Template:Vilnius-Lithuania/JSvendor2

/**

  • plotly.js (basic - minified) v1.31.2
  • Copyright 2012-2017, Plotly, Inc.
  • All rights reserved.
  • Licensed under the MIT license
  • /

!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.Plotly=t()}}(function(){var t;return function t(e,r,n){function a(o,l){if(!r[o]){if(!e[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:{}};e[o][0].call(u.exports,function(t){var r=e[o][1][t];return a(r||t)},u,u.exports,t,e,r,n)}return r[o].exports}for(var i="function"==typeof require&&require,o=0;o<n.length;o++)a(n[o]);return a}({1:[function(t,e,r){"use strict";var n=t("../src/lib"),a={"X,X div":"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 .modebar":"position:absolute;top:2px;right:2px;z-index:1001;background:rgba(255,255,255,0.7);","X .modebar--hover":"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":"opacity:1;","X .modebar-group":"float:left;display:inline-block;box-sizing:border-box;margin-left:8px;position:relative;vertical-align:middle;white-space:nowrap;","X .modebar-group:first-child":"margin-left:0px;","X .modebar-btn":"position:relative;font-size:16px;padding:3px 4px;cursor:pointer;line-height:normal;box-sizing:border-box;","X .modebar-btn svg":"position:relative;top:2px;","X .modebar-btn path":"fill:rgba(0,31,95,0.3);","X .modebar-btn.active path,X .modebar-btn:hover path":"fill:rgba(0,22,72,0.5);","X .modebar-btn.modebar-btn--logo":"padding:3px 1px;","X .modebar-btn.modebar-btn--logo path":"fill:#447adb !important;","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 .select-outline":"fill:none;stroke-width:1;shape-rendering:crispEdges;","X .select-outline-1":"stroke:white;","X .select-outline-2":"stroke:black;stroke-dasharray:2px 2px;",Y:"font-family:'Open Sans';position:fixed;top:50px;right:20px;z-index:10000;font-size:10pt;max-width:180px;","Y p":"margin:0;","Y .notifier-note":"min-width:180px;max-width:250px;border:1px solid #fff;z-index:3000;margin:0;background-color:#8c97af;background-color:rgba(140,151,175,0.9);color:#fff;padding:10px;","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":149}],2:[function(t,e,r){"use strict";e.exports={undo:{width:857.1,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",ascent:850,descent:-150},home:{width:928.6,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",ascent:850,descent:-150},"camera-retro":{width: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",ascent:850,descent:-150},zoombox:{width: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",ascent:850,descent:-150},pan:{width: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",ascent:850,descent:-150},zoom_plus:{width: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",ascent:850,descent:-150},zoom_minus:{width:1e3,path:"m0 788l0-876 875 0 0 876-875 0z m688-500l-500 0 0 125 500 0 0-125z",ascent:850,descent:-150},autoscale:{width: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",ascent:850,descent:-150},tooltip_basic:{width:1500,path:"m375 725l0 0-375-375 375-374 0-1 1125 0 0 750-1125 0z",ascent:850,descent:-150},tooltip_compare:{width:1125,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",ascent:850,descent:-150},plotlylogo:{width:1542,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",ascent:850,descent:-150},"z-axis":{width: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",ascent:850,descent:-150},"3d_rotate":{width: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",ascent:850,descent:-150},camera:{width: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",ascent:850,descent:-150},movie:{width: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",ascent:850,descent:-150},question:{width:857.1,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",ascent:850,descent:-150},disk:{width:857.1,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",ascent:850,descent:-150},lasso:{width:1031,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",ascent:850,descent:-150},selectbox:{width: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",ascent:850,descent:-150},spikeline:{width: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",ascent:850,descent:-150}}},{}],3:[function(t,e,r){"use strict";e.exports=t("../src/traces/bar")},{"../src/traces/bar":239}],4:[function(t,e,r){"use strict";e.exports=t("../src/core")},{"../src/core":136}],5:[function(t,e,r){"use strict";var n=t("./core");n.register([t("./bar"),t("./pie")]),e.exports=n},{"./bar":3,"./core":4,"./pie":6}],6:[function(t,e,r){"use strict";e.exports=t("../src/traces/pie")},{"../src/traces/pie":253}],7:[function(e,r,n){!function(){function e(t){return t&&(t.ownerDocument||t.document||t).documentElement}function n(t){return t&&(t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView)}function a(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function i(t){return null===t?NaN:+t}function o(t){return!isNaN(t)}function l(t){return{left:function(e,r,n,a){for(arguments.length<3&&(n=0),arguments.length<4&&(a=e.length);n<a;){var i=n+a>>>1;t(e[i],r)<0?n=i+1:a=i}return n},right:function(e,r,n,a){for(arguments.length<3&&(n=0),arguments.length<4&&(a=e.length);n<a;){var i=n+a>>>1;t(e[i],r)>0?a=i:n=i+1}return n}}}function s(t){return t.length}function c(t){for(var e=1;t*e%1;)e*=10;return e}function u(t,e){for(var r in e)Object.defineProperty(t.prototype,r,{value:e[r],enumerable:!1})}function f(){this._=Object.create(null)}function d(t){return(t+="")===_o||t[0]===wo?wo+t:t}function p(t){return(t+="")[0]===wo?t.slice(1):t}function h(t){return d(t)in this._}function g(t){return(t=d(t))in this._&&delete this._[t]}function v(){var t=[];for(var e in this._)t.push(p(e));return t}function y(){var t=0;for(var e in this._)++t;return t}function m(){for(var t in this._)return!1;return!0}function x(){this._=Object.create(null)}function b(t){return t}function _(t,e,r){return function(){var n=r.apply(e,arguments);return n===e?t:n}}function w(t,e){if(e in t)return e;e=e.charAt(0).toUpperCase()+e.slice(1);for(var r=0,n=ko.length;r<n;++r){var a=ko[r]+e;if(a in t)return a}}function k(){}function M(){}function A(t){function e(){for(var e,n=r,a=-1,i=n.length;++a<i;)(e=n[a].on)&&e.apply(this,arguments);return t}var r=[],n=new f;return e.on=function(e,a){var i,o=n.get(e);return arguments.length<2?o&&o.on:(o&&(o.on=null,r=r.slice(0,i=r.indexOf(o)).concat(r.slice(i+1)),n.remove(e)),a&&r.push(n.set(e,{on:a})),t)},e}function T(){co.event.preventDefault()}function L(){for(var t,e=co.event;t=e.sourceEvent;)e=t;return e}function C(t){for(var e=new M,r=0,n=arguments.length;++r<n;)e[arguments[r]]=A(e);return e.of=function(r,n){return function(a){try{var i=a.sourceEvent=co.event;a.target=t,co.event=a,e[a.type].apply(r,n)}finally{co.event=i}}},e}function S(t){return Ao(t,So),t}function O(t){return"function"==typeof t?t:function(){return To(t,this)}}function z(t){return"function"==typeof t?t:function(){return Lo(t,this)}}function D(t,e){function r(){this.removeAttribute(t)}function n(){this.removeAttributeNS(t.space,t.local)}function a(){this.setAttribute(t,e)}function i(){this.setAttributeNS(t.space,t.local,e)}function o(){var r=e.apply(this,arguments);null==r?this.removeAttribute(t):this.setAttribute(t,r)}function l(){var r=e.apply(this,arguments);null==r?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,r)}return t=co.ns.qualify(t),null==e?t.local?n:r:"function"==typeof e?t.local?l:o:t.local?i:a}function P(t){return t.trim().replace(/\s+/g," ")}function E(t){return new RegExp("(?:^|\\s+)"+co.requote(t)+"(?:\\s+|$)","g")}function N(t){return(t+"").trim().split(/^|\s+/)}function I(t,e){function r(){for(var r=-1;++r<a;)t[r](this,e)}function n(){for(var r=-1,n=e.apply(this,arguments);++r<a;)t[r](this,n)}t=N(t).map(R);var a=t.length;return"function"==typeof e?n:r}function R(t){var e=E(t);return function(r,n){if(a=r.classList)return n?a.add(t):a.remove(t);var a=r.getAttribute("class")||"";n?(e.lastIndex=0,e.test(a)||r.setAttribute("class",P(a+" "+t))):r.setAttribute("class",P(a.replace(e," ")))}}function F(t,e,r){function n(){this.style.removeProperty(t)}function a(){this.style.setProperty(t,e,r)}function i(){var n=e.apply(this,arguments);null==n?this.style.removeProperty(t):this.style.setProperty(t,n,r)}return null==e?n:"function"==typeof e?i:a}function j(t,e){function r(){delete this[t]}function n(){this[t]=e}function a(){var r=e.apply(this,arguments);null==r?delete this[t]:this[t]=r}return null==e?r:"function"==typeof e?a:n}function B(t){function e(){var e=this.ownerDocument,r=this.namespaceURI;return r===Oo&&e.documentElement.namespaceURI===Oo?e.createElement(t):e.createElementNS(r,t)}function r(){return this.ownerDocument.createElementNS(t.space,t.local)}return"function"==typeof t?t:(t=co.ns.qualify(t)).local?r:e}function q(){var t=this.parentNode;t&&t.removeChild(this)}function H(t){return{__data__:t}}function V(t){return function(){return Co(this,t)}}function U(t){return arguments.length||(t=a),function(e,r){return e&&r?t(e.__data__,r.__data__):!e-!r}}function G(t,e){for(var r=0,n=t.length;r<n;r++)for(var a,i=t[r],o=0,l=i.length;o<l;o++)(a=i[o])&&e(a,o,r);return t}function X(t){return Ao(t,Do),t}function Y(t){var e,r;return function(n,a,i){var o,l=t[i].update,s=l.length;for(i!=r&&(r=i,e=0),a>=e&&(e=a+1);!(o=l[e])&&++e<s;);return o}}function Z(t,e,r){function n(){var e=this[o];e&&(this.removeEventListener(t,e,e.$),delete this[o])}function a(){var a=s(e,fo(arguments));n.call(this),this.addEventListener(t,this[o]=a,a.$=r),a._=e}function i(){var e,r=new RegExp("^__on([^.]+)"+co.requote(t)+"$");for(var n in this)if(e=n.match(r)){var a=this[n];this.removeEventListener(e[1],a,a.$),delete this[n]}}var o="__on"+t,l=t.indexOf("."),s=W;l>0&&(t=t.slice(0,l));var c=Po.get(t);return c&&(t=c,s=Q),l?e?a:n:e?k:i}function W(t,e){return function(r){var n=co.event;co.event=r,e[0]=this.__data__;try{t.apply(this,e)}finally{co.event=n}}}function Q(t,e){var r=W(t,e);return function(t){var e=this,n=t.relatedTarget;n&&(n===e||8&n.compareDocumentPosition(e))||r.call(e,t)}}function $(t){var r=".dragsuppress-"+ ++No,a="click"+r,i=co.select(n(t)).on("touchmove"+r,T).on("dragstart"+r,T).on("selectstart"+r,T);if(null==Eo&&(Eo=!("onselectstart"in t)&&w(t.style,"userSelect")),Eo){var o=e(t).style,l=o[Eo];o[Eo]="none"}return function(t){if(i.on(r,null),Eo&&(o[Eo]=l),t){var e=function(){i.on(a,null)};i.on(a,function(){T(),e()},!0),setTimeout(e,0)}}}function J(t,e){e.changedTouches&&(e=e.changedTouches[0]);var r=t.ownerSVGElement||t;if(r.createSVGPoint){var a=r.createSVGPoint();if(Io<0){var i=n(t);if(i.scrollX||i.scrollY){r=co.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important");var o=r[0][0].getScreenCTM();Io=!(o.f||o.e),r.remove()}}return Io?(a.x=e.pageX,a.y=e.pageY):(a.x=e.clientX,a.y=e.clientY),a=a.matrixTransform(t.getScreenCTM().inverse()),[a.x,a.y]}var l=t.getBoundingClientRect();return[e.clientX-l.left-t.clientLeft,e.clientY-l.top-t.clientTop]}function K(){return co.event.changedTouches[0].identifier}function tt(t){return t>0?1:t<0?-1:0}function et(t,e,r){return(e[0]-t[0])*(r[1]-t[1])-(e[1]-t[1])*(r[0]-t[0])}function rt(t){return t>1?0:t<-1?jo:Math.acos(t)}function nt(t){return t>1?Ho:t<-1?-Ho:Math.asin(t)}function at(t){return((t=Math.exp(t))-1/t)/2}function it(t){return((t=Math.exp(t))+1/t)/2}function ot(t){return((t=Math.exp(2*t))-1)/(t+1)}function lt(t){return(t=Math.sin(t/2))*t}function st(){}function ct(t,e,r){return this instanceof ct?(this.h=+t,this.s=+e,void(this.l=+r)):arguments.length<2?t instanceof ct?new ct(t.h,t.s,t.l):kt(""+t,Mt,ct):new ct(t,e,r)}function ut(t,e,r){function n(t){return t>360?t-=360:t<0&&(t+=360),t<60?i+(o-i)*t/60:t<180?o:t<240?i+(o-i)*(240-t)/60:i}function a(t){return Math.round(255*n(t))}var i,o;return t=isNaN(t)?0:(t%=360)<0?t+360:t,e=isNaN(e)?0:e<0?0:e>1?1:e,r=r<0?0:r>1?1:r,o=r<=.5?r*(1+e):r+e-r*e,i=2*r-o,new xt(a(t+120),a(t),a(t-120))}function ft(t,e,r){return this instanceof ft?(this.h=+t,this.c=+e,void(this.l=+r)):arguments.length<2?t instanceof ft?new ft(t.h,t.c,t.l):t instanceof pt?gt(t.l,t.a,t.b):gt((t=At((t=co.rgb(t)).r,t.g,t.b)).l,t.a,t.b):new ft(t,e,r)}function dt(t,e,r){return isNaN(t)&&(t=0),isNaN(e)&&(e=0),new pt(r,Math.cos(t*=Vo)*e,Math.sin(t)*e)}function pt(t,e,r){return this instanceof pt?(this.l=+t,this.a=+e,void(this.b=+r)):arguments.length<2?t instanceof pt?new pt(t.l,t.a,t.b):t instanceof ft?dt(t.h,t.c,t.l):At((t=xt(t)).r,t.g,t.b):new pt(t,e,r)}function ht(t,e,r){var n=(t+16)/116,a=n+e/500,i=n-r/200;return a=vt(a)*Jo,n=vt(n)*Ko,i=vt(i)*tl,new xt(mt(3.2404542*a-1.5371385*n-.4985314*i),mt(-.969266*a+1.8760108*n+.041556*i),mt(.0556434*a-.2040259*n+1.0572252*i))}function gt(t,e,r){return t>0?new ft(Math.atan2(r,e)*Uo,Math.sqrt(e*e+r*r),t):new ft(NaN,NaN,t)}function vt(t){return t>.206893034?t*t*t:(t-4/29)/7.787037}function yt(t){return t>.008856?Math.pow(t,1/3):7.787037*t+4/29}function mt(t){return Math.round(255*(t<=.00304?12.92*t:1.055*Math.pow(t,1/2.4)-.055))}function xt(t,e,r){return this instanceof xt?(this.r=~~t,this.g=~~e,void(this.b=~~r)):arguments.length<2?t instanceof xt?new xt(t.r,t.g,t.b):kt(""+t,xt,ut):new xt(t,e,r)}function bt(t){return new xt(t>>16,t>>8&255,255&t)}function _t(t){return bt(t)+""}function wt(t){return t<16?"0"+Math.max(0,t).toString(16):Math.min(255,t).toString(16)}function kt(t,e,r){var n,a,i,o=0,l=0,s=0;if(n=/([a-z]+)\((.*)\)/.exec(t=t.toLowerCase()))switch(a=n[2].split(","),n[1]){case"hsl":return r(parseFloat(a[0]),parseFloat(a[1])/100,parseFloat(a[2])/100);case"rgb":return e(Lt(a[0]),Lt(a[1]),Lt(a[2]))}return(i=nl.get(t))?e(i.r,i.g,i.b):(null==t||"#"!==t.charAt(0)||isNaN(i=parseInt(t.slice(1),16))||(4===t.length?(o=(3840&i)>>4,o|=o>>4,l=240&i,l|=l>>4,s=15&i,s|=s<<4):7===t.length&&(o=(16711680&i)>>16,l=(65280&i)>>8,s=255&i)),e(o,l,s))}function Mt(t,e,r){var n,a,i=Math.min(t/=255,e/=255,r/=255),o=Math.max(t,e,r),l=o-i,s=(o+i)/2;return l?(a=s<.5?l/(o+i):l/(2-o-i),n=t==o?(e-r)/l+(e<r?6:0):e==o?(r-t)/l+2:(t-e)/l+4,n*=60):(n=NaN,a=s>0&&s<1?0:n),new ct(n,a,s)}function At(t,e,r){t=Tt(t),e=Tt(e),r=Tt(r);var n=yt((.4124564*t+.3575761*e+.1804375*r)/Jo),a=yt((.2126729*t+.7151522*e+.072175*r)/Ko);return pt(116*a-16,500*(n-a),200*(a-yt((.0193339*t+.119192*e+.9503041*r)/tl)))}function Tt(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Lt(t){var e=parseFloat(t);return"%"===t.charAt(t.length-1)?Math.round(2.55*e):e}function Ct(t){return"function"==typeof t?t:function(){return t}}function St(t){return function(e,r,n){return 2===arguments.length&&"function"==typeof r&&(n=r,r=null),Ot(e,r,t,n)}}function Ot(t,e,r,n){function a(){var t,e=s.status;if(!e&&Dt(s)||e>=200&&e<300||304===e){try{t=r.call(i,s)}catch(t){return void o.error.call(i,t)}o.load.call(i,t)}else o.error.call(i,s)}var i={},o=co.dispatch("beforesend","progress","load","error"),l={},s=new XMLHttpRequest,c=null;return!this.XDomainRequest||"withCredentials"in s||!/^(http(s)?:)?\/\//.test(t)||(s=new XDomainRequest),"onload"in s?s.onload=s.onerror=a:s.onreadystatechange=function(){s.readyState>3&&a()},s.onprogress=function(t){var e=co.event;co.event=t;try{o.progress.call(i,s)}finally{co.event=e}},i.header=function(t,e){return t=(t+"").toLowerCase(),arguments.length<2?l[t]:(null==e?delete l[t]:l[t]=e+"",i)},i.mimeType=function(t){return arguments.length?(e=null==t?null:t+"",i):e},i.responseType=function(t){return arguments.length?(c=t,i):c},i.response=function(t){return r=t,i},["get","post"].forEach(function(t){i[t]=function(){return i.send.apply(i,[t].concat(fo(arguments)))}}),i.send=function(r,n,a){if(2===arguments.length&&"function"==typeof n&&(a=n,n=null),s.open(r,t,!0),null==e||"accept"in l||(l.accept=e+",*/*"),s.setRequestHeader)for(var u in l)s.setRequestHeader(u,l[u]);return null!=e&&s.overrideMimeType&&s.overrideMimeType(e),null!=c&&(s.responseType=c),null!=a&&i.on("error",a).on("load",function(t){a(null,t)}),o.beforesend.call(i,s),s.send(null==n?null:n),i},i.abort=function(){return s.abort(),i},co.rebind(i,o,"on"),null==n?i:i.get(zt(n))}function zt(t){return 1===t.length?function(e,r){t(null==e?r:null)}:t}function Dt(t){var e=t.responseType;return e&&"text"!==e?t.response:t.responseText}function Pt(t,e,r){var n=arguments.length;n<2&&(e=0),n<3&&(r=Date.now());var a=r+e,i={c:t,t:a,n:null};return il?il.n=i:al=i,il=i,ol||(ll=clearTimeout(ll),ol=1,sl(Et)),i}function Et(){var t=Nt(),e=It()-t;e>24?(isFinite(e)&&(clearTimeout(ll),ll=setTimeout(Et,e)),ol=0):(ol=1,sl(Et))}function Nt(){for(var t=Date.now(),e=al;e;)t>=e.t&&e.c(t-e.t)&&(e.c=null),e=e.n;return t}function It(){for(var t,e=al,r=1/0;e;)e.c?(e.t<r&&(r=e.t),e=(t=e).n):e=t?t.n=e.n:al=e.n;return il=t,r}function Rt(t,e){return e-(t?Math.ceil(Math.log(t)/Math.LN10):1)}function Ft(t,e){var r=Math.pow(10,3*bo(8-e));return{scale:e>8?function(t){return t/r}:function(t){return t*r},symbol:t}}function jt(t){var e=t.decimal,r=t.thousands,n=t.grouping,a=t.currency,i=n&&r?function(t,e){for(var a=t.length,i=[],o=0,l=n[0],s=0;a>0&&l>0&&(s+l+1>e&&(l=Math.max(1,e-s)),i.push(t.substring(a-=l,a+l)),!((s+=l+1)>e));)l=n[o=(o+1)%n.length];return i.reverse().join(r)}:b;return function(t){var r=ul.exec(t),n=r[1]||" ",o=r[2]||">",l=r[3]||"-",s=r[4]||"",c=r[5],u=+r[6],f=r[7],d=r[8],p=r[9],h=1,g="",v="",y=!1,m=!0;switch(d&&(d=+d.substring(1)),(c||"0"===n&&"="===o)&&(c=n="0",o="="),p){case"n":f=!0,p="g";break;case"%":h=100,v="%",p="f";break;case"p":h=100,v="%",p="r";break;case"b":case"o":case"x":case"X":"#"===s&&(g="0"+p.toLowerCase());case"c":m=!1;case"d":y=!0,d=0;break;case"s":h=-1,p="r"}"$"===s&&(g=a[0],v=a[1]),"r"!=p||d||(p="g"),null!=d&&("g"==p?d=Math.max(1,Math.min(21,d)):"e"!=p&&"f"!=p||(d=Math.max(0,Math.min(20,d)))),p=fl.get(p)||Bt;var x=c&&f;return function(t){var r=v;if(y&&t%1)return"";var a=t<0||0===t&&1/t<0?(t=-t,"-"):"-"===l?"":l;if(h<0){var s=co.formatPrefix(t,d);t=s.scale(t),r=s.symbol+v}else t*=h;t=p(t,d);var b,_,w=t.lastIndexOf(".");if(w<0){var k=m?t.lastIndexOf("e"):-1;k<0?(b=t,_=""):(b=t.substring(0,k),_=t.substring(k))}else b=t.substring(0,w),_=e+t.substring(w+1);!c&&f&&(b=i(b,1/0));var M=g.length+b.length+_.length+(x?0:a.length),A=M<u?new Array(M=u-M+1).join(n):"";return x&&(b=i(A+b,A.length?u-_.length:1/0)),a+=g,t=b+_,("<"===o?a+t+A:">"===o?A+a+t:"^"===o?A.substring(0,M>>=1)+a+t+A.substring(M):a+(x?t:A+t))+r}}}function Bt(t){return t+""}function qt(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}function Ht(t,e,r){function n(e){var r=t(e),n=i(r,1);return e-r<n-e?r:n}function a(r){return e(r=t(new pl(r-1)),1),r}function i(t,r){return e(t=new pl(+t),r),t}function o(t,n,i){var o=a(t),l=[];if(i>1)for(;o<n;)r(o)%i||l.push(new Date(+o)),e(o,1);else for(;o<n;)l.push(new Date(+o)),e(o,1);return l}function l(t,e,r){try{pl=qt;var n=new qt;return n._=t,o(n,e,r)}finally{pl=Date}}t.floor=t,t.round=n,t.ceil=a,t.offset=i,t.range=o;var s=t.utc=Vt(t);return s.floor=s,s.round=Vt(n),s.ceil=Vt(a),s.offset=Vt(i),s.range=l,t}function Vt(t){return function(e,r){try{pl=qt;var n=new qt;return n._=e,t(n,r)._}finally{pl=Date}}}function Ut(t){function e(t){function e(e){for(var r,a,i,o=[],l=-1,s=0;++l<n;)37===t.charCodeAt(l)&&(o.push(t.slice(s,l)),null!=(a=gl[r=t.charAt(++l)])&&(r=t.charAt(++l)),(i=C[r])&&(r=i(e,null==a?"e"===r?" ":"0":a)),o.push(r),s=l+1);return o.push(t.slice(s,l)),o.join("")}var n=t.length;return e.parse=function(e){var n={y:1900,m:0,d:1,H:0,M:0,S:0,L:0,Z:null};if(r(n,t,e,0)!=e.length)return null;"p"in n&&(n.H=n.H%12+12*n.p);var a=null!=n.Z&&pl!==qt,i=new(a?qt:pl);return"j"in n?i.setFullYear(n.y,0,n.j):"W"in n||"U"in n?("w"in n||(n.w="W"in n?1:0),i.setFullYear(n.y,0,1),i.setFullYear(n.y,0,"W"in n?(n.w+6)%7+7*n.W-(i.getDay()+5)%7:n.w+7*n.U-(i.getDay()+6)%7)):i.setFullYear(n.y,n.m,n.d),i.setHours(n.H+(n.Z/100|0),n.M+n.Z%100,n.S,n.L),a?i._:i},e.toString=function(){return t},e}function r(t,e,r,n){for(var a,i,o,l=0,s=e.length,c=r.length;l<s;){if(n>=c)return-1;if(37===(a=e.charCodeAt(l++))){if(o=e.charAt(l++),!(i=S[o in gl?e.charAt(l++):o])||(n=i(t,r,n))<0)return-1}else if(a!=r.charCodeAt(n++))return-1}return n}function n(t,e,r){w.lastIndex=0;var n=w.exec(e.slice(r));return n?(t.w=k.get(n[0].toLowerCase()),r+n[0].length):-1}function a(t,e,r){b.lastIndex=0;var n=b.exec(e.slice(r));return n?(t.w=_.get(n[0].toLowerCase()),r+n[0].length):-1}function i(t,e,r){T.lastIndex=0;var n=T.exec(e.slice(r));return n?(t.m=L.get(n[0].toLowerCase()),r+n[0].length):-1}function o(t,e,r){M.lastIndex=0;var n=M.exec(e.slice(r));return n?(t.m=A.get(n[0].toLowerCase()),r+n[0].length):-1}function l(t,e,n){return r(t,C.c.toString(),e,n)}function s(t,e,n){return r(t,C.x.toString(),e,n)}function c(t,e,n){return r(t,C.X.toString(),e,n)}function u(t,e,r){var n=x.get(e.slice(r,r+=2).toLowerCase());return null==n?-1:(t.p=n,r)}var f=t.dateTime,d=t.date,p=t.time,h=t.periods,g=t.days,v=t.shortDays,y=t.months,m=t.shortMonths;e.utc=function(t){function r(t){try{pl=qt;var e=new pl;return e._=t,n(e)}finally{pl=Date}}var n=e(t);return r.parse=function(t){try{pl=qt;var e=n.parse(t);return e&&e._}finally{pl=Date}},r.toString=n.toString,r},e.multi=e.utc.multi=ue;var x=co.map(),b=Xt(g),_=Yt(g),w=Xt(v),k=Yt(v),M=Xt(y),A=Yt(y),T=Xt(m),L=Yt(m);h.forEach(function(t,e){x.set(t.toLowerCase(),e)});var C={a:function(t){return v[t.getDay()]},A:function(t){return g[t.getDay()]},b:function(t){return m[t.getMonth()]},B:function(t){return y[t.getMonth()]},c:e(f),d:function(t,e){return Gt(t.getDate(),e,2)},e:function(t,e){return Gt(t.getDate(),e,2)},H:function(t,e){return Gt(t.getHours(),e,2)},I:function(t,e){return Gt(t.getHours()%12||12,e,2)},j:function(t,e){return Gt(1+dl.dayOfYear(t),e,3)},L:function(t,e){return Gt(t.getMilliseconds(),e,3)},m:function(t,e){return Gt(t.getMonth()+1,e,2)},M:function(t,e){return Gt(t.getMinutes(),e,2)},p:function(t){return h[+(t.getHours()>=12)]},S:function(t,e){return Gt(t.getSeconds(),e,2)},U:function(t,e){return Gt(dl.sundayOfYear(t),e,2)},w:function(t){return t.getDay()},W:function(t,e){return Gt(dl.mondayOfYear(t),e,2)},x:e(d),X:e(p),y:function(t,e){return Gt(t.getFullYear()%100,e,2)},Y:function(t,e){return Gt(t.getFullYear()%1e4,e,4)},Z:se,"%":function(){return"%"}},S={a:n,A:a,b:i,B:o,c:l,d:re,e:re,H:ae,I:ae,j:ne,L:le,m:ee,M:ie,p:u,S:oe,U:Wt,w:Zt,W:Qt,x:s,X:c,y:Jt,Y:$t,Z:Kt,"%":ce};return e}function Gt(t,e,r){var n=t<0?"-":"",a=(n?-t:t)+"",i=a.length;return n+(i<r?new Array(r-i+1).join(e)+a:a)}function Xt(t){return new RegExp("^(?:"+t.map(co.requote).join("|")+")","i")}function Yt(t){for(var e=new f,r=-1,n=t.length;++r<n;)e.set(t[r].toLowerCase(),r);return e}function Zt(t,e,r){vl.lastIndex=0;var n=vl.exec(e.slice(r,r+1));return n?(t.w=+n[0],r+n[0].length):-1}function Wt(t,e,r){vl.lastIndex=0;var n=vl.exec(e.slice(r));return n?(t.U=+n[0],r+n[0].length):-1}function Qt(t,e,r){vl.lastIndex=0;var n=vl.exec(e.slice(r));return n?(t.W=+n[0],r+n[0].length):-1}function $t(t,e,r){vl.lastIndex=0;var n=vl.exec(e.slice(r,r+4));return n?(t.y=+n[0],r+n[0].length):-1}function Jt(t,e,r){vl.lastIndex=0;var n=vl.exec(e.slice(r,r+2));return n?(t.y=te(+n[0]),r+n[0].length):-1}function Kt(t,e,r){return/^[+-]\d{4}$/.test(e=e.slice(r,r+5))?(t.Z=-e,r+5):-1}function te(t){return t+(t>68?1900:2e3)}function ee(t,e,r){vl.lastIndex=0;var n=vl.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function re(t,e,r){vl.lastIndex=0;var n=vl.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function ne(t,e,r){vl.lastIndex=0;var n=vl.exec(e.slice(r,r+3));return n?(t.j=+n[0],r+n[0].length):-1}function ae(t,e,r){vl.lastIndex=0;var n=vl.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function ie(t,e,r){vl.lastIndex=0;var n=vl.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function oe(t,e,r){vl.lastIndex=0;var n=vl.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function le(t,e,r){vl.lastIndex=0;var n=vl.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function se(t){var e=t.getTimezoneOffset(),r=e>0?"-":"+",n=bo(e)/60|0,a=bo(e)%60;return r+Gt(n,"0",2)+Gt(a,"0",2)}function ce(t,e,r){yl.lastIndex=0;var n=yl.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function ue(t){ for(var e=t.length,r=-1;++r<e;)t[r][0]=this(t[r][0]);return function(e){for(var r=0,n=t[r];!n[1](e);)n=t[++r];return n[0](e)}}function fe(){}function de(t,e,r){var n=r.s=t+e,a=n-t,i=n-a;r.t=t-i+(e-a)}function pe(t,e){t&&_l.hasOwnProperty(t.type)&&_l[t.type](t,e)}function he(t,e,r){var n,a=-1,i=t.length-r;for(e.lineStart();++a<i;)n=t[a],e.point(n[0],n[1],n[2]);e.lineEnd()}function ge(t,e){var r=-1,n=t.length;for(e.polygonStart();++r<n;)he(t[r],e,1);e.polygonEnd()}function ve(){function t(t,e){t*=Vo,e=e*Vo/2+jo/4;var r=t-n,o=r>=0?1:-1,l=o*r,s=Math.cos(e),c=Math.sin(e),u=i*c,f=a*s+u*Math.cos(l),d=u*o*Math.sin(l);kl.add(Math.atan2(d,f)),n=t,a=s,i=c}var e,r,n,a,i;Ml.point=function(o,l){Ml.point=t,n=(e=o)*Vo,a=Math.cos(l=(r=l)*Vo/2+jo/4),i=Math.sin(l)},Ml.lineEnd=function(){t(e,r)}}function ye(t){var e=t[0],r=t[1],n=Math.cos(r);return[n*Math.cos(e),n*Math.sin(e),Math.sin(r)]}function me(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function xe(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function be(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function _e(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function we(t){var e=Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}function ke(t){return[Math.atan2(t[1],t[0]),nt(t[2])]}function Me(t,e){return bo(t[0]-e[0])<Ro&&bo(t[1]-e[1])<Ro}function Ae(t,e){t*=Vo;var r=Math.cos(e*=Vo);Te(r*Math.cos(t),r*Math.sin(t),Math.sin(e))}function Te(t,e,r){++Al,Ll+=(t-Ll)/Al,Cl+=(e-Cl)/Al,Sl+=(r-Sl)/Al}function Le(){function t(t,a){t*=Vo;var i=Math.cos(a*=Vo),o=i*Math.cos(t),l=i*Math.sin(t),s=Math.sin(a),c=Math.atan2(Math.sqrt((c=r*s-n*l)*c+(c=n*o-e*s)*c+(c=e*l-r*o)*c),e*o+r*l+n*s);Tl+=c,Ol+=c*(e+(e=o)),zl+=c*(r+(r=l)),Dl+=c*(n+(n=s)),Te(e,r,n)}var e,r,n;Il.point=function(a,i){a*=Vo;var o=Math.cos(i*=Vo);e=o*Math.cos(a),r=o*Math.sin(a),n=Math.sin(i),Il.point=t,Te(e,r,n)}}function Ce(){Il.point=Ae}function Se(){function t(t,e){t*=Vo;var r=Math.cos(e*=Vo),o=r*Math.cos(t),l=r*Math.sin(t),s=Math.sin(e),c=a*s-i*l,u=i*o-n*s,f=n*l-a*o,d=Math.sqrt(c*c+u*u+f*f),p=n*o+a*l+i*s,h=d&&-rt(p)/d,g=Math.atan2(d,p);Pl+=h*c,El+=h*u,Nl+=h*f,Tl+=g,Ol+=g*(n+(n=o)),zl+=g*(a+(a=l)),Dl+=g*(i+(i=s)),Te(n,a,i)}var e,r,n,a,i;Il.point=function(o,l){e=o,r=l,Il.point=t,o*=Vo;var s=Math.cos(l*=Vo);n=s*Math.cos(o),a=s*Math.sin(o),i=Math.sin(l),Te(n,a,i)},Il.lineEnd=function(){t(e,r),Il.lineEnd=Ce,Il.point=Ae}}function Oe(t,e){function r(r,n){return r=t(r,n),e(r[0],r[1])}return t.invert&&e.invert&&(r.invert=function(r,n){return(r=e.invert(r,n))&&t.invert(r[0],r[1])}),r}function ze(){return!0}function De(t,e,r,n,a){var i=[],o=[];if(t.forEach(function(t){if(!((e=t.length-1)<=0)){var e,r=t[0],n=t[e];if(Me(r,n)){a.lineStart();for(var l=0;l<e;++l)a.point((r=t[l])[0],r[1]);return void a.lineEnd()}var s=new Ee(r,t,null,!0),c=new Ee(r,null,s,!1);s.o=c,i.push(s),o.push(c),s=new Ee(n,t,null,!1),c=new Ee(n,null,s,!0),s.o=c,i.push(s),o.push(c)}}),o.sort(e),Pe(i),Pe(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(var 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){u=p.p.z;for(var l=u.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}p=p.o,u=p.z,h=!h}while(!p.v);a.lineEnd()}}}function Pe(t){if(e=t.length){for(var e,r,n=0,a=t[0];++n<e;)a.n=r=t[n],r.p=a,a=r;a.n=r=t[0],r.p=a}}function Ee(t,e,r,n){this.x=t,this.z=e,this.o=r,this.e=n,this.v=!1,this.n=this.p=null}function Ne(t,e,r,n){return function(a,i){function o(e,r){var n=a(e,r);t(e=n[0],r=n[1])&&i.point(e,r)}function l(t,e){var r=a(t,e);v.point(r[0],r[1])}function s(){m.point=l,v.lineStart()}function c(){m.point=o,v.lineEnd()}function u(t,e){g.push([t,e]);var r=a(t,e);b.point(r[0],r[1])}function f(){b.lineStart(),g=[]}function d(){u(g[0][0],g[0][1]),b.lineEnd();var t,e=b.clean(),r=x.buffer(),n=r.length;if(g.pop(),h.push(g),g=null,n)if(1&e){t=r[0];var a,n=t.length-1,o=-1;if(n>0){for(_||(i.polygonStart(),_=!0),i.lineStart();++o<n;)i.point((a=t[o])[0],a[1]);i.lineEnd()}}else n>1&&2&e&&r.push(r.pop().concat(r.shift())),p.push(r.filter(Ie))}var p,h,g,v=e(i),y=a.invert(n[0],n[1]),m={point:o,lineStart:s,lineEnd:c,polygonStart:function(){m.point=u,m.lineStart=f,m.lineEnd=d,p=[],h=[]},polygonEnd:function(){m.point=o,m.lineStart=s,m.lineEnd=c,p=co.merge(p);var t=He(y,h);p.length?(_||(i.polygonStart(),_=!0),De(p,Fe,t,r,i)):t&&(_||(i.polygonStart(),_=!0),i.lineStart(),r(null,null,1,i),i.lineEnd()),_&&(i.polygonEnd(),_=!1),p=h=null},sphere:function(){i.polygonStart(),i.lineStart(),r(null,null,1,i),i.lineEnd(),i.polygonEnd()}},x=Re(),b=e(x),_=!1;return m}}function Ie(t){return t.length>1}function Re(){var t,e=[];return{lineStart:function(){e.push(t=[])},point:function(e,r){t.push([e,r])},lineEnd:k,buffer:function(){var r=e;return e=[],t=null,r},rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))}}}function Fe(t,e){return((t=t.x)[0]<0?t[1]-Ho-Ro:Ho-t[1])-((e=e.x)[0]<0?e[1]-Ho-Ro:Ho-e[1])}function je(t){var e,r=NaN,n=NaN,a=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(i,o){var l=i>0?jo:-jo,s=bo(i-r);bo(s-jo)<Ro?(t.point(r,n=(n+o)/2>0?Ho:-Ho),t.point(a,n),t.lineEnd(),t.lineStart(),t.point(l,n),t.point(i,n),e=0):a!==l&&s>=jo&&(bo(r-a)<Ro&&(r-=a*Ro),bo(i-l)<Ro&&(i-=l*Ro),n=Be(r,n,i,o),t.point(a,n),t.lineEnd(),t.lineStart(),t.point(l,n),e=0),t.point(r=i,n=o),a=l},lineEnd:function(){t.lineEnd(),r=n=NaN},clean:function(){return 2-e}}}function Be(t,e,r,n){var a,i,o=Math.sin(t-r);return bo(o)>Ro?Math.atan((Math.sin(e)*(i=Math.cos(n))*Math.sin(r)-Math.sin(n)*(a=Math.cos(e))*Math.sin(t))/(a*i*o)):(e+n)/2}function qe(t,e,r,n){var a;if(null==t)a=r*Ho,n.point(-jo,a),n.point(0,a),n.point(jo,a),n.point(jo,0),n.point(jo,-a),n.point(0,-a),n.point(-jo,-a),n.point(-jo,0),n.point(-jo,a);else if(bo(t[0]-e[0])>Ro){var i=t[0]<e[0]?jo:-jo;a=r*i/2,n.point(-i,a),n.point(0,a),n.point(i,a)}else n.point(e[0],e[1])}function He(t,e){var r=t[0],n=t[1],a=[Math.sin(r),-Math.cos(r),0],i=0,o=0;kl.reset();for(var l=0,s=e.length;l<s;++l){var c=e[l],u=c.length;if(u)for(var f=c[0],d=f[0],p=f[1]/2+jo/4,h=Math.sin(p),g=Math.cos(p),v=1;;){v===u&&(v=0),t=c[v];var y=t[0],m=t[1]/2+jo/4,x=Math.sin(m),b=Math.cos(m),_=y-d,w=_>=0?1:-1,k=w*_,M=k>jo,A=h*x;if(kl.add(Math.atan2(A*w*Math.sin(k),g*b+A*Math.cos(k))),i+=M?_+w*Bo:_,M^d>=r^y>=r){var T=xe(ye(f),ye(t));we(T);var L=xe(a,T);we(L);var C=(M^_>=0?-1:1)*nt(L[2]);(n>C||n===C&&(T[0]||T[1]))&&(o+=M^_>=0?1:-1)}if(!v++)break;d=y,h=x,g=b,f=t}}return(i<-Ro||i<Ro&&kl<-Ro)^1&o}function Ve(t){function e(t,e){return Math.cos(t)*Math.cos(e)>i}function r(t){var r,i,s,c,u;return{lineStart:function(){c=s=!1,u=1},point:function(f,d){var p,h=[f,d],g=e(f,d),v=o?g?0:a(f,d):g?a(f+(f<0?jo:-jo),d):0;if(!r&&(c=s=g)&&t.lineStart(),g!==s&&(p=n(r,h),(Me(r,p)||Me(h,p))&&(h[0]+=Ro,h[1]+=Ro,g=e(h[0],h[1]))),g!==s)u=0,g?(t.lineStart(),p=n(h,r),t.point(p[0],p[1])):(p=n(r,h),t.point(p[0],p[1]),t.lineEnd()),r=p;else if(l&&r&&o^g){var y;v&i||!(y=n(h,r,!0))||(u=0,o?(t.lineStart(),t.point(y[0][0],y[0][1]),t.point(y[1][0],y[1][1]),t.lineEnd()):(t.point(y[1][0],y[1][1]),t.lineEnd(),t.lineStart(),t.point(y[0][0],y[0][1])))}!g||r&&Me(r,h)||t.point(h[0],h[1]),r=h,s=g,i=v},lineEnd:function(){s&&t.lineEnd(),r=null},clean:function(){return u|(c&&s)<<1}}}function n(t,e,r){var n=ye(t),a=ye(e),o=[1,0,0],l=xe(n,a),s=me(l,l),c=l[0],u=s-c*c;if(!u)return!r&&t;var f=i*s/u,d=-i*c/u,p=xe(o,l),h=_e(o,f);be(h,_e(l,d));var g=p,v=me(h,g),y=me(g,g),m=v*v-y*(me(h,h)-1);if(!(m<0)){var x=Math.sqrt(m),b=_e(g,(-v-x)/y);if(be(b,h),b=ke(b),!r)return b;var _,w=t[0],k=e[0],M=t[1],A=e[1];k<w&&(_=w,w=k,k=_);var T=k-w,L=bo(T-jo)<Ro,C=L||T<Ro;if(!L&&A<M&&(_=M,M=A,A=_),C?L?M+A>0^b[1]<(bo(b[0]-w)<Ro?M:A):M<=b[1]&&b[1]<=A:T>jo^(w<=b[0]&&b[0]<=k)){var S=_e(g,(-v+x)/y);return be(S,h),[b,ke(S)]}}}function a(e,r){var n=o?t:jo-t,a=0;return e<-n?a|=1:e>n&&(a|=2),r<-n?a|=4:r>n&&(a|=8),a}var i=Math.cos(t),o=i>0,l=bo(i)>Ro;return Ne(e,r,vr(t,6*Vo),o?[0,-t]:[-jo,t-jo])}function Ue(t,e,r,n){return function(a){var i,o=a.a,l=a.b,s=o.x,c=o.y,u=l.x,f=l.y,d=0,p=1,h=u-s,g=f-c;if(i=t-s,h||!(i>0)){if(i/=h,h<0){if(i<d)return;i<p&&(p=i)}else if(h>0){if(i>p)return;i>d&&(d=i)}if(i=r-s,h||!(i<0)){if(i/=h,h<0){if(i>p)return;i>d&&(d=i)}else if(h>0){if(i<d)return;i<p&&(p=i)}if(i=e-c,g||!(i>0)){if(i/=g,g<0){if(i<d)return;i<p&&(p=i)}else if(g>0){if(i>p)return;i>d&&(d=i)}if(i=n-c,g||!(i<0)){if(i/=g,g<0){if(i>p)return;i>d&&(d=i)}else if(g>0){if(i<d)return;i<p&&(p=i)}return d>0&&(a.a={x:s+d*h,y:c+d*g}),p<1&&(a.b={x:s+p*h,y:c+p*g}),a}}}}}}function Ge(t,e,r,n){function a(n,a){return bo(n[0]-t)<Ro?a>0?0:3:bo(n[0]-r)<Ro?a>0?2:1:bo(n[1]-e)<Ro?a>0?1:0:a>0?3:2}function i(t,e){return o(t.x,e.x)}function o(t,e){var r=a(t,1),n=a(e,1);return r!==n?r-n:0===r?e[1]-t[1]:1===r?t[0]-e[0]:2===r?t[1]-e[1]:e[0]-t[0]}return function(l){function s(t){for(var e=0,r=v.length,n=t[1],a=0;a<r;++a)for(var i,o=1,l=v[a],s=l.length,c=l[0];o<s;++o)i=l[o],c[1]<=n?i[1]>n&&et(c,i,t)>0&&++e:i[1]<=n&&et(c,i,t)<0&&--e,c=i;return 0!==e}function c(i,l,s,c){var u=0,f=0;if(null==i||(u=a(i,s))!==(f=a(l,s))||o(i,l)<0^s>0)do{c.point(0===u||3===u?t:r,u>1?n:e)}while((u=(u+s+4)%4)!==f);else c.point(l[0],l[1])}function u(a,i){return t<=a&&a<=r&&e<=i&&i<=n}function f(t,e){u(t,e)&&l.point(t,e)}function d(){S.point=h,v&&v.push(y=[]),M=!0,k=!1,_=w=NaN}function p(){g&&(h(m,x),b&&k&&L.rejoin(),g.push(L.buffer())),S.point=f,k&&l.lineEnd()}function h(t,e){t=Math.max(-Fl,Math.min(Fl,t)),e=Math.max(-Fl,Math.min(Fl,e));var r=u(t,e);if(v&&y.push([t,e]),M)m=t,x=e,b=r,M=!1,r&&(l.lineStart(),l.point(t,e));else if(r&&k)l.point(t,e);else{var n={a:{x:_,y:w},b:{x:t,y:e}};C(n)?(k||(l.lineStart(),l.point(n.a.x,n.a.y)),l.point(n.b.x,n.b.y),r||l.lineEnd(),A=!1):r&&(l.lineStart(),l.point(t,e),A=!1)}_=t,w=e,k=r}var g,v,y,m,x,b,_,w,k,M,A,T=l,L=Re(),C=Ue(t,e,r,n),S={point:f,lineStart:d,lineEnd:p,polygonStart:function(){l=L,g=[],v=[],A=!0},polygonEnd:function(){l=T,g=co.merge(g);var e=s([t,n]),r=A&&e,a=g.length;(r||a)&&(l.polygonStart(),r&&(l.lineStart(),c(null,null,1,l),l.lineEnd()),a&&De(g,i,e,c,l),l.polygonEnd()),g=v=y=null}};return S}}function Xe(t){var e=0,r=jo/3,n=sr(t),a=n(e,r);return a.parallels=function(t){return arguments.length?n(e=t[0]*jo/180,r=t[1]*jo/180):[e/jo*180,r/jo*180]},a}function Ye(t,e){function r(t,e){var r=Math.sqrt(i-2*a*Math.sin(e))/a;return[r*Math.sin(t*=a),o-r*Math.cos(t)]}var n=Math.sin(t),a=(n+Math.sin(e))/2,i=1+n*(2*a-n),o=Math.sqrt(i)/a;return r.invert=function(t,e){var r=o-e;return[Math.atan2(t,r)/a,nt((i-(t*t+r*r)*a*a)/(2*a))]},r}function Ze(){function t(t,e){Bl+=a*t-n*e,n=t,a=e}var e,r,n,a;Gl.point=function(i,o){Gl.point=t,e=n=i,r=a=o},Gl.lineEnd=function(){t(e,r)}}function We(t,e){t<ql&&(ql=t),t>Vl&&(Vl=t),e<Hl&&(Hl=e),e>Ul&&(Ul=e)}function Qe(){function t(t,e){o.push("M",t,",",e,i)}function e(t,e){o.push("M",t,",",e),l.point=r}function r(t,e){o.push("L",t,",",e)}function n(){l.point=t}function a(){o.push("Z")}var i=$e(4.5),o=[],l={point:t,lineStart:function(){l.point=e},lineEnd:n,polygonStart:function(){l.lineEnd=a},polygonEnd:function(){l.lineEnd=n,l.point=t},pointRadius:function(t){return i=$e(t),l},result:function(){if(o.length){var t=o.join("");return o=[],t}}};return l}function $e(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}function Je(t,e){Ll+=t,Cl+=e,++Sl}function Ke(){function t(t,n){var a=t-e,i=n-r,o=Math.sqrt(a*a+i*i);Ol+=o*(e+t)/2,zl+=o*(r+n)/2,Dl+=o,Je(e=t,r=n)}var e,r;Yl.point=function(n,a){Yl.point=t,Je(e=n,r=a)}}function tr(){Yl.point=Je}function er(){function t(t,e){var r=t-n,i=e-a,o=Math.sqrt(r*r+i*i);Ol+=o*(n+t)/2,zl+=o*(a+e)/2,Dl+=o,o=a*t-n*e,Pl+=o*(n+t),El+=o*(a+e),Nl+=3*o,Je(n=t,a=e)}var e,r,n,a;Yl.point=function(i,o){Yl.point=t,Je(e=n=i,r=a=o)},Yl.lineEnd=function(){t(e,r)}}function rr(t){function e(e,r){t.moveTo(e+o,r),t.arc(e,r,o,0,Bo)}function r(e,r){t.moveTo(e,r),l.point=n}function n(e,r){t.lineTo(e,r)}function a(){l.point=e}function i(){t.closePath()}var o=4.5,l={point:e,lineStart:function(){l.point=r},lineEnd:a,polygonStart:function(){l.lineEnd=i},polygonEnd:function(){l.lineEnd=a,l.point=e},pointRadius:function(t){return o=t,l},result:k};return l}function nr(t){function e(t){return(l?n:r)(t)}function r(e){return or(e,function(r,n){r=t(r,n),e.point(r[0],r[1])})}function n(e){function r(r,n){r=t(r,n),e.point(r[0],r[1])}function n(){x=NaN,M.point=i,e.lineStart()}function i(r,n){var i=ye([r,n]),o=t(r,n);a(x,b,m,_,w,k,x=o[0],b=o[1],m=r,_=i[0],w=i[1],k=i[2],l,e),e.point(x,b)}function o(){M.point=r,e.lineEnd()}function s(){n(),M.point=c,M.lineEnd=u}function c(t,e){i(f=t,d=e),p=x,h=b,g=_,v=w,y=k,M.point=i}function u(){a(x,b,m,_,w,k,p,h,f,g,v,y,l,e),M.lineEnd=o,o()}var f,d,p,h,g,v,y,m,x,b,_,w,k,M={point:r,lineStart:n,lineEnd:o,polygonStart:function(){e.polygonStart(),M.lineStart=s},polygonEnd:function(){e.polygonEnd(),M.lineStart=n}};return M}function a(e,r,n,l,s,c,u,f,d,p,h,g,v,y){var m=u-e,x=f-r,b=m*m+x*x;if(b>4*i&&v--){var _=l+p,w=s+h,k=c+g,M=Math.sqrt(_*_+w*w+k*k),A=Math.asin(k/=M),T=bo(bo(k)-1)<Ro||bo(n-d)<Ro?(n+d)/2:Math.atan2(w,_),L=t(T,A),C=L[0],S=L[1],O=C-e,z=S-r,D=x*O-m*z;(D*D/b>i||bo((m*O+x*z)/b-.5)>.3||l*p+s*h+c*g<o)&&(a(e,r,n,l,s,c,C,S,T,_/=M,w/=M,k,v,y),y.point(C,S),a(C,S,T,_,w,k,u,f,d,p,h,g,v,y))}}var i=.5,o=Math.cos(30*Vo),l=16;return e.precision=function(t){return arguments.length?(l=(i=t*t)>0&&16,e):Math.sqrt(i)},e}function ar(t){var e=nr(function(e,r){return t([e*Uo,r*Uo])});return function(t){return cr(e(t))}}function ir(t){this.stream=t}function or(t,e){return{point:e,sphere:function(){t.sphere()},lineStart:function(){t.lineStart()},lineEnd:function(){t.lineEnd()},polygonStart:function(){t.polygonStart()},polygonEnd:function(){t.polygonEnd()}}}function lr(t){return sr(function(){return t})()}function sr(t){function e(t){return t=l(t[0]*Vo,t[1]*Vo),[t[0]*d+s,c-t[1]*d]}function r(t){return(t=l.invert((t[0]-s)/d,(c-t[1])/d))&&[t[0]*Uo,t[1]*Uo]}function n(){l=Oe(o=dr(y,m,x),i);var t=i(g,v);return s=p-t[0]*d,c=h+t[1]*d,a()}function a(){return u&&(u.valid=!1,u=null),e}var i,o,l,s,c,u,f=nr(function(t,e){return t=i(t,e),[t[0]*d+s,c-t[1]*d]}),d=150,p=480,h=250,g=0,v=0,y=0,m=0,x=0,_=Rl,w=b,k=null,M=null;return e.stream=function(t){return u&&(u.valid=!1),u=cr(_(o,f(w(t)))),u.valid=!0,u},e.clipAngle=function(t){return arguments.length?(_=null==t?(k=t,Rl):Ve((k=+t)*Vo),a()):k},e.clipExtent=function(t){return arguments.length?(M=t,w=t?Ge(t[0][0],t[0][1],t[1][0],t[1][1]):b,a()):M},e.scale=function(t){return arguments.length?(d=+t,n()):d},e.translate=function(t){return arguments.length?(p=+t[0],h=+t[1],n()):[p,h]},e.center=function(t){return arguments.length?(g=t[0]%360*Vo,v=t[1]%360*Vo,n()):[g*Uo,v*Uo]},e.rotate=function(t){return arguments.length?(y=t[0]%360*Vo,m=t[1]%360*Vo,x=t.length>2?t[2]%360*Vo:0,n()):[y*Uo,m*Uo,x*Uo]},co.rebind(e,f,"precision"),function(){return i=t.apply(this,arguments),e.invert=i.invert&&r,n()}}function cr(t){return or(t,function(e,r){t.point(e*Vo,r*Vo)})}function ur(t,e){return[t,e]}function fr(t,e){return[t>jo?t-Bo:t<-jo?t+Bo:t,e]}function dr(t,e,r){return t?e||r?Oe(hr(t),gr(e,r)):hr(t):e||r?gr(e,r):fr}function pr(t){return function(e,r){return e+=t,[e>jo?e-Bo:e<-jo?e+Bo:e,r]}}function hr(t){var e=pr(t);return e.invert=pr(-t),e}function gr(t,e){function r(t,e){var r=Math.cos(e),l=Math.cos(t)*r,s=Math.sin(t)*r,c=Math.sin(e),u=c*n+l*a;return[Math.atan2(s*i-u*o,l*n-c*a),nt(u*i+s*o)]}var n=Math.cos(t),a=Math.sin(t),i=Math.cos(e),o=Math.sin(e);return r.invert=function(t,e){var r=Math.cos(e),l=Math.cos(t)*r,s=Math.sin(t)*r,c=Math.sin(e),u=c*i-s*o;return[Math.atan2(s*i+c*o,l*n+u*a),nt(u*n-l*a)]},r}function vr(t,e){var r=Math.cos(t),n=Math.sin(t);return function(a,i,o,l){var s=o*e;null!=a?(a=yr(r,a),i=yr(r,i),(o>0?a<i:a>i)&&(a+=o*Bo)):(a=t+o*Bo,i=t-.5*s);for(var c,u=a;o>0?u>i:u<i;u-=s)l.point((c=ke([r,-n*Math.cos(u),-n*Math.sin(u)]))[0],c[1])}}function yr(t,e){var r=ye(e);r[0]-=t,we(r);var n=rt(-r[1]);return((-r[2]<0?-n:n)+2*Math.PI-Ro)%(2*Math.PI)}function mr(t,e,r){var n=co.range(t,e-Ro,r).concat(e);return function(t){return n.map(function(e){return[t,e]})}}function xr(t,e,r){var n=co.range(t,e-Ro,r).concat(e);return function(t){return n.map(function(e){return[e,t]})}}function br(t){return t.source}function _r(t){return t.target}function wr(t,e,r,n){var a=Math.cos(e),i=Math.sin(e),o=Math.cos(n),l=Math.sin(n),s=a*Math.cos(t),c=a*Math.sin(t),u=o*Math.cos(r),f=o*Math.sin(r),d=2*Math.asin(Math.sqrt(lt(n-e)+a*o*lt(r-t))),p=1/Math.sin(d),h=d?function(t){var e=Math.sin(t*=d)*p,r=Math.sin(d-t)*p,n=r*s+e*u,a=r*c+e*f,o=r*i+e*l;return[Math.atan2(a,n)*Uo,Math.atan2(o,Math.sqrt(n*n+a*a))*Uo]}:function(){return[t*Uo,e*Uo]};return h.distance=d,h}function kr(){function t(t,a){var i=Math.sin(a*=Vo),o=Math.cos(a),l=bo((t*=Vo)-e),s=Math.cos(l);Zl+=Math.atan2(Math.sqrt((l=o*Math.sin(l))*l+(l=n*i-r*o*s)*l),r*i+n*o*s),e=t,r=i,n=o}var e,r,n;Wl.point=function(a,i){e=a*Vo,r=Math.sin(i*=Vo),n=Math.cos(i),Wl.point=t},Wl.lineEnd=function(){Wl.point=Wl.lineEnd=k}}function Mr(t,e){function r(e,r){var n=Math.cos(e),a=Math.cos(r),i=t(n*a);return[i*a*Math.sin(e),i*Math.sin(r)]}return r.invert=function(t,r){var n=Math.sqrt(t*t+r*r),a=e(n),i=Math.sin(a),o=Math.cos(a);return[Math.atan2(t*i,n*o),Math.asin(n&&r*i/n)]},r}function Ar(t,e){function r(t,e){o>0?e<-Ho+Ro&&(e=-Ho+Ro):e>Ho-Ro&&(e=Ho-Ro);var r=o/Math.pow(a(e),i);return[r*Math.sin(i*t),o-r*Math.cos(i*t)]}var n=Math.cos(t),a=function(t){return Math.tan(jo/4+t/2)},i=t===e?Math.sin(t):Math.log(n/Math.cos(e))/Math.log(a(e)/a(t)),o=n*Math.pow(a(t),i)/i;return i?(r.invert=function(t,e){var r=o-e,n=tt(i)*Math.sqrt(t*t+r*r);return[Math.atan2(t,r)/i,2*Math.atan(Math.pow(o/n,1/i))-Ho]},r):Lr}function Tr(t,e){function r(t,e){var r=i-e;return[r*Math.sin(a*t),i-r*Math.cos(a*t)]}var n=Math.cos(t),a=t===e?Math.sin(t):(n-Math.cos(e))/(e-t),i=n/a+t;return bo(a)<Ro?ur:(r.invert=function(t,e){var r=i-e;return[Math.atan2(t,r)/a,i-tt(a)*Math.sqrt(t*t+r*r)]},r)}function Lr(t,e){return[t,Math.log(Math.tan(jo/4+e/2))]}function Cr(t){var e,r=lr(t),n=r.scale,a=r.translate,i=r.clipExtent;return r.scale=function(){var t=n.apply(r,arguments);return t===r?e?r.clipExtent(null):r:t},r.translate=function(){var t=a.apply(r,arguments);return t===r?e?r.clipExtent(null):r:t},r.clipExtent=function(t){var o=i.apply(r,arguments);if(o===r){if(e=null==t){var l=jo*n(),s=a();i([[s[0]-l,s[1]-l],[s[0]+l,s[1]+l]])}}else e&&(o=null);return o},r.clipExtent(null)}function Sr(t,e){return[Math.log(Math.tan(jo/4+e/2)),-t]}function Or(t){return t[0]}function zr(t){return t[1]}function Dr(t){for(var e=t.length,r=[0,1],n=2,a=2;a<e;a++){for(;n>1&&et(t[r[n-2]],t[r[n-1]],t[a])<=0;)--n;r[n++]=a}return r.slice(0,n)}function Pr(t,e){return t[0]-e[0]||t[1]-e[1]}function Er(t,e,r){return(r[0]-e[0])*(t[1]-e[1])<(r[1]-e[1])*(t[0]-e[0])}function Nr(t,e,r,n){var a=t[0],i=r[0],o=e[0]-a,l=n[0]-i,s=t[1],c=r[1],u=e[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 Ir(t){var e=t[0],r=t[t.length-1];return!(e[0]-r[0]||e[1]-r[1])}function Rr(){an(this),this.edge=this.site=this.circle=null}function Fr(t){var e=ls.pop()||new Rr;return e.site=t,e}function jr(t){Wr(t),as.remove(t),ls.push(t),an(t)}function Br(t){var e=t.circle,r=e.x,n=e.cy,a={x:r,y:n},i=t.P,o=t.N,l=[t];jr(t);for(var s=i;s.circle&&bo(r-s.circle.x)<Ro&&bo(n-s.circle.cy)<Ro;)i=s.P,l.unshift(s),jr(s),s=i;l.unshift(s),Wr(s);for(var c=o;c.circle&&bo(r-c.circle.x)<Ro&&bo(n-c.circle.cy)<Ro;)o=c.N,l.push(c),jr(c),c=o;l.push(c),Wr(c);var u,f=l.length;for(u=1;u<f;++u)c=l[u],s=l[u-1],en(c.edge,s.site,c.site,a);s=l[0],c=l[f-1],c.edge=Kr(s.site,c.site,null,a),Zr(s),Zr(c)}function qr(t){for(var e,r,n,a,i=t.x,o=t.y,l=as._;l;)if((n=Hr(l,o)-i)>Ro)l=l.L;else{if(!((a=i-Vr(l,o))>Ro)){n>-Ro?(e=l.P,r=l):a>-Ro?(e=l,r=l.N):e=r=l;break}if(!l.R){e=l;break}l=l.R}var s=Fr(t);if(as.insert(e,s),e||r){if(e===r)return Wr(e),r=Fr(e.site),as.insert(s,r),s.edge=r.edge=Kr(e.site,s.site),Zr(e),void Zr(r);if(!r)return void(s.edge=Kr(e.site,s.site));Wr(e),Wr(r);var c=e.site,u=c.x,f=c.y,d=t.x-u,p=t.y-f,h=r.site,g=h.x-u,v=h.y-f,y=2*(d*v-p*g),m=d*d+p*p,x=g*g+v*v,b={x:(v*m-p*x)/y+u,y:(d*x-g*m)/y+f};en(r.edge,c,h,b),s.edge=Kr(c,t,null,b),r.edge=Kr(t,h,null,b),Zr(e),Zr(r)}}function Hr(t,e){var r=t.site,n=r.x,a=r.y,i=a-e;if(!i)return n;var o=t.P;if(!o)return-1/0;r=o.site;var l=r.x,s=r.y,c=s-e;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 Vr(t,e){var r=t.N;if(r)return Hr(r,e);var n=t.site;return n.y===e?n.x:1/0}function Ur(t){this.site=t,this.edges=[]}function Gr(t){for(var e,r,n,a,i,o,l,s,c,u,f=t[0][0],d=t[1][0],p=t[0][1],h=t[1][1],g=ns,v=g.length;v--;)if((i=g[v])&&i.prepare())for(l=i.edges,s=l.length,o=0;o<s;)u=l[o].end(),n=u.x,a=u.y,c=l[++o%s].start(),e=c.x,r=c.y,(bo(n-e)>Ro||bo(a-r)>Ro)&&(l.splice(o,0,new rn(tn(i.site,u,bo(n-f)<Ro&&h-a>Ro?{x:f,y:bo(e-f)<Ro?r:h}:bo(a-h)<Ro&&d-n>Ro?{x:bo(r-h)<Ro?e:d,y:h}:bo(n-d)<Ro&&a-p>Ro?{x:d,y:bo(e-d)<Ro?r:p}:bo(a-p)<Ro&&n-f>Ro?{x:bo(r-p)<Ro?e:f,y:p}:null),i.site,null)),++s)}function Xr(t,e){return e.angle-t.angle}function Yr(){an(this),this.x=this.y=this.arc=this.site=this.cy=null}function Zr(t){var e=t.P,r=t.N;if(e&&r){var n=e.site,a=t.site,i=r.site;if(n!==i){var o=a.x,l=a.y,s=n.x-o,c=n.y-l,u=i.x-o,f=i.y-l,d=2*(s*f-c*u);if(!(d>=-Fo)){var p=s*s+c*c,h=u*u+f*f,g=(f*p-c*h)/d,v=(s*h-u*p)/d,f=v+l,y=ss.pop()||new Yr;y.arc=t,y.site=a,y.x=g+o,y.y=f+Math.sqrt(g*g+v*v),y.cy=f,t.circle=y;for(var m=null,x=os._;x;)if(y.y<x.y||y.y===x.y&&y.x<=x.x){if(!x.L){m=x.P;break}x=x.L}else{if(!x.R){m=x;break}x=x.R}os.insert(m,y),m||(is=y)}}}}function Wr(t){var e=t.circle;e&&(e.P||(is=e.N),os.remove(e),ss.push(e),an(e),t.circle=null)}function Qr(t){for(var e,r=rs,n=Ue(t[0][0],t[0][1],t[1][0],t[1][1]),a=r.length;a--;)e=r[a],(!$r(e,t)||!n(e)||bo(e.a.x-e.b.x)<Ro&&bo(e.a.y-e.b.y)<Ro)&&(e.a=e.b=null,r.splice(a,1))}function $r(t,e){var r=t.b;if(r)return!0;var n,a,i=t.a,o=e[0][0],l=e[1][0],s=e[0][1],c=e[1][1],u=t.l,f=t.r,d=u.x,p=u.y,h=f.x,g=f.y,v=(d+h)/2,y=(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(n=(d-h)/(g-p),a=y-n*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 t.a=i,t.b=r,!0}function Jr(t,e){this.l=t,this.r=e,this.a=this.b=null}function Kr(t,e,r,n){var a=new Jr(t,e);return rs.push(a),r&&en(a,t,e,r),n&&en(a,e,t,n),ns[t.i].edges.push(new rn(a,t,e)),ns[e.i].edges.push(new rn(a,e,t)),a}function tn(t,e,r){var n=new Jr(t,null);return n.a=e,n.b=r,rs.push(n),n}function en(t,e,r,n){t.a||t.b?t.l===r?t.b=n:t.a=n:(t.a=n,t.l=e,t.r=r)}function rn(t,e,r){var n=t.a,a=t.b;this.edge=t,this.site=e,this.angle=r?Math.atan2(r.y-e.y,r.x-e.x):t.l===e?Math.atan2(a.x-n.x,n.y-a.y):Math.atan2(n.x-a.x,a.y-n.y)}function nn(){this._=null}function an(t){t.U=t.C=t.L=t.R=t.P=t.N=null}function on(t,e){var r=e,n=e.R,a=r.U;a?a.L===r?a.L=n:a.R=n:t._=n,n.U=a,r.U=n,r.R=n.L,r.R&&(r.R.U=r),n.L=r}function ln(t,e){var r=e,n=e.L,a=r.U;a?a.L===r?a.L=n:a.R=n:t._=n,n.U=a,r.U=n,r.L=n.R,r.L&&(r.L.U=r),n.R=r}function sn(t){for(;t.L;)t=t.L;return t}function cn(t,e){var r,n,a,i=t.sort(un).pop();for(rs=[],ns=new Array(t.length),as=new nn,os=new nn;;)if(a=is,i&&(!a||i.y<a.y||i.y===a.y&&i.x<a.x))i.x===r&&i.y===n||(ns[i.i]=new Ur(i),qr(i),r=i.x,n=i.y),i=t.pop();else{if(!a)break;Br(a.arc)}e&&(Qr(e),Gr(e));var o={cells:ns,edges:rs};return as=os=rs=ns=null,o}function un(t,e){return e.y-t.y||e.x-t.x}function fn(t,e,r){return(t.x-r.x)*(e.y-t.y)-(t.x-e.x)*(r.y-t.y)}function dn(t){return t.x}function pn(t){return t.y}function hn(){return{leaf:!0,nodes:[],point:null,x:null,y:null}}function gn(t,e,r,n,a,i){if(!t(e,r,n,a,i)){var o=.5*(r+a),l=.5*(n+i),s=e.nodes;s[0]&&gn(t,s[0],r,n,o,l),s[1]&&gn(t,s[1],o,n,a,l),s[2]&&gn(t,s[2],r,l,o,i),s[3]&&gn(t,s[3],o,l,a,i)}}function vn(t,e,r,n,a,i,o){var l,s=1/0;return function t(c,u,f,d,p){if(!(u>i||f>o||d<n||p<a)){if(h=c.point){var h,g=e-c.x,v=r-c.y,y=g*g+v*v;if(y<s){var m=Math.sqrt(s=y);n=e-m,a=r-m,i=e+m,o=r+m,l=h}}for(var x=c.nodes,b=.5*(u+d),_=.5*(f+p),w=e>=b,k=r>=_,M=k<<1|w,A=M+4;M<A;++M)if(c=x[3&M])switch(3&M){case 0:t(c,u,f,b,_);break;case 1:t(c,b,f,d,_);break;case 2:t(c,u,_,b,p);break;case 3:t(c,b,_,d,p)}}}(t,n,a,i,o),l}function yn(t,e){t=co.rgb(t),e=co.rgb(e);var r=t.r,n=t.g,a=t.b,i=e.r-r,o=e.g-n,l=e.b-a;return function(t){return"#"+wt(Math.round(r+i*t))+wt(Math.round(n+o*t))+wt(Math.round(a+l*t))}}function mn(t,e){var r,n={},a={};for(r in t)r in e?n[r]=_n(t[r],e[r]):a[r]=t[r];for(r in e)r in t||(a[r]=e[r]);return function(t){for(r in n)a[r]=n[r](t);return a}}function xn(t,e){return t=+t,e=+e,function(r){return t*(1-r)+e*r}}function bn(t,e){var r,n,a,i=us.lastIndex=fs.lastIndex=0,o=-1,l=[],s=[];for(t+="",e+="";(r=us.exec(t))&&(n=fs.exec(e));)(a=n.index)>i&&(a=e.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:xn(r,n)})),i=fs.lastIndex;return i<e.length&&(a=e.slice(i),l[o]?l[o]+=a:l[++o]=a),l.length<2?s[0]?(e=s[0].x,function(t){return e(t)+""}):function(){return e}:(e=s.length,function(t){for(var r,n=0;n<e;++n)l[(r=s[n]).i]=r.x(t);return l.join("")})}function _n(t,e){for(var r,n=co.interpolators.length;--n>=0&&!(r=co.interpolators[n](t,e)););return r}function wn(t,e){var r,n=[],a=[],i=t.length,o=e.length,l=Math.min(t.length,e.length);for(r=0;r<l;++r)n.push(_n(t[r],e[r]));for(;r<i;++r)a[r]=t[r];for(;r<o;++r)a[r]=e[r];return function(t){for(r=0;r<l;++r)a[r]=n[r](t);return a}}function kn(t){return function(e){return e<=0?0:e>=1?1:t(e)}}function Mn(t){return function(e){return 1-t(1-e)}}function An(t){return function(e){return.5*(e<.5?t(2*e):2-t(2-2*e))}}function Tn(t){return t*t}function Ln(t){return t*t*t}function Cn(t){if(t<=0)return 0;if(t>=1)return 1;var e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)}function Sn(t){return function(e){return Math.pow(e,t)}}function On(t){return 1-Math.cos(t*Ho)}function zn(t){return Math.pow(2,10*(t-1))}function Dn(t){return 1-Math.sqrt(1-t*t)}function Pn(t,e){var r;return arguments.length<2&&(e=.45),arguments.length?r=e/Bo*Math.asin(1/t):(t=1,r=e/4),function(n){return 1+t*Math.pow(2,-10*n)*Math.sin((n-r)*Bo/e)}}function En(t){return t||(t=1.70158),function(e){return e*e*((t+1)*e-t)}}function Nn(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}function In(t,e){t=co.hcl(t),e=co.hcl(e);var r=t.h,n=t.c,a=t.l,i=e.h-r,o=e.c-n,l=e.l-a;return isNaN(o)&&(o=0,n=isNaN(n)?e.c:n),isNaN(i)?(i=0,r=isNaN(r)?e.h:r):i>180?i-=360:i<-180&&(i+=360),function(t){return dt(r+i*t,n+o*t,a+l*t)+""}}function Rn(t,e){t=co.hsl(t),e=co.hsl(e);var r=t.h,n=t.s,a=t.l,i=e.h-r,o=e.s-n,l=e.l-a;return isNaN(o)&&(o=0,n=isNaN(n)?e.s:n),isNaN(i)?(i=0,r=isNaN(r)?e.h:r):i>180?i-=360:i<-180&&(i+=360),function(t){return ut(r+i*t,n+o*t,a+l*t)+""}}function Fn(t,e){t=co.lab(t),e=co.lab(e);var r=t.l,n=t.a,a=t.b,i=e.l-r,o=e.a-n,l=e.b-a;return function(t){return ht(r+i*t,n+o*t,a+l*t)+""}}function jn(t,e){return e-=t,function(r){return Math.round(t+e*r)}}function Bn(t){var e=[t.a,t.b],r=[t.c,t.d],n=Hn(e),a=qn(e,r),i=Hn(Vn(r,e,-a))||0;e[0]*r[1]<r[0]*e[1]&&(e[0]*=-1,e[1]*=-1,n*=-1,a*=-1),this.rotate=(n?Math.atan2(e[1],e[0]):Math.atan2(-r[0],r[1]))*Uo,this.translate=[t.e,t.f],this.scale=[n,i],this.skew=i?Math.atan2(a,i)*Uo:0}function qn(t,e){return t[0]*e[0]+t[1]*e[1]}function Hn(t){var e=Math.sqrt(qn(t,t));return e&&(t[0]/=e,t[1]/=e),e}function Vn(t,e,r){return t[0]+=r*e[0],t[1]+=r*e[1],t}function Un(t){return t.length?t.pop()+",":""}function Gn(t,e,r,n){if(t[0]!==e[0]||t[1]!==e[1]){var a=r.push("translate(",null,",",null,")");n.push({i:a-4,x:xn(t[0],e[0])},{i:a-2,x:xn(t[1],e[1])})}else(e[0]||e[1])&&r.push("translate("+e+")")}function Xn(t,e,r,n){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),n.push({i:r.push(Un(r)+"rotate(",null,")")-2,x:xn(t,e)})):e&&r.push(Un(r)+"rotate("+e+")")}function Yn(t,e,r,n){t!==e?n.push({i:r.push(Un(r)+"skewX(",null,")")-2,x:xn(t,e)}):e&&r.push(Un(r)+"skewX("+e+")")}function Zn(t,e,r,n){if(t[0]!==e[0]||t[1]!==e[1]){var a=r.push(Un(r)+"scale(",null,",",null,")");n.push({i:a-4,x:xn(t[0],e[0])},{i:a-2,x:xn(t[1],e[1])})}else 1===e[0]&&1===e[1]||r.push(Un(r)+"scale("+e+")")}function Wn(t,e){var r=[],n=[];return t=co.transform(t),e=co.transform(e),Gn(t.translate,e.translate,r,n),Xn(t.rotate,e.rotate,r,n),Yn(t.skew,e.skew,r,n),Zn(t.scale,e.scale,r,n),t=e=null,function(t){for(var e,a=-1,i=n.length;++a<i;)r[(e=n[a]).i]=e.x(t);return r.join("")}}function Qn(t,e){return e=(e-=t=+t)||1/e,function(r){return(r-t)/e}}function $n(t,e){return e=(e-=t=+t)||1/e,function(r){return Math.max(0,Math.min(1,(r-t)/e))}}function Jn(t){for(var e=t.source,r=t.target,n=ta(e,r),a=[e];e!==n;)e=e.parent,a.push(e);for(var i=a.length;r!==n;)a.splice(i,0,r),r=r.parent;return a}function Kn(t){for(var e=[],r=t.parent;null!=r;)e.push(t),t=r,r=r.parent;return e.push(t),e}function ta(t,e){if(t===e)return t;for(var r=Kn(t),n=Kn(e),a=r.pop(),i=n.pop(),o=null;a===i;)o=a,a=r.pop(),i=n.pop();return o}function ea(t){t.fixed|=2}function ra(t){t.fixed&=-7}function na(t){t.fixed|=4,t.px=t.x,t.py=t.y}function aa(t){t.fixed&=-5}function ia(t,e,r){var n=0,a=0;if(t.charge=0,!t.leaf)for(var i,o=t.nodes,l=o.length,s=-1;++s<l;)null!=(i=o[s])&&(ia(i,e,r),t.charge+=i.charge,n+=i.charge*i.cx,a+=i.charge*i.cy);if(t.point){t.leaf||(t.point.x+=Math.random()-.5,t.point.y+=Math.random()-.5);var c=e*r[t.point.index];t.charge+=t.pointCharge=c,n+=c*t.point.x,a+=c*t.point.y}t.cx=n/t.charge,t.cy=a/t.charge}function oa(t,e){return co.rebind(t,e,"sort","children","value"),t.nodes=t,t.links=da,t}function la(t,e){for(var r=[t];null!=(t=r.pop());)if(e(t),(a=t.children)&&(n=a.length))for(var n,a;--n>=0;)r.push(a[n])}function sa(t,e){for(var r=[t],n=[];null!=(t=r.pop());)if(n.push(t),(i=t.children)&&(a=i.length))for(var a,i,o=-1;++o<a;)r.push(i[o]);for(;null!=(t=n.pop());)e(t)}function ca(t){return t.children}function ua(t){return t.value}function fa(t,e){return e.value-t.value}function da(t){return co.merge(t.map(function(t){return(t.children||[]).map(function(e){return{source:t,target:e}})}))}function pa(t){return t.x}function ha(t){return t.y}function ga(t,e,r){t.y0=e,t.y=r}function va(t){return co.range(t.length)}function ya(t){for(var e=-1,r=t[0].length,n=[];++e<r;)n[e]=0;return n}function ma(t){for(var e,r=1,n=0,a=t[0][1],i=t.length;r<i;++r)(e=t[r][1])>a&&(n=r,a=e);return n}function xa(t){return t.reduce(ba,0)}function ba(t,e){return t+e[1]}function _a(t,e){return wa(t,Math.ceil(Math.log(e.length)/Math.LN2+1))}function wa(t,e){for(var r=-1,n=+t[0],a=(t[1]-n)/e,i=[];++r<=e;)i[r]=a*r+n;return i}function ka(t){return[co.min(t),co.max(t)]}function Ma(t,e){return t.value-e.value}function Aa(t,e){var r=t._pack_next;t._pack_next=e,e._pack_prev=t,e._pack_next=r,r._pack_prev=e}function Ta(t,e){t._pack_next=e,e._pack_prev=t}function La(t,e){var r=e.x-t.x,n=e.y-t.y,a=t.r+e.r;return.999*a*a>r*r+n*n}function Ca(t){function e(t){u=Math.min(t.x-t.r,u),f=Math.max(t.x+t.r,f),d=Math.min(t.y-t.r,d),p=Math.max(t.y+t.r,p)}if((r=t.children)&&(c=r.length)){var r,n,a,i,o,l,s,c,u=1/0,f=-1/0,d=1/0,p=-1/0;if(r.forEach(Sa),n=r[0],n.x=-n.r,n.y=0,e(n),c>1&&(a=r[1],a.x=a.r,a.y=0,e(a),c>2))for(i=r[2],Da(n,a,i),e(i),Aa(n,i),n._pack_prev=i,Aa(i,a),a=n._pack_next,o=3;o<c;o++){Da(n,a,i=r[o]);var h=0,g=1,v=1;for(l=a._pack_next;l!==a;l=l._pack_next,g++)if(La(l,i)){h=1;break}if(1==h)for(s=n._pack_prev;s!==l._pack_prev&&!La(s,i);s=s._pack_prev,v++);h?(g<v||g==v&&a.r<n.r?Ta(n,a=l):Ta(n=s,a),o--):(Aa(n,i),a=i,e(i))}var y=(u+f)/2,m=(d+p)/2,x=0;for(o=0;o<c;o++)i=r[o],i.x-=y,i.y-=m,x=Math.max(x,i.r+Math.sqrt(i.x*i.x+i.y*i.y));t.r=x,r.forEach(Oa)}}function Sa(t){t._pack_next=t._pack_prev=t}function Oa(t){delete t._pack_next,delete t._pack_prev}function za(t,e,r,n){var a=t.children;if(t.x=e+=n*t.x,t.y=r+=n*t.y,t.r*=n, a)for(var i=-1,o=a.length;++i<o;)za(a[i],e,r,n)}function Da(t,e,r){var n=t.r+r.r,a=e.x-t.x,i=e.y-t.y;if(n&&(a||i)){var o=e.r+r.r,l=a*a+i*i;o*=o,n*=n;var s=.5+(n-o)/(2*l),c=Math.sqrt(Math.max(0,2*o*(n+l)-(n-=l)*n-o*o))/(2*l);r.x=t.x+s*a+c*i,r.y=t.y+s*i-c*a}else r.x=t.x+n,r.y=t.y}function Pa(t,e){return t.parent==e.parent?1:2}function Ea(t){var e=t.children;return e.length?e[0]:t.t}function Na(t){var e,r=t.children;return(e=r.length)?r[e-1]:t.t}function Ia(t,e,r){var n=r/(e.i-t.i);e.c-=n,e.s+=r,t.c+=n,e.z+=r,e.m+=r}function Ra(t){for(var e,r=0,n=0,a=t.children,i=a.length;--i>=0;)e=a[i],e.z+=r,e.m+=r,r+=e.s+(n+=e.c)}function Fa(t,e,r){return t.a.parent===e.parent?t.a:r}function ja(t){return 1+co.max(t,function(t){return t.y})}function Ba(t){return t.reduce(function(t,e){return t+e.x},0)/t.length}function qa(t){var e=t.children;return e&&e.length?qa(e[0]):t}function Ha(t){var e,r=t.children;return r&&(e=r.length)?Ha(r[e-1]):t}function Va(t){return{x:t.x,y:t.y,dx:t.dx,dy:t.dy}}function Ua(t,e){var r=t.x+e[3],n=t.y+e[0],a=t.dx-e[1]-e[3],i=t.dy-e[0]-e[2];return a<0&&(r+=a/2,a=0),i<0&&(n+=i/2,i=0),{x:r,y:n,dx:a,dy:i}}function Ga(t){var e=t[0],r=t[t.length-1];return e<r?[e,r]:[r,e]}function Xa(t){return t.rangeExtent?t.rangeExtent():Ga(t.range())}function Ya(t,e,r,n){var a=r(t[0],t[1]),i=n(e[0],e[1]);return function(t){return i(a(t))}}function Za(t,e){var r,n=0,a=t.length-1,i=t[n],o=t[a];return o<i&&(r=n,n=a,a=r,r=i,i=o,o=r),t[n]=e.floor(i),t[a]=e.ceil(o),t}function Wa(t){return t?{floor:function(e){return Math.floor(e/t)*t},ceil:function(e){return Math.ceil(e/t)*t}}:ws}function Qa(t,e,r,n){var a=[],i=[],o=0,l=Math.min(t.length,e.length)-1;for(t[l]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++o<=l;)a.push(r(t[o-1],t[o])),i.push(n(e[o-1],e[o]));return function(e){var r=co.bisect(t,e,1,l)-1;return i[r](a[r](e))}}function $a(t,e,r,n){function a(){var a=Math.min(t.length,e.length)>2?Qa:Ya,s=n?$n:Qn;return o=a(t,e,s,r),l=a(e,t,s,_n),i}function i(t){return o(t)}var o,l;return i.invert=function(t){return l(t)},i.domain=function(e){return arguments.length?(t=e.map(Number),a()):t},i.range=function(t){return arguments.length?(e=t,a()):e},i.rangeRound=function(t){return i.range(t).interpolate(jn)},i.clamp=function(t){return arguments.length?(n=t,a()):n},i.interpolate=function(t){return arguments.length?(r=t,a()):r},i.ticks=function(e){return ei(t,e)},i.tickFormat=function(e,r){return ri(t,e,r)},i.nice=function(e){return Ka(t,e),a()},i.copy=function(){return $a(t,e,r,n)},a()}function Ja(t,e){return co.rebind(t,e,"range","rangeRound","interpolate","clamp")}function Ka(t,e){return Za(t,Wa(ti(t,e)[2])),Za(t,Wa(ti(t,e)[2])),t}function ti(t,e){null==e&&(e=10);var r=Ga(t),n=r[1]-r[0],a=Math.pow(10,Math.floor(Math.log(n/e)/Math.LN10)),i=e/n*a;return i<=.15?a*=10:i<=.35?a*=5:i<=.75&&(a*=2),r[0]=Math.ceil(r[0]/a)*a,r[1]=Math.floor(r[1]/a)*a+.5*a,r[2]=a,r}function ei(t,e){return co.range.apply(co,ti(t,e))}function ri(t,e,r){var n=ti(t,e);if(r){var a=ul.exec(r);if(a.shift(),"s"===a[8]){var i=co.formatPrefix(Math.max(bo(n[0]),bo(n[1])));return a[7]||(a[7]="."+ni(i.scale(n[2]))),a[8]="f",r=co.format(a.join("")),function(t){return r(i.scale(t))+i.symbol}}a[7]||(a[7]="."+ai(a[8],n)),r=a.join("")}else r=",."+ni(n[2])+"f";return co.format(r)}function ni(t){return-Math.floor(Math.log(t)/Math.LN10+.01)}function ai(t,e){var r=ni(e[2]);return t in ks?Math.abs(r-ni(Math.max(bo(e[0]),bo(e[1]))))+ +("e"!==t):r-2*("%"===t)}function ii(t,e,r,n){function a(t){return(r?Math.log(t<0?0:t):-Math.log(t>0?0:-t))/Math.log(e)}function i(t){return r?Math.pow(e,t):-Math.pow(e,-t)}function o(e){return t(a(e))}return o.invert=function(e){return i(t.invert(e))},o.domain=function(e){return arguments.length?(r=e[0]>=0,t.domain((n=e.map(Number)).map(a)),o):n},o.base=function(r){return arguments.length?(e=+r,t.domain(n.map(a)),o):e},o.nice=function(){var e=Za(n.map(a),r?Math:As);return t.domain(e),n=e.map(i),o},o.ticks=function(){var t=Ga(n),o=[],l=t[0],s=t[1],c=Math.floor(a(l)),u=Math.ceil(a(s)),f=e%1?2:e;if(isFinite(u-c)){if(r){for(;c<u;c++)for(var d=1;d<f;d++)o.push(i(c)*d);o.push(i(c))}else for(o.push(i(c));c++<u;)for(var d=f-1;d>0;d--)o.push(i(c)*d);for(c=0;o[c]<l;c++);for(u=o.length;o[u-1]>s;u--);o=o.slice(c,u)}return o},o.tickFormat=function(t,r){if(!arguments.length)return Ms;arguments.length<2?r=Ms:"function"!=typeof r&&(r=co.format(r));var n=Math.max(1,e*t/o.ticks().length);return function(t){var o=t/i(Math.round(a(t)));return o*e<e-.5&&(o*=e),o<=n?r(t):""}},o.copy=function(){return ii(t.copy(),e,r,n)},Ja(o,t)}function oi(t,e,r){function n(e){return t(a(e))}var a=li(e),i=li(1/e);return n.invert=function(e){return i(t.invert(e))},n.domain=function(e){return arguments.length?(t.domain((r=e.map(Number)).map(a)),n):r},n.ticks=function(t){return ei(r,t)},n.tickFormat=function(t,e){return ri(r,t,e)},n.nice=function(t){return n.domain(Ka(r,t))},n.exponent=function(o){return arguments.length?(a=li(e=o),i=li(1/e),t.domain(r.map(a)),n):e},n.copy=function(){return oi(t.copy(),e,r)},Ja(n,t)}function li(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function si(t,e){function r(r){return i[((a.get(r)||("range"===e.t?a.set(r,t.push(r)):NaN))-1)%i.length]}function n(e,r){return co.range(t.length).map(function(t){return e+r*t})}var a,i,o;return r.domain=function(n){if(!arguments.length)return t;t=[],a=new f;for(var i,o=-1,l=n.length;++o<l;)a.has(i=n[o])||a.set(i,t.push(i));return r[e.t].apply(r,e.a)},r.range=function(t){return arguments.length?(i=t,o=0,e={t:"range",a:arguments},r):i},r.rangePoints=function(a,l){arguments.length<2&&(l=0);var s=a[0],c=a[1],u=t.length<2?(s=(s+c)/2,0):(c-s)/(t.length-1+l);return i=n(s+u*l/2,u),o=0,e={t:"rangePoints",a:arguments},r},r.rangeRoundPoints=function(a,l){arguments.length<2&&(l=0);var s=a[0],c=a[1],u=t.length<2?(s=c=Math.round((s+c)/2),0):(c-s)/(t.length-1+l)|0;return i=n(s+Math.round(u*l/2+(c-s-(t.length-1+l)*u)/2),u),o=0,e={t:"rangeRoundPoints",a:arguments},r},r.rangeBands=function(a,l,s){arguments.length<2&&(l=0),arguments.length<3&&(s=l);var c=a[1]<a[0],u=a[c-0],f=a[1-c],d=(f-u)/(t.length-l+2*s);return i=n(u+d*s,d),c&&i.reverse(),o=d*(1-l),e={t:"rangeBands",a:arguments},r},r.rangeRoundBands=function(a,l,s){arguments.length<2&&(l=0),arguments.length<3&&(s=l);var c=a[1]<a[0],u=a[c-0],f=a[1-c],d=Math.floor((f-u)/(t.length-l+2*s));return i=n(u+Math.round((f-u-(t.length-l)*d)/2),d),c&&i.reverse(),o=Math.round(d*(1-l)),e={t:"rangeRoundBands",a:arguments},r},r.rangeBand=function(){return o},r.rangeExtent=function(){return Ga(e.a[0])},r.copy=function(){return si(t,e)},r.domain(t)}function ci(t,e){function r(){var r=0,a=e.length;for(l=[];++r<a;)l[r-1]=co.quantile(t,r/a);return n}function n(t){if(!isNaN(t=+t))return e[co.bisect(l,t)]}var l;return n.domain=function(e){return arguments.length?(t=e.map(i).filter(o).sort(a),r()):t},n.range=function(t){return arguments.length?(e=t,r()):e},n.quantiles=function(){return l},n.invertExtent=function(r){return r=e.indexOf(r),r<0?[NaN,NaN]:[r>0?l[r-1]:t[0],r<l.length?l[r]:t[t.length-1]]},n.copy=function(){return ci(t,e)},r()}function ui(t,e,r){function n(e){return r[Math.max(0,Math.min(o,Math.floor(i*(e-t))))]}function a(){return i=r.length/(e-t),o=r.length-1,n}var i,o;return n.domain=function(r){return arguments.length?(t=+r[0],e=+r[r.length-1],a()):[t,e]},n.range=function(t){return arguments.length?(r=t,a()):r},n.invertExtent=function(e){return e=r.indexOf(e),e=e<0?NaN:e/i+t,[e,e+1/i]},n.copy=function(){return ui(t,e,r)},a()}function fi(t,e){function r(r){if(r<=r)return e[co.bisect(t,r)]}return r.domain=function(e){return arguments.length?(t=e,r):t},r.range=function(t){return arguments.length?(e=t,r):e},r.invertExtent=function(r){return r=e.indexOf(r),[t[r-1],t[r]]},r.copy=function(){return fi(t,e)},r}function di(t){function e(t){return+t}return e.invert=e,e.domain=e.range=function(r){return arguments.length?(t=r.map(e),e):t},e.ticks=function(e){return ei(t,e)},e.tickFormat=function(e,r){return ri(t,e,r)},e.copy=function(){return di(t)},e}function pi(){return 0}function hi(t){return t.innerRadius}function gi(t){return t.outerRadius}function vi(t){return t.startAngle}function yi(t){return t.endAngle}function mi(t){return t&&t.padAngle}function xi(t,e,r,n){return(t-r)*e-(e-n)*t>0?0:1}function bi(t,e,r,n,a){var i=t[0]-e[0],o=t[1]-e[1],l=(a?n:-n)/Math.sqrt(i*i+o*o),s=l*o,c=-l*i,u=t[0]+s,f=t[1]+c,d=e[0]+s,p=e[1]+c,h=(u+d)/2,g=(f+p)/2,v=d-u,y=p-f,m=v*v+y*y,x=r-n,b=u*p-d*f,_=(y<0?-1:1)*Math.sqrt(Math.max(0,x*x*m-b*b)),w=(b*y-v*_)/m,k=(-b*v-y*_)/m,M=(b*y+v*_)/m,A=(-b*v+y*_)/m,T=w-h,L=k-g,C=M-h,S=A-g;return T*T+L*L>C*C+S*S&&(w=M,k=A),[[w-s,k-c],[w*r/x,k*r/x]]}function _i(t){function e(e){function o(){c.push("M",i(t(u),l))}for(var s,c=[],u=[],f=-1,d=e.length,p=Ct(r),h=Ct(n);++f<d;)a.call(this,s=e[f],f)?u.push([+p.call(this,s,f),+h.call(this,s,f)]):u.length&&(o(),u=[]);return u.length&&o(),c.length?c.join(""):null}var r=Or,n=zr,a=ze,i=wi,o=i.key,l=.7;return e.x=function(t){return arguments.length?(r=t,e):r},e.y=function(t){return arguments.length?(n=t,e):n},e.defined=function(t){return arguments.length?(a=t,e):a},e.interpolate=function(t){return arguments.length?(o="function"==typeof t?i=t:(i=zs.get(t)||wi).key,e):o},e.tension=function(t){return arguments.length?(l=t,e):l},e}function wi(t){return t.length>1?t.join("L"):t+"Z"}function ki(t){return t.join("L")+"Z"}function Mi(t){for(var e=0,r=t.length,n=t[0],a=[n[0],",",n[1]];++e<r;)a.push("H",(n[0]+(n=t[e])[0])/2,"V",n[1]);return r>1&&a.push("H",n[0]),a.join("")}function Ai(t){for(var e=0,r=t.length,n=t[0],a=[n[0],",",n[1]];++e<r;)a.push("V",(n=t[e])[1],"H",n[0]);return a.join("")}function Ti(t){for(var e=0,r=t.length,n=t[0],a=[n[0],",",n[1]];++e<r;)a.push("H",(n=t[e])[0],"V",n[1]);return a.join("")}function Li(t,e){return t.length<4?wi(t):t[1]+Oi(t.slice(1,-1),zi(t,e))}function Ci(t,e){return t.length<3?ki(t):t[0]+Oi((t.push(t[0]),t),zi([t[t.length-2]].concat(t,[t[1]]),e))}function Si(t,e){return t.length<3?wi(t):t[0]+Oi(t,zi(t,e))}function Oi(t,e){if(e.length<1||t.length!=e.length&&t.length!=e.length+2)return wi(t);var r=t.length!=e.length,n="",a=t[0],i=t[1],o=e[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=t[1],s=2),e.length>1){l=e[1],i=t[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<e.length;c++,s++)i=t[s],l=e[c],n+="S"+(i[0]-l[0])+","+(i[1]-l[1])+","+i[0]+","+i[1]}if(r){var u=t[s];n+="Q"+(i[0]+2*l[0]/3)+","+(i[1]+2*l[1]/3)+","+u[0]+","+u[1]}return n}function zi(t,e){for(var r,n=[],a=(1-e)/2,i=t[0],o=t[1],l=1,s=t.length;++l<s;)r=i,i=o,o=t[l],n.push([a*(o[0]-r[0]),a*(o[1]-r[1])]);return n}function Di(t){if(t.length<3)return wi(t);var e=1,r=t.length,n=t[0],a=n[0],i=n[1],o=[a,a,a,(n=t[1])[0]],l=[i,i,i,n[1]],s=[a,",",i,"L",Ii(Es,o),",",Ii(Es,l)];for(t.push(t[r-1]);++e<=r;)n=t[e],o.shift(),o.push(n[0]),l.shift(),l.push(n[1]),Ri(s,o,l);return t.pop(),s.push("L",n),s.join("")}function Pi(t){if(t.length<4)return wi(t);for(var e,r=[],n=-1,a=t.length,i=[0],o=[0];++n<3;)e=t[n],i.push(e[0]),o.push(e[1]);for(r.push(Ii(Es,i)+","+Ii(Es,o)),--n;++n<a;)e=t[n],i.shift(),i.push(e[0]),o.shift(),o.push(e[1]),Ri(r,i,o);return r.join("")}function Ei(t){for(var e,r,n=-1,a=t.length,i=a+4,o=[],l=[];++n<4;)r=t[n%a],o.push(r[0]),l.push(r[1]);for(e=[Ii(Es,o),",",Ii(Es,l)],--n;++n<i;)r=t[n%a],o.shift(),o.push(r[0]),l.shift(),l.push(r[1]),Ri(e,o,l);return e.join("")}function Ni(t,e){var r=t.length-1;if(r)for(var n,a,i=t[0][0],o=t[0][1],l=t[r][0]-i,s=t[r][1]-o,c=-1;++c<=r;)n=t[c],a=c/r,n[0]=e*n[0]+(1-e)*(i+a*l),n[1]=e*n[1]+(1-e)*(o+a*s);return Di(t)}function Ii(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}function Ri(t,e,r){t.push("C",Ii(Ds,e),",",Ii(Ds,r),",",Ii(Ps,e),",",Ii(Ps,r),",",Ii(Es,e),",",Ii(Es,r))}function Fi(t,e){return(e[1]-t[1])/(e[0]-t[0])}function ji(t){for(var e=0,r=t.length-1,n=[],a=t[0],i=t[1],o=n[0]=Fi(a,i);++e<r;)n[e]=(o+(o=Fi(a=i,i=t[e+1])))/2;return n[e]=o,n}function Bi(t){for(var e,r,n,a,i=[],o=ji(t),l=-1,s=t.length-1;++l<s;)e=Fi(t[l],t[l+1]),bo(e)<Ro?o[l]=o[l+1]=0:(r=o[l]/e,n=o[l+1]/e,(a=r*r+n*n)>9&&(a=3*e/Math.sqrt(a),o[l]=a*r,o[l+1]=a*n));for(l=-1;++l<=s;)a=(t[Math.min(s,l+1)][0]-t[Math.max(0,l-1)][0])/(6*(1+o[l]*o[l])),i.push([a||0,o[l]*a||0]);return i}function qi(t){return t.length<3?wi(t):t[0]+Oi(t,Bi(t))}function Hi(t){for(var e,r,n,a=-1,i=t.length;++a<i;)e=t[a],r=e[0],n=e[1]-Ho,e[0]=r*Math.cos(n),e[1]=r*Math.sin(n);return t}function Vi(t){function e(e){function s(){g.push("M",l(t(y),f),u,c(t(v.reverse()),f),"Z")}for(var d,p,h,g=[],v=[],y=[],m=-1,x=e.length,b=Ct(r),_=Ct(a),w=r===n?function(){return p}:Ct(n),k=a===i?function(){return h}:Ct(i);++m<x;)o.call(this,d=e[m],m)?(v.push([p=+b.call(this,d,m),h=+_.call(this,d,m)]),y.push([+w.call(this,d,m),+k.call(this,d,m)])):v.length&&(s(),v=[],y=[]);return v.length&&s(),g.length?g.join(""):null}var r=Or,n=Or,a=0,i=zr,o=ze,l=wi,s=l.key,c=l,u="L",f=.7;return e.x=function(t){return arguments.length?(r=n=t,e):n},e.x0=function(t){return arguments.length?(r=t,e):r},e.x1=function(t){return arguments.length?(n=t,e):n},e.y=function(t){return arguments.length?(a=i=t,e):i},e.y0=function(t){return arguments.length?(a=t,e):a},e.y1=function(t){return arguments.length?(i=t,e):i},e.defined=function(t){return arguments.length?(o=t,e):o},e.interpolate=function(t){return arguments.length?(s="function"==typeof t?l=t:(l=zs.get(t)||wi).key,c=l.reverse||l,u=l.closed?"M":"L",e):s},e.tension=function(t){return arguments.length?(f=t,e):f},e}function Ui(t){return t.radius}function Gi(t){return[t.x,t.y]}function Xi(t){return function(){var e=t.apply(this,arguments),r=e[0],n=e[1]-Ho;return[r*Math.cos(n),r*Math.sin(n)]}}function Yi(){return 64}function Zi(){return"circle"}function Wi(t){var e=Math.sqrt(t/jo);return"M0,"+e+"A"+e+","+e+" 0 1,1 0,"+-e+"A"+e+","+e+" 0 1,1 0,"+e+"Z"}function Qi(t){return function(){var e,r,n;(e=this[t])&&(n=e[r=e.active])&&(n.timer.c=null,n.timer.t=NaN,--e.count?delete e[r]:delete this[t],e.active+=.5,n.event&&n.event.interrupt.call(this,this.__data__,n.index))}}function $i(t,e,r){return Ao(t,qs),t.namespace=e,t.id=r,t}function Ji(t,e,r,n){var a=t.id,i=t.namespace;return G(t,"function"==typeof r?function(t,o,l){t[i][a].tween.set(e,n(r.call(t,t.__data__,o,l)))}:(r=n(r),function(t){t[i][a].tween.set(e,r)}))}function Ki(t){return null==t&&(t=""),function(){this.textContent=t}}function to(t){return null==t?"__transition__":"__transition_"+t+"__"}function eo(t,e,r,n,a){function i(t){var e=g.delay;if(c.t=e+s,e<=t)return o(t-e);c.c=o}function o(r){var a=h.active,i=h[a];i&&(i.timer.c=null,i.timer.t=NaN,--h.count,delete h[a],i.event&&i.event.interrupt.call(t,t.__data__,i.index));for(var o in h)if(+o<n){var f=h[o];f.timer.c=null,f.timer.t=NaN,--h.count,delete h[o]}c.c=l,Pt(function(){return c.c&&l(r||1)&&(c.c=null,c.t=NaN),1},0,s),h.active=n,g.event&&g.event.start.call(t,t.__data__,e),p=[],g.tween.forEach(function(r,n){(n=n.call(t,t.__data__,e))&&p.push(n)}),d=g.ease,u=g.duration}function l(a){for(var i=a/u,o=d(i),l=p.length;l>0;)p[--l].call(t,o);if(i>=1)return g.event&&g.event.end.call(t,t.__data__,e),--h.count?delete h[n]:delete t[r],1}var s,c,u,d,p,h=t[r]||(t[r]={active:0,count:0}),g=h[n];g||(s=a.time,c=Pt(i,0,s),g=h[n]={tween:new f,time:s,timer:c,delay:a.delay,duration:a.duration,ease:a.ease,index:e},a=null,++h.count)}function ro(t,e,r){t.attr("transform",function(t){var n=e(t);return"translate("+(isFinite(n)?n:r(t))+",0)"})}function no(t,e,r){t.attr("transform",function(t){var n=e(t);return"translate(0,"+(isFinite(n)?n:r(t))+")"})}function ao(t){return t.toISOString()}function io(t,e,r){function n(e){return t(e)}function a(t,r){var n=t[1]-t[0],a=n/r,i=co.bisect(Qs,a);return i==Qs.length?[e.year,ti(t.map(function(t){return t/31536e6}),r)[2]]:i?e[a/Qs[i-1]<Qs[i]/a?i-1:i]:[Ks,ti(t,r)[2]]}return n.invert=function(e){return oo(t.invert(e))},n.domain=function(e){return arguments.length?(t.domain(e),n):t.domain().map(oo)},n.nice=function(t,e){function r(r){return!isNaN(r)&&!t.range(r,oo(+r+1),e).length}var i=n.domain(),o=Ga(i),l=null==t?a(o,10):"number"==typeof t&&a(o,t);return l&&(t=l[0],e=l[1]),n.domain(Za(i,e>1?{floor:function(e){for(;r(e=t.floor(e));)e=oo(e-1);return e},ceil:function(e){for(;r(e=t.ceil(e));)e=oo(+e+1);return e}}:t))},n.ticks=function(t,e){var r=Ga(n.domain()),i=null==t?a(r,10):"number"==typeof t?a(r,t):!t.range&&[{range:t},e];return i&&(t=i[0],e=i[1]),t.range(r[0],oo(+r[1]+1),e<1?1:e)},n.tickFormat=function(){return r},n.copy=function(){return io(t.copy(),e,r)},Ja(n,t)}function oo(t){return new Date(t)}function lo(t){return JSON.parse(t.responseText)}function so(t){var e=po.createRange();return e.selectNode(po.body),e.createContextualFragment(t.responseText)}var co={version:"3.5.17"},uo=[].slice,fo=function(t){return uo.call(t)},po=this.document;if(po)try{fo(po.documentElement.childNodes)[0].nodeType}catch(t){fo=function(t){for(var e=t.length,r=new Array(e);e--;)r[e]=t[e];return r}}if(Date.now||(Date.now=function(){return+new Date}),po)try{po.createElement("DIV").style.setProperty("opacity",0,"")}catch(t){var ho=this.Element.prototype,go=ho.setAttribute,vo=ho.setAttributeNS,yo=this.CSSStyleDeclaration.prototype,mo=yo.setProperty;ho.setAttribute=function(t,e){go.call(this,t,e+"")},ho.setAttributeNS=function(t,e,r){vo.call(this,t,e,r+"")},yo.setProperty=function(t,e,r){mo.call(this,t,e+"",r)}}co.ascending=a,co.descending=function(t,e){return e<t?-1:e>t?1:e>=t?0:NaN},co.min=function(t,e){var r,n,a=-1,i=t.length;if(1===arguments.length){for(;++a<i;)if(null!=(n=t[a])&&n>=n){r=n;break}for(;++a<i;)null!=(n=t[a])&&r>n&&(r=n)}else{for(;++a<i;)if(null!=(n=e.call(t,t[a],a))&&n>=n){r=n;break}for(;++a<i;)null!=(n=e.call(t,t[a],a))&&r>n&&(r=n)}return r},co.max=function(t,e){var r,n,a=-1,i=t.length;if(1===arguments.length){for(;++a<i;)if(null!=(n=t[a])&&n>=n){r=n;break}for(;++a<i;)null!=(n=t[a])&&n>r&&(r=n)}else{for(;++a<i;)if(null!=(n=e.call(t,t[a],a))&&n>=n){r=n;break}for(;++a<i;)null!=(n=e.call(t,t[a],a))&&n>r&&(r=n)}return r},co.extent=function(t,e){var r,n,a,i=-1,o=t.length;if(1===arguments.length){for(;++i<o;)if(null!=(n=t[i])&&n>=n){r=a=n;break}for(;++i<o;)null!=(n=t[i])&&(r>n&&(r=n),a<n&&(a=n))}else{for(;++i<o;)if(null!=(n=e.call(t,t[i],i))&&n>=n){r=a=n;break}for(;++i<o;)null!=(n=e.call(t,t[i],i))&&(r>n&&(r=n),a<n&&(a=n))}return[r,a]},co.sum=function(t,e){var r,n=0,a=t.length,i=-1;if(1===arguments.length)for(;++i<a;)o(r=+t[i])&&(n+=r);else for(;++i<a;)o(r=+e.call(t,t[i],i))&&(n+=r);return n},co.mean=function(t,e){var r,n=0,a=t.length,l=-1,s=a;if(1===arguments.length)for(;++l<a;)o(r=i(t[l]))?n+=r:--s;else for(;++l<a;)o(r=i(e.call(t,t[l],l)))?n+=r:--s;if(s)return n/s},co.quantile=function(t,e){var r=(t.length-1)*e+1,n=Math.floor(r),a=+t[n-1],i=r-n;return i?a+i*(t[n]-a):a},co.median=function(t,e){var r,n=[],l=t.length,s=-1;if(1===arguments.length)for(;++s<l;)o(r=i(t[s]))&&n.push(r);else for(;++s<l;)o(r=i(e.call(t,t[s],s)))&&n.push(r);if(n.length)return co.quantile(n.sort(a),.5)},co.variance=function(t,e){var r,n,a=t.length,l=0,s=0,c=-1,u=0;if(1===arguments.length)for(;++c<a;)o(r=i(t[c]))&&(n=r-l,l+=n/++u,s+=n*(r-l));else for(;++c<a;)o(r=i(e.call(t,t[c],c)))&&(n=r-l,l+=n/++u,s+=n*(r-l));if(u>1)return s/(u-1)},co.deviation=function(){var t=co.variance.apply(this,arguments);return t?Math.sqrt(t):t};var xo=l(a);co.bisectLeft=xo.left,co.bisect=co.bisectRight=xo.right,co.bisector=function(t){return l(1===t.length?function(e,r){return a(t(e),r)}:t)},co.shuffle=function(t,e,r){(i=arguments.length)<3&&(r=t.length,i<2&&(e=0));for(var n,a,i=r-e;i;)a=Math.random()*i--|0,n=t[i+e],t[i+e]=t[a+e],t[a+e]=n;return t},co.permute=function(t,e){for(var r=e.length,n=new Array(r);r--;)n[r]=t[e[r]];return n},co.pairs=function(t){for(var e=0,r=t.length-1,n=t[0],a=new Array(r<0?0:r);e<r;)a[e]=[n,n=t[++e]];return a},co.transpose=function(t){if(!(a=t.length))return[];for(var e=-1,r=co.min(t,s),n=new Array(r);++e<r;)for(var a,i=-1,o=n[e]=new Array(a);++i<a;)o[i]=t[i][e];return n},co.zip=function(){return co.transpose(arguments)},co.keys=function(t){var e=[];for(var r in t)e.push(r);return e},co.values=function(t){var e=[];for(var r in t)e.push(t[r]);return e},co.entries=function(t){var e=[];for(var r in t)e.push({key:r,value:t[r]});return e},co.merge=function(t){for(var e,r,n,a=t.length,i=-1,o=0;++i<a;)o+=t[i].length;for(r=new Array(o);--a>=0;)for(n=t[a],e=n.length;--e>=0;)r[--o]=n[e];return r};var bo=Math.abs;co.range=function(t,e,r){if(arguments.length<3&&(r=1,arguments.length<2&&(e=t,t=0)),(e-t)/r==1/0)throw new Error("infinite range");var n,a=[],i=c(bo(r)),o=-1;if(t*=i,e*=i,r*=i,r<0)for(;(n=t+r*++o)>e;)a.push(n/i);else for(;(n=t+r*++o)<e;)a.push(n/i);return a},co.map=function(t,e){var r=new f;if(t instanceof f)t.forEach(function(t,e){r.set(t,e)});else if(Array.isArray(t)){var n,a=-1,i=t.length;if(1===arguments.length)for(;++a<i;)r.set(a,t[a]);else for(;++a<i;)r.set(e.call(t,n=t[a],a),n)}else for(var o in t)r.set(o,t[o]);return r};var _o="__proto__",wo="\0";u(f,{has:h,get:function(t){return this._[d(t)]},set:function(t,e){return this._[d(t)]=e},remove:g,keys:v,values:function(){var t=[];for(var e in this._)t.push(this._[e]);return t},entries:function(){var t=[];for(var e in this._)t.push({key:p(e),value:this._[e]});return t},size:y,empty:m,forEach:function(t){for(var e in this._)t.call(this,p(e),this._[e])}}),co.nest=function(){function t(e,o,l){if(l>=i.length)return n?n.call(a,o):r?o.sort(r):o;for(var s,c,u,d,p=-1,h=o.length,g=i[l++],v=new f;++p<h;)(d=v.get(s=g(c=o[p])))?d.push(c):v.set(s,[c]);return e?(c=e(),u=function(r,n){c.set(r,t(e,n,l))}):(c={},u=function(r,n){c[r]=t(e,n,l)}),v.forEach(u),c}function e(t,r){if(r>=i.length)return t;var n=[],a=o[r++];return t.forEach(function(t,a){n.push({key:t,values:e(a,r)})}),a?n.sort(function(t,e){return a(t.key,e.key)}):n}var r,n,a={},i=[],o=[];return a.map=function(e,r){return t(r,e,0)},a.entries=function(r){return e(t(co.map,r,0),0)},a.key=function(t){return i.push(t),a},a.sortKeys=function(t){return o[i.length-1]=t,a},a.sortValues=function(t){return r=t,a},a.rollup=function(t){return n=t,a},a},co.set=function(t){var e=new x;if(t)for(var r=0,n=t.length;r<n;++r)e.add(t[r]);return e},u(x,{has:h,add:function(t){return this._[d(t+="")]=!0,t},remove:g,values:v,size:y,empty:m,forEach:function(t){for(var e in this._)t.call(this,p(e))}}),co.behavior={},co.rebind=function(t,e){for(var r,n=1,a=arguments.length;++n<a;)t[r=arguments[n]]=_(t,e,e[r]);return t};var ko=["webkit","ms","moz","Moz","o","O"];co.dispatch=function(){for(var t=new M,e=-1,r=arguments.length;++e<r;)t[arguments[e]]=A(t);return t},M.prototype.on=function(t,e){var r=t.indexOf("."),n="";if(r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),t)return arguments.length<2?this[t].on(n):this[t].on(n,e);if(2===arguments.length){if(null==e)for(t in this)this.hasOwnProperty(t)&&this[t].on(n,null);return this}},co.event=null,co.requote=function(t){return t.replace(Mo,"\\$&")};var Mo=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,Ao={}.__proto__?function(t,e){t.__proto__=e}:function(t,e){for(var r in e)t[r]=e[r]},To=function(t,e){return e.querySelector(t)},Lo=function(t,e){return e.querySelectorAll(t)},Co=function(t,e){var r=t.matches||t[w(t,"matchesSelector")];return(Co=function(t,e){return r.call(t,e)})(t,e)};"function"==typeof Sizzle&&(To=function(t,e){return Sizzle(t,e)[0]||null},Lo=Sizzle,Co=Sizzle.matchesSelector),co.selection=function(){return co.select(po.documentElement)};var So=co.selection.prototype=[];So.select=function(t){var e,r,n,a,i=[];t=O(t);for(var o=-1,l=this.length;++o<l;){i.push(e=[]),e.parentNode=(n=this[o]).parentNode;for(var s=-1,c=n.length;++s<c;)(a=n[s])?(e.push(r=t.call(a,a.__data__,s,o)),r&&"__data__"in a&&(r.__data__=a.__data__)):e.push(null)}return S(i)},So.selectAll=function(t){var e,r,n=[];t=z(t);for(var a=-1,i=this.length;++a<i;)for(var o=this[a],l=-1,s=o.length;++l<s;)(r=o[l])&&(n.push(e=fo(t.call(r,r.__data__,l,a))),e.parentNode=r);return S(n)};var Oo="http://www.w3.org/1999/xhtml",zo={svg:"http://www.w3.org/2000/svg",xhtml:Oo,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};co.ns={prefix:zo,qualify:function(t){var e=t.indexOf(":"),r=t;return e>=0&&"xmlns"!==(r=t.slice(0,e))&&(t=t.slice(e+1)),zo.hasOwnProperty(r)?{space:zo[r],local:t}:t}},So.attr=function(t,e){if(arguments.length<2){if("string"==typeof t){var r=this.node();return t=co.ns.qualify(t),t.local?r.getAttributeNS(t.space,t.local):r.getAttribute(t)}for(e in t)this.each(D(e,t[e]));return this}return this.each(D(t,e))},So.classed=function(t,e){if(arguments.length<2){if("string"==typeof t){var r=this.node(),n=(t=N(t)).length,a=-1;if(e=r.classList){for(;++a<n;)if(!e.contains(t[a]))return!1}else for(e=r.getAttribute("class");++a<n;)if(!E(t[a]).test(e))return!1;return!0}for(e in t)this.each(I(e,t[e]));return this}return this.each(I(t,e))},So.style=function(t,e,r){var a=arguments.length;if(a<3){if("string"!=typeof t){a<2&&(e="");for(r in t)this.each(F(r,t[r],e));return this}if(a<2){var i=this.node();return n(i).getComputedStyle(i,null).getPropertyValue(t)}r=""}return this.each(F(t,e,r))},So.property=function(t,e){if(arguments.length<2){if("string"==typeof t)return this.node()[t];for(e in t)this.each(j(e,t[e]));return this}return this.each(j(t,e))},So.text=function(t){return arguments.length?this.each("function"==typeof t?function(){var e=t.apply(this,arguments);this.textContent=null==e?"":e}:null==t?function(){this.textContent=""}:function(){this.textContent=t}):this.node().textContent},So.html=function(t){return arguments.length?this.each("function"==typeof t?function(){var e=t.apply(this,arguments);this.innerHTML=null==e?"":e}:null==t?function(){this.innerHTML=""}:function(){this.innerHTML=t}):this.node().innerHTML},So.append=function(t){return t=B(t),this.select(function(){return this.appendChild(t.apply(this,arguments))})},So.insert=function(t,e){return t=B(t),e=O(e),this.select(function(){return this.insertBefore(t.apply(this,arguments),e.apply(this,arguments)||null)})},So.remove=function(){return this.each(q)},So.data=function(t,e){function r(t,r){var n,a,i,o=t.length,u=r.length,d=Math.min(o,u),p=new Array(u),h=new Array(u),g=new Array(o);if(e){var v,y=new f,m=new Array(o);for(n=-1;++n<o;)(a=t[n])&&(y.has(v=e.call(a,a.__data__,n))?g[n]=a:y.set(v,a),m[n]=v);for(n=-1;++n<u;)(a=y.get(v=e.call(r,i=r[n],n)))?!0!==a&&(p[n]=a,a.__data__=i):h[n]=H(i),y.set(v,!0);for(n=-1;++n<o;)n in m&&!0!==y.get(m[n])&&(g[n]=t[n])}else{for(n=-1;++n<d;)a=t[n],i=r[n],a?(a.__data__=i,p[n]=a):h[n]=H(i);for(;n<u;++n)h[n]=H(r[n]);for(;n<o;++n)g[n]=t[n]}h.update=p,h.parentNode=p.parentNode=g.parentNode=t.parentNode,l.push(h),s.push(p),c.push(g)}var n,a,i=-1,o=this.length;if(!arguments.length){for(t=new Array(o=(n=this[0]).length);++i<o;)(a=n[i])&&(t[i]=a.__data__);return t}var l=X([]),s=S([]),c=S([]);if("function"==typeof t)for(;++i<o;)r(n=this[i],t.call(n,n.parentNode.__data__,i));else for(;++i<o;)r(n=this[i],t);return s.enter=function(){return l},s.exit=function(){return c},s},So.datum=function(t){return arguments.length?this.property("__data__",t):this.property("__data__")},So.filter=function(t){var e,r,n,a=[];"function"!=typeof t&&(t=V(t));for(var i=0,o=this.length;i<o;i++){a.push(e=[]),e.parentNode=(r=this[i]).parentNode;for(var l=0,s=r.length;l<s;l++)(n=r[l])&&t.call(n,n.__data__,l,i)&&e.push(n)}return S(a)},So.order=function(){for(var t=-1,e=this.length;++t<e;)for(var r,n=this[t],a=n.length-1,i=n[a];--a>=0;)(r=n[a])&&(i&&i!==r.nextSibling&&i.parentNode.insertBefore(r,i),i=r);return this},So.sort=function(t){t=U.apply(this,arguments);for(var e=-1,r=this.length;++e<r;)this[e].sort(t);return this.order()},So.each=function(t){return G(this,function(e,r,n){t.call(e,e.__data__,r,n)})},So.call=function(t){var e=fo(arguments);return t.apply(e[0]=this,e),this},So.empty=function(){return!this.node()},So.node=function(){for(var t=0,e=this.length;t<e;t++)for(var r=this[t],n=0,a=r.length;n<a;n++){var i=r[n];if(i)return i}return null},So.size=function(){var t=0;return G(this,function(){++t}),t};var Do=[];co.selection.enter=X,co.selection.enter.prototype=Do,Do.append=So.append,Do.empty=So.empty,Do.node=So.node,Do.call=So.call,Do.size=So.size,Do.select=function(t){for(var e,r,n,a,i,o=[],l=-1,s=this.length;++l<s;){n=(a=this[l]).update,o.push(e=[]),e.parentNode=a.parentNode;for(var c=-1,u=a.length;++c<u;)(i=a[c])?(e.push(n[c]=r=t.call(a.parentNode,i.__data__,c,l)),r.__data__=i.__data__):e.push(null)}return S(o)},Do.insert=function(t,e){return arguments.length<2&&(e=Y(this)),So.insert.call(this,t,e)},co.select=function(t){var r;return"string"==typeof t?(r=[To(t,po)],r.parentNode=po.documentElement):(r=[t],r.parentNode=e(t)),S([r])},co.selectAll=function(t){var e;return"string"==typeof t?(e=fo(Lo(t,po)),e.parentNode=po.documentElement):(e=fo(t),e.parentNode=null),S([e])},So.on=function(t,e,r){var n=arguments.length;if(n<3){if("string"!=typeof t){n<2&&(e=!1);for(r in t)this.each(Z(r,t[r],e));return this}if(n<2)return(n=this.node()["__on"+t])&&n._;r=!1}return this.each(Z(t,e,r))};var Po=co.map({mouseenter:"mouseover",mouseleave:"mouseout"});po&&Po.forEach(function(t){"on"+t in po&&Po.remove(t)});var Eo,No=0;co.mouse=function(t){return J(t,L())};var Io=this.navigator&&/WebKit/.test(this.navigator.userAgent)?-1:0;co.touch=function(t,e,r){if(arguments.length<3&&(r=e,e=L().changedTouches),e)for(var n,a=0,i=e.length;a<i;++a)if((n=e[a]).identifier===r)return J(t,n)},co.behavior.drag=function(){function t(){this.on("mousedown.drag",i).on("touchstart.drag",o)}function e(t,e,n,i,o){return function(){function l(){var t,r,n=e(d,g);n&&(t=n[0]-x[0],r=n[1]-x[1],h|=t|r,x=n,p({type:"drag",x:n[0]+c[0],y:n[1]+c[1],dx:t,dy:r}))}function s(){e(d,g)&&(y.on(i+v,null).on(o+v,null),m(h),p({type:"dragend"}))}var c,u=this,f=co.event.target.correspondingElement||co.event.target,d=u.parentNode,p=r.of(u,arguments),h=0,g=t(),v=".drag"+(null==g?"":"-"+g),y=co.select(n(f)).on(i+v,l).on(o+v,s),m=$(f),x=e(d,g);a?(c=a.apply(u,arguments),c=[c.x-x[0],c.y-x[1]]):c=[0,0],p({type:"dragstart"})}}var r=C(t,"drag","dragstart","dragend"),a=null,i=e(k,co.mouse,n,"mousemove","mouseup"),o=e(K,co.touch,b,"touchmove","touchend");return t.origin=function(e){return arguments.length?(a=e,t):a},co.rebind(t,r,"on")},co.touches=function(t,e){return arguments.length<2&&(e=L().touches),e?fo(e).map(function(e){var r=J(t,e);return r.identifier=e.identifier,r}):[]};var Ro=1e-6,Fo=Ro*Ro,jo=Math.PI,Bo=2*jo,qo=Bo-Ro,Ho=jo/2,Vo=jo/180,Uo=180/jo,Go=Math.SQRT2;co.interpolateZoom=function(t,e){var r,n,a=t[0],i=t[1],o=t[2],l=e[0],s=e[1],c=e[2],u=l-a,f=s-i,d=u*u+f*f;if(d<Fo)n=Math.log(c/o)/Go,r=function(t){return[a+t*u,i+t*f,o*Math.exp(Go*t*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),y=Math.log(Math.sqrt(g*g+1)-g);n=(y-v)/Go,r=function(t){var e=t*n,r=it(v),l=o/(2*p)*(r*ot(Go*e+v)-at(v));return[a+l*u,i+l*f,o*r/it(Go*e+v)]}}return r.duration=1e3*n,r},co.behavior.zoom=function(){function t(t){t.on(z,f).on(Yo+".zoom",p).on("dblclick.zoom",h).on(E,d)}function e(t){return[(t[0]-M.x)/M.k,(t[1]-M.y)/M.k]}function r(t){return[t[0]*M.k+M.x,t[1]*M.k+M.y]}function a(t){M.k=Math.max(L[0],Math.min(L[1],t))}function i(t,e){e=r(e),M.x+=t[0]-e[0],M.y+=t[1]-e[1]}function o(e,r,n,o){e.__chart__={x:M.x,y:M.y,k:M.k},a(Math.pow(2,o)),i(v=r,n),e=co.select(e),S>0&&(e=e.transition().duration(S)),e.call(t.event)}function l(){_&&_.domain(b.range().map(function(t){return(t-M.x)/M.k}).map(b.invert)),k&&k.domain(w.range().map(function(t){return(t-M.y)/M.k}).map(w.invert))}function s(t){O++||t({type:"zoomstart"})}function c(t){l(),t({type:"zoom",scale:M.k,translate:[M.x,M.y]})}function u(t){--O||(t({type:"zoomend"}),v=null)}function f(){function t(){l=1,i(co.mouse(a),d),c(o)}function r(){f.on(D,null).on(P,null),p(l),u(o)}var a=this,o=N.of(a,arguments),l=0,f=co.select(n(a)).on(D,t).on(P,r),d=e(co.mouse(a)),p=$(a);Bs.call(a),s(o)}function d(){function t(){var t=co.touches(h);return p=M.k,t.forEach(function(t){ t.identifier in v&&(v[t.identifier]=e(t))}),t}function r(){var e=co.event.target;co.select(e).on(b,n).on(_,l),w.push(e);for(var r=co.event.changedTouches,a=0,i=r.length;a<i;++a)v[r[a].identifier]=null;var s=t(),c=Date.now();if(1===s.length){if(c-x<500){var u=s[0];o(h,u,v[u.identifier],Math.floor(Math.log(M.k)/Math.LN2)+1),T()}x=c}else if(s.length>1){var u=s[0],f=s[1],d=u[0]-f[0],p=u[1]-f[1];y=d*d+p*p}}function n(){var t,e,r,n,o=co.touches(h);Bs.call(h);for(var l=0,s=o.length;l<s;++l,n=null)if(r=o[l],n=v[r.identifier]){if(e)break;t=r,e=n}if(n){var u=(u=r[0]-t[0])*u+(u=r[1]-t[1])*u,f=y&&Math.sqrt(u/y);t=[(t[0]+r[0])/2,(t[1]+r[1])/2],e=[(e[0]+n[0])/2,(e[1]+n[1])/2],a(f*p)}x=null,i(t,e),c(g)}function l(){if(co.event.touches.length){for(var e=co.event.changedTouches,r=0,n=e.length;r<n;++r)delete v[e[r].identifier];for(var a in v)return void t()}co.selectAll(w).on(m,null),k.on(z,f).on(E,d),A(),u(g)}var p,h=this,g=N.of(h,arguments),v={},y=0,m=".zoom-"+co.event.changedTouches[0].identifier,b="touchmove"+m,_="touchend"+m,w=[],k=co.select(h),A=$(h);r(),s(g),k.on(z,null).on(E,r)}function p(){var t=N.of(this,arguments);m?clearTimeout(m):(Bs.call(this),g=e(v=y||co.mouse(this)),s(t)),m=setTimeout(function(){m=null,u(t)},50),T(),a(Math.pow(2,.002*Xo())*M.k),i(v,g),c(t)}function h(){var t=co.mouse(this),r=Math.log(M.k)/Math.LN2;o(this,t,e(t),co.event.shiftKey?Math.ceil(r)-1:Math.floor(r)+1)}var g,v,y,m,x,b,_,w,k,M={x:0,y:0,k:1},A=[960,500],L=Zo,S=250,O=0,z="mousedown.zoom",D="mousemove.zoom",P="mouseup.zoom",E="touchstart.zoom",N=C(t,"zoomstart","zoom","zoomend");return Yo||(Yo="onwheel"in po?(Xo=function(){return-co.event.deltaY*(co.event.deltaMode?120:1)},"wheel"):"onmousewheel"in po?(Xo=function(){return co.event.wheelDelta},"mousewheel"):(Xo=function(){return-co.event.detail},"MozMousePixelScroll")),t.event=function(t){t.each(function(){var t=N.of(this,arguments),e=M;Fs?co.select(this).transition().each("start.zoom",function(){M=this.__chart__||{x:0,y:0,k:1},s(t)}).tween("zoom:zoom",function(){var r=A[0],n=A[1],a=v?v[0]:r/2,i=v?v[1]:n/2,o=co.interpolateZoom([(a-M.x)/M.k,(i-M.y)/M.k,r/M.k],[(a-e.x)/e.k,(i-e.y)/e.k,r/e.k]);return function(e){var n=o(e),l=r/n[2];this.__chart__=M={x:a-n[0]*l,y:i-n[1]*l,k:l},c(t)}}).each("interrupt.zoom",function(){u(t)}).each("end.zoom",function(){u(t)}):(this.__chart__=M,s(t),c(t),u(t))})},t.translate=function(e){return arguments.length?(M={x:+e[0],y:+e[1],k:M.k},l(),t):[M.x,M.y]},t.scale=function(e){return arguments.length?(M={x:M.x,y:M.y,k:null},a(+e),l(),t):M.k},t.scaleExtent=function(e){return arguments.length?(L=null==e?Zo:[+e[0],+e[1]],t):L},t.center=function(e){return arguments.length?(y=e&&[+e[0],+e[1]],t):y},t.size=function(e){return arguments.length?(A=e&&[+e[0],+e[1]],t):A},t.duration=function(e){return arguments.length?(S=+e,t):S},t.x=function(e){return arguments.length?(_=e,b=e.copy(),M={x:0,y:0,k:1},t):_},t.y=function(e){return arguments.length?(k=e,w=e.copy(),M={x:0,y:0,k:1},t):k},co.rebind(t,N,"on")};var Xo,Yo,Zo=[0,1/0];co.color=st,st.prototype.toString=function(){return this.rgb()+""},co.hsl=ct;var Wo=ct.prototype=new st;Wo.brighter=function(t){return t=Math.pow(.7,arguments.length?t:1),new ct(this.h,this.s,this.l/t)},Wo.darker=function(t){return t=Math.pow(.7,arguments.length?t:1),new ct(this.h,this.s,t*this.l)},Wo.rgb=function(){return ut(this.h,this.s,this.l)},co.hcl=ft;var Qo=ft.prototype=new st;Qo.brighter=function(t){return new ft(this.h,this.c,Math.min(100,this.l+$o*(arguments.length?t:1)))},Qo.darker=function(t){return new ft(this.h,this.c,Math.max(0,this.l-$o*(arguments.length?t:1)))},Qo.rgb=function(){return dt(this.h,this.c,this.l).rgb()},co.lab=pt;var $o=18,Jo=.95047,Ko=1,tl=1.08883,el=pt.prototype=new st;el.brighter=function(t){return new pt(Math.min(100,this.l+$o*(arguments.length?t:1)),this.a,this.b)},el.darker=function(t){return new pt(Math.max(0,this.l-$o*(arguments.length?t:1)),this.a,this.b)},el.rgb=function(){return ht(this.l,this.a,this.b)},co.rgb=xt;var rl=xt.prototype=new st;rl.brighter=function(t){t=Math.pow(.7,arguments.length?t:1);var e=this.r,r=this.g,n=this.b,a=30;return e||r||n?(e&&e<a&&(e=a),r&&r<a&&(r=a),n&&n<a&&(n=a),new xt(Math.min(255,e/t),Math.min(255,r/t),Math.min(255,n/t))):new xt(a,a,a)},rl.darker=function(t){return t=Math.pow(.7,arguments.length?t:1),new xt(t*this.r,t*this.g,t*this.b)},rl.hsl=function(){return Mt(this.r,this.g,this.b)},rl.toString=function(){return"#"+wt(this.r)+wt(this.g)+wt(this.b)};var nl=co.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});nl.forEach(function(t,e){nl.set(t,bt(e))}),co.functor=Ct,co.xhr=St(b),co.dsv=function(t,e){function r(t,r,i){arguments.length<3&&(i=r,r=null);var o=Ot(t,e,null==r?n:a(r),i);return o.row=function(t){return arguments.length?o.response(null==(r=t)?n:a(t)):r},o}function n(t){return r.parse(t.responseText)}function a(t){return function(e){return r.parse(e.responseText,t)}}function i(e){return e.map(o).join(t)}function o(t){return l.test(t)?'"'+t.replace(/\"/g,'""')+'"':t}var l=new RegExp('["'+t+"\n]"),s=t.charCodeAt(0);return r.parse=function(t,e){var n;return r.parseRows(t,function(t,r){if(n)return n(t,r-1);var a=new Function("d","return {"+t.map(function(t,e){return JSON.stringify(t)+": d["+e+"]"}).join(",")+"}");n=e?function(t,r){return e(a(t),r)}:a})},r.parseRows=function(t,e){function r(){if(u>=c)return o;if(a)return a=!1,i;var e=u;if(34===t.charCodeAt(e)){for(var r=e;r++<c;)if(34===t.charCodeAt(r)){if(34!==t.charCodeAt(r+1))break;++r}u=r+2;var n=t.charCodeAt(r+1);return 13===n?(a=!0,10===t.charCodeAt(r+2)&&++u):10===n&&(a=!0),t.slice(e+1,r).replace(/""/g,'"')}for(;u<c;){var n=t.charCodeAt(u++),l=1;if(10===n)a=!0;else if(13===n)a=!0,10===t.charCodeAt(u)&&(++u,++l);else if(n!==s)continue;return t.slice(e,u-l)}return t.slice(e)}for(var n,a,i={},o={},l=[],c=t.length,u=0,f=0;(n=r())!==o;){for(var d=[];n!==i&&n!==o;)d.push(n),n=r();e&&null==(d=e(d,f++))||l.push(d)}return l},r.format=function(e){if(Array.isArray(e[0]))return r.formatRows(e);var n=new x,a=[];return e.forEach(function(t){for(var e in t)n.has(e)||a.push(n.add(e))}),[a.map(o).join(t)].concat(e.map(function(e){return a.map(function(t){return o(e[t])}).join(t)})).join("\n")},r.formatRows=function(t){return t.map(i).join("\n")},r},co.csv=co.dsv(",","text/csv"),co.tsv=co.dsv("\t","text/tab-separated-values");var al,il,ol,ll,sl=this[w(this,"requestAnimationFrame")]||function(t){setTimeout(t,17)};co.timer=function(){Pt.apply(this,arguments)},co.timer.flush=function(){Nt(),It()},co.round=function(t,e){return e?Math.round(t*(e=Math.pow(10,e)))/e:Math.round(t)};var cl=["y","z","a","f","p","n","\xb5","m","","k","M","G","T","P","E","Z","Y"].map(Ft);co.formatPrefix=function(t,e){var r=0;return(t=+t)&&(t<0&&(t*=-1),e&&(t=co.round(t,Rt(t,e))),r=1+Math.floor(1e-12+Math.log(t)/Math.LN10),r=Math.max(-24,Math.min(24,3*Math.floor((r-1)/3)))),cl[8+r/3]};var ul=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,fl=co.map({b:function(t){return t.toString(2)},c:function(t){return String.fromCharCode(t)},o:function(t){return t.toString(8)},x:function(t){return t.toString(16)},X:function(t){return t.toString(16).toUpperCase()},g:function(t,e){return t.toPrecision(e)},e:function(t,e){return t.toExponential(e)},f:function(t,e){return t.toFixed(e)},r:function(t,e){return(t=co.round(t,Rt(t,e))).toFixed(Math.max(0,Math.min(20,Rt(t*(1+1e-15),e))))}}),dl=co.time={},pl=Date;qt.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(){hl.setUTCDate.apply(this._,arguments)},setDay:function(){hl.setUTCDay.apply(this._,arguments)},setFullYear:function(){hl.setUTCFullYear.apply(this._,arguments)},setHours:function(){hl.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){hl.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){hl.setUTCMinutes.apply(this._,arguments)},setMonth:function(){hl.setUTCMonth.apply(this._,arguments)},setSeconds:function(){hl.setUTCSeconds.apply(this._,arguments)},setTime:function(){hl.setTime.apply(this._,arguments)}};var hl=Date.prototype;dl.year=Ht(function(t){return t=dl.day(t),t.setMonth(0,1),t},function(t,e){t.setFullYear(t.getFullYear()+e)},function(t){return t.getFullYear()}),dl.years=dl.year.range,dl.years.utc=dl.year.utc.range,dl.day=Ht(function(t){var e=new pl(2e3,0);return e.setFullYear(t.getFullYear(),t.getMonth(),t.getDate()),e},function(t,e){t.setDate(t.getDate()+e)},function(t){return t.getDate()-1}),dl.days=dl.day.range,dl.days.utc=dl.day.utc.range,dl.dayOfYear=function(t){var e=dl.year(t);return Math.floor((t-e-6e4*(t.getTimezoneOffset()-e.getTimezoneOffset()))/864e5)},["sunday","monday","tuesday","wednesday","thursday","friday","saturday"].forEach(function(t,e){e=7-e;var r=dl[t]=Ht(function(t){return(t=dl.day(t)).setDate(t.getDate()-(t.getDay()+e)%7),t},function(t,e){t.setDate(t.getDate()+7*Math.floor(e))},function(t){var r=dl.year(t).getDay();return Math.floor((dl.dayOfYear(t)+(r+e)%7)/7)-(r!==e)});dl[t+"s"]=r.range,dl[t+"s"].utc=r.utc.range,dl[t+"OfYear"]=function(t){var r=dl.year(t).getDay();return Math.floor((dl.dayOfYear(t)+(r+e)%7)/7)}}),dl.week=dl.sunday,dl.weeks=dl.sunday.range,dl.weeks.utc=dl.sunday.utc.range,dl.weekOfYear=dl.sundayOfYear;var gl={"-":"",_:" ",0:"0"},vl=/^\s*\d+/,yl=/^%/;co.locale=function(t){return{numberFormat:jt(t),timeFormat:Ut(t)}};var ml=co.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"]});co.format=ml.numberFormat,co.geo={},fe.prototype={s:0,t:0,add:function(t){de(t,this.t,xl),de(xl.s,this.s,this),this.s?this.t+=xl.t:this.s=xl.t},reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};var xl=new fe;co.geo.stream=function(t,e){t&&bl.hasOwnProperty(t.type)?bl[t.type](t,e):pe(t,e)};var bl={Feature:function(t,e){pe(t.geometry,e)},FeatureCollection:function(t,e){for(var r=t.features,n=-1,a=r.length;++n<a;)pe(r[n].geometry,e)}},_l={Sphere:function(t,e){e.sphere()},Point:function(t,e){t=t.coordinates,e.point(t[0],t[1],t[2])},MultiPoint:function(t,e){for(var r=t.coordinates,n=-1,a=r.length;++n<a;)t=r[n],e.point(t[0],t[1],t[2])},LineString:function(t,e){he(t.coordinates,e,0)},MultiLineString:function(t,e){for(var r=t.coordinates,n=-1,a=r.length;++n<a;)he(r[n],e,0)},Polygon:function(t,e){ge(t.coordinates,e)},MultiPolygon:function(t,e){for(var r=t.coordinates,n=-1,a=r.length;++n<a;)ge(r[n],e)},GeometryCollection:function(t,e){for(var r=t.geometries,n=-1,a=r.length;++n<a;)pe(r[n],e)}};co.geo.area=function(t){return wl=0,co.geo.stream(t,Ml),wl};var wl,kl=new fe,Ml={sphere:function(){wl+=4*jo},point:k,lineStart:k,lineEnd:k,polygonStart:function(){kl.reset(),Ml.lineStart=ve},polygonEnd:function(){var t=2*kl;wl+=t<0?4*jo+t:t,Ml.lineStart=Ml.lineEnd=Ml.point=k}};co.geo.bounds=function(){function t(t,e){x.push(b=[u=t,d=t]),e<f&&(f=e),e>p&&(p=e)}function e(e,r){var n=ye([e*Vo,r*Vo]);if(y){var a=xe(y,n),i=[a[1],-a[0],0],o=xe(i,a);we(o),o=ke(o);var s=e-h,c=s>0?1:-1,g=o[0]*Uo*c,v=bo(s)>180;if(v^(c*h<g&&g<c*e)){var m=o[1]*Uo;m>p&&(p=m)}else if(g=(g+360)%360-180,v^(c*h<g&&g<c*e)){var m=-o[1]*Uo;m<f&&(f=m)}else r<f&&(f=r),r>p&&(p=r);v?e<h?l(u,e)>l(u,d)&&(d=e):l(e,d)>l(u,d)&&(u=e):d>=u?(e<u&&(u=e),e>d&&(d=e)):e>h?l(u,e)>l(u,d)&&(d=e):l(e,d)>l(u,d)&&(u=e)}else t(e,r);y=n,h=e}function r(){_.point=e}function n(){b[0]=u,b[1]=d,_.point=t,y=null}function a(t,r){if(y){var n=t-h;m+=bo(n)>180?n+(n>0?360:-360):n}else g=t,v=r;Ml.point(t,r),e(t,r)}function i(){Ml.lineStart()}function o(){a(g,v),Ml.lineEnd(),bo(m)>Ro&&(u=-(d=180)),b[0]=u,b[1]=d,y=null}function l(t,e){return(e-=t)<0?e+360:e}function s(t,e){return t[0]-e[0]}function c(t,e){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:t<e[0]||e[1]<t}var u,f,d,p,h,g,v,y,m,x,b,_={point:t,lineStart:r,lineEnd:n,polygonStart:function(){_.point=a,_.lineStart=i,_.lineEnd=o,m=0,Ml.polygonStart()},polygonEnd:function(){Ml.polygonEnd(),_.point=t,_.lineStart=r,_.lineEnd=n,kl<0?(u=-(d=180),f=-(p=90)):m>Ro?p=90:m<-Ro&&(f=-90),b[0]=u,b[1]=d}};return function(t){p=d=-(u=f=1/0),x=[],co.geo.stream(t,_);var e=x.length;if(e){x.sort(s);for(var r,n=1,a=x[0],i=[a];n<e;++n)r=x[n],c(r[0],a)||c(r[1],a)?(l(a[0],r[1])>l(a[0],a[1])&&(a[1]=r[1]),l(r[0],a[1])>l(a[0],a[1])&&(a[0]=r[0])):i.push(a=r);for(var o,r,h=-1/0,e=i.length-1,n=0,a=i[e];n<=e;a=r,++n)r=i[n],(o=l(a[1],r[0]))>h&&(h=o,u=r[0],d=a[1])}return x=b=null,u===1/0||f===1/0?[[NaN,NaN],[NaN,NaN]]:[[u,f],[d,p]]}}(),co.geo.centroid=function(t){Al=Tl=Ll=Cl=Sl=Ol=zl=Dl=Pl=El=Nl=0,co.geo.stream(t,Il);var e=Pl,r=El,n=Nl,a=e*e+r*r+n*n;return a<Fo&&(e=Ol,r=zl,n=Dl,Tl<Ro&&(e=Ll,r=Cl,n=Sl),(a=e*e+r*r+n*n)<Fo)?[NaN,NaN]:[Math.atan2(r,e)*Uo,nt(n/Math.sqrt(a))*Uo]};var Al,Tl,Ll,Cl,Sl,Ol,zl,Dl,Pl,El,Nl,Il={sphere:k,point:Ae,lineStart:Le,lineEnd:Ce,polygonStart:function(){Il.lineStart=Se},polygonEnd:function(){Il.lineStart=Le}},Rl=Ne(ze,je,qe,[-jo,-jo/2]),Fl=1e9;co.geo.clipExtent=function(){var t,e,r,n,a,i,o={stream:function(t){return a&&(a.valid=!1),a=i(t),a.valid=!0,a},extent:function(l){return arguments.length?(i=Ge(t=+l[0][0],e=+l[0][1],r=+l[1][0],n=+l[1][1]),a&&(a.valid=!1,a=null),o):[[t,e],[r,n]]}};return o.extent([[0,0],[960,500]])},(co.geo.conicEqualArea=function(){return Xe(Ye)}).raw=Ye,co.geo.albers=function(){return co.geo.conicEqualArea().rotate([96,0]).center([-.6,38.7]).parallels([29.5,45.5]).scale(1070)},co.geo.albersUsa=function(){function t(t){var i=t[0],o=t[1];return e=null,r(i,o),e||(n(i,o),e)||a(i,o),e}var e,r,n,a,i=co.geo.albers(),o=co.geo.conicEqualArea().rotate([154,0]).center([-2,58.5]).parallels([55,65]),l=co.geo.conicEqualArea().rotate([157,0]).center([-3,19.9]).parallels([8,18]),s={point:function(t,r){e=[t,r]}};return t.invert=function(t){var e=i.scale(),r=i.translate(),n=(t[0]-r[0])/e,a=(t[1]-r[1])/e;return(a>=.12&&a<.234&&n>=-.425&&n<-.214?o:a>=.166&&a<.234&&n>=-.214&&n<-.115?l:i).invert(t)},t.stream=function(t){var e=i.stream(t),r=o.stream(t),n=l.stream(t);return{point:function(t,a){e.point(t,a),r.point(t,a),n.point(t,a)},sphere:function(){e.sphere(),r.sphere(),n.sphere()},lineStart:function(){e.lineStart(),r.lineStart(),n.lineStart()},lineEnd:function(){e.lineEnd(),r.lineEnd(),n.lineEnd()},polygonStart:function(){e.polygonStart(),r.polygonStart(),n.polygonStart()},polygonEnd:function(){e.polygonEnd(),r.polygonEnd(),n.polygonEnd()}}},t.precision=function(e){return arguments.length?(i.precision(e),o.precision(e),l.precision(e),t):i.precision()},t.scale=function(e){return arguments.length?(i.scale(e),o.scale(.35*e),l.scale(e),t.translate(i.translate())):i.scale()},t.translate=function(e){if(!arguments.length)return i.translate();var c=i.scale(),u=+e[0],f=+e[1];return r=i.translate(e).clipExtent([[u-.455*c,f-.238*c],[u+.455*c,f+.238*c]]).stream(s).point,n=o.translate([u-.307*c,f+.201*c]).clipExtent([[u-.425*c+Ro,f+.12*c+Ro],[u-.214*c-Ro,f+.234*c-Ro]]).stream(s).point,a=l.translate([u-.205*c,f+.212*c]).clipExtent([[u-.214*c+Ro,f+.166*c+Ro],[u-.115*c-Ro,f+.234*c-Ro]]).stream(s).point,t},t.scale(1070)};var jl,Bl,ql,Hl,Vl,Ul,Gl={point:k,lineStart:k,lineEnd:k,polygonStart:function(){Bl=0,Gl.lineStart=Ze},polygonEnd:function(){Gl.lineStart=Gl.lineEnd=Gl.point=k,jl+=bo(Bl/2)}},Xl={point:We,lineStart:k,lineEnd:k,polygonStart:k,polygonEnd:k},Yl={point:Je,lineStart:Ke,lineEnd:tr,polygonStart:function(){Yl.lineStart=er},polygonEnd:function(){Yl.point=Je,Yl.lineStart=Ke,Yl.lineEnd=tr}};co.geo.path=function(){function t(t){return t&&("function"==typeof l&&i.pointRadius(+l.apply(this,arguments)),o&&o.valid||(o=a(i)),co.geo.stream(t,o)),i.result()}function e(){return o=null,t}var r,n,a,i,o,l=4.5;return t.area=function(t){return jl=0,co.geo.stream(t,a(Gl)),jl},t.centroid=function(t){return Ll=Cl=Sl=Ol=zl=Dl=Pl=El=Nl=0,co.geo.stream(t,a(Yl)),Nl?[Pl/Nl,El/Nl]:Dl?[Ol/Dl,zl/Dl]:Sl?[Ll/Sl,Cl/Sl]:[NaN,NaN]},t.bounds=function(t){return Vl=Ul=-(ql=Hl=1/0),co.geo.stream(t,a(Xl)),[[ql,Hl],[Vl,Ul]]},t.projection=function(t){return arguments.length?(a=(r=t)?t.stream||ar(t):b,e()):r},t.context=function(t){return arguments.length?(i=null==(n=t)?new Qe:new rr(t),"function"!=typeof l&&i.pointRadius(l),e()):n},t.pointRadius=function(e){return arguments.length?(l="function"==typeof e?e:(i.pointRadius(+e),+e),t):l},t.projection(co.geo.albersUsa()).context(null)},co.geo.transform=function(t){return{stream:function(e){var r=new ir(e);for(var n in t)r[n]=t[n];return r}}},ir.prototype={point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}},co.geo.projection=lr,co.geo.projectionMutator=sr,(co.geo.equirectangular=function(){return lr(ur)}).raw=ur.invert=ur,co.geo.rotation=function(t){function e(e){return e=t(e[0]*Vo,e[1]*Vo),e[0]*=Uo,e[1]*=Uo,e}return t=dr(t[0]%360*Vo,t[1]*Vo,t.length>2?t[2]*Vo:0),e.invert=function(e){return e=t.invert(e[0]*Vo,e[1]*Vo),e[0]*=Uo,e[1]*=Uo,e},e},fr.invert=ur,co.geo.circle=function(){function t(){var t="function"==typeof n?n.apply(this,arguments):n,e=dr(-t[0]*Vo,-t[1]*Vo,0).invert,a=[];return r(null,null,1,{point:function(t,r){a.push(t=e(t,r)),t[0]*=Uo,t[1]*=Uo}}),{type:"Polygon",coordinates:[a]}}var e,r,n=[0,0],a=6;return t.origin=function(e){return arguments.length?(n=e,t):n},t.angle=function(n){return arguments.length?(r=vr((e=+n)*Vo,a*Vo),t):e},t.precision=function(n){return arguments.length?(r=vr(e*Vo,(a=+n)*Vo),t):a},t.angle(90)},co.geo.distance=function(t,e){var r,n=(e[0]-t[0])*Vo,a=t[1]*Vo,i=e[1]*Vo,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)},co.geo.graticule=function(){function t(){return{type:"MultiLineString",coordinates:e()}}function e(){return co.range(Math.ceil(i/v)*v,a,v).map(d).concat(co.range(Math.ceil(c/y)*y,s,y).map(p)).concat(co.range(Math.ceil(n/h)*h,r,h).filter(function(t){return bo(t%v)>Ro}).map(u)).concat(co.range(Math.ceil(l/g)*g,o,g).filter(function(t){return bo(t%y)>Ro}).map(f))}var r,n,a,i,o,l,s,c,u,f,d,p,h=10,g=h,v=90,y=360,m=2.5;return t.lines=function(){return e().map(function(t){return{type:"LineString",coordinates:t}})},t.outline=function(){return{type:"Polygon",coordinates:[d(i).concat(p(s).slice(1),d(a).reverse().slice(1),p(c).reverse().slice(1))]}},t.extent=function(e){return arguments.length?t.majorExtent(e).minorExtent(e):t.minorExtent()},t.majorExtent=function(e){return arguments.length?(i=+e[0][0],a=+e[1][0],c=+e[0][1],s=+e[1][1],i>a&&(e=i,i=a,a=e),c>s&&(e=c,c=s,s=e),t.precision(m)):[[i,c],[a,s]]},t.minorExtent=function(e){return arguments.length?(n=+e[0][0],r=+e[1][0],l=+e[0][1],o=+e[1][1],n>r&&(e=n,n=r,r=e),l>o&&(e=l,l=o,o=e),t.precision(m)):[[n,l],[r,o]]},t.step=function(e){return arguments.length?t.majorStep(e).minorStep(e):t.minorStep()},t.majorStep=function(e){return arguments.length?(v=+e[0],y=+e[1],t):[v,y]},t.minorStep=function(e){return arguments.length?(h=+e[0],g=+e[1],t):[h,g]},t.precision=function(e){return arguments.length?(m=+e,u=mr(l,o,90),f=xr(n,r,m),d=mr(c,s,90),p=xr(i,a,m),t):m},t.majorExtent([[-180,-90+Ro],[180,90-Ro]]).minorExtent([[-180,-80-Ro],[180,80+Ro]])},co.geo.greatArc=function(){function t(){return{type:"LineString",coordinates:[e||n.apply(this,arguments),r||a.apply(this,arguments)]}}var e,r,n=br,a=_r;return t.distance=function(){return co.geo.distance(e||n.apply(this,arguments),r||a.apply(this,arguments))},t.source=function(r){return arguments.length?(n=r,e="function"==typeof r?null:r,t):n},t.target=function(e){return arguments.length?(a=e,r="function"==typeof e?null:e,t):a},t.precision=function(){return arguments.length?t:0},t},co.geo.interpolate=function(t,e){return wr(t[0]*Vo,t[1]*Vo,e[0]*Vo,e[1]*Vo)},co.geo.length=function(t){return Zl=0,co.geo.stream(t,Wl),Zl};var Zl,Wl={sphere:k,point:k,lineStart:kr,lineEnd:k,polygonStart:k,polygonEnd:k},Ql=Mr(function(t){return Math.sqrt(2/(1+t))},function(t){return 2*Math.asin(t/2)});(co.geo.azimuthalEqualArea=function(){return lr(Ql)}).raw=Ql;var $l=Mr(function(t){var e=Math.acos(t);return e&&e/Math.sin(e)},b);(co.geo.azimuthalEquidistant=function(){return lr($l)}).raw=$l,(co.geo.conicConformal=function(){return Xe(Ar)}).raw=Ar,(co.geo.conicEquidistant=function(){return Xe(Tr)}).raw=Tr;var Jl=Mr(function(t){return 1/t},Math.atan);(co.geo.gnomonic=function(){return lr(Jl)}).raw=Jl,Lr.invert=function(t,e){return[t,2*Math.atan(Math.exp(e))-Ho]},(co.geo.mercator=function(){return Cr(Lr)}).raw=Lr;var Kl=Mr(function(){return 1},Math.asin);(co.geo.orthographic=function(){return lr(Kl)}).raw=Kl;var ts=Mr(function(t){return 1/(1+t)},function(t){return 2*Math.atan(t)});(co.geo.stereographic=function(){return lr(ts)}).raw=ts,Sr.invert=function(t,e){return[-e,2*Math.atan(Math.exp(t))-Ho]},(co.geo.transverseMercator=function(){var t=Cr(Sr),e=t.center,r=t.rotate;return t.center=function(t){return t?e([-t[1],t[0]]):(t=e(),[t[1],-t[0]])},t.rotate=function(t){return t?r([t[0],t[1],t.length>2?t[2]+90:90]):(t=r(),[t[0],t[1],t[2]-90])},r([0,0,90])}).raw=Sr,co.geom={},co.geom.hull=function(t){function e(t){if(t.length<3)return[];var e,a=Ct(r),i=Ct(n),o=t.length,l=[],s=[];for(e=0;e<o;e++)l.push([+a.call(this,t[e],e),+i.call(this,t[e],e),e]);for(l.sort(Pr),e=0;e<o;e++)s.push([l[e][0],-l[e][1]]);var c=Dr(l),u=Dr(s),f=u[0]===c[0],d=u[u.length-1]===c[c.length-1],p=[];for(e=c.length-1;e>=0;--e)p.push(t[l[c[e]][2]]);for(e=+f;e<u.length-d;++e)p.push(t[l[u[e]][2]]);return p}var r=Or,n=zr;return arguments.length?e(t):(e.x=function(t){return arguments.length?(r=t,e):r},e.y=function(t){return arguments.length?(n=t,e):n},e)},co.geom.polygon=function(t){return Ao(t,es),t};var es=co.geom.polygon.prototype=[];es.area=function(){for(var t,e=-1,r=this.length,n=this[r-1],a=0;++e<r;)t=n,n=this[e],a+=t[1]*n[0]-t[0]*n[1];return.5*a},es.centroid=function(t){var e,r,n=-1,a=this.length,i=0,o=0,l=this[a-1];for(arguments.length||(t=-1/(6*this.area()));++n<a;)e=l,l=this[n],r=e[0]*l[1]-l[0]*e[1],i+=(e[0]+l[0])*r,o+=(e[1]+l[1])*r;return[i*t,o*t]},es.clip=function(t){for(var e,r,n,a,i,o,l=Ir(t),s=-1,c=this.length-Ir(this),u=this[c-1];++s<c;){for(e=t.slice(),t.length=0,a=this[s],i=e[(n=e.length-l)-1],r=-1;++r<n;)o=e[r],Er(o,u,a)?(Er(i,u,a)||t.push(Nr(i,o,u,a)),t.push(o)):Er(i,u,a)&&t.push(Nr(i,o,u,a)),i=o;l&&t.push(t[0]),u=a}return t};var rs,ns,as,is,os,ls=[],ss=[];Ur.prototype.prepare=function(){for(var t,e=this.edges,r=e.length;r--;)t=e[r].edge,t.b&&t.a||e.splice(r,1);return e.sort(Xr),e.length},rn.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}},nn.prototype={insert:function(t,e){var r,n,a;if(t){if(e.P=t,e.N=t.N,t.N&&(t.N.P=e),t.N=e,t.R){for(t=t.R;t.L;)t=t.L;t.L=e}else t.R=e;r=t}else this._?(t=sn(this._),e.P=null,e.N=t,t.P=t.L=e,r=t):(e.P=e.N=null,this._=e,r=null);for(e.L=e.R=null,e.U=r,e.C=!0,t=e;r&&r.C;)n=r.U,r===n.L?(a=n.R,a&&a.C?(r.C=a.C=!1,n.C=!0,t=n):(t===r.R&&(on(this,r),t=r,r=t.U),r.C=!1,n.C=!0,ln(this,n))):(a=n.L,a&&a.C?(r.C=a.C=!1,n.C=!0,t=n):(t===r.L&&(ln(this,r),t=r,r=t.U),r.C=!1,n.C=!0,on(this,n))),r=t.U;this._.C=!1},remove:function(t){t.N&&(t.N.P=t.P),t.P&&(t.P.N=t.N),t.N=t.P=null;var e,r,n,a=t.U,i=t.L,o=t.R;if(r=i?o?sn(o):i:o,a?a.L===t?a.L=r:a.R=r:this._=r,i&&o?(n=r.C,r.C=t.C,r.L=i,i.U=r,r!==o?(a=r.U,r.U=t.U,t=r.R,a.L=t,r.R=o,o.U=r):(r.U=a,a=r,t=r.R)):(n=t.C,t=r),t&&(t.U=a),!n){if(t&&t.C)return void(t.C=!1);do{if(t===this._)break;if(t===a.L){if(e=a.R,e.C&&(e.C=!1,a.C=!0,on(this,a),e=a.R),e.L&&e.L.C||e.R&&e.R.C){e.R&&e.R.C||(e.L.C=!1,e.C=!0,ln(this,e),e=a.R),e.C=a.C,a.C=e.R.C=!1,on(this,a),t=this._;break}}else if(e=a.L,e.C&&(e.C=!1,a.C=!0,ln(this,a),e=a.L),e.L&&e.L.C||e.R&&e.R.C){e.L&&e.L.C||(e.R.C=!1,e.C=!0,on(this,e),e=a.L),e.C=a.C,a.C=e.L.C=!1,ln(this,a),t=this._;break}e.C=!0,t=a,a=a.U}while(!t.C);t&&(t.C=!1)}}},co.geom.voronoi=function(t){function e(t){var e=new Array(t.length),n=l[0][0],a=l[0][1],i=l[1][0],o=l[1][1];return cn(r(t),l).cells.forEach(function(r,l){var s=r.edges,c=r.site;(e[l]=s.length?s.map(function(t){var e=t.start();return[e.x,e.y]}):c.x>=n&&c.x<=i&&c.y>=a&&c.y<=o?[[n,o],[i,o],[i,a],[n,a]]:[]).point=t[l]}),e}function r(t){return t.map(function(t,e){return{x:Math.round(i(t,e)/Ro)*Ro,y:Math.round(o(t,e)/Ro)*Ro,i:e}})}var n=Or,a=zr,i=n,o=a,l=cs;return t?e(t):(e.links=function(t){return cn(r(t)).edges.filter(function(t){return t.l&&t.r}).map(function(e){return{source:t[e.l.i],target:t[e.r.i]}})},e.triangles=function(t){var e=[];return cn(r(t)).cells.forEach(function(r,n){for(var a,i=r.site,o=r.edges.sort(Xr),l=-1,s=o.length,c=o[s-1].edge,u=c.l===i?c.r:c.l;++l<s;)c,a=u,c=o[l].edge,u=c.l===i?c.r:c.l,n<a.i&&n<u.i&&fn(i,a,u)<0&&e.push([t[n],t[a.i],t[u.i]])}),e},e.x=function(t){return arguments.length?(i=Ct(n=t),e):n},e.y=function(t){return arguments.length?(o=Ct(a=t),e):a},e.clipExtent=function(t){return arguments.length?(l=null==t?cs:t,e):l===cs?null:l},e.size=function(t){return arguments.length?e.clipExtent(t&&[[0,0],t]):l===cs?null:l&&l[1]},e)};var cs=[[-1e6,-1e6],[1e6,1e6]];co.geom.delaunay=function(t){return co.geom.voronoi().triangles(t)},co.geom.quadtree=function(t,e,r,n,a){function i(t){function i(t,e,r,n,a,i,o,l){if(!isNaN(r)&&!isNaN(n))if(t.leaf){var s=t.x,u=t.y;if(null!=s)if(bo(s-r)+bo(u-n)<.01)c(t,e,r,n,a,i,o,l);else{var f=t.point;t.x=t.y=t.point=null,c(t,f,s,u,a,i,o,l),c(t,e,r,n,a,i,o,l)}else t.x=r,t.y=n,t.point=e}else c(t,e,r,n,a,i,o,l)}function c(t,e,r,n,a,o,l,s){var c=.5*(a+l),u=.5*(o+s),f=r>=c,d=n>=u,p=d<<1|f;t.leaf=!1,t=t.nodes[p]||(t.nodes[p]=hn()),f?a=c:l=c,d?o=u:s=u,i(t,e,r,n,a,o,l,s)}var u,f,d,p,h,g,v,y,m,x=Ct(l),b=Ct(s);if(null!=e)g=e,v=r,y=n,m=a;else if(y=m=-(g=v=1/0),f=[],d=[],h=t.length,o)for(p=0;p<h;++p)u=t[p],u.x<g&&(g=u.x),u.y<v&&(v=u.y),u.x>y&&(y=u.x),u.y>m&&(m=u.y),f.push(u.x),d.push(u.y);else for(p=0;p<h;++p){var _=+x(u=t[p],p),w=+b(u,p);_<g&&(g=_),w<v&&(v=w),_>y&&(y=_),w>m&&(m=w),f.push(_),d.push(w)}var k=y-g,M=m-v;k>M?m=v+k:y=g+M;var A=hn();if(A.add=function(t){i(A,t,+x(t,++p),+b(t,p),g,v,y,m)},A.visit=function(t){gn(t,A,g,v,y,m)},A.find=function(t){return vn(A,t[0],t[1],g,v,y,m)},p=-1,null==e){for(;++p<h;)i(A,t[p],f[p],d[p],g,v,y,m);--p}else t.forEach(A.add);return f=d=t=u=null,A}var o,l=Or,s=zr;return(o=arguments.length)?(l=dn,s=pn,3===o&&(a=r,n=e,r=e=0),i(t)):(i.x=function(t){return arguments.length?(l=t,i):l},i.y=function(t){return arguments.length?(s=t,i):s},i.extent=function(t){return arguments.length?(null==t?e=r=n=a=null:(e=+t[0][0],r=+t[0][1],n=+t[1][0],a=+t[1][1]),i):null==e?null:[[e,r],[n,a]]},i.size=function(t){return arguments.length?(null==t?e=r=n=a=null:(e=r=0,n=+t[0],a=+t[1]),i):null==e?null:[n-e,a-r]},i)},co.interpolateRgb=yn,co.interpolateObject=mn,co.interpolateNumber=xn,co.interpolateString=bn;var us=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,fs=new RegExp(us.source,"g");co.interpolate=_n,co.interpolators=[function(t,e){var r=typeof e;return("string"===r?nl.has(e.toLowerCase())||/^(#|rgb\(|hsl\()/i.test(e)?yn:bn:e instanceof st?yn:Array.isArray(e)?wn:"object"===r&&isNaN(e)?mn:xn)(t,e)}],co.interpolateArray=wn;var ds=function(){return b},ps=co.map({linear:ds,poly:Sn,quad:function(){return Tn},cubic:function(){return Ln},sin:function(){return On},exp:function(){return zn},circle:function(){return Dn},elastic:Pn,back:En,bounce:function(){return Nn}}),hs=co.map({in:b,out:Mn,"in-out":An,"out-in":function(t){return An(Mn(t))}});co.ease=function(t){var e=t.indexOf("-"),r=e>=0?t.slice(0,e):t,n=e>=0?t.slice(e+1):"in";return r=ps.get(r)||ds,n=hs.get(n)||b,kn(n(r.apply(null,uo.call(arguments,1))))},co.interpolateHcl=In,co.interpolateHsl=Rn,co.interpolateLab=Fn,co.interpolateRound=jn,co.transform=function(t){var e=po.createElementNS(co.ns.prefix.svg,"g");return(co.transform=function(t){if(null!=t){e.setAttribute("transform",t);var r=e.transform.baseVal.consolidate()}return new Bn(r?r.matrix:gs)})(t)},Bn.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var gs={a:1,b:0,c:0,d:1,e:0,f:0};co.interpolateTransform=Wn,co.layout={},co.layout.bundle=function(){return function(t){for(var e=[],r=-1,n=t.length;++r<n;)e.push(Jn(t[r]));return e}},co.layout.chord=function(){function t(){var t,c,f,d,p,h={},g=[],v=co.range(i),y=[];for(r=[],n=[],t=0,d=-1;++d<i;){for(c=0,p=-1;++p<i;)c+=a[d][p];g.push(c),y.push(co.range(i)),t+=c}for(o&&v.sort(function(t,e){return o(g[t],g[e])}),l&&y.forEach(function(t,e){t.sort(function(t,r){return l(a[e][t],a[e][r])})}),t=(Bo-u*i)/t,c=0,d=-1;++d<i;){for(f=c,p=-1;++p<i;){ var m=v[d],x=y[m][p],b=a[m][x],_=c,w=c+=b*t;h[m+"-"+x]={index:m,subindex:x,startAngle:_,endAngle:w,value:b}}n[m]={index:m,startAngle:f,endAngle:c,value:g[m]},c+=u}for(d=-1;++d<i;)for(p=d-1;++p<i;){var k=h[d+"-"+p],M=h[p+"-"+d];(k.value||M.value)&&r.push(k.value<M.value?{source:M,target:k}:{source:k,target:M})}s&&e()}function e(){r.sort(function(t,e){return s((t.source.value+t.target.value)/2,(e.source.value+e.target.value)/2)})}var r,n,a,i,o,l,s,c={},u=0;return c.matrix=function(t){return arguments.length?(i=(a=t)&&a.length,r=n=null,c):a},c.padding=function(t){return arguments.length?(u=t,r=n=null,c):u},c.sortGroups=function(t){return arguments.length?(o=t,r=n=null,c):o},c.sortSubgroups=function(t){return arguments.length?(l=t,r=null,c):l},c.sortChords=function(t){return arguments.length?(s=t,r&&e(),c):s},c.chords=function(){return r||t(),r},c.groups=function(){return n||t(),n},c},co.layout.force=function(){function t(t){return function(e,r,n,a){if(e.point!==t){var i=e.cx-t.x,o=e.cy-t.y,l=a-r,s=i*i+o*o;if(l*l/y<s){if(s<g){var c=e.charge/s;t.px-=i*c,t.py-=o*c}return!0}if(e.point&&s&&s<g){var c=e.pointCharge/s;t.px-=i*c,t.py-=o*c}}return!e.charge}}function e(t){t.px=co.event.x,t.py=co.event.y,s.resume()}var r,n,a,i,o,l,s={},c=co.dispatch("start","tick","end"),u=[1,1],f=.9,d=vs,p=ys,h=-30,g=ms,v=.1,y=.64,m=[],x=[];return s.tick=function(){if((a*=.99)<.005)return r=null,c.end({type:"end",alpha:a=0}),!0;var e,n,s,d,p,g,y,b,_,w=m.length,k=x.length;for(n=0;n<k;++n)s=x[n],d=s.source,p=s.target,b=p.x-d.x,_=p.y-d.y,(g=b*b+_*_)&&(g=a*o[n]*((g=Math.sqrt(g))-i[n])/g,b*=g,_*=g,p.x-=b*(y=d.weight+p.weight?d.weight/(d.weight+p.weight):.5),p.y-=_*y,d.x+=b*(y=1-y),d.y+=_*y);if((y=a*v)&&(b=u[0]/2,_=u[1]/2,n=-1,y))for(;++n<w;)s=m[n],s.x+=(b-s.x)*y,s.y+=(_-s.y)*y;if(h)for(ia(e=co.geom.quadtree(m),a,l),n=-1;++n<w;)(s=m[n]).fixed||e.visit(t(s));for(n=-1;++n<w;)s=m[n],s.fixed?(s.x=s.px,s.y=s.py):(s.x-=(s.px-(s.px=s.x))*f,s.y-=(s.py-(s.py=s.y))*f);c.tick({type:"tick",alpha:a})},s.nodes=function(t){return arguments.length?(m=t,s):m},s.links=function(t){return arguments.length?(x=t,s):x},s.size=function(t){return arguments.length?(u=t,s):u},s.linkDistance=function(t){return arguments.length?(d="function"==typeof t?t:+t,s):d},s.distance=s.linkDistance,s.linkStrength=function(t){return arguments.length?(p="function"==typeof t?t:+t,s):p},s.friction=function(t){return arguments.length?(f=+t,s):f},s.charge=function(t){return arguments.length?(h="function"==typeof t?t:+t,s):h},s.chargeDistance=function(t){return arguments.length?(g=t*t,s):Math.sqrt(g)},s.gravity=function(t){return arguments.length?(v=+t,s):v},s.theta=function(t){return arguments.length?(y=t*t,s):Math.sqrt(y)},s.alpha=function(t){return arguments.length?(t=+t,a?t>0?a=t:(r.c=null,r.t=NaN,r=null,c.end({type:"end",alpha:a=0})):t>0&&(c.start({type:"start",alpha:a=t}),r=Pt(s.tick)),s):a},s.start=function(){function t(t,n){if(!r){for(r=new Array(a),s=0;s<a;++s)r[s]=[];for(s=0;s<c;++s){var i=x[s];r[i.source.index].push(i.target),r[i.target.index].push(i.source)}}for(var o,l=r[e],s=-1,u=l.length;++s<u;)if(!isNaN(o=l[s][t]))return o;return Math.random()*n}var e,r,n,a=m.length,c=x.length,f=u[0],g=u[1];for(e=0;e<a;++e)(n=m[e]).index=e,n.weight=0;for(e=0;e<c;++e)n=x[e],"number"==typeof n.source&&(n.source=m[n.source]),"number"==typeof n.target&&(n.target=m[n.target]),++n.source.weight,++n.target.weight;for(e=0;e<a;++e)n=m[e],isNaN(n.x)&&(n.x=t("x",f)),isNaN(n.y)&&(n.y=t("y",g)),isNaN(n.px)&&(n.px=n.x),isNaN(n.py)&&(n.py=n.y);if(i=[],"function"==typeof d)for(e=0;e<c;++e)i[e]=+d.call(this,x[e],e);else for(e=0;e<c;++e)i[e]=d;if(o=[],"function"==typeof p)for(e=0;e<c;++e)o[e]=+p.call(this,x[e],e);else for(e=0;e<c;++e)o[e]=p;if(l=[],"function"==typeof h)for(e=0;e<a;++e)l[e]=+h.call(this,m[e],e);else for(e=0;e<a;++e)l[e]=h;return s.resume()},s.resume=function(){return s.alpha(.1)},s.stop=function(){return s.alpha(0)},s.drag=function(){if(n||(n=co.behavior.drag().origin(b).on("dragstart.force",ea).on("drag.force",e).on("dragend.force",ra)),!arguments.length)return n;this.on("mouseover.force",na).on("mouseout.force",aa).call(n)},co.rebind(s,c,"on")};var vs=20,ys=1,ms=1/0;co.layout.hierarchy=function(){function t(a){var i,o=[a],l=[];for(a.depth=0;null!=(i=o.pop());)if(l.push(i),(c=r.call(t,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;n&&(i.value=0),i.children=c}else n&&(i.value=+n.call(t,i,i.depth)||0),delete i.children;return sa(a,function(t){var r,a;e&&(r=t.children)&&r.sort(e),n&&(a=t.parent)&&(a.value+=t.value)}),l}var e=fa,r=ca,n=ua;return t.sort=function(r){return arguments.length?(e=r,t):e},t.children=function(e){return arguments.length?(r=e,t):r},t.value=function(e){return arguments.length?(n=e,t):n},t.revalue=function(e){return n&&(la(e,function(t){t.children&&(t.value=0)}),sa(e,function(e){var r;e.children||(e.value=+n.call(t,e,e.depth)||0),(r=e.parent)&&(r.value+=e.value)})),e},t},co.layout.partition=function(){function t(e,r,n,a){var i=e.children;if(e.x=r,e.y=e.depth*a,e.dx=n,e.dy=a,i&&(o=i.length)){var o,l,s,c=-1;for(n=e.value?n/e.value:0;++c<o;)t(l=i[c],r,s=l.value*n,a),r+=s}}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}function r(r,i){var o=n.call(this,r,i);return t(o[0],0,a[0],a[1]/e(o[0])),o}var n=co.layout.hierarchy(),a=[1,1];return r.size=function(t){return arguments.length?(a=t,r):a},oa(r,n)},co.layout.pie=function(){function t(o){var l,s=o.length,c=o.map(function(r,n){return+e.call(t,r,n)}),u=+("function"==typeof n?n.apply(this,arguments):n),f=("function"==typeof a?a.apply(this,arguments):a)-u,d=Math.min(Math.abs(f)/s,+("function"==typeof i?i.apply(this,arguments):i)),p=d*(f<0?-1:1),h=co.sum(c),g=h?(f-s*p)/h:0,v=co.range(s),y=[];return null!=r&&v.sort(r===xs?function(t,e){return c[e]-c[t]}:function(t,e){return r(o[t],o[e])}),v.forEach(function(t){y[t]={data:o[t],value:l=c[t],startAngle:u,endAngle:u+=l*g+p,padAngle:d}}),y}var e=Number,r=xs,n=0,a=Bo,i=0;return t.value=function(r){return arguments.length?(e=r,t):e},t.sort=function(e){return arguments.length?(r=e,t):r},t.startAngle=function(e){return arguments.length?(n=e,t):n},t.endAngle=function(e){return arguments.length?(a=e,t):a},t.padAngle=function(e){return arguments.length?(i=e,t):i},t};var xs={};co.layout.stack=function(){function t(l,s){if(!(d=l.length))return l;var c=l.map(function(r,n){return e.call(t,r,n)}),u=c.map(function(e){return e.map(function(e,r){return[i.call(t,e,r),o.call(t,e,r)]})}),f=r.call(t,u,s);c=co.permute(c,f),u=co.permute(u,f);var d,p,h,g,v=n.call(t,u,s),y=c[0].length;for(h=0;h<y;++h)for(a.call(t,c[0][h],g=v[h],u[0][h][1]),p=1;p<d;++p)a.call(t,c[p][h],g+=u[p-1][h][1],u[p][h][1]);return l}var e=b,r=va,n=ya,a=ga,i=pa,o=ha;return t.values=function(r){return arguments.length?(e=r,t):e},t.order=function(e){return arguments.length?(r="function"==typeof e?e:bs.get(e)||va,t):r},t.offset=function(e){return arguments.length?(n="function"==typeof e?e:_s.get(e)||ya,t):n},t.x=function(e){return arguments.length?(i=e,t):i},t.y=function(e){return arguments.length?(o=e,t):o},t.out=function(e){return arguments.length?(a=e,t):a},t};var bs=co.map({"inside-out":function(t){var e,r,n=t.length,a=t.map(ma),i=t.map(xa),o=co.range(n).sort(function(t,e){return a[t]-a[e]}),l=0,s=0,c=[],u=[];for(e=0;e<n;++e)r=o[e],l<s?(l+=i[r],c.push(r)):(s+=i[r],u.push(r));return u.reverse().concat(c)},reverse:function(t){return co.range(t.length).reverse()},default:va}),_s=co.map({silhouette:function(t){var e,r,n,a=t.length,i=t[0].length,o=[],l=0,s=[];for(r=0;r<i;++r){for(e=0,n=0;e<a;e++)n+=t[e][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(t){var e,r,n,a,i,o,l,s,c,u=t.length,f=t[0],d=f.length,p=[];for(p[0]=s=c=0,r=1;r<d;++r){for(e=0,a=0;e<u;++e)a+=t[e][r][1];for(e=0,i=0,l=f[r][0]-f[r-1][0];e<u;++e){for(n=0,o=(t[e][r][1]-t[e][r-1][1])/(2*l);n<e;++n)o+=(t[n][r][1]-t[n][r-1][1])/l;i+=o*t[e][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(t){var e,r,n,a=t.length,i=t[0].length,o=1/a,l=[];for(r=0;r<i;++r){for(e=0,n=0;e<a;e++)n+=t[e][r][1];if(n)for(e=0;e<a;e++)t[e][r][1]/=n;else for(e=0;e<a;e++)t[e][r][1]=o}for(r=0;r<i;++r)l[r]=0;return l},zero:ya});co.layout.histogram=function(){function t(t,i){for(var o,l,s=[],c=t.map(r,this),u=n.call(this,c,i),f=a.call(this,u,c,i),i=-1,d=c.length,p=f.length-1,h=e?1:1/d;++i<p;)o=s[i]=[],o.dx=f[i+1]-(o.x=f[i]),o.y=0;if(p>0)for(i=-1;++i<d;)(l=c[i])>=u[0]&&l<=u[1]&&(o=s[co.bisect(f,l,1,p)-1],o.y+=h,o.push(t[i]));return s}var e=!0,r=Number,n=ka,a=_a;return t.value=function(e){return arguments.length?(r=e,t):r},t.range=function(e){return arguments.length?(n=Ct(e),t):n},t.bins=function(e){return arguments.length?(a="number"==typeof e?function(t){return wa(t,e)}:Ct(e),t):a},t.frequency=function(r){return arguments.length?(e=!!r,t):e},t},co.layout.pack=function(){function t(t,i){var o=r.call(this,t,i),l=o[0],s=a[0],c=a[1],u=null==e?Math.sqrt:"function"==typeof e?e:function(){return e};if(l.x=l.y=0,sa(l,function(t){t.r=+u(t.value)}),sa(l,Ca),n){var f=n*(e?1:Math.max(2*l.r/s,2*l.r/c))/2;sa(l,function(t){t.r+=f}),sa(l,Ca),sa(l,function(t){t.r-=f})}return za(l,s/2,c/2,e?1:1/Math.max(2*l.r/s,2*l.r/c)),o}var e,r=co.layout.hierarchy().sort(Ma),n=0,a=[1,1];return t.size=function(e){return arguments.length?(a=e,t):a},t.radius=function(r){return arguments.length?(e=null==r||"function"==typeof r?r:+r,t):e},t.padding=function(e){return arguments.length?(n=+e,t):n},oa(t,r)},co.layout.tree=function(){function t(t,a){var u=o.call(this,t,a),f=u[0],d=e(f);if(sa(d,r),d.parent.m=-d.z,la(d,n),c)la(f,i);else{var p=f,h=f,g=f;la(f,function(t){t.x<p.x&&(p=t),t.x>h.x&&(h=t),t.depth>g.depth&&(g=t)});var v=l(p,h)/2-p.x,y=s[0]/(h.x+l(h,p)/2+v),m=s[1]/(g.depth||1);la(f,function(t){t.x=(t.x+v)*y,t.y=t.depth*m})}return u}function e(t){for(var e,r={A:null,children:[t]},n=[r];null!=(e=n.pop());)for(var a,i=e.children,o=0,l=i.length;o<l;++o)n.push((i[o]=a={_:i[o],parent:e,children:(a=i[o].children)&&a.slice()||[],A:null,a:null,z:0,m:0,c:0,s:0,t:null,i:o}).a=a);return r.children[0]}function r(t){var e=t.children,r=t.parent.children,n=t.i?r[t.i-1]:null;if(e.length){Ra(t);var i=(e[0].z+e[e.length-1].z)/2;n?(t.z=n.z+l(t._,n._),t.m=t.z-i):t.z=i}else n&&(t.z=n.z+l(t._,n._));t.parent.A=a(t,n,t.parent.A||r[0])}function n(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function a(t,e,r){if(e){for(var n,a=t,i=t,o=e,s=a.parent.children[0],c=a.m,u=i.m,f=o.m,d=s.m;o=Na(o),a=Ea(a),o&&a;)s=Ea(s),i=Na(i),i.a=t,n=o.z+f-a.z-c+l(o._,a._),n>0&&(Ia(Fa(o,t,r),t,n),c+=n,u+=n),f+=o.m,c+=a.m,d+=s.m,u+=i.m;o&&!Na(i)&&(i.t=o,i.m+=f-u),a&&!Ea(s)&&(s.t=a,s.m+=c-d,r=t)}return r}function i(t){t.x*=s[0],t.y=t.depth*s[1]}var o=co.layout.hierarchy().sort(null).value(null),l=Pa,s=[1,1],c=null;return t.separation=function(e){return arguments.length?(l=e,t):l},t.size=function(e){return arguments.length?(c=null==(s=e)?i:null,t):c?null:s},t.nodeSize=function(e){return arguments.length?(c=null==(s=e)?null:i,t):c?s:null},oa(t,o)},co.layout.cluster=function(){function t(t,i){var o,l=e.call(this,t,i),s=l[0],c=0;sa(s,function(t){var e=t.children;e&&e.length?(t.x=Ba(e),t.y=ja(e)):(t.x=o?c+=r(t,o):0,t.y=0,o=t)});var u=qa(s),f=Ha(s),d=u.x-r(u,f)/2,p=f.x+r(f,u)/2;return sa(s,a?function(t){t.x=(t.x-s.x)*n[0],t.y=(s.y-t.y)*n[1]}:function(t){t.x=(t.x-d)/(p-d)*n[0],t.y=(1-(s.y?t.y/s.y:1))*n[1]}),l}var e=co.layout.hierarchy().sort(null).value(null),r=Pa,n=[1,1],a=!1;return t.separation=function(e){return arguments.length?(r=e,t):r},t.size=function(e){return arguments.length?(a=null==(n=e),t):a?null:n},t.nodeSize=function(e){return arguments.length?(a=null!=(n=e),t):a?n:null},oa(t,e)},co.layout.treemap=function(){function t(t,e){for(var r,n,a=-1,i=t.length;++a<i;)n=(r=t[a]).value*(e<0?0:e),r.area=isNaN(n)||n<=0?0:n}function e(r){var i=r.children;if(i&&i.length){var o,l,s,c=f(r),u=[],d=i.slice(),h=1/0,g="slice"===p?c.dx:"dice"===p?c.dy:"slice-dice"===p?1&r.depth?c.dy:c.dx:Math.min(c.dx,c.dy);for(t(d,c.dx*c.dy/r.value),u.area=0;(s=d.length)>0;)u.push(o=d[s-1]),u.area+=o.area,"squarify"!==p||(l=n(u,g))<=h?(d.pop(),h=l):(u.area-=u.pop().area,a(u,g,c,!1),g=Math.min(c.dx,c.dy),u.length=u.area=0,h=1/0);u.length&&(a(u,g,c,!0),u.length=u.area=0),i.forEach(e)}}function r(e){var n=e.children;if(n&&n.length){var i,o=f(e),l=n.slice(),s=[];for(t(l,o.dx*o.dy/e.value),s.area=0;i=l.pop();)s.push(i),s.area+=i.area,null!=i.z&&(a(s,i.z?o.dx:o.dy,o,!l.length),s.length=s.area=0);n.forEach(r)}}function n(t,e){for(var r,n=t.area,a=0,i=1/0,o=-1,l=t.length;++o<l;)(r=t[o].area)&&(r<i&&(i=r),r>a&&(a=r));return n*=n,e*=e,n?Math.max(e*a*h/n,n/(e*i*h)):1/0}function a(t,e,r,n){var a,i=-1,o=t.length,l=r.x,c=r.y,u=e?s(t.area/e):0;if(e==r.dx){for((n||u>r.dy)&&(u=r.dy);++i<o;)a=t[i],a.x=l,a.y=c,a.dy=u,l+=a.dx=Math.min(r.x+r.dx-l,u?s(a.area/u):0);a.z=!0,a.dx+=r.x+r.dx-l,r.y+=u,r.dy-=u}else{for((n||u>r.dx)&&(u=r.dx);++i<o;)a=t[i],a.x=l,a.y=c,a.dx=u,c+=a.dy=Math.min(r.y+r.dy-c,u?s(a.area/u):0);a.z=!1,a.dy+=r.y+r.dy-c,r.x+=u,r.dx-=u}}function i(n){var a=o||l(n),i=a[0];return i.x=i.y=0,i.value?(i.dx=c[0],i.dy=c[1]):i.dx=i.dy=0,o&&l.revalue(i),t([i],i.dx*i.dy/i.value),(o?r:e)(i),d&&(o=a),a}var o,l=co.layout.hierarchy(),s=Math.round,c=[1,1],u=null,f=Va,d=!1,p="squarify",h=.5*(1+Math.sqrt(5));return i.size=function(t){return arguments.length?(c=t,i):c},i.padding=function(t){function e(e){var r=t.call(i,e,e.depth);return null==r?Va(e):Ua(e,"number"==typeof r?[r,r,r,r]:r)}function r(e){return Ua(e,t)}if(!arguments.length)return u;var n;return f=null==(u=t)?Va:"function"==(n=typeof t)?e:"number"===n?(t=[t,t,t,t],r):r,i},i.round=function(t){return arguments.length?(s=t?Math.round:Number,i):s!=Number},i.sticky=function(t){return arguments.length?(d=t,o=null,i):d},i.ratio=function(t){return arguments.length?(h=t,i):h},i.mode=function(t){return arguments.length?(p=t+"",i):p},oa(i,l)},co.random={normal:function(t,e){var r=arguments.length;return r<2&&(e=1),r<1&&(t=0),function(){var r,n,a;do{r=2*Math.random()-1,n=2*Math.random()-1,a=r*r+n*n}while(!a||a>1);return t+e*r*Math.sqrt(-2*Math.log(a)/a)}},logNormal:function(){var t=co.random.normal.apply(co,arguments);return function(){return Math.exp(t())}},bates:function(t){var e=co.random.irwinHall(t);return function(){return e()/t}},irwinHall:function(t){return function(){for(var e=0,r=0;r<t;r++)e+=Math.random();return e}}},co.scale={};var ws={floor:b,ceil:b};co.scale.linear=function(){return $a([0,1],[0,1],_n,!1)};var ks={s:1,g:1,p:1,r:1,e:1};co.scale.log=function(){return ii(co.scale.linear().domain([0,1]),10,!0,[1,10])};var Ms=co.format(".0e"),As={floor:function(t){return-Math.ceil(-t)},ceil:function(t){return-Math.floor(-t)}};co.scale.pow=function(){return oi(co.scale.linear(),1,[0,1])},co.scale.sqrt=function(){return co.scale.pow().exponent(.5)},co.scale.ordinal=function(){return si([],{t:"range",a:[[]]})},co.scale.category10=function(){return co.scale.ordinal().range(Ts)},co.scale.category20=function(){return co.scale.ordinal().range(Ls)},co.scale.category20b=function(){return co.scale.ordinal().range(Cs)},co.scale.category20c=function(){return co.scale.ordinal().range(Ss)};var Ts=[2062260,16744206,2924588,14034728,9725885,9197131,14907330,8355711,12369186,1556175].map(_t),Ls=[2062260,11454440,16744206,16759672,2924588,10018698,14034728,16750742,9725885,12955861,9197131,12885140,14907330,16234194,8355711,13092807,12369186,14408589,1556175,10410725].map(_t),Cs=[3750777,5395619,7040719,10264286,6519097,9216594,11915115,13556636,9202993,12426809,15186514,15190932,8666169,11356490,14049643,15177372,8077683,10834324,13528509,14589654].map(_t),Ss=[3244733,7057110,10406625,13032431,15095053,16616764,16625259,16634018,3253076,7652470,10607003,13101504,7695281,10394312,12369372,14342891,6513507,9868950,12434877,14277081].map(_t);co.scale.quantile=function(){return ci([],[])},co.scale.quantize=function(){return ui(0,1,[0,1])},co.scale.threshold=function(){return fi([.5],[0,1])},co.scale.identity=function(){return di([0,1])},co.svg={},co.svg.arc=function(){function t(){var t=Math.max(0,+r.apply(this,arguments)),c=Math.max(0,+n.apply(this,arguments)),u=o.apply(this,arguments)-Ho,f=l.apply(this,arguments)-Ho,d=Math.abs(f-u),p=u>f?0:1;if(c<t&&(h=c,c=t,t=h),d>=qo)return e(c,p)+(t?e(t,1-p):"")+"Z";var h,g,v,y,m,x,b,_,w,k,M,A,T=0,L=0,C=[];if((y=(+s.apply(this,arguments)||0)/2)&&(v=i===Os?Math.sqrt(t*t+c*c):+i.apply(this,arguments),p||(L*=-1),c&&(L=nt(v/c*Math.sin(y))),t&&(T=nt(v/t*Math.sin(y)))),c){m=c*Math.cos(u+L),x=c*Math.sin(u+L),b=c*Math.cos(f-L),_=c*Math.sin(f-L);var S=Math.abs(f-u-2*L)<=jo?0:1;if(L&&xi(m,x,b,_)===p^S){var O=(u+f)/2;m=c*Math.cos(O),x=c*Math.sin(O),b=_=null}}else m=x=0;if(t){w=t*Math.cos(f-T),k=t*Math.sin(f-T),M=t*Math.cos(u+T),A=t*Math.sin(u+T);var z=Math.abs(u-f+2*T)<=jo?0:1;if(T&&xi(w,k,M,A)===1-p^z){var D=(u+f)/2;w=t*Math.cos(D),k=t*Math.sin(D),M=A=null}}else w=k=0;if(d>Ro&&(h=Math.min(Math.abs(c-t)/2,+a.apply(this,arguments)))>.001){g=t<c^p?0:1;var P=h,E=h;if(d<jo){var N=null==M?[w,k]:null==b?[m,x]:Nr([m,x],[M,A],[b,_],[w,k]),I=m-N[0],R=x-N[1],F=b-N[0],j=_-N[1],B=1/Math.sin(Math.acos((I*F+R*j)/(Math.sqrt(I*I+R*R)*Math.sqrt(F*F+j*j)))/2),q=Math.sqrt(N[0]*N[0]+N[1]*N[1]);E=Math.min(h,(t-q)/(B-1)),P=Math.min(h,(c-q)/(B+1))}if(null!=b){var H=bi(null==M?[w,k]:[M,A],[m,x],c,P,p),V=bi([b,_],[w,k],c,P,p);h===P?C.push("M",H[0],"A",P,",",P," 0 0,",g," ",H[1],"A",c,",",c," 0 ",1-p^xi(H[1][0],H[1][1],V[1][0],V[1][1]),",",p," ",V[1],"A",P,",",P," 0 0,",g," ",V[0]):C.push("M",H[0],"A",P,",",P," 0 1,",g," ",V[0])}else C.push("M",m,",",x);if(null!=M){var U=bi([m,x],[M,A],t,-E,p),G=bi([w,k],null==b?[m,x]:[b,_],t,-E,p);h===E?C.push("L",G[0],"A",E,",",E," 0 0,",g," ",G[1],"A",t,",",t," 0 ",p^xi(G[1][0],G[1][1],U[1][0],U[1][1]),",",1-p," ",U[1],"A",E,",",E," 0 0,",g," ",U[0]):C.push("L",G[0],"A",E,",",E," 0 0,",g," ",U[0])}else C.push("L",w,",",k)}else C.push("M",m,",",x),null!=b&&C.push("A",c,",",c," 0 ",S,",",p," ",b,",",_),C.push("L",w,",",k),null!=M&&C.push("A",t,",",t," 0 ",z,",",1-p," ",M,",",A);return C.push("Z"),C.join("")}function e(t,e){return"M0,"+t+"A"+t+","+t+" 0 1,"+e+" 0,"+-t+"A"+t+","+t+" 0 1,"+e+" 0,"+t}var r=hi,n=gi,a=pi,i=Os,o=vi,l=yi,s=mi;return t.innerRadius=function(e){return arguments.length?(r=Ct(e),t):r},t.outerRadius=function(e){return arguments.length?(n=Ct(e),t):n},t.cornerRadius=function(e){return arguments.length?(a=Ct(e),t):a},t.padRadius=function(e){return arguments.length?(i=e==Os?Os:Ct(e),t):i},t.startAngle=function(e){return arguments.length?(o=Ct(e),t):o},t.endAngle=function(e){return arguments.length?(l=Ct(e),t):l},t.padAngle=function(e){return arguments.length?(s=Ct(e),t):s},t.centroid=function(){var t=(+r.apply(this,arguments)+ +n.apply(this,arguments))/2,e=(+o.apply(this,arguments)+ +l.apply(this,arguments))/2-Ho;return[Math.cos(e)*t,Math.sin(e)*t]},t};var Os="auto";co.svg.line=function(){return _i(b)};var zs=co.map({linear:wi,"linear-closed":ki,step:Mi,"step-before":Ai,"step-after":Ti,basis:Di,"basis-open":Pi,"basis-closed":Ei,bundle:Ni,cardinal:Si,"cardinal-open":Li,"cardinal-closed":Ci,monotone:qi});zs.forEach(function(t,e){e.key=t,e.closed=/-closed$/.test(t)});var Ds=[0,2/3,1/3,0],Ps=[0,1/3,2/3,0],Es=[0,1/6,2/3,1/6];co.svg.line.radial=function(){var t=_i(Hi);return t.radius=t.x,delete t.x,t.angle=t.y,delete t.y,t},Ai.reverse=Ti,Ti.reverse=Ai,co.svg.area=function(){return Vi(b)},co.svg.area.radial=function(){var t=Vi(Hi);return t.radius=t.x,delete t.x,t.innerRadius=t.x0,delete t.x0,t.outerRadius=t.x1,delete t.x1,t.angle=t.y,delete t.y,t.startAngle=t.y0,delete t.y0,t.endAngle=t.y1,delete t.y1,t},co.svg.chord=function(){function t(t,l){var s=e(this,i,t,l),c=e(this,o,t,l);return"M"+s.p0+n(s.r,s.p1,s.a1-s.a0)+(r(s,c)?a(s.r,s.p1,s.r,s.p0):a(s.r,s.p1,c.r,c.p0)+n(c.r,c.p1,c.a1-c.a0)+a(c.r,c.p1,s.r,s.p0))+"Z"}function e(t,e,r,n){var a=e.call(t,r,n),i=l.call(t,a,n),o=s.call(t,a,n)-Ho,u=c.call(t,a,n)-Ho;return{r:i,a0:o,a1:u,p0:[i*Math.cos(o),i*Math.sin(o)],p1:[i*Math.cos(u),i*Math.sin(u)]}}function r(t,e){return t.a0==e.a0&&t.a1==e.a1}function n(t,e,r){return"A"+t+","+t+" 0 "+ +(r>jo)+",1 "+e}function a(t,e,r,n){return"Q 0,0 "+n}var i=br,o=_r,l=Ui,s=vi,c=yi;return t.radius=function(e){return arguments.length?(l=Ct(e),t):l},t.source=function(e){return arguments.length?(i=Ct(e),t):i},t.target=function(e){return arguments.length?(o=Ct(e),t):o},t.startAngle=function(e){return arguments.length?(s=Ct(e),t):s},t.endAngle=function(e){return arguments.length?(c=Ct(e),t):c},t},co.svg.diagonal=function(){function t(t,a){var i=e.call(this,t,a),o=r.call(this,t,a),l=(i.y+o.y)/2,s=[i,{x:i.x,y:l},{x:o.x,y:l},o];return s=s.map(n),"M"+s[0]+"C"+s[1]+" "+s[2]+" "+s[3]}var e=br,r=_r,n=Gi;return t.source=function(r){return arguments.length?(e=Ct(r),t):e},t.target=function(e){return arguments.length?(r=Ct(e),t):r},t.projection=function(e){return arguments.length?(n=e,t):n},t},co.svg.diagonal.radial=function(){var t=co.svg.diagonal(),e=Gi,r=t.projection;return t.projection=function(t){return arguments.length?r(Xi(e=t)):e},t},co.svg.symbol=function(){function t(t,n){return(Ns.get(e.call(this,t,n))||Wi)(r.call(this,t,n))}var e=Zi,r=Yi;return t.type=function(r){return arguments.length?(e=Ct(r),t):e},t.size=function(e){return arguments.length?(r=Ct(e),t):r},t};var Ns=co.map({circle:Wi,cross:function(t){var e=Math.sqrt(t/5)/2;return"M"+-3*e+","+-e+"H"+-e+"V"+-3*e+"H"+e+"V"+-e+"H"+3*e+"V"+e+"H"+e+"V"+3*e+"H"+-e+"V"+e+"H"+-3*e+"Z"},diamond:function(t){var e=Math.sqrt(t/(2*Rs)),r=e*Rs;return"M0,"+-e+"L"+r+",0 0,"+e+" "+-r+",0Z"},square:function(t){var e=Math.sqrt(t)/2;return"M"+-e+","+-e+"L"+e+","+-e+" "+e+","+e+" "+-e+","+e+"Z"},"triangle-down":function(t){var e=Math.sqrt(t/Is),r=e*Is/2;return"M0,"+r+"L"+e+","+-r+" "+-e+","+-r+"Z"},"triangle-up":function(t){var e=Math.sqrt(t/Is),r=e*Is/2;return"M0,"+-r+"L"+e+","+r+" "+-e+","+r+"Z"}});co.svg.symbolTypes=Ns.keys();var Is=Math.sqrt(3),Rs=Math.tan(30*Vo);So.transition=function(t){for(var e,r,n=Fs||++Hs,a=to(t),i=[],o=js||{time:Date.now(),ease:Cn,delay:0,duration:250},l=-1,s=this.length;++l<s;){i.push(e=[]);for(var c=this[l],u=-1,f=c.length;++u<f;)(r=c[u])&&eo(r,u,a,n,o),e.push(r)}return $i(i,a,n)},So.interrupt=function(t){return this.each(null==t?Bs:Qi(to(t)))};var Fs,js,Bs=Qi(to()),qs=[],Hs=0;qs.call=So.call,qs.empty=So.empty,qs.node=So.node,qs.size=So.size,co.transition=function(t,e){return t&&t.transition?Fs?t.transition(e):t:co.selection().transition(t)},co.transition.prototype=qs,qs.select=function(t){var e,r,n,a=this.id,i=this.namespace,o=[];t=O(t);for(var l=-1,s=this.length;++l<s;){o.push(e=[]);for(var c=this[l],u=-1,f=c.length;++u<f;)(n=c[u])&&(r=t.call(n,n.__data__,u,l))?("__data__"in n&&(r.__data__=n.__data__),eo(r,u,i,a,n[i][a]),e.push(r)):e.push(null)}return $i(o,i,a)},qs.selectAll=function(t){var e,r,n,a,i,o=this.id,l=this.namespace,s=[];t=z(t);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=t.call(n,n.__data__,d,c),s.push(e=[]);for(var h=-1,g=r.length;++h<g;)(a=r[h])&&eo(a,h,l,o,i),e.push(a)}return $i(s,l,o)},qs.filter=function(t){var e,r,n,a=[];"function"!=typeof t&&(t=V(t));for(var i=0,o=this.length;i<o;i++){a.push(e=[]);for(var r=this[i],l=0,s=r.length;l<s;l++)(n=r[l])&&t.call(n,n.__data__,l,i)&&e.push(n)}return $i(a,this.namespace,this.id)},qs.tween=function(t,e){var r=this.id,n=this.namespace;return arguments.length<2?this.node()[n][r].tween.get(t):G(this,null==e?function(e){e[n][r].tween.remove(t)}:function(a){a[n][r].tween.set(t,e)})},qs.attr=function(t,e){function r(){this.removeAttribute(l)}function n(){this.removeAttributeNS(l.space,l.local)}function a(t){return null==t?r:(t+="",function(){var e,r=this.getAttribute(l);return r!==t&&(e=o(r,t),function(t){this.setAttribute(l,e(t))})})}function i(t){return null==t?n:(t+="",function(){var e,r=this.getAttributeNS(l.space,l.local);return r!==t&&(e=o(r,t),function(t){this.setAttributeNS(l.space,l.local,e(t))})})}if(arguments.length<2){for(e in t)this.attr(e,t[e]);return this}var o="transform"==t?Wn:_n,l=co.ns.qualify(t);return Ji(this,"attr."+t,e,l.local?i:a)},qs.attrTween=function(t,e){function r(t,r){var n=e.call(this,t,r,this.getAttribute(a));return n&&function(t){this.setAttribute(a,n(t))}}function n(t,r){var n=e.call(this,t,r,this.getAttributeNS(a.space,a.local));return n&&function(t){this.setAttributeNS(a.space,a.local,n(t))}}var a=co.ns.qualify(t);return this.tween("attr."+t,a.local?n:r)},qs.style=function(t,e,r){function a(){this.style.removeProperty(t)}function i(e){return null==e?a:(e+="",function(){var a,i=n(this).getComputedStyle(this,null).getPropertyValue(t);return i!==e&&(a=_n(i,e),function(e){this.style.setProperty(t,a(e),r)})})}var o=arguments.length;if(o<3){if("string"!=typeof t){o<2&&(e="");for(r in t)this.style(r,t[r],e);return this}r=""}return Ji(this,"style."+t,e,i)},qs.styleTween=function(t,e,r){function a(a,i){var o=e.call(this,a,i,n(this).getComputedStyle(this,null).getPropertyValue(t));return o&&function(e){this.style.setProperty(t,o(e),r)}}return arguments.length<3&&(r=""),this.tween("style."+t,a)},qs.text=function(t){return Ji(this,"text",t,Ki)},qs.remove=function(){var t=this.namespace;return this.each("end.transition",function(){var e;this[t].count<2&&(e=this.parentNode)&&e.removeChild(this)})},qs.ease=function(t){var e=this.id,r=this.namespace;return arguments.length<1?this.node()[r][e].ease:("function"!=typeof t&&(t=co.ease.apply(co,arguments)),G(this,function(n){n[r][e].ease=t}))},qs.delay=function(t){var e=this.id,r=this.namespace;return arguments.length<1?this.node()[r][e].delay:G(this,"function"==typeof t?function(n,a,i){n[r][e].delay=+t.call(n,n.__data__,a,i)}:(t=+t,function(n){n[r][e].delay=t}))},qs.duration=function(t){var e=this.id,r=this.namespace;return arguments.length<1?this.node()[r][e].duration:G(this,"function"==typeof t?function(n,a,i){n[r][e].duration=Math.max(1,t.call(n,n.__data__,a,i))}:(t=Math.max(1,t),function(n){n[r][e].duration=t}))},qs.each=function(t,e){var r=this.id,n=this.namespace;if(arguments.length<2){var a=js,i=Fs;try{Fs=r,G(this,function(e,a,i){js=e[n][r],t.call(e,e.__data__,a,i)})}finally{js=a,Fs=i}}else G(this,function(a){var i=a[n][r];(i.event||(i.event=co.dispatch("start","end","interrupt"))).on(t,e)});return this},qs.transition=function(){for(var t,e,r,n,a=this.id,i=++Hs,o=this.namespace,l=[],s=0,c=this.length;s<c;s++){l.push(t=[]);for(var e=this[s],u=0,f=e.length;u<f;u++)(r=e[u])&&(n=r[o][a],eo(r,u,o,i,{time:n.time,ease:n.ease,delay:n.delay+n.duration,duration:n.duration})),t.push(r)}return $i(l,o,i)},co.svg.axis=function(){function t(t){t.each(function(){var t,c=co.select(this),u=this.__chart__||r,f=this.__chart__=r.copy(),d=null==s?f.ticks?f.ticks.apply(f,l):f.domain():s,p=null==e?f.tickFormat?f.tickFormat.apply(f,l):b:e,h=c.selectAll(".tick").data(d,f),g=h.enter().insert("g",".domain").attr("class","tick").style("opacity",Ro),v=co.transition(h.exit()).style("opacity",Ro).remove(),y=co.transition(h.order()).style("opacity",1),m=Math.max(a,0)+o,x=Xa(f),_=c.selectAll(".domain").data([0]),w=(_.enter().append("path").attr("class","domain"),co.transition(_));g.append("line"),g.append("text");var k,M,A,T,L=g.select("line"),C=y.select("line"),S=h.select("text").text(p),O=g.select("text"),z=y.select("text"),D="top"===n||"left"===n?-1:1;if("bottom"===n||"top"===n?(t=ro,k="x",A="y",M="x2",T="y2",S.attr("dy",D<0?"0em":".71em").style("text-anchor","middle"),w.attr("d","M"+x[0]+","+D*i+"V0H"+x[1]+"V"+D*i)):(t=no,k="y",A="x",M="y2",T="x2",S.attr("dy",".32em").style("text-anchor",D<0?"end":"start"),w.attr("d","M"+D*i+","+x[0]+"H0V"+x[1]+"H"+D*i)),L.attr(T,D*a),O.attr(A,D*m),C.attr(M,0).attr(T,D*a),z.attr(k,0).attr(A,D*m),f.rangeBand){var P=f,E=P.rangeBand()/2;u=f=function(t){return P(t)+E}}else u.rangeBand?u=f:v.call(t,f,u);g.call(t,u,f),y.call(t,f,f)})}var e,r=co.scale.linear(),n=Vs,a=6,i=6,o=3,l=[10],s=null;return t.scale=function(e){return arguments.length?(r=e,t):r},t.orient=function(e){return arguments.length?(n=e in Us?e+"":Vs,t):n},t.ticks=function(){return arguments.length?(l=fo(arguments),t):l},t.tickValues=function(e){return arguments.length?(s=e,t):s},t.tickFormat=function(r){return arguments.length?(e=r,t):e},t.tickSize=function(e){var r=arguments.length;return r?(a=+e,i=+arguments[r-1],t):a},t.innerTickSize=function(e){return arguments.length?(a=+e,t):a},t.outerTickSize=function(e){return arguments.length?(i=+e,t):i},t.tickPadding=function(e){return arguments.length?(o=+e,t):o},t.tickSubdivide=function(){return arguments.length&&t},t};var Vs="bottom",Us={top:1,right:1,bottom:1,left:1};co.svg.brush=function(){function t(n){n.each(function(){var n=co.select(this).style("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush",i).on("touchstart.brush",i),o=n.selectAll(".background").data([0]);o.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),n.selectAll(".extent").data([0]).enter().append("rect").attr("class","extent").style("cursor","move");var l=n.selectAll(".resize").data(g,b);l.exit().remove(),l.enter().append("g").attr("class",function(t){return"resize "+t}).style("cursor",function(t){return Gs[t]}).append("rect").attr("x",function(t){return/[ew]$/.test(t)?-3:null}).attr("y",function(t){return/^[ns]/.test(t)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden"),l.style("display",t.empty()?"none":null);var s,f=co.transition(n),d=co.transition(o);c&&(s=Xa(c),d.attr("x",s[0]).attr("width",s[1]-s[0]),r(f)),u&&(s=Xa(u),d.attr("y",s[0]).attr("height",s[1]-s[0]),a(f)),e(f)})}function e(t){t.selectAll(".resize").attr("transform",function(t){return"translate("+f[+/e$/.test(t)]+","+d[+/^s/.test(t)]+")"})}function r(t){t.select(".extent").attr("x",f[0]),t.selectAll(".extent,.n>rect,.s>rect").attr("width",f[1]-f[0])}function a(t){t.select(".extent").attr("y",d[0]),t.selectAll(".extent,.e>rect,.w>rect").attr("height",d[1]-d[0])}function i(){function i(){32==co.event.keyCode&&(S||(x=null,z[0]-=f[1],z[1]-=d[1],S=2),T())}function g(){32==co.event.keyCode&&2==S&&(z[0]+=f[1],z[1]+=d[1],S=0,T())}function v(){var t=co.mouse(_),n=!1;b&&(t[0]+=b[0],t[1]+=b[1]),S||(co.event.altKey?(x||(x=[(f[0]+f[1])/2,(d[0]+d[1])/2]),z[0]=f[+(t[0]<x[0])],z[1]=d[+(t[1]<x[1])]):x=null),L&&y(t,c,0)&&(r(M),n=!0),C&&y(t,u,1)&&(a(M),n=!0),n&&(e(M),k({type:"brush",mode:S?"move":"resize"}))}function y(t,e,r){var n,a,i=Xa(e),s=i[0],c=i[1],u=z[r],g=r?d:f,v=g[1]-g[0];if(S&&(s-=u,c-=v+u),n=(r?h:p)?Math.max(s,Math.min(c,t[r])):t[r],S?a=(n+=u)+v:(x&&(u=Math.max(s,Math.min(c,2*x[r]-n))),u<n?(a=n,n=u):a=u),g[0]!=n||g[1]!=a)return r?l=null:o=null,g[0]=n,g[1]=a,!0}function m(){v(),M.style("pointer-events","all").selectAll(".resize").style("display",t.empty()?"none":null),co.select("body").style("cursor",null),D.on("mousemove.brush",null).on("mouseup.brush",null).on("touchmove.brush",null).on("touchend.brush",null).on("keydown.brush",null).on("keyup.brush",null),O(),k({type:"brushend"})}var x,b,_=this,w=co.select(co.event.target),k=s.of(_,arguments),M=co.select(_),A=w.datum(),L=!/^(n|s)$/.test(A)&&c,C=!/^(e|w)$/.test(A)&&u,S=w.classed("extent"),O=$(_),z=co.mouse(_),D=co.select(n(_)).on("keydown.brush",i).on("keyup.brush",g);if(co.event.changedTouches?D.on("touchmove.brush",v).on("touchend.brush",m):D.on("mousemove.brush",v).on("mouseup.brush",m),M.interrupt().selectAll("*").interrupt(),S)z[0]=f[0]-z[0],z[1]=d[0]-z[1];else if(A){var P=+/w$/.test(A),E=+/^n/.test(A);b=[f[1-P]-z[0],d[1-E]-z[1]],z[0]=f[P],z[1]=d[E]}else co.event.altKey&&(x=z.slice());M.style("pointer-events","none").selectAll(".resize").style("display",null),co.select("body").style("cursor",w.style("cursor")),k({type:"brushstart"}),v()}var o,l,s=C(t,"brushstart","brush","brushend"),c=null,u=null,f=[0,0],d=[0,0],p=!0,h=!0,g=Xs[0];return t.event=function(t){t.each(function(){var t=s.of(this,arguments),e={x:f,y:d,i:o,j:l},r=this.__chart__||e;this.__chart__=e,Fs?co.select(this).transition().each("start.brush",function(){o=r.i,l=r.j,f=r.x,d=r.y,t({ type:"brushstart"})}).tween("brush:brush",function(){var r=wn(f,e.x),n=wn(d,e.y);return o=l=null,function(a){f=e.x=r(a),d=e.y=n(a),t({type:"brush",mode:"resize"})}}).each("end.brush",function(){o=e.i,l=e.j,t({type:"brush",mode:"resize"}),t({type:"brushend"})}):(t({type:"brushstart"}),t({type:"brush",mode:"resize"}),t({type:"brushend"}))})},t.x=function(e){return arguments.length?(c=e,g=Xs[!c<<1|!u],t):c},t.y=function(e){return arguments.length?(u=e,g=Xs[!c<<1|!u],t):u},t.clamp=function(e){return arguments.length?(c&&u?(p=!!e[0],h=!!e[1]):c?p=!!e:u&&(h=!!e),t):c&&u?[p,h]:c?p:u?h:null},t.extent=function(e){var r,n,a,i,s;return arguments.length?(c&&(r=e[0],n=e[1],u&&(r=r[0],n=n[0]),o=[r,n],c.invert&&(r=c(r),n=c(n)),n<r&&(s=r,r=n,n=s),r==f[0]&&n==f[1]||(f=[r,n])),u&&(a=e[0],i=e[1],c&&(a=a[1],i=i[1]),l=[a,i],u.invert&&(a=u(a),i=u(i)),i<a&&(s=a,a=i,i=s),a==d[0]&&i==d[1]||(d=[a,i])),t):(c&&(o?(r=o[0],n=o[1]):(r=f[0],n=f[1],c.invert&&(r=c.invert(r),n=c.invert(n)),n<r&&(s=r,r=n,n=s))),u&&(l?(a=l[0],i=l[1]):(a=d[0],i=d[1],u.invert&&(a=u.invert(a),i=u.invert(i)),i<a&&(s=a,a=i,i=s))),c&&u?[[r,a],[n,i]]:c?[r,n]:u&&[a,i])},t.clear=function(){return t.empty()||(f=[0,0],d=[0,0],o=l=null),t},t.empty=function(){return!!c&&f[0]==f[1]||!!u&&d[0]==d[1]},co.rebind(t,s,"on")};var Gs={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},Xs=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]],Ys=dl.format=ml.timeFormat,Zs=Ys.utc,Ws=Zs("%Y-%m-%dT%H:%M:%S.%LZ");Ys.iso=Date.prototype.toISOString&&+new Date("2000-01-01T00:00:00.000Z")?ao:Ws,ao.parse=function(t){var e=new Date(t);return isNaN(e)?null:e},ao.toString=Ws.toString,dl.second=Ht(function(t){return new pl(1e3*Math.floor(t/1e3))},function(t,e){t.setTime(t.getTime()+1e3*Math.floor(e))},function(t){return t.getSeconds()}),dl.seconds=dl.second.range,dl.seconds.utc=dl.second.utc.range,dl.minute=Ht(function(t){return new pl(6e4*Math.floor(t/6e4))},function(t,e){t.setTime(t.getTime()+6e4*Math.floor(e))},function(t){return t.getMinutes()}),dl.minutes=dl.minute.range,dl.minutes.utc=dl.minute.utc.range,dl.hour=Ht(function(t){var e=t.getTimezoneOffset()/60;return new pl(36e5*(Math.floor(t/36e5-e)+e))},function(t,e){t.setTime(t.getTime()+36e5*Math.floor(e))},function(t){return t.getHours()}),dl.hours=dl.hour.range,dl.hours.utc=dl.hour.utc.range,dl.month=Ht(function(t){return t=dl.day(t),t.setDate(1),t},function(t,e){t.setMonth(t.getMonth()+e)},function(t){return t.getMonth()}),dl.months=dl.month.range,dl.months.utc=dl.month.utc.range;var Qs=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],$s=[[dl.second,1],[dl.second,5],[dl.second,15],[dl.second,30],[dl.minute,1],[dl.minute,5],[dl.minute,15],[dl.minute,30],[dl.hour,1],[dl.hour,3],[dl.hour,6],[dl.hour,12],[dl.day,1],[dl.day,2],[dl.week,1],[dl.month,1],[dl.month,3],[dl.year,1]],Js=Ys.multi([[".%L",function(t){return t.getMilliseconds()}],[":%S",function(t){return t.getSeconds()}],["%I:%M",function(t){return t.getMinutes()}],["%I %p",function(t){return t.getHours()}],["%a %d",function(t){return t.getDay()&&1!=t.getDate()}],["%b %d",function(t){return 1!=t.getDate()}],["%B",function(t){return t.getMonth()}],["%Y",ze]]),Ks={range:function(t,e,r){return co.range(Math.ceil(t/r)*r,+e,r).map(oo)},floor:b,ceil:b};$s.year=dl.year,dl.scale=function(){return io(co.scale.linear(),$s,Js)};var tc=$s.map(function(t){return[t[0].utc,t[1]]}),ec=Zs.multi([[".%L",function(t){return t.getUTCMilliseconds()}],[":%S",function(t){return t.getUTCSeconds()}],["%I:%M",function(t){return t.getUTCMinutes()}],["%I %p",function(t){return t.getUTCHours()}],["%a %d",function(t){return t.getUTCDay()&&1!=t.getUTCDate()}],["%b %d",function(t){return 1!=t.getUTCDate()}],["%B",function(t){return t.getUTCMonth()}],["%Y",ze]]);tc.year=dl.year.utc,dl.scale.utc=function(){return io(co.scale.linear(),tc,ec)},co.text=St(function(t){return t.responseText}),co.json=function(t,e){return Ot(t,"application/json",lo,e)},co.html=function(t,e){return Ot(t,"text/html",so,e)},co.xml=St(function(t){return t.responseXML}),"function"==typeof t&&t.amd?(this.d3=co,t(co)):"object"==typeof r&&r.exports?r.exports=co:this.d3=co}()},{}],8:[function(e,r,n){(function(a,i){!function(e,a){"object"==typeof n&&void 0!==r?r.exports=a():"function"==typeof t&&t.amd?t(a):e.ES6Promise=a()}(this,function(){"use strict";function t(t){return"function"==typeof t||"object"==typeof t&&null!==t}function r(t){return"function"==typeof t}function n(t){G=t}function o(t){X=t}function l(){return function(){U(c)}}function s(){var t=setTimeout;return function(){return t(c,1)}}function c(){for(var t=0;t<V;t+=2){(0,J[t])(J[t+1]),J[t]=void 0,J[t+1]=void 0}V=0}function u(t,e){var r=arguments,n=this,a=new this.constructor(d);void 0===a[tt]&&z(a);var i=n._state;return i?function(){var t=r[i-1];X(function(){return C(i,a,t,n._result)})}():M(n,a,t,e),a}function f(t){var e=this;if(t&&"object"==typeof t&&t.constructor===e)return t;var r=new e(d);return b(r,t),r}function d(){}function p(){return new TypeError("You cannot resolve a promise with itself")}function h(){return new TypeError("A promises callback cannot return that same promise.")}function g(t){try{return t.then}catch(t){return at.error=t,at}}function v(t,e,r,n){try{t.call(e,r,n)}catch(t){return t}}function y(t,e,r){X(function(t){var n=!1,a=v(r,e,function(r){n||(n=!0,e!==r?b(t,r):w(t,r))},function(e){n||(n=!0,k(t,e))},"Settle: "+(t._label||" unknown promise"));!n&&a&&(n=!0,k(t,a))},t)}function m(t,e){e._state===rt?w(t,e._result):e._state===nt?k(t,e._result):M(e,void 0,function(e){return b(t,e)},function(e){return k(t,e)})}function x(t,e,n){e.constructor===t.constructor&&n===u&&e.constructor.resolve===f?m(t,e):n===at?k(t,at.error):void 0===n?w(t,e):r(n)?y(t,e,n):w(t,e)}function b(e,r){e===r?k(e,p()):t(r)?x(e,r,g(r)):w(e,r)}function _(t){t._onerror&&t._onerror(t._result),A(t)}function w(t,e){t._state===et&&(t._result=e,t._state=rt,0!==t._subscribers.length&&X(A,t))}function k(t,e){t._state===et&&(t._state=nt,t._result=e,X(_,t))}function M(t,e,r,n){var a=t._subscribers,i=a.length;t._onerror=null,a[i]=e,a[i+rt]=r,a[i+nt]=n,0===i&&t._state&&X(A,t)}function A(t){var e=t._subscribers,r=t._state;if(0!==e.length){for(var n=void 0,a=void 0,i=t._result,o=0;o<e.length;o+=3)n=e[o],a=e[o+r],n?C(r,n,a,i):a(i);t._subscribers.length=0}}function T(){this.error=null}function L(t,e){try{return t(e)}catch(t){return it.error=t,it}}function C(t,e,n,a){var i=r(n),o=void 0,l=void 0,s=void 0,c=void 0;if(i){if(o=L(n,a),o===it?(c=!0,l=o.error,o=null):s=!0,e===o)return void k(e,h())}else o=a,s=!0;e._state!==et||(i&&s?b(e,o):c?k(e,l):t===rt?w(e,o):t===nt&&k(e,o))}function S(t,e){try{e(function(e){b(t,e)},function(e){k(t,e)})}catch(e){k(t,e)}}function O(){return ot++}function z(t){t[tt]=ot++,t._state=void 0,t._result=void 0,t._subscribers=[]}function D(t,e){this._instanceConstructor=t,this.promise=new t(d),this.promise[tt]||z(this.promise),H(e)?(this._input=e,this.length=e.length,this._remaining=e.length,this._result=new Array(this.length),0===this.length?w(this.promise,this._result):(this.length=this.length||0,this._enumerate(),0===this._remaining&&w(this.promise,this._result))):k(this.promise,P())}function P(){return new Error("Array Methods must be provided an Array")}function E(t){return new D(this,t).promise}function N(t){var e=this;return new e(H(t)?function(r,n){for(var a=t.length,i=0;i<a;i++)e.resolve(t[i]).then(r,n)}:function(t,e){return e(new TypeError("You must pass an array to race."))})}function I(t){var e=this,r=new e(d);return k(r,t),r}function R(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function F(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}function j(t){this[tt]=O(),this._result=this._state=void 0,this._subscribers=[],d!==t&&("function"!=typeof t&&R(),this instanceof j?S(this,t):F())}function B(){var t=void 0;if(void 0!==i)t=i;else if("undefined"!=typeof self)t=self;else try{t=Function("return this")()}catch(t){throw new Error("polyfill failed because global object is unavailable in this environment")}var e=t.Promise;if(e){var r=null;try{r=Object.prototype.toString.call(e.resolve())}catch(t){}if("[object Promise]"===r&&!e.cast)return}t.Promise=j}var q=void 0;q=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)};var H=q,V=0,U=void 0,G=void 0,X=function(t,e){J[V]=t,J[V+1]=e,2===(V+=2)&&(G?G(c):K())},Y="undefined"!=typeof window?window:void 0,Z=Y||{},W=Z.MutationObserver||Z.WebKitMutationObserver,Q="undefined"==typeof self&&void 0!==a&&"[object process]"==={}.toString.call(a),$="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,J=new Array(1e3),K=void 0;K=Q?function(){return function(){return a.nextTick(c)}}():W?function(){var t=0,e=new W(c),r=document.createTextNode("");return e.observe(r,{characterData:!0}),function(){r.data=t=++t%2}}():$?function(){var t=new MessageChannel;return t.port1.onmessage=c,function(){return t.port2.postMessage(0)}}():void 0===Y&&"function"==typeof e?function(){try{var t=e,r=t("vertx");return U=r.runOnLoop||r.runOnContext,l()}catch(t){return s()}}():s();var tt=Math.random().toString(36).substring(16),et=void 0,rt=1,nt=2,at=new T,it=new T,ot=0;return D.prototype._enumerate=function(){for(var t=this.length,e=this._input,r=0;this._state===et&&r<t;r++)this._eachEntry(e[r],r)},D.prototype._eachEntry=function(t,e){var r=this._instanceConstructor,n=r.resolve;if(n===f){var a=g(t);if(a===u&&t._state!==et)this._settledAt(t._state,e,t._result);else if("function"!=typeof a)this._remaining--,this._result[e]=t;else if(r===j){var i=new r(d);x(i,t,a),this._willSettleAt(i,e)}else this._willSettleAt(new r(function(e){return e(t)}),e)}else this._willSettleAt(n(t),e)},D.prototype._settledAt=function(t,e,r){var n=this.promise;n._state===et&&(this._remaining--,t===nt?k(n,r):this._result[e]=r),0===this._remaining&&w(n,this._result)},D.prototype._willSettleAt=function(t,e){var r=this;M(t,void 0,function(t){return r._settledAt(rt,e,t)},function(t){return r._settledAt(nt,e,t)})},j.all=E,j.race=N,j.resolve=f,j.reject=I,j._setScheduler=n,j._setAsap=o,j._asap=X,j.prototype={constructor:j,then:u,catch:function(t){return this.then(null,t)}},B(),j.polyfill=B,j.Promise=j,j})}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:15}],9:[function(t,e,r){function n(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function a(t){return"function"==typeof t}function i(t){return"number"==typeof t}function o(t){return"object"==typeof t&&null!==t}function l(t){return void 0===t}e.exports=n,n.EventEmitter=n,n.prototype._events=void 0,n.prototype._maxListeners=void 0,n.defaultMaxListeners=10,n.prototype.setMaxListeners=function(t){if(!i(t)||t<0||isNaN(t))throw TypeError("n must be a positive number");return this._maxListeners=t,this},n.prototype.emit=function(t){var e,r,n,i,s,c;if(this._events||(this._events={}),"error"===t&&(!this._events.error||o(this._events.error)&&!this._events.error.length)){if((e=arguments[1])instanceof Error)throw e;var u=new Error('Uncaught, unspecified "error" event. ('+e+")");throw u.context=e,u}if(r=this._events[t],l(r))return!1;if(a(r))switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:i=Array.prototype.slice.call(arguments,1),r.apply(this,i)}else if(o(r))for(i=Array.prototype.slice.call(arguments,1),c=r.slice(),n=c.length,s=0;s<n;s++)c[s].apply(this,i);return!0},n.prototype.addListener=function(t,e){var r;if(!a(e))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",t,a(e.listener)?e.listener:e),this._events[t]?o(this._events[t])?this._events[t].push(e):this._events[t]=[this._events[t],e]:this._events[t]=e,o(this._events[t])&&!this._events[t].warned&&(r=l(this._maxListeners)?n.defaultMaxListeners:this._maxListeners)&&r>0&&this._events[t].length>r&&(this._events[t].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[t].length),"function"==typeof console.trace&&console.trace()),this},n.prototype.on=n.prototype.addListener,n.prototype.once=function(t,e){function r(){this.removeListener(t,r),n||(n=!0,e.apply(this,arguments))}if(!a(e))throw TypeError("listener must be a function");var n=!1;return r.listener=e,this.on(t,r),this},n.prototype.removeListener=function(t,e){var r,n,i,l;if(!a(e))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;if(r=this._events[t],i=r.length,n=-1,r===e||a(r.listener)&&r.listener===e)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,e);else if(o(r)){for(l=i;l-- >0;)if(r[l]===e||r[l].listener&&r[l].listener===e){n=l;break}if(n<0)return this;1===r.length?(r.length=0,delete this._events[t]):r.splice(n,1),this._events.removeListener&&this.emit("removeListener",t,e)}return this},n.prototype.removeAllListeners=function(t){var e,r;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[t]&&delete this._events[t],this;if(0===arguments.length){for(e in this._events)"removeListener"!==e&&this.removeAllListeners(e);return this.removeAllListeners("removeListener"),this._events={},this}if(r=this._events[t],a(r))this.removeListener(t,r);else if(r)for(;r.length;)this.removeListener(t,r[r.length-1]);return delete this._events[t],this},n.prototype.listeners=function(t){return this._events&&this._events[t]?a(this._events[t])?[this._events[t]]:this._events[t].slice():[]},n.prototype.listenerCount=function(t){if(this._events){var e=this._events[t];if(a(e))return 1;if(e)return e.length}return 0},n.listenerCount=function(t,e){return t.listenerCount(e)}},{}],10:[function(t,e,r){"use strict";function n(t){for(var e,r=t.length,n=0;n<r;n++)if(((e=t.charCodeAt(n))<9||e>13)&&32!==e&&133!==e&&160!==e&&5760!==e&&6158!==e&&(e<8192||e>8205)&&8232!==e&&8233!==e&&8239!==e&&8287!==e&&8288!==e&&12288!==e&&65279!==e)return!1;return!0}e.exports=function(t){var e=typeof t;if("string"===e){var r=t;if(0===(t=+t)&&n(r))return!1}else if("number"!==e)return!1;return t-t<1}},{}],11:[function(t,e,r){function n(t,e){var r=e[0],n=e[1],a=e[2],i=e[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,y=i*s;return t[0]=1-f-h,t[1]=u+y,t[2]=d-v,t[3]=0,t[4]=u-y,t[5]=1-c-h,t[6]=p+g,t[7]=0,t[8]=d+v,t[9]=p-g,t[10]=1-c-f,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}e.exports=n},{}],12:[function(t,e,r){(function(r){"use strict";var n,a=t("is-browser");n="function"==typeof r.matchMedia?!r.matchMedia("(hover: none)").matches:a,e.exports=n}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"is-browser":13}],13:[function(t,e,r){e.exports=!0},{}],14:[function(t,e,r){function n(t,e,r){e=e||t.currentTarget||t.srcElement,Array.isArray(r)||(r=[0,0]);var n=t.clientX||0,i=t.clientY||0,o=a(e);return r[0]=n-o.left,r[1]=i-o.top,r}function a(t){return t===window||t===document||t===document.body?i:t.getBoundingClientRect()}var i={left:0,top:0};e.exports=n},{}],15:[function(t,e,r){function n(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function i(t){if(f===setTimeout)return setTimeout(t,0);if((f===n||!f)&&setTimeout)return f=setTimeout,setTimeout(t,0);try{return f(t,0)}catch(e){try{return f.call(null,t,0)}catch(e){return f.call(this,t,0)}}}function o(t){if(d===clearTimeout)return clearTimeout(t);if((d===a||!d)&&clearTimeout)return d=clearTimeout,clearTimeout(t);try{return d(t)}catch(e){try{return d.call(null,t)}catch(e){return d.call(this,t)}}}function l(){v&&h&&(v=!1,h.length?g=h.concat(g):y=-1,g.length&&s())}function s(){if(!v){var t=i(l);v=!0;for(var e=g.length;e;){for(h=g,g=[];++y<e;)h&&h[y].run();y=-1,e=g.length}h=null,v=!1,o(t)}}function c(t,e){this.fun=t,this.array=e}function u(){}var f,d,p=e.exports={};!function(){try{f="function"==typeof setTimeout?setTimeout:n}catch(t){f=n}try{d="function"==typeof clearTimeout?clearTimeout:a}catch(t){d=a}}();var h,g=[],v=!1,y=-1;p.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];g.push(new c(t,e)),1!==g.length||v||i(s)},c.prototype.run=function(){this.fun.apply(null,this.array)},p.title="browser",p.browser=!0,p.env={},p.argv=[],p.version="",p.versions={},p.on=u,p.addListener=u,p.once=u,p.off=u,p.removeListener=u,p.removeAllListeners=u,p.emit=u,p.prependListener=u,p.prependOnceListener=u,p.listeners=function(t){return[]},p.binding=function(t){throw new Error("process.binding is not supported")},p.cwd=function(){return"/"},p.chdir=function(t){throw new Error("process.chdir is not supported")},p.umask=function(){return 0}},{}],16:[function(e,r,n){!function(e){function n(t,e){if(t=t||"",e=e||{},t instanceof n)return t;if(!(this instanceof n))return new n(t,e);var r=a(t);this._originalInput=t,this._r=r.r,this._g=r.g,this._b=r.b,this._a=r.a,this._roundA=H(100*this._a)/100,this._format=e.format||r.format,this._gradientType=e.gradientType,this._r<1&&(this._r=H(this._r)),this._g<1&&(this._g=H(this._g)),this._b<1&&(this._b=H(this._b)),this._ok=r.ok,this._tc_id=q++}function a(t){var e={r:0,g:0,b:0},r=1,n=null,a=null,o=null,s=!1,u=!1;return"string"==typeof t&&(t=R(t)),"object"==typeof t&&(I(t.r)&&I(t.g)&&I(t.b)?(e=i(t.r,t.g,t.b),s=!0,u="%"===String(t.r).substr(-1)?"prgb":"rgb"):I(t.h)&&I(t.s)&&I(t.v)?(n=P(t.s),a=P(t.v),e=c(t.h,n,a),s=!0,u="hsv"):I(t.h)&&I(t.s)&&I(t.l)&&(n=P(t.s),o=P(t.l),e=l(t.h,n,o),s=!0,u="hsl"),t.hasOwnProperty("a")&&(r=t.a)),r=T(r),{ok:s,format:t.format||u,r:V(255,U(e.r,0)),g:V(255,U(e.g,0)),b:V(255,U(e.b,0)),a:r}}function i(t,e,r){return{r:255*L(t,255),g:255*L(e,255),b:255*L(r,255)}}function o(t,e,r){t=L(t,255),e=L(e,255),r=L(r,255);var n,a,i=U(t,e,r),o=V(t,e,r),l=(i+o)/2;if(i==o)n=a=0;else{var s=i-o;switch(a=l>.5?s/(2-i-o):s/(i+o),i){case t:n=(e-r)/s+(e<r?6:0);break;case e:n=(r-t)/s+2;break;case r:n=(t-e)/s+4}n/=6}return{h:n,s:a,l:l}}function l(t,e,r){function n(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}var a,i,o;if(t=L(t,360),e=L(e,100),r=L(r,100),0===e)a=i=o=r;else{var l=r<.5?r*(1+e):r+e-r*e,s=2*r-l;a=n(s,l,t+1/3),i=n(s,l,t),o=n(s,l,t-1/3)}return{r:255*a,g:255*i,b:255*o}}function s(t,e,r){t=L(t,255),e=L(e,255),r=L(r,255);var n,a,i=U(t,e,r),o=V(t,e,r),l=i,s=i-o;if(a=0===i?0:s/i,i==o)n=0;else{switch(i){case t:n=(e-r)/s+(e<r?6:0);break;case e:n=(r-t)/s+2;break;case r:n=(t-e)/s+4}n/=6}return{h:n,s:a,v:l}}function c(t,r,n){t=6*L(t,360),r=L(r,100),n=L(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]}}function u(t,e,r,n){var a=[D(H(t).toString(16)),D(H(e).toString(16)),D(H(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 f(t,e,r,n,a){var i=[D(H(t).toString(16)),D(H(e).toString(16)),D(H(r).toString(16)),D(E(n))];return a&&i[0].charAt(0)==i[0].charAt(1)&&i[1].charAt(0)==i[1].charAt(1)&&i[2].charAt(0)==i[2].charAt(1)&&i[3].charAt(0)==i[3].charAt(1)?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0)+i[3].charAt(0):i.join("")}function d(t,e,r,n){return[D(E(n)),D(H(t).toString(16)),D(H(e).toString(16)),D(H(r).toString(16))].join("")}function p(t,e){e=0===e?0:e||10;var r=n(t).toHsl();return r.s-=e/100,r.s=C(r.s),n(r)}function h(t,e){e=0===e?0:e||10;var r=n(t).toHsl();return r.s+=e/100,r.s=C(r.s),n(r)}function g(t){return n(t).desaturate(100)}function v(t,e){e=0===e?0:e||10;var r=n(t).toHsl();return r.l+=e/100,r.l=C(r.l),n(r)}function y(t,e){e=0===e?0:e||10;var r=n(t).toRgb();return r.r=U(0,V(255,r.r-H(-e/100*255))),r.g=U(0,V(255,r.g-H(-e/100*255))),r.b=U(0,V(255,r.b-H(-e/100*255))),n(r)}function m(t,e){e=0===e?0:e||10;var r=n(t).toHsl();return r.l-=e/100,r.l=C(r.l),n(r)}function x(t,e){var r=n(t).toHsl(),a=(r.h+e)%360;return r.h=a<0?360+a:a,n(r)}function b(t){var e=n(t).toHsl();return e.h=(e.h+180)%360,n(e)}function _(t){var e=n(t).toHsl(),r=e.h;return[n(t),n({h:(r+120)%360,s:e.s,l:e.l}),n({h:(r+240)%360,s:e.s,l:e.l})]}function w(t){var e=n(t).toHsl(),r=e.h;return[n(t),n({h:(r+90)%360,s:e.s,l:e.l}),n({h:(r+180)%360,s:e.s,l:e.l}),n({h:(r+270)%360,s:e.s,l:e.l})]}function k(t){var e=n(t).toHsl(),r=e.h;return[n(t),n({h:(r+72)%360,s:e.s,l:e.l}),n({h:(r+216)%360,s:e.s,l:e.l})]}function M(t,e,r){e=e||6,r=r||30;var a=n(t).toHsl(),i=360/r,o=[n(t)];for(a.h=(a.h-(i*e>>1)+720)%360;--e;)a.h=(a.h+i)%360,o.push(n(a));return o}function A(t,e){e=e||6;for(var r=n(t).toHsv(),a=r.h,i=r.s,o=r.v,l=[],s=1/e;e--;)l.push(n({h:a,s:i,v:o})),o=(o+s)%1;return l}function T(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function L(t,r){O(t)&&(t="100%");var n=z(t);return t=V(r,U(0,parseFloat(t))),n&&(t=parseInt(t*r,10)/100),e.abs(t-r)<1e-6?1:t%r/parseFloat(r)}function C(t){return V(1,U(0,t))}function S(t){return parseInt(t,16)}function O(t){return"string"==typeof t&&-1!=t.indexOf(".")&&1===parseFloat(t)}function z(t){return"string"==typeof t&&-1!=t.indexOf("%")}function D(t){return 1==t.length?"0"+t:""+t}function P(t){return t<=1&&(t=100*t+"%"),t}function E(t){return e.round(255*parseFloat(t)).toString(16)}function N(t){return S(t)/255}function I(t){return!!Z.CSS_UNIT.exec(t)}function R(t){t=t.replace(j,"").replace(B,"").toLowerCase();var e=!1;if(X[t])t=X[t],e=!0;else if("transparent"==t)return{r:0,g:0,b:0,a:0,format:"name"};var r;return(r=Z.rgb.exec(t))?{r:r[1],g:r[2],b:r[3]}:(r=Z.rgba.exec(t))?{r:r[1],g:r[2],b:r[3],a:r[4]}:(r=Z.hsl.exec(t))?{h:r[1],s:r[2],l:r[3]}:(r=Z.hsla.exec(t))?{h:r[1],s:r[2],l:r[3],a:r[4]}:(r=Z.hsv.exec(t))?{h:r[1],s:r[2],v:r[3]}:(r=Z.hsva.exec(t))?{h:r[1],s:r[2],v:r[3],a:r[4]}:(r=Z.hex8.exec(t))?{r:S(r[1]),g:S(r[2]),b:S(r[3]),a:N(r[4]),format:e?"name":"hex8"}:(r=Z.hex6.exec(t))?{r:S(r[1]),g:S(r[2]),b:S(r[3]),format:e?"name":"hex"}:(r=Z.hex4.exec(t))?{r:S(r[1]+""+r[1]),g:S(r[2]+""+r[2]),b:S(r[3]+""+r[3]),a:N(r[4]+""+r[4]),format:e?"name":"hex8"}:!!(r=Z.hex3.exec(t))&&{r:S(r[1]+""+r[1]),g:S(r[2]+""+r[2]),b:S(r[3]+""+r[3]),format:e?"name":"hex"}}function F(t){var e,r;return t=t||{level:"AA",size:"small"},e=(t.level||"AA").toUpperCase(),r=(t.size||"small").toLowerCase(),"AA"!==e&&"AAA"!==e&&(e="AA"),"small"!==r&&"large"!==r&&(r="small"),{level:e,size:r}}var j=/^\s+/,B=/\s+$/,q=0,H=e.round,V=e.min,U=e.max,G=e.random;n.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(299*t.r+587*t.g+114*t.b)/1e3},getLuminance:function(){var t,r,n,a,i,o,l=this.toRgb();return t=l.r/255,r=l.g/255,n=l.b/255,a=t<=.03928?t/12.92:e.pow((t+.055)/1.055,2.4),i=r<=.03928?r/12.92:e.pow((r+.055)/1.055,2.4),o=n<=.03928?n/12.92:e.pow((n+.055)/1.055,2.4),.2126*a+.7152*i+.0722*o},setAlpha:function(t){return this._a=T(t),this._roundA=H(100*this._a)/100,this},toHsv:function(){var t=s(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=s(this._r,this._g,this._b),e=H(360*t.h),r=H(100*t.s),n=H(100*t.v);return 1==this._a?"hsv("+e+", "+r+"%, "+n+"%)":"hsva("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var t=o(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=o(this._r,this._g,this._b),e=H(360*t.h),r=H(100*t.s),n=H(100*t.l);return 1==this._a?"hsl("+e+", "+r+"%, "+n+"%)":"hsla("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(t){return u(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return f(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:H(this._r),g:H(this._g),b:H(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+H(this._r)+", "+H(this._g)+", "+H(this._b)+")":"rgba("+H(this._r)+", "+H(this._g)+", "+H(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:H(100*L(this._r,255))+"%",g:H(100*L(this._g,255))+"%",b:H(100*L(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+H(100*L(this._r,255))+"%, "+H(100*L(this._g,255))+"%, "+H(100*L(this._b,255))+"%)":"rgba("+H(100*L(this._r,255))+"%, "+H(100*L(this._g,255))+"%, "+H(100*L(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(Y[u(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e="#"+d(this._r,this._g,this._b,this._a),r=e,a=this._gradientType?"GradientType = 1, ":"";if(t){var i=n(t);r="#"+d(i._r,i._g,i._b,i._a)}return"progid:DXImageTransform.Microsoft.gradient("+a+"startColorstr="+e+",endColorstr="+r+")"},toString:function(t){var e=!!t;t=t||this._format;var r=!1,n=this._a<1&&this._a>=0;return e||!n||"hex"!==t&&"hex6"!==t&&"hex3"!==t&&"hex4"!==t&&"hex8"!==t&&"name"!==t?("rgb"===t&&(r=this.toRgbString()),"prgb"===t&&(r=this.toPercentageRgbString()),"hex"!==t&&"hex6"!==t||(r=this.toHexString()),"hex3"===t&&(r=this.toHexString(!0)),"hex4"===t&&(r=this.toHex8String(!0)),"hex8"===t&&(r=this.toHex8String()),"name"===t&&(r=this.toName()),"hsl"===t&&(r=this.toHslString()),"hsv"===t&&(r=this.toHsvString()),r||this.toHexString()):"name"===t&&0===this._a?this.toName():this.toRgbString()},clone:function(){return n(this.toString())},_applyModification:function(t,e){var r=t.apply(null,[this].concat([].slice.call(e)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(v,arguments)},brighten:function(){return this._applyModification(y,arguments)},darken:function(){return this._applyModification(m,arguments)},desaturate:function(){return this._applyModification(p,arguments)},saturate:function(){return this._applyModification(h,arguments)},greyscale:function(){return this._applyModification(g,arguments)},spin:function(){return this._applyModification(x,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(M,arguments)},complement:function(){return this._applyCombination(b,arguments)},monochromatic:function(){return this._applyCombination(A,arguments)},splitcomplement:function(){return this._applyCombination(k,arguments)},triad:function(){return this._applyCombination(_,arguments)},tetrad:function(){return this._applyCombination(w,arguments)}},n.fromRatio=function(t,e){if("object"==typeof t){var r={};for(var a in t)t.hasOwnProperty(a)&&(r[a]="a"===a?t[a]:P(t[a]));t=r}return n(t,e)},n.equals=function(t,e){return!(!t||!e)&&n(t).toRgbString()==n(e).toRgbString()},n.random=function(){return n.fromRatio({r:G(),g:G(),b:G()})},n.mix=function(t,e,r){r=0===r?0:r||50;var a=n(t).toRgb(),i=n(e).toRgb(),o=r/100;return n({r:(i.r-a.r)*o+a.r,g:(i.g-a.g)*o+a.g,b:(i.b-a.b)*o+a.b,a:(i.a-a.a)*o+a.a})},n.readability=function(t,r){var a=n(t),i=n(r);return(e.max(a.getLuminance(),i.getLuminance())+.05)/(e.min(a.getLuminance(),i.getLuminance())+.05)},n.isReadable=function(t,e,r){var a,i,o=n.readability(t,e);switch(i=!1,a=F(r),a.level+a.size){case"AAsmall":case"AAAlarge":i=o>=4.5;break;case"AAlarge":i=o>=3;break;case"AAAsmall":i=o>=7}return i},n.mostReadable=function(t,e,r){var a,i,o,l,s=null,c=0;r=r||{},i=r.includeFallbackColors,o=r.level,l=r.size;for(var u=0;u<e.length;u++)(a=n.readability(t,e[u]))>c&&(c=a,s=n(e[u]));return n.isReadable(t,s,{level:o,size:l})||!i?s:(r.includeFallbackColors=!1,n.mostReadable(t,["#fff","#000"],r))};var X=n.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"},Y=n.hexNames=function(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[t[r]]=r);return e}(X),Z=function(){var t="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)",e="[\\s|\\(]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")\\s*\\)?",r="[\\s|\\(]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")\\s*\\)?";return{CSS_UNIT:new RegExp(t),rgb:new RegExp("rgb"+e),rgba:new RegExp("rgba"+r),hsl:new RegExp("hsl"+e),hsla:new RegExp("hsla"+r),hsv:new RegExp("hsv"+e),hsva:new RegExp("hsva"+r),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})$/}}();void 0!==r&&r.exports?r.exports=n:"function"==typeof t&&t.amd?t(function(){return n}):window.tinycolor=n}(Math)},{}],17:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../plots/cartesian/axes"),i=t("./common_defaults"),o=t("./attributes")

e.exports=function(t,e,r,l,s){function c(r,a){return n.coerce(t,e,o,r,a)}l=l||{},s=s||{};var u=c("visible",!s.itemIsNotPlainObject),f=c("clicktoshow");if(!u&&!f)return e;i(t,e,r,c);for(var d=e.showarrow,p=["x","y"],h=[-10,-30],g={_fullLayout
r},v=0;v<2;v++){var y=p[v],m=a.coerceRef(t,e,g,y,"","paper");if(a.coercePosition(e,g,c,m,y,.5),d){var x="a"+y,b=a.coerceRef(t,e,g,x,"pixel");"pixel"!==b&&b!==m&&(b=e[x]="pixel");var _="pixel"===b?h[v]:.4;a.coercePosition(e,g,c,b,x,_)}c(y+"anchor"),c(y+"shift")}if(n.noneOrAll(t,e,["x","y"]),d&&n.noneOrAll(t,e,["ax","ay"]),f){var w=c("xclick"),k=c("yclick");e._xclick=void 0===w?e.x:a.cleanPosition(w,g,e.xref),e._yclick=void 0===k?e.y:a.cleanPosition(k,g,e.yref)}return e}},{"../../lib":149,"../../plots/cartesian/axes":189,"./attributes":19,"./common_defaults":22}],18:[function(t,e,r){"use strict";e.exports=[{path:"",backoff:0},{path:"M-2.4,-3V3L0.6,0Z",backoff:.6},{path:"M-3.7,-2.5V2.5L1.3,0Z",backoff:1.3},{path:"M-4.45,-3L-1.65,-0.2V0.2L-4.45,3L1.55,0Z",backoff:1.55},{path:"M-2.2,-2.2L-0.2,-0.2V0.2L-2.2,2.2L-1.4,3L1.6,0L-1.4,-3Z",backoff:1.6},{path:"M-4.4,-2.1L-0.6,-0.2V0.2L-4.4,2.1L-4,3L2,0L-4,-3Z",backoff:2},{path:"M2,0A2,2 0 1,1 0,-2A2,2 0 0,1 2,0Z",backoff:0,noRotate:!0},{path:"M2,2V-2H-2V2Z",backoff:0,noRotate:!0}]},{}],19:[function(t,e,r){"use strict";var n=t("./arrow_paths"),a=t("../../plots/font_attributes"),i=t("../../plots/cartesian/constants");e.exports={_isLinkedToArray:"annotation",visible:{valType:"boolean",dflt:!0,editType:"calcIfAutorange"},text:{valType:"string",editType:"calcIfAutorange"},textangle:{valType:"angle",dflt:0,editType:"calcIfAutorange"},font:a({editType:"calcIfAutorange",colorEditType:"arraydraw"}),width:{valType:"number",min:1,dflt:null,editType:"calcIfAutorange"},height:{valType:"number",min:1,dflt:null,editType:"calcIfAutorange"},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:"calcIfAutorange"},borderwidth:{valType:"number",min:0,dflt:1,editType:"calcIfAutorange"},showarrow:{valType:"boolean",dflt:!0,editType:"calcIfAutorange"},arrowcolor:{valType:"color",editType:"arraydraw"},arrowhead:{valType:"integer",min:0,max:n.length,dflt:1,editType:"arraydraw"},arrowsize:{valType:"number",min:.3,dflt:1,editType:"calcIfAutorange"},arrowwidth:{valType:"number",min:.1,editType:"calcIfAutorange"},standoff:{valType:"number",min:0,dflt:0,editType:"calcIfAutorange"},ax:{valType:"any",editType:"calcIfAutorange"},ay:{valType:"any",editType:"calcIfAutorange"},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:"calcIfAutorange"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto",editType:"calcIfAutorange"},xshift:{valType:"number",dflt:0,editType:"calcIfAutorange"},yref:{valType:"enumerated",values:["paper",i.idRegex.y.toString()],editType:"calc"},y:{valType:"any",editType:"calcIfAutorange"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto",editType:"calcIfAutorange"},yshift:{valType:"number",dflt:0,editType:"calcIfAutorange"},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"}}}},{"../../plots/cartesian/constants":194,"../../plots/font_attributes":213,"./arrow_paths":18}],20:[function(t,e,r){"use strict";function n(t){var e=t._fullLayout;a.filterVisible(e.annotations).forEach(function(e){var r,n,a=i.getFromId(t,e.xref),o=i.getFromId(t,e.yref),l=3*e.arrowsize*e.arrowwidth||0;a&&a.autorange&&(r=l+e.xshift,n=l-e.xshift,e.axref===e.xref?(i.expand(a,[a.r2c(e.x)],{ppadplus:r,ppadminus:n}),i.expand(a,[a.r2c(e.ax)],{ppadplus:e._xpadplus,ppadminus:e._xpadminus})):i.expand(a,[a.r2c(e.x)],{ppadplus:Math.max(e._xpadplus,r),ppadminus:Math.max(e._xpadminus,n)})),o&&o.autorange&&(r=l-e.yshift,n=l+e.yshift,e.ayref===e.yref?(i.expand(o,[o.r2c(e.y)],{ppadplus:r,ppadminus:n}),i.expand(o,[o.r2c(e.ay)],{ppadplus:e._ypadplus,ppadminus:e._ypadminus})):i.expand(o,[o.r2c(e.y)],{ppadplus:Math.max(e._ypadplus,r),ppadminus:Math.max(e._ypadminus,n)}))})}var a=t("../../lib"),i=t("../../plots/cartesian/axes"),o=t("./draw").draw;e.exports=function(t){var e=t._fullLayout,r=a.filterVisible(e.annotations);if(r.length&&t._fullData.length){var l={};r.forEach(function(t){l[t.xref]=!0,l[t.yref]=!0});if(i.list(t).filter(function(t){return t.autorange&&l[t._id]}).length)return a.syncOrAsync([o,n],t)}}},{"../../lib":149,"../../plots/cartesian/axes":189,"./draw":25}],21:[function(t,e,r){"use strict";function n(t,e){var r=i(t,e);return r.on.length>0||r.explicitOff.length>0}function a(t,e){var r,n=i(t,e),a=n.on,o=n.off.concat(n.explicitOff),s={};if(a.length||o.length){for(r=0;r<a.length;r++)s["annotations["+a[r]+"].visible"]=!0;for(r=0;r<o.length;r++)s["annotations["+o[r]+"].visible"]=!1;return l.update(t,{},s)}}function i(t,e){var r,n,a,i,l,s,c,u,f=t._fullLayout.annotations,d=[],p=[],h=[],g=(e||[]).length;for(r=0;r<f.length;r++)if(a=f[r],i=a.clicktoshow){for(n=0;n<g;n++)if(l=e[n],s=l.xaxis,c=l.yaxis,s._id===a.xref&&c._id===a.yref&&s.d2r(l.x)===o(a._xclick,s)&&c.d2r(l.y)===o(a._yclick,c)){u=a.visible?"onout"===i?p:h:d,u.push(r);break}n===g&&a.visible&&"onout"===i&&p.push(r)}return{on:d,off:p,explicitOff:h}}function o(t,e){return"log"===e.type?e.l2r(t):e.d2r(t)}var l=t("../../plotly");e.exports={hasClickToShow:n,onClick:a}},{"../../plotly":184}],22:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../color");e.exports=function(t,e,r,i){i("opacity");var o=i("bgcolor"),l=i("bordercolor"),s=a.opacity(l);i("borderpad");var c=i("borderwidth"),u=i("showarrow");i("text",u?" ":"new text"),i("textangle"),n.coerceFont(i,"font",r.font),i("width"),i("align"),i("height")&&i("valign"),u&&(i("arrowcolor",s?e.bordercolor:a.defaultLine),i("arrowhead"),i("arrowsize"),i("arrowwidth",2*(s&&c||1)),i("standoff"));var f=i("hovertext"),d=r.hoverlabel||{};if(f){var p=i("hoverlabel.bgcolor",d.bgcolor||(a.opacity(o)?a.rgb(o):a.defaultLine)),h=i("hoverlabel.bordercolor",d.bordercolor||a.contrast(p));n.coerceFont(i,"hoverlabel.font",{family:d.font.family,size:d.font.size,color:d.font.color||h})}i("captureevents",!!f)}},{"../../lib":149,"../color":34}],23:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib/to_log_range");e.exports=function(t,e,r,i){function o(t){var r=c[t],o=null;o=l?a(r,e.range):Math.pow(10,r),n(o)||(o=null),i(u+t,o)}e=e||{};var l="log"===r&&"linear"===e.type,s="linear"===r&&"log"===e.type;if(l||s)for(var c,u,f=t._fullLayout.annotations,d=e._id.charAt(0),p=0;p<f.length;p++)c=f[p],u="annotations["+p+"].",c[d+"ref"]===e._id&&o(d),c["a"+d+"ref"]===e._id&&o("a"+d)}},{"../../lib/to_log_range":171,"fast-isnumeric":10}],24:[function(t,e,r){"use strict";var n=t("../../plots/array_container_defaults"),a=t("./annotation_defaults");e.exports=function(t,e){n(t,e,{name:"annotations",handleItemDefaults:a})}},{"../../plots/array_container_defaults":186,"./annotation_defaults":17}],25:[function(t,e,r){"use strict";function n(t){var e=t._fullLayout;e._infolayer.selectAll(".annotation").remove();for(var r=0;r<e.annotations.length;r++)e.annotations[r].visible&&a(t,r);return s.previousPromises(t)}function a(t,e){var r=t._fullLayout,n=r.annotations[e]||{};i(t,n,e,!1,u.getFromId(t,n.xref),u.getFromId(t,n.yref))}function i(t,e,r,n,a,i){function s(r){return r.call(d.font,R).attr({"text-anchor":{left:"start",right:"end"}[e.align]||"middle"}),h.convertToTspans(r,t,u),r}function u(){function r(t,e){return"auto"===e&&(e=t<1/3?"left":t>2/3?"right":"center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[e]}var o=F.selectAll("a");if(1===o.size()&&o.text()===F.text()){O.insert("a",":first-child").attr({"xlink:xlink:href":o.attr("xlink:href"),"xlink:xlink:show":o.attr("xlink:show")}).style({cursor:"pointer"}).node().appendChild(E.node())}var s=O.select(".annotation-text-math-group"),u=!s.empty(),p=d.bBox((u?s:F).node()),m=p.width,S=p.height,D=e.width||m,R=e.height||S,j=Math.round(D+2*P),B=Math.round(R+2*P);e._w=D,e._h=R;for(var q=!1,H=["x","y"],V=0;V<H.length;V++){var U,G,X,Y,Z,W=H[V],Q=e[W+"ref"]||W,$=e["a"+W+"ref"],J={x:a,y:i}[W],K=(A+("x"===W?0:-90))*Math.PI/180,tt=j*Math.cos(K),et=B*Math.sin(K),rt=Math.abs(tt)+Math.abs(et),nt=e[W+"anchor"],at=e[W+"shift"]*("x"===W?1:-1),it=M[W];if(J){var ot=J.r2fraction(e[W]);if((t._dragging||!J.autorange)&&(ot<0||ot>1)&&($===Q?((ot=J.r2fraction(e["a"+W]))<0||ot>1)&&(q=!0):q=!0,q))continue;U=J._offset+J.r2p(e[W]),Y=.5}else"x"===W?(X=e[W],U=_.l+_.w*X):(X=1-e[W],U=_.t+_.h*X),Y=e.showarrow?.5:X;if(e.showarrow){it.head=U;var lt=e["a"+W];Z=tt*r(.5,e.xanchor)-et*r(.5,e.yanchor),$===Q?(it.tail=J._offset+J.r2p(lt),G=Z):(it.tail=U+lt,G=Z+lt),it.text=it.tail+Z;var st=b["x"===W?"width":"height"];if("paper"===Q&&(it.head=c.constrain(it.head,1,st-1)),"pixel"===$){var ct=-Math.max(it.tail-3,it.text),ut=Math.min(it.tail+3,it.text)-st;ct>0?(it.tail+=ct,it.text+=ct):ut>0&&(it.tail-=ut,it.text-=ut)}it.tail+=at,it.head+=at}else Z=rt*r(Y,nt),G=Z,it.text=U+Z;it.text+=at,Z+=at,G+=at,e["_"+W+"padplus"]=rt/2+G,e["_"+W+"padminus"]=rt/2-G,e["_"+W+"size"]=rt,e["_"+W+"shift"]=Z}if(q)return void O.remove();var ft=0,dt=0;if("left"!==e.align&&(ft=(D-m)*("center"===e.align?.5:1)),"top"!==e.valign&&(dt=(R-S)*("middle"===e.valign?.5:1)),u)s.select("svg").attr({x:P+ft-1,y:P+dt}).call(d.setClipUrl,N?k:null);else{var pt=P+dt-p.top,ht=P+ft-p.left;F.call(h.positionText,ht,pt).call(d.setClipUrl,N?k:null)}I.select("rect").call(d.setRect,P,P,D,R),E.call(d.setRect,z/2,z/2,j-z,B-z),O.call(d.setTranslate,Math.round(M.x.text-j/2),Math.round(M.y.text-B/2)),L.attr({transform:"rotate("+A+","+M.x.text+","+M.y.text+")"});var gt=function(r,o){T.selectAll(".annotation-arrow-g").remove();var s=M.x.head,u=M.y.head,p=M.x.tail+r,h=M.y.tail+o,g=M.x.text+r,m=M.y.text+o,b=c.rotationXYMatrix(A,g,m),k=c.apply2DTransform(b),C=c.apply2DTransform2(b),S=+E.attr("width"),z=+E.attr("height"),D=g-.5*S,P=D+S,N=m-.5*z,I=N+z,R=[[D,N,D,I],[D,I,P,I],[P,I,P,N],[P,N,D,N]].map(C);if(!R.reduce(function(t,e){return t^!!c.segmentsIntersect(s,u,s+1e6,u+1e6,e[0],e[1],e[2],e[3])},!1)){R.forEach(function(t){var e=c.segmentsIntersect(p,h,s,u,t[0],t[1],t[2],t[3]);e&&(p=e.x,h=e.y)});var F=e.arrowwidth,j=e.arrowcolor,B=T.append("g").style({opacity:f.opacity(j)}).classed("annotation-arrow-g",!0),q=B.append("path").attr("d","M"+p+","+h+"L"+s+","+u).style("stroke-width",F+"px").call(f.stroke,f.rgb(j));if(y(q,"end",e),w.annotationPosition&&q.node().parentNode&&!n){var H=s,V=u;if(e.standoff){var U=Math.sqrt(Math.pow(s-p,2)+Math.pow(u-h,2));H+=e.standoff*(p-s)/U,V+=e.standoff*(h-u)/U}var G,X,Y,Z=B.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(p-H)+","+(h-V),transform:"translate("+H+","+V+")"}).style("stroke-width",F+6+"px").call(f.stroke,"rgba(0,0,0,0)").call(f.fill,"rgba(0,0,0,0)");v.init({element:Z.node(),gd:t,prepFn:function(){var t=d.getTranslate(O);X=t.x,Y=t.y,G={},a&&a.autorange&&(G[a._name+".autorange"]=!0),i&&i.autorange&&(G[i._name+".autorange"]=!0)},moveFn:function(t,r){var n=k(X,Y),o=n[0]+t,l=n[1]+r;O.call(d.setTranslate,o,l),G[x+".x"]=a?a.p2r(a.r2p(e.x)+t):e.x+t/_.w,G[x+".y"]=i?i.p2r(i.r2p(e.y)+r):e.y-r/_.h,e.axref===e.xref&&(G[x+".ax"]=a.p2r(a.r2p(e.ax)+t)),e.ayref===e.yref&&(G[x+".ay"]=i.p2r(i.r2p(e.ay)+r)),B.attr("transform","translate("+t+","+r+")"),L.attr({transform:"rotate("+A+","+o+","+l+")"})},doneFn:function(e){if(e){l.relayout(t,G);var r=document.querySelector(".js-notes-box-panel");r&&r.redraw(r.selectedObj)}}})}}};if(e.showarrow&&gt(0,0),C){var vt,yt;v.init({element:O.node(),gd:t,prepFn:function(){yt=L.attr("transform"),vt={}},moveFn:function(t,r){var o="pointer";if(e.showarrow)e.axref===e.xref?vt[x+".ax"]=a.p2r(a.r2p(e.ax)+t):vt[x+".ax"]=e.ax+t,e.ayref===e.yref?vt[x+".ay"]=i.p2r(i.r2p(e.ay)+r):vt[x+".ay"]=e.ay+r,gt(t,r);else{if(n)return;if(a)vt[x+".x"]=e.x+t/a._m;else{var l=e._xsize/_.w,s=e.x+(e._xshift-e.xshift)/_.w-l/2;vt[x+".x"]=v.align(s+t/_.w,l,0,1,e.xanchor)}if(i)vt[x+".y"]=e.y+r/i._m;else{var c=e._ysize/_.h,u=e.y-(e._yshift+e.yshift)/_.h-c/2;vt[x+".y"]=v.align(u-r/_.h,c,0,1,e.yanchor)}a&&i||(o=v.getCursor(a?.5:vt[x+".x"],i?.5:vt[x+".y"],e.xanchor,e.yanchor))}L.attr({transform:"translate("+t+","+r+")"+yt}),g(O,o)},doneFn:function(e){if(g(O),e){l.relayout(t,vt);var r=document.querySelector(".js-notes-box-panel");r&&r.redraw(r.selectedObj)}}})}}var m,x,b=t._fullLayout,_=t._fullLayout._size,w=t._context.edits;n?(m="annotation-"+n,x=n+".annotations["+r+"]"):(m="annotation",x="annotations["+r+"]"),b._infolayer.selectAll("."+m+'[data-index="'+r+'"]').remove();var k="clip"+b._uid+"_ann"+r;if(!e._input||!1===e.visible)return void o.selectAll("#"+k).remove();var M={x:{},y:{}},A=+e.textangle||0,T=b._infolayer.append("g").classed(m,!0).attr("data-index",String(r)).style("opacity",e.opacity),L=T.append("g").classed("annotation-text-g",!0),C=w[e.showarrow?"annotationTail":"annotationPosition"],S=e.captureevents||w.annotationText||C,O=L.append("g").style("pointer-events",S?"all":null).call(g,"default").on("click",function(){t._dragging=!1;var a={index:r,annotation:e._input,fullAnnotation:e,event:o.event};n&&(a.subplotId=n),t.emit("plotly_clickannotation",a)});e.hovertext&&O.on("mouseover",function(){var r=e.hoverlabel,n=r.font,a=this.getBoundingClientRect(),i=t.getBoundingClientRect();p.loneHover({x0:a.left-i.left,x1:a.right-i.left,y:(a.top+a.bottom)/2-i.top,text:e.hovertext,color:r.bgcolor,borderColor:r.bordercolor,fontFamily:n.family,fontSize:n.size,fontColor:n.color},{container:b._hoverlayer.node(),outerContainer:b._paper.node(),gd:t})}).on("mouseout",function(){p.loneUnhover(b._hoverlayer.node())});var z=e.borderwidth,D=e.borderpad,P=z+D,E=O.append("rect").attr("class","bg").style("stroke-width",z+"px").call(f.stroke,e.bordercolor).call(f.fill,e.bgcolor),N=e.width||e.height,I=b._topclips.selectAll("#"+k).data(N?[0]:[]);I.enter().append("clipPath").classed("annclip",!0).attr("id",k).append("rect"),I.exit().remove();var R=e.font,F=O.append("text").classed("annotation-text",!0).text(e.text);w.annotationText?F.call(h.makeEditable,{delegate:O,gd:t}).call(s).on("edit",function(r){e.text=r,this.call(s);var n={};n[x+".text"]=e.text,a&&a.autorange&&(n[a._name+".autorange"]=!0),i&&i.autorange&&(n[i._name+".autorange"]=!0),l.relayout(t,n)}):F.call(s)}var o=t("d3"),l=t("../../plotly"),s=t("../../plots/plots"),c=t("../../lib"),u=t("../../plots/cartesian/axes"),f=t("../color"),d=t("../drawing"),p=t("../fx"),h=t("../../lib/svg_text_utils"),g=t("../../lib/setcursor"),v=t("../dragelement"),y=t("./draw_arrow_head");e.exports={draw:n,drawOne:a,drawRaw:i}},{"../../lib":149,"../../lib/setcursor":167,"../../lib/svg_text_utils":169,"../../plotly":184,"../../plots/cartesian/axes":189,"../../plots/plots":218,"../color":34,"../dragelement":55,"../drawing":58,"../fx":75,"./draw_arrow_head":26,d3:7}],26:[function(t,e,r){"use strict";var n=t("d3"),a=t("../color"),i=t("./arrow_paths");e.exports=function(t,e,r){function o(){t.style("stroke-dasharray","0px,100px")}function l(e,i){p.path&&(p.noRotate&&(i=0),n.select(d.parentNode).append("path").attr({class:t.attr("class"),d:p.path,transform:"translate("+e.x+","+e.y+")"+(i?"rotate("+180*i/Math.PI+")":"")+"scale("+h+")"}).style({fill:a.rgb(r.arrowcolor),"stroke-width":0}))}var s,c,u,f,d=t.node(),p=i[r.arrowhead||0],h=(r.arrowwidth||1)*r.arrowsize,g=e.indexOf("start")>=0,v=e.indexOf("end")>=0,y=p.backoff*h+r.standoff;if("line"===d.nodeName){s={x:+t.attr("x1"),y:+t.attr("y1")},c={x:+t.attr("x2"),y:+t.attr("y2")};var m=s.x-c.x,x=s.y-c.y;if(u=Math.atan2(x,m),f=u+Math.PI,y){if(y*y>m*m+x*x)return void o();var b=y*Math.cos(u),_=y*Math.sin(u);g&&(s.x-=b,s.y-=_,t.attr({x1:s.x,y1:s.y})),v&&(c.x+=b,c.y+=_,t.attr({x2:c.x,y2:c.y}))}}else if("path"===d.nodeName){var w=d.getTotalLength(),k="";if(w<y)return void o();if(g){var M=d.getPointAtLength(0),A=d.getPointAtLength(.1);u=Math.atan2(M.y-A.y,M.x-A.x),s=d.getPointAtLength(Math.min(y,w)),y&&(k="0px,"+y+"px,")}if(v){var T=d.getPointAtLength(w),L=d.getPointAtLength(w-.1);if(f=Math.atan2(T.y-L.y,T.x-L.x),c=d.getPointAtLength(Math.max(0,w-y)),y){var C=k?2*y:y;k+=w-C+"px,"+w+"px"}}else k&&(k+=w+"px");k&&t.style("stroke-dasharray",k)}g&&l(s,u),v&&l(c,f)}},{"../color":34,"./arrow_paths":18,d3:7}],27:[function(t,e,r){"use strict";var n=t("./draw"),a=t("./click");e.exports={moduleType:"component",name:"annotations",layoutAttributes:t("./attributes"),supplyLayoutDefaults:t("./defaults"),calcAutorange:t("./calc_autorange"),draw:n.draw,drawOne:n.drawOne,drawRaw:n.drawRaw,hasClickToShow:a.hasClickToShow,onClick:a.onClick,convertCoords:t("./convert_coords")}},{"./attributes":19,"./calc_autorange":20,"./click":21,"./convert_coords":23,"./defaults":24,"./draw":25}],28:[function(t,e,r){"use strict";var n=t("../annotations/attributes"),a=t("../../plot_api/edit_types").overrideAll;e.exports=a({_isLinkedToArray:"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,arrowsize:n.arrowsize,arrowwidth:n.arrowwidth,standoff:n.standoff,hovertext:n.hovertext,hoverlabel:n.hoverlabel,captureevents:n.captureevents},"calc","from-root")},{"../../plot_api/edit_types":173,"../annotations/attributes":19}],29:[function(t,e,r){"use strict";function n(t,e){var r=e.fullSceneLayout,n=r.domain,o=e.fullLayout._size,l={pdata:null,type:"linear",autorange:!1,range:[-1/0,1/0]};t._xa={},a.extendFlat(t._xa,l),i.setConvert(t._xa),t._xa._offset=o.l+n.x[0]*o.w,t._xa.l2p=function(){return.5*(1+t.pdata[0]/t.pdata[3])*o.w*(n.x[1]-n.x[0])},t._ya={},a.extendFlat(t._ya,l),i.setConvert(t._ya),t._ya._offset=o.t+(1-n.y[1])*o.h,t._ya.l2p=function(){return.5*(1-t.pdata[1]/t.pdata[3])*o.h*(n.y[1]-n.y[0])}}var a=t("../../lib"),i=t("../../plots/cartesian/axes");e.exports=function(t){for(var e=t.fullSceneLayout,r=e.annotations,a=0;a<r.length;a++)n(r[a],t);t.fullLayout._infolayer.selectAll(".annotation-"+t.id).remove()}},{"../../lib":149,"../../plots/cartesian/axes":189}],30:[function(t,e,r){"use strict";function n(t,e,r,n,o){function c(r,n){return a.coerce(t,e,s,r,n)}function u(t){var n=t+"axis",a={_fullLayout:{}};return a._fullLayout[n]=r[n],i.coercePosition(e,a,c,t,t,.5)}return c("visible",!o.itemIsNotPlainObject)?(l(t,e,n.fullLayout,c),u("x"),u("y"),u("z"),a.noneOrAll(t,e,["x","y","z"]),e.xref="x",e.yref="y",e.zref="z",c("xanchor"),c("yanchor"),c("xshift"),c("yshift"),e.showarrow&&(e.axref="pixel",e.ayref="pixel",c("ax",-10),c("ay",-30),a.noneOrAll(t,e,["ax","ay"])),e):e}var a=t("../../lib"),i=t("../../plots/cartesian/axes"),o=t("../../plots/array_container_defaults"),l=t("../annotations/common_defaults"),s=t("./attributes");e.exports=function(t,e,r){o(t,e,{name:"annotations",handleItemDefaults:n,fullLayout:r.fullLayout})}},{"../../lib":149,"../../plots/array_container_defaults":186,"../../plots/cartesian/axes":189,"../annotations/common_defaults":22,"./attributes":28}],31:[function(t,e,r){"use strict";var n=t("../annotations/draw").drawRaw,a=t("../../plots/gl3d/project"),i=["x","y","z"];e.exports=function(t){for(var e=t.fullSceneLayout,r=t.dataScale,o=e.annotations,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=e[f+"axis"],h=p.r2fraction(d);if(h<0||h>1){c=!0;break}}c?t.fullLayout._infolayer.select(".annotation-"+t.id+'[data-index="'+l+'"]').remove():(s.pdata=a(t.glplot.cameraParams,[e.xaxis.r2l(s.x)*r[0],e.yaxis.r2l(s.y)*r[1],e.zaxis.r2l(s.z)*r[2]]),n(t.graphDiv,s,l,t.id,s._xa,s._ya))}}},{"../../plots/gl3d/project":215,"../annotations/draw":25}],32:[function(t,e,r){"use strict";e.exports={moduleType:"component",name:"annotations3d",schema:{subplots:{scene:{annotations:t("./attributes")}}},layoutAttributes:t("./attributes"),handleDefaults:t("./defaults"),convert:t("./convert"),draw:t("./draw")}},{"./attributes":28,"./convert":29,"./defaults":30,"./draw":31}],33:[function(t,e,r){"use strict";r.defaults=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],r.defaultLine="#444",r.lightLine="#eee",r.background="#fff",r.borderLine="#BEC8D9",r.lightFraction=1e3/11},{}],34:[function(t,e,r){"use strict";function n(t){if(i(t)||"string"!=typeof t)return t;var e=t.trim();if("rgb"!==e.substr(0,3))return t;var r=e.match(/^rgba?\s*\(([^()]*)\)$/);if(!r)return t;var n=r[1].trim().split(/\s*[\s,]\s*/),a="a"===e.charAt(3)&&4===n.length;if(!a&&3!==n.length)return t;for(var o=0;o<n.length;o++){if(!n[o].length)return t;if(n[o]=Number(n[o]),!(n[o]>=0))return t;if(3===o)n[o]>1&&(n[o]=1);else if(n[o]>=1)return t}var l=Math.round(255*n[0])+", "+Math.round(255*n[1])+", "+Math.round(255*n[2]);return a?"rgba("+l+", "+n[3]+")":"rgb("+l+")"}var a=t("tinycolor2"),i=t("fast-isnumeric"),o=e.exports={},l=t("./attributes");o.defaults=l.defaults;var s=o.defaultLine=l.defaultLine;o.lightLine=l.lightLine;var c=o.background=l.background;o.tinyRGB=function(t){var e=t.toRgb();return"rgb("+Math.round(e.r)+", "+Math.round(e.g)+", "+Math.round(e.b)+")"},o.rgb=function(t){return o.tinyRGB(a(t))},o.opacity=function(t){return t?a(t).getAlpha():0},o.addOpacity=function(t,e){var r=a(t).toRgb();return"rgba("+Math.round(r.r)+", "+Math.round(r.g)+", "+Math.round(r.b)+", "+e+")"},o.combine=function(t,e){var r=a(t).toRgb();if(1===r.a)return a(t).toRgbString();var n=a(e||c).toRgb(),i=1===n.a?n:{r:255*(1-n.a)+n.r*n.a,g:255*(1-n.a)+n.g*n.a,b:255*(1-n.a)+n.b*n.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 a(o).toRgbString()},o.contrast=function(t,e,r){var n=a(t);return 1!==n.getAlpha()&&(n=a(o.combine(t,c))),(n.isDark()?e?n.lighten(e):c:r?n.darken(r):s).toString()},o.stroke=function(t,e){var r=a(e);t.style({stroke:o.tinyRGB(r),"stroke-opacity":r.getAlpha()})},o.fill=function(t,e){var r=a(e);t.style({fill:o.tinyRGB(r),"fill-opacity":r.getAlpha()})},o.clean=function(t){if(t&&"object"==typeof t){var e,r,a,i,l=Object.keys(t);for(e=0;e<l.length;e++)if(a=l[e],i=t[a],"color"===a.substr(a.length-5))if(Array.isArray(i))for(r=0;r<i.length;r++)i[r]=n(i[r]);else t[a]=n(i);else if("colorscale"===a.substr(a.length-10)&&Array.isArray(i))for(r=0;r<i.length;r++)Array.isArray(i[r])&&(i[r][1]=n(i[r][1]));else if(Array.isArray(i)){var s=i[0];if(!Array.isArray(s)&&s&&"object"==typeof s)for(r=0;r<i.length;r++)o.clean(i[r])}else i&&"object"==typeof i&&o.clean(i)}}},{"./attributes":33,"fast-isnumeric":10,tinycolor2:16}],35:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/layout_attributes"),a=t("../../plots/font_attributes"),i=t("../../lib/extend").extendFlat,o=t("../../plot_api/edit_types").overrideAll;e.exports=o({thicknessmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"pixels"},thickness:{valType:"number",min:0,dflt:30},lenmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"fraction"},len:{valType:"number",min:0,dflt:1},x:{valType:"number",dflt:1.02,min:-2,max:3},xanchor:{valType:"enumerated",values:["left","center","right"],dflt:"left"},xpad:{valType:"number",min:0,dflt:10},y:{valType:"number",dflt:.5,min:-2,max:3},yanchor:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle"},ypad:{valType:"number",min:0,dflt:10},outlinecolor:n.linecolor,outlinewidth:n.linewidth,bordercolor:n.linecolor,borderwidth:{valType:"number",min:0,dflt:0},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)"},tickmode:n.tickmode,nticks:n.nticks,tick0:n.tick0,dtick:n.dtick,tickvals:n.tickvals,ticktext:n.ticktext,ticks:i({},n.ticks,{dflt:""}),ticklen:n.ticklen,tickwidth:n.tickwidth,tickcolor:n.tickcolor,showticklabels:n.showticklabels,tickfont:a({}),tickangle:n.tickangle,tickformat:n.tickformat,tickprefix:n.tickprefix,showtickprefix:n.showtickprefix,ticksuffix:n.ticksuffix,showticksuffix:n.showticksuffix,separatethousands:n.separatethousands,exponentformat:n.exponentformat,showexponent:n.showexponent,title:{valType:"string",dflt:"Click to enter colorscale title"},titlefont:a({}),titleside:{valType:"enumerated",values:["right","top","bottom"],dflt:"top"}},"colorbars","from-root")},{"../../lib/extend":143,"../../plot_api/edit_types":173,"../../plots/cartesian/layout_attributes":200,"../../plots/font_attributes":213}],36:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../plots/cartesian/tick_value_defaults"),i=t("../../plots/cartesian/tick_mark_defaults"),o=t("../../plots/cartesian/tick_label_defaults"),l=t("./attributes");e.exports=function(t,e,r){function s(t,e){return n.coerce(u,c,l,t,e)}var c=e.colorbar={},u=t.colorbar||{};s("thickness","fraction"===s("thicknessmode")?30/(r.width-r.margin.l-r.margin.r):30),s("len","fraction"===s("lenmode")?1:r.height-r.margin.t-r.margin.b),s("x"),s("xanchor"),s("xpad"),s("y"),s("yanchor"),s("ypad"),n.noneOrAll(u,c,["x","y"]),s("outlinecolor"),s("outlinewidth"),s("bordercolor"),s("borderwidth"),s("bgcolor"),a(u,c,s,"linear"),o(u,c,s,"linear",{outerTicks:!1,font:r.font,noHover:!0}),i(u,c,s,"linear",{outerTicks:!1,font:r.font,noHover:!0}),s("title"),n.coerceFont(s,"titlefont",r.font),s("titleside")}},{"../../lib":149,"../../plots/cartesian/tick_label_defaults":207,"../../plots/cartesian/tick_mark_defaults":208,"../../plots/cartesian/tick_value_defaults":209,"./attributes":35}],37:[function(t,e,r){"use strict";var n=t("d3"),a=t("tinycolor2"),i=t("../../plotly"),o=t("../../plots/plots"),l=t("../../registry"),s=t("../../plots/cartesian/axes"),c=t("../dragelement"),u=t("../../lib"),f=t("../../lib/extend").extendFlat,d=t("../../lib/setcursor"),p=t("../drawing"),h=t("../color"),g=t("../titles"),v=t("../../lib/svg_text_utils"),y=t("../../constants/alignment").LINE_SPACING,m=t("../../plots/cartesian/axis_defaults"),x=t("../../plots/cartesian/position_defaults"),b=t("../../plots/cartesian/layout_attributes"),_=t("./attributes");e.exports=function(t,e){function r(){function _(t,e){return u.coerce(et,rt,b,t,e)}function M(){if(-1!==["top","bottom"].indexOf(k.titleside)){var e=st.select(".cbtitle"),r=e.select("text"),i=[-k.outlinewidth/2,k.outlinewidth/2],o=e.select(".h"+rt._id+"title-math-group").node(),l=15.6;if(r.node()&&(l=parseInt(r.node().style.fontSize,10)*y),o?(ut=p.bBox(o).height)>l&&(i[1]-=(ut-l)/2):r.node()&&!r.classed("js-placeholder")&&(ut=p.bBox(r.node()).height),ut){if(ut+=5,"top"===k.titleside)rt.domain[1]-=ut/C.h,i[1]*=-1;else{rt.domain[0]+=ut/C.h;var c=v.lineCount(r);i[1]+=(1-c)*l}e.attr("transform","translate("+i+")"),rt.setScale()}}st.selectAll(".cbfills,.cblines,.cbaxis").attr("transform","translate(0,"+Math.round(C.h*(1-rt.domain[1]))+")");var f=st.select(".cbfills").selectAll("rect.cbfill").data(P);f.enter().append("rect").classed("cbfill",!0).style("stroke","none"),f.exit().remove(),f.each(function(t,e){var r=[0===e?z[0]:(P[e]+P[e-1])/2,e===P.length-1?z[1]:(P[e]+P[e+1])/2].map(rt.c2p).map(Math.round);e!==P.length-1&&(r[1]+=r[1]>r[0]?1:-1);var i=N(t).replace("e-",""),o=a(i).toHexString();n.select(this).attr({x:Q,width:Math.max(V,2),y:n.min(r),height:Math.max(n.max(r)-n.min(r),2),fill:o})});var d=st.select(".cblines").selectAll("path.cbline").data(k.line.color&&k.line.width?D:[]);return d.enter().append("path").classed("cbline",!0),d.exit().remove(),d.each(function(t){n.select(this).attr("d","M"+Q+","+(Math.round(rt.c2p(t))+k.line.width/2%1)+"h"+V).call(p.lineGroupStyle,k.line.width,E(t),k.line.dash)}),rt._axislayer.selectAll("g."+rt._id+"tick,path").remove(),rt._pos=Q+V+(k.outlinewidth||0)/2-("outside"===k.ticks?1:0),rt.side="right",u.syncOrAsync([function(){return s.doTicks(t,rt,!0)},function(){if(-1===["top","bottom"].indexOf(k.titleside)){var e=rt.titlefont.size,r=rt._offset+rt._length/2,a=C.l+(rt.position||0)*C.w+("right"===rt.side?10+e*(rt.showticklabels?1:.5):-10-e*(rt.showticklabels?.5:0));A("h"+rt._id+"title",{avoid:{selection:n.select(t).selectAll("g."+rt._id+"tick"),side:k.titleside,offsetLeft:C.l,offsetTop:C.t,maxShift:L.width},attributes:{x:a,y:r,"text-anchor":"middle"},transform:{rotate:"-90",offset:0}})}}])}function A(e,r){var n,a=w();n=l.traceIs(a,"markerColorscale")?"marker.colorbar.title":"colorbar.title";var i={propContainer:rt,propName:n,traceIndex:a.index,dfltName:"colorscale",containerGroup:st.select(".cbtitle")},o="h"===e.charAt(0)?e.substr(1):"h"+e;st.selectAll("."+o+",."+o+"-math-group").remove(),g.draw(t,e,f(i,r||{}))}function T(){var r=V+k.outlinewidth/2+p.bBox(rt._axislayer.node()).width;if(B=ct.select("text"),B.node()&&!B.classed("js-placeholder")){var n,a=ct.select(".h"+rt._id+"title-math-group").node();n=a&&-1!==["top","bottom"].indexOf(k.titleside)?p.bBox(a).width:p.bBox(ct.node()).right-Q-C.l,r=Math.max(r,n)}var i=2*k.xpad+r+k.borderwidth+k.outlinewidth/2,l=K-tt;st.select(".cbbg").attr({x:Q-k.xpad-(k.borderwidth+k.outlinewidth)/2,y:tt-Z,width:Math.max(i,2),height:Math.max(l+2*Z,2)}).call(h.fill,k.bgcolor).call(h.stroke,k.bordercolor).style({"stroke-width":k.borderwidth}),st.selectAll(".cboutline").attr({x:Q,y:tt+k.ypad+("top"===k.titleside?ut:0),width:Math.max(V,2),height:Math.max(l-2*k.ypad-ut,2)}).call(h.stroke,k.outlinecolor).style({fill:"None","stroke-width":k.outlinewidth});var s=({center:.5,right:1}[k.xanchor]||0)*i;st.attr("transform","translate("+(C.l-s)+","+C.t+")"),o.autoMargin(t,e,{x:k.x,y:k.y,l:i*({right:1,center:.5}[k.xanchor]||0),r:i*({left:1,center:.5}[k.xanchor]||0),t:l*({bottom:1,middle:.5}[k.yanchor]||0),b:l*({top:1,middle:.5}[k.yanchor]||0)})}var L=t._fullLayout,C=L._size;if("function"!=typeof k.fillcolor&&"function"!=typeof k.line.color)return void L._infolayer.selectAll("g."+e).remove();var S,O,z=n.extent(("function"==typeof k.fillcolor?k.fillcolor:k.line.color).domain()),D=[],P=[],E="function"==typeof k.line.color?k.line.color:function(){return k.line.color},N="function"==typeof k.fillcolor?k.fillcolor:function(){return k.fillcolor},I=k.levels.end+k.levels.size/100,R=k.levels.size,F=1.001*z[0]-.001*z[1],j=1.001*z[1]-.001*z[0];for(O=0;O<1e5&&(S=k.levels.start+O*R,!(R>0?S>=I:S<=I));O++)S>F&&S<j&&D.push(S);if("function"==typeof k.fillcolor)if(k.filllevels)for(I=k.filllevels.end+k.filllevels.size/100,R=k.filllevels.size,O=0;O<1e5&&(S=k.filllevels.start+O*R,!(R>0?S>=I:S<=I));O++)S>z[0]&&S<z[1]&&P.push(S);else P=D.map(function(t){return t-k.levels.size/2}),P.push(P[P.length-1]+k.levels.size);else k.fillcolor&&"string"==typeof k.fillcolor&&(P=[0]);k.levels.size<0&&(D.reverse(),P.reverse());var B,q=L.height-L.margin.t-L.margin.b,H=L.width-L.margin.l-L.margin.r,V=Math.round(k.thickness*("fraction"===k.thicknessmode?H:1)),U=V/C.w,G=Math.round(k.len*("fraction"===k.lenmode?q:1)),X=G/C.h,Y=k.xpad/C.w,Z=(k.borderwidth+k.outlinewidth)/2,W=k.ypad/C.h,Q=Math.round(k.x*C.w+k.xpad),$=k.x-U*({middle:.5,right:1}[k.xanchor]||0),J=k.y+X*(({top:-.5,bottom:.5}[k.yanchor]||0)-.5),K=Math.round(C.h*(1-J)),tt=K-G,et={type:"linear",range:z,tickmode:k.tickmode,nticks:k.nticks,tick0:k.tick0,dtick:k.dtick,tickvals:k.tickvals,ticktext:k.ticktext,ticks:k.ticks,

ticklen:k.ticklen,tickwidth:k.tickwidth,tickcolor:k.tickcolor,showticklabels:k.showticklabels,tickfont:k.tickfont,tickangle:k.tickangle,tickformat:k.tickformat,exponentformat:k.exponentformat,separatethousands:k.separatethousands,showexponent:k.showexponent,showtickprefix:k.showtickprefix,tickprefix:k.tickprefix,showticksuffix:k.showticksuffix,ticksuffix:k.ticksuffix,title:k.title,titlefont:k.titlefont,showline:!0,anchor:"free",position:1},rt={type:"linear",_id:"y"+e},nt={letter:"y",font:L.font,noHover:!0,calendar:L.calendar};if(m(et,rt,_,nt,L),x(et,rt,_,nt),rt.position=k.x+Y+U,r.axis=rt,-1!==["top","bottom"].indexOf(k.titleside)&&(rt.titleside=k.titleside,rt.titlex=k.x+Y,rt.titley=J+("top"===k.titleside?X-W:W)),k.line.color&&"auto"===k.tickmode){rt.tickmode="linear",rt.tick0=k.levels.start;var at=k.levels.size,it=u.constrain((K-tt)/50,4,15)+1,ot=(z[1]-z[0])/((k.nticks||it)*at);if(ot>1){var lt=Math.pow(10,Math.floor(Math.log(ot)/Math.LN10));at*=lt*u.roundUp(ot/lt,[2,5,10]),(Math.abs(k.levels.start)/k.levels.size+1e-6)%1<2e-6&&(rt.tick0=0)}rt.dtick=at}rt.domain=[J+W,J+X-W],rt.setScale();var st=L._infolayer.selectAll("g."+e).data([0]);st.enter().append("g").classed(e,!0).each(function(){var t=n.select(this);t.append("rect").classed("cbbg",!0),t.append("g").classed("cbfills",!0),t.append("g").classed("cblines",!0),t.append("g").classed("cbaxis",!0).classed("crisp",!0),t.append("g").classed("cbtitleunshift",!0).append("g").classed("cbtitle",!0),t.append("rect").classed("cboutline",!0),t.select(".cbtitle").datum(0)}),st.attr("transform","translate("+Math.round(C.l)+","+Math.round(C.t)+")");var ct=st.select(".cbtitleunshift").attr("transform","translate(-"+Math.round(C.l)+",-"+Math.round(C.t)+")");rt._axislayer=st.select(".cbaxis");var ut=0;if(-1!==["top","bottom"].indexOf(k.titleside)){var ft,dt=C.l+(k.x+Y)*C.w,pt=rt.titlefont.size;ft="top"===k.titleside?(1-(J+X-W))*C.h+C.t+3+.75*pt:(1-(J+W))*C.h+C.t-3-.25*pt,A(rt._id+"title",{attributes:{x:dt,y:ft,"text-anchor":"start"}})}var ht=u.syncOrAsync([o.previousPromises,M,o.previousPromises,T],t);if(ht&&ht.then&&(t._promises||[]).push(ht),t._context.edits.colorbarPosition){var gt,vt,yt;c.init({element:st.node(),gd:t,prepFn:function(){gt=st.attr("transform"),d(st)},moveFn:function(t,e){st.attr("transform",gt+" translate("+t+","+e+")"),vt=c.align($+t/C.w,U,0,1,k.xanchor),yt=c.align(J-e/C.h,X,0,1,k.yanchor);var r=c.getCursor(vt,yt,k.xanchor,k.yanchor);d(st,r)},doneFn:function(e){d(st),e&&void 0!==vt&&void 0!==yt&&i.restyle(t,{"colorbar.x":vt,"colorbar.y":yt},w().index)}})}return ht}function w(){var r,n,a=e.substr(2);for(r=0;r<t._fullData.length;r++)if(n=t._fullData[r],n.uid===a)return n}var k={};return Object.keys(_).forEach(function(t){k[t]=null}),k.fillcolor=null,k.line={color:null,width:null,dash:null},k.levels={start:null,end:null,size:null},k.filllevels=null,Object.keys(k).forEach(function(t){r[t]=function(e){return arguments.length?(k[t]=u.isPlainObject(k[t])?u.extendFlat(k[t],e):e,r):k[t]}}),r.options=function(t){return Object.keys(t).forEach(function(e){"function"==typeof r[e]&&r[e](t[e])}),r},r._opts=k,r}},{"../../constants/alignment":131,"../../lib":149,"../../lib/extend":143,"../../lib/setcursor":167,"../../lib/svg_text_utils":169,"../../plotly":184,"../../plots/cartesian/axes":189,"../../plots/cartesian/axis_defaults":191,"../../plots/cartesian/layout_attributes":200,"../../plots/cartesian/position_defaults":203,"../../plots/plots":218,"../../registry":225,"../color":34,"../dragelement":55,"../drawing":58,"../titles":124,"./attributes":35,d3:7,tinycolor2:16}],38:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t){return n.isPlainObject(t.colorbar)}},{"../../lib":149}],39:[function(t,e,r){"use strict";e.exports={zauto:{valType:"boolean",dflt:!0,editType:"calc",impliedEdits:{zmin:void 0,zmax:void 0}},zmin:{valType:"number",dflt:null,editType:"plot",impliedEdits:{zauto:!1}},zmax:{valType:"number",dflt:null,editType:"plot",impliedEdits:{zauto:!1}},colorscale:{valType:"colorscale",editType:"calc",impliedEdits:{autocolorscale:!1}},autocolorscale:{valType:"boolean",dflt:!0,editType:"calc",impliedEdits:{colorscale:void 0}},reversescale:{valType:"boolean",dflt:!1,editType:"calc"},showscale:{valType:"boolean",dflt:!0,editType:"calc"}}},{}],40:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./scales"),i=t("./flip_scale");e.exports=function(t,e,r,o){var l,s;r?(l=n.nestedProperty(t,r).get(),s=n.nestedProperty(t._input,r).get()):(l=t,s=t._input);var c=o+"auto",u=o+"min",f=o+"max",d=l[c],p=l[u],h=l[f],g=l.colorscale;!1===d&&void 0!==p||(p=n.aggNums(Math.min,null,e)),!1===d&&void 0!==h||(h=n.aggNums(Math.max,null,e)),p===h&&(p-=.5,h+=.5),l[u]=p,l[f]=h,s[u]=p,s[f]=h,s[c]=!1!==d||void 0===p&&void 0===h,l.autocolorscale&&(g=p*h<0?a.RdBu:p>=0?a.Reds:a.Blues,s.colorscale=g,l.reversescale&&(g=i(g)),l.colorscale=g)}},{"../../lib":149,"./flip_scale":45,"./scales":52}],41:[function(t,e,r){"use strict";var n=t("./attributes"),a=t("../../lib/extend").extendFlat;t("./scales.js");e.exports=function(t,e,r){return{color:{valType:"color",arrayOk:!0,editType:e||"style"},colorscale:a({},n.colorscale,{}),cauto:a({},n.zauto,{impliedEdits:{cmin:void 0,cmax:void 0}}),cmax:a({},n.zmax,{editType:e||n.zmax.editType,impliedEdits:{cauto:!1}}),cmin:a({},n.zmin,{editType:e||n.zmin.editType,impliedEdits:{cauto:!1}}),autocolorscale:a({},n.autocolorscale,{dflt:!1===r?r:n.autocolorscale.dflt}),reversescale:a({},n.reversescale,{})}}},{"../../lib/extend":143,"./attributes":39,"./scales.js":52}],42:[function(t,e,r){"use strict";var n=t("./scales");e.exports=n.RdBu},{"./scales":52}],43:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib"),i=t("../colorbar/has_colorbar"),o=t("../colorbar/defaults"),l=t("./is_valid_scale"),s=t("./flip_scale");e.exports=function(t,e,r,c,u){var f=u.prefix,d=u.cLetter,p=f.slice(0,f.length-1),h=f?a.nestedProperty(t,p).get()||{}:t,g=f?a.nestedProperty(e,p).get()||{}:e,v=h[d+"min"],y=h[d+"max"],m=h.colorscale;c(f+d+"auto",!(n(v)&&n(y)&&v<y)),c(f+d+"min"),c(f+d+"max");var x;void 0!==m&&(x=!l(m)),c(f+"autocolorscale",x);var b=c(f+"colorscale");if(c(f+"reversescale")&&(g.colorscale=s(b)),"marker.line."!==f){var _;f&&(_=i(h)),c(f+"showscale",_)&&o(h,g,r)}}},{"../../lib":149,"../colorbar/defaults":36,"../colorbar/has_colorbar":38,"./flip_scale":45,"./is_valid_scale":49,"fast-isnumeric":10}],44:[function(t,e,r){"use strict";e.exports=function(t,e,r){for(var n=t.length,a=new Array(n),i=new Array(n),o=0;o<n;o++){var l=t[o];a[o]=e+l[0]*(r-e),i[o]=l[1]}return{domain:a,range:i}}},{}],45:[function(t,e,r){"use strict";e.exports=function(t){for(var e,r=t.length,n=new Array(r),a=r-1,i=0;a>=0;a--,i++)e=t[a],n[i]=[1-e[0],e[1]];return n}},{}],46:[function(t,e,r){"use strict";var n=t("./scales"),a=t("./default_scale"),i=t("./is_valid_scale_array");e.exports=function(t,e){function r(){try{t=n[t]||JSON.parse(t)}catch(r){t=e}}return e||(e=a),t?("string"==typeof t&&(r(),"string"==typeof t&&r()),i(t)?t:e):e}},{"./default_scale":42,"./is_valid_scale_array":50,"./scales":52}],47:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib"),i=t("./is_valid_scale");e.exports=function(t,e){var r=e?a.nestedProperty(t,e).get()||{}:t,o=r.color,l=!1;if(Array.isArray(o))for(var s=0;s<o.length;s++)if(n(o[s])){l=!0;break}return a.isPlainObject(r)&&(l||!0===r.showscale||n(r.cmin)&&n(r.cmax)||i(r.colorscale)||a.isPlainObject(r.colorbar))}},{"../../lib":149,"./is_valid_scale":49,"fast-isnumeric":10}],48:[function(t,e,r){"use strict";r.scales=t("./scales"),r.defaultScale=t("./default_scale"),r.attributes=t("./attributes"),r.handleDefaults=t("./defaults"),r.calc=t("./calc"),r.hasColorscale=t("./has_colorscale"),r.isValidScale=t("./is_valid_scale"),r.getScale=t("./get_scale"),r.flipScale=t("./flip_scale"),r.extractScale=t("./extract_scale"),r.makeColorScaleFunc=t("./make_color_scale_func")},{"./attributes":39,"./calc":40,"./default_scale":42,"./defaults":43,"./extract_scale":44,"./flip_scale":45,"./get_scale":46,"./has_colorscale":47,"./is_valid_scale":49,"./make_color_scale_func":51,"./scales":52}],49:[function(t,e,r){"use strict";var n=t("./scales"),a=t("./is_valid_scale_array");e.exports=function(t){return void 0!==n[t]||a(t)}},{"./is_valid_scale_array":50,"./scales":52}],50:[function(t,e,r){"use strict";var n=t("tinycolor2");e.exports=function(t){var e=0;if(!Array.isArray(t)||t.length<2)return!1;if(!t[0]||!t[t.length-1])return!1;if(0!=+t[0][0]||1!=+t[t.length-1][0])return!1;for(var r=0;r<t.length;r++){var a=t[r];if(2!==a.length||+a[0]<e||!n(a[1]).isValid())return!1;e=+a[0]}return!0}},{tinycolor2:16}],51:[function(t,e,r){"use strict";function n(t){var e={r:t[0],g:t[1],b:t[2],a:t[3]};return i(e).toRgbString()}var a=t("d3"),i=t("tinycolor2"),o=t("fast-isnumeric"),l=t("../color");e.exports=function(t,e){e=e||{};for(var r=t.domain,s=t.range,c=s.length,u=new Array(c),f=0;f<c;f++){var d=i(s[f]).toRgb();u[f]=[d.r,d.g,d.b,d.a]}var p,h=a.scale.linear().domain(r).range(u).clamp(!0),g=e.noNumericCheck,v=e.returnArray;return p=g&&v?h:g?function(t){return n(h(t))}:v?function(t){return o(t)?h(t):i(t).isValid()?t:l.defaultLine}:function(t){return o(t)?n(h(t)):i(t).isValid()?t:l.defaultLine},p.domain=h.domain,p.range=function(){return s},p}},{"../color":34,d3:7,"fast-isnumeric":10,tinycolor2:16}],52:[function(t,e,r){"use strict";e.exports={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"]]}},{}],53:[function(t,e,r){"use strict";e.exports=function(t,e,r,n,a){var i=(t-r)/(n-r),o=i+e/(n-r),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}},{}],54:[function(t,e,r){"use strict";var n=t("../../lib"),a=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];e.exports=function(t,e,r,i){return t="left"===r?0:"center"===r?1:"right"===r?2:n.constrain(Math.floor(3*t),0,2),e="bottom"===i?0:"middle"===i?1:"top"===i?2:n.constrain(Math.floor(3*e),0,2),a[e][t]}},{"../../lib":149}],55:[function(t,e,r){"use strict";function n(){var t=document.createElement("div");t.className="dragcover";var e=t.style;return e.position="fixed",e.left=0,e.right=0,e.top=0,e.bottom=0,e.zIndex=999999999,e.background="none",document.body.appendChild(t),t}function a(t){t._dragging=!1,t._replotPending&&s.plot(t)}function i(t){return o(t.changedTouches?t.changedTouches[0]:t,document.body)}var o=t("mouse-event-offset"),l=t("has-hover"),s=t("../../plotly"),c=t("../../lib"),u=t("../../plots/cartesian/constants"),f=t("../../constants/interactions"),d=e.exports={};d.align=t("./align"),d.getCursor=t("./cursor");var p=t("./unhover");d.unhover=p.wrapped,d.unhoverRaw=p.raw,d.init=function(t){function e(e){if(!e.buttons||2!==e.buttons){m._dragged=!1,m._dragging=!0;var a=i(e);return s=a[0],p=a[1],y=e.target,h=(new Date).getTime(),h-m._mouseDownTime<b?x+=1:(x=1,m._mouseDownTime=h),t.prepFn&&t.prepFn(e,s,p),l?(v=n(),v.style.cursor=window.getComputedStyle(_).cursor):(v=document,g=window.getComputedStyle(document.documentElement).cursor,document.documentElement.style.cursor=window.getComputedStyle(_).cursor),document.addEventListener("mousemove",r),document.addEventListener("mouseup",o),document.addEventListener("touchmove",r),document.addEventListener("touchend",o),c.pauseEvent(e)}}function r(e){var r=i(e),n=r[0]-s,a=r[1]-p,o=t.minDrag||u.MINDRAG;return Math.abs(n)<o&&(n=0),Math.abs(a)<o&&(a=0),(n||a)&&(m._dragged=!0,d.unhover(m)),t.moveFn&&t.moveFn(n,a,m._dragged),c.pauseEvent(e)}function o(e){if(document.removeEventListener("mousemove",r),document.removeEventListener("mouseup",o),document.removeEventListener("touchmove",r),document.removeEventListener("touchend",o),l?c.removeElement(v):g&&(v.documentElement.style.cursor=g,g=null),!m._dragging)return void(m._dragged=!1);if(m._dragging=!1,(new Date).getTime()-m._mouseDownTime>b&&(x=Math.max(x-1,1)),t.doneFn&&t.doneFn(m._dragged,x,e),!m._dragged){var n;try{n=new MouseEvent("click",e)}catch(t){var s=i(e);n=document.createEvent("MouseEvents"),n.initMouseEvent("click",e.bubbles,e.cancelable,e.view,e.detail,e.screenX,e.screenY,s[0],s[1],e.ctrlKey,e.altKey,e.shiftKey,e.metaKey,e.button,e.relatedTarget)}y.dispatchEvent(n)}return a(m),m._dragged=!1,c.pauseEvent(e)}var s,p,h,g,v,y,m=t.gd,x=1,b=f.DBLCLICKDELAY,_=t.element;m._mouseDownTime||(m._mouseDownTime=0),_.style.pointerEvents="all",_.onmousedown=e,_.ontouchstart=e},d.coverSlip=n},{"../../constants/interactions":132,"../../lib":149,"../../plotly":184,"../../plots/cartesian/constants":194,"./align":53,"./cursor":54,"./unhover":56,"has-hover":12,"mouse-event-offset":14}],56:[function(t,e,r){"use strict";var n=t("../../lib/events"),a=t("../../lib/throttle"),i=t("../../lib/get_graph_div"),o=t("../fx/constants"),l=e.exports={};l.wrapped=function(t,e,r){t=i(t),a.clear(t._fullLayout._uid+o.HOVERID),l.raw(t,e,r)},l.raw=function(t,e){var r=t._fullLayout,a=t._hoverdata;e||(e={}),e.target&&!1===n.triggerHandler(t,"plotly_beforehover",e)||(r._hoverlayer.selectAll("g").remove(),r._hoverlayer.selectAll("line").remove(),r._hoverlayer.selectAll("circle").remove(),t._hoverdata=void 0,e.target&&a&&t.emit("plotly_unhover",{event:e,points:a}))}},{"../../lib/events":142,"../../lib/get_graph_div":147,"../../lib/throttle":170,"../fx/constants":70}],57:[function(t,e,r){"use strict";r.dash={valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid",editType:"style"}},{}],58:[function(t,e,r){"use strict";function n(t,e,r,n,a,i,o,l){if(c.traceIs(r,"symbols")){var s=m(r);e.attr("d",function(t){var e;e="various"===t.ms||"various"===i.size?3:y.isBubble(r)?s(t.ms):(i.size||6)/2,t.mrc=e;var n=x.symbolNumber(t.mx||i.symbol)||0,a=n%100;return t.om=n%200>=100,x.symbolFuncs[a](e)+(n>=200?w:"")}).style("opacity",function(t){return(t.mo+1||i.opacity+1)-1})}var f,d,p,h=!1;if(t.so?(p=o.outlierwidth,d=o.outliercolor,f=i.outliercolor):(p=(t.mlw+1||o.width+1||(t.trace?t.trace.marker.line.width:0)+1)-1,d="mlc"in t?t.mlcc=a(t.mlc):Array.isArray(o.color)?u.defaultLine:o.color,Array.isArray(i.color)&&(f=u.defaultLine,h=!0),f="mc"in t?t.mcc=n(t.mc):i.color||"rgba(0,0,0,0)"),t.om)e.call(u.stroke,f).style({"stroke-width":(p||1)+"px",fill:"none"});else{e.style("stroke-width",p+"px");var g=i.gradient,v=t.mgt;if(v?h=!0:v=g&&g.type,v&&"none"!==v){var b=t.mgc;b?h=!0:b=g.color;var _="g"+l._fullLayout._uid+"-"+r.uid;h&&(_+="-"+t.i),e.call(x.gradient,l,_,v,f,b)}else e.call(u.fill,f);p&&e.call(u.stroke,d)}}function a(t,e,r,n){var a=t[0]-e[0],i=t[1]-e[1],l=r[0]-e[0],s=r[1]-e[1],c=Math.pow(a*a+i*i,T/2),u=Math.pow(l*l+s*s,T/2),f=(u*u*a-c*c*l)*n,d=(u*u*i-c*c*s)*n,p=3*u*(c+u),h=3*c*(c+u);return[[o.round(e[0]+(p&&f/p),2),o.round(e[1]+(p&&d/p),2)],[o.round(e[0]-(h&&f/h),2),o.round(e[1]-(h&&d/h),2)]]}function i(t){var e=t.getAttribute("data-unformatted");if(null!==e)return e+t.getAttribute("data-math")+t.getAttribute("text-anchor")+t.getAttribute("style")}var o=t("d3"),l=t("fast-isnumeric"),s=t("tinycolor2"),c=t("../../registry"),u=t("../color"),f=t("../colorscale"),d=t("../../lib"),p=t("../../lib/svg_text_utils"),h=t("../../constants/xmlns_namespaces"),g=t("../../constants/alignment"),v=g.LINE_SPACING,y=t("../../traces/scatter/subtypes"),m=t("../../traces/scatter/make_bubble_size_func"),x=e.exports={};x.font=function(t,e,r,n){d.isPlainObject(e)&&(n=e.color,r=e.size,e=e.family),e&&t.style("font-family",e),r+1&&t.style("font-size",r+"px"),n&&t.call(u.fill,n)},x.setPosition=function(t,e,r){t.attr("x",e).attr("y",r)},x.setSize=function(t,e,r){t.attr("width",e).attr("height",r)},x.setRect=function(t,e,r,n,a){t.call(x.setPosition,e,r).call(x.setSize,n,a)},x.translatePoint=function(t,e,r,n){var a=r.c2p(t.x),i=n.c2p(t.y);return!!(l(a)&&l(i)&&e.node())&&("text"===e.node().nodeName?e.attr("x",a).attr("y",i):e.attr("transform","translate("+a+","+i+")"),!0)},x.translatePoints=function(t,e,r){t.each(function(t){var n=o.select(this);x.translatePoint(t,n,e,r)})},x.hideOutsideRangePoint=function(t,e,r,n){e.attr("display",r.isPtWithinRange(t)&&n.isPtWithinRange(t)?null:"none")},x.hideOutsideRangePoints=function(t,e){if(e._hasClipOnAxisFalse){var r=e.xaxis,n=e.yaxis;t.each(function(t){x.hideOutsideRangePoint(t,o.select(this),r,n)})}},x.crispRound=function(t,e,r){return e&&l(e)?t._context.staticPlot?e:e<1?1:Math.round(e):r||0},x.singleLineStyle=function(t,e,r,n,a){e.style("fill","none");var i=(((t||[])[0]||{}).trace||{}).line||{},o=r||i.width||0,l=a||i.dash||"";u.stroke(e,n||i.color),x.dashLine(e,l,o)},x.lineGroupStyle=function(t,e,r,n){t.style("fill","none").each(function(t){var a=(((t||[])[0]||{}).trace||{}).line||{},i=e||a.width||0,l=n||a.dash||"";o.select(this).call(u.stroke,r||a.color).call(x.dashLine,l,i)})},x.dashLine=function(t,e,r){r=+r||0,e=x.dashStyle(e,r),t.style({"stroke-dasharray":e,"stroke-width":r+"px"})},x.dashStyle=function(t,e){e=+e||1;var r=Math.max(e,3);return"solid"===t?t="":"dot"===t?t=r+"px,"+r+"px":"dash"===t?t=3*r+"px,"+3*r+"px":"longdash"===t?t=5*r+"px,"+5*r+"px":"dashdot"===t?t=3*r+"px,"+r+"px,"+r+"px,"+r+"px":"longdashdot"===t&&(t=5*r+"px,"+2*r+"px,"+r+"px,"+2*r+"px"),t},x.singleFillStyle=function(t){var e=o.select(t.node()),r=e.data(),n=(((r[0]||[])[0]||{}).trace||{}).fillcolor;n&&t.call(u.fill,n)},x.fillGroupStyle=function(t){t.style("stroke-width",0).each(function(e){var r=o.select(this);try{r.call(u.fill,e[0].trace.fillcolor)}catch(e){d.error(e,t),r.remove()}})};var b=t("./symbol_defs");x.symbolNames=[],x.symbolFuncs=[],x.symbolNeedLines={},x.symbolNoDot={},x.symbolList=[],Object.keys(b).forEach(function(t){var e=b[t];x.symbolList=x.symbolList.concat([e.n,t,e.n+100,t+"-open"]),x.symbolNames[e.n]=t,x.symbolFuncs[e.n]=e.f,e.needLine&&(x.symbolNeedLines[e.n]=!0),e.noDot?x.symbolNoDot[e.n]=!0:x.symbolList=x.symbolList.concat([e.n+200,t+"-dot",e.n+300,t+"-open-dot"])});var _=x.symbolNames.length,w="M0,0.5L0.5,0L0,-0.5L-0.5,0Z";x.symbolNumber=function(t){if("string"==typeof t){var e=0;t.indexOf("-open")>0&&(e=100,t=t.replace("-open","")),t.indexOf("-dot")>0&&(e+=200,t=t.replace("-dot","")),t=x.symbolNames.indexOf(t),t>=0&&(t+=e)}return t%100>=_||t>=400?0:Math.floor(Math.max(t,0))};var k={x1:1,x2:0,y1:0,y2:0},M={x1:0,x2:0,y1:1,y2:0};x.gradient=function(t,e,r,n,a,i){var l=e._fullLayout._defs.select(".gradients").selectAll("#"+r).data([n+a+i],d.identity);l.exit().remove(),l.enter().append("radial"===n?"radialGradient":"linearGradient").each(function(){var t=o.select(this);"horizontal"===n?t.attr(k):"vertical"===n&&t.attr(M),t.attr("id",r);var e=s(a),l=s(i);t.append("stop").attr({offset:"0%","stop-color":u.tinyRGB(l),"stop-opacity":l.getAlpha()}),t.append("stop").attr({offset:"100%","stop-color":u.tinyRGB(e),"stop-opacity":e.getAlpha()})}),t.style({fill:"url(#"+r+")","fill-opacity":null})},x.initGradients=function(t){var e=t._fullLayout._defs.selectAll(".gradients").data([0]);e.enter().append("g").classed("gradients",!0),e.selectAll("linearGradient,radialGradient").remove()},x.singlePointStyle=function(t,e,r,a,i,o){var l=r.marker;n(t,e,r,a,i,l,l.line,o)},x.pointStyle=function(t,e,r){if(t.size()){var n=e.marker,a=x.tryColorscale(n,""),i=x.tryColorscale(n,"line");t.each(function(t){x.singlePointStyle(t,o.select(this),e,a,i,r)})}},x.tryColorscale=function(t,e){var r=e?d.nestedProperty(t,e).get():t,n=r.colorscale,a=r.color;return n&&Array.isArray(a)?f.makeColorScaleFunc(f.extractScale(n,r.cmin,r.cmax)):d.identity};var A={start:1,end:-1,middle:0,bottom:1,top:-1};x.textPointStyle=function(t,e,r){t.each(function(t){var n=o.select(this),a=d.extractOption(t,e,"tx","text");if(!a)return void n.remove();var i=t.tp||e.textposition,s=-1!==i.indexOf("top")?"top":-1!==i.indexOf("bottom")?"bottom":"middle",c=-1!==i.indexOf("left")?"end":-1!==i.indexOf("right")?"start":"middle",u=t.ts||e.textfont.size,f=t.mrc?t.mrc/.8+1:0;u=l(u)&&u>0?u:0,n.call(x.font,t.tf||e.textfont.family,u,t.tc||e.textfont.color).attr("text-anchor",c).text(a).call(p.convertToTspans,r);var h=o.select(this.parentNode),g=(p.lineCount(n)-1)*v+1,y=A[c]*f,m=.75*u+A[s]*f+(A[s]-1)*g*u/2;h.attr("transform","translate("+y+","+m+")")})};var T=.5;x.smoothopen=function(t,e){if(t.length<3)return"M"+t.join("L");var r,n="M"+t[0],i=[];for(r=1;r<t.length-1;r++)i.push(a(t[r-1],t[r],t[r+1],e));for(n+="Q"+i[0][0]+" "+t[1],r=2;r<t.length-1;r++)n+="C"+i[r-2][1]+" "+i[r-1][0]+" "+t[r];return n+="Q"+i[t.length-3][1]+" "+t[t.length-1]},x.smoothclosed=function(t,e){if(t.length<3)return"M"+t.join("L")+"Z";var r,n="M"+t[0],i=t.length-1,o=[a(t[i],t[0],t[1],e)];for(r=1;r<i;r++)o.push(a(t[r-1],t[r],t[r+1],e));for(o.push(a(t[i-1],t[i],t[0],e)),r=1;r<=i;r++)n+="C"+o[r-1][1]+" "+o[r][0]+" "+t[r];return n+="C"+o[i][1]+" "+o[0][0]+" "+t[0]+"Z"};var L={hv:function(t,e){return"H"+o.round(e[0],2)+"V"+o.round(e[1],2)},vh:function(t,e){return"V"+o.round(e[1],2)+"H"+o.round(e[0],2)},hvh:function(t,e){return"H"+o.round((t[0]+e[0])/2,2)+"V"+o.round(e[1],2)+"H"+o.round(e[0],2)},vhv:function(t,e){return"V"+o.round((t[1]+e[1])/2,2)+"H"+o.round(e[0],2)+"V"+o.round(e[1],2)}},C=function(t,e){return"L"+o.round(e[0],2)+","+o.round(e[1],2)};x.steps=function(t){var e=L[t]||C;return function(t){for(var r="M"+o.round(t[0][0],2)+","+o.round(t[0][1],2),n=1;n<t.length;n++)r+=e(t[n-1],t[n]);return r}},x.makeTester=function(){var t=o.select("body").selectAll("#js-plotly-tester").data([0]);t.enter().append("svg").attr("id","js-plotly-tester").attr(h.svgAttrs).style({position:"absolute",left:"-10000px",top:"-10000px",width:"9000px",height:"9000px","z-index":"1"});var e=t.selectAll(".js-reference-point").data([0]);e.enter().append("path").classed("js-reference-point",!0).attr("d","M0,0H1V1H0Z").style({"stroke-width":0,fill:"black"}),x.tester=t,x.testref=e},x.savedBBoxes={};var S=0;x.bBox=function(t,e,r){r||(r=i(t));var n;if(r){if(n=x.savedBBoxes[r])return d.extendFlat({},n)}else if(1===t.childNodes.length){var a=t.childNodes[0];if(r=i(a)){var l=+a.getAttribute("x")||0,s=+a.getAttribute("y")||0,c=a.getAttribute("transform");if(!c){var u=x.bBox(a,!1,r);return l&&(u.left+=l,u.right+=l),s&&(u.top+=s,u.bottom+=s),u}if(r+="~"+l+"~"+s+"~"+c,n=x.savedBBoxes[r])return d.extendFlat({},n)}}var f,h;e?f=t:(h=x.tester.node(),f=t.cloneNode(!0),h.appendChild(f)),o.select(f).attr("transform",null).call(p.positionText,0,0);var g=f.getBoundingClientRect(),v=x.testref.node().getBoundingClientRect();e||h.removeChild(f);var y={height:g.height,width:g.width,left:g.left-v.left,top:g.top-v.top,right:g.right-v.left,bottom:g.bottom-v.top};return S>=1e4&&(x.savedBBoxes={},S=0),r&&(x.savedBBoxes[r]=y),S++,d.extendFlat({},y)},x.setClipUrl=function(t,e){if(!e)return void t.attr("clip-path",null);var r="#"+e,n=o.select("base");n.size()&&n.attr("href")&&(r=window.location.href.split("#")[0]+r),t.attr("clip-path","url("+r+")")},x.getTranslate=function(t){var e=/.*\btranslate\((-?\d*\.?\d*)[^-\d]*(-?\d*\.?\d*)[^\d].*/,r=t.attr?"attr":"getAttribute",n=t[r]("transform")||"",a=n.replace(e,function(t,e,r){return[e,r].join(" ")}).split(" ");return{x:+a[0]||0,y:+a[1]||0}},x.setTranslate=function(t,e,r){var n=/(\btranslate\(.*?\);?)/,a=t.attr?"attr":"getAttribute",i=t.attr?"attr":"setAttribute",o=t[a]("transform")||"";return e=e||0,r=r||0,o=o.replace(n,"").trim(),o+=" translate("+e+", "+r+")",o=o.trim(),t[i]("transform",o),o},x.getScale=function(t){var e=/.*\bscale\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/,r=t.attr?"attr":"getAttribute",n=t[r]("transform")||"",a=n.replace(e,function(t,e,r){return[e,r].join(" ")}).split(" ");return{x:+a[0]||1,y:+a[1]||1}},x.setScale=function(t,e,r){var n=/(\bscale\(.*?\);?)/,a=t.attr?"attr":"getAttribute",i=t.attr?"attr":"setAttribute",o=t[a]("transform")||"";return e=e||1,r=r||1,o=o.replace(n,"").trim(),o+=" scale("+e+", "+r+")",o=o.trim(),t[i]("transform",o),o},x.setPointGroupScale=function(t,e,r){var n,a,i;return e=e||1,r=r||1,a=1===e&&1===r?"":" scale("+e+","+r+")",i=/\s*sc.*/,t.each(function(){n=(this.getAttribute("transform")||"").replace(i,""),n+=a,n=n.trim(),this.setAttribute("transform",n)}),a};var O=/translate\([^)]*\)\s*$/;x.setTextPointsScale=function(t,e,r){t.each(function(){var t,n=o.select(this),a=n.select("text");if(a.node()){var i=parseFloat(a.attr("x")||0),l=parseFloat(a.attr("y")||0),s=(n.attr("transform")||"").match(O);t=1===e&&1===r?[]:["translate("+i+","+l+")","scale("+e+","+r+")","translate("+-i+","+-l+")"],s&&t.push(s),n.attr("transform",t.join(" "))}})}},{"../../constants/alignment":131,"../../constants/xmlns_namespaces":135,"../../lib":149,"../../lib/svg_text_utils":169,"../../registry":225,"../../traces/scatter/make_bubble_size_func":276,"../../traces/scatter/subtypes":281,"../color":34,"../colorscale":48,"./symbol_defs":59,d3:7,"fast-isnumeric":10,tinycolor2:16}],59:[function(t,e,r){"use strict";var n=t("d3");e.exports={circle:{n:0,f:function(t){var e=n.round(t,2);return"M"+e+",0A"+e+","+e+" 0 1,1 0,-"+e+"A"+e+","+e+" 0 0,1 "+e+",0Z"}},square:{n:1,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"H-"+e+"V-"+e+"H"+e+"Z"}},diamond:{n:2,f:function(t){var e=n.round(1.3*t,2);return"M"+e+",0L0,"+e+"L-"+e+",0L0,-"+e+"Z"}},cross:{n:3,f:function(t){var e=n.round(.4*t,2),r=n.round(1.2*t,2);return"M"+r+","+e+"H"+e+"V"+r+"H-"+e+"V"+e+"H-"+r+"V-"+e+"H-"+e+"V-"+r+"H"+e+"V-"+e+"H"+r+"Z"}},x:{n:4,f:function(t){var e=n.round(.8*t/Math.sqrt(2),2),r="l"+e+","+e,a="l"+e+",-"+e,i="l-"+e+",-"+e,o="l-"+e+","+e;return"M0,"+e+r+a+i+a+i+o+i+o+r+o+r+"Z"}},"triangle-up":{n:5,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M-"+e+","+n.round(t/2,2)+"H"+e+"L0,-"+n.round(t,2)+"Z"}},"triangle-down":{n:6,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M-"+e+",-"+n.round(t/2,2)+"H"+e+"L0,"+n.round(t,2)+"Z"}},"triangle-left":{n:7,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M"+n.round(t/2,2)+",-"+e+"V"+e+"L-"+n.round(t,2)+",0Z"}},"triangle-right":{n:8,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M-"+n.round(t/2,2)+",-"+e+"V"+e+"L"+n.round(t,2)+",0Z"}},"triangle-ne":{n:9,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M-"+r+",-"+e+"H"+e+"V"+r+"Z"}},"triangle-se":{n:10,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M"+e+",-"+r+"V"+e+"H-"+r+"Z"}},"triangle-sw":{n:11,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M"+r+","+e+"H-"+e+"V-"+r+"Z"}},"triangle-nw":{n:12,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M-"+e+","+r+"V-"+e+"H"+r+"Z"}},pentagon:{n:13,f:function(t){var e=n.round(.951*t,2),r=n.round(.588*t,2),a=n.round(-t,2),i=n.round(-.309*t,2);return"M"+e+","+i+"L"+r+","+n.round(.809*t,2)+"H-"+r+"L-"+e+","+i+"L0,"+a+"Z"}},hexagon:{n:14,f:function(t){var e=n.round(t,2),r=n.round(t/2,2),a=n.round(t*Math.sqrt(3)/2,2);return"M"+a+",-"+r+"V"+r+"L0,"+e+"L-"+a+","+r+"V-"+r+"L0,-"+e+"Z"}},hexagon2:{n:15,f:function(t){var e=n.round(t,2),r=n.round(t/2,2),a=n.round(t*Math.sqrt(3)/2,2);return"M-"+r+","+a+"H"+r+"L"+e+",0L"+r+",-"+a+"H-"+r+"L-"+e+",0Z"}},octagon:{n:16,f:function(t){var e=n.round(.924*t,2),r=n.round(.383*t,2);return"M-"+r+",-"+e+"H"+r+"L"+e+",-"+r+"V"+r+"L"+r+","+e+"H-"+r+"L-"+e+","+r+"V-"+r+"Z"}},star:{n:17,f:function(t){var e=1.4*t,r=n.round(.225*e,2),a=n.round(.951*e,2),i=n.round(.363*e,2),o=n.round(.588*e,2),l=n.round(-e,2),s=n.round(-.309*e,2),c=n.round(.118*e,2),u=n.round(.809*e,2);return"M"+r+","+s+"H"+a+"L"+i+","+c+"L"+o+","+u+"L0,"+n.round(.382*e,2)+"L-"+o+","+u+"L-"+i+","+c+"L-"+a+","+s+"H-"+r+"L0,"+l+"Z"}},hexagram:{n:18,f:function(t){var e=n.round(.66*t,2),r=n.round(.38*t,2),a=n.round(.76*t,2);return"M-"+a+",0l-"+r+",-"+e+"h"+a+"l"+r+",-"+e+"l"+r+","+e+"h"+a+"l-"+r+","+e+"l"+r+","+e+"h-"+a+"l-"+r+","+e+"l-"+r+",-"+e+"h-"+a+"Z"}},"star-triangle-up":{n:19,f:function(t){var e=n.round(t*Math.sqrt(3)*.8,2),r=n.round(.8*t,2),a=n.round(1.6*t,2),i=n.round(4*t,2),o="A "+i+","+i+" 0 0 1 ";return"M-"+e+","+r+o+e+","+r+o+"0,-"+a+o+"-"+e+","+r+"Z"}},"star-triangle-down":{n:20,f:function(t){var e=n.round(t*Math.sqrt(3)*.8,2),r=n.round(.8*t,2),a=n.round(1.6*t,2),i=n.round(4*t,2),o="A "+i+","+i+" 0 0 1 ";return"M"+e+",-"+r+o+"-"+e+",-"+r+o+"0,"+a+o+e+",-"+r+"Z"}},"star-square":{n:21,f:function(t){var e=n.round(1.1*t,2),r=n.round(2*t,2),a="A "+r+","+r+" 0 0 1 ";return"M-"+e+",-"+e+a+"-"+e+","+e+a+e+","+e+a+e+",-"+e+a+"-"+e+",-"+e+"Z"}},"star-diamond":{n:22,f:function(t){var e=n.round(1.4*t,2),r=n.round(1.9*t,2),a="A "+r+","+r+" 0 0 1 ";return"M-"+e+",0"+a+"0,"+e+a+e+",0"+a+"0,-"+e+a+"-"+e+",0Z"}},"diamond-tall":{n:23,f:function(t){var e=n.round(.7*t,2),r=n.round(1.4*t,2);return"M0,"+r+"L"+e+",0L0,-"+r+"L-"+e+",0Z"}},"diamond-wide":{n:24,f:function(t){var e=n.round(1.4*t,2),r=n.round(.7*t,2);return"M0,"+r+"L"+e+",0L0,-"+r+"L-"+e+",0Z"}},hourglass:{n:25,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"H-"+e+"L"+e+",-"+e+"H-"+e+"Z"},noDot:!0},bowtie:{n:26,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"V-"+e+"L-"+e+","+e+"V-"+e+"Z"},noDot:!0},"circle-cross":{n:27,f:function(t){var e=n.round(t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e+"M"+e+",0A"+e+","+e+" 0 1,1 0,-"+e+"A"+e+","+e+" 0 0,1 "+e+",0Z"},needLine:!0,noDot:!0},"circle-x":{n:28,f:function(t){var e=n.round(t,2),r=n.round(t/Math.sqrt(2),2);return"M"+r+","+r+"L-"+r+",-"+r+"M"+r+",-"+r+"L-"+r+","+r+"M"+e+",0A"+e+","+e+" 0 1,1 0,-"+e+"A"+e+","+e+" 0 0,1 "+e+",0Z"},needLine:!0,noDot:!0},"square-cross":{n:29,f:function(t){var e=n.round(t,2)

return"M0,"+e+"V-"+e+"M"+e+",0H-"+e+"M"+e+","+e+"H-"+e+"V-"+e+"H"+e+"Z"},needLine
!0,noDot:!0},"square-x":{n:30,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"L-"+e+",-"+e+"M"+e+",-"+e+"L-"+e+","+e+"M"+e+","+e+"H-"+e+"V-"+e+"H"+e+"Z"},needLine:!0,noDot:!0},"diamond-cross":{n:31,f:function(t){var e=n.round(1.3*t,2);return"M"+e+",0L0,"+e+"L-"+e+",0L0,-"+e+"ZM0,-"+e+"V"+e+"M-"+e+",0H"+e},needLine:!0,noDot:!0},"diamond-x":{n:32,f:function(t){var e=n.round(1.3*t,2),r=n.round(.65*t,2);return"M"+e+",0L0,"+e+"L-"+e+",0L0,-"+e+"ZM-"+r+",-"+r+"L"+r+","+r+"M-"+r+","+r+"L"+r+",-"+r},needLine:!0,noDot:!0},"cross-thin":{n:33,f:function(t){var e=n.round(1.4*t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e},needLine:!0,noDot:!0},"x-thin":{n:34,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"L-"+e+",-"+e+"M"+e+",-"+e+"L-"+e+","+e},needLine:!0,noDot:!0},asterisk:{n:35,f:function(t){var e=n.round(1.2*t,2),r=n.round(.85*t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e+"M"+r+","+r+"L-"+r+",-"+r+"M"+r+",-"+r+"L-"+r+","+r},needLine:!0,noDot:!0},hash:{n:36,f:function(t){var e=n.round(t/2,2),r=n.round(t,2);return"M"+e+","+r+"V-"+r+"m-"+r+",0V"+r+"M"+r+","+e+"H-"+r+"m0,-"+r+"H"+r},needLine:!0},"y-up":{n:37,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),a=n.round(.8*t,2);return"M-"+e+","+a+"L0,0M"+e+","+a+"L0,0M0,-"+r+"L0,0"},needLine:!0,noDot:!0},"y-down":{n:38,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),a=n.round(.8*t,2);return"M-"+e+",-"+a+"L0,0M"+e+",-"+a+"L0,0M0,"+r+"L0,0"},needLine:!0,noDot:!0},"y-left":{n:39,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),a=n.round(.8*t,2);return"M"+a+","+e+"L0,0M"+a+",-"+e+"L0,0M-"+r+",0L0,0"},needLine:!0,noDot:!0},"y-right":{n:40,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),a=n.round(.8*t,2);return"M-"+a+","+e+"L0,0M-"+a+",-"+e+"L0,0M"+r+",0L0,0"},needLine:!0,noDot:!0},"line-ew":{n:41,f:function(t){var e=n.round(1.4*t,2);return"M"+e+",0H-"+e},needLine:!0,noDot:!0},"line-ns":{n:42,f:function(t){var e=n.round(1.4*t,2);return"M0,"+e+"V-"+e},needLine:!0,noDot:!0},"line-ne":{n:43,f:function(t){var e=n.round(t,2);return"M"+e+",-"+e+"L-"+e+","+e},needLine:!0,noDot:!0},"line-nw":{n:44,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"L-"+e+",-"+e},needLine:!0,noDot:!0}}},{d3:7}],60:[function(t,e,r){"use strict";e.exports={visible:{valType:"boolean",editType:"calc"},type:{valType:"enumerated",values:["percent","constant","sqrt","data"],editType:"calc"},symmetric:{valType:"boolean",editType:"calc"},array:{valType:"data_array",editType:"calc"},arrayminus:{valType:"data_array",editType:"calc"},value:{valType:"number",min:0,dflt:10,editType:"calc"},valueminus:{valType:"number",min:0,dflt:10,editType:"calc"},traceref:{valType:"integer",min:0,dflt:0,editType:"style"},tracerefminus:{valType:"integer",min:0,dflt:0,editType:"style"},copy_ystyle:{valType:"boolean",editType:"plot"},copy_zstyle:{valType:"boolean",editType:"style"},color:{valType:"color",editType:"style"},thickness:{valType:"number",min:0,dflt:2,editType:"style"},width:{valType:"number",min:0,editType:"plot"},editType:"calc",_deprecated:{opacity:{valType:"number",editType:"style"}}}},{}],61:[function(t,e,r){"use strict";function n(t,e,r,n){var i=e["error_"+n]||{},s=i.visible&&-1!==["linear","log"].indexOf(r.type),c=[];if(s){for(var u=l(i),f=0;f<t.length;f++){var d=t[f],p=d[n];if(a(r.c2l(p))){var h=u(p,f);if(a(h[0])&&a(h[1])){var g=d[n+"s"]=p-h[0],v=d[n+"h"]=p+h[1];c.push(g,v)}}}o.expand(r,c,{padded:!0})}}var a=t("fast-isnumeric"),i=t("../../registry"),o=t("../../plots/cartesian/axes"),l=t("./compute_error");e.exports=function(t){for(var e=t.calcdata,r=0;r<e.length;r++){var a=e[r],l=a[0].trace;if(i.traceIs(l,"errorBarsOK")){var s=o.getFromId(t,l.xaxis),c=o.getFromId(t,l.yaxis);n(a,l,s,"x"),n(a,l,c,"y")}}}},{"../../plots/cartesian/axes":189,"../../registry":225,"./compute_error":62,"fast-isnumeric":10}],62:[function(t,e,r){"use strict";function n(t,e){return"percent"===t?function(t){return Math.abs(t*e/100)}:"constant"===t?function(){return Math.abs(e)}:"sqrt"===t?function(t){return Math.sqrt(Math.abs(t))}:void 0}e.exports=function(t){var e=t.type,r=t.symmetric;if("data"===e){var a=t.array,i=t.arrayminus;return r||void 0===i?function(t,e){var r=+a[e];return[r,r]}:function(t,e){return[+i[e],+a[e]]}}var o=n(e,t.value),l=n(e,t.valueminus);return r||void 0===t.valueminus?function(t){var e=o(t);return[e,e]}:function(t){return[l(t),o(t)]}}},{}],63:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../registry"),i=t("../../lib"),o=t("./attributes");e.exports=function(t,e,r,l){function s(t,e){return i.coerce(f,u,o,t,e)}var c="error_"+l.axis,u=e[c]={},f=t[c]||{};if(!1!==s("visible",void 0!==f.array||void 0!==f.value||"sqrt"===f.type)){var d=s("type","array"in f?"data":"percent"),p=!0;"sqrt"!==d&&(p=s("symmetric",!(("data"===d?"arrayminus":"valueminus")in f))),"data"===d?(s("array")||(u.array=[]),s("traceref"),p||(s("arrayminus")||(u.arrayminus=[]),s("tracerefminus"))):"percent"!==d&&"constant"!==d||(s("value"),p||s("valueminus"));var h="copy_"+l.inherit+"style";l.inherit&&(e["error_"+l.inherit]||{}).visible&&s(h,!(f.color||n(f.thickness)||n(f.width))),l.inherit&&u[h]||(s("color",r),s("thickness"),s("width",a.traceIs(e,"gl3d")?0:4))}}},{"../../lib":149,"../../registry":225,"./attributes":60,"fast-isnumeric":10}],64:[function(t,e,r){"use strict";var n=e.exports={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.calc=t("./calc"),n.calcFromTrace=function(t,e){for(var r=t.x||[],a=t.y||[],i=r.length||a.length,o=new Array(i),l=0;l<i;l++)o[l]={x:r[l],y:a[l]};return o[0].trace=t,n.calc({calcdata:[o],_fullLayout:e}),o},n.plot=t("./plot"),n.style=t("./style"),n.hoverInfo=function(t,e,r){(e.error_y||{}).visible&&(r.yerr=t.yh-t.y,e.error_y.symmetric||(r.yerrneg=t.y-t.ys)),(e.error_x||{}).visible&&(r.xerr=t.xh-t.x,e.error_x.symmetric||(r.xerrneg=t.x-t.xs))}},{"./attributes":60,"./calc":61,"./defaults":63,"./plot":65,"./style":66}],65:[function(t,e,r){"use strict";function n(t,e,r){var n={x:e.c2p(t.x),y:r.c2p(t.y)};return void 0!==t.yh&&(n.yh=r.c2p(t.yh),n.ys=r.c2p(t.ys),i(n.ys)||(n.noYS=!0,n.ys=r.c2p(t.ys,!0))),void 0!==t.xh&&(n.xh=e.c2p(t.xh),n.xs=e.c2p(t.xs),i(n.xs)||(n.noXS=!0,n.xs=e.c2p(t.xs,!0))),n}var a=t("d3"),i=t("fast-isnumeric"),o=t("../drawing"),l=t("../../traces/scatter/subtypes");e.exports=function(t,e,r){var s,c=e.xaxis,u=e.yaxis,f=r&&r.duration>0;t.each(function(t){var d,p=t[0].trace,h=p.error_x||{},g=p.error_y||{};p.ids&&(d=function(t){return t.id});var v=l.hasMarkers(p)&&p.marker.maxdisplayed>0;g.visible||h.visible||(t=[]);var y=a.select(this).selectAll("g.errorbar").data(t,d);if(y.exit().remove(),t.length){h.visible||y.selectAll("path.xerror").remove(),g.visible||y.selectAll("path.yerror").remove(),y.style("opacity",1);var m=y.enter().append("g").classed("errorbar",!0);f&&m.style("opacity",0).transition().duration(r.duration).style("opacity",1),o.setClipUrl(y,e.layerClipId),y.each(function(t){var e=a.select(this),o=n(t,c,u);if(!v||t.vis){var l;if(g.visible&&i(o.x)&&i(o.yh)&&i(o.ys)){var d=g.width;l="M"+(o.x-d)+","+o.yh+"h"+2*d+"m-"+d+",0V"+o.ys,o.noYS||(l+="m-"+d+",0h"+2*d);var p=e.select("path.yerror");s=!p.size(),s?p=e.append("path").style("vector-effect","non-scaling-stroke").classed("yerror",!0):f&&(p=p.transition().duration(r.duration).ease(r.easing)),p.attr("d",l)}if(h.visible&&i(o.y)&&i(o.xh)&&i(o.xs)){var y=(h.copy_ystyle?g:h).width;l="M"+o.xh+","+(o.y-y)+"v"+2*y+"m0,-"+y+"H"+o.xs,o.noXS||(l+="m0,-"+y+"v"+2*y);var m=e.select("path.xerror");s=!m.size(),s?m=e.append("path").style("vector-effect","non-scaling-stroke").classed("xerror",!0):f&&(m=m.transition().duration(r.duration).ease(r.easing)),m.attr("d",l)}}})}})}},{"../../traces/scatter/subtypes":281,"../drawing":58,d3:7,"fast-isnumeric":10}],66:[function(t,e,r){"use strict";var n=t("d3"),a=t("../color");e.exports=function(t){t.each(function(t){var e=t[0].trace,r=e.error_y||{},i=e.error_x||{},o=n.select(this);o.selectAll("path.yerror").style("stroke-width",r.thickness+"px").call(a.stroke,r.color),i.copy_ystyle&&(i=r),o.selectAll("path.xerror").style("stroke-width",i.thickness+"px").call(a.stroke,i.color)})}},{"../color":34,d3:7}],67:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes");e.exports={hoverlabel:{bgcolor:{valType:"color",arrayOk:!0,editType:"none"},bordercolor:{valType:"color",arrayOk:!0,editType:"none"},font:n({arrayOk:!0,editType:"none"}),namelength:{valType:"integer",min:-1,arrayOk:!0,editType:"none"},editType:"calc"}}},{"../../plots/font_attributes":213}],68:[function(t,e,r){"use strict";function n(t,e,r,n){n=n||a.identity,Array.isArray(t)&&(e[0][r]=n(t))}var a=t("../../lib"),i=t("../../registry");e.exports=function(t){for(var e=t.calcdata,r=t._fullLayout,o=0;o<e.length;o++){var l=e[o],s=l[0].trace;if(!i.traceIs(s,"pie")){var c=i.traceIs(s,"2dMap")?n:a.fillArray;c(s.hoverinfo,l,"hi",function(t){return function(e){return a.coerceHoverinfo({hoverinfo:e},{_module:t._module},r)}}(s)),s.hoverlabel&&(c(s.hoverlabel.bgcolor,l,"hbg"),c(s.hoverlabel.bordercolor,l,"hbc"),c(s.hoverlabel.font.size,l,"hts"),c(s.hoverlabel.font.color,l,"htc"),c(s.hoverlabel.font.family,l,"htf"),c(s.hoverlabel.namelength,l,"hnl"))}}}},{"../../lib":149,"../../registry":225}],69:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("./hover").hover;e.exports=function(t,e,r){function i(){t.emit("plotly_click",{points:t._hoverdata,event:e})}var o=n.getComponentMethod("annotations","onClick")(t,t._hoverdata);void 0!==r&&a(t,e,r,!0),t._hoverdata&&e&&e.target&&(o&&o.then?o.then(i):i(),e.stopImmediatePropagation&&e.stopImmediatePropagation())}},{"../../registry":225,"./hover":73}],70:[function(t,e,r){"use strict";e.exports={MAXDIST:20,YANGLE:60,HOVERARROWSIZE:6,HOVERTEXTPAD:3,HOVERFONTSIZE:13,HOVERFONT:"Arial, sans-serif",HOVERMINTIME:50,HOVERID:"-hover"}},{}],71:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./attributes"),i=t("./hoverlabel_defaults");e.exports=function(t,e,r,o){function l(r,i){return n.coerce(t,e,a,r,i)}i(t,e,l,o.hoverlabel)}},{"../../lib":149,"./attributes":67,"./hoverlabel_defaults":74}],72:[function(t,e,r){"use strict";function n(t,e){return function(r){var n=t(r),a=e(r);return Math.sqrt(n*n+a*a)}}var a=t("../../lib"),i=t("./constants");r.getSubplot=function(t){return t.subplot||t.xaxis+t.yaxis||t.geo},r.flat=function(t,e){for(var r=new Array(t.length),n=0;n<t.length;n++)r[n]=e;return r},r.p2c=function(t,e){for(var r=new Array(t.length),n=0;n<t.length;n++)r[n]=t[n].p2c(e);return r},r.getDistanceFunction=function(t,e,r,a){return"closest"===t?a||n(e,r):"x"===t?e:r},r.getClosest=function(t,e,r){if(!1!==r.index)r.index>=0&&r.index<t.length?r.distance=0:r.index=!1;else for(var n=0;n<t.length;n++){var a=e(t[n]);a<=r.distance&&(r.index=n,r.distance=a)}return r},r.inbox=function(t,e){return t*e<0||0===t?i.MAXDIST*(.6-.3/Math.max(3,Math.abs(t-e))):1/0},r.appendArrayPointValue=function(t,e,r){var n=e._arrayAttrs;if(n)for(var i=0;i<n.length;i++){var o,l=n[i];if(o="ids"===l?"id":"locations"===l?"location":l,void 0===t[o]){var s=a.nestedProperty(e,l).get();Array.isArray(r)?Array.isArray(s)&&Array.isArray(s[r[0]])&&(t[o]=s[r[0]][r[1]]):t[o]=s[r]}}}},{"../../lib":149,"./constants":70}],73:[function(t,e,r){"use strict";function n(t,e,r,n){if(("pie"===r||"sankey"===r)&&!n)return void t.emit("plotly_hover",{event:e.originalEvent,points:[e]});r||(r="xy");var d=Array.isArray(r)?r:[r],g=t._fullLayout,y=g._plots||[],M=y[r];if(M){var A=M.overlays.map(function(t){return t.id});d=d.concat(A)}for(var T=d.length,L=new Array(T),C=new Array(T),S=0;S<T;S++){var O=d[S],z=y[O];if(z)L[S]=b.getFromId(t,z.xaxis._id),C[S]=b.getFromId(t,z.yaxis._id);else{var D=g[O]._subplot;L[S]=D.xaxis,C[S]=D.yaxis}}var P=e.hovermode||g.hovermode;if(-1===["x","y","closest"].indexOf(P)||!t.calcdata||t.querySelector(".zoombox")||t._dragging)return x.unhoverRaw(t,e);var E,N,I,R,F,j,B,q,H,V,U,G,X,Y=[],Z=[];if(Array.isArray(e))for(P="array",I=0;I<e.length;I++)F=t.calcdata[e[I].curveNumber||0],"skip"!==F[0].trace.hoverinfo&&Z.push(F);else{for(R=0;R<t.calcdata.length;R++)F=t.calcdata[R],j=F[0].trace,"skip"!==j.hoverinfo&&-1!==d.indexOf(w.getSubplot(j))&&Z.push(F);var W,Q,$=!e.target;if($)W="xpx"in e?e.xpx:L[0]._length/2,Q="ypx"in e?e.ypx:C[0]._length/2;else{if(!1===h.triggerHandler(t,"plotly_beforehover",e))return;var J=e.target.getBoundingClientRect();if(W=e.clientX-J.left,Q=e.clientY-J.top,W<0||W>J.width||Q<0||Q>J.height)return x.unhoverRaw(t,e)}if(E="xval"in e?w.flat(d,e.xval):w.p2c(L,W),N="yval"in e?w.flat(d,e.yval):w.p2c(C,Q),!f(E[0])||!f(N[0]))return p.warn("Fx.hover failed",e,t),x.unhoverRaw(t,e)}var K=1/0;for(R=0;R<Z.length;R++)if((F=Z[R])&&F[0]&&F[0].trace&&!0===F[0].trace.visible&&(j=F[0].trace,-1===["carpet","contourcarpet"].indexOf(j._module.name))){if(B=w.getSubplot(j),q=d.indexOf(B),H=P,G={cd:F,trace:j,xa:L[q],ya:C[q],index:!1,distance:Math.min(K,k.MAXDIST),color:m.defaultLine,name:j.name,x0:void 0,x1:void 0,y0:void 0,y1:void 0,xLabelVal:void 0,yLabelVal:void 0,zLabelVal:void 0,text:void 0},g[B]&&(G.subplot=g[B]._subplot),X=Y.length,"array"===H){var tt=e[R];"pointNumber"in tt?(G.index=tt.pointNumber,H="closest"):(H="","xval"in tt&&(V=tt.xval,H="x"),"yval"in tt&&(U=tt.yval,H=H?"closest":"y"))}else V=E[q],U=N[q];if(j._module&&j._module.hoverPoints){var et=j._module.hoverPoints(G,V,U,H);if(et)for(var rt,nt=0;nt<et.length;nt++)rt=et[nt],f(rt.x0)&&f(rt.y0)&&Y.push(l(rt,P))}else p.log("Unrecognized trace type in hover:",j);"closest"===P&&Y.length>X&&(Y.splice(0,X),K=Y[0].distance)}if(0===Y.length)return x.unhoverRaw(t,e);Y.sort(function(t,e){return t.distance-e.distance});var at=t._hoverdata,it=[];for(I=0;I<Y.length;I++){var ot=Y[I],lt={data:ot.trace._input,fullData:ot.trace,curveNumber:ot.trace.index,pointNumber:ot.index};ot.trace._module.eventData?lt=ot.trace._module.eventData(lt,ot):(lt.x=ot.xVal,lt.y=ot.yVal,lt.xaxis=ot.xa,lt.yaxis=ot.ya,void 0!==ot.zLabelVal&&(lt.z=ot.zLabelVal)),w.appendArrayPointValue(lt,ot.trace,ot.index),it.push(lt)}if(t._hoverdata=it,c(t,e,at)&&g._hasCartesian){s(Y,{hovermode:P,fullLayout:g,container:g._hoverlayer,outerContainer:g._paperdiv})}var st="y"===P&&Z.length>1,ct=m.combine(g.plot_bgcolor||m.background,g.paper_bgcolor),ut={hovermode:P,rotateLabels:st,bgColor:ct,container:g._hoverlayer,outerContainer:g._paperdiv,commonLabelOpts:g.hoverlabel},ft=a(Y,ut,t);if(i(Y,st?"xa":"ya"),o(ft,st),e.target&&e.target.tagName){var dt=_.getComponentMethod("annotations","hasClickToShow")(t,it);v(u.select(e.target),dt?"pointer":"")}e.target&&!n&&c(t,e,at)&&(at&&t.emit("plotly_unhover",{event:e,points:at}),t.emit("plotly_hover",{event:e,points:t._hoverdata,xaxes:L,yaxes:C,xvals:E,yvals:N}))}function a(t,e,r){var n,a,i=e.hovermode,o=e.rotateLabels,l=e.bgColor,s=e.container,c=e.outerContainer,f=e.commonLabelOpts||{},d=e.fontFamily||k.HOVERFONT,p=e.fontSize||k.HOVERFONTSIZE,h=t[0],v=h.xa,x=h.ya,b="y"===i?"yLabel":"xLabel",_=h[b],w=(String(_)||"").split(" ")[0],A=c.node().getBoundingClientRect(),T=A.top,L=A.width,C=A.height,z=h.distance<=k.MAXDIST&&("x"===i||"y"===i);for(n=0;n<t.length;n++){a=t[n].hoverinfo||t[n].trace.hoverinfo;var D=a.split("+");if(-1===D.indexOf("all")&&-1===D.indexOf(i)){z=!1;break}}var P=s.selectAll("g.axistext").data(z?[0]:[]);P.enter().append("g").classed("axistext",!0),P.exit().remove(),P.each(function(){var e=u.select(this),n=e.selectAll("path").data([0]),a=e.selectAll("text").data([0]);n.enter().append("path").style({"stroke-width":"1px"}),n.style({fill:f.bgcolor||m.defaultLine,stroke:f.bordercolor||m.background}),a.enter().append("text").attr("data-notex",1),a.text(_).call(y.font,f.font.family||d,f.font.size||p,f.font.color||m.background).call(g.positionText,0,0).call(g.convertToTspans,r),e.attr("transform","");var o=a.node().getBoundingClientRect();if("x"===i){a.attr("text-anchor","middle").call(g.positionText,0,"top"===v.side?T-o.bottom-S-O:T-o.top+S+O);var l="top"===v.side?"-":"";n.attr("d","M0,0L"+S+","+l+S+"H"+(O+o.width/2)+"v"+l+(2*O+o.height)+"H-"+(O+o.width/2)+"V"+l+S+"H-"+S+"Z"),e.attr("transform","translate("+(v._offset+(h.x0+h.x1)/2)+","+(x._offset+("top"===v.side?0:x._length))+")")}else{a.attr("text-anchor","right"===x.side?"start":"end").call(g.positionText,("right"===x.side?1:-1)*(O+S),T-o.top-o.height/2);var s="right"===x.side?"":"-";n.attr("d","M0,0L"+s+S+","+S+"V"+(O+o.height/2)+"h"+s+(2*O+o.width)+"V-"+(O+o.height/2)+"H"+s+S+"V-"+S+"Z"),e.attr("transform","translate("+(v._offset+("right"===x.side?v._length:0))+","+(x._offset+(h.y0+h.y1)/2)+")")}t=t.filter(function(t){return void 0!==t.zLabelVal||(t[b]||"").split(" ")[0]===w})});var E=s.selectAll("g.hovertext").data(t,function(t){return[t.trace.index,t.index,t.x0,t.y0,t.name,t.attr,t.xa,t.ya||""].join(",")});return E.enter().append("g").classed("hovertext",!0).each(function(){var t=u.select(this);t.append("rect").call(m.fill,m.addOpacity(l,.8)),t.append("text").classed("name",!0),t.append("path").style("stroke-width","1px"),t.append("text").classed("nums",!0).call(y.font,d,p)}),E.exit().remove(),E.each(function(t){var e=u.select(this).attr("transform",""),n="",a="",s=m.opacity(t.color)?t.color:m.defaultLine,c=m.combine(s,l),f=t.borderColor||m.contrast(c);if(void 0!==t.nameOverride&&(t.name=t.nameOverride),t.name){n=g.plainText(t.name||"");var h=Math.round(t.nameLength);h>-1&&n.length>h&&(n=h>3?n.substr(0,h-3)+"...":n.substr(0,h))}void 0!==t.extraText&&(a+=t.extraText),void 0!==t.zLabel?(void 0!==t.xLabel&&(a+="x: "+t.xLabel+"
"),void 0!==t.yLabel&&(a+="y: "+t.yLabel+"
"),a+=(a?"z: ":"")+t.zLabel):z&&t[i+"Label"]===_?a=t[("x"===i?"y":"x")+"Label"]||"":void 0===t.xLabel?void 0!==t.yLabel&&(a=t.yLabel):a=void 0===t.yLabel?t.xLabel:"("+t.xLabel+", "+t.yLabel+")",t.text&&!Array.isArray(t.text)&&(a+=(a?"
":"")+t.text),""===a&&(""===n&&e.remove(),a=n);var v=e.select("text.nums").call(y.font,t.fontFamily||d,t.fontSize||p,t.fontColor||f).text(a).attr("data-notex",1).call(g.positionText,0,0).call(g.convertToTspans,r),x=e.select("text.name"),b=0;n&&n!==a?(x.call(y.font,t.fontFamily||d,t.fontSize||p,c).text(n).attr("data-notex",1).call(g.positionText,0,0).call(g.convertToTspans,r),b=x.node().getBoundingClientRect().width+2*O):(x.remove(),e.select("rect").remove()),e.select("path").style({fill:c,stroke:f});var w,k,A=v.node().getBoundingClientRect(),D=t.xa._offset+(t.x0+t.x1)/2,P=t.ya._offset+(t.y0+t.y1)/2,E=Math.abs(t.x1-t.x0),N=Math.abs(t.y1-t.y0),I=A.width+S+O+b;t.ty0=T-A.top,t.bx=A.width+2*O,t.by=A.height+2*O,t.anchor="start",t.txwidth=A.width,t.tx2width=b,t.offset=0,o?(t.pos=D,w=P+N/2+I<=C,k=P-N/2-I>=0,"top"!==t.idealAlign&&w||!k?w?(P+=N/2,t.anchor="start"):t.anchor="middle":(P-=N/2,t.anchor="end")):(t.pos=P,w=D+E/2+I<=L,k=D-E/2-I>=0,"left"!==t.idealAlign&&w||!k?w?(D+=E/2,t.anchor="start"):t.anchor="middle":(D-=E/2,t.anchor="end")),v.attr("text-anchor",t.anchor),b&&x.attr("text-anchor",t.anchor),e.attr("transform","translate("+D+","+P+")"+(o?"rotate("+M+")":""))}),E}function i(t,e){function r(t){var e=t[0],r=t[t.length-1];if(a=e.pmin-e.pos-e.dp+e.size,i=r.pos+r.dp+r.size-e.pmax,a>.01){for(l=t.length-1;l>=0;l--)t[l].dp+=a;n=!1}if(!(i<.01)){if(a<-.01){for(l=t.length-1;l>=0;l--)t[l].dp-=i;n=!1}if(n){var c=0;for(o=0;o<t.length;o++)s=t[o],s.pos+s.dp+s.size>e.pmax&&c++;for(o=t.length-1;o>=0&&!(c<=0);o--)s=t[o],s.pos>e.pmax-1&&(s.del=!0,c--);for(o=0;o<t.length&&!(c<=0);o++)if(s=t[o],s.pos<e.pmin+1)for(s.del=!0,c--,i=2*s.size,l=t.length-1;l>=0;l--)t[l].dp-=i;for(o=t.length-1;o>=0&&!(c<=0);o--)s=t[o],s.pos+s.dp+s.size>e.pmax&&(s.del=!0,c--)}}}for(var n,a,i,o,l,s,c,u=0,f=t.map(function(t,r){var n=t[e];return[{i:r,dp:0,pos:t.pos,posref:t.posref,size:t.by*("x"===n._id.charAt(0)?T:1)/2,pmin:n._offset,pmax:n._offset+n._length}]}).sort(function(t,e){return t[0].posref-e[0].posref});!n&&u<=t.length;){for(u++,n=!0,o=0;o<f.length-1;){var d=f[o],p=f[o+1],h=d[d.length-1],g=p[0];if((a=h.pos+h.dp+h.size-g.pos-g.dp+g.size)>.01&&h.pmin===g.pmin&&h.pmax===g.pmax){for(l=p.length-1;l>=0;l--)p[l].dp+=a;for(d.push.apply(d,p),f.splice(o+1,1),c=0,l=d.length-1;l>=0;l--)c+=d[l].dp;for(i=c/d.length,l=d.length-1;l>=0;l--)d[l].dp-=i;n=!1}else o++}f.forEach(r)}for(o=f.length-1;o>=0;o--){var v=f[o];for(l=v.length-1;l>=0;l--){var y=v[l],m=t[y.i];m.offset=y.dp,m.del=y.del}}}function o(t,e){t.each(function(t){var r=u.select(this);if(t.del)return void r.remove();var n="end"===t.anchor?-1:1,a=r.select("text.nums"),i={start:1,end:-1,middle:0}[t.anchor],o=i*(S+O),l=o+i*(t.txwidth+O),s=0,c=t.offset;"middle"===t.anchor&&(o-=t.tx2width/2,l-=t.tx2width/2),e&&(c*=-C,s=t.offset*L),r.select("path").attr("d","middle"===t.anchor?"M-"+t.bx/2+",-"+t.by/2+"h"+t.bx+"v"+t.by+"h-"+t.bx+"Z":"M0,0L"+(n*S+s)+","+(S+c)+"v"+(t.by/2-S)+"h"+n*t.bx+"v-"+t.by+"H"+(n*S+s)+"V"+(c-S)+"Z"),a.call(g.positionText,o+s,c+t.ty0-t.by/2+O),t.tx2width&&(r.select("text.name").call(g.positionText,l+i*O+s,c+t.ty0-t.by/2+O),r.select("rect").call(y.setRect,l+(i-1)*t.tx2width/2+s,c-t.by/2-1,t.tx2width,t.by+2))})}function l(t,e){function r(e,r,n){var a=l(r,n);a&&(t[e]=a)}var n=t.index,a=t.trace||{},i=t.cd[0],o=t.cd[n]||{},l=Array.isArray(n)?function(t,e){return p.castOption(i,n,t)||p.extractOption({},a,"",e)}:function(t,e){return p.extractOption(o,a,t,e)};r("hoverinfo","hi","hoverinfo"),r("color","hbg","hoverlabel.bgcolor"),r("borderColor","hbc","hoverlabel.bordercolor"),r("fontFamily","htf","hoverlabel.font.family"),r("fontSize","hts","hoverlabel.font.size"),r("fontColor","htc","hoverlabel.font.color"),r("nameLength","hnl","hoverlabel.namelength"),t.posref="y"===e?(t.x0+t.x1)/2:(t.y0+t.y1)/2,t.x0=p.constrain(t.x0,0,t.xa._length),t.x1=p.constrain(t.x1,0,t.xa._length),t.y0=p.constrain(t.y0,0,t.ya._length),t.y1=p.constrain(t.y1,0,t.ya._length);var s;if(void 0!==t.xLabelVal){s="log"===t.xa.type&&t.xLabelVal<=0;var c=b.tickText(t.xa,t.xa.c2l(s?-t.xLabelVal:t.xLabelVal),"hover");s?0===t.xLabelVal?t.xLabel="0":t.xLabel="-"+c.text:t.xLabel=c.text,t.xVal=t.xa.c2d(t.xLabelVal)}if(void 0!==t.yLabelVal){s="log"===t.ya.type&&t.yLabelVal<=0;var u=b.tickText(t.ya,t.ya.c2l(s?-t.yLabelVal:t.yLabelVal),"hover");s?0===t.yLabelVal?t.yLabel="0":t.yLabel="-"+u.text:t.yLabel=u.text,t.yVal=t.ya.c2d(t.yLabelVal)}if(void 0!==t.zLabelVal&&(t.zLabel=String(t.zLabelVal)),!(isNaN(t.xerr)||"log"===t.xa.type&&t.xerr<=0)){var f=b.tickText(t.xa,t.xa.c2l(t.xerr),"hover").text;void 0!==t.xerrneg?t.xLabel+=" +"+f+" / -"+b.tickText(t.xa,t.xa.c2l(t.xerrneg),"hover").text:t.xLabel+=" \xb1 "+f,"x"===e&&(t.distance+=1)}if(!(isNaN(t.yerr)||"log"===t.ya.type&&t.yerr<=0)){var d=b.tickText(t.ya,t.ya.c2l(t.yerr),"hover").text;void 0!==t.yerrneg?t.yLabel+=" +"+d+" / -"+b.tickText(t.ya,t.ya.c2l(t.yerrneg),"hover").text:t.yLabel+=" \xb1 "+d,"y"===e&&(t.distance+=1)}var h=t.hoverinfo||t.trace.hoverinfo;return"all"!==h&&(h=h.split("+"),-1===h.indexOf("x")&&(t.xLabel=void 0),-1===h.indexOf("y")&&(t.yLabel=void 0),-1===h.indexOf("z")&&(t.zLabel=void 0),-1===h.indexOf("text")&&(t.text=void 0),-1===h.indexOf("name")&&(t.name=void 0)),t}function s(t,e){var r=e.hovermode,n=e.container,a=t[0],i=a.xa,o=a.ya,l=i.showspikes,s=o.showspikes;if(n.selectAll(".spikeline").remove(),"closest"===r&&(l||s)){var c=e.fullLayout,u=i._offset+(a.x0+a.x1)/2,f=o._offset+(a.y0+a.y1)/2,p=m.combine(c.plot_bgcolor,c.paper_bgcolor),h=d.readability(a.color,p)<1.5?m.contrast(p):a.color;if(s){var g=o.spikemode,v=o.spikethickness,x=o.spikecolor||h,b=o._boundingBox,_=(b.left+b.right)/2<u?b.right:b.left;if(-1!==g.indexOf("toaxis")||-1!==g.indexOf("across")){var w=_,k=u;-1!==g.indexOf("across")&&(w=o._counterSpan[0],k=o._counterSpan[1]),n.append("line").attr({x1:w,x2:k,y1:f,y2:f,"stroke-width":v+2,stroke:p}).classed("spikeline",!0).classed("crisp",!0),n.append("line").attr({x1:w,x2:k,y1:f,y2:f,"stroke-width":v,stroke:x,"stroke-dasharray":y.dashStyle(o.spikedash,v)}).classed("spikeline",!0).classed("crisp",!0)}-1!==g.indexOf("marker")&&n.append("circle").attr({cx:_+("right"!==o.side?v:-v),cy:f,r:v,fill:x}).classed("spikeline",!0)}if(l){var M=i.spikemode,A=i.spikethickness,T=i.spikecolor||h,L=i._boundingBox,C=(L.top+L.bottom)/2<f?L.bottom:L.top;if(-1!==M.indexOf("toaxis")||-1!==M.indexOf("across")){var S=C,O=f;-1!==M.indexOf("across")&&(S=i._counterSpan[0],O=i._counterSpan[1]),n.append("line").attr({x1:u,x2:u,y1:S,y2:O,"stroke-width":A+2,stroke:p}).classed("spikeline",!0).classed("crisp",!0),n.append("line").attr({x1:u,x2:u,y1:S,y2:O,"stroke-width":A,stroke:T,"stroke-dasharray":y.dashStyle(i.spikedash,A)}).classed("spikeline",!0).classed("crisp",!0)}-1!==M.indexOf("marker")&&n.append("circle").attr({cx:u,cy:C-("top"!==i.side?A:-A),r:A,fill:T}).classed("spikeline",!0)}}}function c(t,e,r){if(!r||r.length!==t._hoverdata.length)return!0;for(var n=r.length-1;n>=0;n--){var a=r[n],i=t._hoverdata[n];if(a.curveNumber!==i.curveNumber||String(a.pointNumber)!==String(i.pointNumber))return!0}return!1}var u=t("d3"),f=t("fast-isnumeric"),d=t("tinycolor2"),p=t("../../lib"),h=t("../../lib/events"),g=t("../../lib/svg_text_utils"),v=t("../../lib/override_cursor"),y=t("../drawing"),m=t("../color"),x=t("../dragelement"),b=t("../../plots/cartesian/axes"),_=t("../../registry"),w=t("./helpers"),k=t("./constants"),M=k.YANGLE,A=Math.PI*M/180,T=1/Math.sin(A),L=Math.cos(A),C=Math.sin(A),S=k.HOVERARROWSIZE,O=k.HOVERTEXTPAD;r.hover=function(t,e,r,a){t=p.getGraphDiv(t),p.throttle(t._fullLayout._uid+k.HOVERID,k.HOVERMINTIME,function(){n(t,e,r,a)})},r.loneHover=function(t,e){var r={color:t.color||m.defaultLine,x0:t.x0||t.x||0,x1:t.x1||t.x||0,y0:t.y0||t.y||0,y1:t.y1||t.y||0,xLabel:t.xLabel,yLabel:t.yLabel,zLabel:t.zLabel,text:t.text,name:t.name,idealAlign:t.idealAlign,borderColor:t.borderColor,fontFamily:t.fontFamily,fontSize:t.fontSize,fontColor:t.fontColor,trace:{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0},n=u.select(e.container),i=e.outerContainer?u.select(e.outerContainer):n,l={hovermode:"closest",rotateLabels:!1,bgColor:e.bgColor||m.background,container:n,outerContainer:i},s=a([r],l,e.gd);return o(s,l.rotateLabels),s.node()}},{"../../lib":149,"../../lib/events":142,"../../lib/override_cursor":159,"../../lib/svg_text_utils":169,"../../plots/cartesian/axes":189,"../../registry":225,"../color":34,"../dragelement":55,"../drawing":58,"./constants":70,"./helpers":72,d3:7,"fast-isnumeric":10,tinycolor2:16}],74:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e,r,a){a=a||{},r("hoverlabel.bgcolor",a.bgcolor),r("hoverlabel.bordercolor",a.bordercolor),r("hoverlabel.namelength",a.namelength),n.coerceFont(r,"hoverlabel.font",a.font)}},{"../../lib":149}],75:[function(t,e,r){"use strict";function n(t){var e=l.isD3Selection(t)?t:o.select(t);e.selectAll("g.hovertext").remove(),e.selectAll(".spikeline").remove()}function a(t,e,r){return l.castOption(t,e,"hoverlabel."+r)}function i(t,e,r){function n(r){return l.coerceHoverinfo({hoverinfo:r},{_module:t._module},e)}return l.castOption(t,r,"hoverinfo",n)}var o=t("d3"),l=t("../../lib"),s=t("../dragelement"),c=t("./helpers"),u=t("./layout_attributes");e.exports={moduleType:"component",name:"fx",constants:t("./constants"),schema:{layout:u},attributes:t("./attributes"),layoutAttributes:u,supplyLayoutGlobalDefaults:t("./layout_global_defaults"),supplyDefaults:t("./defaults"),supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc"),getDistanceFunction:c.getDistanceFunction,getClosest:c.getClosest,inbox:c.inbox,appendArrayPointValue:c.appendArrayPointValue,castHoverOption:a,castHoverinfo:i,hover:t("./hover").hover,unhover:s.unhover,loneHover:t("./hover").loneHover,loneUnhover:n,click:t("./click")}},{"../../lib":149,"../dragelement":55,"./attributes":67,"./calc":68,"./click":69,"./constants":70,"./defaults":71,"./helpers":72,"./hover":73,"./layout_attributes":76,"./layout_defaults":77,"./layout_global_defaults":78,d3:7}],76:[function(t,e,r){"use strict";var n=t("./constants"),a=t("../../plots/font_attributes")({editType:"none"});a.family.dflt=n.HOVERFONT,a.size.dflt=n.HOVERFONTSIZE,e.exports={dragmode:{valType:"enumerated",values:["zoom","pan","select","lasso","orbit","turntable"],dflt:"zoom",editType:"modebar"},hovermode:{valType:"enumerated",values:["x","y","closest",!1],editType:"modebar"},hoverlabel:{bgcolor:{valType:"color",editType:"none"},bordercolor:{valType:"color",editType:"none"},font:a,namelength:{valType:"integer",min:-1,dflt:15,editType:"none"},editType:"none"}}},{"../../plots/font_attributes":213,"./constants":70}],77:[function(t,e,r){"use strict";function n(t){for(var e=!0,r=0;r<t.length;r++){if("h"!==t[r].orientation){e=!1;break}}return e}var a=t("../../lib"),i=t("./layout_attributes");e.exports=function(t,e,r){function o(r,n){return a.coerce(t,e,i,r,n)}o("dragmode");var l;e._has("cartesian")?(e._isHoriz=n(r),l=e._isHoriz?"y":"x"):l="closest",o("hovermode",l);var s=e._has("mapbox"),c=e._has("geo"),u=e._basePlotModules.length;"zoom"===e.dragmode&&((s||c)&&1===u||s&&c&&2===u)&&(e.dragmode="pan")}},{"../../lib":149,"./layout_attributes":76}],78:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./hoverlabel_defaults"),i=t("./layout_attributes");e.exports=function(t,e){function r(r,a){return n.coerce(t,e,i,r,a)}a(t,e,r)}},{"../../lib":149,"./hoverlabel_defaults":74,"./layout_attributes":76}],79:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/constants");e.exports={_isLinkedToArray:"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"}},{"../../plots/cartesian/constants":194}],80:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib/to_log_range");e.exports=function(t,e,r,i){e=e||{};var o="log"===r&&"linear"===e.type,l="linear"===r&&"log"===e.type;if(o||l)for(var s,c,u=t._fullLayout.images,f=e._id.charAt(0),d=0;d<u.length;d++)if(s=u[d],c="images["+d+"].",s[f+"ref"]===e._id){var p=s[f],h=s["size"+f],g=null,v=null;if(o){g=a(p,e.range);var y=h/Math.pow(10,g)/2;v=2*Math.log(y+Math.sqrt(1+y*y))/Math.LN10}else g=Math.pow(10,p),v=g*(Math.pow(10,h/2)-Math.pow(10,-h/2));n(g)?n(v)||(v=null):(g=null,v=null),i(c+f,g),i(c+"size"+f,v)}}},{"../../lib/to_log_range":171,"fast-isnumeric":10}],81:[function(t,e,r){"use strict";function n(t,e,r){function n(r,n){return a.coerce(t,e,l,r,n)}if(!n("visible",!!n("source")))return e;n("layer"),n("xanchor"),n("yanchor"),n("sizex"),n("sizey"),n("sizing"),n("opacity");for(var o={_fullLayout:r},s=["x","y"],c=0;c<2;c++){var u=s[c],f=i.coerceRef(t,e,o,u,"paper");i.coercePosition(e,o,n,f,u,0)}return e}var a=t("../../lib"),i=t("../../plots/cartesian/axes"),o=t("../../plots/array_container_defaults"),l=t("./attributes");e.exports=function(t,e){o(t,e,{name:"images",handleItemDefaults:n})}},{"../../lib":149,"../../plots/array_container_defaults":186,"../../plots/cartesian/axes":189,"./attributes":79}],82:[function(t,e,r){"use strict";var n=t("d3"),a=t("../drawing"),i=t("../../plots/cartesian/axes"),o=t("../../constants/xmlns_namespaces");e.exports=function(t){function e(e){var r=n.select(this);if(!this.img||this.img.src!==e.source){r.attr("xmlns",o.svg);var a=new Promise(function(t){function n(){r.remove(),t()}var a=new Image;this.img=a,a.setAttribute("crossOrigin","anonymous"),a.onerror=n,a.onload=function(){var e=document.createElement("canvas");e.width=this.width,e.height=this.height,

e.getContext("2d").drawImage(this,0,0);var n=e.toDataURL("image/png");r.attr("xlink:href",n),t()},r.on("error",n),a.src=e.source}.bind(this));t._promises.push(a)}}function r(e){var r=n.select(this),o=i.getFromId(t,e.xref),l=i.getFromId(t,e.yref),s=c._size,u=o?Math.abs(o.l2p(e.sizex)-o.l2p(0)):e.sizex*s.w,f=l?Math.abs(l.l2p(e.sizey)-l.l2p(0)):e.sizey*s.h,d=u*g.x[e.xanchor].offset,p=f*g.y[e.yanchor].offset,h=g.x[e.xanchor].sizing+g.y[e.yanchor].sizing,v=(o?o.r2p(e.x)+o._offset:e.x*s.w+s.l)+d,y=(l?l.r2p(e.y)+l._offset:s.h-e.y*s.h+s.t)+p;switch(e.sizing){case"fill":h+=" slice";break;case"stretch":h="none"}r.attr({x:v,y:y,width:u,height:f,preserveAspectRatio:h,opacity:e.opacity});var m=o?o._id:"",x=l?l._id:"",b=m+x;r.call(a.setClipUrl,b?"clip"+c._uid+b:null)}var l,s,c=t._fullLayout,u=[],f={},d=[];for(s=0;s<c.images.length;s++){var p=c.images[s];if(p.visible)if("below"===p.layer&&"paper"!==p.xref&&"paper"!==p.yref){l=p.xref+p.yref;var h=c._plots[l];if(!h){d.push(p);continue}h.mainplot&&(l=h.mainplot.id),f[l]||(f[l]=[]),f[l].push(p)}else"above"===p.layer?u.push(p):d.push(p)}var g={x:{left:{sizing:"xMin",offset:0},center:{sizing:"xMid",offset:-.5},right:{sizing:"xMax",offset:-1}},y:{top:{sizing:"YMin",offset:0},middle:{sizing:"YMid",offset:-.5},bottom:{sizing:"YMax",offset:-1}}},v=c._imageLowerLayer.selectAll("image").data(d),y=c._imageUpperLayer.selectAll("image").data(u);v.enter().append("image"),y.enter().append("image"),v.exit().remove(),y.exit().remove(),v.each(function(t){e.bind(this)(t),r.bind(this)(t)}),y.each(function(t){e.bind(this)(t),r.bind(this)(t)});var m=Object.keys(c._plots);for(s=0;s<m.length;s++){l=m[s];var x=c._plots[l];if(x.imagelayer){var b=x.imagelayer.selectAll("image").data(f[l]||[]);b.enter().append("image"),b.exit().remove(),b.each(function(t){e.bind(this)(t),r.bind(this)(t)})}}}},{"../../constants/xmlns_namespaces":135,"../../plots/cartesian/axes":189,"../drawing":58,d3:7}],83:[function(t,e,r){"use strict";e.exports={moduleType:"component",name:"images",layoutAttributes:t("./attributes"),supplyLayoutDefaults:t("./defaults"),draw:t("./draw"),convertCoords:t("./convert_coords")}},{"./attributes":79,"./convert_coords":80,"./defaults":81,"./draw":82}],84:[function(t,e,r){"use strict";r.isRightAnchor=function(t){return"right"===t.xanchor||"auto"===t.xanchor&&t.x>=2/3},r.isCenterAnchor=function(t){return"center"===t.xanchor||"auto"===t.xanchor&&t.x>1/3&&t.x<2/3},r.isBottomAnchor=function(t){return"bottom"===t.yanchor||"auto"===t.yanchor&&t.y<=1/3},r.isMiddleAnchor=function(t){return"middle"===t.yanchor||"auto"===t.yanchor&&t.y>1/3&&t.y<2/3}},{}],85:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),a=t("../color/attributes");e.exports={bgcolor:{valType:"color",editType:"legend"},bordercolor:{valType:"color",dflt:a.defaultLine,editType:"legend"},borderwidth:{valType:"number",min:0,dflt:0,editType:"legend"},font:n({editType:"legend"}),orientation:{valType:"enumerated",values:["v","h"],dflt:"v",editType:"legend"},traceorder:{valType:"flaglist",flags:["reversed","grouped"],extras:["normal"],editType:"legend"},tracegroupgap:{valType:"number",min:0,dflt:10,editType:"legend"},x:{valType:"number",min:-2,max:3,dflt:1.02,editType:"legend"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left",editType:"legend"},y:{valType:"number",min:-2,max:3,dflt:1,editType:"legend"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto",editType:"legend"},editType:"legend"}},{"../../plots/font_attributes":213,"../color/attributes":33}],86:[function(t,e,r){"use strict";e.exports={scrollBarWidth:4,scrollBarHeight:20,scrollBarColor:"#808BA4",scrollBarMargin:4}},{}],87:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../lib"),i=t("./attributes"),o=t("../../plots/layout_attributes"),l=t("./helpers");e.exports=function(t,e,r){function s(t,e){return a.coerce(p,h,i,t,e)}for(var c,u,f,d,p=t.legend||{},h=e.legend={},g=0,v="normal",y=0;y<r.length;y++){var m=r[y];l.legendGetsTrace(m)&&(g++,n.traceIs(m,"pie")&&g++),(n.traceIs(m,"bar")&&"stack"===e.barmode||-1!==["tonextx","tonexty"].indexOf(m.fill))&&(v=l.isGrouped({traceorder:v})?"grouped+reversed":"reversed"),void 0!==m.legendgroup&&""!==m.legendgroup&&(v=l.isReversed({traceorder:v})?"reversed+grouped":"grouped")}if(!1!==a.coerce(t,e,o,"showlegend",g>1)){if(s("bgcolor",e.paper_bgcolor),s("bordercolor"),s("borderwidth"),a.coerceFont(s,"font",e.font),s("orientation"),"h"===h.orientation){var x=t.xaxis;x&&x.rangeslider&&x.rangeslider.visible?(c=0,f="left",u=1.1,d="bottom"):(c=0,f="left",u=-.1,d="top")}s("traceorder",v),l.isGrouped(e.legend)&&s("tracegroupgap"),s("x",c),s("xanchor",f),s("y",u),s("yanchor",d),a.noneOrAll(p,h,["x","y"])}}},{"../../lib":149,"../../plots/layout_attributes":216,"../../registry":225,"./attributes":85,"./helpers":91}],88:[function(t,e,r){"use strict";function n(t,e){function r(r){y.convertToTspans(r,e,function(){i(t,e)})}var n=t.data()[0][0],a=e._fullLayout,o=n.trace,l=p.traceIs(o,"pie"),s=o.index,c=l?n.label:o.name,d=t.selectAll("text.legendtext").data([0]);d.enter().append("text").classed("legendtext",!0),d.attr("text-anchor","start").classed("user-select-none",!0).call(g.font,a.legend.font).text(c),e._context.edits.legendText&&!l?d.call(y.makeEditable,{gd:e}).call(r).on("edit",function(t){this.text(t).call(r);var a=t;this.text()||(t=" ");var i,o,l=n.trace._fullInput||{},c={};if(-1!==["ohlc","candlestick"].indexOf(l.type))i=n.trace.transforms,o=i[i.length-1].direction,c[o+".name"]=t;else if(p.hasTransform(l,"groupby")){var d=p.getTransformIndices(l,"groupby"),h=d[d.length-1],g=f.keyedContainer(l,"transforms["+h+"].styles","target","value.name");""===a?g.remove(n.trace._group):g.set(n.trace._group,t),c=g.constructUpdate()}else c.name=t;return u.restyle(e,c,s)}):d.call(r)}function a(t,e){var r,n=1,a=t.selectAll("rect").data([0]);a.enter().append("rect").classed("legendtoggle",!0).style("cursor","pointer").attr("pointer-events","all").call(v.fill,"rgba(0,0,0,0)"),a.on("mousedown",function(){r=(new Date).getTime(),r-e._legendMouseDownTime<T?n+=1:(n=1,e._legendMouseDownTime=r)}),a.on("mouseup",function(){if(!e._dragged&&!e._editing){var r=e._fullLayout.legend;(new Date).getTime()-e._legendMouseDownTime>T&&(n=Math.max(n-1,1)),1===n?r._clickTimeout=setTimeout(function(){m(t,e,n)},T):2===n&&(r._clickTimeout&&clearTimeout(r._clickTimeout),e._legendMouseDownTime=0,m(t,e,n))}})}function i(t,e){var r=t.data()[0][0];if(!r.trace.showlegend)return void t.remove();var n,a,i=t.select("g[class*=math-group]"),o=i.node(),l=e._fullLayout.legend,s=l.font.size*_;if(o){var c=g.bBox(o);n=c.height,a=c.width,g.setTranslate(i,0,n/4)}else{var u=t.select(".legendtext"),f=y.lineCount(u),d=u.node();n=s*f,a=d?g.bBox(d).width:0;var p=s*(.3+(1-f)/2);y.positionText(u,40,p)}n=Math.max(n,16)+3,r.height=n,r.width=a}function o(t,e,r){var n=t._fullLayout,a=n.legend,i=a.borderwidth,o=M.isGrouped(a),l=0;if(a.width=0,a.height=0,M.isVertical(a))o&&e.each(function(t,e){g.setTranslate(this,0,e*a.tracegroupgap)}),r.each(function(t){var e=t[0],r=e.height,n=e.width;g.setTranslate(this,i,5+i+a.height+r/2),a.height+=r,a.width=Math.max(a.width,n)}),a.width+=45+2*i,a.height+=10+2*i,o&&(a.height+=(a._lgroupsLength-1)*a.tracegroupgap),l=40;else if(o){for(var s=[a.width],u=e.data(),f=0,d=u.length;f<d;f++){var p=u[f].map(function(t){return t[0].width}),h=40+Math.max.apply(null,p);a.width+=a.tracegroupgap+h,s.push(a.width)}e.each(function(t,e){g.setTranslate(this,s[e],0)}),e.each(function(){var t=c.select(this),e=t.selectAll("g.traces"),r=0;e.each(function(t){var e=t[0],n=e.height;g.setTranslate(this,0,5+i+r+n/2),r+=n}),a.height=Math.max(a.height,r)}),a.height+=10+2*i,a.width+=2*i}else{var v=0,y=0,m=0,x=0;r.each(function(t){m=Math.max(40+t[0].width,m)}),r.each(function(t){var e=t[0],r=m,o=a.tracegroupgap||5;i+x+o+r>n.width-(n.margin.r+n.margin.l)&&(x=0,v+=y,a.height=a.height+y,y=0),g.setTranslate(this,i+x,5+i+e.height/2+v),a.width+=o+r,a.height=Math.max(a.height,e.height),x+=o+r,y=Math.max(e.height,y)}),a.width+=2*i,a.height+=10+2*i}a.width=Math.ceil(a.width),a.height=Math.ceil(a.height),r.each(function(e){var r=e[0];c.select(this).select(".legendtoggle").call(g.setRect,0,-r.height/2,(t._context.edits.legendText?0:a.width)+l,r.height)})}function l(t){var e=t._fullLayout,r=e.legend,n="left";A.isRightAnchor(r)?n="right":A.isCenterAnchor(r)&&(n="center");var a="top";A.isBottomAnchor(r)?a="bottom":A.isMiddleAnchor(r)&&(a="middle"),d.autoMargin(t,"legend",{x:r.x,y:r.y,l:r.width*({right:1,center:.5}[n]||0),r:r.width*({left:1,center:.5}[n]||0),b:r.height*({top:1,middle:.5}[a]||0),t:r.height*({bottom:1,middle:.5}[a]||0)})}function s(t){var e=t._fullLayout,r=e.legend,n="left";A.isRightAnchor(r)?n="right":A.isCenterAnchor(r)&&(n="center"),d.autoMargin(t,"legend",{x:r.x,y:.5,l:r.width*({right:1,center:.5}[n]||0),r:r.width*({left:1,center:.5}[n]||0),b:0,t:0})}var c=t("d3"),u=t("../../plotly"),f=t("../../lib"),d=t("../../plots/plots"),p=t("../../registry"),h=t("../dragelement"),g=t("../drawing"),v=t("../color"),y=t("../../lib/svg_text_utils"),m=t("./handle_click"),x=t("./constants"),b=t("../../constants/interactions"),_=t("../../constants/alignment").LINE_SPACING,w=t("./get_legend_data"),k=t("./style"),M=t("./helpers"),A=t("./anchor_utils"),T=b.DBLCLICKDELAY;e.exports=function(t){function e(t,e){S.attr("data-scroll",e).call(g.setTranslate,0,e),O.call(g.setRect,j,t,x.scrollBarWidth,x.scrollBarHeight),L.select("rect").attr({y:y.borderwidth-e})}var r=t._fullLayout,i="legend"+r._uid;if(r._infolayer&&t.calcdata){t._legendMouseDownTime||(t._legendMouseDownTime=0);var y=r.legend,b=r.showlegend&&w(t.calcdata,y),_=r.hiddenlabels||[];if(!r.showlegend||!b.length)return r._infolayer.selectAll(".legend").remove(),r._topdefs.select("#"+i).remove(),void d.autoMargin(t,"legend");var M=r._infolayer.selectAll("g.legend").data([0]);M.enter().append("g").attr({class:"legend","pointer-events":"all"});var L=r._topdefs.selectAll("#"+i).data([0]);L.enter().append("clipPath").attr("id",i).append("rect");var C=M.selectAll("rect.bg").data([0]);C.enter().append("rect").attr({class:"bg","shape-rendering":"crispEdges"}),C.call(v.stroke,y.bordercolor),C.call(v.fill,y.bgcolor),C.style("stroke-width",y.borderwidth+"px");var S=M.selectAll("g.scrollbox").data([0]);S.enter().append("g").attr("class","scrollbox");var O=M.selectAll("rect.scrollbar").data([0]);O.enter().append("rect").attr({class:"scrollbar",rx:20,ry:2,width:0,height:0}).call(v.fill,"#808BA4");var z=S.selectAll("g.groups").data(b);z.enter().append("g").attr("class","groups"),z.exit().remove();var D=z.selectAll("g.traces").data(f.identity);D.enter().append("g").attr("class","traces"),D.exit().remove(),D.call(k,t).style("opacity",function(t){var e=t[0].trace;return p.traceIs(e,"pie")?-1!==_.indexOf(t[0].label)?.5:1:"legendonly"===e.visible?.5:1}).each(function(){c.select(this).call(n,t).call(a,t)});var P=0!==M.enter().size();P&&(o(t,z,D),l(t));var E=r.width,N=r.height;o(t,z,D),y.height>N?s(t):l(t);var I=r._size,R=I.l+I.w*y.x,F=I.t+I.h*(1-y.y);A.isRightAnchor(y)?R-=y.width:A.isCenterAnchor(y)&&(R-=y.width/2),A.isBottomAnchor(y)?F-=y.height:A.isMiddleAnchor(y)&&(F-=y.height/2);var j=y.width,B=I.w;j>B?(R=I.l,j=B):(R+j>E&&(R=E-j),R<0&&(R=0),j=Math.min(E-R,y.width));var q=y.height,H=I.h;q>H?(F=I.t,q=H):(F+q>N&&(F=N-q),F<0&&(F=0),q=Math.min(N-F,y.height)),g.setTranslate(M,R,F);var V,U,G=q-x.scrollBarHeight-2*x.scrollBarMargin,X=y.height-q;if(y.height<=q||t._context.staticPlot)C.attr({width:j-y.borderwidth,height:q-y.borderwidth,x:y.borderwidth/2,y:y.borderwidth/2}),g.setTranslate(S,0,0),L.select("rect").attr({width:j-2*y.borderwidth,height:q-2*y.borderwidth,x:y.borderwidth,y:y.borderwidth}),S.call(g.setClipUrl,i);else{V=x.scrollBarMargin,U=S.attr("data-scroll")||0,C.attr({width:j-2*y.borderwidth+x.scrollBarWidth+x.scrollBarMargin,height:q-y.borderwidth,x:y.borderwidth/2,y:y.borderwidth/2}),L.select("rect").attr({width:j-2*y.borderwidth+x.scrollBarWidth+x.scrollBarMargin,height:q-2*y.borderwidth,x:y.borderwidth,y:y.borderwidth-U}),S.call(g.setClipUrl,i),P&&e(V,U),M.on("wheel",null),M.on("wheel",function(){U=f.constrain(S.attr("data-scroll")-c.event.deltaY/G*X,-X,0),V=x.scrollBarMargin-U/X*G,e(V,U),0!==U&&U!==-X&&c.event.preventDefault()}),O.on(".drag",null),S.on(".drag",null);var Y=c.behavior.drag().on("drag",function(){V=f.constrain(c.event.y-x.scrollBarHeight/2,x.scrollBarMargin,x.scrollBarMargin+G),U=-(V-x.scrollBarMargin)/G*X,e(V,U)});O.call(Y),S.call(Y)}if(t._context.edits.legendPosition){var Z,W,Q,$;M.classed("cursor-move",!0),h.init({element:M.node(),gd:t,prepFn:function(){var t=g.getTranslate(M);Q=t.x,$=t.y},moveFn:function(t,e){var r=Q+t,n=$+e;g.setTranslate(M,r,n),Z=h.align(r,0,I.l,I.l+I.w,y.xanchor),W=h.align(n,0,I.t+I.h,I.t,y.yanchor)},doneFn:function(e,n,a){if(e&&void 0!==Z&&void 0!==W)u.relayout(t,{"legend.x":Z,"legend.y":W});else{var i=r._infolayer.selectAll("g.traces").filter(function(){var t=this.getBoundingClientRect();return a.clientX>=t.left&&a.clientX<=t.right&&a.clientY>=t.top&&a.clientY<=t.bottom});i.size()>0&&(1===n?M._clickTimeout=setTimeout(function(){m(i,t,n)},T):2===n&&(M._clickTimeout&&clearTimeout(M._clickTimeout),m(i,t,n)))}}})}}}},{"../../constants/alignment":131,"../../constants/interactions":132,"../../lib":149,"../../lib/svg_text_utils":169,"../../plotly":184,"../../plots/plots":218,"../../registry":225,"../color":34,"../dragelement":55,"../drawing":58,"./anchor_utils":84,"./constants":86,"./get_legend_data":89,"./handle_click":90,"./helpers":91,"./style":93,d3:7}],89:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("./helpers");e.exports=function(t,e){function r(t,r){if(""!==t&&a.isGrouped(e))-1===s.indexOf(t)?(s.push(t),c=!0,l[t]=r):l[t].push([r]);else{var n="~~i"+f;s.push(n),l[n]=r,f++}}var i,o,l={},s=[],c=!1,u={},f=0;for(i=0;i<t.length;i++){var d=t[i],p=d[0],h=p.trace,g=h.legendgroup;if(a.legendGetsTrace(h)&&h.showlegend)if(n.traceIs(h,"pie"))for(u[g]||(u[g]={}),o=0;o<d.length;o++){var v=d[o].label;u[g][v]||(r(g,{label:v,color:d[o].color,i:d[o].i,trace:h}),u[g][v]=!0)}else r(g,p)}if(!s.length)return[];var y,m,x=s.length;if(c&&a.isGrouped(e))for(m=new Array(x),i=0;i<x;i++)y=l[s[i]],m[i]=a.isReversed(e)?y.reverse():y;else{for(m=[new Array(x)],i=0;i<x;i++)y=l[s[i]][0],m[0][a.isReversed(e)?x-i-1:i]=y;x=1}return e._lgroupsLength=x,m}},{"../../registry":225,"./helpers":91}],90:[function(t,e,r){"use strict";var n=t("../../plotly"),a=t("../../lib"),i=t("../../registry"),o=!0;e.exports=function(t,e,r){function l(t,e,r){var n=_.indexOf(t),a=b[e];return a||(a=b[e]=[]),-1===_.indexOf(t)&&(_.push(t),n=_.length-1),a[n]=r,n}function s(t,e){var r=t._fullInput;if(i.hasTransform(r,"groupby")){var n=w[r.index];if(!n){var o=i.getTransformIndices(r,"groupby"),s=o[o.length-1];n=a.keyedContainer(r,"transforms["+s+"].styles","target","value.visible"),w[r.index]=n}var c=n.get(t._group);void 0===c&&(c=!0),!1!==c&&n.set(t._group,e),k[r.index]=l(r.index,"visible",!1!==r.visible)}else{var u=!1!==r.visible&&e;l(r.index,"visible",u)}}if(!e._dragged&&!e._editing){var c,u,f,d,p,h,g=e._fullLayout.hiddenlabels?e._fullLayout.hiddenlabels.slice():[],v=t.data()[0][0],y=e._fullData,m=v.trace,x=m.legendgroup,b={},_=[],w=[],k=[];if(1===r&&o&&e.data&&e._context.showTips?(a.notifier("Double click on legend to isolate individual trace","long"),o=!1):o=!1,i.traceIs(m,"pie")){var M=v.label,A=g.indexOf(M);1===r?-1===A?g.push(M):g.splice(A,1):2===r&&(g=[],e.calcdata[0].forEach(function(t){M!==t.label&&g.push(t.label)}),e._fullLayout.hiddenlabels&&e._fullLayout.hiddenlabels.length===g.length&&-1===A&&(g=[])),n.relayout(e,"hiddenlabels",g)}else{var T,L=x&&x.length,C=[];if(L)for(c=0;c<y.length;c++)T=y[c],T.visible&&T.legendgroup===x&&C.push(c);if(1===r){var S;switch(m.visible){case!0:S="legendonly";break;case!1:S=!1;break;case"legendonly":S=!0}if(L)for(c=0;c<y.length;c++)!1!==y[c].visible&&y[c].legendgroup===x&&s(y[c],S);else s(m,S)}else if(2===r){var O,z,D,P=!0;for(c=0;c<y.length;c++)if(!(O=y[c]===m)&&!(z=L&&y[c].legendgroup===x)&&!0===y[c].visible&&!i.traceIs(y[c],"notLegendIsolatable")){P=!1;break}for(c=0;c<y.length;c++)if(!1!==y[c].visible&&!i.traceIs(y[c],"notLegendIsolatable"))switch(m.visible){case"legendonly":s(y[c],!0);break;case!0:D=!!P||"legendonly",O=y[c]===m,z=O||L&&y[c].legendgroup===x,s(y[c],!!z||D)}}for(c=0;c<w.length;c++)if(f=w[c]){var E=f.constructUpdate(),N=Object.keys(E);for(u=0;u<N.length;u++)d=N[u],h=b[d]=b[d]||[],h[k[c]]=E[d]}for(p=Object.keys(b),c=0;c<p.length;c++)for(d=p[c],u=0;u<_.length;u++)b[d].hasOwnProperty(u)||(b[d][u]=void 0);n.restyle(e,b,_)}}}},{"../../lib":149,"../../plotly":184,"../../registry":225}],91:[function(t,e,r){"use strict";var n=t("../../registry");r.legendGetsTrace=function(t){return t.visible&&n.traceIs(t,"showLegend")},r.isGrouped=function(t){return-1!==(t.traceorder||"").indexOf("grouped")},r.isVertical=function(t){return"h"!==t.orientation},r.isReversed=function(t){return-1!==(t.traceorder||"").indexOf("reversed")}},{"../../registry":225}],92:[function(t,e,r){"use strict";e.exports={moduleType:"component",name:"legend",layoutAttributes:t("./attributes"),supplyLayoutDefaults:t("./defaults"),draw:t("./draw"),style:t("./style")}},{"./attributes":85,"./defaults":87,"./draw":88,"./style":93}],93:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../registry"),i=t("../../lib"),o=t("../drawing"),l=t("../color"),s=t("../../traces/scatter/subtypes"),c=t("../../traces/pie/style_one");e.exports=function(t,e){function r(t){var e=t[0].trace,r=e.visible&&e.fill&&"none"!==e.fill,a=s.hasLines(e);e&&e._module&&"contourcarpet"===e._module.name&&(a=e.contours.showlines,r="fill"===e.contours.coloring);var i=n.select(this).select(".legendfill").selectAll("path").data(r?[t]:[]);i.enter().append("path").classed("js-fill",!0),i.exit().remove(),i.attr("d","M5,0h30v6h-30z").call(o.fillGroupStyle);var l=n.select(this).select(".legendlines").selectAll("path").data(a?[t]:[]);l.enter().append("path").classed("js-line",!0).attr("d","M5,0h30"),l.exit().remove(),l.call(o.lineGroupStyle)}function u(t){function r(t,e,r){var n=i.nestedProperty(f,t).get(),a=Array.isArray(n)&&e?e(n):n;if(r){if(a<r[0])return r[0];if(a>r[1])return r[1]}return a}function a(t){return t[0]}var l,c,u=t[0],f=u.trace,d=s.hasMarkers(f),p=s.hasText(f),h=s.hasLines(f);if(d||p||h){var g={},v={};d&&(g.mc=r("marker.color",a),g.mo=r("marker.opacity",i.mean,[.2,1]),g.ms=r("marker.size",i.mean,[2,16]),g.mlc=r("marker.line.color",a),g.mlw=r("marker.line.width",i.mean,[0,5]),v.marker={sizeref:1,sizemin:1,sizemode:"diameter"}),h&&(v.line={width:r("line.width",a,[0,10])}),p&&(g.tx="Aa",g.tp=r("textposition",a),g.ts=10,g.tc=r("textfont.color",a),g.tf=r("textfont.family",a)),l=[i.minExtend(u,g)],c=i.minExtend(f,v)}var y=n.select(this).select("g.legendpoints"),m=y.selectAll("path.scatterpts").data(d?l:[]);m.enter().append("path").classed("scatterpts",!0).attr("transform","translate(20,0)"),m.exit().remove(),m.call(o.pointStyle,c,e),d&&(l[0].mrc=3);var x=y.selectAll("g.pointtext").data(p?l:[]);x.enter().append("g").classed("pointtext",!0).append("text").attr("transform","translate(20,0)"),x.exit().remove(),x.selectAll("text").call(o.textPointStyle,c,e)}function f(t){var e=t[0].trace,r=e.marker||{},i=r.line||{},o=n.select(this).select("g.legendpoints").selectAll("path.legendbar").data(a.traceIs(e,"bar")?[t]:[]);o.enter().append("path").classed("legendbar",!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),o.exit().remove(),o.each(function(t){var e=n.select(this),a=t[0],o=(a.mlw+1||i.width+1)-1;e.style("stroke-width",o+"px").call(l.fill,a.mc||r.color),o&&e.call(l.stroke,a.mlc||i.color)})}function d(t){var e=t[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendbox").data(a.traceIs(e,"box")&&e.visible?[t]:[]);r.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),r.exit().remove(),r.each(function(){var t=e.line.width,r=n.select(this);r.style("stroke-width",t+"px").call(l.fill,e.fillcolor),t&&r.call(l.stroke,e.line.color)})}function p(t){var e=t[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendpie").data(a.traceIs(e,"pie")&&e.visible?[t]:[]);r.enter().append("path").classed("legendpie",!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),r.exit().remove(),r.size()&&r.call(c,t[0],e)}t.each(function(t){var e=n.select(this),r=e.selectAll("g.layers").data([0]);r.enter().append("g").classed("layers",!0),r.style("opacity",t[0].trace.opacity),r.selectAll("g.legendfill").data([t]).enter().append("g").classed("legendfill",!0),r.selectAll("g.legendlines").data([t]).enter().append("g").classed("legendlines",!0);var a=r.selectAll("g.legendsymbols").data([t]);a.enter().append("g").classed("legendsymbols",!0),a.selectAll("g.legendpoints").data([t]).enter().append("g").classed("legendpoints",!0)}).each(f).each(d).each(p).each(r).each(u)}},{"../../lib":149,"../../registry":225,"../../traces/pie/style_one":258,"../../traces/scatter/subtypes":281,"../color":34,"../drawing":58,d3:7}],94:[function(t,e,r){"use strict";function n(t,e){var r,n,a=e.currentTarget,i=a.getAttribute("data-attr"),o=a.getAttribute("data-val")||!0,l=t._fullLayout,s={},c=p.list(t,null,!0),u="on";if("zoom"===i){var d,h="in"===o?.5:2,g=(1+h)/2,v=(1-h)/2;for(n=0;n<c.length;n++)if(r=c[n],!r.fixedrange)if(d=r._name,"auto"===o)s[d+".autorange"]=!0;else if("reset"===o){if(void 0===r._rangeInitial)s[d+".autorange"]=!0;else{var y=r._rangeInitial.slice();s[d+".range[0]"]=y[0],s[d+".range[1]"]=y[1]}void 0!==r._showSpikeInitial&&(s[d+".showspikes"]=r._showSpikeInitial,"on"!==u||r._showSpikeInitial||(u="off"))}else{var m=[r.r2l(r.range[0]),r.r2l(r.range[1])],x=[g*m[0]+v*m[1],g*m[1]+v*m[0]];s[d+".range[0]"]=r.l2r(x[0]),s[d+".range[1]"]=r.l2r(x[1])}l._cartesianSpikesEnabled=u}else{if("hovermode"!==i||"x"!==o&&"y"!==o){if("hovermode"===i&&"closest"===o){for(n=0;n<c.length;n++)r=c[n],"on"!==u||r.showspikes||(u="off");l._cartesianSpikesEnabled=u}}else o=l._isHoriz?"y":"x",a.setAttribute("data-val",o),"closest"!==o&&(l._cartesianSpikesEnabled="off");s[i]=o}f.relayout(t,s)}function a(t,e){for(var r=e.currentTarget,n=r.getAttribute("data-attr"),a=r.getAttribute("data-val")||!0,i=t._fullLayout,o=d.getSubplotIds(i,"gl3d"),l={},s=n.split("."),c=0;c<o.length;c++)l[o[c]+"."+s[1]]=a;f.relayout(t,l)}function i(t,e){for(var r=e.currentTarget,n=r.getAttribute("data-attr"),a=t._fullLayout,i=d.getSubplotIds(a,"gl3d"),o={},l=0;l<i.length;l++){var s=i[l],c=s+".camera",u=a[s]._scene;"resetDefault"===n?o[c]=null:"resetLastSave"===n&&(o[c]=h.extendDeep({},u.cameraInitial))}f.relayout(t,o)}function o(t,e){var r=e.currentTarget,n=r._previousVal||!1,a=t.layout,i=t._fullLayout,o=d.getSubplotIds(i,"gl3d"),l=["xaxis","yaxis","zaxis"],s=["showspikes","spikesides","spikethickness","spikecolor"],c={},u={},p={};if(n)p=h.extendDeep(a,n),r._previousVal=null;else{p={"allaxes.showspikes":!1};for(var g=0;g<o.length;g++){var v=o[g],y=i[v],m=c[v]={};m.hovermode=y.hovermode,p[v+".hovermode"]=!1;for(var x=0;x<3;x++){var b=l[x];u=m[b]={};for(var _=0;_<s.length;_++){var w=s[_];u[w]=y[b][w]}}}r._previousVal=h.extendDeep({},c)}f.relayout(t,p)}function l(t,e){for(var r=e.currentTarget,n=r.getAttribute("data-attr"),a=r.getAttribute("data-val")||!0,i=t._fullLayout,o=d.getSubplotIds(i,"geo"),l=0;l<o.length;l++){var s=o[l],c=i[s];if("zoom"===n){var p=c.projection.scale,h="in"===a?2*p:.5*p;f.relayout(t,s+".projection.scale",h)}else"reset"===n&&u(t,"geo")}}function s(t){var e,r=t._fullLayout;e=r._has("cartesian")?r._isHoriz?"y":"x":"closest";var n=!t._fullLayout.hovermode&&e;f.relayout(t,"hovermode",n)}function c(t){for(var e,r,n=t._fullLayout,a=p.list(t,null,!0),i={},o=0;o<a.length;o++)e=a[o],r=e._name,i[r+".showspikes"]="on"===n._cartesianSpikesEnabled;return i}function u(t,e){for(var r=t._fullLayout,n=d.getSubplotIds(r,e),a={},i=0;i<n.length;i++)for(var o=n[i],l=r[o]._subplot,s=l.viewInitial,c=Object.keys(s),u=0;u<c.length;u++){var p=c[u];a[o+"."+p]=s[p]}f.relayout(t,a)}var f=t("../../plotly"),d=t("../../plots/plots"),p=t("../../plots/cartesian/axes"),h=t("../../lib"),g=t("../../snapshot/download"),v=t("../../../build/ploticon"),y=e.exports={};y.toImage={name:"toImage",title:"Download plot as a png",icon:v.camera,click:function(t){var e="png";h.notifier("Taking snapshot - this may take a few seconds","long"),h.isIE()&&(h.notifier("IE only supports svg. Changing format to svg.","long"),e="svg"),g(t,{format:e}).then(function(t){h.notifier("Snapshot succeeded - "+t,"long")}).catch(function(){h.notifier("Sorry there was a problem downloading your snapshot!","long")})}},y.sendDataToCloud={name:"sendDataToCloud",title:"Save and edit plot in cloud",icon:v.disk,click:function(t){d.sendDataToCloud(t)}},y.zoom2d={name:"zoom2d",title:"Zoom",attr:"dragmode",val:"zoom",icon:v.zoombox,click:n},y.pan2d={name:"pan2d",title:"Pan",attr:"dragmode",val:"pan",icon:v.pan,click:n},y.select2d={name:"select2d",title:"Box Select",attr:"dragmode",val:"select",icon:v.selectbox,click:n},y.lasso2d={name:"lasso2d",title:"Lasso Select",attr:"dragmode",val:"lasso",icon:v.lasso,click:n},y.zoomIn2d={name:"zoomIn2d",title:"Zoom in",attr:"zoom",val:"in",icon:v.zoom_plus,click:n},y.zoomOut2d={name:"zoomOut2d",title:"Zoom out",attr:"zoom",val:"out",icon:v.zoom_minus,click:n},y.autoScale2d={name:"autoScale2d",title:"Autoscale",attr:"zoom",val:"auto",icon:v.autoscale,click:n},y.resetScale2d={name:"resetScale2d",title:"Reset axes",attr:"zoom",val:"reset",icon:v.home,click:n},y.hoverClosestCartesian={name:"hoverClosestCartesian",title:"Show closest data on hover",attr:"hovermode",val:"closest",icon:v.tooltip_basic,gravity:"ne",click:n},y.hoverCompareCartesian={name:"hoverCompareCartesian",title:"Compare data on hover",attr:"hovermode",val:function(t){return t._fullLayout._isHoriz?"y":"x"},icon:v.tooltip_compare,gravity:"ne",click:n},y.zoom3d={name:"zoom3d",title:"Zoom",attr:"scene.dragmode",val:"zoom",icon:v.zoombox,click:a},y.pan3d={name:"pan3d",title:"Pan",attr:"scene.dragmode",val:"pan",icon:v.pan,click:a},y.orbitRotation={name:"orbitRotation",title:"orbital rotation",attr:"scene.dragmode",val:"orbit",icon:v["3d_rotate"],click:a},y.tableRotation={name:"tableRotation",title:"turntable rotation",attr:"scene.dragmode",val:"turntable",icon:v["z-axis"],click:a},y.resetCameraDefault3d={name:"resetCameraDefault3d",title:"Reset camera to default",attr:"resetDefault",icon:v.home,click:i},y.resetCameraLastSave3d={name:"resetCameraLastSave3d",title:"Reset camera to last save",attr:"resetLastSave",icon:v.movie,click:i},y.hoverClosest3d={name:"hoverClosest3d",title:"Toggle show closest data on hover",attr:"hovermode",val:null,toggle:!0,icon:v.tooltip_basic,gravity:"ne",click:o},y.zoomInGeo={name:"zoomInGeo",title:"Zoom in",attr:"zoom",val:"in",icon:v.zoom_plus,click:l},y.zoomOutGeo={name:"zoomOutGeo",title:"Zoom out",attr:"zoom",val:"out",icon:v.zoom_minus,click:l},y.resetGeo={name:"resetGeo",title:"Reset",attr:"reset",val:null,icon:v.autoscale,click:l},y.hoverClosestGeo={name:"hoverClosestGeo",title:"Toggle show closest data on hover",attr:"hovermode",val:null,toggle:!0,icon:v.tooltip_basic,gravity:"ne",click:s},y.hoverClosestGl2d={name:"hoverClosestGl2d",title:"Toggle show closest data on hover",attr:"hovermode",val:null,toggle:!0,icon:v.tooltip_basic,gravity:"ne",click:s},y.hoverClosestPie={name:"hoverClosestPie",title:"Toggle show closest data on hover",attr:"hovermode",val:"closest",icon:v.tooltip_basic,gravity:"ne",click:s},y.toggleHover={name:"toggleHover",title:"Toggle show closest data on hover",attr:"hovermode",val:null,toggle:!0,icon:v.tooltip_basic,gravity:"ne",click:function(t,e){s(t),o(t,e)}},y.resetViews={name:"resetViews",title:"Reset views",icon:v.home,click:function(t,e){var r=e.currentTarget;r.setAttribute("data-attr","zoom"),r.setAttribute("data-val","reset"),n(t,e),r.setAttribute("data-attr","resetLastSave"),i(t,e),u(t,"geo"),u(t,"mapbox")}},y.toggleSpikelines={name:"toggleSpikelines",title:"Toggle Spike Lines",icon:v.spikeline,attr:"_cartesianSpikesEnabled",val:"on",click:function(t){var e=t._fullLayout;e._cartesianSpikesEnabled="closest"===e.hovermode&&"on"===e._cartesianSpikesEnabled?"off":"on";var r=c(t);r.hovermode="closest",f.relayout(t,r)}},y.resetViewMapbox={name:"resetViewMapbox",title:"Reset view",attr:"reset",icon:v.home,click:function(t){u(t,"mapbox")}}},{"../../../build/ploticon":2,"../../lib":149,"../../plotly":184,"../../plots/cartesian/axes":189,"../../plots/plots":218,"../../snapshot/download":227}],95:[function(t,e,r){"use strict";r.manage=t("./manage")},{"./manage":96}],96:[function(t,e,r){"use strict";function n(t,e,r){function n(t){for(var r=[],n=0;n<t.length;n++){var a=t[n];-1===e.indexOf(a)&&r.push(d[a])}y.push(r)}var l=t._fullLayout,s=t._fullData,c=l._has("cartesian"),u=l._has("gl3d"),f=l._has("geo"),p=l._has("pie"),h=l._has("gl2d"),g=l._has("ternary"),v=l._has("mapbox"),y=[];if(n(["toImage","sendDataToCloud"]),(c||h||p||g)+f+u>1)return n(["resetViews","toggleHover"]),o(y,r);u&&(n(["zoom3d","pan3d","orbitRotation","tableRotation"]),n(["resetCameraDefault3d","resetCameraLastSave3d"]),n(["hoverClosest3d"]));var m=a(l),x=[];return((c||h)&&!m||g)&&(x=["zoom2d","pan2d"]),(v||f)&&(x=["pan2d"]),i(s)&&(x.push("select2d"),x.push("lasso2d")),x.length&&n(x),!c&&!h||m||g||n(["zoomIn2d","zoomOut2d","autoScale2d","resetScale2d"]),c&&p?n(["toggleHover"]):h?n(["hoverClosestGl2d"]):c?n(["toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"]):p?n(["hoverClosestPie"]):v?n(["resetViewMapbox","toggleHover"]):f&&(n(["zoomInGeo","zoomOutGeo","resetGeo"]),n(["hoverClosestGeo"])),o(y,r)}function a(t){for(var e=s.list({_fullLayout:t},null,!0),r=!0,n=0;n<e.length;n++)if(!e[n].fixedrange){r=!1;break}return r}function i(t){for(var e=!1,r=0;r<t.length&&!e;r++){var n=t[r];n._module&&n._module.selectPoints&&(u.traceIs(n,"scatter-like")?(c.hasMarkers(n)||c.hasText(n))&&(e=!0):e=!0)}return e}function o(t,e){if(e.length)if(Array.isArray(e[0]))for(var r=0;r<e.length;r++)t.push(e[r]);else t.push(e);return t}function l(t){for(var e=0;e<t.length;e++)for(var r=t[e],n=0;n<r.length;n++){var a=r[n];if("string"==typeof a){if(void 0===d[a])throw new Error(["*modeBarButtons* configuration options","invalid button name"].join(" "));t[e][n]=d[a]}}return t}var s=t("../../plots/cartesian/axes"),c=t("../../traces/scatter/subtypes"),u=t("../../registry"),f=t("./modebar"),d=t("./buttons");e.exports=function(t){var e=t._fullLayout,r=t._context,a=e._modeBar;if(!r.displayModeBar)return void(a&&(a.destroy(),delete e._modeBar));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 i,o=r.modeBarButtons;i=Array.isArray(o)&&o.length?l(o):n(t,r.modeBarButtonsToRemove,r.modeBarButtonsToAdd),a?a.update(t,i):e._modeBar=f(t,i)}},{"../../plots/cartesian/axes":189,"../../registry":225,"../../traces/scatter/subtypes":281,"./buttons":94,"./modebar":97}],97:[function(t,e,r){"use strict";function n(t){this.container=t.container,this.element=document.createElement("div"),this.update(t.graphInfo,t.buttons),this.container.appendChild(this.element)}function a(t,e){var r=t._fullLayout,a=new n({graphInfo:t,container:r._paperdiv.node(),buttons:e});return r._privateplot&&i.select(a.element).append("span").classed("badge-private float--left",!0).text("PRIVATE"),a}var i=t("d3"),o=t("../../lib"),l=t("../../../build/ploticon"),s=n.prototype;s.update=function(t,e){this.graphInfo=t;var r=this.graphInfo._context;"hover"===r.displayModeBar?this.element.className="modebar modebar--hover":this.element.className="modebar";var n=!this.hasButtons(e),a=this.hasLogo!==r.displaylogo;(n||a)&&(this.removeAllButtons(),this.updateButtons(e),r.displaylogo&&(this.element.appendChild(this.getLogo()),this.hasLogo=!0)),this.updateActiveButton()}, s.updateButtons=function(t){var e=this;this.buttons=t,this.buttonElements=[],this.buttonsNames=[],this.buttons.forEach(function(t){var r=e.createGroup();t.forEach(function(t){var n=t.name;if(!n)throw new Error("must provide button 'name' in button config");if(-1!==e.buttonsNames.indexOf(n))throw new Error("button name '"+n+"' is taken");e.buttonsNames.push(n);var a=e.createButton(t);e.buttonElements.push(a),r.appendChild(a)}),e.element.appendChild(r)})},s.createGroup=function(){var t=document.createElement("div");return t.className="modebar-group",t},s.createButton=function(t){var e=this,r=document.createElement("a");r.setAttribute("rel","tooltip"),r.className="modebar-btn";var n=t.title;void 0===n&&(n=t.name),(n||0===n)&&r.setAttribute("data-title",n),void 0!==t.attr&&r.setAttribute("data-attr",t.attr);var a=t.val;if(void 0!==a&&("function"==typeof a&&(a=a(this.graphInfo)),r.setAttribute("data-val",a)),"function"!=typeof t.click)throw new Error("must provide button 'click' function in button config");return r.addEventListener("click",function(r){t.click(e.graphInfo,r),e.updateActiveButton(r.currentTarget)}),r.setAttribute("data-toggle",t.toggle||!1),t.toggle&&i.select(r).classed("active",!0),r.appendChild(this.createIcon(t.icon||l.question,t.name)),r.setAttribute("data-gravity",t.gravity||"n"),r},s.createIcon=function(t,e){var r=t.ascent-t.descent,n="http://www.w3.org/2000/svg",a=document.createElementNS(n,"svg"),i=document.createElementNS(n,"path");a.setAttribute("height","1em"),a.setAttribute("width",t.width/r+"em"),a.setAttribute("viewBox",[0,0,t.width,r].join(" "));var o="toggleSpikelines"===e?"matrix(1.5 0 0 -1.5 0 "+t.ascent+")":"matrix(1 0 0 -1 0 "+t.ascent+")";return i.setAttribute("d",t.path),i.setAttribute("transform",o),a.appendChild(i),a},s.updateActiveButton=function(t){var e=this.graphInfo._fullLayout,r=void 0!==t?t.getAttribute("data-attr"):null;this.buttonElements.forEach(function(t){var n=t.getAttribute("data-val")||!0,a=t.getAttribute("data-attr"),l="true"===t.getAttribute("data-toggle"),s=i.select(t);if(l)a===r&&s.classed("active",!s.classed("active"));else{var c=null===a?a:o.nestedProperty(e,a).get();s.classed("active",c===n)}})},s.hasButtons=function(t){var e=this.buttons;if(!e)return!1;if(t.length!==e.length)return!1;for(var r=0;r<t.length;++r){if(t[r].length!==e[r].length)return!1;for(var n=0;n<t[r].length;n++)if(t[r][n].name!==e[r][n].name)return!1}return!0},s.getLogo=function(){var t=this.createGroup(),e=document.createElement("a");return e.href="https://plot.ly/",e.target="_blank",e.setAttribute("data-title","Produced with Plotly"),e.className="modebar-btn plotlyjsicon modebar-btn--logo",e.appendChild(this.createIcon(l.plotlylogo)),t.appendChild(e),t},s.removeAllButtons=function(){for(;this.element.firstChild;)this.element.removeChild(this.element.firstChild);this.hasLogo=!1},s.destroy=function(){o.removeElement(this.container.querySelector(".modebar"))},e.exports=a},{"../../../build/ploticon":2,"../../lib":149,d3:7}],98:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),a=t("../color/attributes"),i=t("../../lib/extend").extendFlat,o=t("./button_attributes");o=i(o,{_isLinkedToArray:"button"}),e.exports={visible:{valType:"boolean",editType:"plot"},buttons:o,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"}},{"../../lib/extend":143,"../../plots/font_attributes":213,"../color/attributes":33,"./button_attributes":99}],99:[function(t,e,r){"use strict";e.exports={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"}},{}],100:[function(t,e,r){"use strict";e.exports={yPad:.02,minButtonWidth:30,rx:3,ry:3,lightAmount:25,darkAmount:10}},{}],101:[function(t,e,r){"use strict";function n(t,e,r){function n(t,e){return i.coerce(a,o,s,t,e)}for(var a,o,l=t.buttons||[],c=e.buttons=[],u=0;u<l.length;u++)if(a=l[u],o={},i.isPlainObject(a)){var f=n("step");"all"!==f&&(!r||"gregorian"===r||"month"!==f&&"year"!==f?n("stepmode"):o.stepmode="backward",n("count")),n("label"),o._index=u,c.push(o)}return c}function a(t,e,r){for(var n=r.filter(function(r){return e[r].anchor===t._id}),a=0,i=0;i<n.length;i++){var o=e[n[i]].domain;o&&(a=Math.max(o[1],a))}return[t.domain[0],a+c.yPad]}var i=t("../../lib"),o=t("../color"),l=t("./attributes"),s=t("./button_attributes"),c=t("./constants");e.exports=function(t,e,r,s,u){function f(t,e){return i.coerce(d,p,l,t,e)}var d=t.rangeselector||{},p=e.rangeselector={};if(f("visible",n(d,p,u).length>0)){var h=a(e,r,s);f("x",h[0]),f("y",h[1]),i.noneOrAll(t,e,["x","y"]),f("xanchor"),f("yanchor"),i.coerceFont(f,"font",r.font);var g=f("bgcolor");f("activecolor",o.contrast(g,c.lightAmount,c.darkAmount)),f("bordercolor"),f("borderwidth")}}},{"../../lib":149,"../color":34,"./attributes":98,"./button_attributes":99,"./constants":100}],102:[function(t,e,r){"use strict";function n(t){for(var e=y.list(t,"x",!0),r=[],n=0;n<e.length;n++){var a=e[n];a.rangeselector&&a.rangeselector.visible&&r.push(a)}return r}function a(t){return t._id}function i(t,e,r){if("all"===e.step)return!0===t.autorange;var n=Object.keys(r);return t.range[0]===r[n[0]]&&t.range[1]===r[n[1]]}function o(t,e,r){var n=t.selectAll("rect").data([0]);n.enter().append("rect").classed("selector-rect",!0),n.attr("shape-rendering","crispEdges"),n.attr({rx:b.rx,ry:b.ry}),n.call(h.stroke,e.bordercolor).call(h.fill,l(e,r)).style("stroke-width",e.borderwidth+"px")}function l(t,e){return e.isActive||e.isHovered?t.activecolor:t.bgcolor}function s(t,e,r,n){function a(t){v.convertToTspans(t,n)}var i=t.selectAll("text").data([0]);i.enter().append("text").classed("selector-text",!0).classed("user-select-none",!0),i.attr("text-anchor","middle"),i.call(g.font,e.font).text(c(r)).call(a)}function c(t){return t.label?t.label:"all"===t.step?"all":t.count+t.step.charAt(0)}function u(t,e,r,n){r.width=0,r.height=0;var a=r.borderwidth;e.each(function(){var t=f.select(this),e=t.select(".selector-text"),n=r.font.size*x,a=Math.max(n*v.lineCount(e),16)+3;r.height=Math.max(r.height,a)}),e.each(function(){var t=f.select(this),e=t.select(".selector-rect"),n=t.select(".selector-text"),i=n.node()&&g.bBox(n.node()).width,o=r.font.size*x,l=v.lineCount(n),s=Math.max(i+10,b.minButtonWidth);t.attr("transform","translate("+(a+r.width)+","+a+")"),e.attr({x:0,y:0,width:s,height:r.height}),v.positionText(n,s/2,r.height/2-(l-1)*o/2+3),r.width+=s+5}),e.selectAll("rect").attr("height",r.height);var i=t._fullLayout._size;r.lx=i.l+i.w*r.x,r.ly=i.t+i.h*(1-r.y);var o="left";m.isRightAnchor(r)&&(r.lx-=r.width,o="right"),m.isCenterAnchor(r)&&(r.lx-=r.width/2,o="center");var l="top";m.isBottomAnchor(r)&&(r.ly-=r.height,l="bottom"),m.isMiddleAnchor(r)&&(r.ly-=r.height/2,l="middle"),r.width=Math.ceil(r.width),r.height=Math.ceil(r.height),r.lx=Math.round(r.lx),r.ly=Math.round(r.ly),p.autoMargin(t,n+"-range-selector",{x:r.x,y:r.y,l:r.width*({right:1,center:.5}[o]||0),r:r.width*({left:1,center:.5}[o]||0),b:r.height*({top:1,middle:.5}[l]||0),t:r.height*({bottom:1,middle:.5}[l]||0)})}var f=t("d3"),d=t("../../plotly"),p=t("../../plots/plots"),h=t("../color"),g=t("../drawing"),v=t("../../lib/svg_text_utils"),y=t("../../plots/cartesian/axis_ids"),m=t("../legend/anchor_utils"),x=t("../../constants/alignment").LINE_SPACING,b=t("./constants"),_=t("./get_update_object");e.exports=function(t){var e=t._fullLayout,r=e._infolayer.selectAll(".rangeselector").data(n(t),a);r.enter().append("g").classed("rangeselector",!0),r.exit().remove(),r.style({cursor:"pointer","pointer-events":"all"}),r.each(function(e){var r=f.select(this),n=e,a=n.rangeselector,l=r.selectAll("g.button").data(a.buttons);l.enter().append("g").classed("button",!0),l.exit().remove(),l.each(function(e){var r=f.select(this),l=_(n,e);e.isActive=i(n,e,l),r.call(o,a,e),r.call(s,a,e,t),r.on("click",function(){t._dragged||d.relayout(t,l)}),r.on("mouseover",function(){e.isHovered=!0,r.call(o,a,e)}),r.on("mouseout",function(){e.isHovered=!1,r.call(o,a,e)})}),u(t,l,a,n._name),r.attr("transform","translate("+a.lx+","+a.ly+")")})}},{"../../constants/alignment":131,"../../lib/svg_text_utils":169,"../../plotly":184,"../../plots/cartesian/axis_ids":192,"../../plots/plots":218,"../color":34,"../drawing":58,"../legend/anchor_utils":84,"./constants":100,"./get_update_object":103,d3:7}],103:[function(t,e,r){"use strict";function n(t,e){var r,n=t.range,i=new Date(t.r2l(n[1])),o=e.step,l=e.count;switch(e.stepmode){case"backward":r=t.l2r(+a.time[o].utc.offset(i,-l));break;case"todate":var s=a.time[o].utc.offset(i,-l);r=t.l2r(+a.time[o].utc.ceil(s))}return[r,n[1]]}var a=t("d3");e.exports=function(t,e){var r=t._name,a={};if("all"===e.step)a[r+".autorange"]=!0;else{var i=n(t,e);a[r+".range[0]"]=i[0],a[r+".range[1]"]=i[1]}return a}},{d3:7}],104:[function(t,e,r){"use strict";e.exports={moduleType:"component",name:"rangeselector",schema:{subplots:{xaxis:{rangeselector:t("./attributes")}}},layoutAttributes:t("./attributes"),handleDefaults:t("./defaults"),draw:t("./draw")}},{"./attributes":98,"./defaults":101,"./draw":102}],105:[function(t,e,r){"use strict";var n=t("../color/attributes");e.exports={bgcolor:{valType:"color",dflt:n.background,editType:"calc"},bordercolor:{valType:"color",dflt:n.defaultLine,editType:"calc"},borderwidth:{valType:"integer",dflt:0,min:0,editType:"calc"},autorange:{valType:"boolean",dflt:!0,editType:"calc"},range:{valType:"info_array",items:[{valType:"any",editType:"calc"},{valType:"any",editType:"calc"}],editType:"calc"},thickness:{valType:"number",dflt:.15,min:0,max:1,editType:"calc"},visible:{valType:"boolean",dflt:!0,editType:"calc"},editType:"calc"}},{"../color/attributes":33}],106:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axes"),a=t("./constants");e.exports=function(t){for(var e=n.list(t,"x",!0),r=0;r<e.length;r++){var i=e[r],o=i[a.name];o&&o.visible&&o.autorange&&i._min.length&&i._max.length&&(o._input.autorange=!0,o._input.range=o.range=n.getAutoRange(i))}}},{"../../plots/cartesian/axes":189,"./constants":107}],107:[function(t,e,r){"use strict";e.exports={name:"rangeslider",containerClassName:"rangeslider-container",bgClassName:"rangeslider-bg",rangePlotClassName:"rangeslider-rangeplot",maskMinClassName:"rangeslider-mask-min",maskMaxClassName:"rangeslider-mask-max",slideBoxClassName:"rangeslider-slidebox",grabberMinClassName:"rangeslider-grabber-min",grabAreaMinClassName:"rangeslider-grabarea-min",handleMinClassName:"rangeslider-handle-min",grabberMaxClassName:"rangeslider-grabber-max",grabAreaMaxClassName:"rangeslider-grabarea-max",handleMaxClassName:"rangeslider-handle-max",maskColor:"rgba(0,0,0,0.4)",slideBoxFill:"transparent",slideBoxCursor:"ew-resize",grabAreaFill:"transparent",grabAreaCursor:"col-resize",grabAreaWidth:10,handleWidth:4,handleRadius:1,handleStrokeWidth:1,extraPad:15}},{}],108:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./attributes");e.exports=function(t,e,r){function i(t,e){return n.coerce(o,s,a,t,e)}if(t[r].rangeslider){n.isPlainObject(t[r].rangeslider)||(t[r].rangeslider={});var o=t[r].rangeslider,l=e[r],s=l.rangeslider={};if(i("visible")){if(i("bgcolor",e.plot_bgcolor),i("bordercolor"),i("borderwidth"),i("thickness"),i("autorange",!l.isValidRange(o.range)),i("range"),s.range){var c=s.range,u=l.range;c[0]=l.l2r(Math.min(l.r2l(c[0]),l.r2l(u[0]))),c[1]=l.l2r(Math.max(l.r2l(c[1]),l.r2l(u[1])))}l.cleanRange("rangeslider.range"),s._input=o}}}},{"../../lib":149,"./attributes":105}],109:[function(t,e,r){"use strict";function n(t){var e=w.list({_fullLayout:t},"x",!0),r=A.name,n=[];if(t._has("gl2d"))return n;for(var a=0;a<e.length;a++){var i=e[a];i[r]&&i[r].visible&&n.push(i)}return n}function a(t,e,r,n){var a=t.select("rect."+A.slideBoxClassName).node(),o=t.select("rect."+A.grabAreaMinClassName).node(),l=t.select("rect."+A.grabAreaMaxClassName).node();t.on("mousedown",function(){function s(s){var c,u,m,x=+s.clientX-d;switch(f){case a:m="ew-resize",c=h+x,u=v+x;break;case o:m="col-resize",c=h+x,u=v;break;case l:m="col-resize",c=h,u=v+x;break;default:m="ew-resize",c=p,u=p+x}if(u<c){var b=u;u=c,c=b}n._pixelMin=c,n._pixelMax=u,M(g.select(y),m),i(t,e,r,n)}function c(){y.removeEventListener("mousemove",s),y.removeEventListener("mouseup",c),m.removeElement(y)}var u=g.event,f=u.target,d=u.clientX,p=d-t.node().getBoundingClientRect().left,h=n.d2p(r._rl[0]),v=n.d2p(r._rl[1]),y=k.coverSlip();y.addEventListener("mousemove",s),y.addEventListener("mouseup",c)})}function i(t,e,r,n){function a(t){return r.l2r(m.constrain(t,n._rl[0],n._rl[1]))}var i=a(n.p2d(n._pixelMin)),o=a(n.p2d(n._pixelMax));window.requestAnimationFrame(function(){v.relayout(e,r._name+".range",[i,o])})}function o(t,e,r,n){function a(t){return m.constrain(t,0,n._width)}function i(t){return m.constrain(t,-o,n._width+o)}var o=A.handleWidth/2,l=a(n.d2p(r._rl[0])),s=a(n.d2p(r._rl[1]));t.select("rect."+A.slideBoxClassName).attr("x",l).attr("width",s-l),t.select("rect."+A.maskMinClassName).attr("width",l),t.select("rect."+A.maskMaxClassName).attr("x",s).attr("width",n._width-s);var c=Math.round(i(l-o))-.5,u=Math.round(i(s-o))+.5;t.select("g."+A.grabberMinClassName).attr("transform","translate("+c+",0.5)"),t.select("g."+A.grabberMaxClassName).attr("transform","translate("+u+",0.5)")}function l(t,e,r,n){var a=t.selectAll("rect."+A.bgClassName).data([0]);a.enter().append("rect").classed(A.bgClassName,!0).attr({x:0,y:0,"shape-rendering":"crispEdges"});var i=n.borderwidth%2==0?n.borderwidth:n.borderwidth-1,o=-n._offsetShift,l=x.crispRound(e,n.borderwidth);a.attr({width:n._width+i,height:n._height+i,transform:"translate("+o+","+o+")",fill:n.bgcolor,stroke:n.bordercolor,"stroke-width":l})}function s(t,e,r,n){var a=e._fullLayout,i=a._topdefs.selectAll("#"+n._clipId).data([0]);i.enter().append("clipPath").attr("id",n._clipId).append("rect").attr({x:0,y:0}),i.select("rect").attr({width:n._width,height:n._height})}function c(t,e,r,n){var a=w.getSubplots(e,r),i=e.calcdata,o=t.selectAll("g."+A.rangePlotClassName).data(a,m.identity);o.enter().append("g").attr("class",function(t){return A.rangePlotClassName+" "+t}).call(x.setClipUrl,n._clipId),o.order(),o.exit().remove();var l;o.each(function(t,a){var o=g.select(this),s=0===a,c=w.getFromId(e,t,"y"),f=c._name,d={data:[],layout:{xaxis:{type:r.type,domain:[0,1],range:n.range.slice(),calendar:r.calendar},width:n._width,height:n._height,margin:{t:0,b:0,l:0,r:0}}};d.layout[f]={type:c.type,domain:[0,1],range:c.range.slice(),calendar:c.calendar},y.supplyDefaults(d);var p=d._fullLayout.xaxis,h=d._fullLayout[f],v={id:t,plotgroup:o,xaxis:p,yaxis:h};s?l=v:(v.mainplot="xy",v.mainplotinfo=l),_.rangePlot(e,v,u(i,t))})}function u(t,e){for(var r=[],n=0;n<t.length;n++){var a=t[n],i=a[0].trace;i.xaxis+i.yaxis===e&&r.push(a)}return r}function f(t,e,r,n){var a=t.selectAll("rect."+A.maskMinClassName).data([0]);a.enter().append("rect").classed(A.maskMinClassName,!0).attr({x:0,y:0}).attr("shape-rendering","crispEdges"),a.attr("height",n._height).call(b.fill,A.maskColor);var i=t.selectAll("rect."+A.maskMaxClassName).data([0]);i.enter().append("rect").classed(A.maskMaxClassName,!0).attr("y",0).attr("shape-rendering","crispEdges"),i.attr("height",n._height).call(b.fill,A.maskColor)}function d(t,e,r,n){if(!e._context.staticPlot){var a=t.selectAll("rect."+A.slideBoxClassName).data([0]);a.enter().append("rect").classed(A.slideBoxClassName,!0).attr("y",0).attr("cursor",A.slideBoxCursor).attr("shape-rendering","crispEdges"),a.attr({height:n._height,fill:A.slideBoxFill})}}function p(t,e,r,n){var a=t.selectAll("g."+A.grabberMinClassName).data([0]);a.enter().append("g").classed(A.grabberMinClassName,!0);var i=t.selectAll("g."+A.grabberMaxClassName).data([0]);i.enter().append("g").classed(A.grabberMaxClassName,!0);var o={x:0,width:A.handleWidth,rx:A.handleRadius,fill:b.background,stroke:b.defaultLine,"stroke-width":A.handleStrokeWidth,"shape-rendering":"crispEdges"},l={y:Math.round(n._height/4),height:Math.round(n._height/2)},s=a.selectAll("rect."+A.handleMinClassName).data([0]);s.enter().append("rect").classed(A.handleMinClassName,!0).attr(o),s.attr(l);var c=i.selectAll("rect."+A.handleMaxClassName).data([0]);if(c.enter().append("rect").classed(A.handleMaxClassName,!0).attr(o),c.attr(l),!e._context.staticPlot){var u={width:A.grabAreaWidth,x:0,y:0,fill:A.grabAreaFill,cursor:A.grabAreaCursor},f=a.selectAll("rect."+A.grabAreaMinClassName).data([0]);f.enter().append("rect").classed(A.grabAreaMinClassName,!0).attr(u),f.attr("height",n._height);var d=i.selectAll("rect."+A.grabAreaMaxClassName).data([0]);d.enter().append("rect").classed(A.grabAreaMaxClassName,!0).attr(u),d.attr("height",n._height)}}function h(t){for(var e=t._fullLayout._pushmargin||{},r=Object.keys(e),n=0;n<r.length;n++){var a=r[n];-1!==a.indexOf(A.name)&&y.autoMargin(t,a)}}var g=t("d3"),v=t("../../plotly"),y=t("../../plots/plots"),m=t("../../lib"),x=t("../drawing"),b=t("../color"),_=t("../../plots/cartesian"),w=t("../../plots/cartesian/axes"),k=t("../dragelement"),M=t("../../lib/setcursor"),A=t("./constants");e.exports=function(t){function e(t){return t._name}var r=t._fullLayout,i=n(r),u=r._infolayer.selectAll("g."+A.containerClassName).data(i,e);u.enter().append("g").classed(A.containerClassName,!0).attr("pointer-events","all"),u.exit().each(function(t){var e=g.select(this),n=t[A.name];e.remove(),r._topdefs.select("#"+n._clipId).remove()}),u.exit().size()&&h(t),0!==i.length&&u.each(function(e){var n=g.select(this),i=e[A.name],u=r[w.id2name(e.anchor)],h=r.margin,v=r._size,m=e.domain,x=u.domain,b=(e._boundingBox||{}).height||0;i._id=A.name+e._id,i._clipId=i._id+"-"+r._uid,i._width=v.w*(m[1]-m[0]),i._height=(r.height-h.b-h.t)*i.thickness,i._offsetShift=Math.floor(i.borderwidth/2);var _=Math.round(h.l+v.w*m[0]),k=Math.round(h.t+v.h*(1-x[0])+b+i._offsetShift+A.extraPad);n.attr("transform","translate("+_+","+k+")");var M=e.r2l(i.range[0]),T=e.r2l(i.range[1]),L=T-M;i.p2d=function(t){return t/i._width*L+M},i.d2p=function(t){return(t-M)/L*i._width},i._rl=[M,T],n.call(l,t,e,i).call(s,t,e,i).call(c,t,e,i).call(f,t,e,i).call(d,t,e,i).call(p,t,e,i),a(n,t,e,i),o(n,t,e,i),y.autoMargin(t,i._id,{x:m[0],y:x[0],l:0,r:0,t:0,b:i._height+h.b+b,pad:A.extraPad+2*i._offsetShift})})}},{"../../lib":149,"../../lib/setcursor":167,"../../plotly":184,"../../plots/cartesian":199,"../../plots/cartesian/axes":189,"../../plots/plots":218,"../color":34,"../dragelement":55,"../drawing":58,"./constants":107,d3:7}],110:[function(t,e,r){"use strict";e.exports={moduleType:"component",name:"rangeslider",schema:{subplots:{xaxis:{rangeslider:t("./attributes")}}},layoutAttributes:t("./attributes"),handleDefaults:t("./defaults"),calcAutorange:t("./calc_autorange"),draw:t("./draw")}},{"./attributes":105,"./calc_autorange":106,"./defaults":108,"./draw":109}],111:[function(t,e,r){"use strict";var n=t("../annotations/attributes"),a=t("../../traces/scatter/attributes").line,i=t("../drawing/attributes").dash,o=t("../../lib/extend").extendFlat;e.exports={_isLinkedToArray:"shape",visible:{valType:"boolean",dflt:!0,editType:"calcIfAutorange"},type:{valType:"enumerated",values:["circle","rect","path","line"],editType:"calcIfAutorange"},layer:{valType:"enumerated",values:["below","above"],dflt:"above",editType:"arraydraw"},xref:o({},n.xref,{}),x0:{valType:"any",editType:"calcIfAutorange"},x1:{valType:"any",editType:"calcIfAutorange"},yref:o({},n.yref,{}),y0:{valType:"any",editType:"calcIfAutorange"},y1:{valType:"any",editType:"calcIfAutorange"},path:{valType:"string",editType:"calcIfAutorange"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},line:{color:o({},a.color,{editType:"arraydraw"}),width:o({},a.width,{editType:"calcIfAutorange"}),dash:o({},i,{editType:"arraydraw"}),editType:"calcIfAutorange"},fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},editType:"arraydraw"}},{"../../lib/extend":143,"../../traces/scatter/attributes":260,"../annotations/attributes":19,"../drawing/attributes":57}],112:[function(t,e,r){"use strict";function n(t,e,r,n,a){var i="category"===t.type?t.r2c:t.d2c;if(void 0!==e)return[i(e),i(r)];if(n){var s,c,u,f,d,p=1/0,h=-1/0,g=n.match(o.segmentRE);for("date"===t.type&&(i=l.decodeDate(i)),s=0;s<g.length;s++)c=g[s],void 0!==(u=a[c.charAt(0)].drawn)&&(!(f=g[s].substr(1).match(o.paramRE))||f.length<u||(d=i(f[u]),d<p&&(p=d),d>h&&(h=d)));return h>=p?[p,h]:void 0}}var a=t("../../lib"),i=t("../../plots/cartesian/axes"),o=t("./constants"),l=t("./helpers");e.exports=function(t){var e=t._fullLayout,r=a.filterVisible(e.shapes);if(r.length&&t._fullData.length)for(var l=0;l<r.length;l++){var s,c,u=r[l],f=u.line.width/2;"paper"!==u.xref&&(s=i.getFromId(t,u.xref),(c=n(s,u.x0,u.x1,u.path,o.paramIsX))&&i.expand(s,c,{ppad:f})),"paper"!==u.yref&&(s=i.getFromId(t,u.yref),(c=n(s,u.y0,u.y1,u.path,o.paramIsY))&&i.expand(s,c,{ppad:f}))}}},{"../../lib":149,"../../plots/cartesian/axes":189,"./constants":113,"./helpers":116}],113:[function(t,e,r){"use strict";e.exports={segmentRE:/[MLHVQCTSZ][^MLHVQCTSZ]*/g,paramRE:/[^\s,]+/g,paramIsX:{M:{0:!0,drawn:0},L:{0:!0,drawn:0},H:{0:!0,drawn:0},V:{},Q:{0:!0,2:!0,drawn:2},C:{0:!0,2:!0,4:!0,drawn:4},T:{0:!0,drawn:0},S:{0:!0,2:!0,drawn:2},Z:{}},paramIsY:{M:{1:!0,drawn:1},L:{1:!0,drawn:1},H:{},V:{0:!0,drawn:0},Q:{1:!0,3:!0,drawn:3},C:{1:!0,3:!0,5:!0,drawn:5},T:{1:!0,drawn:1},S:{1:!0,3:!0,drawn:5},Z:{}},numParams:{M:2,L:2,H:1,V:1,Q:4,C:6,T:2,S:4,Z:0}}},{}],114:[function(t,e,r){"use strict";var n=t("../../plots/array_container_defaults"),a=t("./shape_defaults");e.exports=function(t,e){n(t,e,{name:"shapes",handleItemDefaults:a})}},{"../../plots/array_container_defaults":186,"./shape_defaults":118}],115:[function(t,e,r){"use strict";function n(t){var e=t._fullLayout;e._shapeUpperLayer.selectAll("path").remove(),e._shapeLowerLayer.selectAll("path").remove(),e._shapeSubplotLayers.selectAll("path").remove();for(var r=0;r<e.shapes.length;r++)e.shapes[r].visible&&a(t,r)}function a(t,e){function r(r){var n={"data-index":e,"fill-rule":"evenodd",d:o(t,a)},l=a.line.width?a.line.color:"rgba(0,0,0,0)",s=r.append("path").attr(n).style("opacity",a.opacity).call(d.stroke,l).call(d.fill,a.fillcolor).call(p.dashLine,a.line.dash,a.line.width),c=(a.xref+a.yref).replace(/paper/g,"");s.call(p.setClipUrl,c?"clip"+t._fullLayout._uid+c:null),t._context.edits.shapePosition&&i(t,s,a,e)}t._fullLayout._paper.selectAll('.shapelayer [data-index="'+e+'"]').remove();var n=(t.layout.shapes||[])[e],a=t._fullLayout.shapes[e];if(n&&!1!==a.visible)if("below"!==a.layer)r(t._fullLayout._shapeUpperLayer);else if("paper"===a.xref||"paper"===a.yref)r(t._fullLayout._shapeLowerLayer);else{var l=t._fullLayout._plots[a.xref+a.yref];if(l){var s=l.mainplotinfo||l;r(s.shapelayer)}else r(t._fullLayout._shapeLowerLayer)}}function i(t,e,r,n){function a(t){var r=W.right-W.left,n=W.bottom-W.top,a=t.clientX-W.left,i=t.clientY-W.top,o=r>X&&n>Y&&!t.shiftKey?h.getCursor(a/r,1-i/n):"move";g(e,o),G=o.split("-")[0]}function i(e){j=f.getFromId(t,r.xref),B=f.getFromId(t,r.yref),q=y.getDataToPixel(t,j),H=y.getDataToPixel(t,B,!0),V=y.getPixelToData(t,j),U=y.getPixelToData(t,B,!0);var i="shapes["+n+"]";"path"===r.type?(R=r.path,F=i+".path"):(v=q(r.x0),m=H(r.y0),x=q(r.x1),b=H(r.y1),_=i+".x0",w=i+".y0",k=i+".x1",M=i+".y1"),v<x?(L=v,z=i+".x0",N="x0",C=x,D=i+".x1",I="x1"):(L=x,z=i+".x1",N="x1",C=v,D=i+".x0",I="x0"),m<b?(A=m,S=i+".y0",P="y0",T=b,O=i+".y1",E="y1"):(A=b,S=i+".y1",P="y1",T=m,O=i+".y0",E="y0"),p={},a(e),Z.moveFn="move"===G?u:d}function l(r){g(e),r&&c.relayout(t,p)}function u(n,a){if("path"===r.type){var i=function(t){return V(q(t)+n)};j&&"date"===j.type&&(i=y.encodeDate(i));var l=function(t){return U(H(t)+a)};B&&"date"===B.type&&(l=y.encodeDate(l)),r.path=s(R,i,l),p[F]=r.path}else p[_]=r.x0=V(v+n),p[w]=r.y0=U(m+a),p[k]=r.x1=V(x+n),p[M]=r.y1=U(b+a);e.attr("d",o(t,r))}function d(n,a){if("path"===r.type){var i=function(t){return V(q(t)+n)};j&&"date"===j.type&&(i=y.encodeDate(i));var l=function(t){return U(H(t)+a)};B&&"date"===B.type&&(l=y.encodeDate(l)),r.path=s(R,i,l),p[F]=r.path}else{var c=~G.indexOf("n")?A+a:A,u=~G.indexOf("s")?T+a:T,f=~G.indexOf("w")?L+n:L,d=~G.indexOf("e")?C+n:C;u-c>Y&&(p[S]=r[P]=U(c),p[O]=r[E]=U(u)),d-f>X&&(p[z]=r[N]=V(f),p[D]=r[I]=V(d))}e.attr("d",o(t,r))}var p,v,m,x,b,_,w,k,M,A,T,L,C,S,O,z,D,P,E,N,I,R,F,j,B,q,H,V,U,G,X=10,Y=10,Z={element:e.node(),gd:t,prepFn:i,doneFn:l},W=Z.element.getBoundingClientRect();h.init(Z),e.node().onmousemove=a}function o(t,e){var r,n,a,i,o=e.type,s=f.getFromId(t,e.xref),c=f.getFromId(t,e.yref),u=t._fullLayout._size;if(s?(r=y.shapePositionToRange(s),n=function(t){return s._offset+s.r2p(r(t,!0))}):n=function(t){return u.l+u.w*t},c?(a=y.shapePositionToRange(c),i=function(t){return c._offset+c.r2p(a(t,!0))}):i=function(t){return u.t+u.h*(1-t)},"path"===o)return s&&"date"===s.type&&(n=y.decodeDate(n)),c&&"date"===c.type&&(i=y.decodeDate(i)),l(e.path,n,i);var d=n(e.x0),p=n(e.x1),h=i(e.y0),g=i(e.y1);if("line"===o)return"M"+d+","+h+"L"+p+","+g;if("rect"===o)return"M"+d+","+h+"H"+p+"V"+g+"H"+d+"Z";var v=(d+p)/2,m=(h+g)/2,x=Math.abs(v-d),b=Math.abs(m-h),_="A"+x+","+b,w=v+x+","+m;return"M"+w+_+" 0 1,1 "+v+","+(m-b)+_+" 0 0,1 "+w+"Z"}function l(t,e,r){return t.replace(v.segmentRE,function(t){var n=0,a=t.charAt(0),i=v.paramIsX[a],o=v.paramIsY[a],l=v.numParams[a],s=t.substr(1).replace(v.paramRE,function(t){return i[n]?t=e(t):o[n]&&(t=r(t)),n++,n>l&&(t="X"),t});return n>l&&(s=s.replace(/[\s,]*X.*/,""),u.log("Ignoring extra params in segment "+t)),a+s})}function s(t,e,r){return t.replace(v.segmentRE,function(t){var n=0,a=t.charAt(0),i=v.paramIsX[a],o=v.paramIsY[a],l=v.numParams[a];return a+t.substr(1).replace(v.paramRE,function(t){return n>=l?t:(i[n]?t=e(t):o[n]&&(t=r(t)),n++,t)})})}var c=t("../../plotly"),u=t("../../lib"),f=t("../../plots/cartesian/axes"),d=t("../color"),p=t("../drawing"),h=t("../dragelement"),g=t("../../lib/setcursor"),v=t("./constants"),y=t("./helpers");e.exports={draw:n,drawOne:a}},{"../../lib":149,"../../lib/setcursor":167,"../../plotly":184,"../../plots/cartesian/axes":189,"../color":34,"../dragelement":55,"../drawing":58,"./constants":113,"./helpers":116}],116:[function(t,e,r){"use strict";r.rangeToShapePosition=function(t){return"log"===t.type?t.r2d:function(t){return t}},r.shapePositionToRange=function(t){return"log"===t.type?t.d2r:function(t){return t}},r.decodeDate=function(t){return function(e){return e.replace&&(e=e.replace("_"," ")),t(e)}},r.encodeDate=function(t){return function(e){return t(e).replace(" ","_")}},r.getDataToPixel=function(t,e,n){var a,i=t._fullLayout._size;if(e){var o=r.shapePositionToRange(e);a=function(t){return e._offset+e.r2p(o(t,!0))},"date"===e.type&&(a=r.decodeDate(a))}else a=n?function(t){return i.t+i.h*(1-t)}:function(t){return i.l+i.w*t};return a},r.getPixelToData=function(t,e,n){var a,i=t._fullLayout._size;if(e){var o=r.rangeToShapePosition(e);a=function(t){return o(e.p2r(t-e._offset))}}else a=n?function(t){return 1-(t-i.t)/i.h}:function(t){return(t-i.l)/i.w};return a}},{}],117:[function(t,e,r){"use strict";var n=t("./draw");e.exports={moduleType:"component",name:"shapes",layoutAttributes:t("./attributes"),supplyLayoutDefaults:t("./defaults"),calcAutorange:t("./calc_autorange"),draw:n.draw,drawOne:n.drawOne}},{"./attributes":111,"./calc_autorange":112,"./defaults":114,"./draw":115}],118:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../plots/cartesian/axes"),i=t("./attributes"),o=t("./helpers");e.exports=function(t,e,r,l,s){function c(r,a){return n.coerce(t,e,i,r,a)}if(l=l||{},s=s||{},!c("visible",!s.itemIsNotPlainObject))return e;c("layer"),c("opacity"),c("fillcolor"),c("line.color"),c("line.width"),c("line.dash");for(var u=t.path?"path":"rect",f=c("type",u),d=["x","y"],p=0;p<2;p++){var h=d[p],g={_fullLayout:r},v=a.coerceRef(t,e,g,h,"","paper");if("path"!==f){var y,m,x;"paper"!==v?(y=a.getFromId(g,v),x=o.rangeToShapePosition(y),m=o.shapePositionToRange(y)):m=x=n.identity;var b=h+"0",_=h+"1",w=t[b],k=t[_];t[b]=m(t[b],!0),t[_]=m(t[_],!0),a.coercePosition(e,g,c,v,b,.25),a.coercePosition(e,g,c,v,_,.75),e[b]=x(e[b]),e[_]=x(e[_]),t[b]=w,t[_]=k}}return"path"===f?c("path"):n.noneOrAll(t,e,["x0","x1","y0","y1"]),e}},{"../../lib":149,"../../plots/cartesian/axes":189,"./attributes":111,"./helpers":116}],119:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),a=t("../../plots/pad_attributes"),i=t("../../lib/extend").extendDeepAll,o=t("../../plot_api/edit_types").overrideAll,l=t("../../plots/animation_attributes"),s=t("./constants"),c={_isLinkedToArray:"step",method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string"},value:{valType:"string"},execute:{valType:"boolean",dflt:!0}};e.exports=o({_isLinkedToArray:"slider",visible:{valType:"boolean",dflt:!0},active:{valType:"number",min:0,dflt:0},steps:c,lenmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"fraction"},len:{valType:"number",min:0,dflt:1},x:{valType:"number",min:-2,max:3,dflt:0},pad:i({},a,{},{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:s.gripBgActiveColor},bgcolor:{valType:"color",dflt:s.railBgColor},bordercolor:{valType:"color",dflt:s.railBorderColor},borderwidth:{valType:"number",min:0,dflt:s.railBorderWidth},ticklen:{valType:"number",min:0,dflt:s.tickLength},tickcolor:{valType:"color",dflt:s.tickColor},tickwidth:{valType:"number",min:0,dflt:1},minorticklen:{valType:"number",min:0,dflt:s.minorTickLength}},"arraydraw","from-root")},{"../../lib/extend":143,"../../plot_api/edit_types":173,"../../plots/animation_attributes":185,"../../plots/font_attributes":213,"../../plots/pad_attributes":217,"./constants":120}],120:[function(t,e,r){"use strict";e.exports={name:"sliders",containerClassName:"slider-container",groupClassName:"slider-group",inputAreaClass:"slider-input-area",railRectClass:"slider-rail-rect",railTouchRectClass:"slider-rail-touch-rect",gripRectClass:"slider-grip-rect",tickRectClass:"slider-tick-rect",inputProxyClass:"slider-input-proxy",labelsClass:"slider-labels",labelGroupClass:"slider-label-group",labelClass:"slider-label",currentValueClass:"slider-current-value",railHeight:5,menuIndexAttrName:"slider-active-index",autoMarginIdRoot:"slider-",minWidth:30,minHeight:30,textPadX:40,arrowOffsetX:4,railRadius:2,railWidth:5,railBorder:4,railBorderWidth:1,railBorderColor:"#bec8d9",railBgColor:"#f8fafc",railInset:8,stepInset:10,gripRadius:10,gripWidth:20,gripHeight:20,gripBorder:20,gripBorderWidth:1,gripBorderColor:"#bec8d9",gripBgColor:"#f6f8fa",gripBgActiveColor:"#dbdde0",labelPadding:8,labelOffset:0,tickWidth:1,tickColor:"#333",tickOffset:25,tickLength:7,minorTickOffset:25,minorTickColor:"#333",minorTickLength:4,currentValuePadding:8,currentValueInset:0}},{}], 121:[function(t,e,r){"use strict";function n(t,e,r){function n(r,n){return i.coerce(t,e,l,r,n)}n("visible",a(t,e).length>0)&&(n("active"),n("x"),n("y"),i.noneOrAll(t,e,["x","y"]),n("xanchor"),n("yanchor"),n("len"),n("lenmode"),n("pad.t"),n("pad.r"),n("pad.b"),n("pad.l"),i.coerceFont(n,"font",r.font),n("currentvalue.visible")&&(n("currentvalue.xanchor"),n("currentvalue.prefix"),n("currentvalue.suffix"),n("currentvalue.offset"),i.coerceFont(n,"currentvalue.font",e.font)),n("transition.duration"),n("transition.easing"),n("bgcolor"),n("activebgcolor"),n("bordercolor"),n("borderwidth"),n("ticklen"),n("tickwidth"),n("tickcolor"),n("minorticklen"))}function a(t,e){function r(t,e){return i.coerce(n,a,u,t,e)}for(var n,a,o=t.steps||[],l=e.steps=[],s=0;s<o.length;s++)n=o[s],a={},r("method"),i.isPlainObject(n)&&("skip"===a.method||Array.isArray(n.args))&&(r("args"),r("label","step-"+s),r("value",a.label),r("execute"),l.push(a));return l}var i=t("../../lib"),o=t("../../plots/array_container_defaults"),l=t("./attributes"),s=t("./constants"),c=s.name,u=l.steps;e.exports=function(t,e){o(t,e,{name:c,handleItemDefaults:n})}},{"../../lib":149,"../../plots/array_container_defaults":186,"./attributes":119,"./constants":120}],122:[function(t,e,r){"use strict";function n(t,e){for(var r=t[C.name],n=[],a=0;a<r.length;a++){var i=r[a];i.visible&&i.steps.length&&(i.gd=e,n.push(i))}return n}function a(t){return t._index}function i(t,e){var r=A.tester.selectAll("g."+C.labelGroupClass).data(e.steps);r.enter().append("g").classed(C.labelGroupClass,!0);var n=0,a=0;r.each(function(t){var r=w.select(this),i=c(r,{step:t},e),o=i.node();if(o){var l=A.bBox(o);a=Math.max(a,l.height),n=Math.max(n,l.width)}}),r.remove(),e.inputAreaWidth=Math.max(C.railWidth,C.gripHeight);var i=t._fullLayout._size;e.lx=i.l+i.w*e.x,e.ly=i.t+i.h*(1-e.y),"fraction"===e.lenmode?e.outerLength=Math.round(i.w*e.len):e.outerLength=e.len,e.lenPad=Math.round(.5*C.gripWidth),e.inputAreaStart=0,e.inputAreaLength=Math.round(e.outerLength-e.pad.l-e.pad.r);var o=e.inputAreaLength-2*C.stepInset,s=o/(e.steps.length-1),u=n+C.labelPadding;if(e.labelStride=Math.max(1,Math.ceil(u/s)),e.labelHeight=a,e.currentValueMaxWidth=0,e.currentValueHeight=0,e.currentValueTotalHeight=0,e.currentValueMaxLines=1,e.currentvalue.visible){var f=A.tester.append("g");r.each(function(t){var r=l(f,e,t.label),n=r.node()&&A.bBox(r.node())||{width:0,height:0},a=T.lineCount(r);e.currentValueMaxWidth=Math.max(e.currentValueMaxWidth,Math.ceil(n.width)),e.currentValueHeight=Math.max(e.currentValueHeight,Math.ceil(n.height)),e.currentValueMaxLines=Math.max(e.currentValueMaxLines,a)}),e.currentValueTotalHeight=e.currentValueHeight+e.currentvalue.offset,f.remove()}e.height=e.currentValueTotalHeight+C.tickOffset+e.ticklen+C.labelOffset+e.labelHeight+e.pad.t+e.pad.b;var d="left";L.isRightAnchor(e)&&(e.lx-=e.outerLength,d="right"),L.isCenterAnchor(e)&&(e.lx-=e.outerLength/2,d="center");var p="top";L.isBottomAnchor(e)&&(e.ly-=e.height,p="bottom"),L.isMiddleAnchor(e)&&(e.ly-=e.height/2,p="middle"),e.outerLength=Math.ceil(e.outerLength),e.height=Math.ceil(e.height),e.lx=Math.round(e.lx),e.ly=Math.round(e.ly),k.autoMargin(t,C.autoMarginIdRoot+e._index,{x:e.x,y:e.y,l:e.outerLength*({right:1,center:.5}[d]||0),r:e.outerLength*({left:1,center:.5}[d]||0),b:e.height*({top:1,middle:.5}[p]||0),t:e.height*({bottom:1,middle:.5}[p]||0)})}function o(t,e,r){r.active>=r.steps.length&&(r.active=0),e.call(l,r).call(b,r).call(u,r).call(h,r).call(x,t,r).call(s,t,r),A.setTranslate(e,r.lx+r.pad.l,r.ly+r.pad.t),e.call(v,r,r.active/(r.steps.length-1),!1),e.call(l,r)}function l(t,e,r){if(e.currentvalue.visible){var n,a,i=t.selectAll("text").data([0]);switch(e.currentvalue.xanchor){case"right":n=e.inputAreaLength-C.currentValueInset-e.currentValueMaxWidth,a="left";break;case"center":n=.5*e.inputAreaLength,a="middle";break;default:n=C.currentValueInset,a="left"}i.enter().append("text").classed(C.labelClass,!0).classed("user-select-none",!0).attr({"text-anchor":a,"data-notex":1});var o=e.currentvalue.prefix?e.currentvalue.prefix:"";if("string"==typeof r)o+=r;else{o+=e.steps[e.active].label}e.currentvalue.suffix&&(o+=e.currentvalue.suffix),i.call(A.font,e.currentvalue.font).text(o).call(T.convertToTspans,e.gd);var l=T.lineCount(i),s=(e.currentValueMaxLines+1-l)*e.currentvalue.font.size*S;return T.positionText(i,n,s),i}}function s(t,e,r){var n=t.selectAll("rect."+C.gripRectClass).data([0]);n.enter().append("rect").classed(C.gripRectClass,!0).call(p,e,t,r).style("pointer-events","all"),n.attr({width:C.gripWidth,height:C.gripHeight,rx:C.gripRadius,ry:C.gripRadius}).call(M.stroke,r.bordercolor).call(M.fill,r.bgcolor).style("stroke-width",r.borderwidth+"px")}function c(t,e,r){var n=t.selectAll("text").data([0]);return n.enter().append("text").classed(C.labelClass,!0).classed("user-select-none",!0).attr({"text-anchor":"middle","data-notex":1}),n.call(A.font,r.font).text(e.step.label).call(T.convertToTspans,r.gd),n}function u(t,e){var r=t.selectAll("g."+C.labelsClass).data([0]);r.enter().append("g").classed(C.labelsClass,!0);var n=r.selectAll("g."+C.labelGroupClass).data(e.labelSteps);n.enter().append("g").classed(C.labelGroupClass,!0),n.exit().remove(),n.each(function(t){var r=w.select(this);r.call(c,t,e),A.setTranslate(r,y(e,t.fraction),C.tickOffset+e.ticklen+e.font.size*S+C.labelOffset+e.currentValueTotalHeight)})}function f(t,e,r,n,a){var i=Math.round(n*(r.steps.length-1));i!==r.active&&d(t,e,r,i,!0,a)}function d(t,e,r,n,a,i){var o=r.active;r._input.active=r.active=n;var s=r.steps[r.active];e.call(v,r,r.active/(r.steps.length-1),i),e.call(l,r),t.emit("plotly_sliderchange",{slider:r,step:r.steps[r.active],interaction:a,previousActive:o}),s&&s.method&&a&&(e._nextMethod?(e._nextMethod.step=s,e._nextMethod.doCallback=a,e._nextMethod.doTransition=i):(e._nextMethod={step:s,doCallback:a,doTransition:i},e._nextMethodRaf=window.requestAnimationFrame(function(){var r=e._nextMethod.step;r.method&&(r.execute&&k.executeAPICommand(t,r.method,r.args),e._nextMethod=null,e._nextMethodRaf=null)})))}function p(t,e,r){function n(){return r.data()[0]}var a=r.node(),i=w.select(e);t.on("mousedown",function(){var t=n();e.emit("plotly_sliderstart",{slider:t});var o=r.select("."+C.gripRectClass);w.event.stopPropagation(),w.event.preventDefault(),o.call(M.fill,t.activebgcolor);var l=m(t,w.mouse(a)[0]);f(e,r,t,l,!0),t._dragging=!0,i.on("mousemove",function(){var t=n(),i=m(t,w.mouse(a)[0]);f(e,r,t,i,!1)}),i.on("mouseup",function(){var t=n();t._dragging=!1,o.call(M.fill,t.bgcolor),i.on("mouseup",null),i.on("mousemove",null),e.emit("plotly_sliderend",{slider:t,step:t.steps[t.active]})})})}function h(t,e){var r=t.selectAll("rect."+C.tickRectClass).data(e.steps);r.enter().append("rect").classed(C.tickRectClass,!0),r.exit().remove(),r.attr({width:e.tickwidth+"px","shape-rendering":"crispEdges"}),r.each(function(t,r){var n=r%e.labelStride==0,a=w.select(this);a.attr({height:n?e.ticklen:e.minorticklen}).call(M.fill,e.tickcolor),A.setTranslate(a,y(e,r/(e.steps.length-1))-.5*e.tickwidth,(n?C.tickOffset:C.minorTickOffset)+e.currentValueTotalHeight)})}function g(t){t.labelSteps=[];for(var e=t.steps.length,r=0;r<e;r+=t.labelStride)t.labelSteps.push({fraction:r/(e-1),step:t.steps[r]})}function v(t,e,r,n){var a=t.select("rect."+C.gripRectClass),i=y(e,r);if(!e._invokingCommand){var o=a;n&&e.transition.duration>0&&(o=o.transition().duration(e.transition.duration).ease(e.transition.easing)),o.attr("transform","translate("+(i-.5*C.gripWidth)+","+e.currentValueTotalHeight+")")}}function y(t,e){return t.inputAreaStart+C.stepInset+(t.inputAreaLength-2*C.stepInset)*Math.min(1,Math.max(0,e))}function m(t,e){return Math.min(1,Math.max(0,(e-C.stepInset-t.inputAreaStart)/(t.inputAreaLength-2*C.stepInset-2*t.inputAreaStart)))}function x(t,e,r){var n=t.selectAll("rect."+C.railTouchRectClass).data([0]);n.enter().append("rect").classed(C.railTouchRectClass,!0).call(p,e,t,r).style("pointer-events","all"),n.attr({width:r.inputAreaLength,height:Math.max(r.inputAreaWidth,C.tickOffset+r.ticklen+r.labelHeight)}).call(M.fill,r.bgcolor).attr("opacity",0),A.setTranslate(n,0,r.currentValueTotalHeight)}function b(t,e){var r=t.selectAll("rect."+C.railRectClass).data([0]);r.enter().append("rect").classed(C.railRectClass,!0);var n=e.inputAreaLength-2*C.railInset;r.attr({width:n,height:C.railWidth,rx:C.railRadius,ry:C.railRadius,"shape-rendering":"crispEdges"}).call(M.stroke,e.bordercolor).call(M.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px"),A.setTranslate(r,C.railInset,.5*(e.inputAreaWidth-C.railWidth)+e.currentValueTotalHeight)}function _(t){for(var e=t._fullLayout._pushmargin||{},r=Object.keys(e),n=0;n<r.length;n++){var a=r[n];-1!==a.indexOf(C.autoMarginIdRoot)&&k.autoMargin(t,a)}}var w=t("d3"),k=t("../../plots/plots"),M=t("../color"),A=t("../drawing"),T=t("../../lib/svg_text_utils"),L=t("../legend/anchor_utils"),C=t("./constants"),S=t("../../constants/alignment").LINE_SPACING;e.exports=function(t){var e=t._fullLayout,r=n(e,t),l=e._infolayer.selectAll("g."+C.containerClassName).data(r.length>0?[0]:[]);if(l.enter().append("g").classed(C.containerClassName,!0).style("cursor","ew-resize"),l.exit().remove(),l.exit().size()&&_(t),0!==r.length){var s=l.selectAll("g."+C.groupClassName).data(r,a);s.enter().append("g").classed(C.groupClassName,!0),s.exit().each(function(e){w.select(this).remove(),e._commandObserver.remove(),delete e._commandObserver,k.autoMargin(t,C.autoMarginIdRoot+e._index)});for(var c=0;c<r.length;c++){var u=r[c];i(t,u)}s.each(function(e){if(!(e.steps.length<2)){var r=w.select(this);g(e),k.manageCommandObserver(t,e,e.steps,function(e){var n=r.data()[0];n.active!==e.index&&(n._dragging||d(t,r,n,e.index,!1,!0))}),o(t,w.select(this),e)}})}}},{"../../constants/alignment":131,"../../lib/svg_text_utils":169,"../../plots/plots":218,"../color":34,"../drawing":58,"../legend/anchor_utils":84,"./constants":120,d3:7}],123:[function(t,e,r){"use strict";var n=t("./constants");e.exports={moduleType:"component",name:n.name,layoutAttributes:t("./attributes"),supplyLayoutDefaults:t("./defaults"),draw:t("./draw")}},{"./attributes":119,"./constants":120,"./defaults":121,"./draw":122}],124:[function(t,e,r){"use strict";var n=t("d3"),a=t("fast-isnumeric"),i=t("../../plotly"),o=t("../../plots/plots"),l=t("../../lib"),s=t("../drawing"),c=t("../color"),u=t("../../lib/svg_text_utils"),f=t("../../constants/interactions"),d=/Click to enter .+ title/;(e.exports={}).draw=function(t,e,r){function p(t){l.syncOrAsync([h,g],t)}function h(e){return e.attr("transform",k?"rotate("+[k.rotate,w.x,w.y]+") translate(0, "+k.offset+")":null),e.style({"font-family":T,"font-size":n.round(L,2)+"px",fill:c.rgb(C),opacity:S*c.opacity(C),"font-weight":o.fontWeight}).attr(w).call(u.convertToTspans,t),o.previousPromises(t)}function g(t){var e=n.select(t.node().parentNode);if(_&&_.selection&&_.side&&z){e.attr("transform",null);var r=0,i={left:"right",right:"left",top:"bottom",bottom:"top"}[_.side],o=-1!==["left","top"].indexOf(_.side)?-1:1,c=a(_.pad)?_.pad:2,u=s.bBox(e.node()),f={left:0,top:0,right:A.width,bottom:A.height},d=_.maxShift||(f[_.side]-u[_.side])*("left"===_.side||"top"===_.side?-1:1);if(d<0)r=d;else{var p=_.offsetLeft||0,h=_.offsetTop||0;u.left-=p,u.right-=p,u.top-=h,u.bottom-=h,_.selection.each(function(){var t=s.bBox(this);l.bBoxIntersect(u,t,c)&&(r=Math.max(r,o*(t[_.side]-u[i])+c))}),r=Math.min(d,r)}if(r>0||d<0){var g={left:[-r,0],right:[r,0],top:[0,-r],bottom:[0,r]}[_.side];e.attr("transform","translate("+g+")")}}}var v,y=r.propContainer,m=r.propName,x=r.traceIndex,b=r.dfltName,_=r.avoid||{},w=r.attributes,k=r.transform,M=r.containerGroup,A=t._fullLayout,T=y.titlefont.family,L=y.titlefont.size,C=y.titlefont.color,S=1,O=!1,z=y.title.trim();"title"===m?v="titleText":-1!==m.indexOf("axis")?v="axisTitleText":m.indexOf(!0)&&(v="colorbarTitleText");var D=t._context.edits[v];""===z&&(S=0),z.match(d)&&(S=.2,O=!0,D||(z=""));var P=z||D;M||(M=A._infolayer.selectAll(".g-"+e).data([0]),M.enter().append("g").classed("g-"+e,!0));var E=M.selectAll("text").data(P?[0]:[]);if(E.enter().append("text"),E.text(z).attr("class",e),E.exit().remove(),P){E.call(p);var N="Click to enter "+b+" title";D&&(z?E.on(".opacity",null):function(){S=0,O=!0,z=N,E.text(z).on("mouseover.opacity",function(){n.select(this).transition().duration(f.SHOW_PLACEHOLDER).style("opacity",1)}).on("mouseout.opacity",function(){n.select(this).transition().duration(f.HIDE_PLACEHOLDER).style("opacity",0)})}(),E.call(u.makeEditable,{gd:t}).on("edit",function(e){void 0!==x?i.restyle(t,m,e,x):i.relayout(t,m,e)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(p)}).on("input",function(t){this.text(t||" ").call(u.positionText,w.x,w.y)})),E.classed("js-placeholder",O)}}},{"../../constants/interactions":132,"../../lib":149,"../../lib/svg_text_utils":169,"../../plotly":184,"../../plots/plots":218,"../color":34,"../drawing":58,d3:7,"fast-isnumeric":10}],125:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),a=t("../color/attributes"),i=t("../../lib/extend").extendFlat,o=t("../../plot_api/edit_types").overrideAll,l=t("../../plots/pad_attributes"),s={_isLinkedToArray:"button",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",dflt:""},execute:{valType:"boolean",dflt:!0}};e.exports=o({_isLinkedToArray:"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:s,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,{}),font:n({}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:a.borderLine},borderwidth:{valType:"number",min:0,dflt:1,editType:"arraydraw"}},"arraydraw","from-root")},{"../../lib/extend":143,"../../plot_api/edit_types":173,"../../plots/font_attributes":213,"../../plots/pad_attributes":217,"../color/attributes":33}],126:[function(t,e,r){"use strict";e.exports={name:"updatemenus",containerClassName:"updatemenu-container",headerGroupClassName:"updatemenu-header-group",headerClassName:"updatemenu-header",headerArrowClassName:"updatemenu-header-arrow",dropdownButtonGroupClassName:"updatemenu-dropdown-button-group",dropdownButtonClassName:"updatemenu-dropdown-button",buttonClassName:"updatemenu-button",itemRectClassName:"updatemenu-item-rect",itemTextClassName:"updatemenu-item-text",menuIndexAttrName:"updatemenu-active-index",autoMarginIdRoot:"updatemenu-",blankHeaderOpts:{label:" "},minWidth:30,minHeight:30,textPadX:24,arrowPadX:16,rx:2,ry:2,textOffsetX:12,textOffsetY:3,arrowOffsetX:4,gapButtonHeader:5,gapButton:2,activeColor:"#F4FAFF",hoverColor:"#F4FAFF",arrowSymbol:{left:"\u25c4",right:"\u25ba",up:"\u25b2",down:"\u25bc"}}},{}],127:[function(t,e,r){"use strict";function n(t,e,r){function n(r,n){return i.coerce(t,e,l,r,n)}n("visible",a(t,e).length>0)&&(n("active"),n("direction"),n("type"),n("showactive"),n("x"),n("y"),i.noneOrAll(t,e,["x","y"]),n("xanchor"),n("yanchor"),n("pad.t"),n("pad.r"),n("pad.b"),n("pad.l"),i.coerceFont(n,"font",r.font),n("bgcolor",r.paper_bgcolor),n("bordercolor"),n("borderwidth"))}function a(t,e){function r(t,e){return i.coerce(n,a,u,t,e)}for(var n,a,o=t.buttons||[],l=e.buttons=[],s=0;s<o.length;s++)n=o[s],a={},r("method"),i.isPlainObject(n)&&("skip"===a.method||Array.isArray(n.args))&&(r("args"),r("label"),r("execute"),a._index=s,l.push(a));return l}var i=t("../../lib"),o=t("../../plots/array_container_defaults"),l=t("./attributes"),s=t("./constants"),c=s.name,u=l.buttons;e.exports=function(t,e){o(t,e,{name:c,handleItemDefaults:n})}},{"../../lib":149,"../../plots/array_container_defaults":186,"./attributes":125,"./constants":126}],128:[function(t,e,r){"use strict";function n(t){for(var e=t[S.name],r=[],n=0;n<e.length;n++){var a=e[n];a.visible&&r.push(a)}return r}function a(t){return t._index}function i(t){return-1==+t.attr(S.menuIndexAttrName)}function o(t,e){return+t.attr(S.menuIndexAttrName)===e._index}function l(t,e,r,n,a,i,o,l){e._input.active=e.active=o,"buttons"===e.type?c(t,n,null,null,e):"dropdown"===e.type&&(a.attr(S.menuIndexAttrName,"-1"),s(t,n,a,i,e),l||c(t,n,a,i,e))}function s(t,e,r,n,a){var i=e.selectAll("g."+S.headerClassName).data([0]);i.enter().append("g").classed(S.headerClassName,!0).style("pointer-events","all");var l=a.active,s=a.buttons[l]||S.blankHeaderOpts,u={y:a.pad.t,yPad:0,x:a.pad.l,xPad:0,index:0},f={width:a.headerWidth,height:a.headerHeight};i.call(d,a,s,t).call(x,a,u,f);var p=e.selectAll("text."+S.headerArrowClassName).data([0]);p.enter().append("text").classed(S.headerArrowClassName,!0).classed("user-select-none",!0).attr("text-anchor","end").call(A.font,a.font).text(S.arrowSymbol[a.direction]),p.attr({x:a.headerWidth-S.arrowOffsetX+a.pad.l,y:a.headerHeight/2+S.textOffsetY+a.pad.t}),i.on("click",function(){r.call(b),r.attr(S.menuIndexAttrName,o(r,a)?-1:String(a._index)),c(t,e,r,n,a)}),i.on("mouseover",function(){i.call(v)}),i.on("mouseout",function(){i.call(y,a)}),A.setTranslate(e,a.lx,a.ly)}function c(t,e,r,n,a){r||(r=e,r.attr("pointer-events","all"));var o=i(r)&&"buttons"!==a.type?[]:a.buttons,s="dropdown"===a.type?S.dropdownButtonClassName:S.buttonClassName,c=r.selectAll("g."+s).data(o),p=c.enter().append("g").classed(s,!0),h=c.exit();"dropdown"===a.type?(p.attr("opacity","0").transition().attr("opacity","1"),h.transition().attr("opacity","0").remove()):h.remove();var m=0,b=0,_=-1!==["up","down"].indexOf(a.direction);"dropdown"===a.type&&(_?b=a.headerHeight+S.gapButtonHeader:m=a.headerWidth+S.gapButtonHeader),"dropdown"===a.type&&"up"===a.direction&&(b=-S.gapButtonHeader+S.gapButton-a.openHeight),"dropdown"===a.type&&"left"===a.direction&&(m=-S.gapButtonHeader+S.gapButton-a.openWidth);var M={x:a.lx+m+a.pad.l,y:a.ly+b+a.pad.t,yPad:S.gapButton,xPad:S.gapButton,index:0},A={l:M.x+a.borderwidth,t:M.y+a.borderwidth};c.each(function(i,o){var s=w.select(this);s.call(d,a,i,t).call(x,a,M),s.on("click",function(){w.event.defaultPrevented||(l(t,a,i,e,r,n,o),i.execute&&k.executeAPICommand(t,i.method,i.args),t.emit("plotly_buttonclicked",{menu:a,button:i,active:a.active}))}),s.on("mouseover",function(){s.call(v)}),s.on("mouseout",function(){s.call(y,a),c.call(g,a)})}),c.call(g,a),_?(A.w=Math.max(a.openWidth,a.headerWidth),A.h=M.y-A.t):(A.w=M.x-A.l,A.h=Math.max(a.openHeight,a.headerHeight)),A.direction=a.direction,n&&(c.size()?u(t,e,r,n,a,A):f(n))}function u(t,e,r,n,a,i){var o,l,s,c=a.direction,u="up"===c||"down"===c,f=a.active;if(u)for(l=0,s=0;s<f;s++)l+=a.heights[s]+S.gapButton;else for(o=0,s=0;s<f;s++)o+=a.widths[s]+S.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")}function f(t){var e=!!t.hbar,r=!!t.vbar;e&&t.hbar.transition().attr("opacity","0").each("end",function(){e=!1,r||t.disable()}),r&&t.vbar.transition().attr("opacity","0").each("end",function(){r=!1,e||t.disable()})}function d(t,e,r,n){t.call(p,e).call(h,e,r,n)}function p(t,e){var r=t.selectAll("rect").data([0]);r.enter().append("rect").classed(S.itemRectClassName,!0).attr({rx:S.rx,ry:S.ry,"shape-rendering":"crispEdges"}),r.call(M.stroke,e.bordercolor).call(M.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px")}function h(t,e,r,n){var a=t.selectAll("text").data([0]);a.enter().append("text").classed(S.itemTextClassName,!0).classed("user-select-none",!0).attr({"text-anchor":"start","data-notex":1}),a.call(A.font,e.font).text(r.label).call(T.convertToTspans,n)}function g(t,e){var r=e.active;t.each(function(t,n){var a=w.select(this);n===r&&e.showactive&&a.select("rect."+S.itemRectClassName).call(M.fill,S.activeColor)})}function v(t){t.select("rect."+S.itemRectClassName).call(M.fill,S.hoverColor)}function y(t,e){t.select("rect."+S.itemRectClassName).call(M.fill,e.bgcolor)}function m(t,e){e.width1=0,e.height1=0,e.heights=[],e.widths=[],e.totalWidth=0,e.totalHeight=0,e.openWidth=0,e.openHeight=0,e.lx=0,e.ly=0;var r=A.tester.selectAll("g."+S.dropdownButtonClassName).data(e.buttons);r.enter().append("g").classed(S.dropdownButtonClassName,!0);var n=-1!==["up","down"].indexOf(e.direction);r.each(function(r,a){var i=w.select(this);i.call(d,e,r,t);var o=i.select("."+S.itemTextClassName),l=o.node()&&A.bBox(o.node()).width,s=Math.max(l+S.textPadX,S.minWidth),c=e.font.size*C,u=T.lineCount(o),f=Math.max(c*u,S.minHeight)+S.textOffsetY;f=Math.ceil(f),s=Math.ceil(s),e.widths[a]=s,e.heights[a]=f,e.height1=Math.max(e.height1,f),e.width1=Math.max(e.width1,s),n?(e.totalWidth=Math.max(e.totalWidth,s),e.openWidth=e.totalWidth,e.totalHeight+=f+S.gapButton,e.openHeight+=f+S.gapButton):(e.totalWidth+=s+S.gapButton,e.openWidth+=s+S.gapButton,e.totalHeight=Math.max(e.totalHeight,f),e.openHeight=e.totalHeight)}),n?e.totalHeight-=S.gapButton:e.totalWidth-=S.gapButton,e.headerWidth=e.width1+S.arrowPadX,e.headerHeight=e.height1,"dropdown"===e.type&&(n?(e.width1+=S.arrowPadX,e.totalHeight=e.height1):e.totalWidth=e.width1,e.totalWidth+=S.arrowPadX),r.remove();var a=e.totalWidth+e.pad.l+e.pad.r,i=e.totalHeight+e.pad.t+e.pad.b,o=t._fullLayout._size;e.lx=o.l+o.w*e.x,e.ly=o.t+o.h*(1-e.y);var l="left";L.isRightAnchor(e)&&(e.lx-=a,l="right"),L.isCenterAnchor(e)&&(e.lx-=a/2,l="center");var s="top";L.isBottomAnchor(e)&&(e.ly-=i,s="bottom"),L.isMiddleAnchor(e)&&(e.ly-=i/2,s="middle"),e.totalWidth=Math.ceil(e.totalWidth),e.totalHeight=Math.ceil(e.totalHeight),e.lx=Math.round(e.lx),e.ly=Math.round(e.ly),k.autoMargin(t,S.autoMarginIdRoot+e._index,{x:e.x,y:e.y,l:a*({right:1,center:.5}[l]||0),r:a*({left:1,center:.5}[l]||0),b:i*({top:1,middle:.5}[s]||0),t:i*({bottom:1,middle:.5}[s]||0)})}function x(t,e,r,n){n=n||{};var a=t.select("."+S.itemRectClassName),i=t.select("."+S.itemTextClassName),o=e.borderwidth,l=r.index;A.setTranslate(t,o+r.x,o+r.y);var s=-1!==["up","down"].indexOf(e.direction),c=n.height||(s?e.heights[l]:e.height1);a.attr({x:0,y:0,width:n.width||(s?e.width1:e.widths[l]),height:c});var u=e.font.size*C,f=T.lineCount(i),d=(f-1)*u/2;T.positionText(i,S.textOffsetX,c/2-d+S.textOffsetY),s?r.y+=e.heights[l]+r.yPad:r.x+=e.widths[l]+r.xPad,r.index++}function b(t){t.selectAll("g."+S.dropdownButtonClassName).remove()}function _(t){for(var e=t._fullLayout._pushmargin||{},r=Object.keys(e),n=0;n<r.length;n++){var a=r[n];-1!==a.indexOf(S.autoMarginIdRoot)&&k.autoMargin(t,a)}}var w=t("d3"),k=t("../../plots/plots"),M=t("../color"),A=t("../drawing"),T=t("../../lib/svg_text_utils"),L=t("../legend/anchor_utils"),C=t("../../constants/alignment").LINE_SPACING,S=t("./constants"),O=t("./scrollbox");e.exports=function(t){var e=t._fullLayout,r=n(e),i=e._infolayer.selectAll("g."+S.containerClassName).data(r.length>0?[0]:[]);if(i.enter().append("g").classed(S.containerClassName,!0).style("cursor","pointer"),i.exit().remove(),i.exit().size()&&_(t),0!==r.length){var u=i.selectAll("g."+S.headerGroupClassName).data(r,a);u.enter().append("g").classed(S.headerGroupClassName,!0);var f=i.selectAll("g."+S.dropdownButtonGroupClassName).data([0]);f.enter().append("g").classed(S.dropdownButtonGroupClassName,!0).style("pointer-events","all");for(var d=0;d<r.length;d++){var p=r[d];m(t,p)}var h="updatemenus"+e._uid,g=new O(t,f,h);u.enter().size()&&f.call(b).attr(S.menuIndexAttrName,"-1"),u.exit().each(function(e){w.select(this).remove(),f.call(b).attr(S.menuIndexAttrName,"-1"),k.autoMargin(t,S.autoMarginIdRoot+e._index)}),u.each(function(e){var r=w.select(this),n="dropdown"===e.type?f:null;k.manageCommandObserver(t,e,e.buttons,function(a){l(t,e,e.buttons[a.index],r,n,g,a.index,!0)}),"dropdown"===e.type?(s(t,r,f,g,e),o(f,e)&&c(t,r,f,g,e)):c(t,r,null,null,e)})}}},{"../../constants/alignment":131,"../../lib/svg_text_utils":169,"../../plots/plots":218,"../color":34,"../drawing":58,"../legend/anchor_utils":84,"./constants":126,"./scrollbox":130,d3:7}],129:[function(t,e,r){arguments[4][123][0].apply(r,arguments)},{"./attributes":125,"./constants":126,"./defaults":127,"./draw":128,dup:123}],130:[function(t,e,r){"use strict";function n(t,e,r){this.gd=t,this.container=e,this.id=r,this.position=null,this.translateX=null,this.translateY=null,this.hbar=null,this.vbar=null,this.bg=this.container.selectAll("rect.scrollbox-bg").data([0]),this.bg.exit().on(".drag",null).on("wheel",null).remove(),this.bg.enter().append("rect").classed("scrollbox-bg",!0).style("pointer-events","all").attr({opacity:0,x:0,y:0,width:0,height:0})}e.exports=n;var a=t("d3"),i=t("../color"),o=t("../drawing"),l=t("../../lib");n.barWidth=2,n.barLength=20,n.barRadius=2,n.barPad=1,n.barColor="#808BA4",n.prototype.enable=function(t,e,r){var l=this.gd._fullLayout,s=l.width,c=l.height;this.position=t;var u,f,d,p,h=this.position.l,g=this.position.w,v=this.position.t,y=this.position.h,m=this.position.direction,x="down"===m,b="left"===m,_="right"===m,w="up"===m,k=g,M=y;x||b||_||w||(this.position.direction="down",x=!0),x||w?(u=h,f=u+k,x?(d=v,p=Math.min(d+M,c),M=p-d):(p=v+M,d=Math.max(p-M,0),M=p-d)):(d=v,p=d+M,b?(f=h+k,u=Math.max(f-k,0),k=f-u):(u=h,f=Math.min(u+k,s),k=f-u)),this._box={l:u,t:d,w:k,h:M};var A=g>k,T=n.barLength+2*n.barPad,L=n.barWidth+2*n.barPad,C=h,S=v+y;S+L>c&&(S=c-L);var O=this.container.selectAll("rect.scrollbar-horizontal").data(A?[0]:[]);O.exit().on(".drag",null).remove(),O.enter().append("rect").classed("scrollbar-horizontal",!0).call(i.fill,n.barColor),A?(this.hbar=O.attr({rx:n.barRadius,ry:n.barRadius,x:C,y:S,width:T,height:L}),this._hbarXMin=C+T/2,this._hbarTranslateMax=k-T):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var z=y>M,D=n.barWidth+2*n.barPad,P=n.barLength+2*n.barPad,E=h+g,N=v;E+D>s&&(E=s-D);var I=this.container.selectAll("rect.scrollbar-vertical").data(z?[0]:[]);I.exit().on(".drag",null).remove(),I.enter().append("rect").classed("scrollbar-vertical",!0).call(i.fill,n.barColor),z?(this.vbar=I.attr({rx:n.barRadius,ry:n.barRadius,x:E,y:N,width:D,height:P}),this._vbarYMin=N+P/2,this._vbarTranslateMax=M-P):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var R=this.id,F=u-.5,j=z?f+D+.5:f+.5,B=d-.5,q=A?p+L+.5:p+.5,H=l._topdefs.selectAll("#"+R).data(A||z?[0]:[]);if(H.exit().remove(),H.enter().append("clipPath").attr("id",R).append("rect"),A||z?(this._clipRect=H.select("rect").attr({x:Math.floor(F),y:Math.floor(B),width:Math.ceil(j)-Math.floor(F),height:Math.ceil(q)-Math.floor(B)}),this.container.call(o.setClipUrl,R),this.bg.attr({x:h,y:v,width:g,height:y})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(o.setClipUrl,null),delete this._clipRect),A||z){var V=a.behavior.drag().on("dragstart",function(){a.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=a.behavior.drag().on("dragstart",function(){a.event.sourceEvent.preventDefault(),a.event.sourceEvent.stopPropagation()}).on("drag",this._onBarDrag.bind(this));A&&this.hbar.on(".drag",null).call(U),z&&this.vbar.on(".drag",null).call(U)}this.setTranslate(e,r)},n.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(o.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)},n.prototype._onBoxDrag=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t-=a.event.dx),this.vbar&&(e-=a.event.dy),this.setTranslate(t,e)},n.prototype._onBoxWheel=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t+=a.event.deltaY),this.vbar&&(e+=a.event.deltaY),this.setTranslate(t,e)},n.prototype._onBarDrag=function(){var t=this.translateX,e=this.translateY;if(this.hbar){var r=t+this._hbarXMin,n=r+this._hbarTranslateMax;t=(l.constrain(a.event.x,r,n)-r)/(n-r)*(this.position.w-this._box.w)}if(this.vbar){var i=e+this._vbarYMin,o=i+this._vbarTranslateMax;e=(l.constrain(a.event.y,i,o)-i)/(o-i)*(this.position.h-this._box.h)}this.setTranslate(t,e)},n.prototype.setTranslate=function(t,e){var r=this.position.w-this._box.w,n=this.position.h-this._box.h;if(t=l.constrain(t||0,0,r),e=l.constrain(e||0,0,n),this.translateX=t,this.translateY=e,this.container.call(o.setTranslate,this._box.l-this.position.l-t,this._box.t-this.position.t-e),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+t-.5),y:Math.floor(this.position.t+e-.5)}),this.hbar){var a=t/r;this.hbar.call(o.setTranslate,t+a*this._hbarTranslateMax,e)}if(this.vbar){var i=e/n;this.vbar.call(o.setTranslate,t,e+i*this._vbarTranslateMax)}}},{"../../lib":149,"../color":34,"../drawing":58,d3:7}],131:[function(t,e,r){"use strict";e.exports={FROM_BL:{left:0,center:.5,right:1,bottom:0,middle:.5,top:1},FROM_TL:{left:0,center:.5,right:1,bottom:1,middle:.5,top:0},LINE_SPACING:1.3,MID_SHIFT:.35}},{}],132:[function(t,e,r){"use strict";e.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DBLCLICKDELAY:300,DESELECTDIM:.2}},{}],133:[function(t,e,r){"use strict";e.exports={BADNUM:void 0,FP_SAFE:Number.MAX_VALUE/1e4,ONEAVGYEAR:315576e5,ONEAVGMONTH:26298e5,ONEDAY:864e5,ONEHOUR:36e5,ONEMIN:6e4,ONESEC:1e3,EPOCHJD:2440587.5,ALMOST_EQUAL:1-1e-6,MINUS_SIGN:"\u2212"}},{}],134:[function(t,e,r){"use strict";e.exports={entityToUnicode:{mu:"\u03bc","#956":"\u03bc",amp:"&","#28":"&",lt:"<","#60":"<",gt:">","#62":">",nbsp:"\xa0","#160":"\xa0",times:"\xd7","#215":"\xd7",plusmn:"\xb1","#177":"\xb1",deg:"\xb0","#176":"\xb0"}}},{}],135:[function(t,e,r){"use strict";r.xmlns="http://www.w3.org/2000/xmlns/",r.svg="http://www.w3.org/2000/svg",r.xlink="http://www.w3.org/1999/xlink",r.svgAttrs={xmlns:r.svg,"xmlns:xlink":r.xlink}},{}],136:[function(t,e,r){"use strict";var n=t("./plotly");r.version="1.31.2",t("es6-promise").polyfill(),t("../build/plotcss"),t("./fonts/mathjax_config"),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.extendTraces=n.extendTraces,r.prependTraces=n.prependTraces,r.addTraces=n.addTraces,r.deleteTraces=n.deleteTraces,r.moveTraces=n.moveTraces,r.purge=n.purge,r.setPlotConfig=t("./plot_api/set_plot_config"),r.register=t("./plot_api/register"),r.toImage=t("./plot_api/to_image"),r.downloadImage=t("./snapshot/download"),r.validate=t("./plot_api/validate"),r.addFrames=n.addFrames,r.deleteFrames=n.deleteFrames,r.animate=n.animate,r.register(t("./traces/scatter")),r.register([t("./components/fx"),t("./components/legend"),t("./components/annotations"),t("./components/annotations3d"),t("./components/shapes"),t("./components/images"),t("./components/updatemenus"),t("./components/sliders"),t("./components/rangeslider"),t("./components/rangeselector")]),r.Icons=t("../build/ploticon"),r.Plots=n.Plots,r.Fx=t("./components/fx"),r.Snapshot=t("./snapshot"),r.PlotSchema=t("./plot_api/plot_schema"),r.Queue=t("./lib/queue"),r.d3=t("d3")},{"../build/plotcss":1,"../build/ploticon":2,"./components/annotations":27,"./components/annotations3d":32,"./components/fx":75,"./components/images":83,"./components/legend":92,"./components/rangeselector":104,"./components/rangeslider":110,"./components/shapes":117,"./components/sliders":123,"./components/updatemenus":129,"./fonts/mathjax_config":137,"./lib/queue":162,"./plot_api/plot_schema":178,"./plot_api/register":179,"./plot_api/set_plot_config":180,"./plot_api/to_image":182,"./plot_api/validate":183,"./plotly":184,"./snapshot":230, "./snapshot/download":227,"./traces/scatter":271,d3:7,"es6-promise":8}],137:[function(t,e,r){"use strict";"undefined"!=typeof MathJax?(r.MathJax=!0,MathJax.Hub.Config({messageStyle:"none",skipStartupTypeset:!0,displayAlign:"left",tex2jax:{inlineMath:[["$","$"],["\\(","\\)"]]}}),MathJax.Hub.Configured()):r.MathJax=!1},{}],138:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../constants/numerical").BADNUM,i=/^['"%,$#\s']+|[, ]|['"%,$#\s']+$/g;e.exports=function(t){return"string"==typeof t&&(t=t.replace(i,"")),n(t)?Number(t):a}},{"../constants/numerical":133,"fast-isnumeric":10}],139:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("tinycolor2"),i=t("../plots/attributes"),o=t("../components/colorscale/get_scale"),l=(Object.keys(t("../components/colorscale/scales")),t("./nested_property")),s=t("./regex").counter;r.valObjectMeta={data_array:{coerceFunction:function(t,e,r){Array.isArray(t)?e.set(t):void 0!==r&&e.set(r)}},enumerated:{coerceFunction:function(t,e,r,n){n.coerceNumber&&(t=+t),-1===n.values.indexOf(t)?e.set(r):e.set(t)},validateFunction:function(t,e){e.coerceNumber&&(t=+t);for(var r=e.values,n=0;n<r.length;n++){var a=String(r[n]);if("/"===a.charAt(0)&&"/"===a.charAt(a.length-1)){if(new RegExp(a.substr(1,a.length-2)).test(t))return!0}else if(t===r[n])return!0}return!1}},boolean:{coerceFunction:function(t,e,r){!0===t||!1===t?e.set(t):e.set(r)}},number:{coerceFunction:function(t,e,r,a){!n(t)||void 0!==a.min&&t<a.min||void 0!==a.max&&t>a.max?e.set(r):e.set(+t)}},integer:{coerceFunction:function(t,e,r,a){t%1||!n(t)||void 0!==a.min&&t<a.min||void 0!==a.max&&t>a.max?e.set(r):e.set(+t)}},string:{coerceFunction:function(t,e,r,n){if("string"!=typeof t){var a="number"==typeof t;!0!==n.strict&&a?e.set(String(t)):e.set(r)}else n.noBlank&&!t?e.set(r):e.set(t)}},color:{coerceFunction:function(t,e,r){a(t).isValid()?e.set(t):e.set(r)}},colorscale:{coerceFunction:function(t,e,r){e.set(o(t,r))}},angle:{coerceFunction:function(t,e,r){"auto"===t?e.set("auto"):n(t)?(Math.abs(t)>180&&(t-=360*Math.round(t/360)),e.set(+t)):e.set(r)}},subplotid:{coerceFunction:function(t,e,r){if("string"==typeof t&&s(r).test(t))return void e.set(t);e.set(r)},validateFunction:function(t,e){var r=e.dflt;return t===r||"string"==typeof t&&!!s(r).test(t)}},flaglist:{coerceFunction:function(t,e,r,n){if("string"!=typeof t)return void e.set(r);if(-1!==(n.extras||[]).indexOf(t))return void e.set(t);for(var a=t.split("+"),i=0;i<a.length;){var o=a[i];-1===n.flags.indexOf(o)||a.indexOf(o)<i?a.splice(i,1):i++}a.length?e.set(a.join("+")):e.set(r)}},any:{coerceFunction:function(t,e,r){void 0===t?e.set(r):e.set(t)}},info_array:{coerceFunction:function(t,e,n,a){if(!Array.isArray(t))return void e.set(n);var i=a.items,o=[];n=Array.isArray(n)?n:[];for(var l=0;l<i.length;l++)r.coerce(t,o,i,"["+l+"]",n[l]);e.set(o)},validateFunction:function(t,e){if(!Array.isArray(t))return!1;var n=e.items;if(!e.freeLength&&t.length!==n.length)return!1;for(var a=0;a<t.length;a++){if(!r.validate(t[a],e.items[a]))return!1}return!0}}},r.coerce=function(t,e,n,a,i){var o=l(n,a).get(),s=l(t,a),c=l(e,a),u=s.get();return void 0===i&&(i=o.dflt),o.arrayOk&&Array.isArray(u)?(c.set(u),u):(r.valObjectMeta[o.valType].coerceFunction(u,c,i,o),c.get())},r.coerce2=function(t,e,n,a,i){var o=l(t,a),s=r.coerce(t,e,n,a,i),c=o.get();return void 0!==c&&null!==c&&s},r.coerceFont=function(t,e,r){var n={};return r=r||{},n.family=t(e+".family",r.family),n.size=t(e+".size",r.size),n.color=t(e+".color",r.color),n},r.coerceHoverinfo=function(t,e,n){var a,o=e._module.attributes,l=o.hoverinfo?{hoverinfo:o.hoverinfo}: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(t,e,l,"hoverinfo",a)},r.validate=function(t,e){var n=r.valObjectMeta[e.valType];if(e.arrayOk&&Array.isArray(t))return!0;if(n.validateFunction)return n.validateFunction(t,e);var a={},i=a,o={set:function(t){i=t}};return n.coerceFunction(t,o,a,e),i!==a}},{"../components/colorscale/get_scale":46,"../components/colorscale/scales":52,"../plots/attributes":187,"./nested_property":156,"./regex":163,"fast-isnumeric":10,tinycolor2:16}],140:[function(t,e,r){"use strict";function n(t){return t&&k.componentsRegistry.calendars&&"string"==typeof t&&"gregorian"!==t}function a(t,e){return String(t+Math.pow(10,e)).substr(1)}function i(t,e,r,n,i){if((e||r||n||i)&&(t+=" "+a(e,2)+":"+a(r,2),(n||i)&&(t+=":"+a(n,2),i))){for(var o=4;i%10==0;)o-=1,i/=10;t+="."+a(i,o)}return t}function o(t,e,r){t=t.replace(P,function(t){var r=Math.min(+t.charAt(1)||6,6);return(e/1e3%1+2).toFixed(r).substr(2).replace(/0+$/,"")||"0"});var a=new Date(Math.floor(e+.05));if(n(r))try{t=k.getComponentMethod("calendars","worldCalFmt")(t,e,r)}catch(t){return"Invalid"}return M(t)(a)}function l(t,e){var r=g(t+.05,m),n=a(Math.floor(r/x),2)+":"+a(g(Math.floor(r/b),60),2);if("M"!==e){p(e)||(e=0);var i=Math.min(g(t/_,60),E[e]),o=(100+i).toFixed(e).substr(1);e>0&&(o=o.replace(/0+$/,"").replace(/[\.]$/,"")),n+=":"+o}return n}function s(t){return t.formatDate("yyyy")}function c(t){return t.formatDate("M yyyy")}function u(t){return t.formatDate("M d")}function f(t){return t.formatDate("M d, yyyy")}var d=t("d3"),p=t("fast-isnumeric"),h=t("./loggers").error,g=t("./mod"),v=t("../constants/numerical"),y=v.BADNUM,m=v.ONEDAY,x=v.ONEHOUR,b=v.ONEMIN,_=v.ONESEC,w=v.EPOCHJD,k=t("../registry"),M=d.time.format.utc,A=/^\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,T=/^\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,L=(new Date).getFullYear()-70;r.dateTick0=function(t,e){return n(t)?e?k.getComponentMethod("calendars","CANONICAL_SUNDAY")[t]:k.getComponentMethod("calendars","CANONICAL_TICK")[t]:e?"2000-01-02":"2000-01-01"},r.dfltRange=function(t){return n(t)?k.getComponentMethod("calendars","DFLTRANGE")[t]:["2000-01-01","2001-01-01"]},r.isJSDate=function(t){return"object"==typeof t&&null!==t&&"function"==typeof t.getTime};var C,S;r.dateTime2ms=function(t,e){if(r.isJSDate(t))return t=Number(t)-t.getTimezoneOffset()*b,t>=C&&t<=S?t:y;if("string"!=typeof t&&"number"!=typeof t)return y;t=String(t);var a=n(e),i=t.charAt(0);!a||"G"!==i&&"g"!==i||(t=t.substr(1),e="");var o=a&&"chinese"===e.substr(0,7),l=t.match(o?T:A);if(!l)return y;var s=l[1],c=l[3]||"1",u=Number(l[5]||1),f=Number(l[7]||0),d=Number(l[9]||0),p=Number(l[11]||0);if(a){if(2===s.length)return y;s=Number(s);var h;try{var g=k.getComponentMethod("calendars","getCal")(e);if(o){var v="i"===c.charAt(c.length-1);c=parseInt(c,10),h=g.newDate(s,g.toMonthIndex(s,c,v),u)}else h=g.newDate(s,Number(c),u)}catch(t){return y}return h?(h.toJD()-w)*m+f*x+d*b+p*_:y}s=2===s.length?(Number(s)+2e3-L)%100+L:Number(s),c-=1;var M=new Date(Date.UTC(2e3,c,u,f,d));return M.setUTCFullYear(s),M.getUTCMonth()!==c?y:M.getUTCDate()!==u?y:M.getTime()+p*_},C=r.MIN_MS=r.dateTime2ms("-9999"),S=r.MAX_MS=r.dateTime2ms("9999-12-31 23:59:59.9999"),r.isDateTime=function(t,e){return r.dateTime2ms(t,e)!==y};var O=90*m,z=3*x,D=5*b;r.ms2DateTime=function(t,e,r){if("number"!=typeof t||!(t>=C&&t<=S))return y;e||(e=0);var a,o,l,s,c,u,f=Math.floor(10*g(t+.05,1)),d=Math.round(t-f/10);if(n(r)){var p=Math.floor(d/m)+w,h=Math.floor(g(t,m));try{a=k.getComponentMethod("calendars","getCal")(r).fromJD(p).formatDate("yyyy-mm-dd")}catch(t){a=M("G%Y-%m-%d")(new Date(d))}if("-"===a.charAt(0))for(;a.length<11;)a="-0"+a.substr(1);else for(;a.length<10;)a="0"+a;o=e<O?Math.floor(h/x):0,l=e<O?Math.floor(h%x/b):0,s=e<z?Math.floor(h%b/_):0,c=e<D?h%_*10+f:0}else u=new Date(d),a=M("%Y-%m-%d")(u),o=e<O?u.getUTCHours():0,l=e<O?u.getUTCMinutes():0,s=e<z?u.getUTCSeconds():0,c=e<D?10*u.getUTCMilliseconds()+f:0;return i(a,o,l,s,c)},r.ms2DateTimeLocal=function(t){if(!(t>=C+m&&t<=S-m))return y;var e=Math.floor(10*g(t+.05,1)),r=new Date(Math.round(t-e/10));return i(d.time.format("%Y-%m-%d")(r),r.getHours(),r.getMinutes(),r.getSeconds(),10*r.getUTCMilliseconds()+e)},r.cleanDate=function(t,e,a){if(r.isJSDate(t)||"number"==typeof t){if(n(a))return h("JS Dates and milliseconds are incompatible with world calendars",t),e;if(!(t=r.ms2DateTimeLocal(+t))&&void 0!==e)return e}else if(!r.isDateTime(t,a))return h("unrecognized date",t),e;return t};var P=/%\d?f/g,E=[59,59.9,59.99,59.999,59.9999],N=M("%Y"),I=M("%b %Y"),R=M("%b %-d"),F=M("%b %-d, %Y");r.formatDate=function(t,e,r,a){var i,d;if(a=n(a)&&a,e)return o(e,t,a);if(a)try{var p=Math.floor((t+.05)/m)+w,h=k.getComponentMethod("calendars","getCal")(a).fromJD(p);"y"===r?d=s(h):"m"===r?d=c(h):"d"===r?(i=s(h),d=u(h)):(i=f(h),d=l(t,r))}catch(t){return"Invalid"}else{var g=new Date(Math.floor(t+.05));"y"===r?d=N(g):"m"===r?d=I(g):"d"===r?(i=N(g),d=R(g)):(i=F(g),d=l(t,r))}return d+(i?"\n"+i:"")};var j=3*m;r.incrementMonth=function(t,e,r){r=n(r)&&r;var a=g(t,m);if(t=Math.round(t-a),r)try{var i=Math.round(t/m)+w,o=k.getComponentMethod("calendars","getCal")(r),l=o.fromJD(i);return e%12?o.add(l,e,"m"):o.add(l,e/12,"y"),(l.toJD()-w)*m+a}catch(e){h("invalid ms "+t+" in calendar "+r)}var s=new Date(t+j);return s.setUTCMonth(s.getUTCMonth()+e)+a-j},r.findExactDates=function(t,e){for(var r,a,i=0,o=0,l=0,s=0,c=n(e)&&k.getComponentMethod("calendars","getCal")(e),u=0;u<t.length;u++)if(a=t[u],p(a)){if(!(a%m))if(c)try{r=c.fromJD(a/m+w),1===r.day()?1===r.month()?i++:o++:l++}catch(t){}else r=new Date(a),1===r.getUTCDate()?0===r.getUTCMonth()?i++:o++:l++}else s++;o+=i,l+=o;var f=t.length-s;return{exactYears:i/f,exactMonths:o/f,exactDays:l/f}}},{"../constants/numerical":133,"../registry":225,"./loggers":153,"./mod":155,d3:7,"fast-isnumeric":10}],141:[function(t,e,r){"use strict";e.exports=function(t,e){return Array.isArray(t)||(t=[]),t.length=e,t}},{}],142:[function(t,e,r){"use strict";var n=t("events").EventEmitter,a={init:function(t){if(t._ev instanceof n)return t;var e=new n,r=new n;return t._ev=e,t._internalEv=r,t.on=e.on.bind(e),t.once=e.once.bind(e),t.removeListener=e.removeListener.bind(e),t.removeAllListeners=e.removeAllListeners.bind(e),t._internalOn=r.on.bind(r),t._internalOnce=r.once.bind(r),t._removeInternalListener=r.removeListener.bind(r),t._removeAllInternalListeners=r.removeAllListeners.bind(r),t.emit=function(n,a){"undefined"!=typeof jQuery&&jQuery(t).trigger(n,a),e.emit(n,a),r.emit(n,a)},t},triggerHandler:function(t,e,r){var n,a;"undefined"!=typeof jQuery&&(n=jQuery(t).triggerHandler(e,r));var i=t._ev;if(!i)return n;var o=i._events[e];if(!o)return n;"function"==typeof o&&(o=[o]);for(var l=o.pop(),s=0;s<o.length;s++)o[s](r);return a=l(r),void 0!==n?n:a},purge:function(t){return delete t._ev,delete t.on,delete t.once,delete t.removeListener,delete t.removeAllListeners,delete t.emit,delete t._ev,delete t._internalEv,delete t._internalOn,delete t._internalOnce,delete t._removeInternalListener,delete t._removeAllInternalListeners,t}};e.exports=a},{events:9}],143:[function(t,e,r){"use strict";function n(t,e){var r,n;for(r=0;r<t.length;r++){if(null!==(n=t[r])&&"object"==typeof n)return!1;void 0!==n&&(e[r]=n)}return!0}function a(t,e,r,l){var s,c,u,f,d,p,h=t[0],g=t.length;if(2===g&&o(h)&&o(t[1])&&0===h.length){if(n(t[1],h))return h;h.splice(0,h.length)}for(var v=1;v<g;v++){s=t[v];for(c in s)u=h[c],f=s[c],l&&o(f)?h[c]=f:e&&f&&(i(f)||(d=o(f)))?(d?(d=!1,p=u&&o(u)?u:[]):p=u&&i(u)?u:{},h[c]=a([p,f],e,r,l)):(void 0!==f||r)&&(h[c]=f)}return h}var i=t("./is_plain_object.js"),o=Array.isArray;r.extendFlat=function(){return a(arguments,!1,!1,!1)},r.extendDeep=function(){return a(arguments,!0,!1,!1)},r.extendDeepAll=function(){return a(arguments,!0,!0,!1)},r.extendDeepNoArrays=function(){return a(arguments,!0,!1,!0)}},{"./is_plain_object.js":151}],144:[function(t,e,r){"use strict";e.exports=function(t){for(var e={},r=[],n=0,a=0;a<t.length;a++){var i=t[a];1!==e[i]&&(e[i]=1,r[n++]=i)}return r}},{}],145:[function(t,e,r){"use strict";e.exports=function(t){for(var e=[],r=0;r<t.length;r++){var n=t[r];!0===n.visible&&e.push(n)}return e}},{}],146:[function(t,e,r){"use strict";function n(t,e,r,n,a,i,o,l){var s=r-t,c=a-t,u=o-a,f=n-e,d=i-e,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:t+s*g,y:e+f*g}}function a(t,e,r,n,a){var i=n*t+a*e;if(i<0)return n*n+a*a;if(i>r){var o=n-t,l=a-e;return o*o+l*l}var s=n*e-a*t;return s*s/r}var i=t("./mod");r.segmentsIntersect=n,r.segmentDistance=function(t,e,r,i,o,l,s,c){if(n(t,e,r,i,o,l,s,c))return 0;var u=r-t,f=i-e,d=s-o,p=c-l,h=u*u+f*f,g=d*d+p*p,v=Math.min(a(u,f,h,o-t,l-e),a(u,f,h,s-t,c-e),a(d,p,g,t-o,e-l),a(d,p,g,r-o,i-l));return Math.sqrt(v)};var o,l,s;r.getTextLocation=function(t,e,r,n){if(t===l&&n===s||(o={},l=t,s=n),o[r])return o[r];var a=t.getPointAtLength(i(r-n/2,e)),c=t.getPointAtLength(i(r+n/2,e)),u=Math.atan((c.y-a.y)/(c.x-a.x)),f=t.getPointAtLength(i(r,e)),d=(4*f.x+a.x+c.x)/6,p=(4*f.y+a.y+c.y)/6,h={x:d,y:p,theta:u};return o[r]=h,h},r.clearLocationCache=function(){l=null},r.getVisibleSegment=function(t,e,r){function n(e){var r=t.getPointAtLength(e);0===e?a=r:e===f&&(i=r);var n=r.x<o?o-r.x:r.x>l?r.x-l:0,u=r.y<s?s-r.y:r.y>c?r.y-c:0;return Math.sqrt(n*n+u*u)}for(var a,i,o=e.left,l=e.right,s=e.top,c=e.bottom,u=0,f=t.getTotalLength(),d=f,p=n(u);p;){if((u+=p+r)>d)return;p=n(u)}for(p=n(d);p;){if(d-=p+r,u>d)return;p=n(d)}return{min:u,max:d,len:d-u,total:f,isClosed:0===u&&d===f&&Math.abs(a.x-i.x)<.1&&Math.abs(a.y-i.y)<.1}}},{"./mod":155}],147:[function(t,e,r){"use strict";e.exports=function(t){var e;if("string"==typeof t){if(null===(e=document.getElementById(t)))throw new Error("No DOM element with id '"+t+"' exists on the page.");return e}if(null===t||void 0===t)throw new Error("DOM element provided is null or undefined");return t}},{}],148:[function(t,e,r){"use strict";e.exports=function(t){return t}},{}],149:[function(t,e,r){"use strict";var n=t("d3"),a=t("fast-isnumeric"),i=t("../constants/numerical"),o=i.FP_SAFE,l=i.BADNUM,s=e.exports={};s.nestedProperty=t("./nested_property"),s.keyedContainer=t("./keyed_container"),s.relativeAttr=t("./relative_attr"),s.isPlainObject=t("./is_plain_object"),s.isArray=t("./is_array"),s.mod=t("./mod"),s.toLogRange=t("./to_log_range"),s.relinkPrivateKeys=t("./relink_private"),s.ensureArray=t("./ensure_array");var c=t("./coerce");s.valObjectMeta=c.valObjectMeta,s.coerce=c.coerce,s.coerce2=c.coerce2,s.coerceFont=c.coerceFont,s.coerceHoverinfo=c.coerceHoverinfo,s.validate=c.validate;var u=t("./dates");s.dateTime2ms=u.dateTime2ms,s.isDateTime=u.isDateTime,s.ms2DateTime=u.ms2DateTime,s.ms2DateTimeLocal=u.ms2DateTimeLocal,s.cleanDate=u.cleanDate,s.isJSDate=u.isJSDate,s.formatDate=u.formatDate,s.incrementMonth=u.incrementMonth,s.dateTick0=u.dateTick0,s.dfltRange=u.dfltRange,s.findExactDates=u.findExactDates,s.MIN_MS=u.MIN_MS,s.MAX_MS=u.MAX_MS;var f=t("./search");s.findBin=f.findBin,s.sorterAsc=f.sorterAsc,s.sorterDes=f.sorterDes,s.distinctVals=f.distinctVals,s.roundUp=f.roundUp;var d=t("./stats");s.aggNums=d.aggNums,s.len=d.len,s.mean=d.mean,s.variance=d.variance,s.stdev=d.stdev,s.interp=d.interp;var p=t("./matrix");s.init2dArray=p.init2dArray,s.transposeRagged=p.transposeRagged,s.dot=p.dot,s.translationMatrix=p.translationMatrix,s.rotationMatrix=p.rotationMatrix,s.rotationXYMatrix=p.rotationXYMatrix,s.apply2DTransform=p.apply2DTransform,s.apply2DTransform2=p.apply2DTransform2;var h=t("./geometry2d");s.segmentsIntersect=h.segmentsIntersect,s.segmentDistance=h.segmentDistance,s.getTextLocation=h.getTextLocation,s.clearLocationCache=h.clearLocationCache,s.getVisibleSegment=h.getVisibleSegment;var g=t("./extend");s.extendFlat=g.extendFlat,s.extendDeep=g.extendDeep,s.extendDeepAll=g.extendDeepAll,s.extendDeepNoArrays=g.extendDeepNoArrays;var v=t("./loggers");s.log=v.log,s.warn=v.warn,s.error=v.error;var y=t("./regex");s.counterRegex=y.counter;var m=t("./throttle");s.throttle=m.throttle,s.throttleDone=m.done,s.clearThrottle=m.clear,s.getGraphDiv=t("./get_graph_div"),s.notifier=t("./notifier"),s.filterUnique=t("./filter_unique"),s.filterVisible=t("./filter_visible"),s.pushUnique=t("./push_unique"),s.cleanNumber=t("./clean_number"),s.ensureNumber=function(t){return a(t)?(t=Number(t),t<-o||t>o?l:a(t)?Number(t):l):l},s.noop=t("./noop"),s.identity=t("./identity"),s.swapAttrs=function(t,e,r,n){r||(r="x"),n||(n="y");for(var a=0;a<e.length;a++){var i=e[a],o=s.nestedProperty(t,i.replace("?",r)),l=s.nestedProperty(t,i.replace("?",n)),c=o.get();o.set(l.get()),l.set(c)}},s.pauseEvent=function(t){return t.stopPropagation&&t.stopPropagation(),t.preventDefault&&t.preventDefault(),t.cancelBubble=!0,!1},s.raiseToTop=function(t){t.parentNode.appendChild(t)},s.cancelTransition=function(t){return t.transition().duration(0)},s.constrain=function(t,e,r){return e>r?Math.max(r,Math.min(e,t)):Math.max(e,Math.min(r,t))},s.bBoxIntersect=function(t,e,r){return r=r||0,t.left<=e.right+r&&e.left<=t.right+r&&t.top<=e.bottom+r&&e.top<=t.bottom+r},s.simpleMap=function(t,e,r,n){for(var a=t.length,i=new Array(a),o=0;o<a;o++)i[o]=e(t[o],r,n);return i},s.randstr=function t(e,r,n){if(n||(n=16),void 0===r&&(r=24),r<=0)return"0";var a,i,o,l=Math.log(Math.pow(2,r))/Math.log(n),s="";for(a=2;l===1/0;a*=2)l=Math.log(Math.pow(2,r/a))/Math.log(n)*a;var c=l-Math.floor(l);for(a=0;a<Math.floor(l);a++)o=Math.floor(Math.random()*n).toString(n),s=o+s;c&&(i=Math.pow(n,c),o=Math.floor(Math.random()*i).toString(n),s=o+s);var u=parseInt(s,n);return e&&e.indexOf(s)>-1||u!==1/0&&u>=Math.pow(2,r)?t(e,r,n):s},s.OptionControl=function(t,e){t||(t={}),e||(e="opt");var r={};return r.optionList=[],r._newoption=function(n){n[e]=t,r[n.name]=n,r.optionList.push(n)},r["_"+e]=t,r},s.smooth=function(t,e){if((e=Math.round(e)||0)<2)return t;var r,n,a,i,o=t.length,l=2*o,s=2*e-1,c=new Array(s),u=new Array(o);for(r=0;r<s;r++)c[r]=(1-Math.cos(Math.PI*(r+1)/e))/(2*e);for(r=0;r<o;r++){for(i=0,n=0;n<s;n++)a=r+n+1-e,a<-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+=t[a]*c[n];u[r]=i}return u},s.syncOrAsync=function(t,e,r){function n(){return s.syncOrAsync(t,e,r)}for(var a,i;t.length;)if(i=t.splice(0,1)[0],(a=i(e))&&a.then)return a.then(n).then(void 0,s.promiseError);return r&&r(e)},s.stripTrailingSlash=function(t){return"/"===t.substr(-1)?t.substr(0,t.length-1):t},s.noneOrAll=function(t,e,r){if(t){var n,a,i=!1,o=!0;for(n=0;n<r.length;n++)a=t[r[n]],void 0!==a&&null!==a?i=!0:o=!1;if(i&&!o)for(n=0;n<r.length;n++)t[r[n]]=e[r[n]]}},s.mergeArray=function(t,e,r){if(Array.isArray(t))for(var n=Math.min(t.length,e.length),a=0;a<n;a++)e[a][r]=t[a]},s.fillArray=function(t,e,r,n){if(n=n||s.identity,Array.isArray(t))for(var a=0;a<e.length;a++)e[a][r]=n(t[a])},s.castOption=function(t,e,r,n){n=n||s.identity;var a=s.nestedProperty(t,r).get();return Array.isArray(a)?n(Array.isArray(e)&&Array.isArray(a[e[0]])?a[e[0]][e[1]]:a[e]):a},s.extractOption=function(t,e,r,n){if(r in t)return t[r];var a=s.nestedProperty(e,n).get();return Array.isArray(a)?void 0:a},s.getTargetArray=function(t,e){var r=e.target;if("string"==typeof r&&r){var n=s.nestedProperty(t,r).get();return!!Array.isArray(n)&&n}return!!Array.isArray(r)&&r},s.minExtend=function(t,e){var r={};"object"!=typeof e&&(e={});var n,a,i,o=Object.keys(t);for(n=0;n<o.length;n++)a=o[n],i=t[a],"_"!==a.charAt(0)&&"function"!=typeof i&&("module"===a?r[a]=i:Array.isArray(i)?r[a]=i.slice(0,3):r[a]=i&&"object"==typeof i?s.minExtend(t[a],e[a]):i);for(o=Object.keys(e),n=0;n<o.length;n++)a=o[n],"object"==typeof(i=e[a])&&a in r&&"object"==typeof r[a]||(r[a]=i);return r},s.titleCase=function(t){return t.charAt(0).toUpperCase()+t.substr(1)},s.containsAny=function(t,e){for(var r=0;r<e.length;r++)if(-1!==t.indexOf(e[r]))return!0;return!1},s.isPlotDiv=function(t){var e=n.select(t);return e.node()instanceof HTMLElement&&e.size()&&e.classed("js-plotly-plot")},s.removeElement=function(t){var e=t&&t.parentNode;e&&e.removeChild(t)},s.addStyleRule=function(t,e){if(!s.styleSheet){var r=document.createElement("style");r.appendChild(document.createTextNode("")),document.head.appendChild(r),s.styleSheet=r.sheet}var n=s.styleSheet;n.insertRule?n.insertRule(t+"{"+e+"}",0):n.addRule?n.addRule(t,e,0):s.warn("addStyleRule failed")},s.isIE=function(){return void 0!==window.navigator.msSaveBlob},s.isD3Selection=function(t){return t&&"function"==typeof t.classed},s.objectFromPath=function(t,e){for(var r,n=t.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]=e:r[l]={},r=r[l]):(i===n.length-1?r[o]=e:r[o]={},r=r[o])}return a};var x=/^([^\[\.]+)\.(.+)?/,b=/^([^\.]+)\[([0-9]+)\](\.)?(.+)?/;s.expandObjectPaths=function(t){var e,r,n,a,i,o,l;if("object"==typeof t&&!Array.isArray(t))for(r in t)t.hasOwnProperty(r)&&((e=r.match(x))?(a=t[r],n=e[1],delete t[r],t[n]=s.extendDeepNoArrays(t[n]||{},s.objectFromPath(r,s.expandObjectPaths(a))[n])):(e=r.match(b))?(a=t[r],n=e[1],i=parseInt(e[2]),delete t[r],t[n]=t[n]||[],"."===e[3]?(l=e[4],o=t[n][i]=t[n][i]||{},s.extendDeepNoArrays(o,s.objectFromPath(l,s.expandObjectPaths(a)))):t[n][i]=s.expandObjectPaths(a)):t[r]=s.expandObjectPaths(t[r]));return t},s.numSeparate=function(t,e,r){if(r||(r=!1),"string"!=typeof e||0===e.length)throw new Error("Separator string required for formatting!");"number"==typeof t&&(t=String(t));var n=/(\d+)(\d{3})/,a=e.charAt(0),i=e.charAt(1),o=t.split("."),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};var _=/%{([^\s%{}]*)}/g,w=/^\w*$/;s.templateString=function(t,e){var r={};return t.replace(_,function(t,n){return w.test(n)?e[n]||"":(r[n]=r[n]||s.nestedProperty(e,n).get,r[n]()||"")})}},{"../constants/numerical":133,"./clean_number":138,"./coerce":139,"./dates":140,"./ensure_array":141,"./extend":143,"./filter_unique":144,"./filter_visible":145,"./geometry2d":146,"./get_graph_div":147,"./identity":148,"./is_array":150,"./is_plain_object":151,"./keyed_container":152,"./loggers":153,"./matrix":154,"./mod":155,"./nested_property":156,"./noop":157,"./notifier":158,"./push_unique":161,"./regex":163,"./relative_attr":164,"./relink_private":165,"./search":166,"./stats":168,"./throttle":170,"./to_log_range":171,d3:7,"fast-isnumeric":10}],150:[function(t,e,r){"use strict";var n="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer:{isView:function(){return!1}};e.exports=function(t){return Array.isArray(t)||n.isView(t)}},{}],151:[function(t,e,r){"use strict";e.exports=function(t){return window&&window.process&&window.process.versions?"[object Object]"===Object.prototype.toString.call(t):"[object Object]"===Object.prototype.toString.call(t)&&Object.getPrototypeOf(t)===Object.prototype}},{}],152:[function(t,e,r){"use strict";var n=t("./nested_property"),a=/^\w*$/;e.exports=function(t,e,r,i){r=r||"name",i=i||"value";var o,l,s={};l=e&&e.length?n(t,e).get():t,e=e||"",l=l||[];var c={};for(o=0;o<l.length;o++)c[l[o][r]]=o;var u=a.test(i),f={set:function(t,e){var a=null===e?4:0,o=c[t];void 0===o?(a|=3,o=l.length,c[t]=o):e!==(u?l[o][i]:n(l[o],i).get())&&(a|=2);var d=l[o]=l[o]||{};return d[r]=t,u?d[i]=e:n(d,i).set(e),null!==e&&(a&=-5),s[o]=s[o]|a,f},get:function(t){var e=c[t];return void 0===e?void 0:u?l[e][i]:n(l[e],i).get()},rename:function(t,e){var n=c[t];return void 0===n?f:(s[n]=1|s[n],c[e]=n,delete c[t],l[n][r]=e,f)},remove:function(t){var e=c[t];if(void 0===e)return f;var a=l[e];if(Object.keys(a).length>2)return s[e]=2|s[e],f.set(t,null);if(u){for(o=e;o<l.length;o++)s[o]=3|s[o];for(o=e;o<l.length;o++)c[l[o][r]]--;l.splice(e,1),delete c[t]}else n(a,i).set(null),s[e]=6|s[e];return f},constructUpdate:function(){for(var t,a,o={},c=Object.keys(s),f=0;f<c.length;f++)a=c[f],t=e+"["+a+"]",l[a]?(1&s[a]&&(o[t+"."+r]=l[a][r]),2&s[a]&&(o[t+"."+i]=u?4&s[a]?null:l[a][i]:4&s[a]?null:n(l[a],i).get())):o[t]=null;return o}};return f}},{"./nested_property":156}],153:[function(t,e,r){"use strict";function n(t,e){if(t.apply)t.apply(t,e);else for(var r=0;r<e.length;r++)t(e[r])}var a=t("../plot_api/plot_config"),i=e.exports={};i.log=function(){if(a.logging>1){for(var t=["LOG:"],e=0;e<arguments.length;e++)t.push(arguments[e]);n(console.trace||console.log,t)}},i.warn=function(){if(a.logging>0){for(var t=["WARN:"],e=0;e<arguments.length;e++)t.push(arguments[e]);n(console.trace||console.log,t)}},i.error=function(){if(a.logging>0){for(var t=["ERROR:"],e=0;e<arguments.length;e++)t.push(arguments[e]);n(console.error,t)}}},{"../plot_api/plot_config":177}],154:[function(t,e,r){"use strict";r.init2dArray=function(t,e){for(var r=new Array(t),n=0;n<t;n++)r[n]=new Array(e);return r},r.transposeRagged=function(t){var e,r,n=0,a=t.length;for(e=0;e<a;e++)n=Math.max(n,t[e].length);var i=new Array(n);for(e=0;e<n;e++)for(i[e]=new Array(a),r=0;r<a;r++)i[e][r]=t[r][e];return i},r.dot=function(t,e){if(!t.length||!e.length||t.length!==e.length)return null;var n,a,i=t.length;if(t[0].length)for(n=new Array(i),a=0;a<i;a++)n[a]=r.dot(t[a],e);else if(e[0].length){var o=r.transposeRagged(e);for(n=new Array(o.length),a=0;a<o.length;a++)n[a]=r.dot(t,o[a])}else for(n=0,a=0;a<i;a++)n+=t[a]*e[a];return n},r.translationMatrix=function(t,e){return[[1,0,t],[0,1,e],[0,0,1]]},r.rotationMatrix=function(t){var e=t*Math.PI/180;return[[Math.cos(e),-Math.sin(e),0],[Math.sin(e),Math.cos(e),0],[0,0,1]]},r.rotationXYMatrix=function(t,e,n){return r.dot(r.dot(r.translationMatrix(e,n),r.rotationMatrix(t)),r.translationMatrix(-e,-n))},r.apply2DTransform=function(t){return function(){var e=arguments;3===e.length&&(e=e[0]);var n=1===arguments.length?e[0]:[e[0],e[1]];return r.dot(t,[n[0],n[1],1]).slice(0,2)}},r.apply2DTransform2=function(t){var e=r.apply2DTransform(t);return function(t){return e(t.slice(0,2)).concat(e(t.slice(2,4)))}}},{}],155:[function(t,e,r){"use strict";e.exports=function(t,e){var r=t%e;return r<0?r+e:r}},{}],156:[function(t,e,r){"use strict";function n(t,e){return function(){var r,a,i,o,l,s=t;for(o=0;o<e.length-1;o++){if(-1===(r=e[o])){for(a=!0,i=[],l=0;l<s.length;l++)i[l]=n(s[l],e.slice(o+1))(),i[l]!==i[0]&&(a=!1);return a?i[0]:i}if("number"==typeof r&&!p(s))return;if("object"!=typeof(s=s[r])||null===s)return}if("object"==typeof s&&null!==s&&null!==(i=s[e[o]]))return i}}function a(t,e){if(!u(t)||h(t)&&"]"===e.charAt(e.length-1)||e.match(y)&&void 0!==t)return!1;if(!p(t))return!0;if(e.match(v))return!0;var r=g(e);return r&&""===r.index}function i(t,e,r){return function(n){var i,u,f=t,d="",h=t,d,g=a(n,r);for(u=0;u<e.length-1;u++){if("number"==typeof(i=e[u])&&!p(f))throw"array index but container is not an array";if(-1===i){if(g=!l(f,e.slice(u+1),n,r))break;return}if(!s(f,i,e[u+1],g))break;if("object"!=typeof(f=f[i])||null===f)throw"container is not an object";d=o(d,i),h.push([f,d])}g?(u===e.length-1&&delete f[e[u]],c(h)):f[e[u]]=n}}function o(t,e){var r=e;return d(e)?r="["+e+"]":t&&(r="."+e),t+r}function l(t,e,r,n){var o,l=p(r),c=!0,u=r,f=n.replace("-1",0),d=!l&&a(r,f),h=e[0];for(o=0;o<t.length;o++)f=n.replace("-1",o),l&&(u=r[o%r.length],d=a(u,f)),d&&(c=!1),s(t,o,h,d)&&i(t[o],e,n.replace("-1",o))(u);return c}function s(t,e,r,n){if(void 0===t[e]){if(n)return!1;t[e]="number"==typeof r?[]:{}}return!0}function c(t){var e,r,n,i,l,s;for(e=t.length-1;e>=0;e--){if(n=t[e][0],i=t[e][1],s=!1,p(n))for(r=n.length-1;r>=0;r--)a(n[r],o(i,r))?s?n[r]=void 0:n.pop():s=!0;else if("object"==typeof n&&null!==n)for(l=Object.keys(n),s=!1,r=l.length-1;r>=0;r--)a(n[l[r]],o(i,l[r]))?delete n[l[r]]:s=!0;if(s)return}}function u(t){return void 0===t||null===t||"object"==typeof t&&(p(t)?!t.length:!Object.keys(t).length)}function f(t,e,r){return{set:function(){throw"bad container"},get:function(){},astr:e,parts:r,obj:t}}var d=t("fast-isnumeric"),p=t("./is_array"),h=t("./is_plain_object"),g=t("../plot_api/container_array_match");e.exports=function(t,e){if(d(e))e=String(e);else if("string"!=typeof e||"[-1]"===e.substr(e.length-4))throw"bad property string";for(var r,a,o,l=0,s=e.split(".");l<s.length;){if(r=String(s[l]).match(/^([^\[\]]*)((\[\-?[0-9]*\])+)$/)){if(r[1])s[l]=r[1];else{if(0!==l)throw"bad property string";s.splice(0,1)}for(a=r[2].substr(1,r[2].length-2).split("]["),o=0;o<a.length;o++)l++,s.splice(l,0,Number(a[o]))}l++}return"object"!=typeof t?f(t,e,s):{set:i(t,s,e),get:n(t,s),astr:e,parts:s,obj:t}};var v=/(^|\.)((domain|range)(\.[xy])?|args|parallels)$/,y=/(^|\.)args\[/},{"../plot_api/container_array_match":172,"./is_array":150,"./is_plain_object":151,"fast-isnumeric":10}],157:[function(t,e,r){"use strict";e.exports=function(){}},{}],158:[function(t,e,r){"use strict";var n=t("d3"),a=t("fast-isnumeric"),i=[];e.exports=function(t,e){function r(t){t.duration(700).style("opacity",0).each("end",function(t){var e=i.indexOf(t);-1!==e&&i.splice(e,1),n.select(this).remove()})}if(-1===i.indexOf(t)){i.push(t);var o=1e3;a(e)?o=e:"long"===e&&(o=3e3);var l=n.select("body").selectAll(".plotly-notifier").data([0]);l.enter().append("div").classed("plotly-notifier",!0);l.selectAll(".notifier-note").data(i).enter().append("div").classed("notifier-note",!0).style("opacity",0).each(function(t){var e=n.select(this);e.append("button").classed("notifier-close",!0).html("×").on("click",function(){e.transition().call(r)});for(var a=e.append("p"),i=t.split(/<br\s*\/?>/g),l=0;l<i.length;l++)l&&a.append("br"),a.append("span").text(i[l]);e.transition().duration(700).style("opacity",1).transition().delay(o).call(r)})}}},{d3:7,"fast-isnumeric":10}],159:[function(t,e,r){"use strict";var n=t("./setcursor"),a="data-savedcursor";e.exports=function(t,e){var r=t.attr(a);if(e){if(!r){for(var i=(t.attr("class")||"").split(" "),o=0;o<i.length;o++){var l=i[o];0===l.indexOf("cursor-")&&t.attr(a,l.substr(7)).classed(l,!1)}t.attr(a)||t.attr(a,"!!")}n(t,e)}else r&&(t.attr(a,null),"!!"===r?n(t):n(t,r))}},{"./setcursor":167}],160:[function(t,e,r){"use strict";var n=t("./matrix").dot,a=t("../constants/numerical").BADNUM,i=e.exports={};i.tester=function(t){function e(t,e){var r=t[0],n=t[1];return!(r===a||r<i||r>o||n===a||n<l||n>s)&&(!e||!u(t))}function r(t,e){var r=t[0],c=t[1];if(r===a||r<i||r>o||c===a||c<l||c>s)return!1;var u,f,d,p,h,g=n.length,v=n[0][0],y=n[0][1],m=0;for(u=1;u<g;u++)if(f=v,d=y,v=n[u][0],y=n[u][1],p=Math.min(f,v),!(r<p||r>Math.max(f,v)||c>Math.max(d,y)))if(c<Math.min(d,y))r!==p&&m++;else{if(h=v===f?c:d+(r-f)*(y-d)/(v-f),c===h)return 1!==u||!e;c<=h&&r!==p&&m++}return m%2==1}var n=t.slice(),i=n[0][0],o=i,l=n[0][1],s=l;n.push(n[0]);for(var c=1;c<n.length;c++)i=Math.min(i,n[c][0]),o=Math.max(o,n[c][0]),l=Math.min(l,n[c][1]),s=Math.max(s,n[c][1]);var u,f=!1;return 5===n.length&&(n[0][0]===n[1][0]?n[2][0]===n[3][0]&&n[0][1]===n[3][1]&&n[1][1]===n[2][1]&&(f=!0,u=function(t){return t[0]===n[0][0]}):n[0][1]===n[1][1]&&n[2][1]===n[3][1]&&n[0][0]===n[3][0]&&n[1][0]===n[2][0]&&(f=!0,u=function(t){return t[1]===n[0][1]})),{xmin:i,xmax:o,ymin:l,ymax:s,pts:n,contains:f?e:r,isRect:f}};var o=i.isSegmentBent=function(t,e,r,a){var i,o,l,s=t[e],c=[t[r][0]-s[0],t[r][1]-s[1]],u=n(c,c),f=Math.sqrt(u),d=[-c[1]/f,c[0]/f];for(i=e+1;i<r;i++)if(o=[t[i][0]-s[0],t[i][1]-s[1]],(l=n(o,c))<0||l>u||Math.abs(n(o,d))>a)return!0;return!1};i.filter=function(t,e){function r(r){t.push(r);var l=n.length,s=a;n.splice(i+1);for(var c=s+1;c<t.length;c++)(c===t.length-1||o(t,s,c+1,e))&&(n.push(t[c]),n.length<l-2&&(a=c,i=n.length-1),s=c)}var n=[t[0]],a=0,i=0;if(t.length>1){r(t.pop())}return{addPt:r,raw:t,filtered:n}}},{"../constants/numerical":133,"./matrix":154}],161:[function(t,e,r){"use strict";e.exports=function(t,e){if(e instanceof RegExp){var r,n=e.toString();for(r=0;r<t.length;r++)if(t[r]instanceof RegExp&&t[r].toString()===n)return t;t.push(e)}else e&&-1===t.indexOf(e)&&t.push(e);return t}},{}],162:[function(t,e,r){"use strict";function n(t,e){for(var r,n=[],i=0;i<e.length;i++)r=e[i],n[i]=r===t?r:"object"==typeof r?Array.isArray(r)?a.extendDeep([],r):a.extendDeepAll({},r):r;return n}var a=t("../lib"),i=t("../plot_api/plot_config"),o={};o.add=function(t,e,r,n,a){var o,l;if(t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},l=t.undoQueue.index,t.autoplay)return void(t.undoQueue.inSequence||(t.autoplay=!1))

!t.undoQueue.sequence||t.undoQueue.beginSequence?(o={undo
{calls:[],args:[]},redo:{calls:[],args:[]}},t.undoQueue.queue.splice(l,t.undoQueue.queue.length-l,o),t.undoQueue.index+=1):o=t.undoQueue.queue[l-1],t.undoQueue.beginSequence=!1,o&&(o.undo.calls.unshift(e),o.undo.args.unshift(r),o.redo.calls.push(n),o.redo.args.push(a)),t.undoQueue.queue.length>i.queueLength&&(t.undoQueue.queue.shift(),t.undoQueue.index--)},o.startSequence=function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!0,t.undoQueue.beginSequence=!0},o.stopSequence=function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!1,t.undoQueue.beginSequence=!1},o.undo=function(t){var e,r;if(t.framework&&t.framework.isPolar)return void t.framework.undo();if(!(void 0===t.undoQueue||isNaN(t.undoQueue.index)||t.undoQueue.index<=0)){for(t.undoQueue.index--,e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,r=0;r<e.undo.calls.length;r++)o.plotDo(t,e.undo.calls[r],e.undo.args[r]);t.undoQueue.inSequence=!1,t.autoplay=!1}},o.redo=function(t){var e,r;if(t.framework&&t.framework.isPolar)return void t.framework.redo();if(!(void 0===t.undoQueue||isNaN(t.undoQueue.index)||t.undoQueue.index>=t.undoQueue.queue.length)){for(e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,r=0;r<e.redo.calls.length;r++)o.plotDo(t,e.redo.calls[r],e.redo.args[r]);t.undoQueue.inSequence=!1,t.autoplay=!1,t.undoQueue.index++}},o.plotDo=function(t,e,r){t.autoplay=!0,r=n(t,r),e.apply(null,r)},e.exports=o},{"../lib":149,"../plot_api/plot_config":177}],163:[function(t,e,r){"use strict";r.counter=function(t,e,r){return new RegExp("^"+t+"([2-9]|[1-9][0-9]+)?"+(e||"")+(r?"":"$"))}},{}],164:[function(t,e,r){"use strict";var n=/^(.*)(\.[^\.\[\]]+|\[\d\])$/,a=/^[^\.\[\]]+$/;e.exports=function(t,e){for(;e;){var r=t.match(n);if(r)t=r[1];else{if(!t.match(a))throw new Error("bad relativeAttr call:"+[t,e]);t=""}if("^"!==e.charAt(0))break;e=e.slice(1)}return t&&"["!==e.charAt(0)?t+"."+e:t+e}},{}],165:[function(t,e,r){"use strict";var n=t("./is_array"),a=t("./is_plain_object");e.exports=function t(e,r){for(var i=Object.keys(r||{}),o=0;o<i.length;o++){var l=i[o],s=r[l],c=e[l];if("_"===l.charAt(0)||"function"==typeof s){if(l in e)continue;e[l]=s}else if(n(s)&&n(c)&&a(s[0]))for(var u=0;u<s.length;u++)a(s[u])&&a(c[u])&&t(c[u],s[u]);else a(s)&&a(c)&&(t(c,s),Object.keys(c).length||delete e[l])}}},{"./is_array":150,"./is_plain_object":151}],166:[function(t,e,r){"use strict";function n(t,e){return t<e}function a(t,e){return t<=e}function i(t,e){return t>e}function o(t,e){return t>=e}var l=t("fast-isnumeric"),s=t("./loggers");r.findBin=function(t,e,r){if(l(e.start))return r?Math.ceil((t-e.start)/e.size)-1:Math.floor((t-e.start)/e.size);var c,u,f=0,d=e.length,p=0;for(u=e[e.length-1]>=e[0]?r?n:a:r?o:i;f<d&&p++<100;)c=Math.floor((f+d)/2),u(e[c],t)?f=c+1:d=c;return p>90&&s.log("Long binary search..."),f-1},r.sorterAsc=function(t,e){return t-e},r.sorterDes=function(t,e){return e-t},r.distinctVals=function(t){var e=t.slice();e.sort(r.sorterAsc);for(var n=e.length-1,a=e[n]-e[0]||1,i=a/(n||1)/1e4,o=[e[0]],l=0;l<n;l++)e[l+1]>e[l]+i&&(a=Math.min(a,e[l+1]-e[l]),o.push(e[l+1]));return{vals:o,minDiff:a}},r.roundUp=function(t,e,r){for(var n,a=0,i=e.length-1,o=0,l=r?0:1,s=r?1:0,c=r?Math.ceil:Math.floor;a<i&&o++<100;)n=c((a+i)/2),e[n]<=t?a=n+l:i=n-s;return e[a]}},{"./loggers":153,"fast-isnumeric":10}],167:[function(t,e,r){"use strict";e.exports=function(t,e){(t.attr("class")||"").split(" ").forEach(function(e){0===e.indexOf("cursor-")&&t.classed(e,!1)}),e&&t.classed("cursor-"+e,!0)}},{}],168:[function(t,e,r){"use strict";var n=t("fast-isnumeric");r.aggNums=function(t,e,a,i){var o,l;if(i||(i=a.length),n(e)||(e=!1),Array.isArray(a[0])){for(l=new Array(i),o=0;o<i;o++)l[o]=r.aggNums(t,e,a[o]);a=l}for(o=0;o<i;o++)n(e)?n(a[o])&&(e=t(+e,+a[o])):e=a[o];return e},r.len=function(t){return r.aggNums(function(t){return t+1},0,t)},r.mean=function(t,e){return e||(e=r.len(t)),r.aggNums(function(t,e){return t+e},0,t)/e},r.variance=function(t,e,a){return e||(e=r.len(t)),n(a)||(a=r.mean(t,e)),r.aggNums(function(t,e){return t+Math.pow(e-a,2)},0,t)/e},r.stdev=function(t,e,n){return Math.sqrt(r.variance(t,e,n))},r.interp=function(t,e){if(!n(e))throw"n should be a finite number";if((e=e*t.length-.5)<0)return t[0];if(e>t.length-1)return t[t.length-1];var r=e%1;return r*t[Math.ceil(e)]+(1-r)*t[Math.floor(e)]}},{"fast-isnumeric":10}],169:[function(t,e,r){"use strict";function n(t,e){return t.node().getBoundingClientRect()[e]}function a(t){return t.replace(y,"\\lt ").replace(m,"\\gt ")}function i(t,e,r){var n="math-output-"+d.randstr([],64),i=f.select("body").append("div").attr({id:n}).style({visibility:"hidden",position:"absolute"}).style({"font-size":e.fontSize+"px"}).text(a(t));MathJax.Hub.Queue(["Typeset",MathJax.Hub,i.node()],function(){var e=f.select("body").select("#MathJax_SVG_glyphs");if(i.select(".MathJax_SVG").empty()||!i.select("svg").node())d.log("There was an error in the tex syntax.",t),r();else{var n=i.select("svg").node().getBoundingClientRect();r(i.select(".MathJax_SVG"),e,n)}i.remove()})}function o(t,e){if(!t)return null;var r=t.match(e);return r&&(r[3]||r[4])}function l(t,e){if(!t)return"";for(var r=0;r<e.length;r++){var n=e[r];t=t.replace(n.regExp,n.sub)}return t}function s(t){return l(t,A)}function c(t,e){function r(){u++;var e=document.createElementNS(p.svg,"tspan");f.select(e).attr({class:"line",dy:u*g+"em"}),t.appendChild(e),i=e;var r=c;if(c=[{node:e}],r.length>1)for(var a=1;a<r.length;a++)n(r[a])}function n(t){var e,r=t.type,n={};if("a"===r){e="a";var o=t.target,l=t.href,s=t.popup;l&&(n={"xlink:xlink:show":"_blank"===o||"_"!==o.charAt(0)?"new":"replace",target:o,"xlink:xlink:href":l},s&&(n.onclick='window.open(this.href.baseVal,this.target.baseVal,"'+s+'");return false;'))}else e="tspan";t.style&&(n.style=t.style);var u=document.createElementNS(p.svg,e);if("sup"===r||"sub"===r){a(i,w),i.appendChild(u);var d=document.createElementNS(p.svg,"tspan");a(d,w),f.select(d).attr("dy",_[r]),n.dy=b[r],i.appendChild(u),i.appendChild(d)}else i.appendChild(u);f.select(u).attr(n),i=t.node=u,c.push(t)}function a(t,e){t.appendChild(document.createTextNode(e))}e=s(e).replace(T," ");var i,l=!1,c=[],u=-1;S.test(e)?r():(i=t,c=[{node:t}]);for(var h=e.split(L),v=0;v<h.length;v++){var y=h[v],m=y.match(C),M=m&&m[2].toLowerCase(),A=x[M];if("br"===M)r();else if(void 0===A)a(i,y);else if(m[1])!function(t){if(1===c.length)return void d.log("Ignoring unexpected end tag </"+t+">.",e);var r=c.pop();t!==r.type&&d.log("Start tag <"+r.type+"> doesnt match end tag <"+t+">. Pretending it did match.",e),i=c[c.length-1].node}(M);else{var N=m[4],I={type:M},R=o(N,O);if(R?(R=R.replace(E,"$1 fill:"),A&&(R+=";"+A)):A&&(R=A),R&&(I.style=R),"a"===M){l=!0;var F=o(N,z);if(F){var j=document.createElement("a");j.href=F,-1!==k.indexOf(j.protocol)&&(I.href=encodeURI(F),I.target=o(N,D)||"_blank",I.popup=o(N,P))}}n(I)}}return l}function u(t,e,r){var n,a,i,o=r.horizontalAlign,l=r.verticalAlign||"top",s=t.node().getBoundingClientRect(),c=e.node().getBoundingClientRect();return a="bottom"===l?function(){return s.bottom-n.height}:"middle"===l?function(){return s.top+(s.height-n.height)/2}:function(){return s.top},i="right"===o?function(){return s.right-n.width}:"center"===o?function(){return s.left+(s.width-n.width)/2}:function(){return s.left},function(){return n=this.node().getBoundingClientRect(),this.style({top:a()-c.top+"px",left:i()-c.left+"px","z-index":1e3}),this}}var f=t("d3"),d=t("../lib"),p=t("../constants/xmlns_namespaces"),h=t("../constants/string_mappings"),g=t("../constants/alignment").LINE_SPACING,v=/([^$]*)([$]+[^$]*[$]+)([^$]*)/;r.convertToTspans=function(t,e,a){function o(){u.empty()||(d=t.attr("class")+"-math",u.select("svg."+d).remove()),t.text("").style("white-space","pre"),c(t.node(),l)&&t.style("pointer-events","all"),r.positionText(t),a&&a.call(t)}var l=t.text(),s=!t.attr("data-notex")&&"undefined"!=typeof MathJax&&l.match(v),u=f.select(t.node().parentNode);if(!u.empty()){var d=t.attr("class")?t.attr("class").split(" ")[0]:"text";return d+="-math",u.selectAll("svg."+d).remove(),u.selectAll("g."+d+"-group").remove(),t.style("display",null).attr({"data-unformatted":l,"data-math":"N"}),s?(e&&e._promises||[]).push(new Promise(function(e){t.style("display","none");var r=parseInt(t.node().style.fontSize,10);i(s[2],{fontSize:r},function(i,s,c){u.selectAll("svg."+d).remove(),u.selectAll("g."+d+"-group").remove();var f=i&&i.select("svg");if(!f||!f.node())return o(),void e();var p=u.append("g").classed(d+"-group",!0).attr({"pointer-events":"none","data-unformatted":l,"data-math":"Y"});p.node().appendChild(f.node()),s&&s.node()&&f.node().insertBefore(s.node().cloneNode(!0),f.node().firstChild),f.attr({class:d,height:c.height,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var h=t.node().style.fill||"black";f.select("g").attr({fill:h,stroke:h});var g=n(f,"width"),v=n(f,"height"),y=+t.attr("x")-g*{start:0,middle:.5,end:1}[t.attr("text-anchor")||"start"],m=r||n(t,"height"),x=-m/4;"y"===d[0]?(p.attr({transform:"rotate("+[-90,+t.attr("x"),+t.attr("y")]+") translate("+[-g/2,x-v/2]+")"}),f.attr({x:+t.attr("x"),y:+t.attr("y")})):"l"===d[0]?f.attr({x:t.attr("x"),y:x-v/2}):"a"===d[0]?f.attr({x:0,y:x}):f.attr({x:y,y:+t.attr("y")+x-v/2}),a&&a.call(t,p),e(p)})})):o(),t}};var y=/(<|<|<)/g,m=/(>|>|>)/g,x={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"},b={sub:"0.3em",sup:"-0.6em"},_={sub:"-0.21em",sup:"0.42em"},w="\u200b",k=["http:","https:","mailto:","",void 0,":"],M=new RegExp("</?("+Object.keys(x).join("|")+")( [^>]*)?/?>","g"),A=Object.keys(h.entityToUnicode).map(function(t){return{regExp:new RegExp("&"+t+";","g"),sub:h.entityToUnicode[t]}}),T=/(\r\n?|\n)/g,L=/(<[^<>]*>)/,C=/<(\/?)([^ >]*)(\s+(.*))?>/i,S=/<br(\s+.*)?>/i,O=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,z=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,D=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,P=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i,E=/(^|;)\s*color:/;r.plainText=function(t){return(t||"").replace(M," ")},r.lineCount=function(t){return t.selectAll("tspan.line").size()||1},r.positionText=function(t,e,r){return t.each(function(){function t(t,e){return void 0===e?null===(e=n.attr(t))&&(n.attr(t,0),e=0):n.attr(t,e),e}var n=f.select(this),a=t("x",e),i=t("y",r);"text"===this.nodeName&&n.selectAll("tspan.line").attr({x:a,y:i})})},r.makeEditable=function(t,e){function r(){a(),t.style({opacity:0});var e,r=s.attr("class");(e=r?"."+r.split(" ")[0]+"-math-group":"[class*=-math-group]")&&f.select(t.node().parentNode).select(e).style({opacity:0})}function n(t){var e=t.node(),r=document.createRange();r.selectNodeContents(e);var n=window.getSelection();n.removeAllRanges(),n.addRange(r),e.focus()}function a(){var r=f.select(i),a=r.select(".svg-container"),o=a.append("div"),s=t.node().style,c=parseFloat(s.fontSize||12);o.classed("plugin-editable editable",!0).style({position:"absolute","font-family":s.fontFamily||"Arial","font-size":c,color:e.fill||s.fill||"black",opacity:1,"background-color":e.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(e.text||t.attr("data-unformatted")).call(u(t,a,e)).on("blur",function(){i._editing=!1,t.text(this.textContent).style({opacity:1});var e,r=f.select(this).attr("class");(e=r?"."+r.split(" ")[0]+"-math-group":"[class*=-math-group]")&&f.select(t.node().parentNode).select(e).style({opacity:0});var n=this.textContent;f.select(this).transition().duration(0).remove(),f.select(document).on("mouseup",null),l.edit.call(t,n)}).on("focus",function(){var t=this;i._editing=!0,f.select(document).on("mouseup",function(){if(f.event.target===t)return!1;document.activeElement===o.node()&&o.node().blur()})}).on("keyup",function(){27===f.event.which?(i._editing=!1,t.style({opacity:1}),f.select(this).style({opacity:0}).on("blur",function(){return!1}).transition().remove(),l.cancel.call(t,this.textContent)):(l.input.call(t,this.textContent),f.select(this).call(u(t,a,e)))}).on("keydown",function(){13===f.event.which&&this.blur()}).call(n)}var i=e.gd,o=e.delegate,l=f.dispatch("edit","input","cancel"),s=o||t;if(t.style({"pointer-events":o?"none":"all"}),1!==t.size())throw new Error("boo");return e.immediate?r():s.on("click",r),f.rebind(t,l,"on")}},{"../constants/alignment":131,"../constants/string_mappings":134,"../constants/xmlns_namespaces":135,"../lib":149,d3:7}],170:[function(t,e,r){"use strict";function n(t){t&&null!==t.timer&&(clearTimeout(t.timer),t.timer=null)}var a={};r.throttle=function(t,e,r){function i(){r(),o.ts=Date.now(),o.onDone&&(o.onDone(),o.onDone=null)}var o=a[t],l=Date.now();if(!o){for(var s in a)a[s].ts<l-6e4&&delete a[s];o=a[t]={ts:0,timer:null}}if(n(o),l>o.ts+e)return void i();o.timer=setTimeout(function(){i(),o.timer=null},e)},r.done=function(t){var e=a[t];return e&&e.timer?new Promise(function(t){var r=e.onDone;e.onDone=function(){r&&r(),t(),e.onDone=null}}):Promise.resolve()},r.clear=function(t){if(t)n(a[t]),delete a[t];else for(var e in a)r.clear(e)}},{}],171:[function(t,e,r){"use strict";var n=t("fast-isnumeric");e.exports=function(t,e){if(t>0)return Math.log(t)/Math.LN10;var r=Math.log(Math.min(e[0],e[1]))/Math.LN10;return n(r)||(r=Math.log(Math.max(e[0],e[1]))/Math.LN10-6),r}},{"fast-isnumeric":10}],172:[function(t,e,r){"use strict";var n=t("../registry");e.exports=function(t){for(var e,r,a=n.layoutArrayContainers,i=n.layoutArrayRegexes,o=t.split("[")[0],l=0;l<i.length;l++)if((r=t.match(i[l]))&&0===r.index){e=r[0];break}if(e||(e=a[a.indexOf(o)]),!e)return!1;var s=t.substr(e.length);return s?!!(r=s.match(/^\[(0|[1-9][0-9]*)\](\.(.+))?$/))&&{array:e,index:Number(r[1]),property:r[3]||""}:{array:e,index:"",property:""}}},{"../registry":225}],173:[function(t,e,r){"use strict";function n(t){for(var e={},r=0;r<t.length;r++)e[t[r]]=!1;return e}function a(t,e,r){var n=l({},t);for(var a in n){var o=n[a];s(o)&&(n[a]=i(o,e,r,a))}return"from-root"===r&&(n.editType=e),n}function i(t,e,r,n){if(t.valType){var o=l({},t);if(o.editType=e,Array.isArray(t.items)){o.items=new Array(t.items.length);for(var s=0;s<t.items.length;s++)o.items[s]=i(t.items[s],e,"from-root")}return o}return a(t,e,"_"===n.charAt(0)?"nested":"from-root")}var o=t("../lib"),l=o.extendFlat,s=o.isPlainObject,c={valType:"flaglist",extras:["none"],flags:["calc","calcIfAutorange","clearAxisTypes","plot","style","colorbars"]},u={valType:"flaglist",extras:["none"],flags:["calc","calcIfAutorange","plot","legend","ticks","layoutstyle","modebar","camera","arraydraw"]},f=c.flags.slice().concat(["clearCalc","fullReplot"]),d=u.flags.slice().concat("layoutReplot");e.exports={traces:c,layout:u,traceFlags:function(){return n(f)},layoutFlags:function(){return n(d)},update:function(t,e){var r=e.editType;if(r&&"none"!==r)for(var n=r.split("+"),a=0;a<n.length;a++)t[n[a]]=!0},overrideAll:a}},{"../lib":149}],174:[function(t,e,r){"use strict";function n(t,e){var r=t[e],n=e.charAt(0);r&&"paper"!==r&&(t[e]=d.cleanId(r,n))}function a(t){var e="middle",r="center";return-1!==t.indexOf("top")?e="top":-1!==t.indexOf("bottom")&&(e="bottom"),-1!==t.indexOf("left")?r="left":-1!==t.indexOf("right")&&(r="right"),e+" "+r}function i(t,e){return e in t&&"object"==typeof t[e]&&0===Object.keys(t[e]).length}function o(t){var e=t.search(h);if(e>0)return t.substr(0,e)}var l=t("fast-isnumeric"),s=t("gl-mat4/fromQuat"),c=t("../registry"),u=t("../lib"),f=t("../plots/plots"),d=t("../plots/cartesian/axes"),p=t("../components/color");r.clearPromiseQueue=function(t){Array.isArray(t._promises)&&t._promises.length>0&&u.log("Clearing previous rejected promises from queue."),t._promises=[]},r.cleanLayout=function(t){var e,r;t||(t={}),t.xaxis1&&(t.xaxis||(t.xaxis=t.xaxis1),delete t.xaxis1),t.yaxis1&&(t.yaxis||(t.yaxis=t.yaxis1),delete t.yaxis1);var a=d.list({_fullLayout:t});for(e=0;e<a.length;e++){var o=a[e];o.anchor&&"free"!==o.anchor&&(o.anchor=d.cleanId(o.anchor)),o.overlaying&&(o.overlaying=d.cleanId(o.overlaying)),o.type||(o.isdate?o.type="date":o.islog?o.type="log":!1===o.isdate&&!1===o.islog&&(o.type="linear")),"withzero"!==o.autorange&&"tozero"!==o.autorange||(o.autorange=!0,o.rangemode="tozero"),delete o.islog,delete o.isdate,delete o.categories,i(o,"domain")&&delete o.domain,void 0!==o.autotick&&(void 0===o.tickmode&&(o.tickmode=o.autotick?"auto":"linear"),delete o.autotick)}var l=Array.isArray(t.annotations)?t.annotations.length:0;for(e=0;e<l;e++){var c=t.annotations[e];u.isPlainObject(c)&&(c.ref&&("paper"===c.ref?(c.xref="paper",c.yref="paper"):"data"===c.ref&&(c.xref="x",c.yref="y"),delete c.ref),n(c,"xref"),n(c,"yref"))}var h=Array.isArray(t.shapes)?t.shapes.length:0;for(e=0;e<h;e++){var g=t.shapes[e];u.isPlainObject(g)&&(n(g,"xref"),n(g,"yref"))}var v=t.legend;v&&(v.x>3?(v.x=1.02,v.xanchor="left"):v.x<-2&&(v.x=-.02,v.xanchor="right"),v.y>3?(v.y=1.02,v.yanchor="bottom"):v.y<-2&&(v.y=-.02,v.yanchor="top")),"rotate"===t.dragmode&&(t.dragmode="orbit"),t.scene1&&(t.scene||(t.scene=t.scene1),delete t.scene1);var y=f.getSubplotIds(t,"gl3d");for(e=0;e<y.length;e++){var m=t[y[e]],x=m.cameraposition;if(Array.isArray(x)&&4===x[0].length){var b=x[0],_=x[1],w=x[2],k=s([],b),M=[];for(r=0;r<3;++r)M[r]=_[e]+w*k[2+4*r];m.camera={eye:{x:M[0],y:M[1],z:M[2]},center:{x:_[0],y:_[1],z:_[2]},up:{x:k[1],y:k[5],z:k[9]}},delete m.cameraposition}}return p.clean(t),t},r.cleanData=function(t,e){for(var n=[],o=(t.concat(Array.isArray(e)?e:[]).filter(function(t){return"uid"in t}).map(function(t){return t.uid})),l=0;l<t.length;l++){var s,h=t[l];if(!("uid"in h)||-1!==n.indexOf(h.uid)){var g;for(s=0;s<100&&(g=u.randstr(o),-1!==n.indexOf(g));s++);h.uid=u.randstr(o),o.push(h.uid)}if(n.push(h.uid),"histogramy"===h.type&&"xbins"in h&&!("ybins"in h)&&(h.ybins=h.xbins,delete h.xbins),h.error_y&&"opacity"in h.error_y){var v=p.defaults,y=h.error_y.color||(c.traceIs(h,"bar")?p.defaultLine:v[l%v.length]);h.error_y.color=p.addOpacity(p.rgb(y),p.opacity(y)*h.error_y.opacity),delete h.error_y.opacity}if("bardir"in h&&("h"!==h.bardir||!c.traceIs(h,"bar")&&"histogram"!==h.type.substr(0,9)||(h.orientation="h",r.swapXYData(h)),delete h.bardir),"histogramy"===h.type&&r.swapXYData(h),"histogramx"!==h.type&&"histogramy"!==h.type||(h.type="histogram"),"scl"in h&&(h.colorscale=h.scl,delete h.scl),"reversescl"in h&&(h.reversescale=h.reversescl,delete h.reversescl),h.xaxis&&(h.xaxis=d.cleanId(h.xaxis,"x")),h.yaxis&&(h.yaxis=d.cleanId(h.yaxis,"y")),c.traceIs(h,"gl3d")&&h.scene&&(h.scene=f.subplotsRegistry.gl3d.cleanId(h.scene)),c.traceIs(h,"pie")||c.traceIs(h,"bar")||(Array.isArray(h.textposition)?h.textposition=h.textposition.map(a):h.textposition&&(h.textposition=a(h.textposition))),c.traceIs(h,"2dMap")&&("YIGnBu"===h.colorscale&&(h.colorscale="YlGnBu"),"YIOrRd"===h.colorscale&&(h.colorscale="YlOrRd")),c.traceIs(h,"markerColorscale")&&h.marker){var m=h.marker;"YIGnBu"===m.colorscale&&(m.colorscale="YlGnBu"),"YIOrRd"===m.colorscale&&(m.colorscale="YlOrRd")}if("surface"===h.type&&u.isPlainObject(h.contours)){var x=["x","y","z"];for(s=0;s<x.length;s++){var b=h.contours[x[s]];u.isPlainObject(b)&&(b.highlightColor&&(b.highlightcolor=b.highlightColor,delete b.highlightColor),b.highlightWidth&&(b.highlightwidth=b.highlightWidth,delete b.highlightWidth))}}if(Array.isArray(h.transforms)){var _=h.transforms;for(s=0;s<_.length;s++){var w=_[s];if(u.isPlainObject(w))switch(w.type){case"filter":w.filtersrc&&(w.target=w.filtersrc,delete w.filtersrc),w.calendar&&(w.valuecalendar||(w.valuecalendar=w.calendar),delete w.calendar);break;case"groupby":if(w.styles=w.styles||w.style,w.styles&&!Array.isArray(w.styles)){var k=w.styles,M=Object.keys(k);w.styles=[];for(var A=0;A<M.length;A++)w.styles.push({target:M[A],value:k[M[A]]})}}}}i(h,"line")&&delete h.line,"marker"in h&&(i(h.marker,"line")&&delete h.marker.line,i(h,"marker")&&delete h.marker),p.clean(h)}},r.swapXYData=function(t){var e;if(u.swapAttrs(t,["?","?0","d?","?bins","nbins?","autobin?","?src","error_?"]),Array.isArray(t.z)&&Array.isArray(t.z[0])&&(t.transpose?delete t.transpose:t.transpose=!0),t.error_x&&t.error_y){var r=t.error_y,n="copy_ystyle"in r?r.copy_ystyle:!(r.color||r.thickness||r.width);u.swapAttrs(t,["error_?.copy_ystyle"]),n&&u.swapAttrs(t,["error_?.color","error_?.thickness","error_?.width"])}if("string"==typeof t.hoverinfo){var a=t.hoverinfo.split("+");for(e=0;e<a.length;e++)"x"===a[e]?a[e]="y":"y"===a[e]&&(a[e]="x");t.hoverinfo=a.join("+")}},r.coerceTraceIndices=function(t,e){return l(e)?[e]:Array.isArray(e)&&e.length?e:t.data.map(function(t,e){return e})},r.manageArrayContainers=function(t,e,r){var n=t.obj,a=t.parts,i=a.length,o=a[i-1],s=l(o);if(s&&null===e){var c=a.slice(0,i-1).join(".");u.nestedProperty(n,c).get().splice(o,1)}else s&&void 0===t.get()?(void 0===t.get()&&(r[t.astr]=null),t.set(e)):t.set(e)};var h=/(\.[^\[\]\.]+|\[[^\[\]\.]+\])$/;r.hasParent=function(t,e){for(var r=o(e);r;){if(r in t)return!0;r=o(r)}return!1};var g=["x","y","z"];r.clearAxisTypes=function(t,e,r){for(var n=0;n<e.length;n++)for(var a=t._fullData[n],i=0;i<3;i++){var o=d.getFromTrace(t,a,g[i]);if(o&&"log"!==o.type){var l=o._name,s=o._id.substr(1);if("scene"===s.substr(0,5)){if(void 0!==r[s])continue;l=s+"."+l}var c=l+".type";void 0===r[l]&&void 0===r[c]&&u.nestedProperty(t.layout,c).set(null)}}}},{"../components/color":34,"../lib":149,"../plots/cartesian/axes":189,"../plots/plots":218,"../registry":225,"fast-isnumeric":10,"gl-mat4/fromQuat":11}],175:[function(t,e,r){"use strict";var n=t("../lib/nested_property"),a=t("../lib/is_plain_object"),i=t("../lib/noop"),o=t("../lib/loggers"),l=t("../lib/search").sorterAsc,s=t("../registry");r.containerArrayMatch=t("./container_array_match");var c=r.isAddVal=function(t){return"add"===t||a(t)},u=r.isRemoveVal=function(t){return null===t||"remove"===t};r.applyContainerArrayChanges=function(t,e,r,a){var f=e.astr,d=s.getComponentMethod(f,"supplyLayoutDefaults"),p=s.getComponentMethod(f,"draw"),h=s.getComponentMethod(f,"drawOne"),g=a.replot||a.recalc||d===i||p===i,v=t.layout,y=t._fullLayout;if(r[""]){Object.keys(r).length>1&&o.warn("Full array edits are incompatible with other edits",f);var m=r[""][""];if(u(m))e.set(null);else{if(!Array.isArray(m))return o.warn("Unrecognized full array edit value",f,m),!0;e.set(m)}return!g&&(d(v,y),p(t),!0)}var x,b,_,w,k,M,A,T=Object.keys(r).map(Number).sort(l),L=e.get(),C=L||[],S=n(y,f).get(),O=[],z=-1,D=C.length;for(x=0;x<T.length;x++)if(_=T[x],w=r[_],k=Object.keys(w),M=w[""],A=c(M),_<0||_>C.length-(A?0:1))o.warn("index out of range",f,_);else if(void 0!==M)k.length>1&&o.warn("Insertion & removal are incompatible with edits to the same index.",f,_),u(M)?O.push(_):A?("add"===M&&(M={}),C.splice(_,0,M),S&&S.splice(_,0,{})):o.warn("Unrecognized full object edit value",f,_,M),-1===z&&(z=_);else for(b=0;b<k.length;b++)n(C[_],k[b]).set(w[k[b]]);for(x=O.length-1;x>=0;x--)C.splice(O[x],1),S&&S.splice(O[x],1);if(C.length?L||e.set(C):e.set(null),g)return!1;if(d(v,y),h!==i){var P;if(-1===z)P=T;else{for(D=Math.max(C.length,D),P=[],x=0;x<T.length&&!((_=T[x])>=z);x++)P.push(_);for(x=z;x<D;x++)P.push(x)}for(x=0;x<P.length;x++)h(t,P[x])}else p(t);return!0}},{"../lib/is_plain_object":151,"../lib/loggers":153,"../lib/nested_property":156,"../lib/noop":157,"../lib/search":166,"../registry":225,"./container_array_match":172}],176:[function(t,e,r){"use strict";function n(t,e){try{t._fullLayout._paper.style("background",e)}catch(t){w.error(t)}}function a(t,e){n(t,z.combine(e,"white"))}function i(t,e){t._context||(t._context=w.extendDeep({},_.defaultConfig));var r,i,o,l=t._context;if(e){for(i=Object.keys(e),r=0;r<i.length;r++)"editable"!==(o=i[r])&&"edits"!==o&&o in l&&("setBackground"===o&&"opaque"===e[o]?l[o]=a:l[o]=e[o]);e.plot3dPixelRatio&&!l.plotGlPixelRatio&&(l.plotGlPixelRatio=l.plot3dPixelRatio);var s=e.editable;if(void 0!==s)for(l.editable=s,i=Object.keys(l.edits),r=0;r<i.length;r++)l.edits[i[r]]=s;if(e.edits)for(i=Object.keys(e.edits),r=0;r<i.length;r++)(o=i[r])in l.edits&&(l.edits[o]=e.edits[o])}l.staticPlot&&(l.editable=!1,l.edits={},l.autosizable=!1,l.scrollZoom=!1,l.doubleClick=!1,l.showTips=!1,l.showLink=!1,l.displayModeBar=!1),"hover"!==l.displayModeBar||b||(l.displayModeBar=!0),"transparent"!==l.setBackground&&"function"==typeof l.setBackground||(l.setBackground=n)}function o(t,e,r){var n=m.select(t).selectAll(".plot-container").data([0]);n.enter().insert("div",":first-child").classed("plot-container plotly",!0);var a=n.selectAll(".svg-container").data([0]);a.enter().append("div").classed("svg-container",!0).style("position","relative"),a.html(""),e&&(t.data=e),r&&(t.layout=r),C.manager.fillLayout(t),a.style({width:t._fullLayout.width+"px",height:t._fullLayout.height+"px"}),t.framework=C.manager.framework(t),t.framework({data:t.data,layout:t.layout},a.node()),t.framework.setUndoPoint();var i=t.framework.svg(),o=1,l=t._fullLayout.title;""!==l&&l||(o=0);var s=function(){this.call(E.convertToTspans,t)},c=i.select(".title-group text").call(s);if(t._context.edits.titleText){l&&"Click to enter title"!==l||(o=.2,c.attr({"data-unformatted":"Click to enter title"}).text("Click to enter title").style({opacity:o}).on("mouseover.opacity",function(){m.select(this).transition().duration(100).style("opacity",1)}).on("mouseout.opacity",function(){m.select(this).transition().duration(1e3).style("opacity",0)}));var u=function(){this.call(E.makeEditable,{gd:t}).on("edit",function(e){t.framework({layout:{title:e}}),this.text(e).call(s),this.call(u)}).on("cancel",function(){var t=this.attr("data-unformatted");this.text(t).call(s)})};c.call(u)}return t._context.setBackground(t,t._fullLayout.paper_bgcolor),L.addLinks(t),Promise.resolve()}function l(t,e){var r,n,a=e+1,i=[];for(r=0;r<t.length;r++)n=t[r],n<0?i.push(a+n):i.push(n);return i}function s(t,e,r){var n,a;for(n=0;n<e.length;n++){if((a=e[n])!==parseInt(a,10))throw new Error("all values in "+r+" must be integers");if(a>=t.data.length||a<-t.data.length)throw new Error(r+" must be valid indices for gd.data.");if(e.indexOf(a,n+1)>-1||a>=0&&e.indexOf(-t.data.length+a)>-1||a<0&&e.indexOf(t.data.length+a)>-1)throw new Error("each index in "+r+" must be unique.")}}function c(t,e,r){if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if(void 0===e)throw new Error("currentIndices is a required argument.");if(Array.isArray(e)||(e=[e]),s(t,e,"currentIndices"),void 0===r||Array.isArray(r)||(r=[r]),void 0!==r&&s(t,r,"newIndices"),void 0!==r&&e.length!==r.length)throw new Error("current and new indices must be of equal length.")}function u(t,e,r){var n,a;if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if(void 0===e)throw new Error("traces must be defined.");for(Array.isArray(e)||(e=[e]),n=0;n<e.length;n++)if("object"!=typeof(a=e[n])||Array.isArray(a)||null===a)throw new Error("all values in traces array must be non-array objects");if(void 0===r||Array.isArray(r)||(r=[r]),void 0!==r&&r.length!==e.length)throw new Error("if indices is specified, traces.length must equal indices.length")}function f(t,e,r,n){var a=w.isPlainObject(n);if(!Array.isArray(t.data))throw new Error("gd.data must be an array");if(!w.isPlainObject(e))throw new Error("update must be a key:value object");if(void 0===r)throw new Error("indices must be an integer or array of integers");s(t,r,"indices");for(var i in e){if(!Array.isArray(e[i])||e[i].length!==r.length)throw new Error("attribute "+i+" must be an array of length equal to indices array length");if(a&&(!(i in n)||!Array.isArray(n[i])||n[i].length!==e[i].length))throw new Error("when maxPoints is set as a key:value object it must contain a 1:1 corrispondence with the keys and number of traces in the update object")}}function d(t,e,r,n){var a,i,o,s,c,u=w.isPlainObject(n),f=[];Array.isArray(r)||(r=[r]),r=l(r,t.data.length-1);for(var d in e)for(var p=0;p<r.length;p++){if(a=t.data[r[p]],o=w.nestedProperty(a,d),i=o.get(),s=e[d][p],!Array.isArray(s))throw new Error("attribute: "+d+" index: "+p+" must be an array");if(!Array.isArray(i))throw new Error("cannot extend missing or non-array attribute: "+d);c=u?n[d][p]:n,x(c)||(c=-1),f.push({prop:o,target:i,insert:s,maxp:Math.floor(c)})}return f}function p(t,e,r,n,a,i){f(t,e,r,n);for(var o,l,s,c=d(t,e,r,n),u=[],p={},h={},g=0;g<c.length;g++)l=c[g].prop,s=c[g].maxp,o=a(c[g].target,c[g].insert),s>=0&&s<o.length&&(u=i(o,s)),s=c[g].target.length,l.set(o),Array.isArray(p[l.astr])||(p[l.astr]=[]),Array.isArray(h[l.astr])||(h[l.astr]=[]),p[l.astr].push(u),h[l.astr].push(s);return{update:p,maxPoints:h}}function h(t){return void 0===t?null:t}function g(t,e,r){function n(){return r.map(function(){})}function a(t){var e=_.Axes.id2name(t);-1===c.indexOf(e)&&c.push(e)}function i(t){return"LAYOUT"+t+".autorange"}function o(t){return"LAYOUT"+t+".range"}function l(a,i,o){if(Array.isArray(a))return void a.forEach(function(t){l(t,i,o)});if(!(a in e||I.hasParent(e,a))){var s;s="LAYOUT"===a.substr(0,6)?w.nestedProperty(t.layout,a.replace("LAYOUT","")):w.nestedProperty(d[r[o]],a),a in v||(v[a]=n()),void 0===v[a][o]&&(v[a][o]=h(s.get())),void 0!==i&&s.set(i)}}var s,c,u=t._fullLayout,f=t._fullData,d=t.data,p=F.traceFlags(),g={},v={},y={};for(var m in e){if(I.hasParent(e,m))throw new Error("cannot set "+m+"and a parent attribute simultaneously");var x,b,k,M,C,S,O=e[m];if(g[m]=O,"LAYOUT"!==m.substr(0,6)){for(v[m]=n(),s=0;s<r.length;s++)if(x=d[r[s]],b=f[r[s]],k=w.nestedProperty(x,m),M=k.get(),void 0!==(C=Array.isArray(O)?O[s%O.length]:O)){if((S=T.getTraceValObject(b,k.parts))&&S.impliedEdits&&null!==C)for(var z in S.impliedEdits)l(w.relativeAttr(m,z),S.impliedEdits[z],s);else if("colorbar.thicknessmode"===m&&k.get()!==C&&-1!==["fraction","pixels"].indexOf(C)&&b.colorbar){var D=-1!==["top","bottom"].indexOf(b.colorbar.orient)?u.height-u.margin.t-u.margin.b:u.width-u.margin.l-u.margin.r;l("colorbar.thickness",b.colorbar.thickness*("fraction"===C?1/D:D),s)}else if("colorbar.lenmode"===m&&k.get()!==C&&-1!==["fraction","pixels"].indexOf(C)&&b.colorbar){var P=-1!==["top","bottom"].indexOf(b.colorbar.orient)?u.width-u.margin.l-u.margin.r:u.height-u.margin.t-u.margin.b;l("colorbar.len",b.colorbar.len*("fraction"===C?1/P:P),s)}else"colorbar.tick0"!==m&&"colorbar.dtick"!==m||l("colorbar.tickmode","linear",s);if("type"===m&&"pie"===C!=("pie"===M)){var E="x",N="y";"bar"!==C&&"bar"!==M||"h"!==x.orientation||(E="y",N="x"),w.swapAttrs(x,["?","?src"],"labels",E),w.swapAttrs(x,["d?","?0"],"label",E),w.swapAttrs(x,["?","?src"],"values",N),"pie"===M?(w.nestedProperty(x,"marker.color").set(w.nestedProperty(x,"marker.colors").get()),u._pielayer.selectAll("g.trace").remove()):A.traceIs(x,"cartesian")&&(w.nestedProperty(x,"marker.colors").set(w.nestedProperty(x,"marker.color").get()),y[x.xaxis||"x"]=!0,y[x.yaxis||"y"]=!0)}v[m][s]=h(M);var R=["swapxy","swapxyaxes","orientation","orientationaxes"];if(-1!==R.indexOf(m)){if("orientation"===m){k.set(C);var j=x.x&&!x.y?"h":"v";if((k.get()||j)===b.orientation)continue}else"orientationaxes"===m&&(x.orientation={v:"h",h:"v"}[b.orientation]);I.swapXYData(x),p.calc=p.clearAxisTypes=!0}else-1!==L.dataArrayContainers.indexOf(k.parts[0])?(I.manageArrayContainers(k,C,v),p.calc=!0):(S?S.arrayOk&&(Array.isArray(C)||Array.isArray(M))?p.calc=!0:F.update(p,S):p.calc=!0,k.set(C))}if(-1!==["swapxyaxes","orientationaxes"].indexOf(m)&&_.Axes.swap(t,r),"orientationaxes"===m){var B=w.nestedProperty(t.layout,"hovermode");"x"===B.get()?B.set("y"):"y"===B.get()&&B.set("x")}if(-1!==["orientation","type"].indexOf(m)){for(c=[],s=0;s<r.length;s++){var q=d[r[s]];A.traceIs(q,"cartesian")&&(a(q.xaxis||"x"),a(q.yaxis||"y"),"type"===m&&l(["autobinx","autobiny"],!0,s))}l(c.map(i),!0,0),l(c.map(o),[0,1],0)}}else k=w.nestedProperty(t.layout,m.replace("LAYOUT","")),v[m]=[h(k.get())],k.set(Array.isArray(O)?O[0]:O),p.calc=!0}

var H=!1,V=_.Axes.list(t);for(s=0;s<V.length;s++)if(V[s].autorange){H=!0;break}var U=Object.keys(y);t:for(s=0;s<U.length;s++){for(var G=U[s],X=G.charAt(0),Y=X+"axis",Z=0;Z<d.length;Z++)if(A.traceIs(d[Z],"cartesian")&&(d[Z][Y]||X)===G)continue t;l("LAYOUT"+_.Axes.id2name(G),null,0)}return(p.calc||p.calcIfAutorange&&H)&&(p.clearCalc=!0),(p.calc||p.plot||p.calcIfAutorange)&&(p.fullReplot=!0),{flags:p,undoit:v,redoit:g,traces:r,eventData:w.extendDeepNoArrays([],[g,r])}}function v(t,e){function r(t,n){if(Array.isArray(t))return void t.forEach(function(t){r(t,n)});if(!(t in e||I.hasParent(e,t))){var a=w.nestedProperty(s,t);t in b||(b[t]=h(a.get())),void 0!==n&&a.set(n)}}function n(e,r){if(!w.isPlainObject(e))return!1;var n=e[r+"ref"]||r,a=_.Axes.getFromId(t,n);return a||n.charAt(0)!==r||(a=_.Axes.getFromId(t,r)),(a||{}).autorange}function a(t){var e=V.name2id(t.split(".")[0]);return k[e]=1,e}var i,o,l,s=t.layout,c=t._fullLayout,u=Object.keys(e),f=_.Axes.list(t),d={};for(o=0;o<u.length;o++)if(0===u[o].indexOf("allaxes")){for(l=0;l<f.length;l++){var p=f[l]._id.substr(1),g=-1!==p.indexOf("scene")?p+".":"",v=u[o].replace("allaxes",g+f[l]._name);e[v]||(e[v]=e[u[o]])}delete e[u[o]]}var y,m=F.layoutFlags(),x={},b={},k={};for(var M in e){if(I.hasParent(e,M))throw new Error("cannot set "+M+"and a parent attribute simultaneously");var C=w.nestedProperty(s,M),S=e[M],O=C.parts.length,z="string"==typeof C.parts[O-1]?O-1:O-2,D=C.parts[z],P=C.parts[z-1]+"."+D,E=C.parts.slice(0,z).join("."),R=w.nestedProperty(t.layout,E).get(),B=w.nestedProperty(c,E).get(),q=C.get();if(void 0!==S){x[M]=S,b[M]="reverse"===D?S:h(q);var H=T.getLayoutValObject(c,C.parts);if(H&&H.impliedEdits&&null!==S)for(var U in H.impliedEdits)r(w.relativeAttr(M,U),H.impliedEdits[U]);if(-1!==["width","height"].indexOf(M)&&null===S)c[M]=t._initialAutoSize[M];else if(P.match(/^[xyz]axis[0-9]*\.range(\[[0|1]\])?$/))a(P),w.nestedProperty(c,E+"._inputRange").set(null);else if(P.match(/^[xyz]axis[0-9]*\.autorange$/)){a(P),w.nestedProperty(c,E+"._inputRange").set(null);var G=w.nestedProperty(c,E).get();G._inputDomain&&(G._input.domain=G._inputDomain.slice())}else P.match(/^[xyz]axis[0-9]*\.domain(\1]\])?$/)&&w.nestedProperty(c,E+"._inputDomain").set(null);if("type"===D){var X=R,Y="linear"===B.type&&"log"===S,Z="log"===B.type&&"linear"===S;if(Y||Z){if(X&&X.range)if(B.autorange)Y&&(X.range=X.range[1]>X.range[0]?[1,2]:[2,1]);else{var W=X.range[0],Q=X.range[1];Y?(W<=0&&Q<=0&&r(E+".autorange",!0),W<=0?W=Q/1e6:Q<=0&&(Q=W/1e6),r(E+".range[0]",Math.log(W)/Math.LN10),r(E+".range[1]",Math.log(Q)/Math.LN10)):(r(E+".range[0]",Math.pow(10,W)),r(E+".range[1]",Math.pow(10,Q)))}else r(E+".autorange",!0);A.getComponentMethod("annotations","convertCoords")(t,B,S,r),A.getComponentMethod("images","convertCoords")(t,B,S,r)}else r(E+".autorange",!0),r(E+".range",null);w.nestedProperty(c,E+"._inputRange").set(null)}else if(D.match(j.AX_NAME_PATTERN)){var $=w.nestedProperty(c,M).get(),J=(S||{}).type;J&&"-"!==J||(J="linear"),A.getComponentMethod("annotations","convertCoords")(t,$,J,r),A.getComponentMethod("images","convertCoords")(t,$,J,r)}var K=N.containerArrayMatch(M);if(K){i=K.array,o=K.index;var tt=K.property,et=w.nestedProperty(s,i),rt=(et||[])[o]||{},nt=rt,at=H||{editType:"calc"},it=-1!==at.editType.indexOf("calcIfAutorange");""===o?(it?m.calc=!0:F.update(m,at),it=!1):""===tt&&(nt=S,N.isAddVal(S)?b[M]=null:N.isRemoveVal(S)?(b[M]=rt,nt=rt):w.warn("unrecognized full object value",e)),it&&(n(nt,"x")||n(nt,"y"))?m.calc=!0:F.update(m,at),d[i]||(d[i]={});var ot=d[i][o];ot||(ot=d[i][o]={}),ot[tt]=S,delete e[M]}else"reverse"===D?(R.range?R.range.reverse():(r(E+".autorange",!0),R.range=[1,0]),B.autorange?m.calc=!0:m.plot=!0):((!c._has("gl2d")||"dragmode"!==M||"lasso"!==S&&"select"!==S||"lasso"===q||"select"===q)&&H?F.update(m,H):m.calc=!0,C.set(S))}}for(i in d){N.applyContainerArrayChanges(t,w.nestedProperty(s,i),d[i],m)||(m.plot=!0)}var lt=c._axisConstraintGroups;for(y in k)for(o=0;o<lt.length;o++){var st=lt[o];if(st[y]){m.calc=!0;for(var ct in st)k[ct]||(V.getFromId(t,ct)._constraintShrinkable=!0)}}var ut=c.width,ft=c.height;return t.layout.autosize&&L.plotAutoSize(t,t.layout,c),(e.height||e.width||c.width!==ut||c.height!==ft)&&(m.calc=!0),(m.plot||m.calc)&&(m.layoutReplot=!0),{flags:m,undoit:b,redoit:x,eventData:w.extendDeep({},x)}}function y(t){var e=m.select(t),r=t._fullLayout;if(r._container=e.selectAll(".plot-container").data([0]),r._container.enter().insert("div",":first-child").classed("plot-container",!0).classed("plotly",!0),r._paperdiv=r._container.selectAll(".svg-container").data([0]),r._paperdiv.enter().append("div").classed("svg-container",!0).style("position","relative"),r._glcontainer=r._paperdiv.selectAll(".gl-container").data([0]),r._glcontainer.enter().append("div").classed("gl-container",!0),r._paperdiv.selectAll(".main-svg").remove(),r._paper=r._paperdiv.insert("svg",":first-child").classed("main-svg",!0),r._toppaper=r._paperdiv.append("svg").classed("main-svg",!0),!r._uid){var n=[];m.selectAll("defs").each(function(){this.id&&n.push(this.id.split("-")[1])}),r._uid=w.randstr(n)}r._paperdiv.selectAll(".main-svg").attr(P.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 a=r._paper.append("g").classed("layer-below",!0);r._imageLowerLayer=a.append("g").classed("imagelayer",!0),r._shapeLowerLayer=a.append("g").classed("shapelayer",!0),r._cartesianlayer=r._paper.append("g").classed("cartesianlayer",!0),r._ternarylayer=r._paper.append("g").classed("ternarylayer",!0),r._geolayer=r._paper.append("g").classed("geolayer",!0);var i=r._paper.append("g").classed("layer-above",!0);r._imageUpperLayer=i.append("g").classed("imagelayer",!0),r._shapeUpperLayer=i.append("g").classed("shapelayer",!0),r._pielayer=r._paper.append("g").classed("pielayer",!0),r._glimages=r._paper.append("g").classed("glimages",!0),r._infolayer=r._toppaper.append("g").classed("infolayer",!0),r._zoomlayer=r._toppaper.append("g").classed("zoomlayer",!0),r._hoverlayer=r._toppaper.append("g").classed("hoverlayer",!0),t.emit("plotly_framework")}var m=t("d3"),x=t("fast-isnumeric"),b=t("has-hover"),_=t("../plotly"),w=t("../lib"),k=t("../lib/events"),M=t("../lib/queue"),A=t("../registry"),T=t("./plot_schema"),L=t("../plots/plots"),C=t("../plots/polar"),S=t("../plots/cartesian/graph_interact"),O=t("../components/drawing"),z=t("../components/color"),D=t("../components/errorbars"),P=t("../constants/xmlns_namespaces"),E=t("../lib/svg_text_utils"),N=t("./manage_arrays"),I=t("./helpers"),R=t("./subroutines"),F=t("./edit_types"),j=t("../plots/cartesian/constants"),B=t("../plots/cartesian/constraints"),q=B.enforce,H=B.clean,V=t("../plots/cartesian/axis_ids");_.plot=function(t,e,r,n){function a(){if(g)return _.addFrames(t,g)}function l(){for(var e=b._basePlotModules,r=0;r<e.length;r++)e[r].drawFramework&&e[r].drawFramework(t);return w.syncOrAsync([R.layoutStyles],t)}function s(){var e,r,n,a=t.calcdata;for(A.getComponentMethod("legend","draw")(t),A.getComponentMethod("rangeselector","draw")(t),A.getComponentMethod("sliders","draw")(t),A.getComponentMethod("updatemenus","draw")(t),e=0;e<a.length;e++)r=a[e],n=r[0].trace,!0===n.visible&&n._module.colorbar?n._module.colorbar(t,r):L.autoMargin(t,"cb"+n.uid);return L.doAutoMargin(t),L.previousPromises(t)}function c(){if(JSON.stringify(b._size)!==C)return w.syncOrAsync([s,R.layoutStyles],t)}function u(){if(!M)return void q(t);var e,r,n,a=L.getSubplotIds(b,"cartesian"),i=b._modules,o=[];for(n=0;n<i.length;n++)w.pushUnique(o,i[n].setPositions);if(o.length)for(r=0;r<a.length;r++)for(e=b._plots[a[r,n=0;n<o.length;n++)o[n](t,e);return D.calc(t),w.syncOrAsync([A.getComponentMethod("shapes","calcAutorange"),A.getComponentMethod("annotations","calcAutorange"),f,A.getComponentMethod("rangeslider","calcAutorange")],t)}function f(){if(!t._transitioning){for(var e=_.Axes.list(t,"",!0),r=0;r<e.length;r++){var n=e[r];H(t,n),_.Axes.doAutoRange(n)}q(t),x&&_.Axes.saveRangeInitial(t)}}function d(){return _.Axes.doTicks(t,"redraw")}function p(){var e,r=t.calcdata,n=b._infolayer.selectAll("g.rangeslider-container");for(e=0;e<r.length;e++){var a=r[e][0].trace,i=!0===a.visible,o=a.uid;if(!i||!A.traceIs(a,"2dMap")){var l=".hm"+o+",.contour"+o+",#clip"+o;b._paper.selectAll(l).remove(),n.selectAll(l).remove()}i&&a._module.colorbar||b._infolayer.selectAll(".cb"+o).remove()}var s=b._basePlotModules;for(e=0;e<s.length;e++)s[e].plot(t);var c=b._paper.selectAll(".layer-subplot");return b._shapeSubplotLayers=c.selectAll(".shapelayer"),L.style(t),A.getComponentMethod("shapes","draw")(t),A.getComponentMethod("annotations","draw")(t),L.addLinks(t),b._replotting=!1,L.previousPromises(t)}function h(){A.getComponentMethod("shapes","draw")(t),A.getComponentMethod("images","draw")(t),A.getComponentMethod("annotations","draw")(t),A.getComponentMethod("legend","draw")(t),A.getComponentMethod("rangeslider","draw")(t),A.getComponentMethod("rangeselector","draw")(t),A.getComponentMethod("sliders","draw")(t),A.getComponentMethod("updatemenus","draw")(t)}var g;if(t=w.getGraphDiv(t),k.init(t),w.isPlainObject(e)){var v=e;e=v.data,r=v.layout,n=v.config,g=v.frames}if(!1===k.triggerHandler(t,"plotly_beforeplot",[e,r,n]))return Promise.reject();e||r||w.isPlotDiv(t)||w.warn("Calling Plotly.plot as if redrawing but this container doesn't yet have a plot.",t),i(t,n),r||(r={}),m.select(t).classed("js-plotly-plot",!0),O.makeTester(),Array.isArray(t._promises)||(t._promises=[]);var x=0===(t.data||[]).length&&Array.isArray(e);if(Array.isArray(e)&&(I.cleanData(e,t.data),x?t.data=e:t.data.push.apply(t.data,e),t.empty=!1),t.layout&&!x||(t.layout=I.cleanLayout(r)),t._dragging&&!t._transitioning)return t._replotPending=!0,Promise.reject();t._replotPending=!1,L.supplyDefaults(t);var b=t._fullLayout;if(e&&e[0]&&e[0].r)return o(t,e,r);b._replotting=!0,x&&y(t),t.framework!==y&&(t.framework=y,y(t)),O.initGradients(t),x&&_.Axes.saveShowSpikeInitial(t);var M=!t.calcdata||t.calcdata.length!==(t._fullData||[]).length;M&&L.doCalcdata(t);for(var T=0;T<t.calcdata.length;T++)t.calcdata[T][0].trace=t._fullData[T];var C=JSON.stringify(b._size),z=[L.previousPromises,a,l,s,c,u,R.layoutStyles,d,p,h,S,L.rehover,L.previousPromises],P=w.syncOrAsync(z,t);return P&&P.then||(P=Promise.resolve()),P.then(function(){return t.emit("plotly_afterplot"),t})},_.redraw=function(t){if(t=w.getGraphDiv(t),!w.isPlotDiv(t))throw new Error("This element is not a Plotly plot: "+t);return I.cleanData(t.data,t.data),I.cleanLayout(t.layout),t.calcdata=void 0,_.plot(t).then(function(){return t.emit("plotly_redraw"),t})},_.newPlot=function(t,e,r,n){return t=w.getGraphDiv(t),L.cleanPlot([],{},t._fullData||{},t._fullLayout||{}),L.purge(t),_.plot(t,e,r,n)},_.extendTraces=function t(e,r,n,a){e=w.getGraphDiv(e);var i=p(e,r,n,a,function(t,e){return t.concat(e)},function(t,e){return t.splice(0,t.length-e)}),o=_.redraw(e),l=[e,i.update,n,i.maxPoints];return M.add(e,_.prependTraces,l,t,arguments),o},_.prependTraces=function t(e,r,n,a){e=w.getGraphDiv(e);var i=p(e,r,n,a,function(t,e){return e.concat(t)},function(t,e){return t.splice(e,t.length)}),o=_.redraw(e),l=[e,i.update,n,i.maxPoints];return M.add(e,_.extendTraces,l,t,arguments),o},_.addTraces=function t(e,r,n){e=w.getGraphDiv(e);var a,i,o=[],l=_.deleteTraces,s=t,f=[e,o],d=[e,r];for(u(e,r,n),Array.isArray(r)||(r=[r]),r=r.map(function(t){return w.extendFlat({},t)}),I.cleanData(r,e.data),a=0;a<r.length;a++)e.data.push(r[a]);for(a=0;a<r.length;a++)o.push(-r.length+a);if(void 0===n)return i=_.redraw(e),M.add(e,l,f,s,d),i;Array.isArray(n)||(n=[n]);try{c(e,o,n)}catch(t){throw e.data.splice(e.data.length-r.length,r.length),t}return M.startSequence(e),M.add(e,l,f,s,d),i=_.moveTraces(e,o,n),M.stopSequence(e),i},_.deleteTraces=function t(e,r){e=w.getGraphDiv(e);var n,a,i=[],o=_.addTraces,c=t,u=[e,i,r],f=[e,r];if(void 0===r)throw new Error("indices must be an integer or array of integers.");for(Array.isArray(r)||(r=[r]),s(e,r,"indices"),r=l(r,e.data.length-1),r.sort(w.sorterDes),n=0;n<r.length;n+=1)a=e.data.splice(r[n],1)[0],i.push(a);var d=_.redraw(e);return M.add(e,o,u,c,f),d},_.moveTraces=function t(e,r,n){e=w.getGraphDiv(e);var a,i=[],o=[],s=t,u=t,f=[e,n,r],d=[e,r,n];if(c(e,r,n),r=Array.isArray(r)?r:[r],void 0===n)for(n=[],a=0;a<r.length;a++)n.push(-r.length+a);for(n=Array.isArray(n)?n:[n],r=l(r,e.data.length-1),n=l(n,e.data.length-1),a=0;a<e.data.length;a++)-1===r.indexOf(a)&&i.push(e.data[a]);for(a=0;a<r.length;a++)o.push({newIndex:n[a],trace:e.data[r[a]]});for(o.sort(function(t,e){return t.newIndex-e.newIndex}),a=0;a<o.length;a+=1)i.splice(o[a].newIndex,0,o[a].trace);e.data=i;var p=_.redraw(e);return M.add(e,s,f,u,d),p},_.restyle=function t(e,r,n,a){e=w.getGraphDiv(e),I.clearPromiseQueue(e);var i={};if("string"==typeof r)i[r]=n;else{if(!w.isPlainObject(r))return w.warn("Restyle fail.",r,n,a),Promise.reject();i=w.extendFlat({},r),void 0===a&&(a=n)}Object.keys(i).length&&(e.changed=!0);var o=I.coerceTraceIndices(e,a),l=g(e,i,o),s=l.flags;s.clearCalc&&(e.calcdata=void 0),s.clearAxisTypes&&I.clearAxisTypes(e,o,{});var c=[];s.fullReplot?c.push(_.plot):(c.push(L.previousPromises),L.supplyDefaults(e),s.style&&c.push(R.doTraceStyle),s.colorbars&&c.push(R.doColorBars)),c.push(L.rehover),M.add(e,t,[e,l.undoit,l.traces],t,[e,l.redoit,l.traces]);var u=w.syncOrAsync(c,e);return u&&u.then||(u=Promise.resolve()),u.then(function(){return e.emit("plotly_restyle",l.eventData),e})},_.relayout=function t(e,r,n){if(e=w.getGraphDiv(e),I.clearPromiseQueue(e),e.framework&&e.framework.isPolar)return Promise.resolve(e);var a={};if("string"==typeof r)a[r]=n;else{if(!w.isPlainObject(r))return w.warn("Relayout fail.",r,n),Promise.reject();a=w.extendFlat({},r)}Object.keys(a).length&&(e.changed=!0);var i=v(e,a),o=i.flags;o.calc&&(e.calcdata=void 0);var l=[L.previousPromises];o.layoutReplot?l.push(R.layoutReplot):Object.keys(a).length&&(L.supplyDefaults(e),o.legend&&l.push(R.doLegend),o.layoutstyle&&l.push(R.layoutStyles),o.ticks&&l.push(R.doTicksRelayout),o.modebar&&l.push(R.doModeBar),o.camera&&l.push(R.doCamera)),l.push(L.rehover),M.add(e,t,[e,i.undoit],t,[e,i.redoit]);var s=w.syncOrAsync(l,e);return s&&s.then||(s=Promise.resolve(e)),s.then(function(){return e.emit("plotly_relayout",i.eventData),e})},_.update=function t(e,r,n,a){if(e=w.getGraphDiv(e),I.clearPromiseQueue(e),e.framework&&e.framework.isPolar)return Promise.resolve(e);w.isPlainObject(r)||(r={}),w.isPlainObject(n)||(n={}),Object.keys(r).length&&(e.changed=!0),Object.keys(n).length&&(e.changed=!0);var i=I.coerceTraceIndices(e,a),o=g(e,w.extendFlat({},r),i),l=o.flags,s=v(e,w.extendFlat({},n)),c=s.flags;(l.clearCalc||c.calc)&&(e.calcdata=void 0),l.clearAxisTypes&&I.clearAxisTypes(e,i,n);var u=[];if(l.fullReplot&&c.layoutReplot){var f=e.data,d=e.layout;e.data=void 0,e.layout=void 0,u.push(function(){return _.plot(e,f,d)})}else l.fullReplot?u.push(_.plot):c.layoutReplot?u.push(R.layoutReplot):(u.push(L.previousPromises),L.supplyDefaults(e),l.style&&u.push(R.doTraceStyle),l.colorbars&&u.push(R.doColorBars),c.legend&&u.push(R.doLegend),c.layoutstyle&&u.push(R.layoutStyles),c.ticks&&u.push(R.doTicksRelayout),c.modebar&&u.push(R.doModeBar),c.camera&&u.push(R.doCamera));u.push(L.rehover),M.add(e,t,[e,o.undoit,s.undoit,o.traces],t,[e,o.redoit,s.redoit,o.traces]);var p=w.syncOrAsync(u,e);return p&&p.then||(p=Promise.resolve(e)),p.then(function(){return e.emit("plotly_update",{data:o.eventData,layout:s.eventData}),e})},_.animate=function(t,e,r){function n(t){return Array.isArray(l)?t>=l.length?l[0]:l[t]:l}function a(t){return Array.isArray(s)?t>=s.length?s[0]:s[t]:s}function i(t,e){var r=0;return function(){if(t&&++r===e)return t()}}if(t=w.getGraphDiv(t),!w.isPlotDiv(t))throw new Error("This element is not a Plotly plot: "+t+". It's likely that you've failed to create a plot before animating it. For more details, see https://plot.ly/javascript/animations/");var o=t._transitionData;o._frameQueue||(o._frameQueue=[]),r=L.supplyAnimationDefaults(r);var l=r.transition,s=r.frame;return void 0===o._frameWaitingCnt&&(o._frameWaitingCnt=0),new Promise(function(s,c){function u(){t.emit("plotly_animated"),window.cancelAnimationFrame(o._animationRaf),o._animationRaf=null}function f(){o._currentFrame&&o._currentFrame.onComplete&&o._currentFrame.onComplete();var e=o._currentFrame=o._frameQueue.shift();if(e){var r=e.name?e.name.toString():null;t._fullLayout._currentFrame=r,o._lastFrameAt=Date.now(),o._timeToNext=e.frameOpts.duration,L.transition(t,e.frame.data,e.frame.layout,I.coerceTraceIndices(t,e.frame.traces),e.frameOpts,e.transitionOpts).then(function(){e.onComplete&&e.onComplete()}),t.emit("plotly_animatingframe",{name:r,frame:e.frame,animation:{frame:e.frameOpts,transition:e.transitionOpts}})}else u()}function d(){t.emit("plotly_animating"),o._lastFrameAt=-1/0,o._timeToNext=0,o._runningTransitions=0,o._currentFrame=null;var e=function(){o._animationRaf=window.requestAnimationFrame(e),Date.now()-o._lastFrameAt>o._timeToNext&&f()};e()}function p(t){return Array.isArray(l)?v>=l.length?t.transitionOpts=l[v]:t.transitionOpts=l[0]:t.transitionOpts=l,v++,t}var h,g,v=0,y=[],m=void 0===e||null===e,x=Array.isArray(e);if(m||x||!w.isPlainObject(e)){if(m||-1!==["string","number"].indexOf(typeof e))for(h=0;h<o._frames.length;h++)(g=o._frames[h])&&(m||String(g.group)===String(e))&&y.push({type:"byname",name:String(g.name),data:p({name:g.name})});else if(x)for(h=0;h<e.length;h++){var b=e[h];-1!==["number","string"].indexOf(typeof b)?(b=String(b),y.push({type:"byname",name:b,data:p({name:b})})):w.isPlainObject(b)&&y.push({type:"object",data:p(w.extendFlat({},b))})}}else y.push({type:"object",data:p(w.extendFlat({},e))});for(h=0;h<y.length;h++)if(g=y[h],"byname"===g.type&&!o._frameHash[g.data.name])return w.warn('animate failure: frame not found: "'+g.data.name+'"'),void c();-1!==["next","immediate"].indexOf(r.mode)&&function(){if(0!==o._frameQueue.length){for(;o._frameQueue.length;){var e=o._frameQueue.pop();e.onInterrupt&&e.onInterrupt()}t.emit("plotly_animationinterrupted",[])}}(),"reverse"===r.direction&&y.reverse();var _=t._fullLayout._currentFrame;if(_&&r.fromcurrent){var k=-1;for(h=0;h<y.length;h++)if(g=y[h],"byname"===g.type&&g.name===_){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(e){if(0!==e.length){for(var l=0;l<e.length;l++){var u;u="byname"===e[l].type?L.computeFrame(t,e[l].name):e[l].data;var f=a(l),p=n(l);p.duration=Math.min(p.duration,f.duration);var h={frame:u,name:e[l].name,frameOpts:f,transitionOpts:p};l===e.length-1&&(h.onComplete=i(s,2),h.onInterrupt=c),o._frameQueue.push(h)}"immediate"===r.mode&&(o._lastFrameAt=-1/0),o._animationRaf||d()}}(y):(t.emit("plotly_animated"),s())})},_.addFrames=function(t,e,r){t=w.getGraphDiv(t);var n=0;if(null===e||void 0===e)return Promise.resolve();if(!w.isPlotDiv(t))throw new Error("This element is not a Plotly plot: "+t+". It's likely that you've failed to create a plot before adding frames. For more details, see https://plot.ly/javascript/animations/");var a,i,o,l,s=t._transitionData._frames,c=t._transitionData._frameHash;if(!Array.isArray(e))throw new Error("addFrames failure: frameList must be an Array of frame definitions"+e);var u=s.length+2*e.length,f=[];for(a=e.length-1;a>=0;a--)if(w.isPlainObject(e[a])){var d=(c[e[a].name]||{}).name,p=e[a].name;d&&p&&"number"==typeof p&&c[d]&&(n++,w.warn('addFrames: overwriting frame "'+c[d].name+'" with a frame whose name of type "number" also equates to "'+d+'". This is valid but may potentially lead to unexpected behavior since all plotly.js frame names are stored internally as strings.'),n>5&&w.warn("addFrames: This API call has yielded too many warnings. For the rest of this call, further warnings about numeric frame names will be suppressed.")),f.push({frame:L.supplyFrameDefaults(e[a]),index:r&&void 0!==r[a]&&null!==r[a]?r[a]:u+a})}f.sort(function(t,e){return t.index>e.index?-1:t.index<e.index?1:0});var h=[],g=[],v=s.length;for(a=f.length-1;a>=0;a--){if(i=f[a].frame,"number"==typeof i.name&&w.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!i.name)for(;c[i.name="frame "+t._transitionData._counter++];);if(c[i.name]){for(o=0;o<s.length&&(s[o]||{}).name!==i.name;o++);h.push({type:"replace",index:o,value:i}),g.unshift({type:"replace",index:o,value:s[o]})}else l=Math.max(0,Math.min(f[a].index,v)),h.push({type:"insert",index:l,value:i}),g.unshift({type:"delete",index:l}),v++}var y=L.modifyFrames,m=L.modifyFrames,x=[t,g],b=[t,h];return M&&M.add(t,y,x,m,b),L.modifyFrames(t,h)},_.deleteFrames=function(t,e){if(t=w.getGraphDiv(t),!w.isPlotDiv(t))throw new Error("This element is not a Plotly plot: "+t);var r,n,a=t._transitionData._frames,i=[],o=[];if(!e)for(e=[],r=0;r<a.length;r++)e.push(r);for(e=e.slice(0),e.sort(),r=e.length-1;r>=0;r--)n=e[r],i.push({type:"delete",index:n}),o.unshift({type:"insert",index:n,value:a[n]});var l=L.modifyFrames,s=L.modifyFrames,c=[t,o],u=[t,i];return M&&M.add(t,l,c,s,u),L.modifyFrames(t,i)},_.purge=function(t){t=w.getGraphDiv(t);var e=t._fullLayout||{},r=t._fullData||[];return L.cleanPlot([],{},r,e),L.purge(t),k.purge(t),e._container&&e._container.remove(),delete t._context,t}},{"../components/color":34,"../components/drawing":58,"../components/errorbars":64,"../constants/xmlns_namespaces":135,"../lib":149,"../lib/events":142,"../lib/queue":162,"../lib/svg_text_utils":169,"../plotly":184,"../plots/cartesian/axis_ids":192,"../plots/cartesian/constants":194,"../plots/cartesian/constraints":196,"../plots/cartesian/graph_interact":198,"../plots/plots":218,"../plots/polar":221,"../registry":225,"./edit_types":173,"./helpers":174,"./manage_arrays":175,"./plot_schema":178,"./subroutines":181,d3:7,"fast-isnumeric":10,"has-hover":12}],177:[function(t,e,r){"use strict";e.exports={staticPlot:!1,editable:!1,edits:{annotationPosition:!1,annotationTail:!1,annotationText:!1,axisTitleText:!1,colorbarPosition:!1,colorbarTitleText:!1,legendPosition:!1,legendText:!1,shapePosition:!1,titleText:!1},autosizable:!1,queueLength:0,fillFrame:!1,frameMargins:0,scrollZoom:!1,doubleClick:"reset+autosize",showTips:!0,showAxisDragHandles:!0,showAxisRangeEntryBoxes:!0,showLink:!1,sendData:!0,linkText:"Edit chart",showSources:!1,displayModeBar:"hover",modeBarButtonsToRemove:[],modeBarButtonsToAdd:[],modeBarButtons:!1,displaylogo:!0,plotGlPixelRatio:2,setBackground:"transparent",topojsonURL:"https://cdn.plot.ly/",mapboxAccessToken:null,logging:!1,globalTransforms:[]}},{}],178:[function(t,e,r){"use strict";function n(t,e){var r,n,a,i,o=t._basePlotModules;if(o){var l;for(r=0;r<o.length;r++){if(a=o[r],a.attrRegex&&a.attrRegex.test(e)){if(a.layoutAttrOverrides)return a.layoutAttrOverrides;!l&&a.layoutAttributes&&(l=a.layoutAttributes)}var s=a.baseLayoutAttrOverrides;if(s&&e in s)return s[e]}if(l)return l}var c=t._modules;if(c)for(r=0;r<c.length;r++)if((i=c[r].layoutAttributes)&&e in i)return i[e];for(n in v.componentsRegistry)if(a=v.componentsRegistry[n],!a.schema&&e===a.name)return a.layoutAttributes;return e in x?x[e]:"radialaxis"===e||"angularaxis"===e?k[e]:k.layout[e]||!1}function a(t,e,r){if(!t)return!1;if(t._isLinkedToArray)if(i(e[r]))r++;else if(r<e.length)return!1;for(;r<e.length;r++){var n=t[e[r]];if(!y.isPlainObject(n))break;if(t=n,r===e.length-1)break;if(t._isLinkedToArray){if(r++,!i(e[r]))return!1}else if("info_array"===t.valType){r++;var a=e[r];if(!i(a)||a>=t.items.length)return!1;t=t.items[a]}}return t}function i(t){return t===Math.round(t)&&t>=0}function o(t){var e,r;"area"===t?(e={attributes:w},r={}):(e=v.modules[t]._module,r=e.basePlotModule);var n={};n.type=null,T(n,m),T(n,e.attributes),r.attributes&&T(n,r.attributes),n.type=t;var a={meta:e.meta||{},attributes:u(n)};if(e.layoutAttributes){var i={};T(i,e.layoutAttributes),a.layoutAttributes=u(i)}return a}function l(){var t,e,r={};T(r,x);for(t in v.subplotsRegistry)if(e=v.subplotsRegistry[t],e.layoutAttributes)if("cartesian"===e.name)h(r,e,"xaxis"),h(r,e,"yaxis");else{var n="subplot"===e.attr?e.name:e.attr;h(r,e,n)}r=p(r);for(t in v.componentsRegistry){e=v.componentsRegistry[t];var a=e.schema;if(a&&(a.subplots||a.layout)){var i=a.subplots;if(i&&i.xaxis&&!i.yaxis)for(var o in i.xaxis)delete r.yaxis[o]}else e.layoutAttributes&&g(r,e.layoutAttributes,e.name)}return{layoutAttributes:u(r)}}function s(t){var e=v.transformsRegistry[t],r=T({},e.attributes);return Object.keys(v.componentsRegistry).forEach(function(e){var n=v.componentsRegistry[e];n.schema&&n.schema.transforms&&n.schema.transforms[t]&&Object.keys(n.schema.transforms[t]).forEach(function(e){g(r,n.schema.transforms[t][e],e)})}),{attributes:u(r)}}function c(){var t={frames:y.extendDeepAll({},b)};return u(t),t.frames}function u(t){return f(t),d(t),t}function f(t){function e(t){return{valType:"string",editType:"none"}}function n(t,n,a){r.isValObject(t)?"data_array"===t.valType?(t.role="data",a[n+"src"]=e(n)):!0===t.arrayOk&&(a[n+"src"]=e(n)):y.isPlainObject(t)&&(t.role="object")}r.crawl(t,n)}function d(t){function e(t,e,r){if(t){var n=t[C];n&&(delete t[C],r[e]={items:{}},r[e].items[n]=t,r[e].role="object")}}r.crawl(t,e)}function p(t){return A(t,{radialaxis:k.radialaxis,angularaxis:k.angularaxis}),A(t,k.layout),t}function h(t,e,r){var n=y.nestedProperty(t,r),a=T({},e.layoutAttributes);a[L]=!0,n.set(a)}function g(t,e,r){var n=y.nestedProperty(t,r);n.set(T(n.get()||{},e))}var v=t("../registry"),y=t("../lib"),m=t("../plots/attributes"),x=t("../plots/layout_attributes"),b=t("../plots/frame_attributes"),_=t("../plots/animation_attributes"),w=t("../plots/polar/area_attributes"),k=t("../plots/polar/axis_attributes"),M=t("./edit_types"),A=y.extendFlat,T=y.extendDeepAll,L="_isSubplotObj",C="_isLinkedToArray",S=[L,C,"_arrayAttrRegexps","_deprecated"];r.IS_SUBPLOT_OBJ=L,r.IS_LINKED_TO_ARRAY=C,r.DEPRECATED="_deprecated",r.UNDERSCORE_ATTRS=S,r.get=function(){var t={};v.allTypes.concat("area").forEach(function(e){t[e]=o(e)});var e={};return Object.keys(v.transformsRegistry).forEach(function(t){e[t]=s(t)}),{defs:{valObjects:y.valObjectMeta,metaKeys:S.concat(["description","role","editType","impliedEdits"]),editType:{traces:M.traces,layout:M.layout},impliedEdits:{}},traces:t,layout:l(),transforms:e,frames:c(),animation:u(_)}},r.crawl=function(t,e,n,a){var i=n||0;a=a||"",Object.keys(t).forEach(function(n){var o=t[n];if(-1===S.indexOf(n)){var l=(a?a+".":"")+n;e(o,n,t,i,l),r.isValObject(o)||y.isPlainObject(o)&&"impliedEdits"!==n&&r.crawl(o,e,i+1,l)}})},r.isValObject=function(t){return t&&void 0!==t.valType},r.findArrayAttributes=function(t){function e(e,r,o,l){if(i=i.slice(0,l).concat([r]),e&&("data_array"===e.valType||!0===e.arrayOk)&&!("colorbar"===i[l-1]&&("ticktext"===r||"tickvals"===r))){var s=n(i),c=y.nestedProperty(t,s).get();Array.isArray(c)&&a.push(s)}}function n(t){return t.join(".")}var a=[],i=[];if(r.crawl(m,e),t._module&&t._module.attributes&&r.crawl(t._module.attributes,e),t.transforms)for(var o=t.transforms,l=0;l<o.length;l++){var s=o[l],c=s._module;c&&(i=["transforms["+l+"]"],r.crawl(c.attributes,e,1))}return t._fullInput&&t._fullInput._module&&t._fullInput._module.attributes&&(r.crawl(t._fullInput._module.attributes,e),a=y.filterUnique(a)),a},r.getTraceValObject=function(t,e){var r,n,o=e[0],l=1;if("transforms"===o){if(!Array.isArray(t.transforms))return!1;var s=e[1];if(!i(s)||s>=t.transforms.length)return!1;r=(v.transformsRegistry[t.transforms[s].type]||{}).attributes,n=r&&r[e[2]],l=3}else if("area"===t.type)n=w[o];else{var c=t._module;if(c||(c=(v.modules[t.type||m.type.dflt]||{})._module),!c)return!1;if(r=c.attributes,!(n=r&&r[o])){var u=c.basePlotModule;u&&u.attributes&&(n=u.attributes[o])}n||(n=m[o])}return a(n,e,l)},r.getLayoutValObject=function(t,e){return a(n(t,e[0]),e,1)}},{"../lib":149,"../plots/animation_attributes":185,"../plots/attributes":187,"../plots/frame_attributes":214,"../plots/layout_attributes":216,"../plots/polar/area_attributes":219,"../plots/polar/axis_attributes":220,"../registry":225,"./edit_types":173}],179:[function(t,e,r){"use strict";function n(t){o.register(t,t.name,t.categories,t.meta),o.subplotsRegistry[t.basePlotModule.name]||o.registerSubplot(t.basePlotModule)}function a(t){if("string"!=typeof t.name)throw new Error("Transform module *name* must be a string.");var e="Transform module "+t.name,r="function"==typeof t.transform,n="function"==typeof t.calcTransform;if(!r&&!n)throw new Error(e+" is missing a *transform* or *calcTransform* method.");r&&n&&l.log([e+" has both a *transform* and *calcTransform* methods.","Please note that all *transform* methods are executed","before all *calcTransform* methods."].join(" ")),l.isPlainObject(t.attributes)||l.log(e+" registered without an *attributes* object."),"function"!=typeof t.supplyDefaults&&l.log(e+" registered without a *supplyDefaults* method."),o.registerTransform(t)}function i(t){if("string"!=typeof t.name)throw new Error("Component module *name* must be a string.");o.registerComponent(t)}var o=t("../registry"),l=t("../lib");e.exports=function(t){if(!t)throw new Error("No argument passed to Plotly.register.");t&&!Array.isArray(t)&&(t=[t]);for(var e=0;e<t.length;e++){var r=t[e];if(!r)throw new Error("Invalid module was attempted to be registered!");switch(r.moduleType){case"trace":n(r);break;case"transform":a(r);break;case"component":i(r);break;default:throw new Error("Invalid module was attempted to be registered!")}}}},{"../lib":149,"../registry":225}],180:[function(t,e,r){"use strict";var n=t("../plotly"),a=t("../lib");e.exports=function(t){return a.extendFlat(n.defaultConfig,t)}},{"../lib":149,"../plotly":184}],181:[function(t,e,r){"use strict";function n(t,e,r){for(var n=0;n<r.length;n++){var a=r[n][0],i=r[n][1];if(!(a[0]>=t[1]||a[1]<=t[0])&&(i[0]<e[1]&&i[1]>e[0]))return!0}return!1}function a(t,e,r){return t._anchorAxis===e&&(t.mirror||t.side===r)||"all"===t.mirror||"allticks"===t.mirror||t.mirrors&&t.mirrors[e._id+r]}function i(t,e,r){var n=[],a=e._anchorAxis;if(a){var i=a._mainAxis;if(-1===n.indexOf(i)){n.push(i);for(var o=0;o<r.length;o++)r[o].overlaying===i._id&&-1===n.indexOf(r[o])&&n.push(r[o])}}return n}function o(t,e,r){for(var n=0;n<e.length;n++){var i=e[n],o=i._anchorAxis;if(o&&a(i,o,r))return h.crispRound(t,i.linewidth)}}function l(t,e,r,n,a,l){if(n)return r;var s,c=e._mainAxis,u=i(t,c,l),f=o(t,u,a);if(f)return f;for(s=0;s<l.length;s++)if(l[s].overlaying===c._id&&(u=i(t,l[s],l),f=o(t,u,a)))return f;return 0}var s=t("d3"),c=t("../plotly"),u=t("../registry"),f=t("../plots/plots"),d=t("../lib"),p=t("../components/color"),h=t("../components/drawing"),g=t("../components/titles"),v=t("../components/modebar"),y=t("../plots/cartesian/graph_interact"),m=t("../plots/cartesian/constants");r.layoutStyles=function(t){return d.syncOrAsync([f.doAutoMargin,r.lsInner],t)},r.lsInner=function(t){var e,i=t._fullLayout,o=i._size,u=o.p,f=c.Axes.list(t),d=i._has("cartesian");for(e=0;e<f.length;e++)f[e]._linepositions={};i._paperdiv.style({width:i.width+"px",height:i.height+"px"}).selectAll(".main-svg").call(h.setSize,i.width,i.height),t._context.setBackground(t,i.paper_bgcolor);var g=i._paper.selectAll("g.subplot"),y=[],x=[];g.each(function(t){var e=i._plots[t];if(e.mainplot)return e.bg&&e.bg.remove(),void(e.bg=void 0);var r=e.xaxis.domain,a=e.yaxis.domain,o=[];n(r,a,x)?o=[0]:(y.push(t),x.push([r,a]));var l=e.plotgroup.selectAll(".bg").data(o);l.enter().append("rect").classed("bg",!0),l.exit().remove(),l.each(function(){e.bg=l;var t=e.plotgroup.node();t.insertBefore(this,t.childNodes[0])})});var b=i._bgLayer.selectAll(".bg").data(y);b.enter().append("rect").classed("bg",!0),b.exit().remove(),b.each(function(t){i._plots[t].bg=s.select(this)});var _={};return g.each(function(r){function n(t,e){ return e?"M"+E+","+t+"H"+I:""}function s(t,e){return e?"M"+t+","+V+"V"+q:""}var c=i._plots[r],g=c.xaxis,v=c.yaxis;g.setScale(),v.setScale(),c.bg&&d&&c.bg.call(h.setRect,g._offset-u,v._offset-u,g._length+2*u,v._length+2*u).call(p.fill,i.plot_bgcolor).style("stroke-width",0),c.clipId="clip"+i._uid+r+"plot";var y=i._clips.selectAll("#"+c.clipId).data([0]);y.enter().append("clipPath").attr({class:"plotclip",id:c.clipId}).append("rect"),y.selectAll("rect").attr({width:g._length,height:v._length}),h.setTranslate(c.plot,g._offset,v._offset);var x,b;for(c._hasClipOnAxisFalse?(x=null,b=c.clipId):(x=c.clipId,b=null),h.setClipUrl(c.plot,x),e=0;e<m.traceLayerClasses.length;e++){var w=m.traceLayerClasses[e];"scatterlayer"!==w&&c.plot.selectAll("g."+w).call(h.setClipUrl,b)}c.layerClipId=b;var k=!g._anchorAxis,M=k&&!_[g._id],A=a(g,v,"bottom"),T=a(g,v,"top"),L=!v._anchorAxis,C=L&&!_[v._id],S=a(v,g,"left"),O=a(v,g,"right"),z=h.crispRound(t,g.linewidth,1),D=h.crispRound(t,v.linewidth,1),P=l(t,g,D,S,"left",f),E=!k&&P?-u-P:0,N=l(t,g,D,O,"right",f),I=g._length+(!k&&N?u+N:0),R=o.h*(1-(g.position||0))+z/2%1,F=v._length+u+z/2,j=-u-z/2,B=!L&&l(t,v,z,A,"bottom",f),q=v._length+(B?u:0),H=!L&&l(t,v,z,T,"top",f),V=H?-u:0,U=o.w*(v.position||0)+D/2%1,G=-u-D/2,X=g._length+u+D/2;g._linepositions[r]=[A?F:void 0,T?j:void 0,M?R:void 0],g._anchorAxis===v?g._linepositions[r][3]="top"===g.side?j:F:M&&(g._linepositions[r][3]=R),v._linepositions[r]=[S?G:void 0,O?X:void 0,C?U:void 0],v._anchorAxis===g?v._linepositions[r][3]="right"===v.side?X:G:C&&(v._linepositions[r][3]=U);var Y="translate("+g._offset+","+v._offset+")",Z=Y,W=Y;M&&(Z="translate("+g._offset+","+o.t+")",j+=v._offset-o.t,F+=v._offset-o.t),C&&(W="translate("+o.l+","+v._offset+")",G+=g._offset-o.l,X+=g._offset-o.l),d&&(c.xlines.attr("transform",Z).attr("d",n(F,A)+n(j,T)+n(R,M)||"M0,0").style("stroke-width",z+"px").call(p.stroke,g.showline?g.linecolor:"rgba(0,0,0,0)"),c.ylines.attr("transform",W).attr("d",s(G,S)+s(X,O)+s(U,C)||"M0,0").style("stroke-width",D+"px").call(p.stroke,v.showline?v.linecolor:"rgba(0,0,0,0)")),c.xaxislayer.attr("transform",Z),c.yaxislayer.attr("transform",W),c.gridlayer.attr("transform",Y),c.zerolinelayer.attr("transform",Y),c.draglayer.attr("transform",Y),M&&(_[g._id]=1),C&&(_[v._id]=1)}),c.Axes.makeClipPaths(t),r.drawMainTitle(t),v.manage(t),t._promises.length&&Promise.all(t._promises)},r.drawMainTitle=function(t){var e=t._fullLayout;g.draw(t,"gtitle",{propContainer:e,propName:"title",dfltName:"Plot",attributes:{x:e.width/2,y:e._size.t/2,"text-anchor":"middle"}})},r.doTraceStyle=function(t){for(var e=0;e<t.calcdata.length;e++){var r=t.calcdata[e],n=((r[0]||{}).trace||{})._module||{},a=n.arraysToCalcdata;a&&a(r,r[0].trace)}return f.style(t),u.getComponentMethod("legend","draw")(t),f.previousPromises(t)},r.doColorBars=function(t){for(var e=0;e<t.calcdata.length;e++){var r=t.calcdata[e][0];if((r.t||{}).cb){var n=r.trace,a=r.t.cb;u.traceIs(n,"contour")&&a.line({width:!1!==n.contours.showlines?n.line.width:0,dash:n.line.dash,color:"line"===n.contours.coloring?a._opts.line.color:n.line.color}),u.traceIs(n,"markerColorscale")?a.options(n.marker.colorbar)():a.options(n.colorbar)()}}return f.previousPromises(t)},r.layoutReplot=function(t){var e=t.layout;return t.layout=void 0,c.plot(t,"",e)},r.doLegend=function(t){return u.getComponentMethod("legend","draw")(t),f.previousPromises(t)},r.doTicksRelayout=function(t){return c.Axes.doTicks(t,"redraw"),r.drawMainTitle(t),f.previousPromises(t)},r.doModeBar=function(t){var e=t._fullLayout;v.manage(t),y(t);for(var r=0;r<e._basePlotModules.length;r++){var n=e._basePlotModules[r].updateFx;n&&n(e)}return f.previousPromises(t)},r.doCamera=function(t){for(var e=t._fullLayout,r=f.getSubplotIds(e,"gl3d"),n=0;n<r.length;n++){var a=e[r[n]];a._scene.setCamera(a.camera)}}},{"../components/color":34,"../components/drawing":58,"../components/modebar":95,"../components/titles":124,"../lib":149,"../plotly":184,"../plots/cartesian/constants":194,"../plots/cartesian/graph_interact":198,"../plots/plots":218,"../registry":225,d3:7}],182:[function(t,e,r){"use strict";function n(t,e){function r(t){return!(t in e)||i.validate(e[t],c[t])}function n(t,r){return i.coerce(e,y,c,t,r)}function f(){return new Promise(function(t){setTimeout(t,o.getDelay(M._fullLayout))})}function d(){return new Promise(function(t,e){var r=l(M,m,_),n=M._fullLayout.width,o=M._fullLayout.height;if(a.purge(M),document.body.removeChild(M),"svg"===m)return t(k?r:"data:image/svg+xml,"+encodeURIComponent(r));var c=document.createElement("canvas");c.id=i.randstr(),s({format:m,width:n,height:o,scale:_,canvas:c,svg:r,promise:!0}).then(t).catch(e)})}function p(t){return k?t.replace(u,""):t}e=e||{};var h,g,v;if(i.isPlainObject(t)?(h=t.data||[],g=t.layout||{},v=t.config||{}):(t=i.getGraphDiv(t),h=i.extendDeep([],t.data),g=i.extendDeep({},t.layout),v=t._context),!r("width")||!r("height"))throw new Error("Height and width should be pixel values.");if(!r("format"))throw new Error("Image format is not jpeg, png, svg or webp.");var y={},m=n("format"),x=n("width"),b=n("height"),_=n("scale"),w=n("setBackground"),k=n("imageDataOnly"),M=document.createElement("div");M.style.position="absolute",M.style.left="-5000px",document.body.appendChild(M);var A=i.extendFlat({},g);x&&(A.width=x),b&&(A.height=b);var T=i.extendFlat({},v,{staticPlot:!0,setBackground:w}),L=o.getRedrawFunc(M);return new Promise(function(t,e){a.plot(M,h,A,T).then(L).then(f).then(d).then(function(e){t(p(e))}).catch(function(t){e(t)})})}var a=t("../plotly"),i=t("../lib"),o=t("../snapshot/helpers"),l=t("../snapshot/tosvg"),s=t("../snapshot/svgtoimg"),c={format:{valType:"enumerated",values:["png","jpeg","webp","svg"],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}},u=/^data:image\/\w+;base64,/;e.exports=n},{"../lib":149,"../plotly":184,"../snapshot/helpers":229,"../snapshot/svgtoimg":231,"../snapshot/tosvg":233}],183:[function(t,e,r){"use strict";function n(t,e,r,a,i,c){c=c||[];for(var u=Object.keys(t),d=0;d<u.length;d++){var p=u[d];if("transforms"!==p){var v=c.slice();v.push(p);var y=t[p],m=e[p],x=s(r,p),b="info_array"===(x||{}).valType,_="colorscale"===(x||{}).valType;if(l(r,p))if(h(y)&&h(m))n(y,m,x,a,i,v);else if(x.items&&!b&&g(y)){var w,k,M=x.items,A=M[Object.keys(M)[0]],T=[];for(w=0;w<m.length;w++){var L=m[w]._index||w;k=v.slice(),k.push(L),h(y[L])&&h(m[w])&&(T.push(L),n(y[L],m[w],A,a,i,k))}for(w=0;w<y.length;w++)k=v.slice(),k.push(w),h(y[w])?-1===T.indexOf(w)&&a.push(o("unused",i,k)):a.push(o("object",i,k,y[w]))}else!h(y)&&h(m)?a.push(o("object",i,v,y)):g(y)||!g(m)||b||_?p in e?f.validate(y,x)?"enumerated"===x.valType&&(x.coerceNumber&&y!==+m||y!==m)&&a.push(o("dynamic",i,v,y,m)):a.push(o("value",i,v,y)):a.push(o("unused",i,v,y)):a.push(o("array",i,v,y));else a.push(o("schema",i,v))}}return a}function a(t,e){for(var r=0;r<e.length;r++){var n=e[r].type,a=t.traces[n].layoutAttributes;a&&f.extendFlat(t.layout.layoutAttributes,a)}return t.layout.layoutAttributes}function i(t){return g(t)?"In data trace "+t[1]+", ":"In "+t+", "}function o(t,e,r,n,a){r=r||"";var i,o;g(e)?(i=e[0],o=e[1]):(i=e,o=null);var l=u(r),s=v[t](e,l,n,a);return f.log(s),{code:t,container:i,trace:o,path:r,astr:l,msg:s}}function l(t,e){var r=c(e),n=r.keyMinusId,a=r.id;return!!(n in t&&t[n]._isSubplotObj&&a)||e in t}function s(t,e){return t[c(e).keyMinusId]}function c(t){var e=t.match(y);return{keyMinusId:e&&e[1],id:e&&e[2]}}function u(t){if(!g(t))return String(t);for(var e="",r=0;r<t.length;r++){var n=t[r];"number"==typeof n?e=e.substr(0,e.length-1)+"["+n+"]":e+=n,r<t.length-1&&(e+=".")}return e}var f=t("../lib"),d=t("../plots/plots"),p=t("./plot_schema"),h=f.isPlainObject,g=Array.isArray;e.exports=function(t,e){var r,i,l=p.get(),s=[],c={};g(t)?(c.data=f.extendDeep([],t),r=t):(c.data=[],r=[],s.push(o("array","data"))),h(e)?(c.layout=f.extendDeep({},e),i=e):(c.layout={},i={},arguments.length>1&&s.push(o("object","layout"))),d.supplyDefaults(c);for(var u=c._fullData,v=r.length,y=0;y<v;y++){var m=r[y],x=["data",y];if(h(m)){var b=u[y],_=b.type,w=l.traces[_].attributes;w.type={valType:"enumerated",values:[_]},!1===b.visible&&!1!==m.visible&&s.push(o("invisible",x)),n(m,b,w,s,x);var k=m.transforms,M=b.transforms;if(k){g(k)||s.push(o("array",x,["transforms"])),x.push("transforms");for(var A=0;A<k.length;A++){var T=["transforms",A],L=k[A].type;if(h(k[A])){var C=l.transforms[L]?l.transforms[L].attributes:{};C.type={valType:"enumerated",values:Object.keys(l.transforms)},n(k[A],M[A],C,s,x,T)}else s.push(o("object",x,T))}}}else s.push(o("object",x))}return n(i,c._fullLayout,a(l,u),s,"layout"),0===s.length?void 0:s};var v={object:function(t,e){return("layout"===t&&""===e?"The layout argument":"data"===t[0]&&""===e?"Trace "+t[1]+" in the data argument":i(t)+"key "+e)+" must be linked to an object container"},array:function(t,e){return("data"===t?"The data argument":i(t)+"key "+e)+" must be linked to an array container"},schema:function(t,e){return i(t)+"key "+e+" is not part of the schema"},unused:function(t,e,r){var n=h(r)?"container":"key";return i(t)+n+" "+e+" did not get coerced"},dynamic:function(t,e,r,n){return[i(t)+"key",e,"(set to '"+r+"')","got reset to","'"+n+"'","during defaults."].join(" ")},invisible:function(t){return"Trace "+t[1]+" got defaulted to be not visible"},value:function(t,e,r){return[i(t)+"key "+e,"is set to an invalid value ("+r+")"].join(" ")}},y=f.counterRegex("([a-z]+)")},{"../lib":149,"../plots/plots":218,"./plot_schema":178}],184:[function(t,e,r){"use strict";r.defaultConfig=t("./plot_api/plot_config"),r.Plots=t("./plots/plots"),r.Axes=t("./plots/cartesian/axes"),r.ModeBar=t("./components/modebar"),t("./plot_api/plot_api")},{"./components/modebar":95,"./plot_api/plot_api":176,"./plot_api/plot_config":177,"./plots/cartesian/axes":189,"./plots/plots":218}],185:[function(t,e,r){"use strict";e.exports={mode:{valType:"enumerated",dflt:"afterall",values:["immediate","next","afterall"]},direction:{valType:"enumerated",values:["forward","reverse"],dflt:"forward"},fromcurrent:{valType:"boolean",dflt:!1},frame:{duration:{valType:"number",min:0,dflt:500},redraw:{valType:"boolean",dflt:!0}},transition:{duration:{valType:"number",min:0,dflt:500},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"]}}}},{}],186:[function(t,e,r){"use strict";var n=t("../lib");e.exports=function(t,e,r){var a,i=r.name,o=e[i],l=n.isArray(t[i])?t[i]:[],s=e[i]=[];for(a=0;a<l.length;a++){var c=l[a],u={},f={};n.isPlainObject(c)||(f.itemIsNotPlainObject=!0,c={}),r.handleItemDefaults(c,u,e,r,f),u._input=c,u._index=a,s.push(u)}if(n.isArray(o)){var d=Math.min(o.length,s.length);for(a=0;a<d;a++)n.relinkPrivateKeys(s[a],o[a])}}},{"../lib":149}],187:[function(t,e,r){"use strict";var n=t("../components/fx/attributes");e.exports={type:{valType:"enumerated",values:[],dflt:"scatter",editType:"calc+clearAxisTypes"},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",dflt:"",editType:"calc"},ids:{valType:"data_array",editType:"calc"},customdata:{valType:"data_array",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"}}},{"../components/fx/attributes":67}],188:[function(t,e,r){"use strict";e.exports={xaxis:{valType:"subplotid",dflt:"x",editType:"calc+clearAxisTypes"},yaxis:{valType:"subplotid",dflt:"y",editType:"calc+clearAxisTypes"}}},{}],189:[function(t,e,r){"use strict";function n(t){return+t}function a(t){return String(t)}function i(t,e,r,n,a){function i(e){return(1+100*(e-t)/r.dtick)%100<2}for(var o=0,l=0,s=0,c=0,u=0;u<e.length;u++)e[u]%1==0?s++:k(e[u])||c++,i(e[u])&&o++,i(e[u]+r.dtick/2)&&l++;var f=e.length-c;if(s===f&&"date"!==r.type)r.dtick<1?t=n-.5*r.dtick:(t-=.5)+r.dtick<n&&(t+=r.dtick);else if(l<.1*f&&(o>.3*f||i(n)||i(a))){var d=r.dtick/2;t+=t+d<n?d:-d}return t}function o(t,e,r,n,a){var i=A.findExactDates(e,a);if(i.exactDays>.8){var o=Number(r.substr(1));i.exactYears>.8&&o%12==0?t=B.tickIncrement(t,"M6","reverse")+1.5*E:i.exactMonths>.8?t=B.tickIncrement(t,"M1","reverse")+15.5*E:t-=E/2;var l=B.tickIncrement(t,r);if(l<=n)return l}return t}function l(t){var e,r,n=t.tickvals,a=t.ticktext,i=new Array(n.length),o=A.simpleMap(t.range,t.r2l),l=1.0001*o[0]-1e-4*o[1],s=1.0001*o[1]-1e-4*o[0],c=Math.min(l,s),f=Math.max(l,s),d=0;Array.isArray(a)||(a=[]);var p="category"===t.type?t.d2l_noadd:t.d2l;for("log"===t.type&&"L"!==String(t.dtick).charAt(0)&&(t.dtick="L"+Math.pow(10,Math.floor(Math.min(t.range[0],t.range[1]))-1)),r=0;r<n.length;r++)(e=p(n[r]))>c&&e<f&&(void 0===a[r]?i[d]=B.tickText(t,e):i[d]=u(t,e,String(a[r])),d++);return d<n.length&&i.splice(d,n.length-d),i}function s(t,e,r){return e*A.roundUp(t/e,r)}function c(t){var e=t.dtick;if(t._tickexponent=0,k(e)||"string"==typeof e||(e=1),"category"===t.type&&(t._tickround=null),"date"===t.type){var r=t.r2l(t.tick0),n=t.l2r(r).replace(/(^-|i)/g,""),a=n.length;if("M"===String(e).charAt(0))a>10||"01-01"!==n.substr(5)?t._tickround="d":t._tickround=+e.substr(1)%12==0?"y":"m";else if(e>=E&&a<=10||e>=15*E)t._tickround="d";else if(e>=I&&a<=16||e>=N)t._tickround="M";else if(e>=R&&a<=19||e>=I)t._tickround="S";else{var i=t.l2r(r+e).replace(/^-/,"").length;t._tickround=Math.max(a,i)-20}}else if(k(e)||"L"===e.charAt(0)){var o=t.range.map(t.r2d||Number);k(e)||(e=Number(e.substr(1))),t._tickround=2-Math.floor(Math.log(e)/Math.LN10+.01);var l=Math.max(Math.abs(o[0]),Math.abs(o[1])),s=Math.floor(Math.log(l)/Math.LN10+.01);Math.abs(s)>3&&(g(t.exponentformat)&&!v(s)?t._tickexponent=3*Math.round((s-1)/3):t._tickexponent=s)}else t._tickround=null}function u(t,e,r){var n=t.tickfont||{};return{x:e,dx:0,dy:0,text:r||"",fontSize:n.size,font:n.family,fontColor:n.color}}function f(t,e,r,n){var a=t._tickround,i=r&&t.hoverformat||t.tickformat;n&&(a=k(a)?4:{y:"m",m:"d",d:"M",M:"S",S:4}[a]);var o,l=A.formatDate(e.x,i,a,t.calendar),s=l.indexOf("\n");-1!==s&&(o=l.substr(s+1),l=l.substr(0,s)),n&&("00:00:00"===l||"00:00"===l?(l=o,o=""):8===l.length&&(l=l.replace(/:00$/,""))),o&&(r?"d"===a?l+=", "+o:l=o+(l?", "+l:""):t._inCalcTicks&&o===t._prevDateHead||(l+="
"+o,t._prevDateHead=o)),e.text=l}function d(t,e,r,n,a){var i=t.dtick,o=e.x;if("never"===a&&(a=""),!n||"string"==typeof i&&"L"===i.charAt(0)||(i="L3"),t.tickformat||"string"==typeof i&&"L"===i.charAt(0))e.text=y(Math.pow(10,o),t,a,n);else if(k(i)||"D"===i.charAt(0)&&A.mod(o+.01,1)<.1){var l=Math.round(o);-1!==["e","E","power"].indexOf(t.exponentformat)||g(t.exponentformat)&&v(l)?(e.text=0===l?1:1===l?"10":l>1?"10"+l+"":"10"+F+-l+"",e.fontSize*=1.25):(e.text=y(Math.pow(10,o),t,"","fakehover"),"D1"===i&&"y"===t._id.charAt(0)&&(e.dy-=e.fontSize/6))}else{if("D"!==i.charAt(0))throw"unrecognized dtick "+String(i);e.text=String(Math.round(Math.pow(10,A.mod(o,1)))),e.fontSize*=.75}if("D1"===t.dtick){var s=String(e.text).charAt(0);"0"!==s&&"1"!==s||("y"===t._id.charAt(0)?e.dx-=e.fontSize/4:(e.dy+=e.fontSize/2,e.dx+=(t.range[1]>t.range[0]?1:-1)*e.fontSize*(o<0?.5:.25)))}}function p(t,e){var r=t._categories[Math.round(e.x)];void 0===r&&(r=""),e.text=String(r)}function h(t,e,r,n,a){"never"===a?a="":"all"===t.showexponent&&Math.abs(e.x/t.dtick)<1e-6&&(a="hide"),e.text=y(e.x,t,a,n)}function g(t){return"SI"===t||"B"===t}function v(t){return t>14||t<-15}function y(t,e,r,n){var a=t<0,i=e._tickround,o=r||e.exponentformat||"B",l=e._tickexponent,s=e.tickformat,u=e.separatethousands;if(n){var f={exponentformat:e.exponentformat,dtick:"none"===e.showexponent?e.dtick:k(t)?Math.abs(t)||1:1,range:"none"===e.showexponent?e.range.map(e.r2d):[0,t||1]};c(f),i=(Number(f._tickround)||0)+4,l=f._tickexponent,e.hoverformat&&(s=e.hoverformat)}if(s)return w.format(s)(t).replace(/-/g,F);var d=Math.pow(10,-i)/2;if("none"===o&&(l=0),(t=Math.abs(t))<d)t="0",a=!1;else{if(t+=d,l&&(t*=Math.pow(10,-l),i+=l),0===i)t=String(Math.floor(t));else if(i<0){t=String(Math.round(t)),t=t.substr(0,t.length+i);for(var p=i;p<0;p++)t+="0"}else{t=String(t);var h=t.indexOf(".")+1;h&&(t=t.substr(0,h+i).replace(/\.?0+$/,""))}t=A.numSeparate(t,e._separators,u)}if(l&&"hide"!==o){g(o)&&v(l)&&(o="power");var y;y=l<0?F+-l:"power"!==o?"+"+l:String(l),"e"===o?t+="e"+y:"E"===o?t+="E"+y:"power"===o?t+="\xd710"+y+"":"B"===o&&9===l?t+="B":g(o)&&(t+=Q[l/3+5])}return a?F+t:t}function m(t,e){var r,n,a=[];for(r=0;r<e.length;r++){var i=[],o=t._fullData[e[r]].xaxis,l=t._fullData[e[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]],x(c.x,s.x),x(c.y,s.y);x(c.x,[o]),x(c.y,[l])}else a.push({x:[o],y:[l]})}}return a}function x(t,e){for(var r=0;r<e.length;r++)-1===t.indexOf(e[r])&&t.push(e[r])}function b(t,e,r){var n,a,i=[],o=[],l=t.layout;for(n=0;n<e.length;n++)i.push(B.getFromId(t,e[n]));for(n=0;n<r.length;n++)o.push(B.getFromId(t,r[n]));var s=Object.keys(i[0]),c=["anchor","domain","overlaying","position","side","tickangle"],u=["linear","log"];for(n=0;n<s.length;n++){var f=s[n],d=i[0][f],p=o[0][f],h=!0,g=!1,v=!1;if("_"!==f.charAt(0)&&"function"!=typeof d&&-1===c.indexOf(f)){for(a=1;a<i.length&&h;a++){var y=i[a][f];"type"===f&&-1!==u.indexOf(d)&&-1!==u.indexOf(y)&&d!==y?g=!0:y!==d&&(h=!1)}for(a=1;a<o.length&&h;a++){var m=o[a][f];"type"===f&&-1!==u.indexOf(p)&&-1!==u.indexOf(m)&&p!==m?v=!0:o[a][f]!==p&&(h=!1)}h&&(g&&(l[i[0]._name].type="linear"),v&&(l[o[0]._name].type="linear"),_(l,f,i,o))}}for(n=0;n<t._fullLayout.annotations.length;n++){var x=t._fullLayout.annotations[n];-1!==e.indexOf(x.xref)&&-1!==r.indexOf(x.yref)&&A.swapAttrs(l.annotations[n],["?"])}}function _(t,e,r,n){var a,i=A.nestedProperty,o=i(t[r[0]._name],e).get(),l=i(t[n[0]._name],e).get();for("title"===e&&("Click to enter X axis title"===o&&(o="Click to enter Y axis title"),"Click to enter Y axis title"===l&&(l="Click to enter X axis title")),a=0;a<r.length;a++)i(t,r[a]._name+"."+e).set(l);for(a=0;a<n.length;a++)i(t,n[a]._name+"."+e).set(o)}var w=t("d3"),k=t("fast-isnumeric"),M=t("../../registry"),A=t("../../lib"),T=t("../../lib/svg_text_utils"),L=t("../../components/titles"),C=t("../../components/color"),S=t("../../components/drawing"),O=t("../../constants/numerical"),z=O.FP_SAFE,D=O.ONEAVGYEAR,P=O.ONEAVGMONTH,E=O.ONEDAY,N=O.ONEHOUR,I=O.ONEMIN,R=O.ONESEC,F=O.MINUS_SIGN,j=t("../../constants/alignment").MID_SHIFT,B=e.exports={};B.layoutAttributes=t("./layout_attributes"),B.supplyLayoutDefaults=t("./layout_defaults"),B.setConvert=t("./set_convert");var q=t("./axis_autotype"),H=t("./axis_ids");B.id2name=H.id2name,B.cleanId=H.cleanId,B.list=H.list,B.listIds=H.listIds,B.getFromId=H.getFromId,B.getFromTrace=H.getFromTrace,B.coerceRef=function(t,e,r,n,a,i){var o=n.charAt(n.length-1),l=B.listIds(r,o),s=n+"ref",c={};return a||(a=l[0]||i),i||(i=a),c[s]={valType:"enumerated",values:l.concat(i?[i]:[]),dflt:a},A.coerce(t,e,c,s)},B.coercePosition=function(t,e,r,n,a,i){var o,l;if("paper"===n||"pixel"===n)o=A.ensureNumber,l=r(a,i);else{var s=B.getFromId(e,n);i=s.fraction2r(i),l=r(a,i),o=s.cleanPos}t[a]=o(l)},B.cleanPosition=function(t,e,r){return("paper"===r||"pixel"===r?A.ensureNumber:B.getFromId(e,r).cleanPos)(t)};var V=B.getDataConversions=function(t,e,r,i){var o,l="x"===r||"y"===r||"z"===r?r:i;if(Array.isArray(l)){if(o={type:q(i),_categories:[]},B.setConvert(o),"category"===o.type)for(var s=0;s<i.length;s++)o.d2c(i[s])}else o=B.getFromTrace(t,e,l);return o?{d2c:o.d2c,c2d:o.c2d}:"ids"===l?{d2c:a,c2d:a}:{d2c:n,c2d:n}};B.getDataToCoordFunc=function(t,e,r,n){return V(t,e,r,n).d2c},B.counterLetter=function(t){var e=t.charAt(0);return"x"===e?"y":"y"===e?"x":void 0},B.minDtick=function(t,e,r,n){-1===["log","category"].indexOf(t.type)&&n?void 0===t._minDtick?(t._minDtick=e,t._forceTick0=r):t._minDtick&&((t._minDtick/e+1e-6)%1<2e-6&&((r-t._forceTick0)/e%1+1.000001)%1<2e-6?(t._minDtick=e,t._forceTick0=r):((e/t._minDtick+1e-6)%1>2e-6||((r-t._forceTick0)/t._minDtick%1+1.000001)%1>2e-6)&&(t._minDtick=0)):t._minDtick=0},B.getAutoRange=function(t){var e,r=[],n=t._min[0].val,a=t._max[0].val;for(e=1;e<t._min.length&&n===a;e++)n=Math.min(n,t._min[e].val);for(e=1;e<t._max.length&&n===a;e++)a=Math.max(a,t._max[e].val);var i,o,l,s,c,u,f,d=0,p=!1;if(t.range){var h=A.simpleMap(t.range,t.r2l);p=h[1]<h[0]}for("reversed"===t.autorange&&(p=!0,t.autorange=!0),e=0;e<t._min.length;e++)for(o=t._min[e],i=0;i<t._max.length;i++)l=t._max[i],f=l.val-o.val,u=t._length-o.pad-l.pad,f>0&&u>0&&f/u>d&&(s=o,c=l,d=f/u);if(n===a){var g=n-1,v=n+1;r="tozero"===t.rangemode?n<0?[g,0]:[0,v]:"nonnegative"===t.rangemode?[Math.max(0,g),Math.max(0,v)]:[g,v]}else d&&("linear"!==t.type&&"-"!==t.type||("tozero"===t.rangemode?(s.val>=0&&(s={val:0,pad:0}),c.val<=0&&(c={val:0,pad:0})):"nonnegative"===t.rangemode&&(s.val-d*s.pad<0&&(s={val:0,pad:0}),c.val<0&&(c={val:1,pad:0})),d=(c.val-s.val)/(t._length-s.pad-c.pad)),r=[s.val-d*s.pad,c.val+d*c.pad]);return r[0]===r[1]&&("tozero"===t.rangemode?r=r[0]<0?[r[0],0]:r[0]>0?[0,r[0]]:[0,1]:(r=[r[0]-1,r[0]+1],"nonnegative"===t.rangemode&&(r[0]=Math.max(0,r[0])))),p&&r.reverse(),A.simpleMap(r,t.l2r||Number)},B.doAutoRange=function(t){t._length||t.setScale();var e=t._min&&t._max&&t._min.length&&t._max.length;if(t.autorange&&e){t.range=B.getAutoRange(t),t._r=t.range.slice(),t._rl=A.simpleMap(t._r,t.r2l);var r=t._input;r.range=t.range.slice(),r.autorange=t.autorange}},B.saveRangeInitial=function(t,e){for(var r=B.list(t,"",!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||e&&l)&&(i._rangeInitial=i.range.slice(),n=!0)}return n},B.saveShowSpikeInitial=function(t,e){for(var r=B.list(t,"",!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||e&&s)&&(o._showSpikeInitial=o.showspikes,n=!0),"on"!==a||o.showspikes||(a="off")}return t._fullLayout._cartesianSpikesEnabled=a,n},B.expand=function(t,e,r){function n(t){if(Array.isArray(t))return function(e){return Math.max(Number(t[e]||0),0)};var e=Math.max(Number(t||0),0);return function(){return e}}function a(r){function n(t){return k(t)&&Math.abs(t)<z}if(s=e[r],k(s)){if(f=x(r)+y,d=b(r)+y,h=s-w(r),g=s+_(r),"log"===t.type&&h<g/10&&(h=g/10),c=t.c2l(h),u=t.c2l(g),m&&(c=Math.min(0,c),u=Math.max(0,u)),n(c)){for(p=!0,o=0;o<t._min.length&&p;o++)l=t._min[o],l.val<=c&&l.pad>=d?p=!1:l.val>=c&&l.pad<=d&&(t._min.splice(o,1),o--);p&&t._min.push({val:c,pad:m&&0===c?0:d})}if(n(u)){for(p=!0,o=0;o<t._max.length&&p;o++)l=t._max[o],l.val>=u&&l.pad>=f?p=!1:l.val<=u&&l.pad<=f&&(t._max.splice(o,1),o--);p&&t._max.push({val:u,pad:m&&0===u?0:f})}}}if((t.autorange||!!A.nestedProperty(t,"rangeslider.autorange").get())&&e){t._min||(t._min=[]),t._max||(t._max=[]),r||(r={}),t._m||t.setScale();var i,o,l,s,c,u,f,d,p,h,g,v=e.length,y=r.padded?.05*t._length:0,m=r.tozero&&("linear"===t.type||"-"===t.type);y&&"domain"===t.constrain&&t._inputDomain&&(y*=(t._inputDomain[1]-t._inputDomain[0])/(t.domain[1]-t.domain[0]));var x=n((t._m>0?r.ppadplus:r.ppadminus)||r.ppad||0),b=n((t._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),_=n(r.vpadplus||r.vpad),w=n(r.vpadminus||r.vpad);for(i=0;i<6;i++)a(i);for(i=v-1;i>5;i--)a(i)}},B.autoBin=function(t,e,r,n,a){var l=A.aggNums(Math.min,null,t),s=A.aggNums(Math.max,null,t);if(a||(a=e.calendar),"category"===e.type)return{start:l-.5,end:s+.5,size:1,_count:s-l+1};var c;if(r)c=(s-l)/r;else{var u=A.distinctVals(t),f=Math.pow(10,Math.floor(Math.log(u.minDiff)/Math.LN10)),d=f*A.roundUp(u.minDiff/f,[.9,1.9,4.9,9.9],!0);c=Math.max(d,2*A.stdev(t)/Math.pow(t.length,n?.25:.4)),k(c)||(c=1)}var p;p="log"===e.type?{type:"linear",range:[l,s]}:{type:e.type,range:A.simpleMap([l,s],e.c2r,0,a),calendar:a},B.setConvert(p),B.autoTicks(p,c);var h,g,v=B.tickIncrement(B.tickFirst(p),p.dtick,"reverse",a);if("number"==typeof p.dtick)v=i(v,t,p,l,s),g=1+Math.floor((s-v)/p.dtick),h=v+g*p.dtick;else for("M"===p.dtick.charAt(0)&&(v=o(v,t,p.dtick,l,a)),h=v,g=0;h<=s;)h=B.tickIncrement(h,p.dtick,!1,a),g++;return{start:e.c2r(v,0,a),end:e.c2r(h,0,a),size:p.dtick,_count:g}},B.calcTicks=function(t){var e=A.simpleMap(t.range,t.r2l);if("auto"===t.tickmode||!t.dtick){var r,n=t.nticks;n||("category"===t.type?(r=t.tickfont?1.2*(t.tickfont.size||12):15,n=t._length/r):(r="y"===t._id.charAt(0)?40:80,n=A.constrain(t._length/r,4,9)+1)),"array"===t.tickmode&&(n*=100),B.autoTicks(t,Math.abs(e[1]-e[0])/n),t._minDtick>0&&t.dtick<2*t._minDtick&&(t.dtick=t._minDtick,t.tick0=t.l2r(t._forceTick0))}if(t.tick0||(t.tick0="date"===t.type?"2000-01-01":0),c(t),"array"===t.tickmode)return l(t);t._tmin=B.tickFirst(t);var a=e[1]<e[0],i=[],o=1.0001*e[1]-1e-4*e[0];"category"===t.type&&(o=a?Math.max(-.5,o):Math.min(t._categories.length-.5,o));for(var s=null,u=Math.max(1e3,t._length||0),f=t._tmin;(a?f>=o:f<=o)&&!(i.length>u||f===s);f=B.tickIncrement(f,t.dtick,a,t.calendar))s=f,i.push(f);t._tmax=i[i.length-1],t._prevDateHead="",t._inCalcTicks=!0;for(var d=new Array(i.length),p=0;p<i.length;p++)d[p]=B.tickText(t,i[p]);return t._inCalcTicks=!1,d};var U=[2,5,10],G=[1,2,3,6,12],X=[1,2,5,10,15,30],Y=[1,2,3,7,14],Z=[-.046,0,.301,.477,.602,.699,.778,.845,.903,.954,1],W=[-.301,0,.301,.699,1];B.autoTicks=function(t,e){var r;if("date"===t.type){t.tick0=A.dateTick0(t.calendar);var n=2*e;n>D?(e/=D,r=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick="M"+12*s(e,r,U)):n>P?(e/=P,t.dtick="M"+s(e,1,G)):n>E?(t.dtick=s(e,E,Y),t.tick0=A.dateTick0(t.calendar,!0)):n>N?t.dtick=s(e,N,G):n>I?t.dtick=s(e,I,X):n>R?t.dtick=s(e,R,X):(r=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick=s(e,r,U))}else if("log"===t.type){t.tick0=0;var a=A.simpleMap(t.range,t.r2l);if(e>.7)t.dtick=Math.ceil(e);else if(Math.abs(a[1]-a[0])<1){var i=1.5*Math.abs((a[1]-a[0])/e);e=Math.abs(Math.pow(10,a[1])-Math.pow(10,a[0]))/i,r=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick="L"+s(e,r,U)}else t.dtick=e>.3?"D2":"D1"}else"category"===t.type?(t.tick0=0,t.dtick=Math.ceil(Math.max(e,1))):(t.tick0=0,r=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick=s(e,r,U));if(0===t.dtick&&(t.dtick=1),!k(t.dtick)&&"string"!=typeof t.dtick){var o=t.dtick;throw t.dtick=1,"ax.dtick error: "+String(o)}},B.tickIncrement=function(t,e,r,n){var a=r?-1:1;if(k(e))return t+a*e;var i=e.charAt(0),o=a*Number(e.substr(1));if("M"===i)return A.incrementMonth(t,o,n);if("L"===i)return Math.log(Math.pow(10,t)+o)/Math.LN10;if("D"===i){var l="D2"===e?W:Z,s=t+.01*a,c=A.roundUp(A.mod(s,1),l,r);return Math.floor(s)+Math.log(w.round(Math.pow(10,c),1))/Math.LN10}throw"unrecognized dtick "+String(e)},B.tickFirst=function(t){var e=t.r2l||Number,r=A.simpleMap(t.range,e),n=r[1]<r[0],a=n?Math.floor:Math.ceil,i=1.0001*r[0]-1e-4*r[1],o=t.dtick,l=e(t.tick0);if(k(o)){var s=a((i-l)/o)*o+l;return"category"===t.type&&(s=A.constrain(s,0,t._categories.length-1)),s}var c=o.charAt(0),u=Number(o.substr(1));if("M"===c){for(var f,d,p,h=0,g=l;h<10;){if(((f=B.tickIncrement(g,o,n,t.calendar))-i)*(g-i)<=0)return n?Math.min(g,f):Math.max(g,f);d=(i-(g+f)/2)/(f-g),p=c+(Math.abs(Math.round(d))||1)*u,g=B.tickIncrement(g,p,d<0?!n:n,t.calendar),h++}return A.error("tickFirst did not converge",t),g}if("L"===c)return Math.log(a((Math.pow(10,i)-l)/u)*u+l)/Math.LN10;if("D"===c){var v="D2"===o?W:Z,y=A.roundUp(A.mod(i,1),v,n);return Math.floor(i)+Math.log(w.round(Math.pow(10,y),1))/Math.LN10}throw"unrecognized dtick "+String(o)},B.tickText=function(t,e,r){function n(n){var a;return void 0===n||(r?"none"===n:(a={first:t._tmin,last:t._tmax}[n],"all"!==n&&e!==a))}var a,i,o=u(t,e),l="array"===t.tickmode,s=r||l,c="category"===t.type?t.d2l_noadd:t.d2l;if(l&&Array.isArray(t.ticktext)){var g=A.simpleMap(t.range,t.r2l),v=Math.abs(g[1]-g[0])/1e4;for(i=0;i<t.ticktext.length&&!(Math.abs(e-c(t.tickvals[i]))<v);i++);if(i<t.ticktext.length)return o.text=String(t.ticktext[i]),o}return a=r?"never":"none"!==t.exponentformat&&n(t.showexponent)?"hide":"","date"===t.type?f(t,o,r,s):"log"===t.type?d(t,o,r,s,a):"category"===t.type?p(t,o):h(t,o,r,s,a),t.tickprefix&&!n(t.showtickprefix)&&(o.text=t.tickprefix+o.text),t.ticksuffix&&!n(t.showticksuffix)&&(o.text+=t.ticksuffix),o};var Q=["f","p","n","\u03bc","m","","k","M","G","T"];B.subplotMatch=/^x([0-9]*)y([0-9]*)$/,B.getSubplots=function(t,e){var r,n,a,i=[],o=t._fullData||t.data||[];for(r=0;r<o.length;r++){var l=o[r];if(!1!==l.visible&&"legendonly"!==l.visible&&(M.traceIs(l,"cartesian")||M.traceIs(l,"gl2d"))){a=(l.xaxis||"x")+(l.yaxis||"y"),-1===i.indexOf(a)&&i.push(a)}}var s=B.list(t,"",!0);for(r=0;r<s.length;r++){var c=s[r],u=c._id.charAt(0),f="free"===c.anchor?"x"===u?"y":"x":c.anchor,d=B.getFromId(t,f),p=!1;for(n=0;n<i.length;n++)if(function(t,e){return-1!==t.indexOf(e._id)}(i[n],c)){p=!0;break}"free"===c.anchor&&p||d&&(a="x"===u?c._id+d._id:d._id+c._id,-1===i.indexOf(a)&&i.push(a))}var h=B.subplotMatch,g=[];for(r=0;r<i.length;r++)a=i[r],h.test(a)&&g.push(a);return g.sort(function(t,e){var r=t.match(h),n=e.match(h);return r[1]===n[1]?+(r[2]||1)-(n[2]||1):+(r[1]||0)-(n[1]||0)}),e?B.findSubplotsWithAxis(g,e):g},B.findSubplotsWithAxis=function(t,e){for(var r=new RegExp("x"===e._id.charAt(0)?"^"+e._id+"y":e._id+"$"),n=[],a=0;a<t.length;a++){var i=t[a];r.test(i)&&n.push(i)}return n},B.makeClipPaths=function(t){var e,r,n=t._fullLayout,a={_offset:0,_length:n.width,_id:""},i={_offset:0,_length:n.height,_id:""},o=B.list(t,"x",!0),l=B.list(t,"y",!0),s=[];for(e=0;e<o.length;e++)for(s.push({x:o[e],y:i}),r=0;r<l.length;r++)0===e&&s.push({x:a,y:l[r]}),s.push({x:o[e],y:l[r]});var c=n._clips.selectAll(".axesclip").data(s,function(t){return t.x._id+t.y._id});c.enter().append("clipPath").classed("axesclip",!0).attr("id",function(t){return"clip"+n._uid+t.x._id+t.y._id}).append("rect"),c.exit().remove(),c.each(function(t){w.select(this).select("rect").attr({x:t.x._offset||0,y:t.y._offset||0,width:t.x._length||1,height:t.y._length||1})})},B.doTicks=function(t,e,r){function n(t){var e=c.l2p(t.x);return e>1&&e<c._length-1}function a(t,e){var r=t.selectAll("path."+_).data("inside"===c.ticks?U:x,b);e&&c.ticks?(r.enter().append("path").classed(_,1).classed("ticks",1).classed("crisp",1).call(C.stroke,c.tickcolor).style("stroke-width",R+"px").attr("d",e),r.attr("transform",p),r.exit().remove()):r.remove()}function i(r,n){function a(t,e){t.each(function(t){var r=m(e),n=w.select(this),a=n.select(".text-math-group"),i=p(t)+(k(e)&&0!=+e?" rotate("+e+","+d(t)+","+(h(t)-t.fontSize/2)+")":"");if(a.empty())n.select("text").attr({transform:i,"text-anchor":r});else{var o=S.bBox(a.node()).width*{end:-.5,start:.5}[r];a.attr("transform",i+(o?"translate("+o+",0)":""))}})}function i(){return z.length&&Promise.all(z)}function l(){if(a(f,c.tickangle),"x"===y&&!k(c.tickangle)&&("log"!==c.type||"D"!==String(c.dtick).charAt(0))){var t=[];for(f.each(function(e){var r=w.select(this),n=r.select(".text-math-group"),a=c.l2p(e.x);n.empty()&&(n=r.select("text"));var i=S.bBox(n.node());t.push({top:0,bottom:10,height:10,left:a-i.width/2,right:a+i.width/2+2,width:i.width+2})}),v=0;v<t.length-1;v++)if(A.bBoxIntersect(t[v],t[v+1])){O=30;break}if(O){Math.abs((x[x.length-1].x-x[0].x)*c._m)/(x.length-1)<2.5*C&&(O=90),a(f,O)}c._lastangle=O} return o(),e+" done"}function s(){function e(t,e){t[0]=Math.min(t[0],e[0]),t[1]=Math.max(t[1],e[1])}if(c.showticklabels){var n=t.getBoundingClientRect(),a=r.node().getBoundingClientRect();c._boundingBox={width:a.width,height:a.height,left:a.left-n.left,right:a.right-n.left,top:a.top-n.top,bottom:a.bottom-n.top}}else{var i,o=u._size;"x"===y?(i="free"===c.anchor?o.t+o.h*(1-c.position):o.t+o.h*(1-c._anchorAxis.domain[{bottom:0,top:1}[c.side]]),c._boundingBox={top:i,bottom:i,left:c._offset,rigth:c._offset+c._length,width:c._length,height:0}):(i="free"===c.anchor?o.l+o.w*c.position:o.l+o.w*c._anchorAxis.domain[{left:0,right:1}[c.side]],c._boundingBox={left:i,right:i,bottom:c._offset+c._length,top:c._offset,height:c._length,width:0})}if(g){var l=c._counterSpan=[1/0,-1/0];for(v=0;v<g.length;v++){var s=u._plots[g[v]],f=s["x"===y?"yaxis":"xaxis"];e(l,[f._offset,f._offset+f._length])}"free"===c.anchor&&e(l,"x"===y?[c._boundingBox.bottom,c._boundingBox.top]:[c._boundingBox.right,c._boundingBox.left])}}var f=r.selectAll("g."+_).data(x,b);if(!k(n))return f.remove(),void o();if(!c.showticklabels)return f.remove(),o(),void s();var d,h,m,M,L;"x"===y?(L="bottom"===q?1:-1,d=function(t){return t.dx+E*L},M=n+(P+D)*L,h=function(t){return t.dy+M+t.fontSize*("bottom"===q?1:-.2)},m=function(t){return k(t)&&0!==t&&180!==t?t*L<0?"end":"start":"middle"}):(L="right"===q?1:-1,h=function(t){return t.dy+t.fontSize*j-E*L},d=function(t){return t.dx+n+(P+D+(90===Math.abs(c.tickangle)?t.fontSize/2:0))*L},m=function(t){return k(t)&&90===Math.abs(t)?"middle":"right"===q?"start":"end"});var C=0,O=0,z=[];f.enter().append("g").classed(_,1).append("text").attr("text-anchor","middle").each(function(e){var r=w.select(this),n=t._promises.length;r.call(T.positionText,d(e),h(e)).call(S.font,e.font,e.fontSize,e.fontColor).text(e.text).call(T.convertToTspans,t),n=t._promises[n],n?z.push(t._promises.pop().then(function(){a(r,c.tickangle)})):a(r,c.tickangle)}),f.exit().remove(),f.each(function(t){C=Math.max(C,t.fontSize)}),a(f,c._lastangle||c.tickangle);var N=A.syncOrAsync([i,l,s]);return N&&N.then&&t._promises.push(N),N}function o(){if(!r){var n,a,i,o,l=H.getFromId(t,e),s=w.select(t).selectAll("g."+e+"tick"),c={selection:s,side:l.side},f=e.charAt(0),d=t._fullLayout._size,p=l.titlefont.size;if(s.size()){var h=S.getTranslate(s.node().parentNode);c.offsetLeft=h.x,c.offsetTop=h.y}var g=10+1.5*p+(l.linewidth?l.linewidth-1:0);"x"===f?(a="free"===l.anchor?{_offset:d.t+(1-(l.position||0))*d.h,_length:0}:H.getFromId(t,l.anchor),i=l._offset+l._length/2,o="top"===l.side?-g-p*(l.showticklabels?1:0):a._length+g+p*(l.showticklabels?1.5:.5),o+=a._offset,l.rangeslider&&l.rangeslider.visible&&l._boundingBox&&(o+=(u.height-u.margin.b-u.margin.t)*l.rangeslider.thickness+l._boundingBox.height),c.side||(c.side="bottom")):(a="free"===l.anchor?{_offset:d.l+(l.position||0)*d.w,_length:0}:H.getFromId(t,l.anchor),o=l._offset+l._length/2,i="right"===l.side?a._length+g+p*(l.showticklabels?1:.5):-g-p*(l.showticklabels?.5:0),i+=a._offset,n={rotate:"-90",offset:0},c.side||(c.side="left")),L.draw(t,e+"title",{propContainer:l,propName:l._name+".title",dfltName:f.toUpperCase()+" axis",avoid:c,transform:n,attributes:{x:i,y:o,"text-anchor":"middle"}})}}function l(t,e){return!0===t.visible&&t.xaxis+t.yaxis===e&&(!(!M.traceIs(t,"bar")||t.orientation!=={x:"h",y:"v"}[y])||t.fill&&t.fill.charAt(t.fill.length-1)===y)}function s(e,r,a){var i=e.gridlayer,o=e.zerolinelayer,s=e["hidegrid"+y]?[]:U,u=c._gridpath||"M0,0"+("x"===y?"v":"h")+r._length,f=i.selectAll("path."+O).data(!1===c.showgrid?[]:s,b);if(f.enter().append("path").classed(O,1).classed("crisp",1).attr("d",u).each(function(t){c.zeroline&&("linear"===c.type||"-"===c.type)&&Math.abs(t.x)<c.dtick/100&&w.select(this).remove()}),f.attr("transform",p).call(C.stroke,c.gridcolor||"#ddd").style("stroke-width",N+"px"),f.exit().remove(),o){for(var d=!1,h=0;h<t._fullData.length;h++)if(l(t._fullData[h],a)){d=!0;break}var g=A.simpleMap(c.range,c.r2l),v=g[0]*g[1]<=0&&c.zeroline&&("linear"===c.type||"-"===c.type)&&s.length&&(d||n({x:0})||!c.showline),m=o.selectAll("path."+z).data(v?[{x:0}]:[]);m.enter().append("path").classed(z,1).classed("zl",1).classed("crisp",1).attr("d",u),m.attr("transform",p).call(C.stroke,c.zerolinecolor||C.defaultLine).style("stroke-width",I+"px"),m.exit().remove()}}var c,u=t._fullLayout,f=!1;if("object"==typeof e)c=e,e=c._id,f=!0;else if(c=B.getFromId(t,e),"redraw"===e&&u._paper.selectAll("g.subplot").each(function(t){var e=u._plots[t],r=e.xaxis,n=e.yaxis;e.xaxislayer.selectAll("."+r._id+"tick").remove(),e.yaxislayer.selectAll("."+n._id+"tick").remove(),e.gridlayer.selectAll("path").remove(),e.zerolinelayer.selectAll("path").remove(),u._infolayer.select(".g-"+r._id+"title").remove(),u._infolayer.select(".g-"+n._id+"title").remove()}),!e||"redraw"===e)return A.syncOrAsync(B.list(t,"",!0).map(function(r){return function(){if(r._id){var n=B.doTicks(t,r._id);return"redraw"===e&&(r._r=r.range.slice(),r._rl=A.simpleMap(r._r,r.r2l)),n}}}));c.tickformat||(-1===["none","e","E","power","SI","B"].indexOf(c.exponentformat)&&(c.exponentformat="e"),-1===["all","first","last","none"].indexOf(c.showexponent)&&(c.showexponent="all")),c.setScale();var d,p,h,g,v,y=e.charAt(0),m=B.counterLetter(e),x=B.calcTicks(c),b=function(t){return[t.text,t.x,c.mirror].join("_")},_=e+"tick",O=e+"grid",z=e+"zl",D=(c.linewidth||1)/2,P="outside"===c.ticks?c.ticklen:0,E=0,N=S.crispRound(t,c.gridwidth,1),I=S.crispRound(t,c.zerolinewidth,N),R=S.crispRound(t,c.tickwidth,1);if(c._counterangle&&"outside"===c.ticks){var F=c._counterangle*Math.PI/180;P=c.ticklen*Math.cos(F)+1,E=c.ticklen*Math.sin(F)}if(c.showticklabels&&("outside"===c.ticks||c.showline)&&(P+=.2*c.tickfont.size),"x"===y)d=["bottom","top"],p=function(t){return"translate("+c.l2p(t.x)+",0)"},h=function(t,e){if(c._counterangle){var r=c._counterangle*Math.PI/180;return"M0,"+t+"l"+Math.sin(r)*e+","+Math.cos(r)*e}return"M0,"+t+"v"+e};else{if("y"!==y)return void A.warn("Unrecognized doTicks axis:",e);d=["left","right"],p=function(t){return"translate(0,"+c.l2p(t.x)+")"},h=function(t,e){if(c._counterangle){var r=c._counterangle*Math.PI/180;return"M"+t+",0l"+Math.cos(r)*e+","+-Math.sin(r)*e}return"M"+t+",0h"+e}}var q=c.side||d[0],V=[-1,1,q===d[1]?1:-1];if("inside"!==c.ticks==("x"===y)&&(V=V.map(function(t){return-t})),c.visible){var U=x.filter(n);if(f){if(a(c._axislayer,h(c._pos+D*V[2],V[2]*c.ticklen)),c._counteraxis){s({gridlayer:c._gridlayer,zerolinelayer:c._zerolinelayer},c._counteraxis)}return i(c._axislayer,c._pos)}g=B.getSubplots(t,c);var G=g.map(function(t){var e=u._plots[t];if(u._has("cartesian")){var r=e[y+"axislayer"],n=c._linepositions[t]||[],o=e[m+"axis"],l=o._id===c.anchor,f=[!1,!1,!1],p="";if("allticks"===c.mirror?f=[!0,!0,!1]:l&&("ticks"===c.mirror?f=[!0,!0,!1]:f[d.indexOf(q)]=!0),c.mirrors)for(v=0;v<2;v++){var g=c.mirrors[o._id+d[v]];"ticks"!==g&&"labels"!==g||(f[v]=!0)}return void 0!==n[2]&&(f[2]=!0),f.forEach(function(t,e){var r=n[e],a=V[e];t&&k(r)&&(p+=h(r+D*a,a*c.ticklen))}),a(r,p),s(e,o,t),i(r,n[3])}}).filter(function(t){return t&&t.then});return G.length?Promise.all(G):0}},B.swap=function(t,e){for(var r=m(t,e),n=0;n<r.length;n++)b(t,r[n].x,r[n].y)}},{"../../components/color":34,"../../components/drawing":58,"../../components/titles":124,"../../constants/alignment":131,"../../constants/numerical":133,"../../lib":149,"../../lib/svg_text_utils":169,"../../registry":225,"./axis_autotype":190,"./axis_ids":192,"./layout_attributes":200,"./layout_defaults":201,"./set_convert":206,d3:7,"fast-isnumeric":10}],190:[function(t,e,r){"use strict";function n(t){if(!t)return!1;for(var e=0;e<t.length;e++)if(o(t[e]))return!0;return!1}function a(t,e){for(var r,n=0,a=0,i=Math.max(1,(t.length-1)/1e3),s=0;s<t.length;s+=i)r=t[Math.round(s)],l.isDateTime(r,e)&&(n+=1),o(r)&&(a+=1);return n>2*a}function i(t){for(var e,r=Math.max(1,(t.length-1)/1e3),n=0,a=0,i=0;i<t.length;i+=r)e=t[Math.round(i)],l.cleanNumber(e)!==s?n++:"string"==typeof e&&""!==e&&"None"!==e&&a++;return a>2*n}var o=t("fast-isnumeric"),l=t("../../lib"),s=t("../../constants/numerical").BADNUM;e.exports=function(t,e){return a(t,e)?"date":i(t)?"category":n(t)?"linear":"-"}},{"../../constants/numerical":133,"../../lib":149,"fast-isnumeric":10}],191:[function(t,e,r){"use strict";var n=t("tinycolor2").mix,a=t("../../registry"),i=t("../../lib"),o=t("../../components/color/attributes").lightFraction,l=t("./layout_attributes"),s=t("./tick_value_defaults"),c=t("./tick_mark_defaults"),u=t("./tick_label_defaults"),f=t("./category_order_defaults"),d=t("./set_convert"),p=t("./ordered_categories");e.exports=function(t,e,r,h,g){function v(r,n){return i.coerce2(t,e,l,r,n)}var y=h.letter,m=h.font||{},x="Click to enter "+(h.title||y.toUpperCase()+" axis")+" title",b=r("visible",!h.cheateronly),_=e.type;if("date"===_){a.getComponentMethod("calendars","handleDefaults")(t,e,"calendar",h.calendar)}if(d(e,g),r("autorange",!e.isValidRange(t.range))&&r("rangemode"),r("range"),e.cleanRange(),f(t,e,r),e._initialCategories="category"===_?p(y,e.categoryorder,e.categoryarray,h.data):[],!b)return e;var w=r("color"),k=w===t.color?w:m.color;r("title",x),i.coerceFont(r,"titlefont",{family:m.family,size:Math.round(1.2*m.size),color:k}),s(t,e,r,_),u(t,e,r,_,h),c(t,e,r,h);var M=v("linecolor",w),A=v("linewidth"),T=r("showline",!!M||!!A);T||(delete e.linecolor,delete e.linewidth),(T||e.ticks)&&r("mirror");var L=v("gridcolor",n(w,h.bgColor,o).toRgbString()),C=v("gridwidth");r("showgrid",h.showGrid||!!L||!!C)||(delete e.gridcolor,delete e.gridwidth);var S=v("zerolinecolor",w),O=v("zerolinewidth");return r("zeroline",h.showGrid||!!S||!!O)||(delete e.zerolinecolor,delete e.zerolinewidth),e}},{"../../components/color/attributes":33,"../../lib":149,"../../registry":225,"./category_order_defaults":193,"./layout_attributes":200,"./ordered_categories":202,"./set_convert":206,"./tick_label_defaults":207,"./tick_mark_defaults":208,"./tick_value_defaults":209,tinycolor2:16}],192:[function(t,e,r){"use strict";function n(t,e,r){function n(t,r){for(var n=Object.keys(t),a=/^[xyz]axis[0-9]*/,i=[],o=0;o<n.length;o++){var l=n[o];e&&l.charAt(0)!==e||a.test(l)&&i.push(r+l)}return i.sort()}var a=t._fullLayout;if(!a)return[];var o=n(a,"");if(r)return o;for(var l=i.getSubplotIds(a,"gl3d")||[],s=0;s<l.length;s++){var c=l[s];o=o.concat(n(a[c],c+"."))}return o}var a=t("../../registry"),i=t("../plots"),o=t("../../lib"),l=t("./constants");r.id2name=function(t){if("string"==typeof t&&t.match(l.AX_ID_PATTERN)){var e=t.substr(1);return"1"===e&&(e=""),t.charAt(0)+"axis"+e}},r.name2id=function(t){if(t.match(l.AX_NAME_PATTERN)){var e=t.substr(5);return"1"===e&&(e=""),t.charAt(0)+e}},r.cleanId=function(t,e){if(t.match(l.AX_ID_PATTERN)&&(!e||t.charAt(0)===e)){var r=t.substr(1).replace(/^0+/,"");return"1"===r&&(r=""),t.charAt(0)+r}},r.list=function(t,e,r){return n(t,e,r).map(function(e){return o.nestedProperty(t._fullLayout,e).get()})},r.listIds=function(t,e){return n(t,e,!0).map(r.name2id)},r.getFromId=function(t,e,n){var a=t._fullLayout;return"x"===n?e=e.replace(/y[0-9]*/,""):"y"===n&&(e=e.replace(/x[0-9]*/,"")),a[r.id2name(e)]},r.getFromTrace=function(t,e,n){var i=t._fullLayout,o=null;if(a.traceIs(e,"gl3d")){var l=e.scene;"scene"===l.substr(0,5)&&(o=i[l][n+"axis"])}else o=r.getFromId(t,e[n+"axis"]||n);return o}},{"../../lib":149,"../../registry":225,"../plots":218,"./constants":194}],193:[function(t,e,r){"use strict";e.exports=function(t,e,r){if("category"===e.type){var n,a=t.categoryarray,i=Array.isArray(a)&&a.length>0;i&&(n="array");var o=r("categoryorder",n);"array"===o&&r("categoryarray"),i||"array"!==o||(e.categoryorder="trace")}}},{}],194:[function(t,e,r){"use strict";var n=t("../../lib").counterRegex;e.exports={idRegex:{x:n("x"),y:n("y")},attrRegex:n("[xy]axis"),xAxisMatch:n("xaxis"),yAxisMatch:n("yaxis"),AX_ID_PATTERN:/^[xyz][0-9]*$/,AX_NAME_PATTERN:/^[xyz]axis[0-9]*$/,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","maplayer","barlayer","carpetlayer","boxlayer","scatterlayer"],layerValue2layerClass:{"above traces":"above","below traces":"below"}}},{"../../lib":149}],195:[function(t,e,r){"use strict";function n(t,e,r,n){var a,i,l,s,c=n[o(e)].type,u=[];for(i=0;i<r.length;i++)(l=r[i])!==e&&(s=n[o(l)],s.type!==c||s.fixedrange||u.push(l));for(a=0;a<t.length;a++)if(t[a][e]){var f=t[a],d=[];for(i=0;i<u.length;i++)l=u[i],f[l]||d.push(l);return{linkableAxes:d,thisGroup:f}}return{linkableAxes:u,thisGroup:null}}function a(t,e,r,n,a){var i,o,l,s,c;null===e?(e={},e[r]=1,c=t.length,t.push(e)):c=t.indexOf(e);var u=Object.keys(e);for(i=0;i<t.length;i++)if(l=t[i],i!==c&&l[n]){var f=l[n];for(o=0;o<u.length;o++)s=u[o],l[s]=f*a*e[s];return void t.splice(c,1)}if(1!==a)for(o=0;o<u.length;o++)e[u[o]]*=a;e[n]=1}var i=t("../../lib"),o=t("./axis_ids").id2name;e.exports=function(t,e,r,o,l){var s=l._axisConstraintGroups,c=e._id,u=c.charAt(0);if(!e.fixedrange&&(r("constrain"),i.coerce(t,e,{constraintoward:{valType:"enumerated",values:"x"===u?["left","center","right"]:["bottom","middle","top"],dflt:"x"===u?"center":"middle"}},"constraintoward"),t.scaleanchor)){var f=n(s,c,o,l),d=i.coerce(t,e,{scaleanchor:{valType:"enumerated",values:f.linkableAxes}},"scaleanchor");if(d){var p=r("scaleratio");p||(p=e.scaleratio=1),a(s,f.thisGroup,c,d,p)}else-1!==o.indexOf(t.scaleanchor)&&i.warn("ignored "+e._name+'.scaleanchor: "'+t.scaleanchor+'" to avoid either an infinite loop and possibly inconsistent scaleratios, or because the targetaxis has fixed range.')}}},{"../../lib":149,"./axis_ids":192}],196:[function(t,e,r){"use strict";function n(t,e){var r=t._inputDomain,n=l[t.constraintoward],a=r[0]+(r[1]-r[0])*n;t.domain=t._input.domain=[a+(r[0]-a)/e,a+(r[1]-a)/e]}var a=t("./axis_ids").id2name,i=t("./scale_zoom"),o=t("../../constants/numerical").ALMOST_EQUAL,l=t("../../constants/alignment").FROM_BL;r.enforce=function(t){var e,r,l,s,c,u,f,d=t._fullLayout,p=d._axisConstraintGroups;for(e=0;e<p.length;e++){var h=p[e],g=Object.keys(h),v=1/0,y=0,m=1/0,x={},b={},_=!1;for(r=0;r<g.length;r++)l=g[r],b[l]=s=d[a(l)],s._inputDomain?s.domain=s._inputDomain.slice():s._inputDomain=s.domain.slice(),s._inputRange||(s._inputRange=s.range.slice()),s.setScale(),x[l]=c=Math.abs(s._m)/h[l],v=Math.min(v,c),"domain"!==s.constrain&&s._constraintShrinkable||(m=Math.min(m,c)),delete s._constraintShrinkable,y=Math.max(y,c),"domain"===s.constrain&&(_=!0);if(!(v>o*y)||_)for(r=0;r<g.length;r++)if(l=g[r],c=x[l],s=b[l],u=s.constrain,c!==m||"domain"===u)if(f=c/m,"range"===u)i(s,f);else{var w=s._inputDomain,k=(s.domain[1]-s.domain[0])/(w[1]-w[0]),M=(s.r2l(s.range[1])-s.r2l(s.range[0]))/(s.r2l(s._inputRange[1])-s.r2l(s._inputRange[0]));if((f/=k)*M<1){s.domain=s._input.domain=w.slice(),i(s,f);continue}if(M<1&&(s.range=s._input.range=s._inputRange.slice(),f*=M),s.autorange&&s._min.length&&s._max.length){var A=s.r2l(s.range[0]),T=s.r2l(s.range[1]),L=(A+T)/2,C=L,S=L,O=Math.abs(T-L),z=L-O*f*1.0001,D=L+O*f*1.0001;n(s,f),s.setScale();var P,E,N=Math.abs(s._m);for(E=0;E<s._min.length;E++)(P=s._min[E].val-s._min[E].pad/N)>z&&P<C&&(C=P);for(E=0;E<s._max.length;E++)(P=s._max[E].val+s._max[E].pad/N)<D&&P>S&&(S=P);var I=(S-C)/(2*O);f/=I,C=s.l2r(C),S=s.l2r(S),s.range=s._input.range=A<T?[C,S]:[S,C]}n(s,f)}}},r.clean=function(t,e){if(e._inputDomain){for(var r=!1,n=e._id,a=t._fullLayout._axisConstraintGroups,i=0;i<a.length;i++)if(a[i][n]){r=!0;break}r&&"domain"===e.constrain||(e._input.domain=e.domain=e._inputDomain,delete e._inputDomain)}}},{"../../constants/alignment":131,"../../constants/numerical":133,"./axis_ids":192,"./scale_zoom":204}],197:[function(t,e,r){"use strict";function n(t,e,r,n,a,i,o){var l=t.draglayer.selectAll("."+e).data([0]);return l.enter().append("rect").classed("drag",!0).classed(e,!0).style({fill:"transparent","stroke-width":0}).attr("data-subplot",t.id),l.call(L.setRect,n,a,i,o).call(C,r),l.node()}function a(t,e){for(var r=0;r<t.length;r++)if(!t[r].fixedrange)return e;return""}function i(t,e){var r,n=t.range[e],a=Math.abs(n-t.range[1-e]);return"date"===t.type?n:"log"===t.type?(r=Math.ceil(Math.max(0,-Math.log(a)/Math.LN10))+3,b.format("."+r+"g")(Math.pow(10,n))):(r=Math.floor(Math.log(Math.abs(n))/Math.LN10)-Math.floor(Math.log(a)/Math.LN10)+4,b.format("."+String(r)+"g")(n))}function o(t,e,r,n,a){var i,l,s,c;for(i=0;i<t.length;i++)l=t[i],l.fixedrange||(s=l._rl[0],c=l._rl[1]-s,l.range=[l.l2r(s+c*e),l.l2r(s+c*r)],n[l._name+".range[0]"]=l.range[0],n[l._name+".range[1]"]=l.range[1]);if(a&&a.length){var u=(e+(1-r))/2;o(a,u,1-u,n)}}function l(t,e){for(var r=0;r<t.length;r++){var n=t[r];n.fixedrange||(n.range=[n.l2r(n._rl[0]-e/n._m),n.l2r(n._rl[1]-e/n._m)])}}function s(t){return 1-(t>=0?Math.min(t,.9):1/(1/Math.max(t,-.3)+3.222))}function c(t,e){return t?"nsew"===t?"pan"===e?"move":"crosshair":t.toLowerCase()+"-resize":"pointer"}function u(t,e,r,n,a){return t.append("path").attr("class","zoombox").style({fill:e>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform","translate("+r+", "+n+")").attr("d",a+"Z")}function f(t,e,r){return t.append("path").attr("class","zoombox-corners").style({fill:T.background,stroke:T.defaultLine,"stroke-width":1,opacity:0}).attr("transform","translate("+e+", "+r+")").attr("d","M0,0Z")}function d(t){t.selectAll(".select-outline").remove()}function p(t,e,r,n,a,i){t.attr("d",n+"M"+r.l+","+r.t+"v"+r.h+"h"+r.w+"v-"+r.h+"h-"+r.w+"Z"),a||(t.transition().style("fill",i>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),e.transition().style("opacity",1).duration(200))}function h(t){b.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function g(t){return-1!==["lasso","select"].indexOf(t)}function v(t,e){return"M"+(t.l-.5)+","+(e-F-.5)+"h-3v"+(2*F+1)+"h3ZM"+(t.r+.5)+","+(e-F-.5)+"h3v"+(2*F+1)+"h-3Z"}function y(t,e){return"M"+(e-F-.5)+","+(t.t-.5)+"v-3h"+(2*F+1)+"v3ZM"+(e-F-.5)+","+(t.b+.5)+"v3h"+(2*F+1)+"v-3Z"}function m(t){var e=Math.floor(Math.min(t.b-t.t,t.r-t.l,F)/2);return"M"+(t.l-3.5)+","+(t.t-.5+e)+"h3v"+-e+"h"+e+"v-3h-"+(e+3)+"ZM"+(t.r+3.5)+","+(t.t-.5+e)+"h-3v"+-e+"h"+-e+"v-3h"+(e+3)+"ZM"+(t.r+3.5)+","+(t.b+.5-e)+"h-3v"+e+"h"+-e+"v3h"+(e+3)+"ZM"+(t.l-3.5)+","+(t.b+.5-e)+"h3v"+e+"h"+e+"v3h-"+(e+3)+"Z"}function x(t,e,r){var n,a,i,o,l,s,c=!1,u={},f={};for(n=0;n<t.length;n++){for(o=t[n],a=0;a<e.length;a++)if(o[e[a]]){for(l in o)-1===("x"===l.charAt(0)?e:r).indexOf(l)&&(u[l]=1);for(i=0;i<r.length;i++)o[r[i]]&&(c=!0)}for(a=0;a<r.length;a++)if(o[r[a]])for(s in o)-1===("x"===s.charAt(0)?e:r).indexOf(s)&&(f[s]=1)}return c&&(M.extendFlat(u,f),f={}),{x:u,y:f,xy:c}}var b=t("d3"),_=t("tinycolor2"),w=t("../../plotly"),k=t("../../registry"),M=t("../../lib"),A=t("../../lib/svg_text_utils"),T=t("../../components/color"),L=t("../../components/drawing"),C=t("../../lib/setcursor"),S=t("../../components/dragelement"),O=t("../../constants/alignment").FROM_TL,z=t("../plots"),D=t("./axes").doTicks,P=t("./axis_ids").getFromId,E=t("./select"),N=t("./scale_zoom"),I=t("./constants"),R=I.MINDRAG,F=I.MINZOOM,j=!0;e.exports=function(t,e,r,T,C,B,q,H){function V(){et=[e.xaxis],rt=[e.yaxis];var r=et[0],n=rt[0];it=r._length,ot=n._length;var i=pt._axisConstraintGroups,o=[r._id],l=[n._id];tt=[e].concat(q&&H?e.overlays:[]);for(var s=1;s<tt.length;s++){var u=tt[s].xaxis,f=tt[s].yaxis;-1===et.indexOf(u)&&(et.push(u),o.push(u._id)),-1===rt.indexOf(f)&&(rt.push(f),l.push(f._id))}lt=a(et,H),st=a(rt,q),ct=c(st+lt,pt.dragmode),nt=r._offset,at=n._offset;var d=x(i,o,l);ut=d.xy,ft=[];for(var p in d.x)ft.push(P(t,p));dt=[];for(var h in d.y)dt.push(P(t,h))}function U(e,r,n){var a=vt.getBoundingClientRect();mt=r-a.left,xt=n-a.top,bt={l:mt,r:mt,w:0,t:xt,b:xt,h:0},_t=t._hmpixcount?t._hmlumcount/t._hmpixcount:_(t._fullLayout.plot_bgcolor).getLuminance(),wt="M0,0H"+it+"V"+ot+"H0V0",kt=!1,Mt="xy",At=u(ht,_t,nt,at,wt),Tt=f(ht,nt,at),d(ht)}function G(e,r){function n(){Mt="",bt.r=bt.l,bt.t=bt.b,Tt.attr("d","M0,0Z")}if(t._transitioningWithDuration)return!1;var a=Math.max(0,Math.min(it,e+mt)),i=Math.max(0,Math.min(ot,r+xt)),o=Math.abs(a-mt),l=Math.abs(i-xt);bt.l=Math.min(mt,a),bt.r=Math.max(mt,a),bt.t=Math.min(xt,i),bt.b=Math.max(xt,i),ut?o>F||l>F?(Mt="xy",o/it>l/ot?(l=o*ot/it,xt>i?bt.t=xt-l:bt.b=xt+l):(o=l*it/ot,mt>a?bt.l=mt-o:bt.r=mt+o),Tt.attr("d",m(bt))):n():!st||l<Math.min(Math.max(.6*o,R),F)?o<R?n():(bt.t=0,bt.b=ot,Mt="x",Tt.attr("d",v(bt,xt))):!lt||o<Math.min(.6*l,F)?(bt.l=0,bt.r=it,Mt="y",Tt.attr("d",y(bt,mt))):(Mt="xy",Tt.attr("d",m(bt))),bt.w=bt.r-bt.l,bt.h=bt.b-bt.t,p(At,Tt,bt,wt,kt,_t),kt=!0}function X(e,r){if(Math.min(bt.h,bt.w)<2*R)return 2===r&&$(),h(t);"xy"!==Mt&&"x"!==Mt||o(et,bt.l/it,bt.r/it,Lt,ft),"xy"!==Mt&&"y"!==Mt||o(rt,(ot-bt.b)/ot,(ot-bt.t)/ot,Lt,dt),h(t),J(Mt),j&&t.data&&t._context.showTips&&(M.notifier("Double-click to
zoom back out","long"),j=!1)}function Y(e,r){var n=1===(q+H).length;if(e)J();else if(2!==r||n){if(1===r&&n){var a=q?rt[0]:et[0],o="s"===q||"w"===H?0:1,l=a._name+".range["+o+"]",s=i(a,o),c="left",u="middle";if(a.fixedrange)return;q?(u="n"===q?"top":"bottom","right"===a.side&&(c="right")):"e"===H&&(c="right"),t._context.showAxisRangeEntryBoxes&&b.select(vt).call(A.makeEditable,{gd:t,immediate:!0,background:pt.paper_bgcolor,text:String(s),fill:a.tickfont?a.tickfont.color:"#444",horizontalAlign:c,verticalAlign:u}).on("edit",function(e){var r=a.d2r(e);void 0!==r&&w.relayout(t,l,r)})}}else $()}function Z(e){function r(t,e,r){function n(e){return t.l2r(i+(e-i)*r)}if(!t.fixedrange){var a=M.simpleMap(t.range,t.r2l),i=a[0]+(a[1]-a[0])*e;t.range=a.map(n)}}if(t._context.scrollZoom||pt._enablescrollzoom){if(t._transitioningWithDuration)return M.pauseEvent(e);var n=t.querySelector(".plotly");if(V(),!(n.scrollHeight-n.clientHeight>10||n.scrollWidth-n.clientWidth>10)){clearTimeout(St);var a=-e.deltaY;if(isFinite(a)||(a=e.wheelDelta/10),!isFinite(a))return void M.log("Did not find wheel motion attributes: ",e);var i,o=Math.exp(-Math.min(Math.max(a,-20),20)/200),l=zt.draglayer.select(".nsewdrag").node().getBoundingClientRect(),s=(e.clientX-l.left)/l.width,c=(l.bottom-e.clientY)/l.height;if(H||ut){for(H||(s=.5),i=0;i<et.length;i++)r(et[i],s,o);Ct[2]*=o,Ct[0]+=Ct[2]*s*(1/o-1)}if(q||ut){for(q||(c=.5),i=0;i<rt.length;i++)r(rt[i],c,o);Ct[3]*=o,Ct[1]+=Ct[3]*(1-c)*(1/o-1)}return K(Ct),Q(q,H),St=setTimeout(function(){Ct=[0,0,it,ot];var t;t=ut?"xy":(H?"x":"")+(q?"y":""),J(t)},Ot),M.pauseEvent(e)}}}function W(e,r){function n(t,e,r){for(var n,a,i=1-e,o=0;o<t.length;o++){var l=t[o];if(!l.fixedrange){n=l,a=l._rl[i]+(l._rl[e]-l._rl[i])/s(r/l._length);var c=l.l2r(a);!1!==c&&void 0!==c&&(l.range[e]=c)}}return n._length*(n._rl[e]-a)/(n._rl[e]-n._rl[i])}if(!t._transitioningWithDuration){if(V(),"ew"===lt||"ns"===st)return lt&&l(et,e),st&&l(rt,r),K([lt?-e:0,st?-r:0,it,ot]),void Q(st,lt);if(ut&&lt&&st){var a="w"===lt==("n"===st)?1:-1,i=(e/it+a*r/ot)/2;e=i*it,r=a*i*ot}"w"===lt?e=n(et,0,e):"e"===lt?e=n(et,1,-e):lt||(e=0),"n"===st?r=n(rt,1,r):"s"===st?r=n(rt,0,-r):st||(r=0);var o="w"===lt?e:0,c="n"===st?r:0;if(ut){var u;if(!lt&&1===st.length){for(u=0;u<et.length;u++)et[u].range=et[u]._r.slice(),N(et[u],1-r/ot);e=r*it/ot,o=e/2}if(!st&&1===lt.length){for(u=0;u<rt.length;u++)rt[u].range=rt[u]._r.slice(),N(rt[u],1-e/it);r=e*ot/it,c=r/2}}K([o,c,it-e,ot-r]),Q(st,lt)}}function Q(e,r){function n(t){for(i=0;i<t.length;i++)t[i].fixedrange||o.push(t[i]._id)}function a(n,a,l){for(i=0;i<n.length;i++){var s=n[i];if((r&&-1!==o.indexOf(s.xref)||e&&-1!==o.indexOf(s.yref))&&(a(t,i),l))return}}var i,o=[];for((r||ut)&&(n(et),n(ft)),(e||ut)&&(n(rt),n(dt)),Lt={},i=0;i<o.length;i++){var l=o[i];D(t,l,!0);var s=P(t,l);Lt[s._name+".range[0]"]=s.range[0],Lt[s._name+".range[1]"]=s.range[1]}a(pt.annotations||[],k.getComponentMethod("annotations","drawOne")),a(pt.shapes||[],k.getComponentMethod("shapes","drawOne")),a(pt.images||[],k.getComponentMethod("images","draw"),!0)}function $(){if(!t._transitioningWithDuration){var e,r,n,a=t._context.doubleClick,i=(lt?et:[]).concat(st?rt:[]),o={};if("reset+autosize"===a)for(a="autosize",r=0;r<i.length;r++)if(e=i[r],e._rangeInitial&&(e.range[0]!==e._rangeInitial[0]||e.range[1]!==e._rangeInitial[1])||!e._rangeInitial&&!e.autorange){a="reset";break}if("autosize"===a)for(r=0;r<i.length;r++)e=i[r],e.fixedrange||(o[e._name+".autorange"]=!0);else if("reset"===a)for((lt||ut)&&(i=i.concat(ft)),st&&!ut&&(i=i.concat(dt)),ut&&(lt?st||(i=i.concat(rt)):i=i.concat(et)),r=0;r<i.length;r++)e=i[r],e._rangeInitial?(n=e._rangeInitial,o[e._name+".range[0]"]=n[0],o[e._name+".range[1]"]=n[1]):o[e._name+".autorange"]=!0;t.emit("plotly_doubleclick",null),w.relayout(t,o)}}function J(e){void 0===e&&(e=(H?"x":"")+(q?"y":"")),K([0,0,it,ot]),M.syncOrAsync([z.previousPromises,function(){w.relayout(t,Lt)}],t)}function K(t){function e(t){return t.fixedrange?0:p&&-1!==ft.indexOf(t)?f:h&&-1!==(ut?ft:dt).indexOf(t)?d:0}function r(t,e){return e?(t.range=t._r.slice(),N(t,e),n(t,e)):0}function n(t,e){return t._length*(1-e)*O[t.constraintoward||"middle"]}var a,i,o,l,s,c=pt._plots,u=Object.keys(c),f=t[2]/et[0]._length,d=t[3]/rt[0]._length,p=H||ut,h=q||ut;for(a=0;a<u.length;a++){var g=c[u[a]],v=g.xaxis,y=g.yaxis,m=p&&!v.fixedrange&&-1!==et.indexOf(v),x=h&&!y.fixedrange&&-1!==rt.indexOf(y);if(m?(i=f,l=H?t[0]:n(v,i)):(i=e(v),l=r(v,i)),x?(o=d,s=q?t[1]:n(y,o)):(o=e(y),s=r(y,o)),i||o){i||(i=1),o||(o=1);var b=v._offset-l/i,_=y._offset-s/o;pt._defs.select("#"+g.clipId+"> rect").call(L.setTranslate,l,s).call(L.setScale,i,o);var w=g.plot.selectAll(".scatterlayer .points, .boxlayer .points");g.plot.call(L.setTranslate,b,_).call(L.setScale,1/i,1/o),w.selectAll(".point").call(L.setPointGroupScale,i,o).call(L.hideOutsideRangePoints,g),w.selectAll(".textpoint").call(L.setTextPointsScale,i,o).call(L.hideOutsideRangePoints,g)}}}var tt,et,rt,nt,at,it,ot,lt,st,ct,ut,ft,dt,pt=t._fullLayout,ht=t._fullLayout._zoomlayer,gt=q+H==="nsew";V();var vt=n(e,q+H+"drag",ct,r,T,C,B);if(!st&&!lt&&!g(pt.dragmode))return vt.onmousedown=null,vt.style.pointerEvents=gt?"all":"none",vt;var yt={element:vt,gd:t,plotinfo:e,prepFn:function(e,r,n){var a=t._fullLayout.dragmode;gt?e.shiftKey&&(a="pan"===a?"zoom":"pan"):a="pan",yt.minDrag="lasso"===a?1:void 0,"zoom"===a?(yt.moveFn=G,yt.doneFn=X,yt.minDrag=1,U(e,r,n)):"pan"===a?(yt.moveFn=W,yt.doneFn=Y,d(ht)):g(a)&&(yt.xaxes=et,yt.yaxes=rt,E(e,r,n,yt,a))}};S.init(yt);var mt,xt,bt,_t,wt,kt,Mt,At,Tt,Lt={},Ct=[0,0,it,ot],St=null,Ot=I.REDRAWDELAY,zt=e.mainplot?pt._plots[e.mainplot]:e;return q.length*H.length!=1&&(void 0!==vt.onwheel?vt.onwheel=Z:void 0!==vt.onmousewheel&&(vt.onmousewheel=Z)),vt}},{"../../components/color":34,"../../components/dragelement":55,"../../components/drawing":58,"../../constants/alignment":131,"../../lib":149,"../../lib/setcursor":167,"../../lib/svg_text_utils":169,"../../plotly":184,"../../registry":225,"../plots":218,"./axes":189,"./axis_ids":192,"./constants":194,"./scale_zoom":204,"./select":205,d3:7,tinycolor2:16}],198:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../components/fx"),i=t("../../components/dragelement"),o=t("./constants"),l=t("./dragbox");e.exports=function(t){var e=t._fullLayout;if((e._has("cartesian")||e._has("gl2d"))&&!t._context.staticPlot){Object.keys(e._plots||{}).sort(function(t,r){if((e._plots[t].mainplot&&!0)===(e._plots[r].mainplot&&!0)){var n=t.split("y"),a=r.split("y");return n[0]===a[0]?Number(n[1]||1)-Number(a[1]||1):Number(n[0]||1)-Number(a[0]||1)}return e._plots[t].mainplot?1:-1}).forEach(function(r){var s=e._plots[r],c=s.xaxis,u=s.yaxis,f=(c._linepositions[r]||[])[3],d=(u._linepositions[r]||[])[3],p=o.DRAGGERSIZE;if(n(f)&&"top"===c.side&&(f-=p),n(d)&&"right"!==u.side&&(d-=p),!s.mainplot){var h=l(t,s,0,0,c._length,u._length,"ns","ew");h.onmousemove=function(e){t._fullLayout._rehover=function(){t._fullLayout._hoversubplot===r&&a.hover(t,e,r)},a.hover(t,e,r),t._fullLayout._lasthover=h,t._fullLayout._hoversubplot=r},h.onmouseout=function(e){t._dragging||(t._fullLayout._hoversubplot=null,i.unhover(t,e))},h.onclick=function(e){a.click(t,e,r)},t._context.showAxisDragHandles&&(l(t,s,-p,-p,p,p,"n","w"),l(t,s,c._length,-p,p,p,"n","e"),l(t,s,-p,u._length,p,p,"s","w"),l(t,s,c._length,u._length,p,p,"s","e"))}t._context.showAxisDragHandles&&(n(f)&&("free"===c.anchor&&(f-=e._size.h*(1-u.domain[1])),l(t,s,.1*c._length,f,.8*c._length,p,"","ew"),l(t,s,0,f,.1*c._length,p,"","w"),l(t,s,.9*c._length,f,.1*c._length,p,"","e")),n(d)&&("free"===u.anchor&&(d-=e._size.w*c.domain[0]),l(t,s,d,.1*u._length,p,.8*u._length,"ns",""),l(t,s,d,.9*u._length,p,.1*u._length,"s",""),l(t,s,d,0,p,.1*u._length,"n","")))});var r=e._hoverlayer.node();r.onmousemove=function(r){r.target=e._lasthover,a.hover(t,r,e._hoversubplot)},r.onclick=function(r){r.target=e._lasthover,a.click(t,r)},r.onmousedown=function(t){e._lasthover.onmousedown(t)}}}},{"../../components/dragelement":55,"../../components/fx":75,"./constants":194,"./dragbox":197,"fast-isnumeric":10}],199:[function(t,e,r){"use strict";function n(t,e,r,n,a){var i=t._fullLayout,o=i._modules;e.plot&&e.plot.selectAll("g:not(.scatterlayer)").selectAll("g.trace").remove();for(var l=0;l<o.length;l++){var s=o[l];if("cartesian"===s.basePlotModule.name){for(var c=[],u=0;u<r.length;u++){var f=r[u],d=f[0].trace;d._module===s&&!0===d.visible&&c.push(f)}s.plot(t,e,c,n,a)}}}function a(t){for(var e=t._fullLayout,r=Object.keys(e._plots),n=[],a=[],i=0;i<r.length;i++){var o=r[i],l=e._plots[o],s=l.xaxis,c=l.yaxis,u=s._mainAxis,f=c._mainAxis,d=u._id+f._id;d!==o&&-1!==r.indexOf(d)?(l.mainplot=d,l.mainplotinfo=e._plots[d],a.push(o)):n.push(o)}return n=n.concat(a)}function i(t){var e=t.plotgroup,r=t.id,n=d.layerValue2layerClass[t.xaxis.layer],a=d.layerValue2layerClass[t.yaxis.layer];if(t.mainplot){var i=t.mainplotinfo,o=i.plotgroup,s=r+"-x",c=r+"-y";t.gridlayer=l(i.overgrid,"g",r),t.zerolinelayer=l(i.overzero,"g",r),l(i.overlinesBelow,"path",s),l(i.overlinesBelow,"path",c),l(i.overaxesBelow,"g",s),l(i.overaxesBelow,"g",c),t.plot=l(i.overplot,"g",r),l(i.overlinesAbove,"path",s),l(i.overlinesAbove,"path",c),l(i.overaxesAbove,"g",s),l(i.overaxesAbove,"g",c),t.xlines=o.select(".overlines-"+n).select("."+s),t.ylines=o.select(".overlines-"+a).select("."+c),t.xaxislayer=o.select(".overaxes-"+n).select("."+s),t.yaxislayer=o.select(".overaxes-"+a).select("."+c)}else{var u=l(e,"g","layer-subplot");t.shapelayer=l(u,"g","shapelayer"),t.imagelayer=l(u,"g","imagelayer"),t.gridlayer=l(e,"g","gridlayer"),t.overgrid=l(e,"g","overgrid"),t.zerolinelayer=l(e,"g","zerolinelayer"),t.overzero=l(e,"g","overzero"),l(e,"path","xlines-below"),l(e,"path","ylines-below"),t.overlinesBelow=l(e,"g","overlines-below"),l(e,"g","xaxislayer-below"),l(e,"g","yaxislayer-below"),t.overaxesBelow=l(e,"g","overaxes-below"),t.plot=l(e,"g","plot"),t.overplot=l(e,"g","overplot"),l(e,"path","xlines-above"),l(e,"path","ylines-above"),t.overlinesAbove=l(e,"g","overlines-above"),l(e,"g","xaxislayer-above"),l(e,"g","yaxislayer-above"),t.overaxesAbove=l(e,"g","overaxes-above"),t.xlines=e.select(".xlines-"+n),t.ylines=e.select(".ylines-"+a),t.xaxislayer=e.select(".xaxislayer-"+n),t.yaxislayer=e.select(".yaxislayer-"+a)}for(var f=0;f<d.traceLayerClasses.length;f++)l(t.plot,"g",d.traceLayerClasses[f]);t.xlines.style("fill","none").classed("crisp",!0),t.ylines.style("fill","none").classed("crisp",!0)}function o(t,e){if(t){var r={};t.each(function(t){var n=s.select(this),a="clip"+e._uid+t+"plot";n.remove(),e._draggers.selectAll("g."+t).remove(),e._defs.select("#"+a).remove(),r[t]=!0});for(var n=e._plots,a=Object.keys(n),i=0;i<a.length;i++)for(var o=n[a[i]],l=o.overlays||[],c=0;c<l.length;c++){var u=l[c];r[u.id]&&u.plot.selectAll(".trace").remove()}}}function l(t,e,r){var n=t.selectAll("."+r).data([0]);return n.enter().append(e).classed(r,!0),n}var s=t("d3"),c=t("../../lib"),u=t("../plots"),f=t("./axis_ids"),d=t("./constants");r.name="cartesian",r.attr=["xaxis","yaxis"],r.idRoot=["x","y"],r.idRegex=d.idRegex,r.attrRegex=d.attrRegex,r.attributes=t("./attributes"),r.layoutAttributes=t("./layout_attributes"), r.transitionAxes=t("./transition_axes"),r.plot=function(t,e,r,a){var i,o=t._fullLayout,l=u.getSubplotIds(o,"cartesian"),s=t.calcdata;if(!Array.isArray(e))for(e=[],i=0;i<s.length;i++)e.push(i);for(i=0;i<l.length;i++){for(var c,f=l[i],d=o._plots[f],p=[],h=0;h<s.length;h++){var g=s[h],v=g[0].trace;v.xaxis+v.yaxis===f&&((-1!==e.indexOf(v.index)||v.carpet)&&(c&&c[0].trace.xaxis+c[0].trace.yaxis===f&&-1!==["tonextx","tonexty","tonext"].indexOf(v.fill)&&-1===p.indexOf(c)&&p.push(c),p.push(g)),c=g)}n(t,d,p,r,a)}},r.clean=function(t,e,r,n){var a,i,l,s=n._modules||[],c=e._modules||[];for(l=0;l<s.length;l++)if("scatter"===s[l].name){a=!0;break}for(l=0;l<c.length;l++)if("scatter"===c[l].name){i=!0;break}if(a&&!i){var u=n._plots,d=Object.keys(u||{});for(l=0;l<d.length;l++){var p=u[d[l]];p.plot&&p.plot.select("g.scatterlayer").selectAll("g.trace").remove()}n._infolayer.selectAll("g.rangeslider-container").select("g.scatterlayer").selectAll("g.trace").remove()}var h=n._has&&n._has("cartesian"),g=e._has&&e._has("cartesian");if(h&&!g){var v=n._cartesianlayer.selectAll(".subplot"),y=f.listIds({_fullLayout:n});for(v.call(o,n),n._defs.selectAll(".axesclip").remove(),l=0;l<y.length;l++)n._infolayer.select("."+y[l]+"title").remove()}},r.drawFramework=function(t){var e=t._fullLayout,r=a(t),n=e._cartesianlayer.selectAll(".subplot").data(r,c.identity);n.enter().append("g").attr("class",function(t){return"subplot "+t}),n.order(),n.exit().call(o,e),n.each(function(t){var r=e._plots[t];if(r.plotgroup=s.select(this),r.overlays=[],i(r),r.mainplot){e._plots[r.mainplot].overlays.push(r)}r.draglayer=l(e._draggers,"g",t)})},r.rangePlot=function(t,e,r){i(e),n(t,e,r),u.style(t)}},{"../../lib":149,"../plots":218,"./attributes":188,"./axis_ids":192,"./constants":194,"./layout_attributes":200,"./transition_axes":210,d3:7}],200:[function(t,e,r){"use strict";var n=t("../font_attributes"),a=t("../../components/color/attributes"),i=t("../../components/drawing/attributes").dash,o=t("../../lib/extend").extendFlat,l=t("./constants");e.exports={visible:{valType:"boolean",editType:"plot"},color:{valType:"color",dflt:a.defaultLine,editType:"ticks"},title:{valType:"string",editType:"ticks"},titlefont:n({editType:"ticks"}),type:{valType:"enumerated",values:["-","linear","log","date","category"],dflt:"-",editType:"calc"},autorange:{valType:"enumerated",values:[!0,!1,"reversed"],dflt:!0,editType:"calc",impliedEdits:{"range[0]":void 0,"range[1]":void 0}},rangemode:{valType:"enumerated",values:["normal","tozero","nonnegative"],dflt:"normal",editType:"calc"},range:{valType:"info_array",items:[{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}},{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}}],editType:"plot",impliedEdits:{autorange:!1}},fixedrange:{valType:"boolean",dflt:!1,editType:"calc"},scaleanchor:{valType:"enumerated",values:[l.idRegex.x.toString(),l.idRegex.y.toString()],editType:"calc"},scaleratio:{valType:"number",min:0,dflt:1,editType:"calc"},constrain:{valType:"enumerated",values:["range","domain"],dflt:"range",editType:"calc"},constraintoward:{valType:"enumerated",values:["left","center","right","top","middle","bottom"],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"},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"},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"},tickfont:n({editType:"ticks"}),tickangle:{valType:"angle",dflt:"auto",editType:"ticks"},tickprefix:{valType:"string",dflt:"",editType:"ticks"},showtickprefix:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",editType:"ticks"},ticksuffix:{valType:"string",dflt:"",editType:"ticks"},showticksuffix:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",editType:"ticks"},showexponent:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",editType:"ticks"},exponentformat:{valType:"enumerated",values:["none","e","E","power","SI","B"],dflt:"B",editType:"ticks"},separatethousands:{valType:"boolean",dflt:!1,editType:"ticks"},tickformat:{valType:"string",dflt:"",editType:"ticks"},hoverformat:{valType:"string",dflt:"",editType:"none"},showline:{valType:"boolean",dflt:!1,editType:"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"},anchor:{valType:"enumerated",values:["free",l.idRegex.x.toString(),l.idRegex.y.toString()],editType:"plot"},side:{valType:"enumerated",values:["top","bottom","left","right"],editType:"plot"},overlaying:{valType:"enumerated",values:["free",l.idRegex.x.toString(),l.idRegex.y.toString()],editType:"calc"},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:"calc"},{valType:"number",min:0,max:1,editType:"calc"}],dflt:[0,1],editType:"calc"},position:{valType:"number",min:0,max:1,dflt:0,editType:"plot"},categoryorder:{valType:"enumerated",values:["trace","category ascending","category descending","array"],dflt:"trace",editType:"calc"},categoryarray:{valType:"data_array",editType:"calc"},editType:"calc",_deprecated:{autotick:{valType:"boolean",editType:"ticks"}}}},{"../../components/color/attributes":33,"../../components/drawing/attributes":57,"../../lib/extend":143,"../font_attributes":213,"./constants":194}],201:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../lib"),i=t("../../components/color"),o=t("../layout_attributes"),l=t("./constants"),s=t("./layout_attributes"),c=t("./type_defaults"),u=t("./axis_defaults"),f=t("./constraint_defaults"),d=t("./position_defaults"),p=t("./axis_ids");e.exports=function(t,e,r){function h(t,e){return Number(t.substr(5)||1)-Number(e.substr(5)||1)}function g(t,e){return a.coerce(j,B,s,t,e)}function v(t){var e={x:E,y:P}[t];return a.simpleMap(e,p.name2id)}var y,m=Object.keys(t),x=[],b=[],_=[],w=[],k=[],M=[],A={},T={};for(y=0;y<r.length;y++){var L,C,S=r[y];if(n.traceIs(S,"cartesian"))L=x,C=b;else{if(!n.traceIs(S,"gl2d"))continue;L=_,C=w}var O=p.id2name(S.xaxis),z=p.id2name(S.yaxis);if(n.traceIs(S,"carpet")&&("carpet"!==S.type||S._cheater)||O&&a.pushUnique(M,O),"carpet"===S.type&&S._cheater&&O&&a.pushUnique(k,O),O&&-1===L.indexOf(O)&&L.push(O),z&&-1===C.indexOf(z)&&C.push(z),n.traceIs(S,"2dMap")&&(A[O]=!0,A[z]=!0),n.traceIs(S,"oriented")){T["h"===S.orientation?z:O]=!0}}if(!e._has("gl3d")&&!e._has("geo"))for(y=0;y<m.length;y++){var D=m[y];-1===_.indexOf(D)&&-1===x.indexOf(D)&&l.xAxisMatch.test(D)?x.push(D):-1===w.indexOf(D)&&-1===b.indexOf(D)&&l.yAxisMatch.test(D)&&b.push(D)}x.length&&b.length&&a.pushUnique(e._basePlotModules,n.subplotsRegistry.cartesian);var P=x.concat(_).sort(h),E=b.concat(w).sort(h),N=P.concat(E),I=i.background;P.length&&E.length&&(I=a.coerce(t,e,o,"plot_bgcolor"));var R,F,j,B,q=i.combine(I,e.paper_bgcolor),H={x:v("x"),y:v("y")};for(y=0;y<N.length;y++){R=N[y],a.isPlainObject(t[R])||(t[R]={}),j=t[R],B=e[R]={},c(j,B,g,r,R),F=R.charAt(0);var V=function(e,r){for(var n={x:P,y:E}[e],a=[],i=0;i<n.length;i++){var o=n[i];o===r||(t[o]||{}).overlaying||a.push(p.name2id(o))}return a}(F,R),U={letter:F,font:e.font,outerTicks:A[R],showGrid:!T[R],data:r,bgColor:q,calendar:e.calendar,cheateronly:"x"===F&&-1!==k.indexOf(R)&&-1===M.indexOf(R)};u(j,B,g,U,e);g("showspikes")&&(g("spikecolor"),g("spikethickness"),g("spikedash"),g("spikemode"));var G={letter:F,counterAxes:H[F],overlayableAxes:V};d(j,B,g,G),B._input=j}var X=n.getComponentMethod("rangeslider","handleDefaults"),Y=n.getComponentMethod("rangeselector","handleDefaults");for(y=0;y<P.length;y++)R=P[y],j=t[R],B=e[R],X(t,e,R),"date"===B.type&&Y(j,B,e,E,B.calendar),g("fixedrange");for(y=0;y<E.length;y++){R=E[y],j=t[R],B=e[R];var Z=e[p.id2name(B.anchor)];g("fixedrange",Z&&Z.rangeslider&&Z.rangeslider.visible)}e._axisConstraintGroups=[];var W=H.x.concat(H.y);for(y=0;y<N.length;y++)R=N[y],F=R.charAt(0),j=t[R],B=e[R],f(j,B,g,W,e)}},{"../../components/color":34,"../../lib":149,"../../registry":225,"../layout_attributes":216,"./axis_defaults":191,"./axis_ids":192,"./constants":194,"./constraint_defaults":195,"./layout_attributes":200,"./position_defaults":203,"./type_defaults":211}],202:[function(t,e,r){"use strict";function n(t,e,r){var n,i,o,l,s,c=[],u=r.map(function(e){return e[t]}),f=a.bisector(e).left;for(n=0;n<u.length;n++)for(o=u[n],i=0;i<o.length;i++)null!==(l=o[i])&&void 0!==l&&((s=f(c,l))<c.length&&c[s]===l||c.splice(s,0,l));return c}var a=t("d3");e.exports=function(t,e,r,i){switch(e){case"array":return Array.isArray(r)?r.slice():[];case"category ascending":return n(t,a.ascending,i);case"category descending":return n(t,a.descending,i);case"trace":default:return[]}}},{d3:7}],203:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib");e.exports=function(t,e,r,i){var o=i.counterAxes||[],l=i.overlayableAxes||[],s=i.letter;"free"===a.coerce(t,e,{anchor:{valType:"enumerated",values:["free"].concat(o),dflt:n(t.position)?"free":o[0]||"free"}},"anchor")&&r("position"),a.coerce(t,e,{side:{valType:"enumerated",values:"x"===s?["bottom","top"]:["left","right"],dflt:"x"===s?"bottom":"left"}},"side");var c=!1;if(l.length&&(c=a.coerce(t,e,{overlaying:{valType:"enumerated",values:[!1].concat(l),dflt:!1}},"overlaying")),!c){var u=r("domain");u[0]>u[1]-.01&&(e.domain=[0,1]),a.noneOrAll(t.domain,e.domain,[0,1])}return r("layer"),e}},{"../../lib":149,"fast-isnumeric":10}],204:[function(t,e,r){"use strict";var n=t("../../constants/alignment").FROM_BL;e.exports=function(t,e,r){void 0===r&&(r=n[t.constraintoward||"center"]);var a=[t.r2l(t.range[0]),t.r2l(t.range[1])],i=a[0]+(a[1]-a[0])*r;t.range=t._input.range=[t.l2r(i+(a[0]-i)*e),t.l2r(i+(a[1]-i)*e)]}},{"../../constants/alignment":131}],205:[function(t,e,r){"use strict";function n(t){return t._id}function a(t,e){if(Array.isArray(t))for(var r=e.cd[0].trace,n=0;n<t.length;n++){var a=t[n];a.curveNumber=r.index,a.data=r._input,a.fullData=r,s(a,r,a.pointNumber)}return t}var i=t("../../lib/polygon"),o=t("../../lib/throttle"),l=t("../../components/color"),s=t("../../components/fx/helpers").appendArrayPointValue,c=t("./axes"),u=t("./constants"),f=i.filter,d=i.tester,p=u.MINSELECT;e.exports=function(t,e,r,i,s){function h(t){var e="y"===t._id.charAt(0)?1:0;return function(r){return t.p2d(r[e])}}function g(t,e){return t-e}var v,y=i.gd._fullLayout._zoomlayer,m=i.element.getBoundingClientRect(),x=i.plotinfo,b=x.xaxis._offset,_=x.yaxis._offset,w=e-m.left,k=r-m.top,M=w,A=k,T="M"+w+","+k,L=i.xaxes[0]._length,C=i.yaxes[0]._length,S=i.xaxes.map(n),O=i.yaxes.map(n),z=i.xaxes.concat(i.yaxes);"lasso"===s&&(v=f(w,k,u.BENDPX));var D=y.selectAll("path.select-outline").data([1,2]);D.enter().append("path").attr("class",function(t){return"select-outline select-outline-"+t}).attr("transform","translate("+b+", "+_+")").attr("d",T+"Z");var P,E,N,I,R,F=y.append("path").attr("class","zoombox-corners").style({fill:l.background,stroke:l.defaultLine,"stroke-width":1}).attr("transform","translate("+b+", "+_+")").attr("d","M0,0Z"),j=[],B=i.gd,q=B._fullLayout._uid+u.SELECTID,H=[];for(P=0;P<B.calcdata.length;P++)if(E=B.calcdata[P],N=E[0].trace,!0===N.visible&&N._module&&N._module.selectPoints)if(i.subplot)N.subplot!==i.subplot&&N.geo!==i.subplot||j.push({selectPoints:N._module.selectPoints,cd:E,xaxis:i.xaxes[0],yaxis:i.yaxes[0]});else{if(-1===S.indexOf(N.xaxis))continue;if(-1===O.indexOf(N.yaxis))continue;j.push({selectPoints:N._module.selectPoints,cd:E,xaxis:c.getFromId(B,N.xaxis),yaxis:c.getFromId(B,N.yaxis)})}var V;V=x.fillRangeItems?x.fillRangeItems:"select"===s?function(t,e){var r=t.range={};for(P=0;P<z.length;P++){var n=z[P],a=n._id.charAt(0);r[n._id]=[n.p2d(e[a+"min"]),n.p2d(e[a+"max"])].sort(g)}}:function(t,e,r){var n=t.lassoPoints={};for(P=0;P<z.length;P++){var a=z[P];n[a._id]=r.filtered.map(h(a))}},i.moveFn=function(t,e){var r;M=Math.max(0,Math.min(L,t+w)),A=Math.max(0,Math.min(C,e+k));var n=Math.abs(M-w),l=Math.abs(A-k);"select"===s?(l<Math.min(.6*n,p)?(r=d([[w,0],[w,C],[M,C],[M,0]]),F.attr("d","M"+r.xmin+","+(k-p)+"h-4v"+2*p+"h4ZM"+(r.xmax-1)+","+(k-p)+"h4v"+2*p+"h-4Z")):n<Math.min(.6*l,p)?(r=d([[0,k],[0,A],[L,A],[L,k]]),F.attr("d","M"+(w-p)+","+r.ymin+"v-4h"+2*p+"v4ZM"+(w-p)+","+(r.ymax-1)+"v4h"+2*p+"v-4Z")):(r=d([[w,k],[w,A],[M,A],[M,k]]),F.attr("d","M0,0Z")),D.attr("d","M"+r.xmin+","+r.ymin+"H"+(r.xmax-1)+"V"+(r.ymax-1)+"H"+r.xmin+"Z")):"lasso"===s&&(v.addPt([M,A]),r=d(v.filtered),D.attr("d","M"+v.filtered.join("L")+"Z")),o.throttle(q,u.SELECTDELAY,function(){for(H=[],P=0;P<j.length;P++){I=j[P];var t=a(I.selectPoints(I,r),I);if(H.length)for(var e=0;e<t.length;e++)H.push(t[e]);else H=t}R={points:H},V(R,r,v),i.gd.emit("plotly_selecting",R)})},i.doneFn=function(t,e){F.remove(),o.done(q).then(function(){if(o.clear(q),t||2!==e)i.gd.emit("plotly_selected",R);else{for(D.remove(),P=0;P<j.length;P++)I=j[P],I.selectPoints(I,!1);B.emit("plotly_deselect",null)}})}}},{"../../components/color":34,"../../components/fx/helpers":72,"../../lib/polygon":160,"../../lib/throttle":170,"./axes":189,"./constants":194}],206:[function(t,e,r){"use strict";function n(t){return Math.pow(10,t)}var a=t("d3"),i=t("fast-isnumeric"),o=t("../../lib"),l=o.cleanNumber,s=o.ms2DateTime,c=o.dateTime2ms,u=o.ensureNumber,f=t("../../constants/numerical"),d=f.FP_SAFE,p=f.BADNUM,h=t("./constants"),g=t("./axis_ids");e.exports=function(t,e){function r(e,r){if(e>0)return Math.log(e)/Math.LN10;if(e<=0&&r&&t.range&&2===t.range.length){var n=t.range[0],a=t.range[1];return.5*(n+a-3*k*Math.abs(n-a))}return p}function f(e,r,n){var a=c(e,n||t.calendar);if(a===p){if(!i(e))return p;a=c(new Date(+e))}return a}function v(e,r,n){return s(e,r,n||t.calendar)}function y(e){return t._categories[Math.round(e)]}function m(e){if(null!==e&&void 0!==e){if(void 0===t._categoriesMap&&(t._categoriesMap={}),void 0!==t._categoriesMap[e])return t._categoriesMap[e];t._categories.push(e);var r=t._categories.length-1;return t._categoriesMap[e]=r,r}return p}function x(e){if(t._categoriesMap){var r=t._categoriesMap[e];if(void 0!==r)return r}if(i(e))return+e}function b(e){return i(e)?a.round(t._b+t._m*e,2):p}function _(e){return(e-t._b)/t._m}e=e||{};var w=(t._id||"x").charAt(0),k=10;t.c2l="log"===t.type?r:u,t.l2c="log"===t.type?n:u,t.l2p=b,t.p2l=_,t.c2p="log"===t.type?function(t,e){return b(r(t,e))}:b,t.p2c="log"===t.type?function(t){return n(_(t))}:_,-1!==["linear","-"].indexOf(t.type)?(t.d2r=t.r2d=t.d2c=t.r2c=t.d2l=t.r2l=l,t.c2d=t.c2r=t.l2d=t.l2r=u,t.d2p=t.r2p=function(e){return t.l2p(l(e))},t.p2d=t.p2r=_,t.cleanPos=u):"log"===t.type?(t.d2r=t.d2l=function(t,e){return r(l(t),e)},t.r2d=t.r2c=function(t){return n(l(t))},t.d2c=t.r2l=l,t.c2d=t.l2r=u,t.c2r=r,t.l2d=n,t.d2p=function(e,r){return t.l2p(t.d2r(e,r))},t.p2d=function(t){return n(_(t))},t.r2p=function(e){return t.l2p(l(e))},t.p2r=_,t.cleanPos=u):"date"===t.type?(t.d2r=t.r2d=o.identity,t.d2c=t.r2c=t.d2l=t.r2l=f,t.c2d=t.c2r=t.l2d=t.l2r=v,t.d2p=t.r2p=function(e,r,n){return t.l2p(f(e,0,n))},t.p2d=t.p2r=function(t,e,r){return v(_(t),e,r)},t.cleanPos=function(e){return o.cleanDate(e,p,t.calendar)}):"category"===t.type&&(t.d2c=t.d2l=m,t.r2d=t.c2d=t.l2d=y,t.d2r=t.d2l_noadd=x,t.r2c=function(e){var r=x(e);return void 0!==r?r:t.fraction2r(.5)},t.l2r=t.c2r=u,t.r2l=x,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return y(_(t))},t.r2p=t.d2p,t.p2r=_,t.cleanPos=function(t){return"string"==typeof t&&""!==t?t:u(t)}),t.fraction2r=function(e){var r=t.r2l(t.range[0]),n=t.r2l(t.range[1]);return t.l2r(r+e*(n-r))},t.r2fraction=function(e){var r=t.r2l(t.range[0]),n=t.r2l(t.range[1]);return(t.r2l(e)-r)/(n-r)},t.cleanRange=function(e){e||(e="range");var r,n,a=o.nestedProperty(t,e).get();if(n="date"===t.type?o.dfltRange(t.calendar):"y"===w?h.DFLTRANGEY:h.DFLTRANGEX,n=n.slice(),!a||2!==a.length)return void o.nestedProperty(t,e).set(n);for("date"===t.type&&(a[0]=o.cleanDate(a[0],p,t.calendar),a[1]=o.cleanDate(a[1],p,t.calendar)),r=0;r<2;r++)if("date"===t.type){if(!o.isDateTime(a[r],t.calendar)){t[e]=n;break}if(t.r2l(a[0])===t.r2l(a[1])){var l=o.constrain(t.r2l(a[0]),o.MIN_MS+1e3,o.MAX_MS-1e3);a[0]=t.l2r(l-1e3),a[1]=t.l2r(l+1e3);break}}else{if(!i(a[r])){if(!i(a[1-r])){t[e]=n;break}a[r]=a[1-r]*(r?10:.1)}if(a[r]<-d?a[r]=-d:a[r]>d&&(a[r]=d),a[0]===a[1]){var s=Math.max(1,Math.abs(1e-6*a[0]));a[0]-=s,a[1]+=s}}},t.setScale=function(r){var n=e._size;if(t._categories||(t._categories=[]),t._categoriesMap||(t._categoriesMap={}),t.overlaying){var a=g.getFromId({_fullLayout:e},t.overlaying);t.domain=a.domain}var i=r&&t._r?"_r":"range",l=t.calendar;t.cleanRange(i);var s=t.r2l(t[i][0],l),c=t.r2l(t[i][1],l);if("y"===w?(t._offset=n.t+(1-t.domain[1])*n.h,t._length=n.h*(t.domain[1]-t.domain[0]),t._m=t._length/(s-c),t._b=-t._m*c):(t._offset=n.l+t.domain[0]*n.w,t._length=n.w*(t.domain[1]-t.domain[0]),t._m=t._length/(c-s),t._b=-t._m*s),!isFinite(t._m)||!isFinite(t._b))throw o.notifier("Something went wrong with axis scaling","long"),e._replotting=!1,new Error("axis scaling")},t.makeCalcdata=function(e,r){var n,a,i,o="date"===t.type&&e[r+"calendar"];if(r in e)for(n=e[r],a=new Array(n.length),i=0;i<n.length;i++)a[i]=t.d2c(n[i],0,o);else{var l=r+"0"in e?t.d2c(e[r+"0"],0,o):0,s=e["d"+r]?Number(e["d"+r]):1;for(n=e[{x:"y",y:"x"}[r]],a=new Array(n.length),i=0;i<n.length;i++)a[i]=l+i*s}return a},t.isValidRange=function(e){return Array.isArray(e)&&2===e.length&&i(t.r2l(e[0]))&&i(t.r2l(e[1]))},t.isPtWithinRange="x"===w?function(e){var r=e.x;return r>=t.range[0]&&r<=t.range[1]}:function(e){var r=e.y;return r>=t.range[0]&&r<=t.range[1]},t._min=[],t._max=[],t._separators=e.separators,delete t._minDtick,delete t._forceTick0}},{"../../constants/numerical":133,"../../lib":149,"./axis_ids":192,"./constants":194,d3:7,"fast-isnumeric":10}],207:[function(t,e,r){"use strict";function n(t){var e=["showexponent","showtickprefix","showticksuffix"],r=e.filter(function(e){return void 0!==t[e]}),n=function(e){return t[e]===t[r[0]]};if(r.every(n)||1===r.length)return t[r[0]]}var a=t("../../lib");e.exports=function(t,e,r,i,o){var l=n(t);if(r("tickprefix")&&r("showtickprefix",l),r("ticksuffix")&&r("showticksuffix",l),r("showticklabels")){var s=o.font||{},c=e.color===t.color?e.color:s.color;a.coerceFont(r,"tickfont",{family:s.family,size:s.size,color:c}),r("tickangle"),"category"!==i&&(r("tickformat")||"date"===i||(r("showexponent",l),r("exponentformat"),r("separatethousands")))}"category"===i||o.noHover||r("hoverformat")}},{"../../lib":149}],208:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./layout_attributes");e.exports=function(t,e,r,i){var o=n.coerce2(t,e,a,"ticklen"),l=n.coerce2(t,e,a,"tickwidth"),s=n.coerce2(t,e,a,"tickcolor",e.color);r("ticks",i.outerTicks||o||l||s?"outside":"")||(delete e.ticklen,delete e.tickwidth,delete e.tickcolor)}},{"../../lib":149,"./layout_attributes":200}],209:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib"),i=t("../../constants/numerical").ONEDAY;e.exports=function(t,e,r,o){var l="auto";"array"!==t.tickmode||"log"!==o&&"date"!==o||(t.tickmode="auto"),Array.isArray(t.tickvals)?l="array":t.dtick&&(l="linear");var s=r("tickmode",l);if("auto"===s)r("nticks");else if("linear"===s){var c="date"===o?i:1,u=r("dtick",c);if(n(u))e.dtick=u>0?Number(u):c;else if("string"!=typeof u)e.dtick=c;else{var f=u.charAt(0),d=u.substr(1);d=n(d)?Number(d):0,(d<=0||!("date"===o&&"M"===f&&d===Math.round(d)||"log"===o&&"L"===f||"log"===o&&"D"===f&&(1===d||2===d)))&&(e.dtick=c)}var p="date"===o?a.dateTick0(e.calendar):0,h=r("tick0",p);"date"===o?e.tick0=a.cleanDate(h,p):n(h)&&"D1"!==u&&"D2"!==u?e.tick0=Number(h):e.tick0=p}else{var g=r("tickvals");void 0===g?e.tickmode="auto":r("ticktext")}}},{"../../constants/numerical":133,"../../lib":149,"fast-isnumeric":10}],210:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../plotly"),i=t("../../registry"),o=t("../../components/drawing"),l=t("./axes"),s=t("./constants").attrRegex;e.exports=function(t,e,r,c){function u(e,r){function n(e,r,n){for(a=0;a<e.length;a++){var i=e[a];if(-1===o.indexOf(i.xref)&&-1===o.indexOf(i.yref)||r(t,a),n)return}}var a,o=[];for(o=[e._id,r._id],a=0;a<o.length;a++)l.doTicks(t,o[a],!0);n(v.annotations||[],i.getComponentMethod("annotations","drawOne")),n(v.shapes||[],i.getComponentMethod("shapes","drawOne")),n(v.images||[],i.getComponentMethod("images","draw"),!0)}function f(t){var e=t.xaxis,r=t.yaxis;v._defs.select("#"+t.clipId+"> rect").call(o.setTranslate,0,0).call(o.setScale,1,1),t.plot.call(o.setTranslate,e._offset,r._offset).call(o.setScale,1,1);var n=t.plot.select(".scatterlayer").selectAll(".points");n.selectAll(".point").call(o.setPointGroupScale,1,1).call(o.hideOutsideRangePoints,t),n.selectAll(".textpoint").call(o.setTextPointsScale,1,1).call(o.hideOutsideRangePoints,t)}function d(e,r){var n,a,i,l=m[e.xaxis._id],s=m[e.yaxis._id],c=[];if(l){n=t._fullLayout[l.axisName],a=n._r,i=l.to,c[0]=(a[0]*(1-r)+r*i[0]-a[0])/(a[1]-a[0])*e.xaxis._length;var f=a[1]-a[0],d=i[1]-i[0];n.range[0]=a[0]*(1-r)+r*i[0],n.range[1]=a[1]*(1-r)+r*i[1],c[2]=e.xaxis._length*(1-r+r*d/f)}else c[0]=0,c[2]=e.xaxis._length;if(s){n=t._fullLayout[s.axisName],a=n._r,i=s.to,c[1]=(a[1]*(1-r)+r*i[1]-a[1])/(a[0]-a[1])*e.yaxis._length;var p=a[1]-a[0],h=i[1]-i[0];n.range[0]=a[0]*(1-r)+r*i[0],n.range[1]=a[1]*(1-r)+r*i[1],c[3]=e.yaxis._length*(1-r+r*h/p)}else c[1]=0,c[3]=e.yaxis._length;u(e.xaxis,e.yaxis);var g=e.xaxis,y=e.yaxis,x=!!l,b=!!s,_=x?g._length/c[2]:1,w=b?y._length/c[3]:1,k=x?c[0]:0,M=b?c[1]:0,A=x?c[0]/c[2]*g._length:0,T=b?c[1]/c[3]*y._length:0,L=g._offset-A,C=y._offset-T;v._defs.select("#"+e.clipId+"> rect").call(o.setTranslate,k,M).call(o.setScale,1/_,1/w),e.plot.call(o.setTranslate,L,C).call(o.setScale,_,w).selectAll(".points").selectAll(".point").call(o.setPointGroupScale,1/_,1/w),e.plot.selectAll(".points").selectAll(".textpoint").call(o.setTextPointsScale,1/_,1/w)}function p(){for(var e={},r=0;r<x.length;r++){var n=t._fullLayout[m[x[r]].axisName],i=m[x[r]].to;e[n._name+".range[0]"]=i[0],e[n._name+".range[1]"]=i[1],n.range=i.slice()}return _&&_(),a.relayout(t,e).then(function(){for(var t=0;t<b.length;t++)f(b[t])})}function h(){for(var e={},r=0;r<x.length;r++){var n=t._fullLayout[x[r]+"axis"];e[n._name+".range[0]"]=n.range[0],e[n._name+".range[1]"]=n.range[1],n.range=n._r.slice()}return a.relayout(t,e).then(function(){for(var t=0;t<b.length;t++)f(b[t])})}function g(){k=Date.now();for(var t=Math.min(1,(k-w)/r.duration),e=A(t),n=0;n<b.length;n++)d(b[n],e);k-w>r.duration?(p(),M=window.cancelAnimationFrame(g)):M=window.requestAnimationFrame(g)}var v=t._fullLayout,y=[],m=function(t){var e,r,n,a,i={};for(e in t)if(r=e.split("."),r[0].match(s)){var o=e.charAt(0),l=r[0];if(n=v[l],a={},Array.isArray(t[e])?a.to=t[e].slice(0):Array.isArray(t[e].range)&&(a.to=t[e].range.slice(0)),!a.to)continue;a.axisName=l,a.length=n._length,y.push(o),i[o]=a}return i}(e),x=Object.keys(m),b=function(t,e,r){var n,a,i,o=t._plots,l=[];for(n in o){var s=o[n];if(-1===l.indexOf(s)){var c=s.xaxis._id,u=s.yaxis._id,f=s.xaxis.range,d=s.yaxis.range;s.xaxis._r=s.xaxis.range.slice(),s.yaxis._r=s.yaxis.range.slice(),a=r[c]?r[c].to:f,i=r[u]?r[u].to:d,f[0]===a[0]&&f[1]===a[1]&&d[0]===i[0]&&d[1]===i[1]||-1===e.indexOf(c)&&-1===e.indexOf(u)||l.push(s)}}return l}(v,x,m);if(!b.length)return function(){function e(e,r,n){for(var a=0;a<e.length;a++)if(r(t,a),n)return}e(v.annotations||[],i.getComponentMethod("annotations","drawOne")),e(v.shapes||[],i.getComponentMethod("shapes","drawOne")),e(v.images||[],i.getComponentMethod("images","draw"),!0)}(),!1;var _;c&&(_=c());var w,k,M,A=n.ease(r.easing);return t._transitionData._interruptCallbacks.push(function(){return window.cancelAnimationFrame(M),M=null,h()}),w=Date.now(),M=window.requestAnimationFrame(g),Promise.resolve()}},{"../../components/drawing":58,"../../plotly":184,"../../registry":225,"./axes":189,"./constants":194,d3:7}],211:[function(t,e,r){"use strict";function n(t,e){if("-"===t.type){var r=t._id,n=r.charAt(0);-1!==r.indexOf("scene")&&(r=n);var c=a(e,r,n);if(c){if("histogram"===c.type&&n==={v:"y",h:"x"}[c.orientation||"v"])return void(t.type="linear");var u=n+"calendar",f=c[u];if(o(c,n)){for(var d,p=i(c),h=[],g=0;g<e.length;g++)d=e[g],l.traceIs(d,"box")&&(d[n+"axis"]||n)===r&&(void 0!==d[p]?h.push(d[p][0]):void 0!==d.name?h.push(d.name):h.push("text"),d[u]!==f&&(f=void 0));t.type=s(h,f)}else t.type=s(c[n]||[c[n+"0"]],f)}}}function a(t,e,r){for(var n=0;n<t.length;n++){var a=t[n];if((a[r+"axis"]||r)===e){if(o(a,r))return a;if((a[r]||[]).length||a[r+"0"])return a}}}function i(t){return{v:"x",h:"y"}[t.orientation||"v"]}function o(t,e){var r=i(t),n=l.traceIs(t,"box"),a=l.traceIs(t._fullInput||{},"candlestick");return n&&!a&&e===r&&void 0===t[r]&&void 0===t[r+"0"]}var l=t("../../registry"),s=t("./axis_autotype"),c=t("./axis_ids").name2id;e.exports=function(t,e,r,a,i){i&&(e._name=i,e._id=c(i)),"-"===r("type")&&(n(e,a),"-"===e.type?e.type="linear":t.type=e.type)}},{"../../registry":225,"./axis_autotype":190,"./axis_ids":192}],212:[function(t,e,r){"use strict";function n(t,e,r){var n,a,i,o=!1;if("data"===e.type)n=t._fullData[null!==e.traces?e.traces[0]:0];else{if("layout"!==e.type)return!1;n=t._fullLayout}return a=c.nestedProperty(n,e.prop).get(),i=r[e.type]=r[e.type]||{},i.hasOwnProperty(e.prop)&&i[e.prop]!==a&&(o=!0),i[e.prop]=a,{changed:o,value:a}}function a(t,e){return Array.isArray(e[0])&&1===e[0].length&&-1!==["string","number"].indexOf(typeof e[0][0])?[{type:"layout",prop:"_currentFrame",value:e[0][0].toString()}]:[]}function i(t,e){var r=[],n=e[0],a={};if("string"==typeof n)a[n]=e[1];else{if(!c.isPlainObject(n))return r;a=n}return l(a,function(t,e,n){r.push({type:"layout",prop:t,value:n})},"",0),r}function o(t,e){var r,n,a,i,o=[];if(n=e[0],a=e[1],r=e[2],i={},"string"==typeof n)i[n]=a;else{if(!c.isPlainObject(n))return o;i=n,void 0===r&&(r=a)}return void 0===r&&(r=null),l(i,function(e,n,a){var i;if(Array.isArray(a)){var l=Math.min(a.length,t.data.length);r&&(l=Math.min(l,r.length)),i=[];for(var s=0;s<l;s++)i[s]=r?r[s]:s}else i=r?r.slice(0):null;if(null===i)Array.isArray(a)&&(a=a[0]);else if(Array.isArray(i)){if(!Array.isArray(a)){var c=a;a=[];for(var u=0;u<i.length;u++)a[u]=c}a.length=Math.min(i.length,a.length)}o.push({type:"data",prop:e,traces:i,value:a})},"",0),o}function l(t,e,r,n){Object.keys(t).forEach(function(a){var i=t[a];if("_"!==a[0]){var o=r+(n>0?".":"")+a;c.isPlainObject(i)?l(i,e,o,n+1):e(o,a,i)}})}var s=t("../plotly"),c=t("../lib");r.manageCommandObserver=function(t,e,a,i){var o={},l=!0;e&&e._commandObserver&&(o=e._commandObserver),o.cache||(o.cache={}),o.lookupTable={};var s=r.hasSimpleAPICommandBindings(t,a,o.lookupTable);if(e&&e._commandObserver){if(s)return o;if(e._commandObserver.remove)return e._commandObserver.remove(),e._commandObserver=null,o}if(s){n(t,s,o.cache),o.check=function(){if(l){var e=n(t,s,o.cache);return e.changed&&i&&void 0!==o.lookupTable[e.value]&&(o.disable(),Promise.resolve(i({value:e.value,type:s.type,prop:s.prop,traces:s.traces,index:o.lookupTable[e.value]})).then(o.enable,o.enable)),e.changed}};for(var u=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],f=0;f<u.length;f++)t._internalOn(u[f],o.check);o.remove=function(){for(var e=0;e<u.length;e++)t._removeInternalListener(u[e],o.check)}}else c.warn("Unable to automatically bind plot updates to API command"),o.lookupTable={},o.remove=function(){};return o.disable=function(){l=!1},o.enable=function(){l=!0},e&&(e._commandObserver=o),o},r.hasSimpleAPICommandBindings=function(t,e,n){var a,i,o=e.length;for(a=0;a<o;a++){var l,s=e[a],c=s.method,u=s.args;if(Array.isArray(u)||(u=[]),!c)return!1;var f=r.computeAPICommandBindings(t,c,u);if(1!==f.length)return!1;if(i){if(l=f[0],l.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();l=f[0];var p=l.value;if(Array.isArray(p)){if(1!==p.length)return!1;p=p[0]}n&&(n[p]=a)}return i},r.executeAPICommand=function(t,e,r){if("skip"===e)return Promise.resolve();var n=s[e],a=[t];Array.isArray(r)||(r=[]);for(var i=0;i<r.length;i++)a.push(r[i]);return n.apply(null,a).catch(function(t){return c.warn("API call to Plotly."+e+" rejected.",t),Promise.reject(t)})},r.computeAPICommandBindings=function(t,e,r){var n;switch(Array.isArray(r)||(r=[]),e){case"restyle":n=o(t,r);break;case"relayout":n=i(t,r);break;case"update":n=o(t,[r[0],r[2]]).concat(i(t,[r[1]]));break;case"animate":n=a(t,r);break;default:n=[]}return n}},{"../lib":149,"../plotly":184}],213:[function(t,e,r){"use strict";e.exports=function(t){var e=t.editType,r=t.colorEditType;void 0===r&&(r=e);var n={family:{valType:"string",noBlank:!0,strict:!0,editType:e},size:{valType:"number",min:1,editType:e},color:{valType:"color",editType:r},editType:e};return t.arrayOk&&(n.family.arrayOk=!0,n.size.arrayOk=!0,n.color.arrayOk=!0),n}},{}],214:[function(t,e,r){"use strict";e.exports={_isLinkedToArray:"frames_entry",group:{valType:"string"},name:{valType:"string"},traces:{valType:"any"},baseframe:{valType:"string"},data:{valType:"any"},layout:{valType:"any"}}},{}],215:[function(t,e,r){"use strict";function n(t,e){var r,n,a=[0,0,0,0];for(r=0;r<4;++r)for(n=0;n<4;++n)a[n]+=t[4*r+n]*e[r];return a}function a(t,e){return n(t.projection,n(t.view,n(t.model,[e[0],e[1],e[2],1])))}e.exports=a},{}],216:[function(t,e,r){"use strict";var n=t("./font_attributes"),a=t("../components/color/attributes"),i=n({editType:"calc"});i.family.dflt='"Open Sans", verdana, arial, sans-serif',i.size.dflt=12,i.color.dflt=a.defaultLine,e.exports={font:i,title:{valType:"string",dflt:"Click to enter Plot title",editType:"layoutstyle"},titlefont:n({editType:"layoutstyle"}),autosize:{valType:"boolean",dflt:!1,editType:"none"},width:{valType:"number",min:10,dflt:700,editType:"none"},height:{valType:"number",min:10,dflt:450,editType:"none"},margin:{l:{valType:"number",min:0,dflt:80,editType:"calc"},r:{valType:"number",min:0,dflt:80,editType:"calc"},t:{valType:"number",min:0,dflt:100,editType:"calc"},b:{valType:"number",min:0,dflt:80,editType:"calc"},pad:{valType:"number",min:0,dflt:0,editType:"calc"},autoexpand:{valType:"boolean",dflt:!0,editType:"calc"},editType:"calc"},paper_bgcolor:{valType:"color",dflt:a.background,editType:"plot"},plot_bgcolor:{valType:"color",dflt:a.background,editType:"layoutstyle"},separators:{valType:"string",dflt:".,",editType:"plot"},hidesources:{valType:"boolean",dflt:!1,editType:"plot"},smith:{valType:"enumerated",values:[!1],dflt:!1,editType:"none"},showlegend:{valType:"boolean",editType:"legend"}}},{"../components/color/attributes":33, "./font_attributes":213}],217:[function(t,e,r){"use strict";e.exports={t:{valType:"number",dflt:0,editType:"arraydraw"},r:{valType:"number",dflt:0,editType:"arraydraw"},b:{valType:"number",dflt:0,editType:"arraydraw"},l:{valType:"number",dflt:0,editType:"arraydraw"},editType:"arraydraw"}},{}],218:[function(t,e,r){"use strict";function n(t,e){e.text("");var r=e.append("a").attr({"xlink:xlink:href":"#",class:"link--impt link--embedview","font-weight":"bold"}).text(t._context.linkText+" "+String.fromCharCode(187));if(t._context.sendData)r.on("click",function(){v.sendDataToCloud(t)});else{var n=window.location.pathname.split("/"),a=window.location.search;r.attr({"xlink:xlink:show":"new","xlink:xlink:href":"/"+n[2].split(".")[0]+"/"+n[1]+a})}}function a(t,e){var r,n,a=t.trace,i=a._arrayAttrs,o={};for(r=0;r<i.length;r++)n=i[r],o[n]=p.nestedProperty(a,n).get().slice();for(t.trace=e,r=0;r<i.length;r++)n=i[r],p.nestedProperty(t.trace,n).set(o[n])}function i(t,e,r,n){for(var a=t.transforms,i=[t],o=0;o<a.length;o++){var l=a[o],s=_[l.type];s&&s.transform&&(i=s.transform(i,{transform:l,fullTrace:t,fullData:e,layout:r,fullLayout:n,transformIndex:o}))}return i}function o(t){var e,r={left:0,right:0,bottom:0,top:0};if(t)for(e in t)t.hasOwnProperty(e)&&(r.left+=t[e].left||0,r.right+=t[e].right||0,r.bottom+=t[e].bottom||0,r.top+=t[e].top||0);return r}function l(t){for(var e=0;e<t.length;e++){t[e]._categories=t[e]._initialCategories.slice(),t[e]._categoriesMap={};for(var r=0;r<t[e]._categories.length;r++)t[e]._categoriesMap[t[e]._categories[r]]=r}}var s=t("d3"),c=t("fast-isnumeric"),u=t("../plotly"),f=t("../plot_api/plot_schema"),d=t("../registry"),p=t("../lib"),h=t("../components/color"),g=t("../constants/numerical").BADNUM,v=e.exports={},y=t("./animation_attributes"),m=t("./frame_attributes"),x=p.relinkPrivateKeys;p.extendFlat(v,d),v.attributes=t("./attributes"),v.attributes.type.values=v.allTypes,v.fontAttrs=t("./font_attributes"),v.layoutAttributes=t("./layout_attributes"),v.fontWeight="normal";var b=v.subplotsRegistry,_=v.transformsRegistry,w=t("../components/errorbars"),k=t("./command");v.executeAPICommand=k.executeAPICommand,v.computeAPICommandBindings=k.computeAPICommandBindings,v.manageCommandObserver=k.manageCommandObserver,v.hasSimpleAPICommandBindings=k.hasSimpleAPICommandBindings,v.findSubplotIds=function(t,e){var r=[];if(!v.subplotsRegistry[e])return r;for(var n=v.subplotsRegistry[e].attr,a=0;a<t.length;a++){var i=t[a];v.traceIs(i,e)&&-1===r.indexOf(i[n])&&r.push(i[n])}return r},v.getSubplotIds=function(t,e){var r=v.subplotsRegistry[e];if(!r)return[];if(!("cartesian"!==e||t._has&&t._has("cartesian")))return[];if(!("gl2d"!==e||t._has&&t._has("gl2d")))return[];if("cartesian"===e||"gl2d"===e)return Object.keys(t._plots||{});for(var n=r.attrRegex,a=Object.keys(t),i=[],o=0;o<a.length;o++){var l=a[o];n.test(l)&&i.push(l)}var s=r.idRoot.length;return i.sort(function(t,e){return+(t.substr(s)||1)-+(e.substr(s)||1)}),i},v.getSubplotData=function(t,e,r){if(!v.subplotsRegistry[e])return[];for(var n,a=v.subplotsRegistry[e].attr,i=[],o=0;o<t.length;o++)if(n=t[o],"gl2d"===e&&v.traceIs(n,"gl2d")){var l=u.Axes.subplotMatch,s="x"+r.match(l)[1],c="y"+r.match(l)[2];n[a[0]]===s&&n[a[1]]===c&&i.push(n)}else n[a]===r&&i.push(n);return i},v.getSubplotCalcData=function(t,e,r){if(!v.subplotsRegistry[e])return[];for(var n=v.subplotsRegistry[e].attr,a=[],i=0;i<t.length;i++){var o=t[i];o[0].trace[n]===r&&a.push(o)}return a},v.redrawText=function(t){if(!(t.data&&t.data[0]&&t.data[0].r))return new Promise(function(e){setTimeout(function(){d.getComponentMethod("annotations","draw")(t),d.getComponentMethod("legend","draw")(t),(t.calcdata||[]).forEach(function(t){t[0]&&t[0].t&&t[0].t.cb&&t[0].t.cb()}),e(v.previousPromises(t))},300)})},v.resize=function(t){return new Promise(function(e,r){t&&!function(t){var e=window.getComputedStyle(t).display;return!e||"none"===e}(t)||r(new Error("Resize must be passed a displayed plot div element.")),t._redrawTimer&&clearTimeout(t._redrawTimer),t._redrawTimer=setTimeout(function(){if(t.layout.width&&t.layout.height)return void e(t);delete t.layout.width,delete t.layout.height;var r=t.changed;t.autoplay=!0,u.relayout(t,{autosize:!0}).then(function(){t.changed=r,e(t)})},100)})},v.previousPromises=function(t){if((t._promises||[]).length)return Promise.all(t._promises).then(function(){t._promises=[]})},v.addLinks=function(t){if(t._context.showLink||t._context.showSources){var e=t._fullLayout,r=e._paper.selectAll("text.js-plot-link-container").data([0]);r.enter().append("text").classed("js-plot-link-container",!0).style({"font-family":'"Open Sans", Arial, sans-serif',"font-size":"12px",fill:h.defaultLine,"pointer-events":"all"}).each(function(){var t=s.select(this);t.append("tspan").classed("js-link-to-tool",!0),t.append("tspan").classed("js-link-spacer",!0),t.append("tspan").classed("js-sourcelinks",!0)});var a=r.node(),i={y:e._paper.attr("height")-9};document.body.contains(a)&&a.getComputedTextLength()>=e.width-20?(i["text-anchor"]="start",i.x=5):(i["text-anchor"]="end",i.x=e._paper.attr("width")-7),r.attr(i);var o=r.select(".js-link-to-tool"),l=r.select(".js-link-spacer"),c=r.select(".js-sourcelinks");t._context.showSources&&t._context.showSources(t),t._context.showLink&&n(t,o),l.text(o.text()&&c.text()?" - ":"")}},v.sendDataToCloud=function(t){t.emit("plotly_beforeexport");var e=window.PLOTLYENV&&window.PLOTLYENV.BASE_URL||"https://plot.ly",r=s.select(t).append("div").attr("id","hiddenform").style("display","none"),n=r.append("form").attr({action:e+"/external",method:"post",target:"_blank"});return n.append("input").attr({type:"text",name:"data"}).node().value=v.graphJson(t,!1,"keepdata"),n.node().submit(),r.remove(),t.emit("plotly_afterexport"),!1},v.supplyDefaults=function(t){var e,r=t._fullLayout||{},n=t._fullLayout={},i=t.layout||{},o=t._fullData||[],l=t._fullData=[],s=t.data||[];if(t._transitionData||v.createTransitionData(t),r._initialAutoSizeIsDone){var c=r.width,f=r.height;v.supplyLayoutGlobalDefaults(i,n),i.width||(n.width=c),i.height||(n.height=f)}else{v.supplyLayoutGlobalDefaults(i,n);var d=!i.width||!i.height,p=n.autosize,h=t._context&&t._context.autosizable;d&&(p||h)?v.plotAutoSize(t,i,n):d&&v.sanitizeMargins(t),!p&&d&&(i.width=n.width,i.height=n.height)}n._initialAutoSizeIsDone=!0,n._dataLength=s.length,n._globalTransforms=(t._context||{}).globalTransforms,v.supplyDataDefaults(s,l,i,n),n._has=v._hasPlotType.bind(n);var g=n._modules;for(e=0;e<g.length;e++){var y=g[e];y.cleanData&&y.cleanData(l)}if(o.length===s.length)for(e=0;e<l.length;e++)x(l[e],o[e]);v.supplyLayoutModuleDefaults(i,n,l,t._transitionData),n._hasCartesian=n._has("cartesian"),n._hasGeo=n._has("geo"),n._hasGL3D=n._has("gl3d"),n._hasGL2D=n._has("gl2d"),n._hasTernary=n._has("ternary"),n._hasPie=n._has("pie"),v.cleanPlot(l,n,o,r),v.linkSubplots(l,n,o,r),x(n,r),v.doAutoMargin(t);var m=u.Axes.list(t);for(e=0;e<m.length;e++){m[e].setScale()}if((t.calcdata||[]).length===l.length)for(e=0;e<l.length;e++){var b=l[e],_=t.calcdata[e][0];_&&_.trace&&(_.trace._hasCalcTransform?a(_,b):_.trace=b)}},v.createTransitionData=function(t){t._transitionData||(t._transitionData={}),t._transitionData._frames||(t._transitionData._frames=[]),t._transitionData._frameHash||(t._transitionData._frameHash={}),t._transitionData._counter||(t._transitionData._counter=0),t._transitionData._interruptCallbacks||(t._transitionData._interruptCallbacks=[])},v._hasPlotType=function(t){for(var e=this._basePlotModules||[],r=0;r<e.length;r++){if(e[r].name===t)return!0}return!1},v.cleanPlot=function(t,e,r,n){var a,i,o=n._basePlotModules||[];for(a=0;a<o.length;a++){var l=o[a];l.clean&&l.clean(t,e,r,n)}var s=!!n._paper,c=!!n._infolayer;t:for(a=0;a<r.length;a++){var u=r[a],f=u.uid;for(i=0;i<t.length;i++){var d=t[i];if(f===d.uid)continue t}var p=".hm"+f+",.contour"+f+",.carpet"+f+",#clip"+f+",.trace"+f;s&&n._paper.selectAll(p).remove(),c&&(n._infolayer.selectAll(".cb"+f).remove(),n._infolayer.selectAll("g.rangeslider-container").selectAll(p).remove())}n._zoomlayer&&n._zoomlayer.selectAll(".select-outline").remove()},v.linkSubplots=function(t,e,r,n){var a,i=n._plots||{},o=e._plots={},l={_fullData:t,_fullLayout:e},s=u.Axes.getSubplots(l);for(a=0;a<s.length;a++){var c,f=s[a],d=i[f],p=u.Axes.getFromId(l,f,"x"),h=u.Axes.getFromId(l,f,"y");d?(c=o[f]=d,c._scene2d&&c._scene2d.updateRefs(e),c.xaxis.layer!==p.layer&&(c.xlines.attr("d",null),c.xaxislayer.selectAll("*").remove()),c.yaxis.layer!==h.layer&&(c.ylines.attr("d",null),c.yaxislayer.selectAll("*").remove())):(c=o[f]={},c.id=f),c.xaxis=p,c.yaxis=h,c._hasClipOnAxisFalse=!1;for(var g=0;g<t.length;g++){var v=t[g];if(v.xaxis===c.xaxis._id&&v.yaxis===c.yaxis._id&&!1===v.cliponaxis){c._hasClipOnAxisFalse=!0;break}}}var y=u.Axes.list(l,null,!0);for(a=0;a<y.length;a++){var m=y[a],x=null;m.overlaying&&(x=u.Axes.getFromId(l,m.overlaying))&&x.overlaying&&(m.overlaying=!1,x=null),m._mainAxis=x||m,x&&(m.domain=x.domain.slice()),m._anchorAxis="free"===m.anchor?null:u.Axes.getFromId(l,m.anchor)}},v.clearExpandedTraceDefaultColors=function(t){function e(t,e,a,i){n[i]=e,n.length=i+1,"color"===t.valType&&void 0===t.dflt&&r.push(n.join("."))}var r,n,a;for(n=[],r=t._module._colorAttrs,r||(t._module._colorAttrs=r=[],f.crawl(t._module.attributes,e)),a=0;a<r.length;a++){p.nestedProperty(t,"_input."+r[a]).get()||p.nestedProperty(t,r[a]).set(null)}},v.supplyDataDefaults=function(t,e,r,n){function a(t){e.push(t);var r=t._module;r&&(p.pushUnique(c,r),p.pushUnique(u,t._module.basePlotModule),f++)}var o,l,s,c=n._modules=[],u=n._basePlotModules=[],f=0;n._transformModules=[];var h={},g=[];for(o=0;o<t.length;o++){if(s=t[o],l=v.supplyTraceDefaults(s,f,n,o),l.index=o,l._input=s,l._expandedIndex=f,l.transforms&&l.transforms.length)for(var y=i(l,e,r,n),m=0;m<y.length;m++){var b=y[m],_=v.supplyTraceDefaults(b,f,n,o);x(_,b),b.uid=_.uid=l.uid+m,_.index=o,_._input=s,_._fullInput=l,_._expandedIndex=f,_._expandedInput=b,a(_)}else l._fullInput=l,l._expandedInput=l,a(l);d.traceIs(l,"carpetAxis")&&(h[l.carpet]=l),d.traceIs(l,"carpetDependent")&&g.push(o)}for(o=0;o<g.length;o++)if(l=e[g[o]],l.visible){var w=h[l.carpet];l._carpet=w,w&&w.visible?(l.xaxis=w.xaxis,l.yaxis=w.yaxis):l.visible=!1}},v.supplyAnimationDefaults=function(t){function e(e,r){return p.coerce(t||{},n,y,e,r)}t=t||{};var r,n={};if(e("mode"),e("direction"),e("fromcurrent"),Array.isArray(t.frame))for(n.frame=[],r=0;r<t.frame.length;r++)n.frame[r]=v.supplyAnimationFrameDefaults(t.frame[r]||{});else n.frame=v.supplyAnimationFrameDefaults(t.frame||{});if(Array.isArray(t.transition))for(n.transition=[],r=0;r<t.transition.length;r++)n.transition[r]=v.supplyAnimationTransitionDefaults(t.transition[r]||{});else n.transition=v.supplyAnimationTransitionDefaults(t.transition||{});return n},v.supplyAnimationFrameDefaults=function(t){function e(e,n){return p.coerce(t||{},r,y.frame,e,n)}var r={};return e("duration"),e("redraw"),r},v.supplyAnimationTransitionDefaults=function(t){function e(e,n){return p.coerce(t||{},r,y.transition,e,n)}var r={};return e("duration"),e("easing"),r},v.supplyFrameDefaults=function(t){function e(e,n){return p.coerce(t,r,m,e,n)}var r={};return e("group"),e("name"),e("traces"),e("baseframe"),e("data"),e("layout"),r},v.supplyTraceDefaults=function(t,e,r,n){function a(e,r){return p.coerce(t,o,v.attributes,e,r)}function i(e,r){if(v.traceIs(o,e))return p.coerce(t,o,v.subplotsRegistry[e].attributes,r)}var o={},l=h.defaults[e%h.defaults.length],s=a("visible");a("type"),a("uid"),a("name","trace "+n);for(var c=Object.keys(b),u=0;u<c.length;u++){var f=c[u];if(-1===["cartesian","gl2d"].indexOf(f)){var g=b[f].attr;g&&i(f,g)}}if(s){a("customdata"),a("ids");var y=v.getModule(o);o._module=y,v.traceIs(o,"showLegend")&&(a("showlegend"),a("legendgroup")),d.getComponentMethod("fx","supplyDefaults")(t,o,l,r),y&&(y.supplyDefaults(t,o,l,r),p.coerceHoverinfo(t,o,r)),v.traceIs(o,"noOpacity")||a("opacity"),i("cartesian","xaxis"),i("cartesian","yaxis"),i("gl2d","xaxis"),i("gl2d","yaxis"),v.traceIs(o,"notLegendIsolatable")&&(o.visible=!!o.visible),v.supplyTransformDefaults(t,o,r)}return o},v.supplyTransformDefaults=function(t,e,r){var n=r._globalTransforms||[],a=r._transformModules||[];if(Array.isArray(t.transforms)||0!==n.length)for(var i=t.transforms||[],o=n.concat(i),l=e.transforms=[],s=0;s<o.length;s++){var c,u=o[s],f=u.type,d=_[f],h=!(u._module&&u._module===d),g=d&&"function"==typeof d.transform;d||p.warn("Unrecognized transform type "+f+"."),d&&d.supplyDefaults&&(h||g)?(c=d.supplyDefaults(u,e,r,t),c.type=f,c._module=d,p.pushUnique(a,d)):c=p.extendFlat({},u),l.push(c)}},v.supplyLayoutGlobalDefaults=function(t,e){function r(r,n){return p.coerce(t,e,v.layoutAttributes,r,n)}var n=p.coerceFont(r,"font");r("title"),p.coerceFont(r,"titlefont",{family:n.family,size:Math.round(1.4*n.size),color:n.color}),r("autosize",!(t.width&&t.height)),r("width"),r("height"),r("margin.l"),r("margin.r"),r("margin.t"),r("margin.b"),r("margin.pad"),r("margin.autoexpand"),t.width&&t.height&&v.sanitizeMargins(e),r("paper_bgcolor"),r("separators"),r("hidesources"),r("smith"),d.getComponentMethod("calendars","handleDefaults")(t,e,"calendar"),d.getComponentMethod("fx","supplyLayoutGlobalDefaults")(t,e,r)},v.plotAutoSize=function(t,e,r){var n,a,i=t._context||{},l=i.frameMargins,s=p.isPlotDiv(t);if(s&&t.emit("plotly_autosize"),i.fillFrame)n=window.innerWidth,a=window.innerHeight,document.body.style.overflow="hidden";else if(c(l)&&l>0){var u=o(t._boundingBoxMargins),f=u.left+u.right,d=u.bottom+u.top,h=1-2*l,g=r._container&&r._container.node?r._container.node().getBoundingClientRect():{width:r.width,height:r.height};n=Math.round(h*(g.width-f)),a=Math.round(h*(g.height-d))}else{var y=s?window.getComputedStyle(t):{};n=parseFloat(y.width)||r.width,a=parseFloat(y.height)||r.height}var m=v.layoutAttributes.width.min,x=v.layoutAttributes.height.min;n<m&&(n=m),a<x&&(a=x);var b=!e.width&&Math.abs(r.width-n)>1,_=!e.height&&Math.abs(r.height-a)>1;(_||b)&&(b&&(r.width=n),_&&(r.height=a)),t._initialAutoSize||(t._initialAutoSize={width:n,height:a}),v.sanitizeMargins(r)},v.supplyLayoutModuleDefaults=function(t,e,r,n){var a,i;u.Axes.supplyLayoutDefaults(t,e,r);var o=e._basePlotModules;for(a=0;a<o.length;a++)i=o[a],"cartesian"!==i.name&&i.supplyLayoutDefaults&&i.supplyLayoutDefaults(t,e,r);var l=e._modules;for(a=0;a<l.length;a++)i=l[a],i.supplyLayoutDefaults&&i.supplyLayoutDefaults(t,e,r);var s=e._transformModules;for(a=0;a<s.length;a++)i=s[a],i.supplyLayoutDefaults&&i.supplyLayoutDefaults(t,e,r,n);var c=Object.keys(d.componentsRegistry);for(a=0;a<c.length;a++)i=d.componentsRegistry[c[a]],i.supplyLayoutDefaults&&i.supplyLayoutDefaults(t,e,r)},v.purge=function(t){var e=t._fullLayout||{};void 0!==e._glcontainer&&e._glcontainer.remove(),void 0!==e._geocontainer&&e._geocontainer.remove(),e._modeBar&&e._modeBar.destroy(),t._transitionData&&(t._transitionData._interruptCallbacks&&(t._transitionData._interruptCallbacks.length=0),t._transitionData._animationRaf&&window.cancelAnimationFrame(t._transitionData._animationRaf)),delete t.data,delete t.layout,delete t._fullData,delete t._fullLayout,delete t.calcdata,delete t.framework,delete t.empty,delete t.fid,delete t.undoqueue,delete t.undonum,delete t.autoplay,delete t.changed,delete t._promises,delete t._redrawTimer,delete t.firstscatter,delete t._hmlumcount,delete t._hmpixcount,delete t.numboxes,delete t._transitionData,delete t._transitioning,delete t._initialAutoSize,delete t._transitioningWithDuration,delete t._dragging,delete t._dragged,delete t._hoverdata,delete t._snapshotInProgress,delete t._editing,delete t._replotPending,delete t._mouseDownTime,delete t._legendMouseDownTime,t.removeAllListeners&&t.removeAllListeners()},v.style=function(t){for(var e=t._fullLayout._modules,r=0;r<e.length;r++){var n=e[r];n.style&&n.style(t)}},v.sanitizeMargins=function(t){if(t&&t.margin){var e,r=t.width,n=t.height,a=t.margin,i=r-(a.l+a.r),o=n-(a.t+a.b);i<0&&(e=(r-1)/(a.l+a.r),a.l=Math.floor(e*a.l),a.r=Math.floor(e*a.r)),o<0&&(e=(n-1)/(a.t+a.b),a.t=Math.floor(e*a.t),a.b=Math.floor(e*a.b))}},v.autoMargin=function(t,e,r){var n=t._fullLayout;if(n._pushmargin||(n._pushmargin={}),!1!==n.margin.autoexpand){if(r){var a=void 0===r.pad?12:r.pad;r.l+r.r>.5*n.width&&(r.l=r.r=0),r.b+r.t>.5*n.height&&(r.b=r.t=0),n._pushmargin[e]={l:{val:r.x,size:r.l+a},r:{val:r.x,size:r.r+a},b:{val:r.y,size:r.b+a},t:{val:r.y,size:r.t+a}}}else delete n._pushmargin[e];n._replotting||v.doAutoMargin(t)}},v.doAutoMargin=function(t){var e=t._fullLayout;e._size||(e._size={}),e._pushmargin||(e._pushmargin={});var r=e._size,n=JSON.stringify(r),a=Math.max(e.margin.l||0,0),i=Math.max(e.margin.r||0,0),o=Math.max(e.margin.t||0,0),l=Math.max(e.margin.b||0,0),s=e._pushmargin;if(!1!==e.margin.autoexpand){s.base={l:{val:0,size:a},r:{val:1,size:i},t:{val:1,size:o},b:{val:0,size:l}};for(var f=Object.keys(s),d=0;d<f.length;d++)for(var p=f[d],h=s[p].l||{},g=s[p].b||{},v=h.val,y=h.size,m=g.val,x=g.size,b=0;b<f.length;b++){var _=f[b];if(c(y)&&s[_].r){var w=s[_].r.val,k=s[_].r.size;if(w>v){var M=(y*w+(k-e.width)*v)/(w-v),A=(k*(1-v)+(y-e.width)*(1-w))/(w-v);M>=0&&A>=0&&M+A>a+i&&(a=M,i=A)}}if(c(x)&&s[_].t){var T=s[_].t.val,L=s[_].t.size;if(T>m){var C=(x*T+(L-e.height)*m)/(T-m),S=(L*(1-m)+(x-e.height)*(1-T))/(T-m);C>=0&&S>=0&&C+S>l+o&&(l=C,o=S)}}}}if(r.l=Math.round(a),r.r=Math.round(i),r.t=Math.round(o),r.b=Math.round(l),r.p=Math.round(e.margin.pad),r.w=Math.round(e.width)-r.l-r.r,r.h=Math.round(e.height)-r.t-r.b,!e._replotting&&"{}"!==n&&n!==JSON.stringify(e._size))return u.plot(t)},v.graphJson=function(t,e,r,n,a){function i(t){if("function"==typeof t)return null;if(p.isPlainObject(t)){var e,n,a={};for(e in t)if("function"!=typeof t[e]&&-1===["_","["].indexOf(e.charAt(0))){if("keepdata"===r){if("src"===e.substr(e.length-3))continue}else if("keepstream"===r){if("string"==typeof(n=t[e+"src"])&&n.indexOf(":")>0&&!p.isPlainObject(t.stream))continue}else if("keepall"!==r&&"string"==typeof(n=t[e+"src"])&&n.indexOf(":")>0)continue;a[e]=i(t[e])}return a}return Array.isArray(t)?t.map(i):p.isJSDate(t)?p.ms2DateTimeLocal(+t):t}(a&&e&&!t._fullData||a&&!e&&!t._fullLayout)&&v.supplyDefaults(t);var o=a?t._fullData:t.data,l=a?t._fullLayout:t.layout,s=(t._transitionData||{})._frames,c={data:(o||[]).map(function(t){var r=i(t);return e&&delete r.fit,r})};return e||(c.layout=i(l)),t.framework&&t.framework.isPolar&&(c=t.framework.getConfig()),s&&(c.frames=i(s)),"object"===n?c:JSON.stringify(c)},v.modifyFrames=function(t,e){var r,n,a,i=t._transitionData._frames,o=t._transitionData._frameHash;for(r=0;r<e.length;r++)switch(n=e[r],n.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":a=n.value,o[a.name]=a,i.splice(n.index,0,a);break;case"delete":a=i[n.index],delete o[a.name],i.splice(n.index,1)}return Promise.resolve()},v.computeFrame=function(t,e){var r,n,a,i,o=t._transitionData._frameHash;if(!e)throw new Error("computeFrame must be given a string frame name");var l=o[e.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=v.extendLayout(u.layout,l.layout)),l.data){if(u.data||(u.data=[]),!(n=l.traces))for(n=[],r=0;r<l.data.length;r++)n[r]=r;for(u.traces||(u.traces=[]),r=0;r<l.data.length;r++)void 0!==(a=n[r])&&null!==a&&(i=u.traces.indexOf(a),-1===i&&(i=u.data.length,u.traces[i]=a),u.data[i]=v.extendTrace(u.data[i],l.data[r]))}return u},v.recomputeFrameHash=function(t){for(var e=t._transitionData._frameHash={},r=t._transitionData._frames,n=0;n<r.length;n++){var a=r[n];a&&a.name&&(e[a.name]=a)}},v.extendObjectWithContainers=function(t,e,r){var n,a,i,o,l,s,c,u,f=p.extendDeepNoArrays({},e||{}),d=p.expandObjectPaths(f),h={};if(r&&r.length)for(i=0;i<r.length;i++)n=p.nestedProperty(d,r[i]),a=n.get(),void 0===a?p.nestedProperty(h,r[i]).set(null):(n.set(null),p.nestedProperty(h,r[i]).set(a));if(t=p.extendDeepNoArrays(t||{},d),r&&r.length)for(i=0;i<r.length;i++)if(l=p.nestedProperty(h,r[i]),c=l.get()){for(s=p.nestedProperty(t,r[i]),u=s.get(),Array.isArray(u)||(u=[],s.set(u)),o=0;o<c.length;o++){var g=c[o];u[o]=null===g?null:v.extendObjectWithContainers(u[o],g)}s.set(u)}return t},v.dataArrayContainers=["transforms"],v.layoutArrayContainers=d.layoutArrayContainers,v.extendTrace=function(t,e){return v.extendObjectWithContainers(t,e,v.dataArrayContainers)},v.extendLayout=function(t,e){return v.extendObjectWithContainers(t,e,v.layoutArrayContainers)},v.transition=function(t,e,r,n,a,i){function o(){var n;for(n=0;n<m.length;n++){var a=m[n],i=t._fullData[a],o=i._module;o&&(o.animatable&&x.push(a),t.data[m[n]]=v.extendTrace(t.data[m[n]],e[n]))}var l=p.expandObjectPaths(p.extendDeepNoArrays({},r)),s=/^[xy]axis[0-9]*$/;for(var c in l)s.test(c)&&delete l[c].range;return v.extendLayout(t.layout,l),delete t.calcdata,v.supplyDefaults(t),v.doCalcdata(t),w.calc(t),Promise.resolve()}function l(t){var e=Promise.resolve();if(!t)return e;for(;t.length;)e=e.then(t.shift());return e}function s(t){if(t)for(;t.length;)t.shift()}function c(){return t.emit("plotly_transitioning",[]),new Promise(function(e){function n(){return s++,function(){c++,b||c!==s||f(e)}}t._transitioning=!0,i.duration>0&&(t._transitioningWithDuration=!0),t._transitionData._interruptCallbacks.push(function(){b=!0}),a.redraw&&t._transitionData._interruptCallbacks.push(function(){return u.redraw(t)}),t._transitionData._interruptCallbacks.push(function(){t.emit("plotly_transitioninterrupted",[])});var o,l,s=0,c=0,d=t._fullLayout._basePlotModules,h=!1;if(r)for(l=0;l<d.length;l++)if(d[l].transitionAxes){var g=p.expandObjectPaths(r);h=d[l].transitionAxes(t,g,i,n)||h}for(h?(o=p.extendFlat({},i),o.duration=0):o=i,l=0;l<d.length;l++)d[l].plot(t,x,o,n);setTimeout(n())})}function f(e){if(t._transitionData)return s(t._transitionData._interruptCallbacks),Promise.resolve().then(function(){if(a.redraw)return u.redraw(t)}).then(function(){t._transitioning=!1,t._transitioningWithDuration=!1,t.emit("plotly_transitioned",[])}).then(e)}function d(){if(t._transitionData)return t._transitioning=!1,l(t._transitionData._interruptCallbacks)}var h,g,y=Array.isArray(e)?e.length:0,m=n.slice(0,y),x=[],b=!1;for(h=0;h<m.length;h++){g=m[h];var _=t._fullData[g],k=_._module;if(k&&!k.animatable){var M={};for(var A in e[h])M[A]=[e[h][A]]}}var T=[v.previousPromises,d,o,v.rehover,c],L=p.syncOrAsync(T,t);return L&&L.then||(L=Promise.resolve()),L.then(function(){return t})},v.doCalcdata=function(t,e){var r,n,a,i,o=u.Axes.list(t),s=t._fullData,c=t._fullLayout,p=new Array(s.length),h=(t.calcdata||[]).slice(0);for(t.calcdata=p,t.firstscatter=!0,t.numboxes=0,t._hmpixcount=0,t._hmlumcount=0,c._piecolormap={},c._piedefaultcolorcount=0,a=0;a<s.length;a++)Array.isArray(e)&&-1===e.indexOf(a)&&(p[a]=h[a]);for(a=0;a<s.length;a++)r=s[a],r._arrayAttrs=f.findArrayAttributes(r);l(o);var v=!1;for(a=0;a<s.length;a++)if(r=s[a],!0===r.visible&&r.transforms)for(n=r._module,n&&n.calc&&n.calc(t,r),i=0;i<r.transforms.length;i++){var y=r.transforms[i];n=_[y.type],n&&n.calcTransform&&(r._hasCalcTransform=!0,v=!0,n.calcTransform(t,r,y))}if(v){for(a=0;a<o.length;a++)o[a]._min=[],o[a]._max=[],o[a]._categories=[],o[a]._categoriesMap={};l(o)}for(a=0;a<s.length;a++){var m=[];r=s[a],!0===r.visible&&(n=r._module)&&n.calc&&(m=n.calc(t,r)),Array.isArray(m)&&m[0]||(m=[{x:g,y:g}]),m[0].t||(m[0].t={}),m[0].trace=r,p[a]=m}d.getComponentMethod("fx","calc")(t)},v.rehover=function(t){t._fullLayout._rehover&&t._fullLayout._rehover()},v.generalUpdatePerTraceModule=function(t,e,r){var n,a=t.traceHash,i={};for(n=0;n<e.length;n++){var o=e[n],l=o[0].trace;l.visible&&(i[l.type]=i[l.type]||[],i[l.type].push(o))}var s=Object.keys(a),c=Object.keys(i);for(n=0;n<s.length;n++){var u=s[n];if(-1===c.indexOf(u)){var f=a[u][0];f[0].trace.visible=!1,i[u]=[f]}}for(c=Object.keys(i),n=0;n<c.length;n++){var d=i[c[n]];d[0][0].trace._module.plot(t,function(t){for(var e=[],r=0;r<t.length;r++){var n=t[r];!0===n[0].trace.visible&&e.push(n)}return e}(d),r)}t.traceHash=i}},{"../components/color":34,"../components/errorbars":64,"../constants/numerical":133,"../lib":149,"../plot_api/plot_schema":178,"../plotly":184,"../registry":225,"./animation_attributes":185,"./attributes":187,"./command":212,"./font_attributes":213,"./frame_attributes":214,"./layout_attributes":216,d3:7,"fast-isnumeric":10}],219:[function(t,e,r){"use strict";var n=t("../../traces/scatter/attributes"),a=n.marker;e.exports={r:n.r,t:n.t,marker:{color:a.color,size:a.size,symbol:a.symbol,opacity:a.opacity,editType:"calc"}}},{"../../traces/scatter/attributes":260}],220:[function(t,e,r){"use strict";function n(t,e){return i({},e,{showline:{valType:"boolean"},showticklabels:{valType:"boolean"},tickorientation:{valType:"enumerated",values:["horizontal","vertical"]},ticklen:{valType:"number",min:0},tickcolor:{valType:"color"},ticksuffix:{valType:"string"},endpadding:{valType:"number"},visible:{valType:"boolean"}})}var a=t("../cartesian/layout_attributes"),i=t("../../lib/extend").extendFlat,o=t("../../plot_api/edit_types").overrideAll,l=i({},a.domain,{});e.exports=o({radialaxis:n("radial",{range:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},domain:l,orientation:{valType:"number"}}),angularaxis:n("angular",{range:{valType:"info_array",items:[{valType:"number",dflt:0},{valType:"number",dflt:360}]},domain:l}),layout:{direction:{valType:"enumerated",values:["clockwise","counterclockwise"]},orientation:{valType:"angle"}}},"plot","nested")},{"../../lib/extend":143,"../../plot_api/edit_types":173,"../cartesian/layout_attributes":200}],221:[function(t,e,r){"use strict";(e.exports=t("./micropolar")).manager=t("./micropolar_manager")},{"./micropolar":222,"./micropolar_manager":223}],222:[function(t,e,r){var n=t("d3"),a=t("../../lib"),i=a.extendDeepAll,o=t("../../constants/alignment").MID_SHIFT,l=e.exports={version:"0.2.2"};l.Axis=function(){function t(t){r=t||r;var u=c.data,d=c.layout;return("string"==typeof r||r.nodeName)&&(r=n.select(r)),r.datum(u).each(function(t,r){function c(t,e){return s(t)%360+d.orientation}var u=t.slice();f={data:l.util.cloneJson(u),layout:l.util.cloneJson(d)};var p=0;u.forEach(function(t,e){t.color||(t.color=d.defaultColorRange[p],p=(p+1)%d.defaultColorRange.length),t.strokeColor||(t.strokeColor="LinePlot"===t.geometry?t.color:n.rgb(t.color).darker().toString()),f.data[e].color=t.color,f.data[e].strokeColor=t.strokeColor,f.data[e].strokeDash=t.strokeDash,f.data[e].strokeSize=t.strokeSize});var h=u.filter(function(t,e){var r=t.visible;return void 0===r||!0===r}),g=!1,v=h.map(function(t,e){return g=g||void 0!==t.groupId,t});if(g){var y=n.nest().key(function(t,e){return void 0!==t.groupId?t.groupId:"unstacked"}).entries(v),m=[],x=y.map(function(t,e){if("unstacked"===t.key)return t.values;var r=t.values[0].r.map(function(t,e){return 0});return t.values.forEach(function(t,e,n){t.yStack=[r],m.push(r),r=l.util.sumArrays(t.r,r)}),t.values});h=n.merge(x)}h.forEach(function(t,e){t.t=Array.isArray(t.t[0])?t.t:[t.t],t.r=Array.isArray(t.r[0])?t.r:[t.r]});var b=Math.min(d.width-d.margin.left-d.margin.right,d.height-d.margin.top-d.margin.bottom)/2;b=Math.max(10,b);var _,w=[d.margin.left+b,d.margin.top+b];if(g){_=[0,n.max(l.util.sumArrays(l.util.arrayLast(h).r[0],l.util.arrayLast(m)))]}else _=n.extent(l.util.flattenArray(h.map(function(t,e){return t.r})));d.radialAxis.domain!=l.DATAEXTENT&&(_[0]=0),a=n.scale.linear().domain(d.radialAxis.domain!=l.DATAEXTENT&&d.radialAxis.domain?d.radialAxis.domain:_).range([0,b]),f.layout.radialAxis.domain=a.domain();var k,M=l.util.flattenArray(h.map(function(t,e){return t.t})),A="string"==typeof M[0];A&&(M=l.util.deduplicate(M),k=M.slice(),M=n.range(M.length),h=h.map(function(t,e){var r=t;return t.t=[M],g&&(r.yStack=t.yStack),r}));var T=h.filter(function(t,e){return"LinePlot"===t.geometry||"DotPlot"===t.geometry}).length===h.length,L=null===d.needsEndSpacing?A||!T:d.needsEndSpacing,C=d.angularAxis.domain&&d.angularAxis.domain!=l.DATAEXTENT&&!A&&d.angularAxis.domain[0]>=0,S=C?d.angularAxis.domain:n.extent(M),O=Math.abs(M[1]-M[0]);T&&!A&&(O=0);var z=S.slice();L&&A&&(z[1]+=O);var D=d.angularAxis.ticksCount||4;D>8&&(D=D/(D/8)+D%8),d.angularAxis.ticksStep&&(D=(z[1]-z[0])/D);var P=d.angularAxis.ticksStep||(z[1]-z[0])/(D*(d.minorTicks+1));k&&(P=Math.max(Math.round(P),1)),z[2]||(z[2]=P);var E=n.range.apply(this,z);if(E=E.map(function(t,e){return parseFloat(t.toPrecision(12))}),s=n.scale.linear().domain(z.slice(0,2)).range("clockwise"===d.direction?[0,360]:[360,0]),f.layout.angularAxis.domain=s.domain(),f.layout.angularAxis.endPadding=L?O:0,void 0===(e=n.select(this).select("svg.chart-root"))||e.empty()){var N=(new DOMParser).parseFromString("<svg xmlns='http://www.w3.org/2000/svg' class='chart-root'>' + '<g class='outer-group'>' + '<g class='chart-group'>' + '<circle class='background-circle'></circle>' + '<g class='geometry-group'></g>' + '<g class='radial axis-group'>' + '<circle class='outside-circle'></circle>' + '</g>' + '<g class='angular axis-group'></g>' + '<g class='guides-group'><line></line><circle r='0'></circle></g>' + '</g>' + '<g class='legend-group'></g>' + '<g class='tooltips-group'></g>' + '<g class='title-group'><text></text></g>' + '</g>' + '</svg>","application/xml"),I=this.appendChild(this.ownerDocument.importNode(N.documentElement,!0));e=n.select(I)}e.select(".guides-group").style({"pointer-events":"none"}),e.select(".angular.axis-group").style({"pointer-events":"none"}),e.select(".radial.axis-group").style({"pointer-events":"none"});var R,F=e.select(".chart-group"),j={fill:"none",stroke:d.tickColor},B={"font-size":d.font.size,"font-family":d.font.family,fill:d.font.color,"text-shadow":["-1px 0px","1px -1px","-1px 1px","1px 1px"].map(function(t,e){return" "+t+" 0 "+d.font.outlineColor}).join(",")};if(d.showLegend){R=e.select(".legend-group").attr({transform:"translate("+[b,d.margin.top]+")"}).style({display:"block"});var q=h.map(function(t,e){var r=l.util.cloneJson(t);return r.symbol="DotPlot"===t.geometry?t.dotType||"circle":"LinePlot"!=t.geometry?"square":"line",r.visibleInLegend=void 0===t.visibleInLegend||t.visibleInLegend,r.color="LinePlot"===t.geometry?t.strokeColor:t.color,r});l.Legend().config({data:h.map(function(t,e){return t.name||"Element"+e}),legendConfig:i({},l.Legend.defaultConfig().legendConfig,{container:R,elements:q,reverseOrder:d.legend.reverseOrder})})();var H=R.node().getBBox();b=Math.min(d.width-H.width-d.margin.left-d.margin.right,d.height-d.margin.top-d.margin.bottom)/2,b=Math.max(10,b),w=[d.margin.left+b,d.margin.top+b],a.range([0,b]),f.layout.radialAxis.domain=a.domain(),R.attr("transform","translate("+[w[0]+b,w[1]-b]+")")}else R=e.select(".legend-group").style({display:"none"});e.attr({width:d.width,height:d.height}).style({opacity:d.opacity}),F.attr("transform","translate("+w+")").style({cursor:"crosshair"});var V=[(d.width-(d.margin.left+d.margin.right+2*b+(H?H.width:0)))/2,(d.height-(d.margin.top+d.margin.bottom+2*b))/2];if(V[0]=Math.max(0,V[0]),V[1]=Math.max(0,V[1]),e.select(".outer-group").attr("transform","translate("+V+")"),d.title){var U=e.select("g.title-group text").style(B).text(d.title),G=U.node().getBBox();U.attr({x:w[0]-G.width/2,y:w[1]-b-20})}var X=e.select(".radial.axis-group");if(d.radialAxis.gridLinesVisible){var Y=X.selectAll("circle.grid-circle").data(a.ticks(5));Y.enter().append("circle").attr({class:"grid-circle"}).style(j),Y.attr("r",a),Y.exit().remove()}X.select("circle.outside-circle").attr({r:b}).style(j);var Z=e.select("circle.background-circle").attr({r:b}).style({fill:d.backgroundColor,stroke:d.stroke});if(d.radialAxis.visible){var W=n.svg.axis().scale(a).ticks(5).tickSize(5);X.call(W).attr({transform:"rotate("+d.radialAxis.orientation+")"}),X.selectAll(".domain").style(j),X.selectAll("g>text").text(function(t,e){return this.textContent+d.radialAxis.ticksSuffix}).style(B).style({"text-anchor":"start"}).attr({x:0,y:0,dx:0,dy:0,transform:function(t,e){ return"horizontal"===d.radialAxis.tickOrientation?"rotate("+-d.radialAxis.orientation+") translate("+[0,B["font-size"]]+")":"translate("+[0,B["font-size"]]+")"}}),X.selectAll("g>line").style({stroke:"black"})}var Q=e.select(".angular.axis-group").selectAll("g.angular-tick").data(E),$=Q.enter().append("g").classed("angular-tick",!0);Q.attr({transform:function(t,e){return"rotate("+c(t,e)+")"}}).style({display:d.angularAxis.visible?"block":"none"}),Q.exit().remove(),$.append("line").classed("grid-line",!0).classed("major",function(t,e){return e%(d.minorTicks+1)==0}).classed("minor",function(t,e){return!(e%(d.minorTicks+1)==0)}).style(j),$.selectAll(".minor").style({stroke:d.minorTickColor}),Q.select("line.grid-line").attr({x1:d.tickLength?b-d.tickLength:0,x2:b}).style({display:d.angularAxis.gridLinesVisible?"block":"none"}),$.append("text").classed("axis-text",!0).style(B);var J=Q.select("text.axis-text").attr({x:b+d.labelOffset,dy:o+"em",transform:function(t,e){var r=c(t,e),n=b+d.labelOffset,a=d.angularAxis.tickOrientation;return"horizontal"==a?"rotate("+-r+" "+n+" 0)":"radial"==a?r<270&&r>90?"rotate(180 "+n+" 0)":null:"rotate("+(r<=180&&r>0?-90:90)+" "+n+" 0)"}}).style({"text-anchor":"middle",display:d.angularAxis.labelsVisible?"block":"none"}).text(function(t,e){return e%(d.minorTicks+1)!=0?"":k?k[t]+d.angularAxis.ticksSuffix:t+d.angularAxis.ticksSuffix}).style(B);d.angularAxis.rewriteTicks&&J.text(function(t,e){return e%(d.minorTicks+1)!=0?"":d.angularAxis.rewriteTicks(this.textContent,e)});var K=n.max(F.selectAll(".angular-tick text")[0].map(function(t,e){return t.getCTM().e+t.getBBox().width}));R.attr({transform:"translate("+[b+K,d.margin.top]+")"});var tt=e.select("g.geometry-group").selectAll("g").size()>0,et=e.select("g.geometry-group").selectAll("g.geometry").data(h);if(et.enter().append("g").attr({class:function(t,e){return"geometry geometry"+e}}),et.exit().remove(),h[0]||tt){var rt=[];h.forEach(function(t,e){var r={};r.radialScale=a,r.angularScale=s,r.container=et.filter(function(t,r){return r==e}),r.geometry=t.geometry,r.orientation=d.orientation,r.direction=d.direction,r.index=e,rt.push({data:t,geometryConfig:r})});var nt=n.nest().key(function(t,e){return void 0!==t.data.groupId||"unstacked"}).entries(rt),at=[];nt.forEach(function(t,e){"unstacked"===t.key?at=at.concat(t.values.map(function(t,e){return[t]})):at.push(t.values)}),at.forEach(function(t,e){var r;r=Array.isArray(t)?t[0].geometryConfig.geometry:t.geometryConfig.geometry;var n=t.map(function(t,e){return i(l[r].defaultConfig(),t)});l[r]().config(n)()})}var it,ot,lt=e.select(".guides-group"),st=e.select(".tooltips-group"),ct=l.tooltipPanel().config({container:st,fontSize:8})(),ut=l.tooltipPanel().config({container:st,fontSize:8})(),ft=l.tooltipPanel().config({container:st,hasTick:!0})();if(!A){var dt=lt.select("line").attr({x1:0,y1:0,y2:0}).style({stroke:"grey","pointer-events":"none"});F.on("mousemove.angular-guide",function(t,e){var r=l.util.getMousePos(Z).angle;dt.attr({x2:-b,transform:"rotate("+r+")"}).style({opacity:.5});var n=(r+180+360-d.orientation)%360;it=s.invert(n);var a=l.util.convertToCartesian(b+12,r+180);ct.text(l.util.round(it)).move([a[0]+w[0],a[1]+w[1]])}).on("mouseout.angular-guide",function(t,e){lt.select("line").style({opacity:0})})}var pt=lt.select("circle").style({stroke:"grey",fill:"none"});F.on("mousemove.radial-guide",function(t,e){var r=l.util.getMousePos(Z).radius;pt.attr({r:r}).style({opacity:.5}),ot=a.invert(l.util.getMousePos(Z).radius);var n=l.util.convertToCartesian(r,d.radialAxis.orientation);ut.text(l.util.round(ot)).move([n[0]+w[0],n[1]+w[1]])}).on("mouseout.radial-guide",function(t,e){pt.style({opacity:0}),ft.hide(),ct.hide(),ut.hide()}),e.selectAll(".geometry-group .mark").on("mouseover.tooltip",function(t,r){var a=n.select(this),i=this.style.fill,o="black",s=this.style.opacity||1;if(a.attr({"data-opacity":s}),i&&"none"!==i){a.attr({"data-fill":i}),o=n.hsl(i).darker().toString(),a.style({fill:o,opacity:1});var c={t:l.util.round(t[0]),r:l.util.round(t[1])};A&&(c.t=k[t[0]]);var u="t: "+c.t+", r: "+c.r,f=this.getBoundingClientRect(),d=e.node().getBoundingClientRect(),p=[f.left+f.width/2-V[0]-d.left,f.top+f.height/2-V[1]-d.top];ft.config({color:o}).text(u),ft.move(p)}else i=this.style.stroke||"black",a.attr({"data-stroke":i}),o=n.hsl(i).darker().toString(),a.style({stroke:o,opacity:1})}).on("mousemove.tooltip",function(t,e){if(0!=n.event.which)return!1;n.select(this).attr("data-fill")&&ft.show()}).on("mouseout.tooltip",function(t,e){ft.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")})})}),p}var e,r,a,s,c={data:[],layout:{}},u={},f={},d=n.dispatch("hover"),p={};return p.render=function(e){return t(e),this},p.config=function(t){if(!arguments.length)return c;var e=l.util.cloneJson(t);return e.data.forEach(function(t,e){c.data[e]||(c.data[e]={}),i(c.data[e],l.Axis.defaultConfig().data[0]),i(c.data[e],t)}),i(c.layout,l.Axis.defaultConfig().layout),i(c.layout,e.layout),this},p.getLiveConfig=function(){return f},p.getinputConfig=function(){return u},p.radialScale=function(t){return a},p.angularScale=function(t){return s},p.svg=function(){return e},n.rebind(p,d,"on"),p},l.Axis.defaultConfig=function(t,e){return{data:[{t:[1,2,3,4],r:[10,11,12,13],name:"Line1",geometry:"LinePlot",color:null,strokeDash:"solid",strokeColor:null,strokeSize:"1",visibleInLegend:!0,opacity:1}],layout:{defaultColorRange:n.scale.category10().range(),title:null,height:450,width:500,margin:{top:40,right:40,bottom:40,left:40},font:{size:12,color:"gray",outlineColor:"white",family:"Tahoma, sans-serif"},direction:"clockwise",orientation:0,labelOffset:10,radialAxis:{domain:null,orientation:-45,ticksSuffix:"",visible:!0,gridLinesVisible:!0,tickOrientation:"horizontal",rewriteTicks:null},angularAxis:{domain:[0,360],ticksSuffix:"",visible:!0,gridLinesVisible:!0,labelsVisible:!0,tickOrientation:"horizontal",rewriteTicks:null,ticksCount:null,ticksStep:null},minorTicks:0,tickLength:null,tickColor:"silver",minorTickColor:"#eee",backgroundColor:"none",needsEndSpacing:null,showLegend:!0,legend:{reverseOrder:!1},opacity:1}}},l.util={},l.DATAEXTENT="dataExtent",l.AREA="AreaChart",l.LINE="LinePlot",l.DOT="DotPlot",l.BAR="BarChart",l.util._override=function(t,e){for(var r in t)r in e&&(e[r]=t[r])},l.util._extend=function(t,e){for(var r in t)e[r]=t[r]},l.util._rndSnd=function(){return 2*Math.random()-1+(2*Math.random()-1)+(2*Math.random()-1)},l.util.dataFromEquation2=function(t,e){var r=e||6;return n.range(0,360+r,r).map(function(e,r){var n=e*Math.PI/180;return[e,t(n)]})},l.util.dataFromEquation=function(t,e,r){var a=e||6,i=[],o=[];n.range(0,360+a,a).forEach(function(e,r){var n=e*Math.PI/180,a=t(n);i.push(e),o.push(a)});var l={t:i,r:o};return r&&(l.name=r),l},l.util.ensureArray=function(t,e){if(void 0===t)return null;var r=[].concat(t);return n.range(e).map(function(t,e){return r[e]||r[0]})},l.util.fillArrays=function(t,e,r){return e.forEach(function(e,n){t[e]=l.util.ensureArray(t[e],r)}),t},l.util.cloneJson=function(t){return JSON.parse(JSON.stringify(t))},l.util.validateKeys=function(t,e){"string"==typeof e&&(e=e.split("."));var r=e.shift();return t[r]&&(!e.length||objHasKeys(t[r],e))},l.util.sumArrays=function(t,e){return n.zip(t,e).map(function(t,e){return n.sum(t)})},l.util.arrayLast=function(t){return t[t.length-1]},l.util.arrayEqual=function(t,e){for(var r=Math.max(t.length,e.length,1);r-- >=0&&t[r]===e[r];);return-2===r},l.util.flattenArray=function(t){for(var e=[];!l.util.arrayEqual(e,t);)e=t,t=[].concat.apply([],t);return t},l.util.deduplicate=function(t){return t.filter(function(t,e,r){return r.indexOf(t)==e})},l.util.convertToCartesian=function(t,e){var r=e*Math.PI/180;return[t*Math.cos(r),t*Math.sin(r)]},l.util.round=function(t,e){var r=e||2,n=Math.pow(10,r);return Math.round(t*n)/n},l.util.getMousePos=function(t){var e=n.mouse(t.node()),r=e[0],a=e[1],i={};return i.x=r,i.y=a,i.pos=e,i.angle=180*(Math.atan2(a,r)+Math.PI)/Math.PI,i.radius=Math.sqrt(r*r+a*a),i},l.util.duplicatesCount=function(t){for(var e,r={},n={},a=0,i=t.length;a<i;a++)e=t[a],e in r?(r[e]++,n[e]=r[e]):r[e]=1;return n},l.util.duplicates=function(t){return Object.keys(l.util.duplicatesCount(t))},l.util.translator=function(t,e,r,n){if(n){var a=r.slice();r=e,e=a}var i=e.reduce(function(t,e){if(void 0!==t)return t[e]},t);void 0!==i&&(e.reduce(function(t,r,n){if(void 0!==t)return n===e.length-1&&delete t[r],t[r]},t),r.reduce(function(t,e,n){return void 0===t[e]&&(t[e]={}),n===r.length-1&&(t[e]=i),t[e]},t))},l.PolyChart=function(){function t(){var t=e[0].geometryConfig,r=t.container;"string"==typeof r&&(r=n.select(r)),r.datum(e).each(function(e,r){function i(e,r){return{r:t.radialScale(e[1]),t:(t.angularScale(e[0])+t.orientation)*Math.PI/180}}function o(t){return{x:t.r*Math.cos(t.t),y:t.r*Math.sin(t.t)}}var l=!!e[0].data.yStack,s=e.map(function(t,e){return l?n.zip(t.data.t[0],t.data.r[0],t.data.yStack[0]):n.zip(t.data.t[0],t.data.r[0])}),c=t.angularScale,u=t.radialScale.domain()[0],f={};f.bar=function(r,a,i){var o=e[i].data,l=t.radialScale(r[1])-t.radialScale(0),s=t.radialScale(r[2]||0),u=o.barWidth;n.select(this).attr({class:"mark bar",d:"M"+[[l+s,-u/2],[l+s,u/2],[s,u/2],[s,-u/2]].join("L")+"Z",transform:function(e,r){return"rotate("+(t.orientation+c(e[0]))+")"}})},f.dot=function(t,r,a){var l=t[2]?[t[0],t[1]+t[2]]:t,s=n.svg.symbol().size(e[a].data.dotSize).type(e[a].data.dotType)(t,r);n.select(this).attr({class:"mark dot",d:s,transform:function(t,e){var r=o(i(l));return"translate("+[r.x,r.y]+")"}})};var d=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});f.line=function(r,a,i){var o=r[2]?s[i].map(function(t,e){return[t[0],t[1]+t[2]]}):s[i];if(n.select(this).each(f.dot).style({opacity:function(t,r){return+e[i].data.dotVisible},fill:v.stroke(r,a,i)}).attr({class:"mark dot"}),!(a>0)){var l=n.select(this.parentNode).selectAll("path.line").data([0]);l.enter().insert("path"),l.attr({class:"line",d:d(o),transform:function(e,r){return"rotate("+(t.orientation+90)+")"},"pointer-events":"none"}).style({fill:function(t,e){return v.fill(r,a,i)},"fill-opacity":0,stroke:function(t,e){return v.stroke(r,a,i)},"stroke-width":function(t,e){return v["stroke-width"](r,a,i)},"stroke-dasharray":function(t,e){return v["stroke-dasharray"](r,a,i)},opacity:function(t,e){return v.opacity(r,a,i)},display:function(t,e){return v.display(r,a,i)}})}};var p=t.angularScale.range(),h=Math.abs(p[1]-p[0])/s[0].length*Math.PI/180,g=n.svg.arc().startAngle(function(t){return-h/2}).endAngle(function(t){return h/2}).innerRadius(function(e){return t.radialScale(u+(e[2]||0))}).outerRadius(function(e){return t.radialScale(u+(e[2]||0))+t.radialScale(e[1])});f.arc=function(e,r,a){n.select(this).attr({class:"mark arc",d:g,transform:function(e,r){return"rotate("+(t.orientation+c(e[0])+90)+")"}})};var v={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,r,n){return a[e[n].data.strokeDash]},opacity:function(t,r,n){return e[n].data.opacity},display:function(t,r,n){return void 0===e[n].data.visible||e[n].data.visible?"block":"none"}},y=n.select(this).selectAll("g.layer").data(s);y.enter().append("g").attr({class:"layer"});var m=y.selectAll("path.mark").data(function(t,e){return t});m.enter().append("path").attr({class:"mark"}),m.style(v).each(f[t.geometryType]),m.exit().remove(),y.exit().remove()})}var e=[l.PolyChart.defaultConfig()],r=n.dispatch("hover"),a={solid:"none",dash:[5,2],dot:[2,5]};return t.config=function(t){return arguments.length?(t.forEach(function(t,r){e[r]||(e[r]={}),i(e[r],l.PolyChart.defaultConfig()),i(e[r],t)}),this):e},t.getColorScale=function(){},n.rebind(t,r,"on"),t},l.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()}}},l.BarChart=function(){return l.PolyChart()},l.BarChart.defaultConfig=function(){return{geometryConfig:{geometryType:"bar"}}},l.AreaChart=function(){return l.PolyChart()},l.AreaChart.defaultConfig=function(){return{geometryConfig:{geometryType:"arc"}}},l.DotPlot=function(){return l.PolyChart()},l.DotPlot.defaultConfig=function(){return{geometryConfig:{geometryType:"dot",dotType:"circle"}}},l.LinePlot=function(){return l.PolyChart()},l.LinePlot.defaultConfig=function(){return{geometryConfig:{geometryType:"line"}}},l.Legend=function(){function t(){var r=e.legendConfig,a=e.data.map(function(t,e){return[].concat(t).map(function(t,n){var a=i({},r.elements[e]);return a.name=t,a.color=[].concat(r.elements[e].color)[n],a})}),o=n.merge(a);o=o.filter(function(t,e){return r.elements[e]&&(r.elements[e].visibleInLegend||void 0===r.elements[e].visibleInLegend)}),r.reverseOrder&&(o=o.reverse());var l=r.container;("string"==typeof l||l.nodeName)&&(l=n.select(l));var s=o.map(function(t,e){return t.color}),c=r.fontSize,u=null==r.isContinuous?"number"==typeof o[0]:r.isContinuous,f=u?r.height:c*o.length,d=l.classed("legend-group",!0),p=d.selectAll("svg").data([0]),h=p.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"});h.append("g").classed("legend-axis",!0),h.append("g").classed("legend-marks",!0);var g=n.range(o.length),v=n.scale[u?"linear":"ordinal"]().domain(g).range(s),y=n.scale[u?"linear":"ordinal"]().domain(g)[u?"range":"rangePoints"]([0,f]),m=function(t,e){var r=3*e;return"line"===t?"M"+[[-e/2,-e/12],[e/2,-e/12],[e/2,e/12],[-e/2,e/12]]+"Z":-1!=n.svg.symbolTypes.indexOf(t)?n.svg.symbol().type(t).size(r)():n.svg.symbol().type("square").size(r)()};if(u){var x=p.select(".legend-marks").append("defs").append("linearGradient").attr({id:"grad1",x1:"0%",y1:"0%",x2:"0%",y2:"100%"}).selectAll("stop").data(s);x.enter().append("stop"),x.attr({offset:function(t,e){return e/(s.length-1)*100+"%"}}).style({"stop-color":function(t,e){return t}}),p.append("rect").classed("legend-mark",!0).attr({height:r.height,width:r.colorBandWidth,fill:"url(#grad1)"})}else{var b=p.select(".legend-marks").selectAll("path.legend-mark").data(o);b.enter().append("path").classed("legend-mark",!0),b.attr({transform:function(t,e){return"translate("+[c/2,y(e)+c/2]+")"},d:function(t,e){var r=t.symbol;return m(r,c)},fill:function(t,e){return v(e)}}),b.exit().remove()}var _=n.svg.axis().scale(y).orient("right"),w=p.select("g.legend-axis").attr({transform:"translate("+[u?r.colorBandWidth:c,c/2]+")"}).call(_);return w.selectAll(".domain").style({fill:"none",stroke:"none"}),w.selectAll("line").style({fill:"none",stroke:u?r.textColor:"none"}),w.selectAll("text").style({fill:r.textColor,"font-size":r.fontSize}).text(function(t,e){return o[e].name}),t}var e=l.Legend.defaultConfig(),r=n.dispatch("hover");return t.config=function(t){return arguments.length?(i(e,t),this):e},n.rebind(t,r,"on"),t},l.Legend.defaultConfig=function(t,e){return{data:["a","b","c"],legendConfig:{elements:[{symbol:"line",color:"red"},{symbol:"square",color:"yellow"},{symbol:"diamond",color:"limegreen"}],height:150,colorBandWidth:30,fontSize:12,container:"body",isContinuous:null,textColor:"grey",reverseOrder:!1}}},l.tooltipPanel=function(){var t,e,r,a={container:null,hasTick:!1,fontSize:12,color:"white",padding:5},o="tooltip-"+l.tooltipPanel.uid++,s=function(){t=a.container.selectAll("g."+o).data([0]);var n=t.enter().append("g").classed(o,!0).style({"pointer-events":"none",display:"none"});return r=n.append("path").style({fill:"white","fill-opacity":.9}).attr({d:"M0 0"}),e=n.append("text").attr({dx:a.padding+10,dy:.3*+a.fontSize}),s};return s.text=function(i){var o=n.hsl(a.color).l,l=o>=.5?"#aaa":"white",c=o>=.5?"black":"white",u=i||"";e.style({fill:c,"font-size":a.fontSize+"px"}).text(u);var f=a.padding,d=e.node().getBBox(),p={fill:a.color,stroke:l,"stroke-width":"2px"},h=d.width+2*f+10,g=d.height+2*f;return r.attr({d:"M"+[[10,-g/2],[10,-g/4],[a.hasTick?0:10,0],[10,g/4],[10,g/2],[h,g/2],[h,-g/2]].join("L")+"Z"}).style(p),t.attr({transform:"translate("+[10,-g/2+2*f]+")"}),t.style({display:"block"}),s},s.move=function(e){if(t)return t.attr({transform:"translate("+[e[0],e[1]]+")"}).style({display:"block"}),s},s.hide=function(){if(t)return t.style({display:"none"}),s},s.show=function(){if(t)return t.style({display:"block"}),s},s.config=function(t){return i(a,t),s},s},l.tooltipPanel.uid=1,l.adapter={},l.adapter.plotly=function(){var t={};return t.convert=function(t,e){var r={};if(t.data&&(r.data=t.data.map(function(t,r){var n=i({},t);return[[n,["marker","color"],["color"]],[n,["marker","opacity"],["opacity"]],[n,["marker","line","color"],["strokeColor"]],[n,["marker","line","dash"],["strokeDash"]],[n,["marker","line","width"],["strokeSize"]],[n,["marker","symbol"],["dotType"]],[n,["marker","size"],["dotSize"]],[n,["marker","barWidth"],["barWidth"]],[n,["line","interpolation"],["lineInterpolation"]],[n,["showlegend"],["visibleInLegend"]]].forEach(function(t,r){l.util.translator.apply(null,t.concat(e))}),e||delete n.marker,e&&delete n.groupId,e?("LinePlot"===n.geometry?(n.type="scatter",!0===n.dotVisible?(delete n.dotVisible,n.mode="lines+markers"):n.mode="lines"):"DotPlot"===n.geometry?(n.type="scatter",n.mode="markers"):"AreaChart"===n.geometry?n.type="area":"BarChart"===n.geometry&&(n.type="bar"),delete n.geometry):("scatter"===n.type?"lines"===n.mode?n.geometry="LinePlot":"markers"===n.mode?n.geometry="DotPlot":"lines+markers"===n.mode&&(n.geometry="LinePlot",n.dotVisible=!0):"area"===n.type?n.geometry="AreaChart":"bar"===n.type&&(n.geometry="BarChart"),delete n.mode,delete n.type),n}),!e&&t.layout&&"stack"===t.layout.barmode)){var a=l.util.duplicates(r.data.map(function(t,e){return t.geometry}));r.data.forEach(function(t,e){var n=a.indexOf(t.geometry);-1!=n&&(r.data[e].groupId=n)})}if(t.layout){var o=i({},t.layout);if([[o,["plot_bgcolor"],["backgroundColor"]],[o,["showlegend"],["showLegend"]],[o,["radialaxis"],["radialAxis"]],[o,["angularaxis"],["angularAxis"]],[o.angularaxis,["showline"],["gridLinesVisible"]],[o.angularaxis,["showticklabels"],["labelsVisible"]],[o.angularaxis,["nticks"],["ticksCount"]],[o.angularaxis,["tickorientation"],["tickOrientation"]],[o.angularaxis,["ticksuffix"],["ticksSuffix"]],[o.angularaxis,["range"],["domain"]],[o.angularaxis,["endpadding"],["endPadding"]],[o.radialaxis,["showline"],["gridLinesVisible"]],[o.radialaxis,["tickorientation"],["tickOrientation"]],[o.radialaxis,["ticksuffix"],["ticksSuffix"]],[o.radialaxis,["range"],["domain"]],[o.angularAxis,["showline"],["gridLinesVisible"]],[o.angularAxis,["showticklabels"],["labelsVisible"]],[o.angularAxis,["nticks"],["ticksCount"]],[o.angularAxis,["tickorientation"],["tickOrientation"]],[o.angularAxis,["ticksuffix"],["ticksSuffix"]],[o.angularAxis,["range"],["domain"]],[o.angularAxis,["endpadding"],["endPadding"]],[o.radialAxis,["showline"],["gridLinesVisible"]],[o.radialAxis,["tickorientation"],["tickOrientation"]],[o.radialAxis,["ticksuffix"],["ticksSuffix"]],[o.radialAxis,["range"],["domain"]],[o.font,["outlinecolor"],["outlineColor"]],[o.legend,["traceorder"],["reverseOrder"]],[o,["labeloffset"],["labelOffset"]],[o,["defaultcolorrange"],["defaultColorRange"]]].forEach(function(t,r){l.util.translator.apply(null,t.concat(e))}),e?(void 0!==o.tickLength&&(o.angularaxis.ticklen=o.tickLength,delete o.tickLength),o.tickColor&&(o.angularaxis.tickcolor=o.tickColor,delete o.tickColor)):(o.angularAxis&&void 0!==o.angularAxis.ticklen&&(o.tickLength=o.angularAxis.ticklen),o.angularAxis&&void 0!==o.angularAxis.tickcolor&&(o.tickColor=o.angularAxis.tickcolor)),o.legend&&"boolean"!=typeof o.legend.reverseOrder&&(o.legend.reverseOrder="normal"!=o.legend.reverseOrder),o.legend&&"boolean"==typeof o.legend.traceorder&&(o.legend.traceorder=o.legend.traceorder?"reversed":"normal",delete o.legend.reverseOrder),o.margin&&void 0!==o.margin.t){var s=["t","r","b","l","pad"],c=["top","right","bottom","left","pad"],u={};n.entries(o.margin).forEach(function(t,e){u[c[s.indexOf(t.key)]]=t.value}),o.margin=u}e&&(delete o.needsEndSpacing,delete o.minorTickColor,delete o.minorTicks,delete o.angularaxis.ticksCount,delete o.angularaxis.ticksCount,delete o.angularaxis.ticksStep,delete o.angularaxis.rewriteTicks,delete o.angularaxis.nticks,delete o.radialaxis.ticksCount,delete o.radialaxis.ticksCount,delete o.radialaxis.ticksStep,delete o.radialaxis.rewriteTicks,delete o.radialaxis.nticks),r.layout=o}return r},t}},{"../../constants/alignment":131,"../../lib":149,d3:7}],223:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../lib"),i=t("../../components/color"),o=t("./micropolar"),l=t("./undo_manager"),s=a.extendDeepAll,c=e.exports={};c.framework=function(t){function e(e,a){return a&&(f=a),n.select(n.select(f).node().parentNode).selectAll(".svg-container>*:not(.chart-root)").remove(),r=r?s(r,e):e,i||(i=o.Axis()),u=o.adapter.plotly().convert(r),i.config(u).render(f),t.data=r.data,t.layout=r.layout,c.fillLayout(t),r}var r,a,i,u,f,d=new l;return e.isPolar=!0,e.svg=function(){return i.svg()},e.getConfig=function(){return r},e.getLiveConfig=function(){return o.adapter.plotly().convert(i.getLiveConfig(),!0)},e.getLiveScales=function(){return{t:i.angularScale(),r:i.radialScale()}},e.setUndoPoint=function(){var t=this,e=o.util.cloneJson(r);!function(e,r){d.add({undo:function(){r&&t(r)},redo:function(){t(e)}})}(e,a),a=o.util.cloneJson(e)},e.undo=function(){d.undo()},e.redo=function(){d.redo()},e},c.fillLayout=function(t){var e=n.select(t).selectAll(".plot-container"),r=e.selectAll(".svg-container"),a=t.framework&&t.framework.svg&&t.framework.svg(),o={width:800,height:600,paper_bgcolor:i.background,_container:e,_paperdiv:r,_paper:a};t._fullLayout=s(o,t.layout)}},{"../../components/color":34,"../../lib":149,"./micropolar":222,"./undo_manager":224,d3:7}],224:[function(t,e,r){"use strict";e.exports=function(){function t(t,e){return t?(a=!0,t[e](),a=!1,this):this}var e,r=[],n=-1,a=!1;return{add:function(t){return a?this:(r.splice(n+1,r.length-n),r.push(t),n=r.length-1,this)},setCallback:function(t){e=t},undo:function(){var a=r[n];return a?(t(a,"undo"),n-=1,e&&e(a.undo),this):this},redo:function(){var a=r[n+1];return a?(t(a,"redo"),n+=1,e&&e(a.redo),this):this},clear:function(){r=[],n=-1},hasUndo:function(){return-1!==n},hasRedo:function(){return n<r.length-1},getCommands:function(){return r},getPreviousCommand:function(){return r[n-1]},getIndex:function(){return n}}}},{}],225:[function(t,e,r){"use strict";function n(t){if(t.layoutAttributes){var e=t.layoutAttributes._arrayAttrRegexps;if(e)for(var n=0;n<e.length;n++)u(r.layoutArrayRegexes,e[n])}}function a(t,e){var n=r.componentsRegistry[t].schema;if(n&&n.traces){var a=n.traces[e];a&&p(r.modules[e]._module.attributes,a)}}function i(t,e){var n=r.componentsRegistry[t].schema;if(n&&n.transforms){var a=n.transforms[e];a&&p(r.transformsRegistry[e].attributes,a)}}function o(t,e){var n=r.componentsRegistry[t].schema;if(n&&n.subplots){var a=r.subplotsRegistry[e],i=a.layoutAttributes,o="subplot"===a.attr?a.name:a.attr;Array.isArray(o)&&(o=o[0]);var l=n.subplots[o];i&&l&&p(i,l)}}function l(t){return"object"==typeof t&&(t=t.type),t}var s=t("./lib/loggers"),c=t("./lib/noop"),u=t("./lib/push_unique"),f=t("./lib/extend"),d=f.extendFlat,p=f.extendDeepAll,h=t("./plots/attributes"),g=t("./plots/layout_attributes");r.modules={},r.allCategories={},r.allTypes=[],r.subplotsRegistry={},r.transformsRegistry={},r.componentsRegistry={},r.layoutArrayContainers=[],r.layoutArrayRegexes=[],r.traceLayoutAttributes={},r.register=function(t,e,n,i){if(r.modules[e])return void s.log("Type "+e+" already registered");for(var o={},l=0;l<n.length;l++)o[n[l]]=!0,r.allCategories[n[l]]=!0;r.modules[e]={_module:t,categories:o},i&&Object.keys(i).length&&(r.modules[e].meta=i),r.allTypes.push(e);for(var c in r.componentsRegistry)a(c,e);t.layoutAttributes&&d(r.traceLayoutAttributes,t.layoutAttributes)},r.registerSubplot=function(t){var e=t.name;if(r.subplotsRegistry[e])return void s.log("Plot type "+e+" already registered.");n(t),r.subplotsRegistry[e]=t;for(var a in r.componentsRegistry)o(a,t.name)},r.registerComponent=function(t){var e=t.name;r.componentsRegistry[e]=t,t.layoutAttributes&&(t.layoutAttributes._isLinkedToArray&&u(r.layoutArrayContainers,e),n(t));for(var l in r.modules)a(e,l);for(var s in r.subplotsRegistry)o(e,s);for(var c in r.transformsRegistry)i(e,c);t.schema&&t.schema.layout&&p(g,t.schema.layout)},r.registerTransform=function(t){r.transformsRegistry[t.name]=t;for(var e in r.componentsRegistry)i(e,t.name)},r.getModule=function(t){if(void 0!==t.r)return s.warn("Tried to put a polar trace on an incompatible graph of cartesian data. Ignoring this dataset.",t),!1;var e=r.modules[l(t)];return!!e&&e._module},r.traceIs=function(t,e){if("various"===(t=l(t)))return!1;var n=r.modules[t];return n||(t&&"area"!==t&&s.log("Unrecognized trace type "+t+"."),n=r.modules[h.type.dflt]),!!n.categories[e]},r.getTransformIndices=function(t,e){for(var r=[],n=t.transforms||[],a=0;a<n.length;a++)n[a].type===e&&r.push(a);return r},r.hasTransform=function(t,e){for(var r=t.transforms||[],n=0;n<r.length;n++)if(r[n].type===e)return!0;return!1},r.getComponentMethod=function(t,e){var n=r.componentsRegistry[t];return n?n[e]||c:c}},{"./lib/extend":143,"./lib/loggers":153,"./lib/noop":157,"./lib/push_unique":161,"./plots/attributes":187,"./plots/layout_attributes":216}],226:[function(t,e,r){"use strict";function n(t){var e;switch(t){case"themes__thumb":e={autosize:!0,width:150,height:150,title:"",showlegend:!1,margin:{l:5,r:5,t:5,b:5,pad:0},annotations:[]};break;case"thumbnail":e={title:"",hidesources:!0,showlegend:!1,borderwidth:0,bordercolor:"",margin:{l:1,r:1,t:1,b:1,pad:0},annotations:[]};break;default:e={}}return e}function a(t){return["xaxis","yaxis","zaxis"].indexOf(t.slice(0,5))>-1}var i=t("../lib"),o=t("../plots/plots"),l=i.extendFlat,s=i.extendDeep;e.exports=function(t,e){t.framework&&t.framework.isPolar&&(t=t.framework.getConfig());var r,i=t.data,c=t.layout,u=s([],i),f=s({},c,n(e.tileClass)),d=t._context||{};if(e.width&&(f.width=e.width),e.height&&(f.height=e.height),"thumbnail"===e.tileClass||"themes__thumb"===e.tileClass){f.annotations=[];var p=Object.keys(f);for(r=0;r<p.length;r++)a(p[r])&&(f[p[r]].title="");for(r=0;r<u.length;r++){var h=u[r];h.showscale=!1,h.marker&&(h.marker.showscale=!1),"pie"===h.type&&(h.textposition="none")}}if(Array.isArray(e.annotations))for(r=0;r<e.annotations.length;r++)f.annotations.push(e.annotations[r]);var g=o.getSubplotIds(f,"gl3d");if(g.length){var v={};for("thumbnail"===e.tileClass&&(v={title:"",showaxeslabels:!1,showticklabels:!1,linetickenable:!1}),r=0;r<g.length;r++){var y=f[g[r]];y.xaxis||(y.xaxis={}),y.yaxis||(y.yaxis={}),y.zaxis||(y.zaxis={}),l(y.xaxis,v),l(y.yaxis,v),l(y.zaxis,v),y._scene=null}}var m=document.createElement("div");e.tileClass&&(m.className=e.tileClass);var x={gd:m,td:m,layout:f,data:u,config:{staticPlot:void 0===e.staticPlot||e.staticPlot,plotGlPixelRatio:void 0===e.plotGlPixelRatio?2:e.plotGlPixelRatio,displaylogo:e.displaylogo||!1,showLink:e.showLink||!1,showTips:e.showTips||!1,mapboxAccessToken:d.mapboxAccessToken}};return"transparent"!==e.setBackground&&(x.config.setBackground=e.setBackground||"opaque"),x.gd.defaultLayout=n(e.tileClass),x}},{"../lib":149,"../plots/plots":218}],227:[function(t,e,r){"use strict";function n(t,e){return e=e||{},e.format=e.format||"png",new Promise(function(r,n){t._snapshotInProgress&&n(new Error("Snapshotting already in progress.")),i.isIE()&&"svg"!==e.format&&n(new Error("Sorry IE does not support downloading from canvas. Try {format:'svg'} instead.")),t._snapshotInProgress=!0;var l=a(t,e),s=e.filename||t.fn||"newplot";s+="."+e.format,l.then(function(e){return t._snapshotInProgress=!1,o(e,s)}).then(function(t){r(t)}).catch(function(e){t._snapshotInProgress=!1,n(e)})})}var a=t("../plot_api/to_image"),i=t("../lib"),o=t("./filesaver");e.exports=n},{"../lib":149,"../plot_api/to_image":182,"./filesaver":228}],228:[function(t,e,r){"use strict";var n=function(t,e){var r=document.createElement("a"),n="download"in r,a=/Version\/[\d\.]+.*Safari/.test(navigator.userAgent);return new Promise(function(i,o){if("undefined"!=typeof navigator&&/MSIE [1-9]\./.test(navigator.userAgent)&&o(new Error("IE < 10 unsupported")),a&&(document.location.href="data:application/octet-stream"+t.slice(t.search(/[,;]/)),i(e)),e||(e="download"),n&&(r.href=t,r.download=e,document.body.appendChild(r),r.click(),document.body.removeChild(r),i(e)),"undefined"!=typeof navigator&&navigator.msSaveBlob){var l=t.split(/^data:image\/svg\+xml,/)[1],s=decodeURIComponent(l);navigator.msSaveBlob(new Blob([s]),e),i(e)}o(new Error("download error"))})};e.exports=n},{}],229:[function(t,e,r){"use strict";r.getDelay=function(t){return t._has&&(t._has("gl3d")||t._has("gl2d"))?500:0},r.getRedrawFunc=function(t){if(!(t.data&&t.data[0]&&t.data[0].r))return function(){(t.calcdata||[]).forEach(function(t){t[0]&&t[0].t&&t[0].t.cb&&t[0].t.cb()})}}},{}],230:[function(t,e,r){"use strict";var n=t("./helpers"),a={getDelay:n.getDelay,getRedrawFunc:n.getRedrawFunc,clone:t("./cloneplot"),toSVG:t("./tosvg"),svgToImg:t("./svgtoimg"),toImage:t("./toimage"),downloadImage:t("./download")};e.exports=a},{"./cloneplot":226,"./download":227,"./helpers":229,"./svgtoimg":231,"./toimage":232,"./tosvg":233}],231:[function(t,e,r){"use strict";function n(t){var e=t.emitter||new i,r=new Promise(function(n,i){var o=window.Image,l=t.svg,s=t.format||"png";if(a.isIE()&&"svg"!==s){var c=new Error("Sorry IE does not support downloading from canvas. Try {format:'svg'} instead.");return i(c),t.promise?r:e.emit("error",c)}var u=t.canvas,f=t.scale||1,d=t.width||300,p=t.height||150,h=f*d,g=f*p,v=u.getContext("2d"),y=new o,m="data:image/svg+xml,"+encodeURIComponent(l);u.width=h,u.height=g,y.onload=function(){var r;switch("svg"!==s&&v.drawImage(y,0,0,h,g),s){case"jpeg":r=u.toDataURL("image/jpeg");break;case"png":r=u.toDataURL("image/png");break;case"webp":r=u.toDataURL("image/webp");break;case"svg":r=m;break;default:var a="Image format is not jpeg, png, svg or webp.";if(i(new Error(a)),!t.promise)return e.emit("error",a)}n(r),t.promise||e.emit("success",r)},y.onerror=function(r){if(i(r),!t.promise)return e.emit("error",r)},y.src=m});return t.promise?r:e}var a=t("../lib"),i=t("events").EventEmitter;e.exports=n},{"../lib":149,events:9}],232:[function(t,e,r){"use strict";function n(t,e){function r(){var t=l.getDelay(d._fullLayout);setTimeout(function(){var t=c(d),r=document.createElement("canvas");r.id=o.randstr(),n=u({format:e.format,width:d._fullLayout.width,height:d._fullLayout.height,canvas:r,emitter:n,svg:t}),n.clean=function(){d&&document.body.removeChild(d)}},t)}var n=new a,f=s(t,{format:"png"}),d=f.gd;d.style.position="absolute",d.style.left="-5000px",document.body.appendChild(d);var p=l.getRedrawFunc(d);return i.plot(d,f.data,f.layout,f.config).then(p).then(r).catch(function(t){n.emit("error",t)}),n}var a=t("events").EventEmitter,i=t("../plotly"),o=t("../lib"),l=t("./helpers"),s=t("./cloneplot"),c=t("./tosvg"),u=t("./svgtoimg");e.exports=n},{"../lib":149,"../plotly":184,"./cloneplot":226,"./helpers":229,"./svgtoimg":231,"./tosvg":233,events:9}],233:[function(t,e,r){"use strict";function n(t){var e=i.select("body").append("div").style({display:"none"}).html(""),r=t.replace(/(&[^;]*;)/gi,function(t){return"<"===t?"<":"&rt;"===t?">":-1!==t.indexOf("<")||-1!==t.indexOf(">")?"":e.html(t).text()});return e.remove(),r}function a(t){ return t.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")}var i=t("d3"),o=t("../lib"),l=t("../components/drawing"),s=t("../components/color"),c=t("../constants/xmlns_namespaces"),u=/"/g,f=new RegExp('("TOBESTRIPPED)|(TOBESTRIPPED")',"g");e.exports=function(t,e,r){var d,p=t._fullLayout,h=p._paper,g=p._toppaper,v=p.width,y=p.height;h.insert("rect",":first-child").call(l.setRect,0,0,v,y).call(s.fill,p.paper_bgcolor);var m=p._basePlotModules||[];for(d=0;d<m.length;d++){var x=m[d];x.toSVG&&x.toSVG(t)}if(g){var b=g.node().childNodes,_=Array.prototype.slice.call(b);for(d=0;d<_.length;d++){var w=_[d];w.childNodes.length&&h.node().appendChild(w)}}p._draggers&&p._draggers.remove(),h.node().style.background="",h.selectAll("text").attr({"data-unformatted":null,"data-math":null}).each(function(){var t=i.select(this);if("hidden"===this.style.visibility||"none"===this.style.display)return void t.remove();t.style({visibility:null,display:null});var e=this.style.fontFamily;e&&-1!==e.indexOf('"')&&t.style("font-family",e.replace(u,"TOBESTRIPPED"))}),h.selectAll(".point,.scatterpts").each(function(){var t=i.select(this),e=this.style.fill;e&&-1!==e.indexOf("url(")&&t.style("fill",e.replace(u,"TOBESTRIPPED"))}),"pdf"!==e&&"eps"!==e||h.selectAll("#MathJax_SVG_glyphs path").attr("stroke-width",0),h.node().setAttributeNS(c.xmlns,"xmlns",c.svg),h.node().setAttributeNS(c.xmlns,"xmlns:xlink",c.xlink),"svg"===e&&r&&(h.attr("width",r*v),h.attr("height",r*y),h.attr("viewBox","0 0 "+v+" "+y));var k=(new window.XMLSerializer).serializeToString(h.node());return k=n(k),k=a(k),k=k.replace(f,"'"),o.isIE()&&(k=k.replace(/"/gi,"'"),k=k.replace(/(\('#)([^']*)('\))/gi,'("#$2")'),k=k.replace(/(\\')/gi,'"')),k}},{"../components/color":34,"../components/drawing":58,"../constants/xmlns_namespaces":135,"../lib":149,d3:7}],234:[function(t,e,r){"use strict";var n=t("../../lib").mergeArray;e.exports=function(t,e){n(e.text,t,"tx"),n(e.hovertext,t,"htx");var r=e.marker;if(r){n(r.opacity,t,"mo"),n(r.color,t,"mc");var a=r.line;a&&(n(a.color,t,"mlc"),n(a.width,t,"mlw"))}}},{"../../lib":149}],235:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),a=t("../../components/colorscale/color_attributes"),i=t("../../components/errorbars/attributes"),o=t("../../components/colorbar/attributes"),l=t("../../plots/font_attributes"),s=t("../../lib/extend").extendFlat,c=l({editType:"calc",arrayOk:!0}),u=n.marker,f=u.line,d=s({},f.width,{dflt:0}),p=s({width:d,editType:"calc"},a("marker.line")),h=s({line:p,editType:"calc"},a("marker"),{showscale:u.showscale,colorbar:o});e.exports={x:n.x,x0:n.x0,dx:n.dx,y:n.y,y0:n.y0,dy:n.dy,text:n.text,hovertext:n.hovertext,textposition:{valType:"enumerated",values:["inside","outside","auto","none"],dflt:"none",arrayOk:!0,editType:"calc"},textfont:s({},c,{}),insidetextfont:s({},c,{}),outsidetextfont:s({},c,{}),constraintext:{valType:"enumerated",values:["inside","outside","both","none"],dflt:"both",editType:"calc"},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:h,r:n.r,t:n.t,error_y:i,error_x:i,_deprecated:{bardir:{valType:"enumerated",editType:"calc",values:["v","h"]}}}},{"../../components/colorbar/attributes":35,"../../components/colorscale/color_attributes":41,"../../components/errorbars/attributes":60,"../../lib/extend":143,"../../plots/font_attributes":213,"../scatter/attributes":260}],236:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../plots/cartesian/axes"),i=t("../../components/colorscale/has_colorscale"),o=t("../../components/colorscale/calc"),l=t("./arrays_to_calcdata");e.exports=function(t,e){var r,s,c,u,f,d=a.getFromId(t,e.xaxis||"x"),p=a.getFromId(t,e.yaxis||"y"),h=e.orientation||(e.x&&!e.y?"h":"v");"h"===h?(r=d,c=d.makeCalcdata(e,"x"),s=p.makeCalcdata(e,"y"),f=e.xcalendar):(r=p,c=p.makeCalcdata(e,"y"),s=d.makeCalcdata(e,"x"),f=e.ycalendar);var g=Math.min(s.length,c.length),v=new Array(g);for(u=0;u<g;u++)v[u]={p:s[u],s:c[u]};var y,m=e.base;if(Array.isArray(m)){for(u=0;u<Math.min(m.length,v.length);u++)y=r.d2c(m[u],0,f),n(y)?(v[u].b=+y,v[u].hasB=1):v[u].b=0;for(;u<v.length;u++)v[u].b=0}else{y=r.d2c(m,0,f);var x=n(y);for(y=x?y:0,u=0;u<v.length;u++)v[u].b=y,x&&(v[u].hasB=1)}return i(e,"marker")&&o(e,e.marker.color,"marker","c"),i(e,"marker.line")&&o(e,e.marker.line.color,"marker.line","c"),l(v,e),v}},{"../../components/colorscale/calc":40,"../../components/colorscale/has_colorscale":47,"../../plots/cartesian/axes":189,"./arrays_to_calcdata":234,"fast-isnumeric":10}],237:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../components/color"),i=t("../scatter/xy_defaults"),o=t("../bar/style_defaults"),l=t("../../components/errorbars/defaults"),s=t("./attributes");e.exports=function(t,e,r,c){function u(r,a){return n.coerce(t,e,s,r,a)}var f=n.coerceFont;if(!i(t,e,c,u))return void(e.visible=!1);u("orientation",e.x&&!e.y?"h":"v"),u("base"),u("offset"),u("width"),u("text"),u("hovertext");var d=u("textposition"),p=Array.isArray(d)||"auto"===d,h=p||"inside"===d,g=p||"outside"===d;if(h||g){var v=f(u,"textfont",c.font);h&&f(u,"insidetextfont",v),g&&f(u,"outsidetextfont",v),u("constraintext")}o(t,e,u,r,c),l(t,e,a.defaultLine,{axis:"y"}),l(t,e,a.defaultLine,{axis:"x",inherit:"y"})}},{"../../components/color":34,"../../components/errorbars/defaults":63,"../../lib":149,"../bar/style_defaults":247,"../scatter/xy_defaults":283,"./attributes":235}],238:[function(t,e,r){"use strict";var n=t("../../components/fx"),a=t("../../components/errorbars"),i=t("../../components/color"),o=t("../scatter/fill_hover_text");e.exports=function(t,e,r,l){var s,c,u,f,d,p,h,g=t.cd,v=g[0].trace,y=g[0].t,m=t.xa,x=t.ya,b=function(t){return n.inbox(f(t)-s,d(t)-s)};"h"===v.orientation?(s=r,c=function(t){return t.y-t.w/2},u=function(t){return t.y+t.w/2},p=function(t){return n.inbox(t.b-e,t.x-e)+(t.x-e)/(t.x-t.b)},h=b):(s=e,c=function(t){return t.x-t.w/2},u=function(t){return t.x+t.w/2},h=function(t){return n.inbox(t.b-r,t.y-r)+(t.y-r)/(t.y-t.b)},p=b),f="closest"===l?c:function(t){return Math.min(c(t),t.p-y.bargroupwidth/2)},d="closest"===l?u:function(t){return Math.max(u(t),t.p+y.bargroupwidth/2)};var _=n.getDistanceFunction(l,p,h);if(n.getClosest(g,_,t),!1!==t.index){var w=t.index,k=g[w],M=k.mcc||v.marker.color,A=k.mlcc||v.marker.line.color,T=k.mlw||v.marker.line.width;i.opacity(M)?t.color=M:i.opacity(A)&&T&&(t.color=A);var L=v.base?k.b+k.s:k.s;return"h"===v.orientation?(t.x0=t.x1=m.c2p(k.x,!0),t.xLabelVal=L,t.y0=x.c2p(f(k),!0),t.y1=x.c2p(d(k),!0),t.yLabelVal=k.p):(t.y0=t.y1=x.c2p(k.y,!0),t.yLabelVal=L,t.x0=m.c2p(f(k),!0),t.x1=m.c2p(d(k),!0),t.xLabelVal=k.p),o(k,v,t),a.hoverInfo(k,v,t),[t]}}},{"../../components/color":34,"../../components/errorbars":64,"../../components/fx":75,"../scatter/fill_hover_text":267}],239:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.layoutAttributes=t("./layout_attributes"),n.supplyDefaults=t("./defaults"),n.supplyLayoutDefaults=t("./layout_defaults"),n.calc=t("./calc"),n.setPositions=t("./set_positions"),n.colorbar=t("../scatter/colorbar"),n.arraysToCalcdata=t("./arrays_to_calcdata"),n.plot=t("./plot"),n.style=t("./style"),n.hoverPoints=t("./hover"),n.selectPoints=t("./select"),n.moduleType="trace",n.name="bar",n.basePlotModule=t("../../plots/cartesian"),n.categories=["cartesian","bar","oriented","markerColorscale","errorBarsOK","showLegend"],n.meta={},e.exports=n},{"../../plots/cartesian":199,"../scatter/colorbar":263,"./arrays_to_calcdata":234,"./attributes":235,"./calc":236,"./defaults":237,"./hover":238,"./layout_attributes":240,"./layout_defaults":241,"./plot":242,"./select":243,"./set_positions":244,"./style":246}],240:[function(t,e,r){"use strict";e.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"}}},{}],241:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../plots/cartesian/axes"),i=t("../../lib"),o=t("./layout_attributes");e.exports=function(t,e,r){function l(r,n){return i.coerce(t,e,o,r,n)}for(var s=!1,c=!1,u=!1,f={},d=0;d<r.length;d++){var p=r[d];if(n.traceIs(p,"bar")){if(s=!0,"overlay"!==t.barmode&&"stack"!==t.barmode){var h=p.xaxis+p.yaxis;f[h]&&(u=!0),f[h]=!0}if(p.visible&&"histogram"===p.type){"category"!==a.getFromId({_fullLayout:e},p["v"===p.orientation?"xaxis":"yaxis"]).type&&(c=!0)}}}if(s){"overlay"!==l("barmode")&&l("barnorm"),l("bargap",c&&!u?0:.2),l("bargroupgap")}}},{"../../lib":149,"../../plots/cartesian/axes":189,"../../registry":225,"./layout_attributes":240}],242:[function(t,e,r){"use strict";function n(t,e,r,n,o,d,p,h){function g(e,r,n){return e.append("text").text(r).attr({class:"bartext",transform:"","text-anchor":"middle","data-notex":1}).call(M.font,n).call(w.convertToTspans,t)}var v=r[0].trace,y=v.orientation,m=l(v,n);if(m){var x=s(v,n);if("none"!==x){var b,_,k,A,T=c(v,n,t._fullLayout.font),L=u(v,n,T),C=f(v,n,T),S=t._fullLayout.barmode,O="stack"===S,z="relative"===S,P=O||z,E=r[n],N=!P||E._outmost,I=Math.abs(d-o)-2*D,R=Math.abs(h-p)-2*D;if("outside"===x&&(N||(x="inside")),"auto"===x)if(N){b=g(e,m,L),_=M.bBox(b.node()),k=_.width,A=_.height;var F=k>0&&A>0,j=k<=I&&A<=R,B=k<=R&&A<=I,q="h"===y?I>=k*(R/A):R>=A*(I/k);F&&(j||B||q)?x="inside":(x="outside",b.remove(),b=null)}else x="inside";if(!b&&(b=g(e,m,"outside"===x?C:L),_=M.bBox(b.node()),k=_.width,A=_.height,k<=0||A<=0))return void b.remove();var H,V;"outside"===x?(V="both"===v.constraintext||"outside"===v.constraintext,H=i(o,d,p,h,_,y,V)):(V="both"===v.constraintext||"inside"===v.constraintext,H=a(o,d,p,h,_,y,V)),b.attr("transform",H)}}}function a(t,e,r,n,a,i,l){var s,c,u,f,d,p=a.width,h=a.height,g=(a.left+a.right)/2,v=(a.top+a.bottom)/2,y=Math.abs(e-t),m=Math.abs(n-r);y>2*D&&m>2*D?(d=D,y-=2*d,m-=2*d):d=0;var x,b;return p<=y&&h<=m?(x=!1,b=1):p<=m&&h<=y?(x=!0,b=1):p<h==y<m?(x=!1,b=l?Math.min(y/p,m/h):1):(x=!0,b=l?Math.min(m/p,y/h):1),x&&(x=90),x?(s=b*h,c=b*p):(s=b*p,c=b*h),"h"===i?e<t?(u=e+d+s/2,f=(r+n)/2):(u=e-d-s/2,f=(r+n)/2):n>r?(u=(t+e)/2,f=n-d-c/2):(u=(t+e)/2,f=n+d+c/2),o(g,v,u,f,b,x)}function i(t,e,r,n,a,i,l){var s,c="h"===i?Math.abs(n-r):Math.abs(e-t);c>2*D&&(s=D);var u=1;l&&(u="h"===i?Math.min(1,c/a.height):Math.min(1,c/a.width));var f,d,p,h,g=(a.left+a.right)/2,v=(a.top+a.bottom)/2;return f=u*a.width,d=u*a.height,"h"===i?e<t?(p=e-s-f/2,h=(r+n)/2):(p=e+s+f/2,h=(r+n)/2):n>r?(p=(t+e)/2,h=n+s+d/2):(p=(t+e)/2,h=n-s-d/2),o(g,v,p,h,u,!1)}function o(t,e,r,n,a,i){var o,l;return a<1?o="scale("+a+") ":(a=1,o=""),l=i?"rotate("+i+" "+t+" "+e+") ":"","translate("+(r-a*t)+" "+(n-a*e)+")"+o+l}function l(t,e){var r=p(t.text,e);return h(L,r)}function s(t,e){var r=p(t.textposition,e);return g(C,r)}function c(t,e,r){return d(S,t.textfont,e,r)}function u(t,e,r){return d(O,t.insidetextfont,e,r)}function f(t,e,r){return d(z,t.outsidetextfont,e,r)}function d(t,e,r,n){e=e||{};var a=p(e.family,r),i=p(e.size,r),o=p(e.color,r);return{family:h(t.family,a,n.family),size:v(t.size,i,n.size),color:y(t.color,o,n.color)}}function p(t,e){var r;return Array.isArray(t)?e<t.length&&(r=t[e]):r=t,r}function h(t,e,r){if("string"==typeof e){if(e||!t.noBlank)return e}else if("number"==typeof e&&!t.strict)return String(e);return void 0!==r?r:t.dflt}function g(t,e,r){return t.coerceNumber&&(e=+e),-1!==t.values.indexOf(e)?e:void 0!==r?r:t.dflt}function v(t,e,r){if(x(e)){e=+e;var n=t.min,a=t.max;if(!(void 0!==n&&e<n||void 0!==a&&e>a))return e}return void 0!==r?r:t.dflt}function y(t,e,r){return b(e).isValid()?e:void 0!==r?r:t.dflt}var m=t("d3"),x=t("fast-isnumeric"),b=t("tinycolor2"),_=t("../../lib"),w=t("../../lib/svg_text_utils"),k=t("../../components/color"),M=t("../../components/drawing"),A=t("../../components/errorbars"),T=t("./attributes"),L=T.text,C=T.textposition,S=T.textfont,O=T.insidetextfont,z=T.outsidetextfont,D=3;e.exports=function(t,e,r){var a=e.xaxis,i=e.yaxis,o=t._fullLayout,l=e.plot.select(".barlayer").selectAll("g.trace.bars").data(r);l.enter().append("g").attr("class","trace bars"),l.append("g").attr("class","points").each(function(e){var r=e[0].node3=m.select(this),l=e[0].t,s=e[0].trace,c=l.poffset,u=Array.isArray(c);r.selectAll("g.point").data(_.identity).enter().append("g").classed("point",!0).each(function(r,l){function f(t){return 0===o.bargap&&0===o.bargroupgap?m.round(Math.round(t)-A,2):t}function d(t,e){return Math.abs(t-e)>=2?f(t):t>e?Math.ceil(t):Math.floor(t)}var p,h,g,v,y=r.p+(u?c[l]:c),b=y+r.w,_=r.b,w=_+r.s;if("h"===s.orientation?(g=i.c2p(y,!0),v=i.c2p(b,!0),p=a.c2p(_,!0),h=a.c2p(w,!0),r.ct=[h,(g+v)/2]):(p=a.c2p(y,!0),h=a.c2p(b,!0),g=i.c2p(_,!0),v=i.c2p(w,!0),r.ct=[(p+h)/2,v]),!(x(p)&&x(h)&&x(g)&&x(v)&&p!==h&&g!==v))return void m.select(this).remove();var M=(r.mlw+1||s.marker.line.width+1||(r.trace?r.trace.marker.line.width:0)+1)-1,A=m.round(M/2%1,2);if(!t._context.staticPlot){var T=k.opacity(r.mc||s.marker.color),L=T<1||M>.01?f:d;p=L(p,h),h=L(h,p),g=L(g,v),v=L(v,g)}var C=m.select(this);C.append("path").style("vector-effect","non-scaling-stroke").attr("d","M"+p+","+g+"V"+v+"H"+h+"V"+g+"Z"),n(t,C,e,l,p,h,g,v)})}),l.call(A.plot,e)}},{"../../components/color":34,"../../components/drawing":58,"../../components/errorbars":64,"../../lib":149,"../../lib/svg_text_utils":169,"./attributes":235,d3:7,"fast-isnumeric":10,tinycolor2:16}],243:[function(t,e,r){"use strict";var n=t("../../constants/interactions").DESELECTDIM;e.exports=function(t,e){var r,a=t.cd,i=[],o=a[0].node3;if(!1===e)for(r=0;r<a.length;r++)a[r].dim=0;else for(r=0;r<a.length;r++){var l=a[r];e.contains(l.ct)?(i.push({pointNumber:r,x:l.x,y:l.y}),l.dim=0):l.dim=1}return o.selectAll(".point").style("opacity",function(t){return t.dim?n:1}),o.selectAll("text").style("opacity",function(t){return t.dim?n:1}),i}},{"../../constants/interactions":132}],244:[function(t,e,r){"use strict";function n(t,e,r,n){if(n.length){var l,s,c,u,f,d=t._fullLayout.barmode,p="overlay"===d,h="group"===d;if(p)a(t,e,r,n);else if(h){for(l=[],s=[],c=0;c<n.length;c++)u=n[c],f=u[0].trace,void 0===f.offset?s.push(u):l.push(u);s.length&&i(t,e,r,s),l.length&&a(t,e,r,l)}else{for(l=[],s=[],c=0;c<n.length;c++)u=n[c],f=u[0].trace,void 0===f.base?s.push(u):l.push(u);s.length&&o(t,e,r,s),l.length&&a(t,e,r,l)}}}function a(t,e,r,n){for(var a=t._fullLayout.barnorm,i=!a,o=0;o<n.length;o++){var s=n[o],c=new w([s],!1,i);l(t,e,c),a?(g(t,r,c),v(t,r,c)):p(t,r,c)}}function i(t,e,r,n){var a=t._fullLayout,i=a.barnorm,o=!i,l=new w(n,!1,o);s(t,e,l),i?(g(t,r,l),v(t,r,l)):p(t,r,l)}function o(t,e,r,n){var a=t._fullLayout,i=a.barmode,o="stack"===i,s="relative"===i,c=t._fullLayout.barnorm,u=s,f=!(c||o||s),d=new w(n,u,f);l(t,e,d),h(t,r,d);for(var p=0;p<n.length;p++)for(var g=n[p],y=0;y<g.length;y++){var m=g[y];if(m.s!==x){var b=m.b+m.s===d.get(m.p,m.s);b&&(m._outmost=!0)}}c&&v(t,r,d)}function l(t,e,r){var n,a,i,o,l=t._fullLayout,s=l.bargap,d=l.bargroupgap,p=r.minDiff,h=r.traces,g=p*(1-s),v=g,y=v*(1-d),m=-y/2;for(n=0;n<h.length;n++)a=h[n],i=a[0],o=i.t,o.barwidth=y,o.poffset=m,o.bargroupwidth=g;r.binWidth=h[0][0].t.barwidth/100,c(r),u(t,e,r),f(t,e,r)}function s(t,e,r){var n,a,i,o,l=t._fullLayout,s=l.bargap,d=l.bargroupgap,p=r.positions,h=r.distinctPositions,g=r.minDiff,v=r.traces,y=p.length!==h.length,m=v.length,x=g*(1-s),b=y?x/m:x,_=b*(1-d);for(n=0;n<m;n++){a=v[n],i=a[0];var w=y?((2*n+1-m)*b-_)/2:-_/2;o=i.t,o.barwidth=_,o.poffset=w,o.bargroupwidth=x}r.binWidth=v[0][0].t.barwidth/100,c(r),u(t,e,r),f(t,e,r,y)}function c(t){var e,r,n,a,i,o,l=t.traces;for(e=0;e<l.length;e++){r=l[e],n=r[0],a=n.trace,o=n.t;var s,c=a.offset,u=o.poffset;if(Array.isArray(c)){for(s=c.slice(0,r.length),i=0;i<s.length;i++)m(s[i])||(s[i]=u);for(i=s.length;i<r.length;i++)s.push(u);o.poffset=s}else void 0!==c&&(o.poffset=c);var f=a.width,d=o.barwidth;if(Array.isArray(f)){var p=f.slice(0,r.length);for(i=0;i<p.length;i++)m(p[i])||(p[i]=d);for(i=p.length;i<r.length;i++)p.push(d);if(o.barwidth=p,void 0===c){for(s=[],i=0;i<r.length;i++)s.push(u+(d-p[i])/2);o.poffset=s}}else void 0!==f&&(o.barwidth=f,void 0===c&&(o.poffset=u+(d-f)/2))}}function u(t,e,r){for(var n=r.traces,a=y(e),i=0;i<n.length;i++)for(var o=n[i],l=o[0].t,s=l.poffset,c=Array.isArray(s),u=l.barwidth,f=Array.isArray(u),d=0;d<o.length;d++){var p=o[d],h=p.w=f?u[d]:u;p[a]=p.p+(c?s[d]:s)+h/2}}function f(t,e,r,n){var a=r.traces,i=r.distinctPositions,o=i[0],l=r.minDiff,s=l/2;_.minDtick(e,l,o,n);for(var c=Math.min.apply(Math,i)-s,u=Math.max.apply(Math,i)+s,f=0;f<a.length;f++){var d=a[f],p=d[0],h=p.trace;if(void 0!==h.width||void 0!==h.offset)for(var g=p.t,v=g.poffset,y=g.barwidth,m=Array.isArray(v),x=Array.isArray(y),b=0;b<d.length;b++){var w=d[b],k=m?v[b]:v,M=x?y[b]:y,A=w.p,T=A+k,L=T+M;c=Math.min(c,T),u=Math.max(u,L)}}_.expand(e,[c,u],{padded:!1})}function d(t,e){m(t[0])?t[0]=Math.min(t[0],e):t[0]=e,m(t[1])?t[1]=Math.max(t[1],e):t[1]=e}function p(t,e,r){for(var n=r.traces,a=y(e),i=[null,null],o=0;o<n.length;o++)for(var l=n[o],s=0;s<l.length;s++){var c=l[s],u=c.b,f=u+c.s;c[a]=f,m(e.c2l(f))&&d(i,f),c.hasB&&m(e.c2l(u))&&d(i,u)}_.expand(e,i,{tozero:!0,padded:!0})}function h(t,e,r){var n,a,i,o,l=t._fullLayout,s=l.barnorm,c=y(e),u=r.traces,f=[null,null];for(n=0;n<u.length;n++)for(a=u[n],i=0;i<a.length;i++)if(o=a[i],o.s!==x){var p=r.put(o.p,o.b+o.s),h=p+o.b+o.s;o.b=p,o[c]=h,s||(m(e.c2l(h))&&d(f,h),o.hasB&&m(e.c2l(p))&&d(f,p))}s||_.expand(e,f,{tozero:!0,padded:!0})}function g(t,e,r){for(var n=r.traces,a=0;a<n.length;a++)for(var i=n[a],o=0;o<i.length;o++){var l=i[o];l.s!==x&&r.put(l.p,l.b+l.s)}}function v(t,e,r){function n(t){m(e.c2l(t))&&(t<s-l||t>c+l||!m(s))&&(f=!0,d(u,t))}for(var a=r.traces,i=y(e),o="fraction"===t._fullLayout.barnorm?1:100,l=o/1e9,s=e.l2c(e.c2l(0)),c="stack"===t._fullLayout.barmode?o:s,u=[s,c],f=!1,p=0;p<a.length;p++)for(var h=a[p],g=0;g<h.length;g++){var v=h[g];if(v.s!==x){var b=Math.abs(o/r.get(v.p,v.s));v.b*=b,v.s*=b;var w=v.b,k=w+v.s;v[i]=k,n(k),v.hasB&&n(w)}}_.expand(e,u,{tozero:!0,padded:f})}function y(t){return t._id.charAt(0)}var m=t("fast-isnumeric"),x=t("../../constants/numerical").BADNUM,b=t("../../registry"),_=t("../../plots/cartesian/axes"),w=t("./sieve.js");e.exports=function(t,e){var r,a=e.xaxis,i=e.yaxis,o=t._fullData,l=t.calcdata,s=[],c=[];for(r=0;r<o.length;r++){var u=o[r];!0===u.visible&&b.traceIs(u,"bar")&&u.xaxis===a._id&&u.yaxis===i._id&&("h"===u.orientation?s.push(l[r]):c.push(l[r]))}n(t,a,i,c),n(t,i,a,s)}},{"../../constants/numerical":133,"../../plots/cartesian/axes":189,"../../registry":225,"./sieve.js":245,"fast-isnumeric":10}],245:[function(t,e,r){"use strict";function n(t,e,r){this.traces=t,this.separateNegativeValues=e,this.dontMergeOverlappingData=r;for(var n=1/0,o=[],l=0;l<t.length;l++){for(var s=t[l],c=0;c<s.length;c++){var u=s[c];u.p!==i&&o.push(u.p)}s[0]&&s[0].width1&&(n=Math.min(s[0].width1,n))}this.positions=o;var f=a.distinctVals(o);this.distinctPositions=f.vals,1===f.vals.length&&n!==1/0?this.minDiff=n:this.minDiff=Math.min(f.minDiff,n),this.binWidth=this.minDiff,this.bins={}}e.exports=n;var a=t("../../lib"),i=t("../../constants/numerical").BADNUM;n.prototype.put=function(t,e){var r=this.getLabel(t,e),n=this.bins[r]||0;return this.bins[r]=n+e,n},n.prototype.get=function(t,e){var r=this.getLabel(t,e);return this.bins[r]||0},n.prototype.getLabel=function(t,e){return(e<0&&this.separateNegativeValues?"v":"^")+(this.dontMergeOverlappingData?t:Math.round(t/this.binWidth))}},{"../../constants/numerical":133,"../../lib":149}],246:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../components/color"),i=t("../../components/drawing"),o=t("../../components/errorbars");e.exports=function(t){var e=n.select(t).selectAll("g.trace.bars"),r=e.size(),l=t._fullLayout;e.style("opacity",function(t){return t[0].trace.opacity}).each(function(t){("stack"===l.barmode&&r>1||0===l.bargap&&0===l.bargroupgap&&!t[0].trace.marker.line.width)&&n.select(this).attr("shape-rendering","crispEdges")}),e.selectAll("g.points").each(function(t){var e=t[0].trace,r=e.marker,o=r.line,l=i.tryColorscale(r,""),s=i.tryColorscale(r,"line");n.select(this).selectAll("path").each(function(t){var e,i,c=(t.mlw+1||o.width+1)-1,u=n.select(this);e="mc"in t?t.mcc=l(t.mc):Array.isArray(r.color)?a.defaultLine:r.color,u.style("stroke-width",c+"px").call(a.fill,e),c&&(i="mlc"in t?t.mlcc=s(t.mlc):Array.isArray(o.color)?a.defaultLine:o.color,u.call(a.stroke,i))})}),e.call(o.style)}},{"../../components/color":34,"../../components/drawing":58,"../../components/errorbars":64,d3:7}],247:[function(t,e,r){"use strict";var n=t("../../components/color"),a=t("../../components/colorscale/has_colorscale"),i=t("../../components/colorscale/defaults");e.exports=function(t,e,r,o,l){r("marker.color",o),a(t,"marker")&&i(t,e,l,r,{prefix:"marker.",cLetter:"c"}),r("marker.line.color",n.defaultLine),a(t,"marker.line")&&i(t,e,l,r,{prefix:"marker.line.",cLetter:"c"}),r("marker.line.width")}},{"../../components/color":34,"../../components/colorscale/defaults":43,"../../components/colorscale/has_colorscale":47}],248:[function(t,e,r){"use strict";var n=t("../../components/color/attributes"),a=t("../../plots/font_attributes"),i=t("../../plots/attributes"),o=t("../../lib/extend").extendFlat,l=a({editType:"calc",colorEditType:"style"});e.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:n.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:"calc"},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:o({},i.hoverinfo,{flags:["label","text","value","percent","name"]}),textposition:{valType:"enumerated",values:["inside","outside","auto","none"],dflt:"auto",arrayOk:!0,editType:"calc"},textfont:o({},l,{}),insidetextfont:o({},l,{}),outsidetextfont:o({},l,{}),domain:{x:{valType:"info_array",items:[{valType:"number",min:0,max:1,editType:"calc"},{valType:"number",min:0,max:1,editType:"calc"}],dflt:[0,1],editType:"calc"},y:{valType:"info_array",items:[{valType:"number",min:0,max:1,editType:"calc"},{valType:"number",min:0,max:1,editType:"calc"}],dflt:[0,1],editType:"calc"},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"}}},{"../../components/color/attributes":33,"../../lib/extend":143,"../../plots/attributes":187,"../../plots/font_attributes":213}],249:[function(t,e,r){"use strict";function n(t,e){for(var r=[],n=0;n<t.length;n++){var a=t[n],i=a[0].trace;i._module===e&&!0===i.visible&&r.push(a)}return r}var a=t("../../registry");r.name="pie",r.plot=function(t){var e=a.getModule("pie"),r=n(t.calcdata,e);r.length&&e.plot(t,r)},r.clean=function(t,e,r,n){var a=n._has&&n._has("pie"),i=e._has&&e._has("pie");a&&!i&&n._pielayer.selectAll("g.trace").remove()}},{"../../registry":225}],250:[function(t,e,r){"use strict";function n(t){if(!s){var e=o.defaults;s=e.slice();var r;for(r=0;r<e.length;r++)s.push(i(e[r]).lighten(20).toHexString());for(r=0;r<o.defaults.length;r++)s.push(i(e[r]).darken(20).toHexString())}return s[t%s.length]}var a=t("fast-isnumeric"),i=t("tinycolor2"),o=t("../../components/color"),l=t("./helpers");e.exports=function(t,e){var r,s,c,u,f,d,p=e.values,h=e.labels,g=[],v=t._fullLayout,y=v._piecolormap,m={},x=!1,b=0,_=v.hiddenlabels||[];if(e.dlabel)for(h=new Array(p.length),r=0;r<p.length;r++)h[r]=String(e.label0+r*e.dlabel);for(r=0;r<p.length;r++)s=p[r],a(s)&&((s=+s)<0||(c=h[r],void 0!==c&&""!==c||(c=r),c=String(c),void 0===m[c]&&(m[c]=!0,u=i(e.marker.colors[r]),u.isValid()?(u=o.addOpacity(u,u.getAlpha()),y[c]||(y[c]=u)):y[c]?u=y[c]:(u=!1,x=!0),f=-1!==_.indexOf(c),f||(b+=s),g.push({v:s,label:c,color:u,i:r,hidden:f}))));if(e.sort&&g.sort(function(t,e){return e.v-t.v}),x)for(r=0;r<g.length;r++)d=g[r],!1===d.color&&(y[d.label]=d.color=n(v._piedefaultcolorcount),v._piedefaultcolorcount++);if(g[0]&&(g[0].vTotal=b),e.textinfo&&"none"!==e.textinfo){var w,k=-1!==e.textinfo.indexOf("label"),M=-1!==e.textinfo.indexOf("text"),A=-1!==e.textinfo.indexOf("value"),T=-1!==e.textinfo.indexOf("percent"),L=v.separators;for(r=0;r<g.length;r++)d=g[r],w=k?[d.label]:[],M&&e.text[d.i]&&w.push(e.text[d.i]),A&&w.push(l.formatPieValue(d.v,L)),T&&w.push(l.formatPiePercent(d.v/b,L)),d.text=w.join("
")}return g};var s},{"../../components/color":34,"./helpers":252,"fast-isnumeric":10,tinycolor2:16}],251:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./attributes");e.exports=function(t,e,r,i){function o(r,i){return n.coerce(t,e,a,r,i)}var l=n.coerceFont,s=o("values");if(!Array.isArray(s)||!s.length)return void(e.visible=!1);var c=o("labels");Array.isArray(c)||(o("label0"),o("dlabel")),o("marker.line.width")&&o("marker.line.color");var u=o("marker.colors");Array.isArray(u)||(e.marker.colors=[]),o("scalegroup");var f=o("text"),d=o("textinfo",Array.isArray(f)?"text+percent":"percent");if(o("hovertext"),d&&"none"!==d){var p=o("textposition"),h=Array.isArray(p)||"auto"===p,g=h||"inside"===p,v=h||"outside"===p;if(g||v){var y=l(o,"textfont",i.font);g&&l(o,"insidetextfont",y),v&&l(o,"outsidetextfont",y)}}o("domain.x"),o("domain.y"),o("hole"),o("sort"),o("direction"),o("rotation"),o("pull")}},{"../../lib":149,"./attributes":248}],252:[function(t,e,r){"use strict";var n=t("../../lib");r.formatPiePercent=function(t,e){var r=(100*t).toPrecision(3);return-1!==r.lastIndexOf(".")&&(r=r.replace(/[.]?0+$/,"")),n.numSeparate(r,e)+"%"},r.formatPieValue=function(t,e){var r=t.toPrecision(10);return-1!==r.lastIndexOf(".")&&(r=r.replace(/[.]?0+$/,"")),n.numSeparate(r,e)}},{"../../lib":149}],253:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.supplyLayoutDefaults=t("./layout_defaults"),n.layoutAttributes=t("./layout_attributes"),n.calc=t("./calc"),n.plot=t("./plot"),n.style=t("./style"),n.styleOne=t("./style_one"),n.moduleType="trace",n.name="pie",n.basePlotModule=t("./base_plot"),n.categories=["pie","showLegend"],n.meta={},e.exports=n},{"./attributes":248,"./base_plot":249,"./calc":250,"./defaults":251,"./layout_attributes":254,"./layout_defaults":255,"./plot":256,"./style":257,"./style_one":258}],254:[function(t,e,r){"use strict";e.exports={hiddenlabels:{valType:"data_array",editType:"calc"}}},{}],255:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./layout_attributes");e.exports=function(t,e){!function(r,i){n.coerce(t,e,a,r,i)}("hiddenlabels")}},{"../../lib":149,"./layout_attributes":254}],256:[function(t,e,r){"use strict";function n(t,e,r){var n=Math.sqrt(t.width*t.width+t.height*t.height),i=t.width/t.height,o=Math.PI*Math.min(e.v/r.vTotal,.5),l=1-r.trace.hole,s=a(e,r),c={scale:s*r.r*2/n,rCenter:1-s,rotate:0};if(c.scale>=1)return c;var u=i+1/(2*Math.tan(o)),f=r.r*Math.min(1/(Math.sqrt(u*u+.5)+u),l/(Math.sqrt(i*i+l/2)+i)),d={scale:2*f/t.height,rCenter:Math.cos(f/r.r)-f*i/r.r,rotate:(180/Math.PI*e.midangle+720)%180-90},p=1/i,h=p+1/(2*Math.tan(o)),g=r.r*Math.min(1/(Math.sqrt(h*h+.5)+h),l/(Math.sqrt(p*p+l/2)+p)),v={scale:2*g/t.width,rCenter:Math.cos(g/r.r)-g/i/r.r,rotate:(180/Math.PI*e.midangle+810)%180-90},y=v.scale>d.scale?v:d;return c.scale<1&&y.scale>c.scale?y:c}function a(t,e){if(t.v===e.vTotal&&!e.trace.hole)return 1;var r=Math.PI*Math.min(t.v/e.vTotal,.5);return Math.min(1/(1+1/Math.sin(r)),(1-e.trace.hole)/2)}function i(t,e){var r=e.pxmid[0],n=e.pxmid[1],a=t.width/2,i=t.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(t,e){function r(t,e){return t.pxmid[1]-e.pxmid[1]}function n(t,e){return e.pxmid[1]-t.pxmid[1]}var a,i,o,l,s,c,u,f,d,p,h,g,v;for(i=0;i<2;i++)for(o=i?r:n,s=i?Math.max:Math.min,u=i?1:-1,a=0;a<2;a++){for(l=a?Math.max:Math.min,c=a?1:-1,f=t[i][a],f.sort(o),d=t[1-i][a],p=d.concat(f),g=[],h=0;h<f.length;h++)void 0!==f[h].yLabelMid&&g.push(f[h]);for(v=!1,h=0;i&&h<d.length;h++)if(void 0!==d[h].yLabelMid){v=d[h];break}for(h=0;h<g.length;h++){var y=h&&g[h-1];v&&!h&&(y=v),function(t,r){r||(r={});var n,a,o,f,d,h,g=r.labelExtraY+(i?r.yLabelMax:r.yLabelMin),v=i?t.yLabelMin:t.yLabelMax,y=i?t.yLabelMax:t.yLabelMin,m=t.cyFinal+s(t.px0[1],t.px1[1]),x=g-v;if(x*u>0&&(t.labelExtraY=x),Array.isArray(e.pull))for(a=0;a<p.length;a++)(o=p[a])===t||(e.pull[t.i]||0)>=e.pull[o.i]||((t.pxmid[1]-o.pxmid[1])*u>0?(f=o.cyFinal+s(o.px0[1],o.px1[1]),(x=f-v-t.labelExtraY)*u>0&&(t.labelExtraY+=x)):(y+t.labelExtraY-m)*u>0&&(n=3*c*Math.abs(a-p.indexOf(t)),d=o.cxFinal+l(o.px0[0],o.px1[0]),(h=d+n-(t.cxFinal+t.pxmid[0])-t.labelExtraX)*c>0&&(t.labelExtraX+=h)))}(g[h],y)}}}function l(t,e){var r,n,a,i,o,l,s,u,f,d,p=[];for(a=0;a<t.length;a++){if(o=t[a][0],l=o.trace,r=e.w*(l.domain.x[1]-l.domain.x[0]),n=e.h*(l.domain.y[1]-l.domain.y[0]),s=l.tiltaxis*Math.PI/180,u=l.pull,Array.isArray(u))for(u=0,i=0;i<l.pull.length;i++)l.pull[i]>u&&(u=l.pull[i]);o.r=Math.min(r/c(l.tilt,Math.sin(s),l.depth),n/c(l.tilt,Math.cos(s),l.depth))/(2+2*u),o.cx=e.l+e.w*(l.domain.x[1]+l.domain.x[0])/2,o.cy=e.t+e.h*(2-l.domain.y[1]-l.domain.y[0])/2,l.scalegroup&&-1===p.indexOf(l.scalegroup)&&p.push(l.scalegroup)}for(i=0;i<p.length;i++){for(d=1/0,f=p[i],a=0;a<t.length;a++)o=t[a][0],o.trace.scalegroup===f&&(d=Math.min(d,o.r*o.r/o.vTotal));for(a=0;a<t.length;a++)o=t[a][0],o.trace.scalegroup===f&&(o.r=Math.sqrt(d*o.vTotal))}}function s(t){function e(t){var e=f.r*Math.sin(t),r=-f.r*Math.cos(t);return p?[e*(1-l*n*n)+r*o*l,e*o*l+r*(1-l*a*a),Math.sin(i)*(r*a-e*n)]:[e,r]}var r,n,a,i,o,l,s,c,u,f=t[0],d=f.trace,p=d.tilt,h=d.rotation*Math.PI/180,g=2*Math.PI/f.vTotal,v="px0",y="px1";if("counterclockwise"===d.direction){for(s=0;s<t.length&&t[s].hidden;s++);if(s===t.length)return;h+=g*t[s].v,g*=-1,v="px1",y="px0"}for(p&&(i=p*Math.PI/180,r=d.tiltaxis*Math.PI/180,o=Math.sin(r)*Math.cos(r),l=1-Math.cos(i),n=Math.sin(r),a=Math.cos(r)),u=e(h),s=0;s<t.length;s++)c=t[s],c.hidden||(c[v]=u,h+=g*c.v/2,c.pxmid=e(h),c.midangle=h,h+=g*c.v/2,u=e(h),c[y]=u,c.largeArc=c.v>f.vTotal/2?1:0)}function c(t,e,r){if(!t)return 1;var n=Math.sin(t*Math.PI/180);return Math.max(.01,r*n*Math.abs(e)+2*Math.sqrt(1-n*n*e*e))}var u=t("d3"),f=t("../../components/fx"),d=t("../../components/color"),p=t("../../components/drawing"),h=t("../../lib/svg_text_utils"),g=t("./helpers");e.exports=function(t,e){var r=t._fullLayout;l(e,r._size);var c=r._pielayer.selectAll("g.trace").data(e);c.enter().append("g").attr({"stroke-linejoin":"round",class:"trace"}),c.exit().remove(),c.order(),c.each(function(e){var l=u.select(this),c=e[0],v=c.trace,y=(v.depth||0)*c.r*Math.sin(0)/2,m=v.tiltaxis||0,x=m*Math.PI/180,b=[y*Math.sin(x),y*Math.cos(x)],_=c.r*Math.cos(0),w=l.selectAll("g.part").data(v.tilt?["top","sides"]:["top"]);w.enter().append("g").attr("class",function(t){return t+" part"}),w.exit().remove(),w.order(),s(e),l.selectAll(".top").each(function(){var l=u.select(this).selectAll("g.slice").data(e);l.enter().append("g").classed("slice",!0),l.exit().remove();var s=[[[],[]],[[],[]]],y=!1;l.each(function(e){function o(n){n.originalEvent=u.event;var i=t._fullLayout,o=t._fullData[v.index],l=f.castHoverinfo(o,i,e.i);if("all"===l&&(l="label+text+value+percent+name"),t._dragging||!1===i.hovermode||"none"===l||"skip"===l||!l)return void f.hover(t,n,"pie")

var s=a(e,c),d=w+e.pxmid[0]*(1-s),p=k+e.pxmid[1]*(1-s),h=r.separators,y=[];-1!==l.indexOf("label")&&y.push(e.label),-1!==l.indexOf("text")&&(o.hovertext?y.push(Array.isArray(o.hovertext)?o.hovertext[e.i]
o.hovertext):o.text&&o.text[e.i]&&y.push(o.text[e.i])),-1!==l.indexOf("value")&&y.push(g.formatPieValue(e.v,h)),-1!==l.indexOf("percent")&&y.push(g.formatPiePercent(e.v/c.vTotal,h)),f.loneHover({x0:d-s*c.r,x1:d+s*c.r,y:p,text:y.join("
"),name:-1!==l.indexOf("name")?o.name:void 0,idealAlign:e.pxmid[0]<0?"left":"right",color:f.castHoverOption(v,e.i,"bgcolor")||e.color,borderColor:f.castHoverOption(v,e.i,"bordercolor"),fontFamily:f.castHoverOption(v,e.i,"font.family"),fontSize:f.castHoverOption(v,e.i,"font.size"),fontColor:f.castHoverOption(v,e.i,"font.color")},{container:i._hoverlayer.node(),outerContainer:i._paper.node(),gd:t}),f.hover(t,n,"pie"),T=!0}function l(e){e.originalEvent=u.event,t.emit("plotly_unhover",{event:u.event,points:[e]}),T&&(f.loneUnhover(r._hoverlayer.node()),T=!1)}function d(){t._hoverdata=[e],t._hoverdata.trace=c.trace,f.click(t,u.event)}function x(t,r,n,a){return"a"+a*c.r+","+a*_+" "+m+" "+e.largeArc+(n?" 1 ":" 0 ")+a*(r[0]-t[0])+","+a*(r[1]-t[1])}if(e.hidden)return void u.select(this).selectAll("path,g").remove();e.pointNumber=e.i,e.curveNumber=v.index,s[e.pxmid[1]<0?0:1][e.pxmid[0]<0?0:1].push(e);var w=c.cx+b[0],k=c.cy+b[1],M=u.select(this),A=M.selectAll("path.surface").data([e]),T=!1;if(A.enter().append("path").classed("surface",!0).style({"pointer-events":"all"}),M.select("path.textline").remove(),M.on("mouseover",o).on("mouseout",l).on("click",d),v.pull){var L=+(Array.isArray(v.pull)?v.pull[e.i]:v.pull)||0;L>0&&(w+=L*e.pxmid[0],k+=L*e.pxmid[1])}e.cxFinal=w,e.cyFinal=k;var C=v.hole;if(e.v===c.vTotal){var S="M"+(w+e.px0[0])+","+(k+e.px0[1])+x(e.px0,e.pxmid,!0,1)+x(e.pxmid,e.px0,!0,1)+"Z";C?A.attr("d","M"+(w+C*e.px0[0])+","+(k+C*e.px0[1])+x(e.px0,e.pxmid,!1,C)+x(e.pxmid,e.px0,!1,C)+"Z"+S):A.attr("d",S)}else{var O=x(e.px0,e.px1,!0,1);if(C){var z=1-C;A.attr("d","M"+(w+C*e.px1[0])+","+(k+C*e.px1[1])+x(e.px1,e.px0,!1,C)+"l"+z*e.px0[0]+","+z*e.px0[1]+O+"Z")}else A.attr("d","M"+w+","+k+"l"+e.px0[0]+","+e.px0[1]+O+"Z")}var D=Array.isArray(v.textposition)?v.textposition[e.i]:v.textposition,P=M.selectAll("g.slicetext").data(e.text&&"none"!==D?[0]:[]);P.enter().append("g").classed("slicetext",!0),P.exit().remove(),P.each(function(){var r=u.select(this).selectAll("text").data([0]);r.enter().append("text").attr("data-notex",1),r.exit().remove(),r.text(e.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(p.font,"outside"===D?v.outsidetextfont:v.insidetextfont).call(h.convertToTspans,t);var a,o=p.bBox(r.node());"outside"===D?a=i(o,e):(a=n(o,e,c),"auto"===D&&a.scale<1&&(r.call(p.font,v.outsidetextfont),v.outsidetextfont.family===v.insidetextfont.family&&v.outsidetextfont.size===v.insidetextfont.size||(o=p.bBox(r.node())),a=i(o,e)));var l=w+e.pxmid[0]*a.rCenter+(a.x||0),s=k+e.pxmid[1]*a.rCenter+(a.y||0);a.outside&&(e.yLabelMin=s-o.height/2,e.yLabelMid=s,e.yLabelMax=s+o.height/2,e.labelExtraX=0,e.labelExtraY=0,y=!0),r.attr("transform","translate("+l+","+s+")"+(a.scale<1?"scale("+a.scale+")":"")+(a.rotate?"rotate("+a.rotate+")":"")+"translate("+-(o.left+o.right)/2+","+-(o.top+o.bottom)/2+")")})}),y&&o(s,v),l.each(function(t){if(t.labelExtraX||t.labelExtraY){var e=u.select(this),r=e.select("g.slicetext text");r.attr("transform","translate("+t.labelExtraX+","+t.labelExtraY+")"+r.attr("transform"));var n=t.cxFinal+t.pxmid[0],a=t.cyFinal+t.pxmid[1],i="M"+n+","+a,o=(t.yLabelMax-t.yLabelMin)*(t.pxmid[0]<0?-1:1)/4;if(t.labelExtraX){var l=t.labelExtraX*t.pxmid[1]/t.pxmid[0],s=t.yLabelMid+t.labelExtraY-(t.cyFinal+t.pxmid[1]);Math.abs(l)>Math.abs(s)?i+="l"+s*t.pxmid[0]/t.pxmid[1]+","+s+"H"+(n+t.labelExtraX+o):i+="l"+t.labelExtraX+","+l+"v"+(s-l)+"h"+o}else i+="V"+(t.yLabelMid+t.labelExtraY)+"h"+o;e.append("path").classed("textline",!0).call(d.stroke,v.outsidetextfont.color).attr({"stroke-width":Math.min(2,v.outsidetextfont.size/8),d:i,fill:"none"})}})})}),setTimeout(function(){c.selectAll("tspan").each(function(){var t=u.select(this);t.attr("dy")&&t.attr("dy",t.attr("dy"))})},0)}},{"../../components/color":34,"../../components/drawing":58,"../../components/fx":75,"../../lib/svg_text_utils":169,"./helpers":252,d3:7}],257:[function(t,e,r){"use strict";var n=t("d3"),a=t("./style_one");e.exports=function(t){t._fullLayout._pielayer.selectAll(".trace").each(function(t){var e=t[0],r=e.trace,i=n.select(this);i.style({opacity:r.opacity}),i.selectAll(".top path.surface").each(function(t){n.select(this).call(a,t,r)})})}},{"./style_one":258,d3:7}],258:[function(t,e,r){"use strict";var n=t("../../components/color");e.exports=function(t,e,r){var a=r.marker.line.color;Array.isArray(a)&&(a=a[e.i]||n.defaultLine);var i=r.marker.line.width||0;Array.isArray(i)&&(i=i[e.i]||0),t.style({"stroke-width":i}).call(n.fill,e.color).call(n.stroke,a)}},{"../../components/color":34}],259:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e){for(var r=0;r<t.length;r++)t[r].i=r;n.mergeArray(e.text,t,"tx"),n.mergeArray(e.hovertext,t,"htx"),n.mergeArray(e.customdata,t,"data"),n.mergeArray(e.textposition,t,"tp"),e.textfont&&(n.mergeArray(e.textfont.size,t,"ts"),n.mergeArray(e.textfont.color,t,"tc"),n.mergeArray(e.textfont.family,t,"tf"));var a=e.marker;if(a){n.mergeArray(a.size,t,"ms"),n.mergeArray(a.opacity,t,"mo"),n.mergeArray(a.symbol,t,"mx"),n.mergeArray(a.color,t,"mc");var i=a.line;a.line&&(n.mergeArray(i.color,t,"mlc"),n.mergeArray(i.width,t,"mlw"));var o=a.gradient;o&&"none"!==o.type&&(n.mergeArray(o.type,t,"mgt"),n.mergeArray(o.color,t,"mgc"))}}},{"../../lib":149}],260:[function(t,e,r){"use strict";var n=t("../../components/colorscale/color_attributes"),a=t("../../components/errorbars/attributes"),i=t("../../components/colorbar/attributes"),o=t("../../plots/font_attributes"),l=t("../../components/drawing/attributes").dash,s=t("../../components/drawing"),c=(t("./constants"),t("../../lib/extend").extendFlat);e.exports={x:{valType:"data_array",editType:"calc+clearAxisTypes"},x0:{valType:"any",dflt:0,editType:"calc+clearAxisTypes"},dx:{valType:"number",dflt:1,editType:"calc"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},y0:{valType:"any",dflt:0,editType:"calc+clearAxisTypes"},dy:{valType:"number",dflt:1,editType:"calc"},text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},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"},line:{color:{valType:"color",editType:"style"},width:{valType:"number",min:0,dflt:2,editType:"style"},shape:{valType:"enumerated",values:["linear","spline","hv","vh","hvh","vhv"],dflt:"linear",editType:"plot"},smoothing:{valType:"number",min:0,max:1.3,dflt:1,editType:"plot"},dash:c({},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"],dflt:"none",editType:"calc"},fillcolor:{valType:"color",editType:"style"},marker:c({symbol:{valType:"enumerated",values:s.symbolList,dflt:"circle",arrayOk:!0,editType:"style"},opacity:{valType:"number",min:0,max:1,arrayOk:!0,editType:"style"},size:{valType:"number",min:0,dflt:6,arrayOk:!0,editType:"calcIfAutorange"},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"},showscale:{valType:"boolean",dflt:!1,editType:"calc"},colorbar:i,line:c({width:{valType:"number",min:0,arrayOk:!0,editType:"style"},editType:"calc"},n("marker.line")),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"},n("marker")),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"},error_y:a,error_x:a}},{"../../components/colorbar/attributes":35,"../../components/colorscale/color_attributes":41,"../../components/drawing":58,"../../components/drawing/attributes":57,"../../components/errorbars/attributes":60,"../../lib/extend":143,"../../plots/font_attributes":213,"./constants":265}],261:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../plots/cartesian/axes"),i=t("../../constants/numerical").BADNUM,o=t("./subtypes"),l=t("./colorscale_calc"),s=t("./arrays_to_calcdata");e.exports=function(t,e){var r,c,u,f=a.getFromId(t,e.xaxis||"x"),d=a.getFromId(t,e.yaxis||"y"),p=f.makeCalcdata(e,"x"),h=d.makeCalcdata(e,"y"),g=Math.min(p.length,h.length);f._minDtick=0,d._minDtick=0,p.length>g&&p.splice(g,p.length-g),h.length>g&&h.splice(g,h.length-g);var v={padded:!0},y={padded:!0};if(o.hasMarkers(e)){if(r=e.marker,c=r.size,Array.isArray(c)){var m={type:"linear"};a.setConvert(m),c=m.makeCalcdata(e.marker,"size"),c.length>g&&c.splice(g,c.length-g)}var x,b=1.6*(e.marker.sizeref||1);x="area"===e.marker.sizemode?function(t){return Math.max(Math.sqrt((t||0)/b),3)}:function(t){return Math.max((t||0)/b,3)},v.ppad=y.ppad=Array.isArray(c)?c.map(x):x(c)}l(e),!("tozerox"===e.fill||"tonextx"===e.fill&&t.firstscatter)||p[0]===p[g-1]&&h[0]===h[g-1]?e.error_y.visible||-1===["tonexty","tozeroy"].indexOf(e.fill)&&(o.hasMarkers(e)||o.hasText(e))||(v.padded=!1,v.ppad=0):v.tozero=!0,!("tozeroy"===e.fill||"tonexty"===e.fill&&t.firstscatter)||p[0]===p[g-1]&&h[0]===h[g-1]?-1!==["tonextx","tozerox"].indexOf(e.fill)&&(y.padded=!1):y.tozero=!0,a.expand(f,p,v),a.expand(d,h,y);var _=new Array(g);for(u=0;u<g;u++)_[u]=n(p[u])&&n(h[u])?{x:p[u],y:h[u]}:{x:i,y:i},e.ids&&(_[u].id=String(e.ids[u]));return s(_,e),t.firstscatter=!1,_}},{"../../constants/numerical":133,"../../plots/cartesian/axes":189,"./arrays_to_calcdata":259,"./colorscale_calc":264,"./subtypes":281,"fast-isnumeric":10}],262:[function(t,e,r){"use strict";e.exports=function(t){for(var e=0;e<t.length;e++){var r=t[e];if("scatter"===r.type){var n=r.fill;if("none"!==n&&"toself"!==n&&(r.opacity=void 0,"tonexty"===n||"tonextx"===n))for(var a=e-1;a>=0;a--){var i=t[a];if("scatter"===i.type&&i.xaxis===r.xaxis&&i.yaxis===r.yaxis){i.opacity=void 0;break}}}}}},{}],263:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib"),i=t("../../plots/plots"),o=t("../../components/colorscale"),l=t("../../components/colorbar/draw");e.exports=function(t,e){var r=e[0].trace,s=r.marker,c="cb"+r.uid;if(t._fullLayout._infolayer.selectAll("."+c).remove(),void 0===s||!s.showscale)return void i.autoMargin(t,c);var u=s.color,f=s.cmin,d=s.cmax;n(f)||(f=a.aggNums(Math.min,null,u)),n(d)||(d=a.aggNums(Math.max,null,u));var p=e[0].t.cb=l(t,c),h=o.makeColorScaleFunc(o.extractScale(s.colorscale,f,d),{noNumericCheck:!0});p.fillcolor(h).filllevels({start:f,end:d,size:(d-f)/254}).options(s.colorbar)()}},{"../../components/colorbar/draw":37,"../../components/colorscale":48,"../../lib":149,"../../plots/plots":218,"fast-isnumeric":10}],264:[function(t,e,r){"use strict";var n=t("../../components/colorscale/has_colorscale"),a=t("../../components/colorscale/calc"),i=t("./subtypes");e.exports=function(t){i.hasLines(t)&&n(t,"line")&&a(t,t.line.color,"line","c"),i.hasMarkers(t)&&(n(t,"marker")&&a(t,t.marker.color,"marker","c"),n(t,"marker.line")&&a(t,t.marker.line.color,"marker.line","c"))}},{"../../components/colorscale/calc":40,"../../components/colorscale/has_colorscale":47,"./subtypes":281}],265:[function(t,e,r){"use strict";e.exports={PTS_LINESONLY:20,minTolerance:.2,toleranceGrowth:10,maxScreensAway:20}},{}],266:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./attributes"),i=t("./constants"),o=t("./subtypes"),l=t("./xy_defaults"),s=t("./marker_defaults"),c=t("./line_defaults"),u=t("./line_shape_defaults"),f=t("./text_defaults"),d=t("./fillcolor_defaults"),p=t("../../components/errorbars/defaults");e.exports=function(t,e,r,h){function g(r,i){return n.coerce(t,e,a,r,i)}var v=l(t,e,h,g),y=v<i.PTS_LINESONLY?"lines+markers":"lines";if(!v)return void(e.visible=!1);g("text"),g("hovertext"),g("mode",y),o.hasLines(e)&&(c(t,e,r,h,g),u(t,e,g),g("connectgaps"),g("line.simplify")),o.hasMarkers(e)&&s(t,e,r,h,g,{gradient:!0}),o.hasText(e)&&f(t,e,h,g);var m=[];(o.hasMarkers(e)||o.hasText(e))&&(g("marker.maxdisplayed"),m.push("points")),g("fill"),"none"!==e.fill&&(d(t,e,r,g),o.hasLines(e)||u(t,e,g)),"tonext"!==e.fill&&"toself"!==e.fill||m.push("fills"),g("hoveron",m.join("+")||"points"),p(t,e,r,{axis:"y"}),p(t,e,r,{axis:"x",inherit:"y"}),g("cliponaxis")}},{"../../components/errorbars/defaults":63,"../../lib":149,"./attributes":260,"./constants":265,"./fillcolor_defaults":268,"./line_defaults":272,"./line_shape_defaults":274,"./marker_defaults":277,"./subtypes":281,"./text_defaults":282,"./xy_defaults":283}],267:[function(t,e,r){"use strict";function n(t){return t||0===t}var a=t("../../lib");e.exports=function(t,e,r){var i=Array.isArray(r)?function(t){r.push(t)}:function(t){r.text=t},o=a.extractOption(t,e,"htx","hovertext");if(n(o))return i(o);var l=a.extractOption(t,e,"tx","text");return n(l)?i(l):void 0}},{"../../lib":149}],268:[function(t,e,r){"use strict";var n=t("../../components/color");e.exports=function(t,e,r,a){var i=!1;if(e.marker){var o=e.marker.color,l=(e.marker.line||{}).color;o&&!Array.isArray(o)?i=o:l&&!Array.isArray(l)&&(i=l)}a("fillcolor",n.addOpacity((e.line||{}).color||i||r,.5))}},{"../../components/color":34}],269:[function(t,e,r){"use strict";var n=t("../../components/color"),a=t("./subtypes");e.exports=function(t,e){var r,i;if("lines"===t.mode)return r=t.line.color,r&&n.opacity(r)?r:t.fillcolor;if("none"===t.mode)return t.fill?t.fillcolor:"";var o=e.mcc||(t.marker||{}).color,l=e.mlcc||((t.marker||{}).line||{}).color;return i=o&&n.opacity(o)?o:l&&n.opacity(l)&&(e.mlw||((t.marker||{}).line||{}).width)?l:"",i?n.opacity(i)<.3?n.addOpacity(i,.3):i:(r=(t.line||{}).color,r&&n.opacity(r)&&a.hasLines(t)&&t.line.width?r:t.fillcolor)}},{"../../components/color":34,"./subtypes":281}],270:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../components/fx"),i=t("../../components/errorbars"),o=t("./get_trace_color"),l=t("../../components/color"),s=t("./fill_hover_text"),c=a.constants.MAXDIST;e.exports=function(t,e,r,u){var f=t.cd,d=f[0].trace,p=t.xa,h=t.ya,g=p.c2p(e),v=h.c2p(r),y=[g,v],m=d.hoveron||"";if(-1!==m.indexOf("points")){var x=function(t){var e=Math.max(3,t.mrc||0);return Math.max(Math.abs(p.c2p(t.x)-g)-e,1-3/e)},b=function(t){var e=Math.max(3,t.mrc||0);return Math.max(Math.abs(h.c2p(t.y)-v)-e,1-3/e)},_=function(t){var e=Math.max(3,t.mrc||0),r=p.c2p(t.x)-g,n=h.c2p(t.y)-v;return Math.max(Math.sqrt(r*r+n*n)-e,1-3/e)},w=a.getDistanceFunction(u,x,b,_);if(a.getClosest(f,w,t),!1!==t.index){var k=f[t.index],M=p.c2p(k.x,!0),A=h.c2p(k.y,!0),T=k.mrc||1;return n.extendFlat(t,{color:o(d,k),x0:M-T,x1:M+T,xLabelVal:k.x,y0:A-T,y1:A+T,yLabelVal:k.y}),s(k,d,t),i.hoverInfo(k,d,t),[t]}}if(-1!==m.indexOf("fills")&&d._polygons){var L,C,S,O,z,D,P,E,N,I=d._polygons,R=[],F=!1,j=1/0,B=-1/0,q=1/0,H=-1/0;for(L=0;L<I.length;L++)S=I[L],S.contains(y)&&(F=!F,R.push(S),q=Math.min(q,S.ymin),H=Math.max(H,S.ymax));if(F){q=Math.max(q,0),H=Math.min(H,h._length);var V=(q+H)/2;for(L=0;L<R.length;L++)for(O=R[L].pts,C=1;C<O.length;C++)E=O[C-1][1],N=O[C][1],E>V!=N>=V&&(D=O[C-1][0],P=O[C][0],z=D+(P-D)*(V-E)/(N-E),j=Math.min(j,z),B=Math.max(B,z));j=Math.max(j,0),B=Math.min(B,p._length);var U=l.defaultLine;return l.opacity(d.fillcolor)?U=d.fillcolor:l.opacity((d.line||{}).color)&&(U=d.line.color),n.extendFlat(t,{distance:c+10,x0:j,x1:B,y0:V,y1:V,color:U}),delete t.index,d.text&&!Array.isArray(d.text)?t.text=String(d.text):t.text=d.name,[t]}}}},{"../../components/color":34,"../../components/errorbars":64,"../../components/fx":75,"../../lib":149,"./fill_hover_text":267,"./get_trace_color":269}],271:[function(t,e,r){"use strict";var n={},a=t("./subtypes");n.hasLines=a.hasLines,n.hasMarkers=a.hasMarkers,n.hasText=a.hasText,n.isBubble=a.isBubble,n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.cleanData=t("./clean_data"),n.calc=t("./calc"),n.arraysToCalcdata=t("./arrays_to_calcdata"),n.plot=t("./plot"),n.colorbar=t("./colorbar"),n.style=t("./style"),n.hoverPoints=t("./hover"),n.selectPoints=t("./select"),n.animatable=!0,n.moduleType="trace",n.name="scatter",n.basePlotModule=t("../../plots/cartesian"),n.categories=["cartesian","symbols","markerColorscale","errorBarsOK","showLegend","scatter-like"],n.meta={},e.exports=n},{"../../plots/cartesian":199,"./arrays_to_calcdata":259,"./attributes":260,"./calc":261,"./clean_data":262,"./colorbar":263,"./defaults":266,"./hover":270,"./plot":278,"./select":279,"./style":280,"./subtypes":281}],272:[function(t,e,r){"use strict";var n=t("../../components/colorscale/has_colorscale"),a=t("../../components/colorscale/defaults");e.exports=function(t,e,r,i,o,l){var s=(t.marker||{}).color;if(o("line.color",r),n(t,"line"))a(t,e,i,o,{prefix:"line.",cLetter:"c"});else{o("line.color",!Array.isArray(s)&&s||r)}o("line.width"),(l||{}).noDash||o("line.dash")}},{"../../components/colorscale/defaults":43,"../../components/colorscale/has_colorscale":47}],273:[function(t,e,r){"use strict";var n=t("../../constants/numerical").BADNUM,a=t("../../lib"),i=a.segmentsIntersect,o=a.constrain,l=t("./constants");e.exports=function(t,e){function r(e){var r=N.c2p(t[e].x),a=I.c2p(t[e].y);return r!==n&&a!==n&&[r,a]}function s(t){var e=t[0]/N._length,r=t[1]/I._length;return(1+l.toleranceGrowth*Math.max(0,-e,e-1,-r,r-1))*j}function c(t,e){var r=t[0]-e[0],n=t[1]-e[1];return Math.sqrt(r*r+n*n)}function u(t,e){for(var r=[],n=0,a=0;a<4;a++){var o=at[a],l=i(t[0],t[1],e[0],e[1],o[0],o[1],o[2],o[3]);l&&(!n||Math.abs(l.x-r[0][0])>1||Math.abs(l.y-r[0][1])>1)&&(l=[l.x,l.y],n&&c(l,t)<c(r[0],t)?r.unshift(l):r.push(l),n++)}return r}function f(t){if(t[0]<tt||t[0]>et||t[1]<rt||t[1]>nt)return[o(t[0],tt,et),o(t[1],rt,nt)]}function d(t,e){return t[0]===e[0]&&(t[0]===tt||t[0]===et)||(t[1]===e[1]&&(t[1]===rt||t[1]===nt)||void 0)}function p(t,e){var r=[],n=f(t),a=f(e);return n&&a&&d(n,a)?r:(n&&r.push(n),a&&r.push(a),r)}function h(t,e,r){return function(n,i){var o=f(n),l=f(i),s=[];if(o&&l&&d(o,l))return s;o&&s.push(o),l&&s.push(l);var c=2*a.constrain((n[t]+i[t])/2,e,r)-((o||n)[t]+(l||i)[t]);if(c){var u;u=o&&l?c>0==o[t]>l[t]?o:l:o||l,u[t]+=c}return s}}function g(t,e){var r=e[0]-t[0],n=(e[1]-t[1])/r;return(t[1]*e[0]-e[1]*t[0])/r>0?[n>0?tt:et,nt]:[n>0?et:tt,rt]}function v(t){var e=t[0],r=t[1],n=e===U[G-1][0],a=r===U[G-1][1];if(!n||!a)if(G>1){var i=e===U[G-2][0],o=r===U[G-2][1];n&&(e===tt||e===et)&&i?o?G--:U[G-1]=t:a&&(r===rt||r===nt)&&o?i?G--:U[G-1]=t:U[G++]=t}else U[G++]=t}function y(t){U[G-1][0]!==t[0]&&U[G-1][1]!==t[1]&&v([Z,W]),v(t),Q=null,Z=W=0}function m(t){if(X=t[0]<tt?tt:t[0]>et?et:0,Y=t[1]<rt?rt:t[1]>nt?nt:0,X||Y){if(G)if(Q){var e=J(Q,t);e.length>1&&(y(e[0]),U[G++]=e[1])}else $=J(U[G-1],t)[0],U[G++]=$;else U[G++]=[X||t[0],Y||t[1]];var r=U[G-1];X&&Y&&(r[0]!==X||r[1]!==Y)?(Q&&(Z!==X&&W!==Y?v(Z&&W?g(Q,t):[Z||X,W||Y]):Z&&W&&v([Z,W])),v([X,Y])):Z-X&&W-Y&&v([X||Z,Y||W]),Q=t,Z=X,W=Y}else Q&&y(J(Q,t)[0]),U[G++]=t}var x,b,_,w,k,M,A,T,L,C,S,O,z,D,P,E,N=e.xaxis,I=e.yaxis,R=e.simplify,F=e.connectGaps,j=e.baseTolerance,B=e.shape,q="linear"===B,H=[],V=l.minTolerance,U=new Array(t.length),G=0;R||(j=V=-1);var X,Y,Z,W,Q,$,J,K=l.maxScreensAway,tt=-N._length*K,et=N._length*(1+K),rt=-I._length*K,nt=I._length*(1+K),at=[[tt,rt,et,rt],[et,rt,et,nt],[et,nt,tt,nt],[tt,nt,tt,rt]];for("linear"===B||"spline"===B?J=u:"hv"===B||"vh"===B?J=p:"hvh"===B?J=h(0,tt,et):"vhv"===B&&(J=h(1,rt,nt)),x=0;x<t.length;x++)if(b=r(x)){for(G=0,Q=null,m(b),x++;x<t.length;x++){if(!(w=r(x))){if(F)continue;break}if(q){if(!((C=c(w,b))<s(w)*V)){for(T=[(w[0]-b[0])/C,(w[1]-b[1])/C],k=b,S=C,O=D=P=0,A=!1,_=w,x++;x<t.length;x++){if(!(M=r(x))){if(F)continue;break}if(L=[M[0]-b[0],M[1]-b[1]],E=L[0]*T[1]-L[1]*T[0],D=Math.min(D,E),(P=Math.max(P,E))-D>s(M))break;_=M,z=L[0]*T[0]+L[1]*T[1],z>S?(S=z,w=M,A=!1):z<O&&(O=z,k=M,A=!0)}if(A?(m(w),_!==k&&m(k)):(k!==b&&m(k),_!==w&&m(w)),m(_),x>=t.length||!M)break;m(M),b=M}}else m(w)}Q&&v([Z||Q[0],W||Q[1]]),H.push(U.slice(0,G))}return H}},{"../../constants/numerical":133,"../../lib":149,"./constants":265}],274:[function(t,e,r){"use strict";e.exports=function(t,e,r){"spline"===r("line.shape")&&r("line.smoothing")}},{}],275:[function(t,e,r){"use strict";e.exports=function(t,e,r){for(var n,a,i=null,o=0;o<r.length;++o)n=r[o],a=n[0].trace,!0===a.visible?(a._nexttrace=null,-1!==["tonextx","tonexty","tonext"].indexOf(a.fill)&&(a._prevtrace=i,i&&(i._nexttrace=a)),i=a):a._prevtrace=a._nexttrace=null}},{}],276:[function(t,e,r){"use strict";var n=t("fast-isnumeric");e.exports=function(t){var e=t.marker,r=e.sizeref||1,a=e.sizemin||0,i="area"===e.sizemode?function(t){return Math.sqrt(t/r)}:function(t){return t/r};return function(t){var e=i(t/2);return n(e)&&e>0?Math.max(e,a):0}}},{"fast-isnumeric":10}],277:[function(t,e,r){"use strict";var n=t("../../components/color"),a=t("../../components/colorscale/has_colorscale"),i=t("../../components/colorscale/defaults"),o=t("./subtypes");e.exports=function(t,e,r,l,s,c){var u,f=o.isBubble(t),d=(t.line||{}).color;if(c=c||{},d&&(r=d),s("marker.symbol"),s("marker.opacity",f?.7:1),s("marker.size"),s("marker.color",r),a(t,"marker")&&i(t,e,l,s,{prefix:"marker.",cLetter:"c"}),c.noLine||(u=d&&!Array.isArray(d)&&e.marker.color!==d?d:f?n.background:n.defaultLine,s("marker.line.color",u),a(t,"marker.line")&&i(t,e,l,s,{prefix:"marker.line.",cLetter:"c"}),s("marker.line.width",f?1:0)),f&&(s("marker.sizeref"),s("marker.sizemin"),s("marker.sizemode")),c.gradient){"none"!==s("marker.gradient.type")&&s("marker.gradient.color")}}},{"../../components/color":34,"../../components/colorscale/defaults":43,"../../components/colorscale/has_colorscale":47,"./subtypes":281}],278:[function(t,e,r){"use strict";function n(t,e,r){var n;e.selectAll("g.trace").each(function(t){var e=o.select(this);if(n=t[0].trace,n._nexttrace){if(n._nextFill=e.select(".js-fill.js-tonext"),!n._nextFill.size()){var a=":first-child";e.select(".js-fill.js-tozero").size()&&(a+=" + *"),n._nextFill=e.insert("path",a).attr("class","js-fill js-tonext")}}else e.selectAll(".js-fill.js-tonext").remove(),n._nextFill=null;n.fill&&("tozero"===n.fill.substr(0,6)||"toself"===n.fill||"to"===n.fill.substr(0,2)&&!n._prevtrace)?(n._ownFill=e.select(".js-fill.js-tozero"),n._ownFill.size()||(n._ownFill=e.insert("path",":first-child").attr("class","js-fill js-tozero"))):(e.selectAll(".js-fill.js-tozero").remove(),n._ownFill=null),e.selectAll(".js-fill").call(s.setClipUrl,r.layerClipId)})}function a(t,e,r,n,a,d,h){function g(t){return k?t.transition():t}function v(t){return t.filter(function(t){return t.vis})}function y(t){return t.id}function m(t){if(t.ids)return y}function x(){return!1}function b(e){var n,a,i,c=e[0].trace,f=o.select(this),d=u.hasMarkers(c),p=u.hasText(c),h=m(c),y=x,b=x;d&&(y=c.marker.maxdisplayed||c._needsCull?v:l.identity),p&&(b=c.marker.maxdisplayed||c._needsCull?v:l.identity),a=f.selectAll("path.point"),n=a.data(y,h);var _=n.enter().append("path").classed("point",!0);k&&_.call(s.pointStyle,c,t).call(s.translatePoints,M,A).style("opacity",0).transition().style("opacity",1);var w=d&&s.tryColorscale(c.marker,""),T=d&&s.tryColorscale(c.marker,"line");n.order(),n.each(function(e){var n=o.select(this),a=g(n);i=s.translatePoint(e,a,M,A),i?(s.singlePointStyle(e,a,c,w,T,t),r.layerClipId&&s.hideOutsideRangePoint(e,a,M,A),c.customdata&&n.classed("plotly-customdata",null!==e.data&&void 0!==e.data)):a.remove()}),k?n.exit().transition().style("opacity",0).remove():n.exit().remove(),a=f.selectAll("g"),n=a.data(b,h),n.enter().append("g").classed("textpoint",!0).append("text"),n.order(),n.each(function(t){var e=o.select(this),n=g(e.select("text"));i=s.translatePoint(t,n,M,A),i?r.layerClipId&&s.hideOutsideRangePoint(t,e,M,A):e.remove()}),n.selectAll("text").call(s.textPointStyle,c,t).each(function(t){var e=M.c2p(t.x),r=A.c2p(t.y);o.select(this).selectAll("tspan.line").each(function(){g(o.select(this)).attr({x:e,y:r})})}),n.exit().remove()}var _,w;i(t,e,r,n,a);var k=!!h&&h.duration>0,M=r.xaxis,A=r.yaxis,T=n[0].trace,L=T.line,C=o.select(d);if(C.call(c.plot,r,h),!0===T.visible){g(C).style("opacity",T.opacity);var S,O,z=T.fill.charAt(T.fill.length-1);"x"!==z&&"y"!==z&&(z=""),n[0].node3=C;var D="",P=[],E=T._prevtrace;E&&(D=E._prevRevpath||"",O=E._nextFill,P=E._polygons);var N,I,R,F,j,B,q,H,V,U="",G="",X=[],Y=l.noop;if(S=T._ownFill,u.hasLines(T)||"none"!==T.fill){for(O&&O.datum(n),-1!==["hv","vh","hvh","vhv"].indexOf(L.shape)?(R=s.steps(L.shape),F=s.steps(L.shape.split("").reverse().join(""))):R=F="spline"===L.shape?function(t){var e=t[t.length-1];return t.length>1&&t[0][0]===e[0]&&t[0][1]===e[1]?s.smoothclosed(t.slice(1),L.smoothing):s.smoothopen(t,L.smoothing)}:function(t){return"M"+t.join("L")},j=function(t){return F(t.reverse())},X=f(n,{xaxis:M,yaxis:A,connectGaps:T.connectgaps,baseTolerance:Math.max(L.width||1,3)/4,shape:L.shape,simplify:L.simplify}),V=T._polygons=new Array(X.length),w=0;w<X.length;w++)T._polygons[w]=p(X[w]);X.length&&(B=X[0][0],q=X[X.length-1],H=q[q.length-1]),Y=function(t){return function(e){if(N=R(e),I=j(e),U?z?(U+="L"+N.substr(1),G=I+"L"+G.substr(1)):(U+="Z"+N,G=I+"Z"+G):(U=N,G=I),u.hasLines(T)&&e.length>1){var r=o.select(this);if(r.datum(n),t)g(r.style("opacity",0).attr("d",N).call(s.lineGroupStyle)).style("opacity",1);else{var a=g(r);a.attr("d",N),s.singleLineStyle(n,a)}}}}}var Z=C.selectAll(".js-line").data(X);g(Z.exit()).style("opacity",0).remove(),Z.each(Y(!1)),Z.enter().append("path").classed("js-line",!0).style("vector-effect","non-scaling-stroke").call(s.lineGroupStyle).each(Y(!0)),s.setClipUrl(Z,r.layerClipId),X.length&&(S?B&&H&&(z?("y"===z?B[1]=H[1]=A.c2p(0,!0):"x"===z&&(B[0]=H[0]=M.c2p(0,!0)),g(S).attr("d","M"+H+"L"+B+"L"+U.substr(1)).call(s.singleFillStyle)):g(S).attr("d",U+"Z").call(s.singleFillStyle)):"tonext"===T.fill.substr(0,6)&&U&&D&&("tonext"===T.fill?g(O).attr("d",U+"Z"+D+"Z").call(s.singleFillStyle):g(O).attr("d",U+"L"+D.substr(1)+"Z").call(s.singleFillStyle),T._polygons=T._polygons.concat(P)),T._prevRevpath=G,T._prevPolygons=V);var W=C.selectAll(".points");_=W.data([n]),W.each(b),_.enter().append("g").classed("points",!0).each(b),_.exit().remove(),_.each(function(t){var e=!1===t[0].trace.cliponaxis;s.setClipUrl(o.select(this),e?null:r.layerClipId)})}}function i(t,e,r,n,a){var i=r.xaxis,s=r.yaxis,c=o.extent(l.simpleMap(i.range,i.r2c)),f=o.extent(l.simpleMap(s.range,s.r2c)),d=n[0].trace;if(u.hasMarkers(d)){var p=d.marker.maxdisplayed;if(0!==p){var h=n.filter(function(t){return t.x>=c[0]&&t.x<=c[1]&&t.y>=f[0]&&t.y<=f[1]}),g=Math.ceil(h.length/p),v=0;a.forEach(function(t,r){var n=t[0].trace;u.hasMarkers(n)&&n.marker.maxdisplayed>0&&r<e&&v++});var y=Math.round(v*g/3+Math.floor(v/3)*g/7.1);n.forEach(function(t){delete t.vis}),h.forEach(function(t,e){0===Math.round((e+y)%g)&&(t.vis=!0)})}}}var o=t("d3"),l=t("../../lib"),s=t("../../components/drawing"),c=t("../../components/errorbars"),u=t("./subtypes"),f=t("./line_points"),d=t("./link_traces"),p=t("../../lib/polygon").tester;e.exports=function(t,e,r,i,l){var s,c,u,f,p,h=e.plot.select("g.scatterlayer"),g=!i,v=!!i&&i.duration>0;for(u=h.selectAll("g.trace"),f=u.data(r,function(t){return t[0].trace.uid}),f.enter().append("g").attr("class",function(t){return"trace scatter trace"+t[0].trace.uid}).style("stroke-miterlimit",2),d(t,e,r),n(t,h,e),s=0,c={};s<r.length;s++)c[r[s][0].trace.uid]=s;if(h.selectAll("g.trace").sort(function(t,e){return c[t[0].trace.uid]>c[e[0].trace.uid]?1:-1}),v){l&&(p=l());o.transition().duration(i.duration).ease(i.easing).each("end",function(){p&&p()}).each("interrupt",function(){p&&p()}).each(function(){h.selectAll("g.trace").each(function(n,o){a(t,o,e,n,r,this,i)})})}else h.selectAll("g.trace").each(function(n,o){a(t,o,e,n,r,this,i)});g&&f.exit().remove(),h.selectAll("path:not([d])").remove()}},{"../../components/drawing":58,"../../components/errorbars":64,"../../lib":149,"../../lib/polygon":160,"./line_points":273,"./link_traces":275,"./subtypes":281,d3:7}],279:[function(t,e,r){"use strict";var n=t("./subtypes"),a=t("../../constants/interactions").DESELECTDIM;e.exports=function(t,e){var r,i,o,l,s=t.cd,c=t.xaxis,u=t.yaxis,f=[],d=s[0].trace,p=d.marker;if(!n.hasMarkers(d)&&!n.hasText(d))return[];var h=Array.isArray(p.opacity)?1:p.opacity;if(!1===e)for(r=0;r<s.length;r++)s[r].dim=0;else for(r=0;r<s.length;r++)i=s[r],o=c.c2p(i.x),l=u.c2p(i.y),e.contains([o,l])?(f.push({pointNumber:r,x:i.x,y:i.y}),i.dim=0):i.dim=1;return s[0].node3.selectAll("path.point").style("opacity",function(t){return((t.mo+1||h+1)-1)*(t.dim?a:1)}),s[0].node3.selectAll("text").style("opacity",function(t){return t.dim?a:1}),f}},{"../../constants/interactions":132,"./subtypes":281}],280:[function(t,e,r){"use strict";var n=t("d3"),a=t("../../components/drawing"),i=t("../../components/errorbars");e.exports=function(t){var e=n.select(t).selectAll("g.trace.scatter");e.style("opacity",function(t){return t[0].trace.opacity}),e.selectAll("g.points").each(function(e){var r=n.select(this),i=r.selectAll("path.point"),o=e.trace||e[0].trace;i.call(a.pointStyle,o,t),r.selectAll("text").call(a.textPointStyle,o,t)}),e.selectAll("g.trace path.js-line").call(a.lineGroupStyle),e.selectAll("g.trace path.js-fill").call(a.fillGroupStyle),e.call(i.style)}},{"../../components/drawing":58,"../../components/errorbars":64,d3:7}],281:[function(t,e,r){"use strict";var n=t("../../lib");e.exports={hasLines:function(t){return t.visible&&t.mode&&-1!==t.mode.indexOf("lines")},hasMarkers:function(t){return t.visible&&t.mode&&-1!==t.mode.indexOf("markers")},hasText:function(t){return t.visible&&t.mode&&-1!==t.mode.indexOf("text")},isBubble:function(t){return n.isPlainObject(t.marker)&&Array.isArray(t.marker.size)}}},{"../../lib":149}],282:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e,r,a){a("textposition"),n.coerceFont(a,"textfont",r.font)}},{"../../lib":149}],283:[function(t,e,r){"use strict";var n=t("../../registry");e.exports=function(t,e,r,a){var i,o=a("x"),l=a("y");if(n.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y"],r),o)l?(i=Math.min(o.length,l.length),i<o.length&&(e.x=o.slice(0,i)),i<l.length&&(e.y=l.slice(0,i))):(i=o.length,a("y0"),a("dy"));else{if(!l)return 0;i=e.y.length,a("x0"),a("dx")}return i}},{"../../registry":225}]},{},[5])(5)});