-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrender.js
More file actions
1 lines (1 loc) · 813 KB
/
render.js
File metadata and controls
1 lines (1 loc) · 813 KB
1
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).Render=e()}}(function(){return function(){return function e(t,r,n){function a(o,l){if(!r[o]){if(!t[o]){var s="function"==typeof require&&require;if(!l&&s)return s(o,!0);if(i)return i(o,!0);var c=new Error("Cannot find module '"+o+"'");throw c.code="MODULE_NOT_FOUND",c}var u=r[o]={exports:{}};t[o][0].call(u.exports,function(e){return a(t[o][1][e]||e)},u,u.exports,e,t,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(e,t,r){var n=Object.create||function(e){var t=function(){};return t.prototype=e,new t},a=Object.keys||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.push(r);return r},i=Function.prototype.bind||function(e){var t=this;return function(){return t.apply(e,arguments)}};function o(){this._events&&Object.prototype.hasOwnProperty.call(this,"_events")||(this._events=n(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0}t.exports=o,o.EventEmitter=o,o.prototype._events=void 0,o.prototype._maxListeners=void 0;var l,s=10;try{var c={};Object.defineProperty&&Object.defineProperty(c,"x",{value:0}),l=0===c.x}catch(e){l=!1}function u(e){return void 0===e._maxListeners?o.defaultMaxListeners:e._maxListeners}function f(e,t,r,a){var i,o,l;if("function"!=typeof r)throw new TypeError('"listener" argument must be a function');if((o=e._events)?(o.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),o=e._events),l=o[t]):(o=e._events=n(null),e._eventsCount=0),l){if("function"==typeof l?l=o[t]=a?[r,l]:[l,r]:a?l.unshift(r):l.push(r),!l.warned&&(i=u(e))&&i>0&&l.length>i){l.warned=!0;var s=new Error("Possible EventEmitter memory leak detected. "+l.length+' "'+String(t)+'" listeners added. Use emitter.setMaxListeners() to increase limit.');s.name="MaxListenersExceededWarning",s.emitter=e,s.type=t,s.count=l.length,"object"==typeof console&&console.warn&&console.warn("%s: %s",s.name,s.message)}}else l=o[t]=r,++e._eventsCount;return e}function d(){if(!this.fired)switch(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length){case 0:return this.listener.call(this.target);case 1:return this.listener.call(this.target,arguments[0]);case 2:return this.listener.call(this.target,arguments[0],arguments[1]);case 3:return this.listener.call(this.target,arguments[0],arguments[1],arguments[2]);default:for(var e=new Array(arguments.length),t=0;t<e.length;++t)e[t]=arguments[t];this.listener.apply(this.target,e)}}function p(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},a=i.call(d,n);return a.listener=r,n.wrapFn=a,a}function h(e,t,r){var n=e._events;if(!n)return[];var a=n[t];return a?"function"==typeof a?r?[a.listener||a]:[a]:r?function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(a):v(a,a.length):[]}function g(e){var t=this._events;if(t){var r=t[e];if("function"==typeof r)return 1;if(r)return r.length}return 0}function v(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}l?Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(e){if("number"!=typeof e||e<0||e!=e)throw new TypeError('"defaultMaxListeners" must be a positive number');s=e}}):o.defaultMaxListeners=s,o.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||isNaN(e))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=e,this},o.prototype.getMaxListeners=function(){return u(this)},o.prototype.emit=function(e){var t,r,n,a,i,o,l="error"===e;if(o=this._events)l=l&&null==o.error;else if(!l)return!1;if(l){if(arguments.length>1&&(t=arguments[1]),t instanceof Error)throw t;var s=new Error('Unhandled "error" event. ('+t+")");throw s.context=t,s}if(!(r=o[e]))return!1;var c="function"==typeof r;switch(n=arguments.length){case 1:!function(e,t,r){if(t)e.call(r);else for(var n=e.length,a=v(e,n),i=0;i<n;++i)a[i].call(r)}(r,c,this);break;case 2:!function(e,t,r,n){if(t)e.call(r,n);else for(var a=e.length,i=v(e,a),o=0;o<a;++o)i[o].call(r,n)}(r,c,this,arguments[1]);break;case 3:!function(e,t,r,n,a){if(t)e.call(r,n,a);else for(var i=e.length,o=v(e,i),l=0;l<i;++l)o[l].call(r,n,a)}(r,c,this,arguments[1],arguments[2]);break;case 4:!function(e,t,r,n,a,i){if(t)e.call(r,n,a,i);else for(var o=e.length,l=v(e,o),s=0;s<o;++s)l[s].call(r,n,a,i)}(r,c,this,arguments[1],arguments[2],arguments[3]);break;default:for(a=new Array(n-1),i=1;i<n;i++)a[i-1]=arguments[i];!function(e,t,r,n){if(t)e.apply(r,n);else for(var a=e.length,i=v(e,a),o=0;o<a;++o)i[o].apply(r,n)}(r,c,this,a)}return!0},o.prototype.addListener=function(e,t){return f(this,e,t,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(e,t){return f(this,e,t,!0)},o.prototype.once=function(e,t){if("function"!=typeof t)throw new TypeError('"listener" argument must be a function');return this.on(e,p(this,e,t)),this},o.prototype.prependOnceListener=function(e,t){if("function"!=typeof t)throw new TypeError('"listener" argument must be a function');return this.prependListener(e,p(this,e,t)),this},o.prototype.removeListener=function(e,t){var r,a,i,o,l;if("function"!=typeof t)throw new TypeError('"listener" argument must be a function');if(!(a=this._events))return this;if(!(r=a[e]))return this;if(r===t||r.listener===t)0==--this._eventsCount?this._events=n(null):(delete a[e],a.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(i=-1,o=r.length-1;o>=0;o--)if(r[o]===t||r[o].listener===t){l=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(e,t){for(var r=t,n=r+1,a=e.length;n<a;r+=1,n+=1)e[r]=e[n];e.pop()}(r,i),1===r.length&&(a[e]=r[0]),a.removeListener&&this.emit("removeListener",e,l||t)}return this},o.prototype.removeAllListeners=function(e){var t,r,i;if(!(r=this._events))return this;if(!r.removeListener)return 0===arguments.length?(this._events=n(null),this._eventsCount=0):r[e]&&(0==--this._eventsCount?this._events=n(null):delete r[e]),this;if(0===arguments.length){var o,l=a(r);for(i=0;i<l.length;++i)"removeListener"!==(o=l[i])&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=n(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(t)for(i=t.length-1;i>=0;i--)this.removeListener(e,t[i]);return this},o.prototype.listeners=function(e){return h(this,e,!0)},o.prototype.rawListeners=function(e){return h(this,e,!1)},o.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):g.call(e,t)},o.prototype.listenerCount=g,o.prototype.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]}},{}],2:[function(e,t,r){!function(){var e={version:"3.5.17"},r=[].slice,n=function(e){return r.call(e)},a=this.document;function i(e){return e&&(e.ownerDocument||e.document||e).documentElement}function o(e){return e&&(e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView)}if(a)try{n(a.documentElement.childNodes)[0].nodeType}catch(e){n=function(e){for(var t=e.length,r=new Array(t);t--;)r[t]=e[t];return r}}if(Date.now||(Date.now=function(){return+new Date}),a)try{a.createElement("DIV").style.setProperty("opacity",0,"")}catch(e){var l=this.Element.prototype,s=l.setAttribute,c=l.setAttributeNS,u=this.CSSStyleDeclaration.prototype,f=u.setProperty;l.setAttribute=function(e,t){s.call(this,e,t+"")},l.setAttributeNS=function(e,t,r){c.call(this,e,t,r+"")},u.setProperty=function(e,t,r){f.call(this,e,t+"",r)}}function d(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function p(e){return null===e?NaN:+e}function h(e){return!isNaN(e)}function g(e){return{left:function(t,r,n,a){for(arguments.length<3&&(n=0),arguments.length<4&&(a=t.length);n<a;){var i=n+a>>>1;e(t[i],r)<0?n=i+1:a=i}return n},right:function(t,r,n,a){for(arguments.length<3&&(n=0),arguments.length<4&&(a=t.length);n<a;){var i=n+a>>>1;e(t[i],r)>0?a=i:n=i+1}return n}}}e.ascending=d,e.descending=function(e,t){return t<e?-1:t>e?1:t>=e?0:NaN},e.min=function(e,t){var r,n,a=-1,i=e.length;if(1===arguments.length){for(;++a<i;)if(null!=(n=e[a])&&n>=n){r=n;break}for(;++a<i;)null!=(n=e[a])&&r>n&&(r=n)}else{for(;++a<i;)if(null!=(n=t.call(e,e[a],a))&&n>=n){r=n;break}for(;++a<i;)null!=(n=t.call(e,e[a],a))&&r>n&&(r=n)}return r},e.max=function(e,t){var r,n,a=-1,i=e.length;if(1===arguments.length){for(;++a<i;)if(null!=(n=e[a])&&n>=n){r=n;break}for(;++a<i;)null!=(n=e[a])&&n>r&&(r=n)}else{for(;++a<i;)if(null!=(n=t.call(e,e[a],a))&&n>=n){r=n;break}for(;++a<i;)null!=(n=t.call(e,e[a],a))&&n>r&&(r=n)}return r},e.extent=function(e,t){var r,n,a,i=-1,o=e.length;if(1===arguments.length){for(;++i<o;)if(null!=(n=e[i])&&n>=n){r=a=n;break}for(;++i<o;)null!=(n=e[i])&&(r>n&&(r=n),a<n&&(a=n))}else{for(;++i<o;)if(null!=(n=t.call(e,e[i],i))&&n>=n){r=a=n;break}for(;++i<o;)null!=(n=t.call(e,e[i],i))&&(r>n&&(r=n),a<n&&(a=n))}return[r,a]},e.sum=function(e,t){var r,n=0,a=e.length,i=-1;if(1===arguments.length)for(;++i<a;)h(r=+e[i])&&(n+=r);else for(;++i<a;)h(r=+t.call(e,e[i],i))&&(n+=r);return n},e.mean=function(e,t){var r,n=0,a=e.length,i=-1,o=a;if(1===arguments.length)for(;++i<a;)h(r=p(e[i]))?n+=r:--o;else for(;++i<a;)h(r=p(t.call(e,e[i],i)))?n+=r:--o;if(o)return n/o},e.quantile=function(e,t){var r=(e.length-1)*t+1,n=Math.floor(r),a=+e[n-1],i=r-n;return i?a+i*(e[n]-a):a},e.median=function(t,r){var n,a=[],i=t.length,o=-1;if(1===arguments.length)for(;++o<i;)h(n=p(t[o]))&&a.push(n);else for(;++o<i;)h(n=p(r.call(t,t[o],o)))&&a.push(n);if(a.length)return e.quantile(a.sort(d),.5)},e.variance=function(e,t){var r,n,a=e.length,i=0,o=0,l=-1,s=0;if(1===arguments.length)for(;++l<a;)h(r=p(e[l]))&&(o+=(n=r-i)*(r-(i+=n/++s)));else for(;++l<a;)h(r=p(t.call(e,e[l],l)))&&(o+=(n=r-i)*(r-(i+=n/++s)));if(s>1)return o/(s-1)},e.deviation=function(){var t=e.variance.apply(this,arguments);return t?Math.sqrt(t):t};var v=g(d);function m(e){return e.length}e.bisectLeft=v.left,e.bisect=e.bisectRight=v.right,e.bisector=function(e){return g(1===e.length?function(t,r){return d(e(t),r)}:e)},e.shuffle=function(e,t,r){(i=arguments.length)<3&&(r=e.length,i<2&&(t=0));for(var n,a,i=r-t;i;)a=Math.random()*i--|0,n=e[i+t],e[i+t]=e[a+t],e[a+t]=n;return e},e.permute=function(e,t){for(var r=t.length,n=new Array(r);r--;)n[r]=e[t[r]];return n},e.pairs=function(e){for(var t=0,r=e.length-1,n=e[0],a=new Array(r<0?0:r);t<r;)a[t]=[n,n=e[++t]];return a},e.transpose=function(t){if(!(i=t.length))return[];for(var r=-1,n=e.min(t,m),a=new Array(n);++r<n;)for(var i,o=-1,l=a[r]=new Array(i);++o<i;)l[o]=t[o][r];return a},e.zip=function(){return e.transpose(arguments)},e.keys=function(e){var t=[];for(var r in e)t.push(r);return t},e.values=function(e){var t=[];for(var r in e)t.push(e[r]);return t},e.entries=function(e){var t=[];for(var r in e)t.push({key:r,value:e[r]});return t},e.merge=function(e){for(var t,r,n,a=e.length,i=-1,o=0;++i<a;)o+=e[i].length;for(r=new Array(o);--a>=0;)for(t=(n=e[a]).length;--t>=0;)r[--o]=n[t];return r};var y=Math.abs;function x(e,t){for(var r in t)Object.defineProperty(e.prototype,r,{value:t[r],enumerable:!1})}function b(){this._=Object.create(null)}e.range=function(e,t,r){if(arguments.length<3&&(r=1,arguments.length<2&&(t=e,e=0)),(t-e)/r==1/0)throw new Error("infinite range");var n,a=[],i=function(e){var t=1;for(;e*t%1;)t*=10;return t}(y(r)),o=-1;if(e*=i,t*=i,(r*=i)<0)for(;(n=e+r*++o)>t;)a.push(n/i);else for(;(n=e+r*++o)<t;)a.push(n/i);return a},e.map=function(e,t){var r=new b;if(e instanceof b)e.forEach(function(e,t){r.set(e,t)});else if(Array.isArray(e)){var n,a=-1,i=e.length;if(1===arguments.length)for(;++a<i;)r.set(a,e[a]);else for(;++a<i;)r.set(t.call(e,n=e[a],a),n)}else for(var o in e)r.set(o,e[o]);return r};var _="__proto__",w="\0";function k(e){return(e+="")===_||e[0]===w?w+e:e}function T(e){return(e+="")[0]===w?e.slice(1):e}function M(e){return k(e)in this._}function A(e){return(e=k(e))in this._&&delete this._[e]}function L(){var e=[];for(var t in this._)e.push(T(t));return e}function S(){var e=0;for(var t in this._)++e;return e}function C(){for(var e in this._)return!1;return!0}function O(){this._=Object.create(null)}function P(e){return e}function D(e,t,r){return function(){var n=r.apply(t,arguments);return n===t?e:n}}function z(e,t){if(t in e)return t;t=t.charAt(0).toUpperCase()+t.slice(1);for(var r=0,n=R.length;r<n;++r){var a=R[r]+t;if(a in e)return a}}x(b,{has:M,get:function(e){return this._[k(e)]},set:function(e,t){return this._[k(e)]=t},remove:A,keys:L,values:function(){var e=[];for(var t in this._)e.push(this._[t]);return e},entries:function(){var e=[];for(var t in this._)e.push({key:T(t),value:this._[t]});return e},size:S,empty:C,forEach:function(e){for(var t in this._)e.call(this,T(t),this._[t])}}),e.nest=function(){var t,r,n={},a=[],i=[];function o(e,i,l){if(l>=a.length)return r?r.call(n,i):t?i.sort(t):i;for(var s,c,u,f,d=-1,p=i.length,h=a[l++],g=new b;++d<p;)(f=g.get(s=h(c=i[d])))?f.push(c):g.set(s,[c]);return e?(c=e(),u=function(t,r){c.set(t,o(e,r,l))}):(c={},u=function(t,r){c[t]=o(e,r,l)}),g.forEach(u),c}return n.map=function(e,t){return o(t,e,0)},n.entries=function(t){return function e(t,r){if(r>=a.length)return t;var n=[],o=i[r++];return t.forEach(function(t,a){n.push({key:t,values:e(a,r)})}),o?n.sort(function(e,t){return o(e.key,t.key)}):n}(o(e.map,t,0),0)},n.key=function(e){return a.push(e),n},n.sortKeys=function(e){return i[a.length-1]=e,n},n.sortValues=function(e){return t=e,n},n.rollup=function(e){return r=e,n},n},e.set=function(e){var t=new O;if(e)for(var r=0,n=e.length;r<n;++r)t.add(e[r]);return t},x(O,{has:M,add:function(e){return this._[k(e+="")]=!0,e},remove:A,values:L,size:S,empty:C,forEach:function(e){for(var t in this._)e.call(this,T(t))}}),e.behavior={},e.rebind=function(e,t){for(var r,n=1,a=arguments.length;++n<a;)e[r=arguments[n]]=D(e,t,t[r]);return e};var R=["webkit","ms","moz","Moz","o","O"];function E(){}function I(){}function F(e){var t=[],r=new b;function n(){for(var r,n=t,a=-1,i=n.length;++a<i;)(r=n[a].on)&&r.apply(this,arguments);return e}return n.on=function(n,a){var i,o=r.get(n);return arguments.length<2?o&&o.on:(o&&(o.on=null,t=t.slice(0,i=t.indexOf(o)).concat(t.slice(i+1)),r.remove(n)),a&&t.push(r.set(n,{on:a})),e)},n}function N(){e.event.preventDefault()}function j(){for(var t,r=e.event;t=r.sourceEvent;)r=t;return r}function B(t){for(var r=new I,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=e.event;i.target=t,e.event=i,r[i.type].apply(n,a)}finally{e.event=o}}},r}e.dispatch=function(){for(var e=new I,t=-1,r=arguments.length;++t<r;)e[arguments[t]]=F(e);return e},I.prototype.on=function(e,t){var r=e.indexOf("."),n="";if(r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),e)return arguments.length<2?this[e].on(n):this[e].on(n,t);if(2===arguments.length){if(null==t)for(e in this)this.hasOwnProperty(e)&&this[e].on(n,null);return this}},e.event=null,e.requote=function(e){return e.replace(H,"\\$&")};var H=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,q={}.__proto__?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)e[r]=t[r]};function V(e){return q(e,Y),e}var U=function(e,t){return t.querySelector(e)},G=function(e,t){return t.querySelectorAll(e)},Z=function(e,t){var r=e.matches||e[z(e,"matchesSelector")];return(Z=function(e,t){return r.call(e,t)})(e,t)};"function"==typeof Sizzle&&(U=function(e,t){return Sizzle(e,t)[0]||null},G=Sizzle,Z=Sizzle.matchesSelector),e.selection=function(){return e.select(a.documentElement)};var Y=e.selection.prototype=[];function X(e){return"function"==typeof e?e:function(){return U(e,this)}}function W(e){return"function"==typeof e?e:function(){return G(e,this)}}Y.select=function(e){var t,r,n,a,i=[];e=X(e);for(var o=-1,l=this.length;++o<l;){i.push(t=[]),t.parentNode=(n=this[o]).parentNode;for(var s=-1,c=n.length;++s<c;)(a=n[s])?(t.push(r=e.call(a,a.__data__,s,o)),r&&"__data__"in a&&(r.__data__=a.__data__)):t.push(null)}return V(i)},Y.selectAll=function(e){var t,r,a=[];e=W(e);for(var i=-1,o=this.length;++i<o;)for(var l=this[i],s=-1,c=l.length;++s<c;)(r=l[s])&&(a.push(t=n(e.call(r,r.__data__,s,i))),t.parentNode=r);return V(a)};var $="http://www.w3.org/1999/xhtml",J={svg:"http://www.w3.org/2000/svg",xhtml:$,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Q(t,r){return t=e.ns.qualify(t),null==r?t.local?function(){this.removeAttributeNS(t.space,t.local)}:function(){this.removeAttribute(t)}:"function"==typeof r?t.local?function(){var e=r.apply(this,arguments);null==e?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,e)}:function(){var e=r.apply(this,arguments);null==e?this.removeAttribute(t):this.setAttribute(t,e)}:t.local?function(){this.setAttributeNS(t.space,t.local,r)}:function(){this.setAttribute(t,r)}}function K(e){return e.trim().replace(/\s+/g," ")}function ee(t){return new RegExp("(?:^|\\s+)"+e.requote(t)+"(?:\\s+|$)","g")}function te(e){return(e+"").trim().split(/^|\s+/)}function re(e,t){var r=(e=te(e).map(ne)).length;return"function"==typeof t?function(){for(var n=-1,a=t.apply(this,arguments);++n<r;)e[n](this,a)}:function(){for(var n=-1;++n<r;)e[n](this,t)}}function ne(e){var t=ee(e);return function(r,n){if(a=r.classList)return n?a.add(e):a.remove(e);var a=r.getAttribute("class")||"";n?(t.lastIndex=0,t.test(a)||r.setAttribute("class",K(a+" "+e))):r.setAttribute("class",K(a.replace(t," ")))}}function ae(e,t,r){return null==t?function(){this.style.removeProperty(e)}:"function"==typeof t?function(){var n=t.apply(this,arguments);null==n?this.style.removeProperty(e):this.style.setProperty(e,n,r)}:function(){this.style.setProperty(e,t,r)}}function ie(e,t){return null==t?function(){delete this[e]}:"function"==typeof t?function(){var r=t.apply(this,arguments);null==r?delete this[e]:this[e]=r}:function(){this[e]=t}}function oe(t){return"function"==typeof t?t:(t=e.ns.qualify(t)).local?function(){return this.ownerDocument.createElementNS(t.space,t.local)}:function(){var e=this.ownerDocument,r=this.namespaceURI;return r===$&&e.documentElement.namespaceURI===$?e.createElement(t):e.createElementNS(r,t)}}function le(){var e=this.parentNode;e&&e.removeChild(this)}function se(e){return{__data__:e}}function ce(e){return function(){return Z(this,e)}}function ue(e,t){for(var r=0,n=e.length;r<n;r++)for(var a,i=e[r],o=0,l=i.length;o<l;o++)(a=i[o])&&t(a,o,r);return e}function fe(e){return q(e,de),e}e.ns={prefix:J,qualify:function(e){var t=e.indexOf(":"),r=e;return t>=0&&"xmlns"!==(r=e.slice(0,t))&&(e=e.slice(t+1)),J.hasOwnProperty(r)?{space:J[r],local:e}:e}},Y.attr=function(t,r){if(arguments.length<2){if("string"==typeof t){var n=this.node();return(t=e.ns.qualify(t)).local?n.getAttributeNS(t.space,t.local):n.getAttribute(t)}for(r in t)this.each(Q(r,t[r]));return this}return this.each(Q(t,r))},Y.classed=function(e,t){if(arguments.length<2){if("string"==typeof e){var r=this.node(),n=(e=te(e)).length,a=-1;if(t=r.classList){for(;++a<n;)if(!t.contains(e[a]))return!1}else for(t=r.getAttribute("class");++a<n;)if(!ee(e[a]).test(t))return!1;return!0}for(t in e)this.each(re(t,e[t]));return this}return this.each(re(e,t))},Y.style=function(e,t,r){var n=arguments.length;if(n<3){if("string"!=typeof e){for(r in n<2&&(t=""),e)this.each(ae(r,e[r],t));return this}if(n<2){var a=this.node();return o(a).getComputedStyle(a,null).getPropertyValue(e)}r=""}return this.each(ae(e,t,r))},Y.property=function(e,t){if(arguments.length<2){if("string"==typeof e)return this.node()[e];for(t in e)this.each(ie(t,e[t]));return this}return this.each(ie(e,t))},Y.text=function(e){return arguments.length?this.each("function"==typeof e?function(){var t=e.apply(this,arguments);this.textContent=null==t?"":t}:null==e?function(){this.textContent=""}:function(){this.textContent=e}):this.node().textContent},Y.html=function(e){return arguments.length?this.each("function"==typeof e?function(){var t=e.apply(this,arguments);this.innerHTML=null==t?"":t}:null==e?function(){this.innerHTML=""}:function(){this.innerHTML=e}):this.node().innerHTML},Y.append=function(e){return e=oe(e),this.select(function(){return this.appendChild(e.apply(this,arguments))})},Y.insert=function(e,t){return e=oe(e),t=X(t),this.select(function(){return this.insertBefore(e.apply(this,arguments),t.apply(this,arguments)||null)})},Y.remove=function(){return this.each(le)},Y.data=function(e,t){var r,n,a=-1,i=this.length;if(!arguments.length){for(e=new Array(i=(r=this[0]).length);++a<i;)(n=r[a])&&(e[a]=n.__data__);return e}function o(e,r){var n,a,i,o=e.length,u=r.length,f=Math.min(o,u),d=new Array(u),p=new Array(u),h=new Array(o);if(t){var g,v=new b,m=new Array(o);for(n=-1;++n<o;)(a=e[n])&&(v.has(g=t.call(a,a.__data__,n))?h[n]=a:v.set(g,a),m[n]=g);for(n=-1;++n<u;)(a=v.get(g=t.call(r,i=r[n],n)))?!0!==a&&(d[n]=a,a.__data__=i):p[n]=se(i),v.set(g,!0);for(n=-1;++n<o;)n in m&&!0!==v.get(m[n])&&(h[n]=e[n])}else{for(n=-1;++n<f;)a=e[n],i=r[n],a?(a.__data__=i,d[n]=a):p[n]=se(i);for(;n<u;++n)p[n]=se(r[n]);for(;n<o;++n)h[n]=e[n]}p.update=d,p.parentNode=d.parentNode=h.parentNode=e.parentNode,l.push(p),s.push(d),c.push(h)}var l=fe([]),s=V([]),c=V([]);if("function"==typeof e)for(;++a<i;)o(r=this[a],e.call(r,r.parentNode.__data__,a));else for(;++a<i;)o(r=this[a],e);return s.enter=function(){return l},s.exit=function(){return c},s},Y.datum=function(e){return arguments.length?this.property("__data__",e):this.property("__data__")},Y.filter=function(e){var t,r,n,a=[];"function"!=typeof e&&(e=ce(e));for(var i=0,o=this.length;i<o;i++){a.push(t=[]),t.parentNode=(r=this[i]).parentNode;for(var l=0,s=r.length;l<s;l++)(n=r[l])&&e.call(n,n.__data__,l,i)&&t.push(n)}return V(a)},Y.order=function(){for(var e=-1,t=this.length;++e<t;)for(var r,n=this[e],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},Y.sort=function(e){e=function(e){arguments.length||(e=d);return function(t,r){return t&&r?e(t.__data__,r.__data__):!t-!r}}.apply(this,arguments);for(var t=-1,r=this.length;++t<r;)this[t].sort(e);return this.order()},Y.each=function(e){return ue(this,function(t,r,n){e.call(t,t.__data__,r,n)})},Y.call=function(e){var t=n(arguments);return e.apply(t[0]=this,t),this},Y.empty=function(){return!this.node()},Y.node=function(){for(var e=0,t=this.length;e<t;e++)for(var r=this[e],n=0,a=r.length;n<a;n++){var i=r[n];if(i)return i}return null},Y.size=function(){var e=0;return ue(this,function(){++e}),e};var de=[];function pe(t,r,a){var i="__on"+t,o=t.indexOf("."),l=ge;o>0&&(t=t.slice(0,o));var s=he.get(t);function c(){var e=this[i];e&&(this.removeEventListener(t,e,e.$),delete this[i])}return s&&(t=s,l=ve),o?r?function(){var e=l(r,n(arguments));c.call(this),this.addEventListener(t,this[i]=e,e.$=a),e._=r}:c:r?E:function(){var r,n=new RegExp("^__on([^.]+)"+e.requote(t)+"$");for(var a in this)if(r=a.match(n)){var i=this[a];this.removeEventListener(r[1],i,i.$),delete this[a]}}}e.selection.enter=fe,e.selection.enter.prototype=de,de.append=Y.append,de.empty=Y.empty,de.node=Y.node,de.call=Y.call,de.size=Y.size,de.select=function(e){for(var t,r,n,a,i,o=[],l=-1,s=this.length;++l<s;){n=(a=this[l]).update,o.push(t=[]),t.parentNode=a.parentNode;for(var c=-1,u=a.length;++c<u;)(i=a[c])?(t.push(n[c]=r=e.call(a.parentNode,i.__data__,c,l)),r.__data__=i.__data__):t.push(null)}return V(o)},de.insert=function(e,t){var r,n,a;return arguments.length<2&&(r=this,t=function(e,t,i){var o,l=r[i].update,s=l.length;for(i!=a&&(a=i,n=0),t>=n&&(n=t+1);!(o=l[n])&&++n<s;);return o}),Y.insert.call(this,e,t)},e.select=function(e){var t;return"string"==typeof e?(t=[U(e,a)]).parentNode=a.documentElement:(t=[e]).parentNode=i(e),V([t])},e.selectAll=function(e){var t;return"string"==typeof e?(t=n(G(e,a))).parentNode=a.documentElement:(t=n(e)).parentNode=null,V([t])},Y.on=function(e,t,r){var n=arguments.length;if(n<3){if("string"!=typeof e){for(r in n<2&&(t=!1),e)this.each(pe(r,e[r],t));return this}if(n<2)return(n=this.node()["__on"+e])&&n._;r=!1}return this.each(pe(e,t,r))};var he=e.map({mouseenter:"mouseover",mouseleave:"mouseout"});function ge(t,r){return function(n){var a=e.event;e.event=n,r[0]=this.__data__;try{t.apply(this,r)}finally{e.event=a}}}function ve(e,t){var r=ge(e,t);return function(e){var t=e.relatedTarget;t&&(t===this||8&t.compareDocumentPosition(this))||r.call(this,e)}}a&&he.forEach(function(e){"on"+e in a&&he.remove(e)});var me,ye=0;function xe(t){var r=".dragsuppress-"+ ++ye,n="click"+r,a=e.select(o(t)).on("touchmove"+r,N).on("dragstart"+r,N).on("selectstart"+r,N);if(null==me&&(me=!("onselectstart"in t)&&z(t.style,"userSelect")),me){var l=i(t).style,s=l[me];l[me]="none"}return function(e){if(a.on(r,null),me&&(l[me]=s),e){var t=function(){a.on(n,null)};a.on(n,function(){N(),t()},!0),setTimeout(t,0)}}}e.mouse=function(e){return _e(e,j())};var be=this.navigator&&/WebKit/.test(this.navigator.userAgent)?-1:0;function _e(t,r){r.changedTouches&&(r=r.changedTouches[0]);var n=t.ownerSVGElement||t;if(n.createSVGPoint){var a=n.createSVGPoint();if(be<0){var i=o(t);if(i.scrollX||i.scrollY){var l=(n=e.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important"))[0][0].getScreenCTM();be=!(l.f||l.e),n.remove()}}return be?(a.x=r.pageX,a.y=r.pageY):(a.x=r.clientX,a.y=r.clientY),[(a=a.matrixTransform(t.getScreenCTM().inverse())).x,a.y]}var s=t.getBoundingClientRect();return[r.clientX-s.left-t.clientLeft,r.clientY-s.top-t.clientTop]}function we(){return e.event.changedTouches[0].identifier}e.touch=function(e,t,r){if(arguments.length<3&&(r=t,t=j().changedTouches),t)for(var n,a=0,i=t.length;a<i;++a)if((n=t[a]).identifier===r)return _e(e,n)},e.behavior.drag=function(){var t=B(i,"drag","dragstart","dragend"),r=null,n=l(E,e.mouse,o,"mousemove","mouseup"),a=l(we,e.touch,P,"touchmove","touchend");function i(){this.on("mousedown.drag",n).on("touchstart.drag",a)}function l(n,a,i,o,l){return function(){var s,c=e.event.target.correspondingElement||e.event.target,u=this.parentNode,f=t.of(this,arguments),d=0,p=n(),h=".drag"+(null==p?"":"-"+p),g=e.select(i(c)).on(o+h,function(){var e,t,r=a(u,p);if(!r)return;e=r[0]-m[0],t=r[1]-m[1],d|=e|t,m=r,f({type:"drag",x:r[0]+s[0],y:r[1]+s[1],dx:e,dy:t})}).on(l+h,function(){if(!a(u,p))return;g.on(o+h,null).on(l+h,null),v(d),f({type:"dragend"})}),v=xe(c),m=a(u,p);s=r?[(s=r.apply(this,arguments)).x-m[0],s.y-m[1]]:[0,0],f({type:"dragstart"})}}return i.origin=function(e){return arguments.length?(r=e,i):r},e.rebind(i,t,"on")},e.touches=function(e,t){return arguments.length<2&&(t=j().touches),t?n(t).map(function(t){var r=_e(e,t);return r.identifier=t.identifier,r}):[]};var ke=1e-6,Te=ke*ke,Me=Math.PI,Ae=2*Me,Le=Ae-ke,Se=Me/2,Ce=Me/180,Oe=180/Me;function Pe(e){return e>0?1:e<0?-1:0}function De(e,t,r){return(t[0]-e[0])*(r[1]-e[1])-(t[1]-e[1])*(r[0]-e[0])}function ze(e){return e>1?0:e<-1?Me:Math.acos(e)}function Re(e){return e>1?Se:e<-1?-Se:Math.asin(e)}function Ee(e){return((e=Math.exp(e))+1/e)/2}function Ie(e){return(e=Math.sin(e/2))*e}var Fe=Math.SQRT2;e.interpolateZoom=function(e,t){var r,n,a=e[0],i=e[1],o=e[2],l=t[0],s=t[1],c=t[2],u=l-a,f=s-i,d=u*u+f*f;if(d<Te)n=Math.log(c/o)/Fe,r=function(e){return[a+e*u,i+e*f,o*Math.exp(Fe*e*n)]};else{var p=Math.sqrt(d),h=(c*c-o*o+4*d)/(2*o*2*p),g=(c*c-o*o-4*d)/(2*c*2*p),v=Math.log(Math.sqrt(h*h+1)-h),m=Math.log(Math.sqrt(g*g+1)-g);n=(m-v)/Fe,r=function(e){var t,r=e*n,l=Ee(v),s=o/(2*p)*(l*(t=Fe*r+v,((t=Math.exp(2*t))-1)/(t+1))-function(e){return((e=Math.exp(e))-1/e)/2}(v));return[a+s*u,i+s*f,o*l/Ee(Fe*r+v)]}}return r.duration=1e3*n,r},e.behavior.zoom=function(){var t,r,n,i,l,s,c,u,f,d={x:0,y:0,k:1},p=[960,500],h=Be,g=250,v=0,m="mousedown.zoom",y="mousemove.zoom",x="mouseup.zoom",b="touchstart.zoom",_=B(w,"zoomstart","zoom","zoomend");function w(e){e.on(m,P).on(je+".zoom",z).on("dblclick.zoom",R).on(b,D)}function k(e){return[(e[0]-d.x)/d.k,(e[1]-d.y)/d.k]}function T(e){d.k=Math.max(h[0],Math.min(h[1],e))}function M(e,t){t=function(e){return[e[0]*d.k+d.x,e[1]*d.k+d.y]}(t),d.x+=e[0]-t[0],d.y+=e[1]-t[1]}function A(t,n,a,i){t.__chart__={x:d.x,y:d.y,k:d.k},T(Math.pow(2,i)),M(r=n,a),t=e.select(t),g>0&&(t=t.transition().duration(g)),t.call(w.event)}function L(){c&&c.domain(s.range().map(function(e){return(e-d.x)/d.k}).map(s.invert)),f&&f.domain(u.range().map(function(e){return(e-d.y)/d.k}).map(u.invert))}function S(e){v++||e({type:"zoomstart"})}function C(e){L(),e({type:"zoom",scale:d.k,translate:[d.x,d.y]})}function O(e){--v||(e({type:"zoomend"}),r=null)}function P(){var t=this,r=_.of(t,arguments),n=0,a=e.select(o(t)).on(y,function(){n=1,M(e.mouse(t),i),C(r)}).on(x,function(){a.on(y,null).on(x,null),l(n),O(r)}),i=k(e.mouse(t)),l=xe(t);ll.call(t),S(r)}function D(){var t,r=this,n=_.of(r,arguments),a={},i=0,o=".zoom-"+e.event.changedTouches[0].identifier,s="touchmove"+o,c="touchend"+o,u=[],f=e.select(r),p=xe(r);function h(){var n=e.touches(r);return t=d.k,n.forEach(function(e){e.identifier in a&&(a[e.identifier]=k(e))}),n}function g(){var t=e.event.target;e.select(t).on(s,v).on(c,y),u.push(t);for(var n=e.event.changedTouches,o=0,f=n.length;o<f;++o)a[n[o].identifier]=null;var p=h(),g=Date.now();if(1===p.length){if(g-l<500){var m=p[0];A(r,m,a[m.identifier],Math.floor(Math.log(d.k)/Math.LN2)+1),N()}l=g}else if(p.length>1){m=p[0];var x=p[1],b=m[0]-x[0],_=m[1]-x[1];i=b*b+_*_}}function v(){var o,s,c,u,f=e.touches(r);ll.call(r);for(var d=0,p=f.length;d<p;++d,u=null)if(c=f[d],u=a[c.identifier]){if(s)break;o=c,s=u}if(u){var h=(h=c[0]-o[0])*h+(h=c[1]-o[1])*h,g=i&&Math.sqrt(h/i);o=[(o[0]+c[0])/2,(o[1]+c[1])/2],s=[(s[0]+u[0])/2,(s[1]+u[1])/2],T(g*t)}l=null,M(o,s),C(n)}function y(){if(e.event.touches.length){for(var t=e.event.changedTouches,r=0,i=t.length;r<i;++r)delete a[t[r].identifier];for(var l in a)return void h()}e.selectAll(u).on(o,null),f.on(m,P).on(b,D),p(),O(n)}g(),S(n),f.on(m,null).on(b,g)}function z(){var a=_.of(this,arguments);i?clearTimeout(i):(ll.call(this),t=k(r=n||e.mouse(this)),S(a)),i=setTimeout(function(){i=null,O(a)},50),N(),T(Math.pow(2,.002*Ne())*d.k),M(r,t),C(a)}function R(){var t=e.mouse(this),r=Math.log(d.k)/Math.LN2;A(this,t,k(t),e.event.shiftKey?Math.ceil(r)-1:Math.floor(r)+1)}return je||(je="onwheel"in a?(Ne=function(){return-e.event.deltaY*(e.event.deltaMode?120:1)},"wheel"):"onmousewheel"in a?(Ne=function(){return e.event.wheelDelta},"mousewheel"):(Ne=function(){return-e.event.detail},"MozMousePixelScroll")),w.event=function(t){t.each(function(){var t=_.of(this,arguments),n=d;ul?e.select(this).transition().each("start.zoom",function(){d=this.__chart__||{x:0,y:0,k:1},S(t)}).tween("zoom:zoom",function(){var a=p[0],i=p[1],o=r?r[0]:a/2,l=r?r[1]:i/2,s=e.interpolateZoom([(o-d.x)/d.k,(l-d.y)/d.k,a/d.k],[(o-n.x)/n.k,(l-n.y)/n.k,a/n.k]);return function(e){var r=s(e),n=a/r[2];this.__chart__=d={x:o-r[0]*n,y:l-r[1]*n,k:n},C(t)}}).each("interrupt.zoom",function(){O(t)}).each("end.zoom",function(){O(t)}):(this.__chart__=d,S(t),C(t),O(t))})},w.translate=function(e){return arguments.length?(d={x:+e[0],y:+e[1],k:d.k},L(),w):[d.x,d.y]},w.scale=function(e){return arguments.length?(d={x:d.x,y:d.y,k:null},T(+e),L(),w):d.k},w.scaleExtent=function(e){return arguments.length?(h=null==e?Be:[+e[0],+e[1]],w):h},w.center=function(e){return arguments.length?(n=e&&[+e[0],+e[1]],w):n},w.size=function(e){return arguments.length?(p=e&&[+e[0],+e[1]],w):p},w.duration=function(e){return arguments.length?(g=+e,w):g},w.x=function(e){return arguments.length?(c=e,s=e.copy(),d={x:0,y:0,k:1},w):c},w.y=function(e){return arguments.length?(f=e,u=e.copy(),d={x:0,y:0,k:1},w):f},e.rebind(w,_,"on")};var Ne,je,Be=[0,1/0];function He(){}function qe(e,t,r){return this instanceof qe?(this.h=+e,this.s=+t,void(this.l=+r)):arguments.length<2?e instanceof qe?new qe(e.h,e.s,e.l):ut(""+e,ft,qe):new qe(e,t,r)}e.color=He,He.prototype.toString=function(){return this.rgb()+""},e.hsl=qe;var Ve=qe.prototype=new He;function Ue(e,t,r){var n,a;function i(e){return Math.round(255*function(e){return e>360?e-=360:e<0&&(e+=360),e<60?n+(a-n)*e/60:e<180?a:e<240?n+(a-n)*(240-e)/60:n}(e))}return e=isNaN(e)?0:(e%=360)<0?e+360:e,t=isNaN(t)?0:t<0?0:t>1?1:t,n=2*(r=r<0?0:r>1?1:r)-(a=r<=.5?r*(1+t):r+t-r*t),new it(i(e+120),i(e),i(e-120))}function Ge(t,r,n){return this instanceof Ge?(this.h=+t,this.c=+r,void(this.l=+n)):arguments.length<2?t instanceof Ge?new Ge(t.h,t.c,t.l):tt(t instanceof Xe?t.l:(t=dt((t=e.rgb(t)).r,t.g,t.b)).l,t.a,t.b):new Ge(t,r,n)}Ve.brighter=function(e){return e=Math.pow(.7,arguments.length?e:1),new qe(this.h,this.s,this.l/e)},Ve.darker=function(e){return e=Math.pow(.7,arguments.length?e:1),new qe(this.h,this.s,e*this.l)},Ve.rgb=function(){return Ue(this.h,this.s,this.l)},e.hcl=Ge;var Ze=Ge.prototype=new He;function Ye(e,t,r){return isNaN(e)&&(e=0),isNaN(t)&&(t=0),new Xe(r,Math.cos(e*=Ce)*t,Math.sin(e)*t)}function Xe(e,t,r){return this instanceof Xe?(this.l=+e,this.a=+t,void(this.b=+r)):arguments.length<2?e instanceof Xe?new Xe(e.l,e.a,e.b):e instanceof Ge?Ye(e.h,e.c,e.l):dt((e=it(e)).r,e.g,e.b):new Xe(e,t,r)}Ze.brighter=function(e){return new Ge(this.h,this.c,Math.min(100,this.l+We*(arguments.length?e:1)))},Ze.darker=function(e){return new Ge(this.h,this.c,Math.max(0,this.l-We*(arguments.length?e:1)))},Ze.rgb=function(){return Ye(this.h,this.c,this.l).rgb()},e.lab=Xe;var We=18,$e=.95047,Je=1,Qe=1.08883,Ke=Xe.prototype=new He;function et(e,t,r){var n=(e+16)/116,a=n+t/500,i=n-r/200;return new it(at(3.2404542*(a=rt(a)*$e)-1.5371385*(n=rt(n)*Je)-.4985314*(i=rt(i)*Qe)),at(-.969266*a+1.8760108*n+.041556*i),at(.0556434*a-.2040259*n+1.0572252*i))}function tt(e,t,r){return e>0?new Ge(Math.atan2(r,t)*Oe,Math.sqrt(t*t+r*r),e):new Ge(NaN,NaN,e)}function rt(e){return e>.206893034?e*e*e:(e-4/29)/7.787037}function nt(e){return e>.008856?Math.pow(e,1/3):7.787037*e+4/29}function at(e){return Math.round(255*(e<=.00304?12.92*e:1.055*Math.pow(e,1/2.4)-.055))}function it(e,t,r){return this instanceof it?(this.r=~~e,this.g=~~t,void(this.b=~~r)):arguments.length<2?e instanceof it?new it(e.r,e.g,e.b):ut(""+e,it,Ue):new it(e,t,r)}function ot(e){return new it(e>>16,e>>8&255,255&e)}function lt(e){return ot(e)+""}Ke.brighter=function(e){return new Xe(Math.min(100,this.l+We*(arguments.length?e:1)),this.a,this.b)},Ke.darker=function(e){return new Xe(Math.max(0,this.l-We*(arguments.length?e:1)),this.a,this.b)},Ke.rgb=function(){return et(this.l,this.a,this.b)},e.rgb=it;var st=it.prototype=new He;function ct(e){return e<16?"0"+Math.max(0,e).toString(16):Math.min(255,e).toString(16)}function ut(e,t,r){var n,a,i,o=0,l=0,s=0;if(n=/([a-z]+)\((.*)\)/.exec(e=e.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 t(ht(a[0]),ht(a[1]),ht(a[2]))}return(i=gt.get(e))?t(i.r,i.g,i.b):(null==e||"#"!==e.charAt(0)||isNaN(i=parseInt(e.slice(1),16))||(4===e.length?(o=(3840&i)>>4,o|=o>>4,l=240&i,l|=l>>4,s=15&i,s|=s<<4):7===e.length&&(o=(16711680&i)>>16,l=(65280&i)>>8,s=255&i)),t(o,l,s))}function ft(e,t,r){var n,a,i=Math.min(e/=255,t/=255,r/=255),o=Math.max(e,t,r),l=o-i,s=(o+i)/2;return l?(a=s<.5?l/(o+i):l/(2-o-i),n=e==o?(t-r)/l+(t<r?6:0):t==o?(r-e)/l+2:(e-t)/l+4,n*=60):(n=NaN,a=s>0&&s<1?0:n),new qe(n,a,s)}function dt(e,t,r){var n=nt((.4124564*(e=pt(e))+.3575761*(t=pt(t))+.1804375*(r=pt(r)))/$e),a=nt((.2126729*e+.7151522*t+.072175*r)/Je);return Xe(116*a-16,500*(n-a),200*(a-nt((.0193339*e+.119192*t+.9503041*r)/Qe)))}function pt(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function ht(e){var t=parseFloat(e);return"%"===e.charAt(e.length-1)?Math.round(2.55*t):t}st.brighter=function(e){e=Math.pow(.7,arguments.length?e:1);var t=this.r,r=this.g,n=this.b,a=30;return t||r||n?(t&&t<a&&(t=a),r&&r<a&&(r=a),n&&n<a&&(n=a),new it(Math.min(255,t/e),Math.min(255,r/e),Math.min(255,n/e))):new it(a,a,a)},st.darker=function(e){return new it((e=Math.pow(.7,arguments.length?e:1))*this.r,e*this.g,e*this.b)},st.hsl=function(){return ft(this.r,this.g,this.b)},st.toString=function(){return"#"+ct(this.r)+ct(this.g)+ct(this.b)};var gt=e.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 vt(e){return"function"==typeof e?e:function(){return e}}function mt(e){return function(t,r,n){return 2===arguments.length&&"function"==typeof r&&(n=r,r=null),yt(t,r,e,n)}}function yt(t,r,a,i){var o={},l=e.dispatch("beforesend","progress","load","error"),s={},c=new XMLHttpRequest,u=null;function f(){var e,t=c.status;if(!t&&function(e){var t=e.responseType;return t&&"text"!==t?e.response:e.responseText}(c)||t>=200&&t<300||304===t){try{e=a.call(o,c)}catch(e){return void l.error.call(o,e)}l.load.call(o,e)}else l.error.call(o,c)}return!this.XDomainRequest||"withCredentials"in c||!/^(http(s)?:)?\/\//.test(t)||(c=new XDomainRequest),"onload"in c?c.onload=c.onerror=f:c.onreadystatechange=function(){c.readyState>3&&f()},c.onprogress=function(t){var r=e.event;e.event=t;try{l.progress.call(o,c)}finally{e.event=r}},o.header=function(e,t){return e=(e+"").toLowerCase(),arguments.length<2?s[e]:(null==t?delete s[e]:s[e]=t+"",o)},o.mimeType=function(e){return arguments.length?(r=null==e?null:e+"",o):r},o.responseType=function(e){return arguments.length?(u=e,o):u},o.response=function(e){return a=e,o},["get","post"].forEach(function(e){o[e]=function(){return o.send.apply(o,[e].concat(n(arguments)))}}),o.send=function(e,n,a){if(2===arguments.length&&"function"==typeof n&&(a=n,n=null),c.open(e,t,!0),null==r||"accept"in s||(s.accept=r+",*/*"),c.setRequestHeader)for(var i in s)c.setRequestHeader(i,s[i]);return null!=r&&c.overrideMimeType&&c.overrideMimeType(r),null!=u&&(c.responseType=u),null!=a&&o.on("error",a).on("load",function(e){a(null,e)}),l.beforesend.call(o,c),c.send(null==n?null:n),o},o.abort=function(){return c.abort(),o},e.rebind(o,l,"on"),null==i?o:o.get(function(e){return 1===e.length?function(t,r){e(null==t?r:null)}:e}(i))}gt.forEach(function(e,t){gt.set(e,ot(t))}),e.functor=vt,e.xhr=mt(P),e.dsv=function(e,t){var r=new RegExp('["'+e+"\n]"),n=e.charCodeAt(0);function a(e,r,n){arguments.length<3&&(n=r,r=null);var a=yt(e,t,null==r?i:o(r),n);return a.row=function(e){return arguments.length?a.response(null==(r=e)?i:o(e)):r},a}function i(e){return a.parse(e.responseText)}function o(e){return function(t){return a.parse(t.responseText,e)}}function l(t){return t.map(s).join(e)}function s(e){return r.test(e)?'"'+e.replace(/\"/g,'""')+'"':e}return a.parse=function(e,t){var r;return a.parseRows(e,function(e,n){if(r)return r(e,n-1);var a=new Function("d","return {"+e.map(function(e,t){return JSON.stringify(e)+": d["+t+"]"}).join(",")+"}");r=t?function(e,r){return t(a(e),r)}:a})},a.parseRows=function(e,t){var r,a,i={},o={},l=[],s=e.length,c=0,u=0;function f(){if(c>=s)return o;if(a)return a=!1,i;var t=c;if(34===e.charCodeAt(t)){for(var r=t;r++<s;)if(34===e.charCodeAt(r)){if(34!==e.charCodeAt(r+1))break;++r}return c=r+2,13===(l=e.charCodeAt(r+1))?(a=!0,10===e.charCodeAt(r+2)&&++c):10===l&&(a=!0),e.slice(t+1,r).replace(/""/g,'"')}for(;c<s;){var l,u=1;if(10===(l=e.charCodeAt(c++)))a=!0;else if(13===l)a=!0,10===e.charCodeAt(c)&&(++c,++u);else if(l!==n)continue;return e.slice(t,c-u)}return e.slice(t)}for(;(r=f())!==o;){for(var d=[];r!==i&&r!==o;)d.push(r),r=f();t&&null==(d=t(d,u++))||l.push(d)}return l},a.format=function(t){if(Array.isArray(t[0]))return a.formatRows(t);var r=new O,n=[];return t.forEach(function(e){for(var t in e)r.has(t)||n.push(r.add(t))}),[n.map(s).join(e)].concat(t.map(function(t){return n.map(function(e){return s(t[e])}).join(e)})).join("\n")},a.formatRows=function(e){return e.map(l).join("\n")},a},e.csv=e.dsv(",","text/csv"),e.tsv=e.dsv("\t","text/tab-separated-values");var xt,bt,_t,wt,kt=this[z(this,"requestAnimationFrame")]||function(e){setTimeout(e,17)};function Tt(e,t,r){var n=arguments.length;n<2&&(t=0),n<3&&(r=Date.now());var a={c:e,t:r+t,n:null};return bt?bt.n=a:xt=a,bt=a,_t||(wt=clearTimeout(wt),_t=1,kt(Mt)),a}function Mt(){var e=At(),t=Lt()-e;t>24?(isFinite(t)&&(clearTimeout(wt),wt=setTimeout(Mt,t)),_t=0):(_t=1,kt(Mt))}function At(){for(var e=Date.now(),t=xt;t;)e>=t.t&&t.c(e-t.t)&&(t.c=null),t=t.n;return e}function Lt(){for(var e,t=xt,r=1/0;t;)t.c?(t.t<r&&(r=t.t),t=(e=t).n):t=e?e.n=t.n:xt=t.n;return bt=e,r}function St(e,t){return t-(e?Math.ceil(Math.log(e)/Math.LN10):1)}e.timer=function(){Tt.apply(this,arguments)},e.timer.flush=function(){At(),Lt()},e.round=function(e,t){return t?Math.round(e*(t=Math.pow(10,t)))/t:Math.round(e)};var Ct=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"].map(function(e,t){var r=Math.pow(10,3*y(8-t));return{scale:t>8?function(e){return e/r}:function(e){return e*r},symbol:e}});e.formatPrefix=function(t,r){var n=0;return(t=+t)&&(t<0&&(t*=-1),r&&(t=e.round(t,St(t,r))),n=1+Math.floor(1e-12+Math.log(t)/Math.LN10),n=Math.max(-24,Math.min(24,3*Math.floor((n-1)/3)))),Ct[8+n/3]};var Ot=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,Pt=e.map({b:function(e){return e.toString(2)},c:function(e){return String.fromCharCode(e)},o:function(e){return e.toString(8)},x:function(e){return e.toString(16)},X:function(e){return e.toString(16).toUpperCase()},g:function(e,t){return e.toPrecision(t)},e:function(e,t){return e.toExponential(t)},f:function(e,t){return e.toFixed(t)},r:function(t,r){return(t=e.round(t,St(t,r))).toFixed(Math.max(0,Math.min(20,St(t*(1+1e-15),r))))}});function Dt(e){return e+""}var zt=e.time={},Rt=Date;function Et(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}Et.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(){It.setUTCDate.apply(this._,arguments)},setDay:function(){It.setUTCDay.apply(this._,arguments)},setFullYear:function(){It.setUTCFullYear.apply(this._,arguments)},setHours:function(){It.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){It.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){It.setUTCMinutes.apply(this._,arguments)},setMonth:function(){It.setUTCMonth.apply(this._,arguments)},setSeconds:function(){It.setUTCSeconds.apply(this._,arguments)},setTime:function(){It.setTime.apply(this._,arguments)}};var It=Date.prototype;function Ft(e,t,r){function n(t){var r=e(t),n=i(r,1);return t-r<n-t?r:n}function a(r){return t(r=e(new Rt(r-1)),1),r}function i(e,r){return t(e=new Rt(+e),r),e}function o(e,n,i){var o=a(e),l=[];if(i>1)for(;o<n;)r(o)%i||l.push(new Date(+o)),t(o,1);else for(;o<n;)l.push(new Date(+o)),t(o,1);return l}e.floor=e,e.round=n,e.ceil=a,e.offset=i,e.range=o;var l=e.utc=Nt(e);return l.floor=l,l.round=Nt(n),l.ceil=Nt(a),l.offset=Nt(i),l.range=function(e,t,r){try{Rt=Et;var n=new Et;return n._=e,o(n,t,r)}finally{Rt=Date}},e}function Nt(e){return function(t,r){try{Rt=Et;var n=new Et;return n._=t,e(n,r)._}finally{Rt=Date}}}zt.year=Ft(function(e){return(e=zt.day(e)).setMonth(0,1),e},function(e,t){e.setFullYear(e.getFullYear()+t)},function(e){return e.getFullYear()}),zt.years=zt.year.range,zt.years.utc=zt.year.utc.range,zt.day=Ft(function(e){var t=new Rt(2e3,0);return t.setFullYear(e.getFullYear(),e.getMonth(),e.getDate()),t},function(e,t){e.setDate(e.getDate()+t)},function(e){return e.getDate()-1}),zt.days=zt.day.range,zt.days.utc=zt.day.utc.range,zt.dayOfYear=function(e){var t=zt.year(e);return Math.floor((e-t-6e4*(e.getTimezoneOffset()-t.getTimezoneOffset()))/864e5)},["sunday","monday","tuesday","wednesday","thursday","friday","saturday"].forEach(function(e,t){t=7-t;var r=zt[e]=Ft(function(e){return(e=zt.day(e)).setDate(e.getDate()-(e.getDay()+t)%7),e},function(e,t){e.setDate(e.getDate()+7*Math.floor(t))},function(e){var r=zt.year(e).getDay();return Math.floor((zt.dayOfYear(e)+(r+t)%7)/7)-(r!==t)});zt[e+"s"]=r.range,zt[e+"s"].utc=r.utc.range,zt[e+"OfYear"]=function(e){var r=zt.year(e).getDay();return Math.floor((zt.dayOfYear(e)+(r+t)%7)/7)}}),zt.week=zt.sunday,zt.weeks=zt.sunday.range,zt.weeks.utc=zt.sunday.utc.range,zt.weekOfYear=zt.sundayOfYear;var jt={"-":"",_:" ",0:"0"},Bt=/^\s*\d+/,Ht=/^%/;function qt(e,t,r){var n=e<0?"-":"",a=(n?-e:e)+"",i=a.length;return n+(i<r?new Array(r-i+1).join(t)+a:a)}function Vt(t){return new RegExp("^(?:"+t.map(e.requote).join("|")+")","i")}function Ut(e){for(var t=new b,r=-1,n=e.length;++r<n;)t.set(e[r].toLowerCase(),r);return t}function Gt(e,t,r){Bt.lastIndex=0;var n=Bt.exec(t.slice(r,r+1));return n?(e.w=+n[0],r+n[0].length):-1}function Zt(e,t,r){Bt.lastIndex=0;var n=Bt.exec(t.slice(r));return n?(e.U=+n[0],r+n[0].length):-1}function Yt(e,t,r){Bt.lastIndex=0;var n=Bt.exec(t.slice(r));return n?(e.W=+n[0],r+n[0].length):-1}function Xt(e,t,r){Bt.lastIndex=0;var n=Bt.exec(t.slice(r,r+4));return n?(e.y=+n[0],r+n[0].length):-1}function Wt(e,t,r){Bt.lastIndex=0;var n,a=Bt.exec(t.slice(r,r+2));return a?(e.y=(n=+a[0])+(n>68?1900:2e3),r+a[0].length):-1}function $t(e,t,r){return/^[+-]\d{4}$/.test(t=t.slice(r,r+5))?(e.Z=-t,r+5):-1}function Jt(e,t,r){Bt.lastIndex=0;var n=Bt.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function Qt(e,t,r){Bt.lastIndex=0;var n=Bt.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function Kt(e,t,r){Bt.lastIndex=0;var n=Bt.exec(t.slice(r,r+3));return n?(e.j=+n[0],r+n[0].length):-1}function er(e,t,r){Bt.lastIndex=0;var n=Bt.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function tr(e,t,r){Bt.lastIndex=0;var n=Bt.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function rr(e,t,r){Bt.lastIndex=0;var n=Bt.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function nr(e,t,r){Bt.lastIndex=0;var n=Bt.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function ar(e){var t=e.getTimezoneOffset(),r=t>0?"-":"+",n=y(t)/60|0,a=y(t)%60;return r+qt(n,"0",2)+qt(a,"0",2)}function ir(e,t,r){Ht.lastIndex=0;var n=Ht.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function or(e){for(var t=e.length,r=-1;++r<t;)e[r][0]=this(e[r][0]);return function(t){for(var r=0,n=e[r];!n[1](t);)n=e[++r];return n[0](t)}}e.locale=function(t){return{numberFormat:function(t){var r=t.decimal,n=t.thousands,a=t.grouping,i=t.currency,o=a&&n?function(e,t){for(var r=e.length,i=[],o=0,l=a[0],s=0;r>0&&l>0&&(s+l+1>t&&(l=Math.max(1,t-s)),i.push(e.substring(r-=l,r+l)),!((s+=l+1)>t));)l=a[o=(o+1)%a.length];return i.reverse().join(n)}:P;return function(t){var n=Ot.exec(t),a=n[1]||" ",l=n[2]||">",s=n[3]||"-",c=n[4]||"",u=n[5],f=+n[6],d=n[7],p=n[8],h=n[9],g=1,v="",m="",y=!1,x=!0;switch(p&&(p=+p.substring(1)),(u||"0"===a&&"="===l)&&(u=a="0",l="="),h){case"n":d=!0,h="g";break;case"%":g=100,m="%",h="f";break;case"p":g=100,m="%",h="r";break;case"b":case"o":case"x":case"X":"#"===c&&(v="0"+h.toLowerCase());case"c":x=!1;case"d":y=!0,p=0;break;case"s":g=-1,h="r"}"$"===c&&(v=i[0],m=i[1]),"r"!=h||p||(h="g"),null!=p&&("g"==h?p=Math.max(1,Math.min(21,p)):"e"!=h&&"f"!=h||(p=Math.max(0,Math.min(20,p)))),h=Pt.get(h)||Dt;var b=u&&d;return function(t){var n=m;if(y&&t%1)return"";var i=t<0||0===t&&1/t<0?(t=-t,"-"):"-"===s?"":s;if(g<0){var c=e.formatPrefix(t,p);t=c.scale(t),n=c.symbol+m}else t*=g;var _,w,k=(t=h(t,p)).lastIndexOf(".");if(k<0){var T=x?t.lastIndexOf("e"):-1;T<0?(_=t,w=""):(_=t.substring(0,T),w=t.substring(T))}else _=t.substring(0,k),w=r+t.substring(k+1);!u&&d&&(_=o(_,1/0));var M=v.length+_.length+w.length+(b?0:i.length),A=M<f?new Array(M=f-M+1).join(a):"";return b&&(_=o(A+_,A.length?f-w.length:1/0)),i+=v,t=_+w,("<"===l?i+t+A:">"===l?A+i+t:"^"===l?A.substring(0,M>>=1)+i+t+A.substring(M):i+(b?t:A+t))+n}}}(t),timeFormat:function(t){var r=t.dateTime,n=t.date,a=t.time,i=t.periods,o=t.days,l=t.shortDays,s=t.months,c=t.shortMonths;function u(e){var t=e.length;function r(r){for(var n,a,i,o=[],l=-1,s=0;++l<t;)37===e.charCodeAt(l)&&(o.push(e.slice(s,l)),null!=(a=jt[n=e.charAt(++l)])&&(n=e.charAt(++l)),(i=_[n])&&(n=i(r,null==a?"e"===n?" ":"0":a)),o.push(n),s=l+1);return o.push(e.slice(s,l)),o.join("")}return r.parse=function(t){var r={y:1900,m:0,d:1,H:0,M:0,S:0,L:0,Z:null};if(f(r,e,t,0)!=t.length)return null;"p"in r&&(r.H=r.H%12+12*r.p);var n=null!=r.Z&&Rt!==Et,a=new(n?Et:Rt);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 e},r}function f(e,t,r,n){for(var a,i,o,l=0,s=t.length,c=r.length;l<s;){if(n>=c)return-1;if(37===(a=t.charCodeAt(l++))){if(o=t.charAt(l++),!(i=w[o in jt?t.charAt(l++):o])||(n=i(e,r,n))<0)return-1}else if(a!=r.charCodeAt(n++))return-1}return n}u.utc=function(e){var t=u(e);function r(e){try{var r=new(Rt=Et);return r._=e,t(r)}finally{Rt=Date}}return r.parse=function(e){try{Rt=Et;var r=t.parse(e);return r&&r._}finally{Rt=Date}},r.toString=t.toString,r},u.multi=u.utc.multi=or;var d=e.map(),p=Vt(o),h=Ut(o),g=Vt(l),v=Ut(l),m=Vt(s),y=Ut(s),x=Vt(c),b=Ut(c);i.forEach(function(e,t){d.set(e.toLowerCase(),t)});var _={a:function(e){return l[e.getDay()]},A:function(e){return o[e.getDay()]},b:function(e){return c[e.getMonth()]},B:function(e){return s[e.getMonth()]},c:u(r),d:function(e,t){return qt(e.getDate(),t,2)},e:function(e,t){return qt(e.getDate(),t,2)},H:function(e,t){return qt(e.getHours(),t,2)},I:function(e,t){return qt(e.getHours()%12||12,t,2)},j:function(e,t){return qt(1+zt.dayOfYear(e),t,3)},L:function(e,t){return qt(e.getMilliseconds(),t,3)},m:function(e,t){return qt(e.getMonth()+1,t,2)},M:function(e,t){return qt(e.getMinutes(),t,2)},p:function(e){return i[+(e.getHours()>=12)]},S:function(e,t){return qt(e.getSeconds(),t,2)},U:function(e,t){return qt(zt.sundayOfYear(e),t,2)},w:function(e){return e.getDay()},W:function(e,t){return qt(zt.mondayOfYear(e),t,2)},x:u(n),X:u(a),y:function(e,t){return qt(e.getFullYear()%100,t,2)},Y:function(e,t){return qt(e.getFullYear()%1e4,t,4)},Z:ar,"%":function(){return"%"}},w={a:function(e,t,r){g.lastIndex=0;var n=g.exec(t.slice(r));return n?(e.w=v.get(n[0].toLowerCase()),r+n[0].length):-1},A:function(e,t,r){p.lastIndex=0;var n=p.exec(t.slice(r));return n?(e.w=h.get(n[0].toLowerCase()),r+n[0].length):-1},b:function(e,t,r){x.lastIndex=0;var n=x.exec(t.slice(r));return n?(e.m=b.get(n[0].toLowerCase()),r+n[0].length):-1},B:function(e,t,r){m.lastIndex=0;var n=m.exec(t.slice(r));return n?(e.m=y.get(n[0].toLowerCase()),r+n[0].length):-1},c:function(e,t,r){return f(e,_.c.toString(),t,r)},d:Qt,e:Qt,H:er,I:er,j:Kt,L:nr,m:Jt,M:tr,p:function(e,t,r){var n=d.get(t.slice(r,r+=2).toLowerCase());return null==n?-1:(e.p=n,r)},S:rr,U:Zt,w:Gt,W:Yt,x:function(e,t,r){return f(e,_.x.toString(),t,r)},X:function(e,t,r){return f(e,_.X.toString(),t,r)},y:Wt,Y:Xt,Z:$t,"%":ir};return u}(t)}};var lr=e.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 sr(){}e.format=lr.numberFormat,e.geo={},sr.prototype={s:0,t:0,add:function(e){ur(e,this.t,cr),ur(cr.s,this.s,this),this.s?this.t+=cr.t:this.s=cr.t},reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};var cr=new sr;function ur(e,t,r){var n=r.s=e+t,a=n-e,i=n-a;r.t=e-i+(t-a)}function fr(e,t){e&&pr.hasOwnProperty(e.type)&&pr[e.type](e,t)}e.geo.stream=function(e,t){e&&dr.hasOwnProperty(e.type)?dr[e.type](e,t):fr(e,t)};var dr={Feature:function(e,t){fr(e.geometry,t)},FeatureCollection:function(e,t){for(var r=e.features,n=-1,a=r.length;++n<a;)fr(r[n].geometry,t)}},pr={Sphere:function(e,t){t.sphere()},Point:function(e,t){e=e.coordinates,t.point(e[0],e[1],e[2])},MultiPoint:function(e,t){for(var r=e.coordinates,n=-1,a=r.length;++n<a;)e=r[n],t.point(e[0],e[1],e[2])},LineString:function(e,t){hr(e.coordinates,t,0)},MultiLineString:function(e,t){for(var r=e.coordinates,n=-1,a=r.length;++n<a;)hr(r[n],t,0)},Polygon:function(e,t){gr(e.coordinates,t)},MultiPolygon:function(e,t){for(var r=e.coordinates,n=-1,a=r.length;++n<a;)gr(r[n],t)},GeometryCollection:function(e,t){for(var r=e.geometries,n=-1,a=r.length;++n<a;)fr(r[n],t)}};function hr(e,t,r){var n,a=-1,i=e.length-r;for(t.lineStart();++a<i;)n=e[a],t.point(n[0],n[1],n[2]);t.lineEnd()}function gr(e,t){var r=-1,n=e.length;for(t.polygonStart();++r<n;)hr(e[r],t,1);t.polygonEnd()}e.geo.area=function(t){return vr=0,e.geo.stream(t,Cr),vr};var vr,mr,yr,xr,br,_r,wr,kr,Tr,Mr,Ar,Lr,Sr=new sr,Cr={sphere:function(){vr+=4*Me},point:E,lineStart:E,lineEnd:E,polygonStart:function(){Sr.reset(),Cr.lineStart=Or},polygonEnd:function(){var e=2*Sr;vr+=e<0?4*Me+e:e,Cr.lineStart=Cr.lineEnd=Cr.point=E}};function Or(){var e,t,r,n,a;function i(e,t){t=t*Ce/2+Me/4;var i=(e*=Ce)-r,o=i>=0?1:-1,l=o*i,s=Math.cos(t),c=Math.sin(t),u=a*c,f=n*s+u*Math.cos(l),d=u*o*Math.sin(l);Sr.add(Math.atan2(d,f)),r=e,n=s,a=c}Cr.point=function(o,l){Cr.point=i,r=(e=o)*Ce,n=Math.cos(l=(t=l)*Ce/2+Me/4),a=Math.sin(l)},Cr.lineEnd=function(){i(e,t)}}function Pr(e){var t=e[0],r=e[1],n=Math.cos(r);return[n*Math.cos(t),n*Math.sin(t),Math.sin(r)]}function Dr(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function zr(e,t){return[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]]}function Rr(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function Er(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function Ir(e){var t=Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}function Fr(e){return[Math.atan2(e[1],e[0]),Re(e[2])]}function Nr(e,t){return y(e[0]-t[0])<ke&&y(e[1]-t[1])<ke}e.geo.bounds=function(){var t,r,n,a,i,o,l,s,c,u,f,d={point:p,lineStart:g,lineEnd:v,polygonStart:function(){d.point=m,d.lineStart=x,d.lineEnd=b,c=0,Cr.polygonStart()},polygonEnd:function(){Cr.polygonEnd(),d.point=p,d.lineStart=g,d.lineEnd=v,Sr<0?(t=-(n=180),r=-(a=90)):c>ke?a=90:c<-ke&&(r=-90),f[0]=t,f[1]=n}};function p(e,i){u.push(f=[t=e,n=e]),i<r&&(r=i),i>a&&(a=i)}function h(e,o){var l=Pr([e*Ce,o*Ce]);if(s){var c=zr(s,l),u=zr([c[1],-c[0],0],c);Ir(u),u=Fr(u);var f=e-i,d=f>0?1:-1,h=u[0]*Oe*d,g=y(f)>180;if(g^(d*i<h&&h<d*e))(v=u[1]*Oe)>a&&(a=v);else if(g^(d*i<(h=(h+360)%360-180)&&h<d*e)){var v;(v=-u[1]*Oe)<r&&(r=v)}else o<r&&(r=o),o>a&&(a=o);g?e<i?_(t,e)>_(t,n)&&(n=e):_(e,n)>_(t,n)&&(t=e):n>=t?(e<t&&(t=e),e>n&&(n=e)):e>i?_(t,e)>_(t,n)&&(n=e):_(e,n)>_(t,n)&&(t=e)}else p(e,o);s=l,i=e}function g(){d.point=h}function v(){f[0]=t,f[1]=n,d.point=p,s=null}function m(e,t){if(s){var r=e-i;c+=y(r)>180?r+(r>0?360:-360):r}else o=e,l=t;Cr.point(e,t),h(e,t)}function x(){Cr.lineStart()}function b(){m(o,l),Cr.lineEnd(),y(c)>ke&&(t=-(n=180)),f[0]=t,f[1]=n,s=null}function _(e,t){return(t-=e)<0?t+360:t}function w(e,t){return e[0]-t[0]}function k(e,t){return t[0]<=t[1]?t[0]<=e&&e<=t[1]:e<t[0]||t[1]<e}return function(i){if(a=n=-(t=r=1/0),u=[],e.geo.stream(i,d),c=u.length){u.sort(w);for(var o=1,l=[g=u[0]];o<c;++o)k((p=u[o])[0],g)||k(p[1],g)?(_(g[0],p[1])>_(g[0],g[1])&&(g[1]=p[1]),_(p[0],g[1])>_(g[0],g[1])&&(g[0]=p[0])):l.push(g=p);for(var s,c,p,h=-1/0,g=(o=0,l[c=l.length-1]);o<=c;g=p,++o)p=l[o],(s=_(g[1],p[0]))>h&&(h=s,t=p[0],n=g[1])}return u=f=null,t===1/0||r===1/0?[[NaN,NaN],[NaN,NaN]]:[[t,r],[n,a]]}}(),e.geo.centroid=function(t){mr=yr=xr=br=_r=wr=kr=Tr=Mr=Ar=Lr=0,e.geo.stream(t,jr);var r=Mr,n=Ar,a=Lr,i=r*r+n*n+a*a;return i<Te&&(r=wr,n=kr,a=Tr,yr<ke&&(r=xr,n=br,a=_r),(i=r*r+n*n+a*a)<Te)?[NaN,NaN]:[Math.atan2(n,r)*Oe,Re(a/Math.sqrt(i))*Oe]};var jr={sphere:E,point:Br,lineStart:qr,lineEnd:Vr,polygonStart:function(){jr.lineStart=Ur},polygonEnd:function(){jr.lineStart=qr}};function Br(e,t){e*=Ce;var r=Math.cos(t*=Ce);Hr(r*Math.cos(e),r*Math.sin(e),Math.sin(t))}function Hr(e,t,r){xr+=(e-xr)/++mr,br+=(t-br)/mr,_r+=(r-_r)/mr}function qr(){var e,t,r;function n(n,a){n*=Ce;var i=Math.cos(a*=Ce),o=i*Math.cos(n),l=i*Math.sin(n),s=Math.sin(a),c=Math.atan2(Math.sqrt((c=t*s-r*l)*c+(c=r*o-e*s)*c+(c=e*l-t*o)*c),e*o+t*l+r*s);yr+=c,wr+=c*(e+(e=o)),kr+=c*(t+(t=l)),Tr+=c*(r+(r=s)),Hr(e,t,r)}jr.point=function(a,i){a*=Ce;var o=Math.cos(i*=Ce);e=o*Math.cos(a),t=o*Math.sin(a),r=Math.sin(i),jr.point=n,Hr(e,t,r)}}function Vr(){jr.point=Br}function Ur(){var e,t,r,n,a;function i(e,t){e*=Ce;var i=Math.cos(t*=Ce),o=i*Math.cos(e),l=i*Math.sin(e),s=Math.sin(t),c=n*s-a*l,u=a*o-r*s,f=r*l-n*o,d=Math.sqrt(c*c+u*u+f*f),p=r*o+n*l+a*s,h=d&&-ze(p)/d,g=Math.atan2(d,p);Mr+=h*c,Ar+=h*u,Lr+=h*f,yr+=g,wr+=g*(r+(r=o)),kr+=g*(n+(n=l)),Tr+=g*(a+(a=s)),Hr(r,n,a)}jr.point=function(o,l){e=o,t=l,jr.point=i,o*=Ce;var s=Math.cos(l*=Ce);r=s*Math.cos(o),n=s*Math.sin(o),a=Math.sin(l),Hr(r,n,a)},jr.lineEnd=function(){i(e,t),jr.lineEnd=Vr,jr.point=Br}}function Gr(e,t){function r(r,n){return r=e(r,n),t(r[0],r[1])}return e.invert&&t.invert&&(r.invert=function(r,n){return(r=t.invert(r,n))&&e.invert(r[0],r[1])}),r}function Zr(){return!0}function Yr(e,t,r,n,a){var i=[],o=[];if(e.forEach(function(e){if(!((t=e.length-1)<=0)){var t,r=e[0],n=e[t];if(Nr(r,n)){a.lineStart();for(var l=0;l<t;++l)a.point((r=e[l])[0],r[1]);a.lineEnd()}else{var s=new Wr(r,e,null,!0),c=new Wr(r,null,s,!1);s.o=c,i.push(s),o.push(c),c=new Wr(n,null,s=new Wr(n,e,null,!1),!0),s.o=c,i.push(s),o.push(c)}}}),o.sort(t),Xr(i),Xr(o),i.length){for(var l=0,s=r,c=o.length;l<c;++l)o[l].e=s=!s;for(var u,f,d=i[0];;){for(var p=d,h=!0;p.v;)if((p=p.n)===d)return;u=p.z,a.lineStart();do{if(p.v=p.o.v=!0,p.e){if(h)for(l=0,c=u.length;l<c;++l)a.point((f=u[l])[0],f[1]);else n(p.x,p.n.x,1,a);p=p.n}else{if(h)for(l=(u=p.p.z).length-1;l>=0;--l)a.point((f=u[l])[0],f[1]);else n(p.x,p.p.x,-1,a);p=p.p}u=(p=p.o).z,h=!h}while(!p.v);a.lineEnd()}}}function Xr(e){if(t=e.length){for(var t,r,n=0,a=e[0];++n<t;)a.n=r=e[n],r.p=a,a=r;a.n=r=e[0],r.p=a}}function Wr(e,t,r,n){this.x=e,this.z=t,this.o=r,this.e=n,this.v=!1,this.n=this.p=null}function $r(t,r,n,a){return function(i,o){var l,s=r(o),c=i.invert(a[0],a[1]),u={point:f,lineStart:p,lineEnd:h,polygonStart:function(){u.point=b,u.lineStart=_,u.lineEnd=w,l=[],g=[]},polygonEnd:function(){u.point=f,u.lineStart=p,u.lineEnd=h,l=e.merge(l);var t=function(e,t){var r=e[0],n=e[1],a=[Math.sin(r),-Math.cos(r),0],i=0,o=0;Sr.reset();for(var l=0,s=t.length;l<s;++l){var c=t[l],u=c.length;if(u)for(var f=c[0],d=f[0],p=f[1]/2+Me/4,h=Math.sin(p),g=Math.cos(p),v=1;;){v===u&&(v=0);var m=(e=c[v])[0],y=e[1]/2+Me/4,x=Math.sin(y),b=Math.cos(y),_=m-d,w=_>=0?1:-1,k=w*_,T=k>Me,M=h*x;if(Sr.add(Math.atan2(M*w*Math.sin(k),g*b+M*Math.cos(k))),i+=T?_+w*Ae:_,T^d>=r^m>=r){var A=zr(Pr(f),Pr(e));Ir(A);var L=zr(a,A);Ir(L);var S=(T^_>=0?-1:1)*Re(L[2]);(n>S||n===S&&(A[0]||A[1]))&&(o+=T^_>=0?1:-1)}if(!v++)break;d=m,h=x,g=b,f=e}}return(i<-ke||i<ke&&Sr<-ke)^1&o}(c,g);l.length?(x||(o.polygonStart(),x=!0),Yr(l,Kr,t,n,o)):t&&(x||(o.polygonStart(),x=!0),o.lineStart(),n(null,null,1,o),o.lineEnd()),x&&(o.polygonEnd(),x=!1),l=g=null},sphere:function(){o.polygonStart(),o.lineStart(),n(null,null,1,o),o.lineEnd(),o.polygonEnd()}};function f(e,r){var n=i(e,r);t(e=n[0],r=n[1])&&o.point(e,r)}function d(e,t){var r=i(e,t);s.point(r[0],r[1])}function p(){u.point=d,s.lineStart()}function h(){u.point=f,s.lineEnd()}var g,v,m=Qr(),y=r(m),x=!1;function b(e,t){v.push([e,t]);var r=i(e,t);y.point(r[0],r[1])}function _(){y.lineStart(),v=[]}function w(){b(v[0][0],v[0][1]),y.lineEnd();var e,t=y.clean(),r=m.buffer(),n=r.length;if(v.pop(),g.push(v),v=null,n)if(1&t){var a,i=-1;if((n=(e=r[0]).length-1)>0){for(x||(o.polygonStart(),x=!0),o.lineStart();++i<n;)o.point((a=e[i])[0],a[1]);o.lineEnd()}}else n>1&&2&t&&r.push(r.pop().concat(r.shift())),l.push(r.filter(Jr))}return u}}function Jr(e){return e.length>1}function Qr(){var e,t=[];return{lineStart:function(){t.push(e=[])},point:function(t,r){e.push([t,r])},lineEnd:E,buffer:function(){var r=t;return t=[],e=null,r},rejoin:function(){t.length>1&&t.push(t.pop().concat(t.shift()))}}}function Kr(e,t){return((e=e.x)[0]<0?e[1]-Se-ke:Se-e[1])-((t=t.x)[0]<0?t[1]-Se-ke:Se-t[1])}var en=$r(Zr,function(e){var t,r=NaN,n=NaN,a=NaN;return{lineStart:function(){e.lineStart(),t=1},point:function(i,o){var l=i>0?Me:-Me,s=y(i-r);y(s-Me)<ke?(e.point(r,n=(n+o)/2>0?Se:-Se),e.point(a,n),e.lineEnd(),e.lineStart(),e.point(l,n),e.point(i,n),t=0):a!==l&&s>=Me&&(y(r-a)<ke&&(r-=a*ke),y(i-l)<ke&&(i-=l*ke),n=function(e,t,r,n){var a,i,o=Math.sin(e-r);return y(o)>ke?Math.atan((Math.sin(t)*(i=Math.cos(n))*Math.sin(r)-Math.sin(n)*(a=Math.cos(t))*Math.sin(e))/(a*i*o)):(t+n)/2}(r,n,i,o),e.point(a,n),e.lineEnd(),e.lineStart(),e.point(l,n),t=0),e.point(r=i,n=o),a=l},lineEnd:function(){e.lineEnd(),r=n=NaN},clean:function(){return 2-t}}},function(e,t,r,n){var a;if(null==e)a=r*Se,n.point(-Me,a),n.point(0,a),n.point(Me,a),n.point(Me,0),n.point(Me,-a),n.point(0,-a),n.point(-Me,-a),n.point(-Me,0),n.point(-Me,a);else if(y(e[0]-t[0])>ke){var i=e[0]<t[0]?Me:-Me;a=r*i/2,n.point(-i,a),n.point(0,a),n.point(i,a)}else n.point(t[0],t[1])},[-Me,-Me/2]);function tn(e,t,r,n){return function(a){var i,o=a.a,l=a.b,s=o.x,c=o.y,u=0,f=1,d=l.x-s,p=l.y-c;if(i=e-s,d||!(i>0)){if(i/=d,d<0){if(i<u)return;i<f&&(f=i)}else if(d>0){if(i>f)return;i>u&&(u=i)}if(i=r-s,d||!(i<0)){if(i/=d,d<0){if(i>f)return;i>u&&(u=i)}else if(d>0){if(i<u)return;i<f&&(f=i)}if(i=t-c,p||!(i>0)){if(i/=p,p<0){if(i<u)return;i<f&&(f=i)}else if(p>0){if(i>f)return;i>u&&(u=i)}if(i=n-c,p||!(i<0)){if(i/=p,p<0){if(i>f)return;i>u&&(u=i)}else if(p>0){if(i<u)return;i<f&&(f=i)}return u>0&&(a.a={x:s+u*d,y:c+u*p}),f<1&&(a.b={x:s+f*d,y:c+f*p}),a}}}}}}var rn=1e9;function nn(t,r,n,a){return function(s){var c,u,f,d,p,h,g,v,m,y,x,b=s,_=Qr(),w=tn(t,r,n,a),k={point:A,lineStart:function(){k.point=L,u&&u.push(f=[]);y=!0,m=!1,g=v=NaN},lineEnd:function(){c&&(L(d,p),h&&m&&_.rejoin(),c.push(_.buffer()));k.point=A,m&&s.lineEnd()},polygonStart:function(){s=_,c=[],u=[],x=!0},polygonEnd:function(){s=b,c=e.merge(c);var r=function(e){for(var t=0,r=u.length,n=e[1],a=0;a<r;++a)for(var i,o=1,l=u[a],s=l.length,c=l[0];o<s;++o)i=l[o],c[1]<=n?i[1]>n&&De(c,i,e)>0&&++t:i[1]<=n&&De(c,i,e)<0&&--t,c=i;return 0!==t}([t,a]),n=x&&r,i=c.length;(n||i)&&(s.polygonStart(),n&&(s.lineStart(),T(null,null,1,s),s.lineEnd()),i&&Yr(c,o,r,T,s),s.polygonEnd()),c=u=f=null}};function T(e,o,s,c){var u=0,f=0;if(null==e||(u=i(e,s))!==(f=i(o,s))||l(e,o)<0^s>0)do{c.point(0===u||3===u?t:n,u>1?a:r)}while((u=(u+s+4)%4)!==f);else c.point(o[0],o[1])}function M(e,i){return t<=e&&e<=n&&r<=i&&i<=a}function A(e,t){M(e,t)&&s.point(e,t)}function L(e,t){var r=M(e=Math.max(-rn,Math.min(rn,e)),t=Math.max(-rn,Math.min(rn,t)));if(u&&f.push([e,t]),y)d=e,p=t,h=r,y=!1,r&&(s.lineStart(),s.point(e,t));else if(r&&m)s.point(e,t);else{var n={a:{x:g,y:v},b:{x:e,y:t}};w(n)?(m||(s.lineStart(),s.point(n.a.x,n.a.y)),s.point(n.b.x,n.b.y),r||s.lineEnd(),x=!1):r&&(s.lineStart(),s.point(e,t),x=!1)}g=e,v=t,m=r}return k};function i(e,a){return y(e[0]-t)<ke?a>0?0:3:y(e[0]-n)<ke?a>0?2:1:y(e[1]-r)<ke?a>0?1:0:a>0?3:2}function o(e,t){return l(e.x,t.x)}function l(e,t){var r=i(e,1),n=i(t,1);return r!==n?r-n:0===r?t[1]-e[1]:1===r?e[0]-t[0]:2===r?e[1]-t[1]:t[0]-e[0]}}function an(e){var t=0,r=Me/3,n=Ln(e),a=n(t,r);return a.parallels=function(e){return arguments.length?n(t=e[0]*Me/180,r=e[1]*Me/180):[t/Me*180,r/Me*180]},a}function on(e,t){var r=Math.sin(e),n=(r+Math.sin(t))/2,a=1+r*(2*n-r),i=Math.sqrt(a)/n;function o(e,t){var r=Math.sqrt(a-2*n*Math.sin(t))/n;return[r*Math.sin(e*=n),i-r*Math.cos(e)]}return o.invert=function(e,t){var r=i-t;return[Math.atan2(e,r)/n,Re((a-(e*e+r*r)*n*n)/(2*n))]},o}e.geo.clipExtent=function(){var e,t,r,n,a,i,o={stream:function(e){return a&&(a.valid=!1),(a=i(e)).valid=!0,a},extent:function(l){return arguments.length?(i=nn(e=+l[0][0],t=+l[0][1],r=+l[1][0],n=+l[1][1]),a&&(a.valid=!1,a=null),o):[[e,t],[r,n]]}};return o.extent([[0,0],[960,500]])},(e.geo.conicEqualArea=function(){return an(on)}).raw=on,e.geo.albers=function(){return e.geo.conicEqualArea().rotate([96,0]).center([-.6,38.7]).parallels([29.5,45.5]).scale(1070)},e.geo.albersUsa=function(){var t,r,n,a,i=e.geo.albers(),o=e.geo.conicEqualArea().rotate([154,0]).center([-2,58.5]).parallels([55,65]),l=e.geo.conicEqualArea().rotate([157,0]).center([-3,19.9]).parallels([8,18]),s={point:function(e,r){t=[e,r]}};function c(e){var i=e[0],o=e[1];return t=null,r(i,o),t||(n(i,o),t)||a(i,o),t}return c.invert=function(e){var t=i.scale(),r=i.translate(),n=(e[0]-r[0])/t,a=(e[1]-r[1])/t;return(a>=.12&&a<.234&&n>=-.425&&n<-.214?o:a>=.166&&a<.234&&n>=-.214&&n<-.115?l:i).invert(e)},c.stream=function(e){var t=i.stream(e),r=o.stream(e),n=l.stream(e);return{point:function(e,a){t.point(e,a),r.point(e,a),n.point(e,a)},sphere:function(){t.sphere(),r.sphere(),n.sphere()},lineStart:function(){t.lineStart(),r.lineStart(),n.lineStart()},lineEnd:function(){t.lineEnd(),r.lineEnd(),n.lineEnd()},polygonStart:function(){t.polygonStart(),r.polygonStart(),n.polygonStart()},polygonEnd:function(){t.polygonEnd(),r.polygonEnd(),n.polygonEnd()}}},c.precision=function(e){return arguments.length?(i.precision(e),o.precision(e),l.precision(e),c):i.precision()},c.scale=function(e){return arguments.length?(i.scale(e),o.scale(.35*e),l.scale(e),c.translate(i.translate())):i.scale()},c.translate=function(e){if(!arguments.length)return i.translate();var t=i.scale(),u=+e[0],f=+e[1];return r=i.translate(e).clipExtent([[u-.455*t,f-.238*t],[u+.455*t,f+.238*t]]).stream(s).point,n=o.translate([u-.307*t,f+.201*t]).clipExtent([[u-.425*t+ke,f+.12*t+ke],[u-.214*t-ke,f+.234*t-ke]]).stream(s).point,a=l.translate([u-.205*t,f+.212*t]).clipExtent([[u-.214*t+ke,f+.166*t+ke],[u-.115*t-ke,f+.234*t-ke]]).stream(s).point,c},c.scale(1070)};var ln,sn,cn,un,fn,dn,pn={point:E,lineStart:E,lineEnd:E,polygonStart:function(){sn=0,pn.lineStart=hn},polygonEnd:function(){pn.lineStart=pn.lineEnd=pn.point=E,ln+=y(sn/2)}};function hn(){var e,t,r,n;function a(e,t){sn+=n*e-r*t,r=e,n=t}pn.point=function(i,o){pn.point=a,e=r=i,t=n=o},pn.lineEnd=function(){a(e,t)}}var gn={point:function(e,t){e<cn&&(cn=e);e>fn&&(fn=e);t<un&&(un=t);t>dn&&(dn=t)},lineStart:E,lineEnd:E,polygonStart:E,polygonEnd:E};function vn(e){return"m0,"+e+"a"+e+","+e+" 0 1,1 0,"+-2*e+"a"+e+","+e+" 0 1,1 0,"+2*e+"z"}var mn,yn={point:xn,lineStart:bn,lineEnd:_n,polygonStart:function(){yn.lineStart=wn},polygonEnd:function(){yn.point=xn,yn.lineStart=bn,yn.lineEnd=_n}};function xn(e,t){xr+=e,br+=t,++_r}function bn(){var e,t;function r(r,n){var a=r-e,i=n-t,o=Math.sqrt(a*a+i*i);wr+=o*(e+r)/2,kr+=o*(t+n)/2,Tr+=o,xn(e=r,t=n)}yn.point=function(n,a){yn.point=r,xn(e=n,t=a)}}function _n(){yn.point=xn}function wn(){var e,t,r,n;function a(e,t){var a=e-r,i=t-n,o=Math.sqrt(a*a+i*i);wr+=o*(r+e)/2,kr+=o*(n+t)/2,Tr+=o,Mr+=(o=n*e-r*t)*(r+e),Ar+=o*(n+t),Lr+=3*o,xn(r=e,n=t)}yn.point=function(i,o){yn.point=a,xn(e=r=i,t=n=o)},yn.lineEnd=function(){a(e,t)}}function kn(e){var t=.5,r=Math.cos(30*Ce),n=16;function a(t){return(n?function(t){var r,a,o,l,s,c,u,f,d,p,h,g,v={point:m,lineStart:y,lineEnd:b,polygonStart:function(){t.polygonStart(),v.lineStart=_},polygonEnd:function(){t.polygonEnd(),v.lineStart=y}};function m(r,n){r=e(r,n),t.point(r[0],r[1])}function y(){f=NaN,v.point=x,t.lineStart()}function x(r,a){var o=Pr([r,a]),l=e(r,a);i(f,d,u,p,h,g,f=l[0],d=l[1],u=r,p=o[0],h=o[1],g=o[2],n,t),t.point(f,d)}function b(){v.point=m,t.lineEnd()}function _(){y(),v.point=w,v.lineEnd=k}function w(e,t){x(r=e,t),a=f,o=d,l=p,s=h,c=g,v.point=x}function k(){i(f,d,u,p,h,g,a,o,r,l,s,c,n,t),v.lineEnd=b,b()}return v}:function(t){return Mn(t,function(r,n){r=e(r,n),t.point(r[0],r[1])})})(t)}function i(n,a,o,l,s,c,u,f,d,p,h,g,v,m){var x=u-n,b=f-a,_=x*x+b*b;if(_>4*t&&v--){var w=l+p,k=s+h,T=c+g,M=Math.sqrt(w*w+k*k+T*T),A=Math.asin(T/=M),L=y(y(T)-1)<ke||y(o-d)<ke?(o+d)/2:Math.atan2(k,w),S=e(L,A),C=S[0],O=S[1],P=C-n,D=O-a,z=b*P-x*D;(z*z/_>t||y((x*P+b*D)/_-.5)>.3||l*p+s*h+c*g<r)&&(i(n,a,o,l,s,c,C,O,L,w/=M,k/=M,T,v,m),m.point(C,O),i(C,O,L,w,k,T,u,f,d,p,h,g,v,m))}}return a.precision=function(e){return arguments.length?(n=(t=e*e)>0&&16,a):Math.sqrt(t)},a}function Tn(e){this.stream=e}function Mn(e,t){return{point:t,sphere:function(){e.sphere()},lineStart:function(){e.lineStart()},lineEnd:function(){e.lineEnd()},polygonStart:function(){e.polygonStart()},polygonEnd:function(){e.polygonEnd()}}}function An(e){return Ln(function(){return e})()}function Ln(t){var r,n,a,i,o,l,s=kn(function(e,t){return[(e=r(e,t))[0]*c+i,o-e[1]*c]}),c=150,u=480,f=250,d=0,p=0,h=0,g=0,v=0,m=en,x=P,b=null,_=null;function w(e){return[(e=a(e[0]*Ce,e[1]*Ce))[0]*c+i,o-e[1]*c]}function k(e){return(e=a.invert((e[0]-i)/c,(o-e[1])/c))&&[e[0]*Oe,e[1]*Oe]}function T(){a=Gr(n=Pn(h,g,v),r);var e=r(d,p);return i=u-e[0]*c,o=f+e[1]*c,M()}function M(){return l&&(l.valid=!1,l=null),w}return w.stream=function(e){return l&&(l.valid=!1),(l=Sn(m(n,s(x(e))))).valid=!0,l},w.clipAngle=function(e){return arguments.length?(m=null==e?(b=e,en):function(e){var t=Math.cos(e),r=t>0,n=y(t)>ke;return $r(a,function(e){var t,l,s,c,u;return{lineStart:function(){c=s=!1,u=1},point:function(f,d){var p,h=[f,d],g=a(f,d),v=r?g?0:o(f,d):g?o(f+(f<0?Me:-Me),d):0;if(!t&&(c=s=g)&&e.lineStart(),g!==s&&(p=i(t,h),(Nr(t,p)||Nr(h,p))&&(h[0]+=ke,h[1]+=ke,g=a(h[0],h[1]))),g!==s)u=0,g?(e.lineStart(),p=i(h,t),e.point(p[0],p[1])):(p=i(t,h),e.point(p[0],p[1]),e.lineEnd()),t=p;else if(n&&t&&r^g){var m;v&l||!(m=i(h,t,!0))||(u=0,r?(e.lineStart(),e.point(m[0][0],m[0][1]),e.point(m[1][0],m[1][1]),e.lineEnd()):(e.point(m[1][0],m[1][1]),e.lineEnd(),e.lineStart(),e.point(m[0][0],m[0][1])))}!g||t&&Nr(t,h)||e.point(h[0],h[1]),t=h,s=g,l=v},lineEnd:function(){s&&e.lineEnd(),t=null},clean:function(){return u|(c&&s)<<1}}},En(e,6*Ce),r?[0,-e]:[-Me,e-Me]);function a(e,r){return Math.cos(e)*Math.cos(r)>t}function i(e,r,n){var a=[1,0,0],i=zr(Pr(e),Pr(r)),o=Dr(i,i),l=i[0],s=o-l*l;if(!s)return!n&&e;var c=t*o/s,u=-t*l/s,f=zr(a,i),d=Er(a,c);Rr(d,Er(i,u));var p=f,h=Dr(d,p),g=Dr(p,p),v=h*h-g*(Dr(d,d)-1);if(!(v<0)){var m=Math.sqrt(v),x=Er(p,(-h-m)/g);if(Rr(x,d),x=Fr(x),!n)return x;var b,_=e[0],w=r[0],k=e[1],T=r[1];w<_&&(b=_,_=w,w=b);var M=w-_,A=y(M-Me)<ke;if(!A&&T<k&&(b=k,k=T,T=b),A||M<ke?A?k+T>0^x[1]<(y(x[0]-_)<ke?k:T):k<=x[1]&&x[1]<=T:M>Me^(_<=x[0]&&x[0]<=w)){var L=Er(p,(-h+m)/g);return Rr(L,d),[x,Fr(L)]}}}function o(t,n){var a=r?e:Me-e,i=0;return t<-a?i|=1:t>a&&(i|=2),n<-a?i|=4:n>a&&(i|=8),i}}((b=+e)*Ce),M()):b},w.clipExtent=function(e){return arguments.length?(_=e,x=e?nn(e[0][0],e[0][1],e[1][0],e[1][1]):P,M()):_},w.scale=function(e){return arguments.length?(c=+e,T()):c},w.translate=function(e){return arguments.length?(u=+e[0],f=+e[1],T()):[u,f]},w.center=function(e){return arguments.length?(d=e[0]%360*Ce,p=e[1]%360*Ce,T()):[d*Oe,p*Oe]},w.rotate=function(e){return arguments.length?(h=e[0]%360*Ce,g=e[1]%360*Ce,v=e.length>2?e[2]%360*Ce:0,T()):[h*Oe,g*Oe,v*Oe]},e.rebind(w,s,"precision"),function(){return r=t.apply(this,arguments),w.invert=r.invert&&k,T()}}function Sn(e){return Mn(e,function(t,r){e.point(t*Ce,r*Ce)})}function Cn(e,t){return[e,t]}function On(e,t){return[e>Me?e-Ae:e<-Me?e+Ae:e,t]}function Pn(e,t,r){return e?t||r?Gr(zn(e),Rn(t,r)):zn(e):t||r?Rn(t,r):On}function Dn(e){return function(t,r){return[(t+=e)>Me?t-Ae:t<-Me?t+Ae:t,r]}}function zn(e){var t=Dn(e);return t.invert=Dn(-e),t}function Rn(e,t){var r=Math.cos(e),n=Math.sin(e),a=Math.cos(t),i=Math.sin(t);function o(e,t){var o=Math.cos(t),l=Math.cos(e)*o,s=Math.sin(e)*o,c=Math.sin(t),u=c*r+l*n;return[Math.atan2(s*a-u*i,l*r-c*n),Re(u*a+s*i)]}return o.invert=function(e,t){var o=Math.cos(t),l=Math.cos(e)*o,s=Math.sin(e)*o,c=Math.sin(t),u=c*a-s*i;return[Math.atan2(s*a+c*i,l*r+u*n),Re(u*r-l*n)]},o}function En(e,t){var r=Math.cos(e),n=Math.sin(e);return function(a,i,o,l){var s=o*t;null!=a?(a=In(r,a),i=In(r,i),(o>0?a<i:a>i)&&(a+=o*Ae)):(a=e+o*Ae,i=e-.5*s);for(var c,u=a;o>0?u>i:u<i;u-=s)l.point((c=Fr([r,-n*Math.cos(u),-n*Math.sin(u)]))[0],c[1])}}function In(e,t){var r=Pr(t);r[0]-=e,Ir(r);var n=ze(-r[1]);return((-r[2]<0?-n:n)+2*Math.PI-ke)%(2*Math.PI)}function Fn(t,r,n){var a=e.range(t,r-ke,n).concat(r);return function(e){return a.map(function(t){return[e,t]})}}function Nn(t,r,n){var a=e.range(t,r-ke,n).concat(r);return function(e){return a.map(function(t){return[t,e]})}}function jn(e){return e.source}function Bn(e){return e.target}e.geo.path=function(){var t,r,n,a,i,o=4.5;function l(t){return t&&("function"==typeof o&&a.pointRadius(+o.apply(this,arguments)),i&&i.valid||(i=n(a)),e.geo.stream(t,i)),a.result()}function s(){return i=null,l}return l.area=function(t){return ln=0,e.geo.stream(t,n(pn)),ln},l.centroid=function(t){return xr=br=_r=wr=kr=Tr=Mr=Ar=Lr=0,e.geo.stream(t,n(yn)),Lr?[Mr/Lr,Ar/Lr]:Tr?[wr/Tr,kr/Tr]:_r?[xr/_r,br/_r]:[NaN,NaN]},l.bounds=function(t){return fn=dn=-(cn=un=1/0),e.geo.stream(t,n(gn)),[[cn,un],[fn,dn]]},l.projection=function(e){return arguments.length?(n=(t=e)?e.stream||(r=e,a=kn(function(e,t){return r([e*Oe,t*Oe])}),function(e){return Sn(a(e))}):P,s()):t;var r,a},l.context=function(e){return arguments.length?(a=null==(r=e)?new function(){var e=vn(4.5),t=[],r={point:n,lineStart:function(){r.point=a},lineEnd:o,polygonStart:function(){r.lineEnd=l},polygonEnd:function(){r.lineEnd=o,r.point=n},pointRadius:function(t){return e=vn(t),r},result:function(){if(t.length){var e=t.join("");return t=[],e}}};function n(r,n){t.push("M",r,",",n,e)}function a(e,n){t.push("M",e,",",n),r.point=i}function i(e,r){t.push("L",e,",",r)}function o(){r.point=n}function l(){t.push("Z")}return r}:new function(e){var t=4.5,r={point:n,lineStart:function(){r.point=a},lineEnd:o,polygonStart:function(){r.lineEnd=l},polygonEnd:function(){r.lineEnd=o,r.point=n},pointRadius:function(e){return t=e,r},result:E};function n(r,n){e.moveTo(r+t,n),e.arc(r,n,t,0,Ae)}function a(t,n){e.moveTo(t,n),r.point=i}function i(t,r){e.lineTo(t,r)}function o(){r.point=n}function l(){e.closePath()}return r}(e),"function"!=typeof o&&a.pointRadius(o),s()):r},l.pointRadius=function(e){return arguments.length?(o="function"==typeof e?e:(a.pointRadius(+e),+e),l):o},l.projection(e.geo.albersUsa()).context(null)},e.geo.transform=function(e){return{stream:function(t){var r=new Tn(t);for(var n in e)r[n]=e[n];return r}}},Tn.prototype={point:function(e,t){this.stream.point(e,t)},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()}},e.geo.projection=An,e.geo.projectionMutator=Ln,(e.geo.equirectangular=function(){return An(Cn)}).raw=Cn.invert=Cn,e.geo.rotation=function(e){function t(t){return(t=e(t[0]*Ce,t[1]*Ce))[0]*=Oe,t[1]*=Oe,t}return e=Pn(e[0]%360*Ce,e[1]*Ce,e.length>2?e[2]*Ce:0),t.invert=function(t){return(t=e.invert(t[0]*Ce,t[1]*Ce))[0]*=Oe,t[1]*=Oe,t},t},On.invert=Cn,e.geo.circle=function(){var e,t,r=[0,0],n=6;function a(){var e="function"==typeof r?r.apply(this,arguments):r,n=Pn(-e[0]*Ce,-e[1]*Ce,0).invert,a=[];return t(null,null,1,{point:function(e,t){a.push(e=n(e,t)),e[0]*=Oe,e[1]*=Oe}}),{type:"Polygon",coordinates:[a]}}return a.origin=function(e){return arguments.length?(r=e,a):r},a.angle=function(r){return arguments.length?(t=En((e=+r)*Ce,n*Ce),a):e},a.precision=function(r){return arguments.length?(t=En(e*Ce,(n=+r)*Ce),a):n},a.angle(90)},e.geo.distance=function(e,t){var r,n=(t[0]-e[0])*Ce,a=e[1]*Ce,i=t[1]*Ce,o=Math.sin(n),l=Math.cos(n),s=Math.sin(a),c=Math.cos(a),u=Math.sin(i),f=Math.cos(i);return Math.atan2(Math.sqrt((r=f*o)*r+(r=c*u-s*f*l)*r),s*u+c*f*l)},e.geo.graticule=function(){var t,r,n,a,i,o,l,s,c,u,f,d,p=10,h=p,g=90,v=360,m=2.5;function x(){return{type:"MultiLineString",coordinates:b()}}function b(){return e.range(Math.ceil(a/g)*g,n,g).map(f).concat(e.range(Math.ceil(s/v)*v,l,v).map(d)).concat(e.range(Math.ceil(r/p)*p,t,p).filter(function(e){return y(e%g)>ke}).map(c)).concat(e.range(Math.ceil(o/h)*h,i,h).filter(function(e){return y(e%v)>ke}).map(u))}return x.lines=function(){return b().map(function(e){return{type:"LineString",coordinates:e}})},x.outline=function(){return{type:"Polygon",coordinates:[f(a).concat(d(l).slice(1),f(n).reverse().slice(1),d(s).reverse().slice(1))]}},x.extent=function(e){return arguments.length?x.majorExtent(e).minorExtent(e):x.minorExtent()},x.majorExtent=function(e){return arguments.length?(a=+e[0][0],n=+e[1][0],s=+e[0][1],l=+e[1][1],a>n&&(e=a,a=n,n=e),s>l&&(e=s,s=l,l=e),x.precision(m)):[[a,s],[n,l]]},x.minorExtent=function(e){return arguments.length?(r=+e[0][0],t=+e[1][0],o=+e[0][1],i=+e[1][1],r>t&&(e=r,r=t,t=e),o>i&&(e=o,o=i,i=e),x.precision(m)):[[r,o],[t,i]]},x.step=function(e){return arguments.length?x.majorStep(e).minorStep(e):x.minorStep()},x.majorStep=function(e){return arguments.length?(g=+e[0],v=+e[1],x):[g,v]},x.minorStep=function(e){return arguments.length?(p=+e[0],h=+e[1],x):[p,h]},x.precision=function(e){return arguments.length?(m=+e,c=Fn(o,i,90),u=Nn(r,t,m),f=Fn(s,l,90),d=Nn(a,n,m),x):m},x.majorExtent([[-180,-90+ke],[180,90-ke]]).minorExtent([[-180,-80-ke],[180,80+ke]])},e.geo.greatArc=function(){var t,r,n=jn,a=Bn;function i(){return{type:"LineString",coordinates:[t||n.apply(this,arguments),r||a.apply(this,arguments)]}}return i.distance=function(){return e.geo.distance(t||n.apply(this,arguments),r||a.apply(this,arguments))},i.source=function(e){return arguments.length?(n=e,t="function"==typeof e?null:e,i):n},i.target=function(e){return arguments.length?(a=e,r="function"==typeof e?null:e,i):a},i.precision=function(){return arguments.length?i:0},i},e.geo.interpolate=function(e,t){return r=e[0]*Ce,n=e[1]*Ce,a=t[0]*Ce,i=t[1]*Ce,o=Math.cos(n),l=Math.sin(n),s=Math.cos(i),c=Math.sin(i),u=o*Math.cos(r),f=o*Math.sin(r),d=s*Math.cos(a),p=s*Math.sin(a),h=2*Math.asin(Math.sqrt(Ie(i-n)+o*s*Ie(a-r))),g=1/Math.sin(h),(v=h?function(e){var t=Math.sin(e*=h)*g,r=Math.sin(h-e)*g,n=r*u+t*d,a=r*f+t*p,i=r*l+t*c;return[Math.atan2(a,n)*Oe,Math.atan2(i,Math.sqrt(n*n+a*a))*Oe]}:function(){return[r*Oe,n*Oe]}).distance=h,v;var r,n,a,i,o,l,s,c,u,f,d,p,h,g,v},e.geo.length=function(t){return mn=0,e.geo.stream(t,Hn),mn};var Hn={sphere:E,point:E,lineStart:function(){var e,t,r;function n(n,a){var i=Math.sin(a*=Ce),o=Math.cos(a),l=y((n*=Ce)-e),s=Math.cos(l);mn+=Math.atan2(Math.sqrt((l=o*Math.sin(l))*l+(l=r*i-t*o*s)*l),t*i+r*o*s),e=n,t=i,r=o}Hn.point=function(a,i){e=a*Ce,t=Math.sin(i*=Ce),r=Math.cos(i),Hn.point=n},Hn.lineEnd=function(){Hn.point=Hn.lineEnd=E}},lineEnd:E,polygonStart:E,polygonEnd:E};function qn(e,t){function r(t,r){var n=Math.cos(t),a=Math.cos(r),i=e(n*a);return[i*a*Math.sin(t),i*Math.sin(r)]}return r.invert=function(e,r){var n=Math.sqrt(e*e+r*r),a=t(n),i=Math.sin(a),o=Math.cos(a);return[Math.atan2(e*i,n*o),Math.asin(n&&r*i/n)]},r}var Vn=qn(function(e){return Math.sqrt(2/(1+e))},function(e){return 2*Math.asin(e/2)});(e.geo.azimuthalEqualArea=function(){return An(Vn)}).raw=Vn;var Un=qn(function(e){var t=Math.acos(e);return t&&t/Math.sin(t)},P);function Gn(e,t){var r=Math.cos(e),n=function(e){return Math.tan(Me/4+e/2)},a=e===t?Math.sin(e):Math.log(r/Math.cos(t))/Math.log(n(t)/n(e)),i=r*Math.pow(n(e),a)/a;if(!a)return Xn;function o(e,t){i>0?t<-Se+ke&&(t=-Se+ke):t>Se-ke&&(t=Se-ke);var r=i/Math.pow(n(t),a);return[r*Math.sin(a*e),i-r*Math.cos(a*e)]}return o.invert=function(e,t){var r=i-t,n=Pe(a)*Math.sqrt(e*e+r*r);return[Math.atan2(e,r)/a,2*Math.atan(Math.pow(i/n,1/a))-Se]},o}function Zn(e,t){var r=Math.cos(e),n=e===t?Math.sin(e):(r-Math.cos(t))/(t-e),a=r/n+e;if(y(n)<ke)return Cn;function i(e,t){var r=a-t;return[r*Math.sin(n*e),a-r*Math.cos(n*e)]}return i.invert=function(e,t){var r=a-t;return[Math.atan2(e,r)/n,a-Pe(n)*Math.sqrt(e*e+r*r)]},i}(e.geo.azimuthalEquidistant=function(){return An(Un)}).raw=Un,(e.geo.conicConformal=function(){return an(Gn)}).raw=Gn,(e.geo.conicEquidistant=function(){return an(Zn)}).raw=Zn;var Yn=qn(function(e){return 1/e},Math.atan);function Xn(e,t){return[e,Math.log(Math.tan(Me/4+t/2))]}function Wn(e){var t,r=An(e),n=r.scale,a=r.translate,i=r.clipExtent;return r.scale=function(){var e=n.apply(r,arguments);return e===r?t?r.clipExtent(null):r:e},r.translate=function(){var e=a.apply(r,arguments);return e===r?t?r.clipExtent(null):r:e},r.clipExtent=function(e){var o=i.apply(r,arguments);if(o===r){if(t=null==e){var l=Me*n(),s=a();i([[s[0]-l,s[1]-l],[s[0]+l,s[1]+l]])}}else t&&(o=null);return o},r.clipExtent(null)}(e.geo.gnomonic=function(){return An(Yn)}).raw=Yn,Xn.invert=function(e,t){return[e,2*Math.atan(Math.exp(t))-Se]},(e.geo.mercator=function(){return Wn(Xn)}).raw=Xn;var $n=qn(function(){return 1},Math.asin);(e.geo.orthographic=function(){return An($n)}).raw=$n;var Jn=qn(function(e){return 1/(1+e)},function(e){return 2*Math.atan(e)});function Qn(e,t){return[Math.log(Math.tan(Me/4+t/2)),-e]}function Kn(e){return e[0]}function ea(e){return e[1]}function ta(e){for(var t=e.length,r=[0,1],n=2,a=2;a<t;a++){for(;n>1&&De(e[r[n-2]],e[r[n-1]],e[a])<=0;)--n;r[n++]=a}return r.slice(0,n)}function ra(e,t){return e[0]-t[0]||e[1]-t[1]}(e.geo.stereographic=function(){return An(Jn)}).raw=Jn,Qn.invert=function(e,t){return[-t,2*Math.atan(Math.exp(e))-Se]},(e.geo.transverseMercator=function(){var e=Wn(Qn),t=e.center,r=e.rotate;return e.center=function(e){return e?t([-e[1],e[0]]):[(e=t())[1],-e[0]]},e.rotate=function(e){return e?r([e[0],e[1],e.length>2?e[2]+90:90]):[(e=r())[0],e[1],e[2]-90]},r([0,0,90])}).raw=Qn,e.geom={},e.geom.hull=function(e){var t=Kn,r=ea;if(arguments.length)return n(e);function n(e){if(e.length<3)return[];var n,a=vt(t),i=vt(r),o=e.length,l=[],s=[];for(n=0;n<o;n++)l.push([+a.call(this,e[n],n),+i.call(this,e[n],n),n]);for(l.sort(ra),n=0;n<o;n++)s.push([l[n][0],-l[n][1]]);var c=ta(l),u=ta(s),f=u[0]===c[0],d=u[u.length-1]===c[c.length-1],p=[];for(n=c.length-1;n>=0;--n)p.push(e[l[c[n]][2]]);for(n=+f;n<u.length-d;++n)p.push(e[l[u[n]][2]]);return p}return n.x=function(e){return arguments.length?(t=e,n):t},n.y=function(e){return arguments.length?(r=e,n):r},n},e.geom.polygon=function(e){return q(e,na),e};var na=e.geom.polygon.prototype=[];function aa(e,t,r){return(r[0]-t[0])*(e[1]-t[1])<(r[1]-t[1])*(e[0]-t[0])}function ia(e,t,r,n){var a=e[0],i=r[0],o=t[0]-a,l=n[0]-i,s=e[1],c=r[1],u=t[1]-s,f=n[1]-c,d=(l*(s-c)-f*(a-i))/(f*o-l*u);return[a+d*o,s+d*u]}function oa(e){var t=e[0],r=e[e.length-1];return!(t[0]-r[0]||t[1]-r[1])}na.area=function(){for(var e,t=-1,r=this.length,n=this[r-1],a=0;++t<r;)e=n,n=this[t],a+=e[1]*n[0]-e[0]*n[1];return.5*a},na.centroid=function(e){var t,r,n=-1,a=this.length,i=0,o=0,l=this[a-1];for(arguments.length||(e=-1/(6*this.area()));++n<a;)t=l,l=this[n],r=t[0]*l[1]-l[0]*t[1],i+=(t[0]+l[0])*r,o+=(t[1]+l[1])*r;return[i*e,o*e]},na.clip=function(e){for(var t,r,n,a,i,o,l=oa(e),s=-1,c=this.length-oa(this),u=this[c-1];++s<c;){for(t=e.slice(),e.length=0,a=this[s],i=t[(n=t.length-l)-1],r=-1;++r<n;)aa(o=t[r],u,a)?(aa(i,u,a)||e.push(ia(i,o,u,a)),e.push(o)):aa(i,u,a)&&e.push(ia(i,o,u,a)),i=o;l&&e.push(e[0]),u=a}return e};var la,sa,ca,ua,fa,da=[],pa=[];function ha(e){var t=da.pop()||new function(){Oa(this),this.edge=this.site=this.circle=null};return t.site=e,t}function ga(e){ka(e),ca.remove(e),da.push(e),Oa(e)}function va(e){var t=e.circle,r=t.x,n=t.cy,a={x:r,y:n},i=e.P,o=e.N,l=[e];ga(e);for(var s=i;s.circle&&y(r-s.circle.x)<ke&&y(n-s.circle.cy)<ke;)i=s.P,l.unshift(s),ga(s),s=i;l.unshift(s),ka(s);for(var c=o;c.circle&&y(r-c.circle.x)<ke&&y(n-c.circle.cy)<ke;)o=c.N,l.push(c),ga(c),c=o;l.push(c),ka(c);var u,f=l.length;for(u=1;u<f;++u)c=l[u],s=l[u-1],La(c.edge,s.site,c.site,a);s=l[0],(c=l[f-1]).edge=Aa(s.site,c.site,null,a),wa(s),wa(c)}function ma(e){for(var t,r,n,a,i=e.x,o=e.y,l=ca._;l;)if((n=ya(l,o)-i)>ke)l=l.L;else{if(!((a=i-xa(l,o))>ke)){n>-ke?(t=l.P,r=l):a>-ke?(t=l,r=l.N):t=r=l;break}if(!l.R){t=l;break}l=l.R}var s=ha(e);if(ca.insert(t,s),t||r){if(t===r)return ka(t),r=ha(t.site),ca.insert(s,r),s.edge=r.edge=Aa(t.site,s.site),wa(t),void wa(r);if(r){ka(t),ka(r);var c=t.site,u=c.x,f=c.y,d=e.x-u,p=e.y-f,h=r.site,g=h.x-u,v=h.y-f,m=2*(d*v-p*g),y=d*d+p*p,x=g*g+v*v,b={x:(v*y-p*x)/m+u,y:(d*x-g*y)/m+f};La(r.edge,c,h,b),s.edge=Aa(c,e,null,b),r.edge=Aa(e,h,null,b),wa(t),wa(r)}else s.edge=Aa(t.site,s.site)}}function ya(e,t){var r=e.site,n=r.x,a=r.y,i=a-t;if(!i)return n;var o=e.P;if(!o)return-1/0;var l=(r=o.site).x,s=r.y,c=s-t;if(!c)return l;var u=l-n,f=1/i-1/c,d=u/c;return f?(-d+Math.sqrt(d*d-2*f*(u*u/(-2*c)-s+c/2+a-i/2)))/f+n:(n+l)/2}function xa(e,t){var r=e.N;if(r)return ya(r,t);var n=e.site;return n.y===t?n.x:1/0}function ba(e){this.site=e,this.edges=[]}function _a(e,t){return t.angle-e.angle}function wa(e){var t=e.P,r=e.N;if(t&&r){var n=t.site,a=e.site,i=r.site;if(n!==i){var o=a.x,l=a.y,s=n.x-o,c=n.y-l,u=i.x-o,f=2*(s*(v=i.y-l)-c*u);if(!(f>=-Te)){var d=s*s+c*c,p=u*u+v*v,h=(v*d-c*p)/f,g=(s*p-u*d)/f,v=g+l,m=pa.pop()||new function(){Oa(this),this.x=this.y=this.arc=this.site=this.cy=null};m.arc=e,m.site=a,m.x=h+o,m.y=v+Math.sqrt(h*h+g*g),m.cy=v,e.circle=m;for(var y=null,x=fa._;x;)if(m.y<x.y||m.y===x.y&&m.x<=x.x){if(!x.L){y=x.P;break}x=x.L}else{if(!x.R){y=x;break}x=x.R}fa.insert(y,m),y||(ua=m)}}}}function ka(e){var t=e.circle;t&&(t.P||(ua=t.N),fa.remove(t),pa.push(t),Oa(t),e.circle=null)}function Ta(e,t){var r=e.b;if(r)return!0;var n,a,i=e.a,o=t[0][0],l=t[1][0],s=t[0][1],c=t[1][1],u=e.l,f=e.r,d=u.x,p=u.y,h=f.x,g=f.y,v=(d+h)/2,m=(p+g)/2;if(g===p){if(v<o||v>=l)return;if(d>h){if(i){if(i.y>=c)return}else i={x:v,y:s};r={x:v,y:c}}else{if(i){if(i.y<s)return}else i={x:v,y:c};r={x:v,y:s}}}else if(a=m-(n=(d-h)/(g-p))*v,n<-1||n>1)if(d>h){if(i){if(i.y>=c)return}else i={x:(s-a)/n,y:s};r={x:(c-a)/n,y:c}}else{if(i){if(i.y<s)return}else i={x:(c-a)/n,y:c};r={x:(s-a)/n,y:s}}else if(p<g){if(i){if(i.x>=l)return}else i={x:o,y:n*o+a};r={x:l,y:n*l+a}}else{if(i){if(i.x<o)return}else i={x:l,y:n*l+a};r={x:o,y:n*o+a}}return e.a=i,e.b=r,!0}function Ma(e,t){this.l=e,this.r=t,this.a=this.b=null}function Aa(e,t,r,n){var a=new Ma(e,t);return la.push(a),r&&La(a,e,t,r),n&&La(a,t,e,n),sa[e.i].edges.push(new Sa(a,e,t)),sa[t.i].edges.push(new Sa(a,t,e)),a}function La(e,t,r,n){e.a||e.b?e.l===r?e.b=n:e.a=n:(e.a=n,e.l=t,e.r=r)}function Sa(e,t,r){var n=e.a,a=e.b;this.edge=e,this.site=t,this.angle=r?Math.atan2(r.y-t.y,r.x-t.x):e.l===t?Math.atan2(a.x-n.x,n.y-a.y):Math.atan2(n.x-a.x,a.y-n.y)}function Ca(){this._=null}function Oa(e){e.U=e.C=e.L=e.R=e.P=e.N=null}function Pa(e,t){var r=t,n=t.R,a=r.U;a?a.L===r?a.L=n:a.R=n:e._=n,n.U=a,r.U=n,r.R=n.L,r.R&&(r.R.U=r),n.L=r}function Da(e,t){var r=t,n=t.L,a=r.U;a?a.L===r?a.L=n:a.R=n:e._=n,n.U=a,r.U=n,r.L=n.R,r.L&&(r.L.U=r),n.R=r}function za(e){for(;e.L;)e=e.L;return e}function Ra(e,t){var r,n,a,i=e.sort(Ea).pop();for(la=[],sa=new Array(e.length),ca=new Ca,fa=new Ca;;)if(a=ua,i&&(!a||i.y<a.y||i.y===a.y&&i.x<a.x))i.x===r&&i.y===n||(sa[i.i]=new ba(i),ma(i),r=i.x,n=i.y),i=e.pop();else{if(!a)break;va(a.arc)}t&&(function(e){for(var t,r=la,n=tn(e[0][0],e[0][1],e[1][0],e[1][1]),a=r.length;a--;)(!Ta(t=r[a],e)||!n(t)||y(t.a.x-t.b.x)<ke&&y(t.a.y-t.b.y)<ke)&&(t.a=t.b=null,r.splice(a,1))}(t),function(e){for(var t,r,n,a,i,o,l,s,c,u,f=e[0][0],d=e[1][0],p=e[0][1],h=e[1][1],g=sa,v=g.length;v--;)if((i=g[v])&&i.prepare())for(s=(l=i.edges).length,o=0;o<s;)n=(u=l[o].end()).x,a=u.y,t=(c=l[++o%s].start()).x,r=c.y,(y(n-t)>ke||y(a-r)>ke)&&(l.splice(o,0,new Sa((m=i.site,x=u,b=y(n-f)<ke&&h-a>ke?{x:f,y:y(t-f)<ke?r:h}:y(a-h)<ke&&d-n>ke?{x:y(r-h)<ke?t:d,y:h}:y(n-d)<ke&&a-p>ke?{x:d,y:y(t-d)<ke?r:p}:y(a-p)<ke&&n-f>ke?{x:y(r-p)<ke?t:f,y:p}:null,_=void 0,_=new Ma(m,null),_.a=x,_.b=b,la.push(_),_),i.site,null)),++s);var m,x,b,_}(t));var o={cells:sa,edges:la};return ca=fa=la=sa=null,o}function Ea(e,t){return t.y-e.y||t.x-e.x}ba.prototype.prepare=function(){for(var e,t=this.edges,r=t.length;r--;)(e=t[r].edge).b&&e.a||t.splice(r,1);return t.sort(_a),t.length},Sa.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}},Ca.prototype={insert:function(e,t){var r,n,a;if(e){if(t.P=e,t.N=e.N,e.N&&(e.N.P=t),e.N=t,e.R){for(e=e.R;e.L;)e=e.L;e.L=t}else e.R=t;r=e}else this._?(e=za(this._),t.P=null,t.N=e,e.P=e.L=t,r=e):(t.P=t.N=null,this._=t,r=null);for(t.L=t.R=null,t.U=r,t.C=!0,e=t;r&&r.C;)r===(n=r.U).L?(a=n.R)&&a.C?(r.C=a.C=!1,n.C=!0,e=n):(e===r.R&&(Pa(this,r),r=(e=r).U),r.C=!1,n.C=!0,Da(this,n)):(a=n.L)&&a.C?(r.C=a.C=!1,n.C=!0,e=n):(e===r.L&&(Da(this,r),r=(e=r).U),r.C=!1,n.C=!0,Pa(this,n)),r=e.U;this._.C=!1},remove:function(e){e.N&&(e.N.P=e.P),e.P&&(e.P.N=e.N),e.N=e.P=null;var t,r,n,a=e.U,i=e.L,o=e.R;if(r=i?o?za(o):i:o,a?a.L===e?a.L=r:a.R=r:this._=r,i&&o?(n=r.C,r.C=e.C,r.L=i,i.U=r,r!==o?(a=r.U,r.U=e.U,e=r.R,a.L=e,r.R=o,o.U=r):(r.U=a,a=r,e=r.R)):(n=e.C,e=r),e&&(e.U=a),!n)if(e&&e.C)e.C=!1;else{do{if(e===this._)break;if(e===a.L){if((t=a.R).C&&(t.C=!1,a.C=!0,Pa(this,a),t=a.R),t.L&&t.L.C||t.R&&t.R.C){t.R&&t.R.C||(t.L.C=!1,t.C=!0,Da(this,t),t=a.R),t.C=a.C,a.C=t.R.C=!1,Pa(this,a),e=this._;break}}else if((t=a.L).C&&(t.C=!1,a.C=!0,Da(this,a),t=a.L),t.L&&t.L.C||t.R&&t.R.C){t.L&&t.L.C||(t.R.C=!1,t.C=!0,Pa(this,t),t=a.L),t.C=a.C,a.C=t.L.C=!1,Da(this,a),e=this._;break}t.C=!0,e=a,a=a.U}while(!e.C);e&&(e.C=!1)}}},e.geom.voronoi=function(e){var t=Kn,r=ea,n=t,a=r,i=Ia;if(e)return o(e);function o(e){var t=new Array(e.length),r=i[0][0],n=i[0][1],a=i[1][0],o=i[1][1];return Ra(l(e),i).cells.forEach(function(i,l){var s=i.edges,c=i.site;(t[l]=s.length?s.map(function(e){var t=e.start();return[t.x,t.y]}):c.x>=r&&c.x<=a&&c.y>=n&&c.y<=o?[[r,o],[a,o],[a,n],[r,n]]:[]).point=e[l]}),t}function l(e){return e.map(function(e,t){return{x:Math.round(n(e,t)/ke)*ke,y:Math.round(a(e,t)/ke)*ke,i:t}})}return o.links=function(e){return Ra(l(e)).edges.filter(function(e){return e.l&&e.r}).map(function(t){return{source:e[t.l.i],target:e[t.r.i]}})},o.triangles=function(e){var t=[];return Ra(l(e)).cells.forEach(function(r,n){for(var a,i,o,l,s=r.site,c=r.edges.sort(_a),u=-1,f=c.length,d=c[f-1].edge,p=d.l===s?d.r:d.l;++u<f;)d,a=p,p=(d=c[u].edge).l===s?d.r:d.l,n<a.i&&n<p.i&&(o=a,l=p,((i=s).x-l.x)*(o.y-i.y)-(i.x-o.x)*(l.y-i.y)<0)&&t.push([e[n],e[a.i],e[p.i]])}),t},o.x=function(e){return arguments.length?(n=vt(t=e),o):t},o.y=function(e){return arguments.length?(a=vt(r=e),o):r},o.clipExtent=function(e){return arguments.length?(i=null==e?Ia:e,o):i===Ia?null:i},o.size=function(e){return arguments.length?o.clipExtent(e&&[[0,0],e]):i===Ia?null:i&&i[1]},o};var Ia=[[-1e6,-1e6],[1e6,1e6]];function Fa(e){return e.x}function Na(e){return e.y}function ja(t,r){t=e.rgb(t),r=e.rgb(r);var n=t.r,a=t.g,i=t.b,o=r.r-n,l=r.g-a,s=r.b-i;return function(e){return"#"+ct(Math.round(n+o*e))+ct(Math.round(a+l*e))+ct(Math.round(i+s*e))}}function Ba(e,t){var r,n={},a={};for(r in e)r in t?n[r]=Ga(e[r],t[r]):a[r]=e[r];for(r in t)r in e||(a[r]=t[r]);return function(e){for(r in n)a[r]=n[r](e);return a}}function Ha(e,t){return e=+e,t=+t,function(r){return e*(1-r)+t*r}}function qa(e,t){var r,n,a,i=Va.lastIndex=Ua.lastIndex=0,o=-1,l=[],s=[];for(e+="",t+="";(r=Va.exec(e))&&(n=Ua.exec(t));)(a=n.index)>i&&(a=t.slice(i,a),l[o]?l[o]+=a:l[++o]=a),(r=r[0])===(n=n[0])?l[o]?l[o]+=n:l[++o]=n:(l[++o]=null,s.push({i:o,x:Ha(r,n)})),i=Ua.lastIndex;return i<t.length&&(a=t.slice(i),l[o]?l[o]+=a:l[++o]=a),l.length<2?s[0]?(t=s[0].x,function(e){return t(e)+""}):function(){return t}:(t=s.length,function(e){for(var r,n=0;n<t;++n)l[(r=s[n]).i]=r.x(e);return l.join("")})}e.geom.delaunay=function(t){return e.geom.voronoi().triangles(t)},e.geom.quadtree=function(e,t,r,n,a){var i,o=Kn,l=ea;if(i=arguments.length)return o=Fa,l=Na,3===i&&(a=r,n=t,r=t=0),s(e);function s(e){var s,c,u,f,d,p,h,g,v,m=vt(o),x=vt(l);if(null!=t)p=t,h=r,g=n,v=a;else if(g=v=-(p=h=1/0),c=[],u=[],d=e.length,i)for(f=0;f<d;++f)(s=e[f]).x<p&&(p=s.x),s.y<h&&(h=s.y),s.x>g&&(g=s.x),s.y>v&&(v=s.y),c.push(s.x),u.push(s.y);else for(f=0;f<d;++f){var b=+m(s=e[f],f),_=+x(s,f);b<p&&(p=b),_<h&&(h=_),b>g&&(g=b),_>v&&(v=_),c.push(b),u.push(_)}var w=g-p,k=v-h;function T(e,t,r,n,a,i,o,l){if(!isNaN(r)&&!isNaN(n))if(e.leaf){var s=e.x,c=e.y;if(null!=s)if(y(s-r)+y(c-n)<.01)M(e,t,r,n,a,i,o,l);else{var u=e.point;e.x=e.y=e.point=null,M(e,u,s,c,a,i,o,l),M(e,t,r,n,a,i,o,l)}else e.x=r,e.y=n,e.point=t}else M(e,t,r,n,a,i,o,l)}function M(e,t,r,n,a,i,o,l){var s=.5*(a+o),c=.5*(i+l),u=r>=s,f=n>=c,d=f<<1|u;e.leaf=!1,e=e.nodes[d]||(e.nodes[d]={leaf:!0,nodes:[],point:null,x:null,y:null,add:function(e){T(A,e,+m(e,++f),+x(e,f),p,h,g,v)}}),u?a=s:o=s,f?i=c:l=c,T(e,t,r,n,a,i,o,l)}w>k?v=h+w:g=p+k;var A={leaf:!0,nodes:[],point:null,x:null,y:null,add:function(e){T(A,e,+m(e,++f),+x(e,f),p,h,g,v)}};if(A.visit=function(e){!function e(t,r,n,a,i,o){if(!t(r,n,a,i,o)){var l=.5*(n+i),s=.5*(a+o),c=r.nodes;c[0]&&e(t,c[0],n,a,l,s),c[1]&&e(t,c[1],l,a,i,s),c[2]&&e(t,c[2],n,s,l,o),c[3]&&e(t,c[3],l,s,i,o)}}(e,A,p,h,g,v)},A.find=function(e){return function(e,t,r,n,a,i,o){var l,s=1/0;return function e(c,u,f,d,p){if(!(u>i||f>o||d<n||p<a)){if(h=c.point){var h,g=t-c.x,v=r-c.y,m=g*g+v*v;if(m<s){var y=Math.sqrt(s=m);n=t-y,a=r-y,i=t+y,o=r+y,l=h}}for(var x=c.nodes,b=.5*(u+d),_=.5*(f+p),w=(r>=_)<<1|t>=b,k=w+4;w<k;++w)if(c=x[3&w])switch(3&w){case 0:e(c,u,f,b,_);break;case 1:e(c,b,f,d,_);break;case 2:e(c,u,_,b,p);break;case 3:e(c,b,_,d,p)}}}(e,n,a,i,o),l}(A,e[0],e[1],p,h,g,v)},f=-1,null==t){for(;++f<d;)T(A,e[f],c[f],u[f],p,h,g,v);--f}else e.forEach(A.add);return c=u=e=s=null,A}return s.x=function(e){return arguments.length?(o=e,s):o},s.y=function(e){return arguments.length?(l=e,s):l},s.extent=function(e){return arguments.length?(null==e?t=r=n=a=null:(t=+e[0][0],r=+e[0][1],n=+e[1][0],a=+e[1][1]),s):null==t?null:[[t,r],[n,a]]},s.size=function(e){return arguments.length?(null==e?t=r=n=a=null:(t=r=0,n=+e[0],a=+e[1]),s):null==t?null:[n-t,a-r]},s},e.interpolateRgb=ja,e.interpolateObject=Ba,e.interpolateNumber=Ha,e.interpolateString=qa;var Va=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Ua=new RegExp(Va.source,"g");function Ga(t,r){for(var n,a=e.interpolators.length;--a>=0&&!(n=e.interpolators[a](t,r)););return n}function Za(e,t){var r,n=[],a=[],i=e.length,o=t.length,l=Math.min(e.length,t.length);for(r=0;r<l;++r)n.push(Ga(e[r],t[r]));for(;r<i;++r)a[r]=e[r];for(;r<o;++r)a[r]=t[r];return function(e){for(r=0;r<l;++r)a[r]=n[r](e);return a}}e.interpolate=Ga,e.interpolators=[function(e,t){var r=typeof t;return("string"===r?gt.has(t.toLowerCase())||/^(#|rgb\(|hsl\()/i.test(t)?ja:qa:t instanceof He?ja:Array.isArray(t)?Za:"object"===r&&isNaN(t)?Ba:Ha)(e,t)}],e.interpolateArray=Za;var Ya=function(){return P},Xa=e.map({linear:Ya,poly:function(e){return function(t){return Math.pow(t,e)}},quad:function(){return Qa},cubic:function(){return Ka},sin:function(){return ti},exp:function(){return ri},circle:function(){return ni},elastic:function(e,t){var r;arguments.length<2&&(t=.45);arguments.length?r=t/Ae*Math.asin(1/e):(e=1,r=t/4);return function(n){return 1+e*Math.pow(2,-10*n)*Math.sin((n-r)*Ae/t)}},back:function(e){e||(e=1.70158);return function(t){return t*t*((e+1)*t-e)}},bounce:function(){return ai}}),Wa=e.map({in:P,out:$a,"in-out":Ja,"out-in":function(e){return Ja($a(e))}});function $a(e){return function(t){return 1-e(1-t)}}function Ja(e){return function(t){return.5*(t<.5?e(2*t):2-e(2-2*t))}}function Qa(e){return e*e}function Ka(e){return e*e*e}function ei(e){if(e<=0)return 0;if(e>=1)return 1;var t=e*e,r=t*e;return 4*(e<.5?r:3*(e-t)+r-.75)}function ti(e){return 1-Math.cos(e*Se)}function ri(e){return Math.pow(2,10*(e-1))}function ni(e){return 1-Math.sqrt(1-e*e)}function ai(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375}function ii(e,t){return t-=e,function(r){return Math.round(e+t*r)}}function oi(e){var t,r,n,a=[e.a,e.b],i=[e.c,e.d],o=si(a),l=li(a,i),s=si(((t=i)[0]+=(n=-l)*(r=a)[0],t[1]+=n*r[1],t))||0;a[0]*i[1]<i[0]*a[1]&&(a[0]*=-1,a[1]*=-1,o*=-1,l*=-1),this.rotate=(o?Math.atan2(a[1],a[0]):Math.atan2(-i[0],i[1]))*Oe,this.translate=[e.e,e.f],this.scale=[o,s],this.skew=s?Math.atan2(l,s)*Oe:0}function li(e,t){return e[0]*t[0]+e[1]*t[1]}function si(e){var t=Math.sqrt(li(e,e));return t&&(e[0]/=t,e[1]/=t),t}e.ease=function(e){var t,n=e.indexOf("-"),a=n>=0?e.slice(0,n):e,i=n>=0?e.slice(n+1):"in";return a=Xa.get(a)||Ya,i=Wa.get(i)||P,t=i(a.apply(null,r.call(arguments,1))),function(e){return e<=0?0:e>=1?1:t(e)}},e.interpolateHcl=function(t,r){t=e.hcl(t),r=e.hcl(r);var n=t.h,a=t.c,i=t.l,o=r.h-n,l=r.c-a,s=r.l-i;isNaN(l)&&(l=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(e){return Ye(n+o*e,a+l*e,i+s*e)+""}},e.interpolateHsl=function(t,r){t=e.hsl(t),r=e.hsl(r);var n=t.h,a=t.s,i=t.l,o=r.h-n,l=r.s-a,s=r.l-i;isNaN(l)&&(l=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(e){return Ue(n+o*e,a+l*e,i+s*e)+""}},e.interpolateLab=function(t,r){t=e.lab(t),r=e.lab(r);var n=t.l,a=t.a,i=t.b,o=r.l-n,l=r.a-a,s=r.b-i;return function(e){return et(n+o*e,a+l*e,i+s*e)+""}},e.interpolateRound=ii,e.transform=function(t){var r=a.createElementNS(e.ns.prefix.svg,"g");return(e.transform=function(e){if(null!=e){r.setAttribute("transform",e);var t=r.transform.baseVal.consolidate()}return new oi(t?t.matrix:ci)})(t)},oi.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var ci={a:1,b:0,c:0,d:1,e:0,f:0};function ui(e){return e.length?e.pop()+",":""}function fi(t,r){var n=[],a=[];return t=e.transform(t),r=e.transform(r),function(e,t,r,n){if(e[0]!==t[0]||e[1]!==t[1]){var a=r.push("translate(",null,",",null,")");n.push({i:a-4,x:Ha(e[0],t[0])},{i:a-2,x:Ha(e[1],t[1])})}else(t[0]||t[1])&&r.push("translate("+t+")")}(t.translate,r.translate,n,a),function(e,t,r,n){e!==t?(e-t>180?t+=360:t-e>180&&(e+=360),n.push({i:r.push(ui(r)+"rotate(",null,")")-2,x:Ha(e,t)})):t&&r.push(ui(r)+"rotate("+t+")")}(t.rotate,r.rotate,n,a),function(e,t,r,n){e!==t?n.push({i:r.push(ui(r)+"skewX(",null,")")-2,x:Ha(e,t)}):t&&r.push(ui(r)+"skewX("+t+")")}(t.skew,r.skew,n,a),function(e,t,r,n){if(e[0]!==t[0]||e[1]!==t[1]){var a=r.push(ui(r)+"scale(",null,",",null,")");n.push({i:a-4,x:Ha(e[0],t[0])},{i:a-2,x:Ha(e[1],t[1])})}else 1===t[0]&&1===t[1]||r.push(ui(r)+"scale("+t+")")}(t.scale,r.scale,n,a),t=r=null,function(e){for(var t,r=-1,i=a.length;++r<i;)n[(t=a[r]).i]=t.x(e);return n.join("")}}function di(e,t){return t=(t-=e=+e)||1/t,function(r){return(r-e)/t}}function pi(e,t){return t=(t-=e=+e)||1/t,function(r){return Math.max(0,Math.min(1,(r-e)/t))}}function hi(e){for(var t=e.source,r=e.target,n=function(e,t){if(e===t)return e;var r=gi(e),n=gi(t),a=r.pop(),i=n.pop(),o=null;for(;a===i;)o=a,a=r.pop(),i=n.pop();return o}(t,r),a=[t];t!==n;)t=t.parent,a.push(t);for(var i=a.length;r!==n;)a.splice(i,0,r),r=r.parent;return a}function gi(e){for(var t=[],r=e.parent;null!=r;)t.push(e),e=r,r=r.parent;return t.push(e),t}function vi(e){e.fixed|=2}function mi(e){e.fixed&=-7}function yi(e){e.fixed|=4,e.px=e.x,e.py=e.y}function xi(e){e.fixed&=-5}e.interpolateTransform=fi,e.layout={},e.layout.bundle=function(){return function(e){for(var t=[],r=-1,n=e.length;++r<n;)t.push(hi(e[r]));return t}},e.layout.chord=function(){var t,r,n,a,i,o,l,s={},c=0;function u(){var s,u,d,p,h,g={},v=[],m=e.range(a),y=[];for(t=[],r=[],s=0,p=-1;++p<a;){for(u=0,h=-1;++h<a;)u+=n[p][h];v.push(u),y.push(e.range(a)),s+=u}for(i&&m.sort(function(e,t){return i(v[e],v[t])}),o&&y.forEach(function(e,t){e.sort(function(e,r){return o(n[t][e],n[t][r])})}),s=(Ae-c*a)/s,u=0,p=-1;++p<a;){for(d=u,h=-1;++h<a;){var x=m[p],b=y[x][h],_=n[x][b],w=u,k=u+=_*s;g[x+"-"+b]={index:x,subindex:b,startAngle:w,endAngle:k,value:_}}r[x]={index:x,startAngle:d,endAngle:u,value:v[x]},u+=c}for(p=-1;++p<a;)for(h=p-1;++h<a;){var T=g[p+"-"+h],M=g[h+"-"+p];(T.value||M.value)&&t.push(T.value<M.value?{source:M,target:T}:{source:T,target:M})}l&&f()}function f(){t.sort(function(e,t){return l((e.source.value+e.target.value)/2,(t.source.value+t.target.value)/2)})}return s.matrix=function(e){return arguments.length?(a=(n=e)&&n.length,t=r=null,s):n},s.padding=function(e){return arguments.length?(c=e,t=r=null,s):c},s.sortGroups=function(e){return arguments.length?(i=e,t=r=null,s):i},s.sortSubgroups=function(e){return arguments.length?(o=e,t=null,s):o},s.sortChords=function(e){return arguments.length?(l=e,t&&f(),s):l},s.chords=function(){return t||u(),t},s.groups=function(){return r||u(),r},s},e.layout.force=function(){var t,r,n,a,i,o,l={},s=e.dispatch("start","tick","end"),c=[1,1],u=.9,f=bi,d=_i,p=-30,h=wi,g=.1,v=.64,m=[],y=[];function x(e){return function(t,r,n,a){if(t.point!==e){var i=t.cx-e.x,o=t.cy-e.y,l=a-r,s=i*i+o*o;if(l*l/v<s){if(s<h){var c=t.charge/s;e.px-=i*c,e.py-=o*c}return!0}if(t.point&&s&&s<h){c=t.pointCharge/s;e.px-=i*c,e.py-=o*c}}return!t.charge}}function b(t){t.px=e.event.x,t.py=e.event.y,l.resume()}return l.tick=function(){if((n*=.99)<.005)return t=null,s.end({type:"end",alpha:n=0}),!0;var r,l,f,d,h,v,b,_,w,k=m.length,T=y.length;for(l=0;l<T;++l)d=(f=y[l]).source,(v=(_=(h=f.target).x-d.x)*_+(w=h.y-d.y)*w)&&(_*=v=n*i[l]*((v=Math.sqrt(v))-a[l])/v,w*=v,h.x-=_*(b=d.weight+h.weight?d.weight/(d.weight+h.weight):.5),h.y-=w*b,d.x+=_*(b=1-b),d.y+=w*b);if((b=n*g)&&(_=c[0]/2,w=c[1]/2,l=-1,b))for(;++l<k;)(f=m[l]).x+=(_-f.x)*b,f.y+=(w-f.y)*b;if(p)for(!function e(t,r,n){var a=0,i=0;t.charge=0;if(!t.leaf)for(var o,l=t.nodes,s=l.length,c=-1;++c<s;)null!=(o=l[c])&&(e(o,r,n),t.charge+=o.charge,a+=o.charge*o.cx,i+=o.charge*o.cy);if(t.point){t.leaf||(t.point.x+=Math.random()-.5,t.point.y+=Math.random()-.5);var u=r*n[t.point.index];t.charge+=t.pointCharge=u,a+=u*t.point.x,i+=u*t.point.y}t.cx=a/t.charge;t.cy=i/t.charge}(r=e.geom.quadtree(m),n,o),l=-1;++l<k;)(f=m[l]).fixed||r.visit(x(f));for(l=-1;++l<k;)(f=m[l]).fixed?(f.x=f.px,f.y=f.py):(f.x-=(f.px-(f.px=f.x))*u,f.y-=(f.py-(f.py=f.y))*u);s.tick({type:"tick",alpha:n})},l.nodes=function(e){return arguments.length?(m=e,l):m},l.links=function(e){return arguments.length?(y=e,l):y},l.size=function(e){return arguments.length?(c=e,l):c},l.linkDistance=function(e){return arguments.length?(f="function"==typeof e?e:+e,l):f},l.distance=l.linkDistance,l.linkStrength=function(e){return arguments.length?(d="function"==typeof e?e:+e,l):d},l.friction=function(e){return arguments.length?(u=+e,l):u},l.charge=function(e){return arguments.length?(p="function"==typeof e?e:+e,l):p},l.chargeDistance=function(e){return arguments.length?(h=e*e,l):Math.sqrt(h)},l.gravity=function(e){return arguments.length?(g=+e,l):g},l.theta=function(e){return arguments.length?(v=e*e,l):Math.sqrt(v)},l.alpha=function(e){return arguments.length?(e=+e,n?e>0?n=e:(t.c=null,t.t=NaN,t=null,s.end({type:"end",alpha:n=0})):e>0&&(s.start({type:"start",alpha:n=e}),t=Tt(l.tick)),l):n},l.start=function(){var e,t,r,n=m.length,s=y.length,u=c[0],h=c[1];for(e=0;e<n;++e)(r=m[e]).index=e,r.weight=0;for(e=0;e<s;++e)"number"==typeof(r=y[e]).source&&(r.source=m[r.source]),"number"==typeof r.target&&(r.target=m[r.target]),++r.source.weight,++r.target.weight;for(e=0;e<n;++e)r=m[e],isNaN(r.x)&&(r.x=g("x",u)),isNaN(r.y)&&(r.y=g("y",h)),isNaN(r.px)&&(r.px=r.x),isNaN(r.py)&&(r.py=r.y);if(a=[],"function"==typeof f)for(e=0;e<s;++e)a[e]=+f.call(this,y[e],e);else for(e=0;e<s;++e)a[e]=f;if(i=[],"function"==typeof d)for(e=0;e<s;++e)i[e]=+d.call(this,y[e],e);else for(e=0;e<s;++e)i[e]=d;if(o=[],"function"==typeof p)for(e=0;e<n;++e)o[e]=+p.call(this,m[e],e);else for(e=0;e<n;++e)o[e]=p;function g(r,a){if(!t){for(t=new Array(n),c=0;c<n;++c)t[c]=[];for(c=0;c<s;++c){var i=y[c];t[i.source.index].push(i.target),t[i.target.index].push(i.source)}}for(var o,l=t[e],c=-1,u=l.length;++c<u;)if(!isNaN(o=l[c][r]))return o;return Math.random()*a}return l.resume()},l.resume=function(){return l.alpha(.1)},l.stop=function(){return l.alpha(0)},l.drag=function(){if(r||(r=e.behavior.drag().origin(P).on("dragstart.force",vi).on("drag.force",b).on("dragend.force",mi)),!arguments.length)return r;this.on("mouseover.force",yi).on("mouseout.force",xi).call(r)},e.rebind(l,s,"on")};var bi=20,_i=1,wi=1/0;function ki(t,r){return e.rebind(t,r,"sort","children","value"),t.nodes=t,t.links=Ci,t}function Ti(e,t){for(var r=[e];null!=(e=r.pop());)if(t(e),(a=e.children)&&(n=a.length))for(var n,a;--n>=0;)r.push(a[n])}function Mi(e,t){for(var r=[e],n=[];null!=(e=r.pop());)if(n.push(e),(i=e.children)&&(a=i.length))for(var a,i,o=-1;++o<a;)r.push(i[o]);for(;null!=(e=n.pop());)t(e)}function Ai(e){return e.children}function Li(e){return e.value}function Si(e,t){return t.value-e.value}function Ci(t){return e.merge(t.map(function(e){return(e.children||[]).map(function(t){return{source:e,target:t}})}))}e.layout.hierarchy=function(){var e=Si,t=Ai,r=Li;function n(a){var i,o=[a],l=[];for(a.depth=0;null!=(i=o.pop());)if(l.push(i),(c=t.call(n,i,i.depth))&&(s=c.length)){for(var s,c,u;--s>=0;)o.push(u=c[s]),u.parent=i,u.depth=i.depth+1;r&&(i.value=0),i.children=c}else r&&(i.value=+r.call(n,i,i.depth)||0),delete i.children;return Mi(a,function(t){var n,a;e&&(n=t.children)&&n.sort(e),r&&(a=t.parent)&&(a.value+=t.value)}),l}return n.sort=function(t){return arguments.length?(e=t,n):e},n.children=function(e){return arguments.length?(t=e,n):t},n.value=function(e){return arguments.length?(r=e,n):r},n.revalue=function(e){return r&&(Ti(e,function(e){e.children&&(e.value=0)}),Mi(e,function(e){var t;e.children||(e.value=+r.call(n,e,e.depth)||0),(t=e.parent)&&(t.value+=e.value)})),e},n},e.layout.partition=function(){var t=e.layout.hierarchy(),r=[1,1];function n(e,n){var a=t.call(this,e,n);return function e(t,r,n,a){var i=t.children;if(t.x=r,t.y=t.depth*a,t.dx=n,t.dy=a,i&&(o=i.length)){var o,l,s,c=-1;for(n=t.value?n/t.value:0;++c<o;)e(l=i[c],r,s=l.value*n,a),r+=s}}(a[0],0,r[0],r[1]/function e(t){var r=t.children,n=0;if(r&&(a=r.length))for(var a,i=-1;++i<a;)n=Math.max(n,e(r[i]));return 1+n}(a[0])),a}return n.size=function(e){return arguments.length?(r=e,n):r},ki(n,t)},e.layout.pie=function(){var t=Number,r=Oi,n=0,a=Ae,i=0;function o(l){var s,c=l.length,u=l.map(function(e,r){return+t.call(o,e,r)}),f=+("function"==typeof n?n.apply(this,arguments):n),d=("function"==typeof a?a.apply(this,arguments):a)-f,p=Math.min(Math.abs(d)/c,+("function"==typeof i?i.apply(this,arguments):i)),h=p*(d<0?-1:1),g=e.sum(u),v=g?(d-c*h)/g:0,m=e.range(c),y=[];return null!=r&&m.sort(r===Oi?function(e,t){return u[t]-u[e]}:function(e,t){return r(l[e],l[t])}),m.forEach(function(e){y[e]={data:l[e],value:s=u[e],startAngle:f,endAngle:f+=s*v+h,padAngle:p}}),y}return o.value=function(e){return arguments.length?(t=e,o):t},o.sort=function(e){return arguments.length?(r=e,o):r},o.startAngle=function(e){return arguments.length?(n=e,o):n},o.endAngle=function(e){return arguments.length?(a=e,o):a},o.padAngle=function(e){return arguments.length?(i=e,o):i},o};var Oi={};function Pi(e){return e.x}function Di(e){return e.y}function zi(e,t,r){e.y0=t,e.y=r}e.layout.stack=function(){var t=P,r=Ii,n=Fi,a=zi,i=Pi,o=Di;function l(s,c){if(!(p=s.length))return s;var u=s.map(function(e,r){return t.call(l,e,r)}),f=u.map(function(e){return e.map(function(e,t){return[i.call(l,e,t),o.call(l,e,t)]})}),d=r.call(l,f,c);u=e.permute(u,d),f=e.permute(f,d);var p,h,g,v,m=n.call(l,f,c),y=u[0].length;for(g=0;g<y;++g)for(a.call(l,u[0][g],v=m[g],f[0][g][1]),h=1;h<p;++h)a.call(l,u[h][g],v+=f[h-1][g][1],f[h][g][1]);return s}return l.values=function(e){return arguments.length?(t=e,l):t},l.order=function(e){return arguments.length?(r="function"==typeof e?e:Ri.get(e)||Ii,l):r},l.offset=function(e){return arguments.length?(n="function"==typeof e?e:Ei.get(e)||Fi,l):n},l.x=function(e){return arguments.length?(i=e,l):i},l.y=function(e){return arguments.length?(o=e,l):o},l.out=function(e){return arguments.length?(a=e,l):a},l};var Ri=e.map({"inside-out":function(t){var r,n,a=t.length,i=t.map(Ni),o=t.map(ji),l=e.range(a).sort(function(e,t){return i[e]-i[t]}),s=0,c=0,u=[],f=[];for(r=0;r<a;++r)n=l[r],s<c?(s+=o[n],u.push(n)):(c+=o[n],f.push(n));return f.reverse().concat(u)},reverse:function(t){return e.range(t.length).reverse()},default:Ii}),Ei=e.map({silhouette:function(e){var t,r,n,a=e.length,i=e[0].length,o=[],l=0,s=[];for(r=0;r<i;++r){for(t=0,n=0;t<a;t++)n+=e[t][r][1];n>l&&(l=n),o.push(n)}for(r=0;r<i;++r)s[r]=(l-o[r])/2;return s},wiggle:function(e){var t,r,n,a,i,o,l,s,c,u=e.length,f=e[0],d=f.length,p=[];for(p[0]=s=c=0,r=1;r<d;++r){for(t=0,a=0;t<u;++t)a+=e[t][r][1];for(t=0,i=0,l=f[r][0]-f[r-1][0];t<u;++t){for(n=0,o=(e[t][r][1]-e[t][r-1][1])/(2*l);n<t;++n)o+=(e[n][r][1]-e[n][r-1][1])/l;i+=o*e[t][r][1]}p[r]=s-=a?i/a*l:0,s<c&&(c=s)}for(r=0;r<d;++r)p[r]-=c;return p},expand:function(e){var t,r,n,a=e.length,i=e[0].length,o=1/a,l=[];for(r=0;r<i;++r){for(t=0,n=0;t<a;t++)n+=e[t][r][1];if(n)for(t=0;t<a;t++)e[t][r][1]/=n;else for(t=0;t<a;t++)e[t][r][1]=o}for(r=0;r<i;++r)l[r]=0;return l},zero:Fi});function Ii(t){return e.range(t.length)}function Fi(e){for(var t=-1,r=e[0].length,n=[];++t<r;)n[t]=0;return n}function Ni(e){for(var t,r=1,n=0,a=e[0][1],i=e.length;r<i;++r)(t=e[r][1])>a&&(n=r,a=t);return n}function ji(e){return e.reduce(Bi,0)}function Bi(e,t){return e+t[1]}function Hi(e,t){return qi(e,Math.ceil(Math.log(t.length)/Math.LN2+1))}function qi(e,t){for(var r=-1,n=+e[0],a=(e[1]-n)/t,i=[];++r<=t;)i[r]=a*r+n;return i}function Vi(t){return[e.min(t),e.max(t)]}function Ui(e,t){return e.value-t.value}function Gi(e,t){var r=e._pack_next;e._pack_next=t,t._pack_prev=e,t._pack_next=r,r._pack_prev=t}function Zi(e,t){e._pack_next=t,t._pack_prev=e}function Yi(e,t){var r=t.x-e.x,n=t.y-e.y,a=e.r+t.r;return.999*a*a>r*r+n*n}function Xi(e){if((t=e.children)&&(s=t.length)){var t,r,n,a,i,o,l,s,c=1/0,u=-1/0,f=1/0,d=-1/0;if(t.forEach(Wi),(r=t[0]).x=-r.r,r.y=0,x(r),s>1&&((n=t[1]).x=n.r,n.y=0,x(n),s>2))for(Ji(r,n,a=t[2]),x(a),Gi(r,a),r._pack_prev=a,Gi(a,n),n=r._pack_next,i=3;i<s;i++){Ji(r,n,a=t[i]);var p=0,h=1,g=1;for(o=n._pack_next;o!==n;o=o._pack_next,h++)if(Yi(o,a)){p=1;break}if(1==p)for(l=r._pack_prev;l!==o._pack_prev&&!Yi(l,a);l=l._pack_prev,g++);p?(h<g||h==g&&n.r<r.r?Zi(r,n=o):Zi(r=l,n),i--):(Gi(r,a),n=a,x(a))}var v=(c+u)/2,m=(f+d)/2,y=0;for(i=0;i<s;i++)(a=t[i]).x-=v,a.y-=m,y=Math.max(y,a.r+Math.sqrt(a.x*a.x+a.y*a.y));e.r=y,t.forEach($i)}function x(e){c=Math.min(e.x-e.r,c),u=Math.max(e.x+e.r,u),f=Math.min(e.y-e.r,f),d=Math.max(e.y+e.r,d)}}function Wi(e){e._pack_next=e._pack_prev=e}function $i(e){delete e._pack_next,delete e._pack_prev}function Ji(e,t,r){var n=e.r+r.r,a=t.x-e.x,i=t.y-e.y;if(n&&(a||i)){var o=t.r+r.r,l=a*a+i*i,s=.5+((n*=n)-(o*=o))/(2*l),c=Math.sqrt(Math.max(0,2*o*(n+l)-(n-=l)*n-o*o))/(2*l);r.x=e.x+s*a+c*i,r.y=e.y+s*i-c*a}else r.x=e.x+n,r.y=e.y}function Qi(e,t){return e.parent==t.parent?1:2}function Ki(e){var t=e.children;return t.length?t[0]:e.t}function eo(e){var t,r=e.children;return(t=r.length)?r[t-1]:e.t}function to(e,t,r){var n=r/(t.i-e.i);t.c-=n,t.s+=r,e.c+=n,t.z+=r,t.m+=r}function ro(e,t,r){return e.a.parent===t.parent?e.a:r}function no(e){return{x:e.x,y:e.y,dx:e.dx,dy:e.dy}}function ao(e,t){var r=e.x+t[3],n=e.y+t[0],a=e.dx-t[1]-t[3],i=e.dy-t[0]-t[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 io(e){var t=e[0],r=e[e.length-1];return t<r?[t,r]:[r,t]}function oo(e){return e.rangeExtent?e.rangeExtent():io(e.range())}function lo(e,t,r,n){var a=r(e[0],e[1]),i=n(t[0],t[1]);return function(e){return i(a(e))}}function so(e,t){var r,n=0,a=e.length-1,i=e[n],o=e[a];return o<i&&(r=n,n=a,a=r,r=i,i=o,o=r),e[n]=t.floor(i),e[a]=t.ceil(o),e}function co(e){return e?{floor:function(t){return Math.floor(t/e)*e},ceil:function(t){return Math.ceil(t/e)*e}}:uo}e.layout.histogram=function(){var t=!0,r=Number,n=Vi,a=Hi;function i(i,o){for(var l,s,c=[],u=i.map(r,this),f=n.call(this,u,o),d=a.call(this,f,u,o),p=(o=-1,u.length),h=d.length-1,g=t?1:1/p;++o<h;)(l=c[o]=[]).dx=d[o+1]-(l.x=d[o]),l.y=0;if(h>0)for(o=-1;++o<p;)(s=u[o])>=f[0]&&s<=f[1]&&((l=c[e.bisect(d,s,1,h)-1]).y+=g,l.push(i[o]));return c}return i.value=function(e){return arguments.length?(r=e,i):r},i.range=function(e){return arguments.length?(n=vt(e),i):n},i.bins=function(e){return arguments.length?(a="number"==typeof e?function(t){return qi(t,e)}:vt(e),i):a},i.frequency=function(e){return arguments.length?(t=!!e,i):t},i},e.layout.pack=function(){var t,r=e.layout.hierarchy().sort(Ui),n=0,a=[1,1];function i(e,i){var o=r.call(this,e,i),l=o[0],s=a[0],c=a[1],u=null==t?Math.sqrt:"function"==typeof t?t:function(){return t};if(l.x=l.y=0,Mi(l,function(e){e.r=+u(e.value)}),Mi(l,Xi),n){var f=n*(t?1:Math.max(2*l.r/s,2*l.r/c))/2;Mi(l,function(e){e.r+=f}),Mi(l,Xi),Mi(l,function(e){e.r-=f})}return function e(t,r,n,a){var i=t.children;t.x=r+=a*t.x;t.y=n+=a*t.y;t.r*=a;if(i)for(var o=-1,l=i.length;++o<l;)e(i[o],r,n,a)}(l,s/2,c/2,t?1:1/Math.max(2*l.r/s,2*l.r/c)),o}return i.size=function(e){return arguments.length?(a=e,i):a},i.radius=function(e){return arguments.length?(t=null==e||"function"==typeof e?e:+e,i):t},i.padding=function(e){return arguments.length?(n=+e,i):n},ki(i,r)},e.layout.tree=function(){var t=e.layout.hierarchy().sort(null).value(null),r=Qi,n=[1,1],a=null;function i(e,i){var c=t.call(this,e,i),u=c[0],f=function(e){var t,r={A:null,children:[e]},n=[r];for(;null!=(t=n.pop());)for(var a,i=t.children,o=0,l=i.length;o<l;++o)n.push((i[o]=a={_:i[o],parent:t,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]}(u);if(Mi(f,o),f.parent.m=-f.z,Ti(f,l),a)Ti(u,s);else{var d=u,p=u,h=u;Ti(u,function(e){e.x<d.x&&(d=e),e.x>p.x&&(p=e),e.depth>h.depth&&(h=e)});var g=r(d,p)/2-d.x,v=n[0]/(p.x+r(p,d)/2+g),m=n[1]/(h.depth||1);Ti(u,function(e){e.x=(e.x+g)*v,e.y=e.depth*m})}return c}function o(e){var t=e.children,n=e.parent.children,a=e.i?n[e.i-1]:null;if(t.length){!function(e){var t,r=0,n=0,a=e.children,i=a.length;for(;--i>=0;)(t=a[i]).z+=r,t.m+=r,r+=t.s+(n+=t.c)}(e);var i=(t[0].z+t[t.length-1].z)/2;a?(e.z=a.z+r(e._,a._),e.m=e.z-i):e.z=i}else a&&(e.z=a.z+r(e._,a._));e.parent.A=function(e,t,n){if(t){for(var a,i=e,o=e,l=t,s=i.parent.children[0],c=i.m,u=o.m,f=l.m,d=s.m;l=eo(l),i=Ki(i),l&&i;)s=Ki(s),(o=eo(o)).a=e,(a=l.z+f-i.z-c+r(l._,i._))>0&&(to(ro(l,e,n),e,a),c+=a,u+=a),f+=l.m,c+=i.m,d+=s.m,u+=o.m;l&&!eo(o)&&(o.t=l,o.m+=f-u),i&&!Ki(s)&&(s.t=i,s.m+=c-d,n=e)}return n}(e,a,e.parent.A||n[0])}function l(e){e._.x=e.z+e.parent.m,e.m+=e.parent.m}function s(e){e.x*=n[0],e.y=e.depth*n[1]}return i.separation=function(e){return arguments.length?(r=e,i):r},i.size=function(e){return arguments.length?(a=null==(n=e)?s:null,i):a?null:n},i.nodeSize=function(e){return arguments.length?(a=null==(n=e)?null:s,i):a?n:null},ki(i,t)},e.layout.cluster=function(){var t=e.layout.hierarchy().sort(null).value(null),r=Qi,n=[1,1],a=!1;function i(i,o){var l,s=t.call(this,i,o),c=s[0],u=0;Mi(c,function(t){var n=t.children;n&&n.length?(t.x=function(e){return e.reduce(function(e,t){return e+t.x},0)/e.length}(n),t.y=function(t){return 1+e.max(t,function(e){return e.y})}(n)):(t.x=l?u+=r(t,l):0,t.y=0,l=t)});var f=function e(t){var r=t.children;return r&&r.length?e(r[0]):t}(c),d=function e(t){var r,n=t.children;return n&&(r=n.length)?e(n[r-1]):t}(c),p=f.x-r(f,d)/2,h=d.x+r(d,f)/2;return Mi(c,a?function(e){e.x=(e.x-c.x)*n[0],e.y=(c.y-e.y)*n[1]}:function(e){e.x=(e.x-p)/(h-p)*n[0],e.y=(1-(c.y?e.y/c.y:1))*n[1]}),s}return i.separation=function(e){return arguments.length?(r=e,i):r},i.size=function(e){return arguments.length?(a=null==(n=e),i):a?null:n},i.nodeSize=function(e){return arguments.length?(a=null!=(n=e),i):a?n:null},ki(i,t)},e.layout.treemap=function(){var t,r=e.layout.hierarchy(),n=Math.round,a=[1,1],i=null,o=no,l=!1,s="squarify",c=.5*(1+Math.sqrt(5));function u(e,t){for(var r,n,a=-1,i=e.length;++a<i;)n=(r=e[a]).value*(t<0?0:t),r.area=isNaN(n)||n<=0?0:n}function f(e){var t=e.children;if(t&&t.length){var r,n,a,i=o(e),l=[],c=t.slice(),d=1/0,g="slice"===s?i.dx:"dice"===s?i.dy:"slice-dice"===s?1&e.depth?i.dy:i.dx:Math.min(i.dx,i.dy);for(u(c,i.dx*i.dy/e.value),l.area=0;(a=c.length)>0;)l.push(r=c[a-1]),l.area+=r.area,"squarify"!==s||(n=p(l,g))<=d?(c.pop(),d=n):(l.area-=l.pop().area,h(l,g,i,!1),g=Math.min(i.dx,i.dy),l.length=l.area=0,d=1/0);l.length&&(h(l,g,i,!0),l.length=l.area=0),t.forEach(f)}}function d(e){var t=e.children;if(t&&t.length){var r,n=o(e),a=t.slice(),i=[];for(u(a,n.dx*n.dy/e.value),i.area=0;r=a.pop();)i.push(r),i.area+=r.area,null!=r.z&&(h(i,r.z?n.dx:n.dy,n,!a.length),i.length=i.area=0);t.forEach(d)}}function p(e,t){for(var r,n=e.area,a=0,i=1/0,o=-1,l=e.length;++o<l;)(r=e[o].area)&&(r<i&&(i=r),r>a&&(a=r));return t*=t,(n*=n)?Math.max(t*a*c/n,n/(t*i*c)):1/0}function h(e,t,r,a){var i,o=-1,l=e.length,s=r.x,c=r.y,u=t?n(e.area/t):0;if(t==r.dx){for((a||u>r.dy)&&(u=r.dy);++o<l;)(i=e[o]).x=s,i.y=c,i.dy=u,s+=i.dx=Math.min(r.x+r.dx-s,u?n(i.area/u):0);i.z=!0,i.dx+=r.x+r.dx-s,r.y+=u,r.dy-=u}else{for((a||u>r.dx)&&(u=r.dx);++o<l;)(i=e[o]).x=s,i.y=c,i.dx=u,c+=i.dy=Math.min(r.y+r.dy-c,u?n(i.area/u):0);i.z=!1,i.dy+=r.y+r.dy-c,r.x+=u,r.dx-=u}}function g(e){var n=t||r(e),i=n[0];return i.x=i.y=0,i.value?(i.dx=a[0],i.dy=a[1]):i.dx=i.dy=0,t&&r.revalue(i),u([i],i.dx*i.dy/i.value),(t?d:f)(i),l&&(t=n),n}return g.size=function(e){return arguments.length?(a=e,g):a},g.padding=function(e){if(!arguments.length)return i;function t(t){return ao(t,e)}var r;return o=null==(i=e)?no:"function"==(r=typeof e)?function(t){var r=e.call(g,t,t.depth);return null==r?no(t):ao(t,"number"==typeof r?[r,r,r,r]:r)}:"number"===r?(e=[e,e,e,e],t):t,g},g.round=function(e){return arguments.length?(n=e?Math.round:Number,g):n!=Number},g.sticky=function(e){return arguments.length?(l=e,t=null,g):l},g.ratio=function(e){return arguments.length?(c=e,g):c},g.mode=function(e){return arguments.length?(s=e+"",g):s},ki(g,r)},e.random={normal:function(e,t){var r=arguments.length;return r<2&&(t=1),r<1&&(e=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 e+t*r*Math.sqrt(-2*Math.log(a)/a)}},logNormal:function(){var t=e.random.normal.apply(e,arguments);return function(){return Math.exp(t())}},bates:function(t){var r=e.random.irwinHall(t);return function(){return r()/t}},irwinHall:function(e){return function(){for(var t=0,r=0;r<e;r++)t+=Math.random();return t}}},e.scale={};var uo={floor:P,ceil:P};function fo(t,r,n,a){var i=[],o=[],l=0,s=Math.min(t.length,r.length)-1;for(t[s]<t[0]&&(t=t.slice().reverse(),r=r.slice().reverse());++l<=s;)i.push(n(t[l-1],t[l])),o.push(a(r[l-1],r[l]));return function(r){var n=e.bisect(t,r,1,s)-1;return o[n](i[n](r))}}function po(t,r){return e.rebind(t,r,"range","rangeRound","interpolate","clamp")}function ho(e,t){return so(e,co(go(e,t)[2])),so(e,co(go(e,t)[2])),e}function go(e,t){null==t&&(t=10);var r=io(e),n=r[1]-r[0],a=Math.pow(10,Math.floor(Math.log(n/t)/Math.LN10)),i=t/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 vo(t,r){return e.range.apply(e,go(t,r))}function mo(t,r,n){var a=go(t,r);if(n){var i=Ot.exec(n);if(i.shift(),"s"===i[8]){var o=e.formatPrefix(Math.max(y(a[0]),y(a[1])));return i[7]||(i[7]="."+xo(o.scale(a[2]))),i[8]="f",n=e.format(i.join("")),function(e){return n(o.scale(e))+o.symbol}}i[7]||(i[7]="."+function(e,t){var r=xo(t[2]);return e in yo?Math.abs(r-xo(Math.max(y(t[0]),y(t[1]))))+ +("e"!==e):r-2*("%"===e)}(i[8],a)),n=i.join("")}else n=",."+xo(a[2])+"f";return e.format(n)}e.scale.linear=function(){return function e(t,r,n,a){var i,o;function l(){var e=Math.min(t.length,r.length)>2?fo:lo,l=a?pi:di;return i=e(t,r,l,n),o=e(r,t,l,Ga),s}function s(e){return i(e)}s.invert=function(e){return o(e)};s.domain=function(e){return arguments.length?(t=e.map(Number),l()):t};s.range=function(e){return arguments.length?(r=e,l()):r};s.rangeRound=function(e){return s.range(e).interpolate(ii)};s.clamp=function(e){return arguments.length?(a=e,l()):a};s.interpolate=function(e){return arguments.length?(n=e,l()):n};s.ticks=function(e){return vo(t,e)};s.tickFormat=function(e,r){return mo(t,e,r)};s.nice=function(e){return ho(t,e),l()};s.copy=function(){return e(t,r,n,a)};return l()}([0,1],[0,1],Ga,!1)};var yo={s:1,g:1,p:1,r:1,e:1};function xo(e){return-Math.floor(Math.log(e)/Math.LN10+.01)}e.scale.log=function(){return function t(r,n,a,i){function o(e){return(a?Math.log(e<0?0:e):-Math.log(e>0?0:-e))/Math.log(n)}function l(e){return a?Math.pow(n,e):-Math.pow(n,-e)}function s(e){return r(o(e))}s.invert=function(e){return l(r.invert(e))};s.domain=function(e){return arguments.length?(a=e[0]>=0,r.domain((i=e.map(Number)).map(o)),s):i};s.base=function(e){return arguments.length?(n=+e,r.domain(i.map(o)),s):n};s.nice=function(){var e=so(i.map(o),a?Math:_o);return r.domain(e),i=e.map(l),s};s.ticks=function(){var e=io(i),t=[],r=e[0],s=e[1],c=Math.floor(o(r)),u=Math.ceil(o(s)),f=n%1?2:n;if(isFinite(u-c)){if(a){for(;c<u;c++)for(var d=1;d<f;d++)t.push(l(c)*d);t.push(l(c))}else for(t.push(l(c));c++<u;)for(var d=f-1;d>0;d--)t.push(l(c)*d);for(c=0;t[c]<r;c++);for(u=t.length;t[u-1]>s;u--);t=t.slice(c,u)}return t};s.tickFormat=function(t,r){if(!arguments.length)return bo;arguments.length<2?r=bo:"function"!=typeof r&&(r=e.format(r));var a=Math.max(1,n*t/s.ticks().length);return function(e){var t=e/l(Math.round(o(e)));return t*n<n-.5&&(t*=n),t<=a?r(e):""}};s.copy=function(){return t(r.copy(),n,a,i)};return po(s,r)}(e.scale.linear().domain([0,1]),10,!0,[1,10])};var bo=e.format(".0e"),_o={floor:function(e){return-Math.ceil(-e)},ceil:function(e){return-Math.floor(-e)}};function wo(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}e.scale.pow=function(){return function e(t,r,n){var a=wo(r),i=wo(1/r);function o(e){return t(a(e))}o.invert=function(e){return i(t.invert(e))};o.domain=function(e){return arguments.length?(t.domain((n=e.map(Number)).map(a)),o):n};o.ticks=function(e){return vo(n,e)};o.tickFormat=function(e,t){return mo(n,e,t)};o.nice=function(e){return o.domain(ho(n,e))};o.exponent=function(e){return arguments.length?(a=wo(r=e),i=wo(1/r),t.domain(n.map(a)),o):r};o.copy=function(){return e(t.copy(),r,n)};return po(o,t)}(e.scale.linear(),1,[0,1])},e.scale.sqrt=function(){return e.scale.pow().exponent(.5)},e.scale.ordinal=function(){return function t(r,n){var a,i,o;function l(e){return i[((a.get(e)||("range"===n.t?a.set(e,r.push(e)):NaN))-1)%i.length]}function s(t,n){return e.range(r.length).map(function(e){return t+n*e})}l.domain=function(e){if(!arguments.length)return r;r=[],a=new b;for(var t,i=-1,o=e.length;++i<o;)a.has(t=e[i])||a.set(t,r.push(t));return l[n.t].apply(l,n.a)};l.range=function(e){return arguments.length?(i=e,o=0,n={t:"range",a:arguments},l):i};l.rangePoints=function(e,t){arguments.length<2&&(t=0);var a=e[0],c=e[1],u=r.length<2?(a=(a+c)/2,0):(c-a)/(r.length-1+t);return i=s(a+u*t/2,u),o=0,n={t:"rangePoints",a:arguments},l};l.rangeRoundPoints=function(e,t){arguments.length<2&&(t=0);var a=e[0],c=e[1],u=r.length<2?(a=c=Math.round((a+c)/2),0):(c-a)/(r.length-1+t)|0;return i=s(a+Math.round(u*t/2+(c-a-(r.length-1+t)*u)/2),u),o=0,n={t:"rangeRoundPoints",a:arguments},l};l.rangeBands=function(e,t,a){arguments.length<2&&(t=0),arguments.length<3&&(a=t);var c=e[1]<e[0],u=e[c-0],f=e[1-c],d=(f-u)/(r.length-t+2*a);return i=s(u+d*a,d),c&&i.reverse(),o=d*(1-t),n={t:"rangeBands",a:arguments},l};l.rangeRoundBands=function(e,t,a){arguments.length<2&&(t=0),arguments.length<3&&(a=t);var c=e[1]<e[0],u=e[c-0],f=e[1-c],d=Math.floor((f-u)/(r.length-t+2*a));return i=s(u+Math.round((f-u-(r.length-t)*d)/2),d),c&&i.reverse(),o=Math.round(d*(1-t)),n={t:"rangeRoundBands",a:arguments},l};l.rangeBand=function(){return o};l.rangeExtent=function(){return io(n.a[0])};l.copy=function(){return t(r,n)};return l.domain(r)}([],{t:"range",a:[[]]})},e.scale.category10=function(){return e.scale.ordinal().range(ko)},e.scale.category20=function(){return e.scale.ordinal().range(To)},e.scale.category20b=function(){return e.scale.ordinal().range(Mo)},e.scale.category20c=function(){return e.scale.ordinal().range(Ao)};var ko=[2062260,16744206,2924588,14034728,9725885,9197131,14907330,8355711,12369186,1556175].map(lt),To=[2062260,11454440,16744206,16759672,2924588,10018698,14034728,16750742,9725885,12955861,9197131,12885140,14907330,16234194,8355711,13092807,12369186,14408589,1556175,10410725].map(lt),Mo=[3750777,5395619,7040719,10264286,6519097,9216594,11915115,13556636,9202993,12426809,15186514,15190932,8666169,11356490,14049643,15177372,8077683,10834324,13528509,14589654].map(lt),Ao=[3244733,7057110,10406625,13032431,15095053,16616764,16625259,16634018,3253076,7652470,10607003,13101504,7695281,10394312,12369372,14342891,6513507,9868950,12434877,14277081].map(lt);function Lo(){return 0}e.scale.quantile=function(){return function t(r,n){var a;function i(){var t=0,i=n.length;for(a=[];++t<i;)a[t-1]=e.quantile(r,t/i);return o}function o(t){if(!isNaN(t=+t))return n[e.bisect(a,t)]}o.domain=function(e){return arguments.length?(r=e.map(p).filter(h).sort(d),i()):r};o.range=function(e){return arguments.length?(n=e,i()):n};o.quantiles=function(){return a};o.invertExtent=function(e){return(e=n.indexOf(e))<0?[NaN,NaN]:[e>0?a[e-1]:r[0],e<a.length?a[e]:r[r.length-1]]};o.copy=function(){return t(r,n)};return i()}([],[])},e.scale.quantize=function(){return function e(t,r,n){var a,i;function o(e){return n[Math.max(0,Math.min(i,Math.floor(a*(e-t))))]}function l(){return a=n.length/(r-t),i=n.length-1,o}o.domain=function(e){return arguments.length?(t=+e[0],r=+e[e.length-1],l()):[t,r]};o.range=function(e){return arguments.length?(n=e,l()):n};o.invertExtent=function(e){return[e=(e=n.indexOf(e))<0?NaN:e/a+t,e+1/a]};o.copy=function(){return e(t,r,n)};return l()}(0,1,[0,1])},e.scale.threshold=function(){return function t(r,n){function a(t){if(t<=t)return n[e.bisect(r,t)]}a.domain=function(e){return arguments.length?(r=e,a):r};a.range=function(e){return arguments.length?(n=e,a):n};a.invertExtent=function(e){return e=n.indexOf(e),[r[e-1],r[e]]};a.copy=function(){return t(r,n)};return a}([.5],[0,1])},e.scale.identity=function(){return function e(t){function r(e){return+e}r.invert=r;r.domain=r.range=function(e){return arguments.length?(t=e.map(r),r):t};r.ticks=function(e){return vo(t,e)};r.tickFormat=function(e,r){return mo(t,e,r)};r.copy=function(){return e(t)};return r}([0,1])},e.svg={},e.svg.arc=function(){var e=Co,t=Oo,r=Lo,n=So,a=Po,i=Do,o=zo;function l(){var l=Math.max(0,+e.apply(this,arguments)),c=Math.max(0,+t.apply(this,arguments)),u=a.apply(this,arguments)-Se,f=i.apply(this,arguments)-Se,d=Math.abs(f-u),p=u>f?0:1;if(c<l&&(h=c,c=l,l=h),d>=Le)return s(c,p)+(l?s(l,1-p):"")+"Z";var h,g,v,m,y,x,b,_,w,k,T,M,A=0,L=0,S=[];if((m=(+o.apply(this,arguments)||0)/2)&&(v=n===So?Math.sqrt(l*l+c*c):+n.apply(this,arguments),p||(L*=-1),c&&(L=Re(v/c*Math.sin(m))),l&&(A=Re(v/l*Math.sin(m)))),c){y=c*Math.cos(u+L),x=c*Math.sin(u+L),b=c*Math.cos(f-L),_=c*Math.sin(f-L);var C=Math.abs(f-u-2*L)<=Me?0:1;if(L&&Ro(y,x,b,_)===p^C){var O=(u+f)/2;y=c*Math.cos(O),x=c*Math.sin(O),b=_=null}}else y=x=0;if(l){w=l*Math.cos(f-A),k=l*Math.sin(f-A),T=l*Math.cos(u+A),M=l*Math.sin(u+A);var P=Math.abs(u-f+2*A)<=Me?0:1;if(A&&Ro(w,k,T,M)===1-p^P){var D=(u+f)/2;w=l*Math.cos(D),k=l*Math.sin(D),T=M=null}}else w=k=0;if(d>ke&&(h=Math.min(Math.abs(c-l)/2,+r.apply(this,arguments)))>.001){g=l<c^p?0:1;var z=h,R=h;if(d<Me){var E=null==T?[w,k]:null==b?[y,x]:ia([y,x],[T,M],[b,_],[w,k]),I=y-E[0],F=x-E[1],N=b-E[0],j=_-E[1],B=1/Math.sin(Math.acos((I*N+F*j)/(Math.sqrt(I*I+F*F)*Math.sqrt(N*N+j*j)))/2),H=Math.sqrt(E[0]*E[0]+E[1]*E[1]);R=Math.min(h,(l-H)/(B-1)),z=Math.min(h,(c-H)/(B+1))}if(null!=b){var q=Eo(null==T?[w,k]:[T,M],[y,x],c,z,p),V=Eo([b,_],[w,k],c,z,p);h===z?S.push("M",q[0],"A",z,",",z," 0 0,",g," ",q[1],"A",c,",",c," 0 ",1-p^Ro(q[1][0],q[1][1],V[1][0],V[1][1]),",",p," ",V[1],"A",z,",",z," 0 0,",g," ",V[0]):S.push("M",q[0],"A",z,",",z," 0 1,",g," ",V[0])}else S.push("M",y,",",x);if(null!=T){var U=Eo([y,x],[T,M],l,-R,p),G=Eo([w,k],null==b?[y,x]:[b,_],l,-R,p);h===R?S.push("L",G[0],"A",R,",",R," 0 0,",g," ",G[1],"A",l,",",l," 0 ",p^Ro(G[1][0],G[1][1],U[1][0],U[1][1]),",",1-p," ",U[1],"A",R,",",R," 0 0,",g," ",U[0]):S.push("L",G[0],"A",R,",",R," 0 0,",g," ",U[0])}else S.push("L",w,",",k)}else S.push("M",y,",",x),null!=b&&S.push("A",c,",",c," 0 ",C,",",p," ",b,",",_),S.push("L",w,",",k),null!=T&&S.push("A",l,",",l," 0 ",P,",",1-p," ",T,",",M);return S.push("Z"),S.join("")}function s(e,t){return"M0,"+e+"A"+e+","+e+" 0 1,"+t+" 0,"+-e+"A"+e+","+e+" 0 1,"+t+" 0,"+e}return l.innerRadius=function(t){return arguments.length?(e=vt(t),l):e},l.outerRadius=function(e){return arguments.length?(t=vt(e),l):t},l.cornerRadius=function(e){return arguments.length?(r=vt(e),l):r},l.padRadius=function(e){return arguments.length?(n=e==So?So:vt(e),l):n},l.startAngle=function(e){return arguments.length?(a=vt(e),l):a},l.endAngle=function(e){return arguments.length?(i=vt(e),l):i},l.padAngle=function(e){return arguments.length?(o=vt(e),l):o},l.centroid=function(){var r=(+e.apply(this,arguments)+ +t.apply(this,arguments))/2,n=(+a.apply(this,arguments)+ +i.apply(this,arguments))/2-Se;return[Math.cos(n)*r,Math.sin(n)*r]},l};var So="auto";function Co(e){return e.innerRadius}function Oo(e){return e.outerRadius}function Po(e){return e.startAngle}function Do(e){return e.endAngle}function zo(e){return e&&e.padAngle}function Ro(e,t,r,n){return(e-r)*t-(t-n)*e>0?0:1}function Eo(e,t,r,n,a){var i=e[0]-t[0],o=e[1]-t[1],l=(a?n:-n)/Math.sqrt(i*i+o*o),s=l*o,c=-l*i,u=e[0]+s,f=e[1]+c,d=t[0]+s,p=t[1]+c,h=(u+d)/2,g=(f+p)/2,v=d-u,m=p-f,y=v*v+m*m,x=r-n,b=u*p-d*f,_=(m<0?-1:1)*Math.sqrt(Math.max(0,x*x*y-b*b)),w=(b*m-v*_)/y,k=(-b*v-m*_)/y,T=(b*m+v*_)/y,M=(-b*v+m*_)/y,A=w-h,L=k-g,S=T-h,C=M-g;return A*A+L*L>S*S+C*C&&(w=T,k=M),[[w-s,k-c],[w*r/x,k*r/x]]}function Io(e){var t=Kn,r=ea,n=Zr,a=No,i=a.key,o=.7;function l(i){var l,s=[],c=[],u=-1,f=i.length,d=vt(t),p=vt(r);function h(){s.push("M",a(e(c),o))}for(;++u<f;)n.call(this,l=i[u],u)?c.push([+d.call(this,l,u),+p.call(this,l,u)]):c.length&&(h(),c=[]);return c.length&&h(),s.length?s.join(""):null}return l.x=function(e){return arguments.length?(t=e,l):t},l.y=function(e){return arguments.length?(r=e,l):r},l.defined=function(e){return arguments.length?(n=e,l):n},l.interpolate=function(e){return arguments.length?(i="function"==typeof e?a=e:(a=Fo.get(e)||No).key,l):i},l.tension=function(e){return arguments.length?(o=e,l):o},l}e.svg.line=function(){return Io(P)};var Fo=e.map({linear:No,"linear-closed":jo,step:function(e){var t=0,r=e.length,n=e[0],a=[n[0],",",n[1]];for(;++t<r;)a.push("H",(n[0]+(n=e[t])[0])/2,"V",n[1]);r>1&&a.push("H",n[0]);return a.join("")},"step-before":Bo,"step-after":Ho,basis:Uo,"basis-open":function(e){if(e.length<4)return No(e);var t,r=[],n=-1,a=e.length,i=[0],o=[0];for(;++n<3;)t=e[n],i.push(t[0]),o.push(t[1]);r.push(Go(Xo,i)+","+Go(Xo,o)),--n;for(;++n<a;)t=e[n],i.shift(),i.push(t[0]),o.shift(),o.push(t[1]),Wo(r,i,o);return r.join("")},"basis-closed":function(e){var t,r,n=-1,a=e.length,i=a+4,o=[],l=[];for(;++n<4;)r=e[n%a],o.push(r[0]),l.push(r[1]);t=[Go(Xo,o),",",Go(Xo,l)],--n;for(;++n<i;)r=e[n%a],o.shift(),o.push(r[0]),l.shift(),l.push(r[1]),Wo(t,o,l);return t.join("")},bundle:function(e,t){var r=e.length-1;if(r)for(var n,a,i=e[0][0],o=e[0][1],l=e[r][0]-i,s=e[r][1]-o,c=-1;++c<=r;)n=e[c],a=c/r,n[0]=t*n[0]+(1-t)*(i+a*l),n[1]=t*n[1]+(1-t)*(o+a*s);return Uo(e)},cardinal:function(e,t){return e.length<3?No(e):e[0]+qo(e,Vo(e,t))},"cardinal-open":function(e,t){return e.length<4?No(e):e[1]+qo(e.slice(1,-1),Vo(e,t))},"cardinal-closed":function(e,t){return e.length<3?jo(e):e[0]+qo((e.push(e[0]),e),Vo([e[e.length-2]].concat(e,[e[1]]),t))},monotone:function(e){return e.length<3?No(e):e[0]+qo(e,function(e){var t,r,n,a,i=[],o=function(e){var t=0,r=e.length-1,n=[],a=e[0],i=e[1],o=n[0]=$o(a,i);for(;++t<r;)n[t]=(o+(o=$o(a=i,i=e[t+1])))/2;return n[t]=o,n}(e),l=-1,s=e.length-1;for(;++l<s;)t=$o(e[l],e[l+1]),y(t)<ke?o[l]=o[l+1]=0:(r=o[l]/t,n=o[l+1]/t,(a=r*r+n*n)>9&&(a=3*t/Math.sqrt(a),o[l]=a*r,o[l+1]=a*n));l=-1;for(;++l<=s;)a=(e[Math.min(s,l+1)][0]-e[Math.max(0,l-1)][0])/(6*(1+o[l]*o[l])),i.push([a||0,o[l]*a||0]);return i}(e))}});function No(e){return e.length>1?e.join("L"):e+"Z"}function jo(e){return e.join("L")+"Z"}function Bo(e){for(var t=0,r=e.length,n=e[0],a=[n[0],",",n[1]];++t<r;)a.push("V",(n=e[t])[1],"H",n[0]);return a.join("")}function Ho(e){for(var t=0,r=e.length,n=e[0],a=[n[0],",",n[1]];++t<r;)a.push("H",(n=e[t])[0],"V",n[1]);return a.join("")}function qo(e,t){if(t.length<1||e.length!=t.length&&e.length!=t.length+2)return No(e);var r=e.length!=t.length,n="",a=e[0],i=e[1],o=t[0],l=o,s=1;if(r&&(n+="Q"+(i[0]-2*o[0]/3)+","+(i[1]-2*o[1]/3)+","+i[0]+","+i[1],a=e[1],s=2),t.length>1){l=t[1],i=e[s],s++,n+="C"+(a[0]+o[0])+","+(a[1]+o[1])+","+(i[0]-l[0])+","+(i[1]-l[1])+","+i[0]+","+i[1];for(var c=2;c<t.length;c++,s++)i=e[s],l=t[c],n+="S"+(i[0]-l[0])+","+(i[1]-l[1])+","+i[0]+","+i[1]}if(r){var u=e[s];n+="Q"+(i[0]+2*l[0]/3)+","+(i[1]+2*l[1]/3)+","+u[0]+","+u[1]}return n}function Vo(e,t){for(var r,n=[],a=(1-t)/2,i=e[0],o=e[1],l=1,s=e.length;++l<s;)r=i,i=o,o=e[l],n.push([a*(o[0]-r[0]),a*(o[1]-r[1])]);return n}function Uo(e){if(e.length<3)return No(e);var t=1,r=e.length,n=e[0],a=n[0],i=n[1],o=[a,a,a,(n=e[1])[0]],l=[i,i,i,n[1]],s=[a,",",i,"L",Go(Xo,o),",",Go(Xo,l)];for(e.push(e[r-1]);++t<=r;)n=e[t],o.shift(),o.push(n[0]),l.shift(),l.push(n[1]),Wo(s,o,l);return e.pop(),s.push("L",n),s.join("")}function Go(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}Fo.forEach(function(e,t){t.key=e,t.closed=/-closed$/.test(e)});var Zo=[0,2/3,1/3,0],Yo=[0,1/3,2/3,0],Xo=[0,1/6,2/3,1/6];function Wo(e,t,r){e.push("C",Go(Zo,t),",",Go(Zo,r),",",Go(Yo,t),",",Go(Yo,r),",",Go(Xo,t),",",Go(Xo,r))}function $o(e,t){return(t[1]-e[1])/(t[0]-e[0])}function Jo(e){for(var t,r,n,a=-1,i=e.length;++a<i;)r=(t=e[a])[0],n=t[1]-Se,t[0]=r*Math.cos(n),t[1]=r*Math.sin(n);return e}function Qo(e){var t=Kn,r=Kn,n=0,a=ea,i=Zr,o=No,l=o.key,s=o,c="L",u=.7;function f(l){var f,d,p,h=[],g=[],v=[],m=-1,y=l.length,x=vt(t),b=vt(n),_=t===r?function(){return d}:vt(r),w=n===a?function(){return p}:vt(a);function k(){h.push("M",o(e(v),u),c,s(e(g.reverse()),u),"Z")}for(;++m<y;)i.call(this,f=l[m],m)?(g.push([d=+x.call(this,f,m),p=+b.call(this,f,m)]),v.push([+_.call(this,f,m),+w.call(this,f,m)])):g.length&&(k(),g=[],v=[]);return g.length&&k(),h.length?h.join(""):null}return f.x=function(e){return arguments.length?(t=r=e,f):r},f.x0=function(e){return arguments.length?(t=e,f):t},f.x1=function(e){return arguments.length?(r=e,f):r},f.y=function(e){return arguments.length?(n=a=e,f):a},f.y0=function(e){return arguments.length?(n=e,f):n},f.y1=function(e){return arguments.length?(a=e,f):a},f.defined=function(e){return arguments.length?(i=e,f):i},f.interpolate=function(e){return arguments.length?(l="function"==typeof e?o=e:(o=Fo.get(e)||No).key,s=o.reverse||o,c=o.closed?"M":"L",f):l},f.tension=function(e){return arguments.length?(u=e,f):u},f}function Ko(e){return e.radius}function el(e){return[e.x,e.y]}function tl(){return 64}function rl(){return"circle"}function nl(e){var t=Math.sqrt(e/Me);return"M0,"+t+"A"+t+","+t+" 0 1,1 0,"+-t+"A"+t+","+t+" 0 1,1 0,"+t+"Z"}e.svg.line.radial=function(){var e=Io(Jo);return e.radius=e.x,delete e.x,e.angle=e.y,delete e.y,e},Bo.reverse=Ho,Ho.reverse=Bo,e.svg.area=function(){return Qo(P)},e.svg.area.radial=function(){var e=Qo(Jo);return e.radius=e.x,delete e.x,e.innerRadius=e.x0,delete e.x0,e.outerRadius=e.x1,delete e.x1,e.angle=e.y,delete e.y,e.startAngle=e.y0,delete e.y0,e.endAngle=e.y1,delete e.y1,e},e.svg.chord=function(){var e=jn,t=Bn,r=Ko,n=Po,a=Do;function i(r,n){var a,i,c=o(this,e,r,n),u=o(this,t,r,n);return"M"+c.p0+l(c.r,c.p1,c.a1-c.a0)+(i=u,(a=c).a0==i.a0&&a.a1==i.a1?s(c.r,c.p1,c.r,c.p0):s(c.r,c.p1,u.r,u.p0)+l(u.r,u.p1,u.a1-u.a0)+s(u.r,u.p1,c.r,c.p0))+"Z"}function o(e,t,i,o){var l=t.call(e,i,o),s=r.call(e,l,o),c=n.call(e,l,o)-Se,u=a.call(e,l,o)-Se;return{r:s,a0:c,a1:u,p0:[s*Math.cos(c),s*Math.sin(c)],p1:[s*Math.cos(u),s*Math.sin(u)]}}function l(e,t,r){return"A"+e+","+e+" 0 "+ +(r>Me)+",1 "+t}function s(e,t,r,n){return"Q 0,0 "+n}return i.radius=function(e){return arguments.length?(r=vt(e),i):r},i.source=function(t){return arguments.length?(e=vt(t),i):e},i.target=function(e){return arguments.length?(t=vt(e),i):t},i.startAngle=function(e){return arguments.length?(n=vt(e),i):n},i.endAngle=function(e){return arguments.length?(a=vt(e),i):a},i},e.svg.diagonal=function(){var e=jn,t=Bn,r=el;function n(n,a){var i=e.call(this,n,a),o=t.call(this,n,a),l=(i.y+o.y)/2,s=[i,{x:i.x,y:l},{x:o.x,y:l},o];return"M"+(s=s.map(r))[0]+"C"+s[1]+" "+s[2]+" "+s[3]}return n.source=function(t){return arguments.length?(e=vt(t),n):e},n.target=function(e){return arguments.length?(t=vt(e),n):t},n.projection=function(e){return arguments.length?(r=e,n):r},n},e.svg.diagonal.radial=function(){var t=e.svg.diagonal(),r=el,n=t.projection;return t.projection=function(e){return arguments.length?n(function(e){return function(){var t=e.apply(this,arguments),r=t[0],n=t[1]-Se;return[r*Math.cos(n),r*Math.sin(n)]}}(r=e)):r},t},e.svg.symbol=function(){var e=rl,t=tl;function r(r,n){return(al.get(e.call(this,r,n))||nl)(t.call(this,r,n))}return r.type=function(t){return arguments.length?(e=vt(t),r):e},r.size=function(e){return arguments.length?(t=vt(e),r):t},r};var al=e.map({circle:nl,cross:function(e){var t=Math.sqrt(e/5)/2;return"M"+-3*t+","+-t+"H"+-t+"V"+-3*t+"H"+t+"V"+-t+"H"+3*t+"V"+t+"H"+t+"V"+3*t+"H"+-t+"V"+t+"H"+-3*t+"Z"},diamond:function(e){var t=Math.sqrt(e/(2*ol)),r=t*ol;return"M0,"+-t+"L"+r+",0 0,"+t+" "+-r+",0Z"},square:function(e){var t=Math.sqrt(e)/2;return"M"+-t+","+-t+"L"+t+","+-t+" "+t+","+t+" "+-t+","+t+"Z"},"triangle-down":function(e){var t=Math.sqrt(e/il),r=t*il/2;return"M0,"+r+"L"+t+","+-r+" "+-t+","+-r+"Z"},"triangle-up":function(e){var t=Math.sqrt(e/il),r=t*il/2;return"M0,"+-r+"L"+t+","+r+" "+-t+","+r+"Z"}});e.svg.symbolTypes=al.keys();var il=Math.sqrt(3),ol=Math.tan(30*Ce);Y.transition=function(e){for(var t,r,n=ul||++pl,a=vl(e),i=[],o=fl||{time:Date.now(),ease:ei,delay:0,duration:250},l=-1,s=this.length;++l<s;){i.push(t=[]);for(var c=this[l],u=-1,f=c.length;++u<f;)(r=c[u])&&ml(r,u,a,n,o),t.push(r)}return cl(i,a,n)},Y.interrupt=function(e){return this.each(null==e?ll:sl(vl(e)))};var ll=sl(vl());function sl(e){return function(){var t,r,n;(t=this[e])&&(n=t[r=t.active])&&(n.timer.c=null,n.timer.t=NaN,--t.count?delete t[r]:delete this[e],t.active+=.5,n.event&&n.event.interrupt.call(this,this.__data__,n.index))}}function cl(e,t,r){return q(e,dl),e.namespace=t,e.id=r,e}var ul,fl,dl=[],pl=0;function hl(e,t,r,n){var a=e.id,i=e.namespace;return ue(e,"function"==typeof r?function(e,o,l){e[i][a].tween.set(t,n(r.call(e,e.__data__,o,l)))}:(r=n(r),function(e){e[i][a].tween.set(t,r)}))}function gl(e){return null==e&&(e=""),function(){this.textContent=e}}function vl(e){return null==e?"__transition__":"__transition_"+e+"__"}function ml(e,t,r,n,a){var i,o,l,s,c,u=e[r]||(e[r]={active:0,count:0}),f=u[n];function d(r){var a=u.active,d=u[a];for(var h in d&&(d.timer.c=null,d.timer.t=NaN,--u.count,delete u[a],d.event&&d.event.interrupt.call(e,e.__data__,d.index)),u)if(+h<n){var g=u[h];g.timer.c=null,g.timer.t=NaN,--u.count,delete u[h]}o.c=p,Tt(function(){return o.c&&p(r||1)&&(o.c=null,o.t=NaN),1},0,i),u.active=n,f.event&&f.event.start.call(e,e.__data__,t),c=[],f.tween.forEach(function(r,n){(n=n.call(e,e.__data__,t))&&c.push(n)}),s=f.ease,l=f.duration}function p(a){for(var i=a/l,o=s(i),d=c.length;d>0;)c[--d].call(e,o);if(i>=1)return f.event&&f.event.end.call(e,e.__data__,t),--u.count?delete u[n]:delete e[r],1}f||(i=a.time,o=Tt(function(e){var t=f.delay;if(o.t=t+i,t<=e)return d(e-t);o.c=d},0,i),f=u[n]={tween:new b,time:i,timer:o,delay:a.delay,duration:a.duration,ease:a.ease,index:t},a=null,++u.count)}dl.call=Y.call,dl.empty=Y.empty,dl.node=Y.node,dl.size=Y.size,e.transition=function(t,r){return t&&t.transition?ul?t.transition(r):t:e.selection().transition(t)},e.transition.prototype=dl,dl.select=function(e){var t,r,n,a=this.id,i=this.namespace,o=[];e=X(e);for(var l=-1,s=this.length;++l<s;){o.push(t=[]);for(var c=this[l],u=-1,f=c.length;++u<f;)(n=c[u])&&(r=e.call(n,n.__data__,u,l))?("__data__"in n&&(r.__data__=n.__data__),ml(r,u,i,a,n[i][a]),t.push(r)):t.push(null)}return cl(o,i,a)},dl.selectAll=function(e){var t,r,n,a,i,o=this.id,l=this.namespace,s=[];e=W(e);for(var c=-1,u=this.length;++c<u;)for(var f=this[c],d=-1,p=f.length;++d<p;)if(n=f[d]){i=n[l][o],r=e.call(n,n.__data__,d,c),s.push(t=[]);for(var h=-1,g=r.length;++h<g;)(a=r[h])&&ml(a,h,l,o,i),t.push(a)}return cl(s,l,o)},dl.filter=function(e){var t,r,n=[];"function"!=typeof e&&(e=ce(e));for(var a=0,i=this.length;a<i;a++){n.push(t=[]);for(var o,l=0,s=(o=this[a]).length;l<s;l++)(r=o[l])&&e.call(r,r.__data__,l,a)&&t.push(r)}return cl(n,this.namespace,this.id)},dl.tween=function(e,t){var r=this.id,n=this.namespace;return arguments.length<2?this.node()[n][r].tween.get(e):ue(this,null==t?function(t){t[n][r].tween.remove(e)}:function(a){a[n][r].tween.set(e,t)})},dl.attr=function(t,r){if(arguments.length<2){for(r in t)this.attr(r,t[r]);return this}var n="transform"==t?fi:Ga,a=e.ns.qualify(t);function i(){this.removeAttribute(a)}function o(){this.removeAttributeNS(a.space,a.local)}return hl(this,"attr."+t,r,a.local?function(e){return null==e?o:(e+="",function(){var t,r=this.getAttributeNS(a.space,a.local);return r!==e&&(t=n(r,e),function(e){this.setAttributeNS(a.space,a.local,t(e))})})}:function(e){return null==e?i:(e+="",function(){var t,r=this.getAttribute(a);return r!==e&&(t=n(r,e),function(e){this.setAttribute(a,t(e))})})})},dl.attrTween=function(t,r){var n=e.ns.qualify(t);return this.tween("attr."+t,n.local?function(e,t){var a=r.call(this,e,t,this.getAttributeNS(n.space,n.local));return a&&function(e){this.setAttributeNS(n.space,n.local,a(e))}}:function(e,t){var a=r.call(this,e,t,this.getAttribute(n));return a&&function(e){this.setAttribute(n,a(e))}})},dl.style=function(e,t,r){var n=arguments.length;if(n<3){if("string"!=typeof e){for(r in n<2&&(t=""),e)this.style(r,e[r],t);return this}r=""}function a(){this.style.removeProperty(e)}return hl(this,"style."+e,t,function(t){return null==t?a:(t+="",function(){var n,a=o(this).getComputedStyle(this,null).getPropertyValue(e);return a!==t&&(n=Ga(a,t),function(t){this.style.setProperty(e,n(t),r)})})})},dl.styleTween=function(e,t,r){return arguments.length<3&&(r=""),this.tween("style."+e,function(n,a){var i=t.call(this,n,a,o(this).getComputedStyle(this,null).getPropertyValue(e));return i&&function(t){this.style.setProperty(e,i(t),r)}})},dl.text=function(e){return hl(this,"text",e,gl)},dl.remove=function(){var e=this.namespace;return this.each("end.transition",function(){var t;this[e].count<2&&(t=this.parentNode)&&t.removeChild(this)})},dl.ease=function(t){var r=this.id,n=this.namespace;return arguments.length<1?this.node()[n][r].ease:("function"!=typeof t&&(t=e.ease.apply(e,arguments)),ue(this,function(e){e[n][r].ease=t}))},dl.delay=function(e){var t=this.id,r=this.namespace;return arguments.length<1?this.node()[r][t].delay:ue(this,"function"==typeof e?function(n,a,i){n[r][t].delay=+e.call(n,n.__data__,a,i)}:(e=+e,function(n){n[r][t].delay=e}))},dl.duration=function(e){var t=this.id,r=this.namespace;return arguments.length<1?this.node()[r][t].duration:ue(this,"function"==typeof e?function(n,a,i){n[r][t].duration=Math.max(1,e.call(n,n.__data__,a,i))}:(e=Math.max(1,e),function(n){n[r][t].duration=e}))},dl.each=function(t,r){var n=this.id,a=this.namespace;if(arguments.length<2){var i=fl,o=ul;try{ul=n,ue(this,function(e,r,i){fl=e[a][n],t.call(e,e.__data__,r,i)})}finally{fl=i,ul=o}}else ue(this,function(i){var o=i[a][n];(o.event||(o.event=e.dispatch("start","end","interrupt"))).on(t,r)});return this},dl.transition=function(){for(var e,t,r,n=this.id,a=++pl,i=this.namespace,o=[],l=0,s=this.length;l<s;l++){o.push(e=[]);for(var c,u=0,f=(c=this[l]).length;u<f;u++)(t=c[u])&&ml(t,u,i,a,{time:(r=t[i][n]).time,ease:r.ease,delay:r.delay+r.duration,duration:r.duration}),e.push(t)}return cl(o,i,a)},e.svg.axis=function(){var t,r=e.scale.linear(),a=yl,i=6,o=6,l=3,s=[10],c=null;function u(n){n.each(function(){var n,u=e.select(this),f=this.__chart__||r,d=this.__chart__=r.copy(),p=null==c?d.ticks?d.ticks.apply(d,s):d.domain():c,h=null==t?d.tickFormat?d.tickFormat.apply(d,s):P:t,g=u.selectAll(".tick").data(p,d),v=g.enter().insert("g",".domain").attr("class","tick").style("opacity",ke),m=e.transition(g.exit()).style("opacity",ke).remove(),y=e.transition(g.order()).style("opacity",1),x=Math.max(i,0)+l,b=oo(d),_=u.selectAll(".domain").data([0]),w=(_.enter().append("path").attr("class","domain"),e.transition(_));v.append("line"),v.append("text");var k,T,M,A,L=v.select("line"),S=y.select("line"),C=g.select("text").text(h),O=v.select("text"),D=y.select("text"),z="top"===a||"left"===a?-1:1;if("bottom"===a||"top"===a?(n=bl,k="x",M="y",T="x2",A="y2",C.attr("dy",z<0?"0em":".71em").style("text-anchor","middle"),w.attr("d","M"+b[0]+","+z*o+"V0H"+b[1]+"V"+z*o)):(n=_l,k="y",M="x",T="y2",A="x2",C.attr("dy",".32em").style("text-anchor",z<0?"end":"start"),w.attr("d","M"+z*o+","+b[0]+"H0V"+b[1]+"H"+z*o)),L.attr(A,z*i),O.attr(M,z*x),S.attr(T,0).attr(A,z*i),D.attr(k,0).attr(M,z*x),d.rangeBand){var R=d,E=R.rangeBand()/2;f=d=function(e){return R(e)+E}}else f.rangeBand?f=d:m.call(n,d,f);v.call(n,f,d),y.call(n,d,d)})}return u.scale=function(e){return arguments.length?(r=e,u):r},u.orient=function(e){return arguments.length?(a=e in xl?e+"":yl,u):a},u.ticks=function(){return arguments.length?(s=n(arguments),u):s},u.tickValues=function(e){return arguments.length?(c=e,u):c},u.tickFormat=function(e){return arguments.length?(t=e,u):t},u.tickSize=function(e){var t=arguments.length;return t?(i=+e,o=+arguments[t-1],u):i},u.innerTickSize=function(e){return arguments.length?(i=+e,u):i},u.outerTickSize=function(e){return arguments.length?(o=+e,u):o},u.tickPadding=function(e){return arguments.length?(l=+e,u):l},u.tickSubdivide=function(){return arguments.length&&u},u};var yl="bottom",xl={top:1,right:1,bottom:1,left:1};function bl(e,t,r){e.attr("transform",function(e){var n=t(e);return"translate("+(isFinite(n)?n:r(e))+",0)"})}function _l(e,t,r){e.attr("transform",function(e){var n=t(e);return"translate(0,"+(isFinite(n)?n:r(e))+")"})}e.svg.brush=function(){var t,r,n=B(d,"brushstart","brush","brushend"),a=null,i=null,l=[0,0],s=[0,0],c=!0,u=!0,f=kl[0];function d(t){t.each(function(){var t=e.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=t.selectAll(".background").data([0]);r.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),t.selectAll(".extent").data([0]).enter().append("rect").attr("class","extent").style("cursor","move");var n=t.selectAll(".resize").data(f,P);n.exit().remove(),n.enter().append("g").attr("class",function(e){return"resize "+e}).style("cursor",function(e){return wl[e]}).append("rect").attr("x",function(e){return/[ew]$/.test(e)?-3:null}).attr("y",function(e){return/^[ns]/.test(e)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden"),n.style("display",d.empty()?"none":null);var o,l=e.transition(t),s=e.transition(r);a&&(o=oo(a),s.attr("x",o[0]).attr("width",o[1]-o[0]),h(l)),i&&(o=oo(i),s.attr("y",o[0]).attr("height",o[1]-o[0]),g(l)),p(l)})}function p(e){e.selectAll(".resize").attr("transform",function(e){return"translate("+l[+/e$/.test(e)]+","+s[+/^s/.test(e)]+")"})}function h(e){e.select(".extent").attr("x",l[0]),e.selectAll(".extent,.n>rect,.s>rect").attr("width",l[1]-l[0])}function g(e){e.select(".extent").attr("y",s[0]),e.selectAll(".extent,.e>rect,.w>rect").attr("height",s[1]-s[0])}function v(){var f,v,m=this,y=e.select(e.event.target),x=n.of(m,arguments),b=e.select(m),_=y.datum(),w=!/^(n|s)$/.test(_)&&a,k=!/^(e|w)$/.test(_)&&i,T=y.classed("extent"),M=xe(m),A=e.mouse(m),L=e.select(o(m)).on("keydown.brush",function(){32==e.event.keyCode&&(T||(f=null,A[0]-=l[1],A[1]-=s[1],T=2),N())}).on("keyup.brush",function(){32==e.event.keyCode&&2==T&&(A[0]+=l[1],A[1]+=s[1],T=0,N())});if(e.event.changedTouches?L.on("touchmove.brush",O).on("touchend.brush",D):L.on("mousemove.brush",O).on("mouseup.brush",D),b.interrupt().selectAll("*").interrupt(),T)A[0]=l[0]-A[0],A[1]=s[0]-A[1];else if(_){var S=+/w$/.test(_),C=+/^n/.test(_);v=[l[1-S]-A[0],s[1-C]-A[1]],A[0]=l[S],A[1]=s[C]}else e.event.altKey&&(f=A.slice());function O(){var t=e.mouse(m),r=!1;v&&(t[0]+=v[0],t[1]+=v[1]),T||(e.event.altKey?(f||(f=[(l[0]+l[1])/2,(s[0]+s[1])/2]),A[0]=l[+(t[0]<f[0])],A[1]=s[+(t[1]<f[1])]):f=null),w&&P(t,a,0)&&(h(b),r=!0),k&&P(t,i,1)&&(g(b),r=!0),r&&(p(b),x({type:"brush",mode:T?"move":"resize"}))}function P(e,n,a){var i,o,d=oo(n),p=d[0],h=d[1],g=A[a],v=a?s:l,m=v[1]-v[0];if(T&&(p-=g,h-=m+g),i=(a?u:c)?Math.max(p,Math.min(h,e[a])):e[a],T?o=(i+=g)+m:(f&&(g=Math.max(p,Math.min(h,2*f[a]-i))),g<i?(o=i,i=g):o=g),v[0]!=i||v[1]!=o)return a?r=null:t=null,v[0]=i,v[1]=o,!0}function D(){O(),b.style("pointer-events","all").selectAll(".resize").style("display",d.empty()?"none":null),e.select("body").style("cursor",null),L.on("mousemove.brush",null).on("mouseup.brush",null).on("touchmove.brush",null).on("touchend.brush",null).on("keydown.brush",null).on("keyup.brush",null),M(),x({type:"brushend"})}b.style("pointer-events","none").selectAll(".resize").style("display",null),e.select("body").style("cursor",y.style("cursor")),x({type:"brushstart"}),O()}return d.event=function(a){a.each(function(){var a=n.of(this,arguments),i={x:l,y:s,i:t,j:r},o=this.__chart__||i;this.__chart__=i,ul?e.select(this).transition().each("start.brush",function(){t=o.i,r=o.j,l=o.x,s=o.y,a({type:"brushstart"})}).tween("brush:brush",function(){var e=Za(l,i.x),n=Za(s,i.y);return t=r=null,function(t){l=i.x=e(t),s=i.y=n(t),a({type:"brush",mode:"resize"})}}).each("end.brush",function(){t=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(e){return arguments.length?(f=kl[!(a=e)<<1|!i],d):a},d.y=function(e){return arguments.length?(f=kl[!a<<1|!(i=e)],d):i},d.clamp=function(e){return arguments.length?(a&&i?(c=!!e[0],u=!!e[1]):a?c=!!e:i&&(u=!!e),d):a&&i?[c,u]:a?c:i?u:null},d.extent=function(e){var n,o,c,u,f;return arguments.length?(a&&(n=e[0],o=e[1],i&&(n=n[0],o=o[0]),t=[n,o],a.invert&&(n=a(n),o=a(o)),o<n&&(f=n,n=o,o=f),n==l[0]&&o==l[1]||(l=[n,o])),i&&(c=e[0],u=e[1],a&&(c=c[1],u=u[1]),r=[c,u],i.invert&&(c=i(c),u=i(u)),u<c&&(f=c,c=u,u=f),c==s[0]&&u==s[1]||(s=[c,u])),d):(a&&(t?(n=t[0],o=t[1]):(n=l[0],o=l[1],a.invert&&(n=a.invert(n),o=a.invert(o)),o<n&&(f=n,n=o,o=f))),i&&(r?(c=r[0],u=r[1]):(c=s[0],u=s[1],i.invert&&(c=i.invert(c),u=i.invert(u)),u<c&&(f=c,c=u,u=f))),a&&i?[[n,c],[o,u]]:a?[n,o]:i&&[c,u])},d.clear=function(){return d.empty()||(l=[0,0],s=[0,0],t=r=null),d},d.empty=function(){return!!a&&l[0]==l[1]||!!i&&s[0]==s[1]},e.rebind(d,n,"on")};var wl={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},kl=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]],Tl=zt.format=lr.timeFormat,Ml=Tl.utc,Al=Ml("%Y-%m-%dT%H:%M:%S.%LZ");function Ll(e){return e.toISOString()}function Sl(t,r,n){function a(e){return t(e)}function i(t,n){var a=(t[1]-t[0])/n,i=e.bisect(Ol,a);return i==Ol.length?[r.year,go(t.map(function(e){return e/31536e6}),n)[2]]:i?r[a/Ol[i-1]<Ol[i]/a?i-1:i]:[zl,go(t,n)[2]]}return a.invert=function(e){return Cl(t.invert(e))},a.domain=function(e){return arguments.length?(t.domain(e),a):t.domain().map(Cl)},a.nice=function(e,t){var r=a.domain(),n=io(r),o=null==e?i(n,10):"number"==typeof e&&i(n,e);function l(r){return!isNaN(r)&&!e.range(r,Cl(+r+1),t).length}return o&&(e=o[0],t=o[1]),a.domain(so(r,t>1?{floor:function(t){for(;l(t=e.floor(t));)t=Cl(t-1);return t},ceil:function(t){for(;l(t=e.ceil(t));)t=Cl(+t+1);return t}}:e))},a.ticks=function(e,t){var r=io(a.domain()),n=null==e?i(r,10):"number"==typeof e?i(r,e):!e.range&&[{range:e},t];return n&&(e=n[0],t=n[1]),e.range(r[0],Cl(+r[1]+1),t<1?1:t)},a.tickFormat=function(){return n},a.copy=function(){return Sl(t.copy(),r,n)},po(a,t)}function Cl(e){return new Date(e)}Tl.iso=Date.prototype.toISOString&&+new Date("2000-01-01T00:00:00.000Z")?Ll:Al,Ll.parse=function(e){var t=new Date(e);return isNaN(t)?null:t},Ll.toString=Al.toString,zt.second=Ft(function(e){return new Rt(1e3*Math.floor(e/1e3))},function(e,t){e.setTime(e.getTime()+1e3*Math.floor(t))},function(e){return e.getSeconds()}),zt.seconds=zt.second.range,zt.seconds.utc=zt.second.utc.range,zt.minute=Ft(function(e){return new Rt(6e4*Math.floor(e/6e4))},function(e,t){e.setTime(e.getTime()+6e4*Math.floor(t))},function(e){return e.getMinutes()}),zt.minutes=zt.minute.range,zt.minutes.utc=zt.minute.utc.range,zt.hour=Ft(function(e){var t=e.getTimezoneOffset()/60;return new Rt(36e5*(Math.floor(e/36e5-t)+t))},function(e,t){e.setTime(e.getTime()+36e5*Math.floor(t))},function(e){return e.getHours()}),zt.hours=zt.hour.range,zt.hours.utc=zt.hour.utc.range,zt.month=Ft(function(e){return(e=zt.day(e)).setDate(1),e},function(e,t){e.setMonth(e.getMonth()+t)},function(e){return e.getMonth()}),zt.months=zt.month.range,zt.months.utc=zt.month.utc.range;var Ol=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],Pl=[[zt.second,1],[zt.second,5],[zt.second,15],[zt.second,30],[zt.minute,1],[zt.minute,5],[zt.minute,15],[zt.minute,30],[zt.hour,1],[zt.hour,3],[zt.hour,6],[zt.hour,12],[zt.day,1],[zt.day,2],[zt.week,1],[zt.month,1],[zt.month,3],[zt.year,1]],Dl=Tl.multi([[".%L",function(e){return e.getMilliseconds()}],[":%S",function(e){return e.getSeconds()}],["%I:%M",function(e){return e.getMinutes()}],["%I %p",function(e){return e.getHours()}],["%a %d",function(e){return e.getDay()&&1!=e.getDate()}],["%b %d",function(e){return 1!=e.getDate()}],["%B",function(e){return e.getMonth()}],["%Y",Zr]]),zl={range:function(t,r,n){return e.range(Math.ceil(t/n)*n,+r,n).map(Cl)},floor:P,ceil:P};Pl.year=zt.year,zt.scale=function(){return Sl(e.scale.linear(),Pl,Dl)};var Rl=Pl.map(function(e){return[e[0].utc,e[1]]}),El=Ml.multi([[".%L",function(e){return e.getUTCMilliseconds()}],[":%S",function(e){return e.getUTCSeconds()}],["%I:%M",function(e){return e.getUTCMinutes()}],["%I %p",function(e){return e.getUTCHours()}],["%a %d",function(e){return e.getUTCDay()&&1!=e.getUTCDate()}],["%b %d",function(e){return 1!=e.getUTCDate()}],["%B",function(e){return e.getUTCMonth()}],["%Y",Zr]]);function Il(e){return JSON.parse(e.responseText)}function Fl(e){var t=a.createRange();return t.selectNode(a.body),t.createContextualFragment(e.responseText)}Rl.year=zt.year.utc,zt.scale.utc=function(){return Sl(e.scale.linear(),Rl,El)},e.text=mt(function(e){return e.responseText}),e.json=function(e,t){return yt(e,"application/json",Il,t)},e.html=function(e,t){return yt(e,"text/html",Fl,t)},e.xml=mt(function(e){return e.responseXML}),"object"==typeof t&&t.exports?t.exports=e:this.d3=e}()},{}],3:[function(e,t,r){(function(n,a){!function(e,n){"object"==typeof r&&void 0!==t?t.exports=n():e.ES6Promise=n()}(this,function(){"use strict";function t(e){return"function"==typeof e}var r=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},i=0,o=void 0,l=void 0,s=function(e,t){g[i]=e,g[i+1]=t,2===(i+=2)&&(l?l(v):_())};var c="undefined"!=typeof window?window:void 0,u=c||{},f=u.MutationObserver||u.WebKitMutationObserver,d="undefined"==typeof self&&void 0!==n&&"[object process]"==={}.toString.call(n),p="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function h(){var e=setTimeout;return function(){return e(v,1)}}var g=new Array(1e3);function v(){for(var e=0;e<i;e+=2){(0,g[e])(g[e+1]),g[e]=void 0,g[e+1]=void 0}i=0}var m,y,x,b,_=void 0;function w(e,t){var r=arguments,n=this,a=new this.constructor(M);void 0===a[T]&&q(a);var i,o=n._state;return o?(i=r[o-1],s(function(){return B(o,a,i,n._result)})):I(n,a,e,t),a}function k(e){if(e&&"object"==typeof e&&e.constructor===this)return e;var t=new this(M);return D(t,e),t}d?_=function(){return n.nextTick(v)}:f?(y=0,x=new f(v),b=document.createTextNode(""),x.observe(b,{characterData:!0}),_=function(){b.data=y=++y%2}):p?((m=new MessageChannel).port1.onmessage=v,_=function(){return m.port2.postMessage(0)}):_=void 0===c&&"function"==typeof e?function(){try{var t=e("vertx");return o=t.runOnLoop||t.runOnContext,function(){o(v)}}catch(e){return h()}}():h();var T=Math.random().toString(36).substring(16);function M(){}var A=void 0,L=1,S=2,C=new N;function O(e){try{return e.then}catch(e){return C.error=e,C}}function P(e,r,n){r.constructor===e.constructor&&n===w&&r.constructor.resolve===k?function(e,t){t._state===L?R(e,t._result):t._state===S?E(e,t._result):I(t,void 0,function(t){return D(e,t)},function(t){return E(e,t)})}(e,r):n===C?E(e,C.error):void 0===n?R(e,r):t(n)?function(e,t,r){s(function(e){var n=!1,a=function(e,t,r,n){try{e.call(t,r,n)}catch(e){return e}}(r,t,function(r){n||(n=!0,t!==r?D(e,r):R(e,r))},function(t){n||(n=!0,E(e,t))},e._label);!n&&a&&(n=!0,E(e,a))},e)}(e,r,n):R(e,r)}function D(e,t){var r;e===t?E(e,new TypeError("You cannot resolve a promise with itself")):"function"==typeof(r=t)||"object"==typeof r&&null!==r?P(e,t,O(t)):R(e,t)}function z(e){e._onerror&&e._onerror(e._result),F(e)}function R(e,t){e._state===A&&(e._result=t,e._state=L,0!==e._subscribers.length&&s(F,e))}function E(e,t){e._state===A&&(e._state=S,e._result=t,s(z,e))}function I(e,t,r,n){var a=e._subscribers,i=a.length;e._onerror=null,a[i]=t,a[i+L]=r,a[i+S]=n,0===i&&e._state&&s(F,e)}function F(e){var t=e._subscribers,r=e._state;if(0!==t.length){for(var n=void 0,a=void 0,i=e._result,o=0;o<t.length;o+=3)n=t[o],a=t[o+r],n?B(r,n,a,i):a(i);e._subscribers.length=0}}function N(){this.error=null}var j=new N;function B(e,r,n,a){var i=t(n),o=void 0,l=void 0,s=void 0,c=void 0;if(i){if((o=function(e,t){try{return e(t)}catch(e){return j.error=e,j}}(n,a))===j?(c=!0,l=o.error,o=null):s=!0,r===o)return void E(r,new TypeError("A promises callback cannot return that same promise."))}else o=a,s=!0;r._state!==A||(i&&s?D(r,o):c?E(r,l):e===L?R(r,o):e===S&&E(r,o))}var H=0;function q(e){e[T]=H++,e._state=void 0,e._result=void 0,e._subscribers=[]}function V(e,t){this._instanceConstructor=e,this.promise=new e(M),this.promise[T]||q(this.promise),r(t)?(this._input=t,this.length=t.length,this._remaining=t.length,this._result=new Array(this.length),0===this.length?R(this.promise,this._result):(this.length=this.length||0,this._enumerate(),0===this._remaining&&R(this.promise,this._result))):E(this.promise,new Error("Array Methods must be provided an Array"))}function U(e){this[T]=H++,this._result=this._state=void 0,this._subscribers=[],M!==e&&("function"!=typeof e&&function(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}(),this instanceof U?function(e,t){try{t(function(t){D(e,t)},function(t){E(e,t)})}catch(t){E(e,t)}}(this,e):function(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}())}function G(){var e=void 0;if(void 0!==a)e=a;else if("undefined"!=typeof self)e=self;else try{e=Function("return this")()}catch(e){throw new Error("polyfill failed because global object is unavailable in this environment")}var t=e.Promise;if(t){var r=null;try{r=Object.prototype.toString.call(t.resolve())}catch(e){}if("[object Promise]"===r&&!t.cast)return}e.Promise=U}return V.prototype._enumerate=function(){for(var e=this.length,t=this._input,r=0;this._state===A&&r<e;r++)this._eachEntry(t[r],r)},V.prototype._eachEntry=function(e,t){var r=this._instanceConstructor,n=r.resolve;if(n===k){var a=O(e);if(a===w&&e._state!==A)this._settledAt(e._state,t,e._result);else if("function"!=typeof a)this._remaining--,this._result[t]=e;else if(r===U){var i=new r(M);P(i,e,a),this._willSettleAt(i,t)}else this._willSettleAt(new r(function(t){return t(e)}),t)}else this._willSettleAt(n(e),t)},V.prototype._settledAt=function(e,t,r){var n=this.promise;n._state===A&&(this._remaining--,e===S?E(n,r):this._result[t]=r),0===this._remaining&&R(n,this._result)},V.prototype._willSettleAt=function(e,t){var r=this;I(e,void 0,function(e){return r._settledAt(L,t,e)},function(e){return r._settledAt(S,t,e)})},U.all=function(e){return new V(this,e).promise},U.race=function(e){var t=this;return r(e)?new t(function(r,n){for(var a=e.length,i=0;i<a;i++)t.resolve(e[i]).then(r,n)}):new t(function(e,t){return t(new TypeError("You must pass an array to race."))})},U.resolve=k,U.reject=function(e){var t=new this(M);return E(t,e),t},U._setScheduler=function(e){l=e},U._setAsap=function(e){s=e},U._asap=s,U.prototype={constructor:U,then:w,catch:function(e){return this.then(null,e)}},G(),U.polyfill=G,U.Promise=U,U})}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:280}],4:[function(e,t,r){"use strict";var n=e("is-string-blank");t.exports=function(e){var t=typeof e;if("string"===t){var r=e;if(0===(e=+e)&&n(r))return!1}else if("number"!==t)return!1;return e-e<1}},{"is-string-blank":9}],5:[function(e,t,r){t.exports=function(e,t){var r=t[0],n=t[1],a=t[2],i=t[3],o=r+r,l=n+n,s=a+a,c=r*o,u=n*o,f=n*l,d=a*o,p=a*l,h=a*s,g=i*o,v=i*l,m=i*s;return e[0]=1-f-h,e[1]=u+m,e[2]=d-v,e[3]=0,e[4]=u-m,e[5]=1-c-h,e[6]=p+g,e[7]=0,e[8]=d+v,e[9]=p-g,e[10]=1-c-f,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}},{}],6:[function(e,t,r){(function(r){"use strict";var n,a=e("is-browser");n="function"==typeof r.matchMedia?!r.matchMedia("(hover: none)").matches:a,t.exports=n}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"is-browser":8}],7:[function(e,t,r){"use strict";var n=e("is-browser");t.exports=n&&function(){var e=!1;try{var t=Object.defineProperty({},"passive",{get:function(){e=!0}});window.addEventListener("test",null,t),window.removeEventListener("test",null,t)}catch(t){e=!1}return e}()},{"is-browser":8}],8:[function(e,t,r){t.exports=!0},{}],9:[function(e,t,r){"use strict";t.exports=function(e){for(var t,r=e.length,n=0;n<r;n++)if(((t=e.charCodeAt(n))<9||t>13)&&32!==t&&133!==t&&160!==t&&5760!==t&&6158!==t&&(t<8192||t>8205)&&8232!==t&&8233!==t&&8239!==t&&8287!==t&&8288!==t&&12288!==t&&65279!==t)return!1;return!0}},{}],10:[function(e,t,r){var n={left:0,top:0};t.exports=function(e,t,r){t=t||e.currentTarget||e.srcElement,Array.isArray(r)||(r=[0,0]);var a=e.clientX||0,i=e.clientY||0,o=(l=t,l===window||l===document||l===document.body?n:l.getBoundingClientRect());var l;return r[0]=a-o.left,r[1]=i-o.top,r}},{}],11:[function(e,t,r){"use strict";var n=e("../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';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":148}],12:[function(e,t,r){"use strict";t.exports=e("../src/core")},{"../src/core":130}],13:[function(e,t,r){"use strict";t.exports=e("../src/traces/scatter")},{"../src/traces/scatter":256}],14:[function(e,t,r){"use strict";t.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}]},{}],15:[function(e,t,r){"use strict";var n=e("./arrow_paths"),a=e("../../plots/font_attributes"),i=e("../../plots/cartesian/constants"),o=e("../../plot_api/plot_template").templatedArray;t.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"}}})},{"../../plot_api/plot_template":182,"../../plots/cartesian/constants":198,"../../plots/font_attributes":218,"./arrow_paths":14}],16:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/cartesian/axes"),i=e("./draw").draw;function o(e){var t=e._fullLayout;n.filterVisible(t.annotations).forEach(function(t){var r=a.getFromId(e,t.xref),n=a.getFromId(e,t.yref);t._extremes={},r&&l(t,r),n&&l(t,n)})}function l(e,t){var r,n=t._id,i=n.charAt(0),o=e[i],l=e["a"+i],s=e[i+"ref"],c=e["a"+i+"ref"],u=e["_"+i+"padplus"],f=e["_"+i+"padminus"],d={x:1,y:-1}[i]*e[i+"shift"],p=3*e.arrowsize*e.arrowwidth||0,h=p+d,g=p-d,v=3*e.startarrowsize*e.arrowwidth||0,m=v+d,y=v-d;if(c===s){var x=a.findExtremes(t,[t.r2c(o)],{ppadplus:h,ppadminus:g}),b=a.findExtremes(t,[t.r2c(l)],{ppadplus:Math.max(u,m),ppadminus:Math.max(f,y)});r={min:[x.min[0],b.min[0]],max:[x.max[0],b.max[0]]}}else m=l?m+l:m,y=l?y-l:y,r=a.findExtremes(t,[t.r2c(o)],{ppadplus:Math.max(u,h,m),ppadminus:Math.max(f,g,y)});e._extremes[n]=r}t.exports=function(e){var t=e._fullLayout;if(n.filterVisible(t.annotations).length&&e._fullData.length)return n.syncOrAsync([i,o],e)}},{"../../lib":148,"../../plots/cartesian/axes":192,"./draw":21}],17:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../registry"),i=e("../../plot_api/plot_template").arrayEditor;function o(e,t){var r,n,a,i,o,s,c,u=e._fullLayout.annotations,f=[],d=[],p=[],h=(t||[]).length;for(r=0;r<u.length;r++)if(i=(a=u[r]).clicktoshow){for(n=0;n<h;n++)if(s=(o=t[n]).xaxis,c=o.yaxis,s._id===a.xref&&c._id===a.yref&&s.d2r(o.x)===l(a._xclick,s)&&c.d2r(o.y)===l(a._yclick,c)){(a.visible?"onout"===i?d:p:f).push(r);break}n===h&&a.visible&&"onout"===i&&d.push(r)}return{on:f,off:d,explicitOff:p}}function l(e,t){return"log"===t.type?t.l2r(e):t.d2r(e)}t.exports={hasClickToShow:function(e,t){var r=o(e,t);return r.on.length>0||r.explicitOff.length>0},onClick:function(e,t){var r,l,s=o(e,t),c=s.on,u=s.off.concat(s.explicitOff),f={},d=e._fullLayout.annotations;if(!c.length&&!u.length)return;for(r=0;r<c.length;r++)(l=i(e.layout,"annotations",d[c[r]])).modifyItem("visible",!0),n.extendFlat(f,l.getUpdateObj());for(r=0;r<u.length;r++)(l=i(e.layout,"annotations",d[u[r]])).modifyItem("visible",!1),n.extendFlat(f,l.getUpdateObj());return a.call("update",e,{},f)}}},{"../../lib":148,"../../plot_api/plot_template":182,"../../registry":232}],18:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../color");t.exports=function(e,t,r,i){i("opacity");var o=i("bgcolor"),l=i("bordercolor"),s=a.opacity(l);i("borderpad");var c=i("borderwidth"),u=i("showarrow");if(i("text",u?" ":r._dfltTitle.annotation),i("textangle"),n.coerceFont(i,"font",r.font),i("width"),i("align"),i("height")&&i("valign"),u){var f,d,p=i("arrowside");-1!==p.indexOf("end")&&(f=i("arrowhead"),d=i("arrowsize")),-1!==p.indexOf("start")&&(i("startarrowhead",f),i("startarrowsize",d)),i("arrowcolor",s?t.bordercolor:a.defaultLine),i("arrowwidth",2*(s&&c||1)),i("standoff"),i("startstandoff")}var h=i("hovertext"),g=r.hoverlabel||{};if(h){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",!!h)}},{"../../lib":148,"../color":30}],19:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("../../lib/to_log_range");t.exports=function(e,t,r,i){t=t||{};var o="log"===r&&"linear"===t.type,l="linear"===r&&"log"===t.type;if(o||l)for(var s,c,u=e._fullLayout.annotations,f=t._id.charAt(0),d=0;d<u.length;d++)s=u[d],c="annotations["+d+"].",s[f+"ref"]===t._id&&p(f),s["a"+f+"ref"]===t._id&&p("a"+f);function p(e){var r=s[e],l=null;l=o?a(r,t.range):Math.pow(10,r),n(l)||(l=null),i(c+e,l)}}},{"../../lib/to_log_range":171,"fast-isnumeric":4}],20:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/cartesian/axes"),i=e("../../plots/array_container_defaults"),o=e("./common_defaults"),l=e("./attributes");function s(e,t,r){function i(r,a){return n.coerce(e,t,l,r,a)}var s=i("visible"),c=i("clicktoshow");if(s||c){o(e,t,r,i);for(var u=t.showarrow,f=["x","y"],d=[-10,-30],p={_fullLayout:r},h=0;h<2;h++){var g=f[h],v=a.coerceRef(e,t,p,g,"","paper");if("paper"!==v)a.getFromId(p,v)._annIndices.push(t._index);if(a.coercePosition(t,p,i,v,g,.5),u){var m="a"+g,y=a.coerceRef(e,t,p,m,"pixel");"pixel"!==y&&y!==v&&(y=t[m]="pixel");var x="pixel"===y?d[h]:.4;a.coercePosition(t,p,i,y,m,x)}i(g+"anchor"),i(g+"shift")}if(n.noneOrAll(e,t,["x","y"]),u&&n.noneOrAll(e,t,["ax","ay"]),c){var b=i("xclick"),_=i("yclick");t._xclick=void 0===b?t.x:a.cleanPosition(b,p,t.xref),t._yclick=void 0===_?t.y:a.cleanPosition(_,p,t.yref)}}}t.exports=function(e,t){i(e,t,{name:"annotations",handleItemDefaults:s})}},{"../../lib":148,"../../plots/array_container_defaults":188,"../../plots/cartesian/axes":192,"./attributes":15,"./common_defaults":18}],21:[function(e,t,r){"use strict";var n=e("d3"),a=e("../../registry"),i=e("../../plots/plots"),o=e("../../lib"),l=e("../../plots/cartesian/axes"),s=e("../color"),c=e("../drawing"),u=e("../fx"),f=e("../../lib/svg_text_utils"),d=e("../../lib/setcursor"),p=e("../dragelement"),h=e("../../plot_api/plot_template").arrayEditor,g=e("./draw_arrow_head");function v(e,t){var r=e._fullLayout.annotations[t]||{},n=l.getFromId(e,r.xref),a=l.getFromId(e,r.yref);n&&n.setScale(),a&&a.setScale(),m(e,r,t,!1,n,a)}function m(e,t,r,i,l,v){var m,y,x=e._fullLayout,b=e._fullLayout._size,_=e._context.edits;i?(m="annotation-"+i,y=i+".annotations"):(m="annotation",y="annotations");var w=h(e.layout,y,t),k=w.modifyBase,T=w.modifyItem,M=w.getUpdateObj;x._infolayer.selectAll("."+m+'[data-index="'+r+'"]').remove();var A="clip"+x._uid+"_ann"+r;if(t._input&&!1!==t.visible){var L={x:{},y:{}},S=+t.textangle||0,C=x._infolayer.append("g").classed(m,!0).attr("data-index",String(r)).style("opacity",t.opacity),O=C.append("g").classed("annotation-text-g",!0),P=_[t.showarrow?"annotationTail":"annotationPosition"],D=t.captureevents||_.annotationText||P,z=O.append("g").style("pointer-events",D?"all":null).call(d,"pointer").on("click",function(){e._dragging=!1,e.emit("plotly_clickannotation",V(n.event))});t.hovertext&&z.on("mouseover",function(){var r=t.hoverlabel,n=r.font,a=this.getBoundingClientRect(),i=e.getBoundingClientRect();u.loneHover({x0:a.left-i.left,x1:a.right-i.left,y:(a.top+a.bottom)/2-i.top,text:t.hovertext,color:r.bgcolor,borderColor:r.bordercolor,fontFamily:n.family,fontSize:n.size,fontColor:n.color},{container:x._hoverlayer.node(),outerContainer:x._paper.node(),gd:e})}).on("mouseout",function(){u.loneUnhover(x._hoverlayer.node())});var R=t.borderwidth,E=t.borderpad,I=R+E,F=z.append("rect").attr("class","bg").style("stroke-width",R+"px").call(s.stroke,t.bordercolor).call(s.fill,t.bgcolor),N=t.width||t.height,j=x._topclips.selectAll("#"+A).data(N?[0]:[]);j.enter().append("clipPath").classed("annclip",!0).attr("id",A).append("rect"),j.exit().remove();var B=t.font,H=x._meta?o.templateString(t.text,x._meta):t.text,q=z.append("text").classed("annotation-text",!0).text(H);_.annotationText?q.call(f.makeEditable,{delegate:z,gd:e}).call(U).on("edit",function(r){t.text=r,this.call(U),T("text",r),l&&l.autorange&&k(l._name+".autorange",!0),v&&v.autorange&&k(v._name+".autorange",!0),a.call("_guiRelayout",e,M())}):q.call(U)}else n.selectAll("#"+A).remove();function V(e){var n={index:r,annotation:t._input,fullAnnotation:t,event:e};return i&&(n.subplotId=i),n}function U(r){return r.call(c.font,B).attr({"text-anchor":{left:"start",right:"end"}[t.align]||"middle"}),f.convertToTspans(r,e,G),r}function G(){var r=q.selectAll("a");1===r.size()&&r.text()===q.text()&&z.insert("a",":first-child").attr({"xlink:xlink:href":r.attr("xlink:href"),"xlink:xlink:show":r.attr("xlink:show")}).style({cursor:"pointer"}).node().appendChild(F.node());var n=z.select(".annotation-text-math-group"),u=!n.empty(),h=c.bBox((u?n:q).node()),m=h.width,y=h.height,w=t.width||m,D=t.height||y,E=Math.round(w+2*I),B=Math.round(D+2*I);function H(e,t){return"auto"===t&&(t=e<1/3?"left":e>2/3?"right":"center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[t]}for(var U=!1,G=["x","y"],Z=0;Z<G.length;Z++){var Y,X,W,$,J,Q=G[Z],K=t[Q+"ref"]||Q,ee=t["a"+Q+"ref"],te={x:l,y:v}[Q],re=(S+("x"===Q?0:-90))*Math.PI/180,ne=E*Math.cos(re),ae=B*Math.sin(re),ie=Math.abs(ne)+Math.abs(ae),oe=t[Q+"anchor"],le=t[Q+"shift"]*("x"===Q?1:-1),se=L[Q];if(te){var ce=te.r2fraction(t[Q]);(ce<0||ce>1)&&(ee===K?((ce=te.r2fraction(t["a"+Q]))<0||ce>1)&&(U=!0):U=!0),Y=te._offset+te.r2p(t[Q]),$=.5}else"x"===Q?(W=t[Q],Y=b.l+b.w*W):(W=1-t[Q],Y=b.t+b.h*W),$=t.showarrow?.5:W;if(t.showarrow){se.head=Y;var ue=t["a"+Q];J=ne*H(.5,t.xanchor)-ae*H(.5,t.yanchor),ee===K?(se.tail=te._offset+te.r2p(ue),X=J):(se.tail=Y+ue,X=J+ue),se.text=se.tail+J;var fe=x["x"===Q?"width":"height"];if("paper"===K&&(se.head=o.constrain(se.head,1,fe-1)),"pixel"===ee){var de=-Math.max(se.tail-3,se.text),pe=Math.min(se.tail+3,se.text)-fe;de>0?(se.tail+=de,se.text+=de):pe>0&&(se.tail-=pe,se.text-=pe)}se.tail+=le,se.head+=le}else X=J=ie*H($,oe),se.text=Y+J;se.text+=le,J+=le,X+=le,t["_"+Q+"padplus"]=ie/2+X,t["_"+Q+"padminus"]=ie/2-X,t["_"+Q+"size"]=ie,t["_"+Q+"shift"]=J}if(U)z.remove();else{var he=0,ge=0;if("left"!==t.align&&(he=(w-m)*("center"===t.align?.5:1)),"top"!==t.valign&&(ge=(D-y)*("middle"===t.valign?.5:1)),u)n.select("svg").attr({x:I+he-1,y:I+ge}).call(c.setClipUrl,N?A:null,e);else{var ve=I+ge-h.top,me=I+he-h.left;q.call(f.positionText,me,ve).call(c.setClipUrl,N?A:null,e)}j.select("rect").call(c.setRect,I,I,w,D),F.call(c.setRect,R/2,R/2,E-R,B-R),z.call(c.setTranslate,Math.round(L.x.text-E/2),Math.round(L.y.text-B/2)),O.attr({transform:"rotate("+S+","+L.x.text+","+L.y.text+")"});var ye,xe=function(r,n){C.selectAll(".annotation-arrow-g").remove();var u=L.x.head,f=L.y.head,d=L.x.tail+r,h=L.y.tail+n,m=L.x.text+r,y=L.y.text+n,x=o.rotationXYMatrix(S,m,y),w=o.apply2DTransform(x),A=o.apply2DTransform2(x),P=+F.attr("width"),D=+F.attr("height"),R=m-.5*P,E=R+P,I=y-.5*D,N=I+D,j=[[R,I,R,N],[R,N,E,N],[E,N,E,I],[E,I,R,I]].map(A);if(!j.reduce(function(e,t){return e^!!o.segmentsIntersect(u,f,u+1e6,f+1e6,t[0],t[1],t[2],t[3])},!1)){j.forEach(function(e){var t=o.segmentsIntersect(d,h,u,f,e[0],e[1],e[2],e[3]);t&&(d=t.x,h=t.y)});var B=t.arrowwidth,H=t.arrowcolor,q=t.arrowside,V=C.append("g").style({opacity:s.opacity(H)}).classed("annotation-arrow-g",!0),U=V.append("path").attr("d","M"+d+","+h+"L"+u+","+f).style("stroke-width",B+"px").call(s.stroke,s.rgb(H));if(g(U,q,t),_.annotationPosition&&U.node().parentNode&&!i){var G=u,Z=f;if(t.standoff){var Y=Math.sqrt(Math.pow(u-d,2)+Math.pow(f-h,2));G+=t.standoff*(d-u)/Y,Z+=t.standoff*(h-f)/Y}var X,W,$=V.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).classed("cursor-move",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(d-G)+","+(h-Z),transform:"translate("+G+","+Z+")"}).style("stroke-width",B+6+"px").call(s.stroke,"rgba(0,0,0,0)").call(s.fill,"rgba(0,0,0,0)");p.init({element:$.node(),gd:e,prepFn:function(){var e=c.getTranslate(z);X=e.x,W=e.y,l&&l.autorange&&k(l._name+".autorange",!0),v&&v.autorange&&k(v._name+".autorange",!0)},moveFn:function(e,r){var n=w(X,W),a=n[0]+e,i=n[1]+r;z.call(c.setTranslate,a,i),T("x",l?l.p2r(l.r2p(t.x)+e):t.x+e/b.w),T("y",v?v.p2r(v.r2p(t.y)+r):t.y-r/b.h),t.axref===t.xref&&T("ax",l.p2r(l.r2p(t.ax)+e)),t.ayref===t.yref&&T("ay",v.p2r(v.r2p(t.ay)+r)),V.attr("transform","translate("+e+","+r+")"),O.attr({transform:"rotate("+S+","+a+","+i+")"})},doneFn:function(){a.call("_guiRelayout",e,M());var t=document.querySelector(".js-notes-box-panel");t&&t.redraw(t.selectedObj)}})}}};if(t.showarrow&&xe(0,0),P)p.init({element:z.node(),gd:e,prepFn:function(){ye=O.attr("transform")},moveFn:function(e,r){var n="pointer";if(t.showarrow)t.axref===t.xref?T("ax",l.p2r(l.r2p(t.ax)+e)):T("ax",t.ax+e),t.ayref===t.yref?T("ay",v.p2r(v.r2p(t.ay)+r)):T("ay",t.ay+r),xe(e,r);else{if(i)return;var a,o;if(l)a=l.p2r(l.r2p(t.x)+e);else{var s=t._xsize/b.w,c=t.x+(t._xshift-t.xshift)/b.w-s/2;a=p.align(c+e/b.w,s,0,1,t.xanchor)}if(v)o=v.p2r(v.r2p(t.y)+r);else{var u=t._ysize/b.h,f=t.y-(t._yshift+t.yshift)/b.h-u/2;o=p.align(f-r/b.h,u,0,1,t.yanchor)}T("x",a),T("y",o),l&&v||(n=p.getCursor(l?.5:a,v?.5:o,t.xanchor,t.yanchor))}O.attr({transform:"translate("+e+","+r+")"+ye}),d(z,n)},clickFn:function(r,n){t.captureevents&&e.emit("plotly_clickannotation",V(n))},doneFn:function(){d(z),a.call("_guiRelayout",e,M());var t=document.querySelector(".js-notes-box-panel");t&&t.redraw(t.selectedObj)}})}}}t.exports={draw:function(e){var t=e._fullLayout;t._infolayer.selectAll(".annotation").remove();for(var r=0;r<t.annotations.length;r++)t.annotations[r].visible&&v(e,r);return i.previousPromises(e)},drawOne:v,drawRaw:m}},{"../../lib":148,"../../lib/setcursor":167,"../../lib/svg_text_utils":169,"../../plot_api/plot_template":182,"../../plots/cartesian/axes":192,"../../plots/plots":224,"../../registry":232,"../color":30,"../dragelement":48,"../drawing":51,"../fx":69,"./draw_arrow_head":22,d3:2}],22:[function(e,t,r){"use strict";var n=e("d3"),a=e("../color"),i=e("./arrow_paths");t.exports=function(e,t,r){var o,l,s,c,u=e.node(),f=i[r.arrowhead||0],d=i[r.startarrowhead||0],p=(r.arrowwidth||1)*(r.arrowsize||1),h=(r.arrowwidth||1)*(r.startarrowsize||1),g=t.indexOf("start")>=0,v=t.indexOf("end")>=0,m=f.backoff*p+r.standoff,y=d.backoff*h+r.startstandoff;if("line"===u.nodeName){o={x:+e.attr("x1"),y:+e.attr("y1")},l={x:+e.attr("x2"),y:+e.attr("y2")};var x=o.x-l.x,b=o.y-l.y;if(c=(s=Math.atan2(b,x))+Math.PI,m&&y&&m+y>Math.sqrt(x*x+b*b))return void P();if(m){if(m*m>x*x+b*b)return void P();var _=m*Math.cos(s),w=m*Math.sin(s);l.x+=_,l.y+=w,e.attr({x2:l.x,y2:l.y})}if(y){if(y*y>x*x+b*b)return void P();var k=y*Math.cos(s),T=y*Math.sin(s);o.x-=k,o.y-=T,e.attr({x1:o.x,y1:o.y})}}else if("path"===u.nodeName){var M=u.getTotalLength(),A="";if(M<m+y)return void P();var L=u.getPointAtLength(0),S=u.getPointAtLength(.1);s=Math.atan2(L.y-S.y,L.x-S.x),o=u.getPointAtLength(Math.min(y,M)),A="0px,"+y+"px,";var C=u.getPointAtLength(M),O=u.getPointAtLength(M-.1);c=Math.atan2(C.y-O.y,C.x-O.x),l=u.getPointAtLength(Math.max(0,M-m)),A+=M-(A?y+m:m)+"px,"+M+"px",e.style("stroke-dasharray",A)}function P(){e.style("stroke-dasharray","0px,100px")}function D(t,i,o,l){t.path&&(t.noRotate&&(o=0),n.select(u.parentNode).append("path").attr({class:e.attr("class"),d:t.path,transform:"translate("+i.x+","+i.y+")"+(o?"rotate("+180*o/Math.PI+")":"")+"scale("+l+")"}).style({fill:a.rgb(r.arrowcolor),"stroke-width":0}))}g&&D(d,o,s,h),v&&D(f,l,c,p)}},{"../color":30,"./arrow_paths":14,d3:2}],23:[function(e,t,r){"use strict";var n=e("./draw"),a=e("./click");t.exports={moduleType:"component",name:"annotations",layoutAttributes:e("./attributes"),supplyLayoutDefaults:e("./defaults"),includeBasePlot:e("../../plots/cartesian/include_components")("annotations"),calcAutorange:e("./calc_autorange"),draw:n.draw,drawOne:n.drawOne,drawRaw:n.drawRaw,hasClickToShow:a.hasClickToShow,onClick:a.onClick,convertCoords:e("./convert_coords")}},{"../../plots/cartesian/include_components":202,"./attributes":15,"./calc_autorange":16,"./click":17,"./convert_coords":19,"./defaults":20,"./draw":21}],24:[function(e,t,r){"use strict";var n=e("../annotations/attributes"),a=e("../../plot_api/edit_types").overrideAll,i=e("../../plot_api/plot_template").templatedArray;t.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":175,"../../plot_api/plot_template":182,"../annotations/attributes":15}],25:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/cartesian/axes");function i(e,t){var r=t.fullSceneLayout.domain,i=t.fullLayout._size,o={pdata:null,type:"linear",autorange:!1,range:[-1/0,1/0]};e._xa={},n.extendFlat(e._xa,o),a.setConvert(e._xa),e._xa._offset=i.l+r.x[0]*i.w,e._xa.l2p=function(){return.5*(1+e._pdata[0]/e._pdata[3])*i.w*(r.x[1]-r.x[0])},e._ya={},n.extendFlat(e._ya,o),a.setConvert(e._ya),e._ya._offset=i.t+(1-r.y[1])*i.h,e._ya.l2p=function(){return.5*(1-e._pdata[1]/e._pdata[3])*i.h*(r.y[1]-r.y[0])}}t.exports=function(e){for(var t=e.fullSceneLayout.annotations,r=0;r<t.length;r++)i(t[r],e);e.fullLayout._infolayer.selectAll(".annotation-"+e.id).remove()}},{"../../lib":148,"../../plots/cartesian/axes":192}],26:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/cartesian/axes"),i=e("../../plots/array_container_defaults"),o=e("../annotations/common_defaults"),l=e("./attributes");function s(e,t,r,i){function s(r,a){return n.coerce(e,t,l,r,a)}function c(e){var n=e+"axis",i={_fullLayout:{}};return i._fullLayout[n]=r[n],a.coercePosition(t,i,s,e,e,.5)}s("visible")&&(o(e,t,i.fullLayout,s),c("x"),c("y"),c("z"),n.noneOrAll(e,t,["x","y","z"]),t.xref="x",t.yref="y",t.zref="z",s("xanchor"),s("yanchor"),s("xshift"),s("yshift"),t.showarrow&&(t.axref="pixel",t.ayref="pixel",s("ax",-10),s("ay",-30),n.noneOrAll(e,t,["ax","ay"])))}t.exports=function(e,t,r){i(e,t,{name:"annotations",handleItemDefaults:s,fullLayout:r.fullLayout})}},{"../../lib":148,"../../plots/array_container_defaults":188,"../../plots/cartesian/axes":192,"../annotations/common_defaults":18,"./attributes":24}],27:[function(e,t,r){"use strict";var n=e("../annotations/draw").drawRaw,a=e("../../plots/gl3d/project"),i=["x","y","z"];t.exports=function(e){for(var t=e.fullSceneLayout,r=e.dataScale,o=t.annotations,l=0;l<o.length;l++){for(var s=o[l],c=!1,u=0;u<3;u++){var f=i[u],d=s[f],p=t[f+"axis"].r2fraction(d);if(p<0||p>1){c=!0;break}}c?e.fullLayout._infolayer.select(".annotation-"+e.id+'[data-index="'+l+'"]').remove():(s._pdata=a(e.glplot.cameraParams,[t.xaxis.r2l(s.x)*r[0],t.yaxis.r2l(s.y)*r[1],t.zaxis.r2l(s.z)*r[2]]),n(e.graphDiv,s,l,e.id,s._xa,s._ya))}}},{"../../plots/gl3d/project":221,"../annotations/draw":21}],28:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../lib");t.exports={moduleType:"component",name:"annotations3d",schema:{subplots:{scene:{annotations:e("./attributes")}}},layoutAttributes:e("./attributes"),handleDefaults:e("./defaults"),includeBasePlot:function(e,t){var r=n.subplotsRegistry.gl3d;if(!r)return;for(var i=r.attrRegex,o=Object.keys(e),l=0;l<o.length;l++){var s=o[l];i.test(s)&&(e[s].annotations||[]).length&&(a.pushUnique(t._basePlotModules,r),a.pushUnique(t._subplots.gl3d,s))}},convert:e("./convert"),draw:e("./draw")}},{"../../lib":148,"../../registry":232,"./attributes":24,"./convert":25,"./defaults":26,"./draw":27}],29:[function(e,t,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},{}],30:[function(e,t,r){"use strict";var n=e("tinycolor2"),a=e("fast-isnumeric"),i=t.exports={},o=e("./attributes");i.defaults=o.defaults;var l=i.defaultLine=o.defaultLine;i.lightLine=o.lightLine;var s=i.background=o.background;function c(e){if(a(e)||"string"!=typeof e)return e;var t=e.trim();if("rgb"!==t.substr(0,3))return e;var r=t.match(/^rgba?\s*\(([^()]*)\)$/);if(!r)return e;var n=r[1].trim().split(/\s*[\s,]\s*/),i="a"===t.charAt(3)&&4===n.length;if(!i&&3!==n.length)return e;for(var o=0;o<n.length;o++){if(!n[o].length)return e;if(n[o]=Number(n[o]),!(n[o]>=0))return e;if(3===o)n[o]>1&&(n[o]=1);else if(n[o]>=1)return e}var l=Math.round(255*n[0])+", "+Math.round(255*n[1])+", "+Math.round(255*n[2]);return i?"rgba("+l+", "+n[3]+")":"rgb("+l+")"}i.tinyRGB=function(e){var t=e.toRgb();return"rgb("+Math.round(t.r)+", "+Math.round(t.g)+", "+Math.round(t.b)+")"},i.rgb=function(e){return i.tinyRGB(n(e))},i.opacity=function(e){return e?n(e).getAlpha():0},i.addOpacity=function(e,t){var r=n(e).toRgb();return"rgba("+Math.round(r.r)+", "+Math.round(r.g)+", "+Math.round(r.b)+", "+t+")"},i.combine=function(e,t){var r=n(e).toRgb();if(1===r.a)return n(e).toRgbString();var a=n(t||s).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(e,t,r){var a=n(e);return 1!==a.getAlpha()&&(a=n(i.combine(e,s))),(a.isDark()?t?a.lighten(t):s:r?a.darken(r):l).toString()},i.stroke=function(e,t){var r=n(t);e.style({stroke:i.tinyRGB(r),"stroke-opacity":r.getAlpha()})},i.fill=function(e,t){var r=n(t);e.style({fill:i.tinyRGB(r),"fill-opacity":r.getAlpha()})},i.clean=function(e){if(e&&"object"==typeof e){var t,r,n,a,o=Object.keys(e);for(t=0;t<o.length;t++)if(a=e[n=o[t]],"color"===n.substr(n.length-5))if(Array.isArray(a))for(r=0;r<a.length;r++)a[r]=c(a[r]);else e[n]=c(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]=c(a[r][1]));else if(Array.isArray(a)){var l=a[0];if(!Array.isArray(l)&&l&&"object"==typeof l)for(r=0;r<a.length;r++)i.clean(a[r])}else a&&"object"==typeof a&&i.clean(a)}}},{"./attributes":29,"fast-isnumeric":4,tinycolor2:281}],31:[function(e,t,r){"use strict";var n=e("../../plots/cartesian/layout_attributes"),a=e("../../plots/font_attributes"),i=e("../../lib/extend").extendFlat,o=e("../../plot_api/edit_types").overrideAll;t.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:""}),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,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":143,"../../plot_api/edit_types":175,"../../plots/cartesian/layout_attributes":204,"../../plots/font_attributes":218}],32:[function(e,t,r){"use strict";t.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"}}},{}],33:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plot_api/plot_template"),i=e("../../plots/cartesian/tick_value_defaults"),o=e("../../plots/cartesian/tick_mark_defaults"),l=e("../../plots/cartesian/tick_label_defaults"),s=e("./attributes");t.exports=function(e,t,r){var c=a.newContainer(t,"colorbar"),u=e.colorbar||{};function f(e,t){return n.coerce(u,c,s,e,t)}f("thickness","fraction"===f("thicknessmode")?30/(r.width-r.margin.l-r.margin.r):30),f("len","fraction"===f("lenmode")?1:r.height-r.margin.t-r.margin.b),f("x"),f("xanchor"),f("xpad"),f("y"),f("yanchor"),f("ypad"),n.noneOrAll(u,c,["x","y"]),f("outlinecolor"),f("outlinewidth"),f("bordercolor"),f("borderwidth"),f("bgcolor"),i(u,c,f,"linear");var d={outerTicks:!1,font:r.font};l(u,c,f,"linear",d),o(u,c,f,"linear",d),f("title.text",r._dfltTitle.colorbar),n.coerceFont(f,"title.font",r.font),f("title.side")}},{"../../lib":148,"../../plot_api/plot_template":182,"../../plots/cartesian/tick_label_defaults":211,"../../plots/cartesian/tick_mark_defaults":212,"../../plots/cartesian/tick_value_defaults":213,"./attributes":31}],34:[function(e,t,r){"use strict";var n=e("d3"),a=e("tinycolor2"),i=e("../../plots/plots"),o=e("../../registry"),l=e("../../plots/cartesian/axes"),s=e("../dragelement"),c=e("../../lib"),u=e("../../lib/extend").extendFlat,f=e("../../lib/setcursor"),d=e("../drawing"),p=e("../color"),h=e("../titles"),g=e("../../lib/svg_text_utils"),v=e("../colorscale/helpers").flipScale,m=e("../../plots/cartesian/axis_defaults"),y=e("../../plots/cartesian/position_defaults"),x=e("../../plots/cartesian/layout_attributes"),b=e("../../constants/alignment"),_=b.LINE_SPACING,w=b.FROM_TL,k=b.FROM_BR,T=e("./constants").cn;t.exports={draw:function(e){var t=e._fullLayout._infolayer.selectAll("g."+T.colorbar).data(function(e){var t,r,n,a,i=e._fullLayout,o=e.calcdata,l=[];function s(e){return u(e,{_fillcolor:null,_line:{color:null,width:null,dash:null},_levels:{start:null,end:null,size:null},_filllevels:null,_fillgradient:null,_zrange:null})}function c(){"function"==typeof a.calc?a.calc(e,n,t):(t._fillgradient=r.reversescale?v(r.colorscale):r.colorscale,t._zrange=[r[a.min],r[a.max]])}for(var f=0;f<o.length;f++){var d=o[f],p=(n=d[0].trace)._module.colorbar;if(!0===n.visible&&p)for(var h=Array.isArray(p),g=h?p:[p],m=0;m<g.length;m++){var y=(a=g[m]).container;(r=y?n[y]:n)&&r.showscale&&((t=s(r.colorbar))._id="cb"+n.uid+(h&&y?"-"+y:""),t._traceIndex=n.index,t._propPrefix=(y?y+".":"")+"colorbar.",t._meta=n._meta,c(),l.push(t))}}for(var x in i._colorAxes)if((r=i[x]).showscale){var b=i._colorAxes[x];(t=s(r.colorbar))._id="cb"+x,t._propPrefix=x+".colorbar.",t._meta=i._meta,a={min:"cmin",max:"cmax"},"heatmap"!==b[0]&&(n=b[1],a.calc=n._module.colorbar.calc),c(),l.push(t)}return l}(e),function(e){return e._id});t.enter().append("g").attr("class",function(e){return e._id}).classed(T.colorbar,!0),t.each(function(t){var r=n.select(this);c.ensureSingle(r,"rect",T.cbbg),c.ensureSingle(r,"g",T.cbfills),c.ensureSingle(r,"g",T.cblines),c.ensureSingle(r,"g",T.cbaxis,function(e){e.classed(T.crisp,!0)}),c.ensureSingle(r,"g",T.cbtitleunshift,function(e){e.append("g").classed(T.cbtitle,!0)}),c.ensureSingle(r,"rect",T.cboutline);var v=function(e,t,r){var o=r._fullLayout,s=o._size,f=t._fillcolor,v=t._line,b=t.title,M=b.side,A=t._zrange||n.extent(("function"==typeof f?f:v.color).domain()),L="function"==typeof v.color?v.color:function(){return v.color},S="function"==typeof f?f:function(){return f},C=t._levels,O=function(e,t,r){var n,a,i=t._levels,o=[],l=[],s=i.end+i.size/100,c=i.size,u=1.001*r[0]-.001*r[1],f=1.001*r[1]-.001*r[0];for(a=0;a<1e5&&(n=i.start+a*c,!(c>0?n>=s:n<=s));a++)n>u&&n<f&&o.push(n);if(t._fillgradient)l=[0];else if("function"==typeof t._fillcolor){var d=t._filllevels;if(d)for(s=d.end+d.size/100,c=d.size,a=0;a<1e5&&(n=d.start+a*c,!(c>0?n>=s:n<=s));a++)n>r[0]&&n<r[1]&&l.push(n);else(l=o.map(function(e){return e-i.size/2})).push(l[l.length-1]+i.size)}else t._fillcolor&&"string"==typeof t._fillcolor&&(l=[0]);return i.size<0&&(o.reverse(),l.reverse()),{line:o,fill:l}}(0,t,A),P=O.fill,D=O.line,z=Math.round(t.thickness*("fraction"===t.thicknessmode?s.w:1)),R=z/s.w,E=Math.round(t.len*("fraction"===t.lenmode?s.h:1)),I=E/s.h,F=t.xpad/s.w,N=(t.borderwidth+t.outlinewidth)/2,j=t.ypad/s.h,B=Math.round(t.x*s.w+t.xpad),H=t.x-R*({middle:.5,right:1}[t.xanchor]||0),q=t.y+I*(({top:-.5,bottom:.5}[t.yanchor]||0)-.5),V=Math.round(s.h*(1-q)),U=V-E;t._lenFrac=I,t._thickFrac=R,t._xLeftFrac=H,t._yBottomFrac=q;var G=t._axis=function(e,t,r){var n=e._fullLayout,a={type:"linear",range:r,tickmode:t.tickmode,nticks:t.nticks,tick0:t.tick0,dtick:t.dtick,tickvals:t.tickvals,ticktext:t.ticktext,ticks:t.ticks,ticklen:t.ticklen,tickwidth:t.tickwidth,tickcolor:t.tickcolor,showticklabels:t.showticklabels,tickfont:t.tickfont,tickangle:t.tickangle,tickformat:t.tickformat,exponentformat:t.exponentformat,separatethousands:t.separatethousands,showexponent:t.showexponent,showtickprefix:t.showtickprefix,tickprefix:t.tickprefix,showticksuffix:t.showticksuffix,ticksuffix:t.ticksuffix,title:t.title,showline:!0,anchor:"free",side:"right",position:1},i={type:"linear",_id:"y"+t._id},o={letter:"y",font:n.font,noHover:!0,noTickson:!0,calendar:n.calendar};function l(e,t){return c.coerce(a,i,x,e,t)}return m(a,i,l,o,n),y(a,i,l,o),i}(r,t,A);if(G.position=t.x+F+R,-1!==["top","bottom"].indexOf(M)&&(G.title.side=M,G.titlex=t.x+F,G.titley=q+("top"===b.side?I-j:j)),v.color&&"auto"===t.tickmode){G.tickmode="linear",G.tick0=C.start;var Z=C.size,Y=c.constrain((V-U)/50,4,15)+1,X=(A[1]-A[0])/((t.nticks||Y)*Z);if(X>1){var W=Math.pow(10,Math.floor(Math.log(X)/Math.LN10));Z*=W*c.roundUp(X/W,[2,5,10]),(Math.abs(C.start)/C.size+1e-6)%1<2e-6&&(G.tick0=0)}G.dtick=Z}G.domain=[q+j,q+I-j],G.setScale(),e.attr("transform","translate("+Math.round(s.l)+","+Math.round(s.t)+")");var $,J=e.select("."+T.cbtitleunshift).attr("transform","translate(-"+Math.round(s.l)+",-"+Math.round(s.t)+")"),Q=e.select("."+T.cbaxis),K=0;function ee(n,a){var i={propContainer:G,propName:t._propPrefix+"title",traceIndex:t._traceIndex,_meta:t._meta,placeholder:o._dfltTitle.colorbar,containerGroup:e.select("."+T.cbtitle)},l="h"===n.charAt(0)?n.substr(1):"h"+n;e.selectAll("."+l+",."+l+"-math-group").remove(),h.draw(r,n,u(i,a||{}))}return c.syncOrAsync([i.previousPromises,function(){if(-1!==["top","bottom"].indexOf(M)){var e,r=s.l+(t.x+F)*s.w,n=G.title.font.size;e="top"===M?(1-(q+I-j))*s.h+s.t+3+.75*n:(1-(q+j))*s.h+s.t-3-.25*n,ee(G._id+"title",{attributes:{x:r,y:e,"text-anchor":"start"}})}},function(){if(-1!==["top","bottom"].indexOf(M)){var i=e.select("."+T.cbtitle),o=i.select("text"),u=[-t.outlinewidth/2,t.outlinewidth/2],f=i.select(".h"+G._id+"title-math-group").node(),p=15.6;if(o.node()&&(p=parseInt(o.node().style.fontSize,10)*_),f?(K=d.bBox(f).height)>p&&(u[1]-=(K-p)/2):o.node()&&!o.classed(T.jsPlaceholder)&&(K=d.bBox(o.node()).height),K){if(K+=5,"top"===M)G.domain[1]-=K/s.h,u[1]*=-1;else{G.domain[0]+=K/s.h;var h=g.lineCount(o);u[1]+=(1-h)*p}i.attr("transform","translate("+u+")"),G.setScale()}}e.selectAll("."+T.cbfills+",."+T.cblines).attr("transform","translate(0,"+Math.round(s.h*(1-G.domain[1]))+")"),Q.attr("transform","translate(0,"+Math.round(-s.t)+")");var m=e.select("."+T.cbfills).selectAll("rect."+T.cbfill).data(P);m.enter().append("rect").classed(T.cbfill,!0).style("stroke","none"),m.exit().remove();var y=A.map(G.c2p).map(Math.round).sort(function(e,t){return e-t});m.each(function(e,i){var o=[0===i?A[0]:(P[i]+P[i-1])/2,i===P.length-1?A[1]:(P[i]+P[i+1])/2].map(G.c2p).map(Math.round);o[1]=c.constrain(o[1]+(o[1]>o[0])?1:-1,y[0],y[1]);var l=n.select(this).attr({x:B,width:Math.max(z,2),y:n.min(o),height:Math.max(n.max(o)-n.min(o),2)});if(t._fillgradient)d.gradient(l,r,t._id,"vertical",t._fillgradient,"fill");else{var s=S(e).replace("e-","");l.attr("fill",a(s).toHexString())}});var x=e.select("."+T.cblines).selectAll("path."+T.cbline).data(v.color&&v.width?D:[]);x.enter().append("path").classed(T.cbline,!0),x.exit().remove(),x.each(function(e){n.select(this).attr("d","M"+B+","+(Math.round(G.c2p(e))+v.width/2%1)+"h"+z).call(d.lineGroupStyle,v.width,L(e),v.dash)}),Q.selectAll("g."+G._id+"tick,path").remove();var b=B+z+(t.outlinewidth||0)/2-("outside"===t.ticks?1:0),w=l.calcTicks(G),k=l.makeTransFn(G),C=l.getTickSigns(G)[2];return l.drawTicks(r,G,{vals:"inside"===G.ticks?l.clipEnds(G,w):w,layer:Q,path:l.makeTickPath(G,b,C),transFn:k}),l.drawLabels(r,G,{vals:w,layer:Q,transFn:k,labelFns:l.makeLabelFns(G,b)})},function(){if(-1===["top","bottom"].indexOf(M)){var e=G.title.font.size,t=G._offset+G._length/2,a=s.l+(G.position||0)*s.w+("right"===G.side?10+e*(G.showticklabels?1:.5):-10-e*(G.showticklabels?.5:0));ee("h"+G._id+"title",{avoid:{selection:n.select(r).selectAll("g."+G._id+"tick"),side:M,offsetLeft:s.l,offsetTop:0,maxShift:o.width},attributes:{x:a,y:t,"text-anchor":"middle"},transform:{rotate:"-90",offset:0}})}},i.previousPromises,function(){var n=z+t.outlinewidth/2+d.bBox(Q.node()).width;if(($=J.select("text")).node()&&!$.classed(T.jsPlaceholder)){var a,o=J.select(".h"+G._id+"title-math-group").node();a=o&&-1!==["top","bottom"].indexOf(M)?d.bBox(o).width:d.bBox(J.node()).right-B-s.l,n=Math.max(n,a)}var l=2*t.xpad+n+t.borderwidth+t.outlinewidth/2,c=V-U;e.select("."+T.cbbg).attr({x:B-t.xpad-(t.borderwidth+t.outlinewidth)/2,y:U-N,width:Math.max(l,2),height:Math.max(c+2*N,2)}).call(p.fill,t.bgcolor).call(p.stroke,t.bordercolor).style("stroke-width",t.borderwidth),e.selectAll("."+T.cboutline).attr({x:B,y:U+t.ypad+("top"===M?K:0),width:Math.max(z,2),height:Math.max(c-2*t.ypad-K,2)}).call(p.stroke,t.outlinecolor).style({fill:"none","stroke-width":t.outlinewidth});var u=({center:.5,right:1}[t.xanchor]||0)*l;e.attr("transform","translate("+(s.l-u)+","+s.t+")");var f={},h=w[t.yanchor],g=k[t.yanchor];"pixels"===t.lenmode?(f.y=t.y,f.t=c*h,f.b=c*g):(f.t=f.b=0,f.yt=t.y+t.len*h,f.yb=t.y-t.len*g);var v=w[t.xanchor],m=k[t.xanchor];if("pixels"===t.thicknessmode)f.x=t.x,f.l=l*v,f.r=l*m;else{var y=l-z;f.l=y*v,f.r=y*m,f.xl=t.x-t.thickness*v,f.xr=t.x+t.thickness*m}i.autoMargin(r,t._id,f)}],r)}(r,t,e);v&&v.then&&(e._promises||[]).push(v),e._context.edits.colorbarPosition&&function(e,t,r){var n,a,i,l=r._fullLayout._size;s.init({element:e.node(),gd:r,prepFn:function(){n=e.attr("transform"),f(e)},moveFn:function(r,o){e.attr("transform",n+" translate("+r+","+o+")"),a=s.align(t._xLeftFrac+r/l.w,t._thickFrac,0,1,t.xanchor),i=s.align(t._yBottomFrac-o/l.h,t._lenFrac,0,1,t.yanchor);var c=s.getCursor(a,i,t.xanchor,t.yanchor);f(e,c)},doneFn:function(){if(f(e),void 0!==a&&void 0!==i){var n={};n[t._propPrefix+"x"]=a,n[t._propPrefix+"y"]=i,void 0!==t._traceIndex?o.call("_guiRestyle",r,n,t._traceIndex):o.call("_guiRelayout",r,n)}}})}(r,t,e)}),t.exit().each(function(t){i.autoMargin(e,t._id)}).remove(),t.order()}}},{"../../constants/alignment":125,"../../lib":148,"../../lib/extend":143,"../../lib/setcursor":167,"../../lib/svg_text_utils":169,"../../plots/cartesian/axes":192,"../../plots/cartesian/axis_defaults":194,"../../plots/cartesian/layout_attributes":204,"../../plots/cartesian/position_defaults":207,"../../plots/plots":224,"../../registry":232,"../color":30,"../colorscale/helpers":41,"../dragelement":48,"../drawing":51,"../titles":118,"./constants":32,d3:2,tinycolor2:281}],35:[function(e,t,r){"use strict";var n=e("../../lib");t.exports=function(e){return n.isPlainObject(e.colorbar)}},{"../../lib":148}],36:[function(e,t,r){"use strict";t.exports={moduleType:"component",name:"colorbar",attributes:e("./attributes"),supplyDefaults:e("./defaults"),draw:e("./draw").draw,hasColorbar:e("./has_colorbar")}},{"./attributes":31,"./defaults":33,"./draw":34,"./has_colorbar":35}],37:[function(e,t,r){"use strict";var n=e("../colorbar/attributes"),a=e("../../lib/regex").counter,i=e("./scales.js").scales;Object.keys(i);function o(e){return"`"+e+"`"}t.exports=function(e,t){e=e||"";var r,l=(t=t||{}).cLetter||"c",s=("onlyIfNumerical"in t?t.onlyIfNumerical:Boolean(e),"noScale"in t?t.noScale:"marker.line"===e),c="showScaleDflt"in t?t.showScaleDflt:"z"===l,u="string"==typeof t.colorscaleDflt?i[t.colorscaleDflt]:null,f=t.editTypeOverride||"",d=e?e+".":"";"colorAttr"in t?(r=t.colorAttr,t.colorAttr):o(d+(r={z:"z",c:"color"}[l]));var p=l+"auto",h=l+"min",g=l+"max",v=l+"mid",m=(o(d+p),o(d+h),o(d+g),{});m[h]=m[g]=void 0;var y={};y[p]=!1;var x={};return"color"===r&&(x.color={valType:"color",arrayOk:!0,editType:f||"style"},t.anim&&(x.color.anim=!0)),x[p]={valType:"boolean",dflt:!0,editType:"calc",impliedEdits:m},x[h]={valType:"number",dflt:null,editType:f||"plot",impliedEdits:y},x[g]={valType:"number",dflt:null,editType:f||"plot",impliedEdits:y},x[v]={valType:"number",dflt:null,editType:"calc",impliedEdits:m},x.colorscale={valType:"colorscale",editType:"calc",dflt:u,impliedEdits:{autocolorscale:!1}},x.autocolorscale={valType:"boolean",dflt:!1!==t.autoColorDflt,editType:"calc",impliedEdits:{colorscale:void 0}},x.reversescale={valType:"boolean",dflt:!1,editType:"plot"},s||(x.showscale={valType:"boolean",dflt:c,editType:"calc"},x.colorbar=n),t.noColorAxis||(x.coloraxis={valType:"subplotid",regex:a("coloraxis"),dflt:null,editType:"calc"}),x}},{"../../lib/regex":163,"../colorbar/attributes":31,"./scales.js":45}],38:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("../../lib"),i=e("./helpers").extractOpts;t.exports=function(e,t,r){var o,l=e._fullLayout,s=r.vals,c=r.containerStr,u=c?a.nestedProperty(t,c).get():t,f=i(u),d=!1!==f.auto,p=f.min,h=f.max,g=f.mid,v=function(){return a.aggNums(Math.min,null,s)},m=function(){return a.aggNums(Math.max,null,s)};(void 0===p?p=v():d&&(p=u._colorAx&&n(p)?Math.min(p,v()):v()),void 0===h?h=m():d&&(h=u._colorAx&&n(h)?Math.max(h,m()):m()),d&&void 0!==g&&(h-g>g-p?p=g-(h-g):h-g<g-p&&(h=g+(g-p))),p===h&&(p-=.5,h+=.5),f._sync("min",p),f._sync("max",h),f.autocolorscale)&&(o=p*h<0?l.colorscale.diverging:p>=0?l.colorscale.sequential:l.colorscale.sequentialminus,f._sync("colorscale",o))}},{"../../lib":148,"./helpers":41,"fast-isnumeric":4}],39:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./helpers").hasColorscale,i=e("./helpers").extractOpts;t.exports=function(e,t){function r(e,t){var r=e["_"+t];void 0!==r&&(e[t]=r)}function o(e,a){var o=a.container?n.nestedProperty(e,a.container).get():e;if(o)if(o.coloraxis)o._colorAx=t[o.coloraxis];else{var l=i(o),s=l.auto;(s||void 0===l.min)&&r(o,a.min),(s||void 0===l.max)&&r(o,a.max),l.autocolorscale&&r(o,"colorscale")}}for(var l=0;l<e.length;l++){var s=e[l],c=s._module.colorbar;if(c)if(Array.isArray(c))for(var u=0;u<c.length;u++)o(s,c[u]);else o(s,c);a(s,"marker.line")&&o(s,{container:"marker.line",min:"cmin",max:"cmax"})}for(var f in t._colorAxes)o(t[f],{min:"cmin",max:"cmax"})}},{"../../lib":148,"./helpers":41}],40:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("../../lib"),i=e("../colorbar/has_colorbar"),o=e("../colorbar/defaults"),l=e("./scales").isValid,s=e("../../registry").traceIs;function c(e,t){var r=t.slice(0,t.length-1);return t?a.nestedProperty(e,r).get()||{}:e}t.exports=function e(t,r,u,f,d){var p=d.prefix,h=d.cLetter,g="_module"in r,v=c(t,p),m=c(r,p),y=c(r._template||{},p)||{},x=function(){return delete t.coloraxis,delete r.coloraxis,e(t,r,u,f,d)};if(g){var b=u._colorAxes||{},_=f(p+"coloraxis");if(_){var w=s(r,"contour")&&a.nestedProperty(r,"contours.coloring").get()||"heatmap",k=b[_];return void(k?(k[2].push(x),k[0]!==w&&(k[0]=!1,a.warn(["Ignoring coloraxis:",_,"setting","as it is linked to incompatible colorscales."].join(" ")))):b[_]=[w,r,[x]])}}var T=v[h+"min"],M=v[h+"max"],A=n(T)&&n(M)&&T<M;f(p+h+"auto",!A)?f(p+h+"mid"):(f(p+h+"min"),f(p+h+"max"));var L,S,C=v.colorscale,O=y.colorscale;(void 0!==C&&(L=!l(C)),void 0!==O&&(L=!l(O)),f(p+"autocolorscale",L),f(p+"colorscale"),f(p+"reversescale"),"marker.line."!==p)&&(p&&g&&(S=i(v)),f(p+"showscale",S)&&(p&&y&&(m._template=y),o(v,m,u)))}},{"../../lib":148,"../../registry":232,"../colorbar/defaults":33,"../colorbar/has_colorbar":35,"./scales":45,"fast-isnumeric":4}],41:[function(e,t,r){"use strict";var n=e("d3"),a=e("tinycolor2"),i=e("fast-isnumeric"),o=e("../../lib"),l=e("../color"),s=e("./scales").isValid;var c=["showscale","autocolorscale","colorscale","reversescale","colorbar"],u=["min","max","mid","auto"];function f(e){var t,r,n,a=e._colorAx,i=a||e,o={};for(r=0;r<c.length;r++)o[n=c[r]]=i[n];if(a)for(t="c",r=0;r<u.length;r++)o[n=u[r]]=i["c"+n];else{var l;for(r=0;r<u.length;r++)(l="c"+(n=u[r]))in i?o[n]=i[l]:(l="z"+n)in i&&(o[n]=i[l]);t=l.charAt(0)}return o._sync=function(e,r){var n=-1!==u.indexOf(e)?t+e:e;i[n]=i["_"+n]=r},o}function d(e){for(var t=f(e),r=t.min,n=t.max,a=t.reversescale?p(t.colorscale):t.colorscale,i=a.length,o=new Array(i),l=new Array(i),s=0;s<i;s++){var c=a[s];o[s]=r+c[0]*(n-r),l[s]=c[1]}return{domain:o,range:l}}function p(e){for(var t=e.length,r=new Array(t),n=t-1,a=0;n>=0;n--,a++){var i=e[n];r[a]=[1-i[0],i[1]]}return r}function h(e,t){t=t||{};for(var r=e.domain,o=e.range,s=o.length,c=new Array(s),u=0;u<s;u++){var f=a(o[u]).toRgb();c[u]=[f.r,f.g,f.b,f.a]}var d,p=n.scale.linear().domain(r).range(c).clamp(!0),h=t.noNumericCheck,v=t.returnArray;return(d=h&&v?p:h?function(e){return g(p(e))}:v?function(e){return i(e)?p(e):a(e).isValid()?e:l.defaultLine}:function(e){return i(e)?g(p(e)):a(e).isValid()?e:l.defaultLine}).domain=p.domain,d.range=function(){return o},d}function g(e){var t={r:e[0],g:e[1],b:e[2],a:e[3]};return a(t).toRgbString()}t.exports={hasColorscale:function(e,t,r){var n=t?o.nestedProperty(e,t).get()||{}:e,a=n[r||"color"],l=!1;if(o.isArrayOrTypedArray(a))for(var c=0;c<a.length;c++)if(i(a[c])){l=!0;break}return o.isPlainObject(n)&&(l||!0===n.showscale||i(n.cmin)&&i(n.cmax)||s(n.colorscale)||o.isPlainObject(n.colorbar))},extractOpts:f,extractScale:d,flipScale:p,makeColorScaleFunc:h,makeColorScaleFuncFromTrace:function(e,t){return h(d(e),t)}}},{"../../lib":148,"../color":30,"./scales":45,d3:2,"fast-isnumeric":4,tinycolor2:281}],42:[function(e,t,r){"use strict";var n=e("./scales"),a=e("./helpers");t.exports={moduleType:"component",name:"colorscale",attributes:e("./attributes"),layoutAttributes:e("./layout_attributes"),supplyLayoutDefaults:e("./layout_defaults"),handleDefaults:e("./defaults"),crossTraceDefaults:e("./cross_trace_defaults"),calc:e("./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":37,"./calc":38,"./cross_trace_defaults":39,"./defaults":40,"./helpers":41,"./layout_attributes":43,"./layout_defaults":44,"./scales":45}],43:[function(e,t,r){"use strict";var n=e("../../lib/extend").extendFlat,a=e("./attributes"),i=e("./scales").scales;t.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":143,"./attributes":37,"./scales":45}],44:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plot_api/plot_template"),i=e("./layout_attributes"),o=e("./defaults");t.exports=function(e,t){function r(r,a){return n.coerce(e,t,i,r,a)}r("colorscale.sequential"),r("colorscale.sequentialminus"),r("colorscale.diverging");var l,s,c=t._colorAxes;function u(e,t){return n.coerce(l,s,i.coloraxis,e,t)}for(var f in c){var d=c[f];if(d[0])l=e[f]||{},(s=a.newContainer(t,f,"coloraxis"))._name=f,o(l,s,t,u,{prefix:"",cLetter:"c"});else{for(var p=0;p<d[2].length;p++)d[2][p]();delete t._colorAxes[f]}}}},{"../../lib":148,"../../plot_api/plot_template":182,"./defaults":40,"./layout_attributes":43}],45:[function(e,t,r){"use strict";var n=e("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(e){var t=0;if(!Array.isArray(e)||e.length<2)return!1;if(!e[0]||!e[e.length-1])return!1;if(0!=+e[0][0]||1!=+e[e.length-1][0])return!1;for(var r=0;r<e.length;r++){var a=e[r];if(2!==a.length||+a[0]<t||!n(a[1]).isValid())return!1;t=+a[0]}return!0}t.exports={scales:a,defaultScale:i,get:function(e,t){if(t||(t=i),!e)return t;function r(){try{e=a[e]||JSON.parse(e)}catch(r){e=t}}return"string"==typeof e&&(r(),"string"==typeof e&&r()),o(e)?e:t},isValid:function(e){return void 0!==a[e]||o(e)}}},{tinycolor2:281}],46:[function(e,t,r){"use strict";t.exports=function(e,t,r,n,a){var i=(e-r)/(n-r),o=i+t/(n-r),l=(i+o)/2;return"left"===a||"bottom"===a?i:"center"===a||"middle"===a?l:"right"===a||"top"===a?o:i<2/3-l?i:o>4/3-l?o:l}},{}],47:[function(e,t,r){"use strict";var n=e("../../lib"),a=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];t.exports=function(e,t,r,i){return e="left"===r?0:"center"===r?1:"right"===r?2:n.constrain(Math.floor(3*e),0,2),t="bottom"===i?0:"middle"===i?1:"top"===i?2:n.constrain(Math.floor(3*t),0,2),a[t][e]}},{"../../lib":148}],48:[function(e,t,r){"use strict";var n=e("mouse-event-offset"),a=e("has-hover"),i=e("has-passive-events"),o=e("../../lib").removeElement,l=e("../../plots/cartesian/constants"),s=t.exports={};s.align=e("./align"),s.getCursor=e("./cursor");var c=e("./unhover");function u(){var e=document.createElement("div");e.className="dragcover";var t=e.style;return t.position="fixed",t.left=0,t.right=0,t.top=0,t.bottom=0,t.zIndex=999999999,t.background="none",document.body.appendChild(e),e}function f(e){return n(e.changedTouches?e.changedTouches[0]:e,document.body)}s.unhover=c.wrapped,s.unhoverRaw=c.raw,s.init=function(e){var t,r,n,c,d,p,h,g,v=e.gd,m=1,y=v._context.doubleClickDelay,x=e.element;v._mouseDownTime||(v._mouseDownTime=0),x.style.pointerEvents="all",x.onmousedown=_,i?(x._ontouchstart&&x.removeEventListener("touchstart",x._ontouchstart),x._ontouchstart=_,x.addEventListener("touchstart",_,{passive:!1})):x.ontouchstart=_;var b=e.clampFn||function(e,t,r){return Math.abs(e)<r&&(e=0),Math.abs(t)<r&&(t=0),[e,t]};function _(i){v._dragged=!1,v._dragging=!0;var o=f(i);t=o[0],r=o[1],h=i.target,p=i,g=2===i.buttons||i.ctrlKey,void 0===i.clientX&&void 0===i.clientY&&(i.clientX=t,i.clientY=r),(n=(new Date).getTime())-v._mouseDownTime<y?m+=1:(m=1,v._mouseDownTime=n),e.prepFn&&e.prepFn(i,t,r),a&&!g?(d=u()).style.cursor=window.getComputedStyle(x).cursor:a||(d=document,c=window.getComputedStyle(document.documentElement).cursor,document.documentElement.style.cursor=window.getComputedStyle(x).cursor),document.addEventListener("mouseup",k),document.addEventListener("touchend",k),!1!==e.dragmode&&(i.preventDefault(),document.addEventListener("mousemove",w),document.addEventListener("touchmove",w,{passive:!1}))}function w(n){n.preventDefault();var a=f(n),i=e.minDrag||l.MINDRAG,o=b(a[0]-t,a[1]-r,i),c=o[0],u=o[1];(c||u)&&(v._dragged=!0,s.unhover(v)),v._dragged&&e.moveFn&&!g&&(v._dragdata={element:x,dx:c,dy:u},e.moveFn(c,u))}function k(t){if(delete v._dragdata,!1!==e.dragmode&&(t.preventDefault(),document.removeEventListener("mousemove",w),document.removeEventListener("touchmove",w)),document.removeEventListener("mouseup",k),document.removeEventListener("touchend",k),a?o(d):c&&(d.documentElement.style.cursor=c,c=null),v._dragging){if(v._dragging=!1,(new Date).getTime()-v._mouseDownTime>y&&(m=Math.max(m-1,1)),v._dragged)e.doneFn&&e.doneFn();else if(e.clickFn&&e.clickFn(m,p),!g){var r;try{r=new MouseEvent("click",t)}catch(e){var n=f(t);(r=document.createEvent("MouseEvents")).initMouseEvent("click",t.bubbles,t.cancelable,t.view,t.detail,t.screenX,t.screenY,n[0],n[1],t.ctrlKey,t.altKey,t.shiftKey,t.metaKey,t.button,t.relatedTarget)}h.dispatchEvent(r)}v._dragging=!1,v._dragged=!1}else v._dragged=!1}},s.coverSlip=u},{"../../lib":148,"../../plots/cartesian/constants":198,"./align":46,"./cursor":47,"./unhover":49,"has-hover":6,"has-passive-events":7,"mouse-event-offset":10}],49:[function(e,t,r){"use strict";var n=e("../../lib/events"),a=e("../../lib/throttle"),i=e("../../lib/dom").getGraphDiv,o=e("../fx/constants"),l=t.exports={};l.wrapped=function(e,t,r){(e=i(e))._fullLayout&&a.clear(e._fullLayout._uid+o.HOVERID),l.raw(e,t,r)},l.raw=function(e,t){var r=e._fullLayout,a=e._hoverdata;t||(t={}),t.target&&!1===n.triggerHandler(e,"plotly_beforehover",t)||(r._hoverlayer.selectAll("g").remove(),r._hoverlayer.selectAll("line").remove(),r._hoverlayer.selectAll("circle").remove(),e._hoverdata=void 0,t.target&&a&&e.emit("plotly_unhover",{event:t,points:a}))}},{"../../lib/dom":141,"../../lib/events":142,"../../lib/throttle":170,"../fx/constants":63}],50:[function(e,t,r){"use strict";r.dash={valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid",editType:"style"}},{}],51:[function(e,t,r){"use strict";var n=e("d3"),a=e("fast-isnumeric"),i=e("tinycolor2"),o=e("../../registry"),l=e("../color"),s=e("../colorscale"),c=e("../../lib"),u=e("../../lib/svg_text_utils"),f=e("../../constants/xmlns_namespaces"),d=e("../../constants/alignment").LINE_SPACING,p=e("../../constants/interactions").DESELECTDIM,h=e("../../traces/scatter/subtypes"),g=e("../../traces/scatter/make_bubble_size_func"),v=e("../../components/fx/helpers").appendArrayPointValue,m=t.exports={};m.font=function(e,t,r,n){c.isPlainObject(t)&&(n=t.color,r=t.size,t=t.family),t&&e.style("font-family",t),r+1&&e.style("font-size",r+"px"),n&&e.call(l.fill,n)},m.setPosition=function(e,t,r){e.attr("x",t).attr("y",r)},m.setSize=function(e,t,r){e.attr("width",t).attr("height",r)},m.setRect=function(e,t,r,n,a){e.call(m.setPosition,t,r).call(m.setSize,n,a)},m.translatePoint=function(e,t,r,n){var i=r.c2p(e.x),o=n.c2p(e.y);return!!(a(i)&&a(o)&&t.node())&&("text"===t.node().nodeName?t.attr("x",i).attr("y",o):t.attr("transform","translate("+i+","+o+")"),!0)},m.translatePoints=function(e,t,r){e.each(function(e){var a=n.select(this);m.translatePoint(e,a,t,r)})},m.hideOutsideRangePoint=function(e,t,r,n,a,i){t.attr("display",r.isPtWithinRange(e,a)&&n.isPtWithinRange(e,i)?null:"none")},m.hideOutsideRangePoints=function(e,t){if(t._hasClipOnAxisFalse){var r=t.xaxis,a=t.yaxis;e.each(function(t){var i=t[0].trace,l=i.xcalendar,s=i.ycalendar,c=o.traceIs(i,"bar-like")?".bartext":".point,.textpoint";e.selectAll(c).each(function(e){m.hideOutsideRangePoint(e,n.select(this),r,a,l,s)})})}},m.crispRound=function(e,t,r){return t&&a(t)?e._context.staticPlot?t:t<1?1:Math.round(t):r||0},m.singleLineStyle=function(e,t,r,n,a){t.style("fill","none");var i=(((e||[])[0]||{}).trace||{}).line||{},o=r||i.width||0,s=a||i.dash||"";l.stroke(t,n||i.color),m.dashLine(t,s,o)},m.lineGroupStyle=function(e,t,r,a){e.style("fill","none").each(function(e){var i=(((e||[])[0]||{}).trace||{}).line||{},o=t||i.width||0,s=a||i.dash||"";n.select(this).call(l.stroke,r||i.color).call(m.dashLine,s,o)})},m.dashLine=function(e,t,r){r=+r||0,t=m.dashStyle(t,r),e.style({"stroke-dasharray":t,"stroke-width":r+"px"})},m.dashStyle=function(e,t){t=+t||1;var r=Math.max(t,3);return"solid"===e?e="":"dot"===e?e=r+"px,"+r+"px":"dash"===e?e=3*r+"px,"+3*r+"px":"longdash"===e?e=5*r+"px,"+5*r+"px":"dashdot"===e?e=3*r+"px,"+r+"px,"+r+"px,"+r+"px":"longdashdot"===e&&(e=5*r+"px,"+2*r+"px,"+r+"px,"+2*r+"px"),e},m.singleFillStyle=function(e){var t=(((n.select(e.node()).data()[0]||[])[0]||{}).trace||{}).fillcolor;t&&e.call(l.fill,t)},m.fillGroupStyle=function(e){e.style("stroke-width",0).each(function(e){var t=n.select(this);e[0].trace&&t.call(l.fill,e[0].trace.fillcolor)})};var y=e("./symbol_defs");m.symbolNames=[],m.symbolFuncs=[],m.symbolNeedLines={},m.symbolNoDot={},m.symbolNoFill={},m.symbolList=[],Object.keys(y).forEach(function(e){var t=y[e],r=t.n;m.symbolList.push(r,e,r+100,e+"-open"),m.symbolNames[r]=e,m.symbolFuncs[r]=t.f,t.needLine&&(m.symbolNeedLines[r]=!0),t.noDot?m.symbolNoDot[r]=!0:m.symbolList.push(r+200,e+"-dot",r+300,e+"-open-dot"),t.noFill&&(m.symbolNoFill[r]=!0)});var x=m.symbolNames.length,b="M0,0.5L0.5,0L0,-0.5L-0.5,0Z";function _(e,t){var r=e%100;return m.symbolFuncs[r](t)+(e>=200?b:"")}m.symbolNumber=function(e){if("string"==typeof e){var t=0;e.indexOf("-open")>0&&(t=100,e=e.replace("-open","")),e.indexOf("-dot")>0&&(t+=200,e=e.replace("-dot","")),(e=m.symbolNames.indexOf(e))>=0&&(e+=t)}return e%100>=x||e>=400?0:Math.floor(Math.max(e,0))};var w={x1:1,x2:0,y1:0,y2:0},k={x1:0,x2:0,y1:1,y2:0},T=n.format("~.1f"),M={radial:{node:"radialGradient"},radialreversed:{node:"radialGradient",reversed:!0},horizontal:{node:"linearGradient",attrs:w},horizontalreversed:{node:"linearGradient",attrs:w,reversed:!0},vertical:{node:"linearGradient",attrs:k},verticalreversed:{node:"linearGradient",attrs:k,reversed:!0}};m.gradient=function(e,t,r,a,o,s){for(var u=o.length,f=M[a],d=new Array(u),p=0;p<u;p++)f.reversed?d[u-1-p]=[T(100*(1-o[p][0])),o[p][1]]:d[p]=[T(100*o[p][0]),o[p][1]];var h=t._fullLayout,g="g"+h._uid+"-"+r,v=h._defs.select(".gradients").selectAll("#"+g).data([a+d.join(";")],c.identity);v.exit().remove(),v.enter().append(f.node).each(function(){var e=n.select(this);f.attrs&&e.attr(f.attrs),e.attr("id",g);var t=e.selectAll("stop").data(d);t.exit().remove(),t.enter().append("stop"),t.each(function(e){var t=i(e[1]);n.select(this).attr({offset:e[0]+"%","stop-color":l.tinyRGB(t),"stop-opacity":t.getAlpha()})})}),e.style(s,E(g,t)).style(s+"-opacity",null);var m=function(e){return"."+e.attr("class").replace(/\s/g,".")},y=m(n.select(e.node().parentNode))+">"+m(e);h._gradientUrlQueryParts[y]=1},m.initGradients=function(e){var t=e._fullLayout;c.ensureSingle(t._defs,"g","gradients").selectAll("linearGradient,radialGradient").remove(),t._gradientUrlQueryParts={}},m.pointStyle=function(e,t,r){if(e.size()){var a=m.makePointStyleFns(t);e.each(function(e){m.singlePointStyle(e,n.select(this),t,a,r)})}},m.singlePointStyle=function(e,t,r,n,a){var i=r.marker,o=i.line;if(t.style("opacity",n.selectedOpacityFn?n.selectedOpacityFn(e):void 0===e.mo?i.opacity:e.mo),n.ms2mrc){var s;s="various"===e.ms||"various"===i.size?3:n.ms2mrc(e.ms),e.mrc=s,n.selectedSizeFn&&(s=e.mrc=n.selectedSizeFn(e));var u=m.symbolNumber(e.mx||i.symbol)||0;e.om=u%200>=100,t.attr("d",_(u,s))}var f,d,p,h=!1;if(e.so)p=o.outlierwidth,d=o.outliercolor,f=i.outliercolor;else{var g=(o||{}).width;p=(e.mlw+1||g+1||(e.trace?(e.trace.marker.line||{}).width:0)+1)-1||0,d="mlc"in e?e.mlcc=n.lineScale(e.mlc):c.isArrayOrTypedArray(o.color)?l.defaultLine:o.color,c.isArrayOrTypedArray(i.color)&&(f=l.defaultLine,h=!0),f="mc"in e?e.mcc=n.markerScale(e.mc):i.color||"rgba(0,0,0,0)",n.selectedColorFn&&(f=n.selectedColorFn(e))}if(e.om)t.call(l.stroke,f).style({"stroke-width":(p||1)+"px",fill:"none"});else{t.style("stroke-width",(e.isBlank?0:p)+"px");var v=i.gradient,y=e.mgt;if(y?h=!0:y=v&&v.type,Array.isArray(y)&&(y=y[0],M[y]||(y=0)),y&&"none"!==y){var x=e.mgc;x?h=!0:x=v.color;var b=r.uid;h&&(b+="-"+e.i),m.gradient(t,a,b,y,[[0,x],[1,f]],"fill")}else l.fill(t,f);p&&l.stroke(t,d)}},m.makePointStyleFns=function(e){var t={},r=e.marker;return t.markerScale=m.tryColorscale(r,""),t.lineScale=m.tryColorscale(r,"line"),o.traceIs(e,"symbols")&&(t.ms2mrc=h.isBubble(e)?g(e):function(){return(r.size||6)/2}),e.selectedpoints&&c.extendFlat(t,m.makeSelectedPointStyleFns(e)),t},m.makeSelectedPointStyleFns=function(e){var t={},r=e.selected||{},n=e.unselected||{},a=e.marker||{},i=r.marker||{},l=n.marker||{},s=a.opacity,u=i.opacity,f=l.opacity,d=void 0!==u,h=void 0!==f;(c.isArrayOrTypedArray(s)||d||h)&&(t.selectedOpacityFn=function(e){var t=void 0===e.mo?a.opacity:e.mo;return e.selected?d?u:t:h?f:p*t});var g=a.color,v=i.color,m=l.color;(v||m)&&(t.selectedColorFn=function(e){var t=e.mcc||g;return e.selected?v||t:m||t});var y=a.size,x=i.size,b=l.size,_=void 0!==x,w=void 0!==b;return o.traceIs(e,"symbols")&&(_||w)&&(t.selectedSizeFn=function(e){var t=e.mrc||y/2;return e.selected?_?x/2:t:w?b/2:t}),t},m.makeSelectedTextStyleFns=function(e){var t={},r=e.selected||{},n=e.unselected||{},a=e.textfont||{},i=r.textfont||{},o=n.textfont||{},s=a.color,c=i.color,u=o.color;return t.selectedTextColorFn=function(e){var t=e.tc||s;return e.selected?c||t:u||(c?t:l.addOpacity(t,p))},t},m.selectedPointStyle=function(e,t){if(e.size()&&t.selectedpoints){var r=m.makeSelectedPointStyleFns(t),a=t.marker||{},i=[];r.selectedOpacityFn&&i.push(function(e,t){e.style("opacity",r.selectedOpacityFn(t))}),r.selectedColorFn&&i.push(function(e,t){l.fill(e,r.selectedColorFn(t))}),r.selectedSizeFn&&i.push(function(e,t){var n=t.mx||a.symbol||0,i=r.selectedSizeFn(t);e.attr("d",_(m.symbolNumber(n),i)),t.mrc2=i}),i.length&&e.each(function(e){for(var t=n.select(this),r=0;r<i.length;r++)i[r](t,e)})}},m.tryColorscale=function(e,t){var r=t?c.nestedProperty(e,t).get():e;if(r){var n=r.color;if((r.colorscale||r._colorAx)&&c.isArrayOrTypedArray(n))return s.makeColorScaleFuncFromTrace(r)}return c.identity};var A={start:1,end:-1,middle:0,bottom:1,top:-1};function L(e,t,r,a){var i=n.select(e.node().parentNode),o=-1!==t.indexOf("top")?"top":-1!==t.indexOf("bottom")?"bottom":"middle",l=-1!==t.indexOf("left")?"end":-1!==t.indexOf("right")?"start":"middle",s=a?a/.8+1:0,c=(u.lineCount(e)-1)*d+1,f=A[l]*s,p=.75*r+A[o]*s+(A[o]-1)*c*r/2;e.attr("text-anchor",l),i.attr("transform","translate("+f+","+p+")")}function S(e,t){var r=e.ts||t.textfont.size;return a(r)&&r>0?r:0}m.textPointStyle=function(e,t,r){if(e.size()){var a;if(t.selectedpoints){var i=m.makeSelectedTextStyleFns(t);a=i.selectedTextColorFn}var o=t.texttemplate,l=r._fullLayout;e.each(function(e){var i=n.select(this),s=o?c.extractOption(e,t,"txt","texttemplate"):c.extractOption(e,t,"tx","text");if(s||0===s){if(o){var f=t._module.formatLabels?t._module.formatLabels(e,t,l):{},d={};v(d,t,e.i);var p=t._meta||{};s=c.texttemplateString(s,f,l._d3locale,d,e,p)}var h=e.tp||t.textposition,g=S(e,t),y=a?a(e):e.tc||t.textfont.color;i.call(m.font,e.tf||t.textfont.family,g,y).text(s).call(u.convertToTspans,r).call(L,h,g,e.mrc)}else i.remove()})}},m.selectedTextStyle=function(e,t){if(e.size()&&t.selectedpoints){var r=m.makeSelectedTextStyleFns(t);e.each(function(e){var a=n.select(this),i=r.selectedTextColorFn(e),o=e.tp||t.textposition,s=S(e,t);l.fill(a,i),L(a,o,s,e.mrc2||e.mrc)})}};var C=.5;function O(e,t,r,a){var i=e[0]-t[0],o=e[1]-t[1],l=r[0]-t[0],s=r[1]-t[1],c=Math.pow(i*i+o*o,C/2),u=Math.pow(l*l+s*s,C/2),f=(u*u*i-c*c*l)*a,d=(u*u*o-c*c*s)*a,p=3*u*(c+u),h=3*c*(c+u);return[[n.round(t[0]+(p&&f/p),2),n.round(t[1]+(p&&d/p),2)],[n.round(t[0]-(h&&f/h),2),n.round(t[1]-(h&&d/h),2)]]}m.smoothopen=function(e,t){if(e.length<3)return"M"+e.join("L");var r,n="M"+e[0],a=[];for(r=1;r<e.length-1;r++)a.push(O(e[r-1],e[r],e[r+1],t));for(n+="Q"+a[0][0]+" "+e[1],r=2;r<e.length-1;r++)n+="C"+a[r-2][1]+" "+a[r-1][0]+" "+e[r];return n+="Q"+a[e.length-3][1]+" "+e[e.length-1]},m.smoothclosed=function(e,t){if(e.length<3)return"M"+e.join("L")+"Z";var r,n="M"+e[0],a=e.length-1,i=[O(e[a],e[0],e[1],t)];for(r=1;r<a;r++)i.push(O(e[r-1],e[r],e[r+1],t));for(i.push(O(e[a-1],e[a],e[0],t)),r=1;r<=a;r++)n+="C"+i[r-1][1]+" "+i[r][0]+" "+e[r];return n+="C"+i[a][1]+" "+i[0][0]+" "+e[0]+"Z"};var P={hv:function(e,t){return"H"+n.round(t[0],2)+"V"+n.round(t[1],2)},vh:function(e,t){return"V"+n.round(t[1],2)+"H"+n.round(t[0],2)},hvh:function(e,t){return"H"+n.round((e[0]+t[0])/2,2)+"V"+n.round(t[1],2)+"H"+n.round(t[0],2)},vhv:function(e,t){return"V"+n.round((e[1]+t[1])/2,2)+"H"+n.round(t[0],2)+"V"+n.round(t[1],2)}},D=function(e,t){return"L"+n.round(t[0],2)+","+n.round(t[1],2)};m.steps=function(e){var t=P[e]||D;return function(e){for(var r="M"+n.round(e[0][0],2)+","+n.round(e[0][1],2),a=1;a<e.length;a++)r+=t(e[a-1],e[a]);return r}},m.makeTester=function(){var e=c.ensureSingleById(n.select("body"),"svg","js-plotly-tester",function(e){e.attr(f.svgAttrs).style({position:"absolute",left:"-10000px",top:"-10000px",width:"9000px",height:"9000px","z-index":"1"})}),t=c.ensureSingle(e,"path","js-reference-point",function(e){e.attr("d","M0,0H1V1H0Z").style({"stroke-width":0,fill:"black"})});m.tester=e,m.testref=t},m.savedBBoxes={};var z=0;function R(e){var t=e.getAttribute("data-unformatted");if(null!==t)return t+e.getAttribute("data-math")+e.getAttribute("text-anchor")+e.getAttribute("style")}function E(e,t){if(!e)return null;var r=t._context;return"url('"+(r._exportedPlot?"":r._baseUrl||"")+"#"+e+"')"}m.bBox=function(e,t,r){var a,i,o;if(r||(r=R(e)),r){if(a=m.savedBBoxes[r])return c.extendFlat({},a)}else if(1===e.childNodes.length){var l=e.childNodes[0];if(r=R(l)){var s=+l.getAttribute("x")||0,f=+l.getAttribute("y")||0,d=l.getAttribute("transform");if(!d){var p=m.bBox(l,!1,r);return s&&(p.left+=s,p.right+=s),f&&(p.top+=f,p.bottom+=f),p}if(r+="~"+s+"~"+f+"~"+d,a=m.savedBBoxes[r])return c.extendFlat({},a)}}t?i=e:(o=m.tester.node(),i=e.cloneNode(!0),o.appendChild(i)),n.select(i).attr("transform",null).call(u.positionText,0,0);var h=i.getBoundingClientRect(),g=m.testref.node().getBoundingClientRect();t||o.removeChild(i);var v={height:h.height,width:h.width,left:h.left-g.left,top:h.top-g.top,right:h.right-g.left,bottom:h.bottom-g.top};return z>=1e4&&(m.savedBBoxes={},z=0),r&&(m.savedBBoxes[r]=v),z++,c.extendFlat({},v)},m.setClipUrl=function(e,t,r){e.attr("clip-path",E(t,r))},m.getTranslate=function(e){var t=(e[e.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\btranslate\((-?\d*\.?\d*)[^-\d]*(-?\d*\.?\d*)[^\d].*/,function(e,t,r){return[t,r].join(" ")}).split(" ");return{x:+t[0]||0,y:+t[1]||0}},m.setTranslate=function(e,t,r){var n=e.attr?"attr":"getAttribute",a=e.attr?"attr":"setAttribute",i=e[n]("transform")||"";return t=t||0,r=r||0,i=i.replace(/(\btranslate\(.*?\);?)/,"").trim(),i=(i+=" translate("+t+", "+r+")").trim(),e[a]("transform",i),i},m.getScale=function(e){var t=(e[e.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\bscale\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/,function(e,t,r){return[t,r].join(" ")}).split(" ");return{x:+t[0]||1,y:+t[1]||1}},m.setScale=function(e,t,r){var n=e.attr?"attr":"getAttribute",a=e.attr?"attr":"setAttribute",i=e[n]("transform")||"";return t=t||1,r=r||1,i=i.replace(/(\bscale\(.*?\);?)/,"").trim(),i=(i+=" scale("+t+", "+r+")").trim(),e[a]("transform",i),i};var I=/\s*sc.*/;m.setPointGroupScale=function(e,t,r){if(t=t||1,r=r||1,e){var n=1===t&&1===r?"":" scale("+t+","+r+")";e.each(function(){var e=(this.getAttribute("transform")||"").replace(I,"");e=(e+=n).trim(),this.setAttribute("transform",e)})}};var F=/translate\([^)]*\)\s*$/;m.setTextPointsScale=function(e,t,r){e&&e.each(function(){var e,a=n.select(this),i=a.select("text");if(i.node()){var o=parseFloat(i.attr("x")||0),l=parseFloat(i.attr("y")||0),s=(a.attr("transform")||"").match(F);e=1===t&&1===r?[]:["translate("+o+","+l+")","scale("+t+","+r+")","translate("+-o+","+-l+")"],s&&e.push(s),a.attr("transform",e.join(" "))}})}},{"../../components/fx/helpers":65,"../../constants/alignment":125,"../../constants/interactions":127,"../../constants/xmlns_namespaces":129,"../../lib":148,"../../lib/svg_text_utils":169,"../../registry":232,"../../traces/scatter/make_bubble_size_func":261,"../../traces/scatter/subtypes":268,"../color":30,"../colorscale":42,"./symbol_defs":52,d3:2,"fast-isnumeric":4,tinycolor2:281}],52:[function(e,t,r){"use strict";var n=e("d3");t.exports={circle:{n:0,f:function(e){var t=n.round(e,2);return"M"+t+",0A"+t+","+t+" 0 1,1 0,-"+t+"A"+t+","+t+" 0 0,1 "+t+",0Z"}},square:{n:1,f:function(e){var t=n.round(e,2);return"M"+t+","+t+"H-"+t+"V-"+t+"H"+t+"Z"}},diamond:{n:2,f:function(e){var t=n.round(1.3*e,2);return"M"+t+",0L0,"+t+"L-"+t+",0L0,-"+t+"Z"}},cross:{n:3,f:function(e){var t=n.round(.4*e,2),r=n.round(1.2*e,2);return"M"+r+","+t+"H"+t+"V"+r+"H-"+t+"V"+t+"H-"+r+"V-"+t+"H-"+t+"V-"+r+"H"+t+"V-"+t+"H"+r+"Z"}},x:{n:4,f:function(e){var t=n.round(.8*e/Math.sqrt(2),2),r="l"+t+","+t,a="l"+t+",-"+t,i="l-"+t+",-"+t,o="l-"+t+","+t;return"M0,"+t+r+a+i+a+i+o+i+o+r+o+r+"Z"}},"triangle-up":{n:5,f:function(e){var t=n.round(2*e/Math.sqrt(3),2);return"M-"+t+","+n.round(e/2,2)+"H"+t+"L0,-"+n.round(e,2)+"Z"}},"triangle-down":{n:6,f:function(e){var t=n.round(2*e/Math.sqrt(3),2);return"M-"+t+",-"+n.round(e/2,2)+"H"+t+"L0,"+n.round(e,2)+"Z"}},"triangle-left":{n:7,f:function(e){var t=n.round(2*e/Math.sqrt(3),2);return"M"+n.round(e/2,2)+",-"+t+"V"+t+"L-"+n.round(e,2)+",0Z"}},"triangle-right":{n:8,f:function(e){var t=n.round(2*e/Math.sqrt(3),2);return"M-"+n.round(e/2,2)+",-"+t+"V"+t+"L"+n.round(e,2)+",0Z"}},"triangle-ne":{n:9,f:function(e){var t=n.round(.6*e,2),r=n.round(1.2*e,2);return"M-"+r+",-"+t+"H"+t+"V"+r+"Z"}},"triangle-se":{n:10,f:function(e){var t=n.round(.6*e,2),r=n.round(1.2*e,2);return"M"+t+",-"+r+"V"+t+"H-"+r+"Z"}},"triangle-sw":{n:11,f:function(e){var t=n.round(.6*e,2),r=n.round(1.2*e,2);return"M"+r+","+t+"H-"+t+"V-"+r+"Z"}},"triangle-nw":{n:12,f:function(e){var t=n.round(.6*e,2),r=n.round(1.2*e,2);return"M-"+t+","+r+"V-"+t+"H"+r+"Z"}},pentagon:{n:13,f:function(e){var t=n.round(.951*e,2),r=n.round(.588*e,2),a=n.round(-e,2),i=n.round(-.309*e,2);return"M"+t+","+i+"L"+r+","+n.round(.809*e,2)+"H-"+r+"L-"+t+","+i+"L0,"+a+"Z"}},hexagon:{n:14,f:function(e){var t=n.round(e,2),r=n.round(e/2,2),a=n.round(e*Math.sqrt(3)/2,2);return"M"+a+",-"+r+"V"+r+"L0,"+t+"L-"+a+","+r+"V-"+r+"L0,-"+t+"Z"}},hexagon2:{n:15,f:function(e){var t=n.round(e,2),r=n.round(e/2,2),a=n.round(e*Math.sqrt(3)/2,2);return"M-"+r+","+a+"H"+r+"L"+t+",0L"+r+",-"+a+"H-"+r+"L-"+t+",0Z"}},octagon:{n:16,f:function(e){var t=n.round(.924*e,2),r=n.round(.383*e,2);return"M-"+r+",-"+t+"H"+r+"L"+t+",-"+r+"V"+r+"L"+r+","+t+"H-"+r+"L-"+t+","+r+"V-"+r+"Z"}},star:{n:17,f:function(e){var t=1.4*e,r=n.round(.225*t,2),a=n.round(.951*t,2),i=n.round(.363*t,2),o=n.round(.588*t,2),l=n.round(-t,2),s=n.round(-.309*t,2),c=n.round(.118*t,2),u=n.round(.809*t,2);return"M"+r+","+s+"H"+a+"L"+i+","+c+"L"+o+","+u+"L0,"+n.round(.382*t,2)+"L-"+o+","+u+"L-"+i+","+c+"L-"+a+","+s+"H-"+r+"L0,"+l+"Z"}},hexagram:{n:18,f:function(e){var t=n.round(.66*e,2),r=n.round(.38*e,2),a=n.round(.76*e,2);return"M-"+a+",0l-"+r+",-"+t+"h"+a+"l"+r+",-"+t+"l"+r+","+t+"h"+a+"l-"+r+","+t+"l"+r+","+t+"h-"+a+"l-"+r+","+t+"l-"+r+",-"+t+"h-"+a+"Z"}},"star-triangle-up":{n:19,f:function(e){var t=n.round(e*Math.sqrt(3)*.8,2),r=n.round(.8*e,2),a=n.round(1.6*e,2),i=n.round(4*e,2),o="A "+i+","+i+" 0 0 1 ";return"M-"+t+","+r+o+t+","+r+o+"0,-"+a+o+"-"+t+","+r+"Z"}},"star-triangle-down":{n:20,f:function(e){var t=n.round(e*Math.sqrt(3)*.8,2),r=n.round(.8*e,2),a=n.round(1.6*e,2),i=n.round(4*e,2),o="A "+i+","+i+" 0 0 1 ";return"M"+t+",-"+r+o+"-"+t+",-"+r+o+"0,"+a+o+t+",-"+r+"Z"}},"star-square":{n:21,f:function(e){var t=n.round(1.1*e,2),r=n.round(2*e,2),a="A "+r+","+r+" 0 0 1 ";return"M-"+t+",-"+t+a+"-"+t+","+t+a+t+","+t+a+t+",-"+t+a+"-"+t+",-"+t+"Z"}},"star-diamond":{n:22,f:function(e){var t=n.round(1.4*e,2),r=n.round(1.9*e,2),a="A "+r+","+r+" 0 0 1 ";return"M-"+t+",0"+a+"0,"+t+a+t+",0"+a+"0,-"+t+a+"-"+t+",0Z"}},"diamond-tall":{n:23,f:function(e){var t=n.round(.7*e,2),r=n.round(1.4*e,2);return"M0,"+r+"L"+t+",0L0,-"+r+"L-"+t+",0Z"}},"diamond-wide":{n:24,f:function(e){var t=n.round(1.4*e,2),r=n.round(.7*e,2);return"M0,"+r+"L"+t+",0L0,-"+r+"L-"+t+",0Z"}},hourglass:{n:25,f:function(e){var t=n.round(e,2);return"M"+t+","+t+"H-"+t+"L"+t+",-"+t+"H-"+t+"Z"},noDot:!0},bowtie:{n:26,f:function(e){var t=n.round(e,2);return"M"+t+","+t+"V-"+t+"L-"+t+","+t+"V-"+t+"Z"},noDot:!0},"circle-cross":{n:27,f:function(e){var t=n.round(e,2);return"M0,"+t+"V-"+t+"M"+t+",0H-"+t+"M"+t+",0A"+t+","+t+" 0 1,1 0,-"+t+"A"+t+","+t+" 0 0,1 "+t+",0Z"},needLine:!0,noDot:!0},"circle-x":{n:28,f:function(e){var t=n.round(e,2),r=n.round(e/Math.sqrt(2),2);return"M"+r+","+r+"L-"+r+",-"+r+"M"+r+",-"+r+"L-"+r+","+r+"M"+t+",0A"+t+","+t+" 0 1,1 0,-"+t+"A"+t+","+t+" 0 0,1 "+t+",0Z"},needLine:!0,noDot:!0},"square-cross":{n:29,f:function(e){var t=n.round(e,2);return"M0,"+t+"V-"+t+"M"+t+",0H-"+t+"M"+t+","+t+"H-"+t+"V-"+t+"H"+t+"Z"},needLine:!0,noDot:!0},"square-x":{n:30,f:function(e){var t=n.round(e,2);return"M"+t+","+t+"L-"+t+",-"+t+"M"+t+",-"+t+"L-"+t+","+t+"M"+t+","+t+"H-"+t+"V-"+t+"H"+t+"Z"},needLine:!0,noDot:!0},"diamond-cross":{n:31,f:function(e){var t=n.round(1.3*e,2);return"M"+t+",0L0,"+t+"L-"+t+",0L0,-"+t+"ZM0,-"+t+"V"+t+"M-"+t+",0H"+t},needLine:!0,noDot:!0},"diamond-x":{n:32,f:function(e){var t=n.round(1.3*e,2),r=n.round(.65*e,2);return"M"+t+",0L0,"+t+"L-"+t+",0L0,-"+t+"ZM-"+r+",-"+r+"L"+r+","+r+"M-"+r+","+r+"L"+r+",-"+r},needLine:!0,noDot:!0},"cross-thin":{n:33,f:function(e){var t=n.round(1.4*e,2);return"M0,"+t+"V-"+t+"M"+t+",0H-"+t},needLine:!0,noDot:!0,noFill:!0},"x-thin":{n:34,f:function(e){var t=n.round(e,2);return"M"+t+","+t+"L-"+t+",-"+t+"M"+t+",-"+t+"L-"+t+","+t},needLine:!0,noDot:!0,noFill:!0},asterisk:{n:35,f:function(e){var t=n.round(1.2*e,2),r=n.round(.85*e,2);return"M0,"+t+"V-"+t+"M"+t+",0H-"+t+"M"+r+","+r+"L-"+r+",-"+r+"M"+r+",-"+r+"L-"+r+","+r},needLine:!0,noDot:!0,noFill:!0},hash:{n:36,f:function(e){var t=n.round(e/2,2),r=n.round(e,2);return"M"+t+","+r+"V-"+r+"m-"+r+",0V"+r+"M"+r+","+t+"H-"+r+"m0,-"+r+"H"+r},needLine:!0,noFill:!0},"y-up":{n:37,f:function(e){var t=n.round(1.2*e,2),r=n.round(1.6*e,2),a=n.round(.8*e,2);return"M-"+t+","+a+"L0,0M"+t+","+a+"L0,0M0,-"+r+"L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-down":{n:38,f:function(e){var t=n.round(1.2*e,2),r=n.round(1.6*e,2),a=n.round(.8*e,2);return"M-"+t+",-"+a+"L0,0M"+t+",-"+a+"L0,0M0,"+r+"L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-left":{n:39,f:function(e){var t=n.round(1.2*e,2),r=n.round(1.6*e,2),a=n.round(.8*e,2);return"M"+a+","+t+"L0,0M"+a+",-"+t+"L0,0M-"+r+",0L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-right":{n:40,f:function(e){var t=n.round(1.2*e,2),r=n.round(1.6*e,2),a=n.round(.8*e,2);return"M-"+a+","+t+"L0,0M-"+a+",-"+t+"L0,0M"+r+",0L0,0"},needLine:!0,noDot:!0,noFill:!0},"line-ew":{n:41,f:function(e){var t=n.round(1.4*e,2);return"M"+t+",0H-"+t},needLine:!0,noDot:!0,noFill:!0},"line-ns":{n:42,f:function(e){var t=n.round(1.4*e,2);return"M0,"+t+"V-"+t},needLine:!0,noDot:!0,noFill:!0},"line-ne":{n:43,f:function(e){var t=n.round(e,2);return"M"+t+",-"+t+"L-"+t+","+t},needLine:!0,noDot:!0,noFill:!0},"line-nw":{n:44,f:function(e){var t=n.round(e,2);return"M"+t+","+t+"L-"+t+",-"+t},needLine:!0,noDot:!0,noFill:!0}}},{d3:2}],53:[function(e,t,r){"use strict";t.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"}}}},{}],54:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("../../registry"),i=e("../../plots/cartesian/axes"),o=e("../../lib"),l=e("./compute_error");function s(e,t,r,a){var s=t["error_"+a]||{},c=[];if(s.visible&&-1!==["linear","log"].indexOf(r.type)){for(var u=l(s),f=0;f<e.length;f++){var d=e[f],p=d.i;if(void 0===p)p=f;else if(null===p)continue;var h=d[a];if(n(r.c2l(h))){var g=u(h,p);if(n(g[0])&&n(g[1])){var v=d[a+"s"]=h-g[0],m=d[a+"h"]=h+g[1];c.push(v,m)}}}var y=r._id,x=t._extremes[y],b=i.findExtremes(r,c,o.extendFlat({tozero:x.opts.tozero},{padded:!0}));x.min=x.min.concat(b.min),x.max=x.max.concat(b.max)}}t.exports=function(e){for(var t=e.calcdata,r=0;r<t.length;r++){var n=t[r],o=n[0].trace;if(!0===o.visible&&a.traceIs(o,"errorBarsOK")){var l=i.getFromId(e,o.xaxis),c=i.getFromId(e,o.yaxis);s(n,o,l,"x"),s(n,o,c,"y")}}}},{"../../lib":148,"../../plots/cartesian/axes":192,"../../registry":232,"./compute_error":55,"fast-isnumeric":4}],55:[function(e,t,r){"use strict";function n(e,t){return"percent"===e?function(e){return Math.abs(e*t/100)}:"constant"===e?function(){return Math.abs(t)}:"sqrt"===e?function(e){return Math.sqrt(Math.abs(e))}:void 0}t.exports=function(e){var t=e.type,r=e.symmetric;if("data"===t){var a=e.array||[];if(r)return function(e,t){var r=+a[t];return[r,r]};var i=e.arrayminus||[];return function(e,t){var r=+a[t],n=+i[t];return isNaN(r)&&isNaN(n)?[NaN,NaN]:[n||0,r||0]}}var o=n(t,e.value),l=n(t,e.valueminus);return r||void 0===e.valueminus?function(e){var t=o(e);return[t,t]}:function(e){return[l(e),o(e)]}}},{}],56:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("../../registry"),i=e("../../lib"),o=e("../../plot_api/plot_template"),l=e("./attributes");t.exports=function(e,t,r,s){var c="error_"+s.axis,u=o.newContainer(t,c),f=e[c]||{};function d(e,t){return i.coerce(f,u,l,e,t)}if(!1!==d("visible",void 0!==f.array||void 0!==f.value||"sqrt"===f.type)){var p=d("type","array"in f?"data":"percent"),h=!0;"sqrt"!==p&&(h=d("symmetric",!(("data"===p?"arrayminus":"valueminus")in f))),"data"===p?(d("array"),d("traceref"),h||(d("arrayminus"),d("tracerefminus"))):"percent"!==p&&"constant"!==p||(d("value"),h||d("valueminus"));var g="copy_"+s.inherit+"style";if(s.inherit)(t["error_"+s.inherit]||{}).visible&&d(g,!(f.color||n(f.thickness)||n(f.width)));s.inherit&&u[g]||(d("color",r),d("thickness"),d("width",a.traceIs(t,"gl3d")?0:4))}}},{"../../lib":148,"../../plot_api/plot_template":182,"../../registry":232,"./attributes":53,"fast-isnumeric":4}],57:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plot_api/edit_types").overrideAll,i=e("./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 l={error_x:n.extendFlat({},i),error_y:n.extendFlat({},i),error_z:n.extendFlat({},i)};delete l.error_x.copy_ystyle,delete l.error_y.copy_ystyle,delete l.error_z.copy_ystyle,delete l.error_z.copy_zstyle,t.exports={moduleType:"component",name:"errorbars",schema:{traces:{scatter:o,bar:o,histogram:o,scatter3d:a(l,"calc","nested"),scattergl:a(o,"calc","nested")}},supplyDefaults:e("./defaults"),calc:e("./calc"),makeComputeError:e("./compute_error"),plot:e("./plot"),style:e("./style"),hoverInfo:function(e,t,r){(t.error_y||{}).visible&&(r.yerr=e.yh-e.y,t.error_y.symmetric||(r.yerrneg=e.y-e.ys));(t.error_x||{}).visible&&(r.xerr=e.xh-e.x,t.error_x.symmetric||(r.xerrneg=e.x-e.xs))}}},{"../../lib":148,"../../plot_api/edit_types":175,"./attributes":53,"./calc":54,"./compute_error":55,"./defaults":56,"./plot":58,"./style":59}],58:[function(e,t,r){"use strict";var n=e("d3"),a=e("fast-isnumeric"),i=e("../drawing"),o=e("../../traces/scatter/subtypes");t.exports=function(e,t,r,l){var s=r.xaxis,c=r.yaxis,u=l&&l.duration>0;t.each(function(t){var f,d=t[0].trace,p=d.error_x||{},h=d.error_y||{};d.ids&&(f=function(e){return e.id});var g=o.hasMarkers(d)&&d.marker.maxdisplayed>0;h.visible||p.visible||(t=[]);var v=n.select(this).selectAll("g.errorbar").data(t,f);if(v.exit().remove(),t.length){p.visible||v.selectAll("path.xerror").remove(),h.visible||v.selectAll("path.yerror").remove(),v.style("opacity",1);var m=v.enter().append("g").classed("errorbar",!0);u&&m.style("opacity",0).transition().duration(l.duration).style("opacity",1),i.setClipUrl(v,r.layerClipId,e),v.each(function(e){var t=n.select(this),r=function(e,t,r){var n={x:t.c2p(e.x),y:r.c2p(e.y)};void 0!==e.yh&&(n.yh=r.c2p(e.yh),n.ys=r.c2p(e.ys),a(n.ys)||(n.noYS=!0,n.ys=r.c2p(e.ys,!0)));void 0!==e.xh&&(n.xh=t.c2p(e.xh),n.xs=t.c2p(e.xs),a(n.xs)||(n.noXS=!0,n.xs=t.c2p(e.xs,!0)));return n}(e,s,c);if(!g||e.vis){var i,o=t.select("path.yerror");if(h.visible&&a(r.x)&&a(r.yh)&&a(r.ys)){var f=h.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=t.append("path").style("vector-effect","non-scaling-stroke").classed("yerror",!0):u&&(o=o.transition().duration(l.duration).ease(l.easing)),o.attr("d",i)}else o.remove();var d=t.select("path.xerror");if(p.visible&&a(r.y)&&a(r.xh)&&a(r.xs)){var v=(p.copy_ystyle?h:p).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=t.append("path").style("vector-effect","non-scaling-stroke").classed("xerror",!0):u&&(d=d.transition().duration(l.duration).ease(l.easing)),d.attr("d",i)}else d.remove()}})}})}},{"../../traces/scatter/subtypes":268,"../drawing":51,d3:2,"fast-isnumeric":4}],59:[function(e,t,r){"use strict";var n=e("d3"),a=e("../color");t.exports=function(e){e.each(function(e){var t=e[0].trace,r=t.error_y||{},i=t.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":30,d3:2}],60:[function(e,t,r){"use strict";var n=e("../../plots/font_attributes"),a=e("./layout_attributes").hoverlabel,i=e("../../lib/extend").extendFlat;t.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":143,"../../plots/font_attributes":218,"./layout_attributes":70}],61:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../registry");function i(e,t,r,a){a=a||n.identity,Array.isArray(e)&&(t[0][r]=a(e))}t.exports=function(e){var t=e.calcdata,r=e._fullLayout;function o(e){return function(t){return n.coerceHoverinfo({hoverinfo:t},{_module:e._module},r)}}for(var l=0;l<t.length;l++){var s=t[l],c=s[0].trace;if(!a.traceIs(c,"pie-like")){var u=a.traceIs(c,"2dMap")?i:n.fillArray;u(c.hoverinfo,s,"hi",o(c)),c.hovertemplate&&u(c.hovertemplate,s,"ht"),c.hoverlabel&&(u(c.hoverlabel.bgcolor,s,"hbg"),u(c.hoverlabel.bordercolor,s,"hbc"),u(c.hoverlabel.font.size,s,"hts"),u(c.hoverlabel.font.color,s,"htc"),u(c.hoverlabel.font.family,s,"htf"),u(c.hoverlabel.namelength,s,"hnl"),u(c.hoverlabel.align,s,"hta"))}}}},{"../../lib":148,"../../registry":232}],62:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("./hover").hover;t.exports=function(e,t,r){var i=n.getComponentMethod("annotations","onClick")(e,e._hoverdata);function o(){e.emit("plotly_click",{points:e._hoverdata,event:t})}void 0!==r&&a(e,t,r,!0),e._hoverdata&&t&&t.target&&(i&&i.then?i.then(o):o(),t.stopImmediatePropagation&&t.stopImmediatePropagation())}},{"../../registry":232,"./hover":66}],63:[function(e,t,r){"use strict";t.exports={YANGLE:60,HOVERARROWSIZE:6,HOVERTEXTPAD:3,HOVERFONTSIZE:13,HOVERFONT:"Arial, sans-serif",HOVERMINTIME:50,HOVERID:"-hover"}},{}],64:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./attributes"),i=e("./hoverlabel_defaults");t.exports=function(e,t,r,o){var l=n.extendFlat({},o.hoverlabel);t.hovertemplate&&(l.namelength=-1),i(e,t,function(r,i){return n.coerce(e,t,a,r,i)},l)}},{"../../lib":148,"./attributes":60,"./hoverlabel_defaults":67}],65:[function(e,t,r){"use strict";var n=e("../../lib");r.getSubplot=function(e){return e.subplot||e.xaxis+e.yaxis||e.geo},r.isTraceInSubplots=function(e,t){if("splom"===e.type){for(var n=e.xaxes||[],a=e.yaxes||[],i=0;i<n.length;i++)for(var o=0;o<a.length;o++)if(-1!==t.indexOf(n[i]+a[o]))return!0;return!1}return-1!==t.indexOf(r.getSubplot(e))},r.flat=function(e,t){for(var r=new Array(e.length),n=0;n<e.length;n++)r[n]=t;return r},r.p2c=function(e,t){for(var r=new Array(e.length),n=0;n<e.length;n++)r[n]=e[n].p2c(t);return r},r.getDistanceFunction=function(e,t,n,a){return"closest"===e?a||r.quadrature(t,n):"x"===e.charAt(0)?t:n},r.getClosest=function(e,t,r){if(!1!==r.index)r.index>=0&&r.index<e.length?r.distance=0:r.index=!1;else for(var n=0;n<e.length;n++){var a=t(e[n]);a<=r.distance&&(r.index=n,r.distance=a)}return r},r.inbox=function(e,t,r){return e*t<0||0===e?r:1/0},r.quadrature=function(e,t){return function(r){var n=e(r),a=t(r);return Math.sqrt(n*n+a*a)}},r.makeEventData=function(e,t,n){var a="index"in e?e.index:e.pointNumber,i={data:t._input,fullData:t,curveNumber:t.index,pointNumber:a};if(t._indexToPoints){var o=t._indexToPoints[a];1===o.length?i.pointIndex=o[0]:i.pointIndices=o}else i.pointIndex=a;return t._module.eventData?i=t._module.eventData(i,e,t,n,a):("xVal"in e?i.x=e.xVal:"x"in e&&(i.x=e.x),"yVal"in e?i.y=e.yVal:"y"in e&&(i.y=e.y),e.xa&&(i.xaxis=e.xa),e.ya&&(i.yaxis=e.ya),void 0!==e.zLabelVal&&(i.z=e.zLabelVal)),r.appendArrayPointValue(i,t,a),i},r.appendArrayPointValue=function(e,t,r){var a=t._arrayAttrs;if(a)for(var l=0;l<a.length;l++){var s=a[l],c=i(s);if(void 0===e[c]){var u=o(n.nestedProperty(t,s).get(),r);void 0!==u&&(e[c]=u)}}},r.appendArrayMultiPointValues=function(e,t,r){var a=t._arrayAttrs;if(a)for(var l=0;l<a.length;l++){var s=a[l],c=i(s);if(void 0===e[c]){for(var u=n.nestedProperty(t,s).get(),f=new Array(r.length),d=0;d<r.length;d++)f[d]=o(u,r[d]);e[c]=f}}};var a={ids:"id",locations:"location",labels:"label",values:"value","marker.colors":"color",parents:"parent"};function i(e){return a[e]||e}function o(e,t){return Array.isArray(t)?Array.isArray(e)&&Array.isArray(e[t[0]])?e[t[0]][t[1]]:void 0:e[t]}var l={x:!0,y:!0},s={"x unified":!0,"y unified":!0};r.isUnifiedHover=function(e){return"string"==typeof e&&!!s[e]},r.isXYhover=function(e){return"string"==typeof e&&!!l[e]}},{"../../lib":148}],66:[function(e,t,r){"use strict";var n=e("d3"),a=e("fast-isnumeric"),i=e("tinycolor2"),o=e("../../lib"),l=e("../../lib/events"),s=e("../../lib/svg_text_utils"),c=e("../../lib/override_cursor"),u=e("../drawing"),f=e("../color"),d=e("../dragelement"),p=e("../../plots/cartesian/axes"),h=e("../../registry"),g=e("./helpers"),v=e("./constants"),m=e("../legend/defaults"),y=e("../legend/draw"),x=v.YANGLE,b=Math.PI*x/180,_=1/Math.sin(b),w=Math.cos(b),k=Math.sin(b),T=v.HOVERARROWSIZE,M=v.HOVERTEXTPAD;function A(e){return[e.trace.index,e.index,e.x0,e.y0,e.name,e.attr,e.xa,e.ya||""].join(",")}r.hover=function(e,t,r,i){e=o.getGraphDiv(e),o.throttle(e._fullLayout._uid+v.HOVERID,v.HOVERMINTIME,function(){!function(e,t,r,i){r||(r="xy");var s=Array.isArray(r)?r:[r],u=e._fullLayout,p=u._plots||[],v=p[r],m=u._has("cartesian");if(v){var y=v.overlays.map(function(e){return e.id});s=s.concat(y)}for(var x=s.length,b=new Array(x),w=new Array(x),k=!1,T=0;T<x;T++){var M=s[T];if(p[M])k=!0,b[T]=p[M].xaxis,w[T]=p[M].yaxis;else{if(!u[M]||!u[M]._subplot)return void o.warn("Unrecognized subplot: "+M);var L=u[M]._subplot;b[T]=L.xaxis,w[T]=L.yaxis}}var C=t.hovermode||u.hovermode;C&&!k&&(C="closest");if(-1===["x","y","closest","x unified","y unified"].indexOf(C)||!e.calcdata||e.querySelector(".zoombox")||e._dragging)return d.unhoverRaw(e,t);var R,E,I,F,N,j,B,H,q,V,U,G,Z,Y=-1===u.hoverdistance?1/0:u.hoverdistance,X=-1===u.spikedistance?1/0:u.spikedistance,W=[],$=[],J={hLinePoint:null,vLinePoint:null},Q=!1;if(Array.isArray(t))for(C="array",I=0;I<t.length;I++)(N=e.calcdata[t[I].curveNumber||0])&&(j=N[0].trace,"skip"!==N[0].trace.hoverinfo&&($.push(N),"h"===j.orientation&&(Q=!0)));else{for(F=0;F<e.calcdata.length;F++)N=e.calcdata[F],"skip"!==(j=N[0].trace).hoverinfo&&g.isTraceInSubplots(j,s)&&($.push(N),"h"===j.orientation&&(Q=!0));var K,ee,te=!t.target;if(te)K="xpx"in t?t.xpx:b[0]._length/2,ee="ypx"in t?t.ypx:w[0]._length/2;else{if(!1===l.triggerHandler(e,"plotly_beforehover",t))return;var re=t.target.getBoundingClientRect();if(K=t.clientX-re.left,ee=t.clientY-re.top,K<0||K>b[0]._length||ee<0||ee>w[0]._length)return d.unhoverRaw(e,t)}if(t.pointerX=K+b[0]._offset,t.pointerY=ee+w[0]._offset,R="xval"in t?g.flat(s,t.xval):g.p2c(b,K),E="yval"in t?g.flat(s,t.yval):g.p2c(w,ee),!a(R[0])||!a(E[0]))return o.warn("Fx.hover failed",t,e),d.unhoverRaw(e,t)}var ne=1/0;function ae(e,r){for(F=0;F<$.length;F++)if((N=$[F])&&N[0]&&N[0].trace&&!0===(j=N[0].trace).visible&&0!==j._length&&-1===["carpet","contourcarpet"].indexOf(j._module.name)){if("splom"===j.type?B=s[H=0]:(B=g.getSubplot(j),H=s.indexOf(B)),q=C,g.isUnifiedHover(q)&&(q=q.charAt(0)),G={cd:N,trace:j,xa:b[H],ya:w[H],maxHoverDistance:Y,maxSpikeDistance:X,index:!1,distance:Math.min(ne,Y),spikeDistance:1/0,xSpike:void 0,ySpike:void 0,color:f.defaultLine,name:j.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},u[B]&&(G.subplot=u[B]._subplot),u._splomScenes&&u._splomScenes[j.uid]&&(G.scene=u._splomScenes[j.uid]),Z=W.length,"array"===q){var n=t[F];"pointNumber"in n?(G.index=n.pointNumber,q="closest"):(q="","xval"in n&&(V=n.xval,q="x"),"yval"in n&&(U=n.yval,q=q?"closest":"y"))}else void 0!==e&&void 0!==r?(V=e,U=r):(V=R[H],U=E[H]);if(0!==Y)if(j._module&&j._module.hoverPoints){var i=j._module.hoverPoints(G,V,U,q,u._hoverlayer);if(i)for(var l,c=0;c<i.length;c++)l=i[c],a(l.x0)&&a(l.y0)&&W.push(P(l,C))}else o.log("Unrecognized trace type in hover:",j);if("closest"===C&&W.length>Z&&(W.splice(0,Z),ne=W[0].distance),m&&0!==X&&0===W.length){G.distance=X,G.index=!1;var d=j._module.hoverPoints(G,V,U,"closest",u._hoverlayer);if(d&&(d=d.filter(function(e){return e.spikeDistance<=X})),d&&d.length){var p,h=d.filter(function(e){return e.xa.showspikes&&"hovered data"!==e.xa.spikesnap});if(h.length){var v=h[0];a(v.x0)&&a(v.y0)&&(p=oe(v),(!J.vLinePoint||J.vLinePoint.spikeDistance>p.spikeDistance)&&(J.vLinePoint=p))}var y=d.filter(function(e){return e.ya.showspikes&&"hovered data"!==e.ya.spikesnap});if(y.length){var x=y[0];a(x.x0)&&a(x.y0)&&(p=oe(x),(!J.hLinePoint||J.hLinePoint.spikeDistance>p.spikeDistance)&&(J.hLinePoint=p))}}}}}function ie(e,t){for(var r,n=null,a=1/0,i=0;i<e.length;i++)(r=e[i].spikeDistance)<=a&&r<=t&&(n=e[i],a=r);return n}function oe(e){return e?{xa:e.xa,ya:e.ya,x:void 0!==e.xSpike?e.xSpike:(e.x0+e.x1)/2,y:void 0!==e.ySpike?e.ySpike:(e.y0+e.y1)/2,distance:e.distance,spikeDistance:e.spikeDistance,curveNumber:e.trace.index,color:e.color,pointNumber:e.index}:null}ae();var le={fullLayout:u,container:u._hoverlayer,outerContainer:u._paperdiv,event:t},se=e._spikepoints,ce={vLinePoint:J.vLinePoint,hLinePoint:J.hLinePoint};if(e._spikepoints=ce,m&&0!==X&&0!==W.length){var ue=W.filter(function(e){return e.ya.showspikes}),fe=ie(ue,X);J.hLinePoint=oe(fe);var de=W.filter(function(e){return e.xa.showspikes}),pe=ie(de,X);J.vLinePoint=oe(pe)}if(0===W.length){var he=d.unhoverRaw(e,t);return!m||null===J.hLinePoint&&null===J.vLinePoint||z(se)&&D(e,J,le),he}m&&z(se)&&D(e,J,le);if(W.sort(function(e,t){return e.distance-t.distance}),g.isXYhover(q)&&0!==W[0].length&&"splom"!==W[0].trace.type){var ge=W[0],ve=ge.cd[ge.index],me="group"===u.boxmode||"group"===u.violinmode,ye=ge.xVal,xe=ge.xa;"category"===xe.type&&(ye=xe._categoriesMap[ye]),"date"===xe.type&&(ye=xe.d2c(ye)),ve&&ve.t&&ve.t.posLetter===xe._id&&me&&(ye+=ve.t.dPos);var be=ge.yVal;"category"===(xe=ge.ya).type&&(be=xe._categoriesMap[be]),"date"===xe.type&&(be=xe.d2c(be)),ve&&ve.t&&ve.t.posLetter===xe._id&&me&&(be+=ve.t.dPos),ae(ye,be);var _e={};W=W.filter(function(e){var t=A(e);if(!_e[t])return _e[t]=!0,_e[t]})}var we=e._hoverdata,ke=[];for(I=0;I<W.length;I++){var Te=W[I],Me=g.makeEventData(Te,Te.trace,Te.cd);if(!1!==Te.hovertemplate){var Ae=!1;Te.cd[Te.index]&&Te.cd[Te.index].ht&&(Ae=Te.cd[Te.index].ht),Te.hovertemplate=Ae||Te.trace.hovertemplate||!1}Te.eventData=[Me],ke.push(Me)}e._hoverdata=ke;var Le="y"===C&&($.length>1||W.length>1)||"closest"===C&&Q&&W.length>1,Se=f.combine(u.plot_bgcolor||f.background,u.paper_bgcolor),Ce={hovermode:C,rotateLabels:Le,bgColor:Se,container:u._hoverlayer,outerContainer:u._paperdiv,commonLabelOpts:u.hoverlabel,hoverdistance:u.hoverdistance},Oe=S(W,Ce,e);g.isUnifiedHover(C)||(!function(e,t,r){var n,a,i,o,l,s,c,u=0,f=1,d=e.size(),p=new Array(d),h=0;function g(e){var t=e[0],r=e[e.length-1];if(a=t.pmin-t.pos-t.dp+t.size,i=r.pos+r.dp+r.size-t.pmax,a>.01){for(l=e.length-1;l>=0;l--)e[l].dp+=a;n=!1}if(!(i<.01)){if(a<-.01){for(l=e.length-1;l>=0;l--)e[l].dp-=i;n=!1}if(n){var c=0;for(o=0;o<e.length;o++)(s=e[o]).pos+s.dp+s.size>t.pmax&&c++;for(o=e.length-1;o>=0&&!(c<=0);o--)(s=e[o]).pos>t.pmax-1&&(s.del=!0,c--);for(o=0;o<e.length&&!(c<=0);o++)if((s=e[o]).pos<t.pmin+1)for(s.del=!0,c--,i=2*s.size,l=e.length-1;l>=0;l--)e[l].dp-=i;for(o=e.length-1;o>=0&&!(c<=0);o--)(s=e[o]).pos+s.dp+s.size>t.pmax&&(s.del=!0,c--)}}}e.each(function(e){var n=e[t],a="x"===n._id.charAt(0),i=n.range;0===h&&i&&i[0]>i[1]!==a&&(f=-1),p[h++]=[{datum:e,traceIndex:e.trace.index,dp:0,pos:e.pos,posref:e.posref,size:e.by*(a?_:1)/2,pmin:0,pmax:a?r.width:r.height}]}),p.sort(function(e,t){return e[0].posref-t[0].posref||f*(t[0].traceIndex-e[0].traceIndex)});for(;!n&&u<=d;){for(u++,n=!0,o=0;o<p.length-1;){var v=p[o],m=p[o+1],y=v[v.length-1],x=m[0];if((a=y.pos+y.dp+y.size-x.pos-x.dp+x.size)>.01&&y.pmin===x.pmin&&y.pmax===x.pmax){for(l=m.length-1;l>=0;l--)m[l].dp+=a;for(v.push.apply(v,m),p.splice(o+1,1),c=0,l=v.length-1;l>=0;l--)c+=v[l].dp;for(i=c/v.length,l=v.length-1;l>=0;l--)v[l].dp-=i;n=!1}else o++}p.forEach(g)}for(o=p.length-1;o>=0;o--){var b=p[o];for(l=b.length-1;l>=0;l--){var w=b[l],k=w.datum;k.offset=w.dp,k.del=w.del}}}(Oe,Le?"xa":"ya",u),O(Oe,Le));if(t.target&&t.target.tagName){var Pe=h.getComponentMethod("annotations","hasClickToShow")(e,ke);c(n.select(t.target),Pe?"pointer":"")}if(!t.target||i||!function(e,t,r){if(!r||r.length!==e._hoverdata.length)return!0;for(var n=r.length-1;n>=0;n--){var a=r[n],i=e._hoverdata[n];if(a.curveNumber!==i.curveNumber||String(a.pointNumber)!==String(i.pointNumber)||String(a.pointNumbers)!==String(i.pointNumbers))return!0}return!1}(e,0,we))return;we&&e.emit("plotly_unhover",{event:t,points:we});e.emit("plotly_hover",{event:t,points:e._hoverdata,xaxes:b,yaxes:w,xvals:R,yvals:E})}(e,t,r,i)})},r.loneHover=function(e,t){var r=!0;Array.isArray(e)||(r=!1,e=[e]);var a=e.map(function(e){return{color:e.color||f.defaultLine,x0:e.x0||e.x||0,x1:e.x1||e.x||0,y0:e.y0||e.y||0,y1:e.y1||e.y||0,xLabel:e.xLabel,yLabel:e.yLabel,zLabel:e.zLabel,text:e.text,name:e.name,idealAlign:e.idealAlign,borderColor:e.borderColor,fontFamily:e.fontFamily,fontSize:e.fontSize,fontColor:e.fontColor,nameLength:e.nameLength,textAlign:e.textAlign,trace:e.trace||{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0,hovertemplate:e.hovertemplate||!1,eventData:e.eventData||!1,hovertemplateLabels:e.hovertemplateLabels||!1}}),i=n.select(t.container),o=t.outerContainer?n.select(t.outerContainer):i,l={hovermode:"closest",rotateLabels:!1,bgColor:t.bgColor||f.background,container:i,outerContainer:o},s=S(a,l,t.gd),c=0,u=0;return s.sort(function(e,t){return e.y0-t.y0}).each(function(e,r){var n=e.y0-e.by/2;e.offset=n-5<c?c-n+5:0,c=n+e.by+e.offset,r===t.anchorIndex&&(u=e.offset)}).each(function(e){e.offset-=u}),O(s,l.rotateLabels),r?s:s.node()};var L=/<extra>([\s\S]*)<\/extra>/;function S(e,t,r){var a=r._fullLayout,i=t.hovermode,l=t.rotateLabels,c=t.bgColor,d=t.container,p=t.outerContainer,h=t.commonLabelOpts||{},b=t.fontFamily||v.HOVERFONT,_=t.fontSize||v.HOVERFONTSIZE,w=e[0],k=w.xa,L=w.ya,S="y"===i.charAt(0)?"yLabel":"xLabel",O=w[S],P=(String(O)||"").split(" ")[0],D=p.node().getBoundingClientRect(),z=D.top,R=D.width,E=D.height,I=void 0!==O&&w.distance<=t.hoverdistance&&("x"===i||"y"===i);if(I){var F,N,j=!0;for(F=0;F<e.length;F++)if(j&&void 0===e[F].zLabel&&(j=!1),N=e[F].hoverinfo||e[F].trace.hoverinfo){var B=Array.isArray(N)?N:N.split("+");if(-1===B.indexOf("all")&&-1===B.indexOf(i)){I=!1;break}}j&&(I=!1)}var H=d.selectAll("g.axistext").data(I?[0]:[]);function q(e){return e.filter(function(e){return void 0!==e.zLabelVal||(e[S]||"").split(" ")[0]===P})}if(H.enter().append("g").classed("axistext",!0),H.exit().remove(),H.each(function(){var t=n.select(this),l=o.ensureSingle(t,"path","",function(e){e.style({"stroke-width":"1px"})}),c=o.ensureSingle(t,"text","",function(e){e.attr("data-notex",1)}),d=h.bgcolor||f.defaultLine,p=h.bordercolor||f.contrast(d),g=f.contrast(d),v={family:h.font.family||b,size:h.font.size||_,color:h.font.color||g};l.style({fill:d,stroke:p}),c.text(O).call(u.font,v).call(s.positionText,0,0).call(s.convertToTspans,r),t.attr("transform","");var m,y,x=c.node().getBoundingClientRect();if("x"===i){var A="top"===k.side?"-":"";c.attr("text-anchor","middle").call(s.positionText,0,"top"===k.side?z-x.bottom-T-M:z-x.top+T+M),m=k._offset+(w.x0+w.x1)/2,y=L._offset+("top"===k.side?0:L._length);var S=x.width/2+M;m<S?(m=S,l.attr("d","M-"+(S-T)+",0L-"+(S-2*T)+","+A+T+"H"+(M+x.width/2)+"v"+A+(2*M+x.height)+"H-"+S+"V"+A+T+"Z")):m>a.width-S?(m=a.width-S,l.attr("d","M"+(S-T)+",0L"+S+","+A+T+"v"+A+(2*M+x.height)+"H-"+S+"V"+A+T+"H"+(S-2*T)+"Z")):l.attr("d","M0,0L"+T+","+A+T+"H"+(M+x.width/2)+"v"+A+(2*M+x.height)+"H-"+(M+x.width/2)+"V"+A+T+"H-"+T+"Z")}else{var C,P,D;"right"===L.side?(C="start",P=1,D="",m=k._offset+k._length):(C="end",P=-1,D="-",m=k._offset),y=L._offset+(w.y0+w.y1)/2,c.attr("text-anchor",C),l.attr("d","M0,0L"+D+T+","+T+"V"+(M+x.height/2)+"h"+D+(2*M+x.width)+"V-"+(M+x.height/2)+"H"+D+T+"V-"+T+"Z");var R,E=x.height/2,I=z-x.top-E,F="clip"+a._uid+"commonlabel"+L._id;if(m<x.width+2*M+T){R="M-"+(T+M)+"-"+E+"h-"+(x.width-M)+"V"+E+"h"+(x.width-M)+"Z";var N=x.width-m+M;s.positionText(c,N,I),"end"===C&&c.selectAll("tspan").each(function(){var e=n.select(this),t=u.tester.append("text").text(e.text()).call(u.font,v),r=t.node().getBoundingClientRect();Math.round(r.width)<Math.round(x.width)&&e.attr("x",N-r.width),t.remove()})}else s.positionText(c,P*(M+T),I),R=null;var j=a._topclips.selectAll("#"+F).data(R?[0]:[]);j.enter().append("clipPath").attr("id",F).append("path"),j.exit().remove(),j.select("path").attr("d",R),u.setClipUrl(c,R?F:null,r)}t.attr("transform","translate("+m+","+y+")"),e=q(e)}),g.isUnifiedHover(i)){if(d.selectAll("g.hovertext").remove(),void 0!==O&&w.distance<=t.hoverdistance&&(e=q(e)),0===e.length)return;var V={showlegend:!0,legend:{title:{text:O,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"}},U={};m(V,U,r._fullData);var G=U.legend;G.entries=[];for(var Z=0;Z<e.length;Z++){var Y=C(e[Z],!0,i,a,O),X=Y[0],W=Y[1],$=e[Z];$.name=W,$.text=""!==W?W+" : "+X:X;var J=$.cd[$.index];J&&(J.mc&&($.mc=J.mc),J.mcc&&($.mc=J.mcc),J.mlc&&($.mlc=J.mlc),J.mlcc&&($.mlc=J.mlcc),J.mlw&&($.mlw=J.mlw),J.mrc&&($.mrc=J.mrc),J.dir&&($.dir=J.dir)),$._distinct=!0,G.entries.push([$])}G.entries.sort(function(e,t){return e[0].trace.index-t[0].trace.index}),G.layer=d,y(r,G);var Q=o.mean(e.map(function(e){return(e.y0+e.y1)/2})),K=o.mean(e.map(function(e){return(e.x0+e.x1)/2})),ee=d.select("g.legend"),te=ee.node().getBoundingClientRect();K+=k._offset,Q+=L._offset-te.height/2;var re=te.width+2*M;!(K+re<=R)&&K-re>=0?K-=re:K+=2*M;var ne=te.height+2*M,ae=Q+ne>=E;return ne<=E&&(Q<=z?Q=L._offset+2*M:ae&&(Q=E-ne)),ee.attr("transform","translate("+K+","+Q+")"),ee}var ie=d.selectAll("g.hovertext").data(e,function(e){return A(e)});return ie.enter().append("g").classed("hovertext",!0).each(function(){var e=n.select(this);e.append("rect").call(f.fill,f.addOpacity(c,.8)),e.append("text").classed("name",!0),e.append("path").style("stroke-width","1px"),e.append("text").classed("nums",!0).call(u.font,b,_)}),ie.exit().remove(),ie.each(function(e){var t=n.select(this).attr("transform",""),o=e.bgcolor||e.color,d=f.combine(f.opacity(o)?o:f.defaultLine,c),p=f.combine(f.opacity(e.color)?e.color:f.defaultLine,c),h=e.borderColor||f.contrast(d),g=C(e,I,i,a,O,t),v=g[0],m=g[1],y=t.select("text.nums").call(u.font,e.fontFamily||b,e.fontSize||_,e.fontColor||h).text(v).attr("data-notex",1).call(s.positionText,0,0).call(s.convertToTspans,r),w=t.select("text.name"),k=0,A=0;if(m&&m!==v){w.call(u.font,e.fontFamily||b,e.fontSize||_,p).text(m).attr("data-notex",1).call(s.positionText,0,0).call(s.convertToTspans,r);var L=w.node().getBoundingClientRect();k=L.width+2*M,A=L.height+2*M}else w.remove(),t.select("rect").remove();t.select("path").style({fill:d,stroke:h});var S,P,D=y.node().getBoundingClientRect(),F=e.xa._offset+(e.x0+e.x1)/2,N=e.ya._offset+(e.y0+e.y1)/2,j=Math.abs(e.x1-e.x0),B=Math.abs(e.y1-e.y0),H=D.width+T+M+k;if(e.ty0=z-D.top,e.bx=D.width+2*M,e.by=Math.max(D.height+2*M,A),e.anchor="start",e.txwidth=D.width,e.tx2width=k,e.offset=0,l)e.pos=F,S=N+B/2+H<=E,P=N-B/2-H>=0,"top"!==e.idealAlign&&S||!P?S?(N+=B/2,e.anchor="start"):e.anchor="middle":(N-=B/2,e.anchor="end");else if(e.pos=N,S=F+j/2+H<=R,P=F-j/2-H>=0,"left"!==e.idealAlign&&S||!P)if(S)F+=j/2,e.anchor="start";else{e.anchor="middle";var q=H/2,V=F+q-R,U=F-q;V>0&&(F-=V),U<0&&(F+=-U)}else F-=j/2,e.anchor="end";y.attr("text-anchor",e.anchor),k&&w.attr("text-anchor",e.anchor),t.attr("transform","translate("+F+","+N+")"+(l?"rotate("+x+")":""))}),ie}function C(e,t,r,n,a,i){var l="",s="";void 0!==e.nameOverride&&(e.name=e.nameOverride),e.name&&(e.trace._meta&&(e.name=o.templateString(e.name,e.trace._meta)),l=R(e.name,e.nameLength)),void 0!==e.zLabel?(void 0!==e.xLabel&&(s+="x: "+e.xLabel+"<br>"),void 0!==e.yLabel&&(s+="y: "+e.yLabel+"<br>"),"choropleth"!==e.trace.type&&"choroplethmapbox"!==e.trace.type&&(s+=(s?"z: ":"")+e.zLabel)):t&&e[r.charAt(0)+"Label"]===a?s=e[("x"===r.charAt(0)?"y":"x")+"Label"]||"":void 0===e.xLabel?void 0!==e.yLabel&&"scattercarpet"!==e.trace.type&&(s=e.yLabel):s=void 0===e.yLabel?e.xLabel:"("+e.xLabel+", "+e.yLabel+")",!e.text&&0!==e.text||Array.isArray(e.text)||(s+=(s?"<br>":"")+e.text),void 0!==e.extraText&&(s+=(s?"<br>":"")+e.extraText),i&&""===s&&!e.hovertemplate&&(""===l&&i.remove(),s=l);var c=n._d3locale,u=e.hovertemplate||!1,f=e.hovertemplateLabels||e,d=e.eventData[0]||{};return u&&(s=(s=o.hovertemplateString(u,f,c,d,e.trace._meta)).replace(L,function(t,r){return l=R(r,e.nameLength),""})),[s,l]}function O(e,t){e.each(function(e){var r=n.select(this);if(e.del)return r.remove();var a=r.select("text.nums"),i=e.anchor,o="end"===i?-1:1,l={start:1,end:-1,middle:0}[i],c=l*(T+M),f=c+l*(e.txwidth+M),d=0,p=e.offset;"middle"===i&&(c-=e.tx2width/2,f+=e.txwidth/2+M),t&&(p*=-k,d=e.offset*w),r.select("path").attr("d","middle"===i?"M-"+(e.bx/2+e.tx2width/2)+","+(p-e.by/2)+"h"+e.bx+"v"+e.by+"h-"+e.bx+"Z":"M0,0L"+(o*T+d)+","+(T+p)+"v"+(e.by/2-T)+"h"+o*e.bx+"v-"+e.by+"H"+(o*T+d)+"V"+(p-T)+"Z");var h=c+d,g=p+e.ty0-e.by/2+M,v=e.textAlign||"auto";"auto"!==v&&("left"===v&&"start"!==i?(a.attr("text-anchor","start"),h="middle"===i?-e.bx/2-e.tx2width/2+M:-e.bx-M):"right"===v&&"end"!==i&&(a.attr("text-anchor","end"),h="middle"===i?e.bx/2-e.tx2width/2-M:e.bx+M)),a.call(s.positionText,h,g),e.tx2width&&(r.select("text.name").call(s.positionText,f+l*M+d,p+e.ty0-e.by/2+M),r.select("rect").call(u.setRect,f+(l-1)*e.tx2width/2+d,p-e.by/2-1,e.tx2width,e.by+2))})}function P(e,t){var r=e.index,n=e.trace||{},i=e.cd[0],l=e.cd[r]||{};function s(e){return e||a(e)&&0===e}var c=Array.isArray(r)?function(e,t){var a=o.castOption(i,r,e);return s(a)?a:o.extractOption({},n,"",t)}:function(e,t){return o.extractOption(l,n,e,t)};function u(t,r,n){var a=c(r,n);s(a)&&(e[t]=a)}if(u("hoverinfo","hi","hoverinfo"),u("bgcolor","hbg","hoverlabel.bgcolor"),u("borderColor","hbc","hoverlabel.bordercolor"),u("fontFamily","htf","hoverlabel.font.family"),u("fontSize","hts","hoverlabel.font.size"),u("fontColor","htc","hoverlabel.font.color"),u("nameLength","hnl","hoverlabel.namelength"),u("textAlign","hta","hoverlabel.align"),e.posref="y"===t||"closest"===t&&"h"===n.orientation?e.xa._offset+(e.x0+e.x1)/2:e.ya._offset+(e.y0+e.y1)/2,e.x0=o.constrain(e.x0,0,e.xa._length),e.x1=o.constrain(e.x1,0,e.xa._length),e.y0=o.constrain(e.y0,0,e.ya._length),e.y1=o.constrain(e.y1,0,e.ya._length),void 0!==e.xLabelVal&&(e.xLabel="xLabel"in e?e.xLabel:p.hoverLabelText(e.xa,e.xLabelVal),e.xVal=e.xa.c2d(e.xLabelVal)),void 0!==e.yLabelVal&&(e.yLabel="yLabel"in e?e.yLabel:p.hoverLabelText(e.ya,e.yLabelVal),e.yVal=e.ya.c2d(e.yLabelVal)),void 0!==e.zLabelVal&&void 0===e.zLabel&&(e.zLabel=String(e.zLabelVal)),!(isNaN(e.xerr)||"log"===e.xa.type&&e.xerr<=0)){var f=p.tickText(e.xa,e.xa.c2l(e.xerr),"hover").text;void 0!==e.xerrneg?e.xLabel+=" +"+f+" / -"+p.tickText(e.xa,e.xa.c2l(e.xerrneg),"hover").text:e.xLabel+=" ± "+f,"x"===t&&(e.distance+=1)}if(!(isNaN(e.yerr)||"log"===e.ya.type&&e.yerr<=0)){var d=p.tickText(e.ya,e.ya.c2l(e.yerr),"hover").text;void 0!==e.yerrneg?e.yLabel+=" +"+d+" / -"+p.tickText(e.ya,e.ya.c2l(e.yerrneg),"hover").text:e.yLabel+=" ± "+d,"y"===t&&(e.distance+=1)}var h=e.hoverinfo||e.trace.hoverinfo;return h&&"all"!==h&&(-1===(h=Array.isArray(h)?h:h.split("+")).indexOf("x")&&(e.xLabel=void 0),-1===h.indexOf("y")&&(e.yLabel=void 0),-1===h.indexOf("z")&&(e.zLabel=void 0),-1===h.indexOf("text")&&(e.text=void 0),-1===h.indexOf("name")&&(e.name=void 0)),e}function D(e,t,r){var n,a,o=r.container,l=r.fullLayout,s=l._size,c=r.event,d=!!t.hLinePoint,h=!!t.vLinePoint;if(o.selectAll(".spikeline").remove(),h||d){var g=f.combine(l.plot_bgcolor,l.paper_bgcolor);if(d){var v,m,y=t.hLinePoint;n=y&&y.xa,"cursor"===(a=y&&y.ya).spikesnap?(v=c.pointerX,m=c.pointerY):(v=n._offset+y.x,m=a._offset+y.y);var x,b,_=i.readability(y.color,g)<1.5?f.contrast(g):y.color,w=a.spikemode,k=a.spikethickness,T=a.spikecolor||_,M=p.getPxPosition(e,a);if(-1!==w.indexOf("toaxis")||-1!==w.indexOf("across")){if(-1!==w.indexOf("toaxis")&&(x=M,b=v),-1!==w.indexOf("across")){var A=a._counterDomainMin,L=a._counterDomainMax;"free"===a.anchor&&(A=Math.min(A,a.position),L=Math.max(L,a.position)),x=s.l+A*s.w,b=s.l+L*s.w}o.insert("line",":first-child").attr({x1:x,x2:b,y1:m,y2:m,"stroke-width":k,stroke:T,"stroke-dasharray":u.dashStyle(a.spikedash,k)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:x,x2:b,y1:m,y2:m,"stroke-width":k+2,stroke:g}).classed("spikeline",!0).classed("crisp",!0)}-1!==w.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:M+("right"!==a.side?k:-k),cy:m,r:k,fill:T}).classed("spikeline",!0)}if(h){var S,C,O=t.vLinePoint;n=O&&O.xa,a=O&&O.ya,"cursor"===n.spikesnap?(S=c.pointerX,C=c.pointerY):(S=n._offset+O.x,C=a._offset+O.y);var P,D,z=i.readability(O.color,g)<1.5?f.contrast(g):O.color,R=n.spikemode,E=n.spikethickness,I=n.spikecolor||z,F=p.getPxPosition(e,n);if(-1!==R.indexOf("toaxis")||-1!==R.indexOf("across")){if(-1!==R.indexOf("toaxis")&&(P=F,D=C),-1!==R.indexOf("across")){var N=n._counterDomainMin,j=n._counterDomainMax;"free"===n.anchor&&(N=Math.min(N,n.position),j=Math.max(j,n.position)),P=s.t+(1-j)*s.h,D=s.t+(1-N)*s.h}o.insert("line",":first-child").attr({x1:S,x2:S,y1:P,y2:D,"stroke-width":E,stroke:I,"stroke-dasharray":u.dashStyle(n.spikedash,E)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:S,x2:S,y1:P,y2:D,"stroke-width":E+2,stroke:g}).classed("spikeline",!0).classed("crisp",!0)}-1!==R.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:S,cy:F-("top"!==n.side?E:-E),r:E,fill:I}).classed("spikeline",!0)}}}function z(e,t){return!t||(t.vLinePoint!==e._spikepoints.vLinePoint||t.hLinePoint!==e._spikepoints.hLinePoint)}function R(e,t){return s.plainText(e||"",{len:t,allowedTags:["br","sub","sup","b","i","em"]})}},{"../../lib":148,"../../lib/events":142,"../../lib/override_cursor":159,"../../lib/svg_text_utils":169,"../../plots/cartesian/axes":192,"../../registry":232,"../color":30,"../dragelement":48,"../drawing":51,"../legend/defaults":81,"../legend/draw":82,"./constants":63,"./helpers":65,d3:2,"fast-isnumeric":4,tinycolor2:281}],67:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../color"),i=e("./helpers").isUnifiedHover;t.exports=function(e,t,r,o){function l(e){o.font[e]||(o.font[e]=t.legend?t.legend.font[e]:t.font[e])}o=o||{},t&&i(t.hovermode)&&(o.font||(o.font={}),l("size"),l("family"),l("color"),t.legend?(o.bgcolor||(o.bgcolor=a.combine(t.legend.bgcolor,t.paper_bgcolor)),o.bordercolor||(o.bordercolor=t.legend.bordercolor)):o.bgcolor||(o.bgcolor=t.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":148,"../color":30,"./helpers":65}],68:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./layout_attributes");t.exports=function(e,t,r){function i(r,i){return void 0!==t[r]?t[r]:n.coerce(e,t,a,r,i)}var o,l=i("clickmode");return t._has("cartesian")?l.indexOf("select")>-1?o="closest":(t._isHoriz=function(e,t){for(var r=t._scatterStackOpts||{},n=0;n<e.length;n++){var a=e[n],i=a.xaxis+a.yaxis,o=r[i]||{},l=o[a.stackgroup]||{};if("h"!==a.orientation&&"h"!==l.orientation)return!1}return!0}(r,t),o=t._isHoriz?"y":"x"):o="closest",i("hovermode",o)}},{"../../lib":148,"./layout_attributes":70}],69:[function(e,t,r){"use strict";var n=e("d3"),a=e("../../lib"),i=e("../dragelement"),o=e("./helpers"),l=e("./layout_attributes"),s=e("./hover");t.exports={moduleType:"component",name:"fx",constants:e("./constants"),schema:{layout:l},attributes:e("./attributes"),layoutAttributes:l,supplyLayoutGlobalDefaults:e("./layout_global_defaults"),supplyDefaults:e("./defaults"),supplyLayoutDefaults:e("./layout_defaults"),calc:e("./calc"),getDistanceFunction:o.getDistanceFunction,getClosest:o.getClosest,inbox:o.inbox,quadrature:o.quadrature,appendArrayPointValue:o.appendArrayPointValue,castHoverOption:function(e,t,r){return a.castOption(e,t,"hoverlabel."+r)},castHoverinfo:function(e,t,r){return a.castOption(e,r,"hoverinfo",function(r){return a.coerceHoverinfo({hoverinfo:r},{_module:e._module},t)})},hover:s.hover,unhover:i.unhover,loneHover:s.loneHover,loneUnhover:function(e){var t=a.isD3Selection(e)?e:n.select(e);t.selectAll("g.hovertext").remove(),t.selectAll(".spikeline").remove()},click:e("./click")}},{"../../lib":148,"../dragelement":48,"./attributes":60,"./calc":61,"./click":62,"./constants":63,"./defaults":64,"./helpers":65,"./hover":66,"./layout_attributes":70,"./layout_defaults":71,"./layout_global_defaults":72,d3:2}],70:[function(e,t,r){"use strict";var n=e("./constants"),a=e("../../plots/font_attributes")({editType:"none"});a.family.dflt=n.HOVERFONT,a.size.dflt=n.HOVERFONTSIZE,t.exports={clickmode:{valType:"flaglist",flags:["event","select"],dflt:"event",editType:"plot",extras:["none"]},dragmode:{valType:"enumerated",values:["zoom","pan","select","lasso","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":218,"./constants":63}],71:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./helpers").isUnifiedHover,i=e("./layout_attributes"),o=e("./hovermode_defaults"),l=e("./hoverlabel_defaults");t.exports=function(e,t,r){function s(r,a){return n.coerce(e,t,i,r,a)}var c=o(e,t,r);c&&(s("hoverdistance"),s("spikedistance",a(c)?-1:void 0)),"select"===s("dragmode")&&s("selectdirection");var u=t._has("mapbox"),f=t._has("geo"),d=t._basePlotModules.length;"zoom"===t.dragmode&&((u||f)&&1===d||u&&f&&2===d)&&(t.dragmode="pan"),l(e,t,s)}},{"../../lib":148,"./helpers":65,"./hoverlabel_defaults":67,"./hovermode_defaults":68,"./layout_attributes":70}],72:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./hoverlabel_defaults"),i=e("./layout_attributes");t.exports=function(e,t){a(e,t,function(r,a){return n.coerce(e,t,i,r,a)})}},{"../../lib":148,"./hoverlabel_defaults":67,"./layout_attributes":70}],73:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../lib/regex").counter,i=e("../../plots/domain").attributes,o=e("../../plots/cartesian/constants").idRegex,l=e("../../plot_api/plot_template"),s={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 c(e,t,r){var n=t[r+"axes"],a=Object.keys((e._splomAxes||{})[r]||{});return Array.isArray(n)?n:a.length?a:void 0}function u(e,t,r,n,a,i){var o=t(e+"gap",r),l=t("domain."+e);t(e+"side",n);for(var s=new Array(a),c=l[0],u=(l[1]-c)/(a-o),f=u*(1-o),d=0;d<a;d++){var p=c+u*d;s[i?a-1-d:d]=[p,p+f]}return s}function f(e,t,r,n,a){var i,o=new Array(r);function l(e,r){-1!==t.indexOf(r)&&void 0===n[r]?(o[e]=r,n[r]=e):o[e]=""}if(Array.isArray(e))for(i=0;i<r;i++)l(i,e[i]);else for(l(0,a),i=1;i<r;i++)l(i,a+(i+1));return o}t.exports={moduleType:"component",name:"grid",schema:{layout:{grid:s}},layoutAttributes:s,sizeDefaults:function(e,t){var r=e.grid||{},a=c(t,r,"x"),i=c(t,r,"y");if(e.grid||a||i){var o,f,d=Array.isArray(r.subplots)&&Array.isArray(r.subplots[0]),p=Array.isArray(a),h=Array.isArray(i),g=p&&a!==r.xaxes&&h&&i!==r.yaxes;d?(o=r.subplots.length,f=r.subplots[0].length):(h&&(o=i.length),p&&(f=a.length));var v=l.newContainer(t,"grid"),m=T("rows",o),y=T("columns",f);if(m*y>1){d||p||h||"independent"===T("pattern")&&(d=!0),v._hasSubplotGrid=d;var x,b,_="top to bottom"===T("roworder"),w=d?.2:.1,k=d?.3:.1;g&&t._splomGridDflt&&(x=t._splomGridDflt.xside,b=t._splomGridDflt.yside),v._domains={x:u("x",T,w,x,y),y:u("y",T,k,b,m,_)}}else delete t.grid}function T(e,t){return n.coerce(r,v,s,e,t)}},contentDefaults:function(e,t){var r=t.grid;if(r&&r._domains){var n,a,i,o,l,s,u,d=e.grid||{},p=t._subplots,h=r._hasSubplotGrid,g=r.rows,v=r.columns,m="independent"===r.pattern,y=r._axisMap={};if(h){var x=d.subplots||[];s=r.subplots=new Array(g);var b=1;for(n=0;n<g;n++){var _=s[n]=new Array(v),w=x[n]||[];for(a=0;a<v;a++)if(m?(l=1===b?"xy":"x"+b+"y"+b,b++):l=w[a],_[a]="",-1!==p.cartesian.indexOf(l)){if(u=l.indexOf("y"),i=l.slice(0,u),o=l.slice(u),void 0!==y[i]&&y[i]!==a||void 0!==y[o]&&y[o]!==n)continue;_[a]=l,y[i]=a,y[o]=n}}}else{var k=c(t,d,"x"),T=c(t,d,"y");r.xaxes=f(k,p.xaxis,v,y,"x"),r.yaxes=f(T,p.yaxis,g,y,"y")}var M=r._anchors={},A="top to bottom"===r.roworder;for(var L in y){var S,C,O,P=L.charAt(0),D=r[P+"side"];if(D.length<8)M[L]="free";else if("x"===P){if("t"===D.charAt(0)===A?(S=0,C=1,O=g):(S=g-1,C=-1,O=-1),h){var z=y[L];for(n=S;n!==O;n+=C)if((l=s[n][z])&&(u=l.indexOf("y"),l.slice(0,u)===L)){M[L]=l.slice(u);break}}else for(n=S;n!==O;n+=C)if(o=r.yaxes[n],-1!==p.cartesian.indexOf(L+o)){M[L]=o;break}}else if("l"===D.charAt(0)?(S=0,C=1,O=v):(S=v-1,C=-1,O=-1),h){var R=y[L];for(n=S;n!==O;n+=C)if((l=s[R][n])&&(u=l.indexOf("y"),l.slice(u)===L)){M[L]=l.slice(0,u);break}}else for(n=S;n!==O;n+=C)if(i=r.xaxes[n],-1!==p.cartesian.indexOf(i+L)){M[L]=i;break}}}}}},{"../../lib":148,"../../lib/regex":163,"../../plot_api/plot_template":182,"../../plots/cartesian/constants":198,"../../plots/domain":217}],74:[function(e,t,r){"use strict";var n=e("../../plots/cartesian/constants"),a=e("../../plot_api/plot_template").templatedArray;t.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"})},{"../../plot_api/plot_template":182,"../../plots/cartesian/constants":198}],75:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("../../lib/to_log_range");t.exports=function(e,t,r,i){t=t||{};var o="log"===r&&"linear"===t.type,l="linear"===r&&"log"===t.type;if(o||l)for(var s,c,u=e._fullLayout.images,f=t._id.charAt(0),d=0;d<u.length;d++)if(c="images["+d+"].",(s=u[d])[f+"ref"]===t._id){var p=s[f],h=s["size"+f],g=null,v=null;if(o){g=a(p,t.range);var m=h/Math.pow(10,g)/2;v=2*Math.log(m+Math.sqrt(1+m*m))/Math.LN10}else v=(g=Math.pow(10,p))*(Math.pow(10,h/2)-Math.pow(10,-h/2));n(g)?n(v)||(v=null):(g=null,v=null),i(c+f,g),i(c+"size"+f,v)}}},{"../../lib/to_log_range":171,"fast-isnumeric":4}],76:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/cartesian/axes"),i=e("../../plots/array_container_defaults"),o=e("./attributes");function l(e,t,r){function i(r,a){return n.coerce(e,t,o,r,a)}if(!i("visible",!!i("source")))return t;i("layer"),i("xanchor"),i("yanchor"),i("sizex"),i("sizey"),i("sizing"),i("opacity");for(var l={_fullLayout:r},s=["x","y"],c=0;c<2;c++){var u=s[c],f=a.coerceRef(e,t,l,u,"paper");if("paper"!==f)a.getFromId(l,f)._imgIndices.push(t._index);a.coercePosition(t,l,i,f,u,0)}return t}t.exports=function(e,t){i(e,t,{name:"images",handleItemDefaults:l})}},{"../../lib":148,"../../plots/array_container_defaults":188,"../../plots/cartesian/axes":192,"./attributes":74}],77:[function(e,t,r){"use strict";var n=e("d3"),a=e("../drawing"),i=e("../../plots/cartesian/axes"),o=e("../../constants/xmlns_namespaces");t.exports=function(e){var t,r,l=e._fullLayout,s=[],c={},u=[];for(r=0;r<l.images.length;r++){var f=l.images[r];if(f.visible)if("below"===f.layer&&"paper"!==f.xref&&"paper"!==f.yref){t=f.xref+f.yref;var d=l._plots[t];if(!d){u.push(f);continue}d.mainplot&&(t=d.mainplot.id),c[t]||(c[t]=[]),c[t].push(f)}else"above"===f.layer?s.push(f):u.push(f)}var p={x:{left:{sizing:"xMin",offset:0},center:{sizing:"xMid",offset:-.5},right:{sizing:"xMax",offset:-1}},y:{top:{sizing:"YMin",offset:0},middle:{sizing:"YMid",offset:-.5},bottom:{sizing:"YMax",offset:-1}}};function h(t){var r=n.select(this);if(this._imgSrc!==t.source)if(r.attr("xmlns",o.svg),t.source&&"data:"===t.source.slice(0,5))r.attr("xlink:href",t.source),this._imgSrc=t.source;else{var a=new Promise(function(e){var n=new Image;function a(){r.remove(),e()}this.img=n,n.setAttribute("crossOrigin","anonymous"),n.onerror=a,n.onload=function(){var t=document.createElement("canvas");t.width=this.width,t.height=this.height,t.getContext("2d").drawImage(this,0,0);var n=t.toDataURL("image/png");r.attr("xlink:href",n),e()},r.on("error",a),n.src=t.source,this._imgSrc=t.source}.bind(this));e._promises.push(a)}}function g(t){var r=n.select(this),o=i.getFromId(e,t.xref),s=i.getFromId(e,t.yref),c=l._size,u=o?Math.abs(o.l2p(t.sizex)-o.l2p(0)):t.sizex*c.w,f=s?Math.abs(s.l2p(t.sizey)-s.l2p(0)):t.sizey*c.h,d=u*p.x[t.xanchor].offset,h=f*p.y[t.yanchor].offset,g=p.x[t.xanchor].sizing+p.y[t.yanchor].sizing,v=(o?o.r2p(t.x)+o._offset:t.x*c.w+c.l)+d,m=(s?s.r2p(t.y)+s._offset:c.h-t.y*c.h+c.t)+h;switch(t.sizing){case"fill":g+=" slice";break;case"stretch":g="none"}r.attr({x:v,y:m,width:u,height:f,preserveAspectRatio:g,opacity:t.opacity});var y=(o?o._id:"")+(s?s._id:"");a.setClipUrl(r,y?"clip"+l._uid+y:null,e)}var v=l._imageLowerLayer.selectAll("image").data(u),m=l._imageUpperLayer.selectAll("image").data(s);v.enter().append("image"),m.enter().append("image"),v.exit().remove(),m.exit().remove(),v.each(function(e){h.bind(this)(e),g.bind(this)(e)}),m.each(function(e){h.bind(this)(e),g.bind(this)(e)});var y=Object.keys(l._plots);for(r=0;r<y.length;r++){t=y[r];var x=l._plots[t];if(x.imagelayer){var b=x.imagelayer.selectAll("image").data(c[t]||[]);b.enter().append("image"),b.exit().remove(),b.each(function(e){h.bind(this)(e),g.bind(this)(e)})}}}},{"../../constants/xmlns_namespaces":129,"../../plots/cartesian/axes":192,"../drawing":51,d3:2}],78:[function(e,t,r){"use strict";t.exports={moduleType:"component",name:"images",layoutAttributes:e("./attributes"),supplyLayoutDefaults:e("./defaults"),includeBasePlot:e("../../plots/cartesian/include_components")("images"),draw:e("./draw"),convertCoords:e("./convert_coords")}},{"../../plots/cartesian/include_components":202,"./attributes":74,"./convert_coords":75,"./defaults":76,"./draw":77}],79:[function(e,t,r){"use strict";var n=e("../../plots/font_attributes"),a=e("../color/attributes");t.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"},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":218,"../color/attributes":29}],80:[function(e,t,r){"use strict";t.exports={scrollBarWidth:6,scrollBarMinHeight:20,scrollBarColor:"#808BA4",scrollBarMargin:4,scrollBarEnterAttrs:{rx:20,ry:3,width:0,height:0},titlePad:2,textGap:40,itemGap:5}},{}],81:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../lib"),i=e("../../plot_api/plot_template"),o=e("./attributes"),l=e("../../plots/layout_attributes"),s=e("./helpers");t.exports=function(e,t,r){for(var c=e.legend||{},u=0,f=!1,d="normal",p=0;p<r.length;p++){var h=r[p];h.visible&&((h.showlegend||h._dfltShowLegend&&!(h._module&&h._module.attributes&&h._module.attributes.showlegend&&!1===h._module.attributes.showlegend.dflt))&&(u++,h.showlegend&&(f=!0,(n.traceIs(h,"pie-like")||!0===h._input.showlegend)&&u++)),(n.traceIs(h,"bar")&&"stack"===t.barmode||-1!==["tonextx","tonexty"].indexOf(h.fill))&&(d=s.isGrouped({traceorder:d})?"grouped+reversed":"reversed"),void 0!==h.legendgroup&&""!==h.legendgroup&&(d=s.isReversed({traceorder:d})?"reversed+grouped":"grouped"))}var g=a.coerce(e,t,l,"showlegend",f&&u>1);if(!1!==g||c.uirevision){var v=i.newContainer(t,"legend");if(_("uirevision",t.uirevision),!1!==g){_("bgcolor",t.paper_bgcolor),_("bordercolor"),_("borderwidth"),a.coerceFont(_,"font",t.font);var m,y,x,b=_("orientation");"h"===b?(m=0,n.getComponentMethod("rangeslider","isVisible")(e.xaxis)?(y=1.1,x="bottom"):(y=-.1,x="top")):(m=1.02,y=1,x="auto"),_("traceorder",d),s.isGrouped(t.legend)&&_("tracegroupgap"),_("itemsizing"),_("itemclick"),_("itemdoubleclick"),_("x",m),_("xanchor"),_("y",y),_("yanchor",x),_("valign"),a.noneOrAll(c,v,["x","y"]),_("title.text")&&(_("title.side","h"===b?"left":"top"),a.coerceFont(_,"title.font",t.font))}}function _(e,t){return a.coerce(c,v,o,e,t)}}},{"../../lib":148,"../../plot_api/plot_template":182,"../../plots/layout_attributes":222,"../../registry":232,"./attributes":79,"./helpers":85}],82:[function(e,t,r){"use strict";var n=e("d3"),a=e("../../lib"),i=e("../../plots/plots"),o=e("../../registry"),l=e("../../lib/events"),s=e("../dragelement"),c=e("../drawing"),u=e("../color"),f=e("../../lib/svg_text_utils"),d=e("./handle_click"),p=e("./constants"),h=e("../../constants/alignment"),g=h.LINE_SPACING,v=h.FROM_TL,m=h.FROM_BR,y=e("./get_legend_data"),x=e("./style"),b=e("./helpers");function _(e,t,r,n,a){var i=r.data()[0][0].trace,s={event:a,node:r.node(),curveNumber:i.index,expandedIndex:i._expandedIndex,data:e.data,layout:e.layout,frames:e._transitionData._frames,config:e._context,fullData:e._fullData,fullLayout:e._fullLayout};if(i._group&&(s.group=i._group),o.traceIs(i,"pie-like")&&(s.label=r.datum()[0].label),!1!==l.triggerHandler(e,"plotly_legendclick",s))if(1===n)t._clickTimeout=setTimeout(function(){d(r,e,n)},e._context.doubleClickDelay);else if(2===n){t._clickTimeout&&clearTimeout(t._clickTimeout),e._legendMouseDownTime=0,!1!==l.triggerHandler(e,"plotly_legenddoubleclick",s)&&d(r,e,n)}}function w(e,t,r){var n,i=e.data()[0][0],l=i.trace,s=o.traceIs(l,"pie-like"),u=l.index,d=r._main&&t._context.edits.legendText&&!s,h=r._maxNameLength;r.entries?n=i.text:(n=s?i.label:l.name,l._meta&&(n=a.templateString(n,l._meta)));var g=a.ensureSingle(e,"text","legendtext");g.attr("text-anchor","start").classed("user-select-none",!0).call(c.font,r.font).text(d?k(n,h):n),f.positionText(g,p.textGap,0),d?g.call(f.makeEditable,{gd:t,text:n}).call(M,e,t,r).on("edit",function(n){this.text(k(n,h)).call(M,e,t,r);var l=i.trace._fullInput||{},s={};if(o.hasTransform(l,"groupby")){var c=o.getTransformIndices(l,"groupby"),f=c[c.length-1],d=a.keyedContainer(l,"transforms["+f+"].styles","target","value.name");d.set(i.trace._group,n),s=d.constructUpdate()}else s.name=n;return o.call("_guiRestyle",t,s,u)}):M(g,e,t,r)}function k(e,t){var r=Math.max(4,t);if(e&&e.trim().length>=r/2)return e;for(var n=r-(e=e||"").length;n>0;n--)e+=" ";return e}function T(e,t){var r,i=t._context.doubleClickDelay,o=1,l=a.ensureSingle(e,"rect","legendtoggle",function(e){e.style("cursor","pointer").attr("pointer-events","all").call(u.fill,"rgba(0,0,0,0)")});l.on("mousedown",function(){(r=(new Date).getTime())-t._legendMouseDownTime<i?o+=1:(o=1,t._legendMouseDownTime=r)}),l.on("mouseup",function(){if(!t._dragged&&!t._editing){var r=t._fullLayout.legend;(new Date).getTime()-t._legendMouseDownTime>i&&(o=Math.max(o-1,1)),_(t,r,e,o,n.event)}})}function M(e,t,r,n){n._main||e.attr("data-notex",!0),f.convertToTspans(e,r,function(){!function(e,t,r){var n=e.data()[0][0];if(r._main&&n&&!n.trace.showlegend)return void e.remove();var a=e.select("g[class*=math-group]"),i=a.node();r||(r=t._fullLayout.legend);var o,l,s=r.borderwidth,u=(n?r:r.title).font.size*g;if(i){var d=c.bBox(i);o=d.height,l=d.width,n?c.setTranslate(a,0,.25*o):c.setTranslate(a,s,.75*o+s)}else{var h=e.select(n?".legendtext":".legendtitletext"),v=f.lineCount(h),m=h.node();o=u*v,l=m?c.bBox(m).width:0;var y=u*((v-1)/2-.3);n?f.positionText(h,p.textGap,-y):f.positionText(h,p.titlePad+s,u+s)}n?(n.lineHeight=u,n.height=Math.max(o,16)+3,n.width=l):(r._titleWidth=l,r._titleHeight=o)}(t,r,n)})}function A(e){return a.isRightAnchor(e)?"right":a.isCenterAnchor(e)?"center":"left"}function L(e){return a.isBottomAnchor(e)?"bottom":a.isMiddleAnchor(e)?"middle":"top"}t.exports=function(e,t){var r,l=e._fullLayout,f="legend"+l._uid;if(t?(r=t.layer,f+="-hover"):((t=l.legend||{})._main=!0,r=l._infolayer),r){var d;if(e._legendMouseDownTime||(e._legendMouseDownTime=0),t._main){if(!e.calcdata)return;d=l.showlegend&&y(e.calcdata,t)}else{if(!t.entries)return;d=y(t.entries,t)}var h=l.hiddenlabels||[];if(t._main&&(!l.showlegend||!d.length))return r.selectAll(".legend").remove(),l._topdefs.select("#"+f).remove(),i.autoMargin(e,"legend");var g=a.ensureSingle(r,"g","legend",function(e){t._main&&e.attr("pointer-events","all")}),k=a.ensureSingleById(l._topdefs,"clipPath",f,function(e){e.append("rect")}),S=a.ensureSingle(g,"rect","bg",function(e){e.attr("shape-rendering","crispEdges")});S.call(u.stroke,t.bordercolor).call(u.fill,t.bgcolor).style("stroke-width",t.borderwidth+"px");var C=a.ensureSingle(g,"g","scrollbox"),O=t.title;if(t._titleWidth=0,t._titleHeight=0,O.text){var P=a.ensureSingle(C,"text","legendtitletext");P.attr("text-anchor","start").classed("user-select-none",!0).call(c.font,O.font).text(O.text),M(P,C,e,t)}var D=a.ensureSingle(g,"rect","scrollbar",function(e){e.attr(p.scrollBarEnterAttrs).call(u.fill,p.scrollBarColor)}),z=C.selectAll("g.groups").data(d);z.enter().append("g").attr("class","groups"),z.exit().remove();var R=z.selectAll("g.traces").data(a.identity);R.enter().append("g").attr("class","traces"),R.exit().remove(),R.style("opacity",function(e){var t=e[0].trace;return o.traceIs(t,"pie-like")?-1!==h.indexOf(e[0].label)?.5:1:"legendonly"===t.visible?.5:1}).each(function(){n.select(this).call(w,e,t)}).call(x,e,t).each(function(){t._main&&n.select(this).call(T,e)}),a.syncOrAsync([i.previousPromises,function(){return function(e,t,r,a){var i=e._fullLayout;a||(a=i.legend);var o=i._size,l=b.isVertical(a),s=b.isGrouped(a),u=a.borderwidth,f=2*u,d=p.textGap,h=p.itemGap,g=2*(u+h),v=L(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 x=0;a._width=0,a._height=0;var _=function(e){var t=0,r=0,n=e.title.side;n&&(-1!==n.indexOf("left")&&(t=e._titleWidth),-1!==n.indexOf("top")&&(r=e._titleHeight));return[t,r]}(a);if(l)r.each(function(e){var t=e[0].height;c.setTranslate(this,u+_[0],u+_[1]+a._height+t/2+h),a._height+=t,a._width=Math.max(a._width,e[0].width)}),x=d+a._width,a._width+=h+d+f,a._height+=g,s&&(t.each(function(e,t){c.setTranslate(this,0,t*a.tracegroupgap)}),a._height+=(a._lgroupsLength-1)*a.tracegroupgap);else{var w=A(a),k=a.x<0||0===a.x&&"right"===w,T=a.x>1||1===a.x&&"left"===w,M=y||m,S=i.width/2;a._maxWidth=Math.max(k?M&&"left"===w?o.l+o.w:S:T?M&&"right"===w?o.r+o.w:S:o.w,2*d);var C=0,O=0;r.each(function(e){var t=e[0].width+d;C=Math.max(C,t),O+=t}),x=null;var P=0;if(s){var D=0,z=0,R=0;t.each(function(){var e=0,t=0;n.select(this).selectAll("g.traces").each(function(r){var n=r[0].height;c.setTranslate(this,_[0],_[1]+u+h+n/2+t),t+=n,e=Math.max(e,d+r[0].width)}),D=Math.max(D,t);var r=e+h;r+u+z>a._maxWidth&&(P=Math.max(P,z),z=0,R+=D+a.tracegroupgap,D=t),c.setTranslate(this,z,R),z+=r}),a._width=Math.max(P,z)+u,a._height=R+D+g}else{var E=r.size(),I=O+f+(E-1)*h<a._maxWidth,F=0,N=0,j=0,B=0;r.each(function(e){var t=e[0].height,r=d+e[0].width,n=(I?r:C)+h;n+u+N>a._maxWidth&&(P=Math.max(P,B),N=0,j+=F,a._height+=F,F=0),c.setTranslate(this,_[0]+u+N,_[1]+u+j+t/2+h),B=N+r+h,N+=n,F=Math.max(F,t)}),I?(a._width=N+f,a._height=F+g):(a._width=Math.max(P,B)+f,a._height+=F+g)}}a._width=Math.ceil(Math.max(a._width+_[0],a._titleWidth+2*(u+p.titlePad))),a._height=Math.ceil(Math.max(a._height+_[1],a._titleHeight+2*(u+p.itemGap))),a._effHeight=Math.min(a._height,a._maxHeight);var H=e._context.edits,q=H.legendText||H.legendPosition;r.each(function(e){var t=n.select(this).select(".legendtoggle"),r=e[0].height,a=q?d:x||d+e[0].width;l||(a+=h/2),c.setRect(t,0,-r/2,a,r)})}(e,z,R,t)},function(){if(!t._main||!function(e){var t=e._fullLayout.legend,r=A(t),n=L(t);return i.autoMargin(e,"legend",{x:t.x,y:t.y,l:t._width*v[r],r:t._width*m[r],b:t._effHeight*m[n],t:t._effHeight*v[n]})}(e)){var u,d,h,y,x=l._size,b=t.borderwidth,w=x.l+x.w*t.x-v[A(t)]*t._width,T=x.t+x.h*(1-t.y)-v[L(t)]*t._effHeight;if(t._main&&l.margin.autoexpand){var M=w,O=T;w=a.constrain(w,0,l.width-t._width),T=a.constrain(T,0,l.height-t._effHeight),w!==M&&a.log("Constrain legend.x to make legend fit inside graph"),T!==O&&a.log("Constrain legend.y to make legend fit inside graph")}if(t._main&&c.setTranslate(g,w,T),D.on(".drag",null),g.on("wheel",null),!t._main||t._height<=t._maxHeight||e._context.staticPlot){var P=t._effHeight;t._main||(P=t._height),S.attr({width:t._width-b,height:P-b,x:b/2,y:b/2}),c.setTranslate(C,0,0),k.select("rect").attr({width:t._width-2*b,height:P-2*b,x:b,y:b}),c.setClipUrl(C,f,e),c.setRect(D,0,0,0,0),delete t._scrollY}else{var z,R,E,I=Math.max(p.scrollBarMinHeight,t._effHeight*t._effHeight/t._height),F=t._effHeight-I-2*p.scrollBarMargin,N=t._height-t._effHeight,j=F/N,B=Math.min(t._scrollY||0,N);S.attr({width:t._width-2*b+p.scrollBarWidth+p.scrollBarMargin,height:t._effHeight-b,x:b/2,y:b/2}),k.select("rect").attr({width:t._width-2*b+p.scrollBarWidth+p.scrollBarMargin,height:t._effHeight-2*b,x:b,y:b+B}),c.setClipUrl(C,f,e),V(B,I,j),g.on("wheel",function(){V(B=a.constrain(t._scrollY+n.event.deltaY/F*N,0,N),I,j),0!==B&&B!==N&&n.event.preventDefault()});var H=n.behavior.drag().on("dragstart",function(){var e=n.event.sourceEvent;z="touchstart"===e.type?e.changedTouches[0].clientY:e.clientY,E=B}).on("drag",function(){var e=n.event.sourceEvent;2===e.buttons||e.ctrlKey||(R="touchmove"===e.type?e.changedTouches[0].clientY:e.clientY,V(B=function(e,t,r){var n=(r-t)/j+e;return a.constrain(n,0,N)}(E,z,R),I,j))});D.call(H);var q=n.behavior.drag().on("dragstart",function(){var e=n.event.sourceEvent;"touchstart"===e.type&&(z=e.changedTouches[0].clientY,E=B)}).on("drag",function(){var e=n.event.sourceEvent;"touchmove"===e.type&&(R=e.changedTouches[0].clientY,V(B=function(e,t,r){var n=(t-r)/j+e;return a.constrain(n,0,N)}(E,z,R),I,j))});C.call(q)}if(e._context.edits.legendPosition)g.classed("cursor-move",!0),s.init({element:g.node(),gd:e,prepFn:function(){var e=c.getTranslate(g);h=e.x,y=e.y},moveFn:function(e,r){var n=h+e,a=y+r;c.setTranslate(g,n,a),u=s.align(n,0,x.l,x.l+x.w,t.xanchor),d=s.align(a,0,x.t+x.h,x.t,t.yanchor)},doneFn:function(){void 0!==u&&void 0!==d&&o.call("_guiRelayout",e,{"legend.x":u,"legend.y":d})},clickFn:function(t,n){var a=r.selectAll("g.traces").filter(function(){var e=this.getBoundingClientRect();return n.clientX>=e.left&&n.clientX<=e.right&&n.clientY>=e.top&&n.clientY<=e.bottom});a.size()>0&&_(e,g,a,t,n)}})}function V(r,n,a){t._scrollY=e._fullLayout.legend._scrollY=r,c.setTranslate(C,0,-r),c.setRect(D,t._width,p.scrollBarMargin+r*a,p.scrollBarWidth,n),k.select("rect").attr("y",b+r)}}],e)}}},{"../../constants/alignment":125,"../../lib":148,"../../lib/events":142,"../../lib/svg_text_utils":169,"../../plots/plots":224,"../../registry":232,"../color":30,"../dragelement":48,"../drawing":51,"./constants":80,"./get_legend_data":83,"./handle_click":84,"./helpers":85,"./style":87,d3:2}],83:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("./helpers");t.exports=function(e,t){var r,i,o={},l=[],s=!1,c={},u=0,f=0,d=t._main;function p(e,r){if(""!==e&&a.isGrouped(t))-1===l.indexOf(e)?(l.push(e),s=!0,o[e]=[[r]]):o[e].push([r]);else{var n="~~i"+u;l.push(n),o[n]=[[r]],u++}}for(r=0;r<e.length;r++){var h=e[r],g=h[0],v=g.trace,m=v.legendgroup;if(!d||v.visible&&v.showlegend)if(n.traceIs(v,"pie-like"))for(c[m]||(c[m]={}),i=0;i<h.length;i++){var y=h[i].label;c[m][y]||(p(m,{label:y,color:h[i].color,i:h[i].i,trace:v,pts:h[i].pts}),c[m][y]=!0,f=Math.max(f,(y||"").length))}else p(m,g),f=Math.max(f,(v.name||"").length)}if(!l.length)return[];var x,b,_=l.length;if(s&&a.isGrouped(t))for(b=new Array(_),r=0;r<_;r++)x=o[l[r]],b[r]=a.isReversed(t)?x.reverse():x;else{for(b=[new Array(_)],r=0;r<_;r++)x=o[l[r]][0],b[0][a.isReversed(t)?_-r-1:r]=x;_=1}return t._lgroupsLength=_,t._maxNameLength=f,b}},{"../../registry":232,"./helpers":85}],84:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../registry"),i=!0;t.exports=function(e,t,r){var o=t._fullLayout;if(!t._dragged&&!t._editing){var l,s=o.legend.itemclick,c=o.legend.itemdoubleclick;if(1===r&&"toggle"===s&&"toggleothers"===c&&i&&t.data&&t._context.showTips?(n.notifier(n._(t,"Double-click on legend to isolate one trace"),"long"),i=!1):i=!1,1===r?l=s:2===r&&(l=c),l){var u,f,d,p,h,g=o.hiddenlabels?o.hiddenlabels.slice():[],v=e.data()[0][0],m=t._fullData,y=v.trace,x=y.legendgroup,b={},_=[],w=[],k=[];if(a.traceIs(y,"pie-like")){var T=v.label,M=g.indexOf(T);"toggle"===l?-1===M?g.push(T):g.splice(M,1):"toggleothers"===l&&(g=[],t.calcdata[0].forEach(function(e){T!==e.label&&g.push(e.label)}),t._fullLayout.hiddenlabels&&t._fullLayout.hiddenlabels.length===g.length&&-1===M&&(g=[])),a.call("_guiRelayout",t,"hiddenlabels",g)}else{var A,L=x&&x.length,S=[];if(L)for(u=0;u<m.length;u++)(A=m[u]).visible&&A.legendgroup===x&&S.push(u);if("toggle"===l){var C;switch(y.visible){case!0:C="legendonly";break;case!1:C=!1;break;case"legendonly":C=!0}if(L)for(u=0;u<m.length;u++)!1!==m[u].visible&&m[u].legendgroup===x&&N(m[u],C);else N(y,C)}else if("toggleothers"===l){var O,P,D,z,R=!0;for(u=0;u<m.length;u++)if(O=m[u]===y,D=!0!==m[u].showlegend,!(O||D||(P=L&&m[u].legendgroup===x)||!0!==m[u].visible||a.traceIs(m[u],"notLegendIsolatable"))){R=!1;break}for(u=0;u<m.length;u++)if(!1!==m[u].visible&&!a.traceIs(m[u],"notLegendIsolatable"))switch(y.visible){case"legendonly":N(m[u],!0);break;case!0:z=!!R||"legendonly",O=m[u]===y,D=!0!==m[u].showlegend&&!m[u].legendgroup,P=O||L&&m[u].legendgroup===x,N(m[u],!(!P&&!D)||z)}}for(u=0;u<w.length;u++)if(d=w[u]){var E=d.constructUpdate(),I=Object.keys(E);for(f=0;f<I.length;f++)p=I[f],(b[p]=b[p]||[])[k[u]]=E[p]}for(h=Object.keys(b),u=0;u<h.length;u++)for(p=h[u],f=0;f<_.length;f++)b[p].hasOwnProperty(f)||(b[p][f]=void 0);a.call("_guiRestyle",t,b,_)}}}function F(e,t,r){var n=_.indexOf(e),a=b[t];return a||(a=b[t]=[]),-1===_.indexOf(e)&&(_.push(e),n=_.length-1),a[n]=r,n}function N(e,t){var r=e._fullInput;if(a.hasTransform(r,"groupby")){var i=w[r.index];if(!i){var o=a.getTransformIndices(r,"groupby"),l=o[o.length-1];i=n.keyedContainer(r,"transforms["+l+"].styles","target","value.visible"),w[r.index]=i}var s=i.get(e._group);void 0===s&&(s=!0),!1!==s&&i.set(e._group,t),k[r.index]=F(r.index,"visible",!1!==r.visible)}else{var c=!1!==r.visible&&t;F(r.index,"visible",c)}}}},{"../../lib":148,"../../registry":232}],85:[function(e,t,r){"use strict";r.isGrouped=function(e){return-1!==(e.traceorder||"").indexOf("grouped")},r.isVertical=function(e){return"h"!==e.orientation},r.isReversed=function(e){return-1!==(e.traceorder||"").indexOf("reversed")}},{}],86:[function(e,t,r){"use strict";t.exports={moduleType:"component",name:"legend",layoutAttributes:e("./attributes"),supplyLayoutDefaults:e("./defaults"),draw:e("./draw"),style:e("./style")}},{"./attributes":79,"./defaults":81,"./draw":82,"./style":87}],87:[function(e,t,r){"use strict";var n=e("d3"),a=e("../../registry"),i=e("../../lib"),o=e("../drawing"),l=e("../color"),s=e("../colorscale/helpers").extractOpts,c=e("../../traces/scatter/subtypes"),u=e("../../traces/pie/style_one"),f=e("../../traces/pie/helpers").castOption,d=12,p=5,h=2,g=10,v=5;function m(e,t){return(t?"radial":"horizontal")+(e?"":"reversed")}t.exports=function(e,t,r){var y=t._fullLayout;r||(r=y.legend);var x="constant"===r.itemsizing,b=function(e,t,r,n){var a;if(e+1)a=e;else{if(!(t&&t.width>0))return 0;a=t.width}return x?n:Math.min(a,r)};function _(e,t,r){var i=e[0].trace,o=i.marker||{},s=o.line||{},c=r?i.visible&&i.type===r:a.traceIs(i,"bar"),u=n.select(t).select("g.legendpoints").selectAll("path.legend"+r).data(c?[e]:[]);u.enter().append("path").classed("legend"+r,!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),u.exit().remove(),u.each(function(e){var t=n.select(this),r=e[0],a=b(r.mlw,o.line,v,h);t.style("stroke-width",a+"px").call(l.fill,r.mc||o.color),a&&l.stroke(t,r.mlc||s.color)})}function w(e,t,r){var o=e[0],l=o.trace,s=r?l.visible&&l.type===r:a.traceIs(l,r),c=n.select(t).select("g.legendpoints").selectAll("path.legend"+r).data(s?[e]:[]);if(c.enter().append("path").classed("legend"+r,!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),c.exit().remove(),c.size()){var d=(l.marker||{}).line,p=b(f(d.width,o.pts),d,v,h),g=i.minExtend(l,{marker:{line:{width:p}}});g.marker.line.color=d.color;var m=i.minExtend(o,{trace:g});u(c,m,g)}}e.each(function(e){var t=n.select(this),a=i.ensureSingle(t,"g","layers");a.style("opacity",e[0].trace.opacity);var o=r.valign,l=e[0].lineHeight,s=e[0].height;if("middle"!==o&&l&&s){var c={top:1,bottom:-1}[o]*(.5*(l-s+3));a.attr("transform","translate(0,"+c+")")}else a.attr("transform",null);a.selectAll("g.legendfill").data([e]).enter().append("g").classed("legendfill",!0),a.selectAll("g.legendlines").data([e]).enter().append("g").classed("legendlines",!0);var u=a.selectAll("g.legendsymbols").data([e]);u.enter().append("g").classed("legendsymbols",!0),u.selectAll("g.legendpoints").data([e]).enter().append("g").classed("legendpoints",!0)}).each(function(e){var r,a=e[0].trace,c=[];if(a.visible)switch(a.type){case"histogram2d":case"heatmap":c=[["M-15,-2V4H15V-2Z"]],r=!0;break;case"choropleth":case"choroplethmapbox":c=[["M-6,-6V6H6V-6Z"]],r=!0;break;case"densitymapbox":c=[["M-6,0 a6,6 0 1,0 12,0 a 6,6 0 1,0 -12,0"]],r="radial";break;case"cone":c=[["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":c=[["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":c=[["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":c=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],r=!1;break;case"volume":c=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],r=!0;break;case"isosurface":c=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6 A12,24 0 0,0 6,-6 L0,6Z"]],r=!1}var u=n.select(this).select("g.legendpoints").selectAll("path.legend3dandfriends").data(c);u.enter().append("path").classed("legend3dandfriends",!0).attr("transform","translate(20,0)").style("stroke-miterlimit",1),u.exit().remove(),u.each(function(e,c){var u,f=n.select(this),d=s(a),p=d.colorscale,h=d.reversescale;if(p){if(!r){var g=p.length;u=0===c?p[h?g-1:0][1]:1===c?p[h?0:g-1][1]:p[Math.floor((g-1)/2)][1]}}else{var v=a.vertexcolor||a.facecolor||a.color;u=i.isArrayOrTypedArray(v)?v[c]||v[0]:v}f.attr("d",e[0]),u?f.call(l.fill,u):f.call(function(e){if(e.size()){var n="legendfill-"+a.uid;o.gradient(e,t,n,m(h,"radial"===r),p,"fill")}})})}).each(function(e){var t=e[0].trace,r="waterfall"===t.type;if(e[0]._distinct&&r){var a=e[0].trace[e[0].dir].marker;return e[0].mc=a.color,e[0].mlw=a.line.width,e[0].mlc=a.line.color,_(e,this,"waterfall")}var i=[];t.visible&&r&&(i=e[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","translate(20,0)").style("stroke-miterlimit",1),o.exit().remove(),o.each(function(e){var r=n.select(this),a=t[e[0]].marker,i=b(void 0,a.line,v,h);r.attr("d",e[1]).style("stroke-width",i+"px").call(l.fill,a.color),i&&r.call(l.stroke,a.line.color)})}).each(function(e){_(e,this,"funnel")}).each(function(e){_(e,this)}).each(function(e){var r=e[0].trace,s=n.select(this).select("g.legendpoints").selectAll("path.legendbox").data(r.visible&&a.traceIs(r,"box-violin")?[e]:[]);s.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),s.exit().remove(),s.each(function(){var e=n.select(this);if("all"!==r.boxpoints&&"all"!==r.points||0!==l.opacity(r.fillcolor)||0!==l.opacity((r.line||{}).color)){var a=b(void 0,r.line,v,h);e.style("stroke-width",a+"px").call(l.fill,r.fillcolor),a&&l.stroke(e,r.line.color)}else{var c=i.minExtend(r,{marker:{size:x?d:i.constrain(r.marker.size,2,16),sizeref:1,sizemin:1,sizemode:"diameter"}});s.call(o.pointStyle,c,t)}})}).each(function(e){w(e,this,"funnelarea")}).each(function(e){w(e,this,"pie")}).each(function(e){var r,a,l=e[0],u=l.trace,f=u.visible&&u.fill&&"none"!==u.fill,d=c.hasLines(u),h=u.contours,v=!1,y=!1,x=s(u),_=x.colorscale,w=x.reversescale;if(h){var k=h.coloring;"lines"===k?v=!0:d="none"===k||"heatmap"===k||h.showlines,"constraint"===h.type?f="="!==h._operation:"fill"!==k&&"heatmap"!==k||(y=!0)}var T=c.hasMarkers(u)||c.hasText(u)||!f&&!y?"M5,0":d||v?"M5,-2":"M5,-3",M=n.select(this),A=M.select(".legendfill").selectAll("path").data(f||y?[e]:[]);if(A.enter().append("path").classed("js-fill",!0),A.exit().remove(),A.attr("d",T+"h30v6h-30z").call(f?o.fillGroupStyle:function(e){if(e.size()){var r="legendfill-"+u.uid;o.gradient(e,t,r,m(w),_,"fill")}}),d||v){var L=b(void 0,u.line,g,p);a=i.minExtend(u,{line:{width:L}}),r=[i.minExtend(l,{trace:a})]}var S=M.select(".legendlines").selectAll("path").data(d||v?[r]:[]);S.enter().append("path").classed("js-line",!0),S.exit().remove(),S.attr("d",T+(v?"l30,0.0001":"h30")).call(d?o.lineGroupStyle:function(e){if(e.size()){var r="legendline-"+u.uid;o.lineGroupStyle(e),o.gradient(e,t,r,m(w),_,"stroke")}})}).each(function(e){var r,a,l=e[0],s=l.trace,u=c.hasMarkers(s),f=c.hasText(s),g=c.hasLines(s);function v(e,t,r,n){var a=i.nestedProperty(s,e).get(),o=i.isArrayOrTypedArray(a)&&t?t(a):a;if(x&&o&&void 0!==n&&(o=n),r){if(o<r[0])return r[0];if(o>r[1])return r[1]}return o}function m(e){return l._distinct&&l.index&&e[l.index]?e[l.index]:e[0]}if(u||f||g){var y={},b={};if(u){y.mc=v("marker.color",m),y.mx=v("marker.symbol",m),y.mo=v("marker.opacity",i.mean,[.2,1]),y.mlc=v("marker.line.color",m),y.mlw=v("marker.line.width",i.mean,[0,5],h),b.marker={sizeref:1,sizemin:1,sizemode:"diameter"};var _=v("marker.size",i.mean,[2,16],d);y.ms=_,b.marker.size=_}g&&(b.line={width:v("line.width",m,[0,10],p)}),f&&(y.tx="Aa",y.tp=v("textposition",m),y.ts=10,y.tc=v("textfont.color",m),y.tf=v("textfont.family",m)),r=[i.minExtend(l,y)],(a=i.minExtend(s,b)).selectedpoints=null,a.texttemplate=null}var w=n.select(this).select("g.legendpoints"),k=w.selectAll("path.scatterpts").data(u?r:[]);k.enter().insert("path",":first-child").classed("scatterpts",!0).attr("transform","translate(20,0)"),k.exit().remove(),k.call(o.pointStyle,a,t),u&&(r[0].mrc=3);var T=w.selectAll("g.pointtext").data(f?r:[]);T.enter().append("g").classed("pointtext",!0).append("text").attr("transform","translate(20,0)"),T.exit().remove(),T.selectAll("text").call(o.textPointStyle,a,t)}).each(function(e){var t=e[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendcandle").data(t.visible&&"candlestick"===t.type?[e,e]:[]);r.enter().append("path").classed("legendcandle",!0).attr("d",function(e,t){return t?"M-15,0H-8M-8,6V-6H8Z":"M15,0H8M8,-6V6H-8Z"}).attr("transform","translate(20,0)").style("stroke-miterlimit",1),r.exit().remove(),r.each(function(e,r){var a=n.select(this),i=t[r?"increasing":"decreasing"],o=b(void 0,i.line,v,h);a.style("stroke-width",o+"px").call(l.fill,i.fillcolor),o&&l.stroke(a,i.line.color)})}).each(function(e){var t=e[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendohlc").data(t.visible&&"ohlc"===t.type?[e,e]:[]);r.enter().append("path").classed("legendohlc",!0).attr("d",function(e,t){return t?"M-15,0H0M-8,-6V0":"M15,0H0M8,6V0"}).attr("transform","translate(20,0)").style("stroke-miterlimit",1),r.exit().remove(),r.each(function(e,r){var a=n.select(this),i=t[r?"increasing":"decreasing"],s=b(void 0,i.line,v,h);a.style("fill","none").call(o.dashLine,i.line.dash,s),s&&l.stroke(a,i.line.color)})})}},{"../../lib":148,"../../registry":232,"../../traces/pie/helpers":241,"../../traces/pie/style_one":242,"../../traces/scatter/subtypes":268,"../color":30,"../colorscale/helpers":41,"../drawing":51,d3:2}],88:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../plots/plots"),i=e("../../plots/cartesian/axis_ids"),o=e("../../lib"),l=e("../../fonts/ploticon"),s=o._,c=t.exports={};function u(e,t){var r,a,o=t.currentTarget,l=o.getAttribute("data-attr"),s=o.getAttribute("data-val")||!0,c=e._fullLayout,u={},f=i.list(e,null,!0),d=c._cartesianSpikesEnabled;if("zoom"===l){var p,h="in"===s?.5:2,g=(1+h)/2,v=(1-h)/2;for(a=0;a<f.length;a++)if(!(r=f[a]).fixedrange)if(p=r._name,"auto"===s)u[p+".autorange"]=!0;else if("reset"===s){if(void 0===r._rangeInitial)u[p+".autorange"]=!0;else{var m=r._rangeInitial.slice();u[p+".range[0]"]=m[0],u[p+".range[1]"]=m[1]}void 0!==r._showSpikeInitial&&(u[p+".showspikes"]=r._showSpikeInitial,"on"!==d||r._showSpikeInitial||(d="off"))}else{var y=[r.r2l(r.range[0]),r.r2l(r.range[1])],x=[g*y[0]+v*y[1],g*y[1]+v*y[0]];u[p+".range[0]"]=r.l2r(x[0]),u[p+".range[1]"]=r.l2r(x[1])}}else"hovermode"!==l||"x"!==s&&"y"!==s||(s=c._isHoriz?"y":"x",o.setAttribute("data-val",s)),u[l]=s;c._cartesianSpikesEnabled=d,n.call("_guiRelayout",e,u)}function f(e,t){for(var r=t.currentTarget,a=r.getAttribute("data-attr"),i=r.getAttribute("data-val")||!0,o=e._fullLayout._subplots.gl3d||[],l={},s=a.split("."),c=0;c<o.length;c++)l[o[c]+"."+s[1]]=i;var u="pan"===i?i:"zoom";l.dragmode=u,n.call("_guiRelayout",e,l)}function d(e,t){for(var r=t.currentTarget.getAttribute("data-attr"),a=e._fullLayout,i=a._subplots.gl3d||[],o={},l=0;l<i.length;l++){var s,c=i[l],u=c+".camera",f=c+".aspectratio",d=c+".aspectmode",p=a[c]._scene;"resetLastSave"===r?(o[u+".up"]=p.viewInitial.up,o[u+".eye"]=p.viewInitial.eye,o[u+".center"]=p.viewInitial.center,s=!0):"resetDefault"===r&&(o[u+".up"]=null,o[u+".eye"]=null,o[u+".center"]=null,s=!0),s&&(o[f+".x"]=p.viewInitial.aspectratio.x,o[f+".y"]=p.viewInitial.aspectratio.y,o[f+".z"]=p.viewInitial.aspectratio.z,o[d]=p.viewInitial.aspectmode)}n.call("_guiRelayout",e,o)}function p(e,t){var r=t.currentTarget,n=r._previousVal,a=e._fullLayout,i=a._subplots.gl3d||[],o=["xaxis","yaxis","zaxis"],l={},s={};if(n)s=n,r._previousVal=null;else{for(var c=0;c<i.length;c++){var u=i[c],f=a[u],d=u+".hovermode";l[d]=f.hovermode,s[d]=!1;for(var p=0;p<3;p++){var h=o[p],g=u+"."+h+".showspikes";s[g]=!1,l[g]=f[h].showspikes}}r._previousVal=l}return s}function h(e,t){for(var r=t.currentTarget,a=r.getAttribute("data-attr"),i=r.getAttribute("data-val")||!0,o=e._fullLayout,l=o._subplots.geo||[],s=0;s<l.length;s++){var c=l[s],u=o[c];if("zoom"===a){var f=u.projection.scale,d="in"===i?2*f:.5*f;n.call("_guiRelayout",e,c+".projection.scale",d)}}"reset"===a&&y(e,"geo")}function g(e){var t=e._fullLayout;return!t.hovermode&&(t._has("cartesian")?t._isHoriz?"y":"x":"closest")}function v(e){var t=g(e);n.call("_guiRelayout",e,"hovermode",t)}function m(e,t){for(var r=t.currentTarget.getAttribute("data-val"),a=e._fullLayout,i=a._subplots.mapbox||[],o={},l=0;l<i.length;l++){var s=i[l],c=a[s].zoom,u="in"===r?1.05*c:c/1.05;o[s+".zoom"]=u}n.call("_guiRelayout",e,o)}function y(e,t){for(var r=e._fullLayout,a=r._subplots[t]||[],i={},o=0;o<a.length;o++)for(var l=a[o],s=r[l]._subplot.viewInitial,c=Object.keys(s),u=0;u<c.length;u++){var f=c[u];i[l+"."+f]=s[f]}n.call("_guiRelayout",e,i)}c.toImage={name:"toImage",title:function(e){var t=(e._context.toImageButtonOptions||{}).format||"png";return s(e,"png"===t?"Download plot as a png":"Download plot")},icon:l.camera,click:function(e){var t=e._context.toImageButtonOptions,r={format:t.format||"png"};o.notifier(s(e,"Taking snapshot - this may take a few seconds"),"long"),"svg"!==r.format&&o.isIE()&&(o.notifier(s(e,"IE only supports svg. Changing format to svg."),"long"),r.format="svg"),["filename","width","height","scale"].forEach(function(e){e in t&&(r[e]=t[e])}),n.call("downloadImage",e,r).then(function(t){o.notifier(s(e,"Snapshot succeeded")+" - "+t,"long")}).catch(function(){o.notifier(s(e,"Sorry, there was a problem downloading your snapshot!"),"long")})}},c.sendDataToCloud={name:"sendDataToCloud",title:function(e){return s(e,"Edit in Chart Studio")},icon:l.disk,click:function(e){a.sendDataToCloud(e)}},c.editInChartStudio={name:"editInChartStudio",title:function(e){return s(e,"Edit in Chart Studio")},icon:l.pencil,click:function(e){a.sendDataToCloud(e)}},c.zoom2d={name:"zoom2d",title:function(e){return s(e,"Zoom")},attr:"dragmode",val:"zoom",icon:l.zoombox,click:u},c.pan2d={name:"pan2d",title:function(e){return s(e,"Pan")},attr:"dragmode",val:"pan",icon:l.pan,click:u},c.select2d={name:"select2d",title:function(e){return s(e,"Box Select")},attr:"dragmode",val:"select",icon:l.selectbox,click:u},c.lasso2d={name:"lasso2d",title:function(e){return s(e,"Lasso Select")},attr:"dragmode",val:"lasso",icon:l.lasso,click:u},c.zoomIn2d={name:"zoomIn2d",title:function(e){return s(e,"Zoom in")},attr:"zoom",val:"in",icon:l.zoom_plus,click:u},c.zoomOut2d={name:"zoomOut2d",title:function(e){return s(e,"Zoom out")},attr:"zoom",val:"out",icon:l.zoom_minus,click:u},c.autoScale2d={name:"autoScale2d",title:function(e){return s(e,"Autoscale")},attr:"zoom",val:"auto",icon:l.autoscale,click:u},c.resetScale2d={name:"resetScale2d",title:function(e){return s(e,"Reset axes")},attr:"zoom",val:"reset",icon:l.home,click:u},c.hoverClosestCartesian={name:"hoverClosestCartesian",title:function(e){return s(e,"Show closest data on hover")},attr:"hovermode",val:"closest",icon:l.tooltip_basic,gravity:"ne",click:u},c.hoverCompareCartesian={name:"hoverCompareCartesian",title:function(e){return s(e,"Compare data on hover")},attr:"hovermode",val:function(e){return e._fullLayout._isHoriz?"y":"x"},icon:l.tooltip_compare,gravity:"ne",click:u},c.zoom3d={name:"zoom3d",title:function(e){return s(e,"Zoom")},attr:"scene.dragmode",val:"zoom",icon:l.zoombox,click:f},c.pan3d={name:"pan3d",title:function(e){return s(e,"Pan")},attr:"scene.dragmode",val:"pan",icon:l.pan,click:f},c.orbitRotation={name:"orbitRotation",title:function(e){return s(e,"Orbital rotation")},attr:"scene.dragmode",val:"orbit",icon:l["3d_rotate"],click:f},c.tableRotation={name:"tableRotation",title:function(e){return s(e,"Turntable rotation")},attr:"scene.dragmode",val:"turntable",icon:l["z-axis"],click:f},c.resetCameraDefault3d={name:"resetCameraDefault3d",title:function(e){return s(e,"Reset camera to default")},attr:"resetDefault",icon:l.home,click:d},c.resetCameraLastSave3d={name:"resetCameraLastSave3d",title:function(e){return s(e,"Reset camera to last save")},attr:"resetLastSave",icon:l.movie,click:d},c.hoverClosest3d={name:"hoverClosest3d",title:function(e){return s(e,"Toggle show closest data on hover")},attr:"hovermode",val:null,toggle:!0,icon:l.tooltip_basic,gravity:"ne",click:function(e,t){var r=p(e,t);n.call("_guiRelayout",e,r)}},c.zoomInGeo={name:"zoomInGeo",title:function(e){return s(e,"Zoom in")},attr:"zoom",val:"in",icon:l.zoom_plus,click:h},c.zoomOutGeo={name:"zoomOutGeo",title:function(e){return s(e,"Zoom out")},attr:"zoom",val:"out",icon:l.zoom_minus,click:h},c.resetGeo={name:"resetGeo",title:function(e){return s(e,"Reset")},attr:"reset",val:null,icon:l.autoscale,click:h},c.hoverClosestGeo={name:"hoverClosestGeo",title:function(e){return s(e,"Toggle show closest data on hover")},attr:"hovermode",val:null,toggle:!0,icon:l.tooltip_basic,gravity:"ne",click:v},c.hoverClosestGl2d={name:"hoverClosestGl2d",title:function(e){return s(e,"Toggle show closest data on hover")},attr:"hovermode",val:null,toggle:!0,icon:l.tooltip_basic,gravity:"ne",click:v},c.hoverClosestPie={name:"hoverClosestPie",title:function(e){return s(e,"Toggle show closest data on hover")},attr:"hovermode",val:"closest",icon:l.tooltip_basic,gravity:"ne",click:v},c.resetViewSankey={name:"resetSankeyGroup",title:function(e){return s(e,"Reset view")},icon:l.home,click:function(e){for(var t={"node.groups":[],"node.x":[],"node.y":[]},r=0;r<e._fullData.length;r++){var a=e._fullData[r]._viewInitial;t["node.groups"].push(a.node.groups.slice()),t["node.x"].push(a.node.x.slice()),t["node.y"].push(a.node.y.slice())}n.call("restyle",e,t)}},c.toggleHover={name:"toggleHover",title:function(e){return s(e,"Toggle show closest data on hover")},attr:"hovermode",val:null,toggle:!0,icon:l.tooltip_basic,gravity:"ne",click:function(e,t){var r=p(e,t);r.hovermode=g(e),n.call("_guiRelayout",e,r)}},c.resetViews={name:"resetViews",title:function(e){return s(e,"Reset views")},icon:l.home,click:function(e,t){var r=t.currentTarget;r.setAttribute("data-attr","zoom"),r.setAttribute("data-val","reset"),u(e,t),r.setAttribute("data-attr","resetLastSave"),d(e,t),y(e,"geo"),y(e,"mapbox")}},c.toggleSpikelines={name:"toggleSpikelines",title:function(e){return s(e,"Toggle Spike Lines")},icon:l.spikeline,attr:"_cartesianSpikesEnabled",val:"on",click:function(e){var t=e._fullLayout,r=t._cartesianSpikesEnabled;t._cartesianSpikesEnabled="on"===r?"off":"on",n.call("_guiRelayout",e,function(e){for(var t="on"===e._fullLayout._cartesianSpikesEnabled,r=i.list(e,null,!0),n={},a=0;a<r.length;a++){var o=r[a];n[o._name+".showspikes"]=!!t||o._showSpikeInitial}return n}(e))}},c.resetViewMapbox={name:"resetViewMapbox",title:function(e){return s(e,"Reset view")},attr:"reset",icon:l.home,click:function(e){y(e,"mapbox")}},c.zoomInMapbox={name:"zoomInMapbox",title:function(e){return s(e,"Zoom in")},attr:"zoom",val:"in",icon:l.zoom_plus,click:m},c.zoomOutMapbox={name:"zoomOutMapbox",title:function(e){return s(e,"Zoom out")},attr:"zoom",val:"out",icon:l.zoom_minus,click:m}},{"../../fonts/ploticon":132,"../../lib":148,"../../plots/cartesian/axis_ids":195,"../../plots/plots":224,"../../registry":232}],89:[function(e,t,r){"use strict";r.manage=e("./manage")},{"./manage":90}],90:[function(e,t,r){"use strict";var n=e("../../plots/cartesian/axis_ids"),a=e("../../traces/scatter/subtypes"),i=e("../../registry"),o=e("../fx/helpers").isUnifiedHover,l=e("./modebar"),s=e("./buttons");t.exports=function(e){var t=e._fullLayout,r=e._context,c=t._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 u,f=r.modeBarButtons;u=Array.isArray(f)&&f.length?function(e){for(var t=0;t<e.length;t++)for(var r=e[t],n=0;n<r.length;n++){var a=r[n];if("string"==typeof a){if(void 0===s[a])throw new Error(["*modeBarButtons* configuration options","invalid button name"].join(" "));e[t][n]=s[a]}}return e}(f):!r.displayModeBar&&r.watermark?[]:function(e){var t=e._fullLayout,r=e._fullData,l=e._context,c=l.modeBarButtonsToRemove,u=l.modeBarButtonsToAdd,f=t._has("cartesian"),d=t._has("gl3d"),p=t._has("geo"),h=t._has("pie"),g=t._has("funnelarea"),v=t._has("gl2d"),m=t._has("ternary"),y=t._has("mapbox"),x=t._has("polar"),b=t._has("sankey"),_=function(e){for(var t=n.list({_fullLayout:e},null,!0),r=0;r<t.length;r++)if(!t[r].fixedrange)return!1;return!0}(t),w=o(t.hovermode),k=[];function T(e){if(e.length){for(var t=[],r=0;r<e.length;r++){var n=e[r];-1===c.indexOf(n)&&t.push(s[n])}k.push(t)}}var M=["toImage"];l.showEditInChartStudio?M.push("editInChartStudio"):l.showSendToCloud&&M.push("sendDataToCloud");T(M);var A=[],L=[],S=[],C=[];(f||v||h||g||m)+p+d+y+x>1?(L=["toggleHover"],S=["resetViews"]):p?(A=["zoomInGeo","zoomOutGeo"],L=["hoverClosestGeo"],S=["resetGeo"]):d?(L=["hoverClosest3d"],S=["resetCameraDefault3d","resetCameraLastSave3d"]):y?(A=["zoomInMapbox","zoomOutMapbox"],L=["toggleHover"],S=["resetViewMapbox"]):v?L=["hoverClosestGl2d"]:h?L=["hoverClosestPie"]:b?(L=["hoverClosestCartesian","hoverCompareCartesian"],S=["resetViewSankey"]):L=["toggleHover"];f&&(L=["toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"]);((function(e){for(var t=0;t<e.length;t++)if(!i.traceIs(e[t],"noHover"))return!1;return!0})(r)||w)&&(L=[]);!f&&!v||_||(A=["zoomIn2d","zoomOut2d","autoScale2d"],"resetViews"!==S[0]&&(S=["resetScale2d"]));d?C=["zoom3d","pan3d","orbitRotation","tableRotation"]:(f||v)&&!_||m?C=["zoom2d","pan2d"]:y||p?C=["pan2d"]:x&&(C=["zoom2d"]);(function(e){for(var t=!1,r=0;r<e.length&&!t;r++){var n=e[r];n._module&&n._module.selectPoints&&(i.traceIs(n,"scatter-like")?(a.hasMarkers(n)||a.hasText(n))&&(t=!0):i.traceIs(n,"box-violin")&&"all"!==n.boxpoints&&"all"!==n.points||(t=!0))}return t})(r)&&C.push("select2d","lasso2d");return T(C),T(A.concat(S)),T(L),function(e,t){if(t.length)if(Array.isArray(t[0]))for(var r=0;r<t.length;r++)e.push(t[r]);else e.push(t);return e}(k,u)}(e),c?c.update(e,u):t._modeBar=l(e,u)}else c&&(c.destroy(),delete t._modeBar)}},{"../../plots/cartesian/axis_ids":195,"../../registry":232,"../../traces/scatter/subtypes":268,"../fx/helpers":65,"./buttons":88,"./modebar":91}],91:[function(e,t,r){"use strict";var n=e("d3"),a=e("fast-isnumeric"),i=e("../../lib"),o=e("../../fonts/ploticon"),l=new DOMParser;function s(e){this.container=e.container,this.element=document.createElement("div"),this.update(e.graphInfo,e.buttons),this.container.appendChild(this.element)}var c=s.prototype;c.update=function(e,t){this.graphInfo=e;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",t=t.reverse());var o=n.modebar,l="hover"===r.displayModeBar?".js-plotly-plot .plotly:hover ":"";i.deleteRelatedStyleRule(a),i.addRelatedStyleRule(a,l+"#"+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 s=!this.hasButtons(t),c=this.hasLogo!==r.displaylogo,u=this.locale!==r.locale;if(this.locale=r.locale,(s||c||u)&&(this.removeAllButtons(),this.updateButtons(t),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()},c.updateButtons=function(e){var t=this;this.buttons=e,this.buttonElements=[],this.buttonsNames=[],this.buttons.forEach(function(e){var r=t.createGroup();e.forEach(function(e){var n=e.name;if(!n)throw new Error("must provide button 'name' in button config");if(-1!==t.buttonsNames.indexOf(n))throw new Error("button name '"+n+"' is taken");t.buttonsNames.push(n);var a=t.createButton(e);t.buttonElements.push(a),r.appendChild(a)}),t.element.appendChild(r)})},c.createGroup=function(){var e=document.createElement("div");return e.className="modebar-group",e},c.createButton=function(e){var t=this,r=document.createElement("a");r.setAttribute("rel","tooltip"),r.className="modebar-btn";var a=e.title;void 0===a?a=e.name:"function"==typeof a&&(a=a(this.graphInfo)),(a||0===a)&&r.setAttribute("data-title",a),void 0!==e.attr&&r.setAttribute("data-attr",e.attr);var i=e.val;if(void 0!==i&&("function"==typeof i&&(i=i(this.graphInfo)),r.setAttribute("data-val",i)),"function"!=typeof e.click)throw new Error("must provide button 'click' function in button config");r.addEventListener("click",function(r){e.click(t.graphInfo,r),t.updateActiveButton(r.currentTarget)}),r.setAttribute("data-toggle",e.toggle||!1),e.toggle&&n.select(r).classed("active",!0);var l=e.icon;return"function"==typeof l?r.appendChild(l()):r.appendChild(this.createIcon(l||o.question)),r.setAttribute("data-gravity",e.gravity||"n"),r},c.createIcon=function(e){var t,r=a(e.height)?Number(e.height):e.ascent-e.descent,n="http://www.w3.org/2000/svg";if(e.path){(t=document.createElementNS(n,"svg")).setAttribute("viewBox",[0,0,e.width,r].join(" ")),t.setAttribute("class","icon");var i=document.createElementNS(n,"path");i.setAttribute("d",e.path),e.transform?i.setAttribute("transform",e.transform):void 0!==e.ascent&&i.setAttribute("transform","matrix(1 0 0 -1 0 "+e.ascent+")"),t.appendChild(i)}e.svg&&(t=l.parseFromString(e.svg,"application/xml").childNodes[0]);return t.setAttribute("height","1em"),t.setAttribute("width","1em"),t},c.updateActiveButton=function(e){var t=this.graphInfo._fullLayout,r=void 0!==e?e.getAttribute("data-attr"):null;this.buttonElements.forEach(function(e){var a=e.getAttribute("data-val")||!0,o=e.getAttribute("data-attr"),l="true"===e.getAttribute("data-toggle"),s=n.select(e);if(l)o===r&&s.classed("active",!s.classed("active"));else{var c=null===o?o:i.nestedProperty(t,o).get();s.classed("active",c===a)}})},c.hasButtons=function(e){var t=this.buttons;if(!t)return!1;if(e.length!==t.length)return!1;for(var r=0;r<e.length;++r){if(e[r].length!==t[r].length)return!1;for(var n=0;n<e[r].length;n++)if(e[r][n].name!==t[r][n].name)return!1}return!0},c.getLogo=function(){var e=this.createGroup(),t=document.createElement("a");return t.href="https://plotly.com/",t.target="_blank",t.setAttribute("data-title",i._(this.graphInfo,"Produced with Plotly")),t.className="modebar-btn plotlyjsicon modebar-btn--logo",t.appendChild(this.createIcon(o.newplotlylogo)),e.appendChild(t),e},c.removeAllButtons=function(){for(;this.element.firstChild;)this.element.removeChild(this.element.firstChild);this.hasLogo=!1},c.destroy=function(){i.removeElement(this.container.querySelector(".modebar")),i.deleteRelatedStyleRule(this._uid)},t.exports=function(e,t){var r=e._fullLayout,a=new s({graphInfo:e,container:r._modebardiv.node(),buttons:t});return r._privateplot&&n.select(a.element).append("span").classed("badge-private float--left",!0).text("PRIVATE"),a}},{"../../fonts/ploticon":132,"../../lib":148,d3:2,"fast-isnumeric":4}],92:[function(e,t,r){"use strict";var n=e("../../plots/font_attributes"),a=e("../color/attributes"),i=(0,e("../../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"});t.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":182,"../../plots/font_attributes":218,"../color/attributes":29}],93:[function(e,t,r){"use strict";t.exports={yPad:.02,minButtonWidth:30,rx:3,ry:3,lightAmount:25,darkAmount:10}},{}],94:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../color"),i=e("../../plot_api/plot_template"),o=e("../../plots/array_container_defaults"),l=e("./attributes"),s=e("./constants");function c(e,t,r,a){var i=a.calendar;function o(r,a){return n.coerce(e,t,l.buttons,r,a)}if(o("visible")){var s=o("step");"all"!==s&&(!i||"gregorian"===i||"month"!==s&&"year"!==s?o("stepmode"):t.stepmode="backward",o("count")),o("label")}}t.exports=function(e,t,r,u,f){var d=e.rangeselector||{},p=i.newContainer(t,"rangeselector");function h(e,t){return n.coerce(d,p,l,e,t)}if(h("visible",o(d,p,{name:"buttons",handleItemDefaults:c,calendar:f}).length>0)){var g=function(e,t,r){for(var n=r.filter(function(r){return t[r].anchor===e._id}),a=0,i=0;i<n.length;i++){var o=t[n[i]].domain;o&&(a=Math.max(o[1],a))}return[e.domain[0],a+s.yPad]}(t,r,u);h("x",g[0]),h("y",g[1]),n.noneOrAll(e,t,["x","y"]),h("xanchor"),h("yanchor"),n.coerceFont(h,"font",r.font);var v=h("bgcolor");h("activecolor",a.contrast(v,s.lightAmount,s.darkAmount)),h("bordercolor"),h("borderwidth")}}},{"../../lib":148,"../../plot_api/plot_template":182,"../../plots/array_container_defaults":188,"../color":30,"./attributes":92,"./constants":93}],95:[function(e,t,r){"use strict";var n=e("d3"),a=e("../../registry"),i=e("../../plots/plots"),o=e("../color"),l=e("../drawing"),s=e("../../lib"),c=e("../../lib/svg_text_utils"),u=e("../../plots/cartesian/axis_ids"),f=e("../../constants/alignment"),d=f.LINE_SPACING,p=f.FROM_TL,h=f.FROM_BR,g=e("./constants"),v=e("./get_update_object");function m(e){return e._id}function y(e,t,r){var n=s.ensureSingle(e,"rect","selector-rect",function(e){e.attr("shape-rendering","crispEdges")});n.attr({rx:g.rx,ry:g.ry}),n.call(o.stroke,t.bordercolor).call(o.fill,function(e,t){return t._isActive||t._isHovered?e.activecolor:e.bgcolor}(t,r)).style("stroke-width",t.borderwidth+"px")}function x(e,t,r,n){s.ensureSingle(e,"text","selector-text",function(e){e.classed("user-select-none",!0).attr("text-anchor","middle")}).call(l.font,t.font).text(function(e,t){if(e.label)return t?s.templateString(e.label,t):e.label;return"all"===e.step?"all":e.count+e.step.charAt(0)}(r,n._fullLayout._meta)).call(function(e){c.convertToTspans(e,n)})}t.exports=function(e){var t=e._fullLayout._infolayer.selectAll(".rangeselector").data(function(e){for(var t=u.list(e,"x",!0),r=[],n=0;n<t.length;n++){var a=t[n];a.rangeselector&&a.rangeselector.visible&&r.push(a)}return r}(e),m);t.enter().append("g").classed("rangeselector",!0),t.exit().remove(),t.style({cursor:"pointer","pointer-events":"all"}),t.each(function(t){var r=n.select(this),o=t,u=o.rangeselector,f=r.selectAll("g.button").data(s.filterVisible(u.buttons));f.enter().append("g").classed("button",!0),f.exit().remove(),f.each(function(t){var r=n.select(this),i=v(o,t);t._isActive=function(e,t,r){if("all"===t.step)return!0===e.autorange;var n=Object.keys(r);return e.range[0]===r[n[0]]&&e.range[1]===r[n[1]]}(o,t,i),r.call(y,u,t),r.call(x,u,t,e),r.on("click",function(){e._dragged||a.call("_guiRelayout",e,i)}),r.on("mouseover",function(){t._isHovered=!0,r.call(y,u,t)}),r.on("mouseout",function(){t._isHovered=!1,r.call(y,u,t)})}),function(e,t,r,a,o){var u=0,f=0,v=r.borderwidth;t.each(function(){var e=n.select(this),t=e.select(".selector-text"),a=r.font.size*d,i=Math.max(a*c.lineCount(t),16)+3;f=Math.max(f,i)}),t.each(function(){var e=n.select(this),t=e.select(".selector-rect"),a=e.select(".selector-text"),i=a.node()&&l.bBox(a.node()).width,o=r.font.size*d,s=c.lineCount(a),p=Math.max(i+10,g.minButtonWidth);e.attr("transform","translate("+(v+u)+","+v+")"),t.attr({x:0,y:0,width:p,height:f}),c.positionText(a,p/2,f/2-(s-1)*o/2+3),u+=p+5});var m=e._fullLayout._size,y=m.l+m.w*r.x,x=m.t+m.h*(1-r.y),b="left";s.isRightAnchor(r)&&(y-=u,b="right");s.isCenterAnchor(r)&&(y-=u/2,b="center");var _="top";s.isBottomAnchor(r)&&(x-=f,_="bottom");s.isMiddleAnchor(r)&&(x-=f/2,_="middle");u=Math.ceil(u),f=Math.ceil(f),y=Math.round(y),x=Math.round(x),i.autoMargin(e,a+"-range-selector",{x:r.x,y:r.y,l:u*p[b],r:u*h[b],b:f*h[_],t:f*p[_]}),o.attr("transform","translate("+y+","+x+")")}(e,f,u,o._name,r)})}},{"../../constants/alignment":125,"../../lib":148,"../../lib/svg_text_utils":169,"../../plots/cartesian/axis_ids":195,"../../plots/plots":224,"../../registry":232,"../color":30,"../drawing":51,"./constants":93,"./get_update_object":96,d3:2}],96:[function(e,t,r){"use strict";var n=e("d3");t.exports=function(e,t){var r=e._name,a={};if("all"===t.step)a[r+".autorange"]=!0;else{var i=function(e,t){var r,a=e.range,i=new Date(e.r2l(a[1])),o=t.step,l=t.count;switch(t.stepmode){case"backward":r=e.l2r(+n.time[o].utc.offset(i,-l));break;case"todate":var s=n.time[o].utc.offset(i,-l);r=e.l2r(+n.time[o].utc.ceil(s))}var c=a[1];return[r,c]}(e,t);a[r+".range[0]"]=i[0],a[r+".range[1]"]=i[1]}return a}},{d3:2}],97:[function(e,t,r){"use strict";t.exports={moduleType:"component",name:"rangeselector",schema:{subplots:{xaxis:{rangeselector:e("./attributes")}}},layoutAttributes:e("./attributes"),handleDefaults:e("./defaults"),draw:e("./draw")}},{"./attributes":92,"./defaults":94,"./draw":95}],98:[function(e,t,r){"use strict";var n=e("../color/attributes");t.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":29}],99:[function(e,t,r){"use strict";var n=e("../../plots/cartesian/axis_ids").list,a=e("../../plots/cartesian/autorange").getAutoRange,i=e("./constants");t.exports=function(e){for(var t=n(e,"x",!0),r=0;r<t.length;r++){var o=t[r],l=o[i.name];l&&l.visible&&l.autorange&&(l._input.autorange=!0,l._input.range=l.range=a(e,o))}}},{"../../plots/cartesian/autorange":191,"../../plots/cartesian/axis_ids":195,"./constants":100}],100:[function(e,t,r){"use strict";t.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}},{}],101:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plot_api/plot_template"),i=e("../../plots/cartesian/axis_ids"),o=e("./attributes"),l=e("./oppaxis_attributes");t.exports=function(e,t,r){var s=e[r],c=t[r];if(s.rangeslider||t._requestRangeslider[c._id]){n.isPlainObject(s.rangeslider)||(s.rangeslider={});var u,f,d=s.rangeslider,p=a.newContainer(c,"rangeslider");if(_("visible")){_("bgcolor",t.plot_bgcolor),_("bordercolor"),_("borderwidth"),_("thickness"),_("autorange",!c.isValidRange(d.range)),_("range");var h=t._subplots;if(h)for(var g=h.cartesian.filter(function(e){return e.substr(0,e.indexOf("y"))===i.name2id(r)}).map(function(e){return e.substr(e.indexOf("y"),e.length)}),v=n.simpleMap(g,i.id2name),m=0;m<v.length;m++){var y=v[m];u=d[y]||{},f=a.newContainer(p,y,"yaxis");var x,b=t[y];u.range&&b.isValidRange(u.range)&&(x="fixed"),"match"!==w("rangemode",x)&&w("range",b.range.slice())}p._input=d}}function _(e,t){return n.coerce(d,p,o,e,t)}function w(e,t){return n.coerce(u,f,l,e,t)}}},{"../../lib":148,"../../plot_api/plot_template":182,"../../plots/cartesian/axis_ids":195,"./attributes":98,"./oppaxis_attributes":105}],102:[function(e,t,r){"use strict";var n=e("d3"),a=e("../../registry"),i=e("../../plots/plots"),o=e("../../lib"),l=e("../drawing"),s=e("../color"),c=e("../titles"),u=e("../../plots/cartesian"),f=e("../../plots/cartesian/axis_ids"),d=e("../dragelement"),p=e("../../lib/setcursor"),h=e("./constants");function g(e,t,r,n){var a=o.ensureSingle(e,"rect",h.bgClassName,function(e){e.attr({x:0,y:0,"shape-rendering":"crispEdges"})}),i=n.borderwidth%2==0?n.borderwidth:n.borderwidth-1,s=-n._offsetShift,c=l.crispRound(t,n.borderwidth);a.attr({width:n._width+i,height:n._height+i,transform:"translate("+s+","+s+")",fill:n.bgcolor,stroke:n.bordercolor,"stroke-width":c})}function v(e,t,r,n){var a=t._fullLayout;o.ensureSingleById(a._topdefs,"clipPath",n._clipId,function(e){e.append("rect").attr({x:0,y:0})}).select("rect").attr({width:n._width,height:n._height})}function m(e,t,r,a){var s,c=t.calcdata,d=e.selectAll("g."+h.rangePlotClassName).data(r._subplotsWith,o.identity);d.enter().append("g").attr("class",function(e){return h.rangePlotClassName+" "+e}).call(l.setClipUrl,a._clipId,t),d.order(),d.exit().remove(),d.each(function(e,o){var l=n.select(this),d=0===o,p=f.getFromId(t,e,"y"),h=p._name,g=a[h],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:t._context};r.rangebreaks&&(v.layout.xaxis.rangebreaks=r.rangebreaks),v.layout[h]={type:p.type,domain:[0,1],range:"match"!==g.rangemode?g.range.slice():p.range.slice(),calendar:p.calendar},p.rangebreaks&&(v.layout[h].rangebreaks=p.rangebreaks),i.supplyDefaults(v);var m=v._fullLayout.xaxis,y=v._fullLayout[h];m.clearCalc(),m.setScale(),y.clearCalc(),y.setScale();var x={id:e,plotgroup:l,xaxis:m,yaxis:y,isRangePlot:!0};d?s=x:(x.mainplot="xy",x.mainplotinfo=s),u.rangePlot(t,x,function(e,t){for(var r=[],n=0;n<e.length;n++){var a=e[n],i=a[0].trace;i.xaxis+i.yaxis===t&&r.push(a)}return r}(c,e))})}function y(e,t,r,n,a){(o.ensureSingle(e,"rect",h.maskMinClassName,function(e){e.attr({x:0,y:0,"shape-rendering":"crispEdges"})}).attr("height",n._height).call(s.fill,h.maskColor),o.ensureSingle(e,"rect",h.maskMaxClassName,function(e){e.attr({y:0,"shape-rendering":"crispEdges"})}).attr("height",n._height).call(s.fill,h.maskColor),"match"!==a.rangemode)&&(o.ensureSingle(e,"rect",h.maskMinOppAxisClassName,function(e){e.attr({y:0,"shape-rendering":"crispEdges"})}).attr("width",n._width).call(s.fill,h.maskOppAxisColor),o.ensureSingle(e,"rect",h.maskMaxOppAxisClassName,function(e){e.attr({y:0,"shape-rendering":"crispEdges"})}).attr("width",n._width).style("border-top",h.maskOppBorder).call(s.fill,h.maskOppAxisColor))}function x(e,t,r,n){t._context.staticPlot||o.ensureSingle(e,"rect",h.slideBoxClassName,function(e){e.attr({y:0,cursor:h.slideBoxCursor,"shape-rendering":"crispEdges"})}).attr({height:n._height,fill:h.slideBoxFill})}function b(e,t,r,n){var a=o.ensureSingle(e,"g",h.grabberMinClassName),i=o.ensureSingle(e,"g",h.grabberMaxClassName),l={x:0,width:h.handleWidth,rx:h.handleRadius,fill:s.background,stroke:s.defaultLine,"stroke-width":h.handleStrokeWidth,"shape-rendering":"crispEdges"},c={y:Math.round(n._height/4),height:Math.round(n._height/2)};if(o.ensureSingle(a,"rect",h.handleMinClassName,function(e){e.attr(l)}).attr(c),o.ensureSingle(i,"rect",h.handleMaxClassName,function(e){e.attr(l)}).attr(c),!t._context.staticPlot){var u={width:h.grabAreaWidth,x:0,y:0,fill:h.grabAreaFill,cursor:h.grabAreaCursor};o.ensureSingle(a,"rect",h.grabAreaMinClassName,function(e){e.attr(u)}).attr("height",n._height),o.ensureSingle(i,"rect",h.grabAreaMaxClassName,function(e){e.attr(u)}).attr("height",n._height)}}t.exports=function(e){for(var t=e._fullLayout,r=t._rangeSliderData,i=0;i<r.length;i++){var l=r[i][h.name];l._clipId=l._id+"-"+t._uid}var s=t._infolayer.selectAll("g."+h.containerClassName).data(r,function(e){return e._name});s.exit().each(function(e){var r=e[h.name];t._topdefs.select("#"+r._clipId).remove()}).remove(),0!==r.length&&(s.enter().append("g").classed(h.containerClassName,!0).attr("pointer-events","all"),s.each(function(r){var i=n.select(this),l=r[h.name],s=t[f.id2name(r.anchor)],u=l[f.id2name(r.anchor)];if(l.range){var _,w=o.simpleMap(l.range,r.r2l),k=o.simpleMap(r.range,r.r2l);_=k[0]<k[1]?[Math.min(w[0],k[0]),Math.max(w[1],k[1])]:[Math.max(w[0],k[0]),Math.min(w[1],k[1])],l.range=l._input.range=o.simpleMap(_,r.l2r)}r.cleanRange("rangeslider.range");var T=t._size,M=r.domain;l._width=T.w*(M[1]-M[0]);var A=Math.round(T.l+T.w*M[0]),L=Math.round(T.t+T.h*(1-r._counterDomainMin)+("bottom"===r.side?r._depth:0)+l._offsetShift+h.extraPad);i.attr("transform","translate("+A+","+L+")"),l._rl=o.simpleMap(l.range,r.r2l);var S=l._rl[0],C=l._rl[1],O=C-S;if(l.p2d=function(e){return e/l._width*O+S},l.d2p=function(e){return(e-S)/O*l._width},r.rangebreaks){var P=r.locateBreaks(S,C);if(P.length){var D,z,R=0;for(D=0;D<P.length;D++)R+=(z=P[D]).max-z.min;var E=l._width/(C-S-R),I=[-E*S];for(D=0;D<P.length;D++)z=P[D],I.push(I[I.length-1]-E*(z.max-z.min));for(l.d2p=function(e){for(var t=I[0],r=0;r<P.length;r++){var n=P[r];if(e>=n.max)t=I[r+1];else if(e<n.min)break}return t+E*e},D=0;D<P.length;D++)(z=P[D]).pmin=l.d2p(z.min),z.pmax=l.d2p(z.max);l.p2d=function(e){for(var t=I[0],r=0;r<P.length;r++){var n=P[r];if(e>=n.pmax)t=I[r+1];else if(e<n.pmin)break}return(e-t)/E}}}if("match"!==u.rangemode){var F=s.r2l(u.range[0]),N=s.r2l(u.range[1])-F;l.d2pOppAxis=function(e){return(e-F)/N*l._height}}i.call(g,e,r,l).call(v,e,r,l).call(m,e,r,l).call(y,e,r,l,u).call(x,e,r,l).call(b,e,r,l),function(e,t,r,i){var l=e.select("rect."+h.slideBoxClassName).node(),s=e.select("rect."+h.grabAreaMinClassName).node(),c=e.select("rect."+h.grabAreaMaxClassName).node();e.on("mousedown",function(){var u=n.event,f=u.target,h=u.clientX,g=h-e.node().getBoundingClientRect().left,v=i.d2p(r._rl[0]),m=i.d2p(r._rl[1]),y=d.coverSlip();function x(e){var u,d,x,b=+e.clientX-h;switch(f){case l:x="ew-resize",u=v+b,d=m+b;break;case s:x="col-resize",u=v+b,d=m;break;case c:x="col-resize",u=v,d=m+b;break;default:x="ew-resize",u=g,d=g+b}if(d<u){var _=d;d=u,u=_}i._pixelMin=u,i._pixelMax=d,p(n.select(y),x),function(e,t,r,n){function i(e){return r.l2r(o.constrain(e,n._rl[0],n._rl[1]))}var l=i(n.p2d(n._pixelMin)),s=i(n.p2d(n._pixelMax));window.requestAnimationFrame(function(){a.call("_guiRelayout",t,r._name+".range",[l,s])})}(0,t,r,i)}y.addEventListener("mousemove",x),y.addEventListener("mouseup",function e(){y.removeEventListener("mousemove",x);y.removeEventListener("mouseup",e);o.removeElement(y)})})}(i,e,r,l),function(e,t,r,n,a,i){var l=h.handleWidth/2;function s(e){return o.constrain(e,0,n._width)}function c(e){return o.constrain(e,0,n._height)}function u(e){return o.constrain(e,-l,n._width+l)}var f=s(n.d2p(r._rl[0])),d=s(n.d2p(r._rl[1]));if(e.select("rect."+h.slideBoxClassName).attr("x",f).attr("width",d-f),e.select("rect."+h.maskMinClassName).attr("width",f),e.select("rect."+h.maskMaxClassName).attr("x",d).attr("width",n._width-d),"match"!==i.rangemode){var p=n._height-c(n.d2pOppAxis(a._rl[1])),g=n._height-c(n.d2pOppAxis(a._rl[0]));e.select("rect."+h.maskMinOppAxisClassName).attr("x",f).attr("height",p).attr("width",d-f),e.select("rect."+h.maskMaxOppAxisClassName).attr("x",f).attr("y",g).attr("height",n._height-g).attr("width",d-f),e.select("rect."+h.slideBoxClassName).attr("y",p).attr("height",g-p)}var v=Math.round(u(f-l))-.5,m=Math.round(u(d-l))+.5;e.select("g."+h.grabberMinClassName).attr("transform","translate("+v+",0.5)"),e.select("g."+h.grabberMaxClassName).attr("transform","translate("+m+",0.5)")}(i,0,r,l,s,u),"bottom"===r.side&&c.draw(e,r._id+"title",{propContainer:r,propName:r._name+".title",placeholder:t._dfltTitle.x,attributes:{x:r._offset+r._length/2,y:L+l._height+l._offsetShift+10+1.5*r.title.font.size,"text-anchor":"middle"}})}))}},{"../../lib":148,"../../lib/setcursor":167,"../../plots/cartesian":203,"../../plots/cartesian/axis_ids":195,"../../plots/plots":224,"../../registry":232,"../color":30,"../dragelement":48,"../drawing":51,"../titles":118,"./constants":100,d3:2}],103:[function(e,t,r){"use strict";var n=e("../../plots/cartesian/axis_ids"),a=e("../../lib/svg_text_utils"),i=e("./constants"),o=e("../../constants/alignment").LINE_SPACING,l=i.name;function s(e){var t=e&&e[l];return t&&t.visible}r.isVisible=s,r.makeData=function(e){var t=n.list({_fullLayout:e},"x",!0),r=e.margin,a=[];if(!e._has("gl2d"))for(var i=0;i<t.length;i++){var o=t[i];if(s(o)){a.push(o);var c=o[l];c._id=l+o._id,c._height=(e.height-r.b-r.t)*c.thickness,c._offsetShift=Math.floor(c.borderwidth/2)}}e._rangeSliderData=a},r.autoMarginOpts=function(e,t){var r=e._fullLayout,n=t[l],s=t._id.charAt(0),c=0,u=0;"bottom"===t.side&&(c=t._depth,t.title.text!==r._dfltTitle[s]&&(u=1.5*t.title.font.size+10+n._offsetShift,u+=(t.title.text.match(a.BR_TAG_ALL)||[]).length*t.title.font.size*o));return{x:0,y:t._counterDomainMin,l:0,r:0,t:0,b:n._height+c+Math.max(r.margin.b,u),pad:i.extraPad+2*n._offsetShift}}},{"../../constants/alignment":125,"../../lib/svg_text_utils":169,"../../plots/cartesian/axis_ids":195,"./constants":100}],104:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./attributes"),i=e("./oppaxis_attributes"),o=e("./helpers");t.exports={moduleType:"component",name:"rangeslider",schema:{subplots:{xaxis:{rangeslider:n.extendFlat({},a,{yaxis:i})}}},layoutAttributes:e("./attributes"),handleDefaults:e("./defaults"),calcAutorange:e("./calc_autorange"),draw:e("./draw"),isVisible:o.isVisible,makeData:o.makeData,autoMarginOpts:o.autoMarginOpts}},{"../../lib":148,"./attributes":98,"./calc_autorange":99,"./defaults":101,"./draw":102,"./helpers":103,"./oppaxis_attributes":105}],105:[function(e,t,r){"use strict";t.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"}},{}],106:[function(e,t,r){"use strict";var n=e("../annotations/attributes"),a=e("../../traces/scatter/attributes").line,i=e("../drawing/attributes").dash,o=e("../../lib/extend").extendFlat,l=e("../../plot_api/plot_template").templatedArray;t.exports=l("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"},editType:"arraydraw"})},{"../../lib/extend":143,"../../plot_api/plot_template":182,"../../traces/scatter/attributes":244,"../annotations/attributes":15,"../drawing/attributes":50}],107:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/cartesian/axes"),i=e("./constants"),o=e("./helpers");function l(e){return c(e.line.width,e.xsizemode,e.x0,e.x1,e.path,!1)}function s(e){return c(e.line.width,e.ysizemode,e.y0,e.y1,e.path,!0)}function c(e,t,r,a,l,s){var c=e/2,u=s;if("pixel"===t){var f=l?o.extractPathCoords(l,s?i.paramIsY:i.paramIsX):[r,a],d=n.aggNums(Math.max,null,f),p=n.aggNums(Math.min,null,f),h=p<0?Math.abs(p)+c:c,g=d>0?d+c:c;return{ppad:c,ppadplus:u?h:g,ppadminus:u?g:h}}return{ppad:c}}function u(e,t,r,n,a){var l="category"===e.type||"multicategory"===e.type?e.r2c:e.d2c;if(void 0!==t)return[l(t),l(r)];if(n){var s,c,u,f,d=1/0,p=-1/0,h=n.match(i.segmentRE);for("date"===e.type&&(l=o.decodeDate(l)),s=0;s<h.length;s++)void 0!==(c=a[h[s].charAt(0)].drawn)&&(!(u=h[s].substr(1).match(i.paramRE))||u.length<c||((f=l(u[c]))<d&&(d=f),f>p&&(p=f)));return p>=d?[d,p]:void 0}}t.exports=function(e){var t=e._fullLayout,r=n.filterVisible(t.shapes);if(r.length&&e._fullData.length)for(var o=0;o<r.length;o++){var c,f,d=r[o];if(d._extremes={},"paper"!==d.xref){var p="pixel"===d.xsizemode?d.xanchor:d.x0,h="pixel"===d.xsizemode?d.xanchor:d.x1;(f=u(c=a.getFromId(e,d.xref),p,h,d.path,i.paramIsX))&&(d._extremes[c._id]=a.findExtremes(c,f,l(d)))}if("paper"!==d.yref){var g="pixel"===d.ysizemode?d.yanchor:d.y0,v="pixel"===d.ysizemode?d.yanchor:d.y1;(f=u(c=a.getFromId(e,d.yref),g,v,d.path,i.paramIsY))&&(d._extremes[c._id]=a.findExtremes(c,f,s(d)))}}}},{"../../lib":148,"../../plots/cartesian/axes":192,"./constants":108,"./helpers":111}],108:[function(e,t,r){"use strict";t.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}}},{}],109:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/cartesian/axes"),i=e("../../plots/array_container_defaults"),o=e("./attributes"),l=e("./helpers");function s(e,t,r){function i(r,a){return n.coerce(e,t,o,r,a)}if(i("visible")){i("layer"),i("opacity"),i("fillcolor"),i("line.color"),i("line.width"),i("line.dash");for(var s=i("type",e.path?"path":"rect"),c=i("xsizemode"),u=i("ysizemode"),f=["x","y"],d=0;d<2;d++){var p,h,g,v=f[d],m=v+"anchor",y="x"===v?c:u,x={_fullLayout:r},b=a.coerceRef(e,t,x,v,"","paper");if("paper"!==b?((p=a.getFromId(x,b))._shapeIndices.push(t._index),g=l.rangeToShapePosition(p),h=l.shapePositionToRange(p)):h=g=n.identity,"path"!==s){var _=v+"0",w=v+"1",k=e[_],T=e[w];e[_]=h(e[_],!0),e[w]=h(e[w],!0),"pixel"===y?(i(_,0),i(w,10)):(a.coercePosition(t,x,i,b,_,.25),a.coercePosition(t,x,i,b,w,.75)),t[_]=g(t[_]),t[w]=g(t[w]),e[_]=k,e[w]=T}if("pixel"===y){var M=e[m];e[m]=h(e[m],!0),a.coercePosition(t,x,i,b,m,.25),t[m]=g(t[m]),e[m]=M}}"path"===s?i("path"):n.noneOrAll(e,t,["x0","x1","y0","y1"])}}t.exports=function(e,t){i(e,t,{name:"shapes",handleItemDefaults:s})}},{"../../lib":148,"../../plots/array_container_defaults":188,"../../plots/cartesian/axes":192,"./attributes":106,"./helpers":111}],110:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../lib"),i=e("../../plots/cartesian/axes"),o=e("../color"),l=e("../drawing"),s=e("../../plot_api/plot_template").arrayEditor,c=e("../dragelement"),u=e("../../lib/setcursor"),f=e("./constants"),d=e("./helpers");function p(e,t){e._fullLayout._paperdiv.selectAll('.shapelayer [data-index="'+t+'"]').remove();var r=e._fullLayout.shapes[t]||{};if(r._input&&!1!==r.visible)if("below"!==r.layer)m(e._fullLayout._shapeUpperLayer);else if("paper"===r.xref||"paper"===r.yref)m(e._fullLayout._shapeLowerLayer);else{var p=e._fullLayout._plots[r.xref+r.yref];if(p)m((p.mainplotinfo||p).shapelayer);else m(e._fullLayout._shapeLowerLayer)}function m(p){var m={"data-index":t,"fill-rule":"evenodd",d:g(e,r)},y=r.line.width?r.line.color:"rgba(0,0,0,0)",x=p.append("path").attr(m).style("opacity",r.opacity).call(o.stroke,y).call(o.fill,r.fillcolor).call(l.dashLine,r.line.dash,r.line.width);h(x,e,r),e._context.edits.shapePosition&&function(e,t,r,o,p){var m,y,x,b,_,w,k,T,M,A,L,S,C,O,P,D,z=10,R=10,E="pixel"===r.xsizemode,I="pixel"===r.ysizemode,F="line"===r.type,N="path"===r.type,j=s(e.layout,"shapes",r),B=j.modifyItem,H=i.getFromId(e,r.xref),q=i.getFromId(e,r.yref),V=d.getDataToPixel(e,H),U=d.getDataToPixel(e,q,!0),G=d.getPixelToData(e,H),Z=d.getPixelToData(e,q,!0),Y=F?function(){var e=Math.max(r.line.width,10),n=p.append("g").attr("data-index",o);n.append("path").attr("d",t.attr("d")).style({cursor:"move","stroke-width":e,"stroke-opacity":"0"});var a={"fill-opacity":"0"},i=e/2>10?e/2:10;return n.append("circle").attr({"data-line-point":"start-point",cx:E?V(r.xanchor)+r.x0:V(r.x0),cy:I?U(r.yanchor)-r.y0:U(r.y0),r:i}).style(a).classed("cursor-grab",!0),n.append("circle").attr({"data-line-point":"end-point",cx:E?V(r.xanchor)+r.x1:V(r.x1),cy:I?U(r.yanchor)-r.y1:U(r.y1),r:i}).style(a).classed("cursor-grab",!0),n}():t,X={element:Y.node(),gd:e,prepFn:function(n){E&&(_=V(r.xanchor));I&&(w=U(r.yanchor));"path"===r.type?P=r.path:(m=E?r.x0:V(r.x0),y=I?r.y0:U(r.y0),x=E?r.x1:V(r.x1),b=I?r.y1:U(r.y1));m<x?(M=m,C="x0",A=x,O="x1"):(M=x,C="x1",A=m,O="x0");!I&&y<b||I&&y>b?(k=y,L="y0",T=b,S="y1"):(k=b,L="y1",T=y,S="y0");W(n),Q(p,r),function(e,t,r){var n=t.xref,a=t.yref,o=i.getFromId(r,n),s=i.getFromId(r,a),c="";"paper"===n||o.autorange||(c+=n);"paper"===a||s.autorange||(c+=a);l.setClipUrl(e,c?"clip"+r._fullLayout._uid+c:null,r)}(t,r,e),X.moveFn="move"===D?$:J},doneFn:function(){u(t),K(p),h(t,e,r),n.call("_guiRelayout",e,j.getUpdateObj())},clickFn:function(){K(p)}};function W(e){if(F)D="path"===e.target.tagName?"move":"start-point"===e.target.attributes["data-line-point"].value?"resize-over-start-point":"resize-over-end-point";else{var r=X.element.getBoundingClientRect(),n=r.right-r.left,a=r.bottom-r.top,i=e.clientX-r.left,o=e.clientY-r.top,l=!N&&n>z&&a>R&&!e.shiftKey?c.getCursor(i/n,1-o/a):"move";u(t,l),D=l.split("-")[0]}}function $(n,a){if("path"===r.type){var i=function(e){return e},o=i,l=i;E?B("xanchor",r.xanchor=G(_+n)):(o=function(e){return G(V(e)+n)},H&&"date"===H.type&&(o=d.encodeDate(o))),I?B("yanchor",r.yanchor=Z(w+a)):(l=function(e){return Z(U(e)+a)},q&&"date"===q.type&&(l=d.encodeDate(l))),B("path",r.path=v(P,o,l))}else E?B("xanchor",r.xanchor=G(_+n)):(B("x0",r.x0=G(m+n)),B("x1",r.x1=G(x+n))),I?B("yanchor",r.yanchor=Z(w+a)):(B("y0",r.y0=Z(y+a)),B("y1",r.y1=Z(b+a)));t.attr("d",g(e,r)),Q(p,r)}function J(n,a){if(N){var i=function(e){return e},o=i,l=i;E?B("xanchor",r.xanchor=G(_+n)):(o=function(e){return G(V(e)+n)},H&&"date"===H.type&&(o=d.encodeDate(o))),I?B("yanchor",r.yanchor=Z(w+a)):(l=function(e){return Z(U(e)+a)},q&&"date"===q.type&&(l=d.encodeDate(l))),B("path",r.path=v(P,o,l))}else if(F){if("resize-over-start-point"===D){var s=m+n,c=I?y-a:y+a;B("x0",r.x0=E?s:G(s)),B("y0",r.y0=I?c:Z(c))}else if("resize-over-end-point"===D){var u=x+n,f=I?b-a:b+a;B("x1",r.x1=E?u:G(u)),B("y1",r.y1=I?f:Z(f))}}else{var h=~D.indexOf("n")?k+a:k,j=~D.indexOf("s")?T+a:T,Y=~D.indexOf("w")?M+n:M,X=~D.indexOf("e")?A+n:A;~D.indexOf("n")&&I&&(h=k-a),~D.indexOf("s")&&I&&(j=T-a),(!I&&j-h>R||I&&h-j>R)&&(B(L,r[L]=I?h:Z(h)),B(S,r[S]=I?j:Z(j))),X-Y>z&&(B(C,r[C]=E?Y:G(Y)),B(O,r[O]=E?X:G(X)))}t.attr("d",g(e,r)),Q(p,r)}function Q(e,t){(E||I)&&function(){var r="path"!==t.type,n=e.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=V(E?t.xanchor:a.midRange(r?[t.x0,t.x1]:d.extractPathCoords(t.path,f.paramIsX))),o=U(I?t.yanchor:a.midRange(r?[t.y0,t.y1]:d.extractPathCoords(t.path,f.paramIsY)));if(i=d.roundPositionForSharpStrokeRendering(i,1),o=d.roundPositionForSharpStrokeRendering(o,1),E&&I){var l="M"+(i-1-1)+","+(o-1-1)+"h-8v2h8 v8h2v-8 h8v-2h-8 v-8h-2 Z";n.attr("d",l)}else if(E){var s="M"+(i-1-1)+","+(o-9-1)+"v18 h2 v-18 Z";n.attr("d",s)}else{var c="M"+(i-9-1)+","+(o-1-1)+"h18 v2 h-18 Z";n.attr("d",c)}}()}function K(e){e.selectAll(".visual-cue").remove()}c.init(X),Y.node().onmousemove=W}(e,x,r,t,p)}}function h(e,t,r){var n=(r.xref+r.yref).replace(/paper/g,"");l.setClipUrl(e,n?"clip"+t._fullLayout._uid+n:null,t)}function g(e,t){var r,n,o,l,s,c,u,p,h=t.type,g=i.getFromId(e,t.xref),v=i.getFromId(e,t.yref),m=e._fullLayout._size;if(g?(r=d.shapePositionToRange(g),n=function(e){return g._offset+g.r2p(r(e,!0))}):n=function(e){return m.l+m.w*e},v?(o=d.shapePositionToRange(v),l=function(e){return v._offset+v.r2p(o(e,!0))}):l=function(e){return m.t+m.h*(1-e)},"path"===h)return g&&"date"===g.type&&(n=d.decodeDate(n)),v&&"date"===v.type&&(l=d.decodeDate(l)),function(e,t,r){var n=e.path,i=e.xsizemode,o=e.ysizemode,l=e.xanchor,s=e.yanchor;return n.replace(f.segmentRE,function(e){var n=0,c=e.charAt(0),u=f.paramIsX[c],d=f.paramIsY[c],p=f.numParams[c],h=e.substr(1).replace(f.paramRE,function(e){return u[n]?e="pixel"===i?t(l)+Number(e):t(e):d[n]&&(e="pixel"===o?r(s)-Number(e):r(e)),++n>p&&(e="X"),e});return n>p&&(h=h.replace(/[\s,]*X.*/,""),a.log("Ignoring extra params in segment "+e)),c+h})}(t,n,l);if("pixel"===t.xsizemode){var y=n(t.xanchor);s=y+t.x0,c=y+t.x1}else s=n(t.x0),c=n(t.x1);if("pixel"===t.ysizemode){var x=l(t.yanchor);u=x-t.y0,p=x-t.y1}else u=l(t.y0),p=l(t.y1);if("line"===h)return"M"+s+","+u+"L"+c+","+p;if("rect"===h)return"M"+s+","+u+"H"+c+"V"+p+"H"+s+"Z";var b=(s+c)/2,_=(u+p)/2,w=Math.abs(b-s),k=Math.abs(_-u),T="A"+w+","+k,M=b+w+","+_;return"M"+M+T+" 0 1,1 "+(b+","+(_-k))+T+" 0 0,1 "+M+"Z"}function v(e,t,r){return e.replace(f.segmentRE,function(e){var n=0,a=e.charAt(0),i=f.paramIsX[a],o=f.paramIsY[a],l=f.numParams[a];return a+e.substr(1).replace(f.paramRE,function(e){return n>=l?e:(i[n]?e=t(e):o[n]&&(e=r(e)),n++,e)})})}t.exports={draw:function(e){var t=e._fullLayout;for(var r in t._shapeUpperLayer.selectAll("path").remove(),t._shapeLowerLayer.selectAll("path").remove(),t._plots){var n=t._plots[r].shapelayer;n&&n.selectAll("path").remove()}for(var a=0;a<t.shapes.length;a++)t.shapes[a].visible&&p(e,a)},drawOne:p}},{"../../lib":148,"../../lib/setcursor":167,"../../plot_api/plot_template":182,"../../plots/cartesian/axes":192,"../../registry":232,"../color":30,"../dragelement":48,"../drawing":51,"./constants":108,"./helpers":111}],111:[function(e,t,r){"use strict";var n=e("./constants"),a=e("../../lib");r.rangeToShapePosition=function(e){return"log"===e.type?e.r2d:function(e){return e}},r.shapePositionToRange=function(e){return"log"===e.type?e.d2r:function(e){return e}},r.decodeDate=function(e){return function(t){return t.replace&&(t=t.replace("_"," ")),e(t)}},r.encodeDate=function(e){return function(t){return e(t).replace(" ","_")}},r.extractPathCoords=function(e,t){var r=[];return e.match(n.segmentRE).forEach(function(e){var i=t[e.charAt(0)].drawn;if(void 0!==i){var o=e.substr(1).match(n.paramRE);!o||o.length<i||r.push(a.cleanNumber(o[i]))}}),r},r.getDataToPixel=function(e,t,n){var a,i=e._fullLayout._size;if(t){var o=r.shapePositionToRange(t);a=function(e){return t._offset+t.r2p(o(e,!0))},"date"===t.type&&(a=r.decodeDate(a))}else a=n?function(e){return i.t+i.h*(1-e)}:function(e){return i.l+i.w*e};return a},r.getPixelToData=function(e,t,n){var a,i=e._fullLayout._size;if(t){var o=r.rangeToShapePosition(t);a=function(e){return o(t.p2r(e-t._offset))}}else a=n?function(e){return 1-(e-i.t)/i.h}:function(e){return(e-i.l)/i.w};return a},r.roundPositionForSharpStrokeRendering=function(e,t){var r=1===Math.round(t%2),n=Math.round(e);return r?n+.5:n}},{"../../lib":148,"./constants":108}],112:[function(e,t,r){"use strict";var n=e("./draw");t.exports={moduleType:"component",name:"shapes",layoutAttributes:e("./attributes"),supplyLayoutDefaults:e("./defaults"),includeBasePlot:e("../../plots/cartesian/include_components")("shapes"),calcAutorange:e("./calc_autorange"),draw:n.draw,drawOne:n.drawOne}},{"../../plots/cartesian/include_components":202,"./attributes":106,"./calc_autorange":107,"./defaults":109,"./draw":110}],113:[function(e,t,r){"use strict";var n=e("../../plots/font_attributes"),a=e("../../plots/pad_attributes"),i=e("../../lib/extend").extendDeepAll,o=e("../../plot_api/edit_types").overrideAll,l=e("../../plots/animation_attributes"),s=e("../../plot_api/plot_template").templatedArray,c=e("./constants"),u=s("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}});t.exports=o(s("slider",{visible:{valType:"boolean",dflt:!0},active:{valType:"number",min:0,dflt:0},steps:u,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:l.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:c.gripBgActiveColor},bgcolor:{valType:"color",dflt:c.railBgColor},bordercolor:{valType:"color",dflt:c.railBorderColor},borderwidth:{valType:"number",min:0,dflt:c.railBorderWidth},ticklen:{valType:"number",min:0,dflt:c.tickLength},tickcolor:{valType:"color",dflt:c.tickColor},tickwidth:{valType:"number",min:0,dflt:1},minorticklen:{valType:"number",min:0,dflt:c.minorTickLength}}),"arraydraw","from-root")},{"../../lib/extend":143,"../../plot_api/edit_types":175,"../../plot_api/plot_template":182,"../../plots/animation_attributes":187,"../../plots/font_attributes":218,"../../plots/pad_attributes":223,"./constants":114}],114:[function(e,t,r){"use strict";t.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}},{}],115:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/array_container_defaults"),i=e("./attributes"),o=e("./constants").name,l=i.steps;function s(e,t,r){function o(r,a){return n.coerce(e,t,i,r,a)}for(var l=a(e,t,{name:"steps",handleItemDefaults:c}),s=0,u=0;u<l.length;u++)l[u].visible&&s++;if(s<2?t.visible=!1:o("visible")){t._stepCount=s;var f=t._visibleSteps=n.filterVisible(l);(l[o("active")]||{}).visible||(t.active=f[0]._index),o("x"),o("y"),n.noneOrAll(e,t,["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",t.font)),o("transition.duration"),o("transition.easing"),o("bgcolor"),o("activebgcolor"),o("bordercolor"),o("borderwidth"),o("ticklen"),o("tickwidth"),o("tickcolor"),o("minorticklen")}}function c(e,t){function r(r,a){return n.coerce(e,t,l,r,a)}("skip"===e.method||Array.isArray(e.args)?r("visible"):t.visible=!1)&&(r("method"),r("args"),r("value",r("label","step-"+t._index)),r("execute"))}t.exports=function(e,t){a(e,t,{name:o,handleItemDefaults:s})}},{"../../lib":148,"../../plots/array_container_defaults":188,"./attributes":113,"./constants":114}],116:[function(e,t,r){"use strict";var n=e("d3"),a=e("../../plots/plots"),i=e("../color"),o=e("../drawing"),l=e("../../lib"),s=e("../../lib/svg_text_utils"),c=e("../../plot_api/plot_template").arrayEditor,u=e("./constants"),f=e("../../constants/alignment"),d=f.LINE_SPACING,p=f.FROM_TL,h=f.FROM_BR;function g(e){return u.autoMarginIdRoot+e._index}function v(e){return e._index}function m(e,t){var r=o.tester.selectAll("g."+u.labelGroupClass).data(t._visibleSteps);r.enter().append("g").classed(u.labelGroupClass,!0);var i=0,c=0;r.each(function(e){var r=b(n.select(this),{step:e},t).node();if(r){var a=o.bBox(r);c=Math.max(c,a.height),i=Math.max(i,a.width)}}),r.remove();var f=t._dims={};f.inputAreaWidth=Math.max(u.railWidth,u.gripHeight);var d=e._fullLayout._size;f.lx=d.l+d.w*t.x,f.ly=d.t+d.h*(1-t.y),"fraction"===t.lenmode?f.outerLength=Math.round(d.w*t.len):f.outerLength=t.len,f.inputAreaStart=0,f.inputAreaLength=Math.round(f.outerLength-t.pad.l-t.pad.r);var v=(f.inputAreaLength-2*u.stepInset)/(t._stepCount-1),m=i+u.labelPadding;if(f.labelStride=Math.max(1,Math.ceil(m/v)),f.labelHeight=c,f.currentValueMaxWidth=0,f.currentValueHeight=0,f.currentValueTotalHeight=0,f.currentValueMaxLines=1,t.currentvalue.visible){var x=o.tester.append("g");r.each(function(e){var r=y(x,t,e.label),n=r.node()&&o.bBox(r.node())||{width:0,height:0},a=s.lineCount(r);f.currentValueMaxWidth=Math.max(f.currentValueMaxWidth,Math.ceil(n.width)),f.currentValueHeight=Math.max(f.currentValueHeight,Math.ceil(n.height)),f.currentValueMaxLines=Math.max(f.currentValueMaxLines,a)}),f.currentValueTotalHeight=f.currentValueHeight+t.currentvalue.offset,x.remove()}f.height=f.currentValueTotalHeight+u.tickOffset+t.ticklen+u.labelOffset+f.labelHeight+t.pad.t+t.pad.b;var _="left";l.isRightAnchor(t)&&(f.lx-=f.outerLength,_="right"),l.isCenterAnchor(t)&&(f.lx-=f.outerLength/2,_="center");var w="top";l.isBottomAnchor(t)&&(f.ly-=f.height,w="bottom"),l.isMiddleAnchor(t)&&(f.ly-=f.height/2,w="middle"),f.outerLength=Math.ceil(f.outerLength),f.height=Math.ceil(f.height),f.lx=Math.round(f.lx),f.ly=Math.round(f.ly);var k={y:t.y,b:f.height*h[w],t:f.height*p[w]};"fraction"===t.lenmode?(k.l=0,k.xl=t.x-t.len*p[_],k.r=0,k.xr=t.x+t.len*h[_]):(k.x=t.x,k.l=f.outerLength*p[_],k.r=f.outerLength*h[_]),a.autoMargin(e,g(t),k)}function y(e,t,r){if(t.currentvalue.visible){var n,a,i=t._dims;switch(t.currentvalue.xanchor){case"right":n=i.inputAreaLength-u.currentValueInset-i.currentValueMaxWidth,a="left";break;case"center":n=.5*i.inputAreaLength,a="middle";break;default:n=u.currentValueInset,a="left"}var c=l.ensureSingle(e,"text",u.labelClass,function(e){e.classed("user-select-none",!0).attr({"text-anchor":a,"data-notex":1})}),f=t.currentvalue.prefix?t.currentvalue.prefix:"";if("string"==typeof r)f+=r;else{var p=t.steps[t.active].label,h=t._gd._fullLayout._meta;h&&(p=l.templateString(p,h)),f+=p}t.currentvalue.suffix&&(f+=t.currentvalue.suffix),c.call(o.font,t.currentvalue.font).text(f).call(s.convertToTspans,t._gd);var g=s.lineCount(c),v=(i.currentValueMaxLines+1-g)*t.currentvalue.font.size*d;return s.positionText(c,n,v),c}}function x(e,t,r){l.ensureSingle(e,"rect",u.gripRectClass,function(n){n.call(T,t,e,r).style("pointer-events","all")}).attr({width:u.gripWidth,height:u.gripHeight,rx:u.gripRadius,ry:u.gripRadius}).call(i.stroke,r.bordercolor).call(i.fill,r.bgcolor).style("stroke-width",r.borderwidth+"px")}function b(e,t,r){var n=l.ensureSingle(e,"text",u.labelClass,function(e){e.classed("user-select-none",!0).attr({"text-anchor":"middle","data-notex":1})}),a=t.step.label,i=r._gd._fullLayout._meta;return i&&(a=l.templateString(a,i)),n.call(o.font,r.font).text(a).call(s.convertToTspans,r._gd),n}function _(e,t){var r=l.ensureSingle(e,"g",u.labelsClass),a=t._dims,i=r.selectAll("g."+u.labelGroupClass).data(a.labelSteps);i.enter().append("g").classed(u.labelGroupClass,!0),i.exit().remove(),i.each(function(e){var r=n.select(this);r.call(b,e,t),o.setTranslate(r,L(t,e.fraction),u.tickOffset+t.ticklen+t.font.size*d+u.labelOffset+a.currentValueTotalHeight)})}function w(e,t,r,n,a){var i=Math.round(n*(r._stepCount-1)),o=r._visibleSteps[i]._index;o!==r.active&&k(e,t,r,o,!0,a)}function k(e,t,r,n,i,o){var l=r.active;r.active=n,c(e.layout,u.name,r).applyUpdate("active",n);var s=r.steps[r.active];t.call(A,r,o),t.call(y,r),e.emit("plotly_sliderchange",{slider:r,step:r.steps[r.active],interaction:i,previousActive:l}),s&&s.method&&i&&(t._nextMethod?(t._nextMethod.step=s,t._nextMethod.doCallback=i,t._nextMethod.doTransition=o):(t._nextMethod={step:s,doCallback:i,doTransition:o},t._nextMethodRaf=window.requestAnimationFrame(function(){var r=t._nextMethod.step;r.method&&(r.execute&&a.executeAPICommand(e,r.method,r.args),t._nextMethod=null,t._nextMethodRaf=null)})))}function T(e,t,r){var a=r.node(),o=n.select(t);function l(){return r.data()[0]}e.on("mousedown",function(){var e=l();t.emit("plotly_sliderstart",{slider:e});var s=r.select("."+u.gripRectClass);n.event.stopPropagation(),n.event.preventDefault(),s.call(i.fill,e.activebgcolor);var c=S(e,n.mouse(a)[0]);w(t,r,e,c,!0),e._dragging=!0,o.on("mousemove",function(){var e=l(),i=S(e,n.mouse(a)[0]);w(t,r,e,i,!1)}),o.on("mouseup",function(){var e=l();e._dragging=!1,s.call(i.fill,e.bgcolor),o.on("mouseup",null),o.on("mousemove",null),t.emit("plotly_sliderend",{slider:e,step:e.steps[e.active]})})})}function M(e,t){var r=e.selectAll("rect."+u.tickRectClass).data(t._visibleSteps),a=t._dims;r.enter().append("rect").classed(u.tickRectClass,!0),r.exit().remove(),r.attr({width:t.tickwidth+"px","shape-rendering":"crispEdges"}),r.each(function(e,r){var l=r%a.labelStride==0,s=n.select(this);s.attr({height:l?t.ticklen:t.minorticklen}).call(i.fill,t.tickcolor),o.setTranslate(s,L(t,r/(t._stepCount-1))-.5*t.tickwidth,(l?u.tickOffset:u.minorTickOffset)+a.currentValueTotalHeight)})}function A(e,t,r){for(var n=e.select("rect."+u.gripRectClass),a=0,i=0;i<t._stepCount;i++)if(t._visibleSteps[i]._index===t.active){a=i;break}var o=L(t,a/(t._stepCount-1));if(!t._invokingCommand){var l=n;r&&t.transition.duration>0&&(l=l.transition().duration(t.transition.duration).ease(t.transition.easing)),l.attr("transform","translate("+(o-.5*u.gripWidth)+","+t._dims.currentValueTotalHeight+")")}}function L(e,t){var r=e._dims;return r.inputAreaStart+u.stepInset+(r.inputAreaLength-2*u.stepInset)*Math.min(1,Math.max(0,t))}function S(e,t){var r=e._dims;return Math.min(1,Math.max(0,(t-u.stepInset-r.inputAreaStart)/(r.inputAreaLength-2*u.stepInset-2*r.inputAreaStart)))}function C(e,t,r){var n=r._dims,a=l.ensureSingle(e,"rect",u.railTouchRectClass,function(n){n.call(T,t,e,r).style("pointer-events","all")});a.attr({width:n.inputAreaLength,height:Math.max(n.inputAreaWidth,u.tickOffset+r.ticklen+n.labelHeight)}).call(i.fill,r.bgcolor).attr("opacity",0),o.setTranslate(a,0,n.currentValueTotalHeight)}function O(e,t){var r=t._dims,n=r.inputAreaLength-2*u.railInset,a=l.ensureSingle(e,"rect",u.railRectClass);a.attr({width:n,height:u.railWidth,rx:u.railRadius,ry:u.railRadius,"shape-rendering":"crispEdges"}).call(i.stroke,t.bordercolor).call(i.fill,t.bgcolor).style("stroke-width",t.borderwidth+"px"),o.setTranslate(a,u.railInset,.5*(r.inputAreaWidth-u.railWidth)+r.currentValueTotalHeight)}t.exports=function(e){var t=e._fullLayout,r=function(e,t){for(var r=e[u.name],n=[],a=0;a<r.length;a++){var i=r[a];i.visible&&(i._gd=t,n.push(i))}return n}(t,e),i=t._infolayer.selectAll("g."+u.containerClassName).data(r.length>0?[0]:[]);function l(t){t._commandObserver&&(t._commandObserver.remove(),delete t._commandObserver),a.autoMargin(e,g(t))}if(i.enter().append("g").classed(u.containerClassName,!0).style("cursor","ew-resize"),i.exit().each(function(){n.select(this).selectAll("g."+u.groupClassName).each(l)}).remove(),0!==r.length){var s=i.selectAll("g."+u.groupClassName).data(r,v);s.enter().append("g").classed(u.groupClassName,!0),s.exit().each(l).remove();for(var c=0;c<r.length;c++){var f=r[c];m(e,f)}s.each(function(t){var r=n.select(this);!function(e){var t=e._dims;t.labelSteps=[];for(var r=e._stepCount,n=0;n<r;n+=t.labelStride)t.labelSteps.push({fraction:n/(r-1),step:e._visibleSteps[n]})}(t),a.manageCommandObserver(e,t,t._visibleSteps,function(t){var n=r.data()[0];n.active!==t.index&&(n._dragging||k(e,r,n,t.index,!1,!0))}),function(e,t,r){(r.steps[r.active]||{}).visible||(r.active=r._visibleSteps[0]._index);t.call(y,r).call(O,r).call(_,r).call(M,r).call(C,e,r).call(x,e,r);var n=r._dims;o.setTranslate(t,n.lx+r.pad.l,n.ly+r.pad.t),t.call(A,r,!1),t.call(y,r)}(e,n.select(this),t)})}}},{"../../constants/alignment":125,"../../lib":148,"../../lib/svg_text_utils":169,"../../plot_api/plot_template":182,"../../plots/plots":224,"../color":30,"../drawing":51,"./constants":114,d3:2}],117:[function(e,t,r){"use strict";var n=e("./constants");t.exports={moduleType:"component",name:n.name,layoutAttributes:e("./attributes"),supplyLayoutDefaults:e("./defaults"),draw:e("./draw")}},{"./attributes":113,"./constants":114,"./defaults":115,"./draw":116}],118:[function(e,t,r){"use strict";var n=e("d3"),a=e("fast-isnumeric"),i=e("../../plots/plots"),o=e("../../registry"),l=e("../../lib"),s=e("../drawing"),c=e("../color"),u=e("../../lib/svg_text_utils"),f=e("../../constants/interactions"),d=e("../../constants/alignment").OPPOSITE_SIDE,p=/ [XY][0-9]* /;t.exports={draw:function(e,t,r){var h,g=r.propContainer,v=r.propName,m=r.placeholder,y=r.traceIndex,x=r.avoid||{},b=r.attributes,_=r.transform,w=r.containerGroup,k=e._fullLayout,T=1,M=!1,A=g.title,L=(A&&A.text?A.text:"").trim(),S=A&&A.font?A.font:{},C=S.family,O=S.size,P=S.color;"title.text"===v?h="titleText":-1!==v.indexOf("axis")?h="axisTitleText":v.indexOf(!0)&&(h="colorbarTitleText");var D=e._context.edits[h];""===L?T=0:L.replace(p," % ")===m.replace(p," % ")&&(T=.2,M=!0,D||(L="")),r._meta?L=l.templateString(L,r._meta):k._meta&&(L=l.templateString(L,k._meta));var z=L||D;w||(w=l.ensureSingle(k._infolayer,"g","g-"+t));var R=w.selectAll("text").data(z?[0]:[]);if(R.enter().append("text"),R.text(L).attr("class",t),R.exit().remove(),!z)return w;function E(e){l.syncOrAsync([I,F],e)}function I(t){var r;return _?(r="",_.rotate&&(r+="rotate("+[_.rotate,b.x,b.y]+")"),_.offset&&(r+="translate(0, "+_.offset+")")):r=null,t.attr("transform",r),t.style({"font-family":C,"font-size":n.round(O,2)+"px",fill:c.rgb(P),opacity:T*c.opacity(P),"font-weight":i.fontWeight}).attr(b).call(u.convertToTspans,e),i.previousPromises(e)}function F(e){var t=n.select(e.node().parentNode);if(x&&x.selection&&x.side&&L){t.attr("transform",null);var r=d[x.side],i="left"===x.side||"top"===x.side?-1:1,o=a(x.pad)?x.pad:2,c=s.bBox(t.node()),u={left:0,top:0,right:k.width,bottom:k.height},f=x.maxShift||i*(u[x.side]-c[x.side]),p=0;if(f<0)p=f;else{var h=x.offsetLeft||0,g=x.offsetTop||0;c.left-=h,c.right-=h,c.top-=g,c.bottom-=g,x.selection.each(function(){var e=s.bBox(this);l.bBoxIntersect(c,e,o)&&(p=Math.max(p,i*(e[x.side]-c[r])+o))}),p=Math.min(f,p)}if(p>0||f<0){var v={left:[-p,0],right:[p,0],top:[0,-p],bottom:[0,p]}[x.side];t.attr("transform","translate("+v+")")}}}return R.call(E),D&&(L?R.on(".opacity",null):(T=0,M=!0,R.text(m).on("mouseover.opacity",function(){n.select(this).transition().duration(f.SHOW_PLACEHOLDER).style("opacity",1)}).on("mouseout.opacity",function(){n.select(this).transition().duration(f.HIDE_PLACEHOLDER).style("opacity",0)})),R.call(u.makeEditable,{gd:e}).on("edit",function(t){void 0!==y?o.call("_guiRestyle",e,v,t,y):o.call("_guiRelayout",e,v,t)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(E)}).on("input",function(e){this.text(e||" ").call(u.positionText,b.x,b.y)})),R.classed("js-placeholder",M),w}}},{"../../constants/alignment":125,"../../constants/interactions":127,"../../lib":148,"../../lib/svg_text_utils":169,"../../plots/plots":224,"../../registry":232,"../color":30,"../drawing":51,d3:2,"fast-isnumeric":4}],119:[function(e,t,r){"use strict";var n=e("../../plots/font_attributes"),a=e("../color/attributes"),i=e("../../lib/extend").extendFlat,o=e("../../plot_api/edit_types").overrideAll,l=e("../../plots/pad_attributes"),s=e("../../plot_api/plot_template").templatedArray,c=s("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}});t.exports=o(s("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:c,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(l({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":143,"../../plot_api/edit_types":175,"../../plot_api/plot_template":182,"../../plots/font_attributes":218,"../../plots/pad_attributes":223,"../color/attributes":29}],120:[function(e,t,r){"use strict";t.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:"◄",right:"►",up:"▲",down:"▼"}}},{}],121:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/array_container_defaults"),i=e("./attributes"),o=e("./constants").name,l=i.buttons;function s(e,t,r){function o(r,a){return n.coerce(e,t,i,r,a)}o("visible",a(e,t,{name:"buttons",handleItemDefaults:c}).length>0)&&(o("active"),o("direction"),o("type"),o("showactive"),o("x"),o("y"),n.noneOrAll(e,t,["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 c(e,t){function r(r,a){return n.coerce(e,t,l,r,a)}r("visible","skip"===e.method||Array.isArray(e.args))&&(r("method"),r("args"),r("args2"),r("label"),r("execute"))}t.exports=function(e,t){a(e,t,{name:o,handleItemDefaults:s})}},{"../../lib":148,"../../plots/array_container_defaults":188,"./attributes":119,"./constants":120}],122:[function(e,t,r){"use strict";var n=e("d3"),a=e("../../plots/plots"),i=e("../color"),o=e("../drawing"),l=e("../../lib"),s=e("../../lib/svg_text_utils"),c=e("../../plot_api/plot_template").arrayEditor,u=e("../../constants/alignment").LINE_SPACING,f=e("./constants"),d=e("./scrollbox");function p(e){return e._index}function h(e,t){return+e.attr(f.menuIndexAttrName)===t._index}function g(e,t,r,n,a,i,o,l){t.active=o,c(e.layout,f.name,t).applyUpdate("active",o),"buttons"===t.type?m(e,n,null,null,t):"dropdown"===t.type&&(a.attr(f.menuIndexAttrName,"-1"),v(e,n,a,i,t),l||m(e,n,a,i,t))}function v(e,t,r,n,a){var i=l.ensureSingle(t,"g",f.headerClassName,function(e){e.style("pointer-events","all")}),s=a._dims,c=a.active,u=a.buttons[c]||f.blankHeaderOpts,d={y:a.pad.t,yPad:0,x:a.pad.l,xPad:0,index:0},p={width:s.headerWidth,height:s.headerHeight};i.call(y,a,u,e).call(A,a,d,p),l.ensureSingle(t,"text",f.headerArrowClassName,function(e){e.classed("user-select-none",!0).attr("text-anchor","end").call(o.font,a.font).text(f.arrowSymbol[a.direction])}).attr({x:s.headerWidth-f.arrowOffsetX+a.pad.l,y:s.headerHeight/2+f.textOffsetY+a.pad.t}),i.on("click",function(){r.call(L,String(h(r,a)?-1:a._index)),m(e,t,r,n,a)}),i.on("mouseover",function(){i.call(w)}),i.on("mouseout",function(){i.call(k,a)}),o.setTranslate(t,s.lx,s.ly)}function m(e,t,r,i,o){r||(r=t).attr("pointer-events","all");var s=function(e){return-1==+e.attr(f.menuIndexAttrName)}(r)&&"buttons"!==o.type?[]:o.buttons,c="dropdown"===o.type?f.dropdownButtonClassName:f.buttonClassName,u=r.selectAll("g."+c).data(l.filterVisible(s)),d=u.enter().append("g").classed(c,!0),p=u.exit();"dropdown"===o.type?(d.attr("opacity","0").transition().attr("opacity","1"),p.transition().attr("opacity","0").remove()):p.remove();var h=0,v=0,m=o._dims,x=-1!==["up","down"].indexOf(o.direction);"dropdown"===o.type&&(x?v=m.headerHeight+f.gapButtonHeader:h=m.headerWidth+f.gapButtonHeader),"dropdown"===o.type&&"up"===o.direction&&(v=-f.gapButtonHeader+f.gapButton-m.openHeight),"dropdown"===o.type&&"left"===o.direction&&(h=-f.gapButtonHeader+f.gapButton-m.openWidth);var b={x:m.lx+h+o.pad.l,y:m.ly+v+o.pad.t,yPad:f.gapButton,xPad:f.gapButton,index:0},T={l:b.x+o.borderwidth,t:b.y+o.borderwidth};u.each(function(l,s){var c=n.select(this);c.call(y,o,l,e).call(A,o,b),c.on("click",function(){n.event.defaultPrevented||(l.execute&&(l.args2&&o.active===s?(g(e,o,0,t,r,i,-1),a.executeAPICommand(e,l.method,l.args2)):(g(e,o,0,t,r,i,s),a.executeAPICommand(e,l.method,l.args))),e.emit("plotly_buttonclicked",{menu:o,button:l,active:o.active}))}),c.on("mouseover",function(){c.call(w)}),c.on("mouseout",function(){c.call(k,o),u.call(_,o)})}),u.call(_,o),x?(T.w=Math.max(m.openWidth,m.headerWidth),T.h=b.y-T.t):(T.w=b.x-T.l,T.h=Math.max(m.openHeight,m.headerHeight)),T.direction=o.direction,i&&(u.size()?function(e,t,r,n,a,i){var o,l,s,c=a.direction,u="up"===c||"down"===c,d=a._dims,p=a.active;if(u)for(l=0,s=0;s<p;s++)l+=d.heights[s]+f.gapButton;else for(o=0,s=0;s<p;s++)o+=d.widths[s]+f.gapButton;n.enable(i,o,l),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(e){var t=!!e.hbar,r=!!e.vbar;t&&e.hbar.transition().attr("opacity","0").each("end",function(){t=!1,r||e.disable()});r&&e.vbar.transition().attr("opacity","0").each("end",function(){r=!1,t||e.disable()})}(i))}function y(e,t,r,n){e.call(x,t).call(b,t,r,n)}function x(e,t){l.ensureSingle(e,"rect",f.itemRectClassName,function(e){e.attr({rx:f.rx,ry:f.ry,"shape-rendering":"crispEdges"})}).call(i.stroke,t.bordercolor).call(i.fill,t.bgcolor).style("stroke-width",t.borderwidth+"px")}function b(e,t,r,n){var a=l.ensureSingle(e,"text",f.itemTextClassName,function(e){e.classed("user-select-none",!0).attr({"text-anchor":"start","data-notex":1})}),i=r.label,c=n._fullLayout._meta;c&&(i=l.templateString(i,c)),a.call(o.font,t.font).text(i).call(s.convertToTspans,n)}function _(e,t){var r=t.active;e.each(function(e,a){var o=n.select(this);a===r&&t.showactive&&o.select("rect."+f.itemRectClassName).call(i.fill,f.activeColor)})}function w(e){e.select("rect."+f.itemRectClassName).call(i.fill,f.hoverColor)}function k(e,t){e.select("rect."+f.itemRectClassName).call(i.fill,t.bgcolor)}function T(e,t){var r=t._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(l.filterVisible(t.buttons));i.enter().append("g").classed(f.dropdownButtonClassName,!0);var c=-1!==["up","down"].indexOf(t.direction);i.each(function(a,i){var l=n.select(this);l.call(y,t,a,e);var d=l.select("."+f.itemTextClassName),p=d.node()&&o.bBox(d.node()).width,h=Math.max(p+f.textPadX,f.minWidth),g=t.font.size*u,v=s.lineCount(d),m=Math.max(g*v,f.minHeight)+f.textOffsetY;m=Math.ceil(m),h=Math.ceil(h),r.widths[i]=h,r.heights[i]=m,r.height1=Math.max(r.height1,m),r.width1=Math.max(r.width1,h),c?(r.totalWidth=Math.max(r.totalWidth,h),r.openWidth=r.totalWidth,r.totalHeight+=m+f.gapButton,r.openHeight+=m+f.gapButton):(r.totalWidth+=h+f.gapButton,r.openWidth+=h+f.gapButton,r.totalHeight=Math.max(r.totalHeight,m),r.openHeight=r.totalHeight)}),c?r.totalHeight-=f.gapButton:r.totalWidth-=f.gapButton,r.headerWidth=r.width1+f.arrowPadX,r.headerHeight=r.height1,"dropdown"===t.type&&(c?(r.width1+=f.arrowPadX,r.totalHeight=r.height1):r.totalWidth=r.width1,r.totalWidth+=f.arrowPadX),i.remove();var d=r.totalWidth+t.pad.l+t.pad.r,p=r.totalHeight+t.pad.t+t.pad.b,h=e._fullLayout._size;r.lx=h.l+h.w*t.x,r.ly=h.t+h.h*(1-t.y);var g="left";l.isRightAnchor(t)&&(r.lx-=d,g="right"),l.isCenterAnchor(t)&&(r.lx-=d/2,g="center");var v="top";l.isBottomAnchor(t)&&(r.ly-=p,v="bottom"),l.isMiddleAnchor(t)&&(r.ly-=p/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(e,M(t),{x:t.x,y:t.y,l:d*({right:1,center:.5}[g]||0),r:d*({left:1,center:.5}[g]||0),b:p*({top:1,middle:.5}[v]||0),t:p*({bottom:1,middle:.5}[v]||0)})}function M(e){return f.autoMarginIdRoot+e._index}function A(e,t,r,n){n=n||{};var a=e.select("."+f.itemRectClassName),i=e.select("."+f.itemTextClassName),l=t.borderwidth,c=r.index,d=t._dims;o.setTranslate(e,l+r.x,l+r.y);var p=-1!==["up","down"].indexOf(t.direction),h=n.height||(p?d.heights[c]:d.height1);a.attr({x:0,y:0,width:n.width||(p?d.width1:d.widths[c]),height:h});var g=t.font.size*u,v=(s.lineCount(i)-1)*g/2;s.positionText(i,f.textOffsetX,h/2-v+f.textOffsetY),p?r.y+=d.heights[c]+r.yPad:r.x+=d.widths[c]+r.xPad,r.index++}function L(e,t){e.attr(f.menuIndexAttrName,t||"-1").selectAll("g."+f.dropdownButtonClassName).remove()}t.exports=function(e){var t=e._fullLayout,r=l.filterVisible(t[f.name]);function i(t){a.autoMargin(e,M(t))}var o=t._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 s=o.selectAll("g."+f.headerGroupClassName).data(r,p);s.enter().append("g").classed(f.headerGroupClassName,!0);for(var c=l.ensureSingle(o,"g",f.dropdownButtonGroupClassName,function(e){e.style("pointer-events","all")}),u=0;u<r.length;u++){var y=r[u];T(e,y)}var x="updatemenus"+t._uid,b=new d(e,c,x);s.enter().size()&&(c.node().parentNode.appendChild(c.node()),c.call(L)),s.exit().each(function(e){c.call(L),i(e)}).remove(),s.each(function(t){var r=n.select(this),i="dropdown"===t.type?c:null;a.manageCommandObserver(e,t,t.buttons,function(n){g(e,t,t.buttons[n.index],r,i,b,n.index,!0)}),"dropdown"===t.type?(v(e,r,c,b,t),h(c,t)&&m(e,r,c,b,t)):m(e,r,null,null,t)})}}},{"../../constants/alignment":125,"../../lib":148,"../../lib/svg_text_utils":169,"../../plot_api/plot_template":182,"../../plots/plots":224,"../color":30,"../drawing":51,"./constants":120,"./scrollbox":124,d3:2}],123:[function(e,t,r){arguments[4][117][0].apply(r,arguments)},{"./attributes":119,"./constants":120,"./defaults":121,"./draw":122,dup:117}],124:[function(e,t,r){"use strict";t.exports=l;var n=e("d3"),a=e("../color"),i=e("../drawing"),o=e("../../lib");function l(e,t,r){this.gd=e,this.container=t,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})}l.barWidth=2,l.barLength=20,l.barRadius=2,l.barPad=1,l.barColor="#808BA4",l.prototype.enable=function(e,t,r){var o=this.gd._fullLayout,s=o.width,c=o.height;this.position=e;var u,f,d,p,h=this.position.l,g=this.position.w,v=this.position.t,m=this.position.h,y=this.position.direction,x="down"===y,b="left"===y,_="up"===y,w=g,k=m;x||b||"right"===y||_||(this.position.direction="down",x=!0),x||_?(f=(u=h)+w,x?(d=v,k=(p=Math.min(d+k,c))-d):k=(p=v+k)-(d=Math.max(p-k,0))):(p=(d=v)+k,b?w=(f=h+w)-(u=Math.max(f-w,0)):(u=h,w=(f=Math.min(u+w,s))-u)),this._box={l:u,t:d,w:w,h:k};var T=g>w,M=l.barLength+2*l.barPad,A=l.barWidth+2*l.barPad,L=h,S=v+m;S+A>c&&(S=c-A);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,l.barColor),T?(this.hbar=C.attr({rx:l.barRadius,ry:l.barRadius,x:L,y:S,width:M,height:A}),this._hbarXMin=L+M/2,this._hbarTranslateMax=w-M):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var O=m>k,P=l.barWidth+2*l.barPad,D=l.barLength+2*l.barPad,z=h+g,R=v;z+P>s&&(z=s-P);var E=this.container.selectAll("rect.scrollbar-vertical").data(O?[0]:[]);E.exit().on(".drag",null).remove(),E.enter().append("rect").classed("scrollbar-vertical",!0).call(a.fill,l.barColor),O?(this.vbar=E.attr({rx:l.barRadius,ry:l.barRadius,x:z,y:R,width:P,height:D}),this._vbarYMin=R+D/2,this._vbarTranslateMax=k-D):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var I=this.id,F=u-.5,N=O?f+P+.5:f+.5,j=d-.5,B=T?p+A+.5:p+.5,H=o._topdefs.selectAll("#"+I).data(T||O?[0]:[]);if(H.exit().remove(),H.enter().append("clipPath").attr("id",I).append("rect"),T||O?(this._clipRect=H.select("rect").attr({x:Math.floor(F),y:Math.floor(j),width:Math.ceil(N)-Math.floor(F),height:Math.ceil(B)-Math.floor(j)}),this.container.call(i.setClipUrl,I,this.gd),this.bg.attr({x:h,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||O){var q=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(q);var V=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(V),O&&this.vbar.on(".drag",null).call(V)}this.setTranslate(t,r)},l.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)},l.prototype._onBoxDrag=function(){var e=this.translateX,t=this.translateY;this.hbar&&(e-=n.event.dx),this.vbar&&(t-=n.event.dy),this.setTranslate(e,t)},l.prototype._onBoxWheel=function(){var e=this.translateX,t=this.translateY;this.hbar&&(e+=n.event.deltaY),this.vbar&&(t+=n.event.deltaY),this.setTranslate(e,t)},l.prototype._onBarDrag=function(){var e=this.translateX,t=this.translateY;if(this.hbar){var r=e+this._hbarXMin,a=r+this._hbarTranslateMax;e=(o.constrain(n.event.x,r,a)-r)/(a-r)*(this.position.w-this._box.w)}if(this.vbar){var i=t+this._vbarYMin,l=i+this._vbarTranslateMax;t=(o.constrain(n.event.y,i,l)-i)/(l-i)*(this.position.h-this._box.h)}this.setTranslate(e,t)},l.prototype.setTranslate=function(e,t){var r=this.position.w-this._box.w,n=this.position.h-this._box.h;if(e=o.constrain(e||0,0,r),t=o.constrain(t||0,0,n),this.translateX=e,this.translateY=t,this.container.call(i.setTranslate,this._box.l-this.position.l-e,this._box.t-this.position.t-t),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+e-.5),y:Math.floor(this.position.t+t-.5)}),this.hbar){var a=e/r;this.hbar.call(i.setTranslate,e+a*this._hbarTranslateMax,t)}if(this.vbar){var l=t/n;this.vbar.call(i.setTranslate,e,t+l*this._vbarTranslateMax)}}},{"../../lib":148,"../color":30,"../drawing":51,d3:2}],125:[function(e,t,r){"use strict";t.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"}}},{}],126:[function(e,t,r){"use strict";t.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-3.x-api-reference/blob/master/Time-Formatting.md#format"}},{}],127:[function(e,t,r){"use strict";t.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DESELECTDIM:.2}},{}],128:[function(e,t,r){"use strict";t.exports={BADNUM:void 0,FP_SAFE:Number.MAX_VALUE/1e4,ONEAVGYEAR:315576e5,ONEAVGMONTH:26298e5,ONEDAY:864e5,ONEHOUR:36e5,ONEMIN:6e4,ONESEC:1e3,EPOCHJD:2440587.5,ALMOST_EQUAL:1-1e-6,LOG_CLIP:10,MINUS_SIGN:"−"}},{}],129:[function(e,t,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}},{}],130:[function(e,t,r){"use strict";r.version=e("./version").version,e("es6-promise").polyfill(),e("../build/plotcss"),e("./fonts/mathjax_config")();for(var n=e("./registry"),a=r.register=n.register,i=e("./plot_api"),o=Object.keys(i),l=0;l<o.length;l++){var s=o[l];"_"!==s.charAt(0)&&(r[s]=i[s]),a({moduleType:"apiMethod",name:s,fn:i[s]})}a(e("./traces/scatter")),a([e("./components/legend"),e("./components/fx"),e("./components/annotations"),e("./components/annotations3d"),e("./components/shapes"),e("./components/images"),e("./components/updatemenus"),e("./components/sliders"),e("./components/rangeslider"),e("./components/rangeselector"),e("./components/grid"),e("./components/errorbars"),e("./components/colorscale"),e("./components/colorbar")]),a([e("./locale-en"),e("./locale-en-us")]),window.PlotlyLocales&&Array.isArray(window.PlotlyLocales)&&(a(window.PlotlyLocales),delete window.PlotlyLocales),r.Icons=e("./fonts/ploticon"),r.Plots=e("./plots/plots"),r.Fx=e("./components/fx"),r.Snapshot=e("./snapshot"),r.PlotSchema=e("./plot_api/plot_schema"),r.Queue=e("./lib/queue"),r.d3=e("d3")},{"../build/plotcss":11,"./components/annotations":23,"./components/annotations3d":28,"./components/colorbar":36,"./components/colorscale":42,"./components/errorbars":57,"./components/fx":69,"./components/grid":73,"./components/images":78,"./components/legend":86,"./components/rangeselector":97,"./components/rangeslider":104,"./components/shapes":112,"./components/sliders":117,"./components/updatemenus":123,"./fonts/mathjax_config":131,"./fonts/ploticon":132,"./lib/queue":162,"./locale-en":173,"./locale-en-us":172,"./plot_api":177,"./plot_api/plot_schema":181,"./plots/plots":224,"./registry":232,"./snapshot":237,"./traces/scatter":256,"./version":271,d3:2,"es6-promise":3}],131:[function(e,t,r){"use strict";t.exports=function(){"undefined"!=typeof MathJax&&("local"!==(window.PlotlyConfig||{}).MathJaxConfig&&(MathJax.Hub.Config({messageStyle:"none",skipStartupTypeset:!0,displayAlign:"left",tex2jax:{inlineMath:[["$","$"],["\\(","\\)"]]}}),MathJax.Hub.Configured()))}},{}],132:[function(e,t,r){"use strict";t.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)"},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)"},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>"}}},{}],133:[function(e,t,r){"use strict";r.isLeftAnchor=function(e){return"left"===e.xanchor||"auto"===e.xanchor&&e.x<=1/3},r.isCenterAnchor=function(e){return"center"===e.xanchor||"auto"===e.xanchor&&e.x>1/3&&e.x<2/3},r.isRightAnchor=function(e){return"right"===e.xanchor||"auto"===e.xanchor&&e.x>=2/3},r.isTopAnchor=function(e){return"top"===e.yanchor||"auto"===e.yanchor&&e.y>=2/3},r.isMiddleAnchor=function(e){return"middle"===e.yanchor||"auto"===e.yanchor&&e.y>1/3&&e.y<2/3},r.isBottomAnchor=function(e){return"bottom"===e.yanchor||"auto"===e.yanchor&&e.y<=1/3}},{}],134:[function(e,t,r){"use strict";var n=e("./mod"),a=n.mod,i=n.modHalf,o=Math.PI,l=2*o;function s(e){return Math.abs(e[1]-e[0])>l-1e-14}function c(e,t){return i(t-e,l)}function u(e,t){if(s(t))return!0;var r,n;t[0]<t[1]?(r=t[0],n=t[1]):(r=t[1],n=t[0]),(r=a(r,l))>(n=a(n,l))&&(n+=l);var i=a(e,l),o=i+l;return i>=r&&i<=n||o>=r&&o<=n}function f(e,t,r,n,a,i,c){a=a||0,i=i||0;var u,f,d,p,h,g=s([r,n]);function v(e,t){return[e*Math.cos(t)+a,i-e*Math.sin(t)]}g?(u=0,f=o,d=l):r<n?(u=r,d=n):(u=n,d=r),e<t?(p=e,h=t):(p=t,h=e);var m,y=Math.abs(d-u)<=o?0:1;function x(e,t,r){return"A"+[e,e]+" "+[0,y,r]+" "+v(e,t)}return g?m=null===p?"M"+v(h,u)+x(h,f,0)+x(h,d,0)+"Z":"M"+v(p,u)+x(p,f,0)+x(p,d,0)+"ZM"+v(h,u)+x(h,f,1)+x(h,d,1)+"Z":null===p?(m="M"+v(h,u)+x(h,d,0),c&&(m+="L0,0Z")):m="M"+v(p,u)+"L"+v(h,u)+x(h,d,0)+"L"+v(p,d)+x(p,u,1)+"Z",m}t.exports={deg2rad:function(e){return e/180*o},rad2deg:function(e){return e/o*180},angleDelta:c,angleDist:function(e,t){return Math.abs(c(e,t))},isFullCircle:s,isAngleInsideSector:u,isPtInsideSector:function(e,t,r,n){return!!u(t,n)&&(r[0]<r[1]?(a=r[0],i=r[1]):(a=r[1],i=r[0]),e>=a&&e<=i);var a,i},pathArc:function(e,t,r,n,a){return f(null,e,t,r,n,a,0)},pathSector:function(e,t,r,n,a){return f(null,e,t,r,n,a,1)},pathAnnulus:function(e,t,r,n,a,i){return f(e,t,r,n,a,i,1)}}},{"./mod":155}],135:[function(e,t,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(e){return a.isView(e)&&!(e instanceof i)}function l(e){return n(e)||o(e)}function s(e,t,r){if(l(e)){if(l(e[0])){for(var n=r,a=0;a<e.length;a++)n=t(n,e[a].length);return n}return e.length}return 0}r.isTypedArray=o,r.isArrayOrTypedArray=l,r.isArray1D=function(e){return!l(e[0])},r.ensureArray=function(e,t){return n(e)||(e=[]),e.length=t,e},r.concat=function(){var e,t,r,a,i,o,l,s,c=[],u=!0,f=0;for(r=0;r<arguments.length;r++)(o=(a=arguments[r]).length)&&(t?c.push(a):(t=a,i=o),n(a)?e=!1:(u=!1,f?e!==a.constructor&&(e=!1):e=a.constructor),f+=o);if(!f)return[];if(!c.length)return t;if(u)return t.concat.apply(t,c);if(e){for((l=new e(f)).set(t),r=0;r<c.length;r++)a=c[r],l.set(a,i),i+=a.length;return l}for(l=new Array(f),s=0;s<t.length;s++)l[s]=t[s];for(r=0;r<c.length;r++){for(a=c[r],s=0;s<a.length;s++)l[i+s]=a[s];i+=s}return l},r.maxRowLength=function(e){return s(e,Math.max,0)},r.minRowLength=function(e){return s(e,Math.min,1/0)}},{}],136:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("../constants/numerical").BADNUM,i=/^['"%,$#\s']+|[, ]|['"%,$#\s']+$/g;t.exports=function(e){return"string"==typeof e&&(e=e.replace(i,"")),n(e)?Number(e):a}},{"../constants/numerical":128,"fast-isnumeric":4}],137:[function(e,t,r){"use strict";t.exports=function(e){var t=e._fullLayout;t._glcanvas&&t._glcanvas.size()&&t._glcanvas.each(function(e){e.regl&&e.regl.clear({color:!0,depth:!0})})}},{}],138:[function(e,t,r){"use strict";t.exports=function(e){e._responsiveChartHandler&&(window.removeEventListener("resize",e._responsiveChartHandler),delete e._responsiveChartHandler)}},{}],139:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("tinycolor2"),i=e("../plots/attributes"),o=e("../components/colorscale/scales"),l=e("../constants/interactions").DESELECTDIM,s=e("./nested_property"),c=e("./regex").counter,u=e("./mod").modHalf,f=e("./array").isArrayOrTypedArray;function d(e,t){var n=r.valObjectMeta[t.valType];if(t.arrayOk&&f(e))return!0;if(n.validateFunction)return n.validateFunction(e,t);var a={},i=a,o={set:function(e){i=e}};return n.coerceFunction(e,o,a,t),i!==a}r.valObjectMeta={data_array:{coerceFunction:function(e,t,r){f(e)?t.set(e):void 0!==r&&t.set(r)}},enumerated:{coerceFunction:function(e,t,r,n){n.coerceNumber&&(e=+e),-1===n.values.indexOf(e)?t.set(r):t.set(e)},validateFunction:function(e,t){t.coerceNumber&&(e=+e);for(var r=t.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(e))return!0}else if(e===r[n])return!0}return!1}},boolean:{coerceFunction:function(e,t,r){!0===e||!1===e?t.set(e):t.set(r)}},number:{coerceFunction:function(e,t,r,a){!n(e)||void 0!==a.min&&e<a.min||void 0!==a.max&&e>a.max?t.set(r):t.set(+e)}},integer:{coerceFunction:function(e,t,r,a){e%1||!n(e)||void 0!==a.min&&e<a.min||void 0!==a.max&&e>a.max?t.set(r):t.set(+e)}},string:{coerceFunction:function(e,t,r,n){if("string"!=typeof e){var a="number"==typeof e;!0!==n.strict&&a?t.set(String(e)):t.set(r)}else n.noBlank&&!e?t.set(r):t.set(e)}},color:{coerceFunction:function(e,t,r){a(e).isValid()?t.set(e):t.set(r)}},colorlist:{coerceFunction:function(e,t,r){Array.isArray(e)&&e.length&&e.every(function(e){return a(e).isValid()})?t.set(e):t.set(r)}},colorscale:{coerceFunction:function(e,t,r){t.set(o.get(e,r))}},angle:{coerceFunction:function(e,t,r){"auto"===e?t.set("auto"):n(e)?t.set(u(+e,360)):t.set(r)}},subplotid:{coerceFunction:function(e,t,r,n){var a=n.regex||c(r);"string"==typeof e&&a.test(e)?t.set(e):t.set(r)},validateFunction:function(e,t){var r=t.dflt;return e===r||"string"==typeof e&&!!c(r).test(e)}},flaglist:{coerceFunction:function(e,t,r,n){if("string"==typeof e)if(-1===(n.extras||[]).indexOf(e)){for(var a=e.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?t.set(a.join("+")):t.set(r)}else t.set(e);else t.set(r)}},any:{coerceFunction:function(e,t,r){void 0===e?t.set(r):t.set(e)}},info_array:{coerceFunction:function(e,t,n,a){function i(e,t,n){var a,i={set:function(e){a=e}};return void 0===n&&(n=t.dflt),r.valObjectMeta[t.valType].coerceFunction(e,i,n,t),a}var o=2===a.dimensions||"1-2"===a.dimensions&&Array.isArray(e)&&Array.isArray(e[0]);if(Array.isArray(e)){var l,s,c,u,f,d,p=a.items,h=[],g=Array.isArray(p),v=g&&o&&Array.isArray(p[0]),m=o&&g&&!v,y=g&&!m?p.length:e.length;if(n=Array.isArray(n)?n:[],o)for(l=0;l<y;l++)for(h[l]=[],c=Array.isArray(e[l])?e[l]:[],f=m?p.length:g?p[l].length:c.length,s=0;s<f;s++)u=m?p[s]:g?p[l][s]:p,void 0!==(d=i(c[s],u,(n[l]||[])[s]))&&(h[l][s]=d);else for(l=0;l<y;l++)void 0!==(d=i(e[l],g?p[l]:p,n[l]))&&(h[l]=d);t.set(h)}else t.set(n)},validateFunction:function(e,t){if(!Array.isArray(e))return!1;var r=t.items,n=Array.isArray(r),a=2===t.dimensions;if(!t.freeLength&&e.length!==r.length)return!1;for(var i=0;i<e.length;i++)if(a){if(!Array.isArray(e[i])||!t.freeLength&&e[i].length!==r[i].length)return!1;for(var o=0;o<e[i].length;o++)if(!d(e[i][o],n?r[i][o]:r))return!1}else if(!d(e[i],n?r[i]:r))return!1;return!0}}},r.coerce=function(e,t,n,a,i){var o=s(n,a).get(),l=s(e,a),c=s(t,a),u=l.get(),p=t._template;if(void 0===u&&p&&(u=s(p,a).get(),p=0),void 0===i&&(i=o.dflt),o.arrayOk&&f(u))return c.set(u),u;var h=r.valObjectMeta[o.valType].coerceFunction;h(u,c,i,o);var g=c.get();return p&&g===i&&!d(u,o)&&(h(u=s(p,a).get(),c,i,o),g=c.get()),g},r.coerce2=function(e,t,n,a,i){var o=s(e,a),l=r.coerce(e,t,n,a,i),c=o.get();return void 0!==c&&null!==c&&l},r.coerceFont=function(e,t,r){var n={};return r=r||{},n.family=e(t+".family",r.family),n.size=e(t+".size",r.size),n.color=e(t+".color",r.color),n},r.coerceHoverinfo=function(e,t,n){var a,o=t._module.attributes,l=o.hoverinfo?o:i,s=l.hoverinfo;if(1===n._dataLength){var c="all"===s.dflt?s.flags.slice():s.dflt.split("+");c.splice(c.indexOf("name"),1),a=c.join("+")}return r.coerce(e,t,l,"hoverinfo",a)},r.coerceSelectionMarkerOpacity=function(e,t){if(e.marker){var r,n,a=e.marker.opacity;if(void 0!==a)f(a)||e.selected||e.unselected||(r=a,n=l*a),t("selected.marker.opacity",r),t("unselected.marker.opacity",n)}},r.validate=d},{"../components/colorscale/scales":45,"../constants/interactions":127,"../plots/attributes":189,"./array":135,"./mod":155,"./nested_property":156,"./regex":163,"fast-isnumeric":4,tinycolor2:281}],140:[function(e,t,r){"use strict";var n,a,i=e("d3"),o=e("fast-isnumeric"),l=e("./loggers"),s=e("./mod").mod,c=e("../constants/numerical"),u=c.BADNUM,f=c.ONEDAY,d=c.ONEHOUR,p=c.ONEMIN,h=c.ONESEC,g=c.EPOCHJD,v=e("../registry"),m=i.time.format.utc,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,x=/^\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,b=(new Date).getFullYear()-70;function _(e){return e&&v.componentsRegistry.calendars&&"string"==typeof e&&"gregorian"!==e}function w(e,t){return String(e+Math.pow(10,t)).substr(1)}r.dateTick0=function(e,t){return _(e)?t?v.getComponentMethod("calendars","CANONICAL_SUNDAY")[e]:v.getComponentMethod("calendars","CANONICAL_TICK")[e]:t?"2000-01-02":"2000-01-01"},r.dfltRange=function(e){return _(e)?v.getComponentMethod("calendars","DFLTRANGE")[e]:["2000-01-01","2001-01-01"]},r.isJSDate=function(e){return"object"==typeof e&&null!==e&&"function"==typeof e.getTime},r.dateTime2ms=function(e,t){if(r.isJSDate(e)){var i=e.getTimezoneOffset()*p,o=(e.getUTCMinutes()-e.getMinutes())*p+(e.getUTCSeconds()-e.getSeconds())*h+(e.getUTCMilliseconds()-e.getMilliseconds());if(o){var l=3*p;i=i-l/2+s(o-i+l/2,l)}return(e=Number(e)-i)>=n&&e<=a?e:u}if("string"!=typeof e&&"number"!=typeof e)return u;e=String(e);var c=_(t),m=e.charAt(0);!c||"G"!==m&&"g"!==m||(e=e.substr(1),t="");var w=c&&"chinese"===t.substr(0,7),k=e.match(w?x:y);if(!k)return u;var T=k[1],M=k[3]||"1",A=Number(k[5]||1),L=Number(k[7]||0),S=Number(k[9]||0),C=Number(k[11]||0);if(c){if(2===T.length)return u;var O;T=Number(T);try{var P=v.getComponentMethod("calendars","getCal")(t);if(w){var D="i"===M.charAt(M.length-1);M=parseInt(M,10),O=P.newDate(T,P.toMonthIndex(T,M,D),A)}else O=P.newDate(T,Number(M),A)}catch(e){return u}return O?(O.toJD()-g)*f+L*d+S*p+C*h:u}T=2===T.length?(Number(T)+2e3-b)%100+b:Number(T),M-=1;var z=new Date(Date.UTC(2e3,M,A,L,S));return z.setUTCFullYear(T),z.getUTCMonth()!==M?u:z.getUTCDate()!==A?u:z.getTime()+C*h},n=r.MIN_MS=r.dateTime2ms("-9999"),a=r.MAX_MS=r.dateTime2ms("9999-12-31 23:59:59.9999"),r.isDateTime=function(e,t){return r.dateTime2ms(e,t)!==u};var k=90*f,T=3*d,M=5*p;function A(e,t,r,n,a){if((t||r||n||a)&&(e+=" "+w(t,2)+":"+w(r,2),(n||a)&&(e+=":"+w(n,2),a))){for(var i=4;a%10==0;)i-=1,a/=10;e+="."+w(a,i)}return e}r.ms2DateTime=function(e,t,r){if("number"!=typeof e||!(e>=n&&e<=a))return u;t||(t=0);var i,o,l,c,y,x,b=Math.floor(10*s(e+.05,1)),w=Math.round(e-b/10);if(_(r)){var L=Math.floor(w/f)+g,S=Math.floor(s(e,f));try{i=v.getComponentMethod("calendars","getCal")(r).fromJD(L).formatDate("yyyy-mm-dd")}catch(e){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=t<k?Math.floor(S/d):0,l=t<k?Math.floor(S%d/p):0,c=t<T?Math.floor(S%p/h):0,y=t<M?S%h*10+b:0}else x=new Date(w),i=m("%Y-%m-%d")(x),o=t<k?x.getUTCHours():0,l=t<k?x.getUTCMinutes():0,c=t<T?x.getUTCSeconds():0,y=t<M?10*x.getUTCMilliseconds()+b:0;return A(i,o,l,c,y)},r.ms2DateTimeLocal=function(e){if(!(e>=n+f&&e<=a-f))return u;var t=Math.floor(10*s(e+.05,1)),r=new Date(Math.round(e-t/10));return A(i.time.format("%Y-%m-%d")(r),r.getHours(),r.getMinutes(),r.getSeconds(),10*r.getUTCMilliseconds()+t)},r.cleanDate=function(e,t,n){if(e===u)return t;if(r.isJSDate(e)||"number"==typeof e&&isFinite(e)){if(_(n))return l.error("JS Dates and milliseconds are incompatible with world calendars",e),t;if(!(e=r.ms2DateTimeLocal(+e))&&void 0!==t)return t}else if(!r.isDateTime(e,n))return l.error("unrecognized date",e),t;return e};var L=/%\d?f/g;function S(e,t,r,n){e=e.replace(L,function(e){var r=Math.min(+e.charAt(1)||6,6);return(t/1e3%1+2).toFixed(r).substr(2).replace(/0+$/,"")||"0"});var a=new Date(Math.floor(t+.05));if(_(n))try{e=v.getComponentMethod("calendars","worldCalFmt")(e,t,n)}catch(e){return"Invalid"}return r(e)(a)}var C=[59,59.9,59.99,59.999,59.9999];r.formatDate=function(e,t,r,n,a,i){if(a=_(a)&&a,!t)if("y"===r)t=i.year;else if("m"===r)t=i.month;else{if("d"!==r)return function(e,t){var r=s(e+.05,f),n=w(Math.floor(r/d),2)+":"+w(s(Math.floor(r/p),60),2);if("M"!==t){o(t)||(t=0);var a=(100+Math.min(s(e/h,60),C[t])).toFixed(t).substr(1);t>0&&(a=a.replace(/0+$/,"").replace(/[\.]$/,"")),n+=":"+a}return n}(e,r)+"\n"+S(i.dayMonthYear,e,n,a);t=i.dayMonth+"\n"+i.year}return S(t,e,n,a)};var O=3*f;r.incrementMonth=function(e,t,r){r=_(r)&&r;var n=s(e,f);if(e=Math.round(e-n),r)try{var a=Math.round(e/f)+g,i=v.getComponentMethod("calendars","getCal")(r),o=i.fromJD(a);return t%12?i.add(o,t,"m"):i.add(o,t/12,"y"),(o.toJD()-g)*f+n}catch(t){l.error("invalid ms "+e+" in calendar "+r)}var c=new Date(e+O);return c.setUTCMonth(c.getUTCMonth()+t)+n-O},r.findExactDates=function(e,t){for(var r,n,a=0,i=0,l=0,s=0,c=_(t)&&v.getComponentMethod("calendars","getCal")(t),u=0;u<e.length;u++)if(n=e[u],o(n)){if(!(n%f))if(c)try{1===(r=c.fromJD(n/f+g)).day()?1===r.month()?a++:i++:l++}catch(e){}else 1===(r=new Date(n)).getUTCDate()?0===r.getUTCMonth()?a++:i++:l++}else s++;l+=i+=a;var d=e.length-s;return{exactYears:a/d,exactMonths:i/d,exactDays:l/d}}},{"../constants/numerical":128,"../registry":232,"./loggers":152,"./mod":155,d3:2,"fast-isnumeric":4}],141:[function(e,t,r){"use strict";var n=e("d3"),a=e("./loggers");function i(e){var t=e&&e.parentNode;t&&t.removeChild(e)}function o(e,t,r){var n="plotly.js-style-"+e,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(t+"{"+r+"}",0):o.addRule?o.addRule(t,r,0):a.warn("addStyleRule failed")}t.exports={getGraphDiv:function(e){var t;if("string"==typeof e){if(null===(t=document.getElementById(e)))throw new Error("No DOM element with id '"+e+"' exists on the page.");return t}if(null===e||void 0===e)throw new Error("DOM element provided is null or undefined");return e},isPlotDiv:function(e){var t=n.select(e);return t.node()instanceof HTMLElement&&t.size()&&t.classed("js-plotly-plot")},removeElement:i,addStyleRule:function(e,t){o("global",e,t)},addRelatedStyleRule:o,deleteRelatedStyleRule:function(e){var t="plotly.js-style-"+e,r=document.getElementById(t);r&&i(r)}}},{"./loggers":152,d3:2}],142:[function(e,t,r){"use strict";var n=e("events").EventEmitter,a={init:function(e){if(e._ev instanceof n)return e;var t=new n,r=new n;return e._ev=t,e._internalEv=r,e.on=t.on.bind(t),e.once=t.once.bind(t),e.removeListener=t.removeListener.bind(t),e.removeAllListeners=t.removeAllListeners.bind(t),e._internalOn=r.on.bind(r),e._internalOnce=r.once.bind(r),e._removeInternalListener=r.removeListener.bind(r),e._removeAllInternalListeners=r.removeAllListeners.bind(r),e.emit=function(n,a){"undefined"!=typeof jQuery&&jQuery(e).trigger(n,a),t.emit(n,a),r.emit(n,a)},e},triggerHandler:function(e,t,r){var n,a;"undefined"!=typeof jQuery&&(n=jQuery(e).triggerHandler(t,r));var i=e._ev;if(!i)return n;var o,l=i._events[t];if(!l)return n;function s(e){return e.listener?(i.removeListener(t,e.listener),e.fired?void 0:(e.fired=!0,e.listener.apply(i,[r]))):e.apply(i,[r])}for(l=Array.isArray(l)?l:[l],o=0;o<l.length-1;o++)s(l[o]);return a=s(l[o]),void 0!==n?n:a},purge:function(e){return delete e._ev,delete e.on,delete e.once,delete e.removeListener,delete e.removeAllListeners,delete e.emit,delete e._ev,delete e._internalEv,delete e._internalOn,delete e._internalOnce,delete e._removeInternalListener,delete e._removeAllInternalListeners,e}};t.exports=a},{events:1}],143:[function(e,t,r){"use strict";var n=e("./is_plain_object.js"),a=Array.isArray;function i(e,t,r,o){var l,s,c,u,f,d,p=e[0],h=e.length;if(2===h&&a(p)&&a(e[1])&&0===p.length){if(function(e,t){var r,n;for(r=0;r<e.length;r++){if(null!==(n=e[r])&&"object"==typeof n)return!1;void 0!==n&&(t[r]=n)}return!0}(e[1],p))return p;p.splice(0,p.length)}for(var g=1;g<h;g++)for(s in l=e[g])c=p[s],u=l[s],o&&a(u)?p[s]=u:t&&u&&(n(u)||(f=a(u)))?(f?(f=!1,d=c&&a(c)?c:[]):d=c&&n(c)?c:{},p[s]=i([d,u],t,r,o)):(void 0!==u||r)&&(p[s]=u);return p}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":149}],144:[function(e,t,r){"use strict";t.exports=function(e){for(var t={},r=[],n=0,a=0;a<e.length;a++){var i=e[a];1!==t[i]&&(t[i]=1,r[n++]=i)}return r}},{}],145:[function(e,t,r){"use strict";function n(e){return!0===e.visible}function a(e){var t=e[0].trace;return!0===t.visible&&0!==t._length}t.exports=function(e){for(var t,r=(t=e,Array.isArray(t)&&Array.isArray(t[0])&&t[0][0]&&t[0][0].trace?a:n),i=[],o=0;o<e.length;o++){var l=e[o];r(l)&&i.push(l)}return i}},{}],146:[function(e,t,r){"use strict";var n,a,i,o=e("./mod").mod;function l(e,t,r,n,a,i,o,l){var s=r-e,c=a-e,u=o-a,f=n-t,d=i-t,p=l-i,h=s*p-u*f;if(0===h)return null;var g=(c*p-u*d)/h,v=(c*f-s*d)/h;return v<0||v>1||g<0||g>1?null:{x:e+s*g,y:t+f*g}}function s(e,t,r,n,a){var i=n*e+a*t;if(i<0)return n*n+a*a;if(i>r){var o=n-e,l=a-t;return o*o+l*l}var s=n*t-a*e;return s*s/r}r.segmentsIntersect=l,r.segmentDistance=function(e,t,r,n,a,i,o,c){if(l(e,t,r,n,a,i,o,c))return 0;var u=r-e,f=n-t,d=o-a,p=c-i,h=u*u+f*f,g=d*d+p*p,v=Math.min(s(u,f,h,a-e,i-t),s(u,f,h,o-e,c-t),s(d,p,g,e-a,t-i),s(d,p,g,r-a,n-i));return Math.sqrt(v)},r.getTextLocation=function(e,t,r,l){if(e===a&&l===i||(n={},a=e,i=l),n[r])return n[r];var s=e.getPointAtLength(o(r-l/2,t)),c=e.getPointAtLength(o(r+l/2,t)),u=Math.atan((c.y-s.y)/(c.x-s.x)),f=e.getPointAtLength(o(r,t)),d={x:(4*f.x+s.x+c.x)/6,y:(4*f.y+s.y+c.y)/6,theta:u};return n[r]=d,d},r.clearLocationCache=function(){a=null},r.getVisibleSegment=function(e,t,r){var n,a,i=t.left,o=t.right,l=t.top,s=t.bottom,c=0,u=e.getTotalLength(),f=u;function d(t){var r=e.getPointAtLength(t);0===t?n=r:t===u&&(a=r);var c=r.x<i?i-r.x:r.x>o?r.x-o:0,f=r.y<l?l-r.y:r.y>s?r.y-s:0;return Math.sqrt(c*c+f*f)}for(var p=d(c);p;){if((c+=p+r)>f)return;p=d(c)}for(p=d(f);p;){if(c>(f-=p+r))return;p=d(f)}return{min:c,max:f,len:f-c,total:u,isClosed:0===c&&f===u&&Math.abs(n.x-a.x)<.1&&Math.abs(n.y-a.y)<.1}},r.findPointOnPath=function(e,t,r,n){for(var a,i,o,l=(n=n||{}).pathLength||e.getTotalLength(),s=n.tolerance||.001,c=n.iterationLimit||30,u=e.getPointAtLength(0)[r]>e.getPointAtLength(l)[r]?-1:1,f=0,d=0,p=l;f<c;){if(a=(d+p)/2,o=(i=e.getPointAtLength(a))[r]-t,Math.abs(o)<s)return i;u*o>0?p=a:d=a,f++}return i}},{"./mod":155}],147:[function(e,t,r){"use strict";t.exports=function(e){return e}},{}],148:[function(e,t,r){"use strict";var n=e("d3"),a=e("fast-isnumeric"),i=e("../constants/numerical"),o=i.FP_SAFE,l=i.BADNUM,s=t.exports={};s.nestedProperty=e("./nested_property"),s.keyedContainer=e("./keyed_container"),s.relativeAttr=e("./relative_attr"),s.isPlainObject=e("./is_plain_object"),s.toLogRange=e("./to_log_range"),s.relinkPrivateKeys=e("./relink_private");var c=e("./array");s.isTypedArray=c.isTypedArray,s.isArrayOrTypedArray=c.isArrayOrTypedArray,s.isArray1D=c.isArray1D,s.ensureArray=c.ensureArray,s.concat=c.concat,s.maxRowLength=c.maxRowLength,s.minRowLength=c.minRowLength;var u=e("./mod");s.mod=u.mod,s.modHalf=u.modHalf;var f=e("./coerce");s.valObjectMeta=f.valObjectMeta,s.coerce=f.coerce,s.coerce2=f.coerce2,s.coerceFont=f.coerceFont,s.coerceHoverinfo=f.coerceHoverinfo,s.coerceSelectionMarkerOpacity=f.coerceSelectionMarkerOpacity,s.validate=f.validate;var d=e("./dates");s.dateTime2ms=d.dateTime2ms,s.isDateTime=d.isDateTime,s.ms2DateTime=d.ms2DateTime,s.ms2DateTimeLocal=d.ms2DateTimeLocal,s.cleanDate=d.cleanDate,s.isJSDate=d.isJSDate,s.formatDate=d.formatDate,s.incrementMonth=d.incrementMonth,s.dateTick0=d.dateTick0,s.dfltRange=d.dfltRange,s.findExactDates=d.findExactDates,s.MIN_MS=d.MIN_MS,s.MAX_MS=d.MAX_MS;var p=e("./search");s.findBin=p.findBin,s.sorterAsc=p.sorterAsc,s.sorterDes=p.sorterDes,s.distinctVals=p.distinctVals,s.roundUp=p.roundUp,s.sort=p.sort,s.findIndexOfMin=p.findIndexOfMin;var h=e("./stats");s.aggNums=h.aggNums,s.len=h.len,s.mean=h.mean,s.median=h.median,s.midRange=h.midRange,s.variance=h.variance,s.stdev=h.stdev,s.interp=h.interp;var g=e("./matrix");s.init2dArray=g.init2dArray,s.transposeRagged=g.transposeRagged,s.dot=g.dot,s.translationMatrix=g.translationMatrix,s.rotationMatrix=g.rotationMatrix,s.rotationXYMatrix=g.rotationXYMatrix,s.apply2DTransform=g.apply2DTransform,s.apply2DTransform2=g.apply2DTransform2;var v=e("./angles");s.deg2rad=v.deg2rad,s.rad2deg=v.rad2deg,s.angleDelta=v.angleDelta,s.angleDist=v.angleDist,s.isFullCircle=v.isFullCircle,s.isAngleInsideSector=v.isAngleInsideSector,s.isPtInsideSector=v.isPtInsideSector,s.pathArc=v.pathArc,s.pathSector=v.pathSector,s.pathAnnulus=v.pathAnnulus;var m=e("./anchor_utils");s.isLeftAnchor=m.isLeftAnchor,s.isCenterAnchor=m.isCenterAnchor,s.isRightAnchor=m.isRightAnchor,s.isTopAnchor=m.isTopAnchor,s.isMiddleAnchor=m.isMiddleAnchor,s.isBottomAnchor=m.isBottomAnchor;var y=e("./geometry2d");s.segmentsIntersect=y.segmentsIntersect,s.segmentDistance=y.segmentDistance,s.getTextLocation=y.getTextLocation,s.clearLocationCache=y.clearLocationCache,s.getVisibleSegment=y.getVisibleSegment,s.findPointOnPath=y.findPointOnPath;var x=e("./extend");s.extendFlat=x.extendFlat,s.extendDeep=x.extendDeep,s.extendDeepAll=x.extendDeepAll,s.extendDeepNoArrays=x.extendDeepNoArrays;var b=e("./loggers");s.log=b.log,s.warn=b.warn,s.error=b.error;var _=e("./regex");s.counterRegex=_.counter;var w=e("./throttle");s.throttle=w.throttle,s.throttleDone=w.done,s.clearThrottle=w.clear;var k=e("./dom");function T(e){var t={};for(var r in e)for(var n=e[r],a=0;a<n.length;a++)t[n[a]]=+r;return t}s.getGraphDiv=k.getGraphDiv,s.isPlotDiv=k.isPlotDiv,s.removeElement=k.removeElement,s.addStyleRule=k.addStyleRule,s.addRelatedStyleRule=k.addRelatedStyleRule,s.deleteRelatedStyleRule=k.deleteRelatedStyleRule,s.clearResponsive=e("./clear_responsive"),s.makeTraceGroups=e("./make_trace_groups"),s._=e("./localize"),s.notifier=e("./notifier"),s.filterUnique=e("./filter_unique"),s.filterVisible=e("./filter_visible"),s.pushUnique=e("./push_unique"),s.cleanNumber=e("./clean_number"),s.ensureNumber=function(e){return a(e)?(e=Number(e))<-o||e>o?l:a(e)?Number(e):l:l},s.isIndex=function(e,t){return!(void 0!==t&&e>=t)&&(a(e)&&e>=0&&e%1==0)},s.noop=e("./noop"),s.identity=e("./identity"),s.repeat=function(e,t){for(var r=new Array(t),n=0;n<t;n++)r[n]=e;return r},s.swapAttrs=function(e,t,r,n){r||(r="x"),n||(n="y");for(var a=0;a<t.length;a++){var i=t[a],o=s.nestedProperty(e,i.replace("?",r)),l=s.nestedProperty(e,i.replace("?",n)),c=o.get();o.set(l.get()),l.set(c)}},s.raiseToTop=function(e){e.parentNode.appendChild(e)},s.cancelTransition=function(e){return e.transition().duration(0)},s.constrain=function(e,t,r){return t>r?Math.max(r,Math.min(t,e)):Math.max(t,Math.min(r,e))},s.bBoxIntersect=function(e,t,r){return r=r||0,e.left<=t.right+r&&t.left<=e.right+r&&e.top<=t.bottom+r&&t.top<=e.bottom+r},s.simpleMap=function(e,t,r,n){for(var a=e.length,i=new Array(a),o=0;o<a;o++)i[o]=t(e[o],r,n);return i},s.randstr=function e(t,r,n,a){if(n||(n=16),void 0===r&&(r=24),r<=0)return"0";var i,o,l=Math.log(Math.pow(2,r))/Math.log(n),c="";for(i=2;l===1/0;i*=2)l=Math.log(Math.pow(2,r/i))/Math.log(n)*i;var u=l-Math.floor(l);for(i=0;i<Math.floor(l);i++)c=Math.floor(Math.random()*n).toString(n)+c;u&&(o=Math.pow(n,u),c=Math.floor(Math.random()*o).toString(n)+c);var f=parseInt(c,n);return t&&t[c]||f!==1/0&&f>=Math.pow(2,r)?a>10?(s.warn("randstr failed uniqueness"),c):e(t,r,n,(a||0)+1):c},s.OptionControl=function(e,t){e||(e={}),t||(t="opt");var r={optionList:[],_newoption:function(n){n[t]=e,r[n.name]=n,r.optionList.push(n)}};return r["_"+t]=e,r},s.smooth=function(e,t){if((t=Math.round(t)||0)<2)return e;var r,n,a,i,o=e.length,l=2*o,s=2*t-1,c=new Array(s),u=new Array(o);for(r=0;r<s;r++)c[r]=(1-Math.cos(Math.PI*(r+1)/t))/(2*t);for(r=0;r<o;r++){for(i=0,n=0;n<s;n++)(a=r+n+1-t)<-o?a-=l*Math.round(a/l):a>=l&&(a-=l*Math.floor(a/l)),a<0?a=-1-a:a>=o&&(a=l-1-a),i+=e[a]*c[n];u[r]=i}return u},s.syncOrAsync=function(e,t,r){var n;function a(){return s.syncOrAsync(e,t,r)}for(;e.length;)if((n=(0,e.splice(0,1)[0])(t))&&n.then)return n.then(a).then(void 0,s.promiseError);return r&&r(t)},s.stripTrailingSlash=function(e){return"/"===e.substr(-1)?e.substr(0,e.length-1):e},s.noneOrAll=function(e,t,r){if(e){var n,a,i=!1,o=!0;for(n=0;n<r.length;n++)void 0!==(a=e[r[n]])&&null!==a?i=!0:o=!1;if(i&&!o)for(n=0;n<r.length;n++)e[r[n]]=t[r[n]]}},s.mergeArray=function(e,t,r,n){var a="function"==typeof n;if(s.isArrayOrTypedArray(e))for(var i=Math.min(e.length,t.length),o=0;o<i;o++){var l=e[o];t[o][r]=a?n(l):l}},s.mergeArrayCastPositive=function(e,t,r){return s.mergeArray(e,t,r,function(e){var t=+e;return isFinite(t)&&t>0?t:0})},s.fillArray=function(e,t,r,n){if(n=n||s.identity,s.isArrayOrTypedArray(e))for(var a=0;a<t.length;a++)t[a][r]=n(e[a])},s.castOption=function(e,t,r,n){n=n||s.identity;var a=s.nestedProperty(e,r).get();return s.isArrayOrTypedArray(a)?Array.isArray(t)&&s.isArrayOrTypedArray(a[t[0]])?n(a[t[0]][t[1]]):n(a[t]):a},s.extractOption=function(e,t,r,n){if(r in e)return e[r];var a=s.nestedProperty(t,n).get();return Array.isArray(a)?void 0:a},s.tagSelected=function(e,t,r){var n,a,i=t.selectedpoints,o=t._indexToPoints;o&&(n=T(o));for(var l=0;l<i.length;l++){var c=i[l];if(s.isIndex(c)||s.isArrayOrTypedArray(c)&&s.isIndex(c[0])&&s.isIndex(c[1])){var u=n?n[c]:c,f=r?r[u]:u;void 0!==(a=f)&&a<e.length&&(e[f].selected=1)}}},s.selIndices2selPoints=function(e){var t=e.selectedpoints,r=e._indexToPoints;if(r){for(var n=T(r),a=[],i=0;i<t.length;i++){var o=t[i];if(s.isIndex(o)){var l=n[o];s.isIndex(l)&&a.push(l)}}return a}return t},s.getTargetArray=function(e,t){var r=t.target;if("string"==typeof r&&r){var n=s.nestedProperty(e,r).get();return!!Array.isArray(n)&&n}return!!Array.isArray(r)&&r},s.minExtend=function(e,t){var r={};"object"!=typeof t&&(t={});var n,a,i,o=Object.keys(e);for(n=0;n<o.length;n++)i=e[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):s.isTypedArray(i)?r[a]=i.subarray(0,3):r[a]=i&&"object"==typeof i?s.minExtend(e[a],t[a]):i);for(o=Object.keys(t),n=0;n<o.length;n++)"object"==typeof(i=t[a=o[n]])&&a in r&&"object"==typeof r[a]||(r[a]=i);return r},s.titleCase=function(e){return e.charAt(0).toUpperCase()+e.substr(1)},s.containsAny=function(e,t){for(var r=0;r<t.length;r++)if(-1!==e.indexOf(t[r]))return!0;return!1},s.isIE=function(){return void 0!==window.navigator.msSaveBlob};var M=/MSIE [1-9]\./;s.isIE9orBelow=function(){return s.isIE()&&M.test(window.navigator.userAgent)};var A=/Version\/[\d\.]+.*Safari/;s.isSafari=function(){return A.test(window.navigator.userAgent)},s.isD3Selection=function(e){return e&&"function"==typeof e.classed},s.ensureSingle=function(e,t,r,n){var a=e.select(t+(r?"."+r:""));if(a.size())return a;var i=e.append(t);return r&&i.classed(r,!0),n&&i.call(n),i},s.ensureSingleById=function(e,t,r,n){var a=e.select(t+"#"+r);if(a.size())return a;var i=e.append(t).attr("id",r);return n&&i.call(n),i},s.objectFromPath=function(e,t){for(var r,n=e.split("."),a=r={},i=0;i<n.length;i++){var o=n[i],l=null,s=n[i].match(/(.*)\[([0-9]+)\]/);s?(o=s[1],l=s[2],r=r[o]=[],i===n.length-1?r[l]=t:r[l]={},r=r[l]):(i===n.length-1?r[o]=t:r[o]={},r=r[o])}return a};var L=/^([^\[\.]+)\.(.+)?/,S=/^([^\.]+)\[([0-9]+)\](\.)?(.+)?/;s.expandObjectPaths=function(e){var t,r,n,a,i,o,l;if("object"==typeof e&&!Array.isArray(e))for(r in e)e.hasOwnProperty(r)&&((t=r.match(L))?(a=e[r],n=t[1],delete e[r],e[n]=s.extendDeepNoArrays(e[n]||{},s.objectFromPath(r,s.expandObjectPaths(a))[n])):(t=r.match(S))?(a=e[r],n=t[1],i=parseInt(t[2]),delete e[r],e[n]=e[n]||[],"."===t[3]?(l=t[4],o=e[n][i]=e[n][i]||{},s.extendDeepNoArrays(o,s.objectFromPath(l,s.expandObjectPaths(a)))):e[n][i]=s.expandObjectPaths(a)):e[r]=s.expandObjectPaths(e[r]));return e},s.numSeparate=function(e,t,r){if(r||(r=!1),"string"!=typeof t||0===t.length)throw new Error("Separator string required for formatting!");"number"==typeof e&&(e=String(e));var n=/(\d+)(\d{3})/,a=t.charAt(0),i=t.charAt(1),o=e.split("."),l=o[0],s=o.length>1?a+o[1]:"";if(i&&(o.length>1||l.length>4||r))for(;n.test(l);)l=l.replace(n,"$1"+i+"$2");return l+s},s.TEMPLATE_STRING_REGEX=/%{([^\s%{}:]*)([:|\|][^}]*)?}/g;var C=/^\w*$/;s.templateString=function(e,t){var r={};return e.replace(s.TEMPLATE_STRING_REGEX,function(e,n){var a;return C.test(n)?a=t[n]:(r[n]=r[n]||s.nestedProperty(t,n).get,a=r[n]()),s.isValidTextValue(a)?a:""})};var O={max:10,count:0,name:"hovertemplate"};s.hovertemplateString=function(){return z.apply(O,arguments)};var P={max:10,count:0,name:"texttemplate"};s.texttemplateString=function(){return z.apply(P,arguments)};var D=/^[:|\|]/;function z(e,t,r){var a=this,i=arguments;t||(t={});var o={};return e.replace(s.TEMPLATE_STRING_REGEX,function(e,l,c){var u,f,d,p;for(d=3;d<i.length;d++)if(u=i[d]){if(u.hasOwnProperty(l)){f=u[l];break}if(C.test(l)||(f=o[l]||s.nestedProperty(u,l).get())&&(o[l]=f),void 0!==f)break}if(void 0===f&&a)return a.count<a.max&&(s.warn("Variable '"+l+"' in "+a.name+" could not be found!"),f=e),a.count===a.max&&s.warn("Too many "+a.name+" warnings - additional warnings will be suppressed"),a.count++,e;if(c){if(":"===c[0]&&(f=(p=r?r.numberFormat:n.format)(c.replace(D,""))(f)),"|"===c[0]){p=r?r.timeFormat.utc:n.time.format.utc;var h=s.dateTime2ms(f);f=s.formatDate(h,c.replace(D,""),!1,p)}}else t.hasOwnProperty(l+"Label")&&(f=t[l+"Label"]);return f})}s.subplotSort=function(e,t){for(var r=Math.min(e.length,t.length)+1,n=0,a=0,i=0;i<r;i++){var o=e.charCodeAt(i)||0,l=t.charCodeAt(i)||0,s=o>=48&&o<=57,c=l>=48&&l<=57;if(s&&(n=10*n+o-48),c&&(a=10*a+l-48),!s||!c){if(n!==a)return n-a;if(o!==l)return o-l}}return a-n};var R=2e9;s.seedPseudoRandom=function(){R=2e9},s.pseudoRandom=function(){var e=R;return R=(69069*R+1)%4294967296,Math.abs(R-e)<429496729?s.pseudoRandom():R/4294967296},s.fillText=function(e,t,r){var n=Array.isArray(r)?function(e){r.push(e)}:function(e){r.text=e},a=s.extractOption(e,t,"htx","hovertext");if(s.isValidTextValue(a))return n(a);var i=s.extractOption(e,t,"tx","text");return s.isValidTextValue(i)?n(i):void 0},s.isValidTextValue=function(e){return e||0===e},s.formatPercent=function(e,t){t=t||0;for(var r=(Math.round(100*e*Math.pow(10,t))*Math.pow(.1,t)).toFixed(t)+"%",n=0;n<t;n++)-1!==r.indexOf(".")&&(r=(r=r.replace("0%","%")).replace(".%","%"));return r},s.isHidden=function(e){var t=window.getComputedStyle(e).display;return!t||"none"===t},s.getTextTransform=function(e){var t=e.noCenter,r=e.textX,n=e.textY,a=e.targetX,i=e.targetY,o=e.anchorX||0,l=e.anchorY||0,s=e.rotate,c=e.scale;return c?c>1&&(c=1):c=0,"translate("+(a-c*(r+o))+","+(i-c*(n+l))+")"+(c<1?"scale("+c+")":"")+(s?"rotate("+s+(t?"":" "+r+" "+n)+")":"")},s.ensureUniformFontSize=function(e,t){var r=s.extendFlat({},t);return r.size=Math.max(t.size,e._fullLayout.uniformtext.minsize||0),r}},{"../constants/numerical":128,"./anchor_utils":133,"./angles":134,"./array":135,"./clean_number":136,"./clear_responsive":138,"./coerce":139,"./dates":140,"./dom":141,"./extend":143,"./filter_unique":144,"./filter_visible":145,"./geometry2d":146,"./identity":147,"./is_plain_object":149,"./keyed_container":150,"./localize":151,"./loggers":152,"./make_trace_groups":153,"./matrix":154,"./mod":155,"./nested_property":156,"./noop":157,"./notifier":158,"./push_unique":161,"./regex":163,"./relative_attr":164,"./relink_private":165,"./search":166,"./stats":168,"./throttle":170,"./to_log_range":171,d3:2,"fast-isnumeric":4}],149:[function(e,t,r){"use strict";t.exports=function(e){return window&&window.process&&window.process.versions?"[object Object]"===Object.prototype.toString.call(e):"[object Object]"===Object.prototype.toString.call(e)&&Object.getPrototypeOf(e)===Object.prototype}},{}],150:[function(e,t,r){"use strict";var n=e("./nested_property"),a=/^\w*$/;t.exports=function(e,t,r,i){var o,l,s;r=r||"name",i=i||"value";var c={};t&&t.length?(s=n(e,t),l=s.get()):l=e,t=t||"";var u={};if(l)for(o=0;o<l.length;o++)u[l[o][r]]=o;var f=a.test(i),d={set:function(e,t){var a=null===t?4:0;if(!l){if(!s||4===a)return;l=[],s.set(l)}var o=u[e];if(void 0===o){if(4===a)return;a|=3,o=l.length,u[e]=o}else t!==(f?l[o][i]:n(l[o],i).get())&&(a|=2);var p=l[o]=l[o]||{};return p[r]=e,f?p[i]=t:n(p,i).set(t),null!==t&&(a&=-5),c[o]=c[o]|a,d},get:function(e){if(l){var t=u[e];return void 0===t?void 0:f?l[t][i]:n(l[t],i).get()}},rename:function(e,t){var n=u[e];return void 0===n?d:(c[n]=1|c[n],u[t]=n,delete u[e],l[n][r]=t,d)},remove:function(e){var t=u[e];if(void 0===t)return d;var a=l[t];if(Object.keys(a).length>2)return c[t]=2|c[t],d.set(e,null);if(f){for(o=t;o<l.length;o++)c[o]=3|c[o];for(o=t;o<l.length;o++)u[l[o][r]]--;l.splice(t,1),delete u[e]}else n(a,i).set(null),c[t]=6|c[t];return d},constructUpdate:function(){for(var e,a,o={},s=Object.keys(c),u=0;u<s.length;u++)a=s[u],e=t+"["+a+"]",l[a]?(1&c[a]&&(o[e+"."+r]=l[a][r]),2&c[a]&&(o[e+"."+i]=f?4&c[a]?null:l[a][i]:4&c[a]?null:n(l[a],i).get())):o[e]=null;return o}};return d}},{"./nested_property":156}],151:[function(e,t,r){"use strict";var n=e("../registry");t.exports=function(e,t){for(var r=e._context.locale,a=0;a<2;a++){for(var i=e._context.locales,o=0;o<2;o++){var l=(i[r]||{}).dictionary;if(l){var s=l[t];if(s)return s}i=n.localeRegistry}var c=r.split("-")[0];if(c===r)break;r=c}return t}},{"../registry":232}],152:[function(e,t,r){"use strict";var n=e("../plot_api/plot_config").dfltConfig,a=e("./notifier"),i=t.exports={};function o(e,t){if(e&&e.apply)try{return void e.apply(console,t)}catch(e){}for(var r=0;r<t.length;r++)try{e(t[r])}catch(e){console.log(t[r])}}i.log=function(){var e;if(n.logging>1){var t=["LOG:"];for(e=0;e<arguments.length;e++)t.push(arguments[e]);o(console.trace||console.log,t)}if(n.notifyOnLogging>1){var r=[];for(e=0;e<arguments.length;e++)r.push(arguments[e]);a(r.join("<br>"),"long")}},i.warn=function(){var e;if(n.logging>0){var t=["WARN:"];for(e=0;e<arguments.length;e++)t.push(arguments[e]);o(console.trace||console.log,t)}if(n.notifyOnLogging>0){var r=[];for(e=0;e<arguments.length;e++)r.push(arguments[e]);a(r.join("<br>"),"stick")}},i.error=function(){var e;if(n.logging>0){var t=["ERROR:"];for(e=0;e<arguments.length;e++)t.push(arguments[e]);o(console.error,t)}if(n.notifyOnLogging>0){var r=[];for(e=0;e<arguments.length;e++)r.push(arguments[e]);a(r.join("<br>"),"stick")}}},{"../plot_api/plot_config":180,"./notifier":158}],153:[function(e,t,r){"use strict";var n=e("d3");t.exports=function(e,t,r){var a=e.selectAll("g."+r.replace(/\s/g,".")).data(t,function(e){return e[0].trace.uid});a.exit().remove(),a.enter().append("g").attr("class",r),a.order();var i=e.classed("rangeplot")?"nodeRangePlot3":"node3";return a.each(function(e){e[0][i]=n.select(this)}),a}},{d3:2}],154:[function(e,t,r){"use strict";r.init2dArray=function(e,t){for(var r=new Array(e),n=0;n<e;n++)r[n]=new Array(t);return r},r.transposeRagged=function(e){var t,r,n=0,a=e.length;for(t=0;t<a;t++)n=Math.max(n,e[t].length);var i=new Array(n);for(t=0;t<n;t++)for(i[t]=new Array(a),r=0;r<a;r++)i[t][r]=e[r][t];return i},r.dot=function(e,t){if(!e.length||!t.length||e.length!==t.length)return null;var n,a,i=e.length;if(e[0].length)for(n=new Array(i),a=0;a<i;a++)n[a]=r.dot(e[a],t);else if(t[0].length){var o=r.transposeRagged(t);for(n=new Array(o.length),a=0;a<o.length;a++)n[a]=r.dot(e,o[a])}else for(n=0,a=0;a<i;a++)n+=e[a]*t[a];return n},r.translationMatrix=function(e,t){return[[1,0,e],[0,1,t],[0,0,1]]},r.rotationMatrix=function(e){var t=e*Math.PI/180;return[[Math.cos(t),-Math.sin(t),0],[Math.sin(t),Math.cos(t),0],[0,0,1]]},r.rotationXYMatrix=function(e,t,n){return r.dot(r.dot(r.translationMatrix(t,n),r.rotationMatrix(e)),r.translationMatrix(-t,-n))},r.apply2DTransform=function(e){return function(){var t=arguments;3===t.length&&(t=t[0]);var n=1===arguments.length?t[0]:[t[0],t[1]];return r.dot(e,[n[0],n[1],1]).slice(0,2)}},r.apply2DTransform2=function(e){var t=r.apply2DTransform(e);return function(e){return t(e.slice(0,2)).concat(t(e.slice(2,4)))}}},{}],155:[function(e,t,r){"use strict";t.exports={mod:function(e,t){var r=e%t;return r<0?r+t:r},modHalf:function(e,t){return Math.abs(e)>t/2?e-Math.round(e/t)*t:e}}},{}],156:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("./array").isArrayOrTypedArray;t.exports=function(e,t){if(n(t))t=String(t);else if("string"!=typeof t||"[-1]"===t.substr(t.length-4))throw"bad property string";for(var r,i,o,s=0,c=t.split(".");s<c.length;){if(r=String(c[s]).match(/^([^\[\]]*)((\[\-?[0-9]*\])+)$/)){if(r[1])c[s]=r[1];else{if(0!==s)throw"bad property string";c.splice(0,1)}for(i=r[2].substr(1,r[2].length-2).split("]["),o=0;o<i.length;o++)s++,c.splice(s,0,Number(i[o]))}s++}return"object"!=typeof e?function(e,t,r){return{set:function(){throw"bad container"},get:function(){},astr:t,parts:r,obj:e}}(e,t,c):{set:l(e,c,t),get:function e(t,r){return function(){var n,i,o,l,s,c=t;for(l=0;l<r.length-1;l++){if(-1===(n=r[l])){for(i=!0,o=[],s=0;s<c.length;s++)o[s]=e(c[s],r.slice(l+1))(),o[s]!==o[0]&&(i=!1);return i?o[0]:o}if("number"==typeof n&&!a(c))return;if("object"!=typeof(c=c[n])||null===c)return}if("object"==typeof c&&null!==c&&null!==(o=c[r[l]]))return o}}(e,c),astr:t,parts:c,obj:e}};var i=/(^|\.)args\[/;function o(e,t){return void 0===e||null===e&&!t.match(i)}function l(e,t,r){return function(n){var i,l,f=e,d="",p=[[e,d]],h=o(n,r);for(l=0;l<t.length-1;l++){if("number"==typeof(i=t[l])&&!a(f))throw"array index but container is not an array";if(-1===i){if(h=!c(f,t.slice(l+1),n,r))break;return}if(!u(f,i,t[l+1],h))break;if("object"!=typeof(f=f[i])||null===f)throw"container is not an object";d=s(d,i),p.push([f,d])}if(h){if(l===t.length-1&&(delete f[t[l]],Array.isArray(f)&&+t[l]==f.length-1))for(;f.length&&void 0===f[f.length-1];)f.pop()}else f[t[l]]=n}}function s(e,t){var r=t;return n(t)?r="["+t+"]":e&&(r="."+t),e+r}function c(e,t,r,n){var i,s=a(r),c=!0,f=r,d=n.replace("-1",0),p=!s&&o(r,d),h=t[0];for(i=0;i<e.length;i++)d=n.replace("-1",i),s&&(p=o(f=r[i%r.length],d)),p&&(c=!1),u(e,i,h,p)&&l(e[i],t,n.replace("-1",i))(f);return c}function u(e,t,r,n){if(void 0===e[t]){if(n)return!1;e[t]="number"==typeof r?[]:{}}return!0}},{"./array":135,"fast-isnumeric":4}],157:[function(e,t,r){"use strict";t.exports=function(){}},{}],158:[function(e,t,r){"use strict";var n=e("d3"),a=e("fast-isnumeric"),i=[];t.exports=function(e,t){if(-1===i.indexOf(e)){i.push(e);var r=1e3;a(t)?r=t:"long"===t&&(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(e){var a=n.select(this);a.append("button").classed("notifier-close",!0).html("×").on("click",function(){a.transition().call(l)});for(var i=a.append("p"),o=e.split(/<br\s*\/?>/g),s=0;s<o.length;s++)s&&i.append("br"),i.append("span").text(o[s]);"stick"===t?a.transition().duration(350).style("opacity",1):a.transition().duration(700).style("opacity",1).transition().delay(r).call(l)})}function l(e){e.duration(700).style("opacity",0).each("end",function(e){var t=i.indexOf(e);-1!==t&&i.splice(t,1),n.select(this).remove()})}}},{d3:2,"fast-isnumeric":4}],159:[function(e,t,r){"use strict";var n=e("./setcursor"),a="data-savedcursor";t.exports=function(e,t){var r=e.attr(a);if(t){if(!r){for(var i=(e.attr("class")||"").split(" "),o=0;o<i.length;o++){var l=i[o];0===l.indexOf("cursor-")&&e.attr(a,l.substr(7)).classed(l,!1)}e.attr(a)||e.attr(a,"!!")}n(e,t)}else r&&(e.attr(a,null),"!!"===r?n(e):n(e,r))}},{"./setcursor":167}],160:[function(e,t,r){"use strict";var n=e("./matrix").dot,a=e("../constants/numerical").BADNUM,i=t.exports={};i.tester=function(e){var t,r=e.slice(),n=r[0][0],i=n,o=r[0][1],l=o;for(r.push(r[0]),t=1;t<r.length;t++)n=Math.min(n,r[t][0]),i=Math.max(i,r[t][0]),o=Math.min(o,r[t][1]),l=Math.max(l,r[t][1]);var s,c=!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]&&(c=!0,s=function(e){return e[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]&&(c=!0,s=function(e){return e[1]===r[0][1]}));var u=!0,f=r[0];for(t=1;t<r.length;t++)if(f[0]!==r[t][0]||f[1]!==r[t][1]){u=!1;break}return{xmin:n,xmax:i,ymin:o,ymax:l,pts:r,contains:c?function(e,t){var r=e[0],c=e[1];return!(r===a||r<n||r>i||c===a||c<o||c>l||t&&s(e))}:function(e,t){var s=e[0],c=e[1];if(s===a||s<n||s>i||c===a||c<o||c>l)return!1;var u,f,d,p,h,g=r.length,v=r[0][0],m=r[0][1],y=0;for(u=1;u<g;u++)if(f=v,d=m,v=r[u][0],m=r[u][1],!(s<(p=Math.min(f,v))||s>Math.max(f,v)||c>Math.max(d,m)))if(c<Math.min(d,m))s!==p&&y++;else{if(c===(h=v===f?c:d+(s-f)*(m-d)/(v-f)))return 1!==u||!t;c<=h&&s!==p&&y++}return y%2==1},isRect:c,degenerate:u}},i.isSegmentBent=function(e,t,r,a){var i,o,l,s=e[t],c=[e[r][0]-s[0],e[r][1]-s[1]],u=n(c,c),f=Math.sqrt(u),d=[-c[1]/f,c[0]/f];for(i=t+1;i<r;i++)if(o=[e[i][0]-s[0],e[i][1]-s[1]],(l=n(o,c))<0||l>u||Math.abs(n(o,d))>a)return!0;return!1},i.filter=function(e,t){var r=[e[0]],n=0,a=0;function o(o){e.push(o);var l=r.length,s=n;r.splice(a+1);for(var c=s+1;c<e.length;c++)(c===e.length-1||i.isSegmentBent(e,s,c+1,t))&&(r.push(e[c]),r.length<l-2&&(n=c,a=r.length-1),s=c)}e.length>1&&o(e.pop());return{addPt:o,raw:e,filtered:r}}},{"../constants/numerical":128,"./matrix":154}],161:[function(e,t,r){"use strict";t.exports=function(e,t){if(t instanceof RegExp){for(var r=t.toString(),n=0;n<e.length;n++)if(e[n]instanceof RegExp&&e[n].toString()===r)return e;e.push(t)}else!t&&0!==t||-1!==e.indexOf(t)||e.push(t);return e}},{}],162:[function(e,t,r){"use strict";var n=e("../lib"),a=e("../plot_api/plot_config").dfltConfig;var i={add:function(e,t,r,n,i){var o,l;e.undoQueue=e.undoQueue||{index:0,queue:[],sequence:!1},l=e.undoQueue.index,e.autoplay?e.undoQueue.inSequence||(e.autoplay=!1):(!e.undoQueue.sequence||e.undoQueue.beginSequence?(o={undo:{calls:[],args:[]},redo:{calls:[],args:[]}},e.undoQueue.queue.splice(l,e.undoQueue.queue.length-l,o),e.undoQueue.index+=1):o=e.undoQueue.queue[l-1],e.undoQueue.beginSequence=!1,o&&(o.undo.calls.unshift(t),o.undo.args.unshift(r),o.redo.calls.push(n),o.redo.args.push(i)),e.undoQueue.queue.length>a.queueLength&&(e.undoQueue.queue.shift(),e.undoQueue.index--))},startSequence:function(e){e.undoQueue=e.undoQueue||{index:0,queue:[],sequence:!1},e.undoQueue.sequence=!0,e.undoQueue.beginSequence=!0},stopSequence:function(e){e.undoQueue=e.undoQueue||{index:0,queue:[],sequence:!1},e.undoQueue.sequence=!1,e.undoQueue.beginSequence=!1},undo:function(e){var t,r;if(e.framework&&e.framework.isPolar)e.framework.undo();else if(!(void 0===e.undoQueue||isNaN(e.undoQueue.index)||e.undoQueue.index<=0)){for(e.undoQueue.index--,t=e.undoQueue.queue[e.undoQueue.index],e.undoQueue.inSequence=!0,r=0;r<t.undo.calls.length;r++)i.plotDo(e,t.undo.calls[r],t.undo.args[r]);e.undoQueue.inSequence=!1,e.autoplay=!1}},redo:function(e){var t,r;if(e.framework&&e.framework.isPolar)e.framework.redo();else if(!(void 0===e.undoQueue||isNaN(e.undoQueue.index)||e.undoQueue.index>=e.undoQueue.queue.length)){for(t=e.undoQueue.queue[e.undoQueue.index],e.undoQueue.inSequence=!0,r=0;r<t.redo.calls.length;r++)i.plotDo(e,t.redo.calls[r],t.redo.args[r]);e.undoQueue.inSequence=!1,e.autoplay=!1,e.undoQueue.index++}}};i.plotDo=function(e,t,r){e.autoplay=!0,r=function(e,t){for(var r,a=[],i=0;i<t.length;i++)r=t[i],a[i]=r===e?r:"object"==typeof r?Array.isArray(r)?n.extendDeep([],r):n.extendDeepAll({},r):r;return a}(e,r),t.apply(null,r)},t.exports=i},{"../lib":148,"../plot_api/plot_config":180}],163:[function(e,t,r){"use strict";r.counter=function(e,t,r,n){var a=(t||"")+(r?"":"$"),i=!1===n?"":"^";return"xy"===e?new RegExp(i+"x([2-9]|[1-9][0-9]+)?y([2-9]|[1-9][0-9]+)?"+a):new RegExp(i+e+"([2-9]|[1-9][0-9]+)?"+a)}},{}],164:[function(e,t,r){"use strict";var n=/^(.*)(\.[^\.\[\]]+|\[\d\])$/,a=/^[^\.\[\]]+$/;t.exports=function(e,t){for(;t;){var r=e.match(n);if(r)e=r[1];else{if(!e.match(a))throw new Error("bad relativeAttr call:"+[e,t]);e=""}if("^"!==t.charAt(0))break;t=t.slice(1)}return e&&"["!==t.charAt(0)?e+"."+t:e+t}},{}],165:[function(e,t,r){"use strict";var n=e("./array").isArrayOrTypedArray,a=e("./is_plain_object");t.exports=function e(t,r){for(var i in r){var o=r[i],l=t[i];if(l!==o)if("_"===i.charAt(0)||"function"==typeof o){if(i in t)continue;t[i]=o}else if(n(o)&&n(l)&&a(o[0])){if("customdata"===i||"ids"===i)continue;for(var s=Math.min(o.length,l.length),c=0;c<s;c++)l[c]!==o[c]&&a(o[c])&&a(l[c])&&e(l[c],o[c])}else a(o)&&a(l)&&(e(l,o),Object.keys(l).length||delete t[i])}}},{"./array":135,"./is_plain_object":149}],166:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("./loggers"),i=e("./identity");function o(e,t){return e<t}function l(e,t){return e<=t}function s(e,t){return e>t}function c(e,t){return e>=t}r.findBin=function(e,t,r){if(n(t.start))return r?Math.ceil((e-t.start)/t.size-1e-9)-1:Math.floor((e-t.start)/t.size+1e-9);var i,u,f=0,d=t.length,p=0,h=d>1?(t[d-1]-t[0])/(d-1):1;for(u=h>=0?r?o:l:r?c:s,e+=1e-9*h*(r?-1:1)*(h>=0?1:-1);f<d&&p++<100;)u(t[i=Math.floor((f+d)/2)],e)?f=i+1:d=i;return p>90&&a.log("Long binary search..."),f-1},r.sorterAsc=function(e,t){return e-t},r.sorterDes=function(e,t){return t-e},r.distinctVals=function(e){var t=e.slice();t.sort(r.sorterAsc);for(var n=t.length-1,a=t[n]-t[0]||1,i=a/(n||1)/1e4,o=[t[0]],l=0;l<n;l++)t[l+1]>t[l]+i&&(a=Math.min(a,t[l+1]-t[l]),o.push(t[l+1]));return{vals:o,minDiff:a}},r.roundUp=function(e,t,r){for(var n,a=0,i=t.length-1,o=0,l=r?0:1,s=r?1:0,c=r?Math.ceil:Math.floor;a<i&&o++<100;)t[n=c((a+i)/2)]<=e?a=n+l:i=n-s;return t[a]},r.sort=function(e,t){for(var r=0,n=0,a=1;a<e.length;a++){var i=t(e[a],e[a-1]);if(i<0?r=1:i>0&&(n=1),r&&n)return e.sort(t)}return n?e:e.reverse()},r.findIndexOfMin=function(e,t){t=t||i;for(var r,n=1/0,a=0;a<e.length;a++){var o=t(e[a]);o<n&&(n=o,r=a)}return r}},{"./identity":147,"./loggers":152,"fast-isnumeric":4}],167:[function(e,t,r){"use strict";t.exports=function(e,t){(e.attr("class")||"").split(" ").forEach(function(t){0===t.indexOf("cursor-")&&e.classed(t,!1)}),t&&e.classed("cursor-"+t,!0)}},{}],168:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("./array").isArrayOrTypedArray;r.aggNums=function(e,t,i,o){var l,s;if((!o||o>i.length)&&(o=i.length),n(t)||(t=!1),a(i[0])){for(s=new Array(o),l=0;l<o;l++)s[l]=r.aggNums(e,t,i[l]);i=s}for(l=0;l<o;l++)n(t)?n(i[l])&&(t=e(+t,+i[l])):t=i[l];return t},r.len=function(e){return r.aggNums(function(e){return e+1},0,e)},r.mean=function(e,t){return t||(t=r.len(e)),r.aggNums(function(e,t){return e+t},0,e)/t},r.midRange=function(e){if(void 0!==e&&0!==e.length)return(r.aggNums(Math.max,null,e)+r.aggNums(Math.min,null,e))/2},r.variance=function(e,t,a){return t||(t=r.len(e)),n(a)||(a=r.mean(e,t)),r.aggNums(function(e,t){return e+Math.pow(t-a,2)},0,e)/t},r.stdev=function(e,t,n){return Math.sqrt(r.variance(e,t,n))},r.median=function(e){var t=e.slice().sort();return r.interp(t,.5)},r.interp=function(e,t){if(!n(t))throw"n should be a finite number";if((t=t*e.length-.5)<0)return e[0];if(t>e.length-1)return e[e.length-1];var r=t%1;return r*e[Math.ceil(t)]+(1-r)*e[Math.floor(t)]}},{"./array":135,"fast-isnumeric":4}],169:[function(e,t,r){"use strict";var n=e("d3"),a=e("../lib"),i=e("../constants/xmlns_namespaces"),o=e("../constants/alignment").LINE_SPACING;function l(e,t){return e.node().getBoundingClientRect()[t]}var s=/([^$]*)([$]+[^$]*[$]+)([^$]*)/;r.convertToTspans=function(e,t,A){var L=e.text(),C=!e.attr("data-notex")&&"undefined"!=typeof MathJax&&L.match(s),O=n.select(e.node().parentNode);if(!O.empty()){var P=e.attr("class")?e.attr("class").split(" ")[0]:"text";return P+="-math",O.selectAll("svg."+P).remove(),O.selectAll("g."+P+"-group").remove(),e.style("display",null).attr({"data-unformatted":L,"data-math":"N"}),C?(t&&t._promises||[]).push(new Promise(function(t){e.style("display","none");var r=parseInt(e.node().style.fontSize,10),i={fontSize:r};!function(e,t,r){var i,o,l,s;MathJax.Hub.Queue(function(){return o=a.extendDeepAll({},MathJax.Hub.config),l=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 s=n.select("body").append("div").attr({id:r}).style({visibility:"hidden",position:"absolute"}).style({"font-size":t.fontSize+"px"}).text(e.replace(c,"\\lt ").replace(u,"\\gt ")),MathJax.Hub.Typeset(s.node())},function(){var t=n.select("body").select("#MathJax_SVG_glyphs");if(s.select(".MathJax_SVG").empty()||!s.select("svg").node())a.log("There was an error in the tex syntax.",e),r();else{var o=s.select("svg").node().getBoundingClientRect();r(s.select(".MathJax_SVG"),t,o)}if(s.remove(),"SVG"!==i)return MathJax.Hub.setRenderer(i)},function(){return void 0!==l&&(MathJax.Hub.processSectionDelay=l),MathJax.Hub.Config(o)})}(C[2],i,function(n,a,i){O.selectAll("svg."+P).remove(),O.selectAll("g."+P+"-group").remove();var o=n&&n.select("svg");if(!o||!o.node())return D(),void t();var s=O.append("g").classed(P+"-group",!0).attr({"pointer-events":"none","data-unformatted":L,"data-math":"Y"});s.node().appendChild(o.node()),a&&a.node()&&o.node().insertBefore(a.node().cloneNode(!0),o.node().firstChild),o.attr({class:P,height:i.height,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var c=e.node().style.fill||"black",u=o.select("g");u.attr({fill:c,stroke:c});var f=l(u,"width"),d=l(u,"height"),p=+e.attr("x")-f*{start:0,middle:.5,end:1}[e.attr("text-anchor")||"start"],h=-(r||l(e,"height"))/4;"y"===P[0]?(s.attr({transform:"rotate("+[-90,+e.attr("x"),+e.attr("y")]+") translate("+[-f/2,h-d/2]+")"}),o.attr({x:+e.attr("x"),y:+e.attr("y")})):"l"===P[0]?o.attr({x:e.attr("x"),y:h-d/2}):"a"===P[0]&&0!==P.indexOf("atitle")?o.attr({x:0,y:h}):o.attr({x:p,y:+e.attr("y")+h-d/2}),A&&A.call(e,s),t(s)})})):D(),e}function D(){O.empty()||(P=e.attr("class")+"-math",O.select("svg."+P).remove()),e.text("").style("white-space","pre"),function(e,t){t=t.replace(v," ");var r,l=!1,s=[],c=-1;function u(){c++;var t=document.createElementNS(i.svg,"tspan");n.select(t).attr({class:"line",dy:c*o+"em"}),e.appendChild(t),r=t;var a=s;if(s=[{node:t}],a.length>1)for(var l=1;l<a.length;l++)A(a[l])}function A(e){var t,a=e.type,o={};if("a"===a){t="a";var l=e.target,c=e.href,u=e.popup;c&&(o={"xlink:xlink:show":"_blank"===l||"_"!==l.charAt(0)?"new":"replace",target:l,"xlink:xlink:href":c},u&&(o.onclick='window.open(this.href.baseVal,this.target.baseVal,"'+u+'");return false;'))}else t="tspan";e.style&&(o.style=e.style);var f=document.createElementNS(i.svg,t);if("sup"===a||"sub"===a){L(r,h),r.appendChild(f);var g=document.createElementNS(i.svg,"tspan");L(g,h),n.select(g).attr("dy",p[a]),o.dy=d[a],r.appendChild(f),r.appendChild(g)}else r.appendChild(f);n.select(f).attr(o),r=e.node=f,s.push(e)}function L(e,t){e.appendChild(document.createTextNode(t))}function C(e){if(1!==s.length){var n=s.pop();e!==n.type&&a.log("Start tag <"+n.type+"> doesnt match end tag <"+e+">. Pretending it did match.",t),r=s[s.length-1].node}else a.log("Ignoring unexpected end tag </"+e+">.",t)}x.test(t)?u():(r=e,s=[{node:e}]);for(var O=t.split(m),P=0;P<O.length;P++){var D=O[P],z=D.match(y),R=z&&z[2].toLowerCase(),E=f[R];if("br"===R)u();else if(void 0===E)L(r,S(D));else if(z[1])C(R);else{var I=z[4],F={type:R},N=T(I,b);if(N?(N=N.replace(M,"$1 fill:"),E&&(N+=";"+E)):E&&(N=E),N&&(F.style=N),"a"===R){l=!0;var j=T(I,_);if(j){var B=document.createElement("a");B.href=j,-1!==g.indexOf(B.protocol)&&(F.href=encodeURI(decodeURI(j)),F.target=T(I,w)||"_blank",F.popup=T(I,k))}}A(F)}}return l}(e.node(),L)&&e.style("pointer-events","all"),r.positionText(e),A&&A.call(e)}};var c=/(<|<|<)/g,u=/(>|>|>)/g;var f={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"},d={sub:"0.3em",sup:"-0.6em"},p={sub:"-0.21em",sup:"0.42em"},h="",g=["http:","https:","mailto:","",void 0,":"],v=r.NEWLINES=/(\r\n?|\n)/g,m=/(<[^<>]*>)/,y=/<(\/?)([^ >]*)(\s+(.*))?>/i,x=/<br(\s+.*)?>/i;r.BR_TAG_ALL=/<br(\s+.*)?>/gi;var b=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,_=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,w=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,k=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i;function T(e,t){if(!e)return null;var r=e.match(t),n=r&&(r[3]||r[4]);return n&&S(n)}var M=/(^|;)\s*color:/;r.plainText=function(e,t){for(var r=void 0!==(t=t||{}).len&&-1!==t.len?t.len:1/0,n=void 0!==t.allowedTags?t.allowedTags:["br"],a="...".length,i=e.split(m),o=[],l="",s=0,c=0;c<i.length;c++){var u=i[c],f=u.match(y),d=f&&f[2].toLowerCase();if(d)-1!==n.indexOf(d)&&(o.push(u),l=d);else{var p=u.length;if(s+p<r)o.push(u),s+=p;else if(s<r){var h=r-s;l&&("br"!==l||h<=a||p<=a)&&o.pop(),r>a?o.push(u.substr(0,h-a)+"..."):o.push(u.substr(0,h));break}l=""}}return o.join("")};var A={mu:"μ",amp:"&",lt:"<",gt:">",nbsp:" ",times:"×",plusmn:"±",deg:"°"},L=/&(#\d+|#x[\da-fA-F]+|[a-z]+);/g;function S(e){return e.replace(L,function(e,t){return("#"===t.charAt(0)?function(e){if(e>1114111)return;var t=String.fromCodePoint;if(t)return t(e);var r=String.fromCharCode;return e<=65535?r(e):r(55232+(e>>10),e%1024+56320)}("x"===t.charAt(1)?parseInt(t.substr(2),16):parseInt(t.substr(1),10)):A[t])||e})}function C(e,t,r){var n,a,i,o=r.horizontalAlign,l=r.verticalAlign||"top",s=e.node().getBoundingClientRect(),c=t.node().getBoundingClientRect();return a="bottom"===l?function(){return s.bottom-n.height}:"middle"===l?function(){return s.top+(s.height-n.height)/2}:function(){return s.top},i="right"===o?function(){return s.right-n.width}:"center"===o?function(){return s.left+(s.width-n.width)/2}:function(){return s.left},function(){return n=this.node().getBoundingClientRect(),this.style({top:a()-c.top+"px",left:i()-c.left+"px","z-index":1e3}),this}}r.convertEntities=S,r.lineCount=function(e){return e.selectAll("tspan.line").size()||1},r.positionText=function(e,t,r){return e.each(function(){var e=n.select(this);function a(t,r){return void 0===r?null===(r=e.attr(t))&&(e.attr(t,0),r=0):e.attr(t,r),r}var i=a("x",t),o=a("y",r);"text"===this.nodeName&&e.selectAll("tspan.line").attr({x:i,y:o})})},r.makeEditable=function(e,t){var r=t.gd,a=t.delegate,i=n.dispatch("edit","input","cancel"),o=a||e;if(e.style({"pointer-events":a?"none":"all"}),1!==e.size())throw new Error("boo");function l(){!function(){var a=n.select(r).select(".svg-container"),o=a.append("div"),l=e.node().style,c=parseFloat(l.fontSize||12),u=t.text;void 0===u&&(u=e.attr("data-unformatted"));o.classed("plugin-editable editable",!0).style({position:"absolute","font-family":l.fontFamily||"Arial","font-size":c,color:t.fill||l.fill||"black",opacity:1,"background-color":t.background||"transparent",outline:"#ffffff33 1px solid",margin:[-c/8+1,0,0,-1].join("px ")+"px",padding:"0","box-sizing":"border-box"}).attr({contenteditable:!0}).text(u).call(C(e,a,t)).on("blur",function(){r._editing=!1,e.text(this.textContent).style({opacity:1});var t,a=n.select(this).attr("class");(t=a?"."+a.split(" ")[0]+"-math-group":"[class*=-math-group]")&&n.select(e.node().parentNode).select(t).style({opacity:0});var o=this.textContent;n.select(this).transition().duration(0).remove(),n.select(document).on("mouseup",null),i.edit.call(e,o)}).on("focus",function(){var e=this;r._editing=!0,n.select(document).on("mouseup",function(){if(n.event.target===e)return!1;document.activeElement===o.node()&&o.node().blur()})}).on("keyup",function(){27===n.event.which?(r._editing=!1,e.style({opacity:1}),n.select(this).style({opacity:0}).on("blur",function(){return!1}).transition().remove(),i.cancel.call(e,this.textContent)):(i.input.call(e,this.textContent),n.select(this).call(C(e,a,t)))}).on("keydown",function(){13===n.event.which&&this.blur()}).call(s)}(),e.style({opacity:0});var a,l=o.attr("class");(a=l?"."+l.split(" ")[0]+"-math-group":"[class*=-math-group]")&&n.select(e.node().parentNode).select(a).style({opacity:0})}function s(e){var t=e.node(),r=document.createRange();r.selectNodeContents(t);var n=window.getSelection();n.removeAllRanges(),n.addRange(r),t.focus()}return t.immediate?l():o.on("click",l),n.rebind(e,i,"on")}},{"../constants/alignment":125,"../constants/xmlns_namespaces":129,"../lib":148,d3:2}],170:[function(e,t,r){"use strict";var n={};function a(e){e&&null!==e.timer&&(clearTimeout(e.timer),e.timer=null)}r.throttle=function(e,t,r){var i=n[e],o=Date.now();if(!i){for(var l in n)n[l].ts<o-6e4&&delete n[l];i=n[e]={ts:0,timer:null}}function s(){r(),i.ts=Date.now(),i.onDone&&(i.onDone(),i.onDone=null)}a(i),o>i.ts+t?s():i.timer=setTimeout(function(){s(),i.timer=null},t)},r.done=function(e){var t=n[e];return t&&t.timer?new Promise(function(e){var r=t.onDone;t.onDone=function(){r&&r(),e(),t.onDone=null}}):Promise.resolve()},r.clear=function(e){if(e)a(n[e]),delete n[e];else for(var t in n)r.clear(t)}},{}],171:[function(e,t,r){"use strict";var n=e("fast-isnumeric");t.exports=function(e,t){if(e>0)return Math.log(e)/Math.LN10;var r=Math.log(Math.min(t[0],t[1]))/Math.LN10;return n(r)||(r=Math.log(Math.max(t[0],t[1]))/Math.LN10-6),r}},{"fast-isnumeric":4}],172:[function(e,t,r){"use strict";t.exports={moduleType:"locale",name:"en-US",dictionary:{"Click to enter Colorscale title":"Click to enter Colorscale title"},format:{date:"%m/%d/%Y"}}},{}],173:[function(e,t,r){"use strict";t.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"}}},{}],174:[function(e,t,r){"use strict";var n=e("../registry");t.exports=function(e){for(var t,r,a=n.layoutArrayContainers,i=n.layoutArrayRegexes,o=e.split("[")[0],l=0;l<i.length;l++)if((r=e.match(i[l]))&&0===r.index){t=r[0];break}if(t||(t=a[a.indexOf(o)]),!t)return!1;var s=e.substr(t.length);return s?!!(r=s.match(/^\[(0|[1-9][0-9]*)\](\.(.+))?$/))&&{array:t,index:Number(r[1]),property:r[3]||""}:{array:t,index:"",property:""}}},{"../registry":232}],175:[function(e,t,r){"use strict";var n=e("../lib"),a=n.extendFlat,i=n.isPlainObject,o={valType:"flaglist",extras:["none"],flags:["calc","clearAxisTypes","plot","style","markerSize","colorbars"]},l={valType:"flaglist",extras:["none"],flags:["calc","plot","legend","ticks","axrange","layoutstyle","modebar","camera","arraydraw","colorbars"]},s=o.flags.slice().concat(["fullReplot"]),c=l.flags.slice().concat("layoutReplot");function u(e){for(var t={},r=0;r<e.length;r++)t[e[r]]=!1;return t}function f(e,t,r){var n=a({},e);for(var o in n){var l=n[o];i(l)&&(n[o]=d(l,t,r,o))}return"from-root"===r&&(n.editType=t),n}function d(e,t,r,n){if(e.valType){var i=a({},e);if(i.editType=t,Array.isArray(e.items)){i.items=new Array(e.items.length);for(var o=0;o<e.items.length;o++)i.items[o]=d(e.items[o],t,"from-root")}return i}return f(e,t,"_"===n.charAt(0)?"nested":"from-root")}t.exports={traces:o,layout:l,traceFlags:function(){return u(s)},layoutFlags:function(){return u(c)},update:function(e,t){var r=t.editType;if(r&&"none"!==r)for(var n=r.split("+"),a=0;a<n.length;a++)e[n[a]]=!0},overrideAll:f}},{"../lib":148}],176:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("gl-mat4/fromQuat"),i=e("../registry"),o=e("../lib"),l=e("../plots/plots"),s=e("../plots/cartesian/axis_ids"),c=e("../components/color"),u=s.cleanId,f=s.getFromTrace,d=i.traceIs;function p(e,t){var r=e[t],n=t.charAt(0);r&&"paper"!==r&&(e[t]=u(r,n))}function h(e){function t(t,r){var n=e[t],a=e.title&&e.title[r];n&&!a&&(e.title||(e.title={}),e.title[r]=e[t],delete e[t])}e&&("string"!=typeof e.title&&"number"!=typeof e.title||(e.title={text:e.title}),t("titlefont","font"),t("titleposition","position"),t("titleside","side"),t("titleoffset","offset"))}function g(e){if(!o.isPlainObject(e))return!1;var t=e.name;return delete e.name,delete e.showlegend,("string"==typeof t||"number"==typeof t)&&String(t)}function v(e,t,r,n){if(r&&!n)return e;if(n&&!r)return t;if(!e.trim())return t;if(!t.trim())return e;var a,i=Math.min(e.length,t.length);for(a=0;a<i&&e.charAt(a)===t.charAt(a);a++);return e.substr(0,a).trim()}function m(e){var t="middle",r="center";return"string"==typeof e&&(-1!==e.indexOf("top")?t="top":-1!==e.indexOf("bottom")&&(t="bottom"),-1!==e.indexOf("left")?r="left":-1!==e.indexOf("right")&&(r="right")),t+" "+r}function y(e,t){return t in e&&"object"==typeof e[t]&&0===Object.keys(e[t]).length}r.clearPromiseQueue=function(e){Array.isArray(e._promises)&&e._promises.length>0&&o.log("Clearing previous rejected promises from queue."),e._promises=[]},r.cleanLayout=function(e){var t,n;e||(e={}),e.xaxis1&&(e.xaxis||(e.xaxis=e.xaxis1),delete e.xaxis1),e.yaxis1&&(e.yaxis||(e.yaxis=e.yaxis1),delete e.yaxis1),e.scene1&&(e.scene||(e.scene=e.scene1),delete e.scene1);var i=(l.subplotsRegistry.cartesian||{}).attrRegex,s=(l.subplotsRegistry.polar||{}).attrRegex,f=(l.subplotsRegistry.ternary||{}).attrRegex,d=(l.subplotsRegistry.gl3d||{}).attrRegex,g=Object.keys(e);for(t=0;t<g.length;t++){var v=g[t];if(i&&i.test(v)){var m=e[v];m.anchor&&"free"!==m.anchor&&(m.anchor=u(m.anchor)),m.overlaying&&(m.overlaying=u(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),h(m)}else if(s&&s.test(v)){h(e[v].radialaxis)}else if(f&&f.test(v)){var x=e[v];h(x.aaxis),h(x.baxis),h(x.caxis)}else if(d&&d.test(v)){var b=e[v],_=b.cameraposition;if(Array.isArray(_)&&4===_[0].length){var w=_[0],k=_[1],T=_[2],M=a([],w),A=[];for(n=0;n<3;++n)A[n]=k[n]+T*M[2+4*n];b.camera={eye:{x:A[0],y:A[1],z:A[2]},center:{x:k[0],y:k[1],z:k[2]},up:{x:0,y:0,z:1}},delete b.cameraposition}h(b.xaxis),h(b.yaxis),h(b.zaxis)}}var L=Array.isArray(e.annotations)?e.annotations.length:0;for(t=0;t<L;t++){var S=e.annotations[t];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),p(S,"xref"),p(S,"yref"))}var C=Array.isArray(e.shapes)?e.shapes.length:0;for(t=0;t<C;t++){var O=e.shapes[t];o.isPlainObject(O)&&(p(O,"xref"),p(O,"yref"))}var P=e.legend;return P&&(P.x>3?(P.x=1.02,P.xanchor="left"):P.x<-2&&(P.x=-.02,P.xanchor="right"),P.y>3?(P.y=1.02,P.yanchor="bottom"):P.y<-2&&(P.y=-.02,P.yanchor="top")),h(e),"rotate"===e.dragmode&&(e.dragmode="orbit"),c.clean(e),e.template&&e.template.layout&&r.cleanLayout(e.template.layout),e},r.cleanData=function(e){for(var t=0;t<e.length;t++){var n,a=e[t];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 s=c.defaults,f=a.error_y.color||(d(a,"bar")?c.defaultLine:s[t%s.length]);a.error_y.color=c.addOpacity(c.rgb(f),c.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=u(a.xaxis,"x")),a.yaxis&&(a.yaxis=u(a.yaxis,"y")),d(a,"gl3d")&&a.scene&&(a.scene=l.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 p=i.getModule(a);if(p&&p.colorbar){var x=p.colorbar.container,b=x?a[x]:a;b&&b.colorscale&&("YIGnBu"===b.colorscale&&(b.colorscale="YlGnBu"),"YIOrRd"===b.colorscale&&(b.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 k=!1!==(a.increasing||{}).showlegend,T=!1!==(a.decreasing||{}).showlegend,M=g(a.increasing),A=g(a.decreasing);if(!1!==M&&!1!==A){var L=v(M,A,k,T);L&&(a.name=L)}else!M&&!A||a.name||(a.name=M||A)}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 O=C.styles,P=Object.keys(O);C.styles=[];for(var D=0;D<P.length;D++)C.styles.push({target:P[D],value:O[P[D]]})}}}}y(a,"line")&&delete a.line,"marker"in a&&(y(a.marker,"line")&&delete a.marker.line,y(a,"marker")&&delete a.marker),c.clean(a),a.autobinx&&(delete a.autobinx,delete a.xbins),a.autobiny&&(delete a.autobiny,delete a.ybins),h(a),a.colorbar&&h(a.colorbar),a.marker&&a.marker.colorbar&&h(a.marker.colorbar),a.line&&a.line.colorbar&&h(a.line.colorbar),a.aaxis&&h(a.aaxis),a.baxis&&h(a.baxis)}},r.swapXYData=function(e){var t;if(o.swapAttrs(e,["?","?0","d?","?bins","nbins?","autobin?","?src","error_?"]),Array.isArray(e.z)&&Array.isArray(e.z[0])&&(e.transpose?delete e.transpose:e.transpose=!0),e.error_x&&e.error_y){var r=e.error_y,n="copy_ystyle"in r?r.copy_ystyle:!(r.color||r.thickness||r.width);o.swapAttrs(e,["error_?.copy_ystyle"]),n&&o.swapAttrs(e,["error_?.color","error_?.thickness","error_?.width"])}if("string"==typeof e.hoverinfo){var a=e.hoverinfo.split("+");for(t=0;t<a.length;t++)"x"===a[t]?a[t]="y":"y"===a[t]&&(a[t]="x");e.hoverinfo=a.join("+")}},r.coerceTraceIndices=function(e,t){if(n(t))return[t];if(!Array.isArray(t)||!t.length)return e.data.map(function(e,t){return t});if(Array.isArray(t)){for(var r=[],a=0;a<t.length;a++)o.isIndex(t[a],e.data.length)?r.push(t[a]):o.warn("trace index (",t[a],") is not a number or is out of bounds");return r}return t},r.manageArrayContainers=function(e,t,r){var a=e.obj,i=e.parts,l=i.length,s=i[l-1],c=n(s);if(c&&null===t){var u=i.slice(0,l-1).join(".");o.nestedProperty(a,u).get().splice(s,1)}else c&&void 0===e.get()?(void 0===e.get()&&(r[e.astr]=null),e.set(t)):e.set(t)};var x=/(\.[^\[\]\.]+|\[[^\[\]\.]+\])$/;function b(e){var t=e.search(x);if(t>0)return e.substr(0,t)}r.hasParent=function(e,t){for(var r=b(t);r;){if(r in e)return!0;r=b(r)}return!1};var _=["x","y","z"];r.clearAxisTypes=function(e,t,r){for(var n=0;n<t.length;n++)for(var a=e._fullData[n],i=0;i<3;i++){var l=f(e,a,_[i]);if(l&&"log"!==l.type){var s=l._name,c=l._id.substr(1);if("scene"===c.substr(0,5)){if(void 0!==r[c])continue;s=c+"."+s}var u=s+".type";void 0===r[s]&&void 0===r[u]&&o.nestedProperty(e.layout,u).set(null)}}}},{"../components/color":30,"../lib":148,"../plots/cartesian/axis_ids":195,"../plots/plots":224,"../registry":232,"fast-isnumeric":4,"gl-mat4/fromQuat":5}],177:[function(e,t,r){"use strict";var n=e("./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=e("./to_image"),r.validate=e("./validate"),r.downloadImage=e("../snapshot/download");var a=e("./template_api");r.makeTemplate=a.makeTemplate,r.validateTemplate=a.validateTemplate},{"../snapshot/download":234,"./plot_api":179,"./template_api":184,"./to_image":185,"./validate":186}],178:[function(e,t,r){"use strict";var n=e("../lib/is_plain_object"),a=e("../lib/noop"),i=e("../lib/loggers"),o=e("../lib/search").sorterAsc,l=e("../registry");r.containerArrayMatch=e("./container_array_match");var s=r.isAddVal=function(e){return"add"===e||n(e)},c=r.isRemoveVal=function(e){return null===e||"remove"===e};r.applyContainerArrayChanges=function(e,t,r,n,u){var f=t.astr,d=l.getComponentMethod(f,"supplyLayoutDefaults"),p=l.getComponentMethod(f,"draw"),h=l.getComponentMethod(f,"drawOne"),g=n.replot||n.recalc||d===a||p===a,v=e.layout,m=e._fullLayout;if(r[""]){Object.keys(r).length>1&&i.warn("Full array edits are incompatible with other edits",f);var y=r[""][""];if(c(y))t.set(null);else{if(!Array.isArray(y))return i.warn("Unrecognized full array edit value",f,y),!0;t.set(y)}return!g&&(d(v,m),p(e),!0)}var x,b,_,w,k,T,M,A,L=Object.keys(r).map(Number).sort(o),S=t.get(),C=S||[],O=u(m,f).get(),P=[],D=-1,z=C.length;for(x=0;x<L.length;x++)if(w=r[_=L[x]],k=Object.keys(w),T=w[""],M=s(T),_<0||_>C.length-(M?0:1))i.warn("index out of range",f,_);else if(void 0!==T)k.length>1&&i.warn("Insertion & removal are incompatible with edits to the same index.",f,_),c(T)?P.push(_):M?("add"===T&&(T={}),C.splice(_,0,T),O&&O.splice(_,0,{})):i.warn("Unrecognized full object edit value",f,_,T),-1===D&&(D=_);else for(b=0;b<k.length;b++)A=f+"["+_+"].",u(C[_],k[b],A).set(w[k[b]]);for(x=P.length-1;x>=0;x--)C.splice(P[x],1),O&&O.splice(P[x],1);if(C.length?S||t.set(C):t.set(null),g)return!1;if(d(v,m),h!==a){var R;if(-1===D)R=L;else{for(z=Math.max(C.length,z),R=[],x=0;x<L.length&&!((_=L[x])>=D);x++)R.push(_);for(x=D;x<z;x++)R.push(x)}for(x=0;x<R.length;x++)h(e,R[x])}else p(e);return!0}},{"../lib/is_plain_object":149,"../lib/loggers":152,"../lib/noop":157,"../lib/search":166,"../registry":232,"./container_array_match":174}],179:[function(e,t,r){"use strict";var n=e("d3"),a=e("fast-isnumeric"),i=e("has-hover"),o=e("../lib"),l=o.nestedProperty,s=e("../lib/events"),c=e("../lib/queue"),u=e("../registry"),f=e("./plot_schema"),d=e("../plots/plots"),p=e("../plots/polar/legacy"),h=e("../plots/cartesian/axes"),g=e("../components/drawing"),v=e("../components/color"),m=e("../plots/cartesian/graph_interact").initInteractions,y=e("../constants/xmlns_namespaces"),x=e("../lib/svg_text_utils"),b=e("../plots/cartesian/select").clearSelect,_=e("./plot_config").dfltConfig,w=e("./manage_arrays"),k=e("./helpers"),T=e("./subroutines"),M=e("./edit_types"),A=e("../plots/cartesian/constants").AX_NAME_PATTERN,L=0,S=5;function C(e){var t=e._fullLayout;t._redrawFromAutoMarginCount?t._redrawFromAutoMarginCount--:e.emit("plotly_afterplot")}function O(e,t){try{e._fullLayout._paper.style("background",t)}catch(e){o.error(e)}}function P(e,t){O(e,v.combine(t,"white"))}function D(e,t){if(!e._context){e._context=o.extendDeep({},_);var r=n.select("base");e._context._baseUrl=r.size()&&r.attr("href")?window.location.href.split("#")[0]:""}var a,l,s,c=e._context;if(t){for(l=Object.keys(t),a=0;a<l.length;a++)"editable"!==(s=l[a])&&"edits"!==s&&s in c&&("setBackground"===s&&"opaque"===t[s]?c[s]=P:c[s]=t[s]);t.plot3dPixelRatio&&!c.plotGlPixelRatio&&(c.plotGlPixelRatio=c.plot3dPixelRatio);var u=t.editable;if(void 0!==u)for(c.editable=u,l=Object.keys(c.edits),a=0;a<l.length;a++)c.edits[l[a]]=u;if(t.edits)for(l=Object.keys(t.edits),a=0;a<l.length;a++)(s=l[a])in c.edits&&(c.edits[s]=t.edits[s]);c._exportedPlot=t._exportedPlot}c.staticPlot&&(c.editable=!1,c.edits={},c.autosizable=!1,c.scrollZoom=!1,c.doubleClick=!1,c.showTips=!1,c.showLink=!1,c.displayModeBar=!1),"hover"!==c.displayModeBar||i||(c.displayModeBar=!0),"transparent"!==c.setBackground&&"function"==typeof c.setBackground||(c.setBackground=O),c._hasZeroHeight=c._hasZeroHeight||0===e.clientHeight,c._hasZeroWidth=c._hasZeroWidth||0===e.clientWidth;var f=c.scrollZoom,d=c._scrollZoom={};if(!0===f)d.cartesian=1,d.gl3d=1,d.geo=1,d.mapbox=1;else if("string"==typeof f){var p=f.split("+");for(a=0;a<p.length;a++)d[p[a]]=1}else!1!==f&&(d.gl3d=1,d.geo=1,d.mapbox=1)}function z(e,t){var r,n,a=t+1,i=[];for(r=0;r<e.length;r++)(n=e[r])<0?i.push(a+n):i.push(n);return i}function R(e,t,r){var n,a;for(n=0;n<t.length;n++){if((a=t[n])!==parseInt(a,10))throw new Error("all values in "+r+" must be integers");if(a>=e.data.length||a<-e.data.length)throw new Error(r+" must be valid indices for gd.data.");if(t.indexOf(a,n+1)>-1||a>=0&&t.indexOf(-e.data.length+a)>-1||a<0&&t.indexOf(e.data.length+a)>-1)throw new Error("each index in "+r+" must be unique.")}}function E(e,t,r){if(!Array.isArray(e.data))throw new Error("gd.data must be an array.");if(void 0===t)throw new Error("currentIndices is a required argument.");if(Array.isArray(t)||(t=[t]),R(e,t,"currentIndices"),void 0===r||Array.isArray(r)||(r=[r]),void 0!==r&&R(e,r,"newIndices"),void 0!==r&&t.length!==r.length)throw new Error("current and new indices must be of equal length.")}function I(e,t,r,n,i){!function(e,t,r,n){var a=o.isPlainObject(n);if(!Array.isArray(e.data))throw new Error("gd.data must be an array");if(!o.isPlainObject(t))throw new Error("update must be a key:value object");if(void 0===r)throw new Error("indices must be an integer or array of integers");for(var i in R(e,r,"indices"),t){if(!Array.isArray(t[i])||t[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!==t[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")}}(e,t,r,n);for(var s=function(e,t,r,n){var i,s,c,u,f,d=o.isPlainObject(n),p=[];for(var h in Array.isArray(r)||(r=[r]),r=z(r,e.data.length-1),t)for(var g=0;g<r.length;g++){if(i=e.data[r[g]],s=(c=l(i,h)).get(),u=t[h][g],!o.isArrayOrTypedArray(u))throw new Error("attribute: "+h+" index: "+g+" must be an array");if(!o.isArrayOrTypedArray(s))throw new Error("cannot extend missing or non-array attribute: "+h);if(s.constructor!==u.constructor)throw new Error("cannot extend array with an array of a different type: "+h);f=d?n[h][g]:n,a(f)||(f=-1),p.push({prop:c,target:s,insert:u,maxp:Math.floor(f)})}return p}(e,t,r,n),c={},u={},f=0;f<s.length;f++){var d=s[f].prop,p=s[f].maxp,h=i(s[f].target,s[f].insert,p);d.set(h[0]),Array.isArray(c[d.astr])||(c[d.astr]=[]),c[d.astr].push(h[1]),Array.isArray(u[d.astr])||(u[d.astr]=[]),u[d.astr].push(s[f].target.length)}return{update:c,maxPoints:u}}function F(e,t){var r=new e.constructor(e.length+t.length);return r.set(e),r.set(t,e.length),r}function N(e,t,n,a){e=o.getGraphDiv(e),k.clearPromiseQueue(e);var i={};if("string"==typeof t)i[t]=n;else{if(!o.isPlainObject(t))return o.warn("Restyle fail.",t,n,a),Promise.reject();i=o.extendFlat({},t),void 0===a&&(a=n)}Object.keys(i).length&&(e.changed=!0);var l=k.coerceTraceIndices(e,a),s=q(e,i,l),u=s.flags;u.calc&&(e.calcdata=void 0),u.clearAxisTypes&&k.clearAxisTypes(e,l,{});var f=[];u.fullReplot?f.push(r.plot):(f.push(d.previousPromises),d.supplyDefaults(e),u.markerSize&&(d.doCalcdata(e),Z(f)),u.style&&f.push(T.doTraceStyle),u.colorbars&&f.push(T.doColorBars),f.push(C)),f.push(d.rehover,d.redrag),c.add(e,N,[e,s.undoit,s.traces],N,[e,s.redoit,s.traces]);var p=o.syncOrAsync(f,e);return p&&p.then||(p=Promise.resolve()),p.then(function(){return e.emit("plotly_restyle",s.eventData),e})}function j(e){return void 0===e?null:e}function B(e,t){return t?function(t,r,n){var a=l(t,r),i=a.set;return a.set=function(t){H((n||"")+r,a.get(),t,e),i(t)},a}:l}function H(e,t,r,n){if(Array.isArray(t)||Array.isArray(r))for(var a=Array.isArray(t)?t:[],i=Array.isArray(r)?r:[],l=Math.max(a.length,i.length),s=0;s<l;s++)H(e+"["+s+"]",a[s],i[s],n);else if(o.isPlainObject(t)||o.isPlainObject(r)){var c=o.isPlainObject(t)?t:{},u=o.isPlainObject(r)?r:{},f=o.extendFlat({},c,u);for(var d in f)H(e+"."+d,c[d],u[d],n)}else void 0===n[e]&&(n[e]=j(t))}function q(e,t,r){var n,a=e._fullLayout,i=e._fullData,s=e.data,c=a._guiEditing,p=B(a._preGUI,c),g=o.extendDeepAll({},t);V(t);var v,m=M.traceFlags(),y={},x={};function b(){return r.map(function(){})}function _(e){var t=h.id2name(e);-1===v.indexOf(t)&&v.push(t)}function w(e){return"LAYOUT"+e+".autorange"}function T(e){return"LAYOUT"+e+".range"}function A(e){for(var t=e;t<i.length;t++)if(i[t]._input===s[e])return i[t]}function L(n,i,o){if(Array.isArray(n))n.forEach(function(e){L(e,i,o)});else if(!(n in t||k.hasParent(t,n))){var l;if("LAYOUT"===n.substr(0,6))l=p(e.layout,n.replace("LAYOUT",""));else{var u=r[o];l=B(a._tracePreGUI[A(u)._fullInput.uid],c)(s[u],n)}n in x||(x[n]=b()),void 0===x[n][o]&&(x[n][o]=j(l.get())),void 0!==i&&l.set(i)}}function S(e){return function(t){return i[t][e]}}function C(e){return function(t,n){return!1===t?i[r[n]][e]:null}}for(var O in t){if(k.hasParent(t,O))throw new Error("cannot set "+O+" and a parent attribute simultaneously");var P,D,z,R,E,I,F=t[O];if("autobinx"!==O&&"autobiny"!==O||(O=O.charAt(O.length-1)+"bins",F=Array.isArray(F)?F.map(C(O)):!1===F?r.map(S(O)):null),y[O]=F,"LAYOUT"!==O.substr(0,6)){for(x[O]=b(),n=0;n<r.length;n++){if(P=s[r[n]],D=A(r[n]),R=(z=B(a._tracePreGUI[D._fullInput.uid],c)(P,O)).get(),void 0!==(E=Array.isArray(F)?F[n%F.length]:F)){var N=z.parts[z.parts.length-1],H=O.substr(0,O.length-N.length-1),q=H?H+".":"",U=H?l(D,H).get():D;if((I=f.getTraceValObject(D,z.parts))&&I.impliedEdits&&null!==E)for(var G in I.impliedEdits)L(o.relativeAttr(O,G),I.impliedEdits[G],n);else if("thicknessmode"!==N&&"lenmode"!==N||R===E||"fraction"!==E&&"pixels"!==E||!U){if("type"===O&&("pie"===E!=("pie"===R)||"funnelarea"===E!=("funnelarea"===R))){var Z="x",Y="y";"bar"!==E&&"bar"!==R||"h"!==P.orientation||(Z="y",Y="x"),o.swapAttrs(P,["?","?src"],"labels",Z),o.swapAttrs(P,["d?","?0"],"label",Z),o.swapAttrs(P,["?","?src"],"values",Y),"pie"===R||"funnelarea"===R?(l(P,"marker.color").set(l(P,"marker.colors").get()),a._pielayer.selectAll("g.trace").remove()):u.traceIs(P,"cartesian")&&l(P,"marker.colors").set(l(P,"marker.color").get())}}else{var X=a._size,W=U.orient,$="top"===W||"bottom"===W;if("thicknessmode"===N){var J=$?X.h:X.w;L(q+"thickness",U.thickness*("fraction"===E?1/J:J),n)}else{var Q=$?X.w:X.h;L(q+"len",U.len*("fraction"===E?1/Q:Q),n)}}x[O][n]=j(R);if(-1!==["swapxy","swapxyaxes","orientation","orientationaxes"].indexOf(O)){if("orientation"===O){z.set(E);var K=P.x&&!P.y?"h":"v";if((z.get()||K)===D.orientation)continue}else"orientationaxes"===O&&(P.orientation={v:"h",h:"v"}[D.orientation]);k.swapXYData(P),m.calc=m.clearAxisTypes=!0}else-1!==d.dataArrayContainers.indexOf(z.parts[0])?(k.manageArrayContainers(z,E,x),m.calc=!0):(I?I.arrayOk&&!u.traceIs(D,"regl")&&(o.isArrayOrTypedArray(E)||o.isArrayOrTypedArray(R))?m.calc=!0:M.update(m,I):m.calc=!0,z.set(E))}}if(-1!==["swapxyaxes","orientationaxes"].indexOf(O)&&h.swap(e,r),"orientationaxes"===O){var ee=l(e.layout,"hovermode");"x"===ee.get()?ee.set("y"):"y"===ee.get()?ee.set("x"):"x unified"===ee.get()?ee.set("y unified"):"y unified"===ee.get()&&ee.set("x unified")}if(-1!==["orientation","type"].indexOf(O)){for(v=[],n=0;n<r.length;n++){var te=s[r[n]];u.traceIs(te,"cartesian")&&(_(te.xaxis||"x"),_(te.yaxis||"y"))}L(v.map(w),!0,0),L(v.map(T),[0,1],0)}}else z=p(e.layout,O.replace("LAYOUT","")),x[O]=[j(z.get())],z.set(Array.isArray(F)?F[0]:F),m.calc=!0}return(m.calc||m.plot)&&(m.fullReplot=!0),{flags:m,undoit:x,redoit:y,traces:r,eventData:o.extendDeepNoArrays([],[g,r])}}function V(e){var t,r,n,a=o.counterRegex("axis",".title",!1,!1),i=/colorbar\.title$/,l=Object.keys(e);for(t=0;t<l.length;t++)r=l[t],n=e[r],"title"!==r&&!a.test(r)&&!i.test(r)||"string"!=typeof n&&"number"!=typeof n?r.indexOf("titlefont")>-1?s(r,r.replace("titlefont","title.font")):r.indexOf("titleposition")>-1?s(r,r.replace("titleposition","title.position")):r.indexOf("titleside")>-1?s(r,r.replace("titleside","title.side")):r.indexOf("titleoffset")>-1&&s(r,r.replace("titleoffset","title.offset")):s(r,r.replace("title","title.text"));function s(t,r){e[r]=e[t],delete e[t]}}function U(e,t,r){if(e=o.getGraphDiv(e),k.clearPromiseQueue(e),e.framework&&e.framework.isPolar)return Promise.resolve(e);var n={};if("string"==typeof t)n[t]=r;else{if(!o.isPlainObject(t))return o.warn("Relayout fail.",t,r),Promise.reject();n=o.extendFlat({},t)}Object.keys(n).length&&(e.changed=!0);var a=$(e,n),i=a.flags;i.calc&&(e.calcdata=void 0);var l=[d.previousPromises];i.layoutReplot?l.push(T.layoutReplot):Object.keys(n).length&&(G(e,i,a)||d.supplyDefaults(e),i.legend&&l.push(T.doLegend),i.layoutstyle&&l.push(T.layoutStyles),i.axrange&&Z(l,a.rangesAltered),i.ticks&&l.push(T.doTicksRelayout),i.modebar&&l.push(T.doModeBar),i.camera&&l.push(T.doCamera),i.colorbars&&l.push(T.doColorBars),l.push(C)),l.push(d.rehover,d.redrag),c.add(e,U,[e,a.undoit],U,[e,a.redoit]);var s=o.syncOrAsync(l,e);return s&&s.then||(s=Promise.resolve(e)),s.then(function(){return e.emit("plotly_relayout",a.eventData),e})}function G(e,t,r){var n=e._fullLayout;if(!t.axrange)return!1;for(var a in t)if("axrange"!==a&&t[a])return!1;for(var i in r.rangesAltered){var o=h.id2name(i),l=e.layout[o],s=n[o];if(s.autorange=l.autorange,s.range=l.range.slice(),s.cleanRange(),s._matchGroup)for(var c in s._matchGroup)if(c!==i){var u=n[h.id2name(c)];u.autorange=s.autorange,u.range=s.range.slice(),u._input.range=s.range.slice()}}return!0}function Z(e,t){var r=t?function(e){var r=[],n=!0;for(var a in t){var i=h.getFromId(e,a);if(r.push(a),i._matchGroup)for(var o in i._matchGroup)t[o]||r.push(o);i.automargin&&(n=!1)}return h.draw(e,r,{skipTitle:n})}:function(e){return h.draw(e,"redraw")};e.push(b,T.doAutoRangeAndConstraints,r,T.drawData,T.finalDraw)}var Y=/^[xyz]axis[0-9]*\.range(\[[0|1]\])?$/,X=/^[xyz]axis[0-9]*\.autorange$/,W=/^[xyz]axis[0-9]*\.domain(\[[0|1]\])?$/;function $(e,t){var r,n,a,i=e.layout,s=e._fullLayout,c=s._guiEditing,d=B(s._preGUI,c),p=Object.keys(t),g=h.list(e),v=o.extendDeepAll({},t),m={};for(V(t),p=Object.keys(t),n=0;n<p.length;n++)if(0===p[n].indexOf("allaxes")){for(a=0;a<g.length;a++){var y=g[a]._id.substr(1),x=-1!==y.indexOf("scene")?y+".":"",b=p[n].replace("allaxes",x+g[a]._name);t[b]||(t[b]=t[p[n]])}delete t[p[n]]}var _=M.layoutFlags(),T={},L={};function S(e,r){if(Array.isArray(e))e.forEach(function(e){S(e,r)});else if(!(e in t||k.hasParent(t,e))){var n=d(i,e);e in L||(L[e]=j(n.get())),void 0!==r&&n.set(r)}}var C,O={};function P(e){var t=h.name2id(e.split(".")[0]);return O[t]=1,t}for(var D in t){if(k.hasParent(t,D))throw new Error("cannot set "+D+" and a parent attribute simultaneously");for(var z=d(i,D),R=t[D],E=z.parts.length-1;E>0&&"string"!=typeof z.parts[E];)E--;var I=z.parts[E],F=z.parts[E-1]+"."+I,N=z.parts.slice(0,E).join("."),H=l(e.layout,N).get(),q=l(s,N).get(),U=z.get();if(void 0!==R){T[D]=R,L[D]="reverse"===I?R:j(U);var G=f.getLayoutValObject(s,z.parts);if(G&&G.impliedEdits&&null!==R)for(var Z in G.impliedEdits)S(o.relativeAttr(D,Z),G.impliedEdits[Z]);if(-1!==["width","height"].indexOf(D))if(R){S("autosize",null);var $="height"===D?"width":"height";S($,s[$])}else s[D]=e._initialAutoSize[D];else if("autosize"===D)S("width",R?null:s.width),S("height",R?null:s.height);else if(F.match(Y))P(F),l(s,N+"._inputRange").set(null);else if(F.match(X)){P(F),l(s,N+"._inputRange").set(null);var Q=l(s,N).get();Q._inputDomain&&(Q._input.domain=Q._inputDomain.slice())}else F.match(W)&&l(s,N+"._inputDomain").set(null);if("type"===I){var K=H,ee="linear"===q.type&&"log"===R,te="log"===q.type&&"linear"===R;if(ee||te){if(K&&K.range)if(q.autorange)ee&&(K.range=K.range[1]>K.range[0]?[1,2]:[2,1]);else{var re=K.range[0],ne=K.range[1];ee?(re<=0&&ne<=0&&S(N+".autorange",!0),re<=0?re=ne/1e6:ne<=0&&(ne=re/1e6),S(N+".range[0]",Math.log(re)/Math.LN10),S(N+".range[1]",Math.log(ne)/Math.LN10)):(S(N+".range[0]",Math.pow(10,re)),S(N+".range[1]",Math.pow(10,ne)))}else S(N+".autorange",!0);Array.isArray(s._subplots.polar)&&s._subplots.polar.length&&s[z.parts[0]]&&"radialaxis"===z.parts[1]&&delete s[z.parts[0]]._subplot.viewInitial["radialaxis.range"],u.getComponentMethod("annotations","convertCoords")(e,q,R,S),u.getComponentMethod("images","convertCoords")(e,q,R,S)}else S(N+".autorange",!0),S(N+".range",null);l(s,N+"._inputRange").set(null)}else if(I.match(A)){var ae=l(s,D).get(),ie=(R||{}).type;ie&&"-"!==ie||(ie="linear"),u.getComponentMethod("annotations","convertCoords")(e,ae,ie,S),u.getComponentMethod("images","convertCoords")(e,ae,ie,S)}var oe=w.containerArrayMatch(D);if(oe){r=oe.array,n=oe.index;var le=oe.property,se=G||{editType:"calc"};""!==n&&""===le&&(w.isAddVal(R)?L[D]=null:w.isRemoveVal(R)?L[D]=(l(i,r).get()||[])[n]:o.warn("unrecognized full object value",t)),M.update(_,se),m[r]||(m[r]={});var ce=m[r][n];ce||(ce=m[r][n]={}),ce[le]=R,delete t[D]}else"reverse"===I?(H.range?H.range.reverse():(S(N+".autorange",!0),H.range=[1,0]),q.autorange?_.calc=!0:_.plot=!0):(s._has("scatter-like")&&s._has("regl")&&"dragmode"===D&&("lasso"===R||"select"===R)&&"lasso"!==U&&"select"!==U?_.plot=!0:s._has("gl2d")?_.plot=!0:G?M.update(_,G):_.calc=!0,z.set(R))}}for(r in m){w.applyContainerArrayChanges(e,d(i,r),m[r],_,d)||(_.plot=!0)}var ue=s._axisConstraintGroups||[];for(C in O)for(n=0;n<ue.length;n++){var fe=ue[n];if(fe[C])for(var de in _.calc=!0,fe)O[de]||(h.getFromId(e,de)._constraintShrinkable=!0)}return(J(e)||t.height||t.width)&&(_.plot=!0),(_.plot||_.calc)&&(_.layoutReplot=!0),{flags:_,rangesAltered:O,undoit:L,redoit:T,eventData:v}}function J(e){var t=e._fullLayout,r=t.width,n=t.height;return e.layout.autosize&&d.plotAutoSize(e,e.layout,t),t.width!==r||t.height!==n}function Q(e,t,n,a){if(e=o.getGraphDiv(e),k.clearPromiseQueue(e),e.framework&&e.framework.isPolar)return Promise.resolve(e);o.isPlainObject(t)||(t={}),o.isPlainObject(n)||(n={}),Object.keys(t).length&&(e.changed=!0),Object.keys(n).length&&(e.changed=!0);var i=k.coerceTraceIndices(e,a),l=q(e,o.extendFlat({},t),i),s=l.flags,u=$(e,o.extendFlat({},n)),f=u.flags;(s.calc||f.calc)&&(e.calcdata=void 0),s.clearAxisTypes&&k.clearAxisTypes(e,i,n);var p=[];f.layoutReplot?p.push(T.layoutReplot):s.fullReplot?p.push(r.plot):(p.push(d.previousPromises),G(e,f,u)||d.supplyDefaults(e),s.style&&p.push(T.doTraceStyle),(s.colorbars||f.colorbars)&&p.push(T.doColorBars),f.legend&&p.push(T.doLegend),f.layoutstyle&&p.push(T.layoutStyles),f.axrange&&Z(p,u.rangesAltered),f.ticks&&p.push(T.doTicksRelayout),f.modebar&&p.push(T.doModeBar),f.camera&&p.push(T.doCamera),p.push(C)),p.push(d.rehover,d.redrag),c.add(e,Q,[e,l.undoit,u.undoit,l.traces],Q,[e,l.redoit,u.redoit,l.traces]);var h=o.syncOrAsync(p,e);return h&&h.then||(h=Promise.resolve(e)),h.then(function(){return e.emit("plotly_update",{data:l.eventData,layout:u.eventData}),e})}function K(e){return function(t){t._fullLayout._guiEditing=!0;var r=e.apply(null,arguments);return t._fullLayout._guiEditing=!1,r}}var ee=[{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"}],te=[{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 re(e,t){for(var r=0;r<t.length;r++){var n=t[r],a=e.match(n.pattern);if(a)return{head:a[1],attr:n.attr}}}function ne(e,t){var r=l(t,e).get();if(void 0!==r)return r;var n=e.split(".");for(n.pop();n.length>1;)if(n.pop(),void 0!==(r=l(t,n.join(".")+".uirevision").get()))return r;return t.uirevision}function ae(e,t){for(var r=0;r<t.length;r++)if(t[r]._fullInput.uid===e)return r;return-1}function ie(e,t,r){for(var n=0;n<t.length;n++)if(t[n].uid===e)return n;return!t[r]||t[r].uid?-1:r}function oe(e,t){var r=o.isPlainObject(e),n=Array.isArray(e);return r||n?(r&&o.isPlainObject(t)||n&&Array.isArray(t))&&JSON.stringify(e)===JSON.stringify(t):e===t}function le(e,t,r,n){var a,i,s,c=n.getValObject,u=n.flags,f=n.immutable,d=n.inArray,p=n.arrayIndex;function h(){var e=a.editType;d&&-1!==e.indexOf("arraydraw")?o.pushUnique(u.arrays[d],p):(M.update(u,a),"none"!==e&&u.nChanges++,n.transition&&a.anim&&u.nChangesAnim++,(Y.test(s)||X.test(s))&&(u.rangesAltered[r[0]]=1),W.test(s)&&l(t,"_inputDomain").set(null),"datarevision"===i&&(u.newDataRevision=1))}function g(e){return"data_array"===e.valType||e.arrayOk}for(i in e){if(u.calc&&!n.transition)return;var v=e[i],m=t[i],y=r.concat(i);if(s=y.join("."),"_"!==i.charAt(0)&&"function"!=typeof v&&v!==m){if(("tick0"===i||"dtick"===i)&&"geo"!==r[0]){var x=t.tickmode;if("auto"===x||"array"===x||!x)continue}if(("range"!==i||!t.autorange)&&("zmin"!==i&&"zmax"!==i||"contourcarpet"!==t.type)&&(a=c(y))&&(!a._compareAsJSON||JSON.stringify(v)!==JSON.stringify(m))){var b,_=a.valType,w=g(a),k=Array.isArray(v),T=Array.isArray(m);if(k&&T){var A="_input_"+i,L=e[A],S=t[A];if(Array.isArray(L)&&L===S)continue}if(void 0===m)w&&k?u.calc=!0:h();else if(a._isLinkedToArray){var C=[],O=!1;d||(u.arrays[i]=C);var P=Math.min(v.length,m.length),D=Math.max(v.length,m.length);if(P!==D){if("arraydraw"!==a.editType){h();continue}O=!0}for(b=0;b<P;b++)le(v[b],m[b],y.concat(b),o.extendFlat({inArray:i,arrayIndex:b},n));if(O)for(b=P;b<D;b++)C.push(b)}else!_&&o.isPlainObject(v)?le(v,m,y,n):w?k&&T?(f&&(u.calc=!0),(f||n.newDataRevision)&&h()):k!==T?u.calc=!0:h():k&&T&&v.length===m.length&&String(v)===String(m)||h()}}}for(i in t)if(!(i in e||"_"===i.charAt(0)||"function"==typeof t[i])){if(g(a=c(r.concat(i)))&&Array.isArray(t[i]))return void(u.calc=!0);h()}}function se(e){var t=n.select(e),r=e._fullLayout;if(r._container=t.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("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"),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 l=r._toppaper.append("g").classed("layer-above",!0);r._imageUpperLayer=l.append("g").classed("imagelayer",!0),r._shapeUpperLayer=l.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"),e.emit("plotly_framework")}r.animate=function(e,t,r){if(e=o.getGraphDiv(e),!o.isPlotDiv(e))throw new Error("This element is not a Plotly plot: "+e+". 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=e._transitionData;n._frameQueue||(n._frameQueue=[]);var a=(r=d.supplyAnimationDefaults(r)).transition,i=r.frame;function l(e){return Array.isArray(a)?e>=a.length?a[0]:a[e]:a}function s(e){return Array.isArray(i)?e>=i.length?i[0]:i[e]:i}function c(e,t){var r=0;return function(){if(e&&++r===t)return e()}}return void 0===n._frameWaitingCnt&&(n._frameWaitingCnt=0),new Promise(function(i,u){function f(){n._currentFrame&&n._currentFrame.onComplete&&n._currentFrame.onComplete();var t=n._currentFrame=n._frameQueue.shift();if(t){var r=t.name?t.name.toString():null;e._fullLayout._currentFrame=r,n._lastFrameAt=Date.now(),n._timeToNext=t.frameOpts.duration,d.transition(e,t.frame.data,t.frame.layout,k.coerceTraceIndices(e,t.frame.traces),t.frameOpts,t.transitionOpts).then(function(){t.onComplete&&t.onComplete()}),e.emit("plotly_animatingframe",{name:r,frame:t.frame,animation:{frame:t.frameOpts,transition:t.transitionOpts}})}else e.emit("plotly_animated"),window.cancelAnimationFrame(n._animationRaf),n._animationRaf=null}function p(){e.emit("plotly_animating"),n._lastFrameAt=-1/0,n._timeToNext=0,n._runningTransitions=0,n._currentFrame=null;var t=function(){n._animationRaf=window.requestAnimationFrame(t),Date.now()-n._lastFrameAt>n._timeToNext&&f()};t()}var h,g,v=0;function m(e){return Array.isArray(a)?v>=a.length?e.transitionOpts=a[v]:e.transitionOpts=a[0]:e.transitionOpts=a,v++,e}var y=[],x=void 0===t||null===t,b=Array.isArray(t);if(x||b||!o.isPlainObject(t)){if(x||-1!==["string","number"].indexOf(typeof t))for(h=0;h<n._frames.length;h++)(g=n._frames[h])&&(x||String(g.group)===String(t))&&y.push({type:"byname",name:String(g.name),data:m({name:g.name})});else if(b)for(h=0;h<t.length;h++){var _=t[h];-1!==["number","string"].indexOf(typeof _)?(_=String(_),y.push({type:"byname",name:_,data:m({name:_})})):o.isPlainObject(_)&&y.push({type:"object",data:m(o.extendFlat({},_))})}}else y.push({type:"object",data:m(o.extendFlat({},t))});for(h=0;h<y.length;h++)if("byname"===(g=y[h]).type&&!n._frameHash[g.data.name])return o.warn('animate failure: frame not found: "'+g.data.name+'"'),void u();-1!==["next","immediate"].indexOf(r.mode)&&function(){if(0!==n._frameQueue.length){for(;n._frameQueue.length;){var t=n._frameQueue.pop();t.onInterrupt&&t.onInterrupt()}e.emit("plotly_animationinterrupted",[])}}(),"reverse"===r.direction&&y.reverse();var w=e._fullLayout._currentFrame;if(w&&r.fromcurrent){var T=-1;for(h=0;h<y.length;h++)if("byname"===(g=y[h]).type&&g.name===w){T=h;break}if(T>0&&T<y.length-1){var M=[];for(h=0;h<y.length;h++)g=y[h],("byname"!==y[h].type||h>T)&&M.push(g);y=M}}y.length>0?function(t){if(0!==t.length){for(var a=0;a<t.length;a++){var o;o="byname"===t[a].type?d.computeFrame(e,t[a].name):t[a].data;var f=s(a),h=l(a);h.duration=Math.min(h.duration,f.duration);var g={frame:o,name:t[a].name,frameOpts:f,transitionOpts:h};a===t.length-1&&(g.onComplete=c(i,2),g.onInterrupt=u),n._frameQueue.push(g)}"immediate"===r.mode&&(n._lastFrameAt=-1/0),n._animationRaf||p()}}(y):(e.emit("plotly_animated"),i())})},r.addFrames=function(e,t,r){if(e=o.getGraphDiv(e),null===t||void 0===t)return Promise.resolve();if(!o.isPlotDiv(e))throw new Error("This element is not a Plotly plot: "+e+". 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,l,s=e._transitionData._frames,u=e._transitionData._frameHash;if(!Array.isArray(t))throw new Error("addFrames failure: frameList must be an Array of frame definitions"+t);var f=s.length+2*t.length,p=[],h={};for(n=t.length-1;n>=0;n--)if(o.isPlainObject(t[n])){var g=t[n].name,v=(u[g]||h[g]||{}).name,m=t[n].name,y=u[v]||h[v];v&&m&&"number"==typeof m&&y&&L<S&&(L++,o.warn('addFrames: overwriting frame "'+(u[v]||h[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.'),L===S&&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.")),h[g]={name:g},p.push({frame:d.supplyFrameDefaults(t[n]),index:r&&void 0!==r[n]&&null!==r[n]?r[n]:f+n})}p.sort(function(e,t){return e.index>t.index?-1:e.index<t.index?1:0});var x=[],b=[],_=s.length;for(n=p.length-1;n>=0;n--){if("number"==typeof(a=p[n].frame).name&&o.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!a.name)for(;u[a.name="frame "+e._transitionData._counter++];);if(u[a.name]){for(i=0;i<s.length&&(s[i]||{}).name!==a.name;i++);x.push({type:"replace",index:i,value:a}),b.unshift({type:"replace",index:i,value:s[i]})}else l=Math.max(0,Math.min(p[n].index,_)),x.push({type:"insert",index:l,value:a}),b.unshift({type:"delete",index:l}),_++}var w=d.modifyFrames,k=d.modifyFrames,T=[e,b],M=[e,x];return c&&c.add(e,w,T,k,M),d.modifyFrames(e,x)},r.deleteFrames=function(e,t){if(e=o.getGraphDiv(e),!o.isPlotDiv(e))throw new Error("This element is not a Plotly plot: "+e);var r,n,a=e._transitionData._frames,i=[],l=[];if(!t)for(t=[],r=0;r<a.length;r++)t.push(r);for((t=t.slice()).sort(),r=t.length-1;r>=0;r--)n=t[r],i.push({type:"delete",index:n}),l.unshift({type:"insert",index:n,value:a[n]});var s=d.modifyFrames,u=d.modifyFrames,f=[e,l],p=[e,i];return c&&c.add(e,s,f,u,p),d.modifyFrames(e,i)},r.addTraces=function e(t,n,a){t=o.getGraphDiv(t);var i,l,s=[],u=r.deleteTraces,f=e,d=[t,s],p=[t,n];for(function(e,t,r){var n,a;if(!Array.isArray(e.data))throw new Error("gd.data must be an array.");if(void 0===t)throw new Error("traces must be defined.");for(Array.isArray(t)||(t=[t]),n=0;n<t.length;n++)if("object"!=typeof(a=t[n])||Array.isArray(a)||null===a)throw new Error("all values in traces array must be non-array objects");if(void 0===r||Array.isArray(r)||(r=[r]),void 0!==r&&r.length!==t.length)throw new Error("if indices is specified, traces.length must equal indices.length")}(t,n,a),Array.isArray(n)||(n=[n]),n=n.map(function(e){return o.extendFlat({},e)}),k.cleanData(n),i=0;i<n.length;i++)t.data.push(n[i]);for(i=0;i<n.length;i++)s.push(-n.length+i);if(void 0===a)return l=r.redraw(t),c.add(t,u,d,f,p),l;Array.isArray(a)||(a=[a]);try{E(t,s,a)}catch(e){throw t.data.splice(t.data.length-n.length,n.length),e}return c.startSequence(t),c.add(t,u,d,f,p),l=r.moveTraces(t,s,a),c.stopSequence(t),l},r.deleteTraces=function e(t,n){t=o.getGraphDiv(t);var a,i,l=[],s=r.addTraces,u=e,f=[t,l,n],d=[t,n];if(void 0===n)throw new Error("indices must be an integer or array of integers.");for(Array.isArray(n)||(n=[n]),R(t,n,"indices"),(n=z(n,t.data.length-1)).sort(o.sorterDes),a=0;a<n.length;a+=1)i=t.data.splice(n[a],1)[0],l.push(i);var p=r.redraw(t);return c.add(t,s,f,u,d),p},r.extendTraces=function e(t,n,a,i){var l=I(t=o.getGraphDiv(t),n,a,i,function(e,t,r){var n,a;if(o.isTypedArray(e))if(r<0){var i=new e.constructor(0),l=F(e,t);r<0?(n=l,a=i):(n=i,a=l)}else if(n=new e.constructor(r),a=new e.constructor(e.length+t.length-r),r===t.length)n.set(t),a.set(e);else if(r<t.length){var s=t.length-r;n.set(t.subarray(s)),a.set(e),a.set(t.subarray(0,s),e.length)}else{var c=r-t.length,u=e.length-c;n.set(e.subarray(u)),n.set(t,c),a.set(e.subarray(0,u))}else n=e.concat(t),a=r>=0&&r<n.length?n.splice(0,n.length-r):[];return[n,a]}),s=r.redraw(t),u=[t,l.update,a,l.maxPoints];return c.add(t,r.prependTraces,u,e,arguments),s},r.moveTraces=function e(t,n,a){var i,l=[],s=[],u=e,f=e,d=[t=o.getGraphDiv(t),a,n],p=[t,n,a];if(E(t,n,a),n=Array.isArray(n)?n:[n],void 0===a)for(a=[],i=0;i<n.length;i++)a.push(-n.length+i);for(a=Array.isArray(a)?a:[a],n=z(n,t.data.length-1),a=z(a,t.data.length-1),i=0;i<t.data.length;i++)-1===n.indexOf(i)&&l.push(t.data[i]);for(i=0;i<n.length;i++)s.push({newIndex:a[i],trace:t.data[n[i]]});for(s.sort(function(e,t){return e.newIndex-t.newIndex}),i=0;i<s.length;i+=1)l.splice(s[i].newIndex,0,s[i].trace);t.data=l;var h=r.redraw(t);return c.add(t,u,d,f,p),h},r.prependTraces=function e(t,n,a,i){var l=I(t=o.getGraphDiv(t),n,a,i,function(e,t,r){var n,a;if(o.isTypedArray(e))if(r<=0){var i=new e.constructor(0),l=F(t,e);r<0?(n=l,a=i):(n=i,a=l)}else if(n=new e.constructor(r),a=new e.constructor(e.length+t.length-r),r===t.length)n.set(t),a.set(e);else if(r<t.length){var s=t.length-r;n.set(t.subarray(0,s)),a.set(t.subarray(s)),a.set(e,s)}else{var c=r-t.length;n.set(t),n.set(e.subarray(0,c),t.length),a.set(e.subarray(c))}else n=t.concat(e),a=r>=0&&r<n.length?n.splice(r,n.length):[];return[n,a]}),s=r.redraw(t),u=[t,l.update,a,l.maxPoints];return c.add(t,r.extendTraces,u,e,arguments),s},r.newPlot=function(e,t,n,a){return e=o.getGraphDiv(e),d.cleanPlot([],{},e._fullData||[],e._fullLayout||{}),d.purge(e),r.plot(e,t,n,a)},r.plot=function(e,t,a,i){var l;if(e=o.getGraphDiv(e),s.init(e),o.isPlainObject(t)){var c=t;t=c.data,a=c.layout,i=c.config,l=c.frames}if(!1===s.triggerHandler(e,"plotly_beforeplot",[t,a,i]))return Promise.reject();t||a||o.isPlotDiv(e)||o.warn("Calling Plotly.plot as if redrawing but this container doesn't yet have a plot.",e),D(e,i),a||(a={}),n.select(e).classed("js-plotly-plot",!0),g.makeTester(),Array.isArray(e._promises)||(e._promises=[]);var f=0===(e.data||[]).length&&Array.isArray(t);Array.isArray(t)&&(k.cleanData(t),f?e.data=t:e.data.push.apply(e.data,t),e.empty=!1),e.layout&&!f||(e.layout=k.cleanLayout(a)),d.supplyDefaults(e);var v=e._fullLayout,y=v._has("cartesian");if(!v._has("polar")&&t&&t[0]&&t[0].r)return o.log("Legacy polar charts are deprecated!"),function(e,t,r){var a=n.select(e).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(""),t&&(e.data=t),r&&(e.layout=r),p.manager.fillLayout(e),i.style({width:e._fullLayout.width+"px",height:e._fullLayout.height+"px"}),e.framework=p.manager.framework(e),e.framework({data:e.data,layout:e.layout},i.node()),e.framework.setUndoPoint();var l=e.framework.svg(),s=1,c=e._fullLayout.title?e._fullLayout.title.text:"";""!==c&&c||(s=0);var u=function(){this.call(x.convertToTspans,e)},f=l.select(".title-group text").call(u);if(e._context.edits.titleText){var h=o._(e,"Click to enter Plot title");c&&c!==h||(s=.2,f.attr({"data-unformatted":h}).text(h).style({opacity:s}).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(x.makeEditable,{gd:e}).on("edit",function(t){e.framework({layout:{title:{text:t}}}),this.text(t).call(u),this.call(g)}).on("cancel",function(){var e=this.attr("data-unformatted");this.text(e).call(u)})};f.call(g)}return e._context.setBackground(e,e._fullLayout.paper_bgcolor),d.addLinks(e),Promise.resolve()}(e,t,a);v._replotting=!0,f&&se(e),e.framework!==se&&(e.framework=se,se(e)),g.initGradients(e),f&&h.saveShowSpikeInitial(e);var b=!e.calcdata||e.calcdata.length!==(e._fullData||[]).length;b&&d.doCalcdata(e);for(var _=0;_<e.calcdata.length;_++)e.calcdata[_][0].trace=e._fullData[_];e._context.responsive?e._responsiveChartHandler||(e._responsiveChartHandler=function(){o.isHidden(e)||d.resize(e)},window.addEventListener("resize",e._responsiveChartHandler)):o.clearResponsive(e);var w=o.extendFlat({},v._size),M=0;function A(){if(d.clearAutoMarginIds(e),T.drawMarginPushers(e),h.allowAutoMargin(e),v._has("pie"))for(var t=e._fullData,r=0;r<t.length;r++){var n=t[r];"pie"===n.type&&n.automargin&&d.allowAutoMargin(e,"pie."+n.uid+".automargin")}return d.doAutoMargin(e),d.previousPromises(e)}function L(){e._transitioning||(T.doAutoRangeAndConstraints(e),f&&h.saveRangeInitial(e),u.getComponentMethod("rangeslider","calcAutorange")(e))}var S=[d.previousPromises,function(){if(l)return r.addFrames(e,l)},function t(){for(var r=v._basePlotModules,n=0;n<r.length;n++)r[n].drawFramework&&r[n].drawFramework(e);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(e){return e.key}),v._glcanvas.enter().append("canvas").attr("class",function(e){return"gl-canvas gl-canvas-"+e.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(!M)return o.log(i+" Clearing graph and plotting again."),d.cleanPlot([],{},e._fullData,v),d.supplyDefaults(e),v=e._fullLayout,d.doCalcdata(e),M++,t();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(e)},A,function(){if(d.didMarginChange(w,v._size))return o.syncOrAsync([A,T.layoutStyles],e)}];y&&S.push(function(){if(b)return o.syncOrAsync([u.getComponentMethod("shapes","calcAutorange"),u.getComponentMethod("annotations","calcAutorange"),L],e);L()}),S.push(T.layoutStyles),y&&S.push(function(){return h.draw(e,f?"":"redraw")}),S.push(T.drawData,T.finalDraw,m,d.addLinks,d.rehover,d.redrag,d.doAutoMargin,d.previousPromises);var O=o.syncOrAsync(S,e);return O&&O.then||(O=Promise.resolve()),O.then(function(){return C(e),e})},r.purge=function(e){var t=(e=o.getGraphDiv(e))._fullLayout||{},r=e._fullData||[];return d.cleanPlot([],{},r,t),d.purge(e),s.purge(e),t._container&&t._container.remove(),delete e._context,e},r.react=function(e,t,n,a){var i,s;e=o.getGraphDiv(e),k.clearPromiseQueue(e);var c=e._fullData,p=e._fullLayout;if(o.isPlotDiv(e)&&c&&p){if(o.isPlainObject(t)){var h=t;t=h.data,n=h.layout,a=h.config,i=h.frames}var g=!1;if(a){var v=o.extendDeep({},e._context);e._context=void 0,D(e,a),g=function e(t,r){var n;for(n in t)if("_"!==n.charAt(0)){var a=t[n],i=r[n];if(a!==i)if(o.isPlainObject(a)&&o.isPlainObject(i)){if(e(a,i))return!0}else{if(!Array.isArray(a)||!Array.isArray(i))return!0;if(a.length!==i.length)return!0;for(var l=0;l<a.length;l++)if(a[l]!==i[l]){if(!o.isPlainObject(a[l])||!o.isPlainObject(i[l]))return!0;if(e(a[l],i[l]))return!0}}}}(v,e._context)}e.data=t||[],k.cleanData(e.data),e.layout=n||{},k.cleanLayout(e.layout),function(e,t,r,n){var a,i,s,c,u,f,d,p,h=n._preGUI,g=[],v={};for(a in h){if(u=re(a,ee)){if(i=u.attr||u.head+".uirevision",(c=(s=l(n,i).get())&&ne(i,t))&&c===s&&(null===(f=h[a])&&(f=void 0),oe(p=(d=l(t,a)).get(),f))){void 0===p&&"autorange"===a.substr(a.length-9)&&g.push(a.substr(0,a.length-10)),d.set(j(l(n,a).get()));continue}}else o.warn("unrecognized GUI edit: "+a);delete h[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 x=l(t,y).get();x&&delete x.autorange}}var b=n._tracePreGUI;for(var _ in b){var w,k=b[_],T=null;for(a in k){if(!T){var M=ae(_,r);if(M<0){delete b[_];break}var A=ie(_,e,(w=r[M]._fullInput).index);if(A<0){delete b[_];break}T=e[A]}if(u=re(a,te)){if(u.attr?c=(s=l(n,u.attr).get())&&ne(u.attr,t):(s=w.uirevision,void 0===(c=T.uirevision)&&(c=t.uirevision)),c&&c===s&&(null===(f=k[a])&&(f=void 0),oe(p=(d=l(T,a)).get(),f))){d.set(j(l(w,a).get()));continue}}else o.warn("unrecognized GUI edit: "+a+" in trace uid "+_);delete k[a]}}}(e.data,e.layout,c,p),d.supplyDefaults(e,{skipUpdateCalc:!0});var m=e._fullData,y=e._fullLayout,x=void 0===y.datarevision,b=y.transition,_=function(e,t,r,n,a){var i=M.layoutFlags();return i.arrays={},i.rangesAltered={},i.nChanges=0,i.nChangesAnim=0,le(t,r,[],{getValObject:function(e){return f.getLayoutValObject(r,e)},flags:i,immutable:n,transition:a,gd:e}),(i.plot||i.calc)&&(i.layoutReplot=!0),a&&i.nChanges&&i.nChangesAnim&&(i.anim=i.nChanges===i.nChangesAnim?"all":"some"),i}(e,p,y,x,b),w=_.newDataRevision,A=function(e,t,r,n,a,i){var o=t.length===r.length;if(!a&&!o)return{fullReplot:!0,calc:!0};var l,s,c=M.traceFlags();c.arrays={},c.nChanges=0,c.nChangesAnim=0;var u={getValObject:function(e){var t=f.getTraceValObject(s,e);return!s._module.animatable&&t.anim&&(t.anim=!1),t},flags:c,immutable:n,transition:a,newDataRevision:i,gd:e},p={};for(l=0;l<t.length;l++)if(r[l]){if(s=r[l]._fullInput,d.hasMakesDataTransform(s)&&(s=r[l]),p[s.uid])continue;p[s.uid]=1,le(t[l]._fullInput,s,[],u)}return(c.calc||c.plot)&&(c.fullReplot=!0),a&&c.nChanges&&c.nChangesAnim&&(c.anim=c.nChanges===c.nChangesAnim&&o?"all":"some"),c}(e,c,m,x,b,w);J(e)&&(_.layoutReplot=!0),A.calc||_.calc?e.calcdata=void 0:d.supplyDefaultsUpdateCalc(e.calcdata,m);var L=[];if(i&&(e._transitionData={},d.createTransitionData(e),L.push(function(){return r.addFrames(e,i)})),y.transition&&!g&&(A.anim||_.anim))d.doCalcdata(e),T.doAutoRangeAndConstraints(e),L.push(function(){return d.transitionFromReact(e,A,_,p)});else if(A.fullReplot||_.layoutReplot||g)e._fullLayout._skipDefaults=!0,L.push(r.plot);else{for(var S in _.arrays){var O=_.arrays[S];if(O.length){var P=u.getComponentMethod(S,"drawOne");if(P!==o.noop)for(var z=0;z<O.length;z++)P(e,O[z]);else{var R=u.getComponentMethod(S,"draw");if(R===o.noop)throw new Error("cannot draw components: "+S);R(e)}}}L.push(d.previousPromises),A.style&&L.push(T.doTraceStyle),(A.colorbars||_.colorbars)&&L.push(T.doColorBars),_.legend&&L.push(T.doLegend),_.layoutstyle&&L.push(T.layoutStyles),_.axrange&&Z(L),_.ticks&&L.push(T.doTicksRelayout),_.modebar&&L.push(T.doModeBar),_.camera&&L.push(T.doCamera),L.push(C)}L.push(d.rehover,d.redrag),(s=o.syncOrAsync(L,e))&&s.then||(s=Promise.resolve(e))}else s=r.newPlot(e,t,n,a);return s.then(function(){return e.emit("plotly_react",{data:t,layout:n}),e})},r.redraw=function(e){if(e=o.getGraphDiv(e),!o.isPlotDiv(e))throw new Error("This element is not a Plotly plot: "+e);return k.cleanData(e.data),k.cleanLayout(e.layout),e.calcdata=void 0,r.plot(e).then(function(){return e.emit("plotly_redraw"),e})},r.relayout=U,r.restyle=N,r.setPlotConfig=function(e){return o.extendFlat(_,e)},r.update=Q,r._guiRelayout=K(U),r._guiRestyle=K(N),r._guiUpdate=K(Q),r._storeDirectGUIEdit=function(e,t,r){for(var n in r)H(n,l(e,n).get(),r[n],t)}},{"../components/color":30,"../components/drawing":51,"../constants/xmlns_namespaces":129,"../lib":148,"../lib/events":142,"../lib/queue":162,"../lib/svg_text_utils":169,"../plots/cartesian/axes":192,"../plots/cartesian/constants":198,"../plots/cartesian/graph_interact":201,"../plots/cartesian/select":209,"../plots/plots":224,"../plots/polar/legacy":227,"../registry":232,"./edit_types":175,"./helpers":176,"./manage_arrays":178,"./plot_config":180,"./plot_schema":181,"./subroutines":183,d3:2,"fast-isnumeric":4,"has-hover":6}],180:[function(e,t,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 e(t,r){for(var n in t){var a=t[n];a.valType?r[n]=a.dflt:(r[n]||(r[n]={}),e(a,r[n]))}}(n,a),t.exports={configAttributes:n,dfltConfig:a}},{}],181:[function(e,t,r){"use strict";var n=e("../registry"),a=e("../lib"),i=e("../plots/attributes"),o=e("../plots/layout_attributes"),l=e("../plots/frame_attributes"),s=e("../plots/animation_attributes"),c=e("./plot_config").configAttributes,u=e("../plots/polar/legacy/area_attributes"),f=e("../plots/polar/legacy/axis_attributes"),d=e("./edit_types"),p=a.extendFlat,h=a.extendDeepAll,g=a.isPlainObject,v=a.isArrayOrTypedArray,m=a.nestedProperty,y=a.valObjectMeta,x="_isSubplotObj",b="_isLinkedToArray",_=[x,b,"_arrayAttrRegexps","_deprecated"];function w(e,t,r){if(!e)return!1;if(e._isLinkedToArray)if(k(t[r]))r++;else if(r<t.length)return!1;for(;r<t.length;r++){var n=e[t[r]];if(!g(n))break;if(e=n,r===t.length-1)break;if(e._isLinkedToArray){if(!k(t[++r]))return!1}else if("info_array"===e.valType){var a=t[++r];if(!k(a))return!1;var i=e.items;if(Array.isArray(i)){if(a>=i.length)return!1;if(2===e.dimensions){if(r++,t.length===r)return e;var o=t[r];if(!k(o))return!1;e=i[a][o]}else e=i[a]}else e=i}}return e}function k(e){return e===Math.round(e)&&e>=0}function T(e){return function(e){r.crawl(e,function(e,t,n){r.isValObject(e)?"data_array"===e.valType?(e.role="data",n[t+"src"]={valType:"string",editType:"none"}):!0===e.arrayOk&&(n[t+"src"]={valType:"string",editType:"none"}):g(e)&&(e.role="object")})}(e),function(e){r.crawl(e,function(e,t,r){if(!e)return;var n=e[b];if(!n)return;delete e[b],r[t]={items:{}},r[t].items[n]=e,r[t].role="object"})}(e),function(e){!function e(t){for(var r in t)if(g(t[r]))e(t[r]);else if(Array.isArray(t[r]))for(var n=0;n<t[r].length;n++)e(t[r][n]);else t[r]instanceof RegExp&&(t[r]=t[r].toString())}(e)}(e),e}function M(e,t,r){var n=m(e,r),a=h({},t.layoutAttributes);a[x]=!0,n.set(a)}function A(e,t,r){var n=m(e,r);n.set(h(n.get()||{},t))}r.IS_SUBPLOT_OBJ=x,r.IS_LINKED_TO_ARRAY=b,r.DEPRECATED="_deprecated",r.UNDERSCORE_ATTRS=_,r.get=function(){var e={};n.allTypes.concat("area").forEach(function(t){e[t]=function(e){var t,a;"area"===e?(t={attributes:u},a={}):(t=n.modules[e]._module,a=t.basePlotModule);var o={type:null},l=h({},i),s=h({},t.attributes);r.crawl(s,function(e,t,r,n,a){m(l,a).set(void 0),void 0===e&&m(s,a).set(void 0)}),h(o,l),n.traceIs(e,"noOpacity")&&delete o.opacity;n.traceIs(e,"showLegend")||(delete o.showlegend,delete o.legendgroup);n.traceIs(e,"noHover")&&(delete o.hoverinfo,delete o.hoverlabel);t.selectPoints||delete o.selectedpoints;h(o,s),a.attributes&&h(o,a.attributes);o.type=e;var c={meta:t.meta||{},categories:t.categories||{},animatable:Boolean(t.animatable),type:e,attributes:T(o)};if(t.layoutAttributes){var f={};h(f,t.layoutAttributes),c.layoutAttributes=T(f)}t.animatable||r.crawl(c,function(e){r.isValObject(e)&&"anim"in e&&delete e.anim});return c}(t)});var t,a={};return Object.keys(n.transformsRegistry).forEach(function(e){a[e]=function(e){var t=n.transformsRegistry[e],r=h({},t.attributes);return Object.keys(n.componentsRegistry).forEach(function(t){var a=n.componentsRegistry[t];a.schema&&a.schema.transforms&&a.schema.transforms[e]&&Object.keys(a.schema.transforms[e]).forEach(function(t){A(r,a.schema.transforms[e][t],t)})}),{attributes:T(r)}}(e)}),{defs:{valObjects:y,metaKeys:_.concat(["description","role","editType","impliedEdits"]),editType:{traces:d.traces,layout:d.layout},impliedEdits:{}},traces:e,layout:function(){var e,t,r={};for(e in h(r,o),n.subplotsRegistry)if((t=n.subplotsRegistry[e]).layoutAttributes)if(Array.isArray(t.attr))for(var a=0;a<t.attr.length;a++)M(r,t,t.attr[a]);else{var i="subplot"===t.attr?t.name:t.attr;M(r,t,i)}for(e in r=function(e){return p(e,{radialaxis:f.radialaxis,angularaxis:f.angularaxis}),p(e,f.layout),e}(r),n.componentsRegistry){var l=(t=n.componentsRegistry[e]).schema;if(l&&(l.subplots||l.layout)){var s=l.subplots;if(s&&s.xaxis&&!s.yaxis)for(var c in s.xaxis)delete r.yaxis[c]}else"colorscale"===t.name?h(r,t.layoutAttributes):t.layoutAttributes&&A(r,t.layoutAttributes,t.name)}return{layoutAttributes:T(r)}}(),transforms:a,frames:(t={frames:h({},l)},T(t),t.frames),animation:T(s),config:T(c)}},r.crawl=function(e,t,n,a){var i=n||0;a=a||"",Object.keys(e).forEach(function(n){var o=e[n];if(-1===_.indexOf(n)){var l=(a?a+".":"")+n;t(o,n,e,i,l),r.isValObject(o)||g(o)&&"impliedEdits"!==n&&r.crawl(o,t,i+1,l)}})},r.isValObject=function(e){return e&&void 0!==e.valType},r.findArrayAttributes=function(e){var t,n,a=[],o=[],l=[];function s(e,r,i,s){o=o.slice(0,s).concat([r]),l=l.slice(0,s).concat([e&&e._isLinkedToArray]),e&&("data_array"===e.valType||!0===e.arrayOk)&&!("colorbar"===o[s-1]&&("ticktext"===r||"tickvals"===r))&&function e(t,r,i){var s=t[o[r]];var c=i+o[r];if(r===o.length-1)v(s)&&a.push(n+c);else if(l[r]){if(Array.isArray(s))for(var u=0;u<s.length;u++)g(s[u])&&e(s[u],r+1,c+"["+u+"].")}else g(s)&&e(s,r+1,c+".")}(t,0,"")}t=e,n="",r.crawl(i,s),e._module&&e._module.attributes&&r.crawl(e._module.attributes,s);var c=e.transforms;if(c)for(var u=0;u<c.length;u++){var f=c[u],d=f._module;d&&(n="transforms["+u+"].",t=f,r.crawl(d.attributes,s))}return a},r.getTraceValObject=function(e,t){var r,a,o=t[0],l=1;if("transforms"===o){if(1===t.length)return i.transforms;var s=e.transforms;if(!Array.isArray(s)||!s.length)return!1;var c=t[1];if(!k(c)||c>=s.length)return!1;a=(r=(n.transformsRegistry[s[c].type]||{}).attributes)&&r[t[2]],l=3}else if("area"===e.type)a=u[o];else{var f=e._module;if(f||(f=(n.modules[e.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 w(a,t,l)},r.getLayoutValObject=function(e,t){return w(function(e,t){var r,a,i,l,s=e._basePlotModules;if(s){var c;for(r=0;r<s.length;r++){if((i=s[r]).attrRegex&&i.attrRegex.test(t)){if(i.layoutAttrOverrides)return i.layoutAttrOverrides;!c&&i.layoutAttributes&&(c=i.layoutAttributes)}var u=i.baseLayoutAttrOverrides;if(u&&t in u)return u[t]}if(c)return c}var d=e._modules;if(d)for(r=0;r<d.length;r++)if((l=d[r].layoutAttributes)&&t in l)return l[t];for(a in n.componentsRegistry){if("colorscale"===(i=n.componentsRegistry[a]).name&&0===t.indexOf("coloraxis"))return i.layoutAttributes[t];if(!i.schema&&t===i.name)return i.layoutAttributes}if(t in o)return o[t];if("radialaxis"===t||"angularaxis"===t)return f[t];return f.layout[t]||!1}(e,t[0]),t,1)}},{"../lib":148,"../plots/animation_attributes":187,"../plots/attributes":189,"../plots/frame_attributes":219,"../plots/layout_attributes":222,"../plots/polar/legacy/area_attributes":225,"../plots/polar/legacy/axis_attributes":226,"../registry":232,"./edit_types":175,"./plot_config":180}],182:[function(e,t,r){"use strict";var n=e("../lib"),a=e("../plots/attributes"),i="templateitemname",o={name:{valType:"string",editType:"none"}};function l(e){return e&&"string"==typeof e}function s(e){var t=e.length-1;return"s"!==e.charAt(t)&&n.warn("bad argument to arrayDefaultKey: "+e),e.substr(0,e.length-1)+"defaults"}o[i]={valType:"string",editType:"calc"},r.templatedArray=function(e,t){return t._isLinkedToArray=e,t.name=o.name,t[i]=o[i],t},r.traceTemplater=function(e){var t,r,i={};for(t in e)r=e[t],Array.isArray(r)&&r.length&&(i[t]=0);return{newTrace:function(o){var l={type:t=n.coerce(o,{},a,"type"),_template:null};if(t in i){r=e[t];var s=i[t]%r.length;i[t]++,l._template=r[s]}return l}}},r.newContainer=function(e,t,r){var a=e._template,i=a&&(a[t]||r&&a[r]);return n.isPlainObject(i)||(i=null),e[t]={_template:i}},r.arrayTemplater=function(e,t,r){var n=e._template,a=n&&n[s(t)],o=n&&n[t];Array.isArray(o)&&o.length||(o=[]);var c={};return{newItem:function(e){var t={name:e.name,_input:e},n=t[i]=e[i];if(!l(n))return t._template=a,t;for(var s=0;s<o.length;s++){var u=o[s];if(u.name===n)return c[n]=1,t._template=u,t}return t[r]=e[r]||!1,t._template=!1,t},defaultItems:function(){for(var e=[],t=0;t<o.length;t++){var r=o[t],n=r.name;if(l(n)&&!c[n]){var a={_template:r,name:n,_input:{_templateitemname:n}};a[i]=r[i],e.push(a),c[n]=1}}return e}}},r.arrayDefaultKey=s,r.arrayEditor=function(e,t,r){var a=(n.nestedProperty(e,t).get()||[]).length,o=r._index,l=o>=a&&(r._input||{})._templateitemname;l&&(o=a);var s,c=t+"["+o+"]";function u(){s={},l&&(s[c]={},s[c][i]=l)}function f(e,t){l?n.nestedProperty(s[c],e).set(t):s[c+"."+e]=t}function d(){var e=s;return u(),e}return u(),{modifyBase:function(e,t){s[e]=t},modifyItem:f,getUpdateObj:d,applyUpdate:function(t,r){t&&f(t,r);var a=d();for(var i in a)n.nestedProperty(e,i).set(a[i])}}}},{"../lib":148,"../plots/attributes":189}],183:[function(e,t,r){"use strict";var n=e("d3"),a=e("../registry"),i=e("../plots/plots"),o=e("../lib"),l=e("../lib/clear_gl_canvases"),s=e("../components/color"),c=e("../components/drawing"),u=e("../components/titles"),f=e("../components/modebar"),d=e("../plots/cartesian/axes"),p=e("../constants/alignment"),h=e("../plots/cartesian/constraints"),g=h.enforce,v=h.clean,m=e("../plots/cartesian/autorange").doAutoRange,y="start",x="middle",b="end";function _(e,t,r){for(var n=0;n<r.length;n++){var a=r[n][0],i=r[n][1];if(!(a[0]>=e[1]||a[1]<=e[0])&&(i[0]<t[1]&&i[1]>t[0]))return!0}return!1}function w(e){var t,a,l,u,h,g,v=e._fullLayout,m=v._size,y=m.p,x=d.list(e,"",!0);if(v._paperdiv.style({width:e._context.responsive&&v.autosize&&!e._context._hasZeroWidth&&!e.layout.width?"100%":v.width+"px",height:e._context.responsive&&v.autosize&&!e._context._hasZeroHeight&&!e.layout.height?"100%":v.height+"px"}).selectAll(".main-svg").call(c.setSize,v.width,v.height),e._context.setBackground(e,v.paper_bgcolor),r.drawMainTitle(e),f.manage(e),!v._has("cartesian"))return i.previousPromises(e);function b(e,t,r){var n=e._lw/2;return"x"===e._id.charAt(0)?t?"top"===r?t._offset-y-n:t._offset+t._length+y+n:m.t+m.h*(1-(e.position||0))+n%1:t?"right"===r?t._offset+t._length+y+n:t._offset-y-n:m.l+m.w*(e.position||0)+n%1}for(t=0;t<x.length;t++){var w=(u=x[t])._anchorAxis;u._linepositions={},u._lw=c.crispRound(e,u.linewidth,1),u._mainLinePosition=b(u,w,u.side),u._mainMirrorPosition=u.mirror&&w?b(u,w,p.OPPOSITE_SIDE[u.side]):null}var T=[],A=[],L=[],S=1===s.opacity(v.paper_bgcolor)&&1===s.opacity(v.plot_bgcolor)&&v.paper_bgcolor===v.plot_bgcolor;for(a in v._plots)if((l=v._plots[a]).mainplot)l.bg&&l.bg.remove(),l.bg=void 0;else{var C=l.xaxis.domain,O=l.yaxis.domain,P=l.plotgroup;if(_(C,O,L)){var D=P.node(),z=l.bg=o.ensureSingle(P,"rect","bg");D.insertBefore(z.node(),D.childNodes[0]),A.push(a)}else P.select("rect.bg").remove(),L.push([C,O]),S||(T.push(a),A.push(a))}var R,E,I,F,N,j,B,H,q,V,U,G,Z,Y=v._bgLayer.selectAll(".bg").data(T);for(Y.enter().append("rect").classed("bg",!0),Y.exit().remove(),Y.each(function(e){v._plots[e].bg=n.select(this)}),t=0;t<A.length;t++)l=v._plots[A[t]],h=l.xaxis,g=l.yaxis,l.bg&&l.bg.call(c.setRect,h._offset-y,g._offset-y,h._length+2*y,g._length+2*y).call(s.fill,v.plot_bgcolor).style("stroke-width",0);if(!v._hasOnlyLargeSploms)for(a in v._plots){l=v._plots[a],h=l.xaxis,g=l.yaxis;var X,W,$=l.clipId="clip"+v._uid+a+"plot",J=o.ensureSingleById(v._clips,"clipPath",$,function(e){e.classed("plotclip",!0).append("rect")});l.clipRect=J.select("rect").attr({width:h._length,height:g._length}),c.setTranslate(l.plot,h._offset,g._offset),l._hasClipOnAxisFalse?(X=null,W=$):(X=$,W=null),c.setClipUrl(l.plot,X,e),l.layerClipId=W}function Q(e){return"M"+R+","+e+"H"+E}function K(e){return"M"+h._offset+","+e+"h"+h._length}function ee(e){return"M"+e+","+H+"V"+B}function te(e){return"M"+e+","+g._offset+"v"+g._length}function re(e,t,r){if(!e.showline||a!==e._mainSubplot)return"";if(!e._anchorAxis)return r(e._mainLinePosition);var n=t(e._mainLinePosition);return e.mirror&&(n+=t(e._mainMirrorPosition)),n}for(a in v._plots){l=v._plots[a],h=l.xaxis,g=l.yaxis;var ne="M0,0";k(h,a)&&(N=M(h,"left",g,x),R=h._offset-(N?y+N:0),j=M(h,"right",g,x),E=h._offset+h._length+(j?y+j:0),I=b(h,g,"bottom"),F=b(h,g,"top"),!(Z=!h._anchorAxis||a!==h._mainSubplot)||"allticks"!==h.mirror&&"all"!==h.mirror||(h._linepositions[a]=[I,F]),ne=re(h,Q,K),Z&&h.showline&&("all"===h.mirror||"allticks"===h.mirror)&&(ne+=Q(I)+Q(F)),l.xlines.style("stroke-width",h._lw+"px").call(s.stroke,h.showline?h.linecolor:"rgba(0,0,0,0)")),l.xlines.attr("d",ne);var ae="M0,0";k(g,a)&&(U=M(g,"bottom",h,x),B=g._offset+g._length+(U?y:0),G=M(g,"top",h,x),H=g._offset-(G?y:0),q=b(g,h,"left"),V=b(g,h,"right"),!(Z=!g._anchorAxis||a!==g._mainSubplot)||"allticks"!==g.mirror&&"all"!==g.mirror||(g._linepositions[a]=[q,V]),ae=re(g,ee,te),Z&&g.showline&&("all"===g.mirror||"allticks"===g.mirror)&&(ae+=ee(q)+ee(V)),l.ylines.style("stroke-width",g._lw+"px").call(s.stroke,g.showline?g.linecolor:"rgba(0,0,0,0)")),l.ylines.attr("d",ae)}return d.makeClipPaths(e),i.previousPromises(e)}function k(e,t){return(e.ticks||e.showline)&&(t===e._mainSubplot||"all"===e.mirror||"allticks"===e.mirror)}function T(e,t,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=p.FROM_BL[t];return r.side===t?n.domain[a]===e.domain[a]:r.mirror&&n.domain[1-a]===e.domain[1-a]}function M(e,t,r,n){if(T(e,t,r))return r._lw;for(var a=0;a<n.length;a++){var i=n[a];if(i._mainAxis===r._mainAxis&&T(e,t,i))return i._lw}return 0}r.layoutStyles=function(e){return o.syncOrAsync([i.doAutoMargin,w],e)},r.drawMainTitle=function(e){var t=e._fullLayout,r=function(e){var t=e.title,r=x;o.isRightAnchor(t)?r=b:o.isLeftAnchor(t)&&(r=y);return r}(t),n=function(e){var t=e.title,r="0em";o.isTopAnchor(t)?r=p.CAP_SHIFT+"em":o.isMiddleAnchor(t)&&(r=p.MID_SHIFT+"em");return r}(t);u.draw(e,"gtitle",{propContainer:t,propName:"title.text",placeholder:t._dfltTitle.plot,attributes:{x:function(e,t){var r=e.title,n=e._size,a=0;t===y?a=r.pad.l:t===b&&(a=-r.pad.r);switch(r.xref){case"paper":return n.l+n.w*r.x+a;case"container":default:return e.width*r.x+a}}(t,r),y:function(e,t){var r=e.title,n=e._size,a=0;"0em"!==t&&t?t===p.CAP_SHIFT+"em"&&(a=r.pad.t):a=-r.pad.b;if("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 e.height-e.height*r.y+a}}(t,n),"text-anchor":r,dy:n}})},r.doTraceStyle=function(e){var t,n=e.calcdata,o=[];for(t=0;t<n.length;t++){var s=n[t],c=s[0]||{},u=c.trace||{},f=u._module||{},d=f.arraysToCalcdata;d&&d(s,u);var p=f.editStyle;p&&o.push({fn:p,cd0:c})}if(o.length){for(t=0;t<o.length;t++){var h=o[t];h.fn(e,h.cd0)}l(e),r.redrawReglTraces(e)}return i.style(e),a.getComponentMethod("legend","draw")(e),i.previousPromises(e)},r.doColorBars=function(e){return a.getComponentMethod("colorbar","draw")(e),i.previousPromises(e)},r.layoutReplot=function(e){var t=e.layout;return e.layout=void 0,a.call("plot",e,"",t)},r.doLegend=function(e){return a.getComponentMethod("legend","draw")(e),i.previousPromises(e)},r.doTicksRelayout=function(e){return d.draw(e,"redraw"),e._fullLayout._hasOnlyLargeSploms&&(a.subplotsRegistry.splom.updateGrid(e),l(e),r.redrawReglTraces(e)),r.drawMainTitle(e),i.previousPromises(e)},r.doModeBar=function(e){var t=e._fullLayout;f.manage(e);for(var r=0;r<t._basePlotModules.length;r++){var n=t._basePlotModules[r].updateFx;n&&n(e)}return i.previousPromises(e)},r.doCamera=function(e){for(var t=e._fullLayout,r=t._subplots.gl3d,n=0;n<r.length;n++){var a=t[r[n]];a._scene.setViewport(a)}},r.drawData=function(e){var t=e._fullLayout;l(e);for(var n=t._basePlotModules,o=0;o<n.length;o++)n[o].plot(e);return r.redrawReglTraces(e),i.style(e),a.getComponentMethod("shapes","draw")(e),a.getComponentMethod("annotations","draw")(e),a.getComponentMethod("images","draw")(e),t._replotting=!1,i.previousPromises(e)},r.redrawReglTraces=function(e){var t=e._fullLayout;if(t._has("regl")){var r,n,a=e._fullData,i=[],l=[];for(t._hasOnlyLargeSploms&&t._splomGrid.draw(),r=0;r<a.length;r++){var s=a[r];!0===s.visible&&0!==s._length&&("splom"===s.type?t._splomScenes[s.uid].draw():"scattergl"===s.type?o.pushUnique(i,s.xaxis+s.yaxis):"scatterpolargl"===s.type&&o.pushUnique(l,s.subplot))}for(r=0;r<i.length;r++)(n=t._plots[i[r]])._scene&&n._scene.draw();for(r=0;r<l.length;r++)(n=t[l[r]]._subplot)._scene&&n._scene.draw()}},r.doAutoRangeAndConstraints=function(e){for(var t,r,n=e._fullLayout,a=d.list(e,"",!0),i=n._axisMatchGroups||[],l={},s=0;s<a.length;s++)t=a[s],v(e,t),m(e,t),l[t._id]=1;g(e);e:for(var c=0;c<i.length;c++){var u,f=i[c],p=null;for(u in f)if(l[(t=d.getFromId(e,u))._id]){if(!1===t.autorange)continue e;r=o.simpleMap(t.range,t.r2l),p?p[0]<p[1]?(p[0]=Math.min(p[0],r[0]),p[1]=Math.max(p[1],r[1])):(p[0]=Math.max(p[0],r[0]),p[1]=Math.min(p[1],r[1])):p=r}for(u in f)(t=d.getFromId(e,u)).range=o.simpleMap(p,t.l2r),t._input.range=t.range.slice(),t.setScale()}},r.finalDraw=function(e){a.getComponentMethod("rangeslider","draw")(e),a.getComponentMethod("rangeselector","draw")(e)},r.drawMarginPushers=function(e){a.getComponentMethod("legend","draw")(e),a.getComponentMethod("rangeselector","draw")(e),a.getComponentMethod("sliders","draw")(e),a.getComponentMethod("updatemenus","draw")(e),a.getComponentMethod("colorbar","draw")(e)}},{"../components/color":30,"../components/drawing":51,"../components/modebar":89,"../components/titles":118,"../constants/alignment":125,"../lib":148,"../lib/clear_gl_canvases":137,"../plots/cartesian/autorange":191,"../plots/cartesian/axes":192,"../plots/cartesian/constraints":199,"../plots/plots":224,"../registry":232,d3:2}],184:[function(e,t,r){"use strict";var n=e("../lib"),a=n.isPlainObject,i=e("./plot_schema"),o=e("../plots/plots"),l=e("../plots/attributes"),s=e("./plot_template"),c=e("./plot_config").dfltConfig;function u(e,t){e=n.extendDeep({},e);var r,i,o=Object.keys(e).sort();function l(t,r,n){if(a(r)&&a(t))u(t,r);else if(Array.isArray(r)&&Array.isArray(t)){var o=s.arrayTemplater({_template:e},n);for(i=0;i<r.length;i++){var l=r[i],c=o.newItem(l)._template;c&&u(c,l)}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 c=o[r],d=e[c];if(c in t?l(d,t[c],c):t[c]=d,f(c)===c)for(var p in t){var h=f(p);p===h||h!==c||p in e||l(d,t[p],c)}}}function f(e){return e.replace(/[0-9]+$/,"")}function d(e,t,r,i,o){var l=o&&r(o);for(var c in e){var u=e[c],h=p(e,c,i),g=p(e,c,o),v=r(g);if(!v){var m=f(c);m!==c&&(v=r(g=p(e,m,o)))}if((!l||l!==v)&&!(!v||v._noTemplating||"data_array"===v.valType||v.arrayOk&&Array.isArray(u)))if(!v.valType&&a(u))d(u,t,r,h,g);else if(v._isLinkedToArray&&Array.isArray(u))for(var y=!1,x=0,b={},_=0;_<u.length;_++){var w=u[_];if(a(w)){var k=w.name;if(k)b[k]||(d(w,t,r,p(u,x,h),p(u,x,g)),x++,b[k]=1);else if(!y){var T=p(e,s.arrayDefaultKey(c),i),M=p(u,x,h);d(w,t,r,M,p(u,x,g));var A=n.nestedProperty(t,M);n.nestedProperty(t,T).set(A.get()),A.set(null),y=!0}}}else{n.nestedProperty(t,h).set(u)}}}function p(e,t,r){return r?Array.isArray(e)?r+"["+t+"]":r+"."+t:t}function h(e){for(var t=0;t<e.length;t++)if(a(e[t]))return!0}function g(e){var t;switch(e.code){case"data":t="The template has no key data.";break;case"layout":t="The template has no key layout.";break;case"missing":t=e.path?"There are no templates for item "+e.path+" with name "+e.templateitemname:"There are no templates for trace "+e.index+", of type "+e.traceType+".";break;case"unused":t=e.path?"The template item at "+e.path+" was not used in constructing the plot.":e.dataCount?"Some of the templates of type "+e.traceType+" were not used. The template has "+e.templateCount+" traces, the data only has "+e.dataCount+" of this type.":"The template has "+e.templateCount+" traces of type "+e.traceType+" but there are none in the data.";break;case"reused":t="Some of the templates of type "+e.traceType+" were used more than once. The template has "+e.templateCount+" traces, the data has "+e.dataCount+" of this type."}return e.msg=t,e}r.makeTemplate=function(e){e=n.isPlainObject(e)?e:n.getGraphDiv(e),e=n.extendDeep({_context:c},{data:e.data,layout:e.layout}),o.supplyDefaults(e);var t=e.data||[],r=e.layout||{};r._basePlotModules=e._fullLayout._basePlotModules,r._modules=e._fullLayout._modules;var s={data:{},layout:{}};t.forEach(function(e){var t={};d(e,t,function(e,t){return i.getTraceValObject(e,n.nestedProperty({},t).parts)}.bind(null,e));var r=n.coerce(e,{},l,"type"),a=s.data[r];a||(a=s.data[r]=[]),a.push(t)}),d(r,s.layout,function(e,t){return i.getLayoutValObject(e,n.nestedProperty({},t).parts)}.bind(null,r)),delete s.layout.template;var f=r.template;if(a(f)){var p,h,g,v,m,y,x=f.layout;a(x)&&u(x,s.layout);var b=f.data;if(a(b)){for(h in s.data)if(g=b[h],Array.isArray(g)){for(y=(m=s.data[h]).length,v=g.length,p=0;p<y;p++)u(g[p%v],m[p]);for(p=y;p<v;p++)m.push(n.extendDeep({},g[p]))}for(h in b)h in s.data||(s.data[h]=n.extendDeep([],b[h]))}}return s},r.validateTemplate=function(e,t){var r=n.extendDeep({},{_context:c,data:e.data,layout:e.layout}),i=r.layout||{};a(t)||(t=i.template||{});var l=t.layout,s=t.data,u=[];r.layout=i,r.layout.template=t,o.supplyDefaults(r);var d=r._fullLayout,v=r._fullData,m={};if(a(l)?(!function e(t,r){for(var n in t)if("_"!==n.charAt(0)&&a(t[n])){var i,o=f(n),l=[];for(i=0;i<r.length;i++)l.push(p(t,n,r[i])),o!==n&&l.push(p(t,o,r[i]));for(i=0;i<l.length;i++)m[l[i]]=1;e(t[n],l)}}(d,["layout"]),function e(t,r){for(var n in t)if(-1===n.indexOf("defaults")&&a(t[n])){var i=p(t,n,r);m[i]?e(t[n],i):u.push({code:"unused",path:i})}}(l,"layout")):u.push({code:"layout"}),a(s)){for(var y,x={},b=0;b<v.length;b++){var _=v[b];x[y=_.type]=(x[y]||0)+1,_._fullInput._template||u.push({code:"missing",index:_._fullInput.index,traceType:y})}for(y in s){var w=s[y].length,k=x[y]||0;w>k?u.push({code:"unused",traceType:y,templateCount:w,dataCount:k}):k>w&&u.push({code:"reused",traceType:y,templateCount:w,dataCount:k})}}else u.push({code:"data"});if(function e(t,r){for(var n in t)if("_"!==n.charAt(0)){var i=t[n],o=p(t,n,r);a(i)?(Array.isArray(t)&&!1===i._template&&i.templateitemname&&u.push({code:"missing",path:o,templateitemname:i.templateitemname}),e(i,o)):Array.isArray(i)&&h(i)&&e(i,o)}}({data:v,layout:d},""),u.length)return u.map(g)}},{"../lib":148,"../plots/attributes":189,"../plots/plots":224,"./plot_config":180,"./plot_schema":181,"./plot_template":182}],185:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("./plot_api"),i=e("../plots/plots"),o=e("../lib"),l=e("../snapshot/helpers"),s=e("../snapshot/tosvg"),c=e("../snapshot/svgtoimg"),u=e("../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}};t.exports=function(e,t){var r,d,p,h;function g(e){return!(e in t)||o.validate(t[e],f[e])}if(t=t||{},o.isPlainObject(e)?(r=e.data||[],d=e.layout||{},p=e.config||{},h={}):(e=o.getGraphDiv(e),r=o.extendDeep([],e.data),d=o.extendDeep({},e.layout),p=e._context,h=e._fullLayout||{}),!g("width")&&null!==t.width||!g("height")&&null!==t.height)throw new Error("Height and width should be pixel values.");if(!g("format"))throw new Error("Image format is not jpeg, png, svg or webp.");var v={};function m(e,r){return o.coerce(t,v,f,e,r)}var y=m("format"),x=m("width"),b=m("height"),_=m("scale"),w=m("setBackground"),k=m("imageDataOnly"),T=document.createElement("div");T.style.position="absolute",T.style.left="-5000px",document.body.appendChild(T);var M=o.extendFlat({},d);x?M.width=x:null===t.width&&n(h.width)&&(M.width=h.width),b?M.height=b:null===t.height&&n(h.height)&&(M.height=h.height);var A=o.extendFlat({},p,{_exportedPlot:!0,staticPlot:!0,setBackground:w}),L=l.getRedrawFunc(T);function S(){return new Promise(function(e){setTimeout(e,l.getDelay(T._fullLayout))})}function C(){return new Promise(function(e,t){var r=s(T,y,_),n=T._fullLayout.width,f=T._fullLayout.height;function d(){a.purge(T),document.body.removeChild(T)}if("full-json"===y){var p=i.graphJson(T,!1,"keepdata","object",!0,!0);return p.version=u,p=JSON.stringify(p),d(),e(k?p:l.encodeJSON(p))}if(d(),"svg"===y)return e(k?r:l.encodeSVG(r));var h=document.createElement("canvas");h.id=o.randstr(),c({format:y,width:n,height:f,scale:_,canvas:h,svg:r,promise:!0}).then(e).catch(t)})}return new Promise(function(e,t){a.plot(T,r,M,A).then(L).then(S).then(C).then(function(t){e(function(e){return k?e.replace(l.IMAGE_URL_PREFIX,""):e}(t))}).catch(function(e){t(e)})})}},{"../lib":148,"../plots/plots":224,"../snapshot/helpers":236,"../snapshot/svgtoimg":238,"../snapshot/tosvg":240,"../version":271,"./plot_api":179,"fast-isnumeric":4}],186:[function(e,t,r){"use strict";var n=e("../lib"),a=e("../plots/plots"),i=e("./plot_schema"),o=e("./plot_config").dfltConfig,l=n.isPlainObject,s=Array.isArray,c=n.isArrayOrTypedArray;function u(e,t,r,a,i,o){o=o||[];for(var f=Object.keys(e),d=0;d<f.length;d++){var v=f[d];if("transforms"!==v){var m=o.slice();m.push(v);var y=e[v],x=t[v],b=g(r,v),_=(b||{}).valType,w="info_array"===_,k="colorscale"===_,T=(b||{}).items;if(h(r,v))if(l(y)&&l(x)&&"any"!==_)u(y,x,b,a,i,m);else if(w&&s(y)){y.length>x.length&&a.push(p("unused",i,m.concat(x.length)));var M,A,L,S,C,O=x.length,P=Array.isArray(T);if(P&&(O=Math.min(O,T.length)),2===b.dimensions)for(A=0;A<O;A++)if(s(y[A])){y[A].length>x[A].length&&a.push(p("unused",i,m.concat(A,x[A].length)));var D=x[A].length;for(M=0;M<(P?Math.min(D,T[A].length):D);M++)L=P?T[A][M]:T,S=y[A][M],C=x[A][M],n.validate(S,L)?C!==S&&C!==+S&&a.push(p("dynamic",i,m.concat(A,M),S,C)):a.push(p("value",i,m.concat(A,M),S))}else a.push(p("array",i,m.concat(A),y[A]));else for(A=0;A<O;A++)L=P?T[A]:T,S=y[A],C=x[A],n.validate(S,L)?C!==S&&C!==+S&&a.push(p("dynamic",i,m.concat(A),S,C)):a.push(p("value",i,m.concat(A),S))}else if(b.items&&!w&&s(y)){var z,R,E=T[Object.keys(T)[0]],I=[];for(z=0;z<x.length;z++){var F=x[z]._index||z;if((R=m.slice()).push(F),l(y[F])&&l(x[z])){I.push(F);var N=y[F],j=x[z];l(N)&&!1!==N.visible&&!1===j.visible?a.push(p("invisible",i,R)):u(N,j,E,a,i,R)}}for(z=0;z<y.length;z++)(R=m.slice()).push(z),l(y[z])?-1===I.indexOf(z)&&a.push(p("unused",i,R)):a.push(p("object",i,R,y[z]))}else!l(y)&&l(x)?a.push(p("object",i,m,y)):c(y)||!c(x)||w||k?v in t?n.validate(y,b)?"enumerated"===b.valType&&(b.coerceNumber&&y!==+x||y!==x)&&a.push(p("dynamic",i,m,y,x)):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}t.exports=function(e,t){var r,c,f=i.get(),d=[],h={_context:n.extendFlat({},o)};s(e)?(h.data=n.extendDeep([],e),r=e):(h.data=[],r=[],d.push(p("array","data"))),l(t)?(h.layout=n.extendDeep({},t),c=t):(h.layout={},c={},arguments.length>1&&d.push(p("object","layout"))),a.supplyDefaults(h);for(var g=h._fullData,v=r.length,m=0;m<v;m++){var y=r[m],x=["data",m];if(l(y)){var b=g[m],_=b.type,w=f.traces[_].attributes;w.type={valType:"enumerated",values:[_]},!1===b.visible&&!1!==y.visible&&d.push(p("invisible",x)),u(y,b,w,d,x);var k=y.transforms,T=b.transforms;if(k){s(k)||d.push(p("array",x,["transforms"])),x.push("transforms");for(var M=0;M<k.length;M++){var A=["transforms",M],L=k[M].type;if(l(k[M])){var S=f.transforms[L]?f.transforms[L].attributes:{};S.type={valType:"enumerated",values:Object.keys(f.transforms)},u(k[M],T[M],S,d,x,A)}else d.push(p("object",x,A))}}}else d.push(p("object",x))}return u(c,h._fullLayout,function(e,t){for(var r=e.layout.layoutAttributes,a=0;a<t.length;a++){var i=t[a],o=e.traces[i.type],l=o.layoutAttributes;l&&(i.subplot?n.extendFlat(r[o.attributes.subplot.dflt],l):n.extendFlat(r,l))}return r}(f,g),d,"layout"),0===d.length?void 0:d};var f={object:function(e,t){return("layout"===e&&""===t?"The layout argument":"data"===e[0]&&""===t?"Trace "+e[1]+" in the data argument":d(e)+"key "+t)+" must be linked to an object container"},array:function(e,t){return("data"===e?"The data argument":d(e)+"key "+t)+" must be linked to an array container"},schema:function(e,t){return d(e)+"key "+t+" is not part of the schema"},unused:function(e,t,r){var n=l(r)?"container":"key";return d(e)+n+" "+t+" did not get coerced"},dynamic:function(e,t,r,n){return[d(e)+"key",t,"(set to '"+r+"')","got reset to","'"+n+"'","during defaults."].join(" ")},invisible:function(e,t){return(t?d(e)+"item "+t:"Trace "+e[1])+" got defaulted to be not visible"},value:function(e,t,r){return[d(e)+"key "+t,"is set to an invalid value ("+r+")"].join(" ")}};function d(e){return s(e)?"In data trace "+e[1]+", ":"In "+e+", "}function p(e,t,r,a,i){var o,l;r=r||"",s(t)?(o=t[0],l=t[1]):(o=t,l=null);var c=function(e){if(!s(e))return String(e);for(var t="",r=0;r<e.length;r++){var n=e[r];"number"==typeof n?t=t.substr(0,t.length-1)+"["+n+"]":t+=n,r<e.length-1&&(t+=".")}return t}(r),u=f[e](t,c,a,i);return n.log(u),{code:e,container:o,trace:l,path:r,astr:c,msg:u}}function h(e,t){var r=m(t),n=r.keyMinusId,a=r.id;return!!(n in e&&e[n]._isSubplotObj&&a)||t in e}function g(e,t){return t in e?e[t]:e[m(t).keyMinusId]}var v=n.counterRegex("([a-z]+)");function m(e){var t=e.match(v);return{keyMinusId:t&&t[1],id:t&&t[2]}}},{"../lib":148,"../plots/plots":224,"./plot_config":180,"./plot_schema":181}],187:[function(e,t,r){"use strict";t.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"}}}},{}],188:[function(e,t,r){"use strict";var n=e("../lib"),a=e("../plot_api/plot_template");t.exports=function(e,t,r){var i,o,l=r.name,s=r.inclusionAttr||"visible",c=t[l],u=n.isArrayOrTypedArray(e[l])?e[l]:[],f=t[l]=[],d=a.arrayTemplater(t,l,s);for(i=0;i<u.length;i++){var p=u[i];n.isPlainObject(p)?o=d.newItem(p):(o=d.newItem({}))[s]=!1,o._index=i,!1!==o[s]&&r.handleItemDefaults(p,o,t,r),f.push(o)}var h=d.defaultItems();for(i=0;i<h.length;i++)(o=h[i])._index=f.length,r.handleItemDefaults({},o,t,r,{}),f.push(o);if(n.isArrayOrTypedArray(c)){var g=Math.min(c.length,f.length);for(i=0;i<g;i++)n.relinkPrivateKeys(f[i],c[i])}return f}},{"../lib":148,"../plot_api/plot_template":182}],189:[function(e,t,r){"use strict";var n=e("../components/fx/attributes");t.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":60}],190:[function(e,t,r){"use strict";t.exports={xaxis:{valType:"subplotid",dflt:"x",editType:"calc+clearAxisTypes"},yaxis:{valType:"subplotid",dflt:"y",editType:"calc+clearAxisTypes"}}},{}],191:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("../../lib"),i=e("../../constants/numerical").FP_SAFE,o=e("../../registry");function l(e,t){var r,n,i=[],o=s(t),l=c(e,t),u=l.min,f=l.max;if(0===u.length||0===f.length)return a.simpleMap(t.range,t.r2l);var d=u[0].val,p=f[0].val;for(r=1;r<u.length&&d===p;r++)d=Math.min(d,u[r].val);for(r=1;r<f.length&&d===p;r++)p=Math.max(p,f[r].val);var h=!1;if(t.range){var g=a.simpleMap(t.range,t.r2l);h=g[1]<g[0]}"reversed"===t.autorange&&(h=!0,t.autorange=!0);var v,m,y,x,b,_,w=t.rangemode,k="tozero"===w,T="nonnegative"===w,M=t._length,A=M/10,L=function(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},S=0;for(r=0;r<u.length;r++)for(v=u[r],n=0;n<f.length;n++)(_=(m=f[n]).val-v.val-L(v.val,m.val))>0&&((b=M-o(v)-o(m))>A?_/b>S&&(y=v,x=m,S=_/b):_/M>S&&(y={val:v.val,pad:0},x={val:m.val,pad:0},S=_/M));if(d===p){var C=d-1,O=d+1;if(k)if(0===d)i=[0,1];else{var P=(d>0?f:u).reduce(function(e,t){return Math.max(e,o(t))},0),D=d/(1-Math.min(.5,P/M));i=d>0?[0,D]:[D,0]}else i=T?[Math.max(0,C),Math.max(1,O)]:[C,O]}else k?(y.val>=0&&(y={val:0,pad:0}),x.val<=0&&(x={val:0,pad:0})):T&&(y.val-S*o(y)<0&&(y={val:0,pad:0}),x.val<=0&&(x={val:1,pad:0})),S=(x.val-y.val-L(v.val,m.val))/(M-o(y)-o(x)),i=[y.val-S*o(y),x.val+S*o(x)];return h&&i.reverse(),a.simpleMap(i,t.l2r||Number)}function s(e){var t=e._length/20;return"domain"===e.constrain&&e._inputDomain&&(t*=(e._inputDomain[1]-e._inputDomain[0])/(e.domain[1]-e.domain[0])),function(e){return e.pad+(e.extrapad?t:0)}}function c(e,t){var r,n,a,i=t._id,o=e._fullData,l=e._fullLayout,s=[],c=[];function d(e,t){for(r=0;r<t.length;r++){var o=e[t[r]],l=(o._extremes||{})[i];if(!0===o.visible&&l){for(n=0;n<l.min.length;n++)a=l.min[n],u(s,a.val,a.pad,{extrapad:a.extrapad});for(n=0;n<l.max.length;n++)a=l.max[n],f(c,a.val,a.pad,{extrapad:a.extrapad})}}}return d(o,t._traceIndices),d(l.annotations||[],t._annIndices||[]),d(l.shapes||[],t._shapeIndices||[]),{min:s,max:c}}function u(e,t,r,n){d(e,t,r,n,h)}function f(e,t,r,n){d(e,t,r,n,g)}function d(e,t,r,n,a){for(var i=n.tozero,o=n.extrapad,l=!0,s=0;s<e.length&&l;s++){var c=e[s];if(a(c.val,t)&&c.pad>=r&&(c.extrapad||!o)){l=!1;break}a(t,c.val)&&c.pad<=r&&(o||!c.extrapad)&&(e.splice(s,1),s--)}if(l){var u=i&&0===t;e.push({val:t,pad:u?0:r,extrapad:!u&&o})}}function p(e){return n(e)&&Math.abs(e)<i}function h(e,t){return e<=t}function g(e,t){return e>=t}t.exports={getAutoRange:l,makePadFn:s,doAutoRange:function(e,t){if(t.setScale(),t.autorange){t.range=l(e,t),t._r=t.range.slice(),t._rl=a.simpleMap(t._r,t.r2l);var r=t._input,n={};n[t._attr+".range"]=t.range,n[t._attr+".autorange"]=t.autorange,o.call("_storeDirectGUIEdit",e.layout,e._fullLayout._preGUI,n),r.range=t.range.slice(),r.autorange=t.autorange}var i=t._anchorAxis;if(i&&i.rangeslider){var s=i.rangeslider[t._name];s&&"auto"===s.rangemode&&(s.range=l(e,t)),i._input.rangeslider[t._name]=a.extendFlat({},s)}},findExtremes:function(e,t,r){r||(r={});e._m||e.setScale();var a,o,l,s,c,d,h,g,v,m=[],y=[],x=t.length,b=r.padded||!1,_=r.tozero&&("linear"===e.type||"-"===e.type),w="log"===e.type,k=!1,T=r.vpadLinearized||!1;function M(e){if(Array.isArray(e))return k=!0,function(t){return Math.max(Number(e[t]||0),0)};var t=Math.max(Number(e||0),0);return function(){return t}}var A=M((e._m>0?r.ppadplus:r.ppadminus)||r.ppad||0),L=M((e._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),S=M(r.vpadplus||r.vpad),C=M(r.vpadminus||r.vpad);if(!k){if(g=1/0,v=-1/0,w)for(a=0;a<x;a++)(o=t[a])<g&&o>0&&(g=o),o>v&&o<i&&(v=o);else for(a=0;a<x;a++)(o=t[a])<g&&o>-i&&(g=o),o>v&&o<i&&(v=o);t=[g,v],x=2}var O={tozero:_,extrapad:b};function P(r){l=t[r],n(l)&&(d=A(r),h=L(r),T?(s=e.c2l(l)-C(r),c=e.c2l(l)+S(r)):(g=l-C(r),v=l+S(r),w&&g<v/10&&(g=v/10),s=e.c2l(g),c=e.c2l(v)),_&&(s=Math.min(0,s),c=Math.max(0,c)),p(s)&&u(m,s,h,O),p(c)&&f(y,c,d,O))}var D=Math.min(6,x);for(a=0;a<D;a++)P(a);for(a=x-1;a>=D;a--)P(a);return{min:m,max:y,opts:r}},concatExtremes:c}},{"../../constants/numerical":128,"../../lib":148,"../../registry":232,"fast-isnumeric":4}],192:[function(e,t,r){"use strict";var n=e("d3"),a=e("fast-isnumeric"),i=e("../../plots/plots"),o=e("../../registry"),l=e("../../lib"),s=e("../../lib/svg_text_utils"),c=e("../../components/titles"),u=e("../../components/color"),f=e("../../components/drawing"),d=e("./layout_attributes"),p=e("./clean_ticks"),h=e("../../constants/numerical"),g=h.ONEAVGYEAR,v=h.ONEAVGMONTH,m=h.ONEDAY,y=h.ONEHOUR,x=h.ONEMIN,b=h.ONESEC,_=h.MINUS_SIGN,w=h.BADNUM,k=e("../../constants/alignment"),T=k.MID_SHIFT,M=k.CAP_SHIFT,A=k.LINE_SPACING,L=k.OPPOSITE_SIDE,S=t.exports={};S.setConvert=e("./set_convert");var C=e("./axis_autotype"),O=e("./axis_ids");S.id2name=O.id2name,S.name2id=O.name2id,S.cleanId=O.cleanId,S.list=O.list,S.listIds=O.listIds,S.getFromId=O.getFromId,S.getFromTrace=O.getFromTrace;var P=e("./autorange");S.getAutoRange=P.getAutoRange,S.findExtremes=P.findExtremes,S.coerceRef=function(e,t,r,n,a,i){var o=n.charAt(n.length-1),s=r._fullLayout._subplots[o+"axis"],c=n+"ref",u={};return a||(a=s[0]||i),i||(i=a),u[c]={valType:"enumerated",values:s.concat(i?[i]:[]),dflt:a},l.coerce(e,t,u,c)},S.coercePosition=function(e,t,r,n,a,i){var o,s;if("paper"===n||"pixel"===n)o=l.ensureNumber,s=r(a,i);else{var c=S.getFromId(t,n);s=r(a,i=c.fraction2r(i)),o=c.cleanPos}e[a]=o(s)},S.cleanPosition=function(e,t,r){return("paper"===r||"pixel"===r?l.ensureNumber:S.getFromId(t,r).cleanPos)(e)},S.redrawComponents=function(e,t){t=t||S.listIds(e);var r=e._fullLayout;function n(n,a,i,l){for(var s=o.getComponentMethod(n,a),c={},u=0;u<t.length;u++)for(var f=r[S.id2name(t[u])][i],d=0;d<f.length;d++){var p=f[d];if(!c[p]&&(s(e,p),c[p]=1,l))return}}n("annotations","drawOne","_annIndices"),n("shapes","drawOne","_shapeIndices"),n("images","draw","_imgIndices",!0)};var D=S.getDataConversions=function(e,t,r,n){var a,i="x"===r||"y"===r||"z"===r?r:n;if(Array.isArray(i)){if(a={type:C(n),_categories:[]},S.setConvert(a),"category"===a.type)for(var o=0;o<n.length;o++)a.d2c(n[o])}else a=S.getFromTrace(e,t,i);return a?{d2c:a.d2c,c2d:a.c2d}:"ids"===i?{d2c:R,c2d:R}:{d2c:z,c2d:z}};function z(e){return+e}function R(e){return String(e)}S.getDataToCoordFunc=function(e,t,r,n){return D(e,t,r,n).d2c},S.counterLetter=function(e){var t=e.charAt(0);return"x"===t?"y":"y"===t?"x":void 0},S.minDtick=function(e,t,r,n){-1===["log","category","multicategory"].indexOf(e.type)&&n?void 0===e._minDtick?(e._minDtick=t,e._forceTick0=r):e._minDtick&&((e._minDtick/t+1e-6)%1<2e-6&&((r-e._forceTick0)/t%1+1.000001)%1<2e-6?(e._minDtick=t,e._forceTick0=r):((t/e._minDtick+1e-6)%1>2e-6||((r-e._forceTick0)/e._minDtick%1+1.000001)%1>2e-6)&&(e._minDtick=0)):e._minDtick=0},S.saveRangeInitial=function(e,t){for(var r=S.list(e,"",!0),n=!1,a=0;a<r.length;a++){var i=r[a],o=void 0===i._rangeInitial,l=o||!(i.range[0]===i._rangeInitial[0]&&i.range[1]===i._rangeInitial[1]);(o&&!1===i.autorange||t&&l)&&(i._rangeInitial=i.range.slice(),n=!0)}return n},S.saveShowSpikeInitial=function(e,t){for(var r=S.list(e,"",!0),n=!1,a="on",i=0;i<r.length;i++){var o=r[i],l=void 0===o._showSpikeInitial,s=l||!(o.showspikes===o._showspikes);(l||t&&s)&&(o._showSpikeInitial=o.showspikes,n=!0),"on"!==a||o.showspikes||(a="off")}return e._fullLayout._cartesianSpikesEnabled=a,n},S.autoBin=function(e,t,r,n,i,o){var s,c=l.aggNums(Math.min,null,e),u=l.aggNums(Math.max,null,e);if("category"===t.type||"multicategory"===t.type)return{start:c-.5,end:u+.5,size:Math.max(1,Math.round(o)||1),_dataSpan:u-c};if(i||(i=t.calendar),s="log"===t.type?{type:"linear",range:[c,u]}:{type:t.type,range:l.simpleMap([c,u],t.c2r,0,i),calendar:i},S.setConvert(s),o=o&&p.dtick(o,s.type))s.dtick=o,s.tick0=p.tick0(void 0,s.type,i);else{var f;if(r)f=(u-c)/r;else{var d=l.distinctVals(e),h=Math.pow(10,Math.floor(Math.log(d.minDiff)/Math.LN10)),g=h*l.roundUp(d.minDiff/h,[.9,1.9,4.9,9.9],!0);f=Math.max(g,2*l.stdev(e)/Math.pow(e.length,n?.25:.4)),a(f)||(f=1)}S.autoTicks(s,f)}var v,y=s.dtick,x=S.tickIncrement(S.tickFirst(s),y,"reverse",i);if("number"==typeof y)v=(x=function(e,t,r,n,i){var o=0,l=0,s=0,c=0;function u(t){return(1+100*(t-e)/r.dtick)%100<2}for(var f=0;f<t.length;f++)t[f]%1==0?s++:a(t[f])||c++,u(t[f])&&o++,u(t[f]+r.dtick/2)&&l++;var d=t.length-c;if(s===d&&"date"!==r.type)r.dtick<1?e=n-.5*r.dtick:(e-=.5)+r.dtick<n&&(e+=r.dtick);else if(l<.1*d&&(o>.3*d||u(n)||u(i))){var p=r.dtick/2;e+=e+p<n?p:-p}return e}(x,e,s,c,u))+(1+Math.floor((u-x)/y))*y;else for("M"===s.dtick.charAt(0)&&(x=function(e,t,r,n,a){var i=l.findExactDates(t,a);if(i.exactDays>.8){var o=Number(r.substr(1));i.exactYears>.8&&o%12==0?e=S.tickIncrement(e,"M6","reverse")+1.5*m:i.exactMonths>.8?e=S.tickIncrement(e,"M1","reverse")+15.5*m:e-=m/2;var s=S.tickIncrement(e,r);if(s<=n)return s}return e}(x,e,y,c,i)),v=x,0;v<=u;)v=S.tickIncrement(v,y,!1,i),0;return{start:t.c2r(x,0,i),end:t.c2r(v,0,i),size:y,_dataSpan:u-c}},S.prepTicks=function(e){var t=l.simpleMap(e.range,e.r2l);if("auto"===e.tickmode||!e.dtick){var r,n=e.nticks;n||("category"===e.type||"multicategory"===e.type?(r=e.tickfont?1.2*(e.tickfont.size||12):15,n=e._length/r):(r="y"===e._id.charAt(0)?40:80,n=l.constrain(e._length/r,4,9)+1),"radialaxis"===e._name&&(n*=2)),"array"===e.tickmode&&(n*=100),e._roughDTick=(Math.abs(t[1]-t[0])-(e._lBreaks||0))/n,S.autoTicks(e,e._roughDTick),e._minDtick>0&&e.dtick<2*e._minDtick&&(e.dtick=e._minDtick,e.tick0=e.l2r(e._forceTick0))}e.tick0||(e.tick0="date"===e.type?"2000-01-01":0),"date"===e.type&&e.dtick<.1&&(e.dtick=.1),V(e)},S.calcTicks=function(e){S.prepTicks(e);var t=l.simpleMap(e.range,e.r2l);if("array"===e.tickmode)return function(e){var t=e.tickvals,r=e.ticktext,n=new Array(t.length),a=l.simpleMap(e.range,e.r2l),i=1.0001*a[0]-1e-4*a[1],o=1.0001*a[1]-1e-4*a[0],s=Math.min(i,o),c=Math.max(i,o),u=0;Array.isArray(r)||(r=[]);var f="category"===e.type?e.d2l_noadd:e.d2l;"log"===e.type&&"L"!==String(e.dtick).charAt(0)&&(e.dtick="L"+Math.pow(10,Math.floor(Math.min(e.range[0],e.range[1]))-1));for(var d=0;d<t.length;d++){var p=f(t[d]);p>s&&p<c&&(void 0===r[d]?n[u]=S.tickText(e,p):n[u]=U(e,p,String(r[d])),u++)}u<t.length&&n.splice(u,t.length-u);e.rangebreaks&&(n=n.filter(function(t){return e.maskBreaks(t.x)!==w}));return n}(e);e._tmin=S.tickFirst(e);var r=1.0001*t[0]-1e-4*t[1],n=1.0001*t[1]-1e-4*t[0],i=t[1]<t[0];if(e._tmin<r!==i)return[];"category"!==e.type&&"multicategory"!==e.type||(n=i?Math.max(-.5,n):Math.min(e._categories.length-.5,n));var o,s="log"===e.type&&!(a(e.dtick)||"L"===e.dtick.charAt(0));if(function(){var t=null,r=Math.max(1e3,e._length||0);o=[];for(var a=e._tmin;(i?a>=n:a<=n)&&!(o.length>r||a===t);a=S.tickIncrement(a,e.dtick,i,e.calendar)){t=a;var l=!1;s&&a!==(0|a)&&(l=!0),o.push({minor:l,value:a})}}(),e.rangebreaks){if("auto"===e.tickmode)for(var c=0;c<o.length;c++){var u=o[c].value;if(e.maskBreaks(u)===w)for(var f=0;f<e._rangebreaks.length;f++){var d=e._rangebreaks[f];if(u>=d.min&&u<d.max){o[c].value=d.max;break}}}var p=o.length;if(p>2){for(var h,g=2*(e.tickfont?e.tickfont.size:12),v=[],m=i?1:-1,y=i?p-1:0,x=i?0:p-1;m*x<=m*y;x+=m){var b=e.c2p(o[x].value);(void 0===h||Math.abs(b-h)>g)&&(h=b,v.push(o[x]))}o=v.reverse()}}ie(e)&&360===Math.abs(t[1]-t[0])&&o.pop(),e._tmax=(o[o.length-1]||{}).value,e._prevDateHead="",e._inCalcTicks=!0;for(var _=new Array(o.length),k=0;k<o.length;k++){var T=o[k].minor,M=o[k].value;_[k]=S.tickText(e,M,!1,T)}return e._inCalcTicks=!1,_};var E=[2,5,10],I=[1,2,3,6,12],F=[1,2,5,10,15,30],N=[1,2,3,7,14],j=[-.046,0,.301,.477,.602,.699,.778,.845,.903,.954,1],B=[-.301,0,.301,.699,1],H=[15,30,45,90,180];function q(e,t,r){return t*l.roundUp(e/t,r)}function V(e){var t=e.dtick;if(e._tickexponent=0,a(t)||"string"==typeof t||(t=1),"category"!==e.type&&"multicategory"!==e.type||(e._tickround=null),"date"===e.type){var r=e.r2l(e.tick0),n=e.l2r(r).replace(/(^-|i)/g,""),i=n.length;if("M"===String(t).charAt(0))i>10||"01-01"!==n.substr(5)?e._tickround="d":e._tickround=+t.substr(1)%12==0?"y":"m";else if(t>=m&&i<=10||t>=15*m)e._tickround="d";else if(t>=x&&i<=16||t>=y)e._tickround="M";else if(t>=b&&i<=19||t>=x)e._tickround="S";else{var o=e.l2r(r+t).replace(/^-/,"").length;e._tickround=Math.max(i,o)-20,e._tickround<0&&(e._tickround=4)}}else if(a(t)||"L"===t.charAt(0)){var l=e.range.map(e.r2d||Number);a(t)||(t=Number(t.substr(1))),e._tickround=2-Math.floor(Math.log(t)/Math.LN10+.01);var s=Math.max(Math.abs(l[0]),Math.abs(l[1])),c=Math.floor(Math.log(s)/Math.LN10+.01);Math.abs(c)>3&&(Z(e.exponentformat)&&!Y(c)?e._tickexponent=3*Math.round((c-1)/3):e._tickexponent=c)}else e._tickround=null}function U(e,t,r){var n=e.tickfont||{};return{x:t,dx:0,dy:0,text:r||"",fontSize:n.size,font:n.family,fontColor:n.color}}S.autoTicks=function(e,t){var r;function n(e){return Math.pow(e,Math.floor(Math.log(t)/Math.LN10))}if("date"===e.type){e.tick0=l.dateTick0(e.calendar);var i=2*t;i>g?(t/=g,r=n(10),e.dtick="M"+12*q(t,r,E)):i>v?(t/=v,e.dtick="M"+q(t,1,I)):i>m?(e.dtick=q(t,m,e._hasDayOfWeekBreaks?[1,7,14]:N),e.tick0=l.dateTick0(e.calendar,!0)):i>y?e.dtick=q(t,y,I):i>x?e.dtick=q(t,x,F):i>b?e.dtick=q(t,b,F):(r=n(10),e.dtick=q(t,r,E))}else if("log"===e.type){e.tick0=0;var o=l.simpleMap(e.range,e.r2l);if(t>.7)e.dtick=Math.ceil(t);else if(Math.abs(o[1]-o[0])<1){var s=1.5*Math.abs((o[1]-o[0])/t);t=Math.abs(Math.pow(10,o[1])-Math.pow(10,o[0]))/s,r=n(10),e.dtick="L"+q(t,r,E)}else e.dtick=t>.3?"D2":"D1"}else"category"===e.type||"multicategory"===e.type?(e.tick0=0,e.dtick=Math.ceil(Math.max(t,1))):ie(e)?(e.tick0=0,r=1,e.dtick=q(t,r,H)):(e.tick0=0,r=n(10),e.dtick=q(t,r,E));if(0===e.dtick&&(e.dtick=1),!a(e.dtick)&&"string"!=typeof e.dtick){var c=e.dtick;throw e.dtick=1,"ax.dtick error: "+String(c)}},S.tickIncrement=function(e,t,r,i){var o=r?-1:1;if(a(t))return e+o*t;var s=t.charAt(0),c=o*Number(t.substr(1));if("M"===s)return l.incrementMonth(e,c,i);if("L"===s)return Math.log(Math.pow(10,e)+c)/Math.LN10;if("D"===s){var u="D2"===t?B:j,f=e+.01*o,d=l.roundUp(l.mod(f,1),u,r);return Math.floor(f)+Math.log(n.round(Math.pow(10,d),1))/Math.LN10}throw"unrecognized dtick "+String(t)},S.tickFirst=function(e){var t=e.r2l||Number,r=l.simpleMap(e.range,t),i=r[1]<r[0],o=i?Math.floor:Math.ceil,s=1.0001*r[0]-1e-4*r[1],c=e.dtick,u=t(e.tick0);if(a(c)){var f=o((s-u)/c)*c+u;return"category"!==e.type&&"multicategory"!==e.type||(f=l.constrain(f,0,e._categories.length-1)),f}var d=c.charAt(0),p=Number(c.substr(1));if("M"===d){for(var h,g,v,m=0,y=u;m<10;){if(((h=S.tickIncrement(y,c,i,e.calendar))-s)*(y-s)<=0)return i?Math.min(y,h):Math.max(y,h);g=(s-(y+h)/2)/(h-y),v=d+(Math.abs(Math.round(g))||1)*p,y=S.tickIncrement(y,v,g<0?!i:i,e.calendar),m++}return l.error("tickFirst did not converge",e),y}if("L"===d)return Math.log(o((Math.pow(10,s)-u)/p)*p+u)/Math.LN10;if("D"===d){var x="D2"===c?B:j,b=l.roundUp(l.mod(s,1),x,i);return Math.floor(s)+Math.log(n.round(Math.pow(10,b),1))/Math.LN10}throw"unrecognized dtick "+String(c)},S.tickText=function(e,t,r,n){var i,o=U(e,t),s="array"===e.tickmode,c=r||s,u=e.type,f="category"===u?e.d2l_noadd:e.d2l;if(s&&Array.isArray(e.ticktext)){var d=l.simpleMap(e.range,e.r2l),p=(Math.abs(d[1]-d[0])-(e._lBreaks||0))/1e4;for(i=0;i<e.ticktext.length&&!(Math.abs(t-f(e.tickvals[i]))<p);i++);if(i<e.ticktext.length)return o.text=String(e.ticktext[i]),o}function h(n){if(void 0===n)return!0;if(r)return"none"===n;var a={first:e._tmin,last:e._tmax}[n];return"all"!==n&&t!==a}var g=r?"never":"none"!==e.exponentformat&&h(e.showexponent)?"hide":"";if("date"===u?function(e,t,r,n){var i=e._tickround,o=r&&e.hoverformat||S.getTickFormat(e);n&&(i=a(i)?4:{y:"m",m:"d",d:"M",M:"S",S:4}[i]);var s,c=l.formatDate(t.x,o,i,e._dateFormat,e.calendar,e._extraFormat),u=c.indexOf("\n");-1!==u&&(s=c.substr(u+1),c=c.substr(0,u));n&&("00:00:00"===c||"00:00"===c?(c=s,s=""):8===c.length&&(c=c.replace(/:00$/,"")));s&&(r?"d"===i?c+=", "+s:c=s+(c?", "+c:""):e._inCalcTicks&&s===e._prevDateHead||(c+="<br>"+s,e._prevDateHead=s));t.text=c}(e,o,r,c):"log"===u?function(e,t,r,n,i){var o=e.dtick,s=t.x,c=e.tickformat,u="string"==typeof o&&o.charAt(0);"never"===i&&(i="");n&&"L"!==u&&(o="L3",u="L");if(c||"L"===u)t.text=X(Math.pow(10,s),e,i,n);else if(a(o)||"D"===u&&l.mod(s+.01,1)<.1){var f=Math.round(s),d=Math.abs(f),p=e.exponentformat;"power"===p||Z(p)&&Y(f)?(t.text=0===f?1:1===f?"10":"10<sup>"+(f>1?"":_)+d+"</sup>",t.fontSize*=1.25):("e"===p||"E"===p)&&d>2?t.text="1"+p+(f>0?"+":_)+d:(t.text=X(Math.pow(10,s),e,"","fakehover"),"D1"===o&&"y"===e._id.charAt(0)&&(t.dy-=t.fontSize/6))}else{if("D"!==u)throw"unrecognized dtick "+String(o);t.text=String(Math.round(Math.pow(10,l.mod(s,1)))),t.fontSize*=.75}if("D1"===e.dtick){var h=String(t.text).charAt(0);"0"!==h&&"1"!==h||("y"===e._id.charAt(0)?t.dx-=t.fontSize/4:(t.dy+=t.fontSize/2,t.dx+=(e.range[1]>e.range[0]?1:-1)*t.fontSize*(s<0?.5:.25)))}}(e,o,0,c,g):"category"===u?function(e,t){var r=e._categories[Math.round(t.x)];void 0===r&&(r="");t.text=String(r)}(e,o):"multicategory"===u?function(e,t,r){var n=Math.round(t.x),a=e._categories[n]||[],i=void 0===a[1]?"":String(a[1]),o=void 0===a[0]?"":String(a[0]);r?t.text=o+" - "+i:(t.text=i,t.text2=o)}(e,o,r):ie(e)?function(e,t,r,n,a){if("radians"!==e.thetaunit||r)t.text=X(t.x,e,a,n);else{var i=t.x/180;if(0===i)t.text="0";else{var o=function(e){function t(e,t){return Math.abs(e-t)<=1e-6}var r=function(e){var r=1;for(;!t(Math.round(e*r)/r,e);)r*=10;return r}(e),n=e*r,a=Math.abs(function e(r,n){return t(n,0)?r:e(n,r%n)}(n,r));return[Math.round(n/a),Math.round(r/a)]}(i);if(o[1]>=100)t.text=X(l.deg2rad(t.x),e,a,n);else{var s=t.x<0;1===o[1]?1===o[0]?t.text="π":t.text=o[0]+"π":t.text=["<sup>",o[0],"</sup>","⁄","<sub>",o[1],"</sub>","π"].join(""),s&&(t.text=_+t.text)}}}}(e,o,r,c,g):function(e,t,r,n,a){"never"===a?a="":"all"===e.showexponent&&Math.abs(t.x/e.dtick)<1e-6&&(a="hide");t.text=X(t.x,e,a,n)}(e,o,0,c,g),n||(e.tickprefix&&!h(e.showtickprefix)&&(o.text=e.tickprefix+o.text),e.ticksuffix&&!h(e.showticksuffix)&&(o.text+=e.ticksuffix)),"boundaries"===e.tickson||e.showdividers){var v=function(t){var r=e.l2p(t);return r>=0&&r<=e._length?t:null};o.xbnd=[v(o.x-.5),v(o.x+e.dtick-.5)]}return o},S.hoverLabelText=function(e,t,r){if(r!==w&&r!==t)return S.hoverLabelText(e,t)+" - "+S.hoverLabelText(e,r);var n="log"===e.type&&t<=0,a=S.tickText(e,e.c2l(n?-t:t),"hover").text;return n?0===t?"0":_+a:a};var G=["f","p","n","μ","m","","k","M","G","T"];function Z(e){return"SI"===e||"B"===e}function Y(e){return e>14||e<-15}function X(e,t,r,n){var i=e<0,o=t._tickround,s=r||t.exponentformat||"B",c=t._tickexponent,u=S.getTickFormat(t),f=t.separatethousands;if(n){var d={exponentformat:s,dtick:"none"===t.showexponent?t.dtick:a(e)&&Math.abs(e)||1,range:"none"===t.showexponent?t.range.map(t.r2d):[0,e||1]};V(d),o=(Number(d._tickround)||0)+4,c=d._tickexponent,t.hoverformat&&(u=t.hoverformat)}if(u)return t._numFormat(u)(e).replace(/-/g,_);var p,h=Math.pow(10,-o)/2;if("none"===s&&(c=0),(e=Math.abs(e))<h)e="0",i=!1;else{if(e+=h,c&&(e*=Math.pow(10,-c),o+=c),0===o)e=String(Math.floor(e));else if(o<0){e=(e=String(Math.round(e))).substr(0,e.length+o);for(var g=o;g<0;g++)e+="0"}else{var v=(e=String(e)).indexOf(".")+1;v&&(e=e.substr(0,v+o).replace(/\.?0+$/,""))}e=l.numSeparate(e,t._separators,f)}c&&"hide"!==s&&(Z(s)&&Y(c)&&(s="power"),p=c<0?_+-c:"power"!==s?"+"+c:String(c),"e"===s||"E"===s?e+=s+p:"power"===s?e+="×10<sup>"+p+"</sup>":"B"===s&&9===c?e+="B":Z(s)&&(e+=G[c/3+5]));return i?_+e:e}function W(e){return[e.text,e.x,e.axInfo,e.font,e.fontSize,e.fontColor].join("_")}function $(e){var t=e.title.font.size,r=(e.title.text.match(s.BR_TAG_ALL)||[]).length;return e.title.hasOwnProperty("standoff")?r?t*(M+r*A):t*M:r?t*(r+1)*A:t}function J(e,t){var r=e.l2p(t);return r>1&&r<e._length-1}function Q(e){var t=n.select(e),r=t.select(".text-math-group");return r.empty()?t.select("text"):r}function K(e){return e._id+".automargin"}function ee(e){return K(e)+".mirror"}function te(e){return e._id+".rangeslider"}function re(e,t){for(var r=0;r<t.length;r++)-1===e.indexOf(t[r])&&e.push(t[r])}function ne(e,t,r){var n,a,i=[],o=[],s=e.layout;for(n=0;n<t.length;n++)i.push(S.getFromId(e,t[n]));for(n=0;n<r.length;n++)o.push(S.getFromId(e,r[n]));var c=Object.keys(d),u=["anchor","domain","overlaying","position","side","tickangle","editType"],f=["linear","log"];for(n=0;n<c.length;n++){var p=c[n],h=i[0][p],g=o[0][p],v=!0,m=!1,y=!1;if("_"!==p.charAt(0)&&"function"!=typeof h&&-1===u.indexOf(p)){for(a=1;a<i.length&&v;a++){var x=i[a][p];"type"===p&&-1!==f.indexOf(h)&&-1!==f.indexOf(x)&&h!==x?m=!0:x!==h&&(v=!1)}for(a=1;a<o.length&&v;a++){var b=o[a][p];"type"===p&&-1!==f.indexOf(g)&&-1!==f.indexOf(b)&&g!==b?y=!0:o[a][p]!==g&&(v=!1)}v&&(m&&(s[i[0]._name].type="linear"),y&&(s[o[0]._name].type="linear"),ae(s,p,i,o,e._fullLayout._dfltTitle))}}for(n=0;n<e._fullLayout.annotations.length;n++){var _=e._fullLayout.annotations[n];-1!==t.indexOf(_.xref)&&-1!==r.indexOf(_.yref)&&l.swapAttrs(s.annotations[n],["?"])}}function ae(e,t,r,n,a){var i,o=l.nestedProperty,s=o(e[r[0]._name],t).get(),c=o(e[n[0]._name],t).get();for("title"===t&&(s&&s.text===a.x&&(s.text=a.y),c&&c.text===a.y&&(c.text=a.x)),i=0;i<r.length;i++)o(e,r[i]._name+"."+t).set(c);for(i=0;i<n.length;i++)o(e,n[i]._name+"."+t).set(s)}function ie(e){return"angularaxis"===e._id}S.getTickFormat=function(e){var t,r,n,a,i,o,l,s;function c(e){return"string"!=typeof e?e:Number(e.replace("M",""))*v}function u(e,t){var r=["L","D"];if(typeof e==typeof t){if("number"==typeof e)return e-t;var n=r.indexOf(e.charAt(0)),a=r.indexOf(t.charAt(0));return n===a?Number(e.replace(/(L|D)/g,""))-Number(t.replace(/(L|D)/g,"")):n-a}return"number"==typeof e?1:-1}function f(e,t){var r=null===t[0],n=null===t[1],a=u(e,t[0])>=0,i=u(e,t[1])<=0;return(r||a)&&(n||i)}if(e.tickformatstops&&e.tickformatstops.length>0)switch(e.type){case"date":case"linear":for(t=0;t<e.tickformatstops.length;t++)if((n=e.tickformatstops[t]).enabled&&(a=e.dtick,i=n.dtickrange,o=void 0,void 0,void 0,o=c||function(e){return e},l=i[0],s=i[1],(!l&&"number"!=typeof l||o(l)<=o(a))&&(!s&&"number"!=typeof s||o(s)>=o(a)))){r=n;break}break;case"log":for(t=0;t<e.tickformatstops.length;t++)if((n=e.tickformatstops[t]).enabled&&f(e.dtick,n.dtickrange)){r=n;break}}return r?r.value:e.tickformat},S.getSubplots=function(e,t){var r=e._fullLayout._subplots,n=r.cartesian.concat(r.gl2d||[]),a=t?S.findSubplotsWithAxis(n,t):n;return a.sort(function(e,t){var r=e.substr(1).split("y"),n=t.substr(1).split("y");return r[0]===n[0]?+r[1]-+n[1]:+r[0]-+n[0]}),a},S.findSubplotsWithAxis=function(e,t){for(var r=new RegExp("x"===t._id.charAt(0)?"^"+t._id+"y":t._id+"$"),n=[],a=0;a<e.length;a++){var i=e[a];r.test(i)&&n.push(i)}return n},S.makeClipPaths=function(e){var t=e._fullLayout;if(!t._hasOnlyLargeSploms){var r,a,i={_offset:0,_length:t.width,_id:""},o={_offset:0,_length:t.height,_id:""},l=S.list(e,"x",!0),s=S.list(e,"y",!0),c=[];for(r=0;r<l.length;r++)for(c.push({x:l[r],y:o}),a=0;a<s.length;a++)0===r&&c.push({x:i,y:s[a]}),c.push({x:l[r],y:s[a]});var u=t._clips.selectAll(".axesclip").data(c,function(e){return e.x._id+e.y._id});u.enter().append("clipPath").classed("axesclip",!0).attr("id",function(e){return"clip"+t._uid+e.x._id+e.y._id}).append("rect"),u.exit().remove(),u.each(function(e){n.select(this).select("rect").attr({x:e.x._offset||0,y:e.y._offset||0,width:e.x._length||1,height:e.y._length||1})})}},S.draw=function(e,t,r){var n=e._fullLayout;"redraw"===t&&n._paper.selectAll("g.subplot").each(function(e){var t=e[0],r=n._plots[t],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=t&&"redraw"!==t?t:S.listIds(e);return l.syncOrAsync(a.map(function(t){return function(){if(t){var n=S.getFromId(e,t),a=S.drawOne(e,n,r);return n._r=n.range.slice(),n._rl=l.simpleMap(n._r,n.r2l),a}}}))},S.drawOne=function(e,t,r){var n,a,s;r=r||{},t.setScale();var d=e._fullLayout,p=t._id,h=p.charAt(0),g=S.counterLetter(p),v=d._plots[t._mainSubplot];if(v){var m=v[h+"axislayer"],y=t._mainLinePosition,x=t._mainMirrorPosition,b=t._vals=S.calcTicks(t),_=[t.mirror,y,x].join("_");for(n=0;n<b.length;n++)b[n].axInfo=_;t._selections={},t._tickAngles&&(t._prevTickAngles=t._tickAngles),t._tickAngles={},t._depth=null;var w={};if(t.visible){var k,T,M=S.makeTransFn(t);if("boundaries"===t.tickson){var C=function(e,t){var r,n=[],a=function(e,t){var r=e.xbnd[t];null!==r&&n.push(l.extendFlat({},e,{x:r}))};if(t.length){for(r=0;r<t.length;r++)a(t[r],0);a(t[r-1],1)}return n}(0,b);T=S.clipEnds(t,C),k="inside"===t.ticks?T:C}else T=S.clipEnds(t,b),k="inside"===t.ticks?T:b;var O=t._gridVals=T,P=function(e,t){var r,n,a=[],i=function(e,t){var r=e.xbnd[t];null!==r&&a.push(l.extendFlat({},e,{x:r}))};if(e.showdividers&&t.length){for(r=0;r<t.length;r++){var o=t[r];o.text2!==n&&i(o,0),n=o.text2}i(t[r-1],1)}return a}(t,b);if(!d._hasOnlyLargeSploms){var D=t._subplotsWith,z={};for(n=0;n<D.length;n++){a=D[n];var R=(s=d._plots[a])[g+"axis"],E=R._mainAxis._id;if(!z[E]){z[E]=1;var I="x"===h?"M0,"+R._offset+"v"+R._length:"M"+R._offset+",0h"+R._length;S.drawGrid(e,t,{vals:O,counterAxis:R,layer:s.gridlayer.select("."+p),path:I,transFn:M}),S.drawZeroLine(e,t,{counterAxis:R,layer:s.zerolinelayer,path:I,transFn:M})}}}var F=S.getTickSigns(t),N=[];if(t.ticks){var j,B,H,q=S.makeTickPath(t,y,F[2]);if(t._anchorAxis&&t.mirror&&!0!==t.mirror?(j=S.makeTickPath(t,x,F[3]),B=q+j):(j="",B=q),t.showdividers&&"outside"===t.ticks&&"boundaries"===t.tickson){var V={};for(n=0;n<P.length;n++)V[P[n].x]=1;H=function(e){return V[e.x]?j:B}}else H=B;S.drawTicks(e,t,{vals:k,layer:m,path:H,transFn:M}),"allticks"===t.mirror&&(N=Object.keys(t._linepositions||{}))}for(n=0;n<N.length;n++){a=N[n],s=d._plots[a];var G=t._linepositions[a]||[],Z=S.makeTickPath(t,G[0],F[0])+S.makeTickPath(t,G[1],F[1]);S.drawTicks(e,t,{vals:k,layer:s[h+"axislayer"],path:Z,transFn:M})}var Y=[];if(Y.push(function(){return S.drawLabels(e,t,{vals:b,layer:m,transFn:M,labelFns:S.makeLabelFns(t,y)})}),"multicategory"===t.type){var X={x:2,y:10}[h];Y.push(function(){var r={x:"height",y:"width"}[h],n=re()[r]+X+(t._tickAngles[p+"tick"]?t.tickfont.size*A:0);return S.drawLabels(e,t,{vals:function(e,t){for(var r=[],n={},a=0;a<t.length;a++){var i=t[a];n[i.text2]?n[i.text2].push(i.x):n[i.text2]=[i.x]}for(var o in n)r.push(U(e,l.interp(n[o],.5),o));return r}(t,b),layer:m,cls:p+"tick2",repositionOnUpdate:!0,secondary:!0,transFn:M,labelFns:S.makeLabelFns(t,y+n*F[4])})}),Y.push(function(){return t._depth=F[4]*(re("tick2")[t.side]-y),function(e,t,r){var n=t._id+"divider",a=r.vals,i=r.layer.selectAll("path."+n).data(a,W);i.exit().remove(),i.enter().insert("path",":first-child").classed(n,1).classed("crisp",1).call(u.stroke,t.dividercolor).style("stroke-width",f.crispRound(e,t.dividerwidth,1)+"px"),i.attr("transform",r.transFn).attr("d",r.path)}(e,t,{vals:P,layer:m,path:S.makeTickPath(t,y,F[4],t._depth),transFn:M})})}else t.title.hasOwnProperty("standoff")&&Y.push(function(){t._depth=F[4]*(re()[t.side]-y)});var J=o.getComponentMethod("rangeslider","isVisible")(t);return Y.push(function(){var r,n,a,l,s=t.side.charAt(0),c=L[t.side].charAt(0),u=S.getPxPosition(e,t),f="outside"===t.ticks?t.ticklen:0;if((t.automargin||J)&&("multicategory"===t.type?r=re("tick2"):(r=re(),"x"===h&&"b"===s&&(t._depth=Math.max(r.width>0?r.bottom-u:0,f)))),t.automargin){n={x:0,y:0,r:0,l:0,t:0,b:0};var p=[0,1];if("x"===h){if("b"===s?n[s]=t._depth:(n[s]=t._depth=Math.max(r.width>0?u-r.top:0,f),p.reverse()),r.width>0){var v=r.right-(t._offset+t._length);v>0&&(n.xr=1,n.r=v);var m=t._offset-r.left;m>0&&(n.xl=0,n.l=m)}}else if("l"===s?n[s]=t._depth=Math.max(r.height>0?u-r.left:0,f):(n[s]=t._depth=Math.max(r.height>0?r.right-u:0,f),p.reverse()),r.height>0){var y=r.bottom-(t._offset+t._length);y>0&&(n.yb=0,n.b=y);var x=t._offset-r.top;x>0&&(n.yt=1,n.t=x)}n[g]="free"===t.anchor?t.position:t._anchorAxis.domain[p[0]],t.title.text!==d._dfltTitle[h]&&(n[s]+=$(t)+(t.title.standoff||0)),t.mirror&&"free"!==t.anchor&&((a={x:0,y:0,r:0,l:0,t:0,b:0})[c]=t.linewidth,t.mirror&&!0!==t.mirror&&(a[c]+=f),!0===t.mirror||"ticks"===t.mirror?a[g]=t._anchorAxis.domain[p[1]]:"all"!==t.mirror&&"allticks"!==t.mirror||(a[g]=[t._counterDomainMin,t._counterDomainMax][p[1]]))}J&&(l=o.getComponentMethod("rangeslider","autoMarginOpts")(e,t)),i.autoMargin(e,K(t),n),i.autoMargin(e,ee(t),a),i.autoMargin(e,te(t),l)}),r.skipTitle||J&&"bottom"===t.side||Y.push(function(){return function(e,t){var r,n=e._fullLayout,a=t._id,i=a.charAt(0),o=t.title.font.size;if(t.title.hasOwnProperty("standoff"))r=t._depth+t.title.standoff+$(t);else{if("multicategory"===t.type)r=t._depth;else{r=10+1.5*o+(t.linewidth?t.linewidth-1:0)}r+="x"===i?"top"===t.side?o*(t.showticklabels?1:0):o*(t.showticklabels?1.5:.5):"right"===t.side?o*(t.showticklabels?1:.5):o*(t.showticklabels?.5:0)}var l,s,u,d,p=S.getPxPosition(e,t);"x"===i?(s=t._offset+t._length/2,u="top"===t.side?p-r:p+r):(u=t._offset+t._length/2,s="right"===t.side?p+r:p-r,l={rotate:"-90",offset:0});if("multicategory"!==t.type){var h=t._selections[t._id+"tick"];if(d={selection:h,side:t.side},h&&h.node()&&h.node().parentNode){var g=f.getTranslate(h.node().parentNode);d.offsetLeft=g.x,d.offsetTop=g.y}t.title.hasOwnProperty("standoff")&&(d.pad=0)}return c.draw(e,a+"title",{propContainer:t,propName:t._name+".title.text",placeholder:n._dfltTitle[i],avoid:d,transform:l,attributes:{x:s,y:u,"text-anchor":"middle"}})}(e,t)}),l.syncOrAsync(Y)}}function re(e){var r=p+(e||"tick");return w[r]||(w[r]=function(e,t){var r,n,a,i;e._selections[t].size()?(r=1/0,n=-1/0,a=1/0,i=-1/0,e._selections[t].each(function(){var e=Q(this),t=f.bBox(e.node().parentNode);r=Math.min(r,t.top),n=Math.max(n,t.bottom),a=Math.min(a,t.left),i=Math.max(i,t.right)})):(r=0,n=0,a=0,i=0);return{top:r,bottom:n,left:a,right:i,height:n-r,width:i-a}}(t,r)),w[r]}},S.getTickSigns=function(e){var t=e._id.charAt(0),r={x:"top",y:"right"}[t],n=e.side===r?1:-1,a=[-1,1,n,-n];return"inside"!==e.ticks==("x"===t)&&(a=a.map(function(e){return-e})),e.side&&a.push({l:-1,t:-1,r:1,b:1}[e.side.charAt(0)]),a},S.makeTransFn=function(e){var t=e._id.charAt(0),r=e._offset;return"x"===t?function(t){return"translate("+(r+e.l2p(t.x))+",0)"}:function(t){return"translate(0,"+(r+e.l2p(t.x))+")"}},S.makeTickPath=function(e,t,r,n){n=void 0!==n?n:e.ticklen;var a=e._id.charAt(0),i=(e.linewidth||1)/2;return"x"===a?"M0,"+(t+i*r)+"v"+n*r:"M"+(t+i*r)+",0h"+n*r},S.makeLabelFns=function(e,t,r){var n=e._id.charAt(0),i="boundaries"!==e.tickson&&"outside"===e.ticks,o=0,s=0;if(i&&(o+=e.ticklen),r&&"outside"===e.ticks){var c=l.deg2rad(r);o=e.ticklen*Math.cos(c)+1,s=e.ticklen*Math.sin(c)}e.showticklabels&&(i||e.showline)&&(o+=.2*e.tickfont.size);var u,f,d,p,h={labelStandoff:o+=(e.linewidth||1)/2,labelShift:s};return"x"===n?(p="bottom"===e.side?1:-1,u=s*p,f=t+o*p,d="bottom"===e.side?1:-.2,h.xFn=function(e){return e.dx+u},h.yFn=function(e){return e.dy+f+e.fontSize*d},h.anchorFn=function(e,t){return a(t)&&0!==t&&180!==t?t*p<0?"end":"start":"middle"},h.heightFn=function(t,r,n){return r<-60||r>60?-.5*n:"top"===e.side?-n:0}):"y"===n&&(p="right"===e.side?1:-1,u=o,f=-s*p,d=90===Math.abs(e.tickangle)?.5:0,h.xFn=function(e){return e.dx+t+(u+e.fontSize*d)*p},h.yFn=function(e){return e.dy+f+e.fontSize*T},h.anchorFn=function(t,r){return a(r)&&90===Math.abs(r)?"middle":"right"===e.side?"start":"end"},h.heightFn=function(t,r,n){return(r*="left"===e.side?1:-1)<-30?-n:r<30?-.5*n:0}),h},S.drawTicks=function(e,t,r){r=r||{};var n=t._id+"tick",a=r.layer.selectAll("path."+n).data(t.ticks?r.vals:[],W);a.exit().remove(),a.enter().append("path").classed(n,1).classed("ticks",1).classed("crisp",!1!==r.crisp).call(u.stroke,t.tickcolor).style("stroke-width",f.crispRound(e,t.tickwidth,1)+"px").attr("d",r.path),a.attr("transform",r.transFn)},S.drawGrid=function(e,t,r){r=r||{};var n=t._id+"grid",a=r.vals,i=r.counterAxis;if(!1===t.showgrid)a=[];else if(i&&S.shouldShowZeroLine(e,t,i))for(var o="array"===t.tickmode,l=0;l<a.length;l++){var s=a[l].x;if(o?!s:Math.abs(s)<t.dtick/100){if(a=a.slice(0,l).concat(a.slice(l+1)),!o)break;l--}}var c=r.layer.selectAll("path."+n).data(a,W);c.exit().remove(),c.enter().append("path").classed(n,1).classed("crisp",!1!==r.crisp),t._gw=f.crispRound(e,t.gridwidth,1),c.attr("transform",r.transFn).attr("d",r.path).call(u.stroke,t.gridcolor||"#ddd").style("stroke-width",t._gw+"px"),"function"==typeof r.path&&c.attr("d",r.path)},S.drawZeroLine=function(e,t,r){r=r||r;var n=t._id+"zl",a=S.shouldShowZeroLine(e,t,r.counterAxis),i=r.layer.selectAll("path."+n).data(a?[{x:0,id:t._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(e,t){return O.idSort(e.id,t.id)})}),i.attr("transform",r.transFn).attr("d",r.path).call(u.stroke,t.zerolinecolor||u.defaultLine).style("stroke-width",f.crispRound(e,t.zerolinewidth,t._gw||1)+"px")},S.drawLabels=function(e,t,r){r=r||{};var i=e._fullLayout,o=t._id,c=o.charAt(0),u=r.cls||o+"tick",d=r.vals,p=r.labelFns,h=r.secondary?0:t.tickangle,g=(t._prevTickAngles||{})[u],v=r.layer.selectAll("g."+u).data(t.showticklabels?d:[],W),m=[];function y(e,t){e.each(function(e){var i=n.select(this),o=i.select(".text-math-group"),l=p.anchorFn(e,t),c=r.transFn.call(i.node(),e)+(a(t)&&0!=+t?" rotate("+t+","+p.xFn(e)+","+(p.yFn(e)-e.fontSize/2)+")":""),u=s.lineCount(i),d=A*e.fontSize,h=p.heightFn(e,a(t)?+t:0,(u-1)*d);if(h&&(c+=" translate(0, "+h+")"),o.empty())i.select("text").attr({transform:c,"text-anchor":l});else{var g=f.bBox(o.node()).width*{end:-.5,start:.5}[l];o.attr("transform",c+(g?"translate("+g+",0)":""))}})}v.enter().append("g").classed(u,1).append("text").attr("text-anchor","middle").each(function(t){var r=n.select(this),a=e._promises.length;r.call(s.positionText,p.xFn(t),p.yFn(t)).call(f.font,t.font,t.fontSize,t.fontColor).text(t.text).call(s.convertToTspans,e),e._promises[a]?m.push(e._promises.pop().then(function(){y(r,h)})):y(r,h)}),v.exit().remove(),r.repositionOnUpdate&&v.each(function(e){n.select(this).select("text").call(s.positionText,p.xFn(e),p.yFn(e))}),y(v,g+1?g:h);var x=null;t._selections&&(t._selections[u]=v);var b=[function(){return m.length&&Promise.all(m)}];t.automargin&&i._redrawFromAutoMarginCount&&90===g?(x=90,b.push(function(){y(v,g)})):b.push(function(){if(y(v,h),d.length&&"x"===c&&!a(h)&&("log"!==t.type||"D"!==String(t.dtick).charAt(0))){x=0;var e,n=0,i=[];if(v.each(function(e){n=Math.max(n,e.fontSize);var r=t.l2p(e.x),a=Q(this),o=f.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"!==t.tickson&&!t.showdividers||r.secondary){var o=d.length,s=Math.abs((d[o-1].x-d[0].x)*t._m)/(o-1)<2.5*n||"multicategory"===t.type;for(e=0;e<i.length-1;e++)if(l.bBoxIntersect(i[e],i[e+1])){x=s?90:30;break}}else{var u=2;for(t.ticks&&(u+=t.tickwidth/2),e=0;e<i.length;e++){var p=d[e].xbnd,g=i[e];if(null!==p[0]&&g.left-t.l2p(p[0])<u||null!==p[1]&&t.l2p(p[1])-g.right<u){x=90;break}}}x&&y(v,x)}}),t._tickAngles&&b.push(function(){t._tickAngles[u]=null===x?a(h)?h:0:x});var _=l.syncOrAsync(b);return _&&_.then&&e._promises.push(_),_},S.getPxPosition=function(e,t){var r,n=e._fullLayout._size,a=t._id.charAt(0),i=t.side;return"free"!==t.anchor?r=t._anchorAxis:"x"===a?r={_offset:n.t+(1-(t.position||0))*n.h,_length:0}:"y"===a&&(r={_offset:n.l+(t.position||0)*n.w,_length:0}),"top"===i||"left"===i?r._offset:"bottom"===i||"right"===i?r._offset+r._length:void 0},S.shouldShowZeroLine=function(e,t,r){var n=l.simpleMap(t.range,t.r2l);return n[0]*n[1]<=0&&t.zeroline&&("linear"===t.type||"-"===t.type)&&!(t.rangebreaks&&t.maskBreaks(0)===w)&&(J(t,0)||!function(e,t,r,n){var a=r._mainAxis;if(!a)return;var i=e._fullLayout,o=t._id.charAt(0),l=S.counterLetter(t._id),s=t._offset+(Math.abs(n[0])<Math.abs(n[1])==("x"===o)?0:t._length);function c(e){if(!e.showline||!e.linewidth)return!1;var r=Math.max((e.linewidth+t.zerolinewidth)/2,1);function n(e){return"number"==typeof e&&Math.abs(e-s)<r}if(n(e._mainLinePosition)||n(e._mainMirrorPosition))return!0;var a=e._linepositions||{};for(var i in a)if(n(a[i][0])||n(a[i][1]))return!0}var u=i._plots[r._mainSubplot];if(!(u.mainplotinfo||u).overlays.length)return c(r);for(var f=S.list(e,l),d=0;d<f.length;d++){var p=f[d];if(p._mainAxis===a&&c(p))return!0}}(e,t,r,n)||function(e,t){for(var r=e._fullData,n=t._mainSubplot,a=t._id.charAt(0),i=0;i<r.length;i++){var l=r[i];if(!0===l.visible&&l.xaxis+l.yaxis===n){if(o.traceIs(l,"bar-like")&&l.orientation==={x:"h",y:"v"}[a])return!0;if(l.fill&&l.fill.charAt(l.fill.length-1)===a)return!0}}return!1}(e,t))},S.clipEnds=function(e,t){return t.filter(function(t){return J(e,t.x)})},S.allowAutoMargin=function(e){for(var t=S.list(e,"",!0),r=0;r<t.length;r++){var n=t[r];n.automargin&&(i.allowAutoMargin(e,K(n)),n.mirror&&i.allowAutoMargin(e,ee(n))),o.getComponentMethod("rangeslider","isVisible")(n)&&i.allowAutoMargin(e,te(n))}},S.swap=function(e,t){for(var r=function(e,t){var r,n,a=[];for(r=0;r<t.length;r++){var i=[],o=e._fullData[t[r]].xaxis,l=e._fullData[t[r]].yaxis;if(o&&l){for(n=0;n<a.length;n++)-1===a[n].x.indexOf(o)&&-1===a[n].y.indexOf(l)||i.push(n);if(i.length){var s,c=a[i[0]];if(i.length>1)for(n=1;n<i.length;n++)s=a[i[n]],re(c.x,s.x),re(c.y,s.y);re(c.x,[o]),re(c.y,[l])}else a.push({x:[o],y:[l]})}}return a}(e,t),n=0;n<r.length;n++)ne(e,r[n].x,r[n].y)}},{"../../components/color":30,"../../components/drawing":51,"../../components/titles":118,"../../constants/alignment":125,"../../constants/numerical":128,"../../lib":148,"../../lib/svg_text_utils":169,"../../plots/plots":224,"../../registry":232,"./autorange":191,"./axis_autotype":193,"./axis_ids":195,"./clean_ticks":197,"./layout_attributes":204,"./set_convert":210,d3:2,"fast-isnumeric":4}],193:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("../../lib"),i=e("../../constants/numerical").BADNUM;t.exports=function(e,t,r){return!(r=r||{}).noMultiCategory&&(o=e,a.isArrayOrTypedArray(o[0])&&a.isArrayOrTypedArray(o[1]))?"multicategory":function(e,t){for(var r=Math.max(1,(e.length-1)/1e3),i=0,o=0,l={},s=0;s<e.length;s+=r){var c=e[Math.round(s)],u=String(c);l[u]||(l[u]=1,a.isDateTime(c,t)&&(i+=1),n(c)&&(o+=1))}return i>2*o}(e,t)?"date":function(e){for(var t=Math.max(1,(e.length-1)/1e3),r=0,n=0,o={},l=0;l<e.length;l+=t){var s=e[Math.round(l)],c=String(s);o[c]||(o[c]=1,"boolean"==typeof s?n++:a.cleanNumber(s)!==i?r++:"string"==typeof s&&n++)}return n>2*r}(e)?"category":function(e){if(!e)return!1;for(var t=0;t<e.length;t++)if(n(e[t]))return!0;return!1}(e)?"linear":"-";var o}},{"../../constants/numerical":128,"../../lib":148,"fast-isnumeric":4}],194:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("../../registry"),i=e("../../lib"),o=e("../array_container_defaults"),l=e("./layout_attributes"),s=e("./tick_value_defaults"),c=e("./tick_mark_defaults"),u=e("./tick_label_defaults"),f=e("./category_order_defaults"),d=e("./line_grid_defaults"),p=e("./set_convert"),h=e("./constants").WEEKDAY_PATTERN,g=e("./constants").HOUR_PATTERN;function v(e,t,r){function a(r,n){return i.coerce(e,t,l.rangebreaks,r,n)}if(a("enabled")){var o=a("bounds");if(o&&o.length>=2){var s,c,u="";if(2===o.length)for(s=0;s<2;s++)if(c=y(o[s])){u=h;break}var f=a("pattern",u);if(f===h)for(s=0;s<2;s++)(c=y(o[s]))&&(t.bounds[s]=o[s]=c-1);if(f)for(s=0;s<2;s++)switch(c=o[s],f){case h:if(!n(c))return void(t.enabled=!1);if((c=+c)!==Math.floor(c)||c<0||c>=7)return void(t.enabled=!1);t.bounds[s]=o[s]=c;break;case g:if(!n(c))return void(t.enabled=!1);if((c=+c)<0||c>24)return void(t.enabled=!1);t.bounds[s]=o[s]=c}if(!1===r.autorange){var d=r.range;if(d[0]<d[1]){if(o[0]<d[0]&&o[1]>d[1])return void(t.enabled=!1)}else if(o[0]>d[0]&&o[1]<d[1])return void(t.enabled=!1)}}else{var p=a("values");if(!p||!p.length)return void(t.enabled=!1);a("dvalue")}}}t.exports=function(e,t,r,n,g){var m=n.letter,y=n.font||{},x=n.splomStash||{},b=r("visible",!n.visibleDflt),_=t._template||{},w=t.type||_.type||"-";"date"===w&&a.getComponentMethod("calendars","handleDefaults")(e,t,"calendar",n.calendar);p(t,g);var k=!t.isValidRange(e.range);k&&n.reverseDflt&&(k="reversed"),!r("autorange",k)||"linear"!==w&&"-"!==w||r("rangemode"),r("range"),t.cleanRange(),f(e,t,r,n),"category"===w||n.noHover||r("hoverformat");var T=r("color"),M=T!==l.color.dflt?T:y.color,A=x.label||g._dfltTitle[m];if(u(e,t,r,w,n,{pass:1}),!b)return t;r("title.text",A),i.coerceFont(r,"title.font",{family:y.family,size:Math.round(1.2*y.size),color:M}),s(e,t,r,w),u(e,t,r,w,n,{pass:2}),c(e,t,r,n),d(e,t,r,{dfltColor:T,bgColor:n.bgColor,showGrid:n.showGrid,attributes:l}),(t.showline||t.ticks)&&r("mirror"),n.automargin&&r("automargin");var L,S="multicategory"===w;n.noTickson||"category"!==w&&!S||!t.ticks&&!t.showgrid||(S&&(L="boundaries"),r("tickson",L));S&&(r("showdividers")&&(r("dividercolor"),r("dividerwidth")));if("date"===w)if(o(e,t,{name:"rangebreaks",inclusionAttr:"enabled",handleItemDefaults:v}),t.rangebreaks.length){for(var C=0;C<t.rangebreaks.length;C++)if(t.rangebreaks[C].pattern===h){t._hasDayOfWeekBreaks=!0;break}if(p(t,g),g._has("scattergl")||g._has("splom"))for(var O=0;O<n.data.length;O++){var P=n.data[O];"scattergl"!==P.type&&"splom"!==P.type||(P.visible=!1,i.warn(P.type+" traces do not work on axes with rangebreaks. Setting trace "+P.index+" to `visible: false`."))}}else delete t.rangebreaks;return t};var m={sun:1,mon:2,tue:3,wed:4,thu:5,fri:6,sat:7};function y(e){if("string"==typeof e)return m[e.substr(0,3).toLowerCase()]}},{"../../lib":148,"../../registry":232,"../array_container_defaults":188,"./category_order_defaults":196,"./constants":198,"./layout_attributes":204,"./line_grid_defaults":206,"./set_convert":210,"./tick_label_defaults":211,"./tick_mark_defaults":212,"./tick_value_defaults":213,"fast-isnumeric":4}],195:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("./constants");r.id2name=function(e){if("string"==typeof e&&e.match(a.AX_ID_PATTERN)){var t=e.substr(1);return"1"===t&&(t=""),e.charAt(0)+"axis"+t}},r.name2id=function(e){if(e.match(a.AX_NAME_PATTERN)){var t=e.substr(5);return"1"===t&&(t=""),e.charAt(0)+t}},r.cleanId=function(e,t){if(e.match(a.AX_ID_PATTERN)&&(!t||e.charAt(0)===t)){var r=e.substr(1).replace(/^0+/,"");return"1"===r&&(r=""),e.charAt(0)+r}},r.list=function(e,t,n){var a=e._fullLayout;if(!a)return[];var i,o=r.listIds(e,t),l=new Array(o.length);for(i=0;i<o.length;i++){var s=o[i];l[i]=a[s.charAt(0)+"axis"+s.substr(1)]}if(!n){var c=a._subplots.gl3d||[];for(i=0;i<c.length;i++){var u=a[c[i]];t?l.push(u[t+"axis"]):l.push(u.xaxis,u.yaxis,u.zaxis)}}return l},r.listIds=function(e,t){var r=e._fullLayout;if(!r)return[];var n=r._subplots;return t?n[t+"axis"]:n.xaxis.concat(n.yaxis)},r.getFromId=function(e,t,n){var a=e._fullLayout;return"x"===n?t=t.replace(/y[0-9]*/,""):"y"===n&&(t=t.replace(/x[0-9]*/,"")),a[r.id2name(t)]},r.getFromTrace=function(e,t,a){var i=e._fullLayout,o=null;if(n.traceIs(t,"gl3d")){var l=t.scene;"scene"===l.substr(0,5)&&(o=i[l][a+"axis"])}else o=r.getFromId(e,t[a+"axis"]||a);return o},r.idSort=function(e,t){var r=e.charAt(0),n=t.charAt(0);return r!==n?r>n?1:-1:+(e.substr(1)||1)-+(t.substr(1)||1)},r.getAxisGroup=function(e,t){for(var r=e._axisMatchGroups,n=0;n<r.length;n++){if(r[n][t])return"g"+n}return t}},{"../../registry":232,"./constants":198}],196:[function(e,t,r){"use strict";t.exports=function(e,t,r,n){if("category"===t.type){var a,i=e.categoryarray,o=Array.isArray(i)&&i.length>0;o&&(a="array");var l,s=r("categoryorder",a);"array"===s&&(l=r("categoryarray")),o||"array"!==s||(s=t.categoryorder="trace"),"trace"===s?t._initialCategories=[]:"array"===s?t._initialCategories=l.slice():(l=function(e,t){var r,n,a,i=t.dataAttr||e._id.charAt(0),o={};if(t.axData)r=t.axData;else for(r=[],n=0;n<t.data.length;n++){var l=t.data[n];l[i+"axis"]===e._id&&r.push(l)}for(n=0;n<r.length;n++){var s=r[n][i];for(a=0;a<s.length;a++){var c=s[a];null!==c&&void 0!==c&&(o[c]=1)}}return Object.keys(o)}(t,n).sort(),"category ascending"===s?t._initialCategories=l:"category descending"===s&&(t._initialCategories=l.reverse()))}}},{}],197:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("../../lib"),i=e("../../constants/numerical").ONEDAY;r.dtick=function(e,t){var r="log"===t,a="date"===t,o="category"===t,l=a?i:1;if(!e)return l;if(n(e))return(e=Number(e))<=0?l:o?Math.max(1,Math.round(e)):a?Math.max(.1,e):e;if("string"!=typeof e||!a&&!r)return l;var s=e.charAt(0),c=e.substr(1);return(c=n(c)?Number(c):0)<=0||!(a&&"M"===s&&c===Math.round(c)||r&&"L"===s||r&&"D"===s&&(1===c||2===c))?l:e},r.tick0=function(e,t,r,i){return"date"===t?a.cleanDate(e,a.dateTick0(r)):"D1"!==i&&"D2"!==i?n(e)?Number(e):0:void 0}},{"../../constants/numerical":128,"../../lib":148,"fast-isnumeric":4}],198:[function(e,t,r){"use strict";var n=e("../../lib/regex").counter;t.exports={idRegex:{x:n("x"),y:n("y")},attrRegex:n("[xy]axis"),xAxisMatch:n("xaxis"),yAxisMatch:n("yaxis"),AX_ID_PATTERN:/^[xyz][0-9]*$/,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":163}],199:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./axis_ids").id2name,i=e("./scale_zoom"),o=e("./autorange").makePadFn,l=e("./autorange").concatExtremes,s=e("../../constants/numerical").ALMOST_EQUAL,c=e("../../constants/alignment").FROM_BL;function u(e,t,r,n,i){var o,l,s,c,u="range"!==i,f=n[a(t)].type,d=[];for(l=0;l<r.length;l++)if((s=r[l])!==t&&(c=n[a(s)]).type===f)if(c.fixedrange){if(u&&c.anchor){n[a(c.anchor)].fixedrange&&d.push(s)}}else d.push(s);for(o=0;o<e.length;o++)if(e[o][t]){var p=e[o],h=[];for(l=0;l<d.length;l++)p[s=d[l]]||h.push(s);return{linkableAxes:h,thisGroup:p}}return{linkableAxes:d,thisGroup:null}}function f(e,t,r,n,a){var i,o,l,s,c;null===t?((t={})[r]=1,c=e.length,e.push(t)):c=e.indexOf(t);var u=Object.keys(t);for(i=0;i<e.length;i++)if(l=e[i],i!==c&&l[n]){var f=l[n];for(o=0;o<u.length;o++)l[s=u[o]]=f*a*t[s];return void e.splice(c,1)}if(1!==a)for(o=0;o<u.length;o++)t[u[o]]*=a;t[n]=1}function d(e,t){var r=e._inputDomain,n=c[e.constraintoward],a=r[0]+(r[1]-r[0])*n;e.domain=e._input.domain=[a+(r[0]-a)/t,a+(r[1]-a)/t],e.setScale()}r.handleConstraintDefaults=function(e,t,r,a){var i,o,l,s,c=a.allAxisIds,d=a.layoutOut,p=a.scaleanchorDflt,h=a.constrainDflt,g=d._axisConstraintGroups,v=d._axisMatchGroups,m=t._id,y=m.charAt(0),x=((d._splomAxes||{})[y]||{})[m]||{},b=t._id,_=b.charAt(0),w=r("constrain",h);if(n.coerce(e,t,{constraintoward:{valType:"enumerated",values:"x"===_?["left","center","right"]:["bottom","middle","top"],dflt:"x"===_?"center":"middle"}},"constraintoward"),!e.matches&&!x.matches||t.fixedrange||(o=u(v,b,c,d),i=n.coerce(e,t,{matches:{valType:"enumerated",values:o.linkableAxes||[],dflt:x.matches}},"matches")),i||t.fixedrange&&"domain"!==w||!e.scaleanchor&&!p||(s=u(g,b,c,d,w),l=n.coerce(e,t,{scaleanchor:{valType:"enumerated",values:s.linkableAxes||[]}},"scaleanchor",p)),i?(delete t.constrain,f(v,o.thisGroup,b,i,1)):-1!==c.indexOf(e.matches)&&n.warn("ignored "+t._name+'.matches: "'+e.matches+'" to avoid either an infinite loop or because the target axis has fixed range.'),l){var k=r("scaleratio");k||(k=t.scaleratio=1),f(g,s.thisGroup,b,l,k)}else-1!==c.indexOf(e.scaleanchor)&&n.warn("ignored "+t._name+'.scaleanchor: "'+e.scaleanchor+'" to avoid either an infinite loop and possibly inconsistent scaleratios, or because the target axis has fixed range or this axis declares a *matches* constraint.')},r.enforce=function(e){var t,r,n,c,u,f,p,h=e._fullLayout,g=h._axisConstraintGroups||[];for(t=0;t<g.length;t++){var v=g[t],m=Object.keys(v),y=1/0,x=0,b=1/0,_={},w={},k=!1;for(r=0;r<m.length;r++)w[n=m[r]]=c=h[a(n)],c._inputDomain?c.domain=c._inputDomain.slice():c._inputDomain=c.domain.slice(),c._inputRange||(c._inputRange=c.range.slice()),c.setScale(),_[n]=u=Math.abs(c._m)/v[n],y=Math.min(y,u),"domain"!==c.constrain&&c._constraintShrinkable||(b=Math.min(b,u)),delete c._constraintShrinkable,x=Math.max(x,u),"domain"===c.constrain&&(k=!0);if(!(y>s*x)||k)for(r=0;r<m.length;r++)if(u=_[n=m[r]],f=(c=w[n]).constrain,u!==b||"domain"===f)if(p=u/b,"range"===f)i(c,p);else{var T=c._inputDomain,M=(c.domain[1]-c.domain[0])/(T[1]-T[0]),A=(c.r2l(c.range[1])-c.r2l(c.range[0]))/(c.r2l(c._inputRange[1])-c.r2l(c._inputRange[0]));if((p/=M)*A<1){c.domain=c._input.domain=T.slice(),i(c,p);continue}if(A<1&&(c.range=c._input.range=c._inputRange.slice(),p*=A),c.autorange){var L=c.r2l(c.range[0]),S=c.r2l(c.range[1]),C=(L+S)/2,O=C,P=C,D=Math.abs(S-C),z=C-D*p*1.0001,R=C+D*p*1.0001,E=o(c);d(c,p);var I,F,N=Math.abs(c._m),j=l(e,c),B=j.min,H=j.max;for(F=0;F<B.length;F++)(I=B[F].val-E(B[F])/N)>z&&I<O&&(O=I);for(F=0;F<H.length;F++)(I=H[F].val+E(H[F])/N)<R&&I>P&&(P=I);p/=(P-O)/(2*D),O=c.l2r(O),P=c.l2r(P),c.range=c._input.range=L<S?[O,P]:[P,O]}d(c,p)}}},r.clean=function(e,t){if(t._inputDomain){for(var r=!1,n=t._id,a=e._fullLayout._axisConstraintGroups,i=0;i<a.length;i++)if(a[i][n]){r=!0;break}r&&"domain"===t.constrain||(t._input.domain=t.domain=t._inputDomain,delete t._inputDomain)}}},{"../../constants/alignment":125,"../../constants/numerical":128,"../../lib":148,"./autorange":191,"./axis_ids":195,"./scale_zoom":208}],200:[function(e,t,r){"use strict";var n=e("d3"),a=e("tinycolor2"),i=e("has-passive-events"),o=e("../../registry"),l=e("../../lib"),s=e("../../lib/svg_text_utils"),c=e("../../components/color"),u=e("../../components/drawing"),f=e("../../components/fx"),d=e("./axes"),p=e("../../lib/setcursor"),h=e("../../components/dragelement"),g=e("../../constants/alignment").FROM_TL,v=e("../../lib/clear_gl_canvases"),m=e("../../plot_api/subroutines").redrawReglTraces,y=e("../plots"),x=e("./axis_ids").getFromId,b=e("./select").prepSelect,_=e("./select").clearSelect,w=e("./select").selectOnClick,k=e("./scale_zoom"),T=e("./constants"),M=T.MINDRAG,A=T.MINZOOM,L=!0;function S(e,t,r,n){var a=l.ensureSingle(e.draglayer,t,r,function(t){t.classed("drag",!0).style({fill:"transparent","stroke-width":0}).attr("data-subplot",e.id)});return a.call(p,n),a.node()}function C(e,t,r,a,i,o,l){var s=S(e,"rect",t,r);return n.select(s).call(u.setRect,a,i,o,l),s}function O(e,t){for(var r=0;r<e.length;r++)if(!e[r].fixedrange)return t;return""}function P(e,t,r,n,a){for(var i=0;i<e.length;i++){var o=e[i];if(!o.fixedrange)if(o.rangebreaks){var l="y"===o._id.charAt(0),s=l?1-t:t,c=l?1-r:r;n[o._name+".range[0]"]=o.l2r(o.p2l(s*o._length)),n[o._name+".range[1]"]=o.l2r(o.p2l(c*o._length))}else{var u=o._rl[0],f=o._rl[1]-u;n[o._name+".range[0]"]=o.l2r(u+f*t),n[o._name+".range[1]"]=o.l2r(u+f*r)}}if(a&&a.length){var d=(t+(1-r))/2;P(a,d,1-d,n,[])}}function D(e,t){for(var r=0;r<e.length;r++){var n=e[r];if(!n.fixedrange)if(n.rangebreaks){var a=n._length,i=(n.p2l(0+t)-n.p2l(0)+(n.p2l(a+t)-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]-t/n._m),n.l2r(n._rl[1]-t/n._m)]}}function z(e){return 1-(e>=0?Math.min(e,.9):1/(1/Math.max(e,-.3)+3.222))}function R(e,t,r,n,a){return e.append("path").attr("class","zoombox").style({fill:t>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform","translate("+r+", "+n+")").attr("d",a+"Z")}function E(e,t,r){return e.append("path").attr("class","zoombox-corners").style({fill:c.background,stroke:c.defaultLine,"stroke-width":1,opacity:0}).attr("transform","translate("+t+", "+r+")").attr("d","M0,0Z")}function I(e,t,r,n,a,i){e.attr("d",n+"M"+r.l+","+r.t+"v"+r.h+"h"+r.w+"v-"+r.h+"h-"+r.w+"Z"),F(e,t,a,i)}function F(e,t,r,n){r||(e.transition().style("fill",n>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),t.transition().style("opacity",1).duration(200))}function N(e){n.select(e).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function j(e){L&&e.data&&e._context.showTips&&(l.notifier(l._(e,"Double-click to zoom back out"),"long"),L=!1)}function B(e){return"lasso"===e||"select"===e}function H(e){var t=Math.floor(Math.min(e.b-e.t,e.r-e.l,A)/2);return"M"+(e.l-3.5)+","+(e.t-.5+t)+"h3v"+-t+"h"+t+"v-3h-"+(t+3)+"ZM"+(e.r+3.5)+","+(e.t-.5+t)+"h-3v"+-t+"h"+-t+"v-3h"+(t+3)+"ZM"+(e.r+3.5)+","+(e.b+.5-t)+"h-3v"+t+"h"+-t+"v3h"+(t+3)+"ZM"+(e.l-3.5)+","+(e.b+.5-t)+"h3v"+t+"h"+t+"v3h-"+(t+3)+"Z"}function q(e,t,r,n){for(var a,i,o,s,c=!1,u={},f={},d=0;d<t.length;d++){var p=t[d];for(a in r)if(p[a]){for(o in p)("x"===o.charAt(0)?r:n)[o]||(u[o]=a);for(i in n)p[i]&&(c=!0)}for(i in n)if(p[i])for(s in p)("x"===s.charAt(0)?r:n)[s]||(f[s]=i)}c&&(l.extendFlat(u,f),f={});var h={},g=[];for(o in u){var v=x(e,o);g.push(v),h[v._id]=v}var m={},y=[];for(s in f){var b=x(e,s);y.push(b),m[b._id]=b}return{xaHash:h,yaHash:m,xaxes:g,yaxes:y,xLinks:u,yLinks:f,isSubplotConstrained:c}}function V(e,t){if(i){var r=void 0!==e.onwheel?"wheel":"mousewheel";e._onwheel&&e.removeEventListener(r,e._onwheel),e._onwheel=t,e.addEventListener(r,t,{passive:!1})}else void 0!==e.onwheel?e.onwheel=t:void 0!==e.onmousewheel&&(e.onmousewheel=t)}function U(e){var t=[];for(var r in e)t.push(e[r]);return t}t.exports={makeDragBox:function(e,t,r,i,c,p,L,S){var F,G,Z,Y,X,W,$,J,Q,K,ee,te,re,ne,ae,ie,oe,le,se,ce,ue,fe=e._fullLayout._zoomlayer,de=L+S==="nsew",pe=1===(L+S).length;function he(){if(F=t.xaxis,G=t.yaxis,Q=F._length,K=G._length,$=F._offset,J=G._offset,(Z={})[F._id]=F,(Y={})[G._id]=G,L&&S)for(var r=t.overlays,n=0;n<r.length;n++){var a=r[n].xaxis;Z[a._id]=a;var i=r[n].yaxis;Y[i._id]=i}X=U(Z),W=U(Y),re=O(X,S),ne=O(W,L),ae=!ne&&!re,ee=q(e,e._fullLayout._axisConstraintGroups,Z,Y),te=q(e,e._fullLayout._axisMatchGroups,Z,Y),ie=S||ee.isSubplotConstrained||te.isSubplotConstrained,oe=L||ee.isSubplotConstrained||te.isSubplotConstrained;var o=e._fullLayout;le=o._has("scattergl"),se=o._has("splom"),ce=o._has("svg")}he();var ge=function(e,t,r){return e?"nsew"===e?r?"":"pan"===t?"move":"crosshair":e.toLowerCase()+"-resize":"pointer"}(ne+re,e._fullLayout.dragmode,de),ve=C(t,L+S+"drag",ge,r,i,c,p);if(ae&&!de)return ve.onmousedown=null,ve.style.pointerEvents="none",ve;var me,ye,xe,be,_e,we,ke,Te,Me,Ae,Le={element:ve,gd:e,plotinfo:t};function Se(){Le.plotinfo.selection=!1,_(e)}function Ce(r,a){var i=e._fullLayout.clickmode;if(N(e),2!==r||pe||function(){if(!e._transitioningWithDuration){var t=e._context.doubleClick,r=[];re&&(r=r.concat(X)),ne&&(r=r.concat(W)),te.xaxes&&(r=r.concat(te.xaxes)),te.yaxes&&(r=r.concat(te.yaxes));var n,a,i,l={};if("reset+autosize"===t)for(t="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){t="reset";break}if("autosize"===t)for(a=0;a<r.length;a++)(n=r[a]).fixedrange||(l[n._name+".autorange"]=!0);else if("reset"===t)for((re||ee.isSubplotConstrained)&&(r=r.concat(ee.xaxes)),ne&&!ee.isSubplotConstrained&&(r=r.concat(ee.yaxes)),ee.isSubplotConstrained&&(re?ne||(r=r.concat(W)):r=r.concat(X)),a=0;a<r.length;a++)(n=r[a]).fixedrange||(n._rangeInitial?(i=n._rangeInitial,l[n._name+".range[0]"]=i[0],l[n._name+".range[1]"]=i[1]):l[n._name+".autorange"]=!0);e.emit("plotly_doubleclick",null),o.call("_guiRelayout",e,l)}}(),de)i.indexOf("select")>-1&&w(a,e,X,W,t.id,Le),i.indexOf("event")>-1&&f.click(e,a,t.id);else if(1===r&&pe){var l=L?G:F,c="s"===L||"w"===S?0:1,u=l._name+".range["+c+"]",d=function(e,t){var r,a=e.range[t],i=Math.abs(a-e.range[1-t]);return"date"===e.type?a:"log"===e.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))}(l,c),p="left",h="middle";if(l.fixedrange)return;L?(h="n"===L?"top":"bottom","right"===l.side&&(p="right")):"e"===S&&(p="right"),e._context.showAxisRangeEntryBoxes&&n.select(ve).call(s.makeEditable,{gd:e,immediate:!0,background:e._fullLayout.paper_bgcolor,text:String(d),fill:l.tickfont?l.tickfont.color:"#444",horizontalAlign:p,verticalAlign:h}).on("edit",function(t){var r=l.d2r(t);void 0!==r&&o.call("_guiRelayout",e,u,r)})}}function Oe(t,r){if(e._transitioningWithDuration)return!1;var n=Math.max(0,Math.min(Q,t+me)),a=Math.max(0,Math.min(K,r+ye)),i=Math.abs(n-me),o=Math.abs(a-ye);function l(){ke="",xe.r=xe.l,xe.t=xe.b,Me.attr("d","M0,0Z")}if(xe.l=Math.min(me,n),xe.r=Math.max(me,n),xe.t=Math.min(ye,a),xe.b=Math.max(ye,a),ee.isSubplotConstrained)i>A||o>A?(ke="xy",i/Q>o/K?(o=i*K/Q,ye>a?xe.t=ye-o:xe.b=ye+o):(i=o*Q/K,me>n?xe.l=me-i:xe.r=me+i),Me.attr("d",H(xe))):l();else if(te.isSubplotConstrained)if(i>A||o>A){ke="xy";var s=Math.min(xe.l/Q,(K-xe.b)/K),c=Math.max(xe.r/Q,(K-xe.t)/K);xe.l=s*Q,xe.r=c*Q,xe.b=(1-s)*K,xe.t=(1-c)*K,Me.attr("d",H(xe))}else l();else!ne||o<Math.min(Math.max(.6*i,M),A)?i<M||!re?l():(xe.t=0,xe.b=K,ke="x",Me.attr("d",function(e,t){return"M"+(e.l-.5)+","+(t-A-.5)+"h-3v"+(2*A+1)+"h3ZM"+(e.r+.5)+","+(t-A-.5)+"h3v"+(2*A+1)+"h-3Z"}(xe,ye))):!re||i<Math.min(.6*o,A)?(xe.l=0,xe.r=Q,ke="y",Me.attr("d",function(e,t){return"M"+(t-A-.5)+","+(e.t-.5)+"v-3h"+(2*A+1)+"v3ZM"+(t-A-.5)+","+(e.b+.5)+"v3h"+(2*A+1)+"v-3Z"}(xe,me))):(ke="xy",Me.attr("d",H(xe)));xe.w=xe.r-xe.l,xe.h=xe.b-xe.t,ke&&(Ae=!0),e._dragged=Ae,I(Te,Me,xe,_e,we,be),Pe(),e.emit("plotly_relayouting",ue),we=!0}function Pe(){ue={},"xy"!==ke&&"x"!==ke||(P(X,xe.l/Q,xe.r/Q,ue,ee.xaxes),Ne("x",ue)),"xy"!==ke&&"y"!==ke||(P(W,(K-xe.b)/K,(K-xe.t)/K,ue,ee.yaxes),Ne("y",ue))}function De(){Pe(),N(e),Be(),j(e)}Le.prepFn=function(t,r,n){var i=Le.dragmode,o=e._fullLayout.dragmode;o!==i&&(Le.dragmode=o),he(),ae||(de?t.shiftKey?"pan"===o?o="zoom":B(o)||(o="pan"):t.ctrlKey&&(o="pan"):o="pan"),Le.minDrag="lasso"===o?1:void 0,B(o)?(Le.xaxes=X,Le.yaxes=W,b(t,r,n,Le,o)):(Le.clickFn=Ce,B(i)&&Se(),ae||("zoom"===o?(Le.moveFn=Oe,Le.doneFn=De,Le.minDrag=1,function(t,r,n){var i=ve.getBoundingClientRect();me=r-i.left,ye=n-i.top,xe={l:me,r:me,w:0,t:ye,b:ye,h:0},be=e._hmpixcount?e._hmlumcount/e._hmpixcount:a(e._fullLayout.plot_bgcolor).getLuminance(),we=!1,ke="xy",Ae=!1,Te=R(fe,be,$,J,_e="M0,0H"+Q+"V"+K+"H0V0"),Me=E(fe,$,J)}(0,r,n)):"pan"===o&&(Le.moveFn=Fe,Le.doneFn=Be))),e._fullLayout._redrag=function(){var t=e._dragdata;t&&t.element===ve&&(B(e._fullLayout.dragmode)||(he(),He([0,0,Q,K]),Le.moveFn(t.dx,t.dy)))}},h.init(Le);var ze=[0,0,Q,K],Re=null,Ee=T.REDRAWDELAY,Ie=t.mainplot?e._fullLayout._plots[t.mainplot]:t;function Fe(t,r){if(!e._transitioningWithDuration){if(e._fullLayout._replotting=!0,"ew"===re||"ns"===ne)return re&&(D(X,t),Ne("x")),ne&&(D(W,r),Ne("y")),He([re?-t:0,ne?-r:0,Q,K]),je(),void e.emit("plotly_relayouting",ue);if(ee.isSubplotConstrained&&re&&ne){var n="w"===re==("n"===ne)?1:-1,a=(t/Q+n*r/K)/2;t=a*Q,r=n*a*K}"w"===re?t=s(X,0,t):"e"===re?t=s(X,1,-t):re||(t=0),"n"===ne?r=s(W,1,r):"s"===ne?r=s(W,0,-r):ne||(r=0);var i="w"===re?t:0,o="n"===ne?r:0;if(ee.isSubplotConstrained){var l;if(!re&&1===ne.length){for(l=0;l<X.length;l++)X[l].range=X[l]._r.slice(),k(X[l],1-r/K);i=(t=r*Q/K)/2}if(!ne&&1===re.length){for(l=0;l<W.length;l++)W[l].range=W[l]._r.slice(),k(W[l],1-t/Q);o=(r=t*K/Q)/2}}Ne("x"),Ne("y"),He([i,o,Q-t,K-r]),je(),e.emit("plotly_relayouting",ue)}function s(e,t,r){for(var n,a,i=1-t,o=0;o<e.length;o++){var l=e[o];if(!l.fixedrange){n=l,a=l._rl[i]+(l._rl[t]-l._rl[i])/z(r/l._length);var s=l.l2r(a);!1!==s&&void 0!==s&&(l.range[t]=s)}}return n._length*(n._rl[t]-a)/(n._rl[t]-n._rl[i])}}function Ne(e,t){for(var r=te.isSubplotConstrained?{x:W,y:X}[e]:te[e+"axes"],n=te.isSubplotConstrained?{x:X,y:W}[e]:[],a=0;a<r.length;a++){var i=r[a],o=i._id,l=te.xLinks[o]||te.yLinks[o],s=n[0]||Z[l]||Y[l];s&&(t?(t[i._name+".range[0]"]=t[s._name+".range[0]"],t[i._name+".range[1]"]=t[s._name+".range[1]"]):i.range=s.range.slice())}}function je(){var t,r=[];function n(e){for(t=0;t<e.length;t++)e[t].fixedrange||r.push(e[t]._id)}for(ie&&(n(X),n(ee.xaxes),n(te.xaxes)),oe&&(n(W),n(ee.yaxes),n(te.yaxes)),ue={},t=0;t<r.length;t++){var a=r[t],i=x(e,a);d.drawOne(e,i,{skipTitle:!0}),ue[i._name+".range[0]"]=i.range[0],ue[i._name+".range[1]"]=i.range[1]}d.redrawComponents(e,r)}function Be(){He([0,0,Q,K]),l.syncOrAsync([y.previousPromises,function(){e._fullLayout._replotting=!1,o.call("_guiRelayout",e,ue)}],e)}function He(t){var r,n,a,i,s=e._fullLayout,c=s._plots,f=s._subplots.cartesian;if(se&&o.subplotsRegistry.splom.drag(e),le)for(r=0;r<f.length;r++)if(a=(n=c[f[r]]).xaxis,i=n.yaxis,n._scene){var d=l.simpleMap(a.range,a.r2l),p=l.simpleMap(i.range,i.r2l);n._scene.update({range:[d[0],p[0],d[1],p[1]]})}if((se||le)&&(v(e),m(e)),ce){var h=t[2]/F._length,g=t[3]/G._length;for(r=0;r<f.length;r++){a=(n=c[f[r]]).xaxis,i=n.yaxis;var y,x,b,_,w=ie&&!a.fixedrange&&Z[a._id],k=oe&&!i.fixedrange&&Y[i._id];if(w?(y=h,b=S?t[0]:Ue(a,y)):te.xaHash[a._id]?(y=h,b=t[0]*a._length/F._length):te.yaHash[a._id]?(y=g,b="ns"===ne?-t[1]*a._length/G._length:Ue(a,y,{n:"top",s:"bottom"}[ne])):b=Ve(a,y=qe(a,h,g)),k?(x=g,_=L?t[1]:Ue(i,x)):te.yaHash[i._id]?(x=g,_=t[1]*i._length/G._length):te.xaHash[i._id]?(x=h,_="ew"===re?-t[0]*i._length/F._length:Ue(i,x,{e:"right",w:"left"}[re])):_=Ve(i,x=qe(i,h,g)),y||x){y||(y=1),x||(x=1);var T=a._offset-b/y,M=i._offset-_/x;n.clipRect.call(u.setTranslate,b,_).call(u.setScale,y,x),n.plot.call(u.setTranslate,T,M).call(u.setScale,1/y,1/x),y===n.xScaleFactor&&x===n.yScaleFactor||(u.setPointGroupScale(n.zoomScalePts,y,x),u.setTextPointsScale(n.zoomScaleTxt,y,x)),u.hideOutsideRangePoints(n.clipOnAxisFalseTraces,n),n.xScaleFactor=y,n.yScaleFactor=x}}}}function qe(e,t,r){return e.fixedrange?0:ie&&ee.xaHash[e._id]?t:oe&&(ee.isSubplotConstrained?ee.xaHash:ee.yaHash)[e._id]?r:0}function Ve(e,t){return t?(e.range=e._r.slice(),k(e,t),Ue(e,t)):0}function Ue(e,t,r){return e._length*(1-t)*g[r||e.constraintoward||"middle"]}return L.length*S.length!=1&&V(ve,function(t){if(e._context._scrollZoom.cartesian||e._fullLayout._enablescrollzoom){if(Se(),e._transitioningWithDuration)return t.preventDefault(),void t.stopPropagation();he(),clearTimeout(Re);var r=-t.deltaY;if(isFinite(r)||(r=t.wheelDelta/10),isFinite(r)){var n,a=Math.exp(-Math.min(Math.max(r,-20),20)/200),i=Ie.draglayer.select(".nsewdrag").node().getBoundingClientRect(),o=(t.clientX-i.left)/i.width,s=(i.bottom-t.clientY)/i.height;if(ie){for(S||(o=.5),n=0;n<X.length;n++)c(X[n],o,a);Ne("x"),ze[2]*=a,ze[0]+=ze[2]*o*(1/a-1)}if(oe){for(L||(s=.5),n=0;n<W.length;n++)c(W[n],s,a);Ne("y"),ze[3]*=a,ze[1]+=ze[3]*(1-s)*(1/a-1)}He(ze),je(),e.emit("plotly_relayouting",ue),Re=setTimeout(function(){ze=[0,0,Q,K],Be()},Ee),t.preventDefault()}else l.log("Did not find wheel motion attributes: ",t)}function c(e,t,r){if(!e.fixedrange){var n=l.simpleMap(e.range,e.r2l),a=n[0]+(n[1]-n[0])*t;e.range=n.map(function(t){return e.l2r(a+(t-a)*r)})}}}),ve},makeDragger:S,makeRectDragger:C,makeZoombox:R,makeCorners:E,updateZoombox:I,xyCorners:H,transitionZoombox:F,removeZoombox:N,showDoubleClickNotifier:j,attachWheelEventHandler:V}},{"../../components/color":30,"../../components/dragelement":48,"../../components/drawing":51,"../../components/fx":69,"../../constants/alignment":125,"../../lib":148,"../../lib/clear_gl_canvases":137,"../../lib/setcursor":167,"../../lib/svg_text_utils":169,"../../plot_api/subroutines":183,"../../registry":232,"../plots":224,"./axes":192,"./axis_ids":195,"./constants":198,"./scale_zoom":208,"./select":209,d3:2,"has-passive-events":7,tinycolor2:281}],201:[function(e,t,r){"use strict";var n=e("d3"),a=e("../../components/fx"),i=e("../../components/dragelement"),o=e("../../lib/setcursor"),l=e("./dragbox").makeDragBox,s=e("./constants").DRAGGERSIZE;r.initInteractions=function(e){var t=e._fullLayout;if(e._context.staticPlot)n.select(e).selectAll(".drag").remove();else if(t._has("cartesian")||t._has("splom")){Object.keys(t._plots||{}).sort(function(e,r){if((t._plots[e].mainplot&&!0)===(t._plots[r].mainplot&&!0)){var n=e.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 t._plots[e].mainplot?1:-1}).forEach(function(r){var n=t._plots[r],o=n.xaxis,c=n.yaxis;if(!n.mainplot){var u=l(e,n,o._offset,c._offset,o._length,c._length,"ns","ew");u.onmousemove=function(t){e._fullLayout._rehover=function(){e._fullLayout._hoversubplot===r&&e._fullLayout._plots[r]&&a.hover(e,t,r)},a.hover(e,t,r),e._fullLayout._lasthover=u,e._fullLayout._hoversubplot=r},u.onmouseout=function(t){e._dragging||(e._fullLayout._hoversubplot=null,i.unhover(e,t))},e._context.showAxisDragHandles&&(l(e,n,o._offset-s,c._offset-s,s,s,"n","w"),l(e,n,o._offset+o._length,c._offset-s,s,s,"n","e"),l(e,n,o._offset-s,c._offset+c._length,s,s,"s","w"),l(e,n,o._offset+o._length,c._offset+c._length,s,s,"s","e"))}if(e._context.showAxisDragHandles){if(r===o._mainSubplot){var f=o._mainLinePosition;"top"===o.side&&(f-=s),l(e,n,o._offset+.1*o._length,f,.8*o._length,s,"","ew"),l(e,n,o._offset,f,.1*o._length,s,"","w"),l(e,n,o._offset+.9*o._length,f,.1*o._length,s,"","e")}if(r===c._mainSubplot){var d=c._mainLinePosition;"right"!==c.side&&(d-=s),l(e,n,d,c._offset+.1*c._length,s,.8*c._length,"ns",""),l(e,n,d,c._offset+.9*c._length,s,.1*c._length,"s",""),l(e,n,d,c._offset,s,.1*c._length,"n","")}}});var o=t._hoverlayer.node();o.onmousemove=function(r){r.target=e._fullLayout._lasthover,a.hover(e,r,t._hoversubplot)},o.onclick=function(t){t.target=e._fullLayout._lasthover,a.click(e,t)},o.onmousedown=function(t){e._fullLayout._lasthover.onmousedown(t)},r.updateFx(e)}},r.updateFx=function(e){var t=e._fullLayout,r="pan"===t.dragmode?"move":"crosshair";o(t._draggers,r)}},{"../../components/dragelement":48,"../../components/fx":69,"../../lib/setcursor":167,"./constants":198,"./dragbox":200,d3:2}],202:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../lib");t.exports=function(e){return function(t,r){var i=t[e];if(Array.isArray(i))for(var o=n.subplotsRegistry.cartesian,l=o.idRegex,s=r._subplots,c=s.xaxis,u=s.yaxis,f=s.cartesian,d=r._has("cartesian")||r._has("gl2d"),p=0;p<i.length;p++){var h=i[p];if(a.isPlainObject(h)){var g=h.xref,v=h.yref,m=l.x.test(g),y=l.y.test(v);if(m||y){d||a.pushUnique(r._basePlotModules,o);var x=!1;m&&-1===c.indexOf(g)&&(c.push(g),x=!0),y&&-1===u.indexOf(v)&&(u.push(v),x=!0),x&&m&&y&&f.push(g+v)}}}}}},{"../../lib":148,"../../registry":232}],203:[function(e,t,r){"use strict";var n=e("d3"),a=e("../../registry"),i=e("../../lib"),o=e("../plots"),l=e("../../components/drawing"),s=e("../get_data").getModuleCalcData,c=e("./axis_ids"),u=e("./constants"),f=e("../../constants/xmlns_namespaces"),d=i.ensureSingle;function p(e,t,r){return i.ensureSingle(e,t,r,function(e){e.datum(r)})}function h(e,t,r,i,o){for(var c,f,d,p=u.traceLayerClasses,h=e._fullLayout,g=h._modules,v=[],m=[],y=0;y<g.length;y++){var x=(c=g[y]).name,b=a.modules[x].categories;if(b.svg){var _=c.layerName||x+"layer",w=c.plot;d=(f=s(r,w))[0],r=f[1],d.length&&v.push({i:p.indexOf(_),className:_,plotMethod:w,cdModule:d}),b.zoomScale&&m.push("."+_)}}v.sort(function(e,t){return e.i-t.i});var k=t.plot.selectAll("g.mlayer").data(v,function(e){return e.className});if(k.enter().append("g").attr("class",function(e){return e.className}).classed("mlayer",!0).classed("rangeplot",t.isRangePlot),k.exit().remove(),k.order(),k.each(function(r){var a=n.select(this),s=r.className;r.plotMethod(e,t,r.cdModule,a,i,o),-1===u.clipOnAxisFalseQuery.indexOf("."+s)&&l.setClipUrl(a,t.layerClipId,e)}),h._has("scattergl")&&(c=a.getModule("scattergl"),d=s(r,c)[0],c.plot(e,t,d)),!e._context.staticPlot&&(t._hasClipOnAxisFalse&&(t.clipOnAxisFalseTraces=t.plot.selectAll(u.clipOnAxisFalseQuery.join(",")).selectAll(".trace")),m.length)){var T=t.plot.selectAll(m.join(",")).selectAll(".trace");t.zoomScalePts=T.selectAll("path.point"),t.zoomScaleTxt=T.selectAll(".textpoint")}}function g(e,t){var r=t.plotgroup,n=t.id,a=u.layerValue2layerClass[t.xaxis.layer],i=u.layerValue2layerClass[t.yaxis.layer],o=e._fullLayout._hasOnlyLargeSploms;if(t.mainplot){var l=t.mainplotinfo,s=l.plotgroup,f=n+"-x",h=n+"-y";t.gridlayer=l.gridlayer,t.zerolinelayer=l.zerolinelayer,d(l.overlinesBelow,"path",f),d(l.overlinesBelow,"path",h),d(l.overaxesBelow,"g",f),d(l.overaxesBelow,"g",h),t.plot=d(l.overplot,"g",n),d(l.overlinesAbove,"path",f),d(l.overlinesAbove,"path",h),d(l.overaxesAbove,"g",f),d(l.overaxesAbove,"g",h),t.xlines=s.select(".overlines-"+a).select("."+f),t.ylines=s.select(".overlines-"+i).select("."+h),t.xaxislayer=s.select(".overaxes-"+a).select("."+f),t.yaxislayer=s.select(".overaxes-"+i).select("."+h)}else if(o)t.xlines=d(r,"path","xlines-above"),t.ylines=d(r,"path","ylines-above"),t.xaxislayer=d(r,"g","xaxislayer-above"),t.yaxislayer=d(r,"g","yaxislayer-above");else{var g=d(r,"g","layer-subplot");t.shapelayer=d(g,"g","shapelayer"),t.imagelayer=d(g,"g","imagelayer"),t.gridlayer=d(r,"g","gridlayer"),t.zerolinelayer=d(r,"g","zerolinelayer"),d(r,"path","xlines-below"),d(r,"path","ylines-below"),t.overlinesBelow=d(r,"g","overlines-below"),d(r,"g","xaxislayer-below"),d(r,"g","yaxislayer-below"),t.overaxesBelow=d(r,"g","overaxes-below"),t.plot=d(r,"g","plot"),t.overplot=d(r,"g","overplot"),t.xlines=d(r,"path","xlines-above"),t.ylines=d(r,"path","ylines-above"),t.overlinesAbove=d(r,"g","overlines-above"),d(r,"g","xaxislayer-above"),d(r,"g","yaxislayer-above"),t.overaxesAbove=d(r,"g","overaxes-above"),t.xlines=r.select(".xlines-"+a),t.ylines=r.select(".ylines-"+i),t.xaxislayer=r.select(".xaxislayer-"+a),t.yaxislayer=r.select(".yaxislayer-"+i)}o||(p(t.gridlayer,"g",t.xaxis._id),p(t.gridlayer,"g",t.yaxis._id),t.gridlayer.selectAll("g").map(function(e){return e[0]}).sort(c.idSort)),t.xlines.style("fill","none").classed("crisp",!0),t.ylines.style("fill","none").classed("crisp",!0)}function v(e,t){if(e){var r={};for(var a in e.each(function(e){var a=e[0];n.select(this).remove(),m(a,t),r[a]=!0}),t._plots)for(var i=t._plots[a].overlays||[],o=0;o<i.length;o++){var l=i[o];r[l.id]&&l.plot.selectAll(".trace").remove()}}}function m(e,t){t._draggers.selectAll("g."+e).remove(),t._defs.select("#clip"+t._uid+e+"plot").remove()}r.name="cartesian",r.attr=["xaxis","yaxis"],r.idRoot=["x","y"],r.idRegex=u.idRegex,r.attrRegex=u.attrRegex,r.attributes=e("./attributes"),r.layoutAttributes=e("./layout_attributes"),r.supplyLayoutDefaults=e("./layout_defaults"),r.transitionAxes=e("./transition_axes"),r.finalizeSubplots=function(e,t){var r,n,a,o=t._subplots,l=o.xaxis,s=o.yaxis,f=o.cartesian,d=f.concat(o.gl2d||[]),p={},h={};for(r=0;r<d.length;r++){var g=d[r].split("y");p[g[0]]=1,h["y"+g[1]]=1}for(r=0;r<l.length;r++)p[n=l[r]]||(a=(e[c.id2name(n)]||{}).anchor,u.idRegex.y.test(a)||(a="y"),f.push(n+a),d.push(n+a),h[a]||(h[a]=1,i.pushUnique(s,a)));for(r=0;r<s.length;r++)h[a=s[r]]||(n=(e[c.id2name(a)]||{}).anchor,u.idRegex.x.test(n)||(n="x"),f.push(n+a),d.push(n+a),p[n]||(p[n]=1,i.pushUnique(l,n)));if(!d.length){for(var v in n="",a="",e){if(u.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?c.name2id(n):"x",a=a?c.name2id(a):"y",l.push(n),s.push(a),f.push(n+a)}},r.plot=function(e,t,r,n){var a,i=e._fullLayout,o=i._subplots.cartesian,l=e.calcdata;if(!Array.isArray(t))for(t=[],a=0;a<l.length;a++)t.push(a);for(a=0;a<o.length;a++){for(var s,c=o[a],u=i._plots[c],f=[],d=0;d<l.length;d++){var p=l[d],g=p[0].trace;g.xaxis+g.yaxis===c&&((-1!==t.indexOf(g.index)||g.carpet)&&(s&&s[0].trace.xaxis+s[0].trace.yaxis===c&&-1!==["tonextx","tonexty","tonext"].indexOf(g.fill)&&-1===f.indexOf(s)&&f.push(s),f.push(p)),s=p)}h(e,u,f,r,n)}},r.clean=function(e,t,r,n){var a,i,o,l=n._plots||{},s=t._plots||{},u=n._subplots||{};if(n._hasOnlyLargeSploms&&!t._hasOnlyLargeSploms)for(o in l)(a=l[o]).plotgroup&&a.plotgroup.remove();var f=n._has&&n._has("gl"),d=t._has&&t._has("gl");if(f&&!d)for(o in l)(a=l[o])._scene&&a._scene.destroy();if(u.xaxis&&u.yaxis){var p=c.listIds({_fullLayout:n});for(i=0;i<p.length;i++){var h=p[i];t[c.id2name(h)]||n._infolayer.selectAll(".g-"+h+"title").remove()}}var g=n._has&&n._has("cartesian"),y=t._has&&t._has("cartesian");if(g&&!y)v(n._cartesianlayer.selectAll(".subplot"),n),n._defs.selectAll(".axesclip").remove(),delete n._axisConstraintGroups;else if(u.cartesian)for(i=0;i<u.cartesian.length;i++){var x=u.cartesian[i];if(!s[x]){var b="."+x+",."+x+"-x,."+x+"-y";n._cartesianlayer.selectAll(b).remove(),m(x,n)}}},r.drawFramework=function(e){var t=e._fullLayout,r=function(e){var t,r,n,a,i,o,l=e._fullLayout,s=l._subplots.cartesian,c=s.length,u=[],f=[];for(t=0;t<c;t++){n=s[t],a=l._plots[n],i=a.xaxis,o=a.yaxis;var d=i._mainAxis,p=o._mainAxis,h=d._id+p._id,g=l._plots[h];a.overlays=[],h!==n&&g?(a.mainplot=h,a.mainplotinfo=g,f.push(n)):(a.mainplot=void 0,a.mainPlotinfo=void 0,u.push(n))}for(t=0;t<f.length;t++)n=f[t],(a=l._plots[n]).mainplotinfo.overlays.push(a);var v=u.concat(f),m=new Array(c);for(t=0;t<c;t++){n=v[t],a=l._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[t]=y}return m}(e),a=t._cartesianlayer.selectAll(".subplot").data(r,String);a.enter().append("g").attr("class",function(e){return"subplot "+e[0]}),a.order(),a.exit().call(v,t),a.each(function(r){var a=r[0],i=t._plots[a];i.plotgroup=n.select(this),g(e,i),i.draglayer=d(t._draggers,"g",a)})},r.rangePlot=function(e,t,r){g(e,t),h(e,t,r),o.style(e)},r.toSVG=function(e){var t=e._fullLayout._glimages,r=n.select(e).selectAll(".svg-container");r.filter(function(e,t){return t===r.size()-1}).selectAll(".gl-canvas-context, .gl-canvas-focus").each(function(){var e=this.toDataURL("image/png");t.append("svg:image").attr({xmlns:f.svg,"xlink:href":e,preserveAspectRatio:"none",x:0,y:0,width:this.width,height:this.height})})},r.updateFx=e("./graph_interact").updateFx},{"../../components/drawing":51,"../../constants/xmlns_namespaces":129,"../../lib":148,"../../registry":232,"../get_data":220,"../plots":224,"./attributes":190,"./axis_ids":195,"./constants":198,"./graph_interact":201,"./layout_attributes":204,"./layout_defaults":205,"./transition_axes":214,d3:2}],204:[function(e,t,r){"use strict";var n=e("../font_attributes"),a=e("../../components/color/attributes"),i=e("../../components/drawing/attributes").dash,o=e("../../lib/extend").extendFlat,l=e("../../plot_api/plot_template").templatedArray,s=(e("../../constants/docs").FORMAT_LINK,e("../../constants/docs").DATE_FORMAT_LINK,e("../../constants/numerical").ONEDAY),c=e("./constants"),u=c.HOUR_PATTERN,f=c.WEEKDAY_PATTERN;t.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},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:[c.idRegex.x.toString(),c.idRegex.y.toString()],editType:"plot"},scaleratio:{valType:"number",min:0,dflt:1,editType:"plot"},constrain:{valType:"enumerated",values:["range","domain"],dflt:"range",editType:"plot"},constraintoward:{valType:"enumerated",values:["left","center","right","top","middle","bottom"],editType:"plot"},matches:{valType:"enumerated",values:[c.idRegex.x.toString(),c.idRegex.y.toString()],editType:"calc"},rangebreaks:l("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,u,""],editType:"calc"},values:{valType:"info_array",freeLength:!0,editType:"calc",items:{valType:"any",editType:"calc"}},dvalue:{valType:"number",editType:"calc",min:0,dflt:s},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"},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"},separatethousands:{valType:"boolean",dflt:!1,editType:"ticks"},tickformat:{valType:"string",dflt:"",editType:"ticks"},tickformatstops:l("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",c.idRegex.x.toString(),c.idRegex.y.toString()],editType:"plot"},side:{valType:"enumerated",values:["top","bottom","left","right"],editType:"plot"},overlaying:{valType:"enumerated",values:["free",c.idRegex.x.toString(),c.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":29,"../../components/drawing/attributes":50,"../../constants/docs":126,"../../constants/numerical":128,"../../lib/extend":143,"../../plot_api/plot_template":182,"../font_attributes":218,"./constants":198}],205:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../components/color"),i=e("../../components/fx/helpers").isUnifiedHover,o=e("../../components/fx/hovermode_defaults"),l=e("../../plot_api/plot_template"),s=e("../layout_attributes"),c=e("./layout_attributes"),u=e("./type_defaults"),f=e("./axis_defaults"),d=e("./constraints").handleConstraintDefaults,p=e("./position_defaults"),h=e("./axis_ids"),g=h.id2name,v=h.name2id,m=e("./constants").AX_ID_PATTERN,y=e("../../registry"),x=y.traceIs,b=y.getComponentMethod;function _(e,t,r){Array.isArray(e[t])?e[t].push(r):e[t]=[r]}t.exports=function(e,t,r){var h,y,w={},k={},T={},M={},A={},L={},S={},C={},O={},P={};for(h=0;h<r.length;h++){var D=r[h];if(x(D,"cartesian")||x(D,"gl2d")){var z,R;if(D.xaxis)z=g(D.xaxis),_(w,z,D);else if(D.xaxes)for(y=0;y<D.xaxes.length;y++)_(w,g(D.xaxes[y]),D);if(D.yaxis)R=g(D.yaxis),_(w,R,D);else if(D.yaxes)for(y=0;y<D.yaxes.length;y++)_(w,g(D.yaxes[y]),D);if("funnel"===D.type?"h"===D.orientation?(z&&(k[z]=!0),R&&(S[R]=!0)):R&&(T[R]=!0):"image"===D.type?(R&&(C[R]=!0),z&&(C[z]=!0)):(R&&(A[R]=!0,L[R]=!0),x(D,"carpet")&&("carpet"!==D.type||D._cheater)||z&&(M[z]=!0)),"carpet"===D.type&&D._cheater&&z&&(k[z]=!0),x(D,"2dMap")&&(O[z]=!0,O[R]=!0),x(D,"oriented"))P["h"===D.orientation?R:z]=!0}}var E=t._subplots,I=E.xaxis,F=E.yaxis,N=n.simpleMap(I,g),j=n.simpleMap(F,g),B=N.concat(j),H=a.background;I.length&&F.length&&(H=n.coerce(e,t,s,"plot_bgcolor"));var q,V,U,G,Z,Y=a.combine(H,t.paper_bgcolor);function X(){var e=w[q]||[];Z._traceIndices=e.map(function(e){return e._expandedIndex}),Z._annIndices=[],Z._shapeIndices=[],Z._imgIndices=[],Z._subplotsWith=[],Z._counterAxes=[],Z._name=Z._attr=q,Z._id=V}function W(e,t){return n.coerce(G,Z,c,e,t)}function $(e,t){return n.coerce2(G,Z,c,e,t)}function J(e){return"x"===e?F:I}function Q(t,r){for(var n="x"===t?N:j,a=[],i=0;i<n.length;i++){var o=n[i];o===r||(e[o]||{}).overlaying||a.push(v(o))}return a}var K={x:J("x"),y:J("y")},ee=K.x.concat(K.y),te={},re=[];function ne(){var e=G.matches;m.test(e)&&-1===ee.indexOf(e)&&(te[e]=G.type,re=Object.keys(te))}var ae=o(e,t,r),ie=i(ae);for(h=0;h<B.length;h++){q=B[h],V=v(q),U=q.charAt(0),n.isPlainObject(e[q])||(e[q]={}),G=e[q],Z=l.newContainer(t,q,U+"axis"),X();var oe="x"===U&&!M[q]&&k[q]||"y"===U&&!A[q]&&T[q],le="y"===U&&(!L[q]&&S[q]||C[q]),se={letter:U,font:t.font,outerTicks:O[q],showGrid:!P[q],data:w[q]||[],bgColor:Y,calendar:t.calendar,automargin:!0,visibleDflt:oe,reverseDflt:le,splomStash:((t._splomAxes||{})[U]||{})[V]};W("uirevision",t.uirevision),u(G,Z,W,se),f(G,Z,W,se,t);var ce=ie&&U===ae.charAt(0),ue=$("spikecolor",ie?Z.color:void 0),fe=$("spikethickness",ie?1.5:void 0),de=$("spikedash",ie?"dot":void 0),pe=$("spikemode",ie?"across":void 0),he=$("spikesnap",ie?"hovered data":void 0);W("showspikes",!!(ce||ue||fe||de||pe||he))||(delete Z.spikecolor,delete Z.spikethickness,delete Z.spikedash,delete Z.spikemode,delete Z.spikesnap),p(G,Z,W,{letter:U,counterAxes:K[U],overlayableAxes:Q(U,q),grid:t.grid}),W("title.standoff"),ne(),Z._input=G}for(h=0;h<re.length;){V=re[h++],U=(q=g(V)).charAt(0),n.isPlainObject(e[q])||(e[q]={}),G=e[q],Z=l.newContainer(t,q,U+"axis"),X();var ge={letter:U,font:t.font,outerTicks:O[q],showGrid:!P[q],data:[],bgColor:Y,calendar:t.calendar,automargin:!0,visibleDflt:!1,reverseDflt:!1,splomStash:((t._splomAxes||{})[U]||{})[V]};W("uirevision",t.uirevision),Z.type=te[V]||"linear",f(G,Z,W,ge,t),p(G,Z,W,{letter:U,counterAxes:K[U],overlayableAxes:Q(U,q),grid:t.grid}),W("fixedrange"),ne(),Z._input=G}var ve=b("rangeslider","handleDefaults"),me=b("rangeselector","handleDefaults");for(h=0;h<N.length;h++)q=N[h],G=e[q],Z=t[q],ve(e,t,q),"date"===Z.type&&me(G,Z,t,j,Z.calendar),W("fixedrange");for(h=0;h<j.length;h++){q=j[h],G=e[q],Z=t[q];var ye=t[g(Z.anchor)];W("fixedrange",b("rangeslider","isVisible")(ye))}var xe=t._axisConstraintGroups=[],be=t._axisMatchGroups=[],_e=ee.concat(re),we=B.concat(n.simpleMap(re,g));for(h=0;h<we.length;h++){var ke,Te;U=(q=we[h]).charAt(0),G=e[q],Z=t[q],ke="y"===U&&!G.hasOwnProperty("scaleanchor")&&C[q]?Z.anchor:void 0,Te=!G.hasOwnProperty("constrain")&&C[q]?"domain":void 0,d(G,Z,W,{allAxisIds:_e,layoutOut:t,scaleanchorDflt:ke,constrainDflt:Te})}for(h=0;h<be.length;h++){var Me=be[h],Ae=null,Le=null;for(V in Me)(Z=t[g(V)]).matches||(Ae=Z.range,Le=Z.autorange);if(null===Ae||null===Le)for(V in Me){Ae=(Z=t[g(V)]).range,Le=Z.autorange;break}for(V in Me)(Z=t[g(V)]).matches&&(Z.range=Ae.slice(),Z.autorange=Le),Z._matchGroup=Me;if(xe.length)for(V in Me)for(y=0;y<xe.length;y++){var Se=xe[y];for(var Ce in Se)V===Ce&&(n.warn("Axis "+Ce+" is set with both a *scaleanchor* and *matches* constraint; ignoring the scale constraint."),delete Se[Ce],Object.keys(Se).length<2&&xe.splice(y,1))}}}},{"../../components/color":30,"../../components/fx/helpers":65,"../../components/fx/hovermode_defaults":68,"../../lib":148,"../../plot_api/plot_template":182,"../../registry":232,"../layout_attributes":222,"./axis_defaults":194,"./axis_ids":195,"./constants":198,"./constraints":199,"./layout_attributes":204,"./position_defaults":207,"./type_defaults":215}],206:[function(e,t,r){"use strict";var n=e("tinycolor2").mix,a=e("../../components/color/attributes").lightFraction,i=e("../../lib");t.exports=function(e,t,r,o){var l=(o=o||{}).dfltColor;function s(r,n){return i.coerce2(e,t,o.attributes,r,n)}var c=s("linecolor",l),u=s("linewidth");r("showline",o.showLine||!!c||!!u)||(delete t.linecolor,delete t.linewidth);var f=s("gridcolor",n(l,o.bgColor,o.blend||a).toRgbString()),d=s("gridwidth");if(r("showgrid",o.showGrid||!!f||!!d)||(delete t.gridcolor,delete t.gridwidth),!o.noZeroLine){var p=s("zerolinecolor",l),h=s("zerolinewidth");r("zeroline",o.showGrid||!!p||!!h)||(delete t.zerolinecolor,delete t.zerolinewidth)}}},{"../../components/color/attributes":29,"../../lib":148,tinycolor2:281}],207:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("../../lib");t.exports=function(e,t,r,i){var o,l,s,c,u=i.counterAxes||[],f=i.overlayableAxes||[],d=i.letter,p=i.grid;p&&(l=p._domains[d][p._axisMap[t._id]],o=p._anchors[t._id],l&&(s=p[d+"side"].split(" ")[0],c=p.domain[d]["right"===s||"top"===s?1:0])),l=l||[0,1],o=o||(n(e.position)?"free":u[0]||"free"),s=s||("x"===d?"bottom":"left"),c=c||0,"free"===a.coerce(e,t,{anchor:{valType:"enumerated",values:["free"].concat(u),dflt:o}},"anchor")&&r("position",c),a.coerce(e,t,{side:{valType:"enumerated",values:"x"===d?["bottom","top"]:["left","right"],dflt:s}},"side");var h=!1;if(f.length&&(h=a.coerce(e,t,{overlaying:{valType:"enumerated",values:[!1].concat(f),dflt:!1}},"overlaying")),!h){var g=r("domain",l);g[0]>g[1]-1/4096&&(t.domain=l),a.noneOrAll(e.domain,t.domain,l)}return r("layer"),t}},{"../../lib":148,"fast-isnumeric":4}],208:[function(e,t,r){"use strict";var n=e("../../constants/alignment").FROM_BL;t.exports=function(e,t,r){void 0===r&&(r=n[e.constraintoward||"center"]);var a=[e.r2l(e.range[0]),e.r2l(e.range[1])],i=a[0]+(a[1]-a[0])*r;e.range=e._input.range=[e.l2r(i+(a[0]-i)*t),e.l2r(i+(a[1]-i)*t)]}},{"../../constants/alignment":125}],209:[function(e,t,r){"use strict";var n=e("polybooljs"),a=e("../../registry"),i=e("../../components/color"),o=e("../../components/fx"),l=e("../../lib"),s=e("../../lib/polygon"),c=e("../../lib/throttle"),u=e("../../components/fx/helpers").makeEventData,f=e("./axis_ids").getFromId,d=e("../../lib/clear_gl_canvases"),p=e("../../plot_api/subroutines").redrawReglTraces,h=e("./constants"),g=h.MINSELECT,v=s.filter,m=s.tester;function y(e){return e._id}function x(e,t,r,n,a,i,o){var l,s,c,u,f,d,p,h,g,v=t._hoverdata,m=t._fullLayout.clickmode.indexOf("event")>-1,y=[];if(function(e){return e&&Array.isArray(e)&&!0!==e[0].hoverOnBox}(v)){k(e,t,i);var x=function(e,t){var r,n,a=e[0],i=-1,o=[];for(n=0;n<t.length;n++)if(r=t[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}}(v,l=M(t,r,n,a));if(x.pointNumbers.length>0?function(e,t){var r,n,a,i=[];for(a=0;a<e.length;a++)(r=e[a]).cd[0].trace.selectedpoints&&r.cd[0].trace.selectedpoints.length>0&&i.push(r);if(1===i.length&&i[0]===t.searchInfo&&(n=t.searchInfo.cd[0].trace).selectedpoints.length===t.pointNumbers.length){for(a=0;a<t.pointNumbers.length;a++)if(n.selectedpoints.indexOf(t.pointNumbers[a])<0)return!1;return!0}return!1}(l,x):function(e){var t,r,n,a=0;for(n=0;n<e.length;n++)if(t=e[n],(r=t.cd[0].trace).selectedpoints){if(r.selectedpoints.length>1)return!1;if((a+=r.selectedpoints.length)>1)return!1}return 1===a}(l)&&(d=L(x))){for(o&&o.remove(),g=0;g<l.length;g++)(s=l[g])._module.selectPoints(s,!1);S(t,l),T(i),m&&t.emit("plotly_deselect",null)}else{for(p=e.shiftKey&&(void 0!==d?d:L(x)),c=function(e,t,r){return{pointNumber:e,searchInfo:t,subtract:r}}(x.pointNumber,x.searchInfo,p),u=w(i.selectionDefs.concat([c])),g=0;g<l.length;g++)if(f=C(l[g]._module.selectPoints(l[g],u),l[g]),y.length)for(var b=0;b<f.length;b++)y.push(f[b]);else y=f;S(t,l,h={points:y}),c&&i&&i.selectionDefs.push(c),o&&A(i.mergedPolygons,o),m&&t.emit("plotly_selected",h)}}}function b(e){return"pointNumber"in e&&"searchInfo"in e}function _(e){return{xmin:0,xmax:0,ymin:0,ymax:0,pts:[],contains:function(t,r,n,a){var i=e.searchInfo.cd[0].trace._expandedIndex;return a.cd[0].trace._expandedIndex===i&&n===e.pointNumber},isRect:!1,degenerate:!1,subtract:e.subtract}}function w(e){for(var t=[],r=b(e[0])?0:e[0][0][0],n=r,a=b(e[0])?0:e[0][0][1],i=a,o=0;o<e.length;o++)if(b(e[o]))t.push(_(e[o]));else{var l=s.tester(e[o]);l.subtract=e[o].subtract,t.push(l),r=Math.min(r,l.xmin),n=Math.max(n,l.xmax),a=Math.min(a,l.ymin),i=Math.max(i,l.ymax)}return{xmin:r,xmax:n,ymin:a,ymax:i,pts:[],contains:function(e,r,n,a){for(var i=!1,o=0;o<t.length;o++)t[o].contains(e,r,n,a)&&(i=!1===t[o].subtract);return i},isRect:!1,degenerate:!1}}function k(e,t,r){var n=t._fullLayout,a=r.plotinfo,i=n._lastSelectedSubplot&&n._lastSelectedSubplot===a.id,o=e.shiftKey||e.altKey;i&&o&&a.selection&&a.selection.selectionDefs&&!r.selectionDefs?(r.selectionDefs=a.selection.selectionDefs,r.mergedPolygons=a.selection.mergedPolygons):o&&a.selection||T(r),i||(O(t),n._lastSelectedSubplot=a.id)}function T(e){var t=e.plotinfo;t.selection={},t.selection.selectionDefs=e.selectionDefs=[],t.selection.mergedPolygons=e.mergedPolygons=[]}function M(e,t,r,n){var a,i,o,l=[],s=t.map(y),c=r.map(y);for(o=0;o<e.calcdata.length;o++)if(!0===(i=(a=e.calcdata[o])[0].trace).visible&&i._module&&i._module.selectPoints)if(!n||i.subplot!==n&&i.geo!==n)if("splom"===i.type&&i._xaxes[s[0]]&&i._yaxes[c[0]]){var u=p(i._module,a,t[0],r[0]);u.scene=e._fullLayout._splomScenes[i.uid],l.push(u)}else if("sankey"===i.type){var d=p(i._module,a,t[0],r[0]);l.push(d)}else{if(-1===s.indexOf(i.xaxis))continue;if(-1===c.indexOf(i.yaxis))continue;l.push(p(i._module,a,f(e,i.xaxis),f(e,i.yaxis)))}else l.push(p(i._module,a,t[0],r[0]));return l;function p(e,t,r,n){return{_module:e,cd:t,xaxis:r,yaxis:n}}}function A(e,t){var r,n,a=[];for(r=0;r<e.length;r++){var i=e[r];a.push(i.join("L")+"L"+i[0])}n=e.length>0?"M"+a.join("M")+"Z":"M0,0Z",t.attr("d",n)}function L(e){var t=e.searchInfo.cd[0].trace,r=e.pointNumber,n=e.pointNumbers,a=n.length>0?n[0]:r;return!!t.selectedpoints&&t.selectedpoints.indexOf(a)>-1}function S(e,t,r){var n,i,o,l;for(n=0;n<t.length;n++){var s=t[n].cd[0].trace._fullInput,c=e._fullLayout._tracePreGUI[s.uid]||{};void 0===c.selectedpoints&&(c.selectedpoints=s._input.selectedpoints||null)}if(r){var u=r.points||[];for(n=0;n<t.length;n++)(l=t[n].cd[0].trace)._input.selectedpoints=l._fullInput.selectedpoints=[],l._fullInput!==l&&(l.selectedpoints=[]);for(n=0;n<u.length;n++){var f=u[n],h=f.data,g=f.fullData;f.pointIndices?([].push.apply(h.selectedpoints,f.pointIndices),l._fullInput!==l&&[].push.apply(g.selectedpoints,f.pointIndices)):(h.selectedpoints.push(f.pointIndex),l._fullInput!==l&&g.selectedpoints.push(f.pointIndex))}}else for(n=0;n<t.length;n++)delete(l=t[n].cd[0].trace).selectedpoints,delete l._input.selectedpoints,l._fullInput!==l&&delete l._fullInput.selectedpoints;var v=!1;for(n=0;n<t.length;n++){l=(o=(i=t[n]).cd)[0].trace,a.traceIs(l,"regl")&&(v=!0);var m=i._module,y=m.styleOnSelect||m.style;y&&(y(e,o,o[0].node3),o[0].nodeRangePlot3&&y(e,o,o[0].nodeRangePlot3))}v&&(d(e),p(e))}function C(e,t){if(Array.isArray(e))for(var r=t.cd,n=t.cd[0].trace,a=0;a<e.length;a++)e[a]=u(e[a],n,r);return e}function O(e){var t=(e._fullLayout||{})._zoomlayer;t&&t.selectAll(".select-outline").remove()}t.exports={prepSelect:function(e,t,r,a,s){var u,f,d,p,y,b,_,L=a.gd,O=L._fullLayout,P=O._zoomlayer,D=a.element.getBoundingClientRect(),z=a.plotinfo,R=z.xaxis._offset,E=z.yaxis._offset,I=t-D.left,F=r-D.top,N=I,j=F,B="M"+I+","+F,H=a.xaxes[0]._length,q=a.yaxes[0]._length,V=a.xaxes.concat(a.yaxes),U=e.altKey;k(e,L,a),"lasso"===s&&(u=v([[I,F]],h.BENDPX));var G=P.selectAll("path.select-outline-"+z.id).data([1,2]);G.enter().append("path").attr("class",function(e){return"select-outline select-outline-"+e+" select-outline-"+z.id}).attr("transform","translate("+R+", "+E+")").attr("d",B+"Z");var Z,Y=P.append("path").attr("class","zoombox-corners").style({fill:i.background,stroke:i.defaultLine,"stroke-width":1}).attr("transform","translate("+R+", "+E+")").attr("d","M0,0Z"),X=O._uid+h.SELECTID,W=[],$=M(L,a.xaxes,a.yaxes,a.subplot);function J(e,t){return"log"===e.type?e.p2d(t):e.p2r(t)}function Q(e){var t="y"===e._id.charAt(0)?1:0;return function(r){return J(e,r[t])}}function K(e,t){return e-t}Z=z.fillRangeItems?z.fillRangeItems:"select"===s?function(e,t){var r=e.range={};for(y=0;y<V.length;y++){var n=V[y],a=n._id.charAt(0);r[n._id]=[J(n,t[a+"min"]),J(n,t[a+"max"])].sort(K)}}:function(e,t,r){var n=e.lassoPoints={};for(y=0;y<V.length;y++){var a=V[y];n[a._id]=r.filtered.map(Q(a))}},a.moveFn=function(e,t){N=Math.max(0,Math.min(H,e+I)),j=Math.max(0,Math.min(q,t+F));var r=Math.abs(N-I),i=Math.abs(j-F);if("select"===s){var o=O.selectdirection;"h"===(o="any"===O.selectdirection?i<Math.min(.6*r,g)?"h":r<Math.min(.6*i,g)?"v":"d":O.selectdirection)?((p=[[I,0],[I,q],[N,q],[N,0]]).xmin=Math.min(I,N),p.xmax=Math.max(I,N),p.ymin=Math.min(0,q),p.ymax=Math.max(0,q),Y.attr("d","M"+p.xmin+","+(F-g)+"h-4v"+2*g+"h4ZM"+(p.xmax-1)+","+(F-g)+"h4v"+2*g+"h-4Z")):"v"===o?((p=[[0,F],[0,j],[H,j],[H,F]]).xmin=Math.min(0,H),p.xmax=Math.max(0,H),p.ymin=Math.min(F,j),p.ymax=Math.max(F,j),Y.attr("d","M"+(I-g)+","+p.ymin+"v-4h"+2*g+"v4ZM"+(I-g)+","+(p.ymax-1)+"v4h"+2*g+"v-4Z")):"d"===o&&((p=[[I,F],[I,j],[N,j],[N,F]]).xmin=Math.min(I,N),p.xmax=Math.max(I,N),p.ymin=Math.min(F,j),p.ymax=Math.max(F,j),Y.attr("d","M0,0Z"))}else"lasso"===s&&(u.addPt([N,j]),p=u.filtered);a.selectionDefs&&a.selectionDefs.length?(d=function(e,t,r){return r?n.difference({regions:e,inverted:!1},{regions:[t],inverted:!1}).regions:n.union({regions:e,inverted:!1},{regions:[t],inverted:!1}).regions}(a.mergedPolygons,p,U),p.subtract=U,f=w(a.selectionDefs.concat([p]))):(d=[p],f=m(p)),A(d,G),c.throttle(X,h.SELECTDELAY,function(){var e;W=[];var t,r=[];for(y=0;y<$.length;y++)if(t=(b=$[y])._module.selectPoints(b,f),r.push(t),e=C(t,b),W.length)for(var n=0;n<e.length;n++)W.push(e[n]);else W=e;S(L,$,_={points:W}),Z(_,p,u),a.gd.emit("plotly_selecting",_)})},a.clickFn=function(e,t){var r=O.clickmode;Y.remove(),c.done(X).then(function(){if(c.clear(X),2===e){for(G.remove(),y=0;y<$.length;y++)(b=$[y])._module.selectPoints(b,!1);S(L,$),T(a),L.emit("plotly_deselect",null)}else r.indexOf("select")>-1&&x(t,L,a.xaxes,a.yaxes,a.subplot,a,G),"event"===r&&L.emit("plotly_selected",void 0);o.click(L,t)}).catch(l.error)},a.doneFn=function(){Y.remove(),c.done(X).then(function(){c.clear(X),a.gd.emit("plotly_selected",_),p&&a.selectionDefs&&(p.subtract=U,a.selectionDefs.push(p),a.mergedPolygons.length=0,[].push.apply(a.mergedPolygons,d)),a.doneFnCompleted&&a.doneFnCompleted(W)}).catch(l.error)}},clearSelect:O,selectOnClick:x}},{"../../components/color":30,"../../components/fx":69,"../../components/fx/helpers":65,"../../lib":148,"../../lib/clear_gl_canvases":137,"../../lib/polygon":160,"../../lib/throttle":170,"../../plot_api/subroutines":183,"../../registry":232,"./axis_ids":195,"./constants":198,polybooljs:272}],210:[function(e,t,r){"use strict";var n=e("d3"),a=e("fast-isnumeric"),i=e("../../lib"),o=i.cleanNumber,l=i.ms2DateTime,s=i.dateTime2ms,c=i.ensureNumber,u=i.isArrayOrTypedArray,f=e("../../constants/numerical"),d=f.FP_SAFE,p=f.BADNUM,h=f.LOG_CLIP,g=f.ONEDAY,v=f.ONEHOUR,m=f.ONEMIN,y=f.ONESEC,x=e("./axis_ids"),b=e("./constants"),_=b.HOUR_PATTERN,w=b.WEEKDAY_PATTERN;function k(e){return Math.pow(10,e)}function T(e){return null!==e&&void 0!==e}t.exports=function(e,t){t=t||{};var r=e._id||"x",f=r.charAt(0);function M(t,r){if(t>0)return Math.log(t)/Math.LN10;if(t<=0&&r&&e.range&&2===e.range.length){var n=e.range[0],a=e.range[1];return.5*(n+a-2*h*Math.abs(n-a))}return p}function A(t,r,n){var o=s(t,n||e.calendar);if(o===p){if(!a(t))return p;t=+t;var l=Math.floor(10*i.mod(t+.05,1)),c=Math.round(t-l/10);o=s(new Date(c))+l/10}return o}function L(t,r,n){return l(t,r,n||e.calendar)}function S(t){return e._categories[Math.round(t)]}function C(t){if(T(t)){if(void 0===e._categoriesMap&&(e._categoriesMap={}),void 0!==e._categoriesMap[t])return e._categoriesMap[t];e._categories.push("number"==typeof t?String(t):t);var r=e._categories.length-1;return e._categoriesMap[t]=r,r}return p}function O(t){if(e._categoriesMap)return e._categoriesMap[t]}function P(e){var t=O(e);return void 0!==t?t:a(e)?+e:void 0}function D(e,t,r){return n.round(r+t*e,2)}function z(e,t,r){return(e-r)/t}var R=function(t){return a(t)?D(t,e._m,e._b):p},E=function(t){return z(t,e._m,e._b)};if(e.rangebreaks){var I="y"===f;R=function(t){if(!a(t))return p;var r=e._rangebreaks.length;if(!r)return D(t,e._m,e._b);var n=I;e.range[0]>e.range[1]&&(n=!n);for(var i=n?-1:1,o=i*t,l=0,s=0;s<r;s++){var c=i*e._rangebreaks[s].min,u=i*e._rangebreaks[s].max;if(o<c)break;if(!(o>u)){l=o<(c+u)/2?s:s+1;break}l=s+1}var f=e._B[l]||0;return isFinite(f)?D(t,e._m2,f):0},E=function(t){var r=e._rangebreaks.length;if(!r)return z(t,e._m,e._b);for(var n=0,a=0;a<r&&!(t<e._rangebreaks[a].pmin);a++)t>e._rangebreaks[a].pmax&&(n=a+1);return z(t,e._m2,e._B[n])}}e.c2l="log"===e.type?M:c,e.l2c="log"===e.type?k:c,e.l2p=R,e.p2l=E,e.c2p="log"===e.type?function(e,t){return R(M(e,t))}:R,e.p2c="log"===e.type?function(e){return k(E(e))}:E,-1!==["linear","-"].indexOf(e.type)?(e.d2r=e.r2d=e.d2c=e.r2c=e.d2l=e.r2l=o,e.c2d=e.c2r=e.l2d=e.l2r=c,e.d2p=e.r2p=function(t){return e.l2p(o(t))},e.p2d=e.p2r=E,e.cleanPos=c):"log"===e.type?(e.d2r=e.d2l=function(e,t){return M(o(e),t)},e.r2d=e.r2c=function(e){return k(o(e))},e.d2c=e.r2l=o,e.c2d=e.l2r=c,e.c2r=M,e.l2d=k,e.d2p=function(t,r){return e.l2p(e.d2r(t,r))},e.p2d=function(e){return k(E(e))},e.r2p=function(t){return e.l2p(o(t))},e.p2r=E,e.cleanPos=c):"date"===e.type?(e.d2r=e.r2d=i.identity,e.d2c=e.r2c=e.d2l=e.r2l=A,e.c2d=e.c2r=e.l2d=e.l2r=L,e.d2p=e.r2p=function(t,r,n){return e.l2p(A(t,0,n))},e.p2d=e.p2r=function(e,t,r){return L(E(e),t,r)},e.cleanPos=function(t){return i.cleanDate(t,p,e.calendar)}):"category"===e.type?(e.d2c=e.d2l=C,e.r2d=e.c2d=e.l2d=S,e.d2r=e.d2l_noadd=P,e.r2c=function(t){var r=P(t);return void 0!==r?r:e.fraction2r(.5)},e.l2r=e.c2r=c,e.r2l=P,e.d2p=function(t){return e.l2p(e.r2c(t))},e.p2d=function(e){return S(E(e))},e.r2p=e.d2p,e.p2r=E,e.cleanPos=function(e){return"string"==typeof e&&""!==e?e:c(e)}):"multicategory"===e.type&&(e.r2d=e.c2d=e.l2d=S,e.d2r=e.d2l_noadd=P,e.r2c=function(t){var r=P(t);return void 0!==r?r:e.fraction2r(.5)},e.r2c_just_indices=O,e.l2r=e.c2r=c,e.r2l=P,e.d2p=function(t){return e.l2p(e.r2c(t))},e.p2d=function(e){return S(E(e))},e.r2p=e.d2p,e.p2r=E,e.cleanPos=function(e){return Array.isArray(e)||"string"==typeof e&&""!==e?e:c(e)},e.setupMultiCategory=function(n){var a,o,l=e._traceIndices,s=t._axisMatchGroups;if(s&&s.length&&0===e._categories.length)for(a=0;a<s.length;a++){var c=s[a];if(c[r])for(var d in c)if(d!==r){var p=t[x.id2name(d)];l=l.concat(p._traceIndices)}}var h=[[0,{}],[0,{}]],g=[];for(a=0;a<l.length;a++){var v=n[l[a]];if(f in v){var m=v[f],y=v._length||i.minRowLength(m);if(u(m[0])&&u(m[1]))for(o=0;o<y;o++){var b=m[0][o],_=m[1][o];T(b)&&T(_)&&(g.push([b,_]),b in h[0][1]||(h[0][1][b]=h[0][0]++),_ in h[1][1]||(h[1][1][_]=h[1][0]++))}}}for(g.sort(function(e,t){var r=h[0][1],n=r[e[0]]-r[t[0]];if(n)return n;var a=h[1][1];return a[e[1]]-a[t[1]]}),a=0;a<g.length;a++)C(g[a])}),e.fraction2r=function(t){var r=e.r2l(e.range[0]),n=e.r2l(e.range[1]);return e.l2r(r+t*(n-r))},e.r2fraction=function(t){var r=e.r2l(e.range[0]),n=e.r2l(e.range[1]);return(e.r2l(t)-r)/(n-r)},e.cleanRange=function(t,r){r||(r={}),t||(t="range");var n,o,l=i.nestedProperty(e,t).get();if(o=(o="date"===e.type?i.dfltRange(e.calendar):"y"===f?b.DFLTRANGEY:r.dfltRange||b.DFLTRANGEX).slice(),"tozero"!==e.rangemode&&"nonnegative"!==e.rangemode||(o[0]=0),l&&2===l.length)for("date"!==e.type||e.autorange||(l[0]=i.cleanDate(l[0],p,e.calendar),l[1]=i.cleanDate(l[1],p,e.calendar)),n=0;n<2;n++)if("date"===e.type){if(!i.isDateTime(l[n],e.calendar)){e[t]=o;break}if(e.r2l(l[0])===e.r2l(l[1])){var s=i.constrain(e.r2l(l[0]),i.MIN_MS+1e3,i.MAX_MS-1e3);l[0]=e.l2r(s-1e3),l[1]=e.l2r(s+1e3);break}}else{if(!a(l[n])){if(!a(l[1-n])){e[t]=o;break}l[n]=l[1-n]*(n?10:.1)}if(l[n]<-d?l[n]=-d:l[n]>d&&(l[n]=d),l[0]===l[1]){var c=Math.max(1,Math.abs(1e-6*l[0]));l[0]-=c,l[1]+=c}}else i.nestedProperty(e,t).set(o)},e.setScale=function(r){var n=t._size;if(e.overlaying){var a=x.getFromId({_fullLayout:t},e.overlaying);e.domain=a.domain}var i=r&&e._r?"_r":"range",o=e.calendar;e.cleanRange(i);var l,s,c=e.r2l(e[i][0],o),u=e.r2l(e[i][1],o),d="y"===f;if((d?(e._offset=n.t+(1-e.domain[1])*n.h,e._length=n.h*(e.domain[1]-e.domain[0]),e._m=e._length/(c-u),e._b=-e._m*u):(e._offset=n.l+e.domain[0]*n.w,e._length=n.w*(e.domain[1]-e.domain[0]),e._m=e._length/(u-c),e._b=-e._m*c),e._rangebreaks=[],e._lBreaks=0,e._m2=0,e._B=[],e.rangebreaks)&&(e._rangebreaks=e.locateBreaks(Math.min(c,u),Math.max(c,u)),e._rangebreaks.length)){for(l=0;l<e._rangebreaks.length;l++)s=e._rangebreaks[l],e._lBreaks+=Math.abs(s.max-s.min);var p=d;c>u&&(p=!p),p&&e._rangebreaks.reverse();var h=p?-1:1;for(e._m2=h*e._length/(Math.abs(u-c)-e._lBreaks),e._B.push(-e._m2*(d?u:c)),l=0;l<e._rangebreaks.length;l++)s=e._rangebreaks[l],e._B.push(e._B[e._B.length-1]-h*e._m2*(s.max-s.min));for(l=0;l<e._rangebreaks.length;l++)(s=e._rangebreaks[l]).pmin=R(s.min),s.pmax=R(s.max)}if(!isFinite(e._m)||!isFinite(e._b)||e._length<0)throw t._replotting=!1,new Error("Something went wrong with axis scaling")},e.maskBreaks=function(t){for(var r,n,a,l,s,c=e.rangebreaks||[],u=0;u<c.length;u++){var f=c[u];if(f.enabled)if(f.bounds){var d=f.pattern;switch(n=(r=i.simpleMap(f.bounds,d?o:e.d2c))[0],a=r[1],d){case w:l=(s=new Date(t)).getUTCDay(),n>a&&(a+=7,l<n&&(l+=7));break;case _:l=(s=new Date(t)).getUTCHours()+(s.getUTCMinutes()/60+s.getUTCSeconds()/3600+s.getUTCMilliseconds()/36e5),n>a&&(a+=24,l<n&&(l+=24));break;case"":l=t}if(l>=n&&l<a)return p}else for(var h=i.simpleMap(f.values,e.d2c).sort(i.sorterAsc),g=0;g<h.length;g++)if(a=(n=h[g])+f.dvalue,t>=n&&t<a)return p}return t},e.locateBreaks=function(t,r){var n,a,l,s,c=[];if(!e.rangebreaks)return c;var u=e.rangebreaks.slice().sort(function(e,t){return e.pattern===w&&t.pattern===_?-1:t.pattern===w&&e.pattern===_?1:0}),f=function(e,n){if((e=i.constrain(e,t,r))!==(n=i.constrain(n,t,r))){for(var a=!0,o=0;o<c.length;o++){var l=c[o];e>l.max||n<l.min||(e<l.min&&(l.min=e),n>l.max&&(l.max=n),a=!1)}a&&c.push({min:e,max:n})}};for(n=0;n<u.length;n++){var d=u[n];if(d.enabled)if(d.bounds){var p=t,h=r;d.pattern&&(p=Math.floor(p)),l=(a=i.simpleMap(d.bounds,d.pattern?o:e.r2l))[0],s=a[1];var x,b,k=new Date(p);switch(d.pattern){case w:b=7*g,x=(s-l+(s<l?7:0))*g,p+=l*g-(k.getUTCDay()*g+k.getUTCHours()*v+k.getUTCMinutes()*m+k.getUTCSeconds()*y+k.getUTCMilliseconds());break;case _:b=g,x=(s-l+(s<l?24:0))*v,p+=l*v-(k.getUTCHours()*v+k.getUTCMinutes()*m+k.getUTCSeconds()*y+k.getUTCMilliseconds());break;default:p=Math.min(a[0],a[1]),x=b=(h=Math.max(a[0],a[1]))-p}for(var T=p;T<h;T+=b)f(T,T+x)}else for(var M=i.simpleMap(d.values,e.d2c),A=0;A<M.length;A++)f(l=M[A],s=l+d.dvalue)}return c.sort(function(e,t){return e.min-t.min}),c},e.makeCalcdata=function(t,r){var n,a,o,l,s=e.type,c="date"===s&&t[r+"calendar"];if(r in t){if(n=t[r],l=t._length||i.minRowLength(n),i.isTypedArray(n)&&("linear"===s||"log"===s)){if(l===n.length)return n;if(n.subarray)return n.subarray(0,l)}if("multicategory"===s)return function(e,t){for(var r=new Array(t),n=0;n<t;n++){var a=(e[0]||[])[n],i=(e[1]||[])[n];r[n]=O([a,i])}return r}(n,l);for(a=new Array(l),o=0;o<l;o++)a[o]=e.d2c(n[o],0,c)}else{var u=r+"0"in t?e.d2c(t[r+"0"],0,c):0,f=t["d"+r]?Number(t["d"+r]):1;for(n=t[{x:"y",y:"x"}[r]],l=t._length||n.length,a=new Array(l),o=0;o<l;o++)a[o]=u+o*f}if(e.rangebreaks)for(o=0;o<l;o++)a[o]=e.maskBreaks(a[o]);return a},e.isValidRange=function(t){return Array.isArray(t)&&2===t.length&&a(e.r2l(t[0]))&&a(e.r2l(t[1]))},e.isPtWithinRange=function(t,r){var n=e.c2l(t[f],null,r),a=e.r2l(e.range[0]),i=e.r2l(e.range[1]);return a<i?a<=n&&n<=i:i<=n&&n<=a},e.clearCalc=function(){var n=function(){e._categories=[],e._categoriesMap={}},a=t._axisMatchGroups;if(a&&a.length){for(var i=!1,o=0;o<a.length;o++){var l=a[o];if(l[r]){i=!0;var s=null,c=null;for(var u in l){var f=t[x.id2name(u)];if(f._categories){s=f._categories,c=f._categoriesMap;break}}s&&c?(e._categories=s,e._categoriesMap=c):n();break}}i||n()}else n();if(e._initialCategories)for(var d=0;d<e._initialCategories.length;d++)C(e._initialCategories[d])},e.sortByInitialCategories=function(){var n=[];if(e._categories=[],e._categoriesMap={},e._initialCategories)for(var a=0;a<e._initialCategories.length;a++)C(e._initialCategories[a]);n=n.concat(e._traceIndices);var i=e._matchGroup;for(var o in i)if(r!==o){var l=t[x.id2name(o)];l._categories=e._categories,l._categoriesMap=e._categoriesMap,n=n.concat(l._traceIndices)}return n};var F=t._d3locale;"date"===e.type&&(e._dateFormat=F?F.timeFormat.utc:n.time.format.utc,e._extraFormat=t._extraFormat),e._separators=t.separators,e._numFormat=F?F.numberFormat:n.format,delete e._minDtick,delete e._forceTick0}},{"../../constants/numerical":128,"../../lib":148,"./axis_ids":195,"./constants":198,d3:2,"fast-isnumeric":4}],211:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./layout_attributes"),i=e("../array_container_defaults");function o(e){var t=["showexponent","showtickprefix","showticksuffix"].filter(function(t){return void 0!==e[t]});if(t.every(function(r){return e[r]===e[t[0]]})||1===t.length)return e[t[0]]}function l(e,t){function r(r,i){return n.coerce(e,t,a.tickformatstops,r,i)}r("enabled")&&(r("dtickrange"),r("value"))}t.exports=function(e,t,r,s,c,u){u&&1!==u.pass||function(e,t,r,n,a){var i=o(e);r("tickprefix")&&r("showtickprefix",i);r("ticksuffix",a.tickSuffixDflt)&&r("showticksuffix",i)}(e,0,r,0,c),u&&2!==u.pass||function(e,t,r,s,c){var u=o(e);r("tickprefix")&&r("showtickprefix",u);r("ticksuffix",c.tickSuffixDflt)&&r("showticksuffix",u);if(r("showticklabels")){var f=c.font||{},d=t.color,p=d&&d!==a.color.dflt?d:f.color;if(n.coerceFont(r,"tickfont",{family:f.family,size:f.size,color:p}),r("tickangle"),"category"!==s){var h=r("tickformat");i(e,t,{name:"tickformatstops",inclusionAttr:"enabled",handleItemDefaults:l}),t.tickformatstops.length||delete t.tickformatstops,h||"date"===s||(r("showexponent",u),r("exponentformat"),r("separatethousands"))}}}(e,t,r,s,c)}},{"../../lib":148,"../array_container_defaults":188,"./layout_attributes":204}],212:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./layout_attributes");t.exports=function(e,t,r,i){var o=n.coerce2(e,t,a,"ticklen"),l=n.coerce2(e,t,a,"tickwidth"),s=n.coerce2(e,t,a,"tickcolor",t.color);r("ticks",i.outerTicks||o||l||s?"outside":"")||(delete t.ticklen,delete t.tickwidth,delete t.tickcolor)}},{"../../lib":148,"./layout_attributes":204}],213:[function(e,t,r){"use strict";var n=e("./clean_ticks");t.exports=function(e,t,r,a){function i(r){var n=e[r];return void 0!==n?n:(t._template||{})[r]}var o,l=i("tick0"),s=i("dtick"),c=i("tickvals");"array"!==i("tickmode")||"log"!==a&&"date"!==a?o=r("tickmode",Array.isArray(c)?"array":s?"linear":"auto"):o=t.tickmode="auto";if("auto"===o)r("nticks");else if("linear"===o){var u=t.dtick=n.dtick(s,a);t.tick0=n.tick0(l,a,t.calendar,u)}else if("multicategory"!==a){void 0===r("tickvals")?t.tickmode="auto":r("ticktext")}}},{"./clean_ticks":197}],214:[function(e,t,r){"use strict";var n=e("d3"),a=e("../../registry"),i=e("../../lib"),o=e("../../components/drawing"),l=e("./axes");t.exports=function(e,t,r,s){var c=e._fullLayout;if(0!==t.length){var u,f,d,p;s&&(u=s());var h=n.ease(r.easing);return e._transitionData._interruptCallbacks.push(function(){return window.cancelAnimationFrame(p),p=null,function(){for(var r={},n=0;n<t.length;n++){var i=t[n],o=i.plotinfo.xaxis,l=i.plotinfo.yaxis;i.xr0&&(r[o._name+".range"]=i.xr0.slice()),i.yr0&&(r[l._name+".range"]=i.yr0.slice())}return a.call("relayout",e,r).then(function(){for(var e=0;e<t.length;e++)g(t[e].plotinfo)})}()}),f=Date.now(),p=window.requestAnimationFrame(function n(){d=Date.now();for(var i=Math.min(1,(d-f)/r.duration),o=h(i),l=0;l<t.length;l++)v(t[l],o);d-f>r.duration?(function(){for(var r={},n=0;n<t.length;n++){var i=t[n],o=i.plotinfo.xaxis,l=i.plotinfo.yaxis;i.xr1&&(r[o._name+".range"]=i.xr1.slice()),i.yr1&&(r[l._name+".range"]=i.yr1.slice())}u&&u(),a.call("relayout",e,r).then(function(){for(var e=0;e<t.length;e++)g(t[e].plotinfo)})}(),p=window.cancelAnimationFrame(n)):p=window.requestAnimationFrame(n)}),Promise.resolve()}function g(e){var t=e.xaxis,r=e.yaxis;c._defs.select("#"+e.clipId+"> rect").call(o.setTranslate,0,0).call(o.setScale,1,1),e.plot.call(o.setTranslate,t._offset,r._offset).call(o.setScale,1,1);var n=e.plot.selectAll(".scatterlayer .trace");n.selectAll(".point").call(o.setPointGroupScale,1,1),n.selectAll(".textpoint").call(o.setTextPointsScale,1,1),n.call(o.hideOutsideRangePoints,e)}function v(t,r){var n=t.plotinfo,a=n.xaxis,s=n.yaxis,c=a._length,u=s._length,f=!!t.xr1,d=!!t.yr1,p=[];if(f){var h=i.simpleMap(t.xr0,a.r2l),g=i.simpleMap(t.xr1,a.r2l),v=h[1]-h[0],m=g[1]-g[0];p[0]=(h[0]*(1-r)+r*g[0]-h[0])/(h[1]-h[0])*c,p[2]=c*(1-r+r*m/v),a.range[0]=a.l2r(h[0]*(1-r)+r*g[0]),a.range[1]=a.l2r(h[1]*(1-r)+r*g[1])}else p[0]=0,p[2]=c;if(d){var y=i.simpleMap(t.yr0,s.r2l),x=i.simpleMap(t.yr1,s.r2l),b=y[1]-y[0],_=x[1]-x[0];p[1]=(y[1]*(1-r)+r*x[1]-y[1])/(y[0]-y[1])*u,p[3]=u*(1-r+r*_/b),s.range[0]=a.l2r(y[0]*(1-r)+r*x[0]),s.range[1]=s.l2r(y[1]*(1-r)+r*x[1])}else p[1]=0,p[3]=u;l.drawOne(e,a,{skipTitle:!0}),l.drawOne(e,s,{skipTitle:!0}),l.redrawComponents(e,[a._id,s._id]);var w=f?c/p[2]:1,k=d?u/p[3]:1,T=f?p[0]:0,M=d?p[1]:0,A=f?p[0]/p[2]*c:0,L=d?p[1]/p[3]*u:0,S=a._offset-A,C=s._offset-L;n.clipRect.call(o.setTranslate,T,M).call(o.setScale,1/w,1/k),n.plot.call(o.setTranslate,S,C).call(o.setScale,w,k),o.setPointGroupScale(n.zoomScalePts,1/w,1/k),o.setTextPointsScale(n.zoomScaleTxt,1/w,1/k)}l.redrawComponents(e)}},{"../../components/drawing":51,"../../lib":148,"../../registry":232,"./axes":192,d3:2}],215:[function(e,t,r){"use strict";var n=e("../../registry").traceIs,a=e("./axis_autotype");function i(e){return{v:"x",h:"y"}[e.orientation||"v"]}function o(e,t){var r=i(e),a=n(e,"box-violin"),o=n(e._fullInput||{},"candlestick");return a&&!o&&t===r&&void 0===e[r]&&void 0===e[r+"0"]}t.exports=function(e,t,r,l){"-"===r("type",(l.splomStash||{}).type)&&(!function(e,t){if("-"!==e.type)return;var r,l=e._id,s=l.charAt(0);-1!==l.indexOf("scene")&&(l=s);var c=function(e,t,r){for(var n=0;n<e.length;n++){var a=e[n];if("splom"===a.type&&a._length>0&&(a["_"+r+"axes"]||{})[t])return a;if((a[r+"axis"]||r)===t){if(o(a,r))return a;if((a[r]||[]).length||a[r+"0"])return a}}}(t,l,s);if(!c)return;if("histogram"===c.type&&s==={v:"y",h:"x"}[c.orientation||"v"])return void(e.type="linear");var u=s+"calendar",f=c[u],d={noMultiCategory:!n(c,"cartesian")||n(c,"noMultiCategory")};"box"===c.type&&c._hasPreCompStats&&s==={h:"x",v:"y"}[c.orientation||"v"]&&(d.noMultiCategory=!0);if(o(c,s)){var p=i(c),h=[];for(r=0;r<t.length;r++){var g=t[r];n(g,"box-violin")&&(g[s+"axis"]||s)===l&&(void 0!==g[p]?h.push(g[p][0]):void 0!==g.name?h.push(g.name):h.push("text"),g[u]!==f&&(f=void 0))}e.type=a(h,f,d)}else if("splom"===c.type){var v=c.dimensions,m=v[c._axesDim[l]];m.visible&&(e.type=a(m.values,f,d))}else e.type=a(c[s]||[c[s+"0"]],f,d)}(t,l.data),"-"===t.type?t.type="linear":e.type=t.type)}},{"../../registry":232,"./axis_autotype":193}],216:[function(e,t,r){"use strict";var n=e("../registry"),a=e("../lib");function i(e,t,r){var n,i,o,l=!1;if("data"===t.type)n=e._fullData[null!==t.traces?t.traces[0]:0];else{if("layout"!==t.type)return!1;n=e._fullLayout}return i=a.nestedProperty(n,t.prop).get(),(o=r[t.type]=r[t.type]||{}).hasOwnProperty(t.prop)&&o[t.prop]!==i&&(l=!0),o[t.prop]=i,{changed:l,value:i}}function o(e,t){var r=[],n=t[0],i={};if("string"==typeof n)i[n]=t[1];else{if(!a.isPlainObject(n))return r;i=n}return s(i,function(e,t,n){r.push({type:"layout",prop:e,value:n})},"",0),r}function l(e,t){var r,n,i,o,l=[];if(n=t[0],i=t[1],r=t[2],o={},"string"==typeof n)o[n]=i;else{if(!a.isPlainObject(n))return l;o=n,void 0===r&&(r=i)}return void 0===r&&(r=null),s(o,function(t,n,a){var i,o;if(Array.isArray(a)){o=a.slice();var s=Math.min(o.length,e.data.length);r&&(s=Math.min(s,r.length)),i=[];for(var c=0;c<s;c++)i[c]=r?r[c]:c}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 u=o;o=[];for(var f=0;f<i.length;f++)o[f]=u}o.length=Math.min(i.length,o.length)}l.push({type:"data",prop:t,traces:i,value:o})},"",0),l}function s(e,t,r,n){Object.keys(e).forEach(function(i){var o=e[i];if("_"!==i[0]){var l=r+(n>0?".":"")+i;a.isPlainObject(o)?s(o,t,l,n+1):t(l,i,o)}})}r.manageCommandObserver=function(e,t,n,o){var l={},s=!0;t&&t._commandObserver&&(l=t._commandObserver),l.cache||(l.cache={}),l.lookupTable={};var c=r.hasSimpleAPICommandBindings(e,n,l.lookupTable);if(t&&t._commandObserver){if(c)return l;if(t._commandObserver.remove)return t._commandObserver.remove(),t._commandObserver=null,l}if(c){i(e,c,l.cache),l.check=function(){if(s){var t=i(e,c,l.cache);return t.changed&&o&&void 0!==l.lookupTable[t.value]&&(l.disable(),Promise.resolve(o({value:t.value,type:c.type,prop:c.prop,traces:c.traces,index:l.lookupTable[t.value]})).then(l.enable,l.enable)),t.changed}};for(var u=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],f=0;f<u.length;f++)e._internalOn(u[f],l.check);l.remove=function(){for(var t=0;t<u.length;t++)e._removeInternalListener(u[t],l.check)}}else a.log("Unable to automatically bind plot updates to API command"),l.lookupTable={},l.remove=function(){};return l.disable=function(){s=!1},l.enable=function(){s=!0},t&&(t._commandObserver=l),l},r.hasSimpleAPICommandBindings=function(e,t,n){var a,i,o=t.length;for(a=0;a<o;a++){var l,s=t[a],c=s.method,u=s.args;if(Array.isArray(u)||(u=[]),!c)return!1;var f=r.computeAPICommandBindings(e,c,u);if(1!==f.length)return!1;if(i){if((l=f[0]).type!==i.type)return!1;if(l.prop!==i.prop)return!1;if(Array.isArray(i.traces)){if(!Array.isArray(l.traces))return!1;l.traces.sort();for(var d=0;d<i.traces.length;d++)if(i.traces[d]!==l.traces[d])return!1}else if(l.prop!==i.prop)return!1}else i=f[0],Array.isArray(i.traces)&&i.traces.sort();var p=(l=f[0]).value;if(Array.isArray(p)){if(1!==p.length)return!1;p=p[0]}n&&(n[p]=a)}return i},r.executeAPICommand=function(e,t,r){if("skip"===t)return Promise.resolve();var i=n.apiMethodRegistry[t],o=[e];Array.isArray(r)||(r=[]);for(var l=0;l<r.length;l++)o.push(r[l]);return i.apply(null,o).catch(function(e){return a.warn("API call to Plotly."+t+" rejected.",e),Promise.reject(e)})},r.computeAPICommandBindings=function(e,t,r){var n;switch(Array.isArray(r)||(r=[]),t){case"restyle":n=l(e,r);break;case"relayout":n=o(e,r);break;case"update":n=l(e,[r[0],r[2]]).concat(o(e,[r[1]]));break;case"animate":n=function(e,t){return Array.isArray(t[0])&&1===t[0].length&&-1!==["string","number"].indexOf(typeof t[0][0])?[{type:"layout",prop:"_currentFrame",value:t[0][0].toString()}]:[]}(0,r);break;default:n=[]}return n}},{"../lib":148,"../registry":232}],217:[function(e,t,r){"use strict";var n=e("../lib/extend").extendFlat;r.attributes=function(e,t){e=e||{},t=t||{};var r={valType:"info_array",editType:e.editType,items:[{valType:"number",min:0,max:1,editType:e.editType},{valType:"number",min:0,max:1,editType:e.editType}],dflt:[0,1]},a=(e.name&&e.name,e.trace,t.description&&t.description,{x:n({},r,{}),y:n({},r,{}),editType:e.editType});return e.noGridCell||(a.row={valType:"integer",min:0,dflt:0,editType:e.editType},a.column={valType:"integer",min:0,dflt:0,editType:e.editType}),a},r.defaults=function(e,t,r,n){var a=n&&n.x||[0,1],i=n&&n.y||[0,1],o=t.grid;if(o){var l=r("domain.column");void 0!==l&&(l<o.columns?a=o._domains.x[l]:delete e.domain.column);var s=r("domain.row");void 0!==s&&(s<o.rows?i=o._domains.y[s]:delete e.domain.row)}var c=r("domain.x",a),u=r("domain.y",i);c[0]<c[1]||(e.domain.x=a.slice()),u[0]<u[1]||(e.domain.y=i.slice())}},{"../lib/extend":143}],218:[function(e,t,r){"use strict";t.exports=function(e){var t=e.editType,r=e.colorEditType;void 0===r&&(r=t);var n={family:{valType:"string",noBlank:!0,strict:!0,editType:t},size:{valType:"number",min:1,editType:t},color:{valType:"color",editType:r},editType:t};return e.arrayOk&&(n.family.arrayOk=!0,n.size.arrayOk=!0,n.color.arrayOk=!0),n}},{}],219:[function(e,t,r){"use strict";t.exports={_isLinkedToArray:"frames_entry",group:{valType:"string"},name:{valType:"string"},traces:{valType:"any"},baseframe:{valType:"string"},data:{valType:"any"},layout:{valType:"any"}}},{}],220:[function(e,t,r){"use strict";var n=e("../registry"),a=e("./cartesian/constants").SUBPLOT_PATTERN;r.getSubplotCalcData=function(e,t,r){var a=n.subplotsRegistry[t];if(!a)return[];for(var i=a.attr,o=[],l=0;l<e.length;l++){var s=e[l];s[0].trace[i]===r&&o.push(s)}return o},r.getModuleCalcData=function(e,t){var r,a=[],i=[];if(!(r="string"==typeof t?n.getModule(t).plot:"function"==typeof t?t:t.plot))return[a,e];for(var o=0;o<e.length;o++){var l=e[o],s=l[0].trace;!0===s.visible&&0!==s._length&&(s._module.plot===r?a.push(l):i.push(l))}return[a,i]},r.getSubplotData=function(e,t,r){if(!n.subplotsRegistry[t])return[];var i,o,l,s=n.subplotsRegistry[t].attr,c=[];if("gl2d"===t){var u=r.match(a);o="x"+u[1],l="y"+u[2]}for(var f=0;f<e.length;f++)i=e[f],"gl2d"===t&&n.traceIs(i,"gl2d")?i[s[0]]===o&&i[s[1]]===l&&c.push(i):i[s]===r&&c.push(i);return c}},{"../registry":232,"./cartesian/constants":198}],221:[function(e,t,r){"use strict";function n(e,t){var r,n,a=[0,0,0,0];for(r=0;r<4;++r)for(n=0;n<4;++n)a[n]+=e[4*r+n]*t[r];return a}t.exports=function(e,t){return n(e.projection,n(e.view,n(e.model,[t[0],t[1],t[2],1])))}},{}],222:[function(e,t,r){"use strict";var n=e("./font_attributes"),a=e("./animation_attributes"),i=e("../components/color/attributes"),o=e("./pad_attributes"),l=e("../lib/extend").extendFlat,s=n({editType:"calc"});s.family.dflt='"Open Sans", verdana, arial, sans-serif',s.size.dflt=12,s.color.dflt=i.defaultLine,t.exports={font:s,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(o({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"},paper_bgcolor:{valType:"color",dflt:i.background,editType:"plot"},plot_bgcolor:{valType:"color",dflt:i.background,editType:"layoutstyle"},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"},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":29,"../lib/extend":143,"./animation_attributes":187,"./font_attributes":218,"./pad_attributes":223}],223:[function(e,t,r){"use strict";t.exports=function(e){var t=e.editType;return{t:{valType:"number",dflt:0,editType:t},r:{valType:"number",dflt:0,editType:t},b:{valType:"number",dflt:0,editType:t},l:{valType:"number",dflt:0,editType:t},editType:t}}},{}],224:[function(e,t,r){"use strict";var n=e("d3"),a=e("fast-isnumeric"),i=e("../registry"),o=e("../plot_api/plot_schema"),l=e("../plot_api/plot_template"),s=e("../lib"),c=e("../components/color"),u=e("../constants/numerical").BADNUM,f=e("./cartesian/axis_ids"),d=e("./animation_attributes"),p=e("./frame_attributes"),h=e("../plots/get_data").getModuleCalcData,g=s.relinkPrivateKeys,v=s._,m=t.exports={};s.extendFlat(m,i),m.attributes=e("./attributes"),m.attributes.type.values=m.allTypes,m.fontAttrs=e("./font_attributes"),m.layoutAttributes=e("./layout_attributes"),m.fontWeight="normal";var y=m.transformsRegistry,x=e("./command");m.executeAPICommand=x.executeAPICommand,m.computeAPICommandBindings=x.computeAPICommandBindings,m.manageCommandObserver=x.manageCommandObserver,m.hasSimpleAPICommandBindings=x.hasSimpleAPICommandBindings,m.redrawText=function(e){var t=(e=s.getGraphDiv(e))._fullLayout||{};if(!(!(t._has&&t._has("polar"))&&e.data&&e.data[0]&&e.data[0].r))return new Promise(function(t){setTimeout(function(){i.getComponentMethod("annotations","draw")(e),i.getComponentMethod("legend","draw")(e),i.getComponentMethod("colorbar","draw")(e),t(m.previousPromises(e))},300)})},m.resize=function(e){var t;e=s.getGraphDiv(e);var r=new Promise(function(r,n){e&&!s.isHidden(e)||n(new Error("Resize must be passed a displayed plot div element.")),e._redrawTimer&&clearTimeout(e._redrawTimer),e._resolveResize&&(t=e._resolveResize),e._resolveResize=r,e._redrawTimer=setTimeout(function(){if(!e.layout||e.layout.width&&e.layout.height||s.isHidden(e))r(e);else{delete e.layout.width,delete e.layout.height;var t=e.changed;e.autoplay=!0,i.call("relayout",e,{autosize:!0}).then(function(){e.changed=t,e._resolveResize===r&&(delete e._resolveResize,r(e))})}},100)});return t&&t(r),r},m.previousPromises=function(e){if((e._promises||[]).length)return Promise.all(e._promises).then(function(){e._promises=[]})},m.addLinks=function(e){if(e._context.showLink||e._context.showSources){var t=e._fullLayout,r=s.ensureSingle(t._paper,"text","js-plot-link-container",function(e){e.style({"font-family":'"Open Sans", Arial, sans-serif',"font-size":"12px",fill:c.defaultLine,"pointer-events":"all"}).each(function(){var e=n.select(this);e.append("tspan").classed("js-link-to-tool",!0),e.append("tspan").classed("js-link-spacer",!0),e.append("tspan").classed("js-sourcelinks",!0)})}),a=r.node(),i={y:t._paper.attr("height")-9};document.body.contains(a)&&a.getComputedTextLength()>=t.width-20?(i["text-anchor"]="start",i.x=5):(i["text-anchor"]="end",i.x=t._paper.attr("width")-7),r.attr(i);var o=r.select(".js-link-to-tool"),l=r.select(".js-link-spacer"),u=r.select(".js-sourcelinks");e._context.showSources&&e._context.showSources(e),e._context.showLink&&function(e,t){t.text("");var r=t.append("a").attr({"xlink:xlink:href":"#",class:"link--impt link--embedview","font-weight":"bold"}).text(e._context.linkText+" "+String.fromCharCode(187));if(e._context.sendData)r.on("click",function(){m.sendDataToCloud(e)});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})}}(e,o),l.text(o.text()&&u.text()?" - ":"")}},m.sendDataToCloud=function(e){var t=(window.PLOTLYENV||{}).BASE_URL||e._context.plotlyServerURL;if(t){e.emit("plotly_beforeexport");var r=n.select(e).append("div").attr("id","hiddenform").style("display","none"),a=r.append("form").attr({action:t+"/external",method:"post",target:"_blank"});return a.append("input").attr({type:"text",name:"data"}).node().value=m.graphJson(e,!1,"keepdata"),a.node().submit(),r.remove(),e.emit("plotly_afterexport"),!1}};var b=["days","shortDays","months","shortMonths","periods","dateTime","date","time","decimal","thousands","grouping","currency"],_=["year","month","dayMonth","dayMonthYear"];function w(e,t){var r=e._context.locale,n=!1,a={};function o(e){for(var r=!0,i=0;i<t.length;i++){var o=t[i];a[o]||(e[o]?a[o]=e[o]:r=!1)}r&&(n=!0)}for(var l=0;l<2;l++){for(var s=e._context.locales,c=0;c<2;c++){var u=(s[r]||{}).format;if(u&&(o(u),n))break;s=i.localeRegistry}var f=r.split("-")[0];if(n||f===r)break;r=f}return n||o(i.localeRegistry.en.format),a}function k(e,t){var r={_fullLayout:t},n="x"===e._id.charAt(0),a=e._mainAxis._anchorAxis,i="",o="",l="";if(a&&(l=a._mainAxis._id,i=n?e._id+l:l+e._id),!i||!t._plots[i]){i="";for(var s=e._counterAxes,c=0;c<s.length;c++){var u=s[c],d=n?e._id+u:u+e._id;o||(o=d);var p=f.getFromId(r,u);if(l&&p.overlaying===l){i=d;break}}}return i||o}function T(e){var t=e.transforms;if(Array.isArray(t)&&t.length)for(var r=0;r<t.length;r++){var n=t[r],a=n._module||y[n.type];if(a&&a.makesData)return!0}return!1}function M(e,t,r,n){for(var a=e.transforms,i=[e],o=0;o<a.length;o++){var l=a[o],s=y[l.type];s&&s.transform&&(i=s.transform(i,{transform:l,fullTrace:e,fullData:t,layout:r,fullLayout:n,transformIndex:o}))}return i}function A(e){var t=e.margin;if(!e._size){var r=e._size={l:Math.round(t.l),r:Math.round(t.r),t:Math.round(t.t),b:Math.round(t.b),p:Math.round(t.pad)};r.w=Math.round(e.width)-r.l-r.r,r.h=Math.round(e.height)-r.t-r.b}e._pushmargin||(e._pushmargin={}),e._pushmarginIds||(e._pushmarginIds={})}m.supplyDefaults=function(e,t){var r=t&&t.skipUpdateCalc,a=e._fullLayout||{};if(a._skipDefaults)delete a._skipDefaults;else{var o,l=e._fullLayout={},c=e.layout||{},u=e._fullData||[],f=e._fullData=[],d=e.data||[],p=e.calcdata||[],h=e._context||{};e._transitionData||m.createTransitionData(e),l._dfltTitle={plot:v(e,"Click to enter Plot title"),x:v(e,"Click to enter X axis title"),y:v(e,"Click to enter Y axis title"),colorbar:v(e,"Click to enter Colorscale title"),annotation:v(e,"new text")},l._traceWord=v(e,"trace");var y=w(e,b);if(l._mapboxAccessToken=h.mapboxAccessToken,a._initialAutoSizeIsDone){var x=a.width,k=a.height;m.supplyLayoutGlobalDefaults(c,l,y),c.width||(l.width=x),c.height||(l.height=k),m.sanitizeMargins(l)}else{m.supplyLayoutGlobalDefaults(c,l,y);var T=!c.width||!c.height,M=l.autosize,L=h.autosizable;T&&(M||L)?m.plotAutoSize(e,c,l):T&&m.sanitizeMargins(l),!M&&T&&(c.width=l.width,c.height=l.height)}l._d3locale=function(e,t){return e.decimal=t.charAt(0),e.thousands=t.charAt(1),n.locale(e)}(y,l.separators),l._extraFormat=w(e,_),l._initialAutoSizeIsDone=!0,l._dataLength=d.length,l._modules=[],l._visibleModules=[],l._basePlotModules=[];var S=l._subplots=function(){var e,t,r=i.collectableSubplotTypes,n={};if(!r){r=[];var a=i.subplotsRegistry;for(var o in a){var l=a[o],c=l.attr;if(c&&(r.push(o),Array.isArray(c)))for(t=0;t<c.length;t++)s.pushUnique(r,c[t])}}for(e=0;e<r.length;e++)n[r[e]]=[];return n}(),C=l._splomAxes={x:{},y:{}},O=l._splomSubplots={};l._splomGridDflt={},l._scatterStackOpts={},l._firstScatter={},l._alignmentOpts={},l._colorAxes={},l._requestRangeslider={},l._traceUids=function(e,t){var r,n,a=t.length,i=[];for(r=0;r<e.length;r++){var o=e[r]._fullInput;o!==n&&i.push(o),n=o}var l=i.length,c=new Array(a),u={};function f(e,t){c[t]=e,u[e]=1}function d(e,t){if(e&&"string"==typeof e&&!u[e])return f(e,t),!0}for(r=0;r<a;r++){var p=t[r].uid;"number"==typeof p&&(p=String(p)),d(p,r)||(r<l&&d(i[r].uid,r)||f(s.randstr(u),r))}return c}(u,d),l._globalTransforms=(e._context||{}).globalTransforms,m.supplyDataDefaults(d,f,c,l);var P=Object.keys(C.x),D=Object.keys(C.y);if(P.length>1&&D.length>1){for(i.getComponentMethod("grid","sizeDefaults")(c,l),o=0;o<P.length;o++)s.pushUnique(S.xaxis,P[o]);for(o=0;o<D.length;o++)s.pushUnique(S.yaxis,D[o]);for(var z in O)s.pushUnique(S.cartesian,z)}if(l._has=m._hasPlotType.bind(l),u.length===f.length)for(o=0;o<f.length;o++)g(f[o],u[o]);m.supplyLayoutModuleDefaults(c,l,f,e._transitionData);var R=l._visibleModules,E=[];for(o=0;o<R.length;o++){var I=R[o].crossTraceDefaults;I&&s.pushUnique(E,I)}for(o=0;o<E.length;o++)E[o](f,l);l._hasOnlyLargeSploms=1===l._basePlotModules.length&&"splom"===l._basePlotModules[0].name&&P.length>15&&D.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"),m.linkSubplots(f,l,u,a),m.cleanPlot(f,l,u,a),a._zoomlayer&&!e._dragging&&a._zoomlayer.selectAll(".select-outline").remove(),function(e,t){var r,n=[];t.meta&&(r=t._meta={meta:t.meta,layout:{meta:t.meta}});for(var a=0;a<e.length;a++){var i=e[a];i.meta?n[i.index]=i._meta={meta:i.meta}:t.meta&&(i._meta={meta:t.meta}),t.meta&&(i._meta.layout={meta:t.meta})}n.length&&(r||(r=t._meta={}),r.data=n)}(f,l),g(l,a),i.getComponentMethod("colorscale","crossTraceDefaults")(f,l),l._preGUI||(l._preGUI={}),l._tracePreGUI||(l._tracePreGUI={});var F,N=l._tracePreGUI,j={};for(F in N)j[F]="old";for(o=0;o<f.length;o++)j[F=f[o]._fullInput.uid]||(N[F]={}),j[F]="new";for(F in j)"old"===j[F]&&delete N[F];A(l),i.getComponentMethod("rangeslider","makeData")(l),r||p.length!==f.length||m.supplyDefaultsUpdateCalc(p,f)}},m.supplyDefaultsUpdateCalc=function(e,t){for(var r=0;r<t.length;r++){var n=t[r],a=(e[r]||[])[0];if(a&&a.trace){var i=a.trace;if(i._hasCalcTransform){var o,l,c,u=i._arrayAttrs;for(o=0;o<u.length;o++)l=u[o],c=s.nestedProperty(i,l).get().slice(),s.nestedProperty(n,l).set(c)}a.trace=n}}},m.createTransitionData=function(e){e._transitionData||(e._transitionData={}),e._transitionData._frames||(e._transitionData._frames=[]),e._transitionData._frameHash||(e._transitionData._frameHash={}),e._transitionData._counter||(e._transitionData._counter=0),e._transitionData._interruptCallbacks||(e._transitionData._interruptCallbacks=[])},m._hasPlotType=function(e){var t,r=this._basePlotModules||[];for(t=0;t<r.length;t++)if(r[t].name===e)return!0;var n=this._modules||[];for(t=0;t<n.length;t++){var a=n[t].name;if(a===e)return!0;var o=i.modules[a];if(o&&o.categories[e])return!0}return!1},m.cleanPlot=function(e,t,r,n){var a,i,o=n._basePlotModules||[];for(a=0;a<o.length;a++){var l=o[a];l.clean&&l.clean(e,t,r,n)}var s=n._has&&n._has("gl"),c=t._has&&t._has("gl");s&&!c&&void 0!==n._glcontainer&&(n._glcontainer.selectAll(".gl-canvas").remove(),n._glcontainer.selectAll(".no-webgl").remove(),n._glcanvas=null);var u=!!n._infolayer;e:for(a=0;a<r.length;a++){var f=r[a].uid;for(i=0;i<e.length;i++){if(f===e[i].uid)continue e}u&&n._infolayer.select(".cb"+f).remove()}},m.linkSubplots=function(e,t,r,n){var a,o,l=n._plots||{},c=t._plots={},u=t._subplots,d={_fullData:e,_fullLayout:t},p=u.cartesian.concat(u.gl2d||[]);for(a=0;a<p.length;a++){var h,g=p[a],v=l[g],m=f.getFromId(d,g,"x"),y=f.getFromId(d,g,"y");for(v?h=c[g]=v:(h=c[g]={}).id=g,m._counterAxes.push(y._id),y._counterAxes.push(m._id),m._subplotsWith.push(g),y._subplotsWith.push(g),h.xaxis=m,h.yaxis=y,h._hasClipOnAxisFalse=!1,o=0;o<e.length;o++){var x=e[o];if(x.xaxis===h.xaxis._id&&x.yaxis===h.yaxis._id&&!1===x.cliponaxis){h._hasClipOnAxisFalse=!0;break}}}var b,_=f.list(d,null,!0);for(a=0;a<_.length;a++){var w=null;(b=_[a]).overlaying&&(w=f.getFromId(d,b.overlaying))&&w.overlaying&&(b.overlaying=!1,w=null),b._mainAxis=w||b,w&&(b.domain=w.domain.slice()),b._anchorAxis="free"===b.anchor?null:f.getFromId(d,b.anchor)}for(a=0;a<_.length;a++)if((b=_[a])._counterAxes.sort(f.idSort),b._subplotsWith.sort(s.subplotSort),b._mainSubplot=k(b,t),b._counterAxes.length&&(b.spikemode&&-1!==b.spikemode.indexOf("across")||b.automargin&&b.mirror&&"free"!==b.anchor||i.getComponentMethod("rangeslider","isVisible")(b))){var T=1,M=0;for(o=0;o<b._counterAxes.length;o++){var A=f.getFromId(d,b._counterAxes[o]);T=Math.min(T,A.domain[0]),M=Math.max(M,A.domain[1])}T<M&&(b._counterDomainMin=T,b._counterDomainMax=M)}},m.clearExpandedTraceDefaultColors=function(e){var t,r,n;for(r=[],(t=e._module._colorAttrs)||(e._module._colorAttrs=t=[],o.crawl(e._module.attributes,function(e,n,a,i){r[i]=n,r.length=i+1,"color"===e.valType&&void 0===e.dflt&&t.push(r.join("."))})),n=0;n<t.length;n++){s.nestedProperty(e,"_input."+t[n]).get()||s.nestedProperty(e,t[n]).set(null)}},m.supplyDataDefaults=function(e,t,r,n){var a,o,c,u=n._modules,f=n._visibleModules,d=n._basePlotModules,p=0,h=0;function v(e){t.push(e);var r=e._module;r&&(s.pushUnique(u,r),!0===e.visible&&s.pushUnique(f,r),s.pushUnique(d,e._module.basePlotModule),p++,!1!==e._input.visible&&h++)}n._transformModules=[];var y={},x=[],b=(r.template||{}).data||{},_=l.traceTemplater(b);for(a=0;a<e.length;a++){if(c=e[a],(o=_.newTrace(c)).uid=n._traceUids[a],m.supplyTraceDefaults(c,o,h,n,a),o.index=a,o._input=c,o._expandedIndex=p,o.transforms&&o.transforms.length)for(var w=!1!==c.visible&&!1===o.visible,k=M(o,t,r,n),T=0;T<k.length;T++){var A=k[T],L={_template:o._template,type:o.type,uid:o.uid+T};w&&!1===A.visible&&delete A.visible,m.supplyTraceDefaults(A,L,p,n,a),g(L,A),L.index=a,L._input=c,L._fullInput=o,L._expandedIndex=p,L._expandedInput=A,v(L)}else o._fullInput=o,o._expandedInput=o,v(o);i.traceIs(o,"carpetAxis")&&(y[o.carpet]=o),i.traceIs(o,"carpetDependent")&&x.push(a)}for(a=0;a<x.length;a++)if((o=t[x[a]]).visible){var S=y[o.carpet];o._carpet=S,S&&S.visible?(o.xaxis=S.xaxis,o.yaxis=S.yaxis):o.visible=!1}},m.supplyAnimationDefaults=function(e){var t;e=e||{};var r={};function n(t,n){return s.coerce(e||{},r,d,t,n)}if(n("mode"),n("direction"),n("fromcurrent"),Array.isArray(e.frame))for(r.frame=[],t=0;t<e.frame.length;t++)r.frame[t]=m.supplyAnimationFrameDefaults(e.frame[t]||{});else r.frame=m.supplyAnimationFrameDefaults(e.frame||{});if(Array.isArray(e.transition))for(r.transition=[],t=0;t<e.transition.length;t++)r.transition[t]=m.supplyAnimationTransitionDefaults(e.transition[t]||{});else r.transition=m.supplyAnimationTransitionDefaults(e.transition||{});return r},m.supplyAnimationFrameDefaults=function(e){var t={};function r(r,n){return s.coerce(e||{},t,d.frame,r,n)}return r("duration"),r("redraw"),t},m.supplyAnimationTransitionDefaults=function(e){var t={};function r(r,n){return s.coerce(e||{},t,d.transition,r,n)}return r("duration"),r("easing"),t},m.supplyFrameDefaults=function(e){var t={};function r(r,n){return s.coerce(e,t,p,r,n)}return r("group"),r("name"),r("traces"),r("baseframe"),r("data"),r("layout"),t},m.supplyTraceDefaults=function(e,t,r,n,a){var o,l=n.colorway||c.defaults,u=l[r%l.length];function f(r,n){return s.coerce(e,t,m.attributes,r,n)}var d=f("visible");f("type"),f("name",n._traceWord+" "+a),f("uirevision",n.uirevision);var p=m.getModule(t);if(t._module=p,p){var h=p.basePlotModule,g=h.attr,v=h.attributes;if(g&&v){var y=n._subplots,x="";if(d||"gl2d"!==h.name){if(Array.isArray(g))for(o=0;o<g.length;o++){var b=g[o],_=s.coerce(e,t,v,b);y[b]&&s.pushUnique(y[b],_),x+=_}else x=s.coerce(e,t,v,g);y[h.name]&&s.pushUnique(y[h.name],x)}}}return d&&(f("customdata"),f("ids"),f("meta"),i.traceIs(t,"showLegend")?(s.coerce(e,t,p.attributes.showlegend?p.attributes:m.attributes,"showlegend"),f("legendgroup"),t._dfltShowLegend=!0):t._dfltShowLegend=!1,p&&p.supplyDefaults(e,t,u,n),i.traceIs(t,"noOpacity")||f("opacity"),i.traceIs(t,"notLegendIsolatable")&&(t.visible=!!t.visible),i.traceIs(t,"noHover")||(t.hovertemplate||s.coerceHoverinfo(e,t,n),"parcats"!==t.type&&i.getComponentMethod("fx","supplyDefaults")(e,t,u,n)),p&&p.selectPoints&&f("selectedpoints"),m.supplyTransformDefaults(e,t,n)),t},m.hasMakesDataTransform=T,m.supplyTransformDefaults=function(e,t,r){if(t._length||T(e)){var n=r._globalTransforms||[],a=r._transformModules||[];if(Array.isArray(e.transforms)||0!==n.length)for(var i=e.transforms||[],o=n.concat(i),l=t.transforms=[],c=0;c<o.length;c++){var u,f=o[c],d=f.type,p=y[d],h=!(f._module&&f._module===p),g=p&&"function"==typeof p.transform;p||s.warn("Unrecognized transform type "+d+"."),p&&p.supplyDefaults&&(h||g)?((u=p.supplyDefaults(f,t,r,e)).type=d,u._module=p,s.pushUnique(a,p)):u=s.extendFlat({},f),l.push(u)}}},m.supplyLayoutGlobalDefaults=function(e,t,r){function n(r,n){return s.coerce(e,t,m.layoutAttributes,r,n)}var a=e.template;s.isPlainObject(a)&&(t.template=a,t._template=a.layout,t._dataTemplate=a.data);var o=s.coerceFont(n,"font");n("title.text",t._dfltTitle.plot),s.coerceFont(n,"title.font",{family:o.family,size:Math.round(1.4*o.size),color:o.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",!(e.width&&e.height)),n("width"),n("height"),n("margin.l"),n("margin.r"),n("margin.t"),n("margin.b"),n("margin.pad"),n("margin.autoexpand"),e.width&&e.height&&m.sanitizeMargins(t),i.getComponentMethod("grid","sizeDefaults")(e,t),n("paper_bgcolor"),n("separators",r.decimal+r.thousands),n("hidesources"),n("colorway"),n("datarevision");var l=n("uirevision");n("editrevision",l),n("selectionrevision",l),n("modebar.orientation"),n("modebar.bgcolor",c.addOpacity(t.paper_bgcolor,.5));var u=c.contrast(c.rgb(t.modebar.bgcolor));n("modebar.color",c.addOpacity(u,.3)),n("modebar.activecolor",c.addOpacity(u,.7)),n("modebar.uirevision",l),n("meta"),s.isPlainObject(e.transition)&&(n("transition.duration"),n("transition.easing"),n("transition.ordering")),i.getComponentMethod("calendars","handleDefaults")(e,t,"calendar"),i.getComponentMethod("fx","supplyLayoutGlobalDefaults")(e,t,n)},m.plotAutoSize=function(e,t,r){var n,i,o=e._context||{},l=o.frameMargins,c=s.isPlotDiv(e);if(c&&e.emit("plotly_autosize"),o.fillFrame)n=window.innerWidth,i=window.innerHeight,document.body.style.overflow="hidden";else{var u=c?window.getComputedStyle(e):{};if(n=parseFloat(u.width)||parseFloat(u.maxWidth)||r.width,i=parseFloat(u.height)||parseFloat(u.maxHeight)||r.height,a(l)&&l>0){var f=1-2*l;n=Math.round(f*n),i=Math.round(f*i)}}var d=m.layoutAttributes.width.min,p=m.layoutAttributes.height.min;n<d&&(n=d),i<p&&(i=p);var h=!t.width&&Math.abs(r.width-n)>1,g=!t.height&&Math.abs(r.height-i)>1;(g||h)&&(h&&(r.width=n),g&&(r.height=i)),e._initialAutoSize||(e._initialAutoSize={width:n,height:i}),m.sanitizeMargins(r)},m.supplyLayoutModuleDefaults=function(e,t,r,n){var a,o,l,c=i.componentsRegistry,u=t._basePlotModules,f=i.subplotsRegistry.cartesian;for(a in c)(l=c[a]).includeBasePlot&&l.includeBasePlot(e,t);for(var d in u.length||u.push(f),t._has("cartesian")&&(i.getComponentMethod("grid","contentDefaults")(e,t),f.finalizeSubplots(e,t)),t._subplots)t._subplots[d].sort(s.subplotSort);for(o=0;o<u.length;o++)(l=u[o]).supplyLayoutDefaults&&l.supplyLayoutDefaults(e,t,r);var p=t._modules;for(o=0;o<p.length;o++)(l=p[o]).supplyLayoutDefaults&&l.supplyLayoutDefaults(e,t,r);var h=t._transformModules;for(o=0;o<h.length;o++)(l=h[o]).supplyLayoutDefaults&&l.supplyLayoutDefaults(e,t,r,n);for(a in c)(l=c[a]).supplyLayoutDefaults&&l.supplyLayoutDefaults(e,t,r)},m.purge=function(e){var t=e._fullLayout||{};void 0!==t._glcontainer&&(t._glcontainer.selectAll(".gl-canvas").remove(),t._glcontainer.remove(),t._glcanvas=null),t._modeBar&&t._modeBar.destroy(),e._transitionData&&(e._transitionData._interruptCallbacks&&(e._transitionData._interruptCallbacks.length=0),e._transitionData._animationRaf&&window.cancelAnimationFrame(e._transitionData._animationRaf)),s.clearThrottle(),s.clearResponsive(e),delete e.data,delete e.layout,delete e._fullData,delete e._fullLayout,delete e.calcdata,delete e.framework,delete e.empty,delete e.fid,delete e.undoqueue,delete e.undonum,delete e.autoplay,delete e.changed,delete e._promises,delete e._redrawTimer,delete e._hmlumcount,delete e._hmpixcount,delete e._transitionData,delete e._transitioning,delete e._initialAutoSize,delete e._transitioningWithDuration,delete e._dragging,delete e._dragged,delete e._dragdata,delete e._hoverdata,delete e._snapshotInProgress,delete e._editing,delete e._mouseDownTime,delete e._legendMouseDownTime,e.removeAllListeners&&e.removeAllListeners()},m.style=function(e){var t,r=e._fullLayout._visibleModules,n=[];for(t=0;t<r.length;t++){var a=r[t];a.style&&s.pushUnique(n,a.style)}for(t=0;t<n.length;t++)n[t](e)},m.sanitizeMargins=function(e){if(e&&e.margin){var t,r=e.width,n=e.height,a=e.margin,i=r-(a.l+a.r),o=n-(a.t+a.b);i<0&&(t=(r-1)/(a.l+a.r),a.l=Math.floor(t*a.l),a.r=Math.floor(t*a.r)),o<0&&(t=(n-1)/(a.t+a.b),a.t=Math.floor(t*a.t),a.b=Math.floor(t*a.b))}},m.clearAutoMarginIds=function(e){e._fullLayout._pushmarginIds={}},m.allowAutoMargin=function(e,t){e._fullLayout._pushmarginIds[t]=1},m.autoMargin=function(e,t,r){var n=e._fullLayout,a=n._pushmargin,i=n._pushmarginIds;if(!1!==n.margin.autoexpand){if(r){var o=r.pad;if(void 0===o){var l=n.margin;o=Math.min(12,l.l,l.r,l.t,l.b)}r.l+r.r>.5*n.width&&(s.log("Margin push",t,"is too big in x, dropping"),r.l=r.r=0),r.b+r.t>.5*n.height&&(s.log("Margin push",t,"is too big in y, dropping"),r.b=r.t=0);var c=void 0!==r.xl?r.xl:r.x,u=void 0!==r.xr?r.xr:r.x,f=void 0!==r.yt?r.yt:r.y,d=void 0!==r.yb?r.yb:r.y;a[t]={l:{val:c,size:r.l+o},r:{val:u,size:r.r+o},b:{val:d,size:r.b+o},t:{val:f,size:r.t+o}},i[t]=1}else delete a[t],delete i[t];if(!n._replotting)return m.doAutoMargin(e)}},m.doAutoMargin=function(e){var t=e._fullLayout;t._size||(t._size={}),A(t);var r=t._size,n=t.margin,o=s.extendFlat({},r),l=n.l,c=n.r,u=n.t,f=n.b,d=t.width,p=t.height,h=t._pushmargin,g=t._pushmarginIds;if(!1!==t.margin.autoexpand){for(var v in h)g[v]||delete h[v];for(var y in h.base={l:{val:0,size:l},r:{val:1,size:c},t:{val:1,size:u},b:{val:0,size:f}},h){var x=h[y].l||{},b=h[y].b||{},_=x.val,w=x.size,k=b.val,T=b.size;for(var M in h){if(a(w)&&h[M].r){var L=h[M].r.val,S=h[M].r.size;if(L>_){var C=(w*L+(S-d)*_)/(L-_),O=(S*(1-_)+(w-d)*(1-L))/(L-_);C>=0&&O>=0&&d-(C+O)>0&&C+O>l+c&&(l=C,c=O)}}if(a(T)&&h[M].t){var P=h[M].t.val,D=h[M].t.size;if(P>k){var z=(T*P+(D-p)*k)/(P-k),R=(D*(1-k)+(T-p)*(1-P))/(P-k);z>=0&&R>=0&&p-(R+z)>0&&z+R>f+u&&(f=z,u=R)}}}}}if(r.l=Math.round(l),r.r=Math.round(c),r.t=Math.round(u),r.b=Math.round(f),r.p=Math.round(n.pad),r.w=Math.round(d)-r.l-r.r,r.h=Math.round(p)-r.t-r.b,!t._replotting&&m.didMarginChange(o,r)){"_redrawFromAutoMarginCount"in t?t._redrawFromAutoMarginCount++:t._redrawFromAutoMarginCount=1;var E=3*(1+Object.keys(g).length);if(t._redrawFromAutoMarginCount<E)return i.call("plot",e);s.warn("Too many auto-margin redraws.")}};var L=["l","r","t","b","p","w","h"];function S(e,t,r){var n=!1;var a=[m.previousPromises,function(){if(e._transitionData)return e._transitioning=!1,function(e){var t=Promise.resolve();if(!e)return t;for(;e.length;)t=t.then(e.shift());return t}(e._transitionData._interruptCallbacks)},r.prepareFn,m.rehover,function(){return e.emit("plotly_transitioning",[]),new Promise(function(a){e._transitioning=!0,t.duration>0&&(e._transitioningWithDuration=!0),e._transitionData._interruptCallbacks.push(function(){n=!0}),r.redraw&&e._transitionData._interruptCallbacks.push(function(){return i.call("redraw",e)}),e._transitionData._interruptCallbacks.push(function(){e.emit("plotly_transitioninterrupted",[])});var o=0,l=0;function s(){return o++,function(){var t;n||++l!==o||(t=a,e._transitionData&&(function(e){if(e)for(;e.length;)e.shift()}(e._transitionData._interruptCallbacks),Promise.resolve().then(function(){if(r.redraw)return i.call("redraw",e)}).then(function(){e._transitioning=!1,e._transitioningWithDuration=!1,e.emit("plotly_transitioned",[])}).then(t)))}}r.runFn(s),setTimeout(s())})}],o=s.syncOrAsync(a,e);return o&&o.then||(o=Promise.resolve()),o.then(function(){return e})}m.didMarginChange=function(e,t){for(var r=0;r<L.length;r++){var n=L[r],i=e[n],o=t[n];if(!a(i)||Math.abs(o-i)>1)return!0}return!1},m.graphJson=function(e,t,r,n,a,i){(a&&t&&!e._fullData||a&&!t&&!e._fullLayout)&&m.supplyDefaults(e);var o=a?e._fullData:e.data,l=a?e._fullLayout:e.layout,c=(e._transitionData||{})._frames;function u(e,t){if("function"==typeof e)return t?"_function_":null;if(s.isPlainObject(e)){var n,a={};return Object.keys(e).sort().forEach(function(i){if(-1===["_","["].indexOf(i.charAt(0)))if("function"!=typeof e[i]){if("keepdata"===r){if("src"===i.substr(i.length-3))return}else if("keepstream"===r){if("string"==typeof(n=e[i+"src"])&&n.indexOf(":")>0&&!s.isPlainObject(e.stream))return}else if("keepall"!==r&&"string"==typeof(n=e[i+"src"])&&n.indexOf(":")>0)return;a[i]=u(e[i],t)}else t&&(a[i]="_function")}),a}return Array.isArray(e)?e.map(function(e){return u(e,t)}):s.isTypedArray(e)?s.simpleMap(e,s.identity):s.isJSDate(e)?s.ms2DateTimeLocal(+e):e}var f={data:(o||[]).map(function(e){var r=u(e);return t&&delete r.fit,r})};return t||(f.layout=u(l)),e.framework&&e.framework.isPolar&&(f=e.framework.getConfig()),c&&(f.frames=u(c)),i&&(f.config=u(e._context,!0)),"object"===n?f:JSON.stringify(f)},m.modifyFrames=function(e,t){var r,n,a,i=e._transitionData._frames,o=e._transitionData._frameHash;for(r=0;r<t.length;r++)switch((n=t[r]).type){case"replace":a=n.value;var l=(i[n.index]||{}).name,s=a.name;i[n.index]=o[s]=a,s!==l&&(delete o[l],o[s]=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()},m.computeFrame=function(e,t){var r,n,a,i,o=e._transitionData._frameHash;if(!t)throw new Error("computeFrame must be given a string frame name");var l=o[t.toString()];if(!l)return!1;for(var s=[l],c=[l.name];l.baseframe&&(l=o[l.baseframe.toString()])&&-1===c.indexOf(l.name);)s.push(l),c.push(l.name);for(var u={};l=s.pop();)if(l.layout&&(u.layout=m.extendLayout(u.layout,l.layout)),l.data){if(u.data||(u.data=[]),!(n=l.traces))for(n=[],r=0;r<l.data.length;r++)n[r]=r;for(u.traces||(u.traces=[]),r=0;r<l.data.length;r++)void 0!==(a=n[r])&&null!==a&&(-1===(i=u.traces.indexOf(a))&&(i=u.data.length,u.traces[i]=a),u.data[i]=m.extendTrace(u.data[i],l.data[r]))}return u},m.recomputeFrameHash=function(e){for(var t=e._transitionData._frameHash={},r=e._transitionData._frames,n=0;n<r.length;n++){var a=r[n];a&&a.name&&(t[a.name]=a)}},m.extendObjectWithContainers=function(e,t,r){var n,a,i,o,l,c,u,f=s.extendDeepNoArrays({},t||{}),d=s.expandObjectPaths(f),p={};if(r&&r.length)for(i=0;i<r.length;i++)void 0===(a=(n=s.nestedProperty(d,r[i])).get())?s.nestedProperty(p,r[i]).set(null):(n.set(null),s.nestedProperty(p,r[i]).set(a));if(e=s.extendDeepNoArrays(e||{},d),r&&r.length)for(i=0;i<r.length;i++)if(c=s.nestedProperty(p,r[i]).get()){for(u=(l=s.nestedProperty(e,r[i])).get(),Array.isArray(u)||(u=[],l.set(u)),o=0;o<c.length;o++){var h=c[o];u[o]=null===h?null:m.extendObjectWithContainers(u[o],h)}l.set(u)}return e},m.dataArrayContainers=["transforms","dimensions"],m.layoutArrayContainers=i.layoutArrayContainers,m.extendTrace=function(e,t){return m.extendObjectWithContainers(e,t,m.dataArrayContainers)},m.extendLayout=function(e,t){return m.extendObjectWithContainers(e,t,m.layoutArrayContainers)},m.transition=function(e,t,r,n,a,i){var o={redraw:a.redraw},l={},c=[];return o.prepareFn=function(){for(var a=Array.isArray(t)?t.length:0,i=n.slice(0,a),o=0;o<i.length;o++){var u=i[o],f=e._fullData[u]._module;if(f){if(f.animatable){var d=f.basePlotModule.name;l[d]||(l[d]=[]),l[d].push(u)}e.data[i[o]]=m.extendTrace(e.data[i[o]],t[o])}}var p=s.expandObjectPaths(s.extendDeepNoArrays({},r)),h=/^[xy]axis[0-9]*$/;for(var g in p)h.test(g)&&delete p[g].range;m.extendLayout(e.layout,p),delete e.calcdata,m.supplyDefaults(e),m.doCalcdata(e);var v=s.expandObjectPaths(r);if(v){var y=e._fullLayout._plots;for(var x in y){var b=y[x],_=b.xaxis,w=b.yaxis,k=_.range.slice(),T=w.range.slice(),M=null,A=null,L=null,S=null;Array.isArray(v[_._name+".range"])?M=v[_._name+".range"].slice():Array.isArray((v[_._name]||{}).range)&&(M=v[_._name].range.slice()),Array.isArray(v[w._name+".range"])?A=v[w._name+".range"].slice():Array.isArray((v[w._name]||{}).range)&&(A=v[w._name].range.slice()),k&&M&&(_.r2l(k[0])!==_.r2l(M[0])||_.r2l(k[1])!==_.r2l(M[1]))&&(L={xr0:k,xr1:M}),T&&A&&(w.r2l(T[0])!==w.r2l(A[0])||w.r2l(T[1])!==w.r2l(A[1]))&&(S={yr0:T,yr1:A}),(L||S)&&c.push(s.extendFlat({plotinfo:b},L,S))}}return Promise.resolve()},o.runFn=function(t){var n,a,o=e._fullLayout._basePlotModules,u=c.length;if(r)for(a=0;a<o.length;a++)o[a].transitionAxes&&o[a].transitionAxes(e,c,i,t);for(var f in u?((n=s.extendFlat({},i)).duration=0,delete l.cartesian):n=i,l){var d=l[f];e._fullData[d[0]]._module.basePlotModule.plot(e,d,n,t)}},S(e,i,o)},m.transitionFromReact=function(e,t,r,n){var a=e._fullLayout,i=a.transition,o={},l=[];return o.prepareFn=function(){var e=a._plots;for(var i in o.redraw=!1,"some"===t.anim&&(o.redraw=!0),"some"===r.anim&&(o.redraw=!0),e){var c=e[i],u=c.xaxis,f=c.yaxis,d=n[u._name].range.slice(),p=n[f._name].range.slice(),h=u.range.slice(),g=f.range.slice();u.setScale(),f.setScale();var v=null,m=null;u.r2l(d[0])===u.r2l(h[0])&&u.r2l(d[1])===u.r2l(h[1])||(v={xr0:d,xr1:h}),f.r2l(p[0])===f.r2l(g[0])&&f.r2l(p[1])===f.r2l(g[1])||(m={yr0:p,yr1:g}),(v||m)&&l.push(s.extendFlat({plotinfo:c},v,m))}return Promise.resolve()},o.runFn=function(r){for(var n,a,o,c=e._fullData,u=e._fullLayout._basePlotModules,f=[],d=0;d<c.length;d++)f.push(d);function p(){for(var t=0;t<u.length;t++)u[t].transitionAxes&&u[t].transitionAxes(e,l,n,r)}function h(){for(var t=0;t<u.length;t++)u[t].plot(e,o,a,r)}l.length&&t.anim?"traces first"===i.ordering?(n=s.extendFlat({},i,{duration:0}),o=f,a=i,setTimeout(p,i.duration),h()):(n=i,o=null,a=s.extendFlat({},i,{duration:0}),setTimeout(h,n.duration),p()):l.length?(n=i,p()):t.anim&&(o=f,a=i,h())},S(e,i,o)},m.doCalcdata=function(e,t){var r,n,a,l,c=f.list(e),d=e._fullData,p=e._fullLayout,h=new Array(d.length),g=(e.calcdata||[]).slice();for(e.calcdata=h,p._numBoxes=0,p._numViolins=0,p._violinScaleGroupStats={},e._hmpixcount=0,e._hmlumcount=0,p._piecolormap={},p._sunburstcolormap={},p._treemapcolormap={},p._funnelareacolormap={},a=0;a<d.length;a++)Array.isArray(t)&&-1===t.indexOf(a)&&(h[a]=g[a]);for(a=0;a<d.length;a++)(r=d[a])._arrayAttrs=o.findArrayAttributes(r),r._extremes={};var v=p._subplots.polar||[];for(a=0;a<v.length;a++)c.push(p[v[a]].radialaxis,p[v[a]].angularaxis);for(var m in p._colorAxes){var x=p[m];!1!==x.cauto&&(delete x.cmin,delete x.cmax)}var b=!1;function _(t){if(r=d[t],n=r._module,!0===r.visible&&r.transforms){if(n&&n.calc){var a=n.calc(e,r);a[0]&&a[0].t&&a[0].t._scene&&delete a[0].t._scene.dirty}for(l=0;l<r.transforms.length;l++){var i=r.transforms[l];(n=y[i.type])&&n.calcTransform&&(r._hasCalcTransform=!0,b=!0,n.calcTransform(e,r,i))}}}function w(t,a){if(r=d[t],!!(n=r._module).isContainer===a){var i=[];if(!0===r.visible&&0!==r._length){delete r._indexToPoints;var o=r.transforms||[];for(l=o.length-1;l>=0;l--)if(o[l].enabled){r._indexToPoints=o[l]._indexToPoints;break}n&&n.calc&&(i=n.calc(e,r))}Array.isArray(i)&&i[0]||(i=[{x:u,y:u}]),i[0].t||(i[0].t={}),i[0].trace=r,h[t]=i}}for(O(c,d,p),a=0;a<d.length;a++)w(a,!0);for(a=0;a<d.length;a++)_(a);for(b&&O(c,d,p),a=0;a<d.length;a++)w(a,!0);for(a=0;a<d.length;a++)w(a,!1);P(e);var k=function(e,t){var r,n,a,o,l,c=[];function u(e,r,n){var a=r._id.charAt(0);if("histogram2dcontour"===e){var i=r._counterAxes[0],o=f.getFromId(t,i),l="x"===a||"x"===i&&"category"===o.type,s="y"===a||"y"===i&&"category"===o.type;return function(e,t){return 0===e||0===t?-1:l&&e===n[t].length-1?-1:s&&t===n.length-1?-1:("y"===a?t:e)-1}}return function(e,t){return"y"===a?t:e}}var d={min:function(e){return s.aggNums(Math.min,null,e)},max:function(e){return s.aggNums(Math.max,null,e)},sum:function(e){return s.aggNums(function(e,t){return e+t},null,e)},total:function(e){return s.aggNums(function(e,t){return e+t},null,e)},mean:function(e){return s.mean(e)},median:function(e){return s.median(e)}};for(r=0;r<e.length;r++){var p=e[r];if("category"===p.type){var h=p.categoryorder.match(C);if(h){var g=h[1],v=h[2],m=[];for(n=0;n<p._categories.length;n++)m.push([p._categories[n],[]]);for(n=0;n<p._traceIndices.length;n++){var y=p._traceIndices[n],x=t._fullData[y],b=p._id.charAt(0);if(!0===x.visible){var _=x.type;i.traceIs(x,"histogram")&&(delete x._xautoBinFinished,delete x._yautoBinFinished);var w=t.calcdata[y];for(a=0;a<w.length;a++){var k,T,M,A=w[a];if("splom"===_){var L=x._axesDim[p._id];if("y"===b){var S=x._diag[L][0];S&&(p=t._fullLayout[f.id2name(S)])}var O=A.trace.dimensions[L].values;for(o=0;o<O.length;o++)for(k=O[o],T=p._categoriesMap[k],l=0;l<A.trace.dimensions.length;l++)if(l!==L){var P=A.trace.dimensions[l];m[T][1].push(P.values[o])}}else if("scattergl"===_){for(o=0;o<A.t.x.length;o++)"x"===b&&(k=A.t.x[o],T=k,M=A.t.y[o]),"y"===b&&(k=A.t.y[o],T=k,M=A.t.x[o]),m[T][1].push(M);A.t&&A.t._scene&&delete A.t._scene.dirty}else if(A.hasOwnProperty("z")){M=A.z;var D=u(x.type,p,M);for(o=0;o<M.length;o++)for(l=0;l<M[o].length;l++)(T=D(l,o))+1&&m[T][1].push(M[o][l])}else for("x"===b?(k=A.p+1?A.p:A.x,M=A.s||A.v||A.y):"y"===b&&(k=A.p+1?A.p:A.y,M=A.s||A.v||A.x),Array.isArray(M)||(M=[M]),o=0;o<M.length;o++)m[k][1].push(M[o])}}}p._categoriesValue=m;var z=[];for(n=0;n<m.length;n++)z.push([m[n][0],d[g](m[n][1])]);z.sort(function(e,t){return e[1]-t[1]}),p._categoriesAggregatedValue=z,p._initialCategories=z.map(function(e){return e[0]}),"descending"===v&&p._initialCategories.reverse(),c=c.concat(p.sortByInitialCategories())}}}return c}(c,e);if(k.length){for(p._numBoxes=0,p._numViolins=0,a=0;a<k.length;a++)w(k[a],!0);for(a=0;a<k.length;a++)w(k[a],!1);P(e)}i.getComponentMethod("fx","calc")(e),i.getComponentMethod("errorbars","calc")(e)};var C=/(total|sum|min|max|mean|median) (ascending|descending)/;function O(e,t,r){var n,a,i,o={};for(n=0;n<e.length;n++)i=(a=e[n])._id,a.clearCalc(),"multicategory"===a.type&&a.setupMultiCategory(t),o[a._id]=1;var l=r._axisMatchGroups||[];for(n=0;n<l.length;n++)for(i in l[n])o[i]||(a=r[f.id2name(i)]).clearCalc()}function P(e){var t,r,n,a=e._fullLayout,i=a._visibleModules,o={};for(r=0;r<i.length;r++){var l=i[r],c=l.crossTraceCalc;if(c){var u=l.basePlotModule.name;o[u]?s.pushUnique(o[u],c):o[u]=[c]}}for(n in o){var f=o[n],d=a._subplots[n];if(Array.isArray(d))for(t=0;t<d.length;t++){var p=d[t],h="cartesian"===n?a._plots[p]:a[p];for(r=0;r<f.length;r++)f[r](e,h,p)}else for(r=0;r<f.length;r++)f[r](e)}}m.rehover=function(e){e._fullLayout._rehover&&e._fullLayout._rehover()},m.redrag=function(e){e._fullLayout._redrag&&e._fullLayout._redrag()},m.generalUpdatePerTraceModule=function(e,t,r,n){var a,i=t.traceHash,o={};for(a=0;a<r.length;a++){var l=r[a],c=l[0].trace;c.visible&&(o[c.type]=o[c.type]||[],o[c.type].push(l))}for(var u in i)if(!o[u]){var f=i[u][0];f[0].trace.visible=!1,o[u]=[f]}for(var d in o){var p=o[d];p[0][0].trace._module.plot(e,t,s.filterVisible(p),n)}t.traceHash=o},m.plotBasePlot=function(e,t,r,n,a){var o=i.getModule(e),l=h(t.calcdata,o)[0];o.plot(t,l,n,a)},m.cleanBasePlot=function(e,t,r,n,a){var i=a._has&&a._has(e),o=r._has&&r._has(e);i&&!o&&a["_"+e+"layer"].selectAll("g.trace").remove()}},{"../components/color":30,"../constants/numerical":128,"../lib":148,"../plot_api/plot_schema":181,"../plot_api/plot_template":182,"../plots/get_data":220,"../registry":232,"./animation_attributes":187,"./attributes":189,"./cartesian/axis_ids":195,"./command":216,"./font_attributes":218,"./frame_attributes":219,"./layout_attributes":222,d3:2,"fast-isnumeric":4}],225:[function(e,t,r){"use strict";var n=e("../../../traces/scatter/attributes"),a=n.marker,i=e("../../../lib/extend").extendFlat;["Area traces are deprecated!","Please switch to the *barpolar* trace type."].join(" ");t.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":143,"../../../traces/scatter/attributes":244}],226:[function(e,t,r){"use strict";var n=e("../../cartesian/layout_attributes"),a=e("../../../lib/extend").extendFlat,i=e("../../../plot_api/edit_types").overrideAll,o=["Legacy polar charts are deprecated!","Please switch to *polar* subplots."].join(" "),l=a({},n.domain,{});function s(e,t){return a({},t,{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"}})}t.exports=i({radialaxis:s(0,{range:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},domain:l,orientation:{valType:"number"}}),angularaxis:s(0,{range:{valType:"info_array",items:[{valType:"number",dflt:0},{valType:"number",dflt:360}]},domain:l}),layout:{direction:{valType:"enumerated",values:["clockwise","counterclockwise"]},orientation:{valType:"angle"}}},"plot","nested")},{"../../../lib/extend":143,"../../../plot_api/edit_types":175,"../../cartesian/layout_attributes":204}],227:[function(e,t,r){"use strict";(t.exports=e("./micropolar")).manager=e("./micropolar_manager")},{"./micropolar":228,"./micropolar_manager":229}],228:[function(e,t,r){var n=e("d3"),a=e("../../../lib").extendDeepAll,i=e("../../../constants/alignment").MID_SHIFT,o=t.exports={version:"0.2.2"};o.Axis=function(){var e,t,r,l,s={data:[],layout:{}},c={},u={},f=n.dispatch("hover"),d={};return d.render=function(c){return function(c){t=c||t;var f=s.data,d=s.layout;("string"==typeof t||t.nodeName)&&(t=n.select(t)),t.datum(f).each(function(t,s){var c=t.slice();u={data:o.util.cloneJson(c),layout:o.util.cloneJson(d)};var f=0;c.forEach(function(e,t){e.color||(e.color=d.defaultColorRange[f],f=(f+1)%d.defaultColorRange.length),e.strokeColor||(e.strokeColor="LinePlot"===e.geometry?e.color:n.rgb(e.color).darker().toString()),u.data[t].color=e.color,u.data[t].strokeColor=e.strokeColor,u.data[t].strokeDash=e.strokeDash,u.data[t].strokeSize=e.strokeSize});var p=c.filter(function(e,t){var r=e.visible;return void 0===r||!0===r}),h=!1,g=p.map(function(e,t){return h=h||void 0!==e.groupId,e});if(h){var v=[],m=n.nest().key(function(e,t){return void 0!==e.groupId?e.groupId:"unstacked"}).entries(g).map(function(e,t){if("unstacked"===e.key)return e.values;var r=e.values[0].r.map(function(e,t){return 0});return e.values.forEach(function(e,t,n){e.yStack=[r],v.push(r),r=o.util.sumArrays(e.r,r)}),e.values});p=n.merge(m)}p.forEach(function(e,t){e.t=Array.isArray(e.t[0])?e.t:[e.t],e.r=Array.isArray(e.r[0])?e.r:[e.r]});var y=Math.min(d.width-d.margin.left-d.margin.right,d.height-d.margin.top-d.margin.bottom)/2;y=Math.max(10,y);var x,b=[d.margin.left+y,d.margin.top+y];x=h?[0,n.max(o.util.sumArrays(o.util.arrayLast(p).r[0],o.util.arrayLast(v)))]:n.extent(o.util.flattenArray(p.map(function(e,t){return e.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,y]),u.layout.radialAxis.domain=r.domain();var _,w=o.util.flattenArray(p.map(function(e,t){return e.t})),k="string"==typeof w[0];k&&(w=o.util.deduplicate(w),_=w.slice(),w=n.range(w.length),p=p.map(function(e,t){var r=e;return e.t=[w],h&&(r.yStack=e.yStack),r}));var T=p.filter(function(e,t){return"LinePlot"===e.geometry||"DotPlot"===e.geometry}).length===p.length,M=null===d.needsEndSpacing?k||!T:d.needsEndSpacing,A=d.angularAxis.domain&&d.angularAxis.domain!=o.DATAEXTENT&&!k&&d.angularAxis.domain[0]>=0?d.angularAxis.domain:n.extent(w),L=Math.abs(w[1]-w[0]);T&&!k&&(L=0);var S=A.slice();M&&k&&(S[1]+=L);var C=d.angularAxis.ticksCount||4;C>8&&(C=C/(C/8)+C%8),d.angularAxis.ticksStep&&(C=(S[1]-S[0])/C);var O=d.angularAxis.ticksStep||(S[1]-S[0])/(C*(d.minorTicks+1));_&&(O=Math.max(Math.round(O),1)),S[2]||(S[2]=O);var P=n.range.apply(this,S);if(P=P.map(function(e,t){return parseFloat(e.toPrecision(12))}),l=n.scale.linear().domain(S.slice(0,2)).range("clockwise"===d.direction?[0,360]:[360,0]),u.layout.angularAxis.domain=l.domain(),u.layout.angularAxis.endPadding=M?L:0,void 0===(e=n.select(this).select("svg.chart-root"))||e.empty()){var D=(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"),z=this.appendChild(this.ownerDocument.importNode(D.documentElement,!0));e=n.select(z)}e.select(".guides-group").style({"pointer-events":"none"}),e.select(".angular.axis-group").style({"pointer-events":"none"}),e.select(".radial.axis-group").style({"pointer-events":"none"});var R,E=e.select(".chart-group"),I={fill:"none",stroke:d.tickColor},F={"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(e,t){return" "+e+" 0 "+d.font.outlineColor}).join(",")};if(d.showLegend){R=e.select(".legend-group").attr({transform:"translate("+[y,d.margin.top]+")"}).style({display:"block"});var N=p.map(function(e,t){var r=o.util.cloneJson(e);return r.symbol="DotPlot"===e.geometry?e.dotType||"circle":"LinePlot"!=e.geometry?"square":"line",r.visibleInLegend=void 0===e.visibleInLegend||e.visibleInLegend,r.color="LinePlot"===e.geometry?e.strokeColor:e.color,r});o.Legend().config({data:p.map(function(e,t){return e.name||"Element"+t}),legendConfig:a({},o.Legend.defaultConfig().legendConfig,{container:R,elements:N,reverseOrder:d.legend.reverseOrder})})();var j=R.node().getBBox();y=Math.min(d.width-j.width-d.margin.left-d.margin.right,d.height-d.margin.top-d.margin.bottom)/2,y=Math.max(10,y),b=[d.margin.left+y,d.margin.top+y],r.range([0,y]),u.layout.radialAxis.domain=r.domain(),R.attr("transform","translate("+[b[0]+y,b[1]-y]+")")}else R=e.select(".legend-group").style({display:"none"});e.attr({width:d.width,height:d.height}).style({opacity:d.opacity}),E.attr("transform","translate("+b+")").style({cursor:"crosshair"});var B=[(d.width-(d.margin.left+d.margin.right+2*y+(j?j.width:0)))/2,(d.height-(d.margin.top+d.margin.bottom+2*y))/2];if(B[0]=Math.max(0,B[0]),B[1]=Math.max(0,B[1]),e.select(".outer-group").attr("transform","translate("+B+")"),d.title&&d.title.text){var H=e.select("g.title-group text").style(F).text(d.title.text),q=H.node().getBBox();H.attr({x:b[0]-q.width/2,y:b[1]-y-20})}var V=e.select(".radial.axis-group");if(d.radialAxis.gridLinesVisible){var U=V.selectAll("circle.grid-circle").data(r.ticks(5));U.enter().append("circle").attr({class:"grid-circle"}).style(I),U.attr("r",r),U.exit().remove()}V.select("circle.outside-circle").attr({r:y}).style(I);var G=e.select("circle.background-circle").attr({r:y}).style({fill:d.backgroundColor,stroke:d.stroke});function Z(e,t){return l(e)%360+d.orientation}if(d.radialAxis.visible){var Y=n.svg.axis().scale(r).ticks(5).tickSize(5);V.call(Y).attr({transform:"rotate("+d.radialAxis.orientation+")"}),V.selectAll(".domain").style(I),V.selectAll("g>text").text(function(e,t){return this.textContent+d.radialAxis.ticksSuffix}).style(F).style({"text-anchor":"start"}).attr({x:0,y:0,dx:0,dy:0,transform:function(e,t){return"horizontal"===d.radialAxis.tickOrientation?"rotate("+-d.radialAxis.orientation+") translate("+[0,F["font-size"]]+")":"translate("+[0,F["font-size"]]+")"}}),V.selectAll("g>line").style({stroke:"black"})}var X=e.select(".angular.axis-group").selectAll("g.angular-tick").data(P),W=X.enter().append("g").classed("angular-tick",!0);X.attr({transform:function(e,t){return"rotate("+Z(e)+")"}}).style({display:d.angularAxis.visible?"block":"none"}),X.exit().remove(),W.append("line").classed("grid-line",!0).classed("major",function(e,t){return t%(d.minorTicks+1)==0}).classed("minor",function(e,t){return!(t%(d.minorTicks+1)==0)}).style(I),W.selectAll(".minor").style({stroke:d.minorTickColor}),X.select("line.grid-line").attr({x1:d.tickLength?y-d.tickLength:0,x2:y}).style({display:d.angularAxis.gridLinesVisible?"block":"none"}),W.append("text").classed("axis-text",!0).style(F);var $=X.select("text.axis-text").attr({x:y+d.labelOffset,dy:i+"em",transform:function(e,t){var r=Z(e),n=y+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(e,t){return t%(d.minorTicks+1)!=0?"":_?_[e]+d.angularAxis.ticksSuffix:e+d.angularAxis.ticksSuffix}).style(F);d.angularAxis.rewriteTicks&&$.text(function(e,t){return t%(d.minorTicks+1)!=0?"":d.angularAxis.rewriteTicks(this.textContent,t)});var J=n.max(E.selectAll(".angular-tick text")[0].map(function(e,t){return e.getCTM().e+e.getBBox().width}));R.attr({transform:"translate("+[y+J,d.margin.top]+")"});var Q=e.select("g.geometry-group").selectAll("g").size()>0,K=e.select("g.geometry-group").selectAll("g.geometry").data(p);if(K.enter().append("g").attr({class:function(e,t){return"geometry geometry"+t}}),K.exit().remove(),p[0]||Q){var ee=[];p.forEach(function(e,t){var n={};n.radialScale=r,n.angularScale=l,n.container=K.filter(function(e,r){return r==t}),n.geometry=e.geometry,n.orientation=d.orientation,n.direction=d.direction,n.index=t,ee.push({data:e,geometryConfig:n})});var te=[];n.nest().key(function(e,t){return void 0!==e.data.groupId||"unstacked"}).entries(ee).forEach(function(e,t){"unstacked"===e.key?te=te.concat(e.values.map(function(e,t){return[e]})):te.push(e.values)}),te.forEach(function(e,t){var r;r=Array.isArray(e)?e[0].geometryConfig.geometry:e.geometryConfig.geometry;var n=e.map(function(e,t){return a(o[r].defaultConfig(),e)});o[r]().config(n)()})}var re,ne,ae=e.select(".guides-group"),ie=e.select(".tooltips-group"),oe=o.tooltipPanel().config({container:ie,fontSize:8})(),le=o.tooltipPanel().config({container:ie,fontSize:8})(),se=o.tooltipPanel().config({container:ie,hasTick:!0})();if(!k){var ce=ae.select("line").attr({x1:0,y1:0,y2:0}).style({stroke:"grey","pointer-events":"none"});E.on("mousemove.angular-guide",function(e,t){var r=o.util.getMousePos(G).angle;ce.attr({x2:-y,transform:"rotate("+r+")"}).style({opacity:.5});var n=(r+180+360-d.orientation)%360;re=l.invert(n);var a=o.util.convertToCartesian(y+12,r+180);oe.text(o.util.round(re)).move([a[0]+b[0],a[1]+b[1]])}).on("mouseout.angular-guide",function(e,t){ae.select("line").style({opacity:0})})}var ue=ae.select("circle").style({stroke:"grey",fill:"none"});E.on("mousemove.radial-guide",function(e,t){var n=o.util.getMousePos(G).radius;ue.attr({r:n}).style({opacity:.5}),ne=r.invert(o.util.getMousePos(G).radius);var a=o.util.convertToCartesian(n,d.radialAxis.orientation);le.text(o.util.round(ne)).move([a[0]+b[0],a[1]+b[1]])}).on("mouseout.radial-guide",function(e,t){ue.style({opacity:0}),se.hide(),oe.hide(),le.hide()}),e.selectAll(".geometry-group .mark").on("mouseover.tooltip",function(t,r){var a=n.select(this),i=this.style.fill,l="black",s=this.style.opacity||1;if(a.attr({"data-opacity":s}),i&&"none"!==i){a.attr({"data-fill":i}),l=n.hsl(i).darker().toString(),a.style({fill:l,opacity:1});var c={t:o.util.round(t[0]),r:o.util.round(t[1])};k&&(c.t=_[t[0]]);var u="t: "+c.t+", r: "+c.r,f=this.getBoundingClientRect(),d=e.node().getBoundingClientRect(),p=[f.left+f.width/2-B[0]-d.left,f.top+f.height/2-B[1]-d.top];se.config({color:l}).text(u),se.move(p)}else i=this.style.stroke||"black",a.attr({"data-stroke":i}),l=n.hsl(i).darker().toString(),a.style({stroke:l,opacity:1})}).on("mousemove.tooltip",function(e,t){if(0!=n.event.which)return!1;n.select(this).attr("data-fill")&&se.show()}).on("mouseout.tooltip",function(e,t){se.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")})})})}(c),this},d.config=function(e){if(!arguments.length)return s;var t=o.util.cloneJson(e);return t.data.forEach(function(e,t){s.data[t]||(s.data[t]={}),a(s.data[t],o.Axis.defaultConfig().data[0]),a(s.data[t],e)}),a(s.layout,o.Axis.defaultConfig().layout),a(s.layout,t.layout),this},d.getLiveConfig=function(){return u},d.getinputConfig=function(){return c},d.radialScale=function(e){return r},d.angularScale=function(e){return l},d.svg=function(){return e},n.rebind(d,f,"on"),d},o.Axis.defaultConfig=function(e,t){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(e,t){for(var r in e)r in t&&(t[r]=e[r])},o.util._extend=function(e,t){for(var r in e)t[r]=e[r]},o.util._rndSnd=function(){return 2*Math.random()-1+(2*Math.random()-1)+(2*Math.random()-1)},o.util.dataFromEquation2=function(e,t){var r=t||6;return n.range(0,360+r,r).map(function(t,r){var n=t*Math.PI/180;return[t,e(n)]})},o.util.dataFromEquation=function(e,t,r){var a=t||6,i=[],o=[];n.range(0,360+a,a).forEach(function(t,r){var n=t*Math.PI/180,a=e(n);i.push(t),o.push(a)});var l={t:i,r:o};return r&&(l.name=r),l},o.util.ensureArray=function(e,t){if(void 0===e)return null;var r=[].concat(e);return n.range(t).map(function(e,t){return r[t]||r[0]})},o.util.fillArrays=function(e,t,r){return t.forEach(function(t,n){e[t]=o.util.ensureArray(e[t],r)}),e},o.util.cloneJson=function(e){return JSON.parse(JSON.stringify(e))},o.util.validateKeys=function(e,t){"string"==typeof t&&(t=t.split("."));var r=t.shift();return e[r]&&(!t.length||objHasKeys(e[r],t))},o.util.sumArrays=function(e,t){return n.zip(e,t).map(function(e,t){return n.sum(e)})},o.util.arrayLast=function(e){return e[e.length-1]},o.util.arrayEqual=function(e,t){for(var r=Math.max(e.length,t.length,1);r-- >=0&&e[r]===t[r];);return-2===r},o.util.flattenArray=function(e){for(var t=[];!o.util.arrayEqual(t,e);)t=e,e=[].concat.apply([],e);return e},o.util.deduplicate=function(e){return e.filter(function(e,t,r){return r.indexOf(e)==t})},o.util.convertToCartesian=function(e,t){var r=t*Math.PI/180;return[e*Math.cos(r),e*Math.sin(r)]},o.util.round=function(e,t){var r=t||2,n=Math.pow(10,r);return Math.round(e*n)/n},o.util.getMousePos=function(e){var t=n.mouse(e.node()),r=t[0],a=t[1],i={};return i.x=r,i.y=a,i.pos=t,i.angle=180*(Math.atan2(a,r)+Math.PI)/Math.PI,i.radius=Math.sqrt(r*r+a*a),i},o.util.duplicatesCount=function(e){for(var t,r={},n={},a=0,i=e.length;a<i;a++)(t=e[a])in r?(r[t]++,n[t]=r[t]):r[t]=1;return n},o.util.duplicates=function(e){return Object.keys(o.util.duplicatesCount(e))},o.util.translator=function(e,t,r,n){if(n){var a=r.slice();r=t,t=a}var i=t.reduce(function(e,t){if(void 0!==e)return e[t]},e);void 0!==i&&(t.reduce(function(e,r,n){if(void 0!==e)return n===t.length-1&&delete e[r],e[r]},e),r.reduce(function(e,t,n){return void 0===e[t]&&(e[t]={}),n===r.length-1&&(e[t]=i),e[t]},e))},o.PolyChart=function(){var e=[o.PolyChart.defaultConfig()],t=n.dispatch("hover"),r={solid:"none",dash:[5,2],dot:[2,5]};function i(){var t=e[0].geometryConfig,a=t.container;"string"==typeof a&&(a=n.select(a)),a.datum(e).each(function(e,a){var i=!!e[0].data.yStack,o=e.map(function(e,t){return i?n.zip(e.data.t[0],e.data.r[0],e.data.yStack[0]):n.zip(e.data.t[0],e.data.r[0])}),l=t.angularScale,s=t.radialScale.domain()[0],c={bar:function(r,a,i){var o=e[i].data,s=t.radialScale(r[1])-t.radialScale(0),c=t.radialScale(r[2]||0),u=o.barWidth;n.select(this).attr({class:"mark bar",d:"M"+[[s+c,-u/2],[s+c,u/2],[c,u/2],[c,-u/2]].join("L")+"Z",transform:function(e,r){return"rotate("+(t.orientation+l(e[0]))+")"}})}};c.dot=function(r,a,i){var o=r[2]?[r[0],r[1]+r[2]]:r,l=n.svg.symbol().size(e[i].data.dotSize).type(e[i].data.dotType)(r,a);n.select(this).attr({class:"mark dot",d:l,transform:function(e,r){var n,a,i,l=(n=function(e,r){var n=t.radialScale(e[1]),a=(t.angularScale(e[0])+t.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("+[l.x,l.y]+")"}})};var u=n.svg.line.radial().interpolate(e[0].data.lineInterpolation).radius(function(e){return t.radialScale(e[1])}).angle(function(e){return t.angularScale(e[0])*Math.PI/180});c.line=function(r,a,i){var l=r[2]?o[i].map(function(e,t){return[e[0],e[1]+e[2]]}):o[i];if(n.select(this).each(c.dot).style({opacity:function(t,r){return+e[i].data.dotVisible},fill:h.stroke(r,a,i)}).attr({class:"mark dot"}),!(a>0)){var s=n.select(this.parentNode).selectAll("path.line").data([0]);s.enter().insert("path"),s.attr({class:"line",d:u(l),transform:function(e,r){return"rotate("+(t.orientation+90)+")"},"pointer-events":"none"}).style({fill:function(e,t){return h.fill(r,a,i)},"fill-opacity":0,stroke:function(e,t){return h.stroke(r,a,i)},"stroke-width":function(e,t){return h["stroke-width"](r,a,i)},"stroke-dasharray":function(e,t){return h["stroke-dasharray"](r,a,i)},opacity:function(e,t){return h.opacity(r,a,i)},display:function(e,t){return h.display(r,a,i)}})}};var f=t.angularScale.range(),d=Math.abs(f[1]-f[0])/o[0].length*Math.PI/180,p=n.svg.arc().startAngle(function(e){return-d/2}).endAngle(function(e){return d/2}).innerRadius(function(e){return t.radialScale(s+(e[2]||0))}).outerRadius(function(e){return t.radialScale(s+(e[2]||0))+t.radialScale(e[1])});c.arc=function(e,r,a){n.select(this).attr({class:"mark arc",d:p,transform:function(e,r){return"rotate("+(t.orientation+l(e[0])+90)+")"}})};var h={fill:function(t,r,n){return e[n].data.color},stroke:function(t,r,n){return e[n].data.strokeColor},"stroke-width":function(t,r,n){return e[n].data.strokeSize+"px"},"stroke-dasharray":function(t,n,a){return r[e[a].data.strokeDash]},opacity:function(t,r,n){return e[n].data.opacity},display:function(t,r,n){return void 0===e[n].data.visible||e[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(e,t){return e});v.enter().append("path").attr({class:"mark"}),v.style(h).each(c[t.geometryType]),v.exit().remove(),g.exit().remove()})}return i.config=function(t){return arguments.length?(t.forEach(function(t,r){e[r]||(e[r]={}),a(e[r],o.PolyChart.defaultConfig()),a(e[r],t)}),this):e},i.getColorScale=function(){},n.rebind(i,t,"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 e=o.Legend.defaultConfig(),t=n.dispatch("hover");function r(){var t=e.legendConfig,i=e.data.map(function(e,r){return[].concat(e).map(function(e,n){var i=a({},t.elements[r]);return i.name=e,i.color=[].concat(t.elements[r].color)[n],i})}),o=n.merge(i);o=o.filter(function(e,r){return t.elements[r]&&(t.elements[r].visibleInLegend||void 0===t.elements[r].visibleInLegend)}),t.reverseOrder&&(o=o.reverse());var l=t.container;("string"==typeof l||l.nodeName)&&(l=n.select(l));var s=o.map(function(e,t){return e.color}),c=t.fontSize,u=null==t.isContinuous?"number"==typeof o[0]:t.isContinuous,f=u?t.height:c*o.length,d=l.classed("legend-group",!0).selectAll("svg").data([0]),p=d.enter().append("svg").attr({width:300,height:f+c,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"});p.append("g").classed("legend-axis",!0),p.append("g").classed("legend-marks",!0);var h=n.range(o.length),g=n.scale[u?"linear":"ordinal"]().domain(h).range(s),v=n.scale[u?"linear":"ordinal"]().domain(h)[u?"range":"rangePoints"]([0,f]);if(u){var m=d.select(".legend-marks").append("defs").append("linearGradient").attr({id:"grad1",x1:"0%",y1:"0%",x2:"0%",y2:"100%"}).selectAll("stop").data(s);m.enter().append("stop"),m.attr({offset:function(e,t){return t/(s.length-1)*100+"%"}}).style({"stop-color":function(e,t){return e}}),d.append("rect").classed("legend-mark",!0).attr({height:t.height,width:t.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(e,t){return"translate("+[c/2,v(t)+c/2]+")"},d:function(e,t){var r,a,i,o=e.symbol;return i=3*(a=c),"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(e,t){return g(t)}}),y.exit().remove()}var x=n.svg.axis().scale(v).orient("right"),b=d.select("g.legend-axis").attr({transform:"translate("+[u?t.colorBandWidth:c,c/2]+")"}).call(x);return b.selectAll(".domain").style({fill:"none",stroke:"none"}),b.selectAll("line").style({fill:"none",stroke:u?t.textColor:"none"}),b.selectAll("text").style({fill:t.textColor,"font-size":t.fontSize}).text(function(e,t){return o[t].name}),r}return r.config=function(t){return arguments.length?(a(e,t),this):e},n.rebind(r,t,"on"),r},o.Legend.defaultConfig=function(e,t){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 e,t,r,i={container:null,hasTick:!1,fontSize:12,color:"white",padding:5},l="tooltip-"+o.tooltipPanel.uid++,s=10,c=function(){var n=(e=i.container.selectAll("g."+l).data([0])).enter().append("g").classed(l,!0).style({"pointer-events":"none",display:"none"});return r=n.append("path").style({fill:"white","fill-opacity":.9}).attr({d:"M0 0"}),t=n.append("text").attr({dx:i.padding+s,dy:.3*+i.fontSize}),c};return c.text=function(a){var o=n.hsl(i.color).l,l=o>=.5?"#aaa":"white",u=o>=.5?"black":"white",f=a||"";t.style({fill:u,"font-size":i.fontSize+"px"}).text(f);var d=i.padding,p=t.node().getBBox(),h={fill:i.color,stroke:l,"stroke-width":"2px"},g=p.width+2*d+s,v=p.height+2*d;return r.attr({d:"M"+[[s,-v/2],[s,-v/4],[i.hasTick?0:s,0],[s,v/4],[s,v/2],[g,v/2],[g,-v/2]].join("L")+"Z"}).style(h),e.attr({transform:"translate("+[s,-v/2+2*d]+")"}),e.style({display:"block"}),c},c.move=function(t){if(e)return e.attr({transform:"translate("+[t[0],t[1]]+")"}).style({display:"block"}),c},c.hide=function(){if(e)return e.style({display:"none"}),c},c.show=function(){if(e)return e.style({display:"block"}),c},c.config=function(e){return a(i,e),c},c},o.tooltipPanel.uid=1,o.adapter={},o.adapter.plotly=function(){var e={convert:function(e,t){var r={};if(e.data&&(r.data=e.data.map(function(e,r){var n=a({},e);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(e,r){o.util.translator.apply(null,e.concat(t))}),t||delete n.marker,t&&delete n.groupId,t?("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}),!t&&e.layout&&"stack"===e.layout.barmode)){var i=o.util.duplicates(r.data.map(function(e,t){return e.geometry}));r.data.forEach(function(e,t){var n=i.indexOf(e.geometry);-1!=n&&(r.data[t].groupId=n)})}if(e.layout){var l=a({},e.layout);if([[l,["plot_bgcolor"],["backgroundColor"]],[l,["showlegend"],["showLegend"]],[l,["radialaxis"],["radialAxis"]],[l,["angularaxis"],["angularAxis"]],[l.angularaxis,["showline"],["gridLinesVisible"]],[l.angularaxis,["showticklabels"],["labelsVisible"]],[l.angularaxis,["nticks"],["ticksCount"]],[l.angularaxis,["tickorientation"],["tickOrientation"]],[l.angularaxis,["ticksuffix"],["ticksSuffix"]],[l.angularaxis,["range"],["domain"]],[l.angularaxis,["endpadding"],["endPadding"]],[l.radialaxis,["showline"],["gridLinesVisible"]],[l.radialaxis,["tickorientation"],["tickOrientation"]],[l.radialaxis,["ticksuffix"],["ticksSuffix"]],[l.radialaxis,["range"],["domain"]],[l.angularAxis,["showline"],["gridLinesVisible"]],[l.angularAxis,["showticklabels"],["labelsVisible"]],[l.angularAxis,["nticks"],["ticksCount"]],[l.angularAxis,["tickorientation"],["tickOrientation"]],[l.angularAxis,["ticksuffix"],["ticksSuffix"]],[l.angularAxis,["range"],["domain"]],[l.angularAxis,["endpadding"],["endPadding"]],[l.radialAxis,["showline"],["gridLinesVisible"]],[l.radialAxis,["tickorientation"],["tickOrientation"]],[l.radialAxis,["ticksuffix"],["ticksSuffix"]],[l.radialAxis,["range"],["domain"]],[l.font,["outlinecolor"],["outlineColor"]],[l.legend,["traceorder"],["reverseOrder"]],[l,["labeloffset"],["labelOffset"]],[l,["defaultcolorrange"],["defaultColorRange"]]].forEach(function(e,r){o.util.translator.apply(null,e.concat(t))}),t?(void 0!==l.tickLength&&(l.angularaxis.ticklen=l.tickLength,delete l.tickLength),l.tickColor&&(l.angularaxis.tickcolor=l.tickColor,delete l.tickColor)):(l.angularAxis&&void 0!==l.angularAxis.ticklen&&(l.tickLength=l.angularAxis.ticklen),l.angularAxis&&void 0!==l.angularAxis.tickcolor&&(l.tickColor=l.angularAxis.tickcolor)),l.legend&&"boolean"!=typeof l.legend.reverseOrder&&(l.legend.reverseOrder="normal"!=l.legend.reverseOrder),l.legend&&"boolean"==typeof l.legend.traceorder&&(l.legend.traceorder=l.legend.traceorder?"reversed":"normal",delete l.legend.reverseOrder),l.margin&&void 0!==l.margin.t){var s=["t","r","b","l","pad"],c=["top","right","bottom","left","pad"],u={};n.entries(l.margin).forEach(function(e,t){u[c[s.indexOf(e.key)]]=e.value}),l.margin=u}t&&(delete l.needsEndSpacing,delete l.minorTickColor,delete l.minorTicks,delete l.angularaxis.ticksCount,delete l.angularaxis.ticksCount,delete l.angularaxis.ticksStep,delete l.angularaxis.rewriteTicks,delete l.angularaxis.nticks,delete l.radialaxis.ticksCount,delete l.radialaxis.ticksCount,delete l.radialaxis.ticksStep,delete l.radialaxis.rewriteTicks,delete l.radialaxis.nticks),r.layout=l}return r}};return e}},{"../../../constants/alignment":125,"../../../lib":148,d3:2}],229:[function(e,t,r){"use strict";var n=e("d3"),a=e("../../../lib"),i=e("../../../components/color"),o=e("./micropolar"),l=e("./undo_manager"),s=a.extendDeepAll,c=t.exports={};c.framework=function(e){var t,r,a,i,u,f=new l;function d(r,l){return l&&(u=l),n.select(n.select(u).node().parentNode).selectAll(".svg-container>*:not(.chart-root)").remove(),t=t?s(t,r):r,a||(a=o.Axis()),i=o.adapter.plotly().convert(t),a.config(i).render(u),e.data=t.data,e.layout=t.layout,c.fillLayout(e),t}return d.isPolar=!0,d.svg=function(){return a.svg()},d.getConfig=function(){return t},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 e,n,a=this,i=o.util.cloneJson(t);e=i,n=r,f.add({undo:function(){n&&a(n)},redo:function(){a(e)}}),r=o.util.cloneJson(i)},d.undo=function(){f.undo()},d.redo=function(){f.redo()},d},c.fillLayout=function(e){var t=n.select(e).selectAll(".plot-container"),r=t.selectAll(".svg-container"),a=e.framework&&e.framework.svg&&e.framework.svg(),o={width:800,height:600,paper_bgcolor:i.background,_container:t,_paperdiv:r,_paper:a};e._fullLayout=s(o,e.layout)}},{"../../../components/color":30,"../../../lib":148,"./micropolar":228,"./undo_manager":230,d3:2}],230:[function(e,t,r){"use strict";t.exports=function(){var e,t=[],r=-1,n=!1;function a(e,t){return e?(n=!0,e[t](),n=!1,this):this}return{add:function(e){return n?this:(t.splice(r+1,t.length-r),t.push(e),r=t.length-1,this)},setCallback:function(t){e=t},undo:function(){var n=t[r];return n?(a(n,"undo"),r-=1,e&&e(n.undo),this):this},redo:function(){var n=t[r+1];return n?(a(n,"redo"),r+=1,e&&e(n.redo),this):this},clear:function(){t=[],r=-1},hasUndo:function(){return-1!==r},hasRedo:function(){return r<t.length-1},getCommands:function(){return t},getPreviousCommand:function(){return t[r-1]},getIndex:function(){return r}}}},{}],231:[function(e,t,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}".',e("../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}".',e("../constants/docs").DATE_FORMAT_LINK,"for details on the date formatting syntax."].join(" ");function n(e){var t=e.description?" "+e.description:"",r=e.keys||[];if(r.length>0){for(var n=[],a=0;a<r.length;a++)n[a]="`"+r[a]+"`";t+="Finally, the template string has access to ",t=1===r.length?"variable "+n[0]:"variables "+n.slice(0,-1).join(", ")+" and "+n.slice(-1)+"."}return t}r.hovertemplateAttrs=function(e,t){e=e||{};n(t=t||{});var r={valType:"string",dflt:"",editType:e.editType||"none"};return!1!==e.arrayOk&&(r.arrayOk=!0),r},r.texttemplateAttrs=function(e,t){e=e||{};n(t=t||{});var r={valType:"string",dflt:"",editType:e.editType||"calc"};return!1!==e.arrayOk&&(r.arrayOk=!0),r}},{"../constants/docs":126}],232:[function(e,t,r){"use strict";var n=e("./lib/loggers"),a=e("./lib/noop"),i=e("./lib/push_unique"),o=e("./lib/is_plain_object"),l=e("./lib/dom").addStyleRule,s=e("./lib/extend"),c=e("./plots/attributes"),u=e("./plots/layout_attributes"),f=s.extendFlat,d=s.extendDeepAll;function p(e){var t=e.name,a=e.categories,i=e.meta;if(r.modules[t])n.log("Type "+t+" already registered");else{r.subplotsRegistry[e.basePlotModule.name]||function(e){var t=e.name;if(r.subplotsRegistry[t])return void n.log("Plot type "+t+" already registered.");for(var a in m(e),r.subplotsRegistry[t]=e,r.componentsRegistry)b(a,e.name)}(e.basePlotModule);for(var o={},s=0;s<a.length;s++)o[a[s]]=!0,r.allCategories[a[s]]=!0;for(var c in r.modules[t]={_module:e,categories:o},i&&Object.keys(i).length&&(r.modules[t].meta=i),r.allTypes.push(t),r.componentsRegistry)y(c,t);e.layoutAttributes&&f(r.traceLayoutAttributes,e.layoutAttributes);var u=e.basePlotModule,d=u.name;if("mapbox"===d){var p=u.constants.styleRules;for(var h in p)l(".js-plotly-plot .plotly .mapboxgl-"+h,p[h])}"geo"!==d&&"mapbox"!==d||void 0===typeof window||void 0!==window.PlotlyGeoAssets||(window.PlotlyGeoAssets={topojson:{}})}}function h(e){if("string"!=typeof e.name)throw new Error("Component module *name* must be a string.");var t=e.name;for(var n in r.componentsRegistry[t]=e,e.layoutAttributes&&(e.layoutAttributes._isLinkedToArray&&i(r.layoutArrayContainers,t),m(e)),r.modules)y(t,n);for(var a in r.subplotsRegistry)b(t,a);for(var o in r.transformsRegistry)x(t,o);e.schema&&e.schema.layout&&d(u,e.schema.layout)}function g(e){if("string"!=typeof e.name)throw new Error("Transform module *name* must be a string.");var t="Transform module "+e.name,a="function"==typeof e.transform,i="function"==typeof e.calcTransform;if(!a&&!i)throw new Error(t+" is missing a *transform* or *calcTransform* method.");for(var l in a&&i&&n.log([t+" has both a *transform* and *calcTransform* methods.","Please note that all *transform* methods are executed","before all *calcTransform* methods."].join(" ")),o(e.attributes)||n.log(t+" registered without an *attributes* object."),"function"!=typeof e.supplyDefaults&&n.log(t+" registered without a *supplyDefaults* method."),r.transformsRegistry[e.name]=e,r.componentsRegistry)x(l,e.name)}function v(e){var t=e.name,n=t.split("-")[0],a=e.dictionary,i=e.format,o=a&&Object.keys(a).length,l=i&&Object.keys(i).length,s=r.localeRegistry,c=s[t];if(c||(s[t]=c={}),n!==t){var u=s[n];u||(s[n]=u={}),o&&u.dictionary===c.dictionary&&(u.dictionary=a),l&&u.format===c.format&&(u.format=i)}o&&(c.dictionary=a),l&&(c.format=i)}function m(e){if(e.layoutAttributes){var t=e.layoutAttributes._arrayAttrRegexps;if(t)for(var n=0;n<t.length;n++)i(r.layoutArrayRegexes,t[n])}}function y(e,t){var n=r.componentsRegistry[e].schema;if(n&&n.traces){var a=n.traces[t];a&&d(r.modules[t]._module.attributes,a)}}function x(e,t){var n=r.componentsRegistry[e].schema;if(n&&n.transforms){var a=n.transforms[t];a&&d(r.transformsRegistry[t].attributes,a)}}function b(e,t){var n=r.componentsRegistry[e].schema;if(n&&n.subplots){var a=r.subplotsRegistry[t],i=a.layoutAttributes,o="subplot"===a.attr?a.name:a.attr;Array.isArray(o)&&(o=o[0]);var l=n.subplots[o];i&&l&&d(i,l)}}function _(e){return"object"==typeof e&&(e=e.type),e}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(e){if(r.collectableSubplotTypes=null,!e)throw new Error("No argument passed to Plotly.register.");e&&!Array.isArray(e)&&(e=[e]);for(var t=0;t<e.length;t++){var n=e[t];if(!n)throw new Error("Invalid module was attempted to be registered!");switch(n.moduleType){case"trace":p(n);break;case"transform":g(n);break;case"component":h(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(e){var t=r.modules[_(e)];return!!t&&t._module},r.traceIs=function(e,t){if("various"===(e=_(e)))return!1;var a=r.modules[e];return a||(e&&"area"!==e&&n.log("Unrecognized trace type "+e+"."),a=r.modules[c.type.dflt]),!!a.categories[t]},r.getTransformIndices=function(e,t){for(var r=[],n=e.transforms||[],a=0;a<n.length;a++)n[a].type===t&&r.push(a);return r},r.hasTransform=function(e,t){for(var r=e.transforms||[],n=0;n<r.length;n++)if(r[n].type===t)return!0;return!1},r.getComponentMethod=function(e,t){var n=r.componentsRegistry[e];return n&&n[t]||a},r.call=function(){var e=arguments[0],t=[].slice.call(arguments,1);return r.apiMethodRegistry[e].apply(null,t)}},{"./lib/dom":141,"./lib/extend":143,"./lib/is_plain_object":149,"./lib/loggers":152,"./lib/noop":157,"./lib/push_unique":161,"./plots/attributes":189,"./plots/layout_attributes":222}],233:[function(e,t,r){"use strict";var n=e("../registry"),a=e("../lib"),i=a.extendFlat,o=a.extendDeep;function l(e){var t;switch(e){case"themes__thumb":t={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":t={title:{text:""},hidesources:!0,showlegend:!1,borderwidth:0,bordercolor:"",margin:{l:1,r:1,t:1,b:1,pad:0},annotations:[]};break;default:t={}}return t}t.exports=function(e,t){var r;e.framework&&e.framework.isPolar&&(e=e.framework.getConfig());var a,s=e.data,c=e.layout,u=o([],s),f=o({},c,l(t.tileClass)),d=e._context||{};if(t.width&&(f.width=t.width),t.height&&(f.height=t.height),"thumbnail"===t.tileClass||"themes__thumb"===t.tileClass){f.annotations=[];var p=Object.keys(f);for(r=0;r<p.length;r++)a=p[r],["xaxis","yaxis","zaxis"].indexOf(a.slice(0,5))>-1&&(f[p[r]].title={text:""});for(r=0;r<u.length;r++){var h=u[r];h.showscale=!1,h.marker&&(h.marker.showscale=!1),n.traceIs(h,"pie-like")&&(h.textposition="none")}}if(Array.isArray(t.annotations))for(r=0;r<t.annotations.length;r++)f.annotations.push(t.annotations[r]);var g=Object.keys(f).filter(function(e){return e.match(/^scene\d*$/)});if(g.length){var v={};for("thumbnail"===t.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");t.tileClass&&(y.className=t.tileClass);var x={gd:y,td:y,layout:f,data:u,config:{staticPlot:void 0===t.staticPlot||t.staticPlot,plotGlPixelRatio:void 0===t.plotGlPixelRatio?2:t.plotGlPixelRatio,displaylogo:t.displaylogo||!1,showLink:t.showLink||!1,showTips:t.showTips||!1,mapboxAccessToken:d.mapboxAccessToken}};return"transparent"!==t.setBackground&&(x.config.setBackground=t.setBackground||"opaque"),x.gd.defaultLayout=l(t.tileClass),x}},{"../lib":148,"../registry":232}],234:[function(e,t,r){"use strict";var n=e("../lib"),a=e("../plot_api/to_image"),i=e("./filesaver"),o=e("./helpers");t.exports=function(e,t){var r;return n.isPlainObject(e)||(r=n.getGraphDiv(e)),(t=t||{}).format=t.format||"png",t.imageDataOnly=!0,new Promise(function(l,s){r&&r._snapshotInProgress&&s(new Error("Snapshotting already in progress.")),n.isIE()&&"svg"!==t.format&&s(new Error(o.MSG_IE_BAD_FORMAT)),r&&(r._snapshotInProgress=!0);var c=a(e,t),u=t.filename||e.fn||"newplot";u+="."+t.format.replace("-","."),c.then(function(e){return r&&(r._snapshotInProgress=!1),i(e,u,t.format)}).then(function(e){l(e)}).catch(function(e){r&&(r._snapshotInProgress=!1),s(e)})})}},{"../lib":148,"../plot_api/to_image":185,"./filesaver":235,"./helpers":236}],235:[function(e,t,r){"use strict";var n=e("../lib"),a=e("./helpers");t.exports=function(e,t,r){var i=document.createElement("a"),o="download"in i;return new Promise(function(l,s){var c,u;if(n.isIE9orBelow()&&s(new Error("IE < 10 unsupported")),n.isSafari()){var f="svg"===r?",":";base64,";return a.octetStream(f+encodeURIComponent(e)),l(t)}return n.isIE()?(c=a.createBlob(e,"svg"),window.navigator.msSaveBlob(c,t),c=null,l(t)):o?(c=a.createBlob(e,r),u=a.createObjectURL(c),i.href=u,i.download=t,document.body.appendChild(i),i.click(),document.body.removeChild(i),a.revokeObjectURL(u),c=null,l(t)):void s(new Error("download error"))})}},{"../lib":148,"./helpers":236}],236:[function(e,t,r){"use strict";var n=e("../registry");r.getDelay=function(e){return e._has&&(e._has("gl3d")||e._has("gl2d")||e._has("mapbox"))?500:0},r.getRedrawFunc=function(e){return function(){var t=e._fullLayout||{};!(t._has&&t._has("polar"))&&e.data&&e.data[0]&&e.data[0].r||n.getComponentMethod("colorbar","draw")(e)}},r.encodeSVG=function(e){return"data:image/svg+xml,"+encodeURIComponent(e)},r.encodeJSON=function(e){return"data:application/json,"+encodeURIComponent(e)};var a=window.URL||window.webkitURL;r.createObjectURL=function(e){return a.createObjectURL(e)},r.revokeObjectURL=function(e){return a.revokeObjectURL(e)},r.createBlob=function(e,t){if("svg"===t)return new window.Blob([e],{type:"image/svg+xml;charset=utf-8"});if("full-json"===t)return new window.Blob([e],{type:"application/json;charset=utf-8"});var r=function(e){for(var t=e.length,r=new ArrayBuffer(t),n=new Uint8Array(r),a=0;a<t;a++)n[a]=e.charCodeAt(a);return r}(window.atob(e));return new window.Blob([r],{type:"image/"+t})},r.octetStream=function(e){document.location.href="data:application/octet-stream"+e},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":232}],237:[function(e,t,r){"use strict";var n=e("./helpers"),a={getDelay:n.getDelay,getRedrawFunc:n.getRedrawFunc,clone:e("./cloneplot"),toSVG:e("./tosvg"),svgToImg:e("./svgtoimg"),toImage:e("./toimage"),downloadImage:e("./download")};t.exports=a},{"./cloneplot":233,"./download":234,"./helpers":236,"./svgtoimg":238,"./toimage":239,"./tosvg":240}],238:[function(e,t,r){"use strict";var n=e("../lib"),a=e("events").EventEmitter,i=e("./helpers");t.exports=function(e){var t=e.emitter||new a,r=new Promise(function(a,o){var l=window.Image,s=e.svg,c=e.format||"png";if(n.isIE()&&"svg"!==c){var u=new Error(i.MSG_IE_BAD_FORMAT);return o(u),e.promise?r:t.emit("error",u)}var f,d,p=e.canvas,h=e.scale||1,g=h*(e.width||300),v=h*(e.height||150),m=p.getContext("2d"),y=new l;"svg"===c||n.isIE9orBelow()||n.isSafari()?d=i.encodeSVG(s):(f=i.createBlob(s,"svg"),d=i.createObjectURL(f)),p.width=g,p.height=v,y.onload=function(){var r;switch(f=null,i.revokeObjectURL(d),"svg"!==c&&m.drawImage(y,0,0,g,v),c){case"jpeg":r=p.toDataURL("image/jpeg");break;case"png":r=p.toDataURL("image/png");break;case"webp":r=p.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)),!e.promise)return t.emit("error",n)}a(r),e.promise||t.emit("success",r)},y.onerror=function(r){if(f=null,i.revokeObjectURL(d),o(r),!e.promise)return t.emit("error",r)},y.src=d});return e.promise?r:t}},{"../lib":148,"./helpers":236,events:1}],239:[function(e,t,r){"use strict";var n=e("events").EventEmitter,a=e("../registry"),i=e("../lib"),o=e("./helpers"),l=e("./cloneplot"),s=e("./tosvg"),c=e("./svgtoimg");t.exports=function(e,t){var r=new n,u=l(e,{format:"png"}),f=u.gd;f.style.position="absolute",f.style.left="-5000px",document.body.appendChild(f);var d=o.getRedrawFunc(f);return a.call("plot",f,u.data,u.layout,u.config).then(d).then(function(){var e=o.getDelay(f._fullLayout);setTimeout(function(){var e=s(f),n=document.createElement("canvas");n.id=i.randstr(),(r=c({format:t.format,width:f._fullLayout.width,height:f._fullLayout.height,canvas:n,emitter:r,svg:e})).clean=function(){f&&document.body.removeChild(f)}},e)}).catch(function(e){r.emit("error",e)}),r}},{"../lib":148,"../registry":232,"./cloneplot":233,"./helpers":236,"./svgtoimg":238,"./tosvg":240,events:1}],240:[function(e,t,r){"use strict";var n=e("d3"),a=e("../lib"),i=e("../components/drawing"),o=e("../components/color"),l=e("../constants/xmlns_namespaces"),s=/"/g,c=new RegExp('("TOBESTRIPPED)|(TOBESTRIPPED")',"g");t.exports=function(e,t,r){var u,f=e._fullLayout,d=f._paper,p=f._toppaper,h=f.width,g=f.height;d.insert("rect",":first-child").call(i.setRect,0,0,h,g).call(o.fill,f.paper_bgcolor);var v=f._basePlotModules||[];for(u=0;u<v.length;u++){var m=v[u];m.toSVG&&m.toSVG(e)}if(p){var y=p.node().childNodes,x=Array.prototype.slice.call(y);for(u=0;u<x.length;u++){var b=x[u];b.childNodes.length&&d.node().appendChild(b)}}if(f._draggers&&f._draggers.remove(),d.node().style.background="",d.selectAll("text").attr({"data-unformatted":null,"data-math":null}).each(function(){var e=n.select(this);if("hidden"!==this.style.visibility&&"none"!==this.style.display){e.style({visibility:null,display:null});var t=this.style.fontFamily;t&&-1!==t.indexOf('"')&&e.style("font-family",t.replace(s,"TOBESTRIPPED"))}else e.remove()}),f._gradientUrlQueryParts){var _=[];for(var w in f._gradientUrlQueryParts)_.push(w);_.length&&d.selectAll(_.join(",")).each(function(){var e=n.select(this),t=this.style.fill;t&&-1!==t.indexOf("url(")&&e.style("fill",t.replace(s,"TOBESTRIPPED"));var r=this.style.stroke;r&&-1!==r.indexOf("url(")&&e.style("stroke",r.replace(s,"TOBESTRIPPED"))})}"pdf"!==t&&"eps"!==t||d.selectAll("#MathJax_SVG_glyphs path").attr("stroke-width",0),d.node().setAttributeNS(l.xmlns,"xmlns",l.svg),d.node().setAttributeNS(l.xmlns,"xmlns:xlink",l.xlink),"svg"===t&&r&&(d.attr("width",r*h),d.attr("height",r*g),d.attr("viewBox","0 0 "+h+" "+g));var k=(new window.XMLSerializer).serializeToString(d.node());return k=function(e){var t=n.select("body").append("div").style({display:"none"}).html(""),r=e.replace(/(&[^;]*;)/gi,function(e){return"<"===e?"<":"&rt;"===e?">":-1!==e.indexOf("<")||-1!==e.indexOf(">")?"":t.html(e).text()});return t.remove(),r}(k),k=(k=k.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")).replace(c,"'"),a.isIE()&&(k=(k=(k=k.replace(/"/gi,"'")).replace(/(\('#)([^']*)('\))/gi,'("#$2")')).replace(/(\\')/gi,'"')),k}},{"../components/color":30,"../components/drawing":51,"../constants/xmlns_namespaces":129,"../lib":148,d3:2}],241:[function(e,t,r){"use strict";var n=e("../../lib");r.formatPiePercent=function(e,t){var r=(100*e).toPrecision(3);return-1!==r.lastIndexOf(".")&&(r=r.replace(/[.]?0+$/,"")),n.numSeparate(r,t)+"%"},r.formatPieValue=function(e,t){var r=e.toPrecision(10);return-1!==r.lastIndexOf(".")&&(r=r.replace(/[.]?0+$/,"")),n.numSeparate(r,t)},r.getFirstFilled=function(e,t){if(Array.isArray(e))for(var r=0;r<t.length;r++){var n=e[t[r]];if(n||0===n||""===n)return n}},r.castOption=function(e,t){return Array.isArray(e)?r.getFirstFilled(e,t):e||void 0}},{"../../lib":148}],242:[function(e,t,r){"use strict";var n=e("../../components/color"),a=e("./helpers").castOption;t.exports=function(e,t,r){var i=r.marker.line,o=a(i.color,t.pts)||n.defaultLine,l=a(i.width,t.pts)||0;e.style("stroke-width",l).call(n.fill,t.color).call(n.stroke,o)}},{"../../components/color":30,"./helpers":241}],243:[function(e,t,r){"use strict";var n=e("../../lib");t.exports=function(e,t){for(var r=0;r<e.length;r++)e[r].i=r;n.mergeArray(t.text,e,"tx"),n.mergeArray(t.texttemplate,e,"txt"),n.mergeArray(t.hovertext,e,"htx"),n.mergeArray(t.customdata,e,"data"),n.mergeArray(t.textposition,e,"tp"),t.textfont&&(n.mergeArrayCastPositive(t.textfont.size,e,"ts"),n.mergeArray(t.textfont.color,e,"tc"),n.mergeArray(t.textfont.family,e,"tf"));var a=t.marker;if(a){n.mergeArrayCastPositive(a.size,e,"ms"),n.mergeArrayCastPositive(a.opacity,e,"mo"),n.mergeArray(a.symbol,e,"mx"),n.mergeArray(a.color,e,"mc");var i=a.line;a.line&&(n.mergeArray(i.color,e,"mlc"),n.mergeArrayCastPositive(i.width,e,"mlw"));var o=a.gradient;o&&"none"!==o.type&&(n.mergeArray(o.type,e,"mgt"),n.mergeArray(o.color,e,"mgc"))}}},{"../../lib":148}],244:[function(e,t,r){"use strict";var n=e("../../plots/template_attributes").texttemplateAttrs,a=e("../../plots/template_attributes").hovertemplateAttrs,i=e("../../components/colorscale/attributes"),o=e("../../plots/font_attributes"),l=e("../../components/drawing/attributes").dash,s=e("../../components/drawing"),c=e("./constants"),u=e("../../lib/extend").extendFlat;t.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},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:c.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:u({},l,{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:u({symbol:{valType:"enumerated",values:s.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:u({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":37,"../../components/drawing":51,"../../components/drawing/attributes":50,"../../lib/extend":143,"../../plots/font_attributes":218,"../../plots/template_attributes":231,"./constants":248}],245:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("../../lib"),i=e("../../plots/cartesian/axes"),o=e("../../constants/numerical").BADNUM,l=e("./subtypes"),s=e("./colorscale_calc"),c=e("./arrays_to_calcdata"),u=e("./calc_selection");function f(e,t,r,n,a,o,s){var c=t._length,u=e._fullLayout,f=r._id,d=n._id,p=u._firstScatter[h(t)]===t.uid,v=(g(t,u,r,n)||{}).orientation,m=t.fill;r._minDtick=0,n._minDtick=0;var y={padded:!0},x={padded:!0};s&&(y.ppad=x.ppad=s);var b=c<2||a[0]!==a[c-1]||o[0]!==o[c-1];b&&("tozerox"===m||"tonextx"===m&&(p||"h"===v))?y.tozero=!0:(t.error_y||{}).visible||"tonexty"!==m&&"tozeroy"!==m&&(l.hasMarkers(t)||l.hasText(t))||(y.padded=!1,y.ppad=0),b&&("tozeroy"===m||"tonexty"===m&&(p||"v"===v))?x.tozero=!0:"tonextx"!==m&&"tozerox"!==m||(x.padded=!1),f&&(t._extremes[f]=i.findExtremes(r,a,y)),d&&(t._extremes[d]=i.findExtremes(n,o,x))}function d(e,t){if(l.hasMarkers(e)){var r,n=e.marker,o=1.6*(e.marker.sizeref||1);if(r="area"===e.marker.sizemode?function(e){return Math.max(Math.sqrt((e||0)/o),3)}:function(e){return Math.max((e||0)/o,3)},a.isArrayOrTypedArray(n.size)){var s={type:"linear"};i.setConvert(s);for(var c=s.makeCalcdata(e.marker,"size"),u=new Array(t),f=0;f<t;f++)u[f]=r(c[f]);return u}return r(n.size)}}function p(e,t){var r=h(t),n=e._firstScatter;n[r]||(n[r]=t.uid)}function h(e){var t=e.stackgroup;return e.xaxis+e.yaxis+e.type+(t?"-"+t:"")}function g(e,t,r,n){var a=e.stackgroup;if(a){var i=t._scatterStackOpts[r._id+n._id][a],o="v"===i.orientation?n:r;return"linear"===o.type||"log"===o.type?i:void 0}}t.exports={calc:function(e,t){var r,l,h,v,m,y,x=e._fullLayout,b=i.getFromId(e,t.xaxis||"x"),_=i.getFromId(e,t.yaxis||"y"),w=b.makeCalcdata(t,"x"),k=_.makeCalcdata(t,"y"),T=t._length,M=new Array(T),A=t.ids,L=g(t,x,b,_),S=!1;p(x,t);var C,O="x",P="y";for(L?(a.pushUnique(L.traceIndices,t._expandedIndex),(r="v"===L.orientation)?(P="s",C="x"):(O="s",C="y"),m="interpolate"===L.stackgaps):f(e,t,b,_,w,k,d(t,T)),l=0;l<T;l++){var D=M[l]={},z=n(w[l]),R=n(k[l]);z&&R?(D[O]=w[l],D[P]=k[l]):L&&(r?z:R)?(D[C]=r?w[l]:k[l],D.gap=!0,m?(D.s=o,S=!0):D.s=0):D[O]=D[P]=o,A&&(D.id=String(A[l]))}if(c(M,t),s(e,t),u(M,t),L){for(l=0;l<M.length;)M[l][C]===o?M.splice(l,1):l++;if(a.sort(M,function(e,t){return e[C]-t[C]||e.i-t.i}),S){for(l=0;l<M.length-1&&M[l].gap;)l++;for((y=M[l].s)||(y=M[l].s=0),h=0;h<l;h++)M[h].s=y;for(v=M.length-1;v>l&&M[v].gap;)v--;for(y=M[v].s,h=M.length-1;h>v;h--)M[h].s=y;for(;l<v;)if(M[++l].gap){for(h=l+1;M[h].gap;)h++;for(var E=M[l-1][C],I=M[l-1].s,F=(M[h].s-I)/(M[h][C]-E);l<h;)M[l].s=I+(M[l][C]-E)*F,l++}}}return M},calcMarkerSize:d,calcAxisExpansion:f,setFirstScatter:p,getStackOpts:g}},{"../../constants/numerical":128,"../../lib":148,"../../plots/cartesian/axes":192,"./arrays_to_calcdata":243,"./calc_selection":246,"./colorscale_calc":247,"./subtypes":268,"fast-isnumeric":4}],246:[function(e,t,r){"use strict";var n=e("../../lib");t.exports=function(e,t){n.isArrayOrTypedArray(t.selectedpoints)&&n.tagSelected(e,t)}},{"../../lib":148}],247:[function(e,t,r){"use strict";var n=e("../../components/colorscale/helpers").hasColorscale,a=e("../../components/colorscale/calc"),i=e("./subtypes");t.exports=function(e,t){i.hasLines(t)&&n(t,"line")&&a(e,t,{vals:t.line.color,containerStr:"line",cLetter:"c"}),i.hasMarkers(t)&&(n(t,"marker")&&a(e,t,{vals:t.marker.color,containerStr:"marker",cLetter:"c"}),n(t,"marker.line")&&a(e,t,{vals:t.marker.line.color,containerStr:"marker.line",cLetter:"c"}))}},{"../../components/colorscale/calc":38,"../../components/colorscale/helpers":41,"./subtypes":268}],248:[function(e,t,r){"use strict";t.exports={PTS_LINESONLY:20,minTolerance:.2,toleranceGrowth:10,maxScreensAway:20,eventDataKeys:[]}},{}],249:[function(e,t,r){"use strict";var n=e("./calc");function a(e,t,r,n,a,i,o){a[n]=!0;var l={i:null,gap:!0,s:0};if(l[o]=r,e.splice(t,0,l),t&&r===e[t-1][o]){var s=e[t-1];l.s=s.s,l.i=s.i,l.gap=s.gap}else i&&(l.s=function(e,t,r,n){var a=e[t-1],i=e[t+1];return i?a?a.s+(i.s-a.s)*(r-a[n])/(i[n]-a[n]):i.s:a.s}(e,t,r,o));t||(e[0].t=e[1].t,e[0].trace=e[1].trace,delete e[1].t,delete e[1].trace)}t.exports=function(e,t){var r=t.xaxis,i=t.yaxis,o=r._id+i._id,l=e._fullLayout._scatterStackOpts[o];if(l){var s,c,u,f,d,p,h,g,v,m,y,x,b,_,w,k=e.calcdata;for(var T in l){var M=(m=l[T]).traceIndices;if(M.length){for(y="interpolate"===m.stackgaps,x=m.groupnorm,"v"===m.orientation?(b="x",_="y"):(b="y",_="x"),w=new Array(M.length),s=0;s<w.length;s++)w[s]=!1;p=k[M[0]];var A=new Array(p.length);for(s=0;s<p.length;s++)A[s]=p[s][b];for(s=1;s<M.length;s++){for(d=k[M[s]],c=u=0;c<d.length;c++){for(h=d[c][b];h>A[u]&&u<A.length;u++)a(d,c,A[u],s,w,y,b),c++;if(h!==A[u]){for(f=0;f<s;f++)a(k[M[f]],u,h,f,w,y,b);A.splice(u,0,h)}u++}for(;u<A.length;u++)a(d,c,A[u],s,w,y,b),c++}var L=A.length;for(c=0;c<p.length;c++){for(g=p[c][_]=p[c].s,s=1;s<M.length;s++)(d=k[M[s]])[0].trace._rawLength=d[0].trace._length,d[0].trace._length=L,g+=d[c].s,d[c][_]=g;if(x)for(v=("fraction"===x?g:g/100)||1,s=0;s<M.length;s++){var S=k[M[s]][c];S[_]/=v,S.sNorm=S.s/v}}for(s=0;s<M.length;s++){var C=(d=k[M[s]])[0].trace,O=n.calcMarkerSize(C,C._rawLength),P=Array.isArray(O);if(O&&w[s]||P){var D=O;for(O=new Array(L),c=0;c<L;c++)O[c]=d[c].gap?0:P?D[d[c].i]:D}var z=new Array(L),R=new Array(L);for(c=0;c<L;c++)z[c]=d[c].x,R[c]=d[c].y;n.calcAxisExpansion(e,C,r,i,z,R,O),d[0].t.orientation=m.orientation}}}}}},{"./calc":245}],250:[function(e,t,r){"use strict";t.exports=function(e){for(var t=0;t<e.length;t++){var r=e[t];if("scatter"===r.type){var n=r.fill;if("none"!==n&&"toself"!==n&&(r.opacity=void 0,"tonexty"===n||"tonextx"===n))for(var a=t-1;a>=0;a--){var i=e[a];if("scatter"===i.type&&i.xaxis===r.xaxis&&i.yaxis===r.yaxis){i.opacity=void 0;break}}}}}},{}],251:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../registry"),i=e("./attributes"),o=e("./constants"),l=e("./subtypes"),s=e("./xy_defaults"),c=e("./stack_defaults"),u=e("./marker_defaults"),f=e("./line_defaults"),d=e("./line_shape_defaults"),p=e("./text_defaults"),h=e("./fillcolor_defaults");t.exports=function(e,t,r,g){function v(r,a){return n.coerce(e,t,i,r,a)}var m=s(e,t,g,v);if(m||(t.visible=!1),t.visible){var y=c(e,t,g,v),x=!y&&m<o.PTS_LINESONLY?"lines+markers":"lines";v("text"),v("hovertext"),v("mode",x),l.hasLines(t)&&(f(e,t,r,g,v),d(e,t,v),v("connectgaps"),v("line.simplify")),l.hasMarkers(t)&&u(e,t,r,g,v,{gradient:!0}),l.hasText(t)&&(v("texttemplate"),p(e,t,g,v));var b=[];(l.hasMarkers(t)||l.hasText(t))&&(v("cliponaxis"),v("marker.maxdisplayed"),b.push("points")),v("fill",y?y.fillDflt:"none"),"none"!==t.fill&&(h(e,t,r,v),l.hasLines(t)||d(e,t,v));var _=(t.line||{}).color,w=(t.marker||{}).color;"tonext"!==t.fill&&"toself"!==t.fill||b.push("fills"),v("hoveron",b.join("+")||"points"),"fills"!==t.hoveron&&v("hovertemplate");var k=a.getComponentMethod("errorbars","supplyDefaults");k(e,t,_||w||r,{axis:"y"}),k(e,t,_||w||r,{axis:"x",inherit:"y"}),n.coerceSelectionMarkerOpacity(t,v)}}},{"../../lib":148,"../../registry":232,"./attributes":244,"./constants":248,"./fillcolor_defaults":252,"./line_defaults":257,"./line_shape_defaults":259,"./marker_defaults":263,"./stack_defaults":266,"./subtypes":268,"./text_defaults":269,"./xy_defaults":270}],252:[function(e,t,r){"use strict";var n=e("../../components/color"),a=e("../../lib").isArrayOrTypedArray;t.exports=function(e,t,r,i){var o=!1;if(t.marker){var l=t.marker.color,s=(t.marker.line||{}).color;l&&!a(l)?o=l:s&&!a(s)&&(o=s)}i("fillcolor",n.addOpacity((t.line||{}).color||o||r,.5))}},{"../../components/color":30,"../../lib":148}],253:[function(e,t,r){"use strict";var n=e("../../plots/cartesian/axes");t.exports=function(e,t,r){var a={},i={_fullLayout:r},o=n.getFromTrace(i,t,"x"),l=n.getFromTrace(i,t,"y");return a.xLabel=n.tickText(o,e.x,!0).text,a.yLabel=n.tickText(l,e.y,!0).text,a}},{"../../plots/cartesian/axes":192}],254:[function(e,t,r){"use strict";var n=e("../../components/color"),a=e("./subtypes");t.exports=function(e,t){var r,i;if("lines"===e.mode)return(r=e.line.color)&&n.opacity(r)?r:e.fillcolor;if("none"===e.mode)return e.fill?e.fillcolor:"";var o=t.mcc||(e.marker||{}).color,l=t.mlcc||((e.marker||{}).line||{}).color;return(i=o&&n.opacity(o)?o:l&&n.opacity(l)&&(t.mlw||((e.marker||{}).line||{}).width)?l:"")?n.opacity(i)<.3?n.addOpacity(i,.3):i:(r=(e.line||{}).color)&&n.opacity(r)&&a.hasLines(e)&&e.line.width?r:e.fillcolor}},{"../../components/color":30,"./subtypes":268}],255:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../components/fx"),i=e("../../registry"),o=e("./get_trace_color"),l=e("../../components/color"),s=n.fillText;t.exports=function(e,t,r,c){var u=e.cd,f=u[0].trace,d=e.xa,p=e.ya,h=d.c2p(t),g=p.c2p(r),v=[h,g],m=f.hoveron||"",y=-1!==f.mode.indexOf("markers")?3:.5;if(-1!==m.indexOf("points")){var x=function(e){var t=Math.max(y,e.mrc||0),r=d.c2p(e.x)-h,n=p.c2p(e.y)-g;return Math.max(Math.sqrt(r*r+n*n)-t,1-y/t)},b=a.getDistanceFunction(c,function(e){var t=Math.max(3,e.mrc||0),r=1-1/t,n=Math.abs(d.c2p(e.x)-h);return n<t?r*n/t:n-t+r},function(e){var t=Math.max(3,e.mrc||0),r=1-1/t,n=Math.abs(p.c2p(e.y)-g);return n<t?r*n/t:n-t+r},x);if(a.getClosest(u,b,e),!1!==e.index){var _=u[e.index],w=d.c2p(_.x,!0),k=p.c2p(_.y,!0),T=_.mrc||1;e.index=_.i;var M=u[0].t.orientation,A=M&&(_.sNorm||_.s),L="h"===M?A:_.x,S="v"===M?A:_.y;return n.extendFlat(e,{color:o(f,_),x0:w-T,x1:w+T,xLabelVal:L,y0:k-T,y1:k+T,yLabelVal:S,spikeDistance:x(_),hovertemplate:f.hovertemplate}),s(_,f,e),i.getComponentMethod("errorbars","hoverInfo")(_,f,e),[e]}}if(-1!==m.indexOf("fills")&&f._polygons){var C,O,P,D,z,R,E,I,F,N=f._polygons,j=[],B=!1,H=1/0,q=-1/0,V=1/0,U=-1/0;for(C=0;C<N.length;C++)(P=N[C]).contains(v)&&(B=!B,j.push(P),V=Math.min(V,P.ymin),U=Math.max(U,P.ymax));if(B){var G=((V=Math.max(V,0))+(U=Math.min(U,p._length)))/2;for(C=0;C<j.length;C++)for(D=j[C].pts,O=1;O<D.length;O++)(I=D[O-1][1])>G!=(F=D[O][1])>=G&&(R=D[O-1][0],E=D[O][0],F-I&&(z=R+(E-R)*(G-I)/(F-I),H=Math.min(H,z),q=Math.max(q,z)));H=Math.max(H,0),q=Math.min(q,d._length);var Z=l.defaultLine;return l.opacity(f.fillcolor)?Z=f.fillcolor:l.opacity((f.line||{}).color)&&(Z=f.line.color),n.extendFlat(e,{distance:e.maxHoverDistance,x0:H,x1:q,y0:G,y1:G,color:Z,hovertemplate:!1}),delete e.index,f.text&&!Array.isArray(f.text)?e.text=String(f.text):e.text=f.name,[e]}}}},{"../../components/color":30,"../../components/fx":69,"../../lib":148,"../../registry":232,"./get_trace_color":254}],256:[function(e,t,r){"use strict";var n=e("./subtypes");t.exports={hasLines:n.hasLines,hasMarkers:n.hasMarkers,hasText:n.hasText,isBubble:n.isBubble,attributes:e("./attributes"),supplyDefaults:e("./defaults"),crossTraceDefaults:e("./cross_trace_defaults"),calc:e("./calc").calc,crossTraceCalc:e("./cross_trace_calc"),arraysToCalcdata:e("./arrays_to_calcdata"),plot:e("./plot"),colorbar:e("./marker_colorbar"),formatLabels:e("./format_labels"),style:e("./style").style,styleOnSelect:e("./style").styleOnSelect,hoverPoints:e("./hover"),selectPoints:e("./select"),animatable:!0,moduleType:"trace",name:"scatter",basePlotModule:e("../../plots/cartesian"),categories:["cartesian","svg","symbols","errorBarsOK","showLegend","scatter-like","zoomScale"],meta:{}}},{"../../plots/cartesian":203,"./arrays_to_calcdata":243,"./attributes":244,"./calc":245,"./cross_trace_calc":249,"./cross_trace_defaults":250,"./defaults":251,"./format_labels":253,"./hover":255,"./marker_colorbar":262,"./plot":264,"./select":265,"./style":267,"./subtypes":268}],257:[function(e,t,r){"use strict";var n=e("../../lib").isArrayOrTypedArray,a=e("../../components/colorscale/helpers").hasColorscale,i=e("../../components/colorscale/defaults");t.exports=function(e,t,r,o,l,s){var c=(e.marker||{}).color;(l("line.color",r),a(e,"line"))?i(e,t,o,l,{prefix:"line.",cLetter:"c"}):l("line.color",!n(c)&&c||r);l("line.width"),(s||{}).noDash||l("line.dash")}},{"../../components/colorscale/defaults":40,"../../components/colorscale/helpers":41,"../../lib":148}],258:[function(e,t,r){"use strict";var n=e("../../constants/numerical"),a=n.BADNUM,i=n.LOG_CLIP,o=i+.5,l=i-.5,s=e("../../lib"),c=s.segmentsIntersect,u=s.constrain,f=e("./constants");t.exports=function(e,t){var r,n,i,d,p,h,g,v,m,y,x,b,_,w,k,T,M,A,L=t.xaxis,S=t.yaxis,C="log"===L.type,O="log"===S.type,P=L._length,D=S._length,z=t.connectGaps,R=t.baseTolerance,E=t.shape,I="linear"===E,F=t.fill&&"none"!==t.fill,N=[],j=f.minTolerance,B=e.length,H=new Array(B),q=0;function V(r){var n=e[r];if(!n)return!1;var i=t.linearized?L.l2p(n.x):L.c2p(n.x),s=t.linearized?S.l2p(n.y):S.c2p(n.y);if(i===a){if(C&&(i=L.c2p(n.x,!0)),i===a)return!1;O&&s===a&&(i*=Math.abs(L._m*D*(L._m>0?o:l)/(S._m*P*(S._m>0?o:l)))),i*=1e3}if(s===a){if(O&&(s=S.c2p(n.y,!0)),s===a)return!1;s*=1e3}return[i,s]}function U(e,t,r,n){var a=r-e,i=n-t,o=.5-e,l=.5-t,s=a*a+i*i,c=a*o+i*l;if(c>0&&c<s){var u=o*i-l*a;if(u*u<s)return!0}}function G(e,t){var r=e[0]/P,n=e[1]/D,a=Math.max(0,-r,r-1,-n,n-1);return a&&void 0!==M&&U(r,n,M,A)&&(a=0),a&&t&&U(r,n,t[0]/P,t[1]/D)&&(a=0),(1+f.toleranceGrowth*a)*R}function Z(e,t){var r=e[0]-t[0],n=e[1]-t[1];return Math.sqrt(r*r+n*n)}var Y,X,W,$,J,Q,K,ee=f.maxScreensAway,te=-P*ee,re=P*(1+ee),ne=-D*ee,ae=D*(1+ee),ie=[[te,ne,re,ne],[re,ne,re,ae],[re,ae,te,ae],[te,ae,te,ne]];function oe(e){if(e[0]<te||e[0]>re||e[1]<ne||e[1]>ae)return[u(e[0],te,re),u(e[1],ne,ae)]}function le(e,t){return e[0]===t[0]&&(e[0]===te||e[0]===re)||(e[1]===t[1]&&(e[1]===ne||e[1]===ae)||void 0)}function se(e,t,r){return function(n,a){var i=oe(n),o=oe(a),l=[];if(i&&o&&le(i,o))return l;i&&l.push(i),o&&l.push(o);var c=2*s.constrain((n[e]+a[e])/2,t,r)-((i||n)[e]+(o||a)[e]);c&&((i&&o?c>0==i[e]>o[e]?i:o:i||o)[e]+=c);return l}}function ce(e){var t=e[0],r=e[1],n=t===H[q-1][0],a=r===H[q-1][1];if(!n||!a)if(q>1){var i=t===H[q-2][0],o=r===H[q-2][1];n&&(t===te||t===re)&&i?o?q--:H[q-1]=e:a&&(r===ne||r===ae)&&o?i?q--:H[q-1]=e:H[q++]=e}else H[q++]=e}function ue(e){H[q-1][0]!==e[0]&&H[q-1][1]!==e[1]&&ce([W,$]),ce(e),J=null,W=$=0}function fe(e){if(M=e[0]/P,A=e[1]/D,Y=e[0]<te?te:e[0]>re?re:0,X=e[1]<ne?ne:e[1]>ae?ae:0,Y||X){if(q)if(J){var t=K(J,e);t.length>1&&(ue(t[0]),H[q++]=t[1])}else Q=K(H[q-1],e)[0],H[q++]=Q;else H[q++]=[Y||e[0],X||e[1]];var r=H[q-1];Y&&X&&(r[0]!==Y||r[1]!==X)?(J&&(W!==Y&&$!==X?ce(W&&$?(n=J,i=(a=e)[0]-n[0],o=(a[1]-n[1])/i,(n[1]*a[0]-a[1]*n[0])/i>0?[o>0?te:re,ae]:[o>0?re:te,ne]):[W||Y,$||X]):W&&$&&ce([W,$])),ce([Y,X])):W-Y&&$-X&&ce([Y||W,X||$]),J=e,W=Y,$=X}else J&&ue(K(J,e)[0]),H[q++]=e;var n,a,i,o}for("linear"===E||"spline"===E?K=function(e,t){for(var r=[],n=0,a=0;a<4;a++){var i=ie[a],o=c(e[0],e[1],t[0],t[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&&Z(o,e)<Z(r[0],e)?r.unshift(o):r.push(o),n++)}return r}:"hv"===E||"vh"===E?K=function(e,t){var r=[],n=oe(e),a=oe(t);return n&&a&&le(n,a)?r:(n&&r.push(n),a&&r.push(a),r)}:"hvh"===E?K=se(0,te,re):"vhv"===E&&(K=se(1,ne,ae)),r=0;r<B;r++)if(n=V(r)){for(q=0,J=null,fe(n),r++;r<B;r++){if(!(d=V(r))){if(z)continue;break}if(I&&t.simplify){var de=V(r+1);if(y=Z(d,n),F&&(0===q||q===B-1)||!(y<G(d,de)*j)){for(v=[(d[0]-n[0])/y,(d[1]-n[1])/y],p=n,x=y,b=w=k=0,g=!1,i=d,r++;r<e.length;r++){if(h=de,de=V(r+1),!h){if(z)continue;break}if(T=(m=[h[0]-n[0],h[1]-n[1]])[0]*v[1]-m[1]*v[0],w=Math.min(w,T),(k=Math.max(k,T))-w>G(h,de))break;i=h,(_=m[0]*v[0]+m[1]*v[1])>x?(x=_,d=h,g=!1):_<b&&(b=_,p=h,g=!0)}if(g?(fe(d),i!==p&&fe(p)):(p!==n&&fe(p),i!==d&&fe(d)),fe(i),r>=e.length||!h)break;fe(h),n=h}}else fe(d)}J&&ce([W||J[0],$||J[1]]),N.push(H.slice(0,q))}return N}},{"../../constants/numerical":128,"../../lib":148,"./constants":248}],259:[function(e,t,r){"use strict";t.exports=function(e,t,r){"spline"===r("line.shape")&&r("line.smoothing")}},{}],260:[function(e,t,r){"use strict";var n={tonextx:1,tonexty:1,tonext:1};t.exports=function(e,t,r){var a,i,o,l,s,c={},u=!1,f=-1,d=0,p=-1;for(i=0;i<r.length;i++)(o=(a=r[i][0].trace).stackgroup||"")?o in c?s=c[o]:(s=c[o]=d,d++):a.fill in n&&p>=0?s=p:(s=p=d,d++),s<f&&(u=!0),a._groupIndex=f=s;var h=r.slice();u&&h.sort(function(e,t){var r=e[0].trace,n=t[0].trace;return r._groupIndex-n._groupIndex||r.index-n.index});var g={};for(i=0;i<h.length;i++)o=(a=h[i][0].trace).stackgroup||"",!0===a.visible?(a._nexttrace=null,a.fill in n&&(l=g[o],a._prevtrace=l||null,l&&(l._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 h}},{}],261:[function(e,t,r){"use strict";var n=e("fast-isnumeric");t.exports=function(e){var t=e.marker,r=t.sizeref||1,a=t.sizemin||0,i="area"===t.sizemode?function(e){return Math.sqrt(e/r)}:function(e){return e/r};return function(e){var t=i(e/2);return n(t)&&t>0?Math.max(t,a):0}}},{"fast-isnumeric":4}],262:[function(e,t,r){"use strict";t.exports={container:"marker",min:"cmin",max:"cmax"}},{}],263:[function(e,t,r){"use strict";var n=e("../../components/color"),a=e("../../components/colorscale/helpers").hasColorscale,i=e("../../components/colorscale/defaults"),o=e("./subtypes");t.exports=function(e,t,r,l,s,c){var u=o.isBubble(e),f=(e.line||{}).color;(c=c||{},f&&(r=f),s("marker.symbol"),s("marker.opacity",u?.7:1),s("marker.size"),s("marker.color",r),a(e,"marker")&&i(e,t,l,s,{prefix:"marker.",cLetter:"c"}),c.noSelect||(s("selected.marker.color"),s("unselected.marker.color"),s("selected.marker.size"),s("unselected.marker.size")),c.noLine||(s("marker.line.color",f&&!Array.isArray(f)&&t.marker.color!==f?f:u?n.background:n.defaultLine),a(e,"marker.line")&&i(e,t,l,s,{prefix:"marker.line.",cLetter:"c"}),s("marker.line.width",u?1:0)),u&&(s("marker.sizeref"),s("marker.sizemin"),s("marker.sizemode")),c.gradient)&&("none"!==s("marker.gradient.type")&&s("marker.gradient.color"))}},{"../../components/color":30,"../../components/colorscale/defaults":40,"../../components/colorscale/helpers":41,"./subtypes":268}],264:[function(e,t,r){"use strict";var n=e("d3"),a=e("../../registry"),i=e("../../lib"),o=i.ensureSingle,l=i.identity,s=e("../../components/drawing"),c=e("./subtypes"),u=e("./line_points"),f=e("./link_traces"),d=e("../../lib/polygon").tester;function p(e,t,r,f,p,h,g){var v;!function(e,t,r,a,o){var l=r.xaxis,s=r.yaxis,u=n.extent(i.simpleMap(l.range,l.r2c)),f=n.extent(i.simpleMap(s.range,s.r2c)),d=a[0].trace;if(!c.hasMarkers(d))return;var p=d.marker.maxdisplayed;if(0===p)return;var h=a.filter(function(e){return e.x>=u[0]&&e.x<=u[1]&&e.y>=f[0]&&e.y<=f[1]}),g=Math.ceil(h.length/p),v=0;o.forEach(function(e,r){var n=e[0].trace;c.hasMarkers(n)&&n.marker.maxdisplayed>0&&r<t&&v++});var m=Math.round(v*g/3+Math.floor(v/3)*g/7.1);a.forEach(function(e){delete e.vis}),h.forEach(function(e,t){0===Math.round((t+m)%g)&&(e.vis=!0)})}(0,t,r,f,p);var m=!!g&&g.duration>0;function y(e){return m?e.transition():e}var x=r.xaxis,b=r.yaxis,_=f[0].trace,w=_.line,k=n.select(h),T=o(k,"g","errorbars"),M=o(k,"g","lines"),A=o(k,"g","points"),L=o(k,"g","text");if(a.getComponentMethod("errorbars","plot")(e,T,r,g),!0===_.visible){var S,C;y(k).style("opacity",_.opacity);var O=_.fill.charAt(_.fill.length-1);"x"!==O&&"y"!==O&&(O=""),f[0][r.isRangePlot?"nodeRangePlot3":"node3"]=k;var P,D,z="",R=[],E=_._prevtrace;E&&(z=E._prevRevpath||"",C=E._nextFill,R=E._polygons);var I,F,N,j,B,H,q,V="",U="",G=[],Z=i.noop;if(S=_._ownFill,c.hasLines(_)||"none"!==_.fill){for(C&&C.datum(f),-1!==["hv","vh","hvh","vhv"].indexOf(w.shape)?(I=s.steps(w.shape),F=s.steps(w.shape.split("").reverse().join(""))):I=F="spline"===w.shape?function(e){var t=e[e.length-1];return e.length>1&&e[0][0]===t[0]&&e[0][1]===t[1]?s.smoothclosed(e.slice(1),w.smoothing):s.smoothopen(e,w.smoothing)}:function(e){return"M"+e.join("L")},N=function(e){return F(e.reverse())},G=u(f,{xaxis:x,yaxis:b,connectGaps:_.connectgaps,baseTolerance:Math.max(w.width||1,3)/4,shape:w.shape,simplify:w.simplify,fill:_.fill}),q=_._polygons=new Array(G.length),v=0;v<G.length;v++)_._polygons[v]=d(G[v]);G.length&&(j=G[0][0],H=(B=G[G.length-1])[B.length-1]),Z=function(e){return function(t){if(P=I(t),D=N(t),V?O?(V+="L"+P.substr(1),U=D+"L"+U.substr(1)):(V+="Z"+P,U=D+"Z"+U):(V=P,U=D),c.hasLines(_)&&t.length>1){var r=n.select(this);if(r.datum(f),e)y(r.style("opacity",0).attr("d",P).call(s.lineGroupStyle)).style("opacity",1);else{var a=y(r);a.attr("d",P),s.singleLineStyle(f,a)}}}}}var Y=M.selectAll(".js-line").data(G);y(Y.exit()).style("opacity",0).remove(),Y.each(Z(!1)),Y.enter().append("path").classed("js-line",!0).style("vector-effect","non-scaling-stroke").call(s.lineGroupStyle).each(Z(!0)),s.setClipUrl(Y,r.layerClipId,e),G.length?(S?(S.datum(f),j&&H&&(O?("y"===O?j[1]=H[1]=b.c2p(0,!0):"x"===O&&(j[0]=H[0]=x.c2p(0,!0)),y(S).attr("d","M"+H+"L"+j+"L"+V.substr(1)).call(s.singleFillStyle)):y(S).attr("d",V+"Z").call(s.singleFillStyle))):C&&("tonext"===_.fill.substr(0,6)&&V&&z?("tonext"===_.fill?y(C).attr("d",V+"Z"+z+"Z").call(s.singleFillStyle):y(C).attr("d",V+"L"+z.substr(1)+"Z").call(s.singleFillStyle),_._polygons=_._polygons.concat(R)):(W(C),_._polygons=null)),_._prevRevpath=U,_._prevPolygons=q):(S?W(S):C&&W(C),_._polygons=_._prevRevpath=_._prevPolygons=null),A.datum(f),L.datum(f),function(t,a,i){var o,u=i[0].trace,f=c.hasMarkers(u),d=c.hasText(u),p=ee(u),h=te,g=te;if(f||d){var v=l,_=u.stackgroup,w=_&&"infer zero"===e._fullLayout._scatterStackOpts[x._id+b._id][_].stackgaps;u.marker.maxdisplayed||u._needsCull?v=w?J:$:_&&!w&&(v=Q),f&&(h=v),d&&(g=v)}var k,T=(o=t.selectAll("path.point").data(h,p)).enter().append("path").classed("point",!0);m&&T.call(s.pointStyle,u,e).call(s.translatePoints,x,b).style("opacity",0).transition().style("opacity",1),o.order(),f&&(k=s.makePointStyleFns(u)),o.each(function(t){var a=n.select(this),i=y(a);s.translatePoint(t,i,x,b)?(s.singlePointStyle(t,i,u,k,e),r.layerClipId&&s.hideOutsideRangePoint(t,i,x,b,u.xcalendar,u.ycalendar),u.customdata&&a.classed("plotly-customdata",null!==t.data&&void 0!==t.data)):i.remove()}),m?o.exit().transition().style("opacity",0).remove():o.exit().remove(),(o=a.selectAll("g").data(g,p)).enter().append("g").classed("textpoint",!0).append("text"),o.order(),o.each(function(e){var t=n.select(this),a=y(t.select("text"));s.translatePoint(e,a,x,b)?r.layerClipId&&s.hideOutsideRangePoint(e,t,x,b,u.xcalendar,u.ycalendar):t.remove()}),o.selectAll("text").call(s.textPointStyle,u,e).each(function(e){var t=x.c2p(e.x),r=b.c2p(e.y);n.select(this).selectAll("tspan.line").each(function(){y(n.select(this)).attr({x:t,y:r})})}),o.exit().remove()}(A,L,f);var X=!1===_.cliponaxis?null:r.layerClipId;s.setClipUrl(A,X,e),s.setClipUrl(L,X,e)}function W(e){y(e).attr("d","M0,0Z")}function $(e){return e.filter(function(e){return!e.gap&&e.vis})}function J(e){return e.filter(function(e){return e.vis})}function Q(e){return e.filter(function(e){return!e.gap})}function K(e){return e.id}function ee(e){if(e.ids)return K}function te(){return!1}}t.exports=function(e,t,r,a,i,c){var u,d,h=!i,g=!!i&&i.duration>0,v=f(e,t,r);((u=a.selectAll("g.trace").data(v,function(e){return e[0].trace.uid})).enter().append("g").attr("class",function(e){return"trace scatter trace"+e[0].trace.uid}).style("stroke-miterlimit",2),u.order(),function(e,t,r){t.each(function(t){var a=o(n.select(this),"g","fills");s.setClipUrl(a,r.layerClipId,e);var i=t[0].trace,c=[];i._ownfill&&c.push("_ownFill"),i._nexttrace&&c.push("_nextFill");var u=a.selectAll("g").data(c,l);u.enter().append("g"),u.exit().each(function(e){i[e]=null}).remove(),u.order().each(function(e){i[e]=o(n.select(this),"path","js-fill")})})}(e,u,t),g)?(c&&(d=c()),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){p(e,n,t,r,v,this,i)})})):u.each(function(r,n){p(e,n,t,r,v,this,i)});h&&u.exit().remove(),a.selectAll("path:not([d])").remove()}},{"../../components/drawing":51,"../../lib":148,"../../lib/polygon":160,"../../registry":232,"./line_points":258,"./link_traces":260,"./subtypes":268,d3:2}],265:[function(e,t,r){"use strict";var n=e("./subtypes");t.exports=function(e,t){var r,a,i,o,l=e.cd,s=e.xaxis,c=e.yaxis,u=[],f=l[0].trace;if(!n.hasMarkers(f)&&!n.hasText(f))return[];if(!1===t)for(r=0;r<l.length;r++)l[r].selected=0;else for(r=0;r<l.length;r++)a=l[r],i=s.c2p(a.x),o=c.c2p(a.y),null!==a.i&&t.contains([i,o],!1,r,e)?(u.push({pointNumber:a.i,x:s.c2d(a.x),y:c.c2d(a.y)}),a.selected=1):a.selected=0;return u}},{"./subtypes":268}],266:[function(e,t,r){"use strict";var n=["orientation","groupnorm","stackgaps"];t.exports=function(e,t,r,a){var i=r._scatterStackOpts,o=a("stackgroup");if(o){var l=t.xaxis+t.yaxis,s=i[l];s||(s=i[l]={});var c=s[o],u=!1;c?c.traces.push(t):(c=s[o]={traceIndices:[],traces:[t]},u=!0);for(var f={orientation:t.x&&!t.y?"h":"v"},d=0;d<n.length;d++){var p=n[d],h=p+"Found";if(!c[h]){var g=void 0!==e[p],v="orientation"===p;if((g||u)&&(c[p]=a(p,f[p]),v&&(c.fillDflt="h"===c[p]?"tonextx":"tonexty"),g&&(c[h]=!0,!u&&(delete c.traces[0][p],v))))for(var m=0;m<c.traces.length-1;m++){var y=c.traces[m];y._input.fill!==y.fill&&(y.fill=c.fillDflt)}}}return c}}},{}],267:[function(e,t,r){"use strict";var n=e("d3"),a=e("../../components/drawing"),i=e("../../registry");function o(e,t,r){a.pointStyle(e.selectAll("path.point"),t,r)}function l(e,t,r){a.textPointStyle(e.selectAll("text"),t,r)}t.exports={style:function(e){var t=n.select(e).selectAll("g.trace.scatter");t.style("opacity",function(e){return e[0].trace.opacity}),t.selectAll("g.points").each(function(t){o(n.select(this),t.trace||t[0].trace,e)}),t.selectAll("g.text").each(function(t){l(n.select(this),t.trace||t[0].trace,e)}),t.selectAll("g.trace path.js-line").call(a.lineGroupStyle),t.selectAll("g.trace path.js-fill").call(a.fillGroupStyle),i.getComponentMethod("errorbars","style")(t)},stylePoints:o,styleText:l,styleOnSelect:function(e,t,r){var n=t[0].trace;n.selectedpoints?(a.selectedPointStyle(r.selectAll("path.point"),n),a.selectedTextStyle(r.selectAll("text"),n)):(o(r,n,e),l(r,n,e))}}},{"../../components/drawing":51,"../../registry":232,d3:2}],268:[function(e,t,r){"use strict";var n=e("../../lib");t.exports={hasLines:function(e){return e.visible&&e.mode&&-1!==e.mode.indexOf("lines")},hasMarkers:function(e){return e.visible&&(e.mode&&-1!==e.mode.indexOf("markers")||"splom"===e.type)},hasText:function(e){return e.visible&&e.mode&&-1!==e.mode.indexOf("text")},isBubble:function(e){return n.isPlainObject(e.marker)&&n.isArrayOrTypedArray(e.marker.size)}}},{"../../lib":148}],269:[function(e,t,r){"use strict";var n=e("../../lib");t.exports=function(e,t,r,a,i){i=i||{},a("textposition"),n.coerceFont(a,"textfont",r.font),i.noSelect||(a("selected.textfont.color"),a("unselected.textfont.color"))}},{"../../lib":148}],270:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../registry");t.exports=function(e,t,r,i){var o,l=i("x"),s=i("y");if(a.getComponentMethod("calendars","handleTraceDefaults")(e,t,["x","y"],r),l){var c=n.minRowLength(l);s?o=Math.min(c,n.minRowLength(s)):(o=c,i("y0"),i("dy"))}else{if(!s)return 0;o=n.minRowLength(s),i("x0"),i("dx")}return t._length=o,o}},{"../../lib":148,"../../registry":232}],271:[function(e,t,r){"use strict";r.version="1.53.0"},{}],272:[function(e,t,r){var n,a=e("./lib/build-log"),i=e("./lib/epsilon"),o=e("./lib/intersecter"),l=e("./lib/segment-chainer"),s=e("./lib/segment-selector"),c=e("./lib/geojson"),u=!1,f=i();function d(e,t,r){var a=n.segments(e),i=n.segments(t),o=r(n.combine(a,i));return n.polygon(o)}n={buildLog:function(e){return!0===e?u=a():!1===e&&(u=!1),!1!==u&&u.list},epsilon:function(e){return f.epsilon(e)},segments:function(e){var t=o(!0,f,u);return e.regions.forEach(t.addRegion),{segments:t.calculate(e.inverted),inverted:e.inverted}},combine:function(e,t){return{combined:o(!1,f,u).calculate(e.segments,e.inverted,t.segments,t.inverted),inverted1:e.inverted,inverted2:t.inverted}},selectUnion:function(e){return{segments:s.union(e.combined,u),inverted:e.inverted1||e.inverted2}},selectIntersect:function(e){return{segments:s.intersect(e.combined,u),inverted:e.inverted1&&e.inverted2}},selectDifference:function(e){return{segments:s.difference(e.combined,u),inverted:e.inverted1&&!e.inverted2}},selectDifferenceRev:function(e){return{segments:s.differenceRev(e.combined,u),inverted:!e.inverted1&&e.inverted2}},selectXor:function(e){return{segments:s.xor(e.combined,u),inverted:e.inverted1!==e.inverted2}},polygon:function(e){return{regions:l(e.segments,f,u),inverted:e.inverted}},polygonFromGeoJSON:function(e){return c.toPolygon(n,e)},polygonToGeoJSON:function(e){return c.fromPolygon(n,f,e)},union:function(e,t){return d(e,t,n.selectUnion)},intersect:function(e,t){return d(e,t,n.selectIntersect)},difference:function(e,t){return d(e,t,n.selectDifference)},differenceRev:function(e,t){return d(e,t,n.selectDifferenceRev)},xor:function(e,t){return d(e,t,n.selectXor)}},"object"==typeof window&&(window.PolyBool=n),t.exports=n},{"./lib/build-log":273,"./lib/epsilon":274,"./lib/geojson":275,"./lib/intersecter":276,"./lib/segment-chainer":278,"./lib/segment-selector":279}],273:[function(e,t,r){t.exports=function(){var e,t=0,r=!1;function n(t,r){return e.list.push({type:t,data:r?JSON.parse(JSON.stringify(r)):void 0}),e}return e={list:[],segmentId:function(){return t++},checkIntersection:function(e,t){return n("check",{seg1:e,seg2:t})},segmentChop:function(e,t){return n("div_seg",{seg:e,pt:t}),n("chop",{seg:e,pt:t})},statusRemove:function(e){return n("pop_seg",{seg:e})},segmentUpdate:function(e){return n("seg_update",{seg:e})},segmentNew:function(e,t){return n("new_seg",{seg:e,primary:t})},segmentRemove:function(e){return n("rem_seg",{seg:e})},tempStatus:function(e,t,r){return n("temp_status",{seg:e,above:t,below:r})},rewind:function(e){return n("rewind",{seg:e})},status:function(e,t,r){return n("status",{seg:e,above:t,below:r})},vert:function(t){return t===r?e:(r=t,n("vert",{x:t}))},log:function(e){return"string"!=typeof e&&(e=JSON.stringify(e,!1," ")),n("log",{txt:e})},reset:function(){return n("reset")},selected:function(e){return n("selected",{segs:e})},chainStart:function(e){return n("chain_start",{seg:e})},chainRemoveHead:function(e,t){return n("chain_rem_head",{index:e,pt:t})},chainRemoveTail:function(e,t){return n("chain_rem_tail",{index:e,pt:t})},chainNew:function(e,t){return n("chain_new",{pt1:e,pt2:t})},chainMatch:function(e){return n("chain_match",{index:e})},chainClose:function(e){return n("chain_close",{index:e})},chainAddHead:function(e,t){return n("chain_add_head",{index:e,pt:t})},chainAddTail:function(e,t){return n("chain_add_tail",{index:e,pt:t})},chainConnect:function(e,t){return n("chain_con",{index1:e,index2:t})},chainReverse:function(e){return n("chain_rev",{index:e})},chainJoin:function(e,t){return n("chain_join",{index1:e,index2:t})},done:function(){return n("done")}}}},{}],274:[function(e,t,r){t.exports=function(e){"number"!=typeof e&&(e=1e-10);var t={epsilon:function(t){return"number"==typeof t&&(e=t),e},pointAboveOrOnLine:function(t,r,n){var a=r[0],i=r[1],o=n[0],l=n[1],s=t[0];return(o-a)*(t[1]-i)-(l-i)*(s-a)>=-e},pointBetween:function(t,r,n){var a=t[1]-r[1],i=n[0]-r[0],o=t[0]-r[0],l=n[1]-r[1],s=o*i+a*l;return!(s<e||s-(i*i+l*l)>-e)},pointsSameX:function(t,r){return Math.abs(t[0]-r[0])<e},pointsSameY:function(t,r){return Math.abs(t[1]-r[1])<e},pointsSame:function(e,r){return t.pointsSameX(e,r)&&t.pointsSameY(e,r)},pointsCompare:function(e,r){return t.pointsSameX(e,r)?t.pointsSameY(e,r)?0:e[1]<r[1]?-1:1:e[0]<r[0]?-1:1},pointsCollinear:function(t,r,n){var a=t[0]-r[0],i=t[1]-r[1],o=r[0]-n[0],l=r[1]-n[1];return Math.abs(a*l-o*i)<e},linesIntersect:function(t,r,n,a){var i=r[0]-t[0],o=r[1]-t[1],l=a[0]-n[0],s=a[1]-n[1],c=i*s-o*l;if(Math.abs(c)<e)return!1;var u=t[0]-n[0],f=t[1]-n[1],d=(l*f-s*u)/c,p=(i*f-o*u)/c,h={alongA:0,alongB:0,pt:[t[0]+d*i,t[1]+d*o]};return h.alongA=d<=-e?-2:d<e?-1:d-1<=-e?0:d-1<e?1:2,h.alongB=p<=-e?-2:p<e?-1:p-1<=-e?0:p-1<e?1:2,h},pointInsideRegion:function(t,r){for(var n=t[0],a=t[1],i=r[r.length-1][0],o=r[r.length-1][1],l=!1,s=0;s<r.length;s++){var c=r[s][0],u=r[s][1];u-a>e!=o-a>e&&(i-c)*(a-u)/(o-u)+c-n>e&&(l=!l),i=c,o=u}return l}};return t}},{}],275:[function(e,t,r){var n={toPolygon:function(e,t){function r(t){if(t.length<=0)return e.segments({inverted:!1,regions:[]});function r(t){var r=t.slice(0,t.length-1);return e.segments({inverted:!1,regions:[r]})}for(var n=r(t[0]),a=1;a<t.length;a++)n=e.selectDifference(e.combine(n,r(t[a])));return n}if("Polygon"===t.type)return e.polygon(r(t.coordinates));if("MultiPolygon"===t.type){for(var n=e.segments({inverted:!1,regions:[]}),a=0;a<t.coordinates.length;a++)n=e.selectUnion(e.combine(n,r(t.coordinates[a])));return e.polygon(n)}throw new Error("PolyBool: Cannot convert GeoJSON object to PolyBool polygon")},fromPolygon:function(e,t,r){function n(e,r){return t.pointInsideRegion([.5*(e[0][0]+e[1][0]),.5*(e[0][1]+e[1][1])],r)}function a(e){return{region:e,children:[]}}r=e.polygon(e.segments(r));var i=a(null);function o(e,t){for(var r=0;r<e.children.length;r++){if(n(t,(l=e.children[r]).region))return void o(l,t)}var i=a(t);for(r=0;r<e.children.length;r++){var l;n((l=e.children[r]).region,t)&&(i.children.push(l),e.children.splice(r,1),r--)}e.children.push(i)}for(var l=0;l<r.regions.length;l++){var s=r.regions[l];s.length<3||o(i,s)}function c(e,t){for(var r=0,n=e[e.length-1][0],a=e[e.length-1][1],i=[],o=0;o<e.length;o++){var l=e[o][0],s=e[o][1];i.push([l,s]),r+=s*n-l*a,n=l,a=s}return r<0!==t&&i.reverse(),i.push([i[0][0],i[0][1]]),i}var u=[];function f(e){var t=[c(e.region,!1)];u.push(t);for(var r=0;r<e.children.length;r++)t.push(d(e.children[r]))}function d(e){for(var t=0;t<e.children.length;t++)f(e.children[t]);return c(e.region,!0)}for(l=0;l<i.children.length;l++)f(i.children[l]);return u.length<=0?{type:"Polygon",coordinates:[]}:1==u.length?{type:"Polygon",coordinates:u[0]}:{type:"MultiPolygon",coordinates:u}}};t.exports=n},{}],276:[function(e,t,r){var n=e("./linked-list");t.exports=function(e,t,r){function a(e,t,n){return{id:r?r.segmentId():-1,start:e,end:t,myFill:{above:n.myFill.above,below:n.myFill.below},otherFill:null}}var i=n.create();function o(e,r){i.insertBefore(e,function(n){return function(e,r,n,a,i,o){var l=t.pointsCompare(r,i);return 0!==l?l:t.pointsSame(n,o)?0:e!==a?e?1:-1:t.pointAboveOrOnLine(n,a?i:o,a?o:i)?1:-1}(e.isStart,e.pt,r,n.isStart,n.pt,n.other.pt)<0})}function l(e,t){var r=function(e,t){var r=n.node({isStart:!0,pt:e.start,seg:e,primary:t,other:null,status:null});return o(r,e.end),r}(e,t);return function(e,t,r){var a=n.node({isStart:!1,pt:t.end,seg:t,primary:r,other:e,status:null});e.other=a,o(a,e.pt)}(r,e,t),r}function s(e,t){var n=a(t,e.seg.end,e.seg);return function(e,t){r&&r.segmentChop(e.seg,t),e.other.remove(),e.seg.end=t,e.other.pt=t,o(e.other,e.pt)}(e,t),l(n,e.primary)}function c(a,o){var l=n.create();function c(e){return l.findTransition(function(r){var n,a,i,o,l,s;return n=e,a=r.ev,i=n.seg.start,o=n.seg.end,l=a.seg.start,s=a.seg.end,(t.pointsCollinear(i,l,s)?t.pointsCollinear(o,l,s)?1:t.pointAboveOrOnLine(o,l,s)?1:-1:t.pointAboveOrOnLine(i,l,s)?1:-1)>0})}function u(e,n){var a=e.seg,i=n.seg,o=a.start,l=a.end,c=i.start,u=i.end;r&&r.checkIntersection(a,i);var f=t.linesIntersect(o,l,c,u);if(!1===f){if(!t.pointsCollinear(o,l,c))return!1;if(t.pointsSame(o,u)||t.pointsSame(l,c))return!1;var d=t.pointsSame(o,c),p=t.pointsSame(l,u);if(d&&p)return n;var h=!d&&t.pointBetween(o,c,u),g=!p&&t.pointBetween(l,c,u);if(d)return g?s(n,l):s(e,u),n;h&&(p||(g?s(n,l):s(e,u)),s(n,o))}else 0===f.alongA&&(-1===f.alongB?s(e,c):0===f.alongB?s(e,f.pt):1===f.alongB&&s(e,u)),0===f.alongB&&(-1===f.alongA?s(n,o):0===f.alongA?s(n,f.pt):1===f.alongA&&s(n,l));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 p=c(d),h=p.before?p.before.ev:null,g=p.after?p.after.ev:null;function v(){if(h){var e=u(d,h);if(e)return e}return!!g&&u(d,g)}r&&r.tempStatus(d.seg,!!h&&h.seg,!!g&&g.seg);var m,y,x=v();if(x)e?(y=null===d.seg.myFill.below||d.seg.myFill.above!==d.seg.myFill.below)&&(x.seg.myFill.above=!x.seg.myFill.above):x.seg.otherFill=d.seg.myFill,r&&r.segmentUpdate(x.seg),d.other.remove(),d.remove();if(i.getHead()!==d){r&&r.rewind(d.seg);continue}e?(y=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=y?!d.seg.myFill.below:d.seg.myFill.below):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,!!h&&h.seg,!!g&&g.seg),d.other.status=p.insert(n.node({ev:d}))}else{var b=d.status;if(null===b)throw new Error("PolyBool: Zero-length segment detected; your epsilon is probably too small or too large");if(l.exists(b.prev)&&l.exists(b.next)&&u(b.prev.ev,b.next.ev),r&&r.statusRemove(b.ev.seg),b.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 e?{addRegion:function(e){for(var n,a,i,o=e[e.length-1],s=0;s<e.length;s++){n=o,o=e[s];var c=t.pointsCompare(n,o);0!==c&&l((a=c<0?n:o,i=c<0?o:n,{id:r?r.segmentId():-1,start:a,end:i,myFill:{above:null,below:null},otherFill:null}),!0)}},calculate:function(e){return c(e,!1)}}:{calculate:function(e,t,r,n){return e.forEach(function(e){l(a(e.start,e.end,e),!0)}),r.forEach(function(e){l(a(e.start,e.end,e),!1)}),c(t,n)}}}},{"./linked-list":277}],277:[function(e,t,r){t.exports={create:function(){var e={root:{root:!0,next:null},exists:function(t){return null!==t&&t!==e.root},isEmpty:function(){return null===e.root.next},getHead:function(){return e.root.next},insertBefore:function(t,r){for(var n=e.root,a=e.root.next;null!==a;){if(r(a))return t.prev=a.prev,t.next=a,a.prev.next=t,void(a.prev=t);n=a,a=a.next}n.next=t,t.prev=n,t.next=null},findTransition:function(t){for(var r=e.root,n=e.root.next;null!==n&&!t(n);)r=n,n=n.next;return{before:r===e.root?null:r,after:n,insert:function(e){return e.prev=r,e.next=n,r.next=e,null!==n&&(n.prev=e),e}}}};return e},node:function(e){return e.prev=null,e.next=null,e.remove=function(){e.prev.next=e.next,e.next&&(e.next.prev=e.prev),e.prev=null,e.next=null},e}}},{}],278:[function(e,t,r){t.exports=function(e,t,r){var n=[],a=[];return e.forEach(function(e){var i=e.start,o=e.end;if(t.pointsSame(i,o))console.warn("PolyBool: Warning: Zero-length segment detected; your epsilon is probably too small or too large");else{r&&r.chainStart(e);for(var l={index:0,matches_head:!1,matches_pt1:!1},s={index:0,matches_head:!1,matches_pt1:!1},c=l,u=0;u<n.length;u++){var f=(v=n[u])[0],d=(v[1],v[v.length-1]);if(v[v.length-2],t.pointsSame(f,i)){if(T(u,!0,!0))break}else if(t.pointsSame(f,o)){if(T(u,!0,!1))break}else if(t.pointsSame(d,i)){if(T(u,!1,!0))break}else if(t.pointsSame(d,o)&&T(u,!1,!1))break}if(c===l)return n.push([i,o]),void(r&&r.chainNew(i,o));if(c===s){r&&r.chainMatch(l.index);var p=l.index,h=l.matches_pt1?o:i,g=l.matches_head,v=n[p],m=g?v[0]:v[v.length-1],y=g?v[1]:v[v.length-2],x=g?v[v.length-1]:v[0],b=g?v[v.length-2]:v[1];return t.pointsCollinear(y,m,h)&&(g?(r&&r.chainRemoveHead(l.index,h),v.shift()):(r&&r.chainRemoveTail(l.index,h),v.pop()),m=y),t.pointsSame(x,h)?(n.splice(p,1),t.pointsCollinear(b,x,m)&&(g?(r&&r.chainRemoveTail(l.index,m),v.pop()):(r&&r.chainRemoveHead(l.index,m),v.shift())),r&&r.chainClose(l.index),void a.push(v)):void(g?(r&&r.chainAddHead(l.index,h),v.unshift(h)):(r&&r.chainAddTail(l.index,h),v.push(h)))}var _=l.index,w=s.index;r&&r.chainConnect(_,w);var k=n[_].length<n[w].length;l.matches_head?s.matches_head?k?(M(_),A(_,w)):(M(w),A(w,_)):A(w,_):s.matches_head?A(_,w):k?(M(_),A(w,_)):(M(w),A(_,w))}function T(e,t,r){return c.index=e,c.matches_head=t,c.matches_pt1=r,c===l?(c=s,!1):(c=null,!0)}function M(e){r&&r.chainReverse(e),n[e].reverse()}function A(e,a){var i=n[e],o=n[a],l=i[i.length-1],s=i[i.length-2],c=o[0],u=o[1];t.pointsCollinear(s,l,c)&&(r&&r.chainRemoveTail(e,l),i.pop(),l=s),t.pointsCollinear(l,c,u)&&(r&&r.chainRemoveHead(a,c),o.shift()),r&&r.chainJoin(e,a),n[e]=i.concat(o),n.splice(a,1)}}),a}},{}],279:[function(e,t,r){function n(e,t,r){var n=[];return e.forEach(function(e){var a=(e.myFill.above?8:0)+(e.myFill.below?4:0)+(e.otherFill&&e.otherFill.above?2:0)+(e.otherFill&&e.otherFill.below?1:0);0!==t[a]&&n.push({id:r?r.segmentId():-1,start:e.start,end:e.end,myFill:{above:1===t[a],below:2===t[a]},otherFill:null})}),r&&r.selected(n),n}var a={union:function(e,t){return n(e,[0,2,1,0,2,2,0,0,1,0,1,0,0,0,0,0],t)},intersect:function(e,t){return n(e,[0,0,0,0,0,2,0,2,0,0,1,1,0,2,1,0],t)},difference:function(e,t){return n(e,[0,0,0,0,2,0,2,0,1,1,0,0,0,1,2,0],t)},differenceRev:function(e,t){return n(e,[0,2,1,0,0,0,1,1,0,2,0,2,0,0,0,0],t)},xor:function(e,t){return n(e,[0,2,1,0,2,0,0,1,1,0,0,2,0,1,2,0],t)}};t.exports=a},{}],280:[function(e,t,r){var n,a,i=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function l(){throw new Error("clearTimeout has not been defined")}function s(e){if(n===setTimeout)return setTimeout(e,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(e){n=o}try{a="function"==typeof clearTimeout?clearTimeout:l}catch(e){a=l}}();var c,u=[],f=!1,d=-1;function p(){f&&c&&(f=!1,c.length?u=c.concat(u):d=-1,u.length&&h())}function h(){if(!f){var e=s(p);f=!0;for(var t=u.length;t;){for(c=u,u=[];++d<t;)c&&c[d].run();d=-1,t=u.length}c=null,f=!1,function(e){if(a===clearTimeout)return clearTimeout(e);if((a===l||!a)&&clearTimeout)return a=clearTimeout,clearTimeout(e);try{a(e)}catch(t){try{return a.call(null,e)}catch(t){return a.call(this,e)}}}(e)}}function g(e,t){this.fun=e,this.array=t}function v(){}i.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];u.push(new g(e,t)),1!==u.length||f||s(h)},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(e){return[]},i.binding=function(e){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},{}],281:[function(e,t,r){!function(e){var r=/^\s+/,n=/\s+$/,a=0,i=e.round,o=e.min,l=e.max,s=e.random;function c(t,s){if(t=t||"",s=s||{},t instanceof c)return t;if(!(this instanceof c))return new c(t,s);var u=function(t){var a={r:0,g:0,b:0},i=1,s=null,c=null,u=null,f=!1,d=!1;"string"==typeof t&&(t=function(e){e=e.replace(r,"").replace(n,"").toLowerCase();var t,a=!1;if(L[e])e=L[e],a=!0;else if("transparent"==e)return{r:0,g:0,b:0,a:0,format:"name"};if(t=B.rgb.exec(e))return{r:t[1],g:t[2],b:t[3]};if(t=B.rgba.exec(e))return{r:t[1],g:t[2],b:t[3],a:t[4]};if(t=B.hsl.exec(e))return{h:t[1],s:t[2],l:t[3]};if(t=B.hsla.exec(e))return{h:t[1],s:t[2],l:t[3],a:t[4]};if(t=B.hsv.exec(e))return{h:t[1],s:t[2],v:t[3]};if(t=B.hsva.exec(e))return{h:t[1],s:t[2],v:t[3],a:t[4]};if(t=B.hex8.exec(e))return{r:D(t[1]),g:D(t[2]),b:D(t[3]),a:I(t[4]),format:a?"name":"hex8"};if(t=B.hex6.exec(e))return{r:D(t[1]),g:D(t[2]),b:D(t[3]),format:a?"name":"hex"};if(t=B.hex4.exec(e))return{r:D(t[1]+""+t[1]),g:D(t[2]+""+t[2]),b:D(t[3]+""+t[3]),a:I(t[4]+""+t[4]),format:a?"name":"hex8"};if(t=B.hex3.exec(e))return{r:D(t[1]+""+t[1]),g:D(t[2]+""+t[2]),b:D(t[3]+""+t[3]),format:a?"name":"hex"};return!1}(t));"object"==typeof t&&(H(t.r)&&H(t.g)&&H(t.b)?(p=t.r,h=t.g,g=t.b,a={r:255*O(p,255),g:255*O(h,255),b:255*O(g,255)},f=!0,d="%"===String(t.r).substr(-1)?"prgb":"rgb"):H(t.h)&&H(t.s)&&H(t.v)?(s=R(t.s),c=R(t.v),a=function(t,r,n){t=6*O(t,360),r=O(r,100),n=O(n,100);var a=e.floor(t),i=t-a,o=n*(1-r),l=n*(1-i*r),s=n*(1-(1-i)*r),c=a%6;return{r:255*[n,l,o,o,s,n][c],g:255*[s,n,n,l,o,o][c],b:255*[o,o,s,n,n,l][c]}}(t.h,s,c),f=!0,d="hsv"):H(t.h)&&H(t.s)&&H(t.l)&&(s=R(t.s),u=R(t.l),a=function(e,t,r){var n,a,i;function o(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+6*(t-e)*r:r<.5?t:r<2/3?e+(t-e)*(2/3-r)*6:e}if(e=O(e,360),t=O(t,100),r=O(r,100),0===t)n=a=i=r;else{var l=r<.5?r*(1+t):r+t-r*t,s=2*r-l;n=o(s,l,e+1/3),a=o(s,l,e),i=o(s,l,e-1/3)}return{r:255*n,g:255*a,b:255*i}}(t.h,s,u),f=!0,d="hsl"),t.hasOwnProperty("a")&&(i=t.a));var p,h,g;return i=C(i),{ok:f,format:t.format||d,r:o(255,l(a.r,0)),g:o(255,l(a.g,0)),b:o(255,l(a.b,0)),a:i}}(t);this._originalInput=t,this._r=u.r,this._g=u.g,this._b=u.b,this._a=u.a,this._roundA=i(100*this._a)/100,this._format=s.format||u.format,this._gradientType=s.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=u.ok,this._tc_id=a++}function u(e,t,r){e=O(e,255),t=O(t,255),r=O(r,255);var n,a,i=l(e,t,r),s=o(e,t,r),c=(i+s)/2;if(i==s)n=a=0;else{var u=i-s;switch(a=c>.5?u/(2-i-s):u/(i+s),i){case e:n=(t-r)/u+(t<r?6:0);break;case t:n=(r-e)/u+2;break;case r:n=(e-t)/u+4}n/=6}return{h:n,s:a,l:c}}function f(e,t,r){e=O(e,255),t=O(t,255),r=O(r,255);var n,a,i=l(e,t,r),s=o(e,t,r),c=i,u=i-s;if(a=0===i?0:u/i,i==s)n=0;else{switch(i){case e:n=(t-r)/u+(t<r?6:0);break;case t:n=(r-e)/u+2;break;case r:n=(e-t)/u+4}n/=6}return{h:n,s:a,v:c}}function d(e,t,r,n){var a=[z(i(e).toString(16)),z(i(t).toString(16)),z(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 p(e,t,r,n){return[z(E(n)),z(i(e).toString(16)),z(i(t).toString(16)),z(i(r).toString(16))].join("")}function h(e,t){t=0===t?0:t||10;var r=c(e).toHsl();return r.s-=t/100,r.s=P(r.s),c(r)}function g(e,t){t=0===t?0:t||10;var r=c(e).toHsl();return r.s+=t/100,r.s=P(r.s),c(r)}function v(e){return c(e).desaturate(100)}function m(e,t){t=0===t?0:t||10;var r=c(e).toHsl();return r.l+=t/100,r.l=P(r.l),c(r)}function y(e,t){t=0===t?0:t||10;var r=c(e).toRgb();return r.r=l(0,o(255,r.r-i(-t/100*255))),r.g=l(0,o(255,r.g-i(-t/100*255))),r.b=l(0,o(255,r.b-i(-t/100*255))),c(r)}function x(e,t){t=0===t?0:t||10;var r=c(e).toHsl();return r.l-=t/100,r.l=P(r.l),c(r)}function b(e,t){var r=c(e).toHsl(),n=(r.h+t)%360;return r.h=n<0?360+n:n,c(r)}function _(e){var t=c(e).toHsl();return t.h=(t.h+180)%360,c(t)}function w(e){var t=c(e).toHsl(),r=t.h;return[c(e),c({h:(r+120)%360,s:t.s,l:t.l}),c({h:(r+240)%360,s:t.s,l:t.l})]}function k(e){var t=c(e).toHsl(),r=t.h;return[c(e),c({h:(r+90)%360,s:t.s,l:t.l}),c({h:(r+180)%360,s:t.s,l:t.l}),c({h:(r+270)%360,s:t.s,l:t.l})]}function T(e){var t=c(e).toHsl(),r=t.h;return[c(e),c({h:(r+72)%360,s:t.s,l:t.l}),c({h:(r+216)%360,s:t.s,l:t.l})]}function M(e,t,r){t=t||6,r=r||30;var n=c(e).toHsl(),a=360/r,i=[c(e)];for(n.h=(n.h-(a*t>>1)+720)%360;--t;)n.h=(n.h+a)%360,i.push(c(n));return i}function A(e,t){t=t||6;for(var r=c(e).toHsv(),n=r.h,a=r.s,i=r.v,o=[],l=1/t;t--;)o.push(c({h:n,s:a,v:i})),i=(i+l)%1;return o}c.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 e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},getLuminance:function(){var t,r,n,a=this.toRgb();return t=a.r/255,r=a.g/255,n=a.b/255,.2126*(t<=.03928?t/12.92:e.pow((t+.055)/1.055,2.4))+.7152*(r<=.03928?r/12.92:e.pow((r+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:e.pow((n+.055)/1.055,2.4))},setAlpha:function(e){return this._a=C(e),this._roundA=i(100*this._a)/100,this},toHsv:function(){var e=f(this._r,this._g,this._b);return{h:360*e.h,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=f(this._r,this._g,this._b),t=i(360*e.h),r=i(100*e.s),n=i(100*e.v);return 1==this._a?"hsv("+t+", "+r+"%, "+n+"%)":"hsva("+t+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var e=u(this._r,this._g,this._b);return{h:360*e.h,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=u(this._r,this._g,this._b),t=i(360*e.h),r=i(100*e.s),n=i(100*e.l);return 1==this._a?"hsl("+t+", "+r+"%, "+n+"%)":"hsla("+t+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(e){return d(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){return function(e,t,r,n,a){var o=[z(i(e).toString(16)),z(i(t).toString(16)),z(i(r).toString(16)),z(E(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,e)},toHex8String:function(e){return"#"+this.toHex8(e)},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*O(this._r,255))+"%",g:i(100*O(this._g,255))+"%",b:i(100*O(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+i(100*O(this._r,255))+"%, "+i(100*O(this._g,255))+"%, "+i(100*O(this._b,255))+"%)":"rgba("+i(100*O(this._r,255))+"%, "+i(100*O(this._g,255))+"%, "+i(100*O(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(e){var t="#"+p(this._r,this._g,this._b,this._a),r=t,n=this._gradientType?"GradientType = 1, ":"";if(e){var a=c(e);r="#"+p(a._r,a._g,a._b,a._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+t+",endColorstr="+r+")"},toString:function(e){var t=!!e;e=e||this._format;var r=!1,n=this._a<1&&this._a>=0;return t||!n||"hex"!==e&&"hex6"!==e&&"hex3"!==e&&"hex4"!==e&&"hex8"!==e&&"name"!==e?("rgb"===e&&(r=this.toRgbString()),"prgb"===e&&(r=this.toPercentageRgbString()),"hex"!==e&&"hex6"!==e||(r=this.toHexString()),"hex3"===e&&(r=this.toHexString(!0)),"hex4"===e&&(r=this.toHex8String(!0)),"hex8"===e&&(r=this.toHex8String()),"name"===e&&(r=this.toName()),"hsl"===e&&(r=this.toHslString()),"hsv"===e&&(r=this.toHsvString()),r||this.toHexString()):"name"===e&&0===this._a?this.toName():this.toRgbString()},clone:function(){return c(this.toString())},_applyModification:function(e,t){var r=e.apply(null,[this].concat([].slice.call(t)));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(x,arguments)},desaturate:function(){return this._applyModification(h,arguments)},saturate:function(){return this._applyModification(g,arguments)},greyscale:function(){return this._applyModification(v,arguments)},spin:function(){return this._applyModification(b,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(M,arguments)},complement:function(){return this._applyCombination(_,arguments)},monochromatic:function(){return this._applyCombination(A,arguments)},splitcomplement:function(){return this._applyCombination(T,arguments)},triad:function(){return this._applyCombination(w,arguments)},tetrad:function(){return this._applyCombination(k,arguments)}},c.fromRatio=function(e,t){if("object"==typeof e){var r={};for(var n in e)e.hasOwnProperty(n)&&(r[n]="a"===n?e[n]:R(e[n]));e=r}return c(e,t)},c.equals=function(e,t){return!(!e||!t)&&c(e).toRgbString()==c(t).toRgbString()},c.random=function(){return c.fromRatio({r:s(),g:s(),b:s()})},c.mix=function(e,t,r){r=0===r?0:r||50;var n=c(e).toRgb(),a=c(t).toRgb(),i=r/100;return c({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})},c.readability=function(t,r){var n=c(t),a=c(r);return(e.max(n.getLuminance(),a.getLuminance())+.05)/(e.min(n.getLuminance(),a.getLuminance())+.05)},c.isReadable=function(e,t,r){var n,a,i=c.readability(e,t);switch(a=!1,(n=function(e){var t,r;t=((e=e||{level:"AA",size:"small"}).level||"AA").toUpperCase(),r=(e.size||"small").toLowerCase(),"AA"!==t&&"AAA"!==t&&(t="AA");"small"!==r&&"large"!==r&&(r="small");return{level:t,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},c.mostReadable=function(e,t,r){var n,a,i,o,l=null,s=0;a=(r=r||{}).includeFallbackColors,i=r.level,o=r.size;for(var u=0;u<t.length;u++)(n=c.readability(e,t[u]))>s&&(s=n,l=c(t[u]));return c.isReadable(e,l,{level:i,size:o})||!a?l:(r.includeFallbackColors=!1,c.mostReadable(e,["#fff","#000"],r))};var L=c.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=c.hexNames=function(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[e[r]]=r);return t}(L);function C(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function O(t,r){(function(e){return"string"==typeof e&&-1!=e.indexOf(".")&&1===parseFloat(e)})(t)&&(t="100%");var n=function(e){return"string"==typeof e&&-1!=e.indexOf("%")}(t);return t=o(r,l(0,parseFloat(t))),n&&(t=parseInt(t*r,10)/100),e.abs(t-r)<1e-6?1:t%r/parseFloat(r)}function P(e){return o(1,l(0,e))}function D(e){return parseInt(e,16)}function z(e){return 1==e.length?"0"+e:""+e}function R(e){return e<=1&&(e=100*e+"%"),e}function E(t){return e.round(255*parseFloat(t)).toString(16)}function I(e){return D(e)/255}var F,N,j,B=(N="[\\s|\\(]+("+(F="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+F+")[,|\\s]+("+F+")\\s*\\)?",j="[\\s|\\(]+("+F+")[,|\\s]+("+F+")[,|\\s]+("+F+")[,|\\s]+("+F+")\\s*\\)?",{CSS_UNIT:new RegExp(F),rgb:new RegExp("rgb"+N),rgba:new RegExp("rgba"+j),hsl:new RegExp("hsl"+N),hsla:new RegExp("hsla"+j),hsv:new RegExp("hsv"+N),hsva:new RegExp("hsva"+j),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 H(e){return!!B.CSS_UNIT.exec(e)}void 0!==t&&t.exports?t.exports=c:window.tinycolor=c}(Math)},{}],282:[function(e,t,r){var n=e("plotly.js/lib/core");n.register([e("plotly.js/lib/scatter")]),t.exports=n},{"plotly.js/lib/core":12,"plotly.js/lib/scatter":13}],283:[function(e,t,r){const n=e("./plotly-custom.js");t.exports=class{constructor(){this.outputs=document.getElementById("outputs"),this.divPlot=document.createElement("div"),this.divPlot.style.width="100%",this.divPlot.style.maxWidth="900px",this.outputs.appendChild(this.divPlot),this.divPlotTest=document.createElement("div"),this.divPlotTest.style.width="100%",this.divPlotTest.style.maxWidth="900px",this.outputs.appendChild(this.divPlotTest),this.pOpts=document.createElement("p"),this.outputs.appendChild(this.pOpts)}render(e){const{ts:t,forecast:r,forecastTest:a,params:i}=e,o=[{type:"scatter",mode:"lines",name:"Original timeseries",x:t.map((e,t)=>t),y:t,line:{color:"#8F8F8F"}},{type:"scatter",mode:"lines",name:"Forecast",x:r[0].map((e,r)=>r+t.length),y:r[0],line:{color:"#17BECF"}}];if(r[1]&&Array.isArray(r[1])){const e={name:"Forecast",showlegend:!1,type:"scatter",fill:"tonexty",fillcolor:"rgba(0, 0, 0, 0.1)",line:{color:"transparent"},x:r[0].map((e,r)=>r+t.length),y:r[1].map((e,t)=>r[0][t]+1.96*Math.sqrt(e))};for(let t=r[0].length-1;t>=0;t--)e.x.push(e.x[t]),e.y.push(r[0][t]-1.96*Math.sqrt(r[1][t]));o.unshift(e)}n.newPlot(this.divPlot,o,{title:r[0].length+" steps forecast"});const l=t.slice(0,t.length-a[0].length),s=[{type:"scatter",mode:"lines",name:"Original timeseries",x:l.map((e,t)=>t),y:l,line:{color:"#8F8F8F"}},{type:"scatter",mode:"lines",name:"True values",x:a[0].map((e,t)=>t+l.length),y:t.slice(l.length),line:{dash:"dot",color:"#8F8F8F"}},{type:"scatter",mode:"lines",name:"Forecast",x:a[0].map((e,t)=>t+l.length),y:a[0],line:{color:"#17BECF"}}];n.newPlot(this.divPlotTest,s,{title:a[0].length+" steps test"}),this.pOpts.innerHTML=`\n <b>p</b>:${i.p}, <b>d</b>: ${i.d}, <b>q</b>: ${i.q}\n `}}},{"./plotly-custom.js":282}]},{},[283])(283)});