/** * plotly.js (gl2d - minified) v1.58.4 * Copyright 2012-2020, Plotly, Inc. * All rights reserved. * Licensed under the MIT license */ !function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).Plotly=t()}}((function(){return function t(e,r,n){function a(o,s){if(!r[o]){if(!e[o]){var l="function"==typeof require&&require;if(!s&&l)return l(o,!0);if(i)return i(o,!0);var u=new Error("Cannot find module '"+o+"'");throw u.code="MODULE_NOT_FOUND",u}var c=r[o]={exports:{}};e[o][0].call(c.exports,(function(t){return a(e[o][1][t]||t)}),c,c.exports,t,e,r,n)}return r[o].exports}for(var i="function"==typeof require&&require,o=0;o:not(.watermark)":"opacity:0;-webkit-transition:opacity 0.3s ease 0s;-moz-transition:opacity 0.3s ease 0s;-ms-transition:opacity 0.3s ease 0s;-o-transition:opacity 0.3s ease 0s;transition:opacity 0.3s ease 0s;","X:hover .modebar--hover .modebar-group":"opacity:1;","X .modebar-group":"float:left;display:inline-block;box-sizing:border-box;padding-left:8px;position:relative;vertical-align:middle;white-space:nowrap;","X .modebar-btn":"position:relative;font-size:16px;padding:3px 4px;height:22px;cursor:pointer;line-height:normal;box-sizing:border-box;","X .modebar-btn svg":"position:relative;top:2px;","X .modebar.vertical":"display:flex;flex-direction:column;flex-wrap:wrap;align-content:flex-end;max-height:100%;","X .modebar.vertical svg":"top:-1px;","X .modebar.vertical .modebar-group":"display:block;float:none;padding-left:0px;padding-bottom:8px;","X .modebar.vertical .modebar-group .modebar-btn":"display:block;text-align:center;","X [data-title]:before,X [data-title]:after":"position:absolute;-webkit-transform:translate3d(0, 0, 0);-moz-transform:translate3d(0, 0, 0);-ms-transform:translate3d(0, 0, 0);-o-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0);display:none;opacity:0;z-index:1001;pointer-events:none;top:110%;right:50%;","X [data-title]:hover:before,X [data-title]:hover:after":"display:block;opacity:1;","X [data-title]:before":"content:'';position:absolute;background:transparent;border:6px solid transparent;z-index:1002;margin-top:-12px;border-bottom-color:#69738a;margin-right:-6px;","X [data-title]:after":"content:attr(data-title);background:#69738a;color:white;padding:8px 10px;font-size:12px;line-height:12px;white-space:nowrap;margin-right:-18px;border-radius:2px;","X .vertical [data-title]:before,X .vertical [data-title]:after":"top:0%;right:200%;","X .vertical [data-title]:before":"border:6px solid transparent;border-left-color:#69738a;margin-top:8px;margin-right:-30px;","X .select-outline":"fill:none;stroke-width:1;shape-rendering:crispEdges;","X .select-outline-1":"stroke:white;","X .select-outline-2":"stroke:black;stroke-dasharray:2px 2px;",Y:"font-family:'Open Sans', verdana, arial, sans-serif;position:fixed;top:50px;right:20px;z-index:10000;font-size:10pt;max-width:180px;","Y p":"margin:0;","Y .notifier-note":"min-width:180px;max-width:250px;border:1px solid #fff;z-index:3000;margin:0;background-color:#8c97af;background-color:rgba(140,151,175,0.9);color:#fff;padding:10px;overflow-wrap:break-word;word-wrap:break-word;-ms-hyphens:auto;-webkit-hyphens:auto;hyphens:auto;","Y .notifier-close":"color:#fff;opacity:0.8;float:right;padding:0 5px;background:none;border:none;font-size:20px;font-weight:bold;line-height:20px;","Y .notifier-close:hover":"color:#444;text-decoration:none;cursor:pointer;"};for(var i in a){var o=i.replace(/^,/," ,").replace(/X/g,".js-plotly-plot .plotly").replace(/Y/g,".plotly-notifier");n.addStyleRule(o,a[i])}},{"../src/lib":498}],2:[function(t,e,r){"use strict";e.exports=t("../src/traces/contourgl")},{"../src/traces/contourgl":615}],3:[function(t,e,r){"use strict";e.exports=t("../src/core")},{"../src/core":477}],4:[function(t,e,r){"use strict";e.exports=t("../src/traces/heatmapgl")},{"../src/traces/heatmapgl":628}],5:[function(t,e,r){"use strict";var n=t("./core");n.register([t("./scattergl"),t("./splom"),t("./pointcloud"),t("./heatmapgl"),t("./contourgl"),t("./parcoords")]),e.exports=n},{"./contourgl":2,"./core":3,"./heatmapgl":4,"./parcoords":6,"./pointcloud":7,"./scattergl":8,"./splom":9}],6:[function(t,e,r){"use strict";e.exports=t("../src/traces/parcoords")},{"../src/traces/parcoords":642}],7:[function(t,e,r){"use strict";e.exports=t("../src/traces/pointcloud")},{"../src/traces/pointcloud":652}],8:[function(t,e,r){"use strict";e.exports=t("../src/traces/scattergl")},{"../src/traces/scattergl":692}],9:[function(t,e,r){"use strict";e.exports=t("../src/traces/splom")},{"../src/traces/splom":703}],10:[function(t,e,r){"use strict";e.exports=t("./quad")},{"./quad":11}],11:[function(t,e,r){"use strict";var n=t("binary-search-bounds"),a=t("clamp"),i=t("parse-rect"),o=t("array-bounds"),s=t("pick-by-alias"),l=t("defined"),u=t("flatten-vertex-data"),c=t("is-obj"),f=t("dtype"),d=t("math-log2");function h(t,e){for(var r=e[0],n=e[1],i=1/(e[2]-r),o=1/(e[3]-n),s=new Array(t.length),l=0,u=t.length/2;l>>1;e.dtype||(e.dtype="array"),"string"==typeof e.dtype?p=new(f(e.dtype))(v):e.dtype&&(p=e.dtype,Array.isArray(p)&&(p.length=v));for(var m=0;mr||s>1073741824){for(var d=0;de+n||w>r+n||A=k||i===o)){var s=y[a];void 0===o&&(o=s.length);for(var l=i;l=p&&c<=v&&f>=g&&f<=m&&E.push(u)}var d=b[a],h=d[4*i+0],x=d[4*i+1],M=d[4*i+2],S=d[4*i+3],O=L(d,i+1),D=.5*n,R=a+1;C(e,r,D,R,h,x||M||S||O),C(e,r+D,D,R,x,M||S||O),C(e+D,r,D,R,M,S||O),C(e+D,r+D,D,R,S,O)}}function L(t,e){for(var r=null,n=0;null===r;)if(r=t[4*e+n],++n>t.length)return null;return r}return C(0,0,1,0,0,1),E},p;function S(t,e,r,a,i){for(var o=[],s=0;sa&&(a=t[o]),t[o] * @license MIT */function a(t,e){if(t===e)return 0;for(var r=t.length,n=e.length,a=0,i=Math.min(r,n);a=0;u--)if(c[u]!==f[u])return!1;for(u=c.length-1;u>=0;u--)if(s=c[u],!b(t[s],e[s],r,n))return!1;return!0}(t,e,r,n))}return r?t===e:t==e}function x(t){return"[object Arguments]"==Object.prototype.toString.call(t)}function _(t,e){if(!t||!e)return!1;if("[object RegExp]"==Object.prototype.toString.call(e))return e.test(t);try{if(t instanceof e)return!0}catch(t){}return!Error.isPrototypeOf(e)&&!0===e.call({},t)}function w(t,e,r,n){var a;if("function"!=typeof e)throw new TypeError('"block" argument must be a function');"string"==typeof r&&(n=r,r=null),a=function(t){var e;try{t()}catch(t){e=t}return e}(e),n=(r&&r.name?" ("+r.name+").":".")+(n?" "+n:"."),t&&!a&&m(a,r,"Missing expected exception"+n);var i="string"==typeof n,s=!t&&a&&!r;if((!t&&o.isError(a)&&i&&_(a,r)||s)&&m(a,r,"Got unwanted exception"+n),t&&a&&r&&!_(a,r)||!t&&a)throw a}d.AssertionError=function(t){this.name="AssertionError",this.actual=t.actual,this.expected=t.expected,this.operator=t.operator,t.message?(this.message=t.message,this.generatedMessage=!1):(this.message=function(t){return g(v(t.actual),128)+" "+t.operator+" "+g(v(t.expected),128)}(this),this.generatedMessage=!0);var e=t.stackStartFunction||m;if(Error.captureStackTrace)Error.captureStackTrace(this,e);else{var r=new Error;if(r.stack){var n=r.stack,a=p(e),i=n.indexOf("\n"+a);if(i>=0){var o=n.indexOf("\n",i+1);n=n.substring(o+1)}this.stack=n}}},o.inherits(d.AssertionError,Error),d.fail=m,d.ok=y,d.equal=function(t,e,r){t!=e&&m(t,e,r,"==",d.equal)},d.notEqual=function(t,e,r){t==e&&m(t,e,r,"!=",d.notEqual)},d.deepEqual=function(t,e,r){b(t,e,!1)||m(t,e,r,"deepEqual",d.deepEqual)},d.deepStrictEqual=function(t,e,r){b(t,e,!0)||m(t,e,r,"deepStrictEqual",d.deepStrictEqual)},d.notDeepEqual=function(t,e,r){b(t,e,!1)&&m(t,e,r,"notDeepEqual",d.notDeepEqual)},d.notDeepStrictEqual=function t(e,r,n){b(e,r,!0)&&m(e,r,n,"notDeepStrictEqual",t)},d.strictEqual=function(t,e,r){t!==e&&m(t,e,r,"===",d.strictEqual)},d.notStrictEqual=function(t,e,r){t===e&&m(t,e,r,"!==",d.notStrictEqual)},d.throws=function(t,e,r){w(!0,t,e,r)},d.doesNotThrow=function(t,e,r){w(!1,t,e,r)},d.ifError=function(t){if(t)throw t},d.strict=n((function t(e,r){e||m(e,!0,r,"==",t)}),d,{equal:d.strictEqual,deepEqual:d.deepStrictEqual,notEqual:d.notStrictEqual,notDeepEqual:d.notDeepStrictEqual}),d.strict.strict=d.strict;var A=Object.keys||function(t){var e=[];for(var r in t)s.call(t,r)&&e.push(r);return e}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"object-assign":262,"util/":20}],18:[function(t,e,r){"function"==typeof Object.create?e.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}},{}],19:[function(t,e,r){e.exports=function(t){return t&&"object"==typeof t&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}},{}],20:[function(t,e,r){(function(e,n){(function(){var a=/%[sdj%]/g;r.format=function(t){if(!m(t)){for(var e=[],r=0;r=i)return t;switch(t){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(t){return"[Circular]"}default:return t}})),l=n[r];r=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),p(e)?n.showHidden=e:e&&r._extend(n,e),y(n.showHidden)&&(n.showHidden=!1),y(n.depth)&&(n.depth=2),y(n.colors)&&(n.colors=!1),y(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=l),c(n,t,n.depth)}function l(t,e){var r=s.styles[e];return r?"\x1b["+s.colors[r][0]+"m"+t+"\x1b["+s.colors[r][1]+"m":t}function u(t,e){return t}function c(t,e,n){if(t.customInspect&&e&&A(e.inspect)&&e.inspect!==r.inspect&&(!e.constructor||e.constructor.prototype!==e)){var a=e.inspect(n,t);return m(a)||(a=c(t,a,n)),a}var i=function(t,e){if(y(e))return t.stylize("undefined","undefined");if(m(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}if(v(e))return t.stylize(""+e,"number");if(p(e))return t.stylize(""+e,"boolean");if(g(e))return t.stylize("null","null")}(t,e);if(i)return i;var o=Object.keys(e),s=function(t){var e={};return t.forEach((function(t,r){e[t]=!0})),e}(o);if(t.showHidden&&(o=Object.getOwnPropertyNames(e)),w(e)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return f(e);if(0===o.length){if(A(e)){var l=e.name?": "+e.name:"";return t.stylize("[Function"+l+"]","special")}if(b(e))return t.stylize(RegExp.prototype.toString.call(e),"regexp");if(_(e))return t.stylize(Date.prototype.toString.call(e),"date");if(w(e))return f(e)}var u,x="",T=!1,k=["{","}"];(h(e)&&(T=!0,k=["[","]"]),A(e))&&(x=" [Function"+(e.name?": "+e.name:"")+"]");return b(e)&&(x=" "+RegExp.prototype.toString.call(e)),_(e)&&(x=" "+Date.prototype.toUTCString.call(e)),w(e)&&(x=" "+f(e)),0!==o.length||T&&0!=e.length?n<0?b(e)?t.stylize(RegExp.prototype.toString.call(e),"regexp"):t.stylize("[Object]","special"):(t.seen.push(e),u=T?function(t,e,r,n,a){for(var i=[],o=0,s=e.length;o=0&&0,t+e.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60)return r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1];return r[0]+e+" "+t.join(", ")+" "+r[1]}(u,x,k)):k[0]+x+k[1]}function f(t){return"["+Error.prototype.toString.call(t)+"]"}function d(t,e,r,n,a,i){var o,s,l;if((l=Object.getOwnPropertyDescriptor(e,a)||{value:e[a]}).get?s=l.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):l.set&&(s=t.stylize("[Setter]","special")),S(n,a)||(o="["+a+"]"),s||(t.seen.indexOf(l.value)<0?(s=g(r)?c(t,l.value,null):c(t,l.value,r-1)).indexOf("\n")>-1&&(s=i?s.split("\n").map((function(t){return" "+t})).join("\n").substr(2):"\n"+s.split("\n").map((function(t){return" "+t})).join("\n")):s=t.stylize("[Circular]","special")),y(o)){if(i&&a.match(/^\d+$/))return s;(o=JSON.stringify(""+a)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.substr(1,o.length-2),o=t.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=t.stylize(o,"string"))}return o+": "+s}function h(t){return Array.isArray(t)}function p(t){return"boolean"==typeof t}function g(t){return null===t}function v(t){return"number"==typeof t}function m(t){return"string"==typeof t}function y(t){return void 0===t}function b(t){return x(t)&&"[object RegExp]"===T(t)}function x(t){return"object"==typeof t&&null!==t}function _(t){return x(t)&&"[object Date]"===T(t)}function w(t){return x(t)&&("[object Error]"===T(t)||t instanceof Error)}function A(t){return"function"==typeof t}function T(t){return Object.prototype.toString.call(t)}function k(t){return t<10?"0"+t.toString(10):t.toString(10)}r.debuglog=function(t){if(y(i)&&(i=e.env.NODE_DEBUG||""),t=t.toUpperCase(),!o[t])if(new RegExp("\\b"+t+"\\b","i").test(i)){var n=e.pid;o[t]=function(){var e=r.format.apply(r,arguments);console.error("%s %d: %s",t,n,e)}}else o[t]=function(){};return o[t]},r.inspect=s,s.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},s.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},r.isArray=h,r.isBoolean=p,r.isNull=g,r.isNullOrUndefined=function(t){return null==t},r.isNumber=v,r.isString=m,r.isSymbol=function(t){return"symbol"==typeof t},r.isUndefined=y,r.isRegExp=b,r.isObject=x,r.isDate=_,r.isError=w,r.isFunction=A,r.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||"undefined"==typeof t},r.isBuffer=t("./support/isBuffer");var M=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function E(){var t=new Date,e=[k(t.getHours()),k(t.getMinutes()),k(t.getSeconds())].join(":");return[t.getDate(),M[t.getMonth()],e].join(" ")}function S(t,e){return Object.prototype.hasOwnProperty.call(t,e)}r.log=function(){console.log("%s - %s",E(),r.format.apply(r,arguments))},r.inherits=t("inherits"),r._extend=function(t,e){if(!e||!x(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t}}).call(this)}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./support/isBuffer":19,_process:285,inherits:18}],21:[function(t,e,r){e.exports=function(t){return atob(t)}},{}],22:[function(t,e,r){"use strict";r.byteLength=function(t){var e=u(t),r=e[0],n=e[1];return 3*(r+n)/4-n},r.toByteArray=function(t){var e,r,n=u(t),o=n[0],s=n[1],l=new i(function(t,e,r){return 3*(e+r)/4-r}(0,o,s)),c=0,f=s>0?o-4:o;for(r=0;r>16&255,l[c++]=e>>8&255,l[c++]=255&e;2===s&&(e=a[t.charCodeAt(r)]<<2|a[t.charCodeAt(r+1)]>>4,l[c++]=255&e);1===s&&(e=a[t.charCodeAt(r)]<<10|a[t.charCodeAt(r+1)]<<4|a[t.charCodeAt(r+2)]>>2,l[c++]=e>>8&255,l[c++]=255&e);return l},r.fromByteArray=function(t){for(var e,r=t.length,a=r%3,i=[],o=0,s=r-a;os?s:o+16383));1===a?(e=t[r-1],i.push(n[e>>2]+n[e<<4&63]+"==")):2===a&&(e=(t[r-2]<<8)+t[r-1],i.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"="));return i.join("")};for(var n=[],a=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,l=o.length;s0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function c(t,e,r){for(var a,i,o=[],s=e;s>18&63]+n[i>>12&63]+n[i>>6&63]+n[63&i]);return o.join("")}a["-".charCodeAt(0)]=62,a["_".charCodeAt(0)]=63},{}],23:[function(t,e,r){"use strict";var n=t("./lib/rationalize");e.exports=function(t,e){return n(t[0].mul(e[1]).add(e[0].mul(t[1])),t[1].mul(e[1]))}},{"./lib/rationalize":33}],24:[function(t,e,r){"use strict";e.exports=function(t,e){return t[0].mul(e[1]).cmp(e[0].mul(t[1]))}},{}],25:[function(t,e,r){"use strict";var n=t("./lib/rationalize");e.exports=function(t,e){return n(t[0].mul(e[1]),t[1].mul(e[0]))}},{"./lib/rationalize":33}],26:[function(t,e,r){"use strict";var n=t("./is-rat"),a=t("./lib/is-bn"),i=t("./lib/num-to-bn"),o=t("./lib/str-to-bn"),s=t("./lib/rationalize"),l=t("./div");e.exports=function t(e,r){if(n(e))return r?l(e,t(r)):[e[0].clone(),e[1].clone()];var u,c,f=0;if(a(e))u=e.clone();else if("string"==typeof e)u=o(e);else{if(0===e)return[i(0),i(1)];if(e===Math.floor(e))u=i(e);else{for(;e!==Math.floor(e);)e*=Math.pow(2,256),f-=256;u=i(e)}}if(n(r))u.mul(r[1]),c=r[0].clone();else if(a(r))c=r.clone();else if("string"==typeof r)c=o(r);else if(r)if(r===Math.floor(r))c=i(r);else{for(;r!==Math.floor(r);)r*=Math.pow(2,256),f+=256;c=i(r)}else c=i(1);f>0?u=u.ushln(f):f<0&&(c=c.ushln(-f));return s(u,c)}},{"./div":25,"./is-rat":27,"./lib/is-bn":31,"./lib/num-to-bn":32,"./lib/rationalize":33,"./lib/str-to-bn":34}],27:[function(t,e,r){"use strict";var n=t("./lib/is-bn");e.exports=function(t){return Array.isArray(t)&&2===t.length&&n(t[0])&&n(t[1])}},{"./lib/is-bn":31}],28:[function(t,e,r){"use strict";var n=t("bn.js");e.exports=function(t){return t.cmp(new n(0))}},{"bn.js":42}],29:[function(t,e,r){"use strict";var n=t("./bn-sign");e.exports=function(t){var e=t.length,r=t.words,a=0;if(1===e)a=r[0];else if(2===e)a=r[0]+67108864*r[1];else for(var i=0;i20)return 52;return r+32}},{"bit-twiddle":40,"double-bits":89}],31:[function(t,e,r){"use strict";t("bn.js");e.exports=function(t){return t&&"object"==typeof t&&Boolean(t.words)}},{"bn.js":42}],32:[function(t,e,r){"use strict";var n=t("bn.js"),a=t("double-bits");e.exports=function(t){var e=a.exponent(t);return e<52?new n(t):new n(t*Math.pow(2,52-e)).ushln(e-52)}},{"bn.js":42,"double-bits":89}],33:[function(t,e,r){"use strict";var n=t("./num-to-bn"),a=t("./bn-sign");e.exports=function(t,e){var r=a(t),i=a(e);if(0===r)return[n(0),n(1)];if(0===i)return[n(0),n(0)];i<0&&(t=t.neg(),e=e.neg());var o=t.gcd(e);if(o.cmpn(1))return[t.div(o),e.div(o)];return[t,e]}},{"./bn-sign":28,"./num-to-bn":32}],34:[function(t,e,r){"use strict";var n=t("bn.js");e.exports=function(t){return new n(t)}},{"bn.js":42}],35:[function(t,e,r){"use strict";var n=t("./lib/rationalize");e.exports=function(t,e){return n(t[0].mul(e[0]),t[1].mul(e[1]))}},{"./lib/rationalize":33}],36:[function(t,e,r){"use strict";var n=t("./lib/bn-sign");e.exports=function(t){return n(t[0])*n(t[1])}},{"./lib/bn-sign":28}],37:[function(t,e,r){"use strict";var n=t("./lib/rationalize");e.exports=function(t,e){return n(t[0].mul(e[1]).sub(t[1].mul(e[0])),t[1].mul(e[1]))}},{"./lib/rationalize":33}],38:[function(t,e,r){"use strict";var n=t("./lib/bn-to-num"),a=t("./lib/ctz");e.exports=function(t){var e=t[0],r=t[1];if(0===e.cmpn(0))return 0;var i=e.abs().divmod(r.abs()),o=i.div,s=n(o),l=i.mod,u=e.negative!==r.negative?-1:1;if(0===l.cmpn(0))return u*s;if(s){var c=a(s)+4,f=n(l.ushln(c).divRound(r));return u*(s+f*Math.pow(2,-c))}var d=r.bitLength()-l.bitLength()+53;f=n(l.ushln(d).divRound(r));return d<1023?u*f*Math.pow(2,-d):(f*=Math.pow(2,-1023),u*f*Math.pow(2,1023-d))}},{"./lib/bn-to-num":29,"./lib/ctz":30}],39:[function(t,e,r){"use strict";function n(t,e,r,n,a){var i=["function ",t,"(a,l,h,",n.join(","),"){",a?"":"var i=",r?"l-1":"h+1",";while(l<=h){var m=(l+h)>>>1,x=a[m]"];return a?e.indexOf("c")<0?i.push(";if(x===y){return m}else if(x<=y){"):i.push(";var p=c(x,y);if(p===0){return m}else if(p<=0){"):i.push(";if(",e,"){i=m;"),r?i.push("l=m+1}else{h=m-1}"):i.push("h=m-1}else{l=m+1}"),i.push("}"),a?i.push("return -1};"):i.push("return i};"),i.join("")}function a(t,e,r,a){return new Function([n("A","x"+t+"y",e,["y"],a),n("P","c(x,y)"+t+"0",e,["y","c"],a),"function dispatchBsearch",r,"(a,y,c,l,h){if(typeof(c)==='function'){return P(a,(l===void 0)?0:l|0,(h===void 0)?a.length-1:h|0,y,c)}else{return A(a,(c===void 0)?0:c|0,(l===void 0)?a.length-1:l|0,y)}}return dispatchBsearch",r].join(""))()}e.exports={ge:a(">=",!1,"GE"),gt:a(">",!1,"GT"),lt:a("<",!0,"LT"),le:a("<=",!0,"LE"),eq:a("-",!0,"EQ",!0)}},{}],40:[function(t,e,r){"use strict";function n(t){var e=32;return(t&=-t)&&e--,65535&t&&(e-=16),16711935&t&&(e-=8),252645135&t&&(e-=4),858993459&t&&(e-=2),1431655765&t&&(e-=1),e}r.INT_BITS=32,r.INT_MAX=2147483647,r.INT_MIN=-1<<31,r.sign=function(t){return(t>0)-(t<0)},r.abs=function(t){var e=t>>31;return(t^e)-e},r.min=function(t,e){return e^(t^e)&-(t65535)<<4,e|=r=((t>>>=e)>255)<<3,e|=r=((t>>>=r)>15)<<2,(e|=r=((t>>>=r)>3)<<1)|(t>>>=r)>>1},r.log10=function(t){return t>=1e9?9:t>=1e8?8:t>=1e7?7:t>=1e6?6:t>=1e5?5:t>=1e4?4:t>=1e3?3:t>=100?2:t>=10?1:0},r.popCount=function(t){return 16843009*((t=(858993459&(t-=t>>>1&1431655765))+(t>>>2&858993459))+(t>>>4)&252645135)>>>24},r.countTrailingZeros=n,r.nextPow2=function(t){return t+=0===t,--t,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)+1},r.prevPow2=function(t){return t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)-(t>>>1)},r.parity=function(t){return t^=t>>>16,t^=t>>>8,t^=t>>>4,27030>>>(t&=15)&1};var a=new Array(256);!function(t){for(var e=0;e<256;++e){var r=e,n=e,a=7;for(r>>>=1;r;r>>>=1)n<<=1,n|=1&r,--a;t[e]=n<>>8&255]<<16|a[t>>>16&255]<<8|a[t>>>24&255]},r.interleave2=function(t,e){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t&=65535)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e&=65535)|e<<8))|e<<4))|e<<2))|e<<1))<<1},r.deinterleave2=function(t,e){return(t=65535&((t=16711935&((t=252645135&((t=858993459&((t=t>>>e&1431655765)|t>>>1))|t>>>2))|t>>>4))|t>>>16))<<16>>16},r.interleave3=function(t,e,r){return t=1227133513&((t=3272356035&((t=251719695&((t=4278190335&((t&=1023)|t<<16))|t<<8))|t<<4))|t<<2),(t|=(e=1227133513&((e=3272356035&((e=251719695&((e=4278190335&((e&=1023)|e<<16))|e<<8))|e<<4))|e<<2))<<1)|(r=1227133513&((r=3272356035&((r=251719695&((r=4278190335&((r&=1023)|r<<16))|r<<8))|r<<4))|r<<2))<<2},r.deinterleave3=function(t,e){return(t=1023&((t=4278190335&((t=251719695&((t=3272356035&((t=t>>>e&1227133513)|t>>>2))|t>>>4))|t>>>8))|t>>>16))<<22>>22},r.nextCombination=function(t){var e=t|t-1;return e+1|(~e&-~e)-1>>>n(t)+1}},{}],41:[function(t,e,r){"use strict";var n=t("clamp");e.exports=function(t,e){e||(e={});var r,o,s,l,u,c,f,d,h,p,g,v=null==e.cutoff?.25:e.cutoff,m=null==e.radius?8:e.radius,y=e.channel||0;if(ArrayBuffer.isView(t)||Array.isArray(t)){if(!e.width||!e.height)throw Error("For raw data width and height should be provided by options");r=e.width,o=e.height,l=t,c=e.stride?e.stride:Math.floor(t.length/r/o)}else window.HTMLCanvasElement&&t instanceof window.HTMLCanvasElement?(f=(d=t).getContext("2d"),r=d.width,o=d.height,h=f.getImageData(0,0,r,o),l=h.data,c=4):window.CanvasRenderingContext2D&&t instanceof window.CanvasRenderingContext2D?(d=t.canvas,f=t,r=d.width,o=d.height,h=f.getImageData(0,0,r,o),l=h.data,c=4):window.ImageData&&t instanceof window.ImageData&&(h=t,r=t.width,o=t.height,l=h.data,c=4);if(s=Math.max(r,o),window.Uint8ClampedArray&&l instanceof window.Uint8ClampedArray||window.Uint8Array&&l instanceof window.Uint8Array)for(u=l,l=Array(r*o),p=0,g=u.length;p=49&&o<=54?o-49+10:o>=17&&o<=22?o-17+10:15&o}return n}function l(t,e,r,n){for(var a=0,i=Math.min(t.length,r),o=e;o=49?s-49+10:s>=17?s-17+10:s}return a}i.isBN=function(t){return t instanceof i||null!==t&&"object"==typeof t&&t.constructor.wordSize===i.wordSize&&Array.isArray(t.words)},i.max=function(t,e){return t.cmp(e)>0?t:e},i.min=function(t,e){return t.cmp(e)<0?t:e},i.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var a=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&a++,16===e?this._parseHex(t,a):this._parseBase(t,e,a),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),e,r)},i.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},i.prototype._initArray=function(t,e,r){if(n("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var a=0;a=0;a-=3)o=t[a]|t[a-1]<<8|t[a-2]<<16,this.words[i]|=o<>>26-s&67108863,(s+=24)>=26&&(s-=26,i++);else if("le"===r)for(a=0,i=0;a>>26-s&67108863,(s+=24)>=26&&(s-=26,i++);return this.strip()},i.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r=e;r-=6)a=s(t,r,r+6),this.words[n]|=a<>>26-i&4194303,(i+=24)>=26&&(i-=26,n++);r+6!==e&&(a=s(t,e,r+6),this.words[n]|=a<>>26-i&4194303),this.strip()},i.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,a=1;a<=67108863;a*=e)n++;n--,a=a/e|0;for(var i=t.length-r,o=i%n,s=Math.min(i,i-o)+r,u=0,c=r;c1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},i.prototype.inspect=function(){return(this.red?""};var u=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],c=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],f=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function d(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var a=0|t.words[0],i=0|e.words[0],o=a*i,s=67108863&o,l=o/67108864|0;r.words[0]=s;for(var u=1;u>>26,f=67108863&l,d=Math.min(u,e.length-1),h=Math.max(0,u-t.length+1);h<=d;h++){var p=u-h|0;c+=(o=(a=0|t.words[p])*(i=0|e.words[h])+f)/67108864|0,f=67108863&o}r.words[u]=0|f,l=0|c}return 0!==l?r.words[u]=0|l:r.length--,r.strip()}i.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var a=0,i=0,o=0;o>>24-a&16777215)||o!==this.length-1?u[6-l.length]+l+r:l+r,(a+=2)>=26&&(a-=26,o--)}for(0!==i&&(r=i.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var d=c[t],h=f[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var g=p.modn(h).toString(t);r=(p=p.idivn(h)).isZero()?g+r:u[d-g.length]+g+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},i.prototype.toJSON=function(){return this.toString(16)},i.prototype.toBuffer=function(t,e){return n("undefined"!=typeof o),this.toArrayLike(o,t,e)},i.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},i.prototype.toArrayLike=function(t,e,r){var a=this.byteLength(),i=r||Math.max(1,a);n(a<=i,"byte array longer than desired length"),n(i>0,"Requested array length <= 0"),this.strip();var o,s,l="le"===e,u=new t(i),c=this.clone();if(l){for(s=0;!c.isZero();s++)o=c.andln(255),c.iushrn(8),u[s]=o;for(;s=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},i.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},i.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},i.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},i.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},i.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},i.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;nt.length?this.clone().ixor(t):t.clone().ixor(this)},i.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},i.prototype.inotn=function(t){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var a=0;a0&&(this.words[a]=~this.words[a]&67108863>>26-r),this.strip()},i.prototype.notn=function(t){return this.clone().inotn(t)},i.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,a=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,n=t):(r=t,n=this);for(var a=0,i=0;i>>26;for(;0!==a&&i>>26;if(this.length=r.length,0!==a)this.words[this.length]=a,this.length++;else if(r!==this)for(;it.length?this.clone().iadd(t):t.clone().iadd(this)},i.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,a=this.cmp(t);if(0===a)return this.negative=0,this.length=1,this.words[0]=0,this;a>0?(r=this,n=t):(r=t,n=this);for(var i=0,o=0;o>26,this.words[o]=67108863&e;for(;0!==i&&o>26,this.words[o]=67108863&e;if(0===i&&o>>13,h=0|o[1],p=8191&h,g=h>>>13,v=0|o[2],m=8191&v,y=v>>>13,b=0|o[3],x=8191&b,_=b>>>13,w=0|o[4],A=8191&w,T=w>>>13,k=0|o[5],M=8191&k,E=k>>>13,S=0|o[6],C=8191&S,L=S>>>13,O=0|o[7],D=8191&O,R=O>>>13,I=0|o[8],P=8191&I,F=I>>>13,z=0|o[9],N=8191&z,B=z>>>13,j=0|s[0],U=8191&j,V=j>>>13,H=0|s[1],G=8191&H,q=H>>>13,X=0|s[2],W=8191&X,Y=X>>>13,Z=0|s[3],J=8191&Z,Q=Z>>>13,$=0|s[4],K=8191&$,tt=$>>>13,et=0|s[5],rt=8191&et,nt=et>>>13,at=0|s[6],it=8191&at,ot=at>>>13,st=0|s[7],lt=8191&st,ut=st>>>13,ct=0|s[8],ft=8191&ct,dt=ct>>>13,ht=0|s[9],pt=8191&ht,gt=ht>>>13;r.negative=t.negative^e.negative,r.length=19;var vt=(u+(n=Math.imul(f,U))|0)+((8191&(a=(a=Math.imul(f,V))+Math.imul(d,U)|0))<<13)|0;u=((i=Math.imul(d,V))+(a>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(p,U),a=(a=Math.imul(p,V))+Math.imul(g,U)|0,i=Math.imul(g,V);var mt=(u+(n=n+Math.imul(f,G)|0)|0)+((8191&(a=(a=a+Math.imul(f,q)|0)+Math.imul(d,G)|0))<<13)|0;u=((i=i+Math.imul(d,q)|0)+(a>>>13)|0)+(mt>>>26)|0,mt&=67108863,n=Math.imul(m,U),a=(a=Math.imul(m,V))+Math.imul(y,U)|0,i=Math.imul(y,V),n=n+Math.imul(p,G)|0,a=(a=a+Math.imul(p,q)|0)+Math.imul(g,G)|0,i=i+Math.imul(g,q)|0;var yt=(u+(n=n+Math.imul(f,W)|0)|0)+((8191&(a=(a=a+Math.imul(f,Y)|0)+Math.imul(d,W)|0))<<13)|0;u=((i=i+Math.imul(d,Y)|0)+(a>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(x,U),a=(a=Math.imul(x,V))+Math.imul(_,U)|0,i=Math.imul(_,V),n=n+Math.imul(m,G)|0,a=(a=a+Math.imul(m,q)|0)+Math.imul(y,G)|0,i=i+Math.imul(y,q)|0,n=n+Math.imul(p,W)|0,a=(a=a+Math.imul(p,Y)|0)+Math.imul(g,W)|0,i=i+Math.imul(g,Y)|0;var bt=(u+(n=n+Math.imul(f,J)|0)|0)+((8191&(a=(a=a+Math.imul(f,Q)|0)+Math.imul(d,J)|0))<<13)|0;u=((i=i+Math.imul(d,Q)|0)+(a>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(A,U),a=(a=Math.imul(A,V))+Math.imul(T,U)|0,i=Math.imul(T,V),n=n+Math.imul(x,G)|0,a=(a=a+Math.imul(x,q)|0)+Math.imul(_,G)|0,i=i+Math.imul(_,q)|0,n=n+Math.imul(m,W)|0,a=(a=a+Math.imul(m,Y)|0)+Math.imul(y,W)|0,i=i+Math.imul(y,Y)|0,n=n+Math.imul(p,J)|0,a=(a=a+Math.imul(p,Q)|0)+Math.imul(g,J)|0,i=i+Math.imul(g,Q)|0;var xt=(u+(n=n+Math.imul(f,K)|0)|0)+((8191&(a=(a=a+Math.imul(f,tt)|0)+Math.imul(d,K)|0))<<13)|0;u=((i=i+Math.imul(d,tt)|0)+(a>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(M,U),a=(a=Math.imul(M,V))+Math.imul(E,U)|0,i=Math.imul(E,V),n=n+Math.imul(A,G)|0,a=(a=a+Math.imul(A,q)|0)+Math.imul(T,G)|0,i=i+Math.imul(T,q)|0,n=n+Math.imul(x,W)|0,a=(a=a+Math.imul(x,Y)|0)+Math.imul(_,W)|0,i=i+Math.imul(_,Y)|0,n=n+Math.imul(m,J)|0,a=(a=a+Math.imul(m,Q)|0)+Math.imul(y,J)|0,i=i+Math.imul(y,Q)|0,n=n+Math.imul(p,K)|0,a=(a=a+Math.imul(p,tt)|0)+Math.imul(g,K)|0,i=i+Math.imul(g,tt)|0;var _t=(u+(n=n+Math.imul(f,rt)|0)|0)+((8191&(a=(a=a+Math.imul(f,nt)|0)+Math.imul(d,rt)|0))<<13)|0;u=((i=i+Math.imul(d,nt)|0)+(a>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(C,U),a=(a=Math.imul(C,V))+Math.imul(L,U)|0,i=Math.imul(L,V),n=n+Math.imul(M,G)|0,a=(a=a+Math.imul(M,q)|0)+Math.imul(E,G)|0,i=i+Math.imul(E,q)|0,n=n+Math.imul(A,W)|0,a=(a=a+Math.imul(A,Y)|0)+Math.imul(T,W)|0,i=i+Math.imul(T,Y)|0,n=n+Math.imul(x,J)|0,a=(a=a+Math.imul(x,Q)|0)+Math.imul(_,J)|0,i=i+Math.imul(_,Q)|0,n=n+Math.imul(m,K)|0,a=(a=a+Math.imul(m,tt)|0)+Math.imul(y,K)|0,i=i+Math.imul(y,tt)|0,n=n+Math.imul(p,rt)|0,a=(a=a+Math.imul(p,nt)|0)+Math.imul(g,rt)|0,i=i+Math.imul(g,nt)|0;var wt=(u+(n=n+Math.imul(f,it)|0)|0)+((8191&(a=(a=a+Math.imul(f,ot)|0)+Math.imul(d,it)|0))<<13)|0;u=((i=i+Math.imul(d,ot)|0)+(a>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(D,U),a=(a=Math.imul(D,V))+Math.imul(R,U)|0,i=Math.imul(R,V),n=n+Math.imul(C,G)|0,a=(a=a+Math.imul(C,q)|0)+Math.imul(L,G)|0,i=i+Math.imul(L,q)|0,n=n+Math.imul(M,W)|0,a=(a=a+Math.imul(M,Y)|0)+Math.imul(E,W)|0,i=i+Math.imul(E,Y)|0,n=n+Math.imul(A,J)|0,a=(a=a+Math.imul(A,Q)|0)+Math.imul(T,J)|0,i=i+Math.imul(T,Q)|0,n=n+Math.imul(x,K)|0,a=(a=a+Math.imul(x,tt)|0)+Math.imul(_,K)|0,i=i+Math.imul(_,tt)|0,n=n+Math.imul(m,rt)|0,a=(a=a+Math.imul(m,nt)|0)+Math.imul(y,rt)|0,i=i+Math.imul(y,nt)|0,n=n+Math.imul(p,it)|0,a=(a=a+Math.imul(p,ot)|0)+Math.imul(g,it)|0,i=i+Math.imul(g,ot)|0;var At=(u+(n=n+Math.imul(f,lt)|0)|0)+((8191&(a=(a=a+Math.imul(f,ut)|0)+Math.imul(d,lt)|0))<<13)|0;u=((i=i+Math.imul(d,ut)|0)+(a>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(P,U),a=(a=Math.imul(P,V))+Math.imul(F,U)|0,i=Math.imul(F,V),n=n+Math.imul(D,G)|0,a=(a=a+Math.imul(D,q)|0)+Math.imul(R,G)|0,i=i+Math.imul(R,q)|0,n=n+Math.imul(C,W)|0,a=(a=a+Math.imul(C,Y)|0)+Math.imul(L,W)|0,i=i+Math.imul(L,Y)|0,n=n+Math.imul(M,J)|0,a=(a=a+Math.imul(M,Q)|0)+Math.imul(E,J)|0,i=i+Math.imul(E,Q)|0,n=n+Math.imul(A,K)|0,a=(a=a+Math.imul(A,tt)|0)+Math.imul(T,K)|0,i=i+Math.imul(T,tt)|0,n=n+Math.imul(x,rt)|0,a=(a=a+Math.imul(x,nt)|0)+Math.imul(_,rt)|0,i=i+Math.imul(_,nt)|0,n=n+Math.imul(m,it)|0,a=(a=a+Math.imul(m,ot)|0)+Math.imul(y,it)|0,i=i+Math.imul(y,ot)|0,n=n+Math.imul(p,lt)|0,a=(a=a+Math.imul(p,ut)|0)+Math.imul(g,lt)|0,i=i+Math.imul(g,ut)|0;var Tt=(u+(n=n+Math.imul(f,ft)|0)|0)+((8191&(a=(a=a+Math.imul(f,dt)|0)+Math.imul(d,ft)|0))<<13)|0;u=((i=i+Math.imul(d,dt)|0)+(a>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(N,U),a=(a=Math.imul(N,V))+Math.imul(B,U)|0,i=Math.imul(B,V),n=n+Math.imul(P,G)|0,a=(a=a+Math.imul(P,q)|0)+Math.imul(F,G)|0,i=i+Math.imul(F,q)|0,n=n+Math.imul(D,W)|0,a=(a=a+Math.imul(D,Y)|0)+Math.imul(R,W)|0,i=i+Math.imul(R,Y)|0,n=n+Math.imul(C,J)|0,a=(a=a+Math.imul(C,Q)|0)+Math.imul(L,J)|0,i=i+Math.imul(L,Q)|0,n=n+Math.imul(M,K)|0,a=(a=a+Math.imul(M,tt)|0)+Math.imul(E,K)|0,i=i+Math.imul(E,tt)|0,n=n+Math.imul(A,rt)|0,a=(a=a+Math.imul(A,nt)|0)+Math.imul(T,rt)|0,i=i+Math.imul(T,nt)|0,n=n+Math.imul(x,it)|0,a=(a=a+Math.imul(x,ot)|0)+Math.imul(_,it)|0,i=i+Math.imul(_,ot)|0,n=n+Math.imul(m,lt)|0,a=(a=a+Math.imul(m,ut)|0)+Math.imul(y,lt)|0,i=i+Math.imul(y,ut)|0,n=n+Math.imul(p,ft)|0,a=(a=a+Math.imul(p,dt)|0)+Math.imul(g,ft)|0,i=i+Math.imul(g,dt)|0;var kt=(u+(n=n+Math.imul(f,pt)|0)|0)+((8191&(a=(a=a+Math.imul(f,gt)|0)+Math.imul(d,pt)|0))<<13)|0;u=((i=i+Math.imul(d,gt)|0)+(a>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(N,G),a=(a=Math.imul(N,q))+Math.imul(B,G)|0,i=Math.imul(B,q),n=n+Math.imul(P,W)|0,a=(a=a+Math.imul(P,Y)|0)+Math.imul(F,W)|0,i=i+Math.imul(F,Y)|0,n=n+Math.imul(D,J)|0,a=(a=a+Math.imul(D,Q)|0)+Math.imul(R,J)|0,i=i+Math.imul(R,Q)|0,n=n+Math.imul(C,K)|0,a=(a=a+Math.imul(C,tt)|0)+Math.imul(L,K)|0,i=i+Math.imul(L,tt)|0,n=n+Math.imul(M,rt)|0,a=(a=a+Math.imul(M,nt)|0)+Math.imul(E,rt)|0,i=i+Math.imul(E,nt)|0,n=n+Math.imul(A,it)|0,a=(a=a+Math.imul(A,ot)|0)+Math.imul(T,it)|0,i=i+Math.imul(T,ot)|0,n=n+Math.imul(x,lt)|0,a=(a=a+Math.imul(x,ut)|0)+Math.imul(_,lt)|0,i=i+Math.imul(_,ut)|0,n=n+Math.imul(m,ft)|0,a=(a=a+Math.imul(m,dt)|0)+Math.imul(y,ft)|0,i=i+Math.imul(y,dt)|0;var Mt=(u+(n=n+Math.imul(p,pt)|0)|0)+((8191&(a=(a=a+Math.imul(p,gt)|0)+Math.imul(g,pt)|0))<<13)|0;u=((i=i+Math.imul(g,gt)|0)+(a>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(N,W),a=(a=Math.imul(N,Y))+Math.imul(B,W)|0,i=Math.imul(B,Y),n=n+Math.imul(P,J)|0,a=(a=a+Math.imul(P,Q)|0)+Math.imul(F,J)|0,i=i+Math.imul(F,Q)|0,n=n+Math.imul(D,K)|0,a=(a=a+Math.imul(D,tt)|0)+Math.imul(R,K)|0,i=i+Math.imul(R,tt)|0,n=n+Math.imul(C,rt)|0,a=(a=a+Math.imul(C,nt)|0)+Math.imul(L,rt)|0,i=i+Math.imul(L,nt)|0,n=n+Math.imul(M,it)|0,a=(a=a+Math.imul(M,ot)|0)+Math.imul(E,it)|0,i=i+Math.imul(E,ot)|0,n=n+Math.imul(A,lt)|0,a=(a=a+Math.imul(A,ut)|0)+Math.imul(T,lt)|0,i=i+Math.imul(T,ut)|0,n=n+Math.imul(x,ft)|0,a=(a=a+Math.imul(x,dt)|0)+Math.imul(_,ft)|0,i=i+Math.imul(_,dt)|0;var Et=(u+(n=n+Math.imul(m,pt)|0)|0)+((8191&(a=(a=a+Math.imul(m,gt)|0)+Math.imul(y,pt)|0))<<13)|0;u=((i=i+Math.imul(y,gt)|0)+(a>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(N,J),a=(a=Math.imul(N,Q))+Math.imul(B,J)|0,i=Math.imul(B,Q),n=n+Math.imul(P,K)|0,a=(a=a+Math.imul(P,tt)|0)+Math.imul(F,K)|0,i=i+Math.imul(F,tt)|0,n=n+Math.imul(D,rt)|0,a=(a=a+Math.imul(D,nt)|0)+Math.imul(R,rt)|0,i=i+Math.imul(R,nt)|0,n=n+Math.imul(C,it)|0,a=(a=a+Math.imul(C,ot)|0)+Math.imul(L,it)|0,i=i+Math.imul(L,ot)|0,n=n+Math.imul(M,lt)|0,a=(a=a+Math.imul(M,ut)|0)+Math.imul(E,lt)|0,i=i+Math.imul(E,ut)|0,n=n+Math.imul(A,ft)|0,a=(a=a+Math.imul(A,dt)|0)+Math.imul(T,ft)|0,i=i+Math.imul(T,dt)|0;var St=(u+(n=n+Math.imul(x,pt)|0)|0)+((8191&(a=(a=a+Math.imul(x,gt)|0)+Math.imul(_,pt)|0))<<13)|0;u=((i=i+Math.imul(_,gt)|0)+(a>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(N,K),a=(a=Math.imul(N,tt))+Math.imul(B,K)|0,i=Math.imul(B,tt),n=n+Math.imul(P,rt)|0,a=(a=a+Math.imul(P,nt)|0)+Math.imul(F,rt)|0,i=i+Math.imul(F,nt)|0,n=n+Math.imul(D,it)|0,a=(a=a+Math.imul(D,ot)|0)+Math.imul(R,it)|0,i=i+Math.imul(R,ot)|0,n=n+Math.imul(C,lt)|0,a=(a=a+Math.imul(C,ut)|0)+Math.imul(L,lt)|0,i=i+Math.imul(L,ut)|0,n=n+Math.imul(M,ft)|0,a=(a=a+Math.imul(M,dt)|0)+Math.imul(E,ft)|0,i=i+Math.imul(E,dt)|0;var Ct=(u+(n=n+Math.imul(A,pt)|0)|0)+((8191&(a=(a=a+Math.imul(A,gt)|0)+Math.imul(T,pt)|0))<<13)|0;u=((i=i+Math.imul(T,gt)|0)+(a>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,n=Math.imul(N,rt),a=(a=Math.imul(N,nt))+Math.imul(B,rt)|0,i=Math.imul(B,nt),n=n+Math.imul(P,it)|0,a=(a=a+Math.imul(P,ot)|0)+Math.imul(F,it)|0,i=i+Math.imul(F,ot)|0,n=n+Math.imul(D,lt)|0,a=(a=a+Math.imul(D,ut)|0)+Math.imul(R,lt)|0,i=i+Math.imul(R,ut)|0,n=n+Math.imul(C,ft)|0,a=(a=a+Math.imul(C,dt)|0)+Math.imul(L,ft)|0,i=i+Math.imul(L,dt)|0;var Lt=(u+(n=n+Math.imul(M,pt)|0)|0)+((8191&(a=(a=a+Math.imul(M,gt)|0)+Math.imul(E,pt)|0))<<13)|0;u=((i=i+Math.imul(E,gt)|0)+(a>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,n=Math.imul(N,it),a=(a=Math.imul(N,ot))+Math.imul(B,it)|0,i=Math.imul(B,ot),n=n+Math.imul(P,lt)|0,a=(a=a+Math.imul(P,ut)|0)+Math.imul(F,lt)|0,i=i+Math.imul(F,ut)|0,n=n+Math.imul(D,ft)|0,a=(a=a+Math.imul(D,dt)|0)+Math.imul(R,ft)|0,i=i+Math.imul(R,dt)|0;var Ot=(u+(n=n+Math.imul(C,pt)|0)|0)+((8191&(a=(a=a+Math.imul(C,gt)|0)+Math.imul(L,pt)|0))<<13)|0;u=((i=i+Math.imul(L,gt)|0)+(a>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,n=Math.imul(N,lt),a=(a=Math.imul(N,ut))+Math.imul(B,lt)|0,i=Math.imul(B,ut),n=n+Math.imul(P,ft)|0,a=(a=a+Math.imul(P,dt)|0)+Math.imul(F,ft)|0,i=i+Math.imul(F,dt)|0;var Dt=(u+(n=n+Math.imul(D,pt)|0)|0)+((8191&(a=(a=a+Math.imul(D,gt)|0)+Math.imul(R,pt)|0))<<13)|0;u=((i=i+Math.imul(R,gt)|0)+(a>>>13)|0)+(Dt>>>26)|0,Dt&=67108863,n=Math.imul(N,ft),a=(a=Math.imul(N,dt))+Math.imul(B,ft)|0,i=Math.imul(B,dt);var Rt=(u+(n=n+Math.imul(P,pt)|0)|0)+((8191&(a=(a=a+Math.imul(P,gt)|0)+Math.imul(F,pt)|0))<<13)|0;u=((i=i+Math.imul(F,gt)|0)+(a>>>13)|0)+(Rt>>>26)|0,Rt&=67108863;var It=(u+(n=Math.imul(N,pt))|0)+((8191&(a=(a=Math.imul(N,gt))+Math.imul(B,pt)|0))<<13)|0;return u=((i=Math.imul(B,gt))+(a>>>13)|0)+(It>>>26)|0,It&=67108863,l[0]=vt,l[1]=mt,l[2]=yt,l[3]=bt,l[4]=xt,l[5]=_t,l[6]=wt,l[7]=At,l[8]=Tt,l[9]=kt,l[10]=Mt,l[11]=Et,l[12]=St,l[13]=Ct,l[14]=Lt,l[15]=Ot,l[16]=Dt,l[17]=Rt,l[18]=It,0!==u&&(l[19]=u,r.length++),r};function p(t,e,r){return(new g).mulp(t,e,r)}function g(t,e){this.x=t,this.y=e}Math.imul||(h=d),i.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?h(this,t,e):r<63?d(this,t,e):r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,a=0,i=0;i>>26)|0)>>>26,o&=67108863}r.words[i]=s,n=o,o=a}return 0!==n?r.words[i]=n:r.length--,r.strip()}(this,t,e):p(this,t,e)},g.prototype.makeRBT=function(t){for(var e=new Array(t),r=i.prototype._countBits(t)-1,n=0;n>=1;return n},g.prototype.permute=function(t,e,r,n,a,i){for(var o=0;o>>=1)a++;return 1<>>=13,r[2*o+1]=8191&i,i>>>=13;for(o=2*e;o>=26,e+=a/67108864|0,e+=i>>>26,this.words[r]=67108863&i}return 0!==e&&(this.words[r]=e,this.length++),this},i.prototype.muln=function(t){return this.clone().imuln(t)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>a}return e}(t);if(0===e.length)return new i(1);for(var r=this,n=0;n=0);var e,r=t%26,a=(t-r)/26,i=67108863>>>26-r<<26-r;if(0!==r){var o=0;for(e=0;e>>26-r}o&&(this.words[e]=o,this.length++)}if(0!==a){for(e=this.length-1;e>=0;e--)this.words[e+a]=this.words[e];for(e=0;e=0),a=e?(e-e%26)/26:0;var i=t%26,o=Math.min((t-i)/26,this.length),s=67108863^67108863>>>i<o)for(this.length-=o,u=0;u=0&&(0!==c||u>=a);u--){var f=0|this.words[u];this.words[u]=c<<26-i|f>>>i,c=f&s}return l&&0!==c&&(l.words[l.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},i.prototype.shln=function(t){return this.clone().ishln(t)},i.prototype.ushln=function(t){return this.clone().iushln(t)},i.prototype.shrn=function(t){return this.clone().ishrn(t)},i.prototype.ushrn=function(t){return this.clone().iushrn(t)},i.prototype.testn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,a=1<=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var a=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},i.prototype.isubn=function(t){if(n("number"==typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(l/67108864|0),this.words[a+r]=67108863&i}for(;a>26,this.words[a+r]=67108863&i;if(0===s)return this.strip();for(n(-1===s),s=0,a=0;a>26,this.words[a]=67108863&i;return this.negative=1,this.strip()},i.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),a=t,o=0|a.words[a.length-1];0!==(r=26-this._countBits(o))&&(a=a.ushln(r),n.iushln(r),o=0|a.words[a.length-1]);var s,l=n.length-a.length;if("mod"!==e){(s=new i(null)).length=l+1,s.words=new Array(s.length);for(var u=0;u=0;f--){var d=67108864*(0|n.words[a.length+f])+(0|n.words[a.length+f-1]);for(d=Math.min(d/o|0,67108863),n._ishlnsubmul(a,d,f);0!==n.negative;)d--,n.negative=0,n._ishlnsubmul(a,1,f),n.isZero()||(n.negative^=1);s&&(s.words[f]=d)}return s&&s.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},i.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===t.negative?(s=this.neg().divmod(t,e),"mod"!==e&&(a=s.div.neg()),"div"!==e&&(o=s.mod.neg(),r&&0!==o.negative&&o.iadd(t)),{div:a,mod:o}):0===this.negative&&0!==t.negative?(s=this.divmod(t.neg(),e),"mod"!==e&&(a=s.div.neg()),{div:a,mod:s.mod}):0!=(this.negative&t.negative)?(s=this.neg().divmod(t.neg(),e),"div"!==e&&(o=s.mod.neg(),r&&0!==o.negative&&o.isub(t)),{div:s.div,mod:o}):t.length>this.length||this.cmp(t)<0?{div:new i(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new i(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new i(this.modn(t.words[0]))}:this._wordDiv(t,e);var a,o,s},i.prototype.div=function(t){return this.divmod(t,"div",!1).div},i.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},i.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},i.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),a=t.andln(1),i=r.cmp(n);return i<0||1===a&&0===i?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},i.prototype.modn=function(t){n(t<=67108863);for(var e=(1<<26)%t,r=0,a=this.length-1;a>=0;a--)r=(e*r+(0|this.words[a]))%t;return r},i.prototype.idivn=function(t){n(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var a=(0|this.words[r])+67108864*e;this.words[r]=a/t|0,e=a%t}return this.strip()},i.prototype.divn=function(t){return this.clone().idivn(t)},i.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var a=new i(1),o=new i(0),s=new i(0),l=new i(1),u=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++u;for(var c=r.clone(),f=e.clone();!e.isZero();){for(var d=0,h=1;0==(e.words[0]&h)&&d<26;++d,h<<=1);if(d>0)for(e.iushrn(d);d-- >0;)(a.isOdd()||o.isOdd())&&(a.iadd(c),o.isub(f)),a.iushrn(1),o.iushrn(1);for(var p=0,g=1;0==(r.words[0]&g)&&p<26;++p,g<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||l.isOdd())&&(s.iadd(c),l.isub(f)),s.iushrn(1),l.iushrn(1);e.cmp(r)>=0?(e.isub(r),a.isub(s),o.isub(l)):(r.isub(e),s.isub(a),l.isub(o))}return{a:s,b:l,gcd:r.iushln(u)}},i.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var a,o=new i(1),s=new i(0),l=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var u=0,c=1;0==(e.words[0]&c)&&u<26;++u,c<<=1);if(u>0)for(e.iushrn(u);u-- >0;)o.isOdd()&&o.iadd(l),o.iushrn(1);for(var f=0,d=1;0==(r.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(r.iushrn(f);f-- >0;)s.isOdd()&&s.iadd(l),s.iushrn(1);e.cmp(r)>=0?(e.isub(r),o.isub(s)):(r.isub(e),s.isub(o))}return(a=0===e.cmpn(1)?o:s).cmpn(0)<0&&a.iadd(t),a},i.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var a=e.cmp(r);if(a<0){var i=e;e=r,r=i}else if(0===a||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},i.prototype.invm=function(t){return this.egcd(t).a.umod(t)},i.prototype.isEven=function(){return 0==(1&this.words[0])},i.prototype.isOdd=function(){return 1==(1&this.words[0])},i.prototype.andln=function(t){return this.words[0]&t},i.prototype.bincn=function(t){n("number"==typeof t);var e=t%26,r=(t-e)/26,a=1<>>26,s&=67108863,this.words[o]=s}return 0!==i&&(this.words[o]=i,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var a=0|this.words[0];e=a===t?0:at.length)return 1;if(this.length=0;r--){var n=0|this.words[r],a=0|t.words[r];if(n!==a){na&&(e=1);break}}return e},i.prototype.gtn=function(t){return 1===this.cmpn(t)},i.prototype.gt=function(t){return 1===this.cmp(t)},i.prototype.gten=function(t){return this.cmpn(t)>=0},i.prototype.gte=function(t){return this.cmp(t)>=0},i.prototype.ltn=function(t){return-1===this.cmpn(t)},i.prototype.lt=function(t){return-1===this.cmp(t)},i.prototype.lten=function(t){return this.cmpn(t)<=0},i.prototype.lte=function(t){return this.cmp(t)<=0},i.prototype.eqn=function(t){return 0===this.cmpn(t)},i.prototype.eq=function(t){return 0===this.cmp(t)},i.red=function(t){return new w(t)},i.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},i.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(t){return this.red=t,this},i.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},i.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},i.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},i.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},i.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},i.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},i.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},i.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},i.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var v={k256:null,p224:null,p192:null,p25519:null};function m(t,e){this.name=t,this.p=new i(e,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){m.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function b(){m.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function x(){m.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){m.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function w(t){if("string"==typeof t){var e=i._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function A(t){w.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new i(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}m.prototype._tmp=function(){var t=new i(null);return t.words=new Array(Math.ceil(this.n/13)),t},m.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var n=e0?r.isub(this.p):r.strip(),r},m.prototype.split=function(t,e){t.iushrn(this.n,0,e)},m.prototype.imulK=function(t){return t.imul(this.k)},a(y,m),y.prototype.split=function(t,e){for(var r=Math.min(t.length,9),n=0;n>>22,a=i}a>>>=22,t.words[n-10]=a,0===a&&t.length>10?t.length-=10:t.length-=9},y.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=a,e=n}return 0!==e&&(t.words[t.length++]=e),t},i._prime=function(t){if(v[t])return v[t];var e;if("k256"===t)e=new y;else if("p224"===t)e=new b;else if("p192"===t)e=new x;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new _}return v[t]=e,e},w.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},w.prototype._verify2=function(t,e){n(0==(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},w.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},w.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},w.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},w.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},w.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},w.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},w.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},w.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},w.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},w.prototype.isqr=function(t){return this.imul(t,t.clone())},w.prototype.sqr=function(t){return this.mul(t,t)},w.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new i(1)).iushrn(2);return this.pow(t,r)}for(var a=this.m.subn(1),o=0;!a.isZero()&&0===a.andln(1);)o++,a.iushrn(1);n(!a.isZero());var s=new i(1).toRed(this),l=s.redNeg(),u=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new i(2*c*c).toRed(this);0!==this.pow(c,u).cmp(l);)c.redIAdd(l);for(var f=this.pow(c,a),d=this.pow(t,a.addn(1).iushrn(1)),h=this.pow(t,a),p=o;0!==h.cmp(s);){for(var g=h,v=0;0!==g.cmp(s);v++)g=g.redSqr();n(v=0;n--){for(var u=e.words[n],c=l-1;c>=0;c--){var f=u>>c&1;a!==r[0]&&(a=this.sqr(a)),0!==f||0!==o?(o<<=1,o|=f,(4===++s||0===n&&0===c)&&(a=this.mul(a,r[o]),s=0,o=0)):s=0}l=26}return a},w.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},w.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},i.mont=function(t){return new A(t)},a(A,w),A.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},A.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},A.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),a=r.isub(n).iushrn(this.shift),i=a;return a.cmp(this.m)>=0?i=a.isub(this.m):a.cmpn(0)<0&&(i=a.iadd(this.m)),i._forceRed(this)},A.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new i(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),a=r.isub(n).iushrn(this.shift),o=a;return a.cmp(this.m)>=0?o=a.isub(this.m):a.cmpn(0)<0&&(o=a.iadd(this.m)),o._forceRed(this)},A.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}("undefined"==typeof e||e,this)},{buffer:50}],43:[function(t,e,r){"use strict";e.exports=function(t,e,r){switch(arguments.length){case 1:return f(t);case 2:return"function"==typeof e?u(t,t,e,!0):d(t,e);case 3:return u(t,e,r,!1);default:throw new Error("box-intersect: Invalid arguments")}};var n,a=t("typedarray-pool"),i=t("./lib/sweep"),o=t("./lib/intersect");function s(t,e){for(var r=0;r>>1;if(!(c<=0)){var f,d=a.mallocDouble(2*c*s),h=a.mallocInt32(s);if((s=l(t,c,d,h))>0){if(1===c&&n)i.init(s),f=i.sweepComplete(c,r,0,s,d,h,0,s,d,h);else{var p=a.mallocDouble(2*c*u),g=a.mallocInt32(u);(u=l(e,c,p,g))>0&&(i.init(s+u),f=1===c?i.sweepBipartite(c,r,0,s,d,h,0,u,p,g):o(c,r,n,s,d,h,u,p,g),a.free(p),a.free(g))}a.free(d),a.free(h)}return f}}}function c(t,e){n.push([t,e])}function f(t){return n=[],u(t,t,c,!0),n}function d(t,e){return n=[],u(t,e,c,!1),n}},{"./lib/intersect":45,"./lib/sweep":49,"typedarray-pool":339}],44:[function(t,e,r){"use strict";var n=["d","ax","vv","rs","re","rb","ri","bs","be","bb","bi"];function a(t){var e="bruteForce"+(t?"Full":"Partial"),r=[],a=n.slice();t||a.splice(3,0,"fp");var i=["function "+e+"("+a.join()+"){"];function o(e,a){var o=function(t,e,r){var a="bruteForce"+(t?"Red":"Blue")+(e?"Flip":"")+(r?"Full":""),i=["function ",a,"(",n.join(),"){","var ","es","=2*","d",";"],o="for(var i=rs,rp=es*rs;ibe-bs){"),t?(o(!0,!1),i.push("}else{"),o(!1,!1)):(i.push("if(fp){"),o(!0,!0),i.push("}else{"),o(!0,!1),i.push("}}else{if(fp){"),o(!1,!0),i.push("}else{"),o(!1,!1),i.push("}")),i.push("}}return "+e);var s=r.join("")+i.join("");return new Function(s)()}r.partial=a(!1),r.full=a(!0)},{}],45:[function(t,e,r){"use strict";e.exports=function(t,e,r,i,c,w,A,T,k){!function(t,e){var r=8*a.log2(e+1)*(t+1)|0,i=a.nextPow2(6*r);m.length0;){var C=6*(E-=1),L=m[C],O=m[C+1],D=m[C+2],R=m[C+3],I=m[C+4],P=m[C+5],F=2*E,z=y[F],N=y[F+1],B=1&P,j=!!(16&P),U=c,V=w,H=T,G=k;if(B&&(U=T,V=k,H=c,G=w),!(2&P&&(D=h(t,L,O,D,U,V,N),O>=D)||4&P&&(O=p(t,L,O,D,U,V,z))>=D)){var q=D-O,X=I-R;if(j){if(t*q*(q+X)<1<<22){if(void 0!==(M=l.scanComplete(t,L,e,O,D,U,V,R,I,H,G)))return M;continue}}else{if(t*Math.min(q,X)<128){if(void 0!==(M=o(t,L,e,B,O,D,U,V,R,I,H,G)))return M;continue}if(t*q*X<1<<22){if(void 0!==(M=l.scanBipartite(t,L,e,B,O,D,U,V,R,I,H,G)))return M;continue}}var W=f(t,L,O,D,U,V,z,N);if(O=p0)&&!(p1>=hi)",["p0","p1"]),d=c("lo===p0",["p0"]),h=c("lo>>1,f=2*t,d=c,h=o[f*c+e];for(;l=y?(d=m,h=y):v>=x?(d=g,h=v):(d=b,h=x):y>=x?(d=m,h=y):x>=v?(d=g,h=v):(d=b,h=x);for(var _=f*(u-1),w=f*d,A=0;Ar&&a[f+e]>u;--c,f-=o){for(var d=f,h=f+o,p=0;p=0&&n.push("lo=e[k+n]");t.indexOf("hi")>=0&&n.push("hi=e[k+o]");return r.push("for(var j=2*a,k=j*c,l=k,m=c,n=b,o=a+b,p=c;d>p;++p,k+=j){var _;if($)if(m===p)m+=1,l+=j;else{for(var s=0;j>s;++s){var t=e[k+s];e[k+s]=e[l],e[l++]=t}var u=f[p];f[p]=f[m],f[m++]=u}}return m".replace("_",n.join()).replace("$",t)),Function.apply(void 0,r)}},{}],48:[function(t,e,r){"use strict";e.exports=function(t,e){e<=128?n(0,e-1,t):function t(e,r,c){var f=(r-e+1)/6|0,d=e+f,h=r-f,p=e+r>>1,g=p-f,v=p+f,m=d,y=g,b=p,x=v,_=h,w=e+1,A=r-1,T=0;l(m,y,c)&&(T=m,m=y,y=T);l(x,_,c)&&(T=x,x=_,_=T);l(m,b,c)&&(T=m,m=b,b=T);l(y,b,c)&&(T=y,y=b,b=T);l(m,x,c)&&(T=m,m=x,x=T);l(b,x,c)&&(T=b,b=x,x=T);l(y,_,c)&&(T=y,y=_,_=T);l(y,b,c)&&(T=y,y=b,b=T);l(x,_,c)&&(T=x,x=_,_=T);for(var k=c[2*y],M=c[2*y+1],E=c[2*x],S=c[2*x+1],C=2*m,L=2*b,O=2*_,D=2*d,R=2*p,I=2*h,P=0;P<2;++P){var F=c[C+P],z=c[L+P],N=c[O+P];c[D+P]=F,c[R+P]=z,c[I+P]=N}i(g,e,c),i(v,r,c);for(var B=w;B<=A;++B)if(u(B,k,M,c))B!==w&&a(B,w,c),++w;else if(!u(B,E,S,c))for(;;){if(u(A,E,S,c)){u(A,k,M,c)?(o(B,w,A,c),++w,--A):(a(B,A,c),--A);break}if(--At;){var u=r[l-2],c=r[l-1];if(ur[e+1])}function u(t,e,r,n){var a=n[t*=2];return a>>1;i(d,M);var E=0,S=0;for(w=0;w=1<<28)h(l,u,S--,C=C-(1<<28)|0);else if(C>=0)h(o,s,E--,C);else if(C<=-(1<<28)){C=-C-(1<<28)|0;for(var L=0;L>>1;i(d,S);var C=0,L=0,O=0;for(T=0;T>1==d[2*T+3]>>1&&(R=2,T+=1),D<0){for(var I=-(D>>1)-1,P=0;P>1)-1;0===R?h(o,s,C--,I):1===R?h(l,u,L--,I):2===R&&h(c,f,O--,I)}}},scanBipartite:function(t,e,r,n,a,l,u,c,f,g,v,m){var y=0,b=2*t,x=e,_=e+t,w=1,A=1;n?A=1<<28:w=1<<28;for(var T=a;T>>1;i(d,S);var C=0;for(T=0;T=1<<28?(O=!n,k-=1<<28):(O=!!n,k-=1),O)p(o,s,C++,k);else{var D=m[k],R=b*k,I=v[R+e+1],P=v[R+e+1+t];t:for(var F=0;F>>1;i(d,w);var A=0;for(y=0;y=1<<28)o[A++]=b-(1<<28);else{var k=h[b-=1],M=g*b,E=f[M+e+1],S=f[M+e+1+t];t:for(var C=0;C=0;--C)if(o[C]===b){for(R=C+1;R0&&o.length>a&&!o.warned){o.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=t,l.type=e,l.count=o.length,s=l,console&&console.warn&&console.warn(s)}return t}function d(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function h(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},a=d.bind(n);return a.listener=r,n.wrapFn=a,a}function p(t,e,r){var n=t._events;if(void 0===n)return[];var a=n[e];return void 0===a?[]:"function"==typeof a?r?[a.listener||a]:[a]:r?function(t){for(var e=new Array(t.length),r=0;r0&&(o=e[0]),o instanceof Error)throw o;var s=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw s.context=o,s}var l=a[t];if(void 0===l)return!1;if("function"==typeof l)i(l,this,e);else{var u=l.length,c=v(l,u);for(r=0;r=0;i--)if(r[i]===e||r[i].listener===e){o=r[i].listener,a=i;break}if(a<0)return this;0===a?r.shift():function(t,e){for(;e+1=0;n--)this.removeListener(t,e[n]);return this},s.prototype.listeners=function(t){return p(this,t,!0)},s.prototype.rawListeners=function(t){return p(this,t,!1)},s.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):g.call(t,e)},s.prototype.listenerCount=g,s.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}},{}],52:[function(t,e,r){(function(e){(function(){ /*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh * @license MIT */ "use strict";var e=t("base64-js"),n=t("ieee754");r.Buffer=i,r.SlowBuffer=function(t){+t!=t&&(t=0);return i.alloc(+t)},r.INSPECT_MAX_BYTES=50;function a(t){if(t>2147483647)throw new RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return e.__proto__=i.prototype,e}function i(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return l(t)}return o(t,e,r)}function o(t,e,r){if("string"==typeof t)return function(t,e){"string"==typeof e&&""!==e||(e="utf8");if(!i.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var r=0|f(t,e),n=a(r),o=n.write(t,e);o!==r&&(n=n.slice(0,o));return n}(t,e);if(ArrayBuffer.isView(t))return u(t);if(null==t)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(N(t,ArrayBuffer)||t&&N(t.buffer,ArrayBuffer))return function(t,e,r){if(e<0||t.byteLength=2147483647)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+2147483647..toString(16)+" bytes");return 0|t}function f(t,e){if(i.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||N(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var a=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return P(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return F(t).length;default:if(a)return n?-1:P(t).length;e=(""+e).toLowerCase(),a=!0}}function d(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return M(this,e,r);case"utf8":case"utf-8":return A(this,e,r);case"ascii":return T(this,e,r);case"latin1":case"binary":return k(this,e,r);case"base64":return w(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function h(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function p(t,e,r,n,a){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),B(r=+r)&&(r=a?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(a)return-1;r=t.length-1}else if(r<0){if(!a)return-1;r=0}if("string"==typeof e&&(e=i.from(e,n)),i.isBuffer(e))return 0===e.length?-1:g(t,e,r,n,a);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?a?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):g(t,[e],r,n,a);throw new TypeError("val must be string, number or Buffer")}function g(t,e,r,n,a){var i,o=1,s=t.length,l=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;o=2,s/=2,l/=2,r/=2}function u(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}if(a){var c=-1;for(i=r;is&&(r=s-l),i=r;i>=0;i--){for(var f=!0,d=0;da&&(n=a):n=a;var i=e.length;n>i/2&&(n=i/2);for(var o=0;o>8,a=r%256,i.push(a),i.push(n);return i}(e,t.length-r),t,r,n)}function w(t,r,n){return 0===r&&n===t.length?e.fromByteArray(t):e.fromByteArray(t.slice(r,n))}function A(t,e,r){r=Math.min(t.length,r);for(var n=[],a=e;a239?4:u>223?3:u>191?2:1;if(a+f<=r)switch(f){case 1:u<128&&(c=u);break;case 2:128==(192&(i=t[a+1]))&&(l=(31&u)<<6|63&i)>127&&(c=l);break;case 3:i=t[a+1],o=t[a+2],128==(192&i)&&128==(192&o)&&(l=(15&u)<<12|(63&i)<<6|63&o)>2047&&(l<55296||l>57343)&&(c=l);break;case 4:i=t[a+1],o=t[a+2],s=t[a+3],128==(192&i)&&128==(192&o)&&128==(192&s)&&(l=(15&u)<<18|(63&i)<<12|(63&o)<<6|63&s)>65535&&l<1114112&&(c=l)}null===c?(c=65533,f=1):c>65535&&(c-=65536,n.push(c>>>10&1023|55296),c=56320|1023&c),n.push(c),a+=f}return function(t){var e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);var r="",n=0;for(;ne&&(t+=" ... "),""},i.prototype.compare=function(t,e,r,n,a){if(N(t,Uint8Array)&&(t=i.from(t,t.offset,t.byteLength)),!i.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===a&&(a=this.length),e<0||r>t.length||n<0||a>this.length)throw new RangeError("out of range index");if(n>=a&&e>=r)return 0;if(n>=a)return-1;if(e>=r)return 1;if(this===t)return 0;for(var o=(a>>>=0)-(n>>>=0),s=(r>>>=0)-(e>>>=0),l=Math.min(o,s),u=this.slice(n,a),c=t.slice(e,r),f=0;f>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var a=this.length-e;if((void 0===r||r>a)&&(r=a),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var i=!1;;)switch(n){case"hex":return v(this,t,e,r);case"utf8":case"utf-8":return m(this,t,e,r);case"ascii":return y(this,t,e,r);case"latin1":case"binary":return b(this,t,e,r);case"base64":return x(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _(this,t,e,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},i.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function T(t,e,r){var n="";r=Math.min(t.length,r);for(var a=e;an)&&(r=n);for(var a="",i=e;ir)throw new RangeError("Trying to access beyond buffer length")}function C(t,e,r,n,a,o){if(!i.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>a||et.length)throw new RangeError("Index out of range")}function L(t,e,r,n,a,i){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function O(t,e,r,a,i){return e=+e,r>>>=0,i||L(t,0,r,4),n.write(t,e,r,a,23,4),r+4}function D(t,e,r,a,i){return e=+e,r>>>=0,i||L(t,0,r,8),n.write(t,e,r,a,52,8),r+8}i.prototype.slice=function(t,e){var r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e>>=0,e>>>=0,r||S(t,e,this.length);for(var n=this[t],a=1,i=0;++i>>=0,e>>>=0,r||S(t,e,this.length);for(var n=this[t+--e],a=1;e>0&&(a*=256);)n+=this[t+--e]*a;return n},i.prototype.readUInt8=function(t,e){return t>>>=0,e||S(t,1,this.length),this[t]},i.prototype.readUInt16LE=function(t,e){return t>>>=0,e||S(t,2,this.length),this[t]|this[t+1]<<8},i.prototype.readUInt16BE=function(t,e){return t>>>=0,e||S(t,2,this.length),this[t]<<8|this[t+1]},i.prototype.readUInt32LE=function(t,e){return t>>>=0,e||S(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},i.prototype.readUInt32BE=function(t,e){return t>>>=0,e||S(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},i.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||S(t,e,this.length);for(var n=this[t],a=1,i=0;++i=(a*=128)&&(n-=Math.pow(2,8*e)),n},i.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||S(t,e,this.length);for(var n=e,a=1,i=this[t+--n];n>0&&(a*=256);)i+=this[t+--n]*a;return i>=(a*=128)&&(i-=Math.pow(2,8*e)),i},i.prototype.readInt8=function(t,e){return t>>>=0,e||S(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},i.prototype.readInt16LE=function(t,e){t>>>=0,e||S(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},i.prototype.readInt16BE=function(t,e){t>>>=0,e||S(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},i.prototype.readInt32LE=function(t,e){return t>>>=0,e||S(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},i.prototype.readInt32BE=function(t,e){return t>>>=0,e||S(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},i.prototype.readFloatLE=function(t,e){return t>>>=0,e||S(t,4,this.length),n.read(this,t,!0,23,4)},i.prototype.readFloatBE=function(t,e){return t>>>=0,e||S(t,4,this.length),n.read(this,t,!1,23,4)},i.prototype.readDoubleLE=function(t,e){return t>>>=0,e||S(t,8,this.length),n.read(this,t,!0,52,8)},i.prototype.readDoubleBE=function(t,e){return t>>>=0,e||S(t,8,this.length),n.read(this,t,!1,52,8)},i.prototype.writeUIntLE=function(t,e,r,n){(t=+t,e>>>=0,r>>>=0,n)||C(this,t,e,r,Math.pow(2,8*r)-1,0);var a=1,i=0;for(this[e]=255&t;++i>>=0,r>>>=0,n)||C(this,t,e,r,Math.pow(2,8*r)-1,0);var a=r-1,i=1;for(this[e+a]=255&t;--a>=0&&(i*=256);)this[e+a]=t/i&255;return e+r},i.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,1,255,0),this[e]=255&t,e+1},i.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},i.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},i.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},i.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},i.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var a=Math.pow(2,8*r-1);C(this,t,e,r,a-1,-a)}var i=0,o=1,s=0;for(this[e]=255&t;++i>0)-s&255;return e+r},i.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var a=Math.pow(2,8*r-1);C(this,t,e,r,a-1,-a)}var i=r-1,o=1,s=0;for(this[e+i]=255&t;--i>=0&&(o*=256);)t<0&&0===s&&0!==this[e+i+1]&&(s=1),this[e+i]=(t/o>>0)-s&255;return e+r},i.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},i.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},i.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},i.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},i.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},i.prototype.writeFloatLE=function(t,e,r){return O(this,t,e,!0,r)},i.prototype.writeFloatBE=function(t,e,r){return O(this,t,e,!1,r)},i.prototype.writeDoubleLE=function(t,e,r){return D(this,t,e,!0,r)},i.prototype.writeDoubleBE=function(t,e,r){return D(this,t,e,!1,r)},i.prototype.copy=function(t,e,r,n){if(!i.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e=0;--o)t[o+e]=this[o+r];else Uint8Array.prototype.set.call(t,this.subarray(r,n),e);return a},i.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!i.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===t.length){var a=t.charCodeAt(0);("utf8"===n&&a<128||"latin1"===n)&&(t=a)}}else"number"==typeof t&&(t&=255);if(e<0||this.length>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(o=e;o55295&&r<57344){if(!a){if(r>56319){(e-=3)>-1&&i.push(239,191,189);continue}if(o+1===n){(e-=3)>-1&&i.push(239,191,189);continue}a=r;continue}if(r<56320){(e-=3)>-1&&i.push(239,191,189),a=r;continue}r=65536+(a-55296<<10|r-56320)}else a&&(e-=3)>-1&&i.push(239,191,189);if(a=null,r<128){if((e-=1)<0)break;i.push(r)}else if(r<2048){if((e-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function F(t){return e.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(R,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function z(t,e,r,n){for(var a=0;a=e.length||a>=t.length);++a)e[a+r]=t[a];return a}function N(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function B(t){return t!=t}}).call(this)}).call(this,t("buffer").Buffer)},{"base64-js":22,buffer:52,ieee754:239}],53:[function(t,e,r){"use strict";var n=t("./lib/monotone"),a=t("./lib/triangulation"),i=t("./lib/delaunay"),o=t("./lib/filter");function s(t){return[Math.min(t[0],t[1]),Math.max(t[0],t[1])]}function l(t,e){return t[0]-e[0]||t[1]-e[1]}function u(t,e,r){return e in t?t[e]:r}e.exports=function(t,e,r){Array.isArray(e)?(r=r||{},e=e||[]):(r=e||{},e=[]);var c=!!u(r,"delaunay",!0),f=!!u(r,"interior",!0),d=!!u(r,"exterior",!0),h=!!u(r,"infinity",!1);if(!f&&!d||0===t.length)return[];var p=n(t,e);if(c||f!==d||h){for(var g=a(t.length,function(t){return t.map(s).sort(l)}(e)),v=0;v0;){for(var h=r.pop(),p=(s=r.pop(),c=-1,f=-1,l=o[s],1);p=0||(e.flip(s,h),a(t,e,r,c,s,f),a(t,e,r,s,f,c),a(t,e,r,f,h,c),a(t,e,r,h,c,f)))}}},{"binary-search-bounds":39,"robust-in-sphere":299}],55:[function(t,e,r){"use strict";var n,a=t("binary-search-bounds");function i(t,e,r,n,a,i,o){this.cells=t,this.neighbor=e,this.flags=n,this.constraint=r,this.active=a,this.next=i,this.boundary=o}function o(t,e){return t[0]-e[0]||t[1]-e[1]||t[2]-e[2]}e.exports=function(t,e,r){var n=function(t,e){for(var r=t.cells(),n=r.length,a=0;a0||l.length>0;){for(;s.length>0;){var h=s.pop();if(u[h]!==-a){u[h]=a;c[h];for(var p=0;p<3;++p){var g=d[3*h+p];g>=0&&0===u[g]&&(f[3*h+p]?l.push(g):(s.push(g),u[g]=a))}}}var v=l;l=s,s=v,l.length=0,a=-a}var m=function(t,e,r){for(var n=0,a=0;a1&&a(r[d[h-2]],r[d[h-1]],i)>0;)t.push([d[h-1],d[h-2],o]),h-=1;d.length=h,d.push(o);var p=f.upperIds;for(h=p.length;h>1&&a(r[p[h-2]],r[p[h-1]],i)<0;)t.push([p[h-2],p[h-1],o]),h-=1;p.length=h,p.push(o)}}function c(t,e){var r;return(r=t.a[0]p[0]&&a.push(new o(p,h,2,l),new o(h,p,1,l))}a.sort(s);for(var g=a[0].a[0]-(1+Math.abs(a[0].a[0]))*Math.pow(2,-52),v=[new i([g,1],[g,0],-1,[],[],[],[])],m=[],y=(l=0,a.length);l=0}}(),i.removeTriangle=function(t,e,r){var n=this.stars;o(n[t],e,r),o(n[e],r,t),o(n[r],t,e)},i.addTriangle=function(t,e,r){var n=this.stars;n[t].push(e,r),n[e].push(r,t),n[r].push(t,e)},i.opposite=function(t,e){for(var r=this.stars[e],n=1,a=r.length;nr?r:t:te?e:t}},{}],59:[function(t,e,r){"use strict";e.exports=function(t,e,r){var n;if(r){n=e;for(var a=new Array(e.length),i=0;ie[2]?1:0)}function m(t,e,r){if(0!==t.length){if(e)for(var n=0;n=0;--i){var b=e[c=(E=n[i])[0]],x=b[0],_=b[1],w=t[x],A=t[_];if((w[0]-A[0]||w[1]-A[1])<0){var T=x;x=_,_=T}b[0]=x;var k,M=b[1]=E[1];for(a&&(k=b[2]);i>0&&n[i-1][0]===c;){var E,S=(E=n[--i])[1];a?e.push([M,S,k]):e.push([M,S]),M=S}a?e.push([M,_,k]):e.push([M,_])}return d}(t,e,d,v,r));return m(e,y,r),!!y||(d.length>0||v.length>0)}},{"./lib/rat-seg-intersect":60,"big-rat":26,"big-rat/cmp":24,"big-rat/to-float":38,"box-intersect":43,nextafter:260,"rat-vec":288,"robust-segment-intersect":303,"union-find":340}],60:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){var i=s(e,t),f=s(n,r),d=c(i,f);if(0===o(d))return null;var h=s(t,r),p=c(f,h),g=a(p,d),v=u(i,g);return l(t,v)};var n=t("big-rat/mul"),a=t("big-rat/div"),i=t("big-rat/sub"),o=t("big-rat/sign"),s=t("rat-vec/sub"),l=t("rat-vec/add"),u=t("rat-vec/muls");function c(t,e){return i(n(t[0],e[1]),n(t[1],e[0]))}},{"big-rat/div":25,"big-rat/mul":35,"big-rat/sign":36,"big-rat/sub":37,"rat-vec/add":287,"rat-vec/muls":289,"rat-vec/sub":290}],61:[function(t,e,r){"use strict";var n=t("clamp");function a(t,e){null==e&&(e=!0);var r=t[0],a=t[1],i=t[2],o=t[3];return null==o&&(o=e?1:255),e&&(r*=255,a*=255,i*=255,o*=255),16777216*(r=255&n(r,0,255))+((a=255&n(a,0,255))<<16)+((i=255&n(i,0,255))<<8)+(o=255&n(o,0,255))}e.exports=a,e.exports.to=a,e.exports.from=function(t,e){var r=(t=+t)>>>24,n=(16711680&t)>>>16,a=(65280&t)>>>8,i=255&t;return!1===e?[r,n,a,i]:[r/255,n/255,a/255,i/255]}},{clamp:58}],62:[function(t,e,r){"use strict";e.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},{}],63:[function(t,e,r){"use strict";var n=t("color-rgba"),a=t("clamp"),i=t("dtype");e.exports=function(t,e){"float"!==e&&e||(e="array"),"uint"===e&&(e="uint8"),"uint_clamped"===e&&(e="uint8_clamped");var r=new(i(e))(4),o="uint8"!==e&&"uint8_clamped"!==e;return t.length&&"string"!=typeof t||((t=n(t))[0]/=255,t[1]/=255,t[2]/=255),function(t){return t instanceof Uint8Array||t instanceof Uint8ClampedArray||!!(Array.isArray(t)&&(t[0]>1||0===t[0])&&(t[1]>1||0===t[1])&&(t[2]>1||0===t[2])&&(!t[3]||t[3]>1))}(t)?(r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=null!=t[3]?t[3]:255,o&&(r[0]/=255,r[1]/=255,r[2]/=255,r[3]/=255),r):(o?(r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=null!=t[3]?t[3]:1):(r[0]=a(Math.floor(255*t[0]),0,255),r[1]=a(Math.floor(255*t[1]),0,255),r[2]=a(Math.floor(255*t[2]),0,255),r[3]=null==t[3]?255:a(Math.floor(255*t[3]),0,255)),r)}},{clamp:58,"color-rgba":65,dtype:91}],64:[function(t,e,r){(function(r){(function(){"use strict";var n=t("color-name"),a=t("is-plain-obj"),i=t("defined");e.exports=function(t){var e,s,l=[],u=1;if("string"==typeof t)if(n[t])l=n[t].slice(),s="rgb";else if("transparent"===t)u=0,s="rgb",l=[0,0,0];else if(/^#[A-Fa-f0-9]+$/.test(t)){var c=(h=t.slice(1)).length;u=1,c<=4?(l=[parseInt(h[0]+h[0],16),parseInt(h[1]+h[1],16),parseInt(h[2]+h[2],16)],4===c&&(u=parseInt(h[3]+h[3],16)/255)):(l=[parseInt(h[0]+h[1],16),parseInt(h[2]+h[3],16),parseInt(h[4]+h[5],16)],8===c&&(u=parseInt(h[6]+h[7],16)/255)),l[0]||(l[0]=0),l[1]||(l[1]=0),l[2]||(l[2]=0),s="rgb"}else if(e=/^((?:rgb|hs[lvb]|hwb|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms)a?)\s*\(([^\)]*)\)/.exec(t)){var f=e[1],d="rgb"===f,h=f.replace(/a$/,"");s=h;c="cmyk"===h?4:"gray"===h?1:3;l=e[2].trim().split(/\s*,\s*/).map((function(t,e){if(/%$/.test(t))return e===c?parseFloat(t)/100:"rgb"===h?255*parseFloat(t)/100:parseFloat(t);if("h"===h[e]){if(/deg$/.test(t))return parseFloat(t);if(void 0!==o[t])return o[t]}return parseFloat(t)})),f===h&&l.push(1),u=d||void 0===l[c]?1:l[c],l=l.slice(0,c)}else t.length>10&&/[0-9](?:\s|\/)/.test(t)&&(l=t.match(/([0-9]+)/g).map((function(t){return parseFloat(t)})),s=t.match(/([a-z])/gi).join("").toLowerCase());else if(isNaN(t))if(a(t)){var p=i(t.r,t.red,t.R,null);null!==p?(s="rgb",l=[p,i(t.g,t.green,t.G),i(t.b,t.blue,t.B)]):(s="hsl",l=[i(t.h,t.hue,t.H),i(t.s,t.saturation,t.S),i(t.l,t.lightness,t.L,t.b,t.brightness)]),u=i(t.a,t.alpha,t.opacity,1),null!=t.opacity&&(u/=100)}else(Array.isArray(t)||r.ArrayBuffer&&ArrayBuffer.isView&&ArrayBuffer.isView(t))&&(l=[t[0],t[1],t[2]],s="rgb",u=4===t.length?t[3]:1);else s="rgb",l=[t>>>16,(65280&t)>>>8,255&t];return{space:s,values:l,alpha:u}};var o={red:0,orange:60,yellow:120,green:180,blue:240,purple:300}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"color-name":62,defined:87,"is-plain-obj":249}],65:[function(t,e,r){"use strict";var n=t("color-parse"),a=t("color-space/hsl"),i=t("clamp");e.exports=function(t){var e,r=n(t);return r.space?((e=Array(3))[0]=i(r.values[0],0,255),e[1]=i(r.values[1],0,255),e[2]=i(r.values[2],0,255),"h"===r.space[0]&&(e=a.rgb(e)),e.push(i(r.alpha,0,1)),e):[]}},{clamp:58,"color-parse":64,"color-space/hsl":66}],66:[function(t,e,r){"use strict";var n=t("./rgb");e.exports={name:"hsl",min:[0,0,0],max:[360,100,100],channel:["hue","saturation","lightness"],alias:["HSL"],rgb:function(t){var e,r,n,a,i,o=t[0]/360,s=t[1]/100,l=t[2]/100;if(0===s)return[i=255*l,i,i];e=2*l-(r=l<.5?l*(1+s):l+s-l*s),a=[0,0,0];for(var u=0;u<3;u++)(n=o+1/3*-(u-1))<0?n++:n>1&&n--,i=6*n<1?e+6*(r-e)*n:2*n<1?r:3*n<2?e+(r-e)*(2/3-n)*6:e,a[u]=255*i;return a}},n.hsl=function(t){var e,r,n=t[0]/255,a=t[1]/255,i=t[2]/255,o=Math.min(n,a,i),s=Math.max(n,a,i),l=s-o;return s===o?e=0:n===s?e=(a-i)/l:a===s?e=2+(i-n)/l:i===s&&(e=4+(n-a)/l),(e=Math.min(60*e,360))<0&&(e+=360),r=(o+s)/2,[e,100*(s===o?0:r<=.5?l/(s+o):l/(2-s-o)),100*r]}},{"./rgb":67}],67:[function(t,e,r){"use strict";e.exports={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]}},{}],68:[function(t,e,r){"use strict";e.exports=function(t,e,r,i){var o=n(e,r,i);if(0===o){var s=a(n(t,e,r)),u=a(n(t,e,i));if(s===u){if(0===s){var c=l(t,e,r),f=l(t,e,i);return c===f?0:c?1:-1}return 0}return 0===u?s>0||l(t,e,i)?-1:1:0===s?u>0||l(t,e,r)?1:-1:a(u-s)}var d=n(t,e,r);return d>0?o>0&&n(t,e,i)>0?1:-1:d<0?o>0||n(t,e,i)>0?1:-1:n(t,e,i)>0||l(t,e,r)?1:-1};var n=t("robust-orientation"),a=t("signum"),i=t("two-sum"),o=t("robust-product"),s=t("robust-sum");function l(t,e,r){var n=i(t[0],-e[0]),a=i(t[1],-e[1]),l=i(r[0],-e[0]),u=i(r[1],-e[1]),c=s(o(n,l),o(a,u));return c[c.length-1]>=0}},{"robust-orientation":300,"robust-product":301,"robust-sum":305,signum:306,"two-sum":327}],69:[function(t,e,r){e.exports=["xx-small","x-small","small","medium","large","x-large","xx-large","larger","smaller"]},{}],70:[function(t,e,r){e.exports=["normal","condensed","semi-condensed","extra-condensed","ultra-condensed","expanded","semi-expanded","extra-expanded","ultra-expanded"]},{}],71:[function(t,e,r){e.exports=["normal","italic","oblique"]},{}],72:[function(t,e,r){e.exports=["normal","bold","bolder","lighter","100","200","300","400","500","600","700","800","900"]},{}],73:[function(t,e,r){"use strict";e.exports={parse:t("./parse"),stringify:t("./stringify")}},{"./parse":75,"./stringify":76}],74:[function(t,e,r){"use strict";var n=t("css-font-size-keywords");e.exports={isSize:function(t){return/^[\d\.]/.test(t)||-1!==t.indexOf("/")||-1!==n.indexOf(t)}}},{"css-font-size-keywords":69}],75:[function(t,e,r){"use strict";var n=t("unquote"),a=t("css-global-keywords"),i=t("css-system-font-keywords"),o=t("css-font-weight-keywords"),s=t("css-font-style-keywords"),l=t("css-font-stretch-keywords"),u=t("string-split-by"),c=t("./lib/util").isSize;e.exports=d;var f=d.cache={};function d(t){if("string"!=typeof t)throw new Error("Font argument must be a string.");if(f[t])return f[t];if(""===t)throw new Error("Cannot parse an empty string.");if(-1!==i.indexOf(t))return f[t]={system:t};for(var e,r={style:"normal",variant:"normal",weight:"normal",stretch:"normal",lineHeight:"normal",size:"1rem",family:["serif"]},d=u(t,/\s+/);e=d.shift();){if(-1!==a.indexOf(e))return["style","variant","weight","stretch"].forEach((function(t){r[t]=e})),f[t]=r;if(-1===s.indexOf(e))if("normal"!==e&&"small-caps"!==e)if(-1===l.indexOf(e)){if(-1===o.indexOf(e)){if(c(e)){var p=u(e,"/");if(r.size=p[0],null!=p[1]?r.lineHeight=h(p[1]):"/"===d[0]&&(d.shift(),r.lineHeight=h(d.shift())),!d.length)throw new Error("Missing required font-family.");return r.family=u(d.join(" "),/\s*,\s*/).map(n),f[t]=r}throw new Error("Unknown or unsupported font token: "+e)}r.weight=e}else r.stretch=e;else r.variant=e;else r.style=e}throw new Error("Missing required font-size.")}function h(t){var e=parseFloat(t);return e.toString()===t?e:t}},{"./lib/util":74,"css-font-stretch-keywords":70,"css-font-style-keywords":71,"css-font-weight-keywords":72,"css-global-keywords":77,"css-system-font-keywords":78,"string-split-by":315,unquote:342}],76:[function(t,e,r){"use strict";var n=t("pick-by-alias"),a=t("./lib/util").isSize,i=g(t("css-global-keywords")),o=g(t("css-system-font-keywords")),s=g(t("css-font-weight-keywords")),l=g(t("css-font-style-keywords")),u=g(t("css-font-stretch-keywords")),c={normal:1,"small-caps":1},f={serif:1,"sans-serif":1,monospace:1,cursive:1,fantasy:1,"system-ui":1},d="1rem",h="serif";function p(t,e){if(t&&!e[t]&&!i[t])throw Error("Unknown keyword `"+t+"`");return t}function g(t){for(var e={},r=0;r0)throw new Error("cwise: pre() block may not reference array args");if(i0)throw new Error("cwise: post() block may not reference array args")}else if("scalar"===o)e.scalarArgs.push(i),e.shimArgs.push("scalar"+i);else if("index"===o){if(e.indexArgs.push(i),i0)throw new Error("cwise: pre() block may not reference array index");if(i0)throw new Error("cwise: post() block may not reference array index")}else if("shape"===o){if(e.shapeArgs.push(i),ir.length)throw new Error("cwise: Too many arguments in pre() block");if(e.body.args.length>r.length)throw new Error("cwise: Too many arguments in body() block");if(e.post.args.length>r.length)throw new Error("cwise: Too many arguments in post() block");return e.debug=!!t.printCode||!!t.debug,e.funcName=t.funcName||"cwise",e.blockSize=t.blockSize||64,n(e)}},{"./lib/thunk.js":81}],80:[function(t,e,r){"use strict";var n=t("uniq");function a(t,e,r){var n,a,i=t.length,o=e.arrayArgs.length,s=e.indexArgs.length>0,l=[],u=[],c=0,f=0;for(n=0;n0&&l.push("var "+u.join(",")),n=i-1;n>=0;--n)c=t[n],l.push(["for(i",n,"=0;i",n,"0&&l.push(["index[",f,"]-=s",f].join("")),l.push(["++index[",c,"]"].join(""))),l.push("}")}return l.join("\n")}function i(t,e,r){for(var n=t.body,a=[],i=[],o=0;o0&&(r=r&&e[n]===e[n-1])}return r?e[0]:e.join("")}e.exports=function(t,e){for(var r=e[1].length-Math.abs(t.arrayBlockIndices[0])|0,s=new Array(t.arrayArgs.length),l=new Array(t.arrayArgs.length),u=0;u0&&b.push("shape=SS.slice(0)"),t.indexArgs.length>0){var x=new Array(r);for(u=0;u0&&y.push("var "+b.join(",")),u=0;u3&&y.push(i(t.pre,t,l));var T=i(t.body,t,l),k=function(t){for(var e=0,r=t[0].length;e0,u=[],c=0;c0;){"].join("")),u.push(["if(j",c,"<",s,"){"].join("")),u.push(["s",e[c],"=j",c].join("")),u.push(["j",c,"=0"].join("")),u.push(["}else{s",e[c],"=",s].join("")),u.push(["j",c,"-=",s,"}"].join("")),l&&u.push(["index[",e[c],"]=j",c].join(""));for(c=0;c3&&y.push(i(t.post,t,l)),t.debug&&console.log("-----Generated cwise routine for ",e,":\n"+y.join("\n")+"\n----------");var M=[t.funcName||"unnamed","_cwise_loop_",s[0].join("s"),"m",k,o(l)].join("");return new Function(["function ",M,"(",m.join(","),"){",y.join("\n"),"} return ",M].join(""))()}},{uniq:341}],81:[function(t,e,r){"use strict";var n=t("./compile.js");e.exports=function(t){var e=["'use strict'","var CACHED={}"],r=[],a=t.funcName+"_cwise_thunk";e.push(["return function ",a,"(",t.shimArgs.join(","),"){"].join(""));for(var i=[],o=[],s=[["array",t.arrayArgs[0],".shape.slice(",Math.max(0,t.arrayBlockIndices[0]),t.arrayBlockIndices[0]<0?","+t.arrayBlockIndices[0]+")":")"].join("")],l=[],u=[],c=0;c0&&(l.push("array"+t.arrayArgs[0]+".shape.length===array"+f+".shape.length+"+(Math.abs(t.arrayBlockIndices[0])-Math.abs(t.arrayBlockIndices[c]))),u.push("array"+t.arrayArgs[0]+".shape[shapeIndex+"+Math.max(0,t.arrayBlockIndices[0])+"]===array"+f+".shape[shapeIndex+"+Math.max(0,t.arrayBlockIndices[c])+"]"))}for(t.arrayArgs.length>1&&(e.push("if (!("+l.join(" && ")+")) throw new Error('cwise: Arrays do not all have the same dimensionality!')"),e.push("for(var shapeIndex=array"+t.arrayArgs[0]+".shape.length-"+Math.abs(t.arrayBlockIndices[0])+"; shapeIndex--\x3e0;) {"),e.push("if (!("+u.join(" && ")+")) throw new Error('cwise: Arrays do not all have the same shape!')"),e.push("}")),c=0;c=12)]},q:function(t){return 1+~~(t.getMonth()/3)},Q:vt,s:mt,S:H,u:G,U:q,V:X,w:W,W:Y,x:null,X:null,y:Z,Y:J,Z:Q,"%":gt},Lt={a:function(t){return f[t.getUTCDay()]},A:function(t){return c[t.getUTCDay()]},b:function(t){return yt[t.getUTCMonth()]},B:function(t){return d[t.getUTCMonth()]},c:null,d:$,e:$,f:nt,H:K,I:tt,j:et,L:rt,m:at,M:it,p:function(t){return u[+(t.getUTCHours()>=12)]},q:function(t){return 1+~~(t.getUTCMonth()/3)},Q:vt,s:mt,S:ot,u:st,U:lt,V:ut,w:ct,W:ft,x:null,X:null,y:dt,Y:ht,Z:pt,"%":gt},Ot={a:function(t,e,r){var n=At.exec(e.slice(r));return n?(t.w=Tt[n[0].toLowerCase()],r+n[0].length):-1},A:function(t,e,r){var n=_t.exec(e.slice(r));return n?(t.w=wt[n[0].toLowerCase()],r+n[0].length):-1},b:function(t,e,r){var n=Et.exec(e.slice(r));return n?(t.m=St[n[0].toLowerCase()],r+n[0].length):-1},B:function(t,e,r){var n=kt.exec(e.slice(r));return n?(t.m=Mt[n[0].toLowerCase()],r+n[0].length):-1},c:function(t,e,r){return It(t,i,e,r)},d:k,e:k,f:O,H:E,I:E,j:M,L:L,m:T,M:S,p:function(t,e,r){var n=bt.exec(e.slice(r));return n?(t.p=xt[n[0].toLowerCase()],r+n[0].length):-1},q:A,Q:R,s:I,S:C,u:v,U:m,V:y,w:g,W:b,x:function(t,e,r){return It(t,o,e,r)},X:function(t,e,r){return It(t,l,e,r)},y:_,Y:x,Z:w,"%":D};function Dt(t,e){return function(r){var n,a,i,o=[],l=-1,u=0,c=t.length;for(r instanceof Date||(r=new Date(+r));++l53)return null;"w"in u||(u.w=1),"Z"in u?(l=(s=n(a(u.y,0,1))).getUTCDay(),s=l>4||0===l?e.utcMonday.ceil(s):e.utcMonday(s),s=e.utcDay.offset(s,7*(u.V-1)),u.y=s.getUTCFullYear(),u.m=s.getUTCMonth(),u.d=s.getUTCDate()+(u.w+6)%7):(l=(s=r(a(u.y,0,1))).getDay(),s=l>4||0===l?e.timeMonday.ceil(s):e.timeMonday(s),s=e.timeDay.offset(s,7*(u.V-1)),u.y=s.getFullYear(),u.m=s.getMonth(),u.d=s.getDate()+(u.w+6)%7)}else("W"in u||"U"in u)&&("w"in u||(u.w="u"in u?u.u%7:"W"in u?1:0),l="Z"in u?n(a(u.y,0,1)).getUTCDay():r(a(u.y,0,1)).getDay(),u.m=0,u.d="W"in u?(u.w+6)%7+7*u.W-(l+5)%7:u.w+7*u.U-(l+6)%7);return"Z"in u?(u.H+=u.Z/100|0,u.M+=u.Z%100,n(u)):r(u)}}function It(t,e,r,n){for(var a,i,o=0,l=e.length,u=r.length;o=u)return-1;if(37===(a=e.charCodeAt(o++))){if(a=e.charAt(o++),!(i=Ot[a in s?e.charAt(o++):a])||(n=i(t,r,n))<0)return-1}else if(a!=r.charCodeAt(n++))return-1}return n}return Ct.x=Dt(o,Ct),Ct.X=Dt(l,Ct),Ct.c=Dt(i,Ct),Lt.x=Dt(o,Lt),Lt.X=Dt(l,Lt),Lt.c=Dt(i,Lt),{format:function(t){var e=Dt(t+="",Ct);return e.toString=function(){return t},e},parse:function(t){var e=Rt(t+="",!1);return e.toString=function(){return t},e},utcFormat:function(t){var e=Dt(t+="",Lt);return e.toString=function(){return t},e},utcParse:function(t){var e=Rt(t+="",!0);return e.toString=function(){return t},e}}}var o,s={"-":"",_:" ",0:"0"},l=/^\s*\d+/,u=/^%/,c=/[\\^$*+?|[\]().{}]/g;function f(t,e,r){var n=t<0?"-":"",a=(n?-t:t)+"",i=a.length;return n+(i68?1900:2e3),r+n[0].length):-1}function w(t,e,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(r,r+6));return n?(t.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function A(t,e,r){var n=l.exec(e.slice(r,r+1));return n?(t.q=3*n[0]-3,r+n[0].length):-1}function T(t,e,r){var n=l.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function k(t,e,r){var n=l.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function M(t,e,r){var n=l.exec(e.slice(r,r+3));return n?(t.m=0,t.d=+n[0],r+n[0].length):-1}function E(t,e,r){var n=l.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function S(t,e,r){var n=l.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function C(t,e,r){var n=l.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function L(t,e,r){var n=l.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function O(t,e,r){var n=l.exec(e.slice(r,r+6));return n?(t.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function D(t,e,r){var n=u.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function R(t,e,r){var n=l.exec(e.slice(r));return n?(t.Q=+n[0],r+n[0].length):-1}function I(t,e,r){var n=l.exec(e.slice(r));return n?(t.s=+n[0],r+n[0].length):-1}function P(t,e){return f(t.getDate(),e,2)}function F(t,e){return f(t.getHours(),e,2)}function z(t,e){return f(t.getHours()%12||12,e,2)}function N(t,r){return f(1+e.timeDay.count(e.timeYear(t),t),r,3)}function B(t,e){return f(t.getMilliseconds(),e,3)}function j(t,e){return B(t,e)+"000"}function U(t,e){return f(t.getMonth()+1,e,2)}function V(t,e){return f(t.getMinutes(),e,2)}function H(t,e){return f(t.getSeconds(),e,2)}function G(t){var e=t.getDay();return 0===e?7:e}function q(t,r){return f(e.timeSunday.count(e.timeYear(t)-1,t),r,2)}function X(t,r){var n=t.getDay();return t=n>=4||0===n?e.timeThursday(t):e.timeThursday.ceil(t),f(e.timeThursday.count(e.timeYear(t),t)+(4===e.timeYear(t).getDay()),r,2)}function W(t){return t.getDay()}function Y(t,r){return f(e.timeMonday.count(e.timeYear(t)-1,t),r,2)}function Z(t,e){return f(t.getFullYear()%100,e,2)}function J(t,e){return f(t.getFullYear()%1e4,e,4)}function Q(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+f(e/60|0,"0",2)+f(e%60,"0",2)}function $(t,e){return f(t.getUTCDate(),e,2)}function K(t,e){return f(t.getUTCHours(),e,2)}function tt(t,e){return f(t.getUTCHours()%12||12,e,2)}function et(t,r){return f(1+e.utcDay.count(e.utcYear(t),t),r,3)}function rt(t,e){return f(t.getUTCMilliseconds(),e,3)}function nt(t,e){return rt(t,e)+"000"}function at(t,e){return f(t.getUTCMonth()+1,e,2)}function it(t,e){return f(t.getUTCMinutes(),e,2)}function ot(t,e){return f(t.getUTCSeconds(),e,2)}function st(t){var e=t.getUTCDay();return 0===e?7:e}function lt(t,r){return f(e.utcSunday.count(e.utcYear(t)-1,t),r,2)}function ut(t,r){var n=t.getUTCDay();return t=n>=4||0===n?e.utcThursday(t):e.utcThursday.ceil(t),f(e.utcThursday.count(e.utcYear(t),t)+(4===e.utcYear(t).getUTCDay()),r,2)}function ct(t){return t.getUTCDay()}function ft(t,r){return f(e.utcMonday.count(e.utcYear(t)-1,t),r,2)}function dt(t,e){return f(t.getUTCFullYear()%100,e,2)}function ht(t,e){return f(t.getUTCFullYear()%1e4,e,4)}function pt(){return"+0000"}function gt(){return"%"}function vt(t){return+t}function mt(t){return Math.floor(+t/1e3)}function yt(e){return o=i(e),t.timeFormat=o.format,t.timeParse=o.parse,t.utcFormat=o.utcFormat,t.utcParse=o.utcParse,o}yt({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});var bt=Date.prototype.toISOString?function(t){return t.toISOString()}:t.utcFormat("%Y-%m-%dT%H:%M:%S.%LZ");var xt=+new Date("2000-01-01T00:00:00.000Z")?function(t){var e=new Date(t);return isNaN(e)?null:e}:t.utcParse("%Y-%m-%dT%H:%M:%S.%LZ");t.isoFormat=bt,t.isoParse=xt,t.timeFormatDefaultLocale=yt,t.timeFormatLocale=i,Object.defineProperty(t,"__esModule",{value:!0})}))},{"d3-time":85}],85:[function(t,e,r){!function(t,n){"object"==typeof r&&"undefined"!=typeof e?n(r):n((t=t||self).d3=t.d3||{})}(this,(function(t){"use strict";var e=new Date,r=new Date;function n(t,a,i,o){function s(e){return t(e=0===arguments.length?new Date:new Date(+e)),e}return s.floor=function(e){return t(e=new Date(+e)),e},s.ceil=function(e){return t(e=new Date(e-1)),a(e,1),t(e),e},s.round=function(t){var e=s(t),r=s.ceil(t);return t-e0))return o;do{o.push(i=new Date(+e)),a(e,n),t(e)}while(i=r)for(;t(r),!e(r);)r.setTime(r-1)}),(function(t,r){if(t>=t)if(r<0)for(;++r<=0;)for(;a(t,-1),!e(t););else for(;--r>=0;)for(;a(t,1),!e(t););}))},i&&(s.count=function(n,a){return e.setTime(+n),r.setTime(+a),t(e),t(r),Math.floor(i(e,r))},s.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?s.filter(o?function(e){return o(e)%t==0}:function(e){return s.count(0,e)%t==0}):s:null}),s}var a=n((function(){}),(function(t,e){t.setTime(+t+e)}),(function(t,e){return e-t}));a.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?n((function(e){e.setTime(Math.floor(e/t)*t)}),(function(e,r){e.setTime(+e+r*t)}),(function(e,r){return(r-e)/t})):a:null};var i=a.range,o=n((function(t){t.setTime(t-t.getMilliseconds())}),(function(t,e){t.setTime(+t+1e3*e)}),(function(t,e){return(e-t)/1e3}),(function(t){return t.getUTCSeconds()})),s=o.range,l=n((function(t){t.setTime(t-t.getMilliseconds()-1e3*t.getSeconds())}),(function(t,e){t.setTime(+t+6e4*e)}),(function(t,e){return(e-t)/6e4}),(function(t){return t.getMinutes()})),u=l.range,c=n((function(t){t.setTime(t-t.getMilliseconds()-1e3*t.getSeconds()-6e4*t.getMinutes())}),(function(t,e){t.setTime(+t+36e5*e)}),(function(t,e){return(e-t)/36e5}),(function(t){return t.getHours()})),f=c.range,d=n((function(t){t.setHours(0,0,0,0)}),(function(t,e){t.setDate(t.getDate()+e)}),(function(t,e){return(e-t-6e4*(e.getTimezoneOffset()-t.getTimezoneOffset()))/864e5}),(function(t){return t.getDate()-1})),h=d.range;function p(t){return n((function(e){e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)}),(function(t,e){t.setDate(t.getDate()+7*e)}),(function(t,e){return(e-t-6e4*(e.getTimezoneOffset()-t.getTimezoneOffset()))/6048e5}))}var g=p(0),v=p(1),m=p(2),y=p(3),b=p(4),x=p(5),_=p(6),w=g.range,A=v.range,T=m.range,k=y.range,M=b.range,E=x.range,S=_.range,C=n((function(t){t.setDate(1),t.setHours(0,0,0,0)}),(function(t,e){t.setMonth(t.getMonth()+e)}),(function(t,e){return e.getMonth()-t.getMonth()+12*(e.getFullYear()-t.getFullYear())}),(function(t){return t.getMonth()})),L=C.range,O=n((function(t){t.setMonth(0,1),t.setHours(0,0,0,0)}),(function(t,e){t.setFullYear(t.getFullYear()+e)}),(function(t,e){return e.getFullYear()-t.getFullYear()}),(function(t){return t.getFullYear()}));O.every=function(t){return isFinite(t=Math.floor(t))&&t>0?n((function(e){e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)}),(function(e,r){e.setFullYear(e.getFullYear()+r*t)})):null};var D=O.range,R=n((function(t){t.setUTCSeconds(0,0)}),(function(t,e){t.setTime(+t+6e4*e)}),(function(t,e){return(e-t)/6e4}),(function(t){return t.getUTCMinutes()})),I=R.range,P=n((function(t){t.setUTCMinutes(0,0,0)}),(function(t,e){t.setTime(+t+36e5*e)}),(function(t,e){return(e-t)/36e5}),(function(t){return t.getUTCHours()})),F=P.range,z=n((function(t){t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCDate(t.getUTCDate()+e)}),(function(t,e){return(e-t)/864e5}),(function(t){return t.getUTCDate()-1})),N=z.range;function B(t){return n((function(e){e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCDate(t.getUTCDate()+7*e)}),(function(t,e){return(e-t)/6048e5}))}var j=B(0),U=B(1),V=B(2),H=B(3),G=B(4),q=B(5),X=B(6),W=j.range,Y=U.range,Z=V.range,J=H.range,Q=G.range,$=q.range,K=X.range,tt=n((function(t){t.setUTCDate(1),t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCMonth(t.getUTCMonth()+e)}),(function(t,e){return e.getUTCMonth()-t.getUTCMonth()+12*(e.getUTCFullYear()-t.getUTCFullYear())}),(function(t){return t.getUTCMonth()})),et=tt.range,rt=n((function(t){t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCFullYear(t.getUTCFullYear()+e)}),(function(t,e){return e.getUTCFullYear()-t.getUTCFullYear()}),(function(t){return t.getUTCFullYear()}));rt.every=function(t){return isFinite(t=Math.floor(t))&&t>0?n((function(e){e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),(function(e,r){e.setUTCFullYear(e.getUTCFullYear()+r*t)})):null};var nt=rt.range;t.timeDay=d,t.timeDays=h,t.timeFriday=x,t.timeFridays=E,t.timeHour=c,t.timeHours=f,t.timeInterval=n,t.timeMillisecond=a,t.timeMilliseconds=i,t.timeMinute=l,t.timeMinutes=u,t.timeMonday=v,t.timeMondays=A,t.timeMonth=C,t.timeMonths=L,t.timeSaturday=_,t.timeSaturdays=S,t.timeSecond=o,t.timeSeconds=s,t.timeSunday=g,t.timeSundays=w,t.timeThursday=b,t.timeThursdays=M,t.timeTuesday=m,t.timeTuesdays=T,t.timeWednesday=y,t.timeWednesdays=k,t.timeWeek=g,t.timeWeeks=w,t.timeYear=O,t.timeYears=D,t.utcDay=z,t.utcDays=N,t.utcFriday=q,t.utcFridays=$,t.utcHour=P,t.utcHours=F,t.utcMillisecond=a,t.utcMilliseconds=i,t.utcMinute=R,t.utcMinutes=I,t.utcMonday=U,t.utcMondays=Y,t.utcMonth=tt,t.utcMonths=et,t.utcSaturday=X,t.utcSaturdays=K,t.utcSecond=o,t.utcSeconds=s,t.utcSunday=j,t.utcSundays=W,t.utcThursday=G,t.utcThursdays=Q,t.utcTuesday=V,t.utcTuesdays=Z,t.utcWednesday=H,t.utcWednesdays=J,t.utcWeek=j,t.utcWeeks=W,t.utcYear=rt,t.utcYears=nt,Object.defineProperty(t,"__esModule",{value:!0})}))},{}],86:[function(t,e,r){!function(){var t={version:"3.5.17"},r=[].slice,n=function(t){return r.call(t)},a=this.document;function i(t){return t&&(t.ownerDocument||t.document||t).documentElement}function o(t){return t&&(t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView)}if(a)try{n(a.documentElement.childNodes)[0].nodeType}catch(t){n=function(t){for(var e=t.length,r=new Array(e);e--;)r[e]=t[e];return r}}if(Date.now||(Date.now=function(){return+new Date}),a)try{a.createElement("DIV").style.setProperty("opacity",0,"")}catch(t){var s=this.Element.prototype,l=s.setAttribute,u=s.setAttributeNS,c=this.CSSStyleDeclaration.prototype,f=c.setProperty;s.setAttribute=function(t,e){l.call(this,t,e+"")},s.setAttributeNS=function(t,e,r){u.call(this,t,e,r+"")},c.setProperty=function(t,e,r){f.call(this,t,e+"",r)}}function d(t,e){return te?1:t>=e?0:NaN}function h(t){return null===t?NaN:+t}function p(t){return!isNaN(t)}function g(t){return{left:function(e,r,n,a){for(arguments.length<3&&(n=0),arguments.length<4&&(a=e.length);n>>1;t(e[i],r)<0?n=i+1:a=i}return n},right:function(e,r,n,a){for(arguments.length<3&&(n=0),arguments.length<4&&(a=e.length);n>>1;t(e[i],r)>0?a=i:n=i+1}return n}}}t.ascending=d,t.descending=function(t,e){return et?1:e>=t?0:NaN},t.min=function(t,e){var r,n,a=-1,i=t.length;if(1===arguments.length){for(;++a=n){r=n;break}for(;++an&&(r=n)}else{for(;++a=n){r=n;break}for(;++an&&(r=n)}return r},t.max=function(t,e){var r,n,a=-1,i=t.length;if(1===arguments.length){for(;++a=n){r=n;break}for(;++ar&&(r=n)}else{for(;++a=n){r=n;break}for(;++ar&&(r=n)}return r},t.extent=function(t,e){var r,n,a,i=-1,o=t.length;if(1===arguments.length){for(;++i=n){r=a=n;break}for(;++in&&(r=n),a=n){r=a=n;break}for(;++in&&(r=n),a1)return o/(l-1)},t.deviation=function(){var e=t.variance.apply(this,arguments);return e?Math.sqrt(e):e};var v=g(d);function m(t){return t.length}t.bisectLeft=v.left,t.bisect=t.bisectRight=v.right,t.bisector=function(t){return g(1===t.length?function(e,r){return d(t(e),r)}:t)},t.shuffle=function(t,e,r){(i=arguments.length)<3&&(r=t.length,i<2&&(e=0));for(var n,a,i=r-e;i;)a=Math.random()*i--|0,n=t[i+e],t[i+e]=t[a+e],t[a+e]=n;return t},t.permute=function(t,e){for(var r=e.length,n=new Array(r);r--;)n[r]=t[e[r]];return n},t.pairs=function(t){for(var e=0,r=t.length-1,n=t[0],a=new Array(r<0?0:r);e=0;)for(e=(n=t[a]).length;--e>=0;)r[--o]=n[e];return r};var y=Math.abs;function b(t){for(var e=1;t*e%1;)e*=10;return e}function x(t,e){for(var r in e)Object.defineProperty(t.prototype,r,{value:e[r],enumerable:!1})}function _(){this._=Object.create(null)}t.range=function(t,e,r){if(arguments.length<3&&(r=1,arguments.length<2&&(e=t,t=0)),(e-t)/r==1/0)throw new Error("infinite range");var n,a=[],i=b(y(r)),o=-1;if(t*=i,e*=i,(r*=i)<0)for(;(n=t+r*++o)>e;)a.push(n/i);else for(;(n=t+r*++o)=a.length)return r?r.call(n,i):e?i.sort(e):i;for(var l,u,c,f,d=-1,h=i.length,p=a[s++],g=new _;++d=a.length)return e;var n=[],o=i[r++];return e.forEach((function(e,a){n.push({key:e,values:t(a,r)})})),o?n.sort((function(t,e){return o(t.key,e.key)})):n}(o(t.map,e,0),0)},n.key=function(t){return a.push(t),n},n.sortKeys=function(t){return i[a.length-1]=t,n},n.sortValues=function(t){return e=t,n},n.rollup=function(t){return r=t,n},n},t.set=function(t){var e=new C;if(t)for(var r=0,n=t.length;r=0&&(n=t.slice(r+1),t=t.slice(0,r)),t)return arguments.length<2?this[t].on(n):this[t].on(n,e);if(2===arguments.length){if(null==e)for(t in this)this.hasOwnProperty(t)&&this[t].on(n,null);return this}},t.event=null,t.requote=function(t){return t.replace(j,"\\$&")};var j=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,U={}.__proto__?function(t,e){t.__proto__=e}:function(t,e){for(var r in e)t[r]=e[r]};function V(t){return U(t,X),t}var H=function(t,e){return e.querySelector(t)},G=function(t,e){return e.querySelectorAll(t)},q=function(t,e){var r=t.matches||t[D(t,"matchesSelector")];return(q=function(t,e){return r.call(t,e)})(t,e)};"function"==typeof Sizzle&&(H=function(t,e){return Sizzle(t,e)[0]||null},G=Sizzle,q=Sizzle.matchesSelector),t.selection=function(){return t.select(a.documentElement)};var X=t.selection.prototype=[];function W(t){return"function"==typeof t?t:function(){return H(t,this)}}function Y(t){return"function"==typeof t?t:function(){return G(t,this)}}X.select=function(t){var e,r,n,a,i=[];t=W(t);for(var o=-1,s=this.length;++o=0&&"xmlns"!==(r=t.slice(0,e))&&(t=t.slice(e+1)),J.hasOwnProperty(r)?{space:J[r],local:t}:t}},X.attr=function(e,r){if(arguments.length<2){if("string"==typeof e){var n=this.node();return(e=t.ns.qualify(e)).local?n.getAttributeNS(e.space,e.local):n.getAttribute(e)}for(r in e)this.each(Q(r,e[r]));return this}return this.each(Q(e,r))},X.classed=function(t,e){if(arguments.length<2){if("string"==typeof t){var r=this.node(),n=(t=tt(t)).length,a=-1;if(e=r.classList){for(;++a=0;)(r=n[a])&&(i&&i!==r.nextSibling&&i.parentNode.insertBefore(r,i),i=r);return this},X.sort=function(t){t=ut.apply(this,arguments);for(var e=-1,r=this.length;++e=e&&(e=a+1);!(o=s[e])&&++e0&&(e=e.slice(0,o));var l=gt.get(e);function u(){var t=this[i];t&&(this.removeEventListener(e,t,t.$),delete this[i])}return l&&(e=l,s=mt),o?r?function(){var t=s(r,n(arguments));u.call(this),this.addEventListener(e,this[i]=t,t.$=a),t._=r}:u:r?I:function(){var r,n=new RegExp("^__on([^.]+)"+t.requote(e)+"$");for(var a in this)if(r=a.match(n)){var i=this[a];this.removeEventListener(r[1],i,i.$),delete this[a]}}}t.selection.enter=ft,t.selection.enter.prototype=dt,dt.append=X.append,dt.empty=X.empty,dt.node=X.node,dt.call=X.call,dt.size=X.size,dt.select=function(t){for(var e,r,n,a,i,o=[],s=-1,l=this.length;++s0?1:t<0?-1:0}function Rt(t,e,r){return(e[0]-t[0])*(r[1]-t[1])-(e[1]-t[1])*(r[0]-t[0])}function It(t){return t>1?0:t<-1?Mt:Math.acos(t)}function Pt(t){return t>1?Ct:t<-1?-Ct:Math.asin(t)}function Ft(t){return((t=Math.exp(t))+1/t)/2}function zt(t){return(t=Math.sin(t/2))*t}var Nt=Math.SQRT2;t.interpolateZoom=function(t,e){var r,n,a=t[0],i=t[1],o=t[2],s=e[0],l=e[1],u=e[2],c=s-a,f=l-i,d=c*c+f*f;if(d0&&(e=e.transition().duration(g)),e.call(w.event)}function E(){u&&u.domain(l.range().map((function(t){return(t-d.x)/d.k})).map(l.invert)),f&&f.domain(c.range().map((function(t){return(t-d.y)/d.k})).map(c.invert))}function S(t){v++||t({type:"zoomstart"})}function C(t){E(),t({type:"zoom",scale:d.k,translate:[d.x,d.y]})}function L(t){--v||(t({type:"zoomend"}),r=null)}function O(){var e=this,r=_.of(e,arguments),n=0,a=t.select(o(e)).on(y,l).on(b,u),i=A(t.mouse(e)),s=xt(e);function l(){n=1,k(t.mouse(e),i),C(r)}function u(){a.on(y,null).on(b,null),s(n),L(r)}ms.call(e),S(r)}function D(){var e,r=this,n=_.of(r,arguments),a={},i=0,o=".zoom-"+t.event.changedTouches[0].identifier,l="touchmove"+o,u="touchend"+o,c=[],f=t.select(r),h=xt(r);function p(){var n=t.touches(r);return e=d.k,n.forEach((function(t){t.identifier in a&&(a[t.identifier]=A(t))})),n}function g(){var e=t.event.target;t.select(e).on(l,v).on(u,y),c.push(e);for(var n=t.event.changedTouches,o=0,f=n.length;o1){m=h[0];var b=h[1],x=m[0]-b[0],_=m[1]-b[1];i=x*x+_*_}}function v(){var o,l,u,c,f=t.touches(r);ms.call(r);for(var d=0,h=f.length;d360?t-=360:t<0&&(t+=360),t<60?n+(a-n)*t/60:t<180?a:t<240?n+(a-n)*(240-t)/60:n}(t))}return t=isNaN(t)?0:(t%=360)<0?t+360:t,e=isNaN(e)||e<0?0:e>1?1:e,n=2*(r=r<0?0:r>1?1:r)-(a=r<=.5?r*(1+e):r+e-r*e),new ne(i(t+120),i(t),i(t-120))}function Xt(e,r,n){return this instanceof Xt?(this.h=+e,this.c=+r,void(this.l=+n)):arguments.length<2?e instanceof Xt?new Xt(e.h,e.c,e.l):Kt(e instanceof Zt?e.l:(e=ce((e=t.rgb(e)).r,e.g,e.b)).l,e.a,e.b):new Xt(e,r,n)}Gt.brighter=function(t){return t=Math.pow(.7,arguments.length?t:1),new Ht(this.h,this.s,this.l/t)},Gt.darker=function(t){return t=Math.pow(.7,arguments.length?t:1),new Ht(this.h,this.s,t*this.l)},Gt.rgb=function(){return qt(this.h,this.s,this.l)},t.hcl=Xt;var Wt=Xt.prototype=new Vt;function Yt(t,e,r){return isNaN(t)&&(t=0),isNaN(e)&&(e=0),new Zt(r,Math.cos(t*=Lt)*e,Math.sin(t)*e)}function Zt(t,e,r){return this instanceof Zt?(this.l=+t,this.a=+e,void(this.b=+r)):arguments.length<2?t instanceof Zt?new Zt(t.l,t.a,t.b):t instanceof Xt?Yt(t.h,t.c,t.l):ce((t=ne(t)).r,t.g,t.b):new Zt(t,e,r)}Wt.brighter=function(t){return new Xt(this.h,this.c,Math.min(100,this.l+Jt*(arguments.length?t:1)))},Wt.darker=function(t){return new Xt(this.h,this.c,Math.max(0,this.l-Jt*(arguments.length?t:1)))},Wt.rgb=function(){return Yt(this.h,this.c,this.l).rgb()},t.lab=Zt;var Jt=18,Qt=Zt.prototype=new Vt;function $t(t,e,r){var n=(t+16)/116,a=n+e/500,i=n-r/200;return new ne(re(3.2404542*(a=.95047*te(a))-1.5371385*(n=1*te(n))-.4985314*(i=1.08883*te(i))),re(-.969266*a+1.8760108*n+.041556*i),re(.0556434*a-.2040259*n+1.0572252*i))}function Kt(t,e,r){return t>0?new Xt(Math.atan2(r,e)*Ot,Math.sqrt(e*e+r*r),t):new Xt(NaN,NaN,t)}function te(t){return t>.206893034?t*t*t:(t-4/29)/7.787037}function ee(t){return t>.008856?Math.pow(t,1/3):7.787037*t+4/29}function re(t){return Math.round(255*(t<=.00304?12.92*t:1.055*Math.pow(t,1/2.4)-.055))}function ne(t,e,r){return this instanceof ne?(this.r=~~t,this.g=~~e,void(this.b=~~r)):arguments.length<2?t instanceof ne?new ne(t.r,t.g,t.b):le(""+t,ne,qt):new ne(t,e,r)}function ae(t){return new ne(t>>16,t>>8&255,255&t)}function ie(t){return ae(t)+""}Qt.brighter=function(t){return new Zt(Math.min(100,this.l+Jt*(arguments.length?t:1)),this.a,this.b)},Qt.darker=function(t){return new Zt(Math.max(0,this.l-Jt*(arguments.length?t:1)),this.a,this.b)},Qt.rgb=function(){return $t(this.l,this.a,this.b)},t.rgb=ne;var oe=ne.prototype=new Vt;function se(t){return t<16?"0"+Math.max(0,t).toString(16):Math.min(255,t).toString(16)}function le(t,e,r){var n,a,i,o=0,s=0,l=0;if(n=/([a-z]+)\((.*)\)/.exec(t=t.toLowerCase()))switch(a=n[2].split(","),n[1]){case"hsl":return r(parseFloat(a[0]),parseFloat(a[1])/100,parseFloat(a[2])/100);case"rgb":return e(de(a[0]),de(a[1]),de(a[2]))}return(i=he.get(t))?e(i.r,i.g,i.b):(null==t||"#"!==t.charAt(0)||isNaN(i=parseInt(t.slice(1),16))||(4===t.length?(o=(3840&i)>>4,o|=o>>4,s=240&i,s|=s>>4,l=15&i,l|=l<<4):7===t.length&&(o=(16711680&i)>>16,s=(65280&i)>>8,l=255&i)),e(o,s,l))}function ue(t,e,r){var n,a,i=Math.min(t/=255,e/=255,r/=255),o=Math.max(t,e,r),s=o-i,l=(o+i)/2;return s?(a=l<.5?s/(o+i):s/(2-o-i),n=t==o?(e-r)/s+(e0&&l<1?0:n),new Ht(n,a,l)}function ce(t,e,r){var n=ee((.4124564*(t=fe(t))+.3575761*(e=fe(e))+.1804375*(r=fe(r)))/.95047),a=ee((.2126729*t+.7151522*e+.072175*r)/1);return Zt(116*a-16,500*(n-a),200*(a-ee((.0193339*t+.119192*e+.9503041*r)/1.08883)))}function fe(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function de(t){var e=parseFloat(t);return"%"===t.charAt(t.length-1)?Math.round(2.55*e):e}oe.brighter=function(t){t=Math.pow(.7,arguments.length?t:1);var e=this.r,r=this.g,n=this.b,a=30;return e||r||n?(e&&e=200&&e<300||304===e){try{t=a.call(o,u)}catch(t){return void s.error.call(o,t)}s.load.call(o,t)}else s.error.call(o,u)}return this.XDomainRequest&&!("withCredentials"in u)&&/^(http(s)?:)?\/\//.test(e)&&(u=new XDomainRequest),"onload"in u?u.onload=u.onerror=f:u.onreadystatechange=function(){u.readyState>3&&f()},u.onprogress=function(e){var r=t.event;t.event=e;try{s.progress.call(o,u)}finally{t.event=r}},o.header=function(t,e){return t=(t+"").toLowerCase(),arguments.length<2?l[t]:(null==e?delete l[t]:l[t]=e+"",o)},o.mimeType=function(t){return arguments.length?(r=null==t?null:t+"",o):r},o.responseType=function(t){return arguments.length?(c=t,o):c},o.response=function(t){return a=t,o},["get","post"].forEach((function(t){o[t]=function(){return o.send.apply(o,[t].concat(n(arguments)))}})),o.send=function(t,n,a){if(2===arguments.length&&"function"==typeof n&&(a=n,n=null),u.open(t,e,!0),null==r||"accept"in l||(l.accept=r+",*/*"),u.setRequestHeader)for(var i in l)u.setRequestHeader(i,l[i]);return null!=r&&u.overrideMimeType&&u.overrideMimeType(r),null!=c&&(u.responseType=c),null!=a&&o.on("error",a).on("load",(function(t){a(null,t)})),s.beforesend.call(o,u),u.send(null==n?null:n),o},o.abort=function(){return u.abort(),o},t.rebind(o,s,"on"),null==i?o:o.get(function(t){return 1===t.length?function(e,r){t(null==e?r:null)}:t}(i))}he.forEach((function(t,e){he.set(t,ae(e))})),t.functor=pe,t.xhr=ge(L),t.dsv=function(t,e){var r=new RegExp('["'+t+"\n]"),n=t.charCodeAt(0);function a(t,r,n){arguments.length<3&&(n=r,r=null);var a=ve(t,e,null==r?i:o(r),n);return a.row=function(t){return arguments.length?a.response(null==(r=t)?i:o(t)):r},a}function i(t){return a.parse(t.responseText)}function o(t){return function(e){return a.parse(e.responseText,t)}}function s(e){return e.map(l).join(t)}function l(t){return r.test(t)?'"'+t.replace(/\"/g,'""')+'"':t}return a.parse=function(t,e){var r;return a.parseRows(t,(function(t,n){if(r)return r(t,n-1);var a=new Function("d","return {"+t.map((function(t,e){return JSON.stringify(t)+": d["+e+"]"})).join(",")+"}");r=e?function(t,r){return e(a(t),r)}:a}))},a.parseRows=function(t,e){var r,a,i={},o={},s=[],l=t.length,u=0,c=0;function f(){if(u>=l)return o;if(a)return a=!1,i;var e=u;if(34===t.charCodeAt(e)){for(var r=e;r++24?(isFinite(e)&&(clearTimeout(xe),xe=setTimeout(Ae,e)),be=0):(be=1,_e(Ae))}function Te(){for(var t=Date.now(),e=me;e;)t>=e.t&&e.c(t-e.t)&&(e.c=null),e=e.n;return t}function ke(){for(var t,e=me,r=1/0;e;)e.c?(e.t8?function(t){return t/r}:function(t){return t*r},symbol:t}}));function Se(e){var r=e.decimal,n=e.thousands,a=e.grouping,i=e.currency,o=a&&n?function(t,e){for(var r=t.length,i=[],o=0,s=a[0],l=0;r>0&&s>0&&(l+s+1>e&&(s=Math.max(1,e-l)),i.push(t.substring(r-=s,r+s)),!((l+=s+1)>e));)s=a[o=(o+1)%a.length];return i.reverse().join(n)}:L;return function(e){var n=Ce.exec(e),a=n[1]||" ",s=n[2]||">",l=n[3]||"-",u=n[4]||"",c=n[5],f=+n[6],d=n[7],h=n[8],p=n[9],g=1,v="",m="",y=!1,b=!0;switch(h&&(h=+h.substring(1)),(c||"0"===a&&"="===s)&&(c=a="0",s="="),p){case"n":d=!0,p="g";break;case"%":g=100,m="%",p="f";break;case"p":g=100,m="%",p="r";break;case"b":case"o":case"x":case"X":"#"===u&&(v="0"+p.toLowerCase());case"c":b=!1;case"d":y=!0,h=0;break;case"s":g=-1,p="r"}"$"===u&&(v=i[0],m=i[1]),"r"!=p||h||(p="g"),null!=h&&("g"==p?h=Math.max(1,Math.min(21,h)):"e"!=p&&"f"!=p||(h=Math.max(0,Math.min(20,h)))),p=Le.get(p)||Oe;var x=c&&d;return function(e){var n=m;if(y&&e%1)return"";var i=e<0||0===e&&1/e<0?(e=-e,"-"):"-"===l?"":l;if(g<0){var u=t.formatPrefix(e,h);e=u.scale(e),n=u.symbol+m}else e*=g;var _,w,A=(e=p(e,h)).lastIndexOf(".");if(A<0){var T=b?e.lastIndexOf("e"):-1;T<0?(_=e,w=""):(_=e.substring(0,T),w=e.substring(T))}else _=e.substring(0,A),w=r+e.substring(A+1);!c&&d&&(_=o(_,1/0));var k=v.length+_.length+w.length+(x?0:i.length),M=k"===s?M+i+e:"^"===s?M.substring(0,k>>=1)+i+e+M.substring(k):i+(x?e:M+e))+n}}}t.formatPrefix=function(e,r){var n=0;return(e=+e)&&(e<0&&(e*=-1),r&&(e=t.round(e,Me(e,r))),n=1+Math.floor(1e-12+Math.log(e)/Math.LN10),n=Math.max(-24,Math.min(24,3*Math.floor((n-1)/3)))),Ee[8+n/3]};var Ce=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,Le=t.map({b:function(t){return t.toString(2)},c:function(t){return String.fromCharCode(t)},o:function(t){return t.toString(8)},x:function(t){return t.toString(16)},X:function(t){return t.toString(16).toUpperCase()},g:function(t,e){return t.toPrecision(e)},e:function(t,e){return t.toExponential(e)},f:function(t,e){return t.toFixed(e)},r:function(e,r){return(e=t.round(e,Me(e,r))).toFixed(Math.max(0,Math.min(20,Me(e*(1+1e-15),r))))}});function Oe(t){return t+""}var De=t.time={},Re=Date;function Ie(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}Ie.prototype={getDate:function(){return this._.getUTCDate()},getDay:function(){return this._.getUTCDay()},getFullYear:function(){return this._.getUTCFullYear()},getHours:function(){return this._.getUTCHours()},getMilliseconds:function(){return this._.getUTCMilliseconds()},getMinutes:function(){return this._.getUTCMinutes()},getMonth:function(){return this._.getUTCMonth()},getSeconds:function(){return this._.getUTCSeconds()},getTime:function(){return this._.getTime()},getTimezoneOffset:function(){return 0},valueOf:function(){return this._.valueOf()},setDate:function(){Pe.setUTCDate.apply(this._,arguments)},setDay:function(){Pe.setUTCDay.apply(this._,arguments)},setFullYear:function(){Pe.setUTCFullYear.apply(this._,arguments)},setHours:function(){Pe.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){Pe.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){Pe.setUTCMinutes.apply(this._,arguments)},setMonth:function(){Pe.setUTCMonth.apply(this._,arguments)},setSeconds:function(){Pe.setUTCSeconds.apply(this._,arguments)},setTime:function(){Pe.setTime.apply(this._,arguments)}};var Pe=Date.prototype;function Fe(t,e,r){function n(e){var r=t(e),n=i(r,1);return e-r1)for(;o=u)return-1;if(37===(a=e.charCodeAt(s++))){if(o=e.charAt(s++),!(i=w[o in Be?e.charAt(s++):o])||(n=i(t,r,n))<0)return-1}else if(a!=r.charCodeAt(n++))return-1}return n}c.utc=function(t){var e=c(t);function r(t){try{var r=new(Re=Ie);return r._=t,e(r)}finally{Re=Date}}return r.parse=function(t){try{Re=Ie;var r=e.parse(t);return r&&r._}finally{Re=Date}},r.toString=e.toString,r},c.multi=c.utc.multi=or;var d=t.map(),h=He(o),p=Ge(o),g=He(s),v=Ge(s),m=He(l),y=Ge(l),b=He(u),x=Ge(u);i.forEach((function(t,e){d.set(t.toLowerCase(),e)}));var _={a:function(t){return s[t.getDay()]},A:function(t){return o[t.getDay()]},b:function(t){return u[t.getMonth()]},B:function(t){return l[t.getMonth()]},c:c(r),d:function(t,e){return Ve(t.getDate(),e,2)},e:function(t,e){return Ve(t.getDate(),e,2)},H:function(t,e){return Ve(t.getHours(),e,2)},I:function(t,e){return Ve(t.getHours()%12||12,e,2)},j:function(t,e){return Ve(1+De.dayOfYear(t),e,3)},L:function(t,e){return Ve(t.getMilliseconds(),e,3)},m:function(t,e){return Ve(t.getMonth()+1,e,2)},M:function(t,e){return Ve(t.getMinutes(),e,2)},p:function(t){return i[+(t.getHours()>=12)]},S:function(t,e){return Ve(t.getSeconds(),e,2)},U:function(t,e){return Ve(De.sundayOfYear(t),e,2)},w:function(t){return t.getDay()},W:function(t,e){return Ve(De.mondayOfYear(t),e,2)},x:c(n),X:c(a),y:function(t,e){return Ve(t.getFullYear()%100,e,2)},Y:function(t,e){return Ve(t.getFullYear()%1e4,e,4)},Z:ar,"%":function(){return"%"}},w={a:function(t,e,r){g.lastIndex=0;var n=g.exec(e.slice(r));return n?(t.w=v.get(n[0].toLowerCase()),r+n[0].length):-1},A:function(t,e,r){h.lastIndex=0;var n=h.exec(e.slice(r));return n?(t.w=p.get(n[0].toLowerCase()),r+n[0].length):-1},b:function(t,e,r){b.lastIndex=0;var n=b.exec(e.slice(r));return n?(t.m=x.get(n[0].toLowerCase()),r+n[0].length):-1},B:function(t,e,r){m.lastIndex=0;var n=m.exec(e.slice(r));return n?(t.m=y.get(n[0].toLowerCase()),r+n[0].length):-1},c:function(t,e,r){return f(t,_.c.toString(),e,r)},d:$e,e:$e,H:tr,I:tr,j:Ke,L:nr,m:Qe,M:er,p:function(t,e,r){var n=d.get(e.slice(r,r+=2).toLowerCase());return null==n?-1:(t.p=n,r)},S:rr,U:Xe,w:qe,W:We,x:function(t,e,r){return f(t,_.x.toString(),e,r)},X:function(t,e,r){return f(t,_.X.toString(),e,r)},y:Ze,Y:Ye,Z:Je,"%":ir};return c}De.year=Fe((function(t){return(t=De.day(t)).setMonth(0,1),t}),(function(t,e){t.setFullYear(t.getFullYear()+e)}),(function(t){return t.getFullYear()})),De.years=De.year.range,De.years.utc=De.year.utc.range,De.day=Fe((function(t){var e=new Re(2e3,0);return e.setFullYear(t.getFullYear(),t.getMonth(),t.getDate()),e}),(function(t,e){t.setDate(t.getDate()+e)}),(function(t){return t.getDate()-1})),De.days=De.day.range,De.days.utc=De.day.utc.range,De.dayOfYear=function(t){var e=De.year(t);return Math.floor((t-e-6e4*(t.getTimezoneOffset()-e.getTimezoneOffset()))/864e5)},["sunday","monday","tuesday","wednesday","thursday","friday","saturday"].forEach((function(t,e){e=7-e;var r=De[t]=Fe((function(t){return(t=De.day(t)).setDate(t.getDate()-(t.getDay()+e)%7),t}),(function(t,e){t.setDate(t.getDate()+7*Math.floor(e))}),(function(t){var r=De.year(t).getDay();return Math.floor((De.dayOfYear(t)+(r+e)%7)/7)-(r!==e)}));De[t+"s"]=r.range,De[t+"s"].utc=r.utc.range,De[t+"OfYear"]=function(t){var r=De.year(t).getDay();return Math.floor((De.dayOfYear(t)+(r+e)%7)/7)}})),De.week=De.sunday,De.weeks=De.sunday.range,De.weeks.utc=De.sunday.utc.range,De.weekOfYear=De.sundayOfYear;var Be={"-":"",_:" ",0:"0"},je=/^\s*\d+/,Ue=/^%/;function Ve(t,e,r){var n=t<0?"-":"",a=(n?-t:t)+"",i=a.length;return n+(i68?1900:2e3),r+a[0].length):-1}function Je(t,e,r){return/^[+-]\d{4}$/.test(e=e.slice(r,r+5))?(t.Z=-e,r+5):-1}function Qe(t,e,r){je.lastIndex=0;var n=je.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function $e(t,e,r){je.lastIndex=0;var n=je.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function Ke(t,e,r){je.lastIndex=0;var n=je.exec(e.slice(r,r+3));return n?(t.j=+n[0],r+n[0].length):-1}function tr(t,e,r){je.lastIndex=0;var n=je.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function er(t,e,r){je.lastIndex=0;var n=je.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function rr(t,e,r){je.lastIndex=0;var n=je.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function nr(t,e,r){je.lastIndex=0;var n=je.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function ar(t){var e=t.getTimezoneOffset(),r=e>0?"-":"+",n=y(e)/60|0,a=y(e)%60;return r+Ve(n,"0",2)+Ve(a,"0",2)}function ir(t,e,r){Ue.lastIndex=0;var n=Ue.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function or(t){for(var e=t.length,r=-1;++r=0?1:-1,s=o*i,l=Math.cos(e),u=Math.sin(e),c=a*u,f=n*l+c*Math.cos(s),d=c*o*Math.sin(s);Sr.add(Math.atan2(d,f)),r=t,n=l,a=u}Cr.point=function(o,s){Cr.point=i,r=(t=o)*Lt,n=Math.cos(s=(e=s)*Lt/2+Mt/4),a=Math.sin(s)},Cr.lineEnd=function(){i(t,e)}}function Or(t){var e=t[0],r=t[1],n=Math.cos(r);return[n*Math.cos(e),n*Math.sin(e),Math.sin(r)]}function Dr(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function Rr(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function Ir(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function Pr(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function Fr(t){var e=Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}function zr(t){return[Math.atan2(t[1],t[0]),Pt(t[2])]}function Nr(t,e){return y(t[0]-e[0])Tt?a=90:u<-Tt&&(r=-90),f[0]=e,f[1]=n}};function h(t,i){c.push(f=[e=t,n=t]),ia&&(a=i)}function p(t,o){var s=Or([t*Lt,o*Lt]);if(l){var u=Rr(l,s),c=Rr([u[1],-u[0],0],u);Fr(c),c=zr(c);var f=t-i,d=f>0?1:-1,p=c[0]*Ot*d,g=y(f)>180;if(g^(d*ia&&(a=v);else if(g^(d*i<(p=(p+360)%360-180)&&pa&&(a=o);g?t_(e,n)&&(n=t):_(t,n)>_(e,n)&&(e=t):n>=e?(tn&&(n=t)):t>i?_(e,t)>_(e,n)&&(n=t):_(t,n)>_(e,n)&&(e=t)}else h(t,o);l=s,i=t}function g(){d.point=p}function v(){f[0]=e,f[1]=n,d.point=h,l=null}function m(t,e){if(l){var r=t-i;u+=y(r)>180?r+(r>0?360:-360):r}else o=t,s=e;Cr.point(t,e),p(t,e)}function b(){Cr.lineStart()}function x(){m(o,s),Cr.lineEnd(),y(u)>Tt&&(e=-(n=180)),f[0]=e,f[1]=n,l=null}function _(t,e){return(e-=t)<0?e+360:e}function w(t,e){return t[0]-e[0]}function A(t,e){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:t_(g[0],g[1])&&(g[1]=h[1]),_(h[0],g[1])>_(g[0],g[1])&&(g[0]=h[0])):s.push(g=h);for(var l,u,h,p=-1/0,g=(o=0,s[u=s.length-1]);o<=u;g=h,++o)h=s[o],(l=_(g[1],h[0]))>p&&(p=l,e=h[0],n=g[1])}return c=f=null,e===1/0||r===1/0?[[NaN,NaN],[NaN,NaN]]:[[e,r],[n,a]]}}(),t.geo.centroid=function(e){mr=yr=br=xr=_r=wr=Ar=Tr=kr=Mr=Er=0,t.geo.stream(e,Br);var r=kr,n=Mr,a=Er,i=r*r+n*n+a*a;return i=0;--s)a.point((f=c[s])[0],f[1]);else n(h.x,h.p.x,-1,a);h=h.p}c=(h=h.o).z,p=!p}while(!h.v);a.lineEnd()}}}function Yr(t){if(e=t.length){for(var e,r,n=0,a=t[0];++n=0?1:-1,A=w*_,T=A>Mt,k=p*b;if(Sr.add(Math.atan2(k*w*Math.sin(A),g*x+k*Math.cos(A))),i+=T?_+w*Et:_,T^d>=r^m>=r){var M=Rr(Or(f),Or(t));Fr(M);var E=Rr(a,M);Fr(E);var S=(T^_>=0?-1:1)*Pt(E[2]);(n>S||n===S&&(M[0]||M[1]))&&(o+=T^_>=0?1:-1)}if(!v++)break;d=m,p=b,g=x,f=t}}return(i<-Tt||i0){for(b||(o.polygonStart(),b=!0),o.lineStart();++i1&&2&e&&r.push(r.pop().concat(r.shift())),s.push(r.filter(Qr))}return c}}function Qr(t){return t.length>1}function $r(){var t,e=[];return{lineStart:function(){e.push(t=[])},point:function(e,r){t.push([e,r])},lineEnd:I,buffer:function(){var r=e;return e=[],t=null,r},rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))}}}function Kr(t,e){return((t=t.x)[0]<0?t[1]-Ct-Tt:Ct-t[1])-((e=e.x)[0]<0?e[1]-Ct-Tt:Ct-e[1])}var tn=Jr(Xr,(function(t){var e,r=NaN,n=NaN,a=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(i,o){var s=i>0?Mt:-Mt,l=y(i-r);y(l-Mt)0?Ct:-Ct),t.point(a,n),t.lineEnd(),t.lineStart(),t.point(s,n),t.point(i,n),e=0):a!==s&&l>=Mt&&(y(r-a)Tt?Math.atan((Math.sin(e)*(i=Math.cos(n))*Math.sin(r)-Math.sin(n)*(a=Math.cos(e))*Math.sin(t))/(a*i*o)):(e+n)/2}(r,n,i,o),t.point(a,n),t.lineEnd(),t.lineStart(),t.point(s,n),e=0),t.point(r=i,n=o),a=s},lineEnd:function(){t.lineEnd(),r=n=NaN},clean:function(){return 2-e}}}),(function(t,e,r,n){var a;if(null==t)a=r*Ct,n.point(-Mt,a),n.point(0,a),n.point(Mt,a),n.point(Mt,0),n.point(Mt,-a),n.point(0,-a),n.point(-Mt,-a),n.point(-Mt,0),n.point(-Mt,a);else if(y(t[0]-e[0])>Tt){var i=t[0]0,n=y(e)>Tt;return Jr(a,(function(t){var e,s,l,u,c;return{lineStart:function(){u=l=!1,c=1},point:function(f,d){var h,p=[f,d],g=a(f,d),v=r?g?0:o(f,d):g?o(f+(f<0?Mt:-Mt),d):0;if(!e&&(u=l=g)&&t.lineStart(),g!==l&&(h=i(e,p),(Nr(e,h)||Nr(p,h))&&(p[0]+=Tt,p[1]+=Tt,g=a(p[0],p[1]))),g!==l)c=0,g?(t.lineStart(),h=i(p,e),t.point(h[0],h[1])):(h=i(e,p),t.point(h[0],h[1]),t.lineEnd()),e=h;else if(n&&e&&r^g){var m;v&s||!(m=i(p,e,!0))||(c=0,r?(t.lineStart(),t.point(m[0][0],m[0][1]),t.point(m[1][0],m[1][1]),t.lineEnd()):(t.point(m[1][0],m[1][1]),t.lineEnd(),t.lineStart(),t.point(m[0][0],m[0][1])))}!g||e&&Nr(e,p)||t.point(p[0],p[1]),e=p,l=g,s=v},lineEnd:function(){l&&t.lineEnd(),e=null},clean:function(){return c|(u&&l)<<1}}}),Nn(t,6*Lt),r?[0,-t]:[-Mt,t-Mt]);function a(t,r){return Math.cos(t)*Math.cos(r)>e}function i(t,r,n){var a=[1,0,0],i=Rr(Or(t),Or(r)),o=Dr(i,i),s=i[0],l=o-s*s;if(!l)return!n&&t;var u=e*o/l,c=-e*s/l,f=Rr(a,i),d=Pr(a,u);Ir(d,Pr(i,c));var h=f,p=Dr(d,h),g=Dr(h,h),v=p*p-g*(Dr(d,d)-1);if(!(v<0)){var m=Math.sqrt(v),b=Pr(h,(-p-m)/g);if(Ir(b,d),b=zr(b),!n)return b;var x,_=t[0],w=r[0],A=t[1],T=r[1];w<_&&(x=_,_=w,w=x);var k=w-_,M=y(k-Mt)0^b[1]<(y(b[0]-_)Mt^(_<=b[0]&&b[0]<=w)){var E=Pr(h,(-p+m)/g);return Ir(E,d),[b,zr(E)]}}}function o(e,n){var a=r?t:Mt-t,i=0;return e<-a?i|=1:e>a&&(i|=2),n<-a?i|=4:n>a&&(i|=8),i}}function rn(t,e,r,n){return function(a){var i,o=a.a,s=a.b,l=o.x,u=o.y,c=0,f=1,d=s.x-l,h=s.y-u;if(i=t-l,d||!(i>0)){if(i/=d,d<0){if(i0){if(i>f)return;i>c&&(c=i)}if(i=r-l,d||!(i<0)){if(i/=d,d<0){if(i>f)return;i>c&&(c=i)}else if(d>0){if(i0)){if(i/=h,h<0){if(i0){if(i>f)return;i>c&&(c=i)}if(i=n-u,h||!(i<0)){if(i/=h,h<0){if(i>f)return;i>c&&(c=i)}else if(h>0){if(i0&&(a.a={x:l+c*d,y:u+c*h}),f<1&&(a.b={x:l+f*d,y:u+f*h}),a}}}}}}function nn(e,r,n,a){return function(l){var u,c,f,d,h,p,g,v,m,y,b,x=l,_=$r(),w=rn(e,r,n,a),A={point:M,lineStart:function(){A.point=E,c&&c.push(f=[]);y=!0,m=!1,g=v=NaN},lineEnd:function(){u&&(E(d,h),p&&m&&_.rejoin(),u.push(_.buffer()));A.point=M,m&&l.lineEnd()},polygonStart:function(){l=_,u=[],c=[],b=!0},polygonEnd:function(){l=x,u=t.merge(u);var r=function(t){for(var e=0,r=c.length,n=t[1],a=0;an&&Rt(u,i,t)>0&&++e:i[1]<=n&&Rt(u,i,t)<0&&--e,u=i;return 0!==e}([e,a]),n=b&&r,i=u.length;(n||i)&&(l.polygonStart(),n&&(l.lineStart(),T(null,null,1,l),l.lineEnd()),i&&Wr(u,o,r,T,l),l.polygonEnd()),u=c=f=null}};function T(t,o,l,u){var c=0,f=0;if(null==t||(c=i(t,l))!==(f=i(o,l))||s(t,o)<0^l>0)do{u.point(0===c||3===c?e:n,c>1?a:r)}while((c=(c+l+4)%4)!==f);else u.point(o[0],o[1])}function k(t,i){return e<=t&&t<=n&&r<=i&&i<=a}function M(t,e){k(t,e)&&l.point(t,e)}function E(t,e){var r=k(t=Math.max(-1e9,Math.min(1e9,t)),e=Math.max(-1e9,Math.min(1e9,e)));if(c&&f.push([t,e]),y)d=t,h=e,p=r,y=!1,r&&(l.lineStart(),l.point(t,e));else if(r&&m)l.point(t,e);else{var n={a:{x:g,y:v},b:{x:t,y:e}};w(n)?(m||(l.lineStart(),l.point(n.a.x,n.a.y)),l.point(n.b.x,n.b.y),r||l.lineEnd(),b=!1):r&&(l.lineStart(),l.point(t,e),b=!1)}g=t,v=e,m=r}return A};function i(t,a){return y(t[0]-e)0?0:3:y(t[0]-n)0?2:1:y(t[1]-r)0?1:0:a>0?3:2}function o(t,e){return s(t.x,e.x)}function s(t,e){var r=i(t,1),n=i(e,1);return r!==n?r-n:0===r?e[1]-t[1]:1===r?t[0]-e[0]:2===r?t[1]-e[1]:e[0]-t[0]}}function an(t){var e=0,r=Mt/3,n=Ln(t),a=n(e,r);return a.parallels=function(t){return arguments.length?n(e=t[0]*Mt/180,r=t[1]*Mt/180):[e/Mt*180,r/Mt*180]},a}function on(t,e){var r=Math.sin(t),n=(r+Math.sin(e))/2,a=1+r*(2*n-r),i=Math.sqrt(a)/n;function o(t,e){var r=Math.sqrt(a-2*n*Math.sin(e))/n;return[r*Math.sin(t*=n),i-r*Math.cos(t)]}return o.invert=function(t,e){var r=i-e;return[Math.atan2(t,r)/n,Pt((a-(t*t+r*r)*n*n)/(2*n))]},o}t.geo.clipExtent=function(){var t,e,r,n,a,i,o={stream:function(t){return a&&(a.valid=!1),(a=i(t)).valid=!0,a},extent:function(s){return arguments.length?(i=nn(t=+s[0][0],e=+s[0][1],r=+s[1][0],n=+s[1][1]),a&&(a.valid=!1,a=null),o):[[t,e],[r,n]]}};return o.extent([[0,0],[960,500]])},(t.geo.conicEqualArea=function(){return an(on)}).raw=on,t.geo.albers=function(){return t.geo.conicEqualArea().rotate([96,0]).center([-.6,38.7]).parallels([29.5,45.5]).scale(1070)},t.geo.albersUsa=function(){var e,r,n,a,i=t.geo.albers(),o=t.geo.conicEqualArea().rotate([154,0]).center([-2,58.5]).parallels([55,65]),s=t.geo.conicEqualArea().rotate([157,0]).center([-3,19.9]).parallels([8,18]),l={point:function(t,r){e=[t,r]}};function u(t){var i=t[0],o=t[1];return e=null,r(i,o),e||(n(i,o),e)||a(i,o),e}return u.invert=function(t){var e=i.scale(),r=i.translate(),n=(t[0]-r[0])/e,a=(t[1]-r[1])/e;return(a>=.12&&a<.234&&n>=-.425&&n<-.214?o:a>=.166&&a<.234&&n>=-.214&&n<-.115?s:i).invert(t)},u.stream=function(t){var e=i.stream(t),r=o.stream(t),n=s.stream(t);return{point:function(t,a){e.point(t,a),r.point(t,a),n.point(t,a)},sphere:function(){e.sphere(),r.sphere(),n.sphere()},lineStart:function(){e.lineStart(),r.lineStart(),n.lineStart()},lineEnd:function(){e.lineEnd(),r.lineEnd(),n.lineEnd()},polygonStart:function(){e.polygonStart(),r.polygonStart(),n.polygonStart()},polygonEnd:function(){e.polygonEnd(),r.polygonEnd(),n.polygonEnd()}}},u.precision=function(t){return arguments.length?(i.precision(t),o.precision(t),s.precision(t),u):i.precision()},u.scale=function(t){return arguments.length?(i.scale(t),o.scale(.35*t),s.scale(t),u.translate(i.translate())):i.scale()},u.translate=function(t){if(!arguments.length)return i.translate();var e=i.scale(),c=+t[0],f=+t[1];return r=i.translate(t).clipExtent([[c-.455*e,f-.238*e],[c+.455*e,f+.238*e]]).stream(l).point,n=o.translate([c-.307*e,f+.201*e]).clipExtent([[c-.425*e+Tt,f+.12*e+Tt],[c-.214*e-Tt,f+.234*e-Tt]]).stream(l).point,a=s.translate([c-.205*e,f+.212*e]).clipExtent([[c-.214*e+Tt,f+.166*e+Tt],[c-.115*e-Tt,f+.234*e-Tt]]).stream(l).point,u},u.scale(1070)};var sn,ln,un,cn,fn,dn,hn={point:I,lineStart:I,lineEnd:I,polygonStart:function(){ln=0,hn.lineStart=pn},polygonEnd:function(){hn.lineStart=hn.lineEnd=hn.point=I,sn+=y(ln/2)}};function pn(){var t,e,r,n;function a(t,e){ln+=n*t-r*e,r=t,n=e}hn.point=function(i,o){hn.point=a,t=r=i,e=n=o},hn.lineEnd=function(){a(t,e)}}var gn={point:function(t,e){tfn&&(fn=t);edn&&(dn=e)},lineStart:I,lineEnd:I,polygonStart:I,polygonEnd:I};function vn(){var t=mn(4.5),e=[],r={point:n,lineStart:function(){r.point=a},lineEnd:o,polygonStart:function(){r.lineEnd=s},polygonEnd:function(){r.lineEnd=o,r.point=n},pointRadius:function(e){return t=mn(e),r},result:function(){if(e.length){var t=e.join("");return e=[],t}}};function n(r,n){e.push("M",r,",",n,t)}function a(t,n){e.push("M",t,",",n),r.point=i}function i(t,r){e.push("L",t,",",r)}function o(){r.point=n}function s(){e.push("Z")}return r}function mn(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}var yn,bn={point:xn,lineStart:_n,lineEnd:wn,polygonStart:function(){bn.lineStart=An},polygonEnd:function(){bn.point=xn,bn.lineStart=_n,bn.lineEnd=wn}};function xn(t,e){br+=t,xr+=e,++_r}function _n(){var t,e;function r(r,n){var a=r-t,i=n-e,o=Math.sqrt(a*a+i*i);wr+=o*(t+r)/2,Ar+=o*(e+n)/2,Tr+=o,xn(t=r,e=n)}bn.point=function(n,a){bn.point=r,xn(t=n,e=a)}}function wn(){bn.point=xn}function An(){var t,e,r,n;function a(t,e){var a=t-r,i=e-n,o=Math.sqrt(a*a+i*i);wr+=o*(r+t)/2,Ar+=o*(n+e)/2,Tr+=o,kr+=(o=n*t-r*e)*(r+t),Mr+=o*(n+e),Er+=3*o,xn(r=t,n=e)}bn.point=function(i,o){bn.point=a,xn(t=r=i,e=n=o)},bn.lineEnd=function(){a(t,e)}}function Tn(t){var e=4.5,r={point:n,lineStart:function(){r.point=a},lineEnd:o,polygonStart:function(){r.lineEnd=s},polygonEnd:function(){r.lineEnd=o,r.point=n},pointRadius:function(t){return e=t,r},result:I};function n(r,n){t.moveTo(r+e,n),t.arc(r,n,e,0,Et)}function a(e,n){t.moveTo(e,n),r.point=i}function i(e,r){t.lineTo(e,r)}function o(){r.point=n}function s(){t.closePath()}return r}function kn(t){var e=.5,r=Math.cos(30*Lt),n=16;function a(t){return(n?o:i)(t)}function i(e){return Sn(e,(function(r,n){r=t(r,n),e.point(r[0],r[1])}))}function o(e){var r,a,i,o,l,u,c,f,d,h,p,g,v={point:m,lineStart:y,lineEnd:x,polygonStart:function(){e.polygonStart(),v.lineStart=_},polygonEnd:function(){e.polygonEnd(),v.lineStart=y}};function m(r,n){r=t(r,n),e.point(r[0],r[1])}function y(){f=NaN,v.point=b,e.lineStart()}function b(r,a){var i=Or([r,a]),o=t(r,a);s(f,d,c,h,p,g,f=o[0],d=o[1],c=r,h=i[0],p=i[1],g=i[2],n,e),e.point(f,d)}function x(){v.point=m,e.lineEnd()}function _(){y(),v.point=w,v.lineEnd=A}function w(t,e){b(r=t,e),a=f,i=d,o=h,l=p,u=g,v.point=b}function A(){s(f,d,c,h,p,g,a,i,r,o,l,u,n,e),v.lineEnd=x,x()}return v}function s(n,a,i,o,l,u,c,f,d,h,p,g,v,m){var b=c-n,x=f-a,_=b*b+x*x;if(_>4*e&&v--){var w=o+h,A=l+p,T=u+g,k=Math.sqrt(w*w+A*A+T*T),M=Math.asin(T/=k),E=y(y(T)-1)e||y((b*O+x*D)/_-.5)>.3||o*h+l*p+u*g0&&16,a):Math.sqrt(e)},a}function Mn(t){var e=kn((function(e,r){return t([e*Ot,r*Ot])}));return function(t){return On(e(t))}}function En(t){this.stream=t}function Sn(t,e){return{point:e,sphere:function(){t.sphere()},lineStart:function(){t.lineStart()},lineEnd:function(){t.lineEnd()},polygonStart:function(){t.polygonStart()},polygonEnd:function(){t.polygonEnd()}}}function Cn(t){return Ln((function(){return t}))()}function Ln(e){var r,n,a,i,o,s,l=kn((function(t,e){return[(t=r(t,e))[0]*u+i,o-t[1]*u]})),u=150,c=480,f=250,d=0,h=0,p=0,g=0,v=0,m=tn,y=L,b=null,x=null;function _(t){return[(t=a(t[0]*Lt,t[1]*Lt))[0]*u+i,o-t[1]*u]}function w(t){return(t=a.invert((t[0]-i)/u,(o-t[1])/u))&&[t[0]*Ot,t[1]*Ot]}function A(){a=qr(n=In(p,g,v),r);var t=r(d,h);return i=c-t[0]*u,o=f+t[1]*u,T()}function T(){return s&&(s.valid=!1,s=null),_}return _.stream=function(t){return s&&(s.valid=!1),(s=On(m(n,l(y(t))))).valid=!0,s},_.clipAngle=function(t){return arguments.length?(m=null==t?(b=t,tn):en((b=+t)*Lt),T()):b},_.clipExtent=function(t){return arguments.length?(x=t,y=t?nn(t[0][0],t[0][1],t[1][0],t[1][1]):L,T()):x},_.scale=function(t){return arguments.length?(u=+t,A()):u},_.translate=function(t){return arguments.length?(c=+t[0],f=+t[1],A()):[c,f]},_.center=function(t){return arguments.length?(d=t[0]%360*Lt,h=t[1]%360*Lt,A()):[d*Ot,h*Ot]},_.rotate=function(t){return arguments.length?(p=t[0]%360*Lt,g=t[1]%360*Lt,v=t.length>2?t[2]%360*Lt:0,A()):[p*Ot,g*Ot,v*Ot]},t.rebind(_,l,"precision"),function(){return r=e.apply(this,arguments),_.invert=r.invert&&w,A()}}function On(t){return Sn(t,(function(e,r){t.point(e*Lt,r*Lt)}))}function Dn(t,e){return[t,e]}function Rn(t,e){return[t>Mt?t-Et:t<-Mt?t+Et:t,e]}function In(t,e,r){return t?e||r?qr(Fn(t),zn(e,r)):Fn(t):e||r?zn(e,r):Rn}function Pn(t){return function(e,r){return[(e+=t)>Mt?e-Et:e<-Mt?e+Et:e,r]}}function Fn(t){var e=Pn(t);return e.invert=Pn(-t),e}function zn(t,e){var r=Math.cos(t),n=Math.sin(t),a=Math.cos(e),i=Math.sin(e);function o(t,e){var o=Math.cos(e),s=Math.cos(t)*o,l=Math.sin(t)*o,u=Math.sin(e),c=u*r+s*n;return[Math.atan2(l*a-c*i,s*r-u*n),Pt(c*a+l*i)]}return o.invert=function(t,e){var o=Math.cos(e),s=Math.cos(t)*o,l=Math.sin(t)*o,u=Math.sin(e),c=u*a-l*i;return[Math.atan2(l*a+u*i,s*r+c*n),Pt(c*r-s*n)]},o}function Nn(t,e){var r=Math.cos(t),n=Math.sin(t);return function(a,i,o,s){var l=o*e;null!=a?(a=Bn(r,a),i=Bn(r,i),(o>0?ai)&&(a+=o*Et)):(a=t+o*Et,i=t-.5*l);for(var u,c=a;o>0?c>i:c2?t[2]*Lt:0),e.invert=function(e){return(e=t.invert(e[0]*Lt,e[1]*Lt))[0]*=Ot,e[1]*=Ot,e},e},Rn.invert=Dn,t.geo.circle=function(){var t,e,r=[0,0],n=6;function a(){var t="function"==typeof r?r.apply(this,arguments):r,n=In(-t[0]*Lt,-t[1]*Lt,0).invert,a=[];return e(null,null,1,{point:function(t,e){a.push(t=n(t,e)),t[0]*=Ot,t[1]*=Ot}}),{type:"Polygon",coordinates:[a]}}return a.origin=function(t){return arguments.length?(r=t,a):r},a.angle=function(r){return arguments.length?(e=Nn((t=+r)*Lt,n*Lt),a):t},a.precision=function(r){return arguments.length?(e=Nn(t*Lt,(n=+r)*Lt),a):n},a.angle(90)},t.geo.distance=function(t,e){var r,n=(e[0]-t[0])*Lt,a=t[1]*Lt,i=e[1]*Lt,o=Math.sin(n),s=Math.cos(n),l=Math.sin(a),u=Math.cos(a),c=Math.sin(i),f=Math.cos(i);return Math.atan2(Math.sqrt((r=f*o)*r+(r=u*c-l*f*s)*r),l*c+u*f*s)},t.geo.graticule=function(){var e,r,n,a,i,o,s,l,u,c,f,d,h=10,p=h,g=90,v=360,m=2.5;function b(){return{type:"MultiLineString",coordinates:x()}}function x(){return t.range(Math.ceil(a/g)*g,n,g).map(f).concat(t.range(Math.ceil(l/v)*v,s,v).map(d)).concat(t.range(Math.ceil(r/h)*h,e,h).filter((function(t){return y(t%g)>Tt})).map(u)).concat(t.range(Math.ceil(o/p)*p,i,p).filter((function(t){return y(t%v)>Tt})).map(c))}return b.lines=function(){return x().map((function(t){return{type:"LineString",coordinates:t}}))},b.outline=function(){return{type:"Polygon",coordinates:[f(a).concat(d(s).slice(1),f(n).reverse().slice(1),d(l).reverse().slice(1))]}},b.extent=function(t){return arguments.length?b.majorExtent(t).minorExtent(t):b.minorExtent()},b.majorExtent=function(t){return arguments.length?(a=+t[0][0],n=+t[1][0],l=+t[0][1],s=+t[1][1],a>n&&(t=a,a=n,n=t),l>s&&(t=l,l=s,s=t),b.precision(m)):[[a,l],[n,s]]},b.minorExtent=function(t){return arguments.length?(r=+t[0][0],e=+t[1][0],o=+t[0][1],i=+t[1][1],r>e&&(t=r,r=e,e=t),o>i&&(t=o,o=i,i=t),b.precision(m)):[[r,o],[e,i]]},b.step=function(t){return arguments.length?b.majorStep(t).minorStep(t):b.minorStep()},b.majorStep=function(t){return arguments.length?(g=+t[0],v=+t[1],b):[g,v]},b.minorStep=function(t){return arguments.length?(h=+t[0],p=+t[1],b):[h,p]},b.precision=function(t){return arguments.length?(m=+t,u=jn(o,i,90),c=Un(r,e,m),f=jn(l,s,90),d=Un(a,n,m),b):m},b.majorExtent([[-180,-90+Tt],[180,90-Tt]]).minorExtent([[-180,-80-Tt],[180,80+Tt]])},t.geo.greatArc=function(){var e,r,n=Vn,a=Hn;function i(){return{type:"LineString",coordinates:[e||n.apply(this,arguments),r||a.apply(this,arguments)]}}return i.distance=function(){return t.geo.distance(e||n.apply(this,arguments),r||a.apply(this,arguments))},i.source=function(t){return arguments.length?(n=t,e="function"==typeof t?null:t,i):n},i.target=function(t){return arguments.length?(a=t,r="function"==typeof t?null:t,i):a},i.precision=function(){return arguments.length?i:0},i},t.geo.interpolate=function(t,e){return r=t[0]*Lt,n=t[1]*Lt,a=e[0]*Lt,i=e[1]*Lt,o=Math.cos(n),s=Math.sin(n),l=Math.cos(i),u=Math.sin(i),c=o*Math.cos(r),f=o*Math.sin(r),d=l*Math.cos(a),h=l*Math.sin(a),p=2*Math.asin(Math.sqrt(zt(i-n)+o*l*zt(a-r))),g=1/Math.sin(p),(v=p?function(t){var e=Math.sin(t*=p)*g,r=Math.sin(p-t)*g,n=r*c+e*d,a=r*f+e*h,i=r*s+e*u;return[Math.atan2(a,n)*Ot,Math.atan2(i,Math.sqrt(n*n+a*a))*Ot]}:function(){return[r*Ot,n*Ot]}).distance=p,v;var r,n,a,i,o,s,l,u,c,f,d,h,p,g,v},t.geo.length=function(e){return yn=0,t.geo.stream(e,Gn),yn};var Gn={sphere:I,point:I,lineStart:function(){var t,e,r;function n(n,a){var i=Math.sin(a*=Lt),o=Math.cos(a),s=y((n*=Lt)-t),l=Math.cos(s);yn+=Math.atan2(Math.sqrt((s=o*Math.sin(s))*s+(s=r*i-e*o*l)*s),e*i+r*o*l),t=n,e=i,r=o}Gn.point=function(a,i){t=a*Lt,e=Math.sin(i*=Lt),r=Math.cos(i),Gn.point=n},Gn.lineEnd=function(){Gn.point=Gn.lineEnd=I}},lineEnd:I,polygonStart:I,polygonEnd:I};function qn(t,e){function r(e,r){var n=Math.cos(e),a=Math.cos(r),i=t(n*a);return[i*a*Math.sin(e),i*Math.sin(r)]}return r.invert=function(t,r){var n=Math.sqrt(t*t+r*r),a=e(n),i=Math.sin(a),o=Math.cos(a);return[Math.atan2(t*i,n*o),Math.asin(n&&r*i/n)]},r}var Xn=qn((function(t){return Math.sqrt(2/(1+t))}),(function(t){return 2*Math.asin(t/2)}));(t.geo.azimuthalEqualArea=function(){return Cn(Xn)}).raw=Xn;var Wn=qn((function(t){var e=Math.acos(t);return e&&e/Math.sin(e)}),L);function Yn(t,e){var r=Math.cos(t),n=function(t){return Math.tan(Mt/4+t/2)},a=t===e?Math.sin(t):Math.log(r/Math.cos(e))/Math.log(n(e)/n(t)),i=r*Math.pow(n(t),a)/a;if(!a)return Qn;function o(t,e){i>0?e<-Ct+Tt&&(e=-Ct+Tt):e>Ct-Tt&&(e=Ct-Tt);var r=i/Math.pow(n(e),a);return[r*Math.sin(a*t),i-r*Math.cos(a*t)]}return o.invert=function(t,e){var r=i-e,n=Dt(a)*Math.sqrt(t*t+r*r);return[Math.atan2(t,r)/a,2*Math.atan(Math.pow(i/n,1/a))-Ct]},o}function Zn(t,e){var r=Math.cos(t),n=t===e?Math.sin(t):(r-Math.cos(e))/(e-t),a=r/n+t;if(y(n)1&&Rt(t[r[n-2]],t[r[n-1]],t[a])<=0;)--n;r[n++]=a}return r.slice(0,n)}function ia(t,e){return t[0]-e[0]||t[1]-e[1]}(t.geo.stereographic=function(){return Cn(ta)}).raw=ta,ea.invert=function(t,e){return[-e,2*Math.atan(Math.exp(t))-Ct]},(t.geo.transverseMercator=function(){var t=$n(ea),e=t.center,r=t.rotate;return t.center=function(t){return t?e([-t[1],t[0]]):[(t=e())[1],-t[0]]},t.rotate=function(t){return t?r([t[0],t[1],t.length>2?t[2]+90:90]):[(t=r())[0],t[1],t[2]-90]},r([0,0,90])}).raw=ea,t.geom={},t.geom.hull=function(t){var e=ra,r=na;if(arguments.length)return n(t);function n(t){if(t.length<3)return[];var n,a=pe(e),i=pe(r),o=t.length,s=[],l=[];for(n=0;n=0;--n)h.push(t[s[u[n]][2]]);for(n=+f;nTt)s=s.L;else{if(!((a=i-Aa(s,o))>Tt)){n>-Tt?(e=s.P,r=s):a>-Tt?(e=s,r=s.N):e=r=s;break}if(!s.R){e=s;break}s=s.R}var l=ya(t);if(da.insert(e,l),e||r){if(e===r)return Sa(e),r=ya(e.site),da.insert(l,r),l.edge=r.edge=Oa(e.site,l.site),Ea(e),void Ea(r);if(r){Sa(e),Sa(r);var u=e.site,c=u.x,f=u.y,d=t.x-c,h=t.y-f,p=r.site,g=p.x-c,v=p.y-f,m=2*(d*v-h*g),y=d*d+h*h,b=g*g+v*v,x={x:(v*y-h*b)/m+c,y:(d*b-g*y)/m+f};Ra(r.edge,u,p,x),l.edge=Oa(u,t,null,x),r.edge=Oa(t,p,null,x),Ea(e),Ea(r)}else l.edge=Oa(e.site,l.site)}}function wa(t,e){var r=t.site,n=r.x,a=r.y,i=a-e;if(!i)return n;var o=t.P;if(!o)return-1/0;var s=(r=o.site).x,l=r.y,u=l-e;if(!u)return s;var c=s-n,f=1/i-1/u,d=c/u;return f?(-d+Math.sqrt(d*d-2*f*(c*c/(-2*u)-l+u/2+a-i/2)))/f+n:(n+s)/2}function Aa(t,e){var r=t.N;if(r)return wa(r,e);var n=t.site;return n.y===e?n.x:1/0}function Ta(t){this.site=t,this.edges=[]}function ka(t,e){return e.angle-t.angle}function Ma(){Fa(this),this.x=this.y=this.arc=this.site=this.cy=null}function Ea(t){var e=t.P,r=t.N;if(e&&r){var n=e.site,a=t.site,i=r.site;if(n!==i){var o=a.x,s=a.y,l=n.x-o,u=n.y-s,c=i.x-o,f=2*(l*(v=i.y-s)-u*c);if(!(f>=-kt)){var d=l*l+u*u,h=c*c+v*v,p=(v*d-u*h)/f,g=(l*h-c*d)/f,v=g+s,m=va.pop()||new Ma;m.arc=t,m.site=a,m.x=p+o,m.y=v+Math.sqrt(p*p+g*g),m.cy=v,t.circle=m;for(var y=null,b=pa._;b;)if(m.y=s)return;if(d>p){if(i){if(i.y>=u)return}else i={x:v,y:l};r={x:v,y:u}}else{if(i){if(i.y1)if(d>p){if(i){if(i.y>=u)return}else i={x:(l-a)/n,y:l};r={x:(u-a)/n,y:u}}else{if(i){if(i.y=s)return}else i={x:o,y:n*o+a};r={x:s,y:n*s+a}}else{if(i){if(i.xTt||y(a-r)>Tt)&&(s.splice(o,0,new Ia(Da(i.site,c,y(n-f)Tt?{x:f,y:y(e-f)Tt?{x:y(r-p)Tt?{x:d,y:y(e-d)Tt?{x:y(r-h)=r&&u.x<=a&&u.y>=n&&u.y<=o?[[r,o],[a,o],[a,n],[r,n]]:[]).point=t[s]})),e}function s(t){return t.map((function(t,e){return{x:Math.round(n(t,e)/Tt)*Tt,y:Math.round(a(t,e)/Tt)*Tt,i:e}}))}return o.links=function(t){return ja(s(t)).edges.filter((function(t){return t.l&&t.r})).map((function(e){return{source:t[e.l.i],target:t[e.r.i]}}))},o.triangles=function(t){var e=[];return ja(s(t)).cells.forEach((function(r,n){for(var a,i,o,s,l=r.site,u=r.edges.sort(ka),c=-1,f=u.length,d=u[f-1].edge,h=d.l===l?d.r:d.l;++ci||f>o||d=_)<<1|e>=x,A=w+4;wi&&(a=e.slice(i,a),s[o]?s[o]+=a:s[++o]=a),(r=r[0])===(n=n[0])?s[o]?s[o]+=n:s[++o]=n:(s[++o]=null,l.push({i:o,x:Za(r,n)})),i=$a.lastIndex;return ig&&(g=l.x),l.y>v&&(v=l.y),u.push(l.x),c.push(l.y);else for(f=0;fg&&(g=x),_>v&&(v=_),u.push(x),c.push(_)}var w=g-h,A=v-p;function T(t,e,r,n,a,i,o,s){if(!isNaN(r)&&!isNaN(n))if(t.leaf){var l=t.x,u=t.y;if(null!=l)if(y(l-r)+y(u-n)<.01)k(t,e,r,n,a,i,o,s);else{var c=t.point;t.x=t.y=t.point=null,k(t,c,l,u,a,i,o,s),k(t,e,r,n,a,i,o,s)}else t.x=r,t.y=n,t.point=e}else k(t,e,r,n,a,i,o,s)}function k(t,e,r,n,a,i,o,s){var l=.5*(a+o),u=.5*(i+s),c=r>=l,f=n>=u,d=f<<1|c;t.leaf=!1,c?a=l:o=l,f?i=u:s=u,T(t=t.nodes[d]||(t.nodes[d]={leaf:!0,nodes:[],point:null,x:null,y:null}),e,r,n,a,i,o,s)}w>A?v=p+w:g=h+A;var M={leaf:!0,nodes:[],point:null,x:null,y:null,add:function(t){T(M,t,+m(t,++f),+b(t,f),h,p,g,v)},visit:function(t){qa(t,M,h,p,g,v)},find:function(t){return Xa(M,t[0],t[1],h,p,g,v)}};if(f=-1,null==e){for(;++f=0&&!(n=t.interpolators[a](e,r)););return n}function ti(t,e){var r,n=[],a=[],i=t.length,o=e.length,s=Math.min(t.length,e.length);for(r=0;r=1?1:t(e)}}function ii(t){return function(e){return 1-t(1-e)}}function oi(t){return function(e){return.5*(e<.5?t(2*e):2-t(2-2*e))}}function si(t){return t*t}function li(t){return t*t*t}function ui(t){if(t<=0)return 0;if(t>=1)return 1;var e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)}function ci(t){return 1-Math.cos(t*Ct)}function fi(t){return Math.pow(2,10*(t-1))}function di(t){return 1-Math.sqrt(1-t*t)}function hi(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}function pi(t,e){return e-=t,function(r){return Math.round(t+e*r)}}function gi(t){var e,r,n,a=[t.a,t.b],i=[t.c,t.d],o=mi(a),s=vi(a,i),l=mi(((e=i)[0]+=(n=-s)*(r=a)[0],e[1]+=n*r[1],e))||0;a[0]*i[1]=0?t.slice(0,e):t,a=e>=0?t.slice(e+1):"in";return n=ri.get(n)||ei,ai((a=ni.get(a)||L)(n.apply(null,r.call(arguments,1))))},t.interpolateHcl=function(e,r){e=t.hcl(e),r=t.hcl(r);var n=e.h,a=e.c,i=e.l,o=r.h-n,s=r.c-a,l=r.l-i;isNaN(s)&&(s=0,a=isNaN(a)?r.c:a);isNaN(o)?(o=0,n=isNaN(n)?r.h:n):o>180?o-=360:o<-180&&(o+=360);return function(t){return Yt(n+o*t,a+s*t,i+l*t)+""}},t.interpolateHsl=function(e,r){e=t.hsl(e),r=t.hsl(r);var n=e.h,a=e.s,i=e.l,o=r.h-n,s=r.s-a,l=r.l-i;isNaN(s)&&(s=0,a=isNaN(a)?r.s:a);isNaN(o)?(o=0,n=isNaN(n)?r.h:n):o>180?o-=360:o<-180&&(o+=360);return function(t){return qt(n+o*t,a+s*t,i+l*t)+""}},t.interpolateLab=function(e,r){e=t.lab(e),r=t.lab(r);var n=e.l,a=e.a,i=e.b,o=r.l-n,s=r.a-a,l=r.b-i;return function(t){return $t(n+o*t,a+s*t,i+l*t)+""}},t.interpolateRound=pi,t.transform=function(e){var r=a.createElementNS(t.ns.prefix.svg,"g");return(t.transform=function(t){if(null!=t){r.setAttribute("transform",t);var e=r.transform.baseVal.consolidate()}return new gi(e?e.matrix:yi)})(e)},gi.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var yi={a:1,b:0,c:0,d:1,e:0,f:0};function bi(t){return t.length?t.pop()+",":""}function xi(e,r){var n=[],a=[];return e=t.transform(e),r=t.transform(r),function(t,e,r,n){if(t[0]!==e[0]||t[1]!==e[1]){var a=r.push("translate(",null,",",null,")");n.push({i:a-4,x:Za(t[0],e[0])},{i:a-2,x:Za(t[1],e[1])})}else(e[0]||e[1])&&r.push("translate("+e+")")}(e.translate,r.translate,n,a),function(t,e,r,n){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),n.push({i:r.push(bi(r)+"rotate(",null,")")-2,x:Za(t,e)})):e&&r.push(bi(r)+"rotate("+e+")")}(e.rotate,r.rotate,n,a),function(t,e,r,n){t!==e?n.push({i:r.push(bi(r)+"skewX(",null,")")-2,x:Za(t,e)}):e&&r.push(bi(r)+"skewX("+e+")")}(e.skew,r.skew,n,a),function(t,e,r,n){if(t[0]!==e[0]||t[1]!==e[1]){var a=r.push(bi(r)+"scale(",null,",",null,")");n.push({i:a-4,x:Za(t[0],e[0])},{i:a-2,x:Za(t[1],e[1])})}else 1===e[0]&&1===e[1]||r.push(bi(r)+"scale("+e+")")}(e.scale,r.scale,n,a),e=r=null,function(t){for(var e,r=-1,i=a.length;++r0?n=t:(e.c=null,e.t=NaN,e=null,l.end({type:"end",alpha:n=0})):t>0&&(l.start({type:"start",alpha:n=t}),e=we(s.tick)),s):n},s.start=function(){var t,e,r,n=m.length,l=y.length,c=u[0],p=u[1];for(t=0;t=0;)r.push(a[n])}function Ii(t,e){for(var r=[t],n=[];null!=(t=r.pop());)if(n.push(t),(i=t.children)&&(a=i.length))for(var a,i,o=-1;++o=0;)o.push(c=u[l]),c.parent=i,c.depth=i.depth+1;r&&(i.value=0),i.children=u}else r&&(i.value=+r.call(n,i,i.depth)||0),delete i.children;return Ii(a,(function(e){var n,a;t&&(n=e.children)&&n.sort(t),r&&(a=e.parent)&&(a.value+=e.value)})),s}return n.sort=function(e){return arguments.length?(t=e,n):t},n.children=function(t){return arguments.length?(e=t,n):e},n.value=function(t){return arguments.length?(r=t,n):r},n.revalue=function(t){return r&&(Ri(t,(function(t){t.children&&(t.value=0)})),Ii(t,(function(t){var e;t.children||(t.value=+r.call(n,t,t.depth)||0),(e=t.parent)&&(e.value+=t.value)}))),t},n},t.layout.partition=function(){var e=t.layout.hierarchy(),r=[1,1];function n(t,n){var a=e.call(this,t,n);return function t(e,r,n,a){var i=e.children;if(e.x=r,e.y=e.depth*a,e.dx=n,e.dy=a,i&&(o=i.length)){var o,s,l,u=-1;for(n=e.value?n/e.value:0;++us&&(s=n),o.push(n)}for(r=0;ra&&(n=r,a=e);return n}function Yi(t){return t.reduce(Zi,0)}function Zi(t,e){return t+e[1]}function Ji(t,e){return Qi(t,Math.ceil(Math.log(e.length)/Math.LN2+1))}function Qi(t,e){for(var r=-1,n=+t[0],a=(t[1]-n)/e,i=[];++r<=e;)i[r]=a*r+n;return i}function $i(e){return[t.min(e),t.max(e)]}function Ki(t,e){return t.value-e.value}function to(t,e){var r=t._pack_next;t._pack_next=e,e._pack_prev=t,e._pack_next=r,r._pack_prev=e}function eo(t,e){t._pack_next=e,e._pack_prev=t}function ro(t,e){var r=e.x-t.x,n=e.y-t.y,a=t.r+e.r;return.999*a*a>r*r+n*n}function no(t){if((e=t.children)&&(l=e.length)){var e,r,n,a,i,o,s,l,u=1/0,c=-1/0,f=1/0,d=-1/0;if(e.forEach(ao),(r=e[0]).x=-r.r,r.y=0,b(r),l>1&&((n=e[1]).x=n.r,n.y=0,b(n),l>2))for(oo(r,n,a=e[2]),b(a),to(r,a),r._pack_prev=a,to(a,n),n=r._pack_next,i=3;i0)for(o=-1;++o=f[0]&&l<=f[1]&&((s=u[t.bisect(d,l,1,p)-1]).y+=g,s.push(i[o]));return u}return i.value=function(t){return arguments.length?(r=t,i):r},i.range=function(t){return arguments.length?(n=pe(t),i):n},i.bins=function(t){return arguments.length?(a="number"==typeof t?function(e){return Qi(e,t)}:pe(t),i):a},i.frequency=function(t){return arguments.length?(e=!!t,i):e},i},t.layout.pack=function(){var e,r=t.layout.hierarchy().sort(Ki),n=0,a=[1,1];function i(t,i){var o=r.call(this,t,i),s=o[0],l=a[0],u=a[1],c=null==e?Math.sqrt:"function"==typeof e?e:function(){return e};if(s.x=s.y=0,Ii(s,(function(t){t.r=+c(t.value)})),Ii(s,no),n){var f=n*(e?1:Math.max(2*s.r/l,2*s.r/u))/2;Ii(s,(function(t){t.r+=f})),Ii(s,no),Ii(s,(function(t){t.r-=f}))}return function t(e,r,n,a){var i=e.children;if(e.x=r+=a*e.x,e.y=n+=a*e.y,e.r*=a,i)for(var o=-1,s=i.length;++oh.x&&(h=t),t.depth>p.depth&&(p=t)}));var g=r(d,h)/2-d.x,v=n[0]/(h.x+r(h,d)/2+g),m=n[1]/(p.depth||1);Ri(c,(function(t){t.x=(t.x+g)*v,t.y=t.depth*m}))}return u}function o(t){var e=t.children,n=t.parent.children,a=t.i?n[t.i-1]:null;if(e.length){!function(t){var e,r=0,n=0,a=t.children,i=a.length;for(;--i>=0;)(e=a[i]).z+=r,e.m+=r,r+=e.s+(n+=e.c)}(t);var i=(e[0].z+e[e.length-1].z)/2;a?(t.z=a.z+r(t._,a._),t.m=t.z-i):t.z=i}else a&&(t.z=a.z+r(t._,a._));t.parent.A=function(t,e,n){if(e){for(var a,i=t,o=t,s=e,l=i.parent.children[0],u=i.m,c=o.m,f=s.m,d=l.m;s=uo(s),i=lo(i),s&&i;)l=lo(l),(o=uo(o)).a=t,(a=s.z+f-i.z-u+r(s._,i._))>0&&(co(fo(s,t,n),t,a),u+=a,c+=a),f+=s.m,u+=i.m,d+=l.m,c+=o.m;s&&!uo(o)&&(o.t=s,o.m+=f-c),i&&!lo(l)&&(l.t=i,l.m+=u-d,n=t)}return n}(t,a,t.parent.A||n[0])}function s(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function l(t){t.x*=n[0],t.y=t.depth*n[1]}return i.separation=function(t){return arguments.length?(r=t,i):r},i.size=function(t){return arguments.length?(a=null==(n=t)?l:null,i):a?null:n},i.nodeSize=function(t){return arguments.length?(a=null==(n=t)?null:l,i):a?n:null},Di(i,e)},t.layout.cluster=function(){var e=t.layout.hierarchy().sort(null).value(null),r=so,n=[1,1],a=!1;function i(i,o){var s,l=e.call(this,i,o),u=l[0],c=0;Ii(u,(function(e){var n=e.children;n&&n.length?(e.x=function(t){return t.reduce((function(t,e){return t+e.x}),0)/t.length}(n),e.y=function(e){return 1+t.max(e,(function(t){return t.y}))}(n)):(e.x=s?c+=r(e,s):0,e.y=0,s=e)}));var f=function t(e){var r=e.children;return r&&r.length?t(r[0]):e}(u),d=function t(e){var r,n=e.children;return n&&(r=n.length)?t(n[r-1]):e}(u),h=f.x-r(f,d)/2,p=d.x+r(d,f)/2;return Ii(u,a?function(t){t.x=(t.x-u.x)*n[0],t.y=(u.y-t.y)*n[1]}:function(t){t.x=(t.x-h)/(p-h)*n[0],t.y=(1-(u.y?t.y/u.y:1))*n[1]}),l}return i.separation=function(t){return arguments.length?(r=t,i):r},i.size=function(t){return arguments.length?(a=null==(n=t),i):a?null:n},i.nodeSize=function(t){return arguments.length?(a=null!=(n=t),i):a?n:null},Di(i,e)},t.layout.treemap=function(){var e,r=t.layout.hierarchy(),n=Math.round,a=[1,1],i=null,o=ho,s=!1,l="squarify",u=.5*(1+Math.sqrt(5));function c(t,e){for(var r,n,a=-1,i=t.length;++a0;)s.push(r=u[a-1]),s.area+=r.area,"squarify"!==l||(n=h(s,g))<=d?(u.pop(),d=n):(s.area-=s.pop().area,p(s,g,i,!1),g=Math.min(i.dx,i.dy),s.length=s.area=0,d=1/0);s.length&&(p(s,g,i,!0),s.length=s.area=0),e.forEach(f)}}function d(t){var e=t.children;if(e&&e.length){var r,n=o(t),a=e.slice(),i=[];for(c(a,n.dx*n.dy/t.value),i.area=0;r=a.pop();)i.push(r),i.area+=r.area,null!=r.z&&(p(i,r.z?n.dx:n.dy,n,!a.length),i.length=i.area=0);e.forEach(d)}}function h(t,e){for(var r,n=t.area,a=0,i=1/0,o=-1,s=t.length;++oa&&(a=r));return e*=e,(n*=n)?Math.max(e*a*u/n,n/(e*i*u)):1/0}function p(t,e,r,a){var i,o=-1,s=t.length,l=r.x,u=r.y,c=e?n(t.area/e):0;if(e==r.dx){for((a||c>r.dy)&&(c=r.dy);++or.dx)&&(c=r.dx);++o1);return t+e*r*Math.sqrt(-2*Math.log(a)/a)}},logNormal:function(){var e=t.random.normal.apply(t,arguments);return function(){return Math.exp(e())}},bates:function(e){var r=t.random.irwinHall(e);return function(){return r()/e}},irwinHall:function(t){return function(){for(var e=0,r=0;r2?_o:mo,s=a?wi:_i;return i=t(e,r,s,n),o=t(r,e,s,Ka),l}function l(t){return i(t)}return l.invert=function(t){return o(t)},l.domain=function(t){return arguments.length?(e=t.map(Number),s()):e},l.range=function(t){return arguments.length?(r=t,s()):r},l.rangeRound=function(t){return l.range(t).interpolate(pi)},l.clamp=function(t){return arguments.length?(a=t,s()):a},l.interpolate=function(t){return arguments.length?(n=t,s()):n},l.ticks=function(t){return ko(e,t)},l.tickFormat=function(t,r){return Mo(e,t,r)},l.nice=function(t){return Ao(e,t),s()},l.copy=function(){return t(e,r,n,a)},s()}([0,1],[0,1],Ka,!1)};var Eo={s:1,g:1,p:1,r:1,e:1};function So(t){return-Math.floor(Math.log(t)/Math.LN10+.01)}t.scale.log=function(){return function e(r,n,a,i){function o(t){return(a?Math.log(t<0?0:t):-Math.log(t>0?0:-t))/Math.log(n)}function s(t){return a?Math.pow(n,t):-Math.pow(n,-t)}function l(t){return r(o(t))}return l.invert=function(t){return s(r.invert(t))},l.domain=function(t){return arguments.length?(a=t[0]>=0,r.domain((i=t.map(Number)).map(o)),l):i},l.base=function(t){return arguments.length?(n=+t,r.domain(i.map(o)),l):n},l.nice=function(){var t=yo(i.map(o),a?Math:Lo);return r.domain(t),i=t.map(s),l},l.ticks=function(){var t=go(i),e=[],r=t[0],l=t[1],u=Math.floor(o(r)),c=Math.ceil(o(l)),f=n%1?2:n;if(isFinite(c-u)){if(a){for(;u0;d--)e.push(s(u)*d);for(u=0;e[u]l;c--);e=e.slice(u,c)}return e},l.tickFormat=function(e,r){if(!arguments.length)return Co;arguments.length<2?r=Co:"function"!=typeof r&&(r=t.format(r));var a=Math.max(1,n*e/l.ticks().length);return function(t){var e=t/s(Math.round(o(t)));return e*n0?a[t-1]:r[0],tf?0:1;if(u=St)return l(u,h)+(s?l(s,1-h):"")+"Z";var p,g,v,m,y,b,x,_,w,A,T,k,M=0,E=0,S=[];if((m=(+o.apply(this,arguments)||0)/2)&&(v=n===zo?Math.sqrt(s*s+u*u):+n.apply(this,arguments),h||(E*=-1),u&&(E=Pt(v/u*Math.sin(m))),s&&(M=Pt(v/s*Math.sin(m)))),u){y=u*Math.cos(c+E),b=u*Math.sin(c+E),x=u*Math.cos(f-E),_=u*Math.sin(f-E);var C=Math.abs(f-c-2*E)<=Mt?0:1;if(E&&Ho(y,b,x,_)===h^C){var L=(c+f)/2;y=u*Math.cos(L),b=u*Math.sin(L),x=_=null}}else y=b=0;if(s){w=s*Math.cos(f-M),A=s*Math.sin(f-M),T=s*Math.cos(c+M),k=s*Math.sin(c+M);var O=Math.abs(c-f+2*M)<=Mt?0:1;if(M&&Ho(w,A,T,k)===1-h^O){var D=(c+f)/2;w=s*Math.cos(D),A=s*Math.sin(D),T=k=null}}else w=A=0;if(d>Tt&&(p=Math.min(Math.abs(u-s)/2,+r.apply(this,arguments)))>.001){g=s0?0:1}function Go(t,e,r,n,a){var i=t[0]-e[0],o=t[1]-e[1],s=(a?n:-n)/Math.sqrt(i*i+o*o),l=s*o,u=-s*i,c=t[0]+l,f=t[1]+u,d=e[0]+l,h=e[1]+u,p=(c+d)/2,g=(f+h)/2,v=d-c,m=h-f,y=v*v+m*m,b=r-n,x=c*h-d*f,_=(m<0?-1:1)*Math.sqrt(Math.max(0,b*b*y-x*x)),w=(x*m-v*_)/y,A=(-x*v-m*_)/y,T=(x*m+v*_)/y,k=(-x*v+m*_)/y,M=w-p,E=A-g,S=T-p,C=k-g;return M*M+E*E>S*S+C*C&&(w=T,A=k),[[w-l,A-u],[w*r/b,A*r/b]]}function qo(t){var e=ra,r=na,n=Xr,a=Wo,i=a.key,o=.7;function s(i){var s,l=[],u=[],c=-1,f=i.length,d=pe(e),h=pe(r);function p(){l.push("M",a(t(u),o))}for(;++c1&&a.push("H",n[0]);return a.join("")},"step-before":Zo,"step-after":Jo,basis:Ko,"basis-open":function(t){if(t.length<4)return Wo(t);var e,r=[],n=-1,a=t.length,i=[0],o=[0];for(;++n<3;)e=t[n],i.push(e[0]),o.push(e[1]);r.push(ts(ns,i)+","+ts(ns,o)),--n;for(;++n9&&(a=3*e/Math.sqrt(a),o[s]=a*r,o[s+1]=a*n));s=-1;for(;++s<=l;)a=(t[Math.min(l,s+1)][0]-t[Math.max(0,s-1)][0])/(6*(1+o[s]*o[s])),i.push([a||0,o[s]*a||0]);return i}(t))}});function Wo(t){return t.length>1?t.join("L"):t+"Z"}function Yo(t){return t.join("L")+"Z"}function Zo(t){for(var e=0,r=t.length,n=t[0],a=[n[0],",",n[1]];++e1){s=e[1],i=t[l],l++,n+="C"+(a[0]+o[0])+","+(a[1]+o[1])+","+(i[0]-s[0])+","+(i[1]-s[1])+","+i[0]+","+i[1];for(var u=2;uMt)+",1 "+e}function l(t,e,r,n){return"Q 0,0 "+n}return i.radius=function(t){return arguments.length?(r=pe(t),i):r},i.source=function(e){return arguments.length?(t=pe(e),i):t},i.target=function(t){return arguments.length?(e=pe(t),i):e},i.startAngle=function(t){return arguments.length?(n=pe(t),i):n},i.endAngle=function(t){return arguments.length?(a=pe(t),i):a},i},t.svg.diagonal=function(){var t=Vn,e=Hn,r=us;function n(n,a){var i=t.call(this,n,a),o=e.call(this,n,a),s=(i.y+o.y)/2,l=[i,{x:i.x,y:s},{x:o.x,y:s},o];return"M"+(l=l.map(r))[0]+"C"+l[1]+" "+l[2]+" "+l[3]}return n.source=function(e){return arguments.length?(t=pe(e),n):t},n.target=function(t){return arguments.length?(e=pe(t),n):e},n.projection=function(t){return arguments.length?(r=t,n):r},n},t.svg.diagonal.radial=function(){var e=t.svg.diagonal(),r=us,n=e.projection;return e.projection=function(t){return arguments.length?n(cs(r=t)):r},e},t.svg.symbol=function(){var t=ds,e=fs;function r(r,n){return(ps.get(t.call(this,r,n))||hs)(e.call(this,r,n))}return r.type=function(e){return arguments.length?(t=pe(e),r):t},r.size=function(t){return arguments.length?(e=pe(t),r):e},r};var ps=t.map({circle:hs,cross:function(t){var e=Math.sqrt(t/5)/2;return"M"+-3*e+","+-e+"H"+-e+"V"+-3*e+"H"+e+"V"+-e+"H"+3*e+"V"+e+"H"+e+"V"+3*e+"H"+-e+"V"+e+"H"+-3*e+"Z"},diamond:function(t){var e=Math.sqrt(t/(2*vs)),r=e*vs;return"M0,"+-e+"L"+r+",0 0,"+e+" "+-r+",0Z"},square:function(t){var e=Math.sqrt(t)/2;return"M"+-e+","+-e+"L"+e+","+-e+" "+e+","+e+" "+-e+","+e+"Z"},"triangle-down":function(t){var e=Math.sqrt(t/gs),r=e*gs/2;return"M0,"+r+"L"+e+","+-r+" "+-e+","+-r+"Z"},"triangle-up":function(t){var e=Math.sqrt(t/gs),r=e*gs/2;return"M0,"+-r+"L"+e+","+r+" "+-e+","+r+"Z"}});t.svg.symbolTypes=ps.keys();var gs=Math.sqrt(3),vs=Math.tan(30*Lt);X.transition=function(t){for(var e,r,n=xs||++As,a=Ms(t),i=[],o=_s||{time:Date.now(),ease:ui,delay:0,duration:250},s=-1,l=this.length;++s0;)u[--d].call(t,o);if(i>=1)return f.event&&f.event.end.call(t,t.__data__,e),--c.count?delete c[n]:delete t[r],1}f||(i=a.time,o=we((function(t){var e=f.delay;if(o.t=e+i,e<=t)return d(t-e);o.c=d}),0,i),f=c[n]={tween:new _,time:i,timer:o,delay:a.delay,duration:a.duration,ease:a.ease,index:e},a=null,++c.count)}ws.call=X.call,ws.empty=X.empty,ws.node=X.node,ws.size=X.size,t.transition=function(e,r){return e&&e.transition?xs?e.transition(r):e:t.selection().transition(e)},t.transition.prototype=ws,ws.select=function(t){var e,r,n,a=this.id,i=this.namespace,o=[];t=W(t);for(var s=-1,l=this.length;++srect,.s>rect").attr("width",s[1]-s[0])}function g(t){t.select(".extent").attr("y",l[0]),t.selectAll(".extent,.e>rect,.w>rect").attr("height",l[1]-l[0])}function v(){var f,v,m=this,y=t.select(t.event.target),b=n.of(m,arguments),x=t.select(m),_=y.datum(),w=!/^(n|s)$/.test(_)&&a,A=!/^(e|w)$/.test(_)&&i,T=y.classed("extent"),k=xt(m),M=t.mouse(m),E=t.select(o(m)).on("keydown.brush",L).on("keyup.brush",O);if(t.event.changedTouches?E.on("touchmove.brush",D).on("touchend.brush",I):E.on("mousemove.brush",D).on("mouseup.brush",I),x.interrupt().selectAll("*").interrupt(),T)M[0]=s[0]-M[0],M[1]=l[0]-M[1];else if(_){var S=+/w$/.test(_),C=+/^n/.test(_);v=[s[1-S]-M[0],l[1-C]-M[1]],M[0]=s[S],M[1]=l[C]}else t.event.altKey&&(f=M.slice());function L(){32==t.event.keyCode&&(T||(f=null,M[0]-=s[1],M[1]-=l[1],T=2),z())}function O(){32==t.event.keyCode&&2==T&&(M[0]+=s[1],M[1]+=l[1],T=0,z())}function D(){var e=t.mouse(m),r=!1;v&&(e[0]+=v[0],e[1]+=v[1]),T||(t.event.altKey?(f||(f=[(s[0]+s[1])/2,(l[0]+l[1])/2]),M[0]=s[+(e[0]1?{floor:function(e){for(;s(e=t.floor(e));)e=Bs(e-1);return e},ceil:function(e){for(;s(e=t.ceil(e));)e=Bs(+e+1);return e}}:t))},a.ticks=function(t,e){var r=go(a.domain()),n=null==t?i(r,10):"number"==typeof t?i(r,t):!t.range&&[{range:t},e];return n&&(t=n[0],e=n[1]),t.range(r[0],Bs(+r[1]+1),e<1?1:e)},a.tickFormat=function(){return n},a.copy=function(){return Ns(e.copy(),r,n)},wo(a,e)}function Bs(t){return new Date(t)}Is.iso=Date.prototype.toISOString&&+new Date("2000-01-01T00:00:00.000Z")?zs:Fs,zs.parse=function(t){var e=new Date(t);return isNaN(e)?null:e},zs.toString=Fs.toString,De.second=Fe((function(t){return new Re(1e3*Math.floor(t/1e3))}),(function(t,e){t.setTime(t.getTime()+1e3*Math.floor(e))}),(function(t){return t.getSeconds()})),De.seconds=De.second.range,De.seconds.utc=De.second.utc.range,De.minute=Fe((function(t){return new Re(6e4*Math.floor(t/6e4))}),(function(t,e){t.setTime(t.getTime()+6e4*Math.floor(e))}),(function(t){return t.getMinutes()})),De.minutes=De.minute.range,De.minutes.utc=De.minute.utc.range,De.hour=Fe((function(t){var e=t.getTimezoneOffset()/60;return new Re(36e5*(Math.floor(t/36e5-e)+e))}),(function(t,e){t.setTime(t.getTime()+36e5*Math.floor(e))}),(function(t){return t.getHours()})),De.hours=De.hour.range,De.hours.utc=De.hour.utc.range,De.month=Fe((function(t){return(t=De.day(t)).setDate(1),t}),(function(t,e){t.setMonth(t.getMonth()+e)}),(function(t){return t.getMonth()})),De.months=De.month.range,De.months.utc=De.month.utc.range;var js=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],Us=[[De.second,1],[De.second,5],[De.second,15],[De.second,30],[De.minute,1],[De.minute,5],[De.minute,15],[De.minute,30],[De.hour,1],[De.hour,3],[De.hour,6],[De.hour,12],[De.day,1],[De.day,2],[De.week,1],[De.month,1],[De.month,3],[De.year,1]],Vs=Is.multi([[".%L",function(t){return t.getMilliseconds()}],[":%S",function(t){return t.getSeconds()}],["%I:%M",function(t){return t.getMinutes()}],["%I %p",function(t){return t.getHours()}],["%a %d",function(t){return t.getDay()&&1!=t.getDate()}],["%b %d",function(t){return 1!=t.getDate()}],["%B",function(t){return t.getMonth()}],["%Y",Xr]]),Hs={range:function(e,r,n){return t.range(Math.ceil(e/n)*n,+r,n).map(Bs)},floor:L,ceil:L};Us.year=De.year,De.scale=function(){return Ns(t.scale.linear(),Us,Vs)};var Gs=Us.map((function(t){return[t[0].utc,t[1]]})),qs=Ps.multi([[".%L",function(t){return t.getUTCMilliseconds()}],[":%S",function(t){return t.getUTCSeconds()}],["%I:%M",function(t){return t.getUTCMinutes()}],["%I %p",function(t){return t.getUTCHours()}],["%a %d",function(t){return t.getUTCDay()&&1!=t.getUTCDate()}],["%b %d",function(t){return 1!=t.getUTCDate()}],["%B",function(t){return t.getUTCMonth()}],["%Y",Xr]]);function Xs(t){return JSON.parse(t.responseText)}function Ws(t){var e=a.createRange();return e.selectNode(a.body),e.createContextualFragment(t.responseText)}Gs.year=De.year.utc,De.scale.utc=function(){return Ns(t.scale.linear(),Gs,qs)},t.text=ge((function(t){return t.responseText})),t.json=function(t,e){return ve(t,"application/json",Xs,e)},t.html=function(t,e){return ve(t,"text/html",Ws,e)},t.xml=ge((function(t){return t.responseXML})),"object"==typeof e&&e.exports?e.exports=t:this.d3=t}()},{}],87:[function(t,e,r){e.exports=function(){for(var t=0;ts*l){var h=(d-f)/s;i[c]=1e3*h}}return i}function o(t){for(var e=[],r=t[0];r<=t[1];r++)for(var n=String.fromCharCode(r),a=t[0];a>>31},e.exports.exponent=function(t){return(e.exports.hi(t)<<1>>>21)-1023},e.exports.fraction=function(t){var r=e.exports.lo(t),n=e.exports.hi(t),a=1048575&n;return 2146435072&n&&(a+=1<<20),[r,a]},e.exports.denormalized=function(t){return!(2146435072&e.exports.hi(t))}}).call(this)}).call(this,t("buffer").Buffer)},{buffer:52}],90:[function(t,e,r){var n=t("abs-svg-path"),a=t("normalize-svg-path"),i={M:"moveTo",C:"bezierCurveTo"};e.exports=function(t,e){t.beginPath(),a(n(e)).forEach((function(e){var r=e[0],n=e.slice(1);t[i[r]].apply(t,n)})),t.closePath()}},{"abs-svg-path":12,"normalize-svg-path":261}],91:[function(t,e,r){e.exports=function(t){switch(t){case"int8":return Int8Array;case"int16":return Int16Array;case"int32":return Int32Array;case"uint8":return Uint8Array;case"uint16":return Uint16Array;case"uint32":return Uint32Array;case"float32":return Float32Array;case"float64":return Float64Array;case"array":return Array;case"uint8_clamped":return Uint8ClampedArray}}},{}],92:[function(t,e,r){"use strict";e.exports=function(t,e){switch("undefined"==typeof e&&(e=0),typeof t){case"number":if(t>0)return function(t,e){var r,n;for(r=new Array(t),n=0;n80*r){n=l=t[0],s=u=t[1];for(var x=r;xl&&(l=c),h>u&&(u=h);p=0!==(p=Math.max(l-n,u-s))?1/p:0}return o(y,b,r,n,s,p),b}function a(t,e,r,n,a){var i,o;if(a===S(t,e,r,n)>0)for(i=e;i=e;i-=n)o=k(i,t[i],t[i+1],o);return o&&b(o,o.next)&&(M(o),o=o.next),o}function i(t,e){if(!t)return t;e||(e=t);var r,n=t;do{if(r=!1,n.steiner||!b(n,n.next)&&0!==y(n.prev,n,n.next))n=n.next;else{if(M(n),(n=e=n.prev)===n.next)break;r=!0}}while(r||n!==e);return e}function o(t,e,r,n,a,f,d){if(t){!d&&f&&function(t,e,r,n){var a=t;do{null===a.z&&(a.z=p(a.x,a.y,e,r,n)),a.prevZ=a.prev,a.nextZ=a.next,a=a.next}while(a!==t);a.prevZ.nextZ=null,a.prevZ=null,function(t){var e,r,n,a,i,o,s,l,u=1;do{for(r=t,t=null,i=null,o=0;r;){for(o++,n=r,s=0,e=0;e0||l>0&&n;)0!==s&&(0===l||!n||r.z<=n.z)?(a=r,r=r.nextZ,s--):(a=n,n=n.nextZ,l--),i?i.nextZ=a:t=a,a.prevZ=i,i=a;r=n}i.nextZ=null,u*=2}while(o>1)}(a)}(t,n,a,f);for(var h,g,v=t;t.prev!==t.next;)if(h=t.prev,g=t.next,f?l(t,n,a,f):s(t))e.push(h.i/r),e.push(t.i/r),e.push(g.i/r),M(t),t=g.next,v=g.next;else if((t=g)===v){d?1===d?o(t=u(i(t),e,r),e,r,n,a,f,2):2===d&&c(t,e,r,n,a,f):o(i(t),e,r,n,a,f,1);break}}}function s(t){var e=t.prev,r=t,n=t.next;if(y(e,r,n)>=0)return!1;for(var a=t.next.next;a!==t.prev;){if(v(e.x,e.y,r.x,r.y,n.x,n.y,a.x,a.y)&&y(a.prev,a,a.next)>=0)return!1;a=a.next}return!0}function l(t,e,r,n){var a=t.prev,i=t,o=t.next;if(y(a,i,o)>=0)return!1;for(var s=a.xi.x?a.x>o.x?a.x:o.x:i.x>o.x?i.x:o.x,c=a.y>i.y?a.y>o.y?a.y:o.y:i.y>o.y?i.y:o.y,f=p(s,l,e,r,n),d=p(u,c,e,r,n),h=t.prevZ,g=t.nextZ;h&&h.z>=f&&g&&g.z<=d;){if(h!==t.prev&&h!==t.next&&v(a.x,a.y,i.x,i.y,o.x,o.y,h.x,h.y)&&y(h.prev,h,h.next)>=0)return!1;if(h=h.prevZ,g!==t.prev&&g!==t.next&&v(a.x,a.y,i.x,i.y,o.x,o.y,g.x,g.y)&&y(g.prev,g,g.next)>=0)return!1;g=g.nextZ}for(;h&&h.z>=f;){if(h!==t.prev&&h!==t.next&&v(a.x,a.y,i.x,i.y,o.x,o.y,h.x,h.y)&&y(h.prev,h,h.next)>=0)return!1;h=h.prevZ}for(;g&&g.z<=d;){if(g!==t.prev&&g!==t.next&&v(a.x,a.y,i.x,i.y,o.x,o.y,g.x,g.y)&&y(g.prev,g,g.next)>=0)return!1;g=g.nextZ}return!0}function u(t,e,r){var n=t;do{var a=n.prev,o=n.next.next;!b(a,o)&&x(a,n,n.next,o)&&A(a,o)&&A(o,a)&&(e.push(a.i/r),e.push(n.i/r),e.push(o.i/r),M(n),M(n.next),n=t=o),n=n.next}while(n!==t);return i(n)}function c(t,e,r,n,a,s){var l=t;do{for(var u=l.next.next;u!==l.prev;){if(l.i!==u.i&&m(l,u)){var c=T(l,u);return l=i(l,l.next),c=i(c,c.next),o(l,e,r,n,a,s),void o(c,e,r,n,a,s)}u=u.next}l=l.next}while(l!==t)}function f(t,e){return t.x-e.x}function d(t,e){if(e=function(t,e){var r,n=e,a=t.x,i=t.y,o=-1/0;do{if(i<=n.y&&i>=n.next.y&&n.next.y!==n.y){var s=n.x+(i-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=a&&s>o){if(o=s,s===a){if(i===n.y)return n;if(i===n.next.y)return n.next}r=n.x=n.x&&n.x>=c&&a!==n.x&&v(ir.x||n.x===r.x&&h(r,n)))&&(r=n,d=l)),n=n.next}while(n!==u);return r}(t,e)){var r=T(e,t);i(e,e.next),i(r,r.next)}}function h(t,e){return y(t.prev,t,e.prev)<0&&y(e.next,t,t.next)<0}function p(t,e,r,n,a){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*a)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*a)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function g(t){var e=t,r=t;do{(e.x=0&&(t-o)*(n-s)-(r-o)*(e-s)>=0&&(r-o)*(i-s)-(a-o)*(n-s)>=0}function m(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&x(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&(A(t,e)&&A(e,t)&&function(t,e){var r=t,n=!1,a=(t.x+e.x)/2,i=(t.y+e.y)/2;do{r.y>i!=r.next.y>i&&r.next.y!==r.y&&a<(r.next.x-r.x)*(i-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==t);return n}(t,e)&&(y(t.prev,t,e.prev)||y(t,e.prev,e))||b(t,e)&&y(t.prev,t,t.next)>0&&y(e.prev,e,e.next)>0)}function y(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function b(t,e){return t.x===e.x&&t.y===e.y}function x(t,e,r,n){var a=w(y(t,e,r)),i=w(y(t,e,n)),o=w(y(r,n,t)),s=w(y(r,n,e));return a!==i&&o!==s||(!(0!==a||!_(t,r,e))||(!(0!==i||!_(t,n,e))||(!(0!==o||!_(r,t,n))||!(0!==s||!_(r,e,n)))))}function _(t,e,r){return e.x<=Math.max(t.x,r.x)&&e.x>=Math.min(t.x,r.x)&&e.y<=Math.max(t.y,r.y)&&e.y>=Math.min(t.y,r.y)}function w(t){return t>0?1:t<0?-1:0}function A(t,e){return y(t.prev,t,t.next)<0?y(t,e,t.next)>=0&&y(t,t.prev,e)>=0:y(t,e,t.prev)<0||y(t,t.next,e)<0}function T(t,e){var r=new E(t.i,t.x,t.y),n=new E(e.i,e.x,e.y),a=t.next,i=e.prev;return t.next=e,e.prev=t,r.next=a,a.prev=r,n.next=r,r.prev=n,i.next=n,n.prev=i,n}function k(t,e,r,n){var a=new E(t,e,r);return n?(a.next=n.next,a.prev=n,n.next.prev=a,n.next=a):(a.prev=a,a.next=a),a}function M(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function E(t,e,r){this.i=t,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function S(t,e,r,n){for(var a=0,i=e,o=r-n;i0&&(n+=t[a-1].length,r.holes.push(n))}return r}},{}],94:[function(t,e,r){"use strict";e.exports=function(t,e){var r=t.length;if("number"!=typeof e){e=0;for(var a=0;a=55296&&y<=56319&&(w+=t[++r]),w=A?d.call(A,T,w,g):w,e?(h.value=w,p(v,g,h)):v[g]=w,++g;m=g}if(void 0===m)for(m=o(t.length),e&&(v=new e(m)),r=0;r0?1:-1}},{}],105:[function(t,e,r){"use strict";var n=t("../math/sign"),a=Math.abs,i=Math.floor;e.exports=function(t){return isNaN(t)?0:0!==(t=Number(t))&&isFinite(t)?n(t)*i(a(t)):t}},{"../math/sign":102}],106:[function(t,e,r){"use strict";var n=t("./to-integer"),a=Math.max;e.exports=function(t){return a(0,n(t))}},{"./to-integer":105}],107:[function(t,e,r){"use strict";var n=t("./valid-callable"),a=t("./valid-value"),i=Function.prototype.bind,o=Function.prototype.call,s=Object.keys,l=Object.prototype.propertyIsEnumerable;e.exports=function(t,e){return function(r,u){var c,f=arguments[2],d=arguments[3];return r=Object(a(r)),n(u),c=s(r),d&&c.sort("function"==typeof d?i.call(d,r):void 0),"function"!=typeof t&&(t=c[t]),o.call(t,c,(function(t,n){return l.call(r,t)?o.call(u,f,r[t],t,r,n):e}))}}},{"./valid-callable":124,"./valid-value":126}],108:[function(t,e,r){"use strict";e.exports=t("./is-implemented")()?Object.assign:t("./shim")},{"./is-implemented":109,"./shim":110}],109:[function(t,e,r){"use strict";e.exports=function(){var t,e=Object.assign;return"function"==typeof e&&(e(t={foo:"raz"},{bar:"dwa"},{trzy:"trzy"}),t.foo+t.bar+t.trzy==="razdwatrzy")}},{}],110:[function(t,e,r){"use strict";var n=t("../keys"),a=t("../valid-value"),i=Math.max;e.exports=function(t,e){var r,o,s,l=i(arguments.length,2);for(t=Object(a(t)),s=function(n){try{t[n]=e[n]}catch(t){r||(r=t)}},o=1;o-1}},{}],130:[function(t,e,r){"use strict";var n=Object.prototype.toString,a=n.call("");e.exports=function(t){return"string"==typeof t||t&&"object"==typeof t&&(t instanceof String||n.call(t)===a)||!1}},{}],131:[function(t,e,r){"use strict";var n=Object.create(null),a=Math.random;e.exports=function(){var t;do{t=a().toString(36).slice(2)}while(n[t]);return t}},{}],132:[function(t,e,r){"use strict";var n,a=t("es5-ext/object/set-prototype-of"),i=t("es5-ext/string/#/contains"),o=t("d"),s=t("es6-symbol"),l=t("./"),u=Object.defineProperty;n=e.exports=function(t,e){if(!(this instanceof n))throw new TypeError("Constructor requires 'new'");l.call(this,t),e=e?i.call(e,"key+value")?"key+value":i.call(e,"key")?"key":"value":"value",u(this,"__kind__",o("",e))},a&&a(n,l),delete n.prototype.constructor,n.prototype=Object.create(l.prototype,{_resolve:o((function(t){return"value"===this.__kind__?this.__list__[t]:"key+value"===this.__kind__?[t,this.__list__[t]]:t}))}),u(n.prototype,s.toStringTag,o("c","Array Iterator"))},{"./":135,d:83,"es5-ext/object/set-prototype-of":121,"es5-ext/string/#/contains":127,"es6-symbol":140}],133:[function(t,e,r){"use strict";var n=t("es5-ext/function/is-arguments"),a=t("es5-ext/object/valid-callable"),i=t("es5-ext/string/is-string"),o=t("./get"),s=Array.isArray,l=Function.prototype.call,u=Array.prototype.some;e.exports=function(t,e){var r,c,f,d,h,p,g,v,m=arguments[2];if(s(t)||n(t)?r="array":i(t)?r="string":t=o(t),a(e),f=function(){d=!0},"array"!==r)if("string"!==r)for(c=t.next();!c.done;){if(l.call(e,m,c.value,f),d)return;c=t.next()}else for(p=t.length,h=0;h=55296&&v<=56319&&(g+=t[++h]),l.call(e,m,g,f),!d);++h);else u.call(t,(function(t){return l.call(e,m,t,f),d}))}},{"./get":134,"es5-ext/function/is-arguments":99,"es5-ext/object/valid-callable":124,"es5-ext/string/is-string":130}],134:[function(t,e,r){"use strict";var n=t("es5-ext/function/is-arguments"),a=t("es5-ext/string/is-string"),i=t("./array"),o=t("./string"),s=t("./valid-iterable"),l=t("es6-symbol").iterator;e.exports=function(t){return"function"==typeof s(t)[l]?t[l]():n(t)?new i(t):a(t)?new o(t):new i(t)}},{"./array":132,"./string":137,"./valid-iterable":138,"es5-ext/function/is-arguments":99,"es5-ext/string/is-string":130,"es6-symbol":140}],135:[function(t,e,r){"use strict";var n,a=t("es5-ext/array/#/clear"),i=t("es5-ext/object/assign"),o=t("es5-ext/object/valid-callable"),s=t("es5-ext/object/valid-value"),l=t("d"),u=t("d/auto-bind"),c=t("es6-symbol"),f=Object.defineProperty,d=Object.defineProperties;e.exports=n=function(t,e){if(!(this instanceof n))throw new TypeError("Constructor requires 'new'");d(this,{__list__:l("w",s(t)),__context__:l("w",e),__nextIndex__:l("w",0)}),e&&(o(e.on),e.on("_add",this._onAdd),e.on("_delete",this._onDelete),e.on("_clear",this._onClear))},delete n.prototype.constructor,d(n.prototype,i({_next:l((function(){var t;if(this.__list__)return this.__redo__&&void 0!==(t=this.__redo__.shift())?t:this.__nextIndex__=this.__nextIndex__||(++this.__nextIndex__,this.__redo__?(this.__redo__.forEach((function(e,r){e>=t&&(this.__redo__[r]=++e)}),this),this.__redo__.push(t)):f(this,"__redo__",l("c",[t])))})),_onDelete:l((function(t){var e;t>=this.__nextIndex__||(--this.__nextIndex__,this.__redo__&&(-1!==(e=this.__redo__.indexOf(t))&&this.__redo__.splice(e,1),this.__redo__.forEach((function(e,r){e>t&&(this.__redo__[r]=--e)}),this)))})),_onClear:l((function(){this.__redo__&&a.call(this.__redo__),this.__nextIndex__=0}))}))),f(n.prototype,c.iterator,l((function(){return this})))},{d:83,"d/auto-bind":82,"es5-ext/array/#/clear":95,"es5-ext/object/assign":108,"es5-ext/object/valid-callable":124,"es5-ext/object/valid-value":126,"es6-symbol":140}],136:[function(t,e,r){"use strict";var n=t("es5-ext/function/is-arguments"),a=t("es5-ext/object/is-value"),i=t("es5-ext/string/is-string"),o=t("es6-symbol").iterator,s=Array.isArray;e.exports=function(t){return!!a(t)&&(!!s(t)||(!!i(t)||(!!n(t)||"function"==typeof t[o])))}},{"es5-ext/function/is-arguments":99,"es5-ext/object/is-value":115,"es5-ext/string/is-string":130,"es6-symbol":140}],137:[function(t,e,r){"use strict";var n,a=t("es5-ext/object/set-prototype-of"),i=t("d"),o=t("es6-symbol"),s=t("./"),l=Object.defineProperty;n=e.exports=function(t){if(!(this instanceof n))throw new TypeError("Constructor requires 'new'");t=String(t),s.call(this,t),l(this,"__length__",i("",t.length))},a&&a(n,s),delete n.prototype.constructor,n.prototype=Object.create(s.prototype,{_next:i((function(){if(this.__list__)return this.__nextIndex__=55296&&e<=56319?r+this.__list__[this.__nextIndex__++]:r}))}),l(n.prototype,o.toStringTag,i("c","String Iterator"))},{"./":135,d:83,"es5-ext/object/set-prototype-of":121,"es6-symbol":140}],138:[function(t,e,r){"use strict";var n=t("./is-iterable");e.exports=function(t){if(!n(t))throw new TypeError(t+" is not iterable");return t}},{"./is-iterable":136}],139:[function(t,e,r){(function(n,a){(function(){ /*! * @overview es6-promise - a tiny implementation of Promises/A+. * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald) * @license Licensed under MIT license * See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE * @version v4.2.8+1e68dce6 */ !function(t,n){"object"==typeof r&&"undefined"!=typeof e?e.exports=n():t.ES6Promise=n()}(this,(function(){"use strict";function e(t){return"function"==typeof t}var r=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)},i=0,o=void 0,s=void 0,l=function(t,e){g[i]=t,g[i+1]=e,2===(i+=2)&&(s?s(v):_())};var u="undefined"!=typeof window?window:void 0,c=u||{},f=c.MutationObserver||c.WebKitMutationObserver,d="undefined"==typeof self&&"undefined"!=typeof n&&"[object process]"==={}.toString.call(n),h="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function p(){var t=setTimeout;return function(){return t(v,1)}}var g=new Array(1e3);function v(){for(var t=0;te[0]-o[0]/2&&(d=o[0]/2,h+=o[1]);return r}},{"css-font/stringify":76}],158:[function(t,e,r){"use strict";function n(t,e){e||(e={}),("string"==typeof t||Array.isArray(t))&&(e.family=t);var r=Array.isArray(e.family)?e.family.join(", "):e.family;if(!r)throw Error("`family` must be defined");var s=e.size||e.fontSize||e.em||48,l=e.weight||e.fontWeight||"",u=(t=[e.style||e.fontStyle||"",l,s].join(" ")+"px "+r,e.origin||"top");if(n.cache[r]&&s<=n.cache[r].em)return a(n.cache[r],u);var c=e.canvas||n.canvas,f=c.getContext("2d"),d={upper:void 0!==e.upper?e.upper:"H",lower:void 0!==e.lower?e.lower:"x",descent:void 0!==e.descent?e.descent:"p",ascent:void 0!==e.ascent?e.ascent:"h",tittle:void 0!==e.tittle?e.tittle:"i",overshoot:void 0!==e.overshoot?e.overshoot:"O"},h=Math.ceil(1.5*s);c.height=h,c.width=.5*h,f.font=t;var p={top:0};f.clearRect(0,0,h,h),f.textBaseline="top",f.fillStyle="black",f.fillText("H",0,0);var g=i(f.getImageData(0,0,h,h));f.clearRect(0,0,h,h),f.textBaseline="bottom",f.fillText("H",0,h);var v=i(f.getImageData(0,0,h,h));p.lineHeight=p.bottom=h-v+g,f.clearRect(0,0,h,h),f.textBaseline="alphabetic",f.fillText("H",0,h);var m=h-i(f.getImageData(0,0,h,h))-1+g;p.baseline=p.alphabetic=m,f.clearRect(0,0,h,h),f.textBaseline="middle",f.fillText("H",0,.5*h);var y=i(f.getImageData(0,0,h,h));p.median=p.middle=h-y-1+g-.5*h,f.clearRect(0,0,h,h),f.textBaseline="hanging",f.fillText("H",0,.5*h);var b=i(f.getImageData(0,0,h,h));p.hanging=h-b-1+g-.5*h,f.clearRect(0,0,h,h),f.textBaseline="ideographic",f.fillText("H",0,h);var x=i(f.getImageData(0,0,h,h));if(p.ideographic=h-x-1+g,d.upper&&(f.clearRect(0,0,h,h),f.textBaseline="top",f.fillText(d.upper,0,0),p.upper=i(f.getImageData(0,0,h,h)),p.capHeight=p.baseline-p.upper),d.lower&&(f.clearRect(0,0,h,h),f.textBaseline="top",f.fillText(d.lower,0,0),p.lower=i(f.getImageData(0,0,h,h)),p.xHeight=p.baseline-p.lower),d.tittle&&(f.clearRect(0,0,h,h),f.textBaseline="top",f.fillText(d.tittle,0,0),p.tittle=i(f.getImageData(0,0,h,h))),d.ascent&&(f.clearRect(0,0,h,h),f.textBaseline="top",f.fillText(d.ascent,0,0),p.ascent=i(f.getImageData(0,0,h,h))),d.descent&&(f.clearRect(0,0,h,h),f.textBaseline="top",f.fillText(d.descent,0,0),p.descent=o(f.getImageData(0,0,h,h))),d.overshoot){f.clearRect(0,0,h,h),f.textBaseline="top",f.fillText(d.overshoot,0,0);var _=o(f.getImageData(0,0,h,h));p.overshoot=_-m}for(var w in p)p[w]/=s;return p.em=s,n.cache[r]=p,a(p,u)}function a(t,e){var r={};for(var n in"string"==typeof e&&(e=t[e]),t)"em"!==n&&(r[n]=t[n]-e);return r}function i(t){for(var e=t.height,r=t.data,n=3;n0;n-=4)if(0!==r[n])return Math.floor(.25*(n-3)/e)}e.exports=n,n.canvas=document.createElement("canvas"),n.cache={}},{}],159:[function(t,e,r){"use strict";e.exports=function(t){return new s(t||g,null)};function n(t,e,r,n,a,i){this._color=t,this.key=e,this.value=r,this.left=n,this.right=a,this._count=i}function a(t){return new n(t._color,t.key,t.value,t.left,t.right,t._count)}function i(t,e){return new n(t,e.key,e.value,e.left,e.right,e._count)}function o(t){t._count=1+(t.left?t.left._count:0)+(t.right?t.right._count:0)}function s(t,e){this._compare=t,this.root=e}var l=s.prototype;function u(t,e){var r;if(e.left&&(r=u(t,e.left)))return r;return(r=t(e.key,e.value))||(e.right?u(t,e.right):void 0)}function c(t,e,r,n){if(e(t,n.key)<=0){var a;if(n.left)if(a=c(t,e,r,n.left))return a;if(a=r(n.key,n.value))return a}if(n.right)return c(t,e,r,n.right)}function f(t,e,r,n,a){var i,o=r(t,a.key),s=r(e,a.key);if(o<=0){if(a.left&&(i=f(t,e,r,n,a.left)))return i;if(s>0&&(i=n(a.key,a.value)))return i}if(s>0&&a.right)return f(t,e,r,n,a.right)}function d(t,e){this.tree=t,this._stack=e}Object.defineProperty(l,"keys",{get:function(){var t=[];return this.forEach((function(e,r){t.push(e)})),t}}),Object.defineProperty(l,"values",{get:function(){var t=[];return this.forEach((function(e,r){t.push(r)})),t}}),Object.defineProperty(l,"length",{get:function(){return this.root?this.root._count:0}}),l.insert=function(t,e){for(var r=this._compare,a=this.root,l=[],u=[];a;){var c=r(t,a.key);l.push(a),u.push(c),a=c<=0?a.left:a.right}l.push(new n(0,t,e,null,null,1));for(var f=l.length-2;f>=0;--f){a=l[f];u[f]<=0?l[f]=new n(a._color,a.key,a.value,l[f+1],a.right,a._count+1):l[f]=new n(a._color,a.key,a.value,a.left,l[f+1],a._count+1)}for(f=l.length-1;f>1;--f){var d=l[f-1];a=l[f];if(1===d._color||1===a._color)break;var h=l[f-2];if(h.left===d)if(d.left===a){if(!(p=h.right)||0!==p._color){if(h._color=0,h.left=d.right,d._color=1,d.right=h,l[f-2]=d,l[f-1]=a,o(h),o(d),f>=3)(g=l[f-3]).left===h?g.left=d:g.right=d;break}d._color=1,h.right=i(1,p),h._color=0,f-=1}else{if(!(p=h.right)||0!==p._color){if(d.right=a.left,h._color=0,h.left=a.right,a._color=1,a.left=d,a.right=h,l[f-2]=a,l[f-1]=d,o(h),o(d),o(a),f>=3)(g=l[f-3]).left===h?g.left=a:g.right=a;break}d._color=1,h.right=i(1,p),h._color=0,f-=1}else if(d.right===a){if(!(p=h.left)||0!==p._color){if(h._color=0,h.right=d.left,d._color=1,d.left=h,l[f-2]=d,l[f-1]=a,o(h),o(d),f>=3)(g=l[f-3]).right===h?g.right=d:g.left=d;break}d._color=1,h.left=i(1,p),h._color=0,f-=1}else{var p;if(!(p=h.left)||0!==p._color){var g;if(d.left=a.right,h._color=0,h.right=a.left,a._color=1,a.right=d,a.left=h,l[f-2]=a,l[f-1]=d,o(h),o(d),o(a),f>=3)(g=l[f-3]).right===h?g.right=a:g.left=a;break}d._color=1,h.left=i(1,p),h._color=0,f-=1}}return l[0]._color=1,new s(r,l[0])},l.forEach=function(t,e,r){if(this.root)switch(arguments.length){case 1:return u(t,this.root);case 2:return c(e,this._compare,t,this.root);case 3:if(this._compare(e,r)>=0)return;return f(e,r,this._compare,t,this.root)}},Object.defineProperty(l,"begin",{get:function(){for(var t=[],e=this.root;e;)t.push(e),e=e.left;return new d(this,t)}}),Object.defineProperty(l,"end",{get:function(){for(var t=[],e=this.root;e;)t.push(e),e=e.right;return new d(this,t)}}),l.at=function(t){if(t<0)return new d(this,[]);for(var e=this.root,r=[];;){if(r.push(e),e.left){if(t=e.right._count)break;e=e.right}return new d(this,[])},l.ge=function(t){for(var e=this._compare,r=this.root,n=[],a=0;r;){var i=e(t,r.key);n.push(r),i<=0&&(a=n.length),r=i<=0?r.left:r.right}return n.length=a,new d(this,n)},l.gt=function(t){for(var e=this._compare,r=this.root,n=[],a=0;r;){var i=e(t,r.key);n.push(r),i<0&&(a=n.length),r=i<0?r.left:r.right}return n.length=a,new d(this,n)},l.lt=function(t){for(var e=this._compare,r=this.root,n=[],a=0;r;){var i=e(t,r.key);n.push(r),i>0&&(a=n.length),r=i<=0?r.left:r.right}return n.length=a,new d(this,n)},l.le=function(t){for(var e=this._compare,r=this.root,n=[],a=0;r;){var i=e(t,r.key);n.push(r),i>=0&&(a=n.length),r=i<0?r.left:r.right}return n.length=a,new d(this,n)},l.find=function(t){for(var e=this._compare,r=this.root,n=[];r;){var a=e(t,r.key);if(n.push(r),0===a)return new d(this,n);r=a<=0?r.left:r.right}return new d(this,[])},l.remove=function(t){var e=this.find(t);return e?e.remove():this},l.get=function(t){for(var e=this._compare,r=this.root;r;){var n=e(t,r.key);if(0===n)return r.value;r=n<=0?r.left:r.right}};var h=d.prototype;function p(t,e){t.key=e.key,t.value=e.value,t.left=e.left,t.right=e.right,t._color=e._color,t._count=e._count}function g(t,e){return te?1:0}Object.defineProperty(h,"valid",{get:function(){return this._stack.length>0}}),Object.defineProperty(h,"node",{get:function(){return this._stack.length>0?this._stack[this._stack.length-1]:null},enumerable:!0}),h.clone=function(){return new d(this.tree,this._stack.slice())},h.remove=function(){var t=this._stack;if(0===t.length)return this.tree;var e=new Array(t.length),r=t[t.length-1];e[e.length-1]=new n(r._color,r.key,r.value,r.left,r.right,r._count);for(var l=t.length-2;l>=0;--l){(r=t[l]).left===t[l+1]?e[l]=new n(r._color,r.key,r.value,e[l+1],r.right,r._count):e[l]=new n(r._color,r.key,r.value,r.left,e[l+1],r._count)}if((r=e[e.length-1]).left&&r.right){var u=e.length;for(r=r.left;r.right;)e.push(r),r=r.right;var c=e[u-1];e.push(new n(r._color,c.key,c.value,r.left,r.right,r._count)),e[u-1].key=r.key,e[u-1].value=r.value;for(l=e.length-2;l>=u;--l)r=e[l],e[l]=new n(r._color,r.key,r.value,r.left,e[l+1],r._count);e[u-1].left=e[u]}if(0===(r=e[e.length-1])._color){var f=e[e.length-2];f.left===r?f.left=null:f.right===r&&(f.right=null),e.pop();for(l=0;l=0;--l){if(e=t[l],0===l)return void(e._color=1);if((r=t[l-1]).left===e){if((n=r.right).right&&0===n.right._color){if(s=(n=r.right=a(n)).right=a(n.right),r.right=n.left,n.left=r,n.right=s,n._color=r._color,e._color=1,r._color=1,s._color=1,o(r),o(n),l>1)(u=t[l-2]).left===r?u.left=n:u.right=n;return void(t[l-1]=n)}if(n.left&&0===n.left._color){if(s=(n=r.right=a(n)).left=a(n.left),r.right=s.left,n.left=s.right,s.left=r,s.right=n,s._color=r._color,r._color=1,n._color=1,e._color=1,o(r),o(n),o(s),l>1)(u=t[l-2]).left===r?u.left=s:u.right=s;return void(t[l-1]=s)}if(1===n._color){if(0===r._color)return r._color=1,void(r.right=i(0,n));r.right=i(0,n);continue}n=a(n),r.right=n.left,n.left=r,n._color=r._color,r._color=0,o(r),o(n),l>1&&((u=t[l-2]).left===r?u.left=n:u.right=n),t[l-1]=n,t[l]=r,l+11)(u=t[l-2]).right===r?u.right=n:u.left=n;return void(t[l-1]=n)}if(n.right&&0===n.right._color){if(s=(n=r.left=a(n)).right=a(n.right),r.left=s.right,n.right=s.left,s.right=r,s.left=n,s._color=r._color,r._color=1,n._color=1,e._color=1,o(r),o(n),o(s),l>1)(u=t[l-2]).right===r?u.right=s:u.left=s;return void(t[l-1]=s)}if(1===n._color){if(0===r._color)return r._color=1,void(r.left=i(0,n));r.left=i(0,n);continue}var u;n=a(n),r.left=n.right,n.right=r,n._color=r._color,r._color=0,o(r),o(n),l>1&&((u=t[l-2]).right===r?u.right=n:u.left=n),t[l-1]=n,t[l]=r,l+10)return this._stack[this._stack.length-1].key},enumerable:!0}),Object.defineProperty(h,"value",{get:function(){if(this._stack.length>0)return this._stack[this._stack.length-1].value},enumerable:!0}),Object.defineProperty(h,"index",{get:function(){var t=0,e=this._stack;if(0===e.length){var r=this.tree.root;return r?r._count:0}e[e.length-1].left&&(t=e[e.length-1].left._count);for(var n=e.length-2;n>=0;--n)e[n+1]===e[n].right&&(++t,e[n].left&&(t+=e[n].left._count));return t},enumerable:!0}),h.next=function(){var t=this._stack;if(0!==t.length){var e=t[t.length-1];if(e.right)for(e=e.right;e;)t.push(e),e=e.left;else for(t.pop();t.length>0&&t[t.length-1].right===e;)e=t[t.length-1],t.pop()}},Object.defineProperty(h,"hasNext",{get:function(){var t=this._stack;if(0===t.length)return!1;if(t[t.length-1].right)return!0;for(var e=t.length-1;e>0;--e)if(t[e-1].left===t[e])return!0;return!1}}),h.update=function(t){var e=this._stack;if(0===e.length)throw new Error("Can't update empty node!");var r=new Array(e.length),a=e[e.length-1];r[r.length-1]=new n(a._color,a.key,t,a.left,a.right,a._count);for(var i=e.length-2;i>=0;--i)(a=e[i]).left===e[i+1]?r[i]=new n(a._color,a.key,a.value,r[i+1],a.right,a._count):r[i]=new n(a._color,a.key,a.value,a.left,r[i+1],a._count);return new s(this.tree._compare,r[0])},h.prev=function(){var t=this._stack;if(0!==t.length){var e=t[t.length-1];if(e.left)for(e=e.left;e;)t.push(e),e=e.right;else for(t.pop();t.length>0&&t[t.length-1].left===e;)e=t[t.length-1],t.pop()}},Object.defineProperty(h,"hasPrev",{get:function(){var t=this._stack;if(0===t.length)return!1;if(t[t.length-1].left)return!0;for(var e=t.length-1;e>0;--e)if(t[e-1].right===t[e])return!0;return!1}})},{}],160:[function(t,e,r){var n=[.9999999999998099,676.5203681218851,-1259.1392167224028,771.3234287776531,-176.6150291621406,12.507343278686905,-.13857109526572012,9984369578019572e-21,1.5056327351493116e-7],a=[.9999999999999971,57.15623566586292,-59.59796035547549,14.136097974741746,-.4919138160976202,3399464998481189e-20,4652362892704858e-20,-9837447530487956e-20,.0001580887032249125,-.00021026444172410488,.00021743961811521265,-.0001643181065367639,8441822398385275e-20,-26190838401581408e-21,36899182659531625e-22];function i(t){if(t<0)return Number("0/0");for(var e=a[0],r=a.length-1;r>0;--r)e+=a[r]/(t+r);var n=t+607/128+.5;return.5*Math.log(2*Math.PI)+(t+.5)*Math.log(n)-n+Math.log(e)-Math.log(t)}e.exports=function t(e){if(e<.5)return Math.PI/(Math.sin(Math.PI*e)*t(1-e));if(e>100)return Math.exp(i(e));e-=1;for(var r=n[0],a=1;a<9;a++)r+=n[a]/(e+a);var o=e+7+.5;return Math.sqrt(2*Math.PI)*Math.pow(o,e+.5)*Math.exp(-o)*r},e.exports.log=i},{}],161:[function(t,e,r){e.exports=function(t,e){if("string"!=typeof t)throw new TypeError("must specify type string");if(e=e||{},"undefined"==typeof document&&!e.canvas)return null;var r=e.canvas||document.createElement("canvas");"number"==typeof e.width&&(r.width=e.width);"number"==typeof e.height&&(r.height=e.height);var n,a=e;try{var i=[t];0===t.indexOf("webgl")&&i.push("experimental-"+t);for(var o=0;or)throw new Error("gl-buffer: If resizing buffer, must not specify offset");return t.bufferSubData(e,i,a),r}function c(t,e){for(var r=n.malloc(t.length,e),a=t.length,i=0;i=0;--n){if(e[n]!==r)return!1;r*=t[n]}return!0}(t.shape,t.stride))0===t.offset&&t.data.length===t.shape[0]?this.length=u(this.gl,this.type,this.length,this.usage,t.data,e):this.length=u(this.gl,this.type,this.length,this.usage,t.data.subarray(t.offset,t.shape[0]),e);else{var s=n.malloc(t.size,r),l=i(s,t.shape);a.assign(l,t),this.length=u(this.gl,this.type,this.length,this.usage,e<0?s:s.subarray(0,t.size),e),n.free(s)}}else if(Array.isArray(t)){var f;f=this.type===this.gl.ELEMENT_ARRAY_BUFFER?c(t,"uint16"):c(t,"float32"),this.length=u(this.gl,this.type,this.length,this.usage,e<0?f:f.subarray(0,t.length),e),n.free(f)}else if("object"==typeof t&&"number"==typeof t.length)this.length=u(this.gl,this.type,this.length,this.usage,t,e);else{if("number"!=typeof t&&void 0!==t)throw new Error("gl-buffer: Invalid data type");if(e>=0)throw new Error("gl-buffer: Cannot specify offset when resizing buffer");(t|=0)<=0&&(t=1),this.gl.bufferData(this.type,0|t,this.usage),this.length=t}},e.exports=function(t,e,r,n){if(r=r||t.ARRAY_BUFFER,n=n||t.DYNAMIC_DRAW,r!==t.ARRAY_BUFFER&&r!==t.ELEMENT_ARRAY_BUFFER)throw new Error("gl-buffer: Invalid type for webgl buffer, must be either gl.ARRAY_BUFFER or gl.ELEMENT_ARRAY_BUFFER");if(n!==t.DYNAMIC_DRAW&&n!==t.STATIC_DRAW&&n!==t.STREAM_DRAW)throw new Error("gl-buffer: Invalid usage for buffer, must be either gl.DYNAMIC_DRAW, gl.STATIC_DRAW or gl.STREAM_DRAW");var a=t.createBuffer(),i=new s(t,r,a,0,n);return i.update(e),i}},{ndarray:259,"ndarray-ops":258,"typedarray-pool":339}],163:[function(t,e,r){e.exports={0:"NONE",1:"ONE",2:"LINE_LOOP",3:"LINE_STRIP",4:"TRIANGLES",5:"TRIANGLE_STRIP",6:"TRIANGLE_FAN",256:"DEPTH_BUFFER_BIT",512:"NEVER",513:"LESS",514:"EQUAL",515:"LEQUAL",516:"GREATER",517:"NOTEQUAL",518:"GEQUAL",519:"ALWAYS",768:"SRC_COLOR",769:"ONE_MINUS_SRC_COLOR",770:"SRC_ALPHA",771:"ONE_MINUS_SRC_ALPHA",772:"DST_ALPHA",773:"ONE_MINUS_DST_ALPHA",774:"DST_COLOR",775:"ONE_MINUS_DST_COLOR",776:"SRC_ALPHA_SATURATE",1024:"STENCIL_BUFFER_BIT",1028:"FRONT",1029:"BACK",1032:"FRONT_AND_BACK",1280:"INVALID_ENUM",1281:"INVALID_VALUE",1282:"INVALID_OPERATION",1285:"OUT_OF_MEMORY",1286:"INVALID_FRAMEBUFFER_OPERATION",2304:"CW",2305:"CCW",2849:"LINE_WIDTH",2884:"CULL_FACE",2885:"CULL_FACE_MODE",2886:"FRONT_FACE",2928:"DEPTH_RANGE",2929:"DEPTH_TEST",2930:"DEPTH_WRITEMASK",2931:"DEPTH_CLEAR_VALUE",2932:"DEPTH_FUNC",2960:"STENCIL_TEST",2961:"STENCIL_CLEAR_VALUE",2962:"STENCIL_FUNC",2963:"STENCIL_VALUE_MASK",2964:"STENCIL_FAIL",2965:"STENCIL_PASS_DEPTH_FAIL",2966:"STENCIL_PASS_DEPTH_PASS",2967:"STENCIL_REF",2968:"STENCIL_WRITEMASK",2978:"VIEWPORT",3024:"DITHER",3042:"BLEND",3088:"SCISSOR_BOX",3089:"SCISSOR_TEST",3106:"COLOR_CLEAR_VALUE",3107:"COLOR_WRITEMASK",3317:"UNPACK_ALIGNMENT",3333:"PACK_ALIGNMENT",3379:"MAX_TEXTURE_SIZE",3386:"MAX_VIEWPORT_DIMS",3408:"SUBPIXEL_BITS",3410:"RED_BITS",3411:"GREEN_BITS",3412:"BLUE_BITS",3413:"ALPHA_BITS",3414:"DEPTH_BITS",3415:"STENCIL_BITS",3553:"TEXTURE_2D",4352:"DONT_CARE",4353:"FASTEST",4354:"NICEST",5120:"BYTE",5121:"UNSIGNED_BYTE",5122:"SHORT",5123:"UNSIGNED_SHORT",5124:"INT",5125:"UNSIGNED_INT",5126:"FLOAT",5386:"INVERT",5890:"TEXTURE",6401:"STENCIL_INDEX",6402:"DEPTH_COMPONENT",6406:"ALPHA",6407:"RGB",6408:"RGBA",6409:"LUMINANCE",6410:"LUMINANCE_ALPHA",7680:"KEEP",7681:"REPLACE",7682:"INCR",7683:"DECR",7936:"VENDOR",7937:"RENDERER",7938:"VERSION",9728:"NEAREST",9729:"LINEAR",9984:"NEAREST_MIPMAP_NEAREST",9985:"LINEAR_MIPMAP_NEAREST",9986:"NEAREST_MIPMAP_LINEAR",9987:"LINEAR_MIPMAP_LINEAR",10240:"TEXTURE_MAG_FILTER",10241:"TEXTURE_MIN_FILTER",10242:"TEXTURE_WRAP_S",10243:"TEXTURE_WRAP_T",10497:"REPEAT",10752:"POLYGON_OFFSET_UNITS",16384:"COLOR_BUFFER_BIT",32769:"CONSTANT_COLOR",32770:"ONE_MINUS_CONSTANT_COLOR",32771:"CONSTANT_ALPHA",32772:"ONE_MINUS_CONSTANT_ALPHA",32773:"BLEND_COLOR",32774:"FUNC_ADD",32777:"BLEND_EQUATION_RGB",32778:"FUNC_SUBTRACT",32779:"FUNC_REVERSE_SUBTRACT",32819:"UNSIGNED_SHORT_4_4_4_4",32820:"UNSIGNED_SHORT_5_5_5_1",32823:"POLYGON_OFFSET_FILL",32824:"POLYGON_OFFSET_FACTOR",32854:"RGBA4",32855:"RGB5_A1",32873:"TEXTURE_BINDING_2D",32926:"SAMPLE_ALPHA_TO_COVERAGE",32928:"SAMPLE_COVERAGE",32936:"SAMPLE_BUFFERS",32937:"SAMPLES",32938:"SAMPLE_COVERAGE_VALUE",32939:"SAMPLE_COVERAGE_INVERT",32968:"BLEND_DST_RGB",32969:"BLEND_SRC_RGB",32970:"BLEND_DST_ALPHA",32971:"BLEND_SRC_ALPHA",33071:"CLAMP_TO_EDGE",33170:"GENERATE_MIPMAP_HINT",33189:"DEPTH_COMPONENT16",33306:"DEPTH_STENCIL_ATTACHMENT",33635:"UNSIGNED_SHORT_5_6_5",33648:"MIRRORED_REPEAT",33901:"ALIASED_POINT_SIZE_RANGE",33902:"ALIASED_LINE_WIDTH_RANGE",33984:"TEXTURE0",33985:"TEXTURE1",33986:"TEXTURE2",33987:"TEXTURE3",33988:"TEXTURE4",33989:"TEXTURE5",33990:"TEXTURE6",33991:"TEXTURE7",33992:"TEXTURE8",33993:"TEXTURE9",33994:"TEXTURE10",33995:"TEXTURE11",33996:"TEXTURE12",33997:"TEXTURE13",33998:"TEXTURE14",33999:"TEXTURE15",34e3:"TEXTURE16",34001:"TEXTURE17",34002:"TEXTURE18",34003:"TEXTURE19",34004:"TEXTURE20",34005:"TEXTURE21",34006:"TEXTURE22",34007:"TEXTURE23",34008:"TEXTURE24",34009:"TEXTURE25",34010:"TEXTURE26",34011:"TEXTURE27",34012:"TEXTURE28",34013:"TEXTURE29",34014:"TEXTURE30",34015:"TEXTURE31",34016:"ACTIVE_TEXTURE",34024:"MAX_RENDERBUFFER_SIZE",34041:"DEPTH_STENCIL",34055:"INCR_WRAP",34056:"DECR_WRAP",34067:"TEXTURE_CUBE_MAP",34068:"TEXTURE_BINDING_CUBE_MAP",34069:"TEXTURE_CUBE_MAP_POSITIVE_X",34070:"TEXTURE_CUBE_MAP_NEGATIVE_X",34071:"TEXTURE_CUBE_MAP_POSITIVE_Y",34072:"TEXTURE_CUBE_MAP_NEGATIVE_Y",34073:"TEXTURE_CUBE_MAP_POSITIVE_Z",34074:"TEXTURE_CUBE_MAP_NEGATIVE_Z",34076:"MAX_CUBE_MAP_TEXTURE_SIZE",34338:"VERTEX_ATTRIB_ARRAY_ENABLED",34339:"VERTEX_ATTRIB_ARRAY_SIZE",34340:"VERTEX_ATTRIB_ARRAY_STRIDE",34341:"VERTEX_ATTRIB_ARRAY_TYPE",34342:"CURRENT_VERTEX_ATTRIB",34373:"VERTEX_ATTRIB_ARRAY_POINTER",34466:"NUM_COMPRESSED_TEXTURE_FORMATS",34467:"COMPRESSED_TEXTURE_FORMATS",34660:"BUFFER_SIZE",34661:"BUFFER_USAGE",34816:"STENCIL_BACK_FUNC",34817:"STENCIL_BACK_FAIL",34818:"STENCIL_BACK_PASS_DEPTH_FAIL",34819:"STENCIL_BACK_PASS_DEPTH_PASS",34877:"BLEND_EQUATION_ALPHA",34921:"MAX_VERTEX_ATTRIBS",34922:"VERTEX_ATTRIB_ARRAY_NORMALIZED",34930:"MAX_TEXTURE_IMAGE_UNITS",34962:"ARRAY_BUFFER",34963:"ELEMENT_ARRAY_BUFFER",34964:"ARRAY_BUFFER_BINDING",34965:"ELEMENT_ARRAY_BUFFER_BINDING",34975:"VERTEX_ATTRIB_ARRAY_BUFFER_BINDING",35040:"STREAM_DRAW",35044:"STATIC_DRAW",35048:"DYNAMIC_DRAW",35632:"FRAGMENT_SHADER",35633:"VERTEX_SHADER",35660:"MAX_VERTEX_TEXTURE_IMAGE_UNITS",35661:"MAX_COMBINED_TEXTURE_IMAGE_UNITS",35663:"SHADER_TYPE",35664:"FLOAT_VEC2",35665:"FLOAT_VEC3",35666:"FLOAT_VEC4",35667:"INT_VEC2",35668:"INT_VEC3",35669:"INT_VEC4",35670:"BOOL",35671:"BOOL_VEC2",35672:"BOOL_VEC3",35673:"BOOL_VEC4",35674:"FLOAT_MAT2",35675:"FLOAT_MAT3",35676:"FLOAT_MAT4",35678:"SAMPLER_2D",35680:"SAMPLER_CUBE",35712:"DELETE_STATUS",35713:"COMPILE_STATUS",35714:"LINK_STATUS",35715:"VALIDATE_STATUS",35716:"INFO_LOG_LENGTH",35717:"ATTACHED_SHADERS",35718:"ACTIVE_UNIFORMS",35719:"ACTIVE_UNIFORM_MAX_LENGTH",35720:"SHADER_SOURCE_LENGTH",35721:"ACTIVE_ATTRIBUTES",35722:"ACTIVE_ATTRIBUTE_MAX_LENGTH",35724:"SHADING_LANGUAGE_VERSION",35725:"CURRENT_PROGRAM",36003:"STENCIL_BACK_REF",36004:"STENCIL_BACK_VALUE_MASK",36005:"STENCIL_BACK_WRITEMASK",36006:"FRAMEBUFFER_BINDING",36007:"RENDERBUFFER_BINDING",36048:"FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE",36049:"FRAMEBUFFER_ATTACHMENT_OBJECT_NAME",36050:"FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL",36051:"FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE",36053:"FRAMEBUFFER_COMPLETE",36054:"FRAMEBUFFER_INCOMPLETE_ATTACHMENT",36055:"FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT",36057:"FRAMEBUFFER_INCOMPLETE_DIMENSIONS",36061:"FRAMEBUFFER_UNSUPPORTED",36064:"COLOR_ATTACHMENT0",36096:"DEPTH_ATTACHMENT",36128:"STENCIL_ATTACHMENT",36160:"FRAMEBUFFER",36161:"RENDERBUFFER",36162:"RENDERBUFFER_WIDTH",36163:"RENDERBUFFER_HEIGHT",36164:"RENDERBUFFER_INTERNAL_FORMAT",36168:"STENCIL_INDEX8",36176:"RENDERBUFFER_RED_SIZE",36177:"RENDERBUFFER_GREEN_SIZE",36178:"RENDERBUFFER_BLUE_SIZE",36179:"RENDERBUFFER_ALPHA_SIZE",36180:"RENDERBUFFER_DEPTH_SIZE",36181:"RENDERBUFFER_STENCIL_SIZE",36194:"RGB565",36336:"LOW_FLOAT",36337:"MEDIUM_FLOAT",36338:"HIGH_FLOAT",36339:"LOW_INT",36340:"MEDIUM_INT",36341:"HIGH_INT",36346:"SHADER_COMPILER",36347:"MAX_VERTEX_UNIFORM_VECTORS",36348:"MAX_VARYING_VECTORS",36349:"MAX_FRAGMENT_UNIFORM_VECTORS",37440:"UNPACK_FLIP_Y_WEBGL",37441:"UNPACK_PREMULTIPLY_ALPHA_WEBGL",37442:"CONTEXT_LOST_WEBGL",37443:"UNPACK_COLORSPACE_CONVERSION_WEBGL",37444:"BROWSER_DEFAULT_WEBGL"}},{}],164:[function(t,e,r){var n=t("./1.0/numbers");e.exports=function(t){return n[t]}},{"./1.0/numbers":163}],165:[function(t,e,r){"use strict";e.exports=function(t,e){var r=t.gl,n=a(r,f.vertex,f.fragment),o=a(r,f.fillVertex,f.fragment),s=i(r),l=i(r),u=i(r),c=i(r),h=i(r),p=new d(t,n,o,s,l,u,c,h);return p.update(e),t.addObject(p),p};var n=t("iota-array"),a=t("gl-shader"),i=t("gl-buffer"),o=t("ndarray"),s=t("surface-nets"),l=t("cdt2d"),u=t("clean-pslg"),c=t("binary-search-bounds"),f=t("./lib/shaders");function d(t,e,r,n,a,i,o,s){this.plot=t,this.shader=e,this.fillShader=r,this.positionBuffer=n,this.colorBuffer=a,this.idBuffer=i,this.fillPositionBuffer=o,this.fillColorBuffer=s,this.fillVerts=0,this.shape=[0,0],this.bounds=[1/0,1/0,-1/0,-1/0],this.numVertices=0,this.lineWidth=1}var h,p,g=d.prototype,v=[1,0,0,0,0,1,1,0,1,1,0,1];function m(t,e){var r=Math.floor(e);if(r<0)return t[0];if(r>=t.length-1)return t[t.length-1];var n=e-r;return(1-n)*t[r]+n*t[r+1]}g.draw=(h=[1,0,0,0,1,0,0,0,1],p=[0,0],function(){var t,e,r=this.plot,n=this.shader,a=this.fillShader,i=this.bounds,o=this.numVertices,s=this.fillVerts,l=r.gl,u=r.viewBox,c=r.dataBox,f=i[2]-i[0],d=i[3]-i[1],g=c[2]-c[0],v=c[3]-c[1];if(h[0]=2*f/g,h[4]=2*d/v,h[6]=2*(i[0]-c[0])/g-1,h[7]=2*(i[1]-c[1])/v-1,p[0]=u[2]-u[0],p[1]=u[3]-u[1],s>0&&(a.bind(),(t=a.uniforms).viewTransform=h,t.screenShape=p,e=n.attributes,this.fillPositionBuffer.bind(),e.position.pointer(),this.fillColorBuffer.bind(),e.color.pointer(l.UNSIGNED_BYTE,!0),l.drawArrays(l.TRIANGLES,0,s)),o>0){n.bind();var m=this.lineWidth*r.pixelRatio;(t=n.uniforms).viewTransform=h,t.screenShape=p,t.lineWidth=m,t.pointSize=1e3,e=n.attributes,this.positionBuffer.bind(),e.position.pointer(l.FLOAT,!1,16,0),e.tangent.pointer(l.FLOAT,!1,16,8),this.colorBuffer.bind(),e.color.pointer(l.UNSIGNED_BYTE,!0),l.drawArrays(l.TRIANGLES,0,o),t.lineWidth=0,t.pointSize=m,this.positionBuffer.bind(),e.position.pointer(l.FLOAT,!1,48,0),e.tangent.pointer(l.FLOAT,!1,48,8),this.colorBuffer.bind(),e.color.pointer(l.UNSIGNED_BYTE,!0,12,0),l.drawArrays(l.POINTS,0,o/3)}}),g.drawPick=function(t){return t},g.pick=function(t,e,r){return null},g.update=function(t){var e=(t=t||{}).shape||[0,0],r=t.x||n(e[0]),a=t.y||n(e[1]),i=t.z||new Float32Array(e[0]*e[1]),f=t.levels||[],d=t.levelColors||[],h=this.bounds,p=h[0]=r[0],g=h[1]=a[0],y=h[2]=r[r.length-1],b=h[3]=a[a.length-1];p===y&&(h[2]+=1,y+=1),g===b&&(h[3]+=1,b+=1);var x=1/(y-p),_=1/(b-g);this.lineWidth=t.lineWidth||1;var w=o(i,e),A=[],T=[],k=[],M=[],E=[[0,0],[e[0]-1,0],[0,e[1]-1],[e[0]-1,e[1]-1]];function S(t,e,r,n){var a=n-r;return Math.abs(a)<1e-6?e:Math.floor(e)+Math.max(.001,Math.min(.999,(t-r)/a))}for(var C=0;C0&&L===f[C-1])){for(var O=s(w,L),D=255*d[4*C]|0,R=255*d[4*C+1]|0,I=255*d[4*C+2]|0,P=255*d[4*C+3]|0,F=O.cells,z=O.positions,N=Array(z.length),B=0;B1)){var H,G=V[0],q=V[1],X=w.get(Math.floor(G),Math.floor(q)),W=w.get(Math.floor(G),Math.ceil(q)),Y=w.get(Math.ceil(G),Math.floor(q)),Z=w.get(Math.ceil(G),Math.ceil(q));0===Math.floor(V[0])&&X<=L!=Wc||r<0||r>c)throw new Error("gl-fbo: Parameters are too large for FBO");var f=1;if("color"in(n=n||{})){if((f=Math.max(0|n.color,0))<0)throw new Error("gl-fbo: Must specify a nonnegative number of colors");if(f>1){if(!u)throw new Error("gl-fbo: Multiple draw buffer extension not supported");if(f>t.getParameter(u.MAX_COLOR_ATTACHMENTS_WEBGL))throw new Error("gl-fbo: Context does not support "+f+" draw buffers")}}var d=t.UNSIGNED_BYTE,h=t.getExtension("OES_texture_float");if(n.float&&f>0){if(!h)throw new Error("gl-fbo: Context does not support floating point textures");d=t.FLOAT}else n.preferFloat&&f>0&&h&&(d=t.FLOAT);var g=!0;"depth"in n&&(g=!!n.depth);var v=!1;"stencil"in n&&(v=!!n.stencil);return new p(t,e,r,d,f,g,v,u)};var a,i,o,s,l=null;function u(t){return[t.getParameter(t.FRAMEBUFFER_BINDING),t.getParameter(t.RENDERBUFFER_BINDING),t.getParameter(t.TEXTURE_BINDING_2D)]}function c(t,e){t.bindFramebuffer(t.FRAMEBUFFER,e[0]),t.bindRenderbuffer(t.RENDERBUFFER,e[1]),t.bindTexture(t.TEXTURE_2D,e[2])}function f(t){switch(t){case a:throw new Error("gl-fbo: Framebuffer unsupported");case i:throw new Error("gl-fbo: Framebuffer incomplete attachment");case o:throw new Error("gl-fbo: Framebuffer incomplete dimensions");case s:throw new Error("gl-fbo: Framebuffer incomplete missing attachment");default:throw new Error("gl-fbo: Framebuffer failed for unspecified reason")}}function d(t,e,r,a,i,o){if(!a)return null;var s=n(t,e,r,i,a);return s.magFilter=t.NEAREST,s.minFilter=t.NEAREST,s.mipSamples=1,s.bind(),t.framebufferTexture2D(t.FRAMEBUFFER,o,t.TEXTURE_2D,s.handle,0),s}function h(t,e,r,n,a){var i=t.createRenderbuffer();return t.bindRenderbuffer(t.RENDERBUFFER,i),t.renderbufferStorage(t.RENDERBUFFER,n,e,r),t.framebufferRenderbuffer(t.FRAMEBUFFER,a,t.RENDERBUFFER,i),i}function p(t,e,r,n,a,i,o,s){this.gl=t,this._shape=[0|e,0|r],this._destroyed=!1,this._ext=s,this.color=new Array(a);for(var p=0;p1&&s.drawBuffersWEBGL(l[o]);var y=r.getExtension("WEBGL_depth_texture");y?p?t.depth=d(r,a,i,y.UNSIGNED_INT_24_8_WEBGL,r.DEPTH_STENCIL,r.DEPTH_STENCIL_ATTACHMENT):g&&(t.depth=d(r,a,i,r.UNSIGNED_SHORT,r.DEPTH_COMPONENT,r.DEPTH_ATTACHMENT)):g&&p?t._depth_rb=h(r,a,i,r.DEPTH_STENCIL,r.DEPTH_STENCIL_ATTACHMENT):g?t._depth_rb=h(r,a,i,r.DEPTH_COMPONENT16,r.DEPTH_ATTACHMENT):p&&(t._depth_rb=h(r,a,i,r.STENCIL_INDEX,r.STENCIL_ATTACHMENT));var b=r.checkFramebufferStatus(r.FRAMEBUFFER);if(b!==r.FRAMEBUFFER_COMPLETE){t._destroyed=!0,r.bindFramebuffer(r.FRAMEBUFFER,null),r.deleteFramebuffer(t.handle),t.handle=null,t.depth&&(t.depth.dispose(),t.depth=null),t._depth_rb&&(r.deleteRenderbuffer(t._depth_rb),t._depth_rb=null);for(m=0;ma||r<0||r>a)throw new Error("gl-fbo: Can't resize FBO, invalid dimensions");t._shape[0]=e,t._shape[1]=r;for(var i=u(n),o=0;o>8*h&255;this.pickOffset=r,a.bind();var p=a.uniforms;p.viewTransform=t,p.pickOffset=e,p.shape=this.shape;var g=a.attributes;return this.positionBuffer.bind(),g.position.pointer(),this.weightBuffer.bind(),g.weight.pointer(s.UNSIGNED_BYTE,!1),this.idBuffer.bind(),g.pickId.pointer(s.UNSIGNED_BYTE,!1),s.drawArrays(s.TRIANGLES,0,o),r+this.shape[0]*this.shape[1]}}}(),f.pick=function(t,e,r){var n=this.pickOffset,a=this.shape[0]*this.shape[1];if(r=n+a)return null;var i=r-n,o=this.xData,s=this.yData;return{object:this,pointId:i,dataCoord:[o[i%this.shape[0]],s[i/this.shape[0]|0]]}},f.update=function(t){var e=(t=t||{}).shape||[0,0],r=t.x||a(e[0]),o=t.y||a(e[1]),s=t.z||new Float32Array(e[0]*e[1]),l=!1!==t.zsmooth;this.xData=r,this.yData=o;var u,c,f,h,p=t.colorLevels||[0],g=t.colorValues||[0,0,0,1],v=p.length,m=this.bounds;l?(u=m[0]=r[0],c=m[1]=o[0],f=m[2]=r[r.length-1],h=m[3]=o[o.length-1]):(u=m[0]=r[0]+(r[1]-r[0])/2,c=m[1]=o[0]+(o[1]-o[0])/2,f=m[2]=r[r.length-1]+(r[r.length-1]-r[r.length-2])/2,h=m[3]=o[o.length-1]+(o[o.length-1]-o[o.length-2])/2);var y=1/(f-u),b=1/(h-c),x=e[0],_=e[1];this.shape=[x,_];var w=(l?(x-1)*(_-1):x*_)*(d.length>>>1);this.numVertices=w;for(var A=i.mallocUint8(4*w),T=i.mallocFloat32(2*w),k=i.mallocUint8(2*w),M=i.mallocUint32(w),E=0,S=l?x-1:x,C=l?_-1:_,L=0;La[T]&&(r.uniforms.dataAxis=u,r.uniforms.screenOffset=c,r.uniforms.color=v[t],r.uniforms.angle=m[t],i.drawArrays(i.TRIANGLES,a[T],a[k]-a[T]))),y[t]&&A&&(c[1^t]-=M*h*b[t],r.uniforms.dataAxis=f,r.uniforms.screenOffset=c,r.uniforms.color=x[t],r.uniforms.angle=_[t],i.drawArrays(i.TRIANGLES,w,A)),c[1^t]=M*s[2+(1^t)]-1,p[t+2]&&(c[1^t]+=M*h*g[t+2],Ta[T]&&(r.uniforms.dataAxis=u,r.uniforms.screenOffset=c,r.uniforms.color=v[t+2],r.uniforms.angle=m[t+2],i.drawArrays(i.TRIANGLES,a[T],a[k]-a[T]))),y[t+2]&&A&&(c[1^t]+=M*h*b[t+2],r.uniforms.dataAxis=f,r.uniforms.screenOffset=c,r.uniforms.color=x[t+2],r.uniforms.angle=_[t+2],i.drawArrays(i.TRIANGLES,w,A))}),g.drawTitle=function(){var t=[0,0],e=[0,0];return function(){var r=this.plot,n=this.shader,a=r.gl,i=r.screenBox,o=r.titleCenter,s=r.titleAngle,l=r.titleColor,u=r.pixelRatio;if(this.titleCount){for(var c=0;c<2;++c)e[c]=2*(o[c]*u-i[c])/(i[2+c]-i[c])-1;n.bind(),n.uniforms.dataAxis=t,n.uniforms.screenOffset=e,n.uniforms.angle=s,n.uniforms.color=l,a.drawArrays(a.TRIANGLES,this.titleOffset,this.titleCount)}}}(),g.bind=(d=[0,0],h=[0,0],p=[0,0],function(){var t=this.plot,e=this.shader,r=t._tickBounds,n=t.dataBox,a=t.screenBox,i=t.viewBox;e.bind();for(var o=0;o<2;++o){var s=r[o],l=r[o+2]-s,u=.5*(n[o+2]+n[o]),c=n[o+2]-n[o],f=i[o],g=i[o+2]-f,v=a[o],m=a[o+2]-v;h[o]=2*l/c*g/m,d[o]=2*(s-u)/c*g/m}p[1]=2*t.pixelRatio/(a[3]-a[1]),p[0]=p[1]*(a[3]-a[1])/(a[2]-a[0]),e.uniforms.dataScale=h,e.uniforms.dataShift=d,e.uniforms.textScale=p,this.vbo.bind(),e.attributes.textCoordinate.pointer()}),g.update=function(t){var e,r,n,a,o,s=[],l=t.ticks,u=t.bounds;for(o=0;o<2;++o){var c=[Math.floor(s.length/3)],f=[-1/0],d=l[o];for(e=0;e=0){var g=e[p]-n[p]*(e[p+2]-e[p])/(n[p+2]-n[p]);0===p?o.drawLine(g,e[1],g,e[3],h[p],d[p]):o.drawLine(e[0],g,e[2],g,h[p],d[p])}}for(p=0;p=0;--t)this.objects[t].dispose();this.objects.length=0;for(t=this.overlays.length-1;t>=0;--t)this.overlays[t].dispose();this.overlays.length=0,this.gl=null},u.addObject=function(t){this.objects.indexOf(t)<0&&(this.objects.push(t),this.setDirty())},u.removeObject=function(t){for(var e=this.objects,r=0;r 1.0) {\n discard;\n }\n baseColor = mix(borderColor, color, step(radius, centerFraction));\n gl_FragColor = vec4(baseColor.rgb * baseColor.a, baseColor.a);\n }\n}\n"]),r.pickVertex=n(["precision mediump float;\n#define GLSLIFY 1\n\nattribute vec2 position;\nattribute vec4 pickId;\n\nuniform mat3 matrix;\nuniform float pointSize;\nuniform vec4 pickOffset;\n\nvarying vec4 fragId;\n\nvoid main() {\n vec3 hgPosition = matrix * vec3(position, 1);\n gl_Position = vec4(hgPosition.xy, 0, hgPosition.z);\n gl_PointSize = pointSize;\n\n vec4 id = pickId + pickOffset;\n id.y += floor(id.x / 256.0);\n id.x -= floor(id.x / 256.0) * 256.0;\n\n id.z += floor(id.y / 256.0);\n id.y -= floor(id.y / 256.0) * 256.0;\n\n id.w += floor(id.z / 256.0);\n id.z -= floor(id.z / 256.0) * 256.0;\n\n fragId = id;\n}\n"]),r.pickFragment=n(["precision mediump float;\n#define GLSLIFY 1\n\nvarying vec4 fragId;\n\nvoid main() {\n float radius = length(2.0 * gl_PointCoord.xy - 1.0);\n if(radius > 1.0) {\n discard;\n }\n gl_FragColor = fragId / 255.0;\n}\n"])},{glslify:211}],211:[function(t,e,r){arguments[4][167][0].apply(r,arguments)},{dup:167}],212:[function(t,e,r){"use strict";var n=t("gl-shader"),a=t("gl-buffer"),i=t("typedarray-pool"),o=t("./lib/shader");function s(t,e,r,n,a){this.plot=t,this.offsetBuffer=e,this.pickBuffer=r,this.shader=n,this.pickShader=a,this.sizeMin=.5,this.sizeMinCap=2,this.sizeMax=20,this.areaRatio=1,this.pointCount=0,this.color=[1,0,0,1],this.borderColor=[0,0,0,1],this.blend=!1,this.pickOffset=0,this.points=null}e.exports=function(t,e){var r=t.gl,i=a(r),l=a(r),u=n(r,o.pointVertex,o.pointFragment),c=n(r,o.pickVertex,o.pickFragment),f=new s(t,i,l,u,c);return f.update(e),t.addObject(f),f};var l,u,c=s.prototype;c.dispose=function(){this.shader.dispose(),this.pickShader.dispose(),this.offsetBuffer.dispose(),this.pickBuffer.dispose(),this.plot.removeObject(this)},c.update=function(t){var e;function r(e,r){return e in t?t[e]:r}t=t||{},this.sizeMin=r("sizeMin",.5),this.sizeMax=r("sizeMax",20),this.color=r("color",[1,0,0,1]).slice(),this.areaRatio=r("areaRatio",1),this.borderColor=r("borderColor",[0,0,0,1]).slice(),this.blend=r("blend",!1);var n=t.positions.length>>>1,a=t.positions instanceof Float32Array,o=t.idToIndex instanceof Int32Array&&t.idToIndex.length>=n,s=t.positions,l=a?s:i.mallocFloat32(s.length),u=o?t.idToIndex:i.mallocInt32(n);if(a||l.set(s),!o)for(l.set(s),e=0;e>>1;for(r=0;r=e[0]&&i<=e[2]&&o>=e[1]&&o<=e[3]&&n++}return n}(this.points,a),c=this.plot.pickPixelRatio*Math.max(Math.min(this.sizeMinCap,this.sizeMin),Math.min(this.sizeMax,this.sizeMax/Math.pow(s,.33333)));l[0]=2/i,l[4]=2/o,l[6]=-2*a[0]/i-1,l[7]=-2*a[1]/o-1,this.offsetBuffer.bind(),r.bind(),r.attributes.position.pointer(),r.uniforms.matrix=l,r.uniforms.color=this.color,r.uniforms.borderColor=this.borderColor,r.uniforms.pointCloud=c<5,r.uniforms.pointSize=c,r.uniforms.centerFraction=Math.min(1,Math.max(0,Math.sqrt(1-this.areaRatio))),e&&(u[0]=255&t,u[1]=t>>8&255,u[2]=t>>16&255,u[3]=t>>24&255,this.pickBuffer.bind(),r.attributes.pickId.pointer(n.UNSIGNED_BYTE),r.uniforms.pickOffset=u,this.pickOffset=t);var f=n.getParameter(n.BLEND),d=n.getParameter(n.DITHER);return f&&!this.blend&&n.disable(n.BLEND),d&&n.disable(n.DITHER),n.drawArrays(n.POINTS,0,this.pointCount),f&&!this.blend&&n.enable(n.BLEND),d&&n.enable(n.DITHER),t+this.pointCount}),c.draw=c.unifiedDraw,c.drawPick=c.unifiedDraw,c.pick=function(t,e,r){var n=this.pickOffset,a=this.pointCount;if(r=n+a)return null;var i=r-n,o=this.points;return{object:this,pointId:i,dataCoord:[o[2*i],o[2*i+1]]}}},{"./lib/shader":210,"gl-buffer":162,"gl-shader":217,"typedarray-pool":339}],213:[function(t,e,r){"use strict";var n=t("glslify");r.boxVertex=n(["precision mediump float;\n#define GLSLIFY 1\n\nattribute vec2 vertex;\n\nuniform vec2 cornerA, cornerB;\n\nvoid main() {\n gl_Position = vec4(mix(cornerA, cornerB, vertex), 0, 1);\n}\n"]),r.boxFragment=n(["precision mediump float;\n#define GLSLIFY 1\n\nuniform vec4 color;\n\nvoid main() {\n gl_FragColor = color;\n}\n"])},{glslify:214}],214:[function(t,e,r){arguments[4][167][0].apply(r,arguments)},{dup:167}],215:[function(t,e,r){"use strict";var n=t("gl-shader"),a=t("gl-buffer"),i=t("./lib/shaders");function o(t,e,r){this.plot=t,this.boxBuffer=e,this.boxShader=r,this.enabled=!0,this.selectBox=[1/0,1/0,-1/0,-1/0],this.borderColor=[0,0,0,1],this.innerFill=!1,this.innerColor=[0,0,0,.25],this.outerFill=!0,this.outerColor=[0,0,0,.5],this.borderWidth=10}e.exports=function(t,e){var r=t.gl,s=a(r,[0,0,0,1,1,0,1,1]),l=n(r,i.boxVertex,i.boxFragment),u=new o(t,s,l);return u.update(e),t.addOverlay(u),u};var s=o.prototype;s.draw=function(){if(this.enabled){var t=this.plot,e=this.selectBox,r=this.borderWidth,n=(this.innerFill,this.innerColor),a=(this.outerFill,this.outerColor),i=this.borderColor,o=t.box,s=t.screenBox,l=t.dataBox,u=t.viewBox,c=t.pixelRatio,f=(e[0]-l[0])*(u[2]-u[0])/(l[2]-l[0])+u[0],d=(e[1]-l[1])*(u[3]-u[1])/(l[3]-l[1])+u[1],h=(e[2]-l[0])*(u[2]-u[0])/(l[2]-l[0])+u[0],p=(e[3]-l[1])*(u[3]-u[1])/(l[3]-l[1])+u[1];if(f=Math.max(f,u[0]),d=Math.max(d,u[1]),h=Math.min(h,u[2]),p=Math.min(p,u[3]),!(h0){var m=r*c;o.drawBox(f-m,d-m,h+m,d+m,i),o.drawBox(f-m,p-m,h+m,p+m,i),o.drawBox(f-m,d-m,f+m,p+m,i),o.drawBox(h-m,d-m,h+m,p+m,i)}}}},s.update=function(t){t=t||{},this.innerFill=!!t.innerFill,this.outerFill=!!t.outerFill,this.innerColor=(t.innerColor||[0,0,0,.5]).slice(),this.outerColor=(t.outerColor||[0,0,0,.5]).slice(),this.borderColor=(t.borderColor||[0,0,0,1]).slice(),this.borderWidth=t.borderWidth||0,this.selectBox=(t.selectBox||this.selectBox).slice()},s.dispose=function(){this.boxBuffer.dispose(),this.boxShader.dispose(),this.plot.removeOverlay(this)}},{"./lib/shaders":213,"gl-buffer":162,"gl-shader":217}],216:[function(t,e,r){"use strict";e.exports=function(t,e){var r=e[0],i=e[1],o=n(t,r,i,{}),s=a.mallocUint8(r*i*4);return new l(t,o,s)};var n=t("gl-fbo"),a=t("typedarray-pool"),i=t("ndarray"),o=t("bit-twiddle").nextPow2;function s(t,e,r,n,a){this.coord=[t,e],this.id=r,this.value=n,this.distance=a}function l(t,e,r){this.gl=t,this.fbo=e,this.buffer=r,this._readTimeout=null;var n=this;this._readCallback=function(){n.gl&&(e.bind(),t.readPixels(0,0,e.shape[0],e.shape[1],t.RGBA,t.UNSIGNED_BYTE,n.buffer),n._readTimeout=null)}}var u=l.prototype;Object.defineProperty(u,"shape",{get:function(){return this.gl?this.fbo.shape.slice():[0,0]},set:function(t){if(this.gl){this.fbo.shape=t;var e=this.fbo.shape[0],r=this.fbo.shape[1];if(r*e*4>this.buffer.length){a.free(this.buffer);for(var n=this.buffer=a.mallocUint8(o(r*e*4)),i=0;ir)for(t=r;te)for(t=e;t=0){for(var A=0|w.type.charAt(w.type.length-1),T=new Array(A),k=0;k=0;)M+=1;_[y]=M}var E=new Array(r.length);function S(){d.program=o.program(h,d._vref,d._fref,x,_);for(var t=0;t=0){if((p=d.charCodeAt(d.length-1)-48)<2||p>4)throw new n("","Invalid data type for attribute "+f+": "+d);o(t,e,h[0],a,p,i,f)}else{if(!(d.indexOf("mat")>=0))throw new n("","Unknown data type for attribute "+f+": "+d);var p;if((p=d.charCodeAt(d.length-1)-48)<2||p>4)throw new n("","Invalid data type for attribute "+f+": "+d);s(t,e,h,a,p,i,f)}}}return i};var n=t("./GLError");function a(t,e,r,n,a,i){this._gl=t,this._wrapper=e,this._index=r,this._locations=n,this._dimension=a,this._constFunc=i}var i=a.prototype;function o(t,e,r,n,i,o,s){for(var l=["gl","v"],u=[],c=0;c4)throw new a("","Invalid uniform dimension type for matrix "+name+": "+r);return"gl.uniformMatrix"+i+"fv(locations["+e+"],false,obj"+t+")"}throw new a("","Unknown uniform data type for "+name+": "+r)}if((i=r.charCodeAt(r.length-1)-48)<2||i>4)throw new a("","Invalid data type");switch(r.charAt(0)){case"b":case"i":return"gl.uniform"+i+"iv(locations["+e+"],obj"+t+")";case"v":return"gl.uniform"+i+"fv(locations["+e+"],obj"+t+")";default:throw new a("","Unrecognized data type for vector "+name+": "+r)}}}function u(e){for(var n=["return function updateProperty(obj){"],a=function t(e,r){if("object"!=typeof r)return[[e,r]];var n=[];for(var a in r){var i=r[a],o=e;parseInt(a)+""===a?o+="["+a+"]":o+="."+a,"object"==typeof i?n.push.apply(n,t(o,i)):n.push([o,i])}return n}("",e),i=0;i4)throw new a("","Invalid data type");return"b"===t.charAt(0)?o(r,!1):o(r,0)}if(0===t.indexOf("mat")&&4===t.length){var r;if((r=t.charCodeAt(t.length-1)-48)<2||r>4)throw new a("","Invalid uniform dimension type for matrix "+name+": "+t);return o(r*r,0)}throw new a("","Unknown uniform data type for "+name+": "+t)}}(r[c].type);var h}function f(t){var e;if(Array.isArray(t)){e=new Array(t.length);for(var r=0;r1){s[0]in i||(i[s[0]]=[]),i=i[s[0]];for(var l=1;l1)for(var l=0;l halfCharStep + halfCharWidth ||\n\t\t\t\t\tfloor(uv.x) < halfCharStep - halfCharWidth) return;\n\n\t\t\t\tuv += charId * charStep;\n\t\t\t\tuv = uv / atlasSize;\n\n\t\t\t\tvec4 color = fontColor;\n\t\t\t\tvec4 mask = texture2D(atlas, uv);\n\n\t\t\t\tfloat maskY = lightness(mask);\n\t\t\t\t// float colorY = lightness(color);\n\t\t\t\tcolor.a *= maskY;\n\t\t\t\tcolor.a *= opacity;\n\n\t\t\t\t// color.a += .1;\n\n\t\t\t\t// antialiasing, see yiq color space y-channel formula\n\t\t\t\t// color.rgb += (1. - color.rgb) * (1. - mask.rgb);\n\n\t\t\t\tgl_FragColor = color;\n\t\t\t}"});return{regl:t,draw:e,atlas:{}}},A.prototype.update=function(t){var e=this;if("string"==typeof t)t={text:t};else if(!t)return;null!=(t=a(t,{position:"position positions coord coords coordinates",font:"font fontFace fontface typeface cssFont css-font family fontFamily",fontSize:"fontSize fontsize size font-size",text:"text texts chars characters value values symbols",align:"align alignment textAlign textbaseline",baseline:"baseline textBaseline textbaseline",direction:"dir direction textDirection",color:"color colour fill fill-color fillColor textColor textcolor",kerning:"kerning kern",range:"range dataBox",viewport:"vp viewport viewBox viewbox viewPort",opacity:"opacity alpha transparency visible visibility opaque",offset:"offset positionOffset padding shift indent indentation"},!0)).opacity&&(Array.isArray(t.opacity)?this.opacity=t.opacity.map((function(t){return parseFloat(t)})):this.opacity=parseFloat(t.opacity)),null!=t.viewport&&(this.viewport=f(t.viewport),A.normalViewport&&(this.viewport.y=this.canvas.height-this.viewport.y-this.viewport.height),this.viewportArray=[this.viewport.x,this.viewport.y,this.viewport.width,this.viewport.height]),null==this.viewport&&(this.viewport={x:0,y:0,width:this.gl.drawingBufferWidth,height:this.gl.drawingBufferHeight},this.viewportArray=[this.viewport.x,this.viewport.y,this.viewport.width,this.viewport.height]),null!=t.kerning&&(this.kerning=t.kerning),null!=t.offset&&("number"==typeof t.offset&&(t.offset=[t.offset,0]),this.positionOffset=y(t.offset)),t.direction&&(this.direction=t.direction),t.range&&(this.range=t.range,this.scale=[1/(t.range[2]-t.range[0]),1/(t.range[3]-t.range[1])],this.translate=[-t.range[0],-t.range[1]]),t.scale&&(this.scale=t.scale),t.translate&&(this.translate=t.translate),this.scale||(this.scale=[1/this.viewport.width,1/this.viewport.height]),this.translate||(this.translate=[0,0]),this.font.length||t.font||(t.font=A.baseFontSize+"px sans-serif");var r,i=!1,o=!1;if(t.font&&(Array.isArray(t.font)?t.font:[t.font]).forEach((function(t,r){if("string"==typeof t)try{t=n.parse(t)}catch(e){t=n.parse(A.baseFontSize+"px "+t)}else t=n.parse(n.stringify(t));var a=n.stringify({size:A.baseFontSize,family:t.family,stretch:_?t.stretch:void 0,variant:t.variant,weight:t.weight,style:t.style}),s=h(t.size),l=Math.round(s[0]*p(s[1]));if(l!==e.fontSize[r]&&(o=!0,e.fontSize[r]=l),!(e.font[r]&&a==e.font[r].baseString||(i=!0,e.font[r]=A.fonts[a],e.font[r]))){var u=t.family.join(", "),c=[t.style];t.style!=t.variant&&c.push(t.variant),t.variant!=t.weight&&c.push(t.weight),_&&t.weight!=t.stretch&&c.push(t.stretch),e.font[r]={baseString:a,family:u,weight:t.weight,stretch:t.stretch,style:t.style,variant:t.variant,width:{},kerning:{},metrics:m(u,{origin:"top",fontSize:A.baseFontSize,fontStyle:c.join(" ")})},A.fonts[a]=e.font[r]}})),(i||o)&&this.font.forEach((function(r,a){var i=n.stringify({size:e.fontSize[a],family:r.family,stretch:_?r.stretch:void 0,variant:r.variant,weight:r.weight,style:r.style});if(e.fontAtlas[a]=e.shader.atlas[i],!e.fontAtlas[a]){var o=r.metrics;e.shader.atlas[i]=e.fontAtlas[a]={fontString:i,step:2*Math.ceil(e.fontSize[a]*o.bottom*.5),em:e.fontSize[a],cols:0,rows:0,height:0,width:0,chars:[],ids:{},texture:e.regl.texture()}}null==t.text&&(t.text=e.text)})),"string"==typeof t.text&&t.position&&t.position.length>2){for(var s=Array(.5*t.position.length),d=0;d2){for(var w=!t.position[0].length,T=c.mallocFloat(2*this.count),k=0,M=0;k1?e.align[r]:e.align[0]:e.align;if("number"==typeof n)return n;switch(n){case"right":case"end":return-t;case"center":case"centre":case"middle":return.5*-t}return 0}))),null==this.baseline&&null==t.baseline&&(t.baseline=0),null!=t.baseline&&(this.baseline=t.baseline,Array.isArray(this.baseline)||(this.baseline=[this.baseline]),this.baselineOffset=this.baseline.map((function(t,r){var n=(e.font[r]||e.font[0]).metrics,a=0;return a+=.5*n.bottom,a+="number"==typeof t?t-n.baseline:-n[t],A.normalViewport||(a*=-1),a}))),null!=t.color)if(t.color||(t.color="transparent"),"string"!=typeof t.color&&isNaN(t.color)){var G;if("number"==typeof t.color[0]&&t.color.length>this.counts.length){var q=t.color.length;G=c.mallocUint8(q);for(var X=(t.color.subarray||t.color.slice).bind(t.color),W=0;W4||this.baselineOffset.length>1||this.align&&this.align.length>1||this.fontAtlas.length>1||this.positionOffset.length>2){var J=Math.max(.5*this.position.length||0,.25*this.color.length||0,this.baselineOffset.length||0,this.alignOffset.length||0,this.font.length||0,this.opacity.length||0,.5*this.positionOffset.length||0);this.batch=Array(J);for(var Q=0;Q1?this.counts[Q]:this.counts[0],offset:this.textOffsets.length>1?this.textOffsets[Q]:this.textOffsets[0],color:this.color?this.color.length<=4?this.color:this.color.subarray(4*Q,4*Q+4):[0,0,0,255],opacity:Array.isArray(this.opacity)?this.opacity[Q]:this.opacity,baseline:null!=this.baselineOffset[Q]?this.baselineOffset[Q]:this.baselineOffset[0],align:this.align?null!=this.alignOffset[Q]?this.alignOffset[Q]:this.alignOffset[0]:0,atlas:this.fontAtlas[Q]||this.fontAtlas[0],positionOffset:this.positionOffset.length>2?this.positionOffset.subarray(2*Q,2*Q+2):this.positionOffset}}else this.count?this.batch=[{count:this.count,offset:0,color:this.color||[0,0,0,255],opacity:Array.isArray(this.opacity)?this.opacity[0]:this.opacity,baseline:this.baselineOffset[0],align:this.alignOffset?this.alignOffset[0]:0,atlas:this.fontAtlas[0],positionOffset:this.positionOffset}]:this.batch=[]},A.prototype.destroy=function(){},A.prototype.kerning=!0,A.prototype.position={constant:new Float32Array(2)},A.prototype.translate=null,A.prototype.scale=null,A.prototype.font=null,A.prototype.text="",A.prototype.positionOffset=[0,0],A.prototype.opacity=1,A.prototype.color=new Uint8Array([0,0,0,255]),A.prototype.alignOffset=[0,0],A.normalViewport=!1,A.maxAtlasSize=1024,A.atlasCanvas=document.createElement("canvas"),A.atlasContext=A.atlasCanvas.getContext("2d",{alpha:!1}),A.baseFontSize=64,A.fonts={},e.exports=A},{"bit-twiddle":40,"color-normalize":63,"css-font":73,"detect-kerning":88,"es6-weak-map":148,"flatten-vertex-data":156,"font-atlas":157,"font-measure":158,"gl-util/context":227,"is-plain-obj":249,"object-assign":262,"parse-rect":265,"parse-unit":267,"pick-by-alias":271,regl:297,"to-px":324,"typedarray-pool":339}],226:[function(t,e,r){"use strict";var n=t("ndarray"),a=t("ndarray-ops"),i=t("typedarray-pool");e.exports=function(t){if(arguments.length<=1)throw new Error("gl-texture2d: Missing arguments for texture2d constructor");o||u(t);if("number"==typeof arguments[1])return m(t,arguments[1],arguments[2],arguments[3]||t.RGBA,arguments[4]||t.UNSIGNED_BYTE);if(Array.isArray(arguments[1]))return m(t,0|arguments[1][0],0|arguments[1][1],arguments[2]||t.RGBA,arguments[3]||t.UNSIGNED_BYTE);if("object"==typeof arguments[1]){var e=arguments[1],r=c(e)?e:e.raw;if(r)return y(t,r,0|e.width,0|e.height,arguments[2]||t.RGBA,arguments[3]||t.UNSIGNED_BYTE);if(e.shape&&e.data&&e.stride)return b(t,e)}throw new Error("gl-texture2d: Invalid arguments for texture2d constructor")};var o=null,s=null,l=null;function u(t){o=[t.LINEAR,t.NEAREST_MIPMAP_LINEAR,t.LINEAR_MIPMAP_NEAREST,t.LINEAR_MIPMAP_NEAREST],s=[t.NEAREST,t.LINEAR,t.NEAREST_MIPMAP_NEAREST,t.NEAREST_MIPMAP_LINEAR,t.LINEAR_MIPMAP_NEAREST,t.LINEAR_MIPMAP_LINEAR],l=[t.REPEAT,t.CLAMP_TO_EDGE,t.MIRRORED_REPEAT]}function c(t){return"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLVideoElement&&t instanceof HTMLVideoElement||"undefined"!=typeof ImageData&&t instanceof ImageData}var f=function(t,e){a.muls(t,e,255)};function d(t,e,r){var n=t.gl,a=n.getParameter(n.MAX_TEXTURE_SIZE);if(e<0||e>a||r<0||r>a)throw new Error("gl-texture2d: Invalid texture size");return t._shape=[e,r],t.bind(),n.texImage2D(n.TEXTURE_2D,0,t.format,e,r,0,t.format,t.type,null),t._mipLevels=[0],t}function h(t,e,r,n,a,i){this.gl=t,this.handle=e,this.format=a,this.type=i,this._shape=[r,n],this._mipLevels=[0],this._magFilter=t.NEAREST,this._minFilter=t.NEAREST,this._wrapS=t.CLAMP_TO_EDGE,this._wrapT=t.CLAMP_TO_EDGE,this._anisoSamples=1;var o=this,s=[this._wrapS,this._wrapT];Object.defineProperties(s,[{get:function(){return o._wrapS},set:function(t){return o.wrapS=t}},{get:function(){return o._wrapT},set:function(t){return o.wrapT=t}}]),this._wrapVector=s;var l=[this._shape[0],this._shape[1]];Object.defineProperties(l,[{get:function(){return o._shape[0]},set:function(t){return o.width=t}},{get:function(){return o._shape[1]},set:function(t){return o.height=t}}]),this._shapeVector=l}var p=h.prototype;function g(t,e){return 3===t.length?1===e[2]&&e[1]===t[0]*t[2]&&e[0]===t[2]:1===e[0]&&e[1]===t[0]}function v(t){var e=t.createTexture();return t.bindTexture(t.TEXTURE_2D,e),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),e}function m(t,e,r,n,a){var i=t.getParameter(t.MAX_TEXTURE_SIZE);if(e<0||e>i||r<0||r>i)throw new Error("gl-texture2d: Invalid texture shape");if(a===t.FLOAT&&!t.getExtension("OES_texture_float"))throw new Error("gl-texture2d: Floating point textures not supported on this platform");var o=v(t);return t.texImage2D(t.TEXTURE_2D,0,n,e,r,0,n,a,null),new h(t,o,e,r,n,a)}function y(t,e,r,n,a,i){var o=v(t);return t.texImage2D(t.TEXTURE_2D,0,a,a,i,e),new h(t,o,r,n,a,i)}function b(t,e){var r=e.dtype,o=e.shape.slice(),s=t.getParameter(t.MAX_TEXTURE_SIZE);if(o[0]<0||o[0]>s||o[1]<0||o[1]>s)throw new Error("gl-texture2d: Invalid texture size");var l=g(o,e.stride.slice()),u=0;"float32"===r?u=t.FLOAT:"float64"===r?(u=t.FLOAT,l=!1,r="float32"):"uint8"===r?u=t.UNSIGNED_BYTE:(u=t.UNSIGNED_BYTE,l=!1,r="uint8");var c,d,p=0;if(2===o.length)p=t.LUMINANCE,o=[o[0],o[1],1],e=n(e.data,o,[e.stride[0],e.stride[1],1],e.offset);else{if(3!==o.length)throw new Error("gl-texture2d: Invalid shape for texture");if(1===o[2])p=t.ALPHA;else if(2===o[2])p=t.LUMINANCE_ALPHA;else if(3===o[2])p=t.RGB;else{if(4!==o[2])throw new Error("gl-texture2d: Invalid shape for pixel coords");p=t.RGBA}}u!==t.FLOAT||t.getExtension("OES_texture_float")||(u=t.UNSIGNED_BYTE,l=!1);var m=e.size;if(l)c=0===e.offset&&e.data.length===m?e.data:e.data.subarray(e.offset,e.offset+m);else{var y=[o[2],o[2]*o[0],1];d=i.malloc(m,r);var b=n(d,o,y,0);"float32"!==r&&"float64"!==r||u!==t.UNSIGNED_BYTE?a.assign(b,e):f(b,e),c=d.subarray(0,m)}var x=v(t);return t.texImage2D(t.TEXTURE_2D,0,p,o[0],o[1],0,p,u,c),l||i.free(d),new h(t,x,o[0],o[1],p,u)}Object.defineProperties(p,{minFilter:{get:function(){return this._minFilter},set:function(t){this.bind();var e=this.gl;if(this.type===e.FLOAT&&o.indexOf(t)>=0&&(e.getExtension("OES_texture_float_linear")||(t=e.NEAREST)),s.indexOf(t)<0)throw new Error("gl-texture2d: Unknown filter mode "+t);return e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,t),this._minFilter=t}},magFilter:{get:function(){return this._magFilter},set:function(t){this.bind();var e=this.gl;if(this.type===e.FLOAT&&o.indexOf(t)>=0&&(e.getExtension("OES_texture_float_linear")||(t=e.NEAREST)),s.indexOf(t)<0)throw new Error("gl-texture2d: Unknown filter mode "+t);return e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,t),this._magFilter=t}},mipSamples:{get:function(){return this._anisoSamples},set:function(t){var e=this._anisoSamples;if(this._anisoSamples=0|Math.max(t,1),e!==this._anisoSamples){var r=this.gl.getExtension("EXT_texture_filter_anisotropic");r&&this.gl.texParameterf(this.gl.TEXTURE_2D,r.TEXTURE_MAX_ANISOTROPY_EXT,this._anisoSamples)}return this._anisoSamples}},wrapS:{get:function(){return this._wrapS},set:function(t){if(this.bind(),l.indexOf(t)<0)throw new Error("gl-texture2d: Unknown wrap mode "+t);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,t),this._wrapS=t}},wrapT:{get:function(){return this._wrapT},set:function(t){if(this.bind(),l.indexOf(t)<0)throw new Error("gl-texture2d: Unknown wrap mode "+t);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_T,t),this._wrapT=t}},wrap:{get:function(){return this._wrapVector},set:function(t){if(Array.isArray(t)||(t=[t,t]),2!==t.length)throw new Error("gl-texture2d: Must specify wrap mode for rows and columns");for(var e=0;e<2;++e)if(l.indexOf(t[e])<0)throw new Error("gl-texture2d: Unknown wrap mode "+t);this._wrapS=t[0],this._wrapT=t[1];var r=this.gl;return this.bind(),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,this._wrapS),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,this._wrapT),t}},shape:{get:function(){return this._shapeVector},set:function(t){if(Array.isArray(t)){if(2!==t.length)throw new Error("gl-texture2d: Invalid texture shape")}else t=[0|t,0|t];return d(this,0|t[0],0|t[1]),[0|t[0],0|t[1]]}},width:{get:function(){return this._shape[0]},set:function(t){return d(this,t|=0,this._shape[1]),t}},height:{get:function(){return this._shape[1]},set:function(t){return t|=0,d(this,this._shape[0],t),t}}}),p.bind=function(t){var e=this.gl;return void 0!==t&&e.activeTexture(e.TEXTURE0+(0|t)),e.bindTexture(e.TEXTURE_2D,this.handle),void 0!==t?0|t:e.getParameter(e.ACTIVE_TEXTURE)-e.TEXTURE0},p.dispose=function(){this.gl.deleteTexture(this.handle)},p.generateMipmap=function(){this.bind(),this.gl.generateMipmap(this.gl.TEXTURE_2D);for(var t=Math.min(this._shape[0],this._shape[1]),e=0;t>0;++e,t>>>=1)this._mipLevels.indexOf(e)<0&&this._mipLevels.push(e)},p.setPixels=function(t,e,r,o){var s=this.gl;this.bind(),Array.isArray(e)?(o=r,r=0|e[1],e=0|e[0]):(e=e||0,r=r||0),o=o||0;var l=c(t)?t:t.raw;if(l){this._mipLevels.indexOf(o)<0?(s.texImage2D(s.TEXTURE_2D,0,this.format,this.format,this.type,l),this._mipLevels.push(o)):s.texSubImage2D(s.TEXTURE_2D,o,e,r,this.format,this.type,l)}else{if(!(t.shape&&t.stride&&t.data))throw new Error("gl-texture2d: Unsupported data type");if(t.shape.length<2||e+t.shape[1]>this._shape[1]>>>o||r+t.shape[0]>this._shape[0]>>>o||e<0||r<0)throw new Error("gl-texture2d: Texture dimensions are out of bounds");!function(t,e,r,o,s,l,u,c){var d=c.dtype,h=c.shape.slice();if(h.length<2||h.length>3)throw new Error("gl-texture2d: Invalid ndarray, must be 2d or 3d");var p=0,v=0,m=g(h,c.stride.slice());"float32"===d?p=t.FLOAT:"float64"===d?(p=t.FLOAT,m=!1,d="float32"):"uint8"===d?p=t.UNSIGNED_BYTE:(p=t.UNSIGNED_BYTE,m=!1,d="uint8");if(2===h.length)v=t.LUMINANCE,h=[h[0],h[1],1],c=n(c.data,h,[c.stride[0],c.stride[1],1],c.offset);else{if(3!==h.length)throw new Error("gl-texture2d: Invalid shape for texture");if(1===h[2])v=t.ALPHA;else if(2===h[2])v=t.LUMINANCE_ALPHA;else if(3===h[2])v=t.RGB;else{if(4!==h[2])throw new Error("gl-texture2d: Invalid shape for pixel coords");v=t.RGBA}h[2]}v!==t.LUMINANCE&&v!==t.ALPHA||s!==t.LUMINANCE&&s!==t.ALPHA||(v=s);if(v!==s)throw new Error("gl-texture2d: Incompatible texture format for setPixels");var y=c.size,b=u.indexOf(o)<0;b&&u.push(o);if(p===l&&m)0===c.offset&&c.data.length===y?b?t.texImage2D(t.TEXTURE_2D,o,s,h[0],h[1],0,s,l,c.data):t.texSubImage2D(t.TEXTURE_2D,o,e,r,h[0],h[1],s,l,c.data):b?t.texImage2D(t.TEXTURE_2D,o,s,h[0],h[1],0,s,l,c.data.subarray(c.offset,c.offset+y)):t.texSubImage2D(t.TEXTURE_2D,o,e,r,h[0],h[1],s,l,c.data.subarray(c.offset,c.offset+y));else{var x;x=l===t.FLOAT?i.mallocFloat32(y):i.mallocUint8(y);var _=n(x,h,[h[2],h[2]*h[0],1]);p===t.FLOAT&&l===t.UNSIGNED_BYTE?f(_,c):a.assign(_,c),b?t.texImage2D(t.TEXTURE_2D,o,s,h[0],h[1],0,s,l,x.subarray(0,y)):t.texSubImage2D(t.TEXTURE_2D,o,e,r,h[0],h[1],s,l,x.subarray(0,y)),l===t.FLOAT?i.freeFloat32(x):i.freeUint8(x)}}(s,e,r,o,this.format,this.type,this._mipLevels,t)}}},{ndarray:259,"ndarray-ops":258,"typedarray-pool":339}],227:[function(t,e,r){(function(r){(function(){"use strict";var n=t("pick-by-alias");function a(t){if(t.container)if(t.container==document.body)document.body.style.width||(t.canvas.width=t.width||t.pixelRatio*r.innerWidth),document.body.style.height||(t.canvas.height=t.height||t.pixelRatio*r.innerHeight);else{var e=t.container.getBoundingClientRect();t.canvas.width=t.width||e.right-e.left,t.canvas.height=t.height||e.bottom-e.top}}function i(t){return"function"==typeof t.getContext&&"width"in t&&"height"in t}function o(){var t=document.createElement("canvas");return t.style.position="absolute",t.style.top=0,t.style.left=0,t}e.exports=function(t){var e;if(t?"string"==typeof t&&(t={container:t}):t={},i(t)?t={container:t}:t="string"==typeof(e=t).nodeName&&"function"==typeof e.appendChild&&"function"==typeof e.getBoundingClientRect?{container:t}:function(t){return"function"==typeof t.drawArrays||"function"==typeof t.drawElements}(t)?{gl:t}:n(t,{container:"container target element el canvas holder parent parentNode wrapper use ref root node",gl:"gl context webgl glContext",attrs:"attributes attrs contextAttributes",pixelRatio:"pixelRatio pxRatio px ratio pxratio pixelratio",width:"w width",height:"h height"},!0),t.pixelRatio||(t.pixelRatio=r.pixelRatio||1),t.gl)return t.gl;if(t.canvas&&(t.container=t.canvas.parentNode),t.container){if("string"==typeof t.container){var s=document.querySelector(t.container);if(!s)throw Error("Element "+t.container+" is not found");t.container=s}i(t.container)?(t.canvas=t.container,t.container=t.canvas.parentNode):t.canvas||(t.canvas=o(),t.container.appendChild(t.canvas),a(t))}else if(!t.canvas){if("undefined"==typeof document)throw Error("Not DOM environment. Use headless-gl.");t.container=document.body||document.documentElement,t.canvas=o(),t.container.appendChild(t.canvas),a(t)}if(!t.gl)try{t.gl=t.canvas.getContext("webgl",t.attrs)}catch(e){try{t.gl=t.canvas.getContext("experimental-webgl",t.attrs)}catch(e){t.gl=t.canvas.getContext("webgl-experimental",t.attrs)}}return t.gl}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"pick-by-alias":271}],228:[function(t,e,r){var n=t("glsl-tokenizer"),a=t("atob-lite");e.exports=function(t){for(var e=Array.isArray(t)?t:n(t),r=0;r0)continue;r=t.slice(0,1).join("")}return k(r),m+=r.length,(h=h.slice(r.length)).length}}function D(){return/[^a-fA-F0-9]/.test(e)?(k(h.join("")),d=999,c):(h.push(e),r=e,c+1)}function R(){return"."===e||/[eE]/.test(e)?(h.push(e),d=5,r=e,c+1):"x"===e&&1===h.length&&"0"===h[0]?(d=11,h.push(e),r=e,c+1):/[^\d]/.test(e)?(k(h.join("")),d=999,c):(h.push(e),r=e,c+1)}function I(){return"f"===e&&(h.push(e),r=e,c+=1),/[eE]/.test(e)?(h.push(e),r=e,c+1):("-"!==e&&"+"!==e||!/[eE]/.test(r))&&/[^\d]/.test(e)?(k(h.join("")),d=999,c):(h.push(e),r=e,c+1)}function P(){if(/[^\d\w_]/.test(e)){var t=h.join("");return d=T[t]?8:A[t]?7:6,k(h.join("")),d=999,c}return h.push(e),r=e,c+1}};var n=t("./lib/literals"),a=t("./lib/operators"),i=t("./lib/builtins"),o=t("./lib/literals-300es"),s=t("./lib/builtins-300es"),l=["block-comment","line-comment","preprocessor","operator","integer","float","ident","builtin","keyword","whitespace","eof","integer"]},{"./lib/builtins":231,"./lib/builtins-300es":230,"./lib/literals":233,"./lib/literals-300es":232,"./lib/operators":234}],230:[function(t,e,r){var n=t("./builtins");n=n.slice().filter((function(t){return!/^(gl\_|texture)/.test(t)})),e.exports=n.concat(["gl_VertexID","gl_InstanceID","gl_Position","gl_PointSize","gl_FragCoord","gl_FrontFacing","gl_FragDepth","gl_PointCoord","gl_MaxVertexAttribs","gl_MaxVertexUniformVectors","gl_MaxVertexOutputVectors","gl_MaxFragmentInputVectors","gl_MaxVertexTextureImageUnits","gl_MaxCombinedTextureImageUnits","gl_MaxTextureImageUnits","gl_MaxFragmentUniformVectors","gl_MaxDrawBuffers","gl_MinProgramTexelOffset","gl_MaxProgramTexelOffset","gl_DepthRangeParameters","gl_DepthRange","trunc","round","roundEven","isnan","isinf","floatBitsToInt","floatBitsToUint","intBitsToFloat","uintBitsToFloat","packSnorm2x16","unpackSnorm2x16","packUnorm2x16","unpackUnorm2x16","packHalf2x16","unpackHalf2x16","outerProduct","transpose","determinant","inverse","texture","textureSize","textureProj","textureLod","textureOffset","texelFetch","texelFetchOffset","textureProjOffset","textureLodOffset","textureProjLod","textureProjLodOffset","textureGrad","textureGradOffset","textureProjGrad","textureProjGradOffset"])},{"./builtins":231}],231:[function(t,e,r){e.exports=["abs","acos","all","any","asin","atan","ceil","clamp","cos","cross","dFdx","dFdy","degrees","distance","dot","equal","exp","exp2","faceforward","floor","fract","gl_BackColor","gl_BackLightModelProduct","gl_BackLightProduct","gl_BackMaterial","gl_BackSecondaryColor","gl_ClipPlane","gl_ClipVertex","gl_Color","gl_DepthRange","gl_DepthRangeParameters","gl_EyePlaneQ","gl_EyePlaneR","gl_EyePlaneS","gl_EyePlaneT","gl_Fog","gl_FogCoord","gl_FogFragCoord","gl_FogParameters","gl_FragColor","gl_FragCoord","gl_FragData","gl_FragDepth","gl_FragDepthEXT","gl_FrontColor","gl_FrontFacing","gl_FrontLightModelProduct","gl_FrontLightProduct","gl_FrontMaterial","gl_FrontSecondaryColor","gl_LightModel","gl_LightModelParameters","gl_LightModelProducts","gl_LightProducts","gl_LightSource","gl_LightSourceParameters","gl_MaterialParameters","gl_MaxClipPlanes","gl_MaxCombinedTextureImageUnits","gl_MaxDrawBuffers","gl_MaxFragmentUniformComponents","gl_MaxLights","gl_MaxTextureCoords","gl_MaxTextureImageUnits","gl_MaxTextureUnits","gl_MaxVaryingFloats","gl_MaxVertexAttribs","gl_MaxVertexTextureImageUnits","gl_MaxVertexUniformComponents","gl_ModelViewMatrix","gl_ModelViewMatrixInverse","gl_ModelViewMatrixInverseTranspose","gl_ModelViewMatrixTranspose","gl_ModelViewProjectionMatrix","gl_ModelViewProjectionMatrixInverse","gl_ModelViewProjectionMatrixInverseTranspose","gl_ModelViewProjectionMatrixTranspose","gl_MultiTexCoord0","gl_MultiTexCoord1","gl_MultiTexCoord2","gl_MultiTexCoord3","gl_MultiTexCoord4","gl_MultiTexCoord5","gl_MultiTexCoord6","gl_MultiTexCoord7","gl_Normal","gl_NormalMatrix","gl_NormalScale","gl_ObjectPlaneQ","gl_ObjectPlaneR","gl_ObjectPlaneS","gl_ObjectPlaneT","gl_Point","gl_PointCoord","gl_PointParameters","gl_PointSize","gl_Position","gl_ProjectionMatrix","gl_ProjectionMatrixInverse","gl_ProjectionMatrixInverseTranspose","gl_ProjectionMatrixTranspose","gl_SecondaryColor","gl_TexCoord","gl_TextureEnvColor","gl_TextureMatrix","gl_TextureMatrixInverse","gl_TextureMatrixInverseTranspose","gl_TextureMatrixTranspose","gl_Vertex","greaterThan","greaterThanEqual","inversesqrt","length","lessThan","lessThanEqual","log","log2","matrixCompMult","max","min","mix","mod","normalize","not","notEqual","pow","radians","reflect","refract","sign","sin","smoothstep","sqrt","step","tan","texture2D","texture2DLod","texture2DProj","texture2DProjLod","textureCube","textureCubeLod","texture2DLodEXT","texture2DProjLodEXT","textureCubeLodEXT","texture2DGradEXT","texture2DProjGradEXT","textureCubeGradEXT"]},{}],232:[function(t,e,r){var n=t("./literals");e.exports=n.slice().concat(["layout","centroid","smooth","case","mat2x2","mat2x3","mat2x4","mat3x2","mat3x3","mat3x4","mat4x2","mat4x3","mat4x4","uvec2","uvec3","uvec4","samplerCubeShadow","sampler2DArray","sampler2DArrayShadow","isampler2D","isampler3D","isamplerCube","isampler2DArray","usampler2D","usampler3D","usamplerCube","usampler2DArray","coherent","restrict","readonly","writeonly","resource","atomic_uint","noperspective","patch","sample","subroutine","common","partition","active","filter","image1D","image2D","image3D","imageCube","iimage1D","iimage2D","iimage3D","iimageCube","uimage1D","uimage2D","uimage3D","uimageCube","image1DArray","image2DArray","iimage1DArray","iimage2DArray","uimage1DArray","uimage2DArray","image1DShadow","image2DShadow","image1DArrayShadow","image2DArrayShadow","imageBuffer","iimageBuffer","uimageBuffer","sampler1DArray","sampler1DArrayShadow","isampler1D","isampler1DArray","usampler1D","usampler1DArray","isampler2DRect","usampler2DRect","samplerBuffer","isamplerBuffer","usamplerBuffer","sampler2DMS","isampler2DMS","usampler2DMS","sampler2DMSArray","isampler2DMSArray","usampler2DMSArray"])},{"./literals":233}],233:[function(t,e,r){e.exports=["precision","highp","mediump","lowp","attribute","const","uniform","varying","break","continue","do","for","while","if","else","in","out","inout","float","int","uint","void","bool","true","false","discard","return","mat2","mat3","mat4","vec2","vec3","vec4","ivec2","ivec3","ivec4","bvec2","bvec3","bvec4","sampler1D","sampler2D","sampler3D","samplerCube","sampler1DShadow","sampler2DShadow","struct","asm","class","union","enum","typedef","template","this","packed","goto","switch","default","inline","noinline","volatile","public","static","extern","external","interface","long","short","double","half","fixed","unsigned","input","output","hvec2","hvec3","hvec4","dvec2","dvec3","dvec4","fvec2","fvec3","fvec4","sampler2DRect","sampler3DRect","sampler2DRectShadow","sizeof","cast","namespace","using"]},{}],234:[function(t,e,r){e.exports=["<<=",">>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"]},{}],235:[function(t,e,r){var n=t("./index");e.exports=function(t,e){var r=n(e),a=[];return a=(a=a.concat(r(t))).concat(r(null))}},{"./index":229}],236:[function(t,e,r){arguments[4][167][0].apply(r,arguments)},{dup:167}],237:[function(t,e,r){(function(r){(function(){"use strict";var n,a=t("is-browser");n="function"==typeof r.matchMedia?!r.matchMedia("(hover: none)").matches:a,e.exports=n}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"is-browser":244}],238:[function(t,e,r){"use strict";var n=t("is-browser");e.exports=n&&function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch(e){t=!1}return t}()},{"is-browser":244}],239:[function(t,e,r){r.read=function(t,e,r,n,a){var i,o,s=8*a-n-1,l=(1<>1,c=-7,f=r?a-1:0,d=r?-1:1,h=t[e+f];for(f+=d,i=h&(1<<-c)-1,h>>=-c,c+=s;c>0;i=256*i+t[e+f],f+=d,c-=8);for(o=i&(1<<-c)-1,i>>=-c,c+=n;c>0;o=256*o+t[e+f],f+=d,c-=8);if(0===i)i=1-u;else{if(i===l)return o?NaN:1/0*(h?-1:1);o+=Math.pow(2,n),i-=u}return(h?-1:1)*o*Math.pow(2,i-n)},r.write=function(t,e,r,n,a,i){var o,s,l,u=8*i-a-1,c=(1<>1,d=23===a?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:i-1,p=n?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,o=c):(o=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-o))<1&&(o--,l*=2),(e+=o+f>=1?d/l:d*Math.pow(2,1-f))*l>=2&&(o++,l/=2),o+f>=c?(s=0,o=c):o+f>=1?(s=(e*l-1)*Math.pow(2,a),o+=f):(s=e*Math.pow(2,f-1)*Math.pow(2,a),o=0));a>=8;t[r+h]=255&s,h+=p,s/=256,a-=8);for(o=o<0;t[r+h]=255&o,h+=p,o/=256,u-=8);t[r+h-p]|=128*g}},{}],240:[function(t,e,r){"use strict";var n=t("binary-search-bounds");function a(t,e,r,n,a){this.mid=t,this.left=e,this.right=r,this.leftPoints=n,this.rightPoints=a,this.count=(e?e.count:0)+(r?r.count:0)+n.length}e.exports=function(t){if(!t||0===t.length)return new m(null);return new m(v(t))};var i=a.prototype;function o(t,e){t.mid=e.mid,t.left=e.left,t.right=e.right,t.leftPoints=e.leftPoints,t.rightPoints=e.rightPoints,t.count=e.count}function s(t,e){var r=v(e);t.mid=r.mid,t.left=r.left,t.right=r.right,t.leftPoints=r.leftPoints,t.rightPoints=r.rightPoints,t.count=r.count}function l(t,e){var r=t.intervals([]);r.push(e),s(t,r)}function u(t,e){var r=t.intervals([]),n=r.indexOf(e);return n<0?0:(r.splice(n,1),s(t,r),1)}function c(t,e,r){for(var n=0;n=0&&t[n][1]>=e;--n){var a=r(t[n]);if(a)return a}}function d(t,e){for(var r=0;r>1],i=[],o=[],s=[];for(r=0;r3*(e+1)?l(this,t):this.left.insert(t):this.left=v([t]);else if(t[0]>this.mid)this.right?4*(this.right.count+1)>3*(e+1)?l(this,t):this.right.insert(t):this.right=v([t]);else{var r=n.ge(this.leftPoints,t,p),a=n.ge(this.rightPoints,t,g);this.leftPoints.splice(r,0,t),this.rightPoints.splice(a,0,t)}},i.remove=function(t){var e=this.count-this.leftPoints;if(t[1]3*(e-1)?u(this,t):2===(s=this.left.remove(t))?(this.left=null,this.count-=1,1):(1===s&&(this.count-=1),s):0;if(t[0]>this.mid)return this.right?4*(this.left?this.left.count:0)>3*(e-1)?u(this,t):2===(s=this.right.remove(t))?(this.right=null,this.count-=1,1):(1===s&&(this.count-=1),s):0;if(1===this.count)return this.leftPoints[0]===t?2:0;if(1===this.leftPoints.length&&this.leftPoints[0]===t){if(this.left&&this.right){for(var r=this,a=this.left;a.right;)r=a,a=a.right;if(r===this)a.right=this.right;else{var i=this.left,s=this.right;r.count-=a.count,r.right=a.left,a.left=i,a.right=s}o(this,a),this.count=(this.left?this.left.count:0)+(this.right?this.right.count:0)+this.leftPoints.length}else this.left?o(this,this.left):o(this,this.right);return 1}for(i=n.ge(this.leftPoints,t,p);ithis.mid){var r;if(this.right)if(r=this.right.queryPoint(t,e))return r;return f(this.rightPoints,t,e)}return d(this.leftPoints,e)},i.queryInterval=function(t,e,r){var n;if(tthis.mid&&this.right&&(n=this.right.queryInterval(t,e,r)))return n;return ethis.mid?f(this.rightPoints,t,r):d(this.leftPoints,r)};var y=m.prototype;y.insert=function(t){this.root?this.root.insert(t):this.root=new a(t[0],null,null,[t],[t])},y.remove=function(t){if(this.root){var e=this.root.remove(t);return 2===e&&(this.root=null),0!==e}return!1},y.queryPoint=function(t,e){if(this.root)return this.root.queryPoint(t,e)},y.queryInterval=function(t,e,r){if(t<=e&&this.root)return this.root.queryInterval(t,e,r)},Object.defineProperty(y,"count",{get:function(){return this.root?this.root.count:0}}),Object.defineProperty(y,"intervals",{get:function(){return this.root?this.root.intervals([]):[]}})},{"binary-search-bounds":241}],241:[function(t,e,r){"use strict";function n(t,e,r,n,a,i){var o=["function ",t,"(a,l,h,",n.join(","),"){",i?"":"var i=",r?"l-1":"h+1",";while(l<=h){var m=(l+h)>>>1,x=a",a?".get(m)":"[m]"];return i?e.indexOf("c")<0?o.push(";if(x===y){return m}else if(x<=y){"):o.push(";var p=c(x,y);if(p===0){return m}else if(p<=0){"):o.push(";if(",e,"){i=m;"),r?o.push("l=m+1}else{h=m-1}"):o.push("h=m-1}else{l=m+1}"),o.push("}"),i?o.push("return -1};"):o.push("return i};"),o.join("")}function a(t,e,r,a){return new Function([n("A","x"+t+"y",e,["y"],!1,a),n("B","x"+t+"y",e,["y"],!0,a),n("P","c(x,y)"+t+"0",e,["y","c"],!1,a),n("Q","c(x,y)"+t+"0",e,["y","c"],!0,a),"function dispatchBsearch",r,"(a,y,c,l,h){if(a.shape){if(typeof(c)==='function'){return Q(a,(l===undefined)?0:l|0,(h===undefined)?a.shape[0]-1:h|0,y,c)}else{return B(a,(c===undefined)?0:c|0,(l===undefined)?a.shape[0]-1:l|0,y)}}else{if(typeof(c)==='function'){return P(a,(l===undefined)?0:l|0,(h===undefined)?a.length-1:h|0,y,c)}else{return A(a,(c===undefined)?0:c|0,(l===undefined)?a.length-1:l|0,y)}}}return dispatchBsearch",r].join(""))()}e.exports={ge:a(">=",!1,"GE"),gt:a(">",!1,"GT"),lt:a("<",!0,"LT"),le:a("<=",!0,"LE"),eq:a("-",!0,"EQ",!0)}},{}],242:[function(t,e,r){"use strict";e.exports=function(t,e){e=e||new Array(t.length);for(var r=0;r * @license MIT */ e.exports=function(t){return null!=t&&(n(t)||function(t){return"function"==typeof t.readFloatLE&&"function"==typeof t.slice&&n(t.slice(0,0))}(t)||!!t._isBuffer)}},{}],246:[function(t,e,r){"use strict";e.exports="undefined"!=typeof navigator&&(/MSIE/.test(navigator.userAgent)||/Trident\//.test(navigator.appVersion))},{}],247:[function(t,e,r){"use strict";e.exports=i,e.exports.isMobile=i,e.exports.default=i;var n=/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series[46]0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,a=/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series[46]0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino|android|ipad|playbook|silk/i;function i(t){t||(t={});var e=t.ua;if(e||"undefined"==typeof navigator||(e=navigator.userAgent),e&&e.headers&&"string"==typeof e.headers["user-agent"]&&(e=e.headers["user-agent"]),"string"!=typeof e)return!1;var r=t.tablet?a.test(e):n.test(e);return!r&&t.tablet&&t.featureDetect&&navigator&&navigator.maxTouchPoints>1&&-1!==e.indexOf("Macintosh")&&-1!==e.indexOf("Safari")&&(r=!0),r}},{}],248:[function(t,e,r){"use strict";e.exports=function(t){var e=typeof t;return null!==t&&("object"===e||"function"===e)}},{}],249:[function(t,e,r){"use strict";var n=Object.prototype.toString;e.exports=function(t){var e;return"[object Object]"===n.call(t)&&(null===(e=Object.getPrototypeOf(t))||e===Object.getPrototypeOf({}))}},{}],250:[function(t,e,r){"use strict";e.exports=function(t){for(var e,r=t.length,n=0;n13)&&32!==e&&133!==e&&160!==e&&5760!==e&&6158!==e&&(e<8192||e>8205)&&8232!==e&&8233!==e&&8239!==e&&8287!==e&&8288!==e&&12288!==e&&65279!==e)return!1;return!0}},{}],251:[function(t,e,r){"use strict";e.exports=function(t){return"string"==typeof t&&(t=t.trim(),!!(/^[mzlhvcsqta]\s*[-+.0-9][^mlhvzcsqta]+/i.test(t)&&/[\dz]$/i.test(t)&&t.length>4))}},{}],252:[function(t,e,r){"use strict";e.exports=Math.log2||function(t){return Math.log(t)*Math.LOG2E}},{}],253:[function(t,e,r){"use strict";e.exports=function(t,e){e||(e=t,t=window);var r=0,a=0,i=0,o={shift:!1,alt:!1,control:!1,meta:!1},s=!1;function l(t){var e=!1;return"altKey"in t&&(e=e||t.altKey!==o.alt,o.alt=!!t.altKey),"shiftKey"in t&&(e=e||t.shiftKey!==o.shift,o.shift=!!t.shiftKey),"ctrlKey"in t&&(e=e||t.ctrlKey!==o.control,o.control=!!t.ctrlKey),"metaKey"in t&&(e=e||t.metaKey!==o.meta,o.meta=!!t.metaKey),e}function u(t,s){var u=n.x(s),c=n.y(s);"buttons"in s&&(t=0|s.buttons),(t!==r||u!==a||c!==i||l(s))&&(r=0|t,a=u||0,i=c||0,e&&e(r,a,i,o))}function c(t){u(0,t)}function f(){(r||a||i||o.shift||o.alt||o.meta||o.control)&&(a=i=0,r=0,o.shift=o.alt=o.control=o.meta=!1,e&&e(0,0,0,o))}function d(t){l(t)&&e&&e(r,a,i,o)}function h(t){0===n.buttons(t)?u(0,t):u(r,t)}function p(t){u(r|n.buttons(t),t)}function g(t){u(r&~n.buttons(t),t)}function v(){s||(s=!0,t.addEventListener("mousemove",h),t.addEventListener("mousedown",p),t.addEventListener("mouseup",g),t.addEventListener("mouseleave",c),t.addEventListener("mouseenter",c),t.addEventListener("mouseout",c),t.addEventListener("mouseover",c),t.addEventListener("blur",f),t.addEventListener("keyup",d),t.addEventListener("keydown",d),t.addEventListener("keypress",d),t!==window&&(window.addEventListener("blur",f),window.addEventListener("keyup",d),window.addEventListener("keydown",d),window.addEventListener("keypress",d)))}v();var m={element:t};return Object.defineProperties(m,{enabled:{get:function(){return s},set:function(e){e?v():function(){if(!s)return;s=!1,t.removeEventListener("mousemove",h),t.removeEventListener("mousedown",p),t.removeEventListener("mouseup",g),t.removeEventListener("mouseleave",c),t.removeEventListener("mouseenter",c),t.removeEventListener("mouseout",c),t.removeEventListener("mouseover",c),t.removeEventListener("blur",f),t.removeEventListener("keyup",d),t.removeEventListener("keydown",d),t.removeEventListener("keypress",d),t!==window&&(window.removeEventListener("blur",f),window.removeEventListener("keyup",d),window.removeEventListener("keydown",d),window.removeEventListener("keypress",d))}()},enumerable:!0},buttons:{get:function(){return r},enumerable:!0},x:{get:function(){return a},enumerable:!0},y:{get:function(){return i},enumerable:!0},mods:{get:function(){return o},enumerable:!0}}),m};var n=t("mouse-event")},{"mouse-event":255}],254:[function(t,e,r){var n={left:0,top:0};e.exports=function(t,e,r){e=e||t.currentTarget||t.srcElement,Array.isArray(r)||(r=[0,0]);var a=t.clientX||0,i=t.clientY||0,o=(s=e,s===window||s===document||s===document.body?n:s.getBoundingClientRect());var s;return r[0]=a-o.left,r[1]=i-o.top,r}},{}],255:[function(t,e,r){"use strict";function n(t){return t.target||t.srcElement||window}r.buttons=function(t){if("object"==typeof t){if("buttons"in t)return t.buttons;if("which"in t){if(2===(e=t.which))return 4;if(3===e)return 2;if(e>0)return 1<=0)return 1< 0");"function"!=typeof t.vertex&&e("Must specify vertex creation function");"function"!=typeof t.cell&&e("Must specify cell creation function");"function"!=typeof t.phase&&e("Must specify phase function");for(var w=t.getters||[],A=new Array(x),T=0;T=0?A[T]=!0:A[T]=!1;return function(t,e,r,x,_,w){var A=w.length,T=_.length;if(T<2)throw new Error("ndarray-extract-contour: Dimension must be at least 2");for(var k="extractContour"+_.join("_"),M=[],E=[],S=[],C=0;C0&&R.push(l(C,_[L-1])+"*"+s(_[L-1])),E.push(p(C,_[L])+"=("+R.join("-")+")|0")}for(C=0;C=0;--C)I.push(s(_[C]));E.push("Q=("+I.join("*")+")|0","P=mallocUint32(Q)","V=mallocUint32(Q)","X=0"),E.push(g(0)+"=0");for(L=1;L<1<0;_=_-1&p)b.push("V[X+"+m(_)+"]");b.push(y(0));for(_=0;_=0;--e)B(e,0);var r=[];for(e=0;e0){",h(_[e]),"=1;"),t(e-1,r|1<<_[e]);for(var n=0;n>",rrshift:">>>"};!function(){for(var t in s){var e=s[t];r[t]=o({args:["array","array","array"],body:{args:["a","b","c"],body:"a=b"+e+"c"},funcName:t}),r[t+"eq"]=o({args:["array","array"],body:{args:["a","b"],body:"a"+e+"=b"},rvalue:!0,funcName:t+"eq"}),r[t+"s"]=o({args:["array","array","scalar"],body:{args:["a","b","s"],body:"a=b"+e+"s"},funcName:t+"s"}),r[t+"seq"]=o({args:["array","scalar"],body:{args:["a","s"],body:"a"+e+"=s"},rvalue:!0,funcName:t+"seq"})}}();var l={not:"!",bnot:"~",neg:"-",recip:"1.0/"};!function(){for(var t in l){var e=l[t];r[t]=o({args:["array","array"],body:{args:["a","b"],body:"a="+e+"b"},funcName:t}),r[t+"eq"]=o({args:["array"],body:{args:["a"],body:"a="+e+"a"},rvalue:!0,count:2,funcName:t+"eq"})}}();var u={and:"&&",or:"||",eq:"===",neq:"!==",lt:"<",gt:">",leq:"<=",geq:">="};!function(){for(var t in u){var e=u[t];r[t]=o({args:["array","array","array"],body:{args:["a","b","c"],body:"a=b"+e+"c"},funcName:t}),r[t+"s"]=o({args:["array","array","scalar"],body:{args:["a","b","s"],body:"a=b"+e+"s"},funcName:t+"s"}),r[t+"eq"]=o({args:["array","array"],body:{args:["a","b"],body:"a=a"+e+"b"},rvalue:!0,count:2,funcName:t+"eq"}),r[t+"seq"]=o({args:["array","scalar"],body:{args:["a","s"],body:"a=a"+e+"s"},rvalue:!0,count:2,funcName:t+"seq"})}}();var c=["abs","acos","asin","atan","ceil","cos","exp","floor","log","round","sin","sqrt","tan"];!function(){for(var t=0;tthis_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=n({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=n({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=n({args:["array"],pre:{body:"this_h=Infinity",args:[],thisVars:["this_h"],localVars:[]},body:{body:"if(_inline_1_arg0_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=n({args:["array","array"],pre:a,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":79}],259:[function(t,e,r){var n=t("iota-array"),a=t("is-buffer"),i="undefined"!=typeof Float64Array;function o(t,e){return t[0]-e[0]}function s(){var t,e=this.stride,r=new Array(e.length);for(t=0;tMath.abs(this.stride[1]))?[1,0]:[0,1]}})"):3===e&&i.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];}}})")):i.push("ORDER})")),i.push("proto.set=function "+r+"_set("+l.join(",")+",v){"),a?i.push("return this.data.set("+c+",v)}"):i.push("return this.data["+c+"]=v}"),i.push("proto.get=function "+r+"_get("+l.join(",")+"){"),a?i.push("return this.data.get("+c+")}"):i.push("return this.data["+c+"]}"),i.push("proto.index=function "+r+"_index(",l.join(),"){return "+c+"}"),i.push("proto.hi=function "+r+"_hi("+l.join(",")+"){return new "+r+"(this.data,"+o.map((function(t){return["(typeof i",t,"!=='number'||i",t,"<0)?this.shape[",t,"]:i",t,"|0"].join("")})).join(",")+","+o.map((function(t){return"this.stride["+t+"]"})).join(",")+",this.offset)}");var h=o.map((function(t){return"a"+t+"=this.shape["+t+"]"})),p=o.map((function(t){return"c"+t+"=this.stride["+t+"]"}));i.push("proto.lo=function "+r+"_lo("+l.join(",")+"){var b=this.offset,d=0,"+h.join(",")+","+p.join(","));for(var g=0;g=0){d=i"+g+"|0;b+=c"+g+"*d;a"+g+"-=d}");i.push("return new "+r+"(this.data,"+o.map((function(t){return"a"+t})).join(",")+","+o.map((function(t){return"c"+t})).join(",")+",b)}"),i.push("proto.step=function "+r+"_step("+l.join(",")+"){var "+o.map((function(t){return"a"+t+"=this.shape["+t+"]"})).join(",")+","+o.map((function(t){return"b"+t+"=this.stride["+t+"]"})).join(",")+",c=this.offset,d=0,ceil=Math.ceil");for(g=0;g=0){c=(c+this.stride["+g+"]*i"+g+")|0}else{a.push(this.shape["+g+"]);b.push(this.stride["+g+"])}");return i.push("var ctor=CTOR_LIST[a.length+1];return ctor(this.data,a,b,c)}"),i.push("return function construct_"+r+"(data,shape,stride,offset){return new "+r+"(data,"+o.map((function(t){return"shape["+t+"]"})).join(",")+","+o.map((function(t){return"stride["+t+"]"})).join(",")+",offset)}"),new Function("CTOR_LIST","ORDER",i.join("\n"))(u[t],s)}var u={float32:[],float64:[],int8:[],int16:[],int32:[],uint8:[],uint16:[],uint32:[],array:[],uint8_clamped:[],bigint64:[],biguint64:[],buffer:[],generic:[]};e.exports=function(t,e,r,n){if(void 0===t)return(0,u.array[0])([]);"number"==typeof t&&(t=[t]),void 0===e&&(e=[t.length]);var o=e.length;if(void 0===r){r=new Array(o);for(var s=o-1,c=1;s>=0;--s)r[s]=c,c*=e[s]}if(void 0===n){n=0;for(s=0;st==t>0?i===-1>>>0?(r+=1,i=0):i+=1:0===i?(i=-1>>>0,r-=1):i-=1;return n.pack(i,r)}},{"double-bits":89}],261:[function(t,e,r){var n=Math.PI,a=u(120);function i(t,e,r,n){return["C",t,e,r,n,r,n]}function o(t,e,r,n,a,i){return["C",t/3+2/3*r,e/3+2/3*n,a/3+2/3*r,i/3+2/3*n,a,i]}function s(t,e,r,i,o,u,c,f,d,h){if(h)A=h[0],T=h[1],_=h[2],w=h[3];else{var p=l(t,e,-o);t=p.x,e=p.y;var g=(t-(f=(p=l(f,d,-o)).x))/2,v=(e-(d=p.y))/2,m=g*g/(r*r)+v*v/(i*i);m>1&&(r*=m=Math.sqrt(m),i*=m);var y=r*r,b=i*i,x=(u==c?-1:1)*Math.sqrt(Math.abs((y*b-y*v*v-b*g*g)/(y*v*v+b*g*g)));x==1/0&&(x=1);var _=x*r*v/i+(t+f)/2,w=x*-i*g/r+(e+d)/2,A=Math.asin(((e-w)/i).toFixed(9)),T=Math.asin(((d-w)/i).toFixed(9));(A=t<_?n-A:A)<0&&(A=2*n+A),(T=f<_?n-T:T)<0&&(T=2*n+T),c&&A>T&&(A-=2*n),!c&&T>A&&(T-=2*n)}if(Math.abs(T-A)>a){var k=T,M=f,E=d;T=A+a*(c&&T>A?1:-1);var S=s(f=_+r*Math.cos(T),d=w+i*Math.sin(T),r,i,o,0,c,M,E,[T,k,_,w])}var C=Math.tan((T-A)/4),L=4/3*r*C,O=4/3*i*C,D=[2*t-(t+L*Math.sin(A)),2*e-(e-O*Math.cos(A)),f+L*Math.sin(T),d-O*Math.cos(T),f,d];if(h)return D;S&&(D=D.concat(S));for(var R=0;R7&&(r.push(m.splice(0,7)),m.unshift("C"));break;case"S":var b=h,x=p;"C"!=e&&"S"!=e||(b+=b-n,x+=x-a),m=["C",b,x,m[1],m[2],m[3],m[4]];break;case"T":"Q"==e||"T"==e?(f=2*h-f,d=2*p-d):(f=h,d=p),m=o(h,p,f,d,m[1],m[2]);break;case"Q":f=m[1],d=m[2],m=o(h,p,m[1],m[2],m[3],m[4]);break;case"L":m=i(h,p,m[1],m[2]);break;case"H":m=i(h,p,m[1],p);break;case"V":m=i(h,p,h,m[1]);break;case"Z":m=i(h,p,l,c)}e=y,h=m[m.length-2],p=m[m.length-1],m.length>4?(n=m[m.length-4],a=m[m.length-3]):(n=h,a=p),r.push(m)}return r}},{}],262:[function(t,e,r){ /* object-assign (c) Sindre Sorhus @license MIT */ "use strict";var n=Object.getOwnPropertySymbols,a=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;function o(t){if(null==t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}e.exports=function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},r=0;r<10;r++)e["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(e).map((function(t){return e[t]})).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach((function(t){n[t]=t})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(t){return!1}}()?Object.assign:function(t,e){for(var r,s,l=o(t),u=1;u * * Copyright (c) 2014-2015, Jon Schlinkert. * Licensed under the MIT license. */ "use strict";var n=t("repeat-string");e.exports=function(t,e,r){return n(r="undefined"!=typeof r?r+"":" ",e)+t}},{"repeat-string":298}],264:[function(t,e,r){"use strict";function n(t,e){if("string"!=typeof t)return[t];var r=[t];"string"==typeof e||Array.isArray(e)?e={brackets:e}:e||(e={});var n=e.brackets?Array.isArray(e.brackets)?e.brackets:[e.brackets]:["{}","[]","()"],a=e.escape||"___",i=!!e.flat;n.forEach((function(t){var e=new RegExp(["\\",t[0],"[^\\",t[0],"\\",t[1],"]*\\",t[1]].join("")),n=[];function i(e,i,o){var s=r.push(e.slice(t[0].length,-t[1].length))-1;return n.push(s),a+s+a}r.forEach((function(t,n){for(var a,o=0;t!=a;)if(a=t,t=t.replace(e,i),o++>1e4)throw Error("References have circular dependency. Please, check them.");r[n]=t})),n=n.reverse(),r=r.map((function(e){return n.forEach((function(r){e=e.replace(new RegExp("(\\"+a+r+"\\"+a+")","g"),t[0]+"$1"+t[1])})),e}))}));var o=new RegExp("\\"+a+"([0-9]+)\\"+a);return i?r:function t(e,r,n){for(var a,i=[],s=0;a=o.exec(e);){if(s++>1e4)throw Error("Circular references in parenthesis");i.push(e.slice(0,a.index)),i.push(t(r[a[1]],r)),e=e.slice(a.index+a[0].length)}return i.push(e),i}(r[0],r)}function a(t,e){if(e&&e.flat){var r,n=e&&e.escape||"___",a=t[0];if(!a)return"";for(var i=new RegExp("\\"+n+"([0-9]+)\\"+n),o=0;a!=r;){if(o++>1e4)throw Error("Circular references in "+t);r=a,a=a.replace(i,s)}return a}return t.reduce((function t(e,r){return Array.isArray(r)&&(r=r.reduce(t,"")),e+r}),"");function s(e,r){if(null==t[r])throw Error("Reference "+r+"is undefined");return t[r]}}function i(t,e){return Array.isArray(t)?a(t,e):n(t,e)}i.parse=n,i.stringify=a,e.exports=i},{}],265:[function(t,e,r){"use strict";var n=t("pick-by-alias");e.exports=function(t){var e;arguments.length>1&&(t=arguments);"string"==typeof t?t=t.split(/\s/).map(parseFloat):"number"==typeof t&&(t=[t]);t.length&&"number"==typeof t[0]?e=1===t.length?{width:t[0],height:t[0],x:0,y:0}:2===t.length?{width:t[0],height:t[1],x:0,y:0}:{x:t[0],y:t[1],width:t[2]-t[0]||0,height:t[3]-t[1]||0}:t&&(t=n(t,{left:"x l left Left",top:"y t top Top",width:"w width W Width",height:"h height W Width",bottom:"b bottom Bottom",right:"r right Right"}),e={x:t.left||0,y:t.top||0},null==t.width?t.right?e.width=t.right-e.x:e.width=0:e.width=t.width,null==t.height?t.bottom?e.height=t.bottom-e.y:e.height=0:e.height=t.height);return e}},{"pick-by-alias":271}],266:[function(t,e,r){e.exports=function(t){var e=[];return t.replace(a,(function(t,r,a){var o=r.toLowerCase();for(a=function(t){var e=t.match(i);return e?e.map(Number):[]}(a),"m"==o&&a.length>2&&(e.push([r].concat(a.splice(0,2))),o="l",r="m"==r?"l":"L");;){if(a.length==n[o])return a.unshift(r),e.push(a);if(a.length0;--o)i=l[o],r=s[o],s[o]=s[i],s[i]=r,l[o]=l[r],l[r]=i,u=(u+r)*o;return n.freeUint32(l),n.freeUint32(s),u},r.unrank=function(t,e,r){switch(t){case 0:return r||[];case 1:return r?(r[0]=0,r):[0];case 2:return r?(e?(r[0]=0,r[1]=1):(r[0]=1,r[1]=0),r):e?[0,1]:[1,0]}var n,a,i,o=1;for((r=r||new Array(t))[0]=0,i=1;i0;--i)e=e-(n=e/o|0)*o|0,o=o/i|0,a=0|r[i],r[i]=0|r[n],r[n]=0|a;return r}},{"invert-permutation":242,"typedarray-pool":339}],271:[function(t,e,r){"use strict";e.exports=function(t,e,r){var n,i,o={};if("string"==typeof e&&(e=a(e)),Array.isArray(e)){var s={};for(i=0;i0){o=i[c][r][0],l=c;break}s=o[1^l];for(var f=0;f<2;++f)for(var d=i[f][r],h=0;h0&&(o=p,s=g,l=f)}return a||o&&u(o,l),s}function f(t,r){var a=i[r][t][0],o=[t];u(a,r);for(var s=a[1^r];;){for(;s!==t;)o.push(s),s=c(o[o.length-2],s,!1);if(i[0][t].length+i[1][t].length===0)break;var l=o[o.length-1],f=t,d=o[1],h=c(l,f,!0);if(n(e[l],e[f],e[d],e[h])<0)break;o.push(t),s=c(l,f)}return o}function d(t,e){return e[1]===e[e.length-1]}for(o=0;o0;){i[0][o].length;var g=f(o,h);d(0,g)?p.push.apply(p,g):(p.length>0&&l.push(p),p=g)}p.length>0&&l.push(p)}return l};var n=t("compare-angle")},{"compare-angle":68}],273:[function(t,e,r){"use strict";e.exports=function(t,e){for(var r=n(t,e.length),a=new Array(e.length),i=new Array(e.length),o=[],s=0;s0;){var u=o.pop();a[u]=!1;var c=r[u];for(s=0;s0}))).length,v=new Array(g),m=new Array(g);for(h=0;h0;){var N=F.pop(),B=S[N];l(B,(function(t,e){return t-e}));var j,U=B.length,V=z[N];if(0===V){var H=p[N];j=[H]}for(h=0;h=0))if(z[G]=1^V,F.push(G),0===V)P(H=p[G])||(H.reverse(),j.push(H))}0===V&&r.push(j)}return r};var n=t("edges-to-adjacency-list"),a=t("planar-dual"),i=t("point-in-big-polygon"),o=t("two-product"),s=t("robust-sum"),l=t("uniq"),u=t("./lib/trim-leaves");function c(t,e){for(var r=new Array(t),n=0;n0&&e[a]===r[0]))return 1;i=t[a-1]}for(var s=1;i;){var l=i.key,u=n(r,l[0],l[1]);if(l[0][0]0))return 0;s=-1,i=i.right}else if(u>0)i=i.left;else{if(!(u<0))return 0;s=1,i=i.right}}return s}}(m.slabs,m.coordinates);return 0===i.length?y:function(t,e){return function(r){return t(r[0],r[1])?0:e(r)}}(l(i),y)};var n=t("robust-orientation")[3],a=t("slab-decomposition"),i=t("interval-tree-1d"),o=t("binary-search-bounds");function s(){return!0}function l(t){for(var e={},r=0;r=-t},pointBetween:function(e,r,n){var a=e[1]-r[1],i=n[0]-r[0],o=e[0]-r[0],s=n[1]-r[1],l=o*i+a*s;return!(l-t)},pointsSameX:function(e,r){return Math.abs(e[0]-r[0])t!=o-a>t&&(i-u)*(a-c)/(o-c)+u-n>t&&(s=!s),i=u,o=c}return s}};return e}},{}],280:[function(t,e,r){var n={toPolygon:function(t,e){function r(e){if(e.length<=0)return t.segments({inverted:!1,regions:[]});function r(e){var r=e.slice(0,e.length-1);return t.segments({inverted:!1,regions:[r]})}for(var n=r(e[0]),a=1;a0}))}function c(t,n){var a=t.seg,i=n.seg,o=a.start,s=a.end,u=i.start,c=i.end;r&&r.checkIntersection(a,i);var f=e.linesIntersect(o,s,u,c);if(!1===f){if(!e.pointsCollinear(o,s,u))return!1;if(e.pointsSame(o,c)||e.pointsSame(s,u))return!1;var d=e.pointsSame(o,u),h=e.pointsSame(s,c);if(d&&h)return n;var p=!d&&e.pointBetween(o,u,c),g=!h&&e.pointBetween(s,u,c);if(d)return g?l(n,s):l(t,c),n;p&&(h||(g?l(n,s):l(t,c)),l(n,o))}else 0===f.alongA&&(-1===f.alongB?l(t,u):0===f.alongB?l(t,f.pt):1===f.alongB&&l(t,c)),0===f.alongB&&(-1===f.alongA?l(n,o):0===f.alongA?l(n,f.pt):1===f.alongA&&l(n,s));return!1}for(var f=[];!i.isEmpty();){var d=i.getHead();if(r&&r.vert(d.pt[0]),d.isStart){r&&r.segmentNew(d.seg,d.primary);var h=u(d),p=h.before?h.before.ev:null,g=h.after?h.after.ev:null;function v(){if(p){var t=c(d,p);if(t)return t}return!!g&&c(d,g)}r&&r.tempStatus(d.seg,!!p&&p.seg,!!g&&g.seg);var m,y=v();if(y){var b;if(t)(b=null===d.seg.myFill.below||d.seg.myFill.above!==d.seg.myFill.below)&&(y.seg.myFill.above=!y.seg.myFill.above);else y.seg.otherFill=d.seg.myFill;r&&r.segmentUpdate(y.seg),d.other.remove(),d.remove()}if(i.getHead()!==d){r&&r.rewind(d.seg);continue}if(t)b=null===d.seg.myFill.below||d.seg.myFill.above!==d.seg.myFill.below,d.seg.myFill.below=g?g.seg.myFill.above:a,d.seg.myFill.above=b?!d.seg.myFill.below:d.seg.myFill.below;else if(null===d.seg.otherFill)m=g?d.primary===g.primary?g.seg.otherFill.above:g.seg.myFill.above:d.primary?o:a,d.seg.otherFill={above:m,below:m};r&&r.status(d.seg,!!p&&p.seg,!!g&&g.seg),d.other.status=h.insert(n.node({ev:d}))}else{var x=d.status;if(null===x)throw new Error("PolyBool: Zero-length segment detected; your epsilon is probably too small or too large");if(s.exists(x.prev)&&s.exists(x.next)&&c(x.prev.ev,x.next.ev),r&&r.statusRemove(x.ev.seg),x.remove(),!d.primary){var _=d.seg.myFill;d.seg.myFill=d.seg.otherFill,d.seg.otherFill=_}f.push(d.seg)}i.getHead().remove()}return r&&r.done(),f}return t?{addRegion:function(t){for(var n,a,i,o=t[t.length-1],l=0;l1)for(var r=1;r1&&(t.scaleRatio=[t.scale[0]*t.viewport.width,t.scale[1]*t.viewport.height],r(t),t.after&&t.after(t))}function A(t){if(t){null!=t.length?"number"==typeof t[0]&&(t=[{positions:t}]):Array.isArray(t)||(t=[t]);var e=0,r=0;if(x.groups=b=t.map((function(t,u){var c=b[u];return t?("function"==typeof t?t={after:t}:"number"==typeof t[0]&&(t={positions:t}),t=o(t,{color:"color colors fill",capSize:"capSize cap capsize cap-size",lineWidth:"lineWidth line-width width line thickness",opacity:"opacity alpha",range:"range dataBox",viewport:"viewport viewBox",errors:"errors error",positions:"positions position data points"}),c||(b[u]=c={id:u,scale:null,translate:null,scaleFract:null,translateFract:null,draw:!0},t=s({},y,t)),i(c,t,[{lineWidth:function(t){return.5*+t},capSize:function(t){return.5*+t},opacity:parseFloat,errors:function(t){return t=l(t),r+=t.length,t},positions:function(t,r){return t=l(t,"float64"),r.count=Math.floor(t.length/2),r.bounds=n(t,2),r.offset=e,e+=r.count,t}},{color:function(t,e){var r=e.count;if(t||(t="transparent"),!Array.isArray(t)||"number"==typeof t[0]){var n=t;t=Array(r);for(var i=0;i 0. && baClipping < length(normalWidth * endBotJoin)) {\n\t\t//handle miter clipping\n\t\tbTopCoord -= normalWidth * endTopJoin;\n\t\tbTopCoord += normalize(endTopJoin * normalWidth) * baClipping;\n\t}\n\n\tif (nextReverse) {\n\t\t//make join rectangular\n\t\tvec2 miterShift = normalWidth * endJoinDirection * miterLimit * .5;\n\t\tfloat normalAdjust = 1. - min(miterLimit / endMiterRatio, 1.);\n\t\tbBotCoord = bCoord + miterShift - normalAdjust * normalWidth * currNormal * .5;\n\t\tbTopCoord = bCoord + miterShift + normalAdjust * normalWidth * currNormal * .5;\n\t}\n\telse if (!prevReverse && abClipping > 0. && abClipping < length(normalWidth * startBotJoin)) {\n\t\t//handle miter clipping\n\t\taBotCoord -= normalWidth * startBotJoin;\n\t\taBotCoord += normalize(startBotJoin * normalWidth) * abClipping;\n\t}\n\n\tvec2 aTopPosition = (aTopCoord) * adjustedScale + translate;\n\tvec2 aBotPosition = (aBotCoord) * adjustedScale + translate;\n\n\tvec2 bTopPosition = (bTopCoord) * adjustedScale + translate;\n\tvec2 bBotPosition = (bBotCoord) * adjustedScale + translate;\n\n\t//position is normalized 0..1 coord on the screen\n\tvec2 position = (aTopPosition * lineTop + aBotPosition * lineBot) * lineStart + (bTopPosition * lineTop + bBotPosition * lineBot) * lineEnd;\n\n\tstartCoord = aCoord * scaleRatio + translate * viewport.zw + viewport.xy;\n\tendCoord = bCoord * scaleRatio + translate * viewport.zw + viewport.xy;\n\n\tgl_Position = vec4(position * 2.0 - 1.0, depth, 1);\n\n\tenableStartMiter = step(dot(currTangent, prevTangent), .5);\n\tenableEndMiter = step(dot(currTangent, nextTangent), .5);\n\n\t//bevel miter cutoffs\n\tif (miterMode == 1.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tvec2 startMiterWidth = vec2(startJoinDirection) * thickness * miterLimit * .5;\n\t\t\tstartCutoff = vec4(aCoord, aCoord);\n\t\t\tstartCutoff.zw += vec2(-startJoinDirection.y, startJoinDirection.x) / scaleRatio;\n\t\t\tstartCutoff = startCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;\n\t\t\tstartCutoff += viewport.xyxy;\n\t\t\tstartCutoff += startMiterWidth.xyxy;\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tvec2 endMiterWidth = vec2(endJoinDirection) * thickness * miterLimit * .5;\n\t\t\tendCutoff = vec4(bCoord, bCoord);\n\t\t\tendCutoff.zw += vec2(-endJoinDirection.y, endJoinDirection.x) / scaleRatio;\n\t\t\tendCutoff = endCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;\n\t\t\tendCutoff += viewport.xyxy;\n\t\t\tendCutoff += endMiterWidth.xyxy;\n\t\t}\n\t}\n\n\t//round miter cutoffs\n\telse if (miterMode == 2.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tvec2 startMiterWidth = vec2(startJoinDirection) * thickness * abs(dot(startJoinDirection, currNormal)) * .5;\n\t\t\tstartCutoff = vec4(aCoord, aCoord);\n\t\t\tstartCutoff.zw += vec2(-startJoinDirection.y, startJoinDirection.x) / scaleRatio;\n\t\t\tstartCutoff = startCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;\n\t\t\tstartCutoff += viewport.xyxy;\n\t\t\tstartCutoff += startMiterWidth.xyxy;\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tvec2 endMiterWidth = vec2(endJoinDirection) * thickness * abs(dot(endJoinDirection, currNormal)) * .5;\n\t\t\tendCutoff = vec4(bCoord, bCoord);\n\t\t\tendCutoff.zw += vec2(-endJoinDirection.y, endJoinDirection.x) / scaleRatio;\n\t\t\tendCutoff = endCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;\n\t\t\tendCutoff += viewport.xyxy;\n\t\t\tendCutoff += endMiterWidth.xyxy;\n\t\t}\n\t}\n}\n"]),frag:o(["precision highp float;\n#define GLSLIFY 1\n\nuniform sampler2D dashPattern;\nuniform float dashSize, pixelRatio, thickness, opacity, id, miterMode;\n\nvarying vec4 fragColor;\nvarying vec2 tangent;\nvarying vec4 startCutoff, endCutoff;\nvarying vec2 startCoord, endCoord;\nvarying float enableStartMiter, enableEndMiter;\n\nfloat distToLine(vec2 p, vec2 a, vec2 b) {\n\tvec2 diff = b - a;\n\tvec2 perp = normalize(vec2(-diff.y, diff.x));\n\treturn dot(p - a, perp);\n}\n\nvoid main() {\n\tfloat alpha = 1., distToStart, distToEnd;\n\tfloat cutoff = thickness * .5;\n\n\t//bevel miter\n\tif (miterMode == 1.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tdistToStart = distToLine(gl_FragCoord.xy, startCutoff.xy, startCutoff.zw);\n\t\t\tif (distToStart < -1.) {\n\t\t\t\tdiscard;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\talpha *= min(max(distToStart + 1., 0.), 1.);\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tdistToEnd = distToLine(gl_FragCoord.xy, endCutoff.xy, endCutoff.zw);\n\t\t\tif (distToEnd < -1.) {\n\t\t\t\tdiscard;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\talpha *= min(max(distToEnd + 1., 0.), 1.);\n\t\t}\n\t}\n\n\t// round miter\n\telse if (miterMode == 2.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tdistToStart = distToLine(gl_FragCoord.xy, startCutoff.xy, startCutoff.zw);\n\t\t\tif (distToStart < 0.) {\n\t\t\t\tfloat radius = length(gl_FragCoord.xy - startCoord);\n\n\t\t\t\tif(radius > cutoff + .5) {\n\t\t\t\t\tdiscard;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\talpha -= smoothstep(cutoff - .5, cutoff + .5, radius);\n\t\t\t}\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tdistToEnd = distToLine(gl_FragCoord.xy, endCutoff.xy, endCutoff.zw);\n\t\t\tif (distToEnd < 0.) {\n\t\t\t\tfloat radius = length(gl_FragCoord.xy - endCoord);\n\n\t\t\t\tif(radius > cutoff + .5) {\n\t\t\t\t\tdiscard;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\talpha -= smoothstep(cutoff - .5, cutoff + .5, radius);\n\t\t\t}\n\t\t}\n\t}\n\n\tfloat t = fract(dot(tangent, gl_FragCoord.xy) / dashSize) * .5 + .25;\n\tfloat dash = texture2D(dashPattern, vec2(t, .5)).r;\n\n\tgl_FragColor = fragColor;\n\tgl_FragColor.a *= alpha * opacity * dash;\n}\n"]),attributes:{lineEnd:{buffer:r,divisor:0,stride:8,offset:0},lineTop:{buffer:r,divisor:0,stride:8,offset:4},aColor:{buffer:t.prop("colorBuffer"),stride:4,offset:0,divisor:1},bColor:{buffer:t.prop("colorBuffer"),stride:4,offset:4,divisor:1},prevCoord:{buffer:t.prop("positionBuffer"),stride:8,offset:0,divisor:1},aCoord:{buffer:t.prop("positionBuffer"),stride:8,offset:8,divisor:1},bCoord:{buffer:t.prop("positionBuffer"),stride:8,offset:16,divisor:1},nextCoord:{buffer:t.prop("positionBuffer"),stride:8,offset:24,divisor:1}}},n))}catch(t){e=a}return{fill:t({primitive:"triangle",elements:function(t,e){return e.triangles},offset:0,vert:o(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec2 position, positionFract;\n\nuniform vec4 color;\nuniform vec2 scale, scaleFract, translate, translateFract;\nuniform float pixelRatio, id;\nuniform vec4 viewport;\nuniform float opacity;\n\nvarying vec4 fragColor;\n\nconst float MAX_LINES = 256.;\n\nvoid main() {\n\tfloat depth = (MAX_LINES - 4. - id) / (MAX_LINES);\n\n\tvec2 position = position * scale + translate\n + positionFract * scale + translateFract\n + position * scaleFract\n + positionFract * scaleFract;\n\n\tgl_Position = vec4(position * 2.0 - 1.0, depth, 1);\n\n\tfragColor = color / 255.;\n\tfragColor.a *= opacity;\n}\n"]),frag:o(["precision highp float;\n#define GLSLIFY 1\n\nvarying vec4 fragColor;\n\nvoid main() {\n\tgl_FragColor = fragColor;\n}\n"]),uniforms:{scale:t.prop("scale"),color:t.prop("fill"),scaleFract:t.prop("scaleFract"),translateFract:t.prop("translateFract"),translate:t.prop("translate"),opacity:t.prop("opacity"),pixelRatio:t.context("pixelRatio"),id:t.prop("id"),viewport:function(t,e){return[e.viewport.x,e.viewport.y,t.viewportWidth,t.viewportHeight]}},attributes:{position:{buffer:t.prop("positionBuffer"),stride:8,offset:8},positionFract:{buffer:t.prop("positionFractBuffer"),stride:8,offset:8}},blend:n.blend,depth:{enable:!1},scissor:n.scissor,stencil:n.stencil,viewport:n.viewport}),rect:a,miter:e}},v.defaults={dashes:null,join:"miter",miterLimit:1,thickness:10,cap:"square",color:"black",opacity:1,overlay:!1,viewport:null,range:null,close:!1,fill:null},v.prototype.render=function(){for(var t,e=[],r=arguments.length;r--;)e[r]=arguments[r];e.length&&(t=this).update.apply(t,e),this.draw()},v.prototype.draw=function(){for(var t=this,e=[],r=arguments.length;r--;)e[r]=arguments[r];return(e.length?e:this.passes).forEach((function(e,r){var n;if(e&&Array.isArray(e))return(n=t).draw.apply(n,e);"number"==typeof e&&(e=t.passes[e]),e&&e.count>1&&e.opacity&&(t.regl._refresh(),e.fill&&e.triangles&&e.triangles.length>2&&t.shaders.fill(e),e.thickness&&(e.scale[0]*e.viewport.width>v.precisionThreshold||e.scale[1]*e.viewport.height>v.precisionThreshold||"rect"===e.join||!e.join&&(e.thickness<=2||e.count>=v.maxPoints)?t.shaders.rect(e):t.shaders.miter(e)))})),this},v.prototype.update=function(t){var e=this;if(t){null!=t.length?"number"==typeof t[0]&&(t=[{positions:t}]):Array.isArray(t)||(t=[t]);var r=this.regl,o=this.gl;if(t.forEach((function(t,f){var p=e.passes[f];if(void 0!==t)if(null!==t){if("number"==typeof t[0]&&(t={positions:t}),t=s(t,{positions:"positions points data coords",thickness:"thickness lineWidth lineWidths line-width linewidth width stroke-width strokewidth strokeWidth",join:"lineJoin linejoin join type mode",miterLimit:"miterlimit miterLimit",dashes:"dash dashes dasharray dash-array dashArray",color:"color colour stroke colors colours stroke-color strokeColor",fill:"fill fill-color fillColor",opacity:"alpha opacity",overlay:"overlay crease overlap intersect",close:"closed close closed-path closePath",range:"range dataBox",viewport:"viewport viewBox",hole:"holes hole hollow"}),p||(e.passes[f]=p={id:f,scale:null,scaleFract:null,translate:null,translateFract:null,count:0,hole:[],depth:0,dashLength:1,dashTexture:r.texture({channels:1,data:new Uint8Array([255]),width:1,height:1,mag:"linear",min:"linear"}),colorBuffer:r.buffer({usage:"dynamic",type:"uint8",data:new Uint8Array}),positionBuffer:r.buffer({usage:"dynamic",type:"float",data:new Uint8Array}),positionFractBuffer:r.buffer({usage:"dynamic",type:"float",data:new Uint8Array})},t=i({},v.defaults,t)),null!=t.thickness&&(p.thickness=parseFloat(t.thickness)),null!=t.opacity&&(p.opacity=parseFloat(t.opacity)),null!=t.miterLimit&&(p.miterLimit=parseFloat(t.miterLimit)),null!=t.overlay&&(p.overlay=!!t.overlay,ft.length)&&(e=t.length);for(var r=0,n=new Array(e);r 1.0 + delta) {\n\t\tdiscard;\n\t}\n\n\talpha -= smoothstep(1.0 - delta, 1.0 + delta, radius);\n\n\tfloat borderRadius = fragBorderRadius;\n\tfloat ratio = smoothstep(borderRadius - delta, borderRadius + delta, radius);\n\tvec4 color = mix(fragColor, fragBorderColor, ratio);\n\tcolor.a *= alpha * opacity;\n\tgl_FragColor = color;\n}\n"]),l.vert=d(["precision highp float;\n#define GLSLIFY 1\n\nattribute float x, y, xFract, yFract;\nattribute float size, borderSize;\nattribute vec4 colorId, borderColorId;\nattribute float isActive;\n\nuniform vec2 scale, scaleFract, translate, translateFract;\nuniform float pixelRatio;\nuniform bool constPointSize;\nuniform sampler2D palette;\nuniform vec2 paletteSize;\n\nconst float maxSize = 100.;\n\nvarying vec4 fragColor, fragBorderColor;\nvarying float fragBorderRadius, fragWidth;\n\nfloat pointSizeScale = (constPointSize) ? 2. : pixelRatio;\n\nbool isDirect = (paletteSize.x < 1.);\n\nvec4 getColor(vec4 id) {\n return isDirect ? id / 255. : texture2D(palette,\n vec2(\n (id.x + .5) / paletteSize.x,\n (id.y + .5) / paletteSize.y\n )\n );\n}\n\nvoid main() {\n // ignore inactive points\n if (isActive == 0.) return;\n\n vec2 position = vec2(x, y);\n vec2 positionFract = vec2(xFract, yFract);\n\n vec4 color = getColor(colorId);\n vec4 borderColor = getColor(borderColorId);\n\n float size = size * maxSize / 255.;\n float borderSize = borderSize * maxSize / 255.;\n\n gl_PointSize = (size + borderSize) * pointSizeScale;\n\n vec2 pos = (position + translate) * scale\n + (positionFract + translateFract) * scale\n + (position + translate) * scaleFract\n + (positionFract + translateFract) * scaleFract;\n\n gl_Position = vec4(pos * 2. - 1., 0., 1.);\n\n fragBorderRadius = 1. - 2. * borderSize / (size + borderSize);\n fragColor = color;\n fragBorderColor = borderColor.a == 0. || borderSize == 0. ? vec4(color.rgb, 0.) : borderColor;\n fragWidth = 1. / gl_PointSize;\n}\n"]),v&&(l.frag=l.frag.replace("smoothstep","smoothStep"),s.frag=s.frag.replace("smoothstep","smoothStep")),this.drawCircle=t(l)}x.defaults={color:"black",borderColor:"transparent",borderSize:0,size:12,opacity:1,marker:void 0,viewport:null,range:null,pixelSize:null,count:0,offset:0,bounds:null,positions:[],snap:1e4},x.prototype.render=function(){return arguments.length&&this.update.apply(this,arguments),this.draw(),this},x.prototype.draw=function(){for(var t=this,e=arguments.length,r=new Array(e),n=0;nn)?e.tree=c(t,{bounds:f}):n&&n.length&&(e.tree=n),e.tree){var d={primitive:"points",usage:"static",data:e.tree,type:"uint32"};e.elements?e.elements(d):e.elements=o.elements(d)}return a({data:m.float(t),usage:"dynamic"}),i({data:m.fract(t),usage:"dynamic"}),s({data:new Uint8Array(u),type:"uint8",usage:"stream"}),t}},{marker:function(e,r,n){var a=r.activation;if(a.forEach((function(t){return t&&t.destroy&&t.destroy()})),a.length=0,e&&"number"!=typeof e[0]){for(var i=[],s=0,l=Math.min(e.length,r.count);s=0)return i;if(t instanceof Uint8Array||t instanceof Uint8ClampedArray)e=t;else{e=new Uint8Array(t.length);for(var o=0,s=t.length;o4*n&&(this.tooManyColors=!0),this.updatePalette(r),1===a.length?a[0]:a},x.prototype.updatePalette=function(t){if(!this.tooManyColors){var e=this.maxColors,r=this.paletteTexture,n=Math.ceil(.25*t.length/e);if(n>1)for(var a=.25*(t=t.slice()).length%e;a2?(s[0],s[2],n=s[1],a=s[3]):s.length?(n=s[0],a=s[1]):(s.x,n=s.y,s.x+s.width,a=s.y+s.height),l.length>2?(i=l[0],o=l[2],l[1],l[3]):l.length?(i=l[0],o=l[1]):(i=l.x,l.y,o=l.x+l.width,l.y+l.height),[i,n,o,a]}function h(t){if("number"==typeof t)return[t,t,t,t];if(2===t.length)return[t[0],t[1],t[0],t[1]];var e=l(t);return[e.x,e.y,e.x+e.width,e.y+e.height]}e.exports=c,c.prototype.render=function(){for(var t,e=this,r=[],n=arguments.length;n--;)r[n]=arguments[n];return r.length&&(t=this).update.apply(t,r),this.regl.attributes.preserveDrawingBuffer?this.draw():(this.dirty?null==this.planned&&(this.planned=o((function(){e.draw(),e.dirty=!0,e.planned=null}))):(this.draw(),this.dirty=!0,o((function(){e.dirty=!1}))),this)},c.prototype.update=function(){for(var t,e=[],r=arguments.length;r--;)e[r]=arguments[r];if(e.length){for(var n=0;nT))&&(s.lower||!(A>>=e))<<3,(e|=r=(15<(t>>>=r))<<2)|(r=(3<(t>>>=r))<<1)|t>>>r>>1}function s(){function t(t){t:{for(var e=16;268435456>=e;e*=16)if(t<=e){t=e;break t}t=0}return 0<(e=r[o(t)>>2]).length?e.pop():new ArrayBuffer(t)}function e(t){r[o(t.byteLength)>>2].push(t)}var r=i(8,(function(){return[]}));return{alloc:t,free:e,allocType:function(e,r){var n=null;switch(e){case 5120:n=new Int8Array(t(r),0,r);break;case 5121:n=new Uint8Array(t(r),0,r);break;case 5122:n=new Int16Array(t(2*r),0,r);break;case 5123:n=new Uint16Array(t(2*r),0,r);break;case 5124:n=new Int32Array(t(4*r),0,r);break;case 5125:n=new Uint32Array(t(4*r),0,r);break;case 5126:n=new Float32Array(t(4*r),0,r);break;default:return null}return n.length!==r?n.subarray(0,r):n},freeType:function(t){e(t.buffer)}}}function l(t){return!!t&&"object"==typeof t&&Array.isArray(t.shape)&&Array.isArray(t.stride)&&"number"==typeof t.offset&&t.shape.length===t.stride.length&&(Array.isArray(t.data)||Y(t.data))}function u(t,e,r,n,a,i){for(var o=0;o(a=s)&&(a=n.buffer.byteLength,5123===f?a>>=1:5125===f&&(a>>=2)),n.vertCount=a,a=o,0>o&&(a=4,1===(o=n.buffer.dimension)&&(a=0),2===o&&(a=1),3===o&&(a=4)),n.primType=a}function o(t){n.elementsCount--,delete s[t.id],t.buffer.destroy(),t.buffer=null}var s={},u=0,c={uint8:5121,uint16:5123};e.oes_element_index_uint&&(c.uint32=5125),a.prototype.bind=function(){this.buffer.bind()};var f=[];return{create:function(t,e){function s(t){if(t)if("number"==typeof t)u(t),f.primType=4,f.vertCount=0|t,f.type=5121;else{var e=null,r=35044,n=-1,a=-1,o=0,d=0;Array.isArray(t)||Y(t)||l(t)?e=t:("data"in t&&(e=t.data),"usage"in t&&(r=K[t.usage]),"primitive"in t&&(n=nt[t.primitive]),"count"in t&&(a=0|t.count),"type"in t&&(d=c[t.type]),"length"in t?o=0|t.length:(o=a,5123===d||5122===d?o*=2:5125!==d&&5124!==d||(o*=4))),i(f,e,r,n,a,o,d)}else u(),f.primType=4,f.vertCount=0,f.type=5121;return s}var u=r.create(null,34963,!0),f=new a(u._buffer);return n.elementsCount++,s(t),s._reglType="elements",s._elements=f,s.subdata=function(t,e){return u.subdata(t,e),s},s.destroy=function(){o(f)},s},createStream:function(t){var e=f.pop();return e||(e=new a(r.create(null,34963,!0,!1)._buffer)),i(e,t,35040,-1,-1,0,0),e},destroyStream:function(t){f.push(t)},getElements:function(t){return"function"==typeof t&&t._elements instanceof a?t._elements:null},clear:function(){Z(s).forEach(o)}}}function g(t){for(var e=X.allocType(5123,t.length),r=0;r>>31<<15,a=(i<<1>>>24)-127,i=i>>13&1023;e[r]=-24>a?n:-14>a?n+(i+1024>>-14-a):15>=a,r.height>>=a,h(r,n[a]),t.mipmask|=1<e;++e)t.images[e]=null;return t}function L(t){for(var e=t.images,r=0;re){for(var r=0;r=--this.refCount&&z(this)}}),o.profile&&(i.getTotalTextureSize=function(){var t=0;return Object.keys(yt).forEach((function(e){t+=yt[e].stats.size})),t}),{create2D:function(e,r){function n(t,e){var r=a.texInfo;O.call(r);var i=C();return"number"==typeof t?M(i,0|t,"number"==typeof e?0|e:0|t):t?(D(r,t),E(i,t)):M(i,1,1),r.genMipmaps&&(i.mipmask=(i.width<<1)-1),a.mipmask=i.mipmask,u(a,i),a.internalformat=i.internalformat,n.width=i.width,n.height=i.height,P(a),S(i,3553),R(r,3553),F(),L(i),o.profile&&(a.stats.size=A(a.internalformat,a.type,i.width,i.height,r.genMipmaps,!1)),n.format=tt[a.internalformat],n.type=et[a.type],n.mag=rt[r.magFilter],n.min=nt[r.minFilter],n.wrapS=at[r.wrapS],n.wrapT=at[r.wrapT],n}var a=new I(3553);return yt[a.id]=a,i.textureCount++,n(e,r),n.subimage=function(t,e,r,i){e|=0,r|=0,i|=0;var o=m();return u(o,a),o.width=0,o.height=0,h(o,t),o.width=o.width||(a.width>>i)-e,o.height=o.height||(a.height>>i)-r,P(a),p(o,3553,e,r,i),F(),T(o),n},n.resize=function(e,r){var i=0|e,s=0|r||i;if(i===a.width&&s===a.height)return n;n.width=a.width=i,n.height=a.height=s,P(a);for(var l=0;a.mipmask>>l;++l){var u=i>>l,c=s>>l;if(!u||!c)break;t.texImage2D(3553,l,a.format,u,c,0,a.format,a.type,null)}return F(),o.profile&&(a.stats.size=A(a.internalformat,a.type,i,s,!1,!1)),n},n._reglType="texture2d",n._texture=a,o.profile&&(n.stats=a.stats),n.destroy=function(){a.decRef()},n},createCube:function(e,r,n,a,s,l){function f(t,e,r,n,a,i){var s,l=d.texInfo;for(O.call(l),s=0;6>s;++s)g[s]=C();if("number"!=typeof t&&t){if("object"==typeof t)if(e)E(g[0],t),E(g[1],e),E(g[2],r),E(g[3],n),E(g[4],a),E(g[5],i);else if(D(l,t),c(d,t),"faces"in t)for(t=t.faces,s=0;6>s;++s)u(g[s],d),E(g[s],t[s]);else for(s=0;6>s;++s)E(g[s],t)}else for(t=0|t||1,s=0;6>s;++s)M(g[s],t,t);for(u(d,g[0]),d.mipmask=l.genMipmaps?(g[0].width<<1)-1:g[0].mipmask,d.internalformat=g[0].internalformat,f.width=g[0].width,f.height=g[0].height,P(d),s=0;6>s;++s)S(g[s],34069+s);for(R(l,34067),F(),o.profile&&(d.stats.size=A(d.internalformat,d.type,f.width,f.height,l.genMipmaps,!0)),f.format=tt[d.internalformat],f.type=et[d.type],f.mag=rt[l.magFilter],f.min=nt[l.minFilter],f.wrapS=at[l.wrapS],f.wrapT=at[l.wrapT],s=0;6>s;++s)L(g[s]);return f}var d=new I(34067);yt[d.id]=d,i.cubeCount++;var g=Array(6);return f(e,r,n,a,s,l),f.subimage=function(t,e,r,n,a){r|=0,n|=0,a|=0;var i=m();return u(i,d),i.width=0,i.height=0,h(i,e),i.width=i.width||(d.width>>a)-r,i.height=i.height||(d.height>>a)-n,P(d),p(i,34069+t,r,n,a),F(),T(i),f},f.resize=function(e){if((e|=0)!==d.width){f.width=d.width=e,f.height=d.height=e,P(d);for(var r=0;6>r;++r)for(var n=0;d.mipmask>>n;++n)t.texImage2D(34069+r,n,d.format,e>>n,e>>n,0,d.format,d.type,null);return F(),o.profile&&(d.stats.size=A(d.internalformat,d.type,f.width,f.height,!1,!0)),f}},f._reglType="textureCube",f._texture=d,o.profile&&(f.stats=d.stats),f.destroy=function(){d.decRef()},f},clear:function(){for(var e=0;er;++r)if(0!=(e.mipmask&1<>r,e.height>>r,0,e.internalformat,e.type,null);else for(var n=0;6>n;++n)t.texImage2D(34069+n,r,e.internalformat,e.width>>r,e.height>>r,0,e.internalformat,e.type,null);R(e.texInfo,e.target)}))}}}function k(t,e,r,n,a,i){function o(t,e,r){this.target=t,this.texture=e,this.renderbuffer=r;var n=t=0;e?(t=e.width,n=e.height):r&&(t=r.width,n=r.height),this.width=t,this.height=n}function s(t){t&&(t.texture&&t.texture._texture.decRef(),t.renderbuffer&&t.renderbuffer._renderbuffer.decRef())}function l(t,e,r){t&&(t.texture?t.texture._texture.refCount+=1:t.renderbuffer._renderbuffer.refCount+=1)}function u(e,r){r&&(r.texture?t.framebufferTexture2D(36160,e,r.target,r.texture._texture.texture,0):t.framebufferRenderbuffer(36160,e,36161,r.renderbuffer._renderbuffer.renderbuffer))}function c(t){var e=3553,r=null,n=null,a=t;return"object"==typeof t&&(a=t.data,"target"in t&&(e=0|t.target)),"texture2d"===(t=a._reglType)||"textureCube"===t?r=a:"renderbuffer"===t&&(n=a,e=36161),new o(e,r,n)}function f(t,e,r,i,s){return r?((t=n.create2D({width:t,height:e,format:i,type:s}))._texture.refCount=0,new o(3553,t,null)):((t=a.create({width:t,height:e,format:i}))._renderbuffer.refCount=0,new o(36161,null,t))}function d(t){return t&&(t.texture||t.renderbuffer)}function h(t,e,r){t&&(t.texture?t.texture.resize(e,r):t.renderbuffer&&t.renderbuffer.resize(e,r),t.width=e,t.height=r)}function p(){this.id=A++,T[this.id]=this,this.framebuffer=t.createFramebuffer(),this.height=this.width=0,this.colorAttachments=[],this.depthStencilAttachment=this.stencilAttachment=this.depthAttachment=null}function g(t){t.colorAttachments.forEach(s),s(t.depthAttachment),s(t.stencilAttachment),s(t.depthStencilAttachment)}function v(e){t.deleteFramebuffer(e.framebuffer),e.framebuffer=null,i.framebufferCount--,delete T[e.id]}function m(e){var n;t.bindFramebuffer(36160,e.framebuffer);var a=e.colorAttachments;for(n=0;na;++a){for(u=0;ut;++t)r[t].resize(n);return e.width=e.height=n,e},_reglType:"framebufferCube",destroy:function(){r.forEach((function(t){t.destroy()}))}})},clear:function(){Z(T).forEach(v)},restore:function(){b.cur=null,b.next=null,b.dirty=!0,Z(T).forEach((function(e){e.framebuffer=t.createFramebuffer(),m(e)}))}})}function M(){this.w=this.z=this.y=this.x=this.state=0,this.buffer=null,this.size=0,this.normalized=!1,this.type=5126,this.divisor=this.stride=this.offset=0}function E(t,e,r,n,a){function i(){this.id=++u,this.attributes=[];var t=e.oes_vertex_array_object;this.vao=t?t.createVertexArrayOES():null,c[this.id]=this,this.buffers=[]}var o=r.maxAttributes,s=Array(o);for(r=0;rt&&(t=e.stats.uniformsCount)})),t},r.getMaxAttributesCount=function(){var t=0;return d.forEach((function(e){e.stats.attributesCount>t&&(t=e.stats.attributesCount)})),t}),{clear:function(){var e=t.deleteShader.bind(t);Z(u).forEach(e),u={},Z(c).forEach(e),c={},d.forEach((function(e){t.deleteProgram(e.program)})),d.length=0,f={},r.shaderCount=0},program:function(t,e,n,a){var i=f[e];i||(i=f[e]={});var o=i[t];return o&&!a?o:(e=new s(e,t),r.shaderCount++,l(e,n,a),o||(i[t]=e),d.push(e),e)},restore:function(){u={},c={};for(var t=0;t"+e+"?"+a+".constant["+e+"]:0;"})).join(""),"}}else{","if(",s,"(",a,".buffer)){",c,"=",i,".createStream(",34962,",",a,".buffer);","}else{",c,"=",i,".getBuffer(",a,".buffer);","}",f,'="type" in ',a,"?",o.glTypes,"[",a,".type]:",c,".dtype;",l.normalized,"=!!",a,".normalized;"),n("size"),n("offset"),n("stride"),n("divisor"),r("}}"),r.exit("if(",l.isStream,"){",i,".destroyStream(",c,");","}"),l}))})),o}function k(t,e,n,a,o){function s(t){var e=u[t];e&&(d[t]=e)}var l=function(t,e){if("string"==typeof(r=t.static).frag&&"string"==typeof r.vert){if(0>1)",s],");")}function e(){r(l,".drawArraysInstancedANGLE(",[p,g,v,s],");")}h?y?t():(r("if(",h,"){"),t(),r("}else{"),e(),r("}")):e()}function o(){function t(){r(c+".drawElements("+[p,v,m,g+"<<(("+m+"-5121)>>1)"]+");")}function e(){r(c+".drawArrays("+[p,g,v]+");")}h?y?t():(r("if(",h,"){"),t(),r("}else{"),e(),r("}")):e()}var s,l,u=t.shared,c=u.gl,f=u.draw,d=n.draw,h=function(){var a=d.elements,i=e;return a?((a.contextDep&&n.contextDynamic||a.propDep)&&(i=r),a=a.append(t,i)):a=i.def(f,".","elements"),a&&i("if("+a+")"+c+".bindBuffer(34963,"+a+".buffer.buffer);"),a}(),p=a("primitive"),g=a("offset"),v=function(){var a=d.count,i=e;return a?((a.contextDep&&n.contextDynamic||a.propDep)&&(i=r),a=a.append(t,i)):a=i.def(f,".","count"),a}();if("number"==typeof v){if(0===v)return}else r("if(",v,"){"),r.exit("}");Q&&(s=a("instances"),l=t.instancing);var m=h+".type",y=d.elements&&F(d.elements);Q&&("number"!=typeof s||0<=s)?"string"==typeof s?(r("if(",s,">0){"),i(),r("}else if(",s,"<0){"),o(),r("}")):i():o()}function V(t,e,r,n,a){return a=(e=x()).proc("body",a),Q&&(e.instancing=a.def(e.shared.extensions,".angle_instanced_arrays")),t(e,a,r,n),e.compile().body}function G(t,e,r,n){L(t,e),r.useVAO?r.drawVAO?e(t.shared.vao,".setVAO(",r.drawVAO.append(t,e),");"):e(t.shared.vao,".setVAO(",t.shared.vao,".targetVAO);"):(e(t.shared.vao,".setVAO(null);"),B(t,e,r,n.attributes,(function(){return!0}))),j(t,e,r,n.uniforms,(function(){return!0})),U(t,e,e,r)}function q(t,e,r,n){function a(){return!0}t.batchId="a1",L(t,e),B(t,e,r,n.attributes,a),j(t,e,r,n.uniforms,a),U(t,e,e,r)}function X(t,e,r,n){function a(t){return t.contextDep&&o||t.propDep}function i(t){return!a(t)}L(t,e);var o=r.contextDep,s=e.def(),l=e.def();t.shared.props=l,t.batchId=s;var u=t.scope(),c=t.scope();e(u.entry,"for(",s,"=0;",s,"<","a1",";++",s,"){",l,"=","a0","[",s,"];",c,"}",u.exit),r.needsContext&&M(t,c,r.context),r.needsFramebuffer&&E(t,c,r.framebuffer),C(t,c,r.state,a),r.profile&&a(r.profile)&&O(t,c,r,!1,!0),n?(r.useVAO?r.drawVAO?a(r.drawVAO)?c(t.shared.vao,".setVAO(",r.drawVAO.append(t,c),");"):u(t.shared.vao,".setVAO(",r.drawVAO.append(t,u),");"):u(t.shared.vao,".setVAO(",t.shared.vao,".targetVAO);"):(u(t.shared.vao,".setVAO(null);"),B(t,u,r,n.attributes,i),B(t,c,r,n.attributes,a)),j(t,u,r,n.uniforms,i),j(t,c,r,n.uniforms,a),U(t,u,c,r)):(e=t.global.def("{}"),n=r.shader.progVar.append(t,c),l=c.def(n,".id"),u=c.def(e,"[",l,"]"),c(t.shared.gl,".useProgram(",n,".program);","if(!",u,"){",u,"=",e,"[",l,"]=",t.link((function(e){return V(q,t,r,e,2)})),"(",n,");}",u,".call(this,a0[",s,"],",s,");"))}function W(t,r){function n(e){var n=r.shader[e];n&&a.set(i.shader,"."+e,n.append(t,a))}var a=t.proc("scope",3);t.batchId="a2";var i=t.shared,o=i.current;M(t,a,r.context),r.framebuffer&&r.framebuffer.append(t,a),I(Object.keys(r.state)).forEach((function(e){var n=r.state[e].append(t,a);v(n)?n.forEach((function(r,n){a.set(t.next[e],"["+n+"]",r)})):a.set(i.next,"."+e,n)})),O(t,a,r,!0,!0),["elements","offset","count","instances","primitive"].forEach((function(e){var n=r.draw[e];n&&a.set(i.draw,"."+e,""+n.append(t,a))})),Object.keys(r.uniforms).forEach((function(n){a.set(i.uniforms,"["+e.id(n)+"]",r.uniforms[n].append(t,a))})),Object.keys(r.attributes).forEach((function(e){var n=r.attributes[e].append(t,a),i=t.scopeAttrib(e);Object.keys(new Z).forEach((function(t){a.set(i,"."+t,n[t])}))})),r.scopeVAO&&a.set(i.vao,".targetVAO",r.scopeVAO.append(t,a)),n("vert"),n("frag"),0=--this.refCount&&o(this)},a.profile&&(n.getTotalRenderbufferSize=function(){var t=0;return Object.keys(c).forEach((function(e){t+=c[e].stats.size})),t}),{create:function(e,r){function o(e,r){var n=0,i=0,c=32854;if("object"==typeof e&&e?("shape"in e?(n=0|(i=e.shape)[0],i=0|i[1]):("radius"in e&&(n=i=0|e.radius),"width"in e&&(n=0|e.width),"height"in e&&(i=0|e.height)),"format"in e&&(c=s[e.format])):"number"==typeof e?(n=0|e,i="number"==typeof r?0|r:n):e||(n=i=1),n!==u.width||i!==u.height||c!==u.format)return o.width=u.width=n,o.height=u.height=i,u.format=c,t.bindRenderbuffer(36161,u.renderbuffer),t.renderbufferStorage(36161,c,n,i),a.profile&&(u.stats.size=yt[u.format]*u.width*u.height),o.format=l[u.format],o}var u=new i(t.createRenderbuffer());return c[u.id]=u,n.renderbufferCount++,o(e,r),o.resize=function(e,r){var n=0|e,i=0|r||n;return n===u.width&&i===u.height||(o.width=u.width=n,o.height=u.height=i,t.bindRenderbuffer(36161,u.renderbuffer),t.renderbufferStorage(36161,u.format,n,i),a.profile&&(u.stats.size=yt[u.format]*u.width*u.height)),o},o._reglType="renderbuffer",o._renderbuffer=u,a.profile&&(o.stats=u.stats),o.destroy=function(){u.decRef()},o},clear:function(){Z(c).forEach(o)},restore:function(){Z(c).forEach((function(e){e.renderbuffer=t.createRenderbuffer(),t.bindRenderbuffer(36161,e.renderbuffer),t.renderbufferStorage(36161,e.format,e.width,e.height)})),t.bindRenderbuffer(36161,null)}}},xt=[];xt[6408]=4,xt[6407]=3;var _t=[];_t[5121]=1,_t[5126]=4,_t[36193]=2;var wt=["x","y","z","w"],At="blend.func blend.equation stencil.func stencil.opFront stencil.opBack sample.coverage viewport scissor.box polygonOffset.offset".split(" "),Tt={0:0,1:1,zero:0,one:1,"src color":768,"one minus src color":769,"src alpha":770,"one minus src alpha":771,"dst color":774,"one minus dst color":775,"dst alpha":772,"one minus dst alpha":773,"constant color":32769,"one minus constant color":32770,"constant alpha":32771,"one minus constant alpha":32772,"src alpha saturate":776},kt={never:512,less:513,"<":513,equal:514,"=":514,"==":514,"===":514,lequal:515,"<=":515,greater:516,">":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},Mt={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},Et={cw:2304,ccw:2305},St=new P(!1,!1,!1,(function(){}));return function(t){function e(){if(0===J.length)w&&w.update(),tt=null;else{tt=G.next(e),f();for(var t=J.length-1;0<=t;--t){var r=J[t];r&&r(O,null,0)}v.flush(),w&&w.update()}}function r(){!tt&&0=J.length&&n()}}}}function c(){var t=Y.viewport,e=Y.scissor_box;t[0]=t[1]=e[0]=e[1]=0,O.viewportWidth=O.framebufferWidth=O.drawingBufferWidth=t[2]=e[2]=v.drawingBufferWidth,O.viewportHeight=O.framebufferHeight=O.drawingBufferHeight=t[3]=e[3]=v.drawingBufferHeight}function f(){O.tick+=1,O.time=g(),c(),X.procs.poll()}function d(){c(),X.procs.refresh(),w&&w.update()}function g(){return(q()-A)/1e3}if(!(t=a(t)))return null;var v=t.gl,m=v.getContextAttributes();v.isContextLost();var y=function(t,e){function r(e){var r;e=e.toLowerCase();try{r=n[e]=t.getExtension(e)}catch(t){}return!!r}for(var n={},a=0;ae;++e)et(U({framebuffer:t.framebuffer.faces[e]},t),l);else et(t,l);else l(0,t)},prop:H.define.bind(null,1),context:H.define.bind(null,2),this:H.define.bind(null,3),draw:s({}),buffer:function(t){return R.create(t,34962,!1,!1)},elements:function(t){return P.create(t,!1)},texture:z.create2D,cube:z.createCube,renderbuffer:N.create,framebuffer:V.create,framebufferCube:V.createCube,vao:I.createVAO,attributes:m,frame:u,on:function(t,e){var r;switch(t){case"frame":return u(e);case"lost":r=Q;break;case"restore":r=$;break;case"destroy":r=K}return r.push(e),{cancel:function(){for(var t=0;t * * Copyright (c) 2014-2015, Jon Schlinkert. * Licensed under the MIT License. */ "use strict";var n,a="";e.exports=function(t,e){if("string"!=typeof t)throw new TypeError("expected a string");if(1===e)return t;if(2===e)return t+t;var r=t.length*e;if(n!==t||"undefined"==typeof n)n=t,a="";else if(a.length>=r)return a.substr(0,r);for(;r>a.length&&e>1;)1&e&&(a+=t),e>>=1,t+=t;return a=(a+=t).substr(0,r)}},{}],299:[function(t,e,r){"use strict";var n=t("two-product"),a=t("robust-sum"),i=t("robust-subtract"),o=t("robust-scale");function s(t,e){for(var r=new Array(t.length-1),n=1;n>1;return["sum(",l(t.slice(0,e)),",",l(t.slice(e)),")"].join("")}function u(t,e){if("m"===t.charAt(0)){if("w"===e.charAt(0)){var r=t.split("[");return["w",e.substr(1),"m",r[0].substr(1)].join("")}return["prod(",t,",",e,")"].join("")}return u(e,t)}function c(t){if(2===t.length)return[["diff(",u(t[0][0],t[1][1]),",",u(t[1][0],t[0][1]),")"].join("")];for(var e=[],r=0;r>1;return["sum(",l(t.slice(0,e)),",",l(t.slice(e)),")"].join("")}function u(t){if(2===t.length)return[["sum(prod(",t[0][0],",",t[1][1],"),prod(-",t[0][1],",",t[1][0],"))"].join("")];for(var e=[],r=0;r0){if(i<=0)return o;n=a+i}else{if(!(a<0))return o;if(i>=0)return o;n=-(a+i)}var s=33306690738754716e-32*n;return o>=s||o<=-s?o:f(t,e,r)},function(t,e,r,n){var a=t[0]-n[0],i=e[0]-n[0],o=r[0]-n[0],s=t[1]-n[1],l=e[1]-n[1],u=r[1]-n[1],c=t[2]-n[2],f=e[2]-n[2],h=r[2]-n[2],p=i*u,g=o*l,v=o*s,m=a*u,y=a*l,b=i*s,x=c*(p-g)+f*(v-m)+h*(y-b),_=7771561172376103e-31*((Math.abs(p)+Math.abs(g))*Math.abs(c)+(Math.abs(v)+Math.abs(m))*Math.abs(f)+(Math.abs(y)+Math.abs(b))*Math.abs(h));return x>_||-x>_?x:d(t,e,r,n)}];function p(t){var e=h[t.length];return e||(e=h[t.length]=c(t.length)),e.apply(void 0,t)}!function(){for(;h.length<=5;)h.push(c(h.length));for(var t=[],r=["slow"],n=0;n<=5;++n)t.push("a"+n),r.push("o"+n);var a=["function getOrientation(",t.join(),"){switch(arguments.length){case 0:case 1:return 0;"];for(n=2;n<=5;++n)a.push("case ",n,":return o",n,"(",t.slice(0,n).join(),");");a.push("}var s=new Array(arguments.length);for(var i=0;i0&&o>0||i<0&&o<0)return!1;var s=n(r,t,e),l=n(a,t,e);if(s>0&&l>0||s<0&&l<0)return!1;if(0===i&&0===o&&0===s&&0===l)return function(t,e,r,n){for(var a=0;a<2;++a){var i=t[a],o=e[a],s=Math.min(i,o),l=Math.max(i,o),u=r[a],c=n[a],f=Math.min(u,c);if(Math.max(u,c)=n?(a=f,(l+=1)=n?(a=f,(l+=1)0?1:0}},{}],307:[function(t,e,r){arguments[4][40][0].apply(r,arguments)},{dup:40}],308:[function(t,e,r){"use strict";var n=t("bit-twiddle"),a=t("union-find");function i(t,e){var r=t.length,n=t.length-e.length,a=Math.min;if(n)return n;switch(r){case 0:return 0;case 1:return t[0]-e[0];case 2:return(s=t[0]+t[1]-e[0]-e[1])||a(t[0],t[1])-a(e[0],e[1]);case 3:var i=t[0]+t[1],o=e[0]+e[1];if(s=i+t[2]-(o+e[2]))return s;var s,l=a(t[0],t[1]),u=a(e[0],e[1]);return(s=a(l,t[2])-a(u,e[2]))||a(l+t[2],i)-a(u+e[2],o);default:var c=t.slice(0);c.sort();var f=e.slice(0);f.sort();for(var d=0;d>1,s=i(t[o],e);s<=0?(0===s&&(a=o),r=o+1):s>0&&(n=o-1)}return a}function c(t,e){for(var r=new Array(t.length),a=0,o=r.length;a=t.length||0!==i(t[v],s)););}return r}function f(t,e){if(e<0)return[];for(var r=[],a=(1<>>c&1&&u.push(a[c]);e.push(u)}return s(e)},r.skeleton=f,r.boundary=function(t){for(var e=[],r=0,n=t.length;r>1:(t>>1)-1}function b(t){for(var e=m(t);;){var r=e,n=2*t+1,a=2*(t+1),i=t;if(n0;){var r=y(t);if(r>=0)if(e0){var t=T[0];return v(0,M-1),M-=1,b(0),t}return-1}function w(t,e){var r=T[t];return u[r]===e?t:(u[r]=-1/0,x(t),_(),u[r]=e,x((M+=1)-1))}function A(t){if(!c[t]){c[t]=!0;var e=s[t],r=l[t];s[r]>=0&&(s[r]=e),l[e]>=0&&(l[e]=r),k[e]>=0&&w(k[e],g(e)),k[r]>=0&&w(k[r],g(r))}}var T=[],k=new Array(i);for(f=0;f>1;f>=0;--f)b(f);for(;;){var E=_();if(E<0||u[E]>r)break;A(E)}var S=[];for(f=0;f=0&&r>=0&&e!==r){var n=k[e],a=k[r];n!==a&&L.push([n,a])}})),a.unique(a.normalize(L)),{positions:S,edges:L}};var n=t("robust-orientation"),a=t("simplicial-complex")},{"robust-orientation":300,"simplicial-complex":308}],311:[function(t,e,r){"use strict";e.exports=function(t,e){var r,i,o,s;if(e[0][0]e[1][0]))return a(e,t);r=e[1],i=e[0]}if(t[0][0]t[1][0]))return-a(t,e);o=t[1],s=t[0]}var l=n(r,i,s),u=n(r,i,o);if(l<0){if(u<=0)return l}else if(l>0){if(u>=0)return l}else if(u)return u;if(l=n(s,o,i),u=n(s,o,r),l<0){if(u<=0)return l}else if(l>0){if(u>=0)return l}else if(u)return u;return i[0]-s[0]};var n=t("robust-orientation");function a(t,e){var r,a,i,o;if(e[0][0]e[1][0])){var s=Math.min(t[0][1],t[1][1]),l=Math.max(t[0][1],t[1][1]),u=Math.min(e[0][1],e[1][1]),c=Math.max(e[0][1],e[1][1]);return lc?s-c:l-c}r=e[1],a=e[0]}t[0][1]0)if(e[0]!==o[1][0])r=t,t=t.right;else{if(l=u(t.right,e))return l;t=t.left}else{if(e[0]!==o[1][0])return t;var l;if(l=u(t.right,e))return l;t=t.left}}return r}function c(t,e,r,n){this.y=t,this.index=e,this.start=r,this.closed=n}function f(t,e,r,n){this.x=t,this.segment=e,this.create=r,this.index=n}s.prototype.castUp=function(t){var e=n.le(this.coordinates,t[0]);if(e<0)return-1;this.slabs[e];var r=u(this.slabs[e],t),a=-1;if(r&&(a=r.value),this.coordinates[e]===t[0]){var s=null;if(r&&(s=r.key),e>0){var c=u(this.slabs[e-1],t);c&&(s?o(c.key,s)>0&&(s=c.key,a=c.value):(a=c.value,s=c.key))}var f=this.horizontal[e];if(f.length>0){var d=n.ge(f,t[1],l);if(d=f.length)return a;h=f[d]}}if(h.start)if(s){var p=i(s[0],s[1],[t[0],h.y]);s[0][0]>s[1][0]&&(p=-p),p>0&&(a=h.index)}else a=h.index;else h.y!==t[1]&&(a=h.index)}}}return a}},{"./lib/order-segments":311,"binary-search-bounds":312,"functional-red-black-tree":159,"robust-orientation":300}],314:[function(t,e,r){!function(){"use strict";var t={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[+-]/};function e(t){return a(o(t),arguments)}function n(t,r){return e.apply(null,[t].concat(r||[]))}function a(r,n){var a,i,o,s,l,u,c,f,d,h=1,p=r.length,g="";for(i=0;i=0),s.type){case"b":a=parseInt(a,10).toString(2);break;case"c":a=String.fromCharCode(parseInt(a,10));break;case"d":case"i":a=parseInt(a,10);break;case"j":a=JSON.stringify(a,null,s.width?parseInt(s.width):0);break;case"e":a=s.precision?parseFloat(a).toExponential(s.precision):parseFloat(a).toExponential();break;case"f":a=s.precision?parseFloat(a).toFixed(s.precision):parseFloat(a);break;case"g":a=s.precision?String(Number(a.toPrecision(s.precision))):parseFloat(a);break;case"o":a=(parseInt(a,10)>>>0).toString(8);break;case"s":a=String(a),a=s.precision?a.substring(0,s.precision):a;break;case"t":a=String(!!a),a=s.precision?a.substring(0,s.precision):a;break;case"T":a=Object.prototype.toString.call(a).slice(8,-1).toLowerCase(),a=s.precision?a.substring(0,s.precision):a;break;case"u":a=parseInt(a,10)>>>0;break;case"v":a=a.valueOf(),a=s.precision?a.substring(0,s.precision):a;break;case"x":a=(parseInt(a,10)>>>0).toString(16);break;case"X":a=(parseInt(a,10)>>>0).toString(16).toUpperCase()}t.json.test(s.type)?g+=a:(!t.number.test(s.type)||f&&!s.sign?d="":(d=f?"+":"-",a=a.toString().replace(t.sign,"")),u=s.pad_char?"0"===s.pad_char?"0":s.pad_char.charAt(1):" ",c=s.width-(d+a).length,l=s.width&&c>0?u.repeat(c):"",g+=s.align?d+a+l:"0"===u?d+l+a:l+d+a)}return g}var i=Object.create(null);function o(e){if(i[e])return i[e];for(var r,n=e,a=[],o=0;n;){if(null!==(r=t.text.exec(n)))a.push(r[0]);else if(null!==(r=t.modulo.exec(n)))a.push("%");else{if(null===(r=t.placeholder.exec(n)))throw new SyntaxError("[sprintf] unexpected placeholder");if(r[2]){o|=1;var s=[],l=r[2],u=[];if(null===(u=t.key.exec(l)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(s.push(u[1]);""!==(l=l.substring(u[0].length));)if(null!==(u=t.key_access.exec(l)))s.push(u[1]);else{if(null===(u=t.index_access.exec(l)))throw new SyntaxError("[sprintf] failed to parse named argument key");s.push(u[1])}r[2]=s}else o|=2;if(3===o)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");a.push({placeholder:r[0],param_no:r[1],keys:r[2],sign:r[3],pad_char:r[4],align:r[5],width:r[6],precision:r[7],type:r[8]})}n=n.substring(r[0].length)}return i[e]=a}"undefined"!=typeof r&&(r.sprintf=e,r.vsprintf=n),"undefined"!=typeof window&&(window.sprintf=e,window.vsprintf=n)}()},{}],315:[function(t,e,r){"use strict";var n=t("parenthesis");e.exports=function(t,e,r){if(null==t)throw Error("First argument should be a string");if(null==e)throw Error("Separator should be a string or a RegExp");r?("string"==typeof r||Array.isArray(r))&&(r={ignore:r}):r={},null==r.escape&&(r.escape=!0),null==r.ignore?r.ignore=["[]","()","{}","<>",'""',"''","``","\u201c\u201d","\xab\xbb"]:("string"==typeof r.ignore&&(r.ignore=[r.ignore]),r.ignore=r.ignore.map((function(t){return 1===t.length&&(t+=t),t})));var a=n.parse(t,{flat:!0,brackets:r.ignore}),i=a[0].split(e);if(r.escape){for(var o=[],s=0;s c)|0 },"),"generic"===e&&i.push("getters:[0],");for(var s=[],l=[],u=0;u>>7){");for(u=0;u<1<<(1<128&&u%128==0){f.length>0&&d.push("}}");var h="vExtra"+f.length;i.push("case ",u>>>7,":",h,"(m&0x7f,",l.join(),");break;"),d=["function ",h,"(m,",l.join(),"){switch(m){"],f.push(d)}d.push("case ",127&u,":");for(var p=new Array(r),g=new Array(r),v=new Array(r),m=new Array(r),y=0,b=0;bb)&&!(u&1<<_)!=!(u&1<0&&(k="+"+v[x]+"*c");var M=p[x].length/y*.5,E=.5+m[x]/y*.5;T.push("d"+x+"-"+E+"-"+M+"*("+p[x].join("+")+k+")/("+g[x].join("+")+")")}d.push("a.push([",T.join(),"]);","break;")}i.push("}},"),f.length>0&&d.push("}}");var S=[];for(u=0;u<1<1&&(a=1),a<-1&&(a=-1),(t*n-e*r<0?-1:1)*Math.acos(a)};r.default=function(t){var e=t.px,r=t.py,l=t.cx,u=t.cy,c=t.rx,f=t.ry,d=t.xAxisRotation,h=void 0===d?0:d,p=t.largeArcFlag,g=void 0===p?0:p,v=t.sweepFlag,m=void 0===v?0:v,y=[];if(0===c||0===f)return[];var b=Math.sin(h*a/360),x=Math.cos(h*a/360),_=x*(e-l)/2+b*(r-u)/2,w=-b*(e-l)/2+x*(r-u)/2;if(0===_&&0===w)return[];c=Math.abs(c),f=Math.abs(f);var A=Math.pow(_,2)/Math.pow(c,2)+Math.pow(w,2)/Math.pow(f,2);A>1&&(c*=Math.sqrt(A),f*=Math.sqrt(A));var T=function(t,e,r,n,i,o,l,u,c,f,d,h){var p=Math.pow(i,2),g=Math.pow(o,2),v=Math.pow(d,2),m=Math.pow(h,2),y=p*g-p*m-g*v;y<0&&(y=0),y/=p*m+g*v;var b=(y=Math.sqrt(y)*(l===u?-1:1))*i/o*h,x=y*-o/i*d,_=f*b-c*x+(t+r)/2,w=c*b+f*x+(e+n)/2,A=(d-b)/i,T=(h-x)/o,k=(-d-b)/i,M=(-h-x)/o,E=s(1,0,A,T),S=s(A,T,k,M);return 0===u&&S>0&&(S-=a),1===u&&S<0&&(S+=a),[_,w,E,S]}(e,r,l,u,c,f,g,m,b,x,_,w),k=n(T,4),M=k[0],E=k[1],S=k[2],C=k[3],L=Math.abs(C)/(a/4);Math.abs(1-L)<1e-7&&(L=1);var O=Math.max(Math.ceil(L),1);C/=O;for(var D=0;De[2]&&(e[2]=u[c+0]),u[c+1]>e[3]&&(e[3]=u[c+1]);return e}},{"abs-svg-path":12,assert:17,"is-svg-path":251,"normalize-svg-path":319,"parse-svg-path":266}],319:[function(t,e,r){"use strict";e.exports=function(t){for(var e,r=[],o=0,s=0,l=0,u=0,c=null,f=null,d=0,h=0,p=0,g=t.length;p4?(o=v[v.length-4],s=v[v.length-3]):(o=d,s=h),r.push(v)}return r};var n=t("svg-arc-to-cubic-bezier");function a(t,e,r,n){return["C",t,e,r,n,r,n]}function i(t,e,r,n,a,i){return["C",t/3+2/3*r,e/3+2/3*n,a/3+2/3*r,i/3+2/3*n,a,i]}},{"svg-arc-to-cubic-bezier":317}],320:[function(t,e,r){"use strict";var n,a=t("svg-path-bounds"),i=t("parse-svg-path"),o=t("draw-svg-path"),s=t("is-svg-path"),l=t("bitmap-sdf"),u=document.createElement("canvas"),c=u.getContext("2d");e.exports=function(t,e){if(!s(t))throw Error("Argument should be valid svg path string");e||(e={});var r,f;e.shape?(r=e.shape[0],f=e.shape[1]):(r=u.width=e.w||e.width||200,f=u.height=e.h||e.height||200);var d=Math.min(r,f),h=e.stroke||0,p=e.viewbox||e.viewBox||a(t),g=[r/(p[2]-p[0]),f/(p[3]-p[1])],v=Math.min(g[0]||0,g[1]||0)/2;c.fillStyle="black",c.fillRect(0,0,r,f),c.fillStyle="white",h&&("number"!=typeof h&&(h=1),c.strokeStyle=h>0?"white":"black",c.lineWidth=Math.abs(h));if(c.translate(.5*r,.5*f),c.scale(v,v),function(){if(null!=n)return n;var t=document.createElement("canvas").getContext("2d");if(t.canvas.width=t.canvas.height=1,!window.Path2D)return n=!1;var e=new Path2D("M0,0h1v1h-1v-1Z");t.fillStyle="black",t.fill(e);var r=t.getImageData(0,0,1,1);return n=r&&r.data&&255===r.data[3]}()){var m=new Path2D(t);c.fill(m),h&&c.stroke(m)}else{var y=i(t);o(c,y),c.fill(),h&&c.stroke()}return c.setTransform(1,0,0,1,0,0),l(c,{cutoff:null!=e.cutoff?e.cutoff:.5,radius:null!=e.radius?e.radius:.5*d})}},{"bitmap-sdf":41,"draw-svg-path":90,"is-svg-path":251,"parse-svg-path":266,"svg-path-bounds":318}],321:[function(t,e,r){(function(r){(function(){"use strict";e.exports=function t(e,r,a){a=a||{};var o=i[e];o||(o=i[e]={" ":{data:new Float32Array(0),shape:.2}});var s=o[r];if(!s)if(r.length<=1||!/\d/.test(r))s=o[r]=function(t){for(var e=t.cells,r=t.positions,n=new Float32Array(6*e.length),a=0,i=0,o=0;o0&&(f+=.02);var h=new Float32Array(c),p=0,g=-.5*f;for(d=0;d1&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}if(t=L(t,360),e=L(e,100),r=L(r,100),0===e)n=a=i=r;else{var s=r<.5?r*(1+e):r+e-r*e,l=2*r-s;n=o(l,s,t+1/3),a=o(l,s,t),i=o(l,s,t-1/3)}return{r:255*n,g:255*a,b:255*i}}(e.h,l,c),f=!0,d="hsl"),e.hasOwnProperty("a")&&(i=e.a));var h,p,g;return i=C(i),{ok:f,format:e.format||d,r:o(255,s(a.r,0)),g:o(255,s(a.g,0)),b:o(255,s(a.b,0)),a:i}}(e);this._originalInput=e,this._r=c.r,this._g=c.g,this._b=c.b,this._a=c.a,this._roundA=i(100*this._a)/100,this._format=l.format||c.format,this._gradientType=l.gradientType,this._r<1&&(this._r=i(this._r)),this._g<1&&(this._g=i(this._g)),this._b<1&&(this._b=i(this._b)),this._ok=c.ok,this._tc_id=a++}function c(t,e,r){t=L(t,255),e=L(e,255),r=L(r,255);var n,a,i=s(t,e,r),l=o(t,e,r),u=(i+l)/2;if(i==l)n=a=0;else{var c=i-l;switch(a=u>.5?c/(2-i-l):c/(i+l),i){case t:n=(e-r)/c+(e>1)+720)%360;--e;)n.h=(n.h+a)%360,i.push(u(n));return i}function M(t,e){e=e||6;for(var r=u(t).toHsv(),n=r.h,a=r.s,i=r.v,o=[],s=1/e;e--;)o.push(u({h:n,s:a,v:i})),i=(i+s)%1;return o}u.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(299*t.r+587*t.g+114*t.b)/1e3},getLuminance:function(){var e,r,n,a=this.toRgb();return e=a.r/255,r=a.g/255,n=a.b/255,.2126*(e<=.03928?e/12.92:t.pow((e+.055)/1.055,2.4))+.7152*(r<=.03928?r/12.92:t.pow((r+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:t.pow((n+.055)/1.055,2.4))},setAlpha:function(t){return this._a=C(t),this._roundA=i(100*this._a)/100,this},toHsv:function(){var t=f(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=f(this._r,this._g,this._b),e=i(360*t.h),r=i(100*t.s),n=i(100*t.v);return 1==this._a?"hsv("+e+", "+r+"%, "+n+"%)":"hsva("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var t=c(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=c(this._r,this._g,this._b),e=i(360*t.h),r=i(100*t.s),n=i(100*t.l);return 1==this._a?"hsl("+e+", "+r+"%, "+n+"%)":"hsla("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(t){return d(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return function(t,e,r,n,a){var o=[R(i(t).toString(16)),R(i(e).toString(16)),R(i(r).toString(16)),R(P(n))];if(a&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)&&o[3].charAt(0)==o[3].charAt(1))return o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0);return o.join("")}(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:i(this._r),g:i(this._g),b:i(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+i(this._r)+", "+i(this._g)+", "+i(this._b)+")":"rgba("+i(this._r)+", "+i(this._g)+", "+i(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:i(100*L(this._r,255))+"%",g:i(100*L(this._g,255))+"%",b:i(100*L(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+i(100*L(this._r,255))+"%, "+i(100*L(this._g,255))+"%, "+i(100*L(this._b,255))+"%)":"rgba("+i(100*L(this._r,255))+"%, "+i(100*L(this._g,255))+"%, "+i(100*L(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(S[d(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e="#"+h(this._r,this._g,this._b,this._a),r=e,n=this._gradientType?"GradientType = 1, ":"";if(t){var a=u(t);r="#"+h(a._r,a._g,a._b,a._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+e+",endColorstr="+r+")"},toString:function(t){var e=!!t;t=t||this._format;var r=!1,n=this._a<1&&this._a>=0;return e||!n||"hex"!==t&&"hex6"!==t&&"hex3"!==t&&"hex4"!==t&&"hex8"!==t&&"name"!==t?("rgb"===t&&(r=this.toRgbString()),"prgb"===t&&(r=this.toPercentageRgbString()),"hex"!==t&&"hex6"!==t||(r=this.toHexString()),"hex3"===t&&(r=this.toHexString(!0)),"hex4"===t&&(r=this.toHex8String(!0)),"hex8"===t&&(r=this.toHex8String()),"name"===t&&(r=this.toName()),"hsl"===t&&(r=this.toHslString()),"hsv"===t&&(r=this.toHsvString()),r||this.toHexString()):"name"===t&&0===this._a?this.toName():this.toRgbString()},clone:function(){return u(this.toString())},_applyModification:function(t,e){var r=t.apply(null,[this].concat([].slice.call(e)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(m,arguments)},brighten:function(){return this._applyModification(y,arguments)},darken:function(){return this._applyModification(b,arguments)},desaturate:function(){return this._applyModification(p,arguments)},saturate:function(){return this._applyModification(g,arguments)},greyscale:function(){return this._applyModification(v,arguments)},spin:function(){return this._applyModification(x,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(k,arguments)},complement:function(){return this._applyCombination(_,arguments)},monochromatic:function(){return this._applyCombination(M,arguments)},splitcomplement:function(){return this._applyCombination(T,arguments)},triad:function(){return this._applyCombination(w,arguments)},tetrad:function(){return this._applyCombination(A,arguments)}},u.fromRatio=function(t,e){if("object"==typeof t){var r={};for(var n in t)t.hasOwnProperty(n)&&(r[n]="a"===n?t[n]:I(t[n]));t=r}return u(t,e)},u.equals=function(t,e){return!(!t||!e)&&u(t).toRgbString()==u(e).toRgbString()},u.random=function(){return u.fromRatio({r:l(),g:l(),b:l()})},u.mix=function(t,e,r){r=0===r?0:r||50;var n=u(t).toRgb(),a=u(e).toRgb(),i=r/100;return u({r:(a.r-n.r)*i+n.r,g:(a.g-n.g)*i+n.g,b:(a.b-n.b)*i+n.b,a:(a.a-n.a)*i+n.a})},u.readability=function(e,r){var n=u(e),a=u(r);return(t.max(n.getLuminance(),a.getLuminance())+.05)/(t.min(n.getLuminance(),a.getLuminance())+.05)},u.isReadable=function(t,e,r){var n,a,i=u.readability(t,e);switch(a=!1,(n=function(t){var e,r;e=((t=t||{level:"AA",size:"small"}).level||"AA").toUpperCase(),r=(t.size||"small").toLowerCase(),"AA"!==e&&"AAA"!==e&&(e="AA");"small"!==r&&"large"!==r&&(r="small");return{level:e,size:r}}(r)).level+n.size){case"AAsmall":case"AAAlarge":a=i>=4.5;break;case"AAlarge":a=i>=3;break;case"AAAsmall":a=i>=7}return a},u.mostReadable=function(t,e,r){var n,a,i,o,s=null,l=0;a=(r=r||{}).includeFallbackColors,i=r.level,o=r.size;for(var c=0;cl&&(l=n,s=u(e[c]));return u.isReadable(t,s,{level:i,size:o})||!a?s:(r.includeFallbackColors=!1,u.mostReadable(t,["#fff","#000"],r))};var E=u.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},S=u.hexNames=function(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[t[r]]=r);return e}(E);function C(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function L(e,r){(function(t){return"string"==typeof t&&-1!=t.indexOf(".")&&1===parseFloat(t)})(e)&&(e="100%");var n=function(t){return"string"==typeof t&&-1!=t.indexOf("%")}(e);return e=o(r,s(0,parseFloat(e))),n&&(e=parseInt(e*r,10)/100),t.abs(e-r)<1e-6?1:e%r/parseFloat(r)}function O(t){return o(1,s(0,t))}function D(t){return parseInt(t,16)}function R(t){return 1==t.length?"0"+t:""+t}function I(t){return t<=1&&(t=100*t+"%"),t}function P(e){return t.round(255*parseFloat(e)).toString(16)}function F(t){return D(t)/255}var z,N,B,j=(N="[\\s|\\(]+("+(z="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+z+")[,|\\s]+("+z+")\\s*\\)?",B="[\\s|\\(]+("+z+")[,|\\s]+("+z+")[,|\\s]+("+z+")[,|\\s]+("+z+")\\s*\\)?",{CSS_UNIT:new RegExp(z),rgb:new RegExp("rgb"+N),rgba:new RegExp("rgba"+B),hsl:new RegExp("hsl"+N),hsla:new RegExp("hsla"+B),hsv:new RegExp("hsv"+N),hsva:new RegExp("hsva"+B),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function U(t){return!!j.CSS_UNIT.exec(t)}"undefined"!=typeof e&&e.exports?e.exports=u:window.tinycolor=u}(Math)},{}],323:[function(t,e,r){"use strict";e.exports=a,e.exports.float32=e.exports.float=a,e.exports.fract32=e.exports.fract=function(t){if(t.length){for(var e=a(t),r=0,n=e.length;r":(e.length>100&&(e=e.slice(0,99)+"\u2026"),e=e.replace(a,(function(t){switch(t){case"\n":return"\\n";case"\r":return"\\r";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";default:throw new Error("Unexpected character")}})))}},{"./safe-to-string":330}],332:[function(t,e,r){"use strict";var n=t("../value/is"),a={object:!0,function:!0,undefined:!0};e.exports=function(t){return!!n(t)&&hasOwnProperty.call(a,typeof t)}},{"../value/is":338}],333:[function(t,e,r){"use strict";var n=t("../lib/resolve-exception"),a=t("./is");e.exports=function(t){return a(t)?t:n(t,"%v is not a plain function",arguments[1])}},{"../lib/resolve-exception":329,"./is":334}],334:[function(t,e,r){"use strict";var n=t("../function/is"),a=/^\s*class[\s{/}]/,i=Function.prototype.toString;e.exports=function(t){return!!n(t)&&!a.test(i.call(t))}},{"../function/is":328}],335:[function(t,e,r){"use strict";var n=t("../object/is");e.exports=function(t){if(!n(t))return!1;try{return!!t.constructor&&t.constructor.prototype===t}catch(t){return!1}}},{"../object/is":332}],336:[function(t,e,r){"use strict";var n=t("../value/is"),a=t("../object/is"),i=Object.prototype.toString;e.exports=function(t){if(!n(t))return null;if(a(t)){var e=t.toString;if("function"!=typeof e)return null;if(e===i)return null}try{return""+t}catch(t){return null}}},{"../object/is":332,"../value/is":338}],337:[function(t,e,r){"use strict";var n=t("../lib/resolve-exception"),a=t("./is");e.exports=function(t){return a(t)?t:n(t,"Cannot use %v",arguments[1])}},{"../lib/resolve-exception":329,"./is":338}],338:[function(t,e,r){"use strict";e.exports=function(t){return null!=t}},{}],339:[function(t,e,r){(function(e){(function(){"use strict";var n=t("bit-twiddle"),a=t("dup"),i=t("buffer").Buffer;e.__TYPEDARRAY_POOL||(e.__TYPEDARRAY_POOL={UINT8:a([32,0]),UINT16:a([32,0]),UINT32:a([32,0]),BIGUINT64:a([32,0]),INT8:a([32,0]),INT16:a([32,0]),INT32:a([32,0]),BIGINT64:a([32,0]),FLOAT:a([32,0]),DOUBLE:a([32,0]),DATA:a([32,0]),UINT8C:a([32,0]),BUFFER:a([32,0])});var o="undefined"!=typeof Uint8ClampedArray,s="undefined"!=typeof BigUint64Array,l="undefined"!=typeof BigInt64Array,u=e.__TYPEDARRAY_POOL;u.UINT8C||(u.UINT8C=a([32,0])),u.BIGUINT64||(u.BIGUINT64=a([32,0])),u.BIGINT64||(u.BIGINT64=a([32,0])),u.BUFFER||(u.BUFFER=a([32,0]));var c=u.DATA,f=u.BUFFER;function d(t){if(t){var e=t.length||t.byteLength,r=n.log2(e);c[r].push(t)}}function h(t){t=n.nextPow2(t);var e=n.log2(t),r=c[e];return r.length>0?r.pop():new ArrayBuffer(t)}function p(t){return new Uint8Array(h(t),0,t)}function g(t){return new Uint16Array(h(2*t),0,t)}function v(t){return new Uint32Array(h(4*t),0,t)}function m(t){return new Int8Array(h(t),0,t)}function y(t){return new Int16Array(h(2*t),0,t)}function b(t){return new Int32Array(h(4*t),0,t)}function x(t){return new Float32Array(h(4*t),0,t)}function _(t){return new Float64Array(h(8*t),0,t)}function w(t){return o?new Uint8ClampedArray(h(t),0,t):p(t)}function A(t){return s?new BigUint64Array(h(8*t),0,t):null}function T(t){return l?new BigInt64Array(h(8*t),0,t):null}function k(t){return new DataView(h(t),0,t)}function M(t){t=n.nextPow2(t);var e=n.log2(t),r=f[e];return r.length>0?r.pop():new i(t)}r.free=function(t){if(i.isBuffer(t))f[n.log2(t.length)].push(t);else{if("[object ArrayBuffer]"!==Object.prototype.toString.call(t)&&(t=t.buffer),!t)return;var e=t.length||t.byteLength,r=0|n.log2(e);c[r].push(t)}},r.freeUint8=r.freeUint16=r.freeUint32=r.freeBigUint64=r.freeInt8=r.freeInt16=r.freeInt32=r.freeBigInt64=r.freeFloat32=r.freeFloat=r.freeFloat64=r.freeDouble=r.freeUint8Clamped=r.freeDataView=function(t){d(t.buffer)},r.freeArrayBuffer=d,r.freeBuffer=function(t){f[n.log2(t.length)].push(t)},r.malloc=function(t,e){if(void 0===e||"arraybuffer"===e)return h(t);switch(e){case"uint8":return p(t);case"uint16":return g(t);case"uint32":return v(t);case"int8":return m(t);case"int16":return y(t);case"int32":return b(t);case"float":case"float32":return x(t);case"double":case"float64":return _(t);case"uint8_clamped":return w(t);case"bigint64":return T(t);case"biguint64":return A(t);case"buffer":return M(t);case"data":case"dataview":return k(t);default:return null}return null},r.mallocArrayBuffer=h,r.mallocUint8=p,r.mallocUint16=g,r.mallocUint32=v,r.mallocInt8=m,r.mallocInt16=y,r.mallocInt32=b,r.mallocFloat32=r.mallocFloat=x,r.mallocFloat64=r.mallocDouble=_,r.mallocUint8Clamped=w,r.mallocBigUint64=A,r.mallocBigInt64=T,r.mallocDataView=k,r.mallocBuffer=M,r.clearCache=function(){for(var t=0;t<32;++t)u.UINT8[t].length=0,u.UINT16[t].length=0,u.UINT32[t].length=0,u.INT8[t].length=0,u.INT16[t].length=0,u.INT32[t].length=0,u.FLOAT[t].length=0,u.DOUBLE[t].length=0,u.BIGUINT64[t].length=0,u.BIGINT64[t].length=0,u.UINT8C[t].length=0,c[t].length=0,f[t].length=0}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"bit-twiddle":40,buffer:52,dup:92}],340:[function(t,e,r){"use strict";function n(t){this.roots=new Array(t),this.ranks=new Array(t);for(var e=0;e0&&(i=n.size),n.lineSpacing&&n.lineSpacing>0&&(o=n.lineSpacing),n.styletags&&n.styletags.breaklines&&(s.breaklines=!!n.styletags.breaklines),n.styletags&&n.styletags.bolds&&(s.bolds=!!n.styletags.bolds),n.styletags&&n.styletags.italics&&(s.italics=!!n.styletags.italics),n.styletags&&n.styletags.subscripts&&(s.subscripts=!!n.styletags.subscripts),n.styletags&&n.styletags.superscripts&&(s.superscripts=!!n.styletags.superscripts));return r.font=[n.fontStyle,n.fontVariant,n.fontWeight,i+"px",n.font].filter((function(t){return t})).join(" "),r.textAlign="start",r.textBaseline="alphabetic",r.direction="ltr",d(function(t,e,r,n,i,o){r=r.replace(/\n/g,""),r=!0===o.breaklines?r.replace(/\/g,"\n"):r.replace(/\/g," ");var s="",l=[];for(h=0;h-1?parseInt(t[1+a]):0,l=i>-1?parseInt(r[1+i]):0;s!==l&&(n=n.replace(E(),"?px "),v*=Math.pow(.75,l-s),n=n.replace("?px ",E())),g+=.25*b*(l-s)}if(!0===o.superscripts){var u=t.indexOf("+"),c=r.indexOf("+"),f=u>-1?parseInt(t[1+u]):0,d=c>-1?parseInt(r[1+c]):0;f!==d&&(n=n.replace(E(),"?px "),v*=Math.pow(.75,d-f),n=n.replace("?px ",E())),g-=.25*b*(d-f)}if(!0===o.bolds){var h=t.indexOf("b|")>-1,p=r.indexOf("b|")>-1;!h&&p&&(n=m?n.replace("italic ","italic bold "):"bold "+n),h&&!p&&(n=n.replace("bold ",""))}if(!0===o.italics){var m=t.indexOf("i|")>-1,y=r.indexOf("i|")>-1;!m&&y&&(n="italic "+n),m&&!y&&(n=n.replace("italic ",""))}e.font=n}for(d=0;d",i="",o=a.length,s=i.length,l="+"===e[0]||"-"===e[0],u=0,c=-s;u>-1&&-1!==(u=r.indexOf(a,u))&&-1!==(c=r.indexOf(i,u+o))&&!(c<=u);){for(var f=u;f=c)n[f]=null,r=r.substr(0,f)+" "+r.substr(f+1);else if(null!==n[f]){var d=n[f].indexOf(e[0]);-1===d?n[f]+=e:l&&(n[f]=n[f].substr(0,d+1)+(1+parseInt(n[f][d+1]))+n[f].substr(d+2))}var h=u+o,p=r.substr(h,c-h).indexOf(a);u=-1!==p?p:c+s}return n}function c(t,e){var r=n(t,128);return e?i(r.cells,r.positions,.25):{edges:r.cells,positions:r.positions}}function f(t,e,r,n){var a=c(t,n),i=function(t,e,r){for(var n=e.textAlign||"start",a=e.textBaseline||"alphabetic",i=[1<<30,1<<30],o=[0,0],s=t.length,l=0;l= 0) !== (_inline_1_db >= 0)) {\n _inline_1_arg2_.push(_inline_1_arg4_[0] + 0.5 + 0.5 * (_inline_1_da + _inline_1_db) / (_inline_1_da - _inline_1_db))\n }\n }",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg3_",lvalue:!1,rvalue:!0,count:2},{name:"_inline_1_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:[],localVars:["_inline_1_da","_inline_1_db"]},funcName:"zeroCrossings"})},{"cwise-compiler":79}],351:[function(t,e,r){"use strict";e.exports=function(t,e){var r=[];return e=+e||0,n(t.hi(t.shape[0]-1),r,e),r};var n=t("./lib/zc-core")},{"./lib/zc-core":350}],352:[function(t,e,r){"use strict";e.exports=[{path:"",backoff:0},{path:"M-2.4,-3V3L0.6,0Z",backoff:.6},{path:"M-3.7,-2.5V2.5L1.3,0Z",backoff:1.3},{path:"M-4.45,-3L-1.65,-0.2V0.2L-4.45,3L1.55,0Z",backoff:1.55},{path:"M-2.2,-2.2L-0.2,-0.2V0.2L-2.2,2.2L-1.4,3L1.6,0L-1.4,-3Z",backoff:1.6},{path:"M-4.4,-2.1L-0.6,-0.2V0.2L-4.4,2.1L-4,3L2,0L-4,-3Z",backoff:2},{path:"M2,0A2,2 0 1,1 0,-2A2,2 0 0,1 2,0Z",backoff:0,noRotate:!0},{path:"M2,2V-2H-2V2Z",backoff:0,noRotate:!0}]},{}],353:[function(t,e,r){"use strict";var n=t("./arrow_paths"),a=t("../../plots/font_attributes"),i=t("../../plots/cartesian/constants"),o=t("../../plot_api/plot_template").templatedArray;t("../../constants/axis_placeable_objects");e.exports=o("annotation",{visible:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},text:{valType:"string",editType:"calc+arraydraw"},textangle:{valType:"angle",dflt:0,editType:"calc+arraydraw"},font:a({editType:"calc+arraydraw",colorEditType:"arraydraw"}),width:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},height:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},align:{valType:"enumerated",values:["left","center","right"],dflt:"center",editType:"arraydraw"},valign:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle",editType:"arraydraw"},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},bordercolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},borderpad:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},borderwidth:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},showarrow:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},arrowcolor:{valType:"color",editType:"arraydraw"},arrowhead:{valType:"integer",min:0,max:n.length,dflt:1,editType:"arraydraw"},startarrowhead:{valType:"integer",min:0,max:n.length,dflt:1,editType:"arraydraw"},arrowside:{valType:"flaglist",flags:["end","start"],extras:["none"],dflt:"end",editType:"arraydraw"},arrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},startarrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},arrowwidth:{valType:"number",min:.1,editType:"calc+arraydraw"},standoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},startstandoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},ax:{valType:"any",editType:"calc+arraydraw"},ay:{valType:"any",editType:"calc+arraydraw"},axref:{valType:"enumerated",dflt:"pixel",values:["pixel",i.idRegex.x.toString()],editType:"calc"},ayref:{valType:"enumerated",dflt:"pixel",values:["pixel",i.idRegex.y.toString()],editType:"calc"},xref:{valType:"enumerated",values:["paper",i.idRegex.x.toString()],editType:"calc"},x:{valType:"any",editType:"calc+arraydraw"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto",editType:"calc+arraydraw"},xshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},yref:{valType:"enumerated",values:["paper",i.idRegex.y.toString()],editType:"calc"},y:{valType:"any",editType:"calc+arraydraw"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto",editType:"calc+arraydraw"},yshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},clicktoshow:{valType:"enumerated",values:[!1,"onoff","onout"],dflt:!1,editType:"arraydraw"},xclick:{valType:"any",editType:"arraydraw"},yclick:{valType:"any",editType:"arraydraw"},hovertext:{valType:"string",editType:"arraydraw"},hoverlabel:{bgcolor:{valType:"color",editType:"arraydraw"},bordercolor:{valType:"color",editType:"arraydraw"},font:a({editType:"arraydraw"}),editType:"arraydraw"},captureevents:{valType:"boolean",editType:"arraydraw"},editType:"calc",_deprecated:{ref:{valType:"string",editType:"calc"}}})},{"../../constants/axis_placeable_objects":471,"../../plot_api/plot_template":536,"../../plots/cartesian/constants":553,"../../plots/font_attributes":575,"./arrow_paths":352}],354:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../plots/cartesian/axes"),i=t("./draw").draw;function o(t){var e=t._fullLayout;n.filterVisible(e.annotations).forEach((function(e){var r=a.getFromId(t,e.xref),n=a.getFromId(t,e.yref),i=a.getRefType(e.xref),o=a.getRefType(e.yref);e._extremes={},"range"===i&&s(e,r),"range"===o&&s(e,n)}))}function s(t,e){var r,n=e._id,i=n.charAt(0),o=t[i],s=t["a"+i],l=t[i+"ref"],u=t["a"+i+"ref"],c=t["_"+i+"padplus"],f=t["_"+i+"padminus"],d={x:1,y:-1}[i]*t[i+"shift"],h=3*t.arrowsize*t.arrowwidth||0,p=h+d,g=h-d,v=3*t.startarrowsize*t.arrowwidth||0,m=v+d,y=v-d;if(u===l){var b=a.findExtremes(e,[e.r2c(o)],{ppadplus:p,ppadminus:g}),x=a.findExtremes(e,[e.r2c(s)],{ppadplus:Math.max(c,m),ppadminus:Math.max(f,y)});r={min:[b.min[0],x.min[0]],max:[b.max[0],x.max[0]]}}else m=s?m+s:m,y=s?y-s:y,r=a.findExtremes(e,[e.r2c(o)],{ppadplus:Math.max(c,p,m),ppadminus:Math.max(f,g,y)});t._extremes[n]=r}e.exports=function(t){var e=t._fullLayout;if(n.filterVisible(e.annotations).length&&t._fullData.length)return n.syncOrAsync([i,o],t)}},{"../../lib":498,"../../plots/cartesian/axes":547,"./draw":359}],355:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../registry"),i=t("../../plot_api/plot_template").arrayEditor;function o(t,e){var r,n,a,i,o,l,u,c=t._fullLayout.annotations,f=[],d=[],h=[],p=(e||[]).length;for(r=0;r0||r.explicitOff.length>0},onClick:function(t,e){var r,s,l=o(t,e),u=l.on,c=l.off.concat(l.explicitOff),f={},d=t._fullLayout.annotations;if(!u.length&&!c.length)return;for(r=0;r2/3?"right":"center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[e]}for(var W=!1,Y=["x","y"],Z=0;Z1)&&(nt===rt?((ht=at.r2fraction(e["a"+et]))<0||ht>1)&&(W=!0):W=!0),J=at._offset+at.r2p(e[et]),K=.5}else{var pt="domain"===dt;"x"===et?($=e[et],J=pt?at._offset+at._length*$:J=A.l+A.w*$):($=1-e[et],J=pt?at._offset+at._length*$:J=A.t+A.h*$),K=e.showarrow?.5:$}if(e.showarrow){ft.head=J;var gt=e["a"+et];if(tt=ot*G(.5,e.xanchor)-st*G(.5,e.yanchor),nt===rt){var vt=l.getRefType(nt);"domain"===vt?("y"===et&&(gt=1-gt),ft.tail=at._offset+at._length*gt):"paper"===vt?"y"===et?(gt=1-gt,ft.tail=A.t+A.h*gt):ft.tail=A.l+A.w*gt:ft.tail=at._offset+at.r2p(gt),Q=tt}else ft.tail=J+gt,Q=tt+gt;ft.text=ft.tail+tt;var mt=w["x"===et?"width":"height"];if("paper"===rt&&(ft.head=o.constrain(ft.head,1,mt-1)),"pixel"===nt){var yt=-Math.max(ft.tail-3,ft.text),bt=Math.min(ft.tail+3,ft.text)-mt;yt>0?(ft.tail+=yt,ft.text+=yt):bt>0&&(ft.tail-=bt,ft.text-=bt)}ft.tail+=ct,ft.head+=ct}else Q=tt=lt*G(K,ut),ft.text=J+tt;ft.text+=ct,tt+=ct,Q+=ct,e["_"+et+"padplus"]=lt/2+Q,e["_"+et+"padminus"]=lt/2-Q,e["_"+et+"size"]=lt,e["_"+et+"shift"]=tt}if(W)F.remove();else{var xt=0,_t=0;if("left"!==e.align&&(xt=(k-x)*("center"===e.align?.5:1)),"top"!==e.valign&&(_t=(P-_)*("middle"===e.valign?.5:1)),f)n.select("svg").attr({x:B+xt-1,y:B+_t}).call(c.setClipUrl,U?C:null,t);else{var wt=B+_t-g.top,At=B+xt-g.left;q.call(d.positionText,At,wt).call(c.setClipUrl,U?C:null,t)}V.select("rect").call(c.setRect,B,B,k,P),j.call(c.setRect,z/2,z/2,N-z,H-z),F.call(c.setTranslate,Math.round(L.x.text-N/2),Math.round(L.y.text-H/2)),R.attr({transform:"rotate("+O+","+L.x.text+","+L.y.text+")"});var Tt,kt=function(r,n){D.selectAll(".annotation-arrow-g").remove();var l=L.x.head,f=L.y.head,d=L.x.tail+r,h=L.y.tail+n,g=L.x.text+r,x=L.y.text+n,_=o.rotationXYMatrix(O,g,x),w=o.apply2DTransform(_),k=o.apply2DTransform2(_),C=+j.attr("width"),I=+j.attr("height"),P=g-.5*C,z=P+C,N=x-.5*I,B=N+I,U=[[P,N,P,B],[P,B,z,B],[z,B,z,N],[z,N,P,N]].map(k);if(!U.reduce((function(t,e){return t^!!o.segmentsIntersect(l,f,l+1e6,f+1e6,e[0],e[1],e[2],e[3])}),!1)){U.forEach((function(t){var e=o.segmentsIntersect(d,h,l,f,t[0],t[1],t[2],t[3]);e&&(d=e.x,h=e.y)}));var V=e.arrowwidth,H=e.arrowcolor,G=e.arrowside,q=D.append("g").style({opacity:u.opacity(H)}).classed("annotation-arrow-g",!0),X=q.append("path").attr("d","M"+d+","+h+"L"+l+","+f).style("stroke-width",V+"px").call(u.stroke,u.rgb(H));if(v(X,G,e),T.annotationPosition&&X.node().parentNode&&!i){var W=l,Y=f;if(e.standoff){var Z=Math.sqrt(Math.pow(l-d,2)+Math.pow(f-h,2));W+=e.standoff*(d-l)/Z,Y+=e.standoff*(h-f)/Z}var J,Q,$=q.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).classed("cursor-move",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(d-W)+","+(h-Y),transform:s(W,Y)}).style("stroke-width",V+6+"px").call(u.stroke,"rgba(0,0,0,0)").call(u.fill,"rgba(0,0,0,0)");p.init({element:$.node(),gd:t,prepFn:function(){var t=c.getTranslate(F);J=t.x,Q=t.y,m&&m.autorange&&M(m._name+".autorange",!0),b&&b.autorange&&M(b._name+".autorange",!0)},moveFn:function(t,r){var n=w(J,Q),a=n[0]+t,i=n[1]+r;F.call(c.setTranslate,a,i),E("x",y(m,t,"x",A,e)),E("y",y(b,r,"y",A,e)),e.axref===e.xref&&E("ax",y(m,t,"ax",A,e)),e.ayref===e.yref&&E("ay",y(b,r,"ay",A,e)),q.attr("transform",s(t,r)),R.attr({transform:"rotate("+O+","+a+","+i+")"})},doneFn:function(){a.call("_guiRelayout",t,S());var e=document.querySelector(".js-notes-box-panel");e&&e.redraw(e.selectedObj)}})}}};if(e.showarrow&&kt(0,0),I)p.init({element:F.node(),gd:t,prepFn:function(){Tt=R.attr("transform")},moveFn:function(t,r){var n="pointer";if(e.showarrow)e.axref===e.xref?E("ax",y(m,t,"ax",A,e)):E("ax",e.ax+t),e.ayref===e.yref?E("ay",y(b,r,"ay",A.w,e)):E("ay",e.ay+r),kt(t,r);else{if(i)return;var a,o;if(m)a=y(m,t,"x",A,e);else{var l=e._xsize/A.w,u=e.x+(e._xshift-e.xshift)/A.w-l/2;a=p.align(u+t/A.w,l,0,1,e.xanchor)}if(b)o=y(b,r,"y",A,e);else{var c=e._ysize/A.h,f=e.y-(e._yshift+e.yshift)/A.h-c/2;o=p.align(f-r/A.h,c,0,1,e.yanchor)}E("x",a),E("y",o),m&&b||(n=p.getCursor(m?.5:a,b?.5:o,e.xanchor,e.yanchor))}R.attr({transform:s(t,r)+Tt}),h(F,n)},clickFn:function(r,n){e.captureevents&&t.emit("plotly_clickannotation",X(n))},doneFn:function(){h(F),a.call("_guiRelayout",t,S());var e=document.querySelector(".js-notes-box-panel");e&&e.redraw(e.selectedObj)}})}}}e.exports={draw:function(t){var e=t._fullLayout;e._infolayer.selectAll(".annotation").remove();for(var r=0;r=0,b=e.indexOf("end")>=0,x=p.backoff*v+r.standoff,_=g.backoff*m+r.startstandoff;if("line"===h.nodeName){o={x:+t.attr("x1"),y:+t.attr("y1")},c={x:+t.attr("x2"),y:+t.attr("y2")};var w=o.x-c.x,A=o.y-c.y;if(d=(f=Math.atan2(A,w))+Math.PI,x&&_&&x+_>Math.sqrt(w*w+A*A))return void I();if(x){if(x*x>w*w+A*A)return void I();var T=x*Math.cos(f),k=x*Math.sin(f);c.x+=T,c.y+=k,t.attr({x2:c.x,y2:c.y})}if(_){if(_*_>w*w+A*A)return void I();var M=_*Math.cos(f),E=_*Math.sin(f);o.x-=M,o.y-=E,t.attr({x1:o.x,y1:o.y})}}else if("path"===h.nodeName){var S=h.getTotalLength(),C="";if(S1){u=!0;break}}u?t.fullLayout._infolayer.select(".annotation-"+t.id+'[data-index="'+s+'"]').remove():(l._pdata=a(t.glplot.cameraParams,[e.xaxis.r2l(l.x)*r[0],e.yaxis.r2l(l.y)*r[1],e.zaxis.r2l(l.z)*r[2]]),n(t.graphDiv,l,s,t.id,l._xa,l._ya))}}},{"../../plots/gl3d/project":582,"../annotations/draw":359}],366:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../lib");e.exports={moduleType:"component",name:"annotations3d",schema:{subplots:{scene:{annotations:t("./attributes")}}},layoutAttributes:t("./attributes"),handleDefaults:t("./defaults"),includeBasePlot:function(t,e){var r=n.subplotsRegistry.gl3d;if(!r)return;for(var i=r.attrRegex,o=Object.keys(t),s=0;s=0))return t;if(3===o)n[o]>1&&(n[o]=1);else if(n[o]>=1)return t}var s=Math.round(255*n[0])+", "+Math.round(255*n[1])+", "+Math.round(255*n[2]);return i?"rgba("+s+", "+n[3]+")":"rgb("+s+")"}i.tinyRGB=function(t){var e=t.toRgb();return"rgb("+Math.round(e.r)+", "+Math.round(e.g)+", "+Math.round(e.b)+")"},i.rgb=function(t){return i.tinyRGB(n(t))},i.opacity=function(t){return t?n(t).getAlpha():0},i.addOpacity=function(t,e){var r=n(t).toRgb();return"rgba("+Math.round(r.r)+", "+Math.round(r.g)+", "+Math.round(r.b)+", "+e+")"},i.combine=function(t,e){var r=n(t).toRgb();if(1===r.a)return n(t).toRgbString();var a=n(e||l).toRgb(),i=1===a.a?a:{r:255*(1-a.a)+a.r*a.a,g:255*(1-a.a)+a.g*a.a,b:255*(1-a.a)+a.b*a.a},o={r:i.r*(1-r.a)+r.r*r.a,g:i.g*(1-r.a)+r.g*r.a,b:i.b*(1-r.a)+r.b*r.a};return n(o).toRgbString()},i.contrast=function(t,e,r){var a=n(t);return 1!==a.getAlpha()&&(a=n(i.combine(t,l))),(a.isDark()?e?a.lighten(e):l:r?a.darken(r):s).toString()},i.stroke=function(t,e){var r=n(e);t.style({stroke:i.tinyRGB(r),"stroke-opacity":r.getAlpha()})},i.fill=function(t,e){var r=n(e);t.style({fill:i.tinyRGB(r),"fill-opacity":r.getAlpha()})},i.clean=function(t){if(t&&"object"==typeof t){var e,r,n,a,o=Object.keys(t);for(e=0;e0?n>=l:n<=l));a++)n>c&&n0?n>=l:n<=l));a++)n>r[0]&&n1){var J=Math.pow(10,Math.floor(Math.log(Z)/Math.LN10));W*=J*u.roundUp(Z/J,[2,5,10]),(Math.abs(L.start)/L.size+1e-6)%1<2e-6&&(X.tick0=0)}X.dtick=W}X.domain=[H+j,H+z-j],X.setScale(),t.attr("transform",c(Math.round(l.l),Math.round(l.t)));var Q,$=t.select("."+k.cbtitleunshift).attr("transform",c(-Math.round(l.l),-Math.round(l.t))),K=t.select("."+k.cbaxis),tt=0;function et(n,a){var i={propContainer:X,propName:e._propPrefix+"title",traceIndex:e._traceIndex,_meta:e._meta,placeholder:o._dfltTitle.colorbar,containerGroup:t.select("."+k.cbtitle)},s="h"===n.charAt(0)?n.substr(1):"h"+n;t.selectAll("."+s+",."+s+"-math-group").remove(),g.draw(r,n,f(i,a||{}))}return u.syncOrAsync([i.previousPromises,function(){if(-1!==["top","bottom"].indexOf(M)){var t,r=l.l+(e.x+N)*l.w,n=X.title.font.size;t="top"===M?(1-(H+z-j))*l.h+l.t+3+.75*n:(1-(H+j))*l.h+l.t-3-.25*n,et(X._id+"title",{attributes:{x:r,y:t,"text-anchor":"start"}})}},function(){if(-1!==["top","bottom"].indexOf(M)){var i=t.select("."+k.cbtitle),o=i.select("text"),f=[-e.outlinewidth/2,e.outlinewidth/2],d=i.select(".h"+X._id+"title-math-group").node(),p=15.6;if(o.node()&&(p=parseInt(o.node().style.fontSize,10)*w),d?(tt=h.bBox(d).height)>p&&(f[1]-=(tt-p)/2):o.node()&&!o.classed(k.jsPlaceholder)&&(tt=h.bBox(o.node()).height),tt){if(tt+=5,"top"===M)X.domain[1]-=tt/l.h,f[1]*=-1;else{X.domain[0]+=tt/l.h;var g=v.lineCount(o);f[1]+=(1-g)*p}i.attr("transform",c(f[0],f[1])),X.setScale()}}t.selectAll("."+k.cbfills+",."+k.cblines).attr("transform",c(0,Math.round(l.h*(1-X.domain[1])))),K.attr("transform",c(0,Math.round(-l.t)));var y=t.select("."+k.cbfills).selectAll("rect."+k.cbfill).attr("style","").data(D);y.enter().append("rect").classed(k.cbfill,!0).style("stroke","none"),y.exit().remove();var b=E.map(X.c2p).map(Math.round).sort((function(t,e){return t-e}));y.each((function(t,i){var o=[0===i?E[0]:(D[i]+D[i-1])/2,i===D.length-1?E[1]:(D[i]+D[i+1])/2].map(X.c2p).map(Math.round);o[1]=u.constrain(o[1]+(o[1]>o[0])?1:-1,b[0],b[1]);var s=n.select(this).attr({x:U,width:Math.max(I,2),y:n.min(o),height:Math.max(n.max(o)-n.min(o),2)});if(e._fillgradient)h.gradient(s,r,e._id,"vertical",e._fillgradient,"fill");else{var l=C(t).replace("e-","");s.attr("fill",a(l).toHexString())}}));var x=t.select("."+k.cblines).selectAll("path."+k.cbline).data(m.color&&m.width?R:[]);x.enter().append("path").classed(k.cbline,!0),x.exit().remove(),x.each((function(t){n.select(this).attr("d","M"+U+","+(Math.round(X.c2p(t))+m.width/2%1)+"h"+I).call(h.lineGroupStyle,m.width,S(t),m.dash)})),K.selectAll("g."+X._id+"tick,path").remove();var _=U+I+(e.outlinewidth||0)/2-("outside"===e.ticks?1:0),A=s.calcTicks(X),T=s.getTickSigns(X)[2];return s.drawTicks(r,X,{vals:"inside"===X.ticks?s.clipEnds(X,A):A,layer:K,path:s.makeTickPath(X,_,T),transFn:s.makeTransTickFn(X)}),s.drawLabels(r,X,{vals:A,layer:K,transFn:s.makeTransTickLabelFn(X),labelFns:s.makeLabelFns(X,_)})},function(){if(-1===["top","bottom"].indexOf(M)){var t=X.title.font.size,e=X._offset+X._length/2,a=l.l+(X.position||0)*l.w+("right"===X.side?10+t*(X.showticklabels?1:.5):-10-t*(X.showticklabels?.5:0));et("h"+X._id+"title",{avoid:{selection:n.select(r).selectAll("g."+X._id+"tick"),side:M,offsetLeft:l.l,offsetTop:0,maxShift:o.width},attributes:{x:a,y:e,"text-anchor":"middle"},transform:{rotate:"-90",offset:0}})}},i.previousPromises,function(){var n=I+e.outlinewidth/2;if(-1===X.ticklabelposition.indexOf("inside")&&(n+=h.bBox(K.node()).width),(Q=$.select("text")).node()&&!Q.classed(k.jsPlaceholder)){var a,o=$.select(".h"+X._id+"title-math-group").node();a=o&&-1!==["top","bottom"].indexOf(M)?h.bBox(o).width:h.bBox($.node()).right-U-l.l,n=Math.max(n,a)}var s=2*e.xpad+n+e.borderwidth+e.outlinewidth/2,u=G-q;t.select("."+k.cbbg).attr({x:U-e.xpad-(e.borderwidth+e.outlinewidth)/2,y:q-B,width:Math.max(s,2),height:Math.max(u+2*B,2)}).call(p.fill,e.bgcolor).call(p.stroke,e.bordercolor).style("stroke-width",e.borderwidth),t.selectAll("."+k.cboutline).attr({x:U,y:q+e.ypad+("top"===M?tt:0),width:Math.max(I,2),height:Math.max(u-2*e.ypad-tt,2)}).call(p.stroke,e.outlinecolor).style({fill:"none","stroke-width":e.outlinewidth});var f=({center:.5,right:1}[e.xanchor]||0)*s;t.attr("transform",c(l.l-f,l.t));var d={},g=A[e.yanchor],v=T[e.yanchor];"pixels"===e.lenmode?(d.y=e.y,d.t=u*g,d.b=u*v):(d.t=d.b=0,d.yt=e.y+e.len*g,d.yb=e.y-e.len*v);var m=A[e.xanchor],y=T[e.xanchor];if("pixels"===e.thicknessmode)d.x=e.x,d.l=s*m,d.r=s*y;else{var b=s-I;d.l=b*m,d.r=b*y,d.xl=e.x-e.thickness*m,d.xr=e.x+e.thickness*y}i.autoMargin(r,e._id,d)}],r)}(r,e,t);m&&m.then&&(t._promises||[]).push(m),t._context.edits.colorbarPosition&&function(t,e,r){var n,a,i,s=r._fullLayout._size;l.init({element:t.node(),gd:r,prepFn:function(){n=t.attr("transform"),d(t)},moveFn:function(r,o){t.attr("transform",n+c(r,o)),a=l.align(e._xLeftFrac+r/s.w,e._thickFrac,0,1,e.xanchor),i=l.align(e._yBottomFrac-o/s.h,e._lenFrac,0,1,e.yanchor);var u=l.getCursor(a,i,e.xanchor,e.yanchor);d(t,u)},doneFn:function(){if(d(t),void 0!==a&&void 0!==i){var n={};n[e._propPrefix+"x"]=a,n[e._propPrefix+"y"]=i,void 0!==e._traceIndex?o.call("_guiRestyle",r,n,e._traceIndex):o.call("_guiRelayout",r,n)}}})}(r,e,t)})),e.exit().each((function(e){i.autoMargin(t,e._id)})).remove(),e.order()}}},{"../../constants/alignment":470,"../../lib":498,"../../lib/extend":490,"../../lib/setcursor":519,"../../lib/svg_text_utils":523,"../../plots/cartesian/axes":547,"../../plots/cartesian/axis_defaults":549,"../../plots/cartesian/layout_attributes":561,"../../plots/cartesian/position_defaults":564,"../../plots/plots":585,"../../registry":593,"../color":368,"../colorscale/helpers":379,"../dragelement":387,"../drawing":390,"../titles":463,"./constants":370,d3:86,tinycolor2:322}],373:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t){return n.isPlainObject(t.colorbar)}},{"../../lib":498}],374:[function(t,e,r){"use strict";e.exports={moduleType:"component",name:"colorbar",attributes:t("./attributes"),supplyDefaults:t("./defaults"),draw:t("./draw").draw,hasColorbar:t("./has_colorbar")}},{"./attributes":369,"./defaults":371,"./draw":372,"./has_colorbar":373}],375:[function(t,e,r){"use strict";var n=t("../colorbar/attributes"),a=t("../../lib/regex").counter,i=t("./scales.js").scales;Object.keys(i);function o(t){return"`"+t+"`"}e.exports=function(t,e){t=t||"";var r,s=(e=e||{}).cLetter||"c",l=("onlyIfNumerical"in e?e.onlyIfNumerical:Boolean(t),"noScale"in e?e.noScale:"marker.line"===t),u="showScaleDflt"in e?e.showScaleDflt:"z"===s,c="string"==typeof e.colorscaleDflt?i[e.colorscaleDflt]:null,f=e.editTypeOverride||"",d=t?t+".":"";"colorAttr"in e?(r=e.colorAttr,e.colorAttr):o(d+(r={z:"z",c:"color"}[s]));var h=s+"auto",p=s+"min",g=s+"max",v=s+"mid",m=(o(d+h),o(d+p),o(d+g),{});m[p]=m[g]=void 0;var y={};y[h]=!1;var b={};return"color"===r&&(b.color={valType:"color",arrayOk:!0,editType:f||"style"},e.anim&&(b.color.anim=!0)),b[h]={valType:"boolean",dflt:!0,editType:"calc",impliedEdits:m},b[p]={valType:"number",dflt:null,editType:f||"plot",impliedEdits:y},b[g]={valType:"number",dflt:null,editType:f||"plot",impliedEdits:y},b[v]={valType:"number",dflt:null,editType:"calc",impliedEdits:m},b.colorscale={valType:"colorscale",editType:"calc",dflt:c,impliedEdits:{autocolorscale:!1}},b.autocolorscale={valType:"boolean",dflt:!1!==e.autoColorDflt,editType:"calc",impliedEdits:{colorscale:void 0}},b.reversescale={valType:"boolean",dflt:!1,editType:"plot"},l||(b.showscale={valType:"boolean",dflt:u,editType:"calc"},b.colorbar=n),e.noColorAxis||(b.coloraxis={valType:"subplotid",regex:a("coloraxis"),dflt:null,editType:"calc"}),b}},{"../../lib/regex":515,"../colorbar/attributes":369,"./scales.js":383}],376:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib"),i=t("./helpers").extractOpts;e.exports=function(t,e,r){var o,s=t._fullLayout,l=r.vals,u=r.containerStr,c=u?a.nestedProperty(e,u).get():e,f=i(c),d=!1!==f.auto,h=f.min,p=f.max,g=f.mid,v=function(){return a.aggNums(Math.min,null,l)},m=function(){return a.aggNums(Math.max,null,l)};(void 0===h?h=v():d&&(h=c._colorAx&&n(h)?Math.min(h,v()):v()),void 0===p?p=m():d&&(p=c._colorAx&&n(p)?Math.max(p,m()):m()),d&&void 0!==g&&(p-g>g-h?h=g-(p-g):p-g=0?s.colorscale.sequential:s.colorscale.sequentialminus,f._sync("colorscale",o))}},{"../../lib":498,"./helpers":379,"fast-isnumeric":155}],377:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./helpers").hasColorscale,i=t("./helpers").extractOpts;e.exports=function(t,e){function r(t,e){var r=t["_"+e];void 0!==r&&(t[e]=r)}function o(t,a){var o=a.container?n.nestedProperty(t,a.container).get():t;if(o)if(o.coloraxis)o._colorAx=e[o.coloraxis];else{var s=i(o),l=s.auto;(l||void 0===s.min)&&r(o,a.min),(l||void 0===s.max)&&r(o,a.max),s.autocolorscale&&r(o,"colorscale")}}for(var s=0;s=0;n--,a++){var i=t[n];r[a]=[1-i[0],i[1]]}return r}function p(t,e){e=e||{};for(var r=t.domain,o=t.range,l=o.length,u=new Array(l),c=0;c4/3-s?o:s}},{}],385:[function(t,e,r){"use strict";var n=t("../../lib"),a=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];e.exports=function(t,e,r,i){return t="left"===r?0:"center"===r?1:"right"===r?2:n.constrain(Math.floor(3*t),0,2),e="bottom"===i?0:"middle"===i?1:"top"===i?2:n.constrain(Math.floor(3*e),0,2),a[e][t]}},{"../../lib":498}],386:[function(t,e,r){"use strict";r.selectMode=function(t){return"lasso"===t||"select"===t},r.drawMode=function(t){return"drawclosedpath"===t||"drawopenpath"===t||"drawline"===t||"drawrect"===t||"drawcircle"===t},r.openMode=function(t){return"drawline"===t||"drawopenpath"===t},r.rectMode=function(t){return"select"===t||"drawline"===t||"drawrect"===t||"drawcircle"===t},r.freeMode=function(t){return"lasso"===t||"drawclosedpath"===t||"drawopenpath"===t},r.selectingOrDrawing=function(t){return r.freeMode(t)||r.rectMode(t)}},{}],387:[function(t,e,r){"use strict";var n=t("mouse-event-offset"),a=t("has-hover"),i=t("has-passive-events"),o=t("../../lib").removeElement,s=t("../../plots/cartesian/constants"),l=e.exports={};l.align=t("./align"),l.getCursor=t("./cursor");var u=t("./unhover");function c(){var t=document.createElement("div");t.className="dragcover";var e=t.style;return e.position="fixed",e.left=0,e.right=0,e.top=0,e.bottom=0,e.zIndex=999999999,e.background="none",document.body.appendChild(t),t}function f(t){return n(t.changedTouches?t.changedTouches[0]:t,document.body)}l.unhover=u.wrapped,l.unhoverRaw=u.raw,l.init=function(t){var e,r,n,u,d,h,p,g,v=t.gd,m=1,y=v._context.doubleClickDelay,b=t.element;v._mouseDownTime||(v._mouseDownTime=0),b.style.pointerEvents="all",b.onmousedown=_,i?(b._ontouchstart&&b.removeEventListener("touchstart",b._ontouchstart),b._ontouchstart=_,b.addEventListener("touchstart",_,{passive:!1})):b.ontouchstart=_;var x=t.clampFn||function(t,e,r){return Math.abs(t)y&&(m=Math.max(m-1,1)),v._dragged)t.doneFn&&t.doneFn();else if(t.clickFn&&t.clickFn(m,h),!g){var r;try{r=new MouseEvent("click",e)}catch(t){var n=f(e);(r=document.createEvent("MouseEvents")).initMouseEvent("click",e.bubbles,e.cancelable,e.view,e.detail,e.screenX,e.screenY,n[0],n[1],e.ctrlKey,e.altKey,e.shiftKey,e.metaKey,e.button,e.relatedTarget)}p.dispatchEvent(r)}v._dragging=!1,v._dragged=!1}else v._dragged=!1}},l.coverSlip=c},{"../../lib":498,"../../plots/cartesian/constants":553,"./align":384,"./cursor":385,"./unhover":388,"has-hover":237,"has-passive-events":238,"mouse-event-offset":254}],388:[function(t,e,r){"use strict";var n=t("../../lib/events"),a=t("../../lib/throttle"),i=t("../../lib/dom").getGraphDiv,o=t("../fx/constants"),s=e.exports={};s.wrapped=function(t,e,r){(t=i(t))._fullLayout&&a.clear(t._fullLayout._uid+o.HOVERID),s.raw(t,e,r)},s.raw=function(t,e){var r=t._fullLayout,a=t._hoverdata;e||(e={}),e.target&&!1===n.triggerHandler(t,"plotly_beforehover",e)||(r._hoverlayer.selectAll("g").remove(),r._hoverlayer.selectAll("line").remove(),r._hoverlayer.selectAll("circle").remove(),t._hoverdata=void 0,e.target&&a&&t.emit("plotly_unhover",{event:e,points:a}))}},{"../../lib/dom":488,"../../lib/events":489,"../../lib/throttle":524,"../fx/constants":402}],389:[function(t,e,r){"use strict";r.dash={valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid",editType:"style"}},{}],390:[function(t,e,r){"use strict";var n=t("d3"),a=t("fast-isnumeric"),i=t("tinycolor2"),o=t("../../registry"),s=t("../color"),l=t("../colorscale"),u=t("../../lib"),c=u.strTranslate,f=t("../../lib/svg_text_utils"),d=t("../../constants/xmlns_namespaces"),h=t("../../constants/alignment").LINE_SPACING,p=t("../../constants/interactions").DESELECTDIM,g=t("../../traces/scatter/subtypes"),v=t("../../traces/scatter/make_bubble_size_func"),m=t("../../components/fx/helpers").appendArrayPointValue,y=e.exports={};y.font=function(t,e,r,n){u.isPlainObject(e)&&(n=e.color,r=e.size,e=e.family),e&&t.style("font-family",e),r+1&&t.style("font-size",r+"px"),n&&t.call(s.fill,n)},y.setPosition=function(t,e,r){t.attr("x",e).attr("y",r)},y.setSize=function(t,e,r){t.attr("width",e).attr("height",r)},y.setRect=function(t,e,r,n,a){t.call(y.setPosition,e,r).call(y.setSize,n,a)},y.translatePoint=function(t,e,r,n){var i=r.c2p(t.x),o=n.c2p(t.y);return!!(a(i)&&a(o)&&e.node())&&("text"===e.node().nodeName?e.attr("x",i).attr("y",o):e.attr("transform",c(i,o)),!0)},y.translatePoints=function(t,e,r){t.each((function(t){var a=n.select(this);y.translatePoint(t,a,e,r)}))},y.hideOutsideRangePoint=function(t,e,r,n,a,i){e.attr("display",r.isPtWithinRange(t,a)&&n.isPtWithinRange(t,i)?null:"none")},y.hideOutsideRangePoints=function(t,e){if(e._hasClipOnAxisFalse){var r=e.xaxis,a=e.yaxis;t.each((function(e){var i=e[0].trace,s=i.xcalendar,l=i.ycalendar,u=o.traceIs(i,"bar-like")?".bartext":".point,.textpoint";t.selectAll(u).each((function(t){y.hideOutsideRangePoint(t,n.select(this),r,a,s,l)}))}))}},y.crispRound=function(t,e,r){return e&&a(e)?t._context.staticPlot?e:e<1?1:Math.round(e):r||0},y.singleLineStyle=function(t,e,r,n,a){e.style("fill","none");var i=(((t||[])[0]||{}).trace||{}).line||{},o=r||i.width||0,l=a||i.dash||"";s.stroke(e,n||i.color),y.dashLine(e,l,o)},y.lineGroupStyle=function(t,e,r,a){t.style("fill","none").each((function(t){var i=(((t||[])[0]||{}).trace||{}).line||{},o=e||i.width||0,l=a||i.dash||"";n.select(this).call(s.stroke,r||i.color).call(y.dashLine,l,o)}))},y.dashLine=function(t,e,r){r=+r||0,e=y.dashStyle(e,r),t.style({"stroke-dasharray":e,"stroke-width":r+"px"})},y.dashStyle=function(t,e){e=+e||1;var r=Math.max(e,3);return"solid"===t?t="":"dot"===t?t=r+"px,"+r+"px":"dash"===t?t=3*r+"px,"+3*r+"px":"longdash"===t?t=5*r+"px,"+5*r+"px":"dashdot"===t?t=3*r+"px,"+r+"px,"+r+"px,"+r+"px":"longdashdot"===t&&(t=5*r+"px,"+2*r+"px,"+r+"px,"+2*r+"px"),t},y.singleFillStyle=function(t){var e=(((n.select(t.node()).data()[0]||[])[0]||{}).trace||{}).fillcolor;e&&t.call(s.fill,e)},y.fillGroupStyle=function(t){t.style("stroke-width",0).each((function(t){var e=n.select(this);t[0].trace&&e.call(s.fill,t[0].trace.fillcolor)}))};var b=t("./symbol_defs");y.symbolNames=[],y.symbolFuncs=[],y.symbolNeedLines={},y.symbolNoDot={},y.symbolNoFill={},y.symbolList=[],Object.keys(b).forEach((function(t){var e=b[t],r=e.n;y.symbolList.push(r,String(r),t,r+100,String(r+100),t+"-open"),y.symbolNames[r]=t,y.symbolFuncs[r]=e.f,e.needLine&&(y.symbolNeedLines[r]=!0),e.noDot?y.symbolNoDot[r]=!0:y.symbolList.push(r+200,String(r+200),t+"-dot",r+300,String(r+300),t+"-open-dot"),e.noFill&&(y.symbolNoFill[r]=!0)}));var x=y.symbolNames.length;function _(t,e){var r=t%100;return y.symbolFuncs[r](e)+(t>=200?"M0,0.5L0.5,0L0,-0.5L-0.5,0Z":"")}y.symbolNumber=function(t){if(a(t))t=+t;else if("string"==typeof t){var e=0;t.indexOf("-open")>0&&(e=100,t=t.replace("-open","")),t.indexOf("-dot")>0&&(e+=200,t=t.replace("-dot","")),(t=y.symbolNames.indexOf(t))>=0&&(t+=e)}return t%100>=x||t>=400?0:Math.floor(Math.max(t,0))};var w={x1:1,x2:0,y1:0,y2:0},A={x1:0,x2:0,y1:1,y2:0},T=n.format("~.1f"),k={radial:{node:"radialGradient"},radialreversed:{node:"radialGradient",reversed:!0},horizontal:{node:"linearGradient",attrs:w},horizontalreversed:{node:"linearGradient",attrs:w,reversed:!0},vertical:{node:"linearGradient",attrs:A},verticalreversed:{node:"linearGradient",attrs:A,reversed:!0}};y.gradient=function(t,e,r,a,o,l){for(var c=o.length,f=k[a],d=new Array(c),h=0;h"+m(t);p._gradientUrlQueryParts[y]=1},y.initGradients=function(t){var e=t._fullLayout;u.ensureSingle(e._defs,"g","gradients").selectAll("linearGradient,radialGradient").remove(),e._gradientUrlQueryParts={}},y.pointStyle=function(t,e,r){if(t.size()){var a=y.makePointStyleFns(e);t.each((function(t){y.singlePointStyle(t,n.select(this),e,a,r)}))}},y.singlePointStyle=function(t,e,r,n,a){var i=r.marker,o=i.line;if(e.style("opacity",n.selectedOpacityFn?n.selectedOpacityFn(t):void 0===t.mo?i.opacity:t.mo),n.ms2mrc){var l;l="various"===t.ms||"various"===i.size?3:n.ms2mrc(t.ms),t.mrc=l,n.selectedSizeFn&&(l=t.mrc=n.selectedSizeFn(t));var c=y.symbolNumber(t.mx||i.symbol)||0;t.om=c%200>=100,e.attr("d",_(c,l))}var f,d,h,p=!1;if(t.so)h=o.outlierwidth,d=o.outliercolor,f=i.outliercolor;else{var g=(o||{}).width;h=(t.mlw+1||g+1||(t.trace?(t.trace.marker.line||{}).width:0)+1)-1||0,d="mlc"in t?t.mlcc=n.lineScale(t.mlc):u.isArrayOrTypedArray(o.color)?s.defaultLine:o.color,u.isArrayOrTypedArray(i.color)&&(f=s.defaultLine,p=!0),f="mc"in t?t.mcc=n.markerScale(t.mc):i.color||"rgba(0,0,0,0)",n.selectedColorFn&&(f=n.selectedColorFn(t))}if(t.om)e.call(s.stroke,f).style({"stroke-width":(h||1)+"px",fill:"none"});else{e.style("stroke-width",(t.isBlank?0:h)+"px");var v=i.gradient,m=t.mgt;if(m?p=!0:m=v&&v.type,Array.isArray(m)&&(m=m[0],k[m]||(m=0)),m&&"none"!==m){var b=t.mgc;b?p=!0:b=v.color;var x=r.uid;p&&(x+="-"+t.i),y.gradient(e,a,x,m,[[0,b],[1,f]],"fill")}else s.fill(e,f);h&&s.stroke(e,d)}},y.makePointStyleFns=function(t){var e={},r=t.marker;return e.markerScale=y.tryColorscale(r,""),e.lineScale=y.tryColorscale(r,"line"),o.traceIs(t,"symbols")&&(e.ms2mrc=g.isBubble(t)?v(t):function(){return(r.size||6)/2}),t.selectedpoints&&u.extendFlat(e,y.makeSelectedPointStyleFns(t)),e},y.makeSelectedPointStyleFns=function(t){var e={},r=t.selected||{},n=t.unselected||{},a=t.marker||{},i=r.marker||{},s=n.marker||{},l=a.opacity,c=i.opacity,f=s.opacity,d=void 0!==c,h=void 0!==f;(u.isArrayOrTypedArray(l)||d||h)&&(e.selectedOpacityFn=function(t){var e=void 0===t.mo?a.opacity:t.mo;return t.selected?d?c:e:h?f:p*e});var g=a.color,v=i.color,m=s.color;(v||m)&&(e.selectedColorFn=function(t){var e=t.mcc||g;return t.selected?v||e:m||e});var y=a.size,b=i.size,x=s.size,_=void 0!==b,w=void 0!==x;return o.traceIs(t,"symbols")&&(_||w)&&(e.selectedSizeFn=function(t){var e=t.mrc||y/2;return t.selected?_?b/2:e:w?x/2:e}),e},y.makeSelectedTextStyleFns=function(t){var e={},r=t.selected||{},n=t.unselected||{},a=t.textfont||{},i=r.textfont||{},o=n.textfont||{},l=a.color,u=i.color,c=o.color;return e.selectedTextColorFn=function(t){var e=t.tc||l;return t.selected?u||e:c||(u?e:s.addOpacity(e,p))},e},y.selectedPointStyle=function(t,e){if(t.size()&&e.selectedpoints){var r=y.makeSelectedPointStyleFns(e),a=e.marker||{},i=[];r.selectedOpacityFn&&i.push((function(t,e){t.style("opacity",r.selectedOpacityFn(e))})),r.selectedColorFn&&i.push((function(t,e){s.fill(t,r.selectedColorFn(e))})),r.selectedSizeFn&&i.push((function(t,e){var n=e.mx||a.symbol||0,i=r.selectedSizeFn(e);t.attr("d",_(y.symbolNumber(n),i)),e.mrc2=i})),i.length&&t.each((function(t){for(var e=n.select(this),r=0;r0?r:0}y.textPointStyle=function(t,e,r){if(t.size()){var a;if(e.selectedpoints){var i=y.makeSelectedTextStyleFns(e);a=i.selectedTextColorFn}var o=e.texttemplate,s=r._fullLayout;t.each((function(t){var i=n.select(this),l=o?u.extractOption(t,e,"txt","texttemplate"):u.extractOption(t,e,"tx","text");if(l||0===l){if(o){var c=e._module.formatLabels?e._module.formatLabels(t,e,s):{},d={};m(d,e,t.i);var h=e._meta||{};l=u.texttemplateString(l,c,s._d3locale,d,t,h)}var p=t.tp||e.textposition,g=S(t,e),v=a?a(t):t.tc||e.textfont.color;i.call(y.font,t.tf||e.textfont.family,g,v).text(l).call(f.convertToTspans,r).call(E,p,g,t.mrc)}else i.remove()}))}},y.selectedTextStyle=function(t,e){if(t.size()&&e.selectedpoints){var r=y.makeSelectedTextStyleFns(e);t.each((function(t){var a=n.select(this),i=r.selectedTextColorFn(t),o=t.tp||e.textposition,l=S(t,e);s.fill(a,i),E(a,o,l,t.mrc2||t.mrc)}))}};function C(t,e,r,a){var i=t[0]-e[0],o=t[1]-e[1],s=r[0]-e[0],l=r[1]-e[1],u=Math.pow(i*i+o*o,.25),c=Math.pow(s*s+l*l,.25),f=(c*c*i-u*u*s)*a,d=(c*c*o-u*u*l)*a,h=3*c*(u+c),p=3*u*(u+c);return[[n.round(e[0]+(h&&f/h),2),n.round(e[1]+(h&&d/h),2)],[n.round(e[0]-(p&&f/p),2),n.round(e[1]-(p&&d/p),2)]]}y.smoothopen=function(t,e){if(t.length<3)return"M"+t.join("L");var r,n="M"+t[0],a=[];for(r=1;r=1e4&&(y.savedBBoxes={},D=0),r&&(y.savedBBoxes[r]=v),D++,u.extendFlat({},v)},y.setClipUrl=function(t,e,r){t.attr("clip-path",I(e,r))},y.getTranslate=function(t){var e=(t[t.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\btranslate\((-?\d*\.?\d*)[^-\d]*(-?\d*\.?\d*)[^\d].*/,(function(t,e,r){return[e,r].join(" ")})).split(" ");return{x:+e[0]||0,y:+e[1]||0}},y.setTranslate=function(t,e,r){var n=t.attr?"attr":"getAttribute",a=t.attr?"attr":"setAttribute",i=t[n]("transform")||"";return e=e||0,r=r||0,i=i.replace(/(\btranslate\(.*?\);?)/,"").trim(),i=(i+=c(e,r)).trim(),t[a]("transform",i),i},y.getScale=function(t){var e=(t[t.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\bscale\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/,(function(t,e,r){return[e,r].join(" ")})).split(" ");return{x:+e[0]||1,y:+e[1]||1}},y.setScale=function(t,e,r){var n=t.attr?"attr":"getAttribute",a=t.attr?"attr":"setAttribute",i=t[n]("transform")||"";return e=e||1,r=r||1,i=i.replace(/(\bscale\(.*?\);?)/,"").trim(),i=(i+="scale("+e+","+r+")").trim(),t[a]("transform",i),i};var P=/\s*sc.*/;y.setPointGroupScale=function(t,e,r){if(e=e||1,r=r||1,t){var n=1===e&&1===r?"":"scale("+e+","+r+")";t.each((function(){var t=(this.getAttribute("transform")||"").replace(P,"");t=(t+=n).trim(),this.setAttribute("transform",t)}))}};var F=/translate\([^)]*\)\s*$/;y.setTextPointsScale=function(t,e,r){t&&t.each((function(){var t,a=n.select(this),i=a.select("text");if(i.node()){var o=parseFloat(i.attr("x")||0),s=parseFloat(i.attr("y")||0),l=(a.attr("transform")||"").match(F);t=1===e&&1===r?[]:[c(o,s),"scale("+e+","+r+")",c(-o,-s)],l&&t.push(l),a.attr("transform",t.join(""))}}))}},{"../../components/fx/helpers":404,"../../constants/alignment":470,"../../constants/interactions":474,"../../constants/xmlns_namespaces":476,"../../lib":498,"../../lib/svg_text_utils":523,"../../registry":593,"../../traces/scatter/make_bubble_size_func":671,"../../traces/scatter/subtypes":679,"../color":368,"../colorscale":380,"./symbol_defs":391,d3:86,"fast-isnumeric":155,tinycolor2:322}],391:[function(t,e,r){"use strict";var n=t("d3");e.exports={circle:{n:0,f:function(t){var e=n.round(t,2);return"M"+e+",0A"+e+","+e+" 0 1,1 0,-"+e+"A"+e+","+e+" 0 0,1 "+e+",0Z"}},square:{n:1,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"H-"+e+"V-"+e+"H"+e+"Z"}},diamond:{n:2,f:function(t){var e=n.round(1.3*t,2);return"M"+e+",0L0,"+e+"L-"+e+",0L0,-"+e+"Z"}},cross:{n:3,f:function(t){var e=n.round(.4*t,2),r=n.round(1.2*t,2);return"M"+r+","+e+"H"+e+"V"+r+"H-"+e+"V"+e+"H-"+r+"V-"+e+"H-"+e+"V-"+r+"H"+e+"V-"+e+"H"+r+"Z"}},x:{n:4,f:function(t){var e=n.round(.8*t/Math.sqrt(2),2),r="l"+e+","+e,a="l"+e+",-"+e,i="l-"+e+",-"+e,o="l-"+e+","+e;return"M0,"+e+r+a+i+a+i+o+i+o+r+o+r+"Z"}},"triangle-up":{n:5,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M-"+e+","+n.round(t/2,2)+"H"+e+"L0,-"+n.round(t,2)+"Z"}},"triangle-down":{n:6,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M-"+e+",-"+n.round(t/2,2)+"H"+e+"L0,"+n.round(t,2)+"Z"}},"triangle-left":{n:7,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M"+n.round(t/2,2)+",-"+e+"V"+e+"L-"+n.round(t,2)+",0Z"}},"triangle-right":{n:8,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M-"+n.round(t/2,2)+",-"+e+"V"+e+"L"+n.round(t,2)+",0Z"}},"triangle-ne":{n:9,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M-"+r+",-"+e+"H"+e+"V"+r+"Z"}},"triangle-se":{n:10,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M"+e+",-"+r+"V"+e+"H-"+r+"Z"}},"triangle-sw":{n:11,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M"+r+","+e+"H-"+e+"V-"+r+"Z"}},"triangle-nw":{n:12,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M-"+e+","+r+"V-"+e+"H"+r+"Z"}},pentagon:{n:13,f:function(t){var e=n.round(.951*t,2),r=n.round(.588*t,2),a=n.round(-t,2),i=n.round(-.309*t,2);return"M"+e+","+i+"L"+r+","+n.round(.809*t,2)+"H-"+r+"L-"+e+","+i+"L0,"+a+"Z"}},hexagon:{n:14,f:function(t){var e=n.round(t,2),r=n.round(t/2,2),a=n.round(t*Math.sqrt(3)/2,2);return"M"+a+",-"+r+"V"+r+"L0,"+e+"L-"+a+","+r+"V-"+r+"L0,-"+e+"Z"}},hexagon2:{n:15,f:function(t){var e=n.round(t,2),r=n.round(t/2,2),a=n.round(t*Math.sqrt(3)/2,2);return"M-"+r+","+a+"H"+r+"L"+e+",0L"+r+",-"+a+"H-"+r+"L-"+e+",0Z"}},octagon:{n:16,f:function(t){var e=n.round(.924*t,2),r=n.round(.383*t,2);return"M-"+r+",-"+e+"H"+r+"L"+e+",-"+r+"V"+r+"L"+r+","+e+"H-"+r+"L-"+e+","+r+"V-"+r+"Z"}},star:{n:17,f:function(t){var e=1.4*t,r=n.round(.225*e,2),a=n.round(.951*e,2),i=n.round(.363*e,2),o=n.round(.588*e,2),s=n.round(-e,2),l=n.round(-.309*e,2),u=n.round(.118*e,2),c=n.round(.809*e,2);return"M"+r+","+l+"H"+a+"L"+i+","+u+"L"+o+","+c+"L0,"+n.round(.382*e,2)+"L-"+o+","+c+"L-"+i+","+u+"L-"+a+","+l+"H-"+r+"L0,"+s+"Z"}},hexagram:{n:18,f:function(t){var e=n.round(.66*t,2),r=n.round(.38*t,2),a=n.round(.76*t,2);return"M-"+a+",0l-"+r+",-"+e+"h"+a+"l"+r+",-"+e+"l"+r+","+e+"h"+a+"l-"+r+","+e+"l"+r+","+e+"h-"+a+"l-"+r+","+e+"l-"+r+",-"+e+"h-"+a+"Z"}},"star-triangle-up":{n:19,f:function(t){var e=n.round(t*Math.sqrt(3)*.8,2),r=n.round(.8*t,2),a=n.round(1.6*t,2),i=n.round(4*t,2),o="A "+i+","+i+" 0 0 1 ";return"M-"+e+","+r+o+e+","+r+o+"0,-"+a+o+"-"+e+","+r+"Z"}},"star-triangle-down":{n:20,f:function(t){var e=n.round(t*Math.sqrt(3)*.8,2),r=n.round(.8*t,2),a=n.round(1.6*t,2),i=n.round(4*t,2),o="A "+i+","+i+" 0 0 1 ";return"M"+e+",-"+r+o+"-"+e+",-"+r+o+"0,"+a+o+e+",-"+r+"Z"}},"star-square":{n:21,f:function(t){var e=n.round(1.1*t,2),r=n.round(2*t,2),a="A "+r+","+r+" 0 0 1 ";return"M-"+e+",-"+e+a+"-"+e+","+e+a+e+","+e+a+e+",-"+e+a+"-"+e+",-"+e+"Z"}},"star-diamond":{n:22,f:function(t){var e=n.round(1.4*t,2),r=n.round(1.9*t,2),a="A "+r+","+r+" 0 0 1 ";return"M-"+e+",0"+a+"0,"+e+a+e+",0"+a+"0,-"+e+a+"-"+e+",0Z"}},"diamond-tall":{n:23,f:function(t){var e=n.round(.7*t,2),r=n.round(1.4*t,2);return"M0,"+r+"L"+e+",0L0,-"+r+"L-"+e+",0Z"}},"diamond-wide":{n:24,f:function(t){var e=n.round(1.4*t,2),r=n.round(.7*t,2);return"M0,"+r+"L"+e+",0L0,-"+r+"L-"+e+",0Z"}},hourglass:{n:25,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"H-"+e+"L"+e+",-"+e+"H-"+e+"Z"},noDot:!0},bowtie:{n:26,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"V-"+e+"L-"+e+","+e+"V-"+e+"Z"},noDot:!0},"circle-cross":{n:27,f:function(t){var e=n.round(t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e+"M"+e+",0A"+e+","+e+" 0 1,1 0,-"+e+"A"+e+","+e+" 0 0,1 "+e+",0Z"},needLine:!0,noDot:!0},"circle-x":{n:28,f:function(t){var e=n.round(t,2),r=n.round(t/Math.sqrt(2),2);return"M"+r+","+r+"L-"+r+",-"+r+"M"+r+",-"+r+"L-"+r+","+r+"M"+e+",0A"+e+","+e+" 0 1,1 0,-"+e+"A"+e+","+e+" 0 0,1 "+e+",0Z"},needLine:!0,noDot:!0},"square-cross":{n:29,f:function(t){var e=n.round(t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e+"M"+e+","+e+"H-"+e+"V-"+e+"H"+e+"Z"},needLine:!0,noDot:!0},"square-x":{n:30,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"L-"+e+",-"+e+"M"+e+",-"+e+"L-"+e+","+e+"M"+e+","+e+"H-"+e+"V-"+e+"H"+e+"Z"},needLine:!0,noDot:!0},"diamond-cross":{n:31,f:function(t){var e=n.round(1.3*t,2);return"M"+e+",0L0,"+e+"L-"+e+",0L0,-"+e+"ZM0,-"+e+"V"+e+"M-"+e+",0H"+e},needLine:!0,noDot:!0},"diamond-x":{n:32,f:function(t){var e=n.round(1.3*t,2),r=n.round(.65*t,2);return"M"+e+",0L0,"+e+"L-"+e+",0L0,-"+e+"ZM-"+r+",-"+r+"L"+r+","+r+"M-"+r+","+r+"L"+r+",-"+r},needLine:!0,noDot:!0},"cross-thin":{n:33,f:function(t){var e=n.round(1.4*t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e},needLine:!0,noDot:!0,noFill:!0},"x-thin":{n:34,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"L-"+e+",-"+e+"M"+e+",-"+e+"L-"+e+","+e},needLine:!0,noDot:!0,noFill:!0},asterisk:{n:35,f:function(t){var e=n.round(1.2*t,2),r=n.round(.85*t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e+"M"+r+","+r+"L-"+r+",-"+r+"M"+r+",-"+r+"L-"+r+","+r},needLine:!0,noDot:!0,noFill:!0},hash:{n:36,f:function(t){var e=n.round(t/2,2),r=n.round(t,2);return"M"+e+","+r+"V-"+r+"m-"+r+",0V"+r+"M"+r+","+e+"H-"+r+"m0,-"+r+"H"+r},needLine:!0,noFill:!0},"y-up":{n:37,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),a=n.round(.8*t,2);return"M-"+e+","+a+"L0,0M"+e+","+a+"L0,0M0,-"+r+"L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-down":{n:38,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),a=n.round(.8*t,2);return"M-"+e+",-"+a+"L0,0M"+e+",-"+a+"L0,0M0,"+r+"L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-left":{n:39,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),a=n.round(.8*t,2);return"M"+a+","+e+"L0,0M"+a+",-"+e+"L0,0M-"+r+",0L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-right":{n:40,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),a=n.round(.8*t,2);return"M-"+a+","+e+"L0,0M-"+a+",-"+e+"L0,0M"+r+",0L0,0"},needLine:!0,noDot:!0,noFill:!0},"line-ew":{n:41,f:function(t){var e=n.round(1.4*t,2);return"M"+e+",0H-"+e},needLine:!0,noDot:!0,noFill:!0},"line-ns":{n:42,f:function(t){var e=n.round(1.4*t,2);return"M0,"+e+"V-"+e},needLine:!0,noDot:!0,noFill:!0},"line-ne":{n:43,f:function(t){var e=n.round(t,2);return"M"+e+",-"+e+"L-"+e+","+e},needLine:!0,noDot:!0,noFill:!0},"line-nw":{n:44,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"L-"+e+",-"+e},needLine:!0,noDot:!0,noFill:!0},"arrow-up":{n:45,f:function(t){var e=n.round(t,2);return"M0,0L-"+e+","+n.round(2*t,2)+"H"+e+"Z"},noDot:!0},"arrow-down":{n:46,f:function(t){var e=n.round(t,2);return"M0,0L-"+e+",-"+n.round(2*t,2)+"H"+e+"Z"},noDot:!0},"arrow-left":{n:47,f:function(t){var e=n.round(2*t,2),r=n.round(t,2);return"M0,0L"+e+",-"+r+"V"+r+"Z"},noDot:!0},"arrow-right":{n:48,f:function(t){var e=n.round(2*t,2),r=n.round(t,2);return"M0,0L-"+e+",-"+r+"V"+r+"Z"},noDot:!0},"arrow-bar-up":{n:49,f:function(t){var e=n.round(t,2);return"M-"+e+",0H"+e+"M0,0L-"+e+","+n.round(2*t,2)+"H"+e+"Z"},needLine:!0,noDot:!0},"arrow-bar-down":{n:50,f:function(t){var e=n.round(t,2);return"M-"+e+",0H"+e+"M0,0L-"+e+",-"+n.round(2*t,2)+"H"+e+"Z"},needLine:!0,noDot:!0},"arrow-bar-left":{n:51,f:function(t){var e=n.round(2*t,2),r=n.round(t,2);return"M0,-"+r+"V"+r+"M0,0L"+e+",-"+r+"V"+r+"Z"},needLine:!0,noDot:!0},"arrow-bar-right":{n:52,f:function(t){var e=n.round(2*t,2),r=n.round(t,2);return"M0,-"+r+"V"+r+"M0,0L-"+e+",-"+r+"V"+r+"Z"},needLine:!0,noDot:!0}}},{d3:86}],392:[function(t,e,r){"use strict";e.exports={visible:{valType:"boolean",editType:"calc"},type:{valType:"enumerated",values:["percent","constant","sqrt","data"],editType:"calc"},symmetric:{valType:"boolean",editType:"calc"},array:{valType:"data_array",editType:"calc"},arrayminus:{valType:"data_array",editType:"calc"},value:{valType:"number",min:0,dflt:10,editType:"calc"},valueminus:{valType:"number",min:0,dflt:10,editType:"calc"},traceref:{valType:"integer",min:0,dflt:0,editType:"style"},tracerefminus:{valType:"integer",min:0,dflt:0,editType:"style"},copy_ystyle:{valType:"boolean",editType:"plot"},copy_zstyle:{valType:"boolean",editType:"style"},color:{valType:"color",editType:"style"},thickness:{valType:"number",min:0,dflt:2,editType:"style"},width:{valType:"number",min:0,editType:"plot"},editType:"calc",_deprecated:{opacity:{valType:"number",editType:"style"}}}},{}],393:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../registry"),i=t("../../plots/cartesian/axes"),o=t("../../lib"),s=t("./compute_error");function l(t,e,r,a){var l=e["error_"+a]||{},u=[];if(l.visible&&-1!==["linear","log"].indexOf(r.type)){for(var c=s(l),f=0;f0;e.each((function(e){var f,d=e[0].trace,h=d.error_x||{},p=d.error_y||{};d.ids&&(f=function(t){return t.id});var g=o.hasMarkers(d)&&d.marker.maxdisplayed>0;p.visible||h.visible||(e=[]);var v=n.select(this).selectAll("g.errorbar").data(e,f);if(v.exit().remove(),e.length){h.visible||v.selectAll("path.xerror").remove(),p.visible||v.selectAll("path.yerror").remove(),v.style("opacity",1);var m=v.enter().append("g").classed("errorbar",!0);c&&m.style("opacity",0).transition().duration(s.duration).style("opacity",1),i.setClipUrl(v,r.layerClipId,t),v.each((function(t){var e=n.select(this),r=function(t,e,r){var n={x:e.c2p(t.x),y:r.c2p(t.y)};void 0!==t.yh&&(n.yh=r.c2p(t.yh),n.ys=r.c2p(t.ys),a(n.ys)||(n.noYS=!0,n.ys=r.c2p(t.ys,!0)));void 0!==t.xh&&(n.xh=e.c2p(t.xh),n.xs=e.c2p(t.xs),a(n.xs)||(n.noXS=!0,n.xs=e.c2p(t.xs,!0)));return n}(t,l,u);if(!g||t.vis){var i,o=e.select("path.yerror");if(p.visible&&a(r.x)&&a(r.yh)&&a(r.ys)){var f=p.width;i="M"+(r.x-f)+","+r.yh+"h"+2*f+"m-"+f+",0V"+r.ys,r.noYS||(i+="m-"+f+",0h"+2*f),!o.size()?o=e.append("path").style("vector-effect","non-scaling-stroke").classed("yerror",!0):c&&(o=o.transition().duration(s.duration).ease(s.easing)),o.attr("d",i)}else o.remove();var d=e.select("path.xerror");if(h.visible&&a(r.y)&&a(r.xh)&&a(r.xs)){var v=(h.copy_ystyle?p:h).width;i="M"+r.xh+","+(r.y-v)+"v"+2*v+"m0,-"+v+"H"+r.xs,r.noXS||(i+="m0,-"+v+"v"+2*v),!d.size()?d=e.append("path").style("vector-effect","non-scaling-stroke").classed("xerror",!0):c&&(d=d.transition().duration(s.duration).ease(s.easing)),d.attr("d",i)}else d.remove()}}))}}))}},{"../../traces/scatter/subtypes":679,"../drawing":390,d3:86,"fast-isnumeric":155}],398:[function(t,e,r){"use strict";var n=t("d3"),a=t("../color");e.exports=function(t){t.each((function(t){var e=t[0].trace,r=e.error_y||{},i=e.error_x||{},o=n.select(this);o.selectAll("path.yerror").style("stroke-width",r.thickness+"px").call(a.stroke,r.color),i.copy_ystyle&&(i=r),o.selectAll("path.xerror").style("stroke-width",i.thickness+"px").call(a.stroke,i.color)}))}},{"../color":368,d3:86}],399:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),a=t("./layout_attributes").hoverlabel,i=t("../../lib/extend").extendFlat;e.exports={hoverlabel:{bgcolor:i({},a.bgcolor,{arrayOk:!0}),bordercolor:i({},a.bordercolor,{arrayOk:!0}),font:n({arrayOk:!0,editType:"none"}),align:i({},a.align,{arrayOk:!0}),namelength:i({},a.namelength,{arrayOk:!0}),editType:"none"}}},{"../../lib/extend":490,"../../plots/font_attributes":575,"./layout_attributes":409}],400:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../registry");function i(t,e,r,a){a=a||n.identity,Array.isArray(t)&&(e[0][r]=a(t))}e.exports=function(t){var e=t.calcdata,r=t._fullLayout;function o(t){return function(e){return n.coerceHoverinfo({hoverinfo:e},{_module:t._module},r)}}for(var s=0;s=0&&r.indexx[0]._length||tt<0||tt>_[0]._length)return p.unhoverRaw(t,e)}if(e.pointerX=K+x[0]._offset,e.pointerY=tt+_[0]._offset,C="xval"in e?m.flat(s,e.xval):m.p2c(x,K),O="yval"in e?m.flat(s,e.yval):m.p2c(_,tt),!a(C[0])||!a(O[0]))return o.warn("Fx.hover failed",e,t),p.unhoverRaw(t,e)}var nt=1/0;function at(t,r){for(z=0;zX&&(Z.splice(0,X),nt=Z[0].distance),g&&0!==Y&&0===Z.length){q.distance=Y,q.index=!1;var f=B._module.hoverPoints(q,H,G,"closest",l._hoverlayer);if(f&&(f=f.filter((function(t){return t.spikeDistance<=Y}))),f&&f.length){var d,p=f.filter((function(t){return t.xa.showspikes&&"hovered data"!==t.xa.spikesnap}));if(p.length){var v=p[0];a(v.x0)&&a(v.y0)&&(d=ot(v),(!Q.vLinePoint||Q.vLinePoint.spikeDistance>d.spikeDistance)&&(Q.vLinePoint=d))}var y=f.filter((function(t){return t.ya.showspikes&&"hovered data"!==t.ya.spikesnap}));if(y.length){var b=y[0];a(b.x0)&&a(b.y0)&&(d=ot(b),(!Q.hLinePoint||Q.hLinePoint.spikeDistance>d.spikeDistance)&&(Q.hLinePoint=d))}}}}}function it(t,e){for(var r,n=null,a=1/0,i=0;i1||Z.length>1)||"closest"===E&&$&&Z.length>1,Mt=h.combine(l.plot_bgcolor||h.background,l.paper_bgcolor),Et={hovermode:E,rotateLabels:kt,bgColor:Mt,container:l._hoverlayer,outerContainer:l._paperdiv,commonLabelOpts:l.hoverlabel,hoverdistance:l.hoverdistance},St=L(Z,Et,t);m.isUnifiedHover(E)||(!function(t,e,r){var n,a,i,o,s,l,u,c=0,f=1,d=t.size(),h=new Array(d),p=0;function g(t){var e=t[0],r=t[t.length-1];if(a=e.pmin-e.pos-e.dp+e.size,i=r.pos+r.dp+r.size-e.pmax,a>.01){for(s=t.length-1;s>=0;s--)t[s].dp+=a;n=!1}if(!(i<.01)){if(a<-.01){for(s=t.length-1;s>=0;s--)t[s].dp-=i;n=!1}if(n){var u=0;for(o=0;oe.pmax&&u++;for(o=t.length-1;o>=0&&!(u<=0);o--)(l=t[o]).pos>e.pmax-1&&(l.del=!0,u--);for(o=0;o=0;s--)t[s].dp-=i;for(o=t.length-1;o>=0&&!(u<=0);o--)(l=t[o]).pos+l.dp+l.size>e.pmax&&(l.del=!0,u--)}}}t.each((function(t){var n=t[e],a="x"===n._id.charAt(0),i=n.range;0===p&&i&&i[0]>i[1]!==a&&(f=-1),h[p++]=[{datum:t,traceIndex:t.trace.index,dp:0,pos:t.pos,posref:t.posref,size:t.by*(a?A:1)/2,pmin:0,pmax:a?r.width:r.height}]})),h.sort((function(t,e){return t[0].posref-e[0].posref||f*(e[0].traceIndex-t[0].traceIndex)}));for(;!n&&c<=d;){for(c++,n=!0,o=0;o.01&&y.pmin===b.pmin&&y.pmax===b.pmax){for(s=m.length-1;s>=0;s--)m[s].dp+=a;for(v.push.apply(v,m),h.splice(o+1,1),u=0,s=v.length-1;s>=0;s--)u+=v[s].dp;for(i=u/v.length,s=v.length-1;s>=0;s--)v[s].dp-=i;n=!1}else o++}h.forEach(g)}for(o=h.length-1;o>=0;o--){var x=h[o];for(s=x.length-1;s>=0;s--){var _=x[s],w=_.datum;w.offset=_.dp,w.del=_.del}}}(St,kt?"xa":"ya",l),D(St,kt,l._invScaleX,l._invScaleY));if(e.target&&e.target.tagName){var Ct=v.getComponentMethod("annotations","hasClickToShow")(t,_t);f(n.select(e.target),Ct?"pointer":"")}if(!e.target||i||!function(t,e,r){if(!r||r.length!==t._hoverdata.length)return!0;for(var n=r.length-1;n>=0;n--){var a=r[n],i=t._hoverdata[n];if(a.curveNumber!==i.curveNumber||String(a.pointNumber)!==String(i.pointNumber)||String(a.pointNumbers)!==String(i.pointNumbers))return!0}return!1}(t,0,xt))return;xt&&t.emit("plotly_unhover",{event:e,points:xt});t.emit("plotly_hover",{event:e,points:t._hoverdata,xaxes:x,yaxes:_,xvals:C,yvals:O})}(t,e,r,i)}))},r.loneHover=function(t,e){var r=!0;Array.isArray(t)||(r=!1,t=[t]);var a=t.map((function(t){return{color:t.color||h.defaultLine,x0:t.x0||t.x||0,x1:t.x1||t.x||0,y0:t.y0||t.y||0,y1:t.y1||t.y||0,xLabel:t.xLabel,yLabel:t.yLabel,zLabel:t.zLabel,text:t.text,name:t.name,idealAlign:t.idealAlign,borderColor:t.borderColor,fontFamily:t.fontFamily,fontSize:t.fontSize,fontColor:t.fontColor,nameLength:t.nameLength,textAlign:t.textAlign,trace:t.trace||{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0,hovertemplate:t.hovertemplate||!1,eventData:t.eventData||!1,hovertemplateLabels:t.hovertemplateLabels||!1}})),i=n.select(e.container),o=e.outerContainer?n.select(e.outerContainer):i,s={hovermode:"closest",rotateLabels:!1,bgColor:e.bgColor||h.background,container:i,outerContainer:o},l=L(a,s,e.gd),u=0,c=0;l.sort((function(t,e){return t.y0-e.y0})).each((function(t,r){var n=t.y0-t.by/2;t.offset=n-5([\s\S]*)<\/extra>/;function L(t,e,r){var a=r._fullLayout,i=e.hovermode,u=e.rotateLabels,f=e.bgColor,p=e.container,g=e.outerContainer,v=e.commonLabelOpts||{},w=e.fontFamily||y.HOVERFONT,A=e.fontSize||y.HOVERFONTSIZE,T=t[0],k=T.xa,C=T.ya,L="y"===i.charAt(0)?"yLabel":"xLabel",D=T[L],R=(String(D)||"").split(" ")[0],I=g.node().getBoundingClientRect(),P=I.top,F=I.width,z=I.height,N=void 0!==D&&T.distance<=e.hoverdistance&&("x"===i||"y"===i);if(N){var B,j,U=!0;for(B=0;Ba.width-S?(y=a.width-S,l.attr("d","M"+(S-M)+",0L"+S+","+_+M+"v"+_+(2*E+x.height)+"H-"+S+"V"+_+M+"H"+(S-2*M)+"Z")):l.attr("d","M0,0L"+M+","+_+M+"H"+(E+x.width/2)+"v"+_+(2*E+x.height)+"H-"+(E+x.width/2)+"V"+_+M+"H-"+M+"Z")}else{var L,O,R;"right"===C.side?(L="start",O=1,R="",y=k._offset+k._length):(L="end",O=-1,R="-",y=k._offset),b=C._offset+(T.y0+T.y1)/2,u.attr("text-anchor",L),l.attr("d","M0,0L"+R+M+","+M+"V"+(E+x.height/2)+"h"+R+(2*E+x.width)+"V-"+(E+x.height/2)+"H"+R+M+"V-"+M+"Z");var I,F=x.height/2,z=P-x.top-F,N="clip"+a._uid+"commonlabel"+C._id;if(y=0?et-=at:et+=2*E;var it=nt.height+2*E,ot=tt+it>=z;return it<=z&&(tt<=P?tt=C._offset+2*E:ot&&(tt=z-it)),rt.attr("transform",s(et,tt)),rt}var st=p.selectAll("g.hovertext").data(t,(function(t){return S(t)}));return st.enter().append("g").classed("hovertext",!0).each((function(){var t=n.select(this);t.append("rect").call(h.fill,h.addOpacity(f,.8)),t.append("text").classed("name",!0),t.append("path").style("stroke-width","1px"),t.append("text").classed("nums",!0).call(d.font,w,A)})),st.exit().remove(),st.each((function(t){var e=n.select(this).attr("transform",""),o=t.color;Array.isArray(o)&&(o=o[t.eventData[0].pointNumber]);var p=t.bgcolor||o,g=h.combine(h.opacity(p)?p:h.defaultLine,f),v=h.combine(h.opacity(o)?o:h.defaultLine,f),m=t.borderColor||h.contrast(g),y=O(t,N,i,a,D,e),b=y[0],x=y[1],T=e.select("text.nums").call(d.font,t.fontFamily||w,t.fontSize||A,t.fontColor||m).text(b).attr("data-notex",1).call(c.positionText,0,0).call(c.convertToTspans,r),k=e.select("text.name"),S=0,C=0;if(x&&x!==b){k.call(d.font,t.fontFamily||w,t.fontSize||A,v).text(x).attr("data-notex",1).call(c.positionText,0,0).call(c.convertToTspans,r);var L=k.node().getBoundingClientRect();S=L.width+2*E,C=L.height+2*E}else k.remove(),e.select("rect").remove();e.select("path").style({fill:g,stroke:m});var R,I,B=T.node().getBoundingClientRect(),j=t.xa._offset+(t.x0+t.x1)/2,U=t.ya._offset+(t.y0+t.y1)/2,V=Math.abs(t.x1-t.x0),H=Math.abs(t.y1-t.y0),G=B.width+M+E+S;if(t.ty0=P-B.top,t.bx=B.width+2*E,t.by=Math.max(B.height+2*E,C),t.anchor="start",t.txwidth=B.width,t.tx2width=S,t.offset=0,u)t.pos=j,R=U+H/2+G<=z,I=U-H/2-G>=0,"top"!==t.idealAlign&&R||!I?R?(U+=H/2,t.anchor="start"):t.anchor="middle":(U-=H/2,t.anchor="end");else if(t.pos=U,R=j+V/2+G<=F,I=j-V/2-G>=0,"left"!==t.idealAlign&&R||!I)if(R)j+=V/2,t.anchor="start";else{t.anchor="middle";var q=G/2,X=j+q-F,W=j-q;X>0&&(j-=X),W<0&&(j+=-W)}else j-=V/2,t.anchor="end";T.attr("text-anchor",t.anchor),S&&k.attr("text-anchor",t.anchor),e.attr("transform",s(j,U)+(u?l(_):""))})),st}function O(t,e,r,n,a,i){var s="",l="";void 0!==t.nameOverride&&(t.name=t.nameOverride),t.name&&(t.trace._meta&&(t.name=o.templateString(t.name,t.trace._meta)),s=F(t.name,t.nameLength)),void 0!==t.zLabel?(void 0!==t.xLabel&&(l+="x: "+t.xLabel+"
"),void 0!==t.yLabel&&(l+="y: "+t.yLabel+"
"),"choropleth"!==t.trace.type&&"choroplethmapbox"!==t.trace.type&&(l+=(l?"z: ":"")+t.zLabel)):e&&t[r.charAt(0)+"Label"]===a?l=t[("x"===r.charAt(0)?"y":"x")+"Label"]||"":void 0===t.xLabel?void 0!==t.yLabel&&"scattercarpet"!==t.trace.type&&(l=t.yLabel):l=void 0===t.yLabel?t.xLabel:"("+t.xLabel+", "+t.yLabel+")",!t.text&&0!==t.text||Array.isArray(t.text)||(l+=(l?"
":"")+t.text),void 0!==t.extraText&&(l+=(l?"
":"")+t.extraText),i&&""===l&&!t.hovertemplate&&(""===s&&i.remove(),l=s);var u=n._d3locale,c=t.hovertemplate||!1,f=t.hovertemplateLabels||t,d=t.eventData[0]||{};return c&&(l=(l=o.hovertemplateString(c,f,u,d,t.trace._meta)).replace(C,(function(e,r){return s=F(r,t.nameLength),""}))),[l,s]}function D(t,e,r,a){var i=function(t){return t*r},o=function(t){return t*a};t.each((function(t){var r=n.select(this);if(t.del)return r.remove();var a=r.select("text.nums"),s=t.anchor,l="end"===s?-1:1,u={start:1,end:-1,middle:0}[s],f=u*(M+E),h=f+u*(t.txwidth+E),p=0,g=t.offset,v="middle"===s;v&&(f-=t.tx2width/2,h+=t.txwidth/2+E),e&&(g*=-k,p=t.offset*T),r.select("path").attr("d",v?"M-"+i(t.bx/2+t.tx2width/2)+","+o(g-t.by/2)+"h"+i(t.bx)+"v"+o(t.by)+"h-"+i(t.bx)+"Z":"M0,0L"+i(l*M+p)+","+o(M+g)+"v"+o(t.by/2-M)+"h"+i(l*t.bx)+"v-"+o(t.by)+"H"+i(l*M+p)+"V"+o(g-M)+"Z");var m=p+f,y=g+t.ty0-t.by/2+E,b=t.textAlign||"auto";"auto"!==b&&("left"===b&&"start"!==s?(a.attr("text-anchor","start"),m=v?-t.bx/2-t.tx2width/2+E:-t.bx-E):"right"===b&&"end"!==s&&(a.attr("text-anchor","end"),m=v?t.bx/2-t.tx2width/2-E:t.bx+E)),a.call(c.positionText,i(m),o(y)),t.tx2width&&(r.select("text.name").call(c.positionText,i(h+u*E+p),o(g+t.ty0-t.by/2+E)),r.select("rect").call(d.setRect,i(h+(u-1)*t.tx2width/2+p),o(g-t.by/2-1),i(t.tx2width),o(t.by+2)))}))}function R(t,e){var r=t.index,n=t.trace||{},i=t.cd[0],s=t.cd[r]||{};function l(t){return t||a(t)&&0===t}var u=Array.isArray(r)?function(t,e){var a=o.castOption(i,r,t);return l(a)?a:o.extractOption({},n,"",e)}:function(t,e){return o.extractOption(s,n,t,e)};function c(e,r,n){var a=u(r,n);l(a)&&(t[e]=a)}if(c("hoverinfo","hi","hoverinfo"),c("bgcolor","hbg","hoverlabel.bgcolor"),c("borderColor","hbc","hoverlabel.bordercolor"),c("fontFamily","htf","hoverlabel.font.family"),c("fontSize","hts","hoverlabel.font.size"),c("fontColor","htc","hoverlabel.font.color"),c("nameLength","hnl","hoverlabel.namelength"),c("textAlign","hta","hoverlabel.align"),t.posref="y"===e||"closest"===e&&"h"===n.orientation?t.xa._offset+(t.x0+t.x1)/2:t.ya._offset+(t.y0+t.y1)/2,t.x0=o.constrain(t.x0,0,t.xa._length),t.x1=o.constrain(t.x1,0,t.xa._length),t.y0=o.constrain(t.y0,0,t.ya._length),t.y1=o.constrain(t.y1,0,t.ya._length),void 0!==t.xLabelVal&&(t.xLabel="xLabel"in t?t.xLabel:g.hoverLabelText(t.xa,t.xLabelVal),t.xVal=t.xa.c2d(t.xLabelVal)),void 0!==t.yLabelVal&&(t.yLabel="yLabel"in t?t.yLabel:g.hoverLabelText(t.ya,t.yLabelVal),t.yVal=t.ya.c2d(t.yLabelVal)),void 0!==t.zLabelVal&&void 0===t.zLabel&&(t.zLabel=String(t.zLabelVal)),!(isNaN(t.xerr)||"log"===t.xa.type&&t.xerr<=0)){var f=g.tickText(t.xa,t.xa.c2l(t.xerr),"hover").text;void 0!==t.xerrneg?t.xLabel+=" +"+f+" / -"+g.tickText(t.xa,t.xa.c2l(t.xerrneg),"hover").text:t.xLabel+=" \xb1 "+f,"x"===e&&(t.distance+=1)}if(!(isNaN(t.yerr)||"log"===t.ya.type&&t.yerr<=0)){var d=g.tickText(t.ya,t.ya.c2l(t.yerr),"hover").text;void 0!==t.yerrneg?t.yLabel+=" +"+d+" / -"+g.tickText(t.ya,t.ya.c2l(t.yerrneg),"hover").text:t.yLabel+=" \xb1 "+d,"y"===e&&(t.distance+=1)}var h=t.hoverinfo||t.trace.hoverinfo;return h&&"all"!==h&&(-1===(h=Array.isArray(h)?h:h.split("+")).indexOf("x")&&(t.xLabel=void 0),-1===h.indexOf("y")&&(t.yLabel=void 0),-1===h.indexOf("z")&&(t.zLabel=void 0),-1===h.indexOf("text")&&(t.text=void 0),-1===h.indexOf("name")&&(t.name=void 0)),t}function I(t,e,r){var n,a,o=r.container,s=r.fullLayout,l=s._size,u=r.event,c=!!e.hLinePoint,f=!!e.vLinePoint;if(o.selectAll(".spikeline").remove(),f||c){var p=h.combine(s.plot_bgcolor,s.paper_bgcolor);if(c){var v,m,y=e.hLinePoint;n=y&&y.xa,"cursor"===(a=y&&y.ya).spikesnap?(v=u.pointerX,m=u.pointerY):(v=n._offset+y.x,m=a._offset+y.y);var b,x,_=i.readability(y.color,p)<1.5?h.contrast(p):y.color,w=a.spikemode,A=a.spikethickness,T=a.spikecolor||_,k=g.getPxPosition(t,a);if(-1!==w.indexOf("toaxis")||-1!==w.indexOf("across")){if(-1!==w.indexOf("toaxis")&&(b=k,x=v),-1!==w.indexOf("across")){var M=a._counterDomainMin,E=a._counterDomainMax;"free"===a.anchor&&(M=Math.min(M,a.position),E=Math.max(E,a.position)),b=l.l+M*l.w,x=l.l+E*l.w}o.insert("line",":first-child").attr({x1:b,x2:x,y1:m,y2:m,"stroke-width":A,stroke:T,"stroke-dasharray":d.dashStyle(a.spikedash,A)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:b,x2:x,y1:m,y2:m,"stroke-width":A+2,stroke:p}).classed("spikeline",!0).classed("crisp",!0)}-1!==w.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:k+("right"!==a.side?A:-A),cy:m,r:A,fill:T}).classed("spikeline",!0)}if(f){var S,C,L=e.vLinePoint;n=L&&L.xa,a=L&&L.ya,"cursor"===n.spikesnap?(S=u.pointerX,C=u.pointerY):(S=n._offset+L.x,C=a._offset+L.y);var O,D,R=i.readability(L.color,p)<1.5?h.contrast(p):L.color,I=n.spikemode,P=n.spikethickness,F=n.spikecolor||R,z=g.getPxPosition(t,n);if(-1!==I.indexOf("toaxis")||-1!==I.indexOf("across")){if(-1!==I.indexOf("toaxis")&&(O=z,D=C),-1!==I.indexOf("across")){var N=n._counterDomainMin,B=n._counterDomainMax;"free"===n.anchor&&(N=Math.min(N,n.position),B=Math.max(B,n.position)),O=l.t+(1-B)*l.h,D=l.t+(1-N)*l.h}o.insert("line",":first-child").attr({x1:S,x2:S,y1:O,y2:D,"stroke-width":P,stroke:F,"stroke-dasharray":d.dashStyle(n.spikedash,P)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:S,x2:S,y1:O,y2:D,"stroke-width":P+2,stroke:p}).classed("spikeline",!0).classed("crisp",!0)}-1!==I.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:S,cy:z-("top"!==n.side?P:-P),r:P,fill:F}).classed("spikeline",!0)}}}function P(t,e){return!e||(e.vLinePoint!==t._spikepoints.vLinePoint||e.hLinePoint!==t._spikepoints.hLinePoint)}function F(t,e){return c.plainText(t||"",{len:e,allowedTags:["br","sub","sup","b","i","em"]})}},{"../../lib":498,"../../lib/events":489,"../../lib/override_cursor":509,"../../lib/svg_text_utils":523,"../../plots/cartesian/axes":547,"../../registry":593,"../color":368,"../dragelement":387,"../drawing":390,"../legend/defaults":420,"../legend/draw":421,"./constants":402,"./helpers":404,d3:86,"fast-isnumeric":155,tinycolor2:322}],406:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../color"),i=t("./helpers").isUnifiedHover;e.exports=function(t,e,r,o){function s(t){o.font[t]||(o.font[t]=e.legend?e.legend.font[t]:e.font[t])}o=o||{},e&&i(e.hovermode)&&(o.font||(o.font={}),s("size"),s("family"),s("color"),e.legend?(o.bgcolor||(o.bgcolor=a.combine(e.legend.bgcolor,e.paper_bgcolor)),o.bordercolor||(o.bordercolor=e.legend.bordercolor)):o.bgcolor||(o.bgcolor=e.paper_bgcolor)),r("hoverlabel.bgcolor",o.bgcolor),r("hoverlabel.bordercolor",o.bordercolor),r("hoverlabel.namelength",o.namelength),n.coerceFont(r,"hoverlabel.font",o.font),r("hoverlabel.align",o.align)}},{"../../lib":498,"../color":368,"./helpers":404}],407:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./layout_attributes");e.exports=function(t,e,r){function i(r,i){return void 0!==e[r]?e[r]:n.coerce(t,e,a,r,i)}var o,s=i("clickmode");return e._has("cartesian")?s.indexOf("select")>-1?o="closest":(e._isHoriz=function(t,e){for(var r=e._scatterStackOpts||{},n=0;n1){if(!d&&!h&&!p)"independent"===T("pattern")&&(d=!0);v._hasSubplotGrid=d;var b,x,_="top to bottom"===T("roworder"),w=d?.2:.1,A=d?.3:.1;g&&e._splomGridDflt&&(b=e._splomGridDflt.xside,x=e._splomGridDflt.yside),v._domains={x:c("x",T,w,b,y),y:c("y",T,A,x,m,_)}}else delete e.grid}function T(t,e){return n.coerce(r,v,l,t,e)}},contentDefaults:function(t,e){var r=e.grid;if(r&&r._domains){var n,a,i,o,s,l,c,d=t.grid||{},h=e._subplots,p=r._hasSubplotGrid,g=r.rows,v=r.columns,m="independent"===r.pattern,y=r._axisMap={};if(p){var b=d.subplots||[];l=r.subplots=new Array(g);var x=1;for(n=0;n1);if(!1!==g||u.uirevision){var v=i.newContainer(e,"legend");if(_("uirevision",e.uirevision),!1!==g){_("bgcolor",e.paper_bgcolor),_("bordercolor"),_("borderwidth"),a.coerceFont(_,"font",e.font);var m,y,b,x=_("orientation");"h"===x?(m=0,n.getComponentMethod("rangeslider","isVisible")(t.xaxis)?(y=1.1,b="bottom"):(y=-.1,b="top")):(m=1.02,y=1,b="auto"),_("traceorder",d),l.isGrouped(e.legend)&&_("tracegroupgap"),_("itemsizing"),_("itemwidth"),_("itemclick"),_("itemdoubleclick"),_("x",m),_("xanchor"),_("y",y),_("yanchor",b),_("valign"),a.noneOrAll(u,v,["x","y"]),_("title.text")&&(_("title.side","h"===x?"left":"top"),a.coerceFont(_,"title.font",e.font))}}function _(t,e){return a.coerce(u,v,o,t,e)}}},{"../../lib":498,"../../plot_api/plot_template":536,"../../plots/layout_attributes":583,"../../registry":593,"./attributes":418,"./helpers":424}],421:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../lib"),i=t("../../plots/plots"),o=t("../../registry"),s=t("../../lib/events"),l=t("../dragelement"),u=t("../drawing"),c=t("../color"),f=t("../../lib/svg_text_utils"),d=t("./handle_click"),h=t("./constants"),p=t("../../constants/alignment"),g=p.LINE_SPACING,v=p.FROM_TL,m=p.FROM_BR,y=t("./get_legend_data"),b=t("./style"),x=t("./helpers");function _(t,e,r,n,a){var i=r.data()[0][0].trace,l={event:a,node:r.node(),curveNumber:i.index,expandedIndex:i._expandedIndex,data:t.data,layout:t.layout,frames:t._transitionData._frames,config:t._context,fullData:t._fullData,fullLayout:t._fullLayout};if(i._group&&(l.group=i._group),o.traceIs(i,"pie-like")&&(l.label=r.datum()[0].label),!1!==s.triggerHandler(t,"plotly_legendclick",l))if(1===n)e._clickTimeout=setTimeout((function(){d(r,t,n)}),t._context.doubleClickDelay);else if(2===n){e._clickTimeout&&clearTimeout(e._clickTimeout),t._legendMouseDownTime=0,!1!==s.triggerHandler(t,"plotly_legenddoubleclick",l)&&d(r,t,n)}}function w(t,e,r){var n,i=t.data()[0][0],s=i.trace,l=o.traceIs(s,"pie-like"),c=s.index,d=r._main&&e._context.edits.legendText&&!l,p=r._maxNameLength;r.entries?n=i.text:(n=l?i.label:s.name,s._meta&&(n=a.templateString(n,s._meta)));var g=a.ensureSingle(t,"text","legendtext");g.attr("text-anchor","start").call(u.font,r.font).text(d?A(n,p):n);var v=r.itemwidth+2*h.itemGap;f.positionText(g,v,0),d?g.call(f.makeEditable,{gd:e,text:n}).call(k,t,e,r).on("edit",(function(n){this.text(A(n,p)).call(k,t,e,r);var s=i.trace._fullInput||{},l={};if(o.hasTransform(s,"groupby")){var u=o.getTransformIndices(s,"groupby"),f=u[u.length-1],d=a.keyedContainer(s,"transforms["+f+"].styles","target","value.name");d.set(i.trace._group,n),l=d.constructUpdate()}else l.name=n;return o.call("_guiRestyle",e,l,c)})):k(g,t,e,r)}function A(t,e){var r=Math.max(4,e);if(t&&t.trim().length>=r/2)return t;for(var n=r-(t=t||"").length;n>0;n--)t+=" ";return t}function T(t,e){var r,i=e._context.doubleClickDelay,o=1,s=a.ensureSingle(t,"rect","legendtoggle",(function(t){e._context.staticPlot||t.style("cursor","pointer").attr("pointer-events","all"),t.call(c.fill,"rgba(0,0,0,0)")}));e._context.staticPlot||(s.on("mousedown",(function(){(r=(new Date).getTime())-e._legendMouseDownTimei&&(o=Math.max(o-1,1)),_(e,r,t,o,n.event)}})))}function k(t,e,r,n){n._main||t.attr("data-notex",!0),f.convertToTspans(t,r,(function(){!function(t,e,r){var n=t.data()[0][0];if(r._main&&n&&!n.trace.showlegend)return void t.remove();var a=t.select("g[class*=math-group]"),i=a.node();r||(r=e._fullLayout.legend);var o,s,l=r.borderwidth,c=(n?r:r.title).font.size*g;if(i){var d=u.bBox(i);o=d.height,s=d.width,n?u.setTranslate(a,0,.25*o):u.setTranslate(a,l,.75*o+l)}else{var p=t.select(n?".legendtext":".legendtitletext"),v=f.lineCount(p),m=p.node();o=c*v,s=m?u.bBox(m).width:0;var y=c*((v-1)/2-.3);if(n){var b=r.itemwidth+2*h.itemGap;f.positionText(p,b,-y)}else f.positionText(p,h.titlePad+l,c+l)}n?(n.lineHeight=c,n.height=Math.max(o,16)+3,n.width=s):(r._titleWidth=s,r._titleHeight=o)}(e,r,n)}))}function M(t){return a.isRightAnchor(t)?"right":a.isCenterAnchor(t)?"center":"left"}function E(t){return a.isBottomAnchor(t)?"bottom":a.isMiddleAnchor(t)?"middle":"top"}e.exports=function(t,e){var r,s=t._fullLayout,f="legend"+s._uid;if(e?(r=e.layer,f+="-hover"):((e=s.legend||{})._main=!0,r=s._infolayer),r){var d;if(t._legendMouseDownTime||(t._legendMouseDownTime=0),e._main){if(!t.calcdata)return;d=s.showlegend&&y(t.calcdata,e)}else{if(!e.entries)return;d=y(e.entries,e)}var p=s.hiddenlabels||[];if(e._main&&(!s.showlegend||!d.length))return r.selectAll(".legend").remove(),s._topdefs.select("#"+f).remove(),i.autoMargin(t,"legend");var g=a.ensureSingle(r,"g","legend",(function(t){e._main&&t.attr("pointer-events","all")})),A=a.ensureSingleById(s._topdefs,"clipPath",f,(function(t){t.append("rect")})),S=a.ensureSingle(g,"rect","bg",(function(t){t.attr("shape-rendering","crispEdges")}));S.call(c.stroke,e.bordercolor).call(c.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px");var C=a.ensureSingle(g,"g","scrollbox"),L=e.title;if(e._titleWidth=0,e._titleHeight=0,L.text){var O=a.ensureSingle(C,"text","legendtitletext");O.attr("text-anchor","start").call(u.font,L.font).text(L.text),k(O,C,t,e)}else C.selectAll(".legendtitletext").remove();var D=a.ensureSingle(g,"rect","scrollbar",(function(t){t.attr(h.scrollBarEnterAttrs).call(c.fill,h.scrollBarColor)})),R=C.selectAll("g.groups").data(d);R.enter().append("g").attr("class","groups"),R.exit().remove();var I=R.selectAll("g.traces").data(a.identity);I.enter().append("g").attr("class","traces"),I.exit().remove(),I.style("opacity",(function(t){var e=t[0].trace;return o.traceIs(e,"pie-like")?-1!==p.indexOf(t[0].label)?.5:1:"legendonly"===e.visible?.5:1})).each((function(){n.select(this).call(w,t,e)})).call(b,t,e).each((function(){e._main&&n.select(this).call(T,t)})),a.syncOrAsync([i.previousPromises,function(){return function(t,e,r,a){var i=t._fullLayout;a||(a=i.legend);var o=i._size,s=x.isVertical(a),l=x.isGrouped(a),c=a.borderwidth,f=2*c,d=h.itemGap,p=a.itemwidth+2*d,g=2*(c+d),v=E(a),m=a.y<0||0===a.y&&"top"===v,y=a.y>1||1===a.y&&"bottom"===v;a._maxHeight=Math.max(m||y?i.height/2:o.h,30);var b=0;a._width=0,a._height=0;var _=function(t){var e=0,r=0,n=t.title.side;n&&(-1!==n.indexOf("left")&&(e=t._titleWidth),-1!==n.indexOf("top")&&(r=t._titleHeight));return[e,r]}(a);if(s)r.each((function(t){var e=t[0].height;u.setTranslate(this,c+_[0],c+_[1]+a._height+e/2+d),a._height+=e,a._width=Math.max(a._width,t[0].width)})),b=p+a._width,a._width+=d+p+f,a._height+=g,l&&(e.each((function(t,e){u.setTranslate(this,0,e*a.tracegroupgap)})),a._height+=(a._lgroupsLength-1)*a.tracegroupgap);else{var w=M(a),A=a.x<0||0===a.x&&"right"===w,T=a.x>1||1===a.x&&"left"===w,k=y||m,S=i.width/2;a._maxWidth=Math.max(A?k&&"left"===w?o.l+o.w:S:T?k&&"right"===w?o.r+o.w:S:o.w,2*p);var C=0,L=0;r.each((function(t){var e=t[0].width+p;C=Math.max(C,e),L+=e})),b=null;var O=0;if(l){var D=0,R=0,I=0;e.each((function(){var t=0,e=0;n.select(this).selectAll("g.traces").each((function(r){var n=r[0].height;u.setTranslate(this,_[0],_[1]+c+d+n/2+e),e+=n,t=Math.max(t,p+r[0].width)})),D=Math.max(D,e);var r=t+d;r+c+R>a._maxWidth&&(O=Math.max(O,R),R=0,I+=D+a.tracegroupgap,D=e),u.setTranslate(this,R,I),R+=r})),a._width=Math.max(O,R)+c,a._height=I+D+g}else{var P=r.size(),F=L+f+(P-1)*d=a._maxWidth&&(O=Math.max(O,j),N=0,B+=z,a._height+=z,z=0),u.setTranslate(this,_[0]+c+N,_[1]+c+B+e/2+d),j=N+r+d,N+=n,z=Math.max(z,e)})),F?(a._width=N+f,a._height=z+g):(a._width=Math.max(O,j)+f,a._height+=z+g)}}a._width=Math.ceil(Math.max(a._width+_[0],a._titleWidth+2*(c+h.titlePad))),a._height=Math.ceil(Math.max(a._height+_[1],a._titleHeight+2*(c+h.itemGap))),a._effHeight=Math.min(a._height,a._maxHeight);var U=t._context.edits,V=U.legendText||U.legendPosition;r.each((function(t){var e=n.select(this).select(".legendtoggle"),r=t[0].height,a=V?p:b||p+t[0].width;s||(a+=d/2),u.setRect(e,0,-r/2,a,r)}))}(t,R,I,e)},function(){if(!e._main||!function(t){var e=t._fullLayout.legend,r=M(e),n=E(e);return i.autoMargin(t,"legend",{x:e.x,y:e.y,l:e._width*v[r],r:e._width*m[r],b:e._effHeight*m[n],t:e._effHeight*v[n]})}(t)){var c,d,p,y,b=s._size,x=e.borderwidth,w=b.l+b.w*e.x-v[M(e)]*e._width,T=b.t+b.h*(1-e.y)-v[E(e)]*e._effHeight;if(e._main&&s.margin.autoexpand){var k=w,L=T;w=a.constrain(w,0,s.width-e._width),T=a.constrain(T,0,s.height-e._effHeight),w!==k&&a.log("Constrain legend.x to make legend fit inside graph"),T!==L&&a.log("Constrain legend.y to make legend fit inside graph")}if(e._main&&u.setTranslate(g,w,T),D.on(".drag",null),g.on("wheel",null),!e._main||e._height<=e._maxHeight||t._context.staticPlot){var O=e._effHeight;e._main||(O=e._height),S.attr({width:e._width-x,height:O-x,x:x/2,y:x/2}),u.setTranslate(C,0,0),A.select("rect").attr({width:e._width-2*x,height:O-2*x,x:x,y:x}),u.setClipUrl(C,f,t),u.setRect(D,0,0,0,0),delete e._scrollY}else{var R,I,P,F=Math.max(h.scrollBarMinHeight,e._effHeight*e._effHeight/e._height),z=e._effHeight-F-2*h.scrollBarMargin,N=e._height-e._effHeight,B=z/N,j=Math.min(e._scrollY||0,N);S.attr({width:e._width-2*x+h.scrollBarWidth+h.scrollBarMargin,height:e._effHeight-x,x:x/2,y:x/2}),A.select("rect").attr({width:e._width-2*x+h.scrollBarWidth+h.scrollBarMargin,height:e._effHeight-2*x,x:x,y:x+j}),u.setClipUrl(C,f,t),H(j,F,B),g.on("wheel",(function(){H(j=a.constrain(e._scrollY+n.event.deltaY/z*N,0,N),F,B),0!==j&&j!==N&&n.event.preventDefault()}));var U=n.behavior.drag().on("dragstart",(function(){var t=n.event.sourceEvent;R="touchstart"===t.type?t.changedTouches[0].clientY:t.clientY,P=j})).on("drag",(function(){var t=n.event.sourceEvent;2===t.buttons||t.ctrlKey||(I="touchmove"===t.type?t.changedTouches[0].clientY:t.clientY,H(j=function(t,e,r){var n=(r-e)/B+t;return a.constrain(n,0,N)}(P,R,I),F,B))}));D.call(U);var V=n.behavior.drag().on("dragstart",(function(){var t=n.event.sourceEvent;"touchstart"===t.type&&(R=t.changedTouches[0].clientY,P=j)})).on("drag",(function(){var t=n.event.sourceEvent;"touchmove"===t.type&&(I=t.changedTouches[0].clientY,H(j=function(t,e,r){var n=(e-r)/B+t;return a.constrain(n,0,N)}(P,R,I),F,B))}));C.call(V)}if(t._context.edits.legendPosition)g.classed("cursor-move",!0),l.init({element:g.node(),gd:t,prepFn:function(){var t=u.getTranslate(g);p=t.x,y=t.y},moveFn:function(t,r){var n=p+t,a=y+r;u.setTranslate(g,n,a),c=l.align(n,0,b.l,b.l+b.w,e.xanchor),d=l.align(a,0,b.t+b.h,b.t,e.yanchor)},doneFn:function(){void 0!==c&&void 0!==d&&o.call("_guiRelayout",t,{"legend.x":c,"legend.y":d})},clickFn:function(e,n){var a=r.selectAll("g.traces").filter((function(){var t=this.getBoundingClientRect();return n.clientX>=t.left&&n.clientX<=t.right&&n.clientY>=t.top&&n.clientY<=t.bottom}));a.size()>0&&_(t,g,a,e,n)}})}function H(r,n,a){e._scrollY=t._fullLayout.legend._scrollY=r,u.setTranslate(C,0,-r),u.setRect(D,e._width,h.scrollBarMargin+r*a,h.scrollBarWidth,n),A.select("rect").attr("y",x+r)}}],t)}}},{"../../constants/alignment":470,"../../lib":498,"../../lib/events":489,"../../lib/svg_text_utils":523,"../../plots/plots":585,"../../registry":593,"../color":368,"../dragelement":387,"../drawing":390,"./constants":419,"./get_legend_data":422,"./handle_click":423,"./helpers":424,"./style":426,d3:86}],422:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("./helpers");e.exports=function(t,e){var r,i,o={},s=[],l=!1,u={},c=0,f=0,d=e._main;function h(t,r){if(""!==t&&a.isGrouped(e))-1===s.indexOf(t)?(s.push(t),l=!0,o[t]=[[r]]):o[t].push([r]);else{var n="~~i"+c;s.push(n),o[n]=[[r]],c++}}for(r=0;r0))return 0;a=e.width}return v?n:Math.min(a,r)};function _(t,e,r){var i=t[0].trace,o=i.marker||{},s=o.line||{},u=r?i.visible&&i.type===r:a.traceIs(i,"bar"),c=n.select(e).select("g.legendpoints").selectAll("path.legend"+r).data(u?[t]:[]);c.enter().append("path").classed("legend"+r,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",b),c.exit().remove(),c.each((function(t){var e=n.select(this),r=t[0],a=x(r.mlw,o.line,5,2);e.style("stroke-width",a+"px").call(l.fill,r.mc||o.color),a&&l.stroke(e,r.mlc||s.color)}))}function w(t,e,r){var o=t[0],s=o.trace,l=r?s.visible&&s.type===r:a.traceIs(s,r),u=n.select(e).select("g.legendpoints").selectAll("path.legend"+r).data(l?[t]:[]);if(u.enter().append("path").classed("legend"+r,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",b),u.exit().remove(),u.size()){var c=(s.marker||{}).line,h=x(d(c.width,o.pts),c,5,2),p=i.minExtend(s,{marker:{line:{width:h}}});p.marker.line.color=c.color;var g=i.minExtend(o,{trace:p});f(u,g,p)}}t.each((function(t){var e=n.select(this),a=i.ensureSingle(e,"g","layers");a.style("opacity",t[0].trace.opacity);var s=r.valign,l=t[0].lineHeight,u=t[0].height;if("middle"!==s&&l&&u){var c={top:1,bottom:-1}[s]*(.5*(l-u+3));a.attr("transform",o(0,c))}else a.attr("transform",null);a.selectAll("g.legendfill").data([t]).enter().append("g").classed("legendfill",!0),a.selectAll("g.legendlines").data([t]).enter().append("g").classed("legendlines",!0);var f=a.selectAll("g.legendsymbols").data([t]);f.enter().append("g").classed("legendsymbols",!0),f.selectAll("g.legendpoints").data([t]).enter().append("g").classed("legendpoints",!0)})).each((function(t){var r,a=t[0].trace,o=[];if(a.visible)switch(a.type){case"histogram2d":case"heatmap":o=[["M-15,-2V4H15V-2Z"]],r=!0;break;case"choropleth":case"choroplethmapbox":o=[["M-6,-6V6H6V-6Z"]],r=!0;break;case"densitymapbox":o=[["M-6,0 a6,6 0 1,0 12,0 a 6,6 0 1,0 -12,0"]],r="radial";break;case"cone":o=[["M-6,2 A2,2 0 0,0 -6,6 V6L6,4Z"],["M-6,-6 A2,2 0 0,0 -6,-2 L6,-4Z"],["M-6,-2 A2,2 0 0,0 -6,2 L6,0Z"]],r=!1;break;case"streamtube":o=[["M-6,2 A2,2 0 0,0 -6,6 H6 A2,2 0 0,1 6,2 Z"],["M-6,-6 A2,2 0 0,0 -6,-2 H6 A2,2 0 0,1 6,-6 Z"],["M-6,-2 A2,2 0 0,0 -6,2 H6 A2,2 0 0,1 6,-2 Z"]],r=!1;break;case"surface":o=[["M-6,-6 A2,3 0 0,0 -6,0 H6 A2,3 0 0,1 6,-6 Z"],["M-6,1 A2,3 0 0,1 -6,6 H6 A2,3 0 0,0 6,0 Z"]],r=!0;break;case"mesh3d":o=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],r=!1;break;case"volume":o=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],r=!0;break;case"isosurface":o=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6 A12,24 0 0,0 6,-6 L0,6Z"]],r=!1}var c=n.select(this).select("g.legendpoints").selectAll("path.legend3dandfriends").data(o);c.enter().append("path").classed("legend3dandfriends",!0).attr("transform",b).style("stroke-miterlimit",1),c.exit().remove(),c.each((function(t,o){var c,f=n.select(this),d=u(a),h=d.colorscale,g=d.reversescale;if(h){if(!r){var v=h.length;c=0===o?h[g?v-1:0][1]:1===o?h[g?0:v-1][1]:h[Math.floor((v-1)/2)][1]}}else{var m=a.vertexcolor||a.facecolor||a.color;c=i.isArrayOrTypedArray(m)?m[o]||m[0]:m}f.attr("d",t[0]),c?f.call(l.fill,c):f.call((function(t){if(t.size()){var n="legendfill-"+a.uid;s.gradient(t,e,n,p(g,"radial"===r),h,"fill")}}))}))})).each((function(t){var e=t[0].trace,r="waterfall"===e.type;if(t[0]._distinct&&r){var a=t[0].trace[t[0].dir].marker;return t[0].mc=a.color,t[0].mlw=a.line.width,t[0].mlc=a.line.color,_(t,this,"waterfall")}var i=[];e.visible&&r&&(i=t[0].hasTotals?[["increasing","M-6,-6V6H0Z"],["totals","M6,6H0L-6,-6H-0Z"],["decreasing","M6,6V-6H0Z"]]:[["increasing","M-6,-6V6H6Z"],["decreasing","M6,6V-6H-6Z"]]);var o=n.select(this).select("g.legendpoints").selectAll("path.legendwaterfall").data(i);o.enter().append("path").classed("legendwaterfall",!0).attr("transform",b).style("stroke-miterlimit",1),o.exit().remove(),o.each((function(t){var r=n.select(this),a=e[t[0]].marker,i=x(void 0,a.line,5,2);r.attr("d",t[1]).style("stroke-width",i+"px").call(l.fill,a.color),i&&r.call(l.stroke,a.line.color)}))})).each((function(t){_(t,this,"funnel")})).each((function(t){_(t,this)})).each((function(t){var r=t[0].trace,o=n.select(this).select("g.legendpoints").selectAll("path.legendbox").data(r.visible&&a.traceIs(r,"box-violin")?[t]:[]);o.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform",b),o.exit().remove(),o.each((function(){var t=n.select(this);if("all"!==r.boxpoints&&"all"!==r.points||0!==l.opacity(r.fillcolor)||0!==l.opacity((r.line||{}).color)){var a=x(void 0,r.line,5,2);t.style("stroke-width",a+"px").call(l.fill,r.fillcolor),a&&l.stroke(t,r.line.color)}else{var u=i.minExtend(r,{marker:{size:v?12:i.constrain(r.marker.size,2,16),sizeref:1,sizemin:1,sizemode:"diameter"}});o.call(s.pointStyle,u,e)}}))})).each((function(t){w(t,this,"funnelarea")})).each((function(t){w(t,this,"pie")})).each((function(t){var r,a,o=t[0],l=o.trace,f=l.visible&&l.fill&&"none"!==l.fill,d=c.hasLines(l),h=l.contours,g=!1,v=!1,y=u(l),b=y.colorscale,_=y.reversescale;if(h){var w=h.coloring;"lines"===w?g=!0:d="none"===w||"heatmap"===w||h.showlines,"constraint"===h.type?f="="!==h._operation:"fill"!==w&&"heatmap"!==w||(v=!0)}var A=c.hasMarkers(l)||c.hasText(l),T=f||v,k=d||g,M=A||!T?"M5,0":k?"M5,-2":"M5,-3",E=n.select(this),S=E.select(".legendfill").selectAll("path").data(f||v?[t]:[]);if(S.enter().append("path").classed("js-fill",!0),S.exit().remove(),S.attr("d",M+"h"+m+"v6h-"+m+"z").call(f?s.fillGroupStyle:function(t){if(t.size()){var r="legendfill-"+l.uid;s.gradient(t,e,r,p(_),b,"fill")}}),d||g){var C=x(void 0,l.line,10,5);a=i.minExtend(l,{line:{width:C}}),r=[i.minExtend(o,{trace:a})]}var L=E.select(".legendlines").selectAll("path").data(d||g?[r]:[]);L.enter().append("path").classed("js-line",!0),L.exit().remove(),L.attr("d",M+(g?"l"+m+",0.0001":"h"+m)).call(d?s.lineGroupStyle:function(t){if(t.size()){var r="legendline-"+l.uid;s.lineGroupStyle(t),s.gradient(t,e,r,p(_),b,"stroke")}})})).each((function(t){var r,a,o=t[0],l=o.trace,u=c.hasMarkers(l),f=c.hasText(l),d=c.hasLines(l);function h(t,e,r,n){var a=i.nestedProperty(l,t).get(),o=i.isArrayOrTypedArray(a)&&e?e(a):a;if(v&&o&&void 0!==n&&(o=n),r){if(or[1])return r[1]}return o}function p(t){return o._distinct&&o.index&&t[o.index]?t[o.index]:t[0]}if(u||f||d){var g={},m={};if(u){g.mc=h("marker.color",p),g.mx=h("marker.symbol",p),g.mo=h("marker.opacity",i.mean,[.2,1]),g.mlc=h("marker.line.color",p),g.mlw=h("marker.line.width",i.mean,[0,5],2),m.marker={sizeref:1,sizemin:1,sizemode:"diameter"};var y=h("marker.size",i.mean,[2,16],12);g.ms=y,m.marker.size=y}d&&(m.line={width:h("line.width",p,[0,10],5)}),f&&(g.tx="Aa",g.tp=h("textposition",p),g.ts=10,g.tc=h("textfont.color",p),g.tf=h("textfont.family",p)),r=[i.minExtend(o,g)],(a=i.minExtend(l,m)).selectedpoints=null,a.texttemplate=null}var x=n.select(this).select("g.legendpoints"),_=x.selectAll("path.scatterpts").data(u?r:[]);_.enter().insert("path",":first-child").classed("scatterpts",!0).attr("transform",b),_.exit().remove(),_.call(s.pointStyle,a,e),u&&(r[0].mrc=3);var w=x.selectAll("g.pointtext").data(f?r:[]);w.enter().append("g").classed("pointtext",!0).append("text").attr("transform",b),w.exit().remove(),w.selectAll("text").call(s.textPointStyle,a,e)})).each((function(t){var e=t[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendcandle").data(e.visible&&"candlestick"===e.type?[t,t]:[]);r.enter().append("path").classed("legendcandle",!0).attr("d",(function(t,e){return e?"M-15,0H-8M-8,6V-6H8Z":"M15,0H8M8,-6V6H-8Z"})).attr("transform",b).style("stroke-miterlimit",1),r.exit().remove(),r.each((function(t,r){var a=n.select(this),i=e[r?"increasing":"decreasing"],o=x(void 0,i.line,5,2);a.style("stroke-width",o+"px").call(l.fill,i.fillcolor),o&&l.stroke(a,i.line.color)}))})).each((function(t){var e=t[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendohlc").data(e.visible&&"ohlc"===e.type?[t,t]:[]);r.enter().append("path").classed("legendohlc",!0).attr("d",(function(t,e){return e?"M-15,0H0M-8,-6V0":"M15,0H0M8,6V0"})).attr("transform",b).style("stroke-miterlimit",1),r.exit().remove(),r.each((function(t,r){var a=n.select(this),i=e[r?"increasing":"decreasing"],o=x(void 0,i.line,5,2);a.style("fill","none").call(s.dashLine,i.line.dash,o),o&&l.stroke(a,i.line.color)}))}))}},{"../../lib":498,"../../registry":593,"../../traces/pie/helpers":647,"../../traces/pie/style_one":648,"../../traces/scatter/subtypes":679,"../color":368,"../colorscale/helpers":379,"../drawing":390,"./constants":419,d3:86}],427:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../plots/plots"),i=t("../../plots/cartesian/axis_ids"),o=t("../../fonts/ploticon"),s=t("../shapes/draw").eraseActiveShape,l=t("../../lib"),u=l._,c=e.exports={};function f(t,e){var r,a,o=e.currentTarget,s=o.getAttribute("data-attr"),l=o.getAttribute("data-val")||!0,u=t._fullLayout,c={},f=i.list(t,null,!0),d=u._cartesianSpikesEnabled;if("zoom"===s){var h,p="in"===l?.5:2,g=(1+p)/2,v=(1-p)/2;for(a=0;a1?(S=["toggleHover"],C=["resetViews"]):p?(E=["zoomInGeo","zoomOutGeo"],S=["hoverClosestGeo"],C=["resetGeo"]):h?(S=["hoverClosest3d"],C=["resetCameraDefault3d","resetCameraLastSave3d"]):b?(E=["zoomInMapbox","zoomOutMapbox"],S=["toggleHover"],C=["resetViewMapbox"]):m?S=["hoverClosestGl2d"]:g?S=["hoverClosestPie"]:_?(S=["hoverClosestCartesian","hoverCompareCartesian"],C=["resetViewSankey"]):S=["toggleHover"];d&&(S=["toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"]);(function(t){for(var e=0;e0)){var g=function(t,e,r){for(var n=r.filter((function(r){return e[r].anchor===t._id})),a=0,i=0;i=n.max)e=z[r+1];else if(t=n.pmax)e=z[r+1];else if(t0?d+u:u;return{ppad:u,ppadplus:c?p:g,ppadminus:c?g:p}}return{ppad:u}}function c(t,e,r,n,a){var s="category"===t.type||"multicategory"===t.type?t.r2c:t.d2c;if(void 0!==e)return[s(e),s(r)];if(n){var l,u,c,f,d=1/0,h=-1/0,p=n.match(i.segmentRE);for("date"===t.type&&(s=o.decodeDate(s)),l=0;lh&&(h=f)));return h>=d?[d,h]:void 0}}e.exports=function(t){var e=t._fullLayout,r=n.filterVisible(e.shapes);if(r.length&&t._fullData.length)for(var o=0;oy?(T=f,S="y0",k=y,C="y1"):(T=y,S="y1",k=f,C="y0");Z(n),$(s,r),function(t,e,r){var n=e.xref,a=e.yref,o=i.getFromId(r,n),s=i.getFromId(r,a),l="";"paper"===n||o.autorange||(l+=n);"paper"===a||s.autorange||(l+=a);c.setClipUrl(t,l?"clip"+r._fullLayout._uid+l:null,r)}(e,r,t),Y.moveFn="move"===R?J:Q,Y.altKey=n.altKey},doneFn:function(){if(m(t))return;h(e),K(s),x(e,t,r),n.call("_guiRelayout",t,l.getUpdateObj())},clickFn:function(){if(m(t))return;K(s)}};function Z(r){if(m(t))R=null;else if(F)R="path"===r.target.tagName?"move":"start-point"===r.target.attributes["data-line-point"].value?"resize-over-start-point":"resize-over-end-point";else{var n=Y.element.getBoundingClientRect(),a=n.right-n.left,i=n.bottom-n.top,o=r.clientX-n.left,s=r.clientY-n.top,l=!z&&a>10&&i>10&&!r.shiftKey?d.getCursor(o/a,1-s/i):"move";h(e,l),R=l.split("-")[0]}}function J(n,a){if("path"===r.type){var i=function(t){return t},o=i,l=i;I?N("xanchor",r.xanchor=q(b+n)):(o=function(t){return q(H(t)+n)},B&&"date"===B.type&&(o=g.encodeDate(o))),P?N("yanchor",r.yanchor=X(A+a)):(l=function(t){return X(G(t)+a)},U&&"date"===U.type&&(l=g.encodeDate(l))),N("path",r.path=w(D,o,l))}else I?N("xanchor",r.xanchor=q(b+n)):(N("x0",r.x0=q(u+n)),N("x1",r.x1=q(v+n))),P?N("yanchor",r.yanchor=X(A+a)):(N("y0",r.y0=X(f+a)),N("y1",r.y1=X(y+a)));e.attr("d",_(t,r)),$(s,r)}function Q(n,a){if(z){var i=function(t){return t},o=i,l=i;I?N("xanchor",r.xanchor=q(b+n)):(o=function(t){return q(H(t)+n)},B&&"date"===B.type&&(o=g.encodeDate(o))),P?N("yanchor",r.yanchor=X(A+a)):(l=function(t){return X(G(t)+a)},U&&"date"===U.type&&(l=g.encodeDate(l))),N("path",r.path=w(D,o,l))}else if(F){if("resize-over-start-point"===R){var c=u+n,d=P?f-a:f+a;N("x0",r.x0=I?c:q(c)),N("y0",r.y0=P?d:X(d))}else if("resize-over-end-point"===R){var h=v+n,p=P?y-a:y+a;N("x1",r.x1=I?h:q(h)),N("y1",r.y1=P?p:X(p))}}else{var m=function(t){return-1!==R.indexOf(t)},x=m("n"),j=m("s"),V=m("w"),W=m("e"),Y=x?T+a:T,Z=j?k+a:k,J=V?M+n:M,Q=W?E+n:E;P&&(x&&(Y=T-a),j&&(Z=k-a)),(!P&&Z-Y>10||P&&Y-Z>10)&&(N(S,r[S]=P?Y:X(Y)),N(C,r[C]=P?Z:X(Z))),Q-J>10&&(N(L,r[L]=I?J:q(J)),N(O,r[O]=I?Q:q(Q)))}e.attr("d",_(t,r)),$(s,r)}function $(t,e){(I||P)&&function(){var r="path"!==e.type,n=t.selectAll(".visual-cue").data([0]);n.enter().append("path").attr({fill:"#fff","fill-rule":"evenodd",stroke:"#000","stroke-width":1}).classed("visual-cue",!0);var i=H(I?e.xanchor:a.midRange(r?[e.x0,e.x1]:g.extractPathCoords(e.path,p.paramIsX))),o=G(P?e.yanchor:a.midRange(r?[e.y0,e.y1]:g.extractPathCoords(e.path,p.paramIsY)));if(i=g.roundPositionForSharpStrokeRendering(i,1),o=g.roundPositionForSharpStrokeRendering(o,1),I&&P){var s="M"+(i-1-1)+","+(o-1-1)+"h-8v2h8 v8h2v-8 h8v-2h-8 v-8h-2 Z";n.attr("d",s)}else if(I){var l="M"+(i-1-1)+","+(o-9-1)+"v18 h2 v-18 Z";n.attr("d",l)}else{var u="M"+(i-9-1)+","+(o-1-1)+"h18 v2 h-18 Z";n.attr("d",u)}}()}function K(t){t.selectAll(".visual-cue").remove()}d.init(Y),W.node().onmousemove=Z}(t,I,l,e,r,R):!0===l.editable&&I.style("pointer-events",O||u.opacity(E)*M<=.5?"stroke":"all");I.node().addEventListener("click",(function(){return function(t,e){if(!y(t))return;var r=+e.node().getAttribute("data-index");if(r>=0){if(r===t._fullLayout._activeShapeIndex)return void A(t);t._fullLayout._activeShapeIndex=r,t._fullLayout._deactivateShape=A,v(t)}}(t,I)}))}}function x(t,e,r){var n=(r.xref+r.yref).replace(/paper/g,"").replace(/[xyz][1-9]* *domain/g,"");c.setClipUrl(t,n?"clip"+e._fullLayout._uid+n:null,e)}function _(t,e){var r,n,o,s,l,u,c,f,d=e.type,h=i.getRefType(e.xref),v=i.getRefType(e.yref),m=i.getFromId(t,e.xref),y=i.getFromId(t,e.yref),b=t._fullLayout._size;if(m?"domain"===h?n=function(t){return m._offset+m._length*t}:(r=g.shapePositionToRange(m),n=function(t){return m._offset+m.r2p(r(t,!0))}):n=function(t){return b.l+b.w*t},y?"domain"===v?s=function(t){return y._offset+y._length*(1-t)}:(o=g.shapePositionToRange(y),s=function(t){return y._offset+y.r2p(o(t,!0))}):s=function(t){return b.t+b.h*(1-t)},"path"===d)return m&&"date"===m.type&&(n=g.decodeDate(n)),y&&"date"===y.type&&(s=g.decodeDate(s)),function(t,e,r){var n=t.path,i=t.xsizemode,o=t.ysizemode,s=t.xanchor,l=t.yanchor;return n.replace(p.segmentRE,(function(t){var n=0,u=t.charAt(0),c=p.paramIsX[u],f=p.paramIsY[u],d=p.numParams[u],h=t.substr(1).replace(p.paramRE,(function(t){return c[n]?t="pixel"===i?e(s)+Number(t):e(t):f[n]&&(t="pixel"===o?r(l)-Number(t):r(t)),++n>d&&(t="X"),t}));return n>d&&(h=h.replace(/[\s,]*X.*/,""),a.log("Ignoring extra params in segment "+t)),u+h}))}(e,n,s);if("pixel"===e.xsizemode){var x=n(e.xanchor);l=x+e.x0,u=x+e.x1}else l=n(e.x0),u=n(e.x1);if("pixel"===e.ysizemode){var _=s(e.yanchor);c=_-e.y0,f=_-e.y1}else c=s(e.y0),f=s(e.y1);if("line"===d)return"M"+l+","+c+"L"+u+","+f;if("rect"===d)return"M"+l+","+c+"H"+u+"V"+f+"H"+l+"Z";var w=(l+u)/2,A=(c+f)/2,T=Math.abs(w-l),k=Math.abs(A-c),M="A"+T+","+k,E=w+T+","+A;return"M"+E+M+" 0 1,1 "+(w+","+(A-k))+M+" 0 0,1 "+E+"Z"}function w(t,e,r){return t.replace(p.segmentRE,(function(t){var n=0,a=t.charAt(0),i=p.paramIsX[a],o=p.paramIsY[a],s=p.numParams[a];return a+t.substr(1).replace(p.paramRE,(function(t){return n>=s||(i[n]?t=e(t):o[n]&&(t=r(t)),n++),t}))}))}function A(t){y(t)&&(t._fullLayout._activeShapeIndex>=0&&(l(t),delete t._fullLayout._activeShapeIndex,v(t)))}e.exports={draw:v,drawOne:b,eraseActiveShape:function(t){if(!y(t))return;l(t);var e=t._fullLayout._activeShapeIndex,r=(t.layout||{}).shapes||[];if(e=0&&f(m),r.attr("d",g(e)),k&&!d)&&(T=function(t,e){for(var r=0;r1&&(2!==t.length||"Z"!==t[1][0])&&(0===A&&(t[0][0]="M"),e[w]=t,y(),b())}}()}}function D(t,r){!function(t,r){if(e.length)for(var n=0;n0&&l0&&(s=s.transition().duration(e.transition.duration).ease(e.transition.easing)),s.attr("transform",l(o-.5*f.gripWidth,e._dims.currentValueTotalHeight))}}function S(t,e){var r=t._dims;return r.inputAreaStart+f.stepInset+(r.inputAreaLength-2*f.stepInset)*Math.min(1,Math.max(0,e))}function C(t,e){var r=t._dims;return Math.min(1,Math.max(0,(e-f.stepInset-r.inputAreaStart)/(r.inputAreaLength-2*f.stepInset-2*r.inputAreaStart)))}function L(t,e,r){var n=r._dims,a=s.ensureSingle(t,"rect",f.railTouchRectClass,(function(n){n.call(k,e,t,r).style("pointer-events","all")}));a.attr({width:n.inputAreaLength,height:Math.max(n.inputAreaWidth,f.tickOffset+r.ticklen+n.labelHeight)}).call(i.fill,r.bgcolor).attr("opacity",0),o.setTranslate(a,0,n.currentValueTotalHeight)}function O(t,e){var r=e._dims,n=r.inputAreaLength-2*f.railInset,a=s.ensureSingle(t,"rect",f.railRectClass);a.attr({width:n,height:f.railWidth,rx:f.railRadius,ry:f.railRadius,"shape-rendering":"crispEdges"}).call(i.stroke,e.bordercolor).call(i.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px"),o.setTranslate(a,f.railInset,.5*(r.inputAreaWidth-f.railWidth)+r.currentValueTotalHeight)}e.exports=function(t){var e=t._fullLayout,r=function(t,e){for(var r=t[f.name],n=[],a=0;a0?[0]:[]);function s(e){e._commandObserver&&(e._commandObserver.remove(),delete e._commandObserver),a.autoMargin(t,v(e))}if(i.enter().append("g").classed(f.containerClassName,!0).style("cursor","ew-resize"),i.exit().each((function(){n.select(this).selectAll("g."+f.groupClassName).each(s)})).remove(),0!==r.length){var l=i.selectAll("g."+f.groupClassName).data(r,m);l.enter().append("g").classed(f.groupClassName,!0),l.exit().each(s).remove();for(var u=0;u0||d<0){var m={left:[-p,0],right:[p,0],top:[0,-p],bottom:[0,p]}[x.side];e.attr("transform",l(m[0],m[1]))}}}return P.call(F),R&&(S?P.on(".opacity",null):(k=0,M=!0,P.text(y).on("mouseover.opacity",(function(){n.select(this).transition().duration(d.SHOW_PLACEHOLDER).style("opacity",1)})).on("mouseout.opacity",(function(){n.select(this).transition().duration(d.HIDE_PLACEHOLDER).style("opacity",0)}))),P.call(f.makeEditable,{gd:t}).on("edit",(function(e){void 0!==b?o.call("_guiRestyle",t,m,e,b):o.call("_guiRelayout",t,m,e)})).on("cancel",(function(){this.text(this.attr("data-unformatted")).call(F)})).on("input",(function(t){this.text(t||" ").call(f.positionText,_.x,_.y)}))),P.classed("js-placeholder",M),A}}},{"../../constants/alignment":470,"../../constants/interactions":474,"../../lib":498,"../../lib/svg_text_utils":523,"../../plots/plots":585,"../../registry":593,"../color":368,"../drawing":390,d3:86,"fast-isnumeric":155}],464:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),a=t("../color/attributes"),i=t("../../lib/extend").extendFlat,o=t("../../plot_api/edit_types").overrideAll,s=t("../../plots/pad_attributes"),l=t("../../plot_api/plot_template").templatedArray,u=l("button",{visible:{valType:"boolean"},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},args2:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string",dflt:""},execute:{valType:"boolean",dflt:!0}});e.exports=o(l("updatemenu",{_arrayAttrRegexps:[/^updatemenus\[(0|[1-9][0-9]+)\]\.buttons/],visible:{valType:"boolean"},type:{valType:"enumerated",values:["dropdown","buttons"],dflt:"dropdown"},direction:{valType:"enumerated",values:["left","right","up","down"],dflt:"down"},active:{valType:"integer",min:-1,dflt:0},showactive:{valType:"boolean",dflt:!0},buttons:u,x:{valType:"number",min:-2,max:3,dflt:-.05},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"right"},y:{valType:"number",min:-2,max:3,dflt:1},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top"},pad:i(s({editType:"arraydraw"}),{}),font:n({}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:a.borderLine},borderwidth:{valType:"number",min:0,dflt:1,editType:"arraydraw"}}),"arraydraw","from-root")},{"../../lib/extend":490,"../../plot_api/edit_types":529,"../../plot_api/plot_template":536,"../../plots/font_attributes":575,"../../plots/pad_attributes":584,"../color/attributes":367}],465:[function(t,e,r){"use strict";e.exports={name:"updatemenus",containerClassName:"updatemenu-container",headerGroupClassName:"updatemenu-header-group",headerClassName:"updatemenu-header",headerArrowClassName:"updatemenu-header-arrow",dropdownButtonGroupClassName:"updatemenu-dropdown-button-group",dropdownButtonClassName:"updatemenu-dropdown-button",buttonClassName:"updatemenu-button",itemRectClassName:"updatemenu-item-rect",itemTextClassName:"updatemenu-item-text",menuIndexAttrName:"updatemenu-active-index",autoMarginIdRoot:"updatemenu-",blankHeaderOpts:{label:" "},minWidth:30,minHeight:30,textPadX:24,arrowPadX:16,rx:2,ry:2,textOffsetX:12,textOffsetY:3,arrowOffsetX:4,gapButtonHeader:5,gapButton:2,activeColor:"#F4FAFF",hoverColor:"#F4FAFF",arrowSymbol:{left:"\u25c4",right:"\u25ba",up:"\u25b2",down:"\u25bc"}}},{}],466:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../plots/array_container_defaults"),i=t("./attributes"),o=t("./constants").name,s=i.buttons;function l(t,e,r){function o(r,a){return n.coerce(t,e,i,r,a)}o("visible",a(t,e,{name:"buttons",handleItemDefaults:u}).length>0)&&(o("active"),o("direction"),o("type"),o("showactive"),o("x"),o("y"),n.noneOrAll(t,e,["x","y"]),o("xanchor"),o("yanchor"),o("pad.t"),o("pad.r"),o("pad.b"),o("pad.l"),n.coerceFont(o,"font",r.font),o("bgcolor",r.paper_bgcolor),o("bordercolor"),o("borderwidth"))}function u(t,e){function r(r,a){return n.coerce(t,e,s,r,a)}r("visible","skip"===t.method||Array.isArray(t.args))&&(r("method"),r("args"),r("args2"),r("label"),r("execute"))}e.exports=function(t,e){a(t,e,{name:o,handleItemDefaults:l})}},{"../../lib":498,"../../plots/array_container_defaults":542,"./attributes":464,"./constants":465}],467:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../plots/plots"),i=t("../color"),o=t("../drawing"),s=t("../../lib"),l=t("../../lib/svg_text_utils"),u=t("../../plot_api/plot_template").arrayEditor,c=t("../../constants/alignment").LINE_SPACING,f=t("./constants"),d=t("./scrollbox");function h(t){return t._index}function p(t,e){return+t.attr(f.menuIndexAttrName)===e._index}function g(t,e,r,n,a,i,o,s){e.active=o,u(t.layout,f.name,e).applyUpdate("active",o),"buttons"===e.type?m(t,n,null,null,e):"dropdown"===e.type&&(a.attr(f.menuIndexAttrName,"-1"),v(t,n,a,i,e),s||m(t,n,a,i,e))}function v(t,e,r,n,a){var i=s.ensureSingle(e,"g",f.headerClassName,(function(t){t.style("pointer-events","all")})),l=a._dims,u=a.active,c=a.buttons[u]||f.blankHeaderOpts,d={y:a.pad.t,yPad:0,x:a.pad.l,xPad:0,index:0},h={width:l.headerWidth,height:l.headerHeight};i.call(y,a,c,t).call(M,a,d,h),s.ensureSingle(e,"text",f.headerArrowClassName,(function(t){t.attr("text-anchor","end").call(o.font,a.font).text(f.arrowSymbol[a.direction])})).attr({x:l.headerWidth-f.arrowOffsetX+a.pad.l,y:l.headerHeight/2+f.textOffsetY+a.pad.t}),i.on("click",(function(){r.call(E,String(p(r,a)?-1:a._index)),m(t,e,r,n,a)})),i.on("mouseover",(function(){i.call(w)})),i.on("mouseout",(function(){i.call(A,a)})),o.setTranslate(e,l.lx,l.ly)}function m(t,e,r,i,o){r||(r=e).attr("pointer-events","all");var l=function(t){return-1==+t.attr(f.menuIndexAttrName)}(r)&&"buttons"!==o.type?[]:o.buttons,u="dropdown"===o.type?f.dropdownButtonClassName:f.buttonClassName,c=r.selectAll("g."+u).data(s.filterVisible(l)),d=c.enter().append("g").classed(u,!0),h=c.exit();"dropdown"===o.type?(d.attr("opacity","0").transition().attr("opacity","1"),h.transition().attr("opacity","0").remove()):h.remove();var p=0,v=0,m=o._dims,b=-1!==["up","down"].indexOf(o.direction);"dropdown"===o.type&&(b?v=m.headerHeight+f.gapButtonHeader:p=m.headerWidth+f.gapButtonHeader),"dropdown"===o.type&&"up"===o.direction&&(v=-f.gapButtonHeader+f.gapButton-m.openHeight),"dropdown"===o.type&&"left"===o.direction&&(p=-f.gapButtonHeader+f.gapButton-m.openWidth);var x={x:m.lx+p+o.pad.l,y:m.ly+v+o.pad.t,yPad:f.gapButton,xPad:f.gapButton,index:0},T={l:x.x+o.borderwidth,t:x.y+o.borderwidth};c.each((function(s,l){var u=n.select(this);u.call(y,o,s,t).call(M,o,x),u.on("click",(function(){n.event.defaultPrevented||(s.execute&&(s.args2&&o.active===l?(g(t,o,0,e,r,i,-1),a.executeAPICommand(t,s.method,s.args2)):(g(t,o,0,e,r,i,l),a.executeAPICommand(t,s.method,s.args))),t.emit("plotly_buttonclicked",{menu:o,button:s,active:o.active}))})),u.on("mouseover",(function(){u.call(w)})),u.on("mouseout",(function(){u.call(A,o),c.call(_,o)}))})),c.call(_,o),b?(T.w=Math.max(m.openWidth,m.headerWidth),T.h=x.y-T.t):(T.w=x.x-T.l,T.h=Math.max(m.openHeight,m.headerHeight)),T.direction=o.direction,i&&(c.size()?function(t,e,r,n,a,i){var o,s,l,u=a.direction,c="up"===u||"down"===u,d=a._dims,h=a.active;if(c)for(s=0,l=0;l0?[0]:[]);if(o.enter().append("g").classed(f.containerClassName,!0).style("cursor","pointer"),o.exit().each((function(){n.select(this).selectAll("g."+f.headerGroupClassName).each(i)})).remove(),0!==r.length){var l=o.selectAll("g."+f.headerGroupClassName).data(r,h);l.enter().append("g").classed(f.headerGroupClassName,!0);for(var u=s.ensureSingle(o,"g",f.dropdownButtonGroupClassName,(function(t){t.style("pointer-events","all")})),c=0;cw,k=s.barLength+2*s.barPad,M=s.barWidth+2*s.barPad,E=p,S=v+m;S+M>u&&(S=u-M);var C=this.container.selectAll("rect.scrollbar-horizontal").data(T?[0]:[]);C.exit().on(".drag",null).remove(),C.enter().append("rect").classed("scrollbar-horizontal",!0).call(a.fill,s.barColor),T?(this.hbar=C.attr({rx:s.barRadius,ry:s.barRadius,x:E,y:S,width:k,height:M}),this._hbarXMin=E+k/2,this._hbarTranslateMax=w-k):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var L=m>A,O=s.barWidth+2*s.barPad,D=s.barLength+2*s.barPad,R=p+g,I=v;R+O>l&&(R=l-O);var P=this.container.selectAll("rect.scrollbar-vertical").data(L?[0]:[]);P.exit().on(".drag",null).remove(),P.enter().append("rect").classed("scrollbar-vertical",!0).call(a.fill,s.barColor),L?(this.vbar=P.attr({rx:s.barRadius,ry:s.barRadius,x:R,y:I,width:O,height:D}),this._vbarYMin=I+D/2,this._vbarTranslateMax=A-D):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var F=this.id,z=c-.5,N=L?f+O+.5:f+.5,B=d-.5,j=T?h+M+.5:h+.5,U=o._topdefs.selectAll("#"+F).data(T||L?[0]:[]);if(U.exit().remove(),U.enter().append("clipPath").attr("id",F).append("rect"),T||L?(this._clipRect=U.select("rect").attr({x:Math.floor(z),y:Math.floor(B),width:Math.ceil(N)-Math.floor(z),height:Math.ceil(j)-Math.floor(B)}),this.container.call(i.setClipUrl,F,this.gd),this.bg.attr({x:p,y:v,width:g,height:m})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(i.setClipUrl,null),delete this._clipRect),T||L){var V=n.behavior.drag().on("dragstart",(function(){n.event.sourceEvent.preventDefault()})).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(V);var H=n.behavior.drag().on("dragstart",(function(){n.event.sourceEvent.preventDefault(),n.event.sourceEvent.stopPropagation()})).on("drag",this._onBarDrag.bind(this));T&&this.hbar.on(".drag",null).call(H),L&&this.vbar.on(".drag",null).call(H)}this.setTranslate(e,r)},s.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(i.setClipUrl,null),delete this._clipRect),this.hbar&&(this.hbar.on(".drag",null),this.hbar.remove(),delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax),this.vbar&&(this.vbar.on(".drag",null),this.vbar.remove(),delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax)},s.prototype._onBoxDrag=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t-=n.event.dx),this.vbar&&(e-=n.event.dy),this.setTranslate(t,e)},s.prototype._onBoxWheel=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t+=n.event.deltaY),this.vbar&&(e+=n.event.deltaY),this.setTranslate(t,e)},s.prototype._onBarDrag=function(){var t=this.translateX,e=this.translateY;if(this.hbar){var r=t+this._hbarXMin,a=r+this._hbarTranslateMax;t=(o.constrain(n.event.x,r,a)-r)/(a-r)*(this.position.w-this._box.w)}if(this.vbar){var i=e+this._vbarYMin,s=i+this._vbarTranslateMax;e=(o.constrain(n.event.y,i,s)-i)/(s-i)*(this.position.h-this._box.h)}this.setTranslate(t,e)},s.prototype.setTranslate=function(t,e){var r=this.position.w-this._box.w,n=this.position.h-this._box.h;if(t=o.constrain(t||0,0,r),e=o.constrain(e||0,0,n),this.translateX=t,this.translateY=e,this.container.call(i.setTranslate,this._box.l-this.position.l-t,this._box.t-this.position.t-e),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+t-.5),y:Math.floor(this.position.t+e-.5)}),this.hbar){var a=t/r;this.hbar.call(i.setTranslate,t+a*this._hbarTranslateMax,e)}if(this.vbar){var s=e/n;this.vbar.call(i.setTranslate,t,e+s*this._vbarTranslateMax)}}},{"../../lib":498,"../color":368,"../drawing":390,d3:86}],470:[function(t,e,r){"use strict";e.exports={FROM_BL:{left:0,center:.5,right:1,bottom:0,middle:.5,top:1},FROM_TL:{left:0,center:.5,right:1,bottom:1,middle:.5,top:0},FROM_BR:{left:1,center:.5,right:0,bottom:0,middle:.5,top:1},LINE_SPACING:1.3,CAP_SHIFT:.7,MID_SHIFT:.35,OPPOSITE_SIDE:{left:"right",right:"left",top:"bottom",bottom:"top"}}},{}],471:[function(t,e,r){"use strict";e.exports={axisRefDescription:function(t,e,r){return["If set to a",t,"axis id (e.g. *"+t+"* or","*"+t+"2*), the `"+t+"` position refers to a",t,"coordinate. If set to *paper*, the `"+t+"`","position refers to the distance from the",e,"of the plotting","area in normalized coordinates where *0* (*1*) corresponds to the",e,"("+r+"). If set to a",t,"axis ID followed by","*domain* (separated by a space), the position behaves like for","*paper*, but refers to the distance in fractions of the domain","length from the",e,"of the domain of that axis: e.g.,","*"+t+"2 domain* refers to the domain of the second",t," axis and a",t,"position of 0.5 refers to the","point between the",e,"and the",r,"of the domain of the","second",t,"axis."].join(" ")}}},{}],472:[function(t,e,r){"use strict";e.exports={FORMAT_LINK:"https://github.com/d3/d3-3.x-api-reference/blob/master/Formatting.md#d3_format",DATE_FORMAT_LINK:"https://github.com/d3/d3-time-format#locale_format"}},{}],473:[function(t,e,r){"use strict";e.exports={COMPARISON_OPS:["=","!=","<",">=",">","<="],COMPARISON_OPS2:["=","<",">=",">","<="],INTERVAL_OPS:["[]","()","[)","(]","][",")(","](",")["],SET_OPS:["{}","}{"],CONSTRAINT_REDUCTION:{"=":"=","<":"<","<=":"<",">":">",">=":">","[]":"[]","()":"[]","[)":"[]","(]":"[]","][":"][",")(":"][","](":"][",")[":"]["}}},{}],474:[function(t,e,r){"use strict";e.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DESELECTDIM:.2}},{}],475:[function(t,e,r){"use strict";e.exports={BADNUM:void 0,FP_SAFE:Number.MAX_VALUE/1e4,ONEMAXYEAR:316224e5,ONEAVGYEAR:315576e5,ONEMINYEAR:31536e6,ONEMAXQUARTER:79488e5,ONEAVGQUARTER:78894e5,ONEMINQUARTER:76896e5,ONEMAXMONTH:26784e5,ONEAVGMONTH:26298e5,ONEMINMONTH:24192e5,ONEWEEK:6048e5,ONEDAY:864e5,ONEHOUR:36e5,ONEMIN:6e4,ONESEC:1e3,EPOCHJD:2440587.5,ALMOST_EQUAL:.999999,LOG_CLIP:10,MINUS_SIGN:"\u2212"}},{}],476:[function(t,e,r){"use strict";r.xmlns="http://www.w3.org/2000/xmlns/",r.svg="http://www.w3.org/2000/svg",r.xlink="http://www.w3.org/1999/xlink",r.svgAttrs={xmlns:r.svg,"xmlns:xlink":r.xlink}},{}],477:[function(t,e,r){"use strict";r.version=t("./version").version,t("es6-promise").polyfill(),t("../build/plotcss"),t("./fonts/mathjax_config")();for(var n=t("./registry"),a=r.register=n.register,i=t("./plot_api"),o=Object.keys(i),s=0;splotly-logomark"}}},{}],480:[function(t,e,r){"use strict";r.isLeftAnchor=function(t){return"left"===t.xanchor||"auto"===t.xanchor&&t.x<=1/3},r.isCenterAnchor=function(t){return"center"===t.xanchor||"auto"===t.xanchor&&t.x>1/3&&t.x<2/3},r.isRightAnchor=function(t){return"right"===t.xanchor||"auto"===t.xanchor&&t.x>=2/3},r.isTopAnchor=function(t){return"top"===t.yanchor||"auto"===t.yanchor&&t.y>=2/3},r.isMiddleAnchor=function(t){return"middle"===t.yanchor||"auto"===t.yanchor&&t.y>1/3&&t.y<2/3},r.isBottomAnchor=function(t){return"bottom"===t.yanchor||"auto"===t.yanchor&&t.y<=1/3}},{}],481:[function(t,e,r){"use strict";var n=t("./mod"),a=n.mod,i=n.modHalf,o=Math.PI,s=2*o;function l(t){return Math.abs(t[1]-t[0])>s-1e-14}function u(t,e){return i(e-t,s)}function c(t,e){if(l(e))return!0;var r,n;e[0](n=a(n,s))&&(n+=s);var i=a(t,s),o=i+s;return i>=r&&i<=n||o>=r&&o<=n}function f(t,e,r,n,a,i,u){a=a||0,i=i||0;var c,f,d,h,p,g=l([r,n]);function v(t,e){return[t*Math.cos(e)+a,i-t*Math.sin(e)]}g?(c=0,f=o,d=s):r=a&&t<=i);var a,i},pathArc:function(t,e,r,n,a){return f(null,t,e,r,n,a,0)},pathSector:function(t,e,r,n,a){return f(null,t,e,r,n,a,1)},pathAnnulus:function(t,e,r,n,a,i){return f(t,e,r,n,a,i,1)}}},{"./mod":505}],482:[function(t,e,r){"use strict";var n=Array.isArray,a="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer:{isView:function(){return!1}},i="undefined"==typeof DataView?function(){}:DataView;function o(t){return a.isView(t)&&!(t instanceof i)}function s(t){return n(t)||o(t)}function l(t,e,r){if(s(t)){if(s(t[0])){for(var n=r,a=0;aa.max?e.set(r):e.set(+t)}},integer:{coerceFunction:function(t,e,r,a){t%1||!n(t)||void 0!==a.min&&ta.max?e.set(r):e.set(+t)}},string:{coerceFunction:function(t,e,r,n){if("string"!=typeof t){var a="number"==typeof t;!0!==n.strict&&a?e.set(String(t)):e.set(r)}else n.noBlank&&!t?e.set(r):e.set(t)}},color:{coerceFunction:function(t,e,r){a(t).isValid()?e.set(t):e.set(r)}},colorlist:{coerceFunction:function(t,e,r){Array.isArray(t)&&t.length&&t.every((function(t){return a(t).isValid()}))?e.set(t):e.set(r)}},colorscale:{coerceFunction:function(t,e,r){e.set(o.get(t,r))}},angle:{coerceFunction:function(t,e,r){"auto"===t?e.set("auto"):n(t)?e.set(c(+t,360)):e.set(r)}},subplotid:{coerceFunction:function(t,e,r,n){var a=n.regex||u(r);"string"==typeof t&&a.test(t)?e.set(t):e.set(r)},validateFunction:function(t,e){var r=e.dflt;return t===r||"string"==typeof t&&!!u(r).test(t)}},flaglist:{coerceFunction:function(t,e,r,n){if("string"==typeof t)if(-1===(n.extras||[]).indexOf(t)){for(var a=t.split("+"),i=0;i=n&&t<=a?t:c}if("string"!=typeof t&&"number"!=typeof t)return c;t=String(t);var u=_(e),m=t.charAt(0);!u||"G"!==m&&"g"!==m||(t=t.substr(1),e="");var w=u&&"chinese"===e.substr(0,7),A=t.match(w?b:y);if(!A)return c;var T=A[1],k=A[3]||"1",M=Number(A[5]||1),E=Number(A[7]||0),S=Number(A[9]||0),C=Number(A[11]||0);if(u){if(2===T.length)return c;var L;T=Number(T);try{var O=v.getComponentMethod("calendars","getCal")(e);if(w){var D="i"===k.charAt(k.length-1);k=parseInt(k,10),L=O.newDate(T,O.toMonthIndex(T,k,D),M)}else L=O.newDate(T,Number(k),M)}catch(t){return c}return L?(L.toJD()-g)*f+E*d+S*h+C*p:c}T=2===T.length?(Number(T)+2e3-x)%100+x:Number(T),k-=1;var R=new Date(Date.UTC(2e3,k,M,E,S));return R.setUTCFullYear(T),R.getUTCMonth()!==k||R.getUTCDate()!==M?c:R.getTime()+C*p},n=r.MIN_MS=r.dateTime2ms("-9999"),a=r.MAX_MS=r.dateTime2ms("9999-12-31 23:59:59.9999"),r.isDateTime=function(t,e){return r.dateTime2ms(t,e)!==c};var A=90*f,T=3*d,k=5*h;function M(t,e,r,n,a){if((e||r||n||a)&&(t+=" "+w(e,2)+":"+w(r,2),(n||a)&&(t+=":"+w(n,2),a))){for(var i=4;a%10==0;)i-=1,a/=10;t+="."+w(a,i)}return t}r.ms2DateTime=function(t,e,r){if("number"!=typeof t||!(t>=n&&t<=a))return c;e||(e=0);var i,o,s,u,y,b,x=Math.floor(10*l(t+.05,1)),w=Math.round(t-x/10);if(_(r)){var E=Math.floor(w/f)+g,S=Math.floor(l(t,f));try{i=v.getComponentMethod("calendars","getCal")(r).fromJD(E).formatDate("yyyy-mm-dd")}catch(t){i=m("G%Y-%m-%d")(new Date(w))}if("-"===i.charAt(0))for(;i.length<11;)i="-0"+i.substr(1);else for(;i.length<10;)i="0"+i;o=e=n+f&&t<=a-f))return c;var e=Math.floor(10*l(t+.05,1)),r=new Date(Math.round(t-e/10));return M(i("%Y-%m-%d")(r),r.getHours(),r.getMinutes(),r.getSeconds(),10*r.getUTCMilliseconds()+e)},r.cleanDate=function(t,e,n){if(t===c)return e;if(r.isJSDate(t)||"number"==typeof t&&isFinite(t)){if(_(n))return s.error("JS Dates and milliseconds are incompatible with world calendars",t),e;if(!(t=r.ms2DateTimeLocal(+t))&&void 0!==e)return e}else if(!r.isDateTime(t,n))return s.error("unrecognized date",t),e;return t};var E=/%\d?f/g;function S(t,e,r,n){t=t.replace(E,(function(t){var r=Math.min(+t.charAt(1)||6,6);return(e/1e3%1+2).toFixed(r).substr(2).replace(/0+$/,"")||"0"}));var a=new Date(Math.floor(e+.05));if(_(n))try{t=v.getComponentMethod("calendars","worldCalFmt")(t,e,n)}catch(t){return"Invalid"}return r(t)(a)}var C=[59,59.9,59.99,59.999,59.9999];r.formatDate=function(t,e,r,n,a,i){if(a=_(a)&&a,!e)if("y"===r)e=i.year;else if("m"===r)e=i.month;else{if("d"!==r)return function(t,e){var r=l(t+.05,f),n=w(Math.floor(r/d),2)+":"+w(l(Math.floor(r/h),60),2);if("M"!==e){o(e)||(e=0);var a=(100+Math.min(l(t/p,60),C[e])).toFixed(e).substr(1);e>0&&(a=a.replace(/0+$/,"").replace(/[\.]$/,"")),n+=":"+a}return n}(t,r)+"\n"+S(i.dayMonthYear,t,n,a);e=i.dayMonth+"\n"+i.year}return S(e,t,n,a)};var L=3*f;r.incrementMonth=function(t,e,r){r=_(r)&&r;var n=l(t,f);if(t=Math.round(t-n),r)try{var a=Math.round(t/f)+g,i=v.getComponentMethod("calendars","getCal")(r),o=i.fromJD(a);return e%12?i.add(o,e,"m"):i.add(o,e/12,"y"),(o.toJD()-g)*f+n}catch(e){s.error("invalid ms "+t+" in calendar "+r)}var u=new Date(t+L);return u.setUTCMonth(u.getUTCMonth()+e)+n-L},r.findExactDates=function(t,e){for(var r,n,a=0,i=0,s=0,l=0,u=_(e)&&v.getComponentMethod("calendars","getCal")(e),c=0;c1||g<0||g>1?null:{x:t+l*g,y:e+f*g}}function l(t,e,r,n,a){var i=n*t+a*e;if(i<0)return n*n+a*a;if(i>r){var o=n-t,s=a-e;return o*o+s*s}var l=n*e-a*t;return l*l/r}r.segmentsIntersect=s,r.segmentDistance=function(t,e,r,n,a,i,o,u){if(s(t,e,r,n,a,i,o,u))return 0;var c=r-t,f=n-e,d=o-a,h=u-i,p=c*c+f*f,g=d*d+h*h,v=Math.min(l(c,f,p,a-t,i-e),l(c,f,p,o-t,u-e),l(d,h,g,t-a,e-i),l(d,h,g,r-a,n-i));return Math.sqrt(v)},r.getTextLocation=function(t,e,r,s){if(t===a&&s===i||(n={},a=t,i=s),n[r])return n[r];var l=t.getPointAtLength(o(r-s/2,e)),u=t.getPointAtLength(o(r+s/2,e)),c=Math.atan((u.y-l.y)/(u.x-l.x)),f=t.getPointAtLength(o(r,e)),d={x:(4*f.x+l.x+u.x)/6,y:(4*f.y+l.y+u.y)/6,theta:c};return n[r]=d,d},r.clearLocationCache=function(){a=null},r.getVisibleSegment=function(t,e,r){var n,a,i=e.left,o=e.right,s=e.top,l=e.bottom,u=0,c=t.getTotalLength(),f=c;function d(e){var r=t.getPointAtLength(e);0===e?n=r:e===c&&(a=r);var u=r.xo?r.x-o:0,f=r.yl?r.y-l:0;return Math.sqrt(u*u+f*f)}for(var h=d(u);h;){if((u+=h+r)>f)return;h=d(u)}for(h=d(f);h;){if(u>(f-=h+r))return;h=d(f)}return{min:u,max:f,len:f-u,total:c,isClosed:0===u&&f===c&&Math.abs(n.x-a.x)<.1&&Math.abs(n.y-a.y)<.1}},r.findPointOnPath=function(t,e,r,n){for(var a,i,o,s=(n=n||{}).pathLength||t.getTotalLength(),l=n.tolerance||.001,u=n.iterationLimit||30,c=t.getPointAtLength(0)[r]>t.getPointAtLength(s)[r]?-1:1,f=0,d=0,h=s;f0?h=a:d=a,f++}return i}},{"./mod":505}],494:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("tinycolor2"),i=t("color-normalize"),o=t("../components/colorscale"),s=t("../components/color/attributes").defaultLine,l=t("./array").isArrayOrTypedArray,u=i(s);function c(t,e){var r=t;return r[3]*=e,r}function f(t){if(n(t))return u;var e=i(t);return e.length?e:u}function d(t){return n(t)?t:1}e.exports={formatColor:function(t,e,r){var n,a,s,h,p,g=t.color,v=l(g),m=l(e),y=o.extractOpts(t),b=[];if(n=void 0!==y.colorscale?o.makeColorScaleFuncFromTrace(t):f,a=v?function(t,e){return void 0===t[e]?u:i(n(t[e]))}:f,s=m?function(t,e){return void 0===t[e]?1:d(t[e])}:d,v||m)for(var x=0;x1?(r*t+r*e)/r:t+e,a=String(n).length;if(a>16){var i=String(e).length;if(a>=String(t).length+i){var o=parseFloat(n).toPrecision(12);-1===o.indexOf("e+")&&(n=+o)}}return n}},{}],498:[function(t,e,r){"use strict";var n=t("d3"),a=t("d3-time-format").utcFormat,i=t("fast-isnumeric"),o=t("../constants/numerical"),s=o.FP_SAFE,l=o.BADNUM,u=e.exports={};u.nestedProperty=t("./nested_property"),u.keyedContainer=t("./keyed_container"),u.relativeAttr=t("./relative_attr"),u.isPlainObject=t("./is_plain_object"),u.toLogRange=t("./to_log_range"),u.relinkPrivateKeys=t("./relink_private");var c=t("./array");u.isTypedArray=c.isTypedArray,u.isArrayOrTypedArray=c.isArrayOrTypedArray,u.isArray1D=c.isArray1D,u.ensureArray=c.ensureArray,u.concat=c.concat,u.maxRowLength=c.maxRowLength,u.minRowLength=c.minRowLength;var f=t("./mod");u.mod=f.mod,u.modHalf=f.modHalf;var d=t("./coerce");u.valObjectMeta=d.valObjectMeta,u.coerce=d.coerce,u.coerce2=d.coerce2,u.coerceFont=d.coerceFont,u.coerceHoverinfo=d.coerceHoverinfo,u.coerceSelectionMarkerOpacity=d.coerceSelectionMarkerOpacity,u.validate=d.validate;var h=t("./dates");u.dateTime2ms=h.dateTime2ms,u.isDateTime=h.isDateTime,u.ms2DateTime=h.ms2DateTime,u.ms2DateTimeLocal=h.ms2DateTimeLocal,u.cleanDate=h.cleanDate,u.isJSDate=h.isJSDate,u.formatDate=h.formatDate,u.incrementMonth=h.incrementMonth,u.dateTick0=h.dateTick0,u.dfltRange=h.dfltRange,u.findExactDates=h.findExactDates,u.MIN_MS=h.MIN_MS,u.MAX_MS=h.MAX_MS;var p=t("./search");u.findBin=p.findBin,u.sorterAsc=p.sorterAsc,u.sorterDes=p.sorterDes,u.distinctVals=p.distinctVals,u.roundUp=p.roundUp,u.sort=p.sort,u.findIndexOfMin=p.findIndexOfMin;var g=t("./stats");u.aggNums=g.aggNums,u.len=g.len,u.mean=g.mean,u.median=g.median,u.midRange=g.midRange,u.variance=g.variance,u.stdev=g.stdev,u.interp=g.interp;var v=t("./matrix");u.init2dArray=v.init2dArray,u.transposeRagged=v.transposeRagged,u.dot=v.dot,u.translationMatrix=v.translationMatrix,u.rotationMatrix=v.rotationMatrix,u.rotationXYMatrix=v.rotationXYMatrix,u.apply3DTransform=v.apply3DTransform,u.apply2DTransform=v.apply2DTransform,u.apply2DTransform2=v.apply2DTransform2,u.convertCssMatrix=v.convertCssMatrix,u.inverseTransformMatrix=v.inverseTransformMatrix;var m=t("./angles");u.deg2rad=m.deg2rad,u.rad2deg=m.rad2deg,u.angleDelta=m.angleDelta,u.angleDist=m.angleDist,u.isFullCircle=m.isFullCircle,u.isAngleInsideSector=m.isAngleInsideSector,u.isPtInsideSector=m.isPtInsideSector,u.pathArc=m.pathArc,u.pathSector=m.pathSector,u.pathAnnulus=m.pathAnnulus;var y=t("./anchor_utils");u.isLeftAnchor=y.isLeftAnchor,u.isCenterAnchor=y.isCenterAnchor,u.isRightAnchor=y.isRightAnchor,u.isTopAnchor=y.isTopAnchor,u.isMiddleAnchor=y.isMiddleAnchor,u.isBottomAnchor=y.isBottomAnchor;var b=t("./geometry2d");u.segmentsIntersect=b.segmentsIntersect,u.segmentDistance=b.segmentDistance,u.getTextLocation=b.getTextLocation,u.clearLocationCache=b.clearLocationCache,u.getVisibleSegment=b.getVisibleSegment,u.findPointOnPath=b.findPointOnPath;var x=t("./extend");u.extendFlat=x.extendFlat,u.extendDeep=x.extendDeep,u.extendDeepAll=x.extendDeepAll,u.extendDeepNoArrays=x.extendDeepNoArrays;var _=t("./loggers");u.log=_.log,u.warn=_.warn,u.error=_.error;var w=t("./regex");u.counterRegex=w.counter;var A=t("./throttle");u.throttle=A.throttle,u.throttleDone=A.done,u.clearThrottle=A.clear;var T=t("./dom");function k(t){var e={};for(var r in t)for(var n=t[r],a=0;as?l:i(t)?Number(t):l:l},u.isIndex=function(t,e){return!(void 0!==e&&t>=e)&&(i(t)&&t>=0&&t%1==0)},u.noop=t("./noop"),u.identity=t("./identity"),u.repeat=function(t,e){for(var r=new Array(e),n=0;nr?Math.max(r,Math.min(e,t)):Math.max(e,Math.min(r,t))},u.bBoxIntersect=function(t,e,r){return r=r||0,t.left<=e.right+r&&e.left<=t.right+r&&t.top<=e.bottom+r&&e.top<=t.bottom+r},u.simpleMap=function(t,e,r,n,a){for(var i=t.length,o=new Array(i),s=0;s=Math.pow(2,r)?a>10?(u.warn("randstr failed uniqueness"),l):t(e,r,n,(a||0)+1):l},u.OptionControl=function(t,e){t||(t={}),e||(e="opt");var r={optionList:[],_newoption:function(n){n[e]=t,r[n.name]=n,r.optionList.push(n)}};return r["_"+e]=t,r},u.smooth=function(t,e){if((e=Math.round(e)||0)<2)return t;var r,n,a,i,o=t.length,s=2*o,l=2*e-1,u=new Array(l),c=new Array(o);for(r=0;r=s&&(a-=s*Math.floor(a/s)),a<0?a=-1-a:a>=o&&(a=s-1-a),i+=t[a]*u[n];c[r]=i}return c},u.syncOrAsync=function(t,e,r){var n;function a(){return u.syncOrAsync(t,e,r)}for(;t.length;)if((n=(0,t.splice(0,1)[0])(e))&&n.then)return n.then(a).then(void 0,u.promiseError);return r&&r(e)},u.stripTrailingSlash=function(t){return"/"===t.substr(-1)?t.substr(0,t.length-1):t},u.noneOrAll=function(t,e,r){if(t){var n,a=!1,i=!0;for(n=0;n0?e:0}))},u.fillArray=function(t,e,r,n){if(n=n||u.identity,u.isArrayOrTypedArray(t))for(var a=0;a1?a+o[1]:"";if(i&&(o.length>1||s.length>4||r))for(;n.test(s);)s=s.replace(n,"$1"+i+"$2");return s+l},u.TEMPLATE_STRING_REGEX=/%{([^\s%{}:]*)([:|\|][^}]*)?}/g;var O=/^\w*$/;u.templateString=function(t,e){var r={};return t.replace(u.TEMPLATE_STRING_REGEX,(function(t,n){var a;return O.test(n)?a=e[n]:(r[n]=r[n]||u.nestedProperty(e,n).get,a=r[n]()),u.isValidTextValue(a)?a:""}))};var D={max:10,count:0,name:"hovertemplate"};u.hovertemplateString=function(){return P.apply(D,arguments)};var R={max:10,count:0,name:"texttemplate"};u.texttemplateString=function(){return P.apply(R,arguments)};var I=/^[:|\|]/;function P(t,e,r){var i=this,o=arguments;e||(e={});var s={};return t.replace(u.TEMPLATE_STRING_REGEX,(function(t,l,c){var f,d,h,p;for(h=3;h=48&&o<=57,u=s>=48&&s<=57;if(l&&(n=10*n+o-48),u&&(a=10*a+s-48),!l||!u){if(n!==a)return n-a;if(o!==s)return o-s}}return a-n};var F=2e9;u.seedPseudoRandom=function(){F=2e9},u.pseudoRandom=function(){var t=F;return F=(69069*F+1)%4294967296,Math.abs(F-t)<429496729?u.pseudoRandom():F/4294967296},u.fillText=function(t,e,r){var n=Array.isArray(r)?function(t){r.push(t)}:function(t){r.text=t},a=u.extractOption(t,e,"htx","hovertext");if(u.isValidTextValue(a))return n(a);var i=u.extractOption(t,e,"tx","text");return u.isValidTextValue(i)?n(i):void 0},u.isValidTextValue=function(t){return t||0===t},u.formatPercent=function(t,e){e=e||0;for(var r=(Math.round(100*t*Math.pow(10,e))*Math.pow(.1,e)).toFixed(e)+"%",n=0;n1&&(c=1):c=0,u.strTranslate(a-c*(r+o),i-c*(n+s))+u.strScale(c)+(l?"rotate("+l+(e?"":" "+r+" "+n)+")":"")},u.ensureUniformFontSize=function(t,e){var r=u.extendFlat({},e);return r.size=Math.max(e.size,t._fullLayout.uniformtext.minsize||0),r},u.join2=function(t,e,r){var n=t.length;return n>1?t.slice(0,-1).join(e)+r+t[n-1]:t.join(e)}},{"../constants/numerical":475,"./anchor_utils":480,"./angles":481,"./array":482,"./clean_number":483,"./clear_responsive":485,"./coerce":486,"./dates":487,"./dom":488,"./extend":490,"./filter_unique":491,"./filter_visible":492,"./geometry2d":493,"./identity":496,"./increment":497,"./is_plain_object":499,"./keyed_container":500,"./localize":501,"./loggers":502,"./make_trace_groups":503,"./matrix":504,"./mod":505,"./nested_property":506,"./noop":507,"./notifier":508,"./preserve_drawing_buffer":512,"./push_unique":513,"./regex":515,"./relative_attr":516,"./relink_private":517,"./search":518,"./stats":521,"./throttle":524,"./to_log_range":525,d3:86,"d3-time-format":84,"fast-isnumeric":155}],499:[function(t,e,r){"use strict";e.exports=function(t){return window&&window.process&&window.process.versions?"[object Object]"===Object.prototype.toString.call(t):"[object Object]"===Object.prototype.toString.call(t)&&Object.getPrototypeOf(t)===Object.prototype}},{}],500:[function(t,e,r){"use strict";var n=t("./nested_property"),a=/^\w*$/;e.exports=function(t,e,r,i){var o,s,l;r=r||"name",i=i||"value";var u={};e&&e.length?(l=n(t,e),s=l.get()):s=t,e=e||"";var c={};if(s)for(o=0;o2)return u[e]=2|u[e],d.set(t,null);if(f){for(o=e;o1){var e=["LOG:"];for(t=0;t1){var r=[];for(t=0;t"),"long")}},i.warn=function(){var t;if(n.logging>0){var e=["WARN:"];for(t=0;t0){var r=[];for(t=0;t"),"stick")}},i.error=function(){var t;if(n.logging>0){var e=["ERROR:"];for(t=0;t0){var r=[];for(t=0;t"),"stick")}}},{"../plot_api/plot_config":534,"./notifier":508}],503:[function(t,e,r){"use strict";var n=t("d3");e.exports=function(t,e,r){var a=t.selectAll("g."+r.replace(/\s/g,".")).data(e,(function(t){return t[0].trace.uid}));a.exit().remove(),a.enter().append("g").attr("class",r),a.order();var i=t.classed("rangeplot")?"nodeRangePlot3":"node3";return a.each((function(t){t[0][i]=n.select(this)})),a}},{d3:86}],504:[function(t,e,r){"use strict";var n=t("gl-mat4");r.init2dArray=function(t,e){for(var r=new Array(t),n=0;ne/2?t-Math.round(t/e)*e:t}}},{}],506:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("./array").isArrayOrTypedArray;function i(t,e){return function(){var r,n,o,s,l,u=t;for(s=0;s/g),l=0;li||u===a||us)&&(!e||!l(t))}:function(t,e){var l=t[0],u=t[1];if(l===a||li||u===a||us)return!1;var c,f,d,h,p,g=r.length,v=r[0][0],m=r[0][1],y=0;for(c=1;cMath.max(f,v)||u>Math.max(d,m)))if(uc||Math.abs(n(o,d))>a)return!0;return!1},i.filter=function(t,e){var r=[t[0]],n=0,a=0;function o(o){t.push(o);var s=r.length,l=n;r.splice(a+1);for(var u=l+1;u1&&o(t.pop());return{addPt:o,raw:t,filtered:r}}},{"../constants/numerical":475,"./matrix":504}],511:[function(t,e,r){(function(r){(function(){"use strict";var n=t("./show_no_webgl_msg"),a=t("regl");e.exports=function(t,e){var i=t._fullLayout,o=!0;return i._glcanvas.each((function(n){if(!n.regl&&(!n.pick||i._has("parcoords"))){try{n.regl=a({canvas:this,attributes:{antialias:!n.pick,preserveDrawingBuffer:!0},pixelRatio:t._context.plotGlPixelRatio||r.devicePixelRatio,extensions:e||[]})}catch(t){o=!1}n.regl||(o=!1),o&&this.addEventListener("webglcontextlost",(function(e){t&&t.emit&&t.emit("plotly_webglcontextlost",{event:e,layer:n.key})}),!1)}})),o||n({container:i._glcontainer.node()}),o}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./show_no_webgl_msg":520,regl:297}],512:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("is-mobile");e.exports=function(t){var e;if("string"!=typeof(e=t&&t.hasOwnProperty("userAgent")?t.userAgent:function(){var t;"undefined"!=typeof navigator&&(t=navigator.userAgent);t&&t.headers&&"string"==typeof t.headers["user-agent"]&&(t=t.headers["user-agent"]);return t}()))return!0;var r=a({ua:{headers:{"user-agent":e}},tablet:!0,featureDetect:!1});if(!r)for(var i=e.split(" "),o=1;o-1;s--){var l=i[s];if("Version/"===l.substr(0,8)){var u=l.substr(8).split(".")[0];if(n(u)&&(u=+u),u>=13)return!0}}}return r}},{"fast-isnumeric":155,"is-mobile":247}],513:[function(t,e,r){"use strict";e.exports=function(t,e){if(e instanceof RegExp){for(var r=e.toString(),n=0;na.queueLength&&(t.undoQueue.queue.shift(),t.undoQueue.index--))},startSequence:function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!0,t.undoQueue.beginSequence=!0},stopSequence:function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!1,t.undoQueue.beginSequence=!1},undo:function(t){var e,r;if(t.framework&&t.framework.isPolar)t.framework.undo();else if(!(void 0===t.undoQueue||isNaN(t.undoQueue.index)||t.undoQueue.index<=0)){for(t.undoQueue.index--,e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,r=0;r=t.undoQueue.queue.length)){for(e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,r=0;re}function c(t,e){return t>=e}r.findBin=function(t,e,r){if(n(e.start))return r?Math.ceil((t-e.start)/e.size-1e-9)-1:Math.floor((t-e.start)/e.size+1e-9);var i,o,f=0,d=e.length,h=0,p=d>1?(e[d-1]-e[0])/(d-1):1;for(o=p>=0?r?s:l:r?c:u,t+=1e-9*p*(r?-1:1)*(p>=0?1:-1);f90&&a.log("Long binary search..."),f-1},r.sorterAsc=function(t,e){return t-e},r.sorterDes=function(t,e){return e-t},r.distinctVals=function(t,e){var n,a=(e||{}).unitMinDiff,i=t.slice();for(i.sort(r.sorterAsc),n=i.length-1;n>-1&&i[n]===o;n--);var s=1;a||(s=i[n]-i[0]||1);for(var l,u=s/(n||1)/1e4,c=[],f=0;f<=n;f++){var d=i[f],h=d-l;void 0===l?(c.push(d),l=d):h>u&&(s=Math.min(s,h),c.push(d),l=d)}return{vals:c,minDiff:s}},r.roundUp=function(t,e,r){for(var n,a=0,i=e.length-1,o=0,s=r?0:1,l=r?1:0,u=r?Math.ceil:Math.floor;a0&&(n=1),r&&n)return t.sort(e)}return n?t:t.reverse()},r.findIndexOfMin=function(t,e){e=e||i;for(var r,n=1/0,a=0;ai.length)&&(o=i.length),n(e)||(e=!1),a(i[0])){for(l=new Array(o),s=0;st.length-1)return t[t.length-1];var r=e%1;return r*t[Math.ceil(e)]+(1-r)*t[Math.floor(e)]}},{"./array":482,"fast-isnumeric":155}],522:[function(t,e,r){"use strict";var n=t("color-normalize");e.exports=function(t){return t?n(t):[0,0,0,1]}},{"color-normalize":63}],523:[function(t,e,r){"use strict";var n=t("d3"),a=t("../lib"),i=a.strTranslate,o=t("../constants/xmlns_namespaces"),s=t("../constants/alignment").LINE_SPACING;function l(t,e){return t.node().getBoundingClientRect()[e]}var u=/([^$]*)([$]+[^$]*[$]+)([^$]*)/;r.convertToTspans=function(t,e,M){var E=t.text(),C=!t.attr("data-notex")&&"undefined"!=typeof MathJax&&E.match(u),L=n.select(t.node().parentNode);if(!L.empty()){var O=t.attr("class")?t.attr("class").split(" ")[0]:"text";return O+="-math",L.selectAll("svg."+O).remove(),L.selectAll("g."+O+"-group").remove(),t.style("display",null).attr({"data-unformatted":E,"data-math":"N"}),C?(e&&e._promises||[]).push(new Promise((function(e){t.style("display","none");var r=parseInt(t.node().style.fontSize,10),o={fontSize:r};!function(t,e,r){var i,o,s,l;MathJax.Hub.Queue((function(){return o=a.extendDeepAll({},MathJax.Hub.config),s=MathJax.Hub.processSectionDelay,void 0!==MathJax.Hub.processSectionDelay&&(MathJax.Hub.processSectionDelay=0),MathJax.Hub.Config({messageStyle:"none",tex2jax:{inlineMath:[["$","$"],["\\(","\\)"]]},displayAlign:"left"})}),(function(){if("SVG"!==(i=MathJax.Hub.config.menuSettings.renderer))return MathJax.Hub.setRenderer("SVG")}),(function(){var r="math-output-"+a.randstr({},64);return l=n.select("body").append("div").attr({id:r}).style({visibility:"hidden",position:"absolute"}).style({"font-size":e.fontSize+"px"}).text(t.replace(c,"\\lt ").replace(f,"\\gt ")),MathJax.Hub.Typeset(l.node())}),(function(){var e=n.select("body").select("#MathJax_SVG_glyphs");if(l.select(".MathJax_SVG").empty()||!l.select("svg").node())a.log("There was an error in the tex syntax.",t),r();else{var o=l.select("svg").node().getBoundingClientRect();r(l.select(".MathJax_SVG"),e,o)}if(l.remove(),"SVG"!==i)return MathJax.Hub.setRenderer(i)}),(function(){return void 0!==s&&(MathJax.Hub.processSectionDelay=s),MathJax.Hub.Config(o)}))}(C[2],o,(function(n,a,o){L.selectAll("svg."+O).remove(),L.selectAll("g."+O+"-group").remove();var s=n&&n.select("svg");if(!s||!s.node())return D(),void e();var u=L.append("g").classed(O+"-group",!0).attr({"pointer-events":"none","data-unformatted":E,"data-math":"Y"});u.node().appendChild(s.node()),a&&a.node()&&s.node().insertBefore(a.node().cloneNode(!0),s.node().firstChild),s.attr({class:O,height:o.height,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var c=t.node().style.fill||"black",f=s.select("g");f.attr({fill:c,stroke:c});var d=l(f,"width"),h=l(f,"height"),p=+t.attr("x")-d*{start:0,middle:.5,end:1}[t.attr("text-anchor")||"start"],g=-(r||l(t,"height"))/4;"y"===O[0]?(u.attr({transform:"rotate("+[-90,+t.attr("x"),+t.attr("y")]+")"+i(-d/2,g-h/2)}),s.attr({x:+t.attr("x"),y:+t.attr("y")})):"l"===O[0]?s.attr({x:t.attr("x"),y:g-h/2}):"a"===O[0]&&0!==O.indexOf("atitle")?s.attr({x:0,y:g}):s.attr({x:p,y:+t.attr("y")+g-h/2}),M&&M.call(t,u),e(u)}))}))):D(),t}function D(){L.empty()||(O=t.attr("class")+"-math",L.select("svg."+O).remove()),t.text("").style("white-space","pre"),function(t,e){e=e.replace(v," ");var r,i=!1,l=[],u=-1;function c(){u++;var e=document.createElementNS(o.svg,"tspan");n.select(e).attr({class:"line",dy:u*s+"em"}),t.appendChild(e),r=e;var a=l;if(l=[{node:e}],a.length>1)for(var i=1;i doesnt match end tag <"+t+">. Pretending it did match.",e),r=l[l.length-1].node}else a.log("Ignoring unexpected end tag .",e)}b.test(e)?c():(r=t,l=[{node:t}]);for(var C=e.split(m),L=0;L|>|>)/g;var d={sup:"font-size:70%",sub:"font-size:70%",b:"font-weight:bold",i:"font-style:italic",a:"cursor:pointer",span:"",em:"font-style:italic;font-weight:bold"},h={sub:"0.3em",sup:"-0.6em"},p={sub:"-0.21em",sup:"0.42em"},g=["http:","https:","mailto:","",void 0,":"],v=r.NEWLINES=/(\r\n?|\n)/g,m=/(<[^<>]*>)/,y=/<(\/?)([^ >]*)(\s+(.*))?>/i,b=//i;r.BR_TAG_ALL=//gi;var x=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,_=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,w=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,A=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i;function T(t,e){if(!t)return null;var r=t.match(e),n=r&&(r[3]||r[4]);return n&&S(n)}var k=/(^|;)\s*color:/;r.plainText=function(t,e){for(var r=void 0!==(e=e||{}).len&&-1!==e.len?e.len:1/0,n=void 0!==e.allowedTags?e.allowedTags:["br"],a="...".length,i=t.split(m),o=[],s="",l=0,u=0;ua?o.push(c.substr(0,p-a)+"..."):o.push(c.substr(0,p));break}s=""}}return o.join("")};var M={mu:"\u03bc",amp:"&",lt:"<",gt:">",nbsp:"\xa0",times:"\xd7",plusmn:"\xb1",deg:"\xb0"},E=/&(#\d+|#x[\da-fA-F]+|[a-z]+);/g;function S(t){return t.replace(E,(function(t,e){return("#"===e.charAt(0)?function(t){if(t>1114111)return;var e=String.fromCodePoint;if(e)return e(t);var r=String.fromCharCode;return t<=65535?r(t):r(55232+(t>>10),t%1024+56320)}("x"===e.charAt(1)?parseInt(e.substr(2),16):parseInt(e.substr(1),10)):M[e])||t}))}function C(t,e,r){var n,i,o,s=r.horizontalAlign,l=r.verticalAlign||"top",u=t.node().getBoundingClientRect(),c=e.node().getBoundingClientRect();return i="bottom"===l?function(){return u.bottom-n.height}:"middle"===l?function(){return u.top+(u.height-n.height)/2}:function(){return u.top},o="right"===s?function(){return u.right-n.width}:"center"===s?function(){return u.left+(u.width-n.width)/2}:function(){return u.left},function(){n=this.node().getBoundingClientRect();var t=o()-c.left,e=i()-c.top,s=r.gd||{};if(r.gd){s._fullLayout._calcInverseTransform(s);var l=a.apply3DTransform(s._fullLayout._invTransform)(t,e);t=l[0],e=l[1]}return this.style({top:e+"px",left:t+"px","z-index":1e3}),this}}r.convertEntities=S,r.sanitizeHTML=function(t){t=t.replace(v," ");for(var e=document.createElement("p"),r=e,a=[],i=t.split(m),o=0;oi.ts+e?l():i.timer=setTimeout((function(){l(),i.timer=null}),e)},r.done=function(t){var e=n[t];return e&&e.timer?new Promise((function(t){var r=e.onDone;e.onDone=function(){r&&r(),t(),e.onDone=null}})):Promise.resolve()},r.clear=function(t){if(t)a(n[t]),delete n[t];else for(var e in n)r.clear(e)}},{}],525:[function(t,e,r){"use strict";var n=t("fast-isnumeric");e.exports=function(t,e){if(t>0)return Math.log(t)/Math.LN10;var r=Math.log(Math.min(e[0],e[1]))/Math.LN10;return n(r)||(r=Math.log(Math.max(e[0],e[1]))/Math.LN10-6),r}},{"fast-isnumeric":155}],526:[function(t,e,r){"use strict";e.exports={moduleType:"locale",name:"en-US",dictionary:{"Click to enter Colorscale title":"Click to enter Colorscale title"},format:{date:"%m/%d/%Y"}}},{}],527:[function(t,e,r){"use strict";e.exports={moduleType:"locale",name:"en",dictionary:{"Click to enter Colorscale title":"Click to enter Colourscale title"},format:{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"],periods:["AM","PM"],dateTime:"%a %b %e %X %Y",date:"%d/%m/%Y",time:"%H:%M:%S",decimal:".",thousands:",",grouping:[3],currency:["$",""],year:"%Y",month:"%b %Y",dayMonth:"%b %-d",dayMonthYear:"%b %-d, %Y"}}},{}],528:[function(t,e,r){"use strict";var n=t("../registry");e.exports=function(t){for(var e,r,a=n.layoutArrayContainers,i=n.layoutArrayRegexes,o=t.split("[")[0],s=0;s0&&o.log("Clearing previous rejected promises from queue."),t._promises=[]},r.cleanLayout=function(t){var e,n;t||(t={}),t.xaxis1&&(t.xaxis||(t.xaxis=t.xaxis1),delete t.xaxis1),t.yaxis1&&(t.yaxis||(t.yaxis=t.yaxis1),delete t.yaxis1),t.scene1&&(t.scene||(t.scene=t.scene1),delete t.scene1);var i=(s.subplotsRegistry.cartesian||{}).attrRegex,l=(s.subplotsRegistry.polar||{}).attrRegex,f=(s.subplotsRegistry.ternary||{}).attrRegex,d=(s.subplotsRegistry.gl3d||{}).attrRegex,g=Object.keys(t);for(e=0;e3?(R.x=1.02,R.xanchor="left"):R.x<-2&&(R.x=-.02,R.xanchor="right"),R.y>3?(R.y=1.02,R.yanchor="bottom"):R.y<-2&&(R.y=-.02,R.yanchor="top")),p(t),"rotate"===t.dragmode&&(t.dragmode="orbit"),u.clean(t),t.template&&t.template.layout&&r.cleanLayout(t.template.layout),t},r.cleanData=function(t){for(var e=0;e0)return t.substr(0,e)}r.hasParent=function(t,e){for(var r=x(e);r;){if(r in t)return!0;r=x(r)}return!1};var _=["x","y","z"];r.clearAxisTypes=function(t,e,r){for(var n=0;n1&&i.warn("Full array edits are incompatible with other edits",f);var y=r[""][""];if(u(y))e.set(null);else{if(!Array.isArray(y))return i.warn("Unrecognized full array edit value",f,y),!0;e.set(y)}return!g&&(d(v,m),h(t),!0)}var b,x,_,w,A,T,k,M,E=Object.keys(r).map(Number).sort(o),S=e.get(),C=S||[],L=c(m,f).get(),O=[],D=-1,R=C.length;for(b=0;bC.length-(k?0:1))i.warn("index out of range",f,_);else if(void 0!==T)A.length>1&&i.warn("Insertion & removal are incompatible with edits to the same index.",f,_),u(T)?O.push(_):k?("add"===T&&(T={}),C.splice(_,0,T),L&&L.splice(_,0,{})):i.warn("Unrecognized full object edit value",f,_,T),-1===D&&(D=_);else for(x=0;x=0;b--)C.splice(O[b],1),L&&L.splice(O[b],1);if(C.length?S||e.set(C):e.set(null),g)return!1;if(d(v,m),p!==a){var I;if(-1===D)I=E;else{for(R=Math.max(C.length,R),I=[],b=0;b=D);b++)I.push(_);for(b=D;b=t.data.length||a<-t.data.length)throw new Error(r+" must be valid indices for gd.data.");if(e.indexOf(a,n+1)>-1||a>=0&&e.indexOf(-t.data.length+a)>-1||a<0&&e.indexOf(t.data.length+a)>-1)throw new Error("each index in "+r+" must be unique.")}}function I(t,e,r){if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if("undefined"==typeof e)throw new Error("currentIndices is a required argument.");if(Array.isArray(e)||(e=[e]),R(t,e,"currentIndices"),"undefined"==typeof r||Array.isArray(r)||(r=[r]),"undefined"!=typeof r&&R(t,r,"newIndices"),"undefined"!=typeof r&&e.length!==r.length)throw new Error("current and new indices must be of equal length.")}function P(t,e,r,n,i){!function(t,e,r,n){var a=o.isPlainObject(n);if(!Array.isArray(t.data))throw new Error("gd.data must be an array");if(!o.isPlainObject(e))throw new Error("update must be a key:value object");if("undefined"==typeof r)throw new Error("indices must be an integer or array of integers");for(var i in R(t,r,"indices"),e){if(!Array.isArray(e[i])||e[i].length!==r.length)throw new Error("attribute "+i+" must be an array of length equal to indices array length");if(a&&(!(i in n)||!Array.isArray(n[i])||n[i].length!==e[i].length))throw new Error("when maxPoints is set as a key:value object it must contain a 1:1 corrispondence with the keys and number of traces in the update object")}}(t,e,r,n);for(var l=function(t,e,r,n){var i,l,u,c,f,d=o.isPlainObject(n),h=[];for(var p in Array.isArray(r)||(r=[r]),r=D(r,t.data.length-1),e)for(var g=0;g-1?l(r,r.replace("titlefont","title.font")):r.indexOf("titleposition")>-1?l(r,r.replace("titleposition","title.position")):r.indexOf("titleside")>-1?l(r,r.replace("titleside","title.side")):r.indexOf("titleoffset")>-1&&l(r,r.replace("titleoffset","title.offset")):l(r,r.replace("title","title.text"));function l(e,r){t[r]=t[e],delete t[e]}}function H(t,e,r){if(t=o.getGraphDiv(t),A.clearPromiseQueue(t),t.framework&&t.framework.isPolar)return Promise.resolve(t);var n={};if("string"==typeof e)n[e]=r;else{if(!o.isPlainObject(e))return o.warn("Relayout fail.",e,r),Promise.reject();n=o.extendFlat({},e)}Object.keys(n).length&&(t.changed=!0);var a=Z(t,n),i=a.flags;i.calc&&(t.calcdata=void 0);var s=[d.previousPromises];i.layoutReplot?s.push(T.layoutReplot):Object.keys(n).length&&(G(t,i,a)||d.supplyDefaults(t),i.legend&&s.push(T.doLegend),i.layoutstyle&&s.push(T.layoutStyles),i.axrange&&q(s,a.rangesAltered),i.ticks&&s.push(T.doTicksRelayout),i.modebar&&s.push(T.doModeBar),i.camera&&s.push(T.doCamera),i.colorbars&&s.push(T.doColorBars),s.push(S)),s.push(d.rehover,d.redrag),u.add(t,H,[t,a.undoit],H,[t,a.redoit]);var l=o.syncOrAsync(s,t);return l&&l.then||(l=Promise.resolve(t)),l.then((function(){return t.emit("plotly_relayout",a.eventData),t}))}function G(t,e,r){var n=t._fullLayout;if(!e.axrange)return!1;for(var a in e)if("axrange"!==a&&e[a])return!1;for(var i in r.rangesAltered){var o=p.id2name(i),s=t.layout[o],l=n[o];if(l.autorange=s.autorange,s.range&&(l.range=s.range.slice()),l.cleanRange(),l._matchGroup)for(var u in l._matchGroup)if(u!==i){var c=n[p.id2name(u)];c.autorange=l.autorange,c.range=l.range.slice(),c._input.range=l.range.slice()}}return!0}function q(t,e){var r=e?function(t){var r=[],n=!0;for(var a in e){var i=p.getFromId(t,a);if(r.push(a),-1!==(i.ticklabelposition||"").indexOf("inside")&&i._anchorAxis&&r.push(i._anchorAxis._id),i._matchGroup)for(var o in i._matchGroup)e[o]||r.push(o);i.automargin&&(n=!1)}return p.draw(t,r,{skipTitle:n})}:function(t){return p.draw(t,"redraw")};t.push(x,T.doAutoRangeAndConstraints,r,T.drawData,T.finalDraw)}var X=/^[xyz]axis[0-9]*\.range(\[[0|1]\])?$/,W=/^[xyz]axis[0-9]*\.autorange$/,Y=/^[xyz]axis[0-9]*\.domain(\[[0|1]\])?$/;function Z(t,e){var r,n,a,i=t.layout,l=t._fullLayout,u=l._guiEditing,d=B(l._preGUI,u),h=Object.keys(e),g=p.list(t),v=o.extendDeepAll({},e),m={};for(V(e),h=Object.keys(e),n=0;n0&&"string"!=typeof R.parts[P];)P--;var F=R.parts[P],z=R.parts[P-1]+"."+F,j=R.parts.slice(0,P).join("."),U=s(t.layout,j).get(),H=s(l,j).get(),G=R.get();if(void 0!==I){T[D]=I,E[D]="reverse"===F?I:N(G);var q=f.getLayoutValObject(l,R.parts);if(q&&q.impliedEdits&&null!==I)for(var Z in q.impliedEdits)S(o.relativeAttr(D,Z),q.impliedEdits[Z]);if(-1!==["width","height"].indexOf(D))if(I){S("autosize",null);var Q="height"===D?"width":"height";S(Q,l[Q])}else l[D]=t._initialAutoSize[D];else if("autosize"===D)S("width",I?null:l.width),S("height",I?null:l.height);else if(z.match(X))O(z),s(l,j+"._inputRange").set(null);else if(z.match(W)){O(z),s(l,j+"._inputRange").set(null);var $=s(l,j).get();$._inputDomain&&($._input.domain=$._inputDomain.slice())}else z.match(Y)&&s(l,j+"._inputDomain").set(null);if("type"===F){C=U;var K="linear"===H.type&&"log"===I,tt="log"===H.type&&"linear"===I;if(K||tt){if(C&&C.range)if(H.autorange)K&&(C.range=C.range[1]>C.range[0]?[1,2]:[2,1]);else{var et=C.range[0],rt=C.range[1];K?(et<=0&&rt<=0&&S(j+".autorange",!0),et<=0?et=rt/1e6:rt<=0&&(rt=et/1e6),S(j+".range[0]",Math.log(et)/Math.LN10),S(j+".range[1]",Math.log(rt)/Math.LN10)):(S(j+".range[0]",Math.pow(10,et)),S(j+".range[1]",Math.pow(10,rt)))}else S(j+".autorange",!0);Array.isArray(l._subplots.polar)&&l._subplots.polar.length&&l[R.parts[0]]&&"radialaxis"===R.parts[1]&&delete l[R.parts[0]]._subplot.viewInitial["radialaxis.range"],c.getComponentMethod("annotations","convertCoords")(t,H,I,S),c.getComponentMethod("images","convertCoords")(t,H,I,S)}else S(j+".autorange",!0),S(j+".range",null);s(l,j+"._inputRange").set(null)}else if(F.match(M)){var nt=s(l,D).get(),at=(I||{}).type;at&&"-"!==at||(at="linear"),c.getComponentMethod("annotations","convertCoords")(t,nt,at,S),c.getComponentMethod("images","convertCoords")(t,nt,at,S)}var it=w.containerArrayMatch(D);if(it){r=it.array,n=it.index;var ot=it.property,st=q||{editType:"calc"};""!==n&&""===ot&&(w.isAddVal(I)?E[D]=null:w.isRemoveVal(I)?E[D]=(s(i,r).get()||[])[n]:o.warn("unrecognized full object value",e)),k.update(_,st),m[r]||(m[r]={});var lt=m[r][n];lt||(lt=m[r][n]={}),lt[ot]=I,delete e[D]}else"reverse"===F?(U.range?U.range.reverse():(S(j+".autorange",!0),U.range=[1,0]),H.autorange?_.calc=!0:_.plot=!0):(l._has("scatter-like")&&l._has("regl")&&"dragmode"===D&&("lasso"===I||"select"===I)&&"lasso"!==G&&"select"!==G||l._has("gl2d")?_.plot=!0:q?k.update(_,q):_.calc=!0,R.set(I))}}for(r in m){w.applyContainerArrayChanges(t,d(i,r),m[r],_,d)||(_.plot=!0)}for(var ut in L){var ct=(C=p.getFromId(t,ut))&&C._constraintGroup;if(ct)for(var ft in _.calc=!0,ct)L[ft]||(p.getFromId(t,ft)._constraintShrinkable=!0)}return(J(t)||e.height||e.width)&&(_.plot=!0),(_.plot||_.calc)&&(_.layoutReplot=!0),{flags:_,rangesAltered:L,undoit:E,redoit:T,eventData:v}}function J(t){var e=t._fullLayout,r=e.width,n=e.height;return t.layout.autosize&&d.plotAutoSize(t,t.layout,e),e.width!==r||e.height!==n}function Q(t,e,n,a){if(t=o.getGraphDiv(t),A.clearPromiseQueue(t),t.framework&&t.framework.isPolar)return Promise.resolve(t);o.isPlainObject(e)||(e={}),o.isPlainObject(n)||(n={}),Object.keys(e).length&&(t.changed=!0),Object.keys(n).length&&(t.changed=!0);var i=A.coerceTraceIndices(t,a),s=U(t,o.extendFlat({},e),i),l=s.flags,c=Z(t,o.extendFlat({},n)),f=c.flags;(l.calc||f.calc)&&(t.calcdata=void 0),l.clearAxisTypes&&A.clearAxisTypes(t,i,n);var h=[];f.layoutReplot?h.push(T.layoutReplot):l.fullReplot?h.push(r.plot):(h.push(d.previousPromises),G(t,f,c)||d.supplyDefaults(t),l.style&&h.push(T.doTraceStyle),(l.colorbars||f.colorbars)&&h.push(T.doColorBars),f.legend&&h.push(T.doLegend),f.layoutstyle&&h.push(T.layoutStyles),f.axrange&&q(h,c.rangesAltered),f.ticks&&h.push(T.doTicksRelayout),f.modebar&&h.push(T.doModeBar),f.camera&&h.push(T.doCamera),h.push(S)),h.push(d.rehover,d.redrag),u.add(t,Q,[t,s.undoit,c.undoit,s.traces],Q,[t,s.redoit,c.redoit,s.traces]);var p=o.syncOrAsync(h,t);return p&&p.then||(p=Promise.resolve(t)),p.then((function(){return t.emit("plotly_update",{data:s.eventData,layout:c.eventData}),t}))}function $(t){return function(e){e._fullLayout._guiEditing=!0;var r=t.apply(null,arguments);return e._fullLayout._guiEditing=!1,r}}var K=[{pattern:/^hiddenlabels/,attr:"legend.uirevision"},{pattern:/^((x|y)axis\d*)\.((auto)?range|title\.text)/},{pattern:/axis\d*\.showspikes$/,attr:"modebar.uirevision"},{pattern:/(hover|drag)mode$/,attr:"modebar.uirevision"},{pattern:/^(scene\d*)\.camera/},{pattern:/^(geo\d*)\.(projection|center|fitbounds)/},{pattern:/^(ternary\d*\.[abc]axis)\.(min|title\.text)$/},{pattern:/^(polar\d*\.radialaxis)\.((auto)?range|angle|title\.text)/},{pattern:/^(polar\d*\.angularaxis)\.rotation/},{pattern:/^(mapbox\d*)\.(center|zoom|bearing|pitch)/},{pattern:/^legend\.(x|y)$/,attr:"editrevision"},{pattern:/^(shapes|annotations)/,attr:"editrevision"},{pattern:/^title\.text$/,attr:"editrevision"}],tt=[{pattern:/^selectedpoints$/,attr:"selectionrevision"},{pattern:/(^|value\.)visible$/,attr:"legend.uirevision"},{pattern:/^dimensions\[\d+\]\.constraintrange/},{pattern:/^node\.(x|y|groups)/},{pattern:/^level$/},{pattern:/(^|value\.)name$/},{pattern:/colorbar\.title\.text$/},{pattern:/colorbar\.(x|y)$/,attr:"editrevision"}];function et(t,e){for(var r=0;r1;)if(n.pop(),void 0!==(r=s(e,n.join(".")+".uirevision").get()))return r;return e.uirevision}function nt(t,e){for(var r=0;r=a.length?a[0]:a[t]:a}function l(t){return Array.isArray(i)?t>=i.length?i[0]:i[t]:i}function u(t,e){var r=0;return function(){if(t&&++r===e)return t()}}return void 0===n._frameWaitingCnt&&(n._frameWaitingCnt=0),new Promise((function(i,c){function f(){n._currentFrame&&n._currentFrame.onComplete&&n._currentFrame.onComplete();var e=n._currentFrame=n._frameQueue.shift();if(e){var r=e.name?e.name.toString():null;t._fullLayout._currentFrame=r,n._lastFrameAt=Date.now(),n._timeToNext=e.frameOpts.duration,d.transition(t,e.frame.data,e.frame.layout,A.coerceTraceIndices(t,e.frame.traces),e.frameOpts,e.transitionOpts).then((function(){e.onComplete&&e.onComplete()})),t.emit("plotly_animatingframe",{name:r,frame:e.frame,animation:{frame:e.frameOpts,transition:e.transitionOpts}})}else t.emit("plotly_animated"),window.cancelAnimationFrame(n._animationRaf),n._animationRaf=null}function h(){t.emit("plotly_animating"),n._lastFrameAt=-1/0,n._timeToNext=0,n._runningTransitions=0,n._currentFrame=null;var e=function(){n._animationRaf=window.requestAnimationFrame(e),Date.now()-n._lastFrameAt>n._timeToNext&&f()};e()}var p,g,v=0;function m(t){return Array.isArray(a)?v>=a.length?t.transitionOpts=a[v]:t.transitionOpts=a[0]:t.transitionOpts=a,v++,t}var y=[],b=null==e,x=Array.isArray(e);if(!b&&!x&&o.isPlainObject(e))y.push({type:"object",data:m(o.extendFlat({},e))});else if(b||-1!==["string","number"].indexOf(typeof e))for(p=0;p0&&TT)&&k.push(g);y=k}}y.length>0?function(e){if(0!==e.length){for(var a=0;a=0;n--)if(o.isPlainObject(e[n])){var g=e[n].name,v=(c[g]||p[g]||{}).name,m=e[n].name,y=c[v]||p[v];v&&m&&"number"==typeof m&&y&&E<5&&(E++,o.warn('addFrames: overwriting frame "'+(c[v]||p[v]).name+'" with a frame whose name of type "number" also equates to "'+v+'". This is valid but may potentially lead to unexpected behavior since all plotly.js frame names are stored internally as strings.'),5===E&&o.warn("addFrames: This API call has yielded too many of these warnings. For the rest of this call, further warnings about numeric frame names will be suppressed.")),p[g]={name:g},h.push({frame:d.supplyFrameDefaults(e[n]),index:r&&void 0!==r[n]&&null!==r[n]?r[n]:f+n})}h.sort((function(t,e){return t.index>e.index?-1:t.index=0;n--){if("number"==typeof(a=h[n].frame).name&&o.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!a.name)for(;c[a.name="frame "+t._transitionData._counter++];);if(c[a.name]){for(i=0;i=0;r--)n=e[r],i.push({type:"delete",index:n}),s.unshift({type:"insert",index:n,value:a[n]});var l=d.modifyFrames,c=d.modifyFrames,f=[t,s],h=[t,i];return u&&u.add(t,l,f,c,h),d.modifyFrames(t,i)},r.addTraces=function t(e,n,a){e=o.getGraphDiv(e);var i,s,l=[],c=r.deleteTraces,f=t,d=[e,l],h=[e,n];for(function(t,e,r){var n,a;if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if("undefined"==typeof e)throw new Error("traces must be defined.");for(Array.isArray(e)||(e=[e]),n=0;n=0&&r=0&&r=i.length)return!1;if(2===t.dimensions){if(r++,e.length===r)return t;var o=e[r];if(!_(o))return!1;t=i[a][o]}else t=i[a]}else t=i}}return t}function _(t){return t===Math.round(t)&&t>=0}function w(){var t,e,r={};for(t in p(r,o),n.subplotsRegistry){if((e=n.subplotsRegistry[t]).layoutAttributes)if(Array.isArray(e.attr))for(var a=0;a=l.length)return!1;a=(r=(n.transformsRegistry[l[u].type]||{}).attributes)&&r[e[2]],s=3}else if("area"===t.type)a=c[o];else{var f=t._module;if(f||(f=(n.modules[t.type||i.type.dflt]||{})._module),!f)return!1;if(!(a=(r=f.attributes)&&r[o])){var d=f.basePlotModule;d&&d.attributes&&(a=d.attributes[o])}a||(a=i[o])}return x(a,e,s)},r.getLayoutValObject=function(t,e){return x(function(t,e){var r,a,i,s,l=t._basePlotModules;if(l){var u;for(r=0;r=a&&(r._input||{})._templateitemname;o&&(i=a);var s,l=e+"["+i+"]";function u(){s={},o&&(s[l]={},s[l].templateitemname=o)}function c(t,e){o?n.nestedProperty(s[l],t).set(e):s[l+"."+t]=e}function f(){var t=s;return u(),t}return u(),{modifyBase:function(t,e){s[t]=e},modifyItem:c,getUpdateObj:f,applyUpdate:function(e,r){e&&c(e,r);var a=f();for(var i in a)n.nestedProperty(t,i).set(a[i])}}}},{"../lib":498,"../plots/attributes":543}],537:[function(t,e,r){"use strict";var n=t("d3"),a=t("../registry"),i=t("../plots/plots"),o=t("../lib"),s=t("../lib/clear_gl_canvases"),l=t("../components/color"),u=t("../components/drawing"),c=t("../components/titles"),f=t("../components/modebar"),d=t("../plots/cartesian/axes"),h=t("../constants/alignment"),p=t("../plots/cartesian/constraints"),g=p.enforce,v=p.clean,m=t("../plots/cartesian/autorange").doAutoRange;function y(t,e,r){for(var n=0;n=t[1]||a[1]<=t[0])&&(i[0]e[0]))return!0}return!1}function b(t){var e,a,s,c,p,g,v=t._fullLayout,m=v._size,b=m.p,_=d.list(t,"",!0);if(v._paperdiv.style({width:t._context.responsive&&v.autosize&&!t._context._hasZeroWidth&&!t.layout.width?"100%":v.width+"px",height:t._context.responsive&&v.autosize&&!t._context._hasZeroHeight&&!t.layout.height?"100%":v.height+"px"}).selectAll(".main-svg").call(u.setSize,v.width,v.height),t._context.setBackground(t,v.paper_bgcolor),r.drawMainTitle(t),f.manage(t),!v._has("cartesian"))return i.previousPromises(t);function A(t,e,r){var n=t._lw/2;return"x"===t._id.charAt(0)?e?"top"===r?e._offset-b-n:e._offset+e._length+b+n:m.t+m.h*(1-(t.position||0))+n%1:e?"right"===r?e._offset+e._length+b+n:e._offset-b-n:m.l+m.w*(t.position||0)+n%1}for(e=0;e<_.length;e++){var T=(c=_[e])._anchorAxis;c._linepositions={},c._lw=u.crispRound(t,c.linewidth,1),c._mainLinePosition=A(c,T,c.side),c._mainMirrorPosition=c.mirror&&T?A(c,T,h.OPPOSITE_SIDE[c.side]):null}var k=[],M=[],E=[],S=1===l.opacity(v.paper_bgcolor)&&1===l.opacity(v.plot_bgcolor)&&v.paper_bgcolor===v.plot_bgcolor;for(a in v._plots)if((s=v._plots[a]).mainplot)s.bg&&s.bg.remove(),s.bg=void 0;else{var C=s.xaxis.domain,L=s.yaxis.domain,O=s.plotgroup;if(y(C,L,E)){var D=O.node(),R=s.bg=o.ensureSingle(O,"rect","bg");D.insertBefore(R.node(),D.childNodes[0]),M.push(a)}else O.select("rect.bg").remove(),E.push([C,L]),S||(k.push(a),M.push(a))}var I,P,F,z,N,B,j,U,V,H,G,q,X,W=v._bgLayer.selectAll(".bg").data(k);for(W.enter().append("rect").classed("bg",!0),W.exit().remove(),W.each((function(t){v._plots[t].bg=n.select(this)})),e=0;eA?c.push({code:"unused",traceType:y,templateCount:w,dataCount:A}):A>w&&c.push({code:"reused",traceType:y,templateCount:w,dataCount:A})}}else c.push({code:"data"});if(function t(e,r){for(var n in e)if("_"!==n.charAt(0)){var i=e[n],o=g(e,n,r);a(i)?(Array.isArray(e)&&!1===i._template&&i.templateitemname&&c.push({code:"missing",path:o,templateitemname:i.templateitemname}),t(i,o)):Array.isArray(i)&&v(i)&&t(i,o)}}({data:h,layout:d},""),c.length)return c.map(m)}},{"../lib":498,"../plots/attributes":543,"../plots/plots":585,"./plot_config":534,"./plot_schema":535,"./plot_template":536}],539:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("./plot_api"),i=t("../plots/plots"),o=t("../lib"),s=t("../snapshot/helpers"),l=t("../snapshot/tosvg"),u=t("../snapshot/svgtoimg"),c=t("../version").version,f={format:{valType:"enumerated",values:["png","jpeg","webp","svg","full-json"],dflt:"png"},width:{valType:"number",min:1},height:{valType:"number",min:1},scale:{valType:"number",min:0,dflt:1},setBackground:{valType:"any",dflt:!1},imageDataOnly:{valType:"boolean",dflt:!1}};e.exports=function(t,e){var r,d,h,p;function g(t){return!(t in e)||o.validate(e[t],f[t])}if(e=e||{},o.isPlainObject(t)?(r=t.data||[],d=t.layout||{},h=t.config||{},p={}):(t=o.getGraphDiv(t),r=o.extendDeep([],t.data),d=o.extendDeep({},t.layout),h=t._context,p=t._fullLayout||{}),!g("width")&&null!==e.width||!g("height")&&null!==e.height)throw new Error("Height and width should be pixel values.");if(!g("format"))throw new Error("Export format is not "+o.join2(f.format.values,", "," or ")+".");var v={};function m(t,r){return o.coerce(e,v,f,t,r)}var y=m("format"),b=m("width"),x=m("height"),_=m("scale"),w=m("setBackground"),A=m("imageDataOnly"),T=document.createElement("div");T.style.position="absolute",T.style.left="-5000px",document.body.appendChild(T);var k=o.extendFlat({},d);b?k.width=b:null===e.width&&n(p.width)&&(k.width=p.width),x?k.height=x:null===e.height&&n(p.height)&&(k.height=p.height);var M=o.extendFlat({},h,{_exportedPlot:!0,staticPlot:!0,setBackground:w}),E=s.getRedrawFunc(T);function S(){return new Promise((function(t){setTimeout(t,s.getDelay(T._fullLayout))}))}function C(){return new Promise((function(t,e){var r=l(T,y,_),n=T._fullLayout.width,f=T._fullLayout.height;function d(){a.purge(T),document.body.removeChild(T)}if("full-json"===y){var h=i.graphJson(T,!1,"keepdata","object",!0,!0);return h.version=c,h=JSON.stringify(h),d(),t(A?h:s.encodeJSON(h))}if(d(),"svg"===y)return t(A?r:s.encodeSVG(r));var p=document.createElement("canvas");p.id=o.randstr(),u({format:y,width:n,height:f,scale:_,canvas:p,svg:r,promise:!0}).then(t).catch(e)}))}return new Promise((function(t,e){a.plot(T,r,k,M).then(E).then(S).then(C).then((function(e){t(function(t){return A?t.replace(s.IMAGE_URL_PREFIX,""):t}(e))})).catch((function(t){e(t)}))}))}},{"../lib":498,"../plots/plots":585,"../snapshot/helpers":597,"../snapshot/svgtoimg":599,"../snapshot/tosvg":601,"../version":707,"./plot_api":533,"fast-isnumeric":155}],540:[function(t,e,r){"use strict";var n=t("../lib"),a=t("../plots/plots"),i=t("./plot_schema"),o=t("./plot_config").dfltConfig,s=n.isPlainObject,l=Array.isArray,u=n.isArrayOrTypedArray;function c(t,e,r,a,i,o){o=o||[];for(var f=Object.keys(t),d=0;db.length&&a.push(p("unused",i,m.concat(b.length)));var k,M,E,S,C,L=b.length,O=Array.isArray(T);if(O&&(L=Math.min(L,T.length)),2===x.dimensions)for(M=0;Mb[M].length&&a.push(p("unused",i,m.concat(M,b[M].length)));var D=b[M].length;for(k=0;k<(O?Math.min(D,T[M].length):D);k++)E=O?T[M][k]:T,S=y[M][k],C=b[M][k],n.validate(S,E)?C!==S&&C!==+S&&a.push(p("dynamic",i,m.concat(M,k),S,C)):a.push(p("value",i,m.concat(M,k),S))}else a.push(p("array",i,m.concat(M),y[M]));else for(M=0;M1&&h.push(p("object","layout"))),a.supplyDefaults(g);for(var v=g._fullData,m=r.length,y=0;y0&&Math.round(f)===f))return a;u=f}for(var d=e.calendar,h="start"===l,p="end"===l,g=t[r+"period0"],v=i(g,d)||0,m=[],y=a.length,b=0;bA;)w=o(w,-u,d);for(;w<=A;)w=o(w,u,d);_=o(w,-u,d)}else{for(w=v+(x=Math.round((A-v)/c))*c;w>A;)w-=c;for(;w<=A;)w+=c;_=w-c}m[b]=h?_:p?w:(_+w)/2}return m}},{"../../constants/numerical":475,"../../lib":498,"fast-isnumeric":155}],545:[function(t,e,r){"use strict";e.exports={xaxis:{valType:"subplotid",dflt:"x",editType:"calc+clearAxisTypes"},yaxis:{valType:"subplotid",dflt:"y",editType:"calc+clearAxisTypes"}}},{}],546:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib"),i=t("../../constants/numerical").FP_SAFE,o=t("../../registry"),s=t("./axis_ids"),l=s.getFromId,u=s.isLinked;function c(t,e){var r,n,i=[],o=t._fullLayout,s=d(o,e,0),l=d(o,e,1),u=h(t,e),c=u.min,p=u.max;if(0===c.length||0===p.length)return a.simpleMap(e.range,e.r2l);var g=c[0].val,v=p[0].val;for(r=1;r0&&((A=S-s(b)-l(x))>C?T/A>L&&(_=b,w=x,L=T/A):T/S>L&&(_={val:b.val,nopad:1},w={val:x.val,nopad:1},L=T/S));if(g===v){var O=g-1,D=g+1;if(M)if(0===g)i=[0,1];else{var R=(g>0?p:c).reduce((function(t,e){return Math.max(t,l(e))}),0),I=g/(1-Math.min(.5,R/S));i=g>0?[0,I]:[I,0]}else i=E?[Math.max(0,O),Math.max(1,D)]:[O,D]}else M?(_.val>=0&&(_={val:0,nopad:1}),w.val<=0&&(w={val:0,nopad:1})):E&&(_.val-L*s(_)<0&&(_={val:0,nopad:1}),w.val<=0&&(w={val:1,nopad:1})),L=(w.val-_.val-f(e,b.val,x.val))/(S-s(_)-l(w)),i=[_.val-L*s(_),w.val+L*l(w)];return m&&i.reverse(),a.simpleMap(i,e.l2r||Number)}function f(t,e,r){var n=0;if(t.rangebreaks)for(var a=t.locateBreaks(e,r),i=0;i0?r.ppadplus:r.ppadminus)||r.ppad||0),E=k((t._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),S=k(r.vpadplus||r.vpad),C=k(r.vpadminus||r.vpad);if(!A){if(d=1/0,h=-1/0,w)for(a=0;a0&&(d=o),o>h&&o-i&&(d=o),o>h&&o=D;a--)O(a);return{min:v,max:y,opts:r}},concatExtremes:h};function h(t,e,r){var n,a,i,o=e._id,s=t._fullData,u=t._fullLayout,c=[],f=[];function d(t,e){for(n=0;n=r&&(u.extrapad||!o)){s=!1;break}a(e,u.val)&&u.pad<=r&&(o||!u.extrapad)&&(t.splice(l,1),l--)}if(s){var c=i&&0===e;t.push({val:e,pad:c?0:r,extrapad:!c&&o})}}function m(t){return n(t)&&Math.abs(t)=e}},{"../../constants/numerical":475,"../../lib":498,"../../registry":593,"./axis_ids":550,"fast-isnumeric":155}],547:[function(t,e,r){"use strict";var n=t("d3"),a=t("fast-isnumeric"),i=t("../../plots/plots"),o=t("../../registry"),s=t("../../lib"),l=s.strTranslate,u=t("../../lib/svg_text_utils"),c=t("../../components/titles"),f=t("../../components/color"),d=t("../../components/drawing"),h=t("./layout_attributes"),p=t("./clean_ticks"),g=t("../../constants/numerical"),v=g.ONEMAXYEAR,m=g.ONEAVGYEAR,y=g.ONEMINYEAR,b=g.ONEMAXQUARTER,x=g.ONEAVGQUARTER,_=g.ONEMINQUARTER,w=g.ONEMAXMONTH,A=g.ONEAVGMONTH,T=g.ONEMINMONTH,k=g.ONEWEEK,M=g.ONEDAY,E=M/2,S=g.ONEHOUR,C=g.ONEMIN,L=g.ONESEC,O=g.MINUS_SIGN,D=g.BADNUM,R=t("../../constants/alignment"),I=R.MID_SHIFT,P=R.CAP_SHIFT,F=R.LINE_SPACING,z=R.OPPOSITE_SIDE,N=e.exports={};N.setConvert=t("./set_convert");var B=t("./axis_autotype"),j=t("./axis_ids"),U=j.idSort,V=j.isLinked;N.id2name=j.id2name,N.name2id=j.name2id,N.cleanId=j.cleanId,N.list=j.list,N.listIds=j.listIds,N.getFromId=j.getFromId,N.getFromTrace=j.getFromTrace;var H=t("./autorange");N.getAutoRange=H.getAutoRange,N.findExtremes=H.findExtremes;function G(t){var e=1e-4*(t[1]-t[0]);return[t[0]-e,t[1]+e]}N.coerceRef=function(t,e,r,n,a,i){var o=n.charAt(n.length-1),l=r._fullLayout._subplots[o+"axis"],u=n+"ref",c={};return a||(a=l[0]||("string"==typeof i?i:i[0])),i||(i=a),l=l.concat(l.map((function(t){return t+" domain"}))),c[u]={valType:"enumerated",values:l.concat(i?"string"==typeof i?[i]:i:[]),dflt:a},s.coerce(t,e,c,u)},N.getRefType=function(t){return void 0===t?t:"paper"===t?"paper":"pixel"===t?"pixel":/( domain)$/.test(t)?"domain":"range"},N.coercePosition=function(t,e,r,n,a,i){var o,l;if("range"!==N.getRefType(n))o=s.ensureNumber,l=r(a,i);else{var u=N.getFromId(e,n);l=r(a,i=u.fraction2r(i)),o=u.cleanPos}t[a]=o(l)},N.cleanPosition=function(t,e,r){return("paper"===r||"pixel"===r?s.ensureNumber:N.getFromId(e,r).cleanPos)(t)},N.redrawComponents=function(t,e){e=e||N.listIds(t);var r=t._fullLayout;function n(n,a,i,s){for(var l=o.getComponentMethod(n,a),u={},c=0;c2e-6||((r-t._forceTick0)/t._minDtick%1+1.000001)%1>2e-6)&&(t._minDtick=0)):t._minDtick=0},N.saveRangeInitial=function(t,e){for(var r=N.list(t,"",!0),n=!1,a=0;a.3*d||c(n)||c(i))){var h=r.dtick/2;t+=t+h.8){var o=Number(r.substr(1));i.exactYears>.8&&o%12==0?t=N.tickIncrement(t,"M6","reverse")+1.5*M:i.exactMonths>.8?t=N.tickIncrement(t,"M1","reverse")+15.5*M:t-=E;var l=N.tickIncrement(t,r);if(l<=n)return l}return t}(y,t,m,u,i)),v=y,0;v<=c;)v=N.tickIncrement(v,m,!1,i);return{start:e.c2r(y,0,i),end:e.c2r(v,0,i),size:m,_dataSpan:c-u}},N.prepTicks=function(t,e){var r=s.simpleMap(t.range,t.r2l,void 0,void 0,e);if(t._dtickInit=t.dtick,t._tick0Init=t.tick0,"auto"===t.tickmode||!t.dtick){var n,i=t.nticks;i||("category"===t.type||"multicategory"===t.type?(n=t.tickfont?1.2*(t.tickfont.size||12):15,i=t._length/n):(n="y"===t._id.charAt(0)?40:80,i=s.constrain(t._length/n,4,9)+1),"radialaxis"===t._name&&(i*=2)),"array"===t.tickmode&&(i*=100),t._roughDTick=Math.abs(r[1]-r[0])/i,N.autoTicks(t,t._roughDTick),t._minDtick>0&&t.dtick<2*t._minDtick&&(t.dtick=t._minDtick,t.tick0=t.l2r(t._forceTick0))}"period"===t.ticklabelmode&&function(t){var e;function r(){return!(a(t.dtick)||"M"!==t.dtick.charAt(0))}var n=r(),i=N.getTickFormat(t);if(i){var o=t._dtickInit!==t.dtick;/%[fLQsSMX]/.test(i)||(/%[HI]/.test(i)?(e=S,o&&!n&&t.dticki&&f=o:h<=o;h=N.tickIncrement(h,t.dtick,l,t.calendar)){if(t.rangebreaks&&!l){if(h=c)break}if(C.length>g||h===L)break;L=h;var O=!1;f&&h!==(0|h)&&(O=!0),C.push({minor:O,value:h})}if(d&&function(t,e,r){for(var n=0;n0?(i=n-1,o=n):(i=n,o=n);var s,l=t[i].value,u=t[o].value,c=Math.abs(u-l),f=r||c,d=0;f>=y?d=c>=y&&c<=v?c:m:r===x&&f>=_?d=c>=_&&c<=b?c:x:f>=T?d=c>=T&&c<=w?c:A:r===k&&f>=k?d=k:f>=M?d=M:r===E&&f>=E?d=E:r===S&&f>=S&&(d=S),d>=c&&(d=c,s=!0);var h=a+d;if(e.rangebreaks&&d>0){for(var p=0,g=0;g<84;g++){var C=(g+.5)/84;e.maskBreaks(a*(1-C)+C*h)!==D&&p++}(d*=p/84)||(t[n].drop=!0),s&&c>k&&(d=c)}(d>0||0===n)&&(t[n].periodX=a+d/2)}}(C,t,t._definedDelta),t.rangebreaks){var R="y"===t._id.charAt(0),I=1;"auto"===t.tickmode&&(I=t.tickfont?t.tickfont.size:12);var P=NaN;for(p=C.length-1;p>-1;p--)if(C[p].drop)C.splice(p,1);else{C[p].value=wt(C[p].value,t);var F=t.c2p(C[p].value);(R?P>F-I:Pc||Bc&&(z.periodX=c),B10||"01-01"!==n.substr(5)?t._tickround="d":t._tickround=+e.substr(1)%12==0?"y":"m";else if(e>=M&&i<=10||e>=15*M)t._tickround="d";else if(e>=C&&i<=16||e>=S)t._tickround="M";else if(e>=L&&i<=19||e>=C)t._tickround="S";else{var o=t.l2r(r+e).replace(/^-/,"").length;t._tickround=Math.max(i,o)-20,t._tickround<0&&(t._tickround=4)}}else if(a(e)||"L"===e.charAt(0)){var s=t.range.map(t.r2d||Number);a(e)||(e=Number(e.substr(1))),t._tickround=2-Math.floor(Math.log(e)/Math.LN10+.01);var l=Math.max(Math.abs(s[0]),Math.abs(s[1])),u=Math.floor(Math.log(l)/Math.LN10+.01),c=void 0===t.minexponent?3:t.minexponent;Math.abs(u)>c&&(ot(t.exponentformat)&&!st(u)?t._tickexponent=3*Math.round((u-1)/3):t._tickexponent=u)}else t._tickround=null}function at(t,e,r){var n=t.tickfont||{};return{x:e,dx:0,dy:0,text:r||"",fontSize:n.size,font:n.family,fontColor:n.color}}N.autoTicks=function(t,e){var r;function n(t){return Math.pow(t,Math.floor(Math.log(e)/Math.LN10))}if("date"===t.type){t.tick0=s.dateTick0(t.calendar,0);var i=2*e;if(i>m)e/=m,r=n(10),t.dtick="M"+12*rt(e,r,Z);else if(i>A)e/=A,t.dtick="M"+rt(e,1,J);else if(i>M){t.dtick=rt(e,M,t._hasDayOfWeekBreaks?[1,2,7,14]:$);var o=N.getTickFormat(t),l="period"===t.ticklabelmode;l&&(t._rawTick0=t.tick0),/%[uVW]/.test(o)?t.tick0=s.dateTick0(t.calendar,2):t.tick0=s.dateTick0(t.calendar,1),l&&(t._dowTick0=t.tick0)}else i>S?t.dtick=rt(e,S,J):i>C?t.dtick=rt(e,C,Q):i>L?t.dtick=rt(e,L,Q):(r=n(10),t.dtick=rt(e,r,Z))}else if("log"===t.type){t.tick0=0;var u=s.simpleMap(t.range,t.r2l);if(e>.7)t.dtick=Math.ceil(e);else if(Math.abs(u[1]-u[0])<1){var c=1.5*Math.abs((u[1]-u[0])/e);e=Math.abs(Math.pow(10,u[1])-Math.pow(10,u[0]))/c,r=n(10),t.dtick="L"+rt(e,r,Z)}else t.dtick=e>.3?"D2":"D1"}else"category"===t.type||"multicategory"===t.type?(t.tick0=0,t.dtick=Math.ceil(Math.max(e,1))):_t(t)?(t.tick0=0,r=1,t.dtick=rt(e,r,et)):(t.tick0=0,r=n(10),t.dtick=rt(e,r,Z));if(0===t.dtick&&(t.dtick=1),!a(t.dtick)&&"string"!=typeof t.dtick){var f=t.dtick;throw t.dtick=1,"ax.dtick error: "+String(f)}},N.tickIncrement=function(t,e,r,i){var o=r?-1:1;if(a(e))return s.increment(t,o*e);var l=e.charAt(0),u=o*Number(e.substr(1));if("M"===l)return s.incrementMonth(t,u,i);if("L"===l)return Math.log(Math.pow(10,t)+u)/Math.LN10;if("D"===l){var c="D2"===e?tt:K,f=t+.01*o,d=s.roundUp(s.mod(f,1),c,r);return Math.floor(f)+Math.log(n.round(Math.pow(10,d),1))/Math.LN10}throw"unrecognized dtick "+String(e)},N.tickFirst=function(t,e){var r=t.r2l||Number,i=s.simpleMap(t.range,r,void 0,void 0,e),o=i[1] ")}else t._prevDateHead=l,u+="
"+l;e.text=u}(t,o,r,u):"log"===c?function(t,e,r,n,i){var o=t.dtick,l=e.x,u=t.tickformat,c="string"==typeof o&&o.charAt(0);"never"===i&&(i="");n&&"L"!==c&&(o="L3",c="L");if(u||"L"===c)e.text=lt(Math.pow(10,l),t,i,n);else if(a(o)||"D"===c&&s.mod(l+.01,1)<.1){var f=Math.round(l),d=Math.abs(f),h=t.exponentformat;"power"===h||ot(h)&&st(f)?(e.text=0===f?1:1===f?"10":"10"+(f>1?"":O)+d+"",e.fontSize*=1.25):("e"===h||"E"===h)&&d>2?e.text="1"+h+(f>0?"+":O)+d:(e.text=lt(Math.pow(10,l),t,"","fakehover"),"D1"===o&&"y"===t._id.charAt(0)&&(e.dy-=e.fontSize/6))}else{if("D"!==c)throw"unrecognized dtick "+String(o);e.text=String(Math.round(Math.pow(10,s.mod(l,1)))),e.fontSize*=.75}if("D1"===t.dtick){var p=String(e.text).charAt(0);"0"!==p&&"1"!==p||("y"===t._id.charAt(0)?e.dx-=e.fontSize/4:(e.dy+=e.fontSize/2,e.dx+=(t.range[1]>t.range[0]?1:-1)*e.fontSize*(l<0?.5:.25)))}}(t,o,0,u,g):"category"===c?function(t,e){var r=t._categories[Math.round(e.x)];void 0===r&&(r="");e.text=String(r)}(t,o):"multicategory"===c?function(t,e,r){var n=Math.round(e.x),a=t._categories[n]||[],i=void 0===a[1]?"":String(a[1]),o=void 0===a[0]?"":String(a[0]);r?e.text=o+" - "+i:(e.text=i,e.text2=o)}(t,o,r):_t(t)?function(t,e,r,n,a){if("radians"!==t.thetaunit||r)e.text=lt(e.x,t,a,n);else{var i=e.x/180;if(0===i)e.text="0";else{var o=function(t){function e(t,e){return Math.abs(t-e)<=1e-6}var r=function(t){for(var r=1;!e(Math.round(t*r)/r,t);)r*=10;return r}(t),n=t*r,a=Math.abs(function t(r,n){return e(n,0)?r:t(n,r%n)}(n,r));return[Math.round(n/a),Math.round(r/a)]}(i);if(o[1]>=100)e.text=lt(s.deg2rad(e.x),t,a,n);else{var l=e.x<0;1===o[1]?1===o[0]?e.text="\u03c0":e.text=o[0]+"\u03c0":e.text=["",o[0],"","\u2044","",o[1],"","\u03c0"].join(""),l&&(e.text=O+e.text)}}}}(t,o,r,u,g):function(t,e,r,n,a){"never"===a?a="":"all"===t.showexponent&&Math.abs(e.x/t.dtick)<1e-6&&(a="hide");e.text=lt(e.x,t,a,n)}(t,o,0,u,g),n||(t.tickprefix&&!p(t.showtickprefix)&&(o.text=t.tickprefix+o.text),t.ticksuffix&&!p(t.showticksuffix)&&(o.text+=t.ticksuffix)),"boundaries"===t.tickson||t.showdividers){var v=function(e){var r=t.l2p(e);return r>=0&&r<=t._length?e:null};o.xbnd=[v(o.x-.5),v(o.x+t.dtick-.5)]}return o},N.hoverLabelText=function(t,e,r){if(r!==D&&r!==e)return N.hoverLabelText(t,e)+" - "+N.hoverLabelText(t,r);var n="log"===t.type&&e<=0,a=N.tickText(t,t.c2l(n?-e:e),"hover").text;return n?0===e?"0":O+a:a};var it=["f","p","n","\u03bc","m","","k","M","G","T"];function ot(t){return"SI"===t||"B"===t}function st(t){return t>14||t<-15}function lt(t,e,r,n){var i=t<0,o=e._tickround,l=r||e.exponentformat||"B",u=e._tickexponent,c=N.getTickFormat(e),f=e.separatethousands;if(n){var d={exponentformat:l,minexponent:e.minexponent,dtick:"none"===e.showexponent?e.dtick:a(t)&&Math.abs(t)||1,range:"none"===e.showexponent?e.range.map(e.r2d):[0,t||1]};nt(d),o=(Number(d._tickround)||0)+4,u=d._tickexponent,e.hoverformat&&(c=e.hoverformat)}if(c)return e._numFormat(c)(t).replace(/-/g,O);var h,p=Math.pow(10,-o)/2;if("none"===l&&(u=0),(t=Math.abs(t))"+h+"":"B"===l&&9===u?t+="B":ot(l)&&(t+=it[u/3+5]));return i?O+t:t}function ut(t,e){for(var r=[],n={},a=0;a1&&r=a.min&&t=0,i=c(t,e[1])<=0;return(r||a)&&(n||i)}if(t.tickformatstops&&t.tickformatstops.length>0)switch(t.type){case"date":case"linear":for(e=0;e=o(a)))){r=n;break}break;case"log":for(e=0;e0?r.bottom-f:0,d)))),e.automargin){n={x:0,y:0,r:0,l:0,t:0,b:0};var h=[0,1];if("x"===p){if("b"===l?n[l]=e._depth:(n[l]=e._depth=Math.max(r.width>0?f-r.top:0,d),h.reverse()),r.width>0){var v=r.right-(e._offset+e._length);v>0&&(n.xr=1,n.r=v);var m=e._offset-r.left;m>0&&(n.xl=0,n.l=m)}}else if("l"===l?n[l]=e._depth=Math.max(r.height>0?f-r.left:0,d):(n[l]=e._depth=Math.max(r.height>0?r.right-f:0,d),h.reverse()),r.height>0){var y=r.bottom-(e._offset+e._length);y>0&&(n.yb=0,n.b=y);var b=e._offset-r.top;b>0&&(n.yt=1,n.t=b)}n[g]="free"===e.anchor?e.position:e._anchorAxis.domain[h[0]],e.title.text!==u._dfltTitle[p]&&(n[l]+=dt(e)+(e.title.standoff||0)),e.mirror&&"free"!==e.anchor&&((a={x:0,y:0,r:0,l:0,t:0,b:0})[c]=e.linewidth,e.mirror&&!0!==e.mirror&&(a[c]+=d),!0===e.mirror||"ticks"===e.mirror?a[g]=e._anchorAxis.domain[h[1]]:"all"!==e.mirror&&"allticks"!==e.mirror||(a[g]=[e._counterDomainMin,e._counterDomainMax][h[1]]))}Q&&(s=o.getComponentMethod("rangeslider","autoMarginOpts")(t,e)),i.autoMargin(t,gt(e),n),i.autoMargin(t,vt(e),a),i.autoMargin(t,mt(e),s)})),r.skipTitle||Q&&"bottom"===e.side||Z.push((function(){return function(t,e){var r,n=t._fullLayout,a=e._id,i=a.charAt(0),o=e.title.font.size;if(e.title.hasOwnProperty("standoff"))r=e._depth+e.title.standoff+dt(e);else{var s=-1!==(e.ticklabelposition||"").indexOf("inside");if("multicategory"===e.type)r=e._depth;else{var l=1.5*o;s&&(l=.5*o,"outside"===e.ticks&&(l+=e.ticklen)),r=10+l+(e.linewidth?e.linewidth-1:0)}s||(r+="x"===i?"top"===e.side?o*(e.showticklabels?1:0):o*(e.showticklabels?1.5:.5):"right"===e.side?o*(e.showticklabels?1:.5):o*(e.showticklabels?.5:0))}var u,f,h,p,g=N.getPxPosition(t,e);"x"===i?(f=e._offset+e._length/2,h="top"===e.side?g-r:g+r):(h=e._offset+e._length/2,f="right"===e.side?g+r:g-r,u={rotate:"-90",offset:0});if("multicategory"!==e.type){var v=e._selections[e._id+"tick"];if(p={selection:v,side:e.side},v&&v.node()&&v.node().parentNode){var m=d.getTranslate(v.node().parentNode);p.offsetLeft=m.x,p.offsetTop=m.y}e.title.hasOwnProperty("standoff")&&(p.pad=0)}return c.draw(t,a+"title",{propContainer:e,propName:e._name+".title.text",placeholder:n._dfltTitle[i],avoid:p,transform:u,attributes:{x:f,y:h,"text-anchor":"middle"}})}(t,e)})),s.syncOrAsync(Z)}}function $(t){var r=h+(t||"tick");return w[r]||(w[r]=function(t,e){var r,n,a,i;t._selections[e].size()?(r=1/0,n=-1/0,a=1/0,i=-1/0,t._selections[e].each((function(){var t=pt(this),e=d.bBox(t.node().parentNode);r=Math.min(r,e.top),n=Math.max(n,e.bottom),a=Math.min(a,e.left),i=Math.max(i,e.right)}))):(r=0,n=0,a=0,i=0);return{top:r,bottom:n,left:a,right:i,height:n-r,width:i-a}}(e,r)),w[r]}},N.getTickSigns=function(t){var e=t._id.charAt(0),r={x:"top",y:"right"}[e],n=t.side===r?1:-1,a=[-1,1,n,-n];return"inside"!==t.ticks==("x"===e)&&(a=a.map((function(t){return-t}))),t.side&&a.push({l:-1,t:-1,r:1,b:1}[t.side.charAt(0)]),a},N.makeTransTickFn=function(t){return"x"===t._id.charAt(0)?function(e){return l(t._offset+t.l2p(e.x),0)}:function(e){return l(0,t._offset+t.l2p(e.x))}},N.makeTransTickLabelFn=function(t){var e=function(t){var e=t.ticklabelposition||"",r=function(t){return-1!==e.indexOf(t)},n=r("top"),a=r("left"),i=r("right"),o=r("bottom"),s=r("inside"),l=o||a||n||i;if(!l&&!s)return[0,0];var u=t.side,c=l?(t.tickwidth||0)/2:0,f=3,d=t.tickfont?t.tickfont.size:12;(o||n)&&(c+=d*P,f+=(t.linewidth||0)/2);(a||i)&&(c+=(t.linewidth||0)/2,f+=3);s&&"top"===u&&(f-=d*(1-P));(a||n)&&(c=-c);"bottom"!==u&&"right"!==u||(f=-f);return[l?c:0,s?f:0]}(t),r=e[0],n=e[1];return"x"===t._id.charAt(0)?function(e){return l(r+t._offset+t.l2p(ct(e)),n)}:function(e){return l(n,r+t._offset+t.l2p(ct(e)))}},N.makeTickPath=function(t,e,r,n){n=void 0!==n?n:t.ticklen;var a=t._id.charAt(0),i=(t.linewidth||1)/2;return"x"===a?"M0,"+(e+i*r)+"v"+n*r:"M"+(e+i*r)+",0h"+n*r},N.makeLabelFns=function(t,e,r){var n=t.ticklabelposition||"",i=function(t){return-1!==n.indexOf(t)},o=i("top"),l=i("left"),u=i("right"),c=i("bottom")||l||o||u,f=i("inside"),d="inside"===n&&"inside"===t.ticks||!f&&"outside"===t.ticks&&"boundaries"!==t.tickson,h=0,p=0,g=d?t.ticklen:0;if(f?g*=-1:c&&(g=0),d&&(h+=g,r)){var v=s.deg2rad(r);h=g*Math.cos(v)+1,p=g*Math.sin(v)}t.showticklabels&&(d||t.showline)&&(h+=.2*t.tickfont.size);var m,y,b,x,_,w={labelStandoff:h+=(t.linewidth||1)/2*(f?-1:1),labelShift:p},A=0,T=t.side,k=t._id.charAt(0),M=t.tickangle;if("x"===k)x=(_=!f&&"bottom"===T||f&&"top"===T)?1:-1,f&&(x*=-1),m=p*x,y=e+h*x,b=_?1:-.2,90===Math.abs(M)&&(f?b+=I:b=-90===M&&"bottom"===T?P:90===M&&"top"===T?I:.5,A=I/2*(M/90)),w.xFn=function(t){return t.dx+m+A*t.fontSize},w.yFn=function(t){return t.dy+y+t.fontSize*b},w.anchorFn=function(t,e){if(c){if(l)return"end";if(u)return"start"}return a(e)&&0!==e&&180!==e?e*x<0!==f?"end":"start":"middle"},w.heightFn=function(e,r,n){return r<-60||r>60?-.5*n:"top"===t.side!==f?-n:0};else if("y"===k){if(x=(_=!f&&"left"===T||f&&"right"===T)?1:-1,f&&(x*=-1),m=h,y=p*x,b=0,f||90!==Math.abs(M)||(b=-90===M&&"left"===T||90===M&&"right"===T?P:.5),f){var E=a(M)?+M:0;if(0!==E){var S=s.deg2rad(E);A=Math.abs(Math.sin(S))*P*x,b=0}}w.xFn=function(t){return t.dx+e-(m+t.fontSize*b)*x+A*t.fontSize},w.yFn=function(t){return t.dy+y+t.fontSize*I},w.anchorFn=function(t,e){return a(e)&&90===Math.abs(e)?"middle":_?"end":"start"},w.heightFn=function(e,r,n){return"right"===t.side&&(r*=-1),r<-30?-n:r<30?-.5*n:0}}return w},N.drawTicks=function(t,e,r){r=r||{};var n=e._id+"tick",a=r.vals;"period"===e.ticklabelmode&&(a=a.slice()).shift();var i=r.layer.selectAll("path."+n).data(e.ticks?a:[],ft);i.exit().remove(),i.enter().append("path").classed(n,1).classed("ticks",1).classed("crisp",!1!==r.crisp).call(f.stroke,e.tickcolor).style("stroke-width",d.crispRound(t,e.tickwidth,1)+"px").attr("d",r.path),i.attr("transform",r.transFn)},N.drawGrid=function(t,e,r){r=r||{};var n=e._id+"grid",a=r.vals,i=r.counterAxis;if(!1===e.showgrid)a=[];else if(i&&N.shouldShowZeroLine(t,e,i))for(var o="array"===e.tickmode,s=0;so||a.lefto||a.top+(e.tickangle?0:t.fontSize/4)1)for(n=1;n2*o}(a,e))return"date";var v="strict"!==r.autotypenumbers;return function(t,e){for(var r=t.length,n=f(r),a=0,o=0,s={},c=0;c2*a}(a,v)?"category":function(t,e){for(var r=t.length,n=0;n=2){var l,u,c="";if(2===o.length)for(l=0;l<2;l++)if(u=y(o[l])){c=p;break}var f=a("pattern",c);if(f===p)for(l=0;l<2;l++)(u=y(o[l]))&&(e.bounds[l]=o[l]=u-1);if(f)for(l=0;l<2;l++)switch(u=o[l],f){case p:if(!n(u))return void(e.enabled=!1);if((u=+u)!==Math.floor(u)||u<0||u>=7)return void(e.enabled=!1);e.bounds[l]=o[l]=u;break;case g:if(!n(u))return void(e.enabled=!1);if((u=+u)<0||u>24)return void(e.enabled=!1);e.bounds[l]=o[l]=u}if(!1===r.autorange){var d=r.range;if(d[0]d[1])return void(e.enabled=!1)}else if(o[0]>d[0]&&o[1]n?1:-1:+(t.substr(1)||1)-+(e.substr(1)||1)},r.ref2id=function(t){return!!/^[xyz]/.test(t)&&t.split(" ")[0]},r.isLinked=function(t,e){return i(e,t._axisMatchGroups)||i(e,t._axisConstraintGroups)}},{"../../registry":593,"./constants":553}],551:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){if("category"===e.type){var a,i=t.categoryarray,o=Array.isArray(i)&&i.length>0;o&&(a="array");var s,l=r("categoryorder",a);"array"===l&&(s=r("categoryarray")),o||"array"!==l||(l=e.categoryorder="trace"),"trace"===l?e._initialCategories=[]:"array"===l?e._initialCategories=s.slice():(s=function(t,e){var r,n,a,i=e.dataAttr||t._id.charAt(0),o={};if(e.axData)r=e.axData;else for(r=[],n=0;nn?a.substr(n):i.substr(r))+o:a+i+t*e:o}function v(t,e){for(var r=e._size,n=r.h/r.w,a={},i=Object.keys(t),o=0;ou*b)||A)for(r=0;rR&&zO&&(O=z);d/=(O-L)/(2*D),L=l.l2r(L),O=l.l2r(O),l.range=l._input.range=E=0?Math.min(t,.9):1/(1/Math.max(t,-.3)+3.222))}function N(t,e,r,n,a){return t.append("path").attr("class","zoombox").style({fill:e>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform",l(r,n)).attr("d",a+"Z")}function B(t,e,r){return t.append("path").attr("class","zoombox-corners").style({fill:c.background,stroke:c.defaultLine,"stroke-width":1,opacity:0}).attr("transform",l(e,r)).attr("d","M0,0Z")}function j(t,e,r,n,a,i){t.attr("d",n+"M"+r.l+","+r.t+"v"+r.h+"h"+r.w+"v-"+r.h+"h-"+r.w+"Z"),U(t,e,a,i)}function U(t,e,r,n){r||(t.transition().style("fill",n>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),e.transition().style("opacity",1).duration(200))}function V(t){n.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function H(t){O&&t.data&&t._context.showTips&&(s.notifier(s._(t,"Double-click to zoom back out"),"long"),O=!1)}function G(t){var e=Math.floor(Math.min(t.b-t.t,t.r-t.l,L)/2);return"M"+(t.l-3.5)+","+(t.t-.5+e)+"h3v"+-e+"h"+e+"v-3h-"+(e+3)+"ZM"+(t.r+3.5)+","+(t.t-.5+e)+"h-3v"+-e+"h"+-e+"v-3h"+(e+3)+"ZM"+(t.r+3.5)+","+(t.b+.5-e)+"h-3v"+e+"h"+-e+"v3h"+(e+3)+"ZM"+(t.l-3.5)+","+(t.b+.5-e)+"h3v"+e+"h"+e+"v3h-"+(e+3)+"Z"}function q(t,e,r,n,a){for(var i,o,l,u,c=!1,f={},d={},h=(a||{}).xaHash,p=(a||{}).yaHash,g=0;g=0)a._fullLayout._deactivateShape(a);else{var i=a._fullLayout.clickmode;if(V(a),2!==t||vt||Ht(),gt)i.indexOf("select")>-1&&M(r,a,Z,J,e.id,Lt),i.indexOf("event")>-1&&d.click(a,r,e.id);else if(1===t&&vt){var s=p?D:O,l="s"===p||"w"===v?0:1,c=s._name+".range["+l+"]",f=function(t,e){var r,a=t.range[e],i=Math.abs(a-t.range[1-e]);return"date"===t.type?a:"log"===t.type?(r=Math.ceil(Math.max(0,-Math.log(i)/Math.LN10))+3,n.format("."+r+"g")(Math.pow(10,a))):(r=Math.floor(Math.log(Math.abs(a))/Math.LN10)-Math.floor(Math.log(i)/Math.LN10)+4,n.format("."+String(r)+"g")(a))}(s,l),h="left",g="middle";if(s.fixedrange)return;p?(g="n"===p?"top":"bottom","right"===s.side&&(h="right")):"e"===v&&(h="right"),a._context.showAxisRangeEntryBoxes&&n.select(bt).call(u.makeEditable,{gd:a,immediate:!0,background:a._fullLayout.paper_bgcolor,text:String(f),fill:s.tickfont?s.tickfont.color:"#444",horizontalAlign:h,verticalAlign:g}).on("edit",(function(t){var e=s.d2r(t);void 0!==e&&o.call("_guiRelayout",a,c,e)}))}}}function Rt(e,r){if(t._transitioningWithDuration)return!1;var n=Math.max(0,Math.min(K,dt*e+xt)),a=Math.max(0,Math.min(tt,ht*r+_t)),i=Math.abs(n-xt),o=Math.abs(a-_t);function s(){Mt="",wt.r=wt.l,wt.t=wt.b,St.attr("d","M0,0Z")}if(wt.l=Math.min(xt,n),wt.r=Math.max(xt,n),wt.t=Math.min(_t,a),wt.b=Math.max(_t,a),et.isSubplotConstrained)i>L||o>L?(Mt="xy",i/K>o/tt?(o=i*tt/K,_t>a?wt.t=_t-o:wt.b=_t+o):(i=o*K/tt,xt>n?wt.l=xt-i:wt.r=xt+i),St.attr("d",G(wt))):s();else if(rt.isSubplotConstrained)if(i>L||o>L){Mt="xy";var l=Math.min(wt.l/K,(tt-wt.b)/tt),u=Math.max(wt.r/K,(tt-wt.t)/tt);wt.l=l*K,wt.r=u*K,wt.b=(1-l)*tt,wt.t=(1-u)*tt,St.attr("d",G(wt))}else s();else!at||o0){var c;if(rt.isSubplotConstrained||!nt&&1===at.length){for(c=0;cg[1]-1/4096&&(e.domain=s),a.noneOrAll(t.domain,e.domain,s)}return r("layer"),e}},{"../../lib":498,"fast-isnumeric":155}],565:[function(t,e,r){"use strict";var n=t("../../constants/alignment").FROM_BL;e.exports=function(t,e,r){void 0===r&&(r=n[t.constraintoward||"center"]);var a=[t.r2l(t.range[0]),t.r2l(t.range[1])],i=a[0]+(a[1]-a[0])*r;t.range=t._input.range=[t.l2r(i+(a[0]-i)*e),t.l2r(i+(a[1]-i)*e)],t.setScale()}},{"../../constants/alignment":470}],566:[function(t,e,r){"use strict";var n=t("polybooljs"),a=t("../../registry"),i=t("../../components/drawing").dashStyle,o=t("../../components/color"),s=t("../../components/fx"),l=t("../../components/fx/helpers").makeEventData,u=t("../../components/dragelement/helpers"),c=u.freeMode,f=u.rectMode,d=u.drawMode,h=u.openMode,p=u.selectMode,g=t("../../components/shapes/draw_newshape/display_outlines"),v=t("../../components/shapes/draw_newshape/helpers").handleEllipse,m=t("../../components/shapes/draw_newshape/newshapes"),y=t("../../lib"),b=t("../../lib/polygon"),x=t("../../lib/throttle"),_=t("./axis_ids").getFromId,w=t("../../lib/clear_gl_canvases"),A=t("../../plot_api/subroutines").redrawReglTraces,T=t("./constants"),k=T.MINSELECT,M=b.filter,E=b.tester,S=t("./handle_outline").clearSelect,C=t("./helpers"),L=C.p2r,O=C.axValue,D=C.getTransform;function R(t,e,r,n,a,i,o){var s,l,u,c,f,d,p,v,m,y=e._hoverdata,b=e._fullLayout.clickmode.indexOf("event")>-1,x=[];if(function(t){return t&&Array.isArray(t)&&!0!==t[0].hoverOnBox}(y)){z(t,e,i);var _=function(t,e){var r,n,a=t[0],i=-1,o=[];for(n=0;n0?function(t,e){var r,n,a,i=[];for(a=0;a0&&i.push(r);if(1===i.length&&i[0]===e.searchInfo&&(n=e.searchInfo.cd[0].trace).selectedpoints.length===e.pointNumbers.length){for(a=0;a1)return!1;if((a+=r.selectedpoints.length)>1)return!1}return 1===a}(s)&&(d=j(_))){for(o&&o.remove(),m=0;m=0&&n._fullLayout._deactivateShape(n),d(e)){var i=n._fullLayout._zoomlayer.selectAll(".select-outline-"+r.id);if(i&&n._fullLayout._drawing){var o=m(i,t);o&&a.call("_guiRelayout",n,{shapes:o}),n._fullLayout._drawing=!1}}r.selection={},r.selection.selectionDefs=t.selectionDefs=[],r.selection.mergedPolygons=t.mergedPolygons=[]}function B(t,e,r,n){var a,i,o,s=[],l=e.map((function(t){return t._id})),u=r.map((function(t){return t._id}));for(o=0;o0?n[0]:r;return!!e.selectedpoints&&e.selectedpoints.indexOf(a)>-1}function U(t,e,r){var n,i,o,s;for(n=0;n=0)C._fullLayout._deactivateShape(C);else if(!_){var r=I.clickmode;x.done(gt).then((function(){if(x.clear(gt),2===t){for(ft.remove(),K=0;K-1&&R(e,C,a.xaxes,a.yaxes,a.subplot,a,ft),"event"===r&&C.emit("plotly_selected",void 0);s.click(C,e)})).catch(y.error)}},a.doneFn=function(){pt.remove(),x.done(gt).then((function(){x.clear(gt),a.gd.emit("plotly_selected",et),$&&a.selectionDefs&&($.subtract=ct,a.selectionDefs.push($),a.mergedPolygons.length=0,[].push.apply(a.mergedPolygons,Q)),a.doneFnCompleted&&a.doneFnCompleted(vt)})).catch(y.error),_&&N(a)}},clearSelect:S,clearSelectionsCache:N,selectOnClick:R}},{"../../components/color":368,"../../components/dragelement/helpers":386,"../../components/drawing":390,"../../components/fx":408,"../../components/fx/helpers":404,"../../components/shapes/draw_newshape/display_outlines":453,"../../components/shapes/draw_newshape/helpers":454,"../../components/shapes/draw_newshape/newshapes":455,"../../lib":498,"../../lib/clear_gl_canvases":484,"../../lib/polygon":510,"../../lib/throttle":524,"../../plot_api/subroutines":537,"../../registry":593,"./axis_ids":550,"./constants":553,"./handle_outline":557,"./helpers":558,polybooljs:277}],567:[function(t,e,r){"use strict";var n=t("d3"),a=t("d3-time-format").utcFormat,i=t("fast-isnumeric"),o=t("../../lib"),s=o.cleanNumber,l=o.ms2DateTime,u=o.dateTime2ms,c=o.ensureNumber,f=o.isArrayOrTypedArray,d=t("../../constants/numerical"),h=d.FP_SAFE,p=d.BADNUM,g=d.LOG_CLIP,v=d.ONEWEEK,m=d.ONEDAY,y=d.ONEHOUR,b=d.ONEMIN,x=d.ONESEC,_=t("./axis_ids"),w=t("./constants"),A=w.HOUR_PATTERN,T=w.WEEKDAY_PATTERN;function k(t){return Math.pow(10,t)}function M(t){return null!=t}e.exports=function(t,e){e=e||{};var r=t._id||"x",d=r.charAt(0);function E(e,r){if(e>0)return Math.log(e)/Math.LN10;if(e<=0&&r&&t.range&&2===t.range.length){var n=t.range[0],a=t.range[1];return.5*(n+a-2*g*Math.abs(n-a))}return p}function S(e,r,n,a){if((a||{}).msUTC&&i(e))return+e;var s=u(e,n||t.calendar);if(s===p){if(!i(e))return p;e=+e;var l=Math.floor(10*o.mod(e+.05,1)),c=Math.round(e-l/10);s=u(new Date(c))+l/10}return s}function C(e,r,n){return l(e,r,n||t.calendar)}function L(e){return t._categories[Math.round(e)]}function O(e){if(M(e)){if(void 0===t._categoriesMap&&(t._categoriesMap={}),void 0!==t._categoriesMap[e])return t._categoriesMap[e];t._categories.push("number"==typeof e?String(e):e);var r=t._categories.length-1;return t._categoriesMap[e]=r,r}return p}function D(e){if(t._categoriesMap)return t._categoriesMap[e]}function R(t){var e=D(t);return void 0!==e?e:i(t)?+t:void 0}function I(t){return i(t)?+t:D(t)}function P(t,e,r){return n.round(r+e*t,2)}function F(t,e,r){return(t-r)/e}var z=function(e){return i(e)?P(e,t._m,t._b):p},N=function(e){return F(e,t._m,t._b)};if(t.rangebreaks){var B="y"===d;z=function(e){if(!i(e))return p;var r=t._rangebreaks.length;if(!r)return P(e,t._m,t._b);var n=B;t.range[0]>t.range[1]&&(n=!n);for(var a=n?-1:1,o=a*e,s=0,l=0;lc)){s=o<(u+c)/2?l:l+1;break}s=l+1}var f=t._B[s]||0;return isFinite(f)?P(e,t._m2,f):0},N=function(e){var r=t._rangebreaks.length;if(!r)return F(e,t._m,t._b);for(var n=0,a=0;at._rangebreaks[a].pmax&&(n=a+1);return F(e,t._m2,t._B[n])}}t.c2l="log"===t.type?E:c,t.l2c="log"===t.type?k:c,t.l2p=z,t.p2l=N,t.c2p="log"===t.type?function(t,e){return z(E(t,e))}:z,t.p2c="log"===t.type?function(t){return k(N(t))}:N,-1!==["linear","-"].indexOf(t.type)?(t.d2r=t.r2d=t.d2c=t.r2c=t.d2l=t.r2l=s,t.c2d=t.c2r=t.l2d=t.l2r=c,t.d2p=t.r2p=function(e){return t.l2p(s(e))},t.p2d=t.p2r=N,t.cleanPos=c):"log"===t.type?(t.d2r=t.d2l=function(t,e){return E(s(t),e)},t.r2d=t.r2c=function(t){return k(s(t))},t.d2c=t.r2l=s,t.c2d=t.l2r=c,t.c2r=E,t.l2d=k,t.d2p=function(e,r){return t.l2p(t.d2r(e,r))},t.p2d=function(t){return k(N(t))},t.r2p=function(e){return t.l2p(s(e))},t.p2r=N,t.cleanPos=c):"date"===t.type?(t.d2r=t.r2d=o.identity,t.d2c=t.r2c=t.d2l=t.r2l=S,t.c2d=t.c2r=t.l2d=t.l2r=C,t.d2p=t.r2p=function(e,r,n){return t.l2p(S(e,0,n))},t.p2d=t.p2r=function(t,e,r){return C(N(t),e,r)},t.cleanPos=function(e){return o.cleanDate(e,p,t.calendar)}):"category"===t.type?(t.d2c=t.d2l=O,t.r2d=t.c2d=t.l2d=L,t.d2r=t.d2l_noadd=R,t.r2c=function(e){var r=I(e);return void 0!==r?r:t.fraction2r(.5)},t.l2r=t.c2r=c,t.r2l=I,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return L(N(t))},t.r2p=t.d2p,t.p2r=N,t.cleanPos=function(t){return"string"==typeof t&&""!==t?t:c(t)}):"multicategory"===t.type&&(t.r2d=t.c2d=t.l2d=L,t.d2r=t.d2l_noadd=R,t.r2c=function(e){var r=R(e);return void 0!==r?r:t.fraction2r(.5)},t.r2c_just_indices=D,t.l2r=t.c2r=c,t.r2l=R,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return L(N(t))},t.r2p=t.d2p,t.p2r=N,t.cleanPos=function(t){return Array.isArray(t)||"string"==typeof t&&""!==t?t:c(t)},t.setupMultiCategory=function(n){var a,i,s=t._traceIndices,l=t._matchGroup;if(l&&0===t._categories.length)for(var u in l)if(u!==r){var c=e[_.id2name(u)];s=s.concat(c._traceIndices)}var h=[[0,{}],[0,{}]],p=[];for(a=0;ah&&(s[n]=h),s[0]===s[1]){var u=Math.max(1,Math.abs(1e-6*s[0]));s[0]-=u,s[1]+=u}}else o.nestedProperty(t,e).set(a)},t.setScale=function(r){var n=e._size;if(t.overlaying){var a=_.getFromId({_fullLayout:e},t.overlaying);t.domain=a.domain}var i=r&&t._r?"_r":"range",o=t.calendar;t.cleanRange(i);var s,l,u=t.r2l(t[i][0],o),c=t.r2l(t[i][1],o),f="y"===d;if((f?(t._offset=n.t+(1-t.domain[1])*n.h,t._length=n.h*(t.domain[1]-t.domain[0]),t._m=t._length/(u-c),t._b=-t._m*c):(t._offset=n.l+t.domain[0]*n.w,t._length=n.w*(t.domain[1]-t.domain[0]),t._m=t._length/(c-u),t._b=-t._m*u),t._rangebreaks=[],t._lBreaks=0,t._m2=0,t._B=[],t.rangebreaks)&&(t._rangebreaks=t.locateBreaks(Math.min(u,c),Math.max(u,c)),t._rangebreaks.length)){for(s=0;sc&&(h=!h),h&&t._rangebreaks.reverse();var p=h?-1:1;for(t._m2=p*t._length/(Math.abs(c-u)-t._lBreaks),t._B.push(-t._m2*(f?c:u)),s=0;sa&&(a+=7,ia&&(a+=24,i=n&&i=n&&e=s.min&&(ts.max&&(s.max=n),a=!1)}a&&u.push({min:t,max:n})}};for(n=0;nr.duration?(!function(){for(var r={},n=0;n rect").call(o.setTranslate,0,0).call(o.setScale,1,1),t.plot.call(o.setTranslate,e._offset,r._offset).call(o.setScale,1,1);var n=t.plot.selectAll(".scatterlayer .trace");n.selectAll(".point").call(o.setPointGroupScale,1,1),n.selectAll(".textpoint").call(o.setTextPointsScale,1,1),n.call(o.hideOutsideRangePoints,t)}function v(e,r){var n=e.plotinfo,a=n.xaxis,l=n.yaxis,u=a._length,c=l._length,f=!!e.xr1,d=!!e.yr1,h=[];if(f){var p=i.simpleMap(e.xr0,a.r2l),g=i.simpleMap(e.xr1,a.r2l),v=p[1]-p[0],m=g[1]-g[0];h[0]=(p[0]*(1-r)+r*g[0]-p[0])/(p[1]-p[0])*u,h[2]=u*(1-r+r*m/v),a.range[0]=a.l2r(p[0]*(1-r)+r*g[0]),a.range[1]=a.l2r(p[1]*(1-r)+r*g[1])}else h[0]=0,h[2]=u;if(d){var y=i.simpleMap(e.yr0,l.r2l),b=i.simpleMap(e.yr1,l.r2l),x=y[1]-y[0],_=b[1]-b[0];h[1]=(y[1]*(1-r)+r*b[1]-y[1])/(y[0]-y[1])*c,h[3]=c*(1-r+r*_/x),l.range[0]=a.l2r(y[0]*(1-r)+r*b[0]),l.range[1]=l.l2r(y[1]*(1-r)+r*b[1])}else h[1]=0,h[3]=c;s.drawOne(t,a,{skipTitle:!0}),s.drawOne(t,l,{skipTitle:!0}),s.redrawComponents(t,[a._id,l._id]);var w=f?u/h[2]:1,A=d?c/h[3]:1,T=f?h[0]:0,k=d?h[1]:0,M=f?h[0]/h[2]*u:0,E=d?h[1]/h[3]*c:0,S=a._offset-M,C=l._offset-E;n.clipRect.call(o.setTranslate,T,k).call(o.setScale,1/w,1/A),n.plot.call(o.setTranslate,S,C).call(o.setScale,w,A),o.setPointGroupScale(n.zoomScalePts,1/w,1/A),o.setTextPointsScale(n.zoomScaleTxt,1/w,1/A)}s.redrawComponents(t)}},{"../../components/drawing":390,"../../lib":498,"../../registry":593,"./axes":547,d3:86}],572:[function(t,e,r){"use strict";var n=t("../../registry").traceIs,a=t("./axis_autotype");function i(t){return{v:"x",h:"y"}[t.orientation||"v"]}function o(t,e){var r=i(t),a=n(t,"box-violin"),o=n(t._fullInput||{},"candlestick");return a&&!o&&e===r&&void 0===t[r]&&void 0===t[r+"0"]}e.exports=function(t,e,r,s){r("autotypenumbers",s.autotypenumbersDflt),"-"===r("type",(s.splomStash||{}).type)&&(!function(t,e){if("-"!==t.type)return;var r,s=t._id,l=s.charAt(0);-1!==s.indexOf("scene")&&(s=l);var u=function(t,e,r){for(var n=0;n0&&(a["_"+r+"axes"]||{})[e])return a;if((a[r+"axis"]||r)===e){if(o(a,r))return a;if((a[r]||[]).length||a[r+"0"])return a}}}(e,s,l);if(!u)return;if("histogram"===u.type&&l==={v:"y",h:"x"}[u.orientation||"v"])return void(t.type="linear");var c=l+"calendar",f=u[c],d={noMultiCategory:!n(u,"cartesian")||n(u,"noMultiCategory")};"box"===u.type&&u._hasPreCompStats&&l==={h:"x",v:"y"}[u.orientation||"v"]&&(d.noMultiCategory=!0);if(d.autotypenumbers=t.autotypenumbers,o(u,l)){var h=i(u),p=[];for(r=0;r0?".":"")+i;a.isPlainObject(o)?l(o,e,s,n+1):e(s,i,o)}}))}r.manageCommandObserver=function(t,e,n,o){var s={},l=!0;e&&e._commandObserver&&(s=e._commandObserver),s.cache||(s.cache={}),s.lookupTable={};var u=r.hasSimpleAPICommandBindings(t,n,s.lookupTable);if(e&&e._commandObserver){if(u)return s;if(e._commandObserver.remove)return e._commandObserver.remove(),e._commandObserver=null,s}if(u){i(t,u,s.cache),s.check=function(){if(l){var e=i(t,u,s.cache);return e.changed&&o&&void 0!==s.lookupTable[e.value]&&(s.disable(),Promise.resolve(o({value:e.value,type:u.type,prop:u.prop,traces:u.traces,index:s.lookupTable[e.value]})).then(s.enable,s.enable)),e.changed}};for(var c=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],f=0;fMath.abs(s)?(u.boxEnd[1]=u.boxStart[1]+Math.abs(i)*_*(s>=0?1:-1),u.boxEnd[1]l[3]&&(u.boxEnd[1]=l[3],u.boxEnd[0]=u.boxStart[0]+(l[3]-u.boxStart[1])/Math.abs(_))):(u.boxEnd[0]=u.boxStart[0]+Math.abs(s)/_*(i>=0?1:-1),u.boxEnd[0]l[2]&&(u.boxEnd[0]=l[2],u.boxEnd[1]=u.boxStart[1]+(l[2]-u.boxStart[0])*Math.abs(_)))}}else u.boxEnabled?(i=u.boxStart[0]!==u.boxEnd[0],s=u.boxStart[1]!==u.boxEnd[1],i||s?(i&&(v(0,u.boxStart[0],u.boxEnd[0]),t.xaxis.autorange=!1),s&&(v(1,u.boxStart[1],u.boxEnd[1]),t.yaxis.autorange=!1),t.relayoutCallback()):t.glplot.setDirty(),u.boxEnabled=!1,u.boxInited=!1):u.boxInited&&(u.boxInited=!1);break;case"pan":u.boxEnabled=!1,u.boxInited=!1,e?(u.panning||(u.dragStart[0]=n,u.dragStart[1]=a),Math.abs(u.dragStart[0]-n)=e.width-20?(i["text-anchor"]="start",i.x=5):(i["text-anchor"]="end",i.x=e._paper.attr("width")-7),r.attr(i);var o=r.select(".js-link-to-tool"),s=r.select(".js-link-spacer"),l=r.select(".js-sourcelinks");t._context.showSources&&t._context.showSources(t),t._context.showLink&&function(t,e){e.text("");var r=e.append("a").attr({"xlink:xlink:href":"#",class:"link--impt link--embedview","font-weight":"bold"}).text(t._context.linkText+" "+String.fromCharCode(187));if(t._context.sendData)r.on("click",(function(){b.sendDataToCloud(t)}));else{var n=window.location.pathname.split("/"),a=window.location.search;r.attr({"xlink:xlink:show":"new","xlink:xlink:href":"/"+n[2].split(".")[0]+"/"+n[1]+a})}}(t,o),s.text(o.text()&&l.text()?" - ":"")}},b.sendDataToCloud=function(t){var e=(window.PLOTLYENV||{}).BASE_URL||t._context.plotlyServerURL;if(e){t.emit("plotly_beforeexport");var r=n.select(t).append("div").attr("id","hiddenform").style("display","none"),a=r.append("form").attr({action:e+"/external",method:"post",target:"_blank"});return a.append("input").attr({type:"text",name:"data"}).node().value=b.graphJson(t,!1,"keepdata"),a.node().submit(),r.remove(),t.emit("plotly_afterexport"),!1}};var w=["days","shortDays","months","shortMonths","periods","dateTime","date","time","decimal","thousands","grouping","currency"],A=["year","month","dayMonth","dayMonthYear"];function T(t,e){var r=t._context.locale;r||(r="en-US");var n=!1,a={};function i(t){for(var r=!0,i=0;i1&&I.length>1){for(o.getComponentMethod("grid","sizeDefaults")(c,l),s=0;s15&&I.length>15&&0===l.shapes.length&&0===l.images.length,l._hasCartesian=l._has("cartesian"),l._hasGeo=l._has("geo"),l._hasGL3D=l._has("gl3d"),l._hasGL2D=l._has("gl2d"),l._hasTernary=l._has("ternary"),l._hasPie=l._has("pie"),b.linkSubplots(d,l,f,i),b.cleanPlot(d,l,f,i);var B=!(!i._has||!i._has("gl2d")),j=!(!l._has||!l._has("gl2d")),U=!(!i._has||!i._has("cartesian"))||B,V=!(!l._has||!l._has("cartesian"))||j;U&&!V?i._bgLayer.remove():V&&!U&&(l._shouldCreateBgLayer=!0),i._zoomlayer&&!t._dragging&&h({_fullLayout:i}),function(t,e){var r,n=[];e.meta&&(r=e._meta={meta:e.meta,layout:{meta:e.meta}});for(var a=0;a0){var f=1-2*s;n=Math.round(f*n),a=Math.round(f*a)}}var d=b.layoutAttributes.width.min,h=b.layoutAttributes.height.min;n1,g=!e.height&&Math.abs(r.height-a)>1;(g||p)&&(p&&(r.width=n),g&&(r.height=a)),t._initialAutoSize||(t._initialAutoSize={width:n,height:a}),b.sanitizeMargins(r)},b.supplyLayoutModuleDefaults=function(t,e,r,n){var a,i,s,l=o.componentsRegistry,c=e._basePlotModules,f=o.subplotsRegistry.cartesian;for(a in l)(s=l[a]).includeBasePlot&&s.includeBasePlot(t,e);for(var d in c.length||c.push(f),e._has("cartesian")&&(o.getComponentMethod("grid","contentDefaults")(t,e),f.finalizeSubplots(t,e)),e._subplots)e._subplots[d].sort(u.subplotSort);for(i=0;i1&&(r.l/=g,r.r/=g)}if(f){var v=(r.t+r.b)/f;v>1&&(r.t/=v,r.b/=v)}var m=void 0!==r.xl?r.xl:r.x,y=void 0!==r.xr?r.xr:r.x,x=void 0!==r.yt?r.yt:r.y,_=void 0!==r.yb?r.yb:r.y;d[e]={l:{val:m,size:r.l+p},r:{val:y,size:r.r+p},b:{val:_,size:r.b+p},t:{val:x,size:r.t+p}},h[e]=1}else delete d[e],delete h[e];if(!n._replotting)return b.doAutoMargin(t)}},b.doAutoMargin=function(t){var e=t._fullLayout,r=e.width,n=e.height;e._size||(e._size={}),C(e);var a=e._size,s=e.margin,l=u.extendFlat({},a),c=s.l,f=s.r,h=s.t,p=s.b,g=e._pushmargin,v=e._pushmarginIds;if(!1!==e.margin.autoexpand){for(var m in g)v[m]||delete g[m];for(var y in g.base={l:{val:0,size:c},r:{val:1,size:f},t:{val:1,size:h},b:{val:0,size:p}},g){var x=g[y].l||{},_=g[y].b||{},w=x.val,A=x.size,T=_.val,k=_.size;for(var M in g){if(i(A)&&g[M].r){var E=g[M].r.val,S=g[M].r.size;if(E>w){var L=(A*E+(S-r)*w)/(E-w),O=(S*(1-w)+(A-r)*(1-E))/(E-w);L+O>c+f&&(c=L,f=O)}}if(i(k)&&g[M].t){var D=g[M].t.val,R=g[M].t.size;if(D>T){var I=(k*D+(R-n)*T)/(D-T),P=(R*(1-T)+(k-n)*(1-D))/(D-T);I+P>p+h&&(p=I,h=P)}}}}}var F=u.constrain(r-s.l-s.r,2,64),z=u.constrain(n-s.t-s.b,2,64),N=Math.max(0,r-F),B=Math.max(0,n-z);if(N){var j=(c+f)/N;j>1&&(c/=j,f/=j)}if(B){var U=(p+h)/B;U>1&&(p/=U,h/=U)}if(a.l=Math.round(c),a.r=Math.round(f),a.t=Math.round(h),a.b=Math.round(p),a.p=Math.round(s.pad),a.w=Math.round(r)-a.l-a.r,a.h=Math.round(n)-a.t-a.b,!e._replotting&&b.didMarginChange(l,a)){"_redrawFromAutoMarginCount"in e?e._redrawFromAutoMarginCount++:e._redrawFromAutoMarginCount=1;var V=3*(1+Object.keys(v).length);if(e._redrawFromAutoMarginCount0&&(t._transitioningWithDuration=!0),t._transitionData._interruptCallbacks.push((function(){n=!0})),r.redraw&&t._transitionData._interruptCallbacks.push((function(){return o.call("redraw",t)})),t._transitionData._interruptCallbacks.push((function(){t.emit("plotly_transitioninterrupted",[])}));var i=0,s=0;function l(){return i++,function(){s++,n||s!==i||function(e){if(!t._transitionData)return;(function(t){if(t)for(;t.length;)t.shift()})(t._transitionData._interruptCallbacks),Promise.resolve().then((function(){if(r.redraw)return o.call("redraw",t)})).then((function(){t._transitioning=!1,t._transitioningWithDuration=!1,t.emit("plotly_transitioned",[])})).then(e)}(a)}}r.runFn(l),setTimeout(l())}))}],i=u.syncOrAsync(a,t);return i&&i.then||(i=Promise.resolve()),i.then((function(){return t}))}b.didMarginChange=function(t,e){for(var r=0;r1)return!0}return!1},b.graphJson=function(t,e,r,n,a,i){(a&&e&&!t._fullData||a&&!e&&!t._fullLayout)&&b.supplyDefaults(t);var o=a?t._fullData:t.data,s=a?t._fullLayout:t.layout,l=(t._transitionData||{})._frames;function c(t,e){if("function"==typeof t)return e?"_function_":null;if(u.isPlainObject(t)){var n,a={};return Object.keys(t).sort().forEach((function(i){if(-1===["_","["].indexOf(i.charAt(0)))if("function"!=typeof t[i]){if("keepdata"===r){if("src"===i.substr(i.length-3))return}else if("keepstream"===r){if("string"==typeof(n=t[i+"src"])&&n.indexOf(":")>0&&!u.isPlainObject(t.stream))return}else if("keepall"!==r&&"string"==typeof(n=t[i+"src"])&&n.indexOf(":")>0)return;a[i]=c(t[i],e)}else e&&(a[i]="_function")})),a}return Array.isArray(t)?t.map((function(t){return c(t,e)})):u.isTypedArray(t)?u.simpleMap(t,u.identity):u.isJSDate(t)?u.ms2DateTimeLocal(+t):t}var f={data:(o||[]).map((function(t){var r=c(t);return e&&delete r.fit,r}))};if(!e&&(f.layout=c(s),a)){var d=s._size;f.layout.computed={margin:{b:d.b,l:d.l,r:d.r,t:d.t}}}return t.framework&&t.framework.isPolar&&(f=t.framework.getConfig()),l&&(f.frames=c(l)),i&&(f.config=c(t._context,!0)),"object"===n?f:JSON.stringify(f)},b.modifyFrames=function(t,e){var r,n,a,i=t._transitionData._frames,o=t._transitionData._frameHash;for(r=0;r=0;i--)if(s[i].enabled){r._indexToPoints=s[i]._indexToPoints;break}n&&n.calc&&(o=n.calc(t,r))}Array.isArray(o)&&o[0]||(o=[{x:f,y:f}]),o[0].t||(o[0].t={}),o[0].trace=r,p[e]=o}}for(R(l,c,h),a=0;a=0?d.angularAxis.domain:n.extent(A),S=Math.abs(A[1]-A[0]);k&&!T&&(S=0);var C=E.slice();M&&T&&(C[1]+=S);var L=d.angularAxis.ticksCount||4;L>8&&(L=L/(L/8)+L%8),d.angularAxis.ticksStep&&(L=(C[1]-C[0])/L);var O=d.angularAxis.ticksStep||(C[1]-C[0])/(L*(d.minorTicks+1));w&&(O=Math.max(Math.round(O),1)),C[2]||(C[2]=O);var D=n.range.apply(this,C);if(D=D.map((function(t,e){return parseFloat(t.toPrecision(12))})),s=n.scale.linear().domain(C.slice(0,2)).range("clockwise"===d.direction?[0,360]:[360,0]),c.layout.angularAxis.domain=s.domain(),c.layout.angularAxis.endPadding=M?S:0,"undefined"==typeof(t=n.select(this).select("svg.chart-root"))||t.empty()){var R=(new DOMParser).parseFromString("' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '","application/xml"),I=this.appendChild(this.ownerDocument.importNode(R.documentElement,!0));t=n.select(I)}t.select(".guides-group").style({"pointer-events":"none"}),t.select(".angular.axis-group").style({"pointer-events":"none"}),t.select(".radial.axis-group").style({"pointer-events":"none"});var P,F=t.select(".chart-group"),z={fill:"none",stroke:d.tickColor},N={"font-size":d.font.size,"font-family":d.font.family,fill:d.font.color,"text-shadow":["-1px 0px","1px -1px","-1px 1px","1px 1px"].map((function(t,e){return" "+t+" 0 "+d.font.outlineColor})).join(",")};if(d.showLegend){P=t.select(".legend-group").attr({transform:"translate("+[b,d.margin.top]+")"}).style({display:"block"});var B=h.map((function(t,e){var r=o.util.cloneJson(t);return r.symbol="DotPlot"===t.geometry?t.dotType||"circle":"LinePlot"!=t.geometry?"square":"line",r.visibleInLegend="undefined"==typeof t.visibleInLegend||t.visibleInLegend,r.color="LinePlot"===t.geometry?t.strokeColor:t.color,r}));o.Legend().config({data:h.map((function(t,e){return t.name||"Element"+e})),legendConfig:a({},o.Legend.defaultConfig().legendConfig,{container:P,elements:B,reverseOrder:d.legend.reverseOrder})})();var j=P.node().getBBox();b=Math.min(d.width-j.width-d.margin.left-d.margin.right,d.height-d.margin.top-d.margin.bottom)/2,b=Math.max(10,b),_=[d.margin.left+b,d.margin.top+b],r.range([0,b]),c.layout.radialAxis.domain=r.domain(),P.attr("transform","translate("+[_[0]+b,_[1]-b]+")")}else P=t.select(".legend-group").style({display:"none"});t.attr({width:d.width,height:d.height}).style({opacity:d.opacity}),F.attr("transform","translate("+_+")").style({cursor:"crosshair"});var U=[(d.width-(d.margin.left+d.margin.right+2*b+(j?j.width:0)))/2,(d.height-(d.margin.top+d.margin.bottom+2*b))/2];if(U[0]=Math.max(0,U[0]),U[1]=Math.max(0,U[1]),t.select(".outer-group").attr("transform","translate("+U+")"),d.title&&d.title.text){var V=t.select("g.title-group text").style(N).text(d.title.text),H=V.node().getBBox();V.attr({x:_[0]-H.width/2,y:_[1]-b-20})}var G=t.select(".radial.axis-group");if(d.radialAxis.gridLinesVisible){var q=G.selectAll("circle.grid-circle").data(r.ticks(5));q.enter().append("circle").attr({class:"grid-circle"}).style(z),q.attr("r",r),q.exit().remove()}G.select("circle.outside-circle").attr({r:b}).style(z);var X=t.select("circle.background-circle").attr({r:b}).style({fill:d.backgroundColor,stroke:d.stroke});function W(t,e){return s(t)%360+d.orientation}if(d.radialAxis.visible){var Y=n.svg.axis().scale(r).ticks(5).tickSize(5);G.call(Y).attr({transform:"rotate("+d.radialAxis.orientation+")"}),G.selectAll(".domain").style(z),G.selectAll("g>text").text((function(t,e){return this.textContent+d.radialAxis.ticksSuffix})).style(N).style({"text-anchor":"start"}).attr({x:0,y:0,dx:0,dy:0,transform:function(t,e){return"horizontal"===d.radialAxis.tickOrientation?"rotate("+-d.radialAxis.orientation+") translate("+[0,N["font-size"]]+")":"translate("+[0,N["font-size"]]+")"}}),G.selectAll("g>line").style({stroke:"black"})}var Z=t.select(".angular.axis-group").selectAll("g.angular-tick").data(D),J=Z.enter().append("g").classed("angular-tick",!0);Z.attr({transform:function(t,e){return"rotate("+W(t)+")"}}).style({display:d.angularAxis.visible?"block":"none"}),Z.exit().remove(),J.append("line").classed("grid-line",!0).classed("major",(function(t,e){return e%(d.minorTicks+1)==0})).classed("minor",(function(t,e){return!(e%(d.minorTicks+1)==0)})).style(z),J.selectAll(".minor").style({stroke:d.minorTickColor}),Z.select("line.grid-line").attr({x1:d.tickLength?b-d.tickLength:0,x2:b}).style({display:d.angularAxis.gridLinesVisible?"block":"none"}),J.append("text").classed("axis-text",!0).style(N);var Q=Z.select("text.axis-text").attr({x:b+d.labelOffset,dy:i+"em",transform:function(t,e){var r=W(t),n=b+d.labelOffset,a=d.angularAxis.tickOrientation;return"horizontal"==a?"rotate("+-r+" "+n+" 0)":"radial"==a?r<270&&r>90?"rotate(180 "+n+" 0)":null:"rotate("+(r<=180&&r>0?-90:90)+" "+n+" 0)"}}).style({"text-anchor":"middle",display:d.angularAxis.labelsVisible?"block":"none"}).text((function(t,e){return e%(d.minorTicks+1)!=0?"":w?w[t]+d.angularAxis.ticksSuffix:t+d.angularAxis.ticksSuffix})).style(N);d.angularAxis.rewriteTicks&&Q.text((function(t,e){return e%(d.minorTicks+1)!=0?"":d.angularAxis.rewriteTicks(this.textContent,e)}));var $=n.max(F.selectAll(".angular-tick text")[0].map((function(t,e){return t.getCTM().e+t.getBBox().width})));P.attr({transform:"translate("+[b+$,d.margin.top]+")"});var K=t.select("g.geometry-group").selectAll("g").size()>0,tt=t.select("g.geometry-group").selectAll("g.geometry").data(h);if(tt.enter().append("g").attr({class:function(t,e){return"geometry geometry"+e}}),tt.exit().remove(),h[0]||K){var et=[];h.forEach((function(t,e){var n={};n.radialScale=r,n.angularScale=s,n.container=tt.filter((function(t,r){return r==e})),n.geometry=t.geometry,n.orientation=d.orientation,n.direction=d.direction,n.index=e,et.push({data:t,geometryConfig:n})}));var rt=n.nest().key((function(t,e){return"undefined"!=typeof t.data.groupId||"unstacked"})).entries(et),nt=[];rt.forEach((function(t,e){"unstacked"===t.key?nt=nt.concat(t.values.map((function(t,e){return[t]}))):nt.push(t.values)})),nt.forEach((function(t,e){var r;r=Array.isArray(t)?t[0].geometryConfig.geometry:t.geometryConfig.geometry;var n=t.map((function(t,e){return a(o[r].defaultConfig(),t)}));o[r]().config(n)()}))}var at,it,ot=t.select(".guides-group"),st=t.select(".tooltips-group"),lt=o.tooltipPanel().config({container:st,fontSize:8})(),ut=o.tooltipPanel().config({container:st,fontSize:8})(),ct=o.tooltipPanel().config({container:st,hasTick:!0})();if(!T){var ft=ot.select("line").attr({x1:0,y1:0,y2:0}).style({stroke:"grey","pointer-events":"none"});F.on("mousemove.angular-guide",(function(t,e){var r=o.util.getMousePos(X).angle;ft.attr({x2:-b,transform:"rotate("+r+")"}).style({opacity:.5});var n=(r+180+360-d.orientation)%360;at=s.invert(n);var a=o.util.convertToCartesian(b+12,r+180);lt.text(o.util.round(at)).move([a[0]+_[0],a[1]+_[1]])})).on("mouseout.angular-guide",(function(t,e){ot.select("line").style({opacity:0})}))}var dt=ot.select("circle").style({stroke:"grey",fill:"none"});F.on("mousemove.radial-guide",(function(t,e){var n=o.util.getMousePos(X).radius;dt.attr({r:n}).style({opacity:.5}),it=r.invert(o.util.getMousePos(X).radius);var a=o.util.convertToCartesian(n,d.radialAxis.orientation);ut.text(o.util.round(it)).move([a[0]+_[0],a[1]+_[1]])})).on("mouseout.radial-guide",(function(t,e){dt.style({opacity:0}),ct.hide(),lt.hide(),ut.hide()})),t.selectAll(".geometry-group .mark").on("mouseover.tooltip",(function(e,r){var a=n.select(this),i=this.style.fill,s="black",l=this.style.opacity||1;if(a.attr({"data-opacity":l}),i&&"none"!==i){a.attr({"data-fill":i}),s=n.hsl(i).darker().toString(),a.style({fill:s,opacity:1});var u={t:o.util.round(e[0]),r:o.util.round(e[1])};T&&(u.t=w[e[0]]);var c="t: "+u.t+", r: "+u.r,f=this.getBoundingClientRect(),d=t.node().getBoundingClientRect(),h=[f.left+f.width/2-U[0]-d.left,f.top+f.height/2-U[1]-d.top];ct.config({color:s}).text(c),ct.move(h)}else i=this.style.stroke||"black",a.attr({"data-stroke":i}),s=n.hsl(i).darker().toString(),a.style({stroke:s,opacity:1})})).on("mousemove.tooltip",(function(t,e){if(0!=n.event.which)return!1;n.select(this).attr("data-fill")&&ct.show()})).on("mouseout.tooltip",(function(t,e){ct.hide();var r=n.select(this),a=r.attr("data-fill");a?r.style({fill:a,opacity:r.attr("data-opacity")}):r.style({stroke:r.attr("data-stroke"),opacity:r.attr("data-opacity")})}))}))}(u),this},d.config=function(t){if(!arguments.length)return l;var e=o.util.cloneJson(t);return e.data.forEach((function(t,e){l.data[e]||(l.data[e]={}),a(l.data[e],o.Axis.defaultConfig().data[0]),a(l.data[e],t)})),a(l.layout,o.Axis.defaultConfig().layout),a(l.layout,e.layout),this},d.getLiveConfig=function(){return c},d.getinputConfig=function(){return u},d.radialScale=function(t){return r},d.angularScale=function(t){return s},d.svg=function(){return t},n.rebind(d,f,"on"),d},o.Axis.defaultConfig=function(t,e){return{data:[{t:[1,2,3,4],r:[10,11,12,13],name:"Line1",geometry:"LinePlot",color:null,strokeDash:"solid",strokeColor:null,strokeSize:"1",visibleInLegend:!0,opacity:1}],layout:{defaultColorRange:n.scale.category10().range(),title:null,height:450,width:500,margin:{top:40,right:40,bottom:40,left:40},font:{size:12,color:"gray",outlineColor:"white",family:"Tahoma, sans-serif"},direction:"clockwise",orientation:0,labelOffset:10,radialAxis:{domain:null,orientation:-45,ticksSuffix:"",visible:!0,gridLinesVisible:!0,tickOrientation:"horizontal",rewriteTicks:null},angularAxis:{domain:[0,360],ticksSuffix:"",visible:!0,gridLinesVisible:!0,labelsVisible:!0,tickOrientation:"horizontal",rewriteTicks:null,ticksCount:null,ticksStep:null},minorTicks:0,tickLength:null,tickColor:"silver",minorTickColor:"#eee",backgroundColor:"none",needsEndSpacing:null,showLegend:!0,legend:{reverseOrder:!1},opacity:1}}},o.util={},o.DATAEXTENT="dataExtent",o.AREA="AreaChart",o.LINE="LinePlot",o.DOT="DotPlot",o.BAR="BarChart",o.util._override=function(t,e){for(var r in t)r in e&&(e[r]=t[r])},o.util._extend=function(t,e){for(var r in t)e[r]=t[r]},o.util._rndSnd=function(){return 2*Math.random()-1+(2*Math.random()-1)+(2*Math.random()-1)},o.util.dataFromEquation2=function(t,e){var r=e||6;return n.range(0,360+r,r).map((function(e,r){var n=e*Math.PI/180;return[e,t(n)]}))},o.util.dataFromEquation=function(t,e,r){var a=e||6,i=[],o=[];n.range(0,360+a,a).forEach((function(e,r){var n=e*Math.PI/180,a=t(n);i.push(e),o.push(a)}));var s={t:i,r:o};return r&&(s.name=r),s},o.util.ensureArray=function(t,e){if("undefined"==typeof t)return null;var r=[].concat(t);return n.range(e).map((function(t,e){return r[e]||r[0]}))},o.util.fillArrays=function(t,e,r){return e.forEach((function(e,n){t[e]=o.util.ensureArray(t[e],r)})),t},o.util.cloneJson=function(t){return JSON.parse(JSON.stringify(t))},o.util.validateKeys=function(t,e){"string"==typeof e&&(e=e.split("."));var r=e.shift();return t[r]&&(!e.length||objHasKeys(t[r],e))},o.util.sumArrays=function(t,e){return n.zip(t,e).map((function(t,e){return n.sum(t)}))},o.util.arrayLast=function(t){return t[t.length-1]},o.util.arrayEqual=function(t,e){for(var r=Math.max(t.length,e.length,1);r-- >=0&&t[r]===e[r];);return-2===r},o.util.flattenArray=function(t){for(var e=[];!o.util.arrayEqual(e,t);)e=t,t=[].concat.apply([],t);return t},o.util.deduplicate=function(t){return t.filter((function(t,e,r){return r.indexOf(t)==e}))},o.util.convertToCartesian=function(t,e){var r=e*Math.PI/180;return[t*Math.cos(r),t*Math.sin(r)]},o.util.round=function(t,e){var r=e||2,n=Math.pow(10,r);return Math.round(t*n)/n},o.util.getMousePos=function(t){var e=n.mouse(t.node()),r=e[0],a=e[1],i={};return i.x=r,i.y=a,i.pos=e,i.angle=180*(Math.atan2(a,r)+Math.PI)/Math.PI,i.radius=Math.sqrt(r*r+a*a),i},o.util.duplicatesCount=function(t){for(var e,r={},n={},a=0,i=t.length;a0)){var l=n.select(this.parentNode).selectAll("path.line").data([0]);l.enter().insert("path"),l.attr({class:"line",d:c(s),transform:function(t,r){return"rotate("+(e.orientation+90)+")"},"pointer-events":"none"}).style({fill:function(t,e){return p.fill(r,a,i)},"fill-opacity":0,stroke:function(t,e){return p.stroke(r,a,i)},"stroke-width":function(t,e){return p["stroke-width"](r,a,i)},"stroke-dasharray":function(t,e){return p["stroke-dasharray"](r,a,i)},opacity:function(t,e){return p.opacity(r,a,i)},display:function(t,e){return p.display(r,a,i)}})}};var f=e.angularScale.range(),d=Math.abs(f[1]-f[0])/o[0].length*Math.PI/180,h=n.svg.arc().startAngle((function(t){return-d/2})).endAngle((function(t){return d/2})).innerRadius((function(t){return e.radialScale(l+(t[2]||0))})).outerRadius((function(t){return e.radialScale(l+(t[2]||0))+e.radialScale(t[1])}));u.arc=function(t,r,a){n.select(this).attr({class:"mark arc",d:h,transform:function(t,r){return"rotate("+(e.orientation+s(t[0])+90)+")"}})};var p={fill:function(e,r,n){return t[n].data.color},stroke:function(e,r,n){return t[n].data.strokeColor},"stroke-width":function(e,r,n){return t[n].data.strokeSize+"px"},"stroke-dasharray":function(e,n,a){return r[t[a].data.strokeDash]},opacity:function(e,r,n){return t[n].data.opacity},display:function(e,r,n){return"undefined"==typeof t[n].data.visible||t[n].data.visible?"block":"none"}},g=n.select(this).selectAll("g.layer").data(o);g.enter().append("g").attr({class:"layer"});var v=g.selectAll("path.mark").data((function(t,e){return t}));v.enter().append("path").attr({class:"mark"}),v.style(p).each(u[e.geometryType]),v.exit().remove(),g.exit().remove()}))}return i.config=function(e){return arguments.length?(e.forEach((function(e,r){t[r]||(t[r]={}),a(t[r],o.PolyChart.defaultConfig()),a(t[r],e)})),this):t},i.getColorScale=function(){},n.rebind(i,e,"on"),i},o.PolyChart.defaultConfig=function(){return{data:{name:"geom1",t:[[1,2,3,4]],r:[[1,2,3,4]],dotType:"circle",dotSize:64,dotVisible:!1,barWidth:20,color:"#ffa500",strokeSize:1,strokeColor:"silver",strokeDash:"solid",opacity:1,index:0,visible:!0,visibleInLegend:!0},geometryConfig:{geometry:"LinePlot",geometryType:"arc",direction:"clockwise",orientation:0,container:"body",radialScale:null,angularScale:null,colorScale:n.scale.category20()}}},o.BarChart=function(){return o.PolyChart()},o.BarChart.defaultConfig=function(){return{geometryConfig:{geometryType:"bar"}}},o.AreaChart=function(){return o.PolyChart()},o.AreaChart.defaultConfig=function(){return{geometryConfig:{geometryType:"arc"}}},o.DotPlot=function(){return o.PolyChart()},o.DotPlot.defaultConfig=function(){return{geometryConfig:{geometryType:"dot",dotType:"circle"}}},o.LinePlot=function(){return o.PolyChart()},o.LinePlot.defaultConfig=function(){return{geometryConfig:{geometryType:"line"}}},o.Legend=function(){var t=o.Legend.defaultConfig(),e=n.dispatch("hover");function r(){var e=t.legendConfig,i=t.data.map((function(t,r){return[].concat(t).map((function(t,n){var i=a({},e.elements[r]);return i.name=t,i.color=[].concat(e.elements[r].color)[n],i}))})),o=n.merge(i);o=o.filter((function(t,r){return e.elements[r]&&(e.elements[r].visibleInLegend||"undefined"==typeof e.elements[r].visibleInLegend)})),e.reverseOrder&&(o=o.reverse());var s=e.container;("string"==typeof s||s.nodeName)&&(s=n.select(s));var l=o.map((function(t,e){return t.color})),u=e.fontSize,c=null==e.isContinuous?"number"==typeof o[0]:e.isContinuous,f=c?e.height:u*o.length,d=s.classed("legend-group",!0).selectAll("svg").data([0]),h=d.enter().append("svg").attr({width:300,height:f+u,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"});h.append("g").classed("legend-axis",!0),h.append("g").classed("legend-marks",!0);var p=n.range(o.length),g=n.scale[c?"linear":"ordinal"]().domain(p).range(l),v=n.scale[c?"linear":"ordinal"]().domain(p)[c?"range":"rangePoints"]([0,f]);if(c){var m=d.select(".legend-marks").append("defs").append("linearGradient").attr({id:"grad1",x1:"0%",y1:"0%",x2:"0%",y2:"100%"}).selectAll("stop").data(l);m.enter().append("stop"),m.attr({offset:function(t,e){return e/(l.length-1)*100+"%"}}).style({"stop-color":function(t,e){return t}}),d.append("rect").classed("legend-mark",!0).attr({height:e.height,width:e.colorBandWidth,fill:"url(#grad1)"})}else{var y=d.select(".legend-marks").selectAll("path.legend-mark").data(o);y.enter().append("path").classed("legend-mark",!0),y.attr({transform:function(t,e){return"translate("+[u/2,v(e)+u/2]+")"},d:function(t,e){var r,a,i,o=t.symbol;return i=3*(a=u),"line"===(r=o)?"M"+[[-a/2,-a/12],[a/2,-a/12],[a/2,a/12],[-a/2,a/12]]+"Z":-1!=n.svg.symbolTypes.indexOf(r)?n.svg.symbol().type(r).size(i)():n.svg.symbol().type("square").size(i)()},fill:function(t,e){return g(e)}}),y.exit().remove()}var b=n.svg.axis().scale(v).orient("right"),x=d.select("g.legend-axis").attr({transform:"translate("+[c?e.colorBandWidth:u,u/2]+")"}).call(b);return x.selectAll(".domain").style({fill:"none",stroke:"none"}),x.selectAll("line").style({fill:"none",stroke:c?e.textColor:"none"}),x.selectAll("text").style({fill:e.textColor,"font-size":e.fontSize}).text((function(t,e){return o[e].name})),r}return r.config=function(e){return arguments.length?(a(t,e),this):t},n.rebind(r,e,"on"),r},o.Legend.defaultConfig=function(t,e){return{data:["a","b","c"],legendConfig:{elements:[{symbol:"line",color:"red"},{symbol:"square",color:"yellow"},{symbol:"diamond",color:"limegreen"}],height:150,colorBandWidth:30,fontSize:12,container:"body",isContinuous:null,textColor:"grey",reverseOrder:!1}}},o.tooltipPanel=function(){var t,e,r,i={container:null,hasTick:!1,fontSize:12,color:"white",padding:5},s="tooltip-"+o.tooltipPanel.uid++,l=10,u=function(){var n=(t=i.container.selectAll("g."+s).data([0])).enter().append("g").classed(s,!0).style({"pointer-events":"none",display:"none"});return r=n.append("path").style({fill:"white","fill-opacity":.9}).attr({d:"M0 0"}),e=n.append("text").attr({dx:i.padding+l,dy:.3*+i.fontSize}),u};return u.text=function(a){var o=n.hsl(i.color).l,s=o>=.5?"#aaa":"white",c=o>=.5?"black":"white",f=a||"";e.style({fill:c,"font-size":i.fontSize+"px"}).text(f);var d=i.padding,h=e.node().getBBox(),p={fill:i.color,stroke:s,"stroke-width":"2px"},g=h.width+2*d+l,v=h.height+2*d;return r.attr({d:"M"+[[l,-v/2],[l,-v/4],[i.hasTick?0:l,0],[l,v/4],[l,v/2],[g,v/2],[g,-v/2]].join("L")+"Z"}).style(p),t.attr({transform:"translate("+[l,-v/2+2*d]+")"}),t.style({display:"block"}),u},u.move=function(e){if(t)return t.attr({transform:"translate("+[e[0],e[1]]+")"}).style({display:"block"}),u},u.hide=function(){if(t)return t.style({display:"none"}),u},u.show=function(){if(t)return t.style({display:"block"}),u},u.config=function(t){return a(i,t),u},u},o.tooltipPanel.uid=1,o.adapter={},o.adapter.plotly=function(){var t={convert:function(t,e){var r={};if(t.data&&(r.data=t.data.map((function(t,r){var n=a({},t);return[[n,["marker","color"],["color"]],[n,["marker","opacity"],["opacity"]],[n,["marker","line","color"],["strokeColor"]],[n,["marker","line","dash"],["strokeDash"]],[n,["marker","line","width"],["strokeSize"]],[n,["marker","symbol"],["dotType"]],[n,["marker","size"],["dotSize"]],[n,["marker","barWidth"],["barWidth"]],[n,["line","interpolation"],["lineInterpolation"]],[n,["showlegend"],["visibleInLegend"]]].forEach((function(t,r){o.util.translator.apply(null,t.concat(e))})),e||delete n.marker,e&&delete n.groupId,e?("LinePlot"===n.geometry?(n.type="scatter",!0===n.dotVisible?(delete n.dotVisible,n.mode="lines+markers"):n.mode="lines"):"DotPlot"===n.geometry?(n.type="scatter",n.mode="markers"):"AreaChart"===n.geometry?n.type="area":"BarChart"===n.geometry&&(n.type="bar"),delete n.geometry):("scatter"===n.type?"lines"===n.mode?n.geometry="LinePlot":"markers"===n.mode?n.geometry="DotPlot":"lines+markers"===n.mode&&(n.geometry="LinePlot",n.dotVisible=!0):"area"===n.type?n.geometry="AreaChart":"bar"===n.type&&(n.geometry="BarChart"),delete n.mode,delete n.type),n})),!e&&t.layout&&"stack"===t.layout.barmode)){var i=o.util.duplicates(r.data.map((function(t,e){return t.geometry})));r.data.forEach((function(t,e){var n=i.indexOf(t.geometry);-1!=n&&(r.data[e].groupId=n)}))}if(t.layout){var s=a({},t.layout);if([[s,["plot_bgcolor"],["backgroundColor"]],[s,["showlegend"],["showLegend"]],[s,["radialaxis"],["radialAxis"]],[s,["angularaxis"],["angularAxis"]],[s.angularaxis,["showline"],["gridLinesVisible"]],[s.angularaxis,["showticklabels"],["labelsVisible"]],[s.angularaxis,["nticks"],["ticksCount"]],[s.angularaxis,["tickorientation"],["tickOrientation"]],[s.angularaxis,["ticksuffix"],["ticksSuffix"]],[s.angularaxis,["range"],["domain"]],[s.angularaxis,["endpadding"],["endPadding"]],[s.radialaxis,["showline"],["gridLinesVisible"]],[s.radialaxis,["tickorientation"],["tickOrientation"]],[s.radialaxis,["ticksuffix"],["ticksSuffix"]],[s.radialaxis,["range"],["domain"]],[s.angularAxis,["showline"],["gridLinesVisible"]],[s.angularAxis,["showticklabels"],["labelsVisible"]],[s.angularAxis,["nticks"],["ticksCount"]],[s.angularAxis,["tickorientation"],["tickOrientation"]],[s.angularAxis,["ticksuffix"],["ticksSuffix"]],[s.angularAxis,["range"],["domain"]],[s.angularAxis,["endpadding"],["endPadding"]],[s.radialAxis,["showline"],["gridLinesVisible"]],[s.radialAxis,["tickorientation"],["tickOrientation"]],[s.radialAxis,["ticksuffix"],["ticksSuffix"]],[s.radialAxis,["range"],["domain"]],[s.font,["outlinecolor"],["outlineColor"]],[s.legend,["traceorder"],["reverseOrder"]],[s,["labeloffset"],["labelOffset"]],[s,["defaultcolorrange"],["defaultColorRange"]]].forEach((function(t,r){o.util.translator.apply(null,t.concat(e))})),e?("undefined"!=typeof s.tickLength&&(s.angularaxis.ticklen=s.tickLength,delete s.tickLength),s.tickColor&&(s.angularaxis.tickcolor=s.tickColor,delete s.tickColor)):(s.angularAxis&&"undefined"!=typeof s.angularAxis.ticklen&&(s.tickLength=s.angularAxis.ticklen),s.angularAxis&&"undefined"!=typeof s.angularAxis.tickcolor&&(s.tickColor=s.angularAxis.tickcolor)),s.legend&&"boolean"!=typeof s.legend.reverseOrder&&(s.legend.reverseOrder="normal"!=s.legend.reverseOrder),s.legend&&"boolean"==typeof s.legend.traceorder&&(s.legend.traceorder=s.legend.traceorder?"reversed":"normal",delete s.legend.reverseOrder),s.margin&&"undefined"!=typeof s.margin.t){var l=["t","r","b","l","pad"],u=["top","right","bottom","left","pad"],c={};n.entries(s.margin).forEach((function(t,e){c[u[l.indexOf(t.key)]]=t.value})),s.margin=c}e&&(delete s.needsEndSpacing,delete s.minorTickColor,delete s.minorTicks,delete s.angularaxis.ticksCount,delete s.angularaxis.ticksCount,delete s.angularaxis.ticksStep,delete s.angularaxis.rewriteTicks,delete s.angularaxis.nticks,delete s.radialaxis.ticksCount,delete s.radialaxis.ticksCount,delete s.radialaxis.ticksStep,delete s.radialaxis.rewriteTicks,delete s.radialaxis.nticks),r.layout=s}return r}};return t}},{"../../../constants/alignment":470,"../../../lib":498,d3:86}],590:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../../lib"),i=t("../../../components/color"),o=t("./micropolar"),s=t("./undo_manager"),l=a.extendDeepAll,u=e.exports={};u.framework=function(t){var e,r,a,i,c,f=new s;function d(r,s){return s&&(c=s),n.select(n.select(c).node().parentNode).selectAll(".svg-container>*:not(.chart-root)").remove(),e=e?l(e,r):r,a||(a=o.Axis()),i=o.adapter.plotly().convert(e),a.config(i).render(c),t.data=e.data,t.layout=e.layout,u.fillLayout(t),e}return d.isPolar=!0,d.svg=function(){return a.svg()},d.getConfig=function(){return e},d.getLiveConfig=function(){return o.adapter.plotly().convert(a.getLiveConfig(),!0)},d.getLiveScales=function(){return{t:a.angularScale(),r:a.radialScale()}},d.setUndoPoint=function(){var t,n,a=this,i=o.util.cloneJson(e);t=i,n=r,f.add({undo:function(){n&&a(n)},redo:function(){a(t)}}),r=o.util.cloneJson(i)},d.undo=function(){f.undo()},d.redo=function(){f.redo()},d},u.fillLayout=function(t){var e=n.select(t).selectAll(".plot-container"),r=e.selectAll(".svg-container"),a=t.framework&&t.framework.svg&&t.framework.svg(),o={width:800,height:600,paper_bgcolor:i.background,_container:e,_paperdiv:r,_paper:a};t._fullLayout=l(o,t.layout)}},{"../../../components/color":368,"../../../lib":498,"./micropolar":589,"./undo_manager":591,d3:86}],591:[function(t,e,r){"use strict";e.exports=function(){var t,e=[],r=-1,n=!1;function a(t,e){return t?(n=!0,t[e](),n=!1,this):this}return{add:function(t){return n||(e.splice(r+1,e.length-r),e.push(t),r=e.length-1),this},setCallback:function(e){t=e},undo:function(){var n=e[r];return n?(a(n,"undo"),r-=1,t&&t(n.undo),this):this},redo:function(){var n=e[r+1];return n?(a(n,"redo"),r+=1,t&&t(n.redo),this):this},clear:function(){e=[],r=-1},hasUndo:function(){return-1!==r},hasRedo:function(){return r0){for(var n=[],a=0;a-1&&(f[h[r]].title={text:""});for(r=0;r")?"":e.html(t).text()}));return e.remove(),r}(A),A=(A=A.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")).replace(u,"'"),a.isIE()&&(A=(A=(A=A.replace(/"/gi,"'")).replace(/(\('#)([^']*)('\))/gi,'("#$2")')).replace(/(\\')/gi,'"')),A}},{"../components/color":368,"../components/drawing":390,"../constants/xmlns_namespaces":476,"../lib":498,d3:86}],602:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e){for(var r=0;r2?e.value=e.value.slice(2):0===e.length?e.value=[0,1]:e.length<2?(r=parseFloat(e.value[0]),e.value=[r,r+1]):e.value=[parseFloat(e.value[0]),parseFloat(e.value[1])]:n(e.value)&&(r=parseFloat(e.value),e.value=[r,r+1])):(t("contours.value",0),n(e.value)||(Array.isArray(e.value)?e.value=parseFloat(e.value[0]):e.value=0))}(r,g),"="===v?d=g.showlines=!0:(d=r("contours.showlines"),p=r("fillcolor",o((t.line||{}).color||l,.5))),d)&&(h=r("line.color",p&&s(p)?o(e.fillcolor,1):l),r("line.width",2),r("line.dash"));r("line.smoothing"),a(r,i,h,f)}},{"../../components/color":368,"../../constants/filter_ops":473,"./label_defaults":610,"fast-isnumeric":155}],607:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){var a=n("contours.start"),i=n("contours.end"),o=!1===a||!1===i,s=r("contours.size");!(o?e.autocontour=!0:r("autocontour",!1))&&s||r("ncontours")}},{}],608:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../heatmap/xyz_defaults"),i=t("../scatter/period_defaults"),o=t("./constraint_defaults"),s=t("./contours_defaults"),l=t("./style_defaults"),u=t("./attributes");e.exports=function(t,e,r,c){function f(r,a){return n.coerce(t,e,u,r,a)}if(a(t,e,f,c)){i(t,e,c,f),f("text"),f("hovertext"),f("hovertemplate"),f("hoverongaps");var d="constraint"===f("contours.type");f("connectgaps",n.isArray1D(e.z)),d?o(t,e,f,c,r):(s(t,e,f,(function(r){return n.coerce2(t,e,u,r)})),l(t,e,f,c))}else e.visible=!1}},{"../../lib":498,"../heatmap/xyz_defaults":624,"../scatter/period_defaults":674,"./attributes":603,"./constraint_defaults":606,"./contours_defaults":607,"./style_defaults":613}],609:[function(t,e,r){"use strict";e.exports=function(t){return t.end+t.size/1e6}},{}],610:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e,r,a){if(a||(a={}),t("contours.showlabels")){var i=e.font;n.coerceFont(t,"contours.labelfont",{family:i.family,size:i.size,color:r}),t("contours.labelformat")}!1!==a.hasHover&&t("zhoverformat")}},{"../../lib":498}],611:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../components/colorscale"),i=t("./end_plus");e.exports=function(t){var e=t.contours,r=e.start,o=i(e),s=e.size||1,l=Math.floor((o-r)/s)+1,u="lines"===e.coloring?0:1,c=a.extractOpts(t);isFinite(s)||(s=1,l=1);var f,d,h=c.reversescale?a.flipScale(c.colorscale):c.colorscale,p=h.length,g=new Array(p),v=new Array(p);if("heatmap"===e.coloring){var m=c.min,y=c.max;for(d=0;dr.end&&(r.start=r.end=(r.start+r.end)/2),t._input.contours||(t._input.contours={}),a.extendFlat(t._input.contours,{start:r.start,end:r.end,size:r.size}),t._input.autocontour=!0}else if("constraint"!==r.type){var u,c=r.start,f=r.end,d=t._input.contours;if(c>f&&(r.start=d.start=f,f=r.end=d.end=c,c=r.start),!(r.size>0))u=c===f?1:i(c,f,t.ncontours).dtick,d.size=r.size=u}}},{"../../lib":498,"../../plots/cartesian/axes":547}],613:[function(t,e,r){"use strict";var n=t("../../components/colorscale/defaults"),a=t("./label_defaults");e.exports=function(t,e,r,i,o){var s,l=r("contours.coloring"),u="";"fill"===l&&(s=r("contours.showlines")),!1!==s&&("lines"!==l&&(u=r("line.color","#000")),r("line.width",.5),r("line.dash")),"none"!==l&&(!0!==t.showlegend&&(e.showlegend=!1),e._dfltShowLegend=!1,n(t,e,i,r,{prefix:"",cLetter:"z"})),r("line.smoothing"),a(r,i,u,o)}},{"../../components/colorscale/defaults":378,"./label_defaults":610}],614:[function(t,e,r){"use strict";var n=t("gl-contour2d"),a=t("gl-heatmap2d"),i=t("../../plots/cartesian/axes"),o=t("../contour/make_color_map"),s=t("../../lib/str2rgbarray");function l(t,e){this.scene=t,this.uid=e,this.type="contourgl",this.name="",this.hoverinfo="all",this.xData=[],this.yData=[],this.zData=[],this.textLabels=[],this.idToIndex=[],this.bounds=[0,0,0,0],this.contourOptions={z:new Float32Array(0),x:[],y:[],shape:[0,0],levels:[0],levelColors:[0,0,0,1],lineWidth:1},this.contour=n(t.glplot,this.contourOptions),this.contour._trace=this,this.heatmapOptions={z:new Float32Array(0),x:[],y:[],shape:[0,0],colorLevels:[0],colorValues:[0,0,0,0]},this.heatmap=a(t.glplot,this.heatmapOptions),this.heatmap._trace=this}var u=l.prototype;function c(t,e){for(var r=t.contours,n=r.start,a=r.end,i=r.size||1,l=e.fill,u=o(t),c=Math.floor((a-n)/i)+(l?2:1),f=new Array(c),d=new Array(4*c),h=0;hP){R("x scale is not linear");break}}if(b.length&&"fast"===O){var F=(b[b.length-1]-b[0])/(b.length-1),z=Math.abs(F/100);for(T=0;Tz){R("y scale is not linear");break}}}var N=a.maxRowLength(A),B="scaled"===e.xtype?"":r,j=h(e,B,v,m,N,M),U="scaled"===e.ytype?"":b,V=h(e,U,x,_,A.length,E);L||(e._extremes[M._id]=i.findExtremes(M,j),e._extremes[E._id]=i.findExtremes(E,V));var H={x:j,y:V,z:A,text:e._text||e.text,hovertext:e._hovertext||e.hovertext};if(e.xperiodalignment&&y&&(H.orig_x=y),e.yperiodalignment&&w&&(H.orig_y=w),B&&B.length===j.length-1&&(H.xCenter=B),U&&U.length===V.length-1&&(H.yCenter=U),C&&(H.xRanges=k.xRanges,H.yRanges=k.yRanges,H.pts=k.pts),S||l(t,e,{vals:A,cLetter:"z"}),S&&e.contours&&"heatmap"===e.contours.coloring){var G={type:"contour"===e.type?"heatmap":"histogram2d",xcalendar:e.xcalendar,ycalendar:e.ycalendar};H.xfill=h(G,B,v,m,N,M),H.yfill=h(G,U,x,_,A.length,E)}return[H]}},{"../../components/colorscale/calc":376,"../../constants/numerical":475,"../../lib":498,"../../plots/cartesian/align_period":544,"../../plots/cartesian/axes":547,"../../registry":593,"../histogram2d/calc":634,"./clean_2d_array":618,"./convert_column_xyz":620,"./find_empties":621,"./interp2d":622,"./make_bound_array":623}],618:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib"),i=t("../../constants/numerical").BADNUM;e.exports=function(t,e,r,o){var s,l,u,c,f,d;function h(t){if(n(t))return+t}if(e&&e.transpose){for(s=0,f=0;f=0;o--)(s=((f[[(r=(i=d[o])[0])-1,a=i[1]]]||g)[2]+(f[[r+1,a]]||g)[2]+(f[[r,a-1]]||g)[2]+(f[[r,a+1]]||g)[2])/20)&&(l[i]=[r,a,s],d.splice(o,1),u=!0);if(!u)throw"findEmpties iterated with no new neighbors";for(i in l)f[i]=l[i],c.push(l[i])}return c.sort((function(t,e){return e[2]-t[2]}))}},{"../../lib":498}],622:[function(t,e,r){"use strict";var n=t("../../lib"),a=[[-1,0],[1,0],[0,-1],[0,1]];function i(t){return.5-.25*Math.min(1,.5*t)}function o(t,e,r){var n,i,o,s,l,u,c,f,d,h,p,g,v,m=0;for(s=0;sg&&(m=Math.max(m,Math.abs(t[i][o]-p)/(v-g))))}return m}e.exports=function(t,e){var r,a=1;for(o(t,e),r=0;r.01;r++)a=o(t,e,i(a));return a>.01&&n.log("interp2d didn't converge quickly",a),t}},{"../../lib":498}],623:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../lib").isArrayOrTypedArray;e.exports=function(t,e,r,i,o,s){var l,u,c,f=[],d=n.traceIs(t,"contour"),h=n.traceIs(t,"histogram"),p=n.traceIs(t,"gl2d");if(a(e)&&e.length>1&&!h&&"category"!==s.type){var g=e.length;if(!(g<=o))return d?e.slice(0,o):e.slice(0,o+1);if(d||p)f=e.slice(0,o);else if(1===o)f=[e[0]-.5,e[0]+.5];else{for(f=[1.5*e[0]-.5*e[1]],c=1;c0&&(i=!0);for(var l=0;li){var o=i-r[t];return r[t]=i,o}}return 0},max:function(t,e,r,a){var i=a[e];if(n(i)){if(i=Number(i),!n(r[t]))return r[t]=i,i;if(r[t]u?t>o?t>1.1*a?a:t>1.1*i?i:o:t>s?s:t>l?l:u:Math.pow(10,Math.floor(Math.log(t)/Math.LN10))}function h(t,e,r,n,i,s){if(n&&t>o){var l=p(e,i,s),u=p(r,i,s),c=t===a?0:1;return l[c]!==u[c]}return Math.floor(r/t)-Math.floor(e/t)>.1}function p(t,e,r){var n=e.c2d(t,a,r).split("-");return""===n[0]&&(n.unshift(),n[0]="-"+n[0]),n}e.exports=function(t,e,r,n,i){var s,l,u=-1.1*e,d=-.1*e,h=t-d,p=r[0],g=r[1],v=Math.min(f(p+d,p+h,n,i),f(g+d,g+h,n,i)),m=Math.min(f(p+u,p+d,n,i),f(g+u,g+d,n,i));if(v>m&&mo){var y=s===a?1:6,b=s===a?"M12":"M1";return function(e,r){var o=n.c2d(e,a,i),s=o.indexOf("-",y);s>0&&(o=o.substr(0,s));var u=n.d2c(o,0,i);if(ur.r2l(N)&&(j=o.tickIncrement(j,x.size,!0,h)),I.start=r.l2r(j),z||a.nestedProperty(e,m+".start").set(I.start)}var U=x.end,V=r.r2l(R.end),H=void 0!==V;if((x.endFound||H)&&V!==r.r2l(U)){var G=H?V:a.aggNums(Math.max,null,p);I.end=r.l2r(G),H||a.nestedProperty(e,m+".start").set(I.end)}var q="autobin"+s;return!1===e._input[q]&&(e._input[m]=a.extendFlat({},e[m]||{}),delete e._input[q],delete e[q]),[I,p]}e.exports={calc:function(t,e){var r,i,h,p,g=[],v=[],m=o.getFromId(t,"h"===e.orientation?e.yaxis:e.xaxis),y="h"===e.orientation?"y":"x",b={x:"y",y:"x"}[y],x=e[y+"calendar"],_=e.cumulative,w=d(t,e,m,y),A=w[0],T=w[1],k="string"==typeof A.size,M=[],E=k?M:A,S=[],C=[],L=[],O=0,D=e.histnorm,R=e.histfunc,I=-1!==D.indexOf("density");_.enabled&&I&&(D=D.replace(/ ?density$/,""),I=!1);var P,F="max"===R||"min"===R?null:0,z=l.count,N=u[D],B=!1,j=function(t){return m.r2c(t,0,x)};for(a.isArrayOrTypedArray(e[b])&&"count"!==R&&(P=e[b],B="avg"===R,z=l[R]),r=j(A.start),h=j(A.end)+(r-o.tickIncrement(r,A.size,!1,x))/1e6;r=0&&p=0;n--)s(n);else if("increasing"===e){for(n=1;n=0;n--)t[n]+=t[n+1];"exclude"===r&&(t.push(0),t.shift())}}(v,_.direction,_.currentbin);var J=Math.min(g.length,v.length),Q=[],$=0,K=J-1;for(r=0;r=$;r--)if(v[r]){K=r;break}for(r=$;r<=K;r++)if(n(g[r])&&n(v[r])){var tt={p:g[r],s:v[r],b:0};_.enabled||(tt.pts=L[r],q?tt.ph0=tt.ph1=L[r].length?T[L[r][0]]:g[r]:(e._computePh=!0,tt.ph0=H(M[r]),tt.ph1=H(M[r+1],!0))),Q.push(tt)}return 1===Q.length&&(Q[0].width1=o.tickIncrement(Q[0].p,A.size,!1,x)-Q[0].p),s(Q,e),a.isArrayOrTypedArray(e.selectedpoints)&&a.tagSelected(Q,e,Y),Q},calcAllAutoBins:d}},{"../../lib":498,"../../plots/cartesian/axes":547,"../../registry":593,"../bar/arrays_to_calcdata":602,"./average":629,"./bin_functions":630,"./bin_label_vals":631,"./norm_functions":633,"fast-isnumeric":155}],633:[function(t,e,r){"use strict";e.exports={percent:function(t,e){for(var r=t.length,n=100/e,a=0;aE&&A.splice(E,A.length-E),M.length>E&&M.splice(E,M.length-E);var S=[],C=[],L=[],O="string"==typeof w.size,D="string"==typeof k.size,R=[],I=[],P=O?R:w,F=D?I:k,z=0,N=[],B=[],j=e.histnorm,U=e.histfunc,V=-1!==j.indexOf("density"),H="max"===U||"min"===U?null:0,G=i.count,q=o[j],X=!1,W=[],Y=[],Z="z"in e?e.z:"marker"in e&&Array.isArray(e.marker.color)?e.marker.color:"";Z&&"count"!==U&&(X="avg"===U,G=i[U]);var J=w.size,Q=b(w.start),$=b(w.end)+(Q-a.tickIncrement(Q,J,!1,m))/1e6;for(r=Q;r<$;r=a.tickIncrement(r,J,!1,m))C.push(H),R.push(r),X&&L.push(0);R.push(r);var K,tt=C.length,et=(r-Q)/tt,rt=(K=Q+et/2,g.c2r(K,0,m)),nt=k.size,at=x(k.start),it=x(k.end)+(at-a.tickIncrement(at,nt,!1,y))/1e6;for(r=at;r=0&&h=0&&p=e[r][0]&&t<=e[r][1])return!0;return!1}(r,n))return r;var a=t?-1:1,i=0,o=e.length-1;if(a<0){var s=i;i=o,o=s}for(var l=e[i],u=l,f=i;a*fe){d=r;break}}if(i=c,isNaN(i)&&(i=isNaN(f)||isNaN(d)?isNaN(f)?d:f:e-u[f][1]t[1]+r||e=.9*t[1]+.1*t[0]?"n":e<=.9*t[0]+.1*t[1]?"s":"ns"}(p,e);g&&(o.interval=l[i],o.intervalPix=p,o.region=g)}}if(t.ordinal&&!o.region){var v=t.unitTickvals,y=t.unitToPaddedPx.invert(e);for(r=0;r=b[0]&&y<=b[1]){o.clickableOrdinalRange=b;break}}}return o}function w(t,e){a.event.sourceEvent.stopPropagation();var r=e.height-a.mouse(t)[1]-2*n.verticalPadding,i=e.brush.svgBrush;i.wasDragged=!0,i._dragging=!0,i.grabbingBar?i.newExtent=[r-i.grabPoint,r+i.barLength-i.grabPoint].map(e.unitToPaddedPx.invert):i.newExtent=[i.startExtent,e.unitToPaddedPx.invert(r)].sort(s),e.brush.filterSpecified=!0,i.extent=i.stayingIntervals.concat([i.newExtent]),i.brushCallback(e),x(t.parentNode)}function A(t,e){var r=_(e,e.height-a.mouse(t)[1]-2*n.verticalPadding),i="crosshair";r.clickableOrdinalRange?i="pointer":r.region&&(i=r.region+"-resize"),a.select(document.body).style("cursor",i)}function T(t){t.on("mousemove",(function(t){a.event.preventDefault(),t.parent.inBrushDrag||A(this,t)})).on("mouseleave",(function(t){t.parent.inBrushDrag||y()})).call(a.behavior.drag().on("dragstart",(function(t){!function(t,e){a.event.sourceEvent.stopPropagation();var r=e.height-a.mouse(t)[1]-2*n.verticalPadding,i=e.unitToPaddedPx.invert(r),o=e.brush,s=_(e,r),l=s.interval,u=o.svgBrush;if(u.wasDragged=!1,u.grabbingBar="ns"===s.region,u.grabbingBar){var c=l.map(e.unitToPaddedPx);u.grabPoint=r-c[0]-n.verticalPadding,u.barLength=c[1]-c[0]}u.clickableOrdinalRange=s.clickableOrdinalRange,u.stayingIntervals=e.multiselect&&o.filterSpecified?o.filter.getConsolidated():[],l&&(u.stayingIntervals=u.stayingIntervals.filter((function(t){return t[0]!==l[0]&&t[1]!==l[1]}))),u.startExtent=s.region?l["s"===s.region?1:0]:i,e.parent.inBrushDrag=!0,u.brushStartCallback()}(this,t)})).on("drag",(function(t){w(this,t)})).on("dragend",(function(t){!function(t,e){var r=e.brush,n=r.filter,i=r.svgBrush;i._dragging||(A(t,e),w(t,e),e.brush.svgBrush.wasDragged=!1),i._dragging=!1,a.event.sourceEvent.stopPropagation();var o=i.grabbingBar;if(i.grabbingBar=!1,i.grabLocation=void 0,e.parent.inBrushDrag=!1,y(),!i.wasDragged)return i.wasDragged=void 0,i.clickableOrdinalRange?r.filterSpecified&&e.multiselect?i.extent.push(i.clickableOrdinalRange):(i.extent=[i.clickableOrdinalRange],r.filterSpecified=!0):o?(i.extent=i.stayingIntervals,0===i.extent.length&&M(r)):M(r),i.brushCallback(e),x(t.parentNode),void i.brushEndCallback(r.filterSpecified?n.getConsolidated():[]);var s=function(){n.set(n.getConsolidated())};if(e.ordinal){var l=e.unitTickvals;l[l.length-1]i.newExtent[0];i.extent=i.stayingIntervals.concat(u?[i.newExtent]:[]),i.extent.length||M(r),i.brushCallback(e),u?x(t.parentNode,s):(s(),x(t.parentNode))}else s();i.brushEndCallback(r.filterSpecified?n.getConsolidated():[])}(this,t)})))}function k(t,e){return t[0]-e[0]}function M(t){t.filterSpecified=!1,t.svgBrush.extent=[[-1/0,1/0]]}function E(t){for(var e,r=t.slice(),n=[],a=r.shift();a;){for(e=a.slice();(a=r.shift())&&a[0]<=e[1];)e[1]=Math.max(e[1],a[1]);n.push(e)}return 1===n.length&&n[0][0]>n[0][1]&&(n=[]),n}e.exports={makeBrush:function(t,e,r,n,a,i){var o,l=function(){var t,e,r=[];return{set:function(n){1===(r=n.map((function(t){return t.slice().sort(s)})).sort(k)).length&&r[0][0]===-1/0&&r[0][1]===1/0&&(r=[[0,-1]]),t=E(r),e=r.reduce((function(t,e){return[Math.min(t[0],e[0]),Math.max(t[1],e[1])]}),[1/0,-1/0])},get:function(){return r.slice()},getConsolidated:function(){return t},getBounds:function(){return e}}}();return l.set(r),{filter:l,filterSpecified:e,svgBrush:{extent:[],brushStartCallback:n,brushCallback:(o=a,function(t){var e=t.brush,r=function(t){return t.svgBrush.extent.map((function(t){return t.slice()}))}(e).slice();e.filter.set(r),o()}),brushEndCallback:i}}},ensureAxisBrush:function(t){var e=t.selectAll("."+n.cn.axisBrush).data(o,i);e.enter().append("g").classed(n.cn.axisBrush,!0),function(t){var e=t.selectAll(".background").data(o);e.enter().append("rect").classed("background",!0).call(p).call(g).style("pointer-events","auto").attr("transform",l(0,n.verticalPadding)),e.call(T).attr("height",(function(t){return t.height-n.verticalPadding}));var r=t.selectAll(".highlight-shadow").data(o);r.enter().append("line").classed("highlight-shadow",!0).attr("x",-n.bar.width/2).attr("stroke-width",n.bar.width+n.bar.strokeWidth).attr("stroke",n.bar.strokeColor).attr("opacity",n.bar.strokeOpacity).attr("stroke-linecap","butt"),r.attr("y1",(function(t){return t.height})).call(b);var a=t.selectAll(".highlight").data(o);a.enter().append("line").classed("highlight",!0).attr("x",-n.bar.width/2).attr("stroke-width",n.bar.width-n.bar.strokeWidth).attr("stroke",n.bar.fillColor).attr("opacity",n.bar.fillOpacity).attr("stroke-linecap","butt"),a.attr("y1",(function(t){return t.height})).call(b)}(e)},cleanRanges:function(t,e){if(Array.isArray(t[0])?(t=t.map((function(t){return t.sort(s)})),t=e.multiselect?E(t.sort(k)):[t[0]]):t=[t.sort(s)],e.tickvals){var r=e.tickvals.slice().sort(s);if(!(t=t.map((function(t){var e=[h(0,r,t[0],[]),h(1,r,t[1],[])];if(e[1]>e[0])return e})).filter((function(t){return t}))).length)return}return t.length>1?t:t[0]}}},{"../../lib":498,"../../lib/gup":495,"./constants":639,d3:86}],637:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../plots/get_data").getModuleCalcData,i=t("./plot"),o=t("../../constants/xmlns_namespaces");r.name="parcoords",r.plot=function(t){var e=a(t.calcdata,"parcoords")[0];e.length&&i(t,e)},r.clean=function(t,e,r,n){var a=n._has&&n._has("parcoords"),i=e._has&&e._has("parcoords");a&&!i&&(n._paperdiv.selectAll(".parcoords").remove(),n._glimages.selectAll("*").remove())},r.toSVG=function(t){var e=t._fullLayout._glimages,r=n.select(t).selectAll(".svg-container");r.filter((function(t,e){return e===r.size()-1})).selectAll(".gl-canvas-context, .gl-canvas-focus").each((function(){var t=this.toDataURL("image/png");e.append("svg:image").attr({xmlns:o.svg,"xlink:href":t,preserveAspectRatio:"none",x:0,y:0,width:this.width,height:this.height})})),window.setTimeout((function(){n.selectAll("#filterBarPattern").attr("id","filterBarPattern")}),60)}},{"../../constants/xmlns_namespaces":476,"../../plots/get_data":577,"./plot":646,d3:86}],638:[function(t,e,r){"use strict";var n=t("../../lib").isArrayOrTypedArray,a=t("../../components/colorscale"),i=t("../../lib/gup").wrap;e.exports=function(t,e){var r,o;return a.hasColorscale(e,"line")&&n(e.line.color)?(r=e.line.color,o=a.extractOpts(e.line).colorscale,a.calc(t,e,{vals:r,containerStr:"line",cLetter:"c"})):(r=function(t){for(var e=new Array(t),r=0;rf&&(n.log("parcoords traces support up to "+f+" dimensions at the moment"),p.splice(f));var g=s(t,e,{name:"dimensions",layout:l,handleItemDefaults:h}),v=function(t,e,r,o,s){var l=s("line.color",r);if(a(t,"line")&&n.isArrayOrTypedArray(l)){if(l.length)return s("line.colorscale"),i(t,e,o,s,{prefix:"line.",cLetter:"c"}),l.length;e.line.color=r}return 1/0}(t,e,r,l,c);o(e,l,c),Array.isArray(g)&&g.length||(e.visible=!1),d(e,g,"values",v);var m={family:l.font.family,size:Math.round(l.font.size/1.2),color:l.font.color};n.coerceFont(c,"labelfont",m),n.coerceFont(c,"tickfont",m),n.coerceFont(c,"rangefont",m),c("labelangle"),c("labelside")}},{"../../components/colorscale/defaults":378,"../../components/colorscale/helpers":379,"../../lib":498,"../../plots/array_container_defaults":542,"../../plots/cartesian/axes":547,"../../plots/domain":574,"./attributes":635,"./axisbrush":636,"./constants":639,"./merge_length":644}],641:[function(t,e,r){"use strict";var n=t("../../lib").isTypedArray;r.convertTypedArray=function(t){return n(t)?Array.prototype.slice.call(t):t},r.isOrdinal=function(t){return!!t.tickvals},r.isVisible=function(t){return t.visible||!("visible"in t)}},{"../../lib":498}],642:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),calc:t("./calc"),plot:t("./plot"),colorbar:{container:"line",min:"cmin",max:"cmax"},moduleType:"trace",name:"parcoords",basePlotModule:t("./base_plot"),categories:["gl","regl","noOpacity","noHover"],meta:{}}},{"./attributes":635,"./base_plot":637,"./calc":638,"./defaults":640,"./plot":646}],643:[function(t,e,r){"use strict";var n=t("glslify"),a=n(["precision highp float;\n#define GLSLIFY 1\n\nvarying vec4 fragColor;\n\nattribute vec4 p01_04, p05_08, p09_12, p13_16,\n p17_20, p21_24, p25_28, p29_32,\n p33_36, p37_40, p41_44, p45_48,\n p49_52, p53_56, p57_60, colors;\n\nuniform mat4 dim0A, dim1A, dim0B, dim1B, dim0C, dim1C, dim0D, dim1D,\n loA, hiA, loB, hiB, loC, hiC, loD, hiD;\n\nuniform vec2 resolution, viewBoxPos, viewBoxSize;\nuniform sampler2D mask, palette;\nuniform float maskHeight;\nuniform float drwLayer; // 0: context, 1: focus, 2: pick\nuniform vec4 contextColor;\n\nbool isPick = (drwLayer > 1.5);\nbool isContext = (drwLayer < 0.5);\n\nconst vec4 ZEROS = vec4(0.0, 0.0, 0.0, 0.0);\nconst vec4 UNITS = vec4(1.0, 1.0, 1.0, 1.0);\n\nfloat val(mat4 p, mat4 v) {\n return dot(matrixCompMult(p, v) * UNITS, UNITS);\n}\n\nfloat axisY(float ratio, mat4 A, mat4 B, mat4 C, mat4 D) {\n float y1 = val(A, dim0A) + val(B, dim0B) + val(C, dim0C) + val(D, dim0D);\n float y2 = val(A, dim1A) + val(B, dim1B) + val(C, dim1C) + val(D, dim1D);\n return y1 * (1.0 - ratio) + y2 * ratio;\n}\n\nint iMod(int a, int b) {\n return a - b * (a / b);\n}\n\nbool fOutside(float p, float lo, float hi) {\n return (lo < hi) && (lo > p || p > hi);\n}\n\nbool vOutside(vec4 p, vec4 lo, vec4 hi) {\n return (\n fOutside(p[0], lo[0], hi[0]) ||\n fOutside(p[1], lo[1], hi[1]) ||\n fOutside(p[2], lo[2], hi[2]) ||\n fOutside(p[3], lo[3], hi[3])\n );\n}\n\nbool mOutside(mat4 p, mat4 lo, mat4 hi) {\n return (\n vOutside(p[0], lo[0], hi[0]) ||\n vOutside(p[1], lo[1], hi[1]) ||\n vOutside(p[2], lo[2], hi[2]) ||\n vOutside(p[3], lo[3], hi[3])\n );\n}\n\nbool outsideBoundingBox(mat4 A, mat4 B, mat4 C, mat4 D) {\n return mOutside(A, loA, hiA) ||\n mOutside(B, loB, hiB) ||\n mOutside(C, loC, hiC) ||\n mOutside(D, loD, hiD);\n}\n\nbool outsideRasterMask(mat4 A, mat4 B, mat4 C, mat4 D) {\n mat4 pnts[4];\n pnts[0] = A;\n pnts[1] = B;\n pnts[2] = C;\n pnts[3] = D;\n\n for(int i = 0; i < 4; ++i) {\n for(int j = 0; j < 4; ++j) {\n for(int k = 0; k < 4; ++k) {\n if(0 == iMod(\n int(255.0 * texture2D(mask,\n vec2(\n (float(i * 2 + j / 2) + 0.5) / 8.0,\n (pnts[i][j][k] * (maskHeight - 1.0) + 1.0) / maskHeight\n ))[3]\n ) / int(pow(2.0, float(iMod(j * 4 + k, 8)))),\n 2\n )) return true;\n }\n }\n }\n return false;\n}\n\nvec4 position(bool isContext, float v, mat4 A, mat4 B, mat4 C, mat4 D) {\n float x = 0.5 * sign(v) + 0.5;\n float y = axisY(x, A, B, C, D);\n float z = 1.0 - abs(v);\n\n z += isContext ? 0.0 : 2.0 * float(\n outsideBoundingBox(A, B, C, D) ||\n outsideRasterMask(A, B, C, D)\n );\n\n return vec4(\n 2.0 * (vec2(x, y) * viewBoxSize + viewBoxPos) / resolution - 1.0,\n z,\n 1.0\n );\n}\n\nvoid main() {\n mat4 A = mat4(p01_04, p05_08, p09_12, p13_16);\n mat4 B = mat4(p17_20, p21_24, p25_28, p29_32);\n mat4 C = mat4(p33_36, p37_40, p41_44, p45_48);\n mat4 D = mat4(p49_52, p53_56, p57_60, ZEROS);\n\n float v = colors[3];\n\n gl_Position = position(isContext, v, A, B, C, D);\n\n fragColor =\n isContext ? vec4(contextColor) :\n isPick ? vec4(colors.rgb, 1.0) : texture2D(palette, vec2(abs(v), 0.5));\n}\n"]),i=n(["precision highp float;\n#define GLSLIFY 1\n\nvarying vec4 fragColor;\n\nvoid main() {\n gl_FragColor = fragColor;\n}\n"]),o=t("./constants").maxDimensionCount,s=t("../../lib"),l=new Uint8Array(4),u=new Uint8Array(4),c={shape:[256,1],format:"rgba",type:"uint8",mag:"nearest",min:"nearest"};function f(t,e,r,n,a){var i=t._gl;i.enable(i.SCISSOR_TEST),i.scissor(e,r,n,a),t.clear({color:[0,0,0,0],depth:1})}function d(t,e,r,n,a,i){var o=i.key;r.drawCompleted||(!function(t){t.read({x:0,y:0,width:1,height:1,data:l})}(t),r.drawCompleted=!0),function s(l){var u=Math.min(n,a-l*n);0===l&&(window.cancelAnimationFrame(r.currentRafs[o]),delete r.currentRafs[o],f(t,i.scissorX,i.scissorY,i.scissorWidth,i.viewBoxSize[1])),r.clearOnly||(i.count=2*u,i.offset=2*l*n,e(i),l*n+u>>8*e)%256/255}function g(t,e,r){for(var n=new Array(8*e),a=0,i=0;ic&&(c=t[a].dim1.canvasX,o=a);0===s&&f(A,0,0,r.canvasWidth,r.canvasHeight);var h=function(t){var e,r,n,a=[[],[]];for(n=0;n<64;n++){var i=!t&&na._length&&(M=M.slice(0,a._length));var S,C=a.tickvals;function L(t,e){return{val:t,text:S[e]}}function O(t,e){return t.val-e.val}if(Array.isArray(C)&&C.length){S=a.ticktext,Array.isArray(S)&&S.length?S.length>C.length?S=S.slice(0,C.length):C.length>S.length&&(C=C.slice(0,S.length)):S=C.map(n.format(a.tickformat));for(var D=1;D=r||l>=i)return;var u=t.lineLayer.readPixel(s,i-1-l),c=0!==u[3],f=c?u[2]+256*(u[1]+256*u[0]):null,d={x:s,y:l,clientX:e.clientX,clientY:e.clientY,dataIndex:t.model.key,curveNumber:f};f!==F&&(c?a.hover(d):a.unhover&&a.unhover(d),F=f)}})),P.style("opacity",(function(t){return t.pick?0:1})),d.style("background","rgba(255, 255, 255, 0)");var z=d.selectAll("."+m.cn.parcoords).data(M,h);z.exit().remove(),z.enter().append("g").classed(m.cn.parcoords,!0).style("shape-rendering","crispEdges").style("pointer-events","none"),z.attr("transform",(function(t){return l(t.model.translateX,t.model.translateY)}));var N=z.selectAll("."+m.cn.parcoordsControlView).data(p,h);N.enter().append("g").classed(m.cn.parcoordsControlView,!0),N.attr("transform",(function(t){return l(t.model.pad.l,t.model.pad.t)}));var B=N.selectAll("."+m.cn.yAxis).data((function(t){return t.dimensions}),h);B.enter().append("g").classed(m.cn.yAxis,!0),N.each((function(t){D(B,t)})),P.each((function(t){if(t.viewModel){!t.lineLayer||a?t.lineLayer=b(this,t):t.lineLayer.update(t),(t.key||0===t.key)&&(t.viewModel[t.key]=t.lineLayer);var e=!t.context||a;t.lineLayer.render(t.viewModel.panels,e)}})),B.attr("transform",(function(t){return l(t.xScale(t.xIndex),0)})),B.call(n.behavior.drag().origin((function(t){return t})).on("drag",(function(t){var e=t.parent;k.linePickActive(!1),t.x=Math.max(-m.overdrag,Math.min(t.model.width+m.overdrag,n.event.x)),t.canvasX=t.x*t.model.canvasPixelRatio,B.sort((function(t,e){return t.x-e.x})).each((function(e,r){e.xIndex=r,e.x=t===e?e.x:e.xScale(e.xIndex),e.canvasX=e.x*e.model.canvasPixelRatio})),D(B,e),B.filter((function(e){return 0!==Math.abs(t.xIndex-e.xIndex)})).attr("transform",(function(t){return l(t.xScale(t.xIndex),0)})),n.select(this).attr("transform",l(t.x,0)),B.each((function(r,n,a){a===t.parent.key&&(e.dimensions[n]=r)})),e.contextLayer&&e.contextLayer.render(e.panels,!1,!E(e)),e.focusLayer.render&&e.focusLayer.render(e.panels)})).on("dragend",(function(t){var e=t.parent;t.x=t.xScale(t.xIndex),t.canvasX=t.x*t.model.canvasPixelRatio,D(B,e),n.select(this).attr("transform",(function(t){return l(t.x,0)})),e.contextLayer&&e.contextLayer.render(e.panels,!1,!E(e)),e.focusLayer&&e.focusLayer.render(e.panels),e.pickLayer&&e.pickLayer.render(e.panels,!0),k.linePickActive(!0),a&&a.axesMoved&&a.axesMoved(e.key,e.dimensions.map((function(t){return t.crossfilterDimensionIndex})))}))),B.exit().remove();var j=B.selectAll("."+m.cn.axisOverlays).data(p,h);j.enter().append("g").classed(m.cn.axisOverlays,!0),j.selectAll("."+m.cn.axis).remove();var U=j.selectAll("."+m.cn.axis).data(p,h);U.enter().append("g").classed(m.cn.axis,!0),U.each((function(t){var e=t.model.height/t.model.tickDistance,r=t.domainScale,a=r.domain();n.select(this).call(n.svg.axis().orient("left").tickSize(4).outerTickSize(2).ticks(e,t.tickFormat).tickValues(t.ordinal?a:null).tickFormat((function(e){return v.isOrdinal(t)?e:R(t.model.dimensions[t.visibleIndex],e)})).scale(r)),c.font(U.selectAll("text"),t.model.tickFont)})),U.selectAll(".domain, .tick>line").attr("fill","none").attr("stroke","black").attr("stroke-opacity",.25).attr("stroke-width","1px"),U.selectAll("text").style("text-shadow","1px 1px 1px #fff, -1px -1px 1px #fff, 1px -1px 1px #fff, -1px 1px 1px #fff").style("cursor","default");var V=j.selectAll("."+m.cn.axisHeading).data(p,h);V.enter().append("g").classed(m.cn.axisHeading,!0);var H=V.selectAll("."+m.cn.axisTitle).data(p,h);H.enter().append("text").classed(m.cn.axisTitle,!0).attr("text-anchor","middle").style("cursor","ew-resize").style("pointer-events","auto"),H.text((function(t){return t.label})).each((function(e){var r=n.select(this);c.font(r,e.model.labelFont),u.convertToTspans(r,t)})).attr("transform",(function(t){var e=O(t.model.labelAngle,t.model.labelSide),r=m.axisTitleOffset;return(e.dir>0?"":l(0,2*r+t.model.height))+s(e.degrees)+l(-r*e.dx,-r*e.dy)})).attr("text-anchor",(function(t){var e=O(t.model.labelAngle,t.model.labelSide);return 2*Math.abs(e.dx)>Math.abs(e.dy)?e.dir*e.dx<0?"start":"end":"middle"}));var G=j.selectAll("."+m.cn.axisExtent).data(p,h);G.enter().append("g").classed(m.cn.axisExtent,!0);var q=G.selectAll("."+m.cn.axisExtentTop).data(p,h);q.enter().append("g").classed(m.cn.axisExtentTop,!0),q.attr("transform",l(0,-m.axisExtentOffset));var X=q.selectAll("."+m.cn.axisExtentTopText).data(p,h);X.enter().append("text").classed(m.cn.axisExtentTopText,!0).call(L),X.text((function(t){return I(t,!0)})).each((function(t){c.font(n.select(this),t.model.rangeFont)}));var W=G.selectAll("."+m.cn.axisExtentBottom).data(p,h);W.enter().append("g").classed(m.cn.axisExtentBottom,!0),W.attr("transform",(function(t){return l(0,t.model.height+m.axisExtentOffset)}));var Y=W.selectAll("."+m.cn.axisExtentBottomText).data(p,h);Y.enter().append("text").classed(m.cn.axisExtentBottomText,!0).attr("dy","0.75em").call(L),Y.text((function(t){return I(t,!1)})).each((function(t){c.font(n.select(this),t.model.rangeFont)})),y.ensureAxisBrush(j)}},{"../../components/colorscale":380,"../../components/drawing":390,"../../lib":498,"../../lib/gup":495,"../../lib/svg_text_utils":523,"../../plots/cartesian/axes":547,"./axisbrush":636,"./constants":639,"./helpers":641,"./lines":643,"color-rgba":65,d3:86}],646:[function(t,e,r){"use strict";var n=t("./parcoords"),a=t("../../lib/prepare_regl"),i=t("./helpers").isVisible;function o(t,e,r){var n=e.indexOf(r),a=t.indexOf(n);return-1===a&&(a+=e.length),a}e.exports=function(t,e){var r=t._fullLayout;if(a(t)){var s={},l={},u={},c={},f=r._size;e.forEach((function(e,r){var n=e[0].trace;u[r]=n.index;var a=c[r]=n._fullInput.index;s[r]=t.data[a].dimensions,l[r]=t.data[a].dimensions.slice()}));n(t,e,{width:f.w,height:f.h,margin:{t:f.t,r:f.r,b:f.b,l:f.l}},{filterChanged:function(e,n,a){var i=l[e][n],o=a.map((function(t){return t.slice()})),s="dimensions["+n+"].constraintrange",f=r._tracePreGUI[t._fullData[u[e]]._fullInput.uid];if(void 0===f[s]){var d=i.constraintrange;f[s]=d||null}var h=t._fullData[u[e]].dimensions[n];o.length?(1===o.length&&(o=o[0]),i.constraintrange=o,h.constraintrange=o.slice(),o=[o]):(delete i.constraintrange,delete h.constraintrange,o=null);var p={};p[s]=o,t.emit("plotly_restyle",[p,[c[e]]])},hover:function(e){t.emit("plotly_hover",e)},unhover:function(e){t.emit("plotly_unhover",e)},axesMoved:function(e,r){var n=function(t,e){return function(r,n){return o(t,e,r)-o(t,e,n)}}(r,l[e].filter(i));s[e].sort(n),l[e].filter((function(t){return!i(t)})).sort((function(t){return l[e].indexOf(t)})).forEach((function(t){s[e].splice(s[e].indexOf(t),1),s[e].splice(l[e].indexOf(t),0,t)})),t.emit("plotly_restyle",[{dimensions:[s[e]]},[c[e]]])}})}}},{"../../lib/prepare_regl":511,"./helpers":641,"./parcoords":645}],647:[function(t,e,r){"use strict";var n=t("../../lib");function a(t){return-1!==t.indexOf("e")?t.replace(/[.]?0+e/,"e"):-1!==t.indexOf(".")?t.replace(/[.]?0+$/,""):t}r.formatPiePercent=function(t,e){var r=a((100*t).toPrecision(3));return n.numSeparate(r,e)+"%"},r.formatPieValue=function(t,e){var r=a(t.toPrecision(10));return n.numSeparate(r,e)},r.getFirstFilled=function(t,e){if(Array.isArray(t))for(var r=0;r>>1,d)p[0]=t.xbounds[0],p[2]=t.xbounds[1],p[1]=t.ybounds[0],p[3]=t.ybounds[1];else for(l=0;lp[2]&&(p[2]=o),sp[3]&&(p[3]=s);if(h)r=h;else for(r=new Int32Array(e),l=0;lp[2]&&(p[2]=o),sp[3]&&(p[3]=s);this.idToIndex=r,this.pointcloudOptions.idToIndex=r,this.pointcloudOptions.positions=n;var g=a(t.marker.color),v=a(t.marker.border.color),m=t.opacity*t.marker.opacity;g[3]*=m,this.pointcloudOptions.color=g;var y=t.marker.blend;if(null===y){y=u.length<100||c.length<100}this.pointcloudOptions.blend=y,v[3]*=m,this.pointcloudOptions.borderColor=v;var b=t.marker.sizemin,x=Math.max(t.marker.sizemax,t.marker.sizemin);this.pointcloudOptions.sizeMin=b,this.pointcloudOptions.sizeMax=x,this.pointcloudOptions.areaRatio=t.marker.border.arearatio,this.pointcloud.update(this.pointcloudOptions);var _=this.scene.xaxis,w=this.scene.yaxis,A=x/2||.5;t._extremes[_._id]=i(_,[p[0],p[2]],{ppad:A}),t._extremes[w._id]=i(w,[p[1],p[3]],{ppad:A})},l.dispose=function(){this.pointcloud.dispose()},e.exports=function(t,e){var r=new s(t,e.uid);return r.update(e),r}},{"../../lib/str2rgbarray":522,"../../plots/cartesian/autorange":546,"../scatter/get_trace_color":664,"gl-pointcloud2d":212}],651:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./attributes");e.exports=function(t,e,r){function i(r,i){return n.coerce(t,e,a,r,i)}i("x"),i("y"),i("xbounds"),i("ybounds"),t.xy&&t.xy instanceof Float32Array&&(e.xy=t.xy),t.indices&&t.indices instanceof Int32Array&&(e.indices=t.indices),i("text"),i("marker.color",r),i("marker.opacity"),i("marker.blend"),i("marker.sizemin"),i("marker.sizemax"),i("marker.border.color",r),i("marker.border.arearatio"),e._length=null}},{"../../lib":498,"./attributes":649}],652:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),calc:t("../scatter3d/calc"),plot:t("./convert"),moduleType:"trace",name:"pointcloud",basePlotModule:t("../../plots/gl2d"),categories:["gl","gl2d","showLegend"],meta:{}}},{"../../plots/gl2d":580,"../scatter3d/calc":682,"./attributes":649,"./convert":650,"./defaults":651}],653:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e){for(var r=0;rl&&S[m].gap;)m--;for(b=S[m].s,g=S.length-1;g>m;g--)S[g].s=b;for(;lM[c]&&c=0;a--){var i=t[a];if("scatter"===i.type&&i.xaxis===r.xaxis&&i.yaxis===r.yaxis){i.opacity=void 0;break}}}}}},{}],661:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../registry"),i=t("./attributes"),o=t("./constants"),s=t("./subtypes"),l=t("./xy_defaults"),u=t("./period_defaults"),c=t("./stack_defaults"),f=t("./marker_defaults"),d=t("./line_defaults"),h=t("./line_shape_defaults"),p=t("./text_defaults"),g=t("./fillcolor_defaults");e.exports=function(t,e,r,v){function m(r,a){return n.coerce(t,e,i,r,a)}var y=l(t,e,v,m);if(y||(e.visible=!1),e.visible){u(t,e,v,m);var b=c(t,e,v,m),x=!b&&yq!=(z=D[L][1])>=q&&(I=D[L-1][0],P=D[L][0],z-F&&(R=I+(P-I)*(q-F)/(z-F),U=Math.min(U,R),V=Math.max(V,R)));U=Math.max(U,0),V=Math.min(V,d._length);var X=s.defaultLine;return s.opacity(f.fillcolor)?X=f.fillcolor:s.opacity((f.line||{}).color)&&(X=f.line.color),n.extendFlat(t,{distance:t.maxHoverDistance,x0:U,x1:V,y0:q,y1:q,color:X,hovertemplate:!1}),delete t.index,f.text&&!Array.isArray(f.text)?t.text=String(f.text):t.text=f.name,[t]}}}},{"../../components/color":368,"../../components/fx":408,"../../lib":498,"../../registry":593,"./get_trace_color":664}],666:[function(t,e,r){"use strict";var n=t("./subtypes");e.exports={hasLines:n.hasLines,hasMarkers:n.hasMarkers,hasText:n.hasText,isBubble:n.isBubble,attributes:t("./attributes"),supplyDefaults:t("./defaults"),crossTraceDefaults:t("./cross_trace_defaults"),calc:t("./calc").calc,crossTraceCalc:t("./cross_trace_calc"),arraysToCalcdata:t("./arrays_to_calcdata"),plot:t("./plot"),colorbar:t("./marker_colorbar"),formatLabels:t("./format_labels"),style:t("./style").style,styleOnSelect:t("./style").styleOnSelect,hoverPoints:t("./hover"),selectPoints:t("./select"),animatable:!0,moduleType:"trace",name:"scatter",basePlotModule:t("../../plots/cartesian"),categories:["cartesian","svg","symbols","errorBarsOK","showLegend","scatter-like","zoomScale"],meta:{}}},{"../../plots/cartesian":560,"./arrays_to_calcdata":653,"./attributes":654,"./calc":655,"./cross_trace_calc":659,"./cross_trace_defaults":660,"./defaults":661,"./format_labels":663,"./hover":665,"./marker_colorbar":672,"./plot":675,"./select":676,"./style":678,"./subtypes":679}],667:[function(t,e,r){"use strict";var n=t("../../lib").isArrayOrTypedArray,a=t("../../components/colorscale/helpers").hasColorscale,i=t("../../components/colorscale/defaults");e.exports=function(t,e,r,o,s,l){var u=(t.marker||{}).color;(s("line.color",r),a(t,"line"))?i(t,e,o,s,{prefix:"line.",cLetter:"c"}):s("line.color",!n(u)&&u||r);s("line.width"),(l||{}).noDash||s("line.dash")}},{"../../components/colorscale/defaults":378,"../../components/colorscale/helpers":379,"../../lib":498}],668:[function(t,e,r){"use strict";var n=t("../../constants/numerical"),a=n.BADNUM,i=n.LOG_CLIP,o=i+.5,s=i-.5,l=t("../../lib"),u=l.segmentsIntersect,c=l.constrain,f=t("./constants");e.exports=function(t,e){var r,n,i,d,h,p,g,v,m,y,b,x,_,w,A,T,k,M,E=e.xaxis,S=e.yaxis,C="log"===E.type,L="log"===S.type,O=E._length,D=S._length,R=e.connectGaps,I=e.baseTolerance,P=e.shape,F="linear"===P,z=e.fill&&"none"!==e.fill,N=[],B=f.minTolerance,j=t.length,U=new Array(j),V=0;function H(r){var n=t[r];if(!n)return!1;var i=e.linearized?E.l2p(n.x):E.c2p(n.x),l=e.linearized?S.l2p(n.y):S.c2p(n.y);if(i===a){if(C&&(i=E.c2p(n.x,!0)),i===a)return!1;L&&l===a&&(i*=Math.abs(E._m*D*(E._m>0?o:s)/(S._m*O*(S._m>0?o:s)))),i*=1e3}if(l===a){if(L&&(l=S.c2p(n.y,!0)),l===a)return!1;l*=1e3}return[i,l]}function G(t,e,r,n){var a=r-t,i=n-e,o=.5-t,s=.5-e,l=a*a+i*i,u=a*o+i*s;if(u>0&&urt||t[1]at)return[c(t[0],et,rt),c(t[1],nt,at)]}function st(t,e){return t[0]===e[0]&&(t[0]===et||t[0]===rt)||(t[1]===e[1]&&(t[1]===nt||t[1]===at)||void 0)}function lt(t,e,r){return function(n,a){var i=ot(n),o=ot(a),s=[];if(i&&o&&st(i,o))return s;i&&s.push(i),o&&s.push(o);var u=2*l.constrain((n[t]+a[t])/2,e,r)-((i||n)[t]+(o||a)[t]);u&&((i&&o?u>0==i[t]>o[t]?i:o:i||o)[t]+=u);return s}}function ut(t){var e=t[0],r=t[1],n=e===U[V-1][0],a=r===U[V-1][1];if(!n||!a)if(V>1){var i=e===U[V-2][0],o=r===U[V-2][1];n&&(e===et||e===rt)&&i?o?V--:U[V-1]=t:a&&(r===nt||r===at)&&o?i?V--:U[V-1]=t:U[V++]=t}else U[V++]=t}function ct(t){U[V-1][0]!==t[0]&&U[V-1][1]!==t[1]&&ut([Z,J]),ut(t),Q=null,Z=J=0}function ft(t){if(k=t[0]/O,M=t[1]/D,W=t[0]rt?rt:0,Y=t[1]at?at:0,W||Y){if(V)if(Q){var e=K(Q,t);e.length>1&&(ct(e[0]),U[V++]=e[1])}else $=K(U[V-1],t)[0],U[V++]=$;else U[V++]=[W||t[0],Y||t[1]];var r=U[V-1];W&&Y&&(r[0]!==W||r[1]!==Y)?(Q&&(Z!==W&&J!==Y?ut(Z&&J?(n=Q,i=(a=t)[0]-n[0],o=(a[1]-n[1])/i,(n[1]*a[0]-a[1]*n[0])/i>0?[o>0?et:rt,at]:[o>0?rt:et,nt]):[Z||W,J||Y]):Z&&J&&ut([Z,J])),ut([W,Y])):Z-W&&J-Y&&ut([W||Z,Y||J]),Q=t,Z=W,J=Y}else Q&&ct(K(Q,t)[0]),U[V++]=t;var n,a,i,o}for("linear"===P||"spline"===P?K=function(t,e){for(var r=[],n=0,a=0;a<4;a++){var i=it[a],o=u(t[0],t[1],e[0],e[1],i[0],i[1],i[2],i[3]);o&&(!n||Math.abs(o.x-r[0][0])>1||Math.abs(o.y-r[0][1])>1)&&(o=[o.x,o.y],n&&X(o,t)q(p,dt))break;i=p,(_=m[0]*v[0]+m[1]*v[1])>b?(b=_,d=p,g=!1):_=t.length||!p)break;ft(p),n=p}}else ft(d)}Q&&ut([Z||Q[0],J||Q[1]]),N.push(U.slice(0,V))}return N}},{"../../constants/numerical":475,"../../lib":498,"./constants":658}],669:[function(t,e,r){"use strict";e.exports=function(t,e,r){"spline"===r("line.shape")&&r("line.smoothing")}},{}],670:[function(t,e,r){"use strict";var n={tonextx:1,tonexty:1,tonext:1};e.exports=function(t,e,r){var a,i,o,s,l,u={},c=!1,f=-1,d=0,h=-1;for(i=0;i=0?l=h:(l=h=d,d++),l0?Math.max(e,a):0}}},{"fast-isnumeric":155}],672:[function(t,e,r){"use strict";e.exports={container:"marker",min:"cmin",max:"cmax"}},{}],673:[function(t,e,r){"use strict";var n=t("../../components/color"),a=t("../../components/colorscale/helpers").hasColorscale,i=t("../../components/colorscale/defaults"),o=t("./subtypes");e.exports=function(t,e,r,s,l,u){var c=o.isBubble(t),f=(t.line||{}).color;(u=u||{},f&&(r=f),l("marker.symbol"),l("marker.opacity",c?.7:1),l("marker.size"),l("marker.color",r),a(t,"marker")&&i(t,e,s,l,{prefix:"marker.",cLetter:"c"}),u.noSelect||(l("selected.marker.color"),l("unselected.marker.color"),l("selected.marker.size"),l("unselected.marker.size")),u.noLine||(l("marker.line.color",f&&!Array.isArray(f)&&e.marker.color!==f?f:c?n.background:n.defaultLine),a(t,"marker.line")&&i(t,e,s,l,{prefix:"marker.line.",cLetter:"c"}),l("marker.line.width",c?1:0)),c&&(l("marker.sizeref"),l("marker.sizemin"),l("marker.sizemode")),u.gradient)&&("none"!==l("marker.gradient.type")&&l("marker.gradient.color"))}},{"../../components/color":368,"../../components/colorscale/defaults":378,"../../components/colorscale/helpers":379,"./subtypes":679}],674:[function(t,e,r){"use strict";var n=t("../../lib").dateTick0,a=t("../../constants/numerical").ONEWEEK;function i(t,e){return n(e,t%a==0?1:0)}e.exports=function(t,e,r,n,a){if(a||(a={x:!0,y:!0}),a.x){var o=n("xperiod");o&&(n("xperiod0",i(o,e.xcalendar)),n("xperiodalignment"))}if(a.y){var s=n("yperiod");s&&(n("yperiod0",i(s,e.ycalendar)),n("yperiodalignment"))}}},{"../../constants/numerical":475,"../../lib":498}],675:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../registry"),i=t("../../lib"),o=i.ensureSingle,s=i.identity,l=t("../../components/drawing"),u=t("./subtypes"),c=t("./line_points"),f=t("./link_traces"),d=t("../../lib/polygon").tester;function h(t,e,r,f,h,p,g){var v;!function(t,e,r,a,o){var s=r.xaxis,l=r.yaxis,c=n.extent(i.simpleMap(s.range,s.r2c)),f=n.extent(i.simpleMap(l.range,l.r2c)),d=a[0].trace;if(!u.hasMarkers(d))return;var h=d.marker.maxdisplayed;if(0===h)return;var p=a.filter((function(t){return t.x>=c[0]&&t.x<=c[1]&&t.y>=f[0]&&t.y<=f[1]})),g=Math.ceil(p.length/h),v=0;o.forEach((function(t,r){var n=t[0].trace;u.hasMarkers(n)&&n.marker.maxdisplayed>0&&r0;function y(t){return m?t.transition():t}var b=r.xaxis,x=r.yaxis,_=f[0].trace,w=_.line,A=n.select(p),T=o(A,"g","errorbars"),k=o(A,"g","lines"),M=o(A,"g","points"),E=o(A,"g","text");if(a.getComponentMethod("errorbars","plot")(t,T,r,g),!0===_.visible){var S,C;y(A).style("opacity",_.opacity);var L=_.fill.charAt(_.fill.length-1);"x"!==L&&"y"!==L&&(L=""),f[0][r.isRangePlot?"nodeRangePlot3":"node3"]=A;var O,D,R="",I=[],P=_._prevtrace;P&&(R=P._prevRevpath||"",C=P._nextFill,I=P._polygons);var F,z,N,B,j,U,V,H="",G="",q=[],X=i.noop;if(S=_._ownFill,u.hasLines(_)||"none"!==_.fill){for(C&&C.datum(f),-1!==["hv","vh","hvh","vhv"].indexOf(w.shape)?(F=l.steps(w.shape),z=l.steps(w.shape.split("").reverse().join(""))):F=z="spline"===w.shape?function(t){var e=t[t.length-1];return t.length>1&&t[0][0]===e[0]&&t[0][1]===e[1]?l.smoothclosed(t.slice(1),w.smoothing):l.smoothopen(t,w.smoothing)}:function(t){return"M"+t.join("L")},N=function(t){return z(t.reverse())},q=c(f,{xaxis:b,yaxis:x,connectGaps:_.connectgaps,baseTolerance:Math.max(w.width||1,3)/4,shape:w.shape,simplify:w.simplify,fill:_.fill}),V=_._polygons=new Array(q.length),v=0;v1){var r=n.select(this);if(r.datum(f),t)y(r.style("opacity",0).attr("d",O).call(l.lineGroupStyle)).style("opacity",1);else{var a=y(r);a.attr("d",O),l.singleLineStyle(f,a)}}}}}var W=k.selectAll(".js-line").data(q);y(W.exit()).style("opacity",0).remove(),W.each(X(!1)),W.enter().append("path").classed("js-line",!0).style("vector-effect","non-scaling-stroke").call(l.lineGroupStyle).each(X(!0)),l.setClipUrl(W,r.layerClipId,t),q.length?(S?(S.datum(f),B&&U&&(L?("y"===L?B[1]=U[1]=x.c2p(0,!0):"x"===L&&(B[0]=U[0]=b.c2p(0,!0)),y(S).attr("d","M"+U+"L"+B+"L"+H.substr(1)).call(l.singleFillStyle)):y(S).attr("d",H+"Z").call(l.singleFillStyle))):C&&("tonext"===_.fill.substr(0,6)&&H&&R?("tonext"===_.fill?y(C).attr("d",H+"Z"+R+"Z").call(l.singleFillStyle):y(C).attr("d",H+"L"+R.substr(1)+"Z").call(l.singleFillStyle),_._polygons=_._polygons.concat(I)):(Z(C),_._polygons=null)),_._prevRevpath=G,_._prevPolygons=V):(S?Z(S):C&&Z(C),_._polygons=_._prevRevpath=_._prevPolygons=null),M.datum(f),E.datum(f),function(e,a,i){var o,c=i[0].trace,f=u.hasMarkers(c),d=u.hasText(c),h=tt(c),p=et,g=et;if(f||d){var v=s,_=c.stackgroup,w=_&&"infer zero"===t._fullLayout._scatterStackOpts[b._id+x._id][_].stackgaps;c.marker.maxdisplayed||c._needsCull?v=w?Q:J:_&&!w&&(v=$),f&&(p=v),d&&(g=v)}var A,T=(o=e.selectAll("path.point").data(p,h)).enter().append("path").classed("point",!0);m&&T.call(l.pointStyle,c,t).call(l.translatePoints,b,x).style("opacity",0).transition().style("opacity",1),o.order(),f&&(A=l.makePointStyleFns(c)),o.each((function(e){var a=n.select(this),i=y(a);l.translatePoint(e,i,b,x)?(l.singlePointStyle(e,i,c,A,t),r.layerClipId&&l.hideOutsideRangePoint(e,i,b,x,c.xcalendar,c.ycalendar),c.customdata&&a.classed("plotly-customdata",null!==e.data&&void 0!==e.data)):i.remove()})),m?o.exit().transition().style("opacity",0).remove():o.exit().remove(),(o=a.selectAll("g").data(g,h)).enter().append("g").classed("textpoint",!0).append("text"),o.order(),o.each((function(t){var e=n.select(this),a=y(e.select("text"));l.translatePoint(t,a,b,x)?r.layerClipId&&l.hideOutsideRangePoint(t,e,b,x,c.xcalendar,c.ycalendar):e.remove()})),o.selectAll("text").call(l.textPointStyle,c,t).each((function(t){var e=b.c2p(t.x),r=x.c2p(t.y);n.select(this).selectAll("tspan.line").each((function(){y(n.select(this)).attr({x:e,y:r})}))})),o.exit().remove()}(M,E,f);var Y=!1===_.cliponaxis?null:r.layerClipId;l.setClipUrl(M,Y,t),l.setClipUrl(E,Y,t)}function Z(t){y(t).attr("d","M0,0Z")}function J(t){return t.filter((function(t){return!t.gap&&t.vis}))}function Q(t){return t.filter((function(t){return t.vis}))}function $(t){return t.filter((function(t){return!t.gap}))}function K(t){return t.id}function tt(t){if(t.ids)return K}function et(){return!1}}e.exports=function(t,e,r,a,i,u){var c,d,p=!i,g=!!i&&i.duration>0,v=f(t,e,r);((c=a.selectAll("g.trace").data(v,(function(t){return t[0].trace.uid}))).enter().append("g").attr("class",(function(t){return"trace scatter trace"+t[0].trace.uid})).style("stroke-miterlimit",2),c.order(),function(t,e,r){e.each((function(e){var a=o(n.select(this),"g","fills");l.setClipUrl(a,r.layerClipId,t);var i=e[0].trace,u=[];i._ownfill&&u.push("_ownFill"),i._nexttrace&&u.push("_nextFill");var c=a.selectAll("g").data(u,s);c.enter().append("g"),c.exit().each((function(t){i[t]=null})).remove(),c.order().each((function(t){i[t]=o(n.select(this),"path","js-fill")}))}))}(t,c,e),g)?(u&&(d=u()),n.transition().duration(i.duration).ease(i.easing).each("end",(function(){d&&d()})).each("interrupt",(function(){d&&d()})).each((function(){a.selectAll("g.trace").each((function(r,n){h(t,n,e,r,v,this,i)}))}))):c.each((function(r,n){h(t,n,e,r,v,this,i)}));p&&c.exit().remove(),a.selectAll("path:not([d])").remove()}},{"../../components/drawing":390,"../../lib":498,"../../lib/polygon":510,"../../registry":593,"./line_points":668,"./link_traces":670,"./subtypes":679,d3:86}],676:[function(t,e,r){"use strict";var n=t("./subtypes");e.exports=function(t,e){var r,a,i,o,s=t.cd,l=t.xaxis,u=t.yaxis,c=[],f=s[0].trace;if(!n.hasMarkers(f)&&!n.hasText(f))return[];if(!1===e)for(r=0;r=v,T=2*w,k={},M=b.makeCalcdata(e,"x"),E=x.makeCalcdata(e,"y"),S=s(e,b,"x",M),C=s(e,x,"y",E);e._x=S,e._y=C,e.xperiodalignment&&(e._origX=M),e.yperiodalignment&&(e._origY=E);var L=new Array(T);for(r=0;r1&&a.extendFlat(s.line,h.linePositions(t,r,n));if(s.errorX||s.errorY){var l=h.errorBarPositions(t,r,n,i,o);s.errorX&&a.extendFlat(s.errorX,l.x),s.errorY&&a.extendFlat(s.errorY,l.y)}s.text&&(a.extendFlat(s.text,{positions:n},h.textPosition(t,r,s.text,s.marker)),a.extendFlat(s.textSel,{positions:n},h.textPosition(t,r,s.text,s.markerSel)),a.extendFlat(s.textUnsel,{positions:n},h.textPosition(t,r,s.text,s.markerUnsel)));return s}(t,0,e,L,S,C),I=p(t,_);return f(y,e),A?R.marker&&(D=2*(R.marker.sizeAvg||Math.max(R.marker.size,3))):D=u(e,w),c(t,e,b,x,S,C,D),R.errorX&&m(e,b,R.errorX),R.errorY&&m(e,x,R.errorY),R.fill&&!I.fill2d&&(I.fill2d=!0),R.marker&&!I.scatter2d&&(I.scatter2d=!0),R.line&&!I.line2d&&(I.line2d=!0),!R.errorX&&!R.errorY||I.error2d||(I.error2d=!0),R.text&&!I.glText&&(I.glText=!0),R.marker&&(R.marker.snap=w),I.lineOptions.push(R.line),I.errorXOptions.push(R.errorX),I.errorYOptions.push(R.errorY),I.fillOptions.push(R.fill),I.markerOptions.push(R.marker),I.markerSelectedOptions.push(R.markerSel),I.markerUnselectedOptions.push(R.markerUnsel),I.textOptions.push(R.text),I.textSelectedOptions.push(R.textSel),I.textUnselectedOptions.push(R.textUnsel),I.selectBatch.push([]),I.unselectBatch.push([]),k._scene=I,k.index=I.count,k.x=S,k.y=C,k.positions=L,I.count++,[{x:!1,y:!1,t:k,trace:e}]}},{"../../constants/numerical":475,"../../lib":498,"../../plots/cartesian/align_period":544,"../../plots/cartesian/autorange":546,"../../plots/cartesian/axis_ids":550,"../scatter/calc":655,"../scatter/colorscale_calc":657,"./constants":685,"./convert":686,"./scene_update":694,"@plotly/point-cluster":10}],685:[function(t,e,r){"use strict";e.exports={TOO_MANY_POINTS:1e5,SYMBOL_SDF_SIZE:200,SYMBOL_SIZE:20,SYMBOL_STROKE:1,DOT_RE:/-dot/,OPEN_RE:/-open/,DASHES:{solid:[1],dot:[1,1],dash:[4,1],longdash:[8,1],dashdot:[4,1,1,1],longdashdot:[8,1,1,1]}}},{}],686:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("svg-path-sdf"),i=t("color-normalize"),o=t("../../registry"),s=t("../../lib"),l=t("../../components/drawing"),u=t("../../plots/cartesian/axis_ids"),c=t("../../lib/gl_format_color").formatColor,f=t("../scatter/subtypes"),d=t("../scatter/make_bubble_size_func"),h=t("./helpers"),p=t("./constants"),g=t("../../constants/interactions").DESELECTDIM,v={start:1,left:1,end:-1,right:-1,middle:0,center:0,bottom:1,top:-1},m=t("../../components/fx/helpers").appendArrayPointValue;function y(t,e){var r,a=t._fullLayout,i=e._length,o=e.textfont,l=e.textposition,u=Array.isArray(l)?l:[l],c=o.color,f=o.size,d=o.family,h={},p=e.texttemplate;if(p){h.text=[];var g=a._d3locale,v=Array.isArray(p),y=v?Math.min(p.length,i):i,b=v?function(t){return p[t]}:function(){return p};for(r=0;rp.TOO_MANY_POINTS||f.hasMarkers(e)?"rect":"round";if(u&&e.connectgaps){var d=n[0],h=n[1];for(a=0;a1?l[a]:l[0]:l,p=Array.isArray(u)?u.length>1?u[a]:u[0]:u,g=v[h],m=v[p],y=c?c/.8+1:0,b=-m*y-.5*m;o.offset[a]=[g*y/d,b/d]}}return o}}},{"../../components/drawing":390,"../../components/fx/helpers":404,"../../constants/interactions":474,"../../lib":498,"../../lib/gl_format_color":494,"../../plots/cartesian/axis_ids":550,"../../registry":593,"../scatter/make_bubble_size_func":671,"../scatter/subtypes":679,"./constants":685,"./helpers":690,"color-normalize":63,"fast-isnumeric":155,"svg-path-sdf":320}],687:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../registry"),i=t("./helpers"),o=t("./attributes"),s=t("../scatter/constants"),l=t("../scatter/subtypes"),u=t("../scatter/xy_defaults"),c=t("../scatter/period_defaults"),f=t("../scatter/marker_defaults"),d=t("../scatter/line_defaults"),h=t("../scatter/fillcolor_defaults"),p=t("../scatter/text_defaults");e.exports=function(t,e,r,g){function v(r,a){return n.coerce(t,e,o,r,a)}var m=!!t.marker&&i.isOpenSymbol(t.marker.symbol),y=l.isBubble(t),b=u(t,e,g,v);if(b){c(t,e,g,v);var x=b100},r.isDotSymbol=function(t){return"string"==typeof t?n.DOT_RE.test(t):t>200}},{"./constants":685}],691:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../lib"),i=t("../scatter/get_trace_color");function o(t,e,r,o){var s=t.xa,l=t.ya,u=t.distance,c=t.dxy,f=t.index,d={pointNumber:f,x:e[f],y:r[f]};d.tx=Array.isArray(o.text)?o.text[f]:o.text,d.htx=Array.isArray(o.hovertext)?o.hovertext[f]:o.hovertext,d.data=Array.isArray(o.customdata)?o.customdata[f]:o.customdata,d.tp=Array.isArray(o.textposition)?o.textposition[f]:o.textposition;var h=o.textfont;h&&(d.ts=a.isArrayOrTypedArray(h.size)?h.size[f]:h.size,d.tc=Array.isArray(h.color)?h.color[f]:h.color,d.tf=Array.isArray(h.family)?h.family[f]:h.family);var p=o.marker;p&&(d.ms=a.isArrayOrTypedArray(p.size)?p.size[f]:p.size,d.mo=a.isArrayOrTypedArray(p.opacity)?p.opacity[f]:p.opacity,d.mx=a.isArrayOrTypedArray(p.symbol)?p.symbol[f]:p.symbol,d.mc=a.isArrayOrTypedArray(p.color)?p.color[f]:p.color);var g=p&&p.line;g&&(d.mlc=Array.isArray(g.color)?g.color[f]:g.color,d.mlw=a.isArrayOrTypedArray(g.width)?g.width[f]:g.width);var v=p&&p.gradient;v&&"none"!==v.type&&(d.mgt=Array.isArray(v.type)?v.type[f]:v.type,d.mgc=Array.isArray(v.color)?v.color[f]:v.color);var m=s.c2p(d.x,!0),y=l.c2p(d.y,!0),b=d.mrc||1,x=o.hoverlabel;x&&(d.hbg=Array.isArray(x.bgcolor)?x.bgcolor[f]:x.bgcolor,d.hbc=Array.isArray(x.bordercolor)?x.bordercolor[f]:x.bordercolor,d.hts=a.isArrayOrTypedArray(x.font.size)?x.font.size[f]:x.font.size,d.htc=Array.isArray(x.font.color)?x.font.color[f]:x.font.color,d.htf=Array.isArray(x.font.family)?x.font.family[f]:x.font.family,d.hnl=a.isArrayOrTypedArray(x.namelength)?x.namelength[f]:x.namelength);var _=o.hoverinfo;_&&(d.hi=Array.isArray(_)?_[f]:_);var w=o.hovertemplate;w&&(d.ht=Array.isArray(w)?w[f]:w);var A={};A[t.index]=d;var T=o._origX,k=o._origY,M=a.extendFlat({},t,{color:i(o,d),x0:m-b,x1:m+b,xLabelVal:T?T[f]:d.x,y0:y-b,y1:y+b,yLabelVal:k?k[f]:d.y,cd:A,distance:u,spikeDistance:c,hovertemplate:d.ht});return d.htx?M.text=d.htx:d.tx?M.text=d.tx:o.text&&(M.text=o.text),a.fillText(d,o,M),n.getComponentMethod("errorbars","hoverInfo")(d,o,M),M}e.exports={hoverPoints:function(t,e,r,n){var a,i,s,l,u,c,f,d,h,p=t.cd,g=p[0].t,v=p[0].trace,m=t.xa,y=t.ya,b=g.x,x=g.y,_=m.c2p(e),w=y.c2p(r),A=t.distance;if(g.tree){var T=m.p2c(_-A),k=m.p2c(_+A),M=y.p2c(w-A),E=y.p2c(w+A);a="x"===n?g.tree.range(Math.min(T,k),Math.min(y._rl[0],y._rl[1]),Math.max(T,k),Math.max(y._rl[0],y._rl[1])):g.tree.range(Math.min(T,k),Math.min(M,E),Math.max(T,k),Math.max(M,E))}else a=g.ids;var S=A;if("x"===n)for(u=0;u-1;u--)s=b[a[u]],l=x[a[u]],c=m.c2p(s)-_,f=y.c2p(l)-w,(d=Math.sqrt(c*c+f*f))m.glText.length){var w=x-m.glText.length;for(p=0;pr&&(isNaN(e[n])||isNaN(e[n+1]));)n-=2;t.positions=e.slice(r,n+2)}return t})),m.line2d.update(m.lineOptions)),m.error2d){var T=(m.errorXOptions||[]).concat(m.errorYOptions||[]);m.error2d.update(T)}m.scatter2d&&m.scatter2d.update(m.markerOptions),m.fillOrder=s.repeat(null,x),m.fill2d&&(m.fillOptions=m.fillOptions.map((function(t,e){var n=r[e];if(t&&n&&n[0]&&n[0].trace){var a,i,o=n[0],s=o.trace,l=o.t,u=m.lineOptions[e],c=[];s._ownfill&&c.push(e),s._nexttrace&&c.push(e+1),c.length&&(m.fillOrder[e]=c);var f,d,h=[],p=u&&u.positions||l.positions;if("tozeroy"===s.fill){for(f=0;ff&&isNaN(p[d+1]);)d-=2;0!==p[f+1]&&(h=[p[f],0]),h=h.concat(p.slice(f,d+2)),0!==p[d+1]&&(h=h.concat([p[d],0]))}else if("tozerox"===s.fill){for(f=0;ff&&isNaN(p[d]);)d-=2;0!==p[f]&&(h=[0,p[f+1]]),h=h.concat(p.slice(f,d+2)),0!==p[d]&&(h=h.concat([0,p[d+1]]))}else if("toself"===s.fill||"tonext"===s.fill){for(h=[],a=0,i=0;i-1;for(p=0;pd?2*(x.sizeAvg||Math.max(x.size,3)):i(e,b),h=0;hi&&l||a-1,M=!0;if(o(b)||!!h.selectedpoints||k){var E=h._length;if(h.selectedpoints){g.selectBatch=h.selectedpoints;var S=h.selectedpoints,C={};for(l=0;l