You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

61 lines
1.5 MiB

/**
* 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<n.length;o++)a(n[o]);return a}({1:[function(t,e,r){"use strict";var n=t("../src/lib"),a={"X,X div":"direction:ltr;font-family:'Open Sans', verdana, arial, sans-serif;margin:0;padding:0;","X input,X button":"font-family:'Open Sans', verdana, arial, sans-serif;","X input:focus,X button:focus":"outline:none;","X a":"text-decoration:none;","X a:hover":"text-decoration:none;","X .crisp":"shape-rendering:crispEdges;","X .user-select-none":"-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;","X svg":"overflow:hidden;","X svg a":"fill:#447adb;","X svg a:hover":"fill:#3c6dc5;","X .main-svg":"position:absolute;top:0;left:0;pointer-events:none;","X .main-svg .draglayer":"pointer-events:all;","X .cursor-default":"cursor:default;","X .cursor-pointer":"cursor:pointer;","X .cursor-crosshair":"cursor:crosshair;","X .cursor-move":"cursor:move;","X .cursor-col-resize":"cursor:col-resize;","X .cursor-row-resize":"cursor:row-resize;","X .cursor-ns-resize":"cursor:ns-resize;","X .cursor-ew-resize":"cursor:ew-resize;","X .cursor-sw-resize":"cursor:sw-resize;","X .cursor-s-resize":"cursor:s-resize;","X .cursor-se-resize":"cursor:se-resize;","X .cursor-w-resize":"cursor:w-resize;","X .cursor-e-resize":"cursor:e-resize;","X .cursor-nw-resize":"cursor:nw-resize;","X .cursor-n-resize":"cursor:n-resize;","X .cursor-ne-resize":"cursor:ne-resize;","X .cursor-grab":"cursor:-webkit-grab;cursor:grab;","X .modebar":"position:absolute;top:2px;right:2px;","X .ease-bg":"-webkit-transition:background-color 0.3s ease 0s;-moz-transition:background-color 0.3s ease 0s;-ms-transition:background-color 0.3s ease 0s;-o-transition:background-color 0.3s ease 0s;transition:background-color 0.3s ease 0s;","X .modebar--hover>: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<u;l++)s[2*l]=a((t[2*l]-r)*i,0,1),s[2*l+1]=a((t[2*l+1]-n)*o,0,1);return s}e.exports=function(t,e){e||(e={}),t=u(t,"float64"),e=s(e,{bounds:"range bounds dataBox databox",maxDepth:"depth maxDepth maxdepth level maxLevel maxlevel levels",dtype:"type dtype format out dst output destination"});var r=l(e.maxDepth,255),a=l(e.bounds,o(t,2));a[0]===a[2]&&a[2]++,a[1]===a[3]&&a[3]++;var p,g=h(t,a),v=t.length>>>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;m<v;++m)p[m]=m;var y=[],b=[],x=[],_=[];!function t(e,n,a,i,o,s){if(!i.length)return null;var l=y[o]||(y[o]=[]),u=x[o]||(x[o]=[]),c=b[o]||(b[o]=[]),f=l.length;if(++o>r||s>1073741824){for(var d=0;d<i.length;d++)l.push(i[d]),u.push(s),c.push(null,null,null,null);return f}if(l.push(i[0]),u.push(s),i.length<=1)return c.push(null,null,null,null),f;for(var h=.5*a,p=e+h,v=n+h,m=[],_=[],w=[],A=[],T=1,k=i.length;T<k;T++){var M=i[T],E=g[2*M],S=g[2*M+1];E<p?S<v?m.push(M):_.push(M):S<v?w.push(M):A.push(M)}return s<<=2,c.push(t(e,n,h,m,o,s),t(e,v,h,_,o,s+1),t(p,n,h,w,o,s+2),t(p,v,h,A,o,s+3)),f}(0,0,1,p,0,1);for(var w=0,A=0;A<y.length;A++){var T=y[A];if(p.set)p.set(T,w);else for(var k=0,M=T.length;k<M;k++)p[k+w]=T[k];var E=w+y[A].length;_[A]=[w,E],w=E}return p.range=function(){var e,r=[],n=arguments.length;for(;n--;)r[n]=arguments[n];if(c(r[r.length-1])){var o=r.pop();r.length||null==o.x&&null==o.l&&null==o.left||(r=[o],e={}),e=s(o,{level:"level maxLevel",d:"d diam diameter r radius px pxSize pixel pixelSize maxD size minSize",lod:"lod details ranges offsets"})}else e={};r.length||(r=a);var u=i.apply(void 0,r),f=[Math.min(u.x,u.x+u.width),Math.min(u.y,u.y+u.height),Math.max(u.x,u.x+u.width),Math.max(u.y,u.y+u.height)],p=f[0],g=f[1],v=f[2],m=f[3],x=h([p,g,v,m],a),_=x[0],w=x[1],A=x[2],T=x[3],k=l(e.level,y.length);if(null!=e.d){var M;"number"==typeof e.d?M=[e.d,e.d]:e.d.length&&(M=e.d),k=Math.min(Math.max(Math.ceil(-d(Math.abs(M[0])/(a[2]-a[0]))),Math.ceil(-d(Math.abs(M[1])/(a[3]-a[1])))),k)}if(k=Math.min(k,y.length),e.lod)return S(_,w,A,T,k);var E=[];function C(e,r,n,a,i,o){if(null!==i&&null!==o&&!(_>e+n||w>r+n||A<e||T<r||a>=k||i===o)){var s=y[a];void 0===o&&(o=s.length);for(var l=i;l<o;l++){var u=s[l],c=t[2*u],f=t[2*u+1];c>=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;s<i;s++){var l=x[s],u=_[s][0],c=C(t,e,s),f=C(r,a,s),d=n.ge(l,c),h=n.gt(l,f,d,l.length-1);o[s]=[d+u,h+u]}return o}function C(t,e,r){for(var n=1,a=.5,i=.5,o=.5,s=0;s<r;s++)n<<=2,n+=t<a?e<i?0:1:e<i?2:3,o*=.5,a+=t<a?-o:o,i+=e<i?-o:o;return n}}},{"array-bounds":14,"binary-search-bounds":39,clamp:58,defined:87,dtype:91,"flatten-vertex-data":156,"is-obj":248,"math-log2":252,"parse-rect":265,"pick-by-alias":271}],12:[function(t,e,r){e.exports=function(t){var e=0,r=0,n=0,a=0;return t.map((function(t){var i=(t=t.slice())[0],o=i.toUpperCase();if(i!=o)switch(t[0]=o,i){case"a":t[6]+=n,t[7]+=a;break;case"v":t[1]+=a;break;case"h":t[1]+=n;break;default:for(var s=1;s<t.length;)t[s++]+=n,t[s++]+=a}switch(o){case"Z":n=e,a=r;break;case"H":n=t[1];break;case"V":a=t[1];break;case"M":n=e=t[1],a=r=t[2];break;default:n=t[t.length-2],a=t[t.length-1]}return t}))}},{}],13:[function(t,e,r){var n=t("pad-left");e.exports=function(t,e,r){e="number"==typeof e?e:1,r=r||": ";var a=t.split(/\r?\n/),i=String(a.length+e-1).length;return a.map((function(t,a){var o=a+e,s=String(o).length;return n(o,i-s)+r+t})).join("\n")}},{"pad-left":263}],14:[function(t,e,r){"use strict";e.exports=function(t,e){if(!t||null==t.length)throw Error("Argument should be an array");e=null==e?1:Math.floor(e);for(var r=Array(2*e),n=0;n<e;n++){for(var a=-1/0,i=1/0,o=n,s=t.length;o<s;o+=e)t[o]>a&&(a=t[o]),t[o]<i&&(i=t[o]);r[n]=i,r[e+n]=a}return r}},{}],15:[function(t,e,r){"use strict";var n=t("array-bounds");e.exports=function(t,e,r){if(!t||null==t.length)throw Error("Argument should be an array");null==e&&(e=1);null==r&&(r=n(t,e));for(var a=0;a<e;a++){var i=r[e+a],o=r[a],s=a,l=t.length;if(i===1/0&&o===-1/0)for(s=a;s<l;s+=e)t[s]=t[s]===i?1:t[s]===o?0:.5;else if(i===1/0)for(s=a;s<l;s+=e)t[s]=t[s]===i?1:0;else if(o===-1/0)for(s=a;s<l;s+=e)t[s]=t[s]===o?0:1;else{var u=i-o;for(s=a;s<l;s+=e)isNaN(t[s])||(t[s]=0===u?.5:(t[s]-o)/u)}}return t}},{"array-bounds":14}],16:[function(t,e,r){e.exports=function(t,e){var r="number"==typeof t,n="number"==typeof e;r&&!n?(e=t,t=0):r||n||(t=0,e=0);var a=(e|=0)-(t|=0);if(a<0)throw new Error("array length must be positive");for(var i=new Array(a),o=0,s=t;o<a;o++,s++)i[o]=s;return i}},{}],17:[function(t,e,r){(function(r){(function(){"use strict";var n=t("object-assign");
/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
* @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<i;++a)if(t[a]!==e[a]){r=t[a],n=e[a];break}return r<n?-1:n<r?1:0}function i(t){return r.Buffer&&"function"==typeof r.Buffer.isBuffer?r.Buffer.isBuffer(t):!(null==t||!t._isBuffer)}var o=t("util/"),s=Object.prototype.hasOwnProperty,l=Array.prototype.slice,u="foo"===function(){}.name;function c(t){return Object.prototype.toString.call(t)}function f(t){return!i(t)&&("function"==typeof r.ArrayBuffer&&("function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(t):!!t&&(t instanceof DataView||!!(t.buffer&&t.buffer instanceof ArrayBuffer))))}var d=e.exports=y,h=/\s*function\s+([^\(\s]*)\s*/;function p(t){if(o.isFunction(t)){if(u)return t.name;var e=t.toString().match(h);return e&&e[1]}}function g(t,e){return"string"==typeof t?t.length<e?t:t.slice(0,e):t}function v(t){if(u||!o.isFunction(t))return o.inspect(t);var e=p(t);return"[Function"+(e?": "+e:"")+"]"}function m(t,e,r,n,a){throw new d.AssertionError({message:r,actual:t,expected:e,operator:n,stackStartFunction:a})}function y(t,e){t||m(t,!0,e,"==",d.ok)}function b(t,e,r,n){if(t===e)return!0;if(i(t)&&i(e))return 0===a(t,e);if(o.isDate(t)&&o.isDate(e))return t.getTime()===e.getTime();if(o.isRegExp(t)&&o.isRegExp(e))return t.source===e.source&&t.global===e.global&&t.multiline===e.multiline&&t.lastIndex===e.lastIndex&&t.ignoreCase===e.ignoreCase;if(null!==t&&"object"==typeof t||null!==e&&"object"==typeof e){if(f(t)&&f(e)&&c(t)===c(e)&&!(t instanceof Float32Array||t instanceof Float64Array))return 0===a(new Uint8Array(t.buffer),new Uint8Array(e.buffer));if(i(t)!==i(e))return!1;var s=(n=n||{actual:[],expected:[]}).actual.indexOf(t);return-1!==s&&s===n.expected.indexOf(e)||(n.actual.push(t),n.expected.push(e),function(t,e,r,n){if(null==t||null==e)return!1;if(o.isPrimitive(t)||o.isPrimitive(e))return t===e;if(r&&Object.getPrototypeOf(t)!==Object.getPrototypeOf(e))return!1;var a=x(t),i=x(e);if(a&&!i||!a&&i)return!1;if(a)return t=l.call(t),e=l.call(e),b(t,e,r);var s,u,c=A(t),f=A(e);if(c.length!==f.length)return!1;for(c.sort(),f.sort(),u=c.length-1;u>=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<arguments.length;r++)e.push(s(arguments[r]));return e.join(" ")}r=1;for(var n=arguments,i=n.length,o=String(t).replace(a,(function(t){if("%%"===t)return"%";if(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<i;l=n[++r])g(l)||!x(l)?o+=" "+l:o+=" "+s(l);return o},r.deprecate=function(t,a){if(y(n.process))return function(){return r.deprecate(t,a).apply(this,arguments)};if(!0===e.noDeprecation)return t;var i=!1;return function(){if(!i){if(e.throwDeprecation)throw new Error(a);e.traceDeprecation?console.trace(a):console.error(a),i=!0}return t.apply(this,arguments)}};var i,o={};function s(t,e){var n={seen:[],stylize:u};return arguments.length>=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<s;++o)S(e,String(o))?i.push(d(t,e,r,n,String(o),!0)):i.push("");return a.forEach((function(a){a.match(/^\d+$/)||i.push(d(t,e,r,n,a,!0))})),i}(t,e,n,s,o):o.map((function(r){return d(t,e,n,s,r,T)})),t.seen.pop(),function(t,e,r){if(t.reduce((function(t,e){return e.indexOf("\n")>=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<f;r+=4)e=a[t.charCodeAt(r)]<<18|a[t.charCodeAt(r+1)]<<12|a[t.charCodeAt(r+2)]<<6|a[t.charCodeAt(r+3)],l[c++]=e>>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;o<s;o+=16383)i.push(c(t,o,o+16383>s?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;s<l;++s)n[s]=o[s],a[o.charCodeAt(s)]=s;function u(t){var e=t.length;if(e%4>0)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<r;s+=3)a=(t[s]<<16&16711680)+(t[s+1]<<8&65280)+(255&t[s+2]),o.push(n[(i=a)>>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;i<e;i++){var o=r[i];a+=o*Math.pow(67108864,i)}return n(t)*a}},{"./bn-sign":28}],30:[function(t,e,r){"use strict";var n=t("double-bits"),a=t("bit-twiddle").countTrailingZeros;e.exports=function(t){var e=a(n.lo(t));if(e<32)return e;var r=a(n.hi(t));if(r>20)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)&-(t<e)},r.max=function(t,e){return t^(t^e)&-(t<e)},r.isPow2=function(t){return!(t&t-1||!t)},r.log2=function(t){var e,r;return e=(t>65535)<<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<<a&255}}(a),r.reverse=function(t){return a[255&t]<<24|a[t>>>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<g;p++)l[p]=u[p*c+y]/255;else if(1!==c)throw Error("Raw data can have only 1 value per pixel");var b=Array(r*o),x=Array(r*o),_=Array(s),w=Array(s),A=Array(s+1),T=Array(s);for(p=0,g=r*o;p<g;p++){var k=l[p];b[p]=1===k?0:0===k?a:Math.pow(Math.max(0,.5-k),2),x[p]=1===k?a:0===k?0:Math.pow(Math.max(0,k-.5),2)}i(b,r,o,_,w,T,A),i(x,r,o,_,w,T,A);var M=window.Float32Array?new Float32Array(r*o):new Array(r*o);for(p=0,g=r*o;p<g;p++)M[p]=n(1-((b[p]-x[p])/m+v),0,1);return M};var a=1e20;function i(t,e,r,n,a,i,s){for(var l=0;l<e;l++){for(var u=0;u<r;u++)n[u]=t[u*e+l];for(o(n,a,i,s,r),u=0;u<r;u++)t[u*e+l]=a[u]}for(u=0;u<r;u++){for(l=0;l<e;l++)n[l]=t[u*e+l];for(o(n,a,i,s,e),l=0;l<e;l++)t[u*e+l]=Math.sqrt(a[l])}}function o(t,e,r,n,i){r[0]=0,n[0]=-a,n[1]=+a;for(var o=1,s=0;o<i;o++){for(var l=(t[o]+o*o-(t[r[s]]+r[s]*r[s]))/(2*o-2*r[s]);l<=n[s];)s--,l=(t[o]+o*o-(t[r[s]]+r[s]*r[s]))/(2*o-2*r[s]);r[++s]=o,n[s]=l,n[s+1]=+a}for(o=0,s=0;o<i;o++){for(;n[s+1]<o;)s++;e[o]=(o-r[s])*(o-r[s])+t[r[s]]}}},{clamp:58}],42:[function(t,e,r){!function(e,r){"use strict";function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function a(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function i(t,e,r){if(i.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var o;"object"==typeof e?e.exports=i:r.BN=i,i.BN=i,i.wordSize=26;try{o=t("buffer").Buffer}catch(t){}function s(t,e,r){for(var n=0,a=Math.min(t.length,r),i=e;i<a;i++){var o=t.charCodeAt(i)-48;n<<=4,n|=o>=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<i;o++){var s=t.charCodeAt(o)-48;a*=n,a+=s>=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<this.length;a++)this.words[a]=0;var i,o,s=0;if("be"===r)for(a=t.length-1,i=0;a>=0;a-=3)o=t[a]|t[a-1]<<8|t[a-2]<<16,this.words[i]|=o<<s&67108863,this.words[i+1]=o>>>26-s&67108863,(s+=24)>=26&&(s-=26,i++);else if("le"===r)for(a=0,i=0;a<t.length;a+=3)o=t[a]|t[a+1]<<8|t[a+2]<<16,this.words[i]|=o<<s&67108863,this.words[i+1]=o>>>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<this.length;r++)this.words[r]=0;var n,a,i=0;for(r=t.length-6,n=0;r>=e;r-=6)a=s(t,r,r+6),this.words[n]|=a<<i&67108863,this.words[n+1]|=a>>>26-i&4194303,(i+=24)>=26&&(i-=26,n++);r+6!==e&&(a=s(t,e,r+6),this.words[n]|=a<<i&67108863,this.words[n+1]|=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;c<s;c+=n)u=l(t,c,c+n,e),this.imuln(a),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==o){var f=1;for(u=l(t,c,t.length,e),c=0;c<o;c++)f*=e;this.imuln(f),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}},i.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},i.prototype.clone=function(){var t=new i(null);return this.copy(t),t},i.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},i.prototype.strip=function(){for(;this.length>1&&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?"<BN-R: ":"<BN: ")+this.toString(16)+">"};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<n;u++){for(var c=l>>>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<this.length;o++){var s=this.words[o],l=(16777215&(s<<a|i)).toString(16);r=0!==(i=s>>>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<i;s++)u[s]=0}else{for(s=0;s<i-a;s++)u[s]=0;for(s=0;!c.isZero();s++)o=c.andln(255),c.iushrn(8),u[i-s-1]=o}return u},Math.clz32?i.prototype._countBits=function(t){return 32-Math.clz32(t)}:i.prototype._countBits=function(t){var e=t,r=0;return e>=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;e<this.length;e++){var r=this._zeroBits(this.words[e]);if(t+=r,26!==r)break}return t},i.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},i.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},i.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},i.prototype.isNeg=function(){return 0!==this.negative},i.prototype.neg=function(){return this.clone().ineg()},i.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},i.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this.strip()},i.prototype.ior=function(t){return n(0==(this.negative|t.negative)),this.iuor(t)},i.prototype.or=function(t){return this.length>t.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;r<e.length;r++)this.words[r]=this.words[r]&t.words[r];return this.length=e.length,this.strip()},i.prototype.iand=function(t){return n(0==(this.negative|t.negative)),this.iuand(t)},i.prototype.and=function(t){return this.length>t.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;n<r.length;n++)this.words[n]=e.words[n]^r.words[n];if(this!==e)for(;n<e.length;n++)this.words[n]=e.words[n];return this.length=e.length,this.strip()},i.prototype.ixor=function(t){return n(0==(this.negative|t.negative)),this.iuxor(t)},i.prototype.xor=function(t){return this.length>t.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;a<e;a++)this.words[a]=67108863&~this.words[a];return r>0&&(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<<a:this.words[r]&~(1<<a),this.strip()},i.prototype.iadd=function(t){var e,r,n;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(r=this,n=t):(r=t,n=this);for(var a=0,i=0;i<n.length;i++)e=(0|r.words[i])+(0|n.words[i])+a,this.words[i]=67108863&e,a=e>>>26;for(;0!==a&&i<r.length;i++)e=(0|r.words[i])+a,this.words[i]=67108863&e,a=e>>>26;if(this.length=r.length,0!==a)this.words[this.length]=a,this.length++;else if(r!==this)for(;i<r.length;i++)this.words[i]=r.words[i];return this},i.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.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<n.length;o++)i=(e=(0|r.words[o])-(0|n.words[o])+i)>>26,this.words[o]=67108863&e;for(;0!==i&&o<r.length;o++)i=(e=(0|r.words[o])+i)>>26,this.words[o]=67108863&e;if(0===i&&o<r.length&&r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this.length=Math.max(this.length,o),r!==this&&(this.negative=1),this.strip()},i.prototype.sub=function(t){return this.clone().isub(t)};var h=function(t,e,r){var n,a,i,o=t.words,s=e.words,l=r.words,u=0,c=0|o[0],f=8191&c,d=c>>>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<r.length-1;i++){var o=a;a=0;for(var s=67108863&n,l=Math.min(i,e.length-1),u=Math.max(0,i-t.length+1);u<=l;u++){var c=i-u,f=(0|t.words[c])*(0|e.words[u]),d=67108863&f;s=67108863&(d=d+s|0),a+=(o=(o=o+(f/67108864|0)|0)+(d>>>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<t;n++)e[n]=this.revBin(n,r,t);return e},g.prototype.revBin=function(t,e,r){if(0===t||t===r-1)return t;for(var n=0,a=0;a<e;a++)n|=(1&t)<<e-a-1,t>>=1;return n},g.prototype.permute=function(t,e,r,n,a,i){for(var o=0;o<i;o++)n[o]=e[t[o]],a[o]=r[t[o]]},g.prototype.transform=function(t,e,r,n,a,i){this.permute(i,t,e,r,n,a);for(var o=1;o<a;o<<=1)for(var s=o<<1,l=Math.cos(2*Math.PI/s),u=Math.sin(2*Math.PI/s),c=0;c<a;c+=s)for(var f=l,d=u,h=0;h<o;h++){var p=r[c+h],g=n[c+h],v=r[c+h+o],m=n[c+h+o],y=f*v-d*m;m=f*m+d*v,v=y,r[c+h]=p+v,n[c+h]=g+m,r[c+h+o]=p-v,n[c+h+o]=g-m,h!==s&&(y=l*f-u*d,d=l*d+u*f,f=y)}},g.prototype.guessLen13b=function(t,e){var r=1|Math.max(e,t),n=1&r,a=0;for(r=r/2|0;r;r>>>=1)a++;return 1<<a+1+n},g.prototype.conjugate=function(t,e,r){if(!(r<=1))for(var n=0;n<r/2;n++){var a=t[n];t[n]=t[r-n-1],t[r-n-1]=a,a=e[n],e[n]=-e[r-n-1],e[r-n-1]=-a}},g.prototype.normalize13b=function(t,e){for(var r=0,n=0;n<e/2;n++){var a=8192*Math.round(t[2*n+1]/e)+Math.round(t[2*n]/e)+r;t[n]=67108863&a,r=a<67108864?0:a/67108864|0}return t},g.prototype.convert13b=function(t,e,r,a){for(var i=0,o=0;o<e;o++)i+=0|t[o],r[2*o]=8191&i,i>>>=13,r[2*o+1]=8191&i,i>>>=13;for(o=2*e;o<a;++o)r[o]=0;n(0===i),n(0==(-8192&i))},g.prototype.stub=function(t){for(var e=new Array(t),r=0;r<t;r++)e[r]=0;return e},g.prototype.mulp=function(t,e,r){var n=2*this.guessLen13b(t.length,e.length),a=this.makeRBT(n),i=this.stub(n),o=new Array(n),s=new Array(n),l=new Array(n),u=new Array(n),c=new Array(n),f=new Array(n),d=r.words;d.length=n,this.convert13b(t.words,t.length,o,n),this.convert13b(e.words,e.length,u,n),this.transform(o,i,s,l,n,a),this.transform(u,i,c,f,n,a);for(var h=0;h<n;h++){var p=s[h]*c[h]-l[h]*f[h];l[h]=s[h]*f[h]+l[h]*c[h],s[h]=p}return this.conjugate(s,l,n),this.transform(s,l,d,i,n,a),this.conjugate(d,i,n),this.normalize13b(d,n),r.negative=t.negative^e.negative,r.length=t.length+e.length,r.strip()},i.prototype.mul=function(t){var e=new i(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},i.prototype.mulf=function(t){var e=new i(null);return e.words=new Array(this.length+t.length),p(this,t,e)},i.prototype.imul=function(t){return this.clone().mulTo(t,this)},i.prototype.imuln=function(t){n("number"==typeof t),n(t<67108864);for(var e=0,r=0;r<this.length;r++){var a=(0|this.words[r])*t,i=(67108863&a)+(67108863&e);e>>=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<e.length;r++){var n=r/26|0,a=r%26;e[r]=(t.words[n]&1<<a)>>>a}return e}(t);if(0===e.length)return new i(1);for(var r=this,n=0;n<e.length&&0===e[n];n++,r=r.sqr());if(++n<e.length)for(var a=r.sqr();n<e.length;n++,a=a.sqr())0!==e[n]&&(r=r.mul(a));return r},i.prototype.iushln=function(t){n("number"==typeof t&&t>=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<this.length;e++){var s=this.words[e]&i,l=(0|this.words[e])-s<<r;this.words[e]=l|o,o=s>>>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<a;e++)this.words[e]=0;this.length+=a}return this.strip()},i.prototype.ishln=function(t){return n(0===this.negative),this.iushln(t)},i.prototype.iushrn=function(t,e,r){var a;n("number"==typeof t&&t>=0),a=e?(e-e%26)/26:0;var i=t%26,o=Math.min((t-i)/26,this.length),s=67108863^67108863>>>i<<i,l=r;if(a-=o,a=Math.max(0,a),l){for(var u=0;u<o;u++)l.words[u]=this.words[u];l.length=o}if(0===o);else if(this.length>o)for(this.length-=o,u=0;u<this.length;u++)this.words[u]=this.words[u+o];else this.words[0]=0,this.length=1;var c=0;for(u=this.length-1;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<<e;return!(this.length<=r)&&!!(this.words[r]&a)},i.prototype.imaskn=function(t){n("number"==typeof t&&t>=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<<e;this.words[this.length-1]&=a}return this.strip()},i.prototype.maskn=function(t){return this.clone().imaskn(t)},i.prototype.iaddn=function(t){return n("number"==typeof t),n(t<67108864),t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},i.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[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<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this.strip()},i.prototype.addn=function(t){return this.clone().iaddn(t)},i.prototype.subn=function(t){return this.clone().isubn(t)},i.prototype.iabs=function(){return this.negative=0,this},i.prototype.abs=function(){return this.clone().iabs()},i.prototype._ishlnsubmul=function(t,e,r){var a,i,o=t.length+r;this._expand(o);var s=0;for(a=0;a<t.length;a++){i=(0|this.words[a+r])+s;var l=(0|t.words[a])*e;s=((i-=67108863&l)>>26)-(l/67108864|0),this.words[a+r]=67108863&i}for(;a<this.length-r;a++)s=(i=(0|this.words[a+r])+s)>>26,this.words[a+r]=67108863&i;if(0===s)return this.strip();for(n(-1===s),s=0,a=0;a<this.length;a++)s=(i=-(0|this.words[a])+s)>>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<s.length;u++)s.words[u]=0}var c=n.clone()._ishlnsubmul(a,1,l);0===c.negative&&(n=c,s&&(s.words[l]=1));for(var f=l-1;f>=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<<e;if(this.length<=r)return this._expand(r+1),this.words[r]|=a,this;for(var i=a,o=r;0!==i&&o<this.length;o++){var s=0|this.words[o];i=(s+=i)>>>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:a<t?-1:1}return 0!==this.negative?0|-e:e},i.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},i.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],a=0|t.words[r];if(n!==a){n<a?e=-1:n>a&&(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=e<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?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<r;n++)e.words[n]=t.words[n];if(e.length=r,t.length<=9)return t.words[0]=0,void(t.length=1);var a=t.words[9];for(e.words[e.length++]=4194303&a,n=10;n<t.length;n++){var i=0|t.words[n];t.words[n-10]=(4194303&i)<<4|a>>>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<t.length;r++){var n=0|t.words[r];e+=977*n,t.words[r]=67108863&e,e=64*n+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},a(b,m),a(x,m),a(_,m),_.prototype.imulK=function(t){for(var e=0,r=0;r<t.length;r++){var n=19*(0|t.words[r])+e,a=67108863&n;n>>>=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<p);var m=this.pow(f,new i(1).iushln(p-v-1));d=d.redMul(m),f=m.redSqr(),h=h.redMul(f),p=v}return d},w.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},w.prototype.pow=function(t,e){if(e.isZero())return new i(1).toRed(this);if(0===e.cmpn(1))return t.clone();var r=new Array(16);r[0]=new i(1).toRed(this),r[1]=t;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],t);var a=r[0],o=0,s=0,l=e.bitLength()%26;for(0===l&&(l=26),n=e.length-1;n>=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<t;++r)if(!(e[r]<=e[r+t]))return!0;return!1}function l(t,e,r,n){for(var a=0,i=0,o=0,l=t.length;o<l;++o){var u=t[o];if(!s(e,u)){for(var c=0;c<2*e;++c)r[a++]=u[c];n[i++]=o}}return i}function u(t,e,r,n){var s=t.length,u=e.length;if(!(s<=0||u<=0)){var c=t[0].length>>>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;i<re;++i,rp+=es){var x0=rb[ax+rp],x1=rb[ax+rp+d],xi=ri[i];",s="for(var j=bs,bp=es*bs;j<be;++j,bp+=es){var y0=bb[ax+bp],"+(r?"y1=bb[ax+bp+d],":"")+"yi=bi[j];";return t?i.push(o,"Q",":",s):i.push(s,"Q",":",o),r?i.push("if(y1<x0||x1<y0)continue;"):e?i.push("if(y0<=x0||x1<y0)continue;"):i.push("if(y0<x0||x1<y0)continue;"),i.push("for(var k=ax+1;k<d;++k){var r0=rb[k+rp],r1=rb[k+d+rp],b0=bb[k+bp],b1=bb[k+d+bp];if(r1<b0||b1<r0)continue Q;}var rv=vv("),e?i.push("yi,xi"):i.push("xi,yi"),i.push(");if(rv!==void 0)return rv;}}}"),{name:a,code:i.join("")}}(e,a,t);r.push(o.code),i.push("return "+o.name+"("+n.join()+");")}i.push("if(re-rs>be-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.length<i&&(n.free(m),m=n.mallocInt32(i));var o=a.nextPow2(2*r);y.length<o&&(n.free(y),y=n.mallocDouble(o))}(t,i+A);var M,E=0,S=2*t;b(E++,0,0,i,0,A,r?16:0,-1/0,1/0),r||b(E++,0,0,A,0,i,1,-1/0,1/0);for(;E>0;){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<W)if(t*(W-O)<128){if(void 0!==(M=s(t,L+1,e,O,W,U,V,R,I,H,G)))return M}else if(L===t-2){if(void 0!==(M=B?l.sweepBipartite(t,e,R,I,H,G,O,W,U,V):l.sweepBipartite(t,e,O,W,U,V,R,I,H,G)))return M}else b(E++,L+1,O,W,R,I,B,-1/0,1/0),b(E++,L+1,R,I,O,W,1^B,-1/0,1/0);if(W<D){var Y=u(t,L,R,I,H,G),Z=H[S*Y+L],J=d(t,L,Y,I,H,G,Z);if(J<I&&b(E++,L,W,D,J,I,(4|B)+(j?16:0),Z,N),R<Y&&b(E++,L,W,D,R,Y,(2|B)+(j?16:0),z,Z),Y+1===J){if(void 0!==(M=j?_(t,L,e,W,D,U,V,Y,H,G[Y]):x(t,L,e,B,W,D,U,V,Y,H,G[Y])))return M}else if(Y<J){var Q;if(j){if(Q=g(t,L,W,D,U,V,Z),W<Q){var $=d(t,L,W,Q,U,V,Z);if(L===t-2){if(W<$&&void 0!==(M=l.sweepComplete(t,e,W,$,U,V,Y,J,H,G)))return M;if($<Q&&void 0!==(M=l.sweepBipartite(t,e,$,Q,U,V,Y,J,H,G)))return M}else W<$&&b(E++,L+1,W,$,Y,J,16,-1/0,1/0),$<Q&&(b(E++,L+1,$,Q,Y,J,0,-1/0,1/0),b(E++,L+1,Y,J,$,Q,1,-1/0,1/0))}}else Q=B?v(t,L,W,D,U,V,Z):g(t,L,W,D,U,V,Z),W<Q&&(L===t-2?M=B?l.sweepBipartite(t,e,Y,J,H,G,W,Q,U,V):l.sweepBipartite(t,e,W,Q,U,V,Y,J,H,G):(b(E++,L+1,W,Q,Y,J,B,-1/0,1/0),b(E++,L+1,Y,J,W,Q,1^B,-1/0,1/0)))}}}}};var n=t("typedarray-pool"),a=t("bit-twiddle"),i=t("./brute"),o=i.partial,s=i.full,l=t("./sweep"),u=t("./median"),c=t("./partition"),f=c("!(lo>=p0)&&!(p1>=hi)",["p0","p1"]),d=c("lo===p0",["p0"]),h=c("lo<p0",["p0"]),p=c("hi<=p0",["p0"]),g=c("lo<=p0&&p0<=hi",["p0"]),v=c("lo<p0&&p0<=hi",["p0"]),m=n.mallocInt32(1024),y=n.mallocDouble(1024);function b(t,e,r,n,a,i,o,s,l){var u=6*t;m[u]=e,m[u+1]=r,m[u+2]=n,m[u+3]=a,m[u+4]=i,m[u+5]=o;var c=2*t;y[c]=s,y[c+1]=l}function x(t,e,r,n,a,i,o,s,l,u,c){var f=2*t,d=l*f,h=u[d+e];t:for(var p=a,g=a*f;p<i;++p,g+=f){var v=o[g+e],m=o[g+e+t];if(!(h<v||m<h)&&(!n||h!==v)){for(var y,b=s[p],x=e+1;x<t;++x){v=o[g+x],m=o[g+x+t];var _=u[d+x],w=u[d+x+t];if(m<_||w<v)continue t}if(void 0!==(y=n?r(c,b):r(b,c)))return y}}}function _(t,e,r,n,a,i,o,s,l,u){var c=2*t,f=s*c,d=l[f+e];t:for(var h=n,p=n*c;h<a;++h,p+=c){var g=o[h];if(g!==u){var v=i[p+e],m=i[p+e+t];if(!(d<v||m<d)){for(var y=e+1;y<t;++y){v=i[p+y],m=i[p+y+t];var b=l[f+y],x=l[f+y+t];if(m<b||x<v)continue t}var _=r(g,u);if(void 0!==_)return _}}}}},{"./brute":44,"./median":46,"./partition":47,"./sweep":49,"bit-twiddle":40,"typedarray-pool":339}],46:[function(t,e,r){"use strict";e.exports=function(t,e,r,i,o,s){if(i<=r+1)return r;var l=r,u=i,c=i+r>>>1,f=2*t,d=c,h=o[f*c+e];for(;l<u;){if(u-l<8){a(t,e,l,u,o,s),h=o[f*c+e];break}var p=u-l,g=Math.random()*p+l|0,v=o[f*g+e],m=Math.random()*p+l|0,y=o[f*m+e],b=Math.random()*p+l|0,x=o[f*b+e];v<=y?x>=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;A<f;++A,++_,++w){var T=o[_];o[_]=o[w],o[w]=T}var k=s[u-1];s[u-1]=s[d],s[d]=k,d=n(t,e,l,u-1,o,s,h);for(_=f*(u-1),w=f*d,A=0;A<f;++A,++_,++w){T=o[_];o[_]=o[w],o[w]=T}k=s[u-1];if(s[u-1]=s[d],s[d]=k,c<d){for(u=d-1;l<u&&o[f*(u-1)+e]===h;)u-=1;u+=1}else{if(!(d<c))break;for(l=d+1;l<u&&o[f*l+e]===h;)l+=1}}return n(t,e,r,c,o,s,o[f*c+e])};var n=t("./partition")("lo<p0",["p0"]);function a(t,e,r,n,a,i){for(var o=2*t,s=o*(r+1)+e,l=r+1;l<n;++l,s+=o)for(var u=a[s],c=l,f=o*(l-1);c>r&&a[f+e]>u;--c,f-=o){for(var d=f,h=f+o,p=0;p<o;++p,++d,++h){var g=a[d];a[d]=a[h],a[h]=g}var v=i[c];i[c]=i[c-1],i[c-1]=v}}},{"./partition":47}],47:[function(t,e,r){"use strict";e.exports=function(t,e){var r="abcdef".split("").concat(e),n=[];t.indexOf("lo")>=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(--A<B)break}s(e,w-1,k,M,c),s(r,A+1,E,S,c),w-2-e<=32?n(e,w-2,c):t(e,w-2,c);r-(A+2)<=32?n(A+2,r,c):t(A+2,r,c);A-w<=32?n(w,A,c):t(w,A,c)}(0,e-1,t)};function n(t,e,r){for(var n=2*(t+1),a=t+1;a<=e;++a){for(var i=r[n++],o=r[n++],s=a,l=n-2;s-- >t;){var u=r[l-2],c=r[l-1];if(u<i)break;if(u===i&&c<o)break;r[l]=u,r[l+1]=c,l-=2}r[l]=i,r[l+1]=o}}function a(t,e,r){e*=2;var n=r[t*=2],a=r[t+1];r[t]=r[e],r[t+1]=r[e+1],r[e]=n,r[e+1]=a}function i(t,e,r){e*=2,r[t*=2]=r[e],r[t+1]=r[e+1]}function o(t,e,r,n){e*=2,r*=2;var a=n[t*=2],i=n[t+1];n[t]=n[e],n[t+1]=n[e+1],n[e]=n[r],n[e+1]=n[r+1],n[r]=a,n[r+1]=i}function s(t,e,r,n,a){e*=2,a[t*=2]=a[e],a[e]=r,a[t+1]=a[e+1],a[e+1]=n}function l(t,e,r){e*=2;var n=r[t*=2],a=r[e];return!(n<a)&&(n!==a||r[t+1]>r[e+1])}function u(t,e,r,n){var a=n[t*=2];return a<e||a===e&&n[t+1]<r}},{}],49:[function(t,e,r){"use strict";e.exports={init:function(t){var e=a.nextPow2(t);o.length<e&&(n.free(o),o=n.mallocInt32(e));s.length<e&&(n.free(s),s=n.mallocInt32(e));l.length<e&&(n.free(l),l=n.mallocInt32(e));u.length<e&&(n.free(u),u=n.mallocInt32(e));c.length<e&&(n.free(c),c=n.mallocInt32(e));f.length<e&&(n.free(f),f=n.mallocInt32(e));var r=8*e;d.length<r&&(n.free(d),d=n.mallocDouble(r))},sweepBipartite:function(t,e,r,n,a,c,f,g,v,m){for(var y=0,b=2*t,x=t-1,_=b-1,w=r;w<n;++w){var A=c[w],T=b*w;d[y++]=a[T+x],d[y++]=-(A+1),d[y++]=a[T+_],d[y++]=A}for(w=f;w<g;++w){A=m[w]+(1<<28);var k=b*w;d[y++]=v[k+x],d[y++]=-A,d[y++]=v[k+_],d[y++]=A}var M=y>>>1;i(d,M);var E=0,S=0;for(w=0;w<M;++w){var C=0|d[2*w+1];if(C>=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<E;++L){if(void 0!==(O=e(o[L],C)))return O}p(l,u,S++,C)}else{C=-C-1|0;for(L=0;L<S;++L){var O;if(void 0!==(O=e(C,l[L])))return O}p(o,s,E++,C)}}},sweepComplete:function(t,e,r,n,a,g,v,m,y,b){for(var x=0,_=2*t,w=t-1,A=_-1,T=r;T<n;++T){var k=g[T]+1<<1,M=_*T;d[x++]=a[M+w],d[x++]=-k,d[x++]=a[M+A],d[x++]=k}for(T=v;T<m;++T){k=b[T]+1<<1;var E=_*T;d[x++]=y[E+w],d[x++]=1|-k,d[x++]=y[E+A],d[x++]=1|k}var S=x>>>1;i(d,S);var C=0,L=0,O=0;for(T=0;T<S;++T){var D=0|d[2*T+1],R=1&D;if(T<S-1&&D>>1==d[2*T+3]>>1&&(R=2,T+=1),D<0){for(var I=-(D>>1)-1,P=0;P<O;++P){if(void 0!==(F=e(c[P],I)))return F}if(0!==R)for(P=0;P<C;++P){if(void 0!==(F=e(o[P],I)))return F}if(1!==R)for(P=0;P<L;++P){var F;if(void 0!==(F=e(l[P],I)))return F}0===R?p(o,s,C++,I):1===R?p(l,u,L++,I):2===R&&p(c,f,O++,I)}else{I=(D>>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<l;++T){var k=T+w,M=b*T;d[y++]=u[M+x],d[y++]=-k,d[y++]=u[M+_],d[y++]=k}for(T=f;T<g;++T){k=T+A;var E=b*T;d[y++]=v[E+x],d[y++]=-k}var S=y>>>1;i(d,S);var C=0;for(T=0;T<S;++T){var L=0|d[2*T+1];if(L<0){var O=!1;if((k=-L)>=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<C;++F){var z=o[F],N=b*z;if(!(P<u[N+e+1]||u[N+e+1+t]<I)){for(var B=e+2;B<t;++B)if(v[R+B+t]<u[N+B]||u[N+B+t]<v[R+B])continue t;var j,U=c[z];if(void 0!==(j=n?r(D,U):r(U,D)))return j}}}}else h(o,s,C--,L-w)}},scanComplete:function(t,e,r,n,a,s,l,u,c,f,h){for(var p=0,g=2*t,v=e,m=e+t,y=n;y<a;++y){var b=y+(1<<28),x=g*y;d[p++]=s[x+v],d[p++]=-b,d[p++]=s[x+m],d[p++]=b}for(y=u;y<c;++y){b=y+1;var _=g*y;d[p++]=f[_+v],d[p++]=-b}var w=p>>>1;i(d,w);var A=0;for(y=0;y<w;++y){var T=0|d[2*y+1];if(T<0){if((b=-T)>=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<A;++C){var L=o[C],O=l[L];if(O===k)break;var D=g*L;if(!(S<s[D+e+1]||s[D+e+1+t]<E)){for(var R=e+2;R<t;++R)if(f[M+R+t]<s[D+R]||s[D+R+t]<f[M+R])continue t;var I=r(O,k);if(void 0!==I)return I}}}}else{for(b=T-(1<<28),C=A-1;C>=0;--C)if(o[C]===b){for(R=C+1;R<A;++R)o[R-1]=o[R];break}--A}}}};var n=t("typedarray-pool"),a=t("bit-twiddle"),i=t("./sort"),o=n.mallocInt32(1024),s=n.mallocInt32(1024),l=n.mallocInt32(1024),u=n.mallocInt32(1024),c=n.mallocInt32(1024),f=n.mallocInt32(1024),d=n.mallocDouble(8192);function h(t,e,r,n){var a=e[n],i=t[r-1];t[a]=i,e[i]=a}function p(t,e,r,n){t[r]=n,e[n]=r}},{"./sort":48,"bit-twiddle":40,"typedarray-pool":339}],50:[function(t,e,r){},{}],51:[function(t,e,r){"use strict";var n,a="object"==typeof Reflect?Reflect:null,i=a&&"function"==typeof a.apply?a.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};n=a&&"function"==typeof a.ownKeys?a.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var o=Number.isNaN||function(t){return t!=t};function s(){s.init.call(this)}e.exports=s,e.exports.once=function(t,e){return new Promise((function(r,n){function a(){void 0!==i&&t.removeListener("error",i),r([].slice.call(arguments))}var i;"error"!==e&&(i=function(r){t.removeListener(e,a),n(r)},t.once("error",i)),t.once(e,a)}))},s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var l=10;function u(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function c(t){return void 0===t._maxListeners?s.defaultMaxListeners:t._maxListeners}function f(t,e,r,n){var a,i,o,s;if(u(r),void 0===(i=t._events)?(i=t._events=Object.create(null),t._eventsCount=0):(void 0!==i.newListener&&(t.emit("newListener",e,r.listener?r.listener:r),i=t._events),o=i[e]),void 0===o)o=i[e]=r,++t._eventsCount;else if("function"==typeof o?o=i[e]=n?[r,o]:[o,r]:n?o.unshift(r):o.push(r),(a=c(t))>0&&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;r<e.length;++r)e[r]=t[r].listener||t[r];return e}(a):v(a,a.length)}function g(t){var e=this._events;if(void 0!==e){var r=e[t];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function v(t,e){for(var r=new Array(e),n=0;n<e;++n)r[n]=t[n];return r}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return l},set:function(t){if("number"!=typeof t||t<0||o(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");l=t}}),s.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||o(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},s.prototype.getMaxListeners=function(){return c(this)},s.prototype.emit=function(t){for(var e=[],r=1;r<arguments.length;r++)e.push(arguments[r]);var n="error"===t,a=this._events;if(void 0!==a)n=n&&void 0===a.error;else if(!n)return!1;if(n){var o;if(e.length>0&&(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<u;++r)i(c[r],this,e)}return!0},s.prototype.addListener=function(t,e){return f(this,t,e,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(t,e){return f(this,t,e,!0)},s.prototype.once=function(t,e){return u(e),this.on(t,h(this,t,e)),this},s.prototype.prependOnceListener=function(t,e){return u(e),this.prependListener(t,h(this,t,e)),this},s.prototype.removeListener=function(t,e){var r,n,a,i,o;if(u(e),void 0===(n=this._events))return this;if(void 0===(r=n[t]))return this;if(r===e||r.listener===e)0==--this._eventsCount?this._events=Object.create(null):(delete n[t],n.removeListener&&this.emit("removeListener",t,r.listener||e));else if("function"!=typeof r){for(a=-1,i=r.length-1;i>=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<t.length;e++)t[e]=t[e+1];t.pop()}(r,a),1===r.length&&(n[t]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",t,o||e)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(t){var e,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[t]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[t]),this;if(0===arguments.length){var a,i=Object.keys(r);for(n=0;n<i.length;++n)"removeListener"!==(a=i[n])&&this.removeAllListeners(a);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(e=r[t]))this.removeListener(t,e);else if(void 0!==e)for(n=e.length-1;n>=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 <https://feross.org>
* @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<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');var n;n=void 0===e&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,e):new Uint8Array(t,e,r);return n.__proto__=i.prototype,n}(t,e,r);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');var n=t.valueOf&&t.valueOf();if(null!=n&&n!==t)return i.from(n,e,r);var o=function(t){if(i.isBuffer(t)){var e=0|c(t.length),r=a(e);return 0===r.length||t.copy(r,0,0,e),r}if(void 0!==t.length)return"number"!=typeof t.length||B(t.length)?a(0):u(t);if("Buffer"===t.type&&Array.isArray(t.data))return u(t.data)}(t);if(o)return o;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return i.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function s(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function l(t){return s(t),a(t<0?0:0|c(t))}function u(t){for(var e=t.length<0?0:0|c(t.length),r=a(e),n=0;n<e;n+=1)r[n]=255&t[n];return r}function c(t){if(t>=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;i<s;i++)if(u(t,i)===u(e,-1===c?0:i-c)){if(-1===c&&(c=i),i-c+1===l)return c*o}else-1!==c&&(i-=i-c),c=-1}else for(r+l>s&&(r=s-l),i=r;i>=0;i--){for(var f=!0,d=0;d<l;d++)if(u(t,i+d)!==u(e,d)){f=!1;break}if(f)return i}return-1}function v(t,e,r,n){r=Number(r)||0;var a=t.length-r;n?(n=Number(n))>a&&(n=a):n=a;var i=e.length;n>i/2&&(n=i/2);for(var o=0;o<n;++o){var s=parseInt(e.substr(2*o,2),16);if(B(s))return o;t[r+o]=s}return o}function m(t,e,r,n){return z(P(e,t.length-r),t,r,n)}function y(t,e,r,n){return z(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function b(t,e,r,n){return y(t,e,r,n)}function x(t,e,r,n){return z(F(e),t,r,n)}function _(t,e,r,n){return z(function(t,e){for(var r,n,a,i=[],o=0;o<t.length&&!((e-=2)<0);++o)r=t.charCodeAt(o),n=r>>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;a<r;){var i,o,s,l,u=t[a],c=null,f=u>239?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(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=4096));return r}(n)}r.kMaxLength=2147483647,i.TYPED_ARRAY_SUPPORT=function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()}catch(t){return!1}}(),i.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(i.prototype,"parent",{enumerable:!0,get:function(){if(i.isBuffer(this))return this.buffer}}),Object.defineProperty(i.prototype,"offset",{enumerable:!0,get:function(){if(i.isBuffer(this))return this.byteOffset}}),"undefined"!=typeof Symbol&&null!=Symbol.species&&i[Symbol.species]===i&&Object.defineProperty(i,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),i.poolSize=8192,i.from=function(t,e,r){return o(t,e,r)},i.prototype.__proto__=Uint8Array.prototype,i.__proto__=Uint8Array,i.alloc=function(t,e,r){return function(t,e,r){return s(t),t<=0?a(t):void 0!==e?"string"==typeof r?a(t).fill(e,r):a(t).fill(e):a(t)}(t,e,r)},i.allocUnsafe=function(t){return l(t)},i.allocUnsafeSlow=function(t){return l(t)},i.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==i.prototype},i.compare=function(t,e){if(N(t,Uint8Array)&&(t=i.from(t,t.offset,t.byteLength)),N(e,Uint8Array)&&(e=i.from(e,e.offset,e.byteLength)),!i.isBuffer(t)||!i.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;for(var r=t.length,n=e.length,a=0,o=Math.min(r,n);a<o;++a)if(t[a]!==e[a]){r=t[a],n=e[a];break}return r<n?-1:n<r?1:0},i.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},i.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return i.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=i.allocUnsafe(e),a=0;for(r=0;r<t.length;++r){var o=t[r];if(N(o,Uint8Array)&&(o=i.from(o)),!i.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(n,a),a+=o.length}return n},i.byteLength=f,i.prototype._isBuffer=!0,i.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)h(this,e,e+1);return this},i.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)h(this,e,e+3),h(this,e+1,e+2);return this},i.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)h(this,e,e+7),h(this,e+1,e+6),h(this,e+2,e+5),h(this,e+3,e+4);return this},i.prototype.toString=function(){var t=this.length;return 0===t?"":0===arguments.length?A(this,0,t):d.apply(this,arguments)},i.prototype.toLocaleString=i.prototype.toString,i.prototype.equals=function(t){if(!i.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===i.compare(this,t)},i.prototype.inspect=function(){var t="",e=r.INSPECT_MAX_BYTES;return t=this.toString("hex",0,e).replace(/(.{2})/g,"$1 ").trim(),this.length>e&&(t+=" ... "),"<Buffer "+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<l;++f)if(u[f]!==c[f]){o=u[f],s=c[f];break}return o<s?-1:s<o?1:0},i.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},i.prototype.indexOf=function(t,e,r){return p(this,t,e,r,!0)},i.prototype.lastIndexOf=function(t,e,r){return p(this,t,e,r,!1)},i.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e>>>=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;a<r;++a)n+=String.fromCharCode(127&t[a]);return n}function k(t,e,r){var n="";r=Math.min(t.length,r);for(var a=e;a<r;++a)n+=String.fromCharCode(t[a]);return n}function M(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var a="",i=e;i<r;++i)a+=I(t[i]);return a}function E(t,e,r){for(var n=t.slice(e,r),a="",i=0;i<n.length;i+=2)a+=String.fromCharCode(n[i]+256*n[i+1]);return a}function S(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)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||e<o)throw new RangeError('"value" argument is out of bounds');if(r+n>t.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<t&&(e=t);var n=this.subarray(t,e);return n.__proto__=i.prototype,n},i.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||S(t,e,this.length);for(var n=this[t],a=1,i=0;++i<e&&(a*=256);)n+=this[t+i]*a;return n},i.prototype.readUIntBE=function(t,e,r){t>>>=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<e&&(a*=256);)n+=this[t+i]*a;return n>=(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<r&&(a*=256);)this[e+i]=t/a&255;return e+r},i.prototype.writeUIntBE=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=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<r&&(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.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<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=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<n-r&&(n=t.length-e+r);var a=n-r;if(this===t&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(e,r,n);else if(this===t&&r<e&&e<n)for(var o=a-1;o>=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<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;var o;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(o=e;o<r;++o)this[o]=t;else{var s=i.isBuffer(t)?t:i.from(t,n),l=s.length;if(0===l)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(o=0;o<r-e;++o)this[o+e]=s[o%l]}return this};var R=/[^+/0-9A-Za-z-_]/g;function I(t){return t<16?"0"+t.toString(16):t.toString(16)}function P(t,e){var r;e=e||1/0;for(var n=t.length,a=null,i=[],o=0;o<n;++o){if((r=t.charCodeAt(o))>55295&&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<n&&!(a+r>=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;v<p.length;++v){var m=p[v];g.addTriangle(m[0],m[1],m[2])}return c&&i(t,g),d?f?h?o(g,0,h):g.cells():o(g,1,h):o(g,-1)}return p}},{"./lib/delaunay":54,"./lib/filter":55,"./lib/monotone":56,"./lib/triangulation":57}],54:[function(t,e,r){"use strict";var n=t("robust-in-sphere")[4];t("binary-search-bounds");function a(t,e,r,a,i,o){var s=e.opposite(a,i);if(!(s<0)){if(i<a){var l=a;a=i,i=l,l=o,o=s,s=l}e.isConstraint(a,i)||n(t[a],t[i],t[o],t[s])<0&&r.push(a,i)}}e.exports=function(t,e){for(var r=[],i=t.length,o=e.stars,s=0;s<i;++s)for(var l=o[s],u=1;u<l.length;u+=2){if(!((h=l[u])<s)&&!e.isConstraint(s,h)){for(var c=l[u-1],f=-1,d=1;d<l.length;d+=2)if(l[d-1]===h){f=l[d];break}f<0||n(t[s],t[h],t[c],t[f])<0&&r.push(s,h)}}for(;r.length>0;){for(var h=r.pop(),p=(s=r.pop(),c=-1,f=-1,l=o[s],1);p<l.length;p+=2){var g=l[p-1],v=l[p];g===h?f=v:v===h&&(c=g)}c<0||f<0||(n(t[s],t[h],t[c],t[f])>=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;a<n;++a){var s=(m=r[a])[0],l=m[1],u=m[2];l<u?l<s&&(m[0]=l,m[1]=u,m[2]=s):u<s&&(m[0]=u,m[1]=s,m[2]=l)}r.sort(o);var c=new Array(n);for(a=0;a<c.length;++a)c[a]=0;var f=[],d=[],h=new Array(3*n),p=new Array(3*n),g=null;e&&(g=[]);var v=new i(r,h,p,c,f,d,g);for(a=0;a<n;++a)for(var m=r[a],y=0;y<3;++y){s=m[y],l=m[(y+1)%3];var b=h[3*a+y]=v.locate(l,s,t.opposite(l,s)),x=p[3*a+y]=t.isConstraint(s,l);b<0&&(x?d.push(a):(f.push(a),c[a]=1),e&&g.push([l,s,-1]))}return v}(t,r);if(0===e)return r?n.cells.concat(n.boundary):n.cells;var a=1,s=n.active,l=n.next,u=n.flags,c=n.cells,f=n.constraint,d=n.neighbor;for(;s.length>0||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;a<t.length;++a)e[a]===r&&(t[n++]=t[a]);return t.length=n,t}(c,u,e);if(r)return m.concat(n.boundary);return m},i.prototype.locate=(n=[0,0,0],function(t,e,r){var i=t,s=e,l=r;return e<r?e<t&&(i=e,s=r,l=t):r<t&&(i=r,s=t,l=e),i<0?-1:(n[0]=i,n[1]=s,n[2]=l,a.eq(this.cells,n,o))})},{"binary-search-bounds":39}],56:[function(t,e,r){"use strict";var n=t("binary-search-bounds"),a=t("robust-orientation")[3];function i(t,e,r,n,a){this.a=t,this.b=e,this.idx=r,this.lowerIds=n,this.upperIds=a}function o(t,e,r,n){this.a=t,this.b=e,this.type=r,this.idx=n}function s(t,e){var r=t.a[0]-e.a[0]||t.a[1]-e.a[1]||t.type-e.type;return r||(0!==t.type&&(r=a(t.a,t.b,e.b))?r:t.idx-e.idx)}function l(t,e){return a(t.a,t.b,e)}function u(t,e,r,i,o){for(var s=n.lt(e,i,l),u=n.gt(e,i,l),c=s;c<u;++c){for(var f=e[c],d=f.lowerIds,h=d.length;h>1&&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]<e.a[0]?a(t.a,t.b,e.a):a(e.b,e.a,t.a))?r:(r=e.b[0]<t.b[0]?a(t.a,t.b,e.b):a(e.b,e.a,t.b))||t.idx-e.idx}function f(t,e,r){var a=n.le(t,r,c),o=t[a],s=o.upperIds,l=s[s.length-1];o.upperIds=[l],t.splice(a+1,0,new i(r.a,r.b,r.idx,[l],s))}function d(t,e,r){var a=r.a;r.a=r.b,r.b=a;var i=n.eq(t,r,c),o=t[i];t[i-1].upperIds=o.upperIds,t.splice(i,1)}e.exports=function(t,e){for(var r=t.length,n=e.length,a=[],l=0;l<r;++l)a.push(new o(t[l],null,0,l));for(l=0;l<n;++l){var c=e[l],h=t[c[0]],p=t[c[1]];h[0]<p[0]?a.push(new o(h,p,2,l),new o(p,h,1,l)):h[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<y;++l){var b=a[l],x=b.type;0===x?u(m,v,t,b.a,b.idx):2===x?f(v,t,b):d(v,t,b)}return m}},{"binary-search-bounds":39,"robust-orientation":300}],57:[function(t,e,r){"use strict";var n=t("binary-search-bounds");function a(t,e){this.stars=t,this.edges=e}e.exports=function(t,e){for(var r=new Array(t),n=0;n<t;++n)r[n]=[];return new a(r,e)};var i=a.prototype;function o(t,e,r){for(var n=1,a=t.length;n<a;n+=2)if(t[n-1]===e&&t[n]===r)return t[n-1]=t[a-2],t[n]=t[a-1],void(t.length=a-2)}i.isConstraint=function(){var t=[0,0];function e(t,e){return t[0]-e[0]||t[1]-e[1]}return function(r,a){return t[0]=Math.min(r,a),t[1]=Math.max(r,a),n.eq(this.edges,t,e)>=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;n<a;n+=2)if(r[n]===t)return r[n-1];return-1},i.flip=function(t,e){var r=this.opposite(t,e),n=this.opposite(e,t);this.removeTriangle(t,e,r),this.removeTriangle(e,t,n),this.addTriangle(t,n,r),this.addTriangle(e,r,n)},i.edges=function(){for(var t=this.stars,e=[],r=0,n=t.length;r<n;++r)for(var a=t[r],i=0,o=a.length;i<o;i+=2)e.push([a[i],a[i+1]]);return e},i.cells=function(){for(var t=this.stars,e=[],r=0,n=t.length;r<n;++r)for(var a=t[r],i=0,o=a.length;i<o;i+=2){var s=a[i],l=a[i+1];r<Math.min(s,l)&&e.push([r,s,l])}return e}},{"binary-search-bounds":39}],58:[function(t,e,r){e.exports=function(t,e,r){return e<r?t<e?e:t>r?r:t:t<r?r:t>e?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;i<e.length;++i){var o=e[i];a[i]=[o[0],o[1],r[i]]}e=a}var s=function(t,e,r){var n=p(t,[],h(t));return m(e,n,r),!!n}(t,e,!!r);for(;y(t,e,!!r);)s=!0;if(r&&s){n.length=0,r.length=0;for(i=0;i<e.length;++i){o=e[i];n.push([o[0],o[1]]),r.push(o[2])}}return s};var n=t("union-find"),a=t("box-intersect"),i=t("robust-segment-intersect"),o=t("big-rat"),s=t("big-rat/cmp"),l=t("big-rat/to-float"),u=t("rat-vec"),c=t("nextafter"),f=t("./lib/rat-seg-intersect");function d(t){var e=l(t);return[c(e,-1/0),c(e,1/0)]}function h(t){for(var e=new Array(t.length),r=0;r<t.length;++r){var n=t[r];e[r]=[c(n[0],-1/0),c(n[1],-1/0),c(n[0],1/0),c(n[1],1/0)]}return e}function p(t,e,r){for(var i=e.length,o=new n(i),s=[],l=0;l<e.length;++l){var u=e[l],f=d(u[0]),h=d(u[1]);s.push([c(f[0],-1/0),c(h[0],-1/0),c(f[1],1/0),c(h[1],1/0)])}a(s,(function(t,e){o.link(t,e)}));var p=!0,g=new Array(i);for(l=0;l<i;++l){(m=o.find(l))!==l&&(p=!1,t[m]=[Math.min(t[l][0],t[m][0]),Math.min(t[l][1],t[m][1])])}if(p)return null;var v=0;for(l=0;l<i;++l){var m;(m=o.find(l))===l?(g[l]=v,t[v++]=t[l]):g[l]=-1}t.length=v;for(l=0;l<i;++l)g[l]<0&&(g[l]=g[o.find(l)]);return g}function g(t,e){return t[0]-e[0]||t[1]-e[1]}function v(t,e){var r=t[0]-e[0]||t[1]-e[1];return r||(t[2]<e[2]?-1:t[2]>e[2]?1:0)}function m(t,e,r){if(0!==t.length){if(e)for(var n=0;n<t.length;++n){var a=e[(o=t[n])[0]],i=e[o[1]];o[0]=Math.min(a,i),o[1]=Math.max(a,i)}else for(n=0;n<t.length;++n){var o;a=(o=t[n])[0],i=o[1];o[0]=Math.min(a,i),o[1]=Math.max(a,i)}r?t.sort(v):t.sort(g);var s=1;for(n=1;n<t.length;++n){var l=t[n-1],u=t[n];(u[0]!==l[0]||u[1]!==l[1]||r&&u[2]!==l[2])&&(t[s++]=u)}t.length=s}}function y(t,e,r){var n=function(t,e){for(var r=new Array(e.length),n=0;n<e.length;++n){var a=e[n],i=t[a[0]],o=t[a[1]];r[n]=[c(Math.min(i[0],o[0]),-1/0),c(Math.min(i[1],o[1]),-1/0),c(Math.max(i[0],o[0]),1/0),c(Math.max(i[1],o[1]),1/0)]}return r}(t,e),d=function(t,e,r){var n=[];return a(r,(function(r,a){var o=e[r],s=e[a];if(o[0]!==s[0]&&o[0]!==s[1]&&o[1]!==s[0]&&o[1]!==s[1]){var l=t[o[0]],u=t[o[1]],c=t[s[0]],f=t[s[1]];i(l,u,c,f)&&n.push([r,a])}})),n}(t,e,n),g=h(t),v=function(t,e,r,n){var o=[];return a(r,n,(function(r,n){var a=e[r];if(a[0]!==n&&a[1]!==n){var s=t[n],l=t[a[0]],u=t[a[1]];i(l,u,s,s)&&o.push([r,n])}})),o}(t,e,n,g),y=p(t,function(t,e,r,n,a){var i,c,d=t.map((function(t){return[o(t[0]),o(t[1])]}));for(i=0;i<r.length;++i){var h=r[i];c=h[0];var p=h[1],g=e[c],v=e[p],m=f(u(t[g[0]]),u(t[g[1]]),u(t[v[0]]),u(t[v[1]]));if(m){var y=t.length;t.push([l(m[0]),l(m[1])]),d.push(m),n.push([c,y],[p,y])}}for(n.sort((function(t,e){if(t[0]!==e[0])return t[0]-e[0];var r=d[t[1]],n=d[e[1]];return s(r[0],n[0])||s(r[1],n[1])})),i=n.length-1;i>=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;r<t.length;r++)e[t[r]]=1;return e}e.exports=function(t){if((t=n(t,{style:"style fontstyle fontStyle font-style slope distinction",variant:"variant font-variant fontVariant fontvariant var capitalization",weight:"weight w font-weight fontWeight fontweight",stretch:"stretch font-stretch fontStretch fontstretch width",size:"size s font-size fontSize fontsize height em emSize",lineHeight:"lh line-height lineHeight lineheight leading",family:"font family fontFamily font-family fontfamily type typeface face",system:"system reserved default global"})).system)return t.system&&p(t.system,o),t.system;if(p(t.style,l),p(t.variant,c),p(t.weight,s),p(t.stretch,u),null==t.size&&(t.size=d),"number"==typeof t.size&&(t.size+="px"),!a)throw Error("Bad size value `"+t.size+"`");t.family||(t.family=h),Array.isArray(t.family)&&(t.family.length||(t.family=[h]),t.family=t.family.map((function(t){return f[t]?t:'"'+t+'"'})).join(", "));var e=[];return e.push(t.style),t.variant!==t.style&&e.push(t.variant),t.weight!==t.variant&&t.weight!==t.style&&e.push(t.weight),t.stretch!==t.weight&&t.stretch!==t.variant&&t.stretch!==t.style&&e.push(t.stretch),e.push(t.size+(null==t.lineHeight||"normal"===t.lineHeight||t.lineHeight+""=="1"?"":"/"+t.lineHeight)),e.push(t.family),e.filter(Boolean).join(" ")}},{"./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,"pick-by-alias":271}],77:[function(t,e,r){e.exports=["inherit","initial","unset"]},{}],78:[function(t,e,r){e.exports=["caption","icon","menu","message-box","small-caption","status-bar"]},{}],79:[function(t,e,r){"use strict";var n=t("./lib/thunk.js");function a(){this.argTypes=[],this.shimArgs=[],this.arrayArgs=[],this.arrayBlockIndices=[],this.scalarArgs=[],this.offsetArgs=[],this.offsetArgIndex=[],this.indexArgs=[],this.shapeArgs=[],this.funcName="",this.pre=null,this.body=null,this.post=null,this.debug=!1}e.exports=function(t){var e=new a;e.pre=t.pre,e.body=t.body,e.post=t.post;var r=t.args.slice(0);e.argTypes=r;for(var i=0;i<r.length;++i){var o=r[i];if("array"===o||"object"==typeof o&&o.blockIndices){if(e.argTypes[i]="array",e.arrayArgs.push(i),e.arrayBlockIndices.push(o.blockIndices?o.blockIndices:0),e.shimArgs.push("array"+i),i<e.pre.args.length&&e.pre.args[i].count>0)throw new Error("cwise: pre() block may not reference array args");if(i<e.post.args.length&&e.post.args[i].count>0)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),i<e.pre.args.length&&e.pre.args[i].count>0)throw new Error("cwise: pre() block may not reference array index");if(i<e.body.args.length&&e.body.args[i].lvalue)throw new Error("cwise: body() block may not write to array index");if(i<e.post.args.length&&e.post.args[i].count>0)throw new Error("cwise: post() block may not reference array index")}else if("shape"===o){if(e.shapeArgs.push(i),i<e.pre.args.length&&e.pre.args[i].lvalue)throw new Error("cwise: pre() block may not write to array shape");if(i<e.body.args.length&&e.body.args[i].lvalue)throw new Error("cwise: body() block may not write to array shape");if(i<e.post.args.length&&e.post.args[i].lvalue)throw new Error("cwise: post() block may not write to array shape")}else{if("object"!=typeof o||!o.offset)throw new Error("cwise: Unknown argument type "+r[i]);e.argTypes[i]="offset",e.offsetArgs.push({array:o.array,offset:o.offset}),e.offsetArgIndex.push(i)}}if(e.arrayArgs.length<=0)throw new Error("cwise: No array arguments specified");if(e.pre.args.length>r.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;n<i;++n)u.push(["i",n,"=0"].join(""));for(a=0;a<o;++a)for(n=0;n<i;++n)f=c,c=t[n],0===n?u.push(["d",a,"s",n,"=t",a,"p",c].join("")):u.push(["d",a,"s",n,"=(t",a,"p",c,"-s",f,"*t",a,"p",f,")"].join(""));for(u.length>0&&l.push("var "+u.join(",")),n=i-1;n>=0;--n)c=t[n],l.push(["for(i",n,"=0;i",n,"<s",c,";++i",n,"){"].join(""));for(l.push(r),n=0;n<i;++n){for(f=c,c=t[n],a=0;a<o;++a)l.push(["p",a,"+=d",a,"s",n].join(""));s&&(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;o<t.args.length;++o){var s=t.args[o];if(!(s.count<=0)){var l=new RegExp(s.name,"g"),u="",c=e.arrayArgs.indexOf(o);switch(e.argTypes[o]){case"offset":var f=e.offsetArgIndex.indexOf(o);c=e.offsetArgs[f].array,u="+q"+f;case"array":u="p"+c+u;var d="l"+o,h="a"+c;if(0===e.arrayBlockIndices[c])1===s.count?"generic"===r[c]?s.lvalue?(a.push(["var ",d,"=",h,".get(",u,")"].join("")),n=n.replace(l,d),i.push([h,".set(",u,",",d,")"].join(""))):n=n.replace(l,[h,".get(",u,")"].join("")):n=n.replace(l,[h,"[",u,"]"].join("")):"generic"===r[c]?(a.push(["var ",d,"=",h,".get(",u,")"].join("")),n=n.replace(l,d),s.lvalue&&i.push([h,".set(",u,",",d,")"].join(""))):(a.push(["var ",d,"=",h,"[",u,"]"].join("")),n=n.replace(l,d),s.lvalue&&i.push([h,"[",u,"]=",d].join("")));else{for(var p=[s.name],g=[u],v=0;v<Math.abs(e.arrayBlockIndices[c]);v++)p.push("\\s*\\[([^\\]]+)\\]"),g.push("$"+(v+1)+"*t"+c+"b"+v);if(l=new RegExp(p.join(""),"g"),u=g.join("+"),"generic"===r[c])throw new Error("cwise: Generic arrays not supported in combination with blocks!");n=n.replace(l,[h,"[",u,"]"].join(""))}break;case"scalar":n=n.replace(l,"Y"+e.scalarArgs.indexOf(o));break;case"index":n=n.replace(l,"index");break;case"shape":n=n.replace(l,"shape")}}}return[a.join("\n"),n,i.join("\n")].join("\n").trim()}function o(t){for(var e=new Array(t.length),r=!0,n=0;n<t.length;++n){var a=t[n],i=a.match(/\d+/);i=i?i[0]:"",0===a.charAt(0)?e[n]="u"+a.charAt(1)+i:e[n]=a.charAt(0)+i,n>0&&(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;u<t.arrayArgs.length;++u)l[u]=e[2*u],s[u]=e[2*u+1];var c=[],f=[],d=[],h=[],p=[];for(u=0;u<t.arrayArgs.length;++u){t.arrayBlockIndices[u]<0?(d.push(0),h.push(r),c.push(r),f.push(r+t.arrayBlockIndices[u])):(d.push(t.arrayBlockIndices[u]),h.push(t.arrayBlockIndices[u]+r),c.push(0),f.push(t.arrayBlockIndices[u]));for(var g=[],v=0;v<s[u].length;v++)d[u]<=s[u][v]&&s[u][v]<h[u]&&g.push(s[u][v]-d[u]);p.push(g)}var m=["SS"],y=["'use strict'"],b=[];for(v=0;v<r;++v)b.push(["s",v,"=SS[",v,"]"].join(""));for(u=0;u<t.arrayArgs.length;++u){m.push("a"+u),m.push("t"+u),m.push("p"+u);for(v=0;v<r;++v)b.push(["t",u,"p",v,"=t",u,"[",d[u]+v,"]"].join(""));for(v=0;v<Math.abs(t.arrayBlockIndices[u]);++v)b.push(["t",u,"b",v,"=t",u,"[",c[u]+v,"]"].join(""))}for(u=0;u<t.scalarArgs.length;++u)m.push("Y"+u);if(t.shapeArgs.length>0&&b.push("shape=SS.slice(0)"),t.indexArgs.length>0){var x=new Array(r);for(u=0;u<r;++u)x[u]="0";b.push(["index=[",x.join(","),"]"].join(""))}for(u=0;u<t.offsetArgs.length;++u){var _=t.offsetArgs[u],w=[];for(v=0;v<_.offset.length;++v)0!==_.offset[v]&&(1===_.offset[v]?w.push(["t",_.array,"p",v].join("")):w.push([_.offset[v],"*t",_.array,"p",v].join("")));0===w.length?b.push("q"+u+"=0"):b.push(["q",u,"=",w.join("+")].join(""))}var A=n([].concat(t.pre.thisVars).concat(t.body.thisVars).concat(t.post.thisVars));for((b=b.concat(A)).length>0&&y.push("var "+b.join(",")),u=0;u<t.arrayArgs.length;++u)y.push("p"+u+"|=0");t.pre.body.length>3&&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;e<r;){for(var n=1;n<t.length;++n)if(t[n][e]!==t[0][e])return e;++e}return e}(p);k<r?y.push(function(t,e,r,n){for(var i=e.length,o=r.arrayArgs.length,s=r.blockSize,l=r.indexArgs.length>0,u=[],c=0;c<o;++c)u.push(["var offset",c,"=p",c].join(""));for(c=t;c<i;++c)u.push(["for(var j"+c+"=SS[",e[c],"]|0;j",c,">0;){"].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;c<o;++c){for(var f=["offset"+c],d=t;d<i;++d)f.push(["j",d,"*t",c,"p",e[d]].join(""));u.push(["p",c,"=(",f.join("+"),")"].join(""))}for(u.push(a(e,r,n)),c=t;c<i;++c)u.push("}");return u.join("\n")}(k,p[0],t,T)):y.push(a(p[0],t,T)),t.post.body.length>3&&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;c<t.arrayArgs.length;++c){var f=t.arrayArgs[c];r.push(["t",f,"=array",f,".dtype,","r",f,"=array",f,".order"].join("")),i.push("t"+f),i.push("r"+f),o.push("t"+f),o.push("r"+f+".join()"),s.push("array"+f+".data"),s.push("array"+f+".stride"),s.push("array"+f+".offset|0"),c>0&&(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<t.scalarArgs.length;++c)s.push("scalar"+t.scalarArgs[c]);return r.push(["type=[",o.join(","),"].join()"].join("")),r.push("proc=CACHED[type]"),e.push("var "+r.join(",")),e.push(["if(!proc){","CACHED[type]=proc=compile([",i.join(","),"])}","return proc(",s.join(","),")}"].join("")),t.debug&&console.log("-----Generated thunk:\n"+e.join("\n")+"\n----------"),new Function("compile",e.join("\n"))(n.bind(void 0,t))}},{"./compile.js":80}],82:[function(t,e,r){"use strict";var n,a=t("type/value/is"),i=t("type/value/ensure"),o=t("type/plain-function/ensure"),s=t("es5-ext/object/copy"),l=t("es5-ext/object/normalize-options"),u=t("es5-ext/object/map"),c=Function.prototype.bind,f=Object.defineProperty,d=Object.prototype.hasOwnProperty;n=function(t,e,r){var n,a=i(e)&&o(e.value);return delete(n=s(e)).writable,delete n.value,n.get=function(){return!r.overwriteDefinition&&d.call(this,t)?a:(e.value=c.call(a,r.resolveContext?r.resolveContext(this):this),f(this,t,e),this[t])},n},e.exports=function(t){var e=l(arguments[1]);return a(e.resolveContext)&&o(e.resolveContext),u(t,(function(t,r){return n(r,t,e)}))}},{"es5-ext/object/copy":111,"es5-ext/object/map":119,"es5-ext/object/normalize-options":120,"type/plain-function/ensure":333,"type/value/ensure":337,"type/value/is":338}],83:[function(t,e,r){"use strict";var n=t("type/value/is"),a=t("type/plain-function/is"),i=t("es5-ext/object/assign"),o=t("es5-ext/object/normalize-options"),s=t("es5-ext/string/#/contains");(e.exports=function(t,e){var r,a,l,u,c;return arguments.length<2||"string"!=typeof t?(u=e,e=t,t=null):u=arguments[2],n(t)?(r=s.call(t,"c"),a=s.call(t,"e"),l=s.call(t,"w")):(r=l=!0,a=!1),c={value:e,configurable:r,enumerable:a,writable:l},u?i(o(u),c):c}).gs=function(t,e,r){var l,u,c,f;return"string"!=typeof t?(c=r,r=e,e=t,t=null):c=arguments[3],n(e)?a(e)?n(r)?a(r)||(c=r,r=void 0):r=void 0:(c=e,e=r=void 0):e=void 0,n(t)?(l=s.call(t,"c"),u=s.call(t,"e")):(l=!0,u=!1),f={get:e,set:r,configurable:l,enumerable:u},c?i(o(c),f):f}},{"es5-ext/object/assign":108,"es5-ext/object/normalize-options":120,"es5-ext/string/#/contains":127,"type/plain-function/is":334,"type/value/is":338}],84:[function(t,e,r){!function(n,a){"object"==typeof r&&"undefined"!=typeof e?a(r,t("d3-time")):a((n=n||self).d3=n.d3||{},n.d3)}(this,(function(t,e){"use strict";function r(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function n(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function a(t,e,r){return{y:t,m:e,d:r,H:0,M:0,S:0,L:0}}function i(t){var i=t.dateTime,o=t.date,l=t.time,u=t.periods,c=t.days,f=t.shortDays,d=t.months,yt=t.shortMonths,bt=h(u),xt=p(u),_t=h(c),wt=p(c),At=h(f),Tt=p(f),kt=h(d),Mt=p(d),Et=h(yt),St=p(yt),Ct={a:function(t){return f[t.getDay()]},A:function(t){return c[t.getDay()]},b:function(t){return yt[t.getMonth()]},B:function(t){return d[t.getMonth()]},c:null,d:P,e:P,f:j,H:F,I:z,j:N,L:B,m:U,M:V,p:function(t){return u[+(t.getHours()>=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));++l<c;)37===t.charCodeAt(l)&&(o.push(t.slice(u,l)),null!=(a=s[n=t.charAt(++l)])?n=t.charAt(++l):a="e"===n?" ":"0",(i=e[n])&&(n=i(r,a)),o.push(n),u=l+1);return o.push(t.slice(u,l)),o.join("")}}function Rt(t,i){return function(o){var s,l,u=a(1900,void 0,1);if(It(u,t,o+="",0)!=o.length)return null;if("Q"in u)return new Date(u.Q);if("s"in u)return new Date(1e3*u.s+("L"in u?u.L:0));if(i&&!("Z"in u)&&(u.Z=0),"p"in u&&(u.H=u.H%12+12*u.p),void 0===u.m&&(u.m="q"in u?u.q:0),"V"in u){if(u.V<1||u.V>53)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<l;){if(n>=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+(i<r?new Array(r-i+1).join(e)+a:a)}function d(t){return t.replace(c,"\\$&")}function h(t){return new RegExp("^(?:"+t.map(d).join("|")+")","i")}function p(t){for(var e={},r=-1,n=t.length;++r<n;)e[t[r].toLowerCase()]=r;return e}function g(t,e,r){var n=l.exec(e.slice(r,r+1));return n?(t.w=+n[0],r+n[0].length):-1}function v(t,e,r){var n=l.exec(e.slice(r,r+1));return n?(t.u=+n[0],r+n[0].length):-1}function m(t,e,r){var n=l.exec(e.slice(r,r+2));return n?(t.U=+n[0],r+n[0].length):-1}function y(t,e,r){var n=l.exec(e.slice(r,r+2));return n?(t.V=+n[0],r+n[0].length):-1}function b(t,e,r){var n=l.exec(e.slice(r,r+2));return n?(t.W=+n[0],r+n[0].length):-1}function x(t,e,r){var n=l.exec(e.slice(r,r+4));return n?(t.y=+n[0],r+n[0].length):-1}function _(t,e,r){var n=l.exec(e.slice(r,r+2));return n?(t.y=+n[0]+(+n[0]>68?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-e<r-t?e:r},s.offset=function(t,e){return a(t=new Date(+t),null==e?1:Math.floor(e)),t},s.range=function(e,r,n){var i,o=[];if(e=s.ceil(e),n=null==n?1:Math.floor(n),!(e<r&&n>0))return o;do{o.push(i=new Date(+e)),a(e,n),t(e)}while(i<e&&e<r);return o},s.filter=function(e){return n((function(r){if(r>=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 t<e?-1:t>e?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<a;){var i=n+a>>>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<a;){var i=n+a>>>1;t(e[i],r)>0?a=i:n=i+1}return n}}}t.ascending=d,t.descending=function(t,e){return e<t?-1:e>t?1:e>=t?0:NaN},t.min=function(t,e){var r,n,a=-1,i=t.length;if(1===arguments.length){for(;++a<i;)if(null!=(n=t[a])&&n>=n){r=n;break}for(;++a<i;)null!=(n=t[a])&&r>n&&(r=n)}else{for(;++a<i;)if(null!=(n=e.call(t,t[a],a))&&n>=n){r=n;break}for(;++a<i;)null!=(n=e.call(t,t[a],a))&&r>n&&(r=n)}return r},t.max=function(t,e){var r,n,a=-1,i=t.length;if(1===arguments.length){for(;++a<i;)if(null!=(n=t[a])&&n>=n){r=n;break}for(;++a<i;)null!=(n=t[a])&&n>r&&(r=n)}else{for(;++a<i;)if(null!=(n=e.call(t,t[a],a))&&n>=n){r=n;break}for(;++a<i;)null!=(n=e.call(t,t[a],a))&&n>r&&(r=n)}return r},t.extent=function(t,e){var r,n,a,i=-1,o=t.length;if(1===arguments.length){for(;++i<o;)if(null!=(n=t[i])&&n>=n){r=a=n;break}for(;++i<o;)null!=(n=t[i])&&(r>n&&(r=n),a<n&&(a=n))}else{for(;++i<o;)if(null!=(n=e.call(t,t[i],i))&&n>=n){r=a=n;break}for(;++i<o;)null!=(n=e.call(t,t[i],i))&&(r>n&&(r=n),a<n&&(a=n))}return[r,a]},t.sum=function(t,e){var r,n=0,a=t.length,i=-1;if(1===arguments.length)for(;++i<a;)p(r=+t[i])&&(n+=r);else for(;++i<a;)p(r=+e.call(t,t[i],i))&&(n+=r);return n},t.mean=function(t,e){var r,n=0,a=t.length,i=-1,o=a;if(1===arguments.length)for(;++i<a;)p(r=h(t[i]))?n+=r:--o;else for(;++i<a;)p(r=h(e.call(t,t[i],i)))?n+=r:--o;if(o)return n/o},t.quantile=function(t,e){var r=(t.length-1)*e+1,n=Math.floor(r),a=+t[n-1],i=r-n;return i?a+i*(t[n]-a):a},t.median=function(e,r){var n,a=[],i=e.length,o=-1;if(1===arguments.length)for(;++o<i;)p(n=h(e[o]))&&a.push(n);else for(;++o<i;)p(n=h(r.call(e,e[o],o)))&&a.push(n);if(a.length)return t.quantile(a.sort(d),.5)},t.variance=function(t,e){var r,n,a=t.length,i=0,o=0,s=-1,l=0;if(1===arguments.length)for(;++s<a;)p(r=h(t[s]))&&(o+=(n=r-i)*(r-(i+=n/++l)));else for(;++s<a;)p(r=h(e.call(t,t[s],s)))&&(o+=(n=r-i)*(r-(i+=n/++l)));if(l>1)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<r;)a[e]=[n,n=t[++e]];return a},t.transpose=function(e){if(!(i=e.length))return[];for(var r=-1,n=t.min(e,m),a=new Array(n);++r<n;)for(var i,o=-1,s=a[r]=new Array(i);++o<i;)s[o]=e[o][r];return a},t.zip=function(){return t.transpose(arguments)},t.keys=function(t){var e=[];for(var r in t)e.push(r);return e},t.values=function(t){var e=[];for(var r in t)e.push(t[r]);return e},t.entries=function(t){var e=[];for(var r in t)e.push({key:r,value:t[r]});return e},t.merge=function(t){for(var e,r,n,a=t.length,i=-1,o=0;++i<a;)o+=t[i].length;for(r=new Array(o);--a>=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)<e;)a.push(n/i);return a},t.map=function(t,e){var r=new _;if(t instanceof _)t.forEach((function(t,e){r.set(t,e)}));else if(Array.isArray(t)){var n,a=-1,i=t.length;if(1===arguments.length)for(;++a<i;)r.set(a,t[a]);else for(;++a<i;)r.set(e.call(t,n=t[a],a),n)}else for(var o in t)r.set(o,t[o]);return r};function w(t){return"__proto__"==(t+="")||"\0"===t[0]?"\0"+t:t}function A(t){return"\0"===(t+="")[0]?t.slice(1):t}function T(t){return w(t)in this._}function k(t){return(t=w(t))in this._&&delete this._[t]}function M(){var t=[];for(var e in this._)t.push(A(e));return t}function E(){var t=0;for(var e in this._)++t;return t}function S(){for(var t in this._)return!1;return!0}function C(){this._=Object.create(null)}function L(t){return t}function O(t,e,r){return function(){var n=r.apply(e,arguments);return n===e?t:n}}function D(t,e){if(e in t)return e;e=e.charAt(0).toUpperCase()+e.slice(1);for(var r=0,n=R.length;r<n;++r){var a=R[r]+e;if(a in t)return a}}x(_,{has:T,get:function(t){return this._[w(t)]},set:function(t,e){return this._[w(t)]=e},remove:k,keys:M,values:function(){var t=[];for(var e in this._)t.push(this._[e]);return t},entries:function(){var t=[];for(var e in this._)t.push({key:A(e),value:this._[e]});return t},size:E,empty:S,forEach:function(t){for(var e in this._)t.call(this,A(e),this._[e])}}),t.nest=function(){var e,r,n={},a=[],i=[];function o(t,i,s){if(s>=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<h;)(f=g.get(l=p(u=i[d])))?f.push(u):g.set(l,[u]);return t?(u=t(),c=function(e,r){u.set(e,o(t,r,s))}):(u={},c=function(e,r){u[e]=o(t,r,s)}),g.forEach(c),u}return n.map=function(t,e){return o(e,t,0)},n.entries=function(e){return function t(e,r){if(r>=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<n;++r)e.add(t[r]);return e},x(C,{has:T,add:function(t){return this._[w(t+="")]=!0,t},remove:k,values:M,size:E,empty:S,forEach:function(t){for(var e in this._)t.call(this,A(e))}}),t.behavior={},t.rebind=function(t,e){for(var r,n=1,a=arguments.length;++n<a;)t[r=arguments[n]]=O(t,e,e[r]);return t};var R=["webkit","ms","moz","Moz","o","O"];function I(){}function P(){}function F(t){var e=[],r=new _;function n(){for(var r,n=e,a=-1,i=n.length;++a<i;)(r=n[a].on)&&r.apply(this,arguments);return t}return n.on=function(n,a){var i,o=r.get(n);return arguments.length<2?o&&o.on:(o&&(o.on=null,e=e.slice(0,i=e.indexOf(o)).concat(e.slice(i+1)),r.remove(n)),a&&e.push(r.set(n,{on:a})),t)},n}function z(){t.event.preventDefault()}function N(){for(var e,r=t.event;e=r.sourceEvent;)r=e;return r}function B(e){for(var r=new P,n=0,a=arguments.length;++n<a;)r[arguments[n]]=F(r);return r.of=function(n,a){return function(i){try{var o=i.sourceEvent=t.event;i.target=e,t.event=i,r[i.type].apply(n,a)}finally{t.event=o}}},r}t.dispatch=function(){for(var t=new P,e=-1,r=arguments.length;++e<r;)t[arguments[e]]=F(t);return t},P.prototype.on=function(t,e){var r=t.indexOf("."),n="";if(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<s;){i.push(e=[]),e.parentNode=(n=this[o]).parentNode;for(var l=-1,u=n.length;++l<u;)(a=n[l])?(e.push(r=t.call(a,a.__data__,l,o)),r&&"__data__"in a&&(r.__data__=a.__data__)):e.push(null)}return V(i)},X.selectAll=function(t){var e,r,a=[];t=Y(t);for(var i=-1,o=this.length;++i<o;)for(var s=this[i],l=-1,u=s.length;++l<u;)(r=s[l])&&(a.push(e=n(t.call(r,r.__data__,l,i))),e.parentNode=r);return V(a)};var Z="http://www.w3.org/1999/xhtml",J={svg:"http://www.w3.org/2000/svg",xhtml:Z,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Q(e,r){return e=t.ns.qualify(e),null==r?e.local?function(){this.removeAttributeNS(e.space,e.local)}:function(){this.removeAttribute(e)}:"function"==typeof r?e.local?function(){var t=r.apply(this,arguments);null==t?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,t)}:function(){var t=r.apply(this,arguments);null==t?this.removeAttribute(e):this.setAttribute(e,t)}:e.local?function(){this.setAttributeNS(e.space,e.local,r)}:function(){this.setAttribute(e,r)}}function $(t){return t.trim().replace(/\s+/g," ")}function K(e){return new RegExp("(?:^|\\s+)"+t.requote(e)+"(?:\\s+|$)","g")}function tt(t){return(t+"").trim().split(/^|\s+/)}function et(t,e){var r=(t=tt(t).map(rt)).length;return"function"==typeof e?function(){for(var n=-1,a=e.apply(this,arguments);++n<r;)t[n](this,a)}:function(){for(var n=-1;++n<r;)t[n](this,e)}}function rt(t){var e=K(t);return function(r,n){if(a=r.classList)return n?a.add(t):a.remove(t);var a=r.getAttribute("class")||"";n?(e.lastIndex=0,e.test(a)||r.setAttribute("class",$(a+" "+t))):r.setAttribute("class",$(a.replace(e," ")))}}function nt(t,e,r){return null==e?function(){this.style.removeProperty(t)}:"function"==typeof e?function(){var n=e.apply(this,arguments);null==n?this.style.removeProperty(t):this.style.setProperty(t,n,r)}:function(){this.style.setProperty(t,e,r)}}function at(t,e){return null==e?function(){delete this[t]}:"function"==typeof e?function(){var r=e.apply(this,arguments);null==r?delete this[t]:this[t]=r}:function(){this[t]=e}}function it(e){return"function"==typeof e?e:(e=t.ns.qualify(e)).local?function(){return this.ownerDocument.createElementNS(e.space,e.local)}:function(){var t=this.ownerDocument,r=this.namespaceURI;return r===Z&&t.documentElement.namespaceURI===Z?t.createElement(e):t.createElementNS(r,e)}}function ot(){var t=this.parentNode;t&&t.removeChild(this)}function st(t){return{__data__:t}}function lt(t){return function(){return q(this,t)}}function ut(t){return arguments.length||(t=d),function(e,r){return e&&r?t(e.__data__,r.__data__):!e-!r}}function ct(t,e){for(var r=0,n=t.length;r<n;r++)for(var a,i=t[r],o=0,s=i.length;o<s;o++)(a=i[o])&&e(a,o,r);return t}function ft(t){return U(t,dt),t}t.ns={prefix:J,qualify:function(t){var e=t.indexOf(":"),r=t;return e>=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<n;)if(!e.contains(t[a]))return!1}else for(e=r.getAttribute("class");++a<n;)if(!K(t[a]).test(e))return!1;return!0}for(e in t)this.each(et(e,t[e]));return this}return this.each(et(t,e))},X.style=function(t,e,r){var n=arguments.length;if(n<3){if("string"!=typeof t){for(r in n<2&&(e=""),t)this.each(nt(r,t[r],e));return this}if(n<2){var a=this.node();return o(a).getComputedStyle(a,null).getPropertyValue(t)}r=""}return this.each(nt(t,e,r))},X.property=function(t,e){if(arguments.length<2){if("string"==typeof t)return this.node()[t];for(e in t)this.each(at(e,t[e]));return this}return this.each(at(t,e))},X.text=function(t){return arguments.length?this.each("function"==typeof t?function(){var e=t.apply(this,arguments);this.textContent=null==e?"":e}:null==t?function(){this.textContent=""}:function(){this.textContent=t}):this.node().textContent},X.html=function(t){return arguments.length?this.each("function"==typeof t?function(){var e=t.apply(this,arguments);this.innerHTML=null==e?"":e}:null==t?function(){this.innerHTML=""}:function(){this.innerHTML=t}):this.node().innerHTML},X.append=function(t){return t=it(t),this.select((function(){return this.appendChild(t.apply(this,arguments))}))},X.insert=function(t,e){return t=it(t),e=W(e),this.select((function(){return this.insertBefore(t.apply(this,arguments),e.apply(this,arguments)||null)}))},X.remove=function(){return this.each(ot)},X.data=function(t,e){var r,n,a=-1,i=this.length;if(!arguments.length){for(t=new Array(i=(r=this[0]).length);++a<i;)(n=r[a])&&(t[a]=n.__data__);return t}function o(t,r){var n,a,i,o=t.length,c=r.length,f=Math.min(o,c),d=new Array(c),h=new Array(c),p=new Array(o);if(e){var g,v=new _,m=new Array(o);for(n=-1;++n<o;)(a=t[n])&&(v.has(g=e.call(a,a.__data__,n))?p[n]=a:v.set(g,a),m[n]=g);for(n=-1;++n<c;)(a=v.get(g=e.call(r,i=r[n],n)))?!0!==a&&(d[n]=a,a.__data__=i):h[n]=st(i),v.set(g,!0);for(n=-1;++n<o;)n in m&&!0!==v.get(m[n])&&(p[n]=t[n])}else{for(n=-1;++n<f;)a=t[n],i=r[n],a?(a.__data__=i,d[n]=a):h[n]=st(i);for(;n<c;++n)h[n]=st(r[n]);for(;n<o;++n)p[n]=t[n]}h.update=d,h.parentNode=d.parentNode=p.parentNode=t.parentNode,s.push(h),l.push(d),u.push(p)}var s=ft([]),l=V([]),u=V([]);if("function"==typeof t)for(;++a<i;)o(r=this[a],t.call(r,r.parentNode.__data__,a));else for(;++a<i;)o(r=this[a],t);return l.enter=function(){return s},l.exit=function(){return u},l},X.datum=function(t){return arguments.length?this.property("__data__",t):this.property("__data__")},X.filter=function(t){var e,r,n,a=[];"function"!=typeof t&&(t=lt(t));for(var i=0,o=this.length;i<o;i++){a.push(e=[]),e.parentNode=(r=this[i]).parentNode;for(var s=0,l=r.length;s<l;s++)(n=r[s])&&t.call(n,n.__data__,s,i)&&e.push(n)}return V(a)},X.order=function(){for(var t=-1,e=this.length;++t<e;)for(var r,n=this[t],a=n.length-1,i=n[a];--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<r;)this[e].sort(t);return this.order()},X.each=function(t){return ct(this,(function(e,r,n){t.call(e,e.__data__,r,n)}))},X.call=function(t){var e=n(arguments);return t.apply(e[0]=this,e),this},X.empty=function(){return!this.node()},X.node=function(){for(var t=0,e=this.length;t<e;t++)for(var r=this[t],n=0,a=r.length;n<a;n++){var i=r[n];if(i)return i}return null},X.size=function(){var t=0;return ct(this,(function(){++t})),t};var dt=[];function ht(t){var e,r;return function(n,a,i){var o,s=t[i].update,l=s.length;for(i!=r&&(r=i,e=0),a>=e&&(e=a+1);!(o=s[e])&&++e<l;);return o}}function pt(e,r,a){var i="__on"+e,o=e.indexOf("."),s=vt;o>0&&(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;++s<l;){n=(a=this[s]).update,o.push(e=[]),e.parentNode=a.parentNode;for(var u=-1,c=a.length;++u<c;)(i=a[u])?(e.push(n[u]=r=t.call(a.parentNode,i.__data__,u,s)),r.__data__=i.__data__):e.push(null)}return V(o)},dt.insert=function(t,e){return arguments.length<2&&(e=ht(this)),X.insert.call(this,t,e)},t.select=function(t){var e;return"string"==typeof t?(e=[H(t,a)]).parentNode=a.documentElement:(e=[t]).parentNode=i(t),V([e])},t.selectAll=function(t){var e;return"string"==typeof t?(e=n(G(t,a))).parentNode=a.documentElement:(e=n(t)).parentNode=null,V([e])},X.on=function(t,e,r){var n=arguments.length;if(n<3){if("string"!=typeof t){for(r in n<2&&(e=!1),t)this.each(pt(r,t[r],e));return this}if(n<2)return(n=this.node()["__on"+t])&&n._;r=!1}return this.each(pt(t,e,r))};var gt=t.map({mouseenter:"mouseover",mouseleave:"mouseout"});function vt(e,r){return function(n){var a=t.event;t.event=n,r[0]=this.__data__;try{e.apply(this,r)}finally{t.event=a}}}function mt(t,e){var r=vt(t,e);return function(t){var e=t.relatedTarget;e&&(e===this||8&e.compareDocumentPosition(this))||r.call(this,t)}}a&&gt.forEach((function(t){"on"+t in a&&gt.remove(t)}));var yt,bt=0;function xt(e){var r=".dragsuppress-"+ ++bt,n="click"+r,a=t.select(o(e)).on("touchmove"+r,z).on("dragstart"+r,z).on("selectstart"+r,z);if(null==yt&&(yt=!("onselectstart"in e)&&D(e.style,"userSelect")),yt){var s=i(e).style,l=s[yt];s[yt]="none"}return function(t){if(a.on(r,null),yt&&(s[yt]=l),t){var e=function(){a.on(n,null)};a.on(n,(function(){z(),e()}),!0),setTimeout(e,0)}}}t.mouse=function(t){return wt(t,N())};var _t=this.navigator&&/WebKit/.test(this.navigator.userAgent)?-1:0;function wt(e,r){r.changedTouches&&(r=r.changedTouches[0]);var n=e.ownerSVGElement||e;if(n.createSVGPoint){var a=n.createSVGPoint();if(_t<0){var i=o(e);if(i.scrollX||i.scrollY){var s=(n=t.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important"))[0][0].getScreenCTM();_t=!(s.f||s.e),n.remove()}}return _t?(a.x=r.pageX,a.y=r.pageY):(a.x=r.clientX,a.y=r.clientY),[(a=a.matrixTransform(e.getScreenCTM().inverse())).x,a.y]}var l=e.getBoundingClientRect();return[r.clientX-l.left-e.clientLeft,r.clientY-l.top-e.clientTop]}function At(){return t.event.changedTouches[0].identifier}t.touch=function(t,e,r){if(arguments.length<3&&(r=e,e=N().changedTouches),e)for(var n,a=0,i=e.length;a<i;++a)if((n=e[a]).identifier===r)return wt(t,n)},t.behavior.drag=function(){var e=B(i,"drag","dragstart","dragend"),r=null,n=s(I,t.mouse,o,"mousemove","mouseup"),a=s(At,t.touch,L,"touchmove","touchend");function i(){this.on("mousedown.drag",n).on("touchstart.drag",a)}function s(n,a,i,o,s){return function(){var l,u=this,c=t.event.target.correspondingElement||t.event.target,f=u.parentNode,d=e.of(u,arguments),h=0,p=n(),g=".drag"+(null==p?"":"-"+p),v=t.select(i(c)).on(o+g,b).on(s+g,x),m=xt(c),y=a(f,p);function b(){var t,e,r=a(f,p);r&&(t=r[0]-y[0],e=r[1]-y[1],h|=t|e,y=r,d({type:"drag",x:r[0]+l[0],y:r[1]+l[1],dx:t,dy:e}))}function x(){a(f,p)&&(v.on(o+g,null).on(s+g,null),m(h),d({type:"dragend"}))}l=r?[(l=r.apply(u,arguments)).x-y[0],l.y-y[1]]:[0,0],d({type:"dragstart"})}}return i.origin=function(t){return arguments.length?(r=t,i):r},t.rebind(i,e,"on")},t.touches=function(t,e){return arguments.length<2&&(e=N().touches),e?n(e).map((function(e){var r=wt(t,e);return r.identifier=e.identifier,r})):[]};var Tt=1e-6,kt=1e-12,Mt=Math.PI,Et=2*Mt,St=Et-Tt,Ct=Mt/2,Lt=Mt/180,Ot=180/Mt;function Dt(t){return t>0?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(d<kt)n=Math.log(u/o)/Nt,r=function(t){return[a+t*c,i+t*f,o*Math.exp(Nt*t*n)]};else{var h=Math.sqrt(d),p=(u*u-o*o+4*d)/(2*o*2*h),g=(u*u-o*o-4*d)/(2*u*2*h),v=Math.log(Math.sqrt(p*p+1)-p),m=Math.log(Math.sqrt(g*g+1)-g);n=(m-v)/Nt,r=function(t){var e,r=t*n,s=Ft(v),l=o/(2*h)*(s*(e=Nt*r+v,((e=Math.exp(2*e))-1)/(e+1))-function(t){return((t=Math.exp(t))-1/t)/2}(v));return[a+l*c,i+l*f,o*s/Ft(Nt*r+v)]}}return r.duration=1e3*n,r},t.behavior.zoom=function(){var e,r,n,i,s,l,u,c,f,d={x:0,y:0,k:1},h=[960,500],p=Ut,g=250,v=0,m="mousedown.zoom",y="mousemove.zoom",b="mouseup.zoom",x="touchstart.zoom",_=B(w,"zoomstart","zoom","zoomend");function w(t){t.on(m,O).on(jt+".zoom",R).on("dblclick.zoom",I).on(x,D)}function A(t){return[(t[0]-d.x)/d.k,(t[1]-d.y)/d.k]}function T(t){d.k=Math.max(p[0],Math.min(p[1],t))}function k(t,e){e=function(t){return[t[0]*d.k+d.x,t[1]*d.k+d.y]}(e),d.x+=t[0]-e[0],d.y+=t[1]-e[1]}function M(e,n,a,i){e.__chart__={x:d.x,y:d.y,k:d.k},T(Math.pow(2,i)),k(r=n,a),e=t.select(e),g>0&&(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;o<f;++o)a[n[o].identifier]=null;var h=p(),g=Date.now();if(1===h.length){if(g-s<500){var m=h[0];M(r,m,a[m.identifier],Math.floor(Math.log(d.k)/Math.LN2)+1),z()}s=g}else if(h.length>1){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;d<h;++d,c=null)if(u=f[d],c=a[u.identifier]){if(l)break;o=u,l=c}if(c){var p=(p=u[0]-o[0])*p+(p=u[1]-o[1])*p,g=i&&Math.sqrt(p/i);o=[(o[0]+u[0])/2,(o[1]+u[1])/2],l=[(l[0]+c[0])/2,(l[1]+c[1])/2],T(g*e)}s=null,k(o,l),C(n)}function y(){if(t.event.touches.length){for(var e=t.event.changedTouches,r=0,i=e.length;r<i;++r)delete a[e[r].identifier];for(var s in a)return void p()}t.selectAll(c).on(o,null),f.on(m,O).on(x,D),h(),L(n)}g(),S(n),f.on(m,null).on(x,g)}function R(){var a=_.of(this,arguments);i?clearTimeout(i):(ms.call(this),e=A(r=n||t.mouse(this)),S(a)),i=setTimeout((function(){i=null,L(a)}),50),z(),T(Math.pow(2,.002*Bt())*d.k),k(r,e),C(a)}function I(){var e=t.mouse(this),r=Math.log(d.k)/Math.LN2;M(this,e,A(e),t.event.shiftKey?Math.ceil(r)-1:Math.floor(r)+1)}return jt||(jt="onwheel"in a?(Bt=function(){return-t.event.deltaY*(t.event.deltaMode?120:1)},"wheel"):"onmousewheel"in a?(Bt=function(){return t.event.wheelDelta},"mousewheel"):(Bt=function(){return-t.event.detail},"MozMousePixelScroll")),w.event=function(e){e.each((function(){var e=_.of(this,arguments),n=d;xs?t.select(this).transition().each("start.zoom",(function(){d=this.__chart__||{x:0,y:0,k:1},S(e)})).tween("zoom:zoom",(function(){var a=h[0],i=h[1],o=r?r[0]:a/2,s=r?r[1]:i/2,l=t.interpolateZoom([(o-d.x)/d.k,(s-d.y)/d.k,a/d.k],[(o-n.x)/n.k,(s-n.y)/n.k,a/n.k]);return function(t){var r=l(t),n=a/r[2];this.__chart__=d={x:o-r[0]*n,y:s-r[1]*n,k:n},C(e)}})).each("interrupt.zoom",(function(){L(e)})).each("end.zoom",(function(){L(e)})):(this.__chart__=d,S(e),C(e),L(e))}))},w.translate=function(t){return arguments.length?(d={x:+t[0],y:+t[1],k:d.k},E(),w):[d.x,d.y]},w.scale=function(t){return arguments.length?(d={x:d.x,y:d.y,k:null},T(+t),E(),w):d.k},w.scaleExtent=function(t){return arguments.length?(p=null==t?Ut:[+t[0],+t[1]],w):p},w.center=function(t){return arguments.length?(n=t&&[+t[0],+t[1]],w):n},w.size=function(t){return arguments.length?(h=t&&[+t[0],+t[1]],w):h},w.duration=function(t){return arguments.length?(g=+t,w):g},w.x=function(t){return arguments.length?(u=t,l=t.copy(),d={x:0,y:0,k:1},w):u},w.y=function(t){return arguments.length?(f=t,c=t.copy(),d={x:0,y:0,k:1},w):f},t.rebind(w,_,"on")};var Bt,jt,Ut=[0,1/0];function Vt(){}function Ht(t,e,r){return this instanceof Ht?(this.h=+t,this.s=+e,void(this.l=+r)):arguments.length<2?t instanceof Ht?new Ht(t.h,t.s,t.l):le(""+t,ue,Ht):new Ht(t,e,r)}t.color=Vt,Vt.prototype.toString=function(){return this.rgb()+""},t.hsl=Ht;var Gt=Ht.prototype=new Vt;function qt(t,e,r){var n,a;function i(t){return Math.round(255*function(t){return t>360?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+(e<r?6:0):e==o?(r-t)/s+2:(t-e)/s+4,n*=60):(n=NaN,a=l>0&&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<a&&(e=a),r&&r<a&&(r=a),n&&n<a&&(n=a),new ne(Math.min(255,e/t),Math.min(255,r/t),Math.min(255,n/t))):new ne(a,a,a)},oe.darker=function(t){return new ne((t=Math.pow(.7,arguments.length?t:1))*this.r,t*this.g,t*this.b)},oe.hsl=function(){return ue(this.r,this.g,this.b)},oe.toString=function(){return"#"+se(this.r)+se(this.g)+se(this.b)};var he=t.map({aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074});function pe(t){return"function"==typeof t?t:function(){return t}}function ge(t){return function(e,r,n){return 2===arguments.length&&"function"==typeof r&&(n=r,r=null),ve(e,r,t,n)}}function ve(e,r,a,i){var o={},s=t.dispatch("beforesend","progress","load","error"),l={},u=new XMLHttpRequest,c=null;function f(){var t,e=u.status;if(!e&&function(t){var e=t.responseType;return e&&"text"!==e?t.response:t.responseText}(u)||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++<l;)if(34===t.charCodeAt(r)){if(34!==t.charCodeAt(r+1))break;++r}return u=r+2,13===(s=t.charCodeAt(r+1))?(a=!0,10===t.charCodeAt(r+2)&&++u):10===s&&(a=!0),t.slice(e+1,r).replace(/""/g,'"')}for(;u<l;){var s,c=1;if(10===(s=t.charCodeAt(u++)))a=!0;else if(13===s)a=!0,10===t.charCodeAt(u)&&(++u,++c);else if(s!==n)continue;return t.slice(e,u-c)}return t.slice(e)}for(;(r=f())!==o;){for(var d=[];r!==i&&r!==o;)d.push(r),r=f();e&&null==(d=e(d,c++))||s.push(d)}return s},a.format=function(e){if(Array.isArray(e[0]))return a.formatRows(e);var r=new C,n=[];return e.forEach((function(t){for(var e in t)r.has(e)||n.push(r.add(e))})),[n.map(l).join(t)].concat(e.map((function(e){return n.map((function(t){return l(e[t])})).join(t)}))).join("\n")},a.formatRows=function(t){return t.map(s).join("\n")},a},t.csv=t.dsv(",","text/csv"),t.tsv=t.dsv("\t","text/tab-separated-values");var me,ye,be,xe,_e=this[D(this,"requestAnimationFrame")]||function(t){setTimeout(t,17)};function we(t,e,r){var n=arguments.length;n<2&&(e=0),n<3&&(r=Date.now());var a=r+e,i={c:t,t:a,n:null};return ye?ye.n=i:me=i,ye=i,be||(xe=clearTimeout(xe),be=1,_e(Ae)),i}function Ae(){var t=Te(),e=ke()-t;e>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.t<r&&(r=e.t),e=(t=e).n):e=t?t.n=e.n:me=e.n;return ye=t,r}function Me(t,e){return e-(t?Math.ceil(Math.log(t)/Math.LN10):1)}t.timer=function(){we.apply(this,arguments)},t.timer.flush=function(){Te(),ke()},t.round=function(t,e){return e?Math.round(t*(e=Math.pow(10,e)))/e:Math.round(t)};var Ee=["y","z","a","f","p","n","\xb5","m","","k","M","G","T","P","E","Z","Y"].map((function(t,e){var r=Math.pow(10,3*y(8-e));return{scale:e>8?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<f?new Array(k=f-k+1).join(a):"";return x&&(_=o(M+_,M.length?f-w.length:1/0)),i+=v,e=_+w,("<"===s?i+e+M:">"===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-r<n-e?r:n}function a(r){return e(r=t(new Re(r-1)),1),r}function i(t,r){return e(t=new Re(+t),r),t}function o(t,n,i){var o=a(t),s=[];if(i>1)for(;o<n;)r(o)%i||s.push(new Date(+o)),e(o,1);else for(;o<n;)s.push(new Date(+o)),e(o,1);return s}t.floor=t,t.round=n,t.ceil=a,t.offset=i,t.range=o;var s=t.utc=ze(t);return s.floor=s,s.round=ze(n),s.ceil=ze(a),s.offset=ze(i),s.range=function(t,e,r){try{Re=Ie;var n=new Ie;return n._=t,o(n,e,r)}finally{Re=Date}},t}function ze(t){return function(e,r){try{Re=Ie;var n=new Ie;return n._=e,t(n,r)._}finally{Re=Date}}}function Ne(e){var r=e.dateTime,n=e.date,a=e.time,i=e.periods,o=e.days,s=e.shortDays,l=e.months,u=e.shortMonths;function c(t){var e=t.length;function r(r){for(var n,a,i,o=[],s=-1,l=0;++s<e;)37===t.charCodeAt(s)&&(o.push(t.slice(l,s)),null!=(a=Be[n=t.charAt(++s)])&&(n=t.charAt(++s)),(i=_[n])&&(n=i(r,null==a?"e"===n?" ":"0":a)),o.push(n),l=s+1);return o.push(t.slice(l,s)),o.join("")}return r.parse=function(e){var r={y:1900,m:0,d:1,H:0,M:0,S:0,L:0,Z:null};if(f(r,t,e,0)!=e.length)return null;"p"in r&&(r.H=r.H%12+12*r.p);var n=null!=r.Z&&Re!==Ie,a=new(n?Ie:Re);return"j"in r?a.setFullYear(r.y,0,r.j):"W"in r||"U"in r?("w"in r||(r.w="W"in r?1:0),a.setFullYear(r.y,0,1),a.setFullYear(r.y,0,"W"in r?(r.w+6)%7+7*r.W-(a.getDay()+5)%7:r.w+7*r.U-(a.getDay()+6)%7)):a.setFullYear(r.y,r.m,r.d),a.setHours(r.H+(r.Z/100|0),r.M+r.Z%100,r.S,r.L),n?a._:a},r.toString=function(){return t},r}function f(t,e,r,n){for(var a,i,o,s=0,l=e.length,u=r.length;s<l;){if(n>=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+(i<r?new Array(r-i+1).join(e)+a:a)}function He(e){return new RegExp("^(?:"+e.map(t.requote).join("|")+")","i")}function Ge(t){for(var e=new _,r=-1,n=t.length;++r<n;)e.set(t[r].toLowerCase(),r);return e}function qe(t,e,r){je.lastIndex=0;var n=je.exec(e.slice(r,r+1));return n?(t.w=+n[0],r+n[0].length):-1}function Xe(t,e,r){je.lastIndex=0;var n=je.exec(e.slice(r));return n?(t.U=+n[0],r+n[0].length):-1}function We(t,e,r){je.lastIndex=0;var n=je.exec(e.slice(r));return n?(t.W=+n[0],r+n[0].length):-1}function Ye(t,e,r){je.lastIndex=0;var n=je.exec(e.slice(r,r+4));return n?(t.y=+n[0],r+n[0].length):-1}function Ze(t,e,r){je.lastIndex=0;var n,a=je.exec(e.slice(r,r+2));return a?(t.y=(n=+a[0])+(n>68?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<e;)t[r][0]=this(t[r][0]);return function(e){for(var r=0,n=t[r];!n[1](e);)n=t[++r];return n[0](e)}}t.locale=function(t){return{numberFormat:Se(t),timeFormat:Ne(t)}};var sr=t.locale({decimal:".",thousands:",",grouping:[3],currency:["$",""],dateTime:"%a %b %e %X %Y",date:"%m/%d/%Y",time:"%H:%M:%S",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"]});function lr(){}t.format=sr.numberFormat,t.geo={},lr.prototype={s:0,t:0,add:function(t){cr(t,this.t,ur),cr(ur.s,this.s,this),this.s?this.t+=ur.t:this.s=ur.t},reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};var ur=new lr;function cr(t,e,r){var n=r.s=t+e,a=n-t,i=n-a;r.t=t-i+(e-a)}function fr(t,e){t&&hr.hasOwnProperty(t.type)&&hr[t.type](t,e)}t.geo.stream=function(t,e){t&&dr.hasOwnProperty(t.type)?dr[t.type](t,e):fr(t,e)};var dr={Feature:function(t,e){fr(t.geometry,e)},FeatureCollection:function(t,e){for(var r=t.features,n=-1,a=r.length;++n<a;)fr(r[n].geometry,e)}},hr={Sphere:function(t,e){e.sphere()},Point:function(t,e){t=t.coordinates,e.point(t[0],t[1],t[2])},MultiPoint:function(t,e){for(var r=t.coordinates,n=-1,a=r.length;++n<a;)t=r[n],e.point(t[0],t[1],t[2])},LineString:function(t,e){pr(t.coordinates,e,0)},MultiLineString:function(t,e){for(var r=t.coordinates,n=-1,a=r.length;++n<a;)pr(r[n],e,0)},Polygon:function(t,e){gr(t.coordinates,e)},MultiPolygon:function(t,e){for(var r=t.coordinates,n=-1,a=r.length;++n<a;)gr(r[n],e)},GeometryCollection:function(t,e){for(var r=t.geometries,n=-1,a=r.length;++n<a;)fr(r[n],e)}};function pr(t,e,r){var n,a=-1,i=t.length-r;for(e.lineStart();++a<i;)n=t[a],e.point(n[0],n[1],n[2]);e.lineEnd()}function gr(t,e){var r=-1,n=t.length;for(e.polygonStart();++r<n;)pr(t[r],e,1);e.polygonEnd()}t.geo.area=function(e){return vr=0,t.geo.stream(e,Cr),vr};var vr,mr,yr,br,xr,_r,wr,Ar,Tr,kr,Mr,Er,Sr=new lr,Cr={sphere:function(){vr+=4*Mt},point:I,lineStart:I,lineEnd:I,polygonStart:function(){Sr.reset(),Cr.lineStart=Lr},polygonEnd:function(){var t=2*Sr;vr+=t<0?4*Mt+t:t,Cr.lineStart=Cr.lineEnd=Cr.point=I}};function Lr(){var t,e,r,n,a;function i(t,e){e=e*Lt/2+Mt/4;var i=(t*=Lt)-r,o=i>=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&&y(t[1]-e[1])<Tt}t.geo.bounds=function(){var e,r,n,a,i,o,s,l,u,c,f,d={point:h,lineStart:g,lineEnd:v,polygonStart:function(){d.point=m,d.lineStart=b,d.lineEnd=x,u=0,Cr.polygonStart()},polygonEnd:function(){Cr.polygonEnd(),d.point=h,d.lineStart=g,d.lineEnd=v,Sr<0?(e=-(n=180),r=-(a=90)):u>Tt?a=90:u<-Tt&&(r=-90),f[0]=e,f[1]=n}};function h(t,i){c.push(f=[e=t,n=t]),i<r&&(r=i),i>a&&(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*i<p&&p<d*t))(v=c[1]*Ot)>a&&(a=v);else if(g^(d*i<(p=(p+360)%360-180)&&p<d*t)){var v;(v=-c[1]*Ot)<r&&(r=v)}else o<r&&(r=o),o>a&&(a=o);g?t<i?_(e,t)>_(e,n)&&(n=t):_(t,n)>_(e,n)&&(e=t):n>=e?(t<e&&(e=t),t>n&&(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<e[0]||e[1]<t}return function(i){if(a=n=-(e=r=1/0),c=[],t.geo.stream(i,d),u=c.length){c.sort(w);for(var o=1,s=[g=c[0]];o<u;++o)A((h=c[o])[0],g)||A(h[1],g)?(_(g[0],h[1])>_(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<kt&&(r=wr,n=Ar,a=Tr,yr<Tt&&(r=br,n=xr,a=_r),(i=r*r+n*n+a*a)<kt)?[NaN,NaN]:[Math.atan2(n,r)*Ot,Pt(a/Math.sqrt(i))*Ot]};var Br={sphere:I,point:jr,lineStart:Vr,lineEnd:Hr,polygonStart:function(){Br.lineStart=Gr},polygonEnd:function(){Br.lineStart=Vr}};function jr(t,e){t*=Lt;var r=Math.cos(e*=Lt);Ur(r*Math.cos(t),r*Math.sin(t),Math.sin(e))}function Ur(t,e,r){++mr,br+=(t-br)/mr,xr+=(e-xr)/mr,_r+=(r-_r)/mr}function Vr(){var t,e,r;function n(n,a){n*=Lt;var i=Math.cos(a*=Lt),o=i*Math.cos(n),s=i*Math.sin(n),l=Math.sin(a),u=Math.atan2(Math.sqrt((u=e*l-r*s)*u+(u=r*o-t*l)*u+(u=t*s-e*o)*u),t*o+e*s+r*l);yr+=u,wr+=u*(t+(t=o)),Ar+=u*(e+(e=s)),Tr+=u*(r+(r=l)),Ur(t,e,r)}Br.point=function(a,i){a*=Lt;var o=Math.cos(i*=Lt);t=o*Math.cos(a),e=o*Math.sin(a),r=Math.sin(i),Br.point=n,Ur(t,e,r)}}function Hr(){Br.point=jr}function Gr(){var t,e,r,n,a;function i(t,e){t*=Lt;var i=Math.cos(e*=Lt),o=i*Math.cos(t),s=i*Math.sin(t),l=Math.sin(e),u=n*l-a*s,c=a*o-r*l,f=r*s-n*o,d=Math.sqrt(u*u+c*c+f*f),h=r*o+n*s+a*l,p=d&&-It(h)/d,g=Math.atan2(d,h);kr+=p*u,Mr+=p*c,Er+=p*f,yr+=g,wr+=g*(r+(r=o)),Ar+=g*(n+(n=s)),Tr+=g*(a+(a=l)),Ur(r,n,a)}Br.point=function(o,s){t=o,e=s,Br.point=i,o*=Lt;var l=Math.cos(s*=Lt);r=l*Math.cos(o),n=l*Math.sin(o),a=Math.sin(s),Ur(r,n,a)},Br.lineEnd=function(){i(t,e),Br.lineEnd=Hr,Br.point=jr}}function qr(t,e){function r(r,n){return r=t(r,n),e(r[0],r[1])}return t.invert&&e.invert&&(r.invert=function(r,n){return(r=e.invert(r,n))&&t.invert(r[0],r[1])}),r}function Xr(){return!0}function Wr(t,e,r,n,a){var i=[],o=[];if(t.forEach((function(t){if(!((e=t.length-1)<=0)){var e,r=t[0],n=t[e];if(Nr(r,n)){a.lineStart();for(var s=0;s<e;++s)a.point((r=t[s])[0],r[1]);a.lineEnd()}else{var l=new Zr(r,t,null,!0),u=new Zr(r,null,l,!1);l.o=u,i.push(l),o.push(u),l=new Zr(n,t,null,!1),u=new Zr(n,null,l,!0),l.o=u,i.push(l),o.push(u)}}})),o.sort(e),Yr(i),Yr(o),i.length){for(var s=0,l=r,u=o.length;s<u;++s)o[s].e=l=!l;for(var c,f,d=i[0];;){for(var h=d,p=!0;h.v;)if((h=h.n)===d)return;c=h.z,a.lineStart();do{if(h.v=h.o.v=!0,h.e){if(p)for(s=0,u=c.length;s<u;++s)a.point((f=c[s])[0],f[1]);else n(h.x,h.n.x,1,a);h=h.n}else{if(p)for(s=(c=h.p.z).length-1;s>=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<e;)a.n=r=t[n],r.p=a,a=r;a.n=r=t[0],r.p=a}}function Zr(t,e,r,n){this.x=t,this.z=e,this.o=r,this.e=n,this.v=!1,this.n=this.p=null}function Jr(e,r,n,a){return function(i,o){var s,l=r(o),u=i.invert(a[0],a[1]),c={point:f,lineStart:h,lineEnd:p,polygonStart:function(){c.point=x,c.lineStart=_,c.lineEnd=w,s=[],g=[]},polygonEnd:function(){c.point=f,c.lineStart=h,c.lineEnd=p,s=t.merge(s);var e=function(t,e){var r=t[0],n=t[1],a=[Math.sin(r),-Math.cos(r),0],i=0,o=0;Sr.reset();for(var s=0,l=e.length;s<l;++s){var u=e[s],c=u.length;if(c)for(var f=u[0],d=f[0],h=f[1]/2+Mt/4,p=Math.sin(h),g=Math.cos(h),v=1;;){v===c&&(v=0);var m=(t=u[v])[0],y=t[1]/2+Mt/4,b=Math.sin(y),x=Math.cos(y),_=m-d,w=_>=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||i<Tt&&Sr<-Tt)^1&o}(u,g);s.length?(b||(o.polygonStart(),b=!0),Wr(s,Kr,e,n,o)):e&&(b||(o.polygonStart(),b=!0),o.lineStart(),n(null,null,1,o),o.lineEnd()),b&&(o.polygonEnd(),b=!1),s=g=null},sphere:function(){o.polygonStart(),o.lineStart(),n(null,null,1,o),o.lineEnd(),o.polygonEnd()}};function f(t,r){var n=i(t,r);e(t=n[0],r=n[1])&&o.point(t,r)}function d(t,e){var r=i(t,e);l.point(r[0],r[1])}function h(){c.point=d,l.lineStart()}function p(){c.point=f,l.lineEnd()}var g,v,m=$r(),y=r(m),b=!1;function x(t,e){v.push([t,e]);var r=i(t,e);y.point(r[0],r[1])}function _(){y.lineStart(),v=[]}function w(){x(v[0][0],v[0][1]),y.lineEnd();var t,e=y.clean(),r=m.buffer(),n=r.length;if(v.pop(),g.push(v),v=null,n)if(1&e){var a,i=-1;if((n=(t=r[0]).length-1)>0){for(b||(o.polygonStart(),b=!0),o.lineStart();++i<n;)o.point((a=t[i])[0],a[1]);o.lineEnd()}}else n>1&&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)<Tt?(t.point(r,n=(n+o)/2>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&&(r-=a*Tt),y(i-s)<Tt&&(i-=s*Tt),n=function(t,e,r,n){var a,i,o=Math.sin(t-r);return y(o)>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]<e[0]?Mt:-Mt;a=r*i/2,n.point(-i,a),n.point(0,a),n.point(i,a)}else n.point(e[0],e[1])}),[-Mt,-Mt/2]);function en(t){var e=Math.cos(t),r=e>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)<Tt;if(!M&&T<A&&(x=A,A=T,T=x),M||k<Tt?M?A+T>0^b[1]<(y(b[0]-_)<Tt?A:T):A<=b[1]&&b[1]<=T:k>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(i<c)return;i<f&&(f=i)}else if(d>0){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(i<c)return;i<f&&(f=i)}if(i=e-u,h||!(i>0)){if(i/=h,h<0){if(i<c)return;i<f&&(f=i)}else if(h>0){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(i<c)return;i<f&&(f=i)}return c>0&&(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;a<r;++a)for(var i,o=1,s=c[a],l=s.length,u=s[0];o<l;++o)i=s[o],u[1]<=n?i[1]>n&&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)<Tt?a>0?0:3:y(t[0]-n)<Tt?a>0?2:1:y(t[1]-r)<Tt?a>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){t<un&&(un=t);t>fn&&(fn=t);e<cn&&(cn=e);e>dn&&(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)<Tt||y(i-d)<Tt?(i+d)/2:Math.atan2(A,w),S=t(E,M),C=S[0],L=S[1],O=C-n,D=L-a,R=x*O-b*D;(R*R/_>e||y((b*O+x*D)/_-.5)>.3||o*h+l*p+u*g<r)&&(s(n,a,i,o,l,u,C,L,E,w/=k,A/=k,T,v,m),m.point(C,L),s(C,L,E,w,A,T,c,f,d,h,p,g,v,m))}}return a.precision=function(t){return arguments.length?(n=(e=t*t)>0&&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?a<i:a>i)&&(a+=o*Et)):(a=t+o*Et,i=t-.5*l);for(var u,c=a;o>0?c>i:c<i;c-=l)s.point((u=zr([r,-n*Math.cos(c),-n*Math.sin(c)]))[0],u[1])}}function Bn(t,e){var r=Or(e);r[0]-=t,Fr(r);var n=It(-r[1]);return((-r[2]<0?-n:n)+2*Math.PI-Tt)%(2*Math.PI)}function jn(e,r,n){var a=t.range(e,r-Tt,n).concat(r);return function(t){return a.map((function(e){return[t,e]}))}}function Un(e,r,n){var a=t.range(e,r-Tt,n).concat(r);return function(t){return a.map((function(e){return[e,t]}))}}function Vn(t){return t.source}function Hn(t){return t.target}t.geo.path=function(){var e,r,n,a,i,o=4.5;function s(e){return e&&("function"==typeof o&&a.pointRadius(+o.apply(this,arguments)),i&&i.valid||(i=n(a)),t.geo.stream(e,i)),a.result()}function l(){return i=null,s}return s.area=function(e){return sn=0,t.geo.stream(e,n(hn)),sn},s.centroid=function(e){return br=xr=_r=wr=Ar=Tr=kr=Mr=Er=0,t.geo.stream(e,n(bn)),Er?[kr/Er,Mr/Er]:Tr?[wr/Tr,Ar/Tr]:_r?[br/_r,xr/_r]:[NaN,NaN]},s.bounds=function(e){return fn=dn=-(un=cn=1/0),t.geo.stream(e,n(gn)),[[un,cn],[fn,dn]]},s.projection=function(t){return arguments.length?(n=(e=t)?t.stream||Mn(t):L,l()):e},s.context=function(t){return arguments.length?(a=null==(r=t)?new vn:new Tn(t),"function"!=typeof o&&a.pointRadius(o),l()):r},s.pointRadius=function(t){return arguments.length?(o="function"==typeof t?t:(a.pointRadius(+t),+t),s):o},s.projection(t.geo.albersUsa()).context(null)},t.geo.transform=function(t){return{stream:function(e){var r=new En(e);for(var n in t)r[n]=t[n];return r}}},En.prototype={point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}},t.geo.projection=Cn,t.geo.projectionMutator=Ln,(t.geo.equirectangular=function(){return Cn(Dn)}).raw=Dn.invert=Dn,t.geo.rotation=function(t){function e(e){return(e=t(e[0]*Lt,e[1]*Lt))[0]*=Ot,e[1]*=Ot,e}return t=In(t[0]%360*Lt,t[1]*Lt,t.length>2?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)<Tt)return Dn;function i(t,e){var r=a-e;return[r*Math.sin(n*t),a-r*Math.cos(n*t)]}return i.invert=function(t,e){var r=a-e;return[Math.atan2(t,r)/n,a-Dt(n)*Math.sqrt(t*t+r*r)]},i}(t.geo.azimuthalEquidistant=function(){return Cn(Wn)}).raw=Wn,(t.geo.conicConformal=function(){return an(Yn)}).raw=Yn,(t.geo.conicEquidistant=function(){return an(Zn)}).raw=Zn;var Jn=qn((function(t){return 1/t}),Math.atan);function Qn(t,e){return[t,Math.log(Math.tan(Mt/4+e/2))]}function $n(t){var e,r=Cn(t),n=r.scale,a=r.translate,i=r.clipExtent;return r.scale=function(){var t=n.apply(r,arguments);return t===r?e?r.clipExtent(null):r:t},r.translate=function(){var t=a.apply(r,arguments);return t===r?e?r.clipExtent(null):r:t},r.clipExtent=function(t){var o=i.apply(r,arguments);if(o===r){if(e=null==t){var s=Mt*n(),l=a();i([[l[0]-s,l[1]-s],[l[0]+s,l[1]+s]])}}else e&&(o=null);return o},r.clipExtent(null)}(t.geo.gnomonic=function(){return Cn(Jn)}).raw=Jn,Qn.invert=function(t,e){return[t,2*Math.atan(Math.exp(e))-Ct]},(t.geo.mercator=function(){return $n(Qn)}).raw=Qn;var Kn=qn((function(){return 1}),Math.asin);(t.geo.orthographic=function(){return Cn(Kn)}).raw=Kn;var ta=qn((function(t){return 1/(1+t)}),(function(t){return 2*Math.atan(t)}));function ea(t,e){return[Math.log(Math.tan(Mt/4+e/2)),-t]}function ra(t){return t[0]}function na(t){return t[1]}function aa(t){for(var e=t.length,r=[0,1],n=2,a=2;a<e;a++){for(;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<o;n++)s.push([+a.call(this,t[n],n),+i.call(this,t[n],n),n]);for(s.sort(ia),n=0;n<o;n++)l.push([s[n][0],-s[n][1]]);var u=aa(s),c=aa(l),f=c[0]===u[0],d=c[c.length-1]===u[u.length-1],h=[];for(n=u.length-1;n>=0;--n)h.push(t[s[u[n]][2]]);for(n=+f;n<c.length-d;++n)h.push(t[s[c[n]][2]]);return h}return n.x=function(t){return arguments.length?(e=t,n):e},n.y=function(t){return arguments.length?(r=t,n):r},n},t.geom.polygon=function(t){return U(t,oa),t};var oa=t.geom.polygon.prototype=[];function sa(t,e,r){return(r[0]-e[0])*(t[1]-e[1])<(r[1]-e[1])*(t[0]-e[0])}function la(t,e,r,n){var a=t[0],i=r[0],o=e[0]-a,s=n[0]-i,l=t[1],u=r[1],c=e[1]-l,f=n[1]-u,d=(s*(l-u)-f*(a-i))/(f*o-s*c);return[a+d*o,l+d*c]}function ua(t){var e=t[0],r=t[t.length-1];return!(e[0]-r[0]||e[1]-r[1])}oa.area=function(){for(var t,e=-1,r=this.length,n=this[r-1],a=0;++e<r;)t=n,n=this[e],a+=t[1]*n[0]-t[0]*n[1];return.5*a},oa.centroid=function(t){var e,r,n=-1,a=this.length,i=0,o=0,s=this[a-1];for(arguments.length||(t=-1/(6*this.area()));++n<a;)e=s,s=this[n],r=e[0]*s[1]-s[0]*e[1],i+=(e[0]+s[0])*r,o+=(e[1]+s[1])*r;return[i*t,o*t]},oa.clip=function(t){for(var e,r,n,a,i,o,s=ua(t),l=-1,u=this.length-ua(this),c=this[u-1];++l<u;){for(e=t.slice(),t.length=0,a=this[l],i=e[(n=e.length-s)-1],r=-1;++r<n;)sa(o=e[r],c,a)?(sa(i,c,a)||t.push(la(i,o,c,a)),t.push(o)):sa(i,c,a)&&t.push(la(i,o,c,a)),i=o;s&&t.push(t[0]),c=a}return t};var ca,fa,da,ha,pa,ga=[],va=[];function ma(){Fa(this),this.edge=this.site=this.circle=null}function ya(t){var e=ga.pop()||new ma;return e.site=t,e}function ba(t){Sa(t),da.remove(t),ga.push(t),Fa(t)}function xa(t){var e=t.circle,r=e.x,n=e.cy,a={x:r,y:n},i=t.P,o=t.N,s=[t];ba(t);for(var l=i;l.circle&&y(r-l.circle.x)<Tt&&y(n-l.circle.cy)<Tt;)i=l.P,s.unshift(l),ba(l),l=i;s.unshift(l),Sa(l);for(var u=o;u.circle&&y(r-u.circle.x)<Tt&&y(n-u.circle.cy)<Tt;)o=u.N,s.push(u),ba(u),u=o;s.push(u),Sa(u);var c,f=s.length;for(c=1;c<f;++c)u=s[c],l=s[c-1],Ra(u.edge,l.site,u.site,a);l=s[0],(u=s[f-1]).edge=Oa(l.site,u.site,null,a),Ea(l),Ea(u)}function _a(t){for(var e,r,n,a,i=t.x,o=t.y,s=da._;s;)if((n=wa(s,o)-i)>Tt)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<b.y||m.y===b.y&&m.x<=b.x){if(!b.L){y=b.P;break}b=b.L}else{if(!b.R){y=b;break}b=b.R}pa.insert(y,m),y||(ha=m)}}}}function Sa(t){var e=t.circle;e&&(e.P||(ha=e.N),pa.remove(e),va.push(e),Fa(e),t.circle=null)}function Ca(t,e){var r=t.b;if(r)return!0;var n,a,i=t.a,o=e[0][0],s=e[1][0],l=e[0][1],u=e[1][1],c=t.l,f=t.r,d=c.x,h=c.y,p=f.x,g=f.y,v=(d+p)/2,m=(h+g)/2;if(g===h){if(v<o||v>=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.y<l)return}else i={x:v,y:u};r={x:v,y:l}}}else if(a=m-(n=(d-p)/(g-h))*v,n<-1||n>1)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<l)return}else i={x:(u-a)/n,y:u};r={x:(l-a)/n,y:l}}else if(h<g){if(i){if(i.x>=s)return}else i={x:o,y:n*o+a};r={x:s,y:n*s+a}}else{if(i){if(i.x<o)return}else i={x:s,y:n*s+a};r={x:o,y:n*o+a}}return t.a=i,t.b=r,!0}function La(t,e){this.l=t,this.r=e,this.a=this.b=null}function Oa(t,e,r,n){var a=new La(t,e);return ca.push(a),r&&Ra(a,t,e,r),n&&Ra(a,e,t,n),fa[t.i].edges.push(new Ia(a,t,e)),fa[e.i].edges.push(new Ia(a,e,t)),a}function Da(t,e,r){var n=new La(t,null);return n.a=e,n.b=r,ca.push(n),n}function Ra(t,e,r,n){t.a||t.b?t.l===r?t.b=n:t.a=n:(t.a=n,t.l=e,t.r=r)}function Ia(t,e,r){var n=t.a,a=t.b;this.edge=t,this.site=e,this.angle=r?Math.atan2(r.y-e.y,r.x-e.x):t.l===e?Math.atan2(a.x-n.x,n.y-a.y):Math.atan2(n.x-a.x,a.y-n.y)}function Pa(){this._=null}function Fa(t){t.U=t.C=t.L=t.R=t.P=t.N=null}function za(t,e){var r=e,n=e.R,a=r.U;a?a.L===r?a.L=n:a.R=n:t._=n,n.U=a,r.U=n,r.R=n.L,r.R&&(r.R.U=r),n.L=r}function Na(t,e){var r=e,n=e.L,a=r.U;a?a.L===r?a.L=n:a.R=n:t._=n,n.U=a,r.U=n,r.L=n.R,r.L&&(r.L.U=r),n.R=r}function Ba(t){for(;t.L;)t=t.L;return t}function ja(t,e){var r,n,a,i=t.sort(Ua).pop();for(ca=[],fa=new Array(t.length),da=new Pa,pa=new Pa;;)if(a=ha,i&&(!a||i.y<a.y||i.y===a.y&&i.x<a.x))i.x===r&&i.y===n||(fa[i.i]=new Ta(i),_a(i),r=i.x,n=i.y),i=t.pop();else{if(!a)break;xa(a.arc)}e&&(function(t){for(var e,r=ca,n=rn(t[0][0],t[0][1],t[1][0],t[1][1]),a=r.length;a--;)(!Ca(e=r[a],t)||!n(e)||y(e.a.x-e.b.x)<Tt&&y(e.a.y-e.b.y)<Tt)&&(e.a=e.b=null,r.splice(a,1))}(e),function(t){for(var e,r,n,a,i,o,s,l,u,c,f=t[0][0],d=t[1][0],h=t[0][1],p=t[1][1],g=fa,v=g.length;v--;)if((i=g[v])&&i.prepare())for(l=(s=i.edges).length,o=0;o<l;)n=(c=s[o].end()).x,a=c.y,e=(u=s[++o%l].start()).x,r=u.y,(y(n-e)>Tt||y(a-r)>Tt)&&(s.splice(o,0,new Ia(Da(i.site,c,y(n-f)<Tt&&p-a>Tt?{x:f,y:y(e-f)<Tt?r:p}:y(a-p)<Tt&&d-n>Tt?{x:y(r-p)<Tt?e:d,y:p}:y(n-d)<Tt&&a-h>Tt?{x:d,y:y(e-d)<Tt?r:h}:y(a-h)<Tt&&n-f>Tt?{x:y(r-h)<Tt?e:f,y:h}:null),i.site,null)),++l)}(e));var o={cells:fa,edges:ca};return da=pa=ca=fa=null,o}function Ua(t,e){return e.y-t.y||e.x-t.x}Ta.prototype.prepare=function(){for(var t,e=this.edges,r=e.length;r--;)(t=e[r].edge).b&&t.a||e.splice(r,1);return e.sort(ka),e.length},Ia.prototype={start:function(){return this.edge.l===this.site?this.edge.a:this.edge.b},end:function(){return this.edge.l===this.site?this.edge.b:this.edge.a}},Pa.prototype={insert:function(t,e){var r,n,a;if(t){if(e.P=t,e.N=t.N,t.N&&(t.N.P=e),t.N=e,t.R){for(t=t.R;t.L;)t=t.L;t.L=e}else t.R=e;r=t}else this._?(t=Ba(this._),e.P=null,e.N=t,t.P=t.L=e,r=t):(e.P=e.N=null,this._=e,r=null);for(e.L=e.R=null,e.U=r,e.C=!0,t=e;r&&r.C;)r===(n=r.U).L?(a=n.R)&&a.C?(r.C=a.C=!1,n.C=!0,t=n):(t===r.R&&(za(this,r),r=(t=r).U),r.C=!1,n.C=!0,Na(this,n)):(a=n.L)&&a.C?(r.C=a.C=!1,n.C=!0,t=n):(t===r.L&&(Na(this,r),r=(t=r).U),r.C=!1,n.C=!0,za(this,n)),r=t.U;this._.C=!1},remove:function(t){t.N&&(t.N.P=t.P),t.P&&(t.P.N=t.N),t.N=t.P=null;var e,r,n,a=t.U,i=t.L,o=t.R;if(r=i?o?Ba(o):i:o,a?a.L===t?a.L=r:a.R=r:this._=r,i&&o?(n=r.C,r.C=t.C,r.L=i,i.U=r,r!==o?(a=r.U,r.U=t.U,t=r.R,a.L=t,r.R=o,o.U=r):(r.U=a,a=r,t=r.R)):(n=t.C,t=r),t&&(t.U=a),!n)if(t&&t.C)t.C=!1;else{do{if(t===this._)break;if(t===a.L){if((e=a.R).C&&(e.C=!1,a.C=!0,za(this,a),e=a.R),e.L&&e.L.C||e.R&&e.R.C){e.R&&e.R.C||(e.L.C=!1,e.C=!0,Na(this,e),e=a.R),e.C=a.C,a.C=e.R.C=!1,za(this,a),t=this._;break}}else if((e=a.L).C&&(e.C=!1,a.C=!0,Na(this,a),e=a.L),e.L&&e.L.C||e.R&&e.R.C){e.L&&e.L.C||(e.R.C=!1,e.C=!0,za(this,e),e=a.L),e.C=a.C,a.C=e.L.C=!1,Na(this,a),t=this._;break}e.C=!0,t=a,a=a.U}while(!t.C);t&&(t.C=!1)}}},t.geom.voronoi=function(t){var e=ra,r=na,n=e,a=r,i=Va;if(t)return o(t);function o(t){var e=new Array(t.length),r=i[0][0],n=i[0][1],a=i[1][0],o=i[1][1];return ja(s(t),i).cells.forEach((function(i,s){var l=i.edges,u=i.site;(e[s]=l.length?l.map((function(t){var e=t.start();return[e.x,e.y]})):u.x>=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;++c<f;)d,a=h,h=(d=u[c].edge).l===l?d.r:d.l,n<a.i&&n<h.i&&(o=a,s=h,((i=l).x-s.x)*(o.y-i.y)-(i.x-o.x)*(s.y-i.y)<0)&&e.push([t[n],t[a.i],t[h.i]])})),e},o.x=function(t){return arguments.length?(n=pe(e=t),o):e},o.y=function(t){return arguments.length?(a=pe(r=t),o):r},o.clipExtent=function(t){return arguments.length?(i=null==t?Va:t,o):i===Va?null:i},o.size=function(t){return arguments.length?o.clipExtent(t&&[[0,0],t]):i===Va?null:i&&i[1]},o};var Va=[[-1e6,-1e6],[1e6,1e6]];function Ha(t){return t.x}function Ga(t){return t.y}function qa(t,e,r,n,a,i){if(!t(e,r,n,a,i)){var o=.5*(r+a),s=.5*(n+i),l=e.nodes;l[0]&&qa(t,l[0],r,n,o,s),l[1]&&qa(t,l[1],o,n,a,s),l[2]&&qa(t,l[2],r,s,o,i),l[3]&&qa(t,l[3],o,s,a,i)}}function Xa(t,e,r,n,a,i,o){var s,l=1/0;return function t(u,c,f,d,h){if(!(c>i||f>o||d<n||h<a)){if(p=u.point){var p,g=e-u.x,v=r-u.y,m=g*g+v*v;if(m<l){var y=Math.sqrt(l=m);n=e-y,a=r-y,i=e+y,o=r+y,s=p}}for(var b=u.nodes,x=.5*(c+d),_=.5*(f+h),w=(r>=_)<<1|e>=x,A=w+4;w<A;++w)if(u=b[3&w])switch(3&w){case 0:t(u,c,f,x,_);break;case 1:t(u,x,f,d,_);break;case 2:t(u,c,_,x,h);break;case 3:t(u,x,_,d,h)}}}(t,n,a,i,o),s}function Wa(e,r){e=t.rgb(e),r=t.rgb(r);var n=e.r,a=e.g,i=e.b,o=r.r-n,s=r.g-a,l=r.b-i;return function(t){return"#"+se(Math.round(n+o*t))+se(Math.round(a+s*t))+se(Math.round(i+l*t))}}function Ya(t,e){var r,n={},a={};for(r in t)r in e?n[r]=Ka(t[r],e[r]):a[r]=t[r];for(r in e)r in t||(a[r]=e[r]);return function(t){for(r in n)a[r]=n[r](t);return a}}function Za(t,e){return t=+t,e=+e,function(r){return t*(1-r)+e*r}}function Ja(t,e){var r,n,a,i=Qa.lastIndex=$a.lastIndex=0,o=-1,s=[],l=[];for(t+="",e+="";(r=Qa.exec(t))&&(n=$a.exec(e));)(a=n.index)>i&&(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 i<e.length&&(a=e.slice(i),s[o]?s[o]+=a:s[++o]=a),s.length<2?l[0]?(e=l[0].x,function(t){return e(t)+""}):function(){return e}:(e=l.length,function(t){for(var r,n=0;n<e;++n)s[(r=l[n]).i]=r.x(t);return s.join("")})}t.geom.delaunay=function(e){return t.geom.voronoi().triangles(e)},t.geom.quadtree=function(t,e,r,n,a){var i,o=ra,s=na;if(i=arguments.length)return o=Ha,s=Ga,3===i&&(a=r,n=e,r=e=0),l(t);function l(t){var l,u,c,f,d,h,p,g,v,m=pe(o),b=pe(s);if(null!=e)h=e,p=r,g=n,v=a;else if(g=v=-(h=p=1/0),u=[],c=[],d=t.length,i)for(f=0;f<d;++f)(l=t[f]).x<h&&(h=l.x),l.y<p&&(p=l.y),l.x>g&&(g=l.x),l.y>v&&(v=l.y),u.push(l.x),c.push(l.y);else for(f=0;f<d;++f){var x=+m(l=t[f],f),_=+b(l,f);x<h&&(h=x),_<p&&(p=_),x>g&&(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<d;)T(M,t[f],u[f],c[f],h,p,g,v);--f}else t.forEach(M.add);return u=c=t=l=null,M}return l.x=function(t){return arguments.length?(o=t,l):o},l.y=function(t){return arguments.length?(s=t,l):s},l.extent=function(t){return arguments.length?(null==t?e=r=n=a=null:(e=+t[0][0],r=+t[0][1],n=+t[1][0],a=+t[1][1]),l):null==e?null:[[e,r],[n,a]]},l.size=function(t){return arguments.length?(null==t?e=r=n=a=null:(e=r=0,n=+t[0],a=+t[1]),l):null==e?null:[n-e,a-r]},l},t.interpolateRgb=Wa,t.interpolateObject=Ya,t.interpolateNumber=Za,t.interpolateString=Ja;var Qa=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,$a=new RegExp(Qa.source,"g");function Ka(e,r){for(var n,a=t.interpolators.length;--a>=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<s;++r)n.push(Ka(t[r],e[r]));for(;r<i;++r)a[r]=t[r];for(;r<o;++r)a[r]=e[r];return function(t){for(r=0;r<s;++r)a[r]=n[r](t);return a}}t.interpolate=Ka,t.interpolators=[function(t,e){var r=typeof e;return("string"===r?he.has(e.toLowerCase())||/^(#|rgb\(|hsl\()/i.test(e)?Wa:Ja:e instanceof Vt?Wa:Array.isArray(e)?ti:"object"===r&&isNaN(e)?Ya:Za)(t,e)}],t.interpolateArray=ti;var ei=function(){return L},ri=t.map({linear:ei,poly:function(t){return function(e){return Math.pow(e,t)}},quad:function(){return si},cubic:function(){return li},sin:function(){return ci},exp:function(){return fi},circle:function(){return di},elastic:function(t,e){var r;arguments.length<2&&(e=.45);arguments.length?r=e/Et*Math.asin(1/t):(t=1,r=e/4);return function(n){return 1+t*Math.pow(2,-10*n)*Math.sin((n-r)*Et/e)}},back:function(t){t||(t=1.70158);return function(e){return e*e*((t+1)*e-t)}},bounce:function(){return hi}}),ni=t.map({in:L,out:ii,"in-out":oi,"out-in":function(t){return oi(ii(t))}});function ai(t){return function(e){return e<=0?0:e>=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]<i[0]*a[1]&&(a[0]*=-1,a[1]*=-1,o*=-1,s*=-1),this.rotate=(o?Math.atan2(a[1],a[0]):Math.atan2(-i[0],i[1]))*Ot,this.translate=[t.e,t.f],this.scale=[o,l],this.skew=l?Math.atan2(s,l)*Ot:0}function vi(t,e){return t[0]*e[0]+t[1]*e[1]}function mi(t){var e=Math.sqrt(vi(t,t));return e&&(t[0]/=e,t[1]/=e),e}t.ease=function(t){var e=t.indexOf("-"),n=e>=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;++r<i;)n[(e=a[r]).i]=e.x(t);return n.join("")}}function _i(t,e){return e=(e-=t=+t)||1/e,function(r){return(r-t)/e}}function wi(t,e){return e=(e-=t=+t)||1/e,function(r){return Math.max(0,Math.min(1,(r-t)/e))}}function Ai(t){for(var e=t.source,r=t.target,n=function(t,e){if(t===e)return t;var r=Ti(t),n=Ti(e),a=r.pop(),i=n.pop(),o=null;for(;a===i;)o=a,a=r.pop(),i=n.pop();return o}(e,r),a=[e];e!==n;)e=e.parent,a.push(e);for(var i=a.length;r!==n;)a.splice(i,0,r),r=r.parent;return a}function Ti(t){for(var e=[],r=t.parent;null!=r;)e.push(t),t=r,r=r.parent;return e.push(t),e}function ki(t){t.fixed|=2}function Mi(t){t.fixed&=-7}function Ei(t){t.fixed|=4,t.px=t.x,t.py=t.y}function Si(t){t.fixed&=-5}t.interpolateTransform=xi,t.layout={},t.layout.bundle=function(){return function(t){for(var e=[],r=-1,n=t.length;++r<n;)e.push(Ai(t[r]));return e}},t.layout.chord=function(){var e,r,n,a,i,o,s,l={},u=0;function c(){var l,c,d,h,p,g={},v=[],m=t.range(a),y=[];for(e=[],r=[],l=0,h=-1;++h<a;){for(c=0,p=-1;++p<a;)c+=n[h][p];v.push(c),y.push(t.range(a)),l+=c}for(i&&m.sort((function(t,e){return i(v[t],v[e])})),o&&y.forEach((function(t,e){t.sort((function(t,r){return o(n[e][t],n[e][r])}))})),l=(Et-u*a)/l,c=0,h=-1;++h<a;){for(d=c,p=-1;++p<a;){var b=m[h],x=y[b][p],_=n[b][x],w=c,A=c+=_*l;g[b+"-"+x]={index:b,subindex:x,startAngle:w,endAngle:A,value:_}}r[b]={index:b,startAngle:d,endAngle:c,value:v[b]},c+=u}for(h=-1;++h<a;)for(p=h-1;++p<a;){var T=g[h+"-"+p],k=g[p+"-"+h];(T.value||k.value)&&e.push(T.value<k.value?{source:k,target:T}:{source:T,target:k})}s&&f()}function f(){e.sort((function(t,e){return s((t.source.value+t.target.value)/2,(e.source.value+e.target.value)/2)}))}return l.matrix=function(t){return arguments.length?(a=(n=t)&&n.length,e=r=null,l):n},l.padding=function(t){return arguments.length?(u=t,e=r=null,l):u},l.sortGroups=function(t){return arguments.length?(i=t,e=r=null,l):i},l.sortSubgroups=function(t){return arguments.length?(o=t,e=null,l):o},l.sortChords=function(t){return arguments.length?(s=t,e&&f(),l):s},l.chords=function(){return e||c(),e},l.groups=function(){return r||c(),r},l},t.layout.force=function(){var e,r,n,a,i,o,s={},l=t.dispatch("start","tick","end"),u=[1,1],c=.9,f=Ci,d=Li,h=-30,p=Oi,g=.1,v=.64,m=[],y=[];function b(t){return function(e,r,n,a){if(e.point!==t){var i=e.cx-t.x,o=e.cy-t.y,s=a-r,l=i*i+o*o;if(s*s/v<l){if(l<p){var u=e.charge/l;t.px-=i*u,t.py-=o*u}return!0}if(e.point&&l&&l<p){u=e.pointCharge/l;t.px-=i*u,t.py-=o*u}}return!e.charge}}function x(e){e.px=t.event.x,e.py=t.event.y,s.resume()}return s.tick=function(){if((n*=.99)<.005)return e=null,l.end({type:"end",alpha:n=0}),!0;var r,s,f,d,p,v,x,_,w,A=m.length,T=y.length;for(s=0;s<T;++s)d=(f=y[s]).source,(v=(_=(p=f.target).x-d.x)*_+(w=p.y-d.y)*w)&&(_*=v=n*i[s]*((v=Math.sqrt(v))-a[s])/v,w*=v,p.x-=_*(x=d.weight+p.weight?d.weight/(d.weight+p.weight):.5),p.y-=w*x,d.x+=_*(x=1-x),d.y+=w*x);if((x=n*g)&&(_=u[0]/2,w=u[1]/2,s=-1,x))for(;++s<A;)(f=m[s]).x+=(_-f.x)*x,f.y+=(w-f.y)*x;if(h)for(!function t(e,r,n){var a=0,i=0;if(e.charge=0,!e.leaf)for(var o,s=e.nodes,l=s.length,u=-1;++u<l;)null!=(o=s[u])&&(t(o,r,n),e.charge+=o.charge,a+=o.charge*o.cx,i+=o.charge*o.cy);if(e.point){e.leaf||(e.point.x+=Math.random()-.5,e.point.y+=Math.random()-.5);var c=r*n[e.point.index];e.charge+=e.pointCharge=c,a+=c*e.point.x,i+=c*e.point.y}e.cx=a/e.charge,e.cy=i/e.charge}(r=t.geom.quadtree(m),n,o),s=-1;++s<A;)(f=m[s]).fixed||r.visit(b(f));for(s=-1;++s<A;)(f=m[s]).fixed?(f.x=f.px,f.y=f.py):(f.x-=(f.px-(f.px=f.x))*c,f.y-=(f.py-(f.py=f.y))*c);l.tick({type:"tick",alpha:n})},s.nodes=function(t){return arguments.length?(m=t,s):m},s.links=function(t){return arguments.length?(y=t,s):y},s.size=function(t){return arguments.length?(u=t,s):u},s.linkDistance=function(t){return arguments.length?(f="function"==typeof t?t:+t,s):f},s.distance=s.linkDistance,s.linkStrength=function(t){return arguments.length?(d="function"==typeof t?t:+t,s):d},s.friction=function(t){return arguments.length?(c=+t,s):c},s.charge=function(t){return arguments.length?(h="function"==typeof t?t:+t,s):h},s.chargeDistance=function(t){return arguments.length?(p=t*t,s):Math.sqrt(p)},s.gravity=function(t){return arguments.length?(g=+t,s):g},s.theta=function(t){return arguments.length?(v=t*t,s):Math.sqrt(v)},s.alpha=function(t){return arguments.length?(t=+t,n?t>0?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<n;++t)(r=m[t]).index=t,r.weight=0;for(t=0;t<l;++t)"number"==typeof(r=y[t]).source&&(r.source=m[r.source]),"number"==typeof r.target&&(r.target=m[r.target]),++r.source.weight,++r.target.weight;for(t=0;t<n;++t)r=m[t],isNaN(r.x)&&(r.x=g("x",c)),isNaN(r.y)&&(r.y=g("y",p)),isNaN(r.px)&&(r.px=r.x),isNaN(r.py)&&(r.py=r.y);if(a=[],"function"==typeof f)for(t=0;t<l;++t)a[t]=+f.call(this,y[t],t);else for(t=0;t<l;++t)a[t]=f;if(i=[],"function"==typeof d)for(t=0;t<l;++t)i[t]=+d.call(this,y[t],t);else for(t=0;t<l;++t)i[t]=d;if(o=[],"function"==typeof h)for(t=0;t<n;++t)o[t]=+h.call(this,m[t],t);else for(t=0;t<n;++t)o[t]=h;function g(r,a){if(!e){for(e=new Array(n),u=0;u<n;++u)e[u]=[];for(u=0;u<l;++u){var i=y[u];e[i.source.index].push(i.target),e[i.target.index].push(i.source)}}for(var o,s=e[t],u=-1,c=s.length;++u<c;)if(!isNaN(o=s[u][r]))return o;return Math.random()*a}return s.resume()},s.resume=function(){return s.alpha(.1)},s.stop=function(){return s.alpha(0)},s.drag=function(){if(r||(r=t.behavior.drag().origin(L).on("dragstart.force",ki).on("drag.force",x).on("dragend.force",Mi)),!arguments.length)return r;this.on("mouseover.force",Ei).on("mouseout.force",Si).call(r)},t.rebind(s,l,"on")};var Ci=20,Li=1,Oi=1/0;function Di(e,r){return t.rebind(e,r,"sort","children","value"),e.nodes=e,e.links=Ni,e}function Ri(t,e){for(var r=[t];null!=(t=r.pop());)if(e(t),(a=t.children)&&(n=a.length))for(var n,a;--n>=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<a;)r.push(i[o]);for(;null!=(t=n.pop());)e(t)}function Pi(t){return t.children}function Fi(t){return t.value}function zi(t,e){return e.value-t.value}function Ni(e){return t.merge(e.map((function(t){return(t.children||[]).map((function(e){return{source:t,target:e}}))})))}t.layout.hierarchy=function(){var t=zi,e=Pi,r=Fi;function n(a){var i,o=[a],s=[];for(a.depth=0;null!=(i=o.pop());)if(s.push(i),(u=e.call(n,i,i.depth))&&(l=u.length)){for(var l,u,c;--l>=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;++u<o;)t(s=i[u],r,l=s.value*n,a),r+=l}}(a[0],0,r[0],r[1]/function t(e){var r=e.children,n=0;if(r&&(a=r.length))for(var a,i=-1;++i<a;)n=Math.max(n,t(r[i]));return 1+n}(a[0])),a}return n.size=function(t){return arguments.length?(r=t,n):r},Di(n,e)},t.layout.pie=function(){var e=Number,r=Bi,n=0,a=Et,i=0;function o(s){var l,u=s.length,c=s.map((function(t,r){return+e.call(o,t,r)})),f=+("function"==typeof n?n.apply(this,arguments):n),d=("function"==typeof a?a.apply(this,arguments):a)-f,h=Math.min(Math.abs(d)/u,+("function"==typeof i?i.apply(this,arguments):i)),p=h*(d<0?-1:1),g=t.sum(c),v=g?(d-u*p)/g:0,m=t.range(u),y=[];return null!=r&&m.sort(r===Bi?function(t,e){return c[e]-c[t]}:function(t,e){return r(s[t],s[e])}),m.forEach((function(t){y[t]={data:s[t],value:l=c[t],startAngle:f,endAngle:f+=l*v+p,padAngle:h}})),y}return o.value=function(t){return arguments.length?(e=t,o):e},o.sort=function(t){return arguments.length?(r=t,o):r},o.startAngle=function(t){return arguments.length?(n=t,o):n},o.endAngle=function(t){return arguments.length?(a=t,o):a},o.padAngle=function(t){return arguments.length?(i=t,o):i},o};var Bi={};function ji(t){return t.x}function Ui(t){return t.y}function Vi(t,e,r){t.y0=e,t.y=r}t.layout.stack=function(){var e=L,r=qi,n=Xi,a=Vi,i=ji,o=Ui;function s(l,u){if(!(h=l.length))return l;var c=l.map((function(t,r){return e.call(s,t,r)})),f=c.map((function(t){return t.map((function(t,e){return[i.call(s,t,e),o.call(s,t,e)]}))})),d=r.call(s,f,u);c=t.permute(c,d),f=t.permute(f,d);var h,p,g,v,m=n.call(s,f,u),y=c[0].length;for(g=0;g<y;++g)for(a.call(s,c[0][g],v=m[g],f[0][g][1]),p=1;p<h;++p)a.call(s,c[p][g],v+=f[p-1][g][1],f[p][g][1]);return l}return s.values=function(t){return arguments.length?(e=t,s):e},s.order=function(t){return arguments.length?(r="function"==typeof t?t:Hi.get(t)||qi,s):r},s.offset=function(t){return arguments.length?(n="function"==typeof t?t:Gi.get(t)||Xi,s):n},s.x=function(t){return arguments.length?(i=t,s):i},s.y=function(t){return arguments.length?(o=t,s):o},s.out=function(t){return arguments.length?(a=t,s):a},s};var Hi=t.map({"inside-out":function(e){var r,n,a=e.length,i=e.map(Wi),o=e.map(Yi),s=t.range(a).sort((function(t,e){return i[t]-i[e]})),l=0,u=0,c=[],f=[];for(r=0;r<a;++r)n=s[r],l<u?(l+=o[n],c.push(n)):(u+=o[n],f.push(n));return f.reverse().concat(c)},reverse:function(e){return t.range(e.length).reverse()},default:qi}),Gi=t.map({silhouette:function(t){var e,r,n,a=t.length,i=t[0].length,o=[],s=0,l=[];for(r=0;r<i;++r){for(e=0,n=0;e<a;e++)n+=t[e][r][1];n>s&&(s=n),o.push(n)}for(r=0;r<i;++r)l[r]=(s-o[r])/2;return l},wiggle:function(t){var e,r,n,a,i,o,s,l,u,c=t.length,f=t[0],d=f.length,h=[];for(h[0]=l=u=0,r=1;r<d;++r){for(e=0,a=0;e<c;++e)a+=t[e][r][1];for(e=0,i=0,s=f[r][0]-f[r-1][0];e<c;++e){for(n=0,o=(t[e][r][1]-t[e][r-1][1])/(2*s);n<e;++n)o+=(t[n][r][1]-t[n][r-1][1])/s;i+=o*t[e][r][1]}h[r]=l-=a?i/a*s:0,l<u&&(u=l)}for(r=0;r<d;++r)h[r]-=u;return h},expand:function(t){var e,r,n,a=t.length,i=t[0].length,o=1/a,s=[];for(r=0;r<i;++r){for(e=0,n=0;e<a;e++)n+=t[e][r][1];if(n)for(e=0;e<a;e++)t[e][r][1]/=n;else for(e=0;e<a;e++)t[e][r][1]=o}for(r=0;r<i;++r)s[r]=0;return s},zero:Xi});function qi(e){return t.range(e.length)}function Xi(t){for(var e=-1,r=t[0].length,n=[];++e<r;)n[e]=0;return n}function Wi(t){for(var e,r=1,n=0,a=t[0][1],i=t.length;r<i;++r)(e=t[r][1])>a&&(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;i<l;i++){oo(r,n,a=e[i]);var h=0,p=1,g=1;for(o=n._pack_next;o!==n;o=o._pack_next,p++)if(ro(o,a)){h=1;break}if(1==h)for(s=r._pack_prev;s!==o._pack_prev&&!ro(s,a);s=s._pack_prev,g++);h?(p<g||p==g&&n.r<r.r?eo(r,n=o):eo(r=s,n),i--):(to(r,a),n=a,b(a))}var v=(u+c)/2,m=(f+d)/2,y=0;for(i=0;i<l;i++)(a=e[i]).x-=v,a.y-=m,y=Math.max(y,a.r+Math.sqrt(a.x*a.x+a.y*a.y));t.r=y,e.forEach(io)}function b(t){u=Math.min(t.x-t.r,u),c=Math.max(t.x+t.r,c),f=Math.min(t.y-t.r,f),d=Math.max(t.y+t.r,d)}}function ao(t){t._pack_next=t._pack_prev=t}function io(t){delete t._pack_next,delete t._pack_prev}function oo(t,e,r){var n=t.r+r.r,a=e.x-t.x,i=e.y-t.y;if(n&&(a||i)){var o=e.r+r.r,s=a*a+i*i,l=.5+((n*=n)-(o*=o))/(2*s),u=Math.sqrt(Math.max(0,2*o*(n+s)-(n-=s)*n-o*o))/(2*s);r.x=t.x+l*a+u*i,r.y=t.y+l*i-u*a}else r.x=t.x+n,r.y=t.y}function so(t,e){return t.parent==e.parent?1:2}function lo(t){var e=t.children;return e.length?e[0]:t.t}function uo(t){var e,r=t.children;return(e=r.length)?r[e-1]:t.t}function co(t,e,r){var n=r/(e.i-t.i);e.c-=n,e.s+=r,t.c+=n,e.z+=r,e.m+=r}function fo(t,e,r){return t.a.parent===e.parent?t.a:r}function ho(t){return{x:t.x,y:t.y,dx:t.dx,dy:t.dy}}function po(t,e){var r=t.x+e[3],n=t.y+e[0],a=t.dx-e[1]-e[3],i=t.dy-e[0]-e[2];return a<0&&(r+=a/2,a=0),i<0&&(n+=i/2,i=0),{x:r,y:n,dx:a,dy:i}}function go(t){var e=t[0],r=t[t.length-1];return e<r?[e,r]:[r,e]}function vo(t){return t.rangeExtent?t.rangeExtent():go(t.range())}function mo(t,e,r,n){var a=r(t[0],t[1]),i=n(e[0],e[1]);return function(t){return i(a(t))}}function yo(t,e){var r,n=0,a=t.length-1,i=t[n],o=t[a];return o<i&&(r=n,n=a,a=r,r=i,i=o,o=r),t[n]=e.floor(i),t[a]=e.ceil(o),t}function bo(t){return t?{floor:function(e){return Math.floor(e/t)*t},ceil:function(e){return Math.ceil(e/t)*t}}:xo}t.layout.histogram=function(){var e=!0,r=Number,n=$i,a=Ji;function i(i,o){for(var s,l,u=[],c=i.map(r,this),f=n.call(this,c,o),d=a.call(this,f,c,o),h=(o=-1,c.length),p=d.length-1,g=e?1:1/h;++o<p;)(s=u[o]=[]).dx=d[o+1]-(s.x=d[o]),s.y=0;if(p>0)for(o=-1;++o<h;)(l=c[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;++o<s;)t(i[o],r,n,a)}(s,l/2,u/2,e?1:1/Math.max(2*s.r/l,2*s.r/u)),o}return i.size=function(t){return arguments.length?(a=t,i):a},i.radius=function(t){return arguments.length?(e=null==t||"function"==typeof t?t:+t,i):e},i.padding=function(t){return arguments.length?(n=+t,i):n},Di(i,r)},t.layout.tree=function(){var e=t.layout.hierarchy().sort(null).value(null),r=so,n=[1,1],a=null;function i(t,i){var u=e.call(this,t,i),c=u[0],f=function(t){var e,r={A:null,children:[t]},n=[r];for(;null!=(e=n.pop());)for(var a,i=e.children,o=0,s=i.length;o<s;++o)n.push((i[o]=a={_:i[o],parent:e,children:(a=i[o].children)&&a.slice()||[],A:null,a:null,z:0,m:0,c:0,s:0,t:null,i:o}).a=a);return r.children[0]}(c);if(Ii(f,o),f.parent.m=-f.z,Ri(f,s),a)Ri(c,l);else{var d=c,h=c,p=c;Ri(c,(function(t){t.x<d.x&&(d=t),t.x>h.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;++a<i;)n=(r=t[a]).value*(e<0?0:e),r.area=isNaN(n)||n<=0?0:n}function f(t){var e=t.children;if(e&&e.length){var r,n,a,i=o(t),s=[],u=e.slice(),d=1/0,g="slice"===l?i.dx:"dice"===l?i.dy:"slice-dice"===l?1&t.depth?i.dy:i.dx:Math.min(i.dx,i.dy);for(c(u,i.dx*i.dy/t.value),s.area=0;(a=u.length)>0;)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;++o<s;)(r=t[o].area)&&(r<i&&(i=r),r>a&&(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);++o<s;)(i=t[o]).x=l,i.y=u,i.dy=c,l+=i.dx=Math.min(r.x+r.dx-l,c?n(i.area/c):0);i.z=!0,i.dx+=r.x+r.dx-l,r.y+=c,r.dy-=c}else{for((a||c>r.dx)&&(c=r.dx);++o<s;)(i=t[o]).x=l,i.y=u,i.dx=c,u+=i.dy=Math.min(r.y+r.dy-u,c?n(i.area/c):0);i.z=!1,i.dy+=r.y+r.dy-u,r.x+=c,r.dx-=c}}function g(t){var n=e||r(t),i=n[0];return i.x=i.y=0,i.value?(i.dx=a[0],i.dy=a[1]):i.dx=i.dy=0,e&&r.revalue(i),c([i],i.dx*i.dy/i.value),(e?d:f)(i),s&&(e=n),n}return g.size=function(t){return arguments.length?(a=t,g):a},g.padding=function(t){if(!arguments.length)return i;function e(e){var r=t.call(g,e,e.depth);return null==r?ho(e):po(e,"number"==typeof r?[r,r,r,r]:r)}function r(e){return po(e,t)}var n;return o=null==(i=t)?ho:"function"==(n=typeof t)?e:"number"===n?(t=[t,t,t,t],r):r,g},g.round=function(t){return arguments.length?(n=t?Math.round:Number,g):n!=Number},g.sticky=function(t){return arguments.length?(s=t,e=null,g):s},g.ratio=function(t){return arguments.length?(u=t,g):u},g.mode=function(t){return arguments.length?(l=t+"",g):l},Di(g,r)},t.random={normal:function(t,e){var r=arguments.length;return r<2&&(e=1),r<1&&(t=0),function(){var r,n,a;do{a=(r=2*Math.random()-1)*r+(n=2*Math.random()-1)*n}while(!a||a>1);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;r<t;r++)e+=Math.random();return e}}},t.scale={};var xo={floor:L,ceil:L};function _o(e,r,n,a){var i=[],o=[],s=0,l=Math.min(e.length,r.length)-1;for(e[l]<e[0]&&(e=e.slice().reverse(),r=r.slice().reverse());++s<=l;)i.push(n(e[s-1],e[s])),o.push(a(r[s-1],r[s]));return function(r){var n=t.bisect(e,r,1,l)-1;return o[n](i[n](r))}}function wo(e,r){return t.rebind(e,r,"range","rangeRound","interpolate","clamp")}function Ao(t,e){return yo(t,bo(To(t,e)[2])),yo(t,bo(To(t,e)[2])),t}function To(t,e){null==e&&(e=10);var r=go(t),n=r[1]-r[0],a=Math.pow(10,Math.floor(Math.log(n/e)/Math.LN10)),i=e/n*a;return i<=.15?a*=10:i<=.35?a*=5:i<=.75&&(a*=2),r[0]=Math.ceil(r[0]/a)*a,r[1]=Math.floor(r[1]/a)*a+.5*a,r[2]=a,r}function ko(e,r){return t.range.apply(t,To(e,r))}function Mo(e,r,n){var a=To(e,r);if(n){var i=Ce.exec(n);if(i.shift(),"s"===i[8]){var o=t.formatPrefix(Math.max(y(a[0]),y(a[1])));return i[7]||(i[7]="."+So(o.scale(a[2]))),i[8]="f",n=t.format(i.join("")),function(t){return n(o.scale(t))+o.symbol}}i[7]||(i[7]="."+function(t,e){var r=So(e[2]);return t in Eo?Math.abs(r-So(Math.max(y(e[0]),y(e[1]))))+ +("e"!==t):r-2*("%"===t)}(i[8],a)),n=i.join("")}else n=",."+So(a[2])+"f";return t.format(n)}t.scale.linear=function(){return function t(e,r,n,a){var i,o;function s(){var t=Math.min(e.length,r.length)>2?_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(;u<c;u++)for(var d=1;d<f;d++)e.push(s(u)*d);e.push(s(u))}else for(e.push(s(u));u++<c;)for(d=f-1;d>0;d--)e.push(s(u)*d);for(u=0;e[u]<r;u++);for(c=e.length;e[c-1]>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*n<n-.5&&(e*=n),e<=a?r(t):""}},l.copy=function(){return e(r.copy(),n,a,i)},wo(l,r)}(t.scale.linear().domain([0,1]),10,!0,[1,10])};var Co=t.format(".0e"),Lo={floor:function(t){return-Math.ceil(-t)},ceil:function(t){return-Math.floor(-t)}};function Oo(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}t.scale.pow=function(){return function t(e,r,n){var a=Oo(r),i=Oo(1/r);function o(t){return e(a(t))}return o.invert=function(t){return i(e.invert(t))},o.domain=function(t){return arguments.length?(e.domain((n=t.map(Number)).map(a)),o):n},o.ticks=function(t){return ko(n,t)},o.tickFormat=function(t,e){return Mo(n,t,e)},o.nice=function(t){return o.domain(Ao(n,t))},o.exponent=function(t){return arguments.length?(a=Oo(r=t),i=Oo(1/r),e.domain(n.map(a)),o):r},o.copy=function(){return t(e.copy(),r,n)},wo(o,e)}(t.scale.linear(),1,[0,1])},t.scale.sqrt=function(){return t.scale.pow().exponent(.5)},t.scale.ordinal=function(){return function e(r,n){var a,i,o;function s(t){return i[((a.get(t)||("range"===n.t?a.set(t,r.push(t)):NaN))-1)%i.length]}function l(e,n){return t.range(r.length).map((function(t){return e+n*t}))}return s.domain=function(t){if(!arguments.length)return r;r=[],a=new _;for(var e,i=-1,o=t.length;++i<o;)a.has(e=t[i])||a.set(e,r.push(e));return s[n.t].apply(s,n.a)},s.range=function(t){return arguments.length?(i=t,o=0,n={t:"range",a:arguments},s):i},s.rangePoints=function(t,e){arguments.length<2&&(e=0);var a=t[0],u=t[1],c=r.length<2?(a=(a+u)/2,0):(u-a)/(r.length-1+e);return i=l(a+c*e/2,c),o=0,n={t:"rangePoints",a:arguments},s},s.rangeRoundPoints=function(t,e){arguments.length<2&&(e=0);var a=t[0],u=t[1],c=r.length<2?(a=u=Math.round((a+u)/2),0):(u-a)/(r.length-1+e)|0;return i=l(a+Math.round(c*e/2+(u-a-(r.length-1+e)*c)/2),c),o=0,n={t:"rangeRoundPoints",a:arguments},s},s.rangeBands=function(t,e,a){arguments.length<2&&(e=0),arguments.length<3&&(a=e);var u=t[1]<t[0],c=t[u-0],f=t[1-u],d=(f-c)/(r.length-e+2*a);return i=l(c+d*a,d),u&&i.reverse(),o=d*(1-e),n={t:"rangeBands",a:arguments},s},s.rangeRoundBands=function(t,e,a){arguments.length<2&&(e=0),arguments.length<3&&(a=e);var u=t[1]<t[0],c=t[u-0],f=t[1-u],d=Math.floor((f-c)/(r.length-e+2*a));return i=l(c+Math.round((f-c-(r.length-e)*d)/2),d),u&&i.reverse(),o=Math.round(d*(1-e)),n={t:"rangeRoundBands",a:arguments},s},s.rangeBand=function(){return o},s.rangeExtent=function(){return go(n.a[0])},s.copy=function(){return e(r,n)},s.domain(r)}([],{t:"range",a:[[]]})},t.scale.category10=function(){return t.scale.ordinal().range(Do)},t.scale.category20=function(){return t.scale.ordinal().range(Ro)},t.scale.category20b=function(){return t.scale.ordinal().range(Io)},t.scale.category20c=function(){return t.scale.ordinal().range(Po)};var Do=[2062260,16744206,2924588,14034728,9725885,9197131,14907330,8355711,12369186,1556175].map(ie),Ro=[2062260,11454440,16744206,16759672,2924588,10018698,14034728,16750742,9725885,12955861,9197131,12885140,14907330,16234194,8355711,13092807,12369186,14408589,1556175,10410725].map(ie),Io=[3750777,5395619,7040719,10264286,6519097,9216594,11915115,13556636,9202993,12426809,15186514,15190932,8666169,11356490,14049643,15177372,8077683,10834324,13528509,14589654].map(ie),Po=[3244733,7057110,10406625,13032431,15095053,16616764,16625259,16634018,3253076,7652470,10607003,13101504,7695281,10394312,12369372,14342891,6513507,9868950,12434877,14277081].map(ie);function Fo(){return 0}t.scale.quantile=function(){return function e(r,n){var a;function i(){var e=0,i=n.length;for(a=[];++e<i;)a[e-1]=t.quantile(r,e/i);return o}function o(e){if(!isNaN(e=+e))return n[t.bisect(a,e)]}return o.domain=function(t){return arguments.length?(r=t.map(h).filter(p).sort(d),i()):r},o.range=function(t){return arguments.length?(n=t,i()):n},o.quantiles=function(){return a},o.invertExtent=function(t){return(t=n.indexOf(t))<0?[NaN,NaN]:[t>0?a[t-1]:r[0],t<a.length?a[t]:r[r.length-1]]},o.copy=function(){return e(r,n)},i()}([],[])},t.scale.quantize=function(){return function t(e,r,n){var a,i;function o(t){return n[Math.max(0,Math.min(i,Math.floor(a*(t-e))))]}function s(){return a=n.length/(r-e),i=n.length-1,o}return o.domain=function(t){return arguments.length?(e=+t[0],r=+t[t.length-1],s()):[e,r]},o.range=function(t){return arguments.length?(n=t,s()):n},o.invertExtent=function(t){return[t=(t=n.indexOf(t))<0?NaN:t/a+e,t+1/a]},o.copy=function(){return t(e,r,n)},s()}(0,1,[0,1])},t.scale.threshold=function(){return function e(r,n){function a(e){if(e<=e)return n[t.bisect(r,e)]}return a.domain=function(t){return arguments.length?(r=t,a):r},a.range=function(t){return arguments.length?(n=t,a):n},a.invertExtent=function(t){return t=n.indexOf(t),[r[t-1],r[t]]},a.copy=function(){return e(r,n)},a}([.5],[0,1])},t.scale.identity=function(){return function t(e){function r(t){return+t}return r.invert=r,r.domain=r.range=function(t){return arguments.length?(e=t.map(r),r):e},r.ticks=function(t){return ko(e,t)},r.tickFormat=function(t,r){return Mo(e,t,r)},r.copy=function(){return t(e)},r}([0,1])},t.svg={},t.svg.arc=function(){var t=No,e=Bo,r=Fo,n=zo,a=jo,i=Uo,o=Vo;function s(){var s=Math.max(0,+t.apply(this,arguments)),u=Math.max(0,+e.apply(this,arguments)),c=a.apply(this,arguments)-Ct,f=i.apply(this,arguments)-Ct,d=Math.abs(f-c),h=c>f?0:1;if(u<s&&(p=u,u=s,s=p),d>=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=s<u^h?0:1;var R=p,I=p;if(d<Mt){var P=null==T?[w,A]:null==x?[y,b]:la([y,b],[T,k],[x,_],[w,A]),F=y-P[0],z=b-P[1],N=x-P[0],B=_-P[1],j=1/Math.sin(Math.acos((F*N+z*B)/(Math.sqrt(F*F+z*z)*Math.sqrt(N*N+B*B)))/2),U=Math.sqrt(P[0]*P[0]+P[1]*P[1]);I=Math.min(p,(s-U)/(j-1)),R=Math.min(p,(u-U)/(j+1))}if(null!=x){var V=Go(null==T?[w,A]:[T,k],[y,b],u,R,h),H=Go([x,_],[w,A],u,R,h);p===R?S.push("M",V[0],"A",R,",",R," 0 0,",g," ",V[1],"A",u,",",u," 0 ",1-h^Ho(V[1][0],V[1][1],H[1][0],H[1][1]),",",h," ",H[1],"A",R,",",R," 0 0,",g," ",H[0]):S.push("M",V[0],"A",R,",",R," 0 1,",g," ",H[0])}else S.push("M",y,",",b);if(null!=T){var G=Go([y,b],[T,k],s,-I,h),q=Go([w,A],null==x?[y,b]:[x,_],s,-I,h);p===I?S.push("L",q[0],"A",I,",",I," 0 0,",g," ",q[1],"A",s,",",s," 0 ",h^Ho(q[1][0],q[1][1],G[1][0],G[1][1]),",",1-h," ",G[1],"A",I,",",I," 0 0,",g," ",G[0]):S.push("L",q[0],"A",I,",",I," 0 0,",g," ",G[0])}else S.push("L",w,",",A)}else S.push("M",y,",",b),null!=x&&S.push("A",u,",",u," 0 ",C,",",h," ",x,",",_),S.push("L",w,",",A),null!=T&&S.push("A",s,",",s," 0 ",O,",",1-h," ",T,",",k);return S.push("Z"),S.join("")}function l(t,e){return"M0,"+t+"A"+t+","+t+" 0 1,"+e+" 0,"+-t+"A"+t+","+t+" 0 1,"+e+" 0,"+t}return s.innerRadius=function(e){return arguments.length?(t=pe(e),s):t},s.outerRadius=function(t){return arguments.length?(e=pe(t),s):e},s.cornerRadius=function(t){return arguments.length?(r=pe(t),s):r},s.padRadius=function(t){return arguments.length?(n=t==zo?zo:pe(t),s):n},s.startAngle=function(t){return arguments.length?(a=pe(t),s):a},s.endAngle=function(t){return arguments.length?(i=pe(t),s):i},s.padAngle=function(t){return arguments.length?(o=pe(t),s):o},s.centroid=function(){var r=(+t.apply(this,arguments)+ +e.apply(this,arguments))/2,n=(+a.apply(this,arguments)+ +i.apply(this,arguments))/2-Ct;return[Math.cos(n)*r,Math.sin(n)*r]},s};var zo="auto";function No(t){return t.innerRadius}function Bo(t){return t.outerRadius}function jo(t){return t.startAngle}function Uo(t){return t.endAngle}function Vo(t){return t&&t.padAngle}function Ho(t,e,r,n){return(t-r)*e-(e-n)*t>0?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(;++c<f;)n.call(this,s=i[c],c)?u.push([+d.call(this,s,c),+h.call(this,s,c)]):u.length&&(p(),u=[]);return u.length&&p(),l.length?l.join(""):null}return s.x=function(t){return arguments.length?(e=t,s):e},s.y=function(t){return arguments.length?(r=t,s):r},s.defined=function(t){return arguments.length?(n=t,s):n},s.interpolate=function(t){return arguments.length?(i="function"==typeof t?a=t:(a=Xo.get(t)||Wo).key,s):i},s.tension=function(t){return arguments.length?(o=t,s):o},s}t.svg.line=function(){return qo(L)};var Xo=t.map({linear:Wo,"linear-closed":Yo,step:function(t){var e=0,r=t.length,n=t[0],a=[n[0],",",n[1]];for(;++e<r;)a.push("H",(n[0]+(n=t[e])[0])/2,"V",n[1]);r>1&&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(;++n<a;)e=t[n],i.shift(),i.push(e[0]),o.shift(),o.push(e[1]),as(r,i,o);return r.join("")},"basis-closed":function(t){var e,r,n=-1,a=t.length,i=a+4,o=[],s=[];for(;++n<4;)r=t[n%a],o.push(r[0]),s.push(r[1]);e=[ts(ns,o),",",ts(ns,s)],--n;for(;++n<i;)r=t[n%a],o.shift(),o.push(r[0]),s.shift(),s.push(r[1]),as(e,o,s);return e.join("")},bundle:function(t,e){var r=t.length-1;if(r)for(var n,a,i=t[0][0],o=t[0][1],s=t[r][0]-i,l=t[r][1]-o,u=-1;++u<=r;)n=t[u],a=u/r,n[0]=e*n[0]+(1-e)*(i+a*s),n[1]=e*n[1]+(1-e)*(o+a*l);return Ko(t)},cardinal:function(t,e){return t.length<3?Wo(t):t[0]+Qo(t,$o(t,e))},"cardinal-open":function(t,e){return t.length<4?Wo(t):t[1]+Qo(t.slice(1,-1),$o(t,e))},"cardinal-closed":function(t,e){return t.length<3?Yo(t):t[0]+Qo((t.push(t[0]),t),$o([t[t.length-2]].concat(t,[t[1]]),e))},monotone:function(t){return t.length<3?Wo(t):t[0]+Qo(t,function(t){var e,r,n,a,i=[],o=function(t){var e=0,r=t.length-1,n=[],a=t[0],i=t[1],o=n[0]=is(a,i);for(;++e<r;)n[e]=(o+(o=is(a=i,i=t[e+1])))/2;return n[e]=o,n}(t),s=-1,l=t.length-1;for(;++s<l;)e=is(t[s],t[s+1]),y(e)<Tt?o[s]=o[s+1]=0:(r=o[s]/e,n=o[s+1]/e,(a=r*r+n*n)>9&&(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]];++e<r;)a.push("V",(n=t[e])[1],"H",n[0]);return a.join("")}function Jo(t){for(var e=0,r=t.length,n=t[0],a=[n[0],",",n[1]];++e<r;)a.push("H",(n=t[e])[0],"V",n[1]);return a.join("")}function Qo(t,e){if(e.length<1||t.length!=e.length&&t.length!=e.length+2)return Wo(t);var r=t.length!=e.length,n="",a=t[0],i=t[1],o=e[0],s=o,l=1;if(r&&(n+="Q"+(i[0]-2*o[0]/3)+","+(i[1]-2*o[1]/3)+","+i[0]+","+i[1],a=t[1],l=2),e.length>1){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;u<e.length;u++,l++)i=t[l],s=e[u],n+="S"+(i[0]-s[0])+","+(i[1]-s[1])+","+i[0]+","+i[1]}if(r){var c=t[l];n+="Q"+(i[0]+2*s[0]/3)+","+(i[1]+2*s[1]/3)+","+c[0]+","+c[1]}return n}function $o(t,e){for(var r,n=[],a=(1-e)/2,i=t[0],o=t[1],s=1,l=t.length;++s<l;)r=i,i=o,o=t[s],n.push([a*(o[0]-r[0]),a*(o[1]-r[1])]);return n}function Ko(t){if(t.length<3)return Wo(t);var e=1,r=t.length,n=t[0],a=n[0],i=n[1],o=[a,a,a,(n=t[1])[0]],s=[i,i,i,n[1]],l=[a,",",i,"L",ts(ns,o),",",ts(ns,s)];for(t.push(t[r-1]);++e<=r;)n=t[e],o.shift(),o.push(n[0]),s.shift(),s.push(n[1]),as(l,o,s);return t.pop(),l.push("L",n),l.join("")}function ts(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}Xo.forEach((function(t,e){e.key=t,e.closed=/-closed$/.test(t)}));var es=[0,2/3,1/3,0],rs=[0,1/3,2/3,0],ns=[0,1/6,2/3,1/6];function as(t,e,r){t.push("C",ts(es,e),",",ts(es,r),",",ts(rs,e),",",ts(rs,r),",",ts(ns,e),",",ts(ns,r))}function is(t,e){return(e[1]-t[1])/(e[0]-t[0])}function os(t){for(var e,r,n,a=-1,i=t.length;++a<i;)r=(e=t[a])[0],n=e[1]-Ct,e[0]=r*Math.cos(n),e[1]=r*Math.sin(n);return t}function ss(t){var e=ra,r=ra,n=0,a=na,i=Xr,o=Wo,s=o.key,l=o,u="L",c=.7;function f(s){var f,d,h,p=[],g=[],v=[],m=-1,y=s.length,b=pe(e),x=pe(n),_=e===r?function(){return d}:pe(r),w=n===a?function(){return h}:pe(a);function A(){p.push("M",o(t(v),c),u,l(t(g.reverse()),c),"Z")}for(;++m<y;)i.call(this,f=s[m],m)?(g.push([d=+b.call(this,f,m),h=+x.call(this,f,m)]),v.push([+_.call(this,f,m),+w.call(this,f,m)])):g.length&&(A(),g=[],v=[]);return g.length&&A(),p.length?p.join(""):null}return f.x=function(t){return arguments.length?(e=r=t,f):r},f.x0=function(t){return arguments.length?(e=t,f):e},f.x1=function(t){return arguments.length?(r=t,f):r},f.y=function(t){return arguments.length?(n=a=t,f):a},f.y0=function(t){return arguments.length?(n=t,f):n},f.y1=function(t){return arguments.length?(a=t,f):a},f.defined=function(t){return arguments.length?(i=t,f):i},f.interpolate=function(t){return arguments.length?(s="function"==typeof t?o=t:(o=Xo.get(t)||Wo).key,l=o.reverse||o,u=o.closed?"M":"L",f):s},f.tension=function(t){return arguments.length?(c=t,f):c},f}function ls(t){return t.radius}function us(t){return[t.x,t.y]}function cs(t){return function(){var e=t.apply(this,arguments),r=e[0],n=e[1]-Ct;return[r*Math.cos(n),r*Math.sin(n)]}}function fs(){return 64}function ds(){return"circle"}function hs(t){var e=Math.sqrt(t/Mt);return"M0,"+e+"A"+e+","+e+" 0 1,1 0,"+-e+"A"+e+","+e+" 0 1,1 0,"+e+"Z"}t.svg.line.radial=function(){var t=qo(os);return t.radius=t.x,delete t.x,t.angle=t.y,delete t.y,t},Zo.reverse=Jo,Jo.reverse=Zo,t.svg.area=function(){return ss(L)},t.svg.area.radial=function(){var t=ss(os);return t.radius=t.x,delete t.x,t.innerRadius=t.x0,delete t.x0,t.outerRadius=t.x1,delete t.x1,t.angle=t.y,delete t.y,t.startAngle=t.y0,delete t.y0,t.endAngle=t.y1,delete t.y1,t},t.svg.chord=function(){var t=Vn,e=Hn,r=ls,n=jo,a=Uo;function i(r,n){var a,i,u=o(this,t,r,n),c=o(this,e,r,n);return"M"+u.p0+s(u.r,u.p1,u.a1-u.a0)+(i=c,((a=u).a0==i.a0&&a.a1==i.a1?l(u.r,u.p1,u.r,u.p0):l(u.r,u.p1,c.r,c.p0)+s(c.r,c.p1,c.a1-c.a0)+l(c.r,c.p1,u.r,u.p0))+"Z")}function o(t,e,i,o){var s=e.call(t,i,o),l=r.call(t,s,o),u=n.call(t,s,o)-Ct,c=a.call(t,s,o)-Ct;return{r:l,a0:u,a1:c,p0:[l*Math.cos(u),l*Math.sin(u)],p1:[l*Math.cos(c),l*Math.sin(c)]}}function s(t,e,r){return"A"+t+","+t+" 0 "+ +(r>Mt)+",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;++s<l;){i.push(e=[]);for(var u=this[s],c=-1,f=u.length;++c<f;)(r=u[c])&&Es(r,c,a,n,o),e.push(r)}return bs(i,a,n)},X.interrupt=function(t){return this.each(null==t?ms:ys(Ms(t)))};var ms=ys(Ms());function ys(t){return function(){var e,r,n;(e=this[t])&&(n=e[r=e.active])&&(n.timer.c=null,n.timer.t=NaN,--e.count?delete e[r]:delete this[t],e.active+=.5,n.event&&n.event.interrupt.call(this,this.__data__,n.index))}}function bs(t,e,r){return U(t,ws),t.namespace=e,t.id=r,t}var xs,_s,ws=[],As=0;function Ts(t,e,r,n){var a=t.id,i=t.namespace;return ct(t,"function"==typeof r?function(t,o,s){t[i][a].tween.set(e,n(r.call(t,t.__data__,o,s)))}:(r=n(r),function(t){t[i][a].tween.set(e,r)}))}function ks(t){return null==t&&(t=""),function(){this.textContent=t}}function Ms(t){return null==t?"__transition__":"__transition_"+t+"__"}function Es(t,e,r,n,a){var i,o,s,l,u,c=t[r]||(t[r]={active:0,count:0}),f=c[n];function d(r){var a=c.active,d=c[a];for(var p in d&&(d.timer.c=null,d.timer.t=NaN,--c.count,delete c[a],d.event&&d.event.interrupt.call(t,t.__data__,d.index)),c)if(+p<n){var g=c[p];g.timer.c=null,g.timer.t=NaN,--c.count,delete c[p]}o.c=h,we((function(){return o.c&&h(r||1)&&(o.c=null,o.t=NaN),1}),0,i),c.active=n,f.event&&f.event.start.call(t,t.__data__,e),u=[],f.tween.forEach((function(r,n){(n=n.call(t,t.__data__,e))&&u.push(n)})),l=f.ease,s=f.duration}function h(a){for(var i=a/s,o=l(i),d=u.length;d>0;)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;++s<l;){o.push(e=[]);for(var u=this[s],c=-1,f=u.length;++c<f;)(n=u[c])&&(r=t.call(n,n.__data__,c,s))?("__data__"in n&&(r.__data__=n.__data__),Es(r,c,i,a,n[i][a]),e.push(r)):e.push(null)}return bs(o,i,a)},ws.selectAll=function(t){var e,r,n,a,i,o=this.id,s=this.namespace,l=[];t=Y(t);for(var u=-1,c=this.length;++u<c;)for(var f=this[u],d=-1,h=f.length;++d<h;)if(n=f[d]){i=n[s][o],r=t.call(n,n.__data__,d,u),l.push(e=[]);for(var p=-1,g=r.length;++p<g;)(a=r[p])&&Es(a,p,s,o,i),e.push(a)}return bs(l,s,o)},ws.filter=function(t){var e,r,n=[];"function"!=typeof t&&(t=lt(t));for(var a=0,i=this.length;a<i;a++){n.push(e=[]);for(var o,s=0,l=(o=this[a]).length;s<l;s++)(r=o[s])&&t.call(r,r.__data__,s,a)&&e.push(r)}return bs(n,this.namespace,this.id)},ws.tween=function(t,e){var r=this.id,n=this.namespace;return arguments.length<2?this.node()[n][r].tween.get(t):ct(this,null==e?function(e){e[n][r].tween.remove(t)}:function(a){a[n][r].tween.set(t,e)})},ws.attr=function(e,r){if(arguments.length<2){for(r in e)this.attr(r,e[r]);return this}var n="transform"==e?xi:Ka,a=t.ns.qualify(e);function i(){this.removeAttribute(a)}function o(){this.removeAttributeNS(a.space,a.local)}function s(t){return null==t?i:(t+="",function(){var e,r=this.getAttribute(a);return r!==t&&(e=n(r,t),function(t){this.setAttribute(a,e(t))})})}function l(t){return null==t?o:(t+="",function(){var e,r=this.getAttributeNS(a.space,a.local);return r!==t&&(e=n(r,t),function(t){this.setAttributeNS(a.space,a.local,e(t))})})}return Ts(this,"attr."+e,r,a.local?l:s)},ws.attrTween=function(e,r){var n=t.ns.qualify(e);return this.tween("attr."+e,n.local?function(t,e){var a=r.call(this,t,e,this.getAttributeNS(n.space,n.local));return a&&function(t){this.setAttributeNS(n.space,n.local,a(t))}}:function(t,e){var a=r.call(this,t,e,this.getAttribute(n));return a&&function(t){this.setAttribute(n,a(t))}})},ws.style=function(t,e,r){var n=arguments.length;if(n<3){if("string"!=typeof t){for(r in n<2&&(e=""),t)this.style(r,t[r],e);return this}r=""}function a(){this.style.removeProperty(t)}function i(e){return null==e?a:(e+="",function(){var n,a=o(this).getComputedStyle(this,null).getPropertyValue(t);return a!==e&&(n=Ka(a,e),function(e){this.style.setProperty(t,n(e),r)})})}return Ts(this,"style."+t,e,i)},ws.styleTween=function(t,e,r){function n(n,a){var i=e.call(this,n,a,o(this).getComputedStyle(this,null).getPropertyValue(t));return i&&function(e){this.style.setProperty(t,i(e),r)}}return arguments.length<3&&(r=""),this.tween("style."+t,n)},ws.text=function(t){return Ts(this,"text",t,ks)},ws.remove=function(){var t=this.namespace;return this.each("end.transition",(function(){var e;this[t].count<2&&(e=this.parentNode)&&e.removeChild(this)}))},ws.ease=function(e){var r=this.id,n=this.namespace;return arguments.length<1?this.node()[n][r].ease:("function"!=typeof e&&(e=t.ease.apply(t,arguments)),ct(this,(function(t){t[n][r].ease=e})))},ws.delay=function(t){var e=this.id,r=this.namespace;return arguments.length<1?this.node()[r][e].delay:ct(this,"function"==typeof t?function(n,a,i){n[r][e].delay=+t.call(n,n.__data__,a,i)}:(t=+t,function(n){n[r][e].delay=t}))},ws.duration=function(t){var e=this.id,r=this.namespace;return arguments.length<1?this.node()[r][e].duration:ct(this,"function"==typeof t?function(n,a,i){n[r][e].duration=Math.max(1,t.call(n,n.__data__,a,i))}:(t=Math.max(1,t),function(n){n[r][e].duration=t}))},ws.each=function(e,r){var n=this.id,a=this.namespace;if(arguments.length<2){var i=_s,o=xs;try{xs=n,ct(this,(function(t,r,i){_s=t[a][n],e.call(t,t.__data__,r,i)}))}finally{_s=i,xs=o}}else ct(this,(function(i){var o=i[a][n];(o.event||(o.event=t.dispatch("start","end","interrupt"))).on(e,r)}));return this},ws.transition=function(){for(var t,e,r,n=this.id,a=++As,i=this.namespace,o=[],s=0,l=this.length;s<l;s++){o.push(t=[]);for(var u,c=0,f=(u=this[s]).length;c<f;c++)(e=u[c])&&Es(e,c,i,a,{time:(r=e[i][n]).time,ease:r.ease,delay:r.delay+r.duration,duration:r.duration}),t.push(e)}return bs(o,i,a)},t.svg.axis=function(){var e,r=t.scale.linear(),a=Ss,i=6,o=6,s=3,l=[10],u=null;function c(n){n.each((function(){var n,c=t.select(this),f=this.__chart__||r,d=this.__chart__=r.copy(),h=null==u?d.ticks?d.ticks.apply(d,l):d.domain():u,p=null==e?d.tickFormat?d.tickFormat.apply(d,l):L:e,g=c.selectAll(".tick").data(h,d),v=g.enter().insert("g",".domain").attr("class","tick").style("opacity",Tt),m=t.transition(g.exit()).style("opacity",Tt).remove(),y=t.transition(g.order()).style("opacity",1),b=Math.max(i,0)+s,x=vo(d),_=c.selectAll(".domain").data([0]),w=(_.enter().append("path").attr("class","domain"),t.transition(_));v.append("line"),v.append("text");var A,T,k,M,E=v.select("line"),S=y.select("line"),C=g.select("text").text(p),O=v.select("text"),D=y.select("text"),R="top"===a||"left"===a?-1:1;if("bottom"===a||"top"===a?(n=Ls,A="x",k="y",T="x2",M="y2",C.attr("dy",R<0?"0em":".71em").style("text-anchor","middle"),w.attr("d","M"+x[0]+","+R*o+"V0H"+x[1]+"V"+R*o)):(n=Os,A="y",k="x",T="y2",M="x2",C.attr("dy",".32em").style("text-anchor",R<0?"end":"start"),w.attr("d","M"+R*o+","+x[0]+"H0V"+x[1]+"H"+R*o)),E.attr(M,R*i),O.attr(k,R*b),S.attr(T,0).attr(M,R*i),D.attr(A,0).attr(k,R*b),d.rangeBand){var I=d,P=I.rangeBand()/2;f=d=function(t){return I(t)+P}}else f.rangeBand?f=d:m.call(n,d,f);v.call(n,f,d),y.call(n,d,d)}))}return c.scale=function(t){return arguments.length?(r=t,c):r},c.orient=function(t){return arguments.length?(a=t in Cs?t+"":Ss,c):a},c.ticks=function(){return arguments.length?(l=n(arguments),c):l},c.tickValues=function(t){return arguments.length?(u=t,c):u},c.tickFormat=function(t){return arguments.length?(e=t,c):e},c.tickSize=function(t){var e=arguments.length;return e?(i=+t,o=+arguments[e-1],c):i},c.innerTickSize=function(t){return arguments.length?(i=+t,c):i},c.outerTickSize=function(t){return arguments.length?(o=+t,c):o},c.tickPadding=function(t){return arguments.length?(s=+t,c):s},c.tickSubdivide=function(){return arguments.length&&c},c};var Ss="bottom",Cs={top:1,right:1,bottom:1,left:1};function Ls(t,e,r){t.attr("transform",(function(t){var n=e(t);return"translate("+(isFinite(n)?n:r(t))+",0)"}))}function Os(t,e,r){t.attr("transform",(function(t){var n=e(t);return"translate(0,"+(isFinite(n)?n:r(t))+")"}))}t.svg.brush=function(){var e,r,n=B(d,"brushstart","brush","brushend"),a=null,i=null,s=[0,0],l=[0,0],u=!0,c=!0,f=Rs[0];function d(e){e.each((function(){var e=t.select(this).style("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush",v).on("touchstart.brush",v),r=e.selectAll(".background").data([0]);r.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),e.selectAll(".extent").data([0]).enter().append("rect").attr("class","extent").style("cursor","move");var n=e.selectAll(".resize").data(f,L);n.exit().remove(),n.enter().append("g").attr("class",(function(t){return"resize "+t})).style("cursor",(function(t){return Ds[t]})).append("rect").attr("x",(function(t){return/[ew]$/.test(t)?-3:null})).attr("y",(function(t){return/^[ns]/.test(t)?-3:null})).attr("width",6).attr("height",6).style("visibility","hidden"),n.style("display",d.empty()?"none":null);var o,s=t.transition(e),l=t.transition(r);a&&(o=vo(a),l.attr("x",o[0]).attr("width",o[1]-o[0]),p(s)),i&&(o=vo(i),l.attr("y",o[0]).attr("height",o[1]-o[0]),g(s)),h(s)}))}function h(t){t.selectAll(".resize").attr("transform",(function(t){return"translate("+s[+/e$/.test(t)]+","+l[+/^s/.test(t)]+")"}))}function p(t){t.select(".extent").attr("x",s[0]),t.selectAll(".extent,.n>rect,.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]<f[0])],M[1]=l[+(e[1]<f[1])]):f=null),w&&R(e,a,0)&&(p(x),r=!0),A&&R(e,i,1)&&(g(x),r=!0),r&&(h(x),b({type:"brush",mode:T?"move":"resize"}))}function R(t,n,a){var i,o,d=vo(n),h=d[0],p=d[1],g=M[a],v=a?l:s,m=v[1]-v[0];if(T&&(h-=g,p-=m+g),i=(a?c:u)?Math.max(h,Math.min(p,t[a])):t[a],T?o=(i+=g)+m:(f&&(g=Math.max(h,Math.min(p,2*f[a]-i))),g<i?(o=i,i=g):o=g),v[0]!=i||v[1]!=o)return a?r=null:e=null,v[0]=i,v[1]=o,!0}function I(){D(),x.style("pointer-events","all").selectAll(".resize").style("display",d.empty()?"none":null),t.select("body").style("cursor",null),E.on("mousemove.brush",null).on("mouseup.brush",null).on("touchmove.brush",null).on("touchend.brush",null).on("keydown.brush",null).on("keyup.brush",null),k(),b({type:"brushend"})}x.style("pointer-events","none").selectAll(".resize").style("display",null),t.select("body").style("cursor",y.style("cursor")),b({type:"brushstart"}),D()}return d.event=function(a){a.each((function(){var a=n.of(this,arguments),i={x:s,y:l,i:e,j:r},o=this.__chart__||i;this.__chart__=i,xs?t.select(this).transition().each("start.brush",(function(){e=o.i,r=o.j,s=o.x,l=o.y,a({type:"brushstart"})})).tween("brush:brush",(function(){var t=ti(s,i.x),n=ti(l,i.y);return e=r=null,function(e){s=i.x=t(e),l=i.y=n(e),a({type:"brush",mode:"resize"})}})).each("end.brush",(function(){e=i.i,r=i.j,a({type:"brush",mode:"resize"}),a({type:"brushend"})})):(a({type:"brushstart"}),a({type:"brush",mode:"resize"}),a({type:"brushend"}))}))},d.x=function(t){return arguments.length?(f=Rs[!(a=t)<<1|!i],d):a},d.y=function(t){return arguments.length?(f=Rs[!a<<1|!(i=t)],d):i},d.clamp=function(t){return arguments.length?(a&&i?(u=!!t[0],c=!!t[1]):a?u=!!t:i&&(c=!!t),d):a&&i?[u,c]:a?u:i?c:null},d.extent=function(t){var n,o,u,c,f;return arguments.length?(a&&(n=t[0],o=t[1],i&&(n=n[0],o=o[0]),e=[n,o],a.invert&&(n=a(n),o=a(o)),o<n&&(f=n,n=o,o=f),n==s[0]&&o==s[1]||(s=[n,o])),i&&(u=t[0],c=t[1],a&&(u=u[1],c=c[1]),r=[u,c],i.invert&&(u=i(u),c=i(c)),c<u&&(f=u,u=c,c=f),u==l[0]&&c==l[1]||(l=[u,c])),d):(a&&(e?(n=e[0],o=e[1]):(n=s[0],o=s[1],a.invert&&(n=a.invert(n),o=a.invert(o)),o<n&&(f=n,n=o,o=f))),i&&(r?(u=r[0],c=r[1]):(u=l[0],c=l[1],i.invert&&(u=i.invert(u),c=i.invert(c)),c<u&&(f=u,u=c,c=f))),a&&i?[[n,u],[o,c]]:a?[n,o]:i&&[u,c])},d.clear=function(){return d.empty()||(s=[0,0],l=[0,0],e=r=null),d},d.empty=function(){return!!a&&s[0]==s[1]||!!i&&l[0]==l[1]},t.rebind(d,n,"on")};var Ds={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},Rs=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]],Is=De.format=sr.timeFormat,Ps=Is.utc,Fs=Ps("%Y-%m-%dT%H:%M:%S.%LZ");function zs(t){return t.toISOString()}function Ns(e,r,n){function a(t){return e(t)}function i(e,n){var a=(e[1]-e[0])/n,i=t.bisect(js,a);return i==js.length?[r.year,To(e.map((function(t){return t/31536e6})),n)[2]]:i?r[a/js[i-1]<js[i]/a?i-1:i]:[Hs,To(e,n)[2]]}return a.invert=function(t){return Bs(e.invert(t))},a.domain=function(t){return arguments.length?(e.domain(t),a):e.domain().map(Bs)},a.nice=function(t,e){var r=a.domain(),n=go(r),o=null==t?i(n,10):"number"==typeof t&&i(n,t);function s(r){return!isNaN(r)&&!t.range(r,Bs(+r+1),e).length}return o&&(t=o[0],e=o[1]),a.domain(yo(r,e>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;t<arguments.length;t++)if(void 0!==arguments[t])return arguments[t]}},{}],88:[function(t,e,r){"use strict";e.exports=i;var n=(i.canvas=document.createElement("canvas")).getContext("2d"),a=o([32,126]);function i(t,e){Array.isArray(t)&&(t=t.join(", "));var r,i={},s=16,l=.05;e&&(2===e.length&&"number"==typeof e[0]?r=o(e):Array.isArray(e)?r=e:(e.o?r=o(e.o):e.pairs&&(r=e.pairs),e.fontSize&&(s=e.fontSize),null!=e.threshold&&(l=e.threshold))),r||(r=a),n.font=s+"px "+t;for(var u=0;u<r.length;u++){var c=r[u],f=n.measureText(c[0]).width+n.measureText(c[1]).width,d=n.measureText(c).width;if(Math.abs(f-d)>s*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<t[1];a++){var i=n+String.fromCharCode(a);e.push(i)}return e}i.createPairs=o,i.ascii=a},{}],89:[function(t,e,r){(function(t){(function(){var r=!1;if("undefined"!=typeof Float64Array){var n=new Float64Array(1),a=new Uint32Array(n.buffer);if(n[0]=1,r=!0,1072693248===a[1]){e.exports=function(t){return n[0]=t,[a[0],a[1]]},e.exports.pack=function(t,e){return a[0]=t,a[1]=e,n[0]},e.exports.lo=function(t){return n[0]=t,a[0]},e.exports.hi=function(t){return n[0]=t,a[1]}}else if(1072693248===a[0]){e.exports=function(t){return n[0]=t,[a[1],a[0]]},e.exports.pack=function(t,e){return a[1]=t,a[0]=e,n[0]},e.exports.lo=function(t){return n[0]=t,a[1]},e.exports.hi=function(t){return n[0]=t,a[0]}}else r=!1}if(!r){var i=new t(8);e.exports=function(t){return i.writeDoubleLE(t,0,!0),[i.readUInt32LE(0,!0),i.readUInt32LE(4,!0)]},e.exports.pack=function(t,e){return i.writeUInt32LE(t,0,!0),i.writeUInt32LE(e,4,!0),i.readDoubleLE(0,!0)},e.exports.lo=function(t){return i.writeDoubleLE(t,0,!0),i.readUInt32LE(0,!0)},e.exports.hi=function(t){return i.writeDoubleLE(t,0,!0),i.readUInt32LE(4,!0)}}e.exports.sign=function(t){return e.exports.hi(t)>>>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;n<t;++n)r[n]=e;return r}(0|t,e);break;case"object":if("number"==typeof t.length)return function t(e,r,n){var a=0|e[n];if(a<=0)return[];var i,o=new Array(a);if(n===e.length-1)for(i=0;i<a;++i)o[i]=r;else for(i=0;i<a;++i)o[i]=t(e,r,n+1);return o}(t,e,0)}return[]}},{}],93:[function(t,e,r){"use strict";function n(t,e,r){r=r||2;var n,s,l,u,c,h,p,v=e&&e.length,m=v?e[0]*r:t.length,y=a(t,0,m,r,!0),b=[];if(!y||y.next===y.prev)return b;if(v&&(y=function(t,e,r,n){var o,s,l,u,c,h=[];for(o=0,s=e.length;o<s;o++)l=e[o]*n,u=o<s-1?e[o+1]*n:t.length,(c=a(t,l,u,n,!1))===c.next&&(c.steiner=!0),h.push(g(c));for(h.sort(f),o=0;o<h.length;o++)d(h[o],r),r=i(r,r.next);return r}(t,e,y,r)),t.length>80*r){n=l=t[0],s=u=t[1];for(var x=r;x<m;x+=r)(c=t[x])<n&&(n=c),(h=t[x+1])<s&&(s=h),c>l&&(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<r;i+=n)o=k(i,t[i],t[i+1],o);else for(i=r-n;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;e<u&&(s++,n=n.nextZ);e++);for(l=u;s>0||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.x<i.x?a.x<o.x?a.x:o.x:i.x<o.x?i.x:o.x,l=a.y<i.y?a.y<o.y?a.y:o.y:i.y<o.y?i.y:o.y,u=a.x>i.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.next.x?n:n.next}}n=n.next}while(n!==e);if(!r)return null;if(a===o)return r;var l,u=r,c=r.x,f=r.y,d=1/0;n=r;do{a>=n.x&&n.x>=c&&a!==n.x&&v(i<f?a:o,i,c,f,i<f?o:a,i,n.x,n.y)&&(l=Math.abs(i-n.y)/(a-n.x),A(n,t)&&(l<d||l===d&&(n.x>r.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<r.x||e.x===r.x&&e.y<r.y)&&(r=e),e=e.next}while(e!==t);return r}function v(t,e,r,n,a,i,o,s){return(a-o)*(e-s)-(t-o)*(i-s)>=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;i<r;i+=n)a+=(t[o]-t[i])*(t[i+1]+t[o+1]),o=i;return a}e.exports=n,e.exports.default=n,n.deviation=function(t,e,r,n){var a=e&&e.length,i=a?e[0]*r:t.length,o=Math.abs(S(t,0,i,r));if(a)for(var s=0,l=e.length;s<l;s++){var u=e[s]*r,c=s<l-1?e[s+1]*r:t.length;o-=Math.abs(S(t,u,c,r))}var f=0;for(s=0;s<n.length;s+=3){var d=n[s]*r,h=n[s+1]*r,p=n[s+2]*r;f+=Math.abs((t[d]-t[p])*(t[h+1]-t[d+1])-(t[d]-t[h])*(t[p+1]-t[d+1]))}return 0===o&&0===f?0:Math.abs((f-o)/o)},n.flatten=function(t){for(var e=t[0][0].length,r={vertices:[],holes:[],dimensions:e},n=0,a=0;a<t.length;a++){for(var i=0;i<t[a].length;i++)for(var o=0;o<e;o++)r.vertices.push(t[a][i][o]);a>0&&(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<r;++a){var i=t[a];e=Math.max(e,i[0],i[1])}e=1+(0|e)}e|=0;var o=new Array(e);for(a=0;a<e;++a)o[a]=[];for(a=0;a<r;++a){i=t[a];o[i[0]].push(i[1]),o[i[1]].push(i[0])}for(var s=0;s<e;++s)n(o[s],(function(t,e){return t-e}));return o};var n=t("uniq")},{uniq:341}],95:[function(t,e,r){"use strict";var n=t("../../object/valid-value");e.exports=function(){return n(this).length=0,this}},{"../../object/valid-value":126}],96:[function(t,e,r){"use strict";e.exports=t("./is-implemented")()?Array.from:t("./shim")},{"./is-implemented":97,"./shim":98}],97:[function(t,e,r){"use strict";e.exports=function(){var t,e,r=Array.from;return"function"==typeof r&&(e=r(t=["raz","dwa"]),Boolean(e&&e!==t&&"dwa"===e[1]))}},{}],98:[function(t,e,r){"use strict";var n=t("es6-symbol").iterator,a=t("../../function/is-arguments"),i=t("../../function/is-function"),o=t("../../number/to-pos-integer"),s=t("../../object/valid-callable"),l=t("../../object/valid-value"),u=t("../../object/is-value"),c=t("../../string/is-string"),f=Array.isArray,d=Function.prototype.call,h={configurable:!0,enumerable:!0,writable:!0,value:null},p=Object.defineProperty;e.exports=function(t){var e,r,g,v,m,y,b,x,_,w,A=arguments[1],T=arguments[2];if(t=Object(l(t)),u(A)&&s(A),this&&this!==Array&&i(this))e=this;else{if(!A){if(a(t))return 1!==(m=t.length)?Array.apply(null,t):((v=new Array(1))[0]=t[0],v);if(f(t)){for(v=new Array(m=t.length),r=0;r<m;++r)v[r]=t[r];return v}}v=[]}if(!f(t))if(void 0!==(_=t[n])){for(b=s(_).call(t),e&&(v=new e),x=b.next(),r=0;!x.done;)w=A?d.call(A,T,x.value,r):x.value,e?(h.value=w,p(v,r,h)):v[r]=w,x=b.next(),++r;m=r}else if(c(t)){for(m=t.length,e&&(v=new e),r=0,g=0;r<m;++r)w=t[r],r+1<m&&(y=w.charCodeAt(0))>=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;r<m;++r)w=A?d.call(A,T,t[r],r):t[r],e?(h.value=w,p(v,r,h)):v[r]=w;return e&&(h.value=null,v.length=m),v}},{"../../function/is-arguments":99,"../../function/is-function":100,"../../number/to-pos-integer":106,"../../object/is-value":115,"../../object/valid-callable":124,"../../object/valid-value":126,"../../string/is-string":130,"es6-symbol":140}],99:[function(t,e,r){"use strict";var n=Object.prototype.toString,a=n.call(function(){return arguments}());e.exports=function(t){return n.call(t)===a}},{}],100:[function(t,e,r){"use strict";var n=Object.prototype.toString,a=RegExp.prototype.test.bind(/^[object [A-Za-z0-9]*Function]$/);e.exports=function(t){return"function"==typeof t&&a(n.call(t))}},{}],101:[function(t,e,r){"use strict";e.exports=function(){}},{}],102:[function(t,e,r){"use strict";e.exports=t("./is-implemented")()?Math.sign:t("./shim")},{"./is-implemented":103,"./shim":104}],103:[function(t,e,r){"use strict";e.exports=function(){var t=Math.sign;return"function"==typeof t&&(1===t(10)&&-1===t(-20))}},{}],104:[function(t,e,r){"use strict";e.exports=function(t){return t=Number(t),isNaN(t)||0===t?t:t>0?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<l;++o)n(e=arguments[o]).forEach(s);if(void 0!==r)throw r;return t}},{"../keys":116,"../valid-value":126}],111:[function(t,e,r){"use strict";var n=t("../array/from"),a=t("./assign"),i=t("./valid-value");e.exports=function(t){var e=Object(i(t)),r=arguments[1],o=Object(arguments[2]);if(e!==t&&!r)return e;var s={};return r?n(r,(function(e){(o.ensure||e in t)&&(s[e]=t[e])})):a(s,t),s}},{"../array/from":96,"./assign":108,"./valid-value":126}],112:[function(t,e,r){"use strict";var n,a,i,o,s=Object.create;t("./set-prototype-of/is-implemented")()||(n=t("./set-prototype-of/shim")),e.exports=n?1!==n.level?s:(a={},i={},o={configurable:!1,enumerable:!1,writable:!0,value:void 0},Object.getOwnPropertyNames(Object.prototype).forEach((function(t){i[t]="__proto__"!==t?o:{configurable:!0,enumerable:!1,writable:!0,value:void 0}})),Object.defineProperties(a,i),Object.defineProperty(n,"nullPolyfill",{configurable:!1,enumerable:!1,writable:!1,value:a}),function(t,e){return s(null===t?a:t,e)}):s},{"./set-prototype-of/is-implemented":122,"./set-prototype-of/shim":123}],113:[function(t,e,r){"use strict";e.exports=t("./_iterate")("forEach")},{"./_iterate":107}],114:[function(t,e,r){"use strict";var n=t("./is-value"),a={function:!0,object:!0};e.exports=function(t){return n(t)&&a[typeof t]||!1}},{"./is-value":115}],115:[function(t,e,r){"use strict";var n=t("../function/noop")();e.exports=function(t){return t!==n&&null!==t}},{"../function/noop":101}],116:[function(t,e,r){"use strict";e.exports=t("./is-implemented")()?Object.keys:t("./shim")},{"./is-implemented":117,"./shim":118}],117:[function(t,e,r){"use strict";e.exports=function(){try{return Object.keys("primitive"),!0}catch(t){return!1}}},{}],118:[function(t,e,r){"use strict";var n=t("../is-value"),a=Object.keys;e.exports=function(t){return a(n(t)?Object(t):t)}},{"../is-value":115}],119:[function(t,e,r){"use strict";var n=t("./valid-callable"),a=t("./for-each"),i=Function.prototype.call;e.exports=function(t,e){var r={},o=arguments[2];return n(e),a(t,(function(t,n,a,s){r[n]=i.call(e,o,t,n,a,s)})),r}},{"./for-each":113,"./valid-callable":124}],120:[function(t,e,r){"use strict";var n=t("./is-value"),a=Array.prototype.forEach,i=Object.create,o=function(t,e){var r;for(r in t)e[r]=t[r]};e.exports=function(t){var e=i(null);return a.call(arguments,(function(t){n(t)&&o(Object(t),e)})),e}},{"./is-value":115}],121:[function(t,e,r){"use strict";e.exports=t("./is-implemented")()?Object.setPrototypeOf:t("./shim")},{"./is-implemented":122,"./shim":123}],122:[function(t,e,r){"use strict";var n=Object.create,a=Object.getPrototypeOf,i={};e.exports=function(){var t=Object.setPrototypeOf,e=arguments[0]||n;return"function"==typeof t&&a(t(e(null),i))===i}},{}],123:[function(t,e,r){"use strict";var n,a=t("../is-object"),i=t("../valid-value"),o=Object.prototype.isPrototypeOf,s=Object.defineProperty,l={configurable:!0,enumerable:!1,writable:!0,value:void 0};n=function(t,e){if(i(t),null===e||a(e))return t;throw new TypeError("Prototype must be null or an object")},e.exports=function(t){var e,r;return t?(2===t.level?t.set?(r=t.set,e=function(t,e){return r.call(n(t,e),e),t}):e=function(t,e){return n(t,e).__proto__=e,t}:e=function t(e,r){var a;return n(e,r),(a=o.call(t.nullPolyfill,e))&&delete t.nullPolyfill.__proto__,null===r&&(r=t.nullPolyfill),e.__proto__=r,a&&s(t.nullPolyfill,"__proto__",l),e},Object.defineProperty(e,"level",{configurable:!1,enumerable:!1,writable:!1,value:t.level})):null}(function(){var t,e=Object.create(null),r={},n=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__");if(n){try{(t=n.set).call(e,r)}catch(t){}if(Object.getPrototypeOf(e)===r)return{set:t,level:2}}return e.__proto__=r,Object.getPrototypeOf(e)===r?{level:2}:((e={}).__proto__=r,Object.getPrototypeOf(e)===r&&{level:1})}()),t("../create")},{"../create":112,"../is-object":114,"../valid-value":126}],124:[function(t,e,r){"use strict";e.exports=function(t){if("function"!=typeof t)throw new TypeError(t+" is not a function");return t}},{}],125:[function(t,e,r){"use strict";var n=t("./is-object");e.exports=function(t){if(!n(t))throw new TypeError(t+" is not an Object");return t}},{"./is-object":114}],126:[function(t,e,r){"use strict";var n=t("./is-value");e.exports=function(t){if(!n(t))throw new TypeError("Cannot use null or undefined");return t}},{"./is-value":115}],127:[function(t,e,r){"use strict";e.exports=t("./is-implemented")()?String.prototype.contains:t("./shim")},{"./is-implemented":128,"./shim":129}],128:[function(t,e,r){"use strict";var n="razdwatrzy";e.exports=function(){return"function"==typeof n.contains&&(!0===n.contains("dwa")&&!1===n.contains("foo"))}},{}],129:[function(t,e,r){"use strict";var n=String.prototype.indexOf;e.exports=function(t){return n.call(this,t,arguments[1])>-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<p&&(g=t[h],h+1<p&&(v=g.charCodeAt(0))>=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.__list__.length?this.__nextIndex__++:void this._unBind()})),next:l((function(){return this._createResult(this._next())})),_createResult:l((function(t){return void 0===t?{done:!0,value:void 0}:{done:!1,value:this._resolve(t)}})),_resolve:l((function(t){return this.__list__[t]})),_unBind:l((function(){this.__list__=null,delete this.__redo__,this.__context__&&(this.__context__.off("_add",this._onAdd),this.__context__.off("_delete",this._onDelete),this.__context__.off("_clear",this._onClear),this.__context__=null)})),toString:l((function(){return"[object "+(this[c.toStringTag]||"Object")+"]"}))},u({_onAdd:l((function(t){t>=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__<this.__length__?this.__nextIndex__++:void this._unBind()})),_resolve:i((function(t){var e,r=this.__list__[t];return this.__nextIndex__===this.__length__?r:(e=r.charCodeAt(0))>=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;t<i;t+=2){(0,g[t])(g[t+1]),g[t]=void 0,g[t+1]=void 0}i=0}var m,y,b,x,_=void 0;function w(t,e){var r=this,n=new this.constructor(k);void 0===n[T]&&P(n);var a=r._state;if(a){var i=arguments[a-1];l((function(){return R(a,n,i,r._result)}))}else O(r,n,t,e);return n}function A(t){if(t&&"object"==typeof t&&t.constructor===this)return t;var e=new this(k);return E(e,t),e}d?_=function(){return n.nextTick(v)}:f?(y=0,b=new f(v),x=document.createTextNode(""),b.observe(x,{characterData:!0}),_=function(){x.data=y=++y%2}):h?((m=new MessageChannel).port1.onmessage=v,_=function(){return m.port2.postMessage(0)}):_=void 0===u&&"function"==typeof t?function(){try{var t=Function("return this")().require("vertx");return"undefined"!=typeof(o=t.runOnLoop||t.runOnContext)?function(){o(v)}:p()}catch(t){return p()}}():p();var T=Math.random().toString(36).substring(2);function k(){}function M(t,r,n){r.constructor===t.constructor&&n===w&&r.constructor.resolve===A?function(t,e){1===e._state?C(t,e._result):2===e._state?L(t,e._result):O(e,void 0,(function(e){return E(t,e)}),(function(e){return L(t,e)}))}(t,r):void 0===n?C(t,r):e(n)?function(t,e,r){l((function(t){var n=!1,a=function(t,e,r,n){try{t.call(e,r,n)}catch(t){return t}}(r,e,(function(r){n||(n=!0,e!==r?E(t,r):C(t,r))}),(function(e){n||(n=!0,L(t,e))}),t._label);!n&&a&&(n=!0,L(t,a))}),t)}(t,r,n):C(t,r)}function E(t,e){if(t===e)L(t,new TypeError("You cannot resolve a promise with itself"));else if(a=typeof(n=e),null===n||"object"!==a&&"function"!==a)C(t,e);else{var r=void 0;try{r=e.then}catch(e){return void L(t,e)}M(t,e,r)}var n,a}function S(t){t._onerror&&t._onerror(t._result),D(t)}function C(t,e){void 0===t._state&&(t._result=e,t._state=1,0!==t._subscribers.length&&l(D,t))}function L(t,e){void 0===t._state&&(t._state=2,t._result=e,l(S,t))}function O(t,e,r,n){var a=t._subscribers,i=a.length;t._onerror=null,a[i]=e,a[i+1]=r,a[i+2]=n,0===i&&t._state&&l(D,t)}function D(t){var e=t._subscribers,r=t._state;if(0!==e.length){for(var n=void 0,a=void 0,i=t._result,o=0;o<e.length;o+=3)n=e[o],a=e[o+r],n?R(r,n,a,i):a(i);t._subscribers.length=0}}function R(t,r,n,a){var i=e(n),o=void 0,s=void 0,l=!0;if(i){try{o=n(a)}catch(t){l=!1,s=t}if(r===o)return void L(r,new TypeError("A promises callback cannot return that same promise."))}else o=a;void 0!==r._state||(i&&l?E(r,o):!1===l?L(r,s):1===t?C(r,o):2===t&&L(r,o))}var I=0;function P(t){t[T]=I++,t._state=void 0,t._result=void 0,t._subscribers=[]}var F=function(){function t(t,e){this._instanceConstructor=t,this.promise=new t(k),this.promise[T]||P(this.promise),r(e)?(this.length=e.length,this._remaining=e.length,this._result=new Array(this.length),0===this.length?C(this.promise,this._result):(this.length=this.length||0,this._enumerate(e),0===this._remaining&&C(this.promise,this._result))):L(this.promise,new Error("Array Methods must be provided an Array"))}return t.prototype._enumerate=function(t){for(var e=0;void 0===this._state&&e<t.length;e++)this._eachEntry(t[e],e)},t.prototype._eachEntry=function(t,e){var r=this._instanceConstructor,n=r.resolve;if(n===A){var a=void 0,i=void 0,o=!1;try{a=t.then}catch(t){o=!0,i=t}if(a===w&&void 0!==t._state)this._settledAt(t._state,e,t._result);else if("function"!=typeof a)this._remaining--,this._result[e]=t;else if(r===z){var s=new r(k);o?L(s,i):M(s,t,a),this._willSettleAt(s,e)}else this._willSettleAt(new r((function(e){return e(t)})),e)}else this._willSettleAt(n(t),e)},t.prototype._settledAt=function(t,e,r){var n=this.promise;void 0===n._state&&(this._remaining--,2===t?L(n,r):this._result[e]=r),0===this._remaining&&C(n,this._result)},t.prototype._willSettleAt=function(t,e){var r=this;O(t,void 0,(function(t){return r._settledAt(1,e,t)}),(function(t){return r._settledAt(2,e,t)}))},t}();var z=function(){function t(e){this[T]=I++,this._result=this._state=void 0,this._subscribers=[],k!==e&&("function"!=typeof e&&function(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}(),this instanceof t?function(t,e){try{e((function(e){E(t,e)}),(function(e){L(t,e)}))}catch(e){L(t,e)}}(this,e):function(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}())}return t.prototype.catch=function(t){return this.then(null,t)},t.prototype.finally=function(t){var r=this.constructor;return e(t)?this.then((function(e){return r.resolve(t()).then((function(){return e}))}),(function(e){return r.resolve(t()).then((function(){throw e}))})):this.then(t,t)},t}();return z.prototype.then=w,z.all=function(t){return new F(this,t).promise},z.race=function(t){var e=this;return r(t)?new e((function(r,n){for(var a=t.length,i=0;i<a;i++)e.resolve(t[i]).then(r,n)})):new e((function(t,e){return e(new TypeError("You must pass an array to race."))}))},z.resolve=A,z.reject=function(t){var e=new this(k);return L(e,t),e},z._setScheduler=function(t){s=t},z._setAsap=function(t){l=t},z._asap=l,z.polyfill=function(){var t=void 0;if("undefined"!=typeof a)t=a;else if("undefined"!=typeof self)t=self;else try{t=Function("return this")()}catch(t){throw new Error("polyfill failed because global object is unavailable in this environment")}var e=t.Promise;if(e){var r=null;try{r=Object.prototype.toString.call(e.resolve())}catch(t){}if("[object Promise]"===r&&!e.cast)return}t.Promise=z},z.Promise=z,z}))}).call(this)}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:285}],140:[function(t,e,r){"use strict";e.exports=t("./is-implemented")()?t("ext/global-this").Symbol:t("./polyfill")},{"./is-implemented":141,"./polyfill":146,"ext/global-this":153}],141:[function(t,e,r){"use strict";var n=t("ext/global-this"),a={object:!0,symbol:!0};e.exports=function(){var t,e=n.Symbol;if("function"!=typeof e)return!1;t=e("test symbol");try{String(t)}catch(t){return!1}return!!a[typeof e.iterator]&&(!!a[typeof e.toPrimitive]&&!!a[typeof e.toStringTag])}},{"ext/global-this":153}],142:[function(t,e,r){"use strict";e.exports=function(t){return!!t&&("symbol"==typeof t||!!t.constructor&&("Symbol"===t.constructor.name&&"Symbol"===t[t.constructor.toStringTag]))}},{}],143:[function(t,e,r){"use strict";var n=t("d"),a=Object.create,i=Object.defineProperty,o=Object.prototype,s=a(null);e.exports=function(t){for(var e,r,a=0;s[t+(a||"")];)++a;return s[t+=a||""]=!0,i(o,e="@@"+t,n.gs(null,(function(t){r||(r=!0,i(this,e,n(t)),r=!1)}))),e}},{d:83}],144:[function(t,e,r){"use strict";var n=t("d"),a=t("ext/global-this").Symbol;e.exports=function(t){return Object.defineProperties(t,{hasInstance:n("",a&&a.hasInstance||t("hasInstance")),isConcatSpreadable:n("",a&&a.isConcatSpreadable||t("isConcatSpreadable")),iterator:n("",a&&a.iterator||t("iterator")),match:n("",a&&a.match||t("match")),replace:n("",a&&a.replace||t("replace")),search:n("",a&&a.search||t("search")),species:n("",a&&a.species||t("species")),split:n("",a&&a.split||t("split")),toPrimitive:n("",a&&a.toPrimitive||t("toPrimitive")),toStringTag:n("",a&&a.toStringTag||t("toStringTag")),unscopables:n("",a&&a.unscopables||t("unscopables"))})}},{d:83,"ext/global-this":153}],145:[function(t,e,r){"use strict";var n=t("d"),a=t("../../../validate-symbol"),i=Object.create(null);e.exports=function(t){return Object.defineProperties(t,{for:n((function(e){return i[e]?i[e]:i[e]=t(String(e))})),keyFor:n((function(t){var e;for(e in a(t),i)if(i[e]===t)return e}))})}},{"../../../validate-symbol":147,d:83}],146:[function(t,e,r){"use strict";var n,a,i,o=t("d"),s=t("./validate-symbol"),l=t("ext/global-this").Symbol,u=t("./lib/private/generate-name"),c=t("./lib/private/setup/standard-symbols"),f=t("./lib/private/setup/symbol-registry"),d=Object.create,h=Object.defineProperties,p=Object.defineProperty;if("function"==typeof l)try{String(l()),i=!0}catch(t){}else l=null;a=function(t){if(this instanceof a)throw new TypeError("Symbol is not a constructor");return n(t)},e.exports=n=function t(e){var r;if(this instanceof t)throw new TypeError("Symbol is not a constructor");return i?l(e):(r=d(a.prototype),e=void 0===e?"":String(e),h(r,{__description__:o("",e),__name__:o("",u(e))}))},c(n),f(n),h(a.prototype,{constructor:o(n),toString:o("",(function(){return this.__name__}))}),h(n.prototype,{toString:o((function(){return"Symbol ("+s(this).__description__+")"})),valueOf:o((function(){return s(this)}))}),p(n.prototype,n.toPrimitive,o("",(function(){var t=s(this);return"symbol"==typeof t?t:t.toString()}))),p(n.prototype,n.toStringTag,o("c","Symbol")),p(a.prototype,n.toStringTag,o("c",n.prototype[n.toStringTag])),p(a.prototype,n.toPrimitive,o("c",n.prototype[n.toPrimitive]))},{"./lib/private/generate-name":143,"./lib/private/setup/standard-symbols":144,"./lib/private/setup/symbol-registry":145,"./validate-symbol":147,d:83,"ext/global-this":153}],147:[function(t,e,r){"use strict";var n=t("./is-symbol");e.exports=function(t){if(!n(t))throw new TypeError(t+" is not a symbol");return t}},{"./is-symbol":142}],148:[function(t,e,r){"use strict";e.exports=t("./is-implemented")()?WeakMap:t("./polyfill")},{"./is-implemented":149,"./polyfill":151}],149:[function(t,e,r){"use strict";e.exports=function(){var t,e;if("function"!=typeof WeakMap)return!1;try{t=new WeakMap([[e={},"one"],[{},"two"],[{},"three"]])}catch(t){return!1}return"[object WeakMap]"===String(t)&&("function"==typeof t.set&&(t.set({},1)===t&&("function"==typeof t.delete&&("function"==typeof t.has&&"one"===t.get(e)))))}},{}],150:[function(t,e,r){"use strict";e.exports="function"==typeof WeakMap&&"[object WeakMap]"===Object.prototype.toString.call(new WeakMap)},{}],151:[function(t,e,r){"use strict";var n,a=t("es5-ext/object/is-value"),i=t("es5-ext/object/set-prototype-of"),o=t("es5-ext/object/valid-object"),s=t("es5-ext/object/valid-value"),l=t("es5-ext/string/random-uniq"),u=t("d"),c=t("es6-iterator/get"),f=t("es6-iterator/for-of"),d=t("es6-symbol").toStringTag,h=t("./is-native-implemented"),p=Array.isArray,g=Object.defineProperty,v=Object.prototype.hasOwnProperty,m=Object.getPrototypeOf;e.exports=n=function(){var t,e=arguments[0];if(!(this instanceof n))throw new TypeError("Constructor requires 'new'");return t=h&&i&&WeakMap!==n?i(new WeakMap,m(this)):this,a(e)&&(p(e)||(e=c(e))),g(t,"__weakMapData__",u("c","$weakMap$"+l())),e?(f(e,(function(e){s(e),t.set(e[0],e[1])})),t):t},h&&(i&&i(n,WeakMap),n.prototype=Object.create(WeakMap.prototype,{constructor:u(n)})),Object.defineProperties(n.prototype,{delete:u((function(t){return!!v.call(o(t),this.__weakMapData__)&&(delete t[this.__weakMapData__],!0)})),get:u((function(t){if(v.call(o(t),this.__weakMapData__))return t[this.__weakMapData__]})),has:u((function(t){return v.call(o(t),this.__weakMapData__)})),set:u((function(t,e){return g(o(t),this.__weakMapData__,u("c",e)),this})),toString:u((function(){return"[object WeakMap]"}))}),g(n.prototype,d,u("c","WeakMap"))},{"./is-native-implemented":150,d:83,"es5-ext/object/is-value":115,"es5-ext/object/set-prototype-of":121,"es5-ext/object/valid-object":125,"es5-ext/object/valid-value":126,"es5-ext/string/random-uniq":131,"es6-iterator/for-of":133,"es6-iterator/get":134,"es6-symbol":140}],152:[function(t,e,r){var n=function(){if("object"==typeof self&&self)return self;if("object"==typeof window&&window)return window;throw new Error("Unable to resolve global `this`")};e.exports=function(){if(this)return this;try{Object.defineProperty(Object.prototype,"__global__",{get:function(){return this},configurable:!0})}catch(t){return n()}try{return __global__||n()}finally{delete Object.prototype.__global__}}()},{}],153:[function(t,e,r){"use strict";e.exports=t("./is-implemented")()?globalThis:t("./implementation")},{"./implementation":152,"./is-implemented":154}],154:[function(t,e,r){"use strict";e.exports=function(){return"object"==typeof globalThis&&(!!globalThis&&globalThis.Array===Array)}},{}],155:[function(t,e,r){"use strict";var n=t("is-string-blank");e.exports=function(t){var e=typeof t;if("string"===e){var r=t;if(0===(t=+t)&&n(r))return!1}else if("number"!==e)return!1;return t-t<1}},{"is-string-blank":250}],156:[function(t,e,r){var n=t("dtype");e.exports=function(t,e,r){if(!t)throw new TypeError("must specify data as first parameter");if(r=0|+(r||0),Array.isArray(t)&&t[0]&&"number"==typeof t[0][0]){var a,i,o,s,l=t[0].length,u=t.length*l;e&&"string"!=typeof e||(e=new(n(e||"float32"))(u+r));var c=e.length-r;if(u!==c)throw new Error("source length "+u+" ("+l+"x"+t.length+") does not match destination length "+c);for(a=0,o=r;a<t.length;a++)for(i=0;i<l;i++)e[o++]=null===t[a][i]?NaN:t[a][i]}else if(e&&"string"!=typeof e)e.set(t,r);else{var f=n(e||"float32");if(Array.isArray(t)||"array"===e)for(e=new f(t.length+r),a=0,o=r,s=e.length;o<s;o++,a++)e[o]=null===t[a]?NaN:t[a];else 0===r?e=new f(t):(e=new f(t.length+r)).set(t,r)}return e}},{dtype:91}],157:[function(t,e,r){"use strict";var n=t("css-font/stringify"),a=[32,126];e.exports=function(t){var e=(t=t||{}).shape?t.shape:t.canvas?[t.canvas.width,t.canvas.height]:[512,512],r=t.canvas||document.createElement("canvas"),i=t.font,o="number"==typeof t.step?[t.step,t.step]:t.step||[32,32],s=t.chars||a;i&&"string"!=typeof i&&(i=n(i));if(Array.isArray(s)){if(2===s.length&&"number"==typeof s[0]&&"number"==typeof s[1]){for(var l=[],u=s[0],c=0;u<=s[1];u++)l[c++]=String.fromCharCode(u);s=l}}else s=String(s).split("");e=e.slice(),r.width=e[0],r.height=e[1];var f=r.getContext("2d");f.fillStyle="#000",f.fillRect(0,0,r.width,r.height),f.font=i,f.textAlign="center",f.textBaseline="middle",f.fillStyle="#fff";var d=o[0]/2,h=o[1]/2;for(u=0;u<s.length;u++)f.fillText(s[u],d,h),(d+=o[0])>e[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;n<r.length;n+=4)if(0!==r[n])return Math.floor(.25*(n-3)/e)}function o(t){for(var e=t.height,r=t.data,n=r.length-1;n>0;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.left._count){e=e.left;continue}t-=e.left._count}if(!t)return new d(this,r);if(t-=1,!e.right)break;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 t<e?-1:t>e?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<e.length;++l)e[l]._count--;return new s(this.tree._compare,e[0])}if(r.left||r.right){r.left?p(r,r.left):r.right&&p(r,r.right),r._color=1;for(l=0;l<e.length-1;++l)e[l]._count--;return new s(this.tree._compare,e[0])}if(1===e.length)return new s(this.tree._compare,null);for(l=0;l<e.length;++l)e[l]._count--;var d=e[e.length-2];return function(t){for(var e,r,n,s,l=t.length-1;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+1<t.length?t[l+1]=e:t.push(e),l+=2}else{if((n=r.left).left&&0===n.left._color){if(s=(n=r.left=a(n)).left=a(n.left),r.left=n.right,n.right=r,n.left=s,n._color=r._color,e._color=1,r._color=1,s._color=1,o(r),o(n),l>1)(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+1<t.length?t[l+1]=e:t.push(e),l+=2}}}(e),d.left===r?d.left=null:d.right=null,new s(this.tree._compare,e[0])},Object.defineProperty(h,"key",{get:function(){if(this._stack.length>0)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;o<i.length;o++)if(n=r.getContext(i[o],a))return n}catch(t){n=null}return n||null}},{}],162:[function(t,e,r){"use strict";var n=t("typedarray-pool"),a=t("ndarray-ops"),i=t("ndarray"),o=["uint8","uint8_clamped","uint16","uint32","int8","int16","int32","float32"];function s(t,e,r,n,a){this.gl=t,this.type=e,this.handle=r,this.length=n,this.usage=a}var l=s.prototype;function u(t,e,r,n,a,i){var o=a.length*a.BYTES_PER_ELEMENT;if(i<0)return t.bufferData(e,a,n),o;if(o+i>r)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<a;++i)r[i]=t[i];return r}l.bind=function(){this.gl.bindBuffer(this.type,this.handle)},l.unbind=function(){this.gl.bindBuffer(this.type,null)},l.dispose=function(){this.gl.deleteBuffer(this.handle)},l.update=function(t,e){if("number"!=typeof e&&(e=-1),this.bind(),"object"==typeof t&&"undefined"!=typeof t.shape){var r=t.dtype;if(o.indexOf(r)<0&&(r="float32"),this.type===this.gl.ELEMENT_ARRAY_BUFFER)r=gl.getExtension("OES_element_index_uint")&&"uint16"!==r?"uint32":"uint16";if(r===t.dtype&&function(t,e){for(var r=1,n=e.length-1;n>=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;C<f.length;++C){var L=f[C];if(!(C>0&&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;B<N.length;++B)N[B]=0;for(B=0;B<F.length;++B){var j=F[B];N[j[0]]+=1,N[j[1]]+=1}for(B=0;B<N.length;++B){var U=N[B];if(0!==U){var V=z[B];if(N[B]=E.length,E.push(V),!(U>1)){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!=W<L?H=[0,S(L,V[1],X,W)]:Math.ceil(V[0])===e[0]-1&&Y<=L!=Z<L?H=[e[0]-1,S(L,V[1],Y,Z)]:0===Math.floor(V[1])&&X<=L!=Y<L?H=[S(L,V[0],X,Y),0]:Math.ceil(V[1])===e[1]-1&&W<=L!=Z<L&&(H=[S(L,V[0],W,Z),e[1]-1]),H&&(F.push([B,z.length]),N.push(E.length),z.push(H))}}}for(B=0;B<F.length;++B){var J=F[B],Q=z[J[0]],$=z[J[1]];M.push([N[J[0]],N[J[1]]]);for(var K=Math.round(Q[0])+e[0]*Math.round(Q[1]),tt=m(r,Q[0]),et=m(a,Q[1]),rt=m(r,$[0]),nt=m(a,$[1]),at=(tt=x*(tt-p))-(rt=x*(rt-p)),it=(et=_*(et-g))-(nt=_*(nt-g)),ot=0;ot<v.length;ot+=2){var st=v[ot],lt=1-st,ut=2*v[ot+1]-1;A.push(lt*tt+st*rt,lt*et+st*nt,ut*at,ut*it),T.push(D,R,I,P),k.push(K)}}}}this.positionBuffer.update(new Float32Array(A)),this.colorBuffer.update(new Uint8Array(T)),this.idBuffer.update(new Uint32Array(k)),this.numVertices=k.length;var ct=t.fillColors,ft=[],dt=[],ht=0;if(ct){u(E,M);var pt=l(E,M,{delaunay:!1});for(C=0;C<pt.length;++C){var gt=pt[C],vt=0,mt=0;for(B=0;B<3;++B){var yt=E[gt[B]],bt=m(r,yt[0]),xt=m(a,yt[1]);vt+=yt[0],mt+=yt[1],dt.push(x*(bt-p),_*(xt-g))}vt/=3,mt/=3;var _t=Math.floor(vt),wt=Math.floor(mt),At=vt-_t,Tt=mt-wt,kt=w.get(_t,wt),Mt=w.get(_t,wt+1),Et=(1-Tt)*((1-At)*kt+At*w.get(_t+1,wt))+Tt*((1-At)*Mt+At*w.get(_t+1,wt+1)),St=c.le(f,Et)+1,Ct=255*ct[4*St+0]|0,Lt=255*ct[4*St+1]|0,Ot=255*ct[4*St+2]|0,Dt=255*ct[4*St+3]|0;ft.push(Ct,Lt,Ot,Dt,Ct,Lt,Ot,Dt,Ct,Lt,Ot,Dt),ht+=3}this.fillPositionBuffer.update(new Float32Array(dt)),this.fillColorBuffer.update(new Uint8Array(ft)),this.fillVerts=ht}},g.dispose=function(){this.plot.removeObject(this)}},{"./lib/shaders":166,"binary-search-bounds":39,cdt2d:53,"clean-pslg":59,"gl-buffer":162,"gl-shader":217,"iota-array":243,ndarray:259,"surface-nets":316}],166:[function(t,e,r){"use strict";var n=t("glslify");e.exports={fragment:n(["precision lowp float;\n#define GLSLIFY 1\nvarying vec4 fragColor;\nvoid main() {\n gl_FragColor = vec4(fragColor.rgb * fragColor.a, fragColor.a);\n}\n"]),vertex:n(["precision mediump float;\n#define GLSLIFY 1\n\nattribute vec2 position;\nattribute vec2 tangent;\nattribute vec4 color;\n\nuniform mat3 viewTransform;\nuniform vec2 screenShape;\nuniform float lineWidth;\nuniform float pointSize;\n\nvarying vec4 fragColor;\n\nvoid main() {\n fragColor = color;\n\n vec3 vPosition = viewTransform * vec3(position, 1.0);\n vec2 vTangent = normalize(viewTransform * vec3(tangent, 0)).xy;\n vec2 offset = vec2(vTangent.y, -vTangent.x) / screenShape;\n\n gl_Position = vec4(\n vPosition.xy + offset * lineWidth * vPosition.z,\n 0,\n vPosition.z);\n\n gl_PointSize = pointSize;\n}\n"]),fillVertex:n(["precision mediump float;\n#define GLSLIFY 1\n\nattribute vec2 position;\nattribute vec4 color;\n\nuniform mat3 viewTransform;\n\nvarying vec4 fragColor;\n\nvoid main() {\n fragColor = color;\n vec3 vPosition = viewTransform * vec3(position, 1.0);\n gl_Position = vec4(vPosition.xy, 0, vPosition.z);\n}\n"])}},{glslify:167}],167:[function(t,e,r){e.exports=function(t){"string"==typeof t&&(t=[t]);for(var e=[].slice.call(arguments,1),r=[],n=0;n<t.length-1;n++)r.push(t[n],e[n]||"");return r.push(t[n]),r.join("")}},{}],168:[function(t,e,r){"use strict";var n=t("gl-texture2d");e.exports=function(t,e,r,n){a||(a=t.FRAMEBUFFER_UNSUPPORTED,i=t.FRAMEBUFFER_INCOMPLETE_ATTACHMENT,o=t.FRAMEBUFFER_INCOMPLETE_DIMENSIONS,s=t.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT);var u=t.getExtension("WEBGL_draw_buffers");!l&&u&&function(t,e){var r=t.getParameter(e.MAX_COLOR_ATTACHMENTS_WEBGL);l=new Array(r+1);for(var n=0;n<=r;++n){for(var a=new Array(r),i=0;i<n;++i)a[i]=t.COLOR_ATTACHMENT0+i;for(i=n;i<r;++i)a[i]=t.NONE;l[n]=a}}(t,u);Array.isArray(e)&&(n=r,r=0|e[1],e=0|e[0]);if("number"!=typeof e)throw new Error("gl-fbo: Missing shape parameter");var c=t.getParameter(t.MAX_RENDERBUFFER_SIZE);if(e<0||e>c||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;p<a;++p)this.color[p]=null;this._color_rb=null,this.depth=null,this._depth_rb=null,this._colorType=n,this._useDepth=i,this._useStencil=o;var g=this,v=[0|e,0|r];Object.defineProperties(v,{0:{get:function(){return g._shape[0]},set:function(t){return g.width=t}},1:{get:function(){return g._shape[1]},set:function(t){return g.height=t}}}),this._shapeVector=v,function(t){var e=u(t.gl),r=t.gl,n=t.handle=r.createFramebuffer(),a=t._shape[0],i=t._shape[1],o=t.color.length,s=t._ext,p=t._useStencil,g=t._useDepth,v=t._colorType;r.bindFramebuffer(r.FRAMEBUFFER,n);for(var m=0;m<o;++m)t.color[m]=d(r,a,i,v,r.RGBA,r.COLOR_ATTACHMENT0+m);0===o?(t._color_rb=h(r,a,i,r.RGBA4,r.COLOR_ATTACHMENT0),s&&s.drawBuffersWEBGL(l[0])):o>1&&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;m<t.color.length;++m)t.color[m].dispose(),t.color[m]=null;t._color_rb&&(r.deleteRenderbuffer(t._color_rb),t._color_rb=null),c(r,e),f(b)}c(r,e)}(this)}var g=p.prototype;function v(t,e,r){if(t._destroyed)throw new Error("gl-fbo: Can't resize destroyed FBO");if(t._shape[0]!==e||t._shape[1]!==r){var n=t.gl,a=n.getParameter(n.MAX_RENDERBUFFER_SIZE);if(e<0||e>a||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<t.color.length;++o)t.color[o].shape=t._shape;t._color_rb&&(n.bindRenderbuffer(n.RENDERBUFFER,t._color_rb),n.renderbufferStorage(n.RENDERBUFFER,n.RGBA4,t._shape[0],t._shape[1])),t.depth&&(t.depth.shape=t._shape),t._depth_rb&&(n.bindRenderbuffer(n.RENDERBUFFER,t._depth_rb),t._useDepth&&t._useStencil?n.renderbufferStorage(n.RENDERBUFFER,n.DEPTH_STENCIL,t._shape[0],t._shape[1]):t._useDepth?n.renderbufferStorage(n.RENDERBUFFER,n.DEPTH_COMPONENT16,t._shape[0],t._shape[1]):t._useStencil&&n.renderbufferStorage(n.RENDERBUFFER,n.STENCIL_INDEX,t._shape[0],t._shape[1])),n.bindFramebuffer(n.FRAMEBUFFER,t.handle);var s=n.checkFramebufferStatus(n.FRAMEBUFFER);s!==n.FRAMEBUFFER_COMPLETE&&(t.dispose(),c(n,i),f(s)),c(n,i)}}Object.defineProperties(g,{shape:{get:function(){return this._destroyed?[0,0]:this._shapeVector},set:function(t){if(Array.isArray(t)||(t=[0|t,0|t]),2!==t.length)throw new Error("gl-fbo: Shape vector must be length 2");var e=0|t[0],r=0|t[1];return v(this,e,r),[e,r]},enumerable:!1},width:{get:function(){return this._destroyed?0:this._shape[0]},set:function(t){return v(this,t|=0,this._shape[1]),t},enumerable:!1},height:{get:function(){return this._destroyed?0:this._shape[1]},set:function(t){return t|=0,v(this,this._shape[0],t),t},enumerable:!1}}),g.bind=function(){if(!this._destroyed){var t=this.gl;t.bindFramebuffer(t.FRAMEBUFFER,this.handle),t.viewport(0,0,this._shape[0],this._shape[1])}},g.dispose=function(){if(!this._destroyed){this._destroyed=!0;var t=this.gl;t.deleteFramebuffer(this.handle),this.handle=null,this.depth&&(this.depth.dispose(),this.depth=null),this._depth_rb&&(t.deleteRenderbuffer(this._depth_rb),this._depth_rb=null);for(var e=0;e<this.color.length;++e)this.color[e].dispose(),this.color[e]=null;this._color_rb&&(t.deleteRenderbuffer(this._color_rb),this._color_rb=null)}}},{"gl-texture2d":226}],169:[function(t,e,r){var n=t("sprintf-js").sprintf,a=t("gl-constants/lookup"),i=t("glsl-shader-name"),o=t("add-line-numbers");e.exports=function(t,e,r){"use strict";var s=i(e)||"of unknown name (see npm glsl-shader-name)",l="unknown type";void 0!==r&&(l=r===a.FRAGMENT_SHADER?"fragment":"vertex");for(var u=n("Error compiling %s shader %s:\n",l,s),c=n("%s%s",u,t),f=t.split("\n"),d={},h=0;h<f.length;h++){var p=f[h];if(""!==p&&"\0"!==p){var g=parseInt(p.split(":")[2]);if(isNaN(g))throw new Error(n("Could not parse error: %s",p));d[g]=p}}var v=o(e).split("\n");for(h=0;h<v.length;h++)if(d[h+3]||d[h+2]||d[h+1]){var m=v[h];if(u+=m+"\n",d[h+1]){var y=d[h+1];y=y.substr(y.split(":",3).join(":").length+1).trim(),u+=n("^^^ %s\n\n",y)}}return{long:u.trim(),short:c.trim()}}},{"add-line-numbers":13,"gl-constants/lookup":164,"glsl-shader-name":228,"sprintf-js":314}],170:[function(t,e,r){"use strict";e.exports=function(t,e){var r=t.gl,n=o(r,l.vertex,l.fragment),a=o(r,l.pickVertex,l.pickFragment),i=s(r),c=s(r),f=s(r),d=s(r),h=new u(t,n,a,i,c,f,d);return h.update(e),t.addObject(h),h};var n=t("binary-search-bounds"),a=t("iota-array"),i=t("typedarray-pool"),o=t("gl-shader"),s=t("gl-buffer"),l=t("./lib/shaders");function u(t,e,r,n,a,i,o){this.plot=t,this.shader=e,this.pickShader=r,this.positionBuffer=n,this.weightBuffer=a,this.colorBuffer=i,this.idBuffer=o,this.xData=[],this.yData=[],this.shape=[0,0],this.bounds=[1/0,1/0,-1/0,-1/0],this.pickOffset=0}var c,f=u.prototype,d=[0,0,1,0,0,1,1,0,1,1,0,1];f.draw=(c=[1,0,0,0,1,0,0,0,1],function(){var t=this.plot,e=this.shader,r=this.bounds,n=this.numVertices;if(!(n<=0)){var a=t.gl,i=t.dataBox,o=r[2]-r[0],s=r[3]-r[1],l=i[2]-i[0],u=i[3]-i[1];c[0]=2*o/l,c[4]=2*s/u,c[6]=2*(r[0]-i[0])/l-1,c[7]=2*(r[1]-i[1])/u-1,e.bind();var f=e.uniforms;f.viewTransform=c,f.shape=this.shape;var d=e.attributes;this.positionBuffer.bind(),d.position.pointer(),this.weightBuffer.bind(),d.weight.pointer(a.UNSIGNED_BYTE,!1),this.colorBuffer.bind(),d.color.pointer(a.UNSIGNED_BYTE,!0),a.drawArrays(a.TRIANGLES,0,n)}}),f.drawPick=function(){var t=[1,0,0,0,1,0,0,0,1],e=[0,0,0,0];return function(r){var n=this.plot,a=this.pickShader,i=this.bounds,o=this.numVertices;if(!(o<=0)){var s=n.gl,l=n.dataBox,u=i[2]-i[0],c=i[3]-i[1],f=l[2]-l[0],d=l[3]-l[1];t[0]=2*u/f,t[4]=2*c/d,t[6]=2*(i[0]-l[0])/f-1,t[7]=2*(i[1]-l[1])/d-1;for(var h=0;h<4;++h)e[h]=r>>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||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;L<C;++L){var O,D;l?(O=b*(o[L]-c),D=b*(o[L+1]-c)):(O=L<_-1?b*(o[L]-(o[L+1]-o[L])/2-c):b*(o[L]-(o[L]-o[L-1])/2-c),D=L<_-1?b*(o[L]+(o[L+1]-o[L])/2-c):b*(o[L]+(o[L]-o[L-1])/2-c));for(var R=0;R<S;++R){var I,P;l?(I=y*(r[R]-u),P=y*(r[R+1]-u)):(I=R<x-1?y*(r[R]-(r[R+1]-r[R])/2-u):y*(r[R]-(r[R]-r[R-1])/2-u),P=R<x-1?y*(r[R]+(r[R+1]-r[R])/2-u):y*(r[R]+(r[R]-r[R-1])/2-u));for(var F=0;F<d.length;F+=2){var z,N,B,j,U=d[F],V=d[F+1],H=s[l?(L+V)*x+(R+U):L*x+R],G=n.le(p,H);if(G<0)z=g[0],N=g[1],B=g[2],j=g[3];else if(G===v-1)z=g[4*v-4],N=g[4*v-3],B=g[4*v-2],j=g[4*v-1];else{var q=(H-p[G])/(p[G+1]-p[G]),X=1-q,W=4*G,Y=4*(G+1);z=X*g[W]+q*g[Y],N=X*g[W+1]+q*g[Y+1],B=X*g[W+2]+q*g[Y+2],j=X*g[W+3]+q*g[Y+3]}A[4*E]=255*z,A[4*E+1]=255*N,A[4*E+2]=255*B,A[4*E+3]=255*j,T[2*E]=.5*I+.5*P,T[2*E+1]=.5*O+.5*D,k[2*E]=U,k[2*E+1]=V,M[E]=L*x+R,E+=1}}}this.positionBuffer.update(T),this.weightBuffer.update(k),this.colorBuffer.update(A),this.idBuffer.update(M),i.free(T),i.free(A),i.free(k),i.free(M)},f.dispose=function(){this.shader.dispose(),this.pickShader.dispose(),this.positionBuffer.dispose(),this.weightBuffer.dispose(),this.colorBuffer.dispose(),this.idBuffer.dispose(),this.plot.removeObject(this)}},{"./lib/shaders":171,"binary-search-bounds":39,"gl-buffer":162,"gl-shader":217,"iota-array":243,"typedarray-pool":339}],171:[function(t,e,r){"use strict";var n=t("glslify");e.exports={fragment:n(["precision lowp float;\n#define GLSLIFY 1\nvarying vec4 fragColor;\nvoid main() {\n gl_FragColor = vec4(fragColor.rgb * fragColor.a, fragColor.a);\n}\n"]),vertex:n(["precision mediump float;\n#define GLSLIFY 1\n\nattribute vec2 position;\nattribute vec4 color;\nattribute vec2 weight;\n\nuniform vec2 shape;\nuniform mat3 viewTransform;\n\nvarying vec4 fragColor;\n\nvoid main() {\n vec3 vPosition = viewTransform * vec3( position + (weight-.5)/(shape-1.) , 1.0);\n fragColor = color;\n gl_Position = vec4(vPosition.xy, 0, vPosition.z);\n}\n"]),pickFragment:n(["precision mediump float;\n#define GLSLIFY 1\n\nvarying vec4 fragId;\nvarying vec2 vWeight;\n\nuniform vec2 shape;\nuniform vec4 pickOffset;\n\nvoid main() {\n vec2 d = step(.5, vWeight);\n vec4 id = fragId + pickOffset;\n id.x += d.x + d.y*shape.x;\n\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 gl_FragColor = id/255.;\n}\n"]),pickVertex:n(["precision mediump float;\n#define GLSLIFY 1\n\nattribute vec2 position;\nattribute vec4 pickId;\nattribute vec2 weight;\n\nuniform vec2 shape;\nuniform mat3 viewTransform;\n\nvarying vec4 fragId;\nvarying vec2 vWeight;\n\nvoid main() {\n vWeight = weight;\n\n fragId = pickId;\n\n vec3 vPosition = viewTransform * vec3( position + (weight-.5)/(shape-1.) , 1.0);\n gl_Position = vec4(vPosition.xy, 0, vPosition.z);\n}\n"])}},{glslify:172}],172:[function(t,e,r){arguments[4][167][0].apply(r,arguments)},{dup:167}],173:[function(t,e,r){e.exports=function(t,e){var r=e[0],n=e[1],a=e[2],i=e[3],o=e[4],s=e[5],l=e[6],u=e[7],c=e[8],f=e[9],d=e[10],h=e[11],p=e[12],g=e[13],v=e[14],m=e[15];return t[0]=s*(d*m-h*v)-f*(l*m-u*v)+g*(l*h-u*d),t[1]=-(n*(d*m-h*v)-f*(a*m-i*v)+g*(a*h-i*d)),t[2]=n*(l*m-u*v)-s*(a*m-i*v)+g*(a*u-i*l),t[3]=-(n*(l*h-u*d)-s*(a*h-i*d)+f*(a*u-i*l)),t[4]=-(o*(d*m-h*v)-c*(l*m-u*v)+p*(l*h-u*d)),t[5]=r*(d*m-h*v)-c*(a*m-i*v)+p*(a*h-i*d),t[6]=-(r*(l*m-u*v)-o*(a*m-i*v)+p*(a*u-i*l)),t[7]=r*(l*h-u*d)-o*(a*h-i*d)+c*(a*u-i*l),t[8]=o*(f*m-h*g)-c*(s*m-u*g)+p*(s*h-u*f),t[9]=-(r*(f*m-h*g)-c*(n*m-i*g)+p*(n*h-i*f)),t[10]=r*(s*m-u*g)-o*(n*m-i*g)+p*(n*u-i*s),t[11]=-(r*(s*h-u*f)-o*(n*h-i*f)+c*(n*u-i*s)),t[12]=-(o*(f*v-d*g)-c*(s*v-l*g)+p*(s*d-l*f)),t[13]=r*(f*v-d*g)-c*(n*v-a*g)+p*(n*d-a*f),t[14]=-(r*(s*v-l*g)-o*(n*v-a*g)+p*(n*l-a*s)),t[15]=r*(s*d-l*f)-o*(n*d-a*f)+c*(n*l-a*s),t}},{}],174:[function(t,e,r){e.exports=function(t){var e=new Float32Array(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}},{}],175:[function(t,e,r){e.exports=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}},{}],176:[function(t,e,r){e.exports=function(){var t=new Float32Array(16);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}},{}],177:[function(t,e,r){e.exports=function(t){var e=t[0],r=t[1],n=t[2],a=t[3],i=t[4],o=t[5],s=t[6],l=t[7],u=t[8],c=t[9],f=t[10],d=t[11],h=t[12],p=t[13],g=t[14],v=t[15];return(e*o-r*i)*(f*v-d*g)-(e*s-n*i)*(c*v-d*p)+(e*l-a*i)*(c*g-f*p)+(r*s-n*o)*(u*v-d*h)-(r*l-a*o)*(u*g-f*h)+(n*l-a*s)*(u*p-c*h)}},{}],178:[function(t,e,r){e.exports=function(t,e){var r=e[0],n=e[1],a=e[2],i=e[3],o=r+r,s=n+n,l=a+a,u=r*o,c=n*o,f=n*s,d=a*o,h=a*s,p=a*l,g=i*o,v=i*s,m=i*l;return t[0]=1-f-p,t[1]=c+m,t[2]=d-v,t[3]=0,t[4]=c-m,t[5]=1-u-p,t[6]=h+g,t[7]=0,t[8]=d+v,t[9]=h-g,t[10]=1-u-f,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}},{}],179:[function(t,e,r){e.exports=function(t,e,r){var n,a,i,o=r[0],s=r[1],l=r[2],u=Math.sqrt(o*o+s*s+l*l);if(Math.abs(u)<1e-6)return null;return o*=u=1/u,s*=u,l*=u,n=Math.sin(e),a=Math.cos(e),i=1-a,t[0]=o*o*i+a,t[1]=s*o*i+l*n,t[2]=l*o*i-s*n,t[3]=0,t[4]=o*s*i-l*n,t[5]=s*s*i+a,t[6]=l*s*i+o*n,t[7]=0,t[8]=o*l*i+s*n,t[9]=s*l*i-o*n,t[10]=l*l*i+a,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}},{}],180:[function(t,e,r){e.exports=function(t,e,r){var n=e[0],a=e[1],i=e[2],o=e[3],s=n+n,l=a+a,u=i+i,c=n*s,f=n*l,d=n*u,h=a*l,p=a*u,g=i*u,v=o*s,m=o*l,y=o*u;return t[0]=1-(h+g),t[1]=f+y,t[2]=d-m,t[3]=0,t[4]=f-y,t[5]=1-(c+g),t[6]=p+v,t[7]=0,t[8]=d+m,t[9]=p-v,t[10]=1-(c+h),t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t}},{}],181:[function(t,e,r){e.exports=function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e[1],t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e[2],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}},{}],182:[function(t,e,r){e.exports=function(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=e[0],t[13]=e[1],t[14]=e[2],t[15]=1,t}},{}],183:[function(t,e,r){e.exports=function(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=n,t[6]=r,t[7]=0,t[8]=0,t[9]=-r,t[10]=n,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}},{}],184:[function(t,e,r){e.exports=function(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=0,t[2]=-r,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=r,t[9]=0,t[10]=n,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}},{}],185:[function(t,e,r){e.exports=function(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=0,t[3]=0,t[4]=-r,t[5]=n,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}},{}],186:[function(t,e,r){e.exports=function(t,e,r,n,a,i,o){var s=1/(r-e),l=1/(a-n),u=1/(i-o);return t[0]=2*i*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*i*l,t[6]=0,t[7]=0,t[8]=(r+e)*s,t[9]=(a+n)*l,t[10]=(o+i)*u,t[11]=-1,t[12]=0,t[13]=0,t[14]=o*i*2*u,t[15]=0,t}},{}],187:[function(t,e,r){e.exports=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}},{}],188:[function(t,e,r){e.exports={create:t("./create"),clone:t("./clone"),copy:t("./copy"),identity:t("./identity"),transpose:t("./transpose"),invert:t("./invert"),adjoint:t("./adjoint"),determinant:t("./determinant"),multiply:t("./multiply"),translate:t("./translate"),scale:t("./scale"),rotate:t("./rotate"),rotateX:t("./rotateX"),rotateY:t("./rotateY"),rotateZ:t("./rotateZ"),fromRotation:t("./fromRotation"),fromRotationTranslation:t("./fromRotationTranslation"),fromScaling:t("./fromScaling"),fromTranslation:t("./fromTranslation"),fromXRotation:t("./fromXRotation"),fromYRotation:t("./fromYRotation"),fromZRotation:t("./fromZRotation"),fromQuat:t("./fromQuat"),frustum:t("./frustum"),perspective:t("./perspective"),perspectiveFromFieldOfView:t("./perspectiveFromFieldOfView"),ortho:t("./ortho"),lookAt:t("./lookAt"),str:t("./str")}},{"./adjoint":173,"./clone":174,"./copy":175,"./create":176,"./determinant":177,"./fromQuat":178,"./fromRotation":179,"./fromRotationTranslation":180,"./fromScaling":181,"./fromTranslation":182,"./fromXRotation":183,"./fromYRotation":184,"./fromZRotation":185,"./frustum":186,"./identity":187,"./invert":189,"./lookAt":190,"./multiply":191,"./ortho":192,"./perspective":193,"./perspectiveFromFieldOfView":194,"./rotate":195,"./rotateX":196,"./rotateY":197,"./rotateZ":198,"./scale":199,"./str":200,"./translate":201,"./transpose":202}],189:[function(t,e,r){e.exports=function(t,e){var r=e[0],n=e[1],a=e[2],i=e[3],o=e[4],s=e[5],l=e[6],u=e[7],c=e[8],f=e[9],d=e[10],h=e[11],p=e[12],g=e[13],v=e[14],m=e[15],y=r*s-n*o,b=r*l-a*o,x=r*u-i*o,_=n*l-a*s,w=n*u-i*s,A=a*u-i*l,T=c*g-f*p,k=c*v-d*p,M=c*m-h*p,E=f*v-d*g,S=f*m-h*g,C=d*m-h*v,L=y*C-b*S+x*E+_*M-w*k+A*T;if(!L)return null;return L=1/L,t[0]=(s*C-l*S+u*E)*L,t[1]=(a*S-n*C-i*E)*L,t[2]=(g*A-v*w+m*_)*L,t[3]=(d*w-f*A-h*_)*L,t[4]=(l*M-o*C-u*k)*L,t[5]=(r*C-a*M+i*k)*L,t[6]=(v*x-p*A-m*b)*L,t[7]=(c*A-d*x+h*b)*L,t[8]=(o*S-s*M+u*T)*L,t[9]=(n*M-r*S-i*T)*L,t[10]=(p*w-g*x+m*y)*L,t[11]=(f*x-c*w-h*y)*L,t[12]=(s*k-o*E-l*T)*L,t[13]=(r*E-n*k+a*T)*L,t[14]=(g*b-p*_-v*y)*L,t[15]=(c*_-f*b+d*y)*L,t}},{}],190:[function(t,e,r){var n=t("./identity");e.exports=function(t,e,r,a){var i,o,s,l,u,c,f,d,h,p,g=e[0],v=e[1],m=e[2],y=a[0],b=a[1],x=a[2],_=r[0],w=r[1],A=r[2];if(Math.abs(g-_)<1e-6&&Math.abs(v-w)<1e-6&&Math.abs(m-A)<1e-6)return n(t);f=g-_,d=v-w,h=m-A,p=1/Math.sqrt(f*f+d*d+h*h),i=b*(h*=p)-x*(d*=p),o=x*(f*=p)-y*h,s=y*d-b*f,(p=Math.sqrt(i*i+o*o+s*s))?(i*=p=1/p,o*=p,s*=p):(i=0,o=0,s=0);l=d*s-h*o,u=h*i-f*s,c=f*o-d*i,(p=Math.sqrt(l*l+u*u+c*c))?(l*=p=1/p,u*=p,c*=p):(l=0,u=0,c=0);return t[0]=i,t[1]=l,t[2]=f,t[3]=0,t[4]=o,t[5]=u,t[6]=d,t[7]=0,t[8]=s,t[9]=c,t[10]=h,t[11]=0,t[12]=-(i*g+o*v+s*m),t[13]=-(l*g+u*v+c*m),t[14]=-(f*g+d*v+h*m),t[15]=1,t}},{"./identity":187}],191:[function(t,e,r){e.exports=function(t,e,r){var n=e[0],a=e[1],i=e[2],o=e[3],s=e[4],l=e[5],u=e[6],c=e[7],f=e[8],d=e[9],h=e[10],p=e[11],g=e[12],v=e[13],m=e[14],y=e[15],b=r[0],x=r[1],_=r[2],w=r[3];return t[0]=b*n+x*s+_*f+w*g,t[1]=b*a+x*l+_*d+w*v,t[2]=b*i+x*u+_*h+w*m,t[3]=b*o+x*c+_*p+w*y,b=r[4],x=r[5],_=r[6],w=r[7],t[4]=b*n+x*s+_*f+w*g,t[5]=b*a+x*l+_*d+w*v,t[6]=b*i+x*u+_*h+w*m,t[7]=b*o+x*c+_*p+w*y,b=r[8],x=r[9],_=r[10],w=r[11],t[8]=b*n+x*s+_*f+w*g,t[9]=b*a+x*l+_*d+w*v,t[10]=b*i+x*u+_*h+w*m,t[11]=b*o+x*c+_*p+w*y,b=r[12],x=r[13],_=r[14],w=r[15],t[12]=b*n+x*s+_*f+w*g,t[13]=b*a+x*l+_*d+w*v,t[14]=b*i+x*u+_*h+w*m,t[15]=b*o+x*c+_*p+w*y,t}},{}],192:[function(t,e,r){e.exports=function(t,e,r,n,a,i,o){var s=1/(e-r),l=1/(n-a),u=1/(i-o);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*u,t[11]=0,t[12]=(e+r)*s,t[13]=(a+n)*l,t[14]=(o+i)*u,t[15]=1,t}},{}],193:[function(t,e,r){e.exports=function(t,e,r,n,a){var i=1/Math.tan(e/2),o=1/(n-a);return t[0]=i/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=i,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=(a+n)*o,t[11]=-1,t[12]=0,t[13]=0,t[14]=2*a*n*o,t[15]=0,t}},{}],194:[function(t,e,r){e.exports=function(t,e,r,n){var a=Math.tan(e.upDegrees*Math.PI/180),i=Math.tan(e.downDegrees*Math.PI/180),o=Math.tan(e.leftDegrees*Math.PI/180),s=Math.tan(e.rightDegrees*Math.PI/180),l=2/(o+s),u=2/(a+i);return t[0]=l,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=u,t[6]=0,t[7]=0,t[8]=-(o-s)*l*.5,t[9]=(a-i)*u*.5,t[10]=n/(r-n),t[11]=-1,t[12]=0,t[13]=0,t[14]=n*r/(r-n),t[15]=0,t}},{}],195:[function(t,e,r){e.exports=function(t,e,r,n){var a,i,o,s,l,u,c,f,d,h,p,g,v,m,y,b,x,_,w,A,T,k,M,E,S=n[0],C=n[1],L=n[2],O=Math.sqrt(S*S+C*C+L*L);if(Math.abs(O)<1e-6)return null;S*=O=1/O,C*=O,L*=O,a=Math.sin(r),i=Math.cos(r),o=1-i,s=e[0],l=e[1],u=e[2],c=e[3],f=e[4],d=e[5],h=e[6],p=e[7],g=e[8],v=e[9],m=e[10],y=e[11],b=S*S*o+i,x=C*S*o+L*a,_=L*S*o-C*a,w=S*C*o-L*a,A=C*C*o+i,T=L*C*o+S*a,k=S*L*o+C*a,M=C*L*o-S*a,E=L*L*o+i,t[0]=s*b+f*x+g*_,t[1]=l*b+d*x+v*_,t[2]=u*b+h*x+m*_,t[3]=c*b+p*x+y*_,t[4]=s*w+f*A+g*T,t[5]=l*w+d*A+v*T,t[6]=u*w+h*A+m*T,t[7]=c*w+p*A+y*T,t[8]=s*k+f*M+g*E,t[9]=l*k+d*M+v*E,t[10]=u*k+h*M+m*E,t[11]=c*k+p*M+y*E,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]);return t}},{}],196:[function(t,e,r){e.exports=function(t,e,r){var n=Math.sin(r),a=Math.cos(r),i=e[4],o=e[5],s=e[6],l=e[7],u=e[8],c=e[9],f=e[10],d=e[11];e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]);return t[4]=i*a+u*n,t[5]=o*a+c*n,t[6]=s*a+f*n,t[7]=l*a+d*n,t[8]=u*a-i*n,t[9]=c*a-o*n,t[10]=f*a-s*n,t[11]=d*a-l*n,t}},{}],197:[function(t,e,r){e.exports=function(t,e,r){var n=Math.sin(r),a=Math.cos(r),i=e[0],o=e[1],s=e[2],l=e[3],u=e[8],c=e[9],f=e[10],d=e[11];e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]);return t[0]=i*a-u*n,t[1]=o*a-c*n,t[2]=s*a-f*n,t[3]=l*a-d*n,t[8]=i*n+u*a,t[9]=o*n+c*a,t[10]=s*n+f*a,t[11]=l*n+d*a,t}},{}],198:[function(t,e,r){e.exports=function(t,e,r){var n=Math.sin(r),a=Math.cos(r),i=e[0],o=e[1],s=e[2],l=e[3],u=e[4],c=e[5],f=e[6],d=e[7];e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]);return t[0]=i*a+u*n,t[1]=o*a+c*n,t[2]=s*a+f*n,t[3]=l*a+d*n,t[4]=u*a-i*n,t[5]=c*a-o*n,t[6]=f*a-s*n,t[7]=d*a-l*n,t}},{}],199:[function(t,e,r){e.exports=function(t,e,r){var n=r[0],a=r[1],i=r[2];return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*a,t[5]=e[5]*a,t[6]=e[6]*a,t[7]=e[7]*a,t[8]=e[8]*i,t[9]=e[9]*i,t[10]=e[10]*i,t[11]=e[11]*i,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}},{}],200:[function(t,e,r){e.exports=function(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+")"}},{}],201:[function(t,e,r){e.exports=function(t,e,r){var n,a,i,o,s,l,u,c,f,d,h,p,g=r[0],v=r[1],m=r[2];e===t?(t[12]=e[0]*g+e[4]*v+e[8]*m+e[12],t[13]=e[1]*g+e[5]*v+e[9]*m+e[13],t[14]=e[2]*g+e[6]*v+e[10]*m+e[14],t[15]=e[3]*g+e[7]*v+e[11]*m+e[15]):(n=e[0],a=e[1],i=e[2],o=e[3],s=e[4],l=e[5],u=e[6],c=e[7],f=e[8],d=e[9],h=e[10],p=e[11],t[0]=n,t[1]=a,t[2]=i,t[3]=o,t[4]=s,t[5]=l,t[6]=u,t[7]=c,t[8]=f,t[9]=d,t[10]=h,t[11]=p,t[12]=n*g+s*v+f*m+e[12],t[13]=a*g+l*v+d*m+e[13],t[14]=i*g+u*v+h*m+e[14],t[15]=o*g+c*v+p*m+e[15]);return t}},{}],202:[function(t,e,r){e.exports=function(t,e){if(t===e){var r=e[1],n=e[2],a=e[3],i=e[6],o=e[7],s=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=r,t[6]=e[9],t[7]=e[13],t[8]=n,t[9]=i,t[11]=e[14],t[12]=a,t[13]=o,t[14]=s}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}},{}],203:[function(t,e,r){"use strict";e.exports=function(t){var e=t.gl,r=n(e,[0,0,0,1,1,0,1,1]),s=a(e,i.boxVert,i.lineFrag);return new o(t,r,s)};var n=t("gl-buffer"),a=t("gl-shader"),i=t("./shaders");function o(t,e,r){this.plot=t,this.vbo=e,this.shader=r}var s,l,u=o.prototype;u.bind=function(){var t=this.shader;this.vbo.bind(),this.shader.bind(),t.attributes.coord.pointer(),t.uniforms.screenBox=this.plot.screenBox},u.drawBox=(s=[0,0],l=[0,0],function(t,e,r,n,a){var i=this.plot,o=this.shader,u=i.gl;s[0]=t,s[1]=e,l[0]=r,l[1]=n,o.uniforms.lo=s,o.uniforms.hi=l,o.uniforms.color=a,u.drawArrays(u.TRIANGLE_STRIP,0,4)}),u.dispose=function(){this.vbo.dispose(),this.shader.dispose()}},{"./shaders":206,"gl-buffer":162,"gl-shader":217}],204:[function(t,e,r){"use strict";e.exports=function(t){var e=t.gl,r=n(e),i=a(e,o.gridVert,o.gridFrag),l=a(e,o.tickVert,o.gridFrag);return new s(t,r,i,l)};var n=t("gl-buffer"),a=t("gl-shader"),i=t("binary-search-bounds"),o=t("./shaders");function s(t,e,r,n){this.plot=t,this.vbo=e,this.shader=r,this.tickShader=n,this.ticks=[[],[]]}function l(t,e){return t-e}var u,c,f,d,h,p=s.prototype;p.draw=(u=[0,0],c=[0,0],f=[0,0],function(){for(var t=this.plot,e=this.vbo,r=this.shader,n=this.ticks,a=t.gl,i=t._tickBounds,o=t.dataBox,s=t.viewBox,l=t.gridLineWidth,d=t.gridLineColor,h=t.gridLineEnable,p=t.pixelRatio,g=0;g<2;++g){var v=i[g],m=i[g+2]-v,y=.5*(o[g+2]+o[g]),b=o[g+2]-o[g];c[g]=2*m/b,u[g]=2*(v-y)/b}r.bind(),e.bind(),r.attributes.dataCoord.pointer(),r.uniforms.dataShift=u,r.uniforms.dataScale=c;var x=0;for(g=0;g<2;++g){f[0]=f[1]=0,f[g]=1,r.uniforms.dataAxis=f,r.uniforms.lineWidth=l[g]/(s[g+2]-s[g])*p,r.uniforms.color=d[g];var _=6*n[g].length;h[g]&&_&&a.drawArrays(a.TRIANGLES,x,_),x+=_}}),p.drawTickMarks=function(){var t=[0,0],e=[0,0],r=[1,0],n=[0,1],a=[0,0],o=[0,0];return function(){for(var s=this.plot,u=this.vbo,c=this.tickShader,f=this.ticks,d=s.gl,h=s._tickBounds,p=s.dataBox,g=s.viewBox,v=s.pixelRatio,m=s.screenBox,y=m[2]-m[0],b=m[3]-m[1],x=g[2]-g[0],_=g[3]-g[1],w=0;w<2;++w){var A=h[w],T=h[w+2]-A,k=.5*(p[w+2]+p[w]),M=p[w+2]-p[w];e[w]=2*T/M,t[w]=2*(A-k)/M}e[0]*=x/y,t[0]*=x/y,e[1]*=_/b,t[1]*=_/b,c.bind(),u.bind(),c.attributes.dataCoord.pointer();var E=c.uniforms;E.dataShift=t,E.dataScale=e;var S=s.tickMarkLength,C=s.tickMarkWidth,L=s.tickMarkColor,O=6*f[0].length,D=Math.min(i.ge(f[0],(p[0]-h[0])/(h[2]-h[0]),l),f[0].length),R=Math.min(i.gt(f[0],(p[2]-h[0])/(h[2]-h[0]),l),f[0].length),I=0+6*D,P=6*Math.max(0,R-D),F=Math.min(i.ge(f[1],(p[1]-h[1])/(h[3]-h[1]),l),f[1].length),z=Math.min(i.gt(f[1],(p[3]-h[1])/(h[3]-h[1]),l),f[1].length),N=O+6*F,B=6*Math.max(0,z-F);a[0]=2*(g[0]-S[1])/y-1,a[1]=(g[3]+g[1])/b-1,o[0]=S[1]*v/y,o[1]=C[1]*v/b,B&&(E.color=L[1],E.tickScale=o,E.dataAxis=n,E.screenOffset=a,d.drawArrays(d.TRIANGLES,N,B)),a[0]=(g[2]+g[0])/y-1,a[1]=2*(g[1]-S[0])/b-1,o[0]=C[0]*v/y,o[1]=S[0]*v/b,P&&(E.color=L[0],E.tickScale=o,E.dataAxis=r,E.screenOffset=a,d.drawArrays(d.TRIANGLES,I,P)),a[0]=2*(g[2]+S[3])/y-1,a[1]=(g[3]+g[1])/b-1,o[0]=S[3]*v/y,o[1]=C[3]*v/b,B&&(E.color=L[3],E.tickScale=o,E.dataAxis=n,E.screenOffset=a,d.drawArrays(d.TRIANGLES,N,B)),a[0]=(g[2]+g[0])/y-1,a[1]=2*(g[3]+S[2])/b-1,o[0]=C[2]*v/y,o[1]=S[2]*v/b,P&&(E.color=L[2],E.tickScale=o,E.dataAxis=r,E.screenOffset=a,d.drawArrays(d.TRIANGLES,I,P))}}(),p.update=(d=[1,1,-1,-1,1,-1],h=[1,-1,1,1,-1,-1],function(t){for(var e=t.ticks,r=t.bounds,n=new Float32Array(18*(e[0].length+e[1].length)),a=(this.plot.zeroLineEnable,0),i=[[],[]],o=0;o<2;++o)for(var s=i[o],l=e[o],u=r[o],c=r[o+2],f=0;f<l.length;++f){var p=(l[f].x-u)/(c-u);s.push(p);for(var g=0;g<6;++g)n[a++]=p,n[a++]=d[g],n[a++]=h[g]}this.ticks=i,this.vbo.update(n)}),p.dispose=function(){this.vbo.dispose(),this.shader.dispose(),this.tickShader.dispose()}},{"./shaders":206,"binary-search-bounds":39,"gl-buffer":162,"gl-shader":217}],205:[function(t,e,r){"use strict";e.exports=function(t){var e=t.gl,r=n(e,[-1,-1,-1,1,1,-1,1,1]),s=a(e,i.lineVert,i.lineFrag);return new o(t,r,s)};var n=t("gl-buffer"),a=t("gl-shader"),i=t("./shaders");function o(t,e,r){this.plot=t,this.vbo=e,this.shader=r}var s,l,u=o.prototype;u.bind=function(){var t=this.shader;this.vbo.bind(),this.shader.bind(),t.attributes.coord.pointer(),t.uniforms.screenBox=this.plot.screenBox},u.drawLine=(s=[0,0],l=[0,0],function(t,e,r,n,a,i){var o=this.plot,u=this.shader,c=o.gl;s[0]=t,s[1]=e,l[0]=r,l[1]=n,u.uniforms.start=s,u.uniforms.end=l,u.uniforms.width=a*o.pixelRatio,u.uniforms.color=i,c.drawArrays(c.TRIANGLE_STRIP,0,4)}),u.dispose=function(){this.vbo.dispose(),this.shader.dispose()}},{"./shaders":206,"gl-buffer":162,"gl-shader":217}],206:[function(t,e,r){"use strict";var n=t("glslify"),a=n(["precision lowp float;\n#define GLSLIFY 1\nuniform vec4 color;\nvoid main() {\n gl_FragColor = vec4(color.xyz * color.w, color.w);\n}\n"]);e.exports={lineVert:n(["precision mediump float;\n#define GLSLIFY 1\n\nattribute vec2 coord;\n\nuniform vec4 screenBox;\nuniform vec2 start, end;\nuniform float width;\n\nvec2 perp(vec2 v) {\n return vec2(v.y, -v.x);\n}\n\nvec2 screen(vec2 v) {\n return 2.0 * (v - screenBox.xy) / (screenBox.zw - screenBox.xy) - 1.0;\n}\n\nvoid main() {\n vec2 delta = normalize(perp(start - end));\n vec2 offset = mix(start, end, 0.5 * (coord.y+1.0));\n gl_Position = vec4(screen(offset + 0.5 * width * delta * coord.x), 0, 1);\n}\n"]),lineFrag:a,textVert:n(["#define GLSLIFY 1\nattribute vec3 textCoordinate;\n\nuniform vec2 dataScale, dataShift, dataAxis, screenOffset, textScale;\nuniform float angle;\n\nvoid main() {\n float dataOffset = textCoordinate.z;\n vec2 glyphOffset = textCoordinate.xy;\n mat2 glyphMatrix = mat2(cos(angle), sin(angle), -sin(angle), cos(angle));\n vec2 screenCoordinate = dataAxis * (dataScale * dataOffset + dataShift) +\n glyphMatrix * glyphOffset * textScale + screenOffset;\n gl_Position = vec4(screenCoordinate, 0, 1);\n}\n"]),textFrag:a,gridVert:n(["precision mediump float;\n#define GLSLIFY 1\n\nattribute vec3 dataCoord;\n\nuniform vec2 dataAxis, dataShift, dataScale;\nuniform float lineWidth;\n\nvoid main() {\n vec2 pos = dataAxis * (dataScale * dataCoord.x + dataShift);\n pos += 10.0 * dataCoord.y * vec2(dataAxis.y, -dataAxis.x) + dataCoord.z * lineWidth;\n gl_Position = vec4(pos, 0, 1);\n}\n"]),gridFrag:a,boxVert:n(["precision mediump float;\n#define GLSLIFY 1\n\nattribute vec2 coord;\n\nuniform vec4 screenBox;\nuniform vec2 lo, hi;\n\nvec2 screen(vec2 v) {\n return 2.0 * (v - screenBox.xy) / (screenBox.zw - screenBox.xy) - 1.0;\n}\n\nvoid main() {\n gl_Position = vec4(screen(mix(lo, hi, coord)), 0, 1);\n}\n"]),tickVert:n(["precision mediump float;\n#define GLSLIFY 1\n\nattribute vec3 dataCoord;\n\nuniform vec2 dataAxis, dataShift, dataScale, screenOffset, tickScale;\n\nvoid main() {\n vec2 pos = dataAxis * (dataScale * dataCoord.x + dataShift);\n gl_Position = vec4(pos + tickScale*dataCoord.yz + screenOffset, 0, 1);\n}\n"])}},{glslify:208}],207:[function(t,e,r){"use strict";e.exports=function(t){var e=t.gl,r=n(e),i=a(e,s.textVert,s.textFrag);return new l(t,r,i)};var n=t("gl-buffer"),a=t("gl-shader"),i=t("text-cache"),o=t("binary-search-bounds"),s=t("./shaders");function l(t,e,r){this.plot=t,this.vbo=e,this.shader=r,this.tickOffset=[[],[]],this.tickX=[[],[]],this.labelOffset=[0,0],this.labelCount=[0,0]}var u,c,f,d,h,p,g=l.prototype;g.drawTicks=(u=[0,0],c=[0,0],f=[0,0],function(t){var e=this.plot,r=this.shader,n=this.tickX[t],a=this.tickOffset[t],i=e.gl,s=e.viewBox,l=e.dataBox,d=e.screenBox,h=e.pixelRatio,p=e.tickEnable,g=e.tickPad,v=e.tickColor,m=e.tickAngle,y=e.labelEnable,b=e.labelPad,x=e.labelColor,_=e.labelAngle,w=this.labelOffset[t],A=this.labelCount[t],T=o.lt(n,l[t]),k=o.le(n,l[t+2]);u[0]=u[1]=0,u[t]=1,c[t]=(s[2+t]+s[t])/(d[2+t]-d[t])-1;var M=2/d[2+(1^t)]-d[1^t];c[1^t]=M*s[1^t]-1,p[t]&&(c[1^t]-=M*h*g[t],T<k&&a[k]>a[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],T<k&&a[k]>a[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<d.length;++e){var h=d[e],p=h.x,g=h.text,v=h.font||"sans-serif";a=h.fontSize||12;for(var m=1/(u[o+2]-u[o]),y=u[o],b=g.split("\n"),x=0;x<b.length;x++)for(n=i(v,b[x]).data,r=0;r<n.length;r+=2)s.push(n[r]*a,-n[r+1]*a-x*a*1.2,(p-y)*m);c.push(Math.floor(s.length/3)),f.push(p)}this.tickOffset[o]=c,this.tickX[o]=f}for(o=0;o<2;++o){for(this.labelOffset[o]=Math.floor(s.length/3),n=i(t.labelFont[o],t.labels[o],{textAlign:"center"}).data,a=t.labelSize[o],e=0;e<n.length;e+=2)s.push(n[e]*a,-n[e+1]*a,0);this.labelCount[o]=Math.floor(s.length/3)-this.labelOffset[o]}for(this.titleOffset=Math.floor(s.length/3),n=i(t.titleFont,t.title).data,a=t.titleSize,e=0;e<n.length;e+=2)s.push(n[e]*a,-n[e+1]*a,0);this.titleCount=Math.floor(s.length/3)-this.titleOffset,this.vbo.update(s)},g.dispose=function(){this.vbo.dispose(),this.shader.dispose()}},{"./shaders":206,"binary-search-bounds":39,"gl-buffer":162,"gl-shader":217,"text-cache":321}],208:[function(t,e,r){arguments[4][167][0].apply(r,arguments)},{dup:167}],209:[function(t,e,r){"use strict";e.exports=function(t){var e=t.gl,r=n(e,[e.drawingBufferWidth,e.drawingBufferHeight]),u=new l(e,r);return u.grid=a(u),u.text=i(u),u.line=o(u),u.box=s(u),u.update(t),u};var n=t("gl-select-static"),a=t("./lib/grid"),i=t("./lib/text"),o=t("./lib/line"),s=t("./lib/box");function l(t,e){this.gl=t,this.pickBuffer=e,this.screenBox=[0,0,t.drawingBufferWidth,t.drawingBufferHeight],this.viewBox=[0,0,0,0],this.dataBox=[-10,-10,10,10],this.gridLineEnable=[!0,!0],this.gridLineWidth=[1,1],this.gridLineColor=[[0,0,0,1],[0,0,0,1]],this.pixelRatio=1,this.tickMarkLength=[0,0,0,0],this.tickMarkWidth=[0,0,0,0],this.tickMarkColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.tickPad=[15,15,15,15],this.tickAngle=[0,0,0,0],this.tickEnable=[!0,!0,!0,!0],this.tickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.labelPad=[15,15,15,15],this.labelAngle=[0,Math.PI/2,0,3*Math.PI/2],this.labelEnable=[!0,!0,!0,!0],this.labelColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.titleCenter=[0,0],this.titleEnable=!0,this.titleAngle=0,this.titleColor=[0,0,0,1],this.borderColor=[0,0,0,0],this.backgroundColor=[0,0,0,0],this.zeroLineEnable=[!0,!0],this.zeroLineWidth=[4,4],this.zeroLineColor=[[0,0,0,1],[0,0,0,1]],this.borderLineEnable=[!0,!0,!0,!0],this.borderLineWidth=[2,2,2,2],this.borderLineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.grid=null,this.text=null,this.line=null,this.box=null,this.objects=[],this.overlays=[],this._tickBounds=[1/0,1/0,-1/0,-1/0],this.static=!1,this.dirty=!1,this.pickDirty=!1,this.pickDelay=120,this.pickRadius=10,this._pickTimeout=null,this._drawPick=this.drawPick.bind(this),this._depthCounter=0}var u=l.prototype;function c(t){for(var e=t.slice(),r=0;r<e.length;++r)e[r]=e[r].slice();return e}function f(t,e){return t.x-e.x}u.setDirty=function(){this.dirty=this.pickDirty=!0},u.setOverlayDirty=function(){this.dirty=!0},u.nextDepthValue=function(){return this._depthCounter++/65536},u.draw=function(){var t=this.gl,e=this.screenBox,r=this.viewBox,n=this.dataBox,a=this.pixelRatio,i=this.grid,o=this.line,s=this.text,l=this.objects;if(this._depthCounter=0,this.pickDirty&&(this._pickTimeout&&clearTimeout(this._pickTimeout),this.pickDirty=!1,this._pickTimeout=setTimeout(this._drawPick,this.pickDelay)),this.dirty){if(this.dirty=!1,t.bindFramebuffer(t.FRAMEBUFFER,null),t.enable(t.SCISSOR_TEST),t.disable(t.DEPTH_TEST),t.depthFunc(t.LESS),t.depthMask(!1),t.enable(t.BLEND),t.blendEquation(t.FUNC_ADD,t.FUNC_ADD),t.blendFunc(t.ONE,t.ONE_MINUS_SRC_ALPHA),this.borderColor){t.scissor(e[0],e[1],e[2]-e[0],e[3]-e[1]);var u=this.borderColor;t.clearColor(u[0]*u[3],u[1]*u[3],u[2]*u[3],u[3]),t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT)}t.scissor(r[0],r[1],r[2]-r[0],r[3]-r[1]),t.viewport(r[0],r[1],r[2]-r[0],r[3]-r[1]);var c=this.backgroundColor;t.clearColor(c[0]*c[3],c[1]*c[3],c[2]*c[3],c[3]),t.clear(t.COLOR_BUFFER_BIT),i.draw();var f=this.zeroLineEnable,d=this.zeroLineColor,h=this.zeroLineWidth;if(f[0]||f[1]){o.bind();for(var p=0;p<2;++p)if(f[p]&&n[p]<=0&&n[p+2]>=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<l.length;++p)l[p].draw();t.viewport(e[0],e[1],e[2]-e[0],e[3]-e[1]),t.scissor(e[0],e[1],e[2]-e[0],e[3]-e[1]),this.grid.drawTickMarks(),o.bind();var v=this.borderLineEnable,m=this.borderLineWidth,y=this.borderLineColor;for(v[1]&&o.drawLine(r[0],r[1]-.5*m[1]*a,r[0],r[3]+.5*m[3]*a,m[1],y[1]),v[0]&&o.drawLine(r[0]-.5*m[0]*a,r[1],r[2]+.5*m[2]*a,r[1],m[0],y[0]),v[3]&&o.drawLine(r[2],r[1]-.5*m[1]*a,r[2],r[3]+.5*m[3]*a,m[3],y[3]),v[2]&&o.drawLine(r[0]-.5*m[0]*a,r[3],r[2]+.5*m[2]*a,r[3],m[2],y[2]),s.bind(),p=0;p<2;++p)s.drawTicks(p);this.titleEnable&&s.drawTitle();var b=this.overlays;for(p=0;p<b.length;++p)b[p].draw();t.disable(t.SCISSOR_TEST),t.disable(t.BLEND),t.depthMask(!0)}},u.drawPick=function(){if(!this.static){var t=this.pickBuffer;this.gl,this._pickTimeout=null,t.begin();for(var e=1,r=this.objects,n=0;n<r.length;++n)e=r[n].drawPick(e);t.end()}},u.pick=function(t,e){if(!this.static){var r=this.pixelRatio,n=this.pickPixelRatio,a=this.viewBox,i=0|Math.round((t-a[0]/r)*n),o=0|Math.round((e-a[1]/r)*n),s=this.pickBuffer.query(i,o,this.pickRadius);if(!s)return null;for(var l=s.id+(s.value[0]<<8)+(s.value[1]<<16)+(s.value[2]<<24),u=this.objects,c=0;c<u.length;++c){var f=u[c].pick(i,o,l);if(f)return f}return null}},u.setScreenBox=function(t){var e=this.screenBox,r=this.pixelRatio;e[0]=0|Math.round(t[0]*r),e[1]=0|Math.round(t[1]*r),e[2]=0|Math.round(t[2]*r),e[3]=0|Math.round(t[3]*r),this.setDirty()},u.setDataBox=function(t){var e=this.dataBox;(e[0]!==t[0]||e[1]!==t[1]||e[2]!==t[2]||e[3]!==t[3])&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],this.setDirty())},u.setViewBox=function(t){var e=this.pixelRatio,r=this.viewBox;r[0]=0|Math.round(t[0]*e),r[1]=0|Math.round(t[1]*e),r[2]=0|Math.round(t[2]*e),r[3]=0|Math.round(t[3]*e);var n=this.pickPixelRatio;this.pickBuffer.shape=[0|Math.round((t[2]-t[0])*n),0|Math.round((t[3]-t[1])*n)],this.setDirty()},u.update=function(t){t=t||{};var e=this.gl;this.pixelRatio=t.pixelRatio||1;var r=this.pixelRatio;this.pickPixelRatio=Math.max(r,1),this.setScreenBox(t.screenBox||[0,0,e.drawingBufferWidth/r,e.drawingBufferHeight/r]);this.screenBox;this.setViewBox(t.viewBox||[.125*(this.screenBox[2]-this.screenBox[0])/r,.125*(this.screenBox[3]-this.screenBox[1])/r,.875*(this.screenBox[2]-this.screenBox[0])/r,.875*(this.screenBox[3]-this.screenBox[1])/r]);var n=this.viewBox,a=(n[2]-n[0])/(n[3]-n[1]);this.setDataBox(t.dataBox||[-10,-10/a,10,10/a]),this.borderColor=!1!==t.borderColor&&(t.borderColor||[0,0,0,0]).slice(),this.backgroundColor=(t.backgroundColor||[0,0,0,0]).slice(),this.gridLineEnable=(t.gridLineEnable||[!0,!0]).slice(),this.gridLineWidth=(t.gridLineWidth||[1,1]).slice(),this.gridLineColor=c(t.gridLineColor||[[.5,.5,.5,1],[.5,.5,.5,1]]),this.zeroLineEnable=(t.zeroLineEnable||[!0,!0]).slice(),this.zeroLineWidth=(t.zeroLineWidth||[4,4]).slice(),this.zeroLineColor=c(t.zeroLineColor||[[0,0,0,1],[0,0,0,1]]),this.tickMarkLength=(t.tickMarkLength||[0,0,0,0]).slice(),this.tickMarkWidth=(t.tickMarkWidth||[0,0,0,0]).slice(),this.tickMarkColor=c(t.tickMarkColor||[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]]),this.titleCenter=(t.titleCenter||[.5*(n[0]+n[2])/r,(n[3]+120)/r]).slice(),this.titleEnable=!("titleEnable"in t)||!!t.titleEnable,this.titleAngle=t.titleAngle||0,this.titleColor=(t.titleColor||[0,0,0,1]).slice(),this.labelPad=(t.labelPad||[15,15,15,15]).slice(),this.labelAngle=(t.labelAngle||[0,Math.PI/2,0,3*Math.PI/2]).slice(),this.labelEnable=(t.labelEnable||[!0,!0,!0,!0]).slice(),this.labelColor=c(t.labelColor||[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]]),this.tickPad=(t.tickPad||[15,15,15,15]).slice(),this.tickAngle=(t.tickAngle||[0,0,0,0]).slice(),this.tickEnable=(t.tickEnable||[!0,!0,!0,!0]).slice(),this.tickColor=c(t.tickColor||[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]]),this.borderLineEnable=(t.borderLineEnable||[!0,!0,!0,!0]).slice(),this.borderLineWidth=(t.borderLineWidth||[2,2,2,2]).slice(),this.borderLineColor=c(t.borderLineColor||[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]]);var i=t.ticks||[[],[]],o=this._tickBounds;o[0]=o[1]=1/0,o[2]=o[3]=-1/0;for(var s=0;s<2;++s){var l=i[s].slice(0);0!==l.length&&(l.sort(f),o[s]=Math.min(o[s],l[0].x),o[s+2]=Math.max(o[s+2],l[l.length-1].x))}this.grid.update({bounds:o,ticks:i}),this.text.update({bounds:o,ticks:i,labels:t.labels||["x","y"],labelSize:t.labelSize||[12,12],labelFont:t.labelFont||["sans-serif","sans-serif"],title:t.title||"",titleSize:t.titleSize||18,titleFont:t.titleFont||"sans-serif"}),this.static=!!t.static,this.setDirty()},u.dispose=function(){this.box.dispose(),this.grid.dispose(),this.text.dispose(),this.line.dispose();for(var t=this.objects.length-1;t>=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<e.length;++r)if(e[r]===t){e.splice(r,1),this.setDirty();break}},u.addOverlay=function(t){this.overlays.indexOf(t)<0&&(this.overlays.push(t),this.setOverlayDirty())},u.removeOverlay=function(t){for(var e=this.overlays,r=0;r<e.length;++r)if(e[r]===t){e.splice(r,1),this.setOverlayDirty();break}}},{"./lib/box":203,"./lib/grid":204,"./lib/line":205,"./lib/text":207,"gl-select-static":216}],210:[function(t,e,r){var n=t("glslify");r.pointVertex=n(["precision mediump float;\n#define GLSLIFY 1\n\nattribute vec2 position;\n\nuniform mat3 matrix;\nuniform float pointSize;\nuniform float pointCloud;\n\nhighp float rand(vec2 co) {\n highp float a = 12.9898;\n highp float b = 78.233;\n highp float c = 43758.5453;\n highp float d = dot(co.xy, vec2(a, b));\n highp float e = mod(d, 3.14);\n return fract(sin(e) * c);\n}\n\nvoid main() {\n vec3 hgPosition = matrix * vec3(position, 1);\n gl_Position = vec4(hgPosition.xy, 0, hgPosition.z);\n // if we don't jitter the point size a bit, overall point cloud\n // saturation 'jumps' on zooming, which is disturbing and confusing\n gl_PointSize = pointSize * ((19.5 + rand(position)) / 20.0);\n if(pointCloud != 0.0) { // pointCloud is truthy\n // get the same square surface as circle would be\n gl_PointSize *= 0.886;\n }\n}"]),r.pointFragment=n(["precision mediump float;\n#define GLSLIFY 1\n\nuniform vec4 color, borderColor;\nuniform float centerFraction;\nuniform float pointCloud;\n\nvoid main() {\n float radius;\n vec4 baseColor;\n if(pointCloud != 0.0) { // pointCloud is truthy\n if(centerFraction == 1.0) {\n gl_FragColor = color;\n } else {\n gl_FragColor = mix(borderColor, color, centerFraction);\n }\n } else {\n radius = length(2.0 * gl_PointCoord.xy - 1.0);\n if(radius > 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<n;e++)u[e]=e;this.points=s,this.offsetBuffer.update(l),this.pickBuffer.update(u),a||i.free(l),o||i.free(u),this.pointCount=n,this.pickOffset=0},c.unifiedDraw=(l=[1,0,0,0,1,0,0,0,1],u=[0,0,0,0],function(t){var e=void 0!==t,r=e?this.pickShader:this.shader,n=this.plot.gl,a=this.plot.dataBox;if(0===this.pointCount)return t;var i=a[2]-a[0],o=a[3]-a[1],s=function(t,e){var r,n=0,a=t.length>>>1;for(r=0;r<a;r++){var i=t[2*r],o=t[2*r+1];i>=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||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]),!(h<f||p<d)){o.bind();var g=s[2]-s[0],v=s[3]-s[1];if(this.outerFill&&(o.drawBox(0,0,g,d,a),o.drawBox(0,d,f,p,a),o.drawBox(0,p,g,v,a),o.drawBox(h,d,g,p,a)),this.innerFill&&o.drawBox(f,d,h,p,n),r>0){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;i<r*e*4;++i)n[i]=255}return t}}}),u.begin=function(){var t=this.gl;this.shape;t&&(this.fbo.bind(),t.clearColor(1,1,1,1),t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT))},u.end=function(){var t=this.gl;t&&(t.bindFramebuffer(t.FRAMEBUFFER,null),this._readTimeout||clearTimeout(this._readTimeout),this._readTimeout=setTimeout(this._readCallback,1))},u.query=function(t,e,r){if(!this.gl)return null;var n=this.fbo.shape.slice();t|=0,e|=0,"number"!=typeof r&&(r=1);var a=0|Math.min(Math.max(t-r,0),n[0]),o=0|Math.min(Math.max(t+r,0),n[0]),l=0|Math.min(Math.max(e-r,0),n[1]),u=0|Math.min(Math.max(e+r,0),n[1]);if(o<=a||u<=l)return null;var c=[o-a,u-l],f=i(this.buffer,[c[0],c[1],4],[4,4*n[0],1],4*(a+n[0]*l)),d=function(t,e,r){for(var n=1e8,a=-1,i=-1,o=t.shape[0],s=t.shape[1],l=0;l<o;l++)for(var u=0;u<s;u++){var c=t.get(l,u,0),f=t.get(l,u,1),d=t.get(l,u,2),h=t.get(l,u,3);if(c<255||f<255||d<255||h<255){var p=e-l,g=r-u,v=p*p+g*g;v<n&&(n=v,a=l,i=u)}}return[a,i,n]}(f.hi(c[0],c[1],1),r,r),h=d[0],p=d[1];return h<0||Math.pow(this.radius,2)<d[2]?null:new s(h+a|0,p+l|0,f.get(h,p,0),[f.get(h,p,1),f.get(h,p,2),f.get(h,p,3)],Math.sqrt(d[2]))},u.dispose=function(){this.gl&&(this.fbo.dispose(),a.free(this.buffer),this.gl=null,this._readTimeout&&clearTimeout(this._readTimeout))}},{"bit-twiddle":40,"gl-fbo":168,ndarray:259,"typedarray-pool":339}],217:[function(t,e,r){"use strict";var n=t("./lib/create-uniforms"),a=t("./lib/create-attributes"),i=t("./lib/reflect"),o=t("./lib/shader-cache"),s=t("./lib/runtime-reflect"),l=t("./lib/GLError");function u(t){this.gl=t,this.gl.lastAttribCount=0,this._vref=this._fref=this._relink=this.vertShader=this.fragShader=this.program=this.attributes=this.uniforms=this.types=null}var c=u.prototype;function f(t,e){return t.name<e.name?-1:1}c.bind=function(){var t;this.program||this._relink();var e=this.gl.getProgramParameter(this.program,this.gl.ACTIVE_ATTRIBUTES),r=this.gl.lastAttribCount;if(e>r)for(t=r;t<e;t++)this.gl.enableVertexAttribArray(t);else if(r>e)for(t=e;t<r;t++)this.gl.disableVertexAttribArray(t);this.gl.lastAttribCount=e,this.gl.useProgram(this.program)},c.dispose=function(){for(var t=this.gl.lastAttribCount,e=0;e<t;e++)this.gl.disableVertexAttribArray(e);this.gl.lastAttribCount=0,this._fref&&this._fref.dispose(),this._vref&&this._vref.dispose(),this.attributes=this.types=this.vertShader=this.fragShader=this.program=this._relink=this._fref=this._vref=null},c.update=function(t,e,r,u){if(!e||1===arguments.length){var c=t;t=c.vertex,e=c.fragment,r=c.uniforms,u=c.attributes}var d=this,h=d.gl,p=d._vref;d._vref=o.shader(h,h.VERTEX_SHADER,t),p&&p.dispose(),d.vertShader=d._vref.shader;var g=this._fref;if(d._fref=o.shader(h,h.FRAGMENT_SHADER,e),g&&g.dispose(),d.fragShader=d._fref.shader,!r||!u){var v=h.createProgram();if(h.attachShader(v,d.fragShader),h.attachShader(v,d.vertShader),h.linkProgram(v),!h.getProgramParameter(v,h.LINK_STATUS)){var m=h.getProgramInfoLog(v);throw new l(m,"Error linking program:"+m)}r=r||s.uniforms(h,v),u=u||s.attributes(h,v),h.deleteProgram(v)}(u=u.slice()).sort(f);var y,b=[],x=[],_=[];for(y=0;y<u.length;++y){var w=u[y];if(w.type.indexOf("mat")>=0){for(var A=0|w.type.charAt(w.type.length-1),T=new Array(A),k=0;k<A;++k)T[k]=_.length,x.push(w.name+"["+k+"]"),"number"==typeof w.location?_.push(w.location+k):Array.isArray(w.location)&&w.location.length===A&&"number"==typeof w.location[k]?_.push(0|w.location[k]):_.push(-1);b.push({name:w.name,type:w.type,locations:T})}else b.push({name:w.name,type:w.type,locations:[_.length]}),x.push(w.name),"number"==typeof w.location?_.push(0|w.location):_.push(-1)}var M=0;for(y=0;y<_.length;++y)if(_[y]<0){for(;_.indexOf(M)>=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<r.length;++t)E[t]=h.getUniformLocation(d.program,r[t].name)}S(),d._relink=S,d.types={uniforms:i(r),attributes:i(u)},d.attributes=a(h,d,b,_),Object.defineProperty(d,"uniforms",n(h,d,r,E))},e.exports=function(t,e,r,n,a){var i=new u(t);return i.update(e,r,n,a),i}},{"./lib/GLError":218,"./lib/create-attributes":219,"./lib/create-uniforms":220,"./lib/reflect":221,"./lib/runtime-reflect":222,"./lib/shader-cache":223}],218:[function(t,e,r){function n(t,e,r){this.shortMessage=e||"",this.longMessage=r||"",this.rawError=t||"",this.message="gl-shader: "+(e||t||"")+(r?"\n"+r:""),this.stack=(new Error).stack}n.prototype=new Error,n.prototype.name="GLError",n.prototype.constructor=n,e.exports=n},{}],219:[function(t,e,r){"use strict";e.exports=function(t,e,r,a){for(var i={},l=0,u=r.length;l<u;++l){var c=r[l],f=c.name,d=c.type,h=c.locations;switch(d){case"bool":case"int":case"float":o(t,e,h[0],a,1,i,f);break;default:if(d.indexOf("vec")>=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;c<i;++c)l.push("x"+c),u.push("x"+c);l.push("if(x0.length===void 0){return gl.vertexAttrib"+i+"f(v,"+u.join()+")}else{return gl.vertexAttrib"+i+"fv(v,x0)}");var f=Function.apply(null,l),d=new a(t,e,r,n,i,f);Object.defineProperty(o,s,{set:function(e){return t.disableVertexAttribArray(n[r]),f(t,n[r],e),e},get:function(){return d},enumerable:!0})}function s(t,e,r,n,a,i,s){for(var l=new Array(a),u=new Array(a),c=0;c<a;++c)o(t,e,r[c],n,a,l,c),u[c]=l[c];Object.defineProperty(l,"location",{set:function(t){if(Array.isArray(t))for(var e=0;e<a;++e)u[e].location=t[e];else for(e=0;e<a;++e)u[e].location=t+e;return t},get:function(){for(var t=new Array(a),e=0;e<a;++e)t[e]=n[r[e]];return t},enumerable:!0}),l.pointer=function(e,i,o,s){e=e||t.FLOAT,i=!!i,o=o||a*a,s=s||0;for(var l=0;l<a;++l){var u=n[r[l]];t.vertexAttribPointer(u,a,e,i,o,s+l*a),t.enableVertexAttribArray(u)}};var f=new Array(a),d=t["vertexAttrib"+a+"fv"];Object.defineProperty(i,s,{set:function(e){for(var i=0;i<a;++i){var o=n[r[i]];if(t.disableVertexAttribArray(o),Array.isArray(e[0]))d.call(t,o,e[i]);else{for(var s=0;s<a;++s)f[s]=e[a*i+s];d.call(t,o,f)}}return e},get:function(){return l},enumerable:!0})}i.pointer=function(t,e,r,n){var a=this._gl,i=this._locations[this._index];a.vertexAttribPointer(i,this._dimension,t||a.FLOAT,!!e,r||0,n||0),a.enableVertexAttribArray(i)},i.set=function(t,e,r,n){return this._constFunc(this._locations[this._index],t,e,r,n)},Object.defineProperty(i,"location",{get:function(){return this._locations[this._index]},set:function(t){return t!==this._locations[this._index]&&(this._locations[this._index]=0|t,this._wrapper.program=null),0|t}})},{"./GLError":218}],220:[function(t,e,r){"use strict";var n=t("./reflect"),a=t("./GLError");function i(t){return new Function("y","return function(){return y}")(t)}function o(t,e){for(var r=new Array(t),n=0;n<t;++n)r[n]=e;return r}e.exports=function(t,e,r,s){function l(t,e,r){switch(r){case"bool":case"int":case"sampler2D":case"samplerCube":return"gl.uniform1i(locations["+e+"],obj"+t+")";case"float":return"gl.uniform1f(locations["+e+"],obj"+t+")";default:var n=r.indexOf("vec");if(!(0<=n&&n<=1&&r.length===4+n)){if(0===r.indexOf("mat")&&4===r.length){var i;if((i=r.charCodeAt(r.length-1)-48)<2||i>4)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;i<a.length;++i){var o=a[i],u=o[0],c=o[1];s[c]&&n.push(l(u,c,r[c].type))}return n.push("return obj}"),new Function("gl","locations",n.join("\n"))(t,s)}function c(n,l,c){if("object"==typeof c){var d=f(c);Object.defineProperty(n,l,{get:i(d),set:u(c),enumerable:!0,configurable:!1})}else s[c]?Object.defineProperty(n,l,{get:(h=c,new Function("gl","wrapper","locations","return function(){return gl.getUniform(wrapper.program,locations["+h+"])}")(t,e,s)),set:u(c),enumerable:!0,configurable:!1}):n[l]=function(t){switch(t){case"bool":return!1;case"int":case"sampler2D":case"samplerCube":case"float":return 0;default:var e=t.indexOf("vec");if(0<=e&&e<=1&&t.length===4+e){if((r=t.charCodeAt(t.length-1)-48)<2||r>4)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;r<t.length;++r)c(e,r,t[r])}else for(var n in e={},t)c(e,n,t[n]);return e}var d=n(r,!0);return{get:i(f(d)),set:u(d),enumerable:!0,configurable:!0}}},{"./GLError":218,"./reflect":221}],221:[function(t,e,r){"use strict";e.exports=function(t,e){for(var r={},n=0;n<t.length;++n)for(var a=t[n].name.split("."),i=r,o=0;o<a.length;++o){var s=a[o].split("[");if(s.length>1){s[0]in i||(i[s[0]]=[]),i=i[s[0]];for(var l=1;l<s.length;++l){var u=parseInt(s[l]);l<s.length-1||o<a.length-1?(u in i||(l<s.length-1?i[u]=[]:i[u]={}),i=i[u]):i[u]=e?n:t[n].type}}else o<a.length-1?(s[0]in i||(i[s[0]]={}),i=i[s[0]]):i[s[0]]=e?n:t[n].type}return r}},{}],222:[function(t,e,r){"use strict";r.uniforms=function(t,e){for(var r=t.getProgramParameter(e,t.ACTIVE_UNIFORMS),n=[],a=0;a<r;++a){var o=t.getActiveUniform(e,a);if(o){var s=i(t,o.type);if(o.size>1)for(var l=0;l<o.size;++l)n.push({name:o.name.replace("[0]","["+l+"]"),type:s});else n.push({name:o.name,type:s})}}return n},r.attributes=function(t,e){for(var r=t.getProgramParameter(e,t.ACTIVE_ATTRIBUTES),n=[],a=0;a<r;++a){var o=t.getActiveAttrib(e,a);o&&n.push({name:o.name,type:i(t,o.type)})}return n};var n={FLOAT:"float",FLOAT_VEC2:"vec2",FLOAT_VEC3:"vec3",FLOAT_VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",FLOAT_MAT2:"mat2",FLOAT_MAT3:"mat3",FLOAT_MAT4:"mat4",SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube"},a=null;function i(t,e){if(!a){var r=Object.keys(n);a={};for(var i=0;i<r.length;++i){var o=r[i];a[t[o]]=n[o]}}return a[e]}},{}],223:[function(t,e,r){"use strict";r.shader=function(t,e,r){return c(t).getShaderReference(e,r)},r.program=function(t,e,r,n,a){return c(t).getProgram(e,r,n,a)};var n=t("./GLError"),a=t("gl-format-compiler-error"),i=new("undefined"==typeof WeakMap?t("weakmap-shim"):WeakMap),o=0;function s(t,e,r,n,a,i,o){this.id=t,this.src=e,this.type=r,this.shader=n,this.count=i,this.programs=[],this.cache=o}function l(t){this.gl=t,this.shaders=[{},{}],this.programs={}}s.prototype.dispose=function(){if(0==--this.count){for(var t=this.cache,e=t.gl,r=this.programs,n=0,a=r.length;n<a;++n){var i=t.programs[r[n]];i&&(delete t.programs[n],e.deleteProgram(i))}e.deleteShader(this.shader),delete t.shaders[this.type===e.FRAGMENT_SHADER|0][this.src]}};var u=l.prototype;function c(t){var e=i.get(t);return e||(e=new l(t),i.set(t,e)),e}u.getShaderReference=function(t,e){var r=this.gl,i=this.shaders[t===r.FRAGMENT_SHADER|0],l=i[e];if(l&&r.isShader(l.shader))l.count+=1;else{var u=function(t,e,r){var i=t.createShader(e);if(t.shaderSource(i,r),t.compileShader(i),!t.getShaderParameter(i,t.COMPILE_STATUS)){var o=t.getShaderInfoLog(i);try{var s=a(o,r,e)}catch(t){throw console.warn("Failed to format compiler error: "+t),new n(o,"Error compiling shader:\n"+o)}throw new n(o,s.short,s.long)}return i}(r,t,e);l=i[e]=new s(o++,e,t,u,[],1,this)}return l},u.getProgram=function(t,e,r,a){var i=[t.id,e.id,r.join(":"),a.join(":")].join("@"),o=this.programs[i];return o&&this.gl.isProgram(o)||(this.programs[i]=o=function(t,e,r,a,i){var o=t.createProgram();t.attachShader(o,e),t.attachShader(o,r);for(var s=0;s<a.length;++s)t.bindAttribLocation(o,i[s],a[s]);if(t.linkProgram(o),!t.getProgramParameter(o,t.LINK_STATUS)){var l=t.getProgramInfoLog(o);throw new n(l,"Error linking program: "+l)}return o}(this.gl,t.shader,e.shader,r,a),t.programs.push(i),e.programs.push(i)),o}},{"./GLError":218,"gl-format-compiler-error":169,"weakmap-shim":348}],224:[function(t,e,r){"use strict";function n(t){this.plot=t,this.enable=[!0,!0,!1,!1],this.width=[1,1,1,1],this.color=[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.center=[1/0,1/0]}e.exports=function(t,e){var r=new n(t);return r.update(e),t.addOverlay(r),r};var a=n.prototype;a.update=function(t){t=t||{},this.enable=(t.enable||[!0,!0,!1,!1]).slice(),this.width=(t.width||[1,1,1,1]).slice(),this.color=(t.color||[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]]).map((function(t){return t.slice()})),this.center=(t.center||[1/0,1/0]).slice(),this.plot.setOverlayDirty()},a.draw=function(){var t=this.enable,e=this.width,r=this.color,n=this.center,a=this.plot,i=a.line,o=a.dataBox,s=a.viewBox;if(i.bind(),o[0]<=n[0]&&n[0]<=o[2]&&o[1]<=n[1]&&n[1]<=o[3]){var l=s[0]+(n[0]-o[0])/(o[2]-o[0])*(s[2]-s[0]),u=s[1]+(n[1]-o[1])/(o[3]-o[1])*(s[3]-s[1]);t[0]&&i.drawLine(l,u,s[0],u,e[0],r[0]),t[1]&&i.drawLine(l,u,l,s[1],e[1],r[1]),t[2]&&i.drawLine(l,u,s[2],u,e[2],r[2]),t[3]&&i.drawLine(l,u,l,s[3],e[3],r[3])}},a.dispose=function(){this.plot.removeOverlay(this)}},{}],225:[function(t,e,r){"use strict";var n=t("css-font"),a=t("pick-by-alias"),i=t("regl"),o=t("gl-util/context"),s=t("es6-weak-map"),l=t("color-normalize"),u=t("font-atlas"),c=t("typedarray-pool"),f=t("parse-rect"),d=t("is-plain-obj"),h=t("parse-unit"),p=t("to-px"),g=t("detect-kerning"),v=t("object-assign"),m=t("font-measure"),y=t("flatten-vertex-data"),b=t("bit-twiddle").nextPow2,x=new s,_=!1;if(document.body){var w=document.body.appendChild(document.createElement("div"));w.style.font="italic small-caps bold condensed 16px/2 cursive",getComputedStyle(w).fontStretch&&(_=!0),document.body.removeChild(w)}var A=function(t){!function(t){return"function"==typeof t&&t._gl&&t.prop&&t.texture&&t.buffer}(t)?this.gl=o(t):(t={regl:t},this.gl=t.regl._gl),this.shader=x.get(this.gl),this.shader?this.regl=this.shader.regl:this.regl=t.regl||i({gl:this.gl}),this.charBuffer=this.regl.buffer({type:"uint8",usage:"stream"}),this.sizeBuffer=this.regl.buffer({type:"float",usage:"stream"}),this.shader||(this.shader=this.createShader(),x.set(this.gl,this.shader)),this.batch=[],this.fontSize=[],this.font=[],this.fontAtlas=[],this.draw=this.shader.draw.bind(this),this.render=function(){this.regl._refresh(),this.draw(this.batch)},this.canvas=this.gl.canvas,this.update(d(t)?t:{})};A.prototype.createShader=function(){var t=this.regl,e=t({blend:{enable:!0,color:[0,0,0,1],func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:"one minus dst alpha",dstAlpha:"one"}},stencil:{enable:!1},depth:{enable:!1},count:t.prop("count"),offset:t.prop("offset"),attributes:{charOffset:{offset:4,stride:8,buffer:t.this("sizeBuffer")},width:{offset:0,stride:8,buffer:t.this("sizeBuffer")},char:t.this("charBuffer"),position:t.this("position")},uniforms:{atlasSize:function(t,e){return[e.atlas.width,e.atlas.height]},atlasDim:function(t,e){return[e.atlas.cols,e.atlas.rows]},atlas:function(t,e){return e.atlas.texture},charStep:function(t,e){return e.atlas.step},em:function(t,e){return e.atlas.em},color:t.prop("color"),opacity:t.prop("opacity"),viewport:t.this("viewportArray"),scale:t.this("scale"),align:t.prop("align"),baseline:t.prop("baseline"),translate:t.this("translate"),positionOffset:t.prop("positionOffset")},primitive:"points",viewport:t.this("viewport"),vert:"\n\t\t\tprecision highp float;\n\t\t\tattribute float width, charOffset, char;\n\t\t\tattribute vec2 position;\n\t\t\tuniform float fontSize, charStep, em, align, baseline;\n\t\t\tuniform vec4 viewport;\n\t\t\tuniform vec4 color;\n\t\t\tuniform vec2 atlasSize, atlasDim, scale, translate, positionOffset;\n\t\t\tvarying vec2 charCoord, charId;\n\t\t\tvarying float charWidth;\n\t\t\tvarying vec4 fontColor;\n\t\t\tvoid main () {\n\t\t\t\t"+(A.normalViewport?"":"vec2 positionOffset = vec2(positionOffset.x,- positionOffset.y);")+"\n\n\t\t\t\tvec2 offset = floor(em * (vec2(align + charOffset, baseline)\n\t\t\t\t\t+ positionOffset))\n\t\t\t\t\t/ (viewport.zw * scale.xy);\n\n\t\t\t\tvec2 position = (position + translate) * scale;\n\t\t\t\tposition += offset * scale;\n\n\t\t\t\t"+(A.normalViewport?"position.y = 1. - position.y;":"")+"\n\n\t\t\t\tcharCoord = position * viewport.zw + viewport.xy;\n\n\t\t\t\tgl_Position = vec4(position * 2. - 1., 0, 1);\n\n\t\t\t\tgl_PointSize = charStep;\n\n\t\t\t\tcharId.x = mod(char, atlasDim.x);\n\t\t\t\tcharId.y = floor(char / atlasDim.x);\n\n\t\t\t\tcharWidth = width * em;\n\n\t\t\t\tfontColor = color / 255.;\n\t\t\t}",frag:"\n\t\t\tprecision highp float;\n\t\t\tuniform sampler2D atlas;\n\t\t\tuniform float fontSize, charStep, opacity;\n\t\t\tuniform vec2 atlasSize;\n\t\t\tuniform vec4 viewport;\n\t\t\tvarying vec4 fontColor;\n\t\t\tvarying vec2 charCoord, charId;\n\t\t\tvarying float charWidth;\n\n\t\t\tfloat lightness(vec4 color) {\n\t\t\t\treturn color.r * 0.299 + color.g * 0.587 + color.b * 0.114;\n\t\t\t}\n\n\t\t\tvoid main () {\n\t\t\t\tvec2 uv = gl_FragCoord.xy - charCoord + charStep * .5;\n\t\t\t\tfloat halfCharStep = floor(charStep * .5 + .5);\n\n\t\t\t\t// invert y and shift by 1px (FF expecially needs that)\n\t\t\t\tuv.y = charStep - uv.y;\n\n\t\t\t\t// ignore points outside of character bounding box\n\t\t\t\tfloat halfCharWidth = ceil(charWidth * .5);\n\t\t\t\tif (floor(uv.x) > 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;d<s.length;d++)s[d]=t.text;t.text=s}if(null!=t.text||i){if(this.textOffsets=[0],Array.isArray(t.text)){this.count=t.text[0].length,this.counts=[this.count];for(var x=1;x<t.text.length;x++)this.textOffsets[x]=this.textOffsets[x-1]+t.text[x-1].length,this.count+=t.text[x].length,this.counts.push(t.text[x].length);this.text=t.text.join("")}else this.text=t.text,this.count=this.text.length,this.counts=[this.count];r=[],this.font.forEach((function(t,n){A.atlasContext.font=t.baseString;for(var a=e.fontAtlas[n],i=0;i<e.text.length;i++){var o=e.text.charAt(i);if(null==a.ids[o]&&(a.ids[o]=a.chars.length,a.chars.push(o),r.push(o)),null==t.width[o]&&(t.width[o]=A.atlasContext.measureText(o).width/A.baseFontSize,e.kerning)){var s=[];for(var l in t.width)s.push(l+o,o+l);v(t.kerning,g(t.family,{pairs:s}))}}}))}if(t.position)if(t.position.length>2){for(var w=!t.position[0].length,T=c.mallocFloat(2*this.count),k=0,M=0;k<this.counts.length;k++){var E=this.counts[k];if(w)for(var S=0;S<E;S++)T[M++]=t.position[2*k],T[M++]=t.position[2*k+1];else for(var C=0;C<E;C++)T[M++]=t.position[k][0],T[M++]=t.position[k][1]}this.position.call?this.position({type:"float",data:T}):this.position=this.regl.buffer({type:"float",data:T}),c.freeFloat(T)}else this.position.destroy&&this.position.destroy(),this.position={constant:t.position};if(t.text||i){var L=c.mallocUint8(this.count),O=c.mallocFloat(2*this.count);this.textWidth=[];for(var D=0,R=0;D<this.counts.length;D++){for(var I=this.counts[D],P=this.font[D]||this.font[0],F=this.fontAtlas[D]||this.fontAtlas[0],z=0;z<I;z++){var N=this.text.charAt(R),B=this.text.charAt(R-1);if(L[R]=F.ids[N],O[2*R]=P.width[N],z){var j=O[2*R-2],U=O[2*R],V=O[2*R-1]+.5*j+.5*U;if(this.kerning){var H=P.kerning[B+N];H&&(V+=.001*H)}O[2*R+1]=V}else O[2*R+1]=.5*O[2*R];R++}this.textWidth.push(O.length?.5*O[2*R-2]+O[2*R-1]:0)}t.align||(t.align=this.align),this.charBuffer({data:L,type:"uint8",usage:"stream"}),this.sizeBuffer({data:O,type:"float",usage:"stream"}),c.freeUint8(L),c.freeFloat(O),r.length&&this.font.forEach((function(t,r){var n=e.fontAtlas[r],a=n.step,i=Math.floor(A.maxAtlasSize/a),o=Math.min(i,n.chars.length),s=Math.ceil(n.chars.length/o),l=b(o*a),c=b(s*a);n.width=l,n.height=c,n.rows=s,n.cols=o,n.em&&n.texture({data:u({canvas:A.atlasCanvas,font:n.fontString,chars:n.chars,shape:[l,c],step:[a,a]})})}))}if(t.align&&(this.align=t.align,this.alignOffset=this.textWidth.map((function(t,r){var n=Array.isArray(e.align)?e.align.length>1?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;W<q;W+=4)G.set(l(X(W,W+4),"uint8"),W)}else{var Y=t.color.length;G=c.mallocUint8(4*Y);for(var Z=0;Z<Y;Z++)G.set(l(t.color[Z]||0,"uint8"),4*Z)}this.color=G}else this.color=l(t.color,"uint8");if(t.position||t.text||t.color||t.baseline||t.align||t.font||t.offset||t.opacity)if(this.color.length>4||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;Q<this.batch.length;Q++)this.batch[Q]={count:this.counts.length>1?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;r<e.length;r++){var i=e[r];if("preprocessor"===i.type){var o=i.data.match(/\#define\s+SHADER_NAME(_B64)?\s+(.+)$/);if(o&&o[2]){var s=o[1],l=o[2];return(s?a(l):l).trim()}}}}},{"atob-lite":21,"glsl-tokenizer":235}],229:[function(t,e,r){e.exports=function(t){var e,r,u,c=0,f=0,d=999,h=[],p=[],g=1,v=0,m=0,y=!1,b=!1,x="",_=i,w=n;"300 es"===(t=t||{}).version&&(_=s,w=o);var A={},T={};for(c=0;c<_.length;c++)A[_[c]]=!0;for(c=0;c<w.length;c++)T[w[c]]=!0;return function(t){return p=[],null!==t?function(t){c=0,t.toString&&(t=t.toString());var r;x+=t.replace(/\r\n/g,"\n"),u=x.length;for(;e=x[c],c<u;){switch(r=c,d){case 0:c=C();break;case 1:case 2:c=S();break;case 3:c=L();break;case 4:c=R();break;case 11:c=D();break;case 5:c=I();break;case 9999:c=P();break;case 9:c=E();break;case 999:c=M()}if(r!==c)switch(x[r]){case"\n":v=0,++g;break;default:++v}}return f+=c,x=x.slice(c),p}(t):function(t){h.length&&k(h.join(""));return d=10,k("(eof)"),p}()};function k(t){t.length&&p.push({type:l[d],data:t,position:m,line:g,column:v})}function M(){return h=h.length?[]:h,"/"===r&&"*"===e?(m=f+c-1,d=0,r=e,c+1):"/"===r&&"/"===e?(m=f+c-1,d=1,r=e,c+1):"#"===e?(d=2,m=f+c,c):/\s/.test(e)?(d=9,m=f+c,c):(y=/\d/.test(e),b=/[^\w_]/.test(e),m=f+c,d=y?4:b?3:9999,c)}function E(){return/[^\s]/g.test(e)?(k(h.join("")),d=999,c):(h.push(e),r=e,c+1)}function S(){return"\r"!==e&&"\n"!==e||"\\"===r?(h.push(e),r=e,c+1):(k(h.join("")),d=999,c)}function C(){return"/"===e&&"*"===r?(h.push(e),k(h.join("")),d=999,c+1):(h.push(e),r=e,c+1)}function L(){if("."===r&&/\d/.test(e))return d=5,c;if("/"===r&&"*"===e)return d=0,c;if("/"===r&&"/"===e)return d=1,c;if("."===e&&h.length){for(;O(h););return d=5,c}if(";"===e||")"===e||"("===e){if(h.length)for(;O(h););return k(e),d=999,c+1}var t=2===h.length&&"="!==e;if(/[\w_\d\s]/.test(e)||t){for(;O(h););return d=999,c}return h.push(e),r=e,c+1}function O(t){for(var e,r,n=0;;){if(e=a.indexOf(t.slice(0,t.length+n).join("")),r=a[e],-1===e){if(n--+t.length>0)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<<s)-1,u=l>>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<<u)-1,f=c>>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<<a|s,u+=a;u>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<t.length&&t[n][0]<=e;++n){var a=r(t[n]);if(a)return a}}function f(t,e,r){for(var n=t.length-1;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<t.length;++r){var n=e(t[r]);if(n)return n}}function h(t,e){return t-e}function p(t,e){var r=t[0]-e[0];return r||t[1]-e[1]}function g(t,e){var r=t[1]-e[1];return r||t[0]-e[0]}function v(t){if(0===t.length)return null;for(var e=[],r=0;r<t.length;++r)e.push(t[r][0],t[r][1]);e.sort(h);var n=e[e.length>>1],i=[],o=[],s=[];for(r=0;r<t.length;++r){var l=t[r];l[1]<n?i.push(l):n<l[0]?o.push(l):s.push(l)}var u=s,c=s.slice();return u.sort(p),c.sort(g),new a(n,v(i),v(o),u,c)}function m(t){this.root=t}i.intervals=function(t){return t.push.apply(t,this.leftPoints),this.left&&this.left.intervals(t),this.right&&this.right.intervals(t),t},i.insert=function(t){var e=this.count-this.leftPoints.length;if(this.count+=1,t[1]<this.mid)this.left?4*(this.left.count+1)>3*(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]<this.mid)return this.left?4*(this.right?this.right.count:0)>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);i<this.leftPoints.length&&this.leftPoints[i][0]===t[0];++i)if(this.leftPoints[i]===t){this.count-=1,this.leftPoints.splice(i,1);for(s=n.ge(this.rightPoints,t,g);s<this.rightPoints.length&&this.rightPoints[s][1]===t[1];++s)if(this.rightPoints[s]===t)return this.rightPoints.splice(s,1),1}return 0},i.queryPoint=function(t,e){if(t<this.mid){if(this.left)if(r=this.left.queryPoint(t,e))return r;return c(this.leftPoints,t,e)}if(t>this.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(t<this.mid&&this.left&&(n=this.left.queryInterval(t,e,r)))return n;if(e>this.mid&&this.right&&(n=this.right.queryInterval(t,e,r)))return n;return e<this.mid?c(this.leftPoints,e,r):t>this.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<t.length;++r)e[t[r]]=r;return e}},{}],243:[function(t,e,r){"use strict";e.exports=function(t){for(var e=new Array(t),r=0;r<t;++r)e[r]=r;return e}},{}],244:[function(t,e,r){e.exports=!0},{}],245:[function(t,e,r){function n(t){return!!t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}
/*!
* Determine if an object is a Buffer
*
* @author Feross Aboukhadijeh <https://feross.org>
* @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;n<r;n++)if(((e=t.charCodeAt(n))<9||e>13)&&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<<e-1}else if("button"in t){var e;if(1===(e=t.button))return 4;if(2===e)return 2;if(e>=0)return 1<<e}}return 0},r.element=n,r.x=function(t){if("object"==typeof t){if("offsetX"in t)return t.offsetX;var e=n(t).getBoundingClientRect();return t.clientX-e.left}return 0},r.y=function(t){if("object"==typeof t){if("offsetY"in t)return t.offsetY;var e=n(t).getBoundingClientRect();return t.clientY-e.top}return 0}},{}],256:[function(t,e,r){"use strict";var n=t("to-px");e.exports=function(t,e,r){"function"==typeof t&&(r=!!e,e=t,t=window);var a=n("ex",t),i=function(t){r&&t.preventDefault();var n=t.deltaX||0,i=t.deltaY||0,o=t.deltaZ||0,s=1;switch(t.deltaMode){case 1:s=a;break;case 2:s=window.innerHeight}if(i*=s,o*=s,(n*=s)||i||o)return e(n,i,o,t)};return t.addEventListener("wheel",i),i}},{"to-px":324}],257:[function(t,e,r){"use strict";var n=t("typedarray-pool");function a(t){return"a"+t}function i(t){return"d"+t}function o(t,e){return"c"+t+"_"+e}function s(t){return"s"+t}function l(t,e){return"t"+t+"_"+e}function u(t){return"o"+t}function c(t){return"x"+t}function f(t){return"p"+t}function d(t,e){return"d"+t+"_"+e}function h(t){return"i"+t}function p(t,e){return"u"+t+"_"+e}function g(t){return"b"+t}function v(t){return"y"+t}function m(t){return"e"+t}function y(t){return"v"+t}e.exports=function(t){function e(t){throw new Error("ndarray-extract-contour: "+t)}"object"!=typeof t&&e("Must specify arguments");var r=t.order;Array.isArray(r)||e("Must specify order");var x=t.arrayArguments||1;x<1&&e("Must have at least one array argument");var _=t.scalarArguments||0;_<0&&e("Scalar arg count must be > 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<x;++T)w.indexOf(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;C<A;++C)S.push(a(C));for(C=0;C<x;++C)S.push(c(C));for(C=0;C<T;++C)E.push(s(C)+"="+a(0)+".shape["+C+"]|0");for(C=0;C<A;++C){E.push(i(C)+"="+a(C)+".data",u(C)+"="+a(C)+".offset|0");for(var L=0;L<T;++L)E.push(l(C,L)+"="+a(C)+".stride["+L+"]|0")}for(C=0;C<A;++C){E.push(f(C)+"="+u(C)),E.push(o(C,0));for(L=1;L<1<<T;++L){for(var O=[],D=0;D<T;++D)L&1<<D&&O.push("-"+l(C,D));E.push(d(C,L)+"=("+O.join("")+")|0"),E.push(o(C,L)+"=0")}}for(C=0;C<A;++C)for(L=0;L<T;++L){var R=[l(C,_[L])];L>0&&R.push(l(C,_[L-1])+"*"+s(_[L-1])),E.push(p(C,_[L])+"=("+R.join("-")+")|0")}for(C=0;C<T;++C)E.push(h(C)+"=0");E.push("N=0");var I=["2"];for(C=T-2;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<<T;++L){var P=[],F=[];for(D=0;D<T;++D)L&1<<D&&(0===F.length?P.push("1"):P.unshift(F.join("*"))),F.push(s(_[D]));var z="";P[0].indexOf(s(_[T-2]))<0&&(z="-");var N=b(T,L,_);E.push(m(N)+"=(-"+P.join("-")+")|0",v(N)+"=("+z+P.join("-")+")|0",g(N)+"=0")}function B(t,e){M.push("for(",h(_[t]),"=",e,";",h(_[t]),"<",s(_[t]),";","++",h(_[t]),"){")}function j(t){for(var e=0;e<A;++e)M.push(f(e),"+=",p(e,_[t]),";");M.push("}")}function U(){for(var t=1;t<1<<T;++t)M.push("T","=",m(t),";",m(t),"=",v(t),";",v(t),"=","T",";")}E.push(y(0)+"=0","T=0"),function t(e,r){if(e<0)!function(t){for(var e=0;e<A;++e)w[e]?M.push(o(e,0),"=",i(e),".get(",f(e),");"):M.push(o(e,0),"=",i(e),"[",f(e),"];");var r=[];for(e=0;e<A;++e)r.push(o(e,0));for(e=0;e<x;++e)r.push(c(e));M.push(g(0),"=","P","[","X","]=phase(",r.join(),");");for(var n=1;n<1<<T;++n)M.push(g(n),"=","P","[","X","+",m(n),"];");var a=[];for(n=1;n<1<<T;++n)a.push("("+g(0)+"!=="+g(n)+")");M.push("if(",a.join("||"),"){");var s=[];for(e=0;e<T;++e)s.push(h(e));for(e=0;e<A;++e){s.push(o(e,0));for(n=1;n<1<<T;++n)w[e]?M.push(o(e,n),"=",i(e),".get(",f(e),"+",d(e,n),");"):M.push(o(e,n),"=",i(e),"[",f(e),"+",d(e,n),"];"),s.push(o(e,n))}for(e=0;e<1<<T;++e)s.push(g(e));for(e=0;e<x;++e)s.push(c(e));M.push("vertex(",s.join(),");",y(0),"=","V","[","X","]=","N","++;");var l=(1<<T)-1,u=g(l);for(n=0;n<T;++n)if(0==(t&~(1<<n))){for(var p=l^1<<n,v=g(p),b=[],_=p;_>0;_=_-1&p)b.push("V[X+"+m(_)+"]");b.push(y(0));for(_=0;_<A;++_)1&n?b.push(o(_,l),o(_,p)):b.push(o(_,p),o(_,l));1&n?b.push(u,v):b.push(v,u);for(_=0;_<x;++_)b.push(c(_));M.push("if(",u,"!==",v,"){","face(",b.join(),")}")}M.push("}","X","+=1;")}(r);else{!function(t){for(var e=t-1;e>=0;--e)B(e,0);var r=[];for(e=0;e<A;++e)w[e]?r.push(i(e)+".get("+f(e)+")"):r.push(i(e)+"["+f(e)+"]");for(e=0;e<x;++e)r.push(c(e));for(M.push("P","[","X","++]=phase(",r.join(),");"),e=0;e<t;++e)j(e);for(var n=0;n<A;++n)M.push(f(n),"+=",p(n,_[t]),";")}(e),M.push("if(",s(_[e]),">0){",h(_[e]),"=1;"),t(e-1,r|1<<_[e]);for(var n=0;n<A;++n)M.push(f(n),"+=",p(n,_[e]),";");e===T-1&&(M.push("X","=0;"),U()),B(e,2),t(e-1,r),e===T-1&&(M.push("if(",h(_[T-1]),"&1){","X","=0;}"),U()),j(e),M.push("}")}}(T-1,0),M.push("freeUint32(","V",");freeUint32(","P",");");var V=["'use strict';","function ",k,"(",S.join(),"){","var ",E.join(),";",M.join(""),"}","return ",k].join("");return new Function("vertex","face","phase","mallocUint32","freeUint32",V)(t,e,r,n.mallocUint32,n.freeUint32)}(t.vertex,t.cell,t.phase,_,r,A)};function b(t,e,r){for(var n=0,a=0;a<t;++a)e&1<<a&&(n|=1<<r[a]);return n}},{"typedarray-pool":339}],258:[function(t,e,r){"use strict";var n=t("cwise-compiler"),a={body:"",args:[],thisVars:[],localVars:[]};function i(t){if(!t)return a;for(var e=0;e<t.args.length;++e){var r=t.args[e];t.args[e]=0===e?{name:r,lvalue:!0,rvalue:!!t.rvalue,count:t.count||1}:{name:r,lvalue:!1,rvalue:!0,count:1}}return t.thisVars||(t.thisVars=[]),t.localVars||(t.localVars=[]),t}function o(t){for(var e=[],r=0;r<t.args.length;++r)e.push("a"+r);return new Function("P",["return function ",t.funcName,"_ndarrayops(",e.join(","),") {P(",e.join(","),");return a0}"].join(""))(function(t){return n({args:t.args,pre:i(t.pre),body:i(t.body),post:i(t.proc),funcName:t.funcName})}(t))}var s={add:"+",sub:"-",mul:"*",div:"/",mod:"%",band:"&",bor:"|",bxor:"^",lshift:"<<",rshift:">>",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;t<c.length;++t){var e=c[t];r[e]=o({args:["array","array"],pre:{args:[],body:"this_f=Math."+e,thisVars:["this_f"]},body:{args:["a","b"],body:"a=this_f(b)",thisVars:["this_f"]},funcName:e}),r[e+"eq"]=o({args:["array"],pre:{args:[],body:"this_f=Math."+e,thisVars:["this_f"]},body:{args:["a"],body:"a=this_f(a)",thisVars:["this_f"]},rvalue:!0,count:2,funcName:e+"eq"})}}();var f=["max","min","atan2","pow"];!function(){for(var t=0;t<f.length;++t){var e=f[t];r[e]=o({args:["array","array","array"],pre:{args:[],body:"this_f=Math."+e,thisVars:["this_f"]},body:{args:["a","b","c"],body:"a=this_f(b,c)",thisVars:["this_f"]},funcName:e}),r[e+"s"]=o({args:["array","array","scalar"],pre:{args:[],body:"this_f=Math."+e,thisVars:["this_f"]},body:{args:["a","b","c"],body:"a=this_f(b,c)",thisVars:["this_f"]},funcName:e+"s"}),r[e+"eq"]=o({args:["array","array"],pre:{args:[],body:"this_f=Math."+e,thisVars:["this_f"]},body:{args:["a","b"],body:"a=this_f(a,b)",thisVars:["this_f"]},rvalue:!0,count:2,funcName:e+"eq"}),r[e+"seq"]=o({args:["array","scalar"],pre:{args:[],body:"this_f=Math."+e,thisVars:["this_f"]},body:{args:["a","b"],body:"a=this_f(a,b)",thisVars:["this_f"]},rvalue:!0,count:2,funcName:e+"seq"})}}();var d=["atan2","pow"];!function(){for(var t=0;t<d.length;++t){var e=d[t];r[e+"op"]=o({args:["array","array","array"],pre:{args:[],body:"this_f=Math."+e,thisVars:["this_f"]},body:{args:["a","b","c"],body:"a=this_f(c,b)",thisVars:["this_f"]},funcName:e+"op"}),r[e+"ops"]=o({args:["array","array","scalar"],pre:{args:[],body:"this_f=Math."+e,thisVars:["this_f"]},body:{args:["a","b","c"],body:"a=this_f(c,b)",thisVars:["this_f"]},funcName:e+"ops"}),r[e+"opeq"]=o({args:["array","array"],pre:{args:[],body:"this_f=Math."+e,thisVars:["this_f"]},body:{args:["a","b"],body:"a=this_f(b,a)",thisVars:["this_f"]},rvalue:!0,count:2,funcName:e+"opeq"}),r[e+"opseq"]=o({args:["array","scalar"],pre:{args:[],body:"this_f=Math."+e,thisVars:["this_f"]},body:{args:["a","b"],body:"a=this_f(b,a)",thisVars:["this_f"]},rvalue:!0,count:2,funcName:e+"opseq"})}}(),r.any=n({args:["array"],pre:a,body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:1}],body:"if(a){return true}",localVars:[],thisVars:[]},post:{args:[],localVars:[],thisVars:[],body:"return false"},funcName:"any"}),r.all=n({args:["array"],pre:a,body:{args:[{name:"x",lvalue:!1,rvalue:!0,count:1}],body:"if(!x){return false}",localVars:[],thisVars:[]},post:{args:[],localVars:[],thisVars:[],body:"return true"},funcName:"all"}),r.sum=n({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:1}],body:"this_s+=a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"sum"}),r.prod=n({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=1"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:1}],body:"this_s*=a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"prod"}),r.norm2squared=n({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:2}],body:"this_s+=a*a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"norm2squared"}),r.norm2=n({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:2}],body:"this_s+=a*a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return Math.sqrt(this_s)"},funcName:"norm2"}),r.norminf=n({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:4}],body:"if(-a>this_s){this_s=-a}else if(a>this_s){this_s=a}",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"norminf"}),r.norm1=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_h)this_h=_inline_1_arg0_",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_h"],localVars:[]},post:{body:"return this_h",args:[],thisVars:["this_h"],localVars:[]}}),r.argmin=n({args:["index","array","shape"],pre:{body:"{this_v=Infinity;this_i=_inline_0_arg2_.slice(0)}",args:[{name:"_inline_0_arg0_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_0_arg1_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_0_arg2_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_i","this_v"],localVars:[]},body:{body:"{if(_inline_1_arg1_<this_v){this_v=_inline_1_arg1_;for(var _inline_1_k=0;_inline_1_k<_inline_1_arg0_.length;++_inline_1_k){this_i[_inline_1_k]=_inline_1_arg0_[_inline_1_k]}}}",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_i","this_v"],localVars:["_inline_1_k"]},post:{body:"{return this_i}",args:[],thisVars:["this_i"],localVars:[]}}),r.argmax=n({args:["index","array","shape"],pre:{body:"{this_v=-Infinity;this_i=_inline_0_arg2_.slice(0)}",args:[{name:"_inline_0_arg0_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_0_arg1_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_0_arg2_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_i","this_v"],localVars:[]},body:{body:"{if(_inline_1_arg1_>this_v){this_v=_inline_1_arg1_;for(var _inline_1_k=0;_inline_1_k<_inline_1_arg0_.length;++_inline_1_k){this_i[_inline_1_k]=_inline_1_arg0_[_inline_1_k]}}}",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_i","this_v"],localVars:["_inline_1_k"]},post:{body:"{return this_i}",args:[],thisVars:["this_i"],localVars:[]}}),r.random=o({args:["array"],pre:{args:[],body:"this_f=Math.random",thisVars:["this_f"]},body:{args:["a"],body:"a=this_f()",thisVars:["this_f"]},funcName:"random"}),r.assign=o({args:["array","array"],body:{args:["a","b"],body:"a=b"},funcName:"assign"}),r.assigns=o({args:["array","scalar"],body:{args:["a","b"],body:"a=b"},funcName:"assigns"}),r.equals=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;t<r.length;++t)r[t]=[Math.abs(e[t]),t];r.sort(o);var n=new Array(r.length);for(t=0;t<n.length;++t)n[t]=r[t][1];return n}function l(t,e){var r=["View",e,"d",t].join("");e<0&&(r="View_Nil"+t);var a="generic"===t;if(-1===e){var i="function "+r+"(a){this.data=a;};var proto="+r+".prototype;proto.dtype='"+t+"';proto.index=function(){return -1};proto.size=0;proto.dimension=-1;proto.shape=proto.stride=proto.order=[];proto.lo=proto.hi=proto.transpose=proto.step=function(){return new "+r+"(this.data);};proto.get=proto.set=function(){};proto.pick=function(){return null};return function construct_"+r+"(a){return new "+r+"(a);}";return new Function(i)()}if(0===e){i="function "+r+"(a,d) {this.data = a;this.offset = d};var proto="+r+".prototype;proto.dtype='"+t+"';proto.index=function(){return this.offset};proto.dimension=0;proto.size=1;proto.shape=proto.stride=proto.order=[];proto.lo=proto.hi=proto.transpose=proto.step=function "+r+"_copy() {return new "+r+"(this.data,this.offset)};proto.pick=function "+r+"_pick(){return TrivialArray(this.data);};proto.valueOf=proto.get=function "+r+"_get(){return "+(a?"this.data.get(this.offset)":"this.data[this.offset]")+"};proto.set=function "+r+"_set(v){return "+(a?"this.data.set(this.offset,v)":"this.data[this.offset]=v")+"};return function construct_"+r+"(a,b,c,d){return new "+r+"(a,d)}";return new Function("TrivialArray",i)(u[t][0])}i=["'use strict'"];var o=n(e),l=o.map((function(t){return"i"+t})),c="this.offset+"+o.map((function(t){return"this.stride["+t+"]*i"+t})).join("+"),f=o.map((function(t){return"b"+t})).join(","),d=o.map((function(t){return"c"+t})).join(",");i.push("function "+r+"(a,"+f+","+d+",d){this.data=a","this.shape=["+f+"]","this.stride=["+d+"]","this.offset=d|0}","var proto="+r+".prototype","proto.dtype='"+t+"'","proto.dimension="+e),i.push("Object.defineProperty(proto,'size',{get:function "+r+"_size(){return "+o.map((function(t){return"this.shape["+t+"]"})).join("*"),"}})"),1===e?i.push("proto.order=[0]"):(i.push("Object.defineProperty(proto,'order',{get:"),e<4?(i.push("function "+r+"_order(){"),2===e?i.push("return (Math.abs(this.stride[0])>Math.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<e;++g)i.push("if(typeof i"+g+"==='number'&&i"+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<e;++g)i.push("if(typeof i"+g+"==='number'){d=i"+g+"|0;if(d<0){c+=b"+g+"*(a"+g+"-1);a"+g+"=ceil(-a"+g+"/d)}else{a"+g+"=ceil(a"+g+"/d)}b"+g+"*=d}");i.push("return new "+r+"(this.data,"+o.map((function(t){return"a"+t})).join(",")+","+o.map((function(t){return"b"+t})).join(",")+",c)}");var v=new Array(e),m=new Array(e);for(g=0;g<e;++g)v[g]="a[i"+g+"]",m[g]="b[i"+g+"]";i.push("proto.transpose=function "+r+"_transpose("+l+"){"+l.map((function(t,e){return t+"=("+t+"===undefined?"+e+":"+t+"|0)"})).join(";"),"var a=this.shape,b=this.stride;return new "+r+"(this.data,"+v.join(",")+","+m.join(",")+",this.offset)}"),i.push("proto.pick=function "+r+"_pick("+l+"){var a=[],b=[],c=this.offset");for(g=0;g<e;++g)i.push("if(typeof i"+g+"==='number'&&i"+g+">=0){c=(c+this.stride["+g+"]*i"+g+")|0}else{a.push(this.shape["+g+"]);b.push(this.stride["+g+"])}");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;s<o;++s)r[s]<0&&(n-=(e[s]-1)*r[s])}for(var f=function(t){if(a(t))return"buffer";if(i)switch(Object.prototype.toString.call(t)){case"[object Float64Array]":return"float64";case"[object Float32Array]":return"float32";case"[object Int8Array]":return"int8";case"[object Int16Array]":return"int16";case"[object Int32Array]":return"int32";case"[object Uint8Array]":return"uint8";case"[object Uint16Array]":return"uint16";case"[object Uint32Array]":return"uint32";case"[object Uint8ClampedArray]":return"uint8_clamped";case"[object BigInt64Array]":return"bigint64";case"[object BigUint64Array]":return"biguint64"}return Array.isArray(t)?"array":"generic"}(t),d=u[f];d.length<=o+1;)d.push(l(f,d.length-1));return(0,d[o+1])(t,e,r,n)}},{"iota-array":243,"is-buffer":245}],260:[function(t,e,r){"use strict";var n=t("double-bits"),a=Math.pow(2,-1074);e.exports=function(t,e){if(isNaN(t)||isNaN(e))return NaN;if(t===e)return t;if(0===t)return e<0?-a:a;var r=n.hi(t),i=n.lo(t);e>t==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;R<D.length;){var I=l(D[R],D[R+1],o);D[R++]=I.x,D[R++]=I.y}return D}function l(t,e,r){return{x:t*Math.cos(r)-e*Math.sin(r),y:t*Math.sin(r)+e*Math.cos(r)}}function u(t){return t*(n/180)}e.exports=function(t){for(var e,r=[],n=0,a=0,l=0,c=0,f=null,d=null,h=0,p=0,g=0,v=t.length;g<v;g++){var m=t[g],y=m[0];switch(y){case"M":l=m[1],c=m[2];break;case"A":(m=s(h,p,m[1],m[2],u(m[3]),m[4],m[5],m[6],m[7])).unshift("C"),m.length>7&&(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<arguments.length;u++){for(var c in r=Object(arguments[u]))a.call(r,c)&&(l[c]=r[c]);if(n){s=n(r);for(var f=0;f<s.length;f++)i.call(r,s[f])&&(l[s[f]]=r[s[f]])}}return l}},{}],263:[function(t,e,r){
/*!
* pad-left <https://github.com/jonschlinkert/pad-left>
*
* 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.length<n[o])throw new Error("malformed path data");e.push([r].concat(a.splice(0,n[o])))}})),e};var n={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},a=/([astvzqmhlc])([^astvzqmhlc]*)/gi;var i=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi},{}],267:[function(t,e,r){e.exports=function(t,e){e||(e=[0,""]),t=String(t);var r=parseFloat(t,10);return e[0]=r,e[1]=t.match(/[\d.\-\+]*\s*(.*)/)[1]||"",e}},{}],268:[function(t,e,r){(function(t){(function(){(function(){var r,n,a,i,o,s;"undefined"!=typeof performance&&null!==performance&&performance.now?e.exports=function(){return performance.now()}:"undefined"!=typeof t&&null!==t&&t.hrtime?(e.exports=function(){return(r()-o)/1e6},n=t.hrtime,i=(r=function(){var t;return 1e9*(t=n())[0]+t[1]})(),s=1e9*t.uptime(),o=i-s):Date.now?(e.exports=function(){return Date.now()-a},a=Date.now()):(e.exports=function(){return(new Date).getTime()-a},a=(new Date).getTime())}).call(this)}).call(this)}).call(this,t("_process"))},{_process:285}],269:[function(t,e,r){"use strict";e.exports=function(t){var e=t.length;if(e<32){for(var r=1,a=0;a<e;++a)for(var i=0;i<a;++i)if(t[a]<t[i])r=-r;else if(t[a]===t[i])return 0;return r}var o=n.mallocUint8(e);for(a=0;a<e;++a)o[a]=0;for(r=1,a=0;a<e;++a)if(!o[a]){var s=1;o[a]=1;for(i=t[a];i!==a;i=t[i]){if(o[i])return n.freeUint8(o),0;s+=1,o[i]=1}1&s||(r=-r)}return n.freeUint8(o),r};var n=t("typedarray-pool")},{"typedarray-pool":339}],270:[function(t,e,r){"use strict";var n=t("typedarray-pool"),a=t("invert-permutation");r.rank=function(t){var e=t.length;switch(e){case 0:case 1:return 0;case 2:return t[1]}var r,i,o,s=n.mallocUint32(e),l=n.mallocUint32(e),u=0;for(a(t,l),o=0;o<e;++o)s[o]=t[o];for(o=e-1;o>0;--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;i<t;++i)r[i]=i,o=o*i|0;for(i=t-1;i>0;--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;i<e.length;i++)s[e[i]]=!0;e=s}for(n in e)e[n]=a(e[n]);var l={};for(n in e){var u=e[n];if(Array.isArray(u))for(i=0;i<u.length;i++){var c=u[i];if(r&&(l[c]=!0),c in t){if(o[n]=t[c],r)for(var f=i;f<u.length;f++)l[u[f]]=!0;break}}else n in t&&(e[n]&&(o[n]=t[n]),r&&(l[n]=!0))}if(r)for(n in t)l[n]||(o[n]=t[n]);return o};var n={};function a(t){return n[t]?n[t]:("string"==typeof t&&(t=n[t]=t.split(/\s*,\s*|\s+/)),t)}},{}],272:[function(t,e,r){"use strict";e.exports=function(t,e){for(var r=0|e.length,a=t.length,i=[new Array(r),new Array(r)],o=0;o<r;++o)i[0][o]=[],i[1][o]=[];for(o=0;o<a;++o){var s=t[o];i[0][s[0]].push(s),i[1][s[1]].push(s)}var l=[];for(o=0;o<r;++o)i[0][o].length+i[1][o].length===0&&l.push([o]);function u(t,e){var r=i[e][t[e]];r.splice(r.indexOf(t),1)}function c(t,r,a){for(var o,s,l,c=0;c<2;++c)if(i[c][r].length>0){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;h<d.length;++h){var p=d[h],g=p[1^f];n(e[t],e[r],e[s],e[g])>0&&(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;o<r;++o)for(var h=0;h<2;++h){for(var p=[];i[h][o].length>0;){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;s<e.length;++s){var l=r[s].length;i[s]=l,a[s]=!0,l<=1&&o.push(s)}for(;o.length>0;){var u=o.pop();a[u]=!1;var c=r[u];for(s=0;s<c.length;++s){var f=c[s];0==--i[f]&&o.push(f)}}var d=new Array(e.length),h=[];for(s=0;s<e.length;++s)if(a[s]){u=h.length;d[s]=u,h.push(e[s])}else d[s]=-1;var p=[];for(s=0;s<t.length;++s){var g=t[s];a[g[0]]&&a[g[1]]&&p.push([d[g[0]],d[g[1]]])}return[p,h]};var n=t("edges-to-adjacency-list")},{"edges-to-adjacency-list":94}],274:[function(t,e,r){"use strict";e.exports=function(t,e){var r=u(t,e);t=r[0];for(var f=(e=r[1]).length,d=(t.length,n(t,e.length)),h=0;h<f;++h)if(d[h].length%2==1)throw new Error("planar-graph-to-polyline: graph must be manifold");var p=a(t,e);var g=(p=p.filter((function(t){for(var r=t.length,n=[0],a=0;a<r;++a){var i=e[t[a]],l=e[t[(a+1)%r]],u=o(-i[0],i[1]),c=o(-i[0],l[1]),f=o(l[0],i[1]),d=o(l[0],l[1]);n=s(n,s(s(u,c),s(f,d)))}return n[n.length-1]>0}))).length,v=new Array(g),m=new Array(g);for(h=0;h<g;++h){v[h]=h;var y=new Array(g),b=p[h].map((function(t){return e[t]})),x=i([b]),_=0;t:for(var w=0;w<g;++w)if(y[w]=0,h!==w){for(var A=(H=p[w]).length,T=0;T<A;++T){var k=x(e[H[T]]);if(0!==k){k<0&&(y[w]=1,_+=1);continue t}}y[w]=1,_+=1}m[h]=[_,h,y]}m.sort((function(t,e){return e[0]-t[0]}));for(h=0;h<g;++h){var M=(y=m[h])[1],E=y[2];for(w=0;w<g;++w)E[w]&&(v[w]=M)}var S=function(t){for(var e=new Array(t),r=0;r<t;++r)e[r]=[];return e}(g);for(h=0;h<g;++h)S[h].push(v[h]),S[v[h]].push(h);var C={},L=c(f,!1);for(h=0;h<g;++h)for(A=(H=p[h]).length,w=0;w<A;++w){var O=H[w],D=H[(w+1)%A],R=Math.min(O,D)+":"+Math.max(O,D);if(R in C){var I=C[R];S[I].push(h),S[h].push(I),L[O]=L[D]=!0}else C[R]=h}function P(t){for(var e=t.length,r=0;r<e;++r)if(!L[t[r]])return!1;return!0}var F=[],z=c(g,-1);for(h=0;h<g;++h)v[h]!==h||P(p[h])?z[h]=-1:(F.push(h),z[h]=0);r=[];for(;F.length>0;){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<U;++h){var G=B[h];if(!(z[G]>=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;n<t;++n)r[n]=e;return r}},{"./lib/trim-leaves":273,"edges-to-adjacency-list":94,"planar-dual":272,"point-in-big-polygon":276,"robust-sum":305,"two-product":326,uniq:341}],275:[function(t,e,r){arguments[4][241][0].apply(r,arguments)},{dup:241}],276:[function(t,e,r){e.exports=function(t){for(var e=t.length,r=[],i=[],s=0;s<e;++s)for(var c=t[s],f=c.length,d=f-1,h=0;h<f;d=h++){var p=c[d],g=c[h];p[0]===g[0]?i.push([p,g]):r.push([p,g])}if(0===r.length)return 0===i.length?u:(v=l(i),function(t){return v(t[0],t[1])?0:1});var v;var m=a(r),y=function(t,e){return function(r){var a=o.le(e,r[0]);if(a<0)return 1;var i=t[a];if(!i){if(!(a>0&&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]<l[1][0])if(u<0)i=i.left;else{if(!(u>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.length;++r){var n=t[r],a=n[0][0],o=n[0][1],l=n[1][1],u=[Math.min(o,l),Math.max(o,l)];a in e?e[a].push(u):e[a]=[u]}var c={},f=Object.keys(e);for(r=0;r<f.length;++r){var d=e[f[r]];c[f[r]]=i(d)}return function(t){return function(e,r){var n=t[e];return!!n&&!!n.queryPoint(r,s)}}(c)}function u(t){return 1}},{"binary-search-bounds":275,"interval-tree-1d":240,"robust-orientation":300,"slab-decomposition":313}],277:[function(t,e,r){
/*
* @copyright 2016 Sean Connelly (@voidqk), http://syntheti.cc
* @license MIT
* @preserve Project Home: https://github.com/voidqk/polybooljs
*/
var n,a=t("./lib/build-log"),i=t("./lib/epsilon"),o=t("./lib/intersecter"),s=t("./lib/segment-chainer"),l=t("./lib/segment-selector"),u=t("./lib/geojson"),c=!1,f=i();function d(t,e,r){var a=n.segments(t),i=n.segments(e),o=r(n.combine(a,i));return n.polygon(o)}n={buildLog:function(t){return!0===t?c=a():!1===t&&(c=!1),!1!==c&&c.list},epsilon:function(t){return f.epsilon(t)},segments:function(t){var e=o(!0,f,c);return t.regions.forEach(e.addRegion),{segments:e.calculate(t.inverted),inverted:t.inverted}},combine:function(t,e){return{combined:o(!1,f,c).calculate(t.segments,t.inverted,e.segments,e.inverted),inverted1:t.inverted,inverted2:e.inverted}},selectUnion:function(t){return{segments:l.union(t.combined,c),inverted:t.inverted1||t.inverted2}},selectIntersect:function(t){return{segments:l.intersect(t.combined,c),inverted:t.inverted1&&t.inverted2}},selectDifference:function(t){return{segments:l.difference(t.combined,c),inverted:t.inverted1&&!t.inverted2}},selectDifferenceRev:function(t){return{segments:l.differenceRev(t.combined,c),inverted:!t.inverted1&&t.inverted2}},selectXor:function(t){return{segments:l.xor(t.combined,c),inverted:t.inverted1!==t.inverted2}},polygon:function(t){return{regions:s(t.segments,f,c),inverted:t.inverted}},polygonFromGeoJSON:function(t){return u.toPolygon(n,t)},polygonToGeoJSON:function(t){return u.fromPolygon(n,f,t)},union:function(t,e){return d(t,e,n.selectUnion)},intersect:function(t,e){return d(t,e,n.selectIntersect)},difference:function(t,e){return d(t,e,n.selectDifference)},differenceRev:function(t,e){return d(t,e,n.selectDifferenceRev)},xor:function(t,e){return d(t,e,n.selectXor)}},"object"==typeof window&&(window.PolyBool=n),e.exports=n},{"./lib/build-log":278,"./lib/epsilon":279,"./lib/geojson":280,"./lib/intersecter":281,"./lib/segment-chainer":283,"./lib/segment-selector":284}],278:[function(t,e,r){e.exports=function(){var t,e=0,r=!1;function n(e,r){return t.list.push({type:e,data:r?JSON.parse(JSON.stringify(r)):void 0}),t}return t={list:[],segmentId:function(){return e++},checkIntersection:function(t,e){return n("check",{seg1:t,seg2:e})},segmentChop:function(t,e){return n("div_seg",{seg:t,pt:e}),n("chop",{seg:t,pt:e})},statusRemove:function(t){return n("pop_seg",{seg:t})},segmentUpdate:function(t){return n("seg_update",{seg:t})},segmentNew:function(t,e){return n("new_seg",{seg:t,primary:e})},segmentRemove:function(t){return n("rem_seg",{seg:t})},tempStatus:function(t,e,r){return n("temp_status",{seg:t,above:e,below:r})},rewind:function(t){return n("rewind",{seg:t})},status:function(t,e,r){return n("status",{seg:t,above:e,below:r})},vert:function(e){return e===r?t:(r=e,n("vert",{x:e}))},log:function(t){return"string"!=typeof t&&(t=JSON.stringify(t,!1," ")),n("log",{txt:t})},reset:function(){return n("reset")},selected:function(t){return n("selected",{segs:t})},chainStart:function(t){return n("chain_start",{seg:t})},chainRemoveHead:function(t,e){return n("chain_rem_head",{index:t,pt:e})},chainRemoveTail:function(t,e){return n("chain_rem_tail",{index:t,pt:e})},chainNew:function(t,e){return n("chain_new",{pt1:t,pt2:e})},chainMatch:function(t){return n("chain_match",{index:t})},chainClose:function(t){return n("chain_close",{index:t})},chainAddHead:function(t,e){return n("chain_add_head",{index:t,pt:e})},chainAddTail:function(t,e){return n("chain_add_tail",{index:t,pt:e})},chainConnect:function(t,e){return n("chain_con",{index1:t,index2:e})},chainReverse:function(t){return n("chain_rev",{index:t})},chainJoin:function(t,e){return n("chain_join",{index1:t,index2:e})},done:function(){return n("done")}}}},{}],279:[function(t,e,r){e.exports=function(t){"number"!=typeof t&&(t=1e-10);var e={epsilon:function(e){return"number"==typeof e&&(t=e),t},pointAboveOrOnLine:function(e,r,n){var a=r[0],i=r[1],o=n[0],s=n[1],l=e[0];return(o-a)*(e[1]-i)-(s-i)*(l-a)>=-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)&&!(l-(i*i+s*s)>-t)},pointsSameX:function(e,r){return Math.abs(e[0]-r[0])<t},pointsSameY:function(e,r){return Math.abs(e[1]-r[1])<t},pointsSame:function(t,r){return e.pointsSameX(t,r)&&e.pointsSameY(t,r)},pointsCompare:function(t,r){return e.pointsSameX(t,r)?e.pointsSameY(t,r)?0:t[1]<r[1]?-1:1:t[0]<r[0]?-1:1},pointsCollinear:function(e,r,n){var a=e[0]-r[0],i=e[1]-r[1],o=r[0]-n[0],s=r[1]-n[1];return Math.abs(a*s-o*i)<t},linesIntersect:function(e,r,n,a){var i=r[0]-e[0],o=r[1]-e[1],s=a[0]-n[0],l=a[1]-n[1],u=i*l-o*s;if(Math.abs(u)<t)return!1;var c=e[0]-n[0],f=e[1]-n[1],d=(s*f-l*c)/u,h=(i*f-o*c)/u,p={alongA:0,alongB:0,pt:[e[0]+d*i,e[1]+d*o]};return p.alongA=d<=-t?-2:d<t?-1:d-1<=-t?0:d-1<t?1:2,p.alongB=h<=-t?-2:h<t?-1:h-1<=-t?0:h-1<t?1:2,p},pointInsideRegion:function(e,r){for(var n=e[0],a=e[1],i=r[r.length-1][0],o=r[r.length-1][1],s=!1,l=0;l<r.length;l++){var u=r[l][0],c=r[l][1];c-a>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;a<e.length;a++)n=t.selectDifference(t.combine(n,r(e[a])));return n}if("Polygon"===e.type)return t.polygon(r(e.coordinates));if("MultiPolygon"===e.type){for(var n=t.segments({inverted:!1,regions:[]}),a=0;a<e.coordinates.length;a++)n=t.selectUnion(t.combine(n,r(e.coordinates[a])));return t.polygon(n)}throw new Error("PolyBool: Cannot convert GeoJSON object to PolyBool polygon")},fromPolygon:function(t,e,r){function n(t,r){return e.pointInsideRegion([.5*(t[0][0]+t[1][0]),.5*(t[0][1]+t[1][1])],r)}function a(t){return{region:t,children:[]}}r=t.polygon(t.segments(r));var i=a(null);function o(t,e){for(var r=0;r<t.children.length;r++){if(n(e,(s=t.children[r]).region))return void o(s,e)}var i=a(e);for(r=0;r<t.children.length;r++){var s;n((s=t.children[r]).region,e)&&(i.children.push(s),t.children.splice(r,1),r--)}t.children.push(i)}for(var s=0;s<r.regions.length;s++){var l=r.regions[s];l.length<3||o(i,l)}function u(t,e){for(var r=0,n=t[t.length-1][0],a=t[t.length-1][1],i=[],o=0;o<t.length;o++){var s=t[o][0],l=t[o][1];i.push([s,l]),r+=l*n-s*a,n=s,a=l}return r<0!==e&&i.reverse(),i.push([i[0][0],i[0][1]]),i}var c=[];function f(t){var e=[u(t.region,!1)];c.push(e);for(var r=0;r<t.children.length;r++)e.push(d(t.children[r]))}function d(t){for(var e=0;e<t.children.length;e++)f(t.children[e]);return u(t.region,!0)}for(s=0;s<i.children.length;s++)f(i.children[s]);return c.length<=0?{type:"Polygon",coordinates:[]}:1==c.length?{type:"Polygon",coordinates:c[0]}:{type:"MultiPolygon",coordinates:c}}};e.exports=n},{}],281:[function(t,e,r){var n=t("./linked-list");e.exports=function(t,e,r){function a(t,e,n){return{id:r?r.segmentId():-1,start:t,end:e,myFill:{above:n.myFill.above,below:n.myFill.below},otherFill:null}}var i=n.create();function o(t,r){i.insertBefore(t,(function(n){return function(t,r,n,a,i,o){var s=e.pointsCompare(r,i);return 0!==s?s:e.pointsSame(n,o)?0:t!==a?t?1:-1:e.pointAboveOrOnLine(n,a?i:o,a?o:i)?1:-1}(t.isStart,t.pt,r,n.isStart,n.pt,n.other.pt)<0}))}function s(t,e){var r=function(t,e){var r=n.node({isStart:!0,pt:t.start,seg:t,primary:e,other:null,status:null});return o(r,t.end),r}(t,e);return function(t,e,r){var a=n.node({isStart:!1,pt:e.end,seg:e,primary:r,other:t,status:null});t.other=a,o(a,t.pt)}(r,t,e),r}function l(t,e){var n=a(e,t.seg.end,t.seg);return function(t,e){r&&r.segmentChop(t.seg,e),t.other.remove(),t.seg.end=e,t.other.pt=e,o(t.other,t.pt)}(t,e),s(n,t.primary)}function u(a,o){var s=n.create();function u(t){return s.findTransition((function(r){var n,a,i,o,s,l;return(n=t,a=r.ev,i=n.seg.start,o=n.seg.end,s=a.seg.start,l=a.seg.end,e.pointsCollinear(i,s,l)?e.pointsCollinear(o,s,l)||e.pointAboveOrOnLine(o,s,l)?1:-1:e.pointAboveOrOnLine(i,s,l)?1:-1)>0}))}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;l<t.length;l++){n=o,o=t[l];var u=e.pointsCompare(n,o);0!==u&&s((a=u<0?n:o,i=u<0?o:n,{id:r?r.segmentId():-1,start:a,end:i,myFill:{above:null,below:null},otherFill:null}),!0)}},calculate:function(t){return u(t,!1)}}:{calculate:function(t,e,r,n){return t.forEach((function(t){s(a(t.start,t.end,t),!0)})),r.forEach((function(t){s(a(t.start,t.end,t),!1)})),u(e,n)}}}},{"./linked-list":282}],282:[function(t,e,r){e.exports={create:function(){var t={root:{root:!0,next:null},exists:function(e){return null!==e&&e!==t.root},isEmpty:function(){return null===t.root.next},getHead:function(){return t.root.next},insertBefore:function(e,r){for(var n=t.root,a=t.root.next;null!==a;){if(r(a))return e.prev=a.prev,e.next=a,a.prev.next=e,void(a.prev=e);n=a,a=a.next}n.next=e,e.prev=n,e.next=null},findTransition:function(e){for(var r=t.root,n=t.root.next;null!==n&&!e(n);)r=n,n=n.next;return{before:r===t.root?null:r,after:n,insert:function(t){return t.prev=r,t.next=n,r.next=t,null!==n&&(n.prev=t),t}}}};return t},node:function(t){return t.prev=null,t.next=null,t.remove=function(){t.prev.next=t.next,t.next&&(t.next.prev=t.prev),t.prev=null,t.next=null},t}}},{}],283:[function(t,e,r){e.exports=function(t,e,r){var n=[],a=[];return t.forEach((function(t){var i=t.start,o=t.end;if(e.pointsSame(i,o))console.warn("PolyBool: Warning: Zero-length segment detected; your epsilon is probably too small or too large");else{r&&r.chainStart(t);for(var s={index:0,matches_head:!1,matches_pt1:!1},l={index:0,matches_head:!1,matches_pt1:!1},u=s,c=0;c<n.length;c++){var f=(v=n[c])[0],d=(v[1],v[v.length-1]);v[v.length-2];if(e.pointsSame(f,i)){if(T(c,!0,!0))break}else if(e.pointsSame(f,o)){if(T(c,!0,!1))break}else if(e.pointsSame(d,i)){if(T(c,!1,!0))break}else if(e.pointsSame(d,o)&&T(c,!1,!1))break}if(u===s)return n.push([i,o]),void(r&&r.chainNew(i,o));if(u===l){r&&r.chainMatch(s.index);var h=s.index,p=s.matches_pt1?o:i,g=s.matches_head,v=n[h],m=g?v[0]:v[v.length-1],y=g?v[1]:v[v.length-2],b=g?v[v.length-1]:v[0],x=g?v[v.length-2]:v[1];return e.pointsCollinear(y,m,p)&&(g?(r&&r.chainRemoveHead(s.index,p),v.shift()):(r&&r.chainRemoveTail(s.index,p),v.pop()),m=y),e.pointsSame(b,p)?(n.splice(h,1),e.pointsCollinear(x,b,m)&&(g?(r&&r.chainRemoveTail(s.index,m),v.pop()):(r&&r.chainRemoveHead(s.index,m),v.shift())),r&&r.chainClose(s.index),void a.push(v)):void(g?(r&&r.chainAddHead(s.index,p),v.unshift(p)):(r&&r.chainAddTail(s.index,p),v.push(p)))}var _=s.index,w=l.index;r&&r.chainConnect(_,w);var A=n[_].length<n[w].length;s.matches_head?l.matches_head?A?(k(_),M(_,w)):(k(w),M(w,_)):M(w,_):l.matches_head?M(_,w):A?(k(_),M(w,_)):(k(w),M(_,w))}function T(t,e,r){return u.index=t,u.matches_head=e,u.matches_pt1=r,u===s?(u=l,!1):(u=null,!0)}function k(t){r&&r.chainReverse(t),n[t].reverse()}function M(t,a){var i=n[t],o=n[a],s=i[i.length-1],l=i[i.length-2],u=o[0],c=o[1];e.pointsCollinear(l,s,u)&&(r&&r.chainRemoveTail(t,s),i.pop(),s=l),e.pointsCollinear(s,u,c)&&(r&&r.chainRemoveHead(a,u),o.shift()),r&&r.chainJoin(t,a),n[t]=i.concat(o),n.splice(a,1)}})),a}},{}],284:[function(t,e,r){function n(t,e,r){var n=[];return t.forEach((function(t){var a=(t.myFill.above?8:0)+(t.myFill.below?4:0)+(t.otherFill&&t.otherFill.above?2:0)+(t.otherFill&&t.otherFill.below?1:0);0!==e[a]&&n.push({id:r?r.segmentId():-1,start:t.start,end:t.end,myFill:{above:1===e[a],below:2===e[a]},otherFill:null})})),r&&r.selected(n),n}var a={union:function(t,e){return n(t,[0,2,1,0,2,2,0,0,1,0,1,0,0,0,0,0],e)},intersect:function(t,e){return n(t,[0,0,0,0,0,2,0,2,0,0,1,1,0,2,1,0],e)},difference:function(t,e){return n(t,[0,0,0,0,2,0,2,0,1,1,0,0,0,1,2,0],e)},differenceRev:function(t,e){return n(t,[0,2,1,0,0,0,1,1,0,2,0,2,0,0,0,0],e)},xor:function(t,e){return n(t,[0,2,1,0,2,0,0,1,1,0,0,2,0,1,2,0],e)}};e.exports=a},{}],285:[function(t,e,r){var n,a,i=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function l(t){if(n===setTimeout)return setTimeout(t,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(t){n=o}try{a="function"==typeof clearTimeout?clearTimeout:s}catch(t){a=s}}();var u,c=[],f=!1,d=-1;function h(){f&&u&&(f=!1,u.length?c=u.concat(c):d=-1,c.length&&p())}function p(){if(!f){var t=l(h);f=!0;for(var e=c.length;e;){for(u=c,c=[];++d<e;)u&&u[d].run();d=-1,e=c.length}u=null,f=!1,function(t){if(a===clearTimeout)return clearTimeout(t);if((a===s||!a)&&clearTimeout)return a=clearTimeout,clearTimeout(t);try{a(t)}catch(e){try{return a.call(null,t)}catch(e){return a.call(this,t)}}}(t)}}function g(t,e){this.fun=t,this.array=e}function v(){}i.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];c.push(new g(t,e)),1!==c.length||f||l(p)},g.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=v,i.addListener=v,i.once=v,i.off=v,i.removeListener=v,i.removeAllListeners=v,i.emit=v,i.prependListener=v,i.prependOnceListener=v,i.listeners=function(t){return[]},i.binding=function(t){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(t){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},{}],286:[function(t,e,r){(function(r){(function(){for(var n=t("performance-now"),a="undefined"==typeof window?r:window,i=["moz","webkit"],o="AnimationFrame",s=a["request"+o],l=a["cancel"+o]||a["cancelRequest"+o],u=0;!s&&u<i.length;u++)s=a[i[u]+"Request"+o],l=a[i[u]+"Cancel"+o]||a[i[u]+"CancelRequest"+o];if(!s||!l){var c=0,f=0,d=[];s=function(t){if(0===d.length){var e=n(),r=Math.max(0,1e3/60-(e-c));c=r+e,setTimeout((function(){var t=d.slice(0);d.length=0;for(var e=0;e<t.length;e++)if(!t[e].cancelled)try{t[e].callback(c)}catch(t){setTimeout((function(){throw t}),0)}}),Math.round(r))}return d.push({handle:++f,callback:t,cancelled:!1}),f},l=function(t){for(var e=0;e<d.length;e++)d[e].handle===t&&(d[e].cancelled=!0)}}e.exports=function(t){return s.call(a,t)},e.exports.cancel=function(){l.apply(a,arguments)},e.exports.polyfill=function(t){t||(t=a),t.requestAnimationFrame=s,t.cancelAnimationFrame=l}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"performance-now":268}],287:[function(t,e,r){"use strict";var n=t("big-rat/add");e.exports=function(t,e){for(var r=t.length,a=new Array(r),i=0;i<r;++i)a[i]=n(t[i],e[i]);return a}},{"big-rat/add":23}],288:[function(t,e,r){"use strict";e.exports=function(t){for(var e=new Array(t.length),r=0;r<t.length;++r)e[r]=n(t[r]);return e};var n=t("big-rat")},{"big-rat":26}],289:[function(t,e,r){"use strict";var n=t("big-rat"),a=t("big-rat/mul");e.exports=function(t,e){for(var r=n(e),i=t.length,o=new Array(i),s=0;s<i;++s)o[s]=a(t[s],r);return o}},{"big-rat":26,"big-rat/mul":35}],290:[function(t,e,r){"use strict";var n=t("big-rat/sub");e.exports=function(t,e){for(var r=t.length,a=new Array(r),i=0;i<r;++i)a[i]=n(t[i],e[i]);return a}},{"big-rat/sub":37}],291:[function(t,e,r){"use strict";var n=t("array-bounds"),a=t("color-normalize"),i=t("update-diff"),o=t("pick-by-alias"),s=t("object-assign"),l=t("flatten-vertex-data"),u=t("to-float32"),c=u.float32,f=u.fract32;e.exports=function(t,e){"function"==typeof t?(e||(e={}),e.regl=t):e=t;e.length&&(e.positions=e);if(!(t=e.regl).hasExtension("ANGLE_instanced_arrays"))throw Error("regl-error2d: `ANGLE_instanced_arrays` extension should be enabled");var r,u,h,p,g,v,m=t._gl,y={color:"black",capSize:5,lineWidth:1,opacity:1,viewport:null,range:null,offset:0,count:0,bounds:null,positions:[],errors:[]},b=[];return p=t.buffer({usage:"dynamic",type:"uint8",data:new Uint8Array(0)}),u=t.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),h=t.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),g=t.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),v=t.buffer({usage:"static",type:"float",data:d}),A(e),r=t({vert:"\n\t\tprecision highp float;\n\n\t\tattribute vec2 position, positionFract;\n\t\tattribute vec4 error;\n\t\tattribute vec4 color;\n\n\t\tattribute vec2 direction, lineOffset, capOffset;\n\n\t\tuniform vec4 viewport;\n\t\tuniform float lineWidth, capSize;\n\t\tuniform vec2 scale, scaleFract, translate, translateFract;\n\n\t\tvarying vec4 fragColor;\n\n\t\tvoid main() {\n\t\t\tfragColor = color / 255.;\n\n\t\t\tvec2 pixelOffset = lineWidth * lineOffset + (capSize + lineWidth) * capOffset;\n\n\t\t\tvec2 dxy = -step(.5, direction.xy) * error.xz + step(direction.xy, vec2(-.5)) * error.yw;\n\n\t\t\tvec2 position = position + dxy;\n\n\t\t\tvec2 pos = (position + translate) * scale\n\t\t\t\t+ (positionFract + translateFract) * scale\n\t\t\t\t+ (position + translate) * scaleFract\n\t\t\t\t+ (positionFract + translateFract) * scaleFract;\n\n\t\t\tpos += pixelOffset / viewport.zw;\n\n\t\t\tgl_Position = vec4(pos * 2. - 1., 0, 1);\n\t\t}\n\t\t",frag:"\n\t\tprecision highp float;\n\n\t\tvarying vec4 fragColor;\n\n\t\tuniform float opacity;\n\n\t\tvoid main() {\n\t\t\tgl_FragColor = fragColor;\n\t\t\tgl_FragColor.a *= opacity;\n\t\t}\n\t\t",uniforms:{range:t.prop("range"),lineWidth:t.prop("lineWidth"),capSize:t.prop("capSize"),opacity:t.prop("opacity"),scale:t.prop("scale"),translate:t.prop("translate"),scaleFract:t.prop("scaleFract"),translateFract:t.prop("translateFract"),viewport:function(t,e){return[e.viewport.x,e.viewport.y,t.viewportWidth,t.viewportHeight]}},attributes:{color:{buffer:p,offset:function(t,e){return 4*e.offset},divisor:1},position:{buffer:u,offset:function(t,e){return 8*e.offset},divisor:1},positionFract:{buffer:h,offset:function(t,e){return 8*e.offset},divisor:1},error:{buffer:g,offset:function(t,e){return 16*e.offset},divisor:1},direction:{buffer:v,stride:24,offset:0},lineOffset:{buffer:v,stride:24,offset:8},capOffset:{buffer:v,stride:24,offset:16}},primitive:"triangles",blend:{enable:!0,color:[0,0,0,0],equation:{rgb:"add",alpha:"add"},func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:"one minus dst alpha",dstAlpha:"one"}},depth:{enable:!1},scissor:{enable:!0,box:t.prop("viewport")},viewport:t.prop("viewport"),stencil:!1,instances:t.prop("count"),count:d.length}),s(x,{update:A,draw:_,destroy:T,regl:t,gl:m,canvas:m.canvas,groups:b}),x;function x(t){t?A(t):null===t&&T(),_()}function _(e){if("number"==typeof e)return w(e);e&&!Array.isArray(e)&&(e=[e]),t._refresh(),b.forEach((function(t,r){t&&(e&&(e[r]?t.draw=!0:t.draw=!1),t.draw?w(r):t.draw=!0)}))}function w(t){"number"==typeof t&&(t=b[t]),null!=t&&t&&t.count&&t.color&&t.opacity&&t.positions&&t.positions.length>1&&(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<r;i++)t[i]=n}if(t.length<r)throw Error("Not enough colors");for(var o=new Uint8Array(4*r),s=0;s<r;s++){var l=a(t[s],"uint8");o.set(l,4*s)}return o},range:function(t,e,r){var n=e.bounds;return t||(t=n),e.scale=[1/(t[2]-t[0]),1/(t[3]-t[1])],e.translate=[-t[0],-t[1]],e.scaleFract=f(e.scale),e.translateFract=f(e.translate),t},viewport:function(t){var e;return Array.isArray(t)?e={x:t[0],y:t[1],width:t[2]-t[0],height:t[3]-t[1]}:t?(e={x:t.x||t.left||0,y:t.y||t.top||0},t.right?e.width=t.right-e.x:e.width=t.w||t.width||0,t.bottom?e.height=t.bottom-e.y:e.height=t.h||t.height||0):e={x:0,y:0,width:m.drawingBufferWidth,height:m.drawingBufferHeight},e}}]),c):c})),e||r){var d=b.reduce((function(t,e,r){return t+(e?e.count:0)}),0),v=new Float64Array(2*d),_=new Uint8Array(4*d),w=new Float32Array(4*d);b.forEach((function(t,e){if(t){var r=t.positions,n=t.count,a=t.offset,i=t.color,o=t.errors;n&&(_.set(i,4*a),w.set(o,4*a),v.set(r,2*a))}})),u(c(v)),h(f(v)),p(_),g(w)}}}function T(){u.destroy(),h.destroy(),p.destroy(),g.destroy(),v.destroy()}};var d=[[1,0,0,1,0,0],[1,0,0,-1,0,0],[-1,0,0,-1,0,0],[-1,0,0,-1,0,0],[-1,0,0,1,0,0],[1,0,0,1,0,0],[1,0,-1,0,0,1],[1,0,-1,0,0,-1],[1,0,1,0,0,-1],[1,0,1,0,0,-1],[1,0,1,0,0,1],[1,0,-1,0,0,1],[-1,0,-1,0,0,1],[-1,0,-1,0,0,-1],[-1,0,1,0,0,-1],[-1,0,1,0,0,-1],[-1,0,1,0,0,1],[-1,0,-1,0,0,1],[0,1,1,0,0,0],[0,1,-1,0,0,0],[0,-1,-1,0,0,0],[0,-1,-1,0,0,0],[0,1,1,0,0,0],[0,-1,1,0,0,0],[0,1,0,-1,1,0],[0,1,0,-1,-1,0],[0,1,0,1,-1,0],[0,1,0,1,1,0],[0,1,0,-1,1,0],[0,1,0,1,-1,0],[0,-1,0,-1,1,0],[0,-1,0,-1,-1,0],[0,-1,0,1,-1,0],[0,-1,0,1,1,0],[0,-1,0,-1,1,0],[0,-1,0,1,-1,0]]},{"array-bounds":14,"color-normalize":63,"flatten-vertex-data":156,"object-assign":262,"pick-by-alias":271,"to-float32":323,"update-diff":343}],292:[function(t,e,r){"use strict";var n=t("color-normalize"),a=t("array-bounds"),i=t("object-assign"),o=t("glslify"),s=t("pick-by-alias"),l=t("flatten-vertex-data"),u=t("earcut"),c=t("array-normalize"),f=t("to-float32"),d=f.float32,h=f.fract32,p=t("es6-weak-map"),g=t("parse-rect");function v(t,e){if(!(this instanceof v))return new v(t,e);if("function"==typeof t?(e||(e={}),e.regl=t):e=t,e.length&&(e.positions=e),!(t=e.regl).hasExtension("ANGLE_instanced_arrays"))throw Error("regl-error2d: `ANGLE_instanced_arrays` extension should be enabled");this.gl=t._gl,this.regl=t,this.passes=[],this.shaders=v.shaders.has(t)?v.shaders.get(t):v.shaders.set(t,v.createShaders(t)).get(t),this.update(e)}e.exports=v,v.dashMult=2,v.maxPatternLength=256,v.precisionThreshold=3e6,v.maxPoints=1e4,v.maxLines=2048,v.shaders=new p,v.createShaders=function(t){var e,r=t.buffer({usage:"static",type:"float",data:[0,1,0,0,1,1,1,0]}),n={primitive:"triangle strip",instances:t.prop("count"),count:4,offset:0,uniforms:{miterMode:function(t,e){return"round"===e.join?2:1},miterLimit:t.prop("miterLimit"),scale:t.prop("scale"),scaleFract:t.prop("scaleFract"),translateFract:t.prop("translateFract"),translate:t.prop("translate"),thickness:t.prop("thickness"),dashPattern:t.prop("dashTexture"),opacity:t.prop("opacity"),pixelRatio:t.context("pixelRatio"),id:t.prop("id"),dashSize:t.prop("dashLength"),viewport:function(t,e){return[e.viewport.x,e.viewport.y,t.viewportWidth,t.viewportHeight]},depth:t.prop("depth")},blend:{enable:!0,color:[0,0,0,0],equation:{rgb:"add",alpha:"add"},func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:"one minus dst alpha",dstAlpha:"one"}},depth:{enable:function(t,e){return!e.overlay}},stencil:{enable:!1},scissor:{enable:!0,box:t.prop("viewport")},viewport:t.prop("viewport")},a=t(i({vert:o(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec2 aCoord, bCoord, aCoordFract, bCoordFract;\nattribute vec4 color;\nattribute float lineEnd, lineTop;\n\nuniform vec2 scale, scaleFract, translate, translateFract;\nuniform float thickness, pixelRatio, id, depth;\nuniform vec4 viewport;\n\nvarying vec4 fragColor;\nvarying vec2 tangent;\n\nvec2 project(vec2 position, vec2 positionFract, vec2 scale, vec2 scaleFract, vec2 translate, vec2 translateFract) {\n\t// the order is important\n\treturn position * scale + translate\n + positionFract * scale + translateFract\n + position * scaleFract\n + positionFract * scaleFract;\n}\n\nvoid main() {\n\tfloat lineStart = 1. - lineEnd;\n\tfloat lineOffset = lineTop * 2. - 1.;\n\n\tvec2 diff = (bCoord + bCoordFract - aCoord - aCoordFract);\n\ttangent = normalize(diff * scale * viewport.zw);\n\tvec2 normal = vec2(-tangent.y, tangent.x);\n\n\tvec2 position = project(aCoord, aCoordFract, scale, scaleFract, translate, translateFract) * lineStart\n\t\t+ project(bCoord, bCoordFract, scale, scaleFract, translate, translateFract) * lineEnd\n\n\t\t+ thickness * normal * .5 * lineOffset / viewport.zw;\n\n\tgl_Position = vec4(position * 2.0 - 1.0, depth, 1);\n\n\tfragColor = color / 255.;\n}\n"]),frag:o(["precision highp float;\n#define GLSLIFY 1\n\nuniform sampler2D dashPattern;\n\nuniform float dashSize, pixelRatio, thickness, opacity, id;\n\nvarying vec4 fragColor;\nvarying vec2 tangent;\n\nvoid main() {\n\tfloat alpha = 1.;\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},aCoord:{buffer:t.prop("positionBuffer"),stride:8,offset:8,divisor:1},bCoord:{buffer:t.prop("positionBuffer"),stride:8,offset:16,divisor:1},aCoordFract:{buffer:t.prop("positionFractBuffer"),stride:8,offset:8,divisor:1},bCoordFract:{buffer:t.prop("positionFractBuffer"),stride:8,offset:16,divisor:1},color:{buffer:t.prop("colorBuffer"),stride:4,offset:0,divisor:1}}},n));try{e=t(i({cull:{enable:!0,face:"back"},vert:o(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec2 aCoord, bCoord, nextCoord, prevCoord;\nattribute vec4 aColor, bColor;\nattribute float lineEnd, lineTop;\n\nuniform vec2 scale, translate;\nuniform float thickness, pixelRatio, id, depth;\nuniform vec4 viewport;\nuniform float miterLimit, miterMode;\n\nvarying vec4 fragColor;\nvarying vec4 startCutoff, endCutoff;\nvarying vec2 tangent;\nvarying vec2 startCoord, endCoord;\nvarying float enableStartMiter, enableEndMiter;\n\nconst float REVERSE_THRESHOLD = -.875;\nconst float MIN_DIFF = 1e-6;\n\n// TODO: possible optimizations: avoid overcalculating all for vertices and calc just one instead\n// TODO: precalculate dot products, normalize things beforehead etc.\n// TODO: refactor to rectangular algorithm\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\nbool isNaN( float val ){\n return ( val < 0.0 || 0.0 < val || val == 0.0 ) ? false : true;\n}\n\nvoid main() {\n\tvec2 aCoord = aCoord, bCoord = bCoord, prevCoord = prevCoord, nextCoord = nextCoord;\n\n vec2 adjustedScale;\n adjustedScale.x = (abs(scale.x) < MIN_DIFF) ? MIN_DIFF : scale.x;\n adjustedScale.y = (abs(scale.y) < MIN_DIFF) ? MIN_DIFF : scale.y;\n\n vec2 scaleRatio = adjustedScale * viewport.zw;\n\tvec2 normalWidth = thickness / scaleRatio;\n\n\tfloat lineStart = 1. - lineEnd;\n\tfloat lineBot = 1. - lineTop;\n\n\tfragColor = (lineStart * aColor + lineEnd * bColor) / 255.;\n\n\tif (isNaN(aCoord.x) || isNaN(aCoord.y) || isNaN(bCoord.x) || isNaN(bCoord.y)) return;\n\n\tif (aCoord == prevCoord) prevCoord = aCoord + normalize(bCoord - aCoord);\n\tif (bCoord == nextCoord) nextCoord = bCoord - normalize(bCoord - aCoord);\n\n\tvec2 prevDiff = aCoord - prevCoord;\n\tvec2 currDiff = bCoord - aCoord;\n\tvec2 nextDiff = nextCoord - bCoord;\n\n\tvec2 prevTangent = normalize(prevDiff * scaleRatio);\n\tvec2 currTangent = normalize(currDiff * scaleRatio);\n\tvec2 nextTangent = normalize(nextDiff * scaleRatio);\n\n\tvec2 prevNormal = vec2(-prevTangent.y, prevTangent.x);\n\tvec2 currNormal = vec2(-currTangent.y, currTangent.x);\n\tvec2 nextNormal = vec2(-nextTangent.y, nextTangent.x);\n\n\tvec2 startJoinDirection = normalize(prevTangent - currTangent);\n\tvec2 endJoinDirection = normalize(currTangent - nextTangent);\n\n\t// collapsed/unidirectional segment cases\n\t// FIXME: there should be more elegant solution\n\tvec2 prevTanDiff = abs(prevTangent - currTangent);\n\tvec2 nextTanDiff = abs(nextTangent - currTangent);\n\tif (max(prevTanDiff.x, prevTanDiff.y) < MIN_DIFF) {\n\t\tstartJoinDirection = currNormal;\n\t}\n\tif (max(nextTanDiff.x, nextTanDiff.y) < MIN_DIFF) {\n\t\tendJoinDirection = currNormal;\n\t}\n\tif (aCoord == bCoord) {\n\t\tendJoinDirection = startJoinDirection;\n\t\tcurrNormal = prevNormal;\n\t\tcurrTangent = prevTangent;\n\t}\n\n\ttangent = currTangent;\n\n\t//calculate join shifts relative to normals\n\tfloat startJoinShift = dot(currNormal, startJoinDirection);\n\tfloat endJoinShift = dot(currNormal, endJoinDirection);\n\n\tfloat startMiterRatio = abs(1. / startJoinShift);\n\tfloat endMiterRatio = abs(1. / endJoinShift);\n\n\tvec2 startJoin = startJoinDirection * startMiterRatio;\n\tvec2 endJoin = endJoinDirection * endMiterRatio;\n\n\tvec2 startTopJoin, startBotJoin, endTopJoin, endBotJoin;\n\tstartTopJoin = sign(startJoinShift) * startJoin * .5;\n\tstartBotJoin = -startTopJoin;\n\n\tendTopJoin = sign(endJoinShift) * endJoin * .5;\n\tendBotJoin = -endTopJoin;\n\n\tvec2 aTopCoord = aCoord + normalWidth * startTopJoin;\n\tvec2 bTopCoord = bCoord + normalWidth * endTopJoin;\n\tvec2 aBotCoord = aCoord + normalWidth * startBotJoin;\n\tvec2 bBotCoord = bCoord + normalWidth * endBotJoin;\n\n\t//miter anti-clipping\n\tfloat baClipping = distToLine(bCoord, aCoord, aBotCoord) / dot(normalize(normalWidth * endBotJoin), normalize(normalWidth.yx * vec2(-startBotJoin.y, startBotJoin.x)));\n\tfloat abClipping = distToLine(aCoord, bCoord, bTopCoord) / dot(normalize(normalWidth * startBotJoin), normalize(normalWidth.yx * vec2(-endBotJoin.y, endBotJoin.x)));\n\n\t//prevent close to reverse direction switch\n\tbool prevReverse = dot(currTangent, prevTangent) <= REVERSE_THRESHOLD && abs(dot(currTangent, prevNormal)) * min(length(prevDiff), length(currDiff)) < length(normalWidth * currNormal);\n\tbool nextReverse = dot(currTangent, nextTangent) <= REVERSE_THRESHOLD && abs(dot(currTangent, nextNormal)) * min(length(nextDiff), length(currDiff)) < length(normalWidth * currNormal);\n\n\tif (prevReverse) {\n\t\t//make join rectangular\n\t\tvec2 miterShift = normalWidth * startJoinDirection * miterLimit * .5;\n\t\tfloat normalAdjust = 1. - min(miterLimit / startMiterRatio, 1.);\n\t\taBotCoord = aCoord + miterShift - normalAdjust * normalWidth * currNormal * .5;\n\t\taTopCoord = aCoord + miterShift + normalAdjust * normalWidth * currNormal * .5;\n\t}\n\telse if (!nextReverse && baClipping > 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,f<v.maxLines&&(p.depth=2*(v.maxLines-1-f%v.maxLines)/v.maxLines-1)),null!=t.join&&(p.join=t.join),null!=t.hole&&(p.hole=t.hole),null!=t.fill&&(p.fill=t.fill?n(t.fill,"uint8"):null),null!=t.viewport&&(p.viewport=g(t.viewport)),p.viewport||(p.viewport=g([o.drawingBufferWidth,o.drawingBufferHeight])),null!=t.close&&(p.close=t.close),null===t.positions&&(t.positions=[]),t.positions){var m,y;if(t.positions.x&&t.positions.y){var b=t.positions.x,x=t.positions.y;y=p.count=Math.max(b.length,x.length),m=new Float64Array(2*y);for(var _=0;_<y;_++)m[2*_]=b[_],m[2*_+1]=x[_]}else m=l(t.positions,"float64"),y=p.count=Math.floor(m.length/2);var w=p.bounds=a(m,2);if(p.fill){for(var A=[],T={},k=0,M=0,E=0,S=p.count;M<S;M++){var C=m[2*M],L=m[2*M+1];isNaN(C)||isNaN(L)||null==C||null==L?(C=m[2*k],L=m[2*k+1],T[M]=k):k=M,A[E++]=C,A[E++]=L}for(var O=u(A,p.hole||[]),D=0,R=O.length;D<R;D++)null!=T[O[D]]&&(O[D]=T[O[D]]);p.triangles=O}var I=new Float64Array(m);c(I,2,w);var P=new Float64Array(2*y+6);p.close?m[0]===m[2*y-2]&&m[1]===m[2*y-1]?(P[0]=I[2*y-4],P[1]=I[2*y-3]):(P[0]=I[2*y-2],P[1]=I[2*y-1]):(P[0]=I[0],P[1]=I[1]),P.set(I,2),p.close?m[0]===m[2*y-2]&&m[1]===m[2*y-1]?(P[2*y+2]=I[2],P[2*y+3]=I[3],p.count-=1):(P[2*y+2]=I[0],P[2*y+3]=I[1],P[2*y+4]=I[2],P[2*y+5]=I[3]):(P[2*y+2]=I[2*y-2],P[2*y+3]=I[2*y-1],P[2*y+4]=I[2*y-2],P[2*y+5]=I[2*y-1]),p.positionBuffer(d(P)),p.positionFractBuffer(h(P))}if(t.range?p.range=t.range:p.range||(p.range=p.bounds),(t.range||t.positions)&&p.count){var F=p.bounds,z=F[2]-F[0],N=F[3]-F[1],B=p.range[2]-p.range[0],j=p.range[3]-p.range[1];p.scale=[z/B,N/j],p.translate=[-p.range[0]/B+F[0]/B||0,-p.range[1]/j+F[1]/j||0],p.scaleFract=h(p.scale),p.translateFract=h(p.translate)}if(t.dashes){var U,V=0;if(!t.dashes||t.dashes.length<2)V=1,U=new Uint8Array([255,255,255,255,255,255,255,255]);else{V=0;for(var H=0;H<t.dashes.length;++H)V+=t.dashes[H];U=new Uint8Array(V*v.dashMult);for(var G=0,q=255,X=0;X<2;X++)for(var W=0;W<t.dashes.length;++W){for(var Y=0,Z=t.dashes[W]*v.dashMult*.5;Y<Z;++Y)U[G++]=q;q^=255}}p.dashLength=V,p.dashTexture({channels:1,data:U,width:U.length,height:1,mag:"linear",min:"linear"},0,0)}if(t.color){var J=p.count,Q=t.color;Q||(Q="transparent");var $=new Uint8Array(4*J+4);if(Array.isArray(Q)&&"number"!=typeof Q[0]){for(var K=0;K<J;K++){var tt=n(Q[K],"uint8");$.set(tt,4*K)}$.set(n(Q[0],"uint8"),4*J)}else for(var et=n(Q,"uint8"),rt=0;rt<J+1;rt++)$.set(et,4*rt);p.colorBuffer({usage:"dynamic",type:"uint8",data:$})}}else e.passes[f]=null})),t.length<this.passes.length){for(var f=t.length;f<this.passes.length;f++){var p=this.passes[f];p&&(p.colorBuffer.destroy(),p.positionBuffer.destroy(),p.dashTexture.destroy())}this.passes.length=t.length}for(var m=[],y=0;y<this.passes.length;y++)null!==this.passes[y]&&m.push(this.passes[y]);return this.passes=m,this}},v.prototype.destroy=function(){return this.passes.forEach((function(t){t.colorBuffer.destroy(),t.positionBuffer.destroy(),t.dashTexture.destroy()})),this.passes.length=0,this}},{"array-bounds":14,"array-normalize":15,"color-normalize":63,earcut:93,"es6-weak-map":148,"flatten-vertex-data":156,glslify:293,"object-assign":262,"parse-rect":265,"pick-by-alias":271,"to-float32":323}],293:[function(t,e,r){arguments[4][167][0].apply(r,arguments)},{dup:167}],294:[function(t,e,r){"use strict";function n(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var r=[],n=!0,a=!1,i=void 0;try{for(var o,s=t[Symbol.iterator]();!(n=(o=s.next()).done)&&(r.push(o.value),!e||r.length!==e);n=!0);}catch(t){a=!0,i=t}finally{try{n||null==s.return||s.return()}finally{if(a)throw i}}return r}(t,e)||i(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(t){return function(t){if(Array.isArray(t))return o(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||i(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(t,e){if(t){if("string"==typeof t)return o(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?o(t,e):void 0}}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var s=t("color-normalize"),l=t("array-bounds"),u=t("color-id"),c=t("@plotly/point-cluster"),f=t("object-assign"),d=t("glslify"),h=t("pick-by-alias"),p=t("update-diff"),g=t("flatten-vertex-data"),v=t("is-iexplorer"),m=t("to-float32"),y=t("parse-rect"),b=x;function x(t,e){var r=this;if(!(this instanceof x))return new x(t,e);"function"==typeof t?(e||(e={}),e.regl=t):(e=t,t=null),e&&e.length&&(e.positions=e);var n,a=(t=e.regl)._gl,i=[];this.tooManyColors=v,n=t.texture({data:new Uint8Array(1020),width:255,height:1,type:"uint8",format:"rgba",wrapS:"clamp",wrapT:"clamp",mag:"nearest",min:"nearest"}),f(this,{regl:t,gl:a,groups:[],markerCache:[null],markerTextures:[null],palette:i,paletteIds:{},paletteTexture:n,maxColors:255,maxSize:100,canvas:a.canvas}),this.update(e);var o={uniforms:{constPointSize:!!e.constPointSize,pixelRatio:t.context("pixelRatio"),palette:n,paletteSize:function(t,e){return[r.tooManyColors?0:255,n.height]},scale:t.prop("scale"),scaleFract:t.prop("scaleFract"),translate:t.prop("translate"),translateFract:t.prop("translateFract"),opacity:t.prop("opacity"),marker:t.prop("markerTexture")},attributes:{x:function(t,e){return e.xAttr||{buffer:e.positionBuffer,stride:8,offset:0}},y:function(t,e){return e.yAttr||{buffer:e.positionBuffer,stride:8,offset:4}},xFract:function(t,e){return e.xAttr?{constant:[0,0]}:{buffer:e.positionFractBuffer,stride:8,offset:0}},yFract:function(t,e){return e.yAttr?{constant:[0,0]}:{buffer:e.positionFractBuffer,stride:8,offset:4}},size:function(t,e){return e.size.length?{buffer:e.sizeBuffer,stride:2,offset:0}:{constant:[Math.round(255*e.size/r.maxSize)]}},borderSize:function(t,e){return e.borderSize.length?{buffer:e.sizeBuffer,stride:2,offset:1}:{constant:[Math.round(255*e.borderSize/r.maxSize)]}},colorId:function(t,e){return e.color.length?{buffer:e.colorBuffer,stride:r.tooManyColors?8:4,offset:0}:{constant:r.tooManyColors?i.slice(4*e.color,4*e.color+4):[e.color]}},borderColorId:function(t,e){return e.borderColor.length?{buffer:e.colorBuffer,stride:r.tooManyColors?8:4,offset:r.tooManyColors?4:2}:{constant:r.tooManyColors?i.slice(4*e.borderColor,4*e.borderColor+4):[e.borderColor]}},isActive:function(t,e){return!0===e.activation?{constant:[1]}:e.activation?e.activation:{constant:[0]}}},blend:{enable:!0,color:[0,0,0,1],func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:"one minus dst alpha",dstAlpha:"one"}},scissor:{enable:!0,box:t.prop("viewport")},viewport:t.prop("viewport"),stencil:{enable:!1},depth:{enable:!1},elements:t.prop("elements"),count:t.prop("count"),offset:t.prop("offset"),primitive:"points"},s=f({},o);s.frag=d(["precision highp float;\n#define GLSLIFY 1\n\nvarying vec4 fragColor, fragBorderColor;\nvarying float fragWidth, fragBorderColorLevel, fragColorLevel;\n\nuniform sampler2D marker;\nuniform float opacity;\n\nfloat smoothStep(float x, float y) {\n return 1.0 / (1.0 + exp(50.0*(x - y)));\n}\n\nvoid main() {\n float dist = texture2D(marker, gl_PointCoord).r, delta = fragWidth;\n\n // max-distance alpha\n if (dist < 0.003) discard;\n\n // null-border case\n if (fragBorderColorLevel == fragColorLevel || fragBorderColor.a == 0.) {\n float colorAmt = smoothstep(.5 - delta, .5 + delta, dist);\n gl_FragColor = vec4(fragColor.rgb, colorAmt * fragColor.a * opacity);\n }\n else {\n float borderColorAmt = smoothstep(fragBorderColorLevel - delta, fragBorderColorLevel + delta, dist);\n float colorAmt = smoothstep(fragColorLevel - delta, fragColorLevel + delta, dist);\n\n vec4 color = fragBorderColor;\n color.a *= borderColorAmt;\n color = mix(color, fragColor, colorAmt);\n color.a *= opacity;\n\n gl_FragColor = color;\n }\n\n}\n"]),s.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, paletteSize;\nuniform float pixelRatio;\nuniform bool constPointSize;\nuniform sampler2D palette;\n\nconst float maxSize = 100.;\nconst float borderLevel = .5;\n\nvarying vec4 fragColor, fragBorderColor;\nvarying float fragPointSize, fragBorderRadius, fragWidth, fragBorderColorLevel, fragColorLevel;\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 = 2. * size * pointSizeScale;\n fragPointSize = size * pixelRatio;\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 fragColor = color;\n fragBorderColor = borderColor;\n fragWidth = 1. / gl_PointSize;\n\n fragBorderColorLevel = clamp(borderLevel - borderLevel * borderSize / size, 0., 1.);\n fragColorLevel = clamp(borderLevel + (1. - borderLevel) * borderSize / size, 0., 1.);\n}"]),this.drawMarker=t(s);var l=f({},o);l.frag=d(["precision highp float;\n#define GLSLIFY 1\n\nvarying vec4 fragColor, fragBorderColor;\n\nuniform float opacity;\nvarying float fragBorderRadius, fragWidth;\n\nfloat smoothStep(float edge0, float edge1, float x) {\n\tfloat t;\n\tt = clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0);\n\treturn t * t * (3.0 - 2.0 * t);\n}\n\nvoid main() {\n\tfloat radius, alpha = 1.0, delta = fragWidth;\n\n\tradius = length(2.0 * gl_PointCoord.xy - 1.0);\n\n\tif (radius > 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;n<e;n++)r[n]=arguments[n];var a=this.groups;if(1===r.length&&Array.isArray(r[0])&&(null===r[0][0]||Array.isArray(r[0][0]))&&(r=r[0]),this.regl._refresh(),r.length)for(var i=0;i<r.length;i++)this.drawItem(i,r[i]);else a.forEach((function(e,r){t.drawItem(r)}));return this},x.prototype.drawItem=function(t,e){var r=this.groups,n=r[t];if("number"==typeof e&&(t=e,n=r[e],e=null),n&&n.count&&n.opacity){n.activation[0]&&this.drawCircle(this.getMarkerDrawOptions(0,n,e));for(var i=[],o=1;o<n.activation.length;o++)n.activation[o]&&(!0===n.activation[o]||n.activation[o].data.length)&&i.push.apply(i,a(this.getMarkerDrawOptions(o,n,e)));i.length&&this.drawMarker(i)}},x.prototype.getMarkerDrawOptions=function(t,e,r){var a=e.range,i=e.tree,o=e.viewport,s=e.activation,l=e.selectionBuffer,u=e.count;this.regl;if(!i)return r?[f({},e,{markerTexture:this.markerTextures[t],activation:s[t],count:r.length,elements:r,offset:0})]:[f({},e,{markerTexture:this.markerTextures[t],activation:s[t],offset:0})];var c=[],d=i.range(a,{lod:!0,px:[(a[2]-a[0])/o.width,(a[3]-a[1])/o.height]});if(r){for(var h=s[t].data,p=new Uint8Array(u),g=0;g<r.length;g++){var v=r[g];p[v]=h?h[v]:1}l.subdata(p)}for(var m=d.length;m--;){var y=n(d[m],2),b=y[0],x=y[1];c.push(f({},e,{markerTexture:this.markerTextures[t],activation:r?l:s[t],offset:b,count:x-b}))}return c},x.prototype.update=function(){for(var t=this,e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];if(r.length){1===r.length&&Array.isArray(r[0])&&(r=r[0]);var a=this.groups,i=this.gl,o=this.regl,s=this.maxSize,u=this.maxColors,d=this.palette;this.groups=a=r.map((function(e,r){var n=a[r];if(void 0===e)return n;null===e?e={positions:null}:"function"==typeof e?e={ondraw:e}:"number"==typeof e[0]&&(e={positions:e}),null===(e=h(e,{positions:"positions data points",snap:"snap cluster lod tree",size:"sizes size radius",borderSize:"borderSizes borderSize border-size bordersize borderWidth borderWidths border-width borderwidth stroke-width strokeWidth strokewidth outline",color:"colors color fill fill-color fillColor",borderColor:"borderColors borderColor stroke stroke-color strokeColor",marker:"markers marker shape",range:"range dataBox databox",viewport:"viewport viewPort viewBox viewbox",opacity:"opacity alpha transparency",bounds:"bound bounds boundaries limits",tooManyColors:"tooManyColors palette paletteMode optimizePalette enablePalette"})).positions&&(e.positions=[]),null!=e.tooManyColors&&(t.tooManyColors=e.tooManyColors),n||(a[r]=n={id:r,scale:null,translate:null,scaleFract:null,translateFract:null,activation:[],selectionBuffer:o.buffer({data:new Uint8Array(0),usage:"stream",type:"uint8"}),sizeBuffer:o.buffer({data:new Uint8Array(0),usage:"dynamic",type:"uint8"}),colorBuffer:o.buffer({data:new Uint8Array(0),usage:"dynamic",type:"uint8"}),positionBuffer:o.buffer({data:new Uint8Array(0),usage:"dynamic",type:"float"}),positionFractBuffer:o.buffer({data:new Uint8Array(0),usage:"dynamic",type:"float"})},e=f({},x.defaults,e)),e.positions&&!("marker"in e)&&(e.marker=n.marker,delete n.marker),e.marker&&!("positions"in e)&&(e.positions=n.positions,delete n.positions);var v=0,b=0;if(p(n,e,[{snap:!0,size:function(t,e){return null==t&&(t=x.defaults.size),v+=t&&t.length?1:0,t},borderSize:function(t,e){return null==t&&(t=x.defaults.borderSize),v+=t&&t.length?1:0,t},opacity:parseFloat,color:function(e,r){return null==e&&(e=x.defaults.color),e=t.updateColor(e),b++,e},borderColor:function(e,r){return null==e&&(e=x.defaults.borderColor),e=t.updateColor(e),b++,e},bounds:function(t,e,r){return"range"in r||(r.range=null),t},positions:function(t,e,r){var n=e.snap,a=e.positionBuffer,i=e.positionFractBuffer,s=e.selectionBuffer;if(t.x||t.y)return t.x.length?e.xAttr={buffer:o.buffer(t.x),offset:0,stride:4,count:t.x.length}:e.xAttr={buffer:t.x.buffer,offset:4*t.x.offset||0,stride:4*(t.x.stride||1),count:t.x.count},t.y.length?e.yAttr={buffer:o.buffer(t.y),offset:0,stride:4,count:t.y.length}:e.yAttr={buffer:t.y.buffer,offset:4*t.y.offset||0,stride:4*(t.y.stride||1),count:t.y.count},e.count=Math.max(e.xAttr.count,e.yAttr.count),t;t=g(t,"float64");var u=e.count=Math.floor(t.length/2),f=e.bounds=u?l(t,2):null;if(r.range||e.range||(delete e.range,r.range=f),r.marker||e.marker||(delete e.marker,r.marker=null),n&&(!0===n||u>n)?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<l;s++){var u=t.addMarker(e[s]);i[u]||(i[u]=new Uint8Array(r.count)),i[u][s]=1}for(var c=0;c<i.length;c++)if(i[c]){var f={data:i[c],type:"uint8",usage:"static"};a[c]?a[c](f):a[c]=o.buffer(f),a[c].data=i[c]}}else{a[t.addMarker(e)]=!0}return e},range:function(t,e,r){var n=e.bounds;if(n)return t||(t=n),e.scale=[1/(t[2]-t[0]),1/(t[3]-t[1])],e.translate=[-t[0],-t[1]],e.scaleFract=m.fract(e.scale),e.translateFract=m.fract(e.translate),t},viewport:function(t){return y(t||[i.drawingBufferWidth,i.drawingBufferHeight])}}]),v){var _=n,w=_.count,A=_.size,T=_.borderSize,k=_.sizeBuffer,M=new Uint8Array(2*w);if(A.length||T.length)for(var E=0;E<w;E++)M[2*E]=Math.round(255*(null==A[E]?A:A[E])/s),M[2*E+1]=Math.round(255*(null==T[E]?T:T[E])/s);k({data:M,usage:"dynamic"})}if(b){var S,C=n,L=C.count,O=C.color,D=C.borderColor,R=C.colorBuffer;if(t.tooManyColors){if(O.length||D.length){S=new Uint8Array(8*L);for(var I=0;I<L;I++){var P=O[I];S[8*I]=d[4*P],S[8*I+1]=d[4*P+1],S[8*I+2]=d[4*P+2],S[8*I+3]=d[4*P+3];var F=D[I];S[8*I+4]=d[4*F],S[8*I+5]=d[4*F+1],S[8*I+6]=d[4*F+2],S[8*I+7]=d[4*F+3]}}}else if(O.length||D.length){S=new Uint8Array(4*L+2);for(var z=0;z<L;z++)null!=O[z]&&(S[4*z]=O[z]%u,S[4*z+1]=Math.floor(O[z]/u)),null!=D[z]&&(S[4*z+2]=D[z]%u,S[4*z+3]=Math.floor(D[z]/u))}R({data:S||new Uint8Array(0),type:"uint8",usage:"dynamic"})}return n}))}},x.prototype.addMarker=function(t){var e,r=this.markerTextures,n=this.regl,a=this.markerCache,i=null==t?0:a.indexOf(t);if(i>=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;o<s;o++)e[o]=255*t[o]}var l=Math.floor(Math.sqrt(e.length));return i=r.length,a.push(t),r.push(n.texture({channels:1,data:e,radius:l,mag:"linear",min:"linear"})),i},x.prototype.updateColor=function(t){var e=this.paletteIds,r=this.palette,n=this.maxColors;Array.isArray(t)||(t=[t]);var a=[];if("number"==typeof t[0]){var i=[];if(Array.isArray(t))for(var o=0;o<t.length;o+=4)i.push(t.slice(o,o+4));else for(var l=0;l<t.length;l+=4)i.push(t.subarray(l,l+4));t=i}for(var c=0;c<t.length;c++){var f=t[c];f=s(f,"uint8");var d=u(f,!1);if(null==e[d]){var h=r.length;e[d]=Math.floor(h/4),r[h]=f[0],r[h+1]=f[1],r[h+2]=f[2],r[h+3]=f[3]}a[c]=e[d]}return!this.tooManyColors&&r.length>4*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;a<n*e;a++)t.push(0,0,0,0);r.height<n&&r.resize(e,n),r.subimage({width:Math.min(.25*t.length,e),height:n,data:t},0,0)}},x.prototype.destroy=function(){return this.groups.forEach((function(t){t.sizeBuffer.destroy(),t.positionBuffer.destroy(),t.positionFractBuffer.destroy(),t.colorBuffer.destroy(),t.activation.forEach((function(t){return t&&t.destroy&&t.destroy()})),t.selectionBuffer.destroy(),t.elements&&t.elements.destroy()})),this.groups.length=0,this.paletteTexture.destroy(),this.markerTextures.forEach((function(t){return t&&t.destroy&&t.destroy()})),this};var _=t("object-assign");e.exports=function(t,e){var r=new b(t,e),n=r.render.bind(r);return _(n,{render:n,update:r.update.bind(r),draw:r.draw.bind(r),destroy:r.destroy.bind(r),regl:r.regl,gl:r.gl,canvas:r.gl.canvas,groups:r.groups,markers:r.markerCache,palette:r.palette}),n}},{"@plotly/point-cluster":10,"array-bounds":14,"color-id":61,"color-normalize":63,"flatten-vertex-data":156,glslify:295,"is-iexplorer":246,"object-assign":262,"parse-rect":265,"pick-by-alias":271,"to-float32":323,"update-diff":343}],295:[function(t,e,r){arguments[4][167][0].apply(r,arguments)},{dup:167}],296:[function(t,e,r){"use strict";var n=t("regl-scatter2d"),a=t("pick-by-alias"),i=t("array-bounds"),o=t("raf"),s=t("array-range"),l=t("parse-rect"),u=t("flatten-vertex-data");function c(t,e){if(!(this instanceof c))return new c(t,e);this.traces=[],this.passes={},this.regl=t,this.scatter=n(t),this.canvas=this.scatter.canvas}function f(t,e,r){return(null!=t.id?t.id:t)<<16|(255&e)<<8|255&r}function d(t,e,r){var n,a,i,o,s=t[e],l=t[r];return s.length>2?(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;n<e.length;n++)this.updateItem(n,e[n]);this.traces=this.traces.filter(Boolean);for(var a=[],i=0,o=0;o<this.traces.length;o++){for(var s=this.traces[o],l=this.traces[o].passes,u=0;u<l.length;u++)a.push(this.passes[l[u]]);s.passOffset=i,i+=s.passes.length}return(t=this.scatter).update.apply(t,a),this}},c.prototype.updateItem=function(t,e){var r=this.regl;if(null===e)return this.traces[t]=null,this;if(!e)return this;var n,o=a(e,{data:"data items columns rows values dimensions samples x",snap:"snap cluster",size:"sizes size radius",color:"colors color fill fill-color fillColor",opacity:"opacity alpha transparency opaque",borderSize:"borderSizes borderSize border-size bordersize borderWidth borderWidths border-width borderwidth stroke-width strokeWidth strokewidth outline",borderColor:"borderColors borderColor bordercolor stroke stroke-color strokeColor",marker:"markers marker shape",range:"range ranges databox dataBox",viewport:"viewport viewBox viewbox",domain:"domain domains area areas",padding:"pad padding paddings pads margin margins",transpose:"transpose transposed",diagonal:"diagonal diag showDiagonal",upper:"upper up top upperhalf upperHalf showupperhalf showUpper showUpperHalf",lower:"lower low bottom lowerhalf lowerHalf showlowerhalf showLowerHalf showLower"}),s=this.traces[t]||(this.traces[t]={id:t,buffer:r.buffer({usage:"dynamic",type:"float",data:new Uint8Array}),color:"black",marker:null,size:12,borderColor:"transparent",borderSize:1,viewport:l([r._gl.drawingBufferWidth,r._gl.drawingBufferHeight]),padding:[0,0,0,0],opacity:1,diagonal:!0,upper:!0,lower:!0});if(null!=o.color&&(s.color=o.color),null!=o.size&&(s.size=o.size),null!=o.marker&&(s.marker=o.marker),null!=o.borderColor&&(s.borderColor=o.borderColor),null!=o.borderSize&&(s.borderSize=o.borderSize),null!=o.opacity&&(s.opacity=o.opacity),o.viewport&&(s.viewport=l(o.viewport)),null!=o.diagonal&&(s.diagonal=o.diagonal),null!=o.upper&&(s.upper=o.upper),null!=o.lower&&(s.lower=o.lower),o.data){s.buffer(u(o.data)),s.columns=o.data.length,s.count=o.data[0].length,s.bounds=[];for(var c=0;c<s.columns;c++)s.bounds[c]=i(o.data[c],1)}o.range&&(s.range=o.range,n=s.range&&"number"!=typeof s.range[0]),o.domain&&(s.domain=o.domain);var p=!1;null!=o.padding&&(Array.isArray(o.padding)&&o.padding.length===s.columns&&"number"==typeof o.padding[o.padding.length-1]?(s.padding=o.padding.map(h),p=!0):s.padding=h(o.padding));var g=s.columns,v=s.count,m=s.viewport.width,y=s.viewport.height,b=s.viewport.x,x=s.viewport.y,_=m/g,w=y/g;s.passes=[];for(var A=0;A<g;A++)for(var T=0;T<g;T++)if((s.diagonal||T!==A)&&(s.upper||!(A>T))&&(s.lower||!(A<T))){var k=f(s.id,A,T),M=this.passes[k]||(this.passes[k]={});if(o.data&&(o.transpose?M.positions={x:{buffer:s.buffer,offset:T,count:v,stride:g},y:{buffer:s.buffer,offset:A,count:v,stride:g}}:M.positions={x:{buffer:s.buffer,offset:T*v,count:v},y:{buffer:s.buffer,offset:A*v,count:v}},M.bounds=d(s.bounds,A,T)),o.domain||o.viewport||o.data){var E=p?d(s.padding,A,T):s.padding;if(s.domain){var S=d(s.domain,A,T),C=S[0],L=S[1],O=S[2],D=S[3];M.viewport=[b+C*m+E[0],x+L*y+E[1],b+O*m-E[2],x+D*y-E[3]]}else M.viewport=[b+T*_+_*E[0],x+A*w+w*E[1],b+(T+1)*_-_*E[2],x+(A+1)*w-w*E[3]]}o.color&&(M.color=s.color),o.size&&(M.size=s.size),o.marker&&(M.marker=s.marker),o.borderSize&&(M.borderSize=s.borderSize),o.borderColor&&(M.borderColor=s.borderColor),o.opacity&&(M.opacity=s.opacity),o.range&&(M.range=n?d(s.range,A,T):s.range||M.bounds),s.passes.push(k)}return this},c.prototype.draw=function(){for(var t,e=[],r=arguments.length;r--;)e[r]=arguments[r];if(e.length){for(var n=[],a=0;a<e.length;a++)if("number"==typeof e[a]){var i=this.traces[e[a]],o=i.passes,l=i.passOffset;n.push.apply(n,s(l,l+o.length))}else if(e[a].length){var u=e[a],c=this.traces[a],f=c.passes,d=c.passOffset;f=f.map((function(t,e){n[d+e]=u}))}(t=this.scatter).draw.apply(t,n)}else this.scatter.draw();return this},c.prototype.destroy=function(){return this.traces.forEach((function(t){t.buffer&&t.buffer.destroy&&t.buffer.destroy()})),this.traces=null,this.passes=null,this.scatter.destroy(),this}},{"array-bounds":14,"array-range":16,"flatten-vertex-data":156,"parse-rect":265,"pick-by-alias":271,raf:286,"regl-scatter2d":294}],297:[function(t,e,r){!function(t,n){"object"==typeof r&&"undefined"!=typeof e?e.exports=n():t.createREGL=n()}(this,(function(){function t(t,e){this.id=V++,this.type=t,this.data=e}function e(t){return"["+function t(e){if(0===e.length)return[];var r=e.charAt(0),n=e.charAt(e.length-1);if(1<e.length&&r===n&&('"'===r||"'"===r))return['"'+e.substr(1,e.length-2).replace(/\\/g,"\\\\").replace(/"/g,'\\"')+'"'];if(r=/\[(false|true|null|\d+|'[^']*'|"[^"]*")\]/.exec(e))return t(e.substr(0,r.index)).concat(t(r[1])).concat(t(e.substr(r.index+r[0].length)));if(1===(r=e.split(".")).length)return['"'+e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')+'"'];for(e=[],n=0;n<r.length;++n)e=e.concat(t(r[n]));return e}(t).join("][")+"]"}function r(t){return"string"==typeof t?t.split():t}function n(t){return"string"==typeof t?document.querySelector(t):t}function a(t){var e,a,i,o,s=t||{};t={};var l=[],u=[],c="undefined"==typeof window?1:window.devicePixelRatio,f=!1,d=function(t){},h=function(){};if("string"==typeof s?e=document.querySelector(s):"object"==typeof s&&("string"==typeof s.nodeName&&"function"==typeof s.appendChild&&"function"==typeof s.getBoundingClientRect?e=s:"function"==typeof s.drawArrays||"function"==typeof s.drawElements?i=(o=s).canvas:("gl"in s?o=s.gl:"canvas"in s?i=n(s.canvas):"container"in s&&(a=n(s.container)),"attributes"in s&&(t=s.attributes),"extensions"in s&&(l=r(s.extensions)),"optionalExtensions"in s&&(u=r(s.optionalExtensions)),"onDone"in s&&(d=s.onDone),"profile"in s&&(f=!!s.profile),"pixelRatio"in s&&(c=+s.pixelRatio))),e&&("canvas"===e.nodeName.toLowerCase()?i=e:a=e),!o){if(!i){if(!(e=function(t,e,r){function n(){var e=window.innerWidth,n=window.innerHeight;t!==document.body&&(e=(n=t.getBoundingClientRect()).right-n.left,n=n.bottom-n.top),i.width=r*e,i.height=r*n,U(i.style,{width:e+"px",height:n+"px"})}var a,i=document.createElement("canvas");return U(i.style,{border:0,margin:0,padding:0,top:0,left:0}),t.appendChild(i),t===document.body&&(i.style.position="absolute",U(t.style,{margin:0,padding:0})),t!==document.body&&"function"==typeof ResizeObserver?(a=new ResizeObserver((function(){setTimeout(n)}))).observe(t):window.addEventListener("resize",n,!1),n(),{canvas:i,onDestroy:function(){a?a.disconnect():window.removeEventListener("resize",n),t.removeChild(i)}}}(a||document.body,0,c)))return null;i=e.canvas,h=e.onDestroy}void 0===t.premultipliedAlpha&&(t.premultipliedAlpha=!0),o=function(t,e){function r(r){try{return t.getContext(r,e)}catch(t){return null}}return r("webgl")||r("experimental-webgl")||r("webgl-experimental")}(i,t)}return o?{gl:o,canvas:i,container:a,extensions:l,optionalExtensions:u,pixelRatio:c,profile:f,onDone:d,onDestroy:h}:(h(),d("webgl not supported, try upgrading your browser or graphics drivers http://get.webgl.org"),null)}function i(t,e){for(var r=Array(t),n=0;n<t;++n)r[n]=e(n);return r}function o(t){var e,r;return e=(65535<t)<<4,e|=r=(255<(t>>>=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<e;++o)for(var s=t[o],l=0;l<r;++l)for(var u=s[l],c=0;c<n;++c)a[i++]=u[c]}function c(t){return 0|Q[Object.prototype.toString.call(t)]}function f(t,e){for(var r=0;r<e.length;++r)t[r]=e[r]}function d(t,e,r,n,a,i,o){for(var s=0,l=0;l<r;++l)for(var u=0;u<n;++u)t[s++]=e[a*l+i*u+o]}function h(t,e,r,n){function a(e){this.id=u++,this.buffer=t.createBuffer(),this.type=e,this.usage=35044,this.byteLength=0,this.dimension=1,this.dtype=5121,this.persistentData=null,r.profile&&(this.stats={size:0})}function i(e,r,n){e.byteLength=r.byteLength,t.bufferData(e.type,r,n)}function o(t,e,r,n,a,o){if(t.usage=r,Array.isArray(e)){if(t.dtype=n||5126,0<e.length)if(Array.isArray(e[0])){a=et(e);for(var s=n=1;s<a.length;++s)n*=a[s];t.dimension=n,i(t,e=tt(e,a,t.dtype),r),o?t.persistentData=e:X.freeType(e)}else"number"==typeof e[0]?(t.dimension=a,f(a=X.allocType(t.dtype,e.length),e),i(t,a,r),o?t.persistentData=a:X.freeType(a)):Y(e[0])&&(t.dimension=e[0].length,t.dtype=n||c(e[0])||5126,i(t,e=tt(e,[e.length,e[0].length],t.dtype),r),o?t.persistentData=e:X.freeType(e))}else if(Y(e))t.dtype=n||c(e),t.dimension=a,i(t,e,r),o&&(t.persistentData=new Uint8Array(new Uint8Array(e.buffer)));else if(l(e)){a=e.shape;var u=e.stride,h=(s=e.offset,0),p=0,g=0,v=0;1===a.length?(h=a[0],p=1,g=u[0],v=0):2===a.length&&(h=a[0],p=a[1],g=u[0],v=u[1]),t.dtype=n||c(e.data)||5126,t.dimension=p,d(a=X.allocType(t.dtype,h*p),e.data,h,p,g,v,s),i(t,a,r),o?t.persistentData=a:X.freeType(a)}else e instanceof ArrayBuffer&&(t.dtype=5121,t.dimension=a,i(t,e,r),o&&(t.persistentData=new Uint8Array(new Uint8Array(e))))}function s(r){e.bufferCount--,n(r),t.deleteBuffer(r.buffer),r.buffer=null,delete h[r.id]}var u=0,h={};a.prototype.bind=function(){t.bindBuffer(this.type,this.buffer)},a.prototype.destroy=function(){s(this)};var p=[];return r.profile&&(e.getTotalBufferSize=function(){var t=0;return Object.keys(h).forEach((function(e){t+=h[e].stats.size})),t}),{create:function(n,i,u,p){function g(e){var n=35044,a=null,i=0,s=0,u=1;return Array.isArray(e)||Y(e)||l(e)||e instanceof ArrayBuffer?a=e:"number"==typeof e?i=0|e:e&&("data"in e&&(a=e.data),"usage"in e&&(n=K[e.usage]),"type"in e&&(s=$[e.type]),"dimension"in e&&(u=0|e.dimension),"length"in e&&(i=0|e.length)),v.bind(),a?o(v,a,n,s,u,p):(i&&t.bufferData(v.type,i,n),v.dtype=s||5121,v.usage=n,v.dimension=u,v.byteLength=i),r.profile&&(v.stats.size=v.byteLength*rt[v.dtype]),g}e.bufferCount++;var v=new a(i);return h[v.id]=v,u||g(n),g._reglType="buffer",g._buffer=v,g.subdata=function(e,r){var n,a=0|(r||0);if(v.bind(),Y(e)||e instanceof ArrayBuffer)t.bufferSubData(v.type,a,e);else if(Array.isArray(e)){if(0<e.length)if("number"==typeof e[0]){var i=X.allocType(v.dtype,e.length);f(i,e),t.bufferSubData(v.type,a,i),X.freeType(i)}else(Array.isArray(e[0])||Y(e[0]))&&(n=et(e),i=tt(e,n,v.dtype),t.bufferSubData(v.type,a,i),X.freeType(i))}else if(l(e)){n=e.shape;var o=e.stride,s=i=0,u=0,h=0;1===n.length?(i=n[0],s=1,u=o[0],h=0):2===n.length&&(i=n[0],s=n[1],u=o[0],h=o[1]),n=Array.isArray(e.data)?v.dtype:c(e.data),d(n=X.allocType(n,i*s),e.data,i,s,u,h,e.offset),t.bufferSubData(v.type,a,n),X.freeType(n)}return g},r.profile&&(g.stats=v.stats),g.destroy=function(){s(v)},g},createStream:function(t,e){var r=p.pop();return r||(r=new a(t)),r.bind(),o(r,e,35040,0,1,!1),r},destroyStream:function(t){p.push(t)},clear:function(){Z(h).forEach(s),p.forEach(s)},getBuffer:function(t){return t&&t._buffer instanceof a?t._buffer:null},restore:function(){Z(h).forEach((function(e){e.buffer=t.createBuffer(),t.bindBuffer(e.type,e.buffer),t.bufferData(e.type,e.persistentData||e.byteLength,e.usage)}))},_initBuffer:o}}function p(t,e,r,n){function a(t){this.id=u++,s[this.id]=this,this.buffer=t,this.primType=4,this.type=this.vertCount=0}function i(n,a,i,o,s,u,c){var f;if(n.buffer.bind(),a?((f=c)||Y(a)&&(!l(a)||Y(a.data))||(f=e.oes_element_index_uint?5125:5123),r._initBuffer(n.buffer,a,i,f,3)):(t.bufferData(34963,u,i),n.buffer.dtype=f||5121,n.buffer.usage=i,n.buffer.dimension=3,n.buffer.byteLength=u),f=c,!c){switch(n.buffer.dtype){case 5121:case 5120:f=5121;break;case 5123:case 5122:f=5123;break;case 5125:case 5124:f=5125}n.buffer.dtype=f}n.type=f,0>(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<t.length;++r)if(isNaN(t[r]))e[r]=65535;else if(1/0===t[r])e[r]=31744;else if(-1/0===t[r])e[r]=64512;else{at[0]=t[r];var n=(i=it[0])>>>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?n+31744:n+(a+15<<10)+i}return e}function v(t){return Array.isArray(t)||Y(t)}function m(t){return"[object "+t+"]"}function y(t){return Array.isArray(t)&&(0===t.length||"number"==typeof t[0])}function b(t){return!(!Array.isArray(t)||0===t.length||!v(t[0]))}function x(t){return Object.prototype.toString.call(t)}function _(t){if(!t)return!1;var e=x(t);return 0<=gt.indexOf(e)||(y(t)||b(t)||l(t))}function w(t,e){36193===t.type?(t.data=g(e),X.freeType(e)):t.data=e}function A(t,e,r,n,a,i){if(t="undefined"!=typeof mt[t]?mt[t]:lt[t]*vt[e],i&&(t*=6),a){for(n=0;1<=r;)n+=t*r*r,r/=2;return n}return t*r*n}function T(t,e,r,n,a,i,o){function s(){this.format=this.internalformat=6408,this.type=5121,this.flipY=this.premultiplyAlpha=this.compressed=!1,this.unpackAlignment=1,this.colorSpace=37444,this.channels=this.height=this.width=0}function u(t,e){t.internalformat=e.internalformat,t.format=e.format,t.type=e.type,t.compressed=e.compressed,t.premultiplyAlpha=e.premultiplyAlpha,t.flipY=e.flipY,t.unpackAlignment=e.unpackAlignment,t.colorSpace=e.colorSpace,t.width=e.width,t.height=e.height,t.channels=e.channels}function c(t,e){if("object"==typeof e&&e){"premultiplyAlpha"in e&&(t.premultiplyAlpha=e.premultiplyAlpha),"flipY"in e&&(t.flipY=e.flipY),"alignment"in e&&(t.unpackAlignment=e.alignment),"colorSpace"in e&&(t.colorSpace=H[e.colorSpace]),"type"in e&&(t.type=G[e.type]);var r=t.width,n=t.height,a=t.channels,i=!1;"shape"in e?(r=e.shape[0],n=e.shape[1],3===e.shape.length&&(a=e.shape[2],i=!0)):("radius"in e&&(r=n=e.radius),"width"in e&&(r=e.width),"height"in e&&(n=e.height),"channels"in e&&(a=e.channels,i=!0)),t.width=0|r,t.height=0|n,t.channels=0|a,r=!1,"format"in e&&(r=e.format,n=t.internalformat=q[r],t.format=it[n],r in G&&!("type"in e)&&(t.type=G[r]),r in W&&(t.compressed=!0),r=!0),!i&&r?t.channels=lt[t.format]:i&&!r&&t.channels!==st[t.format]&&(t.format=t.internalformat=st[t.channels])}}function f(e){t.pixelStorei(37440,e.flipY),t.pixelStorei(37441,e.premultiplyAlpha),t.pixelStorei(37443,e.colorSpace),t.pixelStorei(3317,e.unpackAlignment)}function d(){s.call(this),this.yOffset=this.xOffset=0,this.data=null,this.needsFree=!1,this.element=null,this.needsCopy=!1}function h(t,e){var r=null;if(_(e)?r=e:e&&(c(t,e),"x"in e&&(t.xOffset=0|e.x),"y"in e&&(t.yOffset=0|e.y),_(e.data)&&(r=e.data)),e.copy){var n=a.viewportWidth,i=a.viewportHeight;t.width=t.width||n-t.xOffset,t.height=t.height||i-t.yOffset,t.needsCopy=!0}else if(r){if(Y(r))t.channels=t.channels||4,t.data=r,"type"in e||5121!==t.type||(t.type=0|Q[Object.prototype.toString.call(r)]);else if(y(r)){switch(t.channels=t.channels||4,i=(n=r).length,t.type){case 5121:case 5123:case 5125:case 5126:(i=X.allocType(t.type,i)).set(n),t.data=i;break;case 36193:t.data=g(n)}t.alignment=1,t.needsFree=!0}else if(l(r)){n=r.data,Array.isArray(n)||5121!==t.type||(t.type=0|Q[Object.prototype.toString.call(n)]);i=r.shape;var o,s,u,f,d=r.stride;3===i.length?(u=i[2],f=d[2]):f=u=1,o=i[0],s=i[1],i=d[0],d=d[1],t.alignment=1,t.width=o,t.height=s,t.channels=u,t.format=t.internalformat=st[u],t.needsFree=!0,o=f,r=r.offset,u=t.width,f=t.height,s=t.channels;for(var h=X.allocType(36193===t.type?5126:t.type,u*f*s),p=0,m=0;m<f;++m)for(var A=0;A<u;++A)for(var T=0;T<s;++T)h[p++]=n[i*A+d*m+o*T+r];w(t,h)}else if(x(r)===ut||x(r)===ct||x(r)===ft)x(r)===ut||x(r)===ct?t.element=r:t.element=r.canvas,t.width=t.element.width,t.height=t.element.height,t.channels=4;else if(x(r)===dt)t.element=r,t.width=r.width,t.height=r.height,t.channels=4;else if(x(r)===ht)t.element=r,t.width=r.naturalWidth,t.height=r.naturalHeight,t.channels=4;else if(x(r)===pt)t.element=r,t.width=r.videoWidth,t.height=r.videoHeight,t.channels=4;else if(b(r)){for(n=t.width||r[0].length,i=t.height||r.length,d=t.channels,d=v(r[0][0])?d||r[0][0].length:d||1,o=J.shape(r),u=1,f=0;f<o.length;++f)u*=o[f];u=X.allocType(36193===t.type?5126:t.type,u),J.flatten(r,o,"",u),w(t,u),t.alignment=1,t.width=n,t.height=i,t.channels=d,t.format=t.internalformat=st[d],t.needsFree=!0}}else t.width=t.width||1,t.height=t.height||1,t.channels=t.channels||4}function p(e,r,a,i,o){var s=e.element,l=e.data,u=e.internalformat,c=e.format,d=e.type,h=e.width,p=e.height;f(e),s?t.texSubImage2D(r,o,a,i,c,d,s):e.compressed?t.compressedTexSubImage2D(r,o,a,i,u,h,p,l):e.needsCopy?(n(),t.copyTexSubImage2D(r,o,a,i,e.xOffset,e.yOffset,h,p)):t.texSubImage2D(r,o,a,i,h,p,c,d,l)}function m(){return gt.pop()||new d}function T(t){t.needsFree&&X.freeType(t.data),d.call(t),gt.push(t)}function k(){s.call(this),this.genMipmaps=!1,this.mipmapHint=4352,this.mipmask=0,this.images=Array(16)}function M(t,e,r){var n=t.images[0]=m();t.mipmask=1,n.width=t.width=e,n.height=t.height=r,n.channels=t.channels=4}function E(t,e){var r=null;if(_(e))u(r=t.images[0]=m(),t),h(r,e),t.mipmask=1;else if(c(t,e),Array.isArray(e.mipmap))for(var n=e.mipmap,a=0;a<n.length;++a)u(r=t.images[a]=m(),t),r.width>>=a,r.height>>=a,h(r,n[a]),t.mipmask|=1<<a;else u(r=t.images[0]=m(),t),h(r,e),t.mipmask=1;u(t,t.images[0])}function S(e,r){for(var a=e.images,i=0;i<a.length&&a[i];++i){var o=a[i],s=r,l=i,u=o.element,c=o.data,d=o.internalformat,h=o.format,p=o.type,g=o.width,v=o.height;f(o),u?t.texImage2D(s,l,h,h,p,u):o.compressed?t.compressedTexImage2D(s,l,d,g,v,0,c):o.needsCopy?(n(),t.copyTexImage2D(s,l,h,o.xOffset,o.yOffset,g,v,0)):t.texImage2D(s,l,h,g,v,0,h,p,c||null)}}function C(){var t=vt.pop()||new k;s.call(t);for(var e=t.mipmask=0;16>e;++e)t.images[e]=null;return t}function L(t){for(var e=t.images,r=0;r<e.length;++r)e[r]&&T(e[r]),e[r]=null;vt.push(t)}function O(){this.magFilter=this.minFilter=9728,this.wrapT=this.wrapS=33071,this.anisotropic=1,this.genMipmaps=!1,this.mipmapHint=4352}function D(t,e){"min"in e&&(t.minFilter=V[e.min],0<=ot.indexOf(t.minFilter)&&!("faces"in e)&&(t.genMipmaps=!0)),"mag"in e&&(t.magFilter=j[e.mag]);var r=t.wrapS,n=t.wrapT;if("wrap"in e){var a=e.wrap;"string"==typeof a?r=n=B[a]:Array.isArray(a)&&(r=B[a[0]],n=B[a[1]])}else"wrapS"in e&&(r=B[e.wrapS]),"wrapT"in e&&(n=B[e.wrapT]);if(t.wrapS=r,t.wrapT=n,"anisotropic"in e&&(t.anisotropic=e.anisotropic),"mipmap"in e){switch(r=!1,typeof e.mipmap){case"string":t.mipmapHint=N[e.mipmap],r=t.genMipmaps=!0;break;case"boolean":r=t.genMipmaps=e.mipmap;break;case"object":t.genMipmaps=!1,r=!0}!r||"min"in e||(t.minFilter=9984)}}function R(r,n){t.texParameteri(n,10241,r.minFilter),t.texParameteri(n,10240,r.magFilter),t.texParameteri(n,10242,r.wrapS),t.texParameteri(n,10243,r.wrapT),e.ext_texture_filter_anisotropic&&t.texParameteri(n,34046,r.anisotropic),r.genMipmaps&&(t.hint(33170,r.mipmapHint),t.generateMipmap(n))}function I(e){s.call(this),this.mipmask=0,this.internalformat=6408,this.id=mt++,this.refCount=1,this.target=e,this.texture=t.createTexture(),this.unit=-1,this.bindCount=0,this.texInfo=new O,o.profile&&(this.stats={size:0})}function P(e){t.activeTexture(33984),t.bindTexture(e.target,e.texture)}function F(){var e=xt[0];e?t.bindTexture(e.target,e.texture):t.bindTexture(3553,null)}function z(e){var r=e.texture,n=e.unit,a=e.target;0<=n&&(t.activeTexture(33984+n),t.bindTexture(a,null),xt[n]=null),t.deleteTexture(r),e.texture=null,e.params=null,e.pixels=null,e.refCount=0,delete yt[e.id],i.textureCount--}var N={"don't care":4352,"dont care":4352,nice:4354,fast:4353},B={repeat:10497,clamp:33071,mirror:33648},j={nearest:9728,linear:9729},V=U({mipmap:9987,"nearest mipmap nearest":9984,"linear mipmap nearest":9985,"nearest mipmap linear":9986,"linear mipmap linear":9987},j),H={none:0,browser:37444},G={uint8:5121,rgba4:32819,rgb565:33635,"rgb5 a1":32820},q={alpha:6406,luminance:6409,"luminance alpha":6410,rgb:6407,rgba:6408,rgba4:32854,"rgb5 a1":32855,rgb565:36194},W={};e.ext_srgb&&(q.srgb=35904,q.srgba=35906),e.oes_texture_float&&(G.float32=G.float=5126),e.oes_texture_half_float&&(G.float16=G["half float"]=36193),e.webgl_depth_texture&&(U(q,{depth:6402,"depth stencil":34041}),U(G,{uint16:5123,uint32:5125,"depth stencil":34042})),e.webgl_compressed_texture_s3tc&&U(W,{"rgb s3tc dxt1":33776,"rgba s3tc dxt1":33777,"rgba s3tc dxt3":33778,"rgba s3tc dxt5":33779}),e.webgl_compressed_texture_atc&&U(W,{"rgb atc":35986,"rgba atc explicit alpha":35987,"rgba atc interpolated alpha":34798}),e.webgl_compressed_texture_pvrtc&&U(W,{"rgb pvrtc 4bppv1":35840,"rgb pvrtc 2bppv1":35841,"rgba pvrtc 4bppv1":35842,"rgba pvrtc 2bppv1":35843}),e.webgl_compressed_texture_etc1&&(W["rgb etc1"]=36196);var $=Array.prototype.slice.call(t.getParameter(34467));Object.keys(W).forEach((function(t){var e=W[t];0<=$.indexOf(e)&&(q[t]=e)}));var K=Object.keys(q);r.textureFormats=K;var tt=[];Object.keys(q).forEach((function(t){tt[q[t]]=t}));var et=[];Object.keys(G).forEach((function(t){et[G[t]]=t}));var rt=[];Object.keys(j).forEach((function(t){rt[j[t]]=t}));var nt=[];Object.keys(V).forEach((function(t){nt[V[t]]=t}));var at=[];Object.keys(B).forEach((function(t){at[B[t]]=t}));var it=K.reduce((function(t,r){var n=q[r];return 6409===n||6406===n||6409===n||6410===n||6402===n||34041===n||e.ext_srgb&&(35904===n||35906===n)?t[n]=n:32855===n||0<=r.indexOf("rgba")?t[n]=6408:t[n]=6407,t}),{}),gt=[],vt=[],mt=0,yt={},bt=r.maxTextureUnits,xt=Array(bt).map((function(){return null}));return U(I.prototype,{bind:function(){this.bindCount+=1;var e=this.unit;if(0>e){for(var r=0;r<bt;++r){var n=xt[r];if(n){if(0<n.bindCount)continue;n.unit=-1}xt[r]=this,e=r;break}o.profile&&i.maxTextureUnits<e+1&&(i.maxTextureUnits=e+1),this.unit=e,t.activeTexture(33984+e),t.bindTexture(this.target,this.texture)}return e},unbind:function(){--this.bindCount},decRef:function(){0>=--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;e<bt;++e)t.activeTexture(33984+e),t.bindTexture(3553,null),xt[e]=null;Z(yt).forEach(z),i.cubeCount=0,i.textureCount=0},getTexture:function(t){return null},restore:function(){for(var e=0;e<bt;++e){var r=xt[e];r&&(r.bindCount=0,r.unit=-1,xt[e]=null)}Z(yt).forEach((function(e){e.texture=t.createTexture(),t.bindTexture(e.target,e.texture);for(var r=0;32>r;++r)if(0!=(e.mipmask&1<<r))if(3553===e.target)t.texImage2D(3553,r,e.internalformat,e.width>>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;n<a.length;++n)u(36064+n,a[n]);for(n=a.length;n<r.maxColorAttachments;++n)t.framebufferTexture2D(36160,36064+n,3553,null,0);t.framebufferTexture2D(36160,33306,3553,null,0),t.framebufferTexture2D(36160,36096,3553,null,0),t.framebufferTexture2D(36160,36128,3553,null,0),u(36096,e.depthAttachment),u(36128,e.stencilAttachment),u(33306,e.depthStencilAttachment),t.checkFramebufferStatus(36160),t.isContextLost(),t.bindFramebuffer(36160,b.next?b.next.framebuffer:null),b.cur=b.next,t.getError()}function y(t,e){function r(t,e){var a,i=0,o=0,s=!0,u=!0;a=null;var h=!0,p="rgba",v="uint8",y=1,b=null,w=null,A=null,T=!1;"number"==typeof t?(i=0|t,o=0|e||i):t?("shape"in t?(i=(o=t.shape)[0],o=o[1]):("radius"in t&&(i=o=t.radius),"width"in t&&(i=t.width),"height"in t&&(o=t.height)),("color"in t||"colors"in t)&&(a=t.color||t.colors,Array.isArray(a)),a||("colorCount"in t&&(y=0|t.colorCount),"colorTexture"in t&&(h=!!t.colorTexture,p="rgba4"),"colorType"in t&&(v=t.colorType,!h)&&("half float"===v||"float16"===v?p="rgba16f":"float"!==v&&"float32"!==v||(p="rgba32f")),"colorFormat"in t&&(p=t.colorFormat,0<=x.indexOf(p)?h=!0:0<=_.indexOf(p)&&(h=!1))),("depthTexture"in t||"depthStencilTexture"in t)&&(T=!(!t.depthTexture&&!t.depthStencilTexture)),"depth"in t&&("boolean"==typeof t.depth?s=t.depth:(b=t.depth,u=!1)),"stencil"in t&&("boolean"==typeof t.stencil?u=t.stencil:(w=t.stencil,s=!1)),"depthStencil"in t&&("boolean"==typeof t.depthStencil?s=u=t.depthStencil:(A=t.depthStencil,u=s=!1))):i=o=1;var k=null,M=null,E=null,S=null;if(Array.isArray(a))k=a.map(c);else if(a)k=[c(a)];else for(k=Array(y),a=0;a<y;++a)k[a]=f(i,o,h,p,v);for(i=i||k[0].width,o=o||k[0].height,b?M=c(b):s&&!u&&(M=f(i,o,T,"depth","uint32")),w?E=c(w):u&&!s&&(E=f(i,o,!1,"stencil","uint8")),A?S=c(A):!b&&!w&&u&&s&&(S=f(i,o,T,"depth stencil","depth stencil")),s=null,a=0;a<k.length;++a)l(k[a]),k[a]&&k[a].texture&&(u=xt[k[a].texture._texture.format]*_t[k[a].texture._texture.type],null===s&&(s=u));return l(M),l(E),l(S),g(n),n.width=i,n.height=o,n.colorAttachments=k,n.depthAttachment=M,n.stencilAttachment=E,n.depthStencilAttachment=S,r.color=k.map(d),r.depth=d(M),r.stencil=d(E),r.depthStencil=d(S),r.width=n.width,r.height=n.height,m(n),r}var n=new p;return i.framebufferCount++,r(t,e),U(r,{resize:function(t,e){var a=Math.max(0|t,1),i=Math.max(0|e||a,1);if(a===n.width&&i===n.height)return r;for(var o=n.colorAttachments,s=0;s<o.length;++s)h(o[s],a,i);return h(n.depthAttachment,a,i),h(n.stencilAttachment,a,i),h(n.depthStencilAttachment,a,i),n.width=r.width=a,n.height=r.height=i,m(n),r},_reglType:"framebuffer",_framebuffer:n,destroy:function(){v(n),g(n)},use:function(t){b.setFBO({framebuffer:r},t)}})}var b={cur:null,next:null,dirty:!1,setFBO:null},x=["rgba"],_=["rgba4","rgb565","rgb5 a1"];e.ext_srgb&&_.push("srgba"),e.ext_color_buffer_half_float&&_.push("rgba16f","rgb16f"),e.webgl_color_buffer_float&&_.push("rgba32f");var w=["uint8"];e.oes_texture_half_float&&w.push("half float","float16"),e.oes_texture_float&&w.push("float","float32");var A=0,T={};return U(b,{getFramebuffer:function(t){return"function"==typeof t&&"framebuffer"===t._reglType&&(t=t._framebuffer)instanceof p?t:null},create:y,createCube:function(t){function e(t){var a,i={color:null},o=0,s=null;a="rgba";var l="uint8",u=1;if("number"==typeof t?o=0|t:t?("shape"in t?o=t.shape[0]:("radius"in t&&(o=0|t.radius),"width"in t?o=0|t.width:"height"in t&&(o=0|t.height)),("color"in t||"colors"in t)&&(s=t.color||t.colors,Array.isArray(s)),s||("colorCount"in t&&(u=0|t.colorCount),"colorType"in t&&(l=t.colorType),"colorFormat"in t&&(a=t.colorFormat)),"depth"in t&&(i.depth=t.depth),"stencil"in t&&(i.stencil=t.stencil),"depthStencil"in t&&(i.depthStencil=t.depthStencil)):o=1,s)if(Array.isArray(s))for(t=[],a=0;a<s.length;++a)t[a]=s[a];else t=[s];else for(t=Array(u),s={radius:o,format:a,type:l},a=0;a<u;++a)t[a]=n.createCube(s);for(i.color=Array(t.length),a=0;a<t.length;++a)u=t[a],o=o||u.width,i.color[a]={target:34069,data:t[a]};for(a=0;6>a;++a){for(u=0;u<t.length;++u)i.color[u].target=34069+a;0<a&&(i.depth=r[0].depth,i.stencil=r[0].stencil,i.depthStencil=r[0].depthStencil),r[a]?r[a](i):r[a]=y(i)}return U(e,{width:o,height:o,color:t})}var r=Array(6);return e(t),U(e,{faces:r,resize:function(t){var n=0|t;if(n===e.width)return e;var a=e.color;for(t=0;t<a.length;++t)a[t].resize(n);for(t=0;6>t;++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;r<o;++r)s[r]=new M;var u=0,c={},f={Record:M,scope:{},state:s,currentVAO:null,targetVAO:null,restore:e.oes_vertex_array_object?function(){e.oes_vertex_array_object&&Z(c).forEach((function(t){t.refresh()}))}:function(){},createVAO:function(t){function e(t){for(var n=0;n<r.buffers.length;++n)r.buffers[n].destroy();r.buffers.length=0,(n=r.attributes).length=t.length;for(var i=0;i<t.length;++i){var o=t[i],s=n[i]=new M;Array.isArray(o)||Y(o)||l(o)?(o=a.create(o,34962,!1,!0),s.buffer=a.getBuffer(o),s.size=0|s.buffer.dimension,s.normalized=!1,s.type=s.buffer.dtype,s.offset=0,s.stride=0,s.divisor=0,s.state=1,r.buffers.push(o)):a.getBuffer(o)?(s.buffer=a.getBuffer(o),s.size=0|s.buffer.dimension,s.normalized=!1,s.type=s.buffer.dtype,s.offset=0,s.stride=0,s.divisor=0,s.state=1):a.getBuffer(o.buffer)?(s.buffer=a.getBuffer(o.buffer),s.size=0|(+o.size||s.buffer.dimension),s.normalized=!!o.normalized||!1,s.type="type"in o?$[o.type]:s.buffer.dtype,s.offset=0|(o.offset||0),s.stride=0|(o.stride||0),s.divisor=0|(o.divisor||0),s.state=1):"x"in o&&(s.x=+o.x||0,s.y=+o.y||0,s.z=+o.z||0,s.w=+o.w||0,s.state=2)}return r.refresh(),e}var r=new i;return n.vaoCount+=1,e.destroy=function(){r.destroy()},e._vao=r,e._reglType="vao",e(t)},getVAO:function(t){return"function"==typeof t&&t._vao?t._vao:null},destroyBuffer:function(e){for(var r=0;r<s.length;++r){var n=s[r];n.buffer===e&&(t.disableVertexAttribArray(r),n.buffer=null)}},setVAO:e.oes_vertex_array_object?function(t){if(t!==f.currentVAO){var r=e.oes_vertex_array_object;t?r.bindVertexArrayOES(t.vao):r.bindVertexArrayOES(null),f.currentVAO=t}}:function(r){if(r!==f.currentVAO){if(r)r.bindAttrs();else for(var n=e.angle_instanced_arrays,a=0;a<s.length;++a){var i=s[a];i.buffer?(t.enableVertexAttribArray(a),t.vertexAttribPointer(a,i.size,i.type,i.normalized,i.stride,i.offfset),n&&n.vertexAttribDivisorANGLE(a,i.divisor)):(t.disableVertexAttribArray(a),t.vertexAttrib4f(a,i.x,i.y,i.z,i.w))}f.currentVAO=r}},clear:e.oes_vertex_array_object?function(){Z(c).forEach((function(t){t.destroy()}))}:function(){}};return i.prototype.bindAttrs=function(){for(var r=e.angle_instanced_arrays,n=this.attributes,a=0;a<n.length;++a){var i=n[a];i.buffer?(t.enableVertexAttribArray(a),t.bindBuffer(34962,i.buffer.buffer),t.vertexAttribPointer(a,i.size,i.type,i.normalized,i.stride,i.offset),r&&r.vertexAttribDivisorANGLE(a,i.divisor)):(t.disableVertexAttribArray(a),t.vertexAttrib4f(a,i.x,i.y,i.z,i.w))}for(r=n.length;r<o;++r)t.disableVertexAttribArray(r)},i.prototype.refresh=function(){var t=e.oes_vertex_array_object;t&&(t.bindVertexArrayOES(this.vao),this.bindAttrs(),f.currentVAO=this)},i.prototype.destroy=function(){if(this.vao){var t=e.oes_vertex_array_object;this===f.currentVAO&&(f.currentVAO=null,t.bindVertexArrayOES(null)),t.deleteVertexArrayOES(this.vao),this.vao=null}c[this.id]&&(delete c[this.id],--n.vaoCount)},f}function S(t,e,r,n){function a(t,e,r,n){this.name=t,this.id=e,this.location=r,this.info=n}function i(t,e){for(var r=0;r<t.length;++r)if(t[r].id===e.id)return void(t[r].location=e.location);t.push(e)}function o(r,n,a){if(!(o=(a=35632===r?u:c)[n])){var i=e.str(n),o=t.createShader(r);t.shaderSource(o,i),t.compileShader(o),a[n]=o}return o}function s(t,e){this.id=h++,this.fragId=t,this.vertId=e,this.program=null,this.uniforms=[],this.attributes=[],n.profile&&(this.stats={uniformsCount:0,attributesCount:0})}function l(r,s,l){var u;u=o(35632,r.fragId);var c=o(35633,r.vertId);if(s=r.program=t.createProgram(),t.attachShader(s,u),t.attachShader(s,c),l)for(u=0;u<l.length;++u)c=l[u],t.bindAttribLocation(s,c[0],c[1]);t.linkProgram(s),c=t.getProgramParameter(s,35718),n.profile&&(r.stats.uniformsCount=c);var f=r.uniforms;for(u=0;u<c;++u)if(l=t.getActiveUniform(s,u))if(1<l.size)for(var d=0;d<l.size;++d){var h=l.name.replace("[0]","["+d+"]");i(f,new a(h,e.id(h),t.getUniformLocation(s,h),l))}else i(f,new a(l.name,e.id(l.name),t.getUniformLocation(s,l.name),l));for(c=t.getProgramParameter(s,35721),n.profile&&(r.stats.attributesCount=c),r=r.attributes,u=0;u<c;++u)(l=t.getActiveAttrib(s,u))&&i(r,new a(l.name,e.id(l.name),t.getAttribLocation(s,l.name),l))}var u={},c={},f={},d=[],h=0;return n.profile&&(r.getMaxUniformsCount=function(){var t=0;return d.forEach((function(e){e.stats.uniformsCount>t&&(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<d.length;++t)l(d[t],null,d[t].attributes.map((function(t){return[t.location,t.name]})))},shader:o,frag:-1,vert:-1}}function C(t,e,r,n,a,i,o){function s(a){var i;i=null===e.next?5121:e.next.colorAttachments[0].texture._texture.type;var o=0,s=0,l=n.framebufferWidth,u=n.framebufferHeight,c=null;return Y(a)?c=a:a&&(o=0|a.x,s=0|a.y,l=0|(a.width||n.framebufferWidth-o),u=0|(a.height||n.framebufferHeight-s),c=a.data||null),r(),a=l*u*4,c||(5121===i?c=new Uint8Array(a):5126===i&&(c=c||new Float32Array(a))),t.pixelStorei(3333,4),t.readPixels(o,s,l,u,6408,i,c),c}return function(t){return t&&"framebuffer"in t?function(t){var r;return e.setFBO({framebuffer:t.framebuffer},(function(){r=s(t)})),r}(t):s(t)}}function L(t){return Array.prototype.slice.call(t)}function O(t){return L(t).join("")}function D(){function t(){var t=[],e=[];return U((function(){t.push.apply(t,L(arguments))}),{def:function(){var n="v"+r++;return e.push(n),0<arguments.length&&(t.push(n,"="),t.push.apply(t,L(arguments)),t.push(";")),n},toString:function(){return O([0<e.length?"var "+e.join(",")+";":"",O(t)])}})}function e(){function e(t,e){n(t,e,"=",r.def(t,e),";")}var r=t(),n=t(),a=r.toString,i=n.toString;return U((function(){r.apply(r,L(arguments))}),{def:r.def,entry:r,exit:n,save:e,set:function(t,n,a){e(t,n),r(t,n,"=",a,";")},toString:function(){return a()+i()}})}var r=0,n=[],a=[],i=t(),o={};return{global:i,link:function(t){for(var e=0;e<a.length;++e)if(a[e]===t)return n[e];return e="g"+r++,n.push(e),a.push(t),e},block:t,proc:function(t,r){function n(){var t="a"+a.length;return a.push(t),t}var a=[];r=r||0;for(var i=0;i<r;++i)n();var s=(i=e()).toString;return o[t]=U(i,{arg:n,toString:function(){return O(["function(",a.join(),"){",s(),"}"])}})},scope:e,cond:function(){var t=O(arguments),r=e(),n=e(),a=r.toString,i=n.toString;return U(r,{then:function(){return r.apply(r,L(arguments)),this},else:function(){return n.apply(n,L(arguments)),this},toString:function(){var e=i();return e&&(e="else{"+e+"}"),O(["if(",t,"){",a(),"}",e])}})},compile:function(){var t=['"use strict";',i,"return {"];Object.keys(o).forEach((function(e){t.push('"',e,'":',o[e].toString(),",")})),t.push("}");var e=O(t).replace(/;/g,";\n").replace(/}/g,"}\n").replace(/{/g,"{\n");return Function.apply(null,n.concat(e)).apply(null,a)}}}function R(t){return Array.isArray(t)||Y(t)||l(t)}function I(t){return t.sort((function(t,e){return"viewport"===t?-1:"viewport"===e?1:t<e?-1:1}))}function P(t,e,r,n){this.thisDep=t,this.contextDep=e,this.propDep=r,this.append=n}function F(t){return t&&!(t.thisDep||t.contextDep||t.propDep)}function z(t){return new P(!1,!1,!1,t)}function N(t,e){var r=t.type;return 0===r?new P(!0,1<=(r=t.data.length),2<=r,e):4===r?new P((r=t.data).thisDep,r.contextDep,r.propDep,e):new P(3===r,2===r,1===r,e)}function B(t,e,r,n,a,o,s,l,u,c,f,d,h,p,g){function m(t){return t.replace(".","_")}function y(t,e,r){var n=m(t);rt.push(t),et[n]=tt[n]=!!r,at[n]=e}function b(t,e,r){var n=m(t);rt.push(t),Array.isArray(r)?(tt[n]=r.slice(),et[n]=r.slice()):tt[n]=et[n]=r,it[n]=e}function x(){var t=D(),r=t.link,n=t.global;t.id=lt++,t.batchId="0";var a=r(ot),i=t.shared={props:"a0"};Object.keys(ot).forEach((function(t){i[t]=n.def(a,".",t)}));var o=t.next={},s=t.current={};Object.keys(it).forEach((function(t){Array.isArray(tt[t])&&(o[t]=n.def(i.next,".",t),s[t]=n.def(i.current,".",t))}));var l=t.constants={};Object.keys(st).forEach((function(t){l[t]=n.def(JSON.stringify(st[t]))})),t.invoke=function(e,n){switch(n.type){case 0:var a=["this",i.context,i.props,t.batchId];return e.def(r(n.data),".call(",a.slice(0,Math.max(n.data.length+1,4)),")");case 1:return e.def(i.props,n.data);case 2:return e.def(i.context,n.data);case 3:return e.def("this",n.data);case 4:return n.data.append(t,e),n.data.ref}},t.attribCache={};var u={};return t.scopeAttrib=function(t){if((t=e.id(t))in u)return u[t];var n=c.scope[t];return n||(n=c.scope[t]=new Z),u[t]=r(n)},t}function _(t,e){var r=t.static,n=t.dynamic;if("framebuffer"in r){var a=r.framebuffer;return a?(a=l.getFramebuffer(a),z((function(t,e){var r=t.link(a),n=t.shared;return e.set(n.framebuffer,".next",r),n=n.context,e.set(n,".framebufferWidth",r+".width"),e.set(n,".framebufferHeight",r+".height"),r}))):z((function(t,e){var r=t.shared;return e.set(r.framebuffer,".next","null"),r=r.context,e.set(r,".framebufferWidth",r+".drawingBufferWidth"),e.set(r,".framebufferHeight",r+".drawingBufferHeight"),"null"}))}if("framebuffer"in n){var i=n.framebuffer;return N(i,(function(t,e){var r=t.invoke(e,i),n=t.shared,a=n.framebuffer;r=e.def(a,".getFramebuffer(",r,")");return e.set(a,".next",r),n=n.context,e.set(n,".framebufferWidth",r+"?"+r+".width:"+n+".drawingBufferWidth"),e.set(n,".framebufferHeight",r+"?"+r+".height:"+n+".drawingBufferHeight"),r}))}return null}function w(t,r,n){function a(t){if(t in i){var r=e.id(i[t]);return(t=z((function(){return r}))).id=r,t}if(t in o){var n=o[t];return N(n,(function(t,e){var r=t.invoke(e,n);return e.def(t.shared.strings,".id(",r,")")}))}return null}var i=t.static,o=t.dynamic,s=a("frag"),l=a("vert"),u=null;return F(s)&&F(l)?(u=f.program(l.id,s.id,null,n),t=z((function(t,e){return t.link(u)}))):t=new P(s&&s.thisDep||l&&l.thisDep,s&&s.contextDep||l&&l.contextDep,s&&s.propDep||l&&l.propDep,(function(t,e){var r,n,a=t.shared.shader;return r=s?s.append(t,e):e.def(a,".","frag"),n=l?l.append(t,e):e.def(a,".","vert"),e.def(a+".program("+n+","+r+")")})),{frag:s,vert:l,progVar:t,program:u}}function A(t,e){function r(t,e){if(t in n){var r=0|n[t];return z((function(t,n){return e&&(t.OFFSET=r),r}))}if(t in a){var o=a[t];return N(o,(function(t,r){var n=t.invoke(r,o);return e&&(t.OFFSET=n),n}))}return e&&i?z((function(t,e){return t.OFFSET="0",0})):null}var n=t.static,a=t.dynamic,i=function(){if("elements"in n){var t=n.elements;R(t)?t=o.getElements(o.create(t,!0)):t&&(t=o.getElements(t));var e=z((function(e,r){if(t){var n=e.link(t);return e.ELEMENTS=n}return e.ELEMENTS=null}));return e.value=t,e}if("elements"in a){var r=a.elements;return N(r,(function(t,e){var n=(a=t.shared).isBufferArgs,a=a.elements,i=t.invoke(e,r),o=e.def("null");n=e.def(n,"(",i,")"),i=t.cond(n).then(o,"=",a,".createStream(",i,");").else(o,"=",a,".getElements(",i,");");return e.entry(i),e.exit(t.cond(n).then(a,".destroyStream(",o,");")),t.ELEMENTS=o}))}return null}(),s=r("offset",!0);return{elements:i,primitive:function(){if("primitive"in n){var t=n.primitive;return z((function(e,r){return nt[t]}))}if("primitive"in a){var e=a.primitive;return N(e,(function(t,r){var n=t.constants.primTypes,a=t.invoke(r,e);return r.def(n,"[",a,"]")}))}return i?F(i)?i.value?z((function(t,e){return e.def(t.ELEMENTS,".primType")})):z((function(){return 4})):new P(i.thisDep,i.contextDep,i.propDep,(function(t,e){var r=t.ELEMENTS;return e.def(r,"?",r,".primType:",4)})):null}(),count:function(){if("count"in n){var t=0|n.count;return z((function(){return t}))}if("count"in a){var e=a.count;return N(e,(function(t,r){return t.invoke(r,e)}))}return i?F(i)?i?s?new P(s.thisDep,s.contextDep,s.propDep,(function(t,e){return e.def(t.ELEMENTS,".vertCount-",t.OFFSET)})):z((function(t,e){return e.def(t.ELEMENTS,".vertCount")})):z((function(){return-1})):new P(i.thisDep||s.thisDep,i.contextDep||s.contextDep,i.propDep||s.propDep,(function(t,e){var r=t.ELEMENTS;return t.OFFSET?e.def(r,"?",r,".vertCount-",t.OFFSET,":-1"):e.def(r,"?",r,".vertCount:-1")})):null}(),instances:r("instances",!1),offset:s}}function T(t,r){var n=t.static,i=t.dynamic,o={};return Object.keys(n).forEach((function(t){var r=n[t],i=e.id(t),s=new Z;if(R(r))s.state=1,s.buffer=a.getBuffer(a.create(r,34962,!1,!0)),s.type=0;else if(u=a.getBuffer(r))s.state=1,s.buffer=u,s.type=0;else if("constant"in r){var l=r.constant;s.buffer="null",s.state=2,"number"==typeof l?s.x=l:wt.forEach((function(t,e){e<l.length&&(s[t]=l[e])}))}else{var u=R(r.buffer)?a.getBuffer(a.create(r.buffer,34962,!1,!0)):a.getBuffer(r.buffer),c=0|r.offset,f=0|r.stride,d=0|r.size,h=!!r.normalized,p=0;"type"in r&&(p=$[r.type]),r=0|r.divisor,s.buffer=u,s.state=1,s.size=d,s.normalized=h,s.type=p||u.dtype,s.offset=c,s.stride=f,s.divisor=r}o[t]=z((function(t,e){var r=t.attribCache;if(i in r)return r[i];var n={isStream:!1};return Object.keys(s).forEach((function(t){n[t]=s[t]})),s.buffer&&(n.buffer=t.link(s.buffer),n.type=n.type||n.buffer+".dtype"),r[i]=n}))})),Object.keys(i).forEach((function(t){var e=i[t];o[t]=N(e,(function(t,r){function n(t){r(l[t],"=",a,".",t,"|0;")}var a=t.invoke(r,e),i=t.shared,o=t.constants,s=i.isBufferArgs,l=(i=i.buffer,{isStream:r.def(!1)}),u=new Z;u.state=1,Object.keys(u).forEach((function(t){l[t]=r.def(""+u[t])}));var c=l.buffer,f=l.type;return r("if(",s,"(",a,")){",l.isStream,"=true;",c,"=",i,".createStream(",34962,",",a,");",f,"=",c,".dtype;","}else{",c,"=",i,".getBuffer(",a,");","if(",c,"){",f,"=",c,".dtype;",'}else if("constant" in ',a,"){",l.state,"=",2,";","if(typeof "+a+'.constant === "number"){',l[wt[0]],"=",a,".constant;",wt.slice(1).map((function(t){return l[t]})).join("="),"=0;","}else{",wt.map((function(t,e){return l[t]+"="+a+".constant.length>"+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<Object.keys(e.dynamic).length)return null;var r=e.static,n=Object.keys(r);if(0<n.length&&"number"==typeof r[n[0]]){for(var a=[],i=0;i<n.length;++i)a.push([0|r[n[i]],n[i]]);return a}}return null}(t,e),u=function(t,e,r){function n(t){if(t in a){var r=a[t];t=!0;var n,o,s=0|r.x,l=0|r.y;return"width"in r?n=0|r.width:t=!1,"height"in r?o=0|r.height:t=!1,new P(!t&&e&&e.thisDep,!t&&e&&e.contextDep,!t&&e&&e.propDep,(function(t,e){var a=t.shared.context,i=n;"width"in r||(i=e.def(a,".","framebufferWidth","-",s));var u=o;return"height"in r||(u=e.def(a,".","framebufferHeight","-",l)),[s,l,i,u]}))}if(t in i){var u=i[t];return t=N(u,(function(t,e){var r=t.invoke(e,u),n=t.shared.context,a=e.def(r,".x|0"),i=e.def(r,".y|0");return[a,i,e.def('"width" in ',r,"?",r,".width|0:","(",n,".","framebufferWidth","-",a,")"),r=e.def('"height" in ',r,"?",r,".height|0:","(",n,".","framebufferHeight","-",i,")")]})),e&&(t.thisDep=t.thisDep||e.thisDep,t.contextDep=t.contextDep||e.contextDep,t.propDep=t.propDep||e.propDep),t}return e?new P(e.thisDep,e.contextDep,e.propDep,(function(t,e){var r=t.shared.context;return[0,0,e.def(r,".","framebufferWidth"),e.def(r,".","framebufferHeight")]})):null}var a=t.static,i=t.dynamic;if(t=n("viewport")){var o=t;t=new P(t.thisDep,t.contextDep,t.propDep,(function(t,e){var r=o.append(t,e),n=t.shared.context;return e.set(n,".viewportWidth",r[2]),e.set(n,".viewportHeight",r[3]),r}))}return{viewport:t,scissor_box:n("scissor.box")}}(t,p=_(t)),f=A(t),d=function(t,e){var r=t.static,n=t.dynamic,a={};return rt.forEach((function(t){function e(e,i){if(t in r){var s=e(r[t]);a[o]=z((function(){return s}))}else if(t in n){var l=n[t];a[o]=N(l,(function(t,e){return i(t,e,t.invoke(e,l))}))}}var o=m(t);switch(t){case"cull.enable":case"blend.enable":case"dither":case"stencil.enable":case"depth.enable":case"scissor.enable":case"polygonOffset.enable":case"sample.alpha":case"sample.enable":case"depth.mask":return e((function(t){return t}),(function(t,e,r){return r}));case"depth.func":return e((function(t){return kt[t]}),(function(t,e,r){return e.def(t.constants.compareFuncs,"[",r,"]")}));case"depth.range":return e((function(t){return t}),(function(t,e,r){return[e.def("+",r,"[0]"),e=e.def("+",r,"[1]")]}));case"blend.func":return e((function(t){return[Tt["srcRGB"in t?t.srcRGB:t.src],Tt["dstRGB"in t?t.dstRGB:t.dst],Tt["srcAlpha"in t?t.srcAlpha:t.src],Tt["dstAlpha"in t?t.dstAlpha:t.dst]]}),(function(t,e,r){function n(t,n){return e.def('"',t,n,'" in ',r,"?",r,".",t,n,":",r,".",t)}t=t.constants.blendFuncs;var a=n("src","RGB"),i=n("dst","RGB"),o=(a=e.def(t,"[",a,"]"),e.def(t,"[",n("src","Alpha"),"]"));return[a,i=e.def(t,"[",i,"]"),o,t=e.def(t,"[",n("dst","Alpha"),"]")]}));case"blend.equation":return e((function(t){return"string"==typeof t?[J[t],J[t]]:"object"==typeof t?[J[t.rgb],J[t.alpha]]:void 0}),(function(t,e,r){var n=t.constants.blendEquations,a=e.def(),i=e.def();return(t=t.cond("typeof ",r,'==="string"')).then(a,"=",i,"=",n,"[",r,"];"),t.else(a,"=",n,"[",r,".rgb];",i,"=",n,"[",r,".alpha];"),e(t),[a,i]}));case"blend.color":return e((function(t){return i(4,(function(e){return+t[e]}))}),(function(t,e,r){return i(4,(function(t){return e.def("+",r,"[",t,"]")}))}));case"stencil.mask":return e((function(t){return 0|t}),(function(t,e,r){return e.def(r,"|0")}));case"stencil.func":return e((function(t){return[kt[t.cmp||"keep"],t.ref||0,"mask"in t?t.mask:-1]}),(function(t,e,r){return[t=e.def('"cmp" in ',r,"?",t.constants.compareFuncs,"[",r,".cmp]",":",7680),e.def(r,".ref|0"),e=e.def('"mask" in ',r,"?",r,".mask|0:-1")]}));case"stencil.opFront":case"stencil.opBack":return e((function(e){return["stencil.opBack"===t?1029:1028,Mt[e.fail||"keep"],Mt[e.zfail||"keep"],Mt[e.zpass||"keep"]]}),(function(e,r,n){function a(t){return r.def('"',t,'" in ',n,"?",i,"[",n,".",t,"]:",7680)}var i=e.constants.stencilOps;return["stencil.opBack"===t?1029:1028,a("fail"),a("zfail"),a("zpass")]}));case"polygonOffset.offset":return e((function(t){return[0|t.factor,0|t.units]}),(function(t,e,r){return[e.def(r,".factor|0"),e=e.def(r,".units|0")]}));case"cull.face":return e((function(t){var e=0;return"front"===t?e=1028:"back"===t&&(e=1029),e}),(function(t,e,r){return e.def(r,'==="front"?',1028,":",1029)}));case"lineWidth":return e((function(t){return t}),(function(t,e,r){return r}));case"frontFace":return e((function(t){return Et[t]}),(function(t,e,r){return e.def(r+'==="cw"?2304:2305')}));case"colorMask":return e((function(t){return t.map((function(t){return!!t}))}),(function(t,e,r){return i(4,(function(t){return"!!"+r+"["+t+"]"}))}));case"sample.coverage":return e((function(t){return["value"in t?t.value:1,!!t.invert]}),(function(t,e,r){return[e.def('"value" in ',r,"?+",r,".value:1"),e=e.def("!!",r,".invert")]}))}})),a}(t),h=w(t,0,l);s("viewport"),s(m("scissor.box"));var p,g=0<Object.keys(d).length;if((p={framebuffer:p,draw:f,shader:h,state:d,dirty:g,scopeVAO:null,drawVAO:null,useVAO:!1,attributes:{}}).profile=function(t){var e,r=t.static;if(t=t.dynamic,"profile"in r){var n=!!r.profile;(e=z((function(t,e){return n}))).enable=n}else if("profile"in t){var a=t.profile;e=N(a,(function(t,e){return t.invoke(e,a)}))}return e}(t),p.uniforms=function(t,e){var r=t.static,n=t.dynamic,a={};return Object.keys(r).forEach((function(t){var e,n=r[t];if("number"==typeof n||"boolean"==typeof n)e=z((function(){return n}));else if("function"==typeof n){var o=n._reglType;"texture2d"===o||"textureCube"===o?e=z((function(t){return t.link(n)})):"framebuffer"!==o&&"framebufferCube"!==o||(e=z((function(t){return t.link(n.color[0])})))}else v(n)&&(e=z((function(t){return t.global.def("[",i(n.length,(function(t){return n[t]})),"]")})));e.value=n,a[t]=e})),Object.keys(n).forEach((function(t){var e=n[t];a[t]=N(e,(function(t,r){return t.invoke(r,e)}))})),a}(n),p.drawVAO=p.scopeVAO=function(t,e){var r=t.static,n=t.dynamic;if("vao"in r){var a=r.vao;return null!==a&&null===c.getVAO(a)&&(a=c.createVAO(a)),z((function(t){return t.link(c.getVAO(a))}))}if("vao"in n){var i=n.vao;return N(i,(function(t,e){var r=t.invoke(e,i);return e.def(t.shared.vao+".getVAO("+r+")")}))}return null}(t),!p.drawVAO&&h.program&&!l&&r.angle_instanced_arrays){var y=!0;if(t=h.program.attributes.map((function(t){return t=e.static[t],y=y&&!!t,t})),y&&0<t.length){var b=c.getVAO(c.createVAO(t));p.drawVAO=new P(null,null,null,(function(t,e){return t.link(b)})),p.useVAO=!0}}return l?p.useVAO=!0:p.attributes=T(e),p.context=function(t){var e=t.static,r=t.dynamic,n={};return Object.keys(e).forEach((function(t){var r=e[t];n[t]=z((function(t,e){return"number"==typeof r||"boolean"==typeof r?""+r:t.link(r)}))})),Object.keys(r).forEach((function(t){var e=r[t];n[t]=N(e,(function(t,r){return t.invoke(r,e)}))})),n}(a),p}function M(t,e,r){var n=t.shared.context,a=t.scope();Object.keys(r).forEach((function(i){e.save(n,"."+i),a(n,".",i,"=",r[i].append(t,e),";")})),e(a)}function E(t,e,r,n){var a,i=(s=t.shared).gl,o=s.framebuffer;K&&(a=e.def(s.extensions,".webgl_draw_buffers"));var s=(l=t.constants).drawBuffer,l=l.backBuffer;t=r?r.append(t,e):e.def(o,".next"),n||e("if(",t,"!==",o,".cur){"),e("if(",t,"){",i,".bindFramebuffer(",36160,",",t,".framebuffer);"),K&&e(a,".drawBuffersWEBGL(",s,"[",t,".colorAttachments.length]);"),e("}else{",i,".bindFramebuffer(",36160,",null);"),K&&e(a,".drawBuffersWEBGL(",l,");"),e("}",o,".cur=",t,";"),n||e("}")}function S(t,e,r){var n=t.shared,a=n.gl,o=t.current,s=t.next,l=n.current,u=n.next,c=t.cond(l,".dirty");rt.forEach((function(e){var n,f;if(!((e=m(e))in r.state))if(e in s){n=s[e],f=o[e];var d=i(tt[e].length,(function(t){return c.def(n,"[",t,"]")}));c(t.cond(d.map((function(t,e){return t+"!=="+f+"["+e+"]"})).join("||")).then(a,".",it[e],"(",d,");",d.map((function(t,e){return f+"["+e+"]="+t})).join(";"),";"))}else n=c.def(u,".",e),d=t.cond(n,"!==",l,".",e),c(d),e in at?d(t.cond(n).then(a,".enable(",at[e],");").else(a,".disable(",at[e],");"),l,".",e,"=",n,";"):d(a,".",it[e],"(",n,");",l,".",e,"=",n,";")})),0===Object.keys(r.state).length&&c(l,".dirty=false;"),e(c)}function C(t,e,r,n){var a=t.shared,i=t.current,o=a.current,s=a.gl;I(Object.keys(r)).forEach((function(a){var l=r[a];if(!n||n(l)){var u=l.append(t,e);if(at[a]){var c=at[a];F(l)?e(s,u?".enable(":".disable(",c,");"):e(t.cond(u).then(s,".enable(",c,");").else(s,".disable(",c,");")),e(o,".",a,"=",u,";")}else if(v(u)){var f=i[a];e(s,".",it[a],"(",u,");",u.map((function(t,e){return f+"["+e+"]="+t})).join(";"),";")}else e(s,".",it[a],"(",u,");",o,".",a,"=",u,";")}}))}function L(t,e){Q&&(t.instancing=e.def(t.shared.extensions,".angle_instanced_arrays"))}function O(t,e,r,n,a){function i(){return"undefined"==typeof performance?"Date.now()":"performance.now()"}function o(t){t(u=e.def(),"=",i(),";"),"string"==typeof a?t(d,".count+=",a,";"):t(d,".count++;"),p&&(n?t(c=e.def(),"=",g,".getNumPendingQueries();"):t(g,".beginQuery(",d,");"))}function s(t){t(d,".cpuTime+=",i(),"-",u,";"),p&&(n?t(g,".pushScopeStats(",c,",",g,".getNumPendingQueries(),",d,");"):t(g,".endQuery();"))}function l(t){var r=e.def(h,".profile");e(h,".profile=",t,";"),e.exit(h,".profile=",r,";")}var u,c,f=t.shared,d=t.stats,h=f.current,g=f.timer;if(r=r.profile){if(F(r))return void(r.enable?(o(e),s(e.exit),l("true")):l("false"));l(r=r.append(t,e))}else r=e.def(h,".profile");o(f=t.block()),e("if(",r,"){",f,"}"),s(t=t.block()),e.exit("if(",r,"){",t,"}")}function B(t,e,r,n,a){function i(r,n,a){function i(){e("if(!",c,".buffer){",l,".enableVertexAttribArray(",u,");}");var r,i=a.type;r=a.size?e.def(a.size,"||",n):n,e("if(",c,".type!==",i,"||",c,".size!==",r,"||",h.map((function(t){return c+"."+t+"!=="+a[t]})).join("||"),"){",l,".bindBuffer(",34962,",",f,".buffer);",l,".vertexAttribPointer(",[u,r,i,a.normalized,a.stride,a.offset],");",c,".type=",i,";",c,".size=",r,";",h.map((function(t){return c+"."+t+"="+a[t]+";"})).join(""),"}"),Q&&(i=a.divisor,e("if(",c,".divisor!==",i,"){",t.instancing,".vertexAttribDivisorANGLE(",[u,i],");",c,".divisor=",i,";}"))}function s(){e("if(",c,".buffer){",l,".disableVertexAttribArray(",u,");",c,".buffer=null;","}if(",wt.map((function(t,e){return c+"."+t+"!=="+d[e]})).join("||"),"){",l,".vertexAttrib4f(",u,",",d,");",wt.map((function(t,e){return c+"."+t+"="+d[e]+";"})).join(""),"}")}var l=o.gl,u=e.def(r,".location"),c=e.def(o.attributes,"[",u,"]");r=a.state;var f=a.buffer,d=[a.x,a.y,a.z,a.w],h=["buffer","normalized","offset","stride"];1===r?i():2===r?s():(e("if(",r,"===",1,"){"),i(),e("}else{"),s(),e("}"))}var o=t.shared;n.forEach((function(n){var o,s=n.name,l=r.attributes[s];if(l){if(!a(l))return;o=l.append(t,e)}else{if(!a(St))return;var u=t.scopeAttrib(s);o={},Object.keys(new Z).forEach((function(t){o[t]=e.def(u,".",t)}))}i(t.link(n),function(t){switch(t){case 35664:case 35667:case 35671:return 2;case 35665:case 35668:case 35672:return 3;case 35666:case 35669:case 35673:return 4;default:return 1}}(n.info.type),o)}))}function j(t,r,n,a,o){for(var s,l=t.shared,u=l.gl,c=0;c<a.length;++c){var f,d=(g=a[c]).name,h=g.info.type,p=n.uniforms[d],g=t.link(g)+".location";if(p){if(!o(p))continue;if(F(p)){if(d=p.value,35678===h||35680===h)r(u,".uniform1i(",g,",",(h=t.link(d._texture||d.color[0]._texture))+".bind());"),r.exit(h,".unbind();");else if(35674===h||35675===h||35676===h)p=2,35675===h?p=3:35676===h&&(p=4),r(u,".uniformMatrix",p,"fv(",g,",false,",d=t.global.def("new Float32Array(["+Array.prototype.slice.call(d)+"])"),");");else{switch(h){case 5126:s="1f";break;case 35664:s="2f";break;case 35665:s="3f";break;case 35666:s="4f";break;case 35670:case 5124:s="1i";break;case 35671:case 35667:s="2i";break;case 35672:case 35668:s="3i";break;case 35673:s="4i";break;case 35669:s="4i"}r(u,".uniform",s,"(",g,",",v(d)?Array.prototype.slice.call(d):d,");")}continue}f=p.append(t,r)}else{if(!o(St))continue;f=r.def(l.uniforms,"[",e.id(d),"]")}switch(35678===h?r("if(",f,"&&",f,'._reglType==="framebuffer"){',f,"=",f,".color[0];","}"):35680===h&&r("if(",f,"&&",f,'._reglType==="framebufferCube"){',f,"=",f,".color[0];","}"),d=1,h){case 35678:case 35680:h=r.def(f,"._texture"),r(u,".uniform1i(",g,",",h,".bind());"),r.exit(h,".unbind();");continue;case 5124:case 35670:s="1i";break;case 35667:case 35671:s="2i",d=2;break;case 35668:case 35672:s="3i",d=3;break;case 35669:case 35673:s="4i",d=4;break;case 5126:s="1f";break;case 35664:s="2f",d=2;break;case 35665:s="3f",d=3;break;case 35666:s="4f",d=4;break;case 35674:s="Matrix2fv";break;case 35675:s="Matrix3fv";break;case 35676:s="Matrix4fv"}if(r(u,".uniform",s,"(",g,","),"M"===s.charAt(0)){g=Math.pow(h-35674+2,2);var m=t.global.def("new Float32Array(",g,")");r("false,(Array.isArray(",f,")||",f," instanceof Float32Array)?",f,":(",i(g,(function(t){return m+"["+t+"]="+f+"["+t+"]"})),",",m,")")}else r(1<d?i(d,(function(t){return f+"["+t+"]"})):f);r(");")}}function U(t,e,r,n){function a(a){var i=d[a];return i?i.contextDep&&n.contextDynamic||i.propDep?i.append(t,r):i.append(t,e):e.def(f,".",a)}function i(){function t(){r(l,".drawElementsInstancedANGLE(",[p,v,m,g+"<<(("+m+"-5121)>>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<Object.keys(r.state).length&&(a(o,".dirty=true;"),a.exit(o,".dirty=true;")),a("a1(",t.shared.context,",a0,",t.batchId,");")}function Y(t,e,r){var n=e.static[r];if(n&&function(t){if("object"==typeof t&&!v(t)){for(var e=Object.keys(t),r=0;r<e.length;++r)if(H.isDynamic(t[e[r]]))return!0;return!1}}(n)){var a=t.global,i=Object.keys(n),o=!1,s=!1,l=!1,u=t.global.def("{}");i.forEach((function(e){var r=n[e];if(H.isDynamic(r))"function"==typeof r&&(r=n[e]=H.unbox(r)),e=N(r,null),o=o||e.thisDep,l=l||e.propDep,s=s||e.contextDep;else{switch(a(u,".",e,"="),typeof r){case"number":a(r);break;case"string":a('"',r,'"');break;case"object":Array.isArray(r)&&a("[",r.join(),"]");break;default:a(t.link(r))}a(";")}})),e.dynamic[r]=new H.DynamicVariable(4,{thisDep:o,contextDep:s,propDep:l,ref:u,append:function(t,e){i.forEach((function(r){var a=n[r];H.isDynamic(a)&&(a=t.invoke(e,a),e(u,".",r,"=",a,";"))}))}}),delete e.static[r]}}var Z=c.Record,J={add:32774,subtract:32778,"reverse subtract":32779};r.ext_blend_minmax&&(J.min=32775,J.max=32776);var Q=r.angle_instanced_arrays,K=r.webgl_draw_buffers,tt={dirty:!0,profile:g.profile},et={},rt=[],at={},it={};y("dither",3024),y("blend.enable",3042),b("blend.color","blendColor",[0,0,0,0]),b("blend.equation","blendEquationSeparate",[32774,32774]),b("blend.func","blendFuncSeparate",[1,0,1,0]),y("depth.enable",2929,!0),b("depth.func","depthFunc",513),b("depth.range","depthRange",[0,1]),b("depth.mask","depthMask",!0),b("colorMask","colorMask",[!0,!0,!0,!0]),y("cull.enable",2884),b("cull.face","cullFace",1029),b("frontFace","frontFace",2305),b("lineWidth","lineWidth",1),y("polygonOffset.enable",32823),b("polygonOffset.offset","polygonOffset",[0,0]),y("sample.alpha",32926),y("sample.enable",32928),b("sample.coverage","sampleCoverage",[1,!1]),y("stencil.enable",2960),b("stencil.mask","stencilMask",-1),b("stencil.func","stencilFunc",[519,0,-1]),b("stencil.opFront","stencilOpSeparate",[1028,7680,7680,7680]),b("stencil.opBack","stencilOpSeparate",[1029,7680,7680,7680]),y("scissor.enable",3089),b("scissor.box","scissor",[0,0,t.drawingBufferWidth,t.drawingBufferHeight]),b("viewport","viewport",[0,0,t.drawingBufferWidth,t.drawingBufferHeight]);var ot={gl:t,context:h,strings:e,next:et,current:tt,draw:d,elements:o,buffer:a,shader:f,attributes:c.state,vao:c,uniforms:u,framebuffer:l,extensions:r,timer:p,isBufferArgs:R},st={primTypes:nt,compareFuncs:kt,blendFuncs:Tt,blendEquations:J,stencilOps:Mt,glTypes:$,orientationType:Et};K&&(st.backBuffer=[1029],st.drawBuffer=i(n.maxDrawbuffers,(function(t){return 0===t?[0]:i(t,(function(t){return 36064+t}))})));var lt=0;return{next:et,current:tt,procs:function(){var t=x(),e=t.proc("poll"),a=t.proc("refresh"),o=t.block();e(o),a(o);var s,l=t.shared,u=l.gl,c=l.next,f=l.current;o(f,".dirty=false;"),E(t,e),E(t,a,null,!0),Q&&(s=t.link(Q)),r.oes_vertex_array_object&&a(t.link(r.oes_vertex_array_object),".bindVertexArrayOES(null);");for(var d=0;d<n.maxAttributes;++d){var h=a.def(l.attributes,"[",d,"]"),p=t.cond(h,".buffer");p.then(u,".enableVertexAttribArray(",d,");",u,".bindBuffer(",34962,",",h,".buffer.buffer);",u,".vertexAttribPointer(",d,",",h,".size,",h,".type,",h,".normalized,",h,".stride,",h,".offset);").else(u,".disableVertexAttribArray(",d,");",u,".vertexAttrib4f(",d,",",h,".x,",h,".y,",h,".z,",h,".w);",h,".buffer=null;"),a(p),Q&&a(s,".vertexAttribDivisorANGLE(",d,",",h,".divisor);")}return a(t.shared.vao,".currentVAO=null;",t.shared.vao,".setVAO(",t.shared.vao,".targetVAO);"),Object.keys(at).forEach((function(r){var n=at[r],i=o.def(c,".",r),s=t.block();s("if(",i,"){",u,".enable(",n,")}else{",u,".disable(",n,")}",f,".",r,"=",i,";"),a(s),e("if(",i,"!==",f,".",r,"){",s,"}")})),Object.keys(it).forEach((function(r){var n,s,l=it[r],d=tt[r],h=t.block();h(u,".",l,"("),v(d)?(l=d.length,n=t.global.def(c,".",r),s=t.global.def(f,".",r),h(i(l,(function(t){return n+"["+t+"]"})),");",i(l,(function(t){return s+"["+t+"]="+n+"["+t+"];"})).join("")),e("if(",i(l,(function(t){return n+"["+t+"]!=="+s+"["+t+"]"})).join("||"),"){",h,"}")):(n=o.def(c,".",r),s=o.def(f,".",r),h(n,");",f,".",r,"=",n,";"),e("if(",n,"!==",s,"){",h,"}")),a(h)})),t.compile()}(),compile:function(t,e,r,n,a){var i=x();return i.stats=i.link(a),Object.keys(e.static).forEach((function(t){Y(i,e,t)})),At.forEach((function(e){Y(i,t,e)})),r=k(t,e,r,n),function(t,e){var r=t.proc("draw",1);L(t,r),M(t,r,e.context),E(t,r,e.framebuffer),S(t,r,e),C(t,r,e.state),O(t,r,e,!1,!0);var n=e.shader.progVar.append(t,r);if(r(t.shared.gl,".useProgram(",n,".program);"),e.shader.program)G(t,r,e,e.shader.program);else{r(t.shared.vao,".setVAO(null);");var a=t.global.def("{}"),i=r.def(n,".id"),o=r.def(a,"[",i,"]");r(t.cond(o).then(o,".call(this,a0);").else(o,"=",a,"[",i,"]=",t.link((function(r){return V(G,t,e,r,1)})),"(",n,");",o,".call(this,a0);"))}0<Object.keys(e.state).length&&r(t.shared.current,".dirty=true;")}(i,r),W(i,r),function(t,e){function r(t){return t.contextDep&&a||t.propDep}var n=t.proc("batch",2);t.batchId="0",L(t,n);var a=!1,i=!0;Object.keys(e.context).forEach((function(t){a=a||e.context[t].propDep})),a||(M(t,n,e.context),i=!1);var o=!1;if((s=e.framebuffer)?(s.propDep?a=o=!0:s.contextDep&&a&&(o=!0),o||E(t,n,s)):E(t,n,null),e.state.viewport&&e.state.viewport.propDep&&(a=!0),S(t,n,e),C(t,n,e.state,(function(t){return!r(t)})),e.profile&&r(e.profile)||O(t,n,e,!1,"a1"),e.contextDep=a,e.needsContext=i,e.needsFramebuffer=o,(i=e.shader.progVar).contextDep&&a||i.propDep)X(t,n,e,null);else if(i=i.append(t,n),n(t.shared.gl,".useProgram(",i,".program);"),e.shader.program)X(t,n,e,e.shader.program);else{n(t.shared.vao,".setVAO(null);");var s=t.global.def("{}"),l=(o=n.def(i,".id"),n.def(s,"[",o,"]"));n(t.cond(l).then(l,".call(this,a0,a1);").else(l,"=",s,"[",o,"]=",t.link((function(r){return V(X,t,e,r,2)})),"(",i,");",l,".call(this,a0,a1);"))}0<Object.keys(e.state).length&&n(t.shared.current,".dirty=true;")}(i,r),i.compile()}}}function j(t,e){for(var r=0;r<t.length;++r)if(t[r]===e)return r;return-1}var U=function(t,e){for(var r=Object.keys(e),n=0;n<r.length;++n)t[r[n]]=e[r[n]];return t},V=0,H={DynamicVariable:t,define:function(r,n){return new t(r,e(n+""))},isDynamic:function(e){return"function"==typeof e&&!e._reglType||e instanceof t},unbox:function(e,r){return"function"==typeof e?new t(0,e):e},accessor:e},G={next:"function"==typeof requestAnimationFrame?function(t){return requestAnimationFrame(t)}:function(t){return setTimeout(t,16)},cancel:"function"==typeof cancelAnimationFrame?function(t){return cancelAnimationFrame(t)}:clearTimeout},q="undefined"!=typeof performance&&performance.now?function(){return performance.now()}:function(){return+new Date},X=s();X.zero=s();var W=function(t,e){var r=1;e.ext_texture_filter_anisotropic&&(r=t.getParameter(34047));var n=1,a=1;e.webgl_draw_buffers&&(n=t.getParameter(34852),a=t.getParameter(36063));var i=!!e.oes_texture_float;if(i){i=t.createTexture(),t.bindTexture(3553,i),t.texImage2D(3553,0,6408,1,1,0,6408,5126,null);var o=t.createFramebuffer();if(t.bindFramebuffer(36160,o),t.framebufferTexture2D(36160,36064,3553,i,0),t.bindTexture(3553,null),36053!==t.checkFramebufferStatus(36160))i=!1;else{t.viewport(0,0,1,1),t.clearColor(1,0,0,1),t.clear(16384);var s=X.allocType(5126,4);t.readPixels(0,0,1,1,6408,5126,s),t.getError()?i=!1:(t.deleteFramebuffer(o),t.deleteTexture(i),i=1===s[0]),X.freeType(s)}}return s=!0,"undefined"!=typeof navigator&&(/MSIE/.test(navigator.userAgent)||/Trident\//.test(navigator.appVersion)||/Edge/.test(navigator.userAgent))||(s=t.createTexture(),o=X.allocType(5121,36),t.activeTexture(33984),t.bindTexture(34067,s),t.texImage2D(34069,0,6408,3,3,0,6408,5121,o),X.freeType(o),t.bindTexture(34067,null),t.deleteTexture(s),s=!t.getError()),{colorBits:[t.getParameter(3410),t.getParameter(3411),t.getParameter(3412),t.getParameter(3413)],depthBits:t.getParameter(3414),stencilBits:t.getParameter(3415),subpixelBits:t.getParameter(3408),extensions:Object.keys(e).filter((function(t){return!!e[t]})),maxAnisotropic:r,maxDrawbuffers:n,maxColorAttachments:a,pointSizeDims:t.getParameter(33901),lineWidthDims:t.getParameter(33902),maxViewportDims:t.getParameter(3386),maxCombinedTextureUnits:t.getParameter(35661),maxCubeMapSize:t.getParameter(34076),maxRenderbufferSize:t.getParameter(34024),maxTextureUnits:t.getParameter(34930),maxTextureSize:t.getParameter(3379),maxAttributes:t.getParameter(34921),maxVertexUniforms:t.getParameter(36347),maxVertexTextureUnits:t.getParameter(35660),maxVaryingVectors:t.getParameter(36348),maxFragmentUniforms:t.getParameter(36349),glsl:t.getParameter(35724),renderer:t.getParameter(7937),vendor:t.getParameter(7936),version:t.getParameter(7938),readFloat:i,npotTextureCube:s}},Y=function(t){return t instanceof Uint8Array||t instanceof Uint16Array||t instanceof Uint32Array||t instanceof Int8Array||t instanceof Int16Array||t instanceof Int32Array||t instanceof Float32Array||t instanceof Float64Array||t instanceof Uint8ClampedArray},Z=function(t){return Object.keys(t).map((function(e){return t[e]}))},J={shape:function(t){for(var e=[];t.length;t=t[0])e.push(t.length);return e},flatten:function(t,e,r,n){var a=1;if(e.length)for(var i=0;i<e.length;++i)a*=e[i];else a=0;switch(r=n||X.allocType(r,a),e.length){case 0:break;case 1:for(n=e[0],e=0;e<n;++e)r[e]=t[e];break;case 2:for(n=e[0],e=e[1],i=a=0;i<n;++i)for(var o=t[i],s=0;s<e;++s)r[a++]=o[s];break;case 3:u(t,e[0],e[1],e[2],r,0);break;default:!function t(e,r,n,a,i){for(var o=1,s=n+1;s<r.length;++s)o*=r[s];var l=r[n];if(4==r.length-n){var c=r[n+1],f=r[n+2];for(r=r[n+3],s=0;s<l;++s)u(e[s],c,f,r,a,i),i+=o}else for(s=0;s<l;++s)t(e[s],r,n+1,a,i),i+=o}(t,e,0,r,0)}return r}},Q={"[object Int8Array]":5120,"[object Int16Array]":5122,"[object Int32Array]":5124,"[object Uint8Array]":5121,"[object Uint8ClampedArray]":5121,"[object Uint16Array]":5123,"[object Uint32Array]":5125,"[object Float32Array]":5126,"[object Float64Array]":5121,"[object ArrayBuffer]":5121},$={int8:5120,int16:5122,int32:5124,uint8:5121,uint16:5123,uint32:5125,float:5126,float32:5126},K={dynamic:35048,stream:35040,static:35044},tt=J.flatten,et=J.shape,rt=[];rt[5120]=1,rt[5122]=2,rt[5124]=4,rt[5121]=1,rt[5123]=2,rt[5125]=4,rt[5126]=4;var nt={points:0,point:0,lines:1,line:1,triangles:4,triangle:4,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6},at=new Float32Array(1),it=new Uint32Array(at.buffer),ot=[9984,9986,9985,9987],st=[0,6409,6410,6407,6408],lt={};lt[6409]=lt[6406]=lt[6402]=1,lt[34041]=lt[6410]=2,lt[6407]=lt[35904]=3,lt[6408]=lt[35906]=4;var ut=m("HTMLCanvasElement"),ct=m("OffscreenCanvas"),ft=m("CanvasRenderingContext2D"),dt=m("ImageBitmap"),ht=m("HTMLImageElement"),pt=m("HTMLVideoElement"),gt=Object.keys(Q).concat([ut,ct,ft,dt,ht,pt]),vt=[];vt[5121]=1,vt[5126]=4,vt[36193]=2,vt[5123]=2,vt[5125]=4;var mt=[];mt[32854]=2,mt[32855]=2,mt[36194]=2,mt[34041]=4,mt[33776]=.5,mt[33777]=.5,mt[33778]=1,mt[33779]=1,mt[35986]=.5,mt[35987]=1,mt[34798]=1,mt[35840]=.5,mt[35841]=.25,mt[35842]=.5,mt[35843]=.25,mt[36196]=.5;var yt=[];yt[32854]=2,yt[32855]=2,yt[36194]=2,yt[33189]=2,yt[36168]=1,yt[34041]=4,yt[35907]=4,yt[34836]=16,yt[34842]=8,yt[34843]=6;var bt=function(t,e,r,n,a){function i(t){this.id=u++,this.refCount=1,this.renderbuffer=t,this.format=32854,this.height=this.width=0,a.profile&&(this.stats={size:0})}function o(e){var r=e.renderbuffer;t.bindRenderbuffer(36161,null),t.deleteRenderbuffer(r),e.renderbuffer=null,e.refCount=0,delete c[e.id],n.renderbufferCount--}var s={rgba4:32854,rgb565:36194,"rgb5 a1":32855,depth:33189,stencil:36168,"depth stencil":34041};e.ext_srgb&&(s.srgba=35907),e.ext_color_buffer_half_float&&(s.rgba16f=34842,s.rgb16f=34843),e.webgl_color_buffer_float&&(s.rgba32f=34836);var l=[];Object.keys(s).forEach((function(t){l[s[t]]=t}));var u=0,c={};return i.prototype.decRef=function(){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&&(tt=G.next(e))}function n(){tt&&(G.cancel(e),tt=null)}function i(t){t.preventDefault(),n(),Q.forEach((function(t){t()}))}function o(t){v.getError(),y.restore(),F.restore(),R.restore(),z.restore(),N.restore(),V.restore(),I.restore(),w&&w.restore(),X.procs.refresh(),r(),$.forEach((function(t){t()}))}function s(t){function e(t){var e={},r={};return Object.keys(t).forEach((function(n){var a=t[n];H.isDynamic(a)?r[n]=H.unbox(a,n):e[n]=a})),{dynamic:r,static:e}}var r=e(t.context||{}),n=e(t.uniforms||{}),a=e(t.attributes||{}),i=e(function(t){function e(t){if(t in r){var e=r[t];delete r[t],Object.keys(e).forEach((function(n){r[t+"."+n]=e[n]}))}}var r=U({},t);return delete r.uniforms,delete r.attributes,delete r.context,delete r.vao,"stencil"in r&&r.stencil.op&&(r.stencil.opBack=r.stencil.opFront=r.stencil.op,delete r.stencil.op),e("blend"),e("depth"),e("cull"),e("stencil"),e("polygonOffset"),e("scissor"),e("sample"),"vao"in t&&(r.vao=t.vao),r}(t));t={gpuTime:0,cpuTime:0,count:0};var o=(r=X.compile(i,a,n,r,t)).draw,s=r.batch,l=r.scope,u=[];return U((function(t,e){var r;if("function"==typeof t)return l.call(this,null,t,0);if("function"==typeof e)if("number"==typeof t)for(r=0;r<t;++r)l.call(this,null,e,r);else{if(!Array.isArray(t))return l.call(this,t,e,0);for(r=0;r<t.length;++r)l.call(this,t[r],e,r)}else if("number"==typeof t){if(0<t)return s.call(this,function(t){for(;u.length<t;)u.push(null);return u}(0|t),0|t)}else{if(!Array.isArray(t))return o.call(this,t);if(t.length)return s.call(this,t,t.length)}}),{stats:t})}function l(t,e){var r=0;X.procs.poll();var n=e.color;n&&(v.clearColor(+n[0]||0,+n[1]||0,+n[2]||0,+n[3]||0),r|=16384),"depth"in e&&(v.clearDepth(+e.depth),r|=256),"stencil"in e&&(v.clearStencil(0|e.stencil),r|=1024),v.clear(r)}function u(t){return J.push(t),r(),{cancel:function(){var e=j(J,t);J[e]=function t(){var e=j(J,t);J[e]=J[J.length-1],--J.length,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;a<e.extensions.length;++a){var i=e.extensions[a];if(!r(i))return e.onDestroy(),e.onDone('"'+i+'" extension is not supported by the current WebGL context, try upgrading your system or a different browser'),null}return e.optionalExtensions.forEach(r),{extensions:n,restore:function(){Object.keys(n).forEach((function(t){if(n[t]&&!r(t))throw Error("(regl): error restoring extension "+t)}))}}}(v,t);if(!y)return null;var b=function(){var t={"":0},e=[""];return{id:function(r){var n=t[r];return n||(n=t[r]=e.length,e.push(r),n)},str:function(t){return e[t]}}}(),x={vaoCount:0,bufferCount:0,elementsCount:0,framebufferCount:0,shaderCount:0,textureCount:0,cubeCount:0,renderbufferCount:0,maxTextureUnits:0},_=y.extensions,w=function(t,e){function r(){this.endQueryIndex=this.startQueryIndex=-1,this.sum=0,this.stats=null}function n(t,e,n){var a=o.pop()||new r;a.startQueryIndex=t,a.endQueryIndex=e,a.sum=0,a.stats=n,s.push(a)}if(!e.ext_disjoint_timer_query)return null;var a=[],i=[],o=[],s=[],l=[],u=[];return{beginQuery:function(t){var r=a.pop()||e.ext_disjoint_timer_query.createQueryEXT();e.ext_disjoint_timer_query.beginQueryEXT(35007,r),i.push(r),n(i.length-1,i.length,t)},endQuery:function(){e.ext_disjoint_timer_query.endQueryEXT(35007)},pushScopeStats:n,update:function(){var t,r;if(0!==(t=i.length)){u.length=Math.max(u.length,t+1),l.length=Math.max(l.length,t+1),l[0]=0;var n=u[0]=0;for(r=t=0;r<i.length;++r){var c=i[r];e.ext_disjoint_timer_query.getQueryObjectEXT(c,34919)?(n+=e.ext_disjoint_timer_query.getQueryObjectEXT(c,34918),a.push(c)):i[t++]=c,l[r+1]=n,u[r+1]=t}for(i.length=t,r=t=0;r<s.length;++r){var f=(n=s[r]).startQueryIndex;c=n.endQueryIndex;n.sum+=l[c]-l[f],f=u[f],(c=u[c])===f?(n.stats.gpuTime+=n.sum/1e6,o.push(n)):(n.startQueryIndex=f,n.endQueryIndex=c,s[t++]=n)}s.length=t}},getNumPendingQueries:function(){return i.length},clear:function(){a.push.apply(a,i);for(var t=0;t<a.length;t++)e.ext_disjoint_timer_query.deleteQueryEXT(a[t]);i.length=0,a.length=0},restore:function(){i.length=0,a.length=0}}}(0,_),A=q(),M=v.drawingBufferWidth,L=v.drawingBufferHeight,O={tick:0,time:0,viewportWidth:M,viewportHeight:L,framebufferWidth:M,framebufferHeight:L,drawingBufferWidth:M,drawingBufferHeight:L,pixelRatio:t.pixelRatio},D=W(v,_),R=h(v,x,t,(function(t){return I.destroyBuffer(t)})),I=E(v,_,D,x,R),P=p(v,_,R,x),F=S(v,b,x,t),z=T(v,_,D,(function(){X.procs.poll()}),O,x,t),N=bt(v,_,0,x,t),V=k(v,_,D,z,N,x),X=B(v,b,_,D,R,P,0,V,{},I,F,{elements:null,primitive:4,count:-1,offset:0,instances:-1},O,w,t),Y=(b=C(v,V,X.procs.poll,O),X.next),Z=v.canvas,J=[],Q=[],$=[],K=[t.onDestroy],tt=null;Z&&(Z.addEventListener("webglcontextlost",i,!1),Z.addEventListener("webglcontextrestored",o,!1));var et=V.setFBO=s({framebuffer:H.define.call(null,1,"framebuffer")});return d(),m=U(s,{clear:function(t){if("framebuffer"in t)if(t.framebuffer&&"framebufferCube"===t.framebuffer_reglType)for(var e=0;6>e;++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<r.length;++t)if(r[t]===e){r[t]=r[r.length-1],r.pop();break}}}},limits:D,hasExtension:function(t){return 0<=D.extensions.indexOf(t.toLowerCase())},read:b,destroy:function(){J.length=0,n(),Z&&(Z.removeEventListener("webglcontextlost",i),Z.removeEventListener("webglcontextrestored",o)),F.clear(),V.clear(),N.clear(),z.clear(),P.clear(),R.clear(),I.clear(),w&&w.clear(),K.forEach((function(t){t()}))},_gl:v,_refresh:d,poll:function(){f(),w&&w.update()},now:g,stats:x}),t.onDone(null,m),m}}))},{}],298:[function(t,e,r){
/*!
* repeat-string <https://github.com/jonschlinkert/repeat-string>
*
* 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<t.length;++n)for(var a=r[n-1]=new Array(t.length-1),i=0,o=0;i<t.length;++i)i!==e&&(a[o++]=t[n][i]);return r}function l(t){if(1===t.length)return t[0];if(2===t.length)return["sum(",t[0],",",t[1],")"].join("");var e=t.length>>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<t.length;++r)e.push(["scale(",l(c(s(t,r))),",",(n=r,!0&n?"-":""),t[0][r],")"].join(""));return e;var n}function f(t,e){for(var r=[],n=0;n<e-2;++n)r.push(["prod(m",t,"[",n,"],m",t,"[",n,"])"].join(""));return l(r)}function d(t){for(var e=[],r=[],u=function(t){for(var e=new Array(t),r=0;r<t;++r){e[r]=new Array(t);for(var n=0;n<t;++n)e[r][n]=["m",n,"[",t-r-2,"]"].join("")}return e}(t),d=0;d<t;++d)u[0][d]="1",u[t-1][d]="w"+d;for(d=0;d<t;++d)0==(1&d)?e.push.apply(e,c(s(u,d))):r.push.apply(r,c(s(u,d)));var h=l(e),p=l(r),g="exactInSphere"+t,v=[];for(d=0;d<t;++d)v.push("m"+d);var m=["function ",g,"(",v.join(),"){"];for(d=0;d<t;++d){m.push("var w",d,"=",f(d,t),";");for(var y=0;y<t;++y)y!==d&&m.push("var w",d,"m",y,"=scale(w",d,",m",y,"[0]);")}return m.push("var p=",h,",n=",p,",d=diff(p,n);return d[d.length-1];}return ",g),new Function("sum","diff","prod","scale",m.join(""))(a,i,n,o)}var h=[function(){return 0},function(){return 0},function(){return 0}];function p(t){var e=h[t.length];return e||(e=h[t.length]=d(t.length)),e.apply(void 0,t)}!function(){for(;h.length<=6;)h.push(d(h.length));for(var t=[],r=["slow"],n=0;n<=6;++n)t.push("a"+n),r.push("o"+n);var a=["function testInSphere(",t.join(),"){switch(arguments.length){case 0:case 1:return 0;"];for(n=2;n<=6;++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;i<arguments.length;++i){s[i]=arguments[i]};return slow(s);}return testInSphere"),r.push(a.join(""));var i=Function.apply(void 0,r);for(e.exports=i.apply(void 0,[p].concat(h)),n=0;n<=6;++n)e.exports[n]=h[n]}()},{"robust-scale":302,"robust-subtract":304,"robust-sum":305,"two-product":326}],300:[function(t,e,r){"use strict";var n=t("two-product"),a=t("robust-sum"),i=t("robust-scale"),o=t("robust-subtract");function s(t,e){for(var r=new Array(t.length-1),n=1;n<t.length;++n)for(var a=r[n-1]=new Array(t.length-1),i=0,o=0;i<t.length;++i)i!==e&&(a[o++]=t[n][i]);return r}function l(t){if(1===t.length)return t[0];if(2===t.length)return["sum(",t[0],",",t[1],")"].join("");var e=t.length>>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;r<t.length;++r)e.push(["scale(",l(u(s(t,r))),",",(n=r,1&n?"-":""),t[0][r],")"].join(""));return e;var n}function c(t){for(var e=[],r=[],c=function(t){for(var e=new Array(t),r=0;r<t;++r){e[r]=new Array(t);for(var n=0;n<t;++n)e[r][n]=["m",n,"[",t-r-1,"]"].join("")}return e}(t),f=[],d=0;d<t;++d)0==(1&d)?e.push.apply(e,u(s(c,d))):r.push.apply(r,u(s(c,d))),f.push("m"+d);var h=l(e),p=l(r),g="orientation"+t+"Exact",v=["function ",g,"(",f.join(),"){var p=",h,",n=",p,",d=sub(p,n);return d[d.length-1];};return ",g].join("");return new Function("sum","prod","scale","sub",v)(a,n,i,o)}var f=c(3),d=c(4),h=[function(){return 0},function(){return 0},function(t,e){return e[0]-t[0]},function(t,e,r){var n,a=(t[1]-r[1])*(e[0]-r[0]),i=(t[0]-r[0])*(e[1]-r[1]),o=a-i;if(a>0){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;i<arguments.length;++i){s[i]=arguments[i]};return slow(s);}return getOrientation"),r.push(a.join(""));var i=Function.apply(void 0,r);for(e.exports=i.apply(void 0,[p].concat(h)),n=0;n<=5;++n)e.exports[n]=h[n]}()},{"robust-scale":302,"robust-subtract":304,"robust-sum":305,"two-product":326}],301:[function(t,e,r){"use strict";var n=t("robust-sum"),a=t("robust-scale");e.exports=function(t,e){if(1===t.length)return a(e,t[0]);if(1===e.length)return a(t,e[0]);if(0===t.length||0===e.length)return[0];var r=[0];if(t.length<e.length)for(var i=0;i<t.length;++i)r=n(r,a(e,t[i]));else for(i=0;i<e.length;++i)r=n(r,a(t,e[i]));return r}},{"robust-scale":302,"robust-sum":305}],302:[function(t,e,r){"use strict";var n=t("two-product"),a=t("two-sum");e.exports=function(t,e){var r=t.length;if(1===r){var i=n(t[0],e);return i[0]?i:[i[1]]}var o=new Array(2*r),s=[.1,.1],l=[.1,.1],u=0;n(t[0],e,s),s[0]&&(o[u++]=s[0]);for(var c=1;c<r;++c){n(t[c],e,l);var f=s[1];a(f,l[0],s),s[0]&&(o[u++]=s[0]);var d=l[1],h=s[1],p=d+h,g=h-(p-d);s[1]=p,g&&(o[u++]=g)}s[1]&&(o[u++]=s[1]);0===u&&(o[u++]=0);return o.length=u,o}},{"two-product":326,"two-sum":327}],303:[function(t,e,r){"use strict";e.exports=function(t,e,r,a){var i=n(t,r,a),o=n(e,r,a);if(i>0&&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)<s||l<f)return!1}return!0}(t,e,r,a);return!0};var n=t("robust-orientation")[3]},{"robust-orientation":300}],304:[function(t,e,r){"use strict";e.exports=function(t,e){var r=0|t.length,n=0|e.length;if(1===r&&1===n)return function(t,e){var r=t+e,n=r-t,a=t-(r-n)+(e-n);if(a)return[a,r];return[r]}(t[0],-e[0]);var a,i,o=new Array(r+n),s=0,l=0,u=0,c=Math.abs,f=t[l],d=c(f),h=-e[u],p=c(h);d<p?(i=f,(l+=1)<r&&(f=t[l],d=c(f))):(i=h,(u+=1)<n&&(h=-e[u],p=c(h)));l<r&&d<p||u>=n?(a=f,(l+=1)<r&&(f=t[l],d=c(f))):(a=h,(u+=1)<n&&(h=-e[u],p=c(h)));var g,v,m=a+i,y=m-a,b=i-y,x=b,_=m;for(;l<r&&u<n;)d<p?(a=f,(l+=1)<r&&(f=t[l],d=c(f))):(a=h,(u+=1)<n&&(h=-e[u],p=c(h))),(b=(i=x)-(y=(m=a+i)-a))&&(o[s++]=b),x=_-((g=_+m)-(v=g-_))+(m-v),_=g;for(;l<r;)(b=(i=x)-(y=(m=(a=f)+i)-a))&&(o[s++]=b),x=_-((g=_+m)-(v=g-_))+(m-v),_=g,(l+=1)<r&&(f=t[l]);for(;u<n;)(b=(i=x)-(y=(m=(a=h)+i)-a))&&(o[s++]=b),x=_-((g=_+m)-(v=g-_))+(m-v),_=g,(u+=1)<n&&(h=-e[u]);x&&(o[s++]=x);_&&(o[s++]=_);s||(o[s++]=0);return o.length=s,o}},{}],305:[function(t,e,r){"use strict";e.exports=function(t,e){var r=0|t.length,n=0|e.length;if(1===r&&1===n)return function(t,e){var r=t+e,n=r-t,a=t-(r-n)+(e-n);if(a)return[a,r];return[r]}(t[0],e[0]);var a,i,o=new Array(r+n),s=0,l=0,u=0,c=Math.abs,f=t[l],d=c(f),h=e[u],p=c(h);d<p?(i=f,(l+=1)<r&&(f=t[l],d=c(f))):(i=h,(u+=1)<n&&(h=e[u],p=c(h)));l<r&&d<p||u>=n?(a=f,(l+=1)<r&&(f=t[l],d=c(f))):(a=h,(u+=1)<n&&(h=e[u],p=c(h)));var g,v,m=a+i,y=m-a,b=i-y,x=b,_=m;for(;l<r&&u<n;)d<p?(a=f,(l+=1)<r&&(f=t[l],d=c(f))):(a=h,(u+=1)<n&&(h=e[u],p=c(h))),(b=(i=x)-(y=(m=a+i)-a))&&(o[s++]=b),x=_-((g=_+m)-(v=g-_))+(m-v),_=g;for(;l<r;)(b=(i=x)-(y=(m=(a=f)+i)-a))&&(o[s++]=b),x=_-((g=_+m)-(v=g-_))+(m-v),_=g,(l+=1)<r&&(f=t[l]);for(;u<n;)(b=(i=x)-(y=(m=(a=h)+i)-a))&&(o[s++]=b),x=_-((g=_+m)-(v=g-_))+(m-v),_=g,(u+=1)<n&&(h=e[u]);x&&(o[s++]=x);_&&(o[s++]=_);s||(o[s++]=0);return o.length=s,o}},{}],306:[function(t,e,r){"use strict";e.exports=function(t){return t<0?-1:t>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<r;++d)if(n=c[d]-f[d])return n;return 0}}function o(t,e){return i(t[0],e[0])}function s(t,e){if(e){for(var r=t.length,n=new Array(r),a=0;a<r;++a)n[a]=[t[a],e[a]];n.sort(o);for(a=0;a<r;++a)t[a]=n[a][0],e[a]=n[a][1];return t}return t.sort(i),t}function l(t){if(0===t.length)return[];for(var e=1,r=t.length,n=1;n<r;++n){var a=t[n];if(i(a,t[n-1])){if(n===e){e++;continue}t[e++]=a}}return t.length=e,t}function u(t,e){for(var r=0,n=t.length-1,a=-1;r<=n;){var o=r+n>>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<o;++a)r[a]=[];for(var s=[],l=(a=0,e.length);a<l;++a)for(var c=e[a],f=c.length,d=1,h=1<<f;d<h;++d){s.length=n.popCount(d);for(var p=0,g=0;g<f;++g)d&1<<g&&(s[p++]=c[g]);var v=u(t,s);if(!(v<0))for(;r[v++].push(a),!(v>=t.length||0!==i(t[v],s)););}return r}function f(t,e){if(e<0)return[];for(var r=[],a=(1<<e+1)-1,i=0;i<t.length;++i)for(var o=t[i],l=a;l<1<<o.length;l=n.nextCombination(l)){for(var u=new Array(e+1),c=0,f=0;f<o.length;++f)l&1<<f&&(u[c++]=o[f]);r.push(u)}return s(r)}r.dimension=function(t){for(var e=0,r=Math.max,n=0,a=t.length;n<a;++n)e=r(e,t[n].length);return e-1},r.countVertices=function(t){for(var e=-1,r=Math.max,n=0,a=t.length;n<a;++n)for(var i=t[n],o=0,s=i.length;o<s;++o)e=r(e,i[o]);return e+1},r.cloneCells=function(t){for(var e=new Array(t.length),r=0,n=t.length;r<n;++r)e[r]=t[r].slice(0);return e},r.compareCells=i,r.normalize=s,r.unique=l,r.findCell=u,r.incidence=c,r.dual=function(t,e){if(!e)return c(l(f(t,0)),t);for(var r=new Array(e),n=0;n<e;++n)r[n]=[];n=0;for(var a=t.length;n<a;++n)for(var i=t[n],o=0,s=i.length;o<s;++o)r[i[o]].push(n);return r},r.explode=function(t){for(var e=[],r=0,n=t.length;r<n;++r)for(var a=t[r],i=0|a.length,o=1,l=1<<i;o<l;++o){for(var u=[],c=0;c<i;++c)o>>>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<n;++r)for(var a=t[r],i=0,o=a.length;i<o;++i){for(var l=new Array(a.length-1),u=0,c=0;u<o;++u)u!==i&&(l[c++]=a[u]);e.push(l)}return s(e)},r.connectedComponents=function(t,e){return e?function(t,e){for(var r=new a(e),n=0;n<t.length;++n)for(var i=t[n],o=0;o<i.length;++o)for(var s=o+1;s<i.length;++s)r.link(i[o],i[s]);var l=[],u=r.ranks;for(n=0;n<u.length;++n)u[n]=-1;for(n=0;n<t.length;++n){var c=r.find(t[n][0]);u[c]<0?(u[c]=l.length,l.push([t[n].slice(0)])):l[u[c]].push(t[n].slice(0))}return l}(t,e):function(t){for(var e=l(s(f(t,0))),r=new a(e.length),n=0;n<t.length;++n)for(var i=t[n],o=0;o<i.length;++o)for(var c=u(e,[i[o]]),d=o+1;d<i.length;++d)r.link(c,u(e,[i[d]]));var h=[],p=r.ranks;for(n=0;n<p.length;++n)p[n]=-1;for(n=0;n<t.length;++n){var g=r.find(u(e,[t[n][0]]));p[g]<0?(p[g]=h.length,h.push([t[n].slice(0)])):h[p[g]].push(t[n].slice(0))}return h}(t)}},{"bit-twiddle":307,"union-find":309}],309:[function(t,e,r){"use strict";function n(t){this.roots=new Array(t),this.ranks=new Array(t);for(var e=0;e<t;++e)this.roots[e]=e,this.ranks[e]=0}e.exports=n,n.prototype.length=function(){return this.roots.length},n.prototype.makeSet=function(){var t=this.roots.length;return this.roots.push(t),this.ranks.push(0),t},n.prototype.find=function(t){for(var e=this.roots;e[t]!==t;){var r=e[t];e[t]=e[r],t=r}return t},n.prototype.link=function(t,e){var r=this.find(t),n=this.find(e);if(r!==n){var a=this.ranks,i=this.roots,o=a[r],s=a[n];o<s?i[r]=n:s<o?i[n]=r:(i[n]=r,++a[r])}}},{}],310:[function(t,e,r){"use strict";e.exports=function(t,e,r){for(var i=e.length,o=t.length,s=new Array(i),l=new Array(i),u=new Array(i),c=new Array(i),f=0;f<i;++f)s[f]=l[f]=-1,u[f]=1/0,c[f]=!1;for(f=0;f<o;++f){var d=t[f];if(2!==d.length)throw new Error("Input must be a graph");var h=d[1],p=d[0];-1!==l[p]?l[p]=-2:l[p]=h,-1!==s[h]?s[h]=-2:s[h]=p}function g(t){if(c[t])return 1/0;var r,a,i,o,u,f=s[t],d=l[t];return f<0||d<0?1/0:(r=e[t],a=e[f],i=e[d],o=Math.abs(n(r,a,i)),u=Math.sqrt(Math.pow(a[0]-i[0],2)+Math.pow(a[1]-i[1],2)),o/u)}function v(t,e){var r=T[t],n=T[e];T[t]=n,T[e]=r,k[r]=e,k[n]=t}function m(t){return u[T[t]]}function y(t){return 1&t?t-1>>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(n<M){var o=m(n);o<r&&(i=n,r=o)}if(a<M)m(a)<r&&(i=a);if(i===t)return t;v(t,i),t=i}}function x(t){for(var e=m(t);t>0;){var r=y(t);if(r>=0)if(e<m(r)){v(t,r),t=r;continue}return t}}function _(){if(M>0){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<i;++f){(u[f]=g(f))<1/0?(k[f]=T.length,T.push(f)):k[f]=-1}var M=T.length;for(f=M>>1;f>=0;--f)b(f);for(;;){var E=_();if(E<0||u[E]>r)break;A(E)}var S=[];for(f=0;f<i;++f)c[f]||(k[f]=S.length,S.push(e[f].slice()));S.length;function C(t,e){if(t[e]<0)return e;var r=e,n=e;do{var a=t[n];if(!c[n]||a<0||a===n)break;if(a=t[n=a],!c[n]||a<0||a===n)break;n=a,r=t[r]}while(r!==n);for(var i=e;i!==n;i=t[i])t[i]=n;return n}var L=[];return t.forEach((function(t){var e=C(s,t[0]),r=C(l,t[1]);if(e>=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])r=e[0],i=e[1];else{if(!(e[0][0]>e[1][0]))return a(e,t);r=e[1],i=e[0]}if(t[0][0]<t[1][0])o=t[0],s=t[1];else{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])r=e[0],a=e[1];else{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 l<u?l-u:s>c?s-c:l-c}r=e[1],a=e[0]}t[0][1]<t[1][1]?(i=t[0],o=t[1]):(i=t[1],o=t[0]);var f=n(a,r,i);return f||((f=n(a,r,o))||o-a)}},{"robust-orientation":300}],312:[function(t,e,r){arguments[4][241][0].apply(r,arguments)},{dup:241}],313:[function(t,e,r){"use strict";e.exports=function(t){for(var e=t.length,r=2*e,n=new Array(r),i=0;i<e;++i){var l=t[i],u=l[0][0]<l[1][0];n[2*i]=new f(l[0][0],l,u,i),n[2*i+1]=new f(l[1][0],l,!u,i)}n.sort((function(t,e){var r=t.x-e.x;return r||((r=t.create-e.create)||Math.min(t.segment[0][1],t.segment[1][1])-Math.min(e.segment[0][1],e.segment[1][1]))}));var d=a(o),h=[],p=[],g=[];for(i=0;i<r;){for(var v=n[i].x,m=[];i<r;){var y=n[i];if(y.x!==v)break;i+=1,y.segment[0][0]===y.x&&y.segment[1][0]===y.x?y.create&&(y.segment[0][1]<y.segment[1][1]?(m.push(new c(y.segment[0][1],y.index,!0,!0)),m.push(new c(y.segment[1][1],y.index,!1,!1))):(m.push(new c(y.segment[1][1],y.index,!0,!1)),m.push(new c(y.segment[0][1],y.index,!1,!0)))):d=y.create?d.insert(y.segment,y.index):d.remove(y.segment)}h.push(d.root),p.push(v),g.push(m)}return new s(h,p,g)};var n=t("binary-search-bounds"),a=t("functional-red-black-tree"),i=t("robust-orientation"),o=t("./lib/order-segments");function s(t,e,r){this.slabs=t,this.coordinates=e,this.horizontal=r}function l(t,e){return t.y-e}function u(t,e){for(var r=null;t;){var n,a,o=t.key;o[0][0]<o[1][0]?(n=o[0],a=o[1]):(n=o[1],a=o[0]);var s=i(n,a,e);if(s<0)t=t.left;else if(s>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){var h=f[d];if(t[1]===h.y){if(h.closed)return h.index;for(;d<f.length-1&&f[d+1].y===t[1];)if((h=f[d+=1]).closed)return h.index;if(h.y===t[1]&&!h.start){if((d+=1)>=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<p;i++)if("string"==typeof r[i])g+=r[i];else if("object"==typeof r[i]){if((s=r[i]).keys)for(a=n[h],o=0;o<s.keys.length;o++){if(null==a)throw new Error(e('[sprintf] Cannot access property "%s" of undefined value "%s"',s.keys[o],s.keys[o-1]));a=a[s.keys[o]]}else a=s.param_no?n[s.param_no]:n[h++];if(t.not_type.test(s.type)&&t.not_primitive.test(s.type)&&a instanceof Function&&(a=a()),t.numeric_arg.test(s.type)&&"number"!=typeof a&&isNaN(a))throw new TypeError(e("[sprintf] expecting number but found %T",a));switch(t.number.test(s.type)&&(f=a>=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<i.length;s++){var l=i[s],u=i[s+1];"\\"===l[l.length-1]&&"\\"!==l[l.length-2]?(o.push(l+e+u),s++):o.push(l)}i=o}for(s=0;s<i.length;s++)a[0]=i[s],i[s]=n.stringify(a,{flat:!0});return i}},{parenthesis:264}],316:[function(t,e,r){"use strict";e.exports=function(t,e){if(t.dimension<=0)return{positions:[],cells:[]};if(1===t.dimension)return function(t,e){for(var r=i(t,e),n=r.length,a=new Array(n),o=new Array(n),s=0;s<n;++s)a[s]=[r[s]],o[s]=[s];return{positions:a,cells:o}}(t,e);var r=t.order.join()+"-"+t.dtype,s=o[r];e=+e||0;s||(s=o[r]=function(t,e){var r=t.length,i=["'use strict';"],o="surfaceNets"+t.join("_")+"d"+e;i.push("var contour=genContour({","order:[",t.join(),"],","scalarArguments: 3,","phase:function phaseFunc(p,a,b,c) { return (p > c)|0 },"),"generic"===e&&i.push("getters:[0],");for(var s=[],l=[],u=0;u<r;++u)s.push("d"+u),l.push("d"+u);for(u=0;u<1<<r;++u)s.push("v"+u),l.push("v"+u);for(u=0;u<1<<r;++u)s.push("p"+u),l.push("p"+u);s.push("a","b","c"),l.push("a","c"),i.push("vertex:function vertexFunc(",s.join(),"){");var c=[];for(u=0;u<1<<r;++u)c.push("(p"+u+"<<"+u+")");i.push("var m=(",c.join("+"),")|0;if(m===0||m===",(1<<(1<<r))-1,"){return}");var f=[],d=[];1<<(1<<r)<=128?(i.push("switch(m){"),d=i):i.push("switch(m>>>7){");for(u=0;u<1<<(1<<r);++u){if(1<<(1<<r)>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;b<r;++b)p[b]=[],g[b]=[],v[b]=0,m[b]=0;for(b=0;b<1<<r;++b)for(var x=0;x<r;++x){var _=b^1<<x;if(!(_>b)&&!(u&1<<_)!=!(u&1<<b)){var w=1;u&1<<_?g[x].push("v"+_+"-v"+b):(g[x].push("v"+b+"-v"+_),w=-w),w<0?(p[x].push("-v"+b+"-v"+_),v[x]+=2):(p[x].push("v"+b+"+v"+_),v[x]-=2),y+=1;for(var A=0;A<r;++A)A!==x&&(_&1<<A?m[A]+=1:m[A]-=1)}}var T=[];for(x=0;x<r;++x)if(0===p[x].length)T.push("d"+x+"-0.5");else{var k="";v[x]<0?k=v[x]+"*c":v[x]>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<<r-1;++u)S.push("v"+u);S.push("c0","c1","p0","p1","a","b","c"),i.push("cell:function cellFunc(",S.join(),"){");var C=a(r-1);i.push("if(p0){b.push(",C.map((function(t){return"["+t.map((function(t){return"v"+t}))+"]"})).join(),")}else{b.push(",C.map((function(t){var e=t.slice();return e.reverse(),"["+e.map((function(t){return"v"+t}))+"]"})).join(),")}}});function ",o,"(array,level){var verts=[],cells=[];contour(array,verts,cells,level);return {positions:verts,cells:cells};} return ",o,";");for(u=0;u<f.length;++u)i.push(f[u].join(""));return new Function("genContour",i.join(""))(n)}(t.order,t.dtype));return s(t,e)};var n=t("ndarray-extract-contour"),a=t("triangulate-hypercube"),i=t("zero-crossings");var o={}},{"ndarray-extract-contour":257,"triangulate-hypercube":325,"zero-crossings":351}],317:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var r=[],n=!0,a=!1,i=void 0;try{for(var o,s=t[Symbol.iterator]();!(n=(o=s.next()).done)&&(r.push(o.value),!e||r.length!==e);n=!0);}catch(t){a=!0,i=t}finally{try{!n&&s.return&&s.return()}finally{if(a)throw i}}return r}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")},a=2*Math.PI,i=function(t,e,r,n,a,i,o){var s=t.x,l=t.y;return{x:n*(s*=e)-a*(l*=r)+i,y:a*s+n*l+o}},o=function(t,e){var r=1.5707963267948966===e?.551915024494:-1.5707963267948966===e?-.551915024494:4/3*Math.tan(e/4),n=Math.cos(t),a=Math.sin(t),i=Math.cos(t+e),o=Math.sin(t+e);return[{x:n-a*r,y:a+n*r},{x:i+o*r,y:o-i*r},{x:i,y:o}]},s=function(t,e,r,n){var a=t*r+e*n;return a>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;D<O;D++)y.push(o(S,C)),S+=C;return y.map((function(t){var e=i(t[0],c,f,x,b,M,E),r=e.x,n=e.y,a=i(t[1],c,f,x,b,M,E),o=a.x,s=a.y,l=i(t[2],c,f,x,b,M,E);return{x1:r,y1:n,x2:o,y2:s,x:l.x,y:l.y}}))},e.exports=r.default},{}],318:[function(t,e,r){"use strict";var n=t("parse-svg-path"),a=t("abs-svg-path"),i=t("normalize-svg-path"),o=t("is-svg-path"),s=t("assert");e.exports=function(t){Array.isArray(t)&&1===t.length&&"string"==typeof t[0]&&(t=t[0]);"string"==typeof t&&(s(o(t),"String is not an SVG path."),t=n(t));if(s(Array.isArray(t),"Argument should be a string or an array of path segments."),t=a(t),!(t=i(t)).length)return[0,0,0,0];for(var e=[1/0,1/0,-1/0,-1/0],r=0,l=t.length;r<l;r++)for(var u=t[r].slice(1),c=0;c<u.length;c+=2)u[c+0]<e[0]&&(e[0]=u[c+0]),u[c+1]<e[1]&&(e[1]=u[c+1]),u[c+0]>e[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;p<g;p++){var v=t[p],m=v[0];switch(m){case"M":l=v[1],u=v[2];break;case"A":var y=n({px:d,py:h,cx:v[6],cy:v[7],rx:v[1],ry:v[2],xAxisRotation:v[3],largeArcFlag:v[4],sweepFlag:v[5]});if(!y.length)continue;for(var b,x=0;x<y.length;x++)b=y[x],v=["C",b.x1,b.y1,b.x2,b.y2,b.x,b.y],x<y.length-1&&r.push(v);break;case"S":var _=d,w=h;"C"!=e&&"S"!=e||(_+=_-o,w+=w-s),v=["C",_,w,v[1],v[2],v[3],v[4]];break;case"T":"Q"==e||"T"==e?(c=2*d-c,f=2*h-f):(c=d,f=h),v=i(d,h,c,f,v[1],v[2]);break;case"Q":c=v[1],f=v[2],v=i(d,h,v[1],v[2],v[3],v[4]);break;case"L":v=a(d,h,v[1],v[2]);break;case"H":v=a(d,h,v[1],h);break;case"V":v=a(d,h,d,v[1]);break;case"Z":v=a(d,h,l,u)}e=m,d=v[v.length-2],h=v[v.length-1],v.length>4?(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;o<e.length;++o)for(var s=e[o],l=0;l<3;++l){var u=r[s[l]];n[a++]=u[0],n[a++]=u[1]+1.4,i=Math.max(u[0],i)}return{data:n,shape:i}}(n(r,{triangles:!0,font:e,textAlign:a.textAlign||"left",textBaseline:"alphabetic",styletags:{breaklines:!0,bolds:!0,italics:!0,subscripts:!0,superscripts:!0}}));else{for(var l=r.split(/(\d|\s)/),u=new Array(l.length),c=0,f=0,d=0;d<l.length;++d)u[d]=t(e,l[d]),c+=u[d].data.length,f+=u[d].shape,d>0&&(f+=.02);var h=new Float32Array(c),p=0,g=-.5*f;for(d=0;d<u.length;++d){for(var v=u[d].data,m=0;m<v.length;m+=2)h[p++]=v[m]+g,h[p++]=v[m+1];g+=u[d].shape+.02}s=o[r]={data:h,shape:f}}return s};var n=t("vectorize-text"),a=window||r.global||{},i=a.__TEXT_CACHE||{};a.__TEXT_CACHE={}}).call(this)}).call(this,t("_process"))},{_process:285,"vectorize-text":344}],322:[function(t,e,r){!function(t){var r=/^\s+/,n=/\s+$/,a=0,i=t.round,o=t.min,s=t.max,l=t.random;function u(e,l){if(l=l||{},(e=e||"")instanceof u)return e;if(!(this instanceof u))return new u(e,l);var c=function(e){var a={r:0,g:0,b:0},i=1,l=null,u=null,c=null,f=!1,d=!1;"string"==typeof e&&(e=function(t){t=t.replace(r,"").replace(n,"").toLowerCase();var e,a=!1;if(E[t])t=E[t],a=!0;else if("transparent"==t)return{r:0,g:0,b:0,a:0,format:"name"};if(e=j.rgb.exec(t))return{r:e[1],g:e[2],b:e[3]};if(e=j.rgba.exec(t))return{r:e[1],g:e[2],b:e[3],a:e[4]};if(e=j.hsl.exec(t))return{h:e[1],s:e[2],l:e[3]};if(e=j.hsla.exec(t))return{h:e[1],s:e[2],l:e[3],a:e[4]};if(e=j.hsv.exec(t))return{h:e[1],s:e[2],v:e[3]};if(e=j.hsva.exec(t))return{h:e[1],s:e[2],v:e[3],a:e[4]};if(e=j.hex8.exec(t))return{r:D(e[1]),g:D(e[2]),b:D(e[3]),a:F(e[4]),format:a?"name":"hex8"};if(e=j.hex6.exec(t))return{r:D(e[1]),g:D(e[2]),b:D(e[3]),format:a?"name":"hex"};if(e=j.hex4.exec(t))return{r:D(e[1]+""+e[1]),g:D(e[2]+""+e[2]),b:D(e[3]+""+e[3]),a:F(e[4]+""+e[4]),format:a?"name":"hex8"};if(e=j.hex3.exec(t))return{r:D(e[1]+""+e[1]),g:D(e[2]+""+e[2]),b:D(e[3]+""+e[3]),format:a?"name":"hex"};return!1}(e));"object"==typeof e&&(U(e.r)&&U(e.g)&&U(e.b)?(h=e.r,p=e.g,g=e.b,a={r:255*L(h,255),g:255*L(p,255),b:255*L(g,255)},f=!0,d="%"===String(e.r).substr(-1)?"prgb":"rgb"):U(e.h)&&U(e.s)&&U(e.v)?(l=I(e.s),u=I(e.v),a=function(e,r,n){e=6*L(e,360),r=L(r,100),n=L(n,100);var a=t.floor(e),i=e-a,o=n*(1-r),s=n*(1-i*r),l=n*(1-(1-i)*r),u=a%6;return{r:255*[n,s,o,o,l,n][u],g:255*[l,n,n,s,o,o][u],b:255*[o,o,l,n,n,s][u]}}(e.h,l,u),f=!0,d="hsv"):U(e.h)&&U(e.s)&&U(e.l)&&(l=I(e.s),c=I(e.l),a=function(t,e,r){var n,a,i;function o(t,e,r){return r<0&&(r+=1),r>1&&(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<r?6:0);break;case e:n=(r-t)/c+2;break;case r:n=(t-e)/c+4}n/=6}return{h:n,s:a,l:u}}function f(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,c=i-l;if(a=0===i?0:c/i,i==l)n=0;else{switch(i){case t:n=(e-r)/c+(e<r?6:0);break;case e:n=(r-t)/c+2;break;case r:n=(t-e)/c+4}n/=6}return{h:n,s:a,v:u}}function d(t,e,r,n){var a=[R(i(t).toString(16)),R(i(e).toString(16)),R(i(r).toString(16))];return n&&a[0].charAt(0)==a[0].charAt(1)&&a[1].charAt(0)==a[1].charAt(1)&&a[2].charAt(0)==a[2].charAt(1)?a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0):a.join("")}function h(t,e,r,n){return[R(P(n)),R(i(t).toString(16)),R(i(e).toString(16)),R(i(r).toString(16))].join("")}function p(t,e){e=0===e?0:e||10;var r=u(t).toHsl();return r.s-=e/100,r.s=O(r.s),u(r)}function g(t,e){e=0===e?0:e||10;var r=u(t).toHsl();return r.s+=e/100,r.s=O(r.s),u(r)}function v(t){return u(t).desaturate(100)}function m(t,e){e=0===e?0:e||10;var r=u(t).toHsl();return r.l+=e/100,r.l=O(r.l),u(r)}function y(t,e){e=0===e?0:e||10;var r=u(t).toRgb();return r.r=s(0,o(255,r.r-i(-e/100*255))),r.g=s(0,o(255,r.g-i(-e/100*255))),r.b=s(0,o(255,r.b-i(-e/100*255))),u(r)}function b(t,e){e=0===e?0:e||10;var r=u(t).toHsl();return r.l-=e/100,r.l=O(r.l),u(r)}function x(t,e){var r=u(t).toHsl(),n=(r.h+e)%360;return r.h=n<0?360+n:n,u(r)}function _(t){var e=u(t).toHsl();return e.h=(e.h+180)%360,u(e)}function w(t){var e=u(t).toHsl(),r=e.h;return[u(t),u({h:(r+120)%360,s:e.s,l:e.l}),u({h:(r+240)%360,s:e.s,l:e.l})]}function A(t){var e=u(t).toHsl(),r=e.h;return[u(t),u({h:(r+90)%360,s:e.s,l:e.l}),u({h:(r+180)%360,s:e.s,l:e.l}),u({h:(r+270)%360,s:e.s,l:e.l})]}function T(t){var e=u(t).toHsl(),r=e.h;return[u(t),u({h:(r+72)%360,s:e.s,l:e.l}),u({h:(r+216)%360,s:e.s,l:e.l})]}function k(t,e,r){e=e||6,r=r||30;var n=u(t).toHsl(),a=360/r,i=[u(t)];for(n.h=(n.h-(a*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;c<e.length;c++)(n=u.readability(t,e[c]))>l&&(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<n;r++)e[r]=t[r]-e[r];return e}return a(t-a(t))};var n=new Float32Array(1);function a(t){if(t.length){if(t instanceof Float32Array)return t;var e=new Float32Array(t);return e.set(t),e}return n[0]=t,n[0]}},{}],324:[function(t,e,r){"use strict";var n=t("parse-unit");e.exports=i;function a(t,e){var r=n(getComputedStyle(t).getPropertyValue(e));return r[0]*i(r[1],t)}function i(t,e){switch(e=e||document.body,t=(t||"px").trim().toLowerCase(),e!==window&&e!==document||(e=document.body),t){case"%":return e.clientHeight/100;case"ch":case"ex":return function(t,e){var r=document.createElement("div");r.style["font-size"]="128"+t,e.appendChild(r);var n=a(r,"font-size")/128;return e.removeChild(r),n}(t,e);case"em":return a(e,"font-size");case"rem":return a(document.body,"font-size");case"vw":return window.innerWidth/100;case"vh":return window.innerHeight/100;case"vmin":return Math.min(window.innerWidth,window.innerHeight)/100;case"vmax":return Math.max(window.innerWidth,window.innerHeight)/100;case"in":return 96;case"cm":return 96/2.54;case"mm":return 96/25.4;case"pt":return 96/72;case"pc":return 16}return 1}},{"parse-unit":267}],325:[function(t,e,r){"use strict";e.exports=function(t){if(t<0)return[];if(0===t)return[[0]];for(var e=0|Math.round(i(t+1)),r=[],o=0;o<e;++o){for(var s=n.unrank(t,o),l=[0],u=0,c=0;c<s.length;++c)u+=1<<s[c],l.push(u);a(s)<1&&(l[0]=u,l[t]=0),r.push(l)}return r};var n=t("permutation-rank"),a=t("permutation-parity"),i=t("gamma")},{gamma:160,"permutation-parity":269,"permutation-rank":270}],326:[function(t,e,r){"use strict";e.exports=function(t,e,r){var a=t*e,i=n*t,o=i-(i-t),s=t-o,l=n*e,u=l-(l-e),c=e-u,f=s*c-(a-o*u-s*u-o*c);if(r)return r[0]=f,r[1]=a,r;return[f,a]};var n=+(Math.pow(2,27)+1)},{}],327:[function(t,e,r){"use strict";e.exports=function(t,e,r){var n=t+e,a=n-t,i=e-a,o=t-(n-a);if(r)return r[0]=o+i,r[1]=n,r;return[o+i,n]}},{}],328:[function(t,e,r){"use strict";var n=t("../prototype/is");e.exports=function(t){if("function"!=typeof t)return!1;if(!hasOwnProperty.call(t,"length"))return!1;try{if("number"!=typeof t.length)return!1;if("function"!=typeof t.call)return!1;if("function"!=typeof t.apply)return!1}catch(t){return!1}return!n(t)}},{"../prototype/is":335}],329:[function(t,e,r){"use strict";var n=t("../value/is"),a=t("../object/is"),i=t("../string/coerce"),o=t("./to-short-string"),s=function(t,e){return t.replace("%v",o(e))};e.exports=function(t,e,r){if(!a(r))throw new TypeError(s(e,t));if(!n(t)){if("default"in r)return r.default;if(r.isOptional)return null}var o=i(r.errorMessage);throw n(o)||(o=e),new TypeError(s(o,t))}},{"../object/is":332,"../string/coerce":336,"../value/is":338,"./to-short-string":331}],330:[function(t,e,r){"use strict";e.exports=function(t){try{return t.toString()}catch(e){try{return String(t)}catch(t){return null}}}},{}],331:[function(t,e,r){"use strict";var n=t("./safe-to-string"),a=/[\n\r\u2028\u2029]/g;e.exports=function(t){var e=n(t);return null===e?"<Non-coercible to string value>":(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;e<t;++e)this.roots[e]=e,this.ranks[e]=0}e.exports=n;var a=n.prototype;Object.defineProperty(a,"length",{get:function(){return this.roots.length}}),a.makeSet=function(){var t=this.roots.length;return this.roots.push(t),this.ranks.push(0),t},a.find=function(t){for(var e=t,r=this.roots;r[t]!==t;)t=r[t];for(;r[e]!==t;){var n=r[e];r[e]=t,e=n}return t},a.link=function(t,e){var r=this.find(t),n=this.find(e);if(r!==n){var a=this.ranks,i=this.roots,o=a[r],s=a[n];o<s?i[r]=n:s<o?i[n]=r:(i[n]=r,++a[r])}}},{}],341:[function(t,e,r){"use strict";e.exports=function(t,e,r){return 0===t.length?t:e?(r||t.sort(e),function(t,e){for(var r=1,n=t.length,a=t[0],i=t[0],o=1;o<n;++o)if(i=a,e(a=t[o],i)){if(o===r){r++;continue}t[r++]=a}return t.length=r,t}(t,e)):(r||t.sort(),function(t){for(var e=1,r=t.length,n=t[0],a=t[0],i=1;i<r;++i,a=n)if(a=n,(n=t[i])!==a){if(i===e){e++;continue}t[e++]=n}return t.length=e,t}(t))}},{}],342:[function(t,e,r){var n=/[\'\"]/;e.exports=function(t){return t?(n.test(t.charAt(0))&&(t=t.substr(1)),n.test(t.charAt(t.length-1))&&(t=t.substr(0,t.length-1)),t):""}},{}],343:[function(t,e,r){"use strict";e.exports=function(t,e,r){Array.isArray(r)||(r=[].slice.call(arguments,2));for(var n=0,a=r.length;n<a;n++){var i=r[n];for(var o in i)if((void 0===e[o]||Array.isArray(e[o])||t[o]!==e[o])&&o in e){var s;if(!0===i[o])s=e[o];else{if(!1===i[o])continue;if("function"==typeof i[o]&&void 0===(s=i[o](e[o],t,e)))continue}t[o]=s}}return t}},{}],344:[function(t,e,r){"use strict";e.exports=function(t,e){"object"==typeof e&&null!==e||(e={});return n(t,e.canvas||a,e.context||i,e)};var n=t("./lib/vtext"),a=null,i=null;"undefined"!=typeof document&&((a=document.createElement("canvas")).width=8192,a.height=1024,i=a.getContext("2d"))},{"./lib/vtext":345}],345:[function(t,e,r){e.exports=function(t,e,r,n){var i=64,o=1.25,s={breaklines:!1,bolds:!1,italics:!1,subscripts:!1,superscripts:!1};n&&(n.size&&n.size>0&&(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(/\<br\>/g,"\n"):r.replace(/\<br\>/g," ");var s="",l=[];for(h=0;h<r.length;++h)l[h]=s;!0===o.bolds&&(l=u("b","b|",r,l));!0===o.italics&&(l=u("i","i|",r,l));!0===o.superscripts&&(l=u("sup","+1",r,l));!0===o.subscripts&&(l=u("sub","-1",r,l));var c=[],f="";for(h=0;h<r.length;++h)null!==l[h]&&(f+=r[h],c.push(l[h]));var d,h,p,g,v,m=f.split("\n"),y=m.length,b=Math.round(i*n),x=n,_=2*n,w=0,A=y*b+_;t.height<A&&(t.height=A);e.fillStyle="#000",e.fillRect(0,0,t.width,t.height),e.fillStyle="#fff";var T=0,k="";function M(){if(""!==k){var t=e.measureText(k).width;e.fillText(k,x+p,_+g),p+=t}}function E(){return Math.round(v)+"px "}function S(t,r){var n=""+e.font;if(!0===o.subscripts){var a=t.indexOf("-"),i=r.indexOf("-"),s=a>-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<y;++d){var C=m[d]+"\n";for(p=0,g=d*b,v=n,k="",h=0;h<C.length;++h){var L=h+T<c.length?c[h+T]:c[c.length-1];s===L?k+=C[h]:(M(),k=C[h],void 0!==L&&(S(s,L),s=L))}M(),T+=C.length;var O=0|Math.round(p+2*x);w<O&&(w=O)}var D=w,R=_+b*y;return a(e.getImageData(0,0,D,R).data,[R,D,4]).pick(-1,-1,0).transpose(1,0)}(e,r,t,i,o,s),n,i)},e.exports.processPixels=d;var n=t("surface-nets"),a=t("ndarray"),i=t("simplify-planar-graph"),o=t("clean-pslg"),s=t("cdt2d"),l=t("planar-graph-to-polyline");function u(t,e,r,n){for(var a="<"+t+">",i="</"+t+">",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+s;++f)if(f<u+o||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<s;++l)for(var u=t[l],c=0;c<2;++c)i[c]=0|Math.min(i[c],u[c]),o[c]=0|Math.max(o[c],u[c]);var f=0;switch(n){case"center":f=-.5*(i[0]+o[0]);break;case"right":case"end":f=-o[0];break;case"left":case"start":f=-i[0];break;default:throw new Error("vectorize-text: Unrecognized textAlign: '"+n+"'")}var d=0;switch(a){case"hanging":case"top":d=-i[1];break;case"middle":d=-.5*(i[1]+o[1]);break;case"alphabetic":case"ideographic":d=-3*r;break;case"bottom":d=-o[1];break;default:throw new Error("vectorize-text: Unrecoginized textBaseline: '"+a+"'")}var h=1/r;return"lineHeight"in e?h*=+e.lineHeight:"width"in e?h=e.width/(o[0]-i[0]):"height"in e&&(h=e.height/(o[1]-i[1])),t.map((function(t){return[h*(t[0]+f),h*(t[1]+d)]}))}(a.positions,e,r),u=a.edges,f="ccw"===e.orientation;if(o(i,u),e.polygons||e.polygon||e.polyline){for(var d=l(u,i),h=new Array(d.length),p=0;p<d.length;++p){for(var g=d[p],v=new Array(g.length),m=0;m<g.length;++m){for(var y=g[m],b=new Array(y.length),x=0;x<y.length;++x)b[x]=i[y[x]].slice();f&&b.reverse(),v[m]=b}h[p]=v}return h}return e.triangles||e.triangulate||e.triangle?{cells:s(i,u,{delaunay:!1,exterior:!1,interior:!0}),positions:i}:{edges:u,positions:i}}function d(t,e,r){try{return f(t,e,r,!0)}catch(t){}try{return f(t,e,r,!1)}catch(t){}return e.polygons||e.polyline||e.polygon?[]:e.triangles||e.triangulate||e.triangle?{cells:[],positions:[]}:{edges:[],positions:[]}}},{cdt2d:53,"clean-pslg":59,ndarray:259,"planar-graph-to-polyline":274,"simplify-planar-graph":310,"surface-nets":316}],346:[function(t,e,r){var n=t("./hidden-store.js");e.exports=function(){var t={};return function(e){if(("object"!=typeof e||null===e)&&"function"!=typeof e)throw new Error("Weakmap-shim: Key must be object");var r=e.valueOf(t);return r&&r.identity===t?r:n(e,t)}}},{"./hidden-store.js":347}],347:[function(t,e,r){e.exports=function(t,e){var r={identity:e},n=t.valueOf;return Object.defineProperty(t,"valueOf",{value:function(t){return t!==e?n.apply(this,arguments):r},writable:!0}),r}},{}],348:[function(t,e,r){var n=t("./create-store.js");e.exports=function(){var t=n();return{get:function(e,r){var n=t(e);return n.hasOwnProperty("value")?n.value:r},set:function(e,r){return t(e).value=r,this},has:function(e){return"value"in t(e)},delete:function(e){return delete t(e).value}}}},{"./create-store.js":346}],349:[function(t,e,r){var n=t("get-canvas-context");e.exports=function(t){return n("webgl",t)}},{"get-canvas-context":161}],350:[function(t,e,r){e.exports=t("cwise-compiler")({args:["array",{offset:[1],array:0},"scalar","scalar","index"],pre:{body:"{}",args:[],thisVars:[],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},body:{body:"{\n var _inline_1_da = _inline_1_arg0_ - _inline_1_arg3_\n var _inline_1_db = _inline_1_arg1_ - _inline_1_arg3_\n if((_inline_1_da >= 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;r<c.length;r++)if(i=(a=c[r]).clicktoshow){for(n=0;n<p;n++)if(l=(o=e[n]).xaxis,u=o.yaxis,l._id===a.xref&&u._id===a.yref&&l.d2r(o.x)===s(a._xclick,l)&&u.d2r(o.y)===s(a._yclick,u)){(a.visible?"onout"===i?d:h:f).push(r);break}n===p&&a.visible&&"onout"===i&&d.push(r)}return{on:f,off:d,explicitOff:h}}function s(t,e){return"log"===e.type?e.l2r(t):e.d2r(t)}e.exports={hasClickToShow:function(t,e){var r=o(t,e);return r.on.length>0||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;r<u.length;r++)(s=i(t.layout,"annotations",d[u[r]])).modifyItem("visible",!0),n.extendFlat(f,s.getUpdateObj());for(r=0;r<c.length;r++)(s=i(t.layout,"annotations",d[c[r]])).modifyItem("visible",!1),n.extendFlat(f,s.getUpdateObj());return a.call("update",t,{},f)}}},{"../../lib":498,"../../plot_api/plot_template":536,"../../registry":593}],356:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../color");e.exports=function(t,e,r,i){i("opacity");var o=i("bgcolor"),s=i("bordercolor"),l=a.opacity(s);i("borderpad");var u=i("borderwidth"),c=i("showarrow");if(i("text",c?" ":r._dfltTitle.annotation),i("textangle"),n.coerceFont(i,"font",r.font),i("width"),i("align"),i("height")&&i("valign"),c){var f,d,h=i("arrowside");-1!==h.indexOf("end")&&(f=i("arrowhead"),d=i("arrowsize")),-1!==h.indexOf("start")&&(i("startarrowhead",f),i("startarrowsize",d)),i("arrowcolor",l?e.bordercolor:a.defaultLine),i("arrowwidth",2*(l&&u||1)),i("standoff"),i("startstandoff")}var p=i("hovertext"),g=r.hoverlabel||{};if(p){var v=i("hoverlabel.bgcolor",g.bgcolor||(a.opacity(o)?a.rgb(o):a.defaultLine)),m=i("hoverlabel.bordercolor",g.bordercolor||a.contrast(v));n.coerceFont(i,"hoverlabel.font",{family:g.font.family,size:g.font.size,color:g.font.color||m})}i("captureevents",!!p)}},{"../../lib":498,"../color":368}],357:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib/to_log_range");e.exports=function(t,e,r,i){e=e||{};var o="log"===r&&"linear"===e.type,s="linear"===r&&"log"===e.type;if(o||s)for(var l,u,c=t._fullLayout.annotations,f=e._id.charAt(0),d=0;d<c.length;d++)l=c[d],u="annotations["+d+"].",l[f+"ref"]===e._id&&h(f),l["a"+f+"ref"]===e._id&&h("a"+f);function h(t){var r=l[t],s=null;s=o?a(r,e.range):Math.pow(10,r),n(s)||(s=null),i(u+t,s)}}},{"../../lib/to_log_range":525,"fast-isnumeric":155}],358:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../plots/cartesian/axes"),i=t("../../plots/array_container_defaults"),o=t("./common_defaults"),s=t("./attributes");function l(t,e,r){function i(r,a){return n.coerce(t,e,s,r,a)}var l=i("visible"),u=i("clicktoshow");if(l||u){o(t,e,r,i);for(var c=e.showarrow,f=["x","y"],d=[-10,-30],h={_fullLayout:r},p=0;p<2;p++){var g=f[p],v=a.coerceRef(t,e,h,g,"","paper");if("paper"!==v)a.getFromId(h,v)._annIndices.push(e._index);if(a.coercePosition(e,h,i,v,g,.5),c){var m="a"+g,y=a.coerceRef(t,e,h,m,"pixel",["pixel","paper"]);"pixel"!==y&&y!==v&&(y=e[m]="pixel");var b="pixel"===y?d[p]:.4;a.coercePosition(e,h,i,y,m,b)}i(g+"anchor"),i(g+"shift")}if(n.noneOrAll(t,e,["x","y"]),c&&n.noneOrAll(t,e,["ax","ay"]),u){var x=i("xclick"),_=i("yclick");e._xclick=void 0===x?e.x:a.cleanPosition(x,h,e.xref),e._yclick=void 0===_?e.y:a.cleanPosition(_,h,e.yref)}}}e.exports=function(t,e){i(t,e,{name:"annotations",handleItemDefaults:l})}},{"../../lib":498,"../../plots/array_container_defaults":542,"../../plots/cartesian/axes":547,"./attributes":353,"./common_defaults":356}],359:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../registry"),i=t("../../plots/plots"),o=t("../../lib"),s=o.strTranslate,l=t("../../plots/cartesian/axes"),u=t("../color"),c=t("../drawing"),f=t("../fx"),d=t("../../lib/svg_text_utils"),h=t("../../lib/setcursor"),p=t("../dragelement"),g=t("../../plot_api/plot_template").arrayEditor,v=t("./draw_arrow_head");function m(t,e){var r=t._fullLayout.annotations[e]||{},n=l.getFromId(t,r.xref),a=l.getFromId(t,r.yref);n&&n.setScale(),a&&a.setScale(),b(t,r,e,!1,n,a)}function y(t,e,r,n,a){var i=a[r],o=a[r+"ref"],s=-1!==r.indexOf("y"),u="domain"===l.getRefType(o),c=s?n.h:n.w;return t?u?i+(s?-e:e)/t._length:t.p2r(t.r2p(i)+e):i+(s?-e:e)/c}function b(t,e,r,i,m,b){var x,_,w=t._fullLayout,A=t._fullLayout._size,T=t._context.edits;i?(x="annotation-"+i,_=i+".annotations"):(x="annotation",_="annotations");var k=g(t.layout,_,e),M=k.modifyBase,E=k.modifyItem,S=k.getUpdateObj;w._infolayer.selectAll("."+x+'[data-index="'+r+'"]').remove();var C="clip"+w._uid+"_ann"+r;if(e._input&&!1!==e.visible){var L={x:{},y:{}},O=+e.textangle||0,D=w._infolayer.append("g").classed(x,!0).attr("data-index",String(r)).style("opacity",e.opacity),R=D.append("g").classed("annotation-text-g",!0),I=T[e.showarrow?"annotationTail":"annotationPosition"],P=e.captureevents||T.annotationText||I,F=R.append("g").style("pointer-events",P?"all":null).call(h,"pointer").on("click",(function(){t._dragging=!1,t.emit("plotly_clickannotation",X(n.event))}));e.hovertext&&F.on("mouseover",(function(){var r=e.hoverlabel,n=r.font,a=this.getBoundingClientRect(),i=t.getBoundingClientRect();f.loneHover({x0:a.left-i.left,x1:a.right-i.left,y:(a.top+a.bottom)/2-i.top,text:e.hovertext,color:r.bgcolor,borderColor:r.bordercolor,fontFamily:n.family,fontSize:n.size,fontColor:n.color},{container:w._hoverlayer.node(),outerContainer:w._paper.node(),gd:t})})).on("mouseout",(function(){f.loneUnhover(w._hoverlayer.node())}));var z=e.borderwidth,N=e.borderpad,B=z+N,j=F.append("rect").attr("class","bg").style("stroke-width",z+"px").call(u.stroke,e.bordercolor).call(u.fill,e.bgcolor),U=e.width||e.height,V=w._topclips.selectAll("#"+C).data(U?[0]:[]);V.enter().append("clipPath").classed("annclip",!0).attr("id",C).append("rect"),V.exit().remove();var H=e.font,G=w._meta?o.templateString(e.text,w._meta):e.text,q=F.append("text").classed("annotation-text",!0).text(G);T.annotationText?q.call(d.makeEditable,{delegate:F,gd:t}).call(W).on("edit",(function(r){e.text=r,this.call(W),E("text",r),m&&m.autorange&&M(m._name+".autorange",!0),b&&b.autorange&&M(b._name+".autorange",!0),a.call("_guiRelayout",t,S())})):q.call(W)}else n.selectAll("#"+C).remove();function X(t){var n={index:r,annotation:e._input,fullAnnotation:e,event:t};return i&&(n.subplotId=i),n}function W(r){return r.call(c.font,H).attr({"text-anchor":{left:"start",right:"end"}[e.align]||"middle"}),d.convertToTspans(r,t,Y),r}function Y(){var r=q.selectAll("a");1===r.size()&&r.text()===q.text()&&F.insert("a",":first-child").attr({"xlink:xlink:href":r.attr("xlink:href"),"xlink:xlink:show":r.attr("xlink:show")}).style({cursor:"pointer"}).node().appendChild(j.node());var n=F.select(".annotation-text-math-group"),f=!n.empty(),g=c.bBox((f?n:q).node()),x=g.width,_=g.height,k=e.width||x,P=e.height||_,N=Math.round(k+2*B),H=Math.round(P+2*B);function G(t,e){return"auto"===e&&(e=t<1/3?"left":t>2/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;Z<Y.length;Z++){var J,Q,$,K,tt,et=Y[Z],rt=e[et+"ref"]||et,nt=e["a"+et+"ref"],at={x:m,y:b}[et],it=(O+("x"===et?0:-90))*Math.PI/180,ot=N*Math.cos(it),st=H*Math.sin(it),lt=Math.abs(ot)+Math.abs(st),ut=e[et+"anchor"],ct=e[et+"shift"]*("x"===et?1:-1),ft=L[et],dt=l.getRefType(rt);if(at&&"domain"!==dt){var ht=at.r2fraction(e[et]);(ht<0||ht>1)&&(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<e.annotations.length;r++)e.annotations[r].visible&&m(t,r);return i.previousPromises(t)},drawOne:m,drawRaw:b}},{"../../lib":498,"../../lib/setcursor":519,"../../lib/svg_text_utils":523,"../../plot_api/plot_template":536,"../../plots/cartesian/axes":547,"../../plots/plots":585,"../../registry":593,"../color":368,"../dragelement":387,"../drawing":390,"../fx":408,"./draw_arrow_head":360,d3:86}],360:[function(t,e,r){"use strict";var n=t("d3"),a=t("../color"),i=t("./arrow_paths"),o=t("../../lib"),s=o.strScale,l=o.strRotate,u=o.strTranslate;e.exports=function(t,e,r){var o,c,f,d,h=t.node(),p=i[r.arrowhead||0],g=i[r.startarrowhead||0],v=(r.arrowwidth||1)*(r.arrowsize||1),m=(r.arrowwidth||1)*(r.startarrowsize||1),y=e.indexOf("start")>=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(S<x+_)return void I();var L=h.getPointAtLength(0),O=h.getPointAtLength(.1);f=Math.atan2(L.y-O.y,L.x-O.x),o=h.getPointAtLength(Math.min(_,S)),C="0px,"+_+"px,";var D=h.getPointAtLength(S),R=h.getPointAtLength(S-.1);d=Math.atan2(D.y-R.y,D.x-R.x),c=h.getPointAtLength(Math.max(0,S-x)),C+=S-(C?_+x:x)+"px,"+S+"px",t.style("stroke-dasharray",C)}function I(){t.style("stroke-dasharray","0px,100px")}function P(e,i,o,c){e.path&&(e.noRotate&&(o=0),n.select(h.parentNode).append("path").attr({class:t.attr("class"),d:e.path,transform:u(i.x,i.y)+l(180*o/Math.PI)+s(c)}).style({fill:a.rgb(r.arrowcolor),"stroke-width":0}))}y&&P(g,o,f,m),b&&P(p,c,d,v)}},{"../../lib":498,"../color":368,"./arrow_paths":352,d3:86}],361:[function(t,e,r){"use strict";var n=t("./draw"),a=t("./click");e.exports={moduleType:"component",name:"annotations",layoutAttributes:t("./attributes"),supplyLayoutDefaults:t("./defaults"),includeBasePlot:t("../../plots/cartesian/include_components")("annotations"),calcAutorange:t("./calc_autorange"),draw:n.draw,drawOne:n.drawOne,drawRaw:n.drawRaw,hasClickToShow:a.hasClickToShow,onClick:a.onClick,convertCoords:t("./convert_coords")}},{"../../plots/cartesian/include_components":559,"./attributes":353,"./calc_autorange":354,"./click":355,"./convert_coords":357,"./defaults":358,"./draw":359}],362:[function(t,e,r){"use strict";var n=t("../annotations/attributes"),a=t("../../plot_api/edit_types").overrideAll,i=t("../../plot_api/plot_template").templatedArray;e.exports=a(i("annotation",{visible:n.visible,x:{valType:"any"},y:{valType:"any"},z:{valType:"any"},ax:{valType:"number"},ay:{valType:"number"},xanchor:n.xanchor,xshift:n.xshift,yanchor:n.yanchor,yshift:n.yshift,text:n.text,textangle:n.textangle,font:n.font,width:n.width,height:n.height,opacity:n.opacity,align:n.align,valign:n.valign,bgcolor:n.bgcolor,bordercolor:n.bordercolor,borderpad:n.borderpad,borderwidth:n.borderwidth,showarrow:n.showarrow,arrowcolor:n.arrowcolor,arrowhead:n.arrowhead,startarrowhead:n.startarrowhead,arrowside:n.arrowside,arrowsize:n.arrowsize,startarrowsize:n.startarrowsize,arrowwidth:n.arrowwidth,standoff:n.standoff,startstandoff:n.startstandoff,hovertext:n.hovertext,hoverlabel:n.hoverlabel,captureevents:n.captureevents}),"calc","from-root")},{"../../plot_api/edit_types":529,"../../plot_api/plot_template":536,"../annotations/attributes":353}],363:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../plots/cartesian/axes");function i(t,e){var r=e.fullSceneLayout.domain,i=e.fullLayout._size,o={pdata:null,type:"linear",autorange:!1,range:[-1/0,1/0]};t._xa={},n.extendFlat(t._xa,o),a.setConvert(t._xa),t._xa._offset=i.l+r.x[0]*i.w,t._xa.l2p=function(){return.5*(1+t._pdata[0]/t._pdata[3])*i.w*(r.x[1]-r.x[0])},t._ya={},n.extendFlat(t._ya,o),a.setConvert(t._ya),t._ya._offset=i.t+(1-r.y[1])*i.h,t._ya.l2p=function(){return.5*(1-t._pdata[1]/t._pdata[3])*i.h*(r.y[1]-r.y[0])}}e.exports=function(t){for(var e=t.fullSceneLayout.annotations,r=0;r<e.length;r++)i(e[r],t);t.fullLayout._infolayer.selectAll(".annotation-"+t.id).remove()}},{"../../lib":498,"../../plots/cartesian/axes":547}],364:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../plots/cartesian/axes"),i=t("../../plots/array_container_defaults"),o=t("../annotations/common_defaults"),s=t("./attributes");function l(t,e,r,i){function l(r,a){return n.coerce(t,e,s,r,a)}function u(t){var n=t+"axis",i={_fullLayout:{}};return i._fullLayout[n]=r[n],a.coercePosition(e,i,l,t,t,.5)}l("visible")&&(o(t,e,i.fullLayout,l),u("x"),u("y"),u("z"),n.noneOrAll(t,e,["x","y","z"]),e.xref="x",e.yref="y",e.zref="z",l("xanchor"),l("yanchor"),l("xshift"),l("yshift"),e.showarrow&&(e.axref="pixel",e.ayref="pixel",l("ax",-10),l("ay",-30),n.noneOrAll(t,e,["ax","ay"])))}e.exports=function(t,e,r){i(t,e,{name:"annotations",handleItemDefaults:l,fullLayout:r.fullLayout})}},{"../../lib":498,"../../plots/array_container_defaults":542,"../../plots/cartesian/axes":547,"../annotations/common_defaults":356,"./attributes":362}],365:[function(t,e,r){"use strict";var n=t("../annotations/draw").drawRaw,a=t("../../plots/gl3d/project"),i=["x","y","z"];e.exports=function(t){for(var e=t.fullSceneLayout,r=t.dataScale,o=e.annotations,s=0;s<o.length;s++){for(var l=o[s],u=!1,c=0;c<3;c++){var f=i[c],d=l[f],h=e[f+"axis"].r2fraction(d);if(h<0||h>1){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<o.length;s++){var l=o[s];i.test(l)&&(t[l].annotations||[]).length&&(a.pushUnique(e._basePlotModules,r),a.pushUnique(e._subplots.gl3d,l))}},convert:t("./convert"),draw:t("./draw")}},{"../../lib":498,"../../registry":593,"./attributes":362,"./convert":363,"./defaults":364,"./draw":365}],367:[function(t,e,r){"use strict";r.defaults=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],r.defaultLine="#444",r.lightLine="#eee",r.background="#fff",r.borderLine="#BEC8D9",r.lightFraction=1e3/11},{}],368:[function(t,e,r){"use strict";var n=t("tinycolor2"),a=t("fast-isnumeric"),i=e.exports={},o=t("./attributes");i.defaults=o.defaults;var s=i.defaultLine=o.defaultLine;i.lightLine=o.lightLine;var l=i.background=o.background;function u(t){if(a(t)||"string"!=typeof t)return t;var e=t.trim();if("rgb"!==e.substr(0,3))return t;var r=e.match(/^rgba?\s*\(([^()]*)\)$/);if(!r)return t;var n=r[1].trim().split(/\s*[\s,]\s*/),i="a"===e.charAt(3)&&4===n.length;if(!i&&3!==n.length)return t;for(var o=0;o<n.length;o++){if(!n[o].length)return t;if(n[o]=Number(n[o]),!(n[o]>=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;e<o.length;e++)if(a=t[n=o[e]],"color"===n.substr(n.length-5))if(Array.isArray(a))for(r=0;r<a.length;r++)a[r]=u(a[r]);else t[n]=u(a);else if("colorscale"===n.substr(n.length-10)&&Array.isArray(a))for(r=0;r<a.length;r++)Array.isArray(a[r])&&(a[r][1]=u(a[r][1]));else if(Array.isArray(a)){var s=a[0];if(!Array.isArray(s)&&s&&"object"==typeof s)for(r=0;r<a.length;r++)i.clean(a[r])}else a&&"object"==typeof a&&i.clean(a)}}},{"./attributes":367,"fast-isnumeric":155,tinycolor2:322}],369:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/layout_attributes"),a=t("../../plots/font_attributes"),i=t("../../lib/extend").extendFlat,o=t("../../plot_api/edit_types").overrideAll;e.exports=o({thicknessmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"pixels"},thickness:{valType:"number",min:0,dflt:30},lenmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"fraction"},len:{valType:"number",min:0,dflt:1},x:{valType:"number",dflt:1.02,min:-2,max:3},xanchor:{valType:"enumerated",values:["left","center","right"],dflt:"left"},xpad:{valType:"number",min:0,dflt:10},y:{valType:"number",dflt:.5,min:-2,max:3},yanchor:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle"},ypad:{valType:"number",min:0,dflt:10},outlinecolor:n.linecolor,outlinewidth:n.linewidth,bordercolor:n.linecolor,borderwidth:{valType:"number",min:0,dflt:0},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)"},tickmode:n.tickmode,nticks:n.nticks,tick0:n.tick0,dtick:n.dtick,tickvals:n.tickvals,ticktext:n.ticktext,ticks:i({},n.ticks,{dflt:""}),ticklabelposition:{valType:"enumerated",values:["outside","inside","outside top","inside top","outside bottom","inside bottom"],dflt:"outside"},ticklen:n.ticklen,tickwidth:n.tickwidth,tickcolor:n.tickcolor,showticklabels:n.showticklabels,tickfont:a({}),tickangle:n.tickangle,tickformat:n.tickformat,tickformatstops:n.tickformatstops,tickprefix:n.tickprefix,showtickprefix:n.showtickprefix,ticksuffix:n.ticksuffix,showticksuffix:n.showticksuffix,separatethousands:n.separatethousands,exponentformat:n.exponentformat,minexponent:n.minexponent,showexponent:n.showexponent,title:{text:{valType:"string"},font:a({}),side:{valType:"enumerated",values:["right","top","bottom"],dflt:"top"}},_deprecated:{title:{valType:"string"},titlefont:a({}),titleside:{valType:"enumerated",values:["right","top","bottom"],dflt:"top"}}},"colorbars","from-root")},{"../../lib/extend":490,"../../plot_api/edit_types":529,"../../plots/cartesian/layout_attributes":561,"../../plots/font_attributes":575}],370:[function(t,e,r){"use strict";e.exports={cn:{colorbar:"colorbar",cbbg:"cbbg",cbfill:"cbfill",cbfills:"cbfills",cbline:"cbline",cblines:"cblines",cbaxis:"cbaxis",cbtitleunshift:"cbtitleunshift",cbtitle:"cbtitle",cboutline:"cboutline",crisp:"crisp",jsPlaceholder:"js-placeholder"}}},{}],371:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../plot_api/plot_template"),i=t("../../plots/cartesian/tick_value_defaults"),o=t("../../plots/cartesian/tick_mark_defaults"),s=t("../../plots/cartesian/tick_label_defaults"),l=t("./attributes");e.exports=function(t,e,r){var u=a.newContainer(e,"colorbar"),c=t.colorbar||{};function f(t,e){return n.coerce(c,u,l,t,e)}var d=f("thicknessmode");f("thickness","fraction"===d?30/(r.width-r.margin.l-r.margin.r):30);var h=f("lenmode");f("len","fraction"===h?1:r.height-r.margin.t-r.margin.b),f("x"),f("xanchor"),f("xpad"),f("y"),f("yanchor"),f("ypad"),n.noneOrAll(c,u,["x","y"]),f("outlinecolor"),f("outlinewidth"),f("bordercolor"),f("borderwidth"),f("bgcolor");var p=f("ticklabelposition");i(c,u,f,"linear");var g={outerTicks:!1,font:r.font};-1!==p.indexOf("inside")&&(g.bgColor="black"),s(c,u,f,"linear",g),o(c,u,f,"linear",g),f("title.text",r._dfltTitle.colorbar),n.coerceFont(f,"title.font",r.font),f("title.side")}},{"../../lib":498,"../../plot_api/plot_template":536,"../../plots/cartesian/tick_label_defaults":568,"../../plots/cartesian/tick_mark_defaults":569,"../../plots/cartesian/tick_value_defaults":570,"./attributes":369}],372:[function(t,e,r){"use strict";var n=t("d3"),a=t("tinycolor2"),i=t("../../plots/plots"),o=t("../../registry"),s=t("../../plots/cartesian/axes"),l=t("../dragelement"),u=t("../../lib"),c=u.strTranslate,f=t("../../lib/extend").extendFlat,d=t("../../lib/setcursor"),h=t("../drawing"),p=t("../color"),g=t("../titles"),v=t("../../lib/svg_text_utils"),m=t("../colorscale/helpers").flipScale,y=t("../../plots/cartesian/axis_defaults"),b=t("../../plots/cartesian/position_defaults"),x=t("../../plots/cartesian/layout_attributes"),_=t("../../constants/alignment"),w=_.LINE_SPACING,A=_.FROM_TL,T=_.FROM_BR,k=t("./constants").cn;e.exports={draw:function(t){var e=t._fullLayout._infolayer.selectAll("g."+k.colorbar).data(function(t){var e,r,n,a,i=t._fullLayout,o=t.calcdata,s=[];function l(t){return f(t,{_fillcolor:null,_line:{color:null,width:null,dash:null},_levels:{start:null,end:null,size:null},_filllevels:null,_fillgradient:null,_zrange:null})}function u(){"function"==typeof a.calc?a.calc(t,n,e):(e._fillgradient=r.reversescale?m(r.colorscale):r.colorscale,e._zrange=[r[a.min],r[a.max]])}for(var c=0;c<o.length;c++){var d=o[c],h=(n=d[0].trace)._module.colorbar;if(!0===n.visible&&h)for(var p=Array.isArray(h),g=p?h:[h],v=0;v<g.length;v++){var y=(a=g[v]).container;(r=y?n[y]:n)&&r.showscale&&((e=l(r.colorbar))._id="cb"+n.uid+(p&&y?"-"+y:""),e._traceIndex=n.index,e._propPrefix=(y?y+".":"")+"colorbar.",e._meta=n._meta,u(),s.push(e))}}for(var b in i._colorAxes)if((r=i[b]).showscale){var x=i._colorAxes[b];(e=l(r.colorbar))._id="cb"+b,e._propPrefix=b+".colorbar.",e._meta=i._meta,a={min:"cmin",max:"cmax"},"heatmap"!==x[0]&&(n=x[1],a.calc=n._module.colorbar.calc),u(),s.push(e)}return s}(t),(function(t){return t._id}));e.enter().append("g").attr("class",(function(t){return t._id})).classed(k.colorbar,!0),e.each((function(e){var r=n.select(this);u.ensureSingle(r,"rect",k.cbbg),u.ensureSingle(r,"g",k.cbfills),u.ensureSingle(r,"g",k.cblines),u.ensureSingle(r,"g",k.cbaxis,(function(t){t.classed(k.crisp,!0)})),u.ensureSingle(r,"g",k.cbtitleunshift,(function(t){t.append("g").classed(k.cbtitle,!0)})),u.ensureSingle(r,"rect",k.cboutline);var m=function(t,e,r){var o=r._fullLayout,l=o._size,d=e._fillcolor,m=e._line,_=e.title,M=_.side,E=e._zrange||n.extent(("function"==typeof d?d:m.color).domain()),S="function"==typeof m.color?m.color:function(){return m.color},C="function"==typeof d?d:function(){return d},L=e._levels,O=function(t,e,r){var n,a,i=e._levels,o=[],s=[],l=i.end+i.size/100,u=i.size,c=1.001*r[0]-.001*r[1],f=1.001*r[1]-.001*r[0];for(a=0;a<1e5&&(n=i.start+a*u,!(u>0?n>=l:n<=l));a++)n>c&&n<f&&o.push(n);if(e._fillgradient)s=[0];else if("function"==typeof e._fillcolor){var d=e._filllevels;if(d)for(l=d.end+d.size/100,u=d.size,a=0;a<1e5&&(n=d.start+a*u,!(u>0?n>=l:n<=l));a++)n>r[0]&&n<r[1]&&s.push(n);else(s=o.map((function(t){return t-i.size/2}))).push(s[s.length-1]+i.size)}else e._fillcolor&&"string"==typeof e._fillcolor&&(s=[0]);i.size<0&&(o.reverse(),s.reverse());return{line:o,fill:s}}(0,e,E),D=O.fill,R=O.line,I=Math.round(e.thickness*("fraction"===e.thicknessmode?l.w:1)),P=I/l.w,F=Math.round(e.len*("fraction"===e.lenmode?l.h:1)),z=F/l.h,N=e.xpad/l.w,B=(e.borderwidth+e.outlinewidth)/2,j=e.ypad/l.h,U=Math.round(e.x*l.w+e.xpad),V=e.x-P*({middle:.5,right:1}[e.xanchor]||0),H=e.y+z*(({top:-.5,bottom:.5}[e.yanchor]||0)-.5),G=Math.round(l.h*(1-H)),q=G-F;e._lenFrac=z,e._thickFrac=P,e._xLeftFrac=V,e._yBottomFrac=H;var X=e._axis=function(t,e,r){var n=t._fullLayout,a={type:"linear",range:r,tickmode:e.tickmode,nticks:e.nticks,tick0:e.tick0,dtick:e.dtick,tickvals:e.tickvals,ticktext:e.ticktext,ticks:e.ticks,ticklen:e.ticklen,tickwidth:e.tickwidth,tickcolor:e.tickcolor,showticklabels:e.showticklabels,ticklabelposition:e.ticklabelposition,tickfont:e.tickfont,tickangle:e.tickangle,tickformat:e.tickformat,exponentformat:e.exponentformat,minexponent:e.minexponent,separatethousands:e.separatethousands,showexponent:e.showexponent,showtickprefix:e.showtickprefix,tickprefix:e.tickprefix,showticksuffix:e.showticksuffix,ticksuffix:e.ticksuffix,title:e.title,showline:!0,anchor:"free",side:"right",position:1},i={type:"linear",_id:"y"+e._id},o={letter:"y",font:n.font,noHover:!0,noTickson:!0,noTicklabelmode:!0,calendar:n.calendar};function s(t,e){return u.coerce(a,i,x,t,e)}return y(a,i,s,o,n),b(a,i,s,o),i}(r,e,E);X.position=e.x+N+P,-1!==["top","bottom"].indexOf(M)&&(X.title.side=M,X.titlex=e.x+N,X.titley=H+("top"===_.side?z-j:j));if(m.color&&"auto"===e.tickmode){X.tickmode="linear",X.tick0=L.start;var W=L.size,Y=u.constrain((G-q)/50,4,15)+1,Z=(E[1]-E[0])/((e.nticks||Y)*W);if(Z>1){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<g-h&&(p=g+(g-h))),h===p&&(h-=.5,p+=.5),f._sync("min",h),f._sync("max",p),f.autocolorscale)&&(o=h*p<0?s.colorscale.diverging:h>=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<t.length;s++){var l=t[s],u=l._module.colorbar;if(u)if(Array.isArray(u))for(var c=0;c<u.length;c++)o(l,u[c]);else o(l,u);a(l,"marker.line")&&o(l,{container:"marker.line",min:"cmin",max:"cmax"})}for(var f in e._colorAxes)o(e[f],{min:"cmin",max:"cmax"})}},{"../../lib":498,"./helpers":379}],378:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib"),i=t("../colorbar/has_colorbar"),o=t("../colorbar/defaults"),s=t("./scales").isValid,l=t("../../registry").traceIs;function u(t,e){var r=e.slice(0,e.length-1);return e?a.nestedProperty(t,r).get()||{}:t}e.exports=function t(e,r,c,f,d){var h=d.prefix,p=d.cLetter,g="_module"in r,v=u(e,h),m=u(r,h),y=u(r._template||{},h)||{},b=function(){return delete e.coloraxis,delete r.coloraxis,t(e,r,c,f,d)};if(g){var x=c._colorAxes||{},_=f(h+"coloraxis");if(_){var w=l(r,"contour")&&a.nestedProperty(r,"contours.coloring").get()||"heatmap",A=x[_];return void(A?(A[2].push(b),A[0]!==w&&(A[0]=!1,a.warn(["Ignoring coloraxis:",_,"setting","as it is linked to incompatible colorscales."].join(" ")))):x[_]=[w,r,[b]])}}var T=v[p+"min"],k=v[p+"max"],M=n(T)&&n(k)&&T<k;f(h+p+"auto",!M)?f(h+p+"mid"):(f(h+p+"min"),f(h+p+"max"));var E,S,C=v.colorscale,L=y.colorscale;(void 0!==C&&(E=!s(C)),void 0!==L&&(E=!s(L)),f(h+"autocolorscale",E),f(h+"colorscale"),f(h+"reversescale"),"marker.line."!==h)&&(h&&g&&(S=i(v)),f(h+"showscale",S)&&(h&&y&&(m._template=y),o(v,m,c)))}},{"../../lib":498,"../../registry":593,"../colorbar/defaults":371,"../colorbar/has_colorbar":373,"./scales":383,"fast-isnumeric":155}],379:[function(t,e,r){"use strict";var n=t("d3"),a=t("tinycolor2"),i=t("fast-isnumeric"),o=t("../../lib"),s=t("../color"),l=t("./scales").isValid;var u=["showscale","autocolorscale","colorscale","reversescale","colorbar"],c=["min","max","mid","auto"];function f(t){var e,r,n,a=t._colorAx,i=a||t,o={};for(r=0;r<u.length;r++)o[n=u[r]]=i[n];if(a)for(e="c",r=0;r<c.length;r++)o[n=c[r]]=i["c"+n];else{var s;for(r=0;r<c.length;r++)((s="c"+(n=c[r]))in i||(s="z"+n)in i)&&(o[n]=i[s]);e=s.charAt(0)}return o._sync=function(t,r){var n=-1!==c.indexOf(t)?e+t:t;i[n]=i["_"+n]=r},o}function d(t){for(var e=f(t),r=e.min,n=e.max,a=e.reversescale?h(e.colorscale):e.colorscale,i=a.length,o=new Array(i),s=new Array(i),l=0;l<i;l++){var u=a[l];o[l]=r+u[0]*(n-r),s[l]=u[1]}return{domain:o,range:s}}function h(t){for(var e=t.length,r=new Array(e),n=e-1,a=0;n>=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;c<l;c++){var f=a(o[c]).toRgb();u[c]=[f.r,f.g,f.b,f.a]}var d,h=n.scale.linear().domain(r).range(u).clamp(!0),p=e.noNumericCheck,v=e.returnArray;return(d=p&&v?h:p?function(t){return g(h(t))}:v?function(t){return i(t)?h(t):a(t).isValid()?t:s.defaultLine}:function(t){return i(t)?g(h(t)):a(t).isValid()?t:s.defaultLine}).domain=h.domain,d.range=function(){return o},d}function g(t){var e={r:t[0],g:t[1],b:t[2],a:t[3]};return a(e).toRgbString()}e.exports={hasColorscale:function(t,e,r){var n=e?o.nestedProperty(t,e).get()||{}:t,a=n[r||"color"],s=!1;if(o.isArrayOrTypedArray(a))for(var u=0;u<a.length;u++)if(i(a[u])){s=!0;break}return o.isPlainObject(n)&&(s||!0===n.showscale||i(n.cmin)&&i(n.cmax)||l(n.colorscale)||o.isPlainObject(n.colorbar))},extractOpts:f,extractScale:d,flipScale:h,makeColorScaleFunc:p,makeColorScaleFuncFromTrace:function(t,e){return p(d(t),e)}}},{"../../lib":498,"../color":368,"./scales":383,d3:86,"fast-isnumeric":155,tinycolor2:322}],380:[function(t,e,r){"use strict";var n=t("./scales"),a=t("./helpers");e.exports={moduleType:"component",name:"colorscale",attributes:t("./attributes"),layoutAttributes:t("./layout_attributes"),supplyLayoutDefaults:t("./layout_defaults"),handleDefaults:t("./defaults"),crossTraceDefaults:t("./cross_trace_defaults"),calc:t("./calc"),scales:n.scales,defaultScale:n.defaultScale,getScale:n.get,isValidScale:n.isValid,hasColorscale:a.hasColorscale,extractOpts:a.extractOpts,extractScale:a.extractScale,flipScale:a.flipScale,makeColorScaleFunc:a.makeColorScaleFunc,makeColorScaleFuncFromTrace:a.makeColorScaleFuncFromTrace}},{"./attributes":375,"./calc":376,"./cross_trace_defaults":377,"./defaults":378,"./helpers":379,"./layout_attributes":381,"./layout_defaults":382,"./scales":383}],381:[function(t,e,r){"use strict";var n=t("../../lib/extend").extendFlat,a=t("./attributes"),i=t("./scales").scales;e.exports={editType:"calc",colorscale:{editType:"calc",sequential:{valType:"colorscale",dflt:i.Reds,editType:"calc"},sequentialminus:{valType:"colorscale",dflt:i.Blues,editType:"calc"},diverging:{valType:"colorscale",dflt:i.RdBu,editType:"calc"}},coloraxis:n({_isSubplotObj:!0,editType:"calc"},a("",{colorAttr:"corresponding trace color array(s)",noColorAxis:!0,showScaleDflt:!0}))}},{"../../lib/extend":490,"./attributes":375,"./scales":383}],382:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../plot_api/plot_template"),i=t("./layout_attributes"),o=t("./defaults");e.exports=function(t,e){function r(r,a){return n.coerce(t,e,i,r,a)}r("colorscale.sequential"),r("colorscale.sequentialminus"),r("colorscale.diverging");var s,l,u=e._colorAxes;function c(t,e){return n.coerce(s,l,i.coloraxis,t,e)}for(var f in u){var d=u[f];if(d[0])s=t[f]||{},(l=a.newContainer(e,f,"coloraxis"))._name=f,o(s,l,e,c,{prefix:"",cLetter:"c"});else{for(var h=0;h<d[2].length;h++)d[2][h]();delete e._colorAxes[f]}}}},{"../../lib":498,"../../plot_api/plot_template":536,"./defaults":378,"./layout_attributes":381}],383:[function(t,e,r){"use strict";var n=t("tinycolor2"),a={Greys:[[0,"rgb(0,0,0)"],[1,"rgb(255,255,255)"]],YlGnBu:[[0,"rgb(8,29,88)"],[.125,"rgb(37,52,148)"],[.25,"rgb(34,94,168)"],[.375,"rgb(29,145,192)"],[.5,"rgb(65,182,196)"],[.625,"rgb(127,205,187)"],[.75,"rgb(199,233,180)"],[.875,"rgb(237,248,217)"],[1,"rgb(255,255,217)"]],Greens:[[0,"rgb(0,68,27)"],[.125,"rgb(0,109,44)"],[.25,"rgb(35,139,69)"],[.375,"rgb(65,171,93)"],[.5,"rgb(116,196,118)"],[.625,"rgb(161,217,155)"],[.75,"rgb(199,233,192)"],[.875,"rgb(229,245,224)"],[1,"rgb(247,252,245)"]],YlOrRd:[[0,"rgb(128,0,38)"],[.125,"rgb(189,0,38)"],[.25,"rgb(227,26,28)"],[.375,"rgb(252,78,42)"],[.5,"rgb(253,141,60)"],[.625,"rgb(254,178,76)"],[.75,"rgb(254,217,118)"],[.875,"rgb(255,237,160)"],[1,"rgb(255,255,204)"]],Bluered:[[0,"rgb(0,0,255)"],[1,"rgb(255,0,0)"]],RdBu:[[0,"rgb(5,10,172)"],[.35,"rgb(106,137,247)"],[.5,"rgb(190,190,190)"],[.6,"rgb(220,170,132)"],[.7,"rgb(230,145,90)"],[1,"rgb(178,10,28)"]],Reds:[[0,"rgb(220,220,220)"],[.2,"rgb(245,195,157)"],[.4,"rgb(245,160,105)"],[1,"rgb(178,10,28)"]],Blues:[[0,"rgb(5,10,172)"],[.35,"rgb(40,60,190)"],[.5,"rgb(70,100,245)"],[.6,"rgb(90,120,245)"],[.7,"rgb(106,137,247)"],[1,"rgb(220,220,220)"]],Picnic:[[0,"rgb(0,0,255)"],[.1,"rgb(51,153,255)"],[.2,"rgb(102,204,255)"],[.3,"rgb(153,204,255)"],[.4,"rgb(204,204,255)"],[.5,"rgb(255,255,255)"],[.6,"rgb(255,204,255)"],[.7,"rgb(255,153,255)"],[.8,"rgb(255,102,204)"],[.9,"rgb(255,102,102)"],[1,"rgb(255,0,0)"]],Rainbow:[[0,"rgb(150,0,90)"],[.125,"rgb(0,0,200)"],[.25,"rgb(0,25,255)"],[.375,"rgb(0,152,255)"],[.5,"rgb(44,255,150)"],[.625,"rgb(151,255,0)"],[.75,"rgb(255,234,0)"],[.875,"rgb(255,111,0)"],[1,"rgb(255,0,0)"]],Portland:[[0,"rgb(12,51,131)"],[.25,"rgb(10,136,186)"],[.5,"rgb(242,211,56)"],[.75,"rgb(242,143,56)"],[1,"rgb(217,30,30)"]],Jet:[[0,"rgb(0,0,131)"],[.125,"rgb(0,60,170)"],[.375,"rgb(5,255,255)"],[.625,"rgb(255,255,0)"],[.875,"rgb(250,0,0)"],[1,"rgb(128,0,0)"]],Hot:[[0,"rgb(0,0,0)"],[.3,"rgb(230,0,0)"],[.6,"rgb(255,210,0)"],[1,"rgb(255,255,255)"]],Blackbody:[[0,"rgb(0,0,0)"],[.2,"rgb(230,0,0)"],[.4,"rgb(230,210,0)"],[.7,"rgb(255,255,255)"],[1,"rgb(160,200,255)"]],Earth:[[0,"rgb(0,0,130)"],[.1,"rgb(0,180,180)"],[.2,"rgb(40,210,40)"],[.4,"rgb(230,230,50)"],[.6,"rgb(120,70,20)"],[1,"rgb(255,255,255)"]],Electric:[[0,"rgb(0,0,0)"],[.15,"rgb(30,0,100)"],[.4,"rgb(120,0,100)"],[.6,"rgb(160,90,0)"],[.8,"rgb(230,200,0)"],[1,"rgb(255,250,220)"]],Viridis:[[0,"#440154"],[.06274509803921569,"#48186a"],[.12549019607843137,"#472d7b"],[.18823529411764706,"#424086"],[.25098039215686274,"#3b528b"],[.3137254901960784,"#33638d"],[.3764705882352941,"#2c728e"],[.4392156862745098,"#26828e"],[.5019607843137255,"#21918c"],[.5647058823529412,"#1fa088"],[.6274509803921569,"#28ae80"],[.6901960784313725,"#3fbc73"],[.7529411764705882,"#5ec962"],[.8156862745098039,"#84d44b"],[.8784313725490196,"#addc30"],[.9411764705882353,"#d8e219"],[1,"#fde725"]],Cividis:[[0,"rgb(0,32,76)"],[.058824,"rgb(0,42,102)"],[.117647,"rgb(0,52,110)"],[.176471,"rgb(39,63,108)"],[.235294,"rgb(60,74,107)"],[.294118,"rgb(76,85,107)"],[.352941,"rgb(91,95,109)"],[.411765,"rgb(104,106,112)"],[.470588,"rgb(117,117,117)"],[.529412,"rgb(131,129,120)"],[.588235,"rgb(146,140,120)"],[.647059,"rgb(161,152,118)"],[.705882,"rgb(176,165,114)"],[.764706,"rgb(192,177,109)"],[.823529,"rgb(209,191,102)"],[.882353,"rgb(225,204,92)"],[.941176,"rgb(243,219,79)"],[1,"rgb(255,233,69)"]]},i=a.RdBu;function o(t){var e=0;if(!Array.isArray(t)||t.length<2)return!1;if(!t[0]||!t[t.length-1])return!1;if(0!=+t[0][0]||1!=+t[t.length-1][0])return!1;for(var r=0;r<t.length;r++){var a=t[r];if(2!==a.length||+a[0]<e||!n(a[1]).isValid())return!1;e=+a[0]}return!0}e.exports={scales:a,defaultScale:i,get:function(t,e){if(e||(e=i),!t)return e;function r(){try{t=a[t]||JSON.parse(t)}catch(r){t=e}}return"string"==typeof t&&(r(),"string"==typeof t&&r()),o(t)?t:e},isValid:function(t){return void 0!==a[t]||o(t)}}},{tinycolor2:322}],384:[function(t,e,r){"use strict";e.exports=function(t,e,r,n,a){var i=(t-r)/(n-r),o=i+e/(n-r),s=(i+o)/2;return"left"===a||"bottom"===a?i:"center"===a||"middle"===a?s:"right"===a||"top"===a?o:i<2/3-s?i:o>4/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)<r&&(t=0),Math.abs(e)<r&&(e=0),[t,e]};function _(i){v._dragged=!1,v._dragging=!0;var o=f(i);e=o[0],r=o[1],p=i.target,h=i,g=2===i.buttons||i.ctrlKey,"undefined"==typeof i.clientX&&"undefined"==typeof i.clientY&&(i.clientX=e,i.clientY=r),(n=(new Date).getTime())-v._mouseDownTime<y?m+=1:(m=1,v._mouseDownTime=n),t.prepFn&&t.prepFn(i,e,r),a&&!g?(d=c()).style.cursor=window.getComputedStyle(b).cursor:a||(d=document,u=window.getComputedStyle(document.documentElement).cursor,document.documentElement.style.cursor=window.getComputedStyle(b).cursor),document.addEventListener("mouseup",A),document.addEventListener("touchend",A),!1!==t.dragmode&&(i.preventDefault(),document.addEventListener("mousemove",w),document.addEventListener("touchmove",w,{passive:!1}))}function w(n){n.preventDefault();var a=f(n),i=t.minDrag||s.MINDRAG,o=x(a[0]-e,a[1]-r,i),u=o[0],c=o[1];(u||c)&&(v._dragged=!0,l.unhover(v)),v._dragged&&t.moveFn&&!g&&(v._dragdata={element:b,dx:u,dy:c},t.moveFn(u,c))}function A(e){if(delete v._dragdata,!1!==t.dragmode&&(e.preventDefault(),document.removeEventListener("mousemove",w),document.removeEventListener("touchmove",w)),document.removeEventListener("mouseup",A),document.removeEventListener("touchend",A),a?o(d):u&&(d.documentElement.style.cursor=u,u=null),v._dragging){if(v._dragging=!1,(new Date).getTime()-v._mouseDownTime>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<c;h++)f.reversed?d[c-1-h]=[T(100*(1-o[h][0])),o[h][1]]:d[h]=[T(100*o[h][0]),o[h][1]];var p=e._fullLayout,g="g"+p._uid+"-"+r,v=p._defs.select(".gradients").selectAll("#"+g).data([a+d.join(";")],u.identity);v.exit().remove(),v.enter().append(f.node).each((function(){var t=n.select(this);f.attrs&&t.attr(f.attrs),t.attr("id",g);var e=t.selectAll("stop").data(d);e.exit().remove(),e.enter().append("stop"),e.each((function(t){var e=i(t[1]);n.select(this).attr({offset:t[0]+"%","stop-color":s.tinyRGB(e),"stop-opacity":e.getAlpha()})}))})),t.style(l,I(g,e)).style(l+"-opacity",null);var m=function(t){return"."+t.attr("class").replace(/\s/g,".")},y=m(n.select(t.node().parentNode))+">"+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;r<i.length;r++)i[r](e,t)}))}},y.tryColorscale=function(t,e){var r=e?u.nestedProperty(t,e).get():t;if(r){var n=r.color;if((r.colorscale||r._colorAx)&&u.isArrayOrTypedArray(n))return l.makeColorScaleFuncFromTrace(r)}return u.identity};var M={start:1,end:-1,middle:0,bottom:1,top:-1};function E(t,e,r,a){var i=n.select(t.node().parentNode),o=-1!==e.indexOf("top")?"top":-1!==e.indexOf("bottom")?"bottom":"middle",s=-1!==e.indexOf("left")?"end":-1!==e.indexOf("right")?"start":"middle",l=a?a/.8+1:0,u=(f.lineCount(t)-1)*h+1,d=M[s]*l,p=.75*r+M[o]*l+(M[o]-1)*u*r/2;t.attr("text-anchor",s),i.attr("transform",c(d,p))}function S(t,e){var r=t.ts||e.textfont.size;return a(r)&&r>0?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<t.length-1;r++)a.push(C(t[r-1],t[r],t[r+1],e));for(n+="Q"+a[0][0]+" "+t[1],r=2;r<t.length-1;r++)n+="C"+a[r-2][1]+" "+a[r-1][0]+" "+t[r];return n+="Q"+a[t.length-3][1]+" "+t[t.length-1]},y.smoothclosed=function(t,e){if(t.length<3)return"M"+t.join("L")+"Z";var r,n="M"+t[0],a=t.length-1,i=[C(t[a],t[0],t[1],e)];for(r=1;r<a;r++)i.push(C(t[r-1],t[r],t[r+1],e));for(i.push(C(t[a-1],t[a],t[0],e)),r=1;r<=a;r++)n+="C"+i[r-1][1]+" "+i[r][0]+" "+t[r];return n+="C"+i[a][1]+" "+i[0][0]+" "+t[0]+"Z"};var L={hv:function(t,e){return"H"+n.round(e[0],2)+"V"+n.round(e[1],2)},vh:function(t,e){return"V"+n.round(e[1],2)+"H"+n.round(e[0],2)},hvh:function(t,e){return"H"+n.round((t[0]+e[0])/2,2)+"V"+n.round(e[1],2)+"H"+n.round(e[0],2)},vhv:function(t,e){return"V"+n.round((t[1]+e[1])/2,2)+"H"+n.round(e[0],2)+"V"+n.round(e[1],2)}},O=function(t,e){return"L"+n.round(e[0],2)+","+n.round(e[1],2)};y.steps=function(t){var e=L[t]||O;return function(t){for(var r="M"+n.round(t[0][0],2)+","+n.round(t[0][1],2),a=1;a<t.length;a++)r+=e(t[a-1],t[a]);return r}},y.makeTester=function(){var t=u.ensureSingleById(n.select("body"),"svg","js-plotly-tester",(function(t){t.attr(d.svgAttrs).style({position:"absolute",left:"-10000px",top:"-10000px",width:"9000px",height:"9000px","z-index":"1"})})),e=u.ensureSingle(t,"path","js-reference-point",(function(t){t.attr("d","M0,0H1V1H0Z").style({"stroke-width":0,fill:"black"})}));y.tester=t,y.testref=e},y.savedBBoxes={};var D=0;function R(t){var e=t.getAttribute("data-unformatted");if(null!==e)return e+t.getAttribute("data-math")+t.getAttribute("text-anchor")+t.getAttribute("style")}function I(t,e){if(!t)return null;var r=e._context;return"url('"+(r._exportedPlot?"":r._baseUrl||"")+"#"+t+"')"}y.bBox=function(t,e,r){var a,i,o;if(r||(r=R(t)),r){if(a=y.savedBBoxes[r])return u.extendFlat({},a)}else if(1===t.childNodes.length){var s=t.childNodes[0];if(r=R(s)){var l=+s.getAttribute("x")||0,c=+s.getAttribute("y")||0,d=s.getAttribute("transform");if(!d){var h=y.bBox(s,!1,r);return l&&(h.left+=l,h.right+=l),c&&(h.top+=c,h.bottom+=c),h}if(r+="~"+l+"~"+c+"~"+d,a=y.savedBBoxes[r])return u.extendFlat({},a)}}e?i=t:(o=y.tester.node(),i=t.cloneNode(!0),o.appendChild(i)),n.select(i).attr("transform",null).call(f.positionText,0,0);var p=i.getBoundingClientRect(),g=y.testref.node().getBoundingClientRect();e||o.removeChild(i);var v={height:p.height,width:p.width,left:p.left-g.left,top:p.top-g.top,right:p.right-g.left,bottom:p.bottom-g.top};return D>=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;f<t.length;f++){var d=t[f],h=d.i;if(void 0===h)h=f;else if(null===h)continue;var p=d[a];if(n(r.c2l(p))){var g=c(p,h);if(n(g[0])&&n(g[1])){var v=d[a+"s"]=p-g[0],m=d[a+"h"]=p+g[1];u.push(v,m)}}}var y=r._id,b=e._extremes[y],x=i.findExtremes(r,u,o.extendFlat({tozero:b.opts.tozero},{padded:!0}));b.min=b.min.concat(x.min),b.max=b.max.concat(x.max)}}e.exports=function(t){for(var e=t.calcdata,r=0;r<e.length;r++){var n=e[r],o=n[0].trace;if(!0===o.visible&&a.traceIs(o,"errorBarsOK")){var s=i.getFromId(t,o.xaxis),u=i.getFromId(t,o.yaxis);l(n,o,s,"x"),l(n,o,u,"y")}}}},{"../../lib":498,"../../plots/cartesian/axes":547,"../../registry":593,"./compute_error":394,"fast-isnumeric":155}],394:[function(t,e,r){"use strict";function n(t,e){return"percent"===t?function(t){return Math.abs(t*e/100)}:"constant"===t?function(){return Math.abs(e)}:"sqrt"===t?function(t){return Math.sqrt(Math.abs(t))}:void 0}e.exports=function(t){var e=t.type,r=t.symmetric;if("data"===e){var a=t.array||[];if(r)return function(t,e){var r=+a[e];return[r,r]};var i=t.arrayminus||[];return function(t,e){var r=+a[e],n=+i[e];return isNaN(r)&&isNaN(n)?[NaN,NaN]:[n||0,r||0]}}var o=n(e,t.value),s=n(e,t.valueminus);return r||void 0===t.valueminus?function(t){var e=o(t);return[e,e]}:function(t){return[s(t),o(t)]}}},{}],395:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../registry"),i=t("../../lib"),o=t("../../plot_api/plot_template"),s=t("./attributes");e.exports=function(t,e,r,l){var u="error_"+l.axis,c=o.newContainer(e,u),f=t[u]||{};function d(t,e){return i.coerce(f,c,s,t,e)}if(!1!==d("visible",void 0!==f.array||void 0!==f.value||"sqrt"===f.type)){var h=d("type","array"in f?"data":"percent"),p=!0;"sqrt"!==h&&(p=d("symmetric",!(("data"===h?"arrayminus":"valueminus")in f))),"data"===h?(d("array"),d("traceref"),p||(d("arrayminus"),d("tracerefminus"))):"percent"!==h&&"constant"!==h||(d("value"),p||d("valueminus"));var g="copy_"+l.inherit+"style";if(l.inherit)(e["error_"+l.inherit]||{}).visible&&d(g,!(f.color||n(f.thickness)||n(f.width)));l.inherit&&c[g]||(d("color",r),d("thickness"),d("width",a.traceIs(e,"gl3d")?0:4))}}},{"../../lib":498,"../../plot_api/plot_template":536,"../../registry":593,"./attributes":392,"fast-isnumeric":155}],396:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../plot_api/edit_types").overrideAll,i=t("./attributes"),o={error_x:n.extendFlat({},i),error_y:n.extendFlat({},i)};delete o.error_x.copy_zstyle,delete o.error_y.copy_zstyle,delete o.error_y.copy_ystyle;var s={error_x:n.extendFlat({},i),error_y:n.extendFlat({},i),error_z:n.extendFlat({},i)};delete s.error_x.copy_ystyle,delete s.error_y.copy_ystyle,delete s.error_z.copy_ystyle,delete s.error_z.copy_zstyle,e.exports={moduleType:"component",name:"errorbars",schema:{traces:{scatter:o,bar:o,histogram:o,scatter3d:a(s,"calc","nested"),scattergl:a(o,"calc","nested")}},supplyDefaults:t("./defaults"),calc:t("./calc"),makeComputeError:t("./compute_error"),plot:t("./plot"),style:t("./style"),hoverInfo:function(t,e,r){(e.error_y||{}).visible&&(r.yerr=t.yh-t.y,e.error_y.symmetric||(r.yerrneg=t.y-t.ys));(e.error_x||{}).visible&&(r.xerr=t.xh-t.x,e.error_x.symmetric||(r.xerrneg=t.x-t.xs))}}},{"../../lib":498,"../../plot_api/edit_types":529,"./attributes":392,"./calc":393,"./compute_error":394,"./defaults":395,"./plot":397,"./style":398}],397:[function(t,e,r){"use strict";var n=t("d3"),a=t("fast-isnumeric"),i=t("../drawing"),o=t("../../traces/scatter/subtypes");e.exports=function(t,e,r,s){var l=r.xaxis,u=r.yaxis,c=s&&s.duration>0;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<e.length;s++){var l=e[s],u=l[0].trace;if(!a.traceIs(u,"pie-like")){var c=a.traceIs(u,"2dMap")?i:n.fillArray;c(u.hoverinfo,l,"hi",o(u)),u.hovertemplate&&c(u.hovertemplate,l,"ht"),u.hoverlabel&&(c(u.hoverlabel.bgcolor,l,"hbg"),c(u.hoverlabel.bordercolor,l,"hbc"),c(u.hoverlabel.font.size,l,"hts"),c(u.hoverlabel.font.color,l,"htc"),c(u.hoverlabel.font.family,l,"htf"),c(u.hoverlabel.namelength,l,"hnl"),c(u.hoverlabel.align,l,"hta"))}}}},{"../../lib":498,"../../registry":593}],401:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("./hover").hover;e.exports=function(t,e,r){var i=n.getComponentMethod("annotations","onClick")(t,t._hoverdata);function o(){t.emit("plotly_click",{points:t._hoverdata,event:e})}void 0!==r&&a(t,e,r,!0),t._hoverdata&&e&&e.target&&(i&&i.then?i.then(o):o(),e.stopImmediatePropagation&&e.stopImmediatePropagation())}},{"../../registry":593,"./hover":405}],402:[function(t,e,r){"use strict";e.exports={YANGLE:60,HOVERARROWSIZE:6,HOVERTEXTPAD:3,HOVERFONTSIZE:13,HOVERFONT:"Arial, sans-serif",HOVERMINTIME:50,HOVERID:"-hover"}},{}],403:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./attributes"),i=t("./hoverlabel_defaults");e.exports=function(t,e,r,o){var s=n.extendFlat({},o.hoverlabel);e.hovertemplate&&(s.namelength=-1),i(t,e,(function(r,i){return n.coerce(t,e,a,r,i)}),s)}},{"../../lib":498,"./attributes":399,"./hoverlabel_defaults":406}],404:[function(t,e,r){"use strict";var n=t("../../lib");r.getSubplot=function(t){return t.subplot||t.xaxis+t.yaxis||t.geo},r.isTraceInSubplots=function(t,e){if("splom"===t.type){for(var n=t.xaxes||[],a=t.yaxes||[],i=0;i<n.length;i++)for(var o=0;o<a.length;o++)if(-1!==e.indexOf(n[i]+a[o]))return!0;return!1}return-1!==e.indexOf(r.getSubplot(t))},r.flat=function(t,e){for(var r=new Array(t.length),n=0;n<t.length;n++)r[n]=e;return r},r.p2c=function(t,e){for(var r=new Array(t.length),n=0;n<t.length;n++)r[n]=t[n].p2c(e);return r},r.getDistanceFunction=function(t,e,n,a){return"closest"===t?a||r.quadrature(e,n):"x"===t.charAt(0)?e:n},r.getClosest=function(t,e,r){if(!1!==r.index)r.index>=0&&r.index<t.length?r.distance=0:r.index=!1;else for(var n=0;n<t.length;n++){var a=e(t[n]);a<=r.distance&&(r.index=n,r.distance=a)}return r},r.inbox=function(t,e,r){return t*e<0||0===t?r:1/0},r.quadrature=function(t,e){return function(r){var n=t(r),a=e(r);return Math.sqrt(n*n+a*a)}},r.makeEventData=function(t,e,n){var a="index"in t?t.index:t.pointNumber,i={data:e._input,fullData:e,curveNumber:e.index,pointNumber:a};if(e._indexToPoints){var o=e._indexToPoints[a];1===o.length?i.pointIndex=o[0]:i.pointIndices=o}else i.pointIndex=a;return e._module.eventData?i=e._module.eventData(i,t,e,n,a):("xVal"in t?i.x=t.xVal:"x"in t&&(i.x=t.x),"yVal"in t?i.y=t.yVal:"y"in t&&(i.y=t.y),t.xa&&(i.xaxis=t.xa),t.ya&&(i.yaxis=t.ya),void 0!==t.zLabelVal&&(i.z=t.zLabelVal)),r.appendArrayPointValue(i,e,a),i},r.appendArrayPointValue=function(t,e,r){var a=e._arrayAttrs;if(a)for(var s=0;s<a.length;s++){var l=a[s],u=i(l);if(void 0===t[u]){var c=o(n.nestedProperty(e,l).get(),r);void 0!==c&&(t[u]=c)}}},r.appendArrayMultiPointValues=function(t,e,r){var a=e._arrayAttrs;if(a)for(var s=0;s<a.length;s++){var l=a[s],u=i(l);if(void 0===t[u]){for(var c=n.nestedProperty(e,l).get(),f=new Array(r.length),d=0;d<r.length;d++)f[d]=o(c,r[d]);t[u]=f}}};var a={ids:"id",locations:"location",labels:"label",values:"value","marker.colors":"color",parents:"parent"};function i(t){return a[t]||t}function o(t,e){return Array.isArray(e)?Array.isArray(t)&&Array.isArray(t[e[0]])?t[e[0]][e[1]]:void 0:t[e]}var s={x:!0,y:!0},l={"x unified":!0,"y unified":!0};r.isUnifiedHover=function(t){return"string"==typeof t&&!!l[t]},r.isXYhover=function(t){return"string"==typeof t&&!!s[t]}},{"../../lib":498}],405:[function(t,e,r){"use strict";var n=t("d3"),a=t("fast-isnumeric"),i=t("tinycolor2"),o=t("../../lib"),s=o.strTranslate,l=o.strRotate,u=t("../../lib/events"),c=t("../../lib/svg_text_utils"),f=t("../../lib/override_cursor"),d=t("../drawing"),h=t("../color"),p=t("../dragelement"),g=t("../../plots/cartesian/axes"),v=t("../../registry"),m=t("./helpers"),y=t("./constants"),b=t("../legend/defaults"),x=t("../legend/draw"),_=y.YANGLE,w=Math.PI*_/180,A=1/Math.sin(w),T=Math.cos(w),k=Math.sin(w),M=y.HOVERARROWSIZE,E=y.HOVERTEXTPAD;function S(t){return[t.trace.index,t.index,t.x0,t.y0,t.name,t.attr,t.xa,t.ya||""].join(",")}r.hover=function(t,e,r,i){t=o.getGraphDiv(t),o.throttle(t._fullLayout._uid+y.HOVERID,y.HOVERMINTIME,(function(){!function(t,e,r,i){r||(r="xy");var s=Array.isArray(r)?r:[r],l=t._fullLayout,c=l._plots||[],d=c[r],g=l._has("cartesian");if(d){var y=d.overlays.map((function(t){return t.id}));s=s.concat(y)}for(var b=s.length,x=new Array(b),_=new Array(b),w=!1,T=0;T<b;T++){var k=s[T];if(c[k])w=!0,x[T]=c[k].xaxis,_[T]=c[k].yaxis;else{if(!l[k]||!l[k]._subplot)return void o.warn("Unrecognized subplot: "+k);var M=l[k]._subplot;x[T]=M.xaxis,_[T]=M.yaxis}}var E=e.hovermode||l.hovermode;E&&!w&&(E="closest");if(-1===["x","y","closest","x unified","y unified"].indexOf(E)||!t.calcdata||t.querySelector(".zoombox")||t._dragging)return p.unhoverRaw(t,e);var C,O,F,z,N,B,j,U,V,H,G,q,X,W=-1===l.hoverdistance?1/0:l.hoverdistance,Y=-1===l.spikedistance?1/0:l.spikedistance,Z=[],J=[],Q={hLinePoint:null,vLinePoint:null},$=!1;if(Array.isArray(e))for(E="array",F=0;F<e.length;F++)(N=t.calcdata[e[F].curveNumber||0])&&(B=N[0].trace,"skip"!==N[0].trace.hoverinfo&&(J.push(N),"h"===B.orientation&&($=!0)));else{for(z=0;z<t.calcdata.length;z++)N=t.calcdata[z],"skip"!==(B=N[0].trace).hoverinfo&&m.isTraceInSubplots(B,s)&&(J.push(N),"h"===B.orientation&&($=!0));var K,tt;if(!e.target)K="xpx"in e?e.xpx:x[0]._length/2,tt="ypx"in e?e.ypx:_[0]._length/2;else{if(!1===u.triggerHandler(t,"plotly_beforehover",e))return;var et=e.target.getBoundingClientRect();K=e.clientX-et.left,tt=e.clientY-et.top,l._calcInverseTransform(t);var rt=o.apply3DTransform(l._invTransform)(K,tt);if(K=rt[0],tt=rt[1],K<0||K>x[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;z<J.length;z++)if((N=J[z])&&N[0]&&N[0].trace&&!0===(B=N[0].trace).visible&&0!==B._length&&-1===["carpet","contourcarpet"].indexOf(B._module.name)){if("splom"===B.type?j=s[U=0]:(j=m.getSubplot(B),U=s.indexOf(j)),V=E,m.isUnifiedHover(V)&&(V=V.charAt(0)),q={cd:N,trace:B,xa:x[U],ya:_[U],maxHoverDistance:W,maxSpikeDistance:Y,index:!1,distance:Math.min(nt,W),spikeDistance:1/0,xSpike:void 0,ySpike:void 0,color:h.defaultLine,name:B.name,x0:void 0,x1:void 0,y0:void 0,y1:void 0,xLabelVal:void 0,yLabelVal:void 0,zLabelVal:void 0,text:void 0},l[j]&&(q.subplot=l[j]._subplot),l._splomScenes&&l._splomScenes[B.uid]&&(q.scene=l._splomScenes[B.uid]),X=Z.length,"array"===V){var n=e[z];"pointNumber"in n?(q.index=n.pointNumber,V="closest"):(V="","xval"in n&&(H=n.xval,V="x"),"yval"in n&&(G=n.yval,V=V?"closest":"y"))}else void 0!==t&&void 0!==r?(H=t,G=r):(H=C[U],G=O[U]);if(0!==W)if(B._module&&B._module.hoverPoints){var i=B._module.hoverPoints(q,H,G,V,l._hoverlayer);if(i)for(var u,c=0;c<i.length;c++)u=i[c],a(u.x0)&&a(u.y0)&&Z.push(R(u,E))}else o.log("Unrecognized trace type in hover:",B);if("closest"===E&&Z.length>X&&(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;i<t.length;i++)(r=t[i].spikeDistance)<=a&&r<=e&&(n=t[i],a=r);return n}function ot(t){return t?{xa:t.xa,ya:t.ya,x:void 0!==t.xSpike?t.xSpike:(t.x0+t.x1)/2,y:void 0!==t.ySpike?t.ySpike:(t.y0+t.y1)/2,distance:t.distance,spikeDistance:t.spikeDistance,curveNumber:t.trace.index,color:t.color,pointNumber:t.index}:null}at();var st={fullLayout:l,container:l._hoverlayer,outerContainer:l._paperdiv,event:e},lt=t._spikepoints,ut={vLinePoint:Q.vLinePoint,hLinePoint:Q.hLinePoint};if(t._spikepoints=ut,g&&0!==Y&&0!==Z.length){var ct=it(Z.filter((function(t){return t.ya.showspikes})),Y);Q.hLinePoint=ot(ct);var ft=it(Z.filter((function(t){return t.xa.showspikes})),Y);Q.vLinePoint=ot(ft)}if(0===Z.length){var dt=p.unhoverRaw(t,e);return!g||null===Q.hLinePoint&&null===Q.vLinePoint||P(lt)&&I(t,Q,st),dt}g&&P(lt)&&I(t,Q,st);if(Z.sort((function(t,e){return t.distance-e.distance})),m.isXYhover(V)&&0!==Z[0].length&&"splom"!==Z[0].trace.type){var ht=Z[0],pt=ht.cd[ht.index],gt="group"===l.boxmode||"group"===l.violinmode,vt=ht.xVal,mt=ht.xa;"category"===mt.type&&(vt=mt._categoriesMap[vt]),"date"===mt.type&&(vt=mt.d2c(vt)),pt&&pt.t&&pt.t.posLetter===mt._id&&gt&&(vt+=pt.t.dPos);var yt=ht.yVal;"category"===(mt=ht.ya).type&&(yt=mt._categoriesMap[yt]),"date"===mt.type&&(yt=mt.d2c(yt)),pt&&pt.t&&pt.t.posLetter===mt._id&&gt&&(yt+=pt.t.dPos),at(vt,yt);var bt={};Z=Z.filter((function(t){var e=S(t);if(!bt[e])return bt[e]=!0,bt[e]}))}var xt=t._hoverdata,_t=[];for(F=0;F<Z.length;F++){var wt=Z[F],At=m.makeEventData(wt,wt.trace,wt.cd);if(!1!==wt.hovertemplate){var Tt=!1;wt.cd[wt.index]&&wt.cd[wt.index].ht&&(Tt=wt.cd[wt.index].ht),wt.hovertemplate=Tt||wt.trace.hovertemplate||!1}wt.eventData=[At],_t.push(At)}t._hoverdata=_t;var kt="y"===E&&(J.length>1||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;o<t.length;o++)(l=t[o]).pos+l.dp+l.size>e.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<t.length&&!(u<=0);o++)if((l=t[o]).pos<e.pmin+1)for(l.del=!0,u--,i=2*l.size,s=t.length-1;s>=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<h.length-1;){var v=h[o],m=h[o+1],y=v[v.length-1],b=m[0];if((a=y.pos+y.dp+y.size-b.pos-b.dp+b.size)>.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<u?u-n+5:0,u=n+t.by+t.offset,r===e.anchorIndex&&(c=t.offset)})).each((function(t){t.offset-=c}));var f=e.gd._fullLayout._invScaleX,d=e.gd._fullLayout._invScaleY;return D(l,s.rotateLabels,f,d),r?l:l.node()};var C=/<extra>([\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;B<t.length;B++)if(U&&void 0===t[B].zLabel&&(U=!1),j=t[B].hoverinfo||t[B].trace.hoverinfo){var V=Array.isArray(j)?j:j.split("+");if(-1===V.indexOf("all")&&-1===V.indexOf(i)){N=!1;break}}U&&(N=!1)}var H=p.selectAll("g.axistext").data(N?[0]:[]);function G(t){return t.filter((function(t){return void 0!==t.zLabelVal||(t[L]||"").split(" ")[0]===R}))}if(H.enter().append("g").classed("axistext",!0),H.exit().remove(),H.each((function(){var e=n.select(this),l=o.ensureSingle(e,"path","",(function(t){t.style({"stroke-width":"1px"})})),u=o.ensureSingle(e,"text","",(function(t){t.attr("data-notex",1)})),f=v.bgcolor||h.defaultLine,p=v.bordercolor||h.contrast(f),g=h.contrast(f),m={family:v.font.family||w,size:v.font.size||A,color:v.font.color||g};l.style({fill:f,stroke:p}),u.text(D).call(d.font,m).call(c.positionText,0,0).call(c.convertToTspans,r),e.attr("transform","");var y,b,x=u.node().getBoundingClientRect();if("x"===i){var _="top"===k.side?"-":"";u.attr("text-anchor","middle").call(c.positionText,0,"top"===k.side?P-x.bottom-M-E:P-x.top+M+E),y=k._offset+(T.x0+T.x1)/2,b=C._offset+("top"===k.side?0:C._length);var S=x.width/2+E;y<S?(y=S,l.attr("d","M-"+(S-M)+",0L-"+(S-2*M)+","+_+M+"H"+(E+x.width/2)+"v"+_+(2*E+x.height)+"H-"+S+"V"+_+M+"Z")):y>a.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<x.width+2*E+M){I="M-"+(M+E)+"-"+F+"h-"+(x.width-E)+"V"+F+"h"+(x.width-E)+"Z";var B=x.width-y+E;c.positionText(u,B,z),"end"===L&&u.selectAll("tspan").each((function(){var t=n.select(this),e=d.tester.append("text").text(t.text()).call(d.font,m),r=e.node().getBoundingClientRect();Math.round(r.width)<Math.round(x.width)&&t.attr("x",B-r.width),e.remove()}))}else c.positionText(u,O*(E+M),z),I=null;var j=a._topclips.selectAll("#"+N).data(I?[0]:[]);j.enter().append("clipPath").attr("id",N).append("path"),j.exit().remove(),j.select("path").attr("d",I),d.setClipUrl(u,I?N:null,r)}e.attr("transform",s(y,b)),t=G(t)})),m.isUnifiedHover(i)){if(p.selectAll("g.hovertext").remove(),void 0!==D&&T.distance<=e.hoverdistance&&(t=G(t)),0===t.length)return;var q={showlegend:!0,legend:{title:{text:D,font:a.hoverlabel.font},font:a.hoverlabel.font,bgcolor:a.hoverlabel.bgcolor,bordercolor:a.hoverlabel.bordercolor,borderwidth:1,tracegroupgap:7,traceorder:a.legend?a.legend.traceorder:void 0,orientation:"v"}},X={};b(q,X,r._fullData);var W=X.legend;W.entries=[];for(var Y=0;Y<t.length;Y++){var Z=O(t[Y],!0,i,a,D),J=Z[0],Q=Z[1],$=t[Y];$.name=Q,$.text=""!==Q?Q+" : "+J:J;var K=$.cd[$.index];K&&(K.mc&&($.mc=K.mc),K.mcc&&($.mc=K.mcc),K.mlc&&($.mlc=K.mlc),K.mlcc&&($.mlc=K.mlcc),K.mlw&&($.mlw=K.mlw),K.mrc&&($.mrc=K.mrc),K.dir&&($.dir=K.dir)),$._distinct=!0,W.entries.push([$])}W.entries.sort((function(t,e){return t[0].trace.index-e[0].trace.index})),W.layer=p,x(r,W);var tt=o.mean(t.map((function(t){return(t.y0+t.y1)/2}))),et=o.mean(t.map((function(t){return(t.x0+t.x1)/2}))),rt=p.select("g.legend"),nt=rt.node().getBoundingClientRect();et+=k._offset,tt+=C._offset-nt.height/2;var at=nt.width+2*E;!(et+at<=F)&&et-at>=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+"<br>"),void 0!==t.yLabel&&(l+="y: "+t.yLabel+"<br>"),"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?"<br>":"")+t.text),void 0!==t.extraText&&(l+=(l?"<br>":"")+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;n<t.length;n++){var a=t[n],i=a.xaxis+a.yaxis,o=(r[i]||{})[a.stackgroup]||{};if("h"!==a.orientation&&"h"!==o.orientation)return!1}return!0}(r,e),o=e._isHoriz?"y":"x"):o="closest",i("hovermode",o)}},{"../../lib":498,"./layout_attributes":409}],408:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../lib"),i=t("../dragelement"),o=t("./helpers"),s=t("./layout_attributes"),l=t("./hover");e.exports={moduleType:"component",name:"fx",constants:t("./constants"),schema:{layout:s},attributes:t("./attributes"),layoutAttributes:s,supplyLayoutGlobalDefaults:t("./layout_global_defaults"),supplyDefaults:t("./defaults"),supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc"),getDistanceFunction:o.getDistanceFunction,getClosest:o.getClosest,inbox:o.inbox,quadrature:o.quadrature,appendArrayPointValue:o.appendArrayPointValue,castHoverOption:function(t,e,r){return a.castOption(t,e,"hoverlabel."+r)},castHoverinfo:function(t,e,r){return a.castOption(t,r,"hoverinfo",(function(r){return a.coerceHoverinfo({hoverinfo:r},{_module:t._module},e)}))},hover:l.hover,unhover:i.unhover,loneHover:l.loneHover,loneUnhover:function(t){var e=a.isD3Selection(t)?t:n.select(t);e.selectAll("g.hovertext").remove(),e.selectAll(".spikeline").remove()},click:t("./click")}},{"../../lib":498,"../dragelement":387,"./attributes":399,"./calc":400,"./click":401,"./constants":402,"./defaults":403,"./helpers":404,"./hover":405,"./layout_attributes":409,"./layout_defaults":410,"./layout_global_defaults":411,d3:86}],409:[function(t,e,r){"use strict";var n=t("./constants"),a=t("../../plots/font_attributes")({editType:"none"});a.family.dflt=n.HOVERFONT,a.size.dflt=n.HOVERFONTSIZE,e.exports={clickmode:{valType:"flaglist",flags:["event","select"],dflt:"event",editType:"plot",extras:["none"]},dragmode:{valType:"enumerated",values:["zoom","pan","select","lasso","drawclosedpath","drawopenpath","drawline","drawrect","drawcircle","orbit","turntable",!1],dflt:"zoom",editType:"modebar"},hovermode:{valType:"enumerated",values:["x","y","closest",!1,"x unified","y unified"],editType:"modebar"},hoverdistance:{valType:"integer",min:-1,dflt:20,editType:"none"},spikedistance:{valType:"integer",min:-1,dflt:20,editType:"none"},hoverlabel:{bgcolor:{valType:"color",editType:"none"},bordercolor:{valType:"color",editType:"none"},font:a,align:{valType:"enumerated",values:["left","right","auto"],dflt:"auto",editType:"none"},namelength:{valType:"integer",min:-1,dflt:15,editType:"none"},editType:"none"},selectdirection:{valType:"enumerated",values:["h","v","d","any"],dflt:"any",editType:"none"}}},{"../../plots/font_attributes":575,"./constants":402}],410:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./helpers").isUnifiedHover,i=t("./layout_attributes"),o=t("./hovermode_defaults"),s=t("./hoverlabel_defaults");e.exports=function(t,e,r){function l(r,a){return n.coerce(t,e,i,r,a)}var u=o(t,e,r);u&&(l("hoverdistance"),l("spikedistance",a(u)?-1:void 0)),"select"===l("dragmode")&&l("selectdirection");var c=e._has("mapbox"),f=e._has("geo"),d=e._basePlotModules.length;"zoom"===e.dragmode&&((c||f)&&1===d||c&&f&&2===d)&&(e.dragmode="pan"),s(t,e,l)}},{"../../lib":498,"./helpers":404,"./hoverlabel_defaults":406,"./hovermode_defaults":407,"./layout_attributes":409}],411:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./hoverlabel_defaults"),i=t("./layout_attributes");e.exports=function(t,e){a(t,e,(function(r,a){return n.coerce(t,e,i,r,a)}))}},{"../../lib":498,"./hoverlabel_defaults":406,"./layout_attributes":409}],412:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../lib/regex").counter,i=t("../../plots/domain").attributes,o=t("../../plots/cartesian/constants").idRegex,s=t("../../plot_api/plot_template"),l={rows:{valType:"integer",min:1,editType:"plot"},roworder:{valType:"enumerated",values:["top to bottom","bottom to top"],dflt:"top to bottom",editType:"plot"},columns:{valType:"integer",min:1,editType:"plot"},subplots:{valType:"info_array",freeLength:!0,dimensions:2,items:{valType:"enumerated",values:[a("xy").toString(),""],editType:"plot"},editType:"plot"},xaxes:{valType:"info_array",freeLength:!0,items:{valType:"enumerated",values:[o.x.toString(),""],editType:"plot"},editType:"plot"},yaxes:{valType:"info_array",freeLength:!0,items:{valType:"enumerated",values:[o.y.toString(),""],editType:"plot"},editType:"plot"},pattern:{valType:"enumerated",values:["independent","coupled"],dflt:"coupled",editType:"plot"},xgap:{valType:"number",min:0,max:1,editType:"plot"},ygap:{valType:"number",min:0,max:1,editType:"plot"},domain:i({name:"grid",editType:"plot",noGridCell:!0},{}),xside:{valType:"enumerated",values:["bottom","bottom plot","top plot","top"],dflt:"bottom plot",editType:"plot"},yside:{valType:"enumerated",values:["left","left plot","right plot","right"],dflt:"left plot",editType:"plot"},editType:"plot"};function u(t,e,r){var n=e[r+"axes"],a=Object.keys((t._splomAxes||{})[r]||{});return Array.isArray(n)?n:a.length?a:void 0}function c(t,e,r,n,a,i){var o=e(t+"gap",r),s=e("domain."+t);e(t+"side",n);for(var l=new Array(a),u=s[0],c=(s[1]-u)/(a-o),f=c*(1-o),d=0;d<a;d++){var h=u+c*d;l[i?a-1-d:d]=[h,h+f]}return l}function f(t,e,r,n,a){var i,o=new Array(r);function s(t,r){-1!==e.indexOf(r)&&void 0===n[r]?(o[t]=r,n[r]=t):o[t]=""}if(Array.isArray(t))for(i=0;i<r;i++)s(i,t[i]);else for(s(0,a),i=1;i<r;i++)s(i,a+(i+1));return o}e.exports={moduleType:"component",name:"grid",schema:{layout:{grid:l}},layoutAttributes:l,sizeDefaults:function(t,e){var r=t.grid||{},a=u(e,r,"x"),i=u(e,r,"y");if(t.grid||a||i){var o,f,d=Array.isArray(r.subplots)&&Array.isArray(r.subplots[0]),h=Array.isArray(a),p=Array.isArray(i),g=h&&a!==r.xaxes&&p&&i!==r.yaxes;d?(o=r.subplots.length,f=r.subplots[0].length):(p&&(o=i.length),h&&(f=a.length));var v=s.newContainer(e,"grid"),m=T("rows",o),y=T("columns",f);if(m*y>1){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;n<g;n++){var _=l[n]=new Array(v),w=b[n]||[];for(a=0;a<v;a++)if(m?(s=1===x?"xy":"x"+x+"y"+x,x++):s=w[a],_[a]="",-1!==h.cartesian.indexOf(s)){if(c=s.indexOf("y"),i=s.slice(0,c),o=s.slice(c),void 0!==y[i]&&y[i]!==a||void 0!==y[o]&&y[o]!==n)continue;_[a]=s,y[i]=a,y[o]=n}}}else{var A=u(e,d,"x"),T=u(e,d,"y");r.xaxes=f(A,h.xaxis,v,y,"x"),r.yaxes=f(T,h.yaxis,g,y,"y")}var k=r._anchors={},M="top to bottom"===r.roworder;for(var E in y){var S,C,L,O=E.charAt(0),D=r[O+"side"];if(D.length<8)k[E]="free";else if("x"===O){if("t"===D.charAt(0)===M?(S=0,C=1,L=g):(S=g-1,C=-1,L=-1),p){var R=y[E];for(n=S;n!==L;n+=C)if((s=l[n][R])&&(c=s.indexOf("y"),s.slice(0,c)===E)){k[E]=s.slice(c);break}}else for(n=S;n!==L;n+=C)if(o=r.yaxes[n],-1!==h.cartesian.indexOf(E+o)){k[E]=o;break}}else if("l"===D.charAt(0)?(S=0,C=1,L=v):(S=v-1,C=-1,L=-1),p){var I=y[E];for(n=S;n!==L;n+=C)if((s=l[I][n])&&(c=s.indexOf("y"),s.slice(c)===E)){k[E]=s.slice(0,c);break}}else for(n=S;n!==L;n+=C)if(i=r.xaxes[n],-1!==h.cartesian.indexOf(i+E)){k[E]=i;break}}}}}},{"../../lib":498,"../../lib/regex":515,"../../plot_api/plot_template":536,"../../plots/cartesian/constants":553,"../../plots/domain":574}],413:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/constants"),a=t("../../plot_api/plot_template").templatedArray;t("../../constants/axis_placeable_objects");e.exports=a("image",{visible:{valType:"boolean",dflt:!0,editType:"arraydraw"},source:{valType:"string",editType:"arraydraw"},layer:{valType:"enumerated",values:["below","above"],dflt:"above",editType:"arraydraw"},sizex:{valType:"number",dflt:0,editType:"arraydraw"},sizey:{valType:"number",dflt:0,editType:"arraydraw"},sizing:{valType:"enumerated",values:["fill","contain","stretch"],dflt:"contain",editType:"arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},x:{valType:"any",dflt:0,editType:"arraydraw"},y:{valType:"any",dflt:0,editType:"arraydraw"},xanchor:{valType:"enumerated",values:["left","center","right"],dflt:"left",editType:"arraydraw"},yanchor:{valType:"enumerated",values:["top","middle","bottom"],dflt:"top",editType:"arraydraw"},xref:{valType:"enumerated",values:["paper",n.idRegex.x.toString()],dflt:"paper",editType:"arraydraw"},yref:{valType:"enumerated",values:["paper",n.idRegex.y.toString()],dflt:"paper",editType:"arraydraw"},editType:"arraydraw"})},{"../../constants/axis_placeable_objects":471,"../../plot_api/plot_template":536,"../../plots/cartesian/constants":553}],414:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib/to_log_range");e.exports=function(t,e,r,i){e=e||{};var o="log"===r&&"linear"===e.type,s="linear"===r&&"log"===e.type;if(o||s)for(var l,u,c=t._fullLayout.images,f=e._id.charAt(0),d=0;d<c.length;d++)if(u="images["+d+"].",(l=c[d])[f+"ref"]===e._id){var h=l[f],p=l["size"+f],g=null,v=null;if(o){g=a(h,e.range);var m=p/Math.pow(10,g)/2;v=2*Math.log(m+Math.sqrt(1+m*m))/Math.LN10}else v=(g=Math.pow(10,h))*(Math.pow(10,p/2)-Math.pow(10,-p/2));n(g)?n(v)||(v=null):(g=null,v=null),i(u+f,g),i(u+"size"+f,v)}}},{"../../lib/to_log_range":525,"fast-isnumeric":155}],415:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../plots/cartesian/axes"),i=t("../../plots/array_container_defaults"),o=t("./attributes");function s(t,e,r){function i(r,a){return n.coerce(t,e,o,r,a)}var s=i("source");if(!i("visible",!!s))return e;i("layer"),i("xanchor"),i("yanchor"),i("sizex"),i("sizey"),i("sizing"),i("opacity");for(var l={_fullLayout:r},u=["x","y"],c=0;c<2;c++){var f=u[c],d=a.coerceRef(t,e,l,f,"paper",void 0);if("paper"!==d)a.getFromId(l,d)._imgIndices.push(e._index);a.coercePosition(e,l,i,d,f,0)}return e}e.exports=function(t,e){i(t,e,{name:"images",handleItemDefaults:s})}},{"../../lib":498,"../../plots/array_container_defaults":542,"../../plots/cartesian/axes":547,"./attributes":413}],416:[function(t,e,r){"use strict";var n=t("d3"),a=t("../drawing"),i=t("../../plots/cartesian/axes"),o=t("../../plots/cartesian/axis_ids"),s=t("../../constants/xmlns_namespaces");e.exports=function(t){var e,r,l=t._fullLayout,u=[],c={},f=[];for(r=0;r<l.images.length;r++){var d=l.images[r];if(d.visible)if("below"===d.layer&&"paper"!==d.xref&&"paper"!==d.yref){e=o.ref2id(d.xref)+o.ref2id(d.yref);var h=l._plots[e];if(!h){f.push(d);continue}h.mainplot&&(e=h.mainplot.id),c[e]||(c[e]=[]),c[e].push(d)}else"above"===d.layer?u.push(d):f.push(d)}var p={left:{sizing:"xMin",offset:0},center:{sizing:"xMid",offset:-.5},right:{sizing:"xMax",offset:-1}},g={top:{sizing:"YMin",offset:0},middle:{sizing:"YMid",offset:-.5},bottom:{sizing:"YMax",offset:-1}};function v(e){var r=n.select(this);if(this._imgSrc!==e.source)if(r.attr("xmlns",s.svg),e.source&&"data:"===e.source.slice(0,5))r.attr("xlink:href",e.source),this._imgSrc=e.source;else{var a=new Promise(function(t){var n=new Image;function a(){r.remove(),t()}this.img=n,n.setAttribute("crossOrigin","anonymous"),n.onerror=a,n.onload=function(){var e=document.createElement("canvas");e.width=this.width,e.height=this.height,e.getContext("2d").drawImage(this,0,0);var n=e.toDataURL("image/png");r.attr("xlink:href",n),t()},r.on("error",a),n.src=e.source,this._imgSrc=e.source}.bind(this));t._promises.push(a)}}function m(e){var r,o,s=n.select(this),u=i.getFromId(t,e.xref),c=i.getFromId(t,e.yref),f="domain"===i.getRefType(e.xref),d="domain"===i.getRefType(e.yref),h=l._size;r=void 0!==u?"string"==typeof e.xref&&f?u._length*e.sizex:Math.abs(u.l2p(e.sizex)-u.l2p(0)):e.sizex*h.w,o=void 0!==c?"string"==typeof e.yref&&d?c._length*e.sizey:Math.abs(c.l2p(e.sizey)-c.l2p(0)):e.sizey*h.h;var v,m,y=r*p[e.xanchor].offset,b=o*g[e.yanchor].offset,x=p[e.xanchor].sizing+g[e.yanchor].sizing;switch(v=void 0!==u?"string"==typeof e.xref&&f?u._length*e.x+u._offset:u.r2p(e.x)+u._offset:e.x*h.w+h.l,v+=y,m=void 0!==c?"string"==typeof e.yref&&d?c._length*(1-e.y)+c._offset:c.r2p(e.y)+c._offset:h.h-e.y*h.h+h.t,m+=b,e.sizing){case"fill":x+=" slice";break;case"stretch":x="none"}s.attr({x:v,y:m,width:r,height:o,preserveAspectRatio:x,opacity:e.opacity});var _=(u&&"domain"!==i.getRefType(e.xref)?u._id:"")+(c&&"domain"!==i.getRefType(e.yref)?c._id:"");a.setClipUrl(s,_?"clip"+l._uid+_:null,t)}var y=l._imageLowerLayer.selectAll("image").data(f),b=l._imageUpperLayer.selectAll("image").data(u);y.enter().append("image"),b.enter().append("image"),y.exit().remove(),b.exit().remove(),y.each((function(t){v.bind(this)(t),m.bind(this)(t)})),b.each((function(t){v.bind(this)(t),m.bind(this)(t)}));var x=Object.keys(l._plots);for(r=0;r<x.length;r++){e=x[r];var _=l._plots[e];if(_.imagelayer){var w=_.imagelayer.selectAll("image").data(c[e]||[]);w.enter().append("image"),w.exit().remove(),w.each((function(t){v.bind(this)(t),m.bind(this)(t)}))}}}},{"../../constants/xmlns_namespaces":476,"../../plots/cartesian/axes":547,"../../plots/cartesian/axis_ids":550,"../drawing":390,d3:86}],417:[function(t,e,r){"use strict";e.exports={moduleType:"component",name:"images",layoutAttributes:t("./attributes"),supplyLayoutDefaults:t("./defaults"),includeBasePlot:t("../../plots/cartesian/include_components")("images"),draw:t("./draw"),convertCoords:t("./convert_coords")}},{"../../plots/cartesian/include_components":559,"./attributes":413,"./convert_coords":414,"./defaults":415,"./draw":416}],418:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),a=t("../color/attributes");e.exports={bgcolor:{valType:"color",editType:"legend"},bordercolor:{valType:"color",dflt:a.defaultLine,editType:"legend"},borderwidth:{valType:"number",min:0,dflt:0,editType:"legend"},font:n({editType:"legend"}),orientation:{valType:"enumerated",values:["v","h"],dflt:"v",editType:"legend"},traceorder:{valType:"flaglist",flags:["reversed","grouped"],extras:["normal"],editType:"legend"},tracegroupgap:{valType:"number",min:0,dflt:10,editType:"legend"},itemsizing:{valType:"enumerated",values:["trace","constant"],dflt:"trace",editType:"legend"},itemwidth:{valType:"number",min:30,dflt:30,editType:"legend"},itemclick:{valType:"enumerated",values:["toggle","toggleothers",!1],dflt:"toggle",editType:"legend"},itemdoubleclick:{valType:"enumerated",values:["toggle","toggleothers",!1],dflt:"toggleothers",editType:"legend"},x:{valType:"number",min:-2,max:3,editType:"legend"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left",editType:"legend"},y:{valType:"number",min:-2,max:3,editType:"legend"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],editType:"legend"},uirevision:{valType:"any",editType:"none"},valign:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle",editType:"legend"},title:{text:{valType:"string",dflt:"",editType:"legend"},font:n({editType:"legend"}),side:{valType:"enumerated",values:["top","left","top left"],editType:"legend"},editType:"legend"},editType:"legend"}},{"../../plots/font_attributes":575,"../color/attributes":367}],419:[function(t,e,r){"use strict";e.exports={scrollBarWidth:6,scrollBarMinHeight:20,scrollBarColor:"#808BA4",scrollBarMargin:4,scrollBarEnterAttrs:{rx:20,ry:3,width:0,height:0},titlePad:2,itemGap:5}},{}],420:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../lib"),i=t("../../plot_api/plot_template"),o=t("./attributes"),s=t("../../plots/layout_attributes"),l=t("./helpers");e.exports=function(t,e,r){for(var u=t.legend||{},c=0,f=!1,d="normal",h=0;h<r.length;h++){var p=r[h];p.visible&&((p.showlegend||p._dfltShowLegend&&!(p._module&&p._module.attributes&&p._module.attributes.showlegend&&!1===p._module.attributes.showlegend.dflt))&&(c++,p.showlegend&&(f=!0,(n.traceIs(p,"pie-like")||!0===p._input.showlegend)&&c++)),(n.traceIs(p,"bar")&&"stack"===e.barmode||-1!==["tonextx","tonexty"].indexOf(p.fill))&&(d=l.isGrouped({traceorder:d})?"grouped+reversed":"reversed"),void 0!==p.legendgroup&&""!==p.legendgroup&&(d=l.isReversed({traceorder:d})?"reversed+grouped":"grouped"))}var g=a.coerce(t,e,s,"showlegend",f&&c>1);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._legendMouseDownTime<i?o+=1:(o=1,e._legendMouseDownTime=r)})),s.on("mouseup",(function(){if(!e._dragged&&!e._editing){var r=e._fullLayout.legend;(new Date).getTime()-e._legendMouseDownTime>i&&(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,z=0,N=0,B=0,j=0;r.each((function(t){var e=t[0].height,r=p+t[0].width,n=(F?r:C)+d;n+c+N-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;r<t.length;r++){var p=t[r],g=p[0],v=g.trace,m=v.legendgroup;if(!d||v.visible&&v.showlegend)if(n.traceIs(v,"pie-like"))for(u[m]||(u[m]={}),i=0;i<p.length;i++){var y=p[i].label;u[m][y]||(h(m,{label:y,color:p[i].color,i:p[i].i,trace:v,pts:p[i].pts}),u[m][y]=!0,f=Math.max(f,(y||"").length))}else h(m,g),f=Math.max(f,(v.name||"").length)}if(!s.length)return[];var b,x,_=s.length;if(l&&a.isGrouped(e))for(x=new Array(_),r=0;r<_;r++)b=o[s[r]],x[r]=a.isReversed(e)?b.reverse():b;else{for(x=[new Array(_)],r=0;r<_;r++)b=o[s[r]][0],x[0][a.isReversed(e)?_-r-1:r]=b;_=1}return e._lgroupsLength=_,e._maxNameLength=f,x}},{"../../registry":593,"./helpers":424}],423:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../registry"),i=!0;e.exports=function(t,e,r){var o=e._fullLayout;if(!e._dragged&&!e._editing){var s,l=o.legend.itemclick,u=o.legend.itemdoubleclick;if(1===r&&"toggle"===l&&"toggleothers"===u&&i&&e.data&&e._context.showTips?(n.notifier(n._(e,"Double-click on legend to isolate one trace"),"long"),i=!1):i=!1,1===r?s=l:2===r&&(s=u),s){var c,f,d,h,p,g=o.hiddenlabels?o.hiddenlabels.slice():[],v=t.data()[0][0],m=e._fullData,y=v.trace,b=y.legendgroup,x={},_=[],w=[],A=[];if(a.traceIs(y,"pie-like")){var T=v.label,k=g.indexOf(T);"toggle"===s?-1===k?g.push(T):g.splice(k,1):"toggleothers"===s&&(g=[],e.calcdata[0].forEach((function(t){T!==t.label&&g.push(t.label)})),e._fullLayout.hiddenlabels&&e._fullLayout.hiddenlabels.length===g.length&&-1===k&&(g=[])),a.call("_guiRelayout",e,"hiddenlabels",g)}else{var M,E=b&&b.length,S=[];if(E)for(c=0;c<m.length;c++)(M=m[c]).visible&&M.legendgroup===b&&S.push(c);if("toggle"===s){var C;switch(y.visible){case!0:C="legendonly";break;case!1:C=!1;break;case"legendonly":C=!0}if(E)for(c=0;c<m.length;c++)!1!==m[c].visible&&m[c].legendgroup===b&&N(m[c],C);else N(y,C)}else if("toggleothers"===s){var L,O,D,R,I=!0;for(c=0;c<m.length;c++)if(L=m[c]===y,D=!0!==m[c].showlegend,!(L||D||(O=E&&m[c].legendgroup===b)||!0!==m[c].visible||a.traceIs(m[c],"notLegendIsolatable"))){I=!1;break}for(c=0;c<m.length;c++)if(!1!==m[c].visible&&!a.traceIs(m[c],"notLegendIsolatable"))switch(y.visible){case"legendonly":N(m[c],!0);break;case!0:R=!!I||"legendonly",L=m[c]===y,D=!0!==m[c].showlegend&&!m[c].legendgroup,O=L||E&&m[c].legendgroup===b,N(m[c],!(!O&&!D)||R)}}for(c=0;c<w.length;c++)if(d=w[c]){var P=d.constructUpdate(),F=Object.keys(P);for(f=0;f<F.length;f++)h=F[f],(x[h]=x[h]||[])[A[c]]=P[h]}for(p=Object.keys(x),c=0;c<p.length;c++)for(h=p[c],f=0;f<_.length;f++)x[h].hasOwnProperty(f)||(x[h][f]=void 0);a.call("_guiRestyle",e,x,_)}}}function z(t,e,r){var n=_.indexOf(t),a=x[e];return a||(a=x[e]=[]),-1===_.indexOf(t)&&(_.push(t),n=_.length-1),a[n]=r,n}function N(t,e){var r=t._fullInput;if(a.hasTransform(r,"groupby")){var i=w[r.index];if(!i){var o=a.getTransformIndices(r,"groupby"),s=o[o.length-1];i=n.keyedContainer(r,"transforms["+s+"].styles","target","value.visible"),w[r.index]=i}var l=i.get(t._group);void 0===l&&(l=!0),!1!==l&&i.set(t._group,e),A[r.index]=z(r.index,"visible",!1!==r.visible)}else{var u=!1!==r.visible&&e;z(r.index,"visible",u)}}}},{"../../lib":498,"../../registry":593}],424:[function(t,e,r){"use strict";r.isGrouped=function(t){return-1!==(t.traceorder||"").indexOf("grouped")},r.isVertical=function(t){return"h"!==t.orientation},r.isReversed=function(t){return-1!==(t.traceorder||"").indexOf("reversed")}},{}],425:[function(t,e,r){"use strict";e.exports={moduleType:"component",name:"legend",layoutAttributes:t("./attributes"),supplyLayoutDefaults:t("./defaults"),draw:t("./draw"),style:t("./style")}},{"./attributes":418,"./defaults":420,"./draw":421,"./style":426}],426:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../registry"),i=t("../../lib"),o=i.strTranslate,s=t("../drawing"),l=t("../color"),u=t("../colorscale/helpers").extractOpts,c=t("../../traces/scatter/subtypes"),f=t("../../traces/pie/style_one"),d=t("../../traces/pie/helpers").castOption,h=t("./constants");function p(t,e){return(e?"radial":"horizontal")+(t?"":"reversed")}e.exports=function(t,e,r){var g=e._fullLayout;r||(r=g.legend);var v="constant"===r.itemsizing,m=r.itemwidth,y=(m+2*h.itemGap)/2,b=o(y,0),x=function(t,e,r,n){var a;if(t+1)a=t;else{if(!(e&&e.width>0))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(o<r[0])return r[0];if(o>r[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;a<f.length;a++)if(!(r=f[a]).fixedrange)if(h=r._name,"auto"===l)c[h+".autorange"]=!0;else if("reset"===l){if(void 0===r._rangeInitial)c[h+".autorange"]=!0;else{var m=r._rangeInitial.slice();c[h+".range[0]"]=m[0],c[h+".range[1]"]=m[1]}void 0!==r._showSpikeInitial&&(c[h+".showspikes"]=r._showSpikeInitial,"on"!==d||r._showSpikeInitial||(d="off"))}else{var y=[r.r2l(r.range[0]),r.r2l(r.range[1])],b=[g*y[0]+v*y[1],g*y[1]+v*y[0]];c[h+".range[0]"]=r.l2r(b[0]),c[h+".range[1]"]=r.l2r(b[1])}}else"hovermode"!==s||"x"!==l&&"y"!==l||(l=u._isHoriz?"y":"x",o.setAttribute("data-val",l)),c[s]=l;u._cartesianSpikesEnabled=d,n.call("_guiRelayout",t,c)}function d(t,e){for(var r=e.currentTarget,a=r.getAttribute("data-attr"),i=r.getAttribute("data-val")||!0,o=t._fullLayout._subplots.gl3d||[],s={},l=a.split("."),u=0;u<o.length;u++)s[o[u]+"."+l[1]]=i;var c="pan"===i?i:"zoom";s.dragmode=c,n.call("_guiRelayout",t,s)}function h(t,e){for(var r=e.currentTarget.getAttribute("data-attr"),a="resetLastSave"===r,i="resetDefault"===r,o=t._fullLayout,s=o._subplots.gl3d||[],l={},u=0;u<s.length;u++){var c,f=s[u],d=f+".camera",h=f+".aspectratio",p=f+".aspectmode",g=o[f]._scene;a?(l[d+".up"]=g.viewInitial.up,l[d+".eye"]=g.viewInitial.eye,l[d+".center"]=g.viewInitial.center,c=!0):i&&(l[d+".up"]=null,l[d+".eye"]=null,l[d+".center"]=null,c=!0),c&&(l[h+".x"]=g.viewInitial.aspectratio.x,l[h+".y"]=g.viewInitial.aspectratio.y,l[h+".z"]=g.viewInitial.aspectratio.z,l[p]=g.viewInitial.aspectmode)}n.call("_guiRelayout",t,l)}function p(t,e){var r=e.currentTarget,n=r._previousVal,a=t._fullLayout,i=a._subplots.gl3d||[],o=["xaxis","yaxis","zaxis"],s={},l={};if(n)l=n,r._previousVal=null;else{for(var u=0;u<i.length;u++){var c=i[u],f=a[c],d=c+".hovermode";s[d]=f.hovermode,l[d]=!1;for(var h=0;h<3;h++){var p=o[h],g=c+"."+p+".showspikes";l[g]=!1,s[g]=f[p].showspikes}}r._previousVal=s}return l}function g(t,e){for(var r=e.currentTarget,a=r.getAttribute("data-attr"),i=r.getAttribute("data-val")||!0,o=t._fullLayout,s=o._subplots.geo||[],l=0;l<s.length;l++){var u=s[l],c=o[u];if("zoom"===a){var f=c.projection.scale,d="in"===i?2*f:.5*f;n.call("_guiRelayout",t,u+".projection.scale",d)}}"reset"===a&&b(t,"geo")}function v(t){var e=t._fullLayout;return!e.hovermode&&(e._has("cartesian")?e._isHoriz?"y":"x":"closest")}function m(t){var e=v(t);n.call("_guiRelayout",t,"hovermode",e)}function y(t,e){for(var r=e.currentTarget.getAttribute("data-val"),a=t._fullLayout,i=a._subplots.mapbox||[],o={},s=0;s<i.length;s++){var l=i[s],u=a[l].zoom,c="in"===r?1.05*u:u/1.05;o[l+".zoom"]=c}n.call("_guiRelayout",t,o)}function b(t,e){for(var r=t._fullLayout,a=r._subplots[e]||[],i={},o=0;o<a.length;o++)for(var s=a[o],l=r[s]._subplot.viewInitial,u=Object.keys(l),c=0;c<u.length;c++){var f=u[c];i[s+"."+f]=l[f]}n.call("_guiRelayout",t,i)}c.toImage={name:"toImage",title:function(t){var e=(t._context.toImageButtonOptions||{}).format||"png";return u(t,"png"===e?"Download plot as a png":"Download plot")},icon:o.camera,click:function(t){var e=t._context.toImageButtonOptions,r={format:e.format||"png"};l.notifier(u(t,"Taking snapshot - this may take a few seconds"),"long"),"svg"!==r.format&&l.isIE()&&(l.notifier(u(t,"IE only supports svg. Changing format to svg."),"long"),r.format="svg"),["filename","width","height","scale"].forEach((function(t){t in e&&(r[t]=e[t])})),n.call("downloadImage",t,r).then((function(e){l.notifier(u(t,"Snapshot succeeded")+" - "+e,"long")})).catch((function(){l.notifier(u(t,"Sorry, there was a problem downloading your snapshot!"),"long")}))}},c.sendDataToCloud={name:"sendDataToCloud",title:function(t){return u(t,"Edit in Chart Studio")},icon:o.disk,click:function(t){a.sendDataToCloud(t)}},c.editInChartStudio={name:"editInChartStudio",title:function(t){return u(t,"Edit in Chart Studio")},icon:o.pencil,click:function(t){a.sendDataToCloud(t)}},c.zoom2d={name:"zoom2d",title:function(t){return u(t,"Zoom")},attr:"dragmode",val:"zoom",icon:o.zoombox,click:f},c.pan2d={name:"pan2d",title:function(t){return u(t,"Pan")},attr:"dragmode",val:"pan",icon:o.pan,click:f},c.select2d={name:"select2d",title:function(t){return u(t,"Box Select")},attr:"dragmode",val:"select",icon:o.selectbox,click:f},c.lasso2d={name:"lasso2d",title:function(t){return u(t,"Lasso Select")},attr:"dragmode",val:"lasso",icon:o.lasso,click:f},c.drawclosedpath={name:"drawclosedpath",title:function(t){return u(t,"Draw closed freeform")},attr:"dragmode",val:"drawclosedpath",icon:o.drawclosedpath,click:f},c.drawopenpath={name:"drawopenpath",title:function(t){return u(t,"Draw open freeform")},attr:"dragmode",val:"drawopenpath",icon:o.drawopenpath,click:f},c.drawline={name:"drawline",title:function(t){return u(t,"Draw line")},attr:"dragmode",val:"drawline",icon:o.drawline,click:f},c.drawrect={name:"drawrect",title:function(t){return u(t,"Draw rectangle")},attr:"dragmode",val:"drawrect",icon:o.drawrect,click:f},c.drawcircle={name:"drawcircle",title:function(t){return u(t,"Draw circle")},attr:"dragmode",val:"drawcircle",icon:o.drawcircle,click:f},c.eraseshape={name:"eraseshape",title:function(t){return u(t,"Erase active shape")},icon:o.eraseshape,click:s},c.zoomIn2d={name:"zoomIn2d",title:function(t){return u(t,"Zoom in")},attr:"zoom",val:"in",icon:o.zoom_plus,click:f},c.zoomOut2d={name:"zoomOut2d",title:function(t){return u(t,"Zoom out")},attr:"zoom",val:"out",icon:o.zoom_minus,click:f},c.autoScale2d={name:"autoScale2d",title:function(t){return u(t,"Autoscale")},attr:"zoom",val:"auto",icon:o.autoscale,click:f},c.resetScale2d={name:"resetScale2d",title:function(t){return u(t,"Reset axes")},attr:"zoom",val:"reset",icon:o.home,click:f},c.hoverClosestCartesian={name:"hoverClosestCartesian",title:function(t){return u(t,"Show closest data on hover")},attr:"hovermode",val:"closest",icon:o.tooltip_basic,gravity:"ne",click:f},c.hoverCompareCartesian={name:"hoverCompareCartesian",title:function(t){return u(t,"Compare data on hover")},attr:"hovermode",val:function(t){return t._fullLayout._isHoriz?"y":"x"},icon:o.tooltip_compare,gravity:"ne",click:f},c.zoom3d={name:"zoom3d",title:function(t){return u(t,"Zoom")},attr:"scene.dragmode",val:"zoom",icon:o.zoombox,click:d},c.pan3d={name:"pan3d",title:function(t){return u(t,"Pan")},attr:"scene.dragmode",val:"pan",icon:o.pan,click:d},c.orbitRotation={name:"orbitRotation",title:function(t){return u(t,"Orbital rotation")},attr:"scene.dragmode",val:"orbit",icon:o["3d_rotate"],click:d},c.tableRotation={name:"tableRotation",title:function(t){return u(t,"Turntable rotation")},attr:"scene.dragmode",val:"turntable",icon:o["z-axis"],click:d},c.resetCameraDefault3d={name:"resetCameraDefault3d",title:function(t){return u(t,"Reset camera to default")},attr:"resetDefault",icon:o.home,click:h},c.resetCameraLastSave3d={name:"resetCameraLastSave3d",title:function(t){return u(t,"Reset camera to last save")},attr:"resetLastSave",icon:o.movie,click:h},c.hoverClosest3d={name:"hoverClosest3d",title:function(t){return u(t,"Toggle show closest data on hover")},attr:"hovermode",val:null,toggle:!0,icon:o.tooltip_basic,gravity:"ne",click:function(t,e){var r=p(t,e);n.call("_guiRelayout",t,r)}},c.zoomInGeo={name:"zoomInGeo",title:function(t){return u(t,"Zoom in")},attr:"zoom",val:"in",icon:o.zoom_plus,click:g},c.zoomOutGeo={name:"zoomOutGeo",title:function(t){return u(t,"Zoom out")},attr:"zoom",val:"out",icon:o.zoom_minus,click:g},c.resetGeo={name:"resetGeo",title:function(t){return u(t,"Reset")},attr:"reset",val:null,icon:o.autoscale,click:g},c.hoverClosestGeo={name:"hoverClosestGeo",title:function(t){return u(t,"Toggle show closest data on hover")},attr:"hovermode",val:null,toggle:!0,icon:o.tooltip_basic,gravity:"ne",click:m},c.hoverClosestGl2d={name:"hoverClosestGl2d",title:function(t){return u(t,"Toggle show closest data on hover")},attr:"hovermode",val:null,toggle:!0,icon:o.tooltip_basic,gravity:"ne",click:m},c.hoverClosestPie={name:"hoverClosestPie",title:function(t){return u(t,"Toggle show closest data on hover")},attr:"hovermode",val:"closest",icon:o.tooltip_basic,gravity:"ne",click:m},c.resetViewSankey={name:"resetSankeyGroup",title:function(t){return u(t,"Reset view")},icon:o.home,click:function(t){for(var e={"node.groups":[],"node.x":[],"node.y":[]},r=0;r<t._fullData.length;r++){var a=t._fullData[r]._viewInitial;e["node.groups"].push(a.node.groups.slice()),e["node.x"].push(a.node.x.slice()),e["node.y"].push(a.node.y.slice())}n.call("restyle",t,e)}},c.toggleHover={name:"toggleHover",title:function(t){return u(t,"Toggle show closest data on hover")},attr:"hovermode",val:null,toggle:!0,icon:o.tooltip_basic,gravity:"ne",click:function(t,e){var r=p(t,e);r.hovermode=v(t),n.call("_guiRelayout",t,r)}},c.resetViews={name:"resetViews",title:function(t){return u(t,"Reset views")},icon:o.home,click:function(t,e){var r=e.currentTarget;r.setAttribute("data-attr","zoom"),r.setAttribute("data-val","reset"),f(t,e),r.setAttribute("data-attr","resetLastSave"),h(t,e),b(t,"geo"),b(t,"mapbox")}},c.toggleSpikelines={name:"toggleSpikelines",title:function(t){return u(t,"Toggle Spike Lines")},icon:o.spikeline,attr:"_cartesianSpikesEnabled",val:"on",click:function(t){var e=t._fullLayout,r=e._cartesianSpikesEnabled;e._cartesianSpikesEnabled="on"===r?"off":"on",n.call("_guiRelayout",t,function(t){for(var e="on"===t._fullLayout._cartesianSpikesEnabled,r=i.list(t,null,!0),n={},a=0;a<r.length;a++){var o=r[a];n[o._name+".showspikes"]=!!e||o._showSpikeInitial}return n}(t))}},c.resetViewMapbox={name:"resetViewMapbox",title:function(t){return u(t,"Reset view")},attr:"reset",icon:o.home,click:function(t){b(t,"mapbox")}},c.zoomInMapbox={name:"zoomInMapbox",title:function(t){return u(t,"Zoom in")},attr:"zoom",val:"in",icon:o.zoom_plus,click:y},c.zoomOutMapbox={name:"zoomOutMapbox",title:function(t){return u(t,"Zoom out")},attr:"zoom",val:"out",icon:o.zoom_minus,click:y}},{"../../fonts/ploticon":479,"../../lib":498,"../../plots/cartesian/axis_ids":550,"../../plots/plots":585,"../../registry":593,"../shapes/draw":449}],428:[function(t,e,r){"use strict";r.manage=t("./manage")},{"./manage":429}],429:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axis_ids"),a=t("../../traces/scatter/subtypes"),i=t("../../registry"),o=t("../fx/helpers").isUnifiedHover,s=t("./modebar"),l=t("./buttons");e.exports=function(t){var e=t._fullLayout,r=t._context,c=e._modeBar;if(r.displayModeBar||r.watermark){if(!Array.isArray(r.modeBarButtonsToRemove))throw new Error(["*modeBarButtonsToRemove* configuration options","must be an array."].join(" "));if(!Array.isArray(r.modeBarButtonsToAdd))throw new Error(["*modeBarButtonsToAdd* configuration options","must be an array."].join(" "));var f,d=r.modeBarButtons;f=Array.isArray(d)&&d.length?function(t){for(var e=0;e<t.length;e++)for(var r=t[e],n=0;n<r.length;n++){var a=r[n];if("string"==typeof a){if(void 0===l[a])throw new Error(["*modeBarButtons* configuration options","invalid button name"].join(" "));t[e][n]=l[a]}}return t}(d):!r.displayModeBar&&r.watermark?[]:function(t){var e=t._fullLayout,r=t._fullData,s=t._context,c=s.modeBarButtonsToRemove,f=s.modeBarButtonsToAdd,d=e._has("cartesian"),h=e._has("gl3d"),p=e._has("geo"),g=e._has("pie"),v=e._has("funnelarea"),m=e._has("gl2d"),y=e._has("ternary"),b=e._has("mapbox"),x=e._has("polar"),_=e._has("sankey"),w=function(t){for(var e=n.list({_fullLayout:t},null,!0),r=0;r<e.length;r++)if(!e[r].fixedrange)return!1;return!0}(e),A=o(e.hovermode),T=[];function k(t){if(t.length){for(var e=[],r=0;r<t.length;r++){var n=t[r];-1===c.indexOf(n)&&e.push(l[n])}T.push(e)}}var M=["toImage"];s.showEditInChartStudio?M.push("editInChartStudio"):s.showSendToCloud&&M.push("sendDataToCloud");k(M);var E=[],S=[],C=[],L=[];(d||m||g||v||y)+p+h+b+x>1?(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;e<t.length;e++)if(!i.traceIs(t[e],"noHover"))return!1;return!0}(r)||A)&&(S=[]);!d&&!m||w||(E=["zoomIn2d","zoomOut2d","autoScale2d"],"resetViews"!==C[0]&&(C=["resetScale2d"]));h?L=["zoom3d","pan3d","orbitRotation","tableRotation"]:(d||m)&&!w||y?L=["zoom2d","pan2d"]:b||p?L=["pan2d"]:x&&(L=["zoom2d"]);(function(t){for(var e=!1,r=0;r<t.length&&!e;r++){var n=t[r];n._module&&n._module.selectPoints&&(i.traceIs(n,"scatter-like")?(a.hasMarkers(n)||a.hasText(n))&&(e=!0):i.traceIs(n,"box-violin")&&"all"!==n.boxpoints&&"all"!==n.points||(e=!0))}return e})(r)&&L.push("select2d","lasso2d");if(Array.isArray(f)){for(var O=[],D=0;D<f.length;D++){var R=f[D];"string"==typeof R?-1!==u.indexOf(R)&&(e._has("mapbox")||e._has("cartesian"))&&L.push(R):O.push(R)}f=O}return k(L),k(E.concat(C)),k(S),function(t,e){if(e.length)if(Array.isArray(e[0]))for(var r=0;r<e.length;r++)t.push(e[r]);else t.push(e);return t}(T,f)}(t),c?c.update(t,f):e._modeBar=s(t,f)}else c&&(c.destroy(),delete e._modeBar)};var u=["drawline","drawopenpath","drawclosedpath","drawcircle","drawrect","eraseshape"]},{"../../plots/cartesian/axis_ids":550,"../../registry":593,"../../traces/scatter/subtypes":679,"../fx/helpers":404,"./buttons":427,"./modebar":430}],430:[function(t,e,r){"use strict";var n=t("d3"),a=t("fast-isnumeric"),i=t("../../lib"),o=t("../../fonts/ploticon"),s=new DOMParser;function l(t){this.container=t.container,this.element=document.createElement("div"),this.update(t.graphInfo,t.buttons),this.container.appendChild(this.element)}var u=l.prototype;u.update=function(t,e){this.graphInfo=t;var r=this.graphInfo._context,n=this.graphInfo._fullLayout,a="modebar-"+n._uid;this.element.setAttribute("id",a),this._uid=a,this.element.className="modebar","hover"===r.displayModeBar&&(this.element.className+=" modebar--hover ease-bg"),"v"===n.modebar.orientation&&(this.element.className+=" vertical",e=e.reverse());var o=n.modebar,s="hover"===r.displayModeBar?".js-plotly-plot .plotly:hover ":"";i.deleteRelatedStyleRule(a),i.addRelatedStyleRule(a,s+"#"+a+" .modebar-group","background-color: "+o.bgcolor),i.addRelatedStyleRule(a,"#"+a+" .modebar-btn .icon path","fill: "+o.color),i.addRelatedStyleRule(a,"#"+a+" .modebar-btn:hover .icon path","fill: "+o.activecolor),i.addRelatedStyleRule(a,"#"+a+" .modebar-btn.active .icon path","fill: "+o.activecolor);var l=!this.hasButtons(e),u=this.hasLogo!==r.displaylogo,c=this.locale!==r.locale;if(this.locale=r.locale,(l||u||c)&&(this.removeAllButtons(),this.updateButtons(e),r.watermark||r.displaylogo)){var f=this.getLogo();r.watermark&&(f.className=f.className+" watermark"),"v"===n.modebar.orientation?this.element.insertBefore(f,this.element.childNodes[0]):this.element.appendChild(f),this.hasLogo=!0}this.updateActiveButton()},u.updateButtons=function(t){var e=this;this.buttons=t,this.buttonElements=[],this.buttonsNames=[],this.buttons.forEach((function(t){var r=e.createGroup();t.forEach((function(t){var n=t.name;if(!n)throw new Error("must provide button 'name' in button config");if(-1!==e.buttonsNames.indexOf(n))throw new Error("button name '"+n+"' is taken");e.buttonsNames.push(n);var a=e.createButton(t);e.buttonElements.push(a),r.appendChild(a)})),e.element.appendChild(r)}))},u.createGroup=function(){var t=document.createElement("div");return t.className="modebar-group",t},u.createButton=function(t){var e=this,r=document.createElement("a");r.setAttribute("rel","tooltip"),r.className="modebar-btn";var a=t.title;void 0===a?a=t.name:"function"==typeof a&&(a=a(this.graphInfo)),(a||0===a)&&r.setAttribute("data-title",a),void 0!==t.attr&&r.setAttribute("data-attr",t.attr);var i=t.val;if(void 0!==i&&("function"==typeof i&&(i=i(this.graphInfo)),r.setAttribute("data-val",i)),"function"!=typeof t.click)throw new Error("must provide button 'click' function in button config");r.addEventListener("click",(function(r){t.click(e.graphInfo,r),e.updateActiveButton(r.currentTarget)})),r.setAttribute("data-toggle",t.toggle||!1),t.toggle&&n.select(r).classed("active",!0);var s=t.icon;return"function"==typeof s?r.appendChild(s()):r.appendChild(this.createIcon(s||o.question)),r.setAttribute("data-gravity",t.gravity||"n"),r},u.createIcon=function(t){var e,r=a(t.height)?Number(t.height):t.ascent-t.descent,n="http://www.w3.org/2000/svg";if(t.path){(e=document.createElementNS(n,"svg")).setAttribute("viewBox",[0,0,t.width,r].join(" ")),e.setAttribute("class","icon");var i=document.createElementNS(n,"path");i.setAttribute("d",t.path),t.transform?i.setAttribute("transform",t.transform):void 0!==t.ascent&&i.setAttribute("transform","matrix(1 0 0 -1 0 "+t.ascent+")"),e.appendChild(i)}t.svg&&(e=s.parseFromString(t.svg,"application/xml").childNodes[0]);return e.setAttribute("height","1em"),e.setAttribute("width","1em"),e},u.updateActiveButton=function(t){var e=this.graphInfo._fullLayout,r=void 0!==t?t.getAttribute("data-attr"):null;this.buttonElements.forEach((function(t){var a=t.getAttribute("data-val")||!0,o=t.getAttribute("data-attr"),s="true"===t.getAttribute("data-toggle"),l=n.select(t);if(s)o===r&&l.classed("active",!l.classed("active"));else{var u=null===o?o:i.nestedProperty(e,o).get();l.classed("active",u===a)}}))},u.hasButtons=function(t){var e=this.buttons;if(!e)return!1;if(t.length!==e.length)return!1;for(var r=0;r<t.length;++r){if(t[r].length!==e[r].length)return!1;for(var n=0;n<t[r].length;n++)if(t[r][n].name!==e[r][n].name)return!1}return!0},u.getLogo=function(){var t=this.createGroup(),e=document.createElement("a");return e.href="https://plotly.com/",e.target="_blank",e.setAttribute("data-title",i._(this.graphInfo,"Produced with Plotly")),e.className="modebar-btn plotlyjsicon modebar-btn--logo",e.appendChild(this.createIcon(o.newplotlylogo)),t.appendChild(e),t},u.removeAllButtons=function(){for(;this.element.firstChild;)this.element.removeChild(this.element.firstChild);this.hasLogo=!1},u.destroy=function(){i.removeElement(this.container.querySelector(".modebar")),i.deleteRelatedStyleRule(this._uid)},e.exports=function(t,e){var r=t._fullLayout,a=new l({graphInfo:t,container:r._modebardiv.node(),buttons:e});return r._privateplot&&n.select(a.element).append("span").classed("badge-private float--left",!0).text("PRIVATE"),a}},{"../../fonts/ploticon":479,"../../lib":498,d3:86,"fast-isnumeric":155}],431:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),a=t("../color/attributes"),i=(0,t("../../plot_api/plot_template").templatedArray)("button",{visible:{valType:"boolean",dflt:!0,editType:"plot"},step:{valType:"enumerated",values:["month","year","day","hour","minute","second","all"],dflt:"month",editType:"plot"},stepmode:{valType:"enumerated",values:["backward","todate"],dflt:"backward",editType:"plot"},count:{valType:"number",min:0,dflt:1,editType:"plot"},label:{valType:"string",editType:"plot"},editType:"plot"});e.exports={visible:{valType:"boolean",editType:"plot"},buttons:i,x:{valType:"number",min:-2,max:3,editType:"plot"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left",editType:"plot"},y:{valType:"number",min:-2,max:3,editType:"plot"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"bottom",editType:"plot"},font:n({editType:"plot"}),bgcolor:{valType:"color",dflt:a.lightLine,editType:"plot"},activecolor:{valType:"color",editType:"plot"},bordercolor:{valType:"color",dflt:a.defaultLine,editType:"plot"},borderwidth:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"plot"}},{"../../plot_api/plot_template":536,"../../plots/font_attributes":575,"../color/attributes":367}],432:[function(t,e,r){"use strict";e.exports={yPad:.02,minButtonWidth:30,rx:3,ry:3,lightAmount:25,darkAmount:10}},{}],433:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../color"),i=t("../../plot_api/plot_template"),o=t("../../plots/array_container_defaults"),s=t("./attributes"),l=t("./constants");function u(t,e,r,a){var i=a.calendar;function o(r,a){return n.coerce(t,e,s.buttons,r,a)}if(o("visible")){var l=o("step");"all"!==l&&(!i||"gregorian"===i||"month"!==l&&"year"!==l?o("stepmode"):e.stepmode="backward",o("count")),o("label")}}e.exports=function(t,e,r,c,f){var d=t.rangeselector||{},h=i.newContainer(e,"rangeselector");function p(t,e){return n.coerce(d,h,s,t,e)}if(p("visible",o(d,h,{name:"buttons",handleItemDefaults:u,calendar:f}).length>0)){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.length;i++){var o=e[n[i]].domain;o&&(a=Math.max(o[1],a))}return[t.domain[0],a+l.yPad]}(e,r,c);p("x",g[0]),p("y",g[1]),n.noneOrAll(t,e,["x","y"]),p("xanchor"),p("yanchor"),n.coerceFont(p,"font",r.font);var v=p("bgcolor");p("activecolor",a.contrast(v,l.lightAmount,l.darkAmount)),p("bordercolor"),p("borderwidth")}}},{"../../lib":498,"../../plot_api/plot_template":536,"../../plots/array_container_defaults":542,"../color":368,"./attributes":431,"./constants":432}],434:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../registry"),i=t("../../plots/plots"),o=t("../color"),s=t("../drawing"),l=t("../../lib"),u=l.strTranslate,c=t("../../lib/svg_text_utils"),f=t("../../plots/cartesian/axis_ids"),d=t("../../constants/alignment"),h=d.LINE_SPACING,p=d.FROM_TL,g=d.FROM_BR,v=t("./constants"),m=t("./get_update_object");function y(t){return t._id}function b(t,e,r){var n=l.ensureSingle(t,"rect","selector-rect",(function(t){t.attr("shape-rendering","crispEdges")}));n.attr({rx:v.rx,ry:v.ry}),n.call(o.stroke,e.bordercolor).call(o.fill,function(t,e){return e._isActive||e._isHovered?t.activecolor:t.bgcolor}(e,r)).style("stroke-width",e.borderwidth+"px")}function x(t,e,r,n){l.ensureSingle(t,"text","selector-text",(function(t){t.attr("text-anchor","middle")})).call(s.font,e.font).text(function(t,e){if(t.label)return e?l.templateString(t.label,e):t.label;return"all"===t.step?"all":t.count+t.step.charAt(0)}(r,n._fullLayout._meta)).call((function(t){c.convertToTspans(t,n)}))}e.exports=function(t){var e=t._fullLayout._infolayer.selectAll(".rangeselector").data(function(t){for(var e=f.list(t,"x",!0),r=[],n=0;n<e.length;n++){var a=e[n];a.rangeselector&&a.rangeselector.visible&&r.push(a)}return r}(t),y);e.enter().append("g").classed("rangeselector",!0),e.exit().remove(),e.style({cursor:"pointer","pointer-events":"all"}),e.each((function(e){var r=n.select(this),o=e,f=o.rangeselector,d=r.selectAll("g.button").data(l.filterVisible(f.buttons));d.enter().append("g").classed("button",!0),d.exit().remove(),d.each((function(e){var r=n.select(this),i=m(o,e);e._isActive=function(t,e,r){if("all"===e.step)return!0===t.autorange;var n=Object.keys(r);return t.range[0]===r[n[0]]&&t.range[1]===r[n[1]]}(o,e,i),r.call(b,f,e),r.call(x,f,e,t),r.on("click",(function(){t._dragged||a.call("_guiRelayout",t,i)})),r.on("mouseover",(function(){e._isHovered=!0,r.call(b,f,e)})),r.on("mouseout",(function(){e._isHovered=!1,r.call(b,f,e)}))})),function(t,e,r,a,o){var f=0,d=0,m=r.borderwidth;e.each((function(){var t=n.select(this).select(".selector-text"),e=r.font.size*h,a=Math.max(e*c.lineCount(t),16)+3;d=Math.max(d,a)})),e.each((function(){var t=n.select(this),e=t.select(".selector-rect"),a=t.select(".selector-text"),i=a.node()&&s.bBox(a.node()).width,o=r.font.size*h,l=c.lineCount(a),p=Math.max(i+10,v.minButtonWidth);t.attr("transform",u(m+f,m)),e.attr({x:0,y:0,width:p,height:d}),c.positionText(a,p/2,d/2-(l-1)*o/2+3),f+=p+5}));var y=t._fullLayout._size,b=y.l+y.w*r.x,x=y.t+y.h*(1-r.y),_="left";l.isRightAnchor(r)&&(b-=f,_="right");l.isCenterAnchor(r)&&(b-=f/2,_="center");var w="top";l.isBottomAnchor(r)&&(x-=d,w="bottom");l.isMiddleAnchor(r)&&(x-=d/2,w="middle");f=Math.ceil(f),d=Math.ceil(d),b=Math.round(b),x=Math.round(x),i.autoMargin(t,a+"-range-selector",{x:r.x,y:r.y,l:f*p[_],r:f*g[_],b:d*g[w],t:d*p[w]}),o.attr("transform",u(b,x))}(t,d,f,o._name,r)}))}},{"../../constants/alignment":470,"../../lib":498,"../../lib/svg_text_utils":523,"../../plots/cartesian/axis_ids":550,"../../plots/plots":585,"../../registry":593,"../color":368,"../drawing":390,"./constants":432,"./get_update_object":435,d3:86}],435:[function(t,e,r){"use strict";var n=t("d3");e.exports=function(t,e){var r=t._name,a={};if("all"===e.step)a[r+".autorange"]=!0;else{var i=function(t,e){var r,a=t.range,i=new Date(t.r2l(a[1])),o=e.step,s=e.count;switch(e.stepmode){case"backward":r=t.l2r(+n.time[o].utc.offset(i,-s));break;case"todate":var l=n.time[o].utc.offset(i,-s);r=t.l2r(+n.time[o].utc.ceil(l))}var u=a[1];return[r,u]}(t,e);a[r+".range[0]"]=i[0],a[r+".range[1]"]=i[1]}return a}},{d3:86}],436:[function(t,e,r){"use strict";e.exports={moduleType:"component",name:"rangeselector",schema:{subplots:{xaxis:{rangeselector:t("./attributes")}}},layoutAttributes:t("./attributes"),handleDefaults:t("./defaults"),draw:t("./draw")}},{"./attributes":431,"./defaults":433,"./draw":434}],437:[function(t,e,r){"use strict";var n=t("../color/attributes");e.exports={bgcolor:{valType:"color",dflt:n.background,editType:"plot"},bordercolor:{valType:"color",dflt:n.defaultLine,editType:"plot"},borderwidth:{valType:"integer",dflt:0,min:0,editType:"plot"},autorange:{valType:"boolean",dflt:!0,editType:"calc",impliedEdits:{"range[0]":void 0,"range[1]":void 0}},range:{valType:"info_array",items:[{valType:"any",editType:"calc",impliedEdits:{"^autorange":!1}},{valType:"any",editType:"calc",impliedEdits:{"^autorange":!1}}],editType:"calc",impliedEdits:{autorange:!1}},thickness:{valType:"number",dflt:.15,min:0,max:1,editType:"plot"},visible:{valType:"boolean",dflt:!0,editType:"calc"},editType:"calc"}},{"../color/attributes":367}],438:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axis_ids").list,a=t("../../plots/cartesian/autorange").getAutoRange,i=t("./constants");e.exports=function(t){for(var e=n(t,"x",!0),r=0;r<e.length;r++){var o=e[r],s=o[i.name];s&&s.visible&&s.autorange&&(s._input.autorange=!0,s._input.range=s.range=a(t,o))}}},{"../../plots/cartesian/autorange":546,"../../plots/cartesian/axis_ids":550,"./constants":439}],439:[function(t,e,r){"use strict";e.exports={name:"rangeslider",containerClassName:"rangeslider-container",bgClassName:"rangeslider-bg",rangePlotClassName:"rangeslider-rangeplot",maskMinClassName:"rangeslider-mask-min",maskMaxClassName:"rangeslider-mask-max",slideBoxClassName:"rangeslider-slidebox",grabberMinClassName:"rangeslider-grabber-min",grabAreaMinClassName:"rangeslider-grabarea-min",handleMinClassName:"rangeslider-handle-min",grabberMaxClassName:"rangeslider-grabber-max",grabAreaMaxClassName:"rangeslider-grabarea-max",handleMaxClassName:"rangeslider-handle-max",maskMinOppAxisClassName:"rangeslider-mask-min-opp-axis",maskMaxOppAxisClassName:"rangeslider-mask-max-opp-axis",maskColor:"rgba(0,0,0,0.4)",maskOppAxisColor:"rgba(0,0,0,0.2)",slideBoxFill:"transparent",slideBoxCursor:"ew-resize",grabAreaFill:"transparent",grabAreaCursor:"col-resize",grabAreaWidth:10,handleWidth:4,handleRadius:1,handleStrokeWidth:1,extraPad:15}},{}],440:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../plot_api/plot_template"),i=t("../../plots/cartesian/axis_ids"),o=t("./attributes"),s=t("./oppaxis_attributes");e.exports=function(t,e,r){var l=t[r],u=e[r];if(l.rangeslider||e._requestRangeslider[u._id]){n.isPlainObject(l.rangeslider)||(l.rangeslider={});var c,f,d=l.rangeslider,h=a.newContainer(u,"rangeslider");if(_("visible")){_("bgcolor",e.plot_bgcolor),_("bordercolor"),_("borderwidth"),_("thickness"),_("autorange",!u.isValidRange(d.range)),_("range");var p=e._subplots;if(p)for(var g=p.cartesian.filter((function(t){return t.substr(0,t.indexOf("y"))===i.name2id(r)})).map((function(t){return t.substr(t.indexOf("y"),t.length)})),v=n.simpleMap(g,i.id2name),m=0;m<v.length;m++){var y=v[m];c=d[y]||{},f=a.newContainer(h,y,"yaxis");var b,x=e[y];c.range&&x.isValidRange(c.range)&&(b="fixed"),"match"!==w("rangemode",b)&&w("range",x.range.slice())}h._input=d}}function _(t,e){return n.coerce(d,h,o,t,e)}function w(t,e){return n.coerce(c,f,s,t,e)}}},{"../../lib":498,"../../plot_api/plot_template":536,"../../plots/cartesian/axis_ids":550,"./attributes":437,"./oppaxis_attributes":444}],441:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../registry"),i=t("../../plots/plots"),o=t("../../lib"),s=o.strTranslate,l=t("../drawing"),u=t("../color"),c=t("../titles"),f=t("../../plots/cartesian"),d=t("../../plots/cartesian/axis_ids"),h=t("../dragelement"),p=t("../../lib/setcursor"),g=t("./constants");function v(t,e,r,n){var a=o.ensureSingle(t,"rect",g.bgClassName,(function(t){t.attr({x:0,y:0,"shape-rendering":"crispEdges"})})),i=n.borderwidth%2==0?n.borderwidth:n.borderwidth-1,u=-n._offsetShift,c=l.crispRound(e,n.borderwidth);a.attr({width:n._width+i,height:n._height+i,transform:s(u,u),fill:n.bgcolor,stroke:n.bordercolor,"stroke-width":c})}function m(t,e,r,n){var a=e._fullLayout;o.ensureSingleById(a._topdefs,"clipPath",n._clipId,(function(t){t.append("rect").attr({x:0,y:0})})).select("rect").attr({width:n._width,height:n._height})}function y(t,e,r,a){var s,u=e.calcdata,c=t.selectAll("g."+g.rangePlotClassName).data(r._subplotsWith,o.identity);c.enter().append("g").attr("class",(function(t){return g.rangePlotClassName+" "+t})).call(l.setClipUrl,a._clipId,e),c.order(),c.exit().remove(),c.each((function(t,o){var l=n.select(this),c=0===o,h=d.getFromId(e,t,"y"),p=h._name,g=a[p],v={data:[],layout:{xaxis:{type:r.type,domain:[0,1],range:a.range.slice(),calendar:r.calendar},width:a._width,height:a._height,margin:{t:0,b:0,l:0,r:0}},_context:e._context};r.rangebreaks&&(v.layout.xaxis.rangebreaks=r.rangebreaks),v.layout[p]={type:h.type,domain:[0,1],range:"match"!==g.rangemode?g.range.slice():h.range.slice(),calendar:h.calendar},h.rangebreaks&&(v.layout[p].rangebreaks=h.rangebreaks),i.supplyDefaults(v);var m=v._fullLayout.xaxis,y=v._fullLayout[p];m.clearCalc(),m.setScale(),y.clearCalc(),y.setScale();var b={id:t,plotgroup:l,xaxis:m,yaxis:y,isRangePlot:!0};c?s=b:(b.mainplot="xy",b.mainplotinfo=s),f.rangePlot(e,b,function(t,e){for(var r=[],n=0;n<t.length;n++){var a=t[n],i=a[0].trace;i.xaxis+i.yaxis===e&&r.push(a)}return r}(u,t))}))}function b(t,e,r,n,a){(o.ensureSingle(t,"rect",g.maskMinClassName,(function(t){t.attr({x:0,y:0,"shape-rendering":"crispEdges"})})).attr("height",n._height).call(u.fill,g.maskColor),o.ensureSingle(t,"rect",g.maskMaxClassName,(function(t){t.attr({y:0,"shape-rendering":"crispEdges"})})).attr("height",n._height).call(u.fill,g.maskColor),"match"!==a.rangemode)&&(o.ensureSingle(t,"rect",g.maskMinOppAxisClassName,(function(t){t.attr({y:0,"shape-rendering":"crispEdges"})})).attr("width",n._width).call(u.fill,g.maskOppAxisColor),o.ensureSingle(t,"rect",g.maskMaxOppAxisClassName,(function(t){t.attr({y:0,"shape-rendering":"crispEdges"})})).attr("width",n._width).style("border-top",g.maskOppBorder).call(u.fill,g.maskOppAxisColor))}function x(t,e,r,n){e._context.staticPlot||o.ensureSingle(t,"rect",g.slideBoxClassName,(function(t){t.attr({y:0,cursor:g.slideBoxCursor,"shape-rendering":"crispEdges"})})).attr({height:n._height,fill:g.slideBoxFill})}function _(t,e,r,n){var a=o.ensureSingle(t,"g",g.grabberMinClassName),i=o.ensureSingle(t,"g",g.grabberMaxClassName),s={x:0,width:g.handleWidth,rx:g.handleRadius,fill:u.background,stroke:u.defaultLine,"stroke-width":g.handleStrokeWidth,"shape-rendering":"crispEdges"},l={y:Math.round(n._height/4),height:Math.round(n._height/2)};o.ensureSingle(a,"rect",g.handleMinClassName,(function(t){t.attr(s)})).attr(l),o.ensureSingle(i,"rect",g.handleMaxClassName,(function(t){t.attr(s)})).attr(l);var c={width:g.grabAreaWidth,x:0,y:0,fill:g.grabAreaFill,cursor:e._context.staticPlot?void 0:g.grabAreaCursor};o.ensureSingle(a,"rect",g.grabAreaMinClassName,(function(t){t.attr(c)})).attr("height",n._height),o.ensureSingle(i,"rect",g.grabAreaMaxClassName,(function(t){t.attr(c)})).attr("height",n._height)}e.exports=function(t){for(var e=t._fullLayout,r=e._rangeSliderData,i=0;i<r.length;i++){var l=r[i][g.name];l._clipId=l._id+"-"+e._uid}var u=e._infolayer.selectAll("g."+g.containerClassName).data(r,(function(t){return t._name}));u.exit().each((function(t){var r=t[g.name];e._topdefs.select("#"+r._clipId).remove()})).remove(),0!==r.length&&(u.enter().append("g").classed(g.containerClassName,!0).attr("pointer-events","all"),u.each((function(r){var i=n.select(this),l=r[g.name],u=e[d.id2name(r.anchor)],f=l[d.id2name(r.anchor)];if(l.range){var w,A=o.simpleMap(l.range,r.r2l),T=o.simpleMap(r.range,r.r2l);w=T[0]<T[1]?[Math.min(A[0],T[0]),Math.max(A[1],T[1])]:[Math.max(A[0],T[0]),Math.min(A[1],T[1])],l.range=l._input.range=o.simpleMap(w,r.l2r)}r.cleanRange("rangeslider.range");var k=e._size,M=r.domain;l._width=k.w*(M[1]-M[0]);var E=Math.round(k.l+k.w*M[0]),S=Math.round(k.t+k.h*(1-r._counterDomainMin)+("bottom"===r.side?r._depth:0)+l._offsetShift+g.extraPad);i.attr("transform",s(E,S)),l._rl=o.simpleMap(l.range,r.r2l);var C=l._rl[0],L=l._rl[1],O=L-C;if(l.p2d=function(t){return t/l._width*O+C},l.d2p=function(t){return(t-C)/O*l._width},r.rangebreaks){var D=r.locateBreaks(C,L);if(D.length){var R,I,P=0;for(R=0;R<D.length;R++)P+=(I=D[R]).max-I.min;var F=l._width/(L-C-P),z=[-F*C];for(R=0;R<D.length;R++)I=D[R],z.push(z[z.length-1]-F*(I.max-I.min));for(l.d2p=function(t){for(var e=z[0],r=0;r<D.length;r++){var n=D[r];if(t>=n.max)e=z[r+1];else if(t<n.min)break}return e+F*t},R=0;R<D.length;R++)(I=D[R]).pmin=l.d2p(I.min),I.pmax=l.d2p(I.max);l.p2d=function(t){for(var e=z[0],r=0;r<D.length;r++){var n=D[r];if(t>=n.pmax)e=z[r+1];else if(t<n.pmin)break}return(t-e)/F}}}if("match"!==f.rangemode){var N=u.r2l(f.range[0]),B=u.r2l(f.range[1])-N;l.d2pOppAxis=function(t){return(t-N)/B*l._height}}i.call(v,t,r,l).call(m,t,r,l).call(y,t,r,l).call(b,t,r,l,f).call(x,t,r,l).call(_,t,r,l),function(t,e,r,i){if(e._context.staticPlot)return;var s=t.select("rect."+g.slideBoxClassName).node(),l=t.select("rect."+g.grabAreaMinClassName).node(),u=t.select("rect."+g.grabAreaMaxClassName).node();function c(){var c=n.event,f=c.target,d=c.clientX||c.touches[0].clientX,g=d-t.node().getBoundingClientRect().left,v=i.d2p(r._rl[0]),m=i.d2p(r._rl[1]),y=h.coverSlip();function b(t){var c,h,b,x=+(t.clientX||t.touches[0].clientX)-d;switch(f){case s:b="ew-resize",c=v+x,h=m+x;break;case l:b="col-resize",c=v+x,h=m;break;case u:b="col-resize",c=v,h=m+x;break;default:b="ew-resize",c=g,h=g+x}if(h<c){var _=h;h=c,c=_}i._pixelMin=c,i._pixelMax=h,p(n.select(y),b),function(t,e,r,n){function i(t){return r.l2r(o.constrain(t,n._rl[0],n._rl[1]))}var s=i(n.p2d(n._pixelMin)),l=i(n.p2d(n._pixelMax));window.requestAnimationFrame((function(){a.call("_guiRelayout",e,r._name+".range",[s,l])}))}(0,e,r,i)}function x(){y.removeEventListener("mousemove",b),y.removeEventListener("mouseup",x),this.removeEventListener("touchmove",b),this.removeEventListener("touchend",x),o.removeElement(y)}this.addEventListener("touchmove",b),this.addEventListener("touchend",x),y.addEventListener("mousemove",b),y.addEventListener("mouseup",x)}t.on("mousedown",c),t.on("touchstart",c)}(i,t,r,l),function(t,e,r,n,a,i){var l=g.handleWidth/2;function u(t){return o.constrain(t,0,n._width)}function c(t){return o.constrain(t,0,n._height)}function f(t){return o.constrain(t,-l,n._width+l)}var d=u(n.d2p(r._rl[0])),h=u(n.d2p(r._rl[1]));if(t.select("rect."+g.slideBoxClassName).attr("x",d).attr("width",h-d),t.select("rect."+g.maskMinClassName).attr("width",d),t.select("rect."+g.maskMaxClassName).attr("x",h).attr("width",n._width-h),"match"!==i.rangemode){var p=n._height-c(n.d2pOppAxis(a._rl[1])),v=n._height-c(n.d2pOppAxis(a._rl[0]));t.select("rect."+g.maskMinOppAxisClassName).attr("x",d).attr("height",p).attr("width",h-d),t.select("rect."+g.maskMaxOppAxisClassName).attr("x",d).attr("y",v).attr("height",n._height-v).attr("width",h-d),t.select("rect."+g.slideBoxClassName).attr("y",p).attr("height",v-p)}var m=Math.round(f(d-l))-.5,y=Math.round(f(h-l))+.5;t.select("g."+g.grabberMinClassName).attr("transform",s(m,.5)),t.select("g."+g.grabberMaxClassName).attr("transform",s(y,.5))}(i,0,r,l,u,f),"bottom"===r.side&&c.draw(t,r._id+"title",{propContainer:r,propName:r._name+".title",placeholder:e._dfltTitle.x,attributes:{x:r._offset+r._length/2,y:S+l._height+l._offsetShift+10+1.5*r.title.font.size,"text-anchor":"middle"}})})))}},{"../../lib":498,"../../lib/setcursor":519,"../../plots/cartesian":560,"../../plots/cartesian/axis_ids":550,"../../plots/plots":585,"../../registry":593,"../color":368,"../dragelement":387,"../drawing":390,"../titles":463,"./constants":439,d3:86}],442:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axis_ids"),a=t("../../lib/svg_text_utils"),i=t("./constants"),o=t("../../constants/alignment").LINE_SPACING,s=i.name;function l(t){var e=t&&t[s];return e&&e.visible}r.isVisible=l,r.makeData=function(t){var e=n.list({_fullLayout:t},"x",!0),r=t.margin,a=[];if(!t._has("gl2d"))for(var i=0;i<e.length;i++){var o=e[i];if(l(o)){a.push(o);var u=o[s];u._id=s+o._id,u._height=(t.height-r.b-r.t)*u.thickness,u._offsetShift=Math.floor(u.borderwidth/2)}}t._rangeSliderData=a},r.autoMarginOpts=function(t,e){var r=t._fullLayout,n=e[s],l=e._id.charAt(0),u=0,c=0;"bottom"===e.side&&(u=e._depth,e.title.text!==r._dfltTitle[l]&&(c=1.5*e.title.font.size+10+n._offsetShift,c+=(e.title.text.match(a.BR_TAG_ALL)||[]).length*e.title.font.size*o));return{x:0,y:e._counterDomainMin,l:0,r:0,t:0,b:n._height+u+Math.max(r.margin.b,c),pad:i.extraPad+2*n._offsetShift}}},{"../../constants/alignment":470,"../../lib/svg_text_utils":523,"../../plots/cartesian/axis_ids":550,"./constants":439}],443:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./attributes"),i=t("./oppaxis_attributes"),o=t("./helpers");e.exports={moduleType:"component",name:"rangeslider",schema:{subplots:{xaxis:{rangeslider:n.extendFlat({},a,{yaxis:i})}}},layoutAttributes:t("./attributes"),handleDefaults:t("./defaults"),calcAutorange:t("./calc_autorange"),draw:t("./draw"),isVisible:o.isVisible,makeData:o.makeData,autoMarginOpts:o.autoMarginOpts}},{"../../lib":498,"./attributes":437,"./calc_autorange":438,"./defaults":440,"./draw":441,"./helpers":442,"./oppaxis_attributes":444}],444:[function(t,e,r){"use strict";e.exports={_isSubplotObj:!0,rangemode:{valType:"enumerated",values:["auto","fixed","match"],dflt:"match",editType:"calc"},range:{valType:"info_array",items:[{valType:"any",editType:"plot"},{valType:"any",editType:"plot"}],editType:"plot"},editType:"calc"}},{}],445:[function(t,e,r){"use strict";var n=t("../annotations/attributes"),a=t("../../traces/scatter/attributes").line,i=t("../drawing/attributes").dash,o=t("../../lib/extend").extendFlat,s=t("../../plot_api/plot_template").templatedArray;t("../../constants/axis_placeable_objects");e.exports=s("shape",{visible:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},type:{valType:"enumerated",values:["circle","rect","path","line"],editType:"calc+arraydraw"},layer:{valType:"enumerated",values:["below","above"],dflt:"above",editType:"arraydraw"},xref:o({},n.xref,{}),xsizemode:{valType:"enumerated",values:["scaled","pixel"],dflt:"scaled",editType:"calc+arraydraw"},xanchor:{valType:"any",editType:"calc+arraydraw"},x0:{valType:"any",editType:"calc+arraydraw"},x1:{valType:"any",editType:"calc+arraydraw"},yref:o({},n.yref,{}),ysizemode:{valType:"enumerated",values:["scaled","pixel"],dflt:"scaled",editType:"calc+arraydraw"},yanchor:{valType:"any",editType:"calc+arraydraw"},y0:{valType:"any",editType:"calc+arraydraw"},y1:{valType:"any",editType:"calc+arraydraw"},path:{valType:"string",editType:"calc+arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},line:{color:o({},a.color,{editType:"arraydraw"}),width:o({},a.width,{editType:"calc+arraydraw"}),dash:o({},i,{editType:"arraydraw"}),editType:"calc+arraydraw"},fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},fillrule:{valType:"enumerated",values:["evenodd","nonzero"],dflt:"evenodd",editType:"arraydraw"},editable:{valType:"boolean",dflt:!1,editType:"calc+arraydraw"},editType:"arraydraw"})},{"../../constants/axis_placeable_objects":471,"../../lib/extend":490,"../../plot_api/plot_template":536,"../../traces/scatter/attributes":654,"../annotations/attributes":353,"../drawing/attributes":389}],446:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../plots/cartesian/axes"),i=t("./constants"),o=t("./helpers");function s(t){return u(t.line.width,t.xsizemode,t.x0,t.x1,t.path,!1)}function l(t){return u(t.line.width,t.ysizemode,t.y0,t.y1,t.path,!0)}function u(t,e,r,a,s,l){var u=t/2,c=l;if("pixel"===e){var f=s?o.extractPathCoords(s,l?i.paramIsY:i.paramIsX):[r,a],d=n.aggNums(Math.max,null,f),h=n.aggNums(Math.min,null,f),p=h<0?Math.abs(h)+u:u,g=d>0?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;l<p.length;l++)void 0!==(u=a[p[l].charAt(0)].drawn)&&(!(c=p[l].substr(1).match(i.paramRE))||c.length<u||((f=s(c[u]))<d&&(d=f),f>h&&(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;o<r.length;o++){var u,f,d=r[o];d._extremes={};var h=a.getRefType(d.xref),p=a.getRefType(d.yref);if("paper"!==d.xref&&"domain"!==h){var g="pixel"===d.xsizemode?d.xanchor:d.x0,v="pixel"===d.xsizemode?d.xanchor:d.x1;(f=c(u=a.getFromId(t,d.xref),g,v,d.path,i.paramIsX))&&(d._extremes[u._id]=a.findExtremes(u,f,s(d)))}if("paper"!==d.yref&&"domain"!==p){var m="pixel"===d.ysizemode?d.yanchor:d.y0,y="pixel"===d.ysizemode?d.yanchor:d.y1;(f=c(u=a.getFromId(t,d.yref),m,y,d.path,i.paramIsY))&&(d._extremes[u._id]=a.findExtremes(u,f,l(d)))}}}},{"../../lib":498,"../../plots/cartesian/axes":547,"./constants":447,"./helpers":456}],447:[function(t,e,r){"use strict";e.exports={segmentRE:/[MLHVQCTSZ][^MLHVQCTSZ]*/g,paramRE:/[^\s,]+/g,paramIsX:{M:{0:!0,drawn:0},L:{0:!0,drawn:0},H:{0:!0,drawn:0},V:{},Q:{0:!0,2:!0,drawn:2},C:{0:!0,2:!0,4:!0,drawn:4},T:{0:!0,drawn:0},S:{0:!0,2:!0,drawn:2},Z:{}},paramIsY:{M:{1:!0,drawn:1},L:{1:!0,drawn:1},H:{},V:{0:!0,drawn:0},Q:{1:!0,3:!0,drawn:3},C:{1:!0,3:!0,5:!0,drawn:5},T:{1:!0,drawn:1},S:{1:!0,3:!0,drawn:5},Z:{}},numParams:{M:2,L:2,H:1,V:1,Q:4,C:6,T:2,S:4,Z:0}}},{}],448:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../plots/cartesian/axes"),i=t("../../plots/array_container_defaults"),o=t("./attributes"),s=t("./helpers");function l(t,e,r){function i(r,a){return n.coerce(t,e,o,r,a)}if(i("visible")){var l=i("path"),u=i("type",l?"path":"rect");"path"!==e.type&&delete e.path,i("editable"),i("layer"),i("opacity"),i("fillcolor"),i("fillrule"),i("line.width")&&(i("line.color"),i("line.dash"));for(var c=i("xsizemode"),f=i("ysizemode"),d=["x","y"],h=0;h<2;h++){var p,g,v,m=d[h],y=m+"anchor",b="x"===m?c:f,x={_fullLayout:r},_=a.coerceRef(t,e,x,m,void 0,"paper");if("range"===a.getRefType(_)?((p=a.getFromId(x,_))._shapeIndices.push(e._index),v=s.rangeToShapePosition(p),g=s.shapePositionToRange(p)):g=v=n.identity,"path"!==u){var w=m+"0",A=m+"1",T=t[w],k=t[A];t[w]=g(t[w],!0),t[A]=g(t[A],!0),"pixel"===b?(i(w,0),i(A,10)):(a.coercePosition(e,x,i,_,w,.25),a.coercePosition(e,x,i,_,A,.75)),e[w]=v(e[w]),e[A]=v(e[A]),t[w]=T,t[A]=k}if("pixel"===b){var M=t[y];t[y]=g(t[y],!0),a.coercePosition(e,x,i,_,y,.25),e[y]=v(e[y]),t[y]=M}}"path"===u?i("path"):n.noneOrAll(t,e,["x0","x1","y0","y1"])}}e.exports=function(t,e){i(t,e,{name:"shapes",handleItemDefaults:l})}},{"../../lib":498,"../../plots/array_container_defaults":542,"../../plots/cartesian/axes":547,"./attributes":445,"./helpers":456}],449:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../lib"),i=t("../../plots/cartesian/axes"),o=t("./draw_newshape/helpers").readPaths,s=t("./draw_newshape/display_outlines"),l=t("../../plots/cartesian/handle_outline").clearOutlineControllers,u=t("../color"),c=t("../drawing"),f=t("../../plot_api/plot_template").arrayEditor,d=t("../dragelement"),h=t("../../lib/setcursor"),p=t("./constants"),g=t("./helpers");function v(t){var e=t._fullLayout;for(var r in e._shapeUpperLayer.selectAll("path").remove(),e._shapeLowerLayer.selectAll("path").remove(),e._plots){var n=e._plots[r].shapelayer;n&&n.selectAll("path").remove()}for(var a=0;a<e.shapes.length;a++)e.shapes[a].visible&&b(t,a)}function m(t){return!!t._fullLayout._drawing}function y(t){return!t._context.edits.shapePosition}function b(t,e){t._fullLayout._paperdiv.selectAll('.shapelayer [data-index="'+e+'"]').remove();var r=g.makeOptionsAndPlotinfo(t,e),l=r.options,b=r.plotinfo;if(l._input&&!1!==l.visible)if("below"!==l.layer)T(t._fullLayout._shapeUpperLayer);else if("paper"===l.xref||"paper"===l.yref)T(t._fullLayout._shapeLowerLayer);else{if(b._hadPlotinfo)T((b.mainplotinfo||b).shapelayer);else T(t._fullLayout._shapeLowerLayer)}function T(r){var T=_(t,l),k={"data-index":e,"fill-rule":l.fillrule,d:T},M=l.opacity,E=l.fillcolor,S=l.line.width?l.line.color:"rgba(0,0,0,0)",C=l.line.width,L=l.line.dash;C||!0!==l.editable||(C=5,L="solid");var O="Z"!==T[T.length-1],D=y(t)&&l.editable&&t._fullLayout._activeShapeIndex===e;D&&(E=O?"rgba(0,0,0,0)":t._fullLayout.activeshape.fillcolor,M=t._fullLayout.activeshape.opacity);var R,I=r.append("path").attr(k).style("opacity",M).call(u.stroke,S).call(u.fill,E).call(c.dashLine,L,C);if(x(I,t,l),(D||t._context.edits.shapePosition)&&(R=f(t.layout,"shapes",l)),D){I.style({cursor:"move"});var P={element:I.node(),plotinfo:b,gd:t,editHelpers:R,isActiveShape:!0},F=o(T,t);s(F,I,P)}else t._context.edits.shapePosition?function(t,e,r,o,s,l){var u,f,v,y,b,A,T,k,M,E,S,C,L,O,D,R,I="pixel"===r.xsizemode,P="pixel"===r.ysizemode,F="line"===r.type,z="path"===r.type,N=l.modifyItem,B=i.getFromId(t,r.xref),j=i.getRefType(r.xref),U=i.getFromId(t,r.yref),V=i.getRefType(r.yref),H=g.getDataToPixel(t,B,!1,j),G=g.getDataToPixel(t,U,!0,V),q=g.getPixelToData(t,B,!1,j),X=g.getPixelToData(t,U,!0,V),W=F?function(){var t=Math.max(r.line.width,10),n=s.append("g").attr("data-index",o);n.append("path").attr("d",e.attr("d")).style({cursor:"move","stroke-width":t,"stroke-opacity":"0"});var a={"fill-opacity":"0"},i=Math.max(t/2,10);return n.append("circle").attr({"data-line-point":"start-point",cx:I?H(r.xanchor)+r.x0:H(r.x0),cy:P?G(r.yanchor)-r.y0:G(r.y0),r:i}).style(a).classed("cursor-grab",!0),n.append("circle").attr({"data-line-point":"end-point",cx:I?H(r.xanchor)+r.x1:H(r.x1),cy:P?G(r.yanchor)-r.y1:G(r.y1),r:i}).style(a).classed("cursor-grab",!0),n}():e,Y={element:W.node(),gd:t,prepFn:function(n){if(m(t))return;I&&(b=H(r.xanchor));P&&(A=G(r.yanchor));"path"===r.type?D=r.path:(u=I?r.x0:H(r.x0),f=P?r.y0:G(r.y0),v=I?r.x1:H(r.x1),y=P?r.y1:G(r.y1));u<v?(M=u,L="x0",E=v,O="x1"):(M=v,L="x1",E=u,O="x0");!P&&f<y||P&&f>y?(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<r.length){for(var a=[],i=0;i<r.length;i++)i!==e&&a.push(r[i]);delete t._fullLayout._activeShapeIndex,n.call("_guiRelayout",t,{shapes:a})}}}},{"../../lib":498,"../../lib/setcursor":519,"../../plot_api/plot_template":536,"../../plots/cartesian/axes":547,"../../plots/cartesian/handle_outline":557,"../../registry":593,"../color":368,"../dragelement":387,"../drawing":390,"./constants":447,"./draw_newshape/display_outlines":453,"./draw_newshape/helpers":454,"./helpers":456}],450:[function(t,e,r){"use strict";var n=t("../../drawing/attributes").dash,a=t("../../../lib/extend").extendFlat;e.exports={newshape:{line:{color:{valType:"color",editType:"none"},width:{valType:"number",min:0,dflt:4,editType:"none"},dash:a({},n,{dflt:"solid",editType:"none"}),editType:"none"},fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"none"},fillrule:{valType:"enumerated",values:["evenodd","nonzero"],dflt:"evenodd",editType:"none"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"none"},layer:{valType:"enumerated",values:["below","above"],dflt:"above",editType:"none"},drawdirection:{valType:"enumerated",values:["ortho","horizontal","vertical","diagonal"],dflt:"diagonal",editType:"none"},editType:"none"},activeshape:{fillcolor:{valType:"color",dflt:"rgb(255,0,255)",editType:"none"},opacity:{valType:"number",min:0,max:1,dflt:.5,editType:"none"},editType:"none"}}},{"../../../lib/extend":490,"../../drawing/attributes":389}],451:[function(t,e,r){"use strict";e.exports={CIRCLE_SIDES:32,i000:0,i090:8,i180:16,i270:24,cos45:Math.cos(Math.PI/4),sin45:Math.sin(Math.PI/4),SQRT2:Math.sqrt(2)}},{}],452:[function(t,e,r){"use strict";var n=t("../../color");e.exports=function(t,e,r){if(r("newshape.drawdirection"),r("newshape.layer"),r("newshape.fillcolor"),r("newshape.fillrule"),r("newshape.opacity"),r("newshape.line.width")){var a=(t||{}).plot_bgcolor||"#FFF";r("newshape.line.color",n.contrast(a)),r("newshape.line.dash")}r("activeshape.fillcolor"),r("activeshape.opacity")}},{"../../color":368}],453:[function(t,e,r){"use strict";var n=t("../../dragelement"),a=t("../../dragelement/helpers").drawMode,i=t("../../../registry"),o=t("./constants"),s=o.i000,l=o.i090,u=o.i180,c=o.i270,f=t("../../../plots/cartesian/handle_outline").clearOutlineControllers,d=t("./helpers"),h=d.pointsShapeRectangle,p=d.pointsShapeEllipse,g=d.writePaths,v=t("./newshapes");e.exports=function t(e,r,o,d){d||(d=0);var m=o.gd;function y(){t(e,r,o,d++),p(e[0])&&b({redrawing:!0})}function b(t){o.isActiveShape=!1;var e=v(r,o);Object.keys(e).length&&i.call((t||{}).redrawing?"relayout":"_guiRelayout",m,e)}var x,_,w,A,T,k=o.isActiveShape,M=m._fullLayout._zoomlayer,E=o.dragmode;(a(E)?m._fullLayout._drawing=!0:m._fullLayout._activeShapeIndex>=0&&f(m),r.attr("d",g(e)),k&&!d)&&(T=function(t,e){for(var r=0;r<e.length;r++){var n=e[r];t[r]=[];for(var a=0;a<n.length;a++){t[r][a]=[];for(var i=0;i<n[a].length;i++)t[r][a][i]=n[a][i]}}return t}([],e),function(t){x=[];for(var r=0;r<e.length;r++){var a=e[r],i=!h(a)&&p(a);x[r]=[];for(var o=0;o<a.length;o++)if("Z"!==a[o][0]&&(!i||o===s||o===l||o===u||o===c)){var f=a[o][1],d=a[o][2],g=t.append("circle").classed("cursor-grab",!0).attr("data-i",r).attr("data-j",o).attr("cx",f).attr("cy",d).attr("r",4).style({"mix-blend-mode":"luminosity",fill:"black",stroke:"white","stroke-width":1});x[r][o]={element:g.node(),gd:m,prepFn:S,doneFn:L,clickFn:O},n.init(x[r][o])}}}(M.append("g").attr("class","outline-controllers")),function(){if(_=[],!e.length)return;_[0]={element:r[0][0],gd:m,prepFn:R,doneFn:I},n.init(_[0])}());function S(t){w=+t.srcElement.getAttribute("data-i"),A=+t.srcElement.getAttribute("data-j"),x[w][A].moveFn=C}function C(t,r){if(e.length){var n=T[w][A][1],a=T[w][A][2],i=e[w],o=i.length;if(h(i)){for(var s=0;s<o;s++)if(s!==A){var l=i[s];l[1]===i[A][1]&&(l[1]=n+t),l[2]===i[A][2]&&(l[2]=a+r)}if(i[A][1]=n+t,i[A][2]=a+r,!h(i))for(var u=0;u<o;u++)for(var c=0;c<i[u].length;c++)i[u][c]=T[w][u][c]}else i[A][1]=n+t,i[A][2]=a+r;y()}}function L(){b()}function O(t,r){if(2===t){w=+r.srcElement.getAttribute("data-i"),A=+r.srcElement.getAttribute("data-j");var n=e[w];h(n)||p(n)||function(){if(e.length&&e[w]&&e[w].length){for(var t=[],r=0;r<e[w].length;r++)r!==A&&t.push(e[w][r]);t.length>1&&(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;n<e.length;n++)for(var a=0;a<e[n].length;a++)for(var i=0;i+2<e[n][a].length;i+=2)e[n][a][i+1]=T[n][a][i+1]+t,e[n][a][i+2]=T[n][a][i+2]+r}(t,r),y()}function R(t){(w=+t.srcElement.getAttribute("data-i"))||(w=0),_[w].moveFn=D}function I(){b()}}},{"../../../plots/cartesian/handle_outline":557,"../../../registry":593,"../../dragelement":387,"../../dragelement/helpers":386,"./constants":451,"./helpers":454,"./newshapes":455}],454:[function(t,e,r){"use strict";var n=t("parse-svg-path"),a=t("./constants"),i=a.CIRCLE_SIDES,o=a.SQRT2,s=t("../../../plots/cartesian/helpers"),l=s.p2r,u=s.r2p,c=[0,3,4,5,6,1,2],f=[0,3,4,1,2];function d(t,e){return Math.abs(t-e)<=1e-6}function h(t,e){var r=e[1]-t[1],n=e[2]-t[2];return Math.sqrt(r*r+n*n)}r.writePaths=function(t){var e=t.length;if(!e)return"M0,0Z";for(var r="",n=0;n<e;n++)for(var a=t[n].length,i=0;i<a;i++){var o=t[n][i][0];if("Z"===o)r+="Z";else for(var s=t[n][i].length,l=0;l<s;l++){var u=l;"Q"===o||"S"===o?u=f[l]:"C"===o&&(u=c[l]),r+=t[n][i][u],l>0&&l<s-1&&(r+=",")}}return r},r.readPaths=function(t,e,r,a){var o,s,c,f=n(t),d=[],h=-1,p=0,g=0,v=function(){s=p,c=g};v();for(var m=0;m<f.length;m++){var y,b,x,_,w=[],A=f[m][0],T=A;switch(A){case"M":h++,d[h]=[],p=+f[m][1],g=+f[m][2],w.push([T,p,g]),v();break;case"Q":case"S":y=+f[m][1],x=+f[m][2],p=+f[m][3],g=+f[m][4],w.push([T,p,g,y,x]);break;case"C":y=+f[m][1],x=+f[m][2],b=+f[m][3],_=+f[m][4],p=+f[m][5],g=+f[m][6],w.push([T,p,g,y,x,b,_]);break;case"T":case"L":p=+f[m][1],g=+f[m][2],w.push([T,p,g]);break;case"H":T="L",p=+f[m][1],w.push([T,p,g]);break;case"V":T="L",g=+f[m][1],w.push([T,p,g]);break;case"A":T="L";var k=+f[m][1],M=+f[m][2];+f[m][4]||(k=-k,M=-M);var E=p-k,S=g;for(o=1;o<=i/2;o++){var C=2*Math.PI*o/i;w.push([T,E+k*Math.cos(C),S+M*Math.sin(C)])}break;case"Z":p===s&&g===c||(p=s,g=c,w.push([T,p,g]))}for(var L=(r||{}).domain,O=e._fullLayout._size,D=r&&"pixel"===r.xsizemode,R=r&&"pixel"===r.ysizemode,I=!1===a,P=0;P<w.length;P++){for(o=0;o+2<7;o+=2){var F=w[P][o+1],z=w[P][o+2];void 0!==F&&void 0!==z&&(p=F,g=z,r&&(r.xaxis&&r.xaxis.p2r?(I&&(F-=r.xaxis._offset),F=D?u(r.xaxis,r.xanchor)+F:l(r.xaxis,F)):(I&&(F-=O.l),L?F=L.x[0]+F/O.w:F/=O.w),r.yaxis&&r.yaxis.p2r?(I&&(z-=r.yaxis._offset),z=R?u(r.yaxis,r.yanchor)-z:l(r.yaxis,z)):(I&&(z-=O.t),z=L?L.y[1]-z/O.h:1-z/O.h)),w[P][o+1]=F,w[P][o+2]=z)}d[h].push(w[P].slice())}}return d},r.pointsShapeRectangle=function(t){if(5!==t.length)return!1;for(var e=1;e<3;e++){if(!d(t[0][e]-t[1][e],t[3][e]-t[2][e]))return!1;if(!d(t[0][e]-t[3][e],t[1][e]-t[2][e]))return!1}return!(!d(t[0][1],t[1][1])&&!d(t[0][1],t[3][1]))&&!!(h(t[0],t[1])*h(t[0],t[3]))},r.pointsShapeEllipse=function(t){var e=t.length;if(e!==i+1)return!1;e=i;for(var r=0;r<e;r++){var n=(2*e-r)%e,a=(e/2+n)%e,o=(e/2+r)%e;if(!d(h(t[r],t[o]),h(t[n],t[a])))return!1}return!0},r.handleEllipse=function(t,e,n){if(!t)return[e,n];var a=r.ellipseOver({x0:e[0],y0:e[1],x1:n[0],y1:n[1]}),s=(a.x1+a.x0)/2,l=(a.y1+a.y0)/2,u=(a.x1-a.x0)/2,c=(a.y1-a.y0)/2;u||(u=c/=o),c||(c=u/=o);for(var f=[],d=0;d<i;d++){var h=2*d*Math.PI/i;f.push([s+u*Math.cos(h),l+c*Math.sin(h)])}return f},r.ellipseOver=function(t){var e=t.x0,r=t.y0,n=t.x1,a=t.y1,i=n-e,s=a-r,l=((e-=i)+n)/2,u=((r-=s)+a)/2;return{x0:l-(i*=o),y0:u-(s*=o),x1:l+i,y1:u+s}}},{"../../../plots/cartesian/helpers":558,"./constants":451,"parse-svg-path":266}],455:[function(t,e,r){"use strict";var n=t("../../dragelement/helpers"),a=n.drawMode,i=n.openMode,o=t("./constants"),s=o.i000,l=o.i090,u=o.i180,c=o.i270,f=o.cos45,d=o.sin45,h=t("../../../plots/cartesian/helpers"),p=h.p2r,g=h.r2p,v=t("../../../plots/cartesian/handle_outline").clearSelect,m=t("./helpers"),y=m.readPaths,b=m.writePaths,x=m.ellipseOver;e.exports=function(t,e){if(t.length){var r=t[0][0];if(r){var n=r.getAttribute("d"),o=e.gd,h=o._fullLayout.newshape,m=e.plotinfo,_=m.xaxis,w=m.yaxis,A=!!m.domain||!m.xaxis,T=!!m.domain||!m.yaxis,k=e.isActiveShape,M=e.dragmode,E=(o.layout||{}).shapes||[];if(!a(M)&&void 0!==k){var S=o._fullLayout._activeShapeIndex;if(S<E.length)switch(o._fullLayout.shapes[S].type){case"rect":M="drawrect";break;case"circle":M="drawcircle";break;case"line":M="drawline";break;case"path":var C=E[S].path||"";M="Z"===C[C.length-1]?"drawclosedpath":"drawopenpath"}}var L,O=i(M),D=y(n,o,m,k),R={editable:!0,xref:A?"paper":_._id,yref:T?"paper":w._id,layer:h.layer,opacity:h.opacity,line:{color:h.line.color,width:h.line.width,dash:h.line.dash}};if(O||(R.fillcolor=h.fillcolor,R.fillrule=h.fillrule),1===D.length&&(L=D[0]),L&&"drawrect"===M)R.type="rect",R.x0=L[0][1],R.y0=L[0][2],R.x1=L[2][1],R.y1=L[2][2];else if(L&&"drawline"===M)R.type="line",R.x0=L[0][1],R.y0=L[0][2],R.x1=L[1][1],R.y1=L[1][2];else if(L&&"drawcircle"===M){R.type="circle";var I=L[s][1],P=L[l][1],F=L[u][1],z=L[c][1],N=L[s][2],B=L[l][2],j=L[u][2],U=L[c][2],V=m.xaxis&&("date"===m.xaxis.type||"log"===m.xaxis.type),H=m.yaxis&&("date"===m.yaxis.type||"log"===m.yaxis.type);V&&(I=g(m.xaxis,I),P=g(m.xaxis,P),F=g(m.xaxis,F),z=g(m.xaxis,z)),H&&(N=g(m.yaxis,N),B=g(m.yaxis,B),j=g(m.yaxis,j),U=g(m.yaxis,U));var G=(P+z)/2,q=(N+j)/2,X=x({x0:G,y0:q,x1:G+(z-P+F-I)/2*f,y1:q+(U-B+j-N)/2*d});V&&(X.x0=p(m.xaxis,X.x0),X.x1=p(m.xaxis,X.x1)),H&&(X.y0=p(m.yaxis,X.y0),X.y1=p(m.yaxis,X.y1)),R.x0=X.x0,R.y0=X.y0,R.x1=X.x1,R.y1=X.y1}else R.type="path",_&&w&&function(t,e,r){var n="date"===e.type,a="date"===r.type;if(!n&&!a)return t;for(var i=0;i<t.length;i++)for(var o=0;o<t[i].length;o++)for(var s=0;s+2<t[i][o].length;s+=2)n&&(t[i][o][s+1]=t[i][o][s+1].replace(" ","_")),a&&(t[i][o][s+2]=t[i][o][s+2].replace(" ","_"))}(D,_,w),R.path=b(D),L=null;v(o);for(var W=e.editHelpers,Y=(W||{}).modifyItem,Z=[],J=0;J<E.length;J++){var Q=o._fullLayout.shapes[J];if(Z[J]=Q._input,void 0!==k&&J===o._fullLayout._activeShapeIndex){var $=R;switch(Q.type){case"line":case"rect":case"circle":Y("x0",$.x0),Y("x1",$.x1),Y("y0",$.y0),Y("y1",$.y1);break;case"path":Y("path",$.path)}}}return void 0===k?(Z.push(R),Z):W?W.getUpdateObj():{}}}}},{"../../../plots/cartesian/handle_outline":557,"../../../plots/cartesian/helpers":558,"../../dragelement/helpers":386,"./constants":451,"./helpers":454}],456:[function(t,e,r){"use strict";var n=t("./constants"),a=t("../../lib");r.rangeToShapePosition=function(t){return"log"===t.type?t.r2d:function(t){return t}},r.shapePositionToRange=function(t){return"log"===t.type?t.d2r:function(t){return t}},r.decodeDate=function(t){return function(e){return e.replace&&(e=e.replace("_"," ")),t(e)}},r.encodeDate=function(t){return function(e){return t(e).replace(" ","_")}},r.extractPathCoords=function(t,e){var r=[];return t.match(n.segmentRE).forEach((function(t){var i=e[t.charAt(0)].drawn;if(void 0!==i){var o=t.substr(1).match(n.paramRE);!o||o.length<i||r.push(a.cleanNumber(o[i]))}})),r},r.getDataToPixel=function(t,e,n,a){var i,o=t._fullLayout._size;if(e)if("domain"===a)i=function(t){return e._length*(n?1-t:t)+e._offset};else{var s=r.shapePositionToRange(e);i=function(t){return e._offset+e.r2p(s(t,!0))},"date"===e.type&&(i=r.decodeDate(i))}else i=n?function(t){return o.t+o.h*(1-t)}:function(t){return o.l+o.w*t};return i},r.getPixelToData=function(t,e,n,a){var i,o=t._fullLayout._size;if(e)if("domain"===a)i=function(t){var r=(t-e._offset)/e._length;return n?1-r:r};else{var s=r.rangeToShapePosition(e);i=function(t){return s(e.p2r(t-e._offset))}}else i=n?function(t){return 1-(t-o.t)/o.h}:function(t){return(t-o.l)/o.w};return i},r.roundPositionForSharpStrokeRendering=function(t,e){var r=1===Math.round(e%2),n=Math.round(t);return r?n+.5:n},r.makeOptionsAndPlotinfo=function(t,e){var r=t._fullLayout.shapes[e]||{},n=t._fullLayout._plots[r.xref+r.yref];return!!n?n._hadPlotinfo=!0:(n={},r.xref&&"paper"!==r.xref&&(n.xaxis=t._fullLayout[r.xref+"axis"]),r.yref&&"paper"!==r.yref&&(n.yaxis=t._fullLayout[r.yref+"axis"])),n.xsizemode=r.xsizemode,n.ysizemode=r.ysizemode,n.xanchor=r.xanchor,n.yanchor=r.yanchor,{options:r,plotinfo:n}}},{"../../lib":498,"./constants":447}],457:[function(t,e,r){"use strict";var n=t("./draw");e.exports={moduleType:"component",name:"shapes",layoutAttributes:t("./attributes"),supplyLayoutDefaults:t("./defaults"),supplyDrawNewShapeDefaults:t("./draw_newshape/defaults"),includeBasePlot:t("../../plots/cartesian/include_components")("shapes"),calcAutorange:t("./calc_autorange"),draw:n.draw,drawOne:n.drawOne}},{"../../plots/cartesian/include_components":559,"./attributes":445,"./calc_autorange":446,"./defaults":448,"./draw":449,"./draw_newshape/defaults":452}],458:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),a=t("../../plots/pad_attributes"),i=t("../../lib/extend").extendDeepAll,o=t("../../plot_api/edit_types").overrideAll,s=t("../../plots/animation_attributes"),l=t("../../plot_api/plot_template").templatedArray,u=t("./constants"),c=l("step",{visible:{valType:"boolean",dflt:!0},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string"},value:{valType:"string"},execute:{valType:"boolean",dflt:!0}});e.exports=o(l("slider",{visible:{valType:"boolean",dflt:!0},active:{valType:"number",min:0,dflt:0},steps:c,lenmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"fraction"},len:{valType:"number",min:0,dflt:1},x:{valType:"number",min:-2,max:3,dflt:0},pad:i(a({editType:"arraydraw"}),{},{t:{dflt:20}}),xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left"},y:{valType:"number",min:-2,max:3,dflt:0},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top"},transition:{duration:{valType:"number",min:0,dflt:150},easing:{valType:"enumerated",values:s.transition.easing.values,dflt:"cubic-in-out"}},currentvalue:{visible:{valType:"boolean",dflt:!0},xanchor:{valType:"enumerated",values:["left","center","right"],dflt:"left"},offset:{valType:"number",dflt:10},prefix:{valType:"string"},suffix:{valType:"string"},font:n({})},font:n({}),activebgcolor:{valType:"color",dflt:u.gripBgActiveColor},bgcolor:{valType:"color",dflt:u.railBgColor},bordercolor:{valType:"color",dflt:u.railBorderColor},borderwidth:{valType:"number",min:0,dflt:u.railBorderWidth},ticklen:{valType:"number",min:0,dflt:u.tickLength},tickcolor:{valType:"color",dflt:u.tickColor},tickwidth:{valType:"number",min:0,dflt:1},minorticklen:{valType:"number",min:0,dflt:u.minorTickLength}}),"arraydraw","from-root")},{"../../lib/extend":490,"../../plot_api/edit_types":529,"../../plot_api/plot_template":536,"../../plots/animation_attributes":541,"../../plots/font_attributes":575,"../../plots/pad_attributes":584,"./constants":459}],459:[function(t,e,r){"use strict";e.exports={name:"sliders",containerClassName:"slider-container",groupClassName:"slider-group",inputAreaClass:"slider-input-area",railRectClass:"slider-rail-rect",railTouchRectClass:"slider-rail-touch-rect",gripRectClass:"slider-grip-rect",tickRectClass:"slider-tick-rect",inputProxyClass:"slider-input-proxy",labelsClass:"slider-labels",labelGroupClass:"slider-label-group",labelClass:"slider-label",currentValueClass:"slider-current-value",railHeight:5,menuIndexAttrName:"slider-active-index",autoMarginIdRoot:"slider-",minWidth:30,minHeight:30,textPadX:40,arrowOffsetX:4,railRadius:2,railWidth:5,railBorder:4,railBorderWidth:1,railBorderColor:"#bec8d9",railBgColor:"#f8fafc",railInset:8,stepInset:10,gripRadius:10,gripWidth:20,gripHeight:20,gripBorder:20,gripBorderWidth:1,gripBorderColor:"#bec8d9",gripBgColor:"#f6f8fa",gripBgActiveColor:"#dbdde0",labelPadding:8,labelOffset:0,tickWidth:1,tickColor:"#333",tickOffset:25,tickLength:7,minorTickOffset:25,minorTickColor:"#333",minorTickLength:4,currentValuePadding:8,currentValueInset:0}},{}],460:[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.steps;function l(t,e,r){function o(r,a){return n.coerce(t,e,i,r,a)}for(var s=a(t,e,{name:"steps",handleItemDefaults:u}),l=0,c=0;c<s.length;c++)s[c].visible&&l++;if(l<2?e.visible=!1:o("visible")){e._stepCount=l;var f=e._visibleSteps=n.filterVisible(s);(s[o("active")]||{}).visible||(e.active=f[0]._index),o("x"),o("y"),n.noneOrAll(t,e,["x","y"]),o("xanchor"),o("yanchor"),o("len"),o("lenmode"),o("pad.t"),o("pad.r"),o("pad.b"),o("pad.l"),n.coerceFont(o,"font",r.font),o("currentvalue.visible")&&(o("currentvalue.xanchor"),o("currentvalue.prefix"),o("currentvalue.suffix"),o("currentvalue.offset"),n.coerceFont(o,"currentvalue.font",e.font)),o("transition.duration"),o("transition.easing"),o("bgcolor"),o("activebgcolor"),o("bordercolor"),o("borderwidth"),o("ticklen"),o("tickwidth"),o("tickcolor"),o("minorticklen")}}function u(t,e){function r(r,a){return n.coerce(t,e,s,r,a)}if("skip"===t.method||Array.isArray(t.args)?r("visible"):e.visible=!1){r("method"),r("args");var a=r("label","step-"+e._index);r("value",a),r("execute")}}e.exports=function(t,e){a(t,e,{name:o,handleItemDefaults:l})}},{"../../lib":498,"../../plots/array_container_defaults":542,"./attributes":458,"./constants":459}],461:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../plots/plots"),i=t("../color"),o=t("../drawing"),s=t("../../lib"),l=s.strTranslate,u=t("../../lib/svg_text_utils"),c=t("../../plot_api/plot_template").arrayEditor,f=t("./constants"),d=t("../../constants/alignment"),h=d.LINE_SPACING,p=d.FROM_TL,g=d.FROM_BR;function v(t){return f.autoMarginIdRoot+t._index}function m(t){return t._index}function y(t,e){var r=o.tester.selectAll("g."+f.labelGroupClass).data(e._visibleSteps);r.enter().append("g").classed(f.labelGroupClass,!0);var i=0,l=0;r.each((function(t){var r=_(n.select(this),{step:t},e).node();if(r){var a=o.bBox(r);l=Math.max(l,a.height),i=Math.max(i,a.width)}})),r.remove();var c=e._dims={};c.inputAreaWidth=Math.max(f.railWidth,f.gripHeight);var d=t._fullLayout._size;c.lx=d.l+d.w*e.x,c.ly=d.t+d.h*(1-e.y),"fraction"===e.lenmode?c.outerLength=Math.round(d.w*e.len):c.outerLength=e.len,c.inputAreaStart=0,c.inputAreaLength=Math.round(c.outerLength-e.pad.l-e.pad.r);var h=(c.inputAreaLength-2*f.stepInset)/(e._stepCount-1),m=i+f.labelPadding;if(c.labelStride=Math.max(1,Math.ceil(m/h)),c.labelHeight=l,c.currentValueMaxWidth=0,c.currentValueHeight=0,c.currentValueTotalHeight=0,c.currentValueMaxLines=1,e.currentvalue.visible){var y=o.tester.append("g");r.each((function(t){var r=b(y,e,t.label),n=r.node()&&o.bBox(r.node())||{width:0,height:0},a=u.lineCount(r);c.currentValueMaxWidth=Math.max(c.currentValueMaxWidth,Math.ceil(n.width)),c.currentValueHeight=Math.max(c.currentValueHeight,Math.ceil(n.height)),c.currentValueMaxLines=Math.max(c.currentValueMaxLines,a)})),c.currentValueTotalHeight=c.currentValueHeight+e.currentvalue.offset,y.remove()}c.height=c.currentValueTotalHeight+f.tickOffset+e.ticklen+f.labelOffset+c.labelHeight+e.pad.t+e.pad.b;var x="left";s.isRightAnchor(e)&&(c.lx-=c.outerLength,x="right"),s.isCenterAnchor(e)&&(c.lx-=c.outerLength/2,x="center");var w="top";s.isBottomAnchor(e)&&(c.ly-=c.height,w="bottom"),s.isMiddleAnchor(e)&&(c.ly-=c.height/2,w="middle"),c.outerLength=Math.ceil(c.outerLength),c.height=Math.ceil(c.height),c.lx=Math.round(c.lx),c.ly=Math.round(c.ly);var A={y:e.y,b:c.height*g[w],t:c.height*p[w]};"fraction"===e.lenmode?(A.l=0,A.xl=e.x-e.len*p[x],A.r=0,A.xr=e.x+e.len*g[x]):(A.x=e.x,A.l=c.outerLength*p[x],A.r=c.outerLength*g[x]),a.autoMargin(t,v(e),A)}function b(t,e,r){if(e.currentvalue.visible){var n,a,i=e._dims;switch(e.currentvalue.xanchor){case"right":n=i.inputAreaLength-f.currentValueInset-i.currentValueMaxWidth,a="left";break;case"center":n=.5*i.inputAreaLength,a="middle";break;default:n=f.currentValueInset,a="left"}var l=s.ensureSingle(t,"text",f.labelClass,(function(t){t.attr({"text-anchor":a,"data-notex":1})})),c=e.currentvalue.prefix?e.currentvalue.prefix:"";if("string"==typeof r)c+=r;else{var d=e.steps[e.active].label,p=e._gd._fullLayout._meta;p&&(d=s.templateString(d,p)),c+=d}e.currentvalue.suffix&&(c+=e.currentvalue.suffix),l.call(o.font,e.currentvalue.font).text(c).call(u.convertToTspans,e._gd);var g=u.lineCount(l),v=(i.currentValueMaxLines+1-g)*e.currentvalue.font.size*h;return u.positionText(l,n,v),l}}function x(t,e,r){s.ensureSingle(t,"rect",f.gripRectClass,(function(n){n.call(k,e,t,r).style("pointer-events","all")})).attr({width:f.gripWidth,height:f.gripHeight,rx:f.gripRadius,ry:f.gripRadius}).call(i.stroke,r.bordercolor).call(i.fill,r.bgcolor).style("stroke-width",r.borderwidth+"px")}function _(t,e,r){var n=s.ensureSingle(t,"text",f.labelClass,(function(t){t.attr({"text-anchor":"middle","data-notex":1})})),a=e.step.label,i=r._gd._fullLayout._meta;return i&&(a=s.templateString(a,i)),n.call(o.font,r.font).text(a).call(u.convertToTspans,r._gd),n}function w(t,e){var r=s.ensureSingle(t,"g",f.labelsClass),a=e._dims,i=r.selectAll("g."+f.labelGroupClass).data(a.labelSteps);i.enter().append("g").classed(f.labelGroupClass,!0),i.exit().remove(),i.each((function(t){var r=n.select(this);r.call(_,t,e),o.setTranslate(r,S(e,t.fraction),f.tickOffset+e.ticklen+e.font.size*h+f.labelOffset+a.currentValueTotalHeight)}))}function A(t,e,r,n,a){var i=Math.round(n*(r._stepCount-1)),o=r._visibleSteps[i]._index;o!==r.active&&T(t,e,r,o,!0,a)}function T(t,e,r,n,i,o){var s=r.active;r.active=n,c(t.layout,f.name,r).applyUpdate("active",n);var l=r.steps[r.active];e.call(E,r,o),e.call(b,r),t.emit("plotly_sliderchange",{slider:r,step:r.steps[r.active],interaction:i,previousActive:s}),l&&l.method&&i&&(e._nextMethod?(e._nextMethod.step=l,e._nextMethod.doCallback=i,e._nextMethod.doTransition=o):(e._nextMethod={step:l,doCallback:i,doTransition:o},e._nextMethodRaf=window.requestAnimationFrame((function(){var r=e._nextMethod.step;r.method&&(r.execute&&a.executeAPICommand(t,r.method,r.args),e._nextMethod=null,e._nextMethodRaf=null)}))))}function k(t,e,r){var a=r.node(),o=n.select(e);function s(){return r.data()[0]}t.on("mousedown",(function(){var t=s();e.emit("plotly_sliderstart",{slider:t});var l=r.select("."+f.gripRectClass);n.event.stopPropagation(),n.event.preventDefault(),l.call(i.fill,t.activebgcolor);var u=C(t,n.mouse(a)[0]);A(e,r,t,u,!0),t._dragging=!0,o.on("mousemove",(function(){var t=s(),i=C(t,n.mouse(a)[0]);A(e,r,t,i,!1)})),o.on("mouseup",(function(){var t=s();t._dragging=!1,l.call(i.fill,t.bgcolor),o.on("mouseup",null),o.on("mousemove",null),e.emit("plotly_sliderend",{slider:t,step:t.steps[t.active]})}))}))}function M(t,e){var r=t.selectAll("rect."+f.tickRectClass).data(e._visibleSteps),a=e._dims;r.enter().append("rect").classed(f.tickRectClass,!0),r.exit().remove(),r.attr({width:e.tickwidth+"px","shape-rendering":"crispEdges"}),r.each((function(t,r){var s=r%a.labelStride==0,l=n.select(this);l.attr({height:s?e.ticklen:e.minorticklen}).call(i.fill,e.tickcolor),o.setTranslate(l,S(e,r/(e._stepCount-1))-.5*e.tickwidth,(s?f.tickOffset:f.minorTickOffset)+a.currentValueTotalHeight)}))}function E(t,e,r){for(var n=t.select("rect."+f.gripRectClass),a=0,i=0;i<e._stepCount;i++)if(e._visibleSteps[i]._index===e.active){a=i;break}var o=S(e,a/(e._stepCount-1));if(!e._invokingCommand){var s=n;r&&e.transition.duration>0&&(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;a<r.length;a++){var i=r[a];i.visible&&(i._gd=e,n.push(i))}return n}(e,t),i=e._infolayer.selectAll("g."+f.containerClassName).data(r.length>0?[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;u<r.length;u++){var c=r[u];y(t,c)}l.each((function(e){var r=n.select(this);!function(t){var e=t._dims;e.labelSteps=[];for(var r=t._stepCount,n=0;n<r;n+=e.labelStride)e.labelSteps.push({fraction:n/(r-1),step:t._visibleSteps[n]})}(e),a.manageCommandObserver(t,e,e._visibleSteps,(function(e){var n=r.data()[0];n.active!==e.index&&(n._dragging||T(t,r,n,e.index,!1,!0))})),function(t,e,r){(r.steps[r.active]||{}).visible||(r.active=r._visibleSteps[0]._index);e.call(b,r).call(O,r).call(w,r).call(M,r).call(L,t,r).call(x,t,r);var n=r._dims;o.setTranslate(e,n.lx+r.pad.l,n.ly+r.pad.t),e.call(E,r,!1),e.call(b,r)}(t,n.select(this),e)}))}}},{"../../constants/alignment":470,"../../lib":498,"../../lib/svg_text_utils":523,"../../plot_api/plot_template":536,"../../plots/plots":585,"../color":368,"../drawing":390,"./constants":459,d3:86}],462:[function(t,e,r){"use strict";var n=t("./constants");e.exports={moduleType:"component",name:n.name,layoutAttributes:t("./attributes"),supplyLayoutDefaults:t("./defaults"),draw:t("./draw")}},{"./attributes":458,"./constants":459,"./defaults":460,"./draw":461}],463:[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("../drawing"),c=t("../color"),f=t("../../lib/svg_text_utils"),d=t("../../constants/interactions"),h=t("../../constants/alignment").OPPOSITE_SIDE,p=/ [XY][0-9]* /;e.exports={draw:function(t,e,r){var g,v=r.propContainer,m=r.propName,y=r.placeholder,b=r.traceIndex,x=r.avoid||{},_=r.attributes,w=r.transform,A=r.containerGroup,T=t._fullLayout,k=1,M=!1,E=v.title,S=(E&&E.text?E.text:"").trim(),C=E&&E.font?E.font:{},L=C.family,O=C.size,D=C.color;"title.text"===m?g="titleText":-1!==m.indexOf("axis")?g="axisTitleText":m.indexOf(!0)&&(g="colorbarTitleText");var R=t._context.edits[g];""===S?k=0:S.replace(p," % ")===y.replace(p," % ")&&(k=.2,M=!0,R||(S="")),r._meta?S=s.templateString(S,r._meta):T._meta&&(S=s.templateString(S,T._meta));var I=S||R;A||(A=s.ensureSingle(T._infolayer,"g","g-"+e));var P=A.selectAll("text").data(I?[0]:[]);if(P.enter().append("text"),P.text(S).attr("class",e),P.exit().remove(),!I)return A;function F(t){s.syncOrAsync([z,N],t)}function z(e){var r;return w?(r="",w.rotate&&(r+="rotate("+[w.rotate,_.x,_.y]+")"),w.offset&&(r+=l(0,w.offset))):r=null,e.attr("transform",r),e.style({"font-family":L,"font-size":n.round(O,2)+"px",fill:c.rgb(D),opacity:k*c.opacity(D),"font-weight":i.fontWeight}).attr(_).call(f.convertToTspans,t),i.previousPromises(t)}function N(t){var e=n.select(t.node().parentNode);if(x&&x.selection&&x.side&&S){e.attr("transform",null);var r=h[x.side],i="left"===x.side||"top"===x.side?-1:1,o=a(x.pad)?x.pad:2,c=u.bBox(e.node()),f={left:0,top:0,right:T.width,bottom:T.height},d=x.maxShift||i*(f[x.side]-c[x.side]),p=0;if(d<0)p=d;else{var g=x.offsetLeft||0,v=x.offsetTop||0;c.left-=g,c.right-=g,c.top-=v,c.bottom-=v,x.selection.each((function(){var t=u.bBox(this);s.bBoxIntersect(c,t,o)&&(p=Math.max(p,i*(t[x.side]-c[r])+o))})),p=Math.min(d,p)}if(p>0||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;l<h;l++)s+=d.heights[l]+f.gapButton;else for(o=0,l=0;l<h;l++)o+=d.widths[l]+f.gapButton;n.enable(i,o,s),n.hbar&&n.hbar.attr("opacity","0").transition().attr("opacity","1");n.vbar&&n.vbar.attr("opacity","0").transition().attr("opacity","1")}(0,0,0,i,o,T):function(t){var e=!!t.hbar,r=!!t.vbar;e&&t.hbar.transition().attr("opacity","0").each("end",(function(){e=!1,r||t.disable()}));r&&t.vbar.transition().attr("opacity","0").each("end",(function(){r=!1,e||t.disable()}))}(i))}function y(t,e,r,n){t.call(b,e).call(x,e,r,n)}function b(t,e){s.ensureSingle(t,"rect",f.itemRectClassName,(function(t){t.attr({rx:f.rx,ry:f.ry,"shape-rendering":"crispEdges"})})).call(i.stroke,e.bordercolor).call(i.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px")}function x(t,e,r,n){var a=s.ensureSingle(t,"text",f.itemTextClassName,(function(t){t.attr({"text-anchor":"start","data-notex":1})})),i=r.label,u=n._fullLayout._meta;u&&(i=s.templateString(i,u)),a.call(o.font,e.font).text(i).call(l.convertToTspans,n)}function _(t,e){var r=e.active;t.each((function(t,a){var o=n.select(this);a===r&&e.showactive&&o.select("rect."+f.itemRectClassName).call(i.fill,f.activeColor)}))}function w(t){t.select("rect."+f.itemRectClassName).call(i.fill,f.hoverColor)}function A(t,e){t.select("rect."+f.itemRectClassName).call(i.fill,e.bgcolor)}function T(t,e){var r=e._dims={width1:0,height1:0,heights:[],widths:[],totalWidth:0,totalHeight:0,openWidth:0,openHeight:0,lx:0,ly:0},i=o.tester.selectAll("g."+f.dropdownButtonClassName).data(s.filterVisible(e.buttons));i.enter().append("g").classed(f.dropdownButtonClassName,!0);var u=-1!==["up","down"].indexOf(e.direction);i.each((function(a,i){var s=n.select(this);s.call(y,e,a,t);var d=s.select("."+f.itemTextClassName),h=d.node()&&o.bBox(d.node()).width,p=Math.max(h+f.textPadX,f.minWidth),g=e.font.size*c,v=l.lineCount(d),m=Math.max(g*v,f.minHeight)+f.textOffsetY;m=Math.ceil(m),p=Math.ceil(p),r.widths[i]=p,r.heights[i]=m,r.height1=Math.max(r.height1,m),r.width1=Math.max(r.width1,p),u?(r.totalWidth=Math.max(r.totalWidth,p),r.openWidth=r.totalWidth,r.totalHeight+=m+f.gapButton,r.openHeight+=m+f.gapButton):(r.totalWidth+=p+f.gapButton,r.openWidth+=p+f.gapButton,r.totalHeight=Math.max(r.totalHeight,m),r.openHeight=r.totalHeight)})),u?r.totalHeight-=f.gapButton:r.totalWidth-=f.gapButton,r.headerWidth=r.width1+f.arrowPadX,r.headerHeight=r.height1,"dropdown"===e.type&&(u?(r.width1+=f.arrowPadX,r.totalHeight=r.height1):r.totalWidth=r.width1,r.totalWidth+=f.arrowPadX),i.remove();var d=r.totalWidth+e.pad.l+e.pad.r,h=r.totalHeight+e.pad.t+e.pad.b,p=t._fullLayout._size;r.lx=p.l+p.w*e.x,r.ly=p.t+p.h*(1-e.y);var g="left";s.isRightAnchor(e)&&(r.lx-=d,g="right"),s.isCenterAnchor(e)&&(r.lx-=d/2,g="center");var v="top";s.isBottomAnchor(e)&&(r.ly-=h,v="bottom"),s.isMiddleAnchor(e)&&(r.ly-=h/2,v="middle"),r.totalWidth=Math.ceil(r.totalWidth),r.totalHeight=Math.ceil(r.totalHeight),r.lx=Math.round(r.lx),r.ly=Math.round(r.ly),a.autoMargin(t,k(e),{x:e.x,y:e.y,l:d*({right:1,center:.5}[g]||0),r:d*({left:1,center:.5}[g]||0),b:h*({top:1,middle:.5}[v]||0),t:h*({bottom:1,middle:.5}[v]||0)})}function k(t){return f.autoMarginIdRoot+t._index}function M(t,e,r,n){n=n||{};var a=t.select("."+f.itemRectClassName),i=t.select("."+f.itemTextClassName),s=e.borderwidth,u=r.index,d=e._dims;o.setTranslate(t,s+r.x,s+r.y);var h=-1!==["up","down"].indexOf(e.direction),p=n.height||(h?d.heights[u]:d.height1);a.attr({x:0,y:0,width:n.width||(h?d.width1:d.widths[u]),height:p});var g=e.font.size*c,v=(l.lineCount(i)-1)*g/2;l.positionText(i,f.textOffsetX,p/2-v+f.textOffsetY),h?r.y+=d.heights[u]+r.yPad:r.x+=d.widths[u]+r.xPad,r.index++}function E(t,e){t.attr(f.menuIndexAttrName,e||"-1").selectAll("g."+f.dropdownButtonClassName).remove()}e.exports=function(t){var e=t._fullLayout,r=s.filterVisible(e[f.name]);function i(e){a.autoMargin(t,k(e))}var o=e._menulayer.selectAll("g."+f.containerClassName).data(r.length>0?[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;c<r.length;c++){var y=r[c];T(t,y)}var b="updatemenus"+e._uid,x=new d(t,u,b);l.enter().size()&&(u.node().parentNode.appendChild(u.node()),u.call(E)),l.exit().each((function(t){u.call(E),i(t)})).remove(),l.each((function(e){var r=n.select(this),i="dropdown"===e.type?u:null;a.manageCommandObserver(t,e,e.buttons,(function(n){g(t,e,e.buttons[n.index],r,i,x,n.index,!0)})),"dropdown"===e.type?(v(t,r,u,x,e),p(u,e)&&m(t,r,u,x,e)):m(t,r,null,null,e)}))}}},{"../../constants/alignment":470,"../../lib":498,"../../lib/svg_text_utils":523,"../../plot_api/plot_template":536,"../../plots/plots":585,"../color":368,"../drawing":390,"./constants":465,"./scrollbox":469,d3:86}],468:[function(t,e,r){arguments[4][462][0].apply(r,arguments)},{"./attributes":464,"./constants":465,"./defaults":466,"./draw":467,dup:462}],469:[function(t,e,r){"use strict";e.exports=s;var n=t("d3"),a=t("../color"),i=t("../drawing"),o=t("../../lib");function s(t,e,r){this.gd=t,this.container=e,this.id=r,this.position=null,this.translateX=null,this.translateY=null,this.hbar=null,this.vbar=null,this.bg=this.container.selectAll("rect.scrollbox-bg").data([0]),this.bg.exit().on(".drag",null).on("wheel",null).remove(),this.bg.enter().append("rect").classed("scrollbox-bg",!0).style("pointer-events","all").attr({opacity:0,x:0,y:0,width:0,height:0})}s.barWidth=2,s.barLength=20,s.barRadius=2,s.barPad=1,s.barColor="#808BA4",s.prototype.enable=function(t,e,r){var o=this.gd._fullLayout,l=o.width,u=o.height;this.position=t;var c,f,d,h,p=this.position.l,g=this.position.w,v=this.position.t,m=this.position.h,y=this.position.direction,b="down"===y,x="left"===y,_="up"===y,w=g,A=m;b||x||"right"===y||_||(this.position.direction="down",b=!0),b||_?(f=(c=p)+w,b?(d=v,A=(h=Math.min(d+A,u))-d):A=(h=v+A)-(d=Math.max(h-A,0))):(h=(d=v)+A,x?w=(f=p+w)-(c=Math.max(f-w,0)):(c=p,w=(f=Math.min(c+w,l))-c)),this._box={l:c,t:d,w:w,h:A};var T=g>w,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;s<o.length;s++){var l=o[s];"_"!==l.charAt(0)&&(r[l]=i[l]),a({moduleType:"apiMethod",name:l,fn:i[l]})}a(t("./traces/scatter")),a([t("./components/legend"),t("./components/fx"),t("./components/annotations"),t("./components/annotations3d"),t("./components/shapes"),t("./components/images"),t("./components/updatemenus"),t("./components/sliders"),t("./components/rangeslider"),t("./components/rangeselector"),t("./components/grid"),t("./components/errorbars"),t("./components/colorscale"),t("./components/colorbar")]),a([t("./locale-en"),t("./locale-en-us")]),window.PlotlyLocales&&Array.isArray(window.PlotlyLocales)&&(a(window.PlotlyLocales),delete window.PlotlyLocales),r.Icons=t("./fonts/ploticon"),r.Plots=t("./plots/plots"),r.Fx=t("./components/fx"),r.Snapshot=t("./snapshot"),r.PlotSchema=t("./plot_api/plot_schema"),r.Queue=t("./lib/queue"),r.d3=t("d3")},{"../build/plotcss":1,"./components/annotations":361,"./components/annotations3d":366,"./components/colorbar":374,"./components/colorscale":380,"./components/errorbars":396,"./components/fx":408,"./components/grid":412,"./components/images":417,"./components/legend":425,"./components/rangeselector":436,"./components/rangeslider":443,"./components/shapes":457,"./components/sliders":462,"./components/updatemenus":468,"./fonts/mathjax_config":478,"./fonts/ploticon":479,"./lib/queue":514,"./locale-en":527,"./locale-en-us":526,"./plot_api":531,"./plot_api/plot_schema":535,"./plots/plots":585,"./registry":593,"./snapshot":598,"./traces/scatter":666,"./version":707,d3:86,"es6-promise":139}],478:[function(t,e,r){"use strict";e.exports=function(){"undefined"!=typeof MathJax&&("local"!==(window.PlotlyConfig||{}).MathJaxConfig&&(MathJax.Hub.Config({messageStyle:"none",skipStartupTypeset:!0,displayAlign:"left",tex2jax:{inlineMath:[["$","$"],["\\(","\\)"]]}}),MathJax.Hub.Configured()))}},{}],479:[function(t,e,r){"use strict";e.exports={undo:{width:857.1,height:1e3,path:"m857 350q0-87-34-166t-91-137-137-92-166-34q-96 0-183 41t-147 114q-4 6-4 13t5 11l76 77q6 5 14 5 9-1 13-7 41-53 100-82t126-29q58 0 110 23t92 61 61 91 22 111-22 111-61 91-92 61-110 23q-55 0-105-20t-90-57l77-77q17-16 8-38-10-23-33-23h-250q-15 0-25 11t-11 25v250q0 24 22 33 22 10 39-8l72-72q60 57 137 88t159 31q87 0 166-34t137-92 91-137 34-166z",transform:"matrix(1 0 0 -1 0 850)"},home:{width:928.6,height:1e3,path:"m786 296v-267q0-15-11-26t-25-10h-214v214h-143v-214h-214q-15 0-25 10t-11 26v267q0 1 0 2t0 2l321 264 321-264q1-1 1-4z m124 39l-34-41q-5-5-12-6h-2q-7 0-12 3l-386 322-386-322q-7-4-13-4-7 2-12 7l-35 41q-4 5-3 13t6 12l401 334q18 15 42 15t43-15l136-114v109q0 8 5 13t13 5h107q8 0 13-5t5-13v-227l122-102q5-5 6-12t-4-13z",transform:"matrix(1 0 0 -1 0 850)"},"camera-retro":{width:1e3,height:1e3,path:"m518 386q0 8-5 13t-13 5q-37 0-63-27t-26-63q0-8 5-13t13-5 12 5 5 13q0 23 16 38t38 16q8 0 13 5t5 13z m125-73q0-59-42-101t-101-42-101 42-42 101 42 101 101 42 101-42 42-101z m-572-320h858v71h-858v-71z m643 320q0 89-62 152t-152 62-151-62-63-152 63-151 151-63 152 63 62 151z m-571 358h214v72h-214v-72z m-72-107h858v143h-462l-36-71h-360v-72z m929 143v-714q0-30-21-51t-50-21h-858q-29 0-50 21t-21 51v714q0 30 21 51t50 21h858q29 0 50-21t21-51z",transform:"matrix(1 0 0 -1 0 850)"},zoombox:{width:1e3,height:1e3,path:"m1000-25l-250 251c40 63 63 138 63 218 0 224-182 406-407 406-224 0-406-182-406-406s183-406 407-406c80 0 155 22 218 62l250-250 125 125z m-812 250l0 438 437 0 0-438-437 0z m62 375l313 0 0-312-313 0 0 312z",transform:"matrix(1 0 0 -1 0 850)"},pan:{width:1e3,height:1e3,path:"m1000 350l-187 188 0-125-250 0 0 250 125 0-188 187-187-187 125 0 0-250-250 0 0 125-188-188 186-187 0 125 252 0 0-250-125 0 187-188 188 188-125 0 0 250 250 0 0-126 187 188z",transform:"matrix(1 0 0 -1 0 850)"},zoom_plus:{width:875,height:1e3,path:"m1 787l0-875 875 0 0 875-875 0z m687-500l-187 0 0-187-125 0 0 187-188 0 0 125 188 0 0 187 125 0 0-187 187 0 0-125z",transform:"matrix(1 0 0 -1 0 850)"},zoom_minus:{width:875,height:1e3,path:"m0 788l0-876 875 0 0 876-875 0z m688-500l-500 0 0 125 500 0 0-125z",transform:"matrix(1 0 0 -1 0 850)"},autoscale:{width:1e3,height:1e3,path:"m250 850l-187 0-63 0 0-62 0-188 63 0 0 188 187 0 0 62z m688 0l-188 0 0-62 188 0 0-188 62 0 0 188 0 62-62 0z m-875-938l0 188-63 0 0-188 0-62 63 0 187 0 0 62-187 0z m875 188l0-188-188 0 0-62 188 0 62 0 0 62 0 188-62 0z m-125 188l-1 0-93-94-156 156 156 156 92-93 2 0 0 250-250 0 0-2 93-92-156-156-156 156 94 92 0 2-250 0 0-250 0 0 93 93 157-156-157-156-93 94 0 0 0-250 250 0 0 0-94 93 156 157 156-157-93-93 0 0 250 0 0 250z",transform:"matrix(1 0 0 -1 0 850)"},tooltip_basic:{width:1500,height:1e3,path:"m375 725l0 0-375-375 375-374 0-1 1125 0 0 750-1125 0z",transform:"matrix(1 0 0 -1 0 850)"},tooltip_compare:{width:1125,height:1e3,path:"m187 786l0 2-187-188 188-187 0 0 937 0 0 373-938 0z m0-499l0 1-187-188 188-188 0 0 937 0 0 376-938-1z",transform:"matrix(1 0 0 -1 0 850)"},plotlylogo:{width:1542,height:1e3,path:"m0-10h182v-140h-182v140z m228 146h183v-286h-183v286z m225 714h182v-1000h-182v1000z m225-285h182v-715h-182v715z m225 142h183v-857h-183v857z m231-428h182v-429h-182v429z m225-291h183v-138h-183v138z",transform:"matrix(1 0 0 -1 0 850)"},"z-axis":{width:1e3,height:1e3,path:"m833 5l-17 108v41l-130-65 130-66c0 0 0 38 0 39 0-1 36-14 39-25 4-15-6-22-16-30-15-12-39-16-56-20-90-22-187-23-279-23-261 0-341 34-353 59 3 60 228 110 228 110-140-8-351-35-351-116 0-120 293-142 474-142 155 0 477 22 477 142 0 50-74 79-163 96z m-374 94c-58-5-99-21-99-40 0-24 65-43 144-43 79 0 143 19 143 43 0 19-42 34-98 40v216h87l-132 135-133-135h88v-216z m167 515h-136v1c16 16 31 34 46 52l84 109v54h-230v-71h124v-1c-16-17-28-32-44-51l-89-114v-51h245v72z",transform:"matrix(1 0 0 -1 0 850)"},"3d_rotate":{width:1e3,height:1e3,path:"m922 660c-5 4-9 7-14 11-359 263-580-31-580-31l-102 28 58-400c0 1 1 1 2 2 118 108 351 249 351 249s-62 27-100 42c88 83 222 183 347 122 16-8 30-17 44-27-2 1-4 2-6 4z m36-329c0 0 64 229-88 296-62 27-124 14-175-11 157-78 225-208 249-266 8-19 11-31 11-31 2 5 6 15 11 32-5-13-8-20-8-20z m-775-239c70-31 117-50 198-32-121 80-199 346-199 346l-96-15-58-12c0 0 55-226 155-287z m603 133l-317-139c0 0 4-4 19-14 7-5 24-15 24-15s-177-147-389 4c235-287 536-112 536-112l31-22 100 299-4-1z m-298-153c6-4 14-9 24-15 0 0-17 10-24 15z",transform:"matrix(1 0 0 -1 0 850)"},camera:{width:1e3,height:1e3,path:"m500 450c-83 0-150-67-150-150 0-83 67-150 150-150 83 0 150 67 150 150 0 83-67 150-150 150z m400 150h-120c-16 0-34 13-39 29l-31 93c-6 15-23 28-40 28h-340c-16 0-34-13-39-28l-31-94c-6-15-23-28-40-28h-120c-55 0-100-45-100-100v-450c0-55 45-100 100-100h800c55 0 100 45 100 100v450c0 55-45 100-100 100z m-400-550c-138 0-250 112-250 250 0 138 112 250 250 250 138 0 250-112 250-250 0-138-112-250-250-250z m365 380c-19 0-35 16-35 35 0 19 16 35 35 35 19 0 35-16 35-35 0-19-16-35-35-35z",transform:"matrix(1 0 0 -1 0 850)"},movie:{width:1e3,height:1e3,path:"m938 413l-188-125c0 37-17 71-44 94 64 38 107 107 107 187 0 121-98 219-219 219-121 0-219-98-219-219 0-61 25-117 66-156h-115c30 33 49 76 49 125 0 103-84 187-187 187s-188-84-188-187c0-57 26-107 65-141-38-22-65-62-65-109v-250c0-70 56-126 125-126h500c69 0 125 56 125 126l188-126c34 0 62 28 62 63v375c0 35-28 63-62 63z m-750 0c-69 0-125 56-125 125s56 125 125 125 125-56 125-125-56-125-125-125z m406-1c-87 0-157 70-157 157 0 86 70 156 157 156s156-70 156-156-70-157-156-157z",transform:"matrix(1 0 0 -1 0 850)"},question:{width:857.1,height:1e3,path:"m500 82v107q0 8-5 13t-13 5h-107q-8 0-13-5t-5-13v-107q0-8 5-13t13-5h107q8 0 13 5t5 13z m143 375q0 49-31 91t-77 65-95 23q-136 0-207-119-9-14 4-24l74-55q4-4 10-4 9 0 14 7 30 38 48 51 19 14 48 14 27 0 48-15t21-33q0-21-11-34t-38-25q-35-16-65-48t-29-70v-20q0-8 5-13t13-5h107q8 0 13 5t5 13q0 10 12 27t30 28q18 10 28 16t25 19 25 27 16 34 7 45z m214-107q0-117-57-215t-156-156-215-58-216 58-155 156-58 215 58 215 155 156 216 58 215-58 156-156 57-215z",transform:"matrix(1 0 0 -1 0 850)"},disk:{width:857.1,height:1e3,path:"m214-7h429v214h-429v-214z m500 0h72v500q0 8-6 21t-11 20l-157 156q-5 6-19 12t-22 5v-232q0-22-15-38t-38-16h-322q-22 0-37 16t-16 38v232h-72v-714h72v232q0 22 16 38t37 16h465q22 0 38-16t15-38v-232z m-214 518v178q0 8-5 13t-13 5h-107q-7 0-13-5t-5-13v-178q0-8 5-13t13-5h107q7 0 13 5t5 13z m357-18v-518q0-22-15-38t-38-16h-750q-23 0-38 16t-16 38v750q0 22 16 38t38 16h517q23 0 50-12t42-26l156-157q16-15 27-42t11-49z",transform:"matrix(1 0 0 -1 0 850)"},drawopenpath:{width:70,height:70,path:"M33.21,85.65a7.31,7.31,0,0,1-2.59-.48c-8.16-3.11-9.27-19.8-9.88-41.3-.1-3.58-.19-6.68-.35-9-.15-2.1-.67-3.48-1.43-3.79-2.13-.88-7.91,2.32-12,5.86L3,32.38c1.87-1.64,11.55-9.66,18.27-6.9,2.13.87,4.75,3.14,5.17,9,.17,2.43.26,5.59.36,9.25a224.17,224.17,0,0,0,1.5,23.4c1.54,10.76,4,12.22,4.48,12.4.84.32,2.79-.46,5.76-3.59L43,80.07C41.53,81.57,37.68,85.64,33.21,85.65ZM74.81,69a11.34,11.34,0,0,0,6.09-6.72L87.26,44.5,74.72,32,56.9,38.35c-2.37.86-5.57,3.42-6.61,6L38.65,72.14l8.42,8.43ZM55,46.27a7.91,7.91,0,0,1,3.64-3.17l14.8-5.3,8,8L76.11,60.6l-.06.19a6.37,6.37,0,0,1-3,3.43L48.25,74.59,44.62,71Zm16.57,7.82A6.9,6.9,0,1,0,64.64,61,6.91,6.91,0,0,0,71.54,54.09Zm-4.05,0a2.85,2.85,0,1,1-2.85-2.85A2.86,2.86,0,0,1,67.49,54.09Zm-4.13,5.22L60.5,56.45,44.26,72.7l2.86,2.86ZM97.83,35.67,84.14,22l-8.57,8.57L89.26,44.24Zm-13.69-8,8,8-2.85,2.85-8-8Z",transform:"matrix(1 0 0 1 -15 -15)"},drawclosedpath:{width:90,height:90,path:"M88.41,21.12a26.56,26.56,0,0,0-36.18,0l-2.07,2-2.07-2a26.57,26.57,0,0,0-36.18,0,23.74,23.74,0,0,0,0,34.8L48,90.12a3.22,3.22,0,0,0,4.42,0l36-34.21a23.73,23.73,0,0,0,0-34.79ZM84,51.24,50.16,83.35,16.35,51.25a17.28,17.28,0,0,1,0-25.47,20,20,0,0,1,27.3,0l4.29,4.07a3.23,3.23,0,0,0,4.44,0l4.29-4.07a20,20,0,0,1,27.3,0,17.27,17.27,0,0,1,0,25.46ZM66.76,47.68h-33v6.91h33ZM53.35,35H46.44V68h6.91Z",transform:"matrix(1 0 0 1 -5 -5)"},lasso:{width:1031,height:1e3,path:"m1018 538c-36 207-290 336-568 286-277-48-473-256-436-463 10-57 36-108 76-151-13-66 11-137 68-183 34-28 75-41 114-42l-55-70 0 0c-2-1-3-2-4-3-10-14-8-34 5-45 14-11 34-8 45 4 1 1 2 3 2 5l0 0 113 140c16 11 31 24 45 40 4 3 6 7 8 11 48-3 100 0 151 9 278 48 473 255 436 462z m-624-379c-80 14-149 48-197 96 42 42 109 47 156 9 33-26 47-66 41-105z m-187-74c-19 16-33 37-39 60 50-32 109-55 174-68-42-25-95-24-135 8z m360 75c-34-7-69-9-102-8 8 62-16 128-68 170-73 59-175 54-244-5-9 20-16 40-20 61-28 159 121 317 333 354s407-60 434-217c28-159-121-318-333-355z",transform:"matrix(1 0 0 -1 0 850)"},selectbox:{width:1e3,height:1e3,path:"m0 850l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z m285 0l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z m-857-286l0-143 143 0 0 143-143 0z m857 0l0-143 143 0 0 143-143 0z m-857-285l0-143 143 0 0 143-143 0z m857 0l0-143 143 0 0 143-143 0z m-857-286l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z m285 0l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z",transform:"matrix(1 0 0 -1 0 850)"},drawline:{width:70,height:70,path:"M60.64,62.3a11.29,11.29,0,0,0,6.09-6.72l6.35-17.72L60.54,25.31l-17.82,6.4c-2.36.86-5.57,3.41-6.6,6L24.48,65.5l8.42,8.42ZM40.79,39.63a7.89,7.89,0,0,1,3.65-3.17l14.79-5.31,8,8L61.94,54l-.06.19a6.44,6.44,0,0,1-3,3.43L34.07,68l-3.62-3.63Zm16.57,7.81a6.9,6.9,0,1,0-6.89,6.9A6.9,6.9,0,0,0,57.36,47.44Zm-4,0a2.86,2.86,0,1,1-2.85-2.85A2.86,2.86,0,0,1,53.32,47.44Zm-4.13,5.22L46.33,49.8,30.08,66.05l2.86,2.86ZM83.65,29,70,15.34,61.4,23.9,75.09,37.59ZM70,21.06l8,8-2.84,2.85-8-8ZM87,80.49H10.67V87H87Z",transform:"matrix(1 0 0 1 -15 -15)"},drawrect:{width:80,height:80,path:"M78,22V79H21V22H78m9-9H12V88H87V13ZM68,46.22H31V54H68ZM53,32H45.22V69H53Z",transform:"matrix(1 0 0 1 -10 -10)"},drawcircle:{width:80,height:80,path:"M50,84.72C26.84,84.72,8,69.28,8,50.3S26.84,15.87,50,15.87,92,31.31,92,50.3,73.16,84.72,50,84.72Zm0-60.59c-18.6,0-33.74,11.74-33.74,26.17S31.4,76.46,50,76.46,83.74,64.72,83.74,50.3,68.6,24.13,50,24.13Zm17.15,22h-34v7.11h34Zm-13.8-13H46.24v34h7.11Z",transform:"matrix(1 0 0 1 -10 -10)"},eraseshape:{width:80,height:80,path:"M82.77,78H31.85L6,49.57,31.85,21.14H82.77a8.72,8.72,0,0,1,8.65,8.77V69.24A8.72,8.72,0,0,1,82.77,78ZM35.46,69.84H82.77a.57.57,0,0,0,.49-.6V29.91a.57.57,0,0,0-.49-.61H35.46L17,49.57Zm32.68-34.7-24,24,5,5,24-24Zm-19,.53-5,5,24,24,5-5Z",transform:"matrix(1 0 0 1 -10 -10)"},spikeline:{width:1e3,height:1e3,path:"M512 409c0-57-46-104-103-104-57 0-104 47-104 104 0 57 47 103 104 103 57 0 103-46 103-103z m-327-39l92 0 0 92-92 0z m-185 0l92 0 0 92-92 0z m370-186l92 0 0 93-92 0z m0-184l92 0 0 92-92 0z",transform:"matrix(1.5 0 0 -1.5 0 850)"},pencil:{width:1792,height:1792,path:"M491 1536l91-91-235-235-91 91v107h128v128h107zm523-928q0-22-22-22-10 0-17 7l-542 542q-7 7-7 17 0 22 22 22 10 0 17-7l542-542q7-7 7-17zm-54-192l416 416-832 832h-416v-416zm683 96q0 53-37 90l-166 166-416-416 166-165q36-38 90-38 53 0 91 38l235 234q37 39 37 91z",transform:"matrix(1 0 0 1 0 1)"},newplotlylogo:{name:"newplotlylogo",svg:"<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 132 132'><defs><style>.cls-1 {fill: #3f4f75;} .cls-2 {fill: #80cfbe;} .cls-3 {fill: #fff;}</style></defs><title>plotly-logomark</title><g id='symbol'><rect class='cls-1' width='132' height='132' rx='6' ry='6'/><circle class='cls-2' cx='78' cy='54' r='6'/><circle class='cls-2' cx='102' cy='30' r='6'/><circle class='cls-2' cx='78' cy='30' r='6'/><circle class='cls-2' cx='54' cy='30' r='6'/><circle class='cls-2' cx='30' cy='30' r='6'/><circle class='cls-2' cx='30' cy='54' r='6'/><path class='cls-3' d='M30,72a6,6,0,0,0-6,6v24a6,6,0,0,0,12,0V78A6,6,0,0,0,30,72Z'/><path class='cls-3' d='M78,72a6,6,0,0,0-6,6v24a6,6,0,0,0,12,0V78A6,6,0,0,0,78,72Z'/><path class='cls-3' d='M54,48a6,6,0,0,0-6,6v48a6,6,0,0,0,12,0V54A6,6,0,0,0,54,48Z'/><path class='cls-3' d='M102,48a6,6,0,0,0-6,6v48a6,6,0,0,0,12,0V54A6,6,0,0,0,102,48Z'/></g></svg>"}}},{}],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]<e[1]?(r=e[0],n=e[1]):(r=e[1],n=e[0]),(r=a(r,s))>(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<n?(c=r,d=n):(c=n,d=r),t<e?(h=t,p=e):(h=e,p=t);var m,y=Math.abs(d-c)<=o?0:1;function b(t,e,r){return"A"+[t,t]+" "+[0,y,r]+" "+v(t,e)}return g?m=null===h?"M"+v(p,c)+b(p,f,0)+b(p,d,0)+"Z":"M"+v(h,c)+b(h,f,0)+b(h,d,0)+"ZM"+v(p,c)+b(p,f,1)+b(p,d,1)+"Z":null===h?(m="M"+v(p,c)+b(p,d,0),u&&(m+="L0,0Z")):m="M"+v(h,c)+"L"+v(p,c)+b(p,d,0)+"L"+v(h,d)+b(h,c,1)+"Z",m}e.exports={deg2rad:function(t){return t/180*o},rad2deg:function(t){return t/o*180},angleDelta:u,angleDist:function(t,e){return Math.abs(u(t,e))},isFullCircle:l,isAngleInsideSector:c,isPtInsideSector:function(t,e,r,n){return!!c(e,n)&&(r[0]<r[1]?(a=r[0],i=r[1]):(a=r[1],i=r[0]),t>=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;a<t.length;a++)n=e(n,t[a].length);return n}return t.length}return 0}r.isTypedArray=o,r.isArrayOrTypedArray=s,r.isArray1D=function(t){return!s(t[0])},r.ensureArray=function(t,e){return n(t)||(t=[]),t.length=e,t},r.concat=function(){var t,e,r,a,i,o,s,l,u=[],c=!0,f=0;for(r=0;r<arguments.length;r++)(o=(a=arguments[r]).length)&&(e?u.push(a):(e=a,i=o),n(a)?t=!1:(c=!1,f?t!==a.constructor&&(t=!1):t=a.constructor),f+=o);if(!f)return[];if(!u.length)return e;if(c)return e.concat.apply(e,u);if(t){for((s=new t(f)).set(e),r=0;r<u.length;r++)a=u[r],s.set(a,i),i+=a.length;return s}for(s=new Array(f),l=0;l<e.length;l++)s[l]=e[l];for(r=0;r<u.length;r++){for(a=u[r],l=0;l<a.length;l++)s[i+l]=a[l];i+=l}return s},r.maxRowLength=function(t){return l(t,Math.max,0)},r.minRowLength=function(t){return l(t,Math.min,1/0)}},{}],483:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../constants/numerical").BADNUM,i=/^['"%,$#\s']+|[, ]|['"%,$#\s']+$/g;e.exports=function(t){return"string"==typeof t&&(t=t.replace(i,"")),n(t)?Number(t):a}},{"../constants/numerical":475,"fast-isnumeric":155}],484:[function(t,e,r){"use strict";e.exports=function(t){var e=t._fullLayout;e._glcanvas&&e._glcanvas.size()&&e._glcanvas.each((function(t){t.regl&&t.regl.clear({color:!0,depth:!0})}))}},{}],485:[function(t,e,r){"use strict";e.exports=function(t){t._responsiveChartHandler&&(window.removeEventListener("resize",t._responsiveChartHandler),delete t._responsiveChartHandler)}},{}],486:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("tinycolor2"),i=t("../plots/attributes"),o=t("../components/colorscale/scales"),s=t("../constants/interactions").DESELECTDIM,l=t("./nested_property"),u=t("./regex").counter,c=t("./mod").modHalf,f=t("./array").isArrayOrTypedArray;function d(t,e){var n=r.valObjectMeta[e.valType];if(e.arrayOk&&f(t))return!0;if(n.validateFunction)return n.validateFunction(t,e);var a={},i=a,o={set:function(t){i=t}};return n.coerceFunction(t,o,a,e),i!==a}r.valObjectMeta={data_array:{coerceFunction:function(t,e,r){f(t)?e.set(t):void 0!==r&&e.set(r)}},enumerated:{coerceFunction:function(t,e,r,n){n.coerceNumber&&(t=+t),-1===n.values.indexOf(t)?e.set(r):e.set(t)},validateFunction:function(t,e){e.coerceNumber&&(t=+t);for(var r=e.values,n=0;n<r.length;n++){var a=String(r[n]);if("/"===a.charAt(0)&&"/"===a.charAt(a.length-1)){if(new RegExp(a.substr(1,a.length-2)).test(t))return!0}else if(t===r[n])return!0}return!1}},boolean:{coerceFunction:function(t,e,r){!0===t||!1===t?e.set(t):e.set(r)}},number:{coerceFunction:function(t,e,r,a){!n(t)||void 0!==a.min&&t<a.min||void 0!==a.max&&t>a.max?e.set(r):e.set(+t)}},integer:{coerceFunction:function(t,e,r,a){t%1||!n(t)||void 0!==a.min&&t<a.min||void 0!==a.max&&t>a.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<a.length;){var o=a[i];-1===n.flags.indexOf(o)||a.indexOf(o)<i?a.splice(i,1):i++}a.length?e.set(a.join("+")):e.set(r)}else e.set(t);else e.set(r)}},any:{coerceFunction:function(t,e,r){void 0===t?e.set(r):e.set(t)}},info_array:{coerceFunction:function(t,e,n,a){function i(t,e,n){var a,i={set:function(t){a=t}};return void 0===n&&(n=e.dflt),r.valObjectMeta[e.valType].coerceFunction(t,i,n,e),a}var o=2===a.dimensions||"1-2"===a.dimensions&&Array.isArray(t)&&Array.isArray(t[0]);if(Array.isArray(t)){var s,l,u,c,f,d,h=a.items,p=[],g=Array.isArray(h),v=g&&o&&Array.isArray(h[0]),m=o&&g&&!v,y=g&&!m?h.length:t.length;if(n=Array.isArray(n)?n:[],o)for(s=0;s<y;s++)for(p[s]=[],u=Array.isArray(t[s])?t[s]:[],f=m?h.length:g?h[s].length:u.length,l=0;l<f;l++)c=m?h[l]:g?h[s][l]:h,void 0!==(d=i(u[l],c,(n[s]||[])[l]))&&(p[s][l]=d);else for(s=0;s<y;s++)void 0!==(d=i(t[s],g?h[s]:h,n[s]))&&(p[s]=d);e.set(p)}else e.set(n)},validateFunction:function(t,e){if(!Array.isArray(t))return!1;var r=e.items,n=Array.isArray(r),a=2===e.dimensions;if(!e.freeLength&&t.length!==r.length)return!1;for(var i=0;i<t.length;i++)if(a){if(!Array.isArray(t[i])||!e.freeLength&&t[i].length!==r[i].length)return!1;for(var o=0;o<t[i].length;o++)if(!d(t[i][o],n?r[i][o]:r))return!1}else if(!d(t[i],n?r[i]:r))return!1;return!0}}},r.coerce=function(t,e,n,a,i){var o=l(n,a).get(),s=l(t,a),u=l(e,a),c=s.get(),h=e._template;if(void 0===c&&h&&(c=l(h,a).get(),h=0),void 0===i&&(i=o.dflt),o.arrayOk&&f(c))return u.set(c),c;var p=r.valObjectMeta[o.valType].coerceFunction;p(c,u,i,o);var g=u.get();return h&&g===i&&!d(c,o)&&(p(c=l(h,a).get(),u,i,o),g=u.get()),g},r.coerce2=function(t,e,n,a,i){var o=l(t,a),s=r.coerce(t,e,n,a,i),u=o.get();return null!=u&&s},r.coerceFont=function(t,e,r){var n={};return r=r||{},n.family=t(e+".family",r.family),n.size=t(e+".size",r.size),n.color=t(e+".color",r.color),n},r.coerceHoverinfo=function(t,e,n){var a,o=e._module.attributes,s=o.hoverinfo?o:i,l=s.hoverinfo;if(1===n._dataLength){var u="all"===l.dflt?l.flags.slice():l.dflt.split("+");u.splice(u.indexOf("name"),1),a=u.join("+")}return r.coerce(t,e,s,"hoverinfo",a)},r.coerceSelectionMarkerOpacity=function(t,e){if(t.marker){var r,n,a=t.marker.opacity;if(void 0!==a)f(a)||t.selected||t.unselected||(r=a,n=s*a),e("selected.marker.opacity",r),e("unselected.marker.opacity",n)}},r.validate=d},{"../components/colorscale/scales":383,"../constants/interactions":474,"../plots/attributes":543,"./array":482,"./mod":505,"./nested_property":506,"./regex":515,"fast-isnumeric":155,tinycolor2:322}],487:[function(t,e,r){"use strict";var n,a,i=t("d3-time-format").timeFormat,o=t("fast-isnumeric"),s=t("./loggers"),l=t("./mod").mod,u=t("../constants/numerical"),c=u.BADNUM,f=u.ONEDAY,d=u.ONEHOUR,h=u.ONEMIN,p=u.ONESEC,g=u.EPOCHJD,v=t("../registry"),m=t("d3-time-format").utcFormat,y=/^\s*(-?\d\d\d\d|\d\d)(-(\d?\d)(-(\d?\d)([ Tt]([01]?\d|2[0-3])(:([0-5]\d)(:([0-5]\d(\.\d+)?))?(Z|z|[+\-]\d\d(:?\d\d)?)?)?)?)?)?\s*$/m,b=/^\s*(-?\d\d\d\d|\d\d)(-(\d?\di?)(-(\d?\d)([ Tt]([01]?\d|2[0-3])(:([0-5]\d)(:([0-5]\d(\.\d+)?))?(Z|z|[+\-]\d\d(:?\d\d)?)?)?)?)?)?\s*$/m,x=(new Date).getFullYear()-70;function _(t){return t&&v.componentsRegistry.calendars&&"string"==typeof t&&"gregorian"!==t}function w(t,e){return String(t+Math.pow(10,e)).substr(1)}r.dateTick0=function(t,e){var n=function(t,e){return _(t)?e?v.getComponentMethod("calendars","CANONICAL_SUNDAY")[t]:v.getComponentMethod("calendars","CANONICAL_TICK")[t]:e?"2000-01-02":"2000-01-01"}(t,!!e);if(e<2)return n;var a=r.dateTime2ms(n,t);return a+=f*(e-1),r.ms2DateTime(a,0,t)},r.dfltRange=function(t){return _(t)?v.getComponentMethod("calendars","DFLTRANGE")[t]:["2000-01-01","2001-01-01"]},r.isJSDate=function(t){return"object"==typeof t&&null!==t&&"function"==typeof t.getTime},r.dateTime2ms=function(t,e){if(r.isJSDate(t)){var i=t.getTimezoneOffset()*h,o=(t.getUTCMinutes()-t.getMinutes())*h+(t.getUTCSeconds()-t.getSeconds())*p+(t.getUTCMilliseconds()-t.getMilliseconds());if(o){var s=3*h;i=i-s/2+l(o-i+s/2,s)}return(t=Number(t)-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<A?Math.floor(S/d):0,s=e<A?Math.floor(S%d/h):0,u=e<T?Math.floor(S%h/p):0,y=e<k?S%p*10+x:0}else b=new Date(w),i=m("%Y-%m-%d")(b),o=e<A?b.getUTCHours():0,s=e<A?b.getUTCMinutes():0,u=e<T?b.getUTCSeconds():0,y=e<k?10*b.getUTCMilliseconds()+x:0;return M(i,o,s,u,y)},r.ms2DateTimeLocal=function(t){if(!(t>=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;c<t.length;c++)if(n=t[c],o(n)){if(!(n%f))if(u)try{1===(r=u.fromJD(n/f+g)).day()?1===r.month()?a++:i++:s++}catch(t){}else 1===(r=new Date(n)).getUTCDate()?0===r.getUTCMonth()?a++:i++:s++}else l++;s+=i+=a;var d=t.length-l;return{exactYears:a/d,exactMonths:i/d,exactDays:s/d}}},{"../constants/numerical":475,"../registry":593,"./loggers":502,"./mod":505,"d3-time-format":84,"fast-isnumeric":155}],488:[function(t,e,r){"use strict";var n=t("d3"),a=t("./loggers"),i=t("./matrix"),o=t("gl-mat4");function s(t){var e=t&&t.parentNode;e&&e.removeChild(t)}function l(t,e,r){var n="plotly.js-style-"+t,i=document.getElementById(n);i||((i=document.createElement("style")).setAttribute("id",n),i.appendChild(document.createTextNode("")),document.head.appendChild(i));var o=i.sheet;o.insertRule?o.insertRule(e+"{"+r+"}",0):o.addRule?o.addRule(e,r,0):a.warn("addStyleRule failed")}function u(t){var e=window.getComputedStyle(t,null),r=e.getPropertyValue("-webkit-transform")||e.getPropertyValue("-moz-transform")||e.getPropertyValue("-ms-transform")||e.getPropertyValue("-o-transform")||e.getPropertyValue("transform");return"none"===r?null:r.replace("matrix","").replace("3d","").slice(1,-1).split(",").map((function(t){return+t}))}function c(t){for(var e=[];f(t);)e.push(t),t=t.parentNode;return e}function f(t){return t&&(t instanceof Element||t instanceof HTMLElement)}e.exports={getGraphDiv:function(t){var e;if("string"==typeof t){if(null===(e=document.getElementById(t)))throw new Error("No DOM element with id '"+t+"' exists on the page.");return e}if(null==t)throw new Error("DOM element provided is null or undefined");return t},isPlotDiv:function(t){var e=n.select(t);return e.node()instanceof HTMLElement&&e.size()&&e.classed("js-plotly-plot")},removeElement:s,addStyleRule:function(t,e){l("global",t,e)},addRelatedStyleRule:l,deleteRelatedStyleRule:function(t){var e="plotly.js-style-"+t,r=document.getElementById(e);r&&s(r)},getFullTransformMatrix:function(t){var e=c(t),r=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];return e.forEach((function(t){var e=u(t);if(e){var n=i.convertCssMatrix(e);r=o.multiply(r,r,n)}})),r},getElementTransformMatrix:u,getElementAndAncestors:c,equalDomRects:function(t,e){return t&&e&&t.x===e.x&&t.y===e.y&&t.top===e.top&&t.left===e.left&&t.right===e.right&&t.bottom===e.bottom}}},{"./loggers":502,"./matrix":504,d3:86,"gl-mat4":188}],489:[function(t,e,r){"use strict";var n=t("events").EventEmitter,a={init:function(t){if(t._ev instanceof n)return t;var e=new n,r=new n;return t._ev=e,t._internalEv=r,t.on=e.on.bind(e),t.once=e.once.bind(e),t.removeListener=e.removeListener.bind(e),t.removeAllListeners=e.removeAllListeners.bind(e),t._internalOn=r.on.bind(r),t._internalOnce=r.once.bind(r),t._removeInternalListener=r.removeListener.bind(r),t._removeAllInternalListeners=r.removeAllListeners.bind(r),t.emit=function(n,a){"undefined"!=typeof jQuery&&jQuery(t).trigger(n,a),e.emit(n,a),r.emit(n,a)},t},triggerHandler:function(t,e,r){var n,a;"undefined"!=typeof jQuery&&(n=jQuery(t).triggerHandler(e,r));var i=t._ev;if(!i)return n;var o,s=i._events[e];if(!s)return n;function l(t){return t.listener?(i.removeListener(e,t.listener),t.fired?void 0:(t.fired=!0,t.listener.apply(i,[r]))):t.apply(i,[r])}for(s=Array.isArray(s)?s:[s],o=0;o<s.length-1;o++)l(s[o]);return a=l(s[o]),void 0!==n?n:a},purge:function(t){return delete t._ev,delete t.on,delete t.once,delete t.removeListener,delete t.removeAllListeners,delete t.emit,delete t._ev,delete t._internalEv,delete t._internalOn,delete t._internalOnce,delete t._removeInternalListener,delete t._removeAllInternalListeners,t}};e.exports=a},{events:51}],490:[function(t,e,r){"use strict";var n=t("./is_plain_object.js"),a=Array.isArray;function i(t,e,r,o){var s,l,u,c,f,d,h=t[0],p=t.length;if(2===p&&a(h)&&a(t[1])&&0===h.length){if(function(t,e){var r,n;for(r=0;r<t.length;r++){if(null!==(n=t[r])&&"object"==typeof n)return!1;void 0!==n&&(e[r]=n)}return!0}(t[1],h))return h;h.splice(0,h.length)}for(var g=1;g<p;g++)for(l in s=t[g])u=h[l],c=s[l],o&&a(c)?h[l]=c:e&&c&&(n(c)||(f=a(c)))?(f?(f=!1,d=u&&a(u)?u:[]):d=u&&n(u)?u:{},h[l]=i([d,c],e,r,o)):("undefined"!=typeof c||r)&&(h[l]=c);return h}r.extendFlat=function(){return i(arguments,!1,!1,!1)},r.extendDeep=function(){return i(arguments,!0,!1,!1)},r.extendDeepAll=function(){return i(arguments,!0,!0,!1)},r.extendDeepNoArrays=function(){return i(arguments,!0,!1,!0)}},{"./is_plain_object.js":499}],491:[function(t,e,r){"use strict";e.exports=function(t){for(var e={},r=[],n=0,a=0;a<t.length;a++){var i=t[a];1!==e[i]&&(e[i]=1,r[n++]=i)}return r}},{}],492:[function(t,e,r){"use strict";function n(t){return!0===t.visible}function a(t){var e=t[0].trace;return!0===e.visible&&0!==e._length}e.exports=function(t){for(var e,r=(e=t,Array.isArray(e)&&Array.isArray(e[0])&&e[0][0]&&e[0][0].trace?a:n),i=[],o=0;o<t.length;o++){var s=t[o];r(s)&&i.push(s)}return i}},{}],493:[function(t,e,r){"use strict";var n,a,i,o=t("./mod").mod;function s(t,e,r,n,a,i,o,s){var l=r-t,u=a-t,c=o-a,f=n-e,d=i-e,h=s-i,p=l*h-c*f;if(0===p)return null;var g=(u*h-c*d)/p,v=(u*f-l*d)/p;return v<0||v>1||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.x<i?i-r.x:r.x>o?r.x-o:0,f=r.y<s?s-r.y:r.y>l?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;f<u;){if(a=(d+h)/2,o=(i=t.getPointAtLength(a))[r]-e,Math.abs(o)<l)return i;c*o>0?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;x<r;x++)h=a(g,x),p=s(e,x),b[x]=c(h,p);else b=c(i(g),e);return b},parseColorScale:function(t){var e=o.extractOpts(t),r=e.colorscale;return e.reversescale&&(r=o.flipScale(e.colorscale)),r.map((function(t){var e=t[0],r=a(t[1]).toRgb();return{index:e,rgb:[r.r,r.g,r.b,r.a]}}))}}},{"../components/color/attributes":367,"../components/colorscale":380,"./array":482,"color-normalize":63,"fast-isnumeric":155,tinycolor2:322}],495:[function(t,e,r){"use strict";var n=t("./identity");function a(t){return[t]}e.exports={keyFun:function(t){return t.key},repeat:a,descend:n,wrap:a,unwrap:function(t){return t[0]}}},{"./identity":496}],496:[function(t,e,r){"use strict";e.exports=function(t){return t}},{}],497:[function(t,e,r){"use strict";e.exports=function(t,e){if(!e)return t;var r=1/Math.abs(e),n=r>1?(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;a<n.length;a++)e[n[a]]=+r;return e}u.getGraphDiv=T.getGraphDiv,u.isPlotDiv=T.isPlotDiv,u.removeElement=T.removeElement,u.addStyleRule=T.addStyleRule,u.addRelatedStyleRule=T.addRelatedStyleRule,u.deleteRelatedStyleRule=T.deleteRelatedStyleRule,u.getFullTransformMatrix=T.getFullTransformMatrix,u.getElementTransformMatrix=T.getElementTransformMatrix,u.getElementAndAncestors=T.getElementAndAncestors,u.equalDomRects=T.equalDomRects,u.clearResponsive=t("./clear_responsive"),u.preserveDrawingBuffer=t("./preserve_drawing_buffer"),u.makeTraceGroups=t("./make_trace_groups"),u._=t("./localize"),u.notifier=t("./notifier"),u.filterUnique=t("./filter_unique"),u.filterVisible=t("./filter_visible"),u.pushUnique=t("./push_unique"),u.increment=t("./increment"),u.cleanNumber=t("./clean_number"),u.ensureNumber=function(t){return i(t)?(t=Number(t))<-s||t>s?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;n<e;n++)r[n]=t;return r},u.swapAttrs=function(t,e,r,n){r||(r="x"),n||(n="y");for(var a=0;a<e.length;a++){var i=e[a],o=u.nestedProperty(t,i.replace("?",r)),s=u.nestedProperty(t,i.replace("?",n)),l=o.get();o.set(s.get()),s.set(l)}},u.raiseToTop=function(t){t.parentNode.appendChild(t)},u.cancelTransition=function(t){return t.transition().duration(0)},u.constrain=function(t,e,r){return e>r?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<i;s++)o[s]=e(t[s],r,n,a);return o},u.randstr=function t(e,r,n,a){if(n||(n=16),void 0===r&&(r=24),r<=0)return"0";var i,o,s=Math.log(Math.pow(2,r))/Math.log(n),l="";for(i=2;s===1/0;i*=2)s=Math.log(Math.pow(2,r/i))/Math.log(n)*i;var c=s-Math.floor(s);for(i=0;i<Math.floor(s);i++)l=Math.floor(Math.random()*n).toString(n)+l;c&&(o=Math.pow(n,c),l=Math.floor(Math.random()*o).toString(n)+l);var f=parseInt(l,n);return e&&e[l]||f!==1/0&&f>=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<l;r++)u[r]=(1-Math.cos(Math.PI*(r+1)/e))/(2*e);for(r=0;r<o;r++){for(i=0,n=0;n<l;n++)(a=r+n+1-e)<-o?a-=s*Math.round(a/s):a>=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;n<r.length;n++)null!=t[r[n]]?a=!0:i=!1;if(a&&!i)for(n=0;n<r.length;n++)t[r[n]]=e[r[n]]}},u.mergeArray=function(t,e,r,n){var a="function"==typeof n;if(u.isArrayOrTypedArray(t))for(var i=Math.min(t.length,e.length),o=0;o<i;o++){var s=t[o];e[o][r]=a?n(s):s}},u.mergeArrayCastPositive=function(t,e,r){return u.mergeArray(t,e,r,(function(t){var e=+t;return isFinite(e)&&e>0?e:0}))},u.fillArray=function(t,e,r,n){if(n=n||u.identity,u.isArrayOrTypedArray(t))for(var a=0;a<e.length;a++)e[a][r]=n(t[a])},u.castOption=function(t,e,r,n){n=n||u.identity;var a=u.nestedProperty(t,r).get();return u.isArrayOrTypedArray(a)?Array.isArray(e)&&u.isArrayOrTypedArray(a[e[0]])?n(a[e[0]][e[1]]):n(a[e]):a},u.extractOption=function(t,e,r,n){if(r in t)return t[r];var a=u.nestedProperty(e,n).get();return Array.isArray(a)?void 0:a},u.tagSelected=function(t,e,r){var n,a,i=e.selectedpoints,o=e._indexToPoints;o&&(n=k(o));for(var s=0;s<i.length;s++){var l=i[s];if(u.isIndex(l)||u.isArrayOrTypedArray(l)&&u.isIndex(l[0])&&u.isIndex(l[1])){var c=n?n[l]:l,f=r?r[c]:c;void 0!==(a=f)&&a<t.length&&(t[f].selected=1)}}},u.selIndices2selPoints=function(t){var e=t.selectedpoints,r=t._indexToPoints;if(r){for(var n=k(r),a=[],i=0;i<e.length;i++){var o=e[i];if(u.isIndex(o)){var s=n[o];u.isIndex(s)&&a.push(s)}}return a}return e},u.getTargetArray=function(t,e){var r=e.target;if("string"==typeof r&&r){var n=u.nestedProperty(t,r).get();return!!Array.isArray(n)&&n}return!!Array.isArray(r)&&r},u.minExtend=function(t,e){var r={};"object"!=typeof e&&(e={});var n,a,i,o=Object.keys(t);for(n=0;n<o.length;n++)i=t[a=o[n]],"_"!==a.charAt(0)&&"function"!=typeof i&&("module"===a?r[a]=i:Array.isArray(i)?r[a]="colorscale"===a?i.slice():i.slice(0,3):u.isTypedArray(i)?r[a]=i.subarray(0,3):r[a]=i&&"object"==typeof i?u.minExtend(t[a],e[a]):i);for(o=Object.keys(e),n=0;n<o.length;n++)"object"==typeof(i=e[a=o[n]])&&a in r&&"object"==typeof r[a]||(r[a]=i);return r},u.titleCase=function(t){return t.charAt(0).toUpperCase()+t.substr(1)},u.containsAny=function(t,e){for(var r=0;r<e.length;r++)if(-1!==t.indexOf(e[r]))return!0;return!1},u.isIE=function(){return"undefined"!=typeof window.navigator.msSaveBlob};var M=/MSIE [1-9]\./;u.isIE9orBelow=function(){return u.isIE()&&M.test(window.navigator.userAgent)};var E=/Version\/[\d\.]+.*Safari/;u.isSafari=function(){return E.test(window.navigator.userAgent)};var S=/iPad|iPhone|iPod/;u.isIOS=function(){return S.test(window.navigator.userAgent)},u.isD3Selection=function(t){return t&&"function"==typeof t.classed},u.ensureSingle=function(t,e,r,n){var a=t.select(e+(r?"."+r:""));if(a.size())return a;var i=t.append(e);return r&&i.classed(r,!0),n&&i.call(n),i},u.ensureSingleById=function(t,e,r,n){var a=t.select(e+"#"+r);if(a.size())return a;var i=t.append(e).attr("id",r);return n&&i.call(n),i},u.objectFromPath=function(t,e){for(var r,n=t.split("."),a=r={},i=0;i<n.length;i++){var o=n[i],s=null,l=n[i].match(/(.*)\[([0-9]+)\]/);l?(o=l[1],s=l[2],r=r[o]=[],i===n.length-1?r[s]=e:r[s]={},r=r[s]):(i===n.length-1?r[o]=e:r[o]={},r=r[o])}return a};var C=/^([^\[\.]+)\.(.+)?/,L=/^([^\.]+)\[([0-9]+)\](\.)?(.+)?/;u.expandObjectPaths=function(t){var e,r,n,a,i,o,s;if("object"==typeof t&&!Array.isArray(t))for(r in t)t.hasOwnProperty(r)&&((e=r.match(C))?(a=t[r],n=e[1],delete t[r],t[n]=u.extendDeepNoArrays(t[n]||{},u.objectFromPath(r,u.expandObjectPaths(a))[n])):(e=r.match(L))?(a=t[r],n=e[1],i=parseInt(e[2]),delete t[r],t[n]=t[n]||[],"."===e[3]?(s=e[4],o=t[n][i]=t[n][i]||{},u.extendDeepNoArrays(o,u.objectFromPath(s,u.expandObjectPaths(a)))):t[n][i]=u.expandObjectPaths(a)):t[r]=u.expandObjectPaths(t[r]));return t},u.numSeparate=function(t,e,r){if(r||(r=!1),"string"!=typeof e||0===e.length)throw new Error("Separator string required for formatting!");"number"==typeof t&&(t=String(t));var n=/(\d+)(\d{3})/,a=e.charAt(0),i=e.charAt(1),o=t.split("."),s=o[0],l=o.length>1?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<o.length;h++)if(f=o[h]){if(f.hasOwnProperty(l)){d=f[l];break}if(O.test(l)||(d=s[l]||u.nestedProperty(f,l).get())&&(s[l]=d),void 0!==d)break}if(void 0===d&&i)return i.count<i.max&&(u.warn("Variable '"+l+"' in "+i.name+" could not be found!"),d=t),i.count===i.max&&u.warn("Too many "+i.name+" warnings - additional warnings will be suppressed"),i.count++,t;if(c){if(":"===c[0]&&(d=(p=r?r.numberFormat:n.format)(c.replace(I,""))(d)),"|"===c[0]){p=r?r.timeFormat:a;var g=u.dateTime2ms(d);d=u.formatDate(g,c.replace(I,""),!1,p)}}else e.hasOwnProperty(l+"Label")&&(d=e[l+"Label"]);return d}))}u.subplotSort=function(t,e){for(var r=Math.min(t.length,e.length)+1,n=0,a=0,i=0;i<r;i++){var o=t.charCodeAt(i)||0,s=e.charCodeAt(i)||0,l=o>=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;n<e;n++)-1!==r.indexOf(".")&&(r=(r=r.replace("0%","%")).replace(".%","%"));return r},u.isHidden=function(t){var e=window.getComputedStyle(t).display;return!e||"none"===e},u.strTranslate=function(t,e){return t||e?"translate("+t+","+e+")":""},u.strRotate=function(t){return t?"rotate("+t+")":""},u.strScale=function(t){return 1!==t?"scale("+t+")":""},u.getTextTransform=function(t){var e=t.noCenter,r=t.textX,n=t.textY,a=t.targetX,i=t.targetY,o=t.anchorX||0,s=t.anchorY||0,l=t.rotate,c=t.scale;return c?c>1&&(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;o<s.length;o++)c[s[o][r]]=o;var f=a.test(i),d={set:function(t,e){var a=null===e?4:0;if(!s){if(!l||4===a)return;s=[],l.set(s)}var o=c[t];if(void 0===o){if(4===a)return;a|=3,o=s.length,c[t]=o}else e!==(f?s[o][i]:n(s[o],i).get())&&(a|=2);var h=s[o]=s[o]||{};return h[r]=t,f?h[i]=e:n(h,i).set(e),null!==e&&(a&=-5),u[o]=u[o]|a,d},get:function(t){if(s){var e=c[t];return void 0===e?void 0:f?s[e][i]:n(s[e],i).get()}},rename:function(t,e){var n=c[t];return void 0===n||(u[n]=1|u[n],c[e]=n,delete c[t],s[n][r]=e),d},remove:function(t){var e=c[t];if(void 0===e)return d;var a=s[e];if(Object.keys(a).length>2)return u[e]=2|u[e],d.set(t,null);if(f){for(o=e;o<s.length;o++)u[o]=3|u[o];for(o=e;o<s.length;o++)c[s[o][r]]--;s.splice(e,1),delete c[t]}else n(a,i).set(null),u[e]=6|u[e];return d},constructUpdate:function(){for(var t,a,o={},l=Object.keys(u),c=0;c<l.length;c++)a=l[c],t=e+"["+a+"]",s[a]?(1&u[a]&&(o[t+"."+r]=s[a][r]),2&u[a]&&(o[t+"."+i]=f?4&u[a]?null:s[a][i]:4&u[a]?null:n(s[a],i).get())):o[t]=null;return o}};return d}},{"./nested_property":506}],501:[function(t,e,r){"use strict";var n=t("../registry");e.exports=function(t,e){for(var r=t._context.locale,a=0;a<2;a++){for(var i=t._context.locales,o=0;o<2;o++){var s=(i[r]||{}).dictionary;if(s){var l=s[e];if(l)return l}i=n.localeRegistry}var u=r.split("-")[0];if(u===r)break;r=u}return e}},{"../registry":593}],502:[function(t,e,r){"use strict";var n=t("../plot_api/plot_config").dfltConfig,a=t("./notifier"),i=e.exports={};function o(t,e){if(t&&t.apply)try{return void t.apply(console,e)}catch(t){}for(var r=0;r<e.length;r++)try{t(e[r])}catch(t){console.log(e[r])}}i.log=function(){var t;if(n.logging>1){var e=["LOG:"];for(t=0;t<arguments.length;t++)e.push(arguments[t]);o(console.trace||console.log,e)}if(n.notifyOnLogging>1){var r=[];for(t=0;t<arguments.length;t++)r.push(arguments[t]);a(r.join("<br>"),"long")}},i.warn=function(){var t;if(n.logging>0){var e=["WARN:"];for(t=0;t<arguments.length;t++)e.push(arguments[t]);o(console.trace||console.log,e)}if(n.notifyOnLogging>0){var r=[];for(t=0;t<arguments.length;t++)r.push(arguments[t]);a(r.join("<br>"),"stick")}},i.error=function(){var t;if(n.logging>0){var e=["ERROR:"];for(t=0;t<arguments.length;t++)e.push(arguments[t]);o(console.error,e)}if(n.notifyOnLogging>0){var r=[];for(t=0;t<arguments.length;t++)r.push(arguments[t]);a(r.join("<br>"),"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;n<t;n++)r[n]=new Array(e);return r},r.transposeRagged=function(t){var e,r,n=0,a=t.length;for(e=0;e<a;e++)n=Math.max(n,t[e].length);var i=new Array(n);for(e=0;e<n;e++)for(i[e]=new Array(a),r=0;r<a;r++)i[e][r]=t[r][e];return i},r.dot=function(t,e){if(!t.length||!e.length||t.length!==e.length)return null;var n,a,i=t.length;if(t[0].length)for(n=new Array(i),a=0;a<i;a++)n[a]=r.dot(t[a],e);else if(e[0].length){var o=r.transposeRagged(e);for(n=new Array(o.length),a=0;a<o.length;a++)n[a]=r.dot(t,o[a])}else for(n=0,a=0;a<i;a++)n+=t[a]*e[a];return n},r.translationMatrix=function(t,e){return[[1,0,t],[0,1,e],[0,0,1]]},r.rotationMatrix=function(t){var e=t*Math.PI/180;return[[Math.cos(e),-Math.sin(e),0],[Math.sin(e),Math.cos(e),0],[0,0,1]]},r.rotationXYMatrix=function(t,e,n){return r.dot(r.dot(r.translationMatrix(e,n),r.rotationMatrix(t)),r.translationMatrix(-e,-n))},r.apply3DTransform=function(t){return function(){var e=arguments,n=1===arguments.length?e[0]:[e[0],e[1],e[2]||0];return r.dot(t,[n[0],n[1],n[2],1]).slice(0,3)}},r.apply2DTransform=function(t){return function(){var e=arguments;3===e.length&&(e=e[0]);var n=1===arguments.length?e[0]:[e[0],e[1]];return r.dot(t,[n[0],n[1],1]).slice(0,2)}},r.apply2DTransform2=function(t){var e=r.apply2DTransform(t);return function(t){return e(t.slice(0,2)).concat(e(t.slice(2,4)))}},r.convertCssMatrix=function(t){if(t){var e=t.length;if(16===e)return t;if(6===e)return[t[0],t[1],0,0,t[2],t[3],0,0,0,0,1,0,t[4],t[5],0,1]}return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]},r.inverseTransformMatrix=function(t){var e=[];return n.invert(e,t),[[e[0],e[1],e[2],e[3]],[e[4],e[5],e[6],e[7]],[e[8],e[9],e[10],e[11]],[e[12],e[13],e[14],e[15]]]}},{"gl-mat4":188}],505:[function(t,e,r){"use strict";e.exports={mod:function(t,e){var r=t%e;return r<0?r+e:r},modHalf:function(t,e){return Math.abs(t)>e/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<e.length-1;s++){if(-1===(r=e[s])){for(n=!0,o=[],l=0;l<u.length;l++)o[l]=i(u[l],e.slice(s+1))(),o[l]!==o[0]&&(n=!1);return n?o[0]:o}if("number"==typeof r&&!a(u))return;if("object"!=typeof(u=u[r])||null===u)return}if("object"==typeof u&&null!==u&&null!==(o=u[e[s]]))return o}}e.exports=function(t,e){if(n(e))e=String(e);else if("string"!=typeof e||"[-1]"===e.substr(e.length-4))throw"bad property string";for(var r,a,o,s=0,u=e.split(".");s<u.length;){if(r=String(u[s]).match(/^([^\[\]]*)((\[\-?[0-9]*\])+)$/)){if(r[1])u[s]=r[1];else{if(0!==s)throw"bad property string";u.splice(0,1)}for(a=r[2].substr(1,r[2].length-2).split("]["),o=0;o<a.length;o++)s++,u.splice(s,0,Number(a[o]))}s++}return"object"!=typeof t?function(t,e,r){return{set:function(){throw"bad container"},get:function(){},astr:e,parts:r,obj:t}}(t,e,u):{set:l(t,u,e),get:i(t,u),astr:e,parts:u,obj:t}};var o=/(^|\.)args\[/;function s(t,e){return void 0===t||null===t&&!e.match(o)}function l(t,e,r){return function(n){var i,o,l=t,d="",h=[[t,d]],p=s(n,r);for(o=0;o<e.length-1;o++){if("number"==typeof(i=e[o])&&!a(l))throw"array index but container is not an array";if(-1===i){if(p=!c(l,e.slice(o+1),n,r))break;return}if(!f(l,i,e[o+1],p))break;if("object"!=typeof(l=l[i])||null===l)throw"container is not an object";d=u(d,i),h.push([l,d])}if(p){if(o===e.length-1&&(delete l[e[o]],Array.isArray(l)&&+e[o]==l.length-1))for(;l.length&&void 0===l[l.length-1];)l.pop()}else l[e[o]]=n}}function u(t,e){var r=e;return n(e)?r="["+e+"]":t&&(r="."+e),t+r}function c(t,e,r,n){var i,o=a(r),u=!0,c=r,d=n.replace("-1",0),h=!o&&s(r,d),p=e[0];for(i=0;i<t.length;i++)d=n.replace("-1",i),o&&(h=s(c=r[i%r.length],d)),h&&(u=!1),f(t,i,p,h)&&l(t[i],e,n.replace("-1",i))(c);return u}function f(t,e,r,n){if(void 0===t[e]){if(n)return!1;t[e]="number"==typeof r?[]:{}}return!0}},{"./array":482,"fast-isnumeric":155}],507:[function(t,e,r){"use strict";e.exports=function(){}},{}],508:[function(t,e,r){"use strict";var n=t("d3"),a=t("fast-isnumeric"),i=[];e.exports=function(t,e){if(-1===i.indexOf(t)){i.push(t);var r=1e3;a(e)?r=e:"long"===e&&(r=3e3);var o=n.select("body").selectAll(".plotly-notifier").data([0]);o.enter().append("div").classed("plotly-notifier",!0),o.selectAll(".notifier-note").data(i).enter().append("div").classed("notifier-note",!0).style("opacity",0).each((function(t){var a=n.select(this);a.append("button").classed("notifier-close",!0).html("&times;").on("click",(function(){a.transition().call(s)}));for(var i=a.append("p"),o=t.split(/<br\s*\/?>/g),l=0;l<o.length;l++)l&&i.append("br"),i.append("span").text(o[l]);"stick"===e?a.transition().duration(350).style("opacity",1):a.transition().duration(700).style("opacity",1).transition().delay(r).call(s)}))}function s(t){t.duration(700).style("opacity",0).each("end",(function(t){var e=i.indexOf(t);-1!==e&&i.splice(e,1),n.select(this).remove()}))}}},{d3:86,"fast-isnumeric":155}],509:[function(t,e,r){"use strict";var n=t("./setcursor"),a="data-savedcursor";e.exports=function(t,e){var r=t.attr(a);if(e){if(!r){for(var i=(t.attr("class")||"").split(" "),o=0;o<i.length;o++){var s=i[o];0===s.indexOf("cursor-")&&t.attr(a,s.substr(7)).classed(s,!1)}t.attr(a)||t.attr(a,"!!")}n(t,e)}else r&&(t.attr(a,null),"!!"===r?n(t):n(t,r))}},{"./setcursor":519}],510:[function(t,e,r){"use strict";var n=t("./matrix").dot,a=t("../constants/numerical").BADNUM,i=e.exports={};i.tester=function(t){var e,r=t.slice(),n=r[0][0],i=n,o=r[0][1],s=o;for(r.push(r[0]),e=1;e<r.length;e++)n=Math.min(n,r[e][0]),i=Math.max(i,r[e][0]),o=Math.min(o,r[e][1]),s=Math.max(s,r[e][1]);var l,u=!1;5===r.length&&(r[0][0]===r[1][0]?r[2][0]===r[3][0]&&r[0][1]===r[3][1]&&r[1][1]===r[2][1]&&(u=!0,l=function(t){return t[0]===r[0][0]}):r[0][1]===r[1][1]&&r[2][1]===r[3][1]&&r[0][0]===r[3][0]&&r[1][0]===r[2][0]&&(u=!0,l=function(t){return t[1]===r[0][1]}));var c=!0,f=r[0];for(e=1;e<r.length;e++)if(f[0]!==r[e][0]||f[1]!==r[e][1]){c=!1;break}return{xmin:n,xmax:i,ymin:o,ymax:s,pts:r,contains:u?function(t,e){var r=t[0],u=t[1];return!(r===a||r<n||r>i||u===a||u<o||u>s)&&(!e||!l(t))}:function(t,e){var l=t[0],u=t[1];if(l===a||l<n||l>i||u===a||u<o||u>s)return!1;var c,f,d,h,p,g=r.length,v=r[0][0],m=r[0][1],y=0;for(c=1;c<g;c++)if(f=v,d=m,v=r[c][0],m=r[c][1],!(l<(h=Math.min(f,v))||l>Math.max(f,v)||u>Math.max(d,m)))if(u<Math.min(d,m))l!==h&&y++;else{if(u===(p=v===f?u:d+(l-f)*(m-d)/(v-f)))return 1!==c||!e;u<=p&&l!==h&&y++}return y%2==1},isRect:u,degenerate:c}},i.isSegmentBent=function(t,e,r,a){var i,o,s,l=t[e],u=[t[r][0]-l[0],t[r][1]-l[1]],c=n(u,u),f=Math.sqrt(c),d=[-u[1]/f,u[0]/f];for(i=e+1;i<r;i++)if(o=[t[i][0]-l[0],t[i][1]-l[1]],(s=n(o,u))<0||s>c||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;u<t.length;u++)(u===t.length-1||i.isSegmentBent(t,l,u+1,e))&&(r.push(t[u]),r.length<s-2&&(n=u,a=r.length-1),l=u)}t.length>1&&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<i.length;o++){if(-1!==i[o].indexOf("Safari"))for(var s=o-1;s>-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;n<t.length;n++)if(t[n]instanceof RegExp&&t[n].toString()===r)return t;t.push(e)}else!e&&0!==e||-1!==t.indexOf(e)||t.push(e);return t}},{}],514:[function(t,e,r){"use strict";var n=t("../lib"),a=t("../plot_api/plot_config").dfltConfig;var i={add:function(t,e,r,n,i){var o,s;t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},s=t.undoQueue.index,t.autoplay?t.undoQueue.inSequence||(t.autoplay=!1):(!t.undoQueue.sequence||t.undoQueue.beginSequence?(o={undo:{calls:[],args:[]},redo:{calls:[],args:[]}},t.undoQueue.queue.splice(s,t.undoQueue.queue.length-s,o),t.undoQueue.index+=1):o=t.undoQueue.queue[s-1],t.undoQueue.beginSequence=!1,o&&(o.undo.calls.unshift(e),o.undo.args.unshift(r),o.redo.calls.push(n),o.redo.args.push(i)),t.undoQueue.queue.length>a.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<e.undo.calls.length;r++)i.plotDo(t,e.undo.calls[r],e.undo.args[r]);t.undoQueue.inSequence=!1,t.autoplay=!1}},redo:function(t){var e,r;if(t.framework&&t.framework.isPolar)t.framework.redo();else if(!(void 0===t.undoQueue||isNaN(t.undoQueue.index)||t.undoQueue.index>=t.undoQueue.queue.length)){for(e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,r=0;r<e.redo.calls.length;r++)i.plotDo(t,e.redo.calls[r],e.redo.args[r]);t.undoQueue.inSequence=!1,t.autoplay=!1,t.undoQueue.index++}}};i.plotDo=function(t,e,r){t.autoplay=!0,r=function(t,e){for(var r,a=[],i=0;i<e.length;i++)r=e[i],a[i]=r===t?r:"object"==typeof r?Array.isArray(r)?n.extendDeep([],r):n.extendDeepAll({},r):r;return a}(t,r),e.apply(null,r)},e.exports=i},{"../lib":498,"../plot_api/plot_config":534}],515:[function(t,e,r){"use strict";r.counter=function(t,e,r,n){var a=(e||"")+(r?"":"$"),i=!1===n?"":"^";return"xy"===t?new RegExp(i+"x([2-9]|[1-9][0-9]+)?y([2-9]|[1-9][0-9]+)?"+a):new RegExp(i+t+"([2-9]|[1-9][0-9]+)?"+a)}},{}],516:[function(t,e,r){"use strict";var n=/^(.*)(\.[^\.\[\]]+|\[\d\])$/,a=/^[^\.\[\]]+$/;e.exports=function(t,e){for(;e;){var r=t.match(n);if(r)t=r[1];else{if(!t.match(a))throw new Error("bad relativeAttr call:"+[t,e]);t=""}if("^"!==e.charAt(0))break;e=e.slice(1)}return t&&"["!==e.charAt(0)?t+"."+e:t+e}},{}],517:[function(t,e,r){"use strict";var n=t("./array").isArrayOrTypedArray,a=t("./is_plain_object");e.exports=function t(e,r){for(var i in r){var o=r[i],s=e[i];if(s!==o)if("_"===i.charAt(0)||"function"==typeof o){if(i in e)continue;e[i]=o}else if(n(o)&&n(s)&&a(o[0])){if("customdata"===i||"ids"===i)continue;for(var l=Math.min(o.length,s.length),u=0;u<l;u++)s[u]!==o[u]&&a(o[u])&&a(s[u])&&t(s[u],o[u])}else a(o)&&a(s)&&(t(s,o),Object.keys(s).length||delete e[i])}}},{"./array":482,"./is_plain_object":499}],518:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("./loggers"),i=t("./identity"),o=t("../constants/numerical").BADNUM;function s(t,e){return t<e}function l(t,e){return t<=e}function u(t,e){return t>e}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);f<d&&h++<100;)o(e[i=Math.floor((f+d)/2)],t)?f=i+1:d=i;return h>90&&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;a<i&&o++<100;)e[n=u((a+i)/2)]<=t?a=n+s:i=n-l;return e[a]},r.sort=function(t,e){for(var r=0,n=0,a=1;a<t.length;a++){var i=e(t[a],t[a-1]);if(i<0?r=1:i>0&&(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;a<t.length;a++){var o=e(t[a]);o<n&&(n=o,r=a)}return r}},{"../constants/numerical":475,"./identity":496,"./loggers":502,"fast-isnumeric":155}],519:[function(t,e,r){"use strict";e.exports=function(t,e){(t.attr("class")||"").split(" ").forEach((function(e){0===e.indexOf("cursor-")&&t.classed(e,!1)})),e&&t.classed("cursor-"+e,!0)}},{}],520:[function(t,e,r){"use strict";var n=t("../components/color"),a=function(){};e.exports=function(t){for(var e in t)"function"==typeof t[e]&&(t[e]=a);t.destroy=function(){t.container.parentNode.removeChild(t.container)};var r=document.createElement("div");r.className="no-webgl",r.style.cursor="pointer",r.style.fontSize="24px",r.style.color=n.defaults[0],r.style.position="absolute",r.style.left=r.style.top="0px",r.style.width=r.style.height="100%",r.style["background-color"]=n.lightLine,r.style["z-index"]=30;var i=document.createElement("p");return i.textContent="WebGL is not supported by your browser - visit https://get.webgl.org for more info",i.style.position="relative",i.style.top="50%",i.style.left="50%",i.style.height="30%",i.style.width="50%",i.style.margin="-15% 0 0 -25%",r.appendChild(i),t.container.appendChild(r),t.container.style.background="#FFFFFF",t.container.onclick=function(){window.open("https://get.webgl.org")},!1}},{"../components/color":368}],521:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("./array").isArrayOrTypedArray;r.aggNums=function(t,e,i,o){var s,l;if((!o||o>i.length)&&(o=i.length),n(e)||(e=!1),a(i[0])){for(l=new Array(o),s=0;s<o;s++)l[s]=r.aggNums(t,e,i[s]);i=l}for(s=0;s<o;s++)n(e)?n(i[s])&&(e=t(+e,+i[s])):e=i[s];return e},r.len=function(t){return r.aggNums((function(t){return t+1}),0,t)},r.mean=function(t,e){return e||(e=r.len(t)),r.aggNums((function(t,e){return t+e}),0,t)/e},r.midRange=function(t){if(void 0!==t&&0!==t.length)return(r.aggNums(Math.max,null,t)+r.aggNums(Math.min,null,t))/2},r.variance=function(t,e,a){return e||(e=r.len(t)),n(a)||(a=r.mean(t,e)),r.aggNums((function(t,e){return t+Math.pow(e-a,2)}),0,t)/e},r.stdev=function(t,e,n){return Math.sqrt(r.variance(t,e,n))},r.median=function(t){var e=t.slice().sort();return r.interp(e,.5)},r.interp=function(t,e){if(!n(e))throw"n should be a finite number";if((e=e*t.length-.5)<0)return t[0];if(e>t.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<a.length;i++)f(a[i])}function f(t){var e,a=t.type,i={};if("a"===a){e="a";var s=t.target,u=t.href,c=t.popup;u&&(i={"xlink:xlink:show":"_blank"===s||"_"!==s.charAt(0)?"new":"replace",target:s,"xlink:xlink:href":u},c&&(i.onclick='window.open(this.href.baseVal,this.target.baseVal,"'+c+'");return false;'))}else e="tspan";t.style&&(i.style=t.style);var f=document.createElementNS(o.svg,e);if("sup"===a||"sub"===a){M(r,"\u200b"),r.appendChild(f);var d=document.createElementNS(o.svg,"tspan");M(d,"\u200b"),n.select(d).attr("dy",p[a]),i.dy=h[a],r.appendChild(f),r.appendChild(d)}else r.appendChild(f);n.select(f).attr(i),r=t.node=f,l.push(t)}function M(t,e){t.appendChild(document.createTextNode(e))}function E(t){if(1!==l.length){var n=l.pop();t!==n.type&&a.log("Start tag <"+n.type+"> doesnt match end tag <"+t+">. Pretending it did match.",e),r=l[l.length-1].node}else a.log("Ignoring unexpected end tag </"+t+">.",e)}b.test(e)?c():(r=t,l=[{node:t}]);for(var C=e.split(m),L=0;L<C.length;L++){var O=C[L],D=O.match(y),R=D&&D[2].toLowerCase(),I=d[R];if("br"===R)c();else if(void 0===I)M(r,S(O));else if(D[1])E(R);else{var P=D[4],F={type:R},z=T(P,x);if(z?(z=z.replace(k,"$1 fill:"),I&&(z+=";"+I)):I&&(z=I),z&&(F.style=z),"a"===R){i=!0;var N=T(P,_);if(N){var B=document.createElement("a");B.href=N,-1!==g.indexOf(B.protocol)&&(F.href=encodeURI(decodeURI(N)),F.target=T(P,w)||"_blank",F.popup=T(P,A))}}f(F)}}return i}(t.node(),E)&&t.style("pointer-events","all"),r.positionText(t),M&&M.call(t)}};var c=/(<|&lt;|&#60;)/g,f=/(>|&gt;|&#62;)/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=/<br(\s+.*)?>/i;r.BR_TAG_ALL=/<br(\s+.*)?>/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;u<i.length;u++){var c=i[u],f=c.match(y),d=f&&f[2].toLowerCase();if(d)-1!==n.indexOf(d)&&(o.push(c),s=d);else{var h=c.length;if(l+h<r)o.push(c),l+=h;else if(l<r){var p=r-l;s&&("br"!==s||p<=a||h<=a)&&o.pop(),r>a?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;o<i.length;o++){var s=i[o],l=s.match(y),u=l&&l[2].toLowerCase();if(u in d)if(l[1])a.length&&(r=a.pop());else{var c=l[4],f=T(c,x),h=f?{style:f}:{};if("a"===u){var p=T(c,_);if(p){var b=document.createElement("a");if(b.href=p,-1!==g.indexOf(b.protocol)){h.href=encodeURI(decodeURI(p));var A=T(c,w);A&&(h.target=A)}}}var k=document.createElement(u);r.appendChild(k),n.select(k).attr(h),r=k,a.push(k)}else r.appendChild(document.createTextNode(S(s)))}return e.innerHTML},r.lineCount=function(t){return t.selectAll("tspan.line").size()||1},r.positionText=function(t,e,r){return t.each((function(){var t=n.select(this);function a(e,r){return void 0===r?null===(r=t.attr(e))&&(t.attr(e,0),r=0):t.attr(e,r),r}var i=a("x",e),o=a("y",r);"text"===this.nodeName&&t.selectAll("tspan.line").attr({x:i,y:o})}))},r.makeEditable=function(t,e){var r=e.gd,a=e.delegate,i=n.dispatch("edit","input","cancel"),o=a||t;if(t.style({"pointer-events":a?"none":"all"}),1!==t.size())throw new Error("boo");function s(){!function(){var a=n.select(r).select(".svg-container"),o=a.append("div"),s=t.node().style,u=parseFloat(s.fontSize||12),c=e.text;void 0===c&&(c=t.attr("data-unformatted"));o.classed("plugin-editable editable",!0).style({position:"absolute","font-family":s.fontFamily||"Arial","font-size":u,color:e.fill||s.fill||"black",opacity:1,"background-color":e.background||"transparent",outline:"#ffffff33 1px solid",margin:[-u/8+1,0,0,-1].join("px ")+"px",padding:"0","box-sizing":"border-box"}).attr({contenteditable:!0}).text(c).call(C(t,a,e)).on("blur",(function(){r._editing=!1,t.text(this.textContent).style({opacity:1});var e,a=n.select(this).attr("class");(e=a?"."+a.split(" ")[0]+"-math-group":"[class*=-math-group]")&&n.select(t.node().parentNode).select(e).style({opacity:0});var o=this.textContent;n.select(this).transition().duration(0).remove(),n.select(document).on("mouseup",null),i.edit.call(t,o)})).on("focus",(function(){var t=this;r._editing=!0,n.select(document).on("mouseup",(function(){if(n.event.target===t)return!1;document.activeElement===o.node()&&o.node().blur()}))})).on("keyup",(function(){27===n.event.which?(r._editing=!1,t.style({opacity:1}),n.select(this).style({opacity:0}).on("blur",(function(){return!1})).transition().remove(),i.cancel.call(t,this.textContent)):(i.input.call(t,this.textContent),n.select(this).call(C(t,a,e)))})).on("keydown",(function(){13===n.event.which&&this.blur()})).call(l)}(),t.style({opacity:0});var a,s=o.attr("class");(a=s?"."+s.split(" ")[0]+"-math-group":"[class*=-math-group]")&&n.select(t.node().parentNode).select(a).style({opacity:0})}function l(t){var e=t.node(),r=document.createRange();r.selectNodeContents(e);var n=window.getSelection();n.removeAllRanges(),n.addRange(r),e.focus()}return e.immediate?s():o.on("click",s),n.rebind(t,i,"on")}},{"../constants/alignment":470,"../constants/xmlns_namespaces":476,"../lib":498,d3:86}],524:[function(t,e,r){"use strict";var n={};function a(t){t&&null!==t.timer&&(clearTimeout(t.timer),t.timer=null)}r.throttle=function(t,e,r){var i=n[t],o=Date.now();if(!i){for(var s in n)n[s].ts<o-6e4&&delete n[s];i=n[t]={ts:0,timer:null}}function l(){r(),i.ts=Date.now(),i.onDone&&(i.onDone(),i.onDone=null)}a(i),o>i.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;s<i.length;s++)if((r=t.match(i[s]))&&0===r.index){e=r[0];break}if(e||(e=a[a.indexOf(o)]),!e)return!1;var l=t.substr(e.length);return l?!!(r=l.match(/^\[(0|[1-9][0-9]*)\](\.(.+))?$/))&&{array:e,index:Number(r[1]),property:r[3]||""}:{array:e,index:"",property:""}}},{"../registry":593}],529:[function(t,e,r){"use strict";var n=t("../lib"),a=n.extendFlat,i=n.isPlainObject,o={valType:"flaglist",extras:["none"],flags:["calc","clearAxisTypes","plot","style","markerSize","colorbars"]},s={valType:"flaglist",extras:["none"],flags:["calc","plot","legend","ticks","axrange","layoutstyle","modebar","camera","arraydraw","colorbars"]},l=o.flags.slice().concat(["fullReplot"]),u=s.flags.slice().concat("layoutReplot");function c(t){for(var e={},r=0;r<t.length;r++)e[t[r]]=!1;return e}function f(t,e,r){var n=a({},t);for(var o in n){var s=n[o];i(s)&&(n[o]=d(s,e,r,o))}return"from-root"===r&&(n.editType=e),n}function d(t,e,r,n){if(t.valType){var i=a({},t);if(i.editType=e,Array.isArray(t.items)){i.items=new Array(t.items.length);for(var o=0;o<t.items.length;o++)i.items[o]=d(t.items[o],e,"from-root")}return i}return f(t,e,"_"===n.charAt(0)?"nested":"from-root")}e.exports={traces:o,layout:s,traceFlags:function(){return c(l)},layoutFlags:function(){return c(u)},update:function(t,e){var r=e.editType;if(r&&"none"!==r)for(var n=r.split("+"),a=0;a<n.length;a++)t[n[a]]=!0},overrideAll:f}},{"../lib":498}],530:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("gl-mat4/fromQuat"),i=t("../registry"),o=t("../lib"),s=t("../plots/plots"),l=t("../plots/cartesian/axis_ids"),u=t("../components/color"),c=l.cleanId,f=l.getFromTrace,d=i.traceIs;function h(t,e){var r=t[e],n=e.charAt(0);r&&"paper"!==r&&(t[e]=c(r,n,!0))}function p(t){function e(e,r){var n=t[e],a=t.title&&t.title[r];n&&!a&&(t.title||(t.title={}),t.title[r]=t[e],delete t[e])}t&&("string"!=typeof t.title&&"number"!=typeof t.title||(t.title={text:t.title}),e("titlefont","font"),e("titleposition","position"),e("titleside","side"),e("titleoffset","offset"))}function g(t){if(!o.isPlainObject(t))return!1;var e=t.name;return delete t.name,delete t.showlegend,("string"==typeof e||"number"==typeof e)&&String(e)}function v(t,e,r,n){if(r&&!n)return t;if(n&&!r)return e;if(!t.trim())return e;if(!e.trim())return t;var a,i=Math.min(t.length,e.length);for(a=0;a<i&&t.charAt(a)===e.charAt(a);a++);return t.substr(0,a).trim()}function m(t){var e="middle",r="center";return"string"==typeof t&&(-1!==t.indexOf("top")?e="top":-1!==t.indexOf("bottom")&&(e="bottom"),-1!==t.indexOf("left")?r="left":-1!==t.indexOf("right")&&(r="right")),e+" "+r}function y(t,e){return e in t&&"object"==typeof t[e]&&0===Object.keys(t[e]).length}r.clearPromiseQueue=function(t){Array.isArray(t._promises)&&t._promises.length>0&&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;e<g.length;e++){var v=g[e];if(i&&i.test(v)){var m=t[v];m.anchor&&"free"!==m.anchor&&(m.anchor=c(m.anchor)),m.overlaying&&(m.overlaying=c(m.overlaying)),m.type||(m.isdate?m.type="date":m.islog?m.type="log":!1===m.isdate&&!1===m.islog&&(m.type="linear")),"withzero"!==m.autorange&&"tozero"!==m.autorange||(m.autorange=!0,m.rangemode="tozero"),delete m.islog,delete m.isdate,delete m.categories,y(m,"domain")&&delete m.domain,void 0!==m.autotick&&(void 0===m.tickmode&&(m.tickmode=m.autotick?"auto":"linear"),delete m.autotick),p(m)}else if(l&&l.test(v)){p(t[v].radialaxis)}else if(f&&f.test(v)){var b=t[v];p(b.aaxis),p(b.baxis),p(b.caxis)}else if(d&&d.test(v)){var x=t[v],_=x.cameraposition;if(Array.isArray(_)&&4===_[0].length){var w=_[0],A=_[1],T=_[2],k=a([],w),M=[];for(n=0;n<3;++n)M[n]=A[n]+T*k[2+4*n];x.camera={eye:{x:M[0],y:M[1],z:M[2]},center:{x:A[0],y:A[1],z:A[2]},up:{x:0,y:0,z:1}},delete x.cameraposition}p(x.xaxis),p(x.yaxis),p(x.zaxis)}}var E=Array.isArray(t.annotations)?t.annotations.length:0;for(e=0;e<E;e++){var S=t.annotations[e];o.isPlainObject(S)&&(S.ref&&("paper"===S.ref?(S.xref="paper",S.yref="paper"):"data"===S.ref&&(S.xref="x",S.yref="y"),delete S.ref),h(S,"xref"),h(S,"yref"))}var C=Array.isArray(t.shapes)?t.shapes.length:0;for(e=0;e<C;e++){var L=t.shapes[e];o.isPlainObject(L)&&(h(L,"xref"),h(L,"yref"))}var O=Array.isArray(t.images)?t.images.length:0;for(e=0;e<O;e++){var D=t.images[e];o.isPlainObject(D)&&(h(D,"xref"),h(D,"yref"))}var R=t.legend;return R&&(R.x>3?(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;e<t.length;e++){var n,a=t[e];if("histogramy"===a.type&&"xbins"in a&&!("ybins"in a)&&(a.ybins=a.xbins,delete a.xbins),a.error_y&&"opacity"in a.error_y){var l=u.defaults,f=a.error_y.color||(d(a,"bar")?u.defaultLine:l[e%l.length]);a.error_y.color=u.addOpacity(u.rgb(f),u.opacity(f)*a.error_y.opacity),delete a.error_y.opacity}if("bardir"in a&&("h"!==a.bardir||!d(a,"bar")&&"histogram"!==a.type.substr(0,9)||(a.orientation="h",r.swapXYData(a)),delete a.bardir),"histogramy"===a.type&&r.swapXYData(a),"histogramx"!==a.type&&"histogramy"!==a.type||(a.type="histogram"),"scl"in a&&!("colorscale"in a)&&(a.colorscale=a.scl,delete a.scl),"reversescl"in a&&!("reversescale"in a)&&(a.reversescale=a.reversescl,delete a.reversescl),a.xaxis&&(a.xaxis=c(a.xaxis,"x")),a.yaxis&&(a.yaxis=c(a.yaxis,"y")),d(a,"gl3d")&&a.scene&&(a.scene=s.subplotsRegistry.gl3d.cleanId(a.scene)),!d(a,"pie-like")&&!d(a,"bar-like"))if(Array.isArray(a.textposition))for(n=0;n<a.textposition.length;n++)a.textposition[n]=m(a.textposition[n]);else a.textposition&&(a.textposition=m(a.textposition));var h=i.getModule(a);if(h&&h.colorbar){var b=h.colorbar.container,x=b?a[b]:a;x&&x.colorscale&&("YIGnBu"===x.colorscale&&(x.colorscale="YlGnBu"),"YIOrRd"===x.colorscale&&(x.colorscale="YlOrRd"))}if("surface"===a.type&&o.isPlainObject(a.contours)){var _=["x","y","z"];for(n=0;n<_.length;n++){var w=a.contours[_[n]];o.isPlainObject(w)&&(w.highlightColor&&(w.highlightcolor=w.highlightColor,delete w.highlightColor),w.highlightWidth&&(w.highlightwidth=w.highlightWidth,delete w.highlightWidth))}}if("candlestick"===a.type||"ohlc"===a.type){var A=!1!==(a.increasing||{}).showlegend,T=!1!==(a.decreasing||{}).showlegend,k=g(a.increasing),M=g(a.decreasing);if(!1!==k&&!1!==M){var E=v(k,M,A,T);E&&(a.name=E)}else!k&&!M||a.name||(a.name=k||M)}if(Array.isArray(a.transforms)){var S=a.transforms;for(n=0;n<S.length;n++){var C=S[n];if(o.isPlainObject(C))switch(C.type){case"filter":C.filtersrc&&(C.target=C.filtersrc,delete C.filtersrc),C.calendar&&(C.valuecalendar||(C.valuecalendar=C.calendar),delete C.calendar);break;case"groupby":if(C.styles=C.styles||C.style,C.styles&&!Array.isArray(C.styles)){var L=C.styles,O=Object.keys(L);C.styles=[];for(var D=0;D<O.length;D++)C.styles.push({target:O[D],value:L[O[D]]})}}}}y(a,"line")&&delete a.line,"marker"in a&&(y(a.marker,"line")&&delete a.marker.line,y(a,"marker")&&delete a.marker),u.clean(a),a.autobinx&&(delete a.autobinx,delete a.xbins),a.autobiny&&(delete a.autobiny,delete a.ybins),p(a),a.colorbar&&p(a.colorbar),a.marker&&a.marker.colorbar&&p(a.marker.colorbar),a.line&&a.line.colorbar&&p(a.line.colorbar),a.aaxis&&p(a.aaxis),a.baxis&&p(a.baxis)}},r.swapXYData=function(t){var e;if(o.swapAttrs(t,["?","?0","d?","?bins","nbins?","autobin?","?src","error_?"]),Array.isArray(t.z)&&Array.isArray(t.z[0])&&(t.transpose?delete t.transpose:t.transpose=!0),t.error_x&&t.error_y){var r=t.error_y,n="copy_ystyle"in r?r.copy_ystyle:!(r.color||r.thickness||r.width);o.swapAttrs(t,["error_?.copy_ystyle"]),n&&o.swapAttrs(t,["error_?.color","error_?.thickness","error_?.width"])}if("string"==typeof t.hoverinfo){var a=t.hoverinfo.split("+");for(e=0;e<a.length;e++)"x"===a[e]?a[e]="y":"y"===a[e]&&(a[e]="x");t.hoverinfo=a.join("+")}},r.coerceTraceIndices=function(t,e){if(n(e))return[e];if(!Array.isArray(e)||!e.length)return t.data.map((function(t,e){return e}));if(Array.isArray(e)){for(var r=[],a=0;a<e.length;a++)o.isIndex(e[a],t.data.length)?r.push(e[a]):o.warn("trace index (",e[a],") is not a number or is out of bounds");return r}return e},r.manageArrayContainers=function(t,e,r){var a=t.obj,i=t.parts,s=i.length,l=i[s-1],u=n(l);if(u&&null===e){var c=i.slice(0,s-1).join(".");o.nestedProperty(a,c).get().splice(l,1)}else u&&void 0===t.get()?(void 0===t.get()&&(r[t.astr]=null),t.set(e)):t.set(e)};var b=/(\.[^\[\]\.]+|\[[^\[\]\.]+\])$/;function x(t){var e=t.search(b);if(e>0)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;n<e.length;n++)for(var a=t._fullData[n],i=0;i<3;i++){var s=f(t,a,_[i]);if(s&&"log"!==s.type){var l=s._name,u=s._id.substr(1);if("scene"===u.substr(0,5)){if(void 0!==r[u])continue;l=u+"."+l}var c=l+".type";void 0===r[l]&&void 0===r[c]&&o.nestedProperty(t.layout,c).set(null)}}}},{"../components/color":368,"../lib":498,"../plots/cartesian/axis_ids":550,"../plots/plots":585,"../registry":593,"fast-isnumeric":155,"gl-mat4/fromQuat":178}],531:[function(t,e,r){"use strict";var n=t("./plot_api");r.plot=n.plot,r.newPlot=n.newPlot,r.restyle=n.restyle,r.relayout=n.relayout,r.redraw=n.redraw,r.update=n.update,r._guiRestyle=n._guiRestyle,r._guiRelayout=n._guiRelayout,r._guiUpdate=n._guiUpdate,r._storeDirectGUIEdit=n._storeDirectGUIEdit,r.react=n.react,r.extendTraces=n.extendTraces,r.prependTraces=n.prependTraces,r.addTraces=n.addTraces,r.deleteTraces=n.deleteTraces,r.moveTraces=n.moveTraces,r.purge=n.purge,r.addFrames=n.addFrames,r.deleteFrames=n.deleteFrames,r.animate=n.animate,r.setPlotConfig=n.setPlotConfig,r.toImage=t("./to_image"),r.validate=t("./validate"),r.downloadImage=t("../snapshot/download");var a=t("./template_api");r.makeTemplate=a.makeTemplate,r.validateTemplate=a.validateTemplate},{"../snapshot/download":595,"./plot_api":533,"./template_api":538,"./to_image":539,"./validate":540}],532:[function(t,e,r){"use strict";var n=t("../lib/is_plain_object"),a=t("../lib/noop"),i=t("../lib/loggers"),o=t("../lib/search").sorterAsc,s=t("../registry");r.containerArrayMatch=t("./container_array_match");var l=r.isAddVal=function(t){return"add"===t||n(t)},u=r.isRemoveVal=function(t){return null===t||"remove"===t};r.applyContainerArrayChanges=function(t,e,r,n,c){var f=e.astr,d=s.getComponentMethod(f,"supplyLayoutDefaults"),h=s.getComponentMethod(f,"draw"),p=s.getComponentMethod(f,"drawOne"),g=n.replot||n.recalc||d===a||h===a,v=t.layout,m=t._fullLayout;if(r[""]){Object.keys(r).length>1&&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;b<E.length;b++)if(w=r[_=E[b]],A=Object.keys(w),T=w[""],k=l(T),_<0||_>C.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<A.length;x++)M=f+"["+_+"].",c(C[_],A[x],M).set(w[A[x]]);for(b=O.length-1;b>=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<E.length&&!((_=E[b])>=D);b++)I.push(_);for(b=D;b<R;b++)I.push(b)}for(b=0;b<I.length;b++)p(t,I[b])}else h(t);return!0}},{"../lib/is_plain_object":499,"../lib/loggers":502,"../lib/noop":507,"../lib/search":518,"../registry":593,"./container_array_match":528}],533:[function(t,e,r){"use strict";var n=t("d3"),a=t("fast-isnumeric"),i=t("has-hover"),o=t("../lib"),s=o.nestedProperty,l=t("../lib/events"),u=t("../lib/queue"),c=t("../registry"),f=t("./plot_schema"),d=t("../plots/plots"),h=t("../plots/polar/legacy"),p=t("../plots/cartesian/axes"),g=t("../components/drawing"),v=t("../components/color"),m=t("../plots/cartesian/graph_interact").initInteractions,y=t("../constants/xmlns_namespaces"),b=t("../lib/svg_text_utils"),x=t("../plots/cartesian/select").clearSelect,_=t("./plot_config").dfltConfig,w=t("./manage_arrays"),A=t("./helpers"),T=t("./subroutines"),k=t("./edit_types"),M=t("../plots/cartesian/constants").AX_NAME_PATTERN,E=0;function S(t){var e=t._fullLayout;e._redrawFromAutoMarginCount?e._redrawFromAutoMarginCount--:t.emit("plotly_afterplot")}function C(t,e){try{t._fullLayout._paper.style("background",e)}catch(t){o.error(t)}}function L(t,e){C(t,v.combine(e,"white"))}function O(t,e){if(!t._context){t._context=o.extendDeep({},_);var r=n.select("base");t._context._baseUrl=r.size()&&r.attr("href")?window.location.href.split("#")[0]:""}var a,s,l,u=t._context;if(e){for(s=Object.keys(e),a=0;a<s.length;a++)"editable"!==(l=s[a])&&"edits"!==l&&l in u&&("setBackground"===l&&"opaque"===e[l]?u[l]=L:u[l]=e[l]);e.plot3dPixelRatio&&!u.plotGlPixelRatio&&(u.plotGlPixelRatio=u.plot3dPixelRatio);var c=e.editable;if(void 0!==c)for(u.editable=c,s=Object.keys(u.edits),a=0;a<s.length;a++)u.edits[s[a]]=c;if(e.edits)for(s=Object.keys(e.edits),a=0;a<s.length;a++)(l=s[a])in u.edits&&(u.edits[l]=e.edits[l]);u._exportedPlot=e._exportedPlot}u.staticPlot&&(u.editable=!1,u.edits={},u.autosizable=!1,u.scrollZoom=!1,u.doubleClick=!1,u.showTips=!1,u.showLink=!1,u.displayModeBar=!1),"hover"!==u.displayModeBar||i||(u.displayModeBar=!0),"transparent"!==u.setBackground&&"function"==typeof u.setBackground||(u.setBackground=C),u._hasZeroHeight=u._hasZeroHeight||0===t.clientHeight,u._hasZeroWidth=u._hasZeroWidth||0===t.clientWidth;var f=u.scrollZoom,d=u._scrollZoom={};if(!0===f)d.cartesian=1,d.gl3d=1,d.geo=1,d.mapbox=1;else if("string"==typeof f){var h=f.split("+");for(a=0;a<h.length;a++)d[h[a]]=1}else!1!==f&&(d.gl3d=1,d.geo=1,d.mapbox=1)}function D(t,e){var r,n,a=e+1,i=[];for(r=0;r<t.length;r++)(n=t[r])<0?i.push(a+n):i.push(n);return i}function R(t,e,r){var n,a;for(n=0;n<e.length;n++){if((a=e[n])!==parseInt(a,10))throw new Error("all values in "+r+" must be integers");if(a>=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<r.length;g++){if(i=t.data[r[g]],l=(u=s(i,p)).get(),c=e[p][g],!o.isArrayOrTypedArray(c))throw new Error("attribute: "+p+" index: "+g+" must be an array");if(!o.isArrayOrTypedArray(l))throw new Error("cannot extend missing or non-array attribute: "+p);if(l.constructor!==c.constructor)throw new Error("cannot extend array with an array of a different type: "+p);f=d?n[p][g]:n,a(f)||(f=-1),h.push({prop:u,target:l,insert:c,maxp:Math.floor(f)})}return h}(t,e,r,n),u={},c={},f=0;f<l.length;f++){var d=l[f].prop,h=l[f].maxp,p=i(l[f].target,l[f].insert,h);d.set(p[0]),Array.isArray(u[d.astr])||(u[d.astr]=[]),u[d.astr].push(p[1]),Array.isArray(c[d.astr])||(c[d.astr]=[]),c[d.astr].push(l[f].target.length)}return{update:u,maxPoints:c}}function F(t,e){var r=new t.constructor(t.length+e.length);return r.set(t),r.set(e,t.length),r}function z(t,e,n,a){t=o.getGraphDiv(t),A.clearPromiseQueue(t);var i={};if("string"==typeof e)i[e]=n;else{if(!o.isPlainObject(e))return o.warn("Restyle fail.",e,n,a),Promise.reject();i=o.extendFlat({},e),void 0===a&&(a=n)}Object.keys(i).length&&(t.changed=!0);var s=A.coerceTraceIndices(t,a),l=U(t,i,s),c=l.flags;c.calc&&(t.calcdata=void 0),c.clearAxisTypes&&A.clearAxisTypes(t,s,{});var f=[];c.fullReplot?f.push(r.plot):(f.push(d.previousPromises),d.supplyDefaults(t),c.markerSize&&(d.doCalcdata(t),q(f)),c.style&&f.push(T.doTraceStyle),c.colorbars&&f.push(T.doColorBars),f.push(S)),f.push(d.rehover,d.redrag),u.add(t,z,[t,l.undoit,l.traces],z,[t,l.redoit,l.traces]);var h=o.syncOrAsync(f,t);return h&&h.then||(h=Promise.resolve()),h.then((function(){return t.emit("plotly_restyle",l.eventData),t}))}function N(t){return void 0===t?null:t}function B(t,e){return e?function(e,r,n){var a=s(e,r),i=a.set;return a.set=function(e){j((n||"")+r,a.get(),e,t),i(e)},a}:s}function j(t,e,r,n){if(Array.isArray(e)||Array.isArray(r))for(var a=Array.isArray(e)?e:[],i=Array.isArray(r)?r:[],s=Math.max(a.length,i.length),l=0;l<s;l++)j(t+"["+l+"]",a[l],i[l],n);else if(o.isPlainObject(e)||o.isPlainObject(r)){var u=o.isPlainObject(e)?e:{},c=o.isPlainObject(r)?r:{},f=o.extendFlat({},u,c);for(var d in f)j(t+"."+d,u[d],c[d],n)}else void 0===n[t]&&(n[t]=N(e))}function U(t,e,r){var n,a=t._fullLayout,i=t._fullData,l=t.data,u=a._guiEditing,h=B(a._preGUI,u),g=o.extendDeepAll({},e);V(e);var v,m=k.traceFlags(),y={},b={};function x(){return r.map((function(){}))}function _(t){var e=p.id2name(t);-1===v.indexOf(e)&&v.push(e)}function w(t){return"LAYOUT"+t+".autorange"}function T(t){return"LAYOUT"+t+".range"}function M(t){for(var e=t;e<i.length;e++)if(i[e]._input===l[t])return i[e]}function E(n,i,o){if(Array.isArray(n))n.forEach((function(t){E(t,i,o)}));else if(!(n in e)&&!A.hasParent(e,n)){var s;if("LAYOUT"===n.substr(0,6))s=h(t.layout,n.replace("LAYOUT",""));else{var c=r[o];s=B(a._tracePreGUI[M(c)._fullInput.uid],u)(l[c],n)}n in b||(b[n]=x()),void 0===b[n][o]&&(b[n][o]=N(s.get())),void 0!==i&&s.set(i)}}function S(t){return function(e){return i[e][t]}}function C(t){return function(e,n){return!1===e?i[r[n]][t]:null}}for(var L in e){if(A.hasParent(e,L))throw new Error("cannot set "+L+" and a parent attribute simultaneously");var O,D,R,I,P,F,z=e[L];if("autobinx"!==L&&"autobiny"!==L||(L=L.charAt(L.length-1)+"bins",z=Array.isArray(z)?z.map(C(L)):!1===z?r.map(S(L)):null),y[L]=z,"LAYOUT"!==L.substr(0,6)){for(b[L]=x(),n=0;n<r.length;n++){if(O=l[r[n]],D=M(r[n]),I=(R=B(a._tracePreGUI[D._fullInput.uid],u)(O,L)).get(),void 0!==(P=Array.isArray(z)?z[n%z.length]:z)){var j=R.parts[R.parts.length-1],U=L.substr(0,L.length-j.length-1),H=U?U+".":"",G=U?s(D,U).get():D;if((F=f.getTraceValObject(D,R.parts))&&F.impliedEdits&&null!==P)for(var q in F.impliedEdits)E(o.relativeAttr(L,q),F.impliedEdits[q],n);else if("thicknessmode"!==j&&"lenmode"!==j||I===P||"fraction"!==P&&"pixels"!==P||!G){if("type"===L&&("pie"===P!=("pie"===I)||"funnelarea"===P!=("funnelarea"===I))){var X="x",W="y";"bar"!==P&&"bar"!==I||"h"!==O.orientation||(X="y",W="x"),o.swapAttrs(O,["?","?src"],"labels",X),o.swapAttrs(O,["d?","?0"],"label",X),o.swapAttrs(O,["?","?src"],"values",W),"pie"===I||"funnelarea"===I?(s(O,"marker.color").set(s(O,"marker.colors").get()),a._pielayer.selectAll("g.trace").remove()):c.traceIs(O,"cartesian")&&s(O,"marker.colors").set(s(O,"marker.color").get())}}else{var Y=a._size,Z=G.orient,J="top"===Z||"bottom"===Z;if("thicknessmode"===j){var Q=J?Y.h:Y.w;E(H+"thickness",G.thickness*("fraction"===P?1/Q:Q),n)}else{var $=J?Y.w:Y.h;E(H+"len",G.len*("fraction"===P?1/$:$),n)}}b[L][n]=N(I);if(-1!==["swapxy","swapxyaxes","orientation","orientationaxes"].indexOf(L)){if("orientation"===L){R.set(P);var K=O.x&&!O.y?"h":"v";if((R.get()||K)===D.orientation)continue}else"orientationaxes"===L&&(O.orientation={v:"h",h:"v"}[D.orientation]);A.swapXYData(O),m.calc=m.clearAxisTypes=!0}else-1!==d.dataArrayContainers.indexOf(R.parts[0])?(A.manageArrayContainers(R,P,b),m.calc=!0):(F?F.arrayOk&&!c.traceIs(D,"regl")&&(o.isArrayOrTypedArray(P)||o.isArrayOrTypedArray(I))?m.calc=!0:k.update(m,F):m.calc=!0,R.set(P))}}if(-1!==["swapxyaxes","orientationaxes"].indexOf(L)&&p.swap(t,r),"orientationaxes"===L){var tt=s(t.layout,"hovermode"),et=tt.get();"x"===et?tt.set("y"):"y"===et?tt.set("x"):"x unified"===et?tt.set("y unified"):"y unified"===et&&tt.set("x unified")}if(-1!==["orientation","type"].indexOf(L)){for(v=[],n=0;n<r.length;n++){var rt=l[r[n]];c.traceIs(rt,"cartesian")&&(_(rt.xaxis||"x"),_(rt.yaxis||"y"))}E(v.map(w),!0,0),E(v.map(T),[0,1],0)}}else R=h(t.layout,L.replace("LAYOUT","")),b[L]=[N(R.get())],R.set(Array.isArray(z)?z[0]:z),m.calc=!0}return(m.calc||m.plot)&&(m.fullReplot=!0),{flags:m,undoit:b,redoit:y,traces:r,eventData:o.extendDeepNoArrays([],[g,r])}}function V(t){var e,r,n,a=o.counterRegex("axis",".title",!1,!1),i=/colorbar\.title$/,s=Object.keys(t);for(e=0;e<s.length;e++)r=s[e],n=t[r],"title"!==r&&!a.test(r)&&!i.test(r)||"string"!=typeof n&&"number"!=typeof n?r.indexOf("titlefont")>-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;n<h.length;n++)if(0===h[n].indexOf("allaxes")){for(a=0;a<g.length;a++){var y=g[a]._id.substr(1),b=-1!==y.indexOf("scene")?y+".":"",x=h[n].replace("allaxes",b+g[a]._name);e[x]||(e[x]=e[h[n]])}delete e[h[n]]}var _=k.layoutFlags(),T={},E={};function S(t,r){if(Array.isArray(t))t.forEach((function(t){S(t,r)}));else if(!(t in e)&&!A.hasParent(e,t)){var n=d(i,t);t in E||(E[t]=N(n.get())),void 0!==r&&n.set(r)}}var C,L={};function O(t){var e=p.name2id(t.split(".")[0]);return L[e]=1,e}for(var D in e){if(A.hasParent(e,D))throw new Error("cannot set "+D+" and a parent attribute simultaneously");for(var R=d(i,D),I=e[D],P=R.parts.length-1;P>0&&"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;r<e.length;r++){var n=e[r],a=t.match(n.pattern);if(a)return{head:a[1],attr:n.attr}}}function rt(t,e){var r=s(e,t).get();if(void 0!==r)return r;var n=t.split(".");for(n.pop();n.length>1;)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<e.length;r++)if(e[r]._fullInput.uid===t)return r;return-1}function at(t,e,r){for(var n=0;n<e.length;n++)if(e[n].uid===t)return n;return!e[r]||e[r].uid?-1:r}function it(t,e){var r=o.isPlainObject(t),n=Array.isArray(t);return r||n?(r&&o.isPlainObject(e)||n&&Array.isArray(e))&&JSON.stringify(t)===JSON.stringify(e):t===e}function ot(t,e,r,n){var a,i,l,u=n.getValObject,c=n.flags,f=n.immutable,d=n.inArray,h=n.arrayIndex;function p(){var t=a.editType;d&&-1!==t.indexOf("arraydraw")?o.pushUnique(c.arrays[d],h):(k.update(c,a),"none"!==t&&c.nChanges++,n.transition&&a.anim&&c.nChangesAnim++,(X.test(l)||W.test(l))&&(c.rangesAltered[r[0]]=1),Y.test(l)&&s(e,"_inputDomain").set(null),"datarevision"===i&&(c.newDataRevision=1))}function g(t){return"data_array"===t.valType||t.arrayOk}for(i in t){if(c.calc&&!n.transition)return;var v=t[i],m=e[i],y=r.concat(i);if(l=y.join("."),"_"!==i.charAt(0)&&"function"!=typeof v&&v!==m){if(("tick0"===i||"dtick"===i)&&"geo"!==r[0]){var b=e.tickmode;if("auto"===b||"array"===b||!b)continue}if(("range"!==i||!e.autorange)&&("zmin"!==i&&"zmax"!==i||"contourcarpet"!==e.type)&&(a=u(y))&&(!a._compareAsJSON||JSON.stringify(v)!==JSON.stringify(m))){var x,_=a.valType,w=g(a),A=Array.isArray(v),T=Array.isArray(m);if(A&&T){var M="_input_"+i,E=t[M],S=e[M];if(Array.isArray(E)&&E===S)continue}if(void 0===m)w&&A?c.calc=!0:p();else if(a._isLinkedToArray){var C=[],L=!1;d||(c.arrays[i]=C);var O=Math.min(v.length,m.length),D=Math.max(v.length,m.length);if(O!==D){if("arraydraw"!==a.editType){p();continue}L=!0}for(x=0;x<O;x++)ot(v[x],m[x],y.concat(x),o.extendFlat({inArray:i,arrayIndex:x},n));if(L)for(x=O;x<D;x++)C.push(x)}else!_&&o.isPlainObject(v)?ot(v,m,y,n):w?A&&T?(f&&(c.calc=!0),(f||n.newDataRevision)&&p()):A!==T?c.calc=!0:p():A&&T&&v.length===m.length&&String(v)===String(m)||p()}}}for(i in e)if(!(i in t)&&"_"!==i.charAt(0)&&"function"!=typeof e[i]){if(g(a=u(r.concat(i)))&&Array.isArray(e[i]))return void(c.calc=!0);p()}}function st(t){var e=t._fullLayout,r=t.getBoundingClientRect();if(!o.equalDomRects(r,e._lastBBox)){var n=e._invTransform=o.inverseTransformMatrix(o.getFullTransformMatrix(t));e._invScaleX=Math.sqrt(n[0][0]*n[0][0]+n[0][1]*n[0][1]+n[0][2]*n[0][2]),e._invScaleY=Math.sqrt(n[1][0]*n[1][0]+n[1][1]*n[1][1]+n[1][2]*n[1][2]),e._lastBBox=r}}function lt(t){var e=n.select(t),r=t._fullLayout;if(r._calcInverseTransform=st,r._calcInverseTransform(t),r._container=e.selectAll(".plot-container").data([0]),r._container.enter().insert("div",":first-child").classed("plot-container",!0).classed("plotly",!0),r._paperdiv=r._container.selectAll(".svg-container").data([0]),r._paperdiv.enter().append("div").classed("user-select-none",!0).classed("svg-container",!0).style("position","relative"),r._glcontainer=r._paperdiv.selectAll(".gl-container").data([{}]),r._glcontainer.enter().append("div").classed("gl-container",!0),r._paperdiv.selectAll(".main-svg").remove(),r._paperdiv.select(".modebar-container").remove(),r._paper=r._paperdiv.insert("svg",":first-child").classed("main-svg",!0),r._toppaper=r._paperdiv.append("svg").classed("main-svg",!0),r._modebardiv=r._paperdiv.append("div"),delete r._modeBar,r._hoverpaper=r._paperdiv.append("svg").classed("main-svg",!0),!r._uid){var a={};n.selectAll("defs").each((function(){this.id&&(a[this.id.split("-")[1]]=1)})),r._uid=o.randstr(a)}r._paperdiv.selectAll(".main-svg").attr(y.svgAttrs),r._defs=r._paper.append("defs").attr("id","defs-"+r._uid),r._clips=r._defs.append("g").classed("clips",!0),r._topdefs=r._toppaper.append("defs").attr("id","topdefs-"+r._uid),r._topclips=r._topdefs.append("g").classed("clips",!0),r._bgLayer=r._paper.append("g").classed("bglayer",!0),r._draggers=r._paper.append("g").classed("draglayer",!0);var i=r._paper.append("g").classed("layer-below",!0);r._imageLowerLayer=i.append("g").classed("imagelayer",!0),r._shapeLowerLayer=i.append("g").classed("shapelayer",!0),r._cartesianlayer=r._paper.append("g").classed("cartesianlayer",!0),r._polarlayer=r._paper.append("g").classed("polarlayer",!0),r._ternarylayer=r._paper.append("g").classed("ternarylayer",!0),r._geolayer=r._paper.append("g").classed("geolayer",!0),r._funnelarealayer=r._paper.append("g").classed("funnelarealayer",!0),r._pielayer=r._paper.append("g").classed("pielayer",!0),r._treemaplayer=r._paper.append("g").classed("treemaplayer",!0),r._sunburstlayer=r._paper.append("g").classed("sunburstlayer",!0),r._indicatorlayer=r._toppaper.append("g").classed("indicatorlayer",!0),r._glimages=r._paper.append("g").classed("glimages",!0);var s=r._toppaper.append("g").classed("layer-above",!0);r._imageUpperLayer=s.append("g").classed("imagelayer",!0),r._shapeUpperLayer=s.append("g").classed("shapelayer",!0),r._infolayer=r._toppaper.append("g").classed("infolayer",!0),r._menulayer=r._toppaper.append("g").classed("menulayer",!0),r._zoomlayer=r._toppaper.append("g").classed("zoomlayer",!0),r._hoverlayer=r._hoverpaper.append("g").classed("hoverlayer",!0),r._modebardiv.classed("modebar-container",!0).style("position","absolute").style("top","0px").style("right","0px"),t.emit("plotly_framework")}r.animate=function(t,e,r){if(t=o.getGraphDiv(t),!o.isPlotDiv(t))throw new Error("This element is not a Plotly plot: "+t+". It's likely that you've failed to create a plot before animating it. For more details, see https://plotly.com/javascript/animations/");var n=t._transitionData;n._frameQueue||(n._frameQueue=[]);var a=(r=d.supplyAnimationDefaults(r)).transition,i=r.frame;function s(t){return Array.isArray(a)?t>=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;p<n._frames.length;p++)(g=n._frames[p])&&(b||String(g.group)===String(e))&&y.push({type:"byname",name:String(g.name),data:m({name:g.name})});else if(x)for(p=0;p<e.length;p++){var _=e[p];-1!==["number","string"].indexOf(typeof _)?(_=String(_),y.push({type:"byname",name:_,data:m({name:_})})):o.isPlainObject(_)&&y.push({type:"object",data:m(o.extendFlat({},_))})}for(p=0;p<y.length;p++)if("byname"===(g=y[p]).type&&!n._frameHash[g.data.name])return o.warn('animate failure: frame not found: "'+g.data.name+'"'),void c();-1!==["next","immediate"].indexOf(r.mode)&&function(){if(0!==n._frameQueue.length){for(;n._frameQueue.length;){var e=n._frameQueue.pop();e.onInterrupt&&e.onInterrupt()}t.emit("plotly_animationinterrupted",[])}}(),"reverse"===r.direction&&y.reverse();var w=t._fullLayout._currentFrame;if(w&&r.fromcurrent){var T=-1;for(p=0;p<y.length;p++)if("byname"===(g=y[p]).type&&g.name===w){T=p;break}if(T>0&&T<y.length-1){var k=[];for(p=0;p<y.length;p++)g=y[p],("byname"!==y[p].type||p>T)&&k.push(g);y=k}}y.length>0?function(e){if(0!==e.length){for(var a=0;a<e.length;a++){var o;o="byname"===e[a].type?d.computeFrame(t,e[a].name):e[a].data;var f=l(a),p=s(a);p.duration=Math.min(p.duration,f.duration);var g={frame:o,name:e[a].name,frameOpts:f,transitionOpts:p};a===e.length-1&&(g.onComplete=u(i,2),g.onInterrupt=c),n._frameQueue.push(g)}"immediate"===r.mode&&(n._lastFrameAt=-1/0),n._animationRaf||h()}}(y):(t.emit("plotly_animated"),i())}))},r.addFrames=function(t,e,r){if(t=o.getGraphDiv(t),null==e)return Promise.resolve();if(!o.isPlotDiv(t))throw new Error("This element is not a Plotly plot: "+t+". It's likely that you've failed to create a plot before adding frames. For more details, see https://plotly.com/javascript/animations/");var n,a,i,s,l=t._transitionData._frames,c=t._transitionData._frameHash;if(!Array.isArray(e))throw new Error("addFrames failure: frameList must be an Array of frame definitions"+e);var f=l.length+2*e.length,h=[],p={};for(n=e.length-1;n>=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<e.index?1:0}));var b=[],x=[],_=l.length;for(n=h.length-1;n>=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<l.length&&(l[i]||{}).name!==a.name;i++);b.push({type:"replace",index:i,value:a}),x.unshift({type:"replace",index:i,value:l[i]})}else s=Math.max(0,Math.min(h[n].index,_)),b.push({type:"insert",index:s,value:a}),x.unshift({type:"delete",index:s}),_++}var w=d.modifyFrames,A=d.modifyFrames,T=[t,x],k=[t,b];return u&&u.add(t,w,T,A,k),d.modifyFrames(t,b)},r.deleteFrames=function(t,e){if(t=o.getGraphDiv(t),!o.isPlotDiv(t))throw new Error("This element is not a Plotly plot: "+t);var r,n,a=t._transitionData._frames,i=[],s=[];if(!e)for(e=[],r=0;r<a.length;r++)e.push(r);for((e=e.slice()).sort(),r=e.length-1;r>=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<e.length;n++)if("object"!=typeof(a=e[n])||Array.isArray(a)||null===a)throw new Error("all values in traces array must be non-array objects");if("undefined"==typeof r||Array.isArray(r)||(r=[r]),"undefined"!=typeof r&&r.length!==e.length)throw new Error("if indices is specified, traces.length must equal indices.length")}(e,n,a),Array.isArray(n)||(n=[n]),n=n.map((function(t){return o.extendFlat({},t)})),A.cleanData(n),i=0;i<n.length;i++)e.data.push(n[i]);for(i=0;i<n.length;i++)l.push(-n.length+i);if("undefined"==typeof a)return s=r.redraw(e),u.add(e,c,d,f,h),s;Array.isArray(a)||(a=[a]);try{I(e,l,a)}catch(t){throw e.data.splice(e.data.length-n.length,n.length),t}return u.startSequence(e),u.add(e,c,d,f,h),s=r.moveTraces(e,l,a),u.stopSequence(e),s},r.deleteTraces=function t(e,n){e=o.getGraphDiv(e);var a,i,s=[],l=r.addTraces,c=t,f=[e,s,n],d=[e,n];if("undefined"==typeof n)throw new Error("indices must be an integer or array of integers.");for(Array.isArray(n)||(n=[n]),R(e,n,"indices"),(n=D(n,e.data.length-1)).sort(o.sorterDes),a=0;a<n.length;a+=1)i=e.data.splice(n[a],1)[0],s.push(i);var h=r.redraw(e);return u.add(e,l,f,c,d),h},r.extendTraces=function t(e,n,a,i){function s(t,e,r){var n,a;if(o.isTypedArray(t))if(r<0){var i=new t.constructor(0),s=F(t,e);r<0?(n=s,a=i):(n=i,a=s)}else if(n=new t.constructor(r),a=new t.constructor(t.length+e.length-r),r===e.length)n.set(e),a.set(t);else if(r<e.length){var l=e.length-r;n.set(e.subarray(l)),a.set(t),a.set(e.subarray(0,l),t.length)}else{var u=r-e.length,c=t.length-u;n.set(t.subarray(c)),n.set(e,u),a.set(t.subarray(0,c))}else n=t.concat(e),a=r>=0&&r<n.length?n.splice(0,n.length-r):[];return[n,a]}var l=P(e=o.getGraphDiv(e),n,a,i,s),c=r.redraw(e),f=[e,l.update,a,l.maxPoints];return u.add(e,r.prependTraces,f,t,arguments),c},r.moveTraces=function t(e,n,a){var i,s=[],l=[],c=t,f=t,d=[e=o.getGraphDiv(e),a,n],h=[e,n,a];if(I(e,n,a),n=Array.isArray(n)?n:[n],"undefined"==typeof a)for(a=[],i=0;i<n.length;i++)a.push(-n.length+i);for(a=Array.isArray(a)?a:[a],n=D(n,e.data.length-1),a=D(a,e.data.length-1),i=0;i<e.data.length;i++)-1===n.indexOf(i)&&s.push(e.data[i]);for(i=0;i<n.length;i++)l.push({newIndex:a[i],trace:e.data[n[i]]});for(l.sort((function(t,e){return t.newIndex-e.newIndex})),i=0;i<l.length;i+=1)s.splice(l[i].newIndex,0,l[i].trace);e.data=s;var p=r.redraw(e);return u.add(e,c,d,f,h),p},r.prependTraces=function t(e,n,a,i){function s(t,e,r){var n,a;if(o.isTypedArray(t))if(r<=0){var i=new t.constructor(0),s=F(e,t);r<0?(n=s,a=i):(n=i,a=s)}else if(n=new t.constructor(r),a=new t.constructor(t.length+e.length-r),r===e.length)n.set(e),a.set(t);else if(r<e.length){var l=e.length-r;n.set(e.subarray(0,l)),a.set(e.subarray(l)),a.set(t,l)}else{var u=r-e.length;n.set(e),n.set(t.subarray(0,u),e.length),a.set(t.subarray(u))}else n=e.concat(t),a=r>=0&&r<n.length?n.splice(r,n.length):[];return[n,a]}var l=P(e=o.getGraphDiv(e),n,a,i,s),c=r.redraw(e),f=[e,l.update,a,l.maxPoints];return u.add(e,r.extendTraces,f,t,arguments),c},r.newPlot=function(t,e,n,a){return t=o.getGraphDiv(t),d.cleanPlot([],{},t._fullData||[],t._fullLayout||{}),d.purge(t),r.plot(t,e,n,a)},r.plot=function(t,e,a,i){var s;if(t=o.getGraphDiv(t),l.init(t),o.isPlainObject(e)){var u=e;e=u.data,a=u.layout,i=u.config,s=u.frames}if(!1===l.triggerHandler(t,"plotly_beforeplot",[e,a,i]))return Promise.reject();e||a||o.isPlotDiv(t)||o.warn("Calling Plotly.plot as if redrawing but this container doesn't yet have a plot.",t),O(t,i),a||(a={}),n.select(t).classed("js-plotly-plot",!0),g.makeTester(),Array.isArray(t._promises)||(t._promises=[]);var f=0===(t.data||[]).length&&Array.isArray(e);Array.isArray(e)&&(A.cleanData(e),f?t.data=e:t.data.push.apply(t.data,e),t.empty=!1),t.layout&&!f||(t.layout=A.cleanLayout(a)),d.supplyDefaults(t);var v=t._fullLayout,y=v._has("cartesian");if(!v._has("polar")&&e&&e[0]&&e[0].r)return o.log("Legacy polar charts are deprecated!"),function(t,e,r){var a=n.select(t).selectAll(".plot-container").data([0]);a.enter().insert("div",":first-child").classed("plot-container plotly",!0);var i=a.selectAll(".svg-container").data([0]);i.enter().append("div").classed("svg-container",!0).style("position","relative"),i.html(""),e&&(t.data=e);r&&(t.layout=r);h.manager.fillLayout(t),i.style({width:t._fullLayout.width+"px",height:t._fullLayout.height+"px"}),t.framework=h.manager.framework(t),t.framework({data:t.data,layout:t.layout},i.node()),t.framework.setUndoPoint();var s=t.framework.svg(),l=1,u=t._fullLayout.title?t._fullLayout.title.text:"";""!==u&&u||(l=0);var c=function(){this.call(b.convertToTspans,t)},f=s.select(".title-group text").call(c);if(t._context.edits.titleText){var p=o._(t,"Click to enter Plot title");u&&u!==p||(l=.2,f.attr({"data-unformatted":p}).text(p).style({opacity:l}).on("mouseover.opacity",(function(){n.select(this).transition().duration(100).style("opacity",1)})).on("mouseout.opacity",(function(){n.select(this).transition().duration(1e3).style("opacity",0)})));var g=function(){this.call(b.makeEditable,{gd:t}).on("edit",(function(e){t.framework({layout:{title:{text:e}}}),this.text(e).call(c),this.call(g)})).on("cancel",(function(){var t=this.attr("data-unformatted");this.text(t).call(c)}))};f.call(g)}return t._context.setBackground(t,t._fullLayout.paper_bgcolor),d.addLinks(t),Promise.resolve()}(t,e,a);v._replotting=!0,(f||v._shouldCreateBgLayer)&&(lt(t),v._shouldCreateBgLayer&&delete v._shouldCreateBgLayer),t.framework!==lt&&(t.framework=lt,lt(t)),g.initGradients(t),f&&p.saveShowSpikeInitial(t);var x=!t.calcdata||t.calcdata.length!==(t._fullData||[]).length;x&&d.doCalcdata(t);for(var _=0;_<t.calcdata.length;_++)t.calcdata[_][0].trace=t._fullData[_];t._context.responsive?t._responsiveChartHandler||(t._responsiveChartHandler=function(){o.isHidden(t)||d.resize(t)},window.addEventListener("resize",t._responsiveChartHandler)):o.clearResponsive(t);var w=o.extendFlat({},v._size),k=0;function M(){if(d.clearAutoMarginIds(t),T.drawMarginPushers(t),p.allowAutoMargin(t),v._has("pie"))for(var e=t._fullData,r=0;r<e.length;r++){var n=e[r];"pie"===n.type&&n.automargin&&d.allowAutoMargin(t,"pie."+n.uid+".automargin")}return d.doAutoMargin(t),d.previousPromises(t)}function E(){t._transitioning||(T.doAutoRangeAndConstraints(t),f&&p.saveRangeInitial(t),c.getComponentMethod("rangeslider","calcAutorange")(t))}var C=[d.previousPromises,function(){if(s)return r.addFrames(t,s)},function e(){for(var r=v._basePlotModules,n=0;n<r.length;n++)r[n].drawFramework&&r[n].drawFramework(t);if(!v._glcanvas&&v._has("gl")&&(v._glcanvas=v._glcontainer.selectAll(".gl-canvas").data([{key:"contextLayer",context:!0,pick:!1},{key:"focusLayer",context:!1,pick:!1},{key:"pickLayer",context:!1,pick:!0}],(function(t){return t.key})),v._glcanvas.enter().append("canvas").attr("class",(function(t){return"gl-canvas gl-canvas-"+t.key.replace("Layer","")})).style({position:"absolute",top:0,left:0,overflow:"visible","pointer-events":"none"})),v._glcanvas){v._glcanvas.attr("width",v.width).attr("height",v.height);var a=v._glcanvas.data()[0].regl;if(a&&(Math.floor(v.width)!==a._gl.drawingBufferWidth||Math.floor(v.height)!==a._gl.drawingBufferHeight)){var i="WebGL context buffer and canvas dimensions do not match due to browser/WebGL bug.";if(!k)return o.log(i+" Clearing graph and plotting again."),d.cleanPlot([],{},t._fullData,v),d.supplyDefaults(t),v=t._fullLayout,d.doCalcdata(t),k++,e();o.error(i)}}return"h"===v.modebar.orientation?v._modebardiv.style("height",null).style("width","100%"):v._modebardiv.style("width",null).style("height",v.height+"px"),d.previousPromises(t)},M,function(){if(d.didMarginChange(w,v._size))return o.syncOrAsync([M,T.layoutStyles],t)}];y&&C.push((function(){if(x)return o.syncOrAsync([c.getComponentMethod("shapes","calcAutorange"),c.getComponentMethod("annotations","calcAutorange"),E],t);E()})),C.push(T.layoutStyles),y&&C.push((function(){return p.draw(t,f?"":"redraw")}),(function(t){t._fullLayout._insideTickLabelsAutorange&&H(t,t._fullLayout._insideTickLabelsAutorange).then((function(){t._fullLayout._insideTickLabelsAutorange=void 0}))})),C.push(T.drawData,T.finalDraw,m,d.addLinks,d.rehover,d.redrag,d.doAutoMargin,(function(t){t._fullLayout._insideTickLabelsAutorange&&f&&p.saveRangeInitial(t,!0)}),d.previousPromises);var L=o.syncOrAsync(C,t);return L&&L.then||(L=Promise.resolve()),L.then((function(){return S(t),t}))},r.purge=function(t){var e=(t=o.getGraphDiv(t))._fullLayout||{},r=t._fullData||[];return d.cleanPlot([],{},r,e),d.purge(t),l.purge(t),e._container&&e._container.remove(),delete t._context,t},r.react=function(t,e,n,a){var i,l;t=o.getGraphDiv(t),A.clearPromiseQueue(t);var u=t._fullData,h=t._fullLayout;if(o.isPlotDiv(t)&&u&&h){if(o.isPlainObject(e)){var p=e;e=p.data,n=p.layout,a=p.config,i=p.frames}var g=!1;if(a){var v=o.extendDeep({},t._context);t._context=void 0,O(t,a),g=function t(e,r){var n;for(n in e)if("_"!==n.charAt(0)){var a=e[n],i=r[n];if(a!==i)if(o.isPlainObject(a)&&o.isPlainObject(i)){if(t(a,i))return!0}else{if(!Array.isArray(a)||!Array.isArray(i))return!0;if(a.length!==i.length)return!0;for(var s=0;s<a.length;s++)if(a[s]!==i[s]){if(!o.isPlainObject(a[s])||!o.isPlainObject(i[s]))return!0;if(t(a[s],i[s]))return!0}}}}(v,t._context)}t.data=e||[],A.cleanData(t.data),t.layout=n||{},A.cleanLayout(t.layout),function(t,e,r,n){var a,i,l,u,c,f,d,h,p=n._preGUI,g=[],v={};for(a in p){if(c=et(a,K)){if(i=c.attr||c.head+".uirevision",(u=(l=s(n,i).get())&&rt(i,e))&&u===l&&(null===(f=p[a])&&(f=void 0),it(h=(d=s(e,a)).get(),f))){void 0===h&&"autorange"===a.substr(a.length-9)&&g.push(a.substr(0,a.length-10)),d.set(N(s(n,a).get()));continue}}else o.warn("unrecognized GUI edit: "+a);delete p[a],"range["===a.substr(a.length-8,6)&&(v[a.substr(0,a.length-9)]=1)}for(var m=0;m<g.length;m++){var y=g[m];if(v[y]){var b=s(e,y).get();b&&delete b.autorange}}var x=n._tracePreGUI;for(var _ in x){var w,A=x[_],T=null;for(a in A){if(!T){var k=nt(_,r);if(k<0){delete x[_];break}var M=at(_,t,(w=r[k]._fullInput).index);if(M<0){delete x[_];break}T=t[M]}if(c=et(a,tt)){if(c.attr?u=(l=s(n,c.attr).get())&&rt(c.attr,e):(l=w.uirevision,void 0===(u=T.uirevision)&&(u=e.uirevision)),u&&u===l&&(null===(f=A[a])&&(f=void 0),it(h=(d=s(T,a)).get(),f))){d.set(N(s(w,a).get()));continue}}else o.warn("unrecognized GUI edit: "+a+" in trace uid "+_);delete A[a]}}}(t.data,t.layout,u,h),d.supplyDefaults(t,{skipUpdateCalc:!0});var m=t._fullData,y=t._fullLayout,b=void 0===y.datarevision,x=y.transition,_=function(t,e,r,n,a){var i=k.layoutFlags();function o(t){return f.getLayoutValObject(r,t)}i.arrays={},i.rangesAltered={},i.nChanges=0,i.nChangesAnim=0,ot(e,r,[],{getValObject:o,flags:i,immutable:n,transition:a,gd:t}),(i.plot||i.calc)&&(i.layoutReplot=!0);a&&i.nChanges&&i.nChangesAnim&&(i.anim=i.nChanges===i.nChangesAnim?"all":"some");return i}(t,h,y,b,x),w=_.newDataRevision,M=function(t,e,r,n,a,i){var o=e.length===r.length;if(!a&&!o)return{fullReplot:!0,calc:!0};var s,l,u=k.traceFlags();u.arrays={},u.nChanges=0,u.nChangesAnim=0;var c={getValObject:function(t){var e=f.getTraceValObject(l,t);return!l._module.animatable&&e.anim&&(e.anim=!1),e},flags:u,immutable:n,transition:a,newDataRevision:i,gd:t},h={};for(s=0;s<e.length;s++)if(r[s]){if(l=r[s]._fullInput,d.hasMakesDataTransform(l)&&(l=r[s]),h[l.uid])continue;h[l.uid]=1,ot(e[s]._fullInput,l,[],c)}(u.calc||u.plot)&&(u.fullReplot=!0);a&&u.nChanges&&u.nChangesAnim&&(u.anim=u.nChanges===u.nChangesAnim&&o?"all":"some");return u}(t,u,m,b,x,w);if(J(t)&&(_.layoutReplot=!0),M.calc||_.calc){t.calcdata=void 0;for(var E=Object.getOwnPropertyNames(y),C=0;C<E.length;C++){var L=E[C],D=L.substring(0,5);if("xaxis"===D||"yaxis"===D){var R=y[L]._emptyCategories;R&&R()}}}else d.supplyDefaultsUpdateCalc(t.calcdata,m);var I=[];if(i&&(t._transitionData={},d.createTransitionData(t),I.push((function(){return r.addFrames(t,i)}))),y.transition&&!g&&(M.anim||_.anim))_.ticks&&I.push(T.doTicksRelayout),d.doCalcdata(t),T.doAutoRangeAndConstraints(t),I.push((function(){return d.transitionFromReact(t,M,_,h)}));else if(M.fullReplot||_.layoutReplot||g)t._fullLayout._skipDefaults=!0,I.push(r.plot);else{for(var P in _.arrays){var F=_.arrays[P];if(F.length){var z=c.getComponentMethod(P,"drawOne");if(z!==o.noop)for(var B=0;B<F.length;B++)z(t,F[B]);else{var j=c.getComponentMethod(P,"draw");if(j===o.noop)throw new Error("cannot draw components: "+P);j(t)}}}I.push(d.previousPromises),M.style&&I.push(T.doTraceStyle),(M.colorbars||_.colorbars)&&I.push(T.doColorBars),_.legend&&I.push(T.doLegend),_.layoutstyle&&I.push(T.layoutStyles),_.axrange&&q(I),_.ticks&&I.push(T.doTicksRelayout),_.modebar&&I.push(T.doModeBar),_.camera&&I.push(T.doCamera),I.push(S)}I.push(d.rehover,d.redrag),(l=o.syncOrAsync(I,t))&&l.then||(l=Promise.resolve(t))}else l=r.newPlot(t,e,n,a);return l.then((function(){return t.emit("plotly_react",{data:e,layout:n}),t}))},r.redraw=function(t){if(t=o.getGraphDiv(t),!o.isPlotDiv(t))throw new Error("This element is not a Plotly plot: "+t);return A.cleanData(t.data),A.cleanLayout(t.layout),t.calcdata=void 0,r.plot(t).then((function(){return t.emit("plotly_redraw"),t}))},r.relayout=H,r.restyle=z,r.setPlotConfig=function(t){return o.extendFlat(_,t)},r.update=Q,r._guiRelayout=$(H),r._guiRestyle=$(z),r._guiUpdate=$(Q),r._storeDirectGUIEdit=function(t,e,r){for(var n in r){j(n,s(t,n).get(),r[n],e)}}},{"../components/color":368,"../components/drawing":390,"../constants/xmlns_namespaces":476,"../lib":498,"../lib/events":489,"../lib/queue":514,"../lib/svg_text_utils":523,"../plots/cartesian/axes":547,"../plots/cartesian/constants":553,"../plots/cartesian/graph_interact":556,"../plots/cartesian/select":566,"../plots/plots":585,"../plots/polar/legacy":588,"../registry":593,"./edit_types":529,"./helpers":530,"./manage_arrays":532,"./plot_config":534,"./plot_schema":535,"./subroutines":537,d3:86,"fast-isnumeric":155,"has-hover":237}],534:[function(t,e,r){"use strict";var n={staticPlot:{valType:"boolean",dflt:!1},plotlyServerURL:{valType:"string",dflt:""},editable:{valType:"boolean",dflt:!1},edits:{annotationPosition:{valType:"boolean",dflt:!1},annotationTail:{valType:"boolean",dflt:!1},annotationText:{valType:"boolean",dflt:!1},axisTitleText:{valType:"boolean",dflt:!1},colorbarPosition:{valType:"boolean",dflt:!1},colorbarTitleText:{valType:"boolean",dflt:!1},legendPosition:{valType:"boolean",dflt:!1},legendText:{valType:"boolean",dflt:!1},shapePosition:{valType:"boolean",dflt:!1},titleText:{valType:"boolean",dflt:!1}},autosizable:{valType:"boolean",dflt:!1},responsive:{valType:"boolean",dflt:!1},fillFrame:{valType:"boolean",dflt:!1},frameMargins:{valType:"number",dflt:0,min:0,max:.5},scrollZoom:{valType:"flaglist",flags:["cartesian","gl3d","geo","mapbox"],extras:[!0,!1],dflt:"gl3d+geo+mapbox"},doubleClick:{valType:"enumerated",values:[!1,"reset","autosize","reset+autosize"],dflt:"reset+autosize"},doubleClickDelay:{valType:"number",dflt:300,min:0},showAxisDragHandles:{valType:"boolean",dflt:!0},showAxisRangeEntryBoxes:{valType:"boolean",dflt:!0},showTips:{valType:"boolean",dflt:!0},showLink:{valType:"boolean",dflt:!1},linkText:{valType:"string",dflt:"Edit chart",noBlank:!0},sendData:{valType:"boolean",dflt:!0},showSources:{valType:"any",dflt:!1},displayModeBar:{valType:"enumerated",values:["hover",!0,!1],dflt:"hover"},showSendToCloud:{valType:"boolean",dflt:!1},showEditInChartStudio:{valType:"boolean",dflt:!1},modeBarButtonsToRemove:{valType:"any",dflt:[]},modeBarButtonsToAdd:{valType:"any",dflt:[]},modeBarButtons:{valType:"any",dflt:!1},toImageButtonOptions:{valType:"any",dflt:{}},displaylogo:{valType:"boolean",dflt:!0},watermark:{valType:"boolean",dflt:!1},plotGlPixelRatio:{valType:"number",dflt:2,min:1,max:4},setBackground:{valType:"any",dflt:"transparent"},topojsonURL:{valType:"string",noBlank:!0,dflt:"https://cdn.plot.ly/"},mapboxAccessToken:{valType:"string",dflt:null},logging:{valType:"integer",min:0,max:2,dflt:1},notifyOnLogging:{valType:"integer",min:0,max:2,dflt:0},queueLength:{valType:"integer",min:0,dflt:0},globalTransforms:{valType:"any",dflt:[]},locale:{valType:"string",dflt:"en-US"},locales:{valType:"any",dflt:{}}},a={};!function t(e,r){for(var n in e){var a=e[n];a.valType?r[n]=a.dflt:(r[n]||(r[n]={}),t(a,r[n]))}}(n,a),e.exports={configAttributes:n,dfltConfig:a}},{}],535:[function(t,e,r){"use strict";var n=t("../registry"),a=t("../lib"),i=t("../plots/attributes"),o=t("../plots/layout_attributes"),s=t("../plots/frame_attributes"),l=t("../plots/animation_attributes"),u=t("./plot_config").configAttributes,c=t("../plots/polar/legacy/area_attributes"),f=t("../plots/polar/legacy/axis_attributes"),d=t("./edit_types"),h=a.extendFlat,p=a.extendDeepAll,g=a.isPlainObject,v=a.isArrayOrTypedArray,m=a.nestedProperty,y=a.valObjectMeta,b=["_isSubplotObj","_isLinkedToArray","_arrayAttrRegexps","_deprecated"];function x(t,e,r){if(!t)return!1;if(t._isLinkedToArray)if(_(e[r]))r++;else if(r<e.length)return!1;for(;r<e.length;r++){var n=t[e[r]];if(!g(n))break;if(t=n,r===e.length-1)break;if(t._isLinkedToArray){if(!_(e[++r]))return!1}else if("info_array"===t.valType){var a=e[++r];if(!_(a))return!1;var i=t.items;if(Array.isArray(i)){if(a>=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<e.attr.length;a++)k(r,e,e.attr[a]);else k(r,e,"subplot"===e.attr?e.name:e.attr)}for(t in r=function(t){return h(t,{radialaxis:f.radialaxis,angularaxis:f.angularaxis}),h(t,f.layout),t}(r),n.componentsRegistry){var i=(e=n.componentsRegistry[t]).schema;if(i&&(i.subplots||i.layout)){var s=i.subplots;if(s&&s.xaxis&&!s.yaxis)for(var l in s.xaxis)delete r.yaxis[l]}else"colorscale"===e.name?p(r,e.layoutAttributes):e.layoutAttributes&&M(r,e.layoutAttributes,e.name)}return{layoutAttributes:T(r)}}function A(){var t={frames:p({},s)};return T(t),t.frames}function T(t){return function(t){r.crawl(t,(function(t,e,n){r.isValObject(t)?"data_array"===t.valType?(t.role="data",n[e+"src"]={valType:"string",editType:"none"}):!0===t.arrayOk&&(n[e+"src"]={valType:"string",editType:"none"}):g(t)&&(t.role="object")}))}(t),function(t){r.crawl(t,(function(t,e,r){if(t){var n=t._isLinkedToArray;n&&(delete t._isLinkedToArray,r[e]={items:{}},r[e].items[n]=t,r[e].role="object")}}))}(t),function(t){!function t(e){for(var r in e)if(g(e[r]))t(e[r]);else if(Array.isArray(e[r]))for(var n=0;n<e[r].length;n++)t(e[r][n]);else e[r]instanceof RegExp&&(e[r]=e[r].toString())}(t)}(t),t}function k(t,e,r){var n=m(t,r),a=p({},e.layoutAttributes);a._isSubplotObj=!0,n.set(a)}function M(t,e,r){var n=m(t,r);n.set(p(n.get()||{},e))}r.IS_SUBPLOT_OBJ="_isSubplotObj",r.IS_LINKED_TO_ARRAY="_isLinkedToArray",r.DEPRECATED="_deprecated",r.UNDERSCORE_ATTRS=b,r.get=function(){var t={};n.allTypes.concat("area").forEach((function(e){t[e]=function(t){var e,a;"area"===t?(e={attributes:c},a={}):(e=n.modules[t]._module,a=e.basePlotModule);var o={type:null},s=p({},i),l=p({},e.attributes);r.crawl(l,(function(t,e,r,n,a){m(s,a).set(void 0),void 0===t&&m(l,a).set(void 0)})),p(o,s),n.traceIs(t,"noOpacity")&&delete o.opacity;n.traceIs(t,"showLegend")||(delete o.showlegend,delete o.legendgroup);n.traceIs(t,"noHover")&&(delete o.hoverinfo,delete o.hoverlabel);e.selectPoints||delete o.selectedpoints;p(o,l),a.attributes&&p(o,a.attributes);o.type=t;var u={meta:e.meta||{},categories:e.categories||{},animatable:Boolean(e.animatable),type:t,attributes:T(o)};if(e.layoutAttributes){var f={};p(f,e.layoutAttributes),u.layoutAttributes=T(f)}e.animatable||r.crawl(u,(function(t){r.isValObject(t)&&"anim"in t&&delete t.anim}));return u}(e)}));var e={};return Object.keys(n.transformsRegistry).forEach((function(t){e[t]=function(t){var e=n.transformsRegistry[t],r=p({},e.attributes);return Object.keys(n.componentsRegistry).forEach((function(e){var a=n.componentsRegistry[e];a.schema&&a.schema.transforms&&a.schema.transforms[t]&&Object.keys(a.schema.transforms[t]).forEach((function(e){M(r,a.schema.transforms[t][e],e)}))})),{attributes:T(r)}}(t)})),{defs:{valObjects:y,metaKeys:b.concat(["description","role","editType","impliedEdits"]),editType:{traces:d.traces,layout:d.layout},impliedEdits:{}},traces:t,layout:w(),transforms:e,frames:A(),animation:T(l),config:T(u)}},r.crawl=function(t,e,n,a){var i=n||0;a=a||"",Object.keys(t).forEach((function(n){var o=t[n];if(-1===b.indexOf(n)){var s=(a?a+".":"")+n;e(o,n,t,i,s),r.isValObject(o)||g(o)&&"impliedEdits"!==n&&r.crawl(o,e,i+1,s)}}))},r.isValObject=function(t){return t&&void 0!==t.valType},r.findArrayAttributes=function(t){var e,n,a=[],o=[],s=[];function l(t,r,i,l){o=o.slice(0,l).concat([r]),s=s.slice(0,l).concat([t&&t._isLinkedToArray]),t&&("data_array"===t.valType||!0===t.arrayOk)&&!("colorbar"===o[l-1]&&("ticktext"===r||"tickvals"===r))&&function t(e,r,i){var l=e[o[r]],u=i+o[r];if(r===o.length-1)v(l)&&a.push(n+u);else if(s[r]){if(Array.isArray(l))for(var c=0;c<l.length;c++)g(l[c])&&t(l[c],r+1,u+"["+c+"].")}else g(l)&&t(l,r+1,u+".")}(e,0,"")}e=t,n="",r.crawl(i,l),t._module&&t._module.attributes&&r.crawl(t._module.attributes,l);var u=t.transforms;if(u)for(var c=0;c<u.length;c++){var f=u[c],d=f._module;d&&(n="transforms["+c+"].",e=f,r.crawl(d.attributes,l))}return a},r.getTraceValObject=function(t,e){var r,a,o=e[0],s=1;if("transforms"===o){if(1===e.length)return i.transforms;var l=t.transforms;if(!Array.isArray(l)||!l.length)return!1;var u=e[1];if(!_(u)||u>=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<l.length;r++){if((i=l[r]).attrRegex&&i.attrRegex.test(e)){if(i.layoutAttrOverrides)return i.layoutAttrOverrides;!u&&i.layoutAttributes&&(u=i.layoutAttributes)}var c=i.baseLayoutAttrOverrides;if(c&&e in c)return c[e]}if(u)return u}var d=t._modules;if(d)for(r=0;r<d.length;r++)if((s=d[r].layoutAttributes)&&e in s)return s[e];for(a in n.componentsRegistry){if("colorscale"===(i=n.componentsRegistry[a]).name&&0===e.indexOf("coloraxis"))return i.layoutAttributes[e];if(!i.schema&&e===i.name)return i.layoutAttributes}if(e in o)return o[e];if("radialaxis"===e||"angularaxis"===e)return f[e];return f.layout[e]||!1}(t,e[0]),e,1)}},{"../lib":498,"../plots/animation_attributes":541,"../plots/attributes":543,"../plots/frame_attributes":576,"../plots/layout_attributes":583,"../plots/polar/legacy/area_attributes":586,"../plots/polar/legacy/axis_attributes":587,"../registry":593,"./edit_types":529,"./plot_config":534}],536:[function(t,e,r){"use strict";var n=t("../lib"),a=t("../plots/attributes"),i={name:{valType:"string",editType:"none"}};function o(t){return t&&"string"==typeof t}function s(t){var e=t.length-1;return"s"!==t.charAt(e)&&n.warn("bad argument to arrayDefaultKey: "+t),t.substr(0,t.length-1)+"defaults"}i.templateitemname={valType:"string",editType:"calc"},r.templatedArray=function(t,e){return e._isLinkedToArray=t,e.name=i.name,e.templateitemname=i.templateitemname,e},r.traceTemplater=function(t){var e,r,i={};for(e in t)r=t[e],Array.isArray(r)&&r.length&&(i[e]=0);return{newTrace:function(o){var s={type:e=n.coerce(o,{},a,"type"),_template:null};if(e in i){r=t[e];var l=i[e]%r.length;i[e]++,s._template=r[l]}return s}}},r.newContainer=function(t,e,r){var a=t._template,i=a&&(a[e]||r&&a[r]);return n.isPlainObject(i)||(i=null),t[e]={_template:i}},r.arrayTemplater=function(t,e,r){var n=t._template,a=n&&n[s(e)],i=n&&n[e];Array.isArray(i)&&i.length||(i=[]);var l={};return{newItem:function(t){var e={name:t.name,_input:t},n=e.templateitemname=t.templateitemname;if(!o(n))return e._template=a,e;for(var s=0;s<i.length;s++){var u=i[s];if(u.name===n)return l[n]=1,e._template=u,e}return e[r]=t[r]||!1,e._template=!1,e},defaultItems:function(){for(var t=[],e=0;e<i.length;e++){var r=i[e],n=r.name;if(o(n)&&!l[n]){var a={_template:r,name:n,_input:{_templateitemname:n}};a.templateitemname=r.templateitemname,t.push(a),l[n]=1}}return t}}},r.arrayDefaultKey=s,r.arrayEditor=function(t,e,r){var a=(n.nestedProperty(t,e).get()||[]).length,i=r._index,o=i>=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<r.length;n++){var a=r[n][0],i=r[n][1];if(!(a[0]>=t[1]||a[1]<=t[0])&&(i[0]<e[1]&&i[1]>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;e<M.length;e++)s=v._plots[M[e]],p=s.xaxis,g=s.yaxis,s.bg&&void 0!==p._offset&&void 0!==g._offset&&s.bg.call(u.setRect,p._offset-b,g._offset-b,p._length+2*b,g._length+2*b).call(l.fill,v.plot_bgcolor).style("stroke-width",0);if(!v._hasOnlyLargeSploms)for(a in v._plots){s=v._plots[a],p=s.xaxis,g=s.yaxis;var Y,Z,J=s.clipId="clip"+v._uid+a+"plot",Q=o.ensureSingleById(v._clips,"clipPath",J,(function(t){t.classed("plotclip",!0).append("rect")}));s.clipRect=Q.select("rect").attr({width:p._length,height:g._length}),u.setTranslate(s.plot,p._offset,g._offset),s._hasClipOnAxisFalse?(Y=null,Z=J):(Y=J,Z=null),u.setClipUrl(s.plot,Y,t),s.layerClipId=Z}function $(t){return"M"+I+","+t+"H"+P}function K(t){return"M"+p._offset+","+t+"h"+p._length}function tt(t){return"M"+t+","+U+"V"+j}function et(t){return"M"+t+","+g._offset+"v"+g._length}function rt(t,e,r){if(!t.showline||a!==t._mainSubplot)return"";if(!t._anchorAxis)return r(t._mainLinePosition);var n=e(t._mainLinePosition);return t.mirror&&(n+=e(t._mainMirrorPosition)),n}for(a in v._plots){s=v._plots[a],p=s.xaxis,g=s.yaxis;var nt="M0,0";x(p,a)&&(N=w(p,"left",g,_),I=p._offset-(N?b+N:0),B=w(p,"right",g,_),P=p._offset+p._length+(B?b+B:0),F=A(p,g,"bottom"),z=A(p,g,"top"),!(X=!p._anchorAxis||a!==p._mainSubplot)||"allticks"!==p.mirror&&"all"!==p.mirror||(p._linepositions[a]=[F,z]),nt=rt(p,$,K),X&&p.showline&&("all"===p.mirror||"allticks"===p.mirror)&&(nt+=$(F)+$(z)),s.xlines.style("stroke-width",p._lw+"px").call(l.stroke,p.showline?p.linecolor:"rgba(0,0,0,0)")),s.xlines.attr("d",nt);var at="M0,0";x(g,a)&&(G=w(g,"bottom",p,_),j=g._offset+g._length+(G?b:0),q=w(g,"top",p,_),U=g._offset-(q?b:0),V=A(g,p,"left"),H=A(g,p,"right"),!(X=!g._anchorAxis||a!==g._mainSubplot)||"allticks"!==g.mirror&&"all"!==g.mirror||(g._linepositions[a]=[V,H]),at=rt(g,tt,et),X&&g.showline&&("all"===g.mirror||"allticks"===g.mirror)&&(at+=tt(V)+tt(H)),s.ylines.style("stroke-width",g._lw+"px").call(l.stroke,g.showline?g.linecolor:"rgba(0,0,0,0)")),s.ylines.attr("d",at)}return d.makeClipPaths(t),i.previousPromises(t)}function x(t,e){return(t.ticks||t.showline)&&(e===t._mainSubplot||"all"===t.mirror||"allticks"===t.mirror)}function _(t,e,r){if(!r.showline||!r._lw)return!1;if("all"===r.mirror||"allticks"===r.mirror)return!0;var n=r._anchorAxis;if(!n)return!1;var a=h.FROM_BL[e];return r.side===e?n.domain[a]===t.domain[a]:r.mirror&&n.domain[1-a]===t.domain[1-a]}function w(t,e,r,n){if(_(t,e,r))return r._lw;for(var a=0;a<n.length;a++){var i=n[a];if(i._mainAxis===r._mainAxis&&_(t,e,i))return i._lw}return 0}function A(t,e){var r=t.title,n=t._size,a=0;switch("start"===e?a=r.pad.l:"end"===e&&(a=-r.pad.r),r.xref){case"paper":return n.l+n.w*r.x+a;case"container":default:return t.width*r.x+a}}function T(t,e){var r=t.title,n=t._size,a=0;if("0em"!==e&&e?e===h.CAP_SHIFT+"em"&&(a=r.pad.t):a=-r.pad.b,"auto"===r.y)return n.t/2;switch(r.yref){case"paper":return n.t+n.h-n.h*r.y+a;case"container":default:return t.height-t.height*r.y+a}}r.layoutStyles=function(t){return o.syncOrAsync([i.doAutoMargin,b],t)},r.drawMainTitle=function(t){var e=t._fullLayout,r=function(t){var e=t.title,r="middle";o.isRightAnchor(e)?r="end":o.isLeftAnchor(e)&&(r="start");return r}(e),n=function(t){var e=t.title,r="0em";o.isTopAnchor(e)?r=h.CAP_SHIFT+"em":o.isMiddleAnchor(e)&&(r=h.MID_SHIFT+"em");return r}(e);c.draw(t,"gtitle",{propContainer:e,propName:"title.text",placeholder:e._dfltTitle.plot,attributes:{x:A(e,r),y:T(e,n),"text-anchor":r,dy:n}})},r.doTraceStyle=function(t){var e,n=t.calcdata,o=[];for(e=0;e<n.length;e++){var l=n[e],u=l[0]||{},c=u.trace||{},f=c._module||{},d=f.arraysToCalcdata;d&&d(l,c);var h=f.editStyle;h&&o.push({fn:h,cd0:u})}if(o.length){for(e=0;e<o.length;e++){var p=o[e];p.fn(t,p.cd0)}s(t),r.redrawReglTraces(t)}return i.style(t),a.getComponentMethod("legend","draw")(t),i.previousPromises(t)},r.doColorBars=function(t){return a.getComponentMethod("colorbar","draw")(t),i.previousPromises(t)},r.layoutReplot=function(t){var e=t.layout;return t.layout=void 0,a.call("plot",t,"",e)},r.doLegend=function(t){return a.getComponentMethod("legend","draw")(t),i.previousPromises(t)},r.doTicksRelayout=function(t){return d.draw(t,"redraw"),t._fullLayout._hasOnlyLargeSploms&&(a.subplotsRegistry.splom.updateGrid(t),s(t),r.redrawReglTraces(t)),r.drawMainTitle(t),i.previousPromises(t)},r.doModeBar=function(t){var e=t._fullLayout;f.manage(t);for(var r=0;r<e._basePlotModules.length;r++){var n=e._basePlotModules[r].updateFx;n&&n(t)}return i.previousPromises(t)},r.doCamera=function(t){for(var e=t._fullLayout,r=e._subplots.gl3d,n=0;n<r.length;n++){var a=e[r[n]];a._scene.setViewport(a)}},r.drawData=function(t){var e=t._fullLayout;s(t);for(var n=e._basePlotModules,o=0;o<n.length;o++)n[o].plot(t);return r.redrawReglTraces(t),i.style(t),a.getComponentMethod("shapes","draw")(t),a.getComponentMethod("annotations","draw")(t),a.getComponentMethod("images","draw")(t),e._replotting=!1,i.previousPromises(t)},r.redrawReglTraces=function(t){var e=t._fullLayout;if(e._has("regl")){var r,n,a=t._fullData,i=[],s=[];for(e._hasOnlyLargeSploms&&e._splomGrid.draw(),r=0;r<a.length;r++){var l=a[r];!0===l.visible&&0!==l._length&&("splom"===l.type?e._splomScenes[l.uid].draw():"scattergl"===l.type?o.pushUnique(i,l.xaxis+l.yaxis):"scatterpolargl"===l.type&&o.pushUnique(s,l.subplot))}for(r=0;r<i.length;r++)(n=e._plots[i[r]])._scene&&n._scene.draw();for(r=0;r<s.length;r++)(n=e[s[r]]._subplot)._scene&&n._scene.draw()}},r.doAutoRangeAndConstraints=function(t){for(var e,r=d.list(t,"",!0),n={},a=0;a<r.length;a++)if(!n[(e=r[a])._id]){n[e._id]=1,v(t,e),m(t,e);var i=e._matchGroup;if(i)for(var o in i){var s=d.getFromId(t,o);m(t,s,e.range),n[o]=1}}g(t)},r.finalDraw=function(t){a.getComponentMethod("rangeslider","draw")(t),a.getComponentMethod("rangeselector","draw")(t)},r.drawMarginPushers=function(t){a.getComponentMethod("legend","draw")(t),a.getComponentMethod("rangeselector","draw")(t),a.getComponentMethod("sliders","draw")(t),a.getComponentMethod("updatemenus","draw")(t),a.getComponentMethod("colorbar","draw")(t)}},{"../components/color":368,"../components/drawing":390,"../components/modebar":428,"../components/titles":463,"../constants/alignment":470,"../lib":498,"../lib/clear_gl_canvases":484,"../plots/cartesian/autorange":546,"../plots/cartesian/axes":547,"../plots/cartesian/constraints":554,"../plots/plots":585,"../registry":593,d3:86}],538:[function(t,e,r){"use strict";var n=t("../lib"),a=n.isPlainObject,i=t("./plot_schema"),o=t("../plots/plots"),s=t("../plots/attributes"),l=t("./plot_template"),u=t("./plot_config").dfltConfig;function c(t,e){t=n.extendDeep({},t);var r,i,o=Object.keys(t).sort();function s(e,r,n){if(a(r)&&a(e))c(e,r);else if(Array.isArray(r)&&Array.isArray(e)){var o=l.arrayTemplater({_template:t},n);for(i=0;i<r.length;i++){var s=r[i],u=o.newItem(s)._template;u&&c(u,s)}var f=o.defaultItems();for(i=0;i<f.length;i++)r.push(f[i]._template);for(i=0;i<r.length;i++)delete r[i].templateitemname}}for(r=0;r<o.length;r++){var u=o[r],d=t[u];if(u in e?s(d,e[u],u):e[u]=d,f(u)===u)for(var h in e){var p=f(h);h===p||p!==u||h in t||s(d,e[h],u)}}}function f(t){return t.replace(/[0-9]+$/,"")}function d(t,e,r,i,o){var s=o&&r(o);for(var u in t){var c=t[u],h=g(t,u,i),p=g(t,u,o),v=r(p);if(!v){var m=f(u);m!==u&&(v=r(p=g(t,m,o)))}if((!s||s!==v)&&!(!v||v._noTemplating||"data_array"===v.valType||v.arrayOk&&Array.isArray(c)))if(!v.valType&&a(c))d(c,e,r,h,p);else if(v._isLinkedToArray&&Array.isArray(c))for(var y=!1,b=0,x={},_=0;_<c.length;_++){var w=c[_];if(a(w)){var A=w.name;if(A)x[A]||(d(w,e,r,g(c,b,h),g(c,b,p)),b++,x[A]=1);else if(!y){var T=g(t,l.arrayDefaultKey(u),i),k=g(c,b,h);d(w,e,r,k,g(c,b,p));var M=n.nestedProperty(e,k);n.nestedProperty(e,T).set(M.get()),M.set(null),y=!0}}}else{n.nestedProperty(e,h).set(c)}}}function h(t,e){return i.getLayoutValObject(t,n.nestedProperty({},e).parts)}function p(t,e){return i.getTraceValObject(t,n.nestedProperty({},e).parts)}function g(t,e,r){return r?Array.isArray(t)?r+"["+e+"]":r+"."+e:e}function v(t){for(var e=0;e<t.length;e++)if(a(t[e]))return!0}function m(t){var e;switch(t.code){case"data":e="The template has no key data.";break;case"layout":e="The template has no key layout.";break;case"missing":e=t.path?"There are no templates for item "+t.path+" with name "+t.templateitemname:"There are no templates for trace "+t.index+", of type "+t.traceType+".";break;case"unused":e=t.path?"The template item at "+t.path+" was not used in constructing the plot.":t.dataCount?"Some of the templates of type "+t.traceType+" were not used. The template has "+t.templateCount+" traces, the data only has "+t.dataCount+" of this type.":"The template has "+t.templateCount+" traces of type "+t.traceType+" but there are none in the data.";break;case"reused":e="Some of the templates of type "+t.traceType+" were used more than once. The template has "+t.templateCount+" traces, the data has "+t.dataCount+" of this type."}return t.msg=e,t}r.makeTemplate=function(t){t=n.isPlainObject(t)?t:n.getGraphDiv(t),t=n.extendDeep({_context:u},{data:t.data,layout:t.layout}),o.supplyDefaults(t);var e=t.data||[],r=t.layout||{};r._basePlotModules=t._fullLayout._basePlotModules,r._modules=t._fullLayout._modules;var i={data:{},layout:{}};e.forEach((function(t){var e={};d(t,e,p.bind(null,t));var r=n.coerce(t,{},s,"type"),a=i.data[r];a||(a=i.data[r]=[]),a.push(e)})),d(r,i.layout,h.bind(null,r)),delete i.layout.template;var l=r.template;if(a(l)){var f,g,v,m,y,b,x=l.layout;a(x)&&c(x,i.layout);var _=l.data;if(a(_)){for(g in i.data)if(v=_[g],Array.isArray(v)){for(b=(y=i.data[g]).length,m=v.length,f=0;f<b;f++)c(v[f%m],y[f]);for(f=b;f<m;f++)y.push(n.extendDeep({},v[f]))}for(g in _)g in i.data||(i.data[g]=n.extendDeep([],_[g]))}}return i},r.validateTemplate=function(t,e){var r=n.extendDeep({},{_context:u,data:t.data,layout:t.layout}),i=r.layout||{};a(e)||(e=i.template||{});var s=e.layout,l=e.data,c=[];r.layout=i,r.layout.template=e,o.supplyDefaults(r);var d=r._fullLayout,h=r._fullData,p={};if(a(s)?(!function t(e,r){for(var n in e)if("_"!==n.charAt(0)&&a(e[n])){var i,o=f(n),s=[];for(i=0;i<r.length;i++)s.push(g(e,n,r[i])),o!==n&&s.push(g(e,o,r[i]));for(i=0;i<s.length;i++)p[s[i]]=1;t(e[n],s)}}(d,["layout"]),function t(e,r){for(var n in e)if(-1===n.indexOf("defaults")&&a(e[n])){var i=g(e,n,r);p[i]?t(e[n],i):c.push({code:"unused",path:i})}}(s,"layout")):c.push({code:"layout"}),a(l)){for(var y,b={},x=0;x<h.length;x++){var _=h[x];b[y=_.type]=(b[y]||0)+1,_._fullInput._template||c.push({code:"missing",index:_._fullInput.index,traceType:y})}for(y in l){var w=l[y].length,A=b[y]||0;w>A?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;d<f.length;d++){var h=f[d];if("transforms"!==h){var m=o.slice();m.push(h);var y=t[h],b=e[h],x=v(r,h),_=(x||{}).valType,w="info_array"===_,A="colorscale"===_,T=(x||{}).items;if(g(r,h))if(s(y)&&s(b)&&"any"!==_)c(y,b,x,a,i,m);else if(w&&l(y)){y.length>b.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;M<L;M++)if(l(y[M])){y[M].length>b[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;M<L;M++)E=O?T[M]:T,S=y[M],C=b[M],n.validate(S,E)?C!==S&&C!==+S&&a.push(p("dynamic",i,m.concat(M),S,C)):a.push(p("value",i,m.concat(M),S))}else if(x.items&&!w&&l(y)){var R,I,P=T[Object.keys(T)[0]],F=[];for(R=0;R<b.length;R++){var z=b[R]._index||R;if((I=m.slice()).push(z),s(y[z])&&s(b[R])){F.push(z);var N=y[z],B=b[R];s(N)&&!1!==N.visible&&!1===B.visible?a.push(p("invisible",i,I)):c(N,B,P,a,i,I)}}for(R=0;R<y.length;R++)(I=m.slice()).push(R),s(y[R])?-1===F.indexOf(R)&&a.push(p("unused",i,I)):a.push(p("object",i,I,y[R]))}else!s(y)&&s(b)?a.push(p("object",i,m,y)):u(y)||!u(b)||w||A?h in e?n.validate(y,x)?"enumerated"===x.valType&&(x.coerceNumber&&y!==+b||y!==b)&&a.push(p("dynamic",i,m,y,b)):a.push(p("value",i,m,y)):a.push(p("unused",i,m,y)):a.push(p("array",i,m,y));else a.push(p("schema",i,m))}}return a}function f(t,e){for(var r=t.layout.layoutAttributes,a=0;a<e.length;a++){var i=e[a],o=t.traces[i.type],s=o.layoutAttributes;s&&(i.subplot?n.extendFlat(r[o.attributes.subplot.dflt],s):n.extendFlat(r,s))}return r}e.exports=function(t,e){void 0===t&&(t=[]),void 0===e&&(e={});var r,u,d=i.get(),h=[],g={_context:n.extendFlat({},o)};l(t)?(g.data=n.extendDeep([],t),r=t):(g.data=[],r=[],h.push(p("array","data"))),s(e)?(g.layout=n.extendDeep({},e),u=e):(g.layout={},u={},arguments.length>1&&h.push(p("object","layout"))),a.supplyDefaults(g);for(var v=g._fullData,m=r.length,y=0;y<m;y++){var b=r[y],x=["data",y];if(s(b)){var _=v[y],w=_.type,A=d.traces[w].attributes;A.type={valType:"enumerated",values:[w]},!1===_.visible&&!1!==b.visible&&h.push(p("invisible",x)),c(b,_,A,h,x);var T=b.transforms,k=_.transforms;if(T){l(T)||h.push(p("array",x,["transforms"])),x.push("transforms");for(var M=0;M<T.length;M++){var E=["transforms",M],S=T[M].type;if(s(T[M])){var C=d.transforms[S]?d.transforms[S].attributes:{};C.type={valType:"enumerated",values:Object.keys(d.transforms)},c(T[M],k[M],C,h,x,E)}else h.push(p("object",x,E))}}}else h.push(p("object",x))}var L=g._fullLayout,O=f(d,v);return c(u,L,O,h,"layout"),0===h.length?void 0:h};var d={object:function(t,e){return("layout"===t&&""===e?"The layout argument":"data"===t[0]&&""===e?"Trace "+t[1]+" in the data argument":h(t)+"key "+e)+" must be linked to an object container"},array:function(t,e){return("data"===t?"The data argument":h(t)+"key "+e)+" must be linked to an array container"},schema:function(t,e){return h(t)+"key "+e+" is not part of the schema"},unused:function(t,e,r){var n=s(r)?"container":"key";return h(t)+n+" "+e+" did not get coerced"},dynamic:function(t,e,r,n){return[h(t)+"key",e,"(set to '"+r+"')","got reset to","'"+n+"'","during defaults."].join(" ")},invisible:function(t,e){return(e?h(t)+"item "+e:"Trace "+t[1])+" got defaulted to be not visible"},value:function(t,e,r){return[h(t)+"key "+e,"is set to an invalid value ("+r+")"].join(" ")}};function h(t){return l(t)?"In data trace "+t[1]+", ":"In "+t+", "}function p(t,e,r,a,i){var o,s;r=r||"",l(e)?(o=e[0],s=e[1]):(o=e,s=null);var u=function(t){if(!l(t))return String(t);for(var e="",r=0;r<t.length;r++){var n=t[r];"number"==typeof n?e=e.substr(0,e.length-1)+"["+n+"]":e+=n,r<t.length-1&&(e+=".")}return e}(r),c=d[t](e,u,a,i);return n.log(c),{code:t,container:o,trace:s,path:r,astr:u,msg:c}}function g(t,e){var r=y(e),n=r.keyMinusId,a=r.id;return!!(n in t&&t[n]._isSubplotObj&&a)||e in t}function v(t,e){return e in t?t[e]:t[y(e).keyMinusId]}var m=n.counterRegex("([a-z]+)");function y(t){var e=t.match(m);return{keyMinusId:e&&e[1],id:e&&e[2]}}},{"../lib":498,"../plots/plots":585,"./plot_config":534,"./plot_schema":535}],541:[function(t,e,r){"use strict";e.exports={mode:{valType:"enumerated",dflt:"afterall",values:["immediate","next","afterall"]},direction:{valType:"enumerated",values:["forward","reverse"],dflt:"forward"},fromcurrent:{valType:"boolean",dflt:!1},frame:{duration:{valType:"number",min:0,dflt:500},redraw:{valType:"boolean",dflt:!0}},transition:{duration:{valType:"number",min:0,dflt:500,editType:"none"},easing:{valType:"enumerated",dflt:"cubic-in-out",values:["linear","quad","cubic","sin","exp","circle","elastic","back","bounce","linear-in","quad-in","cubic-in","sin-in","exp-in","circle-in","elastic-in","back-in","bounce-in","linear-out","quad-out","cubic-out","sin-out","exp-out","circle-out","elastic-out","back-out","bounce-out","linear-in-out","quad-in-out","cubic-in-out","sin-in-out","exp-in-out","circle-in-out","elastic-in-out","back-in-out","bounce-in-out"],editType:"none"},ordering:{valType:"enumerated",values:["layout first","traces first"],dflt:"layout first",editType:"none"}}}},{}],542:[function(t,e,r){"use strict";var n=t("../lib"),a=t("../plot_api/plot_template");e.exports=function(t,e,r){var i,o,s=r.name,l=r.inclusionAttr||"visible",u=e[s],c=n.isArrayOrTypedArray(t[s])?t[s]:[],f=e[s]=[],d=a.arrayTemplater(e,s,l);for(i=0;i<c.length;i++){var h=c[i];n.isPlainObject(h)?o=d.newItem(h):(o=d.newItem({}))[l]=!1,o._index=i,!1!==o[l]&&r.handleItemDefaults(h,o,e,r),f.push(o)}var p=d.defaultItems();for(i=0;i<p.length;i++)(o=p[i])._index=f.length,r.handleItemDefaults({},o,e,r,{}),f.push(o);if(n.isArrayOrTypedArray(u)){var g=Math.min(u.length,f.length);for(i=0;i<g;i++)n.relinkPrivateKeys(f[i],u[i])}return f}},{"../lib":498,"../plot_api/plot_template":536}],543:[function(t,e,r){"use strict";var n=t("../components/fx/attributes");e.exports={type:{valType:"enumerated",values:[],dflt:"scatter",editType:"calc+clearAxisTypes",_noTemplating:!0},visible:{valType:"enumerated",values:[!0,!1,"legendonly"],dflt:!0,editType:"calc"},showlegend:{valType:"boolean",dflt:!0,editType:"style"},legendgroup:{valType:"string",dflt:"",editType:"style"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"style"},name:{valType:"string",editType:"style"},uid:{valType:"string",editType:"plot",anim:!0},ids:{valType:"data_array",editType:"calc",anim:!0},customdata:{valType:"data_array",editType:"calc"},meta:{valType:"any",arrayOk:!0,editType:"plot"},selectedpoints:{valType:"any",editType:"calc"},hoverinfo:{valType:"flaglist",flags:["x","y","z","text","name"],extras:["all","none","skip"],arrayOk:!0,dflt:"all",editType:"none"},hoverlabel:n.hoverlabel,stream:{token:{valType:"string",noBlank:!0,strict:!0,editType:"calc"},maxpoints:{valType:"number",min:0,max:1e4,dflt:500,editType:"calc"},editType:"calc"},transforms:{_isLinkedToArray:"transform",editType:"calc"},uirevision:{valType:"any",editType:"none"}}},{"../components/fx/attributes":399}],544:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib"),i=a.dateTime2ms,o=a.incrementMonth,s=t("../../constants/numerical").ONEAVGMONTH;e.exports=function(t,e,r,a){if("date"!==e.type)return a;var l=t[r+"periodalignment"];if(!l)return a;var u,c=t[r+"period"];if(n(c)){if((c=+c)<=0)return a}else if("string"==typeof c&&"M"===c.charAt(0)){var f=+c.substring(1);if(!(f>0&&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;b<y;b++){var x,_,w,A=a[b];if(u){for(x=Math.round((A-v)/(u*s)),w=o(v,u*x,d);w>A;)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;r<c.length&&g===v;r++)g=Math.min(g,c[r].val);for(r=1;r<p.length&&g===v;r++)v=Math.max(v,p[r].val);var m=!1;if(e.range){var y=a.simpleMap(e.range,e.r2l);m=y[1]<y[0]}"reversed"===e.autorange&&(m=!0,e.autorange=!0);var b,x,_,w,A,T,k=e.rangemode,M="tozero"===k,E="nonnegative"===k,S=e._length,C=S/10,L=0;for(r=0;r<c.length;r++)for(b=c[r],n=0;n<p.length;n++)(T=(x=p[n]).val-b.val-f(e,b.val,x.val))>0&&((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;i<a.length;i++){var o=a[i];n+=o.max-o.min}return n}function d(t,e,r){var n=.05*e._length,i=e._anchorAxis||{};if(-1!==(e.ticklabelposition||"").indexOf("inside")||-1!==(i.ticklabelposition||"").indexOf("inside")){var o="reversed"===e.autorange;if(!o){var s=a.simpleMap(e.range,e.r2l);o=s[1]<s[0]}o&&(r=!r)}var l=0;return u(t,e._id)||(l=function(t,e){var r=0,n=t._anchorAxis||{};if(-1!==(n.ticklabelposition||"").indexOf("inside")&&(!e&&("left"===n.side||"bottom"===n.side)||e&&("top"===n.side||"right"===n.side))){var i="x"===t._id.charAt(0);if(n._vals){var o=a.deg2rad(n._tickAngles[n._id+"tick"]||0),s=Math.abs(Math.cos(o)),l=Math.abs(Math.sin(o));n._vals.forEach((function(t){if(t.bb){var e=6+t.bb.width,n=6+t.bb.height;r=Math.max(r,i?Math.max(e*s,n*l):Math.max(n*s,e*l))}}))}"inside"===n.ticks&&"inside"===n.ticklabelposition&&(r+=n.ticklen||0)}return r}(e,r)),n=Math.max(l,n),"domain"===e.constrain&&e._inputDomain&&(n*=(e._inputDomain[1]-e._inputDomain[0])/(e.domain[1]-e.domain[0])),function(t){return t.nopad?0:t.pad+(t.extrapad?n:l)}}e.exports={getAutoRange:c,makePadFn:d,doAutoRange:function(t,e,r){if(e.setScale(),e.autorange){e.range=r?r.slice():c(t,e),e._r=e.range.slice(),e._rl=a.simpleMap(e._r,e.r2l);var n=e._input,i={};i[e._attr+".range"]=e.range,i[e._attr+".autorange"]=e.autorange,o.call("_storeDirectGUIEdit",t.layout,t._fullLayout._preGUI,i),n.range=e.range.slice(),n.autorange=e.autorange}var s=e._anchorAxis;if(s&&s.rangeslider){var l=s.rangeslider[e._name];l&&"auto"===l.rangemode&&(l.range=c(t,e)),s._input.rangeslider[e._name]=a.extendFlat({},l)}},findExtremes:function(t,e,r){r||(r={});t._m||t.setScale();var a,o,s,l,u,c,f,d,h,v=[],y=[],b=e.length,x=r.padded||!1,_=r.tozero&&("linear"===t.type||"-"===t.type),w="log"===t.type,A=!1,T=r.vpadLinearized||!1;function k(t){if(Array.isArray(t))return A=!0,function(e){return Math.max(Number(t[e]||0),0)};var e=Math.max(Number(t||0),0);return function(){return e}}var M=k((t._m>0?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;a<b;a++)(o=e[a])<d&&o>0&&(d=o),o>h&&o<i&&(h=o);else for(a=0;a<b;a++)(o=e[a])<d&&o>-i&&(d=o),o>h&&o<i&&(h=o);e=[d,h],b=2}var L={tozero:_,extrapad:x};function O(r){s=e[r],n(s)&&(c=M(r),f=E(r),T?(l=t.c2l(s)-C(r),u=t.c2l(s)+S(r)):(d=s-C(r),h=s+S(r),w&&d<h/10&&(d=h/10),l=t.c2l(d),u=t.c2l(h)),_&&(l=Math.min(0,l),u=Math.max(0,u)),m(l)&&p(v,l,f,L),m(u)&&g(y,u,c,L))}var D=Math.min(6,b);for(a=0;a<D;a++)O(a);for(a=b-1;a>=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<e.length;n++){var r=t[e[n]],s=(r._extremes||{})[o];if(!0===r.visible&&s){for(a=0;a<s.min.length;a++)i=s.min[a],p(c,i.val,i.pad,{extrapad:i.extrapad});for(a=0;a<s.max.length;a++)i=s.max[a],g(f,i.val,i.pad,{extrapad:i.extrapad})}}}if(d(s,e._traceIndices),d(u.annotations||[],e._annIndices||[]),d(u.shapes||[],e._shapeIndices||[]),e._matchGroup&&!r)for(var v in e._matchGroup)if(v!==e._id){var m=l(t,v),y=h(t,m,!0),b=e._length/m._length;for(a=0;a<y.min.length;a++)i=y.min[a],p(c,i.val,i.pad*b,{extrapad:i.extrapad});for(a=0;a<y.max.length;a++)i=y.max[a],g(f,i.val,i.pad*b,{extrapad:i.extrapad})}return{min:c,max:f}}function p(t,e,r,n){v(t,e,r,n,y)}function g(t,e,r,n){v(t,e,r,n,b)}function v(t,e,r,n,a){for(var i=n.tozero,o=n.extrapad,s=!0,l=0;l<t.length&&s;l++){var u=t[l];if(a(u.val,e)&&u.pad>=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)<i}function y(t,e){return t<=e}function b(t,e){return 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;c<e.length;c++)for(var f=r[N.id2name(e[c])][i],d=0;d<f.length;d++){var h=f[d];if(!u[h]&&(l(t,h),u[h]=1,s))return}}n("annotations","drawOne","_annIndices"),n("shapes","drawOne","_shapeIndices"),n("images","draw","_imgIndices",!0)};var q=N.getDataConversions=function(t,e,r,n){var a,i="x"===r||"y"===r||"z"===r?r:n;if(Array.isArray(i)){if(a={type:B(n,void 0,{autotypenumbers:t._fullLayout.autotypenumbers}),_categories:[]},N.setConvert(a),"category"===a.type)for(var o=0;o<n.length;o++)a.d2c(n[o])}else a=N.getFromTrace(t,e,i);return a?{d2c:a.d2c,c2d:a.c2d}:"ids"===i?{d2c:W,c2d:W}:{d2c:X,c2d:X}};function X(t){return+t}function W(t){return String(t)}function Y(t){return+t.substring(1)}N.getDataToCoordFunc=function(t,e,r,n){return q(t,e,r,n).d2c},N.counterLetter=function(t){var e=t.charAt(0);return"x"===e?"y":"y"===e?"x":void 0},N.minDtick=function(t,e,r,n){-1===["log","category","multicategory"].indexOf(t.type)&&n?void 0===t._minDtick?(t._minDtick=e,t._forceTick0=r):t._minDtick&&((t._minDtick/e+1e-6)%1<2e-6&&((r-t._forceTick0)/e%1+1.000001)%1<2e-6?(t._minDtick=e,t._forceTick0=r):((e/t._minDtick+1e-6)%1>2e-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<r.length;a++){var i=r[a],o=void 0===i._rangeInitial,s=o||!(i.range[0]===i._rangeInitial[0]&&i.range[1]===i._rangeInitial[1]);(o&&!1===i.autorange||e&&s)&&(i._rangeInitial=i.range.slice(),n=!0)}return n},N.saveShowSpikeInitial=function(t,e){for(var r=N.list(t,"",!0),n=!1,a="on",i=0;i<r.length;i++){var o=r[i],s=void 0===o._showSpikeInitial,l=s||!(o.showspikes===o._showspikes);(s||e&&l)&&(o._showSpikeInitial=o.showspikes,n=!0),"on"!==a||o.showspikes||(a="off")}return t._fullLayout._cartesianSpikesEnabled=a,n},N.autoBin=function(t,e,r,n,i,o){var l,u=s.aggNums(Math.min,null,t),c=s.aggNums(Math.max,null,t);if("category"===e.type||"multicategory"===e.type)return{start:u-.5,end:c+.5,size:Math.max(1,Math.round(o)||1),_dataSpan:c-u};if(i||(i=e.calendar),l="log"===e.type?{type:"linear",range:[u,c]}:{type:e.type,range:s.simpleMap([u,c],e.c2r,0,i),calendar:i},N.setConvert(l),o=o&&p.dtick(o,l.type))l.dtick=o,l.tick0=p.tick0(void 0,l.type,i);else{var f;if(r)f=(c-u)/r;else{var d=s.distinctVals(t),h=Math.pow(10,Math.floor(Math.log(d.minDiff)/Math.LN10)),g=h*s.roundUp(d.minDiff/h,[.9,1.9,4.9,9.9],!0);f=Math.max(g,2*s.stdev(t)/Math.pow(t.length,n?.25:.4)),a(f)||(f=1)}N.autoTicks(l,f)}var v,m=l.dtick,y=N.tickIncrement(N.tickFirst(l),m,"reverse",i);if("number"==typeof m)v=(y=function(t,e,r,n,i){var o=0,s=0,l=0,u=0;function c(e){return(1+100*(e-t)/r.dtick)%100<2}for(var f=0;f<e.length;f++)e[f]%1==0?l++:a(e[f])||u++,c(e[f])&&o++,c(e[f]+r.dtick/2)&&s++;var d=e.length-u;if(l===d&&"date"!==r.type)r.dtick<1?t=n-.5*r.dtick:(t-=.5)+r.dtick<n&&(t+=r.dtick);else if(s<.1*d&&(o>.3*d||c(n)||c(i))){var h=r.dtick/2;t+=t+h<n?h:-h}return t}(y,t,l,u,c))+(1+Math.floor((c-y)/m))*m;else for("M"===l.dtick.charAt(0)&&(y=function(t,e,r,n,a){var i=s.findExactDates(e,a);if(i.exactDays>.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.dtick<S&&(t.dtick=S)):/%p/.test(i)?(e=E,o&&!n&&t.dtick<E&&(t.dtick=E)):/%[Aadejuwx]/.test(i)?(e=M,o&&!n&&t.dtick<M&&(t.dtick=M)):/%[UVW]/.test(i)?(e=k,o&&!n&&t.dtick<k&&(t.dtick=k)):/%[Bbm]/.test(i)?(e=A,o&&(n?Y(t.dtick)<1:t.dtick<T)&&(t.dtick="M1")):/%[q]/.test(i)?(e=x,o&&(n?Y(t.dtick)<3:t.dtick<_)&&(t.dtick="M3")):/%[Yy]/.test(i)&&(e=m,o&&(n?Y(t.dtick)<12:t.dtick<y)&&(t.dtick="M12")))}(n=r())&&t.tick0===t._dowTick0&&(t.tick0=t._rawTick0);t._definedDelta=e}(t),t.tick0||(t.tick0="date"===t.type?"2000-01-01":0),"date"===t.type&&t.dtick<.1&&(t.dtick=.1),nt(t)},N.calcTicks=function(t,e){N.prepTicks(t,e);var r=s.simpleMap(t.range,t.r2l,void 0,void 0,e);if("array"===t.tickmode)return function(t){var e=t.tickvals,r=t.ticktext,n=new Array(e.length),a=G(s.simpleMap(t.range,t.r2l)),i=Math.min(a[0],a[1]),o=Math.max(a[0],a[1]),l=0;Array.isArray(r)||(r=[]);var u="category"===t.type?t.d2l_noadd:t.d2l;"log"===t.type&&"L"!==String(t.dtick).charAt(0)&&(t.dtick="L"+Math.pow(10,Math.floor(Math.min(t.range[0],t.range[1]))-1));for(var c=0;c<e.length;c++){var f=u(e[c]);f>i&&f<o&&(void 0===r[c]?n[l]=N.tickText(t,f):n[l]=at(t,f,String(r[c])),l++)}l<e.length&&n.splice(l,e.length-l);t.rangebreaks&&(n=n.filter((function(e){return t.maskBreaks(e.x)!==D})));return n}(t);var n=G(r),i=n[0],o=n[1],l=r[1]<r[0],u=Math.min(r[0],r[1]),c=Math.max(r[0],r[1]),f="log"===t.type&&!(a(t.dtick)||"L"===t.dtick.charAt(0)),d="period"===t.ticklabelmode;if(t._tmin=N.tickFirst(t,e),t._tmin<i!==l)return[];"category"!==t.type&&"multicategory"!==t.type||(o=l?Math.max(-.5,o):Math.min(t._categories.length-.5,o));var h=t._tmin;t.rangebreaks&&t._tick0Init!==t.tick0&&(h=wt(h,t),l||(h=N.tickIncrement(h,t.dtick,!l,t.calendar))),d&&(h=N.tickIncrement(h,t.dtick,!l,t.calendar));for(var p,g=Math.max(1e3,t._length||0),C=[],L=null;l?h>=o:h<=o;h=N.tickIncrement(h,t.dtick,l,t.calendar)){if(t.rangebreaks&&!l){if(h<i)continue;if(t.maskBreaks(h)===D&&wt(h,t)>=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;n<t.length;n++){var a=t[n].value,i=n,o=n+1;n<t.length-1?(i=n,o=n+1):n>0?(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:P<F+I)?C.splice(l?p+1:p,1):P=F}}_t(t)&&360===Math.abs(r[1]-r[0])&&C.pop(),t._tmax=(C[C.length-1]||{}).value,t._prevDateHead="",t._inCalcTicks=!0;var z,B,j=[];for(p=0;p<C.length;p++){var U=C[p].minor,V=C[p].value;z=N.tickText(t,V,!1,U),void 0!==(B=C[p].periodX)&&(z.periodX=B,(B>c||B<u)&&(B>c&&(z.periodX=c),B<u&&(z.periodX=u),z.text=" ",t._prevDateHead="")),j.push(z)}return t._inCalcTicks=!1,j};var Z=[2,5,10],J=[1,2,3,6,12],Q=[1,2,5,10,15,30],$=[1,2,3,7,14],K=[-.046,0,.301,.477,.602,.699,.778,.845,.903,.954,1],tt=[-.301,0,.301,.699,1],et=[15,30,45,90,180];function rt(t,e,r){return e*s.roundUp(t/e,r)}function nt(t){var e=t.dtick;if(t._tickexponent=0,a(e)||"string"==typeof e||(e=1),"category"!==t.type&&"multicategory"!==t.type||(t._tickround=null),"date"===t.type){var r=t.r2l(t.tick0),n=t.l2r(r).replace(/(^-|i)/g,""),i=n.length;if("M"===String(e).charAt(0))i>10||"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]<i[0],l=o?Math.floor:Math.ceil,u=G(i)[0],c=t.dtick,f=r(t.tick0);if(a(c)){var d=l((u-f)/c)*c+f;return"category"!==t.type&&"multicategory"!==t.type||(d=s.constrain(d,0,t._categories.length-1)),d}var h=c.charAt(0),p=Number(c.substr(1));if("M"===h){for(var g,v,m,y=0,b=f;y<10;){if(((g=N.tickIncrement(b,c,o,t.calendar))-u)*(b-u)<=0)return o?Math.min(b,g):Math.max(b,g);v=(u-(b+g)/2)/(g-b),m=h+(Math.abs(Math.round(v))||1)*p,b=N.tickIncrement(b,m,v<0?!o:o,t.calendar),y++}return s.error("tickFirst did not converge",t),b}if("L"===h)return Math.log(l((Math.pow(10,u)-f)/p)*p+f)/Math.LN10;if("D"===h){var x="D2"===c?tt:K,_=s.roundUp(s.mod(u,1),x,o);return Math.floor(u)+Math.log(n.round(Math.pow(10,_),1))/Math.LN10}throw"unrecognized dtick "+String(c)},N.tickText=function(t,e,r,n){var i,o=at(t,e),l="array"===t.tickmode,u=r||l,c=t.type,f="category"===c?t.d2l_noadd:t.d2l;if(l&&Array.isArray(t.ticktext)){var d=s.simpleMap(t.range,t.r2l),h=(Math.abs(d[1]-d[0])-(t._lBreaks||0))/1e4;for(i=0;i<t.ticktext.length&&!(Math.abs(e-f(t.tickvals[i]))<h);i++);if(i<t.ticktext.length)return o.text=String(t.ticktext[i]),o}function p(n){if(void 0===n)return!0;if(r)return"none"===n;var a={first:t._tmin,last:t._tmax}[n];return"all"!==n&&e!==a}var g=r?"never":"none"!==t.exponentformat&&p(t.showexponent)?"hide":"";if("date"===c?function(t,e,r,n){var i=t._tickround,o=r&&t.hoverformat||N.getTickFormat(t);n&&(i=a(i)?4:{y:"m",m:"d",d:"M",M:"S",S:4}[i]);var l,u=s.formatDate(e.x,o,i,t._dateFormat,t.calendar,t._extraFormat),c=u.indexOf("\n");-1!==c&&(l=u.substr(c+1),u=u.substr(0,c));n&&("00:00:00"===u||"00:00"===u?(u=l,l=""):8===u.length&&(u=u.replace(/:00$/,"")));if(l)if(r)"d"===i?u+=", "+l:u=l+(u?", "+u:"");else if(t._inCalcTicks&&t._prevDateHead===l){var f=-1!==(t.ticklabelposition||"").indexOf("inside"),d=t._realSide||t.side;(!f&&"top"===d||f&&"bottom"===d)&&(u+="<br> ")}else t._prevDateHead=l,u+="<br>"+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<sup>"+(f>1?"":O)+d+"</sup>",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=["<sup>",o[0],"</sup>","\u2044","<sub>",o[1],"</sub>","\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))<p)t="0",i=!1;else{if(t+=p,u&&(t*=Math.pow(10,-u),o+=u),0===o)t=String(Math.floor(t));else if(o<0){t=(t=String(Math.round(t))).substr(0,t.length+o);for(var g=o;g<0;g++)t+="0"}else{var v=(t=String(t)).indexOf(".")+1;v&&(t=t.substr(0,v+o).replace(/\.?0+$/,""))}t=s.numSeparate(t,e._separators,f)}u&&"hide"!==l&&(ot(l)&&st(u)&&(l="power"),h=u<0?O+-u:"power"!==l?"+"+u:String(u),"e"===l||"E"===l?t+=l+h:"power"===l?t+="\xd710<sup>"+h+"</sup>":"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;a<e.length;a++){var i=e[a];n[i.text2]?n[i.text2].push(i.x):n[i.text2]=[i.x]}for(var o in n)r.push(at(t,s.interp(n[o],.5),o));return r}function ct(t){return void 0!==t.periodX?t.periodX:t.x}function ft(t){return[t.text,t.x,t.axInfo,t.font,t.fontSize,t.fontColor].join("_")}function dt(t){var e=t.title.font.size,r=(t.title.text.match(u.BR_TAG_ALL)||[]).length;return t.title.hasOwnProperty("standoff")?r?e*(P+r*F):e*P:r?e*(r+1)*F:e}function ht(t,e){var r=t.l2p(e);return r>1&&r<t._length-1}function pt(t){var e=n.select(t),r=e.select(".text-math-group");return r.empty()?e.select("text"):r}function gt(t){return t._id+".automargin"}function vt(t){return gt(t)+".mirror"}function mt(t){return t._id+".rangeslider"}function yt(t,e){for(var r=0;r<e.length;r++)-1===t.indexOf(e[r])&&t.push(e[r])}function bt(t,e,r){var n,a,i=[],o=[],l=t.layout;for(n=0;n<e.length;n++)i.push(N.getFromId(t,e[n]));for(n=0;n<r.length;n++)o.push(N.getFromId(t,r[n]));var u=Object.keys(h),c=["anchor","domain","overlaying","position","side","tickangle","editType"],f=["linear","log"];for(n=0;n<u.length;n++){var d=u[n],p=i[0][d],g=o[0][d],v=!0,m=!1,y=!1;if("_"!==d.charAt(0)&&"function"!=typeof p&&-1===c.indexOf(d)){for(a=1;a<i.length&&v;a++){var b=i[a][d];"type"===d&&-1!==f.indexOf(p)&&-1!==f.indexOf(b)&&p!==b?m=!0:b!==p&&(v=!1)}for(a=1;a<o.length&&v;a++){var x=o[a][d];"type"===d&&-1!==f.indexOf(g)&&-1!==f.indexOf(x)&&g!==x?y=!0:o[a][d]!==g&&(v=!1)}v&&(m&&(l[i[0]._name].type="linear"),y&&(l[o[0]._name].type="linear"),xt(l,d,i,o,t._fullLayout._dfltTitle))}}for(n=0;n<t._fullLayout.annotations.length;n++){var _=t._fullLayout.annotations[n];-1!==e.indexOf(_.xref)&&-1!==r.indexOf(_.yref)&&s.swapAttrs(l.annotations[n],["?"])}}function xt(t,e,r,n,a){var i,o=s.nestedProperty,l=o(t[r[0]._name],e).get(),u=o(t[n[0]._name],e).get();for("title"===e&&(l&&l.text===a.x&&(l.text=a.y),u&&u.text===a.y&&(u.text=a.x)),i=0;i<r.length;i++)o(t,r[i]._name+"."+e).set(u);for(i=0;i<n.length;i++)o(t,n[i]._name+"."+e).set(l)}function _t(t){return"angularaxis"===t._id}function wt(t,e){for(var r=e._rangebreaks.length,n=0;n<r;n++){var a=e._rangebreaks[n];if(t>=a.min&&t<a.max)return a.max}return t}N.getTickFormat=function(t){var e,r,n,a,i,o,s,l;function u(t){return"string"!=typeof t?t:Number(t.replace("M",""))*A}function c(t,e){var r=["L","D"];if(typeof t==typeof e){if("number"==typeof t)return t-e;var n=r.indexOf(t.charAt(0)),a=r.indexOf(e.charAt(0));return n===a?Number(t.replace(/(L|D)/g,""))-Number(e.replace(/(L|D)/g,"")):n-a}return"number"==typeof t?1:-1}function f(t,e){var r=null===e[0],n=null===e[1],a=c(t,e[0])>=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<t.tickformatstops.length;e++)if((n=t.tickformatstops[e]).enabled&&(a=t.dtick,i=n.dtickrange,o=void 0,s=void 0,l=void 0,o=u||function(t){return t},s=i[0],l=i[1],(!s&&"number"!=typeof s||o(s)<=o(a))&&(!l&&"number"!=typeof l||o(l)>=o(a)))){r=n;break}break;case"log":for(e=0;e<t.tickformatstops.length;e++)if((n=t.tickformatstops[e]).enabled&&f(t.dtick,n.dtickrange)){r=n;break}}return r?r.value:t.tickformat},N.getSubplots=function(t,e){var r=t._fullLayout._subplots,n=r.cartesian.concat(r.gl2d||[]),a=e?N.findSubplotsWithAxis(n,e):n;return a.sort((function(t,e){var r=t.substr(1).split("y"),n=e.substr(1).split("y");return r[0]===n[0]?+r[1]-+n[1]:+r[0]-+n[0]})),a},N.findSubplotsWithAxis=function(t,e){for(var r=new RegExp("x"===e._id.charAt(0)?"^"+e._id+"y":e._id+"$"),n=[],a=0;a<t.length;a++){var i=t[a];r.test(i)&&n.push(i)}return n},N.makeClipPaths=function(t){var e=t._fullLayout;if(!e._hasOnlyLargeSploms){var r,a,i={_offset:0,_length:e.width,_id:""},o={_offset:0,_length:e.height,_id:""},s=N.list(t,"x",!0),l=N.list(t,"y",!0),u=[];for(r=0;r<s.length;r++)for(u.push({x:s[r],y:o}),a=0;a<l.length;a++)0===r&&u.push({x:i,y:l[a]}),u.push({x:s[r],y:l[a]});var c=e._clips.selectAll(".axesclip").data(u,(function(t){return t.x._id+t.y._id}));c.enter().append("clipPath").classed("axesclip",!0).attr("id",(function(t){return"clip"+e._uid+t.x._id+t.y._id})).append("rect"),c.exit().remove(),c.each((function(t){n.select(this).select("rect").attr({x:t.x._offset||0,y:t.y._offset||0,width:t.x._length||1,height:t.y._length||1})}))}},N.draw=function(t,e,r){var n=t._fullLayout;"redraw"===e&&n._paper.selectAll("g.subplot").each((function(t){var e=t[0],r=n._plots[e];if(r){var a=r.xaxis,i=r.yaxis;r.xaxislayer.selectAll("."+a._id+"tick").remove(),r.yaxislayer.selectAll("."+i._id+"tick").remove(),r.xaxislayer.selectAll("."+a._id+"tick2").remove(),r.yaxislayer.selectAll("."+i._id+"tick2").remove(),r.xaxislayer.selectAll("."+a._id+"divider").remove(),r.yaxislayer.selectAll("."+i._id+"divider").remove(),r.gridlayer&&r.gridlayer.selectAll("path").remove(),r.zerolinelayer&&r.zerolinelayer.selectAll("path").remove(),n._infolayer.select(".g-"+a._id+"title").remove(),n._infolayer.select(".g-"+i._id+"title").remove()}}));var a=e&&"redraw"!==e?e:N.listIds(t);return s.syncOrAsync(a.map((function(e){return function(){if(e){var n=N.getFromId(t,e),a=N.drawOne(t,n,r);return n._r=n.range.slice(),n._rl=s.simpleMap(n._r,n.r2l),a}}})))},N.drawOne=function(t,e,r){var n,a,l;r=r||{},e.setScale();var u=t._fullLayout,h=e._id,p=h.charAt(0),g=N.counterLetter(h),v=u._plots[e._mainSubplot];if(v){var m=v[p+"axislayer"],y=e._mainLinePosition,b=e._mainMirrorPosition,x=e._vals=N.calcTicks(e),_=[e.mirror,y,b].join("_");for(n=0;n<x.length;n++)x[n].axInfo=_;e._selections={},e._tickAngles&&(e._prevTickAngles=e._tickAngles),e._tickAngles={},e._depth=null;var w={};if(e.visible){var A,T,k=N.makeTransTickFn(e),M=N.makeTransTickLabelFn(e),E="inside"===e.ticks,S="outside"===e.ticks;if("boundaries"===e.tickson){var C=function(t,e){var r,n=[],a=function(t,e){var r=t.xbnd[e];null!==r&&n.push(s.extendFlat({},t,{x:r}))};if(e.length){for(r=0;r<e.length;r++)a(e[r],0);a(e[r-1],1)}return n}(0,x);T=N.clipEnds(e,C),A=E?T:C}else T=N.clipEnds(e,x),A=E&&"period"!==e.ticklabelmode?T:x;var L=e._gridVals=T,O=function(t,e){var r,n,a=[],i=e.length&&e[e.length-1].x<e[0].x,o=function(t,e){var r=t.xbnd[e];null!==r&&a.push(s.extendFlat({},t,{x:r}))};if(t.showdividers&&e.length){for(r=0;r<e.length;r++){var l=e[r];l.text2!==n&&o(l,i?1:0),n=l.text2}o(e[r-1],i?0:1)}return a}(e,x);if(!u._hasOnlyLargeSploms){var D=e._subplotsWith,R={};for(n=0;n<D.length;n++){a=D[n];var I=(l=u._plots[a])[g+"axis"],P=I._mainAxis._id;if(!R[P]){R[P]=1;var B="x"===p?"M0,"+I._offset+"v"+I._length:"M"+I._offset+",0h"+I._length;N.drawGrid(t,e,{vals:L,counterAxis:I,layer:l.gridlayer.select("."+h),path:B,transFn:k}),N.drawZeroLine(t,e,{counterAxis:I,layer:l.zerolinelayer,path:B,transFn:k})}}}var j=N.getTickSigns(e),U=[];if(e.ticks){var V,H,G,q=N.makeTickPath(e,y,j[2]);if(e._anchorAxis&&e.mirror&&!0!==e.mirror?(V=N.makeTickPath(e,b,j[3]),H=q+V):(V="",H=q),e.showdividers&&S&&"boundaries"===e.tickson){var X={};for(n=0;n<O.length;n++)X[O[n].x]=1;G=function(t){return X[t.x]?V:H}}else G=H;N.drawTicks(t,e,{vals:A,layer:m,path:G,transFn:k}),"allticks"===e.mirror&&(U=Object.keys(e._linepositions||{}))}for(n=0;n<U.length;n++){a=U[n],l=u._plots[a];var W=e._linepositions[a]||[],Y=N.makeTickPath(e,W[0],j[0])+N.makeTickPath(e,W[1],j[1]);N.drawTicks(t,e,{vals:A,layer:l[p+"axislayer"],path:Y,transFn:k})}var Z=[];if(Z.push((function(){return N.drawLabels(t,e,{vals:x,layer:m,transFn:M,labelFns:N.makeLabelFns(e,y)})})),"multicategory"===e.type){var J={x:2,y:10}[p];Z.push((function(){var r={x:"height",y:"width"}[p],n=$()[r]+J+(e._tickAngles[h+"tick"]?e.tickfont.size*F:0);return N.drawLabels(t,e,{vals:ut(e,x),layer:m,cls:h+"tick2",repositionOnUpdate:!0,secondary:!0,transFn:k,labelFns:N.makeLabelFns(e,y+n*j[4])})})),Z.push((function(){return e._depth=j[4]*($("tick2")[e.side]-y),function(t,e,r){var n=e._id+"divider",a=r.vals,i=r.layer.selectAll("path."+n).data(a,ft);i.exit().remove(),i.enter().insert("path",":first-child").classed(n,1).classed("crisp",1).call(f.stroke,e.dividercolor).style("stroke-width",d.crispRound(t,e.dividerwidth,1)+"px"),i.attr("transform",r.transFn).attr("d",r.path)}(t,e,{vals:O,layer:m,path:N.makeTickPath(e,y,j[4],e._depth),transFn:k})}))}else e.title.hasOwnProperty("standoff")&&Z.push((function(){e._depth=j[4]*($()[e.side]-y)}));var Q=o.getComponentMethod("rangeslider","isVisible")(e);return Z.push((function(){var r,n,a,s,l=e.side.charAt(0),c=z[e.side].charAt(0),f=N.getPxPosition(t,e),d=S?e.ticklen:0;if((e.automargin||Q)&&("multicategory"===e.type?r=$("tick2"):(r=$(),"x"===p&&"b"===l&&(e._depth=Math.max(r.width>0?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;s<a.length;s++){var l=a[s].x;if(o?!l:Math.abs(l)<e.dtick/100){if(a=a.slice(0,s).concat(a.slice(s+1)),!o)break;s--}}var u=r.layer.selectAll("path."+n).data(a,ft);u.exit().remove(),u.enter().append("path").classed(n,1).classed("crisp",!1!==r.crisp),e._gw=d.crispRound(t,e.gridwidth,1),u.attr("transform",r.transFn).attr("d",r.path).call(f.stroke,e.gridcolor||"#ddd").style("stroke-width",e._gw+"px"),"function"==typeof r.path&&u.attr("d",r.path)},N.drawZeroLine=function(t,e,r){r=r||r;var n=e._id+"zl",a=N.shouldShowZeroLine(t,e,r.counterAxis),i=r.layer.selectAll("path."+n).data(a?[{x:0,id:e._id}]:[]);i.exit().remove(),i.enter().append("path").classed(n,1).classed("zl",1).classed("crisp",!1!==r.crisp).each((function(){r.layer.selectAll("path").sort((function(t,e){return U(t.id,e.id)}))})),i.attr("transform",r.transFn).attr("d",r.path).call(f.stroke,e.zerolinecolor||f.defaultLine).style("stroke-width",d.crispRound(t,e.zerolinewidth,e._gw||1)+"px")},N.drawLabels=function(t,e,r){r=r||{};var i=t._fullLayout,o=e._id,c=o.charAt(0),f=r.cls||o+"tick",h=r.vals,p=r.labelFns,g=r.secondary?0:e.tickangle,v=(e._prevTickAngles||{})[f],m=r.layer.selectAll("g."+f).data(e.showticklabels?h:[],ft),y=[];function b(t,i){var o=-1!==(e.ticklabelposition||"").indexOf("inside");t.each((function(t){var s=n.select(this),c=s.select(".text-math-group"),f=p.anchorFn(t,i),h=r.transFn.call(s.node(),t)+(a(i)&&0!=+i?" rotate("+i+","+p.xFn(t)+","+(p.yFn(t)-t.fontSize/2)+")":""),g=u.lineCount(s),v=F*t.fontSize,m=p.heightFn(t,a(i)?+i:0,(g-1)*v);if(m&&(h+=l(0,m)),c.empty()){var y=s.select("text");y.attr({transform:h,"text-anchor":f}),o&&(y.style({opacity:100}),e._hideOutOfRangeInsideTickLabels&&e._hideOutOfRangeInsideTickLabels())}else{var b=d.bBox(c.node()).width*{end:-.5,start:.5}[f];c.attr("transform",h+l(b,0))}}))}m.enter().append("g").classed(f,1).append("text").attr("text-anchor","middle").each((function(e){var r=n.select(this),a=t._promises.length;r.call(u.positionText,p.xFn(e),p.yFn(e)).call(d.font,e.font,e.fontSize,e.fontColor).text(e.text).call(u.convertToTspans,t),t._promises[a]?y.push(t._promises.pop().then((function(){b(r,g)}))):b(r,g)})),m.exit().remove(),r.repositionOnUpdate&&m.each((function(t){n.select(this).select("text").call(u.positionText,p.xFn(t),p.yFn(t))})),e._hideOutOfRangeInsideTickLabels=void 0,-1!==(e.ticklabelposition||"").indexOf("inside")&&(e._hideOutOfRangeInsideTickLabels=function(){var t=s.simpleMap(e.range,e.r2l),r=e.l2p(t[0]),a=e.l2p(t[1]),i=Math.min(r,a)+e._offset,o=Math.max(r,a)+e._offset,l="x"===e._id.charAt(0);m.each((function(t){var r=n.select(this);if(r.select(".text-math-group").empty()){var a=d.bBox(r.node()),s=!1;l?(a.right>o||a.left<i)&&(s=!0):(a.bottom>o||a.top+(e.tickangle?0:t.fontSize/4)<i)&&(s=!0),s&&r.select("text").style({opacity:0})}}))}),b(m,v+1?v:g);var x=null;e._selections&&(e._selections[f]=m);var _=[function(){return y.length&&Promise.all(y)}];e.automargin&&i._redrawFromAutoMarginCount&&90===v?(x=90,_.push((function(){b(m,v)}))):_.push((function(){if(b(m,g),h.length&&"x"===c&&!a(g)&&("log"!==e.type||"D"!==String(e.dtick).charAt(0))){x=0;var t,n=0,i=[];if(m.each((function(t){n=Math.max(n,t.fontSize);var r=e.l2p(t.x),a=pt(this),o=d.bBox(a.node());i.push({top:0,bottom:10,height:10,left:r-o.width/2,right:r+o.width/2+2,width:o.width+2})})),"boundaries"!==e.tickson&&!e.showdividers||r.secondary){var o=h.length,l=Math.abs((h[o-1].x-h[0].x)*e._m)/(o-1),u=e.ticklabelposition||"",f=function(t){return-1!==u.indexOf(t)},p=f("top"),v=f("left"),y=f("right"),_=f("bottom")||v||p||y?(e.tickwidth||0)+6:0,w=l<2.5*n||"multicategory"===e.type;for(t=0;t<i.length-1;t++)if(s.bBoxIntersect(i[t],i[t+1],_)){x=w?90:30;break}}else{var A=2;for(e.ticks&&(A+=e.tickwidth/2),t=0;t<i.length;t++){var T=h[t].xbnd,k=i[t];if(null!==T[0]&&k.left-e.l2p(T[0])<A||null!==T[1]&&e.l2p(T[1])-k.right<A){x=90;break}}}x&&b(m,x)}})),e._tickAngles&&_.push((function(){e._tickAngles[f]=null===x?a(g)?g:0:x}));var w=e._anchorAxis;w&&w.autorange&&-1!==(e.ticklabelposition||"").indexOf("inside")&&!V(i,e._id)&&(i._insideTickLabelsAutorange||(i._insideTickLabelsAutorange={}),i._insideTickLabelsAutorange[w._name+".autorange"]=w.autorange,_.push((function(){m.each((function(t,r){var n=pt(this);e._vals[r].bb=d.bBox(n.node())}))})));var A=s.syncOrAsync(_);return A&&A.then&&t._promises.push(A),A},N.getPxPosition=function(t,e){var r,n=t._fullLayout._size,a=e._id.charAt(0),i=e.side;return"free"!==e.anchor?r=e._anchorAxis:"x"===a?r={_offset:n.t+(1-(e.position||0))*n.h,_length:0}:"y"===a&&(r={_offset:n.l+(e.position||0)*n.w,_length:0}),"top"===i||"left"===i?r._offset:"bottom"===i||"right"===i?r._offset+r._length:void 0},N.shouldShowZeroLine=function(t,e,r){var n=s.simpleMap(e.range,e.r2l);return n[0]*n[1]<=0&&e.zeroline&&("linear"===e.type||"-"===e.type)&&!(e.rangebreaks&&e.maskBreaks(0)===D)&&(ht(e,0)||!function(t,e,r,n){var a=r._mainAxis;if(!a)return;var i=t._fullLayout,o=e._id.charAt(0),s=N.counterLetter(e._id),l=e._offset+(Math.abs(n[0])<Math.abs(n[1])==("x"===o)?0:e._length);function u(t){if(!t.showline||!t.linewidth)return!1;var r=Math.max((t.linewidth+e.zerolinewidth)/2,1);function n(t){return"number"==typeof t&&Math.abs(t-l)<r}if(n(t._mainLinePosition)||n(t._mainMirrorPosition))return!0;var a=t._linepositions||{};for(var i in a)if(n(a[i][0])||n(a[i][1]))return!0}var c=i._plots[r._mainSubplot];if(!(c.mainplotinfo||c).overlays.length)return u(r);for(var f=N.list(t,s),d=0;d<f.length;d++){var h=f[d];if(h._mainAxis===a&&u(h))return!0}}(t,e,r,n)||function(t,e){for(var r=t._fullData,n=e._mainSubplot,a=e._id.charAt(0),i=0;i<r.length;i++){var s=r[i];if(!0===s.visible&&s.xaxis+s.yaxis===n){if(o.traceIs(s,"bar-like")&&s.orientation==={x:"h",y:"v"}[a])return!0;if(s.fill&&s.fill.charAt(s.fill.length-1)===a)return!0}}return!1}(t,e))},N.clipEnds=function(t,e){return e.filter((function(e){return ht(t,e.x)}))},N.allowAutoMargin=function(t){for(var e=N.list(t,"",!0),r=0;r<e.length;r++){var n=e[r];n.automargin&&(i.allowAutoMargin(t,gt(n)),n.mirror&&i.allowAutoMargin(t,vt(n))),o.getComponentMethod("rangeslider","isVisible")(n)&&i.allowAutoMargin(t,mt(n))}},N.swap=function(t,e){for(var r=function(t,e){var r,n,a=[];for(r=0;r<e.length;r++){var i=[],o=t._fullData[e[r]].xaxis,s=t._fullData[e[r]].yaxis;if(o&&s){for(n=0;n<a.length;n++)-1===a[n].x.indexOf(o)&&-1===a[n].y.indexOf(s)||i.push(n);if(i.length){var l,u=a[i[0]];if(i.length>1)for(n=1;n<i.length;n++)l=a[i[n]],yt(u.x,l.x),yt(u.y,l.y);yt(u.x,[o]),yt(u.y,[s])}else a.push({x:[o],y:[s]})}}return a}(t,e),n=0;n<r.length;n++)bt(t,r[n].x,r[n].y)}},{"../../components/color":368,"../../components/drawing":390,"../../components/titles":463,"../../constants/alignment":470,"../../constants/numerical":475,"../../lib":498,"../../lib/svg_text_utils":523,"../../plots/plots":585,"../../registry":593,"./autorange":546,"./axis_autotype":548,"./axis_ids":550,"./clean_ticks":552,"./layout_attributes":561,"./set_convert":567,d3:86,"fast-isnumeric":155}],548:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib"),i=t("../../constants/numerical").BADNUM,o=a.isArrayOrTypedArray,s=a.isDateTime,l=a.cleanNumber,u=Math.round;function c(t,e){return e?n(t):"number"==typeof t}function f(t){return Math.max(1,(t-1)/1e3)}e.exports=function(t,e,r){var a=t,d=r.noMultiCategory;if(o(a)&&!a.length)return"-";if(!d&&function(t){return o(t[0])&&o(t[1])}(a))return"multicategory";if(d&&Array.isArray(a[0])){for(var h=[],p=0;p<a.length;p++)if(o(a[p]))for(var g=0;g<a[p].length;g++)h.push(a[p][g]);a=h}if(function(t,e){for(var r=t.length,a=f(r),i=0,o=0,l={},c=0;c<r;c+=a){var d=u(c),h=t[d],p=String(h);l[p]||(l[p]=1,s(h,e)&&i++,n(h)&&o++)}return i>2*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;c<r;c+=n){var d=u(c),h=t[d],p=String(h);if(!s[p]){s[p]=1;var g=typeof h;"boolean"===g?o++:(e?l(h)!==i:"number"===g)?a++:"string"===g&&o++}}return o>2*a}(a,v)?"category":function(t,e){for(var r=t.length,n=0;n<r;n++)if(c(t[n],e))return!0;return!1}(a,v)?"linear":"-"}},{"../../constants/numerical":475,"../../lib":498,"fast-isnumeric":155}],549:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../registry"),i=t("../../lib"),o=t("../array_container_defaults"),s=t("./layout_attributes"),l=t("./tick_value_defaults"),u=t("./tick_mark_defaults"),c=t("./tick_label_defaults"),f=t("./category_order_defaults"),d=t("./line_grid_defaults"),h=t("./set_convert"),p=t("./constants").WEEKDAY_PATTERN,g=t("./constants").HOUR_PATTERN;function v(t,e,r){function a(r,n){return i.coerce(t,e,s.rangebreaks,r,n)}if(a("enabled")){var o=a("bounds");if(o&&o.length>=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]){if(o[0]<d[0]&&o[1]>d[1])return void(e.enabled=!1)}else if(o[0]>d[0]&&o[1]<d[1])return void(e.enabled=!1)}}else{var h=a("values");if(!h||!h.length)return void(e.enabled=!1);a("dvalue")}}}e.exports=function(t,e,r,n,g){var m,y=n.letter,b=n.font||{},x=n.splomStash||{},_=r("visible",!n.visibleDflt),w=e._template||{},A=e.type||w.type||"-";"date"===A&&(a.getComponentMethod("calendars","handleDefaults")(t,e,"calendar",n.calendar),n.noTicklabelmode||(m=r("ticklabelmode")));n.noTicklabelposition&&"multicategory"!==A||i.coerce(t,e,{ticklabelposition:{valType:"enumerated",dflt:"outside",values:"period"===m?["outside","inside"]:"x"===y?["outside","inside","outside left","inside left","outside right","inside right"]:["outside","inside","outside top","inside top","outside bottom","inside bottom"]}},"ticklabelposition"),h(e,g);var T=!e.isValidRange(t.range);T&&n.reverseDflt&&(T="reversed"),!r("autorange",T)||"linear"!==A&&"-"!==A||r("rangemode"),r("range"),e.cleanRange(),f(t,e,r,n),"category"===A||n.noHover||r("hoverformat");var k=r("color"),M=k!==s.color.dflt?k:b.color,E=x.label||g._dfltTitle[y];if(c(t,e,r,A,n,{pass:1}),!_)return e;r("title.text",E),i.coerceFont(r,"title.font",{family:b.family,size:Math.round(1.2*b.size),color:M}),l(t,e,r,A),c(t,e,r,A,n,{pass:2}),u(t,e,r,n),d(t,e,r,{dfltColor:k,bgColor:n.bgColor,showGrid:n.showGrid,attributes:s}),(e.showline||e.ticks)&&r("mirror"),n.automargin&&r("automargin");var S,C="multicategory"===A;n.noTickson||"category"!==A&&!C||!e.ticks&&!e.showgrid||(C&&(S="boundaries"),"boundaries"===r("tickson",S)&&delete e.ticklabelposition);C&&(r("showdividers")&&(r("dividercolor"),r("dividerwidth")));if("date"===A)if(o(t,e,{name:"rangebreaks",inclusionAttr:"enabled",handleItemDefaults:v}),e.rangebreaks.length){for(var L=0;L<e.rangebreaks.length;L++)if(e.rangebreaks[L].pattern===p){e._hasDayOfWeekBreaks=!0;break}if(h(e,g),g._has("scattergl")||g._has("splom"))for(var O=0;O<n.data.length;O++){var D=n.data[O];"scattergl"!==D.type&&"splom"!==D.type||(D.visible=!1,i.warn(D.type+" traces do not work on axes with rangebreaks. Setting trace "+D.index+" to `visible: false`."))}}else delete e.rangebreaks;return e};var m={sun:1,mon:2,tue:3,wed:4,thu:5,fri:6,sat:7};function y(t){if("string"==typeof t)return m[t.substr(0,3).toLowerCase()]}},{"../../lib":498,"../../registry":593,"../array_container_defaults":542,"./category_order_defaults":551,"./constants":553,"./layout_attributes":561,"./line_grid_defaults":563,"./set_convert":567,"./tick_label_defaults":568,"./tick_mark_defaults":569,"./tick_value_defaults":570,"fast-isnumeric":155}],550:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("./constants");function i(t,e){if(e&&e.length)for(var r=0;r<e.length;r++)if(e[r][t])return!0;return!1}r.id2name=function(t){if("string"==typeof t&&t.match(a.AX_ID_PATTERN)){var e=t.split(" ")[0].substr(1);return"1"===e&&(e=""),t.charAt(0)+"axis"+e}},r.name2id=function(t){if(t.match(a.AX_NAME_PATTERN)){var e=t.substr(5);return"1"===e&&(e=""),t.charAt(0)+e}},r.cleanId=function(t,e,r){var n=/( domain)$/.test(t);if("string"==typeof t&&t.match(a.AX_ID_PATTERN)&&(!e||t.charAt(0)===e)&&(!n||r)){var i=t.split(" ")[0].substr(1).replace(/^0+/,"");return"1"===i&&(i=""),t.charAt(0)+i+(n&&r?" domain":"")}},r.list=function(t,e,n){var a=t._fullLayout;if(!a)return[];var i,o=r.listIds(t,e),s=new Array(o.length);for(i=0;i<o.length;i++){var l=o[i];s[i]=a[l.charAt(0)+"axis"+l.substr(1)]}if(!n){var u=a._subplots.gl3d||[];for(i=0;i<u.length;i++){var c=a[u[i]];e?s.push(c[e+"axis"]):s.push(c.xaxis,c.yaxis,c.zaxis)}}return s},r.listIds=function(t,e){var r=t._fullLayout;if(!r)return[];var n=r._subplots;return e?n[e+"axis"]:n.xaxis.concat(n.yaxis)},r.getFromId=function(t,e,n){var a=t._fullLayout;return e=void 0===e||"string"!=typeof e?e:e.replace(" domain",""),"x"===n?e=e.replace(/y[0-9]*/,""):"y"===n&&(e=e.replace(/x[0-9]*/,"")),a[r.id2name(e)]},r.getFromTrace=function(t,e,a){var i=t._fullLayout,o=null;if(n.traceIs(e,"gl3d")){var s=e.scene;"scene"===s.substr(0,5)&&(o=i[s][a+"axis"])}else o=r.getFromId(t,e[a+"axis"]||a);return o},r.idSort=function(t,e){var r=t.charAt(0),n=e.charAt(0);return r!==n?r>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;n<e.data.length;n++){var s=e.data[n];s[i+"axis"]===t._id&&r.push(s)}for(n=0;n<r.length;n++){var l=r[n][i];for(a=0;a<l.length;a++){var u=l[a];null!=u&&(o[u]=1)}}return Object.keys(o)}(e,n).sort(),"category ascending"===l?e._initialCategories=s:"category descending"===l&&(e._initialCategories=s.reverse()))}}},{}],552:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib"),i=t("../../constants/numerical"),o=i.ONEDAY,s=i.ONEWEEK;r.dtick=function(t,e){var r="log"===e,a="date"===e,i="category"===e,s=a?o:1;if(!t)return s;if(n(t))return(t=Number(t))<=0?s:i?Math.max(1,Math.round(t)):a?Math.max(.1,t):t;if("string"!=typeof t||!a&&!r)return s;var l=t.charAt(0),u=t.substr(1);return(u=n(u)?Number(u):0)<=0||!(a&&"M"===l&&u===Math.round(u)||r&&"L"===l||r&&"D"===l&&(1===u||2===u))?s:t},r.tick0=function(t,e,r,i){return"date"===e?a.cleanDate(t,a.dateTick0(r,i%s==0?1:0)):"D1"!==i&&"D2"!==i?n(t)?Number(t):0:void 0}},{"../../constants/numerical":475,"../../lib":498,"fast-isnumeric":155}],553:[function(t,e,r){"use strict";var n=t("../../lib/regex").counter;e.exports={idRegex:{x:n("x","( domain)?"),y:n("y","( domain)?")},attrRegex:n("[xy]axis"),xAxisMatch:n("xaxis"),yAxisMatch:n("yaxis"),AX_ID_PATTERN:/^[xyz][0-9]*( domain)?$/,AX_NAME_PATTERN:/^[xyz]axis[0-9]*$/,SUBPLOT_PATTERN:/^x([0-9]*)y([0-9]*)$/,HOUR_PATTERN:"hour",WEEKDAY_PATTERN:"day of week",MINDRAG:8,MINSELECT:12,MINZOOM:20,DRAGGERSIZE:20,BENDPX:1.5,REDRAWDELAY:50,SELECTDELAY:100,SELECTID:"-select",DFLTRANGEX:[-1,6],DFLTRANGEY:[-1,4],traceLayerClasses:["imagelayer","heatmaplayer","contourcarpetlayer","contourlayer","funnellayer","waterfalllayer","barlayer","carpetlayer","violinlayer","boxlayer","ohlclayer","scattercarpetlayer","scatterlayer"],clipOnAxisFalseQuery:[".scatterlayer",".barlayer",".funnellayer",".waterfalllayer"],layerValue2layerClass:{"above traces":"above","below traces":"below"}}},{"../../lib/regex":515}],554:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./autorange"),i=t("./axis_ids").id2name,o=t("./layout_attributes"),s=t("./scale_zoom"),l=t("./set_convert"),u=t("../../constants/numerical").ALMOST_EQUAL,c=t("../../constants/alignment").FROM_BL;function f(t,e,r){var a=r.axIds,s=r.layoutOut,l=r.hasImage,u=s._axisConstraintGroups,c=s._axisMatchGroups,f=e._id,g=f.charAt(0),v=((s._splomAxes||{})[g]||{})[f]||{},m=e._id,y="x"===m.charAt(0);function b(r,a){return n.coerce(t,e,o,r,a)}e._matchGroup=null,e._constraintGroup=null,b("constrain",l?"domain":"range"),n.coerce(t,e,{constraintoward:{valType:"enumerated",values:y?["left","center","right"]:["bottom","middle","top"],dflt:y?"center":"middle"}},"constraintoward");var x,_,w=e.type,A=[];for(x=0;x<a.length;x++){if((_=a[x])!==m)s[i(_)].type===w&&A.push(_)}var T=h(u,m);if(T){var k=[];for(x=0;x<A.length;x++)T[_=A[x]]||k.push(_);A=k}var M,E,S=A.length;S&&(t.matches||v.matches)&&(M=n.coerce(t,e,{matches:{valType:"enumerated",values:A,dflt:-1!==A.indexOf(v.matches)?v.matches:void 0}},"matches"));var C=l&&!y?e.anchor:void 0;if(S&&!M&&(t.scaleanchor||C)&&(E=n.coerce(t,e,{scaleanchor:{valType:"enumerated",values:A}},"scaleanchor",C)),M){e._matchGroup=p(c,m,M,1);var L=s[i(M)],O=d(s,e)/d(s,L);y!==("x"===M.charAt(0))&&(O=(y?"x":"y")+O),p(u,m,M,O)}else t.matches&&-1!==a.indexOf(t.matches)&&n.warn("ignored "+e._name+'.matches: "'+t.matches+'" to avoid an infinite loop');if(E){var D=b("scaleratio");D||(D=e.scaleratio=1),p(u,m,E,D)}else t.scaleanchor&&-1!==a.indexOf(t.scaleanchor)&&n.warn("ignored "+e._name+'.scaleanchor: "'+t.scaleanchor+'" to avoid either an infinite loop and possibly inconsistent scaleratios, or because this axis declares a *matches* constraint.')}function d(t,e){var r=e.domain;return r||(r=t[i(e.overlaying)].domain),r[1]-r[0]}function h(t,e){for(var r=0;r<t.length;r++)if(t[r][e])return t[r];return null}function p(t,e,r,n){var a,i,o,s,l,u=h(t,e);null===u?((u={})[e]=1,l=t.length,t.push(u)):l=t.indexOf(u);var c=Object.keys(u);for(a=0;a<t.length;a++)if(o=t[a],a!==l&&o[r]){var f=o[r];for(i=0;i<c.length;i++)o[s=c[i]]=g(f,g(n,u[s]));return void t.splice(l,1)}if(1!==n)for(i=0;i<c.length;i++){var d=c[i];u[d]=g(n,u[d])}u[r]=1}function g(t,e){var r,n,a="",i="";"string"==typeof t&&(r=(a=t.match(/^[xy]*/)[0]).length,t=+t.substr(r)),"string"==typeof e&&(n=(i=e.match(/^[xy]*/)[0]).length,e=+e.substr(n));var o=t*e;return r||n?r&&n&&a.charAt(0)!==i.charAt(0)?r===n?o:(r>n?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;o<i.length;o++){var s=i[o],l=t[s];if("string"==typeof l){var u=l.match(/^[xy]*/)[0],c=u.length;l=+l.substr(c);for(var f="y"===u.charAt(0)?n:1/n,d=0;d<c;d++)l*=f}a[s]=l}return a}function m(t,e){var r=t._inputDomain,n=c[t.constraintoward],a=r[0]+(r[1]-r[0])*n;t.domain=t._input.domain=[a+(r[0]-a)/e,a+(r[1]-a)/e],t.setScale()}r.handleDefaults=function(t,e,r){var a,o,s,u,c,d,h,p,g=r.axIds,v=r.axHasImage,m=e._axisConstraintGroups=[],y=e._axisMatchGroups=[];for(a=0;a<g.length;a++)f(c=t[u=i(g[a])],d=e[u],{axIds:g,layoutOut:e,hasImage:v[u]});function b(t,r){for(a=0;a<t.length;a++)for(s in o=t[a])e[i(s)][r]=o}for(b(y,"_matchGroup"),a=0;a<m.length;a++)for(s in o=m[a])if((d=e[i(s)]).fixedrange){for(var x in o){var _=i(x);!1===(t[_]||{}).fixedrange&&n.warn("fixedrange was specified as false for axis "+_+" but was overridden because another axis in its constraint group has fixedrange true"),e[_].fixedrange=!0}break}for(a=0;a<m.length;){for(s in o=m[a]){(d=e[i(s)])._matchGroup&&Object.keys(d._matchGroup).length===Object.keys(o).length&&(m.splice(a,1),a--);break}a++}b(m,"_constraintGroup");var w=["constrain","range","autorange","rangemode","rangebreaks","categoryorder","categoryarray"],A=!1,T=!1;function k(){p=d[h],"rangebreaks"===h&&(T=d._hasDayOfWeekBreaks)}for(a=0;a<y.length;a++){o=y[a];for(var M=0;M<w.length;M++){var E;for(s in h=w[M],p=null,o)if(c=t[u=i(s)],d=e[u],h in d){if(!d.matches&&(E=d,h in c)){k();break}null===p&&h in c&&k()}if("range"===h&&p&&(A=!0),"autorange"===h&&null===p&&A&&(p=!1),null===p&&h in E&&(p=E[h]),null!==p)for(s in o)(d=e[i(s)])[h]="range"===h?p.slice():p,"rangebreaks"===h&&(d._hasDayOfWeekBreaks=T,l(d,e))}}},r.enforce=function(t){var e,r,n,o,l,c,f,d,h=t._fullLayout,p=h._axisConstraintGroups||[];for(e=0;e<p.length;e++){n=v(p[e],h);var g=Object.keys(n),y=1/0,b=0,x=1/0,_={},w={},A=!1;for(r=0;r<g.length;r++)w[o=g[r]]=l=h[i(o)],l._inputDomain?l.domain=l._inputDomain.slice():l._inputDomain=l.domain.slice(),l._inputRange||(l._inputRange=l.range.slice()),l.setScale(),_[o]=c=Math.abs(l._m)/n[o],y=Math.min(y,c),"domain"!==l.constrain&&l._constraintShrinkable||(x=Math.min(x,c)),delete l._constraintShrinkable,b=Math.max(b,c),"domain"===l.constrain&&(A=!0);if(!(y>u*b)||A)for(r=0;r<g.length;r++)if(c=_[o=g[r]],f=(l=w[o]).constrain,c!==x||"domain"===f)if(d=c/x,"range"===f)s(l,d);else{var T=l._inputDomain,k=(l.domain[1]-l.domain[0])/(T[1]-T[0]),M=(l.r2l(l.range[1])-l.r2l(l.range[0]))/(l.r2l(l._inputRange[1])-l.r2l(l._inputRange[0]));if((d/=k)*M<1){l.domain=l._input.domain=T.slice(),s(l,d);continue}if(M<1&&(l.range=l._input.range=l._inputRange.slice(),d*=M),l.autorange){var E=l.r2l(l.range[0]),S=l.r2l(l.range[1]),C=(E+S)/2,L=C,O=C,D=Math.abs(S-C),R=C-D*d*1.0001,I=C+D*d*1.0001,P=a.makePadFn(h,l,0),F=a.makePadFn(h,l,1);m(l,d);var z,N,B=Math.abs(l._m),j=a.concatExtremes(t,l),U=j.min,V=j.max;for(N=0;N<U.length;N++)(z=U[N].val-P(U[N])/B)>R&&z<L&&(L=z);for(N=0;N<V.length;N++)(z=V[N].val+F(V[N])/B)<I&&z>O&&(O=z);d/=(O-L)/(2*D),L=l.l2r(L),O=l.l2r(O),l.range=l._input.range=E<S?[L,O]:[O,L]}m(l,d)}}},r.getAxisGroup=function(t,e){for(var r=t._axisMatchGroups,n=0;n<r.length;n++){if(r[n][e])return"g"+n}return e},r.clean=function(t,e){if(e._inputDomain){for(var r=!1,n=e._id,a=t._fullLayout._axisConstraintGroups,i=0;i<a.length;i++)if(a[i][n]){r=!0;break}r&&"domain"===e.constrain||(e._input.domain=e.domain=e._inputDomain,delete e._inputDomain)}}},{"../../constants/alignment":470,"../../constants/numerical":475,"../../lib":498,"./autorange":546,"./axis_ids":550,"./layout_attributes":561,"./scale_zoom":565,"./set_convert":567}],555:[function(t,e,r){"use strict";var n=t("d3"),a=t("tinycolor2"),i=t("has-passive-events"),o=t("../../registry"),s=t("../../lib"),l=s.strTranslate,u=t("../../lib/svg_text_utils"),c=t("../../components/color"),f=t("../../components/drawing"),d=t("../../components/fx"),h=t("./axes"),p=t("../../lib/setcursor"),g=t("../../components/dragelement"),v=t("../../components/dragelement/helpers"),m=v.selectingOrDrawing,y=v.freeMode,b=t("../../constants/alignment").FROM_TL,x=t("../../lib/clear_gl_canvases"),_=t("../../plot_api/subroutines").redrawReglTraces,w=t("../plots"),A=t("./axis_ids").getFromId,T=t("./select").prepSelect,k=t("./select").clearSelect,M=t("./select").selectOnClick,E=t("./scale_zoom"),S=t("./constants"),C=S.MINDRAG,L=S.MINZOOM,O=!0;function D(t,e,r,n){var a=s.ensureSingle(t.draglayer,e,r,(function(e){e.classed("drag",!0).style({fill:"transparent","stroke-width":0}).attr("data-subplot",t.id)}));return a.call(p,n),a.node()}function R(t,e,r,a,i,o,s){var l=D(t,"rect",e,r);return n.select(l).call(f.setRect,a,i,o,s),l}function I(t,e){for(var r=0;r<t.length;r++)if(!t[r].fixedrange)return e;return""}function P(t,e,r,n,a){for(var i=0;i<t.length;i++){var o=t[i];if(!o.fixedrange)if(o.rangebreaks){var s="y"===o._id.charAt(0),l=s?1-e:e,u=s?1-r:r;n[o._name+".range[0]"]=o.l2r(o.p2l(l*o._length)),n[o._name+".range[1]"]=o.l2r(o.p2l(u*o._length))}else{var c=o._rl[0],f=o._rl[1]-c;n[o._name+".range[0]"]=o.l2r(c+f*e),n[o._name+".range[1]"]=o.l2r(c+f*r)}}if(a&&a.length){var d=(e+(1-r))/2;P(a,d,1-d,n,[])}}function F(t,e){for(var r=0;r<t.length;r++){var n=t[r];if(!n.fixedrange)if(n.rangebreaks){var a=n._length,i=(n.p2l(0+e)-n.p2l(0)+(n.p2l(a+e)-n.p2l(a)))/2;n.range=[n.l2r(n._rl[0]-i),n.l2r(n._rl[1]-i)]}else n.range=[n.l2r(n._rl[0]-e/n._m),n.l2r(n._rl[1]-e/n._m)]}}function z(t){return 1-(t>=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<e.length;g++){var v=e[g];for(i in r)if(v[i]){for(l in v)a&&(h[l]||p[l])||("x"===l.charAt(0)?r:n)[l]||(f[l]=i);for(o in n)a&&(h[o]||p[o])||!v[o]||(c=!0)}for(o in n)if(v[o])for(u in v)a&&(h[u]||p[u])||("x"===u.charAt(0)?r:n)[u]||(d[u]=o)}c&&(s.extendFlat(f,d),d={});var m={},y=[];for(l in f){var b=A(t,l);y.push(b),m[b._id]=b}var x={},_=[];for(u in d){var w=A(t,u);_.push(w),x[w._id]=w}return{xaHash:m,yaHash:x,xaxes:y,yaxes:_,xLinks:f,yLinks:d,isSubplotConstrained:c}}function X(t,e){if(i){var r=void 0!==t.onwheel?"wheel":"mousewheel";t._onwheel&&t.removeEventListener(r,t._onwheel),t._onwheel=e,t.addEventListener(r,e,{passive:!1})}else void 0!==t.onwheel?t.onwheel=e:void 0!==t.onmousewheel?t.onmousewheel=e:t.isAddedWheelEvent||(t.isAddedWheelEvent=!0,t.addEventListener("wheel",e,{passive:!1}))}function W(t){var e=[];for(var r in t)e.push(t[r]);return e}e.exports={makeDragBox:function(t,e,r,i,l,c,p,v){var O,D,U,Y,Z,J,Q,$,K,tt,et,rt,nt,at,it,ot,st,lt,ut,ct,ft,dt,ht,pt=t._fullLayout._zoomlayer,gt=p+v==="nsew",vt=1===(p+v).length;function mt(){if(O=e.xaxis,D=e.yaxis,K=O._length,tt=D._length,Q=O._offset,$=D._offset,(U={})[O._id]=O,(Y={})[D._id]=D,p&&v)for(var r=e.overlays,n=0;n<r.length;n++){var a=r[n].xaxis;U[a._id]=a;var i=r[n].yaxis;Y[i._id]=i}Z=W(U),J=W(Y),nt=I(Z,v),at=I(J,p),it=!at&&!nt,rt=q(t,t._fullLayout._axisMatchGroups,U,Y);var o=(et=q(t,t._fullLayout._axisConstraintGroups,U,Y,rt)).isSubplotConstrained||rt.isSubplotConstrained;ot=v||o,st=p||o;var s=t._fullLayout;lt=s._has("scattergl"),ut=s._has("splom"),ct=s._has("svg")}mt();var yt=function(t,e,r){if(!t)return"pointer";if("nsew"===t)return r?"":"pan"===e?"move":"crosshair";return t.toLowerCase()+"-resize"}(at+nt,t._fullLayout.dragmode,gt),bt=R(e,p+v+"drag",yt,r,i,l,c);if(it&&!gt)return bt.onmousedown=null,bt.style.pointerEvents="none",bt;var xt,_t,wt,At,Tt,kt,Mt,Et,St,Ct,Lt={element:bt,gd:t,plotinfo:e};function Ot(){Lt.plotinfo.selection=!1,k(t)}function Dt(t,r){var a=Lt.gd;if(a._fullLayout._activeShapeIndex>=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||o<Math.min(Math.max(.6*i,C),L)?i<C||!nt?s():(wt.t=0,wt.b=tt,Mt="x",St.attr("d",function(t,e){return"M"+(t.l-.5)+","+(e-L-.5)+"h-3v"+(2*L+1)+"h3ZM"+(t.r+.5)+","+(e-L-.5)+"h3v"+(2*L+1)+"h-3Z"}(wt,_t))):!nt||i<Math.min(.6*o,L)?(wt.l=0,wt.r=K,Mt="y",St.attr("d",function(t,e){return"M"+(e-L-.5)+","+(t.t-.5)+"v-3h"+(2*L+1)+"v3ZM"+(e-L-.5)+","+(t.b+.5)+"v3h"+(2*L+1)+"v-3Z"}(wt,xt))):(Mt="xy",St.attr("d",G(wt)));wt.w=wt.r-wt.l,wt.h=wt.b-wt.t,Mt&&(Ct=!0),t._dragged=Ct,j(Et,St,wt,Tt,kt,At),It(),t.emit("plotly_relayouting",ft),kt=!0}function It(){ft={},"xy"!==Mt&&"x"!==Mt||(P(Z,wt.l/K,wt.r/K,ft,et.xaxes),Ut("x",ft)),"xy"!==Mt&&"y"!==Mt||(P(J,(tt-wt.b)/tt,(tt-wt.t)/tt,ft,et.yaxes),Ut("y",ft))}function Pt(){It(),V(t),Gt(),H(t)}Lt.prepFn=function(e,r,n){var i=Lt.dragmode,o=t._fullLayout.dragmode;o!==i&&(Lt.dragmode=o),mt(),dt=t._fullLayout._invScaleX,ht=t._fullLayout._invScaleY,it||(gt?e.shiftKey?"pan"===o?o="zoom":m(o)||(o="pan"):e.ctrlKey&&(o="pan"):o="pan"),y(o)?Lt.minDrag=1:Lt.minDrag=void 0,m(o)?(Lt.xaxes=Z,Lt.yaxes=J,T(e,r,n,Lt,o)):(Lt.clickFn=Dt,m(i)&&Ot(),it||("zoom"===o?(Lt.moveFn=Rt,Lt.doneFn=Pt,Lt.minDrag=1,function(e,r,n){var i=bt.getBoundingClientRect();xt=r-i.left,_t=n-i.top,t._fullLayout._calcInverseTransform(t);var o=s.apply3DTransform(t._fullLayout._invTransform)(xt,_t);xt=o[0],_t=o[1],wt={l:xt,r:xt,w:0,t:_t,b:_t,h:0},At=t._hmpixcount?t._hmlumcount/t._hmpixcount:a(t._fullLayout.plot_bgcolor).getLuminance(),kt=!1,Mt="xy",Ct=!1,Et=N(pt,At,Q,$,Tt="M0,0H"+K+"V"+tt+"H0V0"),St=B(pt,Q,$)}(0,r,n)):"pan"===o&&(Lt.moveFn=jt,Lt.doneFn=Gt))),t._fullLayout._redrag=function(){var e=t._dragdata;if(e&&e.element===bt){var r=t._fullLayout.dragmode;m(r)||(mt(),qt([0,0,K,tt]),Lt.moveFn(e.dx,e.dy))}}},g.init(Lt);var Ft=[0,0,K,tt],zt=null,Nt=S.REDRAWDELAY,Bt=e.mainplot?t._fullLayout._plots[e.mainplot]:e;function jt(e,r){if(e*=dt,r*=ht,!t._transitioningWithDuration){if(t._fullLayout._replotting=!0,"ew"===nt||"ns"===at){var n=nt?-e:0,a=at?-r:0;if(rt.isSubplotConstrained){if(nt&&at){var i=(e/K-r/tt)/2;n=-(e=i*K),a=-(r=-i*tt)}at?n=-a*K/tt:a=-n*tt/K}return nt&&(F(Z,e),Ut("x")),at&&(F(J,r),Ut("y")),qt([n,a,K,tt]),Vt(),void t.emit("plotly_relayouting",ft)}var o,s,l="w"===nt==("n"===at)?1:-1;if(nt&&at&&(et.isSubplotConstrained||rt.isSubplotConstrained)){var u=(e/K+l*r/tt)/2;e=u*K,r=l*u*tt}if("w"===nt?e=h(Z,0,e):"e"===nt?e=h(Z,1,-e):nt||(e=0),"n"===at?r=h(J,1,r):"s"===at?r=h(J,0,-r):at||(r=0),o="w"===nt?e:0,s="n"===at?r:0,et.isSubplotConstrained&&!rt.isSubplotConstrained||rt.isSubplotConstrained&&nt&&at&&l>0){var c;if(rt.isSubplotConstrained||!nt&&1===at.length){for(c=0;c<Z.length;c++)Z[c].range=Z[c]._r.slice(),E(Z[c],1-r/tt);o=(e=r*K/tt)/2}if(rt.isSubplotConstrained||!at&&1===nt.length){for(c=0;c<J.length;c++)J[c].range=J[c]._r.slice(),E(J[c],1-e/K);s=(r=e*tt/K)/2}}rt.isSubplotConstrained&&at||Ut("x"),rt.isSubplotConstrained&&nt||Ut("y");var f=K-e,d=tt-r;!rt.isSubplotConstrained||nt&&at||(nt?(s=o?0:e*tt/K,d=f*tt/K):(o=s?0:r*K/tt,f=d*K/tt)),qt([o,s,f,d]),Vt(),t.emit("plotly_relayouting",ft)}function h(t,e,r){for(var n,a,i=1-e,o=0;o<t.length;o++){var s=t[o];if(!s.fixedrange){n=s,a=s._rl[i]+(s._rl[e]-s._rl[i])/z(r/s._length);var l=s.l2r(a);!1!==l&&void 0!==l&&(s.range[e]=l)}}return n._length*(n._rl[e]-a)/(n._rl[e]-n._rl[i])}}function Ut(t,e){for(var r=rt.isSubplotConstrained?{x:J,y:Z}[t]:rt[t+"axes"],n=rt.isSubplotConstrained?{x:Z,y:J}[t]:[],a=0;a<r.length;a++){var i=r[a],o=i._id,s=rt.xLinks[o]||rt.yLinks[o],l=n[0]||U[s]||Y[s];l&&(e?(e[i._name+".range[0]"]=e[l._name+".range[0]"],e[i._name+".range[1]"]=e[l._name+".range[1]"]):i.range=l.range.slice())}}function Vt(){var e,r=[];function n(t){for(e=0;e<t.length;e++)t[e].fixedrange||r.push(t[e]._id)}for(ot&&(n(Z),n(et.xaxes),n(rt.xaxes)),st&&(n(J),n(et.yaxes),n(rt.yaxes)),ft={},e=0;e<r.length;e++){var a=r[e],i=A(t,a);h.drawOne(t,i,{skipTitle:!0}),ft[i._name+".range[0]"]=i.range[0],ft[i._name+".range[1]"]=i.range[1]}h.redrawComponents(t,r)}function Ht(){if(!t._transitioningWithDuration){var e=t._context.doubleClick,r=[];nt&&(r=r.concat(Z)),at&&(r=r.concat(J)),rt.xaxes&&(r=r.concat(rt.xaxes)),rt.yaxes&&(r=r.concat(rt.yaxes));var n,a,i,s={};if("reset+autosize"===e)for(e="autosize",a=0;a<r.length;a++)if((n=r[a])._rangeInitial&&(n.range[0]!==n._rangeInitial[0]||n.range[1]!==n._rangeInitial[1])||!n._rangeInitial&&!n.autorange){e="reset";break}if("autosize"===e)for(a=0;a<r.length;a++)(n=r[a]).fixedrange||(s[n._name+".autorange"]=!0);else if("reset"===e)for((nt||et.isSubplotConstrained)&&(r=r.concat(et.xaxes)),at&&!et.isSubplotConstrained&&(r=r.concat(et.yaxes)),et.isSubplotConstrained&&(nt?at||(r=r.concat(J)):r=r.concat(Z)),a=0;a<r.length;a++)(n=r[a]).fixedrange||(n._rangeInitial?(i=n._rangeInitial,s[n._name+".range[0]"]=i[0],s[n._name+".range[1]"]=i[1]):s[n._name+".autorange"]=!0);t.emit("plotly_doubleclick",null),o.call("_guiRelayout",t,s)}}function Gt(){qt([0,0,K,tt]),s.syncOrAsync([w.previousPromises,function(){t._fullLayout._replotting=!1,o.call("_guiRelayout",t,ft)}],t)}function qt(e){var r,n,a,i,l=t._fullLayout,u=l._plots,c=l._subplots.cartesian;if(ut&&o.subplotsRegistry.splom.drag(t),lt)for(r=0;r<c.length;r++)if(a=(n=u[c[r]]).xaxis,i=n.yaxis,n._scene){var d=s.simpleMap(a.range,a.r2l),h=s.simpleMap(i.range,i.r2l);n._scene.update({range:[d[0],h[0],d[1],h[1]]})}if((ut||lt)&&(x(t),_(t)),ct){var g=e[2]/O._length,m=e[3]/D._length;for(r=0;r<c.length;r++){a=(n=u[c[r]]).xaxis,i=n.yaxis;var y,b,w,A,T=(ot||rt.isSubplotConstrained)&&!a.fixedrange&&U[a._id],k=(st||rt.isSubplotConstrained)&&!i.fixedrange&&Y[i._id];if(T?(y=g,w=v||rt.isSubplotConstrained?e[0]:Yt(a,y)):rt.xaHash[a._id]?(y=g,w=e[0]*a._length/O._length):rt.yaHash[a._id]?(y=m,w="ns"===at?-e[1]*a._length/D._length:Yt(a,y,{n:"top",s:"bottom"}[at])):w=Wt(a,y=Xt(a,g,m)),k?(b=m,A=p||rt.isSubplotConstrained?e[1]:Yt(i,b)):rt.yaHash[i._id]?(b=m,A=e[1]*i._length/D._length):rt.xaHash[i._id]?(b=g,A="ew"===nt?-e[0]*i._length/O._length:Yt(i,b,{e:"right",w:"left"}[nt])):A=Wt(i,b=Xt(i,g,m)),y||b){y||(y=1),b||(b=1);var M=a._offset-w/y,E=i._offset-A/b;n.clipRect.call(f.setTranslate,w,A).call(f.setScale,y,b),n.plot.call(f.setTranslate,M,E).call(f.setScale,1/y,1/b),y===n.xScaleFactor&&b===n.yScaleFactor||(f.setPointGroupScale(n.zoomScalePts,y,b),f.setTextPointsScale(n.zoomScaleTxt,y,b)),f.hideOutsideRangePoints(n.clipOnAxisFalseTraces,n),n.xScaleFactor=y,n.yScaleFactor=b}}}}function Xt(t,e,r){return t.fixedrange?0:ot&&et.xaHash[t._id]?e:st&&(et.isSubplotConstrained?et.xaHash:et.yaHash)[t._id]?r:0}function Wt(t,e){return e?(t.range=t._r.slice(),E(t,e),Yt(t,e)):0}function Yt(t,e,r){return t._length*(1-e)*b[r||t.constraintoward||"middle"]}return p.length*v.length!=1&&X(bt,(function(e){if(t._context._scrollZoom.cartesian||t._fullLayout._enablescrollzoom){if(Ot(),t._transitioningWithDuration)return e.preventDefault(),void e.stopPropagation();mt(),clearTimeout(zt);var r=-e.deltaY;if(isFinite(r)||(r=e.wheelDelta/10),isFinite(r)){var n,a=Math.exp(-Math.min(Math.max(r,-20),20)/200),i=Bt.draglayer.select(".nsewdrag").node().getBoundingClientRect(),o=(e.clientX-i.left)/i.width,l=(i.bottom-e.clientY)/i.height;if(ot){for(v||(o=.5),n=0;n<Z.length;n++)u(Z[n],o,a);Ut("x"),Ft[2]*=a,Ft[0]+=Ft[2]*o*(1/a-1)}if(st){for(p||(l=.5),n=0;n<J.length;n++)u(J[n],l,a);Ut("y"),Ft[3]*=a,Ft[1]+=Ft[3]*(1-l)*(1/a-1)}qt(Ft),Vt(),t.emit("plotly_relayouting",ft),zt=setTimeout((function(){Ft=[0,0,K,tt],Gt()}),Nt),e.preventDefault()}else s.log("Did not find wheel motion attributes: ",e)}function u(t,e,r){if(!t.fixedrange){var n=s.simpleMap(t.range,t.r2l),a=n[0]+(n[1]-n[0])*e;t.range=n.map((function(e){return t.l2r(a+(e-a)*r)}))}}})),bt},makeDragger:D,makeRectDragger:R,makeZoombox:N,makeCorners:B,updateZoombox:j,xyCorners:G,transitionZoombox:U,removeZoombox:V,showDoubleClickNotifier:H,attachWheelEventHandler:X}},{"../../components/color":368,"../../components/dragelement":387,"../../components/dragelement/helpers":386,"../../components/drawing":390,"../../components/fx":408,"../../constants/alignment":470,"../../lib":498,"../../lib/clear_gl_canvases":484,"../../lib/setcursor":519,"../../lib/svg_text_utils":523,"../../plot_api/subroutines":537,"../../registry":593,"../plots":585,"./axes":547,"./axis_ids":550,"./constants":553,"./scale_zoom":565,"./select":566,d3:86,"has-passive-events":238,tinycolor2:322}],556:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../components/fx"),i=t("../../components/dragelement"),o=t("../../lib/setcursor"),s=t("./dragbox").makeDragBox,l=t("./constants").DRAGGERSIZE;r.initInteractions=function(t){var e=t._fullLayout;if(t._context.staticPlot)n.select(t).selectAll(".drag").remove();else if(e._has("cartesian")||e._has("splom")){Object.keys(e._plots||{}).sort((function(t,r){if((e._plots[t].mainplot&&!0)===(e._plots[r].mainplot&&!0)){var n=t.split("y"),a=r.split("y");return n[0]===a[0]?Number(n[1]||1)-Number(a[1]||1):Number(n[0]||1)-Number(a[0]||1)}return e._plots[t].mainplot?1:-1})).forEach((function(r){var n=e._plots[r],o=n.xaxis,u=n.yaxis;if(!n.mainplot){var c=s(t,n,o._offset,u._offset,o._length,u._length,"ns","ew");c.onmousemove=function(e){t._fullLayout._rehover=function(){t._fullLayout._hoversubplot===r&&t._fullLayout._plots[r]&&a.hover(t,e,r)},a.hover(t,e,r),t._fullLayout._lasthover=c,t._fullLayout._hoversubplot=r},c.onmouseout=function(e){t._dragging||(t._fullLayout._hoversubplot=null,i.unhover(t,e))},t._context.showAxisDragHandles&&(s(t,n,o._offset-l,u._offset-l,l,l,"n","w"),s(t,n,o._offset+o._length,u._offset-l,l,l,"n","e"),s(t,n,o._offset-l,u._offset+u._length,l,l,"s","w"),s(t,n,o._offset+o._length,u._offset+u._length,l,l,"s","e"))}if(t._context.showAxisDragHandles){if(r===o._mainSubplot){var f=o._mainLinePosition;"top"===o.side&&(f-=l),s(t,n,o._offset+.1*o._length,f,.8*o._length,l,"","ew"),s(t,n,o._offset,f,.1*o._length,l,"","w"),s(t,n,o._offset+.9*o._length,f,.1*o._length,l,"","e")}if(r===u._mainSubplot){var d=u._mainLinePosition;"right"!==u.side&&(d-=l),s(t,n,d,u._offset+.1*u._length,l,.8*u._length,"ns",""),s(t,n,d,u._offset+.9*u._length,l,.1*u._length,"s",""),s(t,n,d,u._offset,l,.1*u._length,"n","")}}}));var o=e._hoverlayer.node();o.onmousemove=function(r){r.target=t._fullLayout._lasthover,a.hover(t,r,e._hoversubplot)},o.onclick=function(e){e.target=t._fullLayout._lasthover,a.click(t,e)},o.onmousedown=function(e){t._fullLayout._lasthover.onmousedown(e)},r.updateFx(t)}},r.updateFx=function(t){var e=t._fullLayout,r="pan"===e.dragmode?"move":"crosshair";o(e._draggers,r)}},{"../../components/dragelement":387,"../../components/fx":408,"../../lib/setcursor":519,"./constants":553,"./dragbox":555,d3:86}],557:[function(t,e,r){"use strict";e.exports={clearOutlineControllers:function(t){var e=t._fullLayout._zoomlayer;e&&e.selectAll(".outline-controllers").remove()},clearSelect:function(t){var e=t._fullLayout._zoomlayer;e&&e.selectAll(".select-outline").remove(),t._fullLayout._drawing=!1}}},{}],558:[function(t,e,r){"use strict";var n=t("../../lib").strTranslate;function a(t,e){switch(t.type){case"log":return t.p2d(e);case"date":return t.p2r(e,0,t.calendar);default:return t.p2r(e)}}e.exports={p2r:a,r2p:function(t,e){switch(t.type){case"log":return t.d2p(e);case"date":return t.r2p(e,0,t.calendar);default:return t.r2p(e)}},axValue:function(t){var e="y"===t._id.charAt(0)?1:0;return function(r){return a(t,r[e])}},getTransform:function(t){return n(t.xaxis._offset,t.yaxis._offset)}}},{"../../lib":498}],559:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../lib"),i=t("./axis_ids");e.exports=function(t){return function(e,r){var o=e[t];if(Array.isArray(o))for(var s=n.subplotsRegistry.cartesian,l=s.idRegex,u=r._subplots,c=u.xaxis,f=u.yaxis,d=u.cartesian,h=r._has("cartesian")||r._has("gl2d"),p=0;p<o.length;p++){var g=o[p];if(a.isPlainObject(g)){var v=i.cleanId(g.xref,"x",!1),m=i.cleanId(g.yref,"y",!1),y=l.x.test(v),b=l.y.test(m);if(y||b){h||a.pushUnique(r._basePlotModules,s);var x=!1;y&&-1===c.indexOf(v)&&(c.push(v),x=!0),b&&-1===f.indexOf(m)&&(f.push(m),x=!0),x&&y&&b&&d.push(v+m)}}}}}},{"../../lib":498,"../../registry":593,"./axis_ids":550}],560:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../registry"),i=t("../../lib"),o=t("../plots"),s=t("../../components/drawing"),l=t("../get_data").getModuleCalcData,u=t("./axis_ids"),c=t("./constants"),f=t("../../constants/xmlns_namespaces"),d=i.ensureSingle;function h(t,e,r){return i.ensureSingle(t,e,r,(function(t){t.datum(r)}))}function p(t,e,r,i,o){for(var u,f,d,h=c.traceLayerClasses,p=t._fullLayout,g=p._modules,v=[],m=[],y=0;y<g.length;y++){var b=(u=g[y]).name,x=a.modules[b].categories;if(x.svg){var _=u.layerName||b+"layer",w=u.plot;d=(f=l(r,w))[0],r=f[1],d.length&&v.push({i:h.indexOf(_),className:_,plotMethod:w,cdModule:d}),x.zoomScale&&m.push("."+_)}}v.sort((function(t,e){return t.i-e.i}));var A=e.plot.selectAll("g.mlayer").data(v,(function(t){return t.className}));if(A.enter().append("g").attr("class",(function(t){return t.className})).classed("mlayer",!0).classed("rangeplot",e.isRangePlot),A.exit().remove(),A.order(),A.each((function(r){var a=n.select(this),l=r.className;r.plotMethod(t,e,r.cdModule,a,i,o),-1===c.clipOnAxisFalseQuery.indexOf("."+l)&&s.setClipUrl(a,e.layerClipId,t)})),p._has("scattergl")&&(u=a.getModule("scattergl"),d=l(r,u)[0],u.plot(t,e,d)),!t._context.staticPlot&&(e._hasClipOnAxisFalse&&(e.clipOnAxisFalseTraces=e.plot.selectAll(c.clipOnAxisFalseQuery.join(",")).selectAll(".trace")),m.length)){var T=e.plot.selectAll(m.join(",")).selectAll(".trace");e.zoomScalePts=T.selectAll("path.point"),e.zoomScaleTxt=T.selectAll(".textpoint")}}function g(t,e){var r=e.plotgroup,n=e.id,a=c.layerValue2layerClass[e.xaxis.layer],i=c.layerValue2layerClass[e.yaxis.layer],o=t._fullLayout._hasOnlyLargeSploms;if(e.mainplot){var s=e.mainplotinfo,l=s.plotgroup,f=n+"-x",p=n+"-y";e.gridlayer=s.gridlayer,e.zerolinelayer=s.zerolinelayer,d(s.overlinesBelow,"path",f),d(s.overlinesBelow,"path",p),d(s.overaxesBelow,"g",f),d(s.overaxesBelow,"g",p),e.plot=d(s.overplot,"g",n),d(s.overlinesAbove,"path",f),d(s.overlinesAbove,"path",p),d(s.overaxesAbove,"g",f),d(s.overaxesAbove,"g",p),e.xlines=l.select(".overlines-"+a).select("."+f),e.ylines=l.select(".overlines-"+i).select("."+p),e.xaxislayer=l.select(".overaxes-"+a).select("."+f),e.yaxislayer=l.select(".overaxes-"+i).select("."+p)}else if(o)e.xlines=d(r,"path","xlines-above"),e.ylines=d(r,"path","ylines-above"),e.xaxislayer=d(r,"g","xaxislayer-above"),e.yaxislayer=d(r,"g","yaxislayer-above");else{var g=d(r,"g","layer-subplot");e.shapelayer=d(g,"g","shapelayer"),e.imagelayer=d(g,"g","imagelayer"),e.gridlayer=d(r,"g","gridlayer"),e.zerolinelayer=d(r,"g","zerolinelayer"),d(r,"path","xlines-below"),d(r,"path","ylines-below"),e.overlinesBelow=d(r,"g","overlines-below"),d(r,"g","xaxislayer-below"),d(r,"g","yaxislayer-below"),e.overaxesBelow=d(r,"g","overaxes-below"),e.plot=d(r,"g","plot"),e.overplot=d(r,"g","overplot"),e.xlines=d(r,"path","xlines-above"),e.ylines=d(r,"path","ylines-above"),e.overlinesAbove=d(r,"g","overlines-above"),d(r,"g","xaxislayer-above"),d(r,"g","yaxislayer-above"),e.overaxesAbove=d(r,"g","overaxes-above"),e.xlines=r.select(".xlines-"+a),e.ylines=r.select(".ylines-"+i),e.xaxislayer=r.select(".xaxislayer-"+a),e.yaxislayer=r.select(".yaxislayer-"+i)}o||(h(e.gridlayer,"g",e.xaxis._id),h(e.gridlayer,"g",e.yaxis._id),e.gridlayer.selectAll("g").map((function(t){return t[0]})).sort(u.idSort)),e.xlines.style("fill","none").classed("crisp",!0),e.ylines.style("fill","none").classed("crisp",!0)}function v(t,e){if(t){var r={};for(var a in t.each((function(t){var a=t[0];n.select(this).remove(),m(a,e),r[a]=!0})),e._plots)for(var i=e._plots[a].overlays||[],o=0;o<i.length;o++){var s=i[o];r[s.id]&&s.plot.selectAll(".trace").remove()}}}function m(t,e){e._draggers.selectAll("g."+t).remove(),e._defs.select("#clip"+e._uid+t+"plot").remove()}r.name="cartesian",r.attr=["xaxis","yaxis"],r.idRoot=["x","y"],r.idRegex=c.idRegex,r.attrRegex=c.attrRegex,r.attributes=t("./attributes"),r.layoutAttributes=t("./layout_attributes"),r.supplyLayoutDefaults=t("./layout_defaults"),r.transitionAxes=t("./transition_axes"),r.finalizeSubplots=function(t,e){var r,n,a,o=e._subplots,s=o.xaxis,l=o.yaxis,f=o.cartesian,d=f.concat(o.gl2d||[]),h={},p={};for(r=0;r<d.length;r++){var g=d[r].split("y");h[g[0]]=1,p["y"+g[1]]=1}for(r=0;r<s.length;r++)h[n=s[r]]||(a=(t[u.id2name(n)]||{}).anchor,c.idRegex.y.test(a)||(a="y"),f.push(n+a),d.push(n+a),p[a]||(p[a]=1,i.pushUnique(l,a)));for(r=0;r<l.length;r++)p[a=l[r]]||(n=(t[u.id2name(a)]||{}).anchor,c.idRegex.x.test(n)||(n="x"),f.push(n+a),d.push(n+a),h[n]||(h[n]=1,i.pushUnique(s,n)));if(!d.length){for(var v in n="",a="",t){if(c.attrRegex.test(v))"x"===v.charAt(0)?(!n||+v.substr(5)<+n.substr(5))&&(n=v):(!a||+v.substr(5)<+a.substr(5))&&(a=v)}n=n?u.name2id(n):"x",a=a?u.name2id(a):"y",s.push(n),l.push(a),f.push(n+a)}},r.plot=function(t,e,r,n){var a,i=t._fullLayout,o=i._subplots.cartesian,s=t.calcdata;if(!Array.isArray(e))for(e=[],a=0;a<s.length;a++)e.push(a);for(a=0;a<o.length;a++){for(var l,u=o[a],c=i._plots[u],f=[],d=0;d<s.length;d++){var h=s[d],g=h[0].trace;g.xaxis+g.yaxis===u&&((-1!==e.indexOf(g.index)||g.carpet)&&(l&&l[0].trace.xaxis+l[0].trace.yaxis===u&&-1!==["tonextx","tonexty","tonext"].indexOf(g.fill)&&-1===f.indexOf(l)&&f.push(l),f.push(h)),l=h)}p(t,c,f,r,n)}},r.clean=function(t,e,r,n){var a,i,o,s=n._plots||{},l=e._plots||{},c=n._subplots||{};if(n._hasOnlyLargeSploms&&!e._hasOnlyLargeSploms)for(o in s)(a=s[o]).plotgroup&&a.plotgroup.remove();var f=n._has&&n._has("gl"),d=e._has&&e._has("gl");if(f&&!d)for(o in s)(a=s[o])._scene&&a._scene.destroy();if(c.xaxis&&c.yaxis){var h=u.listIds({_fullLayout:n});for(i=0;i<h.length;i++){var p=h[i];e[u.id2name(p)]||n._infolayer.selectAll(".g-"+p+"title").remove()}}var g=n._has&&n._has("cartesian"),y=e._has&&e._has("cartesian");if(g&&!y)v(n._cartesianlayer.selectAll(".subplot"),n),n._defs.selectAll(".axesclip").remove(),delete n._axisConstraintGroups,delete n._axisMatchGroups;else if(c.cartesian)for(i=0;i<c.cartesian.length;i++){var b=c.cartesian[i];if(!l[b]){var x="."+b+",."+b+"-x,."+b+"-y";n._cartesianlayer.selectAll(x).remove(),m(b,n)}}},r.drawFramework=function(t){var e=t._fullLayout,r=function(t){var e,r,n,a,i,o,s=t._fullLayout,l=s._subplots.cartesian,u=l.length,c=[],f=[];for(e=0;e<u;e++){n=l[e],a=s._plots[n],i=a.xaxis,o=a.yaxis;var d=i._mainAxis,h=o._mainAxis,p=d._id+h._id,g=s._plots[p];a.overlays=[],p!==n&&g?(a.mainplot=p,a.mainplotinfo=g,f.push(n)):(a.mainplot=void 0,a.mainplotinfo=void 0,c.push(n))}for(e=0;e<f.length;e++)n=f[e],(a=s._plots[n]).mainplotinfo.overlays.push(a);var v=c.concat(f),m=new Array(u);for(e=0;e<u;e++){n=v[e],a=s._plots[n],i=a.xaxis,o=a.yaxis;var y=[n,i.layer,o.layer,i.overlaying||"",o.overlaying||""];for(r=0;r<a.overlays.length;r++)y.push(a.overlays[r].id);m[e]=y}return m}(t),a=e._cartesianlayer.selectAll(".subplot").data(r,String);a.enter().append("g").attr("class",(function(t){return"subplot "+t[0]})),a.order(),a.exit().call(v,e),a.each((function(r){var a=r[0],i=e._plots[a];i.plotgroup=n.select(this),g(t,i),i.draglayer=d(e._draggers,"g",a)}))},r.rangePlot=function(t,e,r){g(t,e),p(t,e,r),o.style(t)},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:f.svg,"xlink:href":t,preserveAspectRatio:"none",x:0,y:0,width:this.width,height:this.height})}))},r.updateFx=t("./graph_interact").updateFx},{"../../components/drawing":390,"../../constants/xmlns_namespaces":476,"../../lib":498,"../../registry":593,"../get_data":577,"../plots":585,"./attributes":545,"./axis_ids":550,"./constants":553,"./graph_interact":556,"./layout_attributes":561,"./layout_defaults":562,"./transition_axes":571,d3:86}],561:[function(t,e,r){"use strict";var n=t("../font_attributes"),a=t("../../components/color/attributes"),i=t("../../components/drawing/attributes").dash,o=t("../../lib/extend").extendFlat,s=t("../../plot_api/plot_template").templatedArray,l=(t("../../constants/docs").FORMAT_LINK,t("../../constants/docs").DATE_FORMAT_LINK,t("../../constants/numerical").ONEDAY),u=t("./constants"),c=u.HOUR_PATTERN,f=u.WEEKDAY_PATTERN;e.exports={visible:{valType:"boolean",editType:"plot"},color:{valType:"color",dflt:a.defaultLine,editType:"ticks"},title:{text:{valType:"string",editType:"ticks"},font:n({editType:"ticks"}),standoff:{valType:"number",min:0,editType:"ticks"},editType:"ticks"},type:{valType:"enumerated",values:["-","linear","log","date","category","multicategory"],dflt:"-",editType:"calc",_noTemplating:!0},autotypenumbers:{valType:"enumerated",values:["convert types","strict"],dflt:"convert types",editType:"calc"},autorange:{valType:"enumerated",values:[!0,!1,"reversed"],dflt:!0,editType:"axrange",impliedEdits:{"range[0]":void 0,"range[1]":void 0}},rangemode:{valType:"enumerated",values:["normal","tozero","nonnegative"],dflt:"normal",editType:"plot"},range:{valType:"info_array",items:[{valType:"any",editType:"axrange",impliedEdits:{"^autorange":!1},anim:!0},{valType:"any",editType:"axrange",impliedEdits:{"^autorange":!1},anim:!0}],editType:"axrange",impliedEdits:{autorange:!1},anim:!0},fixedrange:{valType:"boolean",dflt:!1,editType:"calc"},scaleanchor:{valType:"enumerated",values:[u.idRegex.x.toString(),u.idRegex.y.toString()],editType:"plot"},scaleratio:{valType:"number",min:0,dflt:1,editType:"plot"},constrain:{valType:"enumerated",values:["range","domain"],editType:"plot"},constraintoward:{valType:"enumerated",values:["left","center","right","top","middle","bottom"],editType:"plot"},matches:{valType:"enumerated",values:[u.idRegex.x.toString(),u.idRegex.y.toString()],editType:"calc"},rangebreaks:s("rangebreak",{enabled:{valType:"boolean",dflt:!0,editType:"calc"},bounds:{valType:"info_array",items:[{valType:"any",editType:"calc"},{valType:"any",editType:"calc"}],editType:"calc"},pattern:{valType:"enumerated",values:[f,c,""],editType:"calc"},values:{valType:"info_array",freeLength:!0,editType:"calc",items:{valType:"any",editType:"calc"}},dvalue:{valType:"number",editType:"calc",min:0,dflt:l},editType:"calc"}),tickmode:{valType:"enumerated",values:["auto","linear","array"],editType:"ticks",impliedEdits:{tick0:void 0,dtick:void 0}},nticks:{valType:"integer",min:0,dflt:0,editType:"ticks"},tick0:{valType:"any",editType:"ticks",impliedEdits:{tickmode:"linear"}},dtick:{valType:"any",editType:"ticks",impliedEdits:{tickmode:"linear"}},tickvals:{valType:"data_array",editType:"ticks"},ticktext:{valType:"data_array",editType:"ticks"},ticks:{valType:"enumerated",values:["outside","inside",""],editType:"ticks"},tickson:{valType:"enumerated",values:["labels","boundaries"],dflt:"labels",editType:"ticks"},ticklabelmode:{valType:"enumerated",values:["instant","period"],dflt:"instant",editType:"ticks"},ticklabelposition:{valType:"enumerated",values:["outside","inside","outside top","inside top","outside left","inside left","outside right","inside right","outside bottom","inside bottom"],dflt:"outside",editType:"calc"},mirror:{valType:"enumerated",values:[!0,"ticks",!1,"all","allticks"],dflt:!1,editType:"ticks+layoutstyle"},ticklen:{valType:"number",min:0,dflt:5,editType:"ticks"},tickwidth:{valType:"number",min:0,dflt:1,editType:"ticks"},tickcolor:{valType:"color",dflt:a.defaultLine,editType:"ticks"},showticklabels:{valType:"boolean",dflt:!0,editType:"ticks"},automargin:{valType:"boolean",dflt:!1,editType:"ticks"},showspikes:{valType:"boolean",dflt:!1,editType:"modebar"},spikecolor:{valType:"color",dflt:null,editType:"none"},spikethickness:{valType:"number",dflt:3,editType:"none"},spikedash:o({},i,{dflt:"dash",editType:"none"}),spikemode:{valType:"flaglist",flags:["toaxis","across","marker"],dflt:"toaxis",editType:"none"},spikesnap:{valType:"enumerated",values:["data","cursor","hovered data"],dflt:"data",editType:"none"},tickfont:n({editType:"ticks"}),tickangle:{valType:"angle",dflt:"auto",editType:"ticks"},tickprefix:{valType:"string",dflt:"",editType:"ticks"},showtickprefix:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",editType:"ticks"},ticksuffix:{valType:"string",dflt:"",editType:"ticks"},showticksuffix:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",editType:"ticks"},showexponent:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",editType:"ticks"},exponentformat:{valType:"enumerated",values:["none","e","E","power","SI","B"],dflt:"B",editType:"ticks"},minexponent:{valType:"number",dflt:3,min:0,editType:"ticks"},separatethousands:{valType:"boolean",dflt:!1,editType:"ticks"},tickformat:{valType:"string",dflt:"",editType:"ticks"},tickformatstops:s("tickformatstop",{enabled:{valType:"boolean",dflt:!0,editType:"ticks"},dtickrange:{valType:"info_array",items:[{valType:"any",editType:"ticks"},{valType:"any",editType:"ticks"}],editType:"ticks"},value:{valType:"string",dflt:"",editType:"ticks"},editType:"ticks"}),hoverformat:{valType:"string",dflt:"",editType:"none"},showline:{valType:"boolean",dflt:!1,editType:"ticks+layoutstyle"},linecolor:{valType:"color",dflt:a.defaultLine,editType:"layoutstyle"},linewidth:{valType:"number",min:0,dflt:1,editType:"ticks+layoutstyle"},showgrid:{valType:"boolean",editType:"ticks"},gridcolor:{valType:"color",dflt:a.lightLine,editType:"ticks"},gridwidth:{valType:"number",min:0,dflt:1,editType:"ticks"},zeroline:{valType:"boolean",editType:"ticks"},zerolinecolor:{valType:"color",dflt:a.defaultLine,editType:"ticks"},zerolinewidth:{valType:"number",dflt:1,editType:"ticks"},showdividers:{valType:"boolean",dflt:!0,editType:"ticks"},dividercolor:{valType:"color",dflt:a.defaultLine,editType:"ticks"},dividerwidth:{valType:"number",dflt:1,editType:"ticks"},anchor:{valType:"enumerated",values:["free",u.idRegex.x.toString(),u.idRegex.y.toString()],editType:"plot"},side:{valType:"enumerated",values:["top","bottom","left","right"],editType:"plot"},overlaying:{valType:"enumerated",values:["free",u.idRegex.x.toString(),u.idRegex.y.toString()],editType:"plot"},layer:{valType:"enumerated",values:["above traces","below traces"],dflt:"above traces",editType:"plot"},domain:{valType:"info_array",items:[{valType:"number",min:0,max:1,editType:"plot"},{valType:"number",min:0,max:1,editType:"plot"}],dflt:[0,1],editType:"plot"},position:{valType:"number",min:0,max:1,dflt:0,editType:"plot"},categoryorder:{valType:"enumerated",values:["trace","category ascending","category descending","array","total ascending","total descending","min ascending","min descending","max ascending","max descending","sum ascending","sum descending","mean ascending","mean descending","median ascending","median descending"],dflt:"trace",editType:"calc"},categoryarray:{valType:"data_array",editType:"calc"},uirevision:{valType:"any",editType:"none"},editType:"calc",_deprecated:{autotick:{valType:"boolean",editType:"ticks"},title:{valType:"string",editType:"ticks"},titlefont:n({editType:"ticks"})}}},{"../../components/color/attributes":367,"../../components/drawing/attributes":389,"../../constants/docs":472,"../../constants/numerical":475,"../../lib/extend":490,"../../plot_api/plot_template":536,"../font_attributes":575,"./constants":553}],562:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../components/color"),i=t("../../components/fx/helpers").isUnifiedHover,o=t("../../components/fx/hovermode_defaults"),s=t("../../plot_api/plot_template"),l=t("../layout_attributes"),u=t("./layout_attributes"),c=t("./type_defaults"),f=t("./axis_defaults"),d=t("./constraints"),h=t("./position_defaults"),p=t("./axis_ids"),g=p.id2name,v=p.name2id,m=t("./constants").AX_ID_PATTERN,y=t("../../registry"),b=y.traceIs,x=y.getComponentMethod;function _(t,e,r){Array.isArray(t[e])?t[e].push(r):t[e]=[r]}e.exports=function(t,e,r){var y,w,A=e.autotypenumbers,T={},k={},M={},E={},S={},C={},L={},O={},D={},R={};for(y=0;y<r.length;y++){var I=r[y];if(b(I,"cartesian")||b(I,"gl2d")){var P,F;if(I.xaxis)P=g(I.xaxis),_(T,P,I);else if(I.xaxes)for(w=0;w<I.xaxes.length;w++)_(T,g(I.xaxes[w]),I);if(I.yaxis)F=g(I.yaxis),_(T,F,I);else if(I.yaxes)for(w=0;w<I.yaxes.length;w++)_(T,g(I.yaxes[w]),I);if("funnel"===I.type?"h"===I.orientation?(P&&(k[P]=!0),F&&(L[F]=!0)):F&&(M[F]=!0):"image"===I.type?(F&&(O[F]=!0),P&&(O[P]=!0)):(F&&(S[F]=!0,C[F]=!0),b(I,"carpet")&&("carpet"!==I.type||I._cheater)||P&&(E[P]=!0)),"carpet"===I.type&&I._cheater&&P&&(k[P]=!0),b(I,"2dMap")&&(D[P]=!0,D[F]=!0),b(I,"oriented"))R["h"===I.orientation?F:P]=!0}}var z=e._subplots,N=z.xaxis,B=z.yaxis,j=n.simpleMap(N,g),U=n.simpleMap(B,g),V=j.concat(U),H=a.background;N.length&&B.length&&(H=n.coerce(t,e,l,"plot_bgcolor"));var G,q,X,W,Y,Z=a.combine(H,e.paper_bgcolor);function J(){var t=T[G]||[];Y._traceIndices=t.map((function(t){return t._expandedIndex})),Y._annIndices=[],Y._shapeIndices=[],Y._imgIndices=[],Y._subplotsWith=[],Y._counterAxes=[],Y._name=Y._attr=G,Y._id=q}function Q(t,e){return n.coerce(W,Y,u,t,e)}function $(t,e){return n.coerce2(W,Y,u,t,e)}function K(t){return"x"===t?B:N}function tt(e,r){for(var n="x"===e?j:U,a=[],i=0;i<n.length;i++){var o=n[i];o===r||(t[o]||{}).overlaying||a.push(v(o))}return a}var et={x:K("x"),y:K("y")},rt=et.x.concat(et.y),nt={},at=[];function it(){var t=W.matches;m.test(t)&&-1===rt.indexOf(t)&&(nt[t]=W.type,at=Object.keys(nt))}var ot=o(t,e,r),st=i(ot);for(y=0;y<V.length;y++){G=V[y],q=v(G),X=G.charAt(0),n.isPlainObject(t[G])||(t[G]={}),W=t[G],Y=s.newContainer(e,G,X+"axis"),J();var lt="x"===X&&!E[G]&&k[G]||"y"===X&&!S[G]&&M[G],ut="y"===X&&(!C[G]&&L[G]||O[G]),ct={letter:X,font:e.font,outerTicks:D[G],showGrid:!R[G],data:T[G]||[],bgColor:Z,calendar:e.calendar,automargin:!0,visibleDflt:lt,reverseDflt:ut,autotypenumbersDflt:A,splomStash:((e._splomAxes||{})[X]||{})[q]};Q("uirevision",e.uirevision),c(W,Y,Q,ct),f(W,Y,Q,ct,e);var ft=st&&X===ot.charAt(0),dt=$("spikecolor",st?Y.color:void 0),ht=$("spikethickness",st?1.5:void 0),pt=$("spikedash",st?"dot":void 0),gt=$("spikemode",st?"across":void 0),vt=$("spikesnap",st?"hovered data":void 0);Q("showspikes",!!(ft||dt||ht||pt||gt||vt))||(delete Y.spikecolor,delete Y.spikethickness,delete Y.spikedash,delete Y.spikemode,delete Y.spikesnap),h(W,Y,Q,{letter:X,counterAxes:et[X],overlayableAxes:tt(X,G),grid:e.grid}),Q("title.standoff"),it(),Y._input=W}for(y=0;y<at.length;){q=at[y++],X=(G=g(q)).charAt(0),n.isPlainObject(t[G])||(t[G]={}),W=t[G],Y=s.newContainer(e,G,X+"axis"),J();var mt={letter:X,font:e.font,outerTicks:D[G],showGrid:!R[G],data:[],bgColor:Z,calendar:e.calendar,automargin:!0,visibleDflt:!1,reverseDflt:!1,autotypenumbersDflt:A,splomStash:((e._splomAxes||{})[X]||{})[q]};Q("uirevision",e.uirevision),Y.type=nt[q]||"linear",f(W,Y,Q,mt,e),h(W,Y,Q,{letter:X,counterAxes:et[X],overlayableAxes:tt(X,G),grid:e.grid}),Q("fixedrange"),it(),Y._input=W}var yt=x("rangeslider","handleDefaults"),bt=x("rangeselector","handleDefaults");for(y=0;y<j.length;y++)G=j[y],W=t[G],Y=e[G],yt(t,e,G),"date"===Y.type&&bt(W,Y,e,U,Y.calendar),Q("fixedrange");for(y=0;y<U.length;y++){G=U[y],W=t[G],Y=e[G];var xt=e[g(Y.anchor)];Q("fixedrange",x("rangeslider","isVisible")(xt))}d.handleDefaults(t,e,{axIds:rt.concat(at).sort(p.idSort),axHasImage:O})}},{"../../components/color":368,"../../components/fx/helpers":404,"../../components/fx/hovermode_defaults":407,"../../lib":498,"../../plot_api/plot_template":536,"../../registry":593,"../layout_attributes":583,"./axis_defaults":549,"./axis_ids":550,"./constants":553,"./constraints":554,"./layout_attributes":561,"./position_defaults":564,"./type_defaults":572}],563:[function(t,e,r){"use strict";var n=t("tinycolor2").mix,a=t("../../components/color/attributes").lightFraction,i=t("../../lib");e.exports=function(t,e,r,o){var s=(o=o||{}).dfltColor;function l(r,n){return i.coerce2(t,e,o.attributes,r,n)}var u=l("linecolor",s),c=l("linewidth");r("showline",o.showLine||!!u||!!c)||(delete e.linecolor,delete e.linewidth);var f=l("gridcolor",n(s,o.bgColor,o.blend||a).toRgbString()),d=l("gridwidth");if(r("showgrid",o.showGrid||!!f||!!d)||(delete e.gridcolor,delete e.gridwidth),!o.noZeroLine){var h=l("zerolinecolor",s),p=l("zerolinewidth");r("zeroline",o.showGrid||!!h||!!p)||(delete e.zerolinecolor,delete e.zerolinewidth)}}},{"../../components/color/attributes":367,"../../lib":498,tinycolor2:322}],564:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib");e.exports=function(t,e,r,i){var o,s,l,u,c=i.counterAxes||[],f=i.overlayableAxes||[],d=i.letter,h=i.grid;h&&(s=h._domains[d][h._axisMap[e._id]],o=h._anchors[e._id],s&&(l=h[d+"side"].split(" ")[0],u=h.domain[d]["right"===l||"top"===l?1:0])),s=s||[0,1],o=o||(n(t.position)?"free":c[0]||"free"),l=l||("x"===d?"bottom":"left"),u=u||0,"free"===a.coerce(t,e,{anchor:{valType:"enumerated",values:["free"].concat(c),dflt:o}},"anchor")&&r("position",u),a.coerce(t,e,{side:{valType:"enumerated",values:"x"===d?["bottom","top"]:["left","right"],dflt:l}},"side");var p=!1;if(f.length&&(p=a.coerce(t,e,{overlaying:{valType:"enumerated",values:[!1].concat(f),dflt:!1}},"overlaying")),!p){var g=r("domain",s);g[0]>g[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;n<e.length;n++)if(r=e[n],a.fullData._expandedIndex===r.cd[0].trace._expandedIndex){if(!0===a.hoverOnBox)break;void 0!==a.pointNumber?i=a.pointNumber:void 0!==a.binNumber&&(i=a.binNumber,o=a.pointNumbers);break}return{pointNumber:i,pointNumbers:o,searchInfo:r}}(y,s=B(e,r,n,a));if(_.pointNumbers.length>0?function(t,e){var r,n,a,i=[];for(a=0;a<t.length;a++)(r=t[a]).cd[0].trace.selectedpoints&&r.cd[0].trace.selectedpoints.length>0&&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;a<e.pointNumbers.length;a++)if(n.selectedpoints.indexOf(e.pointNumbers[a])<0)return!1;return!0}return!1}(s,_):function(t){var e,r,n,a=0;for(n=0;n<t.length;n++)if(e=t[n],(r=e.cd[0].trace).selectedpoints){if(r.selectedpoints.length>1)return!1;if((a+=r.selectedpoints.length)>1)return!1}return 1===a}(s)&&(d=j(_))){for(o&&o.remove(),m=0;m<s.length;m++)(l=s[m])._module.selectPoints(l,!1);U(e,s),N(i),b&&e.emit("plotly_deselect",null)}else{for(p=t.shiftKey&&(void 0!==d?d:j(_)),u=function(t,e,r){return{pointNumber:t,searchInfo:e,subtract:r}}(_.pointNumber,_.searchInfo,p),c=F(i.selectionDefs.concat([u])),m=0;m<s.length;m++)if(f=V(s[m]._module.selectPoints(s[m],c),s[m]),x.length)for(var w=0;w<f.length;w++)x.push(f[w]);else x=f;if(U(e,s,v={points:x}),u&&i&&i.selectionDefs.push(u),o){var A=i.mergedPolygons,T=h(i.dragmode);g(H(A,T),o,i)}b&&e.emit("plotly_selected",v)}}}function I(t){return"pointNumber"in t&&"searchInfo"in t}function P(t){return{xmin:0,xmax:0,ymin:0,ymax:0,pts:[],contains:function(e,r,n,a){var i=t.searchInfo.cd[0].trace._expandedIndex;return a.cd[0].trace._expandedIndex===i&&n===t.pointNumber},isRect:!1,degenerate:!1,subtract:t.subtract}}function F(t){for(var e=[],r=I(t[0])?0:t[0][0][0],n=r,a=I(t[0])?0:t[0][0][1],i=a,o=0;o<t.length;o++)if(I(t[o]))e.push(P(t[o]));else{var s=b.tester(t[o]);s.subtract=t[o].subtract,e.push(s),r=Math.min(r,s.xmin),n=Math.max(n,s.xmax),a=Math.min(a,s.ymin),i=Math.max(i,s.ymax)}return{xmin:r,xmax:n,ymin:a,ymax:i,pts:[],contains:function(t,r,n,a){for(var i=!1,o=0;o<e.length;o++)e[o].contains(t,r,n,a)&&(i=!1===e[o].subtract);return i},isRect:!1,degenerate:!1}}function z(t,e,r){e._fullLayout._drawing=!1;var n=e._fullLayout,a=r.plotinfo,i=r.dragmode,o=n._lastSelectedSubplot&&n._lastSelectedSubplot===a.id,s=(t.shiftKey||t.altKey)&&!(d(i)&&h(i));o&&s&&a.selection&&a.selection.selectionDefs&&!r.selectionDefs?(r.selectionDefs=a.selection.selectionDefs,r.mergedPolygons=a.selection.mergedPolygons):s&&a.selection||N(r),o||(S(e),n._lastSelectedSubplot=a.id)}function N(t){var e=t.dragmode,r=t.plotinfo,n=t.gd;if(n._fullLayout._activeShapeIndex>=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;o<t.calcdata.length;o++)if(!0===(i=(a=t.calcdata[o])[0].trace).visible&&i._module&&i._module.selectPoints)if(!n||i.subplot!==n&&i.geo!==n)if("splom"===i.type&&i._xaxes[l[0]]&&i._yaxes[u[0]]){var c=d(i._module,a,e[0],r[0]);c.scene=t._fullLayout._splomScenes[i.uid],s.push(c)}else if("sankey"===i.type){var f=d(i._module,a,e[0],r[0]);s.push(f)}else{if(-1===l.indexOf(i.xaxis))continue;if(-1===u.indexOf(i.yaxis))continue;s.push(d(i._module,a,_(t,i.xaxis),_(t,i.yaxis)))}else s.push(d(i._module,a,e[0],r[0]));return s;function d(t,e,r,n){return{_module:t,cd:e,xaxis:r,yaxis:n}}}function j(t){var e=t.searchInfo.cd[0].trace,r=t.pointNumber,n=t.pointNumbers,a=n.length>0?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<e.length;n++){var l=e[n].cd[0].trace._fullInput,u=t._fullLayout._tracePreGUI[l.uid]||{};void 0===u.selectedpoints&&(u.selectedpoints=l._input.selectedpoints||null)}if(r){var c=r.points||[];for(n=0;n<e.length;n++)(s=e[n].cd[0].trace)._input.selectedpoints=s._fullInput.selectedpoints=[],s._fullInput!==s&&(s.selectedpoints=[]);for(n=0;n<c.length;n++){var f=c[n],d=f.data,h=f.fullData;f.pointIndices?([].push.apply(d.selectedpoints,f.pointIndices),s._fullInput!==s&&[].push.apply(h.selectedpoints,f.pointIndices)):(d.selectedpoints.push(f.pointIndex),s._fullInput!==s&&h.selectedpoints.push(f.pointIndex))}}else for(n=0;n<e.length;n++)delete(s=e[n].cd[0].trace).selectedpoints,delete s._input.selectedpoints,s._fullInput!==s&&delete s._fullInput.selectedpoints;var p=!1;for(n=0;n<e.length;n++){s=(o=(i=e[n]).cd)[0].trace,a.traceIs(s,"regl")&&(p=!0);var g=i._module,v=g.styleOnSelect||g.style;v&&(v(t,o,o[0].node3),o[0].nodeRangePlot3&&v(t,o,o[0].nodeRangePlot3))}p&&(w(t),A(t))}function V(t,e){if(Array.isArray(t))for(var r=e.cd,n=e.cd[0].trace,a=0;a<t.length;a++)t[a]=l(t[a],n,r);return t}function H(t,e){for(var r=[],n=0;n<t.length;n++){r[n]=[];for(var a=0;a<t[n].length;a++){r[n][a]=[],r[n][a][0]=a?"L":"M";for(var i=0;i<t[n][a].length;i++)r[n][a].push(t[n][a][i])}e||r[n].push(["Z",r[n][0][1],r[n][0][2]])}return r}e.exports={prepSelect:function(t,e,r,a,l){var u=c(l),m=f(l),b=h(l),_=d(l),w=p(l),A="drawcircle"===l,S="drawline"===l||A,C=a.gd,I=C._fullLayout,P=I._zoomlayer,j=a.element.getBoundingClientRect(),G=a.plotinfo,q=D(G),X=e-j.left,W=r-j.top;I._calcInverseTransform(C);var Y=y.apply3DTransform(I._invTransform)(X,W);X=Y[0],W=Y[1];var Z,J,Q,$,K,tt,et,rt=I._invScaleX,nt=I._invScaleY,at=X,it=W,ot="M"+X+","+W,st=a.xaxes[0]._length,lt=a.yaxes[0]._length,ut=a.xaxes.concat(a.yaxes),ct=t.altKey&&!(d(l)&&b);z(t,C,a),u&&(Z=M([[X,W]],T.BENDPX));var ft=P.selectAll("path.select-outline-"+G.id).data(_?[0]:[1,2]),dt=I.newshape;ft.enter().append("path").attr("class",(function(t){return"select-outline select-outline-"+t+" select-outline-"+G.id})).style(_?{opacity:dt.opacity/2,fill:b?void 0:dt.fillcolor,stroke:dt.line.color,"stroke-dasharray":i(dt.line.dash,dt.line.width),"stroke-width":dt.line.width+"px"}:{}).attr("fill-rule",dt.fillrule).classed("cursor-move",!!_).attr("transform",q).attr("d",ot+"Z");var ht,pt=P.append("path").attr("class","zoombox-corners").style({fill:o.background,stroke:o.defaultLine,"stroke-width":1}).attr("transform",q).attr("d","M0,0Z"),gt=I._uid+T.SELECTID,vt=[],mt=B(C,a.xaxes,a.yaxes,a.subplot);function yt(t,e){return t-e}ht=G.fillRangeItems?G.fillRangeItems:m?function(t,e){var r=t.range={};for(K=0;K<ut.length;K++){var n=ut[K],a=n._id.charAt(0);r[n._id]=[L(n,e[a+"min"]),L(n,e[a+"max"])].sort(yt)}}:function(t,e,r){var n=t.lassoPoints={};for(K=0;K<ut.length;K++){var a=ut[K];n[a._id]=r.filtered.map(O(a))}},a.moveFn=function(t,e){at=Math.max(0,Math.min(st,rt*t+X)),it=Math.max(0,Math.min(lt,nt*e+W));var r=Math.abs(at-X),i=Math.abs(it-W);if(m){var o,s,l;if(w){var c=I.selectdirection;switch(o="any"===c?i<Math.min(.6*r,k)?"h":r<Math.min(.6*i,k)?"v":"d":c){case"h":s=A?lt/2:0,l=lt;break;case"v":s=A?st/2:0,l=st}}if(_)switch(I.newshape.drawdirection){case"vertical":o="h",s=A?lt/2:0,l=lt;break;case"horizontal":o="v",s=A?st/2:0,l=st;break;case"ortho":r<i?(o="h",s=W,l=it):(o="v",s=X,l=at);break;default:o="d"}"h"===o?(($=S?v(A,[at,s],[at,l]):[[X,s],[X,l],[at,l],[at,s]]).xmin=S?at:Math.min(X,at),$.xmax=S?at:Math.max(X,at),$.ymin=Math.min(s,l),$.ymax=Math.max(s,l),pt.attr("d","M"+$.xmin+","+(W-k)+"h-4v"+2*k+"h4ZM"+($.xmax-1)+","+(W-k)+"h4v"+2*k+"h-4Z")):"v"===o?(($=S?v(A,[s,it],[l,it]):[[s,W],[s,it],[l,it],[l,W]]).xmin=Math.min(s,l),$.xmax=Math.max(s,l),$.ymin=S?it:Math.min(W,it),$.ymax=S?it:Math.max(W,it),pt.attr("d","M"+(X-k)+","+$.ymin+"v-4h"+2*k+"v4ZM"+(X-k)+","+($.ymax-1)+"v4h"+2*k+"v-4Z")):"d"===o&&(($=S?v(A,[X,W],[at,it]):[[X,W],[X,it],[at,it],[at,W]]).xmin=Math.min(X,at),$.xmax=Math.max(X,at),$.ymin=Math.min(W,it),$.ymax=Math.max(W,it),pt.attr("d","M0,0Z"))}else u&&(Z.addPt([at,it]),$=Z.filtered);a.selectionDefs&&a.selectionDefs.length?(Q=function(t,e,r){if(r)return n.difference({regions:t,inverted:!1},{regions:[e],inverted:!1}).regions;return n.union({regions:t,inverted:!1},{regions:[e],inverted:!1}).regions}(a.mergedPolygons,$,ct),$.subtract=ct,J=F(a.selectionDefs.concat([$]))):(Q=[$],J=E($)),g(H(Q,b),ft,a),w&&x.throttle(gt,T.SELECTDELAY,(function(){var t;vt=[];var e,r=[];for(K=0;K<mt.length;K++)if(e=(tt=mt[K])._module.selectPoints(tt,J),r.push(e),t=V(e,tt),vt.length)for(var n=0;n<t.length;n++)vt.push(t[n]);else vt=t;U(C,mt,et={points:vt}),ht(et,$,Z),a.gd.emit("plotly_selecting",et)}))},a.clickFn=function(t,e){if(pt.remove(),C._fullLayout._activeShapeIndex>=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<mt.length;K++)(tt=mt[K])._module.selectPoints(tt,!1);U(C,mt),N(a),C.emit("plotly_deselect",null)}else r.indexOf("select")>-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;l<r;l++){var u=a*t._rangebreaks[l].min,c=a*t._rangebreaks[l].max;if(o<u)break;if(!(o>c)){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;a<r&&!(e<t._rangebreaks[a].pmin);a++)e>t._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;a<s.length;a++){var g=n[s[a]];if(d in g){var v=g[d],m=g._length||o.minRowLength(v);if(f(v[0])&&f(v[1]))for(i=0;i<m;i++){var y=v[0][i],b=v[1][i];M(y)&&M(b)&&(p.push([y,b]),y in h[0][1]||(h[0][1][y]=h[0][0]++),b in h[1][1]||(h[1][1][b]=h[1][0]++))}}}for(p.sort((function(t,e){var r=h[0][1],n=r[t[0]]-r[e[0]];if(n)return n;var a=h[1][1];return a[t[1]]-a[e[1]]})),a=0;a<p.length;a++)O(p[a])}),t.fraction2r=function(e){var r=t.r2l(t.range[0]),n=t.r2l(t.range[1]);return t.l2r(r+e*(n-r))},t.r2fraction=function(e){var r=t.r2l(t.range[0]),n=t.r2l(t.range[1]);return(t.r2l(e)-r)/(n-r)},t.cleanRange=function(e,r){r||(r={}),e||(e="range");var n,a,s=o.nestedProperty(t,e).get();if(a=(a="date"===t.type?o.dfltRange(t.calendar):"y"===d?w.DFLTRANGEY:r.dfltRange||w.DFLTRANGEX).slice(),"tozero"!==t.rangemode&&"nonnegative"!==t.rangemode||(a[0]=0),s&&2===s.length)for("date"!==t.type||t.autorange||(s[0]=o.cleanDate(s[0],p,t.calendar),s[1]=o.cleanDate(s[1],p,t.calendar)),n=0;n<2;n++)if("date"===t.type){if(!o.isDateTime(s[n],t.calendar)){t[e]=a;break}if(t.r2l(s[0])===t.r2l(s[1])){var l=o.constrain(t.r2l(s[0]),o.MIN_MS+1e3,o.MAX_MS-1e3);s[0]=t.l2r(l-1e3),s[1]=t.l2r(l+1e3);break}}else{if(!i(s[n])){if(!i(s[1-n])){t[e]=a;break}s[n]=s[1-n]*(n?10:.1)}if(s[n]<-h?s[n]=-h:s[n]>h&&(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;s<t._rangebreaks.length;s++)l=t._rangebreaks[s],t._lBreaks+=Math.abs(l.max-l.min);var h=f;u>c&&(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;s<t._rangebreaks.length;s++)l=t._rangebreaks[s],t._B.push(t._B[t._B.length-1]-p*t._m2*(l.max-l.min));for(s=0;s<t._rangebreaks.length;s++)(l=t._rangebreaks[s]).pmin=z(l.min),l.pmax=z(l.max)}if(!isFinite(t._m)||!isFinite(t._b)||t._length<0)throw e._replotting=!1,new Error("Something went wrong with axis scaling")},t.maskBreaks=function(e){for(var r,n,a,i,l,u=t.rangebreaks||[],c=0;c<u.length;c++){var f=u[c];if(f.enabled)if(f.bounds){var d=f.pattern;switch(n=(r=o.simpleMap(f.bounds,d?s:t.d2c))[0],a=r[1],d){case T:i=(l=new Date(e)).getUTCDay(),n>a&&(a+=7,i<n&&(i+=7));break;case A:i=(l=new Date(e)).getUTCHours()+(l.getUTCMinutes()/60+l.getUTCSeconds()/3600+l.getUTCMilliseconds()/36e5),n>a&&(a+=24,i<n&&(i+=24));break;case"":i=e}if(i>=n&&i<a)return p}else for(var h=o.simpleMap(f.values,t.d2c).sort(o.sorterAsc),g=0;g<h.length;g++)if(a=(n=h[g])+f.dvalue,e>=n&&e<a)return p}return e},t.locateBreaks=function(e,r){var n,a,i,l,u=[];if(!t.rangebreaks)return u;var c=t.rangebreaks.slice().sort((function(t,e){return t.pattern===T&&e.pattern===A?-1:e.pattern===T&&t.pattern===A?1:0})),f=function(t,n){if((t=o.constrain(t,e,r))!==(n=o.constrain(n,e,r))){for(var a=!0,i=0;i<u.length;i++){var s=u[i];t<s.max&&n>=s.min&&(t<s.min&&(s.min=t),n>s.max&&(s.max=n),a=!1)}a&&u.push({min:t,max:n})}};for(n=0;n<c.length;n++){var d=c[n];if(d.enabled)if(d.bounds){var h=e,p=r;d.pattern&&(h=Math.floor(h)),i=(a=o.simpleMap(d.bounds,d.pattern?s:t.r2l))[0],l=a[1];var g,_,w=new Date(h);switch(d.pattern){case T:_=v,g=(l-i+(l<i?7:0))*m,h+=i*m-(w.getUTCDay()*m+w.getUTCHours()*y+w.getUTCMinutes()*b+w.getUTCSeconds()*x+w.getUTCMilliseconds());break;case A:_=m,g=(l-i+(l<i?24:0))*y,h+=i*y-(w.getUTCHours()*y+w.getUTCMinutes()*b+w.getUTCSeconds()*x+w.getUTCMilliseconds());break;default:h=Math.min(a[0],a[1]),g=_=(p=Math.max(a[0],a[1]))-h}for(var k=h;k<p;k+=_)f(k,k+g)}else for(var M=o.simpleMap(d.values,t.d2c),E=0;E<M.length;E++)f(i=M[E],l=i+d.dvalue)}return u.sort((function(t,e){return t.min-e.min})),u},t.makeCalcdata=function(e,r,n){var a,i,s,l,u=t.type,c="date"===u&&e[r+"calendar"];if(r in e){if(a=e[r],l=e._length||o.minRowLength(a),o.isTypedArray(a)&&("linear"===u||"log"===u)){if(l===a.length)return a;if(a.subarray)return a.subarray(0,l)}if("multicategory"===u)return function(t,e){for(var r=new Array(e),n=0;n<e;n++){var a=(t[0]||[])[n],i=(t[1]||[])[n];r[n]=D([a,i])}return r}(a,l);for(i=new Array(l),s=0;s<l;s++)i[s]=t.d2c(a[s],0,c,n)}else{var f=r+"0"in e?t.d2c(e[r+"0"],0,c):0,d=e["d"+r]?Number(e["d"+r]):1;for(a=e[{x:"y",y:"x"}[r]],l=e._length||a.length,i=new Array(l),s=0;s<l;s++)i[s]=f+s*d}if(t.rangebreaks)for(s=0;s<l;s++)i[s]=t.maskBreaks(i[s]);return i},t.isValidRange=function(e){return Array.isArray(e)&&2===e.length&&i(t.r2l(e[0]))&&i(t.r2l(e[1]))},t.isPtWithinRange=function(e,r){var n=t.c2l(e[d],null,r),a=t.r2l(t.range[0]),i=t.r2l(t.range[1]);return a<i?a<=n&&n<=i:i<=n&&n<=a},t._emptyCategories=function(){t._categories=[],t._categoriesMap={}},t.clearCalc=function(){var r=t._matchGroup;if(r){var n=null,a=null;for(var i in r){var o=e[_.id2name(i)];if(o._categories){n=o._categories,a=o._categoriesMap;break}}n&&a?(t._categories=n,t._categoriesMap=a):t._emptyCategories()}else t._emptyCategories();if(t._initialCategories)for(var s=0;s<t._initialCategories.length;s++)O(t._initialCategories[s])},t.sortByInitialCategories=function(){var n=[];if(t._emptyCategories(),t._initialCategories)for(var a=0;a<t._initialCategories.length;a++)O(t._initialCategories[a]);n=n.concat(t._traceIndices);var i=t._matchGroup;for(var o in i)if(r!==o){var s=e[_.id2name(o)];s._categories=t._categories,s._categoriesMap=t._categoriesMap,n=n.concat(s._traceIndices)}return n};var j=e._d3locale;"date"===t.type&&(t._dateFormat=j?j.timeFormat:a,t._extraFormat=e._extraFormat),t._separators=e.separators,t._numFormat=j?j.numberFormat:n.format,delete t._minDtick,delete t._forceTick0}},{"../../constants/numerical":475,"../../lib":498,"./axis_ids":550,"./constants":553,d3:86,"d3-time-format":84,"fast-isnumeric":155}],568:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../components/color").contrast,i=t("./layout_attributes"),o=t("../array_container_defaults");function s(t){var e=["showexponent","showtickprefix","showticksuffix"].filter((function(e){return void 0!==t[e]}));if(e.every((function(r){return t[r]===t[e[0]]}))||1===e.length)return t[e[0]]}function l(t,e){function r(r,a){return n.coerce(t,e,i.tickformatstops,r,a)}r("enabled")&&(r("dtickrange"),r("value"))}e.exports=function(t,e,r,u,c,f){f&&1!==f.pass||function(t,e,r,n,a){var i=s(t);r("tickprefix")&&r("showtickprefix",i);r("ticksuffix",a.tickSuffixDflt)&&r("showticksuffix",i)}(t,0,r,0,c),f&&2!==f.pass||function(t,e,r,u,c){var f=s(t);r("tickprefix")&&r("showtickprefix",f);r("ticksuffix",c.tickSuffixDflt)&&r("showticksuffix",f);if(r("showticklabels")){var d=c.font||{},h=e.color,p=-1!==(e.ticklabelposition||"").indexOf("inside")?a(c.bgColor):h&&h!==i.color.dflt?h:d.color;if(n.coerceFont(r,"tickfont",{family:d.family,size:d.size,color:p}),r("tickangle"),"category"!==u){var g=r("tickformat");o(t,e,{name:"tickformatstops",inclusionAttr:"enabled",handleItemDefaults:l}),e.tickformatstops.length||delete e.tickformatstops,g||"date"===u||(r("showexponent",f),r("exponentformat"),r("minexponent"),r("separatethousands"))}}}(t,e,r,u,c)}},{"../../components/color":368,"../../lib":498,"../array_container_defaults":542,"./layout_attributes":561}],569:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./layout_attributes");e.exports=function(t,e,r,i){var o=n.coerce2(t,e,a,"ticklen"),s=n.coerce2(t,e,a,"tickwidth"),l=n.coerce2(t,e,a,"tickcolor",e.color);r("ticks",i.outerTicks||o||s||l?"outside":"")||(delete e.ticklen,delete e.tickwidth,delete e.tickcolor)}},{"../../lib":498,"./layout_attributes":561}],570:[function(t,e,r){"use strict";var n=t("./clean_ticks"),a=t("../../lib").isArrayOrTypedArray;e.exports=function(t,e,r,i){function o(r){var n=t[r];return void 0!==n?n:(e._template||{})[r]}var s=o("tick0"),l=o("dtick"),u=o("tickvals"),c=r("tickmode",a(u)?"array":l?"linear":"auto");if("auto"===c)r("nticks");else if("linear"===c){var f=e.dtick=n.dtick(l,i);e.tick0=n.tick0(s,i,e.calendar,f)}else if("multicategory"!==i){void 0===r("tickvals")?e.tickmode="auto":r("ticktext")}}},{"../../lib":498,"./clean_ticks":552}],571:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../registry"),i=t("../../lib"),o=t("../../components/drawing"),s=t("./axes");e.exports=function(t,e,r,l){var u=t._fullLayout;if(0!==e.length){var c,f,d,h;l&&(c=l());var p=n.ease(r.easing);return t._transitionData._interruptCallbacks.push((function(){return window.cancelAnimationFrame(h),h=null,function(){for(var r={},n=0;n<e.length;n++){var i=e[n],o=i.plotinfo.xaxis,s=i.plotinfo.yaxis;i.xr0&&(r[o._name+".range"]=i.xr0.slice()),i.yr0&&(r[s._name+".range"]=i.yr0.slice())}return a.call("relayout",t,r).then((function(){for(var t=0;t<e.length;t++)g(e[t].plotinfo)}))}()})),f=Date.now(),h=window.requestAnimationFrame((function n(){d=Date.now();for(var i=Math.min(1,(d-f)/r.duration),o=p(i),s=0;s<e.length;s++)v(e[s],o);d-f>r.duration?(!function(){for(var r={},n=0;n<e.length;n++){var i=e[n],o=i.plotinfo.xaxis,s=i.plotinfo.yaxis;i.xr1&&(r[o._name+".range"]=i.xr1.slice()),i.yr1&&(r[s._name+".range"]=i.yr1.slice())}c&&c(),a.call("relayout",t,r).then((function(){for(var t=0;t<e.length;t++)g(e[t].plotinfo)}))}(),h=window.cancelAnimationFrame(n)):h=window.requestAnimationFrame(n)})),Promise.resolve()}function g(t){var e=t.xaxis,r=t.yaxis;u._defs.select("#"+t.clipId+"> 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;n<t.length;n++){var a=t[n];if("splom"===a.type&&a._length>0&&(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;r<e.length;r++){var g=e[r];n(g,"box-violin")&&(g[l+"axis"]||l)===s&&(void 0!==g[h]?p.push(g[h][0]):void 0!==g.name?p.push(g.name):p.push("text"),g[c]!==f&&(f=void 0))}t.type=a(p,f,d)}else if("splom"===u.type){var v=u.dimensions[u._axesDim[s]];v.visible&&(t.type=a(v.values,f,d))}else t.type=a(u[l]||[u[l+"0"]],f,d)}(e,s.data),"-"===e.type?e.type="linear":t.type=e.type)}},{"../../registry":593,"./axis_autotype":548}],573:[function(t,e,r){"use strict";var n=t("../registry"),a=t("../lib");function i(t,e,r){var n,i,o,s=!1;if("data"===e.type)n=t._fullData[null!==e.traces?e.traces[0]:0];else{if("layout"!==e.type)return!1;n=t._fullLayout}return i=a.nestedProperty(n,e.prop).get(),(o=r[e.type]=r[e.type]||{}).hasOwnProperty(e.prop)&&o[e.prop]!==i&&(s=!0),o[e.prop]=i,{changed:s,value:i}}function o(t,e){var r=[],n=e[0],i={};if("string"==typeof n)i[n]=e[1];else{if(!a.isPlainObject(n))return r;i=n}return l(i,(function(t,e,n){r.push({type:"layout",prop:t,value:n})}),"",0),r}function s(t,e){var r,n,i,o,s=[];if(n=e[0],i=e[1],r=e[2],o={},"string"==typeof n)o[n]=i;else{if(!a.isPlainObject(n))return s;o=n,void 0===r&&(r=i)}return void 0===r&&(r=null),l(o,(function(e,n,a){var i,o;if(Array.isArray(a)){o=a.slice();var l=Math.min(o.length,t.data.length);r&&(l=Math.min(l,r.length)),i=[];for(var u=0;u<l;u++)i[u]=r?r[u]:u}else o=a,i=r?r.slice():null;if(null===i)Array.isArray(o)&&(o=o[0]);else if(Array.isArray(i)){if(!Array.isArray(o)){var c=o;o=[];for(var f=0;f<i.length;f++)o[f]=c}o.length=Math.min(i.length,o.length)}s.push({type:"data",prop:e,traces:i,value:o})}),"",0),s}function l(t,e,r,n){Object.keys(t).forEach((function(i){var o=t[i];if("_"!==i[0]){var s=r+(n>0?".":"")+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;f<c.length;f++)t._internalOn(c[f],s.check);s.remove=function(){for(var e=0;e<c.length;e++)t._removeInternalListener(c[e],s.check)}}else a.log("Unable to automatically bind plot updates to API command"),s.lookupTable={},s.remove=function(){};return s.disable=function(){l=!1},s.enable=function(){l=!0},e&&(e._commandObserver=s),s},r.hasSimpleAPICommandBindings=function(t,e,n){var a,i,o=e.length;for(a=0;a<o;a++){var s,l=e[a],u=l.method,c=l.args;if(Array.isArray(c)||(c=[]),!u)return!1;var f=r.computeAPICommandBindings(t,u,c);if(1!==f.length)return!1;if(i){if((s=f[0]).type!==i.type)return!1;if(s.prop!==i.prop)return!1;if(Array.isArray(i.traces)){if(!Array.isArray(s.traces))return!1;s.traces.sort();for(var d=0;d<i.traces.length;d++)if(i.traces[d]!==s.traces[d])return!1}else if(s.prop!==i.prop)return!1}else i=f[0],Array.isArray(i.traces)&&i.traces.sort();var h=(s=f[0]).value;if(Array.isArray(h)){if(1!==h.length)return!1;h=h[0]}n&&(n[h]=a)}return i},r.executeAPICommand=function(t,e,r){if("skip"===e)return Promise.resolve();var i=n.apiMethodRegistry[e],o=[t];Array.isArray(r)||(r=[]);for(var s=0;s<r.length;s++)o.push(r[s]);return i.apply(null,o).catch((function(t){return a.warn("API call to Plotly."+e+" rejected.",t),Promise.reject(t)}))},r.computeAPICommandBindings=function(t,e,r){var n;switch(Array.isArray(r)||(r=[]),e){case"restyle":n=s(t,r);break;case"relayout":n=o(t,r);break;case"update":n=s(t,[r[0],r[2]]).concat(o(t,[r[1]]));break;case"animate":n=function(t,e){return Array.isArray(e[0])&&1===e[0].length&&-1!==["string","number"].indexOf(typeof e[0][0])?[{type:"layout",prop:"_currentFrame",value:e[0][0].toString()}]:[]}(0,r);break;default:n=[]}return n}},{"../lib":498,"../registry":593}],574:[function(t,e,r){"use strict";var n=t("../lib/extend").extendFlat;r.attributes=function(t,e){e=e||{};var r={valType:"info_array",editType:(t=t||{}).editType,items:[{valType:"number",min:0,max:1,editType:t.editType},{valType:"number",min:0,max:1,editType:t.editType}],dflt:[0,1]},a=(t.name&&t.name,t.trace,e.description&&e.description,{x:n({},r,{}),y:n({},r,{}),editType:t.editType});return t.noGridCell||(a.row={valType:"integer",min:0,dflt:0,editType:t.editType},a.column={valType:"integer",min:0,dflt:0,editType:t.editType}),a},r.defaults=function(t,e,r,n){var a=n&&n.x||[0,1],i=n&&n.y||[0,1],o=e.grid;if(o){var s=r("domain.column");void 0!==s&&(s<o.columns?a=o._domains.x[s]:delete t.domain.column);var l=r("domain.row");void 0!==l&&(l<o.rows?i=o._domains.y[l]:delete t.domain.row)}var u=r("domain.x",a),c=r("domain.y",i);u[0]<u[1]||(t.domain.x=a.slice()),c[0]<c[1]||(t.domain.y=i.slice())}},{"../lib/extend":490}],575:[function(t,e,r){"use strict";e.exports=function(t){var e=t.editType,r=t.colorEditType;void 0===r&&(r=e);var n={family:{valType:"string",noBlank:!0,strict:!0,editType:e},size:{valType:"number",min:1,editType:e},color:{valType:"color",editType:r},editType:e};return t.arrayOk&&(n.family.arrayOk=!0,n.size.arrayOk=!0,n.color.arrayOk=!0),n}},{}],576:[function(t,e,r){"use strict";e.exports={_isLinkedToArray:"frames_entry",group:{valType:"string"},name:{valType:"string"},traces:{valType:"any"},baseframe:{valType:"string"},data:{valType:"any"},layout:{valType:"any"}}},{}],577:[function(t,e,r){"use strict";var n=t("../registry"),a=t("./cartesian/constants").SUBPLOT_PATTERN;r.getSubplotCalcData=function(t,e,r){var a=n.subplotsRegistry[e];if(!a)return[];for(var i=a.attr,o=[],s=0;s<t.length;s++){var l=t[s];l[0].trace[i]===r&&o.push(l)}return o},r.getModuleCalcData=function(t,e){var r,a=[],i=[];if(!(r="string"==typeof e?n.getModule(e).plot:"function"==typeof e?e:e.plot))return[a,t];for(var o=0;o<t.length;o++){var s=t[o],l=s[0].trace;!0===l.visible&&0!==l._length&&(l._module.plot===r?a.push(s):i.push(s))}return[a,i]},r.getSubplotData=function(t,e,r){if(!n.subplotsRegistry[e])return[];var i,o,s,l=n.subplotsRegistry[e].attr,u=[];if("gl2d"===e){var c=r.match(a);o="x"+c[1],s="y"+c[2]}for(var f=0;f<t.length;f++)i=t[f],"gl2d"===e&&n.traceIs(i,"gl2d")?i[l[0]]===o&&i[l[1]]===s&&u.push(i):i[l]===r&&u.push(i);return u}},{"../registry":593,"./cartesian/constants":553}],578:[function(t,e,r){"use strict";var n=t("mouse-change"),a=t("mouse-wheel"),i=t("mouse-event-offset"),o=t("../cartesian/constants"),s=t("has-passive-events");function l(t,e){this.element=t,this.plot=e,this.mouseListener=null,this.wheelListener=null,this.lastInputTime=Date.now(),this.lastPos=[0,0],this.boxEnabled=!1,this.boxInited=!1,this.boxStart=[0,0],this.boxEnd=[0,0],this.dragStart=[0,0]}e.exports=function(t){var e=t.mouseContainer,r=t.glplot,u=new l(e,r);function c(){t.xaxis.autorange=!1,t.yaxis.autorange=!1}function f(e,n,a){var i,s,l=t.calcDataBox(),f=r.viewBox,d=u.lastPos[0],h=u.lastPos[1],p=o.MINDRAG*r.pixelRatio,g=o.MINZOOM*r.pixelRatio;function v(e,r,n){var a=Math.min(r,n),i=Math.max(r,n);a!==i?(l[e]=a,l[e+2]=i,u.dataBox=l,t.setRanges(l)):(t.selectBox.selectBox=[0,0,1,1],t.glplot.setDirty())}switch(n*=r.pixelRatio,a*=r.pixelRatio,a=f[3]-f[1]-a,t.fullLayout.dragmode){case"zoom":if(e){var m=n/(f[2]-f[0])*(l[2]-l[0])+l[0],y=a/(f[3]-f[1])*(l[3]-l[1])+l[1];u.boxInited||(u.boxStart[0]=m,u.boxStart[1]=y,u.dragStart[0]=n,u.dragStart[1]=a),u.boxEnd[0]=m,u.boxEnd[1]=y,u.boxInited=!0,u.boxEnabled||u.boxStart[0]===u.boxEnd[0]&&u.boxStart[1]===u.boxEnd[1]||(u.boxEnabled=!0);var b=Math.abs(u.dragStart[0]-n)<g,x=Math.abs(u.dragStart[1]-a)<g;if(!function(){for(var e=t.graphDiv._fullLayout._axisConstraintGroups,r=t.xaxis._id,n=t.yaxis._id,a=0;a<e.length;a++)if(-1!==e[a][r]){if(-1!==e[a][n])return!0;break}return!1}()||b&&x)b&&(u.boxEnd[0]=u.boxStart[0]),x&&(u.boxEnd[1]=u.boxStart[1]);else{i=u.boxEnd[0]-u.boxStart[0],s=u.boxEnd[1]-u.boxStart[1];var _=(l[3]-l[1])/(l[2]-l[0]);Math.abs(i*_)>Math.abs(s)?(u.boxEnd[1]=u.boxStart[1]+Math.abs(i)*_*(s>=0?1:-1),u.boxEnd[1]<l[1]?(u.boxEnd[1]=l[1],u.boxEnd[0]=u.boxStart[0]+(l[1]-u.boxStart[1])/Math.abs(_)):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[0]?(u.boxEnd[0]=l[0],u.boxEnd[1]=u.boxStart[1]+(l[0]-u.boxStart[0])*Math.abs(_)):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)<p&&(n=u.dragStart[0]),Math.abs(u.dragStart[1]-a)<p&&(a=u.dragStart[1]),i=(d-n)*(l[2]-l[0])/(r.viewBox[2]-r.viewBox[0]),s=(h-a)*(l[3]-l[1])/(r.viewBox[3]-r.viewBox[1]),l[0]+=i,l[2]+=i,l[1]+=s,l[3]+=s,t.setRanges(l),u.panning=!0,u.lastInputTime=Date.now(),c(),t.cameraChanged(),t.handleAnnotations()):u.panning&&(u.panning=!1,t.relayoutCallback())}u.lastPos[0]=n,u.lastPos[1]=a}return u.mouseListener=n(e,f),e.addEventListener("touchstart",(function(t){var r=i(t.changedTouches[0],e);f(0,r[0],r[1]),f(1,r[0],r[1]),t.preventDefault()}),!!s&&{passive:!1}),e.addEventListener("touchmove",(function(t){t.preventDefault();var r=i(t.changedTouches[0],e);f(1,r[0],r[1]),t.preventDefault()}),!!s&&{passive:!1}),e.addEventListener("touchend",(function(t){f(0,u.lastPos[0],u.lastPos[1]),t.preventDefault()}),!!s&&{passive:!1}),u.wheelListener=a(e,(function(e,n){if(!t.scrollZoom)return!1;var a=t.calcDataBox(),i=r.viewBox,o=u.lastPos[0],s=u.lastPos[1],l=Math.exp(5*n/(i[3]-i[1])),f=o/(i[2]-i[0])*(a[2]-a[0])+a[0],d=s/(i[3]-i[1])*(a[3]-a[1])+a[1];return a[0]=(a[0]-f)*l+f,a[2]=(a[2]-f)*l+f,a[1]=(a[1]-d)*l+d,a[3]=(a[3]-d)*l+d,t.setRanges(a),u.lastInputTime=Date.now(),c(),t.cameraChanged(),t.handleAnnotations(),t.relayoutCallback(),!0}),!0),u}},{"../cartesian/constants":553,"has-passive-events":238,"mouse-change":253,"mouse-event-offset":254,"mouse-wheel":256}],579:[function(t,e,r){"use strict";var n=t("../cartesian/axes"),a=t("../../lib/str2rgbarray");function i(t){this.scene=t,this.gl=t.gl,this.pixelRatio=t.pixelRatio,this.screenBox=[0,0,1,1],this.viewBox=[0,0,1,1],this.dataBox=[-1,-1,1,1],this.borderLineEnable=[!1,!1,!1,!1],this.borderLineWidth=[1,1,1,1],this.borderLineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.ticks=[[],[]],this.tickEnable=[!0,!0,!1,!1],this.tickPad=[15,15,15,15],this.tickAngle=[0,0,0,0],this.tickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.tickMarkLength=[0,0,0,0],this.tickMarkWidth=[0,0,0,0],this.tickMarkColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.labels=["x","y"],this.labelEnable=[!0,!0,!1,!1],this.labelAngle=[0,Math.PI/2,0,3*Math.PI/2],this.labelPad=[15,15,15,15],this.labelSize=[12,12],this.labelFont=["sans-serif","sans-serif"],this.labelColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.title="",this.titleEnable=!0,this.titleCenter=[0,0,0,0],this.titleAngle=0,this.titleColor=[0,0,0,1],this.titleFont="sans-serif",this.titleSize=18,this.gridLineEnable=[!0,!0],this.gridLineColor=[[0,0,0,.5],[0,0,0,.5]],this.gridLineWidth=[1,1],this.zeroLineEnable=[!0,!0],this.zeroLineWidth=[1,1],this.zeroLineColor=[[0,0,0,1],[0,0,0,1]],this.borderColor=[0,0,0,0],this.backgroundColor=[0,0,0,0],this.static=this.scene.staticPlot}var o=i.prototype,s=["xaxis","yaxis"];o.merge=function(t){var e,r,n,i,o,l,u,c,f,d,h;for(this.titleEnable=!1,this.backgroundColor=a(t.plot_bgcolor),d=0;d<2;++d){var p=(e=s[d]).charAt(0);for(n=(r=t[this.scene[e]._name]).title.text===this.scene.fullLayout._dfltTitle[p]?"":r.title.text,h=0;h<=2;h+=2)this.labelEnable[d+h]=!1,this.labels[d+h]=n,this.labelColor[d+h]=a(r.title.font.color),this.labelFont[d+h]=r.title.font.family,this.labelSize[d+h]=r.title.font.size,this.labelPad[d+h]=this.getLabelPad(e,r),this.tickEnable[d+h]=!1,this.tickColor[d+h]=a((r.tickfont||{}).color),this.tickAngle[d+h]="auto"===r.tickangle?0:Math.PI*-r.tickangle/180,this.tickPad[d+h]=this.getTickPad(r),this.tickMarkLength[d+h]=0,this.tickMarkWidth[d+h]=r.tickwidth||0,this.tickMarkColor[d+h]=a(r.tickcolor),this.borderLineEnable[d+h]=!1,this.borderLineColor[d+h]=a(r.linecolor),this.borderLineWidth[d+h]=r.linewidth||0;u=this.hasSharedAxis(r),o=this.hasAxisInDfltPos(e,r)&&!u,l=this.hasAxisInAltrPos(e,r)&&!u,i=r.mirror||!1,c=u?-1!==String(i).indexOf("all"):!!i,f=u?"allticks"===i:-1!==String(i).indexOf("ticks"),o?this.labelEnable[d]=!0:l&&(this.labelEnable[d+2]=!0),o?this.tickEnable[d]=r.showticklabels:l&&(this.tickEnable[d+2]=r.showticklabels),(o||c)&&(this.borderLineEnable[d]=r.showline),(l||c)&&(this.borderLineEnable[d+2]=r.showline),(o||f)&&(this.tickMarkLength[d]=this.getTickMarkLength(r)),(l||f)&&(this.tickMarkLength[d+2]=this.getTickMarkLength(r)),this.gridLineEnable[d]=r.showgrid,this.gridLineColor[d]=a(r.gridcolor),this.gridLineWidth[d]=r.gridwidth,this.zeroLineEnable[d]=r.zeroline,this.zeroLineColor[d]=a(r.zerolinecolor),this.zeroLineWidth[d]=r.zerolinewidth}},o.hasSharedAxis=function(t){var e=this.scene,r=e.fullLayout._subplots.gl2d;return 0!==n.findSubplotsWithAxis(r,t).indexOf(e.id)},o.hasAxisInDfltPos=function(t,e){var r=e.side;return"xaxis"===t?"bottom"===r:"yaxis"===t?"left"===r:void 0},o.hasAxisInAltrPos=function(t,e){var r=e.side;return"xaxis"===t?"top"===r:"yaxis"===t?"right"===r:void 0},o.getLabelPad=function(t,e){var r=e.title.font.size,n=e.showticklabels;return"xaxis"===t?"top"===e.side?r*(1.5+(n?1:0))-10:r*(1.5+(n?.5:0))-10:"yaxis"===t?"right"===e.side?10+r*(1.5+(n?1:.5)):10+r*(1.5+(n?.5:0)):void 0},o.getTickPad=function(t){return"outside"===t.ticks?10+t.ticklen:15},o.getTickMarkLength=function(t){if(!t.ticks)return 0;var e=t.ticklen;return"inside"===t.ticks?-e:e},e.exports=function(t){return new i(t)}},{"../../lib/str2rgbarray":522,"../cartesian/axes":547}],580:[function(t,e,r){"use strict";var n=t("../../plot_api/edit_types").overrideAll,a=t("./scene2d"),i=t("../layout_attributes"),o=t("../../constants/xmlns_namespaces"),s=t("../cartesian/constants"),l=t("../cartesian"),u=t("../../components/fx/layout_attributes"),c=t("../get_data").getSubplotData;r.name="gl2d",r.attr=["xaxis","yaxis"],r.idRoot=["x","y"],r.idRegex=s.idRegex,r.attrRegex=s.attrRegex,r.attributes=t("../cartesian/attributes"),r.supplyLayoutDefaults=function(t,e,r){e._has("cartesian")||l.supplyLayoutDefaults(t,e,r)},r.layoutAttrOverrides=n(l.layoutAttributes,"plot","from-root"),r.baseLayoutAttrOverrides=n({plot_bgcolor:i.plot_bgcolor,hoverlabel:u.hoverlabel},"plot","nested"),r.plot=function(t){for(var e=t._fullLayout,r=t._fullData,n=e._subplots.gl2d,i=0;i<n.length;i++){var o=n[i],s=e._plots[o],l=c(r,"gl2d",o),u=s._scene2d;void 0===u&&(u=new a({id:o,graphDiv:t,container:t.querySelector(".gl-container"),staticPlot:t._context.staticPlot,plotGlPixelRatio:t._context.plotGlPixelRatio},e),s._scene2d=u),u.plot(l,t.calcdata,e,t.layout)}},r.clean=function(t,e,r,n){for(var a=n._subplots.gl2d||[],i=0;i<a.length;i++){var o=a[i],s=n._plots[o];if(s._scene2d){var u=c(t,"gl2d",o);0===u.length&&(s._scene2d.destroy(),delete n._plots[o])}}l.clean.apply(this,arguments)},r.drawFramework=function(t){t._context.staticPlot||l.drawFramework(t)},r.toSVG=function(t){for(var e=t._fullLayout,r=e._subplots.gl2d,n=0;n<r.length;n++){var a=e._plots[r[n]]._scene2d,i=a.toImage("png");e._glimages.append("svg:image").attr({xmlns:o.svg,"xlink:href":i,x:0,y:0,width:"100%",height:"100%",preserveAspectRatio:"none"}),a.destroy()}},r.updateFx=function(t){for(var e=t._fullLayout,r=e._subplots.gl2d,n=0;n<r.length;n++){e._plots[r[n]]._scene2d.updateFx(e.dragmode)}}},{"../../components/fx/layout_attributes":409,"../../constants/xmlns_namespaces":476,"../../plot_api/edit_types":529,"../cartesian":560,"../cartesian/attributes":545,"../cartesian/constants":553,"../get_data":577,"../layout_attributes":583,"./scene2d":581}],581:[function(t,e,r){"use strict";var n,a,i=t("../../registry"),o=t("../../plots/cartesian/axes"),s=t("../../components/fx"),l=t("gl-plot2d"),u=t("gl-spikes2d"),c=t("gl-select-box"),f=t("webgl-context"),d=t("./convert"),h=t("./camera"),p=t("../../lib/show_no_webgl_msg"),g=t("../cartesian/constraints"),v=g.enforce,m=g.clean,y=t("../cartesian/autorange").doAutoRange,b=t("../../components/dragelement/helpers"),x=b.drawMode,_=b.selectMode,w=["xaxis","yaxis"],A=t("../cartesian/constants").SUBPLOT_PATTERN;function T(t,e){this.container=t.container,this.graphDiv=t.graphDiv,this.pixelRatio=t.plotGlPixelRatio||window.devicePixelRatio,this.id=t.id,this.staticPlot=!!t.staticPlot,this.scrollZoom=this.graphDiv._context._scrollZoom.cartesian,this.fullData=null,this.updateRefs(e),this.makeFramework(),this.stopped||(this.glplotOptions=d(this),this.glplotOptions.merge(e),this.glplot=l(this.glplotOptions),this.camera=h(this),this.traces={},this.spikes=u(this.glplot),this.selectBox=c(this.glplot,{innerFill:!1,outerFill:!0}),this.lastButtonState=0,this.pickResult=null,this.isMouseOver=!0,this.stopped=!1,this.redraw=this.draw.bind(this),this.redraw())}e.exports=T;var k=T.prototype;k.makeFramework=function(){if(this.staticPlot){if(!(a||(n=document.createElement("canvas"),a=f({canvas:n,preserveDrawingBuffer:!1,premultipliedAlpha:!0,antialias:!0}))))throw new Error("Error creating static canvas/context for image server");this.canvas=n,this.gl=a}else{var t=this.container.querySelector(".gl-canvas-focus"),e=f({canvas:t,preserveDrawingBuffer:!0,premultipliedAlpha:!0});if(!e)return p(this),void(this.stopped=!0);this.canvas=t,this.gl=e}var r=this.canvas;r.style.width="100%",r.style.height="100%",r.style.position="absolute",r.style.top="0px",r.style.left="0px",r.style["pointer-events"]="none",this.updateSize(r);var i=this.svgContainer=document.createElementNS("http://www.w3.org/2000/svg","svg");i.style.position="absolute",i.style.top=i.style.left="0px",i.style.width=i.style.height="100%",i.style["z-index"]=20,i.style["pointer-events"]="none";var o=this.mouseContainer=document.createElement("div");o.style.position="absolute",o.style["pointer-events"]="auto",this.pickCanvas=this.container.querySelector(".gl-canvas-pick");var s=this.container;s.appendChild(i),s.appendChild(o);var l=this;o.addEventListener("mouseout",(function(){l.isMouseOver=!1,l.unhover()})),o.addEventListener("mouseover",(function(){l.isMouseOver=!0}))},k.toImage=function(t){t||(t="png"),this.stopped=!0,this.staticPlot&&this.container.appendChild(n),this.updateSize(this.canvas);var e=this.glplot.gl,r=e.drawingBufferWidth,a=e.drawingBufferHeight;e.clearColor(1,1,1,0),e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT),this.glplot.setDirty(),this.glplot.draw(),e.bindFramebuffer(e.FRAMEBUFFER,null);var i=new Uint8Array(r*a*4);e.readPixels(0,0,r,a,e.RGBA,e.UNSIGNED_BYTE,i);for(var o=0,s=a-1;o<s;++o,--s)for(var l=0;l<r;++l)for(var u=0;u<4;++u){var c=i[4*(r*o+l)+u];i[4*(r*o+l)+u]=i[4*(r*s+l)+u],i[4*(r*s+l)+u]=c}var f=document.createElement("canvas");f.width=r,f.height=a;var d,h=f.getContext("2d"),p=h.createImageData(r,a);switch(p.data.set(i),h.putImageData(p,0,0),t){case"jpeg":d=f.toDataURL("image/jpeg");break;case"webp":d=f.toDataURL("image/webp");break;default:d=f.toDataURL("image/png")}return this.staticPlot&&this.container.removeChild(n),d},k.updateSize=function(t){t||(t=this.canvas);var e=this.pixelRatio,r=this.fullLayout,n=r.width,a=r.height,i=0|Math.ceil(e*n),o=0|Math.ceil(e*a);return t.width===i&&t.height===o||(t.width=i,t.height=o),t},k.computeTickMarks=function(){this.xaxis.setScale(),this.yaxis.setScale();for(var t=[o.calcTicks(this.xaxis),o.calcTicks(this.yaxis)],e=0;e<2;++e)for(var r=0;r<t[e].length;++r)t[e][r].text=t[e][r].text+"";return t},k.updateRefs=function(t){this.fullLayout=t;var e=this.id.match(A),r="xaxis"+e[1],n="yaxis"+e[2];this.xaxis=this.fullLayout[r],this.yaxis=this.fullLayout[n]},k.relayoutCallback=function(){var t=this.graphDiv,e=this.xaxis,r=this.yaxis,n=t.layout,a={},o=a[e._name+".range"]=e.range.slice(),s=a[r._name+".range"]=r.range.slice();a[e._name+".autorange"]=e.autorange,a[r._name+".autorange"]=r.autorange,i.call("_storeDirectGUIEdit",t.layout,t._fullLayout._preGUI,a);var l=n[e._name];l.range=o,l.autorange=e.autorange;var u=n[r._name];u.range=s,u.autorange=r.autorange,a.lastInputTime=this.camera.lastInputTime,t.emit("plotly_relayout",a)},k.cameraChanged=function(){var t=this.camera;this.glplot.setDataBox(this.calcDataBox());var e=this.computeTickMarks();(function(t,e){for(var r=0;r<2;++r){var n=t[r],a=e[r];if(n.length!==a.length)return!0;for(var i=0;i<n.length;++i)if(n[i].x!==a[i].x)return!0}return!1})(e,this.glplotOptions.ticks)&&(this.glplotOptions.ticks=e,this.glplotOptions.dataBox=t.dataBox,this.glplot.update(this.glplotOptions),this.handleAnnotations())},k.handleAnnotations=function(){for(var t=this.graphDiv,e=this.fullLayout.annotations,r=0;r<e.length;r++){var n=e[r];n.xref===this.xaxis._id&&n.yref===this.yaxis._id&&i.getComponentMethod("annotations","drawOne")(t,r)}},k.destroy=function(){if(this.glplot){var t=this.traces;t&&Object.keys(t).map((function(e){t[e].dispose(),delete t[e]})),this.glplot.dispose(),this.container.removeChild(this.svgContainer),this.container.removeChild(this.mouseContainer),this.fullData=null,this.glplot=null,this.stopped=!0,this.camera.mouseListener.enabled=!1,this.mouseContainer.removeEventListener("wheel",this.camera.wheelListener),this.camera=null}},k.plot=function(t,e,r){var n=this.glplot;this.updateRefs(r),this.xaxis.clearCalc(),this.yaxis.clearCalc(),this.updateTraces(t,e),this.updateFx(r.dragmode);var a=r.width,i=r.height;this.updateSize(this.canvas);var o=this.glplotOptions;o.merge(r),o.screenBox=[0,0,a,i];var s={_fullLayout:{_axisConstraintGroups:this.graphDiv._fullLayout._axisConstraintGroups,xaxis:this.xaxis,yaxis:this.yaxis}};m(s,this.xaxis),m(s,this.yaxis);var l,u,c=r._size,f=this.xaxis.domain,d=this.yaxis.domain;for(o.viewBox=[c.l+f[0]*c.w,c.b+d[0]*c.h,a-c.r-(1-f[1])*c.w,i-c.t-(1-d[1])*c.h],this.mouseContainer.style.width=c.w*(f[1]-f[0])+"px",this.mouseContainer.style.height=c.h*(d[1]-d[0])+"px",this.mouseContainer.height=c.h*(d[1]-d[0]),this.mouseContainer.style.left=c.l+f[0]*c.w+"px",this.mouseContainer.style.top=c.t+(1-d[1])*c.h+"px",u=0;u<2;++u)(l=this[w[u]])._length=o.viewBox[u+2]-o.viewBox[u],y(this.graphDiv,l),l.setScale();v(s),o.ticks=this.computeTickMarks(),o.dataBox=this.calcDataBox(),o.merge(r),n.update(o),this.glplot.draw()},k.calcDataBox=function(){var t=this.xaxis,e=this.yaxis,r=t.range,n=e.range,a=t.r2l,i=e.r2l;return[a(r[0]),i(n[0]),a(r[1]),i(n[1])]},k.setRanges=function(t){var e=this.xaxis,r=this.yaxis,n=e.l2r,a=r.l2r;e.range=[n(t[0]),n(t[2])],r.range=[a(t[1]),a(t[3])]},k.updateTraces=function(t,e){var r,n,a,i=Object.keys(this.traces);this.fullData=t;t:for(r=0;r<i.length;r++){var o=i[r],s=this.traces[o];for(n=0;n<t.length;n++)if((a=t[n]).uid===o&&a.type===s.type)continue t;s.dispose(),delete this.traces[o]}for(r=0;r<t.length;r++){a=t[r];var l=e[r],u=this.traces[a.uid];u?u.update(a,l):(u=a._module.plot(this,a,l),this.traces[a.uid]=u)}this.glplot.objects.sort((function(t,e){return t._trace.index-e._trace.index}))},k.updateFx=function(t){_(t)||x(t)?(this.pickCanvas.style["pointer-events"]="none",this.mouseContainer.style["pointer-events"]="none"):(this.pickCanvas.style["pointer-events"]="auto",this.mouseContainer.style["pointer-events"]="auto"),this.mouseContainer.style.cursor="pan"===t?"move":"zoom"===t?"crosshair":null},k.emitPointAction=function(t,e){for(var r,n=t.trace.uid,a=t.pointIndex,i=0;i<this.fullData.length;i++)this.fullData[i].uid===n&&(r=this.fullData[i]);var o={x:t.traceCoord[0],y:t.traceCoord[1],curveNumber:r.index,pointNumber:a,data:r._input,fullData:this.fullData,xaxis:this.xaxis,yaxis:this.yaxis};s.appendArrayPointValue(o,r,a),this.graphDiv.emit(e,{points:[o]})},k.draw=function(){if(!this.stopped){requestAnimationFrame(this.redraw);var t=this.glplot,e=this.camera,r=e.mouseListener,n=1===this.lastButtonState&&0===r.buttons,a=this.fullLayout;this.lastButtonState=r.buttons,this.cameraChanged();var i,o=r.x*t.pixelRatio,l=this.canvas.height-t.pixelRatio*r.y;if(e.boxEnabled&&"zoom"===a.dragmode){this.selectBox.enabled=!0;for(var u=this.selectBox.selectBox=[Math.min(e.boxStart[0],e.boxEnd[0]),Math.min(e.boxStart[1],e.boxEnd[1]),Math.max(e.boxStart[0],e.boxEnd[0]),Math.max(e.boxStart[1],e.boxEnd[1])],c=0;c<2;c++)e.boxStart[c]===e.boxEnd[c]&&(u[c]=t.dataBox[c],u[c+2]=t.dataBox[c+2]);t.setDirty()}else if(!e.panning&&this.isMouseOver){this.selectBox.enabled=!1;var f=a._size,d=this.xaxis.domain,h=this.yaxis.domain,p=(i=t.pick(o/t.pixelRatio+f.l+d[0]*f.w,l/t.pixelRatio-(f.t+(1-h[1])*f.h)))&&i.object._trace.handlePick(i);if(p&&n&&this.emitPointAction(p,"plotly_click"),i&&"skip"!==i.object._trace.hoverinfo&&a.hovermode&&p&&(!this.lastPickResult||this.lastPickResult.traceUid!==p.trace.uid||this.lastPickResult.dataCoord[0]!==p.dataCoord[0]||this.lastPickResult.dataCoord[1]!==p.dataCoord[1])){var g=p;this.lastPickResult={traceUid:p.trace?p.trace.uid:null,dataCoord:p.dataCoord.slice()},this.spikes.update({center:i.dataCoord}),g.screenCoord=[((t.viewBox[2]-t.viewBox[0])*(i.dataCoord[0]-t.dataBox[0])/(t.dataBox[2]-t.dataBox[0])+t.viewBox[0])/t.pixelRatio,(this.canvas.height-(t.viewBox[3]-t.viewBox[1])*(i.dataCoord[1]-t.dataBox[1])/(t.dataBox[3]-t.dataBox[1])-t.viewBox[1])/t.pixelRatio],this.emitPointAction(p,"plotly_hover");var v=this.fullData[g.trace.index]||{},m=g.pointIndex,y=s.castHoverinfo(v,a,m);if(y&&"all"!==y){var b=y.split("+");-1===b.indexOf("x")&&(g.traceCoord[0]=void 0),-1===b.indexOf("y")&&(g.traceCoord[1]=void 0),-1===b.indexOf("z")&&(g.traceCoord[2]=void 0),-1===b.indexOf("text")&&(g.textLabel=void 0),-1===b.indexOf("name")&&(g.name=void 0)}s.loneHover({x:g.screenCoord[0],y:g.screenCoord[1],xLabel:this.hoverFormatter("xaxis",g.traceCoord[0]),yLabel:this.hoverFormatter("yaxis",g.traceCoord[1]),zLabel:g.traceCoord[2],text:g.textLabel,name:g.name,color:s.castHoverOption(v,m,"bgcolor")||g.color,borderColor:s.castHoverOption(v,m,"bordercolor"),fontFamily:s.castHoverOption(v,m,"font.family"),fontSize:s.castHoverOption(v,m,"font.size"),fontColor:s.castHoverOption(v,m,"font.color"),nameLength:s.castHoverOption(v,m,"namelength"),textAlign:s.castHoverOption(v,m,"align")},{container:this.svgContainer,gd:this.graphDiv})}}i||this.unhover(),t.draw()}},k.unhover=function(){this.lastPickResult&&(this.spikes.update({}),this.lastPickResult=null,this.graphDiv.emit("plotly_unhover"),s.loneUnhover(this.svgContainer))},k.hoverFormatter=function(t,e){if(void 0!==e){var r=this[t];return o.tickText(r,r.c2l(e),"hover").text}}},{"../../components/dragelement/helpers":386,"../../components/fx":408,"../../lib/show_no_webgl_msg":520,"../../plots/cartesian/axes":547,"../../registry":593,"../cartesian/autorange":546,"../cartesian/constants":553,"../cartesian/constraints":554,"./camera":578,"./convert":579,"gl-plot2d":209,"gl-select-box":215,"gl-spikes2d":224,"webgl-context":349}],582:[function(t,e,r){"use strict";function n(t,e){var r,n,a=[0,0,0,0];for(r=0;r<4;++r)for(n=0;n<4;++n)a[n]+=t[4*r+n]*e[r];return a}e.exports=function(t,e){return n(t.projection,n(t.view,n(t.model,[e[0],e[1],e[2],1])))}},{}],583:[function(t,e,r){"use strict";var n=t("./font_attributes"),a=t("./animation_attributes"),i=t("../components/color/attributes"),o=t("../components/shapes/draw_newshape/attributes"),s=t("./pad_attributes"),l=t("../lib/extend").extendFlat,u=n({editType:"calc"});u.family.dflt='"Open Sans", verdana, arial, sans-serif',u.size.dflt=12,u.color.dflt=i.defaultLine,e.exports={font:u,title:{text:{valType:"string",editType:"layoutstyle"},font:n({editType:"layoutstyle"}),xref:{valType:"enumerated",dflt:"container",values:["container","paper"],editType:"layoutstyle"},yref:{valType:"enumerated",dflt:"container",values:["container","paper"],editType:"layoutstyle"},x:{valType:"number",min:0,max:1,dflt:.5,editType:"layoutstyle"},y:{valType:"number",min:0,max:1,dflt:"auto",editType:"layoutstyle"},xanchor:{valType:"enumerated",dflt:"auto",values:["auto","left","center","right"],editType:"layoutstyle"},yanchor:{valType:"enumerated",dflt:"auto",values:["auto","top","middle","bottom"],editType:"layoutstyle"},pad:l(s({editType:"layoutstyle"}),{}),editType:"layoutstyle"},uniformtext:{mode:{valType:"enumerated",values:[!1,"hide","show"],dflt:!1,editType:"plot"},minsize:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"plot"},autosize:{valType:"boolean",dflt:!1,editType:"none"},width:{valType:"number",min:10,dflt:700,editType:"plot"},height:{valType:"number",min:10,dflt:450,editType:"plot"},margin:{l:{valType:"number",min:0,dflt:80,editType:"plot"},r:{valType:"number",min:0,dflt:80,editType:"plot"},t:{valType:"number",min:0,dflt:100,editType:"plot"},b:{valType:"number",min:0,dflt:80,editType:"plot"},pad:{valType:"number",min:0,dflt:0,editType:"plot"},autoexpand:{valType:"boolean",dflt:!0,editType:"plot"},editType:"plot"},computed:{valType:"any",editType:"none"},paper_bgcolor:{valType:"color",dflt:i.background,editType:"plot"},plot_bgcolor:{valType:"color",dflt:i.background,editType:"layoutstyle"},autotypenumbers:{valType:"enumerated",values:["convert types","strict"],dflt:"convert types",editType:"calc"},separators:{valType:"string",editType:"plot"},hidesources:{valType:"boolean",dflt:!1,editType:"plot"},showlegend:{valType:"boolean",editType:"legend"},colorway:{valType:"colorlist",dflt:i.defaults,editType:"calc"},datarevision:{valType:"any",editType:"calc"},uirevision:{valType:"any",editType:"none"},editrevision:{valType:"any",editType:"none"},selectionrevision:{valType:"any",editType:"none"},template:{valType:"any",editType:"calc"},modebar:{orientation:{valType:"enumerated",values:["v","h"],dflt:"h",editType:"modebar"},bgcolor:{valType:"color",editType:"modebar"},color:{valType:"color",editType:"modebar"},activecolor:{valType:"color",editType:"modebar"},uirevision:{valType:"any",editType:"none"},editType:"modebar"},newshape:o.newshape,activeshape:o.activeshape,meta:{valType:"any",arrayOk:!0,editType:"plot"},transition:l({},a.transition,{editType:"none"}),_deprecated:{title:{valType:"string",editType:"layoutstyle"},titlefont:n({editType:"layoutstyle"})}}},{"../components/color/attributes":367,"../components/shapes/draw_newshape/attributes":450,"../lib/extend":490,"./animation_attributes":541,"./font_attributes":575,"./pad_attributes":584}],584:[function(t,e,r){"use strict";e.exports=function(t){var e=t.editType;return{t:{valType:"number",dflt:0,editType:e},r:{valType:"number",dflt:0,editType:e},b:{valType:"number",dflt:0,editType:e},l:{valType:"number",dflt:0,editType:e},editType:e}}},{}],585:[function(t,e,r){"use strict";var n=t("d3"),a=t("d3-time-format").timeFormatLocale,i=t("fast-isnumeric"),o=t("../registry"),s=t("../plot_api/plot_schema"),l=t("../plot_api/plot_template"),u=t("../lib"),c=t("../components/color"),f=t("../constants/numerical").BADNUM,d=t("./cartesian/axis_ids"),h=t("./cartesian/handle_outline").clearSelect,p=t("./animation_attributes"),g=t("./frame_attributes"),v=t("../plots/get_data").getModuleCalcData,m=u.relinkPrivateKeys,y=u._,b=e.exports={};u.extendFlat(b,o),b.attributes=t("./attributes"),b.attributes.type.values=b.allTypes,b.fontAttrs=t("./font_attributes"),b.layoutAttributes=t("./layout_attributes"),b.fontWeight="normal";var x=b.transformsRegistry,_=t("./command");b.executeAPICommand=_.executeAPICommand,b.computeAPICommandBindings=_.computeAPICommandBindings,b.manageCommandObserver=_.manageCommandObserver,b.hasSimpleAPICommandBindings=_.hasSimpleAPICommandBindings,b.redrawText=function(t){var e=(t=u.getGraphDiv(t))._fullLayout||{};if(!(!(e._has&&e._has("polar"))&&t.data&&t.data[0]&&t.data[0].r))return new Promise((function(e){setTimeout((function(){o.getComponentMethod("annotations","draw")(t),o.getComponentMethod("legend","draw")(t),o.getComponentMethod("colorbar","draw")(t),e(b.previousPromises(t))}),300)}))},b.resize=function(t){var e;t=u.getGraphDiv(t);var r=new Promise((function(r,n){t&&!u.isHidden(t)||n(new Error("Resize must be passed a displayed plot div element.")),t._redrawTimer&&clearTimeout(t._redrawTimer),t._resolveResize&&(e=t._resolveResize),t._resolveResize=r,t._redrawTimer=setTimeout((function(){if(!t.layout||t.layout.width&&t.layout.height||u.isHidden(t))r(t);else{delete t.layout.width,delete t.layout.height;var e=t.changed;t.autoplay=!0,o.call("relayout",t,{autosize:!0}).then((function(){t.changed=e,t._resolveResize===r&&(delete t._resolveResize,r(t))}))}}),100)}));return e&&e(r),r},b.previousPromises=function(t){if((t._promises||[]).length)return Promise.all(t._promises).then((function(){t._promises=[]}))},b.addLinks=function(t){if(t._context.showLink||t._context.showSources){var e=t._fullLayout,r=u.ensureSingle(e._paper,"text","js-plot-link-container",(function(t){t.style({"font-family":'"Open Sans", Arial, sans-serif',"font-size":"12px",fill:c.defaultLine,"pointer-events":"all"}).each((function(){var t=n.select(this);t.append("tspan").classed("js-link-to-tool",!0),t.append("tspan").classed("js-link-spacer",!0),t.append("tspan").classed("js-sourcelinks",!0)}))})),a=r.node(),i={y:e._paper.attr("height")-9};document.body.contains(a)&&a.getComputedTextLength()>=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;i<e.length;i++){var o=e[i];a[o]||(t[o]?a[o]=t[o]:r=!1)}r&&(n=!0)}for(var s=0;s<2;s++){for(var l=t._context.locales,u=0;u<2;u++){var c=(l[r]||{}).format;if(c&&(i(c),n))break;l=o.localeRegistry}var f=r.split("-")[0];if(n||f===r)break;r=f}return n||i(o.localeRegistry.en.format),a}function k(t,e){var r={_fullLayout:e},n="x"===t._id.charAt(0),a=t._mainAxis._anchorAxis,i="",o="",s="";if(a&&(s=a._mainAxis._id,i=n?t._id+s:s+t._id),!i||!e._plots[i]){i="";for(var l=t._counterAxes,u=0;u<l.length;u++){var c=l[u],f=n?t._id+c:c+t._id;o||(o=f);var h=d.getFromId(r,c);if(s&&h.overlaying===s){i=f;break}}}return i||o}function M(t){var e=t.transforms;if(Array.isArray(e)&&e.length)for(var r=0;r<e.length;r++){var n=e[r],a=n._module||x[n.type];if(a&&a.makesData)return!0}return!1}function E(t,e,r,n){for(var a=t.transforms,i=[t],o=0;o<a.length;o++){var s=a[o],l=x[s.type];l&&l.transform&&(i=l.transform(i,{transform:s,fullTrace:t,fullData:e,layout:r,fullLayout:n,transformIndex:o}))}return i}function S(t){return"string"==typeof t&&"px"===t.substr(t.length-2)&&parseFloat(t)}function C(t){var e=t.margin;if(!t._size){var r=t._size={l:Math.round(e.l),r:Math.round(e.r),t:Math.round(e.t),b:Math.round(e.b),p:Math.round(e.pad)};r.w=Math.round(t.width)-r.l-r.r,r.h=Math.round(t.height)-r.t-r.b}t._pushmargin||(t._pushmargin={}),t._pushmarginIds||(t._pushmarginIds={})}b.supplyDefaults=function(t,e){var r=e&&e.skipUpdateCalc,i=t._fullLayout||{};if(i._skipDefaults)delete i._skipDefaults;else{var s,l=t._fullLayout={},c=t.layout||{},f=t._fullData||[],d=t._fullData=[],p=t.data||[],g=t.calcdata||[],v=t._context||{};t._transitionData||b.createTransitionData(t),l._dfltTitle={plot:y(t,"Click to enter Plot title"),x:y(t,"Click to enter X axis title"),y:y(t,"Click to enter Y axis title"),colorbar:y(t,"Click to enter Colorscale title"),annotation:y(t,"new text")},l._traceWord=y(t,"trace");var x=T(t,w);if(l._mapboxAccessToken=v.mapboxAccessToken,i._initialAutoSizeIsDone){var _=i.width,k=i.height;b.supplyLayoutGlobalDefaults(c,l,x),c.width||(l.width=_),c.height||(l.height=k),b.sanitizeMargins(l)}else{b.supplyLayoutGlobalDefaults(c,l,x);var M=!c.width||!c.height,E=l.autosize,S=v.autosizable;M&&(E||S)?b.plotAutoSize(t,c,l):M&&b.sanitizeMargins(l),!E&&M&&(c.width=l.width,c.height=l.height)}l._d3locale=function(t,e){return t.decimal=e.charAt(0),t.thousands=e.charAt(1),{numberFormat:n.locale(t).numberFormat,timeFormat:a(t).utcFormat}}(x,l.separators),l._extraFormat=T(t,A),l._initialAutoSizeIsDone=!0,l._dataLength=p.length,l._modules=[],l._visibleModules=[],l._basePlotModules=[];var L=l._subplots=function(){var t,e,r=o.collectableSubplotTypes,n={};if(!r){r=[];var a=o.subplotsRegistry;for(var i in a){var s=a[i].attr;if(s&&(r.push(i),Array.isArray(s)))for(e=0;e<s.length;e++)u.pushUnique(r,s[e])}}for(t=0;t<r.length;t++)n[r[t]]=[];return n}(),O=l._splomAxes={x:{},y:{}},D=l._splomSubplots={};l._splomGridDflt={},l._scatterStackOpts={},l._firstScatter={},l._alignmentOpts={},l._colorAxes={},l._requestRangeslider={},l._traceUids=function(t,e){var r,n,a=e.length,i=[];for(r=0;r<t.length;r++){var o=t[r]._fullInput;o!==n&&i.push(o),n=o}var s=i.length,l=new Array(a),c={};function f(t,e){l[e]=t,c[t]=1}function d(t,e){if(t&&"string"==typeof t&&!c[t])return f(t,e),!0}for(r=0;r<a;r++){var h=e[r].uid;"number"==typeof h&&(h=String(h)),d(h,r)||(r<s&&d(i[r].uid,r)||f(u.randstr(c),r))}return l}(f,p),l._globalTransforms=(t._context||{}).globalTransforms,b.supplyDataDefaults(p,d,c,l);var R=Object.keys(O.x),I=Object.keys(O.y);if(R.length>1&&I.length>1){for(o.getComponentMethod("grid","sizeDefaults")(c,l),s=0;s<R.length;s++)u.pushUnique(L.xaxis,R[s]);for(s=0;s<I.length;s++)u.pushUnique(L.yaxis,I[s]);for(var P in D)u.pushUnique(L.cartesian,P)}if(l._has=b._hasPlotType.bind(l),f.length===d.length)for(s=0;s<d.length;s++)m(d[s],f[s]);b.supplyLayoutModuleDefaults(c,l,d,t._transitionData);var F=l._visibleModules,z=[];for(s=0;s<F.length;s++){var N=F[s].crossTraceDefaults;N&&u.pushUnique(z,N)}for(s=0;s<z.length;s++)z[s](d,l);l._hasOnlyLargeSploms=1===l._basePlotModules.length&&"splom"===l._basePlotModules[0].name&&R.length>15&&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;a<t.length;a++){var i=t[a];i.meta?n[i.index]=i._meta={meta:i.meta}:e.meta&&(i._meta={meta:e.meta}),e.meta&&(i._meta.layout={meta:e.meta})}n.length&&(r||(r=e._meta={}),r.data=n)}(d,l),m(l,i),o.getComponentMethod("colorscale","crossTraceDefaults")(d,l),l._preGUI||(l._preGUI={}),l._tracePreGUI||(l._tracePreGUI={});var H,G=l._tracePreGUI,q={};for(H in G)q[H]="old";for(s=0;s<d.length;s++)q[H=d[s]._fullInput.uid]||(G[H]={}),q[H]="new";for(H in q)"old"===q[H]&&delete G[H];C(l),o.getComponentMethod("rangeslider","makeData")(l),r||g.length!==d.length||b.supplyDefaultsUpdateCalc(g,d)}},b.supplyDefaultsUpdateCalc=function(t,e){for(var r=0;r<e.length;r++){var n=e[r],a=(t[r]||[])[0];if(a&&a.trace){var i=a.trace;if(i._hasCalcTransform){var o,s,l,c=i._arrayAttrs;for(o=0;o<c.length;o++)s=c[o],l=u.nestedProperty(i,s).get().slice(),u.nestedProperty(n,s).set(l)}a.trace=n}}},b.createTransitionData=function(t){t._transitionData||(t._transitionData={}),t._transitionData._frames||(t._transitionData._frames=[]),t._transitionData._frameHash||(t._transitionData._frameHash={}),t._transitionData._counter||(t._transitionData._counter=0),t._transitionData._interruptCallbacks||(t._transitionData._interruptCallbacks=[])},b._hasPlotType=function(t){var e,r=this._basePlotModules||[];for(e=0;e<r.length;e++)if(r[e].name===t)return!0;var n=this._modules||[];for(e=0;e<n.length;e++){var a=n[e].name;if(a===t)return!0;var i=o.modules[a];if(i&&i.categories[t])return!0}return!1},b.cleanPlot=function(t,e,r,n){var a,i,o=n._basePlotModules||[];for(a=0;a<o.length;a++){var s=o[a];s.clean&&s.clean(t,e,r,n)}var l=n._has&&n._has("gl"),u=e._has&&e._has("gl");l&&!u&&void 0!==n._glcontainer&&(n._glcontainer.selectAll(".gl-canvas").remove(),n._glcontainer.selectAll(".no-webgl").remove(),n._glcanvas=null);var c=!!n._infolayer;t:for(a=0;a<r.length;a++){var f=r[a].uid;for(i=0;i<t.length;i++){if(f===t[i].uid)continue t}c&&n._infolayer.select(".cb"+f).remove()}},b.linkSubplots=function(t,e,r,n){var a,i,s=n._plots||{},l=e._plots={},c=e._subplots,f={_fullData:t,_fullLayout:e},h=c.cartesian.concat(c.gl2d||[]);for(a=0;a<h.length;a++){var p,g=h[a],v=s[g],m=d.getFromId(f,g,"x"),y=d.getFromId(f,g,"y");for(v?p=l[g]=v:(p=l[g]={}).id=g,m._counterAxes.push(y._id),y._counterAxes.push(m._id),m._subplotsWith.push(g),y._subplotsWith.push(g),p.xaxis=m,p.yaxis=y,p._hasClipOnAxisFalse=!1,i=0;i<t.length;i++){var b=t[i];if(b.xaxis===p.xaxis._id&&b.yaxis===p.yaxis._id&&!1===b.cliponaxis){p._hasClipOnAxisFalse=!0;break}}}var x,_=d.list(f,null,!0);for(a=0;a<_.length;a++){var w=null;(x=_[a]).overlaying&&(w=d.getFromId(f,x.overlaying))&&w.overlaying&&(x.overlaying=!1,w=null),x._mainAxis=w||x,w&&(x.domain=w.domain.slice()),x._anchorAxis="free"===x.anchor?null:d.getFromId(f,x.anchor)}for(a=0;a<_.length;a++)if((x=_[a])._counterAxes.sort(d.idSort),x._subplotsWith.sort(u.subplotSort),x._mainSubplot=k(x,e),x._counterAxes.length&&(x.spikemode&&-1!==x.spikemode.indexOf("across")||x.automargin&&x.mirror&&"free"!==x.anchor||o.getComponentMethod("rangeslider","isVisible")(x))){var A=1,T=0;for(i=0;i<x._counterAxes.length;i++){var M=d.getFromId(f,x._counterAxes[i]);A=Math.min(A,M.domain[0]),T=Math.max(T,M.domain[1])}A<T&&(x._counterDomainMin=A,x._counterDomainMax=T)}},b.clearExpandedTraceDefaultColors=function(t){var e,r,n;for(r=[],(e=t._module._colorAttrs)||(t._module._colorAttrs=e=[],s.crawl(t._module.attributes,(function(t,n,a,i){r[i]=n,r.length=i+1,"color"===t.valType&&void 0===t.dflt&&e.push(r.join("."))}))),n=0;n<e.length;n++){u.nestedProperty(t,"_input."+e[n]).get()||u.nestedProperty(t,e[n]).set(null)}},b.supplyDataDefaults=function(t,e,r,n){var a,i,s,c=n._modules,f=n._visibleModules,d=n._basePlotModules,h=0,p=0;function g(t){e.push(t);var r=t._module;r&&(u.pushUnique(c,r),!0===t.visible&&u.pushUnique(f,r),u.pushUnique(d,t._module.basePlotModule),h++,!1!==t._input.visible&&p++)}n._transformModules=[];var v={},y=[],x=(r.template||{}).data||{},_=l.traceTemplater(x);for(a=0;a<t.length;a++){if(s=t[a],(i=_.newTrace(s)).uid=n._traceUids[a],b.supplyTraceDefaults(s,i,p,n,a),i.index=a,i._input=s,i._expandedIndex=h,i.transforms&&i.transforms.length)for(var w=!1!==s.visible&&!1===i.visible,A=E(i,e,r,n),T=0;T<A.length;T++){var k=A[T],M={_template:i._template,type:i.type,uid:i.uid+T};w&&!1===k.visible&&delete k.visible,b.supplyTraceDefaults(k,M,h,n,a),m(M,k),M.index=a,M._input=s,M._fullInput=i,M._expandedIndex=h,M._expandedInput=k,g(M)}else i._fullInput=i,i._expandedInput=i,g(i);o.traceIs(i,"carpetAxis")&&(v[i.carpet]=i),o.traceIs(i,"carpetDependent")&&y.push(a)}for(a=0;a<y.length;a++)if((i=e[y[a]]).visible){var S=v[i.carpet];i._carpet=S,S&&S.visible?(i.xaxis=S.xaxis,i.yaxis=S.yaxis):i.visible=!1}},b.supplyAnimationDefaults=function(t){var e;t=t||{};var r={};function n(e,n){return u.coerce(t||{},r,p,e,n)}if(n("mode"),n("direction"),n("fromcurrent"),Array.isArray(t.frame))for(r.frame=[],e=0;e<t.frame.length;e++)r.frame[e]=b.supplyAnimationFrameDefaults(t.frame[e]||{});else r.frame=b.supplyAnimationFrameDefaults(t.frame||{});if(Array.isArray(t.transition))for(r.transition=[],e=0;e<t.transition.length;e++)r.transition[e]=b.supplyAnimationTransitionDefaults(t.transition[e]||{});else r.transition=b.supplyAnimationTransitionDefaults(t.transition||{});return r},b.supplyAnimationFrameDefaults=function(t){var e={};function r(r,n){return u.coerce(t||{},e,p.frame,r,n)}return r("duration"),r("redraw"),e},b.supplyAnimationTransitionDefaults=function(t){var e={};function r(r,n){return u.coerce(t||{},e,p.transition,r,n)}return r("duration"),r("easing"),e},b.supplyFrameDefaults=function(t){var e={};function r(r,n){return u.coerce(t,e,g,r,n)}return r("group"),r("name"),r("traces"),r("baseframe"),r("data"),r("layout"),e},b.supplyTraceDefaults=function(t,e,r,n,a){var i,s=n.colorway||c.defaults,l=s[r%s.length];function f(r,n){return u.coerce(t,e,b.attributes,r,n)}var d=f("visible");f("type"),f("name",n._traceWord+" "+a),f("uirevision",n.uirevision);var h=b.getModule(e);if(e._module=h,h){var p=h.basePlotModule,g=p.attr,v=p.attributes;if(g&&v){var m=n._subplots,y="";if(d||"gl2d"!==p.name){if(Array.isArray(g))for(i=0;i<g.length;i++){var x=g[i],_=u.coerce(t,e,v,x);m[x]&&u.pushUnique(m[x],_),y+=_}else y=u.coerce(t,e,v,g);m[p.name]&&u.pushUnique(m[p.name],y)}}}return d&&(f("customdata"),f("ids"),f("meta"),o.traceIs(e,"showLegend")?(u.coerce(t,e,h.attributes.showlegend?h.attributes:b.attributes,"showlegend"),f("legendgroup"),e._dfltShowLegend=!0):e._dfltShowLegend=!1,h&&h.supplyDefaults(t,e,l,n),o.traceIs(e,"noOpacity")||f("opacity"),o.traceIs(e,"notLegendIsolatable")&&(e.visible=!!e.visible),o.traceIs(e,"noHover")||(e.hovertemplate||u.coerceHoverinfo(t,e,n),"parcats"!==e.type&&o.getComponentMethod("fx","supplyDefaults")(t,e,l,n)),h&&h.selectPoints&&f("selectedpoints"),b.supplyTransformDefaults(t,e,n)),e},b.hasMakesDataTransform=M,b.supplyTransformDefaults=function(t,e,r){if(e._length||M(t)){var n=r._globalTransforms||[],a=r._transformModules||[];if(Array.isArray(t.transforms)||0!==n.length)for(var i=t.transforms||[],o=n.concat(i),s=e.transforms=[],l=0;l<o.length;l++){var c,f=o[l],d=f.type,h=x[d],p=!(f._module&&f._module===h),g=h&&"function"==typeof h.transform;h||u.warn("Unrecognized transform type "+d+"."),h&&h.supplyDefaults&&(p||g)?((c=h.supplyDefaults(f,e,r,t)).type=d,c._module=h,u.pushUnique(a,h)):c=u.extendFlat({},f),s.push(c)}}},b.supplyLayoutGlobalDefaults=function(t,e,r){function n(r,n){return u.coerce(t,e,b.layoutAttributes,r,n)}var a=t.template;u.isPlainObject(a)&&(e.template=a,e._template=a.layout,e._dataTemplate=a.data),n("autotypenumbers");var i=u.coerceFont(n,"font");n("title.text",e._dfltTitle.plot),u.coerceFont(n,"title.font",{family:i.family,size:Math.round(1.4*i.size),color:i.color}),n("title.xref"),n("title.yref"),n("title.x"),n("title.y"),n("title.xanchor"),n("title.yanchor"),n("title.pad.t"),n("title.pad.r"),n("title.pad.b"),n("title.pad.l"),n("uniformtext.mode")&&n("uniformtext.minsize"),n("autosize",!(t.width&&t.height)),n("width"),n("height"),n("margin.l"),n("margin.r"),n("margin.t"),n("margin.b"),n("margin.pad"),n("margin.autoexpand"),t.width&&t.height&&b.sanitizeMargins(e),o.getComponentMethod("grid","sizeDefaults")(t,e),n("paper_bgcolor"),n("separators",r.decimal+r.thousands),n("hidesources"),n("colorway"),n("datarevision");var s=n("uirevision");n("editrevision",s),n("selectionrevision",s),n("modebar.orientation"),n("modebar.bgcolor",c.addOpacity(e.paper_bgcolor,.5));var l=c.contrast(c.rgb(e.modebar.bgcolor));n("modebar.color",c.addOpacity(l,.3)),n("modebar.activecolor",c.addOpacity(l,.7)),n("modebar.uirevision",s),o.getComponentMethod("shapes","supplyDrawNewShapeDefaults")(t,e,n),n("meta"),u.isPlainObject(t.transition)&&(n("transition.duration"),n("transition.easing"),n("transition.ordering")),o.getComponentMethod("calendars","handleDefaults")(t,e,"calendar"),o.getComponentMethod("fx","supplyLayoutGlobalDefaults")(t,e,n)},b.plotAutoSize=function(t,e,r){var n,a,o=t._context||{},s=o.frameMargins,l=u.isPlotDiv(t);if(l&&t.emit("plotly_autosize"),o.fillFrame)n=window.innerWidth,a=window.innerHeight,document.body.style.overflow="hidden";else{var c=l?window.getComputedStyle(t):{};if(n=S(c.width)||S(c.maxWidth)||r.width,a=S(c.height)||S(c.maxHeight)||r.height,i(s)&&s>0){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;n<d&&(n=d),a<h&&(a=h);var p=!e.width&&Math.abs(r.width-n)>1,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;i<c.length;i++)(s=c[i]).supplyLayoutDefaults&&s.supplyLayoutDefaults(t,e,r);var h=e._modules;for(i=0;i<h.length;i++)(s=h[i]).supplyLayoutDefaults&&s.supplyLayoutDefaults(t,e,r);var p=e._transformModules;for(i=0;i<p.length;i++)(s=p[i]).supplyLayoutDefaults&&s.supplyLayoutDefaults(t,e,r,n);for(a in l)(s=l[a]).supplyLayoutDefaults&&s.supplyLayoutDefaults(t,e,r)},b.purge=function(t){var e=t._fullLayout||{};void 0!==e._glcontainer&&(e._glcontainer.selectAll(".gl-canvas").remove(),e._glcontainer.remove(),e._glcanvas=null),e._modeBar&&e._modeBar.destroy(),t._transitionData&&(t._transitionData._interruptCallbacks&&(t._transitionData._interruptCallbacks.length=0),t._transitionData._animationRaf&&window.cancelAnimationFrame(t._transitionData._animationRaf)),u.clearThrottle(),u.clearResponsive(t),delete t.data,delete t.layout,delete t._fullData,delete t._fullLayout,delete t.calcdata,delete t.framework,delete t.empty,delete t.fid,delete t.undoqueue,delete t.undonum,delete t.autoplay,delete t.changed,delete t._promises,delete t._redrawTimer,delete t._hmlumcount,delete t._hmpixcount,delete t._transitionData,delete t._transitioning,delete t._initialAutoSize,delete t._transitioningWithDuration,delete t._dragging,delete t._dragged,delete t._dragdata,delete t._hoverdata,delete t._snapshotInProgress,delete t._editing,delete t._mouseDownTime,delete t._legendMouseDownTime,t.removeAllListeners&&t.removeAllListeners()},b.style=function(t){var e,r=t._fullLayout._visibleModules,n=[];for(e=0;e<r.length;e++){var a=r[e];a.style&&u.pushUnique(n,a.style)}for(e=0;e<n.length;e++)n[e](t)},b.sanitizeMargins=function(t){if(t&&t.margin){var e,r=t.width,n=t.height,a=t.margin,i=r-(a.l+a.r),o=n-(a.t+a.b);i<0&&(e=(r-1)/(a.l+a.r),a.l=Math.floor(e*a.l),a.r=Math.floor(e*a.r)),o<0&&(e=(n-1)/(a.t+a.b),a.t=Math.floor(e*a.t),a.b=Math.floor(e*a.b))}},b.clearAutoMarginIds=function(t){t._fullLayout._pushmarginIds={}},b.allowAutoMargin=function(t,e){t._fullLayout._pushmarginIds[e]=1};b.autoMargin=function(t,e,r){var n=t._fullLayout,a=n.width,i=n.height,o=n.margin,s=u.constrain(a-o.l-o.r,2,64),l=u.constrain(i-o.t-o.b,2,64),c=Math.max(0,a-s),f=Math.max(0,i-l),d=n._pushmargin,h=n._pushmarginIds;if(!1!==o.autoexpand){if(r){var p=r.pad;if(void 0===p&&(p=Math.min(12,o.l,o.r,o.t,o.b)),c){var g=(r.l+r.r)/c;g>1&&(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._redrawFromAutoMarginCount<V)return o.call("plot",t);e._size=l,u.warn("Too many auto-margin redraws.")}!function(t){for(var e=d.list(t,"",!0),r=0;r<e.length;r++){var n=e[r]._hideOutOfRangeInsideTickLabels;n&&n()}}(t)};var L=["l","r","t","b","p","w","h"];function O(t,e,r){var n=!1;var a=[b.previousPromises,function(){if(t._transitionData)return t._transitioning=!1,function(t){var e=Promise.resolve();if(!t)return e;for(;t.length;)e=e.then(t.shift());return e}(t._transitionData._interruptCallbacks)},r.prepareFn,b.rehover,function(){return t.emit("plotly_transitioning",[]),new Promise((function(a){t._transitioning=!0,e.duration>0&&(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;r<L.length;r++){var n=L[r],a=t[n],o=e[n];if(!i(a)||Math.abs(o-a)>1)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<e.length;r++)switch((n=e[r]).type){case"replace":a=n.value;var s=(i[n.index]||{}).name,l=a.name;i[n.index]=o[l]=a,l!==s&&(delete o[s],o[l]=a);break;case"insert":o[(a=n.value).name]=a,i.splice(n.index,0,a);break;case"delete":delete o[(a=i[n.index]).name],i.splice(n.index,1)}return Promise.resolve()},b.computeFrame=function(t,e){var r,n,a,i,o=t._transitionData._frameHash;if(!e)throw new Error("computeFrame must be given a string frame name");var s=o[e.toString()];if(!s)return!1;for(var l=[s],u=[s.name];s.baseframe&&(s=o[s.baseframe.toString()])&&-1===u.indexOf(s.name);)l.push(s),u.push(s.name);for(var c={};s=l.pop();)if(s.layout&&(c.layout=b.extendLayout(c.layout,s.layout)),s.data){if(c.data||(c.data=[]),!(n=s.traces))for(n=[],r=0;r<s.data.length;r++)n[r]=r;for(c.traces||(c.traces=[]),r=0;r<s.data.length;r++)null!=(a=n[r])&&(-1===(i=c.traces.indexOf(a))&&(i=c.data.length,c.traces[i]=a),c.data[i]=b.extendTrace(c.data[i],s.data[r]))}return c},b.recomputeFrameHash=function(t){for(var e=t._transitionData._frameHash={},r=t._transitionData._frames,n=0;n<r.length;n++){var a=r[n];a&&a.name&&(e[a.name]=a)}},b.extendObjectWithContainers=function(t,e,r){var n,a,i,o,s,l,c,f=u.extendDeepNoArrays({},e||{}),d=u.expandObjectPaths(f),h={};if(r&&r.length)for(i=0;i<r.length;i++)void 0===(a=(n=u.nestedProperty(d,r[i])).get())?u.nestedProperty(h,r[i]).set(null):(n.set(null),u.nestedProperty(h,r[i]).set(a));if(t=u.extendDeepNoArrays(t||{},d),r&&r.length)for(i=0;i<r.length;i++)if(l=u.nestedProperty(h,r[i]).get()){for(c=(s=u.nestedProperty(t,r[i])).get(),Array.isArray(c)||(c=[],s.set(c)),o=0;o<l.length;o++){var p=l[o];c[o]=null===p?null:b.extendObjectWithContainers(c[o],p)}s.set(c)}return t},b.dataArrayContainers=["transforms","dimensions"],b.layoutArrayContainers=o.layoutArrayContainers,b.extendTrace=function(t,e){return b.extendObjectWithContainers(t,e,b.dataArrayContainers)},b.extendLayout=function(t,e){return b.extendObjectWithContainers(t,e,b.layoutArrayContainers)},b.transition=function(t,e,r,n,a,i){var o={redraw:a.redraw},s={},l=[];return o.prepareFn=function(){for(var a=Array.isArray(e)?e.length:0,i=n.slice(0,a),o=0;o<i.length;o++){var c=i[o],f=t._fullData[c]._module;if(f){if(f.animatable){var d=f.basePlotModule.name;s[d]||(s[d]=[]),s[d].push(c)}t.data[i[o]]=b.extendTrace(t.data[i[o]],e[o])}}var h=u.expandObjectPaths(u.extendDeepNoArrays({},r)),p=/^[xy]axis[0-9]*$/;for(var g in h)p.test(g)&&delete h[g].range;b.extendLayout(t.layout,h),delete t.calcdata,b.supplyDefaults(t),b.doCalcdata(t);var v=u.expandObjectPaths(r);if(v){var m=t._fullLayout._plots;for(var y in m){var x=m[y],_=x.xaxis,w=x.yaxis,A=_.range.slice(),T=w.range.slice(),k=null,M=null,E=null,S=null;Array.isArray(v[_._name+".range"])?k=v[_._name+".range"].slice():Array.isArray((v[_._name]||{}).range)&&(k=v[_._name].range.slice()),Array.isArray(v[w._name+".range"])?M=v[w._name+".range"].slice():Array.isArray((v[w._name]||{}).range)&&(M=v[w._name].range.slice()),A&&k&&(_.r2l(A[0])!==_.r2l(k[0])||_.r2l(A[1])!==_.r2l(k[1]))&&(E={xr0:A,xr1:k}),T&&M&&(w.r2l(T[0])!==w.r2l(M[0])||w.r2l(T[1])!==w.r2l(M[1]))&&(S={yr0:T,yr1:M}),(E||S)&&l.push(u.extendFlat({plotinfo:x},E,S))}}return Promise.resolve()},o.runFn=function(e){var n,a,o=t._fullLayout._basePlotModules,c=l.length;if(r)for(a=0;a<o.length;a++)o[a].transitionAxes&&o[a].transitionAxes(t,l,i,e);for(var f in c?((n=u.extendFlat({},i)).duration=0,delete s.cartesian):n=i,s){var d=s[f];t._fullData[d[0]]._module.basePlotModule.plot(t,d,n,e)}},O(t,i,o)},b.transitionFromReact=function(t,e,r,n){var a=t._fullLayout,i=a.transition,o={},s=[];return o.prepareFn=function(){var t=a._plots;for(var i in o.redraw=!1,"some"===e.anim&&(o.redraw=!0),"some"===r.anim&&(o.redraw=!0),t){var l=t[i],c=l.xaxis,f=l.yaxis,d=n[c._name].range.slice(),h=n[f._name].range.slice(),p=c.range.slice(),g=f.range.slice();c.setScale(),f.setScale();var v=null,m=null;c.r2l(d[0])===c.r2l(p[0])&&c.r2l(d[1])===c.r2l(p[1])||(v={xr0:d,xr1:p}),f.r2l(h[0])===f.r2l(g[0])&&f.r2l(h[1])===f.r2l(g[1])||(m={yr0:h,yr1:g}),(v||m)&&s.push(u.extendFlat({plotinfo:l},v,m))}return Promise.resolve()},o.runFn=function(r){for(var n,a,o,l=t._fullData,c=t._fullLayout._basePlotModules,f=[],d=0;d<l.length;d++)f.push(d);function h(){for(var e=0;e<c.length;e++)c[e].transitionAxes&&c[e].transitionAxes(t,s,n,r)}function p(){for(var e=0;e<c.length;e++)c[e].plot(t,o,a,r)}s.length&&e.anim?"traces first"===i.ordering?(n=u.extendFlat({},i,{duration:0}),o=f,a=i,setTimeout(h,i.duration),p()):(n=i,o=null,a=u.extendFlat({},i,{duration:0}),setTimeout(p,n.duration),h()):s.length?(n=i,h()):e.anim&&(o=f,a=i,p())},O(t,i,o)},b.doCalcdata=function(t,e){var r,n,a,i,l=d.list(t),c=t._fullData,h=t._fullLayout,p=new Array(c.length),g=(t.calcdata||[]).slice();for(t.calcdata=p,h._numBoxes=0,h._numViolins=0,h._violinScaleGroupStats={},t._hmpixcount=0,t._hmlumcount=0,h._piecolormap={},h._sunburstcolormap={},h._treemapcolormap={},h._funnelareacolormap={},a=0;a<c.length;a++)Array.isArray(e)&&-1===e.indexOf(a)&&(p[a]=g[a]);for(a=0;a<c.length;a++)(r=c[a])._arrayAttrs=s.findArrayAttributes(r),r._extremes={};var v=h._subplots.polar||[];for(a=0;a<v.length;a++)l.push(h[v[a]].radialaxis,h[v[a]].angularaxis);for(var m in h._colorAxes){var y=h[m];!1!==y.cauto&&(delete y.cmin,delete y.cmax)}var b=!1;function _(e){if(r=c[e],n=r._module,!0===r.visible&&r.transforms){if(n&&n.calc){var a=n.calc(t,r);a[0]&&a[0].t&&a[0].t._scene&&delete a[0].t._scene.dirty}for(i=0;i<r.transforms.length;i++){var o=r.transforms[i];(n=x[o.type])&&n.calcTransform&&(r._hasCalcTransform=!0,b=!0,n.calcTransform(t,r,o))}}}function w(e,a){if(r=c[e],!!(n=r._module).isContainer===a){var o=[];if(!0===r.visible&&0!==r._length){delete r._indexToPoints;var s=r.transforms||[];for(i=s.length-1;i>=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<c.length;a++)w(a,!0);for(a=0;a<c.length;a++)_(a);for(b&&R(l,c,h),a=0;a<c.length;a++)w(a,!0);for(a=0;a<c.length;a++)w(a,!1);I(t);var A=function(t,e){var r,n,a,i,s,l=[];function c(t,r,n){var a=r._id.charAt(0);if("histogram2dcontour"===t){var i=r._counterAxes[0],o=d.getFromId(e,i),s="x"===a||"x"===i&&"category"===o.type,l="y"===a||"y"===i&&"category"===o.type;return function(t,e){return 0===t||0===e||s&&t===n[e].length-1||l&&e===n.length-1?-1:("y"===a?e:t)-1}}return function(t,e){return"y"===a?e:t}}var f={min:function(t){return u.aggNums(Math.min,null,t)},max:function(t){return u.aggNums(Math.max,null,t)},sum:function(t){return u.aggNums((function(t,e){return t+e}),null,t)},total:function(t){return u.aggNums((function(t,e){return t+e}),null,t)},mean:function(t){return u.mean(t)},median:function(t){return u.median(t)}};for(r=0;r<t.length;r++){var h=t[r];if("category"===h.type){var p=h.categoryorder.match(D);if(p){var g=p[1],v=p[2],m=h._id.charAt(0),y="x"===m,b=[];for(n=0;n<h._categories.length;n++)b.push([h._categories[n],[]]);for(n=0;n<h._traceIndices.length;n++){var x=h._traceIndices[n],_=e._fullData[x];if(!0===_.visible){var w=_.type;o.traceIs(_,"histogram")&&(delete _._xautoBinFinished,delete _._yautoBinFinished);var A="splom"===w,T="scattergl"===w,k=e.calcdata[x];for(a=0;a<k.length;a++){var M,E,S=k[a];if(A){var C=_._axesDim[h._id];if(!y){var L=_._diag[C][0];L&&(h=e._fullLayout[d.id2name(L)])}var O=S.trace.dimensions[C].values;for(i=0;i<O.length;i++)for(M=h._categoriesMap[O[i]],s=0;s<S.trace.dimensions.length;s++)if(s!==C){var R=S.trace.dimensions[s];b[M][1].push(R.values[i])}}else if(T){for(i=0;i<S.t.x.length;i++)y?(M=S.t.x[i],E=S.t.y[i]):(M=S.t.y[i],E=S.t.x[i]),b[M][1].push(E);S.t&&S.t._scene&&delete S.t._scene.dirty}else if(S.hasOwnProperty("z")){E=S.z;var I=c(_.type,h,E);for(i=0;i<E.length;i++)for(s=0;s<E[i].length;s++)(M=I(s,i))+1&&b[M][1].push(E[i][s])}else for(void 0===(M=S.p)&&(M=S[m]),void 0===(E=S.s)&&(E=S.v),void 0===E&&(E=y?S.y:S.x),Array.isArray(E)||(E=void 0===E?[]:[E]),i=0;i<E.length;i++)b[M][1].push(E[i])}}}h._categoriesValue=b;var P=[];for(n=0;n<b.length;n++)P.push([b[n][0],f[g](b[n][1])]);P.sort((function(t,e){return t[1]-e[1]})),h._categoriesAggregatedValue=P,h._initialCategories=P.map((function(t){return t[0]})),"descending"===v&&h._initialCategories.reverse(),l=l.concat(h.sortByInitialCategories())}}}return l}(l,t);if(A.length){for(h._numBoxes=0,h._numViolins=0,a=0;a<A.length;a++)w(A[a],!0);for(a=0;a<A.length;a++)w(A[a],!1);I(t)}o.getComponentMethod("fx","calc")(t),o.getComponentMethod("errorbars","calc")(t)};var D=/(total|sum|min|max|mean|median) (ascending|descending)/;function R(t,e,r){var n={};function a(t){t.clearCalc(),"multicategory"===t.type&&t.setupMultiCategory(e),n[t._id]=1}u.simpleMap(t,a);for(var i=r._axisMatchGroups||[],o=0;o<i.length;o++)for(var s in i[o])n[s]||a(r[d.id2name(s)])}function I(t){var e,r,n,a=t._fullLayout,i=a._visibleModules,o={};for(r=0;r<i.length;r++){var s=i[r],l=s.crossTraceCalc;if(l){var c=s.basePlotModule.name;o[c]?u.pushUnique(o[c],l):o[c]=[l]}}for(n in o){var f=o[n],d=a._subplots[n];if(Array.isArray(d))for(e=0;e<d.length;e++){var h=d[e],p="cartesian"===n?a._plots[h]:a[h];for(r=0;r<f.length;r++)f[r](t,p,h)}else for(r=0;r<f.length;r++)f[r](t)}}b.rehover=function(t){t._fullLayout._rehover&&t._fullLayout._rehover()},b.redrag=function(t){t._fullLayout._redrag&&t._fullLayout._redrag()},b.generalUpdatePerTraceModule=function(t,e,r,n){var a,i=e.traceHash,o={};for(a=0;a<r.length;a++){var s=r[a],l=s[0].trace;l.visible&&(o[l.type]=o[l.type]||[],o[l.type].push(s))}for(var c in i)if(!o[c]){var f=i[c][0];f[0].trace.visible=!1,o[c]=[f]}for(var d in o){var h=o[d];h[0][0].trace._module.plot(t,e,u.filterVisible(h),n)}e.traceHash=o},b.plotBasePlot=function(t,e,r,n,a){var i=o.getModule(t),s=v(e.calcdata,i)[0];i.plot(e,s,n,a)},b.cleanBasePlot=function(t,e,r,n,a){var i=a._has&&a._has(t),o=r._has&&r._has(t);i&&!o&&a["_"+t+"layer"].selectAll("g.trace").remove()}},{"../components/color":368,"../constants/numerical":475,"../lib":498,"../plot_api/plot_schema":535,"../plot_api/plot_template":536,"../plots/get_data":577,"../registry":593,"./animation_attributes":541,"./attributes":543,"./cartesian/axis_ids":550,"./cartesian/handle_outline":557,"./command":573,"./font_attributes":575,"./frame_attributes":576,"./layout_attributes":583,d3:86,"d3-time-format":84,"fast-isnumeric":155}],586:[function(t,e,r){"use strict";var n=t("../../../traces/scatter/attributes"),a=n.marker,i=t("../../../lib/extend").extendFlat;["Area traces are deprecated!","Please switch to the *barpolar* trace type."].join(" ");e.exports={r:i({},n.r,{}),t:i({},n.t,{}),marker:{color:i({},a.color,{}),size:i({},a.size,{}),symbol:i({},a.symbol,{}),opacity:i({},a.opacity,{}),editType:"calc"}}},{"../../../lib/extend":490,"../../../traces/scatter/attributes":654}],587:[function(t,e,r){"use strict";var n=t("../../cartesian/layout_attributes"),a=t("../../../lib/extend").extendFlat,i=t("../../../plot_api/edit_types").overrideAll,o=["Legacy polar charts are deprecated!","Please switch to *polar* subplots."].join(" "),s=a({},n.domain,{});function l(t,e){return a({},e,{showline:{valType:"boolean"},showticklabels:{valType:"boolean"},tickorientation:{valType:"enumerated",values:["horizontal","vertical"]},ticklen:{valType:"number",min:0},tickcolor:{valType:"color"},ticksuffix:{valType:"string"},endpadding:{valType:"number",description:o},visible:{valType:"boolean"}})}e.exports=i({radialaxis:l(0,{range:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},domain:s,orientation:{valType:"number"}}),angularaxis:l(0,{range:{valType:"info_array",items:[{valType:"number",dflt:0},{valType:"number",dflt:360}]},domain:s}),layout:{direction:{valType:"enumerated",values:["clockwise","counterclockwise"]},orientation:{valType:"angle"}}},"plot","nested")},{"../../../lib/extend":490,"../../../plot_api/edit_types":529,"../../cartesian/layout_attributes":561}],588:[function(t,e,r){"use strict";(e.exports=t("./micropolar")).manager=t("./micropolar_manager")},{"./micropolar":589,"./micropolar_manager":590}],589:[function(t,e,r){var n=t("d3"),a=t("../../../lib").extendDeepAll,i=t("../../../constants/alignment").MID_SHIFT,o=e.exports={version:"0.2.2"};o.Axis=function(){var t,e,r,s,l={data:[],layout:{}},u={},c={},f=n.dispatch("hover"),d={};return d.render=function(u){return function(u){e=u||e;var f=l.data,d=l.layout;("string"==typeof e||e.nodeName)&&(e=n.select(e)),e.datum(f).each((function(e,l){var u=e.slice();c={data:o.util.cloneJson(u),layout:o.util.cloneJson(d)};var f=0;u.forEach((function(t,e){t.color||(t.color=d.defaultColorRange[f],f=(f+1)%d.defaultColorRange.length),t.strokeColor||(t.strokeColor="LinePlot"===t.geometry?t.color:n.rgb(t.color).darker().toString()),c.data[e].color=t.color,c.data[e].strokeColor=t.strokeColor,c.data[e].strokeDash=t.strokeDash,c.data[e].strokeSize=t.strokeSize}));var h=u.filter((function(t,e){var r=t.visible;return"undefined"==typeof r||!0===r})),p=!1,g=h.map((function(t,e){return p=p||"undefined"!=typeof t.groupId,t}));if(p){var v=n.nest().key((function(t,e){return"undefined"!=typeof t.groupId?t.groupId:"unstacked"})).entries(g),m=[],y=v.map((function(t,e){if("unstacked"===t.key)return t.values;var r=t.values[0].r.map((function(t,e){return 0}));return t.values.forEach((function(t,e,n){t.yStack=[r],m.push(r),r=o.util.sumArrays(t.r,r)})),t.values}));h=n.merge(y)}h.forEach((function(t,e){t.t=Array.isArray(t.t[0])?t.t:[t.t],t.r=Array.isArray(t.r[0])?t.r:[t.r]}));var b=Math.min(d.width-d.margin.left-d.margin.right,d.height-d.margin.top-d.margin.bottom)/2;b=Math.max(10,b);var x,_=[d.margin.left+b,d.margin.top+b];p?x=[0,n.max(o.util.sumArrays(o.util.arrayLast(h).r[0],o.util.arrayLast(m)))]:x=n.extent(o.util.flattenArray(h.map((function(t,e){return t.r}))));d.radialAxis.domain!=o.DATAEXTENT&&(x[0]=0),r=n.scale.linear().domain(d.radialAxis.domain!=o.DATAEXTENT&&d.radialAxis.domain?d.radialAxis.domain:x).range([0,b]),c.layout.radialAxis.domain=r.domain();var w,A=o.util.flattenArray(h.map((function(t,e){return t.t}))),T="string"==typeof A[0];T&&(A=o.util.deduplicate(A),w=A.slice(),A=n.range(A.length),h=h.map((function(t,e){var r=t;return t.t=[A],p&&(r.yStack=t.yStack),r})));var k=h.filter((function(t,e){return"LinePlot"===t.geometry||"DotPlot"===t.geometry})).length===h.length,M=null===d.needsEndSpacing?T||!k:d.needsEndSpacing,E=d.angularAxis.domain&&d.angularAxis.domain!=o.DATAEXTENT&&!T&&d.angularAxis.domain[0]>=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("<svg xmlns='http://www.w3.org/2000/svg' class='chart-root'>' + '<g class='outer-group'>' + '<g class='chart-group'>' + '<circle class='background-circle'></circle>' + '<g class='geometry-group'></g>' + '<g class='radial axis-group'>' + '<circle class='outside-circle'></circle>' + '</g>' + '<g class='angular axis-group'></g>' + '<g class='guides-group'><line></line><circle r='0'></circle></g>' + '</g>' + '<g class='legend-group'></g>' + '<g class='tooltips-group'></g>' + '<g class='title-group'><text></text></g>' + '</g>' + '</svg>","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;a<i;a++)(e=t[a])in r?(r[e]++,n[e]=r[e]):r[e]=1;return n},o.util.duplicates=function(t){return Object.keys(o.util.duplicatesCount(t))},o.util.translator=function(t,e,r,n){if(n){var a=r.slice();r=e,e=a}var i=e.reduce((function(t,e){if("undefined"!=typeof t)return t[e]}),t);"undefined"!=typeof i&&(e.reduce((function(t,r,n){if("undefined"!=typeof t)return n===e.length-1&&delete t[r],t[r]}),t),r.reduce((function(t,e,n){return"undefined"==typeof t[e]&&(t[e]={}),n===r.length-1&&(t[e]=i),t[e]}),t))},o.PolyChart=function(){var t=[o.PolyChart.defaultConfig()],e=n.dispatch("hover"),r={solid:"none",dash:[5,2],dot:[2,5]};function i(){var e=t[0].geometryConfig,a=e.container;"string"==typeof a&&(a=n.select(a)),a.datum(t).each((function(t,a){var i=!!t[0].data.yStack,o=t.map((function(t,e){return i?n.zip(t.data.t[0],t.data.r[0],t.data.yStack[0]):n.zip(t.data.t[0],t.data.r[0])})),s=e.angularScale,l=e.radialScale.domain()[0],u={bar:function(r,a,i){var o=t[i].data,l=e.radialScale(r[1])-e.radialScale(0),u=e.radialScale(r[2]||0),c=o.barWidth;n.select(this).attr({class:"mark bar",d:"M"+[[l+u,-c/2],[l+u,c/2],[u,c/2],[u,-c/2]].join("L")+"Z",transform:function(t,r){return"rotate("+(e.orientation+s(t[0]))+")"}})}};u.dot=function(r,a,i){var o=r[2]?[r[0],r[1]+r[2]]:r,s=n.svg.symbol().size(t[i].data.dotSize).type(t[i].data.dotType)(r,a);n.select(this).attr({class:"mark dot",d:s,transform:function(t,r){var n,a,i,s=(n=function(t,r){var n=e.radialScale(t[1]),a=(e.angularScale(t[0])+e.orientation)*Math.PI/180;return{r:n,t:a}}(o),a=n.r*Math.cos(n.t),i=n.r*Math.sin(n.t),{x:a,y:i});return"translate("+[s.x,s.y]+")"}})};var c=n.svg.line.radial().interpolate(t[0].data.lineInterpolation).radius((function(t){return e.radialScale(t[1])})).angle((function(t){return e.angularScale(t[0])*Math.PI/180}));u.line=function(r,a,i){var s=r[2]?o[i].map((function(t,e){return[t[0],t[1]+t[2]]})):o[i];if(n.select(this).each(u.dot).style({opacity:function(e,r){return+t[i].data.dotVisible},fill:p.stroke(r,a,i)}).attr({class:"mark dot"}),!(a>0)){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 r<e.length-1},getCommands:function(){return e},getPreviousCommand:function(){return e[r-1]},getIndex:function(){return r}}}},{}],592:[function(t,e,r){"use strict";['Variables are inserted using %{variable}, for example "y: %{y}".','Numbers are formatted using d3-format\'s syntax %{variable:d3-format}, for example "Price: %{y:$.2f}".',t("../constants/docs").FORMAT_LINK,"for details on the formatting syntax.",'Dates are formatted using d3-time-format\'s syntax %{variable|d3-time-format}, for example "Day: %{2019-01-01|%A}".',t("../constants/docs").DATE_FORMAT_LINK,"for details on the date formatting syntax."].join(" ");function n(t){var e=t.description?" "+t.description:"",r=t.keys||[];if(r.length>0){for(var n=[],a=0;a<r.length;a++)n[a]="`"+r[a]+"`";e+="Finally, the template string has access to ",e=1===r.length?"variable "+n[0]:"variables "+n.slice(0,-1).join(", ")+" and "+n.slice(-1)+"."}return e}r.hovertemplateAttrs=function(t,e){t=t||{};n(e=e||{});var r={valType:"string",dflt:"",editType:t.editType||"none"};return!1!==t.arrayOk&&(r.arrayOk=!0),r},r.texttemplateAttrs=function(t,e){t=t||{};n(e=e||{});var r={valType:"string",dflt:"",editType:t.editType||"calc"};return!1!==t.arrayOk&&(r.arrayOk=!0),r}},{"../constants/docs":472}],593:[function(t,e,r){"use strict";var n=t("./lib/loggers"),a=t("./lib/noop"),i=t("./lib/push_unique"),o=t("./lib/is_plain_object"),s=t("./lib/dom").addStyleRule,l=t("./lib/extend"),u=t("./plots/attributes"),c=t("./plots/layout_attributes"),f=l.extendFlat,d=l.extendDeepAll;function h(t){var e=t.name,a=t.categories,i=t.meta;if(r.modules[e])n.log("Type "+e+" already registered");else{r.subplotsRegistry[t.basePlotModule.name]||function(t){var e=t.name;if(r.subplotsRegistry[e])return void n.log("Plot type "+e+" already registered.");for(var a in m(t),r.subplotsRegistry[e]=t,r.componentsRegistry)x(a,t.name)}(t.basePlotModule);for(var o={},l=0;l<a.length;l++)o[a[l]]=!0,r.allCategories[a[l]]=!0;for(var u in r.modules[e]={_module:t,categories:o},i&&Object.keys(i).length&&(r.modules[e].meta=i),r.allTypes.push(e),r.componentsRegistry)y(u,e);t.layoutAttributes&&f(r.traceLayoutAttributes,t.layoutAttributes);var c=t.basePlotModule,d=c.name;if("mapbox"===d){var h=c.constants.styleRules;for(var p in h)s(".js-plotly-plot .plotly .mapboxgl-"+p,h[p])}"geo"!==d&&"mapbox"!==d||void 0===typeof window||void 0!==window.PlotlyGeoAssets||(window.PlotlyGeoAssets={topojson:{}})}}function p(t){if("string"!=typeof t.name)throw new Error("Component module *name* must be a string.");var e=t.name;for(var n in r.componentsRegistry[e]=t,t.layoutAttributes&&(t.layoutAttributes._isLinkedToArray&&i(r.layoutArrayContainers,e),m(t)),r.modules)y(e,n);for(var a in r.subplotsRegistry)x(e,a);for(var o in r.transformsRegistry)b(e,o);t.schema&&t.schema.layout&&d(c,t.schema.layout)}function g(t){if("string"!=typeof t.name)throw new Error("Transform module *name* must be a string.");var e="Transform module "+t.name,a="function"==typeof t.transform,i="function"==typeof t.calcTransform;if(!a&&!i)throw new Error(e+" is missing a *transform* or *calcTransform* method.");for(var s in a&&i&&n.log([e+" has both a *transform* and *calcTransform* methods.","Please note that all *transform* methods are executed","before all *calcTransform* methods."].join(" ")),o(t.attributes)||n.log(e+" registered without an *attributes* object."),"function"!=typeof t.supplyDefaults&&n.log(e+" registered without a *supplyDefaults* method."),r.transformsRegistry[t.name]=t,r.componentsRegistry)b(s,t.name)}function v(t){var e=t.name,n=e.split("-")[0],a=t.dictionary,i=t.format,o=a&&Object.keys(a).length,s=i&&Object.keys(i).length,l=r.localeRegistry,u=l[e];if(u||(l[e]=u={}),n!==e){var c=l[n];c||(l[n]=c={}),o&&c.dictionary===u.dictionary&&(c.dictionary=a),s&&c.format===u.format&&(c.format=i)}o&&(u.dictionary=a),s&&(u.format=i)}function m(t){if(t.layoutAttributes){var e=t.layoutAttributes._arrayAttrRegexps;if(e)for(var n=0;n<e.length;n++)i(r.layoutArrayRegexes,e[n])}}function y(t,e){var n=r.componentsRegistry[t].schema;if(n&&n.traces){var a=n.traces[e];a&&d(r.modules[e]._module.attributes,a)}}function b(t,e){var n=r.componentsRegistry[t].schema;if(n&&n.transforms){var a=n.transforms[e];a&&d(r.transformsRegistry[e].attributes,a)}}function x(t,e){var n=r.componentsRegistry[t].schema;if(n&&n.subplots){var a=r.subplotsRegistry[e],i=a.layoutAttributes,o="subplot"===a.attr?a.name:a.attr;Array.isArray(o)&&(o=o[0]);var s=n.subplots[o];i&&s&&d(i,s)}}function _(t){return"object"==typeof t&&(t=t.type),t}r.modules={},r.allCategories={},r.allTypes=[],r.subplotsRegistry={},r.transformsRegistry={},r.componentsRegistry={},r.layoutArrayContainers=[],r.layoutArrayRegexes=[],r.traceLayoutAttributes={},r.localeRegistry={},r.apiMethodRegistry={},r.collectableSubplotTypes=null,r.register=function(t){if(r.collectableSubplotTypes=null,!t)throw new Error("No argument passed to Plotly.register.");t&&!Array.isArray(t)&&(t=[t]);for(var e=0;e<t.length;e++){var n=t[e];if(!n)throw new Error("Invalid module was attempted to be registered!");switch(n.moduleType){case"trace":h(n);break;case"transform":g(n);break;case"component":p(n);break;case"locale":v(n);break;case"apiMethod":var a=n.name;r.apiMethodRegistry[a]=n.fn;break;default:throw new Error("Invalid module was attempted to be registered!")}}},r.getModule=function(t){var e=r.modules[_(t)];return!!e&&e._module},r.traceIs=function(t,e){if("various"===(t=_(t)))return!1;var a=r.modules[t];return a||(t&&"area"!==t&&n.log("Unrecognized trace type "+t+"."),a=r.modules[u.type.dflt]),!!a.categories[e]},r.getTransformIndices=function(t,e){for(var r=[],n=t.transforms||[],a=0;a<n.length;a++)n[a].type===e&&r.push(a);return r},r.hasTransform=function(t,e){for(var r=t.transforms||[],n=0;n<r.length;n++)if(r[n].type===e)return!0;return!1},r.getComponentMethod=function(t,e){var n=r.componentsRegistry[t];return n&&n[e]||a},r.call=function(){var t=arguments[0],e=[].slice.call(arguments,1);return r.apiMethodRegistry[t].apply(null,e)}},{"./lib/dom":488,"./lib/extend":490,"./lib/is_plain_object":499,"./lib/loggers":502,"./lib/noop":507,"./lib/push_unique":513,"./plots/attributes":543,"./plots/layout_attributes":583}],594:[function(t,e,r){"use strict";var n=t("../registry"),a=t("../lib"),i=a.extendFlat,o=a.extendDeep;function s(t){var e;switch(t){case"themes__thumb":e={autosize:!0,width:150,height:150,title:{text:""},showlegend:!1,margin:{l:5,r:5,t:5,b:5,pad:0},annotations:[]};break;case"thumbnail":e={title:{text:""},hidesources:!0,showlegend:!1,borderwidth:0,bordercolor:"",margin:{l:1,r:1,t:1,b:1,pad:0},annotations:[]};break;default:e={}}return e}e.exports=function(t,e){var r;t.framework&&t.framework.isPolar&&(t=t.framework.getConfig());var a,l=t.data,u=t.layout,c=o([],l),f=o({},u,s(e.tileClass)),d=t._context||{};if(e.width&&(f.width=e.width),e.height&&(f.height=e.height),"thumbnail"===e.tileClass||"themes__thumb"===e.tileClass){f.annotations=[];var h=Object.keys(f);for(r=0;r<h.length;r++)a=h[r],["xaxis","yaxis","zaxis"].indexOf(a.slice(0,5))>-1&&(f[h[r]].title={text:""});for(r=0;r<c.length;r++){var p=c[r];p.showscale=!1,p.marker&&(p.marker.showscale=!1),n.traceIs(p,"pie-like")&&(p.textposition="none")}}if(Array.isArray(e.annotations))for(r=0;r<e.annotations.length;r++)f.annotations.push(e.annotations[r]);var g=Object.keys(f).filter((function(t){return t.match(/^scene\d*$/)}));if(g.length){var v={};for("thumbnail"===e.tileClass&&(v={title:{text:""},showaxeslabels:!1,showticklabels:!1,linetickenable:!1}),r=0;r<g.length;r++){var m=f[g[r]];m.xaxis||(m.xaxis={}),m.yaxis||(m.yaxis={}),m.zaxis||(m.zaxis={}),i(m.xaxis,v),i(m.yaxis,v),i(m.zaxis,v),m._scene=null}}var y=document.createElement("div");e.tileClass&&(y.className=e.tileClass);var b={gd:y,td:y,layout:f,data:c,config:{staticPlot:void 0===e.staticPlot||e.staticPlot,plotGlPixelRatio:void 0===e.plotGlPixelRatio?2:e.plotGlPixelRatio,displaylogo:e.displaylogo||!1,showLink:e.showLink||!1,showTips:e.showTips||!1,mapboxAccessToken:d.mapboxAccessToken}};return"transparent"!==e.setBackground&&(b.config.setBackground=e.setBackground||"opaque"),b.gd.defaultLayout=s(e.tileClass),b}},{"../lib":498,"../registry":593}],595:[function(t,e,r){"use strict";var n=t("../lib"),a=t("../plot_api/to_image"),i=t("./filesaver"),o=t("./helpers");e.exports=function(t,e){var r;return n.isPlainObject(t)||(r=n.getGraphDiv(t)),(e=e||{}).format=e.format||"png",e.width=e.width||null,e.height=e.height||null,e.imageDataOnly=!0,new Promise((function(s,l){r&&r._snapshotInProgress&&l(new Error("Snapshotting already in progress.")),n.isIE()&&"svg"!==e.format&&l(new Error(o.MSG_IE_BAD_FORMAT)),r&&(r._snapshotInProgress=!0);var u=a(t,e),c=e.filename||t.fn||"newplot";c+="."+e.format.replace("-","."),u.then((function(t){return r&&(r._snapshotInProgress=!1),i(t,c,e.format)})).then((function(t){s(t)})).catch((function(t){r&&(r._snapshotInProgress=!1),l(t)}))}))}},{"../lib":498,"../plot_api/to_image":539,"./filesaver":596,"./helpers":597}],596:[function(t,e,r){"use strict";var n=t("../lib"),a=t("./helpers");e.exports=function(t,e,r){var i=document.createElement("a"),o="download"in i;return new Promise((function(s,l){var u,c;if(n.isIE9orBelow()&&l(new Error("IE < 10 unsupported")),n.isSafari()){var f="svg"===r?",":";base64,";return a.octetStream(f+encodeURIComponent(t)),s(e)}return n.isIE()?(u=a.createBlob(t,"svg"),window.navigator.msSaveBlob(u,e),u=null,s(e)):o?(u=a.createBlob(t,r),c=a.createObjectURL(u),i.href=c,i.download=e,document.body.appendChild(i),i.click(),document.body.removeChild(i),a.revokeObjectURL(c),u=null,s(e)):void l(new Error("download error"))}))}},{"../lib":498,"./helpers":597}],597:[function(t,e,r){"use strict";var n=t("../registry");r.getDelay=function(t){return t._has&&(t._has("gl3d")||t._has("gl2d")||t._has("mapbox"))?500:0},r.getRedrawFunc=function(t){return function(){var e=t._fullLayout||{};!(e._has&&e._has("polar"))&&t.data&&t.data[0]&&t.data[0].r||n.getComponentMethod("colorbar","draw")(t)}},r.encodeSVG=function(t){return"data:image/svg+xml,"+encodeURIComponent(t)},r.encodeJSON=function(t){return"data:application/json,"+encodeURIComponent(t)};var a=window.URL||window.webkitURL;r.createObjectURL=function(t){return a.createObjectURL(t)},r.revokeObjectURL=function(t){return a.revokeObjectURL(t)},r.createBlob=function(t,e){if("svg"===e)return new window.Blob([t],{type:"image/svg+xml;charset=utf-8"});if("full-json"===e)return new window.Blob([t],{type:"application/json;charset=utf-8"});var r=function(t){for(var e=t.length,r=new ArrayBuffer(e),n=new Uint8Array(r),a=0;a<e;a++)n[a]=t.charCodeAt(a);return r}(window.atob(t));return new window.Blob([r],{type:"image/"+e})},r.octetStream=function(t){document.location.href="data:application/octet-stream"+t},r.IMAGE_URL_PREFIX=/^data:image\/\w+;base64,/,r.MSG_IE_BAD_FORMAT="Sorry IE does not support downloading from canvas. Try {format:'svg'} instead."},{"../registry":593}],598:[function(t,e,r){"use strict";var n=t("./helpers"),a={getDelay:n.getDelay,getRedrawFunc:n.getRedrawFunc,clone:t("./cloneplot"),toSVG:t("./tosvg"),svgToImg:t("./svgtoimg"),toImage:t("./toimage"),downloadImage:t("./download")};e.exports=a},{"./cloneplot":594,"./download":595,"./helpers":597,"./svgtoimg":599,"./toimage":600,"./tosvg":601}],599:[function(t,e,r){"use strict";var n=t("../lib"),a=t("events").EventEmitter,i=t("./helpers");e.exports=function(t){var e=t.emitter||new a,r=new Promise((function(a,o){var s=window.Image,l=t.svg,u=t.format||"png";if(n.isIE()&&"svg"!==u){var c=new Error(i.MSG_IE_BAD_FORMAT);return o(c),t.promise?r:e.emit("error",c)}var f,d,h=t.canvas,p=t.scale||1,g=t.width||300,v=t.height||150,m=p*g,y=p*v,b=h.getContext("2d"),x=new s;"svg"===u||n.isIE9orBelow()||n.isSafari()?d=i.encodeSVG(l):(f=i.createBlob(l,"svg"),d=i.createObjectURL(f)),h.width=m,h.height=y,x.onload=function(){var r;switch(f=null,i.revokeObjectURL(d),"svg"!==u&&b.drawImage(x,0,0,m,y),u){case"jpeg":r=h.toDataURL("image/jpeg");break;case"png":r=h.toDataURL("image/png");break;case"webp":r=h.toDataURL("image/webp");break;case"svg":r=d;break;default:var n="Image format is not jpeg, png, svg or webp.";if(o(new Error(n)),!t.promise)return e.emit("error",n)}a(r),t.promise||e.emit("success",r)},x.onerror=function(r){if(f=null,i.revokeObjectURL(d),o(r),!t.promise)return e.emit("error",r)},x.src=d}));return t.promise?r:e}},{"../lib":498,"./helpers":597,events:51}],600:[function(t,e,r){"use strict";var n=t("events").EventEmitter,a=t("../registry"),i=t("../lib"),o=t("./helpers"),s=t("./cloneplot"),l=t("./tosvg"),u=t("./svgtoimg");e.exports=function(t,e){var r=new n,c=s(t,{format:"png"}),f=c.gd;f.style.position="absolute",f.style.left="-5000px",document.body.appendChild(f);var d=o.getRedrawFunc(f);return a.call("plot",f,c.data,c.layout,c.config).then(d).then((function(){var t=o.getDelay(f._fullLayout);setTimeout((function(){var t=l(f),n=document.createElement("canvas");n.id=i.randstr(),(r=u({format:e.format,width:f._fullLayout.width,height:f._fullLayout.height,canvas:n,emitter:r,svg:t})).clean=function(){f&&document.body.removeChild(f)}}),t)})).catch((function(t){r.emit("error",t)})),r}},{"../lib":498,"../registry":593,"./cloneplot":594,"./helpers":597,"./svgtoimg":599,"./tosvg":601,events:51}],601:[function(t,e,r){"use strict";var n=t("d3"),a=t("../lib"),i=t("../components/drawing"),o=t("../components/color"),s=t("../constants/xmlns_namespaces"),l=/"/g,u=new RegExp('("TOBESTRIPPED)|(TOBESTRIPPED")',"g");e.exports=function(t,e,r){var c,f=t._fullLayout,d=f._paper,h=f._toppaper,p=f.width,g=f.height;d.insert("rect",":first-child").call(i.setRect,0,0,p,g).call(o.fill,f.paper_bgcolor);var v=f._basePlotModules||[];for(c=0;c<v.length;c++){var m=v[c];m.toSVG&&m.toSVG(t)}if(h){var y=h.node().childNodes,b=Array.prototype.slice.call(y);for(c=0;c<b.length;c++){var x=b[c];x.childNodes.length&&d.node().appendChild(x)}}if(f._draggers&&f._draggers.remove(),d.node().style.background="",d.selectAll("text").attr({"data-unformatted":null,"data-math":null}).each((function(){var t=n.select(this);if("hidden"!==this.style.visibility&&"none"!==this.style.display){t.style({visibility:null,display:null});var e=this.style.fontFamily;e&&-1!==e.indexOf('"')&&t.style("font-family",e.replace(l,"TOBESTRIPPED"))}else t.remove()})),f._gradientUrlQueryParts){var _=[];for(var w in f._gradientUrlQueryParts)_.push(w);_.length&&d.selectAll(_.join(",")).each((function(){var t=n.select(this),e=this.style.fill;e&&-1!==e.indexOf("url(")&&t.style("fill",e.replace(l,"TOBESTRIPPED"));var r=this.style.stroke;r&&-1!==r.indexOf("url(")&&t.style("stroke",r.replace(l,"TOBESTRIPPED"))}))}"pdf"!==e&&"eps"!==e||d.selectAll("#MathJax_SVG_glyphs path").attr("stroke-width",0),d.node().setAttributeNS(s.xmlns,"xmlns",s.svg),d.node().setAttributeNS(s.xmlns,"xmlns:xlink",s.xlink),"svg"===e&&r&&(d.attr("width",r*p),d.attr("height",r*g),d.attr("viewBox","0 0 "+p+" "+g));var A=(new window.XMLSerializer).serializeToString(d.node());return A=function(t){var e=n.select("body").append("div").style({display:"none"}).html(""),r=t.replace(/(&[^;]*;)/gi,(function(t){return"&lt;"===t?"&#60;":"&rt;"===t?"&#62;":-1!==t.indexOf("<")||-1!==t.indexOf(">")?"":e.html(t).text()}));return e.remove(),r}(A),A=(A=A.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&amp;")).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;r<t.length;r++)t[r].i=r;n.mergeArray(e.text,t,"tx"),n.mergeArray(e.hovertext,t,"htx");var a=e.marker;if(a){n.mergeArray(a.opacity,t,"mo",!0),n.mergeArray(a.color,t,"mc");var i=a.line;i&&(n.mergeArray(i.color,t,"mlc"),n.mergeArrayCastPositive(i.width,t,"mlw"))}}},{"../../lib":498}],603:[function(t,e,r){"use strict";var n=t("../heatmap/attributes"),a=t("../scatter/attributes"),i=t("../../components/colorscale/attributes"),o=t("../../components/drawing/attributes").dash,s=t("../../plots/font_attributes"),l=t("../../lib/extend").extendFlat,u=t("../../constants/filter_ops"),c=u.COMPARISON_OPS2,f=u.INTERVAL_OPS,d=(t("../../constants/docs").FORMAT_LINK,a.line);e.exports=l({z:n.z,x:n.x,x0:n.x0,dx:n.dx,y:n.y,y0:n.y0,dy:n.dy,xperiod:n.xperiod,yperiod:n.yperiod,xperiod0:a.xperiod0,yperiod0:a.yperiod0,xperiodalignment:n.xperiodalignment,yperiodalignment:n.yperiodalignment,text:n.text,hovertext:n.hovertext,transpose:n.transpose,xtype:n.xtype,ytype:n.ytype,zhoverformat:n.zhoverformat,hovertemplate:n.hovertemplate,hoverongaps:n.hoverongaps,connectgaps:l({},n.connectgaps,{}),fillcolor:{valType:"color",editType:"calc"},autocontour:{valType:"boolean",dflt:!0,editType:"calc",impliedEdits:{"contours.start":void 0,"contours.end":void 0,"contours.size":void 0}},ncontours:{valType:"integer",dflt:15,min:1,editType:"calc"},contours:{type:{valType:"enumerated",values:["levels","constraint"],dflt:"levels",editType:"calc"},start:{valType:"number",dflt:null,editType:"plot",impliedEdits:{"^autocontour":!1}},end:{valType:"number",dflt:null,editType:"plot",impliedEdits:{"^autocontour":!1}},size:{valType:"number",dflt:null,min:0,editType:"plot",impliedEdits:{"^autocontour":!1}},coloring:{valType:"enumerated",values:["fill","heatmap","lines","none"],dflt:"fill",editType:"calc"},showlines:{valType:"boolean",dflt:!0,editType:"plot"},showlabels:{valType:"boolean",dflt:!1,editType:"plot"},labelfont:s({editType:"plot",colorEditType:"style"}),labelformat:{valType:"string",dflt:"",editType:"plot"},operation:{valType:"enumerated",values:[].concat(c).concat(f),dflt:"=",editType:"calc"},value:{valType:"any",dflt:0,editType:"calc"},editType:"calc",impliedEdits:{autocontour:!1}},line:{color:l({},d.color,{editType:"style+colorbars"}),width:{valType:"number",min:0,editType:"style+colorbars"},dash:o,smoothing:l({},d.smoothing,{}),editType:"plot"}},i("",{cLetter:"z",autoColorDflt:!1,editTypeOverride:"calc"}))},{"../../components/colorscale/attributes":375,"../../components/drawing/attributes":389,"../../constants/docs":472,"../../constants/filter_ops":473,"../../lib/extend":490,"../../plots/font_attributes":575,"../heatmap/attributes":616,"../scatter/attributes":654}],604:[function(t,e,r){"use strict";var n=t("../../components/colorscale"),a=t("../heatmap/calc"),i=t("./set_contours"),o=t("./end_plus");e.exports=function(t,e){var r=a(t,e),s=r[0].z;i(e,s);var l,u=e.contours,c=n.extractOpts(e);if("heatmap"===u.coloring&&c.auto&&!1===e.autocontour){var f=u.start,d=o(u),h=u.size||1,p=Math.floor((d-f)/h)+1;isFinite(h)||(h=1,p=1);var g=f-h/2;l=[g,g+p*h]}else l=s;return n.calc(t,e,{vals:l,cLetter:"z"}),r}},{"../../components/colorscale":380,"../heatmap/calc":617,"./end_plus":609,"./set_contours":612}],605:[function(t,e,r){"use strict";var n=t("../../components/colorscale"),a=t("./make_color_map"),i=t("./end_plus");e.exports={min:"zmin",max:"zmax",calc:function(t,e,r){var o=e.contours,s=e.line,l=o.size||1,u=o.coloring,c=a(e,{isColorbar:!0});if("heatmap"===u){var f=n.extractOpts(e);r._fillgradient=f.reversescale?n.flipScale(f.colorscale):f.colorscale,r._zrange=[f.min,f.max]}else"fill"===u&&(r._fillcolor=c);r._line={color:"lines"===u?c:s.color,width:!1!==o.showlines?s.width:0,dash:s.dash},r._levels={start:o.start,end:i(o),size:l}}}},{"../../components/colorscale":380,"./end_plus":609,"./make_color_map":611}],606:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("./label_defaults"),i=t("../../components/color"),o=i.addOpacity,s=i.opacity,l=t("../../constants/filter_ops"),u=l.CONSTRAINT_REDUCTION,c=l.COMPARISON_OPS2;e.exports=function(t,e,r,i,l,f){var d,h,p,g=e.contours,v=r("contours.operation");(g._operation=u[v],function(t,e){var r;-1===c.indexOf(e.operation)?(t("contours.value",[0,1]),Array.isArray(e.value)?e.value.length>2?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;d<p;d++)f=h[d],g[d]=f[0]*(y-m)+m,v[d]=f[1];var b=n.extent([m,y,e.start,e.start+s*(l-1)]),x=b[m<y?0:1],_=b[m<y?1:0];x!==m&&(g.splice(0,0,x),v.splice(0,0,v[0])),_!==y&&(g.push(_),v.push(v[v.length-1]))}else for(d=0;d<p;d++)f=h[d],g[d]=(f[0]*(l+u-1)-u/2)*s+r,v[d]=f[1];return a.makeColorScaleFunc({domain:g,range:v},{noNumericCheck:!0})}},{"../../components/colorscale":380,"./end_plus":609,d3:86}],612:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axes"),a=t("../../lib");function i(t,e,r){var a={type:"linear",range:[t,e]};return n.autoTicks(a,(e-t)/(r||15)),a}e.exports=function(t,e){var r=t.contours;if(t.autocontour){var o=t.zmin,s=t.zmax;(t.zauto||void 0===o)&&(o=a.aggNums(Math.min,null,e)),(t.zauto||void 0===s)&&(s=a.aggNums(Math.max,null,e));var l=i(o,s,t.ncontours);r.size=l.dtick,r.start=n.tickFirst(l),l.range.reverse(),r.end=n.tickFirst(l),r.start===o&&(r.start+=r.size),r.end===s&&(r.end-=r.size),r.start>r.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;h<c;h++)for(var p=f[h]=n+i*h-(l?i/2:0),g=s(u(p)),v=0;v<4;v++)d[4*h+v]=g[v];return{levels:f,levelColors:d}}u.handlePick=function(t){var e=this.heatmapOptions,r=e.shape,n=t.pointId,a=n%r[0],i=Math.floor(n/r[0]),o=n;return{trace:this,dataCoord:t.dataCoord,traceCoord:[e.x[a],e.y[i],e.z[o]],textLabel:this.textLabels[n],name:this.name,pointIndex:[i,a],hoverinfo:this.hoverinfo}},u.update=function(t,e){var r=e[0];this.index=t.index,this.name=t.name,this.hoverinfo=t.hoverinfo;var n,a=r.z,o=a[0].length,s=a.length;this.contourOptions.z=function(t,e,r){for(var n=new Float32Array(e*r),a=0,i=0;i<e;i++)for(var o=0;o<r;o++)n[a++]=t[o][i];return n}(a,o,s),this.heatmapOptions.z=[].concat.apply([],a),this.contourOptions.shape=this.heatmapOptions.shape=[o,s],this.contourOptions.x=this.heatmapOptions.x=r.x,this.contourOptions.y=this.heatmapOptions.y=r.y,"fill"===t.contours.coloring?(n=c(t,{fill:!0}),this.contourOptions.levels=n.levels.slice(1),this.contourOptions.fillColors=n.levelColors,this.contourOptions.levelColors=[].concat.apply([],this.contourOptions.levels.map((function(){return[.25,.25,.25,1]})))):(n=c(t,{fill:!1}),this.contourOptions.levels=n.levels,this.contourOptions.levelColors=n.levelColors),this.textLabels=[].concat.apply([],t.text),this.contour.update(this.contourOptions),this.heatmap.update(this.heatmapOptions);var l=this.scene.xaxis,u=this.scene.yaxis;t._extremes[l._id]=i.findExtremes(l,r.x),t._extremes[u._id]=i.findExtremes(u,r.y)},u.dispose=function(){this.contour.dispose(),this.heatmap.dispose()},e.exports=function(t,e,r){var n=new l(t,e.uid);return n.update(e,r),n}},{"../../lib/str2rgbarray":522,"../../plots/cartesian/axes":547,"../contour/make_color_map":611,"gl-contour2d":165,"gl-heatmap2d":170}],615:[function(t,e,r){"use strict";var n=t("../../plot_api/edit_types").overrideAll;e.exports={attributes:n(t("../contour/attributes"),"calc","nested"),supplyDefaults:t("../contour/defaults"),colorbar:t("../contour/colorbar"),calc:t("../contour/calc"),plot:t("./convert"),moduleType:"trace",name:"contourgl",basePlotModule:t("../../plots/gl2d"),categories:["gl","gl2d","2dMap"],meta:{}}},{"../../plot_api/edit_types":529,"../../plots/gl2d":580,"../contour/attributes":603,"../contour/calc":604,"../contour/colorbar":605,"../contour/defaults":608,"./convert":614}],616:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),a=t("../../plots/attributes"),i=t("../../plots/template_attributes").hovertemplateAttrs,o=t("../../components/colorscale/attributes"),s=(t("../../constants/docs").FORMAT_LINK,t("../../lib/extend").extendFlat);e.exports=s({z:{valType:"data_array",editType:"calc"},x:s({},n.x,{impliedEdits:{xtype:"array"}}),x0:s({},n.x0,{impliedEdits:{xtype:"scaled"}}),dx:s({},n.dx,{impliedEdits:{xtype:"scaled"}}),y:s({},n.y,{impliedEdits:{ytype:"array"}}),y0:s({},n.y0,{impliedEdits:{ytype:"scaled"}}),dy:s({},n.dy,{impliedEdits:{ytype:"scaled"}}),xperiod:s({},n.xperiod,{impliedEdits:{xtype:"scaled"}}),yperiod:s({},n.yperiod,{impliedEdits:{ytype:"scaled"}}),xperiod0:s({},n.xperiod0,{impliedEdits:{xtype:"scaled"}}),yperiod0:s({},n.yperiod0,{impliedEdits:{ytype:"scaled"}}),xperiodalignment:s({},n.xperiodalignment,{impliedEdits:{xtype:"scaled"}}),yperiodalignment:s({},n.yperiodalignment,{impliedEdits:{ytype:"scaled"}}),text:{valType:"data_array",editType:"calc"},hovertext:{valType:"data_array",editType:"calc"},transpose:{valType:"boolean",dflt:!1,editType:"calc"},xtype:{valType:"enumerated",values:["array","scaled"],editType:"calc+clearAxisTypes"},ytype:{valType:"enumerated",values:["array","scaled"],editType:"calc+clearAxisTypes"},zsmooth:{valType:"enumerated",values:["fast","best",!1],dflt:!1,editType:"calc"},hoverongaps:{valType:"boolean",dflt:!0,editType:"none"},connectgaps:{valType:"boolean",editType:"calc"},xgap:{valType:"number",dflt:0,min:0,editType:"plot"},ygap:{valType:"number",dflt:0,min:0,editType:"plot"},zhoverformat:{valType:"string",dflt:"",editType:"none"},hovertemplate:i(),showlegend:s({},a.showlegend,{dflt:!1})},{transforms:void 0},o("",{cLetter:"z",autoColorDflt:!1}))},{"../../components/colorscale/attributes":375,"../../constants/docs":472,"../../lib/extend":490,"../../plots/attributes":543,"../../plots/template_attributes":592,"../scatter/attributes":654}],617:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../lib"),i=t("../../plots/cartesian/axes"),o=t("../../plots/cartesian/align_period"),s=t("../histogram2d/calc"),l=t("../../components/colorscale/calc"),u=t("./convert_column_xyz"),c=t("./clean_2d_array"),f=t("./interp2d"),d=t("./find_empties"),h=t("./make_bound_array"),p=t("../../constants/numerical").BADNUM;function g(t){for(var e=[],r=t.length,n=0;n<r;n++){var a=t[n];a!==p&&e.push(a)}return e}e.exports=function(t,e){var r,v,m,y,b,x,_,w,A,T,k,M=i.getFromId(t,e.xaxis||"x"),E=i.getFromId(t,e.yaxis||"y"),S=n.traceIs(e,"contour"),C=n.traceIs(e,"histogram"),L=n.traceIs(e,"gl2d"),O=S?"best":e.zsmooth;if(M._minDtick=0,E._minDtick=0,C)y=(k=s(t,e)).orig_x,r=k.x,v=k.x0,m=k.dx,w=k.orig_y,b=k.y,x=k.y0,_=k.dy,A=k.z;else{var D=e.z;a.isArray1D(D)?(u(e,M,E,"x","y",["z"]),r=e._x,b=e._y,D=e._z):(y=e.x?M.makeCalcdata(e,"x"):[],w=e.y?E.makeCalcdata(e,"y"):[],r=o(e,M,"x",y),b=o(e,E,"y",w),e._x=r,e._y=b),v=e.x0,m=e.dx,x=e.y0,_=e.dy,A=c(D,e,M,E)}function R(t){O=e._input.zsmooth=e.zsmooth=!1,a.warn('cannot use zsmooth: "fast": '+t)}if((M.rangebreaks||E.rangebreaks)&&(A=function(t,e,r){for(var n=[],a=-1,i=0;i<r.length;i++)if(e[i]!==p){a++,n[a]=[];for(var o=0;o<r[i].length;o++)t[o]!==p&&n[a].push(r[i][o])}return n}(r,b,A),C||(r=g(r),b=g(b),e._x=r,e._y=b)),C||!S&&!e.connectgaps||(e._emptypoints=d(A),f(A,e._emptypoints)),"fast"===O)if("log"===M.type||"log"===E.type)R("log axis found");else if(!C){if(r.length){var I=(r[r.length-1]-r[0])/(r.length-1),P=Math.abs(I/100);for(T=0;T<r.length-1;T++)if(Math.abs(r[T+1]-r[T]-I)>P){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;T<b.length-1;T++)if(Math.abs(b[T+1]-b[T]-F)>z){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<t.length;f++)s=Math.max(s,t[f].length);if(0===s)return!1;u=function(t){return t.length},c=function(t,e,r){return(t[r]||[])[e]}}else s=t.length,u=function(t,e){return t[e].length},c=function(t,e,r){return(t[e]||[])[r]};var p=function(t,e,r){return e===i||r===i?i:c(t,e,r)};function g(t){if(e&&"carpet"!==e.type&&"contourcarpet"!==e.type&&t&&"category"===t.type&&e["_"+t._id.charAt(0)].length){var r=t._id.charAt(0),n={},o=e["_"+r+"CategoryMap"]||e[r];for(f=0;f<o.length;f++)n[o[f]]=f;return function(e){var r=n[t._categories[e]];return r+1?r:i}}return a.identity}var v=g(r),m=g(o);o&&"category"===o.type&&(s=o._categories.length);var y=new Array(s);for(f=0;f<s;f++)for(l=r&&"category"===r.type?r._categories.length:u(t,f),y[f]=new Array(l),d=0;d<l;d++)y[f][d]=h(p(t,m(f),v(d)));return y}},{"../../constants/numerical":475,"../../lib":498,"fast-isnumeric":155}],619:[function(t,e,r){"use strict";e.exports={min:"zmin",max:"zmax"}},{}],620:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../constants/numerical").BADNUM,i=t("../../plots/cartesian/align_period");e.exports=function(t,e,r,o,s,l){var u=t._length,c=e.makeCalcdata(t,o),f=r.makeCalcdata(t,s);c=i(t,e,o,c),f=i(t,r,s,f);var d,h,p,g,v=t.text,m=void 0!==v&&n.isArray1D(v),y=t.hovertext,b=void 0!==y&&n.isArray1D(y),x=n.distinctVals(c),_=x.vals,w=n.distinctVals(f),A=w.vals,T=[],k=A.length,M=_.length;for(d=0;d<l.length;d++)T[d]=n.init2dArray(k,M);m&&(p=n.init2dArray(k,M)),b&&(g=n.init2dArray(k,M));var E=n.init2dArray(k,M);for(d=0;d<u;d++)if(c[d]!==a&&f[d]!==a){var S=n.findBin(c[d]+x.minDiff/2,_),C=n.findBin(f[d]+w.minDiff/2,A);for(h=0;h<l.length;h++){var L=t[l[h]];T[h][C][S]=L[d],E[C][S]=d}m&&(p[C][S]=v[d]),b&&(g[C][S]=y[d])}for(t["_"+o]=_,t["_"+s]=A,h=0;h<l.length;h++)t["_"+l[h]]=T[h];m&&(t._text=p),b&&(t._hovertext=g),e&&"category"===e.type&&(t["_"+o+"CategoryMap"]=_.map((function(t){return e._categories[t]}))),r&&"category"===r.type&&(t["_"+s+"CategoryMap"]=A.map((function(t){return r._categories[t]}))),t._after2before=E}},{"../../constants/numerical":475,"../../lib":498,"../../plots/cartesian/align_period":544}],621:[function(t,e,r){"use strict";var n=t("../../lib").maxRowLength;e.exports=function(t){var e,r,a,i,o,s,l,u,c=[],f={},d=[],h=t[0],p=[],g=[0,0,0],v=n(t);for(r=0;r<t.length;r++)for(e=p,p=h,h=t[r+1]||[],a=0;a<v;a++)void 0===p[a]&&((s=(void 0!==p[a-1]?1:0)+(void 0!==p[a+1]?1:0)+(void 0!==e[a]?1:0)+(void 0!==h[a]?1:0))?(0===r&&s++,0===a&&s++,r===t.length-1&&s++,a===p.length-1&&s++,s<4&&(f[[r,a]]=[r,a,s]),c.push([r,a,s])):d.push([r,a]));for(;d.length;){for(l={},u=!1,o=d.length-1;o>=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;s<e.length;s++){for(i=(n=e[s])[0],o=n[1],p=t[i][o],h=0,d=0,l=0;l<4;l++)(c=t[i+(u=a[l])[0]])&&void 0!==(f=c[o+u[1]])&&(0===h?g=v=f:(g=Math.min(g,f),v=Math.max(v,f)),d++,h+=f);if(0===d)throw"iterateInterp2d order is wrong: no defined neighbors";t[i][o]=h/d,void 0===p?d<4&&(m=1):(t[i][o]=(1+r)*t[i][o]-r*p,v>g&&(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<e.length&&!(e[r][2]<4);r++);for(e=e.slice(r),r=0;r<100&&a>.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;c<g;c++)f.push(.5*(e[c-1]+e[c]));f.push(1.5*e[g-1]-.5*e[g-2])}if(g<o){var v=f[f.length-1],m=v-f[f.length-2];for(c=g;c<o;c++)v+=m,f.push(v)}}else{var y=t[s._id.charAt(0)+"calendar"];if(h)l=s.r2c(r,0,y);else if(a(e)&&1===e.length)l=e[0];else if(void 0===r)l=0;else{l=("log"===s.type?s.d2c:s.r2c)(r,0,y)}for(u=i||1,c=d||p?0:-.5;c<o;c++)f.push(l+u*c)}return f}},{"../../lib":498,"../../registry":593}],624:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib"),i=t("../../registry");function o(t,e){var r=e(t);return"scaled"===(r?e(t+"type","array"):"scaled")&&(e(t+"0"),e("d"+t)),r}e.exports=function(t,e,r,s,l,u){var c,f,d=r("z");if(l=l||"x",u=u||"y",void 0===d||!d.length)return 0;if(a.isArray1D(t.z)){c=r(l),f=r(u);var h=a.minRowLength(c),p=a.minRowLength(f);if(0===h||0===p)return 0;e._length=Math.min(h,p,d.length)}else{if(c=o(l,r),f=o(u,r),!function(t){for(var e,r=!0,i=!1,o=!1,s=0;s<t.length;s++){if(e=t[s],!a.isArrayOrTypedArray(e)){r=!1;break}e.length>0&&(i=!0);for(var l=0;l<e.length;l++)if(n(e[l])){o=!0;break}}return r&&i&&o}(d))return 0;r("transpose"),e._length=null}return"heatmapgl"===t.type||"contourgl"===t.type||i.getComponentMethod("calendars","handleTraceDefaults")(t,e,[l,u],s),!0}},{"../../lib":498,"../../registry":593,"fast-isnumeric":155}],625:[function(t,e,r){"use strict";for(var n=t("../heatmap/attributes"),a=t("../../components/colorscale/attributes"),i=t("../../lib/extend").extendFlat,o=t("../../plot_api/edit_types").overrideAll,s=["z","x","x0","dx","y","y0","dy","text","transpose","xtype","ytype"],l={},u=0;u<s.length;u++){var c=s[u];l[c]=n[c]}l.zsmooth={valType:"enumerated",values:["fast",!1],dflt:"fast",editType:"calc"},i(l,a("",{cLetter:"z",autoColorDflt:!1})),e.exports=o(l,"calc","nested")},{"../../components/colorscale/attributes":375,"../../lib/extend":490,"../../plot_api/edit_types":529,"../heatmap/attributes":616}],626:[function(t,e,r){"use strict";var n=t("gl-heatmap2d"),a=t("../../plots/cartesian/axes"),i=t("../../lib/str2rgbarray");function o(t,e){this.scene=t,this.uid=e,this.type="heatmapgl",this.name="",this.hoverinfo="all",this.xData=[],this.yData=[],this.zData=[],this.textLabels=[],this.idToIndex=[],this.bounds=[0,0,0,0],this.options={zsmooth:"fast",z:[],x:[],y:[],shape:[0,0],colorLevels:[0],colorValues:[0,0,0,1]},this.heatmap=n(t.glplot,this.options),this.heatmap._trace=this}var s=o.prototype;s.handlePick=function(t){var e=this.options,r=e.shape,n=t.pointId,a=n%r[0],i=Math.floor(n/r[0]),o=n;return{trace:this,dataCoord:t.dataCoord,traceCoord:[e.x[a],e.y[i],e.z[o]],textLabel:this.textLabels[n],name:this.name,pointIndex:[i,a],hoverinfo:this.hoverinfo}},s.update=function(t,e){var r=e[0];this.index=t.index,this.name=t.name,this.hoverinfo=t.hoverinfo;var n=r.z;this.options.z=[].concat.apply([],n);var o=n[0].length,s=n.length;this.options.shape=[o,s],this.options.x=r.x,this.options.y=r.y,this.options.zsmooth=t.zsmooth;var l=function(t){for(var e=t.colorscale,r=t.zmin,n=t.zmax,a=e.length,o=new Array(a),s=new Array(4*a),l=0;l<a;l++){var u=e[l],c=i(u[1]);o[l]=r+u[0]*(n-r);for(var f=0;f<4;f++)s[4*l+f]=c[f]}return{colorLevels:o,colorValues:s}}(t);this.options.colorLevels=l.colorLevels,this.options.colorValues=l.colorValues,this.textLabels=[].concat.apply([],t.text),this.heatmap.update(this.options);var u,c,f=this.scene.xaxis,d=this.scene.yaxis;!1===t.zsmooth&&(u={ppad:r.x[1]-r.x[0]},c={ppad:r.y[1]-r.y[0]}),t._extremes[f._id]=a.findExtremes(f,r.x,u),t._extremes[d._id]=a.findExtremes(d,r.y,c)},s.dispose=function(){this.heatmap.dispose()},e.exports=function(t,e,r){var n=new o(t,e.uid);return n.update(e,r),n}},{"../../lib/str2rgbarray":522,"../../plots/cartesian/axes":547,"gl-heatmap2d":170}],627:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../heatmap/xyz_defaults"),i=t("../../components/colorscale/defaults"),o=t("./attributes");e.exports=function(t,e,r,s){function l(r,a){return n.coerce(t,e,o,r,a)}a(t,e,l,s)?(l("text"),l("zsmooth"),i(t,e,s,l,{prefix:"",cLetter:"z"})):e.visible=!1}},{"../../components/colorscale/defaults":378,"../../lib":498,"../heatmap/xyz_defaults":624,"./attributes":625}],628:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),colorbar:t("../heatmap/colorbar"),calc:t("../heatmap/calc"),plot:t("./convert"),moduleType:"trace",name:"heatmapgl",basePlotModule:t("../../plots/gl2d"),categories:["gl","gl2d","2dMap"],meta:{}}},{"../../plots/gl2d":580,"../heatmap/calc":617,"../heatmap/colorbar":619,"./attributes":625,"./convert":626,"./defaults":627}],629:[function(t,e,r){"use strict";e.exports=function(t,e){for(var r=t.length,n=0,a=0;a<r;a++)e[a]?(t[a]/=e[a],n+=t[a]):t[a]=null;return n}},{}],630:[function(t,e,r){"use strict";var n=t("fast-isnumeric");e.exports={count:function(t,e,r){return r[t]++,1},sum:function(t,e,r,a){var i=a[e];return n(i)?(i=Number(i),r[t]+=i,i):0},avg:function(t,e,r,a,i){var o=a[e];return n(o)&&(o=Number(o),r[t]+=o,i[t]++),0},min: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]>i){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]<i){var o=i-r[t];return r[t]=i,o}}return 0}}},{"fast-isnumeric":155}],631:[function(t,e,r){"use strict";var n=t("../../constants/numerical"),a=n.ONEAVGYEAR,i=n.ONEAVGMONTH,o=n.ONEDAY,s=n.ONEHOUR,l=n.ONEMIN,u=n.ONESEC,c=t("../../plots/cartesian/axes").tickIncrement;function f(t,e,r,n){if(t*e<=0)return 1/0;for(var a=Math.abs(e-t),i="date"===r.type,o=d(a,i),s=0;s<10;s++){var l=d(80*o,i);if(o===l)break;if(!h(l,t,e,i,r,n))break;o=l}return o}function d(t,e){return e&&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&&m<Math.abs(g-p)/4e3?(s=v,l=!1):(s=Math.min(v,m),l=!0),"date"===n.type&&s>o){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(u<e){var f=c(u,b,!1,i);(u+f)/2<e+t&&(u=f)}return r&&l?c(u,b,!0,i):u}}return function(e,r){var n=s*Math.round(e/s);return n+s/10<e&&n+.9*s<e+t&&(n+=s),r&&l&&(n-=s),n}}},{"../../constants/numerical":475,"../../plots/cartesian/axes":547}],632:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib"),i=t("../../registry"),o=t("../../plots/cartesian/axes"),s=t("../bar/arrays_to_calcdata"),l=t("./bin_functions"),u=t("./norm_functions"),c=t("./average"),f=t("./bin_label_vals");function d(t,e,r,s,l){var u,c,f,h,p,g,v,m=s+"bins",y=t._fullLayout,b=e["_"+s+"bingroup"],x=y._histogramBinOpts[b],_="overlay"===y.barmode,w=function(t){return r.r2c(t,0,h)},A=function(t){return r.c2r(t,0,h)},T="date"===r.type?function(t){return t||0===t?a.cleanDate(t,null,h):null}:function(t){return n(t)?Number(t):null};function k(t,e,r){e[t+"Found"]?(e[t]=T(e[t]),null===e[t]&&(e[t]=r[t])):(g[t]=e[t]=r[t],a.nestedProperty(c[0],m+"."+t).set(r[t]))}if(e["_"+s+"autoBinFinished"])delete e["_"+s+"autoBinFinished"];else{c=x.traces;var M=[],E=!0,S=!1,C=!1;for(u=0;u<c.length;u++)if((f=c[u]).visible){var L=x.dirs[u];p=f["_"+L+"pos0"]=r.makeCalcdata(f,L),M=a.concat(M,p),delete f["_"+s+"autoBinFinished"],!0===e.visible&&(E?E=!1:(delete f._autoBin,f["_"+s+"autoBinFinished"]=1),i.traceIs(f,"2dMap")&&(S=!0),"histogram2dcontour"===f.type&&(C=!0))}h=c[0][s+"calendar"];var O=o.autoBin(M,r,x.nbins,S,h,x.sizeFound&&x.size),D=c[0]._autoBin={};if(g=D[x.dirs[0]]={},C&&(x.size||(O.start=A(o.tickIncrement(w(O.start),O.size,!0,h))),void 0===x.end&&(O.end=A(o.tickIncrement(w(O.end),O.size,!1,h)))),_&&!i.traceIs(e,"2dMap")&&0===O._dataSpan&&"category"!==r.type&&"multicategory"!==r.type){if(l)return[O,p,!0];O=function(t,e,r,n,i){var o,s,l,u=t._fullLayout,c=function(t,e){for(var r=e.xaxis,n=e.yaxis,a=e.orientation,i=[],o=t._fullData,s=0;s<o.length;s++){var l=o[s];"histogram"===l.type&&!0===l.visible&&l.orientation===a&&l.xaxis===r&&l.yaxis===n&&i.push(l)}return i}(t,e),f=!1,h=1/0,p=[e];for(o=0;o<c.length;o++)if((s=c[o])===e)f=!0;else if(f){var g=d(t,s,r,n,!0),v=g[0],m=g[2];s["_"+n+"autoBinFinished"]=1,s["_"+n+"pos0"]=g[1],m?p.push(s):h=Math.min(h,v.size)}else l=u._histogramBinOpts[s["_"+n+"bingroup"]],h=Math.min(h,l.size||s[i].size);var y=new Array(p.length);for(o=0;o<p.length;o++)for(var b=p[o]["_"+n+"pos0"],x=0;x<b.length;x++)if(void 0!==b[x]){y[o]=b[x];break}isFinite(h)||(h=a.distinctVals(y).minDiff);for(o=0;o<p.length;o++){var _=(s=p[o])[n+"calendar"],w={start:r.c2r(y[o]-h/2,0,_),end:r.c2r(y[o]+h/2,0,_),size:h};s._input[i]=s[i]=w,(l=u._histogramBinOpts[s["_"+n+"bingroup"]])&&a.extendFlat(l,w)}return e[i]}(t,e,r,s,m)}(v=f.cumulative||{}).enabled&&"include"!==v.currentbin&&("decreasing"===v.direction?O.start=A(o.tickIncrement(w(O.start),O.size,!0,h)):O.end=A(o.tickIncrement(w(O.end),O.size,!1,h))),x.size=O.size,x.sizeFound||(g.size=O.size,a.nestedProperty(c[0],m+".size").set(O.size)),k("start",x,O),k("end",x,O)}p=e["_"+s+"pos0"],delete e["_"+s+"pos0"];var R=e._input[m]||{},I=a.extendFlat({},x),P=x.start,F=r.r2l(R.start),z=void 0!==F;if((x.startFound||z)&&F!==r.r2l(P)){var N=z?F:a.aggNums(Math.min,null,p),B={type:"category"===r.type||"multicategory"===r.type?"linear":r.type,r2l:r.r2l,dtick:x.size,tick0:P,calendar:h,range:[N,o.tickIncrement(N,x.size,!1,h)].map(r.l2r)},j=o.tickFirst(B);j>r.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<h&&g.length<1e6&&(i=o.tickIncrement(r,A.size,!1,x),g.push((r+i)/2),v.push(F),L.push([]),M.push(r),I&&S.push(1/(i-r)),B&&C.push(0),!(i<=r));)r=i;M.push(r),k||"date"!==m.type||(E={start:j(E.start),end:j(E.end),size:E.size}),t._fullLayout._roundFnOpts||(t._fullLayout._roundFnOpts={});var U=e["_"+y+"bingroup"],V={leftGap:1/0,rightGap:1/0};U&&(t._fullLayout._roundFnOpts[U]||(t._fullLayout._roundFnOpts[U]=V),V=t._fullLayout._roundFnOpts[U]);var H,G=v.length,q=!0,X=V.leftGap,W=V.rightGap,Y={};for(r=0;r<T.length;r++){var Z=T[r];(p=a.findBin(Z,E))>=0&&p<G&&(O+=z(p,r,v,P,C),q&&L[p].length&&Z!==T[L[p][0]]&&(q=!1),L[p].push(r),Y[r]=p,X=Math.min(X,Z-M[p]),W=Math.min(W,M[p+1]-Z))}V.leftGap=X,V.rightGap=W,q||(H=function(e,r){return function(){var n=t._fullLayout._roundFnOpts[U];return f(n.leftGap,n.rightGap,M,m,x)(e,r)}}),B&&(O=c(v,C)),N&&N(v,O,S),_.enabled&&function(t,e,r){var n,a,i;function o(e){i=t[e],t[e]/=2}function s(e){a=t[e],t[e]=i+a/2,i+=a}if("half"===r)if("increasing"===e)for(o(0),n=1;n<t.length;n++)s(n);else for(o(t.length-1),n=t.length-2;n>=0;n--)s(n);else if("increasing"===e){for(n=1;n<t.length;n++)t[n]+=t[n-1];"exclude"===r&&(t.unshift(0),t.pop())}else{for(n=t.length-2;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<J;r++)if(v[r]){$=r;break}for(r=J-1;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;a<r;a++)t[a]*=n},probability:function(t,e){for(var r=t.length,n=0;n<r;n++)t[n]/=e},density:function(t,e,r,n){var a=t.length;n=n||1;for(var i=0;i<a;i++)t[i]*=r[i]*n},"probability density":function(t,e,r,n){var a=t.length;n&&(e/=n);for(var i=0;i<a;i++)t[i]*=r[i]/e}}},{}],634:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../plots/cartesian/axes"),i=t("../histogram/bin_functions"),o=t("../histogram/norm_functions"),s=t("../histogram/average"),l=t("../histogram/bin_label_vals"),u=t("../histogram/calc").calcAllAutoBins;function c(t,e,r,n){var a,i=new Array(t);if(n)for(a=0;a<t;a++)i[a]=1/(e[a+1]-e[a]);else{var o=1/r;for(a=0;a<t;a++)i[a]=o}return i}function f(t,e){return{start:t(e.start),end:t(e.end),size:e.size}}function d(t,e,r,n,a,i){var o,s=t.length-1,u=new Array(s),c=l(r,n,t,a,i);for(o=0;o<s;o++){var f=(e||[])[o];u[o]=void 0===f?[c(t[o]),c(t[o+1],!0)]:[f,f]}return u}e.exports=function(t,e){var r,l,h,p,g=a.getFromId(t,e.xaxis),v=a.getFromId(t,e.yaxis),m=e.xcalendar,y=e.ycalendar,b=function(t){return g.r2c(t,0,m)},x=function(t){return v.r2c(t,0,y)},_=u(t,e,g,"x"),w=_[0],A=_[1],T=u(t,e,v,"y"),k=T[0],M=T[1],E=e._length;A.length>E&&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<it;r=a.tickIncrement(r,nt,!1,y)){S.push(C.slice()),I.push(r);var ot=new Array(tt);for(l=0;l<tt;l++)ot[l]=[];B.push(ot),X&&N.push(L.slice())}I.push(r);var st=S.length,lt=(r-at)/st,ut=function(t){return v.c2r(t,0,y)}(at+lt/2);V&&(W=c(C.length,P,et,O),Y=c(S.length,F,lt,D)),O||"date"!==g.type||(P=f(b,P)),D||"date"!==v.type||(F=f(x,F));var ct=!0,ft=!0,dt=new Array(tt),ht=new Array(st),pt=1/0,gt=1/0,vt=1/0,mt=1/0;for(r=0;r<E;r++){var yt=A[r],bt=M[r];h=n.findBin(yt,P),p=n.findBin(bt,F),h>=0&&h<tt&&p>=0&&p<st&&(z+=G(h,r,S[p],Z,N[p]),B[p][h].push(r),ct&&(void 0===dt[h]?dt[h]=yt:dt[h]!==yt&&(ct=!1)),ft&&(void 0===ht[p]?ht[p]=bt:ht[p]!==bt&&(ft=!1)),pt=Math.min(pt,yt-R[h]),gt=Math.min(gt,R[h+1]-yt),vt=Math.min(vt,bt-I[p]),mt=Math.min(mt,I[p+1]-bt))}if(X)for(p=0;p<st;p++)z+=s(S[p],N[p]);if(q)for(p=0;p<st;p++)q(S[p],z,W,Y[p]);return{x:A,xRanges:d(R,ct&&dt,pt,gt,g,m),x0:rt,dx:et,y:M,yRanges:d(I,ft&&ht,vt,mt,v,y),y0:ut,dy:lt,z:S,pts:B}}},{"../../lib":498,"../../plots/cartesian/axes":547,"../histogram/average":629,"../histogram/bin_functions":630,"../histogram/bin_label_vals":631,"../histogram/calc":632,"../histogram/norm_functions":633}],635:[function(t,e,r){"use strict";var n=t("../../components/colorscale/attributes"),a=t("../../plots/cartesian/layout_attributes"),i=t("../../plots/font_attributes"),o=t("../../plots/domain").attributes,s=t("../../lib/extend").extendFlat,l=t("../../plot_api/plot_template").templatedArray;e.exports={domain:o({name:"parcoords",trace:!0,editType:"plot"}),labelangle:{valType:"angle",dflt:0,editType:"plot"},labelside:{valType:"enumerated",values:["top","bottom"],dflt:"top",editType:"plot"},labelfont:i({editType:"plot"}),tickfont:i({editType:"plot"}),rangefont:i({editType:"plot"}),dimensions:l("dimension",{label:{valType:"string",editType:"plot"},tickvals:s({},a.tickvals,{editType:"plot"}),ticktext:s({},a.ticktext,{editType:"plot"}),tickformat:s({},a.tickformat,{editType:"plot"}),visible:{valType:"boolean",dflt:!0,editType:"plot"},range:{valType:"info_array",items:[{valType:"number",editType:"plot"},{valType:"number",editType:"plot"}],editType:"plot"},constraintrange:{valType:"info_array",freeLength:!0,dimensions:"1-2",items:[{valType:"number",editType:"plot"},{valType:"number",editType:"plot"}],editType:"plot"},multiselect:{valType:"boolean",dflt:!0,editType:"plot"},values:{valType:"data_array",editType:"calc"},editType:"calc"}),line:s({editType:"calc"},n("line",{colorscaleDflt:"Viridis",autoColorDflt:!1,editTypeOverride:"calc"}))}},{"../../components/colorscale/attributes":375,"../../lib/extend":490,"../../plot_api/plot_template":536,"../../plots/cartesian/layout_attributes":561,"../../plots/domain":574,"../../plots/font_attributes":575}],636:[function(t,e,r){"use strict";var n=t("./constants"),a=t("d3"),i=t("../../lib/gup").keyFun,o=t("../../lib/gup").repeat,s=t("../../lib").sorterAsc,l=t("../../lib").strTranslate,u=n.bar.snapRatio;function c(t,e){return t*(1-u)+e*u}var f=n.bar.snapClose;function d(t,e){return t*(1-f)+e*f}function h(t,e,r,n){if(function(t,e){for(var r=0;r<e.length;r++)if(t>=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*f<a*o;f+=a){var h=f+a,p=e[h];if(a*r<a*d(l,p))return c(l,u);if(a*r<a*p||h===o)return c(p,l);u=l,l=p}}function p(t){t.attr("x",-n.bar.captureWidth/2).attr("width",n.bar.captureWidth)}function g(t){t.attr("visibility","visible").style("visibility","visible").attr("fill","yellow").attr("opacity",0)}function v(t){if(!t.brush.filterSpecified)return"0,"+t.height;for(var e,r,n,a=m(t.brush.filter.getConsolidated(),t.height),i=[0],o=a.length?a[0][0]:null,s=0;s<a.length;s++)r=(e=a[s])[1]-e[0],i.push(o),i.push(r),(n=s+1)<a.length&&(o=a[n][0]-e[1]);return i.push(t.height),i}function m(t,e){return t.map((function(t){return t.map((function(t){return Math.max(0,t*e)})).sort(s)}))}function y(){a.select(document.body).style("cursor",null)}function b(t){t.attr("stroke-dasharray",v)}function x(t,e){var r=a.select(t).selectAll(".highlight, .highlight-shadow");b(e?r.transition().duration(n.bar.snapDuration).each("end",e):r)}function _(t,e){var r,a=t.brush,i=NaN,o={};if(a.filterSpecified){var s=t.height,l=a.filter.getConsolidated(),u=m(l,s),c=NaN,f=NaN,d=NaN;for(r=0;r<=u.length;r++){var h=u[r];if(h&&h[0]<=e&&e<=h[1]){c=r;break}if(f=r?r-1:NaN,h&&h[0]>e){d=r;break}}if(i=c,isNaN(i)&&(i=isNaN(f)||isNaN(d)?isNaN(f)?d:f:e-u[f][1]<u[d][0]-e?f:d),!isNaN(i)){var p=u[i],g=function(t,e){var r=n.bar.handleHeight;if(!(e>t[1]+r||e<t[0]-r))return 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<v.length;r++){var b=[.25*v[Math.max(r-1,0)]+.75*v[r],.25*v[Math.min(r+1,v.length-1)]+.75*v[r]];if(y>=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]<l[0]&&l.reverse(),i.newExtent=[h(0,l,i.newExtent[0],i.stayingIntervals),h(1,l,i.newExtent[1],i.stayingIntervals)];var u=i.newExtent[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;r<t;r++)e[r]=.5;return e}(e._length),o=[[0,e.line.color],[1,e.line.color]]),i({lineColor:r,cscale:o})}},{"../../components/colorscale":380,"../../lib":498,"../../lib/gup":495}],639:[function(t,e,r){"use strict";e.exports={maxDimensionCount:60,overdrag:45,verticalPadding:2,tickDistance:50,canvasPixelRatio:1,blockLineCount:5e3,layers:["contextLineLayer","focusLineLayer","pickLineLayer"],axisTitleOffset:28,axisExtentOffset:10,deselectedLineColor:"#777",bar:{width:4,captureWidth:10,fillColor:"magenta",fillOpacity:1,snapDuration:150,snapRatio:.25,snapClose:.01,strokeColor:"white",strokeOpacity:1,strokeWidth:1,handleHeight:8,handleOpacity:1,handleOverlap:0},cn:{axisExtentText:"axis-extent-text",parcoordsLineLayers:"parcoords-line-layers",parcoordsLineLayer:"parcoords-lines",parcoords:"parcoords",parcoordsControlView:"parcoords-control-view",yAxis:"y-axis",axisOverlays:"axis-overlays",axis:"axis",axisHeading:"axis-heading",axisTitle:"axis-title",axisExtent:"axis-extent",axisExtentTop:"axis-extent-top",axisExtentTopText:"axis-extent-top-text",axisExtentBottom:"axis-extent-bottom",axisExtentBottomText:"axis-extent-bottom-text",axisBrush:"axis-brush"},id:{filterBarPattern:"filter-bar-pattern"}}},{}],640:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../components/colorscale/helpers").hasColorscale,i=t("../../components/colorscale/defaults"),o=t("../../plots/domain").defaults,s=t("../../plots/array_container_defaults"),l=t("../../plots/cartesian/axes"),u=t("./attributes"),c=t("./axisbrush"),f=t("./constants").maxDimensionCount,d=t("./merge_length");function h(t,e,r,a){function i(r,a){return n.coerce(t,e,u.dimensions,r,a)}var o=i("values"),s=i("visible");if(o&&o.length||(s=e.visible=!1),s){i("label"),i("tickvals"),i("ticktext"),i("tickformat");var f=i("range");e._ax={_id:"y",type:"linear",showexponent:"all",exponentformat:"B",range:f},l.setConvert(e._ax,a.layout),i("multiselect");var d=i("constraintrange");d&&(e.constraintrange=c.cleanRanges(d,e))}}e.exports=function(t,e,r,l){function c(r,a){return n.coerce(t,e,u,r,a)}var p=t.dimensions;Array.isArray(p)&&p.length>f&&(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<a&&(r.currentRafs[o]=window.requestAnimationFrame((function(){s(l+1)}))),r.drawCompleted=!1)}(0)}function h(t,e){for(var r=new Array(256),n=0;n<256;n++)r[n]=t(n/255).concat(e);return r}function p(t,e){return(t>>>8*e)%256/255}function g(t,e,r){for(var n=new Array(8*e),a=0,i=0;i<e;i++)for(var o=0;o<2;o++)for(var s=0;s<4;s++){var l=4*t+s,u=r[64*i+l];63===l&&0===o&&(u*=-1),n[a++]=u}return n}function v(t){var e="0"+t;return e.substr(e.length-2)}function m(t){return t<o?"p"+v(t+1)+"_"+v(t+4):"colors"}function y(t,e,r,n,a,i,o,l,u,c,f,d,h){for(var p=[[],[]],g=0;g<64;g++)p[0][g]=g===a?1:0,p[1][g]=g===i?1:0;var v=t.lines.canvasOverdrag,m=t.domain,y=t.canvasWidth,b=t.canvasHeight,x=t.deselectedLines.color;return s.extendFlat({key:f,resolution:[y,b],viewBoxPos:[o+v,l],viewBoxSize:[u,c],i0:a,i1:i,dim0A:p[0].slice(0,16),dim0B:p[0].slice(16,32),dim0C:p[0].slice(32,48),dim0D:p[0].slice(48,64),dim1A:p[1].slice(0,16),dim1B:p[1].slice(16,32),dim1C:p[1].slice(32,48),dim1D:p[1].slice(48,64),drwLayer:d,contextColor:[x[0]/255,x[1]/255,x[2]/255,x[3]<1?x[3]:Math.max(1/255,Math.pow(1/t.lines.color.length,1/3))],scissorX:(n===e?0:o+v)+(t.pad.l-v)+t.layoutWidth*m.x[0],scissorWidth:(n===r?y-o+v:u+.5)+(n===e?o+v:0),scissorY:l+t.pad.b+t.layoutHeight*m.y[0],scissorHeight:c,viewportX:t.pad.l-v+t.layoutWidth*m.x[0],viewportY:t.pad.b+t.layoutHeight*m.y[0],viewportWidth:y,viewportHeight:b},h)}function b(t){var e=Math.max(0,Math.floor(2047*t[0]),0),r=Math.min(2047,Math.ceil(2047*t[1]),2047);return[Math.min(e,r),Math.max(e,r)]}e.exports=function(t,e){var r,n,l,v,x,_=e.context,w=e.pick,A=e.regl,T={currentRafs:{},drawCompleted:!0,clearOnly:!1},k=function(t){for(var e={},r=0;r<=o;r+=4)e[m(r)]=t.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)});return e}(A),M=A.texture(c),E=[];C(e);var S=A({profile:!1,blend:{enable:_,func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:1,dstAlpha:1},equation:{rgb:"add",alpha:"add"},color:[0,0,0,0]},depth:{enable:!_,mask:!0,func:"less",range:[0,1]},cull:{enable:!0,face:"back"},scissor:{enable:!0,box:{x:A.prop("scissorX"),y:A.prop("scissorY"),width:A.prop("scissorWidth"),height:A.prop("scissorHeight")}},viewport:{x:A.prop("viewportX"),y:A.prop("viewportY"),width:A.prop("viewportWidth"),height:A.prop("viewportHeight")},dither:!1,vert:a,frag:i,primitive:"lines",lineWidth:1,attributes:k,uniforms:{resolution:A.prop("resolution"),viewBoxPos:A.prop("viewBoxPos"),viewBoxSize:A.prop("viewBoxSize"),dim0A:A.prop("dim0A"),dim1A:A.prop("dim1A"),dim0B:A.prop("dim0B"),dim1B:A.prop("dim1B"),dim0C:A.prop("dim0C"),dim1C:A.prop("dim1C"),dim0D:A.prop("dim0D"),dim1D:A.prop("dim1D"),loA:A.prop("loA"),hiA:A.prop("hiA"),loB:A.prop("loB"),hiB:A.prop("hiB"),loC:A.prop("loC"),hiC:A.prop("hiC"),loD:A.prop("loD"),hiD:A.prop("hiD"),palette:M,contextColor:A.prop("contextColor"),mask:A.prop("maskTexture"),drwLayer:A.prop("drwLayer"),maskHeight:A.prop("maskHeight")},offset:A.prop("offset"),count:A.prop("count")});function C(t){r=t.model,n=t.viewModel,l=n.dimensions.slice(),v=l[0]?l[0].values.length:0;var e=r.lines,a=w?e.color.map((function(t,r){return r/e.color.length})):e.color,i=function(t,e,r){for(var n,a=new Array(t*(o+4)),i=0,s=0;s<t;s++){for(var l=0;l<o;l++)a[i++]=l<e.length?e[l].paddedUnitValues[s]:.5;a[i++]=p(s,2),a[i++]=p(s,1),a[i++]=p(s,0),a[i++]=(n=r[s],Math.max(1e-6,Math.min(.999999,n)))}return a}(v,l,a);!function(t,e,r){for(var n=0;n<=o;n+=4)t[m(n)](g(n/4,e,r))}(k,v,i),_||w||(M=A.texture(s.extendFlat({data:h(r.unitToColor,255)},c)))}return{render:function(t,e,n){var a,i,o,s=t.length,u=1/0,c=-1/0;for(a=0;a<s;a++)t[a].dim0.canvasX<u&&(u=t[a].dim0.canvasX,i=a),t[a].dim1.canvasX>c&&(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&&n<l.length?l[n].brush.filter.getBounds():[-1/0,1/0];a[0][n]=i[0],a[1][n]=i[1]}var o=new Array(16384);for(e=0;e<16384;e++)o[e]=255;if(!t)for(e=0;e<l.length;e++){var s=e%8,u=(e-s)/8,c=Math.pow(2,s),f=l[e].brush.filter.get();if(!(f.length<2)){var d=b(f[0])[1];for(r=1;r<f.length;r++){var h=b(f[r]);for(n=d+1;n<h[0];n++)o[8*n+u]&=~c;d=Math.max(d,h[1])}}}var p={shape:[8,2048],format:"alpha",type:"uint8",mag:"nearest",min:"nearest",data:o};return x?x(p):x=A.texture(p),{maskTexture:x,maskHeight:2048,loA:a[0].slice(0,16),loB:a[0].slice(16,32),loC:a[0].slice(32,48),loD:a[0].slice(48,64),hiA:a[1].slice(0,16),hiB:a[1].slice(16,32),hiC:a[1].slice(32,48),hiD:a[1].slice(48,64)}}(_);for(a=0;a<s;a++){var p=t[a],g=p.dim0.crossfilterDimensionIndex,m=p.dim1.crossfilterDimensionIndex,k=p.canvasX,M=p.canvasY,C=k+p.panelSizeX;if(e||!E[g]||E[g][0]!==k||E[g][1]!==C){E[g]=[k,C];var L=y(r,i,o,a,g,m,k,M,p.panelSizeX,p.panelSizeY,p.dim0.crossfilterDimensionIndex,_?0:w?2:1,h);T.clearOnly=n;var O=e?r.lines.blockLineCount:v;d(A,S,T,O,v,L)}}},readPixel:function(t,e){return A.read({x:t,y:e,width:1,height:1,data:u}),u},readPixels:function(t,e,r,n){var a=new Uint8Array(4*r*n);return A.read({x:t,y:e,width:r,height:n,data:a}),a},destroy:function(){for(var e in t.style["pointer-events"]="none",M.destroy(),x&&x.destroy(),k)k[e].destroy()},update:C}}},{"../../lib":498,"./constants":639,glslify:236}],644:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){var a,i;for(n||(n=1/0),a=0;a<e.length;a++)(i=e[a]).visible&&(n=Math.min(n,i[r].length));for(n===1/0&&(n=0),t._length=n,a=0;a<e.length;a++)(i=e[a]).visible&&(i._length=n);return n}},{}],645:[function(t,e,r){"use strict";var n=t("d3"),a=t("color-rgba"),i=t("../../plots/cartesian/axes"),o=t("../../lib"),s=o.strRotate,l=o.strTranslate,u=t("../../lib/svg_text_utils"),c=t("../../components/drawing"),f=t("../../components/colorscale"),d=t("../../lib/gup"),h=d.keyFun,p=d.repeat,g=d.unwrap,v=t("./helpers"),m=t("./constants"),y=t("./axisbrush"),b=t("./lines");function x(t,e,r){return o.aggNums(t,null,e,r)}function _(t,e){return A(x(Math.min,t,e),x(Math.max,t,e))}function w(t){var e=t.range;return e?A(e[0],e[1]):_(t.values,t._length)}function A(t,e){return!isNaN(t)&&isFinite(t)||(t=0),!isNaN(e)&&isFinite(e)||(e=0),t===e&&(0===t?(t-=1,e+=1):(t*=.9,e*=1.1)),[t,e]}function T(t,e,r,a,i){var o,s,l=w(r);return a?n.scale.ordinal().domain(a.map((o=n.format(r.tickformat),s=i,s?function(t,e){var r=s[e];return null==r?o(t):r}:o))).range(a.map((function(r){var n=(r-l[0])/(l[1]-l[0]);return t-e+n*(2*e-t)}))):n.scale.linear().domain(l).range([t-e,e])}function k(t){if(t.tickvals){var e=w(t);return n.scale.ordinal().domain(t.tickvals).range(t.tickvals.map((function(t){return(t-e[0])/(e[1]-e[0])})))}}function M(t){var e=t.map((function(t){return t[0]})),r=t.map((function(t){var e=a(t[1]);return n.rgb("rgb("+e[0]+","+e[1]+","+e[2]+")")})),i="rgb".split("").map((function(t){return n.scale.linear().clamp(!0).domain(e).range(r.map((a=t,function(t){return t[a]})));var a}));return function(t){return i.map((function(e){return e(t)}))}}function E(t){return t.dimensions.some((function(t){return t.brush.filterSpecified}))}function S(t,e,r){var i=g(e),s=i.trace,l=v.convertTypedArray(i.lineColor),u=s.line,c={color:a(m.deselectedLineColor)},d=f.extractOpts(u),h=d.reversescale?f.flipScale(i.cscale):i.cscale,p=s.domain,y=s.dimensions,b=t.width,x=s.labelangle,_=s.labelside,A=s.labelfont,T=s.tickfont,k=s.rangefont,E=o.extendDeepNoArrays({},u,{color:l.map(n.scale.linear().domain(w({values:l,range:[d.min,d.max],_length:s._length}))),blockLineCount:m.blockLineCount,canvasOverdrag:m.overdrag*m.canvasPixelRatio}),S=Math.floor(b*(p.x[1]-p.x[0])),C=Math.floor(t.height*(p.y[1]-p.y[0])),L=t.margin||{l:80,r:80,t:100,b:80},O=S,D=C;return{key:r,colCount:y.filter(v.isVisible).length,dimensions:y,tickDistance:m.tickDistance,unitToColor:M(h),lines:E,deselectedLines:c,labelAngle:x,labelSide:_,labelFont:A,tickFont:T,rangeFont:k,layoutWidth:b,layoutHeight:t.height,domain:p,translateX:p.x[0]*b,translateY:t.height-p.y[1]*t.height,pad:L,canvasWidth:O*m.canvasPixelRatio+2*E.canvasOverdrag,canvasHeight:D*m.canvasPixelRatio,width:O,height:D,canvasPixelRatio:m.canvasPixelRatio}}function C(t,e,r){var a=r.width,i=r.height,s=r.dimensions,l=r.canvasPixelRatio,u=function(t){return a*t/Math.max(1,r.colCount-1)},c=m.verticalPadding/i,f=function(t,e){return n.scale.linear().range([e,t-e])}(i,m.verticalPadding),d={key:r.key,xScale:u,model:r,inBrushDrag:!1},h={};return d.dimensions=s.filter(v.isVisible).map((function(a,s){var p=function(t,e){return n.scale.linear().domain(w(t)).range([e,1-e])}(a,c),g=h[a.label];h[a.label]=(g||0)+1;var b=a.label+(g?"__"+g:""),x=a.constraintrange,_=x&&x.length;_&&!Array.isArray(x[0])&&(x=[x]);var A=_?x.map((function(t){return t.map(p)})):[[-1/0,1/0]],M=a.values;M.length>a._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<C.length;D++)if(C[D]<C[D-1]){for(var R=C.map(L).sort(O),I=0;I<C.length;I++)C[I]=R[I].val,S[I]=R[I].text;break}}else C=void 0;return M=v.convertTypedArray(M),{key:b,label:a.label,tickFormat:a.tickformat,tickvals:C,ticktext:S,ordinal:v.isOrdinal(a),multiselect:a.multiselect,xIndex:s,crossfilterDimensionIndex:s,visibleIndex:a._index,height:i,values:M,paddedUnitValues:M.map(p),unitTickvals:C&&C.map(p),xScale:u,x:u(s),canvasX:u(s)*l,unitToPaddedPx:f,domainScale:T(i,m.verticalPadding,a,C,S),ordinalScale:k(a),parent:d,model:r,brush:y.makeBrush(t,_,A,(function(){t.linePickActive(!1)}),(function(){var e=d;e.focusLayer&&e.focusLayer.render(e.panels,!0);var r=E(e);!t.contextShown()&&r?(e.contextLayer&&e.contextLayer.render(e.panels,!0),t.contextShown(!0)):t.contextShown()&&!r&&(e.contextLayer&&e.contextLayer.render(e.panels,!0,!0),t.contextShown(!1))}),(function(r){if(d.focusLayer.render(d.panels,!0),d.pickLayer&&d.pickLayer.render(d.panels,!0),t.linePickActive(!0),e&&e.filterChanged){var n=p.invert,i=r.map((function(t){return t.map(n).sort(o.sorterAsc)})).sort((function(t,e){return t[0]-e[0]}));e.filterChanged(d.key,a._index,i)}}))}})),d}function L(t){t.classed(m.cn.axisExtentText,!0).attr("text-anchor","middle").style("cursor","default")}function O(t,e){var r="top"===e?1:-1,n=t*Math.PI/180;return{dir:r,dx:Math.sin(n),dy:Math.cos(n),degrees:t}}function D(t,e){for(var r=e.panels||(e.panels=[]),n=t.data(),a=0;a<n.length-1;a++){var i=r[a]||(r[a]={}),o=n[a],s=n[a+1];i.dim0=o,i.dim1=s,i.canvasX=o.canvasX,i.panelSizeX=s.canvasX-o.canvasX,i.panelSizeY=e.model.canvasHeight,i.y=0,i.canvasY=0}}function R(t,e){return i.tickText(t._ax,e,!1).text}function I(t,e){if(t.ordinal)return"";var r=t.domainScale.domain(),n=r[e?r.length-1:0];return R(t.model.dimensions[t.visibleIndex],n)}e.exports=function(t,e,r,a){var f=t._fullLayout,d=f._toppaper,x=f._glcontainer;!function(t){for(var e=0;e<t.length;e++)for(var r=0;r<t[e].length;r++)for(var n=t[e][r].trace,a=n.dimensions,o=0;o<a.length;o++){var s=a[o].values,l=a[o]._ax;l&&(l.range?l.range=A(l.range[0],l.range[1]):l.range=_(s,n._length),l.dtick||(l.dtick=.01*(Math.abs(l.range[1]-l.range[0])||1)),l.tickformat=a[o].tickformat,i.calcTicks(l),l.cleanRange())}}(e);var w,T,k=(w=!0,T=!1,{linePickActive:function(t){return arguments.length?w=!!t:w},contextShown:function(t){return arguments.length?T=!!t:T}}),M=e.filter((function(t){return g(t).trace.visible})).map(S.bind(0,r)).map(C.bind(0,k,a));x.each((function(t,e){return o.extendFlat(t,M[e])}));var P=x.selectAll(".gl-canvas").each((function(t){t.viewModel=M[0],t.model=t.viewModel?t.viewModel.model:null})),F=null;P.filter((function(t){return t.pick})).style("pointer-events","auto").on("mousemove",(function(t){if(k.linePickActive()&&t.lineLayer&&a&&a.hover){var e=n.event,r=this.width,i=this.height,o=n.mouse(this),s=o[0],l=o[1];if(s<0||l<0||s>=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<e.length;r++){var n=t[e[r]];if(n||0===n||""===n)return n}},r.castOption=function(t,e){return Array.isArray(t)?r.getFirstFilled(t,e):t||void 0},r.getRotationAngle=function(t){return("auto"===t?0:t)*Math.PI/180}},{"../../lib":498}],648:[function(t,e,r){"use strict";var n=t("../../components/color"),a=t("./helpers").castOption;e.exports=function(t,e,r){var i=r.marker.line,o=a(i.color,e.pts)||n.defaultLine,s=a(i.width,e.pts)||0;t.style("stroke-width",s).call(n.fill,e.color).call(n.stroke,o)}},{"../../components/color":368,"./helpers":647}],649:[function(t,e,r){"use strict";var n=t("../scatter/attributes");e.exports={x:n.x,y:n.y,xy:{valType:"data_array",editType:"calc"},indices:{valType:"data_array",editType:"calc"},xbounds:{valType:"data_array",editType:"calc"},ybounds:{valType:"data_array",editType:"calc"},text:n.text,marker:{color:{valType:"color",arrayOk:!1,editType:"calc"},opacity:{valType:"number",min:0,max:1,dflt:1,arrayOk:!1,editType:"calc"},blend:{valType:"boolean",dflt:null,editType:"calc"},sizemin:{valType:"number",min:.1,max:2,dflt:.5,editType:"calc"},sizemax:{valType:"number",min:.1,dflt:20,editType:"calc"},border:{color:{valType:"color",arrayOk:!1,editType:"calc"},arearatio:{valType:"number",min:0,max:1,dflt:0,editType:"calc"},editType:"calc"},editType:"calc"},transforms:void 0}},{"../scatter/attributes":654}],650:[function(t,e,r){"use strict";var n=t("gl-pointcloud2d"),a=t("../../lib/str2rgbarray"),i=t("../../plots/cartesian/autorange").findExtremes,o=t("../scatter/get_trace_color");function s(t,e){this.scene=t,this.uid=e,this.type="pointcloud",this.pickXData=[],this.pickYData=[],this.xData=[],this.yData=[],this.textLabels=[],this.color="rgb(0, 0, 0)",this.name="",this.hoverinfo="all",this.idToIndex=new Int32Array(0),this.bounds=[0,0,0,0],this.pointcloudOptions={positions:new Float32Array(0),idToIndex:this.idToIndex,sizemin:.5,sizemax:12,color:[0,0,0,1],areaRatio:1,borderColor:[0,0,0,1]},this.pointcloud=n(t.glplot,this.pointcloudOptions),this.pointcloud._trace=this}var l=s.prototype;l.handlePick=function(t){var e=this.idToIndex[t.pointId];return{trace:this,dataCoord:t.dataCoord,traceCoord:this.pickXYData?[this.pickXYData[2*e],this.pickXYData[2*e+1]]:[this.pickXData[e],this.pickYData[e]],textLabel:Array.isArray(this.textLabels)?this.textLabels[e]:this.textLabels,color:this.color,name:this.name,pointIndex:e,hoverinfo:this.hoverinfo}},l.update=function(t){this.index=t.index,this.textLabels=t.text,this.name=t.name,this.hoverinfo=t.hoverinfo,this.bounds=[1/0,1/0,-1/0,-1/0],this.updateFast(t),this.color=o(t,{})},l.updateFast=function(t){var e,r,n,o,s,l,u=this.xData=this.pickXData=t.x,c=this.yData=this.pickYData=t.y,f=this.pickXYData=t.xy,d=t.xbounds&&t.ybounds,h=t.indices,p=this.bounds;if(f){if(n=f,e=f.length>>>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;l<e;l++)o=n[2*l],s=n[2*l+1],o<p[0]&&(p[0]=o),o>p[2]&&(p[2]=o),s<p[1]&&(p[1]=s),s>p[3]&&(p[3]=s);if(h)r=h;else for(r=new Int32Array(e),l=0;l<e;l++)r[l]=l}else for(e=u.length,n=new Float32Array(2*e),r=new Int32Array(e),l=0;l<e;l++)o=u[l],s=c[l],r[l]=l,n[2*l]=o,n[2*l+1]=s,o<p[0]&&(p[0]=o),o>p[2]&&(p[2]=o),s<p[1]&&(p[1]=s),s>p[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;r<t.length;r++)t[r].i=r;n.mergeArray(e.text,t,"tx"),n.mergeArray(e.texttemplate,t,"txt"),n.mergeArray(e.hovertext,t,"htx"),n.mergeArray(e.customdata,t,"data"),n.mergeArray(e.textposition,t,"tp"),e.textfont&&(n.mergeArrayCastPositive(e.textfont.size,t,"ts"),n.mergeArray(e.textfont.color,t,"tc"),n.mergeArray(e.textfont.family,t,"tf"));var a=e.marker;if(a){n.mergeArrayCastPositive(a.size,t,"ms"),n.mergeArrayCastPositive(a.opacity,t,"mo"),n.mergeArray(a.symbol,t,"mx"),n.mergeArray(a.color,t,"mc");var i=a.line;a.line&&(n.mergeArray(i.color,t,"mlc"),n.mergeArrayCastPositive(i.width,t,"mlw"));var o=a.gradient;o&&"none"!==o.type&&(n.mergeArray(o.type,t,"mgt"),n.mergeArray(o.color,t,"mgc"))}}},{"../../lib":498}],654:[function(t,e,r){"use strict";var n=t("../../plots/template_attributes").texttemplateAttrs,a=t("../../plots/template_attributes").hovertemplateAttrs,i=t("../../components/colorscale/attributes"),o=t("../../plots/font_attributes"),s=t("../../components/drawing/attributes").dash,l=t("../../components/drawing"),u=t("./constants"),c=t("../../lib/extend").extendFlat;e.exports={x:{valType:"data_array",editType:"calc+clearAxisTypes",anim:!0},x0:{valType:"any",dflt:0,editType:"calc+clearAxisTypes",anim:!0},dx:{valType:"number",dflt:1,editType:"calc",anim:!0},y:{valType:"data_array",editType:"calc+clearAxisTypes",anim:!0},y0:{valType:"any",dflt:0,editType:"calc+clearAxisTypes",anim:!0},dy:{valType:"number",dflt:1,editType:"calc",anim:!0},xperiod:{valType:"any",dflt:0,editType:"calc"},yperiod:{valType:"any",dflt:0,editType:"calc"},xperiod0:{valType:"any",editType:"calc"},yperiod0:{valType:"any",editType:"calc"},xperiodalignment:{valType:"enumerated",values:["start","middle","end"],dflt:"middle",editType:"calc"},yperiodalignment:{valType:"enumerated",values:["start","middle","end"],dflt:"middle",editType:"calc"},stackgroup:{valType:"string",dflt:"",editType:"calc"},orientation:{valType:"enumerated",values:["v","h"],editType:"calc"},groupnorm:{valType:"enumerated",values:["","fraction","percent"],dflt:"",editType:"calc"},stackgaps:{valType:"enumerated",values:["infer zero","interpolate"],dflt:"infer zero",editType:"calc"},text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},texttemplate:n({},{}),hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"style"},mode:{valType:"flaglist",flags:["lines","markers","text"],extras:["none"],editType:"calc"},hoveron:{valType:"flaglist",flags:["points","fills"],editType:"style"},hovertemplate:a({},{keys:u.eventDataKeys}),line:{color:{valType:"color",editType:"style",anim:!0},width:{valType:"number",min:0,dflt:2,editType:"style",anim:!0},shape:{valType:"enumerated",values:["linear","spline","hv","vh","hvh","vhv"],dflt:"linear",editType:"plot"},smoothing:{valType:"number",min:0,max:1.3,dflt:1,editType:"plot"},dash:c({},s,{editType:"style"}),simplify:{valType:"boolean",dflt:!0,editType:"plot"},editType:"plot"},connectgaps:{valType:"boolean",dflt:!1,editType:"calc"},cliponaxis:{valType:"boolean",dflt:!0,editType:"plot"},fill:{valType:"enumerated",values:["none","tozeroy","tozerox","tonexty","tonextx","toself","tonext"],editType:"calc"},fillcolor:{valType:"color",editType:"style",anim:!0},marker:c({symbol:{valType:"enumerated",values:l.symbolList,dflt:"circle",arrayOk:!0,editType:"style"},opacity:{valType:"number",min:0,max:1,arrayOk:!0,editType:"style",anim:!0},size:{valType:"number",min:0,dflt:6,arrayOk:!0,editType:"calc",anim:!0},maxdisplayed:{valType:"number",min:0,dflt:0,editType:"plot"},sizeref:{valType:"number",dflt:1,editType:"calc"},sizemin:{valType:"number",min:0,dflt:0,editType:"calc"},sizemode:{valType:"enumerated",values:["diameter","area"],dflt:"diameter",editType:"calc"},line:c({width:{valType:"number",min:0,arrayOk:!0,editType:"style",anim:!0},editType:"calc"},i("marker.line",{anim:!0})),gradient:{type:{valType:"enumerated",values:["radial","horizontal","vertical","none"],arrayOk:!0,dflt:"none",editType:"calc"},color:{valType:"color",arrayOk:!0,editType:"calc"},editType:"calc"},editType:"calc"},i("marker",{anim:!0})),selected:{marker:{opacity:{valType:"number",min:0,max:1,editType:"style"},color:{valType:"color",editType:"style"},size:{valType:"number",min:0,editType:"style"},editType:"style"},textfont:{color:{valType:"color",editType:"style"},editType:"style"},editType:"style"},unselected:{marker:{opacity:{valType:"number",min:0,max:1,editType:"style"},color:{valType:"color",editType:"style"},size:{valType:"number",min:0,editType:"style"},editType:"style"},textfont:{color:{valType:"color",editType:"style"},editType:"style"},editType:"style"},textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right"],dflt:"middle center",arrayOk:!0,editType:"calc"},textfont:o({editType:"calc",colorEditType:"style",arrayOk:!0}),r:{valType:"data_array",editType:"calc"},t:{valType:"data_array",editType:"calc"}}},{"../../components/colorscale/attributes":375,"../../components/drawing":390,"../../components/drawing/attributes":389,"../../lib/extend":490,"../../plots/font_attributes":575,"../../plots/template_attributes":592,"./constants":658}],655:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib"),i=t("../../plots/cartesian/axes"),o=t("../../plots/cartesian/align_period"),s=t("../../constants/numerical").BADNUM,l=t("./subtypes"),u=t("./colorscale_calc"),c=t("./arrays_to_calcdata"),f=t("./calc_selection");function d(t,e,r,n,a,o,s){var u=e._length,c=t._fullLayout,f=r._id,d=n._id,h=c._firstScatter[g(e)]===e.uid,p=(v(e,c,r,n)||{}).orientation,m=e.fill;r._minDtick=0,n._minDtick=0;var y={padded:!0},b={padded:!0};s&&(y.ppad=b.ppad=s);var x=u<2||a[0]!==a[u-1]||o[0]!==o[u-1];x&&("tozerox"===m||"tonextx"===m&&(h||"h"===p))?y.tozero=!0:(e.error_y||{}).visible||"tonexty"!==m&&"tozeroy"!==m&&(l.hasMarkers(e)||l.hasText(e))||(y.padded=!1,y.ppad=0),x&&("tozeroy"===m||"tonexty"===m&&(h||"v"===p))?b.tozero=!0:"tonextx"!==m&&"tozerox"!==m||(b.padded=!1),f&&(e._extremes[f]=i.findExtremes(r,a,y)),d&&(e._extremes[d]=i.findExtremes(n,o,b))}function h(t,e){if(l.hasMarkers(t)){var r,n=t.marker,o=1.6*(t.marker.sizeref||1);if(r="area"===t.marker.sizemode?function(t){return Math.max(Math.sqrt((t||0)/o),3)}:function(t){return Math.max((t||0)/o,3)},a.isArrayOrTypedArray(n.size)){var s={type:"linear"};i.setConvert(s);for(var u=s.makeCalcdata(t.marker,"size"),c=new Array(e),f=0;f<e;f++)c[f]=r(u[f]);return c}return r(n.size)}}function p(t,e){var r=g(e),n=t._firstScatter;n[r]||(n[r]=e.uid)}function g(t){var e=t.stackgroup;return t.xaxis+t.yaxis+t.type+(e?"-"+e:"")}function v(t,e,r,n){var a=t.stackgroup;if(a){var i=e._scatterStackOpts[r._id+n._id][a],o="v"===i.orientation?n:r;return"linear"===o.type||"log"===o.type?i:void 0}}e.exports={calc:function(t,e){var r,l,g,m,y,b,x=t._fullLayout,_=i.getFromId(t,e.xaxis||"x"),w=i.getFromId(t,e.yaxis||"y"),A=_.makeCalcdata(e,"x"),T=w.makeCalcdata(e,"y"),k=o(e,_,"x",A),M=o(e,w,"y",T),E=e._length,S=new Array(E),C=e.ids,L=v(e,x,_,w),O=!1;p(x,e);var D,R="x",I="y";L?(a.pushUnique(L.traceIndices,e._expandedIndex),(r="v"===L.orientation)?(I="s",D="x"):(R="s",D="y"),y="interpolate"===L.stackgaps):d(t,e,_,w,k,M,h(e,E));var P=!!e.xperiodalignment,F=!!e.yperiodalignment;for(l=0;l<E;l++){var z=S[l]={},N=n(k[l]),B=n(M[l]);N&&B?(z[R]=k[l],z[I]=M[l],P&&(z.orig_x=A[l]),F&&(z.orig_y=T[l])):L&&(r?N:B)?(z[D]=r?k[l]:M[l],z.gap=!0,y?(z.s=s,O=!0):z.s=0):z[R]=z[I]=s,C&&(z.id=String(C[l]))}if(c(S,e),u(t,e),f(S,e),L){for(l=0;l<S.length;)S[l][D]===s?S.splice(l,1):l++;if(a.sort(S,(function(t,e){return t[D]-e[D]||t.i-e.i})),O){for(l=0;l<S.length-1&&S[l].gap;)l++;for((b=S[l].s)||(b=S[l].s=0),g=0;g<l;g++)S[g].s=b;for(m=S.length-1;m>l&&S[m].gap;)m--;for(b=S[m].s,g=S.length-1;g>m;g--)S[g].s=b;for(;l<m;)if(S[++l].gap){for(g=l+1;S[g].gap;)g++;for(var j=S[l-1][D],U=S[l-1].s,V=(S[g].s-U)/(S[g][D]-j);l<g;)S[l].s=U+(S[l][D]-j)*V,l++}}}return S},calcMarkerSize:h,calcAxisExpansion:d,setFirstScatter:p,getStackOpts:v}},{"../../constants/numerical":475,"../../lib":498,"../../plots/cartesian/align_period":544,"../../plots/cartesian/axes":547,"./arrays_to_calcdata":653,"./calc_selection":656,"./colorscale_calc":657,"./subtypes":679,"fast-isnumeric":155}],656:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e){n.isArrayOrTypedArray(e.selectedpoints)&&n.tagSelected(t,e)}},{"../../lib":498}],657:[function(t,e,r){"use strict";var n=t("../../components/colorscale/helpers").hasColorscale,a=t("../../components/colorscale/calc"),i=t("./subtypes");e.exports=function(t,e){i.hasLines(e)&&n(e,"line")&&a(t,e,{vals:e.line.color,containerStr:"line",cLetter:"c"}),i.hasMarkers(e)&&(n(e,"marker")&&a(t,e,{vals:e.marker.color,containerStr:"marker",cLetter:"c"}),n(e,"marker.line")&&a(t,e,{vals:e.marker.line.color,containerStr:"marker.line",cLetter:"c"}))}},{"../../components/colorscale/calc":376,"../../components/colorscale/helpers":379,"./subtypes":679}],658:[function(t,e,r){"use strict";e.exports={PTS_LINESONLY:20,minTolerance:.2,toleranceGrowth:10,maxScreensAway:20,eventDataKeys:[]}},{}],659:[function(t,e,r){"use strict";var n=t("./calc");function a(t,e,r,n,a,i,o){a[n]=!0;var s={i:null,gap:!0,s:0};if(s[o]=r,t.splice(e,0,s),e&&r===t[e-1][o]){var l=t[e-1];s.s=l.s,s.i=l.i,s.gap=l.gap}else i&&(s.s=function(t,e,r,n){var a=t[e-1],i=t[e+1];return i?a?a.s+(i.s-a.s)*(r-a[n])/(i[n]-a[n]):i.s:a.s}(t,e,r,o));e||(t[0].t=t[1].t,t[0].trace=t[1].trace,delete t[1].t,delete t[1].trace)}e.exports=function(t,e){var r=e.xaxis,i=e.yaxis,o=r._id+i._id,s=t._fullLayout._scatterStackOpts[o];if(s){var l,u,c,f,d,h,p,g,v,m,y,b,x,_,w,A=t.calcdata;for(var T in s){var k=(m=s[T]).traceIndices;if(k.length){for(y="interpolate"===m.stackgaps,b=m.groupnorm,"v"===m.orientation?(x="x",_="y"):(x="y",_="x"),w=new Array(k.length),l=0;l<w.length;l++)w[l]=!1;h=A[k[0]];var M=new Array(h.length);for(l=0;l<h.length;l++)M[l]=h[l][x];for(l=1;l<k.length;l++){for(d=A[k[l]],u=c=0;u<d.length;u++){for(p=d[u][x];p>M[c]&&c<M.length;c++)a(d,u,M[c],l,w,y,x),u++;if(p!==M[c]){for(f=0;f<l;f++)a(A[k[f]],c,p,f,w,y,x);M.splice(c,0,p)}c++}for(;c<M.length;c++)a(d,u,M[c],l,w,y,x),u++}var E=M.length;for(u=0;u<h.length;u++){for(g=h[u][_]=h[u].s,l=1;l<k.length;l++)(d=A[k[l]])[0].trace._rawLength=d[0].trace._length,d[0].trace._length=E,g+=d[u].s,d[u][_]=g;if(b)for(v=("fraction"===b?g:g/100)||1,l=0;l<k.length;l++){var S=A[k[l]][u];S[_]/=v,S.sNorm=S.s/v}}for(l=0;l<k.length;l++){var C=(d=A[k[l]])[0].trace,L=n.calcMarkerSize(C,C._rawLength),O=Array.isArray(L);if(L&&w[l]||O){var D=L;for(L=new Array(E),u=0;u<E;u++)L[u]=d[u].gap?0:O?D[d[u].i]:D}var R=new Array(E),I=new Array(E);for(u=0;u<E;u++)R[u]=d[u].x,I[u]=d[u].y;n.calcAxisExpansion(t,C,r,i,R,I,L),d[0].t.orientation=m.orientation}}}}}},{"./calc":655}],660:[function(t,e,r){"use strict";e.exports=function(t){for(var e=0;e<t.length;e++){var r=t[e];if("scatter"===r.type){var n=r.fill;if("none"!==n&&"toself"!==n&&(r.opacity=void 0,"tonexty"===n||"tonextx"===n))for(var a=e-1;a>=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&&y<o.PTS_LINESONLY?"lines+markers":"lines";m("text"),m("hovertext"),m("mode",x),s.hasLines(e)&&(d(t,e,r,v,m),h(t,e,m),m("connectgaps"),m("line.simplify")),s.hasMarkers(e)&&f(t,e,r,v,m,{gradient:!0}),s.hasText(e)&&(m("texttemplate"),p(t,e,v,m));var _=[];(s.hasMarkers(e)||s.hasText(e))&&(m("cliponaxis"),m("marker.maxdisplayed"),_.push("points")),m("fill",b?b.fillDflt:"none"),"none"!==e.fill&&(g(t,e,r,m),s.hasLines(e)||h(t,e,m));var w=(e.line||{}).color,A=(e.marker||{}).color;"tonext"!==e.fill&&"toself"!==e.fill||_.push("fills"),m("hoveron",_.join("+")||"points"),"fills"!==e.hoveron&&m("hovertemplate");var T=a.getComponentMethod("errorbars","supplyDefaults");T(t,e,w||A||r,{axis:"y"}),T(t,e,w||A||r,{axis:"x",inherit:"y"}),n.coerceSelectionMarkerOpacity(e,m)}}},{"../../lib":498,"../../registry":593,"./attributes":654,"./constants":658,"./fillcolor_defaults":662,"./line_defaults":667,"./line_shape_defaults":669,"./marker_defaults":673,"./period_defaults":674,"./stack_defaults":677,"./subtypes":679,"./text_defaults":680,"./xy_defaults":681}],662:[function(t,e,r){"use strict";var n=t("../../components/color"),a=t("../../lib").isArrayOrTypedArray;e.exports=function(t,e,r,i){var o=!1;if(e.marker){var s=e.marker.color,l=(e.marker.line||{}).color;s&&!a(s)?o=s:l&&!a(l)&&(o=l)}i("fillcolor",n.addOpacity((e.line||{}).color||o||r,.5))}},{"../../components/color":368,"../../lib":498}],663:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axes");e.exports=function(t,e,r){var a={},i={_fullLayout:r},o=n.getFromTrace(i,e,"x"),s=n.getFromTrace(i,e,"y");return a.xLabel=n.tickText(o,t.x,!0).text,a.yLabel=n.tickText(s,t.y,!0).text,a}},{"../../plots/cartesian/axes":547}],664:[function(t,e,r){"use strict";var n=t("../../components/color"),a=t("./subtypes");e.exports=function(t,e){var r,i;if("lines"===t.mode)return(r=t.line.color)&&n.opacity(r)?r:t.fillcolor;if("none"===t.mode)return t.fill?t.fillcolor:"";var o=e.mcc||(t.marker||{}).color,s=e.mlcc||((t.marker||{}).line||{}).color;return(i=o&&n.opacity(o)?o:s&&n.opacity(s)&&(e.mlw||((t.marker||{}).line||{}).width)?s:"")?n.opacity(i)<.3?n.addOpacity(i,.3):i:(r=(t.line||{}).color)&&n.opacity(r)&&a.hasLines(t)&&t.line.width?r:t.fillcolor}},{"../../components/color":368,"./subtypes":679}],665:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../components/fx"),i=t("../../registry"),o=t("./get_trace_color"),s=t("../../components/color"),l=n.fillText;e.exports=function(t,e,r,u){var c=t.cd,f=c[0].trace,d=t.xa,h=t.ya,p=d.c2p(e),g=h.c2p(r),v=[p,g],m=f.hoveron||"",y=-1!==f.mode.indexOf("markers")?3:.5;if(-1!==m.indexOf("points")){var b=function(t){var e=Math.max(y,t.mrc||0),r=d.c2p(t.x)-p,n=h.c2p(t.y)-g;return Math.max(Math.sqrt(r*r+n*n)-e,1-y/e)},x=a.getDistanceFunction(u,(function(t){var e=Math.max(3,t.mrc||0),r=1-1/e,n=Math.abs(d.c2p(t.x)-p);return n<e?r*n/e:n-e+r}),(function(t){var e=Math.max(3,t.mrc||0),r=1-1/e,n=Math.abs(h.c2p(t.y)-g);return n<e?r*n/e:n-e+r}),b);if(a.getClosest(c,x,t),!1!==t.index){var _=c[t.index],w=d.c2p(_.x,!0),A=h.c2p(_.y,!0),T=_.mrc||1;t.index=_.i;var k=c[0].t.orientation,M=k&&(_.sNorm||_.s),E="h"===k?M:void 0!==_.orig_x?_.orig_x:_.x,S="v"===k?M:void 0!==_.orig_y?_.orig_y:_.y;return n.extendFlat(t,{color:o(f,_),x0:w-T,x1:w+T,xLabelVal:E,y0:A-T,y1:A+T,yLabelVal:S,spikeDistance:b(_),hovertemplate:f.hovertemplate}),l(_,f,t),i.getComponentMethod("errorbars","hoverInfo")(_,f,t),[t]}}if(-1!==m.indexOf("fills")&&f._polygons){var C,L,O,D,R,I,P,F,z,N=f._polygons,B=[],j=!1,U=1/0,V=-1/0,H=1/0,G=-1/0;for(C=0;C<N.length;C++)(O=N[C]).contains(v)&&(j=!j,B.push(O),H=Math.min(H,O.ymin),G=Math.max(G,O.ymax));if(j){var q=((H=Math.max(H,0))+(G=Math.min(G,h._length)))/2;for(C=0;C<B.length;C++)for(D=B[C].pts,L=1;L<D.length;L++)(F=D[L-1][1])>q!=(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&&u<l){var c=o*i-s*a;if(c*c<l)return!0}}function q(t,e){var r=t[0]/O,n=t[1]/D,a=Math.max(0,-r,r-1,-n,n-1);return a&&void 0!==k&&G(r,n,k,M)&&(a=0),a&&e&&G(r,n,e[0]/O,e[1]/D)&&(a=0),(1+f.toleranceGrowth*a)*I}function X(t,e){var r=t[0]-e[0],n=t[1]-e[1];return Math.sqrt(r*r+n*n)}var W,Y,Z,J,Q,$,K,tt=f.maxScreensAway,et=-O*tt,rt=O*(1+tt),nt=-D*tt,at=D*(1+tt),it=[[et,nt,rt,nt],[rt,nt,rt,at],[rt,at,et,at],[et,at,et,nt]];function ot(t){if(t[0]<et||t[0]>rt||t[1]<nt||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]<et?et:t[0]>rt?rt:0,Y=t[1]<nt?nt: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)<X(r[0],t)?r.unshift(o):r.push(o),n++)}return r}:"hv"===P||"vh"===P?K=function(t,e){var r=[],n=ot(t),a=ot(e);return n&&a&&st(n,a)||(n&&r.push(n),a&&r.push(a)),r}:"hvh"===P?K=lt(0,et,rt):"vhv"===P&&(K=lt(1,nt,at)),r=0;r<j;r++)if(n=H(r)){for(V=0,Q=null,ft(n),r++;r<j;r++){if(!(d=H(r))){if(R)continue;break}if(F&&e.simplify){var dt=H(r+1);if(y=X(d,n),z&&(0===V||V===j-1)||!(y<q(d,dt)*B)){for(v=[(d[0]-n[0])/y,(d[1]-n[1])/y],h=n,b=y,x=w=A=0,g=!1,i=d,r++;r<t.length;r++){if(p=dt,dt=H(r+1),!p){if(R)continue;break}if(T=(m=[p[0]-n[0],p[1]-n[1]])[0]*v[1]-m[1]*v[0],w=Math.min(w,T),(A=Math.max(A,T))-w>q(p,dt))break;i=p,(_=m[0]*v[0]+m[1]*v[1])>b?(b=_,d=p,g=!1):_<x&&(x=_,h=p,g=!0)}if(g?(ft(d),i!==h&&ft(h)):(h!==n&&ft(h),i!==d&&ft(d)),ft(i),r>=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<r.length;i++)(o=(a=r[i][0].trace).stackgroup||"")?o in u?l=u[o]:(l=u[o]=d,d++):a.fill in n&&h>=0?l=h:(l=h=d,d++),l<f&&(c=!0),a._groupIndex=f=l;var p=r.slice();c&&p.sort((function(t,e){var r=t[0].trace,n=e[0].trace;return r._groupIndex-n._groupIndex||r.index-n.index}));var g={};for(i=0;i<p.length;i++)o=(a=p[i][0].trace).stackgroup||"",!0===a.visible?(a._nexttrace=null,a.fill in n&&(s=g[o],a._prevtrace=s||null,s&&(s._nexttrace=a)),a._ownfill=a.fill&&("tozero"===a.fill.substr(0,6)||"toself"===a.fill||"to"===a.fill.substr(0,2)&&!a._prevtrace),g[o]=a):a._prevtrace=a._nexttrace=a._ownfill=null;return p}},{}],671:[function(t,e,r){"use strict";var n=t("fast-isnumeric");e.exports=function(t){var e=t.marker,r=e.sizeref||1,a=e.sizemin||0,i="area"===e.sizemode?function(t){return Math.sqrt(t/r)}:function(t){return t/r};return function(t){var e=i(t/2);return n(e)&&e>0?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&&r<e&&v++}));var m=Math.round(v*g/3+Math.floor(v/3)*g/7.1);a.forEach((function(t){delete t.vis})),p.forEach((function(t,e){0===Math.round((e+m)%g)&&(t.vis=!0)}))}(0,e,r,f,h);var m=!!g&&g.duration>0;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;v<q.length;v++)_._polygons[v]=d(q[v]);q.length&&(B=q[0][0],U=(j=q[q.length-1])[j.length-1]),X=function(t){return function(e){if(O=F(e),D=N(e),H?L?(H+="L"+O.substr(1),G=D+"L"+G.substr(1)):(H+="Z"+O,G=D+"Z"+G):(H=O,G=D),u.hasLines(_)&&e.length>1){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<s.length;r++)s[r].selected=0;else for(r=0;r<s.length;r++)a=s[r],i=l.c2p(a.x),o=u.c2p(a.y),null!==a.i&&e.contains([i,o],!1,r,t)?(c.push({pointNumber:a.i,x:l.c2d(a.x),y:u.c2d(a.y)}),a.selected=1):a.selected=0;return c}},{"./subtypes":679}],677:[function(t,e,r){"use strict";var n=["orientation","groupnorm","stackgaps"];e.exports=function(t,e,r,a){var i=r._scatterStackOpts,o=a("stackgroup");if(o){var s=e.xaxis+e.yaxis,l=i[s];l||(l=i[s]={});var u=l[o],c=!1;u?u.traces.push(e):(u=l[o]={traceIndices:[],traces:[e]},c=!0);for(var f={orientation:e.x&&!e.y?"h":"v"},d=0;d<n.length;d++){var h=n[d],p=h+"Found";if(!u[p]){var g=void 0!==t[h],v="orientation"===h;if((g||c)&&(u[h]=a(h,f[h]),v&&(u.fillDflt="h"===u[h]?"tonextx":"tonexty"),g&&(u[p]=!0,!c&&(delete u.traces[0][h],v))))for(var m=0;m<u.traces.length-1;m++){var y=u.traces[m];y._input.fill!==y.fill&&(y.fill=u.fillDflt)}}}return u}}},{}],678:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../components/drawing"),i=t("../../registry");function o(t,e,r){a.pointStyle(t.selectAll("path.point"),e,r)}function s(t,e,r){a.textPointStyle(t.selectAll("text"),e,r)}e.exports={style:function(t){var e=n.select(t).selectAll("g.trace.scatter");e.style("opacity",(function(t){return t[0].trace.opacity})),e.selectAll("g.points").each((function(e){o(n.select(this),e.trace||e[0].trace,t)})),e.selectAll("g.text").each((function(e){s(n.select(this),e.trace||e[0].trace,t)})),e.selectAll("g.trace path.js-line").call(a.lineGroupStyle),e.selectAll("g.trace path.js-fill").call(a.fillGroupStyle),i.getComponentMethod("errorbars","style")(e)},stylePoints:o,styleText:s,styleOnSelect:function(t,e,r){var n=e[0].trace;n.selectedpoints?(a.selectedPointStyle(r.selectAll("path.point"),n),a.selectedTextStyle(r.selectAll("text"),n)):(o(r,n,t),s(r,n,t))}}},{"../../components/drawing":390,"../../registry":593,d3:86}],679:[function(t,e,r){"use strict";var n=t("../../lib");e.exports={hasLines:function(t){return t.visible&&t.mode&&-1!==t.mode.indexOf("lines")},hasMarkers:function(t){return t.visible&&(t.mode&&-1!==t.mode.indexOf("markers")||"splom"===t.type)},hasText:function(t){return t.visible&&t.mode&&-1!==t.mode.indexOf("text")},isBubble:function(t){return n.isPlainObject(t.marker)&&n.isArrayOrTypedArray(t.marker.size)}}},{"../../lib":498}],680:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e,r,a,i){i=i||{},a("textposition"),n.coerceFont(a,"textfont",r.font),i.noSelect||(a("selected.textfont.color"),a("unselected.textfont.color"))}},{"../../lib":498}],681:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../registry");e.exports=function(t,e,r,i){var o,s=i("x"),l=i("y");if(a.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y"],r),s){var u=n.minRowLength(s);l?o=Math.min(u,n.minRowLength(l)):(o=u,i("y0"),i("dy"))}else{if(!l)return 0;o=n.minRowLength(l),i("x0"),i("dx")}return e._length=o,o}},{"../../lib":498,"../../registry":593}],682:[function(t,e,r){"use strict";var n=t("../scatter/arrays_to_calcdata"),a=t("../scatter/colorscale_calc");e.exports=function(t,e){var r=[{x:!1,y:!1,trace:e,t:{}}];return n(r,e),a(t,e),r}},{"../scatter/arrays_to_calcdata":653,"../scatter/colorscale_calc":657}],683:[function(t,e,r){"use strict";var n=t("../../plots/attributes"),a=t("../scatter/attributes"),i=t("../../components/colorscale/attributes"),o=t("../../lib/extend").extendFlat,s=t("../../plot_api/edit_types").overrideAll,l=t("./constants").DASHES,u=a.line,c=a.marker,f=c.line,d=e.exports=s({x:a.x,x0:a.x0,dx:a.dx,y:a.y,y0:a.y0,dy:a.dy,xperiod:a.xperiod,yperiod:a.yperiod,xperiod0:a.xperiod0,yperiod0:a.yperiod0,xperiodalignment:a.xperiodalignment,yperiodalignment:a.yperiodalignment,text:a.text,hovertext:a.hovertext,textposition:a.textposition,textfont:a.textfont,mode:{valType:"flaglist",flags:["lines","markers","text"],extras:["none"]},line:{color:u.color,width:u.width,shape:{valType:"enumerated",values:["linear","hv","vh","hvh","vhv"],dflt:"linear",editType:"plot"},dash:{valType:"enumerated",values:Object.keys(l),dflt:"solid"}},marker:o({},i("marker"),{symbol:c.symbol,size:c.size,sizeref:c.sizeref,sizemin:c.sizemin,sizemode:c.sizemode,opacity:c.opacity,colorbar:c.colorbar,line:o({},i("marker.line"),{width:f.width})}),connectgaps:a.connectgaps,fill:o({},a.fill,{dflt:"none"}),fillcolor:a.fillcolor,selected:{marker:a.selected.marker,textfont:a.selected.textfont},unselected:{marker:a.unselected.marker,textfont:a.unselected.textfont},opacity:n.opacity},"calc","nested");d.x.editType=d.y.editType=d.x0.editType=d.y0.editType="calc+clearAxisTypes",d.hovertemplate=a.hovertemplate,d.texttemplate=a.texttemplate},{"../../components/colorscale/attributes":375,"../../lib/extend":490,"../../plot_api/edit_types":529,"../../plots/attributes":543,"../scatter/attributes":654,"./constants":685}],684:[function(t,e,r){"use strict";var n=t("@plotly/point-cluster"),a=t("../../lib"),i=t("../../plots/cartesian/axis_ids"),o=t("../../plots/cartesian/autorange").findExtremes,s=t("../../plots/cartesian/align_period"),l=t("../scatter/calc"),u=l.calcMarkerSize,c=l.calcAxisExpansion,f=l.setFirstScatter,d=t("../scatter/colorscale_calc"),h=t("./convert"),p=t("./scene_update"),g=t("../../constants/numerical").BADNUM,v=t("./constants").TOO_MANY_POINTS;function m(t,e,r){var n=t._extremes[e._id],a=o(e,r._bnds,{padded:!0});n.min=n.min.concat(a.min),n.max=n.max.concat(a.max)}e.exports=function(t,e){var r,o,l,y=t._fullLayout,b=i.getFromId(t,e.xaxis),x=i.getFromId(t,e.yaxis),_=y._plots[e.xaxis+e.yaxis],w=e._length,A=w>=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;r<w;r++)o=S[r],l=C[r],L[2*r]=o===g?NaN:o,L[2*r+1]=l===g?NaN:l;if("log"===b.type)for(r=0;r<T;r+=2)L[r]=b.c2l(L[r]);if("log"===x.type)for(r=1;r<T;r+=2)L[r]=x.c2l(L[r]);if(A&&"log"!==b.type&&"log"!==x.type)k.tree=n(L);else{var O=k.ids=new Array(w);for(r=0;r<w;r++)O[r]=r}d(t,e);var D,R=function(t,e,r,n,i,o){var s=h.style(t,r);s.marker&&(s.marker.positions=n);s.line&&n.length>1&&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;r<y;r++){var x={i:r},_=e._module.formatLabels(x,e,a),w={};m(w,e,r);var A=e._meta||{};h.text.push(s.texttemplateString(b(r),_,g,w,x,A))}}else Array.isArray(e.text)&&e.text.length<i?h.text=e.text.slice():h.text=e.text;if(Array.isArray(h.text))for(r=h.text.length;r<i;r++)h.text[r]="";for(h.opacity=e.opacity,h.font={},h.align=[],h.baseline=[],r=0;r<u.length;r++){var T=u[r].split(/\s+/);switch(T[1]){case"left":h.align.push("right");break;case"right":h.align.push("left");break;default:h.align.push(T[1])}switch(T[0]){case"top":h.baseline.push("bottom");break;case"bottom":h.baseline.push("top");break;default:h.baseline.push(T[0])}}if(Array.isArray(c))for(h.color=new Array(i),r=0;r<i;r++)h.color[r]=c[r];else h.color=c;if(s.isArrayOrTypedArray(f)||Array.isArray(d))for(h.font=new Array(i),r=0;r<i;r++){var k=h.font[r]={};k.size=s.isTypedArray(f)?f[r]:Array.isArray(f)?n(f[r])?f[r]:0:f,k.family=Array.isArray(d)?d[r]:d}else h.font={size:f,family:d};return h}function b(t){var e,r,n=t._length,a=t.marker,o={},l=s.isArrayOrTypedArray(a.symbol),u=s.isArrayOrTypedArray(a.color),f=s.isArrayOrTypedArray(a.line.color),p=s.isArrayOrTypedArray(a.opacity),g=s.isArrayOrTypedArray(a.size),v=s.isArrayOrTypedArray(a.line.width);if(l||(r=h.isOpenSymbol(a.symbol)),l||u||f||p){o.colors=new Array(n),o.borderColors=new Array(n);var m=c(a,a.opacity,n),y=c(a.line,a.opacity,n);if(!Array.isArray(y[0])){var b=y;for(y=Array(n),e=0;e<n;e++)y[e]=b}if(!Array.isArray(m[0])){var x=m;for(m=Array(n),e=0;e<n;e++)m[e]=x}for(o.colors=m,o.borderColors=y,e=0;e<n;e++){if(l){var _=a.symbol[e];r=h.isOpenSymbol(_)}r&&(y[e]=m[e].slice(),m[e]=m[e].slice(),m[e][3]=0)}o.opacity=t.opacity}else r?(o.color=i(a.color,"uint8"),o.color[3]=0,o.borderColor=i(a.color,"uint8")):(o.color=i(a.color,"uint8"),o.borderColor=i(a.line.color,"uint8")),o.opacity=t.opacity*a.opacity;if(l)for(o.markers=new Array(n),e=0;e<n;e++)o.markers[e]=S(a.symbol[e]);else o.marker=S(a.symbol);var w,A=d(t);if(g||v){var T,k=o.sizes=new Array(n),M=o.borderSizes=new Array(n),E=0;if(g){for(e=0;e<n;e++)k[e]=A(a.size[e]),E+=k[e];T=E/n}else for(w=A(a.size),e=0;e<n;e++)k[e]=w;if(v)for(e=0;e<n;e++)M[e]=a.line.width[e]/2;else for(w=a.line.width/2,e=0;e<n;e++)M[e]=w;o.sizeAvg=T}else o.size=A(a&&a.size||10),o.borderSizes=A(a.line.width);return o}function x(t,e){var r=t.marker,n={};return e?(e.marker&&e.marker.symbol?n=b(s.extendFlat({},r,e.marker)):e.marker&&(e.marker.size&&(n.size=e.marker.size/2),e.marker.color&&(n.colors=e.marker.color),void 0!==e.marker.opacity&&(n.opacity=e.marker.opacity)),n):n}function _(t,e,r){var n={};if(!r)return n;if(r.textfont){var a={opacity:1,text:e.text,texttemplate:e.texttemplate,textposition:e.textposition,textfont:s.extendFlat({},e.textfont)};r.textfont&&s.extendFlat(a.textfont,r.textfont),n=y(t,a)}return n}function w(t,e){var r={capSize:2*e.width,lineWidth:e.thickness,color:e.color};return e.copy_ystyle&&(r=t.error_y),r}var A=p.SYMBOL_SDF_SIZE,T=p.SYMBOL_SIZE,k=p.SYMBOL_STROKE,M={},E=l.symbolFuncs[0](.05*T);function S(t){if("circle"===t)return null;var e,r,n=l.symbolNumber(t),i=l.symbolFuncs[n%100],o=!!l.symbolNoDot[n%100],s=!!l.symbolNoFill[n%100],u=h.isDotSymbol(t);return M[t]?M[t]:(e=u&&!o?i(1.1*T)+E:i(T),r=a(e,{w:A,h:A,viewBox:[-T,-T,T,T],stroke:s?k:-k}),M[t]=r,r||null)}e.exports={style:function(t,e){var r,n={marker:void 0,markerSel:void 0,markerUnsel:void 0,line:void 0,fill:void 0,errorX:void 0,errorY:void 0,text:void 0,textSel:void 0,textUnsel:void 0};if(!0!==e.visible)return n;if(f.hasText(e)&&(n.text=y(t,e),n.textSel=_(t,e,e.selected),n.textUnsel=_(t,e,e.unselected)),f.hasMarkers(e)&&(n.marker=b(e),n.markerSel=x(e,e.selected),n.markerUnsel=x(e,e.unselected),!e.unselected&&s.isArrayOrTypedArray(e.marker.opacity))){var a=e.marker.opacity;for(n.markerUnsel.opacity=new Array(a.length),r=0;r<a.length;r++)n.markerUnsel.opacity[r]=g*a[r]}if(f.hasLines(e)){n.line={overlay:!0,thickness:e.line.width,color:e.line.color,opacity:e.opacity};var i=(p.DASHES[e.line.dash]||[1]).slice();for(r=0;r<i.length;++r)i[r]*=e.line.width;n.line.dashes=i}return e.error_x&&e.error_x.visible&&(n.errorX=w(e,e.error_x)),e.error_y&&e.error_y.visible&&(n.errorY=w(e,e.error_y)),e.fill&&"none"!==e.fill&&(n.fill={closed:!0,fill:e.fillcolor,thickness:0}),n},markerStyle:b,markerSelection:x,linePositions:function(t,e,r){var n,a,i=r.length,o=i/2;if(f.hasLines(e)&&o)if("hv"===e.line.shape){for(n=[],a=0;a<o-1;a++)isNaN(r[2*a])||isNaN(r[2*a+1])?n.push(NaN,NaN,NaN,NaN):(n.push(r[2*a],r[2*a+1]),isNaN(r[2*a+2])||isNaN(r[2*a+3])?n.push(NaN,NaN):n.push(r[2*a+2],r[2*a+1]));n.push(r[i-2],r[i-1])}else if("hvh"===e.line.shape){for(n=[],a=0;a<o-1;a++)if(isNaN(r[2*a])||isNaN(r[2*a+1])||isNaN(r[2*a+2])||isNaN(r[2*a+3]))isNaN(r[2*a])||isNaN(r[2*a+1])?n.push(NaN,NaN):n.push(r[2*a],r[2*a+1]),n.push(NaN,NaN);else{var s=(r[2*a]+r[2*a+2])/2;n.push(r[2*a],r[2*a+1],s,r[2*a+1],s,r[2*a+3])}n.push(r[i-2],r[i-1])}else if("vhv"===e.line.shape){for(n=[],a=0;a<o-1;a++)if(isNaN(r[2*a])||isNaN(r[2*a+1])||isNaN(r[2*a+2])||isNaN(r[2*a+3]))isNaN(r[2*a])||isNaN(r[2*a+1])?n.push(NaN,NaN):n.push(r[2*a],r[2*a+1]),n.push(NaN,NaN);else{var l=(r[2*a+1]+r[2*a+3])/2;n.push(r[2*a],r[2*a+1],r[2*a],l,r[2*a+2],l)}n.push(r[i-2],r[i-1])}else if("vh"===e.line.shape){for(n=[],a=0;a<o-1;a++)isNaN(r[2*a])||isNaN(r[2*a+1])?n.push(NaN,NaN,NaN,NaN):(n.push(r[2*a],r[2*a+1]),isNaN(r[2*a+2])||isNaN(r[2*a+3])?n.push(NaN,NaN):n.push(r[2*a],r[2*a+3]));n.push(r[i-2],r[i-1])}else n=r;var u=!1;for(a=0;a<n.length;a++)if(isNaN(n[a])){u=!0;break}var c=u||n.length>p.TOO_MANY_POINTS||f.hasMarkers(e)?"rect":"round";if(u&&e.connectgaps){var d=n[0],h=n[1];for(a=0;a<n.length;a+=2)isNaN(n[a])||isNaN(n[a+1])?(n[a]=d,n[a+1]=h):(d=n[a],h=n[a+1])}return{join:c,positions:n}},errorBarPositions:function(t,e,r,a,i){var s=o.getComponentMethod("errorbars","makeComputeError"),l=u.getFromId(t,e.xaxis),c=u.getFromId(t,e.yaxis),f=r.length/2,d={};function h(t,a){var i=a._id.charAt(0),o=e["error_"+i];if(o&&o.visible&&("linear"===a.type||"log"===a.type)){for(var l=s(o),u={x:0,y:1}[i],c={x:[0,1,2,3],y:[2,3,0,1]}[i],h=new Float64Array(4*f),p=1/0,g=-1/0,v=0,m=0;v<f;v++,m+=4){var y=t[v];if(n(y)){var b=r[2*v+u],x=l(y,v),_=x[0],w=x[1];if(n(_)&&n(w)){var A=y-_,T=y+w;h[m+c[0]]=b-a.c2l(A),h[m+c[1]]=a.c2l(T)-b,h[m+c[2]]=0,h[m+c[3]]=0,p=Math.min(p,y-_),g=Math.max(g,y+w)}}}d[i]={positions:r,errors:h,_bnds:[p,g]}}}return h(a,l),h(i,c),d},textPosition:function(t,e,r,n){var a,i=e._length,o={};if(f.hasMarkers(e)){var s=r.font,l=r.align,u=r.baseline;for(o.offset=new Array(i),a=0;a<i;a++){var c=n.sizes?n.sizes[a]:n.size,d=Array.isArray(s)?s[a].size:s.size,h=Array.isArray(l)?l.length>1?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=b<s.PTS_LINESONLY?"lines+markers":"lines";v("text"),v("hovertext"),v("hovertemplate"),v("mode",x),l.hasLines(e)&&(v("connectgaps"),d(t,e,r,g,v),v("line.shape")),l.hasMarkers(e)&&(f(t,e,r,g,v),v("marker.line.width",m||y?1:0)),l.hasText(e)&&(v("texttemplate"),p(t,e,g,v));var _=(e.line||{}).color,w=(e.marker||{}).color;v("fill"),"none"!==e.fill&&h(t,e,r,v);var A=a.getComponentMethod("errorbars","supplyDefaults");A(t,e,_||w||r,{axis:"y"}),A(t,e,_||w||r,{axis:"x",inherit:"y"}),n.coerceSelectionMarkerOpacity(e,v)}else e.visible=!1}},{"../../lib":498,"../../registry":593,"../scatter/constants":658,"../scatter/fillcolor_defaults":662,"../scatter/line_defaults":667,"../scatter/marker_defaults":673,"../scatter/period_defaults":674,"../scatter/subtypes":679,"../scatter/text_defaults":680,"../scatter/xy_defaults":681,"./attributes":683,"./helpers":690}],688:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../components/color"),i=t("../../constants/interactions").DESELECTDIM;e.exports={styleTextSelection:function(t){var e,r,o=t[0],s=o.trace,l=o.t,u=l._scene,c=l.index,f=u.selectBatch[c],d=u.unselectBatch[c],h=u.textOptions[c],p=u.textSelectedOptions[c]||{},g=u.textUnselectedOptions[c]||{},v=n.extendFlat({},h);if(f.length||d.length){var m=p.color,y=g.color,b=h.color,x=Array.isArray(b);for(v.color=new Array(s._length),e=0;e<f.length;e++)r=f[e],v.color[r]=m||(x?b[r]:b);for(e=0;e<d.length;e++){r=d[e];var _=x?b[r]:b;v.color[r]=y||(m?_:a.addOpacity(_,i))}}u.glText[c].update(v)}}},{"../../components/color":368,"../../constants/interactions":474,"../../lib":498}],689:[function(t,e,r){"use strict";var n=t("../scatter/format_labels");e.exports=function(t,e,r){var a=t.i;return"x"in t||(t.x=e._x[a]),"y"in t||(t.y=e._y[a]),n(t,e,r)}},{"../scatter/format_labels":663}],690:[function(t,e,r){"use strict";var n=t("./constants");r.isOpenSymbol=function(t){return"string"==typeof t?n.OPEN_RE.test(t):t%200>100},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<a.length;u++)s=b[a[u]],(c=Math.abs(m.c2p(s)-_))<S&&(S=c,f=y.c2p(x[a[u]])-w,h=Math.sqrt(c*c+f*f),i=a[u]);else for(u=a.length-1;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))<S&&(S=h=d,i=a[u]);return t.index=i,t.distance=S,t.dxy=h,void 0===i?[t]:[o(t,b,x,v)]},calcHover:o}},{"../../lib":498,"../../registry":593,"../scatter/get_trace_color":664}],692:[function(t,e,r){"use strict";var n=t("./hover");e.exports={moduleType:"trace",name:"scattergl",basePlotModule:t("../../plots/cartesian"),categories:["gl","regl","cartesian","symbols","errorBarsOK","showLegend","scatter-like"],attributes:t("./attributes"),supplyDefaults:t("./defaults"),crossTraceDefaults:t("../scatter/cross_trace_defaults"),colorbar:t("../scatter/marker_colorbar"),formatLabels:t("./format_labels"),calc:t("./calc"),plot:t("./plot"),hoverPoints:n.hoverPoints,selectPoints:t("./select"),meta:{}}},{"../../plots/cartesian":560,"../scatter/cross_trace_defaults":660,"../scatter/marker_colorbar":672,"./attributes":683,"./calc":684,"./defaults":687,"./format_labels":689,"./hover":691,"./plot":693,"./select":695}],693:[function(t,e,r){"use strict";var n=t("regl-scatter2d"),a=t("regl-line2d"),i=t("regl-error2d"),o=t("gl-text"),s=t("../../lib"),l=t("../../components/dragelement/helpers").selectMode,u=t("../../lib/prepare_regl"),c=t("../scatter/subtypes"),f=t("../scatter/link_traces"),d=t("./edit_style").styleTextSelection;function h(t,e,r){var n=t._size,a=t.width,i=t.height;return[n.l+e.domain[0]*n.w,n.b+r.domain[0]*n.h,a-n.r-(1-e.domain[1])*n.w,i-n.t-(1-r.domain[1])*n.h]}e.exports=function(t,e,r){if(r.length){var p,g,v=t._fullLayout,m=e._scene,y=e.xaxis,b=e.yaxis;if(m)if(u(t,["ANGLE_instanced_arrays","OES_element_index_uint"])){var x=m.count,_=v._glcanvas.data()[0].regl;if(f(t,e,r),m.dirty){if(!0===m.error2d&&(m.error2d=i(_)),!0===m.line2d&&(m.line2d=a(_)),!0===m.scatter2d&&(m.scatter2d=n(_,{constPointSize:!0})),!0===m.fill2d&&(m.fill2d=a(_)),!0===m.glText)for(m.glText=new Array(x),p=0;p<x;p++)m.glText[p]=new o(_);if(m.glText){if(x>m.glText.length){var w=x-m.glText.length;for(p=0;p<w;p++)m.glText.push(new o(_))}else if(x<m.glText.length){var A=m.glText.length-x;m.glText.splice(x,A).forEach((function(t){t.destroy()}))}for(p=0;p<x;p++)m.glText[p].update(m.textOptions[p])}if(m.line2d&&(m.line2d.update(m.lineOptions),m.lineOptions=m.lineOptions.map((function(t){if(t&&t.positions){for(var e=t.positions,r=0;r<e.length&&(isNaN(e[r])||isNaN(e[r+1]));)r+=2;for(var n=e.length-2;n>r&&(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;f<p.length&&isNaN(p[f+1]);)f+=2;for(d=p.length-2;d>f&&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;f<p.length&&isNaN(p[f]);)f+=2;for(d=p.length-2;d>f&&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<p.length;i+=2)(isNaN(p[i])||isNaN(p[i+1]))&&((h=h.concat(p.slice(a,i))).push(p[a],p[a+1]),a=i+2);h=h.concat(p.slice(a)),a&&h.push(p[a],p[a+1])}else{var g=s._nexttrace;if(g){var v=m.lineOptions[e+1];if(v){var y=v.positions;if("tonexty"===s.fill){for(h=p.slice(),e=Math.floor(y.length/2);e--;){var b=y[2*e],x=y[2*e+1];isNaN(b)||isNaN(x)||h.push(b,x)}t.fill=g.fillcolor}}}}if(s._prevtrace&&"tonext"===s._prevtrace.fill){var _=m.lineOptions[e-1].positions,w=h.length/2,A=[a=w];for(i=0;i<_.length;i+=2)(isNaN(_[i])||isNaN(_[i+1]))&&(A.push(i/2+w+1),a=i+2);h=h.concat(_),t.hole=A}return t.fillmode=s.fill,t.opacity=s.opacity,t.positions=h,t}})),m.fill2d.update(m.fillOptions))}var k=v.dragmode,M=l(k),E=v.clickmode.indexOf("select")>-1;for(p=0;p<x;p++){var S=r[p][0],C=S.trace,L=S.t,O=L.index,D=C._length,R=L.x,I=L.y;if(C.selectedpoints||M||E){if(M||(M=!0),C.selectedpoints){var P=m.selectBatch[O]=s.selIndices2selPoints(C),F={};for(g=0;g<P.length;g++)F[P[g]]=1;var z=[];for(g=0;g<D;g++)F[g]||z.push(g);m.unselectBatch[O]=z}var N=L.xpx=new Array(D),B=L.ypx=new Array(D);for(g=0;g<D;g++)N[g]=y.c2p(R[g]),B[g]=b.c2p(I[g])}else L.xpx=L.ypx=null}if(M){if(m.select2d||(m.select2d=n(v._glcanvas.data()[1].regl)),m.scatter2d){var j=new Array(x);for(p=0;p<x;p++)j[p]=m.selectBatch[p].length||m.unselectBatch[p].length?m.markerUnselectedOptions[p]:{};m.scatter2d.update(j)}m.select2d&&(m.select2d.update(m.markerOptions),m.select2d.update(m.markerSelectedOptions)),m.glText&&r.forEach((function(t){var e=((t||[])[0]||{}).trace||{};c.hasText(e)&&d(t)}))}else m.scatter2d&&m.scatter2d.update(m.markerOptions);var U={viewport:h(v,y,b),range:[(y._rl||y.range)[0],(b._rl||b.range)[0],(y._rl||y.range)[1],(b._rl||b.range)[1]]},V=s.repeat(U,m.count);m.fill2d&&m.fill2d.update(V),m.line2d&&m.line2d.update(V),m.error2d&&m.error2d.update(V.concat(V)),m.scatter2d&&m.scatter2d.update(V),m.select2d&&m.select2d.update(V),m.glText&&m.glText.forEach((function(t){t.update(U)}))}else m.init()}}},{"../../components/dragelement/helpers":386,"../../lib":498,"../../lib/prepare_regl":511,"../scatter/link_traces":670,"../scatter/subtypes":679,"./edit_style":688,"gl-text":225,"regl-error2d":291,"regl-line2d":292,"regl-scatter2d":294}],694:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e){var r=e._scene,a={count:0,dirty:!0,lineOptions:[],fillOptions:[],markerOptions:[],markerSelectedOptions:[],markerUnselectedOptions:[],errorXOptions:[],errorYOptions:[],textOptions:[],textSelectedOptions:[],textUnselectedOptions:[],selectBatch:[],unselectBatch:[]},i={fill2d:!1,scatter2d:!1,error2d:!1,line2d:!1,glText:!1,select2d:!1};return e._scene||((r=e._scene={}).init=function(){n.extendFlat(r,i,a)},r.init(),r.update=function(t){var e=n.repeat(t,r.count);if(r.fill2d&&r.fill2d.update(e),r.scatter2d&&r.scatter2d.update(e),r.line2d&&r.line2d.update(e),r.error2d&&r.error2d.update(e.concat(e)),r.select2d&&r.select2d.update(e),r.glText)for(var a=0;a<r.count;a++)r.glText[a].update(t)},r.draw=function(){for(var t=r.count,e=r.fill2d,a=r.error2d,i=r.line2d,o=r.scatter2d,s=r.glText,l=r.select2d,u=r.selectBatch,c=r.unselectBatch,f=0;f<t;f++){if(e&&r.fillOrder[f]&&e.draw(r.fillOrder[f]),i&&r.lineOptions[f]&&i.draw(f),a&&(r.errorXOptions[f]&&a.draw(f),r.errorYOptions[f]&&a.draw(f+t)),o&&r.markerOptions[f])if(c[f].length){var d=n.repeat([],r.count);d[f]=c[f],o.draw(d)}else u[f].length||o.draw(f);s[f]&&r.textOptions[f]&&s[f].render()}l&&l.draw(u),r.dirty=!1},r.destroy=function(){r.fill2d&&r.fill2d.destroy&&r.fill2d.destroy(),r.scatter2d&&r.scatter2d.destroy&&r.scatter2d.destroy(),r.error2d&&r.error2d.destroy&&r.error2d.destroy(),r.line2d&&r.line2d.destroy&&r.line2d.destroy(),r.select2d&&r.select2d.destroy&&r.select2d.destroy(),r.glText&&r.glText.forEach((function(t){t.destroy&&t.destroy()})),r.lineOptions=null,r.fillOptions=null,r.markerOptions=null,r.markerSelectedOptions=null,r.markerUnselectedOptions=null,r.errorXOptions=null,r.errorYOptions=null,r.textOptions=null,r.textSelectedOptions=null,r.textUnselectedOptions=null,r.selectBatch=null,r.unselectBatch=null,e._scene=null}),r.dirty||n.extendFlat(r,a),r}},{"../../lib":498}],695:[function(t,e,r){"use strict";var n=t("../scatter/subtypes"),a=t("./edit_style").styleTextSelection;e.exports=function(t,e){var r=t.cd,i=[],o=r[0].trace,s=r[0].t,l=o._length,u=s.x,c=s.y,f=s._scene,d=s.index;if(!f)return i;var h=n.hasText(o),p=n.hasMarkers(o),g=!p&&!h;if(!0!==o.visible||g)return i;var v=[],m=[];if(!1!==e&&!e.degenerate)for(var y=0;y<l;y++)e.contains([s.xpx[y],s.ypx[y]],!1,y,t)?(v.push(y),i.push({pointNumber:y,x:u[y],y:c[y]})):m.push(y);if(p){var b=f.scatter2d;if(v.length||m.length){if(!f.selectBatch[d].length&&!f.unselectBatch[d].length){var x=new Array(f.count);x[d]=f.markerUnselectedOptions[d],b.update.apply(b,x)}}else{var _=new Array(f.count);_[d]=f.markerOptions[d],b.update.apply(b,_)}}return f.selectBatch[d]=v,f.unselectBatch[d]=m,h&&a(r),i}},{"../scatter/subtypes":679,"./edit_style":688}],696:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),a=t("../../components/colorscale/attributes"),i=t("../../plots/template_attributes").hovertemplateAttrs,o=t("../scattergl/attributes"),s=t("../../plots/cartesian/constants").idRegex,l=t("../../plot_api/plot_template").templatedArray,u=t("../../lib/extend").extendFlat,c=n.marker,f=c.line,d=u(a("marker.line",{editTypeOverride:"calc"}),{width:u({},f.width,{editType:"calc"}),editType:"calc"}),h=u(a("marker"),{symbol:c.symbol,size:u({},c.size,{editType:"markerSize"}),sizeref:c.sizeref,sizemin:c.sizemin,sizemode:c.sizemode,opacity:c.opacity,colorbar:c.colorbar,line:d,editType:"calc"});function p(t){return{valType:"info_array",freeLength:!0,editType:"calc",items:{valType:"subplotid",regex:s[t],editType:"plot"}}}h.color.editType=h.cmin.editType=h.cmax.editType="style",e.exports={dimensions:l("dimension",{visible:{valType:"boolean",dflt:!0,editType:"calc"},label:{valType:"string",editType:"calc"},values:{valType:"data_array",editType:"calc+clearAxisTypes"},axis:{type:{valType:"enumerated",values:["linear","log","date","category"],editType:"calc+clearAxisTypes"},matches:{valType:"boolean",dflt:!1,editType:"calc"},editType:"calc+clearAxisTypes"},editType:"calc+clearAxisTypes"}),text:u({},o.text,{}),hovertext:u({},o.hovertext,{}),hovertemplate:i(),marker:h,xaxes:p("x"),yaxes:p("y"),diagonal:{visible:{valType:"boolean",dflt:!0,editType:"calc"},editType:"calc"},showupperhalf:{valType:"boolean",dflt:!0,editType:"calc"},showlowerhalf:{valType:"boolean",dflt:!0,editType:"calc"},selected:{marker:o.selected.marker,editType:"calc"},unselected:{marker:o.unselected.marker,editType:"calc"},opacity:o.opacity}},{"../../components/colorscale/attributes":375,"../../lib/extend":490,"../../plot_api/plot_template":536,"../../plots/cartesian/constants":553,"../../plots/template_attributes":592,"../scatter/attributes":654,"../scattergl/attributes":683}],697:[function(t,e,r){"use strict";var n=t("regl-line2d"),a=t("../../registry"),i=t("../../lib/prepare_regl"),o=t("../../plots/get_data").getModuleCalcData,s=t("../../plots/cartesian"),l=t("../../plots/cartesian/axis_ids").getFromId,u=t("../../plots/cartesian/axes").shouldShowZeroLine;function c(t,e,r){for(var n=r.matrixOptions.data.length,a=e._visibleDims,i=r.viewOpts.ranges=new Array(n),o=0;o<a.length;o++){var s=a[o],u=i[o]=new Array(4),c=l(t,e._diag[s][0]);c&&(u[0]=c.r2l(c.range[0]),u[2]=c.r2l(c.range[1]));var f=l(t,e._diag[s][1]);f&&(u[1]=f.r2l(f.range[0]),u[3]=f.r2l(f.range[1]))}r.selectBatch.length||r.unselectBatch.length?r.matrix.update({ranges:i},{ranges:i}):r.matrix.update({ranges:i})}function f(t){var e=t._fullLayout,r=e._glcanvas.data()[0].regl,a=e._splomGrid;a||(a=e._splomGrid=n(r)),a.update(function(t){var e,r=t._fullLayout,n=r._size,a=[0,0,r.width,r.height],i={};function o(t,e,r,n,o,s){var l=e[t+"color"],u=e[t+"width"],c=String(l+u);c in i?i[c].data.push(NaN,NaN,r,n,o,s):i[c]={data:[r,n,o,s],join:"rect",thickness:u,color:l,viewport:a,range:a,overlay:!1}}for(e in r._splomSubplots){var s,l,c=r._plots[e],f=c.xaxis,d=c.yaxis,h=f._gridVals,p=d._gridVals,g=n.b+d.domain[0]*n.h,v=-d._m,m=-v*d.r2l(d.range[0],d.calendar);if(f.showgrid)for(e=0;e<h.length;e++)s=f._offset+f.l2p(h[e].x),o("grid",f,s,g,s,g+d._length);if(d.showgrid)for(e=0;e<p.length;e++)l=g+m+v*p[e].x,o("grid",d,f._offset,l,f._offset+f._length,l);u(t,f,d)&&(s=f._offset+f.l2p(0),o("zeroline",f,s,g,s,g+d._length)),u(t,d,f)&&(l=g+m+0,o("zeroline",d,f._offset,l,f._offset+f._length,l))}var y=[];for(e in i)y.push(i[e]);return y}(t))}e.exports={name:"splom",attr:s.attr,attrRegex:s.attrRegex,layoutAttributes:s.layoutAttributes,supplyLayoutDefaults:s.supplyLayoutDefaults,drawFramework:s.drawFramework,plot:function(t){var e=t._fullLayout,r=a.getModule("splom"),n=o(t.calcdata,r)[0];i(t,["ANGLE_instanced_arrays","OES_element_index_uint"])&&(e._hasOnlyLargeSploms&&f(t),r.plot(t,{},n))},drag:function(t){var e=t.calcdata,r=t._fullLayout;r._hasOnlyLargeSploms&&f(t);for(var n=0;n<e.length;n++){var a=e[n][0].trace,i=r._splomScenes[a.uid];"splom"===a.type&&i&&i.matrix&&c(t,a,i)}},updateGrid:f,clean:function(t,e,r,n){var a,i={};if(n._splomScenes){for(a=0;a<t.length;a++){var o=t[a];"splom"===o.type&&(i[o.uid]=1)}for(a=0;a<r.length;a++){var l=r[a];if(!i[l.uid]){var u=n._splomScenes[l.uid];u&&u.destroy&&u.destroy(),n._splomScenes[l.uid]=null,delete n._splomScenes[l.uid]}}}0===Object.keys(n._splomScenes||{}).length&&delete n._splomScenes,n._splomGrid&&!e._hasOnlyLargeSploms&&n._hasOnlyLargeSploms&&(n._splomGrid.destroy(),n._splomGrid=null,delete n._splomGrid),s.clean(t,e,r,n)},updateFx:s.updateFx,toSVG:s.toSVG}},{"../../lib/prepare_regl":511,"../../plots/cartesian":560,"../../plots/cartesian/axes":547,"../../plots/cartesian/axis_ids":550,"../../plots/get_data":577,"../../registry":593,"regl-line2d":292}],698:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../plots/cartesian/axis_ids"),i=t("../scatter/calc").calcMarkerSize,o=t("../scatter/calc").calcAxisExpansion,s=t("../scatter/colorscale_calc"),l=t("../scattergl/convert").markerSelection,u=t("../scattergl/convert").markerStyle,c=t("./scene_update"),f=t("../../constants/numerical").BADNUM,d=t("../scattergl/constants").TOO_MANY_POINTS;e.exports=function(t,e){var r,h,p,g,v,m,y=e.dimensions,b=e._length,x={},_=x.cdata=[],w=x.data=[],A=e._visibleDims=[];function T(t,r){for(var a=t.makeCalcdata({v:r.values,vcalendar:e.calendar},"v"),i=0;i<a.length;i++)a[i]=a[i]===f?NaN:a[i];_.push(a),w.push("log"===t.type?n.simpleMap(a,t.c2l):a)}for(r=0;r<y.length;r++)if((p=y[r]).visible){if(g=a.getFromId(t,e._diag[r][0]),v=a.getFromId(t,e._diag[r][1]),g&&v&&g.type!==v.type){n.log("Skipping splom dimension "+r+" with conflicting axis types");continue}g?(T(g,p),v&&"category"===v.type&&(v._categories=g._categories.slice())):T(v,p),A.push(r)}for(s(t,e),n.extendFlat(x,u(e)),m=_.length*b>d?2*(x.sizeAvg||Math.max(x.size,3)):i(e,b),h=0;h<A.length;h++)p=y[r=A[h]],g=a.getFromId(t,e._diag[r][0])||{},v=a.getFromId(t,e._diag[r][1])||{},o(t,e,g,v,_[h],_[h],m);var k=c(t,e);return k.matrix||(k.matrix=!0),k.matrixOptions=x,k.selectedOptions=l(e,e.selected),k.unselectedOptions=l(e,e.unselected),[{x:!1,y:!1,t:{},trace:e}]}},{"../../constants/numerical":475,"../../lib":498,"../../plots/cartesian/axis_ids":550,"../scatter/calc":655,"../scatter/colorscale_calc":657,"../scattergl/constants":685,"../scattergl/convert":686,"./scene_update":705}],699:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../plots/array_container_defaults"),i=t("./attributes"),o=t("../scatter/subtypes"),s=t("../scatter/marker_defaults"),l=t("../parcoords/merge_length"),u=t("../scattergl/helpers").isOpenSymbol;function c(t,e){function r(r,a){return n.coerce(t,e,i.dimensions,r,a)}r("label");var a=r("values");a&&a.length?r("visible"):e.visible=!1,r("axis.type"),r("axis.matches")}e.exports=function(t,e,r,f){function d(r,a){return n.coerce(t,e,i,r,a)}var h=a(t,e,{name:"dimensions",handleItemDefaults:c}),p=d("diagonal.visible"),g=d("showupperhalf"),v=d("showlowerhalf");if(l(e,h,"values")&&(p||g||v)){d("text"),d("hovertext"),d("hovertemplate"),s(t,e,r,f,d);var m=u(e.marker.symbol),y=o.isBubble(e);d("marker.line.width",m||y?1:0),function(t,e,r,n){var a,i,o=e.dimensions,s=o.length,l=e.showupperhalf,u=e.showlowerhalf,c=e.diagonal.visible,f=new Array(s),d=new Array(s);for(a=0;a<s;a++){var h=a?a+1:"";f[a]="x"+h,d[a]="y"+h}var p=n("xaxes",f),g=n("yaxes",d),v=e._diag=new Array(s);e._xaxes={},e._yaxes={};var m=[],y=[];function b(t,n,a,i){if(t){var o=t.charAt(0),s=r._splomAxes[o];if(e["_"+o+"axes"][t]=1,i.push(t),!(t in s)){var l=s[t]={};a&&(l.label=a.label||"",a.visible&&a.axis&&(a.axis.type&&(l.type=a.axis.type),a.axis.matches&&(l.matches=n)))}}}var x=!c&&!u,_=!c&&!l;for(e._axesDim={},a=0;a<s;a++){var w=o[a],A=0===a,T=a===s-1,k=A&&x||T&&_?void 0:p[a],M=A&&_||T&&x?void 0:g[a];b(k,M,w,m),b(M,k,w,y),v[a]=[k,M],e._axesDim[k]=a,e._axesDim[M]=a}for(a=0;a<m.length;a++)for(i=0;i<y.length;i++){var E=m[a]+y[i];a>i&&l||a<i&&u?r._splomSubplots[E]=1:a!==i||!c&&u&&l||(r._splomSubplots[E]=1)}(!u||!c&&l&&u)&&(r._splomGridDflt.xside="bottom",r._splomGridDflt.yside="left")}(0,e,f,d),n.coerceSelectionMarkerOpacity(e,d)}else e.visible=!1}},{"../../lib":498,"../../plots/array_container_defaults":542,"../parcoords/merge_length":644,"../scatter/marker_defaults":673,"../scatter/subtypes":679,"../scattergl/helpers":690,"./attributes":696}],700:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../scatter/colorscale_calc"),i=t("../scattergl/convert").markerStyle;e.exports=function(t,e){var r=e.trace,o=t._fullLayout._splomScenes[r.uid];if(o){a(t,r),n.extendFlat(o.matrixOptions,i(r));var s=n.extendFlat({},o.matrixOptions,o.viewOpts);o.matrix.update(s,null)}}},{"../../lib":498,"../scatter/colorscale_calc":657,"../scattergl/convert":686}],701:[function(t,e,r){"use strict";r.getDimIndex=function(t,e){for(var r=e._id,n={x:0,y:1}[r.charAt(0)],a=t._visibleDims,i=0;i<a.length;i++){var o=a[i];if(t._diag[o][n]===r)return i}return!1}},{}],702:[function(t,e,r){"use strict";var n=t("./helpers"),a=t("../scattergl/hover").calcHover;e.exports={hoverPoints:function(t,e,r){var i=t.cd[0].trace,o=t.scene.matrixOptions.cdata,s=t.xa,l=t.ya,u=s.c2p(e),c=l.c2p(r),f=t.distance,d=n.getDimIndex(i,s),h=n.getDimIndex(i,l);if(!1===d||!1===h)return[t];for(var p,g,v=o[d],m=o[h],y=f,b=0;b<v.length;b++){var x=v[b],_=m[b],w=s.c2p(x)-u,A=l.c2p(_)-c,T=Math.sqrt(w*w+A*A);T<y&&(y=g=T,p=b)}return t.index=p,t.distance=y,t.dxy=g,void 0===p?[t]:[a(t,v,m,i)]}}},{"../scattergl/hover":691,"./helpers":701}],703:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../components/grid");e.exports={moduleType:"trace",name:"splom",basePlotModule:t("./base_plot"),categories:["gl","regl","cartesian","symbols","showLegend","scatter-like"],attributes:t("./attributes"),supplyDefaults:t("./defaults"),colorbar:t("../scatter/marker_colorbar"),calc:t("./calc"),plot:t("./plot"),hoverPoints:t("./hover").hoverPoints,selectPoints:t("./select"),editStyle:t("./edit_style"),meta:{}},n.register(a)},{"../../components/grid":412,"../../registry":593,"../scatter/marker_colorbar":672,"./attributes":696,"./base_plot":697,"./calc":698,"./defaults":699,"./edit_style":700,"./hover":702,"./plot":704,"./select":706}],704:[function(t,e,r){"use strict";var n=t("regl-splom"),a=t("../../lib"),i=t("../../plots/cartesian/axis_ids"),o=t("../../components/dragelement/helpers").selectMode;function s(t,e){var r,s,l,u,c,f=t._fullLayout,d=f._size,h=e.trace,p=e.t,g=f._splomScenes[h.uid],v=g.matrixOptions,m=v.cdata,y=f._glcanvas.data()[0].regl,b=f.dragmode;if(0!==m.length){v.lower=h.showupperhalf,v.upper=h.showlowerhalf,v.diagonal=h.diagonal.visible;var x=h._visibleDims,_=m.length,w=g.viewOpts={};for(w.ranges=new Array(_),w.domains=new Array(_),c=0;c<x.length;c++){l=x[c];var A=w.ranges[c]=new Array(4),T=w.domains[c]=new Array(4);(r=i.getFromId(t,h._diag[l][0]))&&(A[0]=r._rl[0],A[2]=r._rl[1],T[0]=r.domain[0],T[2]=r.domain[1]),(s=i.getFromId(t,h._diag[l][1]))&&(A[1]=s._rl[0],A[3]=s._rl[1],T[1]=s.domain[0],T[3]=s.domain[1])}w.viewport=[d.l,d.b,d.w+d.l,d.h+d.b],!0===g.matrix&&(g.matrix=n(y));var k=f.clickmode.indexOf("select")>-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<S.length;l++)C[S[l]]=!0;var L=[];for(l=0;l<E;l++)C[l]||L.push(l);g.unselectBatch=L}var O=p.xpx=new Array(_),D=p.ypx=new Array(_);for(c=0;c<x.length;c++){if(l=x[c],r=i.getFromId(t,h._diag[l][0]))for(O[c]=new Array(E),u=0;u<E;u++)O[c][u]=r.c2p(m[c][u]);if(s=i.getFromId(t,h._diag[l][1]))for(D[c]=new Array(E),u=0;u<E;u++)D[c][u]=s.c2p(m[c][u])}if(g.selectBatch.length||g.unselectBatch.length){var R=a.extendFlat({},v,g.unselectedOptions,w),I=a.extendFlat({},v,g.selectedOptions,w);g.matrix.update(R,I),M=!1}}else p.xpx=p.ypx=null;if(M){var P=a.extendFlat({},v,w);g.matrix.update(P,null)}}}e.exports=function(t,e,r){if(r.length)for(var n=0;n<r.length;n++)s(t,r[n][0])}},{"../../components/dragelement/helpers":386,"../../lib":498,"../../plots/cartesian/axis_ids":550,"regl-splom":296}],705:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e){var r=t._fullLayout,a=e.uid,i=r._splomScenes;i||(i=r._splomScenes={});var o={dirty:!0,selectBatch:[],unselectBatch:[]},s=i[e.uid];return s||((s=i[a]=n.extendFlat({},o,{matrix:!1,selectBatch:[],unselectBatch:[]})).draw=function(){s.matrix&&s.matrix.draw&&(s.selectBatch.length||s.unselectBatch.length?s.matrix.draw(s.unselectBatch,s.selectBatch):s.matrix.draw()),s.dirty=!1},s.destroy=function(){s.matrix&&s.matrix.destroy&&s.matrix.destroy(),s.matrixOptions=null,s.selectBatch=null,s.unselectBatch=null,s=null}),s.dirty||n.extendFlat(s,o),s}},{"../../lib":498}],706:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../scatter/subtypes"),i=t("./helpers");e.exports=function(t,e){var r=t.cd,o=r[0].trace,s=r[0].t,l=t.scene,u=l.matrixOptions.cdata,c=t.xaxis,f=t.yaxis,d=[];if(!l)return d;var h=!a.hasMarkers(o)&&!a.hasText(o);if(!0!==o.visible||h)return d;var p=i.getDimIndex(o,c),g=i.getDimIndex(o,f);if(!1===p||!1===g)return d;var v=s.xpx[p],m=s.ypx[g],y=u[p],b=u[g],x=[],_=[];if(!1!==e&&!e.degenerate)for(var w=0;w<y.length;w++)e.contains([v[w],m[w]],null,w,t)?(x.push(w),d.push({pointNumber:w,x:y[w],y:b[w]})):_.push(w);var A=l.matrixOptions;return x.length||_.length?l.selectBatch.length||l.unselectBatch.length||l.matrix.update(l.unselectedOptions,n.extendFlat({},A,l.selectedOptions,l.viewOpts)):l.matrix.update(A,null),l.selectBatch=x,l.unselectBatch=_,d}},{"../../lib":498,"../scatter/subtypes":679,"./helpers":701}],707:[function(t,e,r){"use strict";r.version="1.58.4"},{}]},{},[5])(5)}));