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

21 lines
1.0 MiB

/**
* plotly.js (finance - minified) v1.58.4
* Copyright 2012-2020, Plotly, Inc.
* All rights reserved.
* Licensed under the MIT license
*/
!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).Plotly=e()}}((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){"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', verdana, arial, sans-serif;position:fixed;top:50px;right:20px;z-index:10000;font-size:10pt;max-width:180px;","Y p":"margin:0;","Y .notifier-note":"min-width:180px;max-width:250px;border:1px solid #fff;z-index:3000;margin:0;background-color:#8c97af;background-color:rgba(140,151,175,0.9);color:#fff;padding:10px;overflow-wrap:break-word;word-wrap:break-word;-ms-hyphens:auto;-webkit-hyphens:auto;hyphens:auto;","Y .notifier-close":"color:#fff;opacity:0.8;float:right;padding:0 5px;background:none;border:none;font-size:20px;font-weight:bold;line-height:20px;","Y .notifier-close:hover":"color:#444;text-decoration:none;cursor:pointer;"};for(var i in a){var o=i.replace(/^,/," ,").replace(/X/g,".js-plotly-plot .plotly").replace(/Y/g,".plotly-notifier");n.addStyleRule(o,a[i])}},{"../src/lib":210}],2:[function(e,t,r){"use strict";t.exports=e("../src/traces/bar")},{"../src/traces/bar":316}],3:[function(e,t,r){"use strict";t.exports=e("../src/traces/candlestick")},{"../src/traces/candlestick":334}],4:[function(e,t,r){"use strict";t.exports=e("../src/core")},{"../src/core":191}],5:[function(e,t,r){"use strict";t.exports=e("../src/traces/funnel")},{"../src/traces/funnel":343}],6:[function(e,t,r){"use strict";t.exports=e("../src/traces/funnelarea")},{"../src/traces/funnelarea":352}],7:[function(e,t,r){"use strict";t.exports=e("../src/traces/histogram")},{"../src/traces/histogram":368}],8:[function(e,t,r){"use strict";var n=e("./core");n.register([e("./bar"),e("./histogram"),e("./pie"),e("./funnelarea"),e("./ohlc"),e("./candlestick"),e("./funnel"),e("./waterfall"),e("./indicator")]),t.exports=n},{"./bar":2,"./candlestick":3,"./core":4,"./funnel":5,"./funnelarea":6,"./histogram":7,"./indicator":9,"./ohlc":10,"./pie":11,"./waterfall":12}],9:[function(e,t,r){"use strict";t.exports=e("../src/traces/indicator")},{"../src/traces/indicator":375}],10:[function(e,t,r){"use strict";t.exports=e("../src/traces/ohlc")},{"../src/traces/ohlc":381}],11:[function(e,t,r){"use strict";t.exports=e("../src/traces/pie")},{"../src/traces/pie":392}],12:[function(e,t,r){"use strict";t.exports=e("../src/traces/waterfall")},{"../src/traces/waterfall":434}],13:[function(e,t,r){"use strict";var n,a="object"==typeof Reflect?Reflect:null,i=a&&"function"==typeof a.apply?a.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};n=a&&"function"==typeof a.ownKeys?a.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var o=Number.isNaN||function(e){return e!=e};function l(){l.init.call(this)}t.exports=l,t.exports.once=function(e,t){return new Promise((function(r,n){function a(){void 0!==i&&e.removeListener("error",i),r([].slice.call(arguments))}var i;"error"!==t&&(i=function(r){e.removeListener(t,a),n(r)},e.once("error",i)),e.once(t,a)}))},l.EventEmitter=l,l.prototype._events=void 0,l.prototype._eventsCount=0,l.prototype._maxListeners=void 0;var s=10;function c(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function u(e){return void 0===e._maxListeners?l.defaultMaxListeners:e._maxListeners}function f(e,t,r,n){var a,i,o,l;if(c(r),void 0===(i=e._events)?(i=e._events=Object.create(null),e._eventsCount=0):(void 0!==i.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),i=e._events),o=i[t]),void 0===o)o=i[t]=r,++e._eventsCount;else if("function"==typeof o?o=i[t]=n?[r,o]:[o,r]:n?o.unshift(r):o.push(r),(a=u(e))>0&&o.length>a&&!o.warned){o.warned=!0;var s=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");s.name="MaxListenersExceededWarning",s.emitter=e,s.type=t,s.count=o.length,l=s,console&&console.warn&&console.warn(l)}return e}function d(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},a=d.bind(n);return a.listener=r,n.wrapFn=a,a}function h(e,t,r){var n=e._events;if(void 0===n)return[];var a=n[t];return void 0===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(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==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}Object.defineProperty(l,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(e){if("number"!=typeof e||e<0||o(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");s=e}}),l.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},l.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||o(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},l.prototype.getMaxListeners=function(){return u(this)},l.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var n="error"===e,a=this._events;if(void 0!==a)n=n&&void 0===a.error;else if(!n)return!1;if(n){var o;if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var l=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw l.context=o,l}var s=a[e];if(void 0===s)return!1;if("function"==typeof s)i(s,this,t);else{var c=s.length,u=v(s,c);for(r=0;r<c;++r)i(u[r],this,t)}return!0},l.prototype.addListener=function(e,t){return f(this,e,t,!1)},l.prototype.on=l.prototype.addListener,l.prototype.prependListener=function(e,t){return f(this,e,t,!0)},l.prototype.once=function(e,t){return c(t),this.on(e,p(this,e,t)),this},l.prototype.prependOnceListener=function(e,t){return c(t),this.prependListener(e,p(this,e,t)),this},l.prototype.removeListener=function(e,t){var r,n,a,i,o;if(c(t),void 0===(n=this._events))return this;if(void 0===(r=n[e]))return this;if(r===t||r.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(a=-1,i=r.length-1;i>=0;i--)if(r[i]===t||r[i].listener===t){o=r[i].listener,a=i;break}if(a<0)return this;0===a?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,a),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,o||t)}return this},l.prototype.off=l.prototype.removeListener,l.prototype.removeAllListeners=function(e){var t,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){var a,i=Object.keys(r);for(n=0;n<i.length;++n)"removeListener"!==(a=i[n])&&this.removeAllListeners(a);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},l.prototype.listeners=function(e){return h(this,e,!0)},l.prototype.rawListeners=function(e){return h(this,e,!1)},l.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):g.call(e,t)},l.prototype.listenerCount=g,l.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}},{}],14:[function(e,t,r){!function(n,a){"object"==typeof r&&"undefined"!=typeof t?a(r,e("d3-time")):a((n=n||self).d3=n.d3||{},n.d3)}(this,(function(e,t){"use strict";function r(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function n(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function a(e,t,r){return{y:e,m:t,d:r,H:0,M:0,S:0,L:0}}function i(e){var i=e.dateTime,o=e.date,s=e.time,c=e.periods,u=e.days,f=e.shortDays,d=e.months,ye=e.shortMonths,xe=p(c),be=h(c),_e=p(u),we=h(u),Te=p(f),ke=h(f),Me=p(d),Ae=h(d),Le=p(ye),Se=h(ye),Ce={a:function(e){return f[e.getDay()]},A:function(e){return u[e.getDay()]},b:function(e){return ye[e.getMonth()]},B:function(e){return d[e.getMonth()]},c:null,d:E,e:E,f:B,H:I,I:F,j:N,L:H,m:j,M:V,p:function(e){return c[+(e.getHours()>=12)]},q:function(e){return 1+~~(e.getMonth()/3)},Q:ve,s:me,S:U,u:q,U:G,V:Z,w:Y,W:X,x:null,X:null,y:W,Y:Q,Z:J,"%":ge},Oe={a:function(e){return f[e.getUTCDay()]},A:function(e){return u[e.getUTCDay()]},b:function(e){return ye[e.getUTCMonth()]},B:function(e){return d[e.getUTCMonth()]},c:null,d:$,e:$,f:ne,H:K,I:ee,j:te,L:re,m:ae,M:ie,p:function(e){return c[+(e.getUTCHours()>=12)]},q:function(e){return 1+~~(e.getUTCMonth()/3)},Q:ve,s:me,S:oe,u:le,U:se,V:ce,w:ue,W:fe,x:null,X:null,y:de,Y:pe,Z:he,"%":ge},De={a:function(e,t,r){var n=Te.exec(t.slice(r));return n?(e.w=ke[n[0].toLowerCase()],r+n[0].length):-1},A:function(e,t,r){var n=_e.exec(t.slice(r));return n?(e.w=we[n[0].toLowerCase()],r+n[0].length):-1},b:function(e,t,r){var n=Le.exec(t.slice(r));return n?(e.m=Se[n[0].toLowerCase()],r+n[0].length):-1},B:function(e,t,r){var n=Me.exec(t.slice(r));return n?(e.m=Ae[n[0].toLowerCase()],r+n[0].length):-1},c:function(e,t,r){return Re(e,i,t,r)},d:M,e:M,f:D,H:L,I:L,j:A,L:O,m:k,M:S,p:function(e,t,r){var n=xe.exec(t.slice(r));return n?(e.p=be[n[0].toLowerCase()],r+n[0].length):-1},q:T,Q:z,s:R,S:C,u:v,U:m,V:y,w:g,W:x,x:function(e,t,r){return Re(e,o,t,r)},X:function(e,t,r){return Re(e,s,t,r)},y:_,Y:b,Z:w,"%":P};function Pe(e,t){return function(r){var n,a,i,o=[],s=-1,c=0,u=e.length;for(r instanceof Date||(r=new Date(+r));++s<u;)37===e.charCodeAt(s)&&(o.push(e.slice(c,s)),null!=(a=l[n=e.charAt(++s)])?n=e.charAt(++s):a="e"===n?" ":"0",(i=t[n])&&(n=i(r,a)),o.push(n),c=s+1);return o.push(e.slice(c,s)),o.join("")}}function ze(e,i){return function(o){var l,s,c=a(1900,void 0,1);if(Re(c,e,o+="",0)!=o.length)return null;if("Q"in c)return new Date(c.Q);if("s"in c)return new Date(1e3*c.s+("L"in c?c.L:0));if(i&&!("Z"in c)&&(c.Z=0),"p"in c&&(c.H=c.H%12+12*c.p),void 0===c.m&&(c.m="q"in c?c.q:0),"V"in c){if(c.V<1||c.V>53)return null;"w"in c||(c.w=1),"Z"in c?(s=(l=n(a(c.y,0,1))).getUTCDay(),l=s>4||0===s?t.utcMonday.ceil(l):t.utcMonday(l),l=t.utcDay.offset(l,7*(c.V-1)),c.y=l.getUTCFullYear(),c.m=l.getUTCMonth(),c.d=l.getUTCDate()+(c.w+6)%7):(s=(l=r(a(c.y,0,1))).getDay(),l=s>4||0===s?t.timeMonday.ceil(l):t.timeMonday(l),l=t.timeDay.offset(l,7*(c.V-1)),c.y=l.getFullYear(),c.m=l.getMonth(),c.d=l.getDate()+(c.w+6)%7)}else("W"in c||"U"in c)&&("w"in c||(c.w="u"in c?c.u%7:"W"in c?1:0),s="Z"in c?n(a(c.y,0,1)).getUTCDay():r(a(c.y,0,1)).getDay(),c.m=0,c.d="W"in c?(c.w+6)%7+7*c.W-(s+5)%7:c.w+7*c.U-(s+6)%7);return"Z"in c?(c.H+=c.Z/100|0,c.M+=c.Z%100,n(c)):r(c)}}function Re(e,t,r,n){for(var a,i,o=0,s=t.length,c=r.length;o<s;){if(n>=c)return-1;if(37===(a=t.charCodeAt(o++))){if(a=t.charAt(o++),!(i=De[a in l?t.charAt(o++):a])||(n=i(e,r,n))<0)return-1}else if(a!=r.charCodeAt(n++))return-1}return n}return Ce.x=Pe(o,Ce),Ce.X=Pe(s,Ce),Ce.c=Pe(i,Ce),Oe.x=Pe(o,Oe),Oe.X=Pe(s,Oe),Oe.c=Pe(i,Oe),{format:function(e){var t=Pe(e+="",Ce);return t.toString=function(){return e},t},parse:function(e){var t=ze(e+="",!1);return t.toString=function(){return e},t},utcFormat:function(e){var t=Pe(e+="",Oe);return t.toString=function(){return e},t},utcParse:function(e){var t=ze(e+="",!0);return t.toString=function(){return e},t}}}var o,l={"-":"",_:" ",0:"0"},s=/^\s*\d+/,c=/^%/,u=/[\\^$*+?|[\]().{}]/g;function f(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 d(e){return e.replace(u,"\\$&")}function p(e){return new RegExp("^(?:"+e.map(d).join("|")+")","i")}function h(e){for(var t={},r=-1,n=e.length;++r<n;)t[e[r].toLowerCase()]=r;return t}function g(e,t,r){var n=s.exec(t.slice(r,r+1));return n?(e.w=+n[0],r+n[0].length):-1}function v(e,t,r){var n=s.exec(t.slice(r,r+1));return n?(e.u=+n[0],r+n[0].length):-1}function m(e,t,r){var n=s.exec(t.slice(r,r+2));return n?(e.U=+n[0],r+n[0].length):-1}function y(e,t,r){var n=s.exec(t.slice(r,r+2));return n?(e.V=+n[0],r+n[0].length):-1}function x(e,t,r){var n=s.exec(t.slice(r,r+2));return n?(e.W=+n[0],r+n[0].length):-1}function b(e,t,r){var n=s.exec(t.slice(r,r+4));return n?(e.y=+n[0],r+n[0].length):-1}function _(e,t,r){var n=s.exec(t.slice(r,r+2));return n?(e.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function w(e,t,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(r,r+6));return n?(e.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function T(e,t,r){var n=s.exec(t.slice(r,r+1));return n?(e.q=3*n[0]-3,r+n[0].length):-1}function k(e,t,r){var n=s.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function M(e,t,r){var n=s.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function A(e,t,r){var n=s.exec(t.slice(r,r+3));return n?(e.m=0,e.d=+n[0],r+n[0].length):-1}function L(e,t,r){var n=s.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function S(e,t,r){var n=s.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function C(e,t,r){var n=s.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function O(e,t,r){var n=s.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function D(e,t,r){var n=s.exec(t.slice(r,r+6));return n?(e.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function P(e,t,r){var n=c.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function z(e,t,r){var n=s.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function R(e,t,r){var n=s.exec(t.slice(r));return n?(e.s=+n[0],r+n[0].length):-1}function E(e,t){return f(e.getDate(),t,2)}function I(e,t){return f(e.getHours(),t,2)}function F(e,t){return f(e.getHours()%12||12,t,2)}function N(e,r){return f(1+t.timeDay.count(t.timeYear(e),e),r,3)}function H(e,t){return f(e.getMilliseconds(),t,3)}function B(e,t){return H(e,t)+"000"}function j(e,t){return f(e.getMonth()+1,t,2)}function V(e,t){return f(e.getMinutes(),t,2)}function U(e,t){return f(e.getSeconds(),t,2)}function q(e){var t=e.getDay();return 0===t?7:t}function G(e,r){return f(t.timeSunday.count(t.timeYear(e)-1,e),r,2)}function Z(e,r){var n=e.getDay();return e=n>=4||0===n?t.timeThursday(e):t.timeThursday.ceil(e),f(t.timeThursday.count(t.timeYear(e),e)+(4===t.timeYear(e).getDay()),r,2)}function Y(e){return e.getDay()}function X(e,r){return f(t.timeMonday.count(t.timeYear(e)-1,e),r,2)}function W(e,t){return f(e.getFullYear()%100,t,2)}function Q(e,t){return f(e.getFullYear()%1e4,t,4)}function J(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+f(t/60|0,"0",2)+f(t%60,"0",2)}function $(e,t){return f(e.getUTCDate(),t,2)}function K(e,t){return f(e.getUTCHours(),t,2)}function ee(e,t){return f(e.getUTCHours()%12||12,t,2)}function te(e,r){return f(1+t.utcDay.count(t.utcYear(e),e),r,3)}function re(e,t){return f(e.getUTCMilliseconds(),t,3)}function ne(e,t){return re(e,t)+"000"}function ae(e,t){return f(e.getUTCMonth()+1,t,2)}function ie(e,t){return f(e.getUTCMinutes(),t,2)}function oe(e,t){return f(e.getUTCSeconds(),t,2)}function le(e){var t=e.getUTCDay();return 0===t?7:t}function se(e,r){return f(t.utcSunday.count(t.utcYear(e)-1,e),r,2)}function ce(e,r){var n=e.getUTCDay();return e=n>=4||0===n?t.utcThursday(e):t.utcThursday.ceil(e),f(t.utcThursday.count(t.utcYear(e),e)+(4===t.utcYear(e).getUTCDay()),r,2)}function ue(e){return e.getUTCDay()}function fe(e,r){return f(t.utcMonday.count(t.utcYear(e)-1,e),r,2)}function de(e,t){return f(e.getUTCFullYear()%100,t,2)}function pe(e,t){return f(e.getUTCFullYear()%1e4,t,4)}function he(){return"+0000"}function ge(){return"%"}function ve(e){return+e}function me(e){return Math.floor(+e/1e3)}function ye(t){return o=i(t),e.timeFormat=o.format,e.timeParse=o.parse,e.utcFormat=o.utcFormat,e.utcParse=o.utcParse,o}ye({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});var xe=Date.prototype.toISOString?function(e){return e.toISOString()}:e.utcFormat("%Y-%m-%dT%H:%M:%S.%LZ");var be=+new Date("2000-01-01T00:00:00.000Z")?function(e){var t=new Date(e);return isNaN(t)?null:t}:e.utcParse("%Y-%m-%dT%H:%M:%S.%LZ");e.isoFormat=xe,e.isoParse=be,e.timeFormatDefaultLocale=ye,e.timeFormatLocale=i,Object.defineProperty(e,"__esModule",{value:!0})}))},{"d3-time":15}],15:[function(e,t,r){!function(e,n){"object"==typeof r&&"undefined"!=typeof t?n(r):n((e=e||self).d3=e.d3||{})}(this,(function(e){"use strict";var t=new Date,r=new Date;function n(e,a,i,o){function l(t){return e(t=0===arguments.length?new Date:new Date(+t)),t}return l.floor=function(t){return e(t=new Date(+t)),t},l.ceil=function(t){return e(t=new Date(t-1)),a(t,1),e(t),t},l.round=function(e){var t=l(e),r=l.ceil(e);return e-t<r-e?t:r},l.offset=function(e,t){return a(e=new Date(+e),null==t?1:Math.floor(t)),e},l.range=function(t,r,n){var i,o=[];if(t=l.ceil(t),n=null==n?1:Math.floor(n),!(t<r&&n>0))return o;do{o.push(i=new Date(+t)),a(t,n),e(t)}while(i<t&&t<r);return o},l.filter=function(t){return n((function(r){if(r>=r)for(;e(r),!t(r);)r.setTime(r-1)}),(function(e,r){if(e>=e)if(r<0)for(;++r<=0;)for(;a(e,-1),!t(e););else for(;--r>=0;)for(;a(e,1),!t(e););}))},i&&(l.count=function(n,a){return t.setTime(+n),r.setTime(+a),e(t),e(r),Math.floor(i(t,r))},l.every=function(e){return e=Math.floor(e),isFinite(e)&&e>0?e>1?l.filter(o?function(t){return o(t)%e==0}:function(t){return l.count(0,t)%e==0}):l:null}),l}var a=n((function(){}),(function(e,t){e.setTime(+e+t)}),(function(e,t){return t-e}));a.every=function(e){return e=Math.floor(e),isFinite(e)&&e>0?e>1?n((function(t){t.setTime(Math.floor(t/e)*e)}),(function(t,r){t.setTime(+t+r*e)}),(function(t,r){return(r-t)/e})):a:null};var i=a.range,o=n((function(e){e.setTime(e-e.getMilliseconds())}),(function(e,t){e.setTime(+e+1e3*t)}),(function(e,t){return(t-e)/1e3}),(function(e){return e.getUTCSeconds()})),l=o.range,s=n((function(e){e.setTime(e-e.getMilliseconds()-1e3*e.getSeconds())}),(function(e,t){e.setTime(+e+6e4*t)}),(function(e,t){return(t-e)/6e4}),(function(e){return e.getMinutes()})),c=s.range,u=n((function(e){e.setTime(e-e.getMilliseconds()-1e3*e.getSeconds()-6e4*e.getMinutes())}),(function(e,t){e.setTime(+e+36e5*t)}),(function(e,t){return(t-e)/36e5}),(function(e){return e.getHours()})),f=u.range,d=n((function(e){e.setHours(0,0,0,0)}),(function(e,t){e.setDate(e.getDate()+t)}),(function(e,t){return(t-e-6e4*(t.getTimezoneOffset()-e.getTimezoneOffset()))/864e5}),(function(e){return e.getDate()-1})),p=d.range;function h(e){return n((function(t){t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)}),(function(e,t){e.setDate(e.getDate()+7*t)}),(function(e,t){return(t-e-6e4*(t.getTimezoneOffset()-e.getTimezoneOffset()))/6048e5}))}var g=h(0),v=h(1),m=h(2),y=h(3),x=h(4),b=h(5),_=h(6),w=g.range,T=v.range,k=m.range,M=y.range,A=x.range,L=b.range,S=_.range,C=n((function(e){e.setDate(1),e.setHours(0,0,0,0)}),(function(e,t){e.setMonth(e.getMonth()+t)}),(function(e,t){return t.getMonth()-e.getMonth()+12*(t.getFullYear()-e.getFullYear())}),(function(e){return e.getMonth()})),O=C.range,D=n((function(e){e.setMonth(0,1),e.setHours(0,0,0,0)}),(function(e,t){e.setFullYear(e.getFullYear()+t)}),(function(e,t){return t.getFullYear()-e.getFullYear()}),(function(e){return e.getFullYear()}));D.every=function(e){return isFinite(e=Math.floor(e))&&e>0?n((function(t){t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)}),(function(t,r){t.setFullYear(t.getFullYear()+r*e)})):null};var P=D.range,z=n((function(e){e.setUTCSeconds(0,0)}),(function(e,t){e.setTime(+e+6e4*t)}),(function(e,t){return(t-e)/6e4}),(function(e){return e.getUTCMinutes()})),R=z.range,E=n((function(e){e.setUTCMinutes(0,0,0)}),(function(e,t){e.setTime(+e+36e5*t)}),(function(e,t){return(t-e)/36e5}),(function(e){return e.getUTCHours()})),I=E.range,F=n((function(e){e.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCDate(e.getUTCDate()+t)}),(function(e,t){return(t-e)/864e5}),(function(e){return e.getUTCDate()-1})),N=F.range;function H(e){return n((function(t){t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCDate(e.getUTCDate()+7*t)}),(function(e,t){return(t-e)/6048e5}))}var B=H(0),j=H(1),V=H(2),U=H(3),q=H(4),G=H(5),Z=H(6),Y=B.range,X=j.range,W=V.range,Q=U.range,J=q.range,$=G.range,K=Z.range,ee=n((function(e){e.setUTCDate(1),e.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCMonth(e.getUTCMonth()+t)}),(function(e,t){return t.getUTCMonth()-e.getUTCMonth()+12*(t.getUTCFullYear()-e.getUTCFullYear())}),(function(e){return e.getUTCMonth()})),te=ee.range,re=n((function(e){e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCFullYear(e.getUTCFullYear()+t)}),(function(e,t){return t.getUTCFullYear()-e.getUTCFullYear()}),(function(e){return e.getUTCFullYear()}));re.every=function(e){return isFinite(e=Math.floor(e))&&e>0?n((function(t){t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),(function(t,r){t.setUTCFullYear(t.getUTCFullYear()+r*e)})):null};var ne=re.range;e.timeDay=d,e.timeDays=p,e.timeFriday=b,e.timeFridays=L,e.timeHour=u,e.timeHours=f,e.timeInterval=n,e.timeMillisecond=a,e.timeMilliseconds=i,e.timeMinute=s,e.timeMinutes=c,e.timeMonday=v,e.timeMondays=T,e.timeMonth=C,e.timeMonths=O,e.timeSaturday=_,e.timeSaturdays=S,e.timeSecond=o,e.timeSeconds=l,e.timeSunday=g,e.timeSundays=w,e.timeThursday=x,e.timeThursdays=A,e.timeTuesday=m,e.timeTuesdays=k,e.timeWednesday=y,e.timeWednesdays=M,e.timeWeek=g,e.timeWeeks=w,e.timeYear=D,e.timeYears=P,e.utcDay=F,e.utcDays=N,e.utcFriday=G,e.utcFridays=$,e.utcHour=E,e.utcHours=I,e.utcMillisecond=a,e.utcMilliseconds=i,e.utcMinute=z,e.utcMinutes=R,e.utcMonday=j,e.utcMondays=X,e.utcMonth=ee,e.utcMonths=te,e.utcSaturday=Z,e.utcSaturdays=K,e.utcSecond=o,e.utcSeconds=l,e.utcSunday=B,e.utcSundays=Y,e.utcThursday=q,e.utcThursdays=J,e.utcTuesday=V,e.utcTuesdays=W,e.utcWednesday=U,e.utcWednesdays=Q,e.utcWeek=B,e.utcWeeks=Y,e.utcYear=re,e.utcYears=ne,Object.defineProperty(e,"__esModule",{value:!0})}))},{}],16:[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){for(var t=1;e*t%1;)t*=10;return t}function b(e,t){for(var r in t)Object.defineProperty(e.prototype,r,{value:t[r],enumerable:!1})}function _(){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=x(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 _;if(e instanceof _)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};function w(e){return"__proto__"==(e+="")||"\0"===e[0]?"\0"+e:e}function T(e){return"\0"===(e+="")[0]?e.slice(1):e}function k(e){return w(e)in this._}function M(e){return(e=w(e))in this._&&delete this._[e]}function A(){var e=[];for(var t in this._)e.push(T(t));return e}function L(){var e=0;for(var t in this._)++e;return e}function S(){for(var e in this._)return!1;return!0}function C(){this._=Object.create(null)}function O(e){return e}function D(e,t,r){return function(){var n=r.apply(t,arguments);return n===t?e:n}}function P(e,t){if(t in e)return t;t=t.charAt(0).toUpperCase()+t.slice(1);for(var r=0,n=z.length;r<n;++r){var a=z[r]+t;if(a in e)return a}}b(_,{has:k,get:function(e){return this._[w(e)]},set:function(e,t){return this._[w(e)]=t},remove:M,keys:A,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:L,empty:S,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 _;++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 C;if(e)for(var r=0,n=e.length;r<n;++r)t.add(e[r]);return t},b(C,{has:k,add:function(e){return this._[w(e+="")]=!0,e},remove:M,values:A,size:L,empty:S,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 z=["webkit","ms","moz","Moz","o","O"];function R(){}function E(){}function I(e){var t=[],r=new _;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 F(){e.event.preventDefault()}function N(){for(var t,r=e.event;t=r.sourceEvent;)r=t;return r}function H(t){for(var r=new E,n=0,a=arguments.length;++n<a;)r[arguments[n]]=I(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 E,t=-1,r=arguments.length;++t<r;)e[arguments[t]]=I(e);return e},E.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(B,"\\$&")};var B=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,j={}.__proto__?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)e[r]=t[r]};function V(e){return j(e,Z),e}var U=function(e,t){return t.querySelector(e)},q=function(e,t){return t.querySelectorAll(e)},G=function(e,t){var r=e.matches||e[P(e,"matchesSelector")];return(G=function(e,t){return r.call(e,t)})(e,t)};"function"==typeof Sizzle&&(U=function(e,t){return Sizzle(e,t)[0]||null},q=Sizzle,G=Sizzle.matchesSelector),e.selection=function(){return e.select(a.documentElement)};var Z=e.selection.prototype=[];function Y(e){return"function"==typeof e?e:function(){return U(e,this)}}function X(e){return"function"==typeof e?e:function(){return q(e,this)}}Z.select=function(e){var t,r,n,a,i=[];e=Y(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)},Z.selectAll=function(e){var t,r,a=[];e=X(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 W="http://www.w3.org/1999/xhtml",Q={svg:"http://www.w3.org/2000/svg",xhtml:W,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function J(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 $(e){return e.trim().replace(/\s+/g," ")}function K(t){return new RegExp("(?:^|\\s+)"+e.requote(t)+"(?:\\s+|$)","g")}function ee(e){return(e+"").trim().split(/^|\s+/)}function te(e,t){var r=(e=ee(e).map(re)).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 re(e){var t=K(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",$(a+" "+e))):r.setAttribute("class",$(a.replace(t," ")))}}function ne(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 ae(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 ie(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===W&&e.documentElement.namespaceURI===W?e.createElement(t):e.createElementNS(r,t)}}function oe(){var e=this.parentNode;e&&e.removeChild(this)}function le(e){return{__data__:e}}function se(e){return function(){return G(this,e)}}function ce(e){return arguments.length||(e=d),function(t,r){return t&&r?e(t.__data__,r.__data__):!t-!r}}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 j(e,de),e}e.ns={prefix:Q,qualify:function(e){var t=e.indexOf(":"),r=e;return t>=0&&"xmlns"!==(r=e.slice(0,t))&&(e=e.slice(t+1)),Q.hasOwnProperty(r)?{space:Q[r],local:e}:e}},Z.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(J(r,t[r]));return this}return this.each(J(t,r))},Z.classed=function(e,t){if(arguments.length<2){if("string"==typeof e){var r=this.node(),n=(e=ee(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(!K(e[a]).test(t))return!1;return!0}for(t in e)this.each(te(t,e[t]));return this}return this.each(te(e,t))},Z.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(ne(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(ne(e,t,r))},Z.property=function(e,t){if(arguments.length<2){if("string"==typeof e)return this.node()[e];for(t in e)this.each(ae(t,e[t]));return this}return this.each(ae(e,t))},Z.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},Z.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},Z.append=function(e){return e=ie(e),this.select((function(){return this.appendChild(e.apply(this,arguments))}))},Z.insert=function(e,t){return e=ie(e),t=Y(t),this.select((function(){return this.insertBefore(e.apply(this,arguments),t.apply(this,arguments)||null)}))},Z.remove=function(){return this.each(oe)},Z.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 _,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]=le(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]=le(i);for(;n<u;++n)p[n]=le(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},Z.datum=function(e){return arguments.length?this.property("__data__",e):this.property("__data__")},Z.filter=function(e){var t,r,n,a=[];"function"!=typeof e&&(e=se(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)},Z.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},Z.sort=function(e){e=ce.apply(this,arguments);for(var t=-1,r=this.length;++t<r;)this[t].sort(e);return this.order()},Z.each=function(e){return ue(this,(function(t,r,n){e.call(t,t.__data__,r,n)}))},Z.call=function(e){var t=n(arguments);return e.apply(t[0]=this,t),this},Z.empty=function(){return!this.node()},Z.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},Z.size=function(){var e=0;return ue(this,(function(){++e})),e};var de=[];function pe(e){var t,r;return function(n,a,i){var o,l=e[i].update,s=l.length;for(i!=r&&(r=i,t=0),a>=t&&(t=a+1);!(o=l[t])&&++t<s;);return o}}function he(t,r,a){var i="__on"+t,o=t.indexOf("."),l=ve;o>0&&(t=t.slice(0,o));var s=ge.get(t);function c(){var e=this[i];e&&(this.removeEventListener(t,e,e.$),delete this[i])}return s&&(t=s,l=me),o?r?function(){var e=l(r,n(arguments));c.call(this),this.addEventListener(t,this[i]=e,e.$=a),e._=r}:c:r?R: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=Z.append,de.empty=Z.empty,de.node=Z.node,de.call=Z.call,de.size=Z.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){return arguments.length<2&&(t=pe(this)),Z.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(q(e,a))).parentNode=a.documentElement:(t=n(e)).parentNode=null,V([t])},Z.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(he(r,e[r],t));return this}if(n<2)return(n=this.node()["__on"+e])&&n._;r=!1}return this.each(he(e,t,r))};var ge=e.map({mouseenter:"mouseover",mouseleave:"mouseout"});function ve(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 me(e,t){var r=ve(e,t);return function(e){var t=e.relatedTarget;t&&(t===this||8&t.compareDocumentPosition(this))||r.call(this,e)}}a&&ge.forEach((function(e){"on"+e in a&&ge.remove(e)}));var ye,xe=0;function be(t){var r=".dragsuppress-"+ ++xe,n="click"+r,a=e.select(o(t)).on("touchmove"+r,F).on("dragstart"+r,F).on("selectstart"+r,F);if(null==ye&&(ye=!("onselectstart"in t)&&P(t.style,"userSelect")),ye){var l=i(t).style,s=l[ye];l[ye]="none"}return function(e){if(a.on(r,null),ye&&(l[ye]=s),e){var t=function(){a.on(n,null)};a.on(n,(function(){F(),t()}),!0),setTimeout(t,0)}}}e.mouse=function(e){return we(e,N())};var _e=this.navigator&&/WebKit/.test(this.navigator.userAgent)?-1:0;function we(t,r){r.changedTouches&&(r=r.changedTouches[0]);var n=t.ownerSVGElement||t;if(n.createSVGPoint){var a=n.createSVGPoint();if(_e<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();_e=!(l.f||l.e),n.remove()}}return _e?(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 Te(){return e.event.changedTouches[0].identifier}e.touch=function(e,t,r){if(arguments.length<3&&(r=t,t=N().changedTouches),t)for(var n,a=0,i=t.length;a<i;++a)if((n=t[a]).identifier===r)return we(e,n)},e.behavior.drag=function(){var t=H(i,"drag","dragstart","dragend"),r=null,n=l(R,e.mouse,o,"mousemove","mouseup"),a=l(Te,e.touch,O,"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=this,u=e.event.target.correspondingElement||e.event.target,f=c.parentNode,d=t.of(c,arguments),p=0,h=n(),g=".drag"+(null==h?"":"-"+h),v=e.select(i(u)).on(o+g,x).on(l+g,b),m=be(u),y=a(f,h);function x(){var e,t,r=a(f,h);r&&(e=r[0]-y[0],t=r[1]-y[1],p|=e|t,y=r,d({type:"drag",x:r[0]+s[0],y:r[1]+s[1],dx:e,dy:t}))}function b(){a(f,h)&&(v.on(o+g,null).on(l+g,null),m(p),d({type:"dragend"}))}s=r?[(s=r.apply(c,arguments)).x-y[0],s.y-y[1]]:[0,0],d({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=N().touches),t?n(t).map((function(t){var r=we(e,t);return r.identifier=t.identifier,r})):[]};var ke=1e-6,Me=1e-12,Ae=Math.PI,Le=2*Ae,Se=Le-ke,Ce=Ae/2,Oe=Ae/180,De=180/Ae;function Pe(e){return e>0?1:e<0?-1:0}function ze(e,t,r){return(t[0]-e[0])*(r[1]-e[1])-(t[1]-e[1])*(r[0]-e[0])}function Re(e){return e>1?0:e<-1?Ae:Math.acos(e)}function Ee(e){return e>1?Ce:e<-1?-Ce:Math.asin(e)}function Ie(e){return((e=Math.exp(e))+1/e)/2}function Fe(e){return(e=Math.sin(e/2))*e}var Ne=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<Me)n=Math.log(c/o)/Ne,r=function(e){return[a+e*u,i+e*f,o*Math.exp(Ne*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)/Ne,r=function(e){var t,r=e*n,l=Ie(v),s=o/(2*p)*(l*(t=Ne*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/Ie(Ne*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=je,g=250,v=0,m="mousedown.zoom",y="mousemove.zoom",x="mouseup.zoom",b="touchstart.zoom",_=H(w,"zoomstart","zoom","zoomend");function w(e){e.on(m,D).on(Be+".zoom",z).on("dblclick.zoom",R).on(b,P)}function T(e){return[(e[0]-d.x)/d.k,(e[1]-d.y)/d.k]}function k(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},k(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 D(){var t=this,r=_.of(t,arguments),n=0,a=e.select(o(t)).on(y,s).on(x,c),i=T(e.mouse(t)),l=be(t);function s(){n=1,M(e.mouse(t),i),C(r)}function c(){a.on(y,null).on(x,null),l(n),O(r)}ml.call(t),S(r)}function P(){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=be(r);function h(){var n=e.touches(r);return t=d.k,n.forEach((function(e){e.identifier in a&&(a[e.identifier]=T(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),F()}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);ml.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],k(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,D).on(b,P),p(),O(n)}g(),S(n),f.on(m,null).on(b,g)}function z(){var a=_.of(this,arguments);i?clearTimeout(i):(ml.call(this),t=T(r=n||e.mouse(this)),S(a)),i=setTimeout((function(){i=null,O(a)}),50),F(),k(Math.pow(2,.002*He())*d.k),M(r,t),C(a)}function R(){var t=e.mouse(this),r=Math.log(d.k)/Math.LN2;A(this,t,T(t),e.event.shiftKey?Math.ceil(r)-1:Math.floor(r)+1)}return Be||(Be="onwheel"in a?(He=function(){return-e.event.deltaY*(e.event.deltaMode?120:1)},"wheel"):"onmousewheel"in a?(He=function(){return e.event.wheelDelta},"mousewheel"):(He=function(){return-e.event.detail},"MozMousePixelScroll")),w.event=function(t){t.each((function(){var t=_.of(this,arguments),n=d;bl?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},k(+e),L(),w):d.k},w.scaleExtent=function(e){return arguments.length?(h=null==e?je:[+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 He,Be,je=[0,1/0];function Ve(){}function Ue(e,t,r){return this instanceof Ue?(this.h=+e,this.s=+t,void(this.l=+r)):arguments.length<2?e instanceof Ue?new Ue(e.h,e.s,e.l):st(""+e,ct,Ue):new Ue(e,t,r)}e.color=Ve,Ve.prototype.toString=function(){return this.rgb()+""},e.hsl=Ue;var qe=Ue.prototype=new Ve;function Ge(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)||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 nt(i(e+120),i(e),i(e-120))}function Ze(t,r,n){return this instanceof Ze?(this.h=+t,this.c=+r,void(this.l=+n)):arguments.length<2?t instanceof Ze?new Ze(t.h,t.c,t.l):Ke(t instanceof We?t.l:(t=ut((t=e.rgb(t)).r,t.g,t.b)).l,t.a,t.b):new Ze(t,r,n)}qe.brighter=function(e){return e=Math.pow(.7,arguments.length?e:1),new Ue(this.h,this.s,this.l/e)},qe.darker=function(e){return e=Math.pow(.7,arguments.length?e:1),new Ue(this.h,this.s,e*this.l)},qe.rgb=function(){return Ge(this.h,this.s,this.l)},e.hcl=Ze;var Ye=Ze.prototype=new Ve;function Xe(e,t,r){return isNaN(e)&&(e=0),isNaN(t)&&(t=0),new We(r,Math.cos(e*=Oe)*t,Math.sin(e)*t)}function We(e,t,r){return this instanceof We?(this.l=+e,this.a=+t,void(this.b=+r)):arguments.length<2?e instanceof We?new We(e.l,e.a,e.b):e instanceof Ze?Xe(e.h,e.c,e.l):ut((e=nt(e)).r,e.g,e.b):new We(e,t,r)}Ye.brighter=function(e){return new Ze(this.h,this.c,Math.min(100,this.l+Qe*(arguments.length?e:1)))},Ye.darker=function(e){return new Ze(this.h,this.c,Math.max(0,this.l-Qe*(arguments.length?e:1)))},Ye.rgb=function(){return Xe(this.h,this.c,this.l).rgb()},e.lab=We;var Qe=18,Je=We.prototype=new Ve;function $e(e,t,r){var n=(e+16)/116,a=n+t/500,i=n-r/200;return new nt(rt(3.2404542*(a=.95047*et(a))-1.5371385*(n=1*et(n))-.4985314*(i=1.08883*et(i))),rt(-.969266*a+1.8760108*n+.041556*i),rt(.0556434*a-.2040259*n+1.0572252*i))}function Ke(e,t,r){return e>0?new Ze(Math.atan2(r,t)*De,Math.sqrt(t*t+r*r),e):new Ze(NaN,NaN,e)}function et(e){return e>.206893034?e*e*e:(e-4/29)/7.787037}function tt(e){return e>.008856?Math.pow(e,1/3):7.787037*e+4/29}function rt(e){return Math.round(255*(e<=.00304?12.92*e:1.055*Math.pow(e,1/2.4)-.055))}function nt(e,t,r){return this instanceof nt?(this.r=~~e,this.g=~~t,void(this.b=~~r)):arguments.length<2?e instanceof nt?new nt(e.r,e.g,e.b):st(""+e,nt,Ge):new nt(e,t,r)}function at(e){return new nt(e>>16,e>>8&255,255&e)}function it(e){return at(e)+""}Je.brighter=function(e){return new We(Math.min(100,this.l+Qe*(arguments.length?e:1)),this.a,this.b)},Je.darker=function(e){return new We(Math.max(0,this.l-Qe*(arguments.length?e:1)),this.a,this.b)},Je.rgb=function(){return $e(this.l,this.a,this.b)},e.rgb=nt;var ot=nt.prototype=new Ve;function lt(e){return e<16?"0"+Math.max(0,e).toString(16):Math.min(255,e).toString(16)}function st(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(dt(a[0]),dt(a[1]),dt(a[2]))}return(i=pt.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 ct(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 Ue(n,a,s)}function ut(e,t,r){var n=tt((.4124564*(e=ft(e))+.3575761*(t=ft(t))+.1804375*(r=ft(r)))/.95047),a=tt((.2126729*e+.7151522*t+.072175*r)/1);return We(116*a-16,500*(n-a),200*(a-tt((.0193339*e+.119192*t+.9503041*r)/1.08883)))}function ft(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function dt(e){var t=parseFloat(e);return"%"===e.charAt(e.length-1)?Math.round(2.55*t):t}ot.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 nt(Math.min(255,t/e),Math.min(255,r/e),Math.min(255,n/e))):new nt(a,a,a)},ot.darker=function(e){return new nt((e=Math.pow(.7,arguments.length?e:1))*this.r,e*this.g,e*this.b)},ot.hsl=function(){return ct(this.r,this.g,this.b)},ot.toString=function(){return"#"+lt(this.r)+lt(this.g)+lt(this.b)};var pt=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 ht(e){return"function"==typeof e?e:function(){return e}}function gt(e){return function(t,r,n){return 2===arguments.length&&"function"==typeof r&&(n=r,r=null),vt(t,r,e,n)}}function vt(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))}pt.forEach((function(e,t){pt.set(e,at(t))})),e.functor=ht,e.xhr=gt(O),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=vt(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 C,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 mt,yt,xt,bt,_t=this[P(this,"requestAnimationFrame")]||function(e){setTimeout(e,17)};function wt(e,t,r){var n=arguments.length;n<2&&(t=0),n<3&&(r=Date.now());var a=r+t,i={c:e,t:a,n:null};return yt?yt.n=i:mt=i,yt=i,xt||(bt=clearTimeout(bt),xt=1,_t(Tt)),i}function Tt(){var e=kt(),t=Mt()-e;t>24?(isFinite(t)&&(clearTimeout(bt),bt=setTimeout(Tt,t)),xt=0):(xt=1,_t(Tt))}function kt(){for(var e=Date.now(),t=mt;t;)e>=t.t&&t.c(e-t.t)&&(t.c=null),t=t.n;return e}function Mt(){for(var e,t=mt,r=1/0;t;)t.c?(t.t<r&&(r=t.t),t=(e=t).n):t=e?e.n=t.n:mt=t.n;return yt=e,r}function At(e,t){return t-(e?Math.ceil(Math.log(e)/Math.LN10):1)}e.timer=function(){wt.apply(this,arguments)},e.timer.flush=function(){kt(),Mt()},e.round=function(e,t){return t?Math.round(e*(t=Math.pow(10,t)))/t:Math.round(e)};var Lt=["y","z","a","f","p","n","\xb5","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}}));function St(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)}:O;return function(t){var n=Ct.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=Ot.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,T=(t=h(t,p)).lastIndexOf(".");if(T<0){var k=x?t.lastIndexOf("e"):-1;k<0?(_=t,w=""):(_=t.substring(0,k),w=t.substring(k))}else _=t.substring(0,T),w=r+t.substring(T+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}}}e.formatPrefix=function(t,r){var n=0;return(t=+t)&&(t<0&&(t*=-1),r&&(t=e.round(t,At(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)))),Lt[8+n/3]};var Ct=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,Ot=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,At(t,r))).toFixed(Math.max(0,Math.min(20,At(t*(1+1e-15),r))))}});function Dt(e){return e+""}var Pt=e.time={},zt=Date;function Rt(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}Rt.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(){Et.setUTCDate.apply(this._,arguments)},setDay:function(){Et.setUTCDay.apply(this._,arguments)},setFullYear:function(){Et.setUTCFullYear.apply(this._,arguments)},setHours:function(){Et.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){Et.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){Et.setUTCMinutes.apply(this._,arguments)},setMonth:function(){Et.setUTCMonth.apply(this._,arguments)},setSeconds:function(){Et.setUTCSeconds.apply(this._,arguments)},setTime:function(){Et.setTime.apply(this._,arguments)}};var Et=Date.prototype;function It(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 zt(r-1)),1),r}function i(e,r){return t(e=new zt(+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=Ft(e);return l.floor=l,l.round=Ft(n),l.ceil=Ft(a),l.offset=Ft(i),l.range=function(e,t,r){try{zt=Rt;var n=new Rt;return n._=e,o(n,t,r)}finally{zt=Date}},e}function Ft(e){return function(t,r){try{zt=Rt;var n=new Rt;return n._=t,e(n,r)._}finally{zt=Date}}}function Nt(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=Ht[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&&zt!==Rt,a=new(n?Rt:zt);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 Ht?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(zt=Rt);return r._=e,t(r)}finally{zt=Date}}return r.parse=function(e){try{zt=Rt;var r=t.parse(e);return r&&r._}finally{zt=Date}},r.toString=t.toString,r},u.multi=u.utc.multi=or;var d=e.map(),p=Ut(o),h=qt(o),g=Ut(l),v=qt(l),m=Ut(s),y=qt(s),x=Ut(c),b=qt(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 Vt(e.getDate(),t,2)},e:function(e,t){return Vt(e.getDate(),t,2)},H:function(e,t){return Vt(e.getHours(),t,2)},I:function(e,t){return Vt(e.getHours()%12||12,t,2)},j:function(e,t){return Vt(1+Pt.dayOfYear(e),t,3)},L:function(e,t){return Vt(e.getMilliseconds(),t,3)},m:function(e,t){return Vt(e.getMonth()+1,t,2)},M:function(e,t){return Vt(e.getMinutes(),t,2)},p:function(e){return i[+(e.getHours()>=12)]},S:function(e,t){return Vt(e.getSeconds(),t,2)},U:function(e,t){return Vt(Pt.sundayOfYear(e),t,2)},w:function(e){return e.getDay()},W:function(e,t){return Vt(Pt.mondayOfYear(e),t,2)},x:u(n),X:u(a),y:function(e,t){return Vt(e.getFullYear()%100,t,2)},Y:function(e,t){return Vt(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:$t,e:$t,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:Qt,"%":ir};return u}Pt.year=It((function(e){return(e=Pt.day(e)).setMonth(0,1),e}),(function(e,t){e.setFullYear(e.getFullYear()+t)}),(function(e){return e.getFullYear()})),Pt.years=Pt.year.range,Pt.years.utc=Pt.year.utc.range,Pt.day=It((function(e){var t=new zt(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})),Pt.days=Pt.day.range,Pt.days.utc=Pt.day.utc.range,Pt.dayOfYear=function(e){var t=Pt.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=Pt[e]=It((function(e){return(e=Pt.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=Pt.year(e).getDay();return Math.floor((Pt.dayOfYear(e)+(r+t)%7)/7)-(r!==t)}));Pt[e+"s"]=r.range,Pt[e+"s"].utc=r.utc.range,Pt[e+"OfYear"]=function(e){var r=Pt.year(e).getDay();return Math.floor((Pt.dayOfYear(e)+(r+t)%7)/7)}})),Pt.week=Pt.sunday,Pt.weeks=Pt.sunday.range,Pt.weeks.utc=Pt.sunday.utc.range,Pt.weekOfYear=Pt.sundayOfYear;var Ht={"-":"",_:" ",0:"0"},Bt=/^\s*\d+/,jt=/^%/;function Vt(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 Ut(t){return new RegExp("^(?:"+t.map(e.requote).join("|")+")","i")}function qt(e){for(var t=new _,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 Qt(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 $t(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+Vt(n,"0",2)+Vt(a,"0",2)}function ir(e,t,r){jt.lastIndex=0;var n=jt.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(e){return{numberFormat:St(e),timeFormat:Nt(e)}};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,Tr,kr,Mr,Ar,Lr,Sr=new sr,Cr={sphere:function(){vr+=4*Ae},point:R,lineStart:R,lineEnd:R,polygonStart:function(){Sr.reset(),Cr.lineStart=Or},polygonEnd:function(){var e=2*Sr;vr+=e<0?4*Ae+e:e,Cr.lineStart=Cr.lineEnd=Cr.point=R}};function Or(){var e,t,r,n,a;function i(e,t){t=t*Oe/2+Ae/4;var i=(e*=Oe)-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)*Oe,n=Math.cos(l=(t=l)*Oe/2+Ae/4),a=Math.sin(l)},Cr.lineEnd=function(){i(e,t)}}function Dr(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 Pr(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]),Ee(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=Dr([e*Oe,o*Oe]);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]*De*d,g=y(f)>180;if(g^(d*i<h&&h<d*e))(v=u[1]*De)>a&&(a=v);else if(g^(d*i<(h=(h+360)%360-180)&&h<d*e)){var v;(v=-u[1]*De)<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 T(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)T((p=u[o])[0],g)||T(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=Tr=kr=Mr=Ar=Lr=0,e.geo.stream(t,Hr);var r=Mr,n=Ar,a=Lr,i=r*r+n*n+a*a;return i<Me&&(r=wr,n=Tr,a=kr,yr<ke&&(r=xr,n=br,a=_r),(i=r*r+n*n+a*a)<Me)?[NaN,NaN]:[Math.atan2(n,r)*De,Ee(a/Math.sqrt(i))*De]};var Hr={sphere:R,point:Br,lineStart:Vr,lineEnd:Ur,polygonStart:function(){Hr.lineStart=qr},polygonEnd:function(){Hr.lineStart=Vr}};function Br(e,t){e*=Oe;var r=Math.cos(t*=Oe);jr(r*Math.cos(e),r*Math.sin(e),Math.sin(t))}function jr(e,t,r){++mr,xr+=(e-xr)/mr,br+=(t-br)/mr,_r+=(r-_r)/mr}function Vr(){var e,t,r;function n(n,a){n*=Oe;var i=Math.cos(a*=Oe),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)),Tr+=c*(t+(t=l)),kr+=c*(r+(r=s)),jr(e,t,r)}Hr.point=function(a,i){a*=Oe;var o=Math.cos(i*=Oe);e=o*Math.cos(a),t=o*Math.sin(a),r=Math.sin(i),Hr.point=n,jr(e,t,r)}}function Ur(){Hr.point=Br}function qr(){var e,t,r,n,a;function i(e,t){e*=Oe;var i=Math.cos(t*=Oe),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&&-Re(p)/d,g=Math.atan2(d,p);Mr+=h*c,Ar+=h*u,Lr+=h*f,yr+=g,wr+=g*(r+(r=o)),Tr+=g*(n+(n=l)),kr+=g*(a+(a=s)),jr(r,n,a)}Hr.point=function(o,l){e=o,t=l,Hr.point=i,o*=Oe;var s=Math.cos(l*=Oe);r=s*Math.cos(o),n=s*Math.sin(o),a=Math.sin(l),jr(r,n,a)},Hr.lineEnd=function(){i(e,t),Hr.lineEnd=Ur,Hr.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),s=new Wr(n,e,null,!1),c=new Wr(n,null,s,!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 Qr(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+Ae/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+Ae/4,x=Math.sin(y),b=Math.cos(y),_=m-d,w=_>=0?1:-1,T=w*_,k=T>Ae,M=h*x;if(Sr.add(Math.atan2(M*w*Math.sin(T),g*b+M*Math.cos(T))),i+=k?_+w*Le:_,k^d>=r^m>=r){var A=zr(Dr(f),Dr(e));Ir(A);var L=zr(a,A);Ir(L);var S=(k^_>=0?-1:1)*Ee(L[2]);(n>S||n===S&&(A[0]||A[1]))&&(o+=k^_>=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=$r(),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 $r(){var e,t=[];return{lineStart:function(){t.push(e=[])},point:function(t,r){e.push([t,r])},lineEnd:R,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]-Ce-ke:Ce-e[1])-((t=t.x)[0]<0?t[1]-Ce-ke:Ce-t[1])}var en=Qr(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?Ae:-Ae,s=y(i-r);y(s-Ae)<ke?(e.point(r,n=(n+o)/2>0?Ce:-Ce),e.point(a,n),e.lineEnd(),e.lineStart(),e.point(l,n),e.point(i,n),t=0):a!==l&&s>=Ae&&(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*Ce,n.point(-Ae,a),n.point(0,a),n.point(Ae,a),n.point(Ae,0),n.point(Ae,-a),n.point(0,-a),n.point(-Ae,-a),n.point(-Ae,0),n.point(-Ae,a);else if(y(e[0]-t[0])>ke){var i=e[0]<t[0]?Ae:-Ae;a=r*i/2,n.point(-i,a),n.point(0,a),n.point(i,a)}else n.point(t[0],t[1])}),[-Ae,-Ae/2]);function tn(e){var t=Math.cos(e),r=t>0,n=y(t)>ke;return Qr(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?Ae:-Ae),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}}}),Nn(e,6*Oe),r?[0,-e]:[-Ae,e-Ae]);function a(e,r){return Math.cos(e)*Math.cos(r)>t}function i(e,r,n){var a=[1,0,0],i=zr(Dr(e),Dr(r)),o=Pr(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=Pr(d,p),g=Pr(p,p),v=h*h-g*(Pr(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],T=e[1],k=r[1];w<_&&(b=_,_=w,w=b);var M=w-_,A=y(M-Ae)<ke;if(!A&&k<T&&(b=T,T=k,k=b),A||M<ke?A?T+k>0^x[1]<(y(x[0]-_)<ke?T:k):T<=x[1]&&x[1]<=k:M>Ae^(_<=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:Ae-e,i=0;return t<-a?i|=1:t>a&&(i|=2),n<-a?i|=4:n>a&&(i|=8),i}}function rn(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}}}}}}function nn(t,r,n,a){return function(s){var c,u,f,d,p,h,g,v,m,y,x,b=s,_=$r(),w=rn(t,r,n,a),T={point:A,lineStart:function(){T.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()));T.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&&ze(c,i,e)>0&&++t:i[1]<=n&&ze(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(),k(null,null,1,s),s.lineEnd()),i&&Yr(c,o,r,k,s),s.polygonEnd()),c=u=f=null}};function k(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(-1e9,Math.min(1e9,e)),t=Math.max(-1e9,Math.min(1e9,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 T};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=Ae/3,n=On(e),a=n(t,r);return a.parallels=function(e){return arguments.length?n(t=e[0]*Ae/180,r=e[1]*Ae/180):[t/Ae*180,r/Ae*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,Ee((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:R,lineStart:R,lineEnd:R,polygonStart:function(){sn=0,pn.lineStart=hn},polygonEnd:function(){pn.lineStart=pn.lineEnd=pn.point=R,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:R,lineEnd:R,polygonStart:R,polygonEnd:R};function vn(){var e=mn(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=mn(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}function mn(e){return"m0,"+e+"a"+e+","+e+" 0 1,1 0,"+-2*e+"a"+e+","+e+" 0 1,1 0,"+2*e+"z"}var yn,xn={point:bn,lineStart:_n,lineEnd:wn,polygonStart:function(){xn.lineStart=Tn},polygonEnd:function(){xn.point=bn,xn.lineStart=_n,xn.lineEnd=wn}};function bn(e,t){xr+=e,br+=t,++_r}function _n(){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,Tr+=o*(t+n)/2,kr+=o,bn(e=r,t=n)}xn.point=function(n,a){xn.point=r,bn(e=n,t=a)}}function wn(){xn.point=bn}function Tn(){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,Tr+=o*(n+t)/2,kr+=o,Mr+=(o=n*e-r*t)*(r+e),Ar+=o*(n+t),Lr+=3*o,bn(r=e,n=t)}xn.point=function(i,o){xn.point=a,bn(e=r=i,t=n=o)},xn.lineEnd=function(){a(e,t)}}function kn(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:R};function n(r,n){e.moveTo(r+t,n),e.arc(r,n,t,0,Le)}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}function Mn(e){var t=.5,r=Math.cos(30*Oe),n=16;function a(e){return(n?o:i)(e)}function i(t){return Sn(t,(function(r,n){r=e(r,n),t.point(r[0],r[1])}))}function o(t){var r,a,i,o,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 i=Dr([r,a]),o=e(r,a);l(f,d,u,p,h,g,f=o[0],d=o[1],u=r,p=i[0],h=i[1],g=i[2],n,t),t.point(f,d)}function b(){v.point=m,t.lineEnd()}function _(){y(),v.point=w,v.lineEnd=T}function w(e,t){x(r=e,t),a=f,i=d,o=p,s=h,c=g,v.point=x}function T(){l(f,d,u,p,h,g,a,i,r,o,s,c,n,t),v.lineEnd=b,b()}return v}function l(n,a,i,o,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=o+p,T=s+h,k=c+g,M=Math.sqrt(w*w+T*T+k*k),A=Math.asin(k/=M),L=y(y(k)-1)<ke||y(i-d)<ke?(i+d)/2:Math.atan2(T,w),S=e(L,A),C=S[0],O=S[1],D=C-n,P=O-a,z=b*D-x*P;(z*z/_>t||y((x*D+b*P)/_-.5)>.3||o*p+s*h+c*g<r)&&(l(n,a,i,o,s,c,C,O,L,w/=M,T/=M,k,v,m),m.point(C,O),l(C,O,L,w,T,k,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 An(e){var t=Mn((function(t,r){return e([t*De,r*De])}));return function(e){return Dn(t(e))}}function Ln(e){this.stream=e}function Sn(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 Cn(e){return On((function(){return e}))()}function On(t){var r,n,a,i,o,l,s=Mn((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,y=O,x=null,b=null;function _(e){return[(e=a(e[0]*Oe,e[1]*Oe))[0]*c+i,o-e[1]*c]}function w(e){return(e=a.invert((e[0]-i)/c,(o-e[1])/c))&&[e[0]*De,e[1]*De]}function T(){a=Gr(n=Rn(h,g,v),r);var e=r(d,p);return i=u-e[0]*c,o=f+e[1]*c,k()}function k(){return l&&(l.valid=!1,l=null),_}return _.stream=function(e){return l&&(l.valid=!1),(l=Dn(m(n,s(y(e))))).valid=!0,l},_.clipAngle=function(e){return arguments.length?(m=null==e?(x=e,en):tn((x=+e)*Oe),k()):x},_.clipExtent=function(e){return arguments.length?(b=e,y=e?nn(e[0][0],e[0][1],e[1][0],e[1][1]):O,k()):b},_.scale=function(e){return arguments.length?(c=+e,T()):c},_.translate=function(e){return arguments.length?(u=+e[0],f=+e[1],T()):[u,f]},_.center=function(e){return arguments.length?(d=e[0]%360*Oe,p=e[1]%360*Oe,T()):[d*De,p*De]},_.rotate=function(e){return arguments.length?(h=e[0]%360*Oe,g=e[1]%360*Oe,v=e.length>2?e[2]%360*Oe:0,T()):[h*De,g*De,v*De]},e.rebind(_,s,"precision"),function(){return r=t.apply(this,arguments),_.invert=r.invert&&w,T()}}function Dn(e){return Sn(e,(function(t,r){e.point(t*Oe,r*Oe)}))}function Pn(e,t){return[e,t]}function zn(e,t){return[e>Ae?e-Le:e<-Ae?e+Le:e,t]}function Rn(e,t,r){return e?t||r?Gr(In(e),Fn(t,r)):In(e):t||r?Fn(t,r):zn}function En(e){return function(t,r){return[(t+=e)>Ae?t-Le:t<-Ae?t+Le:t,r]}}function In(e){var t=En(e);return t.invert=En(-e),t}function Fn(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),Ee(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),Ee(u*r-l*n)]},o}function Nn(e,t){var r=Math.cos(e),n=Math.sin(e);return function(a,i,o,l){var s=o*t;null!=a?(a=Hn(r,a),i=Hn(r,i),(o>0?a<i:a>i)&&(a+=o*Le)):(a=e+o*Le,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 Hn(e,t){var r=Dr(t);r[0]-=e,Ir(r);var n=Re(-r[1]);return((-r[2]<0?-n:n)+2*Math.PI-ke)%(2*Math.PI)}function Bn(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 jn(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 Vn(e){return e.source}function Un(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=Tr=kr=Mr=Ar=Lr=0,e.geo.stream(t,n(xn)),Lr?[Mr/Lr,Ar/Lr]:kr?[wr/kr,Tr/kr]:_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||An(e):O,s()):t},l.context=function(e){return arguments.length?(a=null==(r=e)?new vn:new kn(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 Ln(t);for(var n in e)r[n]=e[n];return r}}},Ln.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=Cn,e.geo.projectionMutator=On,(e.geo.equirectangular=function(){return Cn(Pn)}).raw=Pn.invert=Pn,e.geo.rotation=function(e){function t(t){return(t=e(t[0]*Oe,t[1]*Oe))[0]*=De,t[1]*=De,t}return e=Rn(e[0]%360*Oe,e[1]*Oe,e.length>2?e[2]*Oe:0),t.invert=function(t){return(t=e.invert(t[0]*Oe,t[1]*Oe))[0]*=De,t[1]*=De,t},t},zn.invert=Pn,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=Rn(-e[0]*Oe,-e[1]*Oe,0).invert,a=[];return t(null,null,1,{point:function(e,t){a.push(e=n(e,t)),e[0]*=De,e[1]*=De}}),{type:"Polygon",coordinates:[a]}}return a.origin=function(e){return arguments.length?(r=e,a):r},a.angle=function(r){return arguments.length?(t=Nn((e=+r)*Oe,n*Oe),a):e},a.precision=function(r){return arguments.length?(t=Nn(e*Oe,(n=+r)*Oe),a):n},a.angle(90)},e.geo.distance=function(e,t){var r,n=(t[0]-e[0])*Oe,a=e[1]*Oe,i=t[1]*Oe,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=Bn(o,i,90),u=jn(r,t,m),f=Bn(s,l,90),d=jn(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=Vn,a=Un;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]*Oe,n=e[1]*Oe,a=t[0]*Oe,i=t[1]*Oe,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(Fe(i-n)+o*s*Fe(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)*De,Math.atan2(i,Math.sqrt(n*n+a*a))*De]}:function(){return[r*De,n*De]}).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 yn=0,e.geo.stream(t,qn),yn};var qn={sphere:R,point:R,lineStart:function(){var e,t,r;function n(n,a){var i=Math.sin(a*=Oe),o=Math.cos(a),l=y((n*=Oe)-e),s=Math.cos(l);yn+=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}qn.point=function(a,i){e=a*Oe,t=Math.sin(i*=Oe),r=Math.cos(i),qn.point=n},qn.lineEnd=function(){qn.point=qn.lineEnd=R}},lineEnd:R,polygonStart:R,polygonEnd:R};function Gn(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 Zn=Gn((function(e){return Math.sqrt(2/(1+e))}),(function(e){return 2*Math.asin(e/2)}));(e.geo.azimuthalEqualArea=function(){return Cn(Zn)}).raw=Zn;var Yn=Gn((function(e){var t=Math.acos(e);return t&&t/Math.sin(t)}),O);function Xn(e,t){var r=Math.cos(e),n=function(e){return Math.tan(Ae/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 Jn;function o(e,t){i>0?t<-Ce+ke&&(t=-Ce+ke):t>Ce-ke&&(t=Ce-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))-Ce]},o}function Wn(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 Pn;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 Cn(Yn)}).raw=Yn,(e.geo.conicConformal=function(){return an(Xn)}).raw=Xn,(e.geo.conicEquidistant=function(){return an(Wn)}).raw=Wn;var Qn=Gn((function(e){return 1/e}),Math.atan);function Jn(e,t){return[e,Math.log(Math.tan(Ae/4+t/2))]}function $n(e){var t,r=Cn(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=Ae*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 Cn(Qn)}).raw=Qn,Jn.invert=function(e,t){return[e,2*Math.atan(Math.exp(t))-Ce]},(e.geo.mercator=function(){return $n(Jn)}).raw=Jn;var Kn=Gn((function(){return 1}),Math.asin);(e.geo.orthographic=function(){return Cn(Kn)}).raw=Kn;var ea=Gn((function(e){return 1/(1+e)}),(function(e){return 2*Math.atan(e)}));function ta(e,t){return[Math.log(Math.tan(Ae/4+t/2)),-e]}function ra(e){return e[0]}function na(e){return e[1]}function aa(e){for(var t=e.length,r=[0,1],n=2,a=2;a<t;a++){for(;n>1&&ze(e[r[n-2]],e[r[n-1]],e[a])<=0;)--n;r[n++]=a}return r.slice(0,n)}function ia(e,t){return e[0]-t[0]||e[1]-t[1]}(e.geo.stereographic=function(){return Cn(ea)}).raw=ea,ta.invert=function(e,t){return[-t,2*Math.atan(Math.exp(e))-Ce]},(e.geo.transverseMercator=function(){var e=$n(ta),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=ta,e.geom={},e.geom.hull=function(e){var t=ra,r=na;if(arguments.length)return n(e);function n(e){if(e.length<3)return[];var n,a=ht(t),i=ht(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(ia),n=0;n<o;n++)s.push([l[n][0],-l[n][1]]);var c=aa(l),u=aa(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 j(e,oa),e};var oa=e.geom.polygon.prototype=[];function la(e,t,r){return(r[0]-t[0])*(e[1]-t[1])<(r[1]-t[1])*(e[0]-t[0])}function sa(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 ca(e){var t=e[0],r=e[e.length-1];return!(t[0]-r[0]||t[1]-r[1])}oa.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},oa.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]},oa.clip=function(e){for(var t,r,n,a,i,o,l=ca(e),s=-1,c=this.length-ca(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;)la(o=t[r],u,a)?(la(i,u,a)||e.push(sa(i,o,u,a)),e.push(o)):la(i,u,a)&&e.push(sa(i,o,u,a)),i=o;l&&e.push(e[0]),u=a}return e};var ua,fa,da,pa,ha,ga=[],va=[];function ma(){Ia(this),this.edge=this.site=this.circle=null}function ya(e){var t=ga.pop()||new ma;return t.site=e,t}function xa(e){Sa(e),da.remove(e),ga.push(e),Ia(e)}function ba(e){var t=e.circle,r=t.x,n=t.cy,a={x:r,y:n},i=e.P,o=e.N,l=[e];xa(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),xa(s),s=i;l.unshift(s),Sa(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),xa(c),c=o;l.push(c),Sa(c);var u,f=l.length;for(u=1;u<f;++u)c=l[u],s=l[u-1],za(c.edge,s.site,c.site,a);s=l[0],(c=l[f-1]).edge=Da(s.site,c.site,null,a),La(s),La(c)}function _a(e){for(var t,r,n,a,i=e.x,o=e.y,l=da._;l;)if((n=wa(l,o)-i)>ke)l=l.L;else{if(!((a=i-Ta(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=ya(e);if(da.insert(t,s),t||r){if(t===r)return Sa(t),r=ya(t.site),da.insert(s,r),s.edge=r.edge=Da(t.site,s.site),La(t),void La(r);if(r){Sa(t),Sa(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};za(r.edge,c,h,b),s.edge=Da(c,e,null,b),r.edge=Da(e,h,null,b),La(t),La(r)}else s.edge=Da(t.site,s.site)}}function wa(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 Ta(e,t){var r=e.N;if(r)return wa(r,t);var n=e.site;return n.y===t?n.x:1/0}function ka(e){this.site=e,this.edges=[]}function Ma(e,t){return t.angle-e.angle}function Aa(){Ia(this),this.x=this.y=this.arc=this.site=this.cy=null}function La(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>=-Me)){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=va.pop()||new Aa;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=ha._;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}ha.insert(y,m),y||(pa=m)}}}}function Sa(e){var t=e.circle;t&&(t.P||(pa=t.N),ha.remove(t),va.push(t),Ia(t),e.circle=null)}function Ca(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 Oa(e,t){this.l=e,this.r=t,this.a=this.b=null}function Da(e,t,r,n){var a=new Oa(e,t);return ua.push(a),r&&za(a,e,t,r),n&&za(a,t,e,n),fa[e.i].edges.push(new Ra(a,e,t)),fa[t.i].edges.push(new Ra(a,t,e)),a}function Pa(e,t,r){var n=new Oa(e,null);return n.a=t,n.b=r,ua.push(n),n}function za(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 Ra(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 Ea(){this._=null}function Ia(e){e.U=e.C=e.L=e.R=e.P=e.N=null}function Fa(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 Na(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 Ha(e){for(;e.L;)e=e.L;return e}function Ba(e,t){var r,n,a,i=e.sort(ja).pop();for(ua=[],fa=new Array(e.length),da=new Ea,ha=new Ea;;)if(a=pa,i&&(!a||i.y<a.y||i.y===a.y&&i.x<a.x))i.x===r&&i.y===n||(fa[i.i]=new ka(i),_a(i),r=i.x,n=i.y),i=e.pop();else{if(!a)break;ba(a.arc)}t&&(function(e){for(var t,r=ua,n=rn(e[0][0],e[0][1],e[1][0],e[1][1]),a=r.length;a--;)(!Ca(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=fa,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 Ra(Pa(i.site,u,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),i.site,null)),++s)}(t));var o={cells:fa,edges:ua};return da=ha=ua=fa=null,o}function ja(e,t){return t.y-e.y||t.x-e.x}ka.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(Ma),t.length},Ra.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}},Ea.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=Ha(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&&(Fa(this,r),r=(e=r).U),r.C=!1,n.C=!0,Na(this,n)):(a=n.L)&&a.C?(r.C=a.C=!1,n.C=!0,e=n):(e===r.L&&(Na(this,r),r=(e=r).U),r.C=!1,n.C=!0,Fa(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?Ha(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,Fa(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,Na(this,t),t=a.R),t.C=a.C,a.C=t.R.C=!1,Fa(this,a),e=this._;break}}else if((t=a.L).C&&(t.C=!1,a.C=!0,Na(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,Fa(this,t),t=a.L),t.C=a.C,a.C=t.L.C=!1,Na(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=ra,r=na,n=t,a=r,i=Va;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 Ba(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 Ba(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 Ba(l(e)).cells.forEach((function(r,n){for(var a,i,o,l,s=r.site,c=r.edges.sort(Ma),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=ht(t=e),o):t},o.y=function(e){return arguments.length?(a=ht(r=e),o):r},o.clipExtent=function(e){return arguments.length?(i=null==e?Va:e,o):i===Va?null:i},o.size=function(e){return arguments.length?o.clipExtent(e&&[[0,0],e]):i===Va?null:i&&i[1]},o};var Va=[[-1e6,-1e6],[1e6,1e6]];function Ua(e){return e.x}function qa(e){return e.y}function Ga(e,t,r,n,a,i){if(!e(t,r,n,a,i)){var o=.5*(r+a),l=.5*(n+i),s=t.nodes;s[0]&&Ga(e,s[0],r,n,o,l),s[1]&&Ga(e,s[1],o,n,a,l),s[2]&&Ga(e,s[2],r,l,o,i),s[3]&&Ga(e,s[3],o,l,a,i)}}function Za(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,T=w+4;w<T;++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}function Ya(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"#"+lt(Math.round(n+o*e))+lt(Math.round(a+l*e))+lt(Math.round(i+s*e))}}function Xa(e,t){var r,n={},a={};for(r in e)r in t?n[r]=Ka(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 Wa(e,t){return e=+e,t=+t,function(r){return e*(1-r)+t*r}}function Qa(e,t){var r,n,a,i=Ja.lastIndex=$a.lastIndex=0,o=-1,l=[],s=[];for(e+="",t+="";(r=Ja.exec(e))&&(n=$a.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:Wa(r,n)})),i=$a.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=ra,l=na;if(i=arguments.length)return o=Ua,l=qa,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=ht(o),x=ht(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,T=v-h;function k(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,u?a=s:o=s,f?i=c:l=c,k(e=e.nodes[d]||(e.nodes[d]={leaf:!0,nodes:[],point:null,x:null,y:null}),t,r,n,a,i,o,l)}w>T?v=h+w:g=p+T;var A={leaf:!0,nodes:[],point:null,x:null,y:null,add:function(e){k(A,e,+m(e,++f),+x(e,f),p,h,g,v)},visit:function(e){Ga(e,A,p,h,g,v)},find:function(e){return Za(A,e[0],e[1],p,h,g,v)}};if(f=-1,null==t){for(;++f<d;)k(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=Ya,e.interpolateObject=Xa,e.interpolateNumber=Wa,e.interpolateString=Qa;var Ja=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,$a=new RegExp(Ja.source,"g");function Ka(t,r){for(var n,a=e.interpolators.length;--a>=0&&!(n=e.interpolators[a](t,r)););return n}function ei(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(Ka(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=Ka,e.interpolators=[function(e,t){var r=typeof t;return("string"===r?pt.has(t.toLowerCase())||/^(#|rgb\(|hsl\()/i.test(t)?Ya:Qa:t instanceof Ve?Ya:Array.isArray(t)?ei:"object"===r&&isNaN(t)?Xa:Wa)(e,t)}],e.interpolateArray=ei;var ti=function(){return O},ri=e.map({linear:ti,poly:function(e){return function(t){return Math.pow(t,e)}},quad:function(){return li},cubic:function(){return si},sin:function(){return ui},exp:function(){return fi},circle:function(){return di},elastic:function(e,t){var r;arguments.length<2&&(t=.45);arguments.length?r=t/Le*Math.asin(1/e):(e=1,r=t/4);return function(n){return 1+e*Math.pow(2,-10*n)*Math.sin((n-r)*Le/t)}},back:function(e){e||(e=1.70158);return function(t){return t*t*((e+1)*t-e)}},bounce:function(){return pi}}),ni=e.map({in:O,out:ii,"in-out":oi,"out-in":function(e){return oi(ii(e))}});function ai(e){return function(t){return t<=0?0:t>=1?1:e(t)}}function ii(e){return function(t){return 1-e(1-t)}}function oi(e){return function(t){return.5*(t<.5?e(2*t):2-e(2-2*t))}}function li(e){return e*e}function si(e){return e*e*e}function ci(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 ui(e){return 1-Math.cos(e*Ce)}function fi(e){return Math.pow(2,10*(e-1))}function di(e){return 1-Math.sqrt(1-e*e)}function pi(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 hi(e,t){return t-=e,function(r){return Math.round(e+t*r)}}function gi(e){var t,r,n,a=[e.a,e.b],i=[e.c,e.d],o=mi(a),l=vi(a,i),s=mi(((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]))*De,this.translate=[e.e,e.f],this.scale=[o,s],this.skew=s?Math.atan2(l,s)*De:0}function vi(e,t){return e[0]*t[0]+e[1]*t[1]}function mi(e){var t=Math.sqrt(vi(e,e));return t&&(e[0]/=t,e[1]/=t),t}e.ease=function(e){var t=e.indexOf("-"),n=t>=0?e.slice(0,t):e,a=t>=0?e.slice(t+1):"in";return n=ri.get(n)||ti,ai((a=ni.get(a)||O)(n.apply(null,r.call(arguments,1))))},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 Xe(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 Ge(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 $e(n+o*e,a+l*e,i+s*e)+""}},e.interpolateRound=hi,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 gi(t?t.matrix:yi)})(t)},gi.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var yi={a:1,b:0,c:0,d:1,e:0,f:0};function xi(e){return e.length?e.pop()+",":""}function bi(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:Wa(e[0],t[0])},{i:a-2,x:Wa(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(xi(r)+"rotate(",null,")")-2,x:Wa(e,t)})):t&&r.push(xi(r)+"rotate("+t+")")}(t.rotate,r.rotate,n,a),function(e,t,r,n){e!==t?n.push({i:r.push(xi(r)+"skewX(",null,")")-2,x:Wa(e,t)}):t&&r.push(xi(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(xi(r)+"scale(",null,",",null,")");n.push({i:a-4,x:Wa(e[0],t[0])},{i:a-2,x:Wa(e[1],t[1])})}else 1===t[0]&&1===t[1]||r.push(xi(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 _i(e,t){return t=(t-=e=+e)||1/t,function(r){return(r-e)/t}}function wi(e,t){return t=(t-=e=+e)||1/t,function(r){return Math.max(0,Math.min(1,(r-e)/t))}}function Ti(e){for(var t=e.source,r=e.target,n=function(e,t){if(e===t)return e;var r=ki(e),n=ki(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 ki(e){for(var t=[],r=e.parent;null!=r;)t.push(e),e=r,r=r.parent;return t.push(e),t}function Mi(e){e.fixed|=2}function Ai(e){e.fixed&=-7}function Li(e){e.fixed|=4,e.px=e.x,e.py=e.y}function Si(e){e.fixed&=-5}e.interpolateTransform=bi,e.layout={},e.layout.bundle=function(){return function(e){for(var t=[],r=-1,n=e.length;++r<n;)t.push(Ti(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=(Le-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,T=u+=_*s;g[x+"-"+b]={index:x,subindex:b,startAngle:w,endAngle:T,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 k=g[p+"-"+h],M=g[h+"-"+p];(k.value||M.value)&&t.push(k.value<M.value?{source:M,target:k}:{source:k,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=Ci,d=Oi,p=-30,h=Di,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,T=m.length,k=y.length;for(l=0;l<k;++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<T;)(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;if(t.charge=0,!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<T;)(f=m[l]).fixed||r.visit(x(f));for(l=-1;++l<T;)(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=wt(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(O).on("dragstart.force",Mi).on("drag.force",b).on("dragend.force",Ai)),!arguments.length)return r;this.on("mouseover.force",Li).on("mouseout.force",Si).call(r)},e.rebind(l,s,"on")};var Ci=20,Oi=1,Di=1/0;function Pi(t,r){return e.rebind(t,r,"sort","children","value"),t.nodes=t,t.links=Ni,t}function zi(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 Ri(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 Ei(e){return e.children}function Ii(e){return e.value}function Fi(e,t){return t.value-e.value}function Ni(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=Fi,t=Ei,r=Ii;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 Ri(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&&(zi(e,(function(e){e.children&&(e.value=0)})),Ri(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},Pi(n,t)},e.layout.pie=function(){var t=Number,r=Hi,n=0,a=Le,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===Hi?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 Hi={};function Bi(e){return e.x}function ji(e){return e.y}function Vi(e,t,r){e.y0=t,e.y=r}e.layout.stack=function(){var t=O,r=Gi,n=Zi,a=Vi,i=Bi,o=ji;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:Ui.get(e)||Gi,l):r},l.offset=function(e){return arguments.length?(n="function"==typeof e?e:qi.get(e)||Zi,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 Ui=e.map({"inside-out":function(t){var r,n,a=t.length,i=t.map(Yi),o=t.map(Xi),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:Gi}),qi=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:Zi});function Gi(t){return e.range(t.length)}function Zi(e){for(var t=-1,r=e[0].length,n=[];++t<r;)n[t]=0;return n}function Yi(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 Xi(e){return e.reduce(Wi,0)}function Wi(e,t){return e+t[1]}function Qi(e,t){return Ji(e,Math.ceil(Math.log(t.length)/Math.LN2+1))}function Ji(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 $i(t){return[e.min(t),e.max(t)]}function Ki(e,t){return e.value-t.value}function eo(e,t){var r=e._pack_next;e._pack_next=t,t._pack_prev=e,t._pack_next=r,r._pack_prev=t}function to(e,t){e._pack_next=t,t._pack_prev=e}function ro(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 no(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(ao),(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(oo(r,n,a=t[2]),x(a),eo(r,a),r._pack_prev=a,eo(a,n),n=r._pack_next,i=3;i<s;i++){oo(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(ro(o,a)){p=1;break}if(1==p)for(l=r._pack_prev;l!==o._pack_prev&&!ro(l,a);l=l._pack_prev,g++);p?(h<g||h==g&&n.r<r.r?to(r,n=o):to(r=l,n),i--):(eo(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(io)}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 ao(e){e._pack_next=e._pack_prev=e}function io(e){delete e._pack_next,delete e._pack_prev}function oo(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 lo(e,t){return e.parent==t.parent?1:2}function so(e){var t=e.children;return t.length?t[0]:e.t}function co(e){var t,r=e.children;return(t=r.length)?r[t-1]:e.t}function uo(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 fo(e,t,r){return e.a.parent===t.parent?e.a:r}function po(e){return{x:e.x,y:e.y,dx:e.dx,dy:e.dy}}function ho(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 go(e){var t=e[0],r=e[e.length-1];return t<r?[t,r]:[r,t]}function vo(e){return e.rangeExtent?e.rangeExtent():go(e.range())}function mo(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 yo(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 xo(e){return e?{floor:function(t){return Math.floor(t/e)*e},ceil:function(t){return Math.ceil(t/e)*e}}:bo}e.layout.histogram=function(){var t=!0,r=Number,n=$i,a=Qi;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=ht(e),i):n},i.bins=function(e){return arguments.length?(a="number"==typeof e?function(t){return Ji(t,e)}:ht(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(Ki),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,Ri(l,(function(e){e.r=+u(e.value)})),Ri(l,no),n){var f=n*(t?1:Math.max(2*l.r/s,2*l.r/c))/2;Ri(l,(function(e){e.r+=f})),Ri(l,no),Ri(l,(function(e){e.r-=f}))}return function e(t,r,n,a){var i=t.children;if(t.x=r+=a*t.x,t.y=n+=a*t.y,t.r*=a,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},Pi(i,r)},e.layout.tree=function(){var t=e.layout.hierarchy().sort(null).value(null),r=lo,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(Ri(f,o),f.parent.m=-f.z,zi(f,l),a)zi(u,s);else{var d=u,p=u,h=u;zi(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);zi(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=co(l),i=so(i),l&&i;)s=so(s),(o=co(o)).a=e,(a=l.z+f-i.z-c+r(l._,i._))>0&&(uo(fo(l,e,n),e,a),c+=a,u+=a),f+=l.m,c+=i.m,d+=s.m,u+=o.m;l&&!co(o)&&(o.t=l,o.m+=f-u),i&&!so(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},Pi(i,t)},e.layout.cluster=function(){var t=e.layout.hierarchy().sort(null).value(null),r=lo,n=[1,1],a=!1;function i(i,o){var l,s=t.call(this,i,o),c=s[0],u=0;Ri(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 Ri(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},Pi(i,t)},e.layout.treemap=function(){var t,r=e.layout.hierarchy(),n=Math.round,a=[1,1],i=null,o=po,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){var r=e.call(g,t,t.depth);return null==r?po(t):ho(t,"number"==typeof r?[r,r,r,r]:r)}function r(t){return ho(t,e)}var n;return o=null==(i=e)?po:"function"==(n=typeof e)?t:"number"===n?(e=[e,e,e,e],r):r,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},Pi(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 bo={floor:O,ceil:O};function _o(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 wo(t,r){return e.rebind(t,r,"range","rangeRound","interpolate","clamp")}function To(e,t){return yo(e,xo(ko(e,t)[2])),yo(e,xo(ko(e,t)[2])),e}function ko(e,t){null==t&&(t=10);var r=go(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 Mo(t,r){return e.range.apply(e,ko(t,r))}function Ao(t,r,n){var a=ko(t,r);if(n){var i=Ct.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]="."+So(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=So(t[2]);return e in Lo?Math.abs(r-So(Math.max(y(t[0]),y(t[1]))))+ +("e"!==e):r-2*("%"===e)}(i[8],a)),n=i.join("")}else n=",."+So(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?_o:mo,l=a?wi:_i;return i=e(t,r,l,n),o=e(r,t,l,Ka),s}function s(e){return i(e)}return 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(hi)},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 Mo(t,e)},s.tickFormat=function(e,r){return Ao(t,e,r)},s.nice=function(e){return To(t,e),l()},s.copy=function(){return e(t,r,n,a)},l()}([0,1],[0,1],Ka,!1)};var Lo={s:1,g:1,p:1,r:1,e:1};function So(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))}return 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=yo(i.map(o),a?Math:Oo);return r.domain(e),i=e.map(l),s},s.ticks=function(){var e=go(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(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 Co;arguments.length<2?r=Co:"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)},wo(s,r)}(e.scale.linear().domain([0,1]),10,!0,[1,10])};var Co=e.format(".0e"),Oo={floor:function(e){return-Math.ceil(-e)},ceil:function(e){return-Math.floor(-e)}};function Do(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=Do(r),i=Do(1/r);function o(e){return t(a(e))}return 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 Mo(n,e)},o.tickFormat=function(e,t){return Ao(n,e,t)},o.nice=function(e){return o.domain(To(n,e))},o.exponent=function(e){return arguments.length?(a=Do(r=e),i=Do(1/r),t.domain(n.map(a)),o):r},o.copy=function(){return e(t.copy(),r,n)},wo(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}))}return l.domain=function(e){if(!arguments.length)return r;r=[],a=new _;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 go(n.a[0])},l.copy=function(){return t(r,n)},l.domain(r)}([],{t:"range",a:[[]]})},e.scale.category10=function(){return e.scale.ordinal().range(Po)},e.scale.category20=function(){return e.scale.ordinal().range(zo)},e.scale.category20b=function(){return e.scale.ordinal().range(Ro)},e.scale.category20c=function(){return e.scale.ordinal().range(Eo)};var Po=[2062260,16744206,2924588,14034728,9725885,9197131,14907330,8355711,12369186,1556175].map(it),zo=[2062260,11454440,16744206,16759672,2924588,10018698,14034728,16750742,9725885,12955861,9197131,12885140,14907330,16234194,8355711,13092807,12369186,14408589,1556175,10410725].map(it),Ro=[3750777,5395619,7040719,10264286,6519097,9216594,11915115,13556636,9202993,12426809,15186514,15190932,8666169,11356490,14049643,15177372,8077683,10834324,13528509,14589654].map(it),Eo=[3244733,7057110,10406625,13032431,15095053,16616764,16625259,16634018,3253076,7652470,10607003,13101504,7695281,10394312,12369372,14342891,6513507,9868950,12434877,14277081].map(it);function Io(){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)]}return 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)},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}return 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)},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)]}return 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)},a}([.5],[0,1])},e.scale.identity=function(){return function e(t){function r(e){return+e}return r.invert=r,r.domain=r.range=function(e){return arguments.length?(t=e.map(r),r):t},r.ticks=function(e){return Mo(t,e)},r.tickFormat=function(e,r){return Ao(t,e,r)},r.copy=function(){return e(t)},r}([0,1])},e.svg={},e.svg.arc=function(){var e=No,t=Ho,r=Io,n=Fo,a=Bo,i=jo,o=Vo;function l(){var l=Math.max(0,+e.apply(this,arguments)),c=Math.max(0,+t.apply(this,arguments)),u=a.apply(this,arguments)-Ce,f=i.apply(this,arguments)-Ce,d=Math.abs(f-u),p=u>f?0:1;if(c<l&&(h=c,c=l,l=h),d>=Se)return s(c,p)+(l?s(l,1-p):"")+"Z";var h,g,v,m,y,x,b,_,w,T,k,M,A=0,L=0,S=[];if((m=(+o.apply(this,arguments)||0)/2)&&(v=n===Fo?Math.sqrt(l*l+c*c):+n.apply(this,arguments),p||(L*=-1),c&&(L=Ee(v/c*Math.sin(m))),l&&(A=Ee(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)<=Ae?0:1;if(L&&Uo(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),T=l*Math.sin(f-A),k=l*Math.cos(u+A),M=l*Math.sin(u+A);var D=Math.abs(u-f+2*A)<=Ae?0:1;if(A&&Uo(w,T,k,M)===1-p^D){var P=(u+f)/2;w=l*Math.cos(P),T=l*Math.sin(P),k=M=null}}else w=T=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<Ae){var E=null==k?[w,T]:null==b?[y,x]:sa([y,x],[k,M],[b,_],[w,T]),I=y-E[0],F=x-E[1],N=b-E[0],H=_-E[1],B=1/Math.sin(Math.acos((I*N+F*H)/(Math.sqrt(I*I+F*F)*Math.sqrt(N*N+H*H)))/2),j=Math.sqrt(E[0]*E[0]+E[1]*E[1]);R=Math.min(h,(l-j)/(B-1)),z=Math.min(h,(c-j)/(B+1))}if(null!=b){var V=qo(null==k?[w,T]:[k,M],[y,x],c,z,p),U=qo([b,_],[w,T],c,z,p);h===z?S.push("M",V[0],"A",z,",",z," 0 0,",g," ",V[1],"A",c,",",c," 0 ",1-p^Uo(V[1][0],V[1][1],U[1][0],U[1][1]),",",p," ",U[1],"A",z,",",z," 0 0,",g," ",U[0]):S.push("M",V[0],"A",z,",",z," 0 1,",g," ",U[0])}else S.push("M",y,",",x);if(null!=k){var q=qo([y,x],[k,M],l,-R,p),G=qo([w,T],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^Uo(G[1][0],G[1][1],q[1][0],q[1][1]),",",1-p," ",q[1],"A",R,",",R," 0 0,",g," ",q[0]):S.push("L",G[0],"A",R,",",R," 0 0,",g," ",q[0])}else S.push("L",w,",",T)}else S.push("M",y,",",x),null!=b&&S.push("A",c,",",c," 0 ",C,",",p," ",b,",",_),S.push("L",w,",",T),null!=k&&S.push("A",l,",",l," 0 ",D,",",1-p," ",k,",",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=ht(t),l):e},l.outerRadius=function(e){return arguments.length?(t=ht(e),l):t},l.cornerRadius=function(e){return arguments.length?(r=ht(e),l):r},l.padRadius=function(e){return arguments.length?(n=e==Fo?Fo:ht(e),l):n},l.startAngle=function(e){return arguments.length?(a=ht(e),l):a},l.endAngle=function(e){return arguments.length?(i=ht(e),l):i},l.padAngle=function(e){return arguments.length?(o=ht(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-Ce;return[Math.cos(n)*r,Math.sin(n)*r]},l};var Fo="auto";function No(e){return e.innerRadius}function Ho(e){return e.outerRadius}function Bo(e){return e.startAngle}function jo(e){return e.endAngle}function Vo(e){return e&&e.padAngle}function Uo(e,t,r,n){return(e-r)*t-(t-n)*e>0?0:1}function qo(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,T=(-b*v-m*_)/y,k=(b*m+v*_)/y,M=(-b*v+m*_)/y,A=w-h,L=T-g,S=k-h,C=M-g;return A*A+L*L>S*S+C*C&&(w=k,T=M),[[w-s,T-c],[w*r/x,T*r/x]]}function Go(e){var t=ra,r=na,n=Zr,a=Yo,i=a.key,o=.7;function l(i){var l,s=[],c=[],u=-1,f=i.length,d=ht(t),p=ht(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=Zo.get(e)||Yo).key,l):i},l.tension=function(e){return arguments.length?(o=e,l):o},l}e.svg.line=function(){return Go(O)};var Zo=e.map({linear:Yo,"linear-closed":Xo,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":Wo,"step-after":Qo,basis:Ko,"basis-open":function(e){if(e.length<4)return Yo(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(el(nl,i)+","+el(nl,o)),--n;for(;++n<a;)t=e[n],i.shift(),i.push(t[0]),o.shift(),o.push(t[1]),al(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=[el(nl,o),",",el(nl,l)],--n;for(;++n<i;)r=e[n%a],o.shift(),o.push(r[0]),l.shift(),l.push(r[1]),al(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 Ko(e)},cardinal:function(e,t){return e.length<3?Yo(e):e[0]+Jo(e,$o(e,t))},"cardinal-open":function(e,t){return e.length<4?Yo(e):e[1]+Jo(e.slice(1,-1),$o(e,t))},"cardinal-closed":function(e,t){return e.length<3?Xo(e):e[0]+Jo((e.push(e[0]),e),$o([e[e.length-2]].concat(e,[e[1]]),t))},monotone:function(e){return e.length<3?Yo(e):e[0]+Jo(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]=il(a,i);for(;++t<r;)n[t]=(o+(o=il(a=i,i=e[t+1])))/2;return n[t]=o,n}(e),l=-1,s=e.length-1;for(;++l<s;)t=il(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 Yo(e){return e.length>1?e.join("L"):e+"Z"}function Xo(e){return e.join("L")+"Z"}function Wo(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 Qo(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 Jo(e,t){if(t.length<1||e.length!=t.length&&e.length!=t.length+2)return Yo(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 $o(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 Ko(e){if(e.length<3)return Yo(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",el(nl,o),",",el(nl,l)];for(e.push(e[r-1]);++t<=r;)n=e[t],o.shift(),o.push(n[0]),l.shift(),l.push(n[1]),al(s,o,l);return e.pop(),s.push("L",n),s.join("")}function el(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}Zo.forEach((function(e,t){t.key=e,t.closed=/-closed$/.test(e)}));var tl=[0,2/3,1/3,0],rl=[0,1/3,2/3,0],nl=[0,1/6,2/3,1/6];function al(e,t,r){e.push("C",el(tl,t),",",el(tl,r),",",el(rl,t),",",el(rl,r),",",el(nl,t),",",el(nl,r))}function il(e,t){return(t[1]-e[1])/(t[0]-e[0])}function ol(e){for(var t,r,n,a=-1,i=e.length;++a<i;)r=(t=e[a])[0],n=t[1]-Ce,t[0]=r*Math.cos(n),t[1]=r*Math.sin(n);return e}function ll(e){var t=ra,r=ra,n=0,a=na,i=Zr,o=Yo,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=ht(t),b=ht(n),_=t===r?function(){return d}:ht(r),w=n===a?function(){return p}:ht(a);function T(){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&&(T(),g=[],v=[]);return g.length&&T(),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=Zo.get(e)||Yo).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 sl(e){return e.radius}function cl(e){return[e.x,e.y]}function ul(e){return function(){var t=e.apply(this,arguments),r=t[0],n=t[1]-Ce;return[r*Math.cos(n),r*Math.sin(n)]}}function fl(){return 64}function dl(){return"circle"}function pl(e){var t=Math.sqrt(e/Ae);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=Go(ol);return e.radius=e.x,delete e.x,e.angle=e.y,delete e.y,e},Wo.reverse=Qo,Qo.reverse=Wo,e.svg.area=function(){return ll(O)},e.svg.area.radial=function(){var e=ll(ol);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=Vn,t=Un,r=sl,n=Bo,a=jo;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)-Ce,u=a.call(e,l,o)-Ce;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>Ae)+",1 "+t}function s(e,t,r,n){return"Q 0,0 "+n}return i.radius=function(e){return arguments.length?(r=ht(e),i):r},i.source=function(t){return arguments.length?(e=ht(t),i):e},i.target=function(e){return arguments.length?(t=ht(e),i):t},i.startAngle=function(e){return arguments.length?(n=ht(e),i):n},i.endAngle=function(e){return arguments.length?(a=ht(e),i):a},i},e.svg.diagonal=function(){var e=Vn,t=Un,r=cl;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=ht(t),n):e},n.target=function(e){return arguments.length?(t=ht(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=cl,n=t.projection;return t.projection=function(e){return arguments.length?n(ul(r=e)):r},t},e.svg.symbol=function(){var e=dl,t=fl;function r(r,n){return(hl.get(e.call(this,r,n))||pl)(t.call(this,r,n))}return r.type=function(t){return arguments.length?(e=ht(t),r):e},r.size=function(e){return arguments.length?(t=ht(e),r):t},r};var hl=e.map({circle:pl,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*vl)),r=t*vl;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/gl),r=t*gl/2;return"M0,"+r+"L"+t+","+-r+" "+-t+","+-r+"Z"},"triangle-up":function(e){var t=Math.sqrt(e/gl),r=t*gl/2;return"M0,"+-r+"L"+t+","+r+" "+-t+","+r+"Z"}});e.svg.symbolTypes=hl.keys();var gl=Math.sqrt(3),vl=Math.tan(30*Oe);Z.transition=function(e){for(var t,r,n=bl||++Tl,a=Al(e),i=[],o=_l||{time:Date.now(),ease:ci,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])&&Ll(r,u,a,n,o),t.push(r)}return xl(i,a,n)},Z.interrupt=function(e){return this.each(null==e?ml:yl(Al(e)))};var ml=yl(Al());function yl(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 xl(e,t,r){return j(e,wl),e.namespace=t,e.id=r,e}var bl,_l,wl=[],Tl=0;function kl(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 Ml(e){return null==e&&(e=""),function(){this.textContent=e}}function Al(e){return null==e?"__transition__":"__transition_"+e+"__"}function Ll(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,wt((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=wt((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 _,time:i,timer:o,delay:a.delay,duration:a.duration,ease:a.ease,index:t},a=null,++u.count)}wl.call=Z.call,wl.empty=Z.empty,wl.node=Z.node,wl.size=Z.size,e.transition=function(t,r){return t&&t.transition?bl?t.transition(r):t:e.selection().transition(t)},e.transition.prototype=wl,wl.select=function(e){var t,r,n,a=this.id,i=this.namespace,o=[];e=Y(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__),Ll(r,u,i,a,n[i][a]),t.push(r)):t.push(null)}return xl(o,i,a)},wl.selectAll=function(e){var t,r,n,a,i,o=this.id,l=this.namespace,s=[];e=X(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])&&Ll(a,h,l,o,i),t.push(a)}return xl(s,l,o)},wl.filter=function(e){var t,r,n=[];"function"!=typeof e&&(e=se(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 xl(n,this.namespace,this.id)},wl.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)})},wl.attr=function(t,r){if(arguments.length<2){for(r in t)this.attr(r,t[r]);return this}var n="transform"==t?bi:Ka,a=e.ns.qualify(t);function i(){this.removeAttribute(a)}function o(){this.removeAttributeNS(a.space,a.local)}function l(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))})})}function s(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))})})}return kl(this,"attr."+t,r,a.local?s:l)},wl.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))}})},wl.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)}function i(t){return null==t?a:(t+="",function(){var n,a=o(this).getComputedStyle(this,null).getPropertyValue(e);return a!==t&&(n=Ka(a,t),function(t){this.style.setProperty(e,n(t),r)})})}return kl(this,"style."+e,t,i)},wl.styleTween=function(e,t,r){function n(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)}}return arguments.length<3&&(r=""),this.tween("style."+e,n)},wl.text=function(e){return kl(this,"text",e,Ml)},wl.remove=function(){var e=this.namespace;return this.each("end.transition",(function(){var t;this[e].count<2&&(t=this.parentNode)&&t.removeChild(this)}))},wl.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})))},wl.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}))},wl.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}))},wl.each=function(t,r){var n=this.id,a=this.namespace;if(arguments.length<2){var i=_l,o=bl;try{bl=n,ue(this,(function(e,r,i){_l=e[a][n],t.call(e,e.__data__,r,i)}))}finally{_l=i,bl=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},wl.transition=function(){for(var e,t,r,n=this.id,a=++Tl,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])&&Ll(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 xl(o,i,a)},e.svg.axis=function(){var t,r=e.scale.linear(),a=Sl,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):O: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=vo(d),_=u.selectAll(".domain").data([0]),w=(_.enter().append("path").attr("class","domain"),e.transition(_));v.append("line"),v.append("text");var T,k,M,A,L=v.select("line"),S=y.select("line"),C=g.select("text").text(h),D=v.select("text"),P=y.select("text"),z="top"===a||"left"===a?-1:1;if("bottom"===a||"top"===a?(n=Ol,T="x",M="y",k="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=Dl,T="y",M="x",k="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),D.attr(M,z*x),S.attr(k,0).attr(A,z*i),P.attr(T,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 Cl?e+"":Sl,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 Sl="bottom",Cl={top:1,right:1,bottom:1,left:1};function Ol(e,t,r){e.attr("transform",(function(e){var n=t(e);return"translate("+(isFinite(n)?n:r(e))+",0)"}))}function Dl(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=H(d,"brushstart","brush","brushend"),a=null,i=null,l=[0,0],s=[0,0],c=!0,u=!0,f=zl[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,O);n.exit().remove(),n.enter().append("g").attr("class",(function(e){return"resize "+e})).style("cursor",(function(e){return Pl[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=vo(a),s.attr("x",o[0]).attr("width",o[1]-o[0]),h(l)),i&&(o=vo(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,T=!/^(e|w)$/.test(_)&&i,k=y.classed("extent"),M=be(m),A=e.mouse(m),L=e.select(o(m)).on("keydown.brush",O).on("keyup.brush",D);if(e.event.changedTouches?L.on("touchmove.brush",P).on("touchend.brush",R):L.on("mousemove.brush",P).on("mouseup.brush",R),b.interrupt().selectAll("*").interrupt(),k)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(){32==e.event.keyCode&&(k||(f=null,A[0]-=l[1],A[1]-=s[1],k=2),F())}function D(){32==e.event.keyCode&&2==k&&(A[0]+=l[1],A[1]+=s[1],k=0,F())}function P(){var t=e.mouse(m),r=!1;v&&(t[0]+=v[0],t[1]+=v[1]),k||(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&&z(t,a,0)&&(h(b),r=!0),T&&z(t,i,1)&&(g(b),r=!0),r&&(p(b),x({type:"brush",mode:k?"move":"resize"}))}function z(e,n,a){var i,o,d=vo(n),p=d[0],h=d[1],g=A[a],v=a?s:l,m=v[1]-v[0];if(k&&(p-=g,h-=m+g),i=(a?u:c)?Math.max(p,Math.min(h,e[a])):e[a],k?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 R(){P(),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"}),P()}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,bl?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=ei(l,i.x),n=ei(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=zl[!(a=e)<<1|!i],d):a},d.y=function(e){return arguments.length?(f=zl[!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 Pl={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},zl=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]],Rl=Pt.format=lr.timeFormat,El=Rl.utc,Il=El("%Y-%m-%dT%H:%M:%S.%LZ");function Fl(e){return e.toISOString()}function Nl(t,r,n){function a(e){return t(e)}function i(t,n){var a=(t[1]-t[0])/n,i=e.bisect(Bl,a);return i==Bl.length?[r.year,ko(t.map((function(e){return e/31536e6})),n)[2]]:i?r[a/Bl[i-1]<Bl[i]/a?i-1:i]:[Ul,ko(t,n)[2]]}return a.invert=function(e){return Hl(t.invert(e))},a.domain=function(e){return arguments.length?(t.domain(e),a):t.domain().map(Hl)},a.nice=function(e,t){var r=a.domain(),n=go(r),o=null==e?i(n,10):"number"==typeof e&&i(n,e);function l(r){return!isNaN(r)&&!e.range(r,Hl(+r+1),t).length}return o&&(e=o[0],t=o[1]),a.domain(yo(r,t>1?{floor:function(t){for(;l(t=e.floor(t));)t=Hl(t-1);return t},ceil:function(t){for(;l(t=e.ceil(t));)t=Hl(+t+1);return t}}:e))},a.ticks=function(e,t){var r=go(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],Hl(+r[1]+1),t<1?1:t)},a.tickFormat=function(){return n},a.copy=function(){return Nl(t.copy(),r,n)},wo(a,t)}function Hl(e){return new Date(e)}Rl.iso=Date.prototype.toISOString&&+new Date("2000-01-01T00:00:00.000Z")?Fl:Il,Fl.parse=function(e){var t=new Date(e);return isNaN(t)?null:t},Fl.toString=Il.toString,Pt.second=It((function(e){return new zt(1e3*Math.floor(e/1e3))}),(function(e,t){e.setTime(e.getTime()+1e3*Math.floor(t))}),(function(e){return e.getSeconds()})),Pt.seconds=Pt.second.range,Pt.seconds.utc=Pt.second.utc.range,Pt.minute=It((function(e){return new zt(6e4*Math.floor(e/6e4))}),(function(e,t){e.setTime(e.getTime()+6e4*Math.floor(t))}),(function(e){return e.getMinutes()})),Pt.minutes=Pt.minute.range,Pt.minutes.utc=Pt.minute.utc.range,Pt.hour=It((function(e){var t=e.getTimezoneOffset()/60;return new zt(36e5*(Math.floor(e/36e5-t)+t))}),(function(e,t){e.setTime(e.getTime()+36e5*Math.floor(t))}),(function(e){return e.getHours()})),Pt.hours=Pt.hour.range,Pt.hours.utc=Pt.hour.utc.range,Pt.month=It((function(e){return(e=Pt.day(e)).setDate(1),e}),(function(e,t){e.setMonth(e.getMonth()+t)}),(function(e){return e.getMonth()})),Pt.months=Pt.month.range,Pt.months.utc=Pt.month.utc.range;var Bl=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],jl=[[Pt.second,1],[Pt.second,5],[Pt.second,15],[Pt.second,30],[Pt.minute,1],[Pt.minute,5],[Pt.minute,15],[Pt.minute,30],[Pt.hour,1],[Pt.hour,3],[Pt.hour,6],[Pt.hour,12],[Pt.day,1],[Pt.day,2],[Pt.week,1],[Pt.month,1],[Pt.month,3],[Pt.year,1]],Vl=Rl.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]]),Ul={range:function(t,r,n){return e.range(Math.ceil(t/n)*n,+r,n).map(Hl)},floor:O,ceil:O};jl.year=Pt.year,Pt.scale=function(){return Nl(e.scale.linear(),jl,Vl)};var ql=jl.map((function(e){return[e[0].utc,e[1]]})),Gl=El.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 Zl(e){return JSON.parse(e.responseText)}function Yl(e){var t=a.createRange();return t.selectNode(a.body),t.createContextualFragment(e.responseText)}ql.year=Pt.year.utc,Pt.scale.utc=function(){return Nl(e.scale.linear(),ql,Gl)},e.text=gt((function(e){return e.responseText})),e.json=function(e,t){return vt(e,"application/json",Zl,t)},e.html=function(e,t){return vt(e,"text/html",Yl,t)},e.xml=gt((function(e){return e.responseXML})),"object"==typeof t&&t.exports?t.exports=e:this.d3=e}()},{}],17:[function(e,t,r){(function(n,a){(function(){
/*!
* @overview es6-promise - a tiny implementation of Promises/A+.
* @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)
* @license Licensed under MIT license
* See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE
* @version v4.2.8+1e68dce6
*/
!function(e,n){"object"==typeof r&&"undefined"!=typeof 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&&"undefined"!=typeof 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=this,n=new this.constructor(M);void 0===n[k]&&E(n);var a=r._state;if(a){var i=arguments[a-1];s((function(){return z(a,n,i,r._result)}))}else D(r,n,e,t);return n}function T(e){if(e&&"object"==typeof e&&e.constructor===this)return e;var t=new this(M);return L(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 e=Function("return this")().require("vertx");return"undefined"!=typeof(o=e.runOnLoop||e.runOnContext)?function(){o(v)}:h()}catch(e){return h()}}():h();var k=Math.random().toString(36).substring(2);function M(){}function A(e,r,n){r.constructor===e.constructor&&n===w&&r.constructor.resolve===T?function(e,t){1===t._state?C(e,t._result):2===t._state?O(e,t._result):D(t,void 0,(function(t){return L(e,t)}),(function(t){return O(e,t)}))}(e,r):void 0===n?C(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?L(e,r):C(e,r))}),(function(t){n||(n=!0,O(e,t))}),e._label);!n&&a&&(n=!0,O(e,a))}),e)}(e,r,n):C(e,r)}function L(e,t){if(e===t)O(e,new TypeError("You cannot resolve a promise with itself"));else if(a=typeof(n=t),null===n||"object"!==a&&"function"!==a)C(e,t);else{var r=void 0;try{r=t.then}catch(t){return void O(e,t)}A(e,t,r)}var n,a}function S(e){e._onerror&&e._onerror(e._result),P(e)}function C(e,t){void 0===e._state&&(e._result=t,e._state=1,0!==e._subscribers.length&&s(P,e))}function O(e,t){void 0===e._state&&(e._state=2,e._result=t,s(S,e))}function D(e,t,r,n){var a=e._subscribers,i=a.length;e._onerror=null,a[i]=t,a[i+1]=r,a[i+2]=n,0===i&&e._state&&s(P,e)}function P(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?z(r,n,a,i):a(i);e._subscribers.length=0}}function z(e,r,n,a){var i=t(n),o=void 0,l=void 0,s=!0;if(i){try{o=n(a)}catch(e){s=!1,l=e}if(r===o)return void O(r,new TypeError("A promises callback cannot return that same promise."))}else o=a;void 0!==r._state||(i&&s?L(r,o):!1===s?O(r,l):1===e?C(r,o):2===e&&O(r,o))}var R=0;function E(e){e[k]=R++,e._state=void 0,e._result=void 0,e._subscribers=[]}var I=function(){function e(e,t){this._instanceConstructor=e,this.promise=new e(M),this.promise[k]||E(this.promise),r(t)?(this.length=t.length,this._remaining=t.length,this._result=new Array(this.length),0===this.length?C(this.promise,this._result):(this.length=this.length||0,this._enumerate(t),0===this._remaining&&C(this.promise,this._result))):O(this.promise,new Error("Array Methods must be provided an Array"))}return e.prototype._enumerate=function(e){for(var t=0;void 0===this._state&&t<e.length;t++)this._eachEntry(e[t],t)},e.prototype._eachEntry=function(e,t){var r=this._instanceConstructor,n=r.resolve;if(n===T){var a=void 0,i=void 0,o=!1;try{a=e.then}catch(e){o=!0,i=e}if(a===w&&void 0!==e._state)this._settledAt(e._state,t,e._result);else if("function"!=typeof a)this._remaining--,this._result[t]=e;else if(r===F){var l=new r(M);o?O(l,i):A(l,e,a),this._willSettleAt(l,t)}else this._willSettleAt(new r((function(t){return t(e)})),t)}else this._willSettleAt(n(e),t)},e.prototype._settledAt=function(e,t,r){var n=this.promise;void 0===n._state&&(this._remaining--,2===e?O(n,r):this._result[t]=r),0===this._remaining&&C(n,this._result)},e.prototype._willSettleAt=function(e,t){var r=this;D(e,void 0,(function(e){return r._settledAt(1,t,e)}),(function(e){return r._settledAt(2,t,e)}))},e}();var F=function(){function e(t){this[k]=R++,this._result=this._state=void 0,this._subscribers=[],M!==t&&("function"!=typeof t&&function(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}(),this instanceof e?function(e,t){try{t((function(t){L(e,t)}),(function(t){O(e,t)}))}catch(t){O(e,t)}}(this,t):function(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}())}return e.prototype.catch=function(e){return this.then(null,e)},e.prototype.finally=function(e){var r=this.constructor;return t(e)?this.then((function(t){return r.resolve(e()).then((function(){return t}))}),(function(t){return r.resolve(e()).then((function(){throw t}))})):this.then(e,e)},e}();return F.prototype.then=w,F.all=function(e){return new I(this,e).promise},F.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."))}))},F.resolve=T,F.reject=function(e){var t=new this(M);return O(t,e),t},F._setScheduler=function(e){l=e},F._setAsap=function(e){s=e},F._asap=s,F.polyfill=function(){var e=void 0;if("undefined"!=typeof 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=F},F.Promise=F,F}))}).call(this)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:64}],18:[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":53}],19:[function(e,t,r){t.exports=function(e,t){var r=t[0],n=t[1],a=t[2],i=t[3],o=t[4],l=t[5],s=t[6],c=t[7],u=t[8],f=t[9],d=t[10],p=t[11],h=t[12],g=t[13],v=t[14],m=t[15];return e[0]=l*(d*m-p*v)-f*(s*m-c*v)+g*(s*p-c*d),e[1]=-(n*(d*m-p*v)-f*(a*m-i*v)+g*(a*p-i*d)),e[2]=n*(s*m-c*v)-l*(a*m-i*v)+g*(a*c-i*s),e[3]=-(n*(s*p-c*d)-l*(a*p-i*d)+f*(a*c-i*s)),e[4]=-(o*(d*m-p*v)-u*(s*m-c*v)+h*(s*p-c*d)),e[5]=r*(d*m-p*v)-u*(a*m-i*v)+h*(a*p-i*d),e[6]=-(r*(s*m-c*v)-o*(a*m-i*v)+h*(a*c-i*s)),e[7]=r*(s*p-c*d)-o*(a*p-i*d)+u*(a*c-i*s),e[8]=o*(f*m-p*g)-u*(l*m-c*g)+h*(l*p-c*f),e[9]=-(r*(f*m-p*g)-u*(n*m-i*g)+h*(n*p-i*f)),e[10]=r*(l*m-c*g)-o*(n*m-i*g)+h*(n*c-i*l),e[11]=-(r*(l*p-c*f)-o*(n*p-i*f)+u*(n*c-i*l)),e[12]=-(o*(f*v-d*g)-u*(l*v-s*g)+h*(l*d-s*f)),e[13]=r*(f*v-d*g)-u*(n*v-a*g)+h*(n*d-a*f),e[14]=-(r*(l*v-s*g)-o*(n*v-a*g)+h*(n*s-a*l)),e[15]=r*(l*d-s*f)-o*(n*d-a*f)+u*(n*s-a*l),e}},{}],20:[function(e,t,r){t.exports=function(e){var t=new Float32Array(16);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}},{}],21:[function(e,t,r){t.exports=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}},{}],22:[function(e,t,r){t.exports=function(){var e=new Float32Array(16);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}},{}],23:[function(e,t,r){t.exports=function(e){var t=e[0],r=e[1],n=e[2],a=e[3],i=e[4],o=e[5],l=e[6],s=e[7],c=e[8],u=e[9],f=e[10],d=e[11],p=e[12],h=e[13],g=e[14],v=e[15];return(t*o-r*i)*(f*v-d*g)-(t*l-n*i)*(u*v-d*h)+(t*s-a*i)*(u*g-f*h)+(r*l-n*o)*(c*v-d*p)-(r*s-a*o)*(c*g-f*p)+(n*s-a*l)*(c*h-u*p)}},{}],24:[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}},{}],25:[function(e,t,r){t.exports=function(e,t,r){var n,a,i,o=r[0],l=r[1],s=r[2],c=Math.sqrt(o*o+l*l+s*s);if(Math.abs(c)<1e-6)return null;return o*=c=1/c,l*=c,s*=c,n=Math.sin(t),a=Math.cos(t),i=1-a,e[0]=o*o*i+a,e[1]=l*o*i+s*n,e[2]=s*o*i-l*n,e[3]=0,e[4]=o*l*i-s*n,e[5]=l*l*i+a,e[6]=s*l*i+o*n,e[7]=0,e[8]=o*s*i+l*n,e[9]=l*s*i-o*n,e[10]=s*s*i+a,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}},{}],26:[function(e,t,r){t.exports=function(e,t,r){var n=t[0],a=t[1],i=t[2],o=t[3],l=n+n,s=a+a,c=i+i,u=n*l,f=n*s,d=n*c,p=a*s,h=a*c,g=i*c,v=o*l,m=o*s,y=o*c;return e[0]=1-(p+g),e[1]=f+y,e[2]=d-m,e[3]=0,e[4]=f-y,e[5]=1-(u+g),e[6]=h+v,e[7]=0,e[8]=d+m,e[9]=h-v,e[10]=1-(u+p),e[11]=0,e[12]=r[0],e[13]=r[1],e[14]=r[2],e[15]=1,e}},{}],27:[function(e,t,r){t.exports=function(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t[1],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t[2],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}},{}],28:[function(e,t,r){t.exports=function(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=t[0],e[13]=t[1],e[14]=t[2],e[15]=1,e}},{}],29:[function(e,t,r){t.exports=function(e,t){var r=Math.sin(t),n=Math.cos(t);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=n,e[6]=r,e[7]=0,e[8]=0,e[9]=-r,e[10]=n,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}},{}],30:[function(e,t,r){t.exports=function(e,t){var r=Math.sin(t),n=Math.cos(t);return e[0]=n,e[1]=0,e[2]=-r,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=r,e[9]=0,e[10]=n,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}},{}],31:[function(e,t,r){t.exports=function(e,t){var r=Math.sin(t),n=Math.cos(t);return e[0]=n,e[1]=r,e[2]=0,e[3]=0,e[4]=-r,e[5]=n,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}},{}],32:[function(e,t,r){t.exports=function(e,t,r,n,a,i,o){var l=1/(r-t),s=1/(a-n),c=1/(i-o);return e[0]=2*i*l,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=2*i*s,e[6]=0,e[7]=0,e[8]=(r+t)*l,e[9]=(a+n)*s,e[10]=(o+i)*c,e[11]=-1,e[12]=0,e[13]=0,e[14]=o*i*2*c,e[15]=0,e}},{}],33:[function(e,t,r){t.exports=function(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}},{}],34:[function(e,t,r){t.exports={create:e("./create"),clone:e("./clone"),copy:e("./copy"),identity:e("./identity"),transpose:e("./transpose"),invert:e("./invert"),adjoint:e("./adjoint"),determinant:e("./determinant"),multiply:e("./multiply"),translate:e("./translate"),scale:e("./scale"),rotate:e("./rotate"),rotateX:e("./rotateX"),rotateY:e("./rotateY"),rotateZ:e("./rotateZ"),fromRotation:e("./fromRotation"),fromRotationTranslation:e("./fromRotationTranslation"),fromScaling:e("./fromScaling"),fromTranslation:e("./fromTranslation"),fromXRotation:e("./fromXRotation"),fromYRotation:e("./fromYRotation"),fromZRotation:e("./fromZRotation"),fromQuat:e("./fromQuat"),frustum:e("./frustum"),perspective:e("./perspective"),perspectiveFromFieldOfView:e("./perspectiveFromFieldOfView"),ortho:e("./ortho"),lookAt:e("./lookAt"),str:e("./str")}},{"./adjoint":19,"./clone":20,"./copy":21,"./create":22,"./determinant":23,"./fromQuat":24,"./fromRotation":25,"./fromRotationTranslation":26,"./fromScaling":27,"./fromTranslation":28,"./fromXRotation":29,"./fromYRotation":30,"./fromZRotation":31,"./frustum":32,"./identity":33,"./invert":35,"./lookAt":36,"./multiply":37,"./ortho":38,"./perspective":39,"./perspectiveFromFieldOfView":40,"./rotate":41,"./rotateX":42,"./rotateY":43,"./rotateZ":44,"./scale":45,"./str":46,"./translate":47,"./transpose":48}],35:[function(e,t,r){t.exports=function(e,t){var r=t[0],n=t[1],a=t[2],i=t[3],o=t[4],l=t[5],s=t[6],c=t[7],u=t[8],f=t[9],d=t[10],p=t[11],h=t[12],g=t[13],v=t[14],m=t[15],y=r*l-n*o,x=r*s-a*o,b=r*c-i*o,_=n*s-a*l,w=n*c-i*l,T=a*c-i*s,k=u*g-f*h,M=u*v-d*h,A=u*m-p*h,L=f*v-d*g,S=f*m-p*g,C=d*m-p*v,O=y*C-x*S+b*L+_*A-w*M+T*k;if(!O)return null;return O=1/O,e[0]=(l*C-s*S+c*L)*O,e[1]=(a*S-n*C-i*L)*O,e[2]=(g*T-v*w+m*_)*O,e[3]=(d*w-f*T-p*_)*O,e[4]=(s*A-o*C-c*M)*O,e[5]=(r*C-a*A+i*M)*O,e[6]=(v*b-h*T-m*x)*O,e[7]=(u*T-d*b+p*x)*O,e[8]=(o*S-l*A+c*k)*O,e[9]=(n*A-r*S-i*k)*O,e[10]=(h*w-g*b+m*y)*O,e[11]=(f*b-u*w-p*y)*O,e[12]=(l*M-o*L-s*k)*O,e[13]=(r*L-n*M+a*k)*O,e[14]=(g*x-h*_-v*y)*O,e[15]=(u*_-f*x+d*y)*O,e}},{}],36:[function(e,t,r){var n=e("./identity");t.exports=function(e,t,r,a){var i,o,l,s,c,u,f,d,p,h,g=t[0],v=t[1],m=t[2],y=a[0],x=a[1],b=a[2],_=r[0],w=r[1],T=r[2];if(Math.abs(g-_)<1e-6&&Math.abs(v-w)<1e-6&&Math.abs(m-T)<1e-6)return n(e);f=g-_,d=v-w,p=m-T,h=1/Math.sqrt(f*f+d*d+p*p),i=x*(p*=h)-b*(d*=h),o=b*(f*=h)-y*p,l=y*d-x*f,(h=Math.sqrt(i*i+o*o+l*l))?(i*=h=1/h,o*=h,l*=h):(i=0,o=0,l=0);s=d*l-p*o,c=p*i-f*l,u=f*o-d*i,(h=Math.sqrt(s*s+c*c+u*u))?(s*=h=1/h,c*=h,u*=h):(s=0,c=0,u=0);return e[0]=i,e[1]=s,e[2]=f,e[3]=0,e[4]=o,e[5]=c,e[6]=d,e[7]=0,e[8]=l,e[9]=u,e[10]=p,e[11]=0,e[12]=-(i*g+o*v+l*m),e[13]=-(s*g+c*v+u*m),e[14]=-(f*g+d*v+p*m),e[15]=1,e}},{"./identity":33}],37:[function(e,t,r){t.exports=function(e,t,r){var n=t[0],a=t[1],i=t[2],o=t[3],l=t[4],s=t[5],c=t[6],u=t[7],f=t[8],d=t[9],p=t[10],h=t[11],g=t[12],v=t[13],m=t[14],y=t[15],x=r[0],b=r[1],_=r[2],w=r[3];return e[0]=x*n+b*l+_*f+w*g,e[1]=x*a+b*s+_*d+w*v,e[2]=x*i+b*c+_*p+w*m,e[3]=x*o+b*u+_*h+w*y,x=r[4],b=r[5],_=r[6],w=r[7],e[4]=x*n+b*l+_*f+w*g,e[5]=x*a+b*s+_*d+w*v,e[6]=x*i+b*c+_*p+w*m,e[7]=x*o+b*u+_*h+w*y,x=r[8],b=r[9],_=r[10],w=r[11],e[8]=x*n+b*l+_*f+w*g,e[9]=x*a+b*s+_*d+w*v,e[10]=x*i+b*c+_*p+w*m,e[11]=x*o+b*u+_*h+w*y,x=r[12],b=r[13],_=r[14],w=r[15],e[12]=x*n+b*l+_*f+w*g,e[13]=x*a+b*s+_*d+w*v,e[14]=x*i+b*c+_*p+w*m,e[15]=x*o+b*u+_*h+w*y,e}},{}],38:[function(e,t,r){t.exports=function(e,t,r,n,a,i,o){var l=1/(t-r),s=1/(n-a),c=1/(i-o);return e[0]=-2*l,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*s,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*c,e[11]=0,e[12]=(t+r)*l,e[13]=(a+n)*s,e[14]=(o+i)*c,e[15]=1,e}},{}],39:[function(e,t,r){t.exports=function(e,t,r,n,a){var i=1/Math.tan(t/2),o=1/(n-a);return e[0]=i/r,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=i,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=(a+n)*o,e[11]=-1,e[12]=0,e[13]=0,e[14]=2*a*n*o,e[15]=0,e}},{}],40:[function(e,t,r){t.exports=function(e,t,r,n){var a=Math.tan(t.upDegrees*Math.PI/180),i=Math.tan(t.downDegrees*Math.PI/180),o=Math.tan(t.leftDegrees*Math.PI/180),l=Math.tan(t.rightDegrees*Math.PI/180),s=2/(o+l),c=2/(a+i);return e[0]=s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=c,e[6]=0,e[7]=0,e[8]=-(o-l)*s*.5,e[9]=(a-i)*c*.5,e[10]=n/(r-n),e[11]=-1,e[12]=0,e[13]=0,e[14]=n*r/(r-n),e[15]=0,e}},{}],41:[function(e,t,r){t.exports=function(e,t,r,n){var a,i,o,l,s,c,u,f,d,p,h,g,v,m,y,x,b,_,w,T,k,M,A,L,S=n[0],C=n[1],O=n[2],D=Math.sqrt(S*S+C*C+O*O);if(Math.abs(D)<1e-6)return null;S*=D=1/D,C*=D,O*=D,a=Math.sin(r),i=Math.cos(r),o=1-i,l=t[0],s=t[1],c=t[2],u=t[3],f=t[4],d=t[5],p=t[6],h=t[7],g=t[8],v=t[9],m=t[10],y=t[11],x=S*S*o+i,b=C*S*o+O*a,_=O*S*o-C*a,w=S*C*o-O*a,T=C*C*o+i,k=O*C*o+S*a,M=S*O*o+C*a,A=C*O*o-S*a,L=O*O*o+i,e[0]=l*x+f*b+g*_,e[1]=s*x+d*b+v*_,e[2]=c*x+p*b+m*_,e[3]=u*x+h*b+y*_,e[4]=l*w+f*T+g*k,e[5]=s*w+d*T+v*k,e[6]=c*w+p*T+m*k,e[7]=u*w+h*T+y*k,e[8]=l*M+f*A+g*L,e[9]=s*M+d*A+v*L,e[10]=c*M+p*A+m*L,e[11]=u*M+h*A+y*L,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]);return e}},{}],42:[function(e,t,r){t.exports=function(e,t,r){var n=Math.sin(r),a=Math.cos(r),i=t[4],o=t[5],l=t[6],s=t[7],c=t[8],u=t[9],f=t[10],d=t[11];t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]);return e[4]=i*a+c*n,e[5]=o*a+u*n,e[6]=l*a+f*n,e[7]=s*a+d*n,e[8]=c*a-i*n,e[9]=u*a-o*n,e[10]=f*a-l*n,e[11]=d*a-s*n,e}},{}],43:[function(e,t,r){t.exports=function(e,t,r){var n=Math.sin(r),a=Math.cos(r),i=t[0],o=t[1],l=t[2],s=t[3],c=t[8],u=t[9],f=t[10],d=t[11];t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]);return e[0]=i*a-c*n,e[1]=o*a-u*n,e[2]=l*a-f*n,e[3]=s*a-d*n,e[8]=i*n+c*a,e[9]=o*n+u*a,e[10]=l*n+f*a,e[11]=s*n+d*a,e}},{}],44:[function(e,t,r){t.exports=function(e,t,r){var n=Math.sin(r),a=Math.cos(r),i=t[0],o=t[1],l=t[2],s=t[3],c=t[4],u=t[5],f=t[6],d=t[7];t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]);return e[0]=i*a+c*n,e[1]=o*a+u*n,e[2]=l*a+f*n,e[3]=s*a+d*n,e[4]=c*a-i*n,e[5]=u*a-o*n,e[6]=f*a-l*n,e[7]=d*a-s*n,e}},{}],45:[function(e,t,r){t.exports=function(e,t,r){var n=r[0],a=r[1],i=r[2];return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*a,e[5]=t[5]*a,e[6]=t[6]*a,e[7]=t[7]*a,e[8]=t[8]*i,e[9]=t[9]*i,e[10]=t[10]*i,e[11]=t[11]*i,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}},{}],46:[function(e,t,r){t.exports=function(e){return"mat4("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+", "+e[6]+", "+e[7]+", "+e[8]+", "+e[9]+", "+e[10]+", "+e[11]+", "+e[12]+", "+e[13]+", "+e[14]+", "+e[15]+")"}},{}],47:[function(e,t,r){t.exports=function(e,t,r){var n,a,i,o,l,s,c,u,f,d,p,h,g=r[0],v=r[1],m=r[2];t===e?(e[12]=t[0]*g+t[4]*v+t[8]*m+t[12],e[13]=t[1]*g+t[5]*v+t[9]*m+t[13],e[14]=t[2]*g+t[6]*v+t[10]*m+t[14],e[15]=t[3]*g+t[7]*v+t[11]*m+t[15]):(n=t[0],a=t[1],i=t[2],o=t[3],l=t[4],s=t[5],c=t[6],u=t[7],f=t[8],d=t[9],p=t[10],h=t[11],e[0]=n,e[1]=a,e[2]=i,e[3]=o,e[4]=l,e[5]=s,e[6]=c,e[7]=u,e[8]=f,e[9]=d,e[10]=p,e[11]=h,e[12]=n*g+l*v+f*m+t[12],e[13]=a*g+s*v+d*m+t[13],e[14]=i*g+c*v+p*m+t[14],e[15]=o*g+u*v+h*m+t[15]);return e}},{}],48:[function(e,t,r){t.exports=function(e,t){if(e===t){var r=t[1],n=t[2],a=t[3],i=t[6],o=t[7],l=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=r,e[6]=t[9],e[7]=t[13],e[8]=n,e[9]=i,e[11]=t[14],e[12]=a,e[13]=o,e[14]=l}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e}},{}],49:[function(e,t,r){(function(r){(function(){"use strict";var n,a=e("is-browser");n="function"==typeof r.matchMedia?!r.matchMedia("(hover: none)").matches:a,t.exports=n}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"is-browser":51}],50:[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":51}],51:[function(e,t,r){t.exports=!0},{}],52:[function(e,t,r){"use strict";t.exports=i,t.exports.isMobile=i,t.exports.default=i;var n=/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series[46]0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,a=/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series[46]0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino|android|ipad|playbook|silk/i;function i(e){e||(e={});var t=e.ua;if(t||"undefined"==typeof navigator||(t=navigator.userAgent),t&&t.headers&&"string"==typeof t.headers["user-agent"]&&(t=t.headers["user-agent"]),"string"!=typeof t)return!1;var r=e.tablet?a.test(t):n.test(t);return!r&&e.tablet&&e.featureDetect&&navigator&&navigator.maxTouchPoints>1&&-1!==t.indexOf("Macintosh")&&-1!==t.indexOf("Safari")&&(r=!0),r}},{}],53:[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}},{}],54:[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}},{}],55:[function(e,t,r){t.exports=function(e){var t=[];return e.replace(a,(function(e,r,a){var o=r.toLowerCase();for(a=function(e){var t=e.match(i);return t?t.map(Number):[]}(a),"m"==o&&a.length>2&&(t.push([r].concat(a.splice(0,2))),o="l",r="m"==r?"l":"L");;){if(a.length==n[o])return a.unshift(r),t.push(a);if(a.length<n[o])throw new Error("malformed path data");t.push([r].concat(a.splice(0,n[o])))}})),t};var n={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},a=/([astvzqmhlc])([^astvzqmhlc]*)/gi;var i=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi},{}],56:[function(e,t,r){
/*
* @copyright 2016 Sean Connelly (@voidqk), http://syntheti.cc
* @license MIT
* @preserve Project Home: https://github.com/voidqk/polybooljs
*/
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":57,"./lib/epsilon":58,"./lib/geojson":59,"./lib/intersecter":60,"./lib/segment-chainer":62,"./lib/segment-selector":63}],57:[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")}}}},{}],58:[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}},{}],59:[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},{}],60:[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)||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=v();if(y){var x;if(e)(x=null===d.seg.myFill.below||d.seg.myFill.above!==d.seg.myFill.below)&&(y.seg.myFill.above=!y.seg.myFill.above);else y.seg.otherFill=d.seg.myFill;r&&r.segmentUpdate(y.seg),d.other.remove(),d.remove()}if(i.getHead()!==d){r&&r.rewind(d.seg);continue}if(e)x=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=x?!d.seg.myFill.below:d.seg.myFill.below;else if(null===d.seg.otherFill)m=g?d.primary===g.primary?g.seg.otherFill.above:g.seg.myFill.above:d.primary?o:a,d.seg.otherFill={above:m,below:m};r&&r.status(d.seg,!!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":61}],61:[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}}},{}],62:[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]);v[v.length-2];if(t.pointsSame(f,i)){if(k(u,!0,!0))break}else if(t.pointsSame(f,o)){if(k(u,!0,!1))break}else if(t.pointsSame(d,i)){if(k(u,!1,!0))break}else if(t.pointsSame(d,o)&&k(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 T=n[_].length<n[w].length;l.matches_head?s.matches_head?T?(M(_),A(_,w)):(M(w),A(w,_)):A(w,_):s.matches_head?A(_,w):T?(M(_),A(w,_)):(M(w),A(_,w))}function k(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}},{}],63:[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},{}],64:[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}},{}],65:[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(s=s||{},(t=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:P(t[1]),g:P(t[2]),b:P(t[3]),a:I(t[4]),format:a?"name":"hex8"};if(t=B.hex6.exec(e))return{r:P(t[1]),g:P(t[2]),b:P(t[3]),format:a?"name":"hex"};if(t=B.hex4.exec(e))return{r:P(t[1]+""+t[1]),g:P(t[2]+""+t[2]),b:P(t[3]+""+t[3]),a:I(t[4]+""+t[4]),format:a?"name":"hex8"};if(t=B.hex3.exec(e))return{r:P(t[1]+""+t[1]),g:P(t[2]+""+t[2]),b:P(t[3]+""+t[3]),format:a?"name":"hex"};return!1}(t));"object"==typeof t&&(j(t.r)&&j(t.g)&&j(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"):j(t.h)&&j(t.s)&&j(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"):j(t.h)&&j(t.s)&&j(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=D(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=D(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=D(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=D(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 T(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 k(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(k,arguments)},triad:function(){return this._applyCombination(w,arguments)},tetrad:function(){return this._applyCombination(T,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 D(e){return o(1,l(0,e))}function P(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 P(e)/255}var F,N,H,B=(N="[\\s|\\(]+("+(F="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+F+")[,|\\s]+("+F+")\\s*\\)?",H="[\\s|\\(]+("+F+")[,|\\s]+("+F+")[,|\\s]+("+F+")[,|\\s]+("+F+")\\s*\\)?",{CSS_UNIT:new RegExp(F),rgb:new RegExp("rgb"+N),rgba:new RegExp("rgba"+H),hsl:new RegExp("hsl"+N),hsla:new RegExp("hsla"+H),hsv:new RegExp("hsv"+N),hsva:new RegExp("hsva"+H),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 j(e){return!!B.CSS_UNIT.exec(e)}"undefined"!=typeof t&&t.exports?t.exports=c:window.tinycolor=c}(Math)},{}],66:[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}]},{}],67:[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;e("../../constants/axis_placeable_objects");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"}}})},{"../../constants/axis_placeable_objects":185,"../../plot_api/plot_template":245,"../../plots/cartesian/constants":262,"../../plots/font_attributes":284,"./arrow_paths":66}],68:[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),i=a.getRefType(t.xref),o=a.getRefType(t.yref);t._extremes={},"range"===i&&l(t,r),"range"===o&&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":210,"../../plots/cartesian/axes":256,"./draw":73}],69:[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":210,"../../plot_api/plot_template":245,"../../registry":298}],70:[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":210,"../color":82}],71:[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":234,"fast-isnumeric":18}],72:[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","paper"]);"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":210,"../../plots/array_container_defaults":251,"../../plots/cartesian/axes":256,"./attributes":67,"./common_defaults":70}],73:[function(e,t,r){"use strict";var n=e("d3"),a=e("../../registry"),i=e("../../plots/plots"),o=e("../../lib"),l=o.strTranslate,s=e("../../plots/cartesian/axes"),c=e("../color"),u=e("../drawing"),f=e("../fx"),d=e("../../lib/svg_text_utils"),p=e("../../lib/setcursor"),h=e("../dragelement"),g=e("../../plot_api/plot_template").arrayEditor,v=e("./draw_arrow_head");function m(e,t){var r=e._fullLayout.annotations[t]||{},n=s.getFromId(e,r.xref),a=s.getFromId(e,r.yref);n&&n.setScale(),a&&a.setScale(),x(e,r,t,!1,n,a)}function y(e,t,r,n,a){var i=a[r],o=a[r+"ref"],l=-1!==r.indexOf("y"),c="domain"===s.getRefType(o),u=l?n.h:n.w;return e?c?i+(l?-t:t)/e._length:e.p2r(e.r2p(i)+t):i+(l?-t:t)/u}function x(e,t,r,i,m,x){var b,_,w=e._fullLayout,T=e._fullLayout._size,k=e._context.edits;i?(b="annotation-"+i,_=i+".annotations"):(b="annotation",_="annotations");var M=g(e.layout,_,t),A=M.modifyBase,L=M.modifyItem,S=M.getUpdateObj;w._infolayer.selectAll("."+b+'[data-index="'+r+'"]').remove();var C="clip"+w._uid+"_ann"+r;if(t._input&&!1!==t.visible){var O={x:{},y:{}},D=+t.textangle||0,P=w._infolayer.append("g").classed(b,!0).attr("data-index",String(r)).style("opacity",t.opacity),z=P.append("g").classed("annotation-text-g",!0),R=k[t.showarrow?"annotationTail":"annotationPosition"],E=t.captureevents||k.annotationText||R,I=z.append("g").style("pointer-events",E?"all":null).call(p,"pointer").on("click",(function(){e._dragging=!1,e.emit("plotly_clickannotation",Z(n.event))}));t.hovertext&&I.on("mouseover",(function(){var r=t.hoverlabel,n=r.font,a=this.getBoundingClientRect(),i=e.getBoundingClientRect();f.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:w._hoverlayer.node(),outerContainer:w._paper.node(),gd:e})})).on("mouseout",(function(){f.loneUnhover(w._hoverlayer.node())}));var F=t.borderwidth,N=t.borderpad,H=F+N,B=I.append("rect").attr("class","bg").style("stroke-width",F+"px").call(c.stroke,t.bordercolor).call(c.fill,t.bgcolor),j=t.width||t.height,V=w._topclips.selectAll("#"+C).data(j?[0]:[]);V.enter().append("clipPath").classed("annclip",!0).attr("id",C).append("rect"),V.exit().remove();var U=t.font,q=w._meta?o.templateString(t.text,w._meta):t.text,G=I.append("text").classed("annotation-text",!0).text(q);k.annotationText?G.call(d.makeEditable,{delegate:I,gd:e}).call(Y).on("edit",(function(r){t.text=r,this.call(Y),L("text",r),m&&m.autorange&&A(m._name+".autorange",!0),x&&x.autorange&&A(x._name+".autorange",!0),a.call("_guiRelayout",e,S())})):G.call(Y)}else n.selectAll("#"+C).remove();function Z(e){var n={index:r,annotation:t._input,fullAnnotation:t,event:e};return i&&(n.subplotId=i),n}function Y(r){return r.call(u.font,U).attr({"text-anchor":{left:"start",right:"end"}[t.align]||"middle"}),d.convertToTspans(r,e,X),r}function X(){var r=G.selectAll("a");1===r.size()&&r.text()===G.text()&&I.insert("a",":first-child").attr({"xlink:xlink:href":r.attr("xlink:href"),"xlink:xlink:show":r.attr("xlink:show")}).style({cursor:"pointer"}).node().appendChild(B.node());var n=I.select(".annotation-text-math-group"),f=!n.empty(),g=u.bBox((f?n:G).node()),b=g.width,_=g.height,M=t.width||b,E=t.height||_,N=Math.round(M+2*H),U=Math.round(E+2*H);function q(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 Y=!1,X=["x","y"],W=0;W<X.length;W++){var Q,J,$,K,ee,te=X[W],re=t[te+"ref"]||te,ne=t["a"+te+"ref"],ae={x:m,y:x}[te],ie=(D+("x"===te?0:-90))*Math.PI/180,oe=N*Math.cos(ie),le=U*Math.sin(ie),se=Math.abs(oe)+Math.abs(le),ce=t[te+"anchor"],ue=t[te+"shift"]*("x"===te?1:-1),fe=O[te],de=s.getRefType(re);if(ae&&"domain"!==de){var pe=ae.r2fraction(t[te]);(pe<0||pe>1)&&(ne===re?((pe=ae.r2fraction(t["a"+te]))<0||pe>1)&&(Y=!0):Y=!0),Q=ae._offset+ae.r2p(t[te]),K=.5}else{var he="domain"===de;"x"===te?($=t[te],Q=he?ae._offset+ae._length*$:Q=T.l+T.w*$):($=1-t[te],Q=he?ae._offset+ae._length*$:Q=T.t+T.h*$),K=t.showarrow?.5:$}if(t.showarrow){fe.head=Q;var ge=t["a"+te];if(ee=oe*q(.5,t.xanchor)-le*q(.5,t.yanchor),ne===re){var ve=s.getRefType(ne);"domain"===ve?("y"===te&&(ge=1-ge),fe.tail=ae._offset+ae._length*ge):"paper"===ve?"y"===te?(ge=1-ge,fe.tail=T.t+T.h*ge):fe.tail=T.l+T.w*ge:fe.tail=ae._offset+ae.r2p(ge),J=ee}else fe.tail=Q+ge,J=ee+ge;fe.text=fe.tail+ee;var me=w["x"===te?"width":"height"];if("paper"===re&&(fe.head=o.constrain(fe.head,1,me-1)),"pixel"===ne){var ye=-Math.max(fe.tail-3,fe.text),xe=Math.min(fe.tail+3,fe.text)-me;ye>0?(fe.tail+=ye,fe.text+=ye):xe>0&&(fe.tail-=xe,fe.text-=xe)}fe.tail+=ue,fe.head+=ue}else J=ee=se*q(K,ce),fe.text=Q+ee;fe.text+=ue,ee+=ue,J+=ue,t["_"+te+"padplus"]=se/2+J,t["_"+te+"padminus"]=se/2-J,t["_"+te+"size"]=se,t["_"+te+"shift"]=ee}if(Y)I.remove();else{var be=0,_e=0;if("left"!==t.align&&(be=(M-b)*("center"===t.align?.5:1)),"top"!==t.valign&&(_e=(E-_)*("middle"===t.valign?.5:1)),f)n.select("svg").attr({x:H+be-1,y:H+_e}).call(u.setClipUrl,j?C:null,e);else{var we=H+_e-g.top,Te=H+be-g.left;G.call(d.positionText,Te,we).call(u.setClipUrl,j?C:null,e)}V.select("rect").call(u.setRect,H,H,M,E),B.call(u.setRect,F/2,F/2,N-F,U-F),I.call(u.setTranslate,Math.round(O.x.text-N/2),Math.round(O.y.text-U/2)),z.attr({transform:"rotate("+D+","+O.x.text+","+O.y.text+")"});var ke,Me=function(r,n){P.selectAll(".annotation-arrow-g").remove();var s=O.x.head,f=O.y.head,d=O.x.tail+r,p=O.y.tail+n,g=O.x.text+r,b=O.y.text+n,_=o.rotationXYMatrix(D,g,b),w=o.apply2DTransform(_),M=o.apply2DTransform2(_),C=+B.attr("width"),R=+B.attr("height"),E=g-.5*C,F=E+C,N=b-.5*R,H=N+R,j=[[E,N,E,H],[E,H,F,H],[F,H,F,N],[F,N,E,N]].map(M);if(!j.reduce((function(e,t){return e^!!o.segmentsIntersect(s,f,s+1e6,f+1e6,t[0],t[1],t[2],t[3])}),!1)){j.forEach((function(e){var t=o.segmentsIntersect(d,p,s,f,e[0],e[1],e[2],e[3]);t&&(d=t.x,p=t.y)}));var V=t.arrowwidth,U=t.arrowcolor,q=t.arrowside,G=P.append("g").style({opacity:c.opacity(U)}).classed("annotation-arrow-g",!0),Z=G.append("path").attr("d","M"+d+","+p+"L"+s+","+f).style("stroke-width",V+"px").call(c.stroke,c.rgb(U));if(v(Z,q,t),k.annotationPosition&&Z.node().parentNode&&!i){var Y=s,X=f;if(t.standoff){var W=Math.sqrt(Math.pow(s-d,2)+Math.pow(f-p,2));Y+=t.standoff*(d-s)/W,X+=t.standoff*(p-f)/W}var Q,J,$=G.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).classed("cursor-move",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(d-Y)+","+(p-X),transform:l(Y,X)}).style("stroke-width",V+6+"px").call(c.stroke,"rgba(0,0,0,0)").call(c.fill,"rgba(0,0,0,0)");h.init({element:$.node(),gd:e,prepFn:function(){var e=u.getTranslate(I);Q=e.x,J=e.y,m&&m.autorange&&A(m._name+".autorange",!0),x&&x.autorange&&A(x._name+".autorange",!0)},moveFn:function(e,r){var n=w(Q,J),a=n[0]+e,i=n[1]+r;I.call(u.setTranslate,a,i),L("x",y(m,e,"x",T,t)),L("y",y(x,r,"y",T,t)),t.axref===t.xref&&L("ax",y(m,e,"ax",T,t)),t.ayref===t.yref&&L("ay",y(x,r,"ay",T,t)),G.attr("transform",l(e,r)),z.attr({transform:"rotate("+D+","+a+","+i+")"})},doneFn:function(){a.call("_guiRelayout",e,S());var t=document.querySelector(".js-notes-box-panel");t&&t.redraw(t.selectedObj)}})}}};if(t.showarrow&&Me(0,0),R)h.init({element:I.node(),gd:e,prepFn:function(){ke=z.attr("transform")},moveFn:function(e,r){var n="pointer";if(t.showarrow)t.axref===t.xref?L("ax",y(m,e,"ax",T,t)):L("ax",t.ax+e),t.ayref===t.yref?L("ay",y(x,r,"ay",T.w,t)):L("ay",t.ay+r),Me(e,r);else{if(i)return;var a,o;if(m)a=y(m,e,"x",T,t);else{var s=t._xsize/T.w,c=t.x+(t._xshift-t.xshift)/T.w-s/2;a=h.align(c+e/T.w,s,0,1,t.xanchor)}if(x)o=y(x,r,"y",T,t);else{var u=t._ysize/T.h,f=t.y-(t._yshift+t.yshift)/T.h-u/2;o=h.align(f-r/T.h,u,0,1,t.yanchor)}L("x",a),L("y",o),m&&x||(n=h.getCursor(m?.5:a,x?.5:o,t.xanchor,t.yanchor))}z.attr({transform:l(e,r)+ke}),p(I,n)},clickFn:function(r,n){t.captureevents&&e.emit("plotly_clickannotation",Z(n))},doneFn:function(){p(I),a.call("_guiRelayout",e,S());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&&m(e,r);return i.previousPromises(e)},drawOne:m,drawRaw:x}},{"../../lib":210,"../../lib/setcursor":230,"../../lib/svg_text_utils":232,"../../plot_api/plot_template":245,"../../plots/cartesian/axes":256,"../../plots/plots":290,"../../registry":298,"../color":82,"../dragelement":101,"../drawing":104,"../fx":122,"./draw_arrow_head":74,d3:16}],74:[function(e,t,r){"use strict";var n=e("d3"),a=e("../color"),i=e("./arrow_paths"),o=e("../../lib"),l=o.strScale,s=o.strRotate,c=o.strTranslate;t.exports=function(e,t,r){var o,u,f,d,p=e.node(),h=i[r.arrowhead||0],g=i[r.startarrowhead||0],v=(r.arrowwidth||1)*(r.arrowsize||1),m=(r.arrowwidth||1)*(r.startarrowsize||1),y=t.indexOf("start")>=0,x=t.indexOf("end")>=0,b=h.backoff*v+r.standoff,_=g.backoff*m+r.startstandoff;if("line"===p.nodeName){o={x:+e.attr("x1"),y:+e.attr("y1")},u={x:+e.attr("x2"),y:+e.attr("y2")};var w=o.x-u.x,T=o.y-u.y;if(d=(f=Math.atan2(T,w))+Math.PI,b&&_&&b+_>Math.sqrt(w*w+T*T))return void R();if(b){if(b*b>w*w+T*T)return void R();var k=b*Math.cos(f),M=b*Math.sin(f);u.x+=k,u.y+=M,e.attr({x2:u.x,y2:u.y})}if(_){if(_*_>w*w+T*T)return void R();var A=_*Math.cos(f),L=_*Math.sin(f);o.x-=A,o.y-=L,e.attr({x1:o.x,y1:o.y})}}else if("path"===p.nodeName){var S=p.getTotalLength(),C="";if(S<b+_)return void R();var O=p.getPointAtLength(0),D=p.getPointAtLength(.1);f=Math.atan2(O.y-D.y,O.x-D.x),o=p.getPointAtLength(Math.min(_,S)),C="0px,"+_+"px,";var P=p.getPointAtLength(S),z=p.getPointAtLength(S-.1);d=Math.atan2(P.y-z.y,P.x-z.x),u=p.getPointAtLength(Math.max(0,S-b)),C+=S-(C?_+b:b)+"px,"+S+"px",e.style("stroke-dasharray",C)}function R(){e.style("stroke-dasharray","0px,100px")}function E(t,i,o,u){t.path&&(t.noRotate&&(o=0),n.select(p.parentNode).append("path").attr({class:e.attr("class"),d:t.path,transform:c(i.x,i.y)+s(180*o/Math.PI)+l(u)}).style({fill:a.rgb(r.arrowcolor),"stroke-width":0}))}y&&E(g,o,f,m),x&&E(h,u,d,v)}},{"../../lib":210,"../color":82,"./arrow_paths":66,d3:16}],75:[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":268,"./attributes":67,"./calc_autorange":68,"./click":69,"./convert_coords":71,"./defaults":72,"./draw":73}],76:[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":238,"../../plot_api/plot_template":245,"../annotations/attributes":67}],77:[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":210,"../../plots/cartesian/axes":256}],78:[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":210,"../../plots/array_container_defaults":251,"../../plots/cartesian/axes":256,"../annotations/common_defaults":70,"./attributes":76}],79:[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":287,"../annotations/draw":73}],80:[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":210,"../../registry":298,"./attributes":76,"./convert":77,"./defaults":78,"./draw":79}],81:[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},{}],82:[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":81,"fast-isnumeric":18,tinycolor2:65}],83:[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:""}),ticklabelposition:{valType:"enumerated",values:["outside","inside","outside top","inside top","outside bottom","inside bottom"],dflt:"outside"},ticklen:n.ticklen,tickwidth:n.tickwidth,tickcolor:n.tickcolor,showticklabels:n.showticklabels,tickfont:a({}),tickangle:n.tickangle,tickformat:n.tickformat,tickformatstops:n.tickformatstops,tickprefix:n.tickprefix,showtickprefix:n.showtickprefix,ticksuffix:n.ticksuffix,showticksuffix:n.showticksuffix,separatethousands:n.separatethousands,exponentformat:n.exponentformat,minexponent:n.minexponent,showexponent:n.showexponent,title:{text:{valType:"string"},font:a({}),side:{valType:"enumerated",values:["right","top","bottom"],dflt:"top"}},_deprecated:{title:{valType:"string"},titlefont:a({}),titleside:{valType:"enumerated",values:["right","top","bottom"],dflt:"top"}}},"colorbars","from-root")},{"../../lib/extend":204,"../../plot_api/edit_types":238,"../../plots/cartesian/layout_attributes":270,"../../plots/font_attributes":284}],84:[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"}}},{}],85:[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)}var d=f("thicknessmode");f("thickness","fraction"===d?30/(r.width-r.margin.l-r.margin.r):30);var p=f("lenmode");f("len","fraction"===p?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");var h=f("ticklabelposition");i(u,c,f,"linear");var g={outerTicks:!1,font:r.font};-1!==h.indexOf("inside")&&(g.bgColor="black"),l(u,c,f,"linear",g),o(u,c,f,"linear",g),f("title.text",r._dfltTitle.colorbar),n.coerceFont(f,"title.font",r.font),f("title.side")}},{"../../lib":210,"../../plot_api/plot_template":245,"../../plots/cartesian/tick_label_defaults":277,"../../plots/cartesian/tick_mark_defaults":278,"../../plots/cartesian/tick_value_defaults":279,"./attributes":83}],86:[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=c.strTranslate,f=e("../../lib/extend").extendFlat,d=e("../../lib/setcursor"),p=e("../drawing"),h=e("../color"),g=e("../titles"),v=e("../../lib/svg_text_utils"),m=e("../colorscale/helpers").flipScale,y=e("../../plots/cartesian/axis_defaults"),x=e("../../plots/cartesian/position_defaults"),b=e("../../plots/cartesian/layout_attributes"),_=e("../../constants/alignment"),w=_.LINE_SPACING,T=_.FROM_TL,k=_.FROM_BR,M=e("./constants").cn;t.exports={draw:function(e){var t=e._fullLayout._infolayer.selectAll("g."+M.colorbar).data(function(e){var t,r,n,a,i=e._fullLayout,o=e.calcdata,l=[];function s(e){return f(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?m(r.colorscale):r.colorscale,t._zrange=[r[a.min],r[a.max]])}for(var u=0;u<o.length;u++){var d=o[u],p=(n=d[0].trace)._module.colorbar;if(!0===n.visible&&p)for(var h=Array.isArray(p),g=h?p:[p],v=0;v<g.length;v++){var y=(a=g[v]).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(M.colorbar,!0),t.each((function(t){var r=n.select(this);c.ensureSingle(r,"rect",M.cbbg),c.ensureSingle(r,"g",M.cbfills),c.ensureSingle(r,"g",M.cblines),c.ensureSingle(r,"g",M.cbaxis,(function(e){e.classed(M.crisp,!0)})),c.ensureSingle(r,"g",M.cbtitleunshift,(function(e){e.append("g").classed(M.cbtitle,!0)})),c.ensureSingle(r,"rect",M.cboutline);var m=function(e,t,r){var o=r._fullLayout,s=o._size,d=t._fillcolor,m=t._line,_=t.title,A=_.side,L=t._zrange||n.extent(("function"==typeof d?d:m.color).domain()),S="function"==typeof m.color?m.color:function(){return m.color},C="function"==typeof d?d:function(){return d},O=t._levels,D=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]);i.size<0&&(o.reverse(),l.reverse());return{line:o,fill:l}}(0,t,L),P=D.fill,z=D.line,R=Math.round(t.thickness*("fraction"===t.thicknessmode?s.w:1)),E=R/s.w,I=Math.round(t.len*("fraction"===t.lenmode?s.h:1)),F=I/s.h,N=t.xpad/s.w,H=(t.borderwidth+t.outlinewidth)/2,B=t.ypad/s.h,j=Math.round(t.x*s.w+t.xpad),V=t.x-E*({middle:.5,right:1}[t.xanchor]||0),U=t.y+F*(({top:-.5,bottom:.5}[t.yanchor]||0)-.5),q=Math.round(s.h*(1-U)),G=q-I;t._lenFrac=F,t._thickFrac=E,t._xLeftFrac=V,t._yBottomFrac=U;var Z=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,ticklabelposition:t.ticklabelposition,tickfont:t.tickfont,tickangle:t.tickangle,tickformat:t.tickformat,exponentformat:t.exponentformat,minexponent:t.minexponent,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,noTicklabelmode:!0,calendar:n.calendar};function l(e,t){return c.coerce(a,i,b,e,t)}return y(a,i,l,o,n),x(a,i,l,o),i}(r,t,L);Z.position=t.x+N+E,-1!==["top","bottom"].indexOf(A)&&(Z.title.side=A,Z.titlex=t.x+N,Z.titley=U+("top"===_.side?F-B:B));if(m.color&&"auto"===t.tickmode){Z.tickmode="linear",Z.tick0=O.start;var Y=O.size,X=c.constrain((q-G)/50,4,15)+1,W=(L[1]-L[0])/((t.nticks||X)*Y);if(W>1){var Q=Math.pow(10,Math.floor(Math.log(W)/Math.LN10));Y*=Q*c.roundUp(W/Q,[2,5,10]),(Math.abs(O.start)/O.size+1e-6)%1<2e-6&&(Z.tick0=0)}Z.dtick=Y}Z.domain=[U+B,U+F-B],Z.setScale(),e.attr("transform",u(Math.round(s.l),Math.round(s.t)));var J,$=e.select("."+M.cbtitleunshift).attr("transform",u(-Math.round(s.l),-Math.round(s.t))),K=e.select("."+M.cbaxis),ee=0;function te(n,a){var i={propContainer:Z,propName:t._propPrefix+"title",traceIndex:t._traceIndex,_meta:t._meta,placeholder:o._dfltTitle.colorbar,containerGroup:e.select("."+M.cbtitle)},l="h"===n.charAt(0)?n.substr(1):"h"+n;e.selectAll("."+l+",."+l+"-math-group").remove(),g.draw(r,n,f(i,a||{}))}return c.syncOrAsync([i.previousPromises,function(){if(-1!==["top","bottom"].indexOf(A)){var e,r=s.l+(t.x+N)*s.w,n=Z.title.font.size;e="top"===A?(1-(U+F-B))*s.h+s.t+3+.75*n:(1-(U+B))*s.h+s.t-3-.25*n,te(Z._id+"title",{attributes:{x:r,y:e,"text-anchor":"start"}})}},function(){if(-1!==["top","bottom"].indexOf(A)){var i=e.select("."+M.cbtitle),o=i.select("text"),f=[-t.outlinewidth/2,t.outlinewidth/2],d=i.select(".h"+Z._id+"title-math-group").node(),h=15.6;if(o.node()&&(h=parseInt(o.node().style.fontSize,10)*w),d?(ee=p.bBox(d).height)>h&&(f[1]-=(ee-h)/2):o.node()&&!o.classed(M.jsPlaceholder)&&(ee=p.bBox(o.node()).height),ee){if(ee+=5,"top"===A)Z.domain[1]-=ee/s.h,f[1]*=-1;else{Z.domain[0]+=ee/s.h;var g=v.lineCount(o);f[1]+=(1-g)*h}i.attr("transform",u(f[0],f[1])),Z.setScale()}}e.selectAll("."+M.cbfills+",."+M.cblines).attr("transform",u(0,Math.round(s.h*(1-Z.domain[1])))),K.attr("transform",u(0,Math.round(-s.t)));var y=e.select("."+M.cbfills).selectAll("rect."+M.cbfill).attr("style","").data(P);y.enter().append("rect").classed(M.cbfill,!0).style("stroke","none"),y.exit().remove();var x=L.map(Z.c2p).map(Math.round).sort((function(e,t){return e-t}));y.each((function(e,i){var o=[0===i?L[0]:(P[i]+P[i-1])/2,i===P.length-1?L[1]:(P[i]+P[i+1])/2].map(Z.c2p).map(Math.round);o[1]=c.constrain(o[1]+(o[1]>o[0])?1:-1,x[0],x[1]);var l=n.select(this).attr({x:j,width:Math.max(R,2),y:n.min(o),height:Math.max(n.max(o)-n.min(o),2)});if(t._fillgradient)p.gradient(l,r,t._id,"vertical",t._fillgradient,"fill");else{var s=C(e).replace("e-","");l.attr("fill",a(s).toHexString())}}));var b=e.select("."+M.cblines).selectAll("path."+M.cbline).data(m.color&&m.width?z:[]);b.enter().append("path").classed(M.cbline,!0),b.exit().remove(),b.each((function(e){n.select(this).attr("d","M"+j+","+(Math.round(Z.c2p(e))+m.width/2%1)+"h"+R).call(p.lineGroupStyle,m.width,S(e),m.dash)})),K.selectAll("g."+Z._id+"tick,path").remove();var _=j+R+(t.outlinewidth||0)/2-("outside"===t.ticks?1:0),T=l.calcTicks(Z),k=l.getTickSigns(Z)[2];return l.drawTicks(r,Z,{vals:"inside"===Z.ticks?l.clipEnds(Z,T):T,layer:K,path:l.makeTickPath(Z,_,k),transFn:l.makeTransTickFn(Z)}),l.drawLabels(r,Z,{vals:T,layer:K,transFn:l.makeTransTickLabelFn(Z),labelFns:l.makeLabelFns(Z,_)})},function(){if(-1===["top","bottom"].indexOf(A)){var e=Z.title.font.size,t=Z._offset+Z._length/2,a=s.l+(Z.position||0)*s.w+("right"===Z.side?10+e*(Z.showticklabels?1:.5):-10-e*(Z.showticklabels?.5:0));te("h"+Z._id+"title",{avoid:{selection:n.select(r).selectAll("g."+Z._id+"tick"),side:A,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=R+t.outlinewidth/2;if(-1===Z.ticklabelposition.indexOf("inside")&&(n+=p.bBox(K.node()).width),(J=$.select("text")).node()&&!J.classed(M.jsPlaceholder)){var a,o=$.select(".h"+Z._id+"title-math-group").node();a=o&&-1!==["top","bottom"].indexOf(A)?p.bBox(o).width:p.bBox($.node()).right-j-s.l,n=Math.max(n,a)}var l=2*t.xpad+n+t.borderwidth+t.outlinewidth/2,c=q-G;e.select("."+M.cbbg).attr({x:j-t.xpad-(t.borderwidth+t.outlinewidth)/2,y:G-H,width:Math.max(l,2),height:Math.max(c+2*H,2)}).call(h.fill,t.bgcolor).call(h.stroke,t.bordercolor).style("stroke-width",t.borderwidth),e.selectAll("."+M.cboutline).attr({x:j,y:G+t.ypad+("top"===A?ee:0),width:Math.max(R,2),height:Math.max(c-2*t.ypad-ee,2)}).call(h.stroke,t.outlinecolor).style({fill:"none","stroke-width":t.outlinewidth});var f=({center:.5,right:1}[t.xanchor]||0)*l;e.attr("transform",u(s.l-f,s.t));var d={},g=T[t.yanchor],v=k[t.yanchor];"pixels"===t.lenmode?(d.y=t.y,d.t=c*g,d.b=c*v):(d.t=d.b=0,d.yt=t.y+t.len*g,d.yb=t.y-t.len*v);var m=T[t.xanchor],y=k[t.xanchor];if("pixels"===t.thicknessmode)d.x=t.x,d.l=l*m,d.r=l*y;else{var x=l-R;d.l=x*m,d.r=x*y,d.xl=t.x-t.thickness*m,d.xr=t.x+t.thickness*y}i.autoMargin(r,t._id,d)}],r)}(r,t,e);m&&m.then&&(e._promises||[]).push(m),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"),d(e)},moveFn:function(r,o){e.attr("transform",n+u(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);d(e,c)},doneFn:function(){if(d(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":184,"../../lib":210,"../../lib/extend":204,"../../lib/setcursor":230,"../../lib/svg_text_utils":232,"../../plots/cartesian/axes":256,"../../plots/cartesian/axis_defaults":258,"../../plots/cartesian/layout_attributes":270,"../../plots/cartesian/position_defaults":273,"../../plots/plots":290,"../../registry":298,"../color":82,"../colorscale/helpers":93,"../dragelement":101,"../drawing":104,"../titles":177,"./constants":84,d3:16,tinycolor2:65}],87:[function(e,t,r){"use strict";var n=e("../../lib");t.exports=function(e){return n.isPlainObject(e.colorbar)}},{"../../lib":210}],88:[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":83,"./defaults":85,"./draw":86,"./has_colorbar":87}],89:[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":226,"../colorbar/attributes":83,"./scales.js":97}],90:[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":210,"./helpers":93,"fast-isnumeric":18}],91:[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":210,"./helpers":93}],92:[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",T=b[_];return void(T?(T[2].push(x),T[0]!==w&&(T[0]=!1,a.warn(["Ignoring coloraxis:",_,"setting","as it is linked to incompatible colorscales."].join(" ")))):b[_]=[w,r,[x]])}}var k=v[h+"min"],M=v[h+"max"],A=n(k)&&n(M)&&k<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":210,"../../registry":298,"../colorbar/defaults":85,"../colorbar/has_colorbar":87,"./scales":97,"fast-isnumeric":18}],93:[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||(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":210,"../color":82,"./scales":97,d3:16,"fast-isnumeric":18,tinycolor2:65}],94:[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":89,"./calc":90,"./cross_trace_defaults":91,"./defaults":92,"./helpers":93,"./layout_attributes":95,"./layout_defaults":96,"./scales":97}],95:[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":204,"./attributes":89,"./scales":97}],96:[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":210,"../../plot_api/plot_template":245,"./defaults":92,"./layout_attributes":95}],97:[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:65}],98:[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}},{}],99:[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":210}],100:[function(e,t,r){"use strict";r.selectMode=function(e){return"lasso"===e||"select"===e},r.drawMode=function(e){return"drawclosedpath"===e||"drawopenpath"===e||"drawline"===e||"drawrect"===e||"drawcircle"===e},r.openMode=function(e){return"drawline"===e||"drawopenpath"===e},r.rectMode=function(e){return"select"===e||"drawline"===e||"drawrect"===e||"drawcircle"===e},r.freeMode=function(e){return"lasso"===e||"drawclosedpath"===e||"drawopenpath"===e},r.selectingOrDrawing=function(e){return r.freeMode(e)||r.rectMode(e)}},{}],101:[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,"undefined"==typeof i.clientX&&"undefined"==typeof 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",T),document.addEventListener("touchend",T),!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 T(t){if(delete v._dragdata,!1!==e.dragmode&&(t.preventDefault(),document.removeEventListener("mousemove",w),document.removeEventListener("touchmove",w)),document.removeEventListener("mouseup",T),document.removeEventListener("touchend",T),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":210,"../../plots/cartesian/constants":262,"./align":98,"./cursor":99,"./unhover":102,"has-hover":49,"has-passive-events":50,"mouse-event-offset":54}],102:[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":202,"../../lib/events":203,"../../lib/throttle":233,"../fx/constants":116}],103:[function(e,t,r){"use strict";r.dash={valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid",editType:"style"}},{}],104:[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=c.strTranslate,f=e("../../lib/svg_text_utils"),d=e("../../constants/xmlns_namespaces"),p=e("../../constants/alignment").LINE_SPACING,h=e("../../constants/interactions").DESELECTDIM,g=e("../../traces/scatter/subtypes"),v=e("../../traces/scatter/make_bubble_size_func"),m=e("../../components/fx/helpers").appendArrayPointValue,y=t.exports={};y.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)},y.setPosition=function(e,t,r){e.attr("x",t).attr("y",r)},y.setSize=function(e,t,r){e.attr("width",t).attr("height",r)},y.setRect=function(e,t,r,n,a){e.call(y.setPosition,t,r).call(y.setSize,n,a)},y.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",u(i,o)),!0)},y.translatePoints=function(e,t,r){e.each((function(e){var a=n.select(this);y.translatePoint(e,a,t,r)}))},y.hideOutsideRangePoint=function(e,t,r,n,a,i){t.attr("display",r.isPtWithinRange(e,a)&&n.isPtWithinRange(e,i)?null:"none")},y.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){y.hideOutsideRangePoint(e,n.select(this),r,a,l,s)}))}))}},y.crispRound=function(e,t,r){return t&&a(t)?e._context.staticPlot?t:t<1?1:Math.round(t):r||0},y.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),y.dashLine(t,s,o)},y.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(y.dashLine,s,o)}))},y.dashLine=function(e,t,r){r=+r||0,t=y.dashStyle(t,r),e.style({"stroke-dasharray":t,"stroke-width":r+"px"})},y.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},y.singleFillStyle=function(e){var t=(((n.select(e.node()).data()[0]||[])[0]||{}).trace||{}).fillcolor;t&&e.call(l.fill,t)},y.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 x=e("./symbol_defs");y.symbolNames=[],y.symbolFuncs=[],y.symbolNeedLines={},y.symbolNoDot={},y.symbolNoFill={},y.symbolList=[],Object.keys(x).forEach((function(e){var t=x[e],r=t.n;y.symbolList.push(r,String(r),e,r+100,String(r+100),e+"-open"),y.symbolNames[r]=e,y.symbolFuncs[r]=t.f,t.needLine&&(y.symbolNeedLines[r]=!0),t.noDot?y.symbolNoDot[r]=!0:y.symbolList.push(r+200,String(r+200),e+"-dot",r+300,String(r+300),e+"-open-dot"),t.noFill&&(y.symbolNoFill[r]=!0)}));var b=y.symbolNames.length;function _(e,t){var r=e%100;return y.symbolFuncs[r](t)+(e>=200?"M0,0.5L0.5,0L0,-0.5L-0.5,0Z":"")}y.symbolNumber=function(e){if(a(e))e=+e;else 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=y.symbolNames.indexOf(e))>=0&&(e+=t)}return e%100>=b||e>=400?0:Math.floor(Math.max(e,0))};var w={x1:1,x2:0,y1:0,y2:0},T={x1:0,x2:0,y1:1,y2:0},k=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:T},verticalreversed:{node:"linearGradient",attrs:T,reversed:!0}};y.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]=[k(100*(1-o[p][0])),o[p][1]]:d[p]=[k(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,R(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},y.initGradients=function(e){var t=e._fullLayout;c.ensureSingle(t._defs,"g","gradients").selectAll("linearGradient,radialGradient").remove(),t._gradientUrlQueryParts={}},y.pointStyle=function(e,t,r){if(e.size()){var a=y.makePointStyleFns(t);e.each((function(e){y.singlePointStyle(e,n.select(this),t,a,r)}))}},y.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=y.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,m=e.mgt;if(m?h=!0:m=v&&v.type,Array.isArray(m)&&(m=m[0],M[m]||(m=0)),m&&"none"!==m){var x=e.mgc;x?h=!0:x=v.color;var b=r.uid;h&&(b+="-"+e.i),y.gradient(t,a,b,m,[[0,x],[1,f]],"fill")}else l.fill(t,f);p&&l.stroke(t,d)}},y.makePointStyleFns=function(e){var t={},r=e.marker;return t.markerScale=y.tryColorscale(r,""),t.lineScale=y.tryColorscale(r,"line"),o.traceIs(e,"symbols")&&(t.ms2mrc=g.isBubble(e)?v(e):function(){return(r.size||6)/2}),e.selectedpoints&&c.extendFlat(t,y.makeSelectedPointStyleFns(e)),t},y.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,p=void 0!==f;(c.isArrayOrTypedArray(s)||d||p)&&(t.selectedOpacityFn=function(e){var t=void 0===e.mo?a.opacity:e.mo;return e.selected?d?u:t:p?f:h*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},y.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,h))},t},y.selectedPointStyle=function(e,t){if(e.size()&&t.selectedpoints){var r=y.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",_(y.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)}))}},y.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=(f.lineCount(e)-1)*p+1,d=A[l]*s,h=.75*r+A[o]*s+(A[o]-1)*c*r/2;e.attr("text-anchor",l),i.attr("transform",u(d,h))}function S(e,t){var r=e.ts||t.textfont.size;return a(r)&&r>0?r:0}y.textPointStyle=function(e,t,r){if(e.size()){var a;if(t.selectedpoints){var i=y.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 u=t._module.formatLabels?t._module.formatLabels(e,t,l):{},d={};m(d,t,e.i);var p=t._meta||{};s=c.texttemplateString(s,u,l._d3locale,d,e,p)}var h=e.tp||t.textposition,g=S(e,t),v=a?a(e):e.tc||t.textfont.color;i.call(y.font,e.tf||t.textfont.family,g,v).text(s).call(f.convertToTspans,r).call(L,h,g,e.mrc)}else i.remove()}))}},y.selectedTextStyle=function(e,t){if(e.size()&&t.selectedpoints){var r=y.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)}))}};function C(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,.25),u=Math.pow(l*l+s*s,.25),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)]]}y.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(C(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]},y.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=[C(e[a],e[0],e[1],t)];for(r=1;r<a;r++)i.push(C(e[r-1],e[r],e[r+1],t));for(i.push(C(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 O={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)};y.steps=function(e){var t=O[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}},y.makeTester=function(){var e=c.ensureSingleById(n.select("body"),"svg","js-plotly-tester",(function(e){e.attr(d.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"})}));y.tester=e,y.testref=t},y.savedBBoxes={};var P=0;function z(e){var t=e.getAttribute("data-unformatted");if(null!==t)return t+e.getAttribute("data-math")+e.getAttribute("text-anchor")+e.getAttribute("style")}function R(e,t){if(!e)return null;var r=t._context;return"url('"+(r._exportedPlot?"":r._baseUrl||"")+"#"+e+"')"}y.bBox=function(e,t,r){var a,i,o;if(r||(r=z(e)),r){if(a=y.savedBBoxes[r])return c.extendFlat({},a)}else if(1===e.childNodes.length){var l=e.childNodes[0];if(r=z(l)){var s=+l.getAttribute("x")||0,u=+l.getAttribute("y")||0,d=l.getAttribute("transform");if(!d){var p=y.bBox(l,!1,r);return s&&(p.left+=s,p.right+=s),u&&(p.top+=u,p.bottom+=u),p}if(r+="~"+s+"~"+u+"~"+d,a=y.savedBBoxes[r])return c.extendFlat({},a)}}t?i=e:(o=y.tester.node(),i=e.cloneNode(!0),o.appendChild(i)),n.select(i).attr("transform",null).call(f.positionText,0,0);var h=i.getBoundingClientRect(),g=y.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 P>=1e4&&(y.savedBBoxes={},P=0),r&&(y.savedBBoxes[r]=v),P++,c.extendFlat({},v)},y.setClipUrl=function(e,t,r){e.attr("clip-path",R(t,r))},y.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}},y.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+=u(t,r)).trim(),e[a]("transform",i),i},y.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}},y.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 E=/\s*sc.*/;y.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(E,"");e=(e+=n).trim(),this.setAttribute("transform",e)}))}};var I=/translate\([^)]*\)\s*$/;y.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(I);e=1===t&&1===r?[]:[u(o,l),"scale("+t+","+r+")",u(-o,-l)],s&&e.push(s),a.attr("transform",e.join(""))}}))}},{"../../components/fx/helpers":118,"../../constants/alignment":184,"../../constants/interactions":188,"../../constants/xmlns_namespaces":190,"../../lib":210,"../../lib/svg_text_utils":232,"../../registry":298,"../../traces/scatter/make_bubble_size_func":416,"../../traces/scatter/subtypes":424,"../color":82,"../colorscale":94,"./symbol_defs":105,d3:16,"fast-isnumeric":18,tinycolor2:65}],105:[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},"arrow-up":{n:45,f:function(e){var t=n.round(e,2);return"M0,0L-"+t+","+n.round(2*e,2)+"H"+t+"Z"},noDot:!0},"arrow-down":{n:46,f:function(e){var t=n.round(e,2);return"M0,0L-"+t+",-"+n.round(2*e,2)+"H"+t+"Z"},noDot:!0},"arrow-left":{n:47,f:function(e){var t=n.round(2*e,2),r=n.round(e,2);return"M0,0L"+t+",-"+r+"V"+r+"Z"},noDot:!0},"arrow-right":{n:48,f:function(e){var t=n.round(2*e,2),r=n.round(e,2);return"M0,0L-"+t+",-"+r+"V"+r+"Z"},noDot:!0},"arrow-bar-up":{n:49,f:function(e){var t=n.round(e,2);return"M-"+t+",0H"+t+"M0,0L-"+t+","+n.round(2*e,2)+"H"+t+"Z"},needLine:!0,noDot:!0},"arrow-bar-down":{n:50,f:function(e){var t=n.round(e,2);return"M-"+t+",0H"+t+"M0,0L-"+t+",-"+n.round(2*e,2)+"H"+t+"Z"},needLine:!0,noDot:!0},"arrow-bar-left":{n:51,f:function(e){var t=n.round(2*e,2),r=n.round(e,2);return"M0,-"+r+"V"+r+"M0,0L"+t+",-"+r+"V"+r+"Z"},needLine:!0,noDot:!0},"arrow-bar-right":{n:52,f:function(e){var t=n.round(2*e,2),r=n.round(e,2);return"M0,-"+r+"V"+r+"M0,0L-"+t+",-"+r+"V"+r+"Z"},needLine:!0,noDot:!0}}},{d3:16}],106:[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"}}}},{}],107:[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":210,"../../plots/cartesian/axes":256,"../../registry":298,"./compute_error":108,"fast-isnumeric":18}],108:[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)]}}},{}],109:[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":210,"../../plot_api/plot_template":245,"../../registry":298,"./attributes":106,"fast-isnumeric":18}],110:[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":210,"../../plot_api/edit_types":238,"./attributes":106,"./calc":107,"./compute_error":108,"./defaults":109,"./plot":111,"./style":112}],111:[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":424,"../drawing":104,d3:16,"fast-isnumeric":18}],112:[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":82,d3:16}],113:[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":204,"../../plots/font_attributes":284,"./layout_attributes":123}],114:[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":210,"../../registry":298}],115:[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":298,"./hover":119}],116:[function(e,t,r){"use strict";t.exports={YANGLE:60,HOVERARROWSIZE:6,HOVERTEXTPAD:3,HOVERFONTSIZE:13,HOVERFONT:"Arial, sans-serif",HOVERMINTIME:50,HOVERID:"-hover"}},{}],117:[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":210,"./attributes":113,"./hoverlabel_defaults":120}],118:[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":210}],119:[function(e,t,r){"use strict";var n=e("d3"),a=e("fast-isnumeric"),i=e("tinycolor2"),o=e("../../lib"),l=o.strTranslate,s=o.strRotate,c=e("../../lib/events"),u=e("../../lib/svg_text_utils"),f=e("../../lib/override_cursor"),d=e("../drawing"),p=e("../color"),h=e("../dragelement"),g=e("../../plots/cartesian/axes"),v=e("../../registry"),m=e("./helpers"),y=e("./constants"),x=e("../legend/defaults"),b=e("../legend/draw"),_=y.YANGLE,w=Math.PI*_/180,T=1/Math.sin(w),k=Math.cos(w),M=Math.sin(w),A=y.HOVERARROWSIZE,L=y.HOVERTEXTPAD;function S(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+y.HOVERID,y.HOVERMINTIME,(function(){!function(e,t,r,i){r||(r="xy");var l=Array.isArray(r)?r:[r],s=e._fullLayout,u=s._plots||[],d=u[r],g=s._has("cartesian");if(d){var y=d.overlays.map((function(e){return e.id}));l=l.concat(y)}for(var x=l.length,b=new Array(x),_=new Array(x),w=!1,k=0;k<x;k++){var M=l[k];if(u[M])w=!0,b[k]=u[M].xaxis,_[k]=u[M].yaxis;else{if(!s[M]||!s[M]._subplot)return void o.warn("Unrecognized subplot: "+M);var A=s[M]._subplot;b[k]=A.xaxis,_[k]=A.yaxis}}var L=t.hovermode||s.hovermode;L&&!w&&(L="closest");if(-1===["x","y","closest","x unified","y unified"].indexOf(L)||!e.calcdata||e.querySelector(".zoombox")||e._dragging)return h.unhoverRaw(e,t);var C,D,I,F,N,H,B,j,V,U,q,G,Z,Y=-1===s.hoverdistance?1/0:s.hoverdistance,X=-1===s.spikedistance?1/0:s.spikedistance,W=[],Q=[],J={hLinePoint:null,vLinePoint:null},$=!1;if(Array.isArray(t))for(L="array",I=0;I<t.length;I++)(N=e.calcdata[t[I].curveNumber||0])&&(H=N[0].trace,"skip"!==N[0].trace.hoverinfo&&(Q.push(N),"h"===H.orientation&&($=!0)));else{for(F=0;F<e.calcdata.length;F++)N=e.calcdata[F],"skip"!==(H=N[0].trace).hoverinfo&&m.isTraceInSubplots(H,l)&&(Q.push(N),"h"===H.orientation&&($=!0));var K,ee;if(!t.target)K="xpx"in t?t.xpx:b[0]._length/2,ee="ypx"in t?t.ypx:_[0]._length/2;else{if(!1===c.triggerHandler(e,"plotly_beforehover",t))return;var te=t.target.getBoundingClientRect();K=t.clientX-te.left,ee=t.clientY-te.top,s._calcInverseTransform(e);var re=o.apply3DTransform(s._invTransform)(K,ee);if(K=re[0],ee=re[1],K<0||K>b[0]._length||ee<0||ee>_[0]._length)return h.unhoverRaw(e,t)}if(t.pointerX=K+b[0]._offset,t.pointerY=ee+_[0]._offset,C="xval"in t?m.flat(l,t.xval):m.p2c(b,K),D="yval"in t?m.flat(l,t.yval):m.p2c(_,ee),!a(C[0])||!a(D[0]))return o.warn("Fx.hover failed",t,e),h.unhoverRaw(e,t)}var ne=1/0;function ae(e,r){for(F=0;F<Q.length;F++)if((N=Q[F])&&N[0]&&N[0].trace&&!0===(H=N[0].trace).visible&&0!==H._length&&-1===["carpet","contourcarpet"].indexOf(H._module.name)){if("splom"===H.type?B=l[j=0]:(B=m.getSubplot(H),j=l.indexOf(B)),V=L,m.isUnifiedHover(V)&&(V=V.charAt(0)),G={cd:N,trace:H,xa:b[j],ya:_[j],maxHoverDistance:Y,maxSpikeDistance:X,index:!1,distance:Math.min(ne,Y),spikeDistance:1/0,xSpike:void 0,ySpike:void 0,color:p.defaultLine,name:H.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},s[B]&&(G.subplot=s[B]._subplot),s._splomScenes&&s._splomScenes[H.uid]&&(G.scene=s._splomScenes[H.uid]),Z=W.length,"array"===V){var n=t[F];"pointNumber"in n?(G.index=n.pointNumber,V="closest"):(V="","xval"in n&&(U=n.xval,V="x"),"yval"in n&&(q=n.yval,V=V?"closest":"y"))}else void 0!==e&&void 0!==r?(U=e,q=r):(U=C[j],q=D[j]);if(0!==Y)if(H._module&&H._module.hoverPoints){var i=H._module.hoverPoints(G,U,q,V,s._hoverlayer);if(i)for(var c,u=0;u<i.length;u++)c=i[u],a(c.x0)&&a(c.y0)&&W.push(z(c,L))}else o.log("Unrecognized trace type in hover:",H);if("closest"===L&&W.length>Z&&(W.splice(0,Z),ne=W[0].distance),g&&0!==X&&0===W.length){G.distance=X,G.index=!1;var f=H._module.hoverPoints(G,U,q,"closest",s._hoverlayer);if(f&&(f=f.filter((function(e){return e.spikeDistance<=X}))),f&&f.length){var d,h=f.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)&&(d=oe(v),(!J.vLinePoint||J.vLinePoint.spikeDistance>d.spikeDistance)&&(J.vLinePoint=d))}var y=f.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)&&(d=oe(x),(!J.hLinePoint||J.hLinePoint.spikeDistance>d.spikeDistance)&&(J.hLinePoint=d))}}}}}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:s,container:s._hoverlayer,outerContainer:s._paperdiv,event:t},se=e._spikepoints,ce={vLinePoint:J.vLinePoint,hLinePoint:J.hLinePoint};if(e._spikepoints=ce,g&&0!==X&&0!==W.length){var ue=ie(W.filter((function(e){return e.ya.showspikes})),X);J.hLinePoint=oe(ue);var fe=ie(W.filter((function(e){return e.xa.showspikes})),X);J.vLinePoint=oe(fe)}if(0===W.length){var de=h.unhoverRaw(e,t);return!g||null===J.hLinePoint&&null===J.vLinePoint||E(se)&&R(e,J,le),de}g&&E(se)&&R(e,J,le);if(W.sort((function(e,t){return e.distance-t.distance})),m.isXYhover(V)&&0!==W[0].length&&"splom"!==W[0].trace.type){var pe=W[0],he=pe.cd[pe.index],ge="group"===s.boxmode||"group"===s.violinmode,ve=pe.xVal,me=pe.xa;"category"===me.type&&(ve=me._categoriesMap[ve]),"date"===me.type&&(ve=me.d2c(ve)),he&&he.t&&he.t.posLetter===me._id&&ge&&(ve+=he.t.dPos);var ye=pe.yVal;"category"===(me=pe.ya).type&&(ye=me._categoriesMap[ye]),"date"===me.type&&(ye=me.d2c(ye)),he&&he.t&&he.t.posLetter===me._id&&ge&&(ye+=he.t.dPos),ae(ve,ye);var xe={};W=W.filter((function(e){var t=S(e);if(!xe[t])return xe[t]=!0,xe[t]}))}var be=e._hoverdata,_e=[];for(I=0;I<W.length;I++){var we=W[I],Te=m.makeEventData(we,we.trace,we.cd);if(!1!==we.hovertemplate){var ke=!1;we.cd[we.index]&&we.cd[we.index].ht&&(ke=we.cd[we.index].ht),we.hovertemplate=ke||we.trace.hovertemplate||!1}we.eventData=[Te],_e.push(Te)}e._hoverdata=_e;var Me="y"===L&&(Q.length>1||W.length>1)||"closest"===L&&$&&W.length>1,Ae=p.combine(s.plot_bgcolor||p.background,s.paper_bgcolor),Le={hovermode:L,rotateLabels:Me,bgColor:Ae,container:s._hoverlayer,outerContainer:s._paperdiv,commonLabelOpts:s.hoverlabel,hoverdistance:s.hoverdistance},Se=O(W,Le,e);m.isUnifiedHover(L)||(!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?T: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 _=b[l],w=_.datum;w.offset=_.dp,w.del=_.del}}}(Se,Me?"xa":"ya",s),P(Se,Me,s._invScaleX,s._invScaleY));if(t.target&&t.target.tagName){var Ce=v.getComponentMethod("annotations","hasClickToShow")(e,_e);f(n.select(t.target),Ce?"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,be))return;be&&e.emit("plotly_unhover",{event:t,points:be});e.emit("plotly_hover",{event:t,points:e._hoverdata,xaxes:b,yaxes:_,xvals:C,yvals:D})}(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||p.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||p.background,container:i,outerContainer:o},s=O(a,l,t.gd),c=0,u=0;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}));var f=t.gd._fullLayout._invScaleX,d=t.gd._fullLayout._invScaleY;return P(s,l.rotateLabels,f,d),r?s:s.node()};var C=/<extra>([\s\S]*)<\/extra>/;function O(e,t,r){var a=r._fullLayout,i=t.hovermode,c=t.rotateLabels,f=t.bgColor,h=t.container,g=t.outerContainer,v=t.commonLabelOpts||{},w=t.fontFamily||y.HOVERFONT,T=t.fontSize||y.HOVERFONTSIZE,k=e[0],M=k.xa,C=k.ya,O="y"===i.charAt(0)?"yLabel":"xLabel",P=k[O],z=(String(P)||"").split(" ")[0],R=g.node().getBoundingClientRect(),E=R.top,I=R.width,F=R.height,N=void 0!==P&&k.distance<=t.hoverdistance&&("x"===i||"y"===i);if(N){var H,B,j=!0;for(H=0;H<e.length;H++)if(j&&void 0===e[H].zLabel&&(j=!1),B=e[H].hoverinfo||e[H].trace.hoverinfo){var V=Array.isArray(B)?B:B.split("+");if(-1===V.indexOf("all")&&-1===V.indexOf(i)){N=!1;break}}j&&(N=!1)}var U=h.selectAll("g.axistext").data(N?[0]:[]);function q(e){return e.filter((function(e){return void 0!==e.zLabelVal||(e[O]||"").split(" ")[0]===z}))}if(U.enter().append("g").classed("axistext",!0),U.exit().remove(),U.each((function(){var t=n.select(this),s=o.ensureSingle(t,"path","",(function(e){e.style({"stroke-width":"1px"})})),c=o.ensureSingle(t,"text","",(function(e){e.attr("data-notex",1)})),f=v.bgcolor||p.defaultLine,h=v.bordercolor||p.contrast(f),g=p.contrast(f),m={family:v.font.family||w,size:v.font.size||T,color:v.font.color||g};s.style({fill:f,stroke:h}),c.text(P).call(d.font,m).call(u.positionText,0,0).call(u.convertToTspans,r),t.attr("transform","");var y,x,b=c.node().getBoundingClientRect();if("x"===i){var _="top"===M.side?"-":"";c.attr("text-anchor","middle").call(u.positionText,0,"top"===M.side?E-b.bottom-A-L:E-b.top+A+L),y=M._offset+(k.x0+k.x1)/2,x=C._offset+("top"===M.side?0:C._length);var S=b.width/2+L;y<S?(y=S,s.attr("d","M-"+(S-A)+",0L-"+(S-2*A)+","+_+A+"H"+(L+b.width/2)+"v"+_+(2*L+b.height)+"H-"+S+"V"+_+A+"Z")):y>a.width-S?(y=a.width-S,s.attr("d","M"+(S-A)+",0L"+S+","+_+A+"v"+_+(2*L+b.height)+"H-"+S+"V"+_+A+"H"+(S-2*A)+"Z")):s.attr("d","M0,0L"+A+","+_+A+"H"+(L+b.width/2)+"v"+_+(2*L+b.height)+"H-"+(L+b.width/2)+"V"+_+A+"H-"+A+"Z")}else{var O,D,z;"right"===C.side?(O="start",D=1,z="",y=M._offset+M._length):(O="end",D=-1,z="-",y=M._offset),x=C._offset+(k.y0+k.y1)/2,c.attr("text-anchor",O),s.attr("d","M0,0L"+z+A+","+A+"V"+(L+b.height/2)+"h"+z+(2*L+b.width)+"V-"+(L+b.height/2)+"H"+z+A+"V-"+A+"Z");var R,I=b.height/2,F=E-b.top-I,N="clip"+a._uid+"commonlabel"+C._id;if(y<b.width+2*L+A){R="M-"+(A+L)+"-"+I+"h-"+(b.width-L)+"V"+I+"h"+(b.width-L)+"Z";var H=b.width-y+L;u.positionText(c,H,F),"end"===O&&c.selectAll("tspan").each((function(){var e=n.select(this),t=d.tester.append("text").text(e.text()).call(d.font,m),r=t.node().getBoundingClientRect();Math.round(r.width)<Math.round(b.width)&&e.attr("x",H-r.width),t.remove()}))}else u.positionText(c,D*(L+A),F),R=null;var B=a._topclips.selectAll("#"+N).data(R?[0]:[]);B.enter().append("clipPath").attr("id",N).append("path"),B.exit().remove(),B.select("path").attr("d",R),d.setClipUrl(c,R?N:null,r)}t.attr("transform",l(y,x)),e=q(e)})),m.isUnifiedHover(i)){if(h.selectAll("g.hovertext").remove(),void 0!==P&&k.distance<=t.hoverdistance&&(e=q(e)),0===e.length)return;var G={showlegend:!0,legend:{title:{text:P,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"}},Z={};x(G,Z,r._fullData);var Y=Z.legend;Y.entries=[];for(var X=0;X<e.length;X++){var W=D(e[X],!0,i,a,P),Q=W[0],J=W[1],$=e[X];$.name=J,$.text=""!==J?J+" : "+Q:Q;var K=$.cd[$.index];K&&(K.mc&&($.mc=K.mc),K.mcc&&($.mc=K.mcc),K.mlc&&($.mlc=K.mlc),K.mlcc&&($.mlc=K.mlcc),K.mlw&&($.mlw=K.mlw),K.mrc&&($.mrc=K.mrc),K.dir&&($.dir=K.dir)),$._distinct=!0,Y.entries.push([$])}Y.entries.sort((function(e,t){return e[0].trace.index-t[0].trace.index})),Y.layer=h,b(r,Y);var ee=o.mean(e.map((function(e){return(e.y0+e.y1)/2}))),te=o.mean(e.map((function(e){return(e.x0+e.x1)/2}))),re=h.select("g.legend"),ne=re.node().getBoundingClientRect();te+=M._offset,ee+=C._offset-ne.height/2;var ae=ne.width+2*L;!(te+ae<=I)&&te-ae>=0?te-=ae:te+=2*L;var ie=ne.height+2*L,oe=ee+ie>=F;return ie<=F&&(ee<=E?ee=C._offset+2*L:oe&&(ee=F-ie)),re.attr("transform",l(te,ee)),re}var le=h.selectAll("g.hovertext").data(e,(function(e){return S(e)}));return le.enter().append("g").classed("hovertext",!0).each((function(){var e=n.select(this);e.append("rect").call(p.fill,p.addOpacity(f,.8)),e.append("text").classed("name",!0),e.append("path").style("stroke-width","1px"),e.append("text").classed("nums",!0).call(d.font,w,T)})),le.exit().remove(),le.each((function(e){var t=n.select(this).attr("transform",""),o=e.color;Array.isArray(o)&&(o=o[e.eventData[0].pointNumber]);var h=e.bgcolor||o,g=p.combine(p.opacity(h)?h:p.defaultLine,f),v=p.combine(p.opacity(o)?o:p.defaultLine,f),m=e.borderColor||p.contrast(g),y=D(e,N,i,a,P,t),x=y[0],b=y[1],k=t.select("text.nums").call(d.font,e.fontFamily||w,e.fontSize||T,e.fontColor||m).text(x).attr("data-notex",1).call(u.positionText,0,0).call(u.convertToTspans,r),M=t.select("text.name"),S=0,C=0;if(b&&b!==x){M.call(d.font,e.fontFamily||w,e.fontSize||T,v).text(b).attr("data-notex",1).call(u.positionText,0,0).call(u.convertToTspans,r);var O=M.node().getBoundingClientRect();S=O.width+2*L,C=O.height+2*L}else M.remove(),t.select("rect").remove();t.select("path").style({fill:g,stroke:m});var z,R,H=k.node().getBoundingClientRect(),B=e.xa._offset+(e.x0+e.x1)/2,j=e.ya._offset+(e.y0+e.y1)/2,V=Math.abs(e.x1-e.x0),U=Math.abs(e.y1-e.y0),q=H.width+A+L+S;if(e.ty0=E-H.top,e.bx=H.width+2*L,e.by=Math.max(H.height+2*L,C),e.anchor="start",e.txwidth=H.width,e.tx2width=S,e.offset=0,c)e.pos=B,z=j+U/2+q<=F,R=j-U/2-q>=0,"top"!==e.idealAlign&&z||!R?z?(j+=U/2,e.anchor="start"):e.anchor="middle":(j-=U/2,e.anchor="end");else if(e.pos=j,z=B+V/2+q<=I,R=B-V/2-q>=0,"left"!==e.idealAlign&&z||!R)if(z)B+=V/2,e.anchor="start";else{e.anchor="middle";var G=q/2,Z=B+G-I,Y=B-G;Z>0&&(B-=Z),Y<0&&(B+=-Y)}else B-=V/2,e.anchor="end";k.attr("text-anchor",e.anchor),S&&M.attr("text-anchor",e.anchor),t.attr("transform",l(B,j)+(c?s(_):""))})),le}function D(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=I(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(C,(function(t,r){return l=I(r,e.nameLength),""}))),[s,l]}function P(e,t,r,a){var i=function(e){return e*r},o=function(e){return e*a};e.each((function(e){var r=n.select(this);if(e.del)return r.remove();var a=r.select("text.nums"),l=e.anchor,s="end"===l?-1:1,c={start:1,end:-1,middle:0}[l],f=c*(A+L),p=f+c*(e.txwidth+L),h=0,g=e.offset,v="middle"===l;v&&(f-=e.tx2width/2,p+=e.txwidth/2+L),t&&(g*=-M,h=e.offset*k),r.select("path").attr("d",v?"M-"+i(e.bx/2+e.tx2width/2)+","+o(g-e.by/2)+"h"+i(e.bx)+"v"+o(e.by)+"h-"+i(e.bx)+"Z":"M0,0L"+i(s*A+h)+","+o(A+g)+"v"+o(e.by/2-A)+"h"+i(s*e.bx)+"v-"+o(e.by)+"H"+i(s*A+h)+"V"+o(g-A)+"Z");var m=h+f,y=g+e.ty0-e.by/2+L,x=e.textAlign||"auto";"auto"!==x&&("left"===x&&"start"!==l?(a.attr("text-anchor","start"),m=v?-e.bx/2-e.tx2width/2+L:-e.bx-L):"right"===x&&"end"!==l&&(a.attr("text-anchor","end"),m=v?e.bx/2-e.tx2width/2-L:e.bx+L)),a.call(u.positionText,i(m),o(y)),e.tx2width&&(r.select("text.name").call(u.positionText,i(p+c*L+h),o(g+e.ty0-e.by/2+L)),r.select("rect").call(d.setRect,i(p+(c-1)*e.tx2width/2+h),o(g-e.by/2-1),i(e.tx2width),o(e.by+2)))}))}function z(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:g.hoverLabelText(e.xa,e.xLabelVal),e.xVal=e.xa.c2d(e.xLabelVal)),void 0!==e.yLabelVal&&(e.yLabel="yLabel"in e?e.yLabel:g.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=g.tickText(e.xa,e.xa.c2l(e.xerr),"hover").text;void 0!==e.xerrneg?e.xLabel+=" +"+f+" / -"+g.tickText(e.xa,e.xa.c2l(e.xerrneg),"hover").text:e.xLabel+=" \xb1 "+f,"x"===t&&(e.distance+=1)}if(!(isNaN(e.yerr)||"log"===e.ya.type&&e.yerr<=0)){var d=g.tickText(e.ya,e.ya.c2l(e.yerr),"hover").text;void 0!==e.yerrneg?e.yLabel+=" +"+d+" / -"+g.tickText(e.ya,e.ya.c2l(e.yerrneg),"hover").text:e.yLabel+=" \xb1 "+d,"y"===t&&(e.distance+=1)}var p=e.hoverinfo||e.trace.hoverinfo;return p&&"all"!==p&&(-1===(p=Array.isArray(p)?p:p.split("+")).indexOf("x")&&(e.xLabel=void 0),-1===p.indexOf("y")&&(e.yLabel=void 0),-1===p.indexOf("z")&&(e.zLabel=void 0),-1===p.indexOf("text")&&(e.text=void 0),-1===p.indexOf("name")&&(e.name=void 0)),e}function R(e,t,r){var n,a,o=r.container,l=r.fullLayout,s=l._size,c=r.event,u=!!t.hLinePoint,f=!!t.vLinePoint;if(o.selectAll(".spikeline").remove(),f||u){var h=p.combine(l.plot_bgcolor,l.paper_bgcolor);if(u){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,h)<1.5?p.contrast(h):y.color,w=a.spikemode,T=a.spikethickness,k=a.spikecolor||_,M=g.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":T,stroke:k,"stroke-dasharray":d.dashStyle(a.spikedash,T)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:x,x2:b,y1:m,y2:m,"stroke-width":T+2,stroke:h}).classed("spikeline",!0).classed("crisp",!0)}-1!==w.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:M+("right"!==a.side?T:-T),cy:m,r:T,fill:k}).classed("spikeline",!0)}if(f){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 D,P,z=i.readability(O.color,h)<1.5?p.contrast(h):O.color,R=n.spikemode,E=n.spikethickness,I=n.spikecolor||z,F=g.getPxPosition(e,n);if(-1!==R.indexOf("toaxis")||-1!==R.indexOf("across")){if(-1!==R.indexOf("toaxis")&&(D=F,P=C),-1!==R.indexOf("across")){var N=n._counterDomainMin,H=n._counterDomainMax;"free"===n.anchor&&(N=Math.min(N,n.position),H=Math.max(H,n.position)),D=s.t+(1-H)*s.h,P=s.t+(1-N)*s.h}o.insert("line",":first-child").attr({x1:S,x2:S,y1:D,y2:P,"stroke-width":E,stroke:I,"stroke-dasharray":d.dashStyle(n.spikedash,E)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:S,x2:S,y1:D,y2:P,"stroke-width":E+2,stroke:h}).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 E(e,t){return!t||(t.vLinePoint!==e._spikepoints.vLinePoint||t.hLinePoint!==e._spikepoints.hLinePoint)}function I(e,t){return u.plainText(e||"",{len:t,allowedTags:["br","sub","sup","b","i","em"]})}},{"../../lib":210,"../../lib/events":203,"../../lib/override_cursor":221,"../../lib/svg_text_utils":232,"../../plots/cartesian/axes":256,"../../registry":298,"../color":82,"../dragelement":101,"../drawing":104,"../legend/defaults":134,"../legend/draw":135,"./constants":116,"./helpers":118,d3:16,"fast-isnumeric":18,tinycolor2:65}],120:[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":210,"../color":82,"./helpers":118}],121:[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]||{})[a.stackgroup]||{};if("h"!==a.orientation&&"h"!==o.orientation)return!1}return!0}(r,t),o=t._isHoriz?"y":"x"):o="closest",i("hovermode",o)}},{"../../lib":210,"./layout_attributes":123}],122:[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":210,"../dragelement":101,"./attributes":113,"./calc":114,"./click":115,"./constants":116,"./defaults":117,"./helpers":118,"./hover":119,"./layout_attributes":123,"./layout_defaults":124,"./layout_global_defaults":125,d3:16}],123:[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","drawclosedpath","drawopenpath","drawline","drawrect","drawcircle","orbit","turntable",!1],dflt:"zoom",editType:"modebar"},hovermode:{valType:"enumerated",values:["x","y","closest",!1,"x unified","y unified"],editType:"modebar"},hoverdistance:{valType:"integer",min:-1,dflt:20,editType:"none"},spikedistance:{valType:"integer",min:-1,dflt:20,editType:"none"},hoverlabel:{bgcolor:{valType:"color",editType:"none"},bordercolor:{valType:"color",editType:"none"},font:a,align:{valType:"enumerated",values:["left","right","auto"],dflt:"auto",editType:"none"},namelength:{valType:"integer",min:-1,dflt:15,editType:"none"},editType:"none"},selectdirection:{valType:"enumerated",values:["h","v","d","any"],dflt:"any",editType:"none"}}},{"../../plots/font_attributes":284,"./constants":116}],124:[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":210,"./helpers":118,"./hoverlabel_defaults":120,"./hovermode_defaults":121,"./layout_attributes":123}],125:[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":210,"./hoverlabel_defaults":120,"./layout_attributes":123}],126:[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=k("rows",o),y=k("columns",f);if(m*y>1){if(!d&&!p&&!h)"independent"===k("pattern")&&(d=!0);v._hasSubplotGrid=d;var x,b,_="top to bottom"===k("roworder"),w=d?.2:.1,T=d?.3:.1;g&&t._splomGridDflt&&(x=t._splomGridDflt.xside,b=t._splomGridDflt.yside),v._domains={x:u("x",k,w,x,y),y:u("y",k,T,b,m,_)}}else delete t.grid}function k(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 T=c(t,d,"x"),k=c(t,d,"y");r.xaxes=f(T,p.xaxis,v,y,"x"),r.yaxes=f(k,p.yaxis,g,y,"y")}var M=r._anchors={},A="top to bottom"===r.roworder;for(var L in y){var S,C,O,D=L.charAt(0),P=r[D+"side"];if(P.length<8)M[L]="free";else if("x"===D){if("t"===P.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"===P.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":210,"../../lib/regex":226,"../../plot_api/plot_template":245,"../../plots/cartesian/constants":262,"../../plots/domain":283}],127:[function(e,t,r){"use strict";var n=e("../../plots/cartesian/constants"),a=e("../../plot_api/plot_template").templatedArray;e("../../constants/axis_placeable_objects");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"})},{"../../constants/axis_placeable_objects":185,"../../plot_api/plot_template":245,"../../plots/cartesian/constants":262}],128:[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":234,"fast-isnumeric":18}],129:[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)}var l=i("source");if(!i("visible",!!l))return t;i("layer"),i("xanchor"),i("yanchor"),i("sizex"),i("sizey"),i("sizing"),i("opacity");for(var s={_fullLayout:r},c=["x","y"],u=0;u<2;u++){var f=c[u],d=a.coerceRef(e,t,s,f,"paper",void 0);if("paper"!==d)a.getFromId(s,d)._imgIndices.push(t._index);a.coercePosition(t,s,i,d,f,0)}return t}t.exports=function(e,t){i(e,t,{name:"images",handleItemDefaults:l})}},{"../../lib":210,"../../plots/array_container_defaults":251,"../../plots/cartesian/axes":256,"./attributes":127}],130:[function(e,t,r){"use strict";var n=e("d3"),a=e("../drawing"),i=e("../../plots/cartesian/axes"),o=e("../../plots/cartesian/axis_ids"),l=e("../../constants/xmlns_namespaces");t.exports=function(e){var t,r,s=e._fullLayout,c=[],u={},f=[];for(r=0;r<s.images.length;r++){var d=s.images[r];if(d.visible)if("below"===d.layer&&"paper"!==d.xref&&"paper"!==d.yref){t=o.ref2id(d.xref)+o.ref2id(d.yref);var p=s._plots[t];if(!p){f.push(d);continue}p.mainplot&&(t=p.mainplot.id),u[t]||(u[t]=[]),u[t].push(d)}else"above"===d.layer?c.push(d):f.push(d)}var h={left:{sizing:"xMin",offset:0},center:{sizing:"xMid",offset:-.5},right:{sizing:"xMax",offset:-1}},g={top:{sizing:"YMin",offset:0},middle:{sizing:"YMid",offset:-.5},bottom:{sizing:"YMax",offset:-1}};function v(t){var r=n.select(this);if(this._imgSrc!==t.source)if(r.attr("xmlns",l.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 m(t){var r,o,l=n.select(this),c=i.getFromId(e,t.xref),u=i.getFromId(e,t.yref),f="domain"===i.getRefType(t.xref),d="domain"===i.getRefType(t.yref),p=s._size;r=void 0!==c?"string"==typeof t.xref&&f?c._length*t.sizex:Math.abs(c.l2p(t.sizex)-c.l2p(0)):t.sizex*p.w,o=void 0!==u?"string"==typeof t.yref&&d?u._length*t.sizey:Math.abs(u.l2p(t.sizey)-u.l2p(0)):t.sizey*p.h;var v,m,y=r*h[t.xanchor].offset,x=o*g[t.yanchor].offset,b=h[t.xanchor].sizing+g[t.yanchor].sizing;switch(v=void 0!==c?"string"==typeof t.xref&&f?c._length*t.x+c._offset:c.r2p(t.x)+c._offset:t.x*p.w+p.l,v+=y,m=void 0!==u?"string"==typeof t.yref&&d?u._length*(1-t.y)+u._offset:u.r2p(t.y)+u._offset:p.h-t.y*p.h+p.t,m+=x,t.sizing){case"fill":b+=" slice";break;case"stretch":b="none"}l.attr({x:v,y:m,width:r,height:o,preserveAspectRatio:b,opacity:t.opacity});var _=(c&&"domain"!==i.getRefType(t.xref)?c._id:"")+(u&&"domain"!==i.getRefType(t.yref)?u._id:"");a.setClipUrl(l,_?"clip"+s._uid+_:null,e)}var y=s._imageLowerLayer.selectAll("image").data(f),x=s._imageUpperLayer.selectAll("image").data(c);y.enter().append("image"),x.enter().append("image"),y.exit().remove(),x.exit().remove(),y.each((function(e){v.bind(this)(e),m.bind(this)(e)})),x.each((function(e){v.bind(this)(e),m.bind(this)(e)}));var b=Object.keys(s._plots);for(r=0;r<b.length;r++){t=b[r];var _=s._plots[t];if(_.imagelayer){var w=_.imagelayer.selectAll("image").data(u[t]||[]);w.enter().append("image"),w.exit().remove(),w.each((function(e){v.bind(this)(e),m.bind(this)(e)}))}}}},{"../../constants/xmlns_namespaces":190,"../../plots/cartesian/axes":256,"../../plots/cartesian/axis_ids":259,"../drawing":104,d3:16}],131:[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":268,"./attributes":127,"./convert_coords":128,"./defaults":129,"./draw":130}],132:[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"},itemwidth:{valType:"number",min:30,dflt:30,editType:"legend"},itemclick:{valType:"enumerated",values:["toggle","toggleothers",!1],dflt:"toggle",editType:"legend"},itemdoubleclick:{valType:"enumerated",values:["toggle","toggleothers",!1],dflt:"toggleothers",editType:"legend"},x:{valType:"number",min:-2,max:3,editType:"legend"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left",editType:"legend"},y:{valType:"number",min:-2,max:3,editType:"legend"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],editType:"legend"},uirevision:{valType:"any",editType:"none"},valign:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle",editType:"legend"},title:{text:{valType:"string",dflt:"",editType:"legend"},font:n({editType:"legend"}),side:{valType:"enumerated",values:["top","left","top left"],editType:"legend"},editType:"legend"},editType:"legend"}},{"../../plots/font_attributes":284,"../color/attributes":81}],133:[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,itemGap:5}},{}],134:[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"),_("itemwidth"),_("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":210,"../../plot_api/plot_template":245,"../../plots/layout_attributes":288,"../../registry":298,"./attributes":132,"./helpers":138}],135:[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").call(c.font,r.font).text(d?T(n,h):n);var v=r.itemwidth+2*p.itemGap;f.positionText(g,v,0),d?g.call(f.makeEditable,{gd:t,text:n}).call(M,e,t,r).on("edit",(function(n){this.text(T(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 T(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 k(e,t){var r,i=t._context.doubleClickDelay,o=1,l=a.ensureSingle(e,"rect","legendtoggle",(function(e){t._context.staticPlot||e.style("cursor","pointer").attr("pointer-events","all"),e.call(u.fill,"rgba(0,0,0,0)")}));t._context.staticPlot||(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);if(n){var x=r.itemwidth+2*p.itemGap;f.positionText(h,x,-y)}else 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")})),T=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 D=a.ensureSingle(C,"text","legendtitletext");D.attr("text-anchor","start").call(c.font,O.font).text(O.text),M(D,C,e,t)}else C.selectAll(".legendtitletext").remove();var P=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(k,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.itemGap,h=a.itemwidth+2*d,g=2*(u+d),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+d),a._height+=t,a._width=Math.max(a._width,e[0].width)})),x=h+a._width,a._width+=d+h+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),T=a.x<0||0===a.x&&"right"===w,k=a.x>1||1===a.x&&"left"===w,M=y||m,S=i.width/2;a._maxWidth=Math.max(T?M&&"left"===w?o.l+o.w:S:k?M&&"right"===w?o.r+o.w:S:o.w,2*h);var C=0,O=0;r.each((function(e){var t=e[0].width+h;C=Math.max(C,t),O+=t})),x=null;var D=0;if(s){var P=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+d+n/2+t),t+=n,e=Math.max(e,h+r[0].width)})),P=Math.max(P,t);var r=e+d;r+u+z>a._maxWidth&&(D=Math.max(D,z),z=0,R+=P+a.tracegroupgap,P=t),c.setTranslate(this,z,R),z+=r})),a._width=Math.max(D,z)+u,a._height=R+P+g}else{var E=r.size(),I=O+f+(E-1)*d<a._maxWidth,F=0,N=0,H=0,B=0;r.each((function(e){var t=e[0].height,r=h+e[0].width,n=(I?r:C)+d;n+u+N-d>=a._maxWidth&&(D=Math.max(D,B),N=0,H+=F,a._height+=F,F=0),c.setTranslate(this,_[0]+u+N,_[1]+u+H+t/2+d),B=N+r+d,N+=n,F=Math.max(F,t)})),I?(a._width=N+f,a._height=F+g):(a._width=Math.max(D,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 j=e._context.edits,V=j.legendText||j.legendPosition;r.each((function(e){var t=n.select(this).select(".legendtoggle"),r=e[0].height,a=V?h:x||h+e[0].width;l||(a+=d/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,k=x.t+x.h*(1-t.y)-v[L(t)]*t._effHeight;if(t._main&&l.margin.autoexpand){var M=w,O=k;w=a.constrain(w,0,l.width-t._width),k=a.constrain(k,0,l.height-t._effHeight),w!==M&&a.log("Constrain legend.x to make legend fit inside graph"),k!==O&&a.log("Constrain legend.y to make legend fit inside graph")}if(t._main&&c.setTranslate(g,w,k),P.on(".drag",null),g.on("wheel",null),!t._main||t._height<=t._maxHeight||e._context.staticPlot){var D=t._effHeight;t._main||(D=t._height),S.attr({width:t._width-b,height:D-b,x:b/2,y:b/2}),c.setTranslate(C,0,0),T.select("rect").attr({width:t._width-2*b,height:D-2*b,x:b,y:b}),c.setClipUrl(C,f,e),c.setRect(P,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,H=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}),T.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),U(B,I,H),g.on("wheel",(function(){U(B=a.constrain(t._scrollY+n.event.deltaY/F*N,0,N),I,H),0!==B&&B!==N&&n.event.preventDefault()}));var j=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,U(B=function(e,t,r){var n=(r-t)/H+e;return a.constrain(n,0,N)}(E,z,R),I,H))}));P.call(j);var V=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,U(B=function(e,t,r){var n=(t-r)/H+e;return a.constrain(n,0,N)}(E,z,R),I,H))}));C.call(V)}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 U(r,n,a){t._scrollY=e._fullLayout.legend._scrollY=r,c.setTranslate(C,0,-r),c.setRect(P,t._width,p.scrollBarMargin+r*a,p.scrollBarWidth,n),T.select("rect").attr("y",b+r)}}],e)}}},{"../../constants/alignment":184,"../../lib":210,"../../lib/events":203,"../../lib/svg_text_utils":232,"../../plots/plots":290,"../../registry":298,"../color":82,"../dragelement":101,"../drawing":104,"./constants":133,"./get_legend_data":136,"./handle_click":137,"./helpers":138,"./style":140,d3:16}],136:[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":298,"./helpers":138}],137:[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=[],T=[];if(a.traceIs(y,"pie-like")){var k=v.label,M=g.indexOf(k);"toggle"===l?-1===M?g.push(k):g.splice(M,1):"toggleothers"===l&&(g=[],t.calcdata[0].forEach((function(e){k!==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,D,P,z,R=!0;for(u=0;u<m.length;u++)if(O=m[u]===y,P=!0!==m[u].showlegend,!(O||P||(D=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,P=!0!==m[u].showlegend&&!m[u].legendgroup,D=O||L&&m[u].legendgroup===x,N(m[u],!(!D&&!P)||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]||[])[T[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),T[r.index]=F(r.index,"visible",!1!==r.visible)}else{var c=!1!==r.visible&&t;F(r.index,"visible",c)}}}},{"../../lib":210,"../../registry":298}],138:[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")}},{}],139:[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":132,"./defaults":134,"./draw":135,"./style":140}],140:[function(e,t,r){"use strict";var n=e("d3"),a=e("../../registry"),i=e("../../lib"),o=i.strTranslate,l=e("../drawing"),s=e("../color"),c=e("../colorscale/helpers").extractOpts,u=e("../../traces/scatter/subtypes"),f=e("../../traces/pie/style_one"),d=e("../../traces/pie/helpers").castOption,p=e("./constants");function h(e,t){return(t?"radial":"horizontal")+(e?"":"reversed")}t.exports=function(e,t,r){var g=t._fullLayout;r||(r=g.legend);var v="constant"===r.itemsizing,m=r.itemwidth,y=(m+2*p.itemGap)/2,x=o(y,0),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 v?n:Math.min(a,r)};function _(e,t,r){var i=e[0].trace,o=i.marker||{},l=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",x),u.exit().remove(),u.each((function(e){var t=n.select(this),r=e[0],a=b(r.mlw,o.line,5,2);t.style("stroke-width",a+"px").call(s.fill,r.mc||o.color),a&&s.stroke(t,r.mlc||l.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",x),c.exit().remove(),c.size()){var u=(l.marker||{}).line,p=b(d(u.width,o.pts),u,5,2),h=i.minExtend(l,{marker:{line:{width:p}}});h.marker.line.color=u.color;var g=i.minExtend(o,{trace:h});f(c,g,h)}}e.each((function(e){var t=n.select(this),a=i.ensureSingle(t,"g","layers");a.style("opacity",e[0].trace.opacity);var l=r.valign,s=e[0].lineHeight,c=e[0].height;if("middle"!==l&&s&&c){var u={top:1,bottom:-1}[l]*(.5*(s-c+3));a.attr("transform",o(0,u))}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 f=a.selectAll("g.legendsymbols").data([e]);f.enter().append("g").classed("legendsymbols",!0),f.selectAll("g.legendpoints").data([e]).enter().append("g").classed("legendpoints",!0)})).each((function(e){var r,a=e[0].trace,o=[];if(a.visible)switch(a.type){case"histogram2d":case"heatmap":o=[["M-15,-2V4H15V-2Z"]],r=!0;break;case"choropleth":case"choroplethmapbox":o=[["M-6,-6V6H6V-6Z"]],r=!0;break;case"densitymapbox":o=[["M-6,0 a6,6 0 1,0 12,0 a 6,6 0 1,0 -12,0"]],r="radial";break;case"cone":o=[["M-6,2 A2,2 0 0,0 -6,6 V6L6,4Z"],["M-6,-6 A2,2 0 0,0 -6,-2 L6,-4Z"],["M-6,-2 A2,2 0 0,0 -6,2 L6,0Z"]],r=!1;break;case"streamtube":o=[["M-6,2 A2,2 0 0,0 -6,6 H6 A2,2 0 0,1 6,2 Z"],["M-6,-6 A2,2 0 0,0 -6,-2 H6 A2,2 0 0,1 6,-6 Z"],["M-6,-2 A2,2 0 0,0 -6,2 H6 A2,2 0 0,1 6,-2 Z"]],r=!1;break;case"surface":o=[["M-6,-6 A2,3 0 0,0 -6,0 H6 A2,3 0 0,1 6,-6 Z"],["M-6,1 A2,3 0 0,1 -6,6 H6 A2,3 0 0,0 6,0 Z"]],r=!0;break;case"mesh3d":o=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],r=!1;break;case"volume":o=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],r=!0;break;case"isosurface":o=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6 A12,24 0 0,0 6,-6 L0,6Z"]],r=!1}var u=n.select(this).select("g.legendpoints").selectAll("path.legend3dandfriends").data(o);u.enter().append("path").classed("legend3dandfriends",!0).attr("transform",x).style("stroke-miterlimit",1),u.exit().remove(),u.each((function(e,o){var u,f=n.select(this),d=c(a),p=d.colorscale,g=d.reversescale;if(p){if(!r){var v=p.length;u=0===o?p[g?v-1:0][1]:1===o?p[g?0:v-1][1]:p[Math.floor((v-1)/2)][1]}}else{var m=a.vertexcolor||a.facecolor||a.color;u=i.isArrayOrTypedArray(m)?m[o]||m[0]:m}f.attr("d",e[0]),u?f.call(s.fill,u):f.call((function(e){if(e.size()){var n="legendfill-"+a.uid;l.gradient(e,t,n,h(g,"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",x).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,5,2);r.attr("d",e[1]).style("stroke-width",i+"px").call(s.fill,a.color),i&&r.call(s.stroke,a.line.color)}))})).each((function(e){_(e,this,"funnel")})).each((function(e){_(e,this)})).each((function(e){var r=e[0].trace,o=n.select(this).select("g.legendpoints").selectAll("path.legendbox").data(r.visible&&a.traceIs(r,"box-violin")?[e]:[]);o.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform",x),o.exit().remove(),o.each((function(){var e=n.select(this);if("all"!==r.boxpoints&&"all"!==r.points||0!==s.opacity(r.fillcolor)||0!==s.opacity((r.line||{}).color)){var a=b(void 0,r.line,5,2);e.style("stroke-width",a+"px").call(s.fill,r.fillcolor),a&&s.stroke(e,r.line.color)}else{var c=i.minExtend(r,{marker:{size:v?12:i.constrain(r.marker.size,2,16),sizeref:1,sizemin:1,sizemode:"diameter"}});o.call(l.pointStyle,c,t)}}))})).each((function(e){w(e,this,"funnelarea")})).each((function(e){w(e,this,"pie")})).each((function(e){var r,a,o=e[0],s=o.trace,f=s.visible&&s.fill&&"none"!==s.fill,d=u.hasLines(s),p=s.contours,g=!1,v=!1,y=c(s),x=y.colorscale,_=y.reversescale;if(p){var w=p.coloring;"lines"===w?g=!0:d="none"===w||"heatmap"===w||p.showlines,"constraint"===p.type?f="="!==p._operation:"fill"!==w&&"heatmap"!==w||(v=!0)}var T=u.hasMarkers(s)||u.hasText(s),k=f||v,M=d||g,A=T||!k?"M5,0":M?"M5,-2":"M5,-3",L=n.select(this),S=L.select(".legendfill").selectAll("path").data(f||v?[e]:[]);if(S.enter().append("path").classed("js-fill",!0),S.exit().remove(),S.attr("d",A+"h"+m+"v6h-"+m+"z").call(f?l.fillGroupStyle:function(e){if(e.size()){var r="legendfill-"+s.uid;l.gradient(e,t,r,h(_),x,"fill")}}),d||g){var C=b(void 0,s.line,10,5);a=i.minExtend(s,{line:{width:C}}),r=[i.minExtend(o,{trace:a})]}var O=L.select(".legendlines").selectAll("path").data(d||g?[r]:[]);O.enter().append("path").classed("js-line",!0),O.exit().remove(),O.attr("d",A+(g?"l"+m+",0.0001":"h"+m)).call(d?l.lineGroupStyle:function(e){if(e.size()){var r="legendline-"+s.uid;l.lineGroupStyle(e),l.gradient(e,t,r,h(_),x,"stroke")}})})).each((function(e){var r,a,o=e[0],s=o.trace,c=u.hasMarkers(s),f=u.hasText(s),d=u.hasLines(s);function p(e,t,r,n){var a=i.nestedProperty(s,e).get(),o=i.isArrayOrTypedArray(a)&&t?t(a):a;if(v&&o&&void 0!==n&&(o=n),r){if(o<r[0])return r[0];if(o>r[1])return r[1]}return o}function h(e){return o._distinct&&o.index&&e[o.index]?e[o.index]:e[0]}if(c||f||d){var g={},m={};if(c){g.mc=p("marker.color",h),g.mx=p("marker.symbol",h),g.mo=p("marker.opacity",i.mean,[.2,1]),g.mlc=p("marker.line.color",h),g.mlw=p("marker.line.width",i.mean,[0,5],2),m.marker={sizeref:1,sizemin:1,sizemode:"diameter"};var y=p("marker.size",i.mean,[2,16],12);g.ms=y,m.marker.size=y}d&&(m.line={width:p("line.width",h,[0,10],5)}),f&&(g.tx="Aa",g.tp=p("textposition",h),g.ts=10,g.tc=p("textfont.color",h),g.tf=p("textfont.family",h)),r=[i.minExtend(o,g)],(a=i.minExtend(s,m)).selectedpoints=null,a.texttemplate=null}var b=n.select(this).select("g.legendpoints"),_=b.selectAll("path.scatterpts").data(c?r:[]);_.enter().insert("path",":first-child").classed("scatterpts",!0).attr("transform",x),_.exit().remove(),_.call(l.pointStyle,a,t),c&&(r[0].mrc=3);var w=b.selectAll("g.pointtext").data(f?r:[]);w.enter().append("g").classed("pointtext",!0).append("text").attr("transform",x),w.exit().remove(),w.selectAll("text").call(l.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",x).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,5,2);a.style("stroke-width",o+"px").call(s.fill,i.fillcolor),o&&s.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",x).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,5,2);a.style("fill","none").call(l.dashLine,i.line.dash,o),o&&s.stroke(a,i.line.color)}))}))}},{"../../lib":210,"../../registry":298,"../../traces/pie/helpers":391,"../../traces/pie/style_one":397,"../../traces/scatter/subtypes":424,"../color":82,"../colorscale/helpers":93,"../drawing":104,"./constants":133,d3:16}],141:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../plots/plots"),i=e("../../plots/cartesian/axis_ids"),o=e("../../fonts/ploticon"),l=e("../shapes/draw").eraseActiveShape,s=e("../../lib"),c=s._,u=t.exports={};function f(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 d(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 p(e,t){for(var r=t.currentTarget.getAttribute("data-attr"),a="resetLastSave"===r,i="resetDefault"===r,o=e._fullLayout,l=o._subplots.gl3d||[],s={},c=0;c<l.length;c++){var u,f=l[c],d=f+".camera",p=f+".aspectratio",h=f+".aspectmode",g=o[f]._scene;a?(s[d+".up"]=g.viewInitial.up,s[d+".eye"]=g.viewInitial.eye,s[d+".center"]=g.viewInitial.center,u=!0):i&&(s[d+".up"]=null,s[d+".eye"]=null,s[d+".center"]=null,u=!0),u&&(s[p+".x"]=g.viewInitial.aspectratio.x,s[p+".y"]=g.viewInitial.aspectratio.y,s[p+".z"]=g.viewInitial.aspectratio.z,s[h]=g.viewInitial.aspectmode)}n.call("_guiRelayout",e,s)}function h(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 g(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&&x(e,"geo")}function v(e){var t=e._fullLayout;return!t.hovermode&&(t._has("cartesian")?t._isHoriz?"y":"x":"closest")}function m(e){var t=v(e);n.call("_guiRelayout",e,"hovermode",t)}function y(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 x(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)}u.toImage={name:"toImage",title:function(e){var t=(e._context.toImageButtonOptions||{}).format||"png";return c(e,"png"===t?"Download plot as a png":"Download plot")},icon:o.camera,click:function(e){var t=e._context.toImageButtonOptions,r={format:t.format||"png"};s.notifier(c(e,"Taking snapshot - this may take a few seconds"),"long"),"svg"!==r.format&&s.isIE()&&(s.notifier(c(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){s.notifier(c(e,"Snapshot succeeded")+" - "+t,"long")})).catch((function(){s.notifier(c(e,"Sorry, there was a problem downloading your snapshot!"),"long")}))}},u.sendDataToCloud={name:"sendDataToCloud",title:function(e){return c(e,"Edit in Chart Studio")},icon:o.disk,click:function(e){a.sendDataToCloud(e)}},u.editInChartStudio={name:"editInChartStudio",title:function(e){return c(e,"Edit in Chart Studio")},icon:o.pencil,click:function(e){a.sendDataToCloud(e)}},u.zoom2d={name:"zoom2d",title:function(e){return c(e,"Zoom")},attr:"dragmode",val:"zoom",icon:o.zoombox,click:f},u.pan2d={name:"pan2d",title:function(e){return c(e,"Pan")},attr:"dragmode",val:"pan",icon:o.pan,click:f},u.select2d={name:"select2d",title:function(e){return c(e,"Box Select")},attr:"dragmode",val:"select",icon:o.selectbox,click:f},u.lasso2d={name:"lasso2d",title:function(e){return c(e,"Lasso Select")},attr:"dragmode",val:"lasso",icon:o.lasso,click:f},u.drawclosedpath={name:"drawclosedpath",title:function(e){return c(e,"Draw closed freeform")},attr:"dragmode",val:"drawclosedpath",icon:o.drawclosedpath,click:f},u.drawopenpath={name:"drawopenpath",title:function(e){return c(e,"Draw open freeform")},attr:"dragmode",val:"drawopenpath",icon:o.drawopenpath,click:f},u.drawline={name:"drawline",title:function(e){return c(e,"Draw line")},attr:"dragmode",val:"drawline",icon:o.drawline,click:f},u.drawrect={name:"drawrect",title:function(e){return c(e,"Draw rectangle")},attr:"dragmode",val:"drawrect",icon:o.drawrect,click:f},u.drawcircle={name:"drawcircle",title:function(e){return c(e,"Draw circle")},attr:"dragmode",val:"drawcircle",icon:o.drawcircle,click:f},u.eraseshape={name:"eraseshape",title:function(e){return c(e,"Erase active shape")},icon:o.eraseshape,click:l},u.zoomIn2d={name:"zoomIn2d",title:function(e){return c(e,"Zoom in")},attr:"zoom",val:"in",icon:o.zoom_plus,click:f},u.zoomOut2d={name:"zoomOut2d",title:function(e){return c(e,"Zoom out")},attr:"zoom",val:"out",icon:o.zoom_minus,click:f},u.autoScale2d={name:"autoScale2d",title:function(e){return c(e,"Autoscale")},attr:"zoom",val:"auto",icon:o.autoscale,click:f},u.resetScale2d={name:"resetScale2d",title:function(e){return c(e,"Reset axes")},attr:"zoom",val:"reset",icon:o.home,click:f},u.hoverClosestCartesian={name:"hoverClosestCartesian",title:function(e){return c(e,"Show closest data on hover")},attr:"hovermode",val:"closest",icon:o.tooltip_basic,gravity:"ne",click:f},u.hoverCompareCartesian={name:"hoverCompareCartesian",title:function(e){return c(e,"Compare data on hover")},attr:"hovermode",val:function(e){return e._fullLayout._isHoriz?"y":"x"},icon:o.tooltip_compare,gravity:"ne",click:f},u.zoom3d={name:"zoom3d",title:function(e){return c(e,"Zoom")},attr:"scene.dragmode",val:"zoom",icon:o.zoombox,click:d},u.pan3d={name:"pan3d",title:function(e){return c(e,"Pan")},attr:"scene.dragmode",val:"pan",icon:o.pan,click:d},u.orbitRotation={name:"orbitRotation",title:function(e){return c(e,"Orbital rotation")},attr:"scene.dragmode",val:"orbit",icon:o["3d_rotate"],click:d},u.tableRotation={name:"tableRotation",title:function(e){return c(e,"Turntable rotation")},attr:"scene.dragmode",val:"turntable",icon:o["z-axis"],click:d},u.resetCameraDefault3d={name:"resetCameraDefault3d",title:function(e){return c(e,"Reset camera to default")},attr:"resetDefault",icon:o.home,click:p},u.resetCameraLastSave3d={name:"resetCameraLastSave3d",title:function(e){return c(e,"Reset camera to last save")},attr:"resetLastSave",icon:o.movie,click:p},u.hoverClosest3d={name:"hoverClosest3d",title:function(e){return c(e,"Toggle show closest data on hover")},attr:"hovermode",val:null,toggle:!0,icon:o.tooltip_basic,gravity:"ne",click:function(e,t){var r=h(e,t);n.call("_guiRelayout",e,r)}},u.zoomInGeo={name:"zoomInGeo",title:function(e){return c(e,"Zoom in")},attr:"zoom",val:"in",icon:o.zoom_plus,click:g},u.zoomOutGeo={name:"zoomOutGeo",title:function(e){return c(e,"Zoom out")},attr:"zoom",val:"out",icon:o.zoom_minus,click:g},u.resetGeo={name:"resetGeo",title:function(e){return c(e,"Reset")},attr:"reset",val:null,icon:o.autoscale,click:g},u.hoverClosestGeo={name:"hoverClosestGeo",title:function(e){return c(e,"Toggle show closest data on hover")},attr:"hovermode",val:null,toggle:!0,icon:o.tooltip_basic,gravity:"ne",click:m},u.hoverClosestGl2d={name:"hoverClosestGl2d",title:function(e){return c(e,"Toggle show closest data on hover")},attr:"hovermode",val:null,toggle:!0,icon:o.tooltip_basic,gravity:"ne",click:m},u.hoverClosestPie={name:"hoverClosestPie",title:function(e){return c(e,"Toggle show closest data on hover")},attr:"hovermode",val:"closest",icon:o.tooltip_basic,gravity:"ne",click:m},u.resetViewSankey={name:"resetSankeyGroup",title:function(e){return c(e,"Reset view")},icon:o.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)}},u.toggleHover={name:"toggleHover",title:function(e){return c(e,"Toggle show closest data on hover")},attr:"hovermode",val:null,toggle:!0,icon:o.tooltip_basic,gravity:"ne",click:function(e,t){var r=h(e,t);r.hovermode=v(e),n.call("_guiRelayout",e,r)}},u.resetViews={name:"resetViews",title:function(e){return c(e,"Reset views")},icon:o.home,click:function(e,t){var r=t.currentTarget;r.setAttribute("data-attr","zoom"),r.setAttribute("data-val","reset"),f(e,t),r.setAttribute("data-attr","resetLastSave"),p(e,t),x(e,"geo"),x(e,"mapbox")}},u.toggleSpikelines={name:"toggleSpikelines",title:function(e){return c(e,"Toggle Spike Lines")},icon:o.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))}},u.resetViewMapbox={name:"resetViewMapbox",title:function(e){return c(e,"Reset view")},attr:"reset",icon:o.home,click:function(e){x(e,"mapbox")}},u.zoomInMapbox={name:"zoomInMapbox",title:function(e){return c(e,"Zoom in")},attr:"zoom",val:"in",icon:o.zoom_plus,click:y},u.zoomOutMapbox={name:"zoomOutMapbox",title:function(e){return c(e,"Zoom out")},attr:"zoom",val:"out",icon:o.zoom_minus,click:y}},{"../../fonts/ploticon":193,"../../lib":210,"../../plots/cartesian/axis_ids":259,"../../plots/plots":290,"../../registry":298,"../shapes/draw":163}],142:[function(e,t,r){"use strict";r.manage=e("./manage")},{"./manage":143}],143:[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,u=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 f,d=r.modeBarButtons;f=Array.isArray(d)&&d.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}(d):!r.displayModeBar&&r.watermark?[]:function(e){var t=e._fullLayout,r=e._fullData,l=e._context,u=l.modeBarButtonsToRemove,f=l.modeBarButtonsToAdd,d=t._has("cartesian"),p=t._has("gl3d"),h=t._has("geo"),g=t._has("pie"),v=t._has("funnelarea"),m=t._has("gl2d"),y=t._has("ternary"),x=t._has("mapbox"),b=t._has("polar"),_=t._has("sankey"),w=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),T=o(t.hovermode),k=[];function M(e){if(e.length){for(var t=[],r=0;r<e.length;r++){var n=e[r];-1===u.indexOf(n)&&t.push(s[n])}k.push(t)}}var A=["toImage"];l.showEditInChartStudio?A.push("editInChartStudio"):l.showSendToCloud&&A.push("sendDataToCloud");M(A);var L=[],S=[],C=[],O=[];(d||m||g||v||y)+h+p+x+b>1?(S=["toggleHover"],C=["resetViews"]):h?(L=["zoomInGeo","zoomOutGeo"],S=["hoverClosestGeo"],C=["resetGeo"]):p?(S=["hoverClosest3d"],C=["resetCameraDefault3d","resetCameraLastSave3d"]):x?(L=["zoomInMapbox","zoomOutMapbox"],S=["toggleHover"],C=["resetViewMapbox"]):m?S=["hoverClosestGl2d"]:g?S=["hoverClosestPie"]:_?(S=["hoverClosestCartesian","hoverCompareCartesian"],C=["resetViewSankey"]):S=["toggleHover"];d&&(S=["toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"]);(function(e){for(var t=0;t<e.length;t++)if(!i.traceIs(e[t],"noHover"))return!1;return!0}(r)||T)&&(S=[]);!d&&!m||w||(L=["zoomIn2d","zoomOut2d","autoScale2d"],"resetViews"!==C[0]&&(C=["resetScale2d"]));p?O=["zoom3d","pan3d","orbitRotation","tableRotation"]:(d||m)&&!w||y?O=["zoom2d","pan2d"]:x||h?O=["pan2d"]:b&&(O=["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)&&O.push("select2d","lasso2d");if(Array.isArray(f)){for(var D=[],P=0;P<f.length;P++){var z=f[P];"string"==typeof z?-1!==c.indexOf(z)&&(t._has("mapbox")||t._has("cartesian"))&&O.push(z):D.push(z)}f=D}return M(O),M(L.concat(C)),M(S),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,f)}(e),u?u.update(e,f):t._modeBar=l(e,f)}else u&&(u.destroy(),delete t._modeBar)};var c=["drawline","drawopenpath","drawclosedpath","drawcircle","drawrect","eraseshape"]},{"../../plots/cartesian/axis_ids":259,"../../registry":298,"../../traces/scatter/subtypes":424,"../fx/helpers":118,"./buttons":141,"./modebar":144}],144:[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":193,"../../lib":210,d3:16,"fast-isnumeric":18}],145:[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":245,"../../plots/font_attributes":284,"../color/attributes":81}],146:[function(e,t,r){"use strict";t.exports={yPad:.02,minButtonWidth:30,rx:3,ry:3,lightAmount:25,darkAmount:10}},{}],147:[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":210,"../../plot_api/plot_template":245,"../../plots/array_container_defaults":251,"../color":82,"./attributes":145,"./constants":146}],148:[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=s.strTranslate,u=e("../../lib/svg_text_utils"),f=e("../../plots/cartesian/axis_ids"),d=e("../../constants/alignment"),p=d.LINE_SPACING,h=d.FROM_TL,g=d.FROM_BR,v=e("./constants"),m=e("./get_update_object");function y(e){return e._id}function x(e,t,r){var n=s.ensureSingle(e,"rect","selector-rect",(function(e){e.attr("shape-rendering","crispEdges")}));n.attr({rx:v.rx,ry:v.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 b(e,t,r,n){s.ensureSingle(e,"text","selector-text",(function(e){e.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){u.convertToTspans(e,n)}))}t.exports=function(e){var t=e._fullLayout._infolayer.selectAll(".rangeselector").data(function(e){for(var t=f.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),y);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,f=o.rangeselector,d=r.selectAll("g.button").data(s.filterVisible(f.buttons));d.enter().append("g").classed("button",!0),d.exit().remove(),d.each((function(t){var r=n.select(this),i=m(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(x,f,t),r.call(b,f,t,e),r.on("click",(function(){e._dragged||a.call("_guiRelayout",e,i)})),r.on("mouseover",(function(){t._isHovered=!0,r.call(x,f,t)})),r.on("mouseout",(function(){t._isHovered=!1,r.call(x,f,t)}))})),function(e,t,r,a,o){var f=0,d=0,m=r.borderwidth;t.each((function(){var e=n.select(this).select(".selector-text"),t=r.font.size*p,a=Math.max(t*u.lineCount(e),16)+3;d=Math.max(d,a)})),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*p,s=u.lineCount(a),h=Math.max(i+10,v.minButtonWidth);e.attr("transform",c(m+f,m)),t.attr({x:0,y:0,width:h,height:d}),u.positionText(a,h/2,d/2-(s-1)*o/2+3),f+=h+5}));var y=e._fullLayout._size,x=y.l+y.w*r.x,b=y.t+y.h*(1-r.y),_="left";s.isRightAnchor(r)&&(x-=f,_="right");s.isCenterAnchor(r)&&(x-=f/2,_="center");var w="top";s.isBottomAnchor(r)&&(b-=d,w="bottom");s.isMiddleAnchor(r)&&(b-=d/2,w="middle");f=Math.ceil(f),d=Math.ceil(d),x=Math.round(x),b=Math.round(b),i.autoMargin(e,a+"-range-selector",{x:r.x,y:r.y,l:f*h[_],r:f*g[_],b:d*g[w],t:d*h[w]}),o.attr("transform",c(x,b))}(e,d,f,o._name,r)}))}},{"../../constants/alignment":184,"../../lib":210,"../../lib/svg_text_utils":232,"../../plots/cartesian/axis_ids":259,"../../plots/plots":290,"../../registry":298,"../color":82,"../drawing":104,"./constants":146,"./get_update_object":149,d3:16}],149:[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:16}],150:[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":145,"./defaults":147,"./draw":148}],151:[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":81}],152:[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":255,"../../plots/cartesian/axis_ids":259,"./constants":153}],153:[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}},{}],154:[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":210,"../../plot_api/plot_template":245,"../../plots/cartesian/axis_ids":259,"./attributes":151,"./oppaxis_attributes":158}],155:[function(e,t,r){"use strict";var n=e("d3"),a=e("../../registry"),i=e("../../plots/plots"),o=e("../../lib"),l=o.strTranslate,s=e("../drawing"),c=e("../color"),u=e("../titles"),f=e("../../plots/cartesian"),d=e("../../plots/cartesian/axis_ids"),p=e("../dragelement"),h=e("../../lib/setcursor"),g=e("./constants");function v(e,t,r,n){var a=o.ensureSingle(e,"rect",g.bgClassName,(function(e){e.attr({x:0,y:0,"shape-rendering":"crispEdges"})})),i=n.borderwidth%2==0?n.borderwidth:n.borderwidth-1,c=-n._offsetShift,u=s.crispRound(t,n.borderwidth);a.attr({width:n._width+i,height:n._height+i,transform:l(c,c),fill:n.bgcolor,stroke:n.bordercolor,"stroke-width":u})}function m(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 y(e,t,r,a){var l,c=t.calcdata,u=e.selectAll("g."+g.rangePlotClassName).data(r._subplotsWith,o.identity);u.enter().append("g").attr("class",(function(e){return g.rangePlotClassName+" "+e})).call(s.setClipUrl,a._clipId,t),u.order(),u.exit().remove(),u.each((function(e,o){var s=n.select(this),u=0===o,p=d.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:s,xaxis:m,yaxis:y,isRangePlot:!0};u?l=x:(x.mainplot="xy",x.mainplotinfo=l),f.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 x(e,t,r,n,a){(o.ensureSingle(e,"rect",g.maskMinClassName,(function(e){e.attr({x:0,y:0,"shape-rendering":"crispEdges"})})).attr("height",n._height).call(c.fill,g.maskColor),o.ensureSingle(e,"rect",g.maskMaxClassName,(function(e){e.attr({y:0,"shape-rendering":"crispEdges"})})).attr("height",n._height).call(c.fill,g.maskColor),"match"!==a.rangemode)&&(o.ensureSingle(e,"rect",g.maskMinOppAxisClassName,(function(e){e.attr({y:0,"shape-rendering":"crispEdges"})})).attr("width",n._width).call(c.fill,g.maskOppAxisColor),o.ensureSingle(e,"rect",g.maskMaxOppAxisClassName,(function(e){e.attr({y:0,"shape-rendering":"crispEdges"})})).attr("width",n._width).style("border-top",g.maskOppBorder).call(c.fill,g.maskOppAxisColor))}function b(e,t,r,n){t._context.staticPlot||o.ensureSingle(e,"rect",g.slideBoxClassName,(function(e){e.attr({y:0,cursor:g.slideBoxCursor,"shape-rendering":"crispEdges"})})).attr({height:n._height,fill:g.slideBoxFill})}function _(e,t,r,n){var a=o.ensureSingle(e,"g",g.grabberMinClassName),i=o.ensureSingle(e,"g",g.grabberMaxClassName),l={x:0,width:g.handleWidth,rx:g.handleRadius,fill:c.background,stroke:c.defaultLine,"stroke-width":g.handleStrokeWidth,"shape-rendering":"crispEdges"},s={y:Math.round(n._height/4),height:Math.round(n._height/2)};o.ensureSingle(a,"rect",g.handleMinClassName,(function(e){e.attr(l)})).attr(s),o.ensureSingle(i,"rect",g.handleMaxClassName,(function(e){e.attr(l)})).attr(s);var u={width:g.grabAreaWidth,x:0,y:0,fill:g.grabAreaFill,cursor:t._context.staticPlot?void 0:g.grabAreaCursor};o.ensureSingle(a,"rect",g.grabAreaMinClassName,(function(e){e.attr(u)})).attr("height",n._height),o.ensureSingle(i,"rect",g.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 s=r[i][g.name];s._clipId=s._id+"-"+t._uid}var c=t._infolayer.selectAll("g."+g.containerClassName).data(r,(function(e){return e._name}));c.exit().each((function(e){var r=e[g.name];t._topdefs.select("#"+r._clipId).remove()})).remove(),0!==r.length&&(c.enter().append("g").classed(g.containerClassName,!0).attr("pointer-events","all"),c.each((function(r){var i=n.select(this),s=r[g.name],c=t[d.id2name(r.anchor)],f=s[d.id2name(r.anchor)];if(s.range){var w,T=o.simpleMap(s.range,r.r2l),k=o.simpleMap(r.range,r.r2l);w=k[0]<k[1]?[Math.min(T[0],k[0]),Math.max(T[1],k[1])]:[Math.max(T[0],k[0]),Math.min(T[1],k[1])],s.range=s._input.range=o.simpleMap(w,r.l2r)}r.cleanRange("rangeslider.range");var M=t._size,A=r.domain;s._width=M.w*(A[1]-A[0]);var L=Math.round(M.l+M.w*A[0]),S=Math.round(M.t+M.h*(1-r._counterDomainMin)+("bottom"===r.side?r._depth:0)+s._offsetShift+g.extraPad);i.attr("transform",l(L,S)),s._rl=o.simpleMap(s.range,r.r2l);var C=s._rl[0],O=s._rl[1],D=O-C;if(s.p2d=function(e){return e/s._width*D+C},s.d2p=function(e){return(e-C)/D*s._width},r.rangebreaks){var P=r.locateBreaks(C,O);if(P.length){var z,R,E=0;for(z=0;z<P.length;z++)E+=(R=P[z]).max-R.min;var I=s._width/(O-C-E),F=[-I*C];for(z=0;z<P.length;z++)R=P[z],F.push(F[F.length-1]-I*(R.max-R.min));for(s.d2p=function(e){for(var t=F[0],r=0;r<P.length;r++){var n=P[r];if(e>=n.max)t=F[r+1];else if(e<n.min)break}return t+I*e},z=0;z<P.length;z++)(R=P[z]).pmin=s.d2p(R.min),R.pmax=s.d2p(R.max);s.p2d=function(e){for(var t=F[0],r=0;r<P.length;r++){var n=P[r];if(e>=n.pmax)t=F[r+1];else if(e<n.pmin)break}return(e-t)/I}}}if("match"!==f.rangemode){var N=c.r2l(f.range[0]),H=c.r2l(f.range[1])-N;s.d2pOppAxis=function(e){return(e-N)/H*s._height}}i.call(v,e,r,s).call(m,e,r,s).call(y,e,r,s).call(x,e,r,s,f).call(b,e,r,s).call(_,e,r,s),function(e,t,r,i){if(t._context.staticPlot)return;var l=e.select("rect."+g.slideBoxClassName).node(),s=e.select("rect."+g.grabAreaMinClassName).node(),c=e.select("rect."+g.grabAreaMaxClassName).node();function u(){var u=n.event,f=u.target,d=u.clientX||u.touches[0].clientX,g=d-e.node().getBoundingClientRect().left,v=i.d2p(r._rl[0]),m=i.d2p(r._rl[1]),y=p.coverSlip();function x(e){var u,p,x,b=+(e.clientX||e.touches[0].clientX)-d;switch(f){case l:x="ew-resize",u=v+b,p=m+b;break;case s:x="col-resize",u=v+b,p=m;break;case c:x="col-resize",u=v,p=m+b;break;default:x="ew-resize",u=g,p=g+b}if(p<u){var _=p;p=u,u=_}i._pixelMin=u,i._pixelMax=p,h(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)}function b(){y.removeEventListener("mousemove",x),y.removeEventListener("mouseup",b),this.removeEventListener("touchmove",x),this.removeEventListener("touchend",b),o.removeElement(y)}this.addEventListener("touchmove",x),this.addEventListener("touchend",b),y.addEventListener("mousemove",x),y.addEventListener("mouseup",b)}e.on("mousedown",u),e.on("touchstart",u)}(i,e,r,s),function(e,t,r,n,a,i){var s=g.handleWidth/2;function c(e){return o.constrain(e,0,n._width)}function u(e){return o.constrain(e,0,n._height)}function f(e){return o.constrain(e,-s,n._width+s)}var d=c(n.d2p(r._rl[0])),p=c(n.d2p(r._rl[1]));if(e.select("rect."+g.slideBoxClassName).attr("x",d).attr("width",p-d),e.select("rect."+g.maskMinClassName).attr("width",d),e.select("rect."+g.maskMaxClassName).attr("x",p).attr("width",n._width-p),"match"!==i.rangemode){var h=n._height-u(n.d2pOppAxis(a._rl[1])),v=n._height-u(n.d2pOppAxis(a._rl[0]));e.select("rect."+g.maskMinOppAxisClassName).attr("x",d).attr("height",h).attr("width",p-d),e.select("rect."+g.maskMaxOppAxisClassName).attr("x",d).attr("y",v).attr("height",n._height-v).attr("width",p-d),e.select("rect."+g.slideBoxClassName).attr("y",h).attr("height",v-h)}var m=Math.round(f(d-s))-.5,y=Math.round(f(p-s))+.5;e.select("g."+g.grabberMinClassName).attr("transform",l(m,.5)),e.select("g."+g.grabberMaxClassName).attr("transform",l(y,.5))}(i,0,r,s,c,f),"bottom"===r.side&&u.draw(e,r._id+"title",{propContainer:r,propName:r._name+".title",placeholder:t._dfltTitle.x,attributes:{x:r._offset+r._length/2,y:S+s._height+s._offsetShift+10+1.5*r.title.font.size,"text-anchor":"middle"}})})))}},{"../../lib":210,"../../lib/setcursor":230,"../../plots/cartesian":269,"../../plots/cartesian/axis_ids":259,"../../plots/plots":290,"../../registry":298,"../color":82,"../dragelement":101,"../drawing":104,"../titles":177,"./constants":153,d3:16}],156:[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":184,"../../lib/svg_text_utils":232,"../../plots/cartesian/axis_ids":259,"./constants":153}],157:[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":210,"./attributes":151,"./calc_autorange":152,"./defaults":154,"./draw":155,"./helpers":156,"./oppaxis_attributes":158}],158:[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"}},{}],159:[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;e("../../constants/axis_placeable_objects");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"},fillrule:{valType:"enumerated",values:["evenodd","nonzero"],dflt:"evenodd",editType:"arraydraw"},editable:{valType:"boolean",dflt:!1,editType:"calc+arraydraw"},editType:"arraydraw"})},{"../../constants/axis_placeable_objects":185,"../../lib/extend":204,"../../plot_api/plot_template":245,"../../traces/scatter/attributes":399,"../annotations/attributes":67,"../drawing/attributes":103}],160:[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];d._extremes={};var p=a.getRefType(d.xref),h=a.getRefType(d.yref);if("paper"!==d.xref&&"domain"!==p){var g="pixel"===d.xsizemode?d.xanchor:d.x0,v="pixel"===d.xsizemode?d.xanchor:d.x1;(f=u(c=a.getFromId(e,d.xref),g,v,d.path,i.paramIsX))&&(d._extremes[c._id]=a.findExtremes(c,f,l(d)))}if("paper"!==d.yref&&"domain"!==h){var m="pixel"===d.ysizemode?d.yanchor:d.y0,y="pixel"===d.ysizemode?d.yanchor:d.y1;(f=u(c=a.getFromId(e,d.yref),m,y,d.path,i.paramIsY))&&(d._extremes[c._id]=a.findExtremes(c,f,s(d)))}}}},{"../../lib":210,"../../plots/cartesian/axes":256,"./constants":161,"./helpers":170}],161:[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}}},{}],162:[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")){var s=i("path"),c=i("type",s?"path":"rect");"path"!==t.type&&delete t.path,i("editable"),i("layer"),i("opacity"),i("fillcolor"),i("fillrule"),i("line.width")&&(i("line.color"),i("line.dash"));for(var u=i("xsizemode"),f=i("ysizemode"),d=["x","y"],p=0;p<2;p++){var h,g,v,m=d[p],y=m+"anchor",x="x"===m?u:f,b={_fullLayout:r},_=a.coerceRef(e,t,b,m,void 0,"paper");if("range"===a.getRefType(_)?((h=a.getFromId(b,_))._shapeIndices.push(t._index),v=l.rangeToShapePosition(h),g=l.shapePositionToRange(h)):g=v=n.identity,"path"!==c){var w=m+"0",T=m+"1",k=e[w],M=e[T];e[w]=g(e[w],!0),e[T]=g(e[T],!0),"pixel"===x?(i(w,0),i(T,10)):(a.coercePosition(t,b,i,_,w,.25),a.coercePosition(t,b,i,_,T,.75)),t[w]=v(t[w]),t[T]=v(t[T]),e[w]=k,e[T]=M}if("pixel"===x){var A=e[y];e[y]=g(e[y],!0),a.coercePosition(t,b,i,_,y,.25),t[y]=v(t[y]),e[y]=A}}"path"===c?i("path"):n.noneOrAll(e,t,["x0","x1","y0","y1"])}}t.exports=function(e,t){i(e,t,{name:"shapes",handleItemDefaults:s})}},{"../../lib":210,"../../plots/array_container_defaults":251,"../../plots/cartesian/axes":256,"./attributes":159,"./helpers":170}],163:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../lib"),i=e("../../plots/cartesian/axes"),o=e("./draw_newshape/helpers").readPaths,l=e("./draw_newshape/display_outlines"),s=e("../../plots/cartesian/handle_outline").clearOutlineControllers,c=e("../color"),u=e("../drawing"),f=e("../../plot_api/plot_template").arrayEditor,d=e("../dragelement"),p=e("../../lib/setcursor"),h=e("./constants"),g=e("./helpers");function v(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&&x(e,a)}function m(e){return!!e._fullLayout._drawing}function y(e){return!e._context.edits.shapePosition}function x(e,t){e._fullLayout._paperdiv.selectAll('.shapelayer [data-index="'+t+'"]').remove();var r=g.makeOptionsAndPlotinfo(e,t),s=r.options,x=r.plotinfo;if(s._input&&!1!==s.visible)if("below"!==s.layer)k(e._fullLayout._shapeUpperLayer);else if("paper"===s.xref||"paper"===s.yref)k(e._fullLayout._shapeLowerLayer);else{if(x._hadPlotinfo)k((x.mainplotinfo||x).shapelayer);else k(e._fullLayout._shapeLowerLayer)}function k(r){var k=_(e,s),M={"data-index":t,"fill-rule":s.fillrule,d:k},A=s.opacity,L=s.fillcolor,S=s.line.width?s.line.color:"rgba(0,0,0,0)",C=s.line.width,O=s.line.dash;C||!0!==s.editable||(C=5,O="solid");var D="Z"!==k[k.length-1],P=y(e)&&s.editable&&e._fullLayout._activeShapeIndex===t;P&&(L=D?"rgba(0,0,0,0)":e._fullLayout.activeshape.fillcolor,A=e._fullLayout.activeshape.opacity);var z,R=r.append("path").attr(M).style("opacity",A).call(c.stroke,S).call(c.fill,L).call(u.dashLine,O,C);if(b(R,e,s),(P||e._context.edits.shapePosition)&&(z=f(e.layout,"shapes",s)),P){R.style({cursor:"move"});var E={element:R.node(),plotinfo:x,gd:e,editHelpers:z,isActiveShape:!0},I=o(k,e);l(I,R,E)}else e._context.edits.shapePosition?function(e,t,r,o,l,s){var c,f,v,y,x,T,k,M,A,L,S,C,O,D,P,z,R="pixel"===r.xsizemode,E="pixel"===r.ysizemode,I="line"===r.type,F="path"===r.type,N=s.modifyItem,H=i.getFromId(e,r.xref),B=i.getRefType(r.xref),j=i.getFromId(e,r.yref),V=i.getRefType(r.yref),U=g.getDataToPixel(e,H,!1,B),q=g.getDataToPixel(e,j,!0,V),G=g.getPixelToData(e,H,!1,B),Z=g.getPixelToData(e,j,!0,V),Y=I?function(){var e=Math.max(r.line.width,10),n=l.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=Math.max(e/2,10);return n.append("circle").attr({"data-line-point":"start-point",cx:R?U(r.xanchor)+r.x0:U(r.x0),cy:E?q(r.yanchor)-r.y0:q(r.y0),r:i}).style(a).classed("cursor-grab",!0),n.append("circle").attr({"data-line-point":"end-point",cx:R?U(r.xanchor)+r.x1:U(r.x1),cy:E?q(r.yanchor)-r.y1:q(r.y1),r:i}).style(a).classed("cursor-grab",!0),n}():t,X={element:Y.node(),gd:e,prepFn:function(n){if(m(e))return;R&&(x=U(r.xanchor));E&&(T=q(r.yanchor));"path"===r.type?P=r.path:(c=R?r.x0:U(r.x0),f=E?r.y0:q(r.y0),v=R?r.x1:U(r.x1),y=E?r.y1:q(r.y1));c<v?(A=c,O="x0",L=v,D="x1"):(A=v,O="x1",L=c,D="x0");!E&&f<y||E&&f>y?(k=f,S="y0",M=y,C="y1"):(k=y,S="y1",M=f,C="y0");W(n),$(l,r),function(e,t,r){var n=t.xref,a=t.yref,o=i.getFromId(r,n),l=i.getFromId(r,a),s="";"paper"===n||o.autorange||(s+=n);"paper"===a||l.autorange||(s+=a);u.setClipUrl(e,s?"clip"+r._fullLayout._uid+s:null,r)}(t,r,e),X.moveFn="move"===z?Q:J,X.altKey=n.altKey},doneFn:function(){if(m(e))return;p(t),K(l),b(t,e,r),n.call("_guiRelayout",e,s.getUpdateObj())},clickFn:function(){if(m(e))return;K(l)}};function W(r){if(m(e))z=null;else if(I)z="path"===r.target.tagName?"move":"start-point"===r.target.attributes["data-line-point"].value?"resize-over-start-point":"resize-over-end-point";else{var n=X.element.getBoundingClientRect(),a=n.right-n.left,i=n.bottom-n.top,o=r.clientX-n.left,l=r.clientY-n.top,s=!F&&a>10&&i>10&&!r.shiftKey?d.getCursor(o/a,1-l/i):"move";p(t,s),z=s.split("-")[0]}}function Q(n,a){if("path"===r.type){var i=function(e){return e},o=i,s=i;R?N("xanchor",r.xanchor=G(x+n)):(o=function(e){return G(U(e)+n)},H&&"date"===H.type&&(o=g.encodeDate(o))),E?N("yanchor",r.yanchor=Z(T+a)):(s=function(e){return Z(q(e)+a)},j&&"date"===j.type&&(s=g.encodeDate(s))),N("path",r.path=w(P,o,s))}else R?N("xanchor",r.xanchor=G(x+n)):(N("x0",r.x0=G(c+n)),N("x1",r.x1=G(v+n))),E?N("yanchor",r.yanchor=Z(T+a)):(N("y0",r.y0=Z(f+a)),N("y1",r.y1=Z(y+a)));t.attr("d",_(e,r)),$(l,r)}function J(n,a){if(F){var i=function(e){return e},o=i,s=i;R?N("xanchor",r.xanchor=G(x+n)):(o=function(e){return G(U(e)+n)},H&&"date"===H.type&&(o=g.encodeDate(o))),E?N("yanchor",r.yanchor=Z(T+a)):(s=function(e){return Z(q(e)+a)},j&&"date"===j.type&&(s=g.encodeDate(s))),N("path",r.path=w(P,o,s))}else if(I){if("resize-over-start-point"===z){var u=c+n,d=E?f-a:f+a;N("x0",r.x0=R?u:G(u)),N("y0",r.y0=E?d:Z(d))}else if("resize-over-end-point"===z){var p=v+n,h=E?y-a:y+a;N("x1",r.x1=R?p:G(p)),N("y1",r.y1=E?h:Z(h))}}else{var m=function(e){return-1!==z.indexOf(e)},b=m("n"),B=m("s"),V=m("w"),Y=m("e"),X=b?k+a:k,W=B?M+a:M,Q=V?A+n:A,J=Y?L+n:L;E&&(b&&(X=k-a),B&&(W=M-a)),(!E&&W-X>10||E&&X-W>10)&&(N(S,r[S]=E?X:Z(X)),N(C,r[C]=E?W:Z(W))),J-Q>10&&(N(O,r[O]=R?Q:G(Q)),N(D,r[D]=R?J:G(J)))}t.attr("d",_(e,r)),$(l,r)}function $(e,t){(R||E)&&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=U(R?t.xanchor:a.midRange(r?[t.x0,t.x1]:g.extractPathCoords(t.path,h.paramIsX))),o=q(E?t.yanchor:a.midRange(r?[t.y0,t.y1]:g.extractPathCoords(t.path,h.paramIsY)));if(i=g.roundPositionForSharpStrokeRendering(i,1),o=g.roundPositionForSharpStrokeRendering(o,1),R&&E){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(R){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()}d.init(X),Y.node().onmousemove=W}(e,R,s,t,r,z):!0===s.editable&&R.style("pointer-events",D||c.opacity(L)*A<=.5?"stroke":"all");R.node().addEventListener("click",(function(){return function(e,t){if(!y(e))return;var r=+t.node().getAttribute("data-index");if(r>=0){if(r===e._fullLayout._activeShapeIndex)return void T(e);e._fullLayout._activeShapeIndex=r,e._fullLayout._deactivateShape=T,v(e)}}(e,R)}))}}function b(e,t,r){var n=(r.xref+r.yref).replace(/paper/g,"").replace(/[xyz][1-9]* *domain/g,"");u.setClipUrl(e,n?"clip"+t._fullLayout._uid+n:null,t)}function _(e,t){var r,n,o,l,s,c,u,f,d=t.type,p=i.getRefType(t.xref),v=i.getRefType(t.yref),m=i.getFromId(e,t.xref),y=i.getFromId(e,t.yref),x=e._fullLayout._size;if(m?"domain"===p?n=function(e){return m._offset+m._length*e}:(r=g.shapePositionToRange(m),n=function(e){return m._offset+m.r2p(r(e,!0))}):n=function(e){return x.l+x.w*e},y?"domain"===v?l=function(e){return y._offset+y._length*(1-e)}:(o=g.shapePositionToRange(y),l=function(e){return y._offset+y.r2p(o(e,!0))}):l=function(e){return x.t+x.h*(1-e)},"path"===d)return m&&"date"===m.type&&(n=g.decodeDate(n)),y&&"date"===y.type&&(l=g.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(h.segmentRE,(function(e){var n=0,c=e.charAt(0),u=h.paramIsX[c],f=h.paramIsY[c],d=h.numParams[c],p=e.substr(1).replace(h.paramRE,(function(e){return u[n]?e="pixel"===i?t(l)+Number(e):t(e):f[n]&&(e="pixel"===o?r(s)-Number(e):r(e)),++n>d&&(e="X"),e}));return n>d&&(p=p.replace(/[\s,]*X.*/,""),a.log("Ignoring extra params in segment "+e)),c+p}))}(t,n,l);if("pixel"===t.xsizemode){var b=n(t.xanchor);s=b+t.x0,c=b+t.x1}else s=n(t.x0),c=n(t.x1);if("pixel"===t.ysizemode){var _=l(t.yanchor);u=_-t.y0,f=_-t.y1}else u=l(t.y0),f=l(t.y1);if("line"===d)return"M"+s+","+u+"L"+c+","+f;if("rect"===d)return"M"+s+","+u+"H"+c+"V"+f+"H"+s+"Z";var w=(s+c)/2,T=(u+f)/2,k=Math.abs(w-s),M=Math.abs(T-u),A="A"+k+","+M,L=w+k+","+T;return"M"+L+A+" 0 1,1 "+(w+","+(T-M))+A+" 0 0,1 "+L+"Z"}function w(e,t,r){return e.replace(h.segmentRE,(function(e){var n=0,a=e.charAt(0),i=h.paramIsX[a],o=h.paramIsY[a],l=h.numParams[a];return a+e.substr(1).replace(h.paramRE,(function(e){return n>=l||(i[n]?e=t(e):o[n]&&(e=r(e)),n++),e}))}))}function T(e){y(e)&&(e._fullLayout._activeShapeIndex>=0&&(s(e),delete e._fullLayout._activeShapeIndex,v(e)))}t.exports={draw:v,drawOne:x,eraseActiveShape:function(e){if(!y(e))return;s(e);var t=e._fullLayout._activeShapeIndex,r=(e.layout||{}).shapes||[];if(t<r.length){for(var a=[],i=0;i<r.length;i++)i!==t&&a.push(r[i]);delete e._fullLayout._activeShapeIndex,n.call("_guiRelayout",e,{shapes:a})}}}},{"../../lib":210,"../../lib/setcursor":230,"../../plot_api/plot_template":245,"../../plots/cartesian/axes":256,"../../plots/cartesian/handle_outline":266,"../../registry":298,"../color":82,"../dragelement":101,"../drawing":104,"./constants":161,"./draw_newshape/display_outlines":167,"./draw_newshape/helpers":168,"./helpers":170}],164:[function(e,t,r){"use strict";var n=e("../../drawing/attributes").dash,a=e("../../../lib/extend").extendFlat;t.exports={newshape:{line:{color:{valType:"color",editType:"none"},width:{valType:"number",min:0,dflt:4,editType:"none"},dash:a({},n,{dflt:"solid",editType:"none"}),editType:"none"},fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"none"},fillrule:{valType:"enumerated",values:["evenodd","nonzero"],dflt:"evenodd",editType:"none"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"none"},layer:{valType:"enumerated",values:["below","above"],dflt:"above",editType:"none"},drawdirection:{valType:"enumerated",values:["ortho","horizontal","vertical","diagonal"],dflt:"diagonal",editType:"none"},editType:"none"},activeshape:{fillcolor:{valType:"color",dflt:"rgb(255,0,255)",editType:"none"},opacity:{valType:"number",min:0,max:1,dflt:.5,editType:"none"},editType:"none"}}},{"../../../lib/extend":204,"../../drawing/attributes":103}],165:[function(e,t,r){"use strict";t.exports={CIRCLE_SIDES:32,i000:0,i090:8,i180:16,i270:24,cos45:Math.cos(Math.PI/4),sin45:Math.sin(Math.PI/4),SQRT2:Math.sqrt(2)}},{}],166:[function(e,t,r){"use strict";var n=e("../../color");t.exports=function(e,t,r){if(r("newshape.drawdirection"),r("newshape.layer"),r("newshape.fillcolor"),r("newshape.fillrule"),r("newshape.opacity"),r("newshape.line.width")){var a=(e||{}).plot_bgcolor||"#FFF";r("newshape.line.color",n.contrast(a)),r("newshape.line.dash")}r("activeshape.fillcolor"),r("activeshape.opacity")}},{"../../color":82}],167:[function(e,t,r){"use strict";var n=e("../../dragelement"),a=e("../../dragelement/helpers").drawMode,i=e("../../../registry"),o=e("./constants"),l=o.i000,s=o.i090,c=o.i180,u=o.i270,f=e("../../../plots/cartesian/handle_outline").clearOutlineControllers,d=e("./helpers"),p=d.pointsShapeRectangle,h=d.pointsShapeEllipse,g=d.writePaths,v=e("./newshapes");t.exports=function e(t,r,o,d){d||(d=0);var m=o.gd;function y(){e(t,r,o,d++),h(t[0])&&x({redrawing:!0})}function x(e){o.isActiveShape=!1;var t=v(r,o);Object.keys(t).length&&i.call((e||{}).redrawing?"relayout":"_guiRelayout",m,t)}var b,_,w,T,k,M=o.isActiveShape,A=m._fullLayout._zoomlayer,L=o.dragmode;(a(L)?m._fullLayout._drawing=!0:m._fullLayout._activeShapeIndex>=0&&f(m),r.attr("d",g(t)),M&&!d)&&(k=function(e,t){for(var r=0;r<t.length;r++){var n=t[r];e[r]=[];for(var a=0;a<n.length;a++){e[r][a]=[];for(var i=0;i<n[a].length;i++)e[r][a][i]=n[a][i]}}return e}([],t),function(e){b=[];for(var r=0;r<t.length;r++){var a=t[r],i=!p(a)&&h(a);b[r]=[];for(var o=0;o<a.length;o++)if("Z"!==a[o][0]&&(!i||o===l||o===s||o===c||o===u)){var f=a[o][1],d=a[o][2],g=e.append("circle").classed("cursor-grab",!0).attr("data-i",r).attr("data-j",o).attr("cx",f).attr("cy",d).attr("r",4).style({"mix-blend-mode":"luminosity",fill:"black",stroke:"white","stroke-width":1});b[r][o]={element:g.node(),gd:m,prepFn:S,doneFn:O,clickFn:D},n.init(b[r][o])}}}(A.append("g").attr("class","outline-controllers")),function(){if(_=[],!t.length)return;_[0]={element:r[0][0],gd:m,prepFn:z,doneFn:R},n.init(_[0])}());function S(e){w=+e.srcElement.getAttribute("data-i"),T=+e.srcElement.getAttribute("data-j"),b[w][T].moveFn=C}function C(e,r){if(t.length){var n=k[w][T][1],a=k[w][T][2],i=t[w],o=i.length;if(p(i)){for(var l=0;l<o;l++)if(l!==T){var s=i[l];s[1]===i[T][1]&&(s[1]=n+e),s[2]===i[T][2]&&(s[2]=a+r)}if(i[T][1]=n+e,i[T][2]=a+r,!p(i))for(var c=0;c<o;c++)for(var u=0;u<i[c].length;u++)i[c][u]=k[w][c][u]}else i[T][1]=n+e,i[T][2]=a+r;y()}}function O(){x()}function D(e,r){if(2===e){w=+r.srcElement.getAttribute("data-i"),T=+r.srcElement.getAttribute("data-j");var n=t[w];p(n)||h(n)||function(){if(t.length&&t[w]&&t[w].length){for(var e=[],r=0;r<t[w].length;r++)r!==T&&e.push(t[w][r]);e.length>1&&(2!==e.length||"Z"!==e[1][0])&&(0===T&&(e[0][0]="M"),t[w]=e,y(),x())}}()}}function P(e,r){!function(e,r){if(t.length)for(var n=0;n<t.length;n++)for(var a=0;a<t[n].length;a++)for(var i=0;i+2<t[n][a].length;i+=2)t[n][a][i+1]=k[n][a][i+1]+e,t[n][a][i+2]=k[n][a][i+2]+r}(e,r),y()}function z(e){(w=+e.srcElement.getAttribute("data-i"))||(w=0),_[w].moveFn=P}function R(){x()}}},{"../../../plots/cartesian/handle_outline":266,"../../../registry":298,"../../dragelement":101,"../../dragelement/helpers":100,"./constants":165,"./helpers":168,"./newshapes":169}],168:[function(e,t,r){"use strict";var n=e("parse-svg-path"),a=e("./constants"),i=a.CIRCLE_SIDES,o=a.SQRT2,l=e("../../../plots/cartesian/helpers"),s=l.p2r,c=l.r2p,u=[0,3,4,5,6,1,2],f=[0,3,4,1,2];function d(e,t){return Math.abs(e-t)<=1e-6}function p(e,t){var r=t[1]-e[1],n=t[2]-e[2];return Math.sqrt(r*r+n*n)}r.writePaths=function(e){var t=e.length;if(!t)return"M0,0Z";for(var r="",n=0;n<t;n++)for(var a=e[n].length,i=0;i<a;i++){var o=e[n][i][0];if("Z"===o)r+="Z";else for(var l=e[n][i].length,s=0;s<l;s++){var c=s;"Q"===o||"S"===o?c=f[s]:"C"===o&&(c=u[s]),r+=e[n][i][c],s>0&&s<l-1&&(r+=",")}}return r},r.readPaths=function(e,t,r,a){var o,l,u,f=n(e),d=[],p=-1,h=0,g=0,v=function(){l=h,u=g};v();for(var m=0;m<f.length;m++){var y,x,b,_,w=[],T=f[m][0],k=T;switch(T){case"M":p++,d[p]=[],h=+f[m][1],g=+f[m][2],w.push([k,h,g]),v();break;case"Q":case"S":y=+f[m][1],b=+f[m][2],h=+f[m][3],g=+f[m][4],w.push([k,h,g,y,b]);break;case"C":y=+f[m][1],b=+f[m][2],x=+f[m][3],_=+f[m][4],h=+f[m][5],g=+f[m][6],w.push([k,h,g,y,b,x,_]);break;case"T":case"L":h=+f[m][1],g=+f[m][2],w.push([k,h,g]);break;case"H":k="L",h=+f[m][1],w.push([k,h,g]);break;case"V":k="L",g=+f[m][1],w.push([k,h,g]);break;case"A":k="L";var M=+f[m][1],A=+f[m][2];+f[m][4]||(M=-M,A=-A);var L=h-M,S=g;for(o=1;o<=i/2;o++){var C=2*Math.PI*o/i;w.push([k,L+M*Math.cos(C),S+A*Math.sin(C)])}break;case"Z":h===l&&g===u||(h=l,g=u,w.push([k,h,g]))}for(var O=(r||{}).domain,D=t._fullLayout._size,P=r&&"pixel"===r.xsizemode,z=r&&"pixel"===r.ysizemode,R=!1===a,E=0;E<w.length;E++){for(o=0;o+2<7;o+=2){var I=w[E][o+1],F=w[E][o+2];void 0!==I&&void 0!==F&&(h=I,g=F,r&&(r.xaxis&&r.xaxis.p2r?(R&&(I-=r.xaxis._offset),I=P?c(r.xaxis,r.xanchor)+I:s(r.xaxis,I)):(R&&(I-=D.l),O?I=O.x[0]+I/D.w:I/=D.w),r.yaxis&&r.yaxis.p2r?(R&&(F-=r.yaxis._offset),F=z?c(r.yaxis,r.yanchor)-F:s(r.yaxis,F)):(R&&(F-=D.t),F=O?O.y[1]-F/D.h:1-F/D.h)),w[E][o+1]=I,w[E][o+2]=F)}d[p].push(w[E].slice())}}return d},r.pointsShapeRectangle=function(e){if(5!==e.length)return!1;for(var t=1;t<3;t++){if(!d(e[0][t]-e[1][t],e[3][t]-e[2][t]))return!1;if(!d(e[0][t]-e[3][t],e[1][t]-e[2][t]))return!1}return!(!d(e[0][1],e[1][1])&&!d(e[0][1],e[3][1]))&&!!(p(e[0],e[1])*p(e[0],e[3]))},r.pointsShapeEllipse=function(e){var t=e.length;if(t!==i+1)return!1;t=i;for(var r=0;r<t;r++){var n=(2*t-r)%t,a=(t/2+n)%t,o=(t/2+r)%t;if(!d(p(e[r],e[o]),p(e[n],e[a])))return!1}return!0},r.handleEllipse=function(e,t,n){if(!e)return[t,n];var a=r.ellipseOver({x0:t[0],y0:t[1],x1:n[0],y1:n[1]}),l=(a.x1+a.x0)/2,s=(a.y1+a.y0)/2,c=(a.x1-a.x0)/2,u=(a.y1-a.y0)/2;c||(c=u/=o),u||(u=c/=o);for(var f=[],d=0;d<i;d++){var p=2*d*Math.PI/i;f.push([l+c*Math.cos(p),s+u*Math.sin(p)])}return f},r.ellipseOver=function(e){var t=e.x0,r=e.y0,n=e.x1,a=e.y1,i=n-t,l=a-r,s=((t-=i)+n)/2,c=((r-=l)+a)/2;return{x0:s-(i*=o),y0:c-(l*=o),x1:s+i,y1:c+l}}},{"../../../plots/cartesian/helpers":267,"./constants":165,"parse-svg-path":55}],169:[function(e,t,r){"use strict";var n=e("../../dragelement/helpers"),a=n.drawMode,i=n.openMode,o=e("./constants"),l=o.i000,s=o.i090,c=o.i180,u=o.i270,f=o.cos45,d=o.sin45,p=e("../../../plots/cartesian/helpers"),h=p.p2r,g=p.r2p,v=e("../../../plots/cartesian/handle_outline").clearSelect,m=e("./helpers"),y=m.readPaths,x=m.writePaths,b=m.ellipseOver;t.exports=function(e,t){if(e.length){var r=e[0][0];if(r){var n=r.getAttribute("d"),o=t.gd,p=o._fullLayout.newshape,m=t.plotinfo,_=m.xaxis,w=m.yaxis,T=!!m.domain||!m.xaxis,k=!!m.domain||!m.yaxis,M=t.isActiveShape,A=t.dragmode,L=(o.layout||{}).shapes||[];if(!a(A)&&void 0!==M){var S=o._fullLayout._activeShapeIndex;if(S<L.length)switch(o._fullLayout.shapes[S].type){case"rect":A="drawrect";break;case"circle":A="drawcircle";break;case"line":A="drawline";break;case"path":var C=L[S].path||"";A="Z"===C[C.length-1]?"drawclosedpath":"drawopenpath"}}var O,D=i(A),P=y(n,o,m,M),z={editable:!0,xref:T?"paper":_._id,yref:k?"paper":w._id,layer:p.layer,opacity:p.opacity,line:{color:p.line.color,width:p.line.width,dash:p.line.dash}};if(D||(z.fillcolor=p.fillcolor,z.fillrule=p.fillrule),1===P.length&&(O=P[0]),O&&"drawrect"===A)z.type="rect",z.x0=O[0][1],z.y0=O[0][2],z.x1=O[2][1],z.y1=O[2][2];else if(O&&"drawline"===A)z.type="line",z.x0=O[0][1],z.y0=O[0][2],z.x1=O[1][1],z.y1=O[1][2];else if(O&&"drawcircle"===A){z.type="circle";var R=O[l][1],E=O[s][1],I=O[c][1],F=O[u][1],N=O[l][2],H=O[s][2],B=O[c][2],j=O[u][2],V=m.xaxis&&("date"===m.xaxis.type||"log"===m.xaxis.type),U=m.yaxis&&("date"===m.yaxis.type||"log"===m.yaxis.type);V&&(R=g(m.xaxis,R),E=g(m.xaxis,E),I=g(m.xaxis,I),F=g(m.xaxis,F)),U&&(N=g(m.yaxis,N),H=g(m.yaxis,H),B=g(m.yaxis,B),j=g(m.yaxis,j));var q=(E+F)/2,G=(N+B)/2,Z=b({x0:q,y0:G,x1:q+(F-E+I-R)/2*f,y1:G+(j-H+B-N)/2*d});V&&(Z.x0=h(m.xaxis,Z.x0),Z.x1=h(m.xaxis,Z.x1)),U&&(Z.y0=h(m.yaxis,Z.y0),Z.y1=h(m.yaxis,Z.y1)),z.x0=Z.x0,z.y0=Z.y0,z.x1=Z.x1,z.y1=Z.y1}else z.type="path",_&&w&&function(e,t,r){var n="date"===t.type,a="date"===r.type;if(!n&&!a)return e;for(var i=0;i<e.length;i++)for(var o=0;o<e[i].length;o++)for(var l=0;l+2<e[i][o].length;l+=2)n&&(e[i][o][l+1]=e[i][o][l+1].replace(" ","_")),a&&(e[i][o][l+2]=e[i][o][l+2].replace(" ","_"))}(P,_,w),z.path=x(P),O=null;v(o);for(var Y=t.editHelpers,X=(Y||{}).modifyItem,W=[],Q=0;Q<L.length;Q++){var J=o._fullLayout.shapes[Q];if(W[Q]=J._input,void 0!==M&&Q===o._fullLayout._activeShapeIndex){var $=z;switch(J.type){case"line":case"rect":case"circle":X("x0",$.x0),X("x1",$.x1),X("y0",$.y0),X("y1",$.y1);break;case"path":X("path",$.path)}}}return void 0===M?(W.push(z),W):Y?Y.getUpdateObj():{}}}}},{"../../../plots/cartesian/handle_outline":266,"../../../plots/cartesian/helpers":267,"../../dragelement/helpers":100,"./constants":165,"./helpers":168}],170:[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,a){var i,o=e._fullLayout._size;if(t)if("domain"===a)i=function(e){return t._length*(n?1-e:e)+t._offset};else{var l=r.shapePositionToRange(t);i=function(e){return t._offset+t.r2p(l(e,!0))},"date"===t.type&&(i=r.decodeDate(i))}else i=n?function(e){return o.t+o.h*(1-e)}:function(e){return o.l+o.w*e};return i},r.getPixelToData=function(e,t,n,a){var i,o=e._fullLayout._size;if(t)if("domain"===a)i=function(e){var r=(e-t._offset)/t._length;return n?1-r:r};else{var l=r.rangeToShapePosition(t);i=function(e){return l(t.p2r(e-t._offset))}}else i=n?function(e){return 1-(e-o.t)/o.h}:function(e){return(e-o.l)/o.w};return i},r.roundPositionForSharpStrokeRendering=function(e,t){var r=1===Math.round(t%2),n=Math.round(e);return r?n+.5:n},r.makeOptionsAndPlotinfo=function(e,t){var r=e._fullLayout.shapes[t]||{},n=e._fullLayout._plots[r.xref+r.yref];return!!n?n._hadPlotinfo=!0:(n={},r.xref&&"paper"!==r.xref&&(n.xaxis=e._fullLayout[r.xref+"axis"]),r.yref&&"paper"!==r.yref&&(n.yaxis=e._fullLayout[r.yref+"axis"])),n.xsizemode=r.xsizemode,n.ysizemode=r.ysizemode,n.xanchor=r.xanchor,n.yanchor=r.yanchor,{options:r,plotinfo:n}}},{"../../lib":210,"./constants":161}],171:[function(e,t,r){"use strict";var n=e("./draw");t.exports={moduleType:"component",name:"shapes",layoutAttributes:e("./attributes"),supplyLayoutDefaults:e("./defaults"),supplyDrawNewShapeDefaults:e("./draw_newshape/defaults"),includeBasePlot:e("../../plots/cartesian/include_components")("shapes"),calcAutorange:e("./calc_autorange"),draw:n.draw,drawOne:n.drawOne}},{"../../plots/cartesian/include_components":268,"./attributes":159,"./calc_autorange":160,"./defaults":162,"./draw":163,"./draw_newshape/defaults":166}],172:[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":204,"../../plot_api/edit_types":238,"../../plot_api/plot_template":245,"../../plots/animation_attributes":250,"../../plots/font_attributes":284,"../../plots/pad_attributes":289,"./constants":173}],173:[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}},{}],174:[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)}if("skip"===e.method||Array.isArray(e.args)?r("visible"):t.visible=!1){r("method"),r("args");var a=r("label","step-"+t._index);r("value",a),r("execute")}}t.exports=function(e,t){a(e,t,{name:o,handleItemDefaults:s})}},{"../../lib":210,"../../plots/array_container_defaults":251,"./attributes":172,"./constants":173}],175:[function(e,t,r){"use strict";var n=e("d3"),a=e("../../plots/plots"),i=e("../color"),o=e("../drawing"),l=e("../../lib"),s=l.strTranslate,c=e("../../lib/svg_text_utils"),u=e("../../plot_api/plot_template").arrayEditor,f=e("./constants"),d=e("../../constants/alignment"),p=d.LINE_SPACING,h=d.FROM_TL,g=d.FROM_BR;function v(e){return f.autoMarginIdRoot+e._index}function m(e){return e._index}function y(e,t){var r=o.tester.selectAll("g."+f.labelGroupClass).data(t._visibleSteps);r.enter().append("g").classed(f.labelGroupClass,!0);var i=0,s=0;r.each((function(e){var r=_(n.select(this),{step:e},t).node();if(r){var a=o.bBox(r);s=Math.max(s,a.height),i=Math.max(i,a.width)}})),r.remove();var u=t._dims={};u.inputAreaWidth=Math.max(f.railWidth,f.gripHeight);var d=e._fullLayout._size;u.lx=d.l+d.w*t.x,u.ly=d.t+d.h*(1-t.y),"fraction"===t.lenmode?u.outerLength=Math.round(d.w*t.len):u.outerLength=t.len,u.inputAreaStart=0,u.inputAreaLength=Math.round(u.outerLength-t.pad.l-t.pad.r);var p=(u.inputAreaLength-2*f.stepInset)/(t._stepCount-1),m=i+f.labelPadding;if(u.labelStride=Math.max(1,Math.ceil(m/p)),u.labelHeight=s,u.currentValueMaxWidth=0,u.currentValueHeight=0,u.currentValueTotalHeight=0,u.currentValueMaxLines=1,t.currentvalue.visible){var y=o.tester.append("g");r.each((function(e){var r=x(y,t,e.label),n=r.node()&&o.bBox(r.node())||{width:0,height:0},a=c.lineCount(r);u.currentValueMaxWidth=Math.max(u.currentValueMaxWidth,Math.ceil(n.width)),u.currentValueHeight=Math.max(u.currentValueHeight,Math.ceil(n.height)),u.currentValueMaxLines=Math.max(u.currentValueMaxLines,a)})),u.currentValueTotalHeight=u.currentValueHeight+t.currentvalue.offset,y.remove()}u.height=u.currentValueTotalHeight+f.tickOffset+t.ticklen+f.labelOffset+u.labelHeight+t.pad.t+t.pad.b;var b="left";l.isRightAnchor(t)&&(u.lx-=u.outerLength,b="right"),l.isCenterAnchor(t)&&(u.lx-=u.outerLength/2,b="center");var w="top";l.isBottomAnchor(t)&&(u.ly-=u.height,w="bottom"),l.isMiddleAnchor(t)&&(u.ly-=u.height/2,w="middle"),u.outerLength=Math.ceil(u.outerLength),u.height=Math.ceil(u.height),u.lx=Math.round(u.lx),u.ly=Math.round(u.ly);var T={y:t.y,b:u.height*g[w],t:u.height*h[w]};"fraction"===t.lenmode?(T.l=0,T.xl=t.x-t.len*h[b],T.r=0,T.xr=t.x+t.len*g[b]):(T.x=t.x,T.l=u.outerLength*h[b],T.r=u.outerLength*g[b]),a.autoMargin(e,v(t),T)}function x(e,t,r){if(t.currentvalue.visible){var n,a,i=t._dims;switch(t.currentvalue.xanchor){case"right":n=i.inputAreaLength-f.currentValueInset-i.currentValueMaxWidth,a="left";break;case"center":n=.5*i.inputAreaLength,a="middle";break;default:n=f.currentValueInset,a="left"}var s=l.ensureSingle(e,"text",f.labelClass,(function(e){e.attr({"text-anchor":a,"data-notex":1})})),u=t.currentvalue.prefix?t.currentvalue.prefix:"";if("string"==typeof r)u+=r;else{var d=t.steps[t.active].label,h=t._gd._fullLayout._meta;h&&(d=l.templateString(d,h)),u+=d}t.currentvalue.suffix&&(u+=t.currentvalue.suffix),s.call(o.font,t.currentvalue.font).text(u).call(c.convertToTspans,t._gd);var g=c.lineCount(s),v=(i.currentValueMaxLines+1-g)*t.currentvalue.font.size*p;return c.positionText(s,n,v),s}}function b(e,t,r){l.ensureSingle(e,"rect",f.gripRectClass,(function(n){n.call(M,t,e,r).style("pointer-events","all")})).attr({width:f.gripWidth,height:f.gripHeight,rx:f.gripRadius,ry:f.gripRadius}).call(i.stroke,r.bordercolor).call(i.fill,r.bgcolor).style("stroke-width",r.borderwidth+"px")}function _(e,t,r){var n=l.ensureSingle(e,"text",f.labelClass,(function(e){e.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(c.convertToTspans,r._gd),n}function w(e,t){var r=l.ensureSingle(e,"g",f.labelsClass),a=t._dims,i=r.selectAll("g."+f.labelGroupClass).data(a.labelSteps);i.enter().append("g").classed(f.labelGroupClass,!0),i.exit().remove(),i.each((function(e){var r=n.select(this);r.call(_,e,t),o.setTranslate(r,S(t,e.fraction),f.tickOffset+t.ticklen+t.font.size*p+f.labelOffset+a.currentValueTotalHeight)}))}function T(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,u(e.layout,f.name,r).applyUpdate("active",n);var s=r.steps[r.active];t.call(L,r,o),t.call(x,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 M(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("."+f.gripRectClass);n.event.stopPropagation(),n.event.preventDefault(),s.call(i.fill,e.activebgcolor);var c=C(e,n.mouse(a)[0]);T(t,r,e,c,!0),e._dragging=!0,o.on("mousemove",(function(){var e=l(),i=C(e,n.mouse(a)[0]);T(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 A(e,t){var r=e.selectAll("rect."+f.tickRectClass).data(t._visibleSteps),a=t._dims;r.enter().append("rect").classed(f.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,S(t,r/(t._stepCount-1))-.5*t.tickwidth,(l?f.tickOffset:f.minorTickOffset)+a.currentValueTotalHeight)}))}function L(e,t,r){for(var n=e.select("rect."+f.gripRectClass),a=0,i=0;i<t._stepCount;i++)if(t._visibleSteps[i]._index===t.active){a=i;break}var o=S(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",s(o-.5*f.gripWidth,t._dims.currentValueTotalHeight))}}function S(e,t){var r=e._dims;return r.inputAreaStart+f.stepInset+(r.inputAreaLength-2*f.stepInset)*Math.min(1,Math.max(0,t))}function C(e,t){var r=e._dims;return Math.min(1,Math.max(0,(t-f.stepInset-r.inputAreaStart)/(r.inputAreaLength-2*f.stepInset-2*r.inputAreaStart)))}function O(e,t,r){var n=r._dims,a=l.ensureSingle(e,"rect",f.railTouchRectClass,(function(n){n.call(M,t,e,r).style("pointer-events","all")}));a.attr({width:n.inputAreaLength,height:Math.max(n.inputAreaWidth,f.tickOffset+r.ticklen+n.labelHeight)}).call(i.fill,r.bgcolor).attr("opacity",0),o.setTranslate(a,0,n.currentValueTotalHeight)}function D(e,t){var r=t._dims,n=r.inputAreaLength-2*f.railInset,a=l.ensureSingle(e,"rect",f.railRectClass);a.attr({width:n,height:f.railWidth,rx:f.railRadius,ry:f.railRadius,"shape-rendering":"crispEdges"}).call(i.stroke,t.bordercolor).call(i.fill,t.bgcolor).style("stroke-width",t.borderwidth+"px"),o.setTranslate(a,f.railInset,.5*(r.inputAreaWidth-f.railWidth)+r.currentValueTotalHeight)}t.exports=function(e){var t=e._fullLayout,r=function(e,t){for(var r=e[f.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."+f.containerClassName).data(r.length>0?[0]:[]);function l(t){t._commandObserver&&(t._commandObserver.remove(),delete t._commandObserver),a.autoMargin(e,v(t))}if(i.enter().append("g").classed(f.containerClassName,!0).style("cursor","ew-resize"),i.exit().each((function(){n.select(this).selectAll("g."+f.groupClassName).each(l)})).remove(),0!==r.length){var s=i.selectAll("g."+f.groupClassName).data(r,m);s.enter().append("g").classed(f.groupClassName,!0),s.exit().each(l).remove();for(var c=0;c<r.length;c++){var u=r[c];y(e,u)}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(x,r).call(D,r).call(w,r).call(A,r).call(O,e,r).call(b,e,r);var n=r._dims;o.setTranslate(t,n.lx+r.pad.l,n.ly+r.pad.t),t.call(L,r,!1),t.call(x,r)}(e,n.select(this),t)}))}}},{"../../constants/alignment":184,"../../lib":210,"../../lib/svg_text_utils":232,"../../plot_api/plot_template":245,"../../plots/plots":290,"../color":82,"../drawing":104,"./constants":173,d3:16}],176:[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":172,"./constants":173,"./defaults":174,"./draw":175}],177:[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=l.strTranslate,c=e("../drawing"),u=e("../color"),f=e("../../lib/svg_text_utils"),d=e("../../constants/interactions"),p=e("../../constants/alignment").OPPOSITE_SIDE,h=/ [XY][0-9]* /;t.exports={draw:function(e,t,r){var g,v=r.propContainer,m=r.propName,y=r.placeholder,x=r.traceIndex,b=r.avoid||{},_=r.attributes,w=r.transform,T=r.containerGroup,k=e._fullLayout,M=1,A=!1,L=v.title,S=(L&&L.text?L.text:"").trim(),C=L&&L.font?L.font:{},O=C.family,D=C.size,P=C.color;"title.text"===m?g="titleText":-1!==m.indexOf("axis")?g="axisTitleText":m.indexOf(!0)&&(g="colorbarTitleText");var z=e._context.edits[g];""===S?M=0:S.replace(h," % ")===y.replace(h," % ")&&(M=.2,A=!0,z||(S="")),r._meta?S=l.templateString(S,r._meta):k._meta&&(S=l.templateString(S,k._meta));var R=S||z;T||(T=l.ensureSingle(k._infolayer,"g","g-"+t));var E=T.selectAll("text").data(R?[0]:[]);if(E.enter().append("text"),E.text(S).attr("class",t),E.exit().remove(),!R)return T;function I(e){l.syncOrAsync([F,N],e)}function F(t){var r;return w?(r="",w.rotate&&(r+="rotate("+[w.rotate,_.x,_.y]+")"),w.offset&&(r+=s(0,w.offset))):r=null,t.attr("transform",r),t.style({"font-family":O,"font-size":n.round(D,2)+"px",fill:u.rgb(P),opacity:M*u.opacity(P),"font-weight":i.fontWeight}).attr(_).call(f.convertToTspans,e),i.previousPromises(e)}function N(e){var t=n.select(e.node().parentNode);if(b&&b.selection&&b.side&&S){t.attr("transform",null);var r=p[b.side],i="left"===b.side||"top"===b.side?-1:1,o=a(b.pad)?b.pad:2,u=c.bBox(t.node()),f={left:0,top:0,right:k.width,bottom:k.height},d=b.maxShift||i*(f[b.side]-u[b.side]),h=0;if(d<0)h=d;else{var g=b.offsetLeft||0,v=b.offsetTop||0;u.left-=g,u.right-=g,u.top-=v,u.bottom-=v,b.selection.each((function(){var e=c.bBox(this);l.bBoxIntersect(u,e,o)&&(h=Math.max(h,i*(e[b.side]-u[r])+o))})),h=Math.min(d,h)}if(h>0||d<0){var m={left:[-h,0],right:[h,0],top:[0,-h],bottom:[0,h]}[b.side];t.attr("transform",s(m[0],m[1]))}}}return E.call(I),z&&(S?E.on(".opacity",null):(M=0,A=!0,E.text(y).on("mouseover.opacity",(function(){n.select(this).transition().duration(d.SHOW_PLACEHOLDER).style("opacity",1)})).on("mouseout.opacity",(function(){n.select(this).transition().duration(d.HIDE_PLACEHOLDER).style("opacity",0)}))),E.call(f.makeEditable,{gd:e}).on("edit",(function(t){void 0!==x?o.call("_guiRestyle",e,m,t,x):o.call("_guiRelayout",e,m,t)})).on("cancel",(function(){this.text(this.attr("data-unformatted")).call(I)})).on("input",(function(e){this.text(e||" ").call(f.positionText,_.x,_.y)}))),E.classed("js-placeholder",A),T}}},{"../../constants/alignment":184,"../../constants/interactions":188,"../../lib":210,"../../lib/svg_text_utils":232,"../../plots/plots":290,"../../registry":298,"../color":82,"../drawing":104,d3:16,"fast-isnumeric":18}],178:[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":204,"../../plot_api/edit_types":238,"../../plot_api/plot_template":245,"../../plots/font_attributes":284,"../../plots/pad_attributes":289,"../color/attributes":81}],179:[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:"\u25c4",right:"\u25ba",up:"\u25b2",down:"\u25bc"}}},{}],180:[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":210,"../../plots/array_container_defaults":251,"./attributes":178,"./constants":179}],181:[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.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(T,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},k={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(T,o),u.call(_,o)}))})),u.call(_,o),x?(k.w=Math.max(m.openWidth,m.headerWidth),k.h=b.y-k.t):(k.w=b.x-k.l,k.h=Math.max(m.openHeight,m.headerHeight)),k.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,k):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.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 T(e,t){e.select("rect."+f.itemRectClassName).call(i.fill,t.bgcolor)}function k(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];k(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":184,"../../lib":210,"../../lib/svg_text_utils":232,"../../plot_api/plot_template":245,"../../plots/plots":290,"../color":82,"../drawing":104,"./constants":179,"./scrollbox":183,d3:16}],182:[function(e,t,r){arguments[4][176][0].apply(r,arguments)},{"./attributes":178,"./constants":179,"./defaults":180,"./draw":181,dup:176}],183:[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,T=m;x||b||"right"===y||_||(this.position.direction="down",x=!0),x||_?(f=(u=h)+w,x?(d=v,T=(p=Math.min(d+T,c))-d):T=(p=v+T)-(d=Math.max(p-T,0))):(p=(d=v)+T,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:T};var k=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(k?[0]:[]);C.exit().on(".drag",null).remove(),C.enter().append("rect").classed("scrollbar-horizontal",!0).call(a.fill,l.barColor),k?(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>T,D=l.barWidth+2*l.barPad,P=l.barLength+2*l.barPad,z=h+g,R=v;z+D>s&&(z=s-D);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:D,height:P}),this._vbarYMin=R+P/2,this._vbarTranslateMax=T-P):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var I=this.id,F=u-.5,N=O?f+D+.5:f+.5,H=d-.5,B=k?p+A+.5:p+.5,j=o._topdefs.selectAll("#"+I).data(k||O?[0]:[]);if(j.exit().remove(),j.enter().append("clipPath").attr("id",I).append("rect"),k||O?(this._clipRect=j.select("rect").attr({x:Math.floor(F),y:Math.floor(H),width:Math.ceil(N)-Math.floor(F),height:Math.ceil(B)-Math.floor(H)}),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),k||O){var V=n.behavior.drag().on("dragstart",(function(){n.event.sourceEvent.preventDefault()})).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(V);var U=n.behavior.drag().on("dragstart",(function(){n.event.sourceEvent.preventDefault(),n.event.sourceEvent.stopPropagation()})).on("drag",this._onBarDrag.bind(this));k&&this.hbar.on(".drag",null).call(U),O&&this.vbar.on(".drag",null).call(U)}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":210,"../color":82,"../drawing":104,d3:16}],184:[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"}}},{}],185:[function(e,t,r){"use strict";t.exports={axisRefDescription:function(e,t,r){return["If set to a",e,"axis id (e.g. *"+e+"* or","*"+e+"2*), the `"+e+"` position refers to a",e,"coordinate. If set to *paper*, the `"+e+"`","position refers to the distance from the",t,"of the plotting","area in normalized coordinates where *0* (*1*) corresponds to the",t,"("+r+"). If set to a",e,"axis ID followed by","*domain* (separated by a space), the position behaves like for","*paper*, but refers to the distance in fractions of the domain","length from the",t,"of the domain of that axis: e.g.,","*"+e+"2 domain* refers to the domain of the second",e," axis and a",e,"position of 0.5 refers to the","point between the",t,"and the",r,"of the domain of the","second",e,"axis."].join(" ")}}},{}],186:[function(e,t,r){"use strict";t.exports={INCREASING:{COLOR:"#3D9970",SYMBOL:"\u25b2"},DECREASING:{COLOR:"#FF4136",SYMBOL:"\u25bc"}}},{}],187:[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-time-format#locale_format"}},{}],188:[function(e,t,r){"use strict";t.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DESELECTDIM:.2}},{}],189:[function(e,t,r){"use strict";t.exports={BADNUM:void 0,FP_SAFE:Number.MAX_VALUE/1e4,ONEMAXYEAR:316224e5,ONEAVGYEAR:315576e5,ONEMINYEAR:31536e6,ONEMAXQUARTER:79488e5,ONEAVGQUARTER:78894e5,ONEMINQUARTER:76896e5,ONEMAXMONTH:26784e5,ONEAVGMONTH:26298e5,ONEMINMONTH:24192e5,ONEWEEK:6048e5,ONEDAY:864e5,ONEHOUR:36e5,ONEMIN:6e4,ONESEC:1e3,EPOCHJD:2440587.5,ALMOST_EQUAL:.999999,LOG_CLIP:10,MINUS_SIGN:"\u2212"}},{}],190:[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}},{}],191:[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":1,"./components/annotations":75,"./components/annotations3d":80,"./components/colorbar":88,"./components/colorscale":94,"./components/errorbars":110,"./components/fx":122,"./components/grid":126,"./components/images":131,"./components/legend":139,"./components/rangeselector":150,"./components/rangeslider":157,"./components/shapes":171,"./components/sliders":176,"./components/updatemenus":182,"./fonts/mathjax_config":192,"./fonts/ploticon":193,"./lib/queue":225,"./locale-en":236,"./locale-en-us":235,"./plot_api":240,"./plot_api/plot_schema":244,"./plots/plots":290,"./registry":298,"./snapshot":303,"./traces/scatter":411,"./version":439,d3:16,"es6-promise":17}],192:[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()))}},{}],193:[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)"},drawopenpath:{width:70,height:70,path:"M33.21,85.65a7.31,7.31,0,0,1-2.59-.48c-8.16-3.11-9.27-19.8-9.88-41.3-.1-3.58-.19-6.68-.35-9-.15-2.1-.67-3.48-1.43-3.79-2.13-.88-7.91,2.32-12,5.86L3,32.38c1.87-1.64,11.55-9.66,18.27-6.9,2.13.87,4.75,3.14,5.17,9,.17,2.43.26,5.59.36,9.25a224.17,224.17,0,0,0,1.5,23.4c1.54,10.76,4,12.22,4.48,12.4.84.32,2.79-.46,5.76-3.59L43,80.07C41.53,81.57,37.68,85.64,33.21,85.65ZM74.81,69a11.34,11.34,0,0,0,6.09-6.72L87.26,44.5,74.72,32,56.9,38.35c-2.37.86-5.57,3.42-6.61,6L38.65,72.14l8.42,8.43ZM55,46.27a7.91,7.91,0,0,1,3.64-3.17l14.8-5.3,8,8L76.11,60.6l-.06.19a6.37,6.37,0,0,1-3,3.43L48.25,74.59,44.62,71Zm16.57,7.82A6.9,6.9,0,1,0,64.64,61,6.91,6.91,0,0,0,71.54,54.09Zm-4.05,0a2.85,2.85,0,1,1-2.85-2.85A2.86,2.86,0,0,1,67.49,54.09Zm-4.13,5.22L60.5,56.45,44.26,72.7l2.86,2.86ZM97.83,35.67,84.14,22l-8.57,8.57L89.26,44.24Zm-13.69-8,8,8-2.85,2.85-8-8Z",transform:"matrix(1 0 0 1 -15 -15)"},drawclosedpath:{width:90,height:90,path:"M88.41,21.12a26.56,26.56,0,0,0-36.18,0l-2.07,2-2.07-2a26.57,26.57,0,0,0-36.18,0,23.74,23.74,0,0,0,0,34.8L48,90.12a3.22,3.22,0,0,0,4.42,0l36-34.21a23.73,23.73,0,0,0,0-34.79ZM84,51.24,50.16,83.35,16.35,51.25a17.28,17.28,0,0,1,0-25.47,20,20,0,0,1,27.3,0l4.29,4.07a3.23,3.23,0,0,0,4.44,0l4.29-4.07a20,20,0,0,1,27.3,0,17.27,17.27,0,0,1,0,25.46ZM66.76,47.68h-33v6.91h33ZM53.35,35H46.44V68h6.91Z",transform:"matrix(1 0 0 1 -5 -5)"},lasso:{width:1031,height:1e3,path:"m1018 538c-36 207-290 336-568 286-277-48-473-256-436-463 10-57 36-108 76-151-13-66 11-137 68-183 34-28 75-41 114-42l-55-70 0 0c-2-1-3-2-4-3-10-14-8-34 5-45 14-11 34-8 45 4 1 1 2 3 2 5l0 0 113 140c16 11 31 24 45 40 4 3 6 7 8 11 48-3 100 0 151 9 278 48 473 255 436 462z m-624-379c-80 14-149 48-197 96 42 42 109 47 156 9 33-26 47-66 41-105z m-187-74c-19 16-33 37-39 60 50-32 109-55 174-68-42-25-95-24-135 8z m360 75c-34-7-69-9-102-8 8 62-16 128-68 170-73 59-175 54-244-5-9 20-16 40-20 61-28 159 121 317 333 354s407-60 434-217c28-159-121-318-333-355z",transform:"matrix(1 0 0 -1 0 850)"},selectbox:{width:1e3,height:1e3,path:"m0 850l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z m285 0l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z m-857-286l0-143 143 0 0 143-143 0z m857 0l0-143 143 0 0 143-143 0z m-857-285l0-143 143 0 0 143-143 0z m857 0l0-143 143 0 0 143-143 0z m-857-286l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z m285 0l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z",transform:"matrix(1 0 0 -1 0 850)"},drawline:{width:70,height:70,path:"M60.64,62.3a11.29,11.29,0,0,0,6.09-6.72l6.35-17.72L60.54,25.31l-17.82,6.4c-2.36.86-5.57,3.41-6.6,6L24.48,65.5l8.42,8.42ZM40.79,39.63a7.89,7.89,0,0,1,3.65-3.17l14.79-5.31,8,8L61.94,54l-.06.19a6.44,6.44,0,0,1-3,3.43L34.07,68l-3.62-3.63Zm16.57,7.81a6.9,6.9,0,1,0-6.89,6.9A6.9,6.9,0,0,0,57.36,47.44Zm-4,0a2.86,2.86,0,1,1-2.85-2.85A2.86,2.86,0,0,1,53.32,47.44Zm-4.13,5.22L46.33,49.8,30.08,66.05l2.86,2.86ZM83.65,29,70,15.34,61.4,23.9,75.09,37.59ZM70,21.06l8,8-2.84,2.85-8-8ZM87,80.49H10.67V87H87Z",transform:"matrix(1 0 0 1 -15 -15)"},drawrect:{width:80,height:80,path:"M78,22V79H21V22H78m9-9H12V88H87V13ZM68,46.22H31V54H68ZM53,32H45.22V69H53Z",transform:"matrix(1 0 0 1 -10 -10)"},drawcircle:{width:80,height:80,path:"M50,84.72C26.84,84.72,8,69.28,8,50.3S26.84,15.87,50,15.87,92,31.31,92,50.3,73.16,84.72,50,84.72Zm0-60.59c-18.6,0-33.74,11.74-33.74,26.17S31.4,76.46,50,76.46,83.74,64.72,83.74,50.3,68.6,24.13,50,24.13Zm17.15,22h-34v7.11h34Zm-13.8-13H46.24v34h7.11Z",transform:"matrix(1 0 0 1 -10 -10)"},eraseshape:{width:80,height:80,path:"M82.77,78H31.85L6,49.57,31.85,21.14H82.77a8.72,8.72,0,0,1,8.65,8.77V69.24A8.72,8.72,0,0,1,82.77,78ZM35.46,69.84H82.77a.57.57,0,0,0,.49-.6V29.91a.57.57,0,0,0-.49-.61H35.46L17,49.57Zm32.68-34.7-24,24,5,5,24-24Zm-19,.53-5,5,24,24,5-5Z",transform:"matrix(1 0 0 1 -10 -10)"},spikeline:{width:1e3,height:1e3,path:"M512 409c0-57-46-104-103-104-57 0-104 47-104 104 0 57 47 103 104 103 57 0 103-46 103-103z m-327-39l92 0 0 92-92 0z m-185 0l92 0 0 92-92 0z m370-186l92 0 0 93-92 0z m0-184l92 0 0 92-92 0z",transform:"matrix(1.5 0 0 -1.5 0 850)"},pencil:{width:1792,height:1792,path:"M491 1536l91-91-235-235-91 91v107h128v128h107zm523-928q0-22-22-22-10 0-17 7l-542 542q-7 7-7 17 0 22 22 22 10 0 17-7l542-542q7-7 7-17zm-54-192l416 416-832 832h-416v-416zm683 96q0 53-37 90l-166 166-416-416 166-165q36-38 90-38 53 0 91 38l235 234q37 39 37 91z",transform:"matrix(1 0 0 1 0 1)"},newplotlylogo:{name:"newplotlylogo",svg:"<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 132 132'><defs><style>.cls-1 {fill: #3f4f75;} .cls-2 {fill: #80cfbe;} .cls-3 {fill: #fff;}</style></defs><title>plotly-logomark</title><g id='symbol'><rect class='cls-1' width='132' height='132' rx='6' ry='6'/><circle class='cls-2' cx='78' cy='54' r='6'/><circle class='cls-2' cx='102' cy='30' r='6'/><circle class='cls-2' cx='78' cy='30' r='6'/><circle class='cls-2' cx='54' cy='30' r='6'/><circle class='cls-2' cx='30' cy='30' r='6'/><circle class='cls-2' cx='30' cy='54' r='6'/><path class='cls-3' d='M30,72a6,6,0,0,0-6,6v24a6,6,0,0,0,12,0V78A6,6,0,0,0,30,72Z'/><path class='cls-3' d='M78,72a6,6,0,0,0-6,6v24a6,6,0,0,0,12,0V78A6,6,0,0,0,78,72Z'/><path class='cls-3' d='M54,48a6,6,0,0,0-6,6v48a6,6,0,0,0,12,0V54A6,6,0,0,0,54,48Z'/><path class='cls-3' d='M102,48a6,6,0,0,0-6,6v48a6,6,0,0,0,12,0V54A6,6,0,0,0,102,48Z'/></g></svg>"}}},{}],194:[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}},{}],195:[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":217}],196:[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)}},{}],197:[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":189,"fast-isnumeric":18}],198:[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})}))}},{}],199:[function(e,t,r){"use strict";t.exports=function(e){e._responsiveChartHandler&&(window.removeEventListener("resize",e._responsiveChartHandler),delete e._responsiveChartHandler)}},{}],200:[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 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":97,"../constants/interactions":188,"../plots/attributes":252,"./array":196,"./mod":217,"./nested_property":218,"./regex":226,"fast-isnumeric":18,tinycolor2:65}],201:[function(e,t,r){"use strict";var n,a,i=e("d3-time-format").timeFormat,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=e("d3-time-format").utcFormat,y=/^\s*(-?\d\d\d\d|\d\d)(-(\d?\d)(-(\d?\d)([ Tt]([01]?\d|2[0-3])(:([0-5]\d)(:([0-5]\d(\.\d+)?))?(Z|z|[+\-]\d\d(:?\d\d)?)?)?)?)?)?\s*$/m,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){var n=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"}(e,!!t);if(t<2)return n;var a=r.dateTime2ms(n,e);return a+=f*(t-1),r.ms2DateTime(a,0,e)},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),T=e.match(w?x:y);if(!T)return u;var k=T[1],M=T[3]||"1",A=Number(T[5]||1),L=Number(T[7]||0),S=Number(T[9]||0),C=Number(T[11]||0);if(c){if(2===k.length)return u;var O;k=Number(k);try{var D=v.getComponentMethod("calendars","getCal")(t);if(w){var P="i"===M.charAt(M.length-1);M=parseInt(M,10),O=D.newDate(k,D.toMonthIndex(k,M,P),A)}else O=D.newDate(k,Number(M),A)}catch(e){return u}return O?(O.toJD()-g)*f+L*d+S*p+C*h:u}k=2===k.length?(Number(k)+2e3-b)%100+b:Number(k),M-=1;var z=new Date(Date.UTC(2e3,M,A,L,S));return z.setUTCFullYear(k),z.getUTCMonth()!==M||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 T=90*f,k=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<T?Math.floor(S/d):0,l=t<T?Math.floor(S%d/p):0,c=t<k?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<T?x.getUTCHours():0,l=t<T?x.getUTCMinutes():0,c=t<k?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("%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":189,"../registry":298,"./loggers":214,"./mod":217,"d3-time-format":14,"fast-isnumeric":18}],202:[function(e,t,r){"use strict";var n=e("d3"),a=e("./loggers"),i=e("./matrix"),o=e("gl-mat4");function l(e){var t=e&&e.parentNode;t&&t.removeChild(e)}function s(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")}function c(e){var t=window.getComputedStyle(e,null),r=t.getPropertyValue("-webkit-transform")||t.getPropertyValue("-moz-transform")||t.getPropertyValue("-ms-transform")||t.getPropertyValue("-o-transform")||t.getPropertyValue("transform");return"none"===r?null:r.replace("matrix","").replace("3d","").slice(1,-1).split(",").map((function(e){return+e}))}function u(e){for(var t=[];f(e);)t.push(e),e=e.parentNode;return t}function f(e){return e&&(e instanceof Element||e instanceof HTMLElement)}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)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:l,addStyleRule:function(e,t){s("global",e,t)},addRelatedStyleRule:s,deleteRelatedStyleRule:function(e){var t="plotly.js-style-"+e,r=document.getElementById(t);r&&l(r)},getFullTransformMatrix:function(e){var t=u(e),r=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];return t.forEach((function(e){var t=c(e);if(t){var n=i.convertCssMatrix(t);r=o.multiply(r,r,n)}})),r},getElementTransformMatrix:c,getElementAndAncestors:u,equalDomRects:function(e,t){return e&&t&&e.x===t.x&&e.y===t.y&&e.top===t.top&&e.left===t.left&&e.right===t.right&&e.bottom===t.bottom}}},{"./loggers":214,"./matrix":216,d3:16,"gl-mat4":34}],203:[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:13}],204:[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)):("undefined"!=typeof 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":211}],205:[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}},{}],206:[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}},{}],207:[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":217}],208:[function(e,t,r){"use strict";t.exports=function(e){return e}},{}],209:[function(e,t,r){"use strict";t.exports=function(e,t){if(!t)return e;var r=1/Math.abs(t),n=r>1?(r*e+r*t)/r:e+t,a=String(n).length;if(a>16){var i=String(t).length;if(a>=String(e).length+i){var o=parseFloat(n).toPrecision(12);-1===o.indexOf("e+")&&(n=+o)}}return n}},{}],210:[function(e,t,r){"use strict";var n=e("d3"),a=e("d3-time-format").utcFormat,i=e("fast-isnumeric"),o=e("../constants/numerical"),l=o.FP_SAFE,s=o.BADNUM,c=t.exports={};c.nestedProperty=e("./nested_property"),c.keyedContainer=e("./keyed_container"),c.relativeAttr=e("./relative_attr"),c.isPlainObject=e("./is_plain_object"),c.toLogRange=e("./to_log_range"),c.relinkPrivateKeys=e("./relink_private");var u=e("./array");c.isTypedArray=u.isTypedArray,c.isArrayOrTypedArray=u.isArrayOrTypedArray,c.isArray1D=u.isArray1D,c.ensureArray=u.ensureArray,c.concat=u.concat,c.maxRowLength=u.maxRowLength,c.minRowLength=u.minRowLength;var f=e("./mod");c.mod=f.mod,c.modHalf=f.modHalf;var d=e("./coerce");c.valObjectMeta=d.valObjectMeta,c.coerce=d.coerce,c.coerce2=d.coerce2,c.coerceFont=d.coerceFont,c.coerceHoverinfo=d.coerceHoverinfo,c.coerceSelectionMarkerOpacity=d.coerceSelectionMarkerOpacity,c.validate=d.validate;var p=e("./dates");c.dateTime2ms=p.dateTime2ms,c.isDateTime=p.isDateTime,c.ms2DateTime=p.ms2DateTime,c.ms2DateTimeLocal=p.ms2DateTimeLocal,c.cleanDate=p.cleanDate,c.isJSDate=p.isJSDate,c.formatDate=p.formatDate,c.incrementMonth=p.incrementMonth,c.dateTick0=p.dateTick0,c.dfltRange=p.dfltRange,c.findExactDates=p.findExactDates,c.MIN_MS=p.MIN_MS,c.MAX_MS=p.MAX_MS;var h=e("./search");c.findBin=h.findBin,c.sorterAsc=h.sorterAsc,c.sorterDes=h.sorterDes,c.distinctVals=h.distinctVals,c.roundUp=h.roundUp,c.sort=h.sort,c.findIndexOfMin=h.findIndexOfMin;var g=e("./stats");c.aggNums=g.aggNums,c.len=g.len,c.mean=g.mean,c.median=g.median,c.midRange=g.midRange,c.variance=g.variance,c.stdev=g.stdev,c.interp=g.interp;var v=e("./matrix");c.init2dArray=v.init2dArray,c.transposeRagged=v.transposeRagged,c.dot=v.dot,c.translationMatrix=v.translationMatrix,c.rotationMatrix=v.rotationMatrix,c.rotationXYMatrix=v.rotationXYMatrix,c.apply3DTransform=v.apply3DTransform,c.apply2DTransform=v.apply2DTransform,c.apply2DTransform2=v.apply2DTransform2,c.convertCssMatrix=v.convertCssMatrix,c.inverseTransformMatrix=v.inverseTransformMatrix;var m=e("./angles");c.deg2rad=m.deg2rad,c.rad2deg=m.rad2deg,c.angleDelta=m.angleDelta,c.angleDist=m.angleDist,c.isFullCircle=m.isFullCircle,c.isAngleInsideSector=m.isAngleInsideSector,c.isPtInsideSector=m.isPtInsideSector,c.pathArc=m.pathArc,c.pathSector=m.pathSector,c.pathAnnulus=m.pathAnnulus;var y=e("./anchor_utils");c.isLeftAnchor=y.isLeftAnchor,c.isCenterAnchor=y.isCenterAnchor,c.isRightAnchor=y.isRightAnchor,c.isTopAnchor=y.isTopAnchor,c.isMiddleAnchor=y.isMiddleAnchor,c.isBottomAnchor=y.isBottomAnchor;var x=e("./geometry2d");c.segmentsIntersect=x.segmentsIntersect,c.segmentDistance=x.segmentDistance,c.getTextLocation=x.getTextLocation,c.clearLocationCache=x.clearLocationCache,c.getVisibleSegment=x.getVisibleSegment,c.findPointOnPath=x.findPointOnPath;var b=e("./extend");c.extendFlat=b.extendFlat,c.extendDeep=b.extendDeep,c.extendDeepAll=b.extendDeepAll,c.extendDeepNoArrays=b.extendDeepNoArrays;var _=e("./loggers");c.log=_.log,c.warn=_.warn,c.error=_.error;var w=e("./regex");c.counterRegex=w.counter;var T=e("./throttle");c.throttle=T.throttle,c.throttleDone=T.done,c.clearThrottle=T.clear;var k=e("./dom");function M(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}c.getGraphDiv=k.getGraphDiv,c.isPlotDiv=k.isPlotDiv,c.removeElement=k.removeElement,c.addStyleRule=k.addStyleRule,c.addRelatedStyleRule=k.addRelatedStyleRule,c.deleteRelatedStyleRule=k.deleteRelatedStyleRule,c.getFullTransformMatrix=k.getFullTransformMatrix,c.getElementTransformMatrix=k.getElementTransformMatrix,c.getElementAndAncestors=k.getElementAndAncestors,c.equalDomRects=k.equalDomRects,c.clearResponsive=e("./clear_responsive"),c.preserveDrawingBuffer=e("./preserve_drawing_buffer"),c.makeTraceGroups=e("./make_trace_groups"),c._=e("./localize"),c.notifier=e("./notifier"),c.filterUnique=e("./filter_unique"),c.filterVisible=e("./filter_visible"),c.pushUnique=e("./push_unique"),c.increment=e("./increment"),c.cleanNumber=e("./clean_number"),c.ensureNumber=function(e){return i(e)?(e=Number(e))<-l||e>l?s:i(e)?Number(e):s:s},c.isIndex=function(e,t){return!(void 0!==t&&e>=t)&&(i(e)&&e>=0&&e%1==0)},c.noop=e("./noop"),c.identity=e("./identity"),c.repeat=function(e,t){for(var r=new Array(t),n=0;n<t;n++)r[n]=e;return r},c.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=c.nestedProperty(e,i.replace("?",r)),l=c.nestedProperty(e,i.replace("?",n)),s=o.get();o.set(l.get()),l.set(s)}},c.raiseToTop=function(e){e.parentNode.appendChild(e)},c.cancelTransition=function(e){return e.transition().duration(0)},c.constrain=function(e,t,r){return t>r?Math.max(r,Math.min(t,e)):Math.max(t,Math.min(r,e))},c.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},c.simpleMap=function(e,t,r,n,a){for(var i=e.length,o=new Array(i),l=0;l<i;l++)o[l]=t(e[l],r,n,a);return o},c.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),s="";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++)s=Math.floor(Math.random()*n).toString(n)+s;u&&(o=Math.pow(n,u),s=Math.floor(Math.random()*o).toString(n)+s);var f=parseInt(s,n);return t&&t[s]||f!==1/0&&f>=Math.pow(2,r)?a>10?(c.warn("randstr failed uniqueness"),s):e(t,r,n,(a||0)+1):s},c.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},c.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},c.syncOrAsync=function(e,t,r){var n;function a(){return c.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,c.promiseError);return r&&r(t)},c.stripTrailingSlash=function(e){return"/"===e.substr(-1)?e.substr(0,e.length-1):e},c.noneOrAll=function(e,t,r){if(e){var n,a=!1,i=!0;for(n=0;n<r.length;n++)null!=e[r[n]]?a=!0:i=!1;if(a&&!i)for(n=0;n<r.length;n++)e[r[n]]=t[r[n]]}},c.mergeArray=function(e,t,r,n){var a="function"==typeof n;if(c.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}},c.mergeArrayCastPositive=function(e,t,r){return c.mergeArray(e,t,r,(function(e){var t=+e;return isFinite(t)&&t>0?t:0}))},c.fillArray=function(e,t,r,n){if(n=n||c.identity,c.isArrayOrTypedArray(e))for(var a=0;a<t.length;a++)t[a][r]=n(e[a])},c.castOption=function(e,t,r,n){n=n||c.identity;var a=c.nestedProperty(e,r).get();return c.isArrayOrTypedArray(a)?Array.isArray(t)&&c.isArrayOrTypedArray(a[t[0]])?n(a[t[0]][t[1]]):n(a[t]):a},c.extractOption=function(e,t,r,n){if(r in e)return e[r];var a=c.nestedProperty(t,n).get();return Array.isArray(a)?void 0:a},c.tagSelected=function(e,t,r){var n,a,i=t.selectedpoints,o=t._indexToPoints;o&&(n=M(o));for(var l=0;l<i.length;l++){var s=i[l];if(c.isIndex(s)||c.isArrayOrTypedArray(s)&&c.isIndex(s[0])&&c.isIndex(s[1])){var u=n?n[s]:s,f=r?r[u]:u;void 0!==(a=f)&&a<e.length&&(e[f].selected=1)}}},c.selIndices2selPoints=function(e){var t=e.selectedpoints,r=e._indexToPoints;if(r){for(var n=M(r),a=[],i=0;i<t.length;i++){var o=t[i];if(c.isIndex(o)){var l=n[o];c.isIndex(l)&&a.push(l)}}return a}return t},c.getTargetArray=function(e,t){var r=t.target;if("string"==typeof r&&r){var n=c.nestedProperty(e,r).get();return!!Array.isArray(n)&&n}return!!Array.isArray(r)&&r},c.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):c.isTypedArray(i)?r[a]=i.subarray(0,3):r[a]=i&&"object"==typeof i?c.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},c.titleCase=function(e){return e.charAt(0).toUpperCase()+e.substr(1)},c.containsAny=function(e,t){for(var r=0;r<t.length;r++)if(-1!==e.indexOf(t[r]))return!0;return!1},c.isIE=function(){return"undefined"!=typeof window.navigator.msSaveBlob};var A=/MSIE [1-9]\./;c.isIE9orBelow=function(){return c.isIE()&&A.test(window.navigator.userAgent)};var L=/Version\/[\d\.]+.*Safari/;c.isSafari=function(){return L.test(window.navigator.userAgent)};var S=/iPad|iPhone|iPod/;c.isIOS=function(){return S.test(window.navigator.userAgent)},c.isD3Selection=function(e){return e&&"function"==typeof e.classed},c.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},c.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},c.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 C=/^([^\[\.]+)\.(.+)?/,O=/^([^\.]+)\[([0-9]+)\](\.)?(.+)?/;c.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(C))?(a=e[r],n=t[1],delete e[r],e[n]=c.extendDeepNoArrays(e[n]||{},c.objectFromPath(r,c.expandObjectPaths(a))[n])):(t=r.match(O))?(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]||{},c.extendDeepNoArrays(o,c.objectFromPath(l,c.expandObjectPaths(a)))):e[n][i]=c.expandObjectPaths(a)):e[r]=c.expandObjectPaths(e[r]));return e},c.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},c.TEMPLATE_STRING_REGEX=/%{([^\s%{}:]*)([:|\|][^}]*)?}/g;var D=/^\w*$/;c.templateString=function(e,t){var r={};return e.replace(c.TEMPLATE_STRING_REGEX,(function(e,n){var a;return D.test(n)?a=t[n]:(r[n]=r[n]||c.nestedProperty(t,n).get,a=r[n]()),c.isValidTextValue(a)?a:""}))};var P={max:10,count:0,name:"hovertemplate"};c.hovertemplateString=function(){return E.apply(P,arguments)};var z={max:10,count:0,name:"texttemplate"};c.texttemplateString=function(){return E.apply(z,arguments)};var R=/^[:|\|]/;function E(e,t,r){var i=this,o=arguments;t||(t={});var l={};return e.replace(c.TEMPLATE_STRING_REGEX,(function(e,s,u){var f,d,p,h;for(p=3;p<o.length;p++)if(f=o[p]){if(f.hasOwnProperty(s)){d=f[s];break}if(D.test(s)||(d=l[s]||c.nestedProperty(f,s).get())&&(l[s]=d),void 0!==d)break}if(void 0===d&&i)return i.count<i.max&&(c.warn("Variable '"+s+"' in "+i.name+" could not be found!"),d=e),i.count===i.max&&c.warn("Too many "+i.name+" warnings - additional warnings will be suppressed"),i.count++,e;if(u){if(":"===u[0]&&(d=(h=r?r.numberFormat:n.format)(u.replace(R,""))(d)),"|"===u[0]){h=r?r.timeFormat:a;var g=c.dateTime2ms(d);d=c.formatDate(g,u.replace(R,""),!1,h)}}else t.hasOwnProperty(s+"Label")&&(d=t[s+"Label"]);return d}))}c.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 I=2e9;c.seedPseudoRandom=function(){I=2e9},c.pseudoRandom=function(){var e=I;return I=(69069*I+1)%4294967296,Math.abs(I-e)<429496729?c.pseudoRandom():I/4294967296},c.fillText=function(e,t,r){var n=Array.isArray(r)?function(e){r.push(e)}:function(e){r.text=e},a=c.extractOption(e,t,"htx","hovertext");if(c.isValidTextValue(a))return n(a);var i=c.extractOption(e,t,"tx","text");return c.isValidTextValue(i)?n(i):void 0},c.isValidTextValue=function(e){return e||0===e},c.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},c.isHidden=function(e){var t=window.getComputedStyle(e).display;return!t||"none"===t},c.strTranslate=function(e,t){return e||t?"translate("+e+","+t+")":""},c.strRotate=function(e){return e?"rotate("+e+")":""},c.strScale=function(e){return 1!==e?"scale("+e+")":""},c.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,u=e.scale;return u?u>1&&(u=1):u=0,c.strTranslate(a-u*(r+o),i-u*(n+l))+c.strScale(u)+(s?"rotate("+s+(t?"":" "+r+" "+n)+")":"")},c.ensureUniformFontSize=function(e,t){var r=c.extendFlat({},t);return r.size=Math.max(t.size,e._fullLayout.uniformtext.minsize||0),r},c.join2=function(e,t,r){var n=e.length;return n>1?e.slice(0,-1).join(t)+r+e[n-1]:e.join(t)}},{"../constants/numerical":189,"./anchor_utils":194,"./angles":195,"./array":196,"./clean_number":197,"./clear_responsive":199,"./coerce":200,"./dates":201,"./dom":202,"./extend":204,"./filter_unique":205,"./filter_visible":206,"./geometry2d":207,"./identity":208,"./increment":209,"./is_plain_object":211,"./keyed_container":212,"./localize":213,"./loggers":214,"./make_trace_groups":215,"./matrix":216,"./mod":217,"./nested_property":218,"./noop":219,"./notifier":220,"./preserve_drawing_buffer":223,"./push_unique":224,"./regex":226,"./relative_attr":227,"./relink_private":228,"./search":229,"./stats":231,"./throttle":233,"./to_log_range":234,d3:16,"d3-time-format":14,"fast-isnumeric":18}],211:[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}},{}],212:[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||(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":218}],213:[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":298}],214:[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":243,"./notifier":220}],215:[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:16}],216:[function(e,t,r){"use strict";var n=e("gl-mat4");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.apply3DTransform=function(e){return function(){var t=arguments,n=1===arguments.length?t[0]:[t[0],t[1],t[2]||0];return r.dot(e,[n[0],n[1],n[2],1]).slice(0,3)}},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)))}},r.convertCssMatrix=function(e){if(e){var t=e.length;if(16===t)return e;if(6===t)return[e[0],e[1],0,0,e[2],e[3],0,0,0,0,1,0,e[4],e[5],0,1]}return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]},r.inverseTransformMatrix=function(e){var t=[];return n.invert(t,e),[[t[0],t[1],t[2],t[3]],[t[4],t[5],t[6],t[7]],[t[8],t[9],t[10],t[11]],[t[12],t[13],t[14],t[15]]]}},{"gl-mat4":34}],217:[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}}},{}],218:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("./array").isArrayOrTypedArray;function i(e,t){return function(){var r,n,o,l,s,c=e;for(l=0;l<t.length-1;l++){if(-1===(r=t[l])){for(n=!0,o=[],s=0;s<c.length;s++)o[s]=i(c[s],t.slice(l+1))(),o[s]!==o[0]&&(n=!1);return n?o[0]:o}if("number"==typeof r&&!a(c))return;if("object"!=typeof(c=c[r])||null===c)return}if("object"==typeof c&&null!==c&&null!==(o=c[t[l]]))return o}}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,a,o,l=0,c=t.split(".");l<c.length;){if(r=String(c[l]).match(/^([^\[\]]*)((\[\-?[0-9]*\])+)$/)){if(r[1])c[l]=r[1];else{if(0!==l)throw"bad property string";c.splice(0,1)}for(a=r[2].substr(1,r[2].length-2).split("]["),o=0;o<a.length;o++)l++,c.splice(l,0,Number(a[o]))}l++}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:s(e,c,t),get:i(e,c),astr:t,parts:c,obj:e}};var o=/(^|\.)args\[/;function l(e,t){return void 0===e||null===e&&!t.match(o)}function s(e,t,r){return function(n){var i,o,s=e,d="",p=[[e,d]],h=l(n,r);for(o=0;o<t.length-1;o++){if("number"==typeof(i=t[o])&&!a(s))throw"array index but container is not an array";if(-1===i){if(h=!u(s,t.slice(o+1),n,r))break;return}if(!f(s,i,t[o+1],h))break;if("object"!=typeof(s=s[i])||null===s)throw"container is not an object";d=c(d,i),p.push([s,d])}if(h){if(o===t.length-1&&(delete s[t[o]],Array.isArray(s)&&+t[o]==s.length-1))for(;s.length&&void 0===s[s.length-1];)s.pop()}else s[t[o]]=n}}function c(e,t){var r=t;return n(t)?r="["+t+"]":e&&(r="."+t),e+r}function u(e,t,r,n){var i,o=a(r),c=!0,u=r,d=n.replace("-1",0),p=!o&&l(r,d),h=t[0];for(i=0;i<e.length;i++)d=n.replace("-1",i),o&&(p=l(u=r[i%r.length],d)),p&&(c=!1),f(e,i,h,p)&&s(e[i],t,n.replace("-1",i))(u);return c}function f(e,t,r,n){if(void 0===e[t]){if(n)return!1;e[t]="number"==typeof r?[]:{}}return!0}},{"./array":196,"fast-isnumeric":18}],219:[function(e,t,r){"use strict";t.exports=function(){}},{}],220:[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("&times;").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:16,"fast-isnumeric":18}],221:[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":230}],222:[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":189,"./matrix":216}],223:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("is-mobile");t.exports=function(e){var t;if("string"!=typeof(t=e&&e.hasOwnProperty("userAgent")?e.userAgent:function(){var e;"undefined"!=typeof navigator&&(e=navigator.userAgent);e&&e.headers&&"string"==typeof e.headers["user-agent"]&&(e=e.headers["user-agent"]);return e}()))return!0;var r=a({ua:{headers:{"user-agent":t}},tablet:!0,featureDetect:!1});if(!r)for(var i=t.split(" "),o=1;o<i.length;o++){if(-1!==i[o].indexOf("Safari"))for(var l=o-1;l>-1;l--){var s=i[l];if("Version/"===s.substr(0,8)){var c=s.substr(8).split(".")[0];if(n(c)&&(c=+c),c>=13)return!0}}}return r}},{"fast-isnumeric":18,"is-mobile":52}],224:[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}},{}],225:[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":210,"../plot_api/plot_config":243}],226:[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)}},{}],227:[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}},{}],228:[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":196,"./is_plain_object":211}],229:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("./loggers"),i=e("./identity"),o=e("../constants/numerical").BADNUM;function l(e,t){return e<t}function s(e,t){return e<=t}function c(e,t){return e>t}function u(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,o,f=0,d=t.length,p=0,h=d>1?(t[d-1]-t[0])/(d-1):1;for(o=h>=0?r?l:s:r?u:c,e+=1e-9*h*(r?-1:1)*(h>=0?1:-1);f<d&&p++<100;)o(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,t){var n,a=(t||{}).unitMinDiff,i=e.slice();for(i.sort(r.sorterAsc),n=i.length-1;n>-1&&i[n]===o;n--);var l=1;a||(l=i[n]-i[0]||1);for(var s,c=l/(n||1)/1e4,u=[],f=0;f<=n;f++){var d=i[f],p=d-s;void 0===s?(u.push(d),s=d):p>c&&(l=Math.min(l,p),u.push(d),s=d)}return{vals:u,minDiff:l}},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}},{"../constants/numerical":189,"./identity":208,"./loggers":214,"fast-isnumeric":18}],230:[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)}},{}],231:[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":196,"fast-isnumeric":18}],232:[function(e,t,r){"use strict";var n=e("d3"),a=e("../lib"),i=a.strTranslate,o=e("../constants/xmlns_namespaces"),l=e("../constants/alignment").LINE_SPACING;function s(e,t){return e.node().getBoundingClientRect()[t]}var c=/([^$]*)([$]+[^$]*[$]+)([^$]*)/;r.convertToTspans=function(e,t,A){var L=e.text(),C=!e.attr("data-notex")&&"undefined"!=typeof MathJax&&L.match(c),O=n.select(e.node().parentNode);if(!O.empty()){var D=e.attr("class")?e.attr("class").split(" ")[0]:"text";return D+="-math",O.selectAll("svg."+D).remove(),O.selectAll("g."+D+"-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),o={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(u,"\\lt ").replace(f,"\\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],o,(function(n,a,o){O.selectAll("svg."+D).remove(),O.selectAll("g."+D+"-group").remove();var l=n&&n.select("svg");if(!l||!l.node())return P(),void t();var c=O.append("g").classed(D+"-group",!0).attr({"pointer-events":"none","data-unformatted":L,"data-math":"Y"});c.node().appendChild(l.node()),a&&a.node()&&l.node().insertBefore(a.node().cloneNode(!0),l.node().firstChild),l.attr({class:D,height:o.height,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var u=e.node().style.fill||"black",f=l.select("g");f.attr({fill:u,stroke:u});var d=s(f,"width"),p=s(f,"height"),h=+e.attr("x")-d*{start:0,middle:.5,end:1}[e.attr("text-anchor")||"start"],g=-(r||s(e,"height"))/4;"y"===D[0]?(c.attr({transform:"rotate("+[-90,+e.attr("x"),+e.attr("y")]+")"+i(-d/2,g-p/2)}),l.attr({x:+e.attr("x"),y:+e.attr("y")})):"l"===D[0]?l.attr({x:e.attr("x"),y:g-p/2}):"a"===D[0]&&0!==D.indexOf("atitle")?l.attr({x:0,y:g}):l.attr({x:h,y:+e.attr("y")+g-p/2}),A&&A.call(e,c),t(c)}))}))):P(),e}function P(){O.empty()||(D=e.attr("class")+"-math",O.select("svg."+D).remove()),e.text("").style("white-space","pre"),function(e,t){t=t.replace(v," ");var r,i=!1,s=[],c=-1;function u(){c++;var t=document.createElementNS(o.svg,"tspan");n.select(t).attr({class:"line",dy:c*l+"em"}),e.appendChild(t),r=t;var a=s;if(s=[{node:t}],a.length>1)for(var i=1;i<a.length;i++)f(a[i])}function f(e){var t,a=e.type,i={};if("a"===a){t="a";var l=e.target,c=e.href,u=e.popup;c&&(i={"xlink:xlink:show":"_blank"===l||"_"!==l.charAt(0)?"new":"replace",target:l,"xlink:xlink:href":c},u&&(i.onclick='window.open(this.href.baseVal,this.target.baseVal,"'+u+'");return false;'))}else t="tspan";e.style&&(i.style=e.style);var f=document.createElementNS(o.svg,t);if("sup"===a||"sub"===a){A(r,"\u200b"),r.appendChild(f);var d=document.createElementNS(o.svg,"tspan");A(d,"\u200b"),n.select(d).attr("dy",h[a]),i.dy=p[a],r.appendChild(f),r.appendChild(d)}else r.appendChild(f);n.select(f).attr(i),r=e.node=f,s.push(e)}function A(e,t){e.appendChild(document.createTextNode(t))}function L(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 C=t.split(m),O=0;O<C.length;O++){var D=C[O],P=D.match(y),z=P&&P[2].toLowerCase(),R=d[z];if("br"===z)u();else if(void 0===R)A(r,S(D));else if(P[1])L(z);else{var E=P[4],I={type:z},F=k(E,b);if(F?(F=F.replace(M,"$1 fill:"),R&&(F+=";"+R)):R&&(F=R),F&&(I.style=F),"a"===z){i=!0;var N=k(E,_);if(N){var H=document.createElement("a");H.href=N,-1!==g.indexOf(H.protocol)&&(I.href=encodeURI(decodeURI(N)),I.target=k(E,w)||"_blank",I.popup=k(E,T))}}f(I)}}return i}(e.node(),L)&&e.style("pointer-events","all"),r.positionText(e),A&&A.call(e)}};var u=/(<|&lt;|&#60;)/g,f=/(>|&gt;|&#62;)/g;var d={sup:"font-size:70%",sub:"font-size:70%",b:"font-weight:bold",i:"font-style:italic",a:"cursor:pointer",span:"",em:"font-style:italic;font-weight:bold"},p={sub:"0.3em",sup:"-0.6em"},h={sub:"-0.21em",sup:"0.42em"},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,T=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i;function k(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:"\u03bc",amp:"&",lt:"<",gt:">",nbsp:"\xa0",times:"\xd7",plusmn:"\xb1",deg:"\xb0"},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,i,o,l=r.horizontalAlign,s=r.verticalAlign||"top",c=e.node().getBoundingClientRect(),u=t.node().getBoundingClientRect();return i="bottom"===s?function(){return c.bottom-n.height}:"middle"===s?function(){return c.top+(c.height-n.height)/2}:function(){return c.top},o="right"===l?function(){return c.right-n.width}:"center"===l?function(){return c.left+(c.width-n.width)/2}:function(){return c.left},function(){n=this.node().getBoundingClientRect();var e=o()-u.left,t=i()-u.top,l=r.gd||{};if(r.gd){l._fullLayout._calcInverseTransform(l);var s=a.apply3DTransform(l._fullLayout._invTransform)(e,t);e=s[0],t=s[1]}return this.style({top:t+"px",left:e+"px","z-index":1e3}),this}}r.convertEntities=S,r.sanitizeHTML=function(e){e=e.replace(v," ");for(var t=document.createElement("p"),r=t,a=[],i=e.split(m),o=0;o<i.length;o++){var l=i[o],s=l.match(y),c=s&&s[2].toLowerCase();if(c in d)if(s[1])a.length&&(r=a.pop());else{var u=s[4],f=k(u,b),p=f?{style:f}:{};if("a"===c){var h=k(u,_);if(h){var x=document.createElement("a");if(x.href=h,-1!==g.indexOf(x.protocol)){p.href=encodeURI(decodeURI(h));var T=k(u,w);T&&(p.target=T)}}}var M=document.createElement(c);r.appendChild(M),n.select(M).attr(p),r=M,a.push(M)}else r.appendChild(document.createTextNode(S(l)))}return t.innerHTML},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":184,"../constants/xmlns_namespaces":190,"../lib":210,d3:16}],233:[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)}},{}],234:[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":18}],235:[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"}}},{}],236:[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"}}},{}],237:[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":298}],238:[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":210}],239:[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,!0))}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],T=_[1],k=_[2],M=a([],w),A=[];for(n=0;n<3;++n)A[n]=T[n]+k*M[2+4*n];b.camera={eye:{x:A[0],y:A[1],z:A[2]},center:{x:T[0],y:T[1],z:T[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 D=Array.isArray(e.images)?e.images.length:0;for(t=0;t<D;t++){var P=e.images[t];o.isPlainObject(P)&&(p(P,"xref"),p(P,"yref"))}var z=e.legend;return z&&(z.x>3?(z.x=1.02,z.xanchor="left"):z.x<-2&&(z.x=-.02,z.xanchor="right"),z.y>3?(z.y=1.02,z.yanchor="bottom"):z.y<-2&&(z.y=-.02,z.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 T=!1!==(a.increasing||{}).showlegend,k=!1!==(a.decreasing||{}).showlegend,M=g(a.increasing),A=g(a.decreasing);if(!1!==M&&!1!==A){var L=v(M,A,T,k);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,D=Object.keys(O);C.styles=[];for(var P=0;P<D.length;P++)C.styles.push({target:D[P],value:O[D[P]]})}}}}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":82,"../lib":210,"../plots/cartesian/axis_ids":259,"../plots/plots":290,"../registry":298,"fast-isnumeric":18,"gl-mat4/fromQuat":24}],240:[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":300,"./plot_api":242,"./template_api":247,"./to_image":248,"./validate":249}],241:[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,T,k,M,A,L=Object.keys(r).map(Number).sort(o),S=t.get(),C=S||[],O=u(m,f).get(),D=[],P=-1,z=C.length;for(x=0;x<L.length;x++)if(w=r[_=L[x]],T=Object.keys(w),k=w[""],M=s(k),_<0||_>C.length-(M?0:1))i.warn("index out of range",f,_);else if(void 0!==k)T.length>1&&i.warn("Insertion & removal are incompatible with edits to the same index.",f,_),c(k)?D.push(_):M?("add"===k&&(k={}),C.splice(_,0,k),O&&O.splice(_,0,{})):i.warn("Unrecognized full object edit value",f,_,k),-1===P&&(P=_);else for(b=0;b<T.length;b++)A=f+"["+_+"].",u(C[_],T[b],A).set(w[T[b]]);for(x=D.length-1;x>=0;x--)C.splice(D[x],1),O&&O.splice(D[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===P)R=L;else{for(z=Math.max(C.length,z),R=[],x=0;x<L.length&&!((_=L[x])>=P);x++)R.push(_);for(x=P;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":211,"../lib/loggers":214,"../lib/noop":219,"../lib/search":229,"../registry":298,"./container_array_match":237}],242:[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"),T=e("./helpers"),k=e("./subroutines"),M=e("./edit_types"),A=e("../plots/cartesian/constants").AX_NAME_PATTERN,L=0;function S(e){var t=e._fullLayout;t._redrawFromAutoMarginCount?t._redrawFromAutoMarginCount--:e.emit("plotly_afterplot")}function C(e,t){try{e._fullLayout._paper.style("background",t)}catch(e){o.error(e)}}function O(e,t){C(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]=O: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=C),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 P(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 z(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 R(e,t,r){if(!Array.isArray(e.data))throw new Error("gd.data must be an array.");if("undefined"==typeof t)throw new Error("currentIndices is a required argument.");if(Array.isArray(t)||(t=[t]),z(e,t,"currentIndices"),"undefined"==typeof r||Array.isArray(r)||(r=[r]),"undefined"!=typeof r&&z(e,r,"newIndices"),"undefined"!=typeof r&&t.length!==r.length)throw new Error("current and new indices must be of equal length.")}function E(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("undefined"==typeof r)throw new Error("indices must be an integer or array of integers");for(var i in z(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=P(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 I(e,t){var r=new e.constructor(e.length+t.length);return r.set(e),r.set(t,e.length),r}function F(e,t,n,a){e=o.getGraphDiv(e),T.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=T.coerceTraceIndices(e,a),s=j(e,i,l),u=s.flags;u.calc&&(e.calcdata=void 0),u.clearAxisTypes&&T.clearAxisTypes(e,l,{});var f=[];u.fullReplot?f.push(r.plot):(f.push(d.previousPromises),d.supplyDefaults(e),u.markerSize&&(d.doCalcdata(e),G(f)),u.style&&f.push(k.doTraceStyle),u.colorbars&&f.push(k.doColorBars),f.push(S)),f.push(d.rehover,d.redrag),c.add(e,F,[e,s.undoit,s.traces],F,[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 N(e){return void 0===e?null:e}function H(e,t){return t?function(t,r,n){var a=l(t,r),i=a.set;return a.set=function(t){B((n||"")+r,a.get(),t,e),i(t)},a}:l}function B(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++)B(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)B(e+"."+d,c[d],u[d],n)}else void 0===n[e]&&(n[e]=N(t))}function j(e,t,r){var n,a=e._fullLayout,i=e._fullData,s=e.data,c=a._guiEditing,p=H(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 k(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)&&!T.hasParent(t,n)){var l;if("LAYOUT"===n.substr(0,6))l=p(e.layout,n.replace("LAYOUT",""));else{var u=r[o];l=H(a._tracePreGUI[A(u)._fullInput.uid],c)(s[u],n)}n in x||(x[n]=b()),void 0===x[n][o]&&(x[n][o]=N(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(T.hasParent(t,O))throw new Error("cannot set "+O+" and a parent attribute simultaneously");var D,P,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(D=s[r[n]],P=A(r[n]),R=(z=H(a._tracePreGUI[P._fullInput.uid],c)(D,O)).get(),void 0!==(E=Array.isArray(F)?F[n%F.length]:F)){var B=z.parts[z.parts.length-1],j=O.substr(0,O.length-B.length-1),U=j?j+".":"",q=j?l(P,j).get():P;if((I=f.getTraceValObject(P,z.parts))&&I.impliedEdits&&null!==E)for(var G in I.impliedEdits)L(o.relativeAttr(O,G),I.impliedEdits[G],n);else if("thicknessmode"!==B&&"lenmode"!==B||R===E||"fraction"!==E&&"pixels"!==E||!q){if("type"===O&&("pie"===E!=("pie"===R)||"funnelarea"===E!=("funnelarea"===R))){var Z="x",Y="y";"bar"!==E&&"bar"!==R||"h"!==D.orientation||(Z="y",Y="x"),o.swapAttrs(D,["?","?src"],"labels",Z),o.swapAttrs(D,["d?","?0"],"label",Z),o.swapAttrs(D,["?","?src"],"values",Y),"pie"===R||"funnelarea"===R?(l(D,"marker.color").set(l(D,"marker.colors").get()),a._pielayer.selectAll("g.trace").remove()):u.traceIs(D,"cartesian")&&l(D,"marker.colors").set(l(D,"marker.color").get())}}else{var X=a._size,W=q.orient,Q="top"===W||"bottom"===W;if("thicknessmode"===B){var J=Q?X.h:X.w;L(U+"thickness",q.thickness*("fraction"===E?1/J:J),n)}else{var $=Q?X.w:X.h;L(U+"len",q.len*("fraction"===E?1/$:$),n)}}x[O][n]=N(R);if(-1!==["swapxy","swapxyaxes","orientation","orientationaxes"].indexOf(O)){if("orientation"===O){z.set(E);var K=D.x&&!D.y?"h":"v";if((z.get()||K)===P.orientation)continue}else"orientationaxes"===O&&(D.orientation={v:"h",h:"v"}[P.orientation]);T.swapXYData(D),m.calc=m.clearAxisTypes=!0}else-1!==d.dataArrayContainers.indexOf(z.parts[0])?(T.manageArrayContainers(z,E,x),m.calc=!0):(I?I.arrayOk&&!u.traceIs(P,"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"),te=ee.get();"x"===te?ee.set("y"):"y"===te?ee.set("x"):"x unified"===te?ee.set("y unified"):"y unified"===te&&ee.set("x unified")}if(-1!==["orientation","type"].indexOf(O)){for(v=[],n=0;n<r.length;n++){var re=s[r[n]];u.traceIs(re,"cartesian")&&(_(re.xaxis||"x"),_(re.yaxis||"y"))}L(v.map(w),!0,0),L(v.map(k),[0,1],0)}}else z=p(e.layout,O.replace("LAYOUT","")),x[O]=[N(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),T.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=W(e,n),i=a.flags;i.calc&&(e.calcdata=void 0);var l=[d.previousPromises];i.layoutReplot?l.push(k.layoutReplot):Object.keys(n).length&&(q(e,i,a)||d.supplyDefaults(e),i.legend&&l.push(k.doLegend),i.layoutstyle&&l.push(k.layoutStyles),i.axrange&&G(l,a.rangesAltered),i.ticks&&l.push(k.doTicksRelayout),i.modebar&&l.push(k.doModeBar),i.camera&&l.push(k.doCamera),i.colorbars&&l.push(k.doColorBars),l.push(S)),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 q(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,l.range&&(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 G(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),-1!==(i.ticklabelposition||"").indexOf("inside")&&i._anchorAxis&&r.push(i._anchorAxis._id),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,k.doAutoRangeAndConstraints,r,k.drawData,k.finalDraw)}var Z=/^[xyz]axis[0-9]*\.range(\[[0|1]\])?$/,Y=/^[xyz]axis[0-9]*\.autorange$/,X=/^[xyz]axis[0-9]*\.domain(\[[0|1]\])?$/;function W(e,t){var r,n,a,i=e.layout,s=e._fullLayout,c=s._guiEditing,d=H(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(),k={},L={};function S(e,r){if(Array.isArray(e))e.forEach((function(e){S(e,r)}));else if(!(e in t)&&!T.hasParent(t,e)){var n=d(i,e);e in L||(L[e]=N(n.get())),void 0!==r&&n.set(r)}}var C,O={};function D(e){var t=h.name2id(e.split(".")[0]);return O[t]=1,t}for(var P in t){if(T.hasParent(t,P))throw new Error("cannot set "+P+" and a parent attribute simultaneously");for(var z=d(i,P),R=t[P],E=z.parts.length-1;E>0&&"string"!=typeof z.parts[E];)E--;var I=z.parts[E],F=z.parts[E-1]+"."+I,B=z.parts.slice(0,E).join("."),j=l(e.layout,B).get(),U=l(s,B).get(),q=z.get();if(void 0!==R){k[P]=R,L[P]="reverse"===I?R:N(q);var G=f.getLayoutValObject(s,z.parts);if(G&&G.impliedEdits&&null!==R)for(var W in G.impliedEdits)S(o.relativeAttr(P,W),G.impliedEdits[W]);if(-1!==["width","height"].indexOf(P))if(R){S("autosize",null);var J="height"===P?"width":"height";S(J,s[J])}else s[P]=e._initialAutoSize[P];else if("autosize"===P)S("width",R?null:s.width),S("height",R?null:s.height);else if(F.match(Z))D(F),l(s,B+"._inputRange").set(null);else if(F.match(Y)){D(F),l(s,B+"._inputRange").set(null);var $=l(s,B).get();$._inputDomain&&($._input.domain=$._inputDomain.slice())}else F.match(X)&&l(s,B+"._inputDomain").set(null);if("type"===I){C=j;var K="linear"===U.type&&"log"===R,ee="log"===U.type&&"linear"===R;if(K||ee){if(C&&C.range)if(U.autorange)K&&(C.range=C.range[1]>C.range[0]?[1,2]:[2,1]);else{var te=C.range[0],re=C.range[1];K?(te<=0&&re<=0&&S(B+".autorange",!0),te<=0?te=re/1e6:re<=0&&(re=te/1e6),S(B+".range[0]",Math.log(te)/Math.LN10),S(B+".range[1]",Math.log(re)/Math.LN10)):(S(B+".range[0]",Math.pow(10,te)),S(B+".range[1]",Math.pow(10,re)))}else S(B+".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,U,R,S),u.getComponentMethod("images","convertCoords")(e,U,R,S)}else S(B+".autorange",!0),S(B+".range",null);l(s,B+"._inputRange").set(null)}else if(I.match(A)){var ne=l(s,P).get(),ae=(R||{}).type;ae&&"-"!==ae||(ae="linear"),u.getComponentMethod("annotations","convertCoords")(e,ne,ae,S),u.getComponentMethod("images","convertCoords")(e,ne,ae,S)}var ie=w.containerArrayMatch(P);if(ie){r=ie.array,n=ie.index;var oe=ie.property,le=G||{editType:"calc"};""!==n&&""===oe&&(w.isAddVal(R)?L[P]=null:w.isRemoveVal(R)?L[P]=(l(i,r).get()||[])[n]:o.warn("unrecognized full object value",t)),M.update(_,le),m[r]||(m[r]={});var se=m[r][n];se||(se=m[r][n]={}),se[oe]=R,delete t[P]}else"reverse"===I?(j.range?j.range.reverse():(S(B+".autorange",!0),j.range=[1,0]),U.autorange?_.calc=!0:_.plot=!0):(s._has("scatter-like")&&s._has("regl")&&"dragmode"===P&&("lasso"===R||"select"===R)&&"lasso"!==q&&"select"!==q||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)}for(var ce in O){var ue=(C=h.getFromId(e,ce))&&C._constraintGroup;if(ue)for(var fe in _.calc=!0,ue)O[fe]||(h.getFromId(e,fe)._constraintShrinkable=!0)}return(Q(e)||t.height||t.width)&&(_.plot=!0),(_.plot||_.calc)&&(_.layoutReplot=!0),{flags:_,rangesAltered:O,undoit:L,redoit:k,eventData:v}}function Q(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 J(e,t,n,a){if(e=o.getGraphDiv(e),T.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=T.coerceTraceIndices(e,a),l=j(e,o.extendFlat({},t),i),s=l.flags,u=W(e,o.extendFlat({},n)),f=u.flags;(s.calc||f.calc)&&(e.calcdata=void 0),s.clearAxisTypes&&T.clearAxisTypes(e,i,n);var p=[];f.layoutReplot?p.push(k.layoutReplot):s.fullReplot?p.push(r.plot):(p.push(d.previousPromises),q(e,f,u)||d.supplyDefaults(e),s.style&&p.push(k.doTraceStyle),(s.colorbars||f.colorbars)&&p.push(k.doColorBars),f.legend&&p.push(k.doLegend),f.layoutstyle&&p.push(k.layoutStyles),f.axrange&&G(p,u.rangesAltered),f.ticks&&p.push(k.doTicksRelayout),f.modebar&&p.push(k.doModeBar),f.camera&&p.push(k.doCamera),p.push(S)),p.push(d.rehover,d.redrag),c.add(e,J,[e,l.undoit,u.undoit,l.traces],J,[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 $(e){return function(t){t._fullLayout._guiEditing=!0;var r=e.apply(null,arguments);return t._fullLayout._guiEditing=!1,r}}var K=[{pattern:/^hiddenlabels/,attr:"legend.uirevision"},{pattern:/^((x|y)axis\d*)\.((auto)?range|title\.text)/},{pattern:/axis\d*\.showspikes$/,attr:"modebar.uirevision"},{pattern:/(hover|drag)mode$/,attr:"modebar.uirevision"},{pattern:/^(scene\d*)\.camera/},{pattern:/^(geo\d*)\.(projection|center|fitbounds)/},{pattern:/^(ternary\d*\.[abc]axis)\.(min|title\.text)$/},{pattern:/^(polar\d*\.radialaxis)\.((auto)?range|angle|title\.text)/},{pattern:/^(polar\d*\.angularaxis)\.rotation/},{pattern:/^(mapbox\d*)\.(center|zoom|bearing|pitch)/},{pattern:/^legend\.(x|y)$/,attr:"editrevision"},{pattern:/^(shapes|annotations)/,attr:"editrevision"},{pattern:/^title\.text$/,attr:"editrevision"}],ee=[{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 te(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 re(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 ne(e,t){for(var r=0;r<t.length;r++)if(t[r]._fullInput.uid===e)return r;return-1}function ae(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 ie(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 oe(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++,(Z.test(s)||Y.test(s))&&(u.rangesAltered[r[0]]=1),X.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),T=Array.isArray(v),k=Array.isArray(m);if(T&&k){var A="_input_"+i,L=e[A],S=t[A];if(Array.isArray(L)&&L===S)continue}if(void 0===m)w&&T?u.calc=!0:h();else if(a._isLinkedToArray){var C=[],O=!1;d||(u.arrays[i]=C);var D=Math.min(v.length,m.length),P=Math.max(v.length,m.length);if(D!==P){if("arraydraw"!==a.editType){h();continue}O=!0}for(b=0;b<D;b++)oe(v[b],m[b],y.concat(b),o.extendFlat({inArray:i,arrayIndex:b},n));if(O)for(b=D;b<P;b++)C.push(b)}else!_&&o.isPlainObject(v)?oe(v,m,y,n):w?T&&k?(f&&(u.calc=!0),(f||n.newDataRevision)&&h()):T!==k?u.calc=!0:h():T&&k&&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 le(e){var t=e._fullLayout,r=e.getBoundingClientRect();if(!o.equalDomRects(r,t._lastBBox)){var n=t._invTransform=o.inverseTransformMatrix(o.getFullTransformMatrix(e));t._invScaleX=Math.sqrt(n[0][0]*n[0][0]+n[0][1]*n[0][1]+n[0][2]*n[0][2]),t._invScaleY=Math.sqrt(n[1][0]*n[1][0]+n[1][1]*n[1][1]+n[1][2]*n[1][2]),t._lastBBox=r}}function se(e){var t=n.select(e),r=e._fullLayout;if(r._calcInverseTransform=le,r._calcInverseTransform(e),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("user-select-none",!0).classed("svg-container",!0).style("position","relative"),r._glcontainer=r._paperdiv.selectAll(".gl-container").data([{}]),r._glcontainer.enter().append("div").classed("gl-container",!0),r._paperdiv.selectAll(".main-svg").remove(),r._paperdiv.select(".modebar-container").remove(),r._paper=r._paperdiv.insert("svg",":first-child").classed("main-svg",!0),r._toppaper=r._paperdiv.append("svg").classed("main-svg",!0),r._modebardiv=r._paperdiv.append("div"),delete r._modeBar,r._hoverpaper=r._paperdiv.append("svg").classed("main-svg",!0),!r._uid){var a={};n.selectAll("defs").each((function(){this.id&&(a[this.id.split("-")[1]]=1)})),r._uid=o.randstr(a)}r._paperdiv.selectAll(".main-svg").attr(y.svgAttrs),r._defs=r._paper.append("defs").attr("id","defs-"+r._uid),r._clips=r._defs.append("g").classed("clips",!0),r._topdefs=r._toppaper.append("defs").attr("id","topdefs-"+r._uid),r._topclips=r._topdefs.append("g").classed("clips",!0),r._bgLayer=r._paper.append("g").classed("bglayer",!0),r._draggers=r._paper.append("g").classed("draglayer",!0);var i=r._paper.append("g").classed("layer-below",!0);r._imageLowerLayer=i.append("g").classed("imagelayer",!0),r._shapeLowerLayer=i.append("g").classed("shapelayer",!0),r._cartesianlayer=r._paper.append("g").classed("cartesianlayer",!0),r._polarlayer=r._paper.append("g").classed("polarlayer",!0),r._ternarylayer=r._paper.append("g").classed("ternarylayer",!0),r._geolayer=r._paper.append("g").classed("geolayer",!0),r._funnelarealayer=r._paper.append("g").classed("funnelarealayer",!0),r._pielayer=r._paper.append("g").classed("pielayer",!0),r._treemaplayer=r._paper.append("g").classed("treemaplayer",!0),r._sunburstlayer=r._paper.append("g").classed("sunburstlayer",!0),r._indicatorlayer=r._toppaper.append("g").classed("indicatorlayer",!0),r._glimages=r._paper.append("g").classed("glimages",!0);var 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,T.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=null==t,b=Array.isArray(t);if(!x&&!b&&o.isPlainObject(t))y.push({type:"object",data:m(o.extendFlat({},t))});else 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({},_))})}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 k=-1;for(h=0;h<y.length;h++)if("byname"===(g=y[h]).type&&g.name===w){k=h;break}if(k>0&&k<y.length-1){var M=[];for(h=0;h<y.length;h++)g=y[h],("byname"!==y[h].type||h>k)&&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)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<5&&(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.'),5===L&&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,T=d.modifyFrames,k=[e,b],M=[e,x];return c&&c.add(e,w,k,T,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("undefined"==typeof 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("undefined"==typeof r||Array.isArray(r)||(r=[r]),"undefined"!=typeof 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)})),T.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("undefined"==typeof a)return l=r.redraw(t),c.add(t,u,d,f,p),l;Array.isArray(a)||(a=[a]);try{R(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("undefined"==typeof n)throw new Error("indices must be an integer or array of integers.");for(Array.isArray(n)||(n=[n]),z(t,n,"indices"),(n=P(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){function l(e,t,r){var n,a;if(o.isTypedArray(e))if(r<0){var i=new e.constructor(0),l=I(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]}var s=E(t=o.getGraphDiv(t),n,a,i,l),u=r.redraw(t),f=[t,s.update,a,s.maxPoints];return c.add(t,r.prependTraces,f,e,arguments),u},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(R(t,n,a),n=Array.isArray(n)?n:[n],"undefined"==typeof a)for(a=[],i=0;i<n.length;i++)a.push(-n.length+i);for(a=Array.isArray(a)?a:[a],n=P(n,t.data.length-1),a=P(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){function l(e,t,r){var n,a;if(o.isTypedArray(e))if(r<=0){var i=new e.constructor(0),l=I(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]}var s=E(t=o.getGraphDiv(t),n,a,i,l),u=r.redraw(t),f=[t,s.update,a,s.maxPoints];return c.add(t,r.extendTraces,f,e,arguments),u},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)&&(T.cleanData(t),f?e.data=t:e.data.push.apply(e.data,t),e.empty=!1),e.layout&&!f||(e.layout=T.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||v._shouldCreateBgLayer)&&(se(e),v._shouldCreateBgLayer&&delete v._shouldCreateBgLayer),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),k.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||(k.doAutoRangeAndConstraints(e),f&&h.saveRangeInitial(e),u.getComponentMethod("rangeslider","calcAutorange")(e))}var C=[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,k.layoutStyles],e)}];y&&C.push((function(){if(b)return o.syncOrAsync([u.getComponentMethod("shapes","calcAutorange"),u.getComponentMethod("annotations","calcAutorange"),L],e);L()})),C.push(k.layoutStyles),y&&C.push((function(){return h.draw(e,f?"":"redraw")}),(function(e){e._fullLayout._insideTickLabelsAutorange&&U(e,e._fullLayout._insideTickLabelsAutorange).then((function(){e._fullLayout._insideTickLabelsAutorange=void 0}))})),C.push(k.drawData,k.finalDraw,m,d.addLinks,d.rehover,d.redrag,d.doAutoMargin,(function(e){e._fullLayout._insideTickLabelsAutorange&&f&&h.saveRangeInitial(e,!0)}),d.previousPromises);var O=o.syncOrAsync(C,e);return O&&O.then||(O=Promise.resolve()),O.then((function(){return S(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),T.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||[],T.cleanData(e.data),e.layout=n||{},T.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=te(a,K)){if(i=u.attr||u.head+".uirevision",(c=(s=l(n,i).get())&&re(i,t))&&c===s&&(null===(f=h[a])&&(f=void 0),ie(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(N(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,T=b[_],k=null;for(a in T){if(!k){var M=ne(_,r);if(M<0){delete b[_];break}var A=ae(_,e,(w=r[M]._fullInput).index);if(A<0){delete b[_];break}k=e[A]}if(u=te(a,ee)){if(u.attr?c=(s=l(n,u.attr).get())&&re(u.attr,t):(s=w.uirevision,void 0===(c=k.uirevision)&&(c=t.uirevision)),c&&c===s&&(null===(f=T[a])&&(f=void 0),ie(p=(d=l(k,a)).get(),f))){d.set(N(l(w,a).get()));continue}}else o.warn("unrecognized GUI edit: "+a+" in trace uid "+_);delete T[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();function o(e){return f.getLayoutValObject(r,e)}i.arrays={},i.rangesAltered={},i.nChanges=0,i.nChangesAnim=0,oe(t,r,[],{getValObject:o,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");return 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,oe(t[l]._fullInput,s,[],u)}(c.calc||c.plot)&&(c.fullReplot=!0);a&&c.nChanges&&c.nChangesAnim&&(c.anim=c.nChanges===c.nChangesAnim&&o?"all":"some");return c}(e,c,m,x,b,w);if(Q(e)&&(_.layoutReplot=!0),A.calc||_.calc){e.calcdata=void 0;for(var L=Object.getOwnPropertyNames(y),C=0;C<L.length;C++){var O=L[C],P=O.substring(0,5);if("xaxis"===P||"yaxis"===P){var z=y[O]._emptyCategories;z&&z()}}}else d.supplyDefaultsUpdateCalc(e.calcdata,m);var R=[];if(i&&(e._transitionData={},d.createTransitionData(e),R.push((function(){return r.addFrames(e,i)}))),y.transition&&!g&&(A.anim||_.anim))_.ticks&&R.push(k.doTicksRelayout),d.doCalcdata(e),k.doAutoRangeAndConstraints(e),R.push((function(){return d.transitionFromReact(e,A,_,p)}));else if(A.fullReplot||_.layoutReplot||g)e._fullLayout._skipDefaults=!0,R.push(r.plot);else{for(var E in _.arrays){var I=_.arrays[E];if(I.length){var F=u.getComponentMethod(E,"drawOne");if(F!==o.noop)for(var H=0;H<I.length;H++)F(e,I[H]);else{var B=u.getComponentMethod(E,"draw");if(B===o.noop)throw new Error("cannot draw components: "+E);B(e)}}}R.push(d.previousPromises),A.style&&R.push(k.doTraceStyle),(A.colorbars||_.colorbars)&&R.push(k.doColorBars),_.legend&&R.push(k.doLegend),_.layoutstyle&&R.push(k.layoutStyles),_.axrange&&G(R),_.ticks&&R.push(k.doTicksRelayout),_.modebar&&R.push(k.doModeBar),_.camera&&R.push(k.doCamera),R.push(S)}R.push(d.rehover,d.redrag),(s=o.syncOrAsync(R,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 T.cleanData(e.data),T.cleanLayout(e.layout),e.calcdata=void 0,r.plot(e).then((function(){return e.emit("plotly_redraw"),e}))},r.relayout=U,r.restyle=F,r.setPlotConfig=function(e){return o.extendFlat(_,e)},r.update=J,r._guiRelayout=$(U),r._guiRestyle=$(F),r._guiUpdate=$(J),r._storeDirectGUIEdit=function(e,t,r){for(var n in r){B(n,l(e,n).get(),r[n],t)}}},{"../components/color":82,"../components/drawing":104,"../constants/xmlns_namespaces":190,"../lib":210,"../lib/events":203,"../lib/queue":225,"../lib/svg_text_utils":232,"../plots/cartesian/axes":256,"../plots/cartesian/constants":262,"../plots/cartesian/graph_interact":265,"../plots/cartesian/select":275,"../plots/plots":290,"../plots/polar/legacy":293,"../registry":298,"./edit_types":238,"./helpers":239,"./manage_arrays":241,"./plot_config":243,"./plot_schema":244,"./subroutines":246,d3:16,"fast-isnumeric":18,"has-hover":49}],243:[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}},{}],244:[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","_isLinkedToArray","_arrayAttrRegexps","_deprecated"];function b(e,t,r){if(!e)return!1;if(e._isLinkedToArray)if(_(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(!_(t[++r]))return!1}else if("info_array"===e.valType){var a=t[++r];if(!_(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(!_(o))return!1;e=i[a][o]}else e=i[a]}else e=i}}return e}function _(e){return e===Math.round(e)&&e>=0}function w(){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 M(r,t,"subplot"===t.attr?t.name:t.attr)}for(e in r=function(e){return p(e,{radialaxis:f.radialaxis,angularaxis:f.angularaxis}),p(e,f.layout),e}(r),n.componentsRegistry){var i=(t=n.componentsRegistry[e]).schema;if(i&&(i.subplots||i.layout)){var l=i.subplots;if(l&&l.xaxis&&!l.yaxis)for(var s in l.xaxis)delete r.yaxis[s]}else"colorscale"===t.name?h(r,t.layoutAttributes):t.layoutAttributes&&A(r,t.layoutAttributes,t.name)}return{layoutAttributes:k(r)}}function T(){var e={frames:h({},l)};return k(e),e.frames}function k(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){var n=e._isLinkedToArray;n&&(delete e._isLinkedToArray,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._isSubplotObj=!0,n.set(a)}function A(e,t,r){var n=m(e,r);n.set(h(n.get()||{},t))}r.IS_SUBPLOT_OBJ="_isSubplotObj",r.IS_LINKED_TO_ARRAY="_isLinkedToArray",r.DEPRECATED="_deprecated",r.UNDERSCORE_ATTRS=x,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:k(o)};if(t.layoutAttributes){var f={};h(f,t.layoutAttributes),c.layoutAttributes=k(f)}t.animatable||r.crawl(c,(function(e){r.isValObject(e)&&"anim"in e&&delete e.anim}));return c}(t)}));var t={};return Object.keys(n.transformsRegistry).forEach((function(e){t[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:k(r)}}(e)})),{defs:{valObjects:y,metaKeys:x.concat(["description","role","editType","impliedEdits"]),editType:{traces:d.traces,layout:d.layout},impliedEdits:{}},traces:e,layout:w(),transforms:t,frames:T(),animation:k(s),config:k(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===x.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]],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(!_(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 b(a,t,l)},r.getLayoutValObject=function(e,t){return b(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":210,"../plots/animation_attributes":250,"../plots/attributes":252,"../plots/frame_attributes":285,"../plots/layout_attributes":288,"../plots/polar/legacy/area_attributes":291,"../plots/polar/legacy/axis_attributes":292,"../registry":298,"./edit_types":238,"./plot_config":243}],245:[function(e,t,r){"use strict";var n=e("../lib"),a=e("../plots/attributes"),i={name:{valType:"string",editType:"none"}};function o(e){return e&&"string"==typeof e}function l(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"}i.templateitemname={valType:"string",editType:"calc"},r.templatedArray=function(e,t){return t._isLinkedToArray=e,t.name=i.name,t.templateitemname=i.templateitemname,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[l(t)],i=n&&n[t];Array.isArray(i)&&i.length||(i=[]);var s={};return{newItem:function(e){var t={name:e.name,_input:e},n=t.templateitemname=e.templateitemname;if(!o(n))return t._template=a,t;for(var l=0;l<i.length;l++){var c=i[l];if(c.name===n)return s[n]=1,t._template=c,t}return t[r]=e[r]||!1,t._template=!1,t},defaultItems:function(){for(var e=[],t=0;t<i.length;t++){var r=i[t],n=r.name;if(o(n)&&!s[n]){var a={_template:r,name:n,_input:{_templateitemname:n}};a.templateitemname=r.templateitemname,e.push(a),s[n]=1}}return e}}},r.arrayDefaultKey=l,r.arrayEditor=function(e,t,r){var a=(n.nestedProperty(e,t).get()||[]).length,i=r._index,o=i>=a&&(r._input||{})._templateitemname;o&&(i=a);var l,s=t+"["+i+"]";function c(){l={},o&&(l[s]={},l[s].templateitemname=o)}function u(e,t){o?n.nestedProperty(l[s],e).set(t):l[s+"."+e]=t}function f(){var e=l;return c(),e}return c(),{modifyBase:function(e,t){l[e]=t},modifyItem:u,getUpdateObj:f,applyUpdate:function(t,r){t&&u(t,r);var a=f();for(var i in a)n.nestedProperty(e,i).set(a[i])}}}},{"../lib":210,"../plots/attributes":252}],246:[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;function y(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 x(e){var t,a,l,u,h,g,v=e._fullLayout,m=v._size,x=m.p,_=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 T(e,t,r){var n=e._lw/2;return"x"===e._id.charAt(0)?t?"top"===r?t._offset-x-n:t._offset+t._length+x+n:m.t+m.h*(1-(e.position||0))+n%1:t?"right"===r?t._offset+t._length+x+n:t._offset-x-n:m.l+m.w*(e.position||0)+n%1}for(t=0;t<_.length;t++){var k=(u=_[t])._anchorAxis;u._linepositions={},u._lw=c.crispRound(e,u.linewidth,1),u._mainLinePosition=T(u,k,u.side),u._mainMirrorPosition=u.mirror&&k?T(u,k,p.OPPOSITE_SIDE[u.side]):null}var M=[],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,D=l.plotgroup;if(y(C,O,L)){var P=D.node(),z=l.bg=o.ensureSingle(D,"rect","bg");P.insertBefore(z.node(),P.childNodes[0]),A.push(a)}else D.select("rect.bg").remove(),L.push([C,O]),S||(M.push(a),A.push(a))}var R,E,I,F,N,H,B,j,V,U,q,G,Z,Y=v._bgLayer.selectAll(".bg").data(M);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&&void 0!==h._offset&&void 0!==g._offset&&l.bg.call(c.setRect,h._offset-x,g._offset-x,h._length+2*x,g._length+2*x).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,Q=l.clipId="clip"+v._uid+a+"plot",J=o.ensureSingleById(v._clips,"clipPath",Q,(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=Q):(X=Q,W=null),c.setClipUrl(l.plot,X,e),l.layerClipId=W}function $(e){return"M"+R+","+e+"H"+E}function K(e){return"M"+h._offset+","+e+"h"+h._length}function ee(e){return"M"+e+","+j+"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";b(h,a)&&(N=w(h,"left",g,_),R=h._offset-(N?x+N:0),H=w(h,"right",g,_),E=h._offset+h._length+(H?x+H:0),I=T(h,g,"bottom"),F=T(h,g,"top"),!(Z=!h._anchorAxis||a!==h._mainSubplot)||"allticks"!==h.mirror&&"all"!==h.mirror||(h._linepositions[a]=[I,F]),ne=re(h,$,K),Z&&h.showline&&("all"===h.mirror||"allticks"===h.mirror)&&(ne+=$(I)+$(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";b(g,a)&&(q=w(g,"bottom",h,_),B=g._offset+g._length+(q?x:0),G=w(g,"top",h,_),j=g._offset-(G?x:0),V=T(g,h,"left"),U=T(g,h,"right"),!(Z=!g._anchorAxis||a!==g._mainSubplot)||"allticks"!==g.mirror&&"all"!==g.mirror||(g._linepositions[a]=[V,U]),ae=re(g,ee,te),Z&&g.showline&&("all"===g.mirror||"allticks"===g.mirror)&&(ae+=ee(V)+ee(U)),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 b(e,t){return(e.ticks||e.showline)&&(t===e._mainSubplot||"all"===e.mirror||"allticks"===e.mirror)}function _(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 w(e,t,r,n){if(_(e,t,r))return r._lw;for(var a=0;a<n.length;a++){var i=n[a];if(i._mainAxis===r._mainAxis&&_(e,t,i))return i._lw}return 0}function T(e,t){var r=e.title,n=e._size,a=0;switch("start"===t?a=r.pad.l:"end"===t&&(a=-r.pad.r),r.xref){case"paper":return n.l+n.w*r.x+a;case"container":default:return e.width*r.x+a}}function k(e,t){var r=e.title,n=e._size,a=0;if("0em"!==t&&t?t===p.CAP_SHIFT+"em"&&(a=r.pad.t):a=-r.pad.b,"auto"===r.y)return n.t/2;switch(r.yref){case"paper":return n.t+n.h-n.h*r.y+a;case"container":default:return e.height-e.height*r.y+a}}r.layoutStyles=function(e){return o.syncOrAsync([i.doAutoMargin,x],e)},r.drawMainTitle=function(e){var t=e._fullLayout,r=function(e){var t=e.title,r="middle";o.isRightAnchor(t)?r="end":o.isLeftAnchor(t)&&(r="start");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:T(t,r),y:k(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=d.list(e,"",!0),n={},a=0;a<r.length;a++)if(!n[(t=r[a])._id]){n[t._id]=1,v(e,t),m(e,t);var i=t._matchGroup;if(i)for(var o in i){var l=d.getFromId(e,o);m(e,l,t.range),n[o]=1}}g(e)},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":82,"../components/drawing":104,"../components/modebar":142,"../components/titles":177,"../constants/alignment":184,"../lib":210,"../lib/clear_gl_canvases":198,"../plots/cartesian/autorange":255,"../plots/cartesian/axes":256,"../plots/cartesian/constraints":263,"../plots/plots":290,"../registry":298,d3:16}],247:[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],p=g(e,c,i),h=g(e,c,o),v=r(h);if(!v){var m=f(c);m!==c&&(v=r(h=g(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,p,h);else if(v._isLinkedToArray&&Array.isArray(u))for(var y=!1,x=0,b={},_=0;_<u.length;_++){var w=u[_];if(a(w)){var T=w.name;if(T)b[T]||(d(w,t,r,g(u,x,p),g(u,x,h)),x++,b[T]=1);else if(!y){var k=g(e,s.arrayDefaultKey(c),i),M=g(u,x,p);d(w,t,r,M,g(u,x,h));var A=n.nestedProperty(t,M);n.nestedProperty(t,k).set(A.get()),A.set(null),y=!0}}}else{n.nestedProperty(t,p).set(u)}}}function p(e,t){return i.getLayoutValObject(e,n.nestedProperty({},t).parts)}function h(e,t){return i.getTraceValObject(e,n.nestedProperty({},t).parts)}function g(e,t,r){return r?Array.isArray(e)?r+"["+t+"]":r+"."+t:t}function v(e){for(var t=0;t<e.length;t++)if(a(e[t]))return!0}function m(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 i={data:{},layout:{}};t.forEach((function(e){var t={};d(e,t,h.bind(null,e));var r=n.coerce(e,{},l,"type"),a=i.data[r];a||(a=i.data[r]=[]),a.push(t)})),d(r,i.layout,p.bind(null,r)),delete i.layout.template;var s=r.template;if(a(s)){var f,g,v,m,y,x,b=s.layout;a(b)&&u(b,i.layout);var _=s.data;if(a(_)){for(g in i.data)if(v=_[g],Array.isArray(v)){for(x=(y=i.data[g]).length,m=v.length,f=0;f<x;f++)u(v[f%m],y[f]);for(f=x;f<m;f++)y.push(n.extendDeep({},v[f]))}for(g in _)g in i.data||(i.data[g]=n.extendDeep([],_[g]))}}return i},r.validateTemplate=function(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,p=r._fullData,h={};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(g(t,n,r[i])),o!==n&&l.push(g(t,o,r[i]));for(i=0;i<l.length;i++)h[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=g(t,n,r);h[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<p.length;b++){var _=p[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,T=x[y]||0;w>T?u.push({code:"unused",traceType:y,templateCount:w,dataCount:T}):T>w&&u.push({code:"reused",traceType:y,templateCount:w,dataCount:T})}}else u.push({code:"data"});if(function e(t,r){for(var n in t)if("_"!==n.charAt(0)){var i=t[n],o=g(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)&&v(i)&&e(i,o)}}({data:p,layout:d},""),u.length)return u.map(m)}},{"../lib":210,"../plots/attributes":252,"../plots/plots":290,"./plot_config":243,"./plot_schema":244,"./plot_template":245}],248:[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("Export format is not "+o.join2(f.format.values,", "," or ")+".");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"),T=m("imageDataOnly"),k=document.createElement("div");k.style.position="absolute",k.style.left="-5000px",document.body.appendChild(k);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(k);function S(){return new Promise((function(e){setTimeout(e,l.getDelay(k._fullLayout))}))}function C(){return new Promise((function(e,t){var r=s(k,y,_),n=k._fullLayout.width,f=k._fullLayout.height;function d(){a.purge(k),document.body.removeChild(k)}if("full-json"===y){var p=i.graphJson(k,!1,"keepdata","object",!0,!0);return p.version=u,p=JSON.stringify(p),d(),e(T?p:l.encodeJSON(p))}if(d(),"svg"===y)return e(T?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(k,r,M,A).then(L).then(S).then(C).then((function(t){e(function(e){return T?e.replace(l.IMAGE_URL_PREFIX,""):e}(t))})).catch((function(e){t(e)}))}))}},{"../lib":210,"../plots/plots":290,"../snapshot/helpers":302,"../snapshot/svgtoimg":304,"../snapshot/tosvg":306,"../version":439,"./plot_api":242,"fast-isnumeric":18}],249:[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 p=f[d];if("transforms"!==p){var m=o.slice();m.push(p);var y=e[p],x=t[p],b=v(r,p),_=(b||{}).valType,w="info_array"===_,T="colorscale"===_,k=(b||{}).items;if(g(r,p))if(l(y)&&l(x)&&"any"!==_)u(y,x,b,a,i,m);else if(w&&s(y)){y.length>x.length&&a.push(h("unused",i,m.concat(x.length)));var M,A,L,S,C,O=x.length,D=Array.isArray(k);if(D&&(O=Math.min(O,k.length)),2===b.dimensions)for(A=0;A<O;A++)if(s(y[A])){y[A].length>x[A].length&&a.push(h("unused",i,m.concat(A,x[A].length)));var P=x[A].length;for(M=0;M<(D?Math.min(P,k[A].length):P);M++)L=D?k[A][M]:k,S=y[A][M],C=x[A][M],n.validate(S,L)?C!==S&&C!==+S&&a.push(h("dynamic",i,m.concat(A,M),S,C)):a.push(h("value",i,m.concat(A,M),S))}else a.push(h("array",i,m.concat(A),y[A]));else for(A=0;A<O;A++)L=D?k[A]:k,S=y[A],C=x[A],n.validate(S,L)?C!==S&&C!==+S&&a.push(h("dynamic",i,m.concat(A),S,C)):a.push(h("value",i,m.concat(A),S))}else if(b.items&&!w&&s(y)){var z,R,E=k[Object.keys(k)[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],H=x[z];l(N)&&!1!==N.visible&&!1===H.visible?a.push(h("invisible",i,R)):u(N,H,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(h("unused",i,R)):a.push(h("object",i,R,y[z]))}else!l(y)&&l(x)?a.push(h("object",i,m,y)):c(y)||!c(x)||w||T?p in t?n.validate(y,b)?"enumerated"===b.valType&&(b.coerceNumber&&y!==+x||y!==x)&&a.push(h("dynamic",i,m,y,x)):a.push(h("value",i,m,y)):a.push(h("unused",i,m,y)):a.push(h("array",i,m,y));else a.push(h("schema",i,m))}}return a}function f(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}t.exports=function(e,t){void 0===e&&(e=[]),void 0===t&&(t={});var r,c,d=i.get(),p=[],g={_context:n.extendFlat({},o)};s(e)?(g.data=n.extendDeep([],e),r=e):(g.data=[],r=[],p.push(h("array","data"))),l(t)?(g.layout=n.extendDeep({},t),c=t):(g.layout={},c={},arguments.length>1&&p.push(h("object","layout"))),a.supplyDefaults(g);for(var v=g._fullData,m=r.length,y=0;y<m;y++){var x=r[y],b=["data",y];if(l(x)){var _=v[y],w=_.type,T=d.traces[w].attributes;T.type={valType:"enumerated",values:[w]},!1===_.visible&&!1!==x.visible&&p.push(h("invisible",b)),u(x,_,T,p,b);var k=x.transforms,M=_.transforms;if(k){s(k)||p.push(h("array",b,["transforms"])),b.push("transforms");for(var A=0;A<k.length;A++){var L=["transforms",A],S=k[A].type;if(l(k[A])){var C=d.transforms[S]?d.transforms[S].attributes:{};C.type={valType:"enumerated",values:Object.keys(d.transforms)},u(k[A],M[A],C,p,b,L)}else p.push(h("object",b,L))}}}else p.push(h("object",b))}var O=g._fullLayout,D=f(d,v);return u(c,O,D,p,"layout"),0===p.length?void 0:p};var d={object:function(e,t){return("layout"===e&&""===t?"The layout argument":"data"===e[0]&&""===t?"Trace "+e[1]+" in the data argument":p(e)+"key "+t)+" must be linked to an object container"},array:function(e,t){return("data"===e?"The data argument":p(e)+"key "+t)+" must be linked to an array container"},schema:function(e,t){return p(e)+"key "+t+" is not part of the schema"},unused:function(e,t,r){var n=l(r)?"container":"key";return p(e)+n+" "+t+" did not get coerced"},dynamic:function(e,t,r,n){return[p(e)+"key",t,"(set to '"+r+"')","got reset to","'"+n+"'","during defaults."].join(" ")},invisible:function(e,t){return(t?p(e)+"item "+t:"Trace "+e[1])+" got defaulted to be not visible"},value:function(e,t,r){return[p(e)+"key "+t,"is set to an invalid value ("+r+")"].join(" ")}};function p(e){return s(e)?"In data trace "+e[1]+", ":"In "+e+", "}function h(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=d[e](t,c,a,i);return n.log(u),{code:e,container:o,trace:l,path:r,astr:c,msg:u}}function g(e,t){var r=y(t),n=r.keyMinusId,a=r.id;return!!(n in e&&e[n]._isSubplotObj&&a)||t in e}function v(e,t){return t in e?e[t]:e[y(t).keyMinusId]}var m=n.counterRegex("([a-z]+)");function y(e){var t=e.match(m);return{keyMinusId:t&&t[1],id:t&&t[2]}}},{"../lib":210,"../plots/plots":290,"./plot_config":243,"./plot_schema":244}],250:[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"}}}},{}],251:[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":210,"../plot_api/plot_template":245}],252:[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":113}],253:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("../../lib"),i=a.dateTime2ms,o=a.incrementMonth,l=e("../../constants/numerical").ONEAVGMONTH;t.exports=function(e,t,r,a){if("date"!==t.type)return a;var s=e[r+"periodalignment"];if(!s)return a;var c,u=e[r+"period"];if(n(u)){if((u=+u)<=0)return a}else if("string"==typeof u&&"M"===u.charAt(0)){var f=+u.substring(1);if(!(f>0&&Math.round(f)===f))return a;c=f}for(var d=t.calendar,p="start"===s,h="end"===s,g=e[r+"period0"],v=i(g,d)||0,m=[],y=a.length,x=0;x<y;x++){var b,_,w,T=a[x];if(c){for(b=Math.round((T-v)/(c*l)),w=o(v,c*b,d);w>T;)w=o(w,-c,d);for(;w<=T;)w=o(w,c,d);_=o(w,-c,d)}else{for(w=v+(b=Math.round((T-v)/u))*u;w>T;)w-=u;for(;w<=T;)w+=u;_=w-u}m[x]=p?_:h?w:(_+w)/2}return m}},{"../../constants/numerical":189,"../../lib":210,"fast-isnumeric":18}],254:[function(e,t,r){"use strict";t.exports={xaxis:{valType:"subplotid",dflt:"x",editType:"calc+clearAxisTypes"},yaxis:{valType:"subplotid",dflt:"y",editType:"calc+clearAxisTypes"}}},{}],255:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("../../lib"),i=e("../../constants/numerical").FP_SAFE,o=e("../../registry"),l=e("./axis_ids"),s=l.getFromId,c=l.isLinked;function u(e,t){var r,n,i=[],o=e._fullLayout,l=d(o,t,0),s=d(o,t,1),c=p(e,t),u=c.min,h=c.max;if(0===u.length||0===h.length)return a.simpleMap(t.range,t.r2l);var g=u[0].val,v=h[0].val;for(r=1;r<u.length&&g===v;r++)g=Math.min(g,u[r].val);for(r=1;r<h.length&&g===v;r++)v=Math.max(v,h[r].val);var m=!1;if(t.range){var y=a.simpleMap(t.range,t.r2l);m=y[1]<y[0]}"reversed"===t.autorange&&(m=!0,t.autorange=!0);var x,b,_,w,T,k,M=t.rangemode,A="tozero"===M,L="nonnegative"===M,S=t._length,C=S/10,O=0;for(r=0;r<u.length;r++)for(x=u[r],n=0;n<h.length;n++)(k=(b=h[n]).val-x.val-f(t,x.val,b.val))>0&&((T=S-l(x)-s(b))>C?k/T>O&&(_=x,w=b,O=k/T):k/S>O&&(_={val:x.val,nopad:1},w={val:b.val,nopad:1},O=k/S));if(g===v){var D=g-1,P=g+1;if(A)if(0===g)i=[0,1];else{var z=(g>0?h:u).reduce((function(e,t){return Math.max(e,s(t))}),0),R=g/(1-Math.min(.5,z/S));i=g>0?[0,R]:[R,0]}else i=L?[Math.max(0,D),Math.max(1,P)]:[D,P]}else A?(_.val>=0&&(_={val:0,nopad:1}),w.val<=0&&(w={val:0,nopad:1})):L&&(_.val-O*l(_)<0&&(_={val:0,nopad:1}),w.val<=0&&(w={val:1,nopad:1})),O=(w.val-_.val-f(t,x.val,b.val))/(S-l(_)-s(w)),i=[_.val-O*l(_),w.val+O*s(w)];return m&&i.reverse(),a.simpleMap(i,t.l2r||Number)}function f(e,t,r){var n=0;if(e.rangebreaks)for(var a=e.locateBreaks(t,r),i=0;i<a.length;i++){var o=a[i];n+=o.max-o.min}return n}function d(e,t,r){var n=.05*t._length,i=t._anchorAxis||{};if(-1!==(t.ticklabelposition||"").indexOf("inside")||-1!==(i.ticklabelposition||"").indexOf("inside")){var o="reversed"===t.autorange;if(!o){var l=a.simpleMap(t.range,t.r2l);o=l[1]<l[0]}o&&(r=!r)}var s=0;return c(e,t._id)||(s=function(e,t){var r=0,n=e._anchorAxis||{};if(-1!==(n.ticklabelposition||"").indexOf("inside")&&(!t&&("left"===n.side||"bottom"===n.side)||t&&("top"===n.side||"right"===n.side))){var i="x"===e._id.charAt(0);if(n._vals){var o=a.deg2rad(n._tickAngles[n._id+"tick"]||0),l=Math.abs(Math.cos(o)),s=Math.abs(Math.sin(o));n._vals.forEach((function(e){if(e.bb){var t=6+e.bb.width,n=6+e.bb.height;r=Math.max(r,i?Math.max(t*l,n*s):Math.max(n*l,t*s))}}))}"inside"===n.ticks&&"inside"===n.ticklabelposition&&(r+=n.ticklen||0)}return r}(t,r)),n=Math.max(s,n),"domain"===t.constrain&&t._inputDomain&&(n*=(t._inputDomain[1]-t._inputDomain[0])/(t.domain[1]-t.domain[0])),function(e){return e.nopad?0:e.pad+(e.extrapad?n:s)}}t.exports={getAutoRange:u,makePadFn:d,doAutoRange:function(e,t,r){if(t.setScale(),t.autorange){t.range=r?r.slice():u(e,t),t._r=t.range.slice(),t._rl=a.simpleMap(t._r,t.r2l);var n=t._input,i={};i[t._attr+".range"]=t.range,i[t._attr+".autorange"]=t.autorange,o.call("_storeDirectGUIEdit",e.layout,e._fullLayout._preGUI,i),n.range=t.range.slice(),n.autorange=t.autorange}var l=t._anchorAxis;if(l&&l.rangeslider){var s=l.rangeslider[t._name];s&&"auto"===s.rangemode&&(s.range=u(e,t)),l._input.rangeslider[t._name]=a.extendFlat({},s)}},findExtremes:function(e,t,r){r||(r={});e._m||e.setScale();var a,o,l,s,c,u,f,d,p,v=[],y=[],x=t.length,b=r.padded||!1,_=r.tozero&&("linear"===e.type||"-"===e.type),w="log"===e.type,T=!1,k=r.vpadLinearized||!1;function M(e){if(Array.isArray(e))return T=!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(!T){if(d=1/0,p=-1/0,w)for(a=0;a<x;a++)(o=t[a])<d&&o>0&&(d=o),o>p&&o<i&&(p=o);else for(a=0;a<x;a++)(o=t[a])<d&&o>-i&&(d=o),o>p&&o<i&&(p=o);t=[d,p],x=2}var O={tozero:_,extrapad:b};function D(r){l=t[r],n(l)&&(u=A(r),f=L(r),k?(s=e.c2l(l)-C(r),c=e.c2l(l)+S(r)):(d=l-C(r),p=l+S(r),w&&d<p/10&&(d=p/10),s=e.c2l(d),c=e.c2l(p)),_&&(s=Math.min(0,s),c=Math.max(0,c)),m(s)&&h(v,s,f,O),m(c)&&g(y,c,u,O))}var P=Math.min(6,x);for(a=0;a<P;a++)D(a);for(a=x-1;a>=P;a--)D(a);return{min:v,max:y,opts:r}},concatExtremes:p};function p(e,t,r){var n,a,i,o=t._id,l=e._fullData,c=e._fullLayout,u=[],f=[];function d(e,t){for(n=0;n<t.length;n++){var r=e[t[n]],l=(r._extremes||{})[o];if(!0===r.visible&&l){for(a=0;a<l.min.length;a++)i=l.min[a],h(u,i.val,i.pad,{extrapad:i.extrapad});for(a=0;a<l.max.length;a++)i=l.max[a],g(f,i.val,i.pad,{extrapad:i.extrapad})}}}if(d(l,t._traceIndices),d(c.annotations||[],t._annIndices||[]),d(c.shapes||[],t._shapeIndices||[]),t._matchGroup&&!r)for(var v in t._matchGroup)if(v!==t._id){var m=s(e,v),y=p(e,m,!0),x=t._length/m._length;for(a=0;a<y.min.length;a++)i=y.min[a],h(u,i.val,i.pad*x,{extrapad:i.extrapad});for(a=0;a<y.max.length;a++)i=y.max[a],g(f,i.val,i.pad*x,{extrapad:i.extrapad})}return{min:u,max:f}}function h(e,t,r,n){v(e,t,r,n,y)}function g(e,t,r,n){v(e,t,r,n,x)}function v(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 m(e){return n(e)&&Math.abs(e)<i}function y(e,t){return e<=t}function x(e,t){return e>=t}},{"../../constants/numerical":189,"../../lib":210,"../../registry":298,"./axis_ids":259,"fast-isnumeric":18}],256:[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=l.strTranslate,c=e("../../lib/svg_text_utils"),u=e("../../components/titles"),f=e("../../components/color"),d=e("../../components/drawing"),p=e("./layout_attributes"),h=e("./clean_ticks"),g=e("../../constants/numerical"),v=g.ONEMAXYEAR,m=g.ONEAVGYEAR,y=g.ONEMINYEAR,x=g.ONEMAXQUARTER,b=g.ONEAVGQUARTER,_=g.ONEMINQUARTER,w=g.ONEMAXMONTH,T=g.ONEAVGMONTH,k=g.ONEMINMONTH,M=g.ONEWEEK,A=g.ONEDAY,L=A/2,S=g.ONEHOUR,C=g.ONEMIN,O=g.ONESEC,D=g.MINUS_SIGN,P=g.BADNUM,z=e("../../constants/alignment"),R=z.MID_SHIFT,E=z.CAP_SHIFT,I=z.LINE_SPACING,F=z.OPPOSITE_SIDE,N=t.exports={};N.setConvert=e("./set_convert");var H=e("./axis_autotype"),B=e("./axis_ids"),j=B.idSort,V=B.isLinked;N.id2name=B.id2name,N.name2id=B.name2id,N.cleanId=B.cleanId,N.list=B.list,N.listIds=B.listIds,N.getFromId=B.getFromId,N.getFromTrace=B.getFromTrace;var U=e("./autorange");N.getAutoRange=U.getAutoRange,N.findExtremes=U.findExtremes;function q(e){var t=1e-4*(e[1]-e[0]);return[e[0]-t,e[1]+t]}N.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]||("string"==typeof i?i:i[0])),i||(i=a),s=s.concat(s.map((function(e){return e+" domain"}))),u[c]={valType:"enumerated",values:s.concat(i?"string"==typeof i?[i]:i:[]),dflt:a},l.coerce(e,t,u,c)},N.getRefType=function(e){return void 0===e?e:"paper"===e?"paper":"pixel"===e?"pixel":/( domain)$/.test(e)?"domain":"range"},N.coercePosition=function(e,t,r,n,a,i){var o,s;if("range"!==N.getRefType(n))o=l.ensureNumber,s=r(a,i);else{var c=N.getFromId(t,n);s=r(a,i=c.fraction2r(i)),o=c.cleanPos}e[a]=o(s)},N.cleanPosition=function(e,t,r){return("paper"===r||"pixel"===r?l.ensureNumber:N.getFromId(t,r).cleanPos)(e)},N.redrawComponents=function(e,t){t=t||N.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[N.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 G=N.getDataConversions=function(e,t,r,n){var a,i="x"===r||"y"===r||"z"===r?r:n;if(Array.isArray(i)){if(a={type:H(n,void 0,{autotypenumbers:e._fullLayout.autotypenumbers}),_categories:[]},N.setConvert(a),"category"===a.type)for(var o=0;o<n.length;o++)a.d2c(n[o])}else a=N.getFromTrace(e,t,i);return a?{d2c:a.d2c,c2d:a.c2d}:"ids"===i?{d2c:Y,c2d:Y}:{d2c:Z,c2d:Z}};function Z(e){return+e}function Y(e){return String(e)}function X(e){return+e.substring(1)}N.getDataToCoordFunc=function(e,t,r,n){return G(e,t,r,n).d2c},N.counterLetter=function(e){var t=e.charAt(0);return"x"===t?"y":"y"===t?"x":void 0},N.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},N.saveRangeInitial=function(e,t){for(var r=N.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},N.saveShowSpikeInitial=function(e,t){for(var r=N.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},N.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},N.setConvert(s),o=o&&h.dtick(o,s.type))s.dtick=o,s.tick0=h.tick0(void 0,s.type,i);else{var f;if(r)f=(u-c)/r;else{var d=l.distinctVals(e),p=Math.pow(10,Math.floor(Math.log(d.minDiff)/Math.LN10)),g=p*l.roundUp(d.minDiff/p,[.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)}N.autoTicks(s,f)}var v,m=s.dtick,y=N.tickIncrement(N.tickFirst(s),m,"reverse",i);if("number"==typeof m)v=(y=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}(y,e,s,c,u))+(1+Math.floor((u-y)/m))*m;else for("M"===s.dtick.charAt(0)&&(y=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=N.tickIncrement(e,"M6","reverse")+1.5*A:i.exactMonths>.8?e=N.tickIncrement(e,"M1","reverse")+15.5*A:e-=L;var s=N.tickIncrement(e,r);if(s<=n)return s}return e}(y,e,m,c,i)),v=y,0;v<=u;)v=N.tickIncrement(v,m,!1,i);return{start:t.c2r(y,0,i),end:t.c2r(v,0,i),size:m,_dataSpan:u-c}},N.prepTicks=function(e,t){var r=l.simpleMap(e.range,e.r2l,void 0,void 0,t);if(e._dtickInit=e.dtick,e._tick0Init=e.tick0,"auto"===e.tickmode||!e.dtick){var n,i=e.nticks;i||("category"===e.type||"multicategory"===e.type?(n=e.tickfont?1.2*(e.tickfont.size||12):15,i=e._length/n):(n="y"===e._id.charAt(0)?40:80,i=l.constrain(e._length/n,4,9)+1),"radialaxis"===e._name&&(i*=2)),"array"===e.tickmode&&(i*=100),e._roughDTick=Math.abs(r[1]-r[0])/i,N.autoTicks(e,e._roughDTick),e._minDtick>0&&e.dtick<2*e._minDtick&&(e.dtick=e._minDtick,e.tick0=e.l2r(e._forceTick0))}"period"===e.ticklabelmode&&function(e){var t;function r(){return!(a(e.dtick)||"M"!==e.dtick.charAt(0))}var n=r(),i=N.getTickFormat(e);if(i){var o=e._dtickInit!==e.dtick;/%[fLQsSMX]/.test(i)||(/%[HI]/.test(i)?(t=S,o&&!n&&e.dtick<S&&(e.dtick=S)):/%p/.test(i)?(t=L,o&&!n&&e.dtick<L&&(e.dtick=L)):/%[Aadejuwx]/.test(i)?(t=A,o&&!n&&e.dtick<A&&(e.dtick=A)):/%[UVW]/.test(i)?(t=M,o&&!n&&e.dtick<M&&(e.dtick=M)):/%[Bbm]/.test(i)?(t=T,o&&(n?X(e.dtick)<1:e.dtick<k)&&(e.dtick="M1")):/%[q]/.test(i)?(t=b,o&&(n?X(e.dtick)<3:e.dtick<_)&&(e.dtick="M3")):/%[Yy]/.test(i)&&(t=m,o&&(n?X(e.dtick)<12:e.dtick<y)&&(e.dtick="M12")))}(n=r())&&e.tick0===e._dowTick0&&(e.tick0=e._rawTick0);e._definedDelta=t}(e),e.tick0||(e.tick0="date"===e.type?"2000-01-01":0),"date"===e.type&&e.dtick<.1&&(e.dtick=.1),ne(e)},N.calcTicks=function(e,t){N.prepTicks(e,t);var r=l.simpleMap(e.range,e.r2l,void 0,void 0,t);if("array"===e.tickmode)return function(e){var t=e.tickvals,r=e.ticktext,n=new Array(t.length),a=q(l.simpleMap(e.range,e.r2l)),i=Math.min(a[0],a[1]),o=Math.max(a[0],a[1]),s=0;Array.isArray(r)||(r=[]);var c="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 u=0;u<t.length;u++){var f=c(t[u]);f>i&&f<o&&(void 0===r[u]?n[s]=N.tickText(e,f):n[s]=ae(e,f,String(r[u])),s++)}s<t.length&&n.splice(s,t.length-s);e.rangebreaks&&(n=n.filter((function(t){return e.maskBreaks(t.x)!==P})));return n}(e);var n=q(r),i=n[0],o=n[1],s=r[1]<r[0],c=Math.min(r[0],r[1]),u=Math.max(r[0],r[1]),f="log"===e.type&&!(a(e.dtick)||"L"===e.dtick.charAt(0)),d="period"===e.ticklabelmode;if(e._tmin=N.tickFirst(e,t),e._tmin<i!==s)return[];"category"!==e.type&&"multicategory"!==e.type||(o=s?Math.max(-.5,o):Math.min(e._categories.length-.5,o));var p=e._tmin;e.rangebreaks&&e._tick0Init!==e.tick0&&(p=we(p,e),s||(p=N.tickIncrement(p,e.dtick,!s,e.calendar))),d&&(p=N.tickIncrement(p,e.dtick,!s,e.calendar));for(var h,g=Math.max(1e3,e._length||0),C=[],O=null;s?p>=o:p<=o;p=N.tickIncrement(p,e.dtick,s,e.calendar)){if(e.rangebreaks&&!s){if(p<i)continue;if(e.maskBreaks(p)===P&&we(p,e)>=u)break}if(C.length>g||p===O)break;O=p;var D=!1;f&&p!==(0|p)&&(D=!0),C.push({minor:D,value:p})}if(d&&function(e,t,r){for(var n=0;n<e.length;n++){var a=e[n].value,i=n,o=n+1;n<e.length-1?(i=n,o=n+1):n>0?(i=n-1,o=n):(i=n,o=n);var l,s=e[i].value,c=e[o].value,u=Math.abs(c-s),f=r||u,d=0;f>=y?d=u>=y&&u<=v?u:m:r===b&&f>=_?d=u>=_&&u<=x?u:b:f>=k?d=u>=k&&u<=w?u:T:r===M&&f>=M?d=M:f>=A?d=A:r===L&&f>=L?d=L:r===S&&f>=S&&(d=S),d>=u&&(d=u,l=!0);var p=a+d;if(t.rangebreaks&&d>0){for(var h=0,g=0;g<84;g++){var C=(g+.5)/84;t.maskBreaks(a*(1-C)+C*p)!==P&&h++}(d*=h/84)||(e[n].drop=!0),l&&u>M&&(d=u)}(d>0||0===n)&&(e[n].periodX=a+d/2)}}(C,e,e._definedDelta),e.rangebreaks){var z="y"===e._id.charAt(0),R=1;"auto"===e.tickmode&&(R=e.tickfont?e.tickfont.size:12);var E=NaN;for(h=C.length-1;h>-1;h--)if(C[h].drop)C.splice(h,1);else{C[h].value=we(C[h].value,e);var I=e.c2p(C[h].value);(z?E>I-R:E<I+R)?C.splice(s?h+1:h,1):E=I}}_e(e)&&360===Math.abs(r[1]-r[0])&&C.pop(),e._tmax=(C[C.length-1]||{}).value,e._prevDateHead="",e._inCalcTicks=!0;var F,H,B=[];for(h=0;h<C.length;h++){var j=C[h].minor,V=C[h].value;F=N.tickText(e,V,!1,j),void 0!==(H=C[h].periodX)&&(F.periodX=H,(H>u||H<c)&&(H>u&&(F.periodX=u),H<c&&(F.periodX=c),F.text=" ",e._prevDateHead="")),B.push(F)}return e._inCalcTicks=!1,B};var W=[2,5,10],Q=[1,2,3,6,12],J=[1,2,5,10,15,30],$=[1,2,3,7,14],K=[-.046,0,.301,.477,.602,.699,.778,.845,.903,.954,1],ee=[-.301,0,.301,.699,1],te=[15,30,45,90,180];function re(e,t,r){return t*l.roundUp(e/t,r)}function ne(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>=A&&i<=10||t>=15*A)e._tickround="d";else if(t>=C&&i<=16||t>=S)e._tickround="M";else if(t>=O&&i<=19||t>=C)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),u=void 0===e.minexponent?3:e.minexponent;Math.abs(c)>u&&(oe(e.exponentformat)&&!le(c)?e._tickexponent=3*Math.round((c-1)/3):e._tickexponent=c)}else e._tickround=null}function ae(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}}N.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,0);var i=2*t;if(i>m)t/=m,r=n(10),e.dtick="M"+12*re(t,r,W);else if(i>T)t/=T,e.dtick="M"+re(t,1,Q);else if(i>A){e.dtick=re(t,A,e._hasDayOfWeekBreaks?[1,2,7,14]:$);var o=N.getTickFormat(e),s="period"===e.ticklabelmode;s&&(e._rawTick0=e.tick0),/%[uVW]/.test(o)?e.tick0=l.dateTick0(e.calendar,2):e.tick0=l.dateTick0(e.calendar,1),s&&(e._dowTick0=e.tick0)}else i>S?e.dtick=re(t,S,Q):i>C?e.dtick=re(t,C,J):i>O?e.dtick=re(t,O,J):(r=n(10),e.dtick=re(t,r,W))}else if("log"===e.type){e.tick0=0;var c=l.simpleMap(e.range,e.r2l);if(t>.7)e.dtick=Math.ceil(t);else if(Math.abs(c[1]-c[0])<1){var u=1.5*Math.abs((c[1]-c[0])/t);t=Math.abs(Math.pow(10,c[1])-Math.pow(10,c[0]))/u,r=n(10),e.dtick="L"+re(t,r,W)}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))):_e(e)?(e.tick0=0,r=1,e.dtick=re(t,r,te)):(e.tick0=0,r=n(10),e.dtick=re(t,r,W));if(0===e.dtick&&(e.dtick=1),!a(e.dtick)&&"string"!=typeof e.dtick){var f=e.dtick;throw e.dtick=1,"ax.dtick error: "+String(f)}},N.tickIncrement=function(e,t,r,i){var o=r?-1:1;if(a(t))return l.increment(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?ee:K,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)},N.tickFirst=function(e,t){var r=e.r2l||Number,i=l.simpleMap(e.range,r,void 0,void 0,t),o=i[1]<i[0],s=o?Math.floor:Math.ceil,c=q(i)[0],u=e.dtick,f=r(e.tick0);if(a(u)){var d=s((c-f)/u)*u+f;return"category"!==e.type&&"multicategory"!==e.type||(d=l.constrain(d,0,e._categories.length-1)),d}var p=u.charAt(0),h=Number(u.substr(1));if("M"===p){for(var g,v,m,y=0,x=f;y<10;){if(((g=N.tickIncrement(x,u,o,e.calendar))-c)*(x-c)<=0)return o?Math.min(x,g):Math.max(x,g);v=(c-(x+g)/2)/(g-x),m=p+(Math.abs(Math.round(v))||1)*h,x=N.tickIncrement(x,m,v<0?!o:o,e.calendar),y++}return l.error("tickFirst did not converge",e),x}if("L"===p)return Math.log(s((Math.pow(10,c)-f)/h)*h+f)/Math.LN10;if("D"===p){var b="D2"===u?ee:K,_=l.roundUp(l.mod(c,1),b,o);return Math.floor(c)+Math.log(n.round(Math.pow(10,_),1))/Math.LN10}throw"unrecognized dtick "+String(u)},N.tickText=function(e,t,r,n){var i,o=ae(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||N.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$/,"")));if(s)if(r)"d"===i?c+=", "+s:c=s+(c?", "+c:"");else if(e._inCalcTicks&&e._prevDateHead===s){var f=-1!==(e.ticklabelposition||"").indexOf("inside"),d=e._realSide||e.side;(!f&&"top"===d||f&&"bottom"===d)&&(c+="<br> ")}else e._prevDateHead=s,c+="<br>"+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=se(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||oe(p)&&le(f)?(t.text=0===f?1:1===f?"10":"10<sup>"+(f>1?"":D)+d+"</sup>",t.fontSize*=1.25):("e"===p||"E"===p)&&d>2?t.text="1"+p+(f>0?"+":D)+d:(t.text=se(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):_e(e)?function(e,t,r,n,a){if("radians"!==e.thetaunit||r)t.text=se(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){for(var r=1;!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=se(l.deg2rad(t.x),e,a,n);else{var s=t.x<0;1===o[1]?1===o[0]?t.text="\u03c0":t.text=o[0]+"\u03c0":t.text=["<sup>",o[0],"</sup>","\u2044","<sub>",o[1],"</sub>","\u03c0"].join(""),s&&(t.text=D+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=se(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},N.hoverLabelText=function(e,t,r){if(r!==P&&r!==t)return N.hoverLabelText(e,t)+" - "+N.hoverLabelText(e,r);var n="log"===e.type&&t<=0,a=N.tickText(e,e.c2l(n?-t:t),"hover").text;return n?0===t?"0":D+a:a};var ie=["f","p","n","\u03bc","m","","k","M","G","T"];function oe(e){return"SI"===e||"B"===e}function le(e){return e>14||e<-15}function se(e,t,r,n){var i=e<0,o=t._tickround,s=r||t.exponentformat||"B",c=t._tickexponent,u=N.getTickFormat(t),f=t.separatethousands;if(n){var d={exponentformat:s,minexponent:t.minexponent,dtick:"none"===t.showexponent?t.dtick:a(e)&&Math.abs(e)||1,range:"none"===t.showexponent?t.range.map(t.r2d):[0,e||1]};ne(d),o=(Number(d._tickround)||0)+4,c=d._tickexponent,t.hoverformat&&(u=t.hoverformat)}if(u)return t._numFormat(u)(e).replace(/-/g,D);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&&(oe(s)&&le(c)&&(s="power"),p=c<0?D+-c:"power"!==s?"+"+c:String(c),"e"===s||"E"===s?e+=s+p:"power"===s?e+="\xd710<sup>"+p+"</sup>":"B"===s&&9===c?e+="B":oe(s)&&(e+=ie[c/3+5]));return i?D+e:e}function ce(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(ae(e,l.interp(n[o],.5),o));return r}function ue(e){return void 0!==e.periodX?e.periodX:e.x}function fe(e){return[e.text,e.x,e.axInfo,e.font,e.fontSize,e.fontColor].join("_")}function de(e){var t=e.title.font.size,r=(e.title.text.match(c.BR_TAG_ALL)||[]).length;return e.title.hasOwnProperty("standoff")?r?t*(E+r*I):t*E:r?t*(r+1)*I:t}function pe(e,t){var r=e.l2p(t);return r>1&&r<e._length-1}function he(e){var t=n.select(e),r=t.select(".text-math-group");return r.empty()?t.select("text"):r}function ge(e){return e._id+".automargin"}function ve(e){return ge(e)+".mirror"}function me(e){return e._id+".rangeslider"}function ye(e,t){for(var r=0;r<t.length;r++)-1===e.indexOf(t[r])&&e.push(t[r])}function xe(e,t,r){var n,a,i=[],o=[],s=e.layout;for(n=0;n<t.length;n++)i.push(N.getFromId(e,t[n]));for(n=0;n<r.length;n++)o.push(N.getFromId(e,r[n]));var c=Object.keys(p),u=["anchor","domain","overlaying","position","side","tickangle","editType"],f=["linear","log"];for(n=0;n<c.length;n++){var d=c[n],h=i[0][d],g=o[0][d],v=!0,m=!1,y=!1;if("_"!==d.charAt(0)&&"function"!=typeof h&&-1===u.indexOf(d)){for(a=1;a<i.length&&v;a++){var x=i[a][d];"type"===d&&-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][d];"type"===d&&-1!==f.indexOf(g)&&-1!==f.indexOf(b)&&g!==b?y=!0:o[a][d]!==g&&(v=!1)}v&&(m&&(s[i[0]._name].type="linear"),y&&(s[o[0]._name].type="linear"),be(s,d,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 be(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 _e(e){return"angularaxis"===e._id}function we(e,t){for(var r=t._rangebreaks.length,n=0;n<r;n++){var a=t._rangebreaks[n];if(e>=a.min&&e<a.max)return a.max}return e}N.getTickFormat=function(e){var t,r,n,a,i,o,l,s;function c(e){return"string"!=typeof e?e:Number(e.replace("M",""))*T}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,l=void 0,s=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},N.getSubplots=function(e,t){var r=e._fullLayout._subplots,n=r.cartesian.concat(r.gl2d||[]),a=t?N.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},N.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},N.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=N.list(e,"x",!0),s=N.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})}))}},N.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];if(r){var a=r.xaxis,i=r.yaxis;r.xaxislayer.selectAll("."+a._id+"tick").remove(),r.yaxislayer.selectAll("."+i._id+"tick").remove(),r.xaxislayer.selectAll("."+a._id+"tick2").remove(),r.yaxislayer.selectAll("."+i._id+"tick2").remove(),r.xaxislayer.selectAll("."+a._id+"divider").remove(),r.yaxislayer.selectAll("."+i._id+"divider").remove(),r.gridlayer&&r.gridlayer.selectAll("path").remove(),r.zerolinelayer&&r.zerolinelayer.selectAll("path").remove(),n._infolayer.select(".g-"+a._id+"title").remove(),n._infolayer.select(".g-"+i._id+"title").remove()}}));var a=t&&"redraw"!==t?t:N.listIds(e);return l.syncOrAsync(a.map((function(t){return function(){if(t){var n=N.getFromId(e,t),a=N.drawOne(e,n,r);return n._r=n.range.slice(),n._rl=l.simpleMap(n._r,n.r2l),a}}})))},N.drawOne=function(e,t,r){var n,a,s;r=r||{},t.setScale();var c=e._fullLayout,p=t._id,h=p.charAt(0),g=N.counterLetter(p),v=c._plots[t._mainSubplot];if(v){var m=v[h+"axislayer"],y=t._mainLinePosition,x=t._mainMirrorPosition,b=t._vals=N.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 T,k,M=N.makeTransTickFn(t),A=N.makeTransTickLabelFn(t),L="inside"===t.ticks,S="outside"===t.ticks;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);k=N.clipEnds(t,C),T=L?k:C}else k=N.clipEnds(t,b),T=L&&"period"!==t.ticklabelmode?k:b;var O=t._gridVals=k,D=function(e,t){var r,n,a=[],i=t.length&&t[t.length-1].x<t[0].x,o=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 s=t[r];s.text2!==n&&o(s,i?1:0),n=s.text2}o(t[r-1],i?0:1)}return a}(t,b);if(!c._hasOnlyLargeSploms){var P=t._subplotsWith,z={};for(n=0;n<P.length;n++){a=P[n];var R=(s=c._plots[a])[g+"axis"],E=R._mainAxis._id;if(!z[E]){z[E]=1;var H="x"===h?"M0,"+R._offset+"v"+R._length:"M"+R._offset+",0h"+R._length;N.drawGrid(e,t,{vals:O,counterAxis:R,layer:s.gridlayer.select("."+p),path:H,transFn:M}),N.drawZeroLine(e,t,{counterAxis:R,layer:s.zerolinelayer,path:H,transFn:M})}}}var B=N.getTickSigns(t),j=[];if(t.ticks){var V,U,q,G=N.makeTickPath(t,y,B[2]);if(t._anchorAxis&&t.mirror&&!0!==t.mirror?(V=N.makeTickPath(t,x,B[3]),U=G+V):(V="",U=G),t.showdividers&&S&&"boundaries"===t.tickson){var Z={};for(n=0;n<D.length;n++)Z[D[n].x]=1;q=function(e){return Z[e.x]?V:U}}else q=U;N.drawTicks(e,t,{vals:T,layer:m,path:q,transFn:M}),"allticks"===t.mirror&&(j=Object.keys(t._linepositions||{}))}for(n=0;n<j.length;n++){a=j[n],s=c._plots[a];var Y=t._linepositions[a]||[],X=N.makeTickPath(t,Y[0],B[0])+N.makeTickPath(t,Y[1],B[1]);N.drawTicks(e,t,{vals:T,layer:s[h+"axislayer"],path:X,transFn:M})}var W=[];if(W.push((function(){return N.drawLabels(e,t,{vals:b,layer:m,transFn:A,labelFns:N.makeLabelFns(t,y)})})),"multicategory"===t.type){var Q={x:2,y:10}[h];W.push((function(){var r={x:"height",y:"width"}[h],n=$()[r]+Q+(t._tickAngles[p+"tick"]?t.tickfont.size*I:0);return N.drawLabels(e,t,{vals:ce(t,b),layer:m,cls:p+"tick2",repositionOnUpdate:!0,secondary:!0,transFn:M,labelFns:N.makeLabelFns(t,y+n*B[4])})})),W.push((function(){return t._depth=B[4]*($("tick2")[t.side]-y),function(e,t,r){var n=t._id+"divider",a=r.vals,i=r.layer.selectAll("path."+n).data(a,fe);i.exit().remove(),i.enter().insert("path",":first-child").classed(n,1).classed("crisp",1).call(f.stroke,t.dividercolor).style("stroke-width",d.crispRound(e,t.dividerwidth,1)+"px"),i.attr("transform",r.transFn).attr("d",r.path)}(e,t,{vals:D,layer:m,path:N.makeTickPath(t,y,B[4],t._depth),transFn:M})}))}else t.title.hasOwnProperty("standoff")&&W.push((function(){t._depth=B[4]*($()[t.side]-y)}));var J=o.getComponentMethod("rangeslider","isVisible")(t);return W.push((function(){var r,n,a,l,s=t.side.charAt(0),u=F[t.side].charAt(0),f=N.getPxPosition(e,t),d=S?t.ticklen:0;if((t.automargin||J)&&("multicategory"===t.type?r=$("tick2"):(r=$(),"x"===h&&"b"===s&&(t._depth=Math.max(r.width>0?r.bottom-f:0,d)))),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?f-r.top:0,d),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?f-r.left:0,d):(n[s]=t._depth=Math.max(r.height>0?r.right-f:0,d),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!==c._dfltTitle[h]&&(n[s]+=de(t)+(t.title.standoff||0)),t.mirror&&"free"!==t.anchor&&((a={x:0,y:0,r:0,l:0,t:0,b:0})[u]=t.linewidth,t.mirror&&!0!==t.mirror&&(a[u]+=d),!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,ge(t),n),i.autoMargin(e,ve(t),a),i.autoMargin(e,me(t),l)})),r.skipTitle||J&&"bottom"===t.side||W.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+de(t);else{var l=-1!==(t.ticklabelposition||"").indexOf("inside");if("multicategory"===t.type)r=t._depth;else{var s=1.5*o;l&&(s=.5*o,"outside"===t.ticks&&(s+=t.ticklen)),r=10+s+(t.linewidth?t.linewidth-1:0)}l||(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 c,f,p,h,g=N.getPxPosition(e,t);"x"===i?(f=t._offset+t._length/2,p="top"===t.side?g-r:g+r):(p=t._offset+t._length/2,f="right"===t.side?g+r:g-r,c={rotate:"-90",offset:0});if("multicategory"!==t.type){var v=t._selections[t._id+"tick"];if(h={selection:v,side:t.side},v&&v.node()&&v.node().parentNode){var m=d.getTranslate(v.node().parentNode);h.offsetLeft=m.x,h.offsetTop=m.y}t.title.hasOwnProperty("standoff")&&(h.pad=0)}return u.draw(e,a+"title",{propContainer:t,propName:t._name+".title.text",placeholder:n._dfltTitle[i],avoid:h,transform:c,attributes:{x:f,y:p,"text-anchor":"middle"}})}(e,t)})),l.syncOrAsync(W)}}function $(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=he(this),t=d.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]}},N.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},N.makeTransTickFn=function(e){return"x"===e._id.charAt(0)?function(t){return s(e._offset+e.l2p(t.x),0)}:function(t){return s(0,e._offset+e.l2p(t.x))}},N.makeTransTickLabelFn=function(e){var t=function(e){var t=e.ticklabelposition||"",r=function(e){return-1!==t.indexOf(e)},n=r("top"),a=r("left"),i=r("right"),o=r("bottom"),l=r("inside"),s=o||a||n||i;if(!s&&!l)return[0,0];var c=e.side,u=s?(e.tickwidth||0)/2:0,f=3,d=e.tickfont?e.tickfont.size:12;(o||n)&&(u+=d*E,f+=(e.linewidth||0)/2);(a||i)&&(u+=(e.linewidth||0)/2,f+=3);l&&"top"===c&&(f-=d*(1-E));(a||n)&&(u=-u);"bottom"!==c&&"right"!==c||(f=-f);return[s?u:0,l?f:0]}(e),r=t[0],n=t[1];return"x"===e._id.charAt(0)?function(t){return s(r+e._offset+e.l2p(ue(t)),n)}:function(t){return s(n,r+e._offset+e.l2p(ue(t)))}},N.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},N.makeLabelFns=function(e,t,r){var n=e.ticklabelposition||"",i=function(e){return-1!==n.indexOf(e)},o=i("top"),s=i("left"),c=i("right"),u=i("bottom")||s||o||c,f=i("inside"),d="inside"===n&&"inside"===e.ticks||!f&&"outside"===e.ticks&&"boundaries"!==e.tickson,p=0,h=0,g=d?e.ticklen:0;if(f?g*=-1:u&&(g=0),d&&(p+=g,r)){var v=l.deg2rad(r);p=g*Math.cos(v)+1,h=g*Math.sin(v)}e.showticklabels&&(d||e.showline)&&(p+=.2*e.tickfont.size);var m,y,x,b,_,w={labelStandoff:p+=(e.linewidth||1)/2*(f?-1:1),labelShift:h},T=0,k=e.side,M=e._id.charAt(0),A=e.tickangle;if("x"===M)b=(_=!f&&"bottom"===k||f&&"top"===k)?1:-1,f&&(b*=-1),m=h*b,y=t+p*b,x=_?1:-.2,90===Math.abs(A)&&(f?x+=R:x=-90===A&&"bottom"===k?E:90===A&&"top"===k?R:.5,T=R/2*(A/90)),w.xFn=function(e){return e.dx+m+T*e.fontSize},w.yFn=function(e){return e.dy+y+e.fontSize*x},w.anchorFn=function(e,t){if(u){if(s)return"end";if(c)return"start"}return a(t)&&0!==t&&180!==t?t*b<0!==f?"end":"start":"middle"},w.heightFn=function(t,r,n){return r<-60||r>60?-.5*n:"top"===e.side!==f?-n:0};else if("y"===M){if(b=(_=!f&&"left"===k||f&&"right"===k)?1:-1,f&&(b*=-1),m=p,y=h*b,x=0,f||90!==Math.abs(A)||(x=-90===A&&"left"===k||90===A&&"right"===k?E:.5),f){var L=a(A)?+A:0;if(0!==L){var S=l.deg2rad(L);T=Math.abs(Math.sin(S))*E*b,x=0}}w.xFn=function(e){return e.dx+t-(m+e.fontSize*x)*b+T*e.fontSize},w.yFn=function(e){return e.dy+y+e.fontSize*R},w.anchorFn=function(e,t){return a(t)&&90===Math.abs(t)?"middle":_?"end":"start"},w.heightFn=function(t,r,n){return"right"===e.side&&(r*=-1),r<-30?-n:r<30?-.5*n:0}}return w},N.drawTicks=function(e,t,r){r=r||{};var n=t._id+"tick",a=r.vals;"period"===t.ticklabelmode&&(a=a.slice()).shift();var i=r.layer.selectAll("path."+n).data(t.ticks?a:[],fe);i.exit().remove(),i.enter().append("path").classed(n,1).classed("ticks",1).classed("crisp",!1!==r.crisp).call(f.stroke,t.tickcolor).style("stroke-width",d.crispRound(e,t.tickwidth,1)+"px").attr("d",r.path),i.attr("transform",r.transFn)},N.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&&N.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,fe);c.exit().remove(),c.enter().append("path").classed(n,1).classed("crisp",!1!==r.crisp),t._gw=d.crispRound(e,t.gridwidth,1),c.attr("transform",r.transFn).attr("d",r.path).call(f.stroke,t.gridcolor||"#ddd").style("stroke-width",t._gw+"px"),"function"==typeof r.path&&c.attr("d",r.path)},N.drawZeroLine=function(e,t,r){r=r||r;var n=t._id+"zl",a=N.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 j(e.id,t.id)}))})),i.attr("transform",r.transFn).attr("d",r.path).call(f.stroke,t.zerolinecolor||f.defaultLine).style("stroke-width",d.crispRound(e,t.zerolinewidth,t._gw||1)+"px")},N.drawLabels=function(e,t,r){r=r||{};var i=e._fullLayout,o=t._id,u=o.charAt(0),f=r.cls||o+"tick",p=r.vals,h=r.labelFns,g=r.secondary?0:t.tickangle,v=(t._prevTickAngles||{})[f],m=r.layer.selectAll("g."+f).data(t.showticklabels?p:[],fe),y=[];function x(e,i){var o=-1!==(t.ticklabelposition||"").indexOf("inside");e.each((function(e){var l=n.select(this),u=l.select(".text-math-group"),f=h.anchorFn(e,i),p=r.transFn.call(l.node(),e)+(a(i)&&0!=+i?" rotate("+i+","+h.xFn(e)+","+(h.yFn(e)-e.fontSize/2)+")":""),g=c.lineCount(l),v=I*e.fontSize,m=h.heightFn(e,a(i)?+i:0,(g-1)*v);if(m&&(p+=s(0,m)),u.empty()){var y=l.select("text");y.attr({transform:p,"text-anchor":f}),o&&(y.style({opacity:100}),t._hideOutOfRangeInsideTickLabels&&t._hideOutOfRangeInsideTickLabels())}else{var x=d.bBox(u.node()).width*{end:-.5,start:.5}[f];u.attr("transform",p+s(x,0))}}))}m.enter().append("g").classed(f,1).append("text").attr("text-anchor","middle").each((function(t){var r=n.select(this),a=e._promises.length;r.call(c.positionText,h.xFn(t),h.yFn(t)).call(d.font,t.font,t.fontSize,t.fontColor).text(t.text).call(c.convertToTspans,e),e._promises[a]?y.push(e._promises.pop().then((function(){x(r,g)}))):x(r,g)})),m.exit().remove(),r.repositionOnUpdate&&m.each((function(e){n.select(this).select("text").call(c.positionText,h.xFn(e),h.yFn(e))})),t._hideOutOfRangeInsideTickLabels=void 0,-1!==(t.ticklabelposition||"").indexOf("inside")&&(t._hideOutOfRangeInsideTickLabels=function(){var e=l.simpleMap(t.range,t.r2l),r=t.l2p(e[0]),a=t.l2p(e[1]),i=Math.min(r,a)+t._offset,o=Math.max(r,a)+t._offset,s="x"===t._id.charAt(0);m.each((function(e){var r=n.select(this);if(r.select(".text-math-group").empty()){var a=d.bBox(r.node()),l=!1;s?(a.right>o||a.left<i)&&(l=!0):(a.bottom>o||a.top+(t.tickangle?0:e.fontSize/4)<i)&&(l=!0),l&&r.select("text").style({opacity:0})}}))}),x(m,v+1?v:g);var b=null;t._selections&&(t._selections[f]=m);var _=[function(){return y.length&&Promise.all(y)}];t.automargin&&i._redrawFromAutoMarginCount&&90===v?(b=90,_.push((function(){x(m,v)}))):_.push((function(){if(x(m,g),p.length&&"x"===u&&!a(g)&&("log"!==t.type||"D"!==String(t.dtick).charAt(0))){b=0;var e,n=0,i=[];if(m.each((function(e){n=Math.max(n,e.fontSize);var r=t.l2p(e.x),a=he(this),o=d.bBox(a.node());i.push({top:0,bottom:10,height:10,left:r-o.width/2,right:r+o.width/2+2,width:o.width+2})})),"boundaries"!==t.tickson&&!t.showdividers||r.secondary){var o=p.length,s=Math.abs((p[o-1].x-p[0].x)*t._m)/(o-1),c=t.ticklabelposition||"",f=function(e){return-1!==c.indexOf(e)},h=f("top"),v=f("left"),y=f("right"),_=f("bottom")||v||h||y?(t.tickwidth||0)+6:0,w=s<2.5*n||"multicategory"===t.type;for(e=0;e<i.length-1;e++)if(l.bBoxIntersect(i[e],i[e+1],_)){b=w?90:30;break}}else{var T=2;for(t.ticks&&(T+=t.tickwidth/2),e=0;e<i.length;e++){var k=p[e].xbnd,M=i[e];if(null!==k[0]&&M.left-t.l2p(k[0])<T||null!==k[1]&&t.l2p(k[1])-M.right<T){b=90;break}}}b&&x(m,b)}})),t._tickAngles&&_.push((function(){t._tickAngles[f]=null===b?a(g)?g:0:b}));var w=t._anchorAxis;w&&w.autorange&&-1!==(t.ticklabelposition||"").indexOf("inside")&&!V(i,t._id)&&(i._insideTickLabelsAutorange||(i._insideTickLabelsAutorange={}),i._insideTickLabelsAutorange[w._name+".autorange"]=w.autorange,_.push((function(){m.each((function(e,r){var n=he(this);t._vals[r].bb=d.bBox(n.node())}))})));var T=l.syncOrAsync(_);return T&&T.then&&e._promises.push(T),T},N.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},N.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)===P)&&(pe(t,0)||!function(e,t,r,n){var a=r._mainAxis;if(!a)return;var i=e._fullLayout,o=t._id.charAt(0),l=N.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=N.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))},N.clipEnds=function(e,t){return t.filter((function(t){return pe(e,t.x)}))},N.allowAutoMargin=function(e){for(var t=N.list(e,"",!0),r=0;r<t.length;r++){var n=t[r];n.automargin&&(i.allowAutoMargin(e,ge(n)),n.mirror&&i.allowAutoMargin(e,ve(n))),o.getComponentMethod("rangeslider","isVisible")(n)&&i.allowAutoMargin(e,me(n))}},N.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]],ye(c.x,s.x),ye(c.y,s.y);ye(c.x,[o]),ye(c.y,[l])}else a.push({x:[o],y:[l]})}}return a}(e,t),n=0;n<r.length;n++)xe(e,r[n].x,r[n].y)}},{"../../components/color":82,"../../components/drawing":104,"../../components/titles":177,"../../constants/alignment":184,"../../constants/numerical":189,"../../lib":210,"../../lib/svg_text_utils":232,"../../plots/plots":290,"../../registry":298,"./autorange":255,"./axis_autotype":257,"./axis_ids":259,"./clean_ticks":261,"./layout_attributes":270,"./set_convert":276,d3:16,"fast-isnumeric":18}],257:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("../../lib"),i=e("../../constants/numerical").BADNUM,o=a.isArrayOrTypedArray,l=a.isDateTime,s=a.cleanNumber,c=Math.round;function u(e,t){return t?n(e):"number"==typeof e}function f(e){return Math.max(1,(e-1)/1e3)}t.exports=function(e,t,r){var a=e,d=r.noMultiCategory;if(o(a)&&!a.length)return"-";if(!d&&function(e){return o(e[0])&&o(e[1])}(a))return"multicategory";if(d&&Array.isArray(a[0])){for(var p=[],h=0;h<a.length;h++)if(o(a[h]))for(var g=0;g<a[h].length;g++)p.push(a[h][g]);a=p}if(function(e,t){for(var r=e.length,a=f(r),i=0,o=0,s={},u=0;u<r;u+=a){var d=c(u),p=e[d],h=String(p);s[h]||(s[h]=1,l(p,t)&&i++,n(p)&&o++)}return i>2*o}(a,t))return"date";var v="strict"!==r.autotypenumbers;return function(e,t){for(var r=e.length,n=f(r),a=0,o=0,l={},u=0;u<r;u+=n){var d=c(u),p=e[d],h=String(p);if(!l[h]){l[h]=1;var g=typeof p;"boolean"===g?o++:(t?s(p)!==i:"number"===g)?a++:"string"===g&&o++}}return o>2*a}(a,v)?"category":function(e,t){for(var r=e.length,n=0;n<r;n++)if(u(e[n],t))return!0;return!1}(a,v)?"linear":"-"}},{"../../constants/numerical":189,"../../lib":210,"fast-isnumeric":18}],258:[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,y=n.letter,x=n.font||{},b=n.splomStash||{},_=r("visible",!n.visibleDflt),w=t._template||{},T=t.type||w.type||"-";"date"===T&&(a.getComponentMethod("calendars","handleDefaults")(e,t,"calendar",n.calendar),n.noTicklabelmode||(m=r("ticklabelmode")));n.noTicklabelposition&&"multicategory"!==T||i.coerce(e,t,{ticklabelposition:{valType:"enumerated",dflt:"outside",values:"period"===m?["outside","inside"]:"x"===y?["outside","inside","outside left","inside left","outside right","inside right"]:["outside","inside","outside top","inside top","outside bottom","inside bottom"]}},"ticklabelposition"),p(t,g);var k=!t.isValidRange(e.range);k&&n.reverseDflt&&(k="reversed"),!r("autorange",k)||"linear"!==T&&"-"!==T||r("rangemode"),r("range"),t.cleanRange(),f(e,t,r,n),"category"===T||n.noHover||r("hoverformat");var M=r("color"),A=M!==l.color.dflt?M:x.color,L=b.label||g._dfltTitle[y];if(u(e,t,r,T,n,{pass:1}),!_)return t;r("title.text",L),i.coerceFont(r,"title.font",{family:x.family,size:Math.round(1.2*x.size),color:A}),s(e,t,r,T),u(e,t,r,T,n,{pass:2}),c(e,t,r,n),d(e,t,r,{dfltColor:M,bgColor:n.bgColor,showGrid:n.showGrid,attributes:l}),(t.showline||t.ticks)&&r("mirror"),n.automargin&&r("automargin");var S,C="multicategory"===T;n.noTickson||"category"!==T&&!C||!t.ticks&&!t.showgrid||(C&&(S="boundaries"),"boundaries"===r("tickson",S)&&delete t.ticklabelposition);C&&(r("showdividers")&&(r("dividercolor"),r("dividerwidth")));if("date"===T)if(o(e,t,{name:"rangebreaks",inclusionAttr:"enabled",handleItemDefaults:v}),t.rangebreaks.length){for(var O=0;O<t.rangebreaks.length;O++)if(t.rangebreaks[O].pattern===h){t._hasDayOfWeekBreaks=!0;break}if(p(t,g),g._has("scattergl")||g._has("splom"))for(var D=0;D<n.data.length;D++){var P=n.data[D];"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":210,"../../registry":298,"../array_container_defaults":251,"./category_order_defaults":260,"./constants":262,"./layout_attributes":270,"./line_grid_defaults":272,"./set_convert":276,"./tick_label_defaults":277,"./tick_mark_defaults":278,"./tick_value_defaults":279,"fast-isnumeric":18}],259:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("./constants");function i(e,t){if(t&&t.length)for(var r=0;r<t.length;r++)if(t[r][e])return!0;return!1}r.id2name=function(e){if("string"==typeof e&&e.match(a.AX_ID_PATTERN)){var t=e.split(" ")[0].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,r){var n=/( domain)$/.test(e);if("string"==typeof e&&e.match(a.AX_ID_PATTERN)&&(!t||e.charAt(0)===t)&&(!n||r)){var i=e.split(" ")[0].substr(1).replace(/^0+/,"");return"1"===i&&(i=""),e.charAt(0)+i+(n&&r?" domain":"")}},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 t=void 0===t||"string"!=typeof t?t:t.replace(" domain",""),"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.ref2id=function(e){return!!/^[xyz]/.test(e)&&e.split(" ")[0]},r.isLinked=function(e,t){return i(t,e._axisMatchGroups)||i(t,e._axisConstraintGroups)}},{"../../registry":298,"./constants":262}],260:[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&&(o[c]=1)}}return Object.keys(o)}(t,n).sort(),"category ascending"===s?t._initialCategories=l:"category descending"===s&&(t._initialCategories=l.reverse()))}}},{}],261:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("../../lib"),i=e("../../constants/numerical"),o=i.ONEDAY,l=i.ONEWEEK;r.dtick=function(e,t){var r="log"===t,a="date"===t,i="category"===t,l=a?o:1;if(!e)return l;if(n(e))return(e=Number(e))<=0?l:i?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,i%l==0?1:0)):"D1"!==i&&"D2"!==i?n(e)?Number(e):0:void 0}},{"../../constants/numerical":189,"../../lib":210,"fast-isnumeric":18}],262:[function(e,t,r){"use strict";var n=e("../../lib/regex").counter;t.exports={idRegex:{x:n("x","( domain)?"),y:n("y","( domain)?")},attrRegex:n("[xy]axis"),xAxisMatch:n("xaxis"),yAxisMatch:n("yaxis"),AX_ID_PATTERN:/^[xyz][0-9]*( domain)?$/,AX_NAME_PATTERN:/^[xyz]axis[0-9]*$/,SUBPLOT_PATTERN:/^x([0-9]*)y([0-9]*)$/,HOUR_PATTERN:"hour",WEEKDAY_PATTERN:"day of week",MINDRAG:8,MINSELECT:12,MINZOOM:20,DRAGGERSIZE:20,BENDPX:1.5,REDRAWDELAY:50,SELECTDELAY:100,SELECTID:"-select",DFLTRANGEX:[-1,6],DFLTRANGEY:[-1,4],traceLayerClasses:["imagelayer","heatmaplayer","contourcarpetlayer","contourlayer","funnellayer","waterfalllayer","barlayer","carpetlayer","violinlayer","boxlayer","ohlclayer","scattercarpetlayer","scatterlayer"],clipOnAxisFalseQuery:[".scatterlayer",".barlayer",".funnellayer",".waterfalllayer"],layerValue2layerClass:{"above traces":"above","below traces":"below"}}},{"../../lib/regex":226}],263:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./autorange"),i=e("./axis_ids").id2name,o=e("./layout_attributes"),l=e("./scale_zoom"),s=e("./set_convert"),c=e("../../constants/numerical").ALMOST_EQUAL,u=e("../../constants/alignment").FROM_BL;function f(e,t,r){var a=r.axIds,l=r.layoutOut,s=r.hasImage,c=l._axisConstraintGroups,u=l._axisMatchGroups,f=t._id,g=f.charAt(0),v=((l._splomAxes||{})[g]||{})[f]||{},m=t._id,y="x"===m.charAt(0);function x(r,a){return n.coerce(e,t,o,r,a)}t._matchGroup=null,t._constraintGroup=null,x("constrain",s?"domain":"range"),n.coerce(e,t,{constraintoward:{valType:"enumerated",values:y?["left","center","right"]:["bottom","middle","top"],dflt:y?"center":"middle"}},"constraintoward");var b,_,w=t.type,T=[];for(b=0;b<a.length;b++){if((_=a[b])!==m)l[i(_)].type===w&&T.push(_)}var k=p(c,m);if(k){var M=[];for(b=0;b<T.length;b++)k[_=T[b]]||M.push(_);T=M}var A,L,S=T.length;S&&(e.matches||v.matches)&&(A=n.coerce(e,t,{matches:{valType:"enumerated",values:T,dflt:-1!==T.indexOf(v.matches)?v.matches:void 0}},"matches"));var C=s&&!y?t.anchor:void 0;if(S&&!A&&(e.scaleanchor||C)&&(L=n.coerce(e,t,{scaleanchor:{valType:"enumerated",values:T}},"scaleanchor",C)),A){t._matchGroup=h(u,m,A,1);var O=l[i(A)],D=d(l,t)/d(l,O);y!==("x"===A.charAt(0))&&(D=(y?"x":"y")+D),h(c,m,A,D)}else e.matches&&-1!==a.indexOf(e.matches)&&n.warn("ignored "+t._name+'.matches: "'+e.matches+'" to avoid an infinite loop');if(L){var P=x("scaleratio");P||(P=t.scaleratio=1),h(c,m,L,P)}else e.scaleanchor&&-1!==a.indexOf(e.scaleanchor)&&n.warn("ignored "+t._name+'.scaleanchor: "'+e.scaleanchor+'" to avoid either an infinite loop and possibly inconsistent scaleratios, or because this axis declares a *matches* constraint.')}function d(e,t){var r=t.domain;return r||(r=e[i(t.overlaying)].domain),r[1]-r[0]}function p(e,t){for(var r=0;r<e.length;r++)if(e[r][t])return e[r];return null}function h(e,t,r,n){var a,i,o,l,s,c=p(e,t);null===c?((c={})[t]=1,s=e.length,e.push(c)):s=e.indexOf(c);var u=Object.keys(c);for(a=0;a<e.length;a++)if(o=e[a],a!==s&&o[r]){var f=o[r];for(i=0;i<u.length;i++)o[l=u[i]]=g(f,g(n,c[l]));return void e.splice(s,1)}if(1!==n)for(i=0;i<u.length;i++){var d=u[i];c[d]=g(n,c[d])}c[r]=1}function g(e,t){var r,n,a="",i="";"string"==typeof e&&(r=(a=e.match(/^[xy]*/)[0]).length,e=+e.substr(r)),"string"==typeof t&&(n=(i=t.match(/^[xy]*/)[0]).length,t=+t.substr(n));var o=e*t;return r||n?r&&n&&a.charAt(0)!==i.charAt(0)?r===n?o:(r>n?a.substr(n):i.substr(r))+o:a+i+e*t:o}function v(e,t){for(var r=t._size,n=r.h/r.w,a={},i=Object.keys(e),o=0;o<i.length;o++){var l=i[o],s=e[l];if("string"==typeof s){var c=s.match(/^[xy]*/)[0],u=c.length;s=+s.substr(u);for(var f="y"===c.charAt(0)?n:1/n,d=0;d<u;d++)s*=f}a[l]=s}return a}function m(e,t){var r=e._inputDomain,n=u[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.handleDefaults=function(e,t,r){var a,o,l,c,u,d,p,h,g=r.axIds,v=r.axHasImage,m=t._axisConstraintGroups=[],y=t._axisMatchGroups=[];for(a=0;a<g.length;a++)f(u=e[c=i(g[a])],d=t[c],{axIds:g,layoutOut:t,hasImage:v[c]});function x(e,r){for(a=0;a<e.length;a++)for(l in o=e[a])t[i(l)][r]=o}for(x(y,"_matchGroup"),a=0;a<m.length;a++)for(l in o=m[a])if((d=t[i(l)]).fixedrange){for(var b in o){var _=i(b);!1===(e[_]||{}).fixedrange&&n.warn("fixedrange was specified as false for axis "+_+" but was overridden because another axis in its constraint group has fixedrange true"),t[_].fixedrange=!0}break}for(a=0;a<m.length;){for(l in o=m[a]){(d=t[i(l)])._matchGroup&&Object.keys(d._matchGroup).length===Object.keys(o).length&&(m.splice(a,1),a--);break}a++}x(m,"_constraintGroup");var w=["constrain","range","autorange","rangemode","rangebreaks","categoryorder","categoryarray"],T=!1,k=!1;function M(){h=d[p],"rangebreaks"===p&&(k=d._hasDayOfWeekBreaks)}for(a=0;a<y.length;a++){o=y[a];for(var A=0;A<w.length;A++){var L;for(l in p=w[A],h=null,o)if(u=e[c=i(l)],d=t[c],p in d){if(!d.matches&&(L=d,p in u)){M();break}null===h&&p in u&&M()}if("range"===p&&h&&(T=!0),"autorange"===p&&null===h&&T&&(h=!1),null===h&&p in L&&(h=L[p]),null!==h)for(l in o)(d=t[i(l)])[p]="range"===p?h.slice():h,"rangebreaks"===p&&(d._hasDayOfWeekBreaks=k,s(d,t))}}},r.enforce=function(e){var t,r,n,o,s,u,f,d,p=e._fullLayout,h=p._axisConstraintGroups||[];for(t=0;t<h.length;t++){n=v(h[t],p);var g=Object.keys(n),y=1/0,x=0,b=1/0,_={},w={},T=!1;for(r=0;r<g.length;r++)w[o=g[r]]=s=p[i(o)],s._inputDomain?s.domain=s._inputDomain.slice():s._inputDomain=s.domain.slice(),s._inputRange||(s._inputRange=s.range.slice()),s.setScale(),_[o]=u=Math.abs(s._m)/n[o],y=Math.min(y,u),"domain"!==s.constrain&&s._constraintShrinkable||(b=Math.min(b,u)),delete s._constraintShrinkable,x=Math.max(x,u),"domain"===s.constrain&&(T=!0);if(!(y>c*x)||T)for(r=0;r<g.length;r++)if(u=_[o=g[r]],f=(s=w[o]).constrain,u!==b||"domain"===f)if(d=u/b,"range"===f)l(s,d);else{var k=s._inputDomain,M=(s.domain[1]-s.domain[0])/(k[1]-k[0]),A=(s.r2l(s.range[1])-s.r2l(s.range[0]))/(s.r2l(s._inputRange[1])-s.r2l(s._inputRange[0]));if((d/=M)*A<1){s.domain=s._input.domain=k.slice(),l(s,d);continue}if(A<1&&(s.range=s._input.range=s._inputRange.slice(),d*=A),s.autorange){var L=s.r2l(s.range[0]),S=s.r2l(s.range[1]),C=(L+S)/2,O=C,D=C,P=Math.abs(S-C),z=C-P*d*1.0001,R=C+P*d*1.0001,E=a.makePadFn(p,s,0),I=a.makePadFn(p,s,1);m(s,d);var F,N,H=Math.abs(s._m),B=a.concatExtremes(e,s),j=B.min,V=B.max;for(N=0;N<j.length;N++)(F=j[N].val-E(j[N])/H)>z&&F<O&&(O=F);for(N=0;N<V.length;N++)(F=V[N].val+I(V[N])/H)<R&&F>D&&(D=F);d/=(D-O)/(2*P),O=s.l2r(O),D=s.l2r(D),s.range=s._input.range=L<S?[O,D]:[D,O]}m(s,d)}}},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},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":184,"../../constants/numerical":189,"../../lib":210,"./autorange":255,"./axis_ids":259,"./layout_attributes":270,"./scale_zoom":274,"./set_convert":276}],264:[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=l.strTranslate,c=e("../../lib/svg_text_utils"),u=e("../../components/color"),f=e("../../components/drawing"),d=e("../../components/fx"),p=e("./axes"),h=e("../../lib/setcursor"),g=e("../../components/dragelement"),v=e("../../components/dragelement/helpers"),m=v.selectingOrDrawing,y=v.freeMode,x=e("../../constants/alignment").FROM_TL,b=e("../../lib/clear_gl_canvases"),_=e("../../plot_api/subroutines").redrawReglTraces,w=e("../plots"),T=e("./axis_ids").getFromId,k=e("./select").prepSelect,M=e("./select").clearSelect,A=e("./select").selectOnClick,L=e("./scale_zoom"),S=e("./constants"),C=S.MINDRAG,O=S.MINZOOM,D=!0;function P(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(h,n),a.node()}function z(e,t,r,a,i,o,l){var s=P(e,"rect",t,r);return n.select(s).call(f.setRect,a,i,o,l),s}function R(e,t){for(var r=0;r<e.length;r++)if(!e[r].fixedrange)return t;return""}function E(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;E(a,d,1-d,n,[])}}function I(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 F(e){return 1-(e>=0?Math.min(e,.9):1/(1/Math.max(e,-.3)+3.222))}function N(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",s(r,n)).attr("d",a+"Z")}function H(e,t,r){return e.append("path").attr("class","zoombox-corners").style({fill:u.background,stroke:u.defaultLine,"stroke-width":1,opacity:0}).attr("transform",s(t,r)).attr("d","M0,0Z")}function B(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"),j(e,t,a,i)}function j(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 V(e){n.select(e).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function U(e){D&&e.data&&e._context.showTips&&(l.notifier(l._(e,"Double-click to zoom back out"),"long"),D=!1)}function q(e){var t=Math.floor(Math.min(e.b-e.t,e.r-e.l,O)/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 G(e,t,r,n,a){for(var i,o,s,c,u=!1,f={},d={},p=(a||{}).xaHash,h=(a||{}).yaHash,g=0;g<t.length;g++){var v=t[g];for(i in r)if(v[i]){for(s in v)a&&(p[s]||h[s])||("x"===s.charAt(0)?r:n)[s]||(f[s]=i);for(o in n)a&&(p[o]||h[o])||!v[o]||(u=!0)}for(o in n)if(v[o])for(c in v)a&&(p[c]||h[c])||("x"===c.charAt(0)?r:n)[c]||(d[c]=o)}u&&(l.extendFlat(f,d),d={});var m={},y=[];for(s in f){var x=T(e,s);y.push(x),m[x._id]=x}var b={},_=[];for(c in d){var w=T(e,c);_.push(w),b[w._id]=w}return{xaHash:m,yaHash:b,xaxes:y,yaxes:_,xLinks:f,yLinks:d,isSubplotConstrained:u}}function Z(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:e.isAddedWheelEvent||(e.isAddedWheelEvent=!0,e.addEventListener("wheel",t,{passive:!1}))}function Y(e){var t=[];for(var r in e)t.push(e[r]);return t}t.exports={makeDragBox:function(e,t,r,i,s,u,h,v){var D,P,j,X,W,Q,J,$,K,ee,te,re,ne,ae,ie,oe,le,se,ce,ue,fe,de,pe,he=e._fullLayout._zoomlayer,ge=h+v==="nsew",ve=1===(h+v).length;function me(){if(D=t.xaxis,P=t.yaxis,K=D._length,ee=P._length,J=D._offset,$=P._offset,(j={})[D._id]=D,(X={})[P._id]=P,h&&v)for(var r=t.overlays,n=0;n<r.length;n++){var a=r[n].xaxis;j[a._id]=a;var i=r[n].yaxis;X[i._id]=i}W=Y(j),Q=Y(X),ne=R(W,v),ae=R(Q,h),ie=!ae&&!ne,re=G(e,e._fullLayout._axisMatchGroups,j,X);var o=(te=G(e,e._fullLayout._axisConstraintGroups,j,X,re)).isSubplotConstrained||re.isSubplotConstrained;oe=v||o,le=h||o;var l=e._fullLayout;se=l._has("scattergl"),ce=l._has("splom"),ue=l._has("svg")}me();var ye=function(e,t,r){if(!e)return"pointer";if("nsew"===e)return r?"":"pan"===t?"move":"crosshair";return e.toLowerCase()+"-resize"}(ae+ne,e._fullLayout.dragmode,ge),xe=z(t,h+v+"drag",ye,r,i,s,u);if(ie&&!ge)return xe.onmousedown=null,xe.style.pointerEvents="none",xe;var be,_e,we,Te,ke,Me,Ae,Le,Se,Ce,Oe={element:xe,gd:e,plotinfo:t};function De(){Oe.plotinfo.selection=!1,M(e)}function Pe(e,r){var a=Oe.gd;if(a._fullLayout._activeShapeIndex>=0)a._fullLayout._deactivateShape(a);else{var i=a._fullLayout.clickmode;if(V(a),2!==e||ve||Ue(),ge)i.indexOf("select")>-1&&A(r,a,W,Q,t.id,Oe),i.indexOf("event")>-1&&d.click(a,r,t.id);else if(1===e&&ve){var l=h?P:D,s="s"===h||"w"===v?0:1,u=l._name+".range["+s+"]",f=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,s),p="left",g="middle";if(l.fixedrange)return;h?(g="n"===h?"top":"bottom","right"===l.side&&(p="right")):"e"===v&&(p="right"),a._context.showAxisRangeEntryBoxes&&n.select(xe).call(c.makeEditable,{gd:a,immediate:!0,background:a._fullLayout.paper_bgcolor,text:String(f),fill:l.tickfont?l.tickfont.color:"#444",horizontalAlign:p,verticalAlign:g}).on("edit",(function(e){var t=l.d2r(e);void 0!==t&&o.call("_guiRelayout",a,u,t)}))}}}function ze(t,r){if(e._transitioningWithDuration)return!1;var n=Math.max(0,Math.min(K,de*t+be)),a=Math.max(0,Math.min(ee,pe*r+_e)),i=Math.abs(n-be),o=Math.abs(a-_e);function l(){Ae="",we.r=we.l,we.t=we.b,Se.attr("d","M0,0Z")}if(we.l=Math.min(be,n),we.r=Math.max(be,n),we.t=Math.min(_e,a),we.b=Math.max(_e,a),te.isSubplotConstrained)i>O||o>O?(Ae="xy",i/K>o/ee?(o=i*ee/K,_e>a?we.t=_e-o:we.b=_e+o):(i=o*K/ee,be>n?we.l=be-i:we.r=be+i),Se.attr("d",q(we))):l();else if(re.isSubplotConstrained)if(i>O||o>O){Ae="xy";var s=Math.min(we.l/K,(ee-we.b)/ee),c=Math.max(we.r/K,(ee-we.t)/ee);we.l=s*K,we.r=c*K,we.b=(1-s)*ee,we.t=(1-c)*ee,Se.attr("d",q(we))}else l();else!ae||o<Math.min(Math.max(.6*i,C),O)?i<C||!ne?l():(we.t=0,we.b=ee,Ae="x",Se.attr("d",function(e,t){return"M"+(e.l-.5)+","+(t-O-.5)+"h-3v"+(2*O+1)+"h3ZM"+(e.r+.5)+","+(t-O-.5)+"h3v"+(2*O+1)+"h-3Z"}(we,_e))):!ne||i<Math.min(.6*o,O)?(we.l=0,we.r=K,Ae="y",Se.attr("d",function(e,t){return"M"+(t-O-.5)+","+(e.t-.5)+"v-3h"+(2*O+1)+"v3ZM"+(t-O-.5)+","+(e.b+.5)+"v3h"+(2*O+1)+"v-3Z"}(we,be))):(Ae="xy",Se.attr("d",q(we)));we.w=we.r-we.l,we.h=we.b-we.t,Ae&&(Ce=!0),e._dragged=Ce,B(Le,Se,we,ke,Me,Te),Re(),e.emit("plotly_relayouting",fe),Me=!0}function Re(){fe={},"xy"!==Ae&&"x"!==Ae||(E(W,we.l/K,we.r/K,fe,te.xaxes),je("x",fe)),"xy"!==Ae&&"y"!==Ae||(E(Q,(ee-we.b)/ee,(ee-we.t)/ee,fe,te.yaxes),je("y",fe))}function Ee(){Re(),V(e),qe(),U(e)}Oe.prepFn=function(t,r,n){var i=Oe.dragmode,o=e._fullLayout.dragmode;o!==i&&(Oe.dragmode=o),me(),de=e._fullLayout._invScaleX,pe=e._fullLayout._invScaleY,ie||(ge?t.shiftKey?"pan"===o?o="zoom":m(o)||(o="pan"):t.ctrlKey&&(o="pan"):o="pan"),y(o)?Oe.minDrag=1:Oe.minDrag=void 0,m(o)?(Oe.xaxes=W,Oe.yaxes=Q,k(t,r,n,Oe,o)):(Oe.clickFn=Pe,m(i)&&De(),ie||("zoom"===o?(Oe.moveFn=ze,Oe.doneFn=Ee,Oe.minDrag=1,function(t,r,n){var i=xe.getBoundingClientRect();be=r-i.left,_e=n-i.top,e._fullLayout._calcInverseTransform(e);var o=l.apply3DTransform(e._fullLayout._invTransform)(be,_e);be=o[0],_e=o[1],we={l:be,r:be,w:0,t:_e,b:_e,h:0},Te=e._hmpixcount?e._hmlumcount/e._hmpixcount:a(e._fullLayout.plot_bgcolor).getLuminance(),Me=!1,Ae="xy",Ce=!1,Le=N(he,Te,J,$,ke="M0,0H"+K+"V"+ee+"H0V0"),Se=H(he,J,$)}(0,r,n)):"pan"===o&&(Oe.moveFn=Be,Oe.doneFn=qe))),e._fullLayout._redrag=function(){var t=e._dragdata;if(t&&t.element===xe){var r=e._fullLayout.dragmode;m(r)||(me(),Ge([0,0,K,ee]),Oe.moveFn(t.dx,t.dy))}}},g.init(Oe);var Ie=[0,0,K,ee],Fe=null,Ne=S.REDRAWDELAY,He=t.mainplot?e._fullLayout._plots[t.mainplot]:t;function Be(t,r){if(t*=de,r*=pe,!e._transitioningWithDuration){if(e._fullLayout._replotting=!0,"ew"===ne||"ns"===ae){var n=ne?-t:0,a=ae?-r:0;if(re.isSubplotConstrained){if(ne&&ae){var i=(t/K-r/ee)/2;n=-(t=i*K),a=-(r=-i*ee)}ae?n=-a*K/ee:a=-n*ee/K}return ne&&(I(W,t),je("x")),ae&&(I(Q,r),je("y")),Ge([n,a,K,ee]),Ve(),void e.emit("plotly_relayouting",fe)}var o,l,s="w"===ne==("n"===ae)?1:-1;if(ne&&ae&&(te.isSubplotConstrained||re.isSubplotConstrained)){var c=(t/K+s*r/ee)/2;t=c*K,r=s*c*ee}if("w"===ne?t=p(W,0,t):"e"===ne?t=p(W,1,-t):ne||(t=0),"n"===ae?r=p(Q,1,r):"s"===ae?r=p(Q,0,-r):ae||(r=0),o="w"===ne?t:0,l="n"===ae?r:0,te.isSubplotConstrained&&!re.isSubplotConstrained||re.isSubplotConstrained&&ne&&ae&&s>0){var u;if(re.isSubplotConstrained||!ne&&1===ae.length){for(u=0;u<W.length;u++)W[u].range=W[u]._r.slice(),L(W[u],1-r/ee);o=(t=r*K/ee)/2}if(re.isSubplotConstrained||!ae&&1===ne.length){for(u=0;u<Q.length;u++)Q[u].range=Q[u]._r.slice(),L(Q[u],1-t/K);l=(r=t*ee/K)/2}}re.isSubplotConstrained&&ae||je("x"),re.isSubplotConstrained&&ne||je("y");var f=K-t,d=ee-r;!re.isSubplotConstrained||ne&&ae||(ne?(l=o?0:t*ee/K,d=f*ee/K):(o=l?0:r*K/ee,f=d*K/ee)),Ge([o,l,f,d]),Ve(),e.emit("plotly_relayouting",fe)}function p(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])/F(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 je(e,t){for(var r=re.isSubplotConstrained?{x:Q,y:W}[e]:re[e+"axes"],n=re.isSubplotConstrained?{x:W,y:Q}[e]:[],a=0;a<r.length;a++){var i=r[a],o=i._id,l=re.xLinks[o]||re.yLinks[o],s=n[0]||j[l]||X[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 Ve(){var t,r=[];function n(e){for(t=0;t<e.length;t++)e[t].fixedrange||r.push(e[t]._id)}for(oe&&(n(W),n(te.xaxes),n(re.xaxes)),le&&(n(Q),n(te.yaxes),n(re.yaxes)),fe={},t=0;t<r.length;t++){var a=r[t],i=T(e,a);p.drawOne(e,i,{skipTitle:!0}),fe[i._name+".range[0]"]=i.range[0],fe[i._name+".range[1]"]=i.range[1]}p.redrawComponents(e,r)}function Ue(){if(!e._transitioningWithDuration){var t=e._context.doubleClick,r=[];ne&&(r=r.concat(W)),ae&&(r=r.concat(Q)),re.xaxes&&(r=r.concat(re.xaxes)),re.yaxes&&(r=r.concat(re.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((ne||te.isSubplotConstrained)&&(r=r.concat(te.xaxes)),ae&&!te.isSubplotConstrained&&(r=r.concat(te.yaxes)),te.isSubplotConstrained&&(ne?ae||(r=r.concat(Q)):r=r.concat(W)),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)}}function qe(){Ge([0,0,K,ee]),l.syncOrAsync([w.previousPromises,function(){e._fullLayout._replotting=!1,o.call("_guiRelayout",e,fe)}],e)}function Ge(t){var r,n,a,i,s=e._fullLayout,c=s._plots,u=s._subplots.cartesian;if(ce&&o.subplotsRegistry.splom.drag(e),se)for(r=0;r<u.length;r++)if(a=(n=c[u[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((ce||se)&&(b(e),_(e)),ue){var g=t[2]/D._length,m=t[3]/P._length;for(r=0;r<u.length;r++){a=(n=c[u[r]]).xaxis,i=n.yaxis;var y,x,w,T,k=(oe||re.isSubplotConstrained)&&!a.fixedrange&&j[a._id],M=(le||re.isSubplotConstrained)&&!i.fixedrange&&X[i._id];if(k?(y=g,w=v||re.isSubplotConstrained?t[0]:Xe(a,y)):re.xaHash[a._id]?(y=g,w=t[0]*a._length/D._length):re.yaHash[a._id]?(y=m,w="ns"===ae?-t[1]*a._length/P._length:Xe(a,y,{n:"top",s:"bottom"}[ae])):w=Ye(a,y=Ze(a,g,m)),M?(x=m,T=h||re.isSubplotConstrained?t[1]:Xe(i,x)):re.yaHash[i._id]?(x=m,T=t[1]*i._length/P._length):re.xaHash[i._id]?(x=g,T="ew"===ne?-t[0]*i._length/D._length:Xe(i,x,{e:"right",w:"left"}[ne])):T=Ye(i,x=Ze(i,g,m)),y||x){y||(y=1),x||(x=1);var A=a._offset-w/y,L=i._offset-T/x;n.clipRect.call(f.setTranslate,w,T).call(f.setScale,y,x),n.plot.call(f.setTranslate,A,L).call(f.setScale,1/y,1/x),y===n.xScaleFactor&&x===n.yScaleFactor||(f.setPointGroupScale(n.zoomScalePts,y,x),f.setTextPointsScale(n.zoomScaleTxt,y,x)),f.hideOutsideRangePoints(n.clipOnAxisFalseTraces,n),n.xScaleFactor=y,n.yScaleFactor=x}}}}function Ze(e,t,r){return e.fixedrange?0:oe&&te.xaHash[e._id]?t:le&&(te.isSubplotConstrained?te.xaHash:te.yaHash)[e._id]?r:0}function Ye(e,t){return t?(e.range=e._r.slice(),L(e,t),Xe(e,t)):0}function Xe(e,t,r){return e._length*(1-t)*x[r||e.constraintoward||"middle"]}return h.length*v.length!=1&&Z(xe,(function(t){if(e._context._scrollZoom.cartesian||e._fullLayout._enablescrollzoom){if(De(),e._transitioningWithDuration)return t.preventDefault(),void t.stopPropagation();me(),clearTimeout(Fe);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=He.draglayer.select(".nsewdrag").node().getBoundingClientRect(),o=(t.clientX-i.left)/i.width,s=(i.bottom-t.clientY)/i.height;if(oe){for(v||(o=.5),n=0;n<W.length;n++)c(W[n],o,a);je("x"),Ie[2]*=a,Ie[0]+=Ie[2]*o*(1/a-1)}if(le){for(h||(s=.5),n=0;n<Q.length;n++)c(Q[n],s,a);je("y"),Ie[3]*=a,Ie[1]+=Ie[3]*(1-s)*(1/a-1)}Ge(Ie),Ve(),e.emit("plotly_relayouting",fe),Fe=setTimeout((function(){Ie=[0,0,K,ee],qe()}),Ne),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)}))}}})),xe},makeDragger:P,makeRectDragger:z,makeZoombox:N,makeCorners:H,updateZoombox:B,xyCorners:q,transitionZoombox:j,removeZoombox:V,showDoubleClickNotifier:U,attachWheelEventHandler:Z}},{"../../components/color":82,"../../components/dragelement":101,"../../components/dragelement/helpers":100,"../../components/drawing":104,"../../components/fx":122,"../../constants/alignment":184,"../../lib":210,"../../lib/clear_gl_canvases":198,"../../lib/setcursor":230,"../../lib/svg_text_utils":232,"../../plot_api/subroutines":246,"../../registry":298,"../plots":290,"./axes":256,"./axis_ids":259,"./constants":262,"./scale_zoom":274,"./select":275,d3:16,"has-passive-events":50,tinycolor2:65}],265:[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":101,"../../components/fx":122,"../../lib/setcursor":230,"./constants":262,"./dragbox":264,d3:16}],266:[function(e,t,r){"use strict";t.exports={clearOutlineControllers:function(e){var t=e._fullLayout._zoomlayer;t&&t.selectAll(".outline-controllers").remove()},clearSelect:function(e){var t=e._fullLayout._zoomlayer;t&&t.selectAll(".select-outline").remove(),e._fullLayout._drawing=!1}}},{}],267:[function(e,t,r){"use strict";var n=e("../../lib").strTranslate;function a(e,t){switch(e.type){case"log":return e.p2d(t);case"date":return e.p2r(t,0,e.calendar);default:return e.p2r(t)}}t.exports={p2r:a,r2p:function(e,t){switch(e.type){case"log":return e.d2p(t);case"date":return e.r2p(t,0,e.calendar);default:return e.r2p(t)}},axValue:function(e){var t="y"===e._id.charAt(0)?1:0;return function(r){return a(e,r[t])}},getTransform:function(e){return n(e.xaxis._offset,e.yaxis._offset)}}},{"../../lib":210}],268:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../lib"),i=e("./axis_ids");t.exports=function(e){return function(t,r){var o=t[e];if(Array.isArray(o))for(var l=n.subplotsRegistry.cartesian,s=l.idRegex,c=r._subplots,u=c.xaxis,f=c.yaxis,d=c.cartesian,p=r._has("cartesian")||r._has("gl2d"),h=0;h<o.length;h++){var g=o[h];if(a.isPlainObject(g)){var v=i.cleanId(g.xref,"x",!1),m=i.cleanId(g.yref,"y",!1),y=s.x.test(v),x=s.y.test(m);if(y||x){p||a.pushUnique(r._basePlotModules,l);var b=!1;y&&-1===u.indexOf(v)&&(u.push(v),b=!0),x&&-1===f.indexOf(m)&&(f.push(m),b=!0),b&&y&&x&&d.push(v+m)}}}}}},{"../../lib":210,"../../registry":298,"./axis_ids":259}],269:[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 T=t.plot.selectAll("g.mlayer").data(v,(function(e){return e.className}));if(T.enter().append("g").attr("class",(function(e){return e.className})).classed("mlayer",!0).classed("rangeplot",t.isRangePlot),T.exit().remove(),T.order(),T.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 k=t.plot.selectAll(m.join(",")).selectAll(".trace");t.zoomScalePts=k.selectAll("path.point"),t.zoomScaleTxt=k.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,delete n._axisMatchGroups;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":104,"../../constants/xmlns_namespaces":190,"../../lib":210,"../../registry":298,"../get_data":286,"../plots":290,"./attributes":254,"./axis_ids":259,"./constants":262,"./graph_interact":265,"./layout_attributes":270,"./layout_defaults":271,"./transition_axes":280,d3:16}],270:[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},autotypenumbers:{valType:"enumerated",values:["convert types","strict"],dflt:"convert types",editType:"calc"},autorange:{valType:"enumerated",values:[!0,!1,"reversed"],dflt:!0,editType:"axrange",impliedEdits:{"range[0]":void 0,"range[1]":void 0}},rangemode:{valType:"enumerated",values:["normal","tozero","nonnegative"],dflt:"normal",editType:"plot"},range:{valType:"info_array",items:[{valType:"any",editType:"axrange",impliedEdits:{"^autorange":!1},anim:!0},{valType:"any",editType:"axrange",impliedEdits:{"^autorange":!1},anim:!0}],editType:"axrange",impliedEdits:{autorange:!1},anim:!0},fixedrange:{valType:"boolean",dflt:!1,editType:"calc"},scaleanchor:{valType:"enumerated",values:[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"],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"},ticklabelmode:{valType:"enumerated",values:["instant","period"],dflt:"instant",editType:"ticks"},ticklabelposition:{valType:"enumerated",values:["outside","inside","outside top","inside top","outside left","inside left","outside right","inside right","outside bottom","inside bottom"],dflt:"outside",editType:"calc"},mirror:{valType:"enumerated",values:[!0,"ticks",!1,"all","allticks"],dflt:!1,editType:"ticks+layoutstyle"},ticklen:{valType:"number",min:0,dflt:5,editType:"ticks"},tickwidth:{valType:"number",min:0,dflt:1,editType:"ticks"},tickcolor:{valType:"color",dflt:a.defaultLine,editType:"ticks"},showticklabels:{valType:"boolean",dflt:!0,editType:"ticks"},automargin:{valType:"boolean",dflt:!1,editType:"ticks"},showspikes:{valType:"boolean",dflt:!1,editType:"modebar"},spikecolor:{valType:"color",dflt:null,editType:"none"},spikethickness:{valType:"number",dflt:3,editType:"none"},spikedash:o({},i,{dflt:"dash",editType:"none"}),spikemode:{valType:"flaglist",flags:["toaxis","across","marker"],dflt:"toaxis",editType:"none"},spikesnap:{valType:"enumerated",values:["data","cursor","hovered data"],dflt:"data",editType:"none"},tickfont:n({editType:"ticks"}),tickangle:{valType:"angle",dflt:"auto",editType:"ticks"},tickprefix:{valType:"string",dflt:"",editType:"ticks"},showtickprefix:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",editType:"ticks"},ticksuffix:{valType:"string",dflt:"",editType:"ticks"},showticksuffix:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",editType:"ticks"},showexponent:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",editType:"ticks"},exponentformat:{valType:"enumerated",values:["none","e","E","power","SI","B"],dflt:"B",editType:"ticks"},minexponent:{valType:"number",dflt:3,min:0,editType:"ticks"},separatethousands:{valType:"boolean",dflt:!1,editType:"ticks"},tickformat:{valType:"string",dflt:"",editType:"ticks"},tickformatstops: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":81,"../../components/drawing/attributes":103,"../../constants/docs":187,"../../constants/numerical":189,"../../lib/extend":204,"../../plot_api/plot_template":245,"../font_attributes":284,"./constants":262}],271:[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"),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 y,w,T=t.autotypenumbers,k={},M={},A={},L={},S={},C={},O={},D={},P={},z={};for(y=0;y<r.length;y++){var R=r[y];if(x(R,"cartesian")||x(R,"gl2d")){var E,I;if(R.xaxis)E=g(R.xaxis),_(k,E,R);else if(R.xaxes)for(w=0;w<R.xaxes.length;w++)_(k,g(R.xaxes[w]),R);if(R.yaxis)I=g(R.yaxis),_(k,I,R);else if(R.yaxes)for(w=0;w<R.yaxes.length;w++)_(k,g(R.yaxes[w]),R);if("funnel"===R.type?"h"===R.orientation?(E&&(M[E]=!0),I&&(O[I]=!0)):I&&(A[I]=!0):"image"===R.type?(I&&(D[I]=!0),E&&(D[E]=!0)):(I&&(S[I]=!0,C[I]=!0),x(R,"carpet")&&("carpet"!==R.type||R._cheater)||E&&(L[E]=!0)),"carpet"===R.type&&R._cheater&&E&&(M[E]=!0),x(R,"2dMap")&&(P[E]=!0,P[I]=!0),x(R,"oriented"))z["h"===R.orientation?I:E]=!0}}var F=t._subplots,N=F.xaxis,H=F.yaxis,B=n.simpleMap(N,g),j=n.simpleMap(H,g),V=B.concat(j),U=a.background;N.length&&H.length&&(U=n.coerce(e,t,s,"plot_bgcolor"));var q,G,Z,Y,X,W=a.combine(U,t.paper_bgcolor);function Q(){var e=k[q]||[];X._traceIndices=e.map((function(e){return e._expandedIndex})),X._annIndices=[],X._shapeIndices=[],X._imgIndices=[],X._subplotsWith=[],X._counterAxes=[],X._name=X._attr=q,X._id=G}function J(e,t){return n.coerce(Y,X,c,e,t)}function $(e,t){return n.coerce2(Y,X,c,e,t)}function K(e){return"x"===e?H:N}function ee(t,r){for(var n="x"===t?B:j,a=[],i=0;i<n.length;i++){var o=n[i];o===r||(e[o]||{}).overlaying||a.push(v(o))}return a}var te={x:K("x"),y:K("y")},re=te.x.concat(te.y),ne={},ae=[];function ie(){var e=Y.matches;m.test(e)&&-1===re.indexOf(e)&&(ne[e]=Y.type,ae=Object.keys(ne))}var oe=o(e,t,r),le=i(oe);for(y=0;y<V.length;y++){q=V[y],G=v(q),Z=q.charAt(0),n.isPlainObject(e[q])||(e[q]={}),Y=e[q],X=l.newContainer(t,q,Z+"axis"),Q();var se="x"===Z&&!L[q]&&M[q]||"y"===Z&&!S[q]&&A[q],ce="y"===Z&&(!C[q]&&O[q]||D[q]),ue={letter:Z,font:t.font,outerTicks:P[q],showGrid:!z[q],data:k[q]||[],bgColor:W,calendar:t.calendar,automargin:!0,visibleDflt:se,reverseDflt:ce,autotypenumbersDflt:T,splomStash:((t._splomAxes||{})[Z]||{})[G]};J("uirevision",t.uirevision),u(Y,X,J,ue),f(Y,X,J,ue,t);var fe=le&&Z===oe.charAt(0),de=$("spikecolor",le?X.color:void 0),pe=$("spikethickness",le?1.5:void 0),he=$("spikedash",le?"dot":void 0),ge=$("spikemode",le?"across":void 0),ve=$("spikesnap",le?"hovered data":void 0);J("showspikes",!!(fe||de||pe||he||ge||ve))||(delete X.spikecolor,delete X.spikethickness,delete X.spikedash,delete X.spikemode,delete X.spikesnap),p(Y,X,J,{letter:Z,counterAxes:te[Z],overlayableAxes:ee(Z,q),grid:t.grid}),J("title.standoff"),ie(),X._input=Y}for(y=0;y<ae.length;){G=ae[y++],Z=(q=g(G)).charAt(0),n.isPlainObject(e[q])||(e[q]={}),Y=e[q],X=l.newContainer(t,q,Z+"axis"),Q();var me={letter:Z,font:t.font,outerTicks:P[q],showGrid:!z[q],data:[],bgColor:W,calendar:t.calendar,automargin:!0,visibleDflt:!1,reverseDflt:!1,autotypenumbersDflt:T,splomStash:((t._splomAxes||{})[Z]||{})[G]};J("uirevision",t.uirevision),X.type=ne[G]||"linear",f(Y,X,J,me,t),p(Y,X,J,{letter:Z,counterAxes:te[Z],overlayableAxes:ee(Z,q),grid:t.grid}),J("fixedrange"),ie(),X._input=Y}var ye=b("rangeslider","handleDefaults"),xe=b("rangeselector","handleDefaults");for(y=0;y<B.length;y++)q=B[y],Y=e[q],X=t[q],ye(e,t,q),"date"===X.type&&xe(Y,X,t,j,X.calendar),J("fixedrange");for(y=0;y<j.length;y++){q=j[y],Y=e[q],X=t[q];var be=t[g(X.anchor)];J("fixedrange",b("rangeslider","isVisible")(be))}d.handleDefaults(e,t,{axIds:re.concat(ae).sort(h.idSort),axHasImage:D})}},{"../../components/color":82,"../../components/fx/helpers":118,"../../components/fx/hovermode_defaults":121,"../../lib":210,"../../plot_api/plot_template":245,"../../registry":298,"../layout_attributes":288,"./axis_defaults":258,"./axis_ids":259,"./constants":262,"./constraints":263,"./layout_attributes":270,"./position_defaults":273,"./type_defaults":281}],272:[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":81,"../../lib":210,tinycolor2:65}],273:[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":210,"fast-isnumeric":18}],274:[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)],e.setScale()}},{"../../constants/alignment":184}],275:[function(e,t,r){"use strict";var n=e("polybooljs"),a=e("../../registry"),i=e("../../components/drawing").dashStyle,o=e("../../components/color"),l=e("../../components/fx"),s=e("../../components/fx/helpers").makeEventData,c=e("../../components/dragelement/helpers"),u=c.freeMode,f=c.rectMode,d=c.drawMode,p=c.openMode,h=c.selectMode,g=e("../../components/shapes/draw_newshape/display_outlines"),v=e("../../components/shapes/draw_newshape/helpers").handleEllipse,m=e("../../components/shapes/draw_newshape/newshapes"),y=e("../../lib"),x=e("../../lib/polygon"),b=e("../../lib/throttle"),_=e("./axis_ids").getFromId,w=e("../../lib/clear_gl_canvases"),T=e("../../plot_api/subroutines").redrawReglTraces,k=e("./constants"),M=k.MINSELECT,A=x.filter,L=x.tester,S=e("./handle_outline").clearSelect,C=e("./helpers"),O=C.p2r,D=C.axValue,P=C.getTransform;function z(e,t,r,n,a,i,o){var l,s,c,u,f,d,h,v,m,y=t._hoverdata,x=t._fullLayout.clickmode.indexOf("event")>-1,b=[];if(function(e){return e&&Array.isArray(e)&&!0!==e[0].hoverOnBox}(y)){F(e,t,i);var _=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}}(y,l=H(t,r,n,a));if(_.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,_):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=B(_))){for(o&&o.remove(),m=0;m<l.length;m++)(s=l[m])._module.selectPoints(s,!1);j(t,l),N(i),x&&t.emit("plotly_deselect",null)}else{for(h=e.shiftKey&&(void 0!==d?d:B(_)),c=function(e,t,r){return{pointNumber:e,searchInfo:t,subtract:r}}(_.pointNumber,_.searchInfo,h),u=I(i.selectionDefs.concat([c])),m=0;m<l.length;m++)if(f=V(l[m]._module.selectPoints(l[m],u),l[m]),b.length)for(var w=0;w<f.length;w++)b.push(f[w]);else b=f;if(j(t,l,v={points:b}),c&&i&&i.selectionDefs.push(c),o){var T=i.mergedPolygons,k=p(i.dragmode);g(U(T,k),o,i)}x&&t.emit("plotly_selected",v)}}}function R(e){return"pointNumber"in e&&"searchInfo"in e}function E(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 I(e){for(var t=[],r=R(e[0])?0:e[0][0][0],n=r,a=R(e[0])?0:e[0][0][1],i=a,o=0;o<e.length;o++)if(R(e[o]))t.push(E(e[o]));else{var l=x.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 F(e,t,r){t._fullLayout._drawing=!1;var n=t._fullLayout,a=r.plotinfo,i=r.dragmode,o=n._lastSelectedSubplot&&n._lastSelectedSubplot===a.id,l=(e.shiftKey||e.altKey)&&!(d(i)&&p(i));o&&l&&a.selection&&a.selection.selectionDefs&&!r.selectionDefs?(r.selectionDefs=a.selection.selectionDefs,r.mergedPolygons=a.selection.mergedPolygons):l&&a.selection||N(r),o||(S(t),n._lastSelectedSubplot=a.id)}function N(e){var t=e.dragmode,r=e.plotinfo,n=e.gd;if(n._fullLayout._activeShapeIndex>=0&&n._fullLayout._deactivateShape(n),d(t)){var i=n._fullLayout._zoomlayer.selectAll(".select-outline-"+r.id);if(i&&n._fullLayout._drawing){var o=m(i,e);o&&a.call("_guiRelayout",n,{shapes:o}),n._fullLayout._drawing=!1}}r.selection={},r.selection.selectionDefs=e.selectionDefs=[],r.selection.mergedPolygons=e.mergedPolygons=[]}function H(e,t,r,n){var a,i,o,l=[],s=t.map((function(e){return e._id})),c=r.map((function(e){return e._id}));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=d(i._module,a,t[0],r[0]);u.scene=e._fullLayout._splomScenes[i.uid],l.push(u)}else if("sankey"===i.type){var f=d(i._module,a,t[0],r[0]);l.push(f)}else{if(-1===s.indexOf(i.xaxis))continue;if(-1===c.indexOf(i.yaxis))continue;l.push(d(i._module,a,_(e,i.xaxis),_(e,i.yaxis)))}else l.push(d(i._module,a,t[0],r[0]));return l;function d(e,t,r,n){return{_module:e,cd:t,xaxis:r,yaxis:n}}}function B(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 j(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],d=f.data,p=f.fullData;f.pointIndices?([].push.apply(d.selectedpoints,f.pointIndices),l._fullInput!==l&&[].push.apply(p.selectedpoints,f.pointIndices)):(d.selectedpoints.push(f.pointIndex),l._fullInput!==l&&p.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 h=!1;for(n=0;n<t.length;n++){l=(o=(i=t[n]).cd)[0].trace,a.traceIs(l,"regl")&&(h=!0);var g=i._module,v=g.styleOnSelect||g.style;v&&(v(e,o,o[0].node3),o[0].nodeRangePlot3&&v(e,o,o[0].nodeRangePlot3))}h&&(w(e),T(e))}function V(e,t){if(Array.isArray(e))for(var r=t.cd,n=t.cd[0].trace,a=0;a<e.length;a++)e[a]=s(e[a],n,r);return e}function U(e,t){for(var r=[],n=0;n<e.length;n++){r[n]=[];for(var a=0;a<e[n].length;a++){r[n][a]=[],r[n][a][0]=a?"L":"M";for(var i=0;i<e[n][a].length;i++)r[n][a].push(e[n][a][i])}t||r[n].push(["Z",r[n][0][1],r[n][0][2]])}return r}t.exports={prepSelect:function(e,t,r,a,s){var c=u(s),m=f(s),x=p(s),_=d(s),w=h(s),T="drawcircle"===s,S="drawline"===s||T,C=a.gd,R=C._fullLayout,E=R._zoomlayer,B=a.element.getBoundingClientRect(),q=a.plotinfo,G=P(q),Z=t-B.left,Y=r-B.top;R._calcInverseTransform(C);var X=y.apply3DTransform(R._invTransform)(Z,Y);Z=X[0],Y=X[1];var W,Q,J,$,K,ee,te,re=R._invScaleX,ne=R._invScaleY,ae=Z,ie=Y,oe="M"+Z+","+Y,le=a.xaxes[0]._length,se=a.yaxes[0]._length,ce=a.xaxes.concat(a.yaxes),ue=e.altKey&&!(d(s)&&x);F(e,C,a),c&&(W=A([[Z,Y]],k.BENDPX));var fe=E.selectAll("path.select-outline-"+q.id).data(_?[0]:[1,2]),de=R.newshape;fe.enter().append("path").attr("class",(function(e){return"select-outline select-outline-"+e+" select-outline-"+q.id})).style(_?{opacity:de.opacity/2,fill:x?void 0:de.fillcolor,stroke:de.line.color,"stroke-dasharray":i(de.line.dash,de.line.width),"stroke-width":de.line.width+"px"}:{}).attr("fill-rule",de.fillrule).classed("cursor-move",!!_).attr("transform",G).attr("d",oe+"Z");var pe,he=E.append("path").attr("class","zoombox-corners").style({fill:o.background,stroke:o.defaultLine,"stroke-width":1}).attr("transform",G).attr("d","M0,0Z"),ge=R._uid+k.SELECTID,ve=[],me=H(C,a.xaxes,a.yaxes,a.subplot);function ye(e,t){return e-t}pe=q.fillRangeItems?q.fillRangeItems:m?function(e,t){var r=e.range={};for(K=0;K<ce.length;K++){var n=ce[K],a=n._id.charAt(0);r[n._id]=[O(n,t[a+"min"]),O(n,t[a+"max"])].sort(ye)}}:function(e,t,r){var n=e.lassoPoints={};for(K=0;K<ce.length;K++){var a=ce[K];n[a._id]=r.filtered.map(D(a))}},a.moveFn=function(e,t){ae=Math.max(0,Math.min(le,re*e+Z)),ie=Math.max(0,Math.min(se,ne*t+Y));var r=Math.abs(ae-Z),i=Math.abs(ie-Y);if(m){var o,l,s;if(w){var u=R.selectdirection;switch(o="any"===u?i<Math.min(.6*r,M)?"h":r<Math.min(.6*i,M)?"v":"d":u){case"h":l=T?se/2:0,s=se;break;case"v":l=T?le/2:0,s=le}}if(_)switch(R.newshape.drawdirection){case"vertical":o="h",l=T?se/2:0,s=se;break;case"horizontal":o="v",l=T?le/2:0,s=le;break;case"ortho":r<i?(o="h",l=Y,s=ie):(o="v",l=Z,s=ae);break;default:o="d"}"h"===o?(($=S?v(T,[ae,l],[ae,s]):[[Z,l],[Z,s],[ae,s],[ae,l]]).xmin=S?ae:Math.min(Z,ae),$.xmax=S?ae:Math.max(Z,ae),$.ymin=Math.min(l,s),$.ymax=Math.max(l,s),he.attr("d","M"+$.xmin+","+(Y-M)+"h-4v"+2*M+"h4ZM"+($.xmax-1)+","+(Y-M)+"h4v"+2*M+"h-4Z")):"v"===o?(($=S?v(T,[l,ie],[s,ie]):[[l,Y],[l,ie],[s,ie],[s,Y]]).xmin=Math.min(l,s),$.xmax=Math.max(l,s),$.ymin=S?ie:Math.min(Y,ie),$.ymax=S?ie:Math.max(Y,ie),he.attr("d","M"+(Z-M)+","+$.ymin+"v-4h"+2*M+"v4ZM"+(Z-M)+","+($.ymax-1)+"v4h"+2*M+"v-4Z")):"d"===o&&(($=S?v(T,[Z,Y],[ae,ie]):[[Z,Y],[Z,ie],[ae,ie],[ae,Y]]).xmin=Math.min(Z,ae),$.xmax=Math.max(Z,ae),$.ymin=Math.min(Y,ie),$.ymax=Math.max(Y,ie),he.attr("d","M0,0Z"))}else c&&(W.addPt([ae,ie]),$=W.filtered);a.selectionDefs&&a.selectionDefs.length?(J=function(e,t,r){if(r)return n.difference({regions:e,inverted:!1},{regions:[t],inverted:!1}).regions;return n.union({regions:e,inverted:!1},{regions:[t],inverted:!1}).regions}(a.mergedPolygons,$,ue),$.subtract=ue,Q=I(a.selectionDefs.concat([$]))):(J=[$],Q=L($)),g(U(J,x),fe,a),w&&b.throttle(ge,k.SELECTDELAY,(function(){var e;ve=[];var t,r=[];for(K=0;K<me.length;K++)if(t=(ee=me[K])._module.selectPoints(ee,Q),r.push(t),e=V(t,ee),ve.length)for(var n=0;n<e.length;n++)ve.push(e[n]);else ve=e;j(C,me,te={points:ve}),pe(te,$,W),a.gd.emit("plotly_selecting",te)}))},a.clickFn=function(e,t){if(he.remove(),C._fullLayout._activeShapeIndex>=0)C._fullLayout._deactivateShape(C);else if(!_){var r=R.clickmode;b.done(ge).then((function(){if(b.clear(ge),2===e){for(fe.remove(),K=0;K<me.length;K++)(ee=me[K])._module.selectPoints(ee,!1);j(C,me),N(a),C.emit("plotly_deselect",null)}else r.indexOf("select")>-1&&z(t,C,a.xaxes,a.yaxes,a.subplot,a,fe),"event"===r&&C.emit("plotly_selected",void 0);l.click(C,t)})).catch(y.error)}},a.doneFn=function(){he.remove(),b.done(ge).then((function(){b.clear(ge),a.gd.emit("plotly_selected",te),$&&a.selectionDefs&&($.subtract=ue,a.selectionDefs.push($),a.mergedPolygons.length=0,[].push.apply(a.mergedPolygons,J)),a.doneFnCompleted&&a.doneFnCompleted(ve)})).catch(y.error),_&&N(a)}},clearSelect:S,clearSelectionsCache:N,selectOnClick:z}},{"../../components/color":82,"../../components/dragelement/helpers":100,"../../components/drawing":104,"../../components/fx":122,"../../components/fx/helpers":118,"../../components/shapes/draw_newshape/display_outlines":167,"../../components/shapes/draw_newshape/helpers":168,"../../components/shapes/draw_newshape/newshapes":169,"../../lib":210,"../../lib/clear_gl_canvases":198,"../../lib/polygon":222,"../../lib/throttle":233,"../../plot_api/subroutines":246,"../../registry":298,"./axis_ids":259,"./constants":262,"./handle_outline":266,"./helpers":267,polybooljs:56}],276:[function(e,t,r){"use strict";var n=e("d3"),a=e("d3-time-format").utcFormat,i=e("fast-isnumeric"),o=e("../../lib"),l=o.cleanNumber,s=o.ms2DateTime,c=o.dateTime2ms,u=o.ensureNumber,f=o.isArrayOrTypedArray,d=e("../../constants/numerical"),p=d.FP_SAFE,h=d.BADNUM,g=d.LOG_CLIP,v=d.ONEWEEK,m=d.ONEDAY,y=d.ONEHOUR,x=d.ONEMIN,b=d.ONESEC,_=e("./axis_ids"),w=e("./constants"),T=w.HOUR_PATTERN,k=w.WEEKDAY_PATTERN;function M(e){return Math.pow(10,e)}function A(e){return null!=e}t.exports=function(e,t){t=t||{};var r=e._id||"x",d=r.charAt(0);function L(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*g*Math.abs(n-a))}return h}function S(t,r,n,a){if((a||{}).msUTC&&i(t))return+t;var l=c(t,n||e.calendar);if(l===h){if(!i(t))return h;t=+t;var s=Math.floor(10*o.mod(t+.05,1)),u=Math.round(t-s/10);l=c(new Date(u))+s/10}return l}function C(t,r,n){return s(t,r,n||e.calendar)}function O(t){return e._categories[Math.round(t)]}function D(t){if(A(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 h}function P(t){if(e._categoriesMap)return e._categoriesMap[t]}function z(e){var t=P(e);return void 0!==t?t:i(e)?+e:void 0}function R(e){return i(e)?+e:P(e)}function E(e,t,r){return n.round(r+t*e,2)}function I(e,t,r){return(e-r)/t}var F=function(t){return i(t)?E(t,e._m,e._b):h},N=function(t){return I(t,e._m,e._b)};if(e.rangebreaks){var H="y"===d;F=function(t){if(!i(t))return h;var r=e._rangebreaks.length;if(!r)return E(t,e._m,e._b);var n=H;e.range[0]>e.range[1]&&(n=!n);for(var a=n?-1:1,o=a*t,l=0,s=0;s<r;s++){var c=a*e._rangebreaks[s].min,u=a*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)?E(t,e._m2,f):0},N=function(t){var r=e._rangebreaks.length;if(!r)return I(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 I(t,e._m2,e._B[n])}}e.c2l="log"===e.type?L:u,e.l2c="log"===e.type?M:u,e.l2p=F,e.p2l=N,e.c2p="log"===e.type?function(e,t){return F(L(e,t))}:F,e.p2c="log"===e.type?function(e){return M(N(e))}:N,-1!==["linear","-"].indexOf(e.type)?(e.d2r=e.r2d=e.d2c=e.r2c=e.d2l=e.r2l=l,e.c2d=e.c2r=e.l2d=e.l2r=u,e.d2p=e.r2p=function(t){return e.l2p(l(t))},e.p2d=e.p2r=N,e.cleanPos=u):"log"===e.type?(e.d2r=e.d2l=function(e,t){return L(l(e),t)},e.r2d=e.r2c=function(e){return M(l(e))},e.d2c=e.r2l=l,e.c2d=e.l2r=u,e.c2r=L,e.l2d=M,e.d2p=function(t,r){return e.l2p(e.d2r(t,r))},e.p2d=function(e){return M(N(e))},e.r2p=function(t){return e.l2p(l(t))},e.p2r=N,e.cleanPos=u):"date"===e.type?(e.d2r=e.r2d=o.identity,e.d2c=e.r2c=e.d2l=e.r2l=S,e.c2d=e.c2r=e.l2d=e.l2r=C,e.d2p=e.r2p=function(t,r,n){return e.l2p(S(t,0,n))},e.p2d=e.p2r=function(e,t,r){return C(N(e),t,r)},e.cleanPos=function(t){return o.cleanDate(t,h,e.calendar)}):"category"===e.type?(e.d2c=e.d2l=D,e.r2d=e.c2d=e.l2d=O,e.d2r=e.d2l_noadd=z,e.r2c=function(t){var r=R(t);return void 0!==r?r:e.fraction2r(.5)},e.l2r=e.c2r=u,e.r2l=R,e.d2p=function(t){return e.l2p(e.r2c(t))},e.p2d=function(e){return O(N(e))},e.r2p=e.d2p,e.p2r=N,e.cleanPos=function(e){return"string"==typeof e&&""!==e?e:u(e)}):"multicategory"===e.type&&(e.r2d=e.c2d=e.l2d=O,e.d2r=e.d2l_noadd=z,e.r2c=function(t){var r=z(t);return void 0!==r?r:e.fraction2r(.5)},e.r2c_just_indices=P,e.l2r=e.c2r=u,e.r2l=z,e.d2p=function(t){return e.l2p(e.r2c(t))},e.p2d=function(e){return O(N(e))},e.r2p=e.d2p,e.p2r=N,e.cleanPos=function(e){return Array.isArray(e)||"string"==typeof e&&""!==e?e:u(e)},e.setupMultiCategory=function(n){var a,i,l=e._traceIndices,s=e._matchGroup;if(s&&0===e._categories.length)for(var c in s)if(c!==r){var u=t[_.id2name(c)];l=l.concat(u._traceIndices)}var p=[[0,{}],[0,{}]],h=[];for(a=0;a<l.length;a++){var g=n[l[a]];if(d in g){var v=g[d],m=g._length||o.minRowLength(v);if(f(v[0])&&f(v[1]))for(i=0;i<m;i++){var y=v[0][i],x=v[1][i];A(y)&&A(x)&&(h.push([y,x]),y in p[0][1]||(p[0][1][y]=p[0][0]++),x in p[1][1]||(p[1][1][x]=p[1][0]++))}}}for(h.sort((function(e,t){var r=p[0][1],n=r[e[0]]-r[t[0]];if(n)return n;var a=p[1][1];return a[e[1]]-a[t[1]]})),a=0;a<h.length;a++)D(h[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,a,l=o.nestedProperty(e,t).get();if(a=(a="date"===e.type?o.dfltRange(e.calendar):"y"===d?w.DFLTRANGEY:r.dfltRange||w.DFLTRANGEX).slice(),"tozero"!==e.rangemode&&"nonnegative"!==e.rangemode||(a[0]=0),l&&2===l.length)for("date"!==e.type||e.autorange||(l[0]=o.cleanDate(l[0],h,e.calendar),l[1]=o.cleanDate(l[1],h,e.calendar)),n=0;n<2;n++)if("date"===e.type){if(!o.isDateTime(l[n],e.calendar)){e[t]=a;break}if(e.r2l(l[0])===e.r2l(l[1])){var s=o.constrain(e.r2l(l[0]),o.MIN_MS+1e3,o.MAX_MS-1e3);l[0]=e.l2r(s-1e3),l[1]=e.l2r(s+1e3);break}}else{if(!i(l[n])){if(!i(l[1-n])){e[t]=a;break}l[n]=l[1-n]*(n?10:.1)}if(l[n]<-p?l[n]=-p:l[n]>p&&(l[n]=p),l[0]===l[1]){var c=Math.max(1,Math.abs(1e-6*l[0]));l[0]-=c,l[1]+=c}}else o.nestedProperty(e,t).set(a)},e.setScale=function(r){var n=t._size;if(e.overlaying){var a=_.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),f="y"===d;if((f?(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=f;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*(f?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=F(s.min),s.pmax=F(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,i,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=o.simpleMap(f.bounds,d?l:e.d2c))[0],a=r[1],d){case k:i=(s=new Date(t)).getUTCDay(),n>a&&(a+=7,i<n&&(i+=7));break;case T:i=(s=new Date(t)).getUTCHours()+(s.getUTCMinutes()/60+s.getUTCSeconds()/3600+s.getUTCMilliseconds()/36e5),n>a&&(a+=24,i<n&&(i+=24));break;case"":i=t}if(i>=n&&i<a)return h}else for(var p=o.simpleMap(f.values,e.d2c).sort(o.sorterAsc),g=0;g<p.length;g++)if(a=(n=p[g])+f.dvalue,t>=n&&t<a)return h}return t},e.locateBreaks=function(t,r){var n,a,i,s,c=[];if(!e.rangebreaks)return c;var u=e.rangebreaks.slice().sort((function(e,t){return e.pattern===k&&t.pattern===T?-1:t.pattern===k&&e.pattern===T?1:0})),f=function(e,n){if((e=o.constrain(e,t,r))!==(n=o.constrain(n,t,r))){for(var a=!0,i=0;i<c.length;i++){var l=c[i];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)),i=(a=o.simpleMap(d.bounds,d.pattern?l:e.r2l))[0],s=a[1];var g,_,w=new Date(p);switch(d.pattern){case k:_=v,g=(s-i+(s<i?7:0))*m,p+=i*m-(w.getUTCDay()*m+w.getUTCHours()*y+w.getUTCMinutes()*x+w.getUTCSeconds()*b+w.getUTCMilliseconds());break;case T:_=m,g=(s-i+(s<i?24:0))*y,p+=i*y-(w.getUTCHours()*y+w.getUTCMinutes()*x+w.getUTCSeconds()*b+w.getUTCMilliseconds());break;default:p=Math.min(a[0],a[1]),g=_=(h=Math.max(a[0],a[1]))-p}for(var M=p;M<h;M+=_)f(M,M+g)}else for(var A=o.simpleMap(d.values,e.d2c),L=0;L<A.length;L++)f(i=A[L],s=i+d.dvalue)}return c.sort((function(e,t){return e.min-t.min})),c},e.makeCalcdata=function(t,r,n){var a,i,l,s,c=e.type,u="date"===c&&t[r+"calendar"];if(r in t){if(a=t[r],s=t._length||o.minRowLength(a),o.isTypedArray(a)&&("linear"===c||"log"===c)){if(s===a.length)return a;if(a.subarray)return a.subarray(0,s)}if("multicategory"===c)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]=P([a,i])}return r}(a,s);for(i=new Array(s),l=0;l<s;l++)i[l]=e.d2c(a[l],0,u,n)}else{var f=r+"0"in t?e.d2c(t[r+"0"],0,u):0,d=t["d"+r]?Number(t["d"+r]):1;for(a=t[{x:"y",y:"x"}[r]],s=t._length||a.length,i=new Array(s),l=0;l<s;l++)i[l]=f+l*d}if(e.rangebreaks)for(l=0;l<s;l++)i[l]=e.maskBreaks(i[l]);return i},e.isValidRange=function(t){return Array.isArray(t)&&2===t.length&&i(e.r2l(t[0]))&&i(e.r2l(t[1]))},e.isPtWithinRange=function(t,r){var n=e.c2l(t[d],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._emptyCategories=function(){e._categories=[],e._categoriesMap={}},e.clearCalc=function(){var r=e._matchGroup;if(r){var n=null,a=null;for(var i in r){var o=t[_.id2name(i)];if(o._categories){n=o._categories,a=o._categoriesMap;break}}n&&a?(e._categories=n,e._categoriesMap=a):e._emptyCategories()}else e._emptyCategories();if(e._initialCategories)for(var l=0;l<e._initialCategories.length;l++)D(e._initialCategories[l])},e.sortByInitialCategories=function(){var n=[];if(e._emptyCategories(),e._initialCategories)for(var a=0;a<e._initialCategories.length;a++)D(e._initialCategories[a]);n=n.concat(e._traceIndices);var i=e._matchGroup;for(var o in i)if(r!==o){var l=t[_.id2name(o)];l._categories=e._categories,l._categoriesMap=e._categoriesMap,n=n.concat(l._traceIndices)}return n};var B=t._d3locale;"date"===e.type&&(e._dateFormat=B?B.timeFormat:a,e._extraFormat=t._extraFormat),e._separators=t.separators,e._numFormat=B?B.numberFormat:n.format,delete e._minDtick,delete e._forceTick0}},{"../../constants/numerical":189,"../../lib":210,"./axis_ids":259,"./constants":262,d3:16,"d3-time-format":14,"fast-isnumeric":18}],277:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../components/color").contrast,i=e("./layout_attributes"),o=e("../array_container_defaults");function l(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 s(e,t){function r(r,a){return n.coerce(e,t,i.tickformatstops,r,a)}r("enabled")&&(r("dtickrange"),r("value"))}t.exports=function(e,t,r,c,u,f){f&&1!==f.pass||function(e,t,r,n,a){var i=l(e);r("tickprefix")&&r("showtickprefix",i);r("ticksuffix",a.tickSuffixDflt)&&r("showticksuffix",i)}(e,0,r,0,u),f&&2!==f.pass||function(e,t,r,c,u){var f=l(e);r("tickprefix")&&r("showtickprefix",f);r("ticksuffix",u.tickSuffixDflt)&&r("showticksuffix",f);if(r("showticklabels")){var d=u.font||{},p=t.color,h=-1!==(t.ticklabelposition||"").indexOf("inside")?a(u.bgColor):p&&p!==i.color.dflt?p:d.color;if(n.coerceFont(r,"tickfont",{family:d.family,size:d.size,color:h}),r("tickangle"),"category"!==c){var g=r("tickformat");o(e,t,{name:"tickformatstops",inclusionAttr:"enabled",handleItemDefaults:s}),t.tickformatstops.length||delete t.tickformatstops,g||"date"===c||(r("showexponent",f),r("exponentformat"),r("minexponent"),r("separatethousands"))}}}(e,t,r,c,u)}},{"../../components/color":82,"../../lib":210,"../array_container_defaults":251,"./layout_attributes":270}],278:[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":210,"./layout_attributes":270}],279:[function(e,t,r){"use strict";var n=e("./clean_ticks"),a=e("../../lib").isArrayOrTypedArray;t.exports=function(e,t,r,i){function o(r){var n=e[r];return void 0!==n?n:(t._template||{})[r]}var l=o("tick0"),s=o("dtick"),c=o("tickvals"),u=r("tickmode",a(c)?"array":s?"linear":"auto");if("auto"===u)r("nticks");else if("linear"===u){var f=t.dtick=n.dtick(s,i);t.tick0=n.tick0(l,i,t.calendar,f)}else if("multicategory"!==i){void 0===r("tickvals")?t.tickmode="auto":r("ticktext")}}},{"../../lib":210,"./clean_ticks":261}],280:[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,T=d?u/p[3]:1,k=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,k,M).call(o.setScale,1/w,1/T),n.plot.call(o.setTranslate,S,C).call(o.setScale,w,T),o.setPointGroupScale(n.zoomScalePts,1/w,1/T),o.setTextPointsScale(n.zoomScaleTxt,1/w,1/T)}l.redrawComponents(e)}},{"../../components/drawing":104,"../../lib":210,"../../registry":298,"./axes":256,d3:16}],281:[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("autotypenumbers",l.autotypenumbersDflt),"-"===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(d.autotypenumbers=e.autotypenumbers,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[c._axesDim[l]];v.visible&&(e.type=a(v.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":298,"./axis_autotype":257}],282:[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":210,"../registry":298}],283:[function(e,t,r){"use strict";var n=e("../lib/extend").extendFlat;r.attributes=function(e,t){t=t||{};var r={valType:"info_array",editType:(e=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":204}],284:[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}},{}],285:[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"}}},{}],286:[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":298,"./cartesian/constants":262}],287:[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])))}},{}],288:[function(e,t,r){"use strict";var n=e("./font_attributes"),a=e("./animation_attributes"),i=e("../components/color/attributes"),o=e("../components/shapes/draw_newshape/attributes"),l=e("./pad_attributes"),s=e("../lib/extend").extendFlat,c=n({editType:"calc"});c.family.dflt='"Open Sans", verdana, arial, sans-serif',c.size.dflt=12,c.color.dflt=i.defaultLine,t.exports={font:c,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:s(l({editType:"layoutstyle"}),{}),editType:"layoutstyle"},uniformtext:{mode:{valType:"enumerated",values:[!1,"hide","show"],dflt:!1,editType:"plot"},minsize:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"plot"},autosize:{valType:"boolean",dflt:!1,editType:"none"},width:{valType:"number",min:10,dflt:700,editType:"plot"},height:{valType:"number",min:10,dflt:450,editType:"plot"},margin:{l:{valType:"number",min:0,dflt:80,editType:"plot"},r:{valType:"number",min:0,dflt:80,editType:"plot"},t:{valType:"number",min:0,dflt:100,editType:"plot"},b:{valType:"number",min:0,dflt:80,editType:"plot"},pad:{valType:"number",min:0,dflt:0,editType:"plot"},autoexpand:{valType:"boolean",dflt:!0,editType:"plot"},editType:"plot"},computed:{valType:"any",editType:"none"},paper_bgcolor:{valType:"color",dflt:i.background,editType:"plot"},plot_bgcolor:{valType:"color",dflt:i.background,editType:"layoutstyle"},autotypenumbers:{valType:"enumerated",values:["convert types","strict"],dflt:"convert types",editType:"calc"},separators:{valType:"string",editType:"plot"},hidesources:{valType:"boolean",dflt:!1,editType:"plot"},showlegend:{valType:"boolean",editType:"legend"},colorway:{valType:"colorlist",dflt:i.defaults,editType:"calc"},datarevision:{valType:"any",editType:"calc"},uirevision:{valType:"any",editType:"none"},editrevision:{valType:"any",editType:"none"},selectionrevision:{valType:"any",editType:"none"},template:{valType:"any",editType:"calc"},modebar:{orientation:{valType:"enumerated",values:["v","h"],dflt:"h",editType:"modebar"},bgcolor:{valType:"color",editType:"modebar"},color:{valType:"color",editType:"modebar"},activecolor:{valType:"color",editType:"modebar"},uirevision:{valType:"any",editType:"none"},editType:"modebar"},newshape:o.newshape,activeshape:o.activeshape,meta:{valType:"any",arrayOk:!0,editType:"plot"},transition:s({},a.transition,{editType:"none"}),_deprecated:{title:{valType:"string",editType:"layoutstyle"},titlefont:n({editType:"layoutstyle"})}}},{"../components/color/attributes":81,"../components/shapes/draw_newshape/attributes":164,"../lib/extend":204,"./animation_attributes":250,"./font_attributes":284,"./pad_attributes":289}],289:[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}}},{}],290:[function(e,t,r){"use strict";var n=e("d3"),a=e("d3-time-format").timeFormatLocale,i=e("fast-isnumeric"),o=e("../registry"),l=e("../plot_api/plot_schema"),s=e("../plot_api/plot_template"),c=e("../lib"),u=e("../components/color"),f=e("../constants/numerical").BADNUM,d=e("./cartesian/axis_ids"),p=e("./cartesian/handle_outline").clearSelect,h=e("./animation_attributes"),g=e("./frame_attributes"),v=e("../plots/get_data").getModuleCalcData,m=c.relinkPrivateKeys,y=c._,x=t.exports={};c.extendFlat(x,o),x.attributes=e("./attributes"),x.attributes.type.values=x.allTypes,x.fontAttrs=e("./font_attributes"),x.layoutAttributes=e("./layout_attributes"),x.fontWeight="normal";var b=x.transformsRegistry,_=e("./command");x.executeAPICommand=_.executeAPICommand,x.computeAPICommandBindings=_.computeAPICommandBindings,x.manageCommandObserver=_.manageCommandObserver,x.hasSimpleAPICommandBindings=_.hasSimpleAPICommandBindings,x.redrawText=function(e){var t=(e=c.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(){o.getComponentMethod("annotations","draw")(e),o.getComponentMethod("legend","draw")(e),o.getComponentMethod("colorbar","draw")(e),t(x.previousPromises(e))}),300)}))},x.resize=function(e){var t;e=c.getGraphDiv(e);var r=new Promise((function(r,n){e&&!c.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||c.isHidden(e))r(e);else{delete e.layout.width,delete e.layout.height;var t=e.changed;e.autoplay=!0,o.call("relayout",e,{autosize:!0}).then((function(){e.changed=t,e._resolveResize===r&&(delete e._resolveResize,r(e))}))}}),100)}));return t&&t(r),r},x.previousPromises=function(e){if((e._promises||[]).length)return Promise.all(e._promises).then((function(){e._promises=[]}))},x.addLinks=function(e){if(e._context.showLink||e._context.showSources){var t=e._fullLayout,r=c.ensureSingle(t._paper,"text","js-plot-link-container",(function(e){e.style({"font-family":'"Open Sans", Arial, sans-serif',"font-size":"12px",fill:u.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"),s=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(){x.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()&&s.text()?" - ":"")}},x.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=x.graphJson(e,!1,"keepdata"),a.node().submit(),r.remove(),e.emit("plotly_afterexport"),!1}};var w=["days","shortDays","months","shortMonths","periods","dateTime","date","time","decimal","thousands","grouping","currency"],T=["year","month","dayMonth","dayMonthYear"];function k(e,t){var r=e._context.locale;r||(r="en-US");var n=!1,a={};function i(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&&(i(u),n))break;s=o.localeRegistry}var f=r.split("-")[0];if(n||f===r)break;r=f}return n||i(o.localeRegistry.en.format),a}function M(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],f=n?e._id+u:u+e._id;o||(o=f);var p=d.getFromId(r,u);if(l&&p.overlaying===l){i=f;break}}}return i||o}function A(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||b[n.type];if(a&&a.makesData)return!0}return!1}function L(e,t,r,n){for(var a=e.transforms,i=[e],o=0;o<a.length;o++){var l=a[o],s=b[l.type];s&&s.transform&&(i=s.transform(i,{transform:l,fullTrace:e,fullData:t,layout:r,fullLayout:n,transformIndex:o}))}return i}function S(e){return"string"==typeof e&&"px"===e.substr(e.length-2)&&parseFloat(e)}function C(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={})}x.supplyDefaults=function(e,t){var r=t&&t.skipUpdateCalc,i=e._fullLayout||{};if(i._skipDefaults)delete i._skipDefaults;else{var l,s=e._fullLayout={},u=e.layout||{},f=e._fullData||[],d=e._fullData=[],h=e.data||[],g=e.calcdata||[],v=e._context||{};e._transitionData||x.createTransitionData(e),s._dfltTitle={plot:y(e,"Click to enter Plot title"),x:y(e,"Click to enter X axis title"),y:y(e,"Click to enter Y axis title"),colorbar:y(e,"Click to enter Colorscale title"),annotation:y(e,"new text")},s._traceWord=y(e,"trace");var b=k(e,w);if(s._mapboxAccessToken=v.mapboxAccessToken,i._initialAutoSizeIsDone){var _=i.width,M=i.height;x.supplyLayoutGlobalDefaults(u,s,b),u.width||(s.width=_),u.height||(s.height=M),x.sanitizeMargins(s)}else{x.supplyLayoutGlobalDefaults(u,s,b);var A=!u.width||!u.height,L=s.autosize,S=v.autosizable;A&&(L||S)?x.plotAutoSize(e,u,s):A&&x.sanitizeMargins(s),!L&&A&&(u.width=s.width,u.height=s.height)}s._d3locale=function(e,t){return e.decimal=t.charAt(0),e.thousands=t.charAt(1),{numberFormat:n.locale(e).numberFormat,timeFormat:a(e).utcFormat}}(b,s.separators),s._extraFormat=k(e,T),s._initialAutoSizeIsDone=!0,s._dataLength=h.length,s._modules=[],s._visibleModules=[],s._basePlotModules=[];var O=s._subplots=function(){var e,t,r=o.collectableSubplotTypes,n={};if(!r){r=[];var a=o.subplotsRegistry;for(var i in a){var l=a[i].attr;if(l&&(r.push(i),Array.isArray(l)))for(t=0;t<l.length;t++)c.pushUnique(r,l[t])}}for(e=0;e<r.length;e++)n[r[e]]=[];return n}(),D=s._splomAxes={x:{},y:{}},P=s._splomSubplots={};s._splomGridDflt={},s._scatterStackOpts={},s._firstScatter={},s._alignmentOpts={},s._colorAxes={},s._requestRangeslider={},s._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,s=new Array(a),u={};function f(e,t){s[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(c.randstr(u),r))}return s}(f,h),s._globalTransforms=(e._context||{}).globalTransforms,x.supplyDataDefaults(h,d,u,s);var z=Object.keys(D.x),R=Object.keys(D.y);if(z.length>1&&R.length>1){for(o.getComponentMethod("grid","sizeDefaults")(u,s),l=0;l<z.length;l++)c.pushUnique(O.xaxis,z[l]);for(l=0;l<R.length;l++)c.pushUnique(O.yaxis,R[l]);for(var E in P)c.pushUnique(O.cartesian,E)}if(s._has=x._hasPlotType.bind(s),f.length===d.length)for(l=0;l<d.length;l++)m(d[l],f[l]);x.supplyLayoutModuleDefaults(u,s,d,e._transitionData);var I=s._visibleModules,F=[];for(l=0;l<I.length;l++){var N=I[l].crossTraceDefaults;N&&c.pushUnique(F,N)}for(l=0;l<F.length;l++)F[l](d,s);s._hasOnlyLargeSploms=1===s._basePlotModules.length&&"splom"===s._basePlotModules[0].name&&z.length>15&&R.length>15&&0===s.shapes.length&&0===s.images.length,s._hasCartesian=s._has("cartesian"),s._hasGeo=s._has("geo"),s._hasGL3D=s._has("gl3d"),s._hasGL2D=s._has("gl2d"),s._hasTernary=s._has("ternary"),s._hasPie=s._has("pie"),x.linkSubplots(d,s,f,i),x.cleanPlot(d,s,f,i);var H=!(!i._has||!i._has("gl2d")),B=!(!s._has||!s._has("gl2d")),j=!(!i._has||!i._has("cartesian"))||H,V=!(!s._has||!s._has("cartesian"))||B;j&&!V?i._bgLayer.remove():V&&!j&&(s._shouldCreateBgLayer=!0),i._zoomlayer&&!e._dragging&&p({_fullLayout:i}),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)}(d,s),m(s,i),o.getComponentMethod("colorscale","crossTraceDefaults")(d,s),s._preGUI||(s._preGUI={}),s._tracePreGUI||(s._tracePreGUI={});var U,q=s._tracePreGUI,G={};for(U in q)G[U]="old";for(l=0;l<d.length;l++)G[U=d[l]._fullInput.uid]||(q[U]={}),G[U]="new";for(U in G)"old"===G[U]&&delete q[U];C(s),o.getComponentMethod("rangeslider","makeData")(s),r||g.length!==d.length||x.supplyDefaultsUpdateCalc(g,d)}},x.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,s,u=i._arrayAttrs;for(o=0;o<u.length;o++)l=u[o],s=c.nestedProperty(i,l).get().slice(),c.nestedProperty(n,l).set(s)}a.trace=n}}},x.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=[])},x._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 i=o.modules[a];if(i&&i.categories[e])return!0}return!1},x.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()}},x.linkSubplots=function(e,t,r,n){var a,i,l=n._plots||{},s=t._plots={},u=t._subplots,f={_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=d.getFromId(f,g,"x"),y=d.getFromId(f,g,"y");for(v?h=s[g]=v:(h=s[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,i=0;i<e.length;i++){var x=e[i];if(x.xaxis===h.xaxis._id&&x.yaxis===h.yaxis._id&&!1===x.cliponaxis){h._hasClipOnAxisFalse=!0;break}}}var b,_=d.list(f,null,!0);for(a=0;a<_.length;a++){var w=null;(b=_[a]).overlaying&&(w=d.getFromId(f,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:d.getFromId(f,b.anchor)}for(a=0;a<_.length;a++)if((b=_[a])._counterAxes.sort(d.idSort),b._subplotsWith.sort(c.subplotSort),b._mainSubplot=M(b,t),b._counterAxes.length&&(b.spikemode&&-1!==b.spikemode.indexOf("across")||b.automargin&&b.mirror&&"free"!==b.anchor||o.getComponentMethod("rangeslider","isVisible")(b))){var T=1,k=0;for(i=0;i<b._counterAxes.length;i++){var A=d.getFromId(f,b._counterAxes[i]);T=Math.min(T,A.domain[0]),k=Math.max(k,A.domain[1])}T<k&&(b._counterDomainMin=T,b._counterDomainMax=k)}},x.clearExpandedTraceDefaultColors=function(e){var t,r,n;for(r=[],(t=e._module._colorAttrs)||(e._module._colorAttrs=t=[],l.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++){c.nestedProperty(e,"_input."+t[n]).get()||c.nestedProperty(e,t[n]).set(null)}},x.supplyDataDefaults=function(e,t,r,n){var a,i,l,u=n._modules,f=n._visibleModules,d=n._basePlotModules,p=0,h=0;function g(e){t.push(e);var r=e._module;r&&(c.pushUnique(u,r),!0===e.visible&&c.pushUnique(f,r),c.pushUnique(d,e._module.basePlotModule),p++,!1!==e._input.visible&&h++)}n._transformModules=[];var v={},y=[],b=(r.template||{}).data||{},_=s.traceTemplater(b);for(a=0;a<e.length;a++){if(l=e[a],(i=_.newTrace(l)).uid=n._traceUids[a],x.supplyTraceDefaults(l,i,h,n,a),i.index=a,i._input=l,i._expandedIndex=p,i.transforms&&i.transforms.length)for(var w=!1!==l.visible&&!1===i.visible,T=L(i,t,r,n),k=0;k<T.length;k++){var M=T[k],A={_template:i._template,type:i.type,uid:i.uid+k};w&&!1===M.visible&&delete M.visible,x.supplyTraceDefaults(M,A,p,n,a),m(A,M),A.index=a,A._input=l,A._fullInput=i,A._expandedIndex=p,A._expandedInput=M,g(A)}else i._fullInput=i,i._expandedInput=i,g(i);o.traceIs(i,"carpetAxis")&&(v[i.carpet]=i),o.traceIs(i,"carpetDependent")&&y.push(a)}for(a=0;a<y.length;a++)if((i=t[y[a]]).visible){var S=v[i.carpet];i._carpet=S,S&&S.visible?(i.xaxis=S.xaxis,i.yaxis=S.yaxis):i.visible=!1}},x.supplyAnimationDefaults=function(e){var t;e=e||{};var r={};function n(t,n){return c.coerce(e||{},r,h,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]=x.supplyAnimationFrameDefaults(e.frame[t]||{});else r.frame=x.supplyAnimationFrameDefaults(e.frame||{});if(Array.isArray(e.transition))for(r.transition=[],t=0;t<e.transition.length;t++)r.transition[t]=x.supplyAnimationTransitionDefaults(e.transition[t]||{});else r.transition=x.supplyAnimationTransitionDefaults(e.transition||{});return r},x.supplyAnimationFrameDefaults=function(e){var t={};function r(r,n){return c.coerce(e||{},t,h.frame,r,n)}return r("duration"),r("redraw"),t},x.supplyAnimationTransitionDefaults=function(e){var t={};function r(r,n){return c.coerce(e||{},t,h.transition,r,n)}return r("duration"),r("easing"),t},x.supplyFrameDefaults=function(e){var t={};function r(r,n){return c.coerce(e,t,g,r,n)}return r("group"),r("name"),r("traces"),r("baseframe"),r("data"),r("layout"),t},x.supplyTraceDefaults=function(e,t,r,n,a){var i,l=n.colorway||u.defaults,s=l[r%l.length];function f(r,n){return c.coerce(e,t,x.attributes,r,n)}var d=f("visible");f("type"),f("name",n._traceWord+" "+a),f("uirevision",n.uirevision);var p=x.getModule(t);if(t._module=p,p){var h=p.basePlotModule,g=h.attr,v=h.attributes;if(g&&v){var m=n._subplots,y="";if(d||"gl2d"!==h.name){if(Array.isArray(g))for(i=0;i<g.length;i++){var b=g[i],_=c.coerce(e,t,v,b);m[b]&&c.pushUnique(m[b],_),y+=_}else y=c.coerce(e,t,v,g);m[h.name]&&c.pushUnique(m[h.name],y)}}}return d&&(f("customdata"),f("ids"),f("meta"),o.traceIs(t,"showLegend")?(c.coerce(e,t,p.attributes.showlegend?p.attributes:x.attributes,"showlegend"),f("legendgroup"),t._dfltShowLegend=!0):t._dfltShowLegend=!1,p&&p.supplyDefaults(e,t,s,n),o.traceIs(t,"noOpacity")||f("opacity"),o.traceIs(t,"notLegendIsolatable")&&(t.visible=!!t.visible),o.traceIs(t,"noHover")||(t.hovertemplate||c.coerceHoverinfo(e,t,n),"parcats"!==t.type&&o.getComponentMethod("fx","supplyDefaults")(e,t,s,n)),p&&p.selectPoints&&f("selectedpoints"),x.supplyTransformDefaults(e,t,n)),t},x.hasMakesDataTransform=A,x.supplyTransformDefaults=function(e,t,r){if(t._length||A(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=[],s=0;s<o.length;s++){var u,f=o[s],d=f.type,p=b[d],h=!(f._module&&f._module===p),g=p&&"function"==typeof p.transform;p||c.warn("Unrecognized transform type "+d+"."),p&&p.supplyDefaults&&(h||g)?((u=p.supplyDefaults(f,t,r,e)).type=d,u._module=p,c.pushUnique(a,p)):u=c.extendFlat({},f),l.push(u)}}},x.supplyLayoutGlobalDefaults=function(e,t,r){function n(r,n){return c.coerce(e,t,x.layoutAttributes,r,n)}var a=e.template;c.isPlainObject(a)&&(t.template=a,t._template=a.layout,t._dataTemplate=a.data),n("autotypenumbers");var i=c.coerceFont(n,"font");n("title.text",t._dfltTitle.plot),c.coerceFont(n,"title.font",{family:i.family,size:Math.round(1.4*i.size),color:i.color}),n("title.xref"),n("title.yref"),n("title.x"),n("title.y"),n("title.xanchor"),n("title.yanchor"),n("title.pad.t"),n("title.pad.r"),n("title.pad.b"),n("title.pad.l"),n("uniformtext.mode")&&n("uniformtext.minsize"),n("autosize",!(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&&x.sanitizeMargins(t),o.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",u.addOpacity(t.paper_bgcolor,.5));var s=u.contrast(u.rgb(t.modebar.bgcolor));n("modebar.color",u.addOpacity(s,.3)),n("modebar.activecolor",u.addOpacity(s,.7)),n("modebar.uirevision",l),o.getComponentMethod("shapes","supplyDrawNewShapeDefaults")(e,t,n),n("meta"),c.isPlainObject(e.transition)&&(n("transition.duration"),n("transition.easing"),n("transition.ordering")),o.getComponentMethod("calendars","handleDefaults")(e,t,"calendar"),o.getComponentMethod("fx","supplyLayoutGlobalDefaults")(e,t,n)},x.plotAutoSize=function(e,t,r){var n,a,o=e._context||{},l=o.frameMargins,s=c.isPlotDiv(e);if(s&&e.emit("plotly_autosize"),o.fillFrame)n=window.innerWidth,a=window.innerHeight,document.body.style.overflow="hidden";else{var u=s?window.getComputedStyle(e):{};if(n=S(u.width)||S(u.maxWidth)||r.width,a=S(u.height)||S(u.maxHeight)||r.height,i(l)&&l>0){var f=1-2*l;n=Math.round(f*n),a=Math.round(f*a)}}var d=x.layoutAttributes.width.min,p=x.layoutAttributes.height.min;n<d&&(n=d),a<p&&(a=p);var h=!t.width&&Math.abs(r.width-n)>1,g=!t.height&&Math.abs(r.height-a)>1;(g||h)&&(h&&(r.width=n),g&&(r.height=a)),e._initialAutoSize||(e._initialAutoSize={width:n,height:a}),x.sanitizeMargins(r)},x.supplyLayoutModuleDefaults=function(e,t,r,n){var a,i,l,s=o.componentsRegistry,u=t._basePlotModules,f=o.subplotsRegistry.cartesian;for(a in s)(l=s[a]).includeBasePlot&&l.includeBasePlot(e,t);for(var d in u.length||u.push(f),t._has("cartesian")&&(o.getComponentMethod("grid","contentDefaults")(e,t),f.finalizeSubplots(e,t)),t._subplots)t._subplots[d].sort(c.subplotSort);for(i=0;i<u.length;i++)(l=u[i]).supplyLayoutDefaults&&l.supplyLayoutDefaults(e,t,r);var p=t._modules;for(i=0;i<p.length;i++)(l=p[i]).supplyLayoutDefaults&&l.supplyLayoutDefaults(e,t,r);var h=t._transformModules;for(i=0;i<h.length;i++)(l=h[i]).supplyLayoutDefaults&&l.supplyLayoutDefaults(e,t,r,n);for(a in s)(l=s[a]).supplyLayoutDefaults&&l.supplyLayoutDefaults(e,t,r)},x.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)),c.clearThrottle(),c.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()},x.style=function(e){var t,r=e._fullLayout._visibleModules,n=[];for(t=0;t<r.length;t++){var a=r[t];a.style&&c.pushUnique(n,a.style)}for(t=0;t<n.length;t++)n[t](e)},x.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))}},x.clearAutoMarginIds=function(e){e._fullLayout._pushmarginIds={}},x.allowAutoMargin=function(e,t){e._fullLayout._pushmarginIds[t]=1};x.autoMargin=function(e,t,r){var n=e._fullLayout,a=n.width,i=n.height,o=n.margin,l=c.constrain(a-o.l-o.r,2,64),s=c.constrain(i-o.t-o.b,2,64),u=Math.max(0,a-l),f=Math.max(0,i-s),d=n._pushmargin,p=n._pushmarginIds;if(!1!==o.autoexpand){if(r){var h=r.pad;if(void 0===h&&(h=Math.min(12,o.l,o.r,o.t,o.b)),u){var g=(r.l+r.r)/u;g>1&&(r.l/=g,r.r/=g)}if(f){var v=(r.t+r.b)/f;v>1&&(r.t/=v,r.b/=v)}var m=void 0!==r.xl?r.xl:r.x,y=void 0!==r.xr?r.xr:r.x,b=void 0!==r.yt?r.yt:r.y,_=void 0!==r.yb?r.yb:r.y;d[t]={l:{val:m,size:r.l+h},r:{val:y,size:r.r+h},b:{val:_,size:r.b+h},t:{val:b,size:r.t+h}},p[t]=1}else delete d[t],delete p[t];if(!n._replotting)return x.doAutoMargin(e)}},x.doAutoMargin=function(e){var t=e._fullLayout,r=t.width,n=t.height;t._size||(t._size={}),C(t);var a=t._size,l=t.margin,s=c.extendFlat({},a),u=l.l,f=l.r,p=l.t,h=l.b,g=t._pushmargin,v=t._pushmarginIds;if(!1!==t.margin.autoexpand){for(var m in g)v[m]||delete g[m];for(var y in g.base={l:{val:0,size:u},r:{val:1,size:f},t:{val:1,size:p},b:{val:0,size:h}},g){var b=g[y].l||{},_=g[y].b||{},w=b.val,T=b.size,k=_.val,M=_.size;for(var A in g){if(i(T)&&g[A].r){var L=g[A].r.val,S=g[A].r.size;if(L>w){var O=(T*L+(S-r)*w)/(L-w),D=(S*(1-w)+(T-r)*(1-L))/(L-w);O+D>u+f&&(u=O,f=D)}}if(i(M)&&g[A].t){var P=g[A].t.val,z=g[A].t.size;if(P>k){var R=(M*P+(z-n)*k)/(P-k),E=(z*(1-k)+(M-n)*(1-P))/(P-k);R+E>h+p&&(h=R,p=E)}}}}}var I=c.constrain(r-l.l-l.r,2,64),F=c.constrain(n-l.t-l.b,2,64),N=Math.max(0,r-I),H=Math.max(0,n-F);if(N){var B=(u+f)/N;B>1&&(u/=B,f/=B)}if(H){var j=(h+p)/H;j>1&&(h/=j,p/=j)}if(a.l=Math.round(u),a.r=Math.round(f),a.t=Math.round(p),a.b=Math.round(h),a.p=Math.round(l.pad),a.w=Math.round(r)-a.l-a.r,a.h=Math.round(n)-a.t-a.b,!t._replotting&&x.didMarginChange(s,a)){"_redrawFromAutoMarginCount"in t?t._redrawFromAutoMarginCount++:t._redrawFromAutoMarginCount=1;var V=3*(1+Object.keys(v).length);if(t._redrawFromAutoMarginCount<V)return o.call("plot",e);t._size=s,c.warn("Too many auto-margin redraws.")}!function(e){for(var t=d.list(e,"",!0),r=0;r<t.length;r++){var n=t[r]._hideOutOfRangeInsideTickLabels;n&&n()}}(e)};var O=["l","r","t","b","p","w","h"];function D(e,t,r){var n=!1;var a=[x.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,x.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 o.call("redraw",e)})),e._transitionData._interruptCallbacks.push((function(){e.emit("plotly_transitioninterrupted",[])}));var i=0,l=0;function s(){return i++,function(){l++,n||l!==i||function(t){if(!e._transitionData)return;(function(e){if(e)for(;e.length;)e.shift()})(e._transitionData._interruptCallbacks),Promise.resolve().then((function(){if(r.redraw)return o.call("redraw",e)})).then((function(){e._transitioning=!1,e._transitioningWithDuration=!1,e.emit("plotly_transitioned",[])})).then(t)}(a)}}r.runFn(s),setTimeout(s())}))}],i=c.syncOrAsync(a,e);return i&&i.then||(i=Promise.resolve()),i.then((function(){return e}))}x.didMarginChange=function(e,t){for(var r=0;r<O.length;r++){var n=O[r],a=e[n],o=t[n];if(!i(a)||Math.abs(o-a)>1)return!0}return!1},x.graphJson=function(e,t,r,n,a,i){(a&&t&&!e._fullData||a&&!t&&!e._fullLayout)&&x.supplyDefaults(e);var o=a?e._fullData:e.data,l=a?e._fullLayout:e.layout,s=(e._transitionData||{})._frames;function u(e,t){if("function"==typeof e)return t?"_function_":null;if(c.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&&!c.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)})):c.isTypedArray(e)?c.simpleMap(e,c.identity):c.isJSDate(e)?c.ms2DateTimeLocal(+e):e}var f={data:(o||[]).map((function(e){var r=u(e);return t&&delete r.fit,r}))};if(!t&&(f.layout=u(l),a)){var d=l._size;f.layout.computed={margin:{b:d.b,l:d.l,r:d.r,t:d.t}}}return e.framework&&e.framework.isPolar&&(f=e.framework.getConfig()),s&&(f.frames=u(s)),i&&(f.config=u(e._context,!0)),"object"===n?f:JSON.stringify(f)},x.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()},x.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=x.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++)null!=(a=n[r])&&(-1===(i=u.traces.indexOf(a))&&(i=u.data.length,u.traces[i]=a),u.data[i]=x.extendTrace(u.data[i],l.data[r]))}return u},x.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)}},x.extendObjectWithContainers=function(e,t,r){var n,a,i,o,l,s,u,f=c.extendDeepNoArrays({},t||{}),d=c.expandObjectPaths(f),p={};if(r&&r.length)for(i=0;i<r.length;i++)void 0===(a=(n=c.nestedProperty(d,r[i])).get())?c.nestedProperty(p,r[i]).set(null):(n.set(null),c.nestedProperty(p,r[i]).set(a));if(e=c.extendDeepNoArrays(e||{},d),r&&r.length)for(i=0;i<r.length;i++)if(s=c.nestedProperty(p,r[i]).get()){for(u=(l=c.nestedProperty(e,r[i])).get(),Array.isArray(u)||(u=[],l.set(u)),o=0;o<s.length;o++){var h=s[o];u[o]=null===h?null:x.extendObjectWithContainers(u[o],h)}l.set(u)}return e},x.dataArrayContainers=["transforms","dimensions"],x.layoutArrayContainers=o.layoutArrayContainers,x.extendTrace=function(e,t){return x.extendObjectWithContainers(e,t,x.dataArrayContainers)},x.extendLayout=function(e,t){return x.extendObjectWithContainers(e,t,x.layoutArrayContainers)},x.transition=function(e,t,r,n,a,i){var o={redraw:a.redraw},l={},s=[];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]]=x.extendTrace(e.data[i[o]],t[o])}}var p=c.expandObjectPaths(c.extendDeepNoArrays({},r)),h=/^[xy]axis[0-9]*$/;for(var g in p)h.test(g)&&delete p[g].range;x.extendLayout(e.layout,p),delete e.calcdata,x.supplyDefaults(e),x.doCalcdata(e);var v=c.expandObjectPaths(r);if(v){var m=e._fullLayout._plots;for(var y in m){var b=m[y],_=b.xaxis,w=b.yaxis,T=_.range.slice(),k=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()),T&&M&&(_.r2l(T[0])!==_.r2l(M[0])||_.r2l(T[1])!==_.r2l(M[1]))&&(L={xr0:T,xr1:M}),k&&A&&(w.r2l(k[0])!==w.r2l(A[0])||w.r2l(k[1])!==w.r2l(A[1]))&&(S={yr0:k,yr1:A}),(L||S)&&s.push(c.extendFlat({plotinfo:b},L,S))}}return Promise.resolve()},o.runFn=function(t){var n,a,o=e._fullLayout._basePlotModules,u=s.length;if(r)for(a=0;a<o.length;a++)o[a].transitionAxes&&o[a].transitionAxes(e,s,i,t);for(var f in u?((n=c.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)}},D(e,i,o)},x.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 s=e[i],u=s.xaxis,f=s.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(c.extendFlat({plotinfo:s},v,m))}return Promise.resolve()},o.runFn=function(r){for(var n,a,o,s=e._fullData,u=e._fullLayout._basePlotModules,f=[],d=0;d<s.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=c.extendFlat({},i,{duration:0}),o=f,a=i,setTimeout(p,i.duration),h()):(n=i,o=null,a=c.extendFlat({},i,{duration:0}),setTimeout(h,n.duration),p()):l.length?(n=i,p()):t.anim&&(o=f,a=i,h())},D(e,i,o)},x.doCalcdata=function(e,t){var r,n,a,i,s=d.list(e),u=e._fullData,p=e._fullLayout,h=new Array(u.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<u.length;a++)Array.isArray(t)&&-1===t.indexOf(a)&&(h[a]=g[a]);for(a=0;a<u.length;a++)(r=u[a])._arrayAttrs=l.findArrayAttributes(r),r._extremes={};var v=p._subplots.polar||[];for(a=0;a<v.length;a++)s.push(p[v[a]].radialaxis,p[v[a]].angularaxis);for(var m in p._colorAxes){var y=p[m];!1!==y.cauto&&(delete y.cmin,delete y.cmax)}var x=!1;function _(t){if(r=u[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(i=0;i<r.transforms.length;i++){var o=r.transforms[i];(n=b[o.type])&&n.calcTransform&&(r._hasCalcTransform=!0,x=!0,n.calcTransform(e,r,o))}}}function w(t,a){if(r=u[t],!!(n=r._module).isContainer===a){var o=[];if(!0===r.visible&&0!==r._length){delete r._indexToPoints;var l=r.transforms||[];for(i=l.length-1;i>=0;i--)if(l[i].enabled){r._indexToPoints=l[i]._indexToPoints;break}n&&n.calc&&(o=n.calc(e,r))}Array.isArray(o)&&o[0]||(o=[{x:f,y:f}]),o[0].t||(o[0].t={}),o[0].trace=r,h[t]=o}}for(z(s,u,p),a=0;a<u.length;a++)w(a,!0);for(a=0;a<u.length;a++)_(a);for(x&&z(s,u,p),a=0;a<u.length;a++)w(a,!0);for(a=0;a<u.length;a++)w(a,!1);R(e);var T=function(e,t){var r,n,a,i,l,s=[];function u(e,r,n){var a=r._id.charAt(0);if("histogram2dcontour"===e){var i=r._counterAxes[0],o=d.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||l&&e===n[t].length-1||s&&t===n.length-1?-1:("y"===a?t:e)-1}}return function(e,t){return"y"===a?t:e}}var f={min:function(e){return c.aggNums(Math.min,null,e)},max:function(e){return c.aggNums(Math.max,null,e)},sum:function(e){return c.aggNums((function(e,t){return e+t}),null,e)},total:function(e){return c.aggNums((function(e,t){return e+t}),null,e)},mean:function(e){return c.mean(e)},median:function(e){return c.median(e)}};for(r=0;r<e.length;r++){var p=e[r];if("category"===p.type){var h=p.categoryorder.match(P);if(h){var g=h[1],v=h[2],m=p._id.charAt(0),y="x"===m,x=[];for(n=0;n<p._categories.length;n++)x.push([p._categories[n],[]]);for(n=0;n<p._traceIndices.length;n++){var b=p._traceIndices[n],_=t._fullData[b];if(!0===_.visible){var w=_.type;o.traceIs(_,"histogram")&&(delete _._xautoBinFinished,delete _._yautoBinFinished);var T="splom"===w,k="scattergl"===w,M=t.calcdata[b];for(a=0;a<M.length;a++){var A,L,S=M[a];if(T){var C=_._axesDim[p._id];if(!y){var O=_._diag[C][0];O&&(p=t._fullLayout[d.id2name(O)])}var D=S.trace.dimensions[C].values;for(i=0;i<D.length;i++)for(A=p._categoriesMap[D[i]],l=0;l<S.trace.dimensions.length;l++)if(l!==C){var z=S.trace.dimensions[l];x[A][1].push(z.values[i])}}else if(k){for(i=0;i<S.t.x.length;i++)y?(A=S.t.x[i],L=S.t.y[i]):(A=S.t.y[i],L=S.t.x[i]),x[A][1].push(L);S.t&&S.t._scene&&delete S.t._scene.dirty}else if(S.hasOwnProperty("z")){L=S.z;var R=u(_.type,p,L);for(i=0;i<L.length;i++)for(l=0;l<L[i].length;l++)(A=R(l,i))+1&&x[A][1].push(L[i][l])}else for(void 0===(A=S.p)&&(A=S[m]),void 0===(L=S.s)&&(L=S.v),void 0===L&&(L=y?S.y:S.x),Array.isArray(L)||(L=void 0===L?[]:[L]),i=0;i<L.length;i++)x[A][1].push(L[i])}}}p._categoriesValue=x;var E=[];for(n=0;n<x.length;n++)E.push([x[n][0],f[g](x[n][1])]);E.sort((function(e,t){return e[1]-t[1]})),p._categoriesAggregatedValue=E,p._initialCategories=E.map((function(e){return e[0]})),"descending"===v&&p._initialCategories.reverse(),s=s.concat(p.sortByInitialCategories())}}}return s}(s,e);if(T.length){for(p._numBoxes=0,p._numViolins=0,a=0;a<T.length;a++)w(T[a],!0);for(a=0;a<T.length;a++)w(T[a],!1);R(e)}o.getComponentMethod("fx","calc")(e),o.getComponentMethod("errorbars","calc")(e)};var P=/(total|sum|min|max|mean|median) (ascending|descending)/;function z(e,t,r){var n={};function a(e){e.clearCalc(),"multicategory"===e.type&&e.setupMultiCategory(t),n[e._id]=1}c.simpleMap(e,a);for(var i=r._axisMatchGroups||[],o=0;o<i.length;o++)for(var l in i[o])n[l]||a(r[d.id2name(l)])}function R(e){var t,r,n,a=e._fullLayout,i=a._visibleModules,o={};for(r=0;r<i.length;r++){var l=i[r],s=l.crossTraceCalc;if(s){var u=l.basePlotModule.name;o[u]?c.pushUnique(o[u],s):o[u]=[s]}}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)}}x.rehover=function(e){e._fullLayout._rehover&&e._fullLayout._rehover()},x.redrag=function(e){e._fullLayout._redrag&&e._fullLayout._redrag()},x.generalUpdatePerTraceModule=function(e,t,r,n){var a,i=t.traceHash,o={};for(a=0;a<r.length;a++){var l=r[a],s=l[0].trace;s.visible&&(o[s.type]=o[s.type]||[],o[s.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,c.filterVisible(p),n)}t.traceHash=o},x.plotBasePlot=function(e,t,r,n,a){var i=o.getModule(e),l=v(t.calcdata,i)[0];i.plot(t,l,n,a)},x.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":82,"../constants/numerical":189,"../lib":210,"../plot_api/plot_schema":244,"../plot_api/plot_template":245,"../plots/get_data":286,"../registry":298,"./animation_attributes":250,"./attributes":252,"./cartesian/axis_ids":259,"./cartesian/handle_outline":266,"./command":282,"./font_attributes":284,"./frame_attributes":285,"./layout_attributes":288,d3:16,"d3-time-format":14,"fast-isnumeric":18}],291:[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":204,"../../../traces/scatter/attributes":399}],292:[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":204,"../../../plot_api/edit_types":238,"../../cartesian/layout_attributes":270}],293:[function(e,t,r){"use strict";(t.exports=e("./micropolar")).manager=e("./micropolar_manager")},{"./micropolar":294,"./micropolar_manager":295}],294:[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"undefined"==typeof r||!0===r})),h=!1,g=p.map((function(e,t){return h=h||"undefined"!=typeof e.groupId,e}));if(h){var v=n.nest().key((function(e,t){return"undefined"!=typeof e.groupId?e.groupId:"unstacked"})).entries(g),m=[],y=v.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],m.push(r),r=o.util.sumArrays(e.r,r)})),e.values}));p=n.merge(y)}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 x=Math.min(d.width-d.margin.left-d.margin.right,d.height-d.margin.top-d.margin.bottom)/2;x=Math.max(10,x);var b,_=[d.margin.left+x,d.margin.top+x];h?b=[0,n.max(o.util.sumArrays(o.util.arrayLast(p).r[0],o.util.arrayLast(m)))]:b=n.extent(o.util.flattenArray(p.map((function(e,t){return e.r}))));d.radialAxis.domain!=o.DATAEXTENT&&(b[0]=0),r=n.scale.linear().domain(d.radialAxis.domain!=o.DATAEXTENT&&d.radialAxis.domain?d.radialAxis.domain:b).range([0,x]),u.layout.radialAxis.domain=r.domain();var w,T=o.util.flattenArray(p.map((function(e,t){return e.t}))),k="string"==typeof T[0];k&&(T=o.util.deduplicate(T),w=T.slice(),T=n.range(T.length),p=p.map((function(e,t){var r=e;return e.t=[T],h&&(r.yStack=e.yStack),r})));var M=p.filter((function(e,t){return"LinePlot"===e.geometry||"DotPlot"===e.geometry})).length===p.length,A=null===d.needsEndSpacing?k||!M:d.needsEndSpacing,L=d.angularAxis.domain&&d.angularAxis.domain!=o.DATAEXTENT&&!k&&d.angularAxis.domain[0]>=0?d.angularAxis.domain:n.extent(T),S=Math.abs(T[1]-T[0]);M&&!k&&(S=0);var C=L.slice();A&&k&&(C[1]+=S);var O=d.angularAxis.ticksCount||4;O>8&&(O=O/(O/8)+O%8),d.angularAxis.ticksStep&&(O=(C[1]-C[0])/O);var D=d.angularAxis.ticksStep||(C[1]-C[0])/(O*(d.minorTicks+1));w&&(D=Math.max(Math.round(D),1)),C[2]||(C[2]=D);var P=n.range.apply(this,C);if(P=P.map((function(e,t){return parseFloat(e.toPrecision(12))})),l=n.scale.linear().domain(C.slice(0,2)).range("clockwise"===d.direction?[0,360]:[360,0]),u.layout.angularAxis.domain=l.domain(),u.layout.angularAxis.endPadding=A?S:0,"undefined"==typeof(e=n.select(this).select("svg.chart-root"))||e.empty()){var z=(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"),R=this.appendChild(this.ownerDocument.importNode(z.documentElement,!0));e=n.select(R)}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 E,I=e.select(".chart-group"),F={fill:"none",stroke:d.tickColor},N={"font-size":d.font.size,"font-family":d.font.family,fill:d.font.color,"text-shadow":["-1px 0px","1px -1px","-1px 1px","1px 1px"].map((function(e,t){return" "+e+" 0 "+d.font.outlineColor})).join(",")};if(d.showLegend){E=e.select(".legend-group").attr({transform:"translate("+[x,d.margin.top]+")"}).style({display:"block"});var H=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="undefined"==typeof 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:E,elements:H,reverseOrder:d.legend.reverseOrder})})();var B=E.node().getBBox();x=Math.min(d.width-B.width-d.margin.left-d.margin.right,d.height-d.margin.top-d.margin.bottom)/2,x=Math.max(10,x),_=[d.margin.left+x,d.margin.top+x],r.range([0,x]),u.layout.radialAxis.domain=r.domain(),E.attr("transform","translate("+[_[0]+x,_[1]-x]+")")}else E=e.select(".legend-group").style({display:"none"});e.attr({width:d.width,height:d.height}).style({opacity:d.opacity}),I.attr("transform","translate("+_+")").style({cursor:"crosshair"});var j=[(d.width-(d.margin.left+d.margin.right+2*x+(B?B.width:0)))/2,(d.height-(d.margin.top+d.margin.bottom+2*x))/2];if(j[0]=Math.max(0,j[0]),j[1]=Math.max(0,j[1]),e.select(".outer-group").attr("transform","translate("+j+")"),d.title&&d.title.text){var V=e.select("g.title-group text").style(N).text(d.title.text),U=V.node().getBBox();V.attr({x:_[0]-U.width/2,y:_[1]-x-20})}var q=e.select(".radial.axis-group");if(d.radialAxis.gridLinesVisible){var G=q.selectAll("circle.grid-circle").data(r.ticks(5));G.enter().append("circle").attr({class:"grid-circle"}).style(F),G.attr("r",r),G.exit().remove()}q.select("circle.outside-circle").attr({r:x}).style(F);var Z=e.select("circle.background-circle").attr({r:x}).style({fill:d.backgroundColor,stroke:d.stroke});function Y(e,t){return l(e)%360+d.orientation}if(d.radialAxis.visible){var X=n.svg.axis().scale(r).ticks(5).tickSize(5);q.call(X).attr({transform:"rotate("+d.radialAxis.orientation+")"}),q.selectAll(".domain").style(F),q.selectAll("g>text").text((function(e,t){return this.textContent+d.radialAxis.ticksSuffix})).style(N).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,N["font-size"]]+")":"translate("+[0,N["font-size"]]+")"}}),q.selectAll("g>line").style({stroke:"black"})}var W=e.select(".angular.axis-group").selectAll("g.angular-tick").data(P),Q=W.enter().append("g").classed("angular-tick",!0);W.attr({transform:function(e,t){return"rotate("+Y(e)+")"}}).style({display:d.angularAxis.visible?"block":"none"}),W.exit().remove(),Q.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(F),Q.selectAll(".minor").style({stroke:d.minorTickColor}),W.select("line.grid-line").attr({x1:d.tickLength?x-d.tickLength:0,x2:x}).style({display:d.angularAxis.gridLinesVisible?"block":"none"}),Q.append("text").classed("axis-text",!0).style(N);var J=W.select("text.axis-text").attr({x:x+d.labelOffset,dy:i+"em",transform:function(e,t){var r=Y(e),n=x+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?"":w?w[e]+d.angularAxis.ticksSuffix:e+d.angularAxis.ticksSuffix})).style(N);d.angularAxis.rewriteTicks&&J.text((function(e,t){return t%(d.minorTicks+1)!=0?"":d.angularAxis.rewriteTicks(this.textContent,t)}));var $=n.max(I.selectAll(".angular-tick text")[0].map((function(e,t){return e.getCTM().e+e.getBBox().width})));E.attr({transform:"translate("+[x+$,d.margin.top]+")"});var K=e.select("g.geometry-group").selectAll("g").size()>0,ee=e.select("g.geometry-group").selectAll("g.geometry").data(p);if(ee.enter().append("g").attr({class:function(e,t){return"geometry geometry"+t}}),ee.exit().remove(),p[0]||K){var te=[];p.forEach((function(e,t){var n={};n.radialScale=r,n.angularScale=l,n.container=ee.filter((function(e,r){return r==t})),n.geometry=e.geometry,n.orientation=d.orientation,n.direction=d.direction,n.index=t,te.push({data:e,geometryConfig:n})}));var re=n.nest().key((function(e,t){return"undefined"!=typeof e.data.groupId||"unstacked"})).entries(te),ne=[];re.forEach((function(e,t){"unstacked"===e.key?ne=ne.concat(e.values.map((function(e,t){return[e]}))):ne.push(e.values)})),ne.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 ae,ie,oe=e.select(".guides-group"),le=e.select(".tooltips-group"),se=o.tooltipPanel().config({container:le,fontSize:8})(),ce=o.tooltipPanel().config({container:le,fontSize:8})(),ue=o.tooltipPanel().config({container:le,hasTick:!0})();if(!k){var fe=oe.select("line").attr({x1:0,y1:0,y2:0}).style({stroke:"grey","pointer-events":"none"});I.on("mousemove.angular-guide",(function(e,t){var r=o.util.getMousePos(Z).angle;fe.attr({x2:-x,transform:"rotate("+r+")"}).style({opacity:.5});var n=(r+180+360-d.orientation)%360;ae=l.invert(n);var a=o.util.convertToCartesian(x+12,r+180);se.text(o.util.round(ae)).move([a[0]+_[0],a[1]+_[1]])})).on("mouseout.angular-guide",(function(e,t){oe.select("line").style({opacity:0})}))}var de=oe.select("circle").style({stroke:"grey",fill:"none"});I.on("mousemove.radial-guide",(function(e,t){var n=o.util.getMousePos(Z).radius;de.attr({r:n}).style({opacity:.5}),ie=r.invert(o.util.getMousePos(Z).radius);var a=o.util.convertToCartesian(n,d.radialAxis.orientation);ce.text(o.util.round(ie)).move([a[0]+_[0],a[1]+_[1]])})).on("mouseout.radial-guide",(function(e,t){de.style({opacity:0}),ue.hide(),se.hide(),ce.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=w[t[0]]);var u="t: "+c.t+", r: "+c.r,f=this.getBoundingClientRect(),d=e.node().getBoundingClientRect(),p=[f.left+f.width/2-j[0]-d.left,f.top+f.height/2-j[1]-d.top];ue.config({color:l}).text(u),ue.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")&&ue.show()})).on("mouseout.tooltip",(function(e,t){ue.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("undefined"==typeof 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("undefined"!=typeof e)return e[t]}),e);"undefined"!=typeof i&&(t.reduce((function(e,r,n){if("undefined"!=typeof e)return n===t.length-1&&delete e[r],e[r]}),e),r.reduce((function(e,t,n){return"undefined"==typeof 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"undefined"==typeof 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||"undefined"==typeof 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?("undefined"!=typeof l.tickLength&&(l.angularaxis.ticklen=l.tickLength,delete l.tickLength),l.tickColor&&(l.angularaxis.tickcolor=l.tickColor,delete l.tickColor)):(l.angularAxis&&"undefined"!=typeof l.angularAxis.ticklen&&(l.tickLength=l.angularAxis.ticklen),l.angularAxis&&"undefined"!=typeof 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&&"undefined"!=typeof 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":184,"../../../lib":210,d3:16}],295:[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":82,"../../../lib":210,"./micropolar":294,"./undo_manager":296,d3:16}],296:[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||(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}}}},{}],297:[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":187}],298:[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":202,"./lib/extend":204,"./lib/is_plain_object":211,"./lib/loggers":214,"./lib/noop":219,"./lib/push_unique":224,"./plots/attributes":252,"./plots/layout_attributes":288}],299:[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":210,"../registry":298}],300:[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.width=t.width||null,t.height=t.height||null,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":210,"../plot_api/to_image":248,"./filesaver":301,"./helpers":302}],301:[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":210,"./helpers":302}],302:[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":298}],303:[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":299,"./download":300,"./helpers":302,"./svgtoimg":304,"./toimage":305,"./tosvg":306}],304:[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=e.width||300,v=e.height||150,m=h*g,y=h*v,x=p.getContext("2d"),b=new l;"svg"===c||n.isIE9orBelow()||n.isSafari()?d=i.encodeSVG(s):(f=i.createBlob(s,"svg"),d=i.createObjectURL(f)),p.width=m,p.height=y,b.onload=function(){var r;switch(f=null,i.revokeObjectURL(d),"svg"!==c&&x.drawImage(b,0,0,m,y),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)},b.onerror=function(r){if(f=null,i.revokeObjectURL(d),o(r),!e.promise)return t.emit("error",r)},b.src=d}));return e.promise?r:t}},{"../lib":210,"./helpers":302,events:13}],305:[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":210,"../registry":298,"./cloneplot":299,"./helpers":302,"./svgtoimg":304,"./tosvg":306,events:13}],306:[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 T=(new window.XMLSerializer).serializeToString(d.node());return T=function(e){var t=n.select("body").append("div").style({display:"none"}).html(""),r=e.replace(/(&[^;]*;)/gi,(function(e){return"&lt;"===e?"&#60;":"&rt;"===e?"&#62;":-1!==e.indexOf("<")||-1!==e.indexOf(">")?"":t.html(e).text()}));return t.remove(),r}(T),T=(T=T.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&amp;")).replace(c,"'"),a.isIE()&&(T=(T=(T=T.replace(/"/gi,"'")).replace(/(\('#)([^']*)('\))/gi,'("#$2")')).replace(/(\\')/gi,'"')),T}},{"../components/color":82,"../components/drawing":104,"../constants/xmlns_namespaces":190,"../lib":210,d3:16}],307:[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.hovertext,e,"htx");var a=t.marker;if(a){n.mergeArray(a.opacity,e,"mo",!0),n.mergeArray(a.color,e,"mc");var i=a.line;i&&(n.mergeArray(i.color,e,"mlc"),n.mergeArrayCastPositive(i.width,e,"mlw"))}}},{"../../lib":210}],308:[function(e,t,r){"use strict";var n=e("../scatter/attributes"),a=e("../../plots/template_attributes").hovertemplateAttrs,i=e("../../plots/template_attributes").texttemplateAttrs,o=e("../../components/colorscale/attributes"),l=e("../../plots/font_attributes"),s=e("./constants"),c=e("../../lib/extend").extendFlat,u=l({editType:"calc",arrayOk:!0,colorEditType:"style"}),f=c({},n.marker.line.width,{dflt:0}),d=c({width:f,editType:"calc"},o("marker.line")),p=c({line:d,editType:"calc"},o("marker"),{opacity:{valType:"number",arrayOk:!0,dflt:1,min:0,max:1,editType:"style"}});t.exports={x:n.x,x0:n.x0,dx:n.dx,y:n.y,y0:n.y0,dy:n.dy,xperiod:n.xperiod,yperiod:n.yperiod,xperiod0:n.xperiod0,yperiod0:n.yperiod0,xperiodalignment:n.xperiodalignment,yperiodalignment:n.yperiodalignment,text:n.text,texttemplate:i({editType:"plot"},{keys:s.eventDataKeys}),hovertext:n.hovertext,hovertemplate:a({},{keys:s.eventDataKeys}),textposition:{valType:"enumerated",values:["inside","outside","auto","none"],dflt:"none",arrayOk:!0,editType:"calc"},insidetextanchor:{valType:"enumerated",values:["end","middle","start"],dflt:"end",editType:"plot"},textangle:{valType:"angle",dflt:"auto",editType:"plot"},textfont:c({},u,{}),insidetextfont:c({},u,{}),outsidetextfont:c({},u,{}),constraintext:{valType:"enumerated",values:["inside","outside","both","none"],dflt:"both",editType:"calc"},cliponaxis:c({},n.cliponaxis,{}),orientation:{valType:"enumerated",values:["v","h"],editType:"calc+clearAxisTypes"},base:{valType:"any",dflt:null,arrayOk:!0,editType:"calc"},offset:{valType:"number",dflt:null,arrayOk:!0,editType:"calc"},width:{valType:"number",dflt:null,min:0,arrayOk:!0,editType:"calc"},marker:p,offsetgroup:{valType:"string",dflt:"",editType:"calc"},alignmentgroup:{valType:"string",dflt:"",editType:"calc"},selected:{marker:{opacity:n.selected.marker.opacity,color:n.selected.marker.color,editType:"style"},textfont:n.selected.textfont,editType:"style"},unselected:{marker:{opacity:n.unselected.marker.opacity,color:n.unselected.marker.color,editType:"style"},textfont:n.unselected.textfont,editType:"style"},r:n.r,t:n.t,_deprecated:{bardir:{valType:"enumerated",editType:"calc",values:["v","h"]}}}},{"../../components/colorscale/attributes":89,"../../lib/extend":204,"../../plots/font_attributes":284,"../../plots/template_attributes":297,"../scatter/attributes":399,"./constants":310}],309:[function(e,t,r){"use strict";var n=e("../../plots/cartesian/axes"),a=e("../../plots/cartesian/align_period"),i=e("../../components/colorscale/helpers").hasColorscale,o=e("../../components/colorscale/calc"),l=e("./arrays_to_calcdata"),s=e("../scatter/calc_selection");t.exports=function(e,t){var r,c,u,f,d=n.getFromId(e,t.xaxis||"x"),p=n.getFromId(e,t.yaxis||"y"),h={msUTC:!(!t.base&&0!==t.base)};"h"===t.orientation?(r=d.makeCalcdata(t,"x",h),u=p.makeCalcdata(t,"y"),c=a(t,p,"y",u),f=!!t.yperiodalignment):(r=p.makeCalcdata(t,"y",h),u=d.makeCalcdata(t,"x"),c=a(t,d,"x",u),f=!!t.xperiodalignment);for(var g=Math.min(c.length,r.length),v=new Array(g),m=0;m<g;m++)v[m]={p:c[m],s:r[m]},f&&(v[m].orig_p=u[m]),t.ids&&(v[m].id=String(t.ids[m]));return i(t,"marker")&&o(e,t,{vals:t.marker.color,containerStr:"marker",cLetter:"c"}),i(t,"marker.line")&&o(e,t,{vals:t.marker.line.color,containerStr:"marker.line",cLetter:"c"}),l(v,t),s(v,t),v}},{"../../components/colorscale/calc":90,"../../components/colorscale/helpers":93,"../../plots/cartesian/align_period":253,"../../plots/cartesian/axes":256,"../scatter/calc_selection":401,"./arrays_to_calcdata":307}],310:[function(e,t,r){"use strict";t.exports={TEXTPAD:3,eventDataKeys:["value","label"]}},{}],311:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("../../lib").isArrayOrTypedArray,i=e("../../constants/numerical").BADNUM,o=e("../../registry"),l=e("../../plots/cartesian/axes"),s=e("../../plots/cartesian/constraints").getAxisGroup,c=e("./sieve.js");function u(e,t,r,o,u){if(o.length){var b,_,w,T;switch(function(e,t){var r,i;for(r=0;r<t.length;r++){var o,l=t[r],s=l[0].trace,c="funnel"===s.type?s._base:s.base,u="h"===s.orientation?s.xcalendar:s.ycalendar,f="category"===e.type||"multicategory"===e.type?function(){return null}:e.d2c;if(a(c)){for(i=0;i<Math.min(c.length,l.length);i++)o=f(c[i],0,u),n(o)?(l[i].b=+o,l[i].hasB=1):l[i].b=0;for(;i<l.length;i++)l[i].b=0}else{o=f(c,0,u);var d=n(o);for(o=d?o:0,i=0;i<l.length;i++)l[i].b=o,d&&(l[i].hasB=1)}}}(r,o),u.mode){case"overlay":f(t,r,o,u);break;case"group":for(b=[],_=[],w=0;w<o.length;w++)void 0===(T=o[w])[0].trace.offset?_.push(T):b.push(T);_.length&&function(e,t,r,n,a){var o=new c(n,{sepNegVal:!1,overlapNoMerge:!a.norm});(function(e,t,r,n){for(var a=e._fullLayout,i=r.positions,o=r.distinctPositions,l=r.minDiff,c=r.traces,u=c.length,f=i.length!==o.length,d=l*(1-n.gap),v=s(a,t._id)+c[0][0].trace.orientation,m=a._alignmentOpts[v]||{},y=0;y<u;y++){var x,b,_=c[y],w=_[0].trace,T=m[w.alignmentgroup]||{},k=Object.keys(T.offsetGroups||{}).length,M=(x=k?d/k:f?d/u:d)*(1-(n.groupgap||0));b=k?((2*w._offsetIndex+1-k)*x-M)/2:f?((2*y+1-u)*x-M)/2:-M/2;var A=_[0].t;A.barwidth=M,A.poffset=b,A.bargroupwidth=d,A.bardelta=l}r.binWidth=c[0][0].t.barwidth/100,p(r),h(t,r),g(t,r,f)})(e,t,o,a),function(e){for(var t=e.traces,r=0;r<t.length;r++){var n=t[r];if(void 0===n[0].trace.base)for(var a=new c([n],{sepNegVal:!0,overlapNoMerge:!0}),o=0;o<n.length;o++){var l=n[o];if(l.p!==i){var s=a.put(l.p,l.b+l.s);s&&(l.b=s)}}}}(o),a.norm?(m(o),y(r,o,a)):v(r,o)}(e,t,r,_,u),b.length&&f(t,r,b,u);break;case"stack":case"relative":for(b=[],_=[],w=0;w<o.length;w++)void 0===(T=o[w])[0].trace.base?_.push(T):b.push(T);_.length&&function(e,t,r,n,a){var o=new c(n,{sepNegVal:"relative"===a.mode,overlapNoMerge:!(a.norm||"stack"===a.mode||"relative"===a.mode)});d(t,o,a),function(e,t,r){var n,a,o,s,c,u,f=x(e),d=t.traces;for(s=0;s<d.length;s++)if(n=d[s],"funnel"===(a=n[0].trace).type)for(c=0;c<n.length;c++)(u=n[c]).s!==i&&t.put(u.p,-.5*u.s);for(s=0;s<d.length;s++){n=d[s],a=n[0].trace,o="funnel"===a.type;var p=[];for(c=0;c<n.length;c++)if((u=n[c]).s!==i){var h;h=o?u.s:u.s+u.b;var g=t.put(u.p,h),v=g+h;u.b=g,u[f]=v,r.norm||(p.push(v),u.hasB&&p.push(g))}r.norm||(a._extremes[e._id]=l.findExtremes(e,p,{tozero:!0,padded:!0}))}}(r,o,a);for(var s=0;s<n.length;s++)for(var u=n[s],f=0;f<u.length;f++){var p=u[f];if(p.s!==i)p.b+p.s===o.get(p.p,p.s)&&(p._outmost=!0)}a.norm&&y(r,o,a)}(0,t,r,_,u),b.length&&f(t,r,b,u)}!function(e,t){var r,a,i,o=x(t),l={},s=1/0,c=-1/0;for(r=0;r<e.length;r++)for(i=e[r],a=0;a<i.length;a++){var u=i[a].p;n(u)&&(s=Math.min(s,u),c=Math.max(c,u))}var f=1e4/(c-s),d=l.round=function(e){return String(Math.round(f*(e-s)))};for(r=0;r<e.length;r++){(i=e[r])[0].t.extents=l;var p=i[0].t.poffset,h=Array.isArray(p);for(a=0;a<i.length;a++){var g=i[a],v=g[o]-g.w/2;if(n(v)){var m=g[o]+g.w/2,y=d(g.p);l[y]?l[y]=[Math.min(v,l[y][0]),Math.max(m,l[y][1])]:l[y]=[v,m]}g.p0=g.p+(h?p[a]:p),g.p1=g.p0+g.w,g.s0=g.b,g.s1=g.s0+g.s}}}(o,t)}}function f(e,t,r,n){for(var a=0;a<r.length;a++){var i=r[a],o=new c([i],{unitMinDiff:n.xCat||n.yCat,sepNegVal:!1,overlapNoMerge:!n.norm});d(e,o,n),n.norm?(m(o),y(t,o,n)):v(t,o)}}function d(e,t,r){for(var n=t.minDiff,a=t.traces,i=n*(1-r.gap),o=i*(1-(r.groupgap||0)),l=-o/2,s=0;s<a.length;s++){var c=a[s][0].t;c.barwidth=o,c.poffset=l,c.bargroupwidth=i,c.bardelta=n}t.binWidth=a[0][0].t.barwidth/100,p(t),h(e,t),g(e,t)}function p(e){var t,r,i=e.traces;for(t=0;t<i.length;t++){var o,l=i[t],s=l[0],c=s.trace,u=s.t,f=c._offset||c.offset,d=u.poffset;if(a(f)){for(o=Array.prototype.slice.call(f,0,l.length),r=0;r<o.length;r++)n(o[r])||(o[r]=d);for(r=o.length;r<l.length;r++)o.push(d);u.poffset=o}else void 0!==f&&(u.poffset=f);var p=c._width||c.width,h=u.barwidth;if(a(p)){var g=Array.prototype.slice.call(p,0,l.length);for(r=0;r<g.length;r++)n(g[r])||(g[r]=h);for(r=g.length;r<l.length;r++)g.push(h);if(u.barwidth=g,void 0===f){for(o=[],r=0;r<l.length;r++)o.push(d+(h-g[r])/2);u.poffset=o}}else void 0!==p&&(u.barwidth=p,void 0===f&&(u.poffset=d+(h-p)/2))}}function h(e,t){for(var r=t.traces,n=x(e),a=0;a<r.length;a++)for(var i=r[a],o=i[0].t,l=o.poffset,s=Array.isArray(l),c=o.barwidth,u=Array.isArray(c),f=0;f<i.length;f++){var d=i[f],p=d.w=u?c[f]:c;d[n]=d.p+(s?l[f]:l)+p/2}}function g(e,t,r){var n=t.traces,a=t.minDiff/2;l.minDtick(e,t.minDiff,t.distinctPositions[0],r);for(var i=0;i<n.length;i++){var o,s,c,u,f=n[i],d=f[0],p=d.trace,h=[];for(u=0;u<f.length;u++)s=(o=f[u]).p-a,c=o.p+a,h.push(s,c);if(p.width||p.offset){var g=d.t,v=g.poffset,m=g.barwidth,y=Array.isArray(v),x=Array.isArray(m);for(u=0;u<f.length;u++){o=f[u];var b=y?v[u]:v,_=x?m[u]:m;c=(s=o.p+b)+_,h.push(s,c)}}p._extremes[e._id]=l.findExtremes(e,h,{padded:!1})}}function v(e,t){for(var r=t.traces,n=x(e),a=0;a<r.length;a++){for(var i=r[a],o=i[0].trace,s=[],c=!1,u=0;u<i.length;u++){var f=i[u],d=f.b,p=d+f.s;f[n]=p,s.push(p),f.hasB&&s.push(d),f.hasB&&f.b||(c=!0)}o._extremes[e._id]=l.findExtremes(e,s,{tozero:c,padded:!0})}}function m(e){for(var t=e.traces,r=0;r<t.length;r++)for(var n=t[r],a=0;a<n.length;a++){var o=n[a];o.s!==i&&e.put(o.p,o.b+o.s)}}function y(e,t,r){var a=t.traces,o=x(e),s="fraction"===r.norm?1:100,c=s/1e9,u=e.l2c(e.c2l(0)),f="stack"===r.mode?s:u;function d(t){return n(e.c2l(t))&&(t<u-c||t>f+c||!n(u))}for(var p=0;p<a.length;p++){for(var h=a[p],g=h[0].trace,v=[],m=!1,y=!1,b=0;b<h.length;b++){var _=h[b];if(_.s!==i){var w=Math.abs(s/t.get(_.p,_.s));_.b*=w,_.s*=w;var T=_.b,k=T+_.s;_[o]=k,v.push(k),y=y||d(k),_.hasB&&(v.push(T),y=y||d(T)),_.hasB&&_.b||(m=!0)}}g._extremes[e._id]=l.findExtremes(e,v,{tozero:m,padded:y})}}function x(e){return e._id.charAt(0)}t.exports={crossTraceCalc:function(e,t){for(var r=t.xaxis,n=t.yaxis,a=e._fullLayout,i=e._fullData,l=e.calcdata,s=[],c=[],f=0;f<i.length;f++){var d=i[f];if(!0===d.visible&&o.traceIs(d,"bar")&&d.xaxis===r._id&&d.yaxis===n._id&&("h"===d.orientation?s.push(l[f]):c.push(l[f]),d._computePh))for(var p=e.calcdata[f],h=0;h<p.length;h++)"function"==typeof p[h].ph0&&(p[h].ph0=p[h].ph0()),"function"==typeof p[h].ph1&&(p[h].ph1=p[h].ph1())}var g={xCat:"category"===r.type||"multicategory"===r.type,yCat:"category"===n.type||"multicategory"===n.type,mode:a.barmode,norm:a.barnorm,gap:a.bargap,groupgap:a.bargroupgap};u(e,r,n,c,g),u(e,n,r,s,g)},setGroupPositions:u}},{"../../constants/numerical":189,"../../lib":210,"../../plots/cartesian/axes":256,"../../plots/cartesian/constraints":263,"../../registry":298,"./sieve.js":321,"fast-isnumeric":18}],312:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../components/color"),i=e("../../registry"),o=e("../scatter/xy_defaults"),l=e("../scatter/period_defaults"),s=e("./style_defaults"),c=e("../../plots/cartesian/constraints").getAxisGroup,u=e("./attributes"),f=n.coerceFont;function d(e,t,r,n){var a=t.orientation,i=t[{v:"x",h:"y"}[a]+"axis"],o=c(r,i)+a,l=r._alignmentOpts||{},s=n("alignmentgroup"),u=l[o];u||(u=l[o]={});var f=u[s];f?f.traces.push(t):f=u[s]={traces:[t],alignmentIndex:Object.keys(u).length,offsetGroups:{}};var d=n("offsetgroup"),p=f.offsetGroups,h=p[d];d&&(h||(h=p[d]={offsetIndex:Object.keys(p).length}),t._offsetIndex=h.offsetIndex)}function p(e,t,r,a,i,o){var l=!(!1===(o=o||{}).moduleHasSelected),s=!(!1===o.moduleHasUnselected),c=!(!1===o.moduleHasConstrain),u=!(!1===o.moduleHasCliponaxis),d=!(!1===o.moduleHasTextangle),p=!(!1===o.moduleHasInsideanchor),h=!!o.hasPathbar,g=Array.isArray(i)||"auto"===i,v=g||"inside"===i,m=g||"outside"===i;if(v||m){var y=f(a,"textfont",r.font),x=n.extendFlat({},y),b=!(e.textfont&&e.textfont.color);if(b&&delete x.color,f(a,"insidetextfont",x),h){var _=n.extendFlat({},y);b&&delete _.color,f(a,"pathbar.textfont",_)}m&&f(a,"outsidetextfont",y),l&&a("selected.textfont.color"),s&&a("unselected.textfont.color"),c&&a("constraintext"),u&&a("cliponaxis"),d&&a("textangle"),a("texttemplate")}v&&p&&a("insidetextanchor")}t.exports={supplyDefaults:function(e,t,r,c){function f(r,a){return n.coerce(e,t,u,r,a)}if(o(e,t,c,f)){l(e,t,c,f),f("orientation",t.x&&!t.y?"h":"v"),f("base"),f("offset"),f("width"),f("text"),f("hovertext"),f("hovertemplate");var d=f("textposition");p(e,t,c,f,d,{moduleHasSelected:!0,moduleHasUnselected:!0,moduleHasConstrain:!0,moduleHasCliponaxis:!0,moduleHasTextangle:!0,moduleHasInsideanchor:!0}),s(e,t,f,r,c);var h=(t.marker.line||{}).color,g=i.getComponentMethod("errorbars","supplyDefaults");g(e,t,h||a.defaultLine,{axis:"y"}),g(e,t,h||a.defaultLine,{axis:"x",inherit:"y"}),n.coerceSelectionMarkerOpacity(t,f)}else t.visible=!1},crossTraceDefaults:function(e,t){var r;function a(e){return n.coerce(r._input,r,u,e)}if("group"===t.barmode)for(var i=0;i<e.length;i++)"bar"===(r=e[i]).type&&(r._input,d(0,r,t,a))},handleGroupingDefaults:d,handleText:p}},{"../../components/color":82,"../../lib":210,"../../plots/cartesian/constraints":263,"../../registry":298,"../scatter/period_defaults":419,"../scatter/xy_defaults":426,"./attributes":308,"./style_defaults":323}],313:[function(e,t,r){"use strict";t.exports=function(e,t,r){return e.x="xVal"in t?t.xVal:t.x,e.y="yVal"in t?t.yVal:t.y,t.xa&&(e.xaxis=t.xa),t.ya&&(e.yaxis=t.ya),"h"===r.orientation?(e.label=e.y,e.value=e.x):(e.label=e.x,e.value=e.y),e}},{}],314:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("tinycolor2"),i=e("../../lib").isArrayOrTypedArray;r.coerceString=function(e,t,r){if("string"==typeof t){if(t||!e.noBlank)return t}else if(("number"==typeof t||!0===t)&&!e.strict)return String(t);return void 0!==r?r:e.dflt},r.coerceNumber=function(e,t,r){if(n(t)){t=+t;var a=e.min,i=e.max;if(!(void 0!==a&&t<a||void 0!==i&&t>i))return t}return void 0!==r?r:e.dflt},r.coerceColor=function(e,t,r){return a(t).isValid()?t:void 0!==r?r:e.dflt},r.coerceEnumerated=function(e,t,r){return e.coerceNumber&&(t=+t),-1!==e.values.indexOf(t)?t:void 0!==r?r:e.dflt},r.getValue=function(e,t){var r;return Array.isArray(e)?t<e.length&&(r=e[t]):r=e,r},r.getLineWidth=function(e,t){return 0<t.mlw?t.mlw:i(e.marker.line.width)?0:e.marker.line.width}},{"../../lib":210,"fast-isnumeric":18,tinycolor2:65}],315:[function(e,t,r){"use strict";var n=e("../../components/fx"),a=e("../../registry"),i=e("../../components/color"),o=e("../../lib").fillText,l=e("./helpers").getLineWidth,s=e("../../plots/cartesian/axes").hoverLabelText,c=e("../../constants/numerical").BADNUM;function u(e,t,r,a){var i,l,u,f,d,p,h,g=e.cd,v=g[0].trace,m=g[0].t,y="closest"===a,x="waterfall"===v.type,b=e.maxHoverDistance;function _(e){return e[u]-e.w/2}function w(e){return e[u]+e.w/2}var T=y?_:function(e){return Math.min(_(e),e.p-m.bardelta/2)},k=y?w:function(e){return Math.max(w(e),e.p+m.bardelta/2)};function M(e,t){return n.inbox(e-i,t-i,b+Math.min(1,Math.abs(t-e)/h)-1)}function A(e){return M(T(e),k(e))}function L(e){var t=l,r=e.b,a=e[f];if(x){var i=Math.abs(e.rawS)||0;t>0?a+=i:t<0&&(a-=i)}return n.inbox(r-t,a-t,b+(a-t)/(a-r)-1)}"h"===v.orientation?(i=r,l=t,u="y",f="x",d=L,p=A):(i=t,l=r,u="x",f="y",p=L,d=A);var S=e[u+"a"],C=e[f+"a"];h=Math.abs(S.r2c(S.range[1])-S.r2c(S.range[0]));var O=n.getDistanceFunction(a,d,p,(function(e){return(d(e)+p(e))/2}));if(n.getClosest(g,O,e),!1!==e.index&&g[e.index].p!==c){y||(T=function(e){return Math.min(_(e),e.p-m.bargroupwidth/2)},k=function(e){return Math.max(w(e),e.p+m.bargroupwidth/2)});var D=g[e.index],P=v.base?D.b+D.s:D.s;e[f+"0"]=e[f+"1"]=C.c2p(D[f],!0),e[f+"LabelVal"]=P;var z=m.extents[m.extents.round(D.p)];e[u+"0"]=S.c2p(y?T(D):z[0],!0),e[u+"1"]=S.c2p(y?k(D):z[1],!0);var R=void 0!==D.orig_p;return e[u+"LabelVal"]=R?D.orig_p:D.p,e.labelLabel=s(S,e[u+"LabelVal"]),e.valueLabel=s(C,e[f+"LabelVal"]),e.baseLabel=s(C,D.b),e.spikeDistance=(L(D)+function(e){return M(_(e),w(e))}(D))/2-b,e[u+"Spike"]=S.c2p(D.p,!0),o(D,v,e),e.hovertemplate=v.hovertemplate,e}}function f(e,t){var r=t.mcc||e.marker.color,n=t.mlcc||e.marker.line.color,a=l(e,t);return i.opacity(r)?r:i.opacity(n)&&a?n:void 0}t.exports={hoverPoints:function(e,t,r,n){var i=u(e,t,r,n);if(i){var o=i.cd,l=o[0].trace,s=o[i.index];return i.color=f(l,s),a.getComponentMethod("errorbars","hoverInfo")(s,l,i),[i]}},hoverOnBars:u,getTraceColor:f}},{"../../components/color":82,"../../components/fx":122,"../../constants/numerical":189,"../../lib":210,"../../plots/cartesian/axes":256,"../../registry":298,"./helpers":314}],316:[function(e,t,r){"use strict";t.exports={attributes:e("./attributes"),layoutAttributes:e("./layout_attributes"),supplyDefaults:e("./defaults").supplyDefaults,crossTraceDefaults:e("./defaults").crossTraceDefaults,supplyLayoutDefaults:e("./layout_defaults"),calc:e("./calc"),crossTraceCalc:e("./cross_trace_calc").crossTraceCalc,colorbar:e("../scatter/marker_colorbar"),arraysToCalcdata:e("./arrays_to_calcdata"),plot:e("./plot").plot,style:e("./style").style,styleOnSelect:e("./style").styleOnSelect,hoverPoints:e("./hover").hoverPoints,eventData:e("./event_data"),selectPoints:e("./select"),moduleType:"trace",name:"bar",basePlotModule:e("../../plots/cartesian"),categories:["bar-like","cartesian","svg","bar","oriented","errorBarsOK","showLegend","zoomScale"],animatable:!0,meta:{}}},{"../../plots/cartesian":269,"../scatter/marker_colorbar":417,"./arrays_to_calcdata":307,"./attributes":308,"./calc":309,"./cross_trace_calc":311,"./defaults":312,"./event_data":313,"./hover":315,"./layout_attributes":317,"./layout_defaults":318,"./plot":319,"./select":320,"./style":322}],317:[function(e,t,r){"use strict";t.exports={barmode:{valType:"enumerated",values:["stack","group","overlay","relative"],dflt:"group",editType:"calc"},barnorm:{valType:"enumerated",values:["","fraction","percent"],dflt:"",editType:"calc"},bargap:{valType:"number",min:0,max:1,editType:"calc"},bargroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"}}},{}],318:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../plots/cartesian/axes"),i=e("../../lib"),o=e("./layout_attributes");t.exports=function(e,t,r){function l(r,n){return i.coerce(e,t,o,r,n)}for(var s=!1,c=!1,u=!1,f={},d=l("barmode"),p=0;p<r.length;p++){var h=r[p];if(n.traceIs(h,"bar")&&h.visible){if(s=!0,"group"===d){var g=h.xaxis+h.yaxis;f[g]&&(u=!0),f[g]=!0}if(h.visible&&"histogram"===h.type)"category"!==a.getFromId({_fullLayout:t},h["v"===h.orientation?"xaxis":"yaxis"]).type&&(c=!0)}}s?("overlay"!==d&&l("barnorm"),l("bargap",c&&!u?0:.2),l("bargroupgap")):delete t.barmode}},{"../../lib":210,"../../plots/cartesian/axes":256,"../../registry":298,"./layout_attributes":317}],319:[function(e,t,r){"use strict";var n=e("d3"),a=e("fast-isnumeric"),i=e("../../lib"),o=e("../../lib/svg_text_utils"),l=e("../../components/color"),s=e("../../components/drawing"),c=e("../../registry"),u=e("../../plots/cartesian/axes").tickText,f=e("./uniform_text"),d=f.recordMinTextSize,p=f.clearMinTextSize,h=e("./style"),g=e("./helpers"),v=e("./constants"),m=e("./attributes"),y=m.text,x=m.textposition,b=e("../../components/fx/helpers").appendArrayPointValue,_=v.TEXTPAD;function w(e){return e.id}function T(e){if(e.ids)return w}function k(e,t){return e<t?1:-1}function M(e,t,r,n){var a;return!t.uniformtext.mode&&A(r)?(n&&(a=n()),e.transition().duration(r.duration).ease(r.easing).each("end",(function(){a&&a()})).each("interrupt",(function(){a&&a()}))):e}function A(e){return e&&e.duration>0}function L(e){return"auto"===e?0:e}function S(e,t){var r=Math.PI/180*t,n=Math.abs(Math.sin(r)),a=Math.abs(Math.cos(r));return{x:e.width*a+e.height*n,y:e.width*n+e.height*a}}function C(e,t,r,n,a,i){var o=!!i.isHorizontal,l=!!i.constrained,s=i.angle||0,c=i.anchor||"end",u="end"===c,f="start"===c,d=((i.leftToRight||0)+1)/2,p=1-d,h=a.width,g=a.height,v=Math.abs(t-e),m=Math.abs(n-r),y=v>2*_&&m>2*_?_:0;v-=2*y,m-=2*y;var x=L(s);"auto"!==s||h<=v&&g<=m||!(h>v||g>m)||(h>m||g>v)&&h<g==v<m||(x+=90);var b=S(a,x),w=1;l&&(w=Math.min(1,v/b.x,m/b.y));var T=a.left*p+a.right*d,M=(a.top+a.bottom)/2,A=(e+_)*p+(t-_)*d,C=(r+n)/2,O=0,D=0;if(f||u){var P=(o?b.x:b.y)/2,z=o?k(e,t):k(r,n);o?f?(A=e+z*y,O=-z*P):(A=t-z*y,O=z*P):f?(C=r+z*y,D=-z*P):(C=n-z*y,D=z*P)}return{textX:T,textY:M,targetX:A,targetY:C,anchorX:O,anchorY:D,scale:w,rotate:x}}t.exports={plot:function(e,t,r,f,v,m){var w=t.xaxis,O=t.yaxis,D=e._fullLayout;v||(v={mode:D.barmode,norm:D.barmode,gap:D.bargap,groupgap:D.bargroupgap},p("bar",D));var P=i.makeTraceGroups(f,r,"trace bars").each((function(r){var c=n.select(this),f=r[0].trace,p="waterfall"===f.type,P="funnel"===f.type,z="bar"===f.type||P,R=0;p&&f.connector.visible&&"between"===f.connector.mode&&(R=f.connector.line.width/2);var E="h"===f.orientation,I=A(v),F=i.ensureSingle(c,"g","points"),N=T(f),H=F.selectAll("g.point").data(i.identity,N);H.enter().append("g").classed("point",!0),H.exit().remove(),H.each((function(c,p){var T,A,P=n.select(this),F=function(e,t,r,n){var a=[],i=[],o=n?t:r,l=n?r:t;return a[0]=o.c2p(e.s0,!0),i[0]=l.c2p(e.p0,!0),a[1]=o.c2p(e.s1,!0),i[1]=l.c2p(e.p1,!0),n?[a,i]:[i,a]}(c,w,O,E),N=F[0][0],H=F[0][1],B=F[1][0],j=F[1][1],V=0==(E?H-N:j-B);if(V&&z&&g.getLineWidth(f,c)&&(V=!1),V||(V=!(a(N)&&a(H)&&a(B)&&a(j))),c.isBlank=V,V&&(E?H=N:j=B),R&&!V&&(E?(N-=k(N,H)*R,H+=k(N,H)*R):(B-=k(B,j)*R,j+=k(B,j)*R)),"waterfall"===f.type){if(!V){var U=f[c.dir].marker;T=U.line.width,A=U.color}}else T=g.getLineWidth(f,c),A=c.mc||f.marker.color;function q(e){var t=n.round(T/2%1,2);return 0===v.gap&&0===v.groupgap?n.round(Math.round(e)-t,2):e}if(!e._context.staticPlot){var G=l.opacity(A)<1||T>.01?q:function(e,t,r){return r&&e===t?e:Math.abs(e-t)>=2?q(e):e>t?Math.ceil(e):Math.floor(e)};N=G(N,H,E),H=G(H,N,E),B=G(B,j,!E),j=G(j,B,!E)}var Z=M(i.ensureSingle(P,"path"),D,v,m);if(Z.style("vector-effect","non-scaling-stroke").attr("d",isNaN((H-N)*(j-B))||V&&e._context.staticPlot?"M0,0Z":"M"+N+","+B+"V"+j+"H"+H+"V"+B+"Z").call(s.setClipUrl,t.layerClipId,e),!D.uniformtext.mode&&I){var Y=s.makePointStyleFns(f);s.singlePointStyle(c,Z,f,Y,e)}!function(e,t,r,n,a,l,c,f,p,v,m){var w,T=t.xaxis,A=t.yaxis,O=e._fullLayout;function D(t,r,n){return i.ensureSingle(t,"text").text(r).attr({class:"bartext bartext-"+w,"text-anchor":"middle","data-notex":1}).call(s.font,n).call(o.convertToTspans,e)}var P=n[0].trace,z="h"===P.orientation,R=function(e,t,r,n,a){var o,l=t[0].trace;o=l.texttemplate?function(e,t,r,n,a){var o=t[0].trace,l=i.castOption(o,r,"texttemplate");if(!l)return"";var s,c,f,d,p="waterfall"===o.type,h="funnel"===o.type;"h"===o.orientation?(s="y",c=a,f="x",d=n):(s="x",c=n,f="y",d=a);function g(e){return u(d,+e,!0).text}var v=t[r],m={};m.label=v.p,m.labelLabel=m[s+"Label"]=(y=v.p,u(c,y,!0).text);var y;var x=i.castOption(o,v.i,"text");(0===x||x)&&(m.text=x);m.value=v.s,m.valueLabel=m[f+"Label"]=g(v.s);var _={};b(_,o,v.i),p&&(m.delta=+v.rawS||v.s,m.deltaLabel=g(m.delta),m.final=v.v,m.finalLabel=g(m.final),m.initial=m.final-m.delta,m.initialLabel=g(m.initial));h&&(m.value=v.s,m.valueLabel=g(m.value),m.percentInitial=v.begR,m.percentInitialLabel=i.formatPercent(v.begR),m.percentPrevious=v.difR,m.percentPreviousLabel=i.formatPercent(v.difR),m.percentTotal=v.sumR,m.percenTotalLabel=i.formatPercent(v.sumR));var w=i.castOption(o,v.i,"customdata");w&&(m.customdata=w);return i.texttemplateString(l,m,e._d3locale,_,m,o._meta||{})}(e,t,r,n,a):l.textinfo?function(e,t,r,n){var a=e[0].trace,o="h"===a.orientation,l="waterfall"===a.type,s="funnel"===a.type;function c(e){return u(o?r:n,+e,!0).text}var f,d=a.textinfo,p=e[t],h=d.split("+"),g=[],v=function(e){return-1!==h.indexOf(e)};v("label")&&g.push((m=e[t].p,u(o?n:r,m,!0).text));var m;v("text")&&(0===(f=i.castOption(a,p.i,"text"))||f)&&g.push(f);if(l){var y=+p.rawS||p.s,x=p.v,b=x-y;v("initial")&&g.push(c(b)),v("delta")&&g.push(c(y)),v("final")&&g.push(c(x))}if(s){v("value")&&g.push(c(p.s));var _=0;v("percent initial")&&_++,v("percent previous")&&_++,v("percent total")&&_++;var w=_>1;v("percent initial")&&(f=i.formatPercent(p.begR),w&&(f+=" of initial"),g.push(f)),v("percent previous")&&(f=i.formatPercent(p.difR),w&&(f+=" of previous"),g.push(f)),v("percent total")&&(f=i.formatPercent(p.sumR),w&&(f+=" of total"),g.push(f))}return g.join("<br>")}(t,r,n,a):g.getValue(l.text,r);return g.coerceString(y,o)}(O,n,a,T,A);w=function(e,t){var r=g.getValue(e.textposition,t);return g.coerceEnumerated(x,r)}(P,a);var E="stack"===v.mode||"relative"===v.mode,I=n[a],F=!E||I._outmost;if(!R||"none"===w||(I.isBlank||l===c||f===p)&&("auto"===w||"inside"===w))return void r.select("text").remove();var N=O.font,H=h.getBarColor(n[a],P),B=h.getInsideTextFont(P,a,N,H),j=h.getOutsideTextFont(P,a,N),V=r.datum();z?"log"===T.type&&V.s0<=0&&(l=T.range[0]<T.range[1]?0:T._length):"log"===A.type&&V.s0<=0&&(f=A.range[0]<A.range[1]?A._length:0);var U,q,G,Z,Y,X=Math.abs(c-l)-2*_,W=Math.abs(p-f)-2*_;"outside"===w&&(F||I.hasB||(w="inside"));if("auto"===w)if(F){w="inside",Y=i.ensureUniformFontSize(e,B),U=D(r,R,Y),q=s.bBox(U.node()),G=q.width,Z=q.height;var Q=G<=X&&Z<=W,J=G<=W&&Z<=X,$=z?X>=G*(W/Z):W>=Z*(X/G);G>0&&Z>0&&(Q||J||$)?w="inside":(w="outside",U.remove(),U=null)}else w="inside";if(!U){Y=i.ensureUniformFontSize(e,"outside"===w?j:B);var K=(U=D(r,R,Y)).attr("transform");if(U.attr("transform",""),q=s.bBox(U.node()),G=q.width,Z=q.height,U.attr("transform",K),G<=0||Z<=0)return void U.remove()}var ee,te,re=P.textangle;"outside"===w?(te="both"===P.constraintext||"outside"===P.constraintext,ee=function(e,t,r,n,a,i){var o,l=!!i.isHorizontal,s=!!i.constrained,c=i.angle||0,u=a.width,f=a.height,d=Math.abs(t-e),p=Math.abs(n-r);o=l?p>2*_?_:0:d>2*_?_:0;var h=1;s&&(h=l?Math.min(1,p/f):Math.min(1,d/u));var g=L(c),v=S(a,g),m=(l?v.x:v.y)/2,y=(a.left+a.right)/2,x=(a.top+a.bottom)/2,b=(e+t)/2,w=(r+n)/2,T=0,M=0,A=l?k(t,e):k(r,n);l?(b=t-A*o,T=A*m):(w=n+A*o,M=-A*m);return{textX:y,textY:x,targetX:b,targetY:w,anchorX:T,anchorY:M,scale:h,rotate:g}}(l,c,f,p,q,{isHorizontal:z,constrained:te,angle:re})):(te="both"===P.constraintext||"inside"===P.constraintext,ee=C(l,c,f,p,q,{isHorizontal:z,constrained:te,angle:re,anchor:P.insidetextanchor}));ee.fontSize=Y.size,d(P.type,ee,O),I.transform=ee,M(U,O,v,m).attr("transform",i.getTextTransform(ee))}(e,t,P,r,p,N,H,B,j,v,m),t.layerClipId&&s.hideOutsideRangePoint(c,P.select("text"),w,O,f.xcalendar,f.ycalendar)}));var B=!1===f.cliponaxis;s.setClipUrl(c,B?null:t.layerClipId,e)}));c.getComponentMethod("errorbars","plot")(e,P,t,v)},toMoveInsideBar:C}},{"../../components/color":82,"../../components/drawing":104,"../../components/fx/helpers":118,"../../lib":210,"../../lib/svg_text_utils":232,"../../plots/cartesian/axes":256,"../../registry":298,"./attributes":308,"./constants":310,"./helpers":314,"./style":322,"./uniform_text":324,d3:16,"fast-isnumeric":18}],320:[function(e,t,r){"use strict";function n(e,t,r,n,a){var i=t.c2p(n?e.s0:e.p0,!0),o=t.c2p(n?e.s1:e.p1,!0),l=r.c2p(n?e.p0:e.s0,!0),s=r.c2p(n?e.p1:e.s1,!0);return a?[(i+o)/2,(l+s)/2]:n?[o,(l+s)/2]:[(i+o)/2,s]}t.exports=function(e,t){var r,a=e.cd,i=e.xaxis,o=e.yaxis,l=a[0].trace,s="funnel"===l.type,c="h"===l.orientation,u=[];if(!1===t)for(r=0;r<a.length;r++)a[r].selected=0;else for(r=0;r<a.length;r++){var f=a[r],d="ct"in f?f.ct:n(f,i,o,c,s);t.contains(d,!1,r,e)?(u.push({pointNumber:r,x:i.c2d(f.x),y:o.c2d(f.y)}),f.selected=1):f.selected=0}return u}},{}],321:[function(e,t,r){"use strict";t.exports=i;var n=e("../../lib").distinctVals,a=e("../../constants/numerical").BADNUM;function i(e,t){this.traces=e,this.sepNegVal=t.sepNegVal,this.overlapNoMerge=t.overlapNoMerge;for(var r=1/0,i=[],o=0;o<e.length;o++){for(var l=e[o],s=0;s<l.length;s++){var c=l[s];c.p!==a&&i.push(c.p)}l[0]&&l[0].width1&&(r=Math.min(l[0].width1,r))}this.positions=i;var u=n(i,{unitMinDiff:t.unitMinDiff});this.distinctPositions=u.vals,1===u.vals.length&&r!==1/0?this.minDiff=r:this.minDiff=Math.min(u.minDiff,r),this.binWidth=this.minDiff,this.bins={}}i.prototype.put=function(e,t){var r=this.getLabel(e,t),n=this.bins[r]||0;return this.bins[r]=n+t,n},i.prototype.get=function(e,t){var r=this.getLabel(e,t);return this.bins[r]||0},i.prototype.getLabel=function(e,t){return(t<0&&this.sepNegVal?"v":"^")+(this.overlapNoMerge?e:Math.round(e/this.binWidth))}},{"../../constants/numerical":189,"../../lib":210}],322:[function(e,t,r){"use strict";var n=e("d3"),a=e("../../components/color"),i=e("../../components/drawing"),o=e("../../lib"),l=e("../../registry"),s=e("./uniform_text").resizeText,c=e("./attributes"),u=c.textfont,f=c.insidetextfont,d=c.outsidetextfont,p=e("./helpers");function h(e,t,r){i.pointStyle(e.selectAll("path"),t,r),g(e,t,r)}function g(e,t,r){e.selectAll("text").each((function(e){var a=n.select(this),l=o.ensureUniformFontSize(r,v(a,e,t,r));i.font(a,l)}))}function v(e,t,r,n){var a=n._fullLayout.font,i=r.textfont;if(e.classed("bartext-inside")){var o=_(t,r);i=y(r,t.i,a,o)}else e.classed("bartext-outside")&&(i=x(r,t.i,a));return i}function m(e,t,r){return b(u,e.textfont,t,r)}function y(e,t,r,n){var i=m(e,t,r);return(void 0===e._input.textfont||void 0===e._input.textfont.color||Array.isArray(e.textfont.color)&&void 0===e.textfont.color[t])&&(i={color:a.contrast(n),family:i.family,size:i.size}),b(f,e.insidetextfont,t,i)}function x(e,t,r){var n=m(e,t,r);return b(d,e.outsidetextfont,t,n)}function b(e,t,r,n){t=t||{};var a=p.getValue(t.family,r),i=p.getValue(t.size,r),o=p.getValue(t.color,r);return{family:p.coerceString(e.family,a,n.family),size:p.coerceNumber(e.size,i,n.size),color:p.coerceColor(e.color,o,n.color)}}function _(e,t){return"waterfall"===t.type?t[e.dir].marker.color:e.mc||t.marker.color}t.exports={style:function(e){var t=n.select(e).selectAll("g.barlayer").selectAll("g.trace");s(e,t,"bar");var r=t.size(),a=e._fullLayout;t.style("opacity",(function(e){return e[0].trace.opacity})).each((function(e){("stack"===a.barmode&&r>1||0===a.bargap&&0===a.bargroupgap&&!e[0].trace.marker.line.width)&&n.select(this).attr("shape-rendering","crispEdges")})),t.selectAll("g.points").each((function(t){h(n.select(this),t[0].trace,e)})),l.getComponentMethod("errorbars","style")(t)},styleTextPoints:g,styleOnSelect:function(e,t,r){var a=t[0].trace;a.selectedpoints?function(e,t,r){i.selectedPointStyle(e.selectAll("path"),t),function(e,t,r){e.each((function(e){var a,l=n.select(this);if(e.selected){a=o.ensureUniformFontSize(r,v(l,e,t,r));var s=t.selected.textfont&&t.selected.textfont.color;s&&(a.color=s),i.font(l,a)}else i.selectedTextStyle(l,t)}))}(e.selectAll("text"),t,r)}(r,a,e):(h(r,a,e),l.getComponentMethod("errorbars","style")(r))},getInsideTextFont:y,getOutsideTextFont:x,getBarColor:_,resizeText:s}},{"../../components/color":82,"../../components/drawing":104,"../../lib":210,"../../registry":298,"./attributes":308,"./helpers":314,"./uniform_text":324,d3:16}],323:[function(e,t,r){"use strict";var n=e("../../components/color"),a=e("../../components/colorscale/helpers").hasColorscale,i=e("../../components/colorscale/defaults");t.exports=function(e,t,r,o,l){r("marker.color",o),a(e,"marker")&&i(e,t,l,r,{prefix:"marker.",cLetter:"c"}),r("marker.line.color",n.defaultLine),a(e,"marker.line")&&i(e,t,l,r,{prefix:"marker.line.",cLetter:"c"}),r("marker.line.width"),r("marker.opacity"),r("selected.marker.color"),r("unselected.marker.color")}},{"../../components/color":82,"../../components/colorscale/defaults":92,"../../components/colorscale/helpers":93}],324:[function(e,t,r){"use strict";var n=e("d3"),a=e("../../lib");function i(e){return"_"+e+"Text_minsize"}t.exports={recordMinTextSize:function(e,t,r){if(r.uniformtext.mode){var n=i(e),a=r.uniformtext.minsize,o=t.scale*t.fontSize;t.hide=o<a,r[n]=r[n]||1/0,t.hide||(r[n]=Math.min(r[n],Math.max(o,a)))}},clearMinTextSize:function(e,t){t[i(e)]=void 0},resizeText:function(e,t,r){var i=e._fullLayout,o=i["_"+r+"Text_minsize"];if(o){var l,s="hide"===i.uniformtext.mode;switch(r){case"funnelarea":case"pie":case"sunburst":l="g.slice";break;case"treemap":l="g.slice, g.pathbar";break;default:l="g.points > g.point"}t.selectAll(l).each((function(e){var t=e.transform;t&&(t.scale=s&&t.hide?0:o/t.fontSize,n.select(this).select("text").attr("transform",a.getTextTransform(t)))}))}}}},{"../../lib":210,d3:16}],325:[function(e,t,r){"use strict";var n=e("../scatter/attributes"),a=e("../bar/attributes"),i=e("../../components/color/attributes"),o=e("../../plots/template_attributes").hovertemplateAttrs,l=e("../../lib/extend").extendFlat,s=n.marker,c=s.line;t.exports={y:{valType:"data_array",editType:"calc+clearAxisTypes"},x:{valType:"data_array",editType:"calc+clearAxisTypes"},x0:{valType:"any",editType:"calc+clearAxisTypes"},y0:{valType:"any",editType:"calc+clearAxisTypes"},dx:{valType:"number",editType:"calc"},dy:{valType:"number",editType:"calc"},xperiod:n.xperiod,yperiod:n.yperiod,xperiod0:n.xperiod0,yperiod0:n.yperiod0,xperiodalignment:n.xperiodalignment,yperiodalignment:n.yperiodalignment,name:{valType:"string",editType:"calc+clearAxisTypes"},q1:{valType:"data_array",editType:"calc+clearAxisTypes"},median:{valType:"data_array",editType:"calc+clearAxisTypes"},q3:{valType:"data_array",editType:"calc+clearAxisTypes"},lowerfence:{valType:"data_array",editType:"calc"},upperfence:{valType:"data_array",editType:"calc"},notched:{valType:"boolean",editType:"calc"},notchwidth:{valType:"number",min:0,max:.5,dflt:.25,editType:"calc"},notchspan:{valType:"data_array",editType:"calc"},boxpoints:{valType:"enumerated",values:["all","outliers","suspectedoutliers",!1],editType:"calc"},jitter:{valType:"number",min:0,max:1,editType:"calc"},pointpos:{valType:"number",min:-2,max:2,editType:"calc"},boxmean:{valType:"enumerated",values:[!0,"sd",!1],editType:"calc"},mean:{valType:"data_array",editType:"calc"},sd:{valType:"data_array",editType:"calc"},orientation:{valType:"enumerated",values:["v","h"],editType:"calc+clearAxisTypes"},quartilemethod:{valType:"enumerated",values:["linear","exclusive","inclusive"],dflt:"linear",editType:"calc"},width:{valType:"number",min:0,dflt:0,editType:"calc"},marker:{outliercolor:{valType:"color",dflt:"rgba(0, 0, 0, 0)",editType:"style"},symbol:l({},s.symbol,{arrayOk:!1,editType:"plot"}),opacity:l({},s.opacity,{arrayOk:!1,dflt:1,editType:"style"}),size:l({},s.size,{arrayOk:!1,editType:"calc"}),color:l({},s.color,{arrayOk:!1,editType:"style"}),line:{color:l({},c.color,{arrayOk:!1,dflt:i.defaultLine,editType:"style"}),width:l({},c.width,{arrayOk:!1,dflt:0,editType:"style"}),outliercolor:{valType:"color",editType:"style"},outlierwidth:{valType:"number",min:0,dflt:1,editType:"style"},editType:"style"},editType:"plot"},line:{color:{valType:"color",editType:"style"},width:{valType:"number",min:0,dflt:2,editType:"style"},editType:"plot"},fillcolor:n.fillcolor,whiskerwidth:{valType:"number",min:0,max:1,dflt:.5,editType:"calc"},offsetgroup:a.offsetgroup,alignmentgroup:a.alignmentgroup,selected:{marker:n.selected.marker,editType:"style"},unselected:{marker:n.unselected.marker,editType:"style"},text:l({},n.text,{}),hovertext:l({},n.hovertext,{}),hovertemplate:o({}),hoveron:{valType:"flaglist",flags:["boxes","points"],dflt:"boxes+points",editType:"style"}}},{"../../components/color/attributes":81,"../../lib/extend":204,"../../plots/template_attributes":297,"../bar/attributes":308,"../scatter/attributes":399}],326:[function(e,t,r){"use strict";var n=e("../../plots/cartesian/axes"),a=e("../../lib"),i=e("../../plots/cartesian/constraints").getAxisGroup,o=["v","h"];function l(e,t,r,o){var l,s,c,u=t.calcdata,f=t._fullLayout,d=o._id,p=d.charAt(0),h=[],g=0;for(l=0;l<r.length;l++)for(c=u[r[l]],s=0;s<c.length;s++)h.push(o.c2l(c[s].pos,!0)),g+=(c[s].pts2||[]).length;if(h.length){var v=a.distinctVals(h,{unitMinDiff:"category"===o.type||"multicategory"===o.type}),m=v.minDiff/2;n.minDtick(o,v.minDiff,v.vals[0],!0);var y=f["violin"===e?"_numViolins":"_numBoxes"],x="group"===f[e+"mode"]&&y>1,b=1-f[e+"gap"],_=1-f[e+"groupgap"];for(l=0;l<r.length;l++){var w,T,k,M,A,L,S=(c=u[r[l]])[0].trace,C=c[0].t,O=S.width,D=S.side;if(O)w=T=M=O/2,k=0;else if(w=m,x){var P=i(f,o._id)+S.orientation,z=(f._alignmentOpts[P]||{})[S.alignmentgroup]||{},R=Object.keys(z.offsetGroups||{}).length,E=R||y;T=w*b*_/E,k=2*w*(((R?S._offsetIndex:C.num)+.5)/E-.5)*b,M=w*b/E}else T=w*b*_,k=0,M=w;C.dPos=w,C.bPos=k,C.bdPos=T,C.wHover=M;var I,F,N,H,B,j,V=k+T,U=Boolean(O);if("positive"===D?(A=w*(O?1:.5),I=V,L=I=k):"negative"===D?(A=I=k,L=w*(O?1:.5),F=V):(A=L=w,I=F=V),(S.boxpoints||S.points)&&g>0){var q=S.pointpos,G=S.jitter,Z=S.marker.size/2,Y=0;q+G>=0&&((Y=V*(q+G))>A?(U=!0,B=Z,N=Y):Y>I&&(B=Z,N=A)),Y<=A&&(N=A);var X=0;q-G<=0&&((X=-V*(q-G))>L?(U=!0,j=Z,H=X):X>F&&(j=Z,H=L)),X<=L&&(H=L)}else N=A,H=L;var W=new Array(c.length);for(s=0;s<c.length;s++)W[s]=c[s].pos;S._extremes[d]=n.findExtremes(o,W,{padded:U,vpadminus:H,vpadplus:N,vpadLinearized:!0,ppadminus:{x:j,y:B}[p],ppadplus:{x:B,y:j}[p]})}}}t.exports={crossTraceCalc:function(e,t){for(var r=e.calcdata,n=t.xaxis,a=t.yaxis,i=0;i<o.length;i++){for(var s=o[i],c="h"===s?a:n,u=[],f=0;f<r.length;f++){var d=r[f],p=d[0].t,h=d[0].trace;!0!==h.visible||"box"!==h.type&&"candlestick"!==h.type||p.empty||(h.orientation||"v")!==s||h.xaxis!==n._id||h.yaxis!==a._id||u.push(f)}l("box",e,u,c)}},setPositionOffset:l}},{"../../lib":210,"../../plots/cartesian/axes":256,"../../plots/cartesian/constraints":263}],327:[function(e,t,r){"use strict";t.exports={boxmode:{valType:"enumerated",values:["group","overlay"],dflt:"overlay",editType:"calc"},boxgap:{valType:"number",min:0,max:1,dflt:.3,editType:"calc"},boxgroupgap:{valType:"number",min:0,max:1,dflt:.3,editType:"calc"}}},{}],328:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../lib"),i=e("./layout_attributes");function o(e,t,r,a,i){for(var o=i+"Layout",l=!1,s=0;s<r.length;s++){var c=r[s];if(n.traceIs(c,o)){l=!0;break}}l&&(a(i+"mode"),a(i+"gap"),a(i+"groupgap"))}t.exports={supplyLayoutDefaults:function(e,t,r){o(0,0,r,(function(r,n){return a.coerce(e,t,i,r,n)}),"box")},_supply:o}},{"../../lib":210,"../../registry":298,"./layout_attributes":327}],329:[function(e,t,r){"use strict";var n=e("d3"),a=e("../../lib"),i=e("../../components/drawing");function o(e,t,r,i){var o,l,s="h"===r.orientation,c=t.val,u=t.pos,f=!!u.rangebreaks,d=i.bPos,p=i.wdPos||0,h=i.bPosPxOffset||0,g=r.whiskerwidth||0,v=r.notched||!1,m=v?1-2*r.notchwidth:1;Array.isArray(i.bdPos)?(o=i.bdPos[0],l=i.bdPos[1]):(o=i.bdPos,l=i.bdPos);var y=e.selectAll("path.box").data("violin"!==r.type||r.box.visible?a.identity:[]);y.enter().append("path").style("vector-effect","non-scaling-stroke").attr("class","box"),y.exit().remove(),y.each((function(e){if(e.empty)return"M0,0Z";var t=u.c2l(e.pos+d,!0),i=u.l2p(t-o)+h,y=u.l2p(t+l)+h,x=f?(i+y)/2:u.l2p(t)+h,b=r.whiskerwidth,_=f?i*b+(1-b)*x:u.l2p(t-p)+h,w=f?y*b+(1-b)*x:u.l2p(t+p)+h,T=u.l2p(t-o*m)+h,k=u.l2p(t+l*m)+h,M=c.c2p(e.q1,!0),A=c.c2p(e.q3,!0),L=a.constrain(c.c2p(e.med,!0),Math.min(M,A)+1,Math.max(M,A)-1),S=void 0===e.lf||!1===r.boxpoints,C=c.c2p(S?e.min:e.lf,!0),O=c.c2p(S?e.max:e.uf,!0),D=c.c2p(e.ln,!0),P=c.c2p(e.un,!0);s?n.select(this).attr("d","M"+L+","+T+"V"+k+"M"+M+","+i+"V"+y+(v?"H"+D+"L"+L+","+k+"L"+P+","+y:"")+"H"+A+"V"+i+(v?"H"+P+"L"+L+","+T+"L"+D+","+i:"")+"ZM"+M+","+x+"H"+C+"M"+A+","+x+"H"+O+(0===g?"":"M"+C+","+_+"V"+w+"M"+O+","+_+"V"+w)):n.select(this).attr("d","M"+T+","+L+"H"+k+"M"+i+","+M+"H"+y+(v?"V"+D+"L"+k+","+L+"L"+y+","+P:"")+"V"+A+"H"+i+(v?"V"+P+"L"+T+","+L+"L"+i+","+D:"")+"ZM"+x+","+M+"V"+C+"M"+x+","+A+"V"+O+(0===g?"":"M"+_+","+C+"H"+w+"M"+_+","+O+"H"+w))}))}function l(e,t,r,n){var o=t.x,l=t.y,s=n.bdPos,c=n.bPos,u=r.boxpoints||r.points;a.seedPseudoRandom();var f=e.selectAll("g.points").data(u?function(e){return e.forEach((function(e){e.t=n,e.trace=r})),e}:[]);f.enter().append("g").attr("class","points"),f.exit().remove();var d=f.selectAll("path").data((function(e){var t,n,i=e.pts2,o=Math.max((e.max-e.min)/10,e.q3-e.q1),l=1e-9*o,f=.01*o,d=[],p=0;if(r.jitter){if(0===o)for(p=1,d=new Array(i.length),t=0;t<i.length;t++)d[t]=1;else for(t=0;t<i.length;t++){var h=Math.max(0,t-5),g=i[h].v,v=Math.min(i.length-1,t+5),m=i[v].v;"all"!==u&&(i[t].v<e.lf?m=Math.min(m,e.lf):g=Math.max(g,e.uf));var y=Math.sqrt(f*(v-h)/(m-g+l))||0;y=a.constrain(Math.abs(y),0,1),d.push(y),p=Math.max(y,p)}n=2*r.jitter/(p||1)}for(t=0;t<i.length;t++){var x=i[t],b=x.v,_=r.jitter?n*d[t]*(a.pseudoRandom()-.5):0,w=e.pos+c+s*(r.pointpos+_);"h"===r.orientation?(x.y=w,x.x=b):(x.x=w,x.y=b),"suspectedoutliers"===u&&b<e.uo&&b>e.lo&&(x.so=!0)}return i}));d.enter().append("path").classed("point",!0),d.exit().remove(),d.call(i.translatePoints,o,l)}function s(e,t,r,i){var o,l,s=t.val,c=t.pos,u=!!c.rangebreaks,f=i.bPos,d=i.bPosPxOffset||0,p=r.boxmean||(r.meanline||{}).visible;Array.isArray(i.bdPos)?(o=i.bdPos[0],l=i.bdPos[1]):(o=i.bdPos,l=i.bdPos);var h=e.selectAll("path.mean").data("box"===r.type&&r.boxmean||"violin"===r.type&&r.box.visible&&r.meanline.visible?a.identity:[]);h.enter().append("path").attr("class","mean").style({fill:"none","vector-effect":"non-scaling-stroke"}),h.exit().remove(),h.each((function(e){var t=c.c2l(e.pos+f,!0),a=c.l2p(t-o)+d,i=c.l2p(t+l)+d,h=u?(a+i)/2:c.l2p(t)+d,g=s.c2p(e.mean,!0),v=s.c2p(e.mean-e.sd,!0),m=s.c2p(e.mean+e.sd,!0);"h"===r.orientation?n.select(this).attr("d","M"+g+","+a+"V"+i+("sd"===p?"m0,0L"+v+","+h+"L"+g+","+a+"L"+m+","+h+"Z":"")):n.select(this).attr("d","M"+a+","+g+"H"+i+("sd"===p?"m0,0L"+h+","+v+"L"+a+","+g+"L"+h+","+m+"Z":""))}))}t.exports={plot:function(e,t,r,i){var c=t.xaxis,u=t.yaxis;a.makeTraceGroups(i,r,"trace boxes").each((function(e){var t,r,a=n.select(this),i=e[0],f=i.t,d=i.trace;(f.wdPos=f.bdPos*d.whiskerwidth,!0!==d.visible||f.empty)?a.remove():("h"===d.orientation?(t=u,r=c):(t=c,r=u),o(a,{pos:t,val:r},d,f),l(a,{x:c,y:u},d,f),s(a,{pos:t,val:r},d,f))}))},plotBoxAndWhiskers:o,plotPoints:l,plotBoxMean:s}},{"../../components/drawing":104,"../../lib":210,d3:16}],330:[function(e,t,r){"use strict";var n=e("d3"),a=e("../../components/color"),i=e("../../components/drawing");t.exports={style:function(e,t,r){var o=r||n.select(e).selectAll("g.trace.boxes");o.style("opacity",(function(e){return e[0].trace.opacity})),o.each((function(t){var r=n.select(this),o=t[0].trace,l=o.line.width;function s(e,t,r,n){e.style("stroke-width",t+"px").call(a.stroke,r).call(a.fill,n)}var c=r.selectAll("path.box");if("candlestick"===o.type)c.each((function(e){if(!e.empty){var t=n.select(this),r=o[e.dir];s(t,r.line.width,r.line.color,r.fillcolor),t.style("opacity",o.selectedpoints&&!e.selected?.3:1)}}));else{s(c,l,o.line.color,o.fillcolor),r.selectAll("path.mean").style({"stroke-width":l,"stroke-dasharray":2*l+"px,"+l+"px"}).call(a.stroke,o.line.color);var u=r.selectAll("path.point");i.pointStyle(u,o,e)}}))},styleOnSelect:function(e,t,r){var n=t[0].trace,a=r.selectAll("path.point");n.selectedpoints?i.selectedPointStyle(a,n):i.pointStyle(a,n,e)}}},{"../../components/color":82,"../../components/drawing":104,d3:16}],331:[function(e,t,r){"use strict";var n=e("../../lib").extendFlat,a=e("../ohlc/attributes"),i=e("../box/attributes");function o(e){return{line:{color:n({},i.line.color,{dflt:e}),width:i.line.width,editType:"style"},fillcolor:i.fillcolor,editType:"style"}}t.exports={xperiod:a.xperiod,xperiod0:a.xperiod0,xperiodalignment:a.xperiodalignment,x:a.x,open:a.open,high:a.high,low:a.low,close:a.close,line:{width:n({},i.line.width,{}),editType:"style"},increasing:o(a.increasing.line.color.dflt),decreasing:o(a.decreasing.line.color.dflt),text:a.text,hovertext:a.hovertext,whiskerwidth:n({},i.whiskerwidth,{dflt:0}),hoverlabel:a.hoverlabel}},{"../../lib":210,"../box/attributes":325,"../ohlc/attributes":377}],332:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/cartesian/axes"),i=e("../../plots/cartesian/align_period"),o=e("../ohlc/calc").calcCommon;function l(e,t,r,n){return{min:r,q1:Math.min(e,n),med:n,q3:Math.max(e,n),max:t}}t.exports=function(e,t){var r=e._fullLayout,s=a.getFromId(e,t.xaxis),c=a.getFromId(e,t.yaxis),u=s.makeCalcdata(t,"x"),f=i(t,s,"x",u),d=o(e,t,u,f,c,l);return d.length?(n.extendFlat(d[0].t,{num:r._numBoxes,dPos:n.distinctVals(f).minDiff/2,posLetter:"x",valLetter:"y"}),r._numBoxes++,d):[{t:{empty:!0}}]}},{"../../lib":210,"../../plots/cartesian/align_period":253,"../../plots/cartesian/axes":256,"../ohlc/calc":378}],333:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../components/color"),i=e("../ohlc/ohlc_defaults"),o=e("../scatter/period_defaults"),l=e("./attributes");function s(e,t,r,n){var i=r(n+".line.color");r(n+".line.width",t.line.width),r(n+".fillcolor",a.addOpacity(i,.5))}t.exports=function(e,t,r,a){function c(r,a){return n.coerce(e,t,l,r,a)}i(e,t,c,a)?(o(e,t,a,c,{x:!0}),c("line.width"),s(e,t,c,"increasing"),s(e,t,c,"decreasing"),c("text"),c("hovertext"),c("whiskerwidth"),a._requestRangeslider[t.xaxis]=!0):t.visible=!1}},{"../../components/color":82,"../../lib":210,"../ohlc/ohlc_defaults":382,"../scatter/period_defaults":419,"./attributes":331}],334:[function(e,t,r){"use strict";t.exports={moduleType:"trace",name:"candlestick",basePlotModule:e("../../plots/cartesian"),categories:["cartesian","svg","showLegend","candlestick","boxLayout"],meta:{},attributes:e("./attributes"),layoutAttributes:e("../box/layout_attributes"),supplyLayoutDefaults:e("../box/layout_defaults").supplyLayoutDefaults,crossTraceCalc:e("../box/cross_trace_calc").crossTraceCalc,supplyDefaults:e("./defaults"),calc:e("./calc"),plot:e("../box/plot").plot,layerName:"boxlayer",style:e("../box/style").style,hoverPoints:e("../ohlc/hover").hoverPoints,selectPoints:e("../ohlc/select")}},{"../../plots/cartesian":269,"../box/cross_trace_calc":326,"../box/layout_attributes":327,"../box/layout_defaults":328,"../box/plot":329,"../box/style":330,"../ohlc/hover":380,"../ohlc/select":384,"./attributes":331,"./calc":332,"./defaults":333}],335:[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.hovertext,e,"htx");var a=t.marker;if(a){n.mergeArray(a.opacity,e,"mo"),n.mergeArray(a.color,e,"mc");var i=a.line;i&&(n.mergeArray(i.color,e,"mlc"),n.mergeArrayCastPositive(i.width,e,"mlw"))}}},{"../../lib":210}],336:[function(e,t,r){"use strict";var n=e("../bar/attributes"),a=e("../scatter/attributes").line,i=e("../../plots/attributes"),o=e("../../plots/template_attributes").hovertemplateAttrs,l=e("../../plots/template_attributes").texttemplateAttrs,s=e("./constants"),c=e("../../lib/extend").extendFlat,u=e("../../components/color");t.exports={x:n.x,x0:n.x0,dx:n.dx,y:n.y,y0:n.y0,dy:n.dy,xperiod:n.xperiod,yperiod:n.yperiod,xperiod0:n.xperiod0,yperiod0:n.yperiod0,xperiodalignment:n.xperiodalignment,yperiodalignment:n.yperiodalignment,hovertext:n.hovertext,hovertemplate:o({},{keys:s.eventDataKeys}),hoverinfo:c({},i.hoverinfo,{flags:["name","x","y","text","percent initial","percent previous","percent total"]}),textinfo:{valType:"flaglist",flags:["label","text","percent initial","percent previous","percent total","value"],extras:["none"],editType:"plot",arrayOk:!1},texttemplate:l({editType:"plot"},{keys:s.eventDataKeys.concat(["label","value"])}),text:n.text,textposition:c({},n.textposition,{dflt:"auto"}),insidetextanchor:c({},n.insidetextanchor,{dflt:"middle"}),textangle:c({},n.textangle,{dflt:0}),textfont:n.textfont,insidetextfont:n.insidetextfont,outsidetextfont:n.outsidetextfont,constraintext:n.constraintext,cliponaxis:n.cliponaxis,orientation:c({},n.orientation,{}),offset:c({},n.offset,{arrayOk:!1}),width:c({},n.width,{arrayOk:!1}),marker:n.marker,connector:{fillcolor:{valType:"color",editType:"style"},line:{color:c({},a.color,{dflt:u.defaultLine}),width:c({},a.width,{dflt:0,editType:"plot"}),dash:a.dash,editType:"style"},visible:{valType:"boolean",dflt:!0,editType:"plot"},editType:"plot"},offsetgroup:n.offsetgroup,alignmentgroup:n.alignmentgroup}},{"../../components/color":82,"../../lib/extend":204,"../../plots/attributes":252,"../../plots/template_attributes":297,"../bar/attributes":308,"../scatter/attributes":399,"./constants":338}],337:[function(e,t,r){"use strict";var n=e("../../plots/cartesian/axes"),a=e("../../plots/cartesian/align_period"),i=e("./arrays_to_calcdata"),o=e("../scatter/calc_selection"),l=e("../../constants/numerical").BADNUM;function s(e){return e===l?0:e}t.exports=function(e,t){var r,c,u,f,d,p,h=n.getFromId(e,t.xaxis||"x"),g=n.getFromId(e,t.yaxis||"y");"h"===t.orientation?(r=h.makeCalcdata(t,"x"),u=g.makeCalcdata(t,"y"),c=a(t,g,"y",u),p=!!t.yperiodalignment):(r=g.makeCalcdata(t,"y"),u=h.makeCalcdata(t,"x"),c=a(t,h,"x",u),p=!!t.xperiodalignment);var v,m=Math.min(c.length,r.length),y=new Array(m);for(t._base=[],f=0;f<m;f++){r[f]<0&&(r[f]=l);var x=!1;r[f]!==l&&f+1<m&&r[f+1]!==l&&(x=!0),d=y[f]={p:c[f],s:r[f],cNext:x},t._base[f]=-.5*d.s,p&&(y[f].orig_p=u[f]),t.ids&&(d.id=String(t.ids[f])),0===f&&(y[0].vTotal=0),y[0].vTotal+=s(d.s),d.begR=s(d.s)/s(y[0].s)}for(f=0;f<m;f++)(d=y[f]).s!==l&&(d.sumR=d.s/y[0].vTotal,d.difR=void 0!==v?d.s/v:1,v=d.s);return i(y,t),o(y,t),y}},{"../../constants/numerical":189,"../../plots/cartesian/align_period":253,"../../plots/cartesian/axes":256,"../scatter/calc_selection":401,"./arrays_to_calcdata":335}],338:[function(e,t,r){"use strict";t.exports={eventDataKeys:["percentInitial","percentPrevious","percentTotal"]}},{}],339:[function(e,t,r){"use strict";var n=e("../bar/cross_trace_calc").setGroupPositions;t.exports=function(e,t){var r,a,i=e._fullLayout,o=e._fullData,l=e.calcdata,s=t.xaxis,c=t.yaxis,u=[],f=[],d=[];for(a=0;a<o.length;a++){var p=o[a],h="h"===p.orientation;!0===p.visible&&p.xaxis===s._id&&p.yaxis===c._id&&"funnel"===p.type&&(r=l[a],h?d.push(r):f.push(r),u.push(r))}var g={mode:i.funnelmode,norm:i.funnelnorm,gap:i.funnelgap,groupgap:i.funnelgroupgap};for(n(e,s,c,f,g),n(e,c,s,d,g),a=0;a<u.length;a++){r=u[a];for(var v=0;v<r.length;v++)v+1<r.length&&(r[v].nextP0=r[v+1].p0,r[v].nextS0=r[v+1].s0,r[v].nextP1=r[v+1].p1,r[v].nextS1=r[v+1].s1)}}},{"../bar/cross_trace_calc":311}],340:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../bar/defaults").handleGroupingDefaults,i=e("../bar/defaults").handleText,o=e("../scatter/xy_defaults"),l=e("../scatter/period_defaults"),s=e("./attributes"),c=e("../../components/color");t.exports={supplyDefaults:function(e,t,r,a){function u(r,a){return n.coerce(e,t,s,r,a)}if(o(e,t,a,u)){l(e,t,a,u),u("orientation",t.y&&!t.x?"v":"h"),u("offset"),u("width");var f=u("text");u("hovertext"),u("hovertemplate");var d=u("textposition");i(e,t,a,u,d,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!0,moduleHasCliponaxis:!0,moduleHasTextangle:!0,moduleHasInsideanchor:!0}),"none"===t.textposition||t.texttemplate||u("textinfo",Array.isArray(f)?"text+value":"value");var p=u("marker.color",r);if(u("marker.line.color",c.defaultLine),u("marker.line.width"),u("connector.visible"))u("connector.fillcolor",function(e){var t=n.isArrayOrTypedArray(e)?"#000":e;return c.addOpacity(t,.5*c.opacity(t))}(p)),u("connector.line.width")&&(u("connector.line.color"),u("connector.line.dash"))}else t.visible=!1},crossTraceDefaults:function(e,t){var r,i;function o(e){return n.coerce(i._input,i,s,e)}if("group"===t.funnelmode)for(var l=0;l<e.length;l++)r=(i=e[l])._input,a(r,i,t,o)}}},{"../../components/color":82,"../../lib":210,"../bar/defaults":312,"../scatter/period_defaults":419,"../scatter/xy_defaults":426,"./attributes":336}],341:[function(e,t,r){"use strict";t.exports=function(e,t){return e.x="xVal"in t?t.xVal:t.x,e.y="yVal"in t?t.yVal:t.y,"percentInitial"in t&&(e.percentInitial=t.percentInitial),"percentPrevious"in t&&(e.percentPrevious=t.percentPrevious),"percentTotal"in t&&(e.percentTotal=t.percentTotal),t.xa&&(e.xaxis=t.xa),t.ya&&(e.yaxis=t.ya),e}},{}],342:[function(e,t,r){"use strict";var n=e("../../components/color").opacity,a=e("../bar/hover").hoverOnBars,i=e("../../lib").formatPercent;t.exports=function(e,t,r,o){var l=a(e,t,r,o);if(l){var s=l.cd,c=s[0].trace,u="h"===c.orientation,f=s[l.index];l[(u?"x":"y")+"LabelVal"]=f.s,l.percentInitial=f.begR,l.percentInitialLabel=i(f.begR,1),l.percentPrevious=f.difR,l.percentPreviousLabel=i(f.difR,1),l.percentTotal=f.sumR,l.percentTotalLabel=i(f.sumR,1);var d=f.hi||c.hoverinfo,p=[];if(d&&"none"!==d&&"skip"!==d){var h="all"===d,g=d.split("+"),v=function(e){return h||-1!==g.indexOf(e)};v("percent initial")&&p.push(l.percentInitialLabel+" of initial"),v("percent previous")&&p.push(l.percentPreviousLabel+" of previous"),v("percent total")&&p.push(l.percentTotalLabel+" of total")}return l.extraText=p.join("<br>"),l.color=function(e,t){var r=e.marker,a=t.mc||r.color,i=t.mlc||r.line.color,o=t.mlw||r.line.width;if(n(a))return a;if(n(i)&&o)return i}(c,f),[l]}}},{"../../components/color":82,"../../lib":210,"../bar/hover":315}],343:[function(e,t,r){"use strict";t.exports={attributes:e("./attributes"),layoutAttributes:e("./layout_attributes"),supplyDefaults:e("./defaults").supplyDefaults,crossTraceDefaults:e("./defaults").crossTraceDefaults,supplyLayoutDefaults:e("./layout_defaults"),calc:e("./calc"),crossTraceCalc:e("./cross_trace_calc"),plot:e("./plot"),style:e("./style").style,hoverPoints:e("./hover"),eventData:e("./event_data"),selectPoints:e("../bar/select"),moduleType:"trace",name:"funnel",basePlotModule:e("../../plots/cartesian"),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}},{"../../plots/cartesian":269,"../bar/select":320,"./attributes":336,"./calc":337,"./cross_trace_calc":339,"./defaults":340,"./event_data":341,"./hover":342,"./layout_attributes":344,"./layout_defaults":345,"./plot":346,"./style":347}],344:[function(e,t,r){"use strict";t.exports={funnelmode:{valType:"enumerated",values:["stack","group","overlay"],dflt:"stack",editType:"calc"},funnelgap:{valType:"number",min:0,max:1,editType:"calc"},funnelgroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"}}},{}],345:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./layout_attributes");t.exports=function(e,t,r){var i=!1;function o(r,i){return n.coerce(e,t,a,r,i)}for(var l=0;l<r.length;l++){var s=r[l];if(s.visible&&"funnel"===s.type){i=!0;break}}i&&(o("funnelmode"),o("funnelgap",.2),o("funnelgroupgap"))}},{"../../lib":210,"./layout_attributes":344}],346:[function(e,t,r){"use strict";var n=e("d3"),a=e("../../lib"),i=e("../../components/drawing"),o=e("../../constants/numerical").BADNUM,l=e("../bar/plot"),s=e("../bar/uniform_text").clearMinTextSize;function c(e,t,r,n){var a=[],i=[],o=n?t:r,l=n?r:t;return a[0]=o.c2p(e.s0,!0),i[0]=l.c2p(e.p0,!0),a[1]=o.c2p(e.s1,!0),i[1]=l.c2p(e.p1,!0),a[2]=o.c2p(e.nextS0,!0),i[2]=l.c2p(e.nextP0,!0),a[3]=o.c2p(e.nextS1,!0),i[3]=l.c2p(e.nextP1,!0),n?[a,i]:[i,a]}t.exports=function(e,t,r,u){var f=e._fullLayout;s("funnel",f),function(e,t,r,l){var s=t.xaxis,u=t.yaxis;a.makeTraceGroups(l,r,"trace bars").each((function(r){var l=n.select(this),f=r[0].trace,d=a.ensureSingle(l,"g","regions");if(f.connector&&f.connector.visible){var p="h"===f.orientation,h=d.selectAll("g.region").data(a.identity);h.enter().append("g").classed("region",!0),h.exit().remove();var g=h.size();h.each((function(r,l){if(l===g-1||r.cNext){var f=c(r,s,u,p),d=f[0],h=f[1],v="";d[0]!==o&&h[0]!==o&&d[1]!==o&&h[1]!==o&&d[2]!==o&&h[2]!==o&&d[3]!==o&&h[3]!==o&&(v+=p?"M"+d[0]+","+h[1]+"L"+d[2]+","+h[2]+"H"+d[3]+"L"+d[1]+","+h[1]+"Z":"M"+d[1]+","+h[1]+"L"+d[2]+","+h[3]+"V"+h[2]+"L"+d[1]+","+h[0]+"Z"),""===v&&(v="M0,0Z"),a.ensureSingle(n.select(this),"path").attr("d",v).call(i.setClipUrl,t.layerClipId,e)}}))}else d.remove()}))}(e,t,r,u),function(e,t,r,o){var l=t.xaxis,s=t.yaxis;a.makeTraceGroups(o,r,"trace bars").each((function(r){var o=n.select(this),u=r[0].trace,f=a.ensureSingle(o,"g","lines");if(u.connector&&u.connector.visible&&u.connector.line.width){var d="h"===u.orientation,p=f.selectAll("g.line").data(a.identity);p.enter().append("g").classed("line",!0),p.exit().remove();var h=p.size();p.each((function(r,o){if(o===h-1||r.cNext){var u=c(r,l,s,d),f=u[0],p=u[1],g="";void 0!==f[3]&&void 0!==p[3]&&(d?(g+="M"+f[0]+","+p[1]+"L"+f[2]+","+p[2],g+="M"+f[1]+","+p[1]+"L"+f[3]+","+p[2]):(g+="M"+f[1]+","+p[1]+"L"+f[2]+","+p[3],g+="M"+f[1]+","+p[0]+"L"+f[2]+","+p[2])),""===g&&(g="M0,0Z"),a.ensureSingle(n.select(this),"path").attr("d",g).call(i.setClipUrl,t.layerClipId,e)}}))}else f.remove()}))}(e,t,r,u),l.plot(e,t,r,u,{mode:f.funnelmode,norm:f.funnelmode,gap:f.funnelgap,groupgap:f.funnelgroupgap})}},{"../../components/drawing":104,"../../constants/numerical":189,"../../lib":210,"../bar/plot":319,"../bar/uniform_text":324,d3:16}],347:[function(e,t,r){"use strict";var n=e("d3"),a=e("../../components/drawing"),i=e("../../components/color"),o=e("../../constants/interactions").DESELECTDIM,l=e("../bar/style"),s=e("../bar/uniform_text").resizeText,c=l.styleTextPoints;t.exports={style:function(e,t,r){var l=r||n.select(e).selectAll("g.funnellayer").selectAll("g.trace");s(e,l,"funnel"),l.style("opacity",(function(e){return e[0].trace.opacity})),l.each((function(t){var r=n.select(this),l=t[0].trace;r.selectAll(".point > path").each((function(e){if(!e.isBlank){var t=l.marker;n.select(this).call(i.fill,e.mc||t.color).call(i.stroke,e.mlc||t.line.color).call(a.dashLine,t.line.dash,e.mlw||t.line.width).style("opacity",l.selectedpoints&&!e.selected?o:1)}})),c(r,l,e),r.selectAll(".regions").each((function(){n.select(this).selectAll("path").style("stroke-width",0).call(i.fill,l.connector.fillcolor)})),r.selectAll(".lines").each((function(){var e=l.connector.line;a.lineGroupStyle(n.select(this).selectAll("path"),e.width,e.color,e.dash)}))}))}}},{"../../components/color":82,"../../components/drawing":104,"../../constants/interactions":188,"../bar/style":322,"../bar/uniform_text":324,d3:16}],348:[function(e,t,r){"use strict";var n=e("../pie/attributes"),a=e("../../plots/attributes"),i=e("../../plots/domain").attributes,o=e("../../plots/template_attributes").hovertemplateAttrs,l=e("../../plots/template_attributes").texttemplateAttrs,s=e("../../lib/extend").extendFlat;t.exports={labels:n.labels,label0:n.label0,dlabel:n.dlabel,values:n.values,marker:{colors:n.marker.colors,line:{color:s({},n.marker.line.color,{dflt:null}),width:s({},n.marker.line.width,{dflt:1}),editType:"calc"},editType:"calc"},text:n.text,hovertext:n.hovertext,scalegroup:s({},n.scalegroup,{}),textinfo:s({},n.textinfo,{flags:["label","text","value","percent"]}),texttemplate:l({editType:"plot"},{keys:["label","color","value","text","percent"]}),hoverinfo:s({},a.hoverinfo,{flags:["label","text","value","percent","name"]}),hovertemplate:o({},{keys:["label","color","value","text","percent"]}),textposition:s({},n.textposition,{values:["inside","none"],dflt:"inside"}),textfont:n.textfont,insidetextfont:n.insidetextfont,title:{text:n.title.text,font:n.title.font,position:s({},n.title.position,{values:["top left","top center","top right"],dflt:"top center"}),editType:"plot"},domain:i({name:"funnelarea",trace:!0,editType:"calc"}),aspectratio:{valType:"number",min:0,dflt:1,editType:"plot"},baseratio:{valType:"number",min:0,max:1,dflt:.333,editType:"plot"}}},{"../../lib/extend":204,"../../plots/attributes":252,"../../plots/domain":283,"../../plots/template_attributes":297,"../pie/attributes":386}],349:[function(e,t,r){"use strict";var n=e("../../plots/plots");r.name="funnelarea",r.plot=function(e,t,a,i){n.plotBasePlot(r.name,e,t,a,i)},r.clean=function(e,t,a,i){n.cleanBasePlot(r.name,e,t,a,i)}},{"../../plots/plots":290}],350:[function(e,t,r){"use strict";var n=e("../pie/calc");t.exports={calc:function(e,t){return n.calc(e,t)},crossTraceCalc:function(e){n.crossTraceCalc(e,{type:"funnelarea"})}}},{"../pie/calc":388}],351:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./attributes"),i=e("../../plots/domain").defaults,o=e("../bar/defaults").handleText,l=e("../pie/defaults").handleLabelsAndValues;t.exports=function(e,t,r,s){function c(r,i){return n.coerce(e,t,a,r,i)}var u=c("labels"),f=c("values"),d=l(u,f),p=d.len;if(t._hasLabels=d.hasLabels,t._hasValues=d.hasValues,!t._hasLabels&&t._hasValues&&(c("label0"),c("dlabel")),p){t._length=p,c("marker.line.width")&&c("marker.line.color",s.paper_bgcolor),c("marker.colors"),c("scalegroup");var h,g=c("text"),v=c("texttemplate");if(v||(h=c("textinfo",Array.isArray(g)?"text+percent":"percent")),c("hovertext"),c("hovertemplate"),v||h&&"none"!==h){var m=c("textposition");o(e,t,s,c,m,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1})}i(t,s,c),c("title.text")&&(c("title.position"),n.coerceFont(c,"title.font",s.font)),c("aspectratio"),c("baseratio")}else t.visible=!1}},{"../../lib":210,"../../plots/domain":283,"../bar/defaults":312,"../pie/defaults":389,"./attributes":348}],352:[function(e,t,r){"use strict";t.exports={moduleType:"trace",name:"funnelarea",basePlotModule:e("./base_plot"),categories:["pie-like","funnelarea","showLegend"],attributes:e("./attributes"),layoutAttributes:e("./layout_attributes"),supplyDefaults:e("./defaults"),supplyLayoutDefaults:e("./layout_defaults"),calc:e("./calc").calc,crossTraceCalc:e("./calc").crossTraceCalc,plot:e("./plot"),style:e("./style"),styleOne:e("../pie/style_one"),meta:{}}},{"../pie/style_one":397,"./attributes":348,"./base_plot":349,"./calc":350,"./defaults":351,"./layout_attributes":353,"./layout_defaults":354,"./plot":355,"./style":356}],353:[function(e,t,r){"use strict";var n=e("../pie/layout_attributes").hiddenlabels;t.exports={hiddenlabels:n,funnelareacolorway:{valType:"colorlist",editType:"calc"},extendfunnelareacolors:{valType:"boolean",dflt:!0,editType:"calc"}}},{"../pie/layout_attributes":393}],354:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./layout_attributes");t.exports=function(e,t){function r(r,i){return n.coerce(e,t,a,r,i)}r("hiddenlabels"),r("funnelareacolorway",t.colorway),r("extendfunnelareacolors")}},{"../../lib":210,"./layout_attributes":353}],355:[function(e,t,r){"use strict";var n=e("d3"),a=e("../../components/drawing"),i=e("../../lib"),o=i.strScale,l=i.strTranslate,s=e("../../lib/svg_text_utils"),c=e("../bar/plot").toMoveInsideBar,u=e("../bar/uniform_text"),f=u.recordMinTextSize,d=u.clearMinTextSize,p=e("../pie/helpers"),h=e("../pie/plot"),g=h.attachFxHandlers,v=h.determineInsideTextFont,m=h.layoutAreas,y=h.prerenderTitles,x=h.positionTitleOutside,b=h.formatSliceLabel;function _(e,t){return"l"+(t[0]-e[0])+","+(t[1]-e[1])}t.exports=function(e,t){var r=e._fullLayout;d("funnelarea",r),y(t,e),m(t,r._size),i.makeTraceGroups(r._funnelarealayer,t,"trace").each((function(t){var u=n.select(this),d=t[0],h=d.trace;!function(e){if(!e.length)return;var t=e[0],r=t.trace,n=r.aspectratio,a=r.baseratio;a>.999&&(a=.999);var i,o=Math.pow(a,2),l=t.vTotal,s=l,c=l*o/(1-o)/l;function u(){var e,t={x:e=Math.sqrt(c),y:-e};return[t.x,t.y]}var f,d,p=[];for(p.push(u()),f=e.length-1;f>-1;f--)if(!(d=e[f]).hidden){var h=d.v/s;c+=h,p.push(u())}var g=1/0,v=-1/0;for(f=0;f<p.length;f++)i=p[f],g=Math.min(g,i[1]),v=Math.max(v,i[1]);for(f=0;f<p.length;f++)p[f][1]-=(v+g)/2;var m=p[p.length-1][0],y=t.r,x=(v-g)/2,b=y/m,_=y/x*n;for(t.r=_*x,f=0;f<p.length;f++)p[f][0]*=b,p[f][1]*=_;var w=[-(i=p[0])[0],i[1]],T=[i[0],i[1]],k=0;for(f=e.length-1;f>-1;f--)if(!(d=e[f]).hidden){var M=p[k+=1][0],A=p[k][1];d.TL=[-M,A],d.TR=[M,A],d.BL=w,d.BR=T,d.pxmid=(L=d.TR,S=d.BR,[.5*(L[0]+S[0]),.5*(L[1]+S[1])]),w=d.TL,T=d.TR}var L,S}(t),u.each((function(){var u=n.select(this).selectAll("g.slice").data(t);u.enter().append("g").classed("slice",!0),u.exit().remove(),u.each((function(o,l){if(o.hidden)n.select(this).selectAll("path,g").remove();else{o.pointNumber=o.i,o.curveNumber=h.index;var u=d.cx,m=d.cy,y=n.select(this),x=y.selectAll("path.surface").data([o]);x.enter().append("path").classed("surface",!0).style({"pointer-events":"all"}),y.call(g,e,t);var w="M"+(u+o.TR[0])+","+(m+o.TR[1])+_(o.TR,o.BR)+_(o.BR,o.BL)+_(o.BL,o.TL)+"Z";x.attr("d",w),b(e,o,d);var T=p.castOption(h.textposition,o.pts),k=y.selectAll("g.slicetext").data(o.text&&"none"!==T?[0]:[]);k.enter().append("g").classed("slicetext",!0),k.exit().remove(),k.each((function(){var d=i.ensureSingle(n.select(this),"text","",(function(e){e.attr("data-notex",1)})),p=i.ensureUniformFontSize(e,v(h,o,r.font));d.text(o.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(a.font,p).call(s.convertToTspans,e);var g,y,x,b=a.bBox(d.node()),_=Math.min(o.BL[1],o.BR[1])+m,w=Math.max(o.TL[1],o.TR[1])+m;y=Math.max(o.TL[0],o.BL[0])+u,x=Math.min(o.TR[0],o.BR[0])+u,(g=c(y,x,_,w,b,{isHorizontal:!0,constrained:!0,angle:0,anchor:"middle"})).fontSize=p.size,f(h.type,g,r),t[l].transform=g,d.attr("transform",i.getTextTransform(g))}))}}));var m=n.select(this).selectAll("g.titletext").data(h.title.text?[0]:[]);m.enter().append("g").classed("titletext",!0),m.exit().remove(),m.each((function(){var t=i.ensureSingle(n.select(this),"text","",(function(e){e.attr("data-notex",1)})),c=h.title.text;h._meta&&(c=i.templateString(c,h._meta)),t.text(c).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(a.font,h.title.font).call(s.convertToTspans,e);var u=x(d,r._size);t.attr("transform",l(u.x,u.y)+o(Math.min(1,u.scale))+l(u.tx,u.ty))}))}))}))}},{"../../components/drawing":104,"../../lib":210,"../../lib/svg_text_utils":232,"../bar/plot":319,"../bar/uniform_text":324,"../pie/helpers":391,"../pie/plot":395,d3:16}],356:[function(e,t,r){"use strict";var n=e("d3"),a=e("../pie/style_one"),i=e("../bar/uniform_text").resizeText;t.exports=function(e){var t=e._fullLayout._funnelarealayer.selectAll(".trace");i(e,t,"funnelarea"),t.each((function(e){var t=e[0].trace,r=n.select(this);r.style({opacity:t.opacity}),r.selectAll("path.surface").each((function(e){n.select(this).call(a,e,t)}))}))}},{"../bar/uniform_text":324,"../pie/style_one":397,d3:16}],357:[function(e,t,r){"use strict";var n=e("../bar/attributes"),a=e("../../plots/template_attributes").hovertemplateAttrs,i=e("./bin_attributes"),o=e("./constants"),l=e("../../lib/extend").extendFlat;t.exports={x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},text:l({},n.text,{}),hovertext:l({},n.hovertext,{}),orientation:n.orientation,histfunc:{valType:"enumerated",values:["count","sum","avg","min","max"],dflt:"count",editType:"calc"},histnorm:{valType:"enumerated",values:["","percent","probability","density","probability density"],dflt:"",editType:"calc"},cumulative:{enabled:{valType:"boolean",dflt:!1,editType:"calc"},direction:{valType:"enumerated",values:["increasing","decreasing"],dflt:"increasing",editType:"calc"},currentbin:{valType:"enumerated",values:["include","exclude","half"],dflt:"include",editType:"calc"},editType:"calc"},nbinsx:{valType:"integer",min:0,dflt:0,editType:"calc"},xbins:i("x",!0),nbinsy:{valType:"integer",min:0,dflt:0,editType:"calc"},ybins:i("y",!0),autobinx:{valType:"boolean",dflt:null,editType:"calc"},autobiny:{valType:"boolean",dflt:null,editType:"calc"},bingroup:{valType:"string",dflt:"",editType:"calc"},hovertemplate:a({},{keys:o.eventDataKeys}),marker:n.marker,offsetgroup:n.offsetgroup,alignmentgroup:n.alignmentgroup,selected:n.selected,unselected:n.unselected,_deprecated:{bardir:n._deprecated.bardir}}},{"../../lib/extend":204,"../../plots/template_attributes":297,"../bar/attributes":308,"./bin_attributes":359,"./constants":363}],358:[function(e,t,r){"use strict";t.exports=function(e,t){for(var r=e.length,n=0,a=0;a<r;a++)t[a]?(e[a]/=t[a],n+=e[a]):e[a]=null;return n}},{}],359:[function(e,t,r){"use strict";t.exports=function(e,t){return{start:{valType:"any",editType:"calc"},end:{valType:"any",editType:"calc"},size:{valType:"any",editType:"calc"},editType:"calc"}}},{}],360:[function(e,t,r){"use strict";var n=e("fast-isnumeric");t.exports={count:function(e,t,r){return r[e]++,1},sum:function(e,t,r,a){var i=a[t];return n(i)?(i=Number(i),r[e]+=i,i):0},avg:function(e,t,r,a,i){var o=a[t];return n(o)&&(o=Number(o),r[e]+=o,i[e]++),0},min:function(e,t,r,a){var i=a[t];if(n(i)){if(i=Number(i),!n(r[e]))return r[e]=i,i;if(r[e]>i){var o=i-r[e];return r[e]=i,o}}return 0},max:function(e,t,r,a){var i=a[t];if(n(i)){if(i=Number(i),!n(r[e]))return r[e]=i,i;if(r[e]<i){var o=i-r[e];return r[e]=i,o}}return 0}}},{"fast-isnumeric":18}],361:[function(e,t,r){"use strict";var n=e("../../constants/numerical"),a=n.ONEAVGYEAR,i=n.ONEAVGMONTH,o=n.ONEDAY,l=n.ONEHOUR,s=n.ONEMIN,c=n.ONESEC,u=e("../../plots/cartesian/axes").tickIncrement;function f(e,t,r,n){if(e*t<=0)return 1/0;for(var a=Math.abs(t-e),i="date"===r.type,o=d(a,i),l=0;l<10;l++){var s=d(80*o,i);if(o===s)break;if(!p(s,e,t,i,r,n))break;o=s}return o}function d(e,t){return t&&e>c?e>o?e>1.1*a?a:e>1.1*i?i:o:e>l?l:e>s?s:c:Math.pow(10,Math.floor(Math.log(e)/Math.LN10))}function p(e,t,r,n,i,l){if(n&&e>o){var s=h(t,i,l),c=h(r,i,l),u=e===a?0:1;return s[u]!==c[u]}return Math.floor(r/e)-Math.floor(t/e)>.1}function h(e,t,r){var n=t.c2d(e,a,r).split("-");return""===n[0]&&(n.unshift(),n[0]="-"+n[0]),n}t.exports=function(e,t,r,n,i){var l,s,c=-1.1*t,d=-.1*t,p=e-d,h=r[0],g=r[1],v=Math.min(f(h+d,h+p,n,i),f(g+d,g+p,n,i)),m=Math.min(f(h+c,h+d,n,i),f(g+c,g+d,n,i));if(v>m&&m<Math.abs(g-h)/4e3?(l=v,s=!1):(l=Math.min(v,m),s=!0),"date"===n.type&&l>o){var y=l===a?1:6,x=l===a?"M12":"M1";return function(t,r){var o=n.c2d(t,a,i),l=o.indexOf("-",y);l>0&&(o=o.substr(0,l));var c=n.d2c(o,0,i);if(c<t){var f=u(c,x,!1,i);(c+f)/2<t+e&&(c=f)}return r&&s?u(c,x,!0,i):c}}return function(t,r){var n=l*Math.round(t/l);return n+l/10<t&&n+.9*l<t+e&&(n+=l),r&&s&&(n-=l),n}}},{"../../constants/numerical":189,"../../plots/cartesian/axes":256}],362:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("../../lib"),i=e("../../registry"),o=e("../../plots/cartesian/axes"),l=e("../bar/arrays_to_calcdata"),s=e("./bin_functions"),c=e("./norm_functions"),u=e("./average"),f=e("./bin_label_vals");function d(e,t,r,l,s){var c,u,f,p,h,g,v,m=l+"bins",y=e._fullLayout,x=t["_"+l+"bingroup"],b=y._histogramBinOpts[x],_="overlay"===y.barmode,w=function(e){return r.r2c(e,0,p)},T=function(e){return r.c2r(e,0,p)},k="date"===r.type?function(e){return e||0===e?a.cleanDate(e,null,p):null}:function(e){return n(e)?Number(e):null};function M(e,t,r){t[e+"Found"]?(t[e]=k(t[e]),null===t[e]&&(t[e]=r[e])):(g[e]=t[e]=r[e],a.nestedProperty(u[0],m+"."+e).set(r[e]))}if(t["_"+l+"autoBinFinished"])delete t["_"+l+"autoBinFinished"];else{u=b.traces;var A=[],L=!0,S=!1,C=!1;for(c=0;c<u.length;c++)if((f=u[c]).visible){var O=b.dirs[c];h=f["_"+O+"pos0"]=r.makeCalcdata(f,O),A=a.concat(A,h),delete f["_"+l+"autoBinFinished"],!0===t.visible&&(L?L=!1:(delete f._autoBin,f["_"+l+"autoBinFinished"]=1),i.traceIs(f,"2dMap")&&(S=!0),"histogram2dcontour"===f.type&&(C=!0))}p=u[0][l+"calendar"];var D=o.autoBin(A,r,b.nbins,S,p,b.sizeFound&&b.size),P=u[0]._autoBin={};if(g=P[b.dirs[0]]={},C&&(b.size||(D.start=T(o.tickIncrement(w(D.start),D.size,!0,p))),void 0===b.end&&(D.end=T(o.tickIncrement(w(D.end),D.size,!1,p)))),_&&!i.traceIs(t,"2dMap")&&0===D._dataSpan&&"category"!==r.type&&"multicategory"!==r.type){if(s)return[D,h,!0];D=function(e,t,r,n,i){var o,l,s,c=e._fullLayout,u=function(e,t){for(var r=t.xaxis,n=t.yaxis,a=t.orientation,i=[],o=e._fullData,l=0;l<o.length;l++){var s=o[l];"histogram"===s.type&&!0===s.visible&&s.orientation===a&&s.xaxis===r&&s.yaxis===n&&i.push(s)}return i}(e,t),f=!1,p=1/0,h=[t];for(o=0;o<u.length;o++)if((l=u[o])===t)f=!0;else if(f){var g=d(e,l,r,n,!0),v=g[0],m=g[2];l["_"+n+"autoBinFinished"]=1,l["_"+n+"pos0"]=g[1],m?h.push(l):p=Math.min(p,v.size)}else s=c._histogramBinOpts[l["_"+n+"bingroup"]],p=Math.min(p,s.size||l[i].size);var y=new Array(h.length);for(o=0;o<h.length;o++)for(var x=h[o]["_"+n+"pos0"],b=0;b<x.length;b++)if(void 0!==x[b]){y[o]=x[b];break}isFinite(p)||(p=a.distinctVals(y).minDiff);for(o=0;o<h.length;o++){var _=(l=h[o])[n+"calendar"],w={start:r.c2r(y[o]-p/2,0,_),end:r.c2r(y[o]+p/2,0,_),size:p};l._input[i]=l[i]=w,(s=c._histogramBinOpts[l["_"+n+"bingroup"]])&&a.extendFlat(s,w)}return t[i]}(e,t,r,l,m)}(v=f.cumulative||{}).enabled&&"include"!==v.currentbin&&("decreasing"===v.direction?D.start=T(o.tickIncrement(w(D.start),D.size,!0,p)):D.end=T(o.tickIncrement(w(D.end),D.size,!1,p))),b.size=D.size,b.sizeFound||(g.size=D.size,a.nestedProperty(u[0],m+".size").set(D.size)),M("start",b,D),M("end",b,D)}h=t["_"+l+"pos0"],delete t["_"+l+"pos0"];var z=t._input[m]||{},R=a.extendFlat({},b),E=b.start,I=r.r2l(z.start),F=void 0!==I;if((b.startFound||F)&&I!==r.r2l(E)){var N=F?I:a.aggNums(Math.min,null,h),H={type:"category"===r.type||"multicategory"===r.type?"linear":r.type,r2l:r.r2l,dtick:b.size,tick0:E,calendar:p,range:[N,o.tickIncrement(N,b.size,!1,p)].map(r.l2r)},B=o.tickFirst(H);B>r.r2l(N)&&(B=o.tickIncrement(B,b.size,!0,p)),R.start=r.l2r(B),F||a.nestedProperty(t,m+".start").set(R.start)}var j=b.end,V=r.r2l(z.end),U=void 0!==V;if((b.endFound||U)&&V!==r.r2l(j)){var q=U?V:a.aggNums(Math.max,null,h);R.end=r.l2r(q),U||a.nestedProperty(t,m+".start").set(R.end)}var G="autobin"+l;return!1===t._input[G]&&(t._input[m]=a.extendFlat({},t[m]||{}),delete t._input[G],delete t[G]),[R,h]}t.exports={calc:function(e,t){var r,i,p,h,g=[],v=[],m=o.getFromId(e,"h"===t.orientation?t.yaxis:t.xaxis),y="h"===t.orientation?"y":"x",x={x:"y",y:"x"}[y],b=t[y+"calendar"],_=t.cumulative,w=d(e,t,m,y),T=w[0],k=w[1],M="string"==typeof T.size,A=[],L=M?A:T,S=[],C=[],O=[],D=0,P=t.histnorm,z=t.histfunc,R=-1!==P.indexOf("density");_.enabled&&R&&(P=P.replace(/ ?density$/,""),R=!1);var E,I="max"===z||"min"===z?null:0,F=s.count,N=c[P],H=!1,B=function(e){return m.r2c(e,0,b)};for(a.isArrayOrTypedArray(t[x])&&"count"!==z&&(E=t[x],H="avg"===z,F=s[z]),r=B(T.start),p=B(T.end)+(r-o.tickIncrement(r,T.size,!1,b))/1e6;r<p&&g.length<1e6&&(i=o.tickIncrement(r,T.size,!1,b),g.push((r+i)/2),v.push(I),O.push([]),A.push(r),R&&S.push(1/(i-r)),H&&C.push(0),!(i<=r));)r=i;A.push(r),M||"date"!==m.type||(L={start:B(L.start),end:B(L.end),size:L.size}),e._fullLayout._roundFnOpts||(e._fullLayout._roundFnOpts={});var j=t["_"+y+"bingroup"],V={leftGap:1/0,rightGap:1/0};j&&(e._fullLayout._roundFnOpts[j]||(e._fullLayout._roundFnOpts[j]=V),V=e._fullLayout._roundFnOpts[j]);var U,q=v.length,G=!0,Z=V.leftGap,Y=V.rightGap,X={};for(r=0;r<k.length;r++){var W=k[r];(h=a.findBin(W,L))>=0&&h<q&&(D+=F(h,r,v,E,C),G&&O[h].length&&W!==k[O[h][0]]&&(G=!1),O[h].push(r),X[r]=h,Z=Math.min(Z,W-A[h]),Y=Math.min(Y,A[h+1]-W))}V.leftGap=Z,V.rightGap=Y,G||(U=function(t,r){return function(){var n=e._fullLayout._roundFnOpts[j];return f(n.leftGap,n.rightGap,A,m,b)(t,r)}}),H&&(D=u(v,C)),N&&N(v,D,S),_.enabled&&function(e,t,r){var n,a,i;function o(t){i=e[t],e[t]/=2}function l(t){a=e[t],e[t]=i+a/2,i+=a}if("half"===r)if("increasing"===t)for(o(0),n=1;n<e.length;n++)l(n);else for(o(e.length-1),n=e.length-2;n>=0;n--)l(n);else if("increasing"===t){for(n=1;n<e.length;n++)e[n]+=e[n-1];"exclude"===r&&(e.unshift(0),e.pop())}else{for(n=e.length-2;n>=0;n--)e[n]+=e[n+1];"exclude"===r&&(e.push(0),e.shift())}}(v,_.direction,_.currentbin);var Q=Math.min(g.length,v.length),J=[],$=0,K=Q-1;for(r=0;r<Q;r++)if(v[r]){$=r;break}for(r=Q-1;r>=$;r--)if(v[r]){K=r;break}for(r=$;r<=K;r++)if(n(g[r])&&n(v[r])){var ee={p:g[r],s:v[r],b:0};_.enabled||(ee.pts=O[r],G?ee.ph0=ee.ph1=O[r].length?k[O[r][0]]:g[r]:(t._computePh=!0,ee.ph0=U(A[r]),ee.ph1=U(A[r+1],!0))),J.push(ee)}return 1===J.length&&(J[0].width1=o.tickIncrement(J[0].p,T.size,!1,b)-J[0].p),l(J,t),a.isArrayOrTypedArray(t.selectedpoints)&&a.tagSelected(J,t,X),J},calcAllAutoBins:d}},{"../../lib":210,"../../plots/cartesian/axes":256,"../../registry":298,"../bar/arrays_to_calcdata":307,"./average":358,"./bin_functions":360,"./bin_label_vals":361,"./norm_functions":369,"fast-isnumeric":18}],363:[function(e,t,r){"use strict";t.exports={eventDataKeys:["binNumber"]}},{}],364:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/cartesian/axis_ids"),i=e("../../registry").traceIs,o=e("../bar/defaults").handleGroupingDefaults,l=n.nestedProperty,s=e("../../plots/cartesian/constraints").getAxisGroup,c=[{aStr:{x:"xbins.start",y:"ybins.start"},name:"start"},{aStr:{x:"xbins.end",y:"ybins.end"},name:"end"},{aStr:{x:"xbins.size",y:"ybins.size"},name:"size"},{aStr:{x:"nbinsx",y:"nbinsy"},name:"nbins"}],u=["x","y"];t.exports=function(e,t){var r,f,d,p,h,g,v,m=t._histogramBinOpts={},y=[],x={},b=[];function _(e,t){return n.coerce(r._input,r,r._module.attributes,e,t)}function w(e){return"v"===e.orientation?"x":"y"}function T(e,r,i){var o=e.uid+"__"+i;r||(r=o);var l=function(e,r){return a.getFromTrace({_fullLayout:t},e,r).type}(e,i),s=e[i+"calendar"]||"",c=m[r],u=!0;c&&(l===c.axType&&s===c.calendar?(u=!1,c.traces.push(e),c.dirs.push(i)):(r=o,l!==c.axType&&n.warn(["Attempted to group the bins of trace",e.index,"set on a","type:"+l,"axis","with bins on","type:"+c.axType,"axis."].join(" ")),s!==c.calendar&&n.warn(["Attempted to group the bins of trace",e.index,"set with a",s,"calendar","with bins",c.calendar?"on a "+c.calendar+" calendar":"w/o a set calendar"].join(" ")))),u&&(m[r]={traces:[e],dirs:[i],axType:l,calendar:e[i+"calendar"]||""}),e["_"+i+"bingroup"]=r}for(h=0;h<e.length;h++)r=e[h],i(r,"histogram")&&(y.push(r),delete r._xautoBinFinished,delete r._yautoBinFinished,i(r,"2dMap")||o(r._input,r,t,_));var k=t._alignmentOpts||{};for(h=0;h<y.length;h++){if(r=y[h],d="",!i(r,"2dMap")){if(p=w(r),"group"===t.barmode&&r.alignmentgroup){var M=r[p+"axis"],A=s(t,M)+r.orientation;(k[A]||{})[r.alignmentgroup]&&(d=A)}d||"overlay"===t.barmode||(d=s(t,r.xaxis)+s(t,r.yaxis)+w(r))}d?(x[d]||(x[d]=[]),x[d].push(r)):b.push(r)}for(d in x)if(1!==(f=x[d]).length){var L=!1;for(f.length&&(r=f[0],L=_("bingroup")),d=L||d,h=0;h<f.length;h++){var S=(r=f[h])._input.bingroup;S&&S!==d&&n.warn(["Trace",r.index,"must match","within bingroup",d+".","Ignoring its bingroup:",S,"setting."].join(" ")),r.bingroup=d,T(r,d,w(r))}}else b.push(f[0]);for(h=0;h<b.length;h++){r=b[h];var C=_("bingroup");if(i(r,"2dMap"))for(v=0;v<2;v++){var O=_((p=u[v])+"bingroup",C?C+"__"+p:null);T(r,O,p)}else T(r,C,w(r))}for(d in m){var D=m[d];for(f=D.traces,g=0;g<c.length;g++){var P,z,R=c[g],E=R.name;if("nbins"!==E||!D.sizeFound){for(h=0;h<f.length;h++){if(r=f[h],p=D.dirs[h],P=R.aStr[p],void 0!==l(r._input,P).get()){D[E]=_(P),D[E+"Found"]=!0;break}(z=(r._autoBin||{})[p]||{})[E]&&l(r,P).set(z[E])}if("start"===E||"end"===E)for(;h<f.length;h++)(r=f[h])["_"+p+"bingroup"]&&_(P,(z=(r._autoBin||{})[p]||{})[E]);"nbins"!==E||D.sizeFound||D.nbinsFound||(r=f[0],D[E]=_(P))}}}}},{"../../lib":210,"../../plots/cartesian/axis_ids":259,"../../plots/cartesian/constraints":263,"../../registry":298,"../bar/defaults":312}],365:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../lib"),i=e("../../components/color"),o=e("../bar/style_defaults"),l=e("./attributes");t.exports=function(e,t,r,s){function c(r,n){return a.coerce(e,t,l,r,n)}var u=c("x"),f=c("y");c("cumulative.enabled")&&(c("cumulative.direction"),c("cumulative.currentbin")),c("text"),c("hovertext"),c("hovertemplate");var d=c("orientation",f&&!u?"h":"v"),p="v"===d?"x":"y",h="v"===d?"y":"x",g=u&&f?Math.min(a.minRowLength(u)&&a.minRowLength(f)):a.minRowLength(t[p]||[]);if(g){t._length=g,n.getComponentMethod("calendars","handleTraceDefaults")(e,t,["x","y"],s),t[h]&&c("histfunc"),c("histnorm"),c("autobin"+p),o(e,t,c,r,s),a.coerceSelectionMarkerOpacity(t,c);var v=(t.marker.line||{}).color,m=n.getComponentMethod("errorbars","supplyDefaults");m(e,t,v||i.defaultLine,{axis:"y"}),m(e,t,v||i.defaultLine,{axis:"x",inherit:"y"})}else t.visible=!1}},{"../../components/color":82,"../../lib":210,"../../registry":298,"../bar/style_defaults":323,"./attributes":357}],366:[function(e,t,r){"use strict";t.exports=function(e,t,r,n,a){if(e.x="xVal"in t?t.xVal:t.x,e.y="yVal"in t?t.yVal:t.y,"zLabelVal"in t&&(e.z=t.zLabelVal),t.xa&&(e.xaxis=t.xa),t.ya&&(e.yaxis=t.ya),!(r.cumulative||{}).enabled){var i,o=Array.isArray(a)?n[0].pts[a[0]][a[1]]:n[a].pts;if(e.pointNumbers=o,e.binNumber=e.pointNumber,delete e.pointNumber,delete e.pointIndex,r._indexToPoints){i=[];for(var l=0;l<o.length;l++)i=i.concat(r._indexToPoints[o[l]])}else i=o;e.pointIndices=i}return e}},{}],367:[function(e,t,r){"use strict";var n=e("../bar/hover").hoverPoints,a=e("../../plots/cartesian/axes").hoverLabelText;t.exports=function(e,t,r,i){var o=n(e,t,r,i);if(o){var l=(e=o[0]).cd[e.index],s=e.cd[0].trace;if(!s.cumulative.enabled){var c="h"===s.orientation?"y":"x";e[c+"Label"]=a(e[c+"a"],l.ph0,l.ph1)}return o}}},{"../../plots/cartesian/axes":256,"../bar/hover":315}],368:[function(e,t,r){"use strict";t.exports={attributes:e("./attributes"),layoutAttributes:e("../bar/layout_attributes"),supplyDefaults:e("./defaults"),crossTraceDefaults:e("./cross_trace_defaults"),supplyLayoutDefaults:e("../bar/layout_defaults"),calc:e("./calc").calc,crossTraceCalc:e("../bar/cross_trace_calc").crossTraceCalc,plot:e("../bar/plot").plot,layerName:"barlayer",style:e("../bar/style").style,styleOnSelect:e("../bar/style").styleOnSelect,colorbar:e("../scatter/marker_colorbar"),hoverPoints:e("./hover"),selectPoints:e("../bar/select"),eventData:e("./event_data"),moduleType:"trace",name:"histogram",basePlotModule:e("../../plots/cartesian"),categories:["bar-like","cartesian","svg","bar","histogram","oriented","errorBarsOK","showLegend"],meta:{}}},{"../../plots/cartesian":269,"../bar/cross_trace_calc":311,"../bar/layout_attributes":317,"../bar/layout_defaults":318,"../bar/plot":319,"../bar/select":320,"../bar/style":322,"../scatter/marker_colorbar":417,"./attributes":357,"./calc":362,"./cross_trace_defaults":364,"./defaults":365,"./event_data":366,"./hover":367}],369:[function(e,t,r){"use strict";t.exports={percent:function(e,t){for(var r=e.length,n=100/t,a=0;a<r;a++)e[a]*=n},probability:function(e,t){for(var r=e.length,n=0;n<r;n++)e[n]/=t},density:function(e,t,r,n){var a=e.length;n=n||1;for(var i=0;i<a;i++)e[i]*=r[i]*n},"probability density":function(e,t,r,n){var a=e.length;n&&(t/=n);for(var i=0;i<a;i++)e[i]*=r[i]/t}}},{}],370:[function(e,t,r){"use strict";var n=e("../../lib/extend").extendFlat,a=e("../../lib/extend").extendDeep,i=e("../../plot_api/edit_types").overrideAll,o=e("../../plots/font_attributes"),l=e("../../components/color/attributes"),s=e("../../plots/domain").attributes,c=e("../../plots/cartesian/layout_attributes"),u=e("../../plot_api/plot_template").templatedArray,f=e("../../constants/delta.js"),d=(e("../../constants/docs").FORMAT_LINK,o({editType:"plot",colorEditType:"plot"})),p={color:{valType:"color",editType:"plot"},line:{color:{valType:"color",dflt:l.defaultLine,editType:"plot"},width:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"calc"},thickness:{valType:"number",min:0,max:1,dflt:1,editType:"plot"},editType:"calc"},h={valType:"info_array",items:[{valType:"number",editType:"plot"},{valType:"number",editType:"plot"}],editType:"plot"},g=u("step",a({},p,{range:h}));t.exports={mode:{valType:"flaglist",editType:"calc",flags:["number","delta","gauge"],dflt:"number"},value:{valType:"number",editType:"calc",anim:!0},align:{valType:"enumerated",values:["left","center","right"],editType:"plot"},domain:s({name:"indicator",trace:!0,editType:"calc"}),title:{text:{valType:"string",editType:"plot"},align:{valType:"enumerated",values:["left","center","right"],editType:"plot"},font:n({},d,{}),editType:"plot"},number:{valueformat:{valType:"string",dflt:"",editType:"plot"},font:n({},d,{}),prefix:{valType:"string",dflt:"",editType:"plot"},suffix:{valType:"string",dflt:"",editType:"plot"},editType:"plot"},delta:{reference:{valType:"number",editType:"calc"},position:{valType:"enumerated",values:["top","bottom","left","right"],dflt:"bottom",editType:"plot"},relative:{valType:"boolean",editType:"plot",dflt:!1},valueformat:{valType:"string",editType:"plot"},increasing:{symbol:{valType:"string",dflt:f.INCREASING.SYMBOL,editType:"plot"},color:{valType:"color",dflt:f.INCREASING.COLOR,editType:"plot"},editType:"plot"},decreasing:{symbol:{valType:"string",dflt:f.DECREASING.SYMBOL,editType:"plot"},color:{valType:"color",dflt:f.DECREASING.COLOR,editType:"plot"},editType:"plot"},font:n({},d,{}),editType:"calc"},gauge:{shape:{valType:"enumerated",editType:"plot",dflt:"angular",values:["angular","bullet"]},bar:a({},p,{color:{dflt:"green"}}),bgcolor:{valType:"color",editType:"plot"},bordercolor:{valType:"color",dflt:l.defaultLine,editType:"plot"},borderwidth:{valType:"number",min:0,dflt:1,editType:"plot"},axis:i({range:h,visible:n({},c.visible,{dflt:!0}),tickmode:c.tickmode,nticks:c.nticks,tick0:c.tick0,dtick:c.dtick,tickvals:c.tickvals,ticktext:c.ticktext,ticks:n({},c.ticks,{dflt:"outside"}),ticklen:c.ticklen,tickwidth:c.tickwidth,tickcolor:c.tickcolor,showticklabels:c.showticklabels,tickfont:o({}),tickangle:c.tickangle,tickformat:c.tickformat,tickformatstops:c.tickformatstops,tickprefix:c.tickprefix,showtickprefix:c.showtickprefix,ticksuffix:c.ticksuffix,showticksuffix:c.showticksuffix,separatethousands:c.separatethousands,exponentformat:c.exponentformat,minexponent:c.minexponent,showexponent:c.showexponent,editType:"plot"},"plot"),steps:g,threshold:{line:{color:n({},p.line.color,{}),width:n({},p.line.width,{dflt:1}),editType:"plot"},thickness:n({},p.thickness,{dflt:.85}),value:{valType:"number",editType:"calc",dflt:!1},editType:"plot"},editType:"plot"}}},{"../../components/color/attributes":81,"../../constants/delta.js":186,"../../constants/docs":187,"../../lib/extend":204,"../../plot_api/edit_types":238,"../../plot_api/plot_template":245,"../../plots/cartesian/layout_attributes":270,"../../plots/domain":283,"../../plots/font_attributes":284}],371:[function(e,t,r){"use strict";var n=e("../../plots/plots");r.name="indicator",r.plot=function(e,t,a,i){n.plotBasePlot(r.name,e,t,a,i)},r.clean=function(e,t,a,i){n.cleanBasePlot(r.name,e,t,a,i)}},{"../../plots/plots":290}],372:[function(e,t,r){"use strict";t.exports={calc:function(e,t){var r=[],n=t.value;"number"!=typeof t._lastValue&&(t._lastValue=t.value);var a=t._lastValue,i=a;return t._hasDelta&&"number"==typeof t.delta.reference&&(i=t.delta.reference),r[0]={y:n,lastY:a,delta:n-i,relativeDelta:(n-i)/i},r}}},{}],373:[function(e,t,r){"use strict";t.exports={defaultNumberFontSize:80,bulletNumberDomainSize:.25,bulletPadding:.025,innerRadius:.75,valueThickness:.5,titlePadding:5,horizontalPadding:10}},{}],374:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./attributes"),i=e("../../plots/domain").defaults,o=e("../../plot_api/plot_template"),l=e("../../plots/array_container_defaults"),s=e("./constants.js"),c=e("../../plots/cartesian/tick_value_defaults"),u=e("../../plots/cartesian/tick_mark_defaults"),f=e("../../plots/cartesian/tick_label_defaults");function d(e,t){function r(r,i){return n.coerce(e,t,a.gauge.steps,r,i)}r("color"),r("line.color"),r("line.width"),r("range"),r("thickness")}t.exports={supplyDefaults:function(e,t,r,p){function h(r,i){return n.coerce(e,t,a,r,i)}i(t,p,h),h("mode"),t._hasNumber=-1!==t.mode.indexOf("number"),t._hasDelta=-1!==t.mode.indexOf("delta"),t._hasGauge=-1!==t.mode.indexOf("gauge");var g=h("value");t._range=[0,"number"==typeof g?1.5*g:1];var v,m,y,x,b,_,w=new Array(2);function T(e,t){return n.coerce(y,x,a.gauge,e,t)}function k(e,t){return n.coerce(b,_,a.gauge.axis,e,t)}if(t._hasNumber&&(h("number.valueformat"),h("number.font.color",p.font.color),h("number.font.family",p.font.family),h("number.font.size"),void 0===t.number.font.size&&(t.number.font.size=s.defaultNumberFontSize,w[0]=!0),h("number.prefix"),h("number.suffix"),v=t.number.font.size),t._hasDelta&&(h("delta.font.color",p.font.color),h("delta.font.family",p.font.family),h("delta.font.size"),void 0===t.delta.font.size&&(t.delta.font.size=(t._hasNumber?.5:1)*(v||s.defaultNumberFontSize),w[1]=!0),h("delta.reference",t.value),h("delta.relative"),h("delta.valueformat",t.delta.relative?"2%":""),h("delta.increasing.symbol"),h("delta.increasing.color"),h("delta.decreasing.symbol"),h("delta.decreasing.color"),h("delta.position"),m=t.delta.font.size),t._scaleNumbers=(!t._hasNumber||w[0])&&(!t._hasDelta||w[1])||!1,h("title.font.color",p.font.color),h("title.font.family",p.font.family),h("title.font.size",.25*(v||m||s.defaultNumberFontSize)),h("title.text"),t._hasGauge){(y=e.gauge)||(y={}),x=o.newContainer(t,"gauge"),T("shape"),(t._isBullet="bullet"===t.gauge.shape)||h("title.align","center"),(t._isAngular="angular"===t.gauge.shape)||h("align","center"),T("bgcolor",p.paper_bgcolor),T("borderwidth"),T("bordercolor"),T("bar.color"),T("bar.line.color"),T("bar.line.width"),T("bar.thickness",s.valueThickness*("bullet"===t.gauge.shape?.5:1)),l(y,x,{name:"steps",handleItemDefaults:d}),T("threshold.value"),T("threshold.thickness"),T("threshold.line.width"),T("threshold.line.color"),b={},y&&(b=y.axis||{}),_=o.newContainer(x,"axis"),k("visible"),t._range=k("range",t._range);var M={outerTicks:!0};c(b,_,k,"linear"),f(b,_,k,"linear",M),u(b,_,k,M)}else h("title.align","center"),h("align","center"),t._isAngular=t._isBullet=!1;t._length=null}}},{"../../lib":210,"../../plot_api/plot_template":245,"../../plots/array_container_defaults":251,"../../plots/cartesian/tick_label_defaults":277,"../../plots/cartesian/tick_mark_defaults":278,"../../plots/cartesian/tick_value_defaults":279,"../../plots/domain":283,"./attributes":370,"./constants.js":373}],375:[function(e,t,r){"use strict";t.exports={moduleType:"trace",name:"indicator",basePlotModule:e("./base_plot"),categories:["svg","noOpacity","noHover"],animatable:!0,attributes:e("./attributes"),supplyDefaults:e("./defaults").supplyDefaults,calc:e("./calc").calc,plot:e("./plot"),meta:{}}},{"./attributes":370,"./base_plot":371,"./calc":372,"./defaults":374,"./plot":376}],376:[function(e,t,r){"use strict";var n=e("d3"),a=e("../../lib"),i=a.strScale,o=a.strTranslate,l=a.rad2deg,s=e("../../constants/alignment").MID_SHIFT,c=e("../../components/drawing"),u=e("./constants"),f=e("../../lib/svg_text_utils"),d=e("../../plots/cartesian/axes"),p=e("../../plots/cartesian/axis_defaults"),h=e("../../plots/cartesian/position_defaults"),g=e("../../plots/cartesian/layout_attributes"),v=e("../../components/color"),m={left:"start",center:"middle",right:"end"},y={left:0,center:.5,right:1},x=/[yzafpn\xb5mkMGTPEZY]/;function b(e){return e&&e.duration>0}function _(e){e.each((function(e){v.stroke(n.select(this),e.line.color)})).each((function(e){v.fill(n.select(this),e.color)})).style("stroke-width",(function(e){return e.line.width}))}function w(e,t,r){var n=e._fullLayout,i=a.extendFlat({type:"linear",ticks:"outside",range:r,showline:!0},t),o={type:"linear",_id:"x"+t._id},l={letter:"x",font:n.font,noHover:!0,noTickson:!0};function s(e,t){return a.coerce(i,o,g,e,t)}return p(i,o,s,l,n),h(i,o,s,l),o}function T(e,t,r){return[Math.min(t/e.width,r/e.height),e,t+"x"+r]}function k(e,t,r,a){var i=document.createElementNS("http://www.w3.org/2000/svg","text"),o=n.select(i);return o.text(e).attr("x",0).attr("y",0).attr("text-anchor",r).attr("data-unformatted",e).call(f.convertToTspans,a).call(c.font,t),c.bBox(o.node())}function M(e,t,r,n,i,o){var l="_cache"+t;e[l]&&e[l].key===i||(e[l]={key:i,value:r});var s=a.aggNums(o,null,[e[l].value,n],2);return e[l].value=s,s}t.exports=function(e,t,r,p){var h,g=e._fullLayout;b(r)&&p&&(h=p()),a.makeTraceGroups(g._indicatorlayer,t,"trace").each((function(t){var p,A,L,S,C,O=t[0].trace,D=n.select(this),P=O._hasGauge,z=O._isAngular,R=O._isBullet,E=O.domain,I={w:g._size.w*(E.x[1]-E.x[0]),h:g._size.h*(E.y[1]-E.y[0]),l:g._size.l+g._size.w*E.x[0],r:g._size.r+g._size.w*(1-E.x[1]),t:g._size.t+g._size.h*(1-E.y[1]),b:g._size.b+g._size.h*E.y[0]},F=I.l+I.w/2,N=I.t+I.h/2,H=Math.min(I.w/2,I.h),B=u.innerRadius*H,j=O.align||"center";if(A=N,P){if(z&&(p=F,A=N+H/2,L=function(e){return function(e,t){var r=Math.sqrt(e.width/2*(e.width/2)+e.height*e.height);return[t/r,e,t]}(e,.9*B)}),R){var V=u.bulletPadding,U=1-u.bulletNumberDomainSize+V;p=I.l+(U+(1-U)*y[j])*I.w,L=function(e){return T(e,(u.bulletNumberDomainSize-V)*I.w,I.h)}}}else p=I.l+y[j]*I.w,L=function(e){return T(e,I.w,I.h)};!function(e,t,r,l){var s,u,p,h=r[0].trace,g=l.numbersX,_=l.numbersY,T=h.align||"center",A=m[T],L=l.transitionOpts,S=l.onComplete,C=a.ensureSingle(t,"g","numbers"),O=[];h._hasNumber&&O.push("number");h._hasDelta&&(O.push("delta"),"left"===h.delta.position&&O.reverse());var D=C.selectAll("text").data(O);function P(t,r,n,a){if(!t.match("s")||n>=0==a>=0||r(n).slice(-1).match(x)||r(a).slice(-1).match(x))return r;var i=t.slice().replace("s","f").replace(/\d+/,(function(e){return parseInt(e)-1})),o=w(e,{tickformat:i});return function(e){return Math.abs(e)<1?d.tickText(o,e).text:r(e)}}D.enter().append("text"),D.attr("text-anchor",(function(){return A})).attr("class",(function(e){return e})).attr("x",null).attr("y",null).attr("dx",null).attr("dy",null),D.exit().remove();var z,R=h.mode+h.align;h._hasDelta&&(z=function(){var t=w(e,{tickformat:h.delta.valueformat},h._range);t.setScale(),d.prepTicks(t);var a=function(e){return d.tickText(t,e).text},i=function(e){return h.delta.relative?e.relativeDelta:e.delta},o=function(e,t){return 0===e||"number"!=typeof e||isNaN(e)?"-":(e>0?h.delta.increasing.symbol:h.delta.decreasing.symbol)+t(e)},l=function(e){return e.delta>=0?h.delta.increasing.color:h.delta.decreasing.color};void 0===h._deltaLastValue&&(h._deltaLastValue=i(r[0]));var s=C.select("text.delta");function p(){s.text(o(i(r[0]),a)).call(v.fill,l(r[0])).call(f.convertToTspans,e)}return s.call(c.font,h.delta.font).call(v.fill,l({delta:h._deltaLastValue})),b(L)?s.transition().duration(L.duration).ease(L.easing).tween("text",(function(){var e=n.select(this),t=i(r[0]),s=h._deltaLastValue,c=P(h.delta.valueformat,a,s,t),u=n.interpolateNumber(s,t);return h._deltaLastValue=t,function(t){e.text(o(u(t),c)),e.call(v.fill,l({delta:u(t)}))}})).each("end",(function(){p(),S&&S()})).each("interrupt",(function(){p(),S&&S()})):p(),u=k(o(i(r[0]),a),h.delta.font,A,e),s}(),R+=h.delta.position+h.delta.font.size+h.delta.font.family+h.delta.valueformat,R+=h.delta.increasing.symbol+h.delta.decreasing.symbol,p=u);h._hasNumber&&(!function(){var t=w(e,{tickformat:h.number.valueformat},h._range);t.setScale(),d.prepTicks(t);var a=function(e){return d.tickText(t,e).text},i=h.number.suffix,o=h.number.prefix,l=C.select("text.number");function u(){var t="number"==typeof r[0].y?o+a(r[0].y)+i:"-";l.text(t).call(c.font,h.number.font).call(f.convertToTspans,e)}b(L)?l.transition().duration(L.duration).ease(L.easing).each("end",(function(){u(),S&&S()})).each("interrupt",(function(){u(),S&&S()})).attrTween("text",(function(){var e=n.select(this),t=n.interpolateNumber(r[0].lastY,r[0].y);h._lastValue=r[0].y;var l=P(h.number.valueformat,a,r[0].lastY,r[0].y);return function(r){e.text(o+l(t(r))+i)}})):u(),s=k(o+a(r[0].y)+i,h.number.font,A,e)}(),R+=h.number.font.size+h.number.font.family+h.number.valueformat+h.number.suffix+h.number.prefix,p=s);if(h._hasDelta&&h._hasNumber){var E,I,F=[(s.left+s.right)/2,(s.top+s.bottom)/2],N=[(u.left+u.right)/2,(u.top+u.bottom)/2],H=.75*h.delta.font.size;"left"===h.delta.position&&(E=M(h,"deltaPos",0,-1*(s.width*y[h.align]+u.width*(1-y[h.align])+H),R,Math.min),I=F[1]-N[1],p={width:s.width+u.width+H,height:Math.max(s.height,u.height),left:u.left+E,right:s.right,top:Math.min(s.top,u.top+I),bottom:Math.max(s.bottom,u.bottom+I)}),"right"===h.delta.position&&(E=M(h,"deltaPos",0,s.width*(1-y[h.align])+u.width*y[h.align]+H,R,Math.max),I=F[1]-N[1],p={width:s.width+u.width+H,height:Math.max(s.height,u.height),left:s.left,right:u.right+E,top:Math.min(s.top,u.top+I),bottom:Math.max(s.bottom,u.bottom+I)}),"bottom"===h.delta.position&&(E=null,I=u.height,p={width:Math.max(s.width,u.width),height:s.height+u.height,left:Math.min(s.left,u.left),right:Math.max(s.right,u.right),top:s.bottom-s.height,bottom:s.bottom+u.height}),"top"===h.delta.position&&(E=null,I=s.top,p={width:Math.max(s.width,u.width),height:s.height+u.height,left:Math.min(s.left,u.left),right:Math.max(s.right,u.right),top:s.bottom-s.height-u.height,bottom:s.bottom}),z.attr({dx:E,dy:I})}(h._hasNumber||h._hasDelta)&&C.attr("transform",(function(){var e=l.numbersScaler(p);R+=e[2];var t,r=M(h,"numbersScale",1,e[0],R,Math.min);h._scaleNumbers||(r=1),t=h._isAngular?_-r*p.bottom:_-r*(p.top+p.bottom)/2,h._numbersTop=r*p.top+t;var n=p[T];"center"===T&&(n=(p.left+p.right)/2);var a=g-r*n;return a=M(h,"numbersTranslate",0,a,R,Math.max),o(a,t)+i(r)}))}(e,D,t,{numbersX:p,numbersY:A,numbersScaler:L,transitionOpts:r,onComplete:h}),P&&(S={range:O.gauge.axis.range,color:O.gauge.bgcolor,line:{color:O.gauge.bordercolor,width:0},thickness:1},C={range:O.gauge.axis.range,color:"rgba(0, 0, 0, 0)",line:{color:O.gauge.bordercolor,width:O.gauge.borderwidth},thickness:1});var q=D.selectAll("g.angular").data(z?t:[]);q.exit().remove();var G=D.selectAll("g.angularaxis").data(z?t:[]);G.exit().remove(),z&&function(e,t,r,a){var i,c,u,f,p=r[0].trace,h=a.size,g=a.radius,v=a.innerRadius,m=a.gaugeBg,y=a.gaugeOutline,x=[h.l+h.w/2,h.t+h.h/2+g/2],T=a.gauge,k=a.layer,M=a.transitionOpts,A=a.onComplete,L=Math.PI/2;function S(e){var t=p.gauge.axis.range[0],r=(e-t)/(p.gauge.axis.range[1]-t)*Math.PI-L;return r<-L?-L:r>L?L:r}function C(e){return n.svg.arc().innerRadius((v+g)/2-e/2*(g-v)).outerRadius((v+g)/2+e/2*(g-v)).startAngle(-L)}function O(e){e.attr("d",(function(e){return C(e.thickness).startAngle(S(e.range[0])).endAngle(S(e.range[1]))()}))}T.enter().append("g").classed("angular",!0),T.attr("transform",o(x[0],x[1])),k.enter().append("g").classed("angularaxis",!0).classed("crisp",!0),k.selectAll("g.xangularaxistick,path,text").remove(),(i=w(e,p.gauge.axis)).type="linear",i.range=p.gauge.axis.range,i._id="xangularaxis",i.setScale();var D=function(e){return(i.range[0]-e.x)/(i.range[1]-i.range[0])*Math.PI+Math.PI},P={},z=d.makeLabelFns(i,0).labelStandoff;P.xFn=function(e){var t=D(e);return Math.cos(t)*z},P.yFn=function(e){var t=D(e),r=Math.sin(t)>0?.2:1;return-Math.sin(t)*(z+e.fontSize*r)+Math.abs(Math.cos(t))*(e.fontSize*s)},P.anchorFn=function(e){var t=D(e),r=Math.cos(t);return Math.abs(r)<.1?"middle":r>0?"start":"end"},P.heightFn=function(e,t,r){var n=D(e);return-.5*(1+Math.sin(n))*r};var R=function(e){return o(x[0]+g*Math.cos(e),x[1]-g*Math.sin(e))};u=function(e){return R(D(e))};if(c=d.calcTicks(i),f=d.getTickSigns(i)[2],i.visible){f="inside"===i.ticks?-1:1;var E=(i.linewidth||1)/2;d.drawTicks(e,i,{vals:c,layer:k,path:"M"+f*E+",0h"+f*i.ticklen,transFn:function(e){var t=D(e);return R(t)+"rotate("+-l(t)+")"}}),d.drawLabels(e,i,{vals:c,layer:k,transFn:u,labelFns:P})}var I=[m].concat(p.gauge.steps),F=T.selectAll("g.bg-arc").data(I);F.enter().append("g").classed("bg-arc",!0).append("path"),F.select("path").call(O).call(_),F.exit().remove();var N=C(p.gauge.bar.thickness),H=T.selectAll("g.value-arc").data([p.gauge.bar]);H.enter().append("g").classed("value-arc",!0).append("path");var B=H.select("path");b(M)?(B.transition().duration(M.duration).ease(M.easing).each("end",(function(){A&&A()})).each("interrupt",(function(){A&&A()})).attrTween("d",(j=N,V=S(r[0].lastY),U=S(r[0].y),function(){var e=n.interpolate(V,U);return function(t){return j.endAngle(e(t))()}})),p._lastValue=r[0].y):B.attr("d","number"==typeof r[0].y?N.endAngle(S(r[0].y)):"M0,0Z");var j,V,U;B.call(_),H.exit().remove(),I=[];var q=p.gauge.threshold.value;q&&I.push({range:[q,q],color:p.gauge.threshold.color,line:{color:p.gauge.threshold.line.color,width:p.gauge.threshold.line.width},thickness:p.gauge.threshold.thickness});var G=T.selectAll("g.threshold-arc").data(I);G.enter().append("g").classed("threshold-arc",!0).append("path"),G.select("path").call(O).call(_),G.exit().remove();var Z=T.selectAll("g.gauge-outline").data([y]);Z.enter().append("g").classed("gauge-outline",!0).append("path"),Z.select("path").call(O).call(_),Z.exit().remove()}(e,0,t,{radius:H,innerRadius:B,gauge:q,layer:G,size:I,gaugeBg:S,gaugeOutline:C,transitionOpts:r,onComplete:h});var Z=D.selectAll("g.bullet").data(R?t:[]);Z.exit().remove();var Y=D.selectAll("g.bulletaxis").data(R?t:[]);Y.exit().remove(),R&&function(e,t,r,n){var a,i,l,s,c,f=r[0].trace,p=n.gauge,h=n.layer,g=n.gaugeBg,m=n.gaugeOutline,y=n.size,x=f.domain,T=n.transitionOpts,k=n.onComplete;p.enter().append("g").classed("bullet",!0),p.attr("transform",o(y.l,y.t)),h.enter().append("g").classed("bulletaxis",!0).classed("crisp",!0),h.selectAll("g.xbulletaxistick,path,text").remove();var M=y.h,A=f.gauge.bar.thickness*M,L=x.x[0],S=x.x[0]+(x.x[1]-x.x[0])*(f._hasNumber||f._hasDelta?1-u.bulletNumberDomainSize:1);(a=w(e,f.gauge.axis))._id="xbulletaxis",a.domain=[L,S],a.setScale(),i=d.calcTicks(a),l=d.makeTransTickFn(a),s=d.getTickSigns(a)[2],c=y.t+y.h,a.visible&&(d.drawTicks(e,a,{vals:"inside"===a.ticks?d.clipEnds(a,i):i,layer:h,path:d.makeTickPath(a,c,s),transFn:l}),d.drawLabels(e,a,{vals:i,layer:h,transFn:l,labelFns:d.makeLabelFns(a,c)}));function C(e){e.attr("width",(function(e){return Math.max(0,a.c2p(e.range[1])-a.c2p(e.range[0]))})).attr("x",(function(e){return a.c2p(e.range[0])})).attr("y",(function(e){return.5*(1-e.thickness)*M})).attr("height",(function(e){return e.thickness*M}))}var O=[g].concat(f.gauge.steps),D=p.selectAll("g.bg-bullet").data(O);D.enter().append("g").classed("bg-bullet",!0).append("rect"),D.select("rect").call(C).call(_),D.exit().remove();var P=p.selectAll("g.value-bullet").data([f.gauge.bar]);P.enter().append("g").classed("value-bullet",!0).append("rect"),P.select("rect").attr("height",A).attr("y",(M-A)/2).call(_),b(T)?P.select("rect").transition().duration(T.duration).ease(T.easing).each("end",(function(){k&&k()})).each("interrupt",(function(){k&&k()})).attr("width",Math.max(0,a.c2p(Math.min(f.gauge.axis.range[1],r[0].y)))):P.select("rect").attr("width","number"==typeof r[0].y?Math.max(0,a.c2p(Math.min(f.gauge.axis.range[1],r[0].y))):0);P.exit().remove();var z=r.filter((function(){return f.gauge.threshold.value})),R=p.selectAll("g.threshold-bullet").data(z);R.enter().append("g").classed("threshold-bullet",!0).append("line"),R.select("line").attr("x1",a.c2p(f.gauge.threshold.value)).attr("x2",a.c2p(f.gauge.threshold.value)).attr("y1",(1-f.gauge.threshold.thickness)/2*M).attr("y2",(1-(1-f.gauge.threshold.thickness)/2)*M).call(v.stroke,f.gauge.threshold.line.color).style("stroke-width",f.gauge.threshold.line.width),R.exit().remove();var E=p.selectAll("g.gauge-outline").data([m]);E.enter().append("g").classed("gauge-outline",!0).append("rect"),E.select("rect").call(C).call(_),E.exit().remove()}(e,0,t,{gauge:Z,layer:Y,size:I,gaugeBg:S,gaugeOutline:C,transitionOpts:r,onComplete:h});var X=D.selectAll("text.title").data(t);X.exit().remove(),X.enter().append("text").classed("title",!0),X.attr("text-anchor",(function(){return R?m.right:m[O.title.align]})).text(O.title.text).call(c.font,O.title.font).call(f.convertToTspans,e),X.attr("transform",(function(){var e,t=I.l+I.w*y[O.title.align],r=u.titlePadding,n=c.bBox(X.node());if(P){if(z)if(O.gauge.axis.visible)e=c.bBox(G.node()).top-r-n.bottom;else e=I.t+I.h/2-H/2-n.bottom-r;R&&(e=A-(n.top+n.bottom)/2,t=I.l-u.bulletPadding*I.w)}else e=O._numbersTop-r-n.bottom;return o(t,e)}))}))}},{"../../components/color":82,"../../components/drawing":104,"../../constants/alignment":184,"../../lib":210,"../../lib/svg_text_utils":232,"../../plots/cartesian/axes":256,"../../plots/cartesian/axis_defaults":258,"../../plots/cartesian/layout_attributes":270,"../../plots/cartesian/position_defaults":273,"./constants":373,d3:16}],377:[function(e,t,r){"use strict";var n=e("../../lib").extendFlat,a=e("../scatter/attributes"),i=e("../../components/drawing/attributes").dash,o=e("../../components/fx/attributes"),l=e("../../constants/delta.js"),s=l.INCREASING.COLOR,c=l.DECREASING.COLOR,u=a.line;function f(e){return{line:{color:n({},u.color,{dflt:e}),width:u.width,dash:i,editType:"style"},editType:"style"}}t.exports={xperiod:a.xperiod,xperiod0:a.xperiod0,xperiodalignment:a.xperiodalignment,x:{valType:"data_array",editType:"calc+clearAxisTypes"},open:{valType:"data_array",editType:"calc"},high:{valType:"data_array",editType:"calc"},low:{valType:"data_array",editType:"calc"},close:{valType:"data_array",editType:"calc"},line:{width:n({},u.width,{}),dash:n({},i,{}),editType:"style"},increasing:f(s),decreasing:f(c),text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},tickwidth:{valType:"number",min:0,max:.5,dflt:.3,editType:"calc"},hoverlabel:n({},o.hoverlabel,{split:{valType:"boolean",dflt:!1,editType:"style"}})}},{"../../components/drawing/attributes":103,"../../components/fx/attributes":113,"../../constants/delta.js":186,"../../lib":210,"../scatter/attributes":399}],378:[function(e,t,r){"use strict";var n=e("../../lib"),a=n._,i=e("../../plots/cartesian/axes"),o=e("../../plots/cartesian/align_period"),l=e("../../constants/numerical").BADNUM;function s(e,t,r,n){return{o:e,h:t,l:r,c:n}}function c(e,t,r,o,s,c){for(var u=s.makeCalcdata(t,"open"),f=s.makeCalcdata(t,"high"),d=s.makeCalcdata(t,"low"),p=s.makeCalcdata(t,"close"),h=Array.isArray(t.text),g=Array.isArray(t.hovertext),v=!0,m=null,y=!!t.xperiodalignment,x=[],b=0;b<o.length;b++){var _=o[b],w=u[b],T=f[b],k=d[b],M=p[b];if(_!==l&&w!==l&&T!==l&&k!==l&&M!==l){M===w?null!==m&&M!==m&&(v=M>m):v=M>w,m=M;var A=c(w,T,k,M);A.pos=_,A.yc=(w+M)/2,A.i=b,A.dir=v?"increasing":"decreasing",A.x=A.pos,A.y=[k,T],y&&(A.orig_p=r[b]),h&&(A.tx=t.text[b]),g&&(A.htx=t.hovertext[b]),x.push(A)}else x.push({pos:_,empty:!0})}return t._extremes[s._id]=i.findExtremes(s,n.concat(d,f),{padded:!0}),x.length&&(x[0].t={labels:{open:a(e,"open:")+" ",high:a(e,"high:")+" ",low:a(e,"low:")+" ",close:a(e,"close:")+" "}}),x}t.exports={calc:function(e,t){var r=i.getFromId(e,t.xaxis),a=i.getFromId(e,t.yaxis),l=function(e,t,r){var a=r._minDiff;if(!a){var i,l=e._fullData,s=[];for(a=1/0,i=0;i<l.length;i++){var c=l[i];if("ohlc"===c.type&&!0===c.visible&&c.xaxis===t._id){s.push(c);var u=t.makeCalcdata(c,"x");c._origX=u;var f=o(r,t,"x",u);c._xcalc=f;var d=n.distinctVals(f).minDiff;d&&isFinite(d)&&(a=Math.min(a,d))}}for(a===1/0&&(a=1),i=0;i<s.length;i++)s[i]._minDiff=a}return a*r.tickwidth}(e,r,t),u=t._minDiff;t._minDiff=null;var f=t._origX;t._origX=null;var d=t._xcalc;t._xcalc=null;var p=c(e,t,f,d,a,s);return t._extremes[r._id]=i.findExtremes(r,d,{vpad:u/2}),p.length?(n.extendFlat(p[0].t,{wHover:u/2,tickLen:l}),p):[{t:{empty:!0}}]},calcCommon:c}},{"../../constants/numerical":189,"../../lib":210,"../../plots/cartesian/align_period":253,"../../plots/cartesian/axes":256}],379:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./ohlc_defaults"),i=e("../scatter/period_defaults"),o=e("./attributes");function l(e,t,r,n){r(n+".line.color"),r(n+".line.width",t.line.width),r(n+".line.dash",t.line.dash)}t.exports=function(e,t,r,s){function c(r,a){return n.coerce(e,t,o,r,a)}a(e,t,c,s)?(i(e,t,s,c,{x:!0}),c("line.width"),c("line.dash"),l(e,t,c,"increasing"),l(e,t,c,"decreasing"),c("text"),c("hovertext"),c("tickwidth"),s._requestRangeslider[t.xaxis]=!0):t.visible=!1}},{"../../lib":210,"../scatter/period_defaults":419,"./attributes":377,"./ohlc_defaults":382}],380:[function(e,t,r){"use strict";var n=e("../../plots/cartesian/axes"),a=e("../../lib"),i=e("../../components/fx"),o=e("../../components/color"),l=e("../../lib").fillText,s=e("../../constants/delta.js"),c={increasing:s.INCREASING.SYMBOL,decreasing:s.DECREASING.SYMBOL};function u(e,t,r,n){var a,l,s=e.cd,c=e.xa,u=s[0].trace,f=s[0].t,d=u.type,p="ohlc"===d?"l":"min",h="ohlc"===d?"h":"max",g=f.bPos||0,v=f.bdPos||f.tickLen,m=f.wHover,y=Math.min(1,v/Math.abs(c.r2c(c.range[1])-c.r2c(c.range[0])));function x(e){var r=function(e){return e.pos+g-t}(e);return i.inbox(r-m,r+m,a)}function b(e){var t=e[p],n=e[h];return t===n||i.inbox(t-r,n-r,a)}function _(e){return(x(e)+b(e))/2}a=e.maxHoverDistance-y,l=e.maxSpikeDistance-y;var w=i.getDistanceFunction(n,x,b,_);if(i.getClosest(s,w,e),!1===e.index)return null;var T=s[e.index];if(T.empty)return null;var k=u[T.dir],M=k.line.color;return o.opacity(M)&&k.line.width?e.color=M:e.color=k.fillcolor,e.x0=c.c2p(T.pos+g-v,!0),e.x1=c.c2p(T.pos+g+v,!0),e.xLabelVal=void 0!==T.orig_p?T.orig_p:T.pos,e.spikeDistance=_(T)*l/a,e.xSpike=c.c2p(T.pos,!0),e}function f(e,t,r,i){var o=e.cd,l=e.ya,s=o[0].trace,c=o[0].t,f=[],d=u(e,t,r,i);if(!d)return[];var p=o[d.index].hi||s.hoverinfo,h=p.split("+");if(!("all"===p||-1!==h.indexOf("y")))return[];for(var g=["high","open","close","low"],v={},m=0;m<g.length;m++){var y,x=g[m],b=s[x][d.index],_=l.c2p(b,!0);b in v?(y=v[b]).yLabel+="<br>"+c.labels[x]+n.hoverLabelText(l,b):((y=a.extendFlat({},d)).y0=y.y1=_,y.yLabelVal=b,y.yLabel=c.labels[x]+n.hoverLabelText(l,b),y.name="",f.push(y),v[b]=y)}return f}function d(e,t,r,a){var i=e.cd,o=e.ya,s=i[0].trace,f=i[0].t,d=u(e,t,r,a);if(!d)return[];var p=i[d.index],h=d.index=p.i,g=p.dir;function v(e){return f.labels[e]+n.hoverLabelText(o,s[e][h])}var m=p.hi||s.hoverinfo,y=m.split("+"),x="all"===m,b=x||-1!==y.indexOf("y"),_=x||-1!==y.indexOf("text"),w=b?[v("open"),v("high"),v("low"),v("close")+" "+c[g]]:[];return _&&l(p,s,w),d.extraText=w.join("<br>"),d.y0=d.y1=o.c2p(p.yc,!0),[d]}t.exports={hoverPoints:function(e,t,r,n){return e.cd[0].trace.hoverlabel.split?f(e,t,r,n):d(e,t,r,n)},hoverSplit:f,hoverOnPoints:d}},{"../../components/color":82,"../../components/fx":122,"../../constants/delta.js":186,"../../lib":210,"../../plots/cartesian/axes":256}],381:[function(e,t,r){"use strict";t.exports={moduleType:"trace",name:"ohlc",basePlotModule:e("../../plots/cartesian"),categories:["cartesian","svg","showLegend"],meta:{},attributes:e("./attributes"),supplyDefaults:e("./defaults"),calc:e("./calc").calc,plot:e("./plot"),style:e("./style"),hoverPoints:e("./hover").hoverPoints,selectPoints:e("./select")}},{"../../plots/cartesian":269,"./attributes":377,"./calc":378,"./defaults":379,"./hover":380,"./plot":383,"./select":384,"./style":385}],382:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../lib");t.exports=function(e,t,r,i){var o=r("x"),l=r("open"),s=r("high"),c=r("low"),u=r("close");if(r("hoverlabel.split"),n.getComponentMethod("calendars","handleTraceDefaults")(e,t,["x"],i),l&&s&&c&&u){var f=Math.min(l.length,s.length,c.length,u.length);return o&&(f=Math.min(f,a.minRowLength(o))),t._length=f,f}}},{"../../lib":210,"../../registry":298}],383:[function(e,t,r){"use strict";var n=e("d3"),a=e("../../lib");t.exports=function(e,t,r,i){var o=t.yaxis,l=t.xaxis,s=!!l.rangebreaks;a.makeTraceGroups(i,r,"trace ohlc").each((function(e){var t=n.select(this),r=e[0],i=r.t;if(!0!==r.trace.visible||i.empty)t.remove();else{var c=i.tickLen,u=t.selectAll("path").data(a.identity);u.enter().append("path"),u.exit().remove(),u.attr("d",(function(e){if(e.empty)return"M0,0Z";var t=l.c2p(e.pos-c,!0),r=l.c2p(e.pos+c,!0),n=s?(t+r)/2:l.c2p(e.pos,!0);return"M"+t+","+o.c2p(e.o,!0)+"H"+n+"M"+n+","+o.c2p(e.h,!0)+"V"+o.c2p(e.l,!0)+"M"+r+","+o.c2p(e.c,!0)+"H"+n}))}}))}},{"../../lib":210,d3:16}],384:[function(e,t,r){"use strict";t.exports=function(e,t){var r,n=e.cd,a=e.xaxis,i=e.yaxis,o=[],l=n[0].t.bPos||0;if(!1===t)for(r=0;r<n.length;r++)n[r].selected=0;else for(r=0;r<n.length;r++){var s=n[r];t.contains([a.c2p(s.pos+l),i.c2p(s.yc)],null,s.i,e)?(o.push({pointNumber:s.i,x:a.c2d(s.pos),y:i.c2d(s.yc)}),s.selected=1):s.selected=0}return o}},{}],385:[function(e,t,r){"use strict";var n=e("d3"),a=e("../../components/drawing"),i=e("../../components/color");t.exports=function(e,t,r){var o=r||n.select(e).selectAll("g.ohlclayer").selectAll("g.trace");o.style("opacity",(function(e){return e[0].trace.opacity})),o.each((function(e){var t=e[0].trace;n.select(this).selectAll("path").each((function(e){if(!e.empty){var r=t[e.dir].line;n.select(this).style("fill","none").call(i.stroke,r.color).call(a.dashLine,r.dash,r.width).style("opacity",t.selectedpoints&&!e.selected?.3:1)}}))}))}},{"../../components/color":82,"../../components/drawing":104,d3:16}],386:[function(e,t,r){"use strict";var n=e("../../plots/attributes"),a=e("../../plots/domain").attributes,i=e("../../plots/font_attributes"),o=e("../../components/color/attributes"),l=e("../../plots/template_attributes").hovertemplateAttrs,s=e("../../plots/template_attributes").texttemplateAttrs,c=e("../../lib/extend").extendFlat,u=i({editType:"plot",arrayOk:!0,colorEditType:"plot"});t.exports={labels:{valType:"data_array",editType:"calc"},label0:{valType:"number",dflt:0,editType:"calc"},dlabel:{valType:"number",dflt:1,editType:"calc"},values:{valType:"data_array",editType:"calc"},marker:{colors:{valType:"data_array",editType:"calc"},line:{color:{valType:"color",dflt:o.defaultLine,arrayOk:!0,editType:"style"},width:{valType:"number",min:0,dflt:0,arrayOk:!0,editType:"style"},editType:"calc"},editType:"calc"},text:{valType:"data_array",editType:"plot"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"style"},scalegroup:{valType:"string",dflt:"",editType:"calc"},textinfo:{valType:"flaglist",flags:["label","text","value","percent"],extras:["none"],editType:"calc"},hoverinfo:c({},n.hoverinfo,{flags:["label","text","value","percent","name"]}),hovertemplate:l({},{keys:["label","color","value","percent","text"]}),texttemplate:s({editType:"plot"},{keys:["label","color","value","percent","text"]}),textposition:{valType:"enumerated",values:["inside","outside","auto","none"],dflt:"auto",arrayOk:!0,editType:"plot"},textfont:c({},u,{}),insidetextorientation:{valType:"enumerated",values:["horizontal","radial","tangential","auto"],dflt:"auto",editType:"plot"},insidetextfont:c({},u,{}),outsidetextfont:c({},u,{}),automargin:{valType:"boolean",dflt:!1,editType:"plot"},title:{text:{valType:"string",dflt:"",editType:"plot"},font:c({},u,{}),position:{valType:"enumerated",values:["top left","top center","top right","middle center","bottom left","bottom center","bottom right"],editType:"plot"},editType:"plot"},domain:a({name:"pie",trace:!0,editType:"calc"}),hole:{valType:"number",min:0,max:1,dflt:0,editType:"calc"},sort:{valType:"boolean",dflt:!0,editType:"calc"},direction:{valType:"enumerated",values:["clockwise","counterclockwise"],dflt:"counterclockwise",editType:"calc"},rotation:{valType:"number",min:-360,max:360,dflt:0,editType:"calc"},pull:{valType:"number",min:0,max:1,dflt:0,arrayOk:!0,editType:"calc"},_deprecated:{title:{valType:"string",dflt:"",editType:"calc"},titlefont:c({},u,{}),titleposition:{valType:"enumerated",values:["top left","top center","top right","middle center","bottom left","bottom center","bottom right"],editType:"calc"}}}},{"../../components/color/attributes":81,"../../lib/extend":204,"../../plots/attributes":252,"../../plots/domain":283,"../../plots/font_attributes":284,"../../plots/template_attributes":297}],387:[function(e,t,r){"use strict";var n=e("../../plots/plots");r.name="pie",r.plot=function(e,t,a,i){n.plotBasePlot(r.name,e,t,a,i)},r.clean=function(e,t,a,i){n.cleanBasePlot(r.name,e,t,a,i)}},{"../../plots/plots":290}],388:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("tinycolor2"),i=e("../../components/color"),o={};function l(e){return function(t,r){return!!t&&(!!(t=a(t)).isValid()&&(t=i.addOpacity(t,t.getAlpha()),e[r]||(e[r]=t),t))}}function s(e,t){var r,n=JSON.stringify(e),i=t[n];if(!i){for(i=e.slice(),r=0;r<e.length;r++)i.push(a(e[r]).lighten(20).toHexString());for(r=0;r<e.length;r++)i.push(a(e[r]).darken(20).toHexString());t[n]=i}return i}t.exports={calc:function(e,t){var r,a,i=[],o=e._fullLayout,s=o.hiddenlabels||[],c=t.labels,u=t.marker.colors||[],f=t.values,d=t._length,p=t._hasValues&&d;if(t.dlabel)for(c=new Array(d),r=0;r<d;r++)c[r]=String(t.label0+r*t.dlabel);var h={},g=l(o["_"+t.type+"colormap"]),v=0,m=!1;for(r=0;r<d;r++){var y,x,b;if(p){if(y=f[r],!n(y))continue;if((y=+y)<0)continue}else y=1;void 0!==(x=c[r])&&""!==x||(x=r);var _=h[x=String(x)];void 0===_?(h[x]=i.length,(b=-1!==s.indexOf(x))||(v+=y),i.push({v:y,label:x,color:g(u[r],x),i:r,pts:[r],hidden:b})):(m=!0,(a=i[_]).v+=y,a.pts.push(r),a.hidden||(v+=y),!1===a.color&&u[r]&&(a.color=g(u[r],x)))}return("funnelarea"===t.type?m:t.sort)&&i.sort((function(e,t){return t.v-e.v})),i[0]&&(i[0].vTotal=v),i},crossTraceCalc:function(e,t){var r=(t||{}).type;r||(r="pie");var n=e._fullLayout,a=e.calcdata,i=n[r+"colorway"],l=n["_"+r+"colormap"];n["extend"+r+"colors"]&&(i=s(i,o));for(var c=0,u=0;u<a.length;u++){var f=a[u];if(f[0].trace.type===r)for(var d=0;d<f.length;d++){var p=f[d];!1===p.color&&(l[p.label]?p.color=l[p.label]:(l[p.label]=p.color=i[c%i.length],c++))}}},makePullColorFn:l,generateExtendedColors:s}},{"../../components/color":82,"fast-isnumeric":18,tinycolor2:65}],389:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("../../lib"),i=e("./attributes"),o=e("../../plots/domain").defaults,l=e("../bar/defaults").handleText;function s(e,t){var r=Array.isArray(e),i=a.isArrayOrTypedArray(t),o=Math.min(r?e.length:1/0,i?t.length:1/0);if(isFinite(o)||(o=0),o&&i){for(var l,s=0;s<o;s++){var c=t[s];if(n(c)&&c>0){l=!0;break}}l||(o=0)}return{hasLabels:r,hasValues:i,len:o}}t.exports={handleLabelsAndValues:s,supplyDefaults:function(e,t,r,n){function c(r,n){return a.coerce(e,t,i,r,n)}var u=s(c("labels"),c("values")),f=u.len;if(t._hasLabels=u.hasLabels,t._hasValues=u.hasValues,!t._hasLabels&&t._hasValues&&(c("label0"),c("dlabel")),f){t._length=f,c("marker.line.width")&&c("marker.line.color"),c("marker.colors"),c("scalegroup");var d,p=c("text"),h=c("texttemplate");if(h||(d=c("textinfo",Array.isArray(p)?"text+percent":"percent")),c("hovertext"),c("hovertemplate"),h||d&&"none"!==d){var g=c("textposition");l(e,t,n,c,g,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),(Array.isArray(g)||"auto"===g||"outside"===g)&&c("automargin"),("inside"===g||"auto"===g||Array.isArray(g))&&c("insidetextorientation")}o(t,n,c);var v=c("hole");if(c("title.text")){var m=c("title.position",v?"middle center":"top center");v||"middle center"!==m||(t.title.position="top center"),a.coerceFont(c,"title.font",n.font)}c("sort"),c("direction"),c("rotation"),c("pull")}else t.visible=!1}}},{"../../lib":210,"../../plots/domain":283,"../bar/defaults":312,"./attributes":386,"fast-isnumeric":18}],390:[function(e,t,r){"use strict";var n=e("../../components/fx/helpers").appendArrayMultiPointValues;t.exports=function(e,t){var r={curveNumber:t.index,pointNumbers:e.pts,data:t._input,fullData:t,label:e.label,color:e.color,value:e.v,percent:e.percent,text:e.text,v:e.v};return 1===e.pts.length&&(r.pointNumber=r.i=e.pts[0]),n(r,t,e.pts),"funnelarea"===t.type&&(delete r.v,delete r.i),r}},{"../../components/fx/helpers":118}],391:[function(e,t,r){"use strict";var n=e("../../lib");function a(e){return-1!==e.indexOf("e")?e.replace(/[.]?0+e/,"e"):-1!==e.indexOf(".")?e.replace(/[.]?0+$/,""):e}r.formatPiePercent=function(e,t){var r=a((100*e).toPrecision(3));return n.numSeparate(r,t)+"%"},r.formatPieValue=function(e,t){var r=a(e.toPrecision(10));return 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},r.getRotationAngle=function(e){return("auto"===e?0:e)*Math.PI/180}},{"../../lib":210}],392:[function(e,t,r){"use strict";t.exports={attributes:e("./attributes"),supplyDefaults:e("./defaults").supplyDefaults,supplyLayoutDefaults:e("./layout_defaults"),layoutAttributes:e("./layout_attributes"),calc:e("./calc").calc,crossTraceCalc:e("./calc").crossTraceCalc,plot:e("./plot").plot,style:e("./style"),styleOne:e("./style_one"),moduleType:"trace",name:"pie",basePlotModule:e("./base_plot"),categories:["pie-like","pie","showLegend"],meta:{}}},{"./attributes":386,"./base_plot":387,"./calc":388,"./defaults":389,"./layout_attributes":393,"./layout_defaults":394,"./plot":395,"./style":396,"./style_one":397}],393:[function(e,t,r){"use strict";t.exports={hiddenlabels:{valType:"data_array",editType:"calc"},piecolorway:{valType:"colorlist",editType:"calc"},extendpiecolors:{valType:"boolean",dflt:!0,editType:"calc"}}},{}],394:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./layout_attributes");t.exports=function(e,t){function r(r,i){return n.coerce(e,t,a,r,i)}r("hiddenlabels"),r("piecolorway",t.colorway),r("extendpiecolors")}},{"../../lib":210,"./layout_attributes":393}],395:[function(e,t,r){"use strict";var n=e("d3"),a=e("../../plots/plots"),i=e("../../components/fx"),o=e("../../components/color"),l=e("../../components/drawing"),s=e("../../lib"),c=s.strScale,u=s.strTranslate,f=e("../../lib/svg_text_utils"),d=e("../bar/uniform_text"),p=d.recordMinTextSize,h=d.clearMinTextSize,g=e("../bar/constants").TEXTPAD,v=e("./helpers"),m=e("./event_data"),y=e("../../lib").isValidTextValue;function x(e,t,r){var a=r[0],o=a.trace,l=a.cx,c=a.cy;"_hasHoverLabel"in o||(o._hasHoverLabel=!1),"_hasHoverEvent"in o||(o._hasHoverEvent=!1),e.on("mouseover",(function(e){var r=t._fullLayout,u=t._fullData[o.index];if(!t._dragging&&!1!==r.hovermode){var f=u.hoverinfo;if(Array.isArray(f)&&(f=i.castHoverinfo({hoverinfo:[v.castOption(f,e.pts)],_module:o._module},r,0)),"all"===f&&(f="label+text+value+percent+name"),u.hovertemplate||"none"!==f&&"skip"!==f&&f){var d=e.rInscribed||0,p=l+e.pxmid[0]*(1-d),h=c+e.pxmid[1]*(1-d),g=r.separators,y=[];if(f&&-1!==f.indexOf("label")&&y.push(e.label),e.text=v.castOption(u.hovertext||u.text,e.pts),f&&-1!==f.indexOf("text")){var x=e.text;s.isValidTextValue(x)&&y.push(x)}e.value=e.v,e.valueLabel=v.formatPieValue(e.v,g),f&&-1!==f.indexOf("value")&&y.push(e.valueLabel),e.percent=e.v/a.vTotal,e.percentLabel=v.formatPiePercent(e.percent,g),f&&-1!==f.indexOf("percent")&&y.push(e.percentLabel);var b=u.hoverlabel,_=b.font;i.loneHover({trace:o,x0:p-d*a.r,x1:p+d*a.r,y:h,text:y.join("<br>"),name:u.hovertemplate||-1!==f.indexOf("name")?u.name:void 0,idealAlign:e.pxmid[0]<0?"left":"right",color:v.castOption(b.bgcolor,e.pts)||e.color,borderColor:v.castOption(b.bordercolor,e.pts),fontFamily:v.castOption(_.family,e.pts),fontSize:v.castOption(_.size,e.pts),fontColor:v.castOption(_.color,e.pts),nameLength:v.castOption(b.namelength,e.pts),textAlign:v.castOption(b.align,e.pts),hovertemplate:v.castOption(u.hovertemplate,e.pts),hovertemplateLabels:e,eventData:[m(e,u)]},{container:r._hoverlayer.node(),outerContainer:r._paper.node(),gd:t}),o._hasHoverLabel=!0}o._hasHoverEvent=!0,t.emit("plotly_hover",{points:[m(e,u)],event:n.event})}})),e.on("mouseout",(function(e){var r=t._fullLayout,a=t._fullData[o.index],l=n.select(this).datum();o._hasHoverEvent&&(e.originalEvent=n.event,t.emit("plotly_unhover",{points:[m(l,a)],event:n.event}),o._hasHoverEvent=!1),o._hasHoverLabel&&(i.loneUnhover(r._hoverlayer.node()),o._hasHoverLabel=!1)})),e.on("click",(function(e){var r=t._fullLayout,a=t._fullData[o.index];t._dragging||!1===r.hovermode||(t._hoverdata=[m(e,a)],i.click(t,n.event))}))}function b(e,t,r){var n=v.castOption(e.insidetextfont.color,t.pts);!n&&e._input.textfont&&(n=v.castOption(e._input.textfont.color,t.pts));var a=v.castOption(e.insidetextfont.family,t.pts)||v.castOption(e.textfont.family,t.pts)||r.family,i=v.castOption(e.insidetextfont.size,t.pts)||v.castOption(e.textfont.size,t.pts)||r.size;return{color:n||o.contrast(t.color),family:a,size:i}}function _(e,t){for(var r,n,a=0;a<e.length;a++)if((n=(r=e[a][0]).trace).title.text){var i=n.title.text;n._meta&&(i=s.templateString(i,n._meta));var o=l.tester.append("text").attr("data-notex",1).text(i).call(l.font,n.title.font).call(f.convertToTspans,t),c=l.bBox(o.node(),!0);r.titleBox={width:c.width,height:c.height},o.remove()}}function w(e,t,r){var n=r.r||t.rpx1,a=t.rInscribed;if(t.startangle===t.stopangle)return{rCenter:1-a,scale:0,rotate:0,textPosAngle:0};var i,o=t.ring,l=1===o&&Math.abs(t.startangle-t.stopangle)===2*Math.PI,s=t.halfangle,c=t.midangle,u=r.trace.insidetextorientation,f="horizontal"===u,d="tangential"===u,p="radial"===u,h="auto"===u,g=[];if(!h){var v,m=function(r,a){if(function(e,t){var r=e.startangle,n=e.stopangle;return r>t&&t>n||r<t&&t<n}(t,r)){var l=Math.abs(r-t.startangle),s=Math.abs(r-t.stopangle),c=l<s?l:s;(i="tan"===a?k(e,n,o,c,0):T(e,n,o,c,Math.PI/2)).textPosAngle=r,g.push(i)}};if(f||d){for(v=4;v>=-4;v-=2)m(Math.PI*v,"tan");for(v=4;v>=-4;v-=2)m(Math.PI*(v+1),"tan")}if(f||p){for(v=4;v>=-4;v-=2)m(Math.PI*(v+1.5),"rad");for(v=4;v>=-4;v-=2)m(Math.PI*(v+.5),"rad")}}if(l||h||f){var y=Math.sqrt(e.width*e.width+e.height*e.height);if((i={scale:a*n*2/y,rCenter:1-a,rotate:0}).textPosAngle=(t.startangle+t.stopangle)/2,i.scale>=1)return i;g.push(i)}(h||p)&&((i=T(e,n,o,s,c)).textPosAngle=(t.startangle+t.stopangle)/2,g.push(i)),(h||d)&&((i=k(e,n,o,s,c)).textPosAngle=(t.startangle+t.stopangle)/2,g.push(i));for(var x=0,b=0,_=0;_<g.length;_++){var w=g[_].scale;if(b<w&&(b=w,x=_),!h&&b>=1)break}return g[x]}function T(e,t,r,n,a){t=Math.max(0,t-2*g);var i=e.width/e.height,o=L(i,n,t,r);return{scale:2*o/e.height,rCenter:M(i,o/t),rotate:A(a)}}function k(e,t,r,n,a){t=Math.max(0,t-2*g);var i=e.height/e.width,o=L(i,n,t,r);return{scale:2*o/e.width,rCenter:M(i,o/t),rotate:A(a+Math.PI/2)}}function M(e,t){return Math.cos(t)-e*t}function A(e){return(180/Math.PI*e+720)%180-90}function L(e,t,r,n){var a=e+1/(2*Math.tan(t));return r*Math.min(1/(Math.sqrt(a*a+.5)+a),n/(Math.sqrt(e*e+n/2)+e))}function S(e,t){return e.v!==t.vTotal||t.trace.hole?Math.min(1/(1+1/Math.sin(e.halfangle)),e.ring/2):1}function C(e,t){var r=t.pxmid[0],n=t.pxmid[1],a=e.width/2,i=e.height/2;return r<0&&(a*=-1),n<0&&(i*=-1),{scale:1,rCenter:1,rotate:0,x:a+Math.abs(i)*(a>0?1:-1)/2,y:i/(1+r*r/(n*n)),outside:!0}}function O(e,t){var r,n,a,i=e.trace,o={x:e.cx,y:e.cy},l={tx:0,ty:0};l.ty+=i.title.font.size,a=P(i),-1!==i.title.position.indexOf("top")?(o.y-=(1+a)*e.r,l.ty-=e.titleBox.height):-1!==i.title.position.indexOf("bottom")&&(o.y+=(1+a)*e.r);var s,c,u=(s=e.r,c=e.trace.aspectratio,s/(void 0===c?1:c)),f=t.w*(i.domain.x[1]-i.domain.x[0])/2;return-1!==i.title.position.indexOf("left")?(f+=u,o.x-=(1+a)*u,l.tx+=e.titleBox.width/2):-1!==i.title.position.indexOf("center")?f*=2:-1!==i.title.position.indexOf("right")&&(f+=u,o.x+=(1+a)*u,l.tx-=e.titleBox.width/2),r=f/e.titleBox.width,n=D(e,t)/e.titleBox.height,{x:o.x,y:o.y,scale:Math.min(r,n),tx:l.tx,ty:l.ty}}function D(e,t){var r=e.trace,n=t.h*(r.domain.y[1]-r.domain.y[0]);return Math.min(e.titleBox.height,n/2)}function P(e){var t,r=e.pull;if(!r)return 0;if(Array.isArray(r))for(r=0,t=0;t<e.pull.length;t++)e.pull[t]>r&&(r=e.pull[t]);return r}function z(e,t){for(var r=[],n=0;n<e.length;n++){var a=e[n][0],i=a.trace,o=i.domain,l=t.w*(o.x[1]-o.x[0]),s=t.h*(o.y[1]-o.y[0]);i.title.text&&"middle center"!==i.title.position&&(s-=D(a,t));var c=l/2,u=s/2;"funnelarea"!==i.type||i.scalegroup||(u/=i.aspectratio),a.r=Math.min(c,u)/(1+P(i)),a.cx=t.l+t.w*(i.domain.x[1]+i.domain.x[0])/2,a.cy=t.t+t.h*(1-i.domain.y[0])-s/2,i.title.text&&-1!==i.title.position.indexOf("bottom")&&(a.cy-=D(a,t)),i.scalegroup&&-1===r.indexOf(i.scalegroup)&&r.push(i.scalegroup)}!function(e,t){for(var r,n,a,i=0;i<t.length;i++){var o=1/0,l=t[i];for(n=0;n<e.length;n++)if(r=e[n][0],(a=r.trace).scalegroup===l){var s;if("pie"===a.type)s=r.r*r.r;else if("funnelarea"===a.type){var c,u;a.aspectratio>1?(c=r.r,u=c/a.aspectratio):(u=r.r,c=u*a.aspectratio),c*=(1+a.baseratio)/2,s=c*u}o=Math.min(o,s/r.vTotal)}for(n=0;n<e.length;n++)if(r=e[n][0],(a=r.trace).scalegroup===l){var f=o*r.vTotal;"funnelarea"===a.type&&(f/=(1+a.baseratio)/2,f/=a.aspectratio),r.r=Math.sqrt(f)}}}(e,r)}function R(e,t){return[e*Math.sin(t),-e*Math.cos(t)]}function E(e,t,r){var n=e._fullLayout,a=r.trace,i=a.texttemplate,o=a.textinfo;if(!i&&o&&"none"!==o){var l,c=o.split("+"),u=function(e){return-1!==c.indexOf(e)},f=u("label"),d=u("text"),p=u("value"),h=u("percent"),g=n.separators;if(l=f?[t.label]:[],d){var m=v.getFirstFilled(a.text,t.pts);y(m)&&l.push(m)}p&&l.push(v.formatPieValue(t.v,g)),h&&l.push(v.formatPiePercent(t.v/r.vTotal,g)),t.text=l.join("<br>")}if(i){var x=s.castOption(a,t.i,"texttemplate");if(x){var b=function(e){return{label:e.label,value:e.v,valueLabel:v.formatPieValue(e.v,n.separators),percent:e.v/r.vTotal,percentLabel:v.formatPiePercent(e.v/r.vTotal,n.separators),color:e.color,text:e.text,customdata:s.castOption(a,e.i,"customdata")}}(t),_=v.getFirstFilled(a.text,t.pts);(y(_)||""===_)&&(b.text=_),t.text=s.texttemplateString(x,b,e._fullLayout._d3locale,b,a._meta||{})}else t.text=""}}function I(e,t){var r=e.rotate*Math.PI/180,n=Math.cos(r),a=Math.sin(r),i=(t.left+t.right)/2,o=(t.top+t.bottom)/2;e.textX=i*n-o*a,e.textY=i*a+o*n,e.noCenter=!0}t.exports={plot:function(e,t){var r=e._fullLayout,i=r._size;h("pie",r),_(t,e),z(t,i);var d=s.makeTraceGroups(r._pielayer,t,"trace").each((function(t){var d=n.select(this),h=t[0],g=h.trace;!function(e){var t,r,n,a=e[0],i=a.r,o=a.trace,l=v.getRotationAngle(o.rotation),s=2*Math.PI/a.vTotal,c="px0",u="px1";if("counterclockwise"===o.direction){for(t=0;t<e.length&&e[t].hidden;t++);if(t===e.length)return;l+=s*e[t].v,s*=-1,c="px1",u="px0"}for(n=R(i,l),t=0;t<e.length;t++)(r=e[t]).hidden||(r[c]=n,r.startangle=l,l+=s*r.v/2,r.pxmid=R(i,l),r.midangle=l,l+=s*r.v/2,n=R(i,l),r.stopangle=l,r[u]=n,r.largeArc=r.v>a.vTotal/2?1:0,r.halfangle=Math.PI*Math.min(r.v/a.vTotal,.5),r.ring=1-o.hole,r.rInscribed=S(r,a))}(t),d.attr("stroke-linejoin","round"),d.each((function(){var m=n.select(this).selectAll("g.slice").data(t);m.enter().append("g").classed("slice",!0),m.exit().remove();var y=[[[],[]],[[],[]]],_=!1;m.each((function(a,i){if(a.hidden)n.select(this).selectAll("path,g").remove();else{a.pointNumber=a.i,a.curveNumber=g.index,y[a.pxmid[1]<0?0:1][a.pxmid[0]<0?0:1].push(a);var o=h.cx,c=h.cy,u=n.select(this),d=u.selectAll("path.surface").data([a]);if(d.enter().append("path").classed("surface",!0).style({"pointer-events":"all"}),u.call(x,e,t),g.pull){var m=+v.castOption(g.pull,a.pts)||0;m>0&&(o+=m*a.pxmid[0],c+=m*a.pxmid[1])}a.cxFinal=o,a.cyFinal=c;var T=g.hole;if(a.v===h.vTotal){var k="M"+(o+a.px0[0])+","+(c+a.px0[1])+O(a.px0,a.pxmid,!0,1)+O(a.pxmid,a.px0,!0,1)+"Z";T?d.attr("d","M"+(o+T*a.px0[0])+","+(c+T*a.px0[1])+O(a.px0,a.pxmid,!1,T)+O(a.pxmid,a.px0,!1,T)+"Z"+k):d.attr("d",k)}else{var M=O(a.px0,a.px1,!0,1);if(T){var A=1-T;d.attr("d","M"+(o+T*a.px1[0])+","+(c+T*a.px1[1])+O(a.px1,a.px0,!1,T)+"l"+A*a.px0[0]+","+A*a.px0[1]+M+"Z")}else d.attr("d","M"+o+","+c+"l"+a.px0[0]+","+a.px0[1]+M+"Z")}E(e,a,h);var L=v.castOption(g.textposition,a.pts),S=u.selectAll("g.slicetext").data(a.text&&"none"!==L?[0]:[]);S.enter().append("g").classed("slicetext",!0),S.exit().remove(),S.each((function(){var u=s.ensureSingle(n.select(this),"text","",(function(e){e.attr("data-notex",1)})),d=s.ensureUniformFontSize(e,"outside"===L?function(e,t,r){var n=v.castOption(e.outsidetextfont.color,t.pts)||v.castOption(e.textfont.color,t.pts)||r.color,a=v.castOption(e.outsidetextfont.family,t.pts)||v.castOption(e.textfont.family,t.pts)||r.family,i=v.castOption(e.outsidetextfont.size,t.pts)||v.castOption(e.textfont.size,t.pts)||r.size;return{color:n,family:a,size:i}}(g,a,r.font):b(g,a,r.font));u.text(a.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(l.font,d).call(f.convertToTspans,e);var m,y=l.bBox(u.node());if("outside"===L)m=C(y,a);else if(m=w(y,a,h),"auto"===L&&m.scale<1){var x=s.ensureUniformFontSize(e,g.outsidetextfont);u.call(l.font,x),m=C(y=l.bBox(u.node()),a)}var T=m.textPosAngle,k=void 0===T?a.pxmid:R(h.r,T);if(m.targetX=o+k[0]*m.rCenter+(m.x||0),m.targetY=c+k[1]*m.rCenter+(m.y||0),I(m,y),m.outside){var M=m.targetY;a.yLabelMin=M-y.height/2,a.yLabelMid=M,a.yLabelMax=M+y.height/2,a.labelExtraX=0,a.labelExtraY=0,_=!0}m.fontSize=d.size,p(g.type,m,r),t[i].transform=m,u.attr("transform",s.getTextTransform(m))}))}function O(e,t,r,n){var i=n*(t[0]-e[0]),o=n*(t[1]-e[1]);return"a"+n*h.r+","+n*h.r+" 0 "+a.largeArc+(r?" 1 ":" 0 ")+i+","+o}}));var T=n.select(this).selectAll("g.titletext").data(g.title.text?[0]:[]);if(T.enter().append("g").classed("titletext",!0),T.exit().remove(),T.each((function(){var t,r=s.ensureSingle(n.select(this),"text","",(function(e){e.attr("data-notex",1)})),a=g.title.text;g._meta&&(a=s.templateString(a,g._meta)),r.text(a).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(l.font,g.title.font).call(f.convertToTspans,e),t="middle center"===g.title.position?function(e){var t=Math.sqrt(e.titleBox.width*e.titleBox.width+e.titleBox.height*e.titleBox.height);return{x:e.cx,y:e.cy,scale:e.trace.hole*e.r*2/t,tx:0,ty:-e.titleBox.height/2+e.trace.title.font.size}}(h):O(h,i),r.attr("transform",u(t.x,t.y)+c(Math.min(1,t.scale))+u(t.tx,t.ty))})),_&&function(e,t){var r,n,a,i,o,l,s,c,u,f,d,p,h;function g(e,t){return e.pxmid[1]-t.pxmid[1]}function m(e,t){return t.pxmid[1]-e.pxmid[1]}function y(e,r){r||(r={});var a,c,u,d,p=r.labelExtraY+(n?r.yLabelMax:r.yLabelMin),h=n?e.yLabelMin:e.yLabelMax,g=n?e.yLabelMax:e.yLabelMin,m=e.cyFinal+o(e.px0[1],e.px1[1]),y=p-h;if(y*s>0&&(e.labelExtraY=y),Array.isArray(t.pull))for(c=0;c<f.length;c++)(u=f[c])===e||(v.castOption(t.pull,e.pts)||0)>=(v.castOption(t.pull,u.pts)||0)||((e.pxmid[1]-u.pxmid[1])*s>0?(y=u.cyFinal+o(u.px0[1],u.px1[1])-h-e.labelExtraY)*s>0&&(e.labelExtraY+=y):(g+e.labelExtraY-m)*s>0&&(a=3*l*Math.abs(c-f.indexOf(e)),(d=u.cxFinal+i(u.px0[0],u.px1[0])+a-(e.cxFinal+e.pxmid[0])-e.labelExtraX)*l>0&&(e.labelExtraX+=d)))}for(n=0;n<2;n++)for(a=n?g:m,o=n?Math.max:Math.min,s=n?1:-1,r=0;r<2;r++){for(i=r?Math.max:Math.min,l=r?1:-1,(c=e[n][r]).sort(a),u=e[1-n][r],f=u.concat(c),p=[],d=0;d<c.length;d++)void 0!==c[d].yLabelMid&&p.push(c[d]);for(h=!1,d=0;n&&d<u.length;d++)if(void 0!==u[d].yLabelMid){h=u[d];break}for(d=0;d<p.length;d++){var x=d&&p[d-1];h&&!d&&(x=h),y(p[d],x)}}}(y,g),function(e,t){e.each((function(e){var r=n.select(this);if(e.labelExtraX||e.labelExtraY){var a=r.select("g.slicetext text");e.transform.targetX+=e.labelExtraX,e.transform.targetY+=e.labelExtraY,a.attr("transform",s.getTextTransform(e.transform));var i=e.cxFinal+e.pxmid[0],l="M"+i+","+(e.cyFinal+e.pxmid[1]),c=(e.yLabelMax-e.yLabelMin)*(e.pxmid[0]<0?-1:1)/4;if(e.labelExtraX){var u=e.labelExtraX*e.pxmid[1]/e.pxmid[0],f=e.yLabelMid+e.labelExtraY-(e.cyFinal+e.pxmid[1]);Math.abs(u)>Math.abs(f)?l+="l"+f*e.pxmid[0]/e.pxmid[1]+","+f+"H"+(i+e.labelExtraX+c):l+="l"+e.labelExtraX+","+u+"v"+(f-u)+"h"+c}else l+="V"+(e.yLabelMid+e.labelExtraY)+"h"+c;s.ensureSingle(r,"path","textline").call(o.stroke,t.outsidetextfont.color).attr({"stroke-width":Math.min(2,t.outsidetextfont.size/8),d:l,fill:"none"})}else r.select("path.textline").remove()}))}(m,g),_&&g.automargin){var k=l.bBox(d.node()),M=g.domain,A=i.w*(M.x[1]-M.x[0]),L=i.h*(M.y[1]-M.y[0]),S=(.5*A-h.r)/i.w,D=(.5*L-h.r)/i.h;a.autoMargin(e,"pie."+g.uid+".automargin",{xl:M.x[0]-S,xr:M.x[1]+S,yb:M.y[0]-D,yt:M.y[1]+D,l:Math.max(h.cx-h.r-k.left,0),r:Math.max(k.right-(h.cx+h.r),0),b:Math.max(k.bottom-(h.cy+h.r),0),t:Math.max(h.cy-h.r-k.top,0),pad:5})}}))}));setTimeout((function(){d.selectAll("tspan").each((function(){var e=n.select(this);e.attr("dy")&&e.attr("dy",e.attr("dy"))}))}),0)},formatSliceLabel:E,transformInsideText:w,determineInsideTextFont:b,positionTitleOutside:O,prerenderTitles:_,layoutAreas:z,attachFxHandlers:x,computeTransform:I}},{"../../components/color":82,"../../components/drawing":104,"../../components/fx":122,"../../lib":210,"../../lib/svg_text_utils":232,"../../plots/plots":290,"../bar/constants":310,"../bar/uniform_text":324,"./event_data":390,"./helpers":391,d3:16}],396:[function(e,t,r){"use strict";var n=e("d3"),a=e("./style_one"),i=e("../bar/uniform_text").resizeText;t.exports=function(e){var t=e._fullLayout._pielayer.selectAll(".trace");i(e,t,"pie"),t.each((function(e){var t=e[0].trace,r=n.select(this);r.style({opacity:t.opacity}),r.selectAll("path.surface").each((function(e){n.select(this).call(a,e,t)}))}))}},{"../bar/uniform_text":324,"./style_one":397,d3:16}],397:[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":82,"./helpers":391}],398:[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":210}],399:[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},xperiod:{valType:"any",dflt:0,editType:"calc"},yperiod:{valType:"any",dflt:0,editType:"calc"},xperiod0:{valType:"any",editType:"calc"},yperiod0:{valType:"any",editType:"calc"},xperiodalignment:{valType:"enumerated",values:["start","middle","end"],dflt:"middle",editType:"calc"},yperiodalignment:{valType:"enumerated",values:["start","middle","end"],dflt:"middle",editType:"calc"},stackgroup:{valType:"string",dflt:"",editType:"calc"},orientation:{valType:"enumerated",values:["v","h"],editType:"calc"},groupnorm:{valType:"enumerated",values:["","fraction","percent"],dflt:"",editType:"calc"},stackgaps:{valType:"enumerated",values:["infer zero","interpolate"],dflt:"infer zero",editType:"calc"},text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},texttemplate:n({},{}),hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"style"},mode:{valType:"flaglist",flags:["lines","markers","text"],extras:["none"],editType:"calc"},hoveron:{valType:"flaglist",flags:["points","fills"],editType:"style"},hovertemplate:a({},{keys: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":89,"../../components/drawing":104,"../../components/drawing/attributes":103,"../../lib/extend":204,"../../plots/font_attributes":284,"../../plots/template_attributes":297,"./constants":403}],400:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("../../lib"),i=e("../../plots/cartesian/axes"),o=e("../../plots/cartesian/align_period"),l=e("../../constants/numerical").BADNUM,s=e("./subtypes"),c=e("./colorscale_calc"),u=e("./arrays_to_calcdata"),f=e("./calc_selection");function d(e,t,r,n,a,o,l){var c=t._length,u=e._fullLayout,f=r._id,d=n._id,p=u._firstScatter[g(t)]===t.uid,h=(v(t,u,r,n)||{}).orientation,m=t.fill;r._minDtick=0,n._minDtick=0;var y={padded:!0},x={padded:!0};l&&(y.ppad=x.ppad=l);var b=c<2||a[0]!==a[c-1]||o[0]!==o[c-1];b&&("tozerox"===m||"tonextx"===m&&(p||"h"===h))?y.tozero=!0:(t.error_y||{}).visible||"tonexty"!==m&&"tozeroy"!==m&&(s.hasMarkers(t)||s.hasText(t))||(y.padded=!1,y.ppad=0),b&&("tozeroy"===m||"tonexty"===m&&(p||"v"===h))?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 p(e,t){if(s.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 l={type:"linear"};i.setConvert(l);for(var c=l.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 h(e,t){var r=g(t),n=e._firstScatter;n[r]||(n[r]=t.uid)}function g(e){var t=e.stackgroup;return e.xaxis+e.yaxis+e.type+(t?"-"+t:"")}function v(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,s,g,m,y,x,b=e._fullLayout,_=i.getFromId(e,t.xaxis||"x"),w=i.getFromId(e,t.yaxis||"y"),T=_.makeCalcdata(t,"x"),k=w.makeCalcdata(t,"y"),M=o(t,_,"x",T),A=o(t,w,"y",k),L=t._length,S=new Array(L),C=t.ids,O=v(t,b,_,w),D=!1;h(b,t);var P,z="x",R="y";O?(a.pushUnique(O.traceIndices,t._expandedIndex),(r="v"===O.orientation)?(R="s",P="x"):(z="s",P="y"),y="interpolate"===O.stackgaps):d(e,t,_,w,M,A,p(t,L));var E=!!t.xperiodalignment,I=!!t.yperiodalignment;for(s=0;s<L;s++){var F=S[s]={},N=n(M[s]),H=n(A[s]);N&&H?(F[z]=M[s],F[R]=A[s],E&&(F.orig_x=T[s]),I&&(F.orig_y=k[s])):O&&(r?N:H)?(F[P]=r?M[s]:A[s],F.gap=!0,y?(F.s=l,D=!0):F.s=0):F[z]=F[R]=l,C&&(F.id=String(C[s]))}if(u(S,t),c(e,t),f(S,t),O){for(s=0;s<S.length;)S[s][P]===l?S.splice(s,1):s++;if(a.sort(S,(function(e,t){return e[P]-t[P]||e.i-t.i})),D){for(s=0;s<S.length-1&&S[s].gap;)s++;for((x=S[s].s)||(x=S[s].s=0),g=0;g<s;g++)S[g].s=x;for(m=S.length-1;m>s&&S[m].gap;)m--;for(x=S[m].s,g=S.length-1;g>m;g--)S[g].s=x;for(;s<m;)if(S[++s].gap){for(g=s+1;S[g].gap;)g++;for(var B=S[s-1][P],j=S[s-1].s,V=(S[g].s-j)/(S[g][P]-B);s<g;)S[s].s=j+(S[s][P]-B)*V,s++}}}return S},calcMarkerSize:p,calcAxisExpansion:d,setFirstScatter:h,getStackOpts:v}},{"../../constants/numerical":189,"../../lib":210,"../../plots/cartesian/align_period":253,"../../plots/cartesian/axes":256,"./arrays_to_calcdata":398,"./calc_selection":401,"./colorscale_calc":402,"./subtypes":424,"fast-isnumeric":18}],401:[function(e,t,r){"use strict";var n=e("../../lib");t.exports=function(e,t){n.isArrayOrTypedArray(t.selectedpoints)&&n.tagSelected(e,t)}},{"../../lib":210}],402:[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":90,"../../components/colorscale/helpers":93,"./subtypes":424}],403:[function(e,t,r){"use strict";t.exports={PTS_LINESONLY:20,minTolerance:.2,toleranceGrowth:10,maxScreensAway:20,eventDataKeys:[]}},{}],404:[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,T=e.calcdata;for(var k in l){var M=(m=l[k]).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=T[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=T[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(T[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=T[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=T[M[s]][c];S[_]/=v,S.sNorm=S.s/v}}for(s=0;s<M.length;s++){var C=(d=T[M[s]])[0].trace,O=n.calcMarkerSize(C,C._rawLength),D=Array.isArray(O);if(O&&w[s]||D){var P=O;for(O=new Array(L),c=0;c<L;c++)O[c]=d[c].gap?0:D?P[d[c].i]:P}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":400}],405:[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}}}}}},{}],406:[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("./period_defaults"),u=e("./stack_defaults"),f=e("./marker_defaults"),d=e("./line_defaults"),p=e("./line_shape_defaults"),h=e("./text_defaults"),g=e("./fillcolor_defaults");t.exports=function(e,t,r,v){function m(r,a){return n.coerce(e,t,i,r,a)}var y=s(e,t,v,m);if(y||(t.visible=!1),t.visible){c(e,t,v,m);var x=u(e,t,v,m),b=!x&&y<o.PTS_LINESONLY?"lines+markers":"lines";m("text"),m("hovertext"),m("mode",b),l.hasLines(t)&&(d(e,t,r,v,m),p(e,t,m),m("connectgaps"),m("line.simplify")),l.hasMarkers(t)&&f(e,t,r,v,m,{gradient:!0}),l.hasText(t)&&(m("texttemplate"),h(e,t,v,m));var _=[];(l.hasMarkers(t)||l.hasText(t))&&(m("cliponaxis"),m("marker.maxdisplayed"),_.push("points")),m("fill",x?x.fillDflt:"none"),"none"!==t.fill&&(g(e,t,r,m),l.hasLines(t)||p(e,t,m));var w=(t.line||{}).color,T=(t.marker||{}).color;"tonext"!==t.fill&&"toself"!==t.fill||_.push("fills"),m("hoveron",_.join("+")||"points"),"fills"!==t.hoveron&&m("hovertemplate");var k=a.getComponentMethod("errorbars","supplyDefaults");k(e,t,w||T||r,{axis:"y"}),k(e,t,w||T||r,{axis:"x",inherit:"y"}),n.coerceSelectionMarkerOpacity(t,m)}}},{"../../lib":210,"../../registry":298,"./attributes":399,"./constants":403,"./fillcolor_defaults":407,"./line_defaults":412,"./line_shape_defaults":414,"./marker_defaults":418,"./period_defaults":419,"./stack_defaults":422,"./subtypes":424,"./text_defaults":425,"./xy_defaults":426}],407:[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":82,"../../lib":210}],408:[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":256}],409:[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":82,"./subtypes":424}],410:[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),T=p.c2p(_.y,!0),k=_.mrc||1;e.index=_.i;var M=u[0].t.orientation,A=M&&(_.sNorm||_.s),L="h"===M?A:void 0!==_.orig_x?_.orig_x:_.x,S="v"===M?A:void 0!==_.orig_y?_.orig_y:_.y;return n.extendFlat(e,{color:o(f,_),x0:w-k,x1:w+k,xLabelVal:L,y0:T-k,y1:T+k,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,D,P,z,R,E,I,F,N=f._polygons,H=[],B=!1,j=1/0,V=-1/0,U=1/0,q=-1/0;for(C=0;C<N.length;C++)(D=N[C]).contains(v)&&(B=!B,H.push(D),U=Math.min(U,D.ymin),q=Math.max(q,D.ymax));if(B){var G=((U=Math.max(U,0))+(q=Math.min(q,p._length)))/2;for(C=0;C<H.length;C++)for(P=H[C].pts,O=1;O<P.length;O++)(I=P[O-1][1])>G!=(F=P[O][1])>=G&&(R=P[O-1][0],E=P[O][0],F-I&&(z=R+(E-R)*(G-I)/(F-I),j=Math.min(j,z),V=Math.max(V,z)));j=Math.max(j,0),V=Math.min(V,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:j,x1:V,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":82,"../../components/fx":122,"../../lib":210,"../../registry":298,"./get_trace_color":409}],411:[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":269,"./arrays_to_calcdata":398,"./attributes":399,"./calc":400,"./cross_trace_calc":404,"./cross_trace_defaults":405,"./defaults":406,"./format_labels":408,"./hover":410,"./marker_colorbar":417,"./plot":420,"./select":421,"./style":423,"./subtypes":424}],412:[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":92,"../../components/colorscale/helpers":93,"../../lib":210}],413:[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,T,k,M,A,L=t.xaxis,S=t.yaxis,C="log"===L.type,O="log"===S.type,D=L._length,P=S._length,z=t.connectGaps,R=t.baseTolerance,E=t.shape,I="linear"===E,F=t.fill&&"none"!==t.fill,N=[],H=f.minTolerance,B=e.length,j=new Array(B),V=0;function U(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*P*(L._m>0?o:l)/(S._m*D*(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 q(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]/D,n=e[1]/P,a=Math.max(0,-r,r-1,-n,n-1);return a&&void 0!==M&&q(r,n,M,A)&&(a=0),a&&t&&q(r,n,t[0]/D,t[1]/P)&&(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,Q,J,$,K,ee=f.maxScreensAway,te=-D*ee,re=D*(1+ee),ne=-P*ee,ae=P*(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===j[V-1][0],a=r===j[V-1][1];if(!n||!a)if(V>1){var i=t===j[V-2][0],o=r===j[V-2][1];n&&(t===te||t===re)&&i?o?V--:j[V-1]=e:a&&(r===ne||r===ae)&&o?i?V--:j[V-1]=e:j[V++]=e}else j[V++]=e}function ue(e){j[V-1][0]!==e[0]&&j[V-1][1]!==e[1]&&ce([W,Q]),ce(e),J=null,W=Q=0}function fe(e){if(M=e[0]/D,A=e[1]/P,Y=e[0]<te?te:e[0]>re?re:0,X=e[1]<ne?ne:e[1]>ae?ae:0,Y||X){if(V)if(J){var t=K(J,e);t.length>1&&(ue(t[0]),j[V++]=t[1])}else $=K(j[V-1],e)[0],j[V++]=$;else j[V++]=[Y||e[0],X||e[1]];var r=j[V-1];Y&&X&&(r[0]!==Y||r[1]!==X)?(J&&(W!==Y&&Q!==X?ce(W&&Q?(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,Q||X]):W&&Q&&ce([W,Q])),ce([Y,X])):W-Y&&Q-X&&ce([Y||W,X||Q]),J=e,W=Y,Q=X}else J&&ue(K(J,e)[0]),j[V++]=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)||(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=U(r)){for(V=0,J=null,fe(n),r++;r<B;r++){if(!(d=U(r))){if(z)continue;break}if(I&&t.simplify){var de=U(r+1);if(y=Z(d,n),F&&(0===V||V===B-1)||!(y<G(d,de)*H)){for(v=[(d[0]-n[0])/y,(d[1]-n[1])/y],p=n,x=y,b=w=T=0,g=!1,i=d,r++;r<e.length;r++){if(h=de,de=U(r+1),!h){if(z)continue;break}if(k=(m=[h[0]-n[0],h[1]-n[1]])[0]*v[1]-m[1]*v[0],w=Math.min(w,k),(T=Math.max(T,k))-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],Q||J[1]]),N.push(j.slice(0,V))}return N}},{"../../constants/numerical":189,"../../lib":210,"./constants":403}],414:[function(e,t,r){"use strict";t.exports=function(e,t,r){"spline"===r("line.shape")&&r("line.smoothing")}},{}],415:[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}},{}],416:[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":18}],417:[function(e,t,r){"use strict";t.exports={container:"marker",min:"cmin",max:"cmax"}},{}],418:[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":82,"../../components/colorscale/defaults":92,"../../components/colorscale/helpers":93,"./subtypes":424}],419:[function(e,t,r){"use strict";var n=e("../../lib").dateTick0,a=e("../../constants/numerical").ONEWEEK;function i(e,t){return n(t,e%a==0?1:0)}t.exports=function(e,t,r,n,a){if(a||(a={x:!0,y:!0}),a.x){var o=n("xperiod");o&&(n("xperiod0",i(o,t.xcalendar)),n("xperiodalignment"))}if(a.y){var l=n("yperiod");l&&(n("yperiod0",i(l,t.ycalendar)),n("yperiodalignment"))}}},{"../../constants/numerical":189,"../../lib":210}],420:[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,T=n.select(h),k=o(T,"g","errorbars"),M=o(T,"g","lines"),A=o(T,"g","points"),L=o(T,"g","text");if(a.getComponentMethod("errorbars","plot")(e,k,r,g),!0===_.visible){var S,C;y(T).style("opacity",_.opacity);var O=_.fill.charAt(_.fill.length-1);"x"!==O&&"y"!==O&&(O=""),f[0][r.isRangePlot?"nodeRangePlot3":"node3"]=T;var D,P,z="",R=[],E=_._prevtrace;E&&(z=E._prevRevpath||"",C=E._nextFill,R=E._polygons);var I,F,N,H,B,j,V,U="",q="",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}),V=_._polygons=new Array(G.length),v=0;v<G.length;v++)_._polygons[v]=d(G[v]);G.length&&(H=G[0][0],j=(B=G[G.length-1])[B.length-1]),Z=function(e){return function(t){if(D=I(t),P=N(t),U?O?(U+="L"+D.substr(1),q=P+"L"+q.substr(1)):(U+="Z"+D,q=P+"Z"+q):(U=D,q=P),c.hasLines(_)&&t.length>1){var r=n.select(this);if(r.datum(f),e)y(r.style("opacity",0).attr("d",D).call(s.lineGroupStyle)).style("opacity",1);else{var a=y(r);a.attr("d",D),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),H&&j&&(O?("y"===O?H[1]=j[1]=b.c2p(0,!0):"x"===O&&(H[0]=j[0]=x.c2p(0,!0)),y(S).attr("d","M"+j+"L"+H+"L"+U.substr(1)).call(s.singleFillStyle)):y(S).attr("d",U+"Z").call(s.singleFillStyle))):C&&("tonext"===_.fill.substr(0,6)&&U&&z?("tonext"===_.fill?y(C).attr("d",U+"Z"+z+"Z").call(s.singleFillStyle):y(C).attr("d",U+"L"+z.substr(1)+"Z").call(s.singleFillStyle),_._polygons=_._polygons.concat(R)):(W(C),_._polygons=null)),_._prevRevpath=q,_._prevPolygons=V):(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:Q:_&&!w&&(v=$),f&&(h=v),d&&(g=v)}var T,k=(o=t.selectAll("path.point").data(h,p)).enter().append("path").classed("point",!0);m&&k.call(s.pointStyle,u,e).call(s.translatePoints,x,b).style("opacity",0).transition().style("opacity",1),o.order(),f&&(T=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,T,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 Q(e){return e.filter((function(e){return!e.gap&&e.vis}))}function J(e){return e.filter((function(e){return e.vis}))}function $(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":104,"../../lib":210,"../../lib/polygon":222,"../../registry":298,"./line_points":413,"./link_traces":415,"./subtypes":424,d3:16}],421:[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":424}],422:[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}}},{}],423:[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":104,"../../registry":298,d3:16}],424:[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":210}],425:[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":210}],426:[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":210,"../../registry":298}],427:[function(e,t,r){"use strict";var n=e("../bar/attributes"),a=e("../scatter/attributes").line,i=e("../../plots/attributes"),o=e("../../plots/template_attributes").hovertemplateAttrs,l=e("../../plots/template_attributes").texttemplateAttrs,s=e("./constants"),c=e("../../lib/extend").extendFlat,u=e("../../components/color");function f(e){return{marker:{color:c({},n.marker.color,{arrayOk:!1,editType:"style"}),line:{color:c({},n.marker.line.color,{arrayOk:!1,editType:"style"}),width:c({},n.marker.line.width,{arrayOk:!1,editType:"style"}),editType:"style"},editType:"style"},editType:"style"}}t.exports={measure:{valType:"data_array",dflt:[],editType:"calc"},base:{valType:"number",dflt:null,arrayOk:!1,editType:"calc"},x:n.x,x0:n.x0,dx:n.dx,y:n.y,y0:n.y0,dy:n.dy,xperiod:n.xperiod,yperiod:n.yperiod,xperiod0:n.xperiod0,yperiod0:n.yperiod0,xperiodalignment:n.xperiodalignment,yperiodalignment:n.yperiodalignment,hovertext:n.hovertext,hovertemplate:o({},{keys:s.eventDataKeys}),hoverinfo:c({},i.hoverinfo,{flags:["name","x","y","text","initial","delta","final"]}),textinfo:{valType:"flaglist",flags:["label","text","initial","delta","final"],extras:["none"],editType:"plot",arrayOk:!1},texttemplate:l({editType:"plot"},{keys:s.eventDataKeys.concat(["label"])}),text:n.text,textposition:n.textposition,insidetextanchor:n.insidetextanchor,textangle:n.textangle,textfont:n.textfont,insidetextfont:n.insidetextfont,outsidetextfont:n.outsidetextfont,constraintext:n.constraintext,cliponaxis:n.cliponaxis,orientation:n.orientation,offset:n.offset,width:n.width,increasing:f(),decreasing:f(),totals:f(),connector:{line:{color:c({},a.color,{dflt:u.defaultLine}),width:c({},a.width,{editType:"plot"}),dash:a.dash,editType:"plot"},mode:{valType:"enumerated",values:["spanning","between"],dflt:"between",editType:"plot"},visible:{valType:"boolean",dflt:!0,editType:"plot"},editType:"plot"},offsetgroup:n.offsetgroup,alignmentgroup:n.alignmentgroup}},{"../../components/color":82,"../../lib/extend":204,"../../plots/attributes":252,"../../plots/template_attributes":297,"../bar/attributes":308,"../scatter/attributes":399,"./constants":429}],428:[function(e,t,r){"use strict";var n=e("../../plots/cartesian/axes"),a=e("../../plots/cartesian/align_period"),i=e("../../lib").mergeArray,o=e("../scatter/calc_selection"),l=e("../../constants/numerical").BADNUM;function s(e){return"a"===e||"absolute"===e}function c(e){return"t"===e||"total"===e}t.exports=function(e,t){var r,u,f,d,p=n.getFromId(e,t.xaxis||"x"),h=n.getFromId(e,t.yaxis||"y");"h"===t.orientation?(r=p.makeCalcdata(t,"x"),f=h.makeCalcdata(t,"y"),u=a(t,h,"y",f),d=!!t.yperiodalignment):(r=h.makeCalcdata(t,"y"),f=p.makeCalcdata(t,"x"),u=a(t,p,"x",f),d=!!t.xperiodalignment);for(var g,v=Math.min(u.length,r.length),m=new Array(v),y=0,x=!1,b=0;b<v;b++){var _=r[b]||0,w=!1;(r[b]!==l||c(t.measure[b])||s(t.measure[b]))&&b+1<v&&(r[b+1]!==l||c(t.measure[b+1])||s(t.measure[b+1]))&&(w=!0);var T=m[b]={i:b,p:u[b],s:_,rawS:_,cNext:w};s(t.measure[b])?(y=T.s,T.isSum=!0,T.dir="totals",T.s=y):c(t.measure[b])?(T.isSum=!0,T.dir="totals",T.s=y):(T.isSum=!1,T.dir=T.rawS<0?"decreasing":"increasing",g=T.s,T.s=y+g,y+=g),"totals"===T.dir&&(x=!0),d&&(m[b].orig_p=f[b]),t.ids&&(T.id=String(t.ids[b])),T.v=(t.base||0)+y}return m.length&&(m[0].hasTotals=x),i(t.text,m,"tx"),i(t.hovertext,m,"htx"),o(m,t),m}},{"../../constants/numerical":189,"../../lib":210,"../../plots/cartesian/align_period":253,"../../plots/cartesian/axes":256,"../scatter/calc_selection":401}],429:[function(e,t,r){"use strict";t.exports={eventDataKeys:["initial","delta","final"]}},{}],430:[function(e,t,r){"use strict";var n=e("../bar/cross_trace_calc").setGroupPositions;t.exports=function(e,t){var r,a,i=e._fullLayout,o=e._fullData,l=e.calcdata,s=t.xaxis,c=t.yaxis,u=[],f=[],d=[];for(a=0;a<o.length;a++){var p=o[a];!0===p.visible&&p.xaxis===s._id&&p.yaxis===c._id&&"waterfall"===p.type&&(r=l[a],"h"===p.orientation?d.push(r):f.push(r),u.push(r))}var h={mode:i.waterfallmode,norm:i.waterfallnorm,gap:i.waterfallgap,groupgap:i.waterfallgroupgap};for(n(e,s,c,f,h),n(e,c,s,d,h),a=0;a<u.length;a++){r=u[a];for(var g=0;g<r.length;g++){var v=r[g];!1===v.isSum&&(v.s0+=0===g?0:r[g-1].s),g+1<r.length&&(r[g].nextP0=r[g+1].p0,r[g].nextS0=r[g+1].s0)}}}},{"../bar/cross_trace_calc":311}],431:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../bar/defaults").handleGroupingDefaults,i=e("../bar/defaults").handleText,o=e("../scatter/xy_defaults"),l=e("../scatter/period_defaults"),s=e("./attributes"),c=e("../../components/color"),u=e("../../constants/delta.js"),f=u.INCREASING.COLOR,d=u.DECREASING.COLOR;function p(e,t,r){e(t+".marker.color",r),e(t+".marker.line.color",c.defaultLine),e(t+".marker.line.width")}t.exports={supplyDefaults:function(e,t,r,a){function c(r,a){return n.coerce(e,t,s,r,a)}if(o(e,t,a,c)){l(e,t,a,c),c("measure"),c("orientation",t.x&&!t.y?"h":"v"),c("base"),c("offset"),c("width"),c("text"),c("hovertext"),c("hovertemplate");var u=c("textposition");if(i(e,t,a,c,u,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!0,moduleHasCliponaxis:!0,moduleHasTextangle:!0,moduleHasInsideanchor:!0}),"none"!==t.textposition&&(c("texttemplate"),t.texttemplate||c("textinfo")),p(c,"increasing",f),p(c,"decreasing",d),p(c,"totals","#4499FF"),c("connector.visible"))c("connector.mode"),c("connector.line.width")&&(c("connector.line.color"),c("connector.line.dash"))}else t.visible=!1},crossTraceDefaults:function(e,t){var r,i;function o(e){return n.coerce(i._input,i,s,e)}if("group"===t.waterfallmode)for(var l=0;l<e.length;l++)r=(i=e[l])._input,a(r,i,t,o)}}},{"../../components/color":82,"../../constants/delta.js":186,"../../lib":210,"../bar/defaults":312,"../scatter/period_defaults":419,"../scatter/xy_defaults":426,"./attributes":427}],432:[function(e,t,r){"use strict";t.exports=function(e,t){return e.x="xVal"in t?t.xVal:t.x,e.y="yVal"in t?t.yVal:t.y,"initial"in t&&(e.initial=t.initial),"delta"in t&&(e.delta=t.delta),"final"in t&&(e.final=t.final),t.xa&&(e.xaxis=t.xa),t.ya&&(e.yaxis=t.ya),e}},{}],433:[function(e,t,r){"use strict";var n=e("../../plots/cartesian/axes").hoverLabelText,a=e("../../components/color").opacity,i=e("../bar/hover").hoverOnBars,o=e("../../constants/delta.js"),l=o.INCREASING.SYMBOL,s=o.DECREASING.SYMBOL;t.exports=function(e,t,r,o){var c=i(e,t,r,o);if(c){var u=c.cd,f=u[0].trace,d="h"===f.orientation,p=d?e.xa:e.ya,h=u[c.index],g=h.isSum?h.b+h.s:h.rawS;if(!h.isSum){c.initial=h.b+h.s-g,c.delta=g,c.final=c.initial+c.delta;var v=w(Math.abs(c.delta));c.deltaLabel=g<0?"("+v+")":v,c.finalLabel=w(c.final),c.initialLabel=w(c.initial)}var m=h.hi||f.hoverinfo,y=[];if(m&&"none"!==m&&"skip"!==m){var x="all"===m,b=m.split("+"),_=function(e){return x||-1!==b.indexOf(e)};h.isSum||(!_("final")||_(d?"x":"y")||y.push(c.finalLabel),_("delta")&&(g<0?y.push(c.deltaLabel+" "+s):y.push(c.deltaLabel+" "+l)),_("initial")&&y.push("Initial: "+c.initialLabel))}return y.length&&(c.extraText=y.join("<br>")),c.color=function(e,t){var r=e[t.dir].marker,n=r.color,i=r.line.color,o=r.line.width;if(a(n))return n;if(a(i)&&o)return i}(f,h),[c]}function w(e){return n(p,e)}}},{"../../components/color":82,"../../constants/delta.js":186,"../../plots/cartesian/axes":256,"../bar/hover":315}],434:[function(e,t,r){"use strict";t.exports={attributes:e("./attributes"),layoutAttributes:e("./layout_attributes"),supplyDefaults:e("./defaults").supplyDefaults,crossTraceDefaults:e("./defaults").crossTraceDefaults,supplyLayoutDefaults:e("./layout_defaults"),calc:e("./calc"),crossTraceCalc:e("./cross_trace_calc"),plot:e("./plot"),style:e("./style").style,hoverPoints:e("./hover"),eventData:e("./event_data"),selectPoints:e("../bar/select"),moduleType:"trace",name:"waterfall",basePlotModule:e("../../plots/cartesian"),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}},{"../../plots/cartesian":269,"../bar/select":320,"./attributes":427,"./calc":428,"./cross_trace_calc":430,"./defaults":431,"./event_data":432,"./hover":433,"./layout_attributes":435,"./layout_defaults":436,"./plot":437,"./style":438}],435:[function(e,t,r){"use strict";t.exports={waterfallmode:{valType:"enumerated",values:["group","overlay"],dflt:"group",editType:"calc"},waterfallgap:{valType:"number",min:0,max:1,editType:"calc"},waterfallgroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"}}},{}],436:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./layout_attributes");t.exports=function(e,t,r){var i=!1;function o(r,i){return n.coerce(e,t,a,r,i)}for(var l=0;l<r.length;l++){var s=r[l];if(s.visible&&"waterfall"===s.type){i=!0;break}}i&&(o("waterfallmode"),o("waterfallgap",.2),o("waterfallgroupgap"))}},{"../../lib":210,"./layout_attributes":435}],437:[function(e,t,r){"use strict";var n=e("d3"),a=e("../../lib"),i=e("../../components/drawing"),o=e("../../constants/numerical").BADNUM,l=e("../bar/plot"),s=e("../bar/uniform_text").clearMinTextSize;t.exports=function(e,t,r,c){var u=e._fullLayout;s("waterfall",u),l.plot(e,t,r,c,{mode:u.waterfallmode,norm:u.waterfallmode,gap:u.waterfallgap,groupgap:u.waterfallgroupgap}),function(e,t,r,l){var s=t.xaxis,c=t.yaxis;a.makeTraceGroups(l,r,"trace bars").each((function(r){var l=n.select(this),u=r[0].trace,f=a.ensureSingle(l,"g","lines");if(u.connector&&u.connector.visible){var d="h"===u.orientation,p=u.connector.mode,h=f.selectAll("g.line").data(a.identity);h.enter().append("g").classed("line",!0),h.exit().remove();var g=h.size();h.each((function(r,l){if(l===g-1||r.cNext){var u=function(e,t,r,n){var a=[],i=[],o=n?t:r,l=n?r:t;return a[0]=o.c2p(e.s0,!0),i[0]=l.c2p(e.p0,!0),a[1]=o.c2p(e.s1,!0),i[1]=l.c2p(e.p1,!0),a[2]=o.c2p(e.nextS0,!0),i[2]=l.c2p(e.nextP0,!0),n?[a,i]:[i,a]}(r,s,c,d),f=u[0],h=u[1],v="";f[0]!==o&&h[0]!==o&&f[1]!==o&&h[1]!==o&&("spanning"===p&&!r.isSum&&l>0&&(v+=d?"M"+f[0]+","+h[1]+"V"+h[0]:"M"+f[1]+","+h[0]+"H"+f[0]),"between"!==p&&(r.isSum||l<g-1)&&(v+=d?"M"+f[1]+","+h[0]+"V"+h[1]:"M"+f[0]+","+h[1]+"H"+f[1]),f[2]!==o&&h[2]!==o&&(v+=d?"M"+f[1]+","+h[1]+"V"+h[2]:"M"+f[1]+","+h[1]+"H"+f[2])),""===v&&(v="M0,0Z"),a.ensureSingle(n.select(this),"path").attr("d",v).call(i.setClipUrl,t.layerClipId,e)}}))}else f.remove()}))}(e,t,r,c)}},{"../../components/drawing":104,"../../constants/numerical":189,"../../lib":210,"../bar/plot":319,"../bar/uniform_text":324,d3:16}],438:[function(e,t,r){"use strict";var n=e("d3"),a=e("../../components/drawing"),i=e("../../components/color"),o=e("../../constants/interactions").DESELECTDIM,l=e("../bar/style"),s=e("../bar/uniform_text").resizeText,c=l.styleTextPoints;t.exports={style:function(e,t,r){var l=r||n.select(e).selectAll("g.waterfalllayer").selectAll("g.trace");s(e,l,"waterfall"),l.style("opacity",(function(e){return e[0].trace.opacity})),l.each((function(t){var r=n.select(this),l=t[0].trace;r.selectAll(".point > path").each((function(e){if(!e.isBlank){var t=l[e.dir].marker;n.select(this).call(i.fill,t.color).call(i.stroke,t.line.color).call(a.dashLine,t.line.dash,t.line.width).style("opacity",l.selectedpoints&&!e.selected?o:1)}})),c(r,l,e),r.selectAll(".lines").each((function(){var e=l.connector.line;a.lineGroupStyle(n.select(this).selectAll("path"),e.width,e.color,e.dash)}))}))}}},{"../../components/color":82,"../../components/drawing":104,"../../constants/interactions":188,"../bar/style":322,"../bar/uniform_text":324,d3:16}],439:[function(e,t,r){"use strict";r.version="1.58.4"},{}]},{},[8])(8)}));