@deephaven/embed-widget 0.63.1-beta.3 → 0.63.1-beta.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (22) hide show
  1. package/build/assets/{App-cc51f4b2.js → App-d62b961e.js} +2 -2
  2. package/build/assets/{App-cc51f4b2.js.map → App-d62b961e.js.map} +1 -1
  3. package/build/assets/{MarkdownEditor-d028efcc.js → MarkdownEditor-c9ba7835.js} +2 -2
  4. package/build/assets/{MarkdownEditor-d028efcc.js.map → MarkdownEditor-c9ba7835.js.map} +1 -1
  5. package/build/assets/{MarkdownNotebook-5cee8c9f.js → MarkdownNotebook-a46efa0a.js} +2 -2
  6. package/build/assets/{MarkdownNotebook-5cee8c9f.js.map → MarkdownNotebook-a46efa0a.js.map} +1 -1
  7. package/build/assets/{index-141d7c0e.js → index-8a9ee106.js} +22 -22
  8. package/build/assets/index-8a9ee106.js.map +1 -0
  9. package/build/assets/{index-ae42d2bf.js → index-909a9ee9.js} +2 -2
  10. package/build/assets/{index-ae42d2bf.js.map → index-909a9ee9.js.map} +1 -1
  11. package/build/assets/{index-ae5c2ef1.js → index-ce39369f.js} +3 -3
  12. package/build/assets/{index-ae5c2ef1.js.map → index-ce39369f.js.map} +1 -1
  13. package/build/assets/plotly-9a15c985.js +7 -0
  14. package/build/assets/{plotly-6b679548.js.map → plotly-9a15c985.js.map} +1 -1
  15. package/build/assets/{useConnection-51f83c5a.js → useConnection-b97a0997.js} +2 -2
  16. package/build/assets/{useConnection-51f83c5a.js.map → useConnection-b97a0997.js.map} +1 -1
  17. package/build/assets/{usePlugins-228ae1cc.js → usePlugins-ba7b2ad5.js} +2 -2
  18. package/build/assets/{usePlugins-228ae1cc.js.map → usePlugins-ba7b2ad5.js.map} +1 -1
  19. package/build/index.html +1 -1
  20. package/package.json +15 -15
  21. package/build/assets/index-141d7c0e.js.map +0 -1
  22. package/build/assets/plotly-6b679548.js +0 -7
@@ -0,0 +1,7 @@
1
+ import{g as Fi,c as lM}from"./helpers-de833af9.js";import{r as sM,p as fM,f as wt,t as ga,d as gt,g as E1,a as zl,i as cM,b as z1,e as Ah,c as I1,m as uM,h as F1,j as N1,k as vM,n as dM,l as hM,o as pM,q as H1,s as mM,u as yM,v as gM,w as bM,x as xM,y as _M,z as wM,A as Mh,B as O1}from"./vendor-e5b6c1c9.js";var j1={};(function(t){function e(x){"@babel/helpers - typeof";return e=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(_){return typeof _}:function(_){return _&&typeof Symbol=="function"&&_.constructor===Symbol&&_!==Symbol.prototype?"symbol":typeof _},e(x)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=g;var r=o(sM),a=i(fM);function i(x){return x&&x.__esModule?x:{default:x}}function n(x){if(typeof WeakMap!="function")return null;var _=new WeakMap,T=new WeakMap;return(n=function(S){return S?T:_})(x)}function o(x,_){if(!_&&x&&x.__esModule)return x;if(x===null||e(x)!=="object"&&typeof x!="function")return{default:x};var T=n(_);if(T&&T.has(x))return T.get(x);var k={},S=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var L in x)if(L!=="default"&&Object.prototype.hasOwnProperty.call(x,L)){var D=S?Object.getOwnPropertyDescriptor(x,L):null;D&&(D.get||D.set)?Object.defineProperty(k,L,D):k[L]=x[L]}return k.default=x,T&&T.set(x,k),k}function l(x,_){if(!(x instanceof _))throw new TypeError("Cannot call a class as a function")}function s(x,_){for(var T=0;T<_.length;T++){var k=_[T];k.enumerable=k.enumerable||!1,k.configurable=!0,"value"in k&&(k.writable=!0),Object.defineProperty(x,k.key,k)}}function f(x,_,T){return _&&s(x.prototype,_),T&&s(x,T),Object.defineProperty(x,"prototype",{writable:!1}),x}function c(x,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");x.prototype=Object.create(_&&_.prototype,{constructor:{value:x,writable:!0,configurable:!0}}),Object.defineProperty(x,"prototype",{writable:!1}),_&&v(x,_)}function v(x,_){return v=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(k,S){return k.__proto__=S,k},v(x,_)}function u(x){var _=p();return function(){var k=m(x),S;if(_){var L=m(this).constructor;S=Reflect.construct(k,arguments,L)}else S=k.apply(this,arguments);return h(this,S)}}function h(x,_){if(_&&(e(_)==="object"||typeof _=="function"))return _;if(_!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return d(x)}function d(x){if(x===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return x}function p(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function m(x){return m=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(T){return T.__proto__||Object.getPrototypeOf(T)},m(x)}var y=["AfterExport","AfterPlot","Animated","AnimatingFrame","AnimationInterrupted","AutoSize","BeforeExport","BeforeHover","ButtonClicked","Click","ClickAnnotation","Deselect","DoubleClick","Framework","Hover","LegendClick","LegendDoubleClick","Relayout","Relayouting","Restyle","Redraw","Selected","Selecting","SliderChange","SliderEnd","SliderStart","SunburstClick","Transitioning","TransitionInterrupted","Unhover","WebGlContextLost"],b=["plotly_restyle","plotly_redraw","plotly_relayout","plotly_relayouting","plotly_doubleclick","plotly_animated","plotly_sunburstclick"],w=typeof window<"u";function g(x){var _=function(T){c(S,T);var k=u(S);function S(L){var D;return l(this,S),D=k.call(this,L),D.p=Promise.resolve(),D.resizeHandler=null,D.handlers={},D.syncWindowResize=D.syncWindowResize.bind(d(D)),D.syncEventHandlers=D.syncEventHandlers.bind(d(D)),D.attachUpdateEvents=D.attachUpdateEvents.bind(d(D)),D.getRef=D.getRef.bind(d(D)),D.handleUpdate=D.handleUpdate.bind(d(D)),D.figureCallback=D.figureCallback.bind(d(D)),D.updatePlotly=D.updatePlotly.bind(d(D)),D}return f(S,[{key:"updatePlotly",value:function(D,$,E){var z=this;this.p=this.p.then(function(){if(!z.unmounting){if(!z.el)throw new Error("Missing element reference");return x.react(z.el,{data:z.props.data,layout:z.props.layout,config:z.props.config,frames:z.props.frames})}}).then(function(){z.unmounting||(z.syncWindowResize(D),z.syncEventHandlers(),z.figureCallback($),E&&z.attachUpdateEvents())}).catch(function(O){z.props.onError&&z.props.onError(O)})}},{key:"componentDidMount",value:function(){this.unmounting=!1,this.updatePlotly(!0,this.props.onInitialized,!0)}},{key:"componentDidUpdate",value:function(D){this.unmounting=!1;var $=D.frames&&D.frames.length?D.frames.length:0,E=this.props.frames&&this.props.frames.length?this.props.frames.length:0,z=!(D.layout===this.props.layout&&D.data===this.props.data&&D.config===this.props.config&&E===$),O=D.revision!==void 0,I=D.revision!==this.props.revision;!z&&(!O||O&&!I)||this.updatePlotly(!1,this.props.onUpdate,!1)}},{key:"componentWillUnmount",value:function(){this.unmounting=!0,this.figureCallback(this.props.onPurge),this.resizeHandler&&w&&(window.removeEventListener("resize",this.resizeHandler),this.resizeHandler=null),this.removeUpdateEvents(),x.purge(this.el)}},{key:"attachUpdateEvents",value:function(){var D=this;!this.el||!this.el.removeListener||b.forEach(function($){D.el.on($,D.handleUpdate)})}},{key:"removeUpdateEvents",value:function(){var D=this;!this.el||!this.el.removeListener||b.forEach(function($){D.el.removeListener($,D.handleUpdate)})}},{key:"handleUpdate",value:function(){this.figureCallback(this.props.onUpdate)}},{key:"figureCallback",value:function(D){if(typeof D=="function"){var $=this.el,E=$.data,z=$.layout,O=this.el._transitionData?this.el._transitionData._frames:null,I={data:E,layout:z,frames:O};D(I,this.el)}}},{key:"syncWindowResize",value:function(D){var $=this;w&&(this.props.useResizeHandler&&!this.resizeHandler?(this.resizeHandler=function(){return x.Plots.resize($.el)},window.addEventListener("resize",this.resizeHandler),D&&this.resizeHandler()):!this.props.useResizeHandler&&this.resizeHandler&&(window.removeEventListener("resize",this.resizeHandler),this.resizeHandler=null))}},{key:"getRef",value:function(D){this.el=D,this.props.debug&&w&&(window.gd=this.el)}},{key:"syncEventHandlers",value:function(){var D=this;y.forEach(function($){var E=D.props["on"+$],z=D.handlers[$],O=!!z;E&&!O?D.addEventHandler($,E):!E&&O?D.removeEventHandler($):E&&O&&E!==z&&(D.removeEventHandler($),D.addEventHandler($,E))})}},{key:"addEventHandler",value:function(D,$){this.handlers[D]=$,this.el.on(this.getPlotlyEventName(D),this.handlers[D])}},{key:"removeEventHandler",value:function(D){this.el.removeListener(this.getPlotlyEventName(D),this.handlers[D]),delete this.handlers[D]}},{key:"getPlotlyEventName",value:function(D){return"plotly_"+D.toLowerCase()}},{key:"render",value:function(){return r.default.createElement("div",{id:this.props.divId,style:this.props.style,ref:this.getRef,className:this.props.className})}}]),S}(r.Component);return _.propTypes={data:a.default.arrayOf(a.default.object),config:a.default.object,layout:a.default.object,frames:a.default.arrayOf(a.default.object),revision:a.default.number,onInitialized:a.default.func,onPurge:a.default.func,onError:a.default.func,onUpdate:a.default.func,debug:a.default.bool,style:a.default.object,className:a.default.string,useResizeHandler:a.default.bool,divId:a.default.string},y.forEach(function(T){_.propTypes["on"+T]=a.default.func}),_.defaultProps={debug:!1,useResizeHandler:!1,data:[],style:{position:"relative",display:"inline-block"}},_}})(j1);const Oj=Fi(j1);var B1={},wc={};wc.version="2.27.1";var G1={exports:{}},or={BADNUM:void 0,FP_SAFE:Number.MAX_VALUE*1e-4,ONEMAXYEAR:316224e5,ONEAVGYEAR:315576e5,ONEMINYEAR:31536e6,ONEMAXQUARTER:79488e5,ONEAVGQUARTER:78894e5,ONEMINQUARTER:76896e5,ONEMAXMONTH:26784e5,ONEAVGMONTH:26298e5,ONEMINMONTH:24192e5,ONEWEEK:6048e5,ONEDAY:864e5,ONEHOUR:36e5,ONEMIN:6e4,ONESEC:1e3,EPOCHJD:24405875e-1,ALMOST_EQUAL:1-1e-6,LOG_CLIP:10,MINUS_SIGN:"−"},ta={},Sh=Array.isArray,TM=ArrayBuffer,kM=DataView;function U1(t){return TM.isView(t)&&!(t instanceof kM)}ta.isTypedArray=U1;function jf(t){return Sh(t)||U1(t)}ta.isArrayOrTypedArray=jf;function AM(t){return!jf(t[0])}ta.isArray1D=AM;ta.ensureArray=function(t,e){return Sh(t)||(t=[]),t.length=e,t};ta.concat=function(){var t=[],e=!0,r=0,a,i,n,o,l,s,f,c;for(n=0;n<arguments.length;n++)o=arguments[n],s=o.length,s&&(i?t.push(o):(i=o,l=s),Sh(o)?a=!1:(e=!1,r?a!==o.constructor&&(a=!1):a=o.constructor),r+=s);if(!r)return[];if(!t.length)return i;if(e)return i.concat.apply(i,t);if(a){for(f=new a(r),f.set(i),n=0;n<t.length;n++)o=t[n],f.set(o,l),l+=o.length;return f}for(f=new Array(r),c=0;c<i.length;c++)f[c]=i[c];for(n=0;n<t.length;n++){for(o=t[n],c=0;c<o.length;c++)f[l+c]=o[c];l+=c}return f};ta.maxRowLength=function(t){return V1(t,Math.max,0)};ta.minRowLength=function(t){return V1(t,Math.min,1/0)};function V1(t,e,r){if(jf(t))if(jf(t[0])){for(var a=r,i=0;i<t.length;i++)a=e(a,t[i].length);return a}else return t.length;return 0}var X1=wt,Lh=ta.isArrayOrTypedArray,Ch=function(e,r){if(X1(r))r=String(r);else if(typeof r!="string"||r.substr(r.length-4)==="[-1]")throw"bad property string";var a=r.split("."),i,n,o,l;for(l=0;l<a.length;l++)if(String(a[l]).slice(0,2)==="__")throw"bad property string";for(l=0;l<a.length;){if(i=String(a[l]).match(/^([^\[\]]*)((\[\-?[0-9]*\])+)$/),i){if(i[1])a[l]=i[1];else if(l===0)a.splice(0,1);else throw"bad property string";for(n=i[2].substr(1,i[2].length-2).split("]["),o=0;o<n.length;o++)l++,a.splice(l,0,Number(n[o]))}l++}return typeof e!="object"?CM(e,r,a):{set:W1(e,a,r),get:Y1(e,a),astr:r,parts:a,obj:e}};function Y1(t,e){return function(){var r=t,a,i,n,o,l;for(o=0;o<e.length-1;o++){if(a=e[o],a===-1){for(i=!0,n=[],l=0;l<r.length;l++)n[l]=Y1(r[l],e.slice(o+1))(),n[l]!==n[0]&&(i=!1);return i?n[0]:n}if(typeof a=="number"&&!Lh(r)||(r=r[a],typeof r!="object"||r===null))return}if(!(typeof r!="object"||r===null)&&(n=r[e[o]],n!==null))return n}}var MM=/(^|\.)args\[/;function bd(t,e){return t===void 0||t===null&&!e.match(MM)}function W1(t,e,r){return function(a){var i=t,n="",o=bd(a,r),l,s;for(s=0;s<e.length-1;s++){if(l=e[s],typeof l=="number"&&!Lh(i))throw"array index but container is not an array";if(l===-1){if(o=!LM(i,e.slice(s+1),a,r),o)break;return}if(!q1(i,l,e[s+1],o))break;if(i=i[l],typeof i!="object"||i===null)throw"container is not an object";n=SM(n,l)}if(o){if(s===e.length-1&&(delete i[e[s]],Array.isArray(i)&&+e[s]===i.length-1))for(;i.length&&i[i.length-1]===void 0;)i.pop()}else i[e[s]]=a}}function SM(t,e){var r=e;return X1(e)?r="["+e+"]":t&&(r="."+e),t+r}function LM(t,e,r,a){var i=Lh(r),n=!0,o=r,l=a.replace("-1",0),s=i?!1:bd(r,l),f=e[0],c;for(c=0;c<t.length;c++)l=a.replace("-1",c),i&&(o=r[c%r.length],s=bd(o,l)),s&&(n=!1),q1(t,c,f,s)&&W1(t[c],e,a.replace("-1",c))(o);return n}function q1(t,e,r,a){if(t[e]===void 0){if(a)return!1;typeof r=="number"?t[e]=[]:t[e]={}}return!0}function CM(t,e,r){return{set:function(){throw"bad container"},get:function(){},astr:e,parts:r,obj:t}}var $n=Ch,DM=/^\w*$/,$M=0,hm=1,xs=2,pm=3,Yi=4,PM=function(e,r,a,i){a=a||"name",i=i||"value";var n,o,l,s={};r&&r.length?(l=$n(e,r),o=l.get()):o=e,r=r||"";var f={};if(o)for(n=0;n<o.length;n++)f[o[n][a]]=n;var c=DM.test(i),v={set:function(u,h){var d=h===null?Yi:$M;if(!o){if(!l||d===Yi)return;o=[],l.set(o)}var p=f[u];if(p===void 0){if(d===Yi)return;d=d|pm,p=o.length,f[u]=p}else h!==(c?o[p][i]:$n(o[p],i).get())&&(d=d|xs);var m=o[p]=o[p]||{};return m[a]=u,c?m[i]=h:$n(m,i).set(h),h!==null&&(d=d&~Yi),s[p]=s[p]|d,v},get:function(u){if(o){var h=f[u];if(h!==void 0)return c?o[h][i]:$n(o[h],i).get()}},rename:function(u,h){var d=f[u];return d===void 0||(s[d]=s[d]|hm,f[h]=d,delete f[u],o[d][a]=h),v},remove:function(u){var h=f[u];if(h===void 0)return v;var d=o[h];if(Object.keys(d).length>2)return s[h]=s[h]|xs,v.set(u,null);if(c){for(n=h;n<o.length;n++)s[n]=s[n]|pm;for(n=h;n<o.length;n++)f[o[n][a]]--;o.splice(h,1),delete f[u]}else $n(d,i).set(null),s[h]=s[h]|xs|Yi;return v},constructUpdate:function(){for(var u,h,d={},p=Object.keys(s),m=0;m<p.length;m++)h=p[m],u=r+"["+h+"]",o[h]?(s[h]&hm&&(d[u+"."+a]=o[h][a]),s[h]&xs&&(c?d[u+"."+i]=s[h]&Yi?null:o[h][i]:d[u+"."+i]=s[h]&Yi?null:$n(o[h],i).get())):d[u]=null;return d}};return v},RM=/^(.*)(\.[^\.\[\]]+|\[\d\])$/,EM=/^[^\.\[\]]+$/,zM=function(t,e){for(;e;){var r=t.match(RM);if(r)t=r[1];else if(t.match(EM))t="";else throw new Error("bad relativeAttr call:"+[t,e]);if(e.charAt(0)==="^")e=e.slice(1);else break}return t&&e.charAt(0)!=="["?t+"."+e:t+e},Ro=function(e){return window&&window.process&&window.process.versions?Object.prototype.toString.call(e)==="[object Object]":Object.prototype.toString.call(e)==="[object Object]"&&Object.getPrototypeOf(e).hasOwnProperty("hasOwnProperty")},IM=wt,Dh=function(e,r){if(e>0)return Math.log(e)/Math.LN10;var a=Math.log(Math.min(r[0],r[1]))/Math.LN10;return IM(a)||(a=Math.log(Math.max(r[0],r[1]))/Math.LN10-6),a},mm=ta.isArrayOrTypedArray,Xo=Ro,FM=function t(e,r){for(var a in r){var i=r[a],n=e[a];if(n!==i)if(a.charAt(0)==="_"||typeof i=="function"){if(a in e)continue;e[a]=i}else if(mm(i)&&mm(n)&&Xo(i[0])){if(a==="customdata"||a==="ids")continue;for(var o=Math.min(i.length,n.length),l=0;l<o;l++)n[l]!==i[l]&&Xo(i[l])&&Xo(n[l])&&t(n[l],i[l])}else Xo(i)&&Xo(n)&&(t(n,i),Object.keys(n).length||delete e[a])}};function NM(t,e){var r=t%e;return r<0?r+e:r}function HM(t,e){return Math.abs(t)>e/2?t-Math.round(t/e)*e:t}var rs={mod:NM,modHalf:HM},Z1={},Mr=function(t){var e=t.editType,r=t.colorEditType;r===void 0&&(r=e);var a={family:{valType:"string",noBlank:!0,strict:!0,editType:e,description:["HTML font family - the typeface that will be applied by the web browser.","The web browser will only be able to apply a font if it is available on the system","which it operates. Provide multiple font families, separated by commas, to indicate","the preference in which to apply fonts if they aren't available on the system.","The Chart Studio Cloud (at https://chart-studio.plotly.com or on-premise) generates images on a server,","where only a select number of","fonts are installed and supported.","These include *Arial*, *Balto*, *Courier New*, *Droid Sans*,, *Droid Serif*,","*Droid Sans Mono*, *Gravitas One*, *Old Standard TT*, *Open Sans*, *Overpass*,","*PT Sans Narrow*, *Raleway*, *Times New Roman*."].join(" ")},size:{valType:"number",min:1,editType:e},color:{valType:"color",editType:r},editType:e,description:""+(t.description||"")};return t.autoSize&&(a.size.dflt="auto"),t.autoColor&&(a.color.dflt="auto"),t.arrayOk&&(a.family.arrayOk=!0,a.size.arrayOk=!0,a.color.arrayOk=!0),a},Tc={YANGLE:60,HOVERARROWSIZE:6,HOVERTEXTPAD:3,HOVERFONTSIZE:13,HOVERFONT:"Arial, sans-serif",HOVERMINTIME:50,HOVERID:"-hover"},K1=Tc,Q1=Mr,$h=Q1({editType:"none",description:"Sets the default hover label font used by all traces on the graph."});$h.family.dflt=K1.HOVERFONT;$h.size.dflt=K1.HOVERFONTSIZE;var as={clickmode:{valType:"flaglist",flags:["event","select"],dflt:"event",editType:"plot",extras:["none"],description:["Determines the mode of single click interactions.","*event* is the default value and emits the `plotly_click`","event. In addition this mode emits the `plotly_selected` event","in drag modes *lasso* and *select*, but with no event data attached","(kept for compatibility reasons).","The *select* flag enables selecting single","data points via click. This mode also supports persistent selections,","meaning that pressing Shift while clicking, adds to / subtracts from an","existing selection. *select* with `hovermode`: *x* can be confusing, consider","explicitly setting `hovermode`: *closest* when using this feature.","Selection events are sent accordingly as long as *event* flag is set as well.","When the *event* flag is missing, `plotly_click` and `plotly_selected`","events are not fired."].join(" ")},dragmode:{valType:"enumerated",values:["zoom","pan","select","lasso","drawclosedpath","drawopenpath","drawline","drawrect","drawcircle","orbit","turntable",!1],dflt:"zoom",editType:"modebar",description:["Determines the mode of drag interactions.","*select* and *lasso* apply only to scatter traces with","markers or text. *orbit* and *turntable* apply only to","3D scenes."].join(" ")},hovermode:{valType:"enumerated",values:["x","y","closest",!1,"x unified","y unified"],dflt:"closest",editType:"modebar",description:["Determines the mode of hover interactions.","If *closest*, a single hoverlabel will appear","for the *closest* point within the `hoverdistance`.","If *x* (or *y*), multiple hoverlabels will appear for multiple points","at the *closest* x- (or y-) coordinate within the `hoverdistance`,","with the caveat that no more than one hoverlabel will appear per trace.","If *x unified* (or *y unified*), a single hoverlabel will appear","multiple points at the closest x- (or y-) coordinate within the `hoverdistance`","with the caveat that no more than one hoverlabel will appear per trace.","In this mode, spikelines are enabled by default perpendicular to the specified axis.","If false, hover interactions are disabled."].join(" ")},hoverdistance:{valType:"integer",min:-1,dflt:20,editType:"none",description:["Sets the default distance (in pixels) to look for data","to add hover labels (-1 means no cutoff, 0 means no looking for data).","This is only a real distance for hovering on point-like objects,","like scatter points. For area-like objects (bars, scatter fills, etc)","hovering is on inside the area and off outside, but these objects","will not supersede hover on point-like objects in case of conflict."].join(" ")},spikedistance:{valType:"integer",min:-1,dflt:-1,editType:"none",description:["Sets the default distance (in pixels) to look for data to draw","spikelines to (-1 means no cutoff, 0 means no looking for data).","As with hoverdistance, distance does not apply to area-like objects.","In addition, some objects can be hovered on but will not generate","spikelines, such as scatter fills."].join(" ")},hoverlabel:{bgcolor:{valType:"color",editType:"none",description:["Sets the background color of all hover labels on graph"].join(" ")},bordercolor:{valType:"color",editType:"none",description:["Sets the border color of all hover labels on graph."].join(" ")},font:$h,grouptitlefont:Q1({editType:"none",description:["Sets the font for group titles in hover (unified modes).","Defaults to `hoverlabel.font`."].join(" ")}),align:{valType:"enumerated",values:["left","right","auto"],dflt:"auto",editType:"none",description:["Sets the horizontal alignment of the text content within hover label box.","Has an effect only if the hover label text spans more two or more lines"].join(" ")},namelength:{valType:"integer",min:-1,dflt:15,editType:"none",description:["Sets the default length (in number of characters) of the trace name in","the hover labels for all traces. -1 shows the whole name","regardless of length. 0-3 shows the first 0-3 characters, and","an integer >3 will show the whole name if it is less than that","many characters, but if it is longer, will truncate to","`namelength - 3` characters and add an ellipsis."].join(" ")},editType:"none"},selectdirection:{valType:"enumerated",values:["h","v","d","any"],dflt:"any",description:["When `dragmode` is set to *select*, this limits the selection of the drag to","horizontal, vertical or diagonal. *h* only allows horizontal selection,","*v* only vertical, *d* only diagonal and *any* sets no limit."].join(" "),editType:"none"}},Qt={},ym=Ro,Yo=Array.isArray;function OM(t,e){var r,a;for(r=0;r<t.length;r++){if(a=t[r],a!==null&&typeof a=="object")return!1;a!==void 0&&(e[r]=a)}return!0}Qt.extendFlat=function(){return is(arguments,!1,!1,!1)};Qt.extendDeep=function(){return is(arguments,!0,!1,!1)};Qt.extendDeepAll=function(){return is(arguments,!0,!0,!1)};Qt.extendDeepNoArrays=function(){return is(arguments,!0,!1,!0)};function is(t,e,r,a){var i=t[0],n=t.length,o,l,s,f,c,v,u;if(n===2&&Yo(i)&&Yo(t[1])&&i.length===0){if(u=OM(t[1],i),u)return i;i.splice(0,i.length)}for(var h=1;h<n;h++){o=t[h];for(l in o)s=i[l],f=o[l],a&&Yo(f)?i[l]=f:e&&f&&(ym(f)||(c=Yo(f)))?(c?(c=!1,v=s&&Yo(s)?s:[]):v=s&&ym(s)?s:{},i[l]=is([v,f],e,r,a)):(typeof f<"u"||r)&&(i[l]=f)}return i}var jM=Mr,_s=as.hoverlabel,ws=Qt.extendFlat,kc={hoverlabel:{bgcolor:ws({},_s.bgcolor,{arrayOk:!0,description:"Sets the background color of the hover labels for this trace"}),bordercolor:ws({},_s.bordercolor,{arrayOk:!0,description:"Sets the border color of the hover labels for this trace."}),font:jM({arrayOk:!0,editType:"none",description:"Sets the font used in hover labels."}),align:ws({},_s.align,{arrayOk:!0}),namelength:ws({},_s.namelength,{arrayOk:!0}),editType:"none"}},BM=Mr,GM=kc,ba={type:{valType:"enumerated",values:[],dflt:"scatter",editType:"calc+clearAxisTypes",_noTemplating:!0},visible:{valType:"enumerated",values:[!0,!1,"legendonly"],dflt:!0,editType:"calc",description:["Determines whether or not this trace is visible.","If *legendonly*, the trace is not drawn,","but can appear as a legend item","(provided that the legend itself is visible)."].join(" ")},showlegend:{valType:"boolean",dflt:!0,editType:"style",description:["Determines whether or not an item corresponding to this","trace is shown in the legend."].join(" ")},legend:{valType:"subplotid",dflt:"legend",editType:"style",description:["Sets the reference to a legend to show this trace in.","References to these legends are *legend*, *legend2*, *legend3*, etc.","Settings for these legends are set in the layout, under","`layout.legend`, `layout.legend2`, etc."].join(" ")},legendgroup:{valType:"string",dflt:"",editType:"style",description:["Sets the legend group for this trace.","Traces and shapes part of the same legend group hide/show at the same time","when toggling legend items."].join(" ")},legendgrouptitle:{text:{valType:"string",dflt:"",editType:"style",description:["Sets the title of the legend group."].join(" ")},font:BM({editType:"style",description:["Sets this legend group's title font."].join(" ")}),editType:"style"},legendrank:{valType:"number",dflt:1e3,editType:"style",description:["Sets the legend rank for this trace.","Items and groups with smaller ranks are presented on top/left side while","with *reversed* `legend.traceorder` they are on bottom/right side.","The default legendrank is 1000,","so that you can use ranks less than 1000 to place certain items before all unranked items,","and ranks greater than 1000 to go after all unranked items.","When having unranked or equal rank items shapes would be displayed after traces","i.e. according to their order in data and layout."].join(" ")},legendwidth:{valType:"number",min:0,editType:"style",description:"Sets the width (in px or fraction) of the legend for this trace."},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"style",description:"Sets the opacity of the trace."},name:{valType:"string",editType:"style",description:["Sets the trace name.","The trace name appears as the legend item and on hover."].join(" ")},uid:{valType:"string",editType:"plot",anim:!0,description:["Assign an id to this trace,","Use this to provide object constancy between traces during animations","and transitions."].join(" ")},ids:{valType:"data_array",editType:"calc",anim:!0,description:["Assigns id labels to each datum.","These ids for object constancy of data points during animation.","Should be an array of strings, not numbers or any other type."].join(" ")},customdata:{valType:"data_array",editType:"calc",description:["Assigns extra data each datum.","This may be useful when listening to hover, click and selection events.","Note that, *scatter* traces also appends customdata items in the markers","DOM elements"].join(" ")},meta:{valType:"any",arrayOk:!0,editType:"plot",description:["Assigns extra meta information associated with this trace","that can be used in various text attributes.","Attributes such as trace `name`, graph, axis and colorbar `title.text`, annotation `text`","`rangeselector`, `updatemenues` and `sliders` `label` text","all support `meta`.","To access the trace `meta` values in an attribute in the same trace, simply use","`%{meta[i]}` where `i` is the index or key of the `meta`","item in question.","To access trace `meta` in layout attributes, use","`%{data[n[.meta[i]}` where `i` is the index or key of the `meta`","and `n` is the trace index."].join(" ")},selectedpoints:{valType:"any",editType:"calc",description:["Array containing integer indices of selected points.","Has an effect only for traces that support selections.","Note that an empty array means an empty selection where the `unselected`","are turned on for all points, whereas, any other non-array values means no","selection all where the `selected` and `unselected` styles have no effect."].join(" ")},hoverinfo:{valType:"flaglist",flags:["x","y","z","text","name"],extras:["all","none","skip"],arrayOk:!0,dflt:"all",editType:"none",description:["Determines which trace information appear on hover.","If `none` or `skip` are set, no information is displayed upon hovering.","But, if `none` is set, click and hover events are still fired."].join(" ")},hoverlabel:GM.hoverlabel,stream:{token:{valType:"string",noBlank:!0,strict:!0,editType:"calc",description:["The stream id number links a data trace on a plot with a stream.","See https://chart-studio.plotly.com/settings for more details."].join(" ")},maxpoints:{valType:"number",min:0,max:1e4,dflt:500,editType:"calc",description:["Sets the maximum number of points to keep on the plots from an","incoming stream.","If `maxpoints` is set to *50*, only the newest 50 points will","be displayed on the plot."].join(" ")},editType:"calc"},transforms:{_isLinkedToArray:"transform",editType:"calc",description:["WARNING: All transforms are deprecated and may be removed from the API in next major version.","An array of operations that manipulate the trace data,","for example filtering or sorting the data arrays."].join(" ")},uirevision:{valType:"any",editType:"none",description:["Controls persistence of some user-driven changes to the trace:","`constraintrange` in `parcoords` traces, as well as some","`editable: true` modifications such as `name` and `colorbar.title`.","Defaults to `layout.uirevision`.","Note that other user-driven trace attribute changes are controlled","by `layout` attributes:","`trace.visible` is controlled by `layout.legend.uirevision`,","`selectedpoints` is controlled by `layout.selectionrevision`,","and `colorbar.(x|y)` (accessible with `config: {editable: true}`)","is controlled by `layout.editrevision`.","Trace changes are tracked by `uid`, which only falls back on trace","index if no `uid` is provided. So if your app can add/remove traces","before the end of the `data` array, such that the same trace has a","different index, you can still preserve user-driven changes if you","give each trace a `uid` that stays with it as it moves."].join(" ")}},UM=ga,Ac={Greys:[[0,"rgb(0,0,0)"],[1,"rgb(255,255,255)"]],YlGnBu:[[0,"rgb(8,29,88)"],[.125,"rgb(37,52,148)"],[.25,"rgb(34,94,168)"],[.375,"rgb(29,145,192)"],[.5,"rgb(65,182,196)"],[.625,"rgb(127,205,187)"],[.75,"rgb(199,233,180)"],[.875,"rgb(237,248,217)"],[1,"rgb(255,255,217)"]],Greens:[[0,"rgb(0,68,27)"],[.125,"rgb(0,109,44)"],[.25,"rgb(35,139,69)"],[.375,"rgb(65,171,93)"],[.5,"rgb(116,196,118)"],[.625,"rgb(161,217,155)"],[.75,"rgb(199,233,192)"],[.875,"rgb(229,245,224)"],[1,"rgb(247,252,245)"]],YlOrRd:[[0,"rgb(128,0,38)"],[.125,"rgb(189,0,38)"],[.25,"rgb(227,26,28)"],[.375,"rgb(252,78,42)"],[.5,"rgb(253,141,60)"],[.625,"rgb(254,178,76)"],[.75,"rgb(254,217,118)"],[.875,"rgb(255,237,160)"],[1,"rgb(255,255,204)"]],Bluered:[[0,"rgb(0,0,255)"],[1,"rgb(255,0,0)"]],RdBu:[[0,"rgb(5,10,172)"],[.35,"rgb(106,137,247)"],[.5,"rgb(190,190,190)"],[.6,"rgb(220,170,132)"],[.7,"rgb(230,145,90)"],[1,"rgb(178,10,28)"]],Reds:[[0,"rgb(220,220,220)"],[.2,"rgb(245,195,157)"],[.4,"rgb(245,160,105)"],[1,"rgb(178,10,28)"]],Blues:[[0,"rgb(5,10,172)"],[.35,"rgb(40,60,190)"],[.5,"rgb(70,100,245)"],[.6,"rgb(90,120,245)"],[.7,"rgb(106,137,247)"],[1,"rgb(220,220,220)"]],Picnic:[[0,"rgb(0,0,255)"],[.1,"rgb(51,153,255)"],[.2,"rgb(102,204,255)"],[.3,"rgb(153,204,255)"],[.4,"rgb(204,204,255)"],[.5,"rgb(255,255,255)"],[.6,"rgb(255,204,255)"],[.7,"rgb(255,153,255)"],[.8,"rgb(255,102,204)"],[.9,"rgb(255,102,102)"],[1,"rgb(255,0,0)"]],Rainbow:[[0,"rgb(150,0,90)"],[.125,"rgb(0,0,200)"],[.25,"rgb(0,25,255)"],[.375,"rgb(0,152,255)"],[.5,"rgb(44,255,150)"],[.625,"rgb(151,255,0)"],[.75,"rgb(255,234,0)"],[.875,"rgb(255,111,0)"],[1,"rgb(255,0,0)"]],Portland:[[0,"rgb(12,51,131)"],[.25,"rgb(10,136,186)"],[.5,"rgb(242,211,56)"],[.75,"rgb(242,143,56)"],[1,"rgb(217,30,30)"]],Jet:[[0,"rgb(0,0,131)"],[.125,"rgb(0,60,170)"],[.375,"rgb(5,255,255)"],[.625,"rgb(255,255,0)"],[.875,"rgb(250,0,0)"],[1,"rgb(128,0,0)"]],Hot:[[0,"rgb(0,0,0)"],[.3,"rgb(230,0,0)"],[.6,"rgb(255,210,0)"],[1,"rgb(255,255,255)"]],Blackbody:[[0,"rgb(0,0,0)"],[.2,"rgb(230,0,0)"],[.4,"rgb(230,210,0)"],[.7,"rgb(255,255,255)"],[1,"rgb(160,200,255)"]],Earth:[[0,"rgb(0,0,130)"],[.1,"rgb(0,180,180)"],[.2,"rgb(40,210,40)"],[.4,"rgb(230,230,50)"],[.6,"rgb(120,70,20)"],[1,"rgb(255,255,255)"]],Electric:[[0,"rgb(0,0,0)"],[.15,"rgb(30,0,100)"],[.4,"rgb(120,0,100)"],[.6,"rgb(160,90,0)"],[.8,"rgb(230,200,0)"],[1,"rgb(255,250,220)"]],Viridis:[[0,"#440154"],[.06274509803921569,"#48186a"],[.12549019607843137,"#472d7b"],[.18823529411764706,"#424086"],[.25098039215686274,"#3b528b"],[.3137254901960784,"#33638d"],[.3764705882352941,"#2c728e"],[.4392156862745098,"#26828e"],[.5019607843137255,"#21918c"],[.5647058823529412,"#1fa088"],[.6274509803921569,"#28ae80"],[.6901960784313725,"#3fbc73"],[.7529411764705882,"#5ec962"],[.8156862745098039,"#84d44b"],[.8784313725490196,"#addc30"],[.9411764705882353,"#d8e219"],[1,"#fde725"]],Cividis:[[0,"rgb(0,32,76)"],[.058824,"rgb(0,42,102)"],[.117647,"rgb(0,52,110)"],[.176471,"rgb(39,63,108)"],[.235294,"rgb(60,74,107)"],[.294118,"rgb(76,85,107)"],[.352941,"rgb(91,95,109)"],[.411765,"rgb(104,106,112)"],[.470588,"rgb(117,117,117)"],[.529412,"rgb(131,129,120)"],[.588235,"rgb(146,140,120)"],[.647059,"rgb(161,152,118)"],[.705882,"rgb(176,165,114)"],[.764706,"rgb(192,177,109)"],[.823529,"rgb(209,191,102)"],[.882353,"rgb(225,204,92)"],[.941176,"rgb(243,219,79)"],[1,"rgb(255,233,69)"]]},J1=Ac.RdBu;function VM(t,e){if(e||(e=J1),!t)return e;function r(){try{t=Ac[t]||JSON.parse(t)}catch{t=e}}return typeof t=="string"&&(r(),typeof t=="string"&&r()),e_(t)?t:e}function e_(t){var e=0;if(!Array.isArray(t)||t.length<2||!t[0]||!t[t.length-1]||+t[0][0]!=0||+t[t.length-1][0]!=1)return!1;for(var r=0;r<t.length;r++){var a=t[r];if(a.length!==2||+a[0]<e||!UM(a[1]).isValid())return!1;e=+a[0]}return!0}function XM(t){return Ac[t]!==void 0?!0:e_(t)}var Eo={scales:Ac,defaultScale:J1,get:VM,isValid:XM},t_={exports:{}},zr={};zr.defaults=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"];zr.defaultLine="#444";zr.lightLine="#eee";zr.background="#fff";zr.borderLine="#BEC8D9";zr.lightFraction=100*(14-4)/(15-4);var Ea=ga,YM=wt,WM=ta.isTypedArray,Tr=t_.exports={},Mc=zr;Tr.defaults=Mc.defaults;var qM=Tr.defaultLine=Mc.defaultLine;Tr.lightLine=Mc.lightLine;var xd=Tr.background=Mc.background;Tr.tinyRGB=function(t){var e=t.toRgb();return"rgb("+Math.round(e.r)+", "+Math.round(e.g)+", "+Math.round(e.b)+")"};Tr.rgb=function(t){return Tr.tinyRGB(Ea(t))};Tr.opacity=function(t){return t?Ea(t).getAlpha():0};Tr.addOpacity=function(t,e){var r=Ea(t).toRgb();return"rgba("+Math.round(r.r)+", "+Math.round(r.g)+", "+Math.round(r.b)+", "+e+")"};Tr.combine=function(t,e){var r=Ea(t).toRgb();if(r.a===1)return Ea(t).toRgbString();var a=Ea(e||xd).toRgb(),i=a.a===1?a:{r:255*(1-a.a)+a.r*a.a,g:255*(1-a.a)+a.g*a.a,b:255*(1-a.a)+a.b*a.a},n={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 Ea(n).toRgbString()};Tr.contrast=function(t,e,r){var a=Ea(t);a.getAlpha()!==1&&(a=Ea(Tr.combine(t,xd)));var i=a.isDark()?e?a.lighten(e):xd:r?a.darken(r):qM;return i.toString()};Tr.stroke=function(t,e){var r=Ea(e);t.style({stroke:Tr.tinyRGB(r),"stroke-opacity":r.getAlpha()})};Tr.fill=function(t,e){var r=Ea(e);t.style({fill:Tr.tinyRGB(r),"fill-opacity":r.getAlpha()})};Tr.clean=function(t){if(!(!t||typeof t!="object")){var e=Object.keys(t),r,a,i,n;for(r=0;r<e.length;r++)if(i=e[r],n=t[i],i.substr(i.length-5)==="color")if(Array.isArray(n))for(a=0;a<n.length;a++)n[a]=mu(n[a]);else t[i]=mu(n);else if(i.substr(i.length-10)==="colorscale"&&Array.isArray(n))for(a=0;a<n.length;a++)Array.isArray(n[a])&&(n[a][1]=mu(n[a][1]));else if(Array.isArray(n)){var o=n[0];if(!Array.isArray(o)&&o&&typeof o=="object")for(a=0;a<n.length;a++)Tr.clean(n[a])}else n&&typeof n=="object"&&!WM(n)&&Tr.clean(n)}};function mu(t){if(YM(t)||typeof t!="string")return t;var e=t.trim();if(e.substr(0,3)!=="rgb")return t;var r=e.match(/^rgba?\s*\(([^()]*)\)$/);if(!r)return t;var a=r[1].trim().split(/\s*[\s,]\s*/),i=e.charAt(3)==="a"&&a.length===4;if(!i&&a.length!==3)return t;for(var n=0;n<a.length;n++){if(!a[n].length||(a[n]=Number(a[n]),!(a[n]>=0)))return t;if(n===3)a[n]>1&&(a[n]=1);else if(a[n]>=1)return t}var o=Math.round(a[0]*255)+", "+Math.round(a[1]*255)+", "+Math.round(a[2]*255);return i?"rgba("+o+", "+a[3]+")":"rgb("+o+")"}var ht=t_.exports,ns={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DESELECTDIM:.2},zo={};zo.counter=function(t,e,r,a){var i=(e||"")+(r?"":"$"),n=a===!1?"":"^";return t==="xy"?new RegExp(n+"x([2-9]|[1-9][0-9]+)?y([2-9]|[1-9][0-9]+)?"+i):new RegExp(n+t+"([2-9]|[1-9][0-9]+)?"+i)};(function(t){var e=wt,r=ga,a=ba,i=Eo,n=ht,o=ns.DESELECTDIM,l=Ch,s=zo.counter,f=rs.modHalf,c=ta.isArrayOrTypedArray;t.valObjectMeta={data_array:{description:["An {array} of data.","The value MUST be an {array}, or we ignore it.","Note that typed arrays (e.g. Float32Array) are supported."].join(" "),requiredOpts:[],otherOpts:["dflt"],coerceFunction:function(u,h,d){c(u)?h.set(u):d!==void 0&&h.set(d)}},enumerated:{description:["Enumerated value type. The available values are listed","in `values`."].join(" "),requiredOpts:["values"],otherOpts:["dflt","coerceNumber","arrayOk"],coerceFunction:function(u,h,d,p){p.coerceNumber&&(u=+u),p.values.indexOf(u)===-1?h.set(d):h.set(u)},validateFunction:function(u,h){h.coerceNumber&&(u=+u);for(var d=h.values,p=0;p<d.length;p++){var m=String(d[p]);if(m.charAt(0)==="/"&&m.charAt(m.length-1)==="/"){var y=new RegExp(m.substr(1,m.length-2));if(y.test(u))return!0}else if(u===d[p])return!0}return!1}},boolean:{description:"A boolean (true/false) value.",requiredOpts:[],otherOpts:["dflt"],coerceFunction:function(u,h,d){u===!0||u===!1?h.set(u):h.set(d)}},number:{description:["A number or a numeric value","(e.g. a number inside a string).","When applicable, values greater (less) than `max` (`min`)","are coerced to the `dflt`."].join(" "),requiredOpts:[],otherOpts:["dflt","min","max","arrayOk"],coerceFunction:function(u,h,d,p){!e(u)||p.min!==void 0&&u<p.min||p.max!==void 0&&u>p.max?h.set(d):h.set(+u)}},integer:{description:["An integer or an integer inside a string.","When applicable, values greater (less) than `max` (`min`)","are coerced to the `dflt`."].join(" "),requiredOpts:[],otherOpts:["dflt","min","max","arrayOk"],coerceFunction:function(u,h,d,p){u%1||!e(u)||p.min!==void 0&&u<p.min||p.max!==void 0&&u>p.max?h.set(d):h.set(+u)}},string:{description:["A string value.","Numbers are converted to strings except for attributes with","`strict` set to true."].join(" "),requiredOpts:[],otherOpts:["dflt","noBlank","strict","arrayOk","values"],coerceFunction:function(u,h,d,p){if(typeof u!="string"){var m=typeof u=="number";p.strict===!0||!m?h.set(d):h.set(String(u))}else p.noBlank&&!u?h.set(d):h.set(u)}},color:{description:["A string describing color.","Supported formats:","- hex (e.g. '#d3d3d3')","- rgb (e.g. 'rgb(255, 0, 0)')","- rgba (e.g. 'rgb(255, 0, 0, 0.5)')","- hsl (e.g. 'hsl(0, 100%, 50%)')","- hsv (e.g. 'hsv(0, 100%, 100%)')","- named colors (full list: http://www.w3.org/TR/css3-color/#svg-color)"].join(" "),requiredOpts:[],otherOpts:["dflt","arrayOk"],coerceFunction:function(u,h,d){r(u).isValid()?h.set(u):h.set(d)}},colorlist:{description:["A list of colors.","Must be an {array} containing valid colors."].join(" "),requiredOpts:[],otherOpts:["dflt"],coerceFunction:function(u,h,d){function p(m){return r(m).isValid()}!Array.isArray(u)||!u.length?h.set(d):u.every(p)?h.set(u):h.set(d)}},colorscale:{description:["A Plotly colorscale either picked by a name:","(any of",Object.keys(i.scales).join(", "),")","customized as an {array} of 2-element {arrays} where","the first element is the normalized color level value","(starting at *0* and ending at *1*),","and the second item is a valid color string."].join(" "),requiredOpts:[],otherOpts:["dflt"],coerceFunction:function(u,h,d){h.set(i.get(u,d))}},angle:{description:["A number (in degree) between -180 and 180."].join(" "),requiredOpts:[],otherOpts:["dflt","arrayOk"],coerceFunction:function(u,h,d){u==="auto"?h.set("auto"):e(u)?h.set(f(+u,360)):h.set(d)}},subplotid:{description:["An id string of a subplot type (given by dflt), optionally","followed by an integer >1. e.g. if dflt='geo', we can have","'geo', 'geo2', 'geo3', ..."].join(" "),requiredOpts:["dflt"],otherOpts:["regex"],coerceFunction:function(u,h,d,p){var m=p.regex||s(d);if(typeof u=="string"&&m.test(u)){h.set(u);return}h.set(d)},validateFunction:function(u,h){var d=h.dflt;return u===d?!0:typeof u!="string"?!1:!!s(d).test(u)}},flaglist:{description:["A string representing a combination of flags","(order does not matter here).","Combine any of the available `flags` with *+*.","(e.g. ('lines+markers')).","Values in `extras` cannot be combined."].join(" "),requiredOpts:["flags"],otherOpts:["dflt","extras","arrayOk"],coerceFunction:function(u,h,d,p){if((p.extras||[]).indexOf(u)!==-1){h.set(u);return}if(typeof u!="string"){h.set(d);return}for(var m=u.split("+"),y=0;y<m.length;){var b=m[y];p.flags.indexOf(b)===-1||m.indexOf(b)<y?m.splice(y,1):y++}m.length?h.set(m.join("+")):h.set(d)}},any:{description:"Any type.",requiredOpts:[],otherOpts:["dflt","values","arrayOk"],coerceFunction:function(u,h,d){u===void 0?h.set(d):h.set(u)}},info_array:{description:["An {array} of plot information."].join(" "),requiredOpts:["items"],otherOpts:["dflt","freeLength","dimensions"],coerceFunction:function(u,h,d,p){function m(z,O,I){var P,M={set:function(A){P=A}};return I===void 0&&(I=O.dflt),t.valObjectMeta[O.valType].coerceFunction(z,M,I,O),P}var y=p.dimensions===2||p.dimensions==="1-2"&&Array.isArray(u)&&Array.isArray(u[0]);if(!Array.isArray(u)){h.set(d);return}var b=p.items,w=[],g=Array.isArray(b),x=g&&y&&Array.isArray(b[0]),_=y&&g&&!x,T=g&&!_?b.length:u.length,k,S,L,D,$,E;if(d=Array.isArray(d)?d:[],y)for(k=0;k<T;k++)for(w[k]=[],L=Array.isArray(u[k])?u[k]:[],_?$=b.length:g?$=b[k].length:$=L.length,S=0;S<$;S++)_?D=b[S]:g?D=b[k][S]:D=b,E=m(L[S],D,(d[k]||[])[S]),E!==void 0&&(w[k][S]=E);else for(k=0;k<T;k++)E=m(u[k],g?b[k]:b,d[k]),E!==void 0&&(w[k]=E);h.set(w)},validateFunction:function(u,h){if(!Array.isArray(u))return!1;var d=h.items,p=Array.isArray(d),m=h.dimensions===2;if(!h.freeLength&&u.length!==d.length)return!1;for(var y=0;y<u.length;y++)if(m){if(!Array.isArray(u[y])||!h.freeLength&&u[y].length!==d[y].length)return!1;for(var b=0;b<u[y].length;b++)if(!v(u[y][b],p?d[y][b]:d))return!1}else if(!v(u[y],p?d[y]:d))return!1;return!0}}},t.coerce=function(u,h,d,p,m){var y=l(d,p).get(),b=l(u,p),w=l(h,p),g=b.get(),x=h._template;if(g===void 0&&x&&(g=l(x,p).get(),x=0),m===void 0&&(m=y.dflt),y.arrayOk&&c(g))return w.set(g),g;var _=t.valObjectMeta[y.valType].coerceFunction;_(g,w,m,y);var T=w.get();return x&&T===m&&!v(g,y)&&(g=l(x,p).get(),_(g,w,m,y),T=w.get()),T},t.coerce2=function(u,h,d,p,m){var y=l(u,p),b=t.coerce(u,h,d,p,m),w=y.get();return w!=null?b:!1},t.coerceFont=function(u,h,d){var p={};return d=d||{},p.family=u(h+".family",d.family),p.size=u(h+".size",d.size),p.color=u(h+".color",d.color),p},t.coercePattern=function(u,h,d,p){var m=u(h+".shape");if(m){u(h+".solidity"),u(h+".size");var y=u(h+".fillmode"),b=y==="overlay";if(!p){var w=u(h+".bgcolor",b?d:void 0);u(h+".fgcolor",b?n.contrast(w):d)}u(h+".fgopacity",b?.5:1)}},t.coerceHoverinfo=function(u,h,d){var p=h._module.attributes,m=p.hoverinfo?p:a,y=m.hoverinfo,b;if(d._dataLength===1){var w=y.dflt==="all"?y.flags.slice():y.dflt.split("+");w.splice(w.indexOf("name"),1),b=w.join("+")}return t.coerce(u,h,m,"hoverinfo",b)},t.coerceSelectionMarkerOpacity=function(u,h){if(u.marker){var d=u.marker.opacity;if(d!==void 0){var p,m;!c(d)&&!u.selected&&!u.unselected&&(p=d,m=o*d),h("selected.marker.opacity",p),h("unselected.marker.opacity",m)}}};function v(u,h){var d=t.valObjectMeta[h.valType];if(h.arrayOk&&c(u))return!0;if(d.validateFunction)return d.validateFunction(u,h);var p={},m=p,y={set:function(b){m=b}};return d.coerceFunction(u,y,p,h),m!==p}t.validate=v})(Z1);var r_={},a_={exports:{}},i_={staticPlot:{valType:"boolean",dflt:!1,description:["Determines whether the graphs are interactive or not.","If *false*, no interactivity, for export or image generation."].join(" ")},typesetMath:{valType:"boolean",dflt:!0,description:["Determines whether math should be typeset or not,","when MathJax (either v2 or v3) is present on the page."].join(" ")},plotlyServerURL:{valType:"string",dflt:"",description:["When set it determines base URL for","the 'Edit in Chart Studio' `showEditInChartStudio`/`showSendToCloud` mode bar button","and the showLink/sendData on-graph link.","To enable sending your data to Chart Studio Cloud, you need to","set both `plotlyServerURL` to 'https://chart-studio.plotly.com' and","also set `showSendToCloud` to true."].join(" ")},editable:{valType:"boolean",dflt:!1,description:["Determines whether the graph is editable or not.","Sets all pieces of `edits`","unless a separate `edits` config item overrides individual parts."].join(" ")},edits:{annotationPosition:{valType:"boolean",dflt:!1,description:["Determines if the main anchor of the annotation is editable.","The main anchor corresponds to the","text (if no arrow) or the arrow (which drags the whole thing leaving","the arrow length & direction unchanged)."].join(" ")},annotationTail:{valType:"boolean",dflt:!1,description:["Has only an effect for annotations with arrows.","Enables changing the length and direction of the arrow."].join(" ")},annotationText:{valType:"boolean",dflt:!1,description:"Enables editing annotation text."},axisTitleText:{valType:"boolean",dflt:!1,description:"Enables editing axis title text."},colorbarPosition:{valType:"boolean",dflt:!1,description:"Enables moving colorbars."},colorbarTitleText:{valType:"boolean",dflt:!1,description:"Enables editing colorbar title text."},legendPosition:{valType:"boolean",dflt:!1,description:"Enables moving the legend."},legendText:{valType:"boolean",dflt:!1,description:"Enables editing the trace name fields from the legend"},shapePosition:{valType:"boolean",dflt:!1,description:"Enables moving shapes."},titleText:{valType:"boolean",dflt:!1,description:"Enables editing the global layout title."}},editSelection:{valType:"boolean",dflt:!0,description:"Enables moving selections."},autosizable:{valType:"boolean",dflt:!1,description:["Determines whether the graphs are plotted with respect to","layout.autosize:true and infer its container size."].join(" ")},responsive:{valType:"boolean",dflt:!1,description:["Determines whether to change the layout size when window is resized.","In v3, this option will be removed and will always be true."].join(" ")},fillFrame:{valType:"boolean",dflt:!1,description:["When `layout.autosize` is turned on, determines whether the graph","fills the container (the default) or the screen (if set to *true*)."].join(" ")},frameMargins:{valType:"number",dflt:0,min:0,max:.5,description:["When `layout.autosize` is turned on, set the frame margins","in fraction of the graph size."].join(" ")},scrollZoom:{valType:"flaglist",flags:["cartesian","gl3d","geo","mapbox"],extras:[!0,!1],dflt:"gl3d+geo+mapbox",description:["Determines whether mouse wheel or two-finger scroll zooms is enable.","Turned on by default for gl3d, geo and mapbox subplots","(as these subplot types do not have zoombox via pan),","but turned off by default for cartesian subplots.","Set `scrollZoom` to *false* to disable scrolling for all subplots."].join(" ")},doubleClick:{valType:"enumerated",values:[!1,"reset","autosize","reset+autosize"],dflt:"reset+autosize",description:["Sets the double click interaction mode.","Has an effect only in cartesian plots.","If *false*, double click is disable.","If *reset*, double click resets the axis ranges to their initial values.","If *autosize*, double click set the axis ranges to their autorange values.","If *reset+autosize*, the odd double clicks resets the axis ranges","to their initial values and even double clicks set the axis ranges","to their autorange values."].join(" ")},doubleClickDelay:{valType:"number",dflt:300,min:0,description:["Sets the delay for registering a double-click in ms.","This is the time interval (in ms) between first mousedown and","2nd mouseup to constitute a double-click.","This setting propagates to all on-subplot double clicks","(except for geo and mapbox) and on-legend double clicks."].join(" ")},showAxisDragHandles:{valType:"boolean",dflt:!0,description:["Set to *false* to omit cartesian axis pan/zoom drag handles."].join(" ")},showAxisRangeEntryBoxes:{valType:"boolean",dflt:!0,description:["Set to *false* to omit direct range entry at the pan/zoom drag points,","note that `showAxisDragHandles` must be enabled to have an effect."].join(" ")},showTips:{valType:"boolean",dflt:!0,description:["Determines whether or not tips are shown while interacting","with the resulting graphs."].join(" ")},showLink:{valType:"boolean",dflt:!1,description:["Determines whether a link to Chart Studio Cloud is displayed","at the bottom right corner of resulting graphs.","Use with `sendData` and `linkText`."].join(" ")},linkText:{valType:"string",dflt:"Edit chart",noBlank:!0,description:["Sets the text appearing in the `showLink` link."].join(" ")},sendData:{valType:"boolean",dflt:!0,description:["If *showLink* is true, does it contain data","just link to a Chart Studio Cloud file?"].join(" ")},showSources:{valType:"any",dflt:!1,description:["Adds a source-displaying function to show sources on","the resulting graphs."].join(" ")},displayModeBar:{valType:"enumerated",values:["hover",!0,!1],dflt:"hover",description:["Determines the mode bar display mode.","If *true*, the mode bar is always visible.","If *false*, the mode bar is always hidden.","If *hover*, the mode bar is visible while the mouse cursor","is on the graph container."].join(" ")},showSendToCloud:{valType:"boolean",dflt:!1,description:['Should we include a ModeBar button, labeled "Edit in Chart Studio",',"that sends this chart to chart-studio.plotly.com (formerly plot.ly) or another plotly server","as specified by `plotlyServerURL` for editing, export, etc? Prior to version 1.43.0","this button was included by default, now it is opt-in using this flag.","Note that this button can (depending on `plotlyServerURL` being set) send your data","to an external server. However that server does not persist your data",'until you arrive at the Chart Studio and explicitly click "Save".'].join(" ")},showEditInChartStudio:{valType:"boolean",dflt:!1,description:["Same as `showSendToCloud`, but use a pencil icon instead of a floppy-disk.","Note that if both `showSendToCloud` and `showEditInChartStudio` are turned,","only `showEditInChartStudio` will be honored."].join(" ")},modeBarButtonsToRemove:{valType:"any",dflt:[],description:["Remove mode bar buttons by name.","See ./components/modebar/buttons.js for the list of names."].join(" ")},modeBarButtonsToAdd:{valType:"any",dflt:[],description:["Add mode bar button using config objects","See ./components/modebar/buttons.js for list of arguments.","To enable predefined modebar buttons e.g. shape drawing, hover and spikelines,","simply provide their string name(s). This could include:","*v1hovermode*, *hoverclosest*, *hovercompare*, *togglehover*, *togglespikelines*,","*drawline*, *drawopenpath*, *drawclosedpath*, *drawcircle*, *drawrect* and *eraseshape*.","Please note that these predefined buttons will only be shown if they are compatible","with all trace types used in a graph."].join(" ")},modeBarButtons:{valType:"any",dflt:!1,description:["Define fully custom mode bar buttons as nested array,","where the outer arrays represents button groups, and","the inner arrays have buttons config objects or names of default buttons","See ./components/modebar/buttons.js for more info."].join(" ")},toImageButtonOptions:{valType:"any",dflt:{},description:["Statically override options for toImage modebar button","allowed keys are format, filename, width, height, scale","see ../components/modebar/buttons.js"].join(" ")},displaylogo:{valType:"boolean",dflt:!0,description:["Determines whether or not the plotly logo is displayed","on the end of the mode bar."].join(" ")},watermark:{valType:"boolean",dflt:!1,description:"watermark the images with the company's logo"},plotGlPixelRatio:{valType:"number",dflt:2,min:1,max:4,description:["Set the pixel ratio during WebGL image export.","This config option was formerly named `plot3dPixelRatio`","which is now deprecated."].join(" ")},setBackground:{valType:"any",dflt:"transparent",description:["Set function to add the background color (i.e. `layout.paper_color`)","to a different container.","This function take the graph div as first argument and the current background","color as second argument.","Alternatively, set to string *opaque* to ensure there is white behind it."].join(" ")},topojsonURL:{valType:"string",noBlank:!0,dflt:"https://cdn.plot.ly/",description:["Set the URL to topojson used in geo charts.","By default, the topojson files are fetched from cdn.plot.ly.","For example, set this option to:","<path-to-plotly.js>/dist/topojson/","to render geographical feature using the topojson files","that ship with the plotly.js module."].join(" ")},mapboxAccessToken:{valType:"string",dflt:null,description:["Mapbox access token (required to plot mapbox trace types)","If using an Mapbox Atlas server, set this option to ''","so that plotly.js won't attempt to authenticate to the public Mapbox server."].join(" ")},logging:{valType:"integer",min:0,max:2,dflt:1,description:["Turn all console logging on or off (errors will be thrown)","This should ONLY be set via Plotly.setPlotConfig","Available levels:","0: no logs","1: warnings and errors, but not informational messages","2: verbose logs"].join(" ")},notifyOnLogging:{valType:"integer",min:0,max:2,dflt:0,description:["Set on-graph logging (notifier) level","This should ONLY be set via Plotly.setPlotConfig","Available levels:","0: no on-graph logs","1: warnings and errors, but not informational messages","2: verbose logs"].join(" ")},queueLength:{valType:"integer",min:0,dflt:0,description:"Sets the length of the undo/redo queue."},globalTransforms:{valType:"any",dflt:[],description:["Set global transform to be applied to all traces with no","specification needed"].join(" ")},locale:{valType:"string",dflt:"en-US",description:["Which localization should we use?","Should be a string like 'en' or 'en-US'."].join(" ")},locales:{valType:"any",dflt:{},description:["Localization definitions","Locales can be provided either here (specific to one chart) or globally","by registering them as modules.","Should be an object of objects {locale: {dictionary: {...}, format: {...}}}","{"," da: {"," dictionary: {'Reset axes': 'Nulstil aksler', ...},"," format: {months: [...], shortMonths: [...]}"," },"," ...","}","All parts are optional. When looking for translation or format fields, we","look first for an exact match in a config locale, then in a registered","module. If those fail, we strip off any regionalization ('en-US' -> 'en')","and try each (config, registry) again. The final fallback for translation","is untranslated (which is US English) and for formats is the base English","(the only consequence being the last fallback date format %x is DD/MM/YYYY","instead of MM/DD/YYYY). Currently `grouping` and `currency` are ignored","for our automatic number formatting, but can be used in custom formats."].join(" ")}},n_={};function o_(t,e){for(var r in t){var a=t[r];a.valType?e[r]=a.dflt:(e[r]||(e[r]={}),o_(a,e[r]))}}o_(i_,n_);var Io={configAttributes:i_,dfltConfig:n_},yu=gt,ZM=wt,Wo=[],l_=function(t,e){if(Wo.indexOf(t)!==-1)return;Wo.push(t);var r=1e3;ZM(e)?r=e:e==="long"&&(r=3e3);var a=yu.select("body").selectAll(".plotly-notifier").data([0]);a.enter().append("div").classed("plotly-notifier",!0);var i=a.selectAll(".notifier-note").data(Wo);function n(o){o.duration(700).style("opacity",0).each("end",function(l){var s=Wo.indexOf(l);s!==-1&&Wo.splice(s,1),yu.select(this).remove()})}i.enter().append("div").classed("notifier-note",!0).style("opacity",0).each(function(o){var l=yu.select(this);l.append("button").classed("notifier-close",!0).html("&times;").on("click",function(){l.transition().call(n)});for(var s=l.append("p"),f=o.split(/<br\s*\/?>/g),c=0;c<f.length;c++)c&&s.append("br"),s.append("span").text(f[c]);e==="stick"?l.transition().duration(350).style("opacity",1):l.transition().duration(700).style("opacity",1).transition().delay(r).call(n)})},_o=Io.dfltConfig,Ph=l_,Rh=a_.exports={};Rh.log=function(){var t;if(_o.logging>1){var e=["LOG:"];for(t=0;t<arguments.length;t++)e.push(arguments[t]);console.trace.apply(console,e)}if(_o.notifyOnLogging>1){var r=[];for(t=0;t<arguments.length;t++)r.push(arguments[t]);Ph(r.join("<br>"),"long")}};Rh.warn=function(){var t;if(_o.logging>0){var e=["WARN:"];for(t=0;t<arguments.length;t++)e.push(arguments[t]);console.trace.apply(console,e)}if(_o.notifyOnLogging>0){var r=[];for(t=0;t<arguments.length;t++)r.push(arguments[t]);Ph(r.join("<br>"),"stick")}};Rh.error=function(){var t;if(_o.logging>0){var e=["ERROR:"];for(t=0;t<arguments.length;t++)e.push(arguments[t]);console.error.apply(console,e)}if(_o.notifyOnLogging>0){var r=[];for(t=0;t<arguments.length;t++)r.push(arguments[t]);Ph(r.join("<br>"),"stick")}};var Fo=a_.exports,ot={},Eh=function(){},s_=function(e,r){if(r instanceof RegExp){for(var a=r.toString(),i=0;i<e.length;i++)if(e[i]instanceof RegExp&&e[i].toString()===a)return e;e.push(r)}else(r||r===0)&&e.indexOf(r)===-1&&e.push(r);return e},Sc={};(function(t){var e=E1;t.init2dArray=function(r,a){for(var i=new Array(r),n=0;n<r;n++)i[n]=new Array(a);return i},t.transposeRagged=function(r){var a=0,i=r.length,n,o;for(n=0;n<i;n++)a=Math.max(a,r[n].length);var l=new Array(a);for(n=0;n<a;n++)for(l[n]=new Array(i),o=0;o<i;o++)l[n][o]=r[o][n];return l},t.dot=function(r,a){if(!(r.length&&a.length)||r.length!==a.length)return null;var i=r.length,n,o;if(r[0].length)for(n=new Array(i),o=0;o<i;o++)n[o]=t.dot(r[o],a);else if(a[0].length){var l=t.transposeRagged(a);for(n=new Array(l.length),o=0;o<l.length;o++)n[o]=t.dot(r,l[o])}else for(n=0,o=0;o<i;o++)n+=r[o]*a[o];return n},t.translationMatrix=function(r,a){return[[1,0,r],[0,1,a],[0,0,1]]},t.rotationMatrix=function(r){var a=r*Math.PI/180;return[[Math.cos(a),-Math.sin(a),0],[Math.sin(a),Math.cos(a),0],[0,0,1]]},t.rotationXYMatrix=function(r,a,i){return t.dot(t.dot(t.translationMatrix(a,i),t.rotationMatrix(r)),t.translationMatrix(-a,-i))},t.apply3DTransform=function(r){return function(){var a=arguments,i=arguments.length===1?a[0]:[a[0],a[1],a[2]||0];return t.dot(r,[i[0],i[1],i[2],1]).slice(0,3)}},t.apply2DTransform=function(r){return function(){var a=arguments;a.length===3&&(a=a[0]);var i=arguments.length===1?a[0]:[a[0],a[1]];return t.dot(r,[i[0],i[1],1]).slice(0,2)}},t.apply2DTransform2=function(r){var a=t.apply2DTransform(r);return function(i){return a(i.slice(0,2)).concat(a(i.slice(2,4)))}},t.convertCssMatrix=function(r){if(r){var a=r.length;if(a===16)return r;if(a===6)return[r[0],r[1],0,0,r[2],r[3],0,0,0,0,1,0,r[4],r[5],0,1]}return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]},t.inverseTransformMatrix=function(r){var a=[];return e.invert(a,r),[[a[0],a[1],a[2],a[3]],[a[4],a[5],a[6],a[7]],[a[8],a[9],a[10],a[11]],[a[12],a[13],a[14],a[15]]]}})(Sc);var KM=gt,QM=Fo,JM=Sc,eS=E1;function tS(t){var e;if(typeof t=="string"){if(e=document.getElementById(t),e===null)throw new Error("No DOM element with id '"+t+"' exists on the page.");return e}else if(t==null)throw new Error("DOM element provided is null or undefined");return t}function rS(t){var e=KM.select(t);return e.node()instanceof HTMLElement&&e.size()&&e.classed("js-plotly-plot")}function f_(t){var e=t&&t.parentNode;e&&e.removeChild(t)}function aS(t,e){c_("global",t,e)}function c_(t,e,r){var a="plotly.js-style-"+t,i=document.getElementById(a);i||(i=document.createElement("style"),i.setAttribute("id",a),i.appendChild(document.createTextNode("")),document.head.appendChild(i));var n=i.sheet;n.insertRule?n.insertRule(e+"{"+r+"}",0):n.addRule?n.addRule(e,r,0):QM.warn("addStyleRule failed")}function iS(t){var e="plotly.js-style-"+t,r=document.getElementById(e);r&&f_(r)}function nS(t){var e=v_(t),r=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];return e.forEach(function(a){var i=u_(a);if(i){var n=JM.convertCssMatrix(i);r=eS.multiply(r,r,n)}}),r}function u_(t){var e=window.getComputedStyle(t,null),r=e.getPropertyValue("-webkit-transform")||e.getPropertyValue("-moz-transform")||e.getPropertyValue("-ms-transform")||e.getPropertyValue("-o-transform")||e.getPropertyValue("transform");return r==="none"?null:r.replace("matrix","").replace("3d","").slice(1,-1).split(",").map(function(a){return+a})}function v_(t){for(var e=[];oS(t);)e.push(t),t=t.parentNode;return e}function oS(t){return t&&(t instanceof Element||t instanceof HTMLElement)}function lS(t,e){return t&&e&&t.top===e.top&&t.left===e.left&&t.right===e.right&&t.bottom===e.bottom}var Lc={getGraphDiv:tS,isPlotDiv:rS,removeElement:f_,addStyleRule:aS,addRelatedStyleRule:c_,deleteRelatedStyleRule:iS,getFullTransformMatrix:nS,getElementTransformMatrix:u_,getElementAndAncestors:v_,equalDomRects:lS},Cc={mode:{valType:"enumerated",dflt:"afterall",values:["immediate","next","afterall"],description:["Describes how a new animate call interacts with currently-running","animations. If `immediate`, current animations are interrupted and","the new animation is started. If `next`, the current frame is allowed","to complete, after which the new animation is started. If `afterall`","all existing frames are animated to completion before the new animation","is started."].join(" ")},direction:{valType:"enumerated",values:["forward","reverse"],dflt:"forward",description:["The direction in which to play the frames triggered by the animation call"].join(" ")},fromcurrent:{valType:"boolean",dflt:!1,description:["Play frames starting at the current frame instead of the beginning."].join(" ")},frame:{duration:{valType:"number",min:0,dflt:500,description:["The duration in milliseconds of each frame. If greater than the frame","duration, it will be limited to the frame duration."].join(" ")},redraw:{valType:"boolean",dflt:!0,description:["Redraw the plot at completion of the transition. This is desirable","for transitions that include properties that cannot be transitioned,","but may significantly slow down updates that do not require a full","redraw of the plot"].join(" ")}},transition:{duration:{valType:"number",min:0,dflt:500,editType:"none",description:["The duration of the transition, in milliseconds. If equal to zero,","updates are synchronous."].join(" ")},easing:{valType:"enumerated",dflt:"cubic-in-out",values:["linear","quad","cubic","sin","exp","circle","elastic","back","bounce","linear-in","quad-in","cubic-in","sin-in","exp-in","circle-in","elastic-in","back-in","bounce-in","linear-out","quad-out","cubic-out","sin-out","exp-out","circle-out","elastic-out","back-out","bounce-out","linear-in-out","quad-in-out","cubic-in-out","sin-in-out","exp-in-out","circle-in-out","elastic-in-out","back-in-out","bounce-in-out"],editType:"none",description:"The easing function used for the transition"},ordering:{valType:"enumerated",values:["layout first","traces first"],dflt:"layout first",editType:"none",description:["Determines whether the figure's layout or traces smoothly transitions","during updates that make both traces and layout change."].join(" ")}}},d_=Qt.extendFlat,sS=Ro,h_={valType:"flaglist",extras:["none"],flags:["calc","clearAxisTypes","plot","style","markerSize","colorbars"],description:["trace attributes should include an `editType` string matching this flaglist.","*calc* is the most extensive: a full (re)plot starting by clearing `gd.calcdata`","to force it to be regenerated","*clearAxisTypes* resets the types of the axes this trace is on, because new data could","cause the automatic axis type detection to change. Log type will not be cleared, as that","is never automatically chosen so must have been user-specified.","*plot* (re)plots but without first clearing `gd.calcdata`.","*style* only calls `module.style` (or module.editStyle) for all trace modules and redraws the legend.","*markerSize* is like *style*, but propagate axis-range changes due to scatter `marker.size`","*colorbars* only redraws colorbars."].join(" ")},p_={valType:"flaglist",extras:["none"],flags:["calc","plot","legend","ticks","axrange","layoutstyle","modebar","camera","arraydraw","colorbars"],description:["layout attributes should include an `editType` string matching this flaglist.","*calc* is the most extensive: a full (re)plot starting by clearing `gd.calcdata`","to force it to be regenerated","*plot* (re)plots but without first clearing `gd.calcdata`.","*legend* only redraws the legend.","*ticks* only redraws axis ticks, labels, and gridlines.","*axrange* minimal sequence when updating axis ranges.","*layoutstyle* reapplies global and SVG cartesian axis styles.","*modebar* just updates the modebar.","*camera* just updates the camera settings for gl3d scenes.","*arraydraw* allows component arrays to invoke the redraw routines just for the","component(s) that changed.","*colorbars* only redraws colorbars."].join(" ")},fS=h_.flags.slice().concat(["fullReplot"]),cS=p_.flags.slice().concat("layoutReplot"),Ya={traces:h_,layout:p_,traceFlags:function(){return gm(fS)},layoutFlags:function(){return gm(cS)},update:function(t,e){var r=e.editType;if(r&&r!=="none")for(var a=r.split("+"),i=0;i<a.length;i++)t[a[i]]=!0},overrideAll:m_};function gm(t){for(var e={},r=0;r<t.length;r++)e[t[r]]=!1;return e}function m_(t,e,r){var a=d_({},t);for(var i in a){var n=a[i];sS(n)&&(a[i]=y_(n,e,r,i))}return r==="from-root"&&(a.editType=e),a}function y_(t,e,r,a){if(t.valType){var i=d_({},t);if(i.editType=e,Array.isArray(t.items)){i.items=new Array(t.items.length);for(var n=0;n<t.items.length;n++)i.items[n]=y_(t.items[n],e)}return i}else return m_(t,e,a.charAt(0)==="_"?"nested":"from-root")}var ra={};ra.dash={valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid",editType:"style",description:["Sets the dash style of lines. Set to a dash type string","(*solid*, *dot*, *dash*, *longdash*, *dashdot*, or *longdashdot*)","or a dash length list in px (eg *5px,10px,2px,2px*)."].join(" ")};ra.pattern={shape:{valType:"enumerated",values:["","/","\\","x","-","|","+","."],dflt:"",arrayOk:!0,editType:"style",description:["Sets the shape of the pattern fill.","By default, no pattern is used for filling the area."].join(" ")},fillmode:{valType:"enumerated",values:["replace","overlay"],dflt:"replace",editType:"style",description:["Determines whether `marker.color` should be used","as a default to `bgcolor` or a `fgcolor`."].join(" ")},bgcolor:{valType:"color",arrayOk:!0,editType:"style",description:["When there is no colorscale sets the color of background pattern fill.","Defaults to a `marker.color` background when `fillmode` is *overlay*.","Otherwise, defaults to a transparent background."].join(" ")},fgcolor:{valType:"color",arrayOk:!0,editType:"style",description:["When there is no colorscale sets the color of foreground pattern fill.","Defaults to a `marker.color` background when `fillmode` is *replace*.","Otherwise, defaults to dark grey or white","to increase contrast with the `bgcolor`."].join(" ")},fgopacity:{valType:"number",editType:"style",min:0,max:1,description:["Sets the opacity of the foreground pattern fill.","Defaults to a 0.5 when `fillmode` is *overlay*.","Otherwise, defaults to 1."].join(" ")},size:{valType:"number",min:0,dflt:8,arrayOk:!0,editType:"style",description:["Sets the size of unit squares of the pattern fill in pixels,","which corresponds to the interval of repetition of the pattern."].join(" ")},solidity:{valType:"number",min:0,max:1,dflt:.3,arrayOk:!0,editType:"style",description:["Sets the solidity of the pattern fill.","Solidity is roughly the fraction of the area filled by the pattern.","Solidity of 0 shows only the background color without pattern","and solidty of 1 shows only the foreground color without pattern."].join(" ")},editType:"style",description:["Sets the pattern within the marker."].join(" ")};var Dr={},g_={FORMAT_LINK:"https://github.com/d3/d3-format/tree/v1.4.5#d3-format",DATE_FORMAT_LINK:"https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format"},b_=g_,x_=b_.FORMAT_LINK,__=b_.DATE_FORMAT_LINK;function w_(t){var e=t&&t.supportOther;return["Variables are inserted using %{variable},",'for example "y: %{y}"'+(e?" as well as %{xother}, {%_xother}, {%_xother_}, {%xother_}. When showing info for several points, *xother* will be added to those with different x positions from the first point. An underscore before or after *(x|y)other* will add a space on that side, only when this field is shown.":"."),`Numbers are formatted using d3-format's syntax %{variable:d3-format}, for example "Price: %{y:$.2f}".`,x_,"for details on the formatting syntax.",`Dates are formatted using d3-time-format's syntax %{variable|d3-time-format}, for example "Day: %{2019-01-01|%A}".`,__,"for details on the date formatting syntax."].join(" ")}function uS(){return["Variables are inserted using %{variable},",'for example "x0: %{x0}".',`Numbers are formatted using d3-format's syntax %{variable:d3-format}, for example "Price: %{x0:$.2f}". See`,x_,"for details on the formatting syntax.",`Dates are formatted using d3-time-format's syntax %{variable|d3-time-format}, for example "Day: %{x0|%m %b %Y}". See`,__,"for details on the date formatting syntax.","A single multiplication or division operation may be applied to numeric variables, and combined with",'d3 number formatting, for example "Length in cm: %{x0*2.54}", "%{slope*60:.1f} meters per second."',"For log axes, variable values are given in log units.","For date axes, x/y coordinate variables and center variables use datetimes, while all other variable values use values in ms."].join(" ")}function zh(t){var e=t.description?" "+t.description:"",r=t.keys||[];if(r.length>0){for(var a=[],i=0;i<r.length;i++)a[i]="`"+r[i]+"`";e=e+"Finally, the template string has access to ",r.length===1?e=e+"variable "+a[0]:e=e+"variables "+a.slice(0,-1).join(", ")+" and "+a.slice(-1)+"."}return e}Dr.hovertemplateAttrs=function(t,e){t=t||{},e=e||{};var r=zh(e),a={valType:"string",dflt:"",editType:t.editType||"none",description:["Template string used for rendering the information that appear on hover box.","Note that this will override `hoverinfo`.",w_({supportOther:!0}),"The variables available in `hovertemplate` are the ones emitted as event data described at this link https://plotly.com/javascript/plotlyjs-events/#event-data.","Additionally, every attributes that can be specified per-point (the ones that are `arrayOk: true`) are available.",r,'Anything contained in tag `<extra>` is displayed in the secondary box, for example "<extra>{fullData.name}</extra>".',"To hide the secondary box completely, use an empty tag `<extra></extra>`."].join(" ")};return t.arrayOk!==!1&&(a.arrayOk=!0),a};Dr.texttemplateAttrs=function(t,e){t=t||{},e=e||{};var r=zh(e),a={valType:"string",dflt:"",editType:t.editType||"calc",description:["Template string used for rendering the information text that appear on points.","Note that this will override `textinfo`.",w_(),"Every attributes that can be specified per-point (the ones that are `arrayOk: true`) are available.",r].join(" ")};return t.arrayOk!==!1&&(a.arrayOk=!0),a};Dr.shapeTexttemplateAttrs=function(t,e){t=t||{},e=e||{};var r=t.newshape?"new ":"",a=zh(e),i={valType:"string",dflt:"",editType:t.editType||"arraydraw",description:["Template string used for rendering the "+r+"shape's label.","Note that this will override `text`.",uS(),a].join(" ")};return i};function Ei(t,e){return e?e.d2l(t):t}function T_(t,e){return e?e.l2d(t):t}function vS(t){return t.x0}function dS(t){return t.x1}function hS(t){return t.y0}function pS(t){return t.y1}function Dc(t,e){return Ei(t.x1,e)-Ei(t.x0,e)}function $c(t,e,r){return Ei(t.y1,r)-Ei(t.y0,r)}function mS(t,e){return Math.abs(Dc(t,e))}function yS(t,e,r){return Math.abs($c(t,e,r))}function gS(t,e,r){return t.type!=="line"?void 0:Math.sqrt(Math.pow(Dc(t,e),2)+Math.pow($c(t,e,r),2))}function bS(t,e){return T_((Ei(t.x1,e)+Ei(t.x0,e))/2,e)}function xS(t,e,r){return T_((Ei(t.y1,r)+Ei(t.y0,r))/2,r)}function _S(t,e,r){return t.type!=="line"?void 0:$c(t,e,r)/Dc(t,e)}var Ih={x0:vS,x1:dS,y0:hS,y1:pS,slope:_S,dx:Dc,dy:$c,width:mS,height:yS,length:gS,xcenter:bS,ycenter:xS},wS=Ya.overrideAll,Wi=ba,bm=Mr,TS=ra.dash,hi=Qt.extendFlat,kS=Dr.shapeTexttemplateAttrs,AS=Ih,MS=wS({newshape:{visible:hi({},Wi.visible,{description:["Determines whether or not new shape is visible.","If *legendonly*, the shape is not drawn,","but can appear as a legend item","(provided that the legend itself is visible)."].join(" ")}),showlegend:{valType:"boolean",dflt:!1,description:["Determines whether or not new","shape is shown in the legend."].join(" ")},legend:hi({},Wi.legend,{description:["Sets the reference to a legend to show new shape in.","References to these legends are *legend*, *legend2*, *legend3*, etc.","Settings for these legends are set in the layout, under","`layout.legend`, `layout.legend2`, etc."].join(" ")}),legendgroup:hi({},Wi.legendgroup,{description:["Sets the legend group for new shape.","Traces and shapes part of the same legend group hide/show at the same time","when toggling legend items."].join(" ")}),legendgrouptitle:{text:hi({},Wi.legendgrouptitle.text,{}),font:bm({description:["Sets this legend group's title font."].join(" ")})},legendrank:hi({},Wi.legendrank,{description:["Sets the legend rank for new shape.","Items and groups with smaller ranks are presented on top/left side while","with *reversed* `legend.traceorder` they are on bottom/right side.","The default legendrank is 1000,","so that you can use ranks less than 1000 to place certain items before all unranked items,","and ranks greater than 1000 to go after all unranked items."].join(" ")}),legendwidth:hi({},Wi.legendwidth,{description:"Sets the width (in px or fraction) of the legend for new shape."}),line:{color:{valType:"color",description:["Sets the line color.","By default uses either dark grey or white","to increase contrast with background color."].join(" ")},width:{valType:"number",min:0,dflt:4,description:"Sets the line width (in px)."},dash:hi({},TS,{dflt:"solid"})},fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)",description:["Sets the color filling new shapes' interior.","Please note that if using a fillcolor with alpha greater than half,","drag inside the active shape starts moving the shape underneath,","otherwise a new shape could be started over."].join(" ")},fillrule:{valType:"enumerated",values:["evenodd","nonzero"],dflt:"evenodd",description:["Determines the path's interior.","For more info please visit https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/fill-rule"].join(" ")},opacity:{valType:"number",min:0,max:1,dflt:1,description:"Sets the opacity of new shapes."},layer:{valType:"enumerated",values:["below","above"],dflt:"above",description:"Specifies whether new shapes are drawn below or above traces."},drawdirection:{valType:"enumerated",values:["ortho","horizontal","vertical","diagonal"],dflt:"diagonal",description:["When `dragmode` is set to *drawrect*, *drawline* or *drawcircle*","this limits the drag to be horizontal, vertical or diagonal.","Using *diagonal* there is no limit e.g. in drawing lines in any direction.","*ortho* limits the draw to be either horizontal or vertical.","*horizontal* allows horizontal extend.","*vertical* allows vertical extend."].join(" ")},name:hi({},Wi.name,{description:["Sets new shape name.","The name appears as the legend item."].join(" ")}),label:{text:{valType:"string",dflt:"",description:["Sets the text to display with the new shape.","It is also used for legend item if `name` is not provided."].join(" ")},texttemplate:kS({newshape:!0},{keys:Object.keys(AS)}),font:bm({description:"Sets the new shape label text font."}),textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right","start","middle","end"],description:["Sets the position of the label text relative to the new shape.","Supported values for rectangles, circles and paths are","*top left*, *top center*, *top right*, *middle left*,","*middle center*, *middle right*, *bottom left*, *bottom center*,","and *bottom right*.","Supported values for lines are *start*, *middle*, and *end*.","Default: *middle center* for rectangles, circles, and paths; *middle* for lines."].join(" ")},textangle:{valType:"angle",dflt:"auto",description:["Sets the angle at which the label text is drawn","with respect to the horizontal. For lines, angle *auto*","is the same angle as the line. For all other shapes,","angle *auto* is horizontal."].join(" ")},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto",description:["Sets the label's horizontal position anchor","This anchor binds the specified `textposition` to the *left*, *center*","or *right* of the label text.","For example, if `textposition` is set to *top right* and","`xanchor` to *right* then the right-most portion of the","label text lines up with the right-most edge of the","new shape."].join(" ")},yanchor:{valType:"enumerated",values:["top","middle","bottom"],description:["Sets the label's vertical position anchor","This anchor binds the specified `textposition` to the *top*, *middle*","or *bottom* of the label text.","For example, if `textposition` is set to *top right* and","`yanchor` to *top* then the top-most portion of the","label text lines up with the top-most edge of the","new shape."].join(" ")},padding:{valType:"number",dflt:3,min:0,description:"Sets padding (in px) between edge of label and edge of new shape."}}},activeshape:{fillcolor:{valType:"color",dflt:"rgb(255,0,255)",description:"Sets the color filling the active shape' interior."},opacity:{valType:"number",min:0,max:1,dflt:.5,description:"Sets the opacity of the active shape."}}},"none","from-root"),SS=ra.dash,LS=Qt.extendFlat,CS={newselection:{mode:{valType:"enumerated",values:["immediate","gradual"],dflt:"immediate",editType:"none",description:["Describes how a new selection is created.","If `immediate`, a new selection is created after first mouse up.","If `gradual`, a new selection is not created after first mouse.","By adding to and subtracting from the initial selection,","this option allows declaring extra outlines of the selection."].join(" ")},line:{color:{valType:"color",editType:"none",description:["Sets the line color.","By default uses either dark grey or white","to increase contrast with background color."].join(" ")},width:{valType:"number",min:1,dflt:1,editType:"none",description:"Sets the line width (in px)."},dash:LS({},SS,{dflt:"dot",editType:"none"}),editType:"none"},editType:"none"},activeselection:{fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"none",description:"Sets the color filling the active selection' interior."},opacity:{valType:"number",min:0,max:1,dflt:.5,editType:"none",description:"Sets the opacity of the active selection."},editType:"none"}},Fh=function(t){var e=t.editType;return{t:{valType:"number",dflt:0,editType:e,description:"The amount of padding (in px) along the top of the component."},r:{valType:"number",dflt:0,editType:e,description:"The amount of padding (in px) on the right side of the component."},b:{valType:"number",dflt:0,editType:e,description:"The amount of padding (in px) along the bottom of the component."},l:{valType:"number",dflt:0,editType:e,description:"The amount of padding (in px) on the left side of the component."},editType:e}},_d=Mr,DS=Cc,_f=zr,xm=MS,_m=CS,$S=Fh,wm=Qt.extendFlat,Pc=_d({editType:"calc",description:["Sets the global font.","Note that fonts used in traces and other","layout components inherit from the global font."].join(" ")});Pc.family.dflt='"Open Sans", verdana, arial, sans-serif';Pc.size.dflt=12;Pc.color.dflt=_f.defaultLine;var os={font:Pc,title:{text:{valType:"string",editType:"layoutstyle",description:["Sets the plot's title.","Note that before the existence of `title.text`, the title's","contents used to be defined as the `title` attribute itself.","This behavior has been deprecated."].join(" ")},font:_d({editType:"layoutstyle",description:["Sets the title font.","Note that the title's font used to be customized","by the now deprecated `titlefont` attribute."].join(" ")}),xref:{valType:"enumerated",dflt:"container",values:["container","paper"],editType:"layoutstyle",description:["Sets the container `x` refers to.","*container* spans the entire `width` of the plot.","*paper* refers to the width of the plotting area only."].join(" ")},yref:{valType:"enumerated",dflt:"container",values:["container","paper"],editType:"layoutstyle",description:["Sets the container `y` refers to.","*container* spans the entire `height` of the plot.","*paper* refers to the height of the plotting area only."].join(" ")},x:{valType:"number",min:0,max:1,dflt:.5,editType:"layoutstyle",description:["Sets the x position with respect to `xref` in normalized","coordinates from *0* (left) to *1* (right)."].join(" ")},y:{valType:"number",min:0,max:1,dflt:"auto",editType:"layoutstyle",description:["Sets the y position with respect to `yref` in normalized","coordinates from *0* (bottom) to *1* (top).","*auto* places the baseline of the title onto the","vertical center of the top margin."].join(" ")},xanchor:{valType:"enumerated",dflt:"auto",values:["auto","left","center","right"],editType:"layoutstyle",description:["Sets the title's horizontal alignment with respect to its x position.","*left* means that the title starts at x,","*right* means that the title ends at x","and *center* means that the title's center is at x.","*auto* divides `xref` by three and calculates the `xanchor`","value automatically based on the value of `x`."].join(" ")},yanchor:{valType:"enumerated",dflt:"auto",values:["auto","top","middle","bottom"],editType:"layoutstyle",description:["Sets the title's vertical alignment with respect to its y position.","*top* means that the title's cap line is at y,","*bottom* means that the title's baseline is at y","and *middle* means that the title's midline is at y.","*auto* divides `yref` by three and calculates the `yanchor`","value automatically based on the value of `y`."].join(" ")},pad:wm($S({editType:"layoutstyle"}),{description:["Sets the padding of the title.","Each padding value only applies when the corresponding","`xanchor`/`yanchor` value is set accordingly. E.g. for left","padding to take effect, `xanchor` must be set to *left*.","The same rule applies if `xanchor`/`yanchor` is determined automatically.","Padding is muted if the respective anchor value is *middle*/*center*."].join(" ")}),automargin:{valType:"boolean",dflt:!1,editType:"plot",description:["Determines whether the title can automatically push the figure margins.","If `yref='paper'` then the margin will expand to ensure that the title doesn’t","overlap with the edges of the container. If `yref='container'` then the margins","will ensure that the title doesn’t overlap with the plot area, tick labels,","and axis titles. If `automargin=true` and the margins need to be expanded,","then y will be set to a default 1 and yanchor will be set to an appropriate","default to ensure that minimal margin space is needed. Note that when `yref='paper'`,","only 1 or 0 are allowed y values. Invalid values will be reset to the default 1."].join(" ")},editType:"layoutstyle"},uniformtext:{mode:{valType:"enumerated",values:[!1,"hide","show"],dflt:!1,editType:"plot",description:["Determines how the font size for various text","elements are uniformed between each trace type.","If the computed text sizes were smaller than","the minimum size defined by `uniformtext.minsize`","using *hide* option hides the text; and","using *show* option shows the text without further downscaling.","Please note that if the size defined by `minsize` is greater than","the font size defined by trace, then the `minsize` is used."].join(" ")},minsize:{valType:"number",min:0,dflt:0,editType:"plot",description:["Sets the minimum text size between traces of the same type."].join(" ")},editType:"plot"},autosize:{valType:"boolean",dflt:!1,editType:"none",description:["Determines whether or not a layout width or height","that has been left undefined by the user","is initialized on each relayout.","Note that, regardless of this attribute,","an undefined layout width or height","is always initialized on the first call to plot."].join(" ")},width:{valType:"number",min:10,dflt:700,editType:"plot",description:["Sets the plot's width (in px)."].join(" ")},height:{valType:"number",min:10,dflt:450,editType:"plot",description:["Sets the plot's height (in px)."].join(" ")},minreducedwidth:{valType:"number",min:2,dflt:64,editType:"plot",description:"Minimum width of the plot with margin.automargin applied (in px)"},minreducedheight:{valType:"number",min:2,dflt:64,editType:"plot",description:"Minimum height of the plot with margin.automargin applied (in px)"},margin:{l:{valType:"number",min:0,dflt:80,editType:"plot",description:"Sets the left margin (in px)."},r:{valType:"number",min:0,dflt:80,editType:"plot",description:"Sets the right margin (in px)."},t:{valType:"number",min:0,dflt:100,editType:"plot",description:"Sets the top margin (in px)."},b:{valType:"number",min:0,dflt:80,editType:"plot",description:"Sets the bottom margin (in px)."},pad:{valType:"number",min:0,dflt:0,editType:"plot",description:["Sets the amount of padding (in px)","between the plotting area and the axis lines"].join(" ")},autoexpand:{valType:"boolean",dflt:!0,editType:"plot",description:["Turns on/off margin expansion computations.","Legends, colorbars, updatemenus, sliders, axis rangeselector and rangeslider","are allowed to push the margins by defaults."].join(" ")},editType:"plot"},computed:{valType:"any",editType:"none",description:["Placeholder for exporting automargin-impacting values namely","`margin.t`, `margin.b`, `margin.l` and `margin.r` in *full-json* mode."].join(" ")},paper_bgcolor:{valType:"color",dflt:_f.background,editType:"plot",description:"Sets the background color of the paper where the graph is drawn."},plot_bgcolor:{valType:"color",dflt:_f.background,editType:"layoutstyle",description:["Sets the background color of the plotting area in-between x and y axes."].join(" ")},autotypenumbers:{valType:"enumerated",values:["convert types","strict"],dflt:"convert types",editType:"calc",description:["Using *strict* a numeric string in trace data is not converted to a number.","Using *convert types* a numeric string in trace data may be","treated as a number during automatic axis `type` detection.","This is the default value; however it could be overridden for individual axes."].join(" ")},separators:{valType:"string",editType:"plot",description:["Sets the decimal and thousand separators.","For example, *. * puts a '.' before decimals and a space","between thousands. In English locales, dflt is *.,* but","other locales may alter this default."].join(" ")},hidesources:{valType:"boolean",dflt:!1,editType:"plot",description:["Determines whether or not a text link citing the data source is","placed at the bottom-right cored of the figure.","Has only an effect only on graphs that have been generated via","forked graphs from the Chart Studio Cloud (at https://chart-studio.plotly.com or on-premise)."].join(" ")},showlegend:{valType:"boolean",editType:"legend",description:["Determines whether or not a legend is drawn.","Default is `true` if there is a trace to show and any of these:","a) Two or more traces would by default be shown in the legend.","b) One pie trace is shown in the legend.","c) One trace is explicitly given with `showlegend: true`."].join(" ")},colorway:{valType:"colorlist",dflt:_f.defaults,editType:"calc",description:"Sets the default trace colors."},datarevision:{valType:"any",editType:"calc",description:["If provided, a changed value tells `Plotly.react` that","one or more data arrays has changed. This way you can modify","arrays in-place rather than making a complete new copy for an","incremental change.","If NOT provided, `Plotly.react` assumes that data arrays are","being treated as immutable, thus any data array with a","different identity from its predecessor contains new data."].join(" ")},uirevision:{valType:"any",editType:"none",description:["Used to allow user interactions with the plot to persist after","`Plotly.react` calls that are unaware of these interactions.","If `uirevision` is omitted, or if it is given and it changed from","the previous `Plotly.react` call, the exact new figure is used.","If `uirevision` is truthy and did NOT change, any attribute","that has been affected by user interactions and did not receive a","different value in the new figure will keep the interaction value.","`layout.uirevision` attribute serves as the default for","`uirevision` attributes in various sub-containers. For finer","control you can set these sub-attributes directly. For example,","if your app separately controls the data on the x and y axes you","might set `xaxis.uirevision=*time*` and `yaxis.uirevision=*cost*`.","Then if only the y data is changed, you can update","`yaxis.uirevision=*quantity*` and the y axis range will reset but","the x axis range will retain any user-driven zoom."].join(" ")},editrevision:{valType:"any",editType:"none",description:["Controls persistence of user-driven changes in `editable: true`","configuration, other than trace names and axis titles.","Defaults to `layout.uirevision`."].join(" ")},selectionrevision:{valType:"any",editType:"none",description:["Controls persistence of user-driven changes in selected points","from all traces."].join(" ")},template:{valType:"any",editType:"calc",description:["Default attributes to be applied to the plot. Templates can be","created from existing plots using `Plotly.makeTemplate`, or","created manually. They should be objects with format:","`{layout: layoutTemplate, data: {[type]: [traceTemplate, ...]}, ...}`","`layoutTemplate` and `traceTemplate` are objects matching the","attribute structure of `layout` and a data trace. ","Trace templates are applied cyclically to traces of each type.","Container arrays (eg `annotations`) have special handling:","An object ending in `defaults` (eg `annotationdefaults`) is applied","to each array item. But if an item has a `templateitemname` key","we look in the template array for an item with matching `name` and","apply that instead. If no matching `name` is found we mark the item","invisible. Any named template item not referenced is appended to","the end of the array, so you can use this for a watermark annotation","or a logo image, for example. To omit one of these items on the plot,","make an item with matching `templateitemname` and `visible: false`."].join(" ")},newshape:xm.newshape,activeshape:xm.activeshape,newselection:_m.newselection,activeselection:_m.activeselection,meta:{valType:"any",arrayOk:!0,editType:"plot",description:["Assigns extra meta information that can be used in various `text` attributes.","Attributes such as the graph, axis and colorbar `title.text`, annotation `text`","`trace.name` in legend items, `rangeselector`, `updatemenus` and `sliders` `label` text","all support `meta`. One can access `meta` fields using template strings:","`%{meta[i]}` where `i` is the index of the `meta`","item in question.","`meta` can also be an object for example `{key: value}` which can be accessed","%{meta[key]}."].join(" ")},transition:wm({},DS.transition,{description:["Sets transition options used during Plotly.react updates."].join(" "),editType:"none"}),_deprecated:{title:{valType:"string",editType:"layoutstyle",description:["Value of `title` is no longer a simple *string* but a set of sub-attributes.","To set the contents of the title, please use `title.text` now."].join(" ")},titlefont:_d({editType:"layoutstyle",description:["Former `titlefont` is now the sub-attribute `font` of `title`.","To customize title font properties, please use `title.font` now."].join(" ")})}};(function(t){var e=Fo,r=Eh,a=s_,i=Ro,n=Lc.addStyleRule,o=Qt,l=ba,s=os,f=o.extendFlat,c=o.extendDeepAll;t.modules={},t.allCategories={},t.allTypes=[],t.subplotsRegistry={},t.transformsRegistry={},t.componentsRegistry={},t.layoutArrayContainers=[],t.layoutArrayRegexes=[],t.traceLayoutAttributes={},t.localeRegistry={},t.apiMethodRegistry={},t.collectableSubplotTypes=null,t.register=function(_){if(t.collectableSubplotTypes=null,_)_&&!Array.isArray(_)&&(_=[_]);else throw new Error("No argument passed to Plotly.register.");for(var T=0;T<_.length;T++){var k=_[T];if(!k)throw new Error("Invalid module was attempted to be registered!");switch(k.moduleType){case"trace":v(k);break;case"transform":d(k);break;case"component":h(k);break;case"locale":p(k);break;case"apiMethod":var S=k.name;t.apiMethodRegistry[S]=k.fn;break;default:throw new Error("Invalid module was attempted to be registered!")}}},t.getModule=function(x){var _=t.modules[g(x)];return _?_._module:!1},t.traceIs=function(x,_){if(x=g(x),x==="various")return!1;var T=t.modules[x];return T||(x&&e.log("Unrecognized trace type "+x+"."),T=t.modules[l.type.dflt]),!!T.categories[_]},t.getTransformIndices=function(x,_){for(var T=[],k=x.transforms||[],S=0;S<k.length;S++)k[S].type===_&&T.push(S);return T},t.hasTransform=function(x,_){for(var T=x.transforms||[],k=0;k<T.length;k++)if(T[k].type===_)return!0;return!1},t.getComponentMethod=function(x,_){var T=t.componentsRegistry[x];return T&&T[_]||r},t.call=function(){var x=arguments[0],_=[].slice.call(arguments,1);return t.apiMethodRegistry[x].apply(null,_)};function v(x){var _=x.name,T=x.categories,k=x.meta;if(t.modules[_]){e.log("Type "+_+" already registered");return}t.subplotsRegistry[x.basePlotModule.name]||u(x.basePlotModule);for(var S={},L=0;L<T.length;L++)S[T[L]]=!0,t.allCategories[T[L]]=!0;t.modules[_]={_module:x,categories:S},k&&Object.keys(k).length&&(t.modules[_].meta=k),t.allTypes.push(_);for(var D in t.componentsRegistry)y(D,_);x.layoutAttributes&&f(t.traceLayoutAttributes,x.layoutAttributes);var $=x.basePlotModule,E=$.name;if(E==="mapbox"){var z=$.constants.styleRules;for(var O in z)n(".js-plotly-plot .plotly .mapboxgl-"+O,z[O])}(E==="geo"||E==="mapbox")&&window.PlotlyGeoAssets===void 0&&(window.PlotlyGeoAssets={topojson:{}})}function u(x){var _=x.name;if(t.subplotsRegistry[_]){e.log("Plot type "+_+" already registered.");return}m(x),t.subplotsRegistry[_]=x;for(var T in t.componentsRegistry)w(T,x.name)}function h(x){if(typeof x.name!="string")throw new Error("Component module *name* must be a string.");var _=x.name;t.componentsRegistry[_]=x,x.layoutAttributes&&(x.layoutAttributes._isLinkedToArray&&a(t.layoutArrayContainers,_),m(x));for(var T in t.modules)y(_,T);for(var k in t.subplotsRegistry)w(_,k);for(var S in t.transformsRegistry)b(_,S);x.schema&&x.schema.layout&&c(s,x.schema.layout)}function d(x){if(typeof x.name!="string")throw new Error("Transform module *name* must be a string.");var _="Transform module "+x.name,T=typeof x.transform=="function",k=typeof x.calcTransform=="function";if(!T&&!k)throw new Error(_+" is missing a *transform* or *calcTransform* method.");T&&k&&e.log([_+" has both a *transform* and *calcTransform* methods.","Please note that all *transform* methods are executed","before all *calcTransform* methods."].join(" ")),i(x.attributes)||e.log(_+" registered without an *attributes* object."),typeof x.supplyDefaults!="function"&&e.log(_+" registered without a *supplyDefaults* method."),t.transformsRegistry[x.name]=x;for(var S in t.componentsRegistry)b(S,x.name)}function p(x){var _=x.name,T=_.split("-")[0],k=x.dictionary,S=x.format,L=k&&Object.keys(k).length,D=S&&Object.keys(S).length,$=t.localeRegistry,E=$[_];if(E||($[_]=E={}),T!==_){var z=$[T];z||($[T]=z={}),L&&z.dictionary===E.dictionary&&(z.dictionary=k),D&&z.format===E.format&&(z.format=S)}L&&(E.dictionary=k),D&&(E.format=S)}function m(x){if(x.layoutAttributes){var _=x.layoutAttributes._arrayAttrRegexps;if(_)for(var T=0;T<_.length;T++)a(t.layoutArrayRegexes,_[T])}}function y(x,_){var T=t.componentsRegistry[x].schema;if(!(!T||!T.traces)){var k=T.traces[_];k&&c(t.modules[_]._module.attributes,k)}}function b(x,_){var T=t.componentsRegistry[x].schema;if(!(!T||!T.transforms)){var k=T.transforms[_];k&&c(t.transformsRegistry[_].attributes,k)}}function w(x,_){var T=t.componentsRegistry[x].schema;if(!(!T||!T.subplots)){var k=t.subplotsRegistry[_],S=k.layoutAttributes,L=k.attr==="subplot"?k.name:k.attr;Array.isArray(L)&&(L=L[0]);var D=T.subplots[L];S&&D&&c(S,D)}}function g(x){return typeof x=="object"&&(x=x.type),x}})(ot);(function(t){var e=zl.timeFormat,r=wt,a=Fo,i=rs.mod,n=or,o=n.BADNUM,l=n.ONEDAY,s=n.ONEHOUR,f=n.ONEMIN,c=n.ONESEC,v=n.EPOCHJD,u=ot,h=zl.utcFormat,d=/^\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,p=/^\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,m=new Date().getFullYear()-70;function y(P){return P&&u.componentsRegistry.calendars&&typeof P=="string"&&P!=="gregorian"}t.dateTick0=function(P,M){var A=b(P,!!M);if(M<2)return A;var C=t.dateTime2ms(A,P);return C+=l*(M-1),t.ms2DateTime(C,0,P)};function b(P,M){return y(P)?M?u.getComponentMethod("calendars","CANONICAL_SUNDAY")[P]:u.getComponentMethod("calendars","CANONICAL_TICK")[P]:M?"2000-01-02":"2000-01-01"}t.dfltRange=function(P){return y(P)?u.getComponentMethod("calendars","DFLTRANGE")[P]:["2000-01-01","2001-01-01"]},t.isJSDate=function(P){return typeof P=="object"&&P!==null&&typeof P.getTime=="function"};var w,g;t.dateTime2ms=function(P,M){if(t.isJSDate(P)){var A=P.getTimezoneOffset()*f,C=(P.getUTCMinutes()-P.getMinutes())*f+(P.getUTCSeconds()-P.getSeconds())*c+(P.getUTCMilliseconds()-P.getMilliseconds());if(C){var R=3*f;A=A-R/2+i(C-A+R/2,R)}return P=Number(P)-A,P>=w&&P<=g?P:o}if(typeof P!="string"&&typeof P!="number")return o;P=String(P);var N=y(M),H=P.charAt(0);N&&(H==="G"||H==="g")&&(P=P.substr(1),M="");var B=N&&M.substr(0,7)==="chinese",X=P.match(B?p:d);if(!X)return o;var j=X[1],q=X[3]||"1",U=Number(X[5]||1),Z=Number(X[7]||0),K=Number(X[9]||0),ee=Number(X[11]||0);if(N){if(j.length===2)return o;j=Number(j);var le;try{var ye=u.getComponentMethod("calendars","getCal")(M);if(B){var se=q.charAt(q.length-1)==="i";q=parseInt(q,10),le=ye.newDate(j,ye.toMonthIndex(j,q,se),U)}else le=ye.newDate(j,Number(q),U)}catch{return o}return le?(le.toJD()-v)*l+Z*s+K*f+ee*c:o}j.length===2?j=(Number(j)+2e3-m)%100+m:j=Number(j),q-=1;var G=new Date(Date.UTC(2e3,q,U,Z,K));return G.setUTCFullYear(j),G.getUTCMonth()!==q||G.getUTCDate()!==U?o:G.getTime()+ee*c},w=t.MIN_MS=t.dateTime2ms("-9999"),g=t.MAX_MS=t.dateTime2ms("9999-12-31 23:59:59.9999"),t.isDateTime=function(P,M){return t.dateTime2ms(P,M)!==o};function x(P,M){return String(P+Math.pow(10,M)).substr(1)}var _=90*l,T=3*s,k=5*f;t.ms2DateTime=function(P,M,A){if(typeof P!="number"||!(P>=w&&P<=g))return o;M||(M=0);var C=Math.floor(i(P+.05,1)*10),R=Math.round(P-C/10),N,H,B,X,j,q;if(y(A)){var U=Math.floor(R/l)+v,Z=Math.floor(i(P,l));try{N=u.getComponentMethod("calendars","getCal")(A).fromJD(U).formatDate("yyyy-mm-dd")}catch{N=h("G%Y-%m-%d")(new Date(R))}if(N.charAt(0)==="-")for(;N.length<11;)N="-0"+N.substr(1);else for(;N.length<10;)N="0"+N;H=M<_?Math.floor(Z/s):0,B=M<_?Math.floor(Z%s/f):0,X=M<T?Math.floor(Z%f/c):0,j=M<k?Z%c*10+C:0}else q=new Date(R),N=h("%Y-%m-%d")(q),H=M<_?q.getUTCHours():0,B=M<_?q.getUTCMinutes():0,X=M<T?q.getUTCSeconds():0,j=M<k?q.getUTCMilliseconds()*10+C:0;return S(N,H,B,X,j)},t.ms2DateTimeLocal=function(P){if(!(P>=w+l&&P<=g-l))return o;var M=Math.floor(i(P+.05,1)*10),A=new Date(Math.round(P-M/10)),C=e("%Y-%m-%d")(A),R=A.getHours(),N=A.getMinutes(),H=A.getSeconds(),B=A.getUTCMilliseconds()*10+M;return S(C,R,N,H,B)};function S(P,M,A,C,R){if((M||A||C||R)&&(P+=" "+x(M,2)+":"+x(A,2),(C||R)&&(P+=":"+x(C,2),R))){for(var N=4;R%10===0;)N-=1,R/=10;P+="."+x(R,N)}return P}t.cleanDate=function(P,M,A){if(P===o)return M;if(t.isJSDate(P)||typeof P=="number"&&isFinite(P)){if(y(A))return a.error("JS Dates and milliseconds are incompatible with world calendars",P),M;if(P=t.ms2DateTimeLocal(+P),!P&&M!==void 0)return M}else if(!t.isDateTime(P,A))return a.error("unrecognized date",P),M;return P};var L=/%\d?f/g,D=/%h/g,$={1:"1",2:"1",3:"2",4:"2"};function E(P,M,A,C){P=P.replace(L,function(N){var H=Math.min(+N.charAt(1)||6,6),B=(M/1e3%1+2).toFixed(H).substr(2).replace(/0+$/,"")||"0";return B});var R=new Date(Math.floor(M+.05));if(P=P.replace(D,function(){return $[A("%q")(R)]}),y(C))try{P=u.getComponentMethod("calendars","worldCalFmt")(P,M,C)}catch{return"Invalid"}return A(P)(R)}var z=[59,59.9,59.99,59.999,59.9999];function O(P,M){var A=i(P+.05,l),C=x(Math.floor(A/s),2)+":"+x(i(Math.floor(A/f),60),2);if(M!=="M"){r(M)||(M=0);var R=Math.min(i(P/c,60),z[M]),N=(100+R).toFixed(M).substr(1);M>0&&(N=N.replace(/0+$/,"").replace(/[\.]$/,"")),C+=":"+N}return C}t.formatDate=function(P,M,A,C,R,N){if(R=y(R)&&R,!M)if(A==="y")M=N.year;else if(A==="m")M=N.month;else if(A==="d")M=N.dayMonth+`
2
+ `+N.year;else return O(P,A)+`
3
+ `+E(N.dayMonthYear,P,C,R);return E(M,P,C,R)};var I=3*l;t.incrementMonth=function(P,M,A){A=y(A)&&A;var C=i(P,l);if(P=Math.round(P-C),A)try{var R=Math.round(P/l)+v,N=u.getComponentMethod("calendars","getCal")(A),H=N.fromJD(R);return M%12?N.add(H,M,"m"):N.add(H,M/12,"y"),(H.toJD()-v)*l+C}catch{a.error("invalid ms "+P+" in calendar "+A)}var B=new Date(P+I);return B.setUTCMonth(B.getUTCMonth()+M)+C-I},t.findExactDates=function(P,M){for(var A=0,C=0,R=0,N=0,H,B,X=y(M)&&u.getComponentMethod("calendars","getCal")(M),j=0;j<P.length;j++){if(B=P[j],!r(B)){N++;continue}if(!(B%l))if(X)try{H=X.fromJD(B/l+v),H.day()===1?H.month()===1?A++:C++:R++}catch{}else H=new Date(B),H.getUTCDate()===1?H.getUTCMonth()===0?A++:C++:R++}C+=A,R+=C;var q=P.length-N;return{exactYears:A/q,exactMonths:C/q,exactDays:R/q}}})(r_);var Nh={},k_=function(e){return e};(function(t){var e=wt,r=Fo,a=k_,i=or.BADNUM,n=1e-9;t.findBin=function(c,v,u){if(e(v.start))return u?Math.ceil((c-v.start)/v.size-n)-1:Math.floor((c-v.start)/v.size+n);var h=0,d=v.length,p=0,m=d>1?(v[d-1]-v[0])/(d-1):1,y,b;for(m>=0?b=u?o:l:b=u?f:s,c+=m*n*(u?-1:1)*(m>=0?1:-1);h<d&&p++<100;)y=Math.floor((h+d)/2),b(v[y],c)?h=y+1:d=y;return p>90&&r.log("Long binary search..."),h-1};function o(c,v){return c<v}function l(c,v){return c<=v}function s(c,v){return c>v}function f(c,v){return c>=v}t.sorterAsc=function(c,v){return c-v},t.sorterDes=function(c,v){return v-c},t.distinctVals=function(c){var v=c.slice();v.sort(t.sorterAsc);var u;for(u=v.length-1;u>-1&&v[u]===i;u--);for(var h=v[u]-v[0]||1,d=h/(u||1)/1e4,p=[],m,y=0;y<=u;y++){var b=v[y],w=b-m;m===void 0?(p.push(b),m=b):w>d&&(h=Math.min(h,w),p.push(b),m=b)}return{vals:p,minDiff:h}},t.roundUp=function(c,v,u){for(var h=0,d=v.length-1,p,m=0,y=u?0:1,b=u?1:0,w=u?Math.ceil:Math.floor;h<d&&m++<100;)p=w((h+d)/2),v[p]<=c?h=p+y:d=p-b;return v[h]},t.sort=function(c,v){for(var u=0,h=0,d=1;d<c.length;d++){var p=v(c[d],c[d-1]);if(p<0?u=1:p>0&&(h=1),u&&h)return c.sort(v)}return h?c:c.reverse()},t.findIndexOfMin=function(c,v){v=v||a;for(var u=1/0,h,d=0;d<c.length;d++){var p=v(c[d]);p<u&&(u=p,h=d)}return h}})(Nh);var Hh=function(e){return Object.keys(e).sort()},A_={};(function(t){var e=wt,r=ta.isArrayOrTypedArray;t.aggNums=function(a,i,n,o){var l,s;if((!o||o>n.length)&&(o=n.length),e(i)||(i=!1),r(n[0])){for(s=new Array(o),l=0;l<o;l++)s[l]=t.aggNums(a,i,n[l]);n=s}for(l=0;l<o;l++)e(i)?e(n[l])&&(i=a(+i,+n[l])):i=n[l];return i},t.len=function(a){return t.aggNums(function(i){return i+1},0,a)},t.mean=function(a,i){return i||(i=t.len(a)),t.aggNums(function(n,o){return n+o},0,a)/i},t.midRange=function(a){if(!(a===void 0||a.length===0))return(t.aggNums(Math.max,null,a)+t.aggNums(Math.min,null,a))/2},t.variance=function(a,i,n){return i||(i=t.len(a)),e(n)||(n=t.mean(a,i)),t.aggNums(function(o,l){return o+Math.pow(l-n,2)},0,a)/i},t.stdev=function(a,i,n){return Math.sqrt(t.variance(a,i,n))},t.median=function(a){var i=a.slice().sort();return t.interp(i,.5)},t.interp=function(a,i){if(!e(i))throw"n should be a finite number";if(i=i*a.length-.5,i<0)return a[0];if(i>a.length-1)return a[a.length-1];var n=i%1;return n*a[Math.ceil(i)]+(1-n)*a[Math.floor(i)]}})(A_);var M_=rs,gu=M_.mod,PS=M_.modHalf,Il=Math.PI,Mi=2*Il;function RS(t){return t/180*Il}function ES(t){return t/Il*180}function Oh(t){return Math.abs(t[1]-t[0])>Mi-1e-14}function S_(t,e){return PS(e-t,Mi)}function zS(t,e){return Math.abs(S_(t,e))}function L_(t,e){if(Oh(e))return!0;var r,a;e[0]<e[1]?(r=e[0],a=e[1]):(r=e[1],a=e[0]),r=gu(r,Mi),a=gu(a,Mi),r>a&&(a+=Mi);var i=gu(t,Mi),n=i+Mi;return i>=r&&i<=a||n>=r&&n<=a}function IS(t,e,r,a){if(!L_(e,a))return!1;var i,n;return r[0]<r[1]?(i=r[0],n=r[1]):(i=r[1],n=r[0]),t>=i&&t<=n}function jh(t,e,r,a,i,n,o){i=i||0,n=n||0;var l=Oh([r,a]),s,f,c,v,u;l?(s=0,f=Il,c=Mi):r<a?(s=r,c=a):(s=a,c=r),t<e?(v=t,u=e):(v=e,u=t);function h(y,b){return[y*Math.cos(b)+i,n-y*Math.sin(b)]}var d=Math.abs(c-s)<=Il?0:1;function p(y,b,w){return"A"+[y,y]+" "+[0,d,w]+" "+h(y,b)}var m;return l?v===null?m="M"+h(u,s)+p(u,f,0)+p(u,c,0)+"Z":m="M"+h(v,s)+p(v,f,0)+p(v,c,0)+"ZM"+h(u,s)+p(u,f,1)+p(u,c,1)+"Z":v===null?(m="M"+h(u,s)+p(u,c,0),o&&(m+="L0,0Z")):m="M"+h(v,s)+"L"+h(u,s)+p(u,c,0)+"L"+h(v,c)+p(v,s,1)+"Z",m}function FS(t,e,r,a,i){return jh(null,t,e,r,a,i,0)}function NS(t,e,r,a,i){return jh(null,t,e,r,a,i,1)}function HS(t,e,r,a,i,n){return jh(t,e,r,a,i,n,1)}var OS={deg2rad:RS,rad2deg:ES,angleDelta:S_,angleDist:zS,isFullCircle:Oh,isAngleInsideSector:L_,isPtInsideSector:IS,pathArc:FS,pathSector:NS,pathAnnulus:HS},wn={};wn.isLeftAnchor=function(e){return e.xanchor==="left"||e.xanchor==="auto"&&e.x<=1/3};wn.isCenterAnchor=function(e){return e.xanchor==="center"||e.xanchor==="auto"&&e.x>1/3&&e.x<2/3};wn.isRightAnchor=function(e){return e.xanchor==="right"||e.xanchor==="auto"&&e.x>=2/3};wn.isTopAnchor=function(e){return e.yanchor==="top"||e.yanchor==="auto"&&e.y>=2/3};wn.isMiddleAnchor=function(e){return e.yanchor==="middle"||e.yanchor==="auto"&&e.y>1/3&&e.y<2/3};wn.isBottomAnchor=function(e){return e.yanchor==="bottom"||e.yanchor==="auto"&&e.y<=1/3};var Tn={},bu=rs.mod;Tn.segmentsIntersect=C_;function C_(t,e,r,a,i,n,o,l){var s=r-t,f=i-t,c=o-i,v=a-e,u=n-e,h=l-n,d=s*h-c*v;if(d===0)return null;var p=(f*h-c*u)/d,m=(f*v-s*u)/d;return m<0||m>1||p<0||p>1?null:{x:t+s*p,y:e+v*p}}Tn.segmentDistance=function(e,r,a,i,n,o,l,s){if(C_(e,r,a,i,n,o,l,s))return 0;var f=a-e,c=i-r,v=l-n,u=s-o,h=f*f+c*c,d=v*v+u*u,p=Math.min(Ts(f,c,h,n-e,o-r),Ts(f,c,h,l-e,s-r),Ts(v,u,d,e-n,r-o),Ts(v,u,d,a-n,i-o));return Math.sqrt(p)};function Ts(t,e,r,a,i){var n=a*t+i*e;if(n<0)return a*a+i*i;if(n>r){var o=a-t,l=i-e;return o*o+l*l}else{var s=a*e-i*t;return s*s/r}}var ks,wd,Tm;Tn.getTextLocation=function(e,r,a,i){if((e!==wd||i!==Tm)&&(ks={},wd=e,Tm=i),ks[a])return ks[a];var n=e.getPointAtLength(bu(a-i/2,r)),o=e.getPointAtLength(bu(a+i/2,r)),l=Math.atan((o.y-n.y)/(o.x-n.x)),s=e.getPointAtLength(bu(a,r)),f=(s.x*4+n.x+o.x)/6,c=(s.y*4+n.y+o.y)/6,v={x:f,y:c,theta:l};return ks[a]=v,v};Tn.clearLocationCache=function(){wd=null};Tn.getVisibleSegment=function(e,r,a){var i=r.left,n=r.right,o=r.top,l=r.bottom,s=0,f=e.getTotalLength(),c=f,v,u;function h(p){var m=e.getPointAtLength(p);p===0?v=m:p===f&&(u=m);var y=m.x<i?i-m.x:m.x>n?m.x-n:0,b=m.y<o?o-m.y:m.y>l?m.y-l:0;return Math.sqrt(y*y+b*b)}for(var d=h(s);d;){if(s+=d+a,s>c)return;d=h(s)}for(d=h(c);d;){if(c-=d+a,s>c)return;d=h(c)}return{min:s,max:c,len:c-s,total:f,isClosed:s===0&&c===f&&Math.abs(v.x-u.x)<.1&&Math.abs(v.y-u.y)<.1}};Tn.findPointOnPath=function(e,r,a,i){i=i||{};for(var n=i.pathLength||e.getTotalLength(),o=i.tolerance||.001,l=i.iterationLimit||30,s=e.getPointAtLength(0)[a]>e.getPointAtLength(n)[a]?-1:1,f=0,c=0,v=n,u,h,d;f<l;){if(u=(c+v)/2,h=e.getPointAtLength(u),d=h[a]-r,Math.abs(d)<o)return h;s*d>0?v=u:c=u,f++}return h};var Rc={};(function(t){var e={};t.throttle=function(i,n,o){var l=e[i],s=Date.now();if(!l){for(var f in e)e[f].ts<s-6e4&&delete e[f];l=e[i]={ts:0,timer:null}}r(l);function c(){o(),l.ts=Date.now(),l.onDone&&(l.onDone(),l.onDone=null)}if(s>l.ts+n){c();return}l.timer=setTimeout(function(){c(),l.timer=null},n)},t.done=function(a){var i=e[a];return!i||!i.timer?Promise.resolve():new Promise(function(n){var o=i.onDone;i.onDone=function(){o&&o(),n(),i.onDone=null}})},t.clear=function(a){if(a)r(e[a]),delete e[a];else for(var i in e)t.clear(i)};function r(a){a&&a.timer!==null&&(clearTimeout(a.timer),a.timer=null)}})(Rc);var jS=function(e){e._responsiveChartHandler&&(window.removeEventListener("resize",e._responsiveChartHandler),delete e._responsiveChartHandler)},BS=wt,GS=cM,US=function(e){var r;if(e&&e.hasOwnProperty("userAgent")?r=e.userAgent:r=VS(),typeof r!="string")return!0;var a=GS({ua:{headers:{"user-agent":r}},tablet:!0,featureDetect:!1});if(!a)for(var i=r.split(" "),n=1;n<i.length;n++){var o=i[n];if(o.indexOf("Safari")!==-1)for(var l=n-1;l>-1;l--){var s=i[l];if(s.substr(0,8)==="Version/"){var f=s.substr(8).split(".")[0];if(BS(f)&&(f=+f),f>=13)return!0}}}return a};function VS(){var t;return typeof navigator<"u"&&(t=navigator.userAgent),t&&t.headers&&typeof t.headers["user-agent"]=="string"&&(t=t.headers["user-agent"]),t}var XS=gt,YS=function(e,r,a){var i=e.selectAll("g."+a.replace(/\s/g,".")).data(r,function(o){return o[0].trace.uid});i.exit().remove(),i.enter().append("g").attr("class",a),i.order();var n=e.classed("rangeplot")?"nodeRangePlot3":"node3";return i.each(function(o){o[0][n]=XS.select(this)}),i},WS=ot,qS=function(e,r){for(var a=e._context.locale,i=0;i<2;i++){for(var n=e._context.locales,o=0;o<2;o++){var l=(n[a]||{}).dictionary;if(l){var s=l[r];if(s)return s}n=WS.localeRegistry}var f=a.split("-")[0];if(f===a)break;a=f}return r},ZS=function(e){for(var r={},a=[],i=0,n=0;n<e.length;n++){var o=e[n];r[o]!==1&&(r[o]=1,a[i++]=o)}return a},KS=function(e){for(var r=eL(e)?JS:QS,a=[],i=0;i<e.length;i++){var n=e[i];r(n)&&a.push(n)}return a};function QS(t){return t.visible===!0}function JS(t){var e=t[0].trace;return e.visible===!0&&e._length!==0}function eL(t){return Array.isArray(t)&&Array.isArray(t[0])&&t[0][0]&&t[0][0].trace}var tL=function(e,r){if(!r)return e;var a=1/Math.abs(r),i=a>1?(a*e+a*r)/a:e+r,n=String(i).length;if(n>16){var o=String(r).length,l=String(e).length;if(n>=l+o){var s=parseFloat(i).toPrecision(12);s.indexOf("e+")===-1&&(i=+s)}}return i},rL=wt,aL=or.BADNUM,iL=/^['"%,$#\s']+|[, ]|['"%,$#\s']+$/g,nL=function(e){return typeof e=="string"&&(e=e.replace(iL,"")),rL(e)?Number(e):aL},xl=gt,oL=zl.utcFormat,lL=z1.format,D_=wt,$_=or,P_=$_.FP_SAFE,sL=-P_,km=$_.BADNUM,ae=G1.exports={};ae.adjustFormat=function(e){return!e||/^\d[.]\df/.test(e)||/[.]\d%/.test(e)?e:e==="0.f"?"~f":/^\d%/.test(e)?"~%":/^\ds/.test(e)?"~s":!/^[~,.0$]/.test(e)&&/[&fps]/.test(e)?"~"+e:e};var Am={};ae.warnBadFormat=function(t){var e=String(t);Am[e]||(Am[e]=1,ae.warn('encountered bad format: "'+e+'"'))};ae.noFormat=function(t){return String(t)};ae.numberFormat=function(t){var e;try{e=lL(ae.adjustFormat(t))}catch{return ae.warnBadFormat(t),ae.noFormat}return e};ae.nestedProperty=Ch;ae.keyedContainer=PM;ae.relativeAttr=zM;ae.isPlainObject=Ro;ae.toLogRange=Dh;ae.relinkPrivateKeys=FM;var kn=ta;ae.isTypedArray=kn.isTypedArray;ae.isArrayOrTypedArray=kn.isArrayOrTypedArray;ae.isArray1D=kn.isArray1D;ae.ensureArray=kn.ensureArray;ae.concat=kn.concat;ae.maxRowLength=kn.maxRowLength;ae.minRowLength=kn.minRowLength;var R_=rs;ae.mod=R_.mod;ae.modHalf=R_.modHalf;var Ni=Z1;ae.valObjectMeta=Ni.valObjectMeta;ae.coerce=Ni.coerce;ae.coerce2=Ni.coerce2;ae.coerceFont=Ni.coerceFont;ae.coercePattern=Ni.coercePattern;ae.coerceHoverinfo=Ni.coerceHoverinfo;ae.coerceSelectionMarkerOpacity=Ni.coerceSelectionMarkerOpacity;ae.validate=Ni.validate;var oa=r_;ae.dateTime2ms=oa.dateTime2ms;ae.isDateTime=oa.isDateTime;ae.ms2DateTime=oa.ms2DateTime;ae.ms2DateTimeLocal=oa.ms2DateTimeLocal;ae.cleanDate=oa.cleanDate;ae.isJSDate=oa.isJSDate;ae.formatDate=oa.formatDate;ae.incrementMonth=oa.incrementMonth;ae.dateTick0=oa.dateTick0;ae.dfltRange=oa.dfltRange;ae.findExactDates=oa.findExactDates;ae.MIN_MS=oa.MIN_MS;ae.MAX_MS=oa.MAX_MS;var An=Nh;ae.findBin=An.findBin;ae.sorterAsc=An.sorterAsc;ae.sorterDes=An.sorterDes;ae.distinctVals=An.distinctVals;ae.roundUp=An.roundUp;ae.sort=An.sort;ae.findIndexOfMin=An.findIndexOfMin;ae.sortObjectKeys=Hh;var Hi=A_;ae.aggNums=Hi.aggNums;ae.len=Hi.len;ae.mean=Hi.mean;ae.median=Hi.median;ae.midRange=Hi.midRange;ae.variance=Hi.variance;ae.stdev=Hi.stdev;ae.interp=Hi.interp;var Fa=Sc;ae.init2dArray=Fa.init2dArray;ae.transposeRagged=Fa.transposeRagged;ae.dot=Fa.dot;ae.translationMatrix=Fa.translationMatrix;ae.rotationMatrix=Fa.rotationMatrix;ae.rotationXYMatrix=Fa.rotationXYMatrix;ae.apply3DTransform=Fa.apply3DTransform;ae.apply2DTransform=Fa.apply2DTransform;ae.apply2DTransform2=Fa.apply2DTransform2;ae.convertCssMatrix=Fa.convertCssMatrix;ae.inverseTransformMatrix=Fa.inverseTransformMatrix;var Wa=OS;ae.deg2rad=Wa.deg2rad;ae.rad2deg=Wa.rad2deg;ae.angleDelta=Wa.angleDelta;ae.angleDist=Wa.angleDist;ae.isFullCircle=Wa.isFullCircle;ae.isAngleInsideSector=Wa.isAngleInsideSector;ae.isPtInsideSector=Wa.isPtInsideSector;ae.pathArc=Wa.pathArc;ae.pathSector=Wa.pathSector;ae.pathAnnulus=Wa.pathAnnulus;var No=wn;ae.isLeftAnchor=No.isLeftAnchor;ae.isCenterAnchor=No.isCenterAnchor;ae.isRightAnchor=No.isRightAnchor;ae.isTopAnchor=No.isTopAnchor;ae.isMiddleAnchor=No.isMiddleAnchor;ae.isBottomAnchor=No.isBottomAnchor;var Ho=Tn;ae.segmentsIntersect=Ho.segmentsIntersect;ae.segmentDistance=Ho.segmentDistance;ae.getTextLocation=Ho.getTextLocation;ae.clearLocationCache=Ho.clearLocationCache;ae.getVisibleSegment=Ho.getVisibleSegment;ae.findPointOnPath=Ho.findPointOnPath;var Ec=Qt;ae.extendFlat=Ec.extendFlat;ae.extendDeep=Ec.extendDeep;ae.extendDeepAll=Ec.extendDeepAll;ae.extendDeepNoArrays=Ec.extendDeepNoArrays;var Bh=Fo;ae.log=Bh.log;ae.warn=Bh.warn;ae.error=Bh.error;var fL=zo;ae.counterRegex=fL.counter;var Gh=Rc;ae.throttle=Gh.throttle;ae.throttleDone=Gh.done;ae.clearThrottle=Gh.clear;var qa=Lc;ae.getGraphDiv=qa.getGraphDiv;ae.isPlotDiv=qa.isPlotDiv;ae.removeElement=qa.removeElement;ae.addStyleRule=qa.addStyleRule;ae.addRelatedStyleRule=qa.addRelatedStyleRule;ae.deleteRelatedStyleRule=qa.deleteRelatedStyleRule;ae.getFullTransformMatrix=qa.getFullTransformMatrix;ae.getElementTransformMatrix=qa.getElementTransformMatrix;ae.getElementAndAncestors=qa.getElementAndAncestors;ae.equalDomRects=qa.equalDomRects;ae.clearResponsive=jS;ae.preserveDrawingBuffer=US;ae.makeTraceGroups=YS;ae._=qS;ae.notifier=l_;ae.filterUnique=ZS;ae.filterVisible=KS;ae.pushUnique=s_;ae.increment=tL;ae.cleanNumber=nL;ae.ensureNumber=function(e){return D_(e)?(e=Number(e),e>P_||e<sL?km:e):km};ae.isIndex=function(t,e){return e!==void 0&&t>=e?!1:D_(t)&&t>=0&&t%1===0};ae.noop=Eh;ae.identity=k_;ae.repeat=function(t,e){for(var r=new Array(e),a=0;a<e;a++)r[a]=t;return r};ae.swapAttrs=function(t,e,r,a){r||(r="x"),a||(a="y");for(var i=0;i<e.length;i++){var n=e[i],o=ae.nestedProperty(t,n.replace("?",r)),l=ae.nestedProperty(t,n.replace("?",a)),s=o.get();o.set(l.get()),l.set(s)}};ae.raiseToTop=function(e){e.parentNode.appendChild(e)};ae.cancelTransition=function(t){return t.transition().duration(0)};ae.constrain=function(t,e,r){return e>r?Math.max(r,Math.min(e,t)):Math.max(e,Math.min(r,t))};ae.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};ae.simpleMap=function(t,e,r,a,i){for(var n=t.length,o=new Array(n),l=0;l<n;l++)o[l]=e(t[l],r,a,i);return o};ae.randstr=function t(e,r,a,i){if(a||(a=16),r===void 0&&(r=24),r<=0)return"0";var n=Math.log(Math.pow(2,r))/Math.log(a),o="",l,s,f;for(l=2;n===1/0;l*=2)n=Math.log(Math.pow(2,r/l))/Math.log(a)*l;var c=n-Math.floor(n);for(l=0;l<Math.floor(n);l++)f=Math.floor(Math.random()*a).toString(a),o=f+o;c&&(s=Math.pow(a,c),f=Math.floor(Math.random()*s).toString(a),o=f+o);var v=parseInt(o,a);return e&&e[o]||v!==1/0&&v>=Math.pow(2,r)?i>10?(ae.warn("randstr failed uniqueness"),o):t(e,r,a,(i||0)+1):o};ae.OptionControl=function(t,e){t||(t={}),e||(e="opt");var r={};return r.optionList=[],r._newoption=function(a){a[e]=t,r[a.name]=a,r.optionList.push(a)},r["_"+e]=t,r};ae.smooth=function(t,e){if(e=Math.round(e)||0,e<2)return t;var r=t.length,a=2*r,i=2*e-1,n=new Array(i),o=new Array(r),l,s,f,c;for(l=0;l<i;l++)n[l]=(1-Math.cos(Math.PI*(l+1)/e))/(2*e);for(l=0;l<r;l++){for(c=0,s=0;s<i;s++)f=l+s+1-e,f<-r?f-=a*Math.round(f/a):f>=a&&(f-=a*Math.floor(f/a)),f<0?f=-1-f:f>=r&&(f=a-1-f),c+=t[f]*n[s];o[l]=c}return o};ae.syncOrAsync=function(t,e,r){var a,i;function n(){return ae.syncOrAsync(t,e,r)}for(;t.length;)if(i=t.splice(0,1)[0],a=i(e),a&&a.then)return a.then(n);return r&&r(e)};ae.stripTrailingSlash=function(t){return t.substr(-1)==="/"?t.substr(0,t.length-1):t};ae.noneOrAll=function(t,e,r){if(t){var a=!1,i=!0,n,o;for(n=0;n<r.length;n++)o=t[r[n]],o!=null?a=!0:i=!1;if(a&&!i)for(n=0;n<r.length;n++)t[r[n]]=e[r[n]]}};ae.mergeArray=function(t,e,r,a){var i=typeof a=="function";if(ae.isArrayOrTypedArray(t))for(var n=Math.min(t.length,e.length),o=0;o<n;o++){var l=t[o];e[o][r]=i?a(l):l}};ae.mergeArrayCastPositive=function(t,e,r){return ae.mergeArray(t,e,r,function(a){var i=+a;return isFinite(i)&&i>0?i:0})};ae.fillArray=function(t,e,r,a){if(a=a||ae.identity,ae.isArrayOrTypedArray(t))for(var i=0;i<e.length;i++)e[i][r]=a(t[i])};ae.castOption=function(t,e,r,a){a=a||ae.identity;var i=ae.nestedProperty(t,r).get();return ae.isArrayOrTypedArray(i)?Array.isArray(e)&&ae.isArrayOrTypedArray(i[e[0]])?a(i[e[0]][e[1]]):a(i[e]):i};ae.extractOption=function(t,e,r,a){if(r in t)return t[r];var i=ae.nestedProperty(e,a).get();if(!Array.isArray(i))return i};function E_(t){var e={};for(var r in t)for(var a=t[r],i=0;i<a.length;i++)e[a[i]]=+r;return e}ae.tagSelected=function(t,e,r){var a=e.selectedpoints,i=e._indexToPoints,n;i&&(n=E_(i));function o(v){return v!==void 0&&v<t.length}for(var l=0;l<a.length;l++){var s=a[l];if(ae.isIndex(s)||ae.isArrayOrTypedArray(s)&&ae.isIndex(s[0])&&ae.isIndex(s[1])){var f=n?n[s]:s,c=r?r[f]:f;o(c)&&(t[c].selected=1)}}};ae.selIndices2selPoints=function(t){var e=t.selectedpoints,r=t._indexToPoints;if(r){for(var a=E_(r),i=[],n=0;n<e.length;n++){var o=e[n];if(ae.isIndex(o)){var l=a[o];ae.isIndex(l)&&i.push(l)}}return i}else return e};ae.getTargetArray=function(t,e){var r=e.target;if(typeof r=="string"&&r){var a=ae.nestedProperty(t,r).get();return Array.isArray(a)?a:!1}else if(Array.isArray(r))return r;return!1};function z_(t,e,r){var a={};typeof e!="object"&&(e={});var i=r==="pieLike"?-1:3,n=Object.keys(t),o,l,s;for(o=0;o<n.length;o++)l=n[o],s=t[l],!(l.charAt(0)==="_"||typeof s=="function")&&(l==="module"?a[l]=s:Array.isArray(s)?l==="colorscale"||i===-1?a[l]=s.slice():a[l]=s.slice(0,i):ae.isTypedArray(s)?i===-1?a[l]=s.subarray():a[l]=s.subarray(0,i):s&&typeof s=="object"?a[l]=z_(t[l],e[l],r):a[l]=s);for(n=Object.keys(e),o=0;o<n.length;o++)l=n[o],s=e[l],(typeof s!="object"||!(l in a)||typeof a[l]!="object")&&(a[l]=s);return a}ae.minExtend=z_;ae.titleCase=function(t){return t.charAt(0).toUpperCase()+t.substr(1)};ae.containsAny=function(t,e){for(var r=0;r<e.length;r++)if(t.indexOf(e[r])!==-1)return!0;return!1};ae.isIE=function(){return typeof window.navigator.msSaveBlob<"u"};var cL=/Version\/[\d\.]+.*Safari/;ae.isSafari=function(){return cL.test(window.navigator.userAgent)};var uL=/iPad|iPhone|iPod/;ae.isIOS=function(){return uL.test(window.navigator.userAgent)};var vL=/Firefox\/(\d+)\.\d+/;ae.getFirefoxVersion=function(){var t=vL.exec(window.navigator.userAgent);if(t&&t.length===2){var e=parseInt(t[1]);if(!isNaN(e))return e}return null};ae.isD3Selection=function(t){return t instanceof xl.selection};ae.ensureSingle=function(t,e,r,a){var i=t.select(e+(r?"."+r:""));if(i.size())return i;var n=t.append(e);return r&&n.classed(r,!0),a&&n.call(a),n};ae.ensureSingleById=function(t,e,r,a){var i=t.select(e+"#"+r);if(i.size())return i;var n=t.append(e).attr("id",r);return a&&n.call(a),n};ae.objectFromPath=function(t,e){for(var r=t.split("."),a,i=a={},n=0;n<r.length;n++){var o=r[n],l=null,s=r[n].match(/(.*)\[([0-9]+)\]/);s?(o=s[1],l=s[2],a=a[o]=[],n===r.length-1?a[l]=e:a[l]={},a=a[l]):(n===r.length-1?a[o]=e:a[o]={},a=a[o])}return i};var dL=/^([^\[\.]+)\.(.+)?/,hL=/^([^\.]+)\[([0-9]+)\](\.)?(.+)?/;function As(t){return t.slice(0,2)==="__"}ae.expandObjectPaths=function(t){var e,r,a,i,n,o,l;if(typeof t=="object"&&!Array.isArray(t)){for(r in t)if(t.hasOwnProperty(r))if(e=r.match(dL)){if(i=t[r],a=e[1],As(a))continue;delete t[r],t[a]=ae.extendDeepNoArrays(t[a]||{},ae.objectFromPath(r,ae.expandObjectPaths(i))[a])}else if(e=r.match(hL)){if(i=t[r],a=e[1],As(a))continue;if(n=parseInt(e[2]),delete t[r],t[a]=t[a]||[],e[3]===".")l=e[4],o=t[a][n]=t[a][n]||{},ae.extendDeepNoArrays(o,ae.objectFromPath(l,ae.expandObjectPaths(i)));else{if(As(a))continue;t[a][n]=ae.expandObjectPaths(i)}}else{if(As(r))continue;t[r]=ae.expandObjectPaths(t[r])}}return t};ae.numSeparate=function(t,e,r){if(r||(r=!1),typeof e!="string"||e.length===0)throw new Error("Separator string required for formatting!");typeof t=="number"&&(t=String(t));var a=/(\d+)(\d{3})/,i=e.charAt(0),n=e.charAt(1),o=t.split("."),l=o[0],s=o.length>1?i+o[1]:"";if(n&&(o.length>1||l.length>4||r))for(;a.test(l);)l=l.replace(a,"$1"+n+"$2");return l+s};ae.TEMPLATE_STRING_REGEX=/%{([^\s%{}:]*)([:|\|][^}]*)?}/g;var I_=/^\w*$/;ae.templateString=function(t,e){var r={};return t.replace(ae.TEMPLATE_STRING_REGEX,function(a,i){var n;return I_.test(i)?n=e[i]:(r[i]=r[i]||ae.nestedProperty(e,i).get,n=r[i]()),ae.isValidTextValue(n)?n:""})};var pL={max:10,count:0,name:"hovertemplate"};ae.hovertemplateString=function(){return Uh.apply(pL,arguments)};var mL={max:10,count:0,name:"texttemplate"};ae.texttemplateString=function(){return Uh.apply(mL,arguments)};var yL=/^(\S+)([\*\/])(-?\d+(\.\d+)?)$/;function gL(t){var e=t.match(yL);return e?{key:e[1],op:e[2],number:Number(e[3])}:{key:t,op:null,number:null}}var bL={max:10,count:0,name:"texttemplate",parseMultDiv:!0};ae.texttemplateStringForShapes=function(){return Uh.apply(bL,arguments)};var Mm=/^[:|\|]/;function Uh(t,e,r){var a=this,i=arguments;e||(e={});var n={};return t.replace(ae.TEMPLATE_STRING_REGEX,function(o,l,s){var f=l==="xother"||l==="yother",c=l==="_xother"||l==="_yother",v=l==="_xother_"||l==="_yother_",u=l==="xother_"||l==="yother_",h=f||c||u||v,d=l;(c||v)&&(d=d.substring(1)),(u||v)&&(d=d.substring(0,d.length-1));var p=null,m=null;if(a.parseMultDiv){var y=gL(d);d=y.key,p=y.op,m=y.number}var b;if(h){if(b=e[d],b===void 0)return""}else{var w,g;for(g=3;g<i.length;g++)if(w=i[g],!!w){if(w.hasOwnProperty(d)){b=w[d];break}if(I_.test(d)||(b=ae.nestedProperty(w,d).get(),b=n[d]||ae.nestedProperty(w,d).get(),b&&(n[d]=b)),b!==void 0)break}}if(b!==void 0&&(p==="*"&&(b*=m),p==="/"&&(b/=m)),b===void 0&&a)return a.count<a.max&&(ae.warn("Variable '"+d+"' in "+a.name+" could not be found!"),b=o),a.count===a.max&&ae.warn("Too many "+a.name+" warnings - additional warnings will be suppressed"),a.count++,o;if(s){var x;if(s[0]===":"&&(x=r?r.numberFormat:ae.numberFormat,b=x(s.replace(Mm,""))(b)),s[0]==="|"){x=r?r.timeFormat:oL;var _=ae.dateTime2ms(b);b=ae.formatDate(_,s.replace(Mm,""),!1,x)}}else{var T=d+"Label";e.hasOwnProperty(T)&&(b=e[T])}return h&&(b="("+b+")",(c||v)&&(b=" "+b),(u||v)&&(b=b+" ")),b})}var Ms=48,Sm=57;ae.subplotSort=function(t,e){for(var r=Math.min(t.length,e.length)+1,a=0,i=0,n=0;n<r;n++){var o=t.charCodeAt(n)||0,l=e.charCodeAt(n)||0,s=o>=Ms&&o<=Sm,f=l>=Ms&&l<=Sm;if(s&&(a=10*a+o-Ms),f&&(i=10*i+l-Ms),!s||!f){if(a!==i)return a-i;if(o!==l)return o-l}}return i-a};var to=2e9;ae.seedPseudoRandom=function(){to=2e9};ae.pseudoRandom=function(){var t=to;return to=(69069*to+1)%4294967296,Math.abs(to-t)<429496729?ae.pseudoRandom():to/4294967296};ae.fillText=function(t,e,r){var a=Array.isArray(r)?function(o){r.push(o)}:function(o){r.text=o},i=ae.extractOption(t,e,"htx","hovertext");if(ae.isValidTextValue(i))return a(i);var n=ae.extractOption(t,e,"tx","text");if(ae.isValidTextValue(n))return a(n)};ae.isValidTextValue=function(t){return t||t===0};ae.formatPercent=function(t,e){e=e||0;for(var r=(Math.round(100*t*Math.pow(10,e))*Math.pow(.1,e)).toFixed(e)+"%",a=0;a<e;a++)r.indexOf(".")!==-1&&(r=r.replace("0%","%"),r=r.replace(".%","%"));return r};ae.isHidden=function(t){var e=window.getComputedStyle(t).display;return!e||e==="none"};ae.strTranslate=function(t,e){return t||e?"translate("+t+","+e+")":""};ae.strRotate=function(t){return t?"rotate("+t+")":""};ae.strScale=function(t){return t!==1?"scale("+t+")":""};ae.getTextTransform=function(t){var e=t.noCenter,r=t.textX,a=t.textY,i=t.targetX,n=t.targetY,o=t.anchorX||0,l=t.anchorY||0,s=t.rotate,f=t.scale;return f?f>1&&(f=1):f=0,ae.strTranslate(i-f*(r+o),n-f*(a+l))+ae.strScale(f)+(s?"rotate("+s+(e?"":" "+r+" "+a)+")":"")};ae.setTransormAndDisplay=function(t,e){t.attr("transform",ae.getTextTransform(e)),t.style("display",e.scale?null:"none")};ae.ensureUniformFontSize=function(t,e){var r=ae.extendFlat({},e);return r.size=Math.max(e.size,t._fullLayout.uniformtext.minsize||0),r};ae.join2=function(t,e,r){var a=t.length;return a>1?t.slice(0,-1).join(e)+r+t[a-1]:t.join(e)};ae.bigFont=function(t){return Math.round(1.2*t)};var Lm=ae.getFirefoxVersion(),xL=Lm!==null&&Lm<86;ae.getPositionFromD3Event=function(){return xL?[xl.event.layerX,xl.event.layerY]:[xl.event.offsetX,xl.event.offsetY]};var me=G1.exports,_L=me,Cm={"X,X div":'direction:ltr;font-family:"Open Sans",verdana,arial,sans-serif;margin:0;padding:0;',"X input,X button":'font-family:"Open Sans",verdana,arial,sans-serif;',"X input:focus,X button:focus":"outline:none;","X a":"text-decoration:none;","X a:hover":"text-decoration:none;","X .crisp":"shape-rendering:crispEdges;","X .user-select-none":"-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;","X svg":"overflow:hidden;","X svg a":"fill:#447adb;","X svg a:hover":"fill:#3c6dc5;","X .main-svg":"position:absolute;top:0;left:0;pointer-events:none;","X .main-svg .draglayer":"pointer-events:all;","X .cursor-default":"cursor:default;","X .cursor-pointer":"cursor:pointer;","X .cursor-crosshair":"cursor:crosshair;","X .cursor-move":"cursor:move;","X .cursor-col-resize":"cursor:col-resize;","X .cursor-row-resize":"cursor:row-resize;","X .cursor-ns-resize":"cursor:ns-resize;","X .cursor-ew-resize":"cursor:ew-resize;","X .cursor-sw-resize":"cursor:sw-resize;","X .cursor-s-resize":"cursor:s-resize;","X .cursor-se-resize":"cursor:se-resize;","X .cursor-w-resize":"cursor:w-resize;","X .cursor-e-resize":"cursor:e-resize;","X .cursor-nw-resize":"cursor:nw-resize;","X .cursor-n-resize":"cursor:n-resize;","X .cursor-ne-resize":"cursor:ne-resize;","X .cursor-grab":"cursor:-webkit-grab;cursor:grab;","X .modebar":"position:absolute;top:2px;right:2px;","X .ease-bg":"-webkit-transition:background-color .3s ease 0s;-moz-transition:background-color .3s ease 0s;-ms-transition:background-color .3s ease 0s;-o-transition:background-color .3s ease 0s;transition:background-color .3s ease 0s;","X .modebar--hover>:not(.watermark)":"opacity:0;-webkit-transition:opacity .3s ease 0s;-moz-transition:opacity .3s ease 0s;-ms-transition:opacity .3s ease 0s;-o-transition:opacity .3s ease 0s;transition:opacity .3s ease 0s;","X:hover .modebar--hover .modebar-group":"opacity:1;","X .modebar-group":"float:left;display:inline-block;box-sizing:border-box;padding-left:8px;position:relative;vertical-align:middle;white-space:nowrap;","X .modebar-btn":"position:relative;font-size:16px;padding:3px 4px;height:22px;cursor:pointer;line-height:normal;box-sizing:border-box;","X .modebar-btn svg":"position:relative;top:2px;","X .modebar.vertical":"display:flex;flex-direction:column;flex-wrap:wrap;align-content:flex-end;max-height:100%;","X .modebar.vertical svg":"top:-1px;","X .modebar.vertical .modebar-group":"display:block;float:none;padding-left:0px;padding-bottom:8px;","X .modebar.vertical .modebar-group .modebar-btn":"display:block;text-align:center;","X [data-title]:before,X [data-title]:after":"position:absolute;-webkit-transform:translate3d(0, 0, 0);-moz-transform:translate3d(0, 0, 0);-ms-transform:translate3d(0, 0, 0);-o-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0);display:none;opacity:0;z-index:1001;pointer-events:none;top:110%;right:50%;","X [data-title]:hover:before,X [data-title]:hover:after":"display:block;opacity:1;","X [data-title]:before":'content:"";position:absolute;background:rgba(0,0,0,0);border:6px solid rgba(0,0,0,0);z-index:1002;margin-top:-12px;border-bottom-color:#69738a;margin-right:-6px;',"X [data-title]:after":"content:attr(data-title);background:#69738a;color:#fff;padding:8px 10px;font-size:12px;line-height:12px;white-space:nowrap;margin-right:-18px;border-radius:2px;","X .vertical [data-title]:before,X .vertical [data-title]:after":"top:0%;right:200%;","X .vertical [data-title]:before":"border:6px solid rgba(0,0,0,0);border-left-color:#69738a;margin-top:8px;margin-right:-30px;",Y:'font-family:"Open Sans",verdana,arial,sans-serif;position:fixed;top:50px;right:20px;z-index:10000;font-size:10pt;max-width:180px;',"Y p":"margin:0;","Y .notifier-note":"min-width:180px;max-width:250px;border:1px solid #fff;z-index:3000;margin:0;background-color:#8c97af;background-color:rgba(140,151,175,.9);color:#fff;padding:10px;overflow-wrap:break-word;word-wrap:break-word;-ms-hyphens:auto;-webkit-hyphens:auto;hyphens:auto;","Y .notifier-close":"color:#fff;opacity:.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 Dm in Cm){var wL=Dm.replace(/^,/," ,").replace(/X/g,".js-plotly-plot .plotly").replace(/Y/g,".plotly-notifier");_L.addStyleRule(wL,Cm[Dm])}var Wt={},Vh={},xu=Ah.EventEmitter,TL={init:function(t){if(t._ev instanceof xu)return t;var e=new xu,r=new xu;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(a,i){typeof jQuery<"u"&&jQuery(t).trigger(a,i),e.emit(a,i),r.emit(a,i)},t},triggerHandler:function(t,e,r){var a,i;typeof jQuery<"u"&&(a=jQuery(t).triggerHandler(e,r));var n=t._ev;if(!n)return a;var o=n._events[e];if(!o)return a;function l(f){if(f.listener){if(n.removeListener(e,f.listener),!f.fired)return f.fired=!0,f.listener.apply(n,[r])}else return f.apply(n,[r])}o=Array.isArray(o)?o:[o];var s;for(s=0;s<o.length-1;s++)l(o[s]);return i=l(o[s]),a!==void 0?a:i},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}},ls=TL,$m=me,kL=Io.dfltConfig;function AL(t,e){for(var r=[],a,i=0;i<e.length;i++)a=e[i],a===t?r[i]=a:typeof a=="object"?r[i]=Array.isArray(a)?$m.extendDeep([],a):$m.extendDeepAll({},a):r[i]=a;return r}var fi={};fi.add=function(t,e,r,a,i){var n,o;if(t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},o=t.undoQueue.index,t.autoplay){t.undoQueue.inSequence||(t.autoplay=!1);return}!t.undoQueue.sequence||t.undoQueue.beginSequence?(n={undo:{calls:[],args:[]},redo:{calls:[],args:[]}},t.undoQueue.queue.splice(o,t.undoQueue.queue.length-o,n),t.undoQueue.index+=1):n=t.undoQueue.queue[o-1],t.undoQueue.beginSequence=!1,n&&(n.undo.calls.unshift(e),n.undo.args.unshift(r),n.redo.calls.push(a),n.redo.args.push(i)),t.undoQueue.queue.length>kL.queueLength&&(t.undoQueue.queue.shift(),t.undoQueue.index--)};fi.startSequence=function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!0,t.undoQueue.beginSequence=!0};fi.stopSequence=function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!1,t.undoQueue.beginSequence=!1};fi.undo=function(e){var r,a;if(!(e.undoQueue===void 0||isNaN(e.undoQueue.index)||e.undoQueue.index<=0)){for(e.undoQueue.index--,r=e.undoQueue.queue[e.undoQueue.index],e.undoQueue.inSequence=!0,a=0;a<r.undo.calls.length;a++)fi.plotDo(e,r.undo.calls[a],r.undo.args[a]);e.undoQueue.inSequence=!1,e.autoplay=!1}};fi.redo=function(e){var r,a;if(!(e.undoQueue===void 0||isNaN(e.undoQueue.index)||e.undoQueue.index>=e.undoQueue.queue.length)){for(r=e.undoQueue.queue[e.undoQueue.index],e.undoQueue.inSequence=!0,a=0;a<r.redo.calls.length;a++)fi.plotDo(e,r.redo.calls[a],r.redo.args[a]);e.undoQueue.inSequence=!1,e.autoplay=!1,e.undoQueue.index++}};fi.plotDo=function(t,e,r){t.autoplay=!0,r=AL(t,r),e.apply(null,r)};var ML=fi,Oo={},F_={_isLinkedToArray:"frames_entry",group:{valType:"string",description:["An identifier that specifies the group to which the frame belongs,","used by animate to select a subset of frames."].join(" ")},name:{valType:"string",description:"A label by which to identify the frame"},traces:{valType:"any",description:["A list of trace indices that identify the respective traces in the","data attribute"].join(" ")},baseframe:{valType:"string",description:["The name of the frame into which this frame's properties are merged","before applying. This is used to unify properties and avoid needing","to specify the same values for the same properties in multiple frames."].join(" ")},data:{valType:"any",description:["A list of traces this frame modifies. The format is identical to the","normal trace definition."].join(" ")},layout:{valType:"any",description:["Layout properties which this frame modifies. The format is identical","to the normal layout definition."].join(" ")}};(function(t){var e=ot,r=me,a=ba,i=os,n=F_,o=Cc,l=Io.configAttributes,s=Ya,f=r.extendDeepAll,c=r.isPlainObject,v=r.isArrayOrTypedArray,u=r.nestedProperty,h=r.valObjectMeta,d="_isSubplotObj",p="_isLinkedToArray",m="_arrayAttrRegexps",y="_deprecated",b=[d,p,m,y];t.IS_SUBPLOT_OBJ=d,t.IS_LINKED_TO_ARRAY=p,t.DEPRECATED=y,t.UNDERSCORE_ATTRS=b,t.get=function(){var I={};e.allTypes.forEach(function(M){I[M]=_(M)});var P={};return Object.keys(e.transformsRegistry).forEach(function(M){P[M]=k(M)}),{defs:{valObjects:h,metaKeys:b.concat(["description","role","editType","impliedEdits"]),editType:{traces:s.traces,layout:s.layout},impliedEdits:{description:["Sometimes when an attribute is changed, other attributes","must be altered as well in order to achieve the intended","result. For example, when `range` is specified, it is","important to set `autorange` to `false` or the new `range`","value would be lost in the redraw. `impliedEdits` is the","mechanism to do this: `impliedEdits: {autorange: false}`.","Each key is a relative paths to the attribute string to","change, using *^* to ascend into the parent container,","for example `range[0]` has `impliedEdits: {*^autorange*: false}`.","A value of `undefined` means that the attribute will not be","changed, but its previous value should be recorded in case","we want to reverse this change later. For example, `autorange`","has `impliedEdits: {*range[0]*: undefined, *range[1]*:undefined}","because the range will likely be changed by redraw."].join(" ")}},traces:I,layout:T(),transforms:P,frames:S(),animation:L(o),config:L(l)}},t.crawl=function(I,P,M,A){var C=M||0;A=A||"",Object.keys(I).forEach(function(R){var N=I[R];if(b.indexOf(R)===-1){var H=(A?A+".":"")+R;P(N,R,I,C,H),!t.isValObject(N)&&c(N)&&R!=="impliedEdits"&&t.crawl(N,P,C+1,H)}})},t.isValObject=function(I){return I&&I.valType!==void 0},t.findArrayAttributes=function(I){var P=[],M=[],A=[],C,R;function N(U,Z,K,ee){M=M.slice(0,ee).concat([Z]),A=A.slice(0,ee).concat([U&&U._isLinkedToArray]);var le=U&&(U.valType==="data_array"||U.arrayOk===!0)&&!(M[ee-1]==="colorbar"&&(Z==="ticktext"||Z==="tickvals"));le&&H(C,0,"")}function H(U,Z,K){var ee=U[M[Z]],le=K+M[Z];if(Z===M.length-1)v(ee)&&P.push(R+le);else if(A[Z]){if(Array.isArray(ee))for(var ye=0;ye<ee.length;ye++)c(ee[ye])&&H(ee[ye],Z+1,le+"["+ye+"].")}else c(ee)&&H(ee,Z+1,le+".")}C=I,R="",t.crawl(a,N),I._module&&I._module.attributes&&t.crawl(I._module.attributes,N);var B=I.transforms;if(B)for(var X=0;X<B.length;X++){var j=B[X],q=j._module;q&&(R="transforms["+X+"].",C=j,t.crawl(q.attributes,N))}return P},t.getTraceValObject=function(I,P){var M=P[0],A=1,C,R;if(M==="transforms"){if(P.length===1)return a.transforms;var N=I.transforms;if(!Array.isArray(N)||!N.length)return!1;var H=P[1];if(!x(H)||H>=N.length)return!1;C=(e.transformsRegistry[N[H].type]||{}).attributes,R=C&&C[P[2]],A=3}else{var B=I._module;if(B||(B=(e.modules[I.type||a.type.dflt]||{})._module),!B)return!1;if(C=B.attributes,R=C&&C[M],!R){var X=B.basePlotModule;X&&X.attributes&&(R=X.attributes[M])}R||(R=a[M])}return g(R,P,A)},t.getLayoutValObject=function(I,P){var M=w(I,P[0]);return g(M,P,1)};function w(I,P){var M,A,C,R,N=I._basePlotModules;if(N){var H;for(M=0;M<N.length;M++){if(C=N[M],C.attrRegex&&C.attrRegex.test(P)){if(C.layoutAttrOverrides)return C.layoutAttrOverrides;!H&&C.layoutAttributes&&(H=C.layoutAttributes)}var B=C.baseLayoutAttrOverrides;if(B&&P in B)return B[P]}if(H)return H}var X=I._modules;if(X){for(M=0;M<X.length;M++)if(R=X[M].layoutAttributes,R&&P in R)return R[P]}for(A in e.componentsRegistry){if(C=e.componentsRegistry[A],C.name==="colorscale"&&P.indexOf("coloraxis")===0)return C.layoutAttributes[P];if(!C.schema&&P===C.name)return C.layoutAttributes}return P in i?i[P]:!1}function g(I,P,M){if(!I)return!1;if(I._isLinkedToArray){if(x(P[M]))M++;else if(M<P.length)return!1}for(;M<P.length;M++){var A=I[P[M]];if(c(A))I=A;else break;if(M===P.length-1)break;if(I._isLinkedToArray){if(M++,!x(P[M]))return!1}else if(I.valType==="info_array"){M++;var C=P[M];if(!x(C))return!1;var R=I.items;if(Array.isArray(R)){if(C>=R.length)return!1;if(I.dimensions===2){if(M++,P.length===M)return I;var N=P[M];if(!x(N))return!1;I=R[C][N]}else I=R[C]}else I=R}}return I}function x(I){return I===Math.round(I)&&I>=0}function _(I){var P,M;P=e.modules[I]._module,M=P.basePlotModule;var A={};A.type=null;var C=f({},a),R=f({},P.attributes);t.crawl(R,function(B,X,j,q,U){u(C,U).set(void 0),B===void 0&&u(R,U).set(void 0)}),f(A,C),e.traceIs(I,"noOpacity")&&delete A.opacity,e.traceIs(I,"showLegend")||(delete A.showlegend,delete A.legendgroup),e.traceIs(I,"noHover")&&(delete A.hoverinfo,delete A.hoverlabel),P.selectPoints||delete A.selectedpoints,f(A,R),M.attributes&&f(A,M.attributes),A.type=I;var N={meta:P.meta||{},categories:P.categories||{},animatable:!!P.animatable,type:I,attributes:L(A)};if(P.layoutAttributes){var H={};f(H,P.layoutAttributes),N.layoutAttributes=L(H)}return P.animatable||t.crawl(N,function(B){t.isValObject(B)&&"anim"in B&&delete B.anim}),N}function T(){var I={},P,M;f(I,i);for(P in e.subplotsRegistry)if(M=e.subplotsRegistry[P],!!M.layoutAttributes)if(Array.isArray(M.attr))for(var A=0;A<M.attr.length;A++)z(I,M,M.attr[A]);else{var C=M.attr==="subplot"?M.name:M.attr;z(I,M,C)}for(P in e.componentsRegistry){M=e.componentsRegistry[P];var R=M.schema;if(R&&(R.subplots||R.layout)){var N=R.subplots;if(N&&N.xaxis&&!N.yaxis)for(var H in N.xaxis)delete I.yaxis[H];delete I.xaxis.shift,delete I.xaxis.autoshift}else M.name==="colorscale"?f(I,M.layoutAttributes):M.layoutAttributes&&O(I,M.layoutAttributes,M.name)}return{layoutAttributes:L(I)}}function k(I){var P=e.transformsRegistry[I],M=f({},P.attributes);return Object.keys(e.componentsRegistry).forEach(function(A){var C=e.componentsRegistry[A];C.schema&&C.schema.transforms&&C.schema.transforms[I]&&Object.keys(C.schema.transforms[I]).forEach(function(R){O(M,C.schema.transforms[I][R],R)})}),{attributes:L(M)}}function S(){var I={frames:f({},n)};return L(I),I.frames}function L(I){return D(I),$(I),E(I),I}function D(I){function P(A){return{valType:"string",description:"Sets the source reference on Chart Studio Cloud for `"+A+"`.",editType:"none"}}function M(A,C,R){t.isValObject(A)?(A.arrayOk===!0||A.valType==="data_array")&&(R[C+"src"]=P(C)):c(A)&&(A.role="object")}t.crawl(I,M)}function $(I){function P(M,A,C){if(M){var R=M[p];R&&(delete M[p],C[A]={items:{}},C[A].items[R]=M,C[A].role="object")}}t.crawl(I,P)}function E(I){function P(M){for(var A in M)if(c(M[A]))P(M[A]);else if(Array.isArray(M[A]))for(var C=0;C<M[A].length;C++)P(M[A][C]);else M[A]instanceof RegExp&&(M[A]=M[A].toString())}P(I)}function z(I,P,M){var A=u(I,M),C=f({},P.layoutAttributes);C[d]=!0,A.set(C)}function O(I,P,M){var A=u(I,M);A.set(f(A.get()||{},P))}})(Oo);var N_={exports:{}},Ht={},yo=me,SL=ba,Ci="templateitemname",Td={name:{valType:"string",editType:"none",description:["When used in a template, named items are created in the output figure","in addition to any items the figure already has in this array.","You can modify these items in the output figure by making your own","item with `templateitemname` matching this `name`","alongside your modifications (including `visible: false` or","`enabled: false` to hide it).","Has no effect outside of a template."].join(" ")}};Td[Ci]={valType:"string",editType:"calc",description:["Used to refer to a named item in this array in the template. Named","items from the template will be created even without a matching item","in the input figure, but you can modify one by making an item with","`templateitemname` matching its `name`, alongside your modifications","(including `visible: false` or `enabled: false` to hide it).","If there is no template or no matching item, this item will be","hidden unless you explicitly show it with `visible: true`."].join(" ")};Ht.templatedArray=function(t,e){return e._isLinkedToArray=t,e.name=Td.name,e[Ci]=Td[Ci],e};Ht.traceTemplater=function(t){var e={},r,a;for(r in t)a=t[r],Array.isArray(a)&&a.length&&(e[r]=0);function i(n){r=yo.coerce(n,{},SL,"type");var o={type:r,_template:null};if(r in e){a=t[r];var l=e[r]%a.length;e[r]++,o._template=a[l]}return o}return{newTrace:i}};Ht.newContainer=function(t,e,r){var a=t._template,i=a&&(a[e]||r&&a[r]);yo.isPlainObject(i)||(i=null);var n=t[e]={_template:i};return n};Ht.arrayTemplater=function(t,e,r){var a=t._template,i=a&&a[H_(e)],n=a&&a[e];(!Array.isArray(n)||!n.length)&&(n=[]);var o={};function l(f){var c={name:f.name,_input:f},v=c[Ci]=f[Ci];if(!Pm(v))return c._template=i,c;for(var u=0;u<n.length;u++){var h=n[u];if(h.name===v)return o[v]=1,c._template=h,c}return c[r]=f[r]||!1,c._template=!1,c}function s(){for(var f=[],c=0;c<n.length;c++){var v=n[c],u=v.name;if(Pm(u)&&!o[u]){var h={_template:v,name:u,_input:{_templateitemname:u}};h[Ci]=v[Ci],f.push(h),o[u]=1}}return f}return{newItem:l,defaultItems:s}};function Pm(t){return t&&typeof t=="string"}function H_(t){var e=t.length-1;return t.charAt(e)!=="s"&&yo.warn("bad argument to arrayDefaultKey: "+t),t.substr(0,t.length-1)+"defaults"}Ht.arrayDefaultKey=H_;Ht.arrayEditor=function(t,e,r){var a=(yo.nestedProperty(t,e).get()||[]).length,i=r._index,n=i>=a&&(r._input||{})._templateitemname;n&&(i=a);var o=e+"["+i+"]",l;function s(){l={},n&&(l[o]={},l[o][Ci]=n)}s();function f(h,d){l[h]=d}function c(h,d){n?yo.nestedProperty(l[o],h).set(d):l[o+"."+h]=d}function v(){var h=l;return s(),h}function u(h,d){h&&c(h,d);var p=v();for(var m in p)yo.nestedProperty(t,m).set(p[m])}return{modifyBase:f,modifyItem:c,getUpdateObj:v,applyUpdate:u}};var lr={},qo=zo.counter,Gr={idRegex:{x:qo("x","( domain)?"),y:qo("y","( domain)?")},attrRegex:qo("[xy]axis"),xAxisMatch:qo("xaxis"),yAxisMatch:qo("yaxis"),AX_ID_PATTERN:/^[xyz][0-9]*( domain)?$/,AX_NAME_PATTERN:/^[xyz]axis[0-9]*$/,SUBPLOT_PATTERN:/^x([0-9]*)y([0-9]*)$/,HOUR_PATTERN:"hour",WEEKDAY_PATTERN:"day of week",MINDRAG:8,MINZOOM:20,DRAGGERSIZE:20,REDRAWDELAY:50,DFLTRANGEX:[-1,6],DFLTRANGEY:[-1,4],traceLayerClasses:["imagelayer","heatmaplayer","contourcarpetlayer","contourlayer","funnellayer","waterfalllayer","barlayer","carpetlayer","violinlayer","boxlayer","ohlclayer","scattercarpetlayer","scatterlayer"],clipOnAxisFalseQuery:[".scatterlayer",".barlayer",".funnellayer",".waterfalllayer"],layerValue2layerClass:{"above traces":"above","below traces":"below"}};(function(t){var e=ot,r=Gr;t.id2name=function(n){if(!(typeof n!="string"||!n.match(r.AX_ID_PATTERN))){var o=n.split(" ")[0].substr(1);return o==="1"&&(o=""),n.charAt(0)+"axis"+o}},t.name2id=function(n){if(n.match(r.AX_NAME_PATTERN)){var o=n.substr(5);return o==="1"&&(o=""),n.charAt(0)+o}},t.cleanId=function(n,o,l){var s=/( domain)$/.test(n);if(!(typeof n!="string"||!n.match(r.AX_ID_PATTERN))&&!(o&&n.charAt(0)!==o)&&!(s&&!l)){var f=n.split(" ")[0].substr(1).replace(/^0+/,"");return f==="1"&&(f=""),n.charAt(0)+f+(s&&l?" domain":"")}},t.list=function(i,n,o){var l=i._fullLayout;if(!l)return[];var s=t.listIds(i,n),f=new Array(s.length),c;for(c=0;c<s.length;c++){var v=s[c];f[c]=l[v.charAt(0)+"axis"+v.substr(1)]}if(!o){var u=l._subplots.gl3d||[];for(c=0;c<u.length;c++){var h=l[u[c]];n?f.push(h[n+"axis"]):f.push(h.xaxis,h.yaxis,h.zaxis)}}return f},t.listIds=function(i,n){var o=i._fullLayout;if(!o)return[];var l=o._subplots;return n?l[n+"axis"]:l.xaxis.concat(l.yaxis)},t.getFromId=function(i,n,o){var l=i._fullLayout;return n=n===void 0||typeof n!="string"?n:n.replace(" domain",""),o==="x"?n=n.replace(/y[0-9]*/,""):o==="y"&&(n=n.replace(/x[0-9]*/,"")),l[t.id2name(n)]},t.getFromTrace=function(i,n,o){var l=i._fullLayout,s=null;if(e.traceIs(n,"gl3d")){var f=n.scene;f.substr(0,5)==="scene"&&(s=l[f][o+"axis"])}else s=t.getFromId(i,n[o+"axis"]||o);return s},t.idSort=function(i,n){var o=i.charAt(0),l=n.charAt(0);return o!==l?o>l?1:-1:+(i.substr(1)||1)-+(n.substr(1)||1)},t.ref2id=function(i){return/^[xyz]/.test(i)?i.split(" ")[0]:!1};function a(i,n){if(n&&n.length){for(var o=0;o<n.length;o++)if(n[o][i])return!0}return!1}t.isLinked=function(i,n){return a(n,i._axisMatchGroups)||a(n,i._axisConstraintGroups)}})(lr);function LL(t){var e=t._fullLayout._zoomlayer;e&&e.selectAll(".outline-controllers").remove()}function CL(t){var e=t._fullLayout._zoomlayer;e&&e.selectAll(".select-outline").remove(),t._fullLayout._outlining=!1}var Mn={clearOutlineControllers:LL,clearOutline:CL},Xh={scattermode:{valType:"enumerated",values:["group","overlay"],dflt:"overlay",editType:"calc",description:["Determines how scatter points at the same location coordinate","are displayed on the graph.","With *group*, the scatter points are plotted next to one another","centered around the shared location.","With *overlay*, the scatter points are plotted over one another,","you might need to reduce *opacity* to see multiple scatter points."].join(" ")},scattergap:{valType:"number",min:0,max:1,editType:"calc",description:["Sets the gap (in plot fraction) between scatter points of","adjacent location coordinates.","Defaults to `bargap`."].join(" ")}},ss={},kl=ot,DL=Gr.SUBPLOT_PATTERN;ss.getSubplotCalcData=function(t,e,r){var a=kl.subplotsRegistry[e];if(!a)return[];for(var i=a.attr,n=[],o=0;o<t.length;o++){var l=t[o],s=l[0].trace;s[i]===r&&n.push(l)}return n};ss.getModuleCalcData=function(t,e){var r=[],a=[],i;if(typeof e=="string"?i=kl.getModule(e).plot:typeof e=="function"?i=e:i=e.plot,!i)return[r,t];for(var n=0;n<t.length;n++){var o=t[n],l=o[0].trace;l.visible!==!0||l._length===0||(l._module&&l._module.plot===i?r.push(o):a.push(o))}return[r,a]};ss.getSubplotData=function(e,r,a){if(!kl.subplotsRegistry[r])return[];var i=kl.subplotsRegistry[r].attr,n=[],o,l,s;if(r==="gl2d"){var f=a.match(DL);l="x"+f[1],s="y"+f[2]}for(var c=0;c<e.length;c++)o=e[c],r==="gl2d"&&kl.traceIs(o,"gl2d")?o[i[0]]===l&&o[i[1]]===s&&n.push(o):o[i]===a&&n.push(o);return n};var _u={},Rm;function $L(){return Rm||(Rm=1,function(t){var e=ot,r=me;t.manageCommandObserver=function(s,f,c,v){var u={},h=!0;f&&f._commandObserver&&(u=f._commandObserver),u.cache||(u.cache={}),u.lookupTable={};var d=t.hasSimpleAPICommandBindings(s,c,u.lookupTable);if(f&&f._commandObserver){if(d)return u;if(f._commandObserver.remove)return f._commandObserver.remove(),f._commandObserver=null,u}if(d){a(s,d,u.cache),u.check=function(){if(h){var b=a(s,d,u.cache);return b.changed&&v&&u.lookupTable[b.value]!==void 0&&(u.disable(),Promise.resolve(v({value:b.value,type:d.type,prop:d.prop,traces:d.traces,index:u.lookupTable[b.value]})).then(u.enable,u.enable)),b.changed}};for(var p=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],m=0;m<p.length;m++)s._internalOn(p[m],u.check);u.remove=function(){for(var y=0;y<p.length;y++)s._removeInternalListener(p[y],u.check)}}else r.log("Unable to automatically bind plot updates to API command"),u.lookupTable={},u.remove=function(){};return u.disable=function(){h=!1},u.enable=function(){h=!0},f&&(f._commandObserver=u),u},t.hasSimpleAPICommandBindings=function(s,f,c){var v,u=f.length,h;for(v=0;v<u;v++){var d,p=f[v],m=p.method,y=p.args;if(Array.isArray(y)||(y=[]),!m)return!1;var b=t.computeAPICommandBindings(s,m,y);if(b.length!==1)return!1;if(!h)h=b[0],Array.isArray(h.traces)&&h.traces.sort();else{if(d=b[0],d.type!==h.type||d.prop!==h.prop)return!1;if(Array.isArray(h.traces))if(Array.isArray(d.traces)){d.traces.sort();for(var w=0;w<h.traces.length;w++)if(h.traces[w]!==d.traces[w])return!1}else return!1;else if(d.prop!==h.prop)return!1}d=b[0];var g=d.value;if(Array.isArray(g))if(g.length===1)g=g[0];else return!1;c&&(c[g]=v)}return h};function a(s,f,c){var v,u,h,d=!1;if(f.type==="data")v=s._fullData[f.traces!==null?f.traces[0]:0];else if(f.type==="layout")v=s._fullLayout;else return!1;return u=r.nestedProperty(v,f.prop).get(),h=c[f.type]=c[f.type]||{},h.hasOwnProperty(f.prop)&&h[f.prop]!==u&&(d=!0),h[f.prop]=u,{changed:d,value:u}}t.executeAPICommand=function(s,f,c){if(f==="skip")return Promise.resolve();var v=e.apiMethodRegistry[f],u=[s];Array.isArray(c)||(c=[]);for(var h=0;h<c.length;h++)u.push(c[h]);return v.apply(null,u).catch(function(d){return r.warn("API call to Plotly."+f+" rejected.",d),Promise.reject(d)})},t.computeAPICommandBindings=function(s,f,c){var v;switch(Array.isArray(c)||(c=[]),f){case"restyle":v=o(s,c);break;case"relayout":v=n(s,c);break;case"update":v=o(s,[c[0],c[2]]).concat(n(s,[c[1]]));break;case"animate":v=i(s,c);break;default:v=[]}return v};function i(s,f){return Array.isArray(f[0])&&f[0].length===1&&["string","number"].indexOf(typeof f[0][0])!==-1?[{type:"layout",prop:"_currentFrame",value:f[0][0].toString()}]:[]}function n(s,f){var c=[],v=f[0],u={};if(typeof v=="string")u[v]=f[1];else if(r.isPlainObject(v))u=v;else return c;return l(u,function(h,d,p){c.push({type:"layout",prop:h,value:p})},"",0),c}function o(s,f){var c,v,u,h,d=[];if(v=f[0],u=f[1],c=f[2],h={},typeof v=="string")h[v]=u;else if(r.isPlainObject(v))h=v,c===void 0&&(c=u);else return d;return c===void 0&&(c=null),l(h,function(p,m,y){var b,w;if(Array.isArray(y)){w=y.slice();var g=Math.min(w.length,s.data.length);c&&(g=Math.min(g,c.length)),b=[];for(var x=0;x<g;x++)b[x]=c?c[x]:x}else w=y,b=c?c.slice():null;if(b===null)Array.isArray(w)&&(w=w[0]);else if(Array.isArray(b)){if(!Array.isArray(w)){var _=w;w=[];for(var T=0;T<b.length;T++)w[T]=_}w.length=Math.min(b.length,w.length)}d.push({type:"data",prop:p,traces:b,value:w})},"",0),d}function l(s,f,c,v){Object.keys(s).forEach(function(u){var h=s[u];if(u[0]!=="_"){var d=c+(v>0?".":"")+u;r.isPlainObject(h)?l(h,f,d,v+1):f(d,u,h)}})}}(_u)),_u}var O_=gt,PL=zl.timeFormatLocale,RL=z1.formatLocale,Al=wt,Dt=ot,j_=Oo,EL=Ht,je=me,B_=ht,Em=or.BADNUM,Kr=lr,zL=Mn.clearOutline,IL=Xh,Yh=Cc,FL=F_,NL=ss.getModuleCalcData,kd=je.relinkPrivateKeys,Pn=je._,Pe=N_.exports={};je.extendFlat(Pe,Dt);Pe.attributes=ba;Pe.attributes.type.values=Pe.allTypes;Pe.fontAttrs=Mr;Pe.layoutAttributes=os;Pe.fontWeight="normal";var zc=Pe.transformsRegistry,Ic=$L();Pe.executeAPICommand=Ic.executeAPICommand;Pe.computeAPICommandBindings=Ic.computeAPICommandBindings;Pe.manageCommandObserver=Ic.manageCommandObserver;Pe.hasSimpleAPICommandBindings=Ic.hasSimpleAPICommandBindings;Pe.redrawText=function(t){return t=je.getGraphDiv(t),new Promise(function(e){setTimeout(function(){t._fullLayout&&(Dt.getComponentMethod("annotations","draw")(t),Dt.getComponentMethod("legend","draw")(t),Dt.getComponentMethod("colorbar","draw")(t),e(Pe.previousPromises(t)))},300)})};Pe.resize=function(t){t=je.getGraphDiv(t);var e,r=new Promise(function(a,i){(!t||je.isHidden(t))&&i(new Error("Resize must be passed a displayed plot div element.")),t._redrawTimer&&clearTimeout(t._redrawTimer),t._resolveResize&&(e=t._resolveResize),t._resolveResize=a,t._redrawTimer=setTimeout(function(){if(!t.layout||t.layout.width&&t.layout.height||je.isHidden(t)){a(t);return}delete t.layout.width,delete t.layout.height;var n=t.changed;t.autoplay=!0,Dt.call("relayout",t,{autosize:!0}).then(function(){t.changed=n,t._resolveResize===a&&(delete t._resolveResize,a(t))})},100)});return e&&e(r),r};Pe.previousPromises=function(t){if((t._promises||[]).length)return Promise.all(t._promises).then(function(){t._promises=[]})};Pe.addLinks=function(t){if(!(!t._context.showLink&&!t._context.showSources)){var e=t._fullLayout,r=je.ensureSingle(e._paper,"text","js-plot-link-container",function(s){s.style({"font-family":'"Open Sans", Arial, sans-serif',"font-size":"12px",fill:B_.defaultLine,"pointer-events":"all"}).each(function(){var f=O_.select(this);f.append("tspan").classed("js-link-to-tool",!0),f.append("tspan").classed("js-link-spacer",!0),f.append("tspan").classed("js-sourcelinks",!0)})}),a=r.node(),i={y:e._paper.attr("height")-9};document.body.contains(a)&&a.getComputedTextLength()>=e.width-20?(i["text-anchor"]="start",i.x=5):(i["text-anchor"]="end",i.x=e._paper.attr("width")-7),r.attr(i);var n=r.select(".js-link-to-tool"),o=r.select(".js-link-spacer"),l=r.select(".js-sourcelinks");t._context.showSources&&t._context.showSources(t),t._context.showLink&&HL(t,n),o.text(n.text()&&l.text()?" - ":"")}};function HL(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(){Pe.sendDataToCloud(t)});else{var a=window.location.pathname.split("/"),i=window.location.search;r.attr({"xlink:xlink:show":"new","xlink:xlink:href":"/"+a[2].split(".")[0]+"/"+a[1]+i})}}Pe.sendDataToCloud=function(t){var e=(window.PLOTLYENV||{}).BASE_URL||t._context.plotlyServerURL;if(e){t.emit("plotly_beforeexport");var r=O_.select(t).append("div").attr("id","hiddenform").style("display","none"),a=r.append("form").attr({action:e+"/external",method:"post",target:"_blank"}),i=a.append("input").attr({type:"text",name:"data"});return i.node().value=Pe.graphJson(t,!1,"keepdata"),a.node().submit(),r.remove(),t.emit("plotly_afterexport"),!1}};var OL=["days","shortDays","months","shortMonths","periods","dateTime","date","time","decimal","thousands","grouping","currency"],jL=["year","month","dayMonth","dayMonthYear"];Pe.supplyDefaults=function(t,e){var r=e&&e.skipUpdateCalc,a=t._fullLayout||{};if(a._skipDefaults){delete a._skipDefaults;return}var i=t._fullLayout={},n=t.layout||{},o=t._fullData||[],l=t._fullData=[],s=t.data||[],f=t.calcdata||[],c=t._context||{},v;t._transitionData||Pe.createTransitionData(t),i._dfltTitle={plot:Pn(t,"Click to enter Plot title"),x:Pn(t,"Click to enter X axis title"),y:Pn(t,"Click to enter Y axis title"),colorbar:Pn(t,"Click to enter Colorscale title"),annotation:Pn(t,"new text")},i._traceWord=Pn(t,"trace");var u=zm(t,OL);if(i._mapboxAccessToken=c.mapboxAccessToken,a._initialAutoSizeIsDone){var h=a.width,d=a.height;Pe.supplyLayoutGlobalDefaults(n,i,u),n.width||(i.width=h),n.height||(i.height=d),Pe.sanitizeMargins(i)}else{Pe.supplyLayoutGlobalDefaults(n,i,u);var p=!n.width||!n.height,m=i.autosize,y=c.autosizable,b=p&&(m||y);b?Pe.plotAutoSize(t,n,i):p&&Pe.sanitizeMargins(i),!m&&p&&(n.width=i.width,n.height=i.height)}i._d3locale=UL(u,i.separators),i._extraFormat=zm(t,jL),i._initialAutoSizeIsDone=!0,i._dataLength=s.length,i._modules=[],i._visibleModules=[],i._basePlotModules=[];var w=i._subplots=GL(),g=i._splomAxes={x:{},y:{}},x=i._splomSubplots={};i._splomGridDflt={},i._scatterStackOpts={},i._firstScatter={},i._alignmentOpts={},i._colorAxes={},i._requestRangeslider={},i._traceUids=BL(o,s),i._globalTransforms=(t._context||{}).globalTransforms,Pe.supplyDataDefaults(s,l,n,i);var _=Object.keys(g.x),T=Object.keys(g.y);if(_.length>1&&T.length>1){for(Dt.getComponentMethod("grid","sizeDefaults")(n,i),v=0;v<_.length;v++)je.pushUnique(w.xaxis,_[v]);for(v=0;v<T.length;v++)je.pushUnique(w.yaxis,T[v]);for(var k in x)je.pushUnique(w.cartesian,k)}if(i._has=Pe._hasPlotType.bind(i),o.length===l.length)for(v=0;v<l.length;v++)kd(l[v],o[v]);Pe.supplyLayoutModuleDefaults(n,i,l,t._transitionData);var S=i._visibleModules,L=[];for(v=0;v<S.length;v++){var D=S[v].crossTraceDefaults;D&&je.pushUnique(L,D)}for(v=0;v<L.length;v++)L[v](l,i);i._hasOnlyLargeSploms=i._basePlotModules.length===1&&i._basePlotModules[0].name==="splom"&&_.length>15&&T.length>15&&i.shapes.length===0&&i.images.length===0,Pe.linkSubplots(l,i,o,a),Pe.cleanPlot(l,i,o,a);var $=!!(a._has&&a._has("gl2d")),E=!!(i._has&&i._has("gl2d")),z=!!(a._has&&a._has("cartesian")),O=!!(i._has&&i._has("cartesian")),I=z||$,P=O||E;I&&!P?a._bgLayer.remove():P&&!I&&(i._shouldCreateBgLayer=!0),a._zoomlayer&&!t._dragging&&zL({_fullLayout:a}),VL(l,i),kd(i,a),Dt.getComponentMethod("colorscale","crossTraceDefaults")(l,i),i._preGUI||(i._preGUI={}),i._tracePreGUI||(i._tracePreGUI={});var M=i._tracePreGUI,A={},C;for(C in M)A[C]="old";for(v=0;v<l.length;v++)C=l[v]._fullInput.uid,A[C]||(M[C]={}),A[C]="new";for(C in A)A[C]==="old"&&delete M[C];U_(i),Dt.getComponentMethod("rangeslider","makeData")(i),!r&&f.length===l.length&&Pe.supplyDefaultsUpdateCalc(f,l)};Pe.supplyDefaultsUpdateCalc=function(t,e){for(var r=0;r<e.length;r++){var a=e[r],i=(t[r]||[])[0];if(i&&i.trace){var n=i.trace;if(n._hasCalcTransform){var o=n._arrayAttrs,l,s,f;for(l=0;l<o.length;l++)s=o[l],f=je.nestedProperty(n,s).get().slice(),je.nestedProperty(a,s).set(f)}i.trace=a}}};function BL(t,e){var r=e.length,a=[],i,n;for(i=0;i<t.length;i++){var o=t[i]._fullInput;o!==n&&a.push(o),n=o}var l=a.length,s=new Array(r),f={};function c(h,d){s[d]=h,f[h]=1}function v(h,d){if(h&&typeof h=="string"&&!f[h])return c(h,d),!0}for(i=0;i<r;i++){var u=e[i].uid;typeof u=="number"&&(u=String(u)),!v(u,i)&&(i<l&&v(a[i].uid,i)||c(je.randstr(f),i))}return s}function GL(){var t=Dt.collectableSubplotTypes,e={},r,a;if(!t){t=[];var i=Dt.subplotsRegistry;for(var n in i){var o=i[n],l=o.attr;if(l&&(t.push(n),Array.isArray(l)))for(a=0;a<l.length;a++)je.pushUnique(t,l[a])}}for(r=0;r<t.length;r++)e[t[r]]=[];return e}function zm(t,e){var r=t._context.locale;r||(r="en-US");var a=!1,i={};function n(v){for(var u=!0,h=0;h<e.length;h++){var d=e[h];i[d]||(v[d]?i[d]=v[d]:u=!1)}u&&(a=!0)}for(var o=0;o<2;o++){for(var l=t._context.locales,s=0;s<2;s++){var f=(l[r]||{}).format;if(f&&(n(f),a))break;l=Dt.localeRegistry}var c=r.split("-")[0];if(a||c===r)break;r=c}return a||n(Dt.localeRegistry.en.format),i}function UL(t,e){return t.decimal=e.charAt(0),t.thousands=e.charAt(1),{numberFormat:function(r){try{r=RL(t).format(je.adjustFormat(r))}catch{return je.warnBadFormat(r),je.noFormat}return r},timeFormat:PL(t).utcFormat}}function VL(t,e){var r,a=[];e.meta&&(r=e._meta={meta:e.meta,layout:{meta:e.meta}});for(var i=0;i<t.length;i++){var n=t[i];n.meta?a[n.index]=n._meta={meta:n.meta}:e.meta&&(n._meta={meta:e.meta}),e.meta&&(n._meta.layout={meta:e.meta})}a.length&&(r||(r=e._meta={}),r.data=a)}Pe.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=[])};Pe._hasPlotType=function(t){var e,r=this._basePlotModules||[];for(e=0;e<r.length;e++)if(r[e].name===t)return!0;var a=this._modules||[];for(e=0;e<a.length;e++){var i=a[e].name;if(i===t)return!0;var n=Dt.modules[i];if(n&&n.categories[t])return!0}return!1};Pe.cleanPlot=function(t,e,r,a){var i,n,o=a._basePlotModules||[];for(i=0;i<o.length;i++){var l=o[i];l.clean&&l.clean(t,e,r,a)}var s=a._has&&a._has("gl"),f=e._has&&e._has("gl");s&&!f&&a._glcontainer!==void 0&&(a._glcontainer.selectAll(".gl-canvas").remove(),a._glcontainer.selectAll(".no-webgl").remove(),a._glcanvas=null);var c=!!a._infolayer;e:for(i=0;i<r.length;i++){var v=r[i],u=v.uid;for(n=0;n<t.length;n++){var h=t[n];if(u===h.uid)continue e}c&&a._infolayer.select(".cb"+u).remove()}};Pe.linkSubplots=function(t,e,r,a){var i,n,o=a._plots||{},l=e._plots={},s=e._subplots,f={_fullData:t,_fullLayout:e},c=s.cartesian.concat(s.gl2d||[]);for(i=0;i<c.length;i++){var v=c[i],u=o[v],h=Kr.getFromId(f,v,"x"),d=Kr.getFromId(f,v,"y"),p;for(u?p=l[v]=u:(p=l[v]={},p.id=v),h._counterAxes.push(d._id),d._counterAxes.push(h._id),h._subplotsWith.push(v),d._subplotsWith.push(v),p.xaxis=h,p.yaxis=d,p._hasClipOnAxisFalse=!1,n=0;n<t.length;n++){var m=t[n];if(m.xaxis===p.xaxis._id&&m.yaxis===p.yaxis._id&&m.cliponaxis===!1){p._hasClipOnAxisFalse=!0;break}}}var y=Kr.list(f,null,!0),b;for(i=0;i<y.length;i++){b=y[i];var w=null;b.overlaying&&(w=Kr.getFromId(f,b.overlaying),w&&w.overlaying&&(b.overlaying=!1,w=null)),b._mainAxis=w||b,w&&(b.domain=w.domain.slice()),b._anchorAxis=b.anchor==="free"?null:Kr.getFromId(f,b.anchor)}for(i=0;i<y.length;i++)if(b=y[i],b._counterAxes.sort(Kr.idSort),b._subplotsWith.sort(je.subplotSort),b._mainSubplot=XL(b,e),b._counterAxes.length&&(b.spikemode&&b.spikemode.indexOf("across")!==-1||b.automargin&&b.mirror&&b.anchor!=="free"||Dt.getComponentMethod("rangeslider","isVisible")(b))){var g=1,x=0;for(n=0;n<b._counterAxes.length;n++){var _=Kr.getFromId(f,b._counterAxes[n]);g=Math.min(g,_.domain[0]),x=Math.max(x,_.domain[1])}g<x&&(b._counterDomainMin=g,b._counterDomainMax=x)}};function XL(t,e){var r={_fullLayout:e},a=t._id.charAt(0)==="x",i=t._mainAxis._anchorAxis,n="",o="",l="";if(i&&(l=i._mainAxis._id,n=a?t._id+l:l+t._id),!n||!e._plots[n]){n="";for(var s=t._counterAxes,f=0;f<s.length;f++){var c=s[f],v=a?t._id+c:c+t._id;o||(o=v);var u=Kr.getFromId(r,c);if(l&&u.overlaying===l){n=v;break}}}return n||o}Pe.clearExpandedTraceDefaultColors=function(t){var e,r,a;function i(o,l,s,f){r[f]=l,r.length=f+1,o.valType==="color"&&o.dflt===void 0&&e.push(r.join("."))}for(r=[],e=t._module._colorAttrs,e||(t._module._colorAttrs=e=[],j_.crawl(t._module.attributes,i)),a=0;a<e.length;a++){var n=je.nestedProperty(t,"_input."+e[a]);n.get()||je.nestedProperty(t,e[a]).set(null)}};Pe.supplyDataDefaults=function(t,e,r,a){var i=a._modules,n=a._visibleModules,o=a._basePlotModules,l=0,s=0,f,c,v;a._transformModules=[];function u(T){e.push(T);var k=T._module;k&&(je.pushUnique(i,k),T.visible===!0&&je.pushUnique(n,k),je.pushUnique(o,T._module.basePlotModule),l++,T._input.visible!==!1&&s++)}var h={},d=[],p=(r.template||{}).data||{},m=EL.traceTemplater(p);for(f=0;f<t.length;f++){if(v=t[f],c=m.newTrace(v),c.uid=a._traceUids[f],Pe.supplyTraceDefaults(v,c,s,a,f),c.index=f,c._input=v,c._expandedIndex=l,c.transforms&&c.transforms.length)for(var y=v.visible!==!1&&c.visible===!1,b=YL(c,e,r,a),w=0;w<b.length;w++){var g=b[w],x={_template:c._template,type:c.type,uid:c.uid+w};y&&g.visible===!1&&delete g.visible,Pe.supplyTraceDefaults(g,x,l,a,f),kd(x,g),x.index=f,x._input=v,x._fullInput=c,x._expandedIndex=l,x._expandedInput=g,u(x)}else c._fullInput=c,c._expandedInput=c,u(c);Dt.traceIs(c,"carpetAxis")&&(h[c.carpet]=c),Dt.traceIs(c,"carpetDependent")&&d.push(f)}for(f=0;f<d.length;f++)if(c=e[d[f]],!!c.visible){var _=h[c.carpet];if(c._carpet=_,!_||!_.visible){c.visible=!1;continue}c.xaxis=_.xaxis,c.yaxis=_.yaxis}};Pe.supplyAnimationDefaults=function(t){t=t||{};var e,r={};function a(i,n){return je.coerce(t||{},r,Yh,i,n)}if(a("mode"),a("direction"),a("fromcurrent"),Array.isArray(t.frame))for(r.frame=[],e=0;e<t.frame.length;e++)r.frame[e]=Pe.supplyAnimationFrameDefaults(t.frame[e]||{});else r.frame=Pe.supplyAnimationFrameDefaults(t.frame||{});if(Array.isArray(t.transition))for(r.transition=[],e=0;e<t.transition.length;e++)r.transition[e]=Pe.supplyAnimationTransitionDefaults(t.transition[e]||{});else r.transition=Pe.supplyAnimationTransitionDefaults(t.transition||{});return r};Pe.supplyAnimationFrameDefaults=function(t){var e={};function r(a,i){return je.coerce(t||{},e,Yh.frame,a,i)}return r("duration"),r("redraw"),e};Pe.supplyAnimationTransitionDefaults=function(t){var e={};function r(a,i){return je.coerce(t||{},e,Yh.transition,a,i)}return r("duration"),r("easing"),e};Pe.supplyFrameDefaults=function(t){var e={};function r(a,i){return je.coerce(t,e,FL,a,i)}return r("group"),r("name"),r("traces"),r("baseframe"),r("data"),r("layout"),e};Pe.supplyTraceDefaults=function(t,e,r,a,i){var n=a.colorway||B_.defaults,o=n[r%n.length],l;function s(b,w){return je.coerce(t,e,Pe.attributes,b,w)}var f=s("visible");s("type"),s("name",a._traceWord+" "+i),s("uirevision",a.uirevision);var c=Pe.getModule(e);if(e._module=c,c){var v=c.basePlotModule,u=v.attr,h=v.attributes;if(u&&h){var d=a._subplots,p="";if(f||v.name!=="gl2d"){if(Array.isArray(u))for(l=0;l<u.length;l++){var m=u[l],y=je.coerce(t,e,h,m);d[m]&&je.pushUnique(d[m],y),p+=y}else p=je.coerce(t,e,h,u);d[v.name]&&je.pushUnique(d[v.name],p)}}}return f&&(s("customdata"),s("ids"),s("meta"),Dt.traceIs(e,"showLegend")?(je.coerce(t,e,c.attributes.showlegend?c.attributes:Pe.attributes,"showlegend"),s("legend"),s("legendwidth"),s("legendgroup"),s("legendgrouptitle.text"),s("legendrank"),e._dfltShowLegend=!0):e._dfltShowLegend=!1,c&&c.supplyDefaults(t,e,o,a),Dt.traceIs(e,"noOpacity")||s("opacity"),Dt.traceIs(e,"notLegendIsolatable")&&(e.visible=!!e.visible),Dt.traceIs(e,"noHover")||(e.hovertemplate||je.coerceHoverinfo(t,e,a),e.type!=="parcats"&&Dt.getComponentMethod("fx","supplyDefaults")(t,e,o,a)),c&&c.selectPoints&&s("selectedpoints"),Pe.supplyTransformDefaults(t,e,a)),e};function G_(t){var e=t.transforms;if(Array.isArray(e)&&e.length)for(var r=0;r<e.length;r++){var a=e[r],i=a._module||zc[a.type];if(i&&i.makesData)return!0}return!1}Pe.hasMakesDataTransform=G_;Pe.supplyTransformDefaults=function(t,e,r){if(e._length||G_(t)){var a=r._globalTransforms||[],i=r._transformModules||[];if(!(!Array.isArray(t.transforms)&&a.length===0))for(var n=t.transforms||[],o=a.concat(n),l=e.transforms=[],s=0;s<o.length;s++){var f=o[s],c=f.type,v=zc[c],u,h=!(f._module&&f._module===v),d=v&&typeof v.transform=="function";v||je.warn("Unrecognized transform type "+c+"."),v&&v.supplyDefaults&&(h||d)?(u=v.supplyDefaults(f,e,r,t),u.type=c,u._module=v,je.pushUnique(i,v)):u=je.extendFlat({},f),l.push(u)}}};function YL(t,e,r,a){for(var i=t.transforms,n=[t],o=0;o<i.length;o++){var l=i[o],s=zc[l.type];s&&s.transform&&(n=s.transform(n,{transform:l,fullTrace:t,fullData:e,layout:r,fullLayout:a,transformIndex:o}))}return n}Pe.supplyLayoutGlobalDefaults=function(t,e,r){function a(v,u){return je.coerce(t,e,Pe.layoutAttributes,v,u)}var i=t.template;je.isPlainObject(i)&&(e.template=i,e._template=i.layout,e._dataTemplate=i.data),a("autotypenumbers");var n=je.coerceFont(a,"font"),o=n.size;je.coerceFont(a,"title.font",je.extendFlat({},n,{size:Math.round(o*1.4)})),a("title.text",e._dfltTitle.plot),a("title.xref");var l=a("title.yref");a("title.pad.t"),a("title.pad.r"),a("title.pad.b"),a("title.pad.l");var s=a("title.automargin");a("title.x"),a("title.xanchor"),a("title.y"),a("title.yanchor"),s&&(l==="paper"&&(e.title.y!==0&&(e.title.y=1),e.title.yanchor==="auto"&&(e.title.yanchor=e.title.y===0?"top":"bottom")),l==="container"&&(e.title.y==="auto"&&(e.title.y=1),e.title.yanchor==="auto"&&(e.title.yanchor=e.title.y<.5?"bottom":"top")));var f=a("uniformtext.mode");f&&a("uniformtext.minsize"),a("autosize",!(t.width&&t.height)),a("width"),a("height"),a("minreducedwidth"),a("minreducedheight"),a("margin.l"),a("margin.r"),a("margin.t"),a("margin.b"),a("margin.pad"),a("margin.autoexpand"),t.width&&t.height&&Pe.sanitizeMargins(e),Dt.getComponentMethod("grid","sizeDefaults")(t,e),a("paper_bgcolor"),a("separators",r.decimal+r.thousands),a("hidesources"),a("colorway"),a("datarevision");var c=a("uirevision");a("editrevision",c),a("selectionrevision",c),Dt.getComponentMethod("modebar","supplyLayoutDefaults")(t,e),Dt.getComponentMethod("shapes","supplyDrawNewShapeDefaults")(t,e,a),Dt.getComponentMethod("selections","supplyDrawNewSelectionDefaults")(t,e,a),a("meta"),je.isPlainObject(t.transition)&&(a("transition.duration"),a("transition.easing"),a("transition.ordering")),Dt.getComponentMethod("calendars","handleDefaults")(t,e,"calendar"),Dt.getComponentMethod("fx","supplyLayoutGlobalDefaults")(t,e,a),je.coerce(t,e,IL,"scattermode")};function Ss(t){return typeof t=="string"&&t.substr(t.length-2)==="px"&&parseFloat(t)}Pe.plotAutoSize=function(e,r,a){var i=e._context||{},n=i.frameMargins,o,l,s=je.isPlotDiv(e);if(s&&e.emit("plotly_autosize"),i.fillFrame)o=window.innerWidth,l=window.innerHeight,document.body.style.overflow="hidden";else{var f=s?window.getComputedStyle(e):{};if(o=Ss(f.width)||Ss(f.maxWidth)||a.width,l=Ss(f.height)||Ss(f.maxHeight)||a.height,Al(n)&&n>0){var c=1-2*n;o=Math.round(c*o),l=Math.round(c*l)}}var v=Pe.layoutAttributes.width.min,u=Pe.layoutAttributes.height.min;o<v&&(o=v),l<u&&(l=u);var h=!r.width&&Math.abs(a.width-o)>1,d=!r.height&&Math.abs(a.height-l)>1;(d||h)&&(h&&(a.width=o),d&&(a.height=l)),e._initialAutoSize||(e._initialAutoSize={width:o,height:l}),Pe.sanitizeMargins(a)};Pe.supplyLayoutModuleDefaults=function(t,e,r,a){var i=Dt.componentsRegistry,n=e._basePlotModules,o,l,s,f=Dt.subplotsRegistry.cartesian;for(o in i)s=i[o],s.includeBasePlot&&s.includeBasePlot(t,e);n.length||n.push(f),e._has("cartesian")&&(Dt.getComponentMethod("grid","contentDefaults")(t,e),f.finalizeSubplots(t,e));for(var c in e._subplots)e._subplots[c].sort(je.subplotSort);for(l=0;l<n.length;l++)s=n[l],s.supplyLayoutDefaults&&s.supplyLayoutDefaults(t,e,r);var v=e._modules;for(l=0;l<v.length;l++)s=v[l],s.supplyLayoutDefaults&&s.supplyLayoutDefaults(t,e,r);var u=e._transformModules;for(l=0;l<u.length;l++)s=u[l],s.supplyLayoutDefaults&&s.supplyLayoutDefaults(t,e,r,a);for(o in i)s=i[o],s.supplyLayoutDefaults&&s.supplyLayoutDefaults(t,e,r)};Pe.purge=function(t){var e=t._fullLayout||{};e._glcontainer!==void 0&&(e._glcontainer.selectAll(".gl-canvas").remove(),e._glcontainer.remove(),e._glcanvas=null),e._modeBar&&e._modeBar.destroy(),t._transitionData&&(t._transitionData._interruptCallbacks&&(t._transitionData._interruptCallbacks.length=0),t._transitionData._animationRaf&&window.cancelAnimationFrame(t._transitionData._animationRaf)),je.clearThrottle(),je.clearResponsive(t),delete t.data,delete t.layout,delete t._fullData,delete t._fullLayout,delete t.calcdata,delete t.empty,delete t.fid,delete t.undoqueue,delete t.undonum,delete t.autoplay,delete t.changed,delete t._promises,delete t._redrawTimer,delete t._hmlumcount,delete t._hmpixcount,delete t._transitionData,delete t._transitioning,delete t._initialAutoSize,delete t._transitioningWithDuration,delete t._dragging,delete t._dragged,delete t._dragdata,delete t._hoverdata,delete t._snapshotInProgress,delete t._editing,delete t._mouseDownTime,delete t._legendMouseDownTime,t.removeAllListeners&&t.removeAllListeners()};Pe.style=function(t){var e=t._fullLayout._visibleModules,r=[],a;for(a=0;a<e.length;a++){var i=e[a];i.style&&je.pushUnique(r,i.style)}for(a=0;a<r.length;a++)r[a](t)};Pe.sanitizeMargins=function(t){if(!(!t||!t.margin)){var e=t.width,r=t.height,a=t.margin,i=e-(a.l+a.r),n=r-(a.t+a.b),o;i<0&&(o=(e-1)/(a.l+a.r),a.l=Math.floor(o*a.l),a.r=Math.floor(o*a.r)),n<0&&(o=(r-1)/(a.t+a.b),a.t=Math.floor(o*a.t),a.b=Math.floor(o*a.b))}};Pe.clearAutoMarginIds=function(t){t._fullLayout._pushmarginIds={}};Pe.allowAutoMargin=function(t,e){t._fullLayout._pushmarginIds[e]=1};function U_(t){var e=t.margin;if(!t._size){var r=t._size={l:Math.round(e.l),r:Math.round(e.r),t:Math.round(e.t),b:Math.round(e.b),p:Math.round(e.pad)};r.w=Math.round(t.width)-r.l-r.r,r.h=Math.round(t.height)-r.t-r.b}t._pushmargin||(t._pushmargin={}),t._pushmarginIds||(t._pushmarginIds={}),t._reservedMargin||(t._reservedMargin={})}var V_=2,X_=2;Pe.autoMargin=function(t,e,r){var a=t._fullLayout,i=a.width,n=a.height,o=a.margin,l=a.minreducedwidth,s=a.minreducedheight,f=je.constrain(i-o.l-o.r,V_,l),c=je.constrain(n-o.t-o.b,X_,s),v=Math.max(0,i-f),u=Math.max(0,n-c),h=a._pushmargin,d=a._pushmarginIds;if(o.autoexpand!==!1){if(!r)delete h[e],delete d[e];else{var p=r.pad;if(p===void 0&&(p=Math.min(12,o.l,o.r,o.t,o.b)),v){var m=(r.l+r.r)/v;m>1&&(r.l/=m,r.r/=m)}if(u){var y=(r.t+r.b)/u;y>1&&(r.t/=y,r.b/=y)}var b=r.xl!==void 0?r.xl:r.x,w=r.xr!==void 0?r.xr:r.x,g=r.yt!==void 0?r.yt:r.y,x=r.yb!==void 0?r.yb:r.y;h[e]={l:{val:b,size:r.l+p},r:{val:w,size:r.r+p},b:{val:x,size:r.b+p},t:{val:g,size:r.t+p}},d[e]=1}if(!a._replotting)return Pe.doAutoMargin(t)}};function WL(t){if("_redrawFromAutoMarginCount"in t._fullLayout)return!1;var e=Kr.list(t,"",!0);for(var r in e)if(e[r].autoshift||e[r].shift)return!0;return!1}Pe.doAutoMargin=function(t){var e=t._fullLayout,r=e.width,a=e.height;e._size||(e._size={}),U_(e);var i=e._size,n=e.margin,o={t:0,b:0,l:0,r:0},l=je.extendFlat({},i),s=n.l,f=n.r,c=n.t,v=n.b,u=e._pushmargin,h=e._pushmarginIds,d=e.minreducedwidth,p=e.minreducedheight;if(n.autoexpand!==!1){for(var m in u)h[m]||delete u[m];var y=t._fullLayout._reservedMargin;for(var b in y)for(var w in y[b]){var g=y[b][w];o[w]=Math.max(o[w],g)}u.base={l:{val:0,size:s},r:{val:1,size:f},t:{val:1,size:c},b:{val:0,size:v}};for(var x in o){var _=0;for(var T in u)T!=="base"&&Al(u[T][x].size)&&(_=u[T][x].size>_?u[T][x].size:_);var k=Math.max(0,n[x]-_);o[x]=Math.max(0,o[x]-k)}for(var S in u){var L=u[S].l||{},D=u[S].b||{},$=L.val,E=L.size,z=D.val,O=D.size,I=r-o.r-o.l,P=a-o.t-o.b;for(var M in u){if(Al(E)&&u[M].r){var A=u[M].r.val,C=u[M].r.size;if(A>$){var R=(E*A+(C-I)*$)/(A-$),N=(C*(1-$)+(E-I)*(1-A))/(A-$);R+N>s+f&&(s=R,f=N)}}if(Al(O)&&u[M].t){var H=u[M].t.val,B=u[M].t.size;if(H>z){var X=(O*H+(B-P)*z)/(H-z),j=(B*(1-z)+(O-P)*(1-H))/(H-z);X+j>v+c&&(v=X,c=j)}}}}}var q=je.constrain(r-n.l-n.r,V_,d),U=je.constrain(a-n.t-n.b,X_,p),Z=Math.max(0,r-q),K=Math.max(0,a-U);if(Z){var ee=(s+f)/Z;ee>1&&(s/=ee,f/=ee)}if(K){var le=(v+c)/K;le>1&&(v/=le,c/=le)}if(i.l=Math.round(s)+o.l,i.r=Math.round(f)+o.r,i.t=Math.round(c)+o.t,i.b=Math.round(v)+o.b,i.p=Math.round(n.pad),i.w=Math.round(r)-i.l-i.r,i.h=Math.round(a)-i.t-i.b,!e._replotting&&(Pe.didMarginChange(l,i)||WL(t))){"_redrawFromAutoMarginCount"in e?e._redrawFromAutoMarginCount++:e._redrawFromAutoMarginCount=1;var ye=3*(1+Object.keys(h).length);if(e._redrawFromAutoMarginCount<ye)return Dt.call("_doPlot",t);e._size=l,je.warn("Too many auto-margin redraws.")}qL(t)};function qL(t){var e=Kr.list(t,"",!0);["_adjustTickLabelsOverflow","_hideCounterAxisInsideTickLabels"].forEach(function(r){for(var a=0;a<e.length;a++){var i=e[a][r];i&&i()}})}var Im=["l","r","t","b","p","w","h"];Pe.didMarginChange=function(t,e){for(var r=0;r<Im.length;r++){var a=Im[r],i=t[a],n=e[a];if(!Al(i)||Math.abs(n-i)>1)return!0}return!1};Pe.graphJson=function(t,e,r,a,i,n){(i&&e&&!t._fullData||i&&!e&&!t._fullLayout)&&Pe.supplyDefaults(t);var o=i?t._fullData:t.data,l=i?t._fullLayout:t.layout,s=(t._transitionData||{})._frames;function f(u,h){if(typeof u=="function")return h?"_function_":null;if(je.isPlainObject(u)){var d={},p;return Object.keys(u).sort().forEach(function(m){if(["_","["].indexOf(m.charAt(0))===-1){if(typeof u[m]=="function"){h&&(d[m]="_function");return}if(r==="keepdata"){if(m.substr(m.length-3)==="src")return}else if(r==="keepstream"){if(p=u[m+"src"],typeof p=="string"&&p.indexOf(":")>0&&!je.isPlainObject(u.stream))return}else if(r!=="keepall"&&(p=u[m+"src"],typeof p=="string"&&p.indexOf(":")>0))return;d[m]=f(u[m],h)}}),d}return Array.isArray(u)?u.map(function(m){return f(m,h)}):je.isTypedArray(u)?je.simpleMap(u,je.identity):je.isJSDate(u)?je.ms2DateTimeLocal(+u):u}var c={data:(o||[]).map(function(u){var h=f(u);return e&&delete h.fit,h})};if(!e&&(c.layout=f(l),i)){var v=l._size;c.layout.computed={margin:{b:v.b,l:v.l,r:v.r,t:v.t}}}return s&&(c.frames=f(s)),n&&(c.config=f(t._context,!0)),a==="object"?c:JSON.stringify(c)};Pe.modifyFrames=function(t,e){var r,a,i,n=t._transitionData._frames,o=t._transitionData._frameHash;for(r=0;r<e.length;r++)switch(a=e[r],a.type){case"replace":i=a.value;var l=(n[a.index]||{}).name,s=i.name;n[a.index]=o[s]=i,s!==l&&(delete o[l],o[s]=i);break;case"insert":i=a.value,o[i.name]=i,n.splice(a.index,0,i);break;case"delete":i=n[a.index],delete o[i.name],n.splice(a.index,1);break}return Promise.resolve()};Pe.computeFrame=function(t,e){var r=t._transitionData._frameHash,a,i,n,o;if(!e)throw new Error("computeFrame must be given a string frame name");var l=r[e.toString()];if(!l)return!1;for(var s=[l],f=[l.name];l.baseframe&&(l=r[l.baseframe.toString()])&&f.indexOf(l.name)===-1;)s.push(l),f.push(l.name);for(var c={};l=s.pop();)if(l.layout&&(c.layout=Pe.extendLayout(c.layout,l.layout)),l.data){if(c.data||(c.data=[]),i=l.traces,!i)for(i=[],a=0;a<l.data.length;a++)i[a]=a;for(c.traces||(c.traces=[]),a=0;a<l.data.length;a++)n=i[a],n!=null&&(o=c.traces.indexOf(n),o===-1&&(o=c.data.length,c.traces[o]=n),c.data[o]=Pe.extendTrace(c.data[o],l.data[a]))}return c};Pe.recomputeFrameHash=function(t){for(var e=t._transitionData._frameHash={},r=t._transitionData._frames,a=0;a<r.length;a++){var i=r[a];i&&i.name&&(e[i.name]=i)}};Pe.extendObjectWithContainers=function(t,e,r){var a,i,n,o,l,s,f,c,v=je.extendDeepNoArrays({},e||{}),u=je.expandObjectPaths(v),h={};if(r&&r.length)for(n=0;n<r.length;n++)a=je.nestedProperty(u,r[n]),i=a.get(),i===void 0?je.nestedProperty(h,r[n]).set(null):(a.set(null),je.nestedProperty(h,r[n]).set(i));if(t=je.extendDeepNoArrays(t||{},u),r&&r.length){for(n=0;n<r.length;n++)if(l=je.nestedProperty(h,r[n]),f=l.get(),!!f){for(s=je.nestedProperty(t,r[n]),c=s.get(),Array.isArray(c)||(c=[],s.set(c)),o=0;o<f.length;o++){var d=f[o];d===null?c[o]=null:c[o]=Pe.extendObjectWithContainers(c[o],d)}s.set(c)}}return t};Pe.dataArrayContainers=["transforms","dimensions"];Pe.layoutArrayContainers=Dt.layoutArrayContainers;Pe.extendTrace=function(t,e){return Pe.extendObjectWithContainers(t,e,Pe.dataArrayContainers)};Pe.extendLayout=function(t,e){return Pe.extendObjectWithContainers(t,e,Pe.layoutArrayContainers)};Pe.transition=function(t,e,r,a,i,n){var o={redraw:i.redraw},l={},s=[];return o.prepareFn=function(){for(var f=Array.isArray(e)?e.length:0,c=a.slice(0,f),v=0;v<c.length;v++){var u=c[v],h=t._fullData[u],d=h._module;if(d){if(d.animatable){var p=d.basePlotModule.name;l[p]||(l[p]=[]),l[p].push(u)}t.data[c[v]]=Pe.extendTrace(t.data[c[v]],e[v])}}var m=je.expandObjectPaths(je.extendDeepNoArrays({},r)),y=/^[xy]axis[0-9]*$/;for(var b in m)y.test(b)&&delete m[b].range;Pe.extendLayout(t.layout,m),delete t.calcdata,Pe.supplyDefaults(t),Pe.doCalcdata(t);var w=je.expandObjectPaths(r);if(w){var g=t._fullLayout._plots;for(var x in g){var _=g[x],T=_.xaxis,k=_.yaxis,S=T.range.slice(),L=k.range.slice(),D=null,$=null,E=null,z=null;Array.isArray(w[T._name+".range"])?D=w[T._name+".range"].slice():Array.isArray((w[T._name]||{}).range)&&(D=w[T._name].range.slice()),Array.isArray(w[k._name+".range"])?$=w[k._name+".range"].slice():Array.isArray((w[k._name]||{}).range)&&($=w[k._name].range.slice()),S&&D&&(T.r2l(S[0])!==T.r2l(D[0])||T.r2l(S[1])!==T.r2l(D[1]))&&(E={xr0:S,xr1:D}),L&&$&&(k.r2l(L[0])!==k.r2l($[0])||k.r2l(L[1])!==k.r2l($[1]))&&(z={yr0:L,yr1:$}),(E||z)&&s.push(je.extendFlat({plotinfo:_},E,z))}}return Promise.resolve()},o.runFn=function(f){var c,v=t._fullLayout._basePlotModules,u=s.length,h;if(r)for(h=0;h<v.length;h++)v[h].transitionAxes&&v[h].transitionAxes(t,s,n,f);u?(c=je.extendFlat({},n),c.duration=0,delete l.cartesian):c=n;for(var d in l){var p=l[d],m=t._fullData[p[0]]._module;m.basePlotModule.plot(t,p,c,f)}},Y_(t,n,o)};Pe.transitionFromReact=function(t,e,r,a){var i=t._fullLayout,n=i.transition,o={},l=[];return o.prepareFn=function(){var s=i._plots;o.redraw=!1,e.anim==="some"&&(o.redraw=!0),r.anim==="some"&&(o.redraw=!0);for(var f in s){var c=s[f],v=c.xaxis,u=c.yaxis,h=a[v._name].range.slice(),d=a[u._name].range.slice(),p=v.range.slice(),m=u.range.slice();v.setScale(),u.setScale();var y=null,b=null;(v.r2l(h[0])!==v.r2l(p[0])||v.r2l(h[1])!==v.r2l(p[1]))&&(y={xr0:h,xr1:p}),(u.r2l(d[0])!==u.r2l(m[0])||u.r2l(d[1])!==u.r2l(m[1]))&&(b={yr0:d,yr1:m}),(y||b)&&l.push(je.extendFlat({plotinfo:c},y,b))}return Promise.resolve()},o.runFn=function(s){for(var f=t._fullData,c=t._fullLayout,v=c._basePlotModules,u,h,d,p=[],m=0;m<f.length;m++)p.push(m);function y(){if(t._fullLayout)for(var w=0;w<v.length;w++)v[w].transitionAxes&&v[w].transitionAxes(t,l,u,s)}function b(){if(t._fullLayout)for(var w=0;w<v.length;w++)v[w].plot(t,d,h,s)}l.length&&e.anim?n.ordering==="traces first"?(u=je.extendFlat({},n,{duration:0}),d=p,h=n,setTimeout(y,n.duration),b()):(u=n,d=null,h=je.extendFlat({},n,{duration:0}),setTimeout(b,u.duration),y()):l.length?(u=n,y()):e.anim&&(d=p,h=n,b())},Y_(t,n,o)};function Y_(t,e,r){var a=!1;function i(v){var u=Promise.resolve();if(!v)return u;for(;v.length;)u=u.then(v.shift());return u}function n(v){if(v)for(;v.length;)v.shift()}function o(){return t.emit("plotly_transitioning",[]),new Promise(function(v){t._transitioning=!0,e.duration>0&&(t._transitioningWithDuration=!0),t._transitionData._interruptCallbacks.push(function(){a=!0}),r.redraw&&t._transitionData._interruptCallbacks.push(function(){return Dt.call("redraw",t)}),t._transitionData._interruptCallbacks.push(function(){t.emit("plotly_transitioninterrupted",[])});var u=0,h=0;function d(){return u++,function(){h++,!a&&h===u&&l(v)}}r.runFn(d),setTimeout(d())})}function l(v){if(t._transitionData)return n(t._transitionData._interruptCallbacks),Promise.resolve().then(function(){if(r.redraw)return Dt.call("redraw",t)}).then(function(){t._transitioning=!1,t._transitioningWithDuration=!1,t.emit("plotly_transitioned",[])}).then(v)}function s(){if(t._transitionData)return t._transitioning=!1,i(t._transitionData._interruptCallbacks)}var f=[Pe.previousPromises,s,r.prepareFn,Pe.rehover,Pe.reselect,o],c=je.syncOrAsync(f,t);return(!c||!c.then)&&(c=Promise.resolve()),c.then(function(){return t})}Pe.doCalcdata=function(t,e){var r=Kr.list(t),a=t._fullData,i=t._fullLayout,n,o,l,s,f=new Array(a.length),c=(t.calcdata||[]).slice();for(t.calcdata=f,i._numBoxes=0,i._numViolins=0,i._violinScaleGroupStats={},t._hmpixcount=0,t._hmlumcount=0,i._piecolormap={},i._sunburstcolormap={},i._treemapcolormap={},i._iciclecolormap={},i._funnelareacolormap={},l=0;l<a.length;l++)if(Array.isArray(e)&&e.indexOf(l)===-1){f[l]=c[l];continue}for(l=0;l<a.length;l++)n=a[l],n._arrayAttrs=j_.findArrayAttributes(n),n._extremes={};var v=i._subplots.polar||[];for(l=0;l<v.length;l++)r.push(i[v[l]].radialaxis,i[v[l]].angularaxis);for(var u in i._colorAxes){var h=i[u];h.cauto!==!1&&(delete h.cmin,delete h.cmax)}var d=!1;function p(b){if(n=a[b],o=n._module,n.visible===!0&&n.transforms){if(o&&o.calc){var w=o.calc(t,n);w[0]&&w[0].t&&w[0].t._scene&&delete w[0].t._scene.dirty}for(s=0;s<n.transforms.length;s++){var g=n.transforms[s];o=zc[g.type],o&&o.calcTransform&&(n._hasCalcTransform=!0,d=!0,o.calcTransform(t,n,g))}}}function m(b,w){if(n=a[b],o=n._module,!!o.isContainer===w){var g=[];if(n.visible===!0&&n._length!==0){delete n._indexToPoints;var x=n.transforms||[];for(s=x.length-1;s>=0;s--)if(x[s].enabled){n._indexToPoints=x[s]._indexToPoints;break}o&&o.calc&&(g=o.calc(t,n))}(!Array.isArray(g)||!g[0])&&(g=[{x:Em,y:Em}]),g[0].t||(g[0].t={}),g[0].trace=n,f[b]=g}}for(Fm(r,a,i),l=0;l<a.length;l++)m(l,!0);for(l=0;l<a.length;l++)p(l);for(d&&Fm(r,a,i),l=0;l<a.length;l++)m(l,!0);for(l=0;l<a.length;l++)m(l,!1);Nm(t);var y=KL(r,t);if(y.length){for(i._numBoxes=0,i._numViolins=0,l=0;l<y.length;l++)m(y[l],!0);for(l=0;l<y.length;l++)m(y[l],!1);Nm(t)}Dt.getComponentMethod("fx","calc")(t),Dt.getComponentMethod("errorbars","calc")(t)};var ZL=/(total|sum|min|max|mean|median) (ascending|descending)/;function KL(t,e){var r=[],a,i,n,o,l;function s(M,A,C){var R=A._id.charAt(0);if(M==="histogram2dcontour"){var N=A._counterAxes[0],H=Kr.getFromId(e,N),B=R==="x"||N==="x"&&H.type==="category",X=R==="y"||N==="y"&&H.type==="category";return function(j,q){return j===0||q===0||B&&j===C[q].length-1||X&&q===C.length-1?-1:(R==="y"?q:j)-1}}else return function(j,q){return R==="y"?q:j}}var f={min:function(M){return je.aggNums(Math.min,null,M)},max:function(M){return je.aggNums(Math.max,null,M)},sum:function(M){return je.aggNums(function(A,C){return A+C},null,M)},total:function(M){return je.aggNums(function(A,C){return A+C},null,M)},mean:function(M){return je.mean(M)},median:function(M){return je.median(M)}};function c(M,A){return M[1]-A[1]}function v(M,A){return A[1]-M[1]}for(a=0;a<t.length;a++){var u=t[a];if(u.type==="category"){var h=u.categoryorder.match(ZL);if(h){var d=h[1],p=h[2],m=u._id.charAt(0),y=m==="x",b=[];for(i=0;i<u._categories.length;i++)b.push([u._categories[i],[]]);for(i=0;i<u._traceIndices.length;i++){var w=u._traceIndices[i],g=e._fullData[w];if(g.visible===!0){var x=g.type;Dt.traceIs(g,"histogram")&&(delete g._xautoBinFinished,delete g._yautoBinFinished);var _=x==="splom",T=x==="scattergl",k=e.calcdata[w];for(n=0;n<k.length;n++){var S=k[n],L,D;if(_){var $=g._axesDim[u._id];if(!y){var E=g._diag[$][0];E&&(u=e._fullLayout[Kr.id2name(E)])}var z=S.trace.dimensions[$].values;for(o=0;o<z.length;o++)for(L=u._categoriesMap[z[o]],l=0;l<S.trace.dimensions.length;l++)if(l!==$){var O=S.trace.dimensions[l];b[L][1].push(O.values[o])}}else if(T){for(o=0;o<S.t.x.length;o++)y?(L=S.t.x[o],D=S.t.y[o]):(L=S.t.y[o],D=S.t.x[o]),b[L][1].push(D);S.t&&S.t._scene&&delete S.t._scene.dirty}else if(S.hasOwnProperty("z")){D=S.z;var I=s(g.type,u,D);for(o=0;o<D.length;o++)for(l=0;l<D[o].length;l++)L=I(l,o),L+1&&b[L][1].push(D[o][l])}else for(L=S.p,L===void 0&&(L=S[m]),D=S.s,D===void 0&&(D=S.v),D===void 0&&(D=y?S.y:S.x),Array.isArray(D)||(D===void 0?D=[]:D=[D]),o=0;o<D.length;o++)b[L][1].push(D[o])}}}u._categoriesValue=b;var P=[];for(i=0;i<b.length;i++)P.push([b[i][0],f[d](b[i][1])]);P.sort(p==="descending"?v:c),u._categoriesAggregatedValue=P,u._initialCategories=P.map(function(M){return M[0]}),r=r.concat(u.sortByInitialCategories())}}}return r}function Fm(t,e,r){var a={};function i(s){s.clearCalc(),s.type==="multicategory"&&s.setupMultiCategory(e),a[s._id]=1}je.simpleMap(t,i);for(var n=r._axisMatchGroups||[],o=0;o<n.length;o++)for(var l in n[o])a[l]||i(r[Kr.id2name(l)])}function Nm(t){var e=t._fullLayout,r=e._visibleModules,a={},i,n,o;for(n=0;n<r.length;n++){var l=r[n],s=l.crossTraceCalc;if(s){var f=l.basePlotModule.name;a[f]?je.pushUnique(a[f],s):a[f]=[s]}}for(o in a){var c=a[o],v=e._subplots[o];if(Array.isArray(v))for(i=0;i<v.length;i++){var u=v[i],h=o==="cartesian"?e._plots[u]:e[u];for(n=0;n<c.length;n++)c[n](t,h,u)}else for(n=0;n<c.length;n++)c[n](t)}}Pe.rehover=function(t){t._fullLayout._rehover&&t._fullLayout._rehover()};Pe.redrag=function(t){t._fullLayout._redrag&&t._fullLayout._redrag()};Pe.reselect=function(t){var e=t._fullLayout,r=(t.layout||{}).selections,a=e._previousSelections;e._previousSelections=r;var i=e._reselect||JSON.stringify(r)!==JSON.stringify(a);Dt.getComponentMethod("selections","reselect")(t,i)};Pe.generalUpdatePerTraceModule=function(t,e,r,a){var i=e.traceHash,n={},o;for(o=0;o<r.length;o++){var l=r[o],s=l[0].trace;s.visible&&(n[s.type]=n[s.type]||[],n[s.type].push(l))}for(var f in i)if(!n[f]){var c=i[f][0],v=c[0].trace;v.visible=!1,n[f]=[c]}for(var u in n){var h=n[u],d=h[0][0].trace._module;d.plot(t,e,je.filterVisible(h),a)}e.traceHash=n};Pe.plotBasePlot=function(t,e,r,a,i){var n=Dt.getModule(t),o=NL(e.calcdata,n)[0];n.plot(e,o,a,i)};Pe.cleanBasePlot=function(t,e,r,a,i){var n=i._has&&i._has(t),o=r._has&&r._has(t);n&&!o&&i["_"+t+"layer"].selectAll("g.trace").remove()};var cr=N_.exports,W_={exports:{}},br={},Sn={};(function(t){t.xmlns="http://www.w3.org/2000/xmlns/",t.svg="http://www.w3.org/2000/svg",t.xlink="http://www.w3.org/1999/xlink",t.svgAttrs={xmlns:t.svg,"xmlns:xlink":t.xlink}})(Sn);var Ur={FROM_BL:{left:0,center:.5,right:1,bottom:0,middle:.5,top:1},FROM_TL:{left:0,center:.5,right:1,bottom:1,middle:.5,top:0},FROM_BR:{left:1,center:.5,right:0,bottom:0,middle:.5,top:1},LINE_SPACING:1.3,CAP_SHIFT:.7,MID_SHIFT:.35,OPPOSITE_SIDE:{left:"right",right:"left",top:"bottom",bottom:"top"}};(function(t){var e=gt,r=me,a=r.strTranslate,i=Sn,n=Ur.LINE_SPACING,o=/([^$]*)([$]+[^$]*[$]+)([^$]*)/;t.convertToTspans=function(A,C,R){var N=A.text(),H=!A.attr("data-notex")&&C&&C._context.typesetMath&&typeof MathJax<"u"&&N.match(o),B=e.select(A.node().parentNode);if(B.empty())return;var X=A.attr("class")?A.attr("class").split(" ")[0]:"text";X+="-math",B.selectAll("svg."+X).remove(),B.selectAll("g."+X+"-group").remove(),A.style("display",null).attr({"data-unformatted":N,"data-math":"N"});function j(){B.empty()||(X=A.attr("class")+"-math",B.select("svg."+X).remove()),A.text("").style("white-space","pre");var q=O(A.node(),N);q&&A.style("pointer-events","all"),t.positionText(A),R&&R.call(A)}return H?(C&&C._promises||[]).push(new Promise(function(q){A.style("display","none");var U=parseInt(A.node().style.fontSize,10),Z={fontSize:U};v(H[2],Z,function(K,ee,le){B.selectAll("svg."+X).remove(),B.selectAll("g."+X+"-group").remove();var ye=K&&K.select("svg");if(!ye||!ye.node()){j(),q();return}var se=B.append("g").classed(X+"-group",!0).attr({"pointer-events":"none","data-unformatted":N,"data-math":"Y"});se.node().appendChild(ye.node()),ee&&ee.node()&&ye.node().insertBefore(ee.node().cloneNode(!0),ye.node().firstChild);var G=le.width,J=le.height;ye.attr({class:X,height:J,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var oe=A.node().style.fill||"black",fe=ye.select("g");fe.attr({fill:oe,stroke:oe});var pe=fe.node().getBoundingClientRect(),ge=pe.width,ue=pe.height;(ge>G||ue>J)&&(ye.style("overflow","hidden"),pe=ye.node().getBoundingClientRect(),ge=pe.width,ue=pe.height);var Ce=+A.attr("x"),ce=+A.attr("y"),De=U||A.node().getBoundingClientRect().height,Ee=-De/4;if(X[0]==="y")se.attr({transform:"rotate("+[-90,Ce,ce]+")"+a(-ge/2,Ee-ue/2)});else if(X[0]==="l")ce=Ee-ue/2;else if(X[0]==="a"&&X.indexOf("atitle")!==0)Ce=0,ce=Ee;else{var $e=A.attr("text-anchor");Ce=Ce-ge*($e==="middle"?.5:$e==="end"?1:0),ce=ce+Ee-ue/2}ye.attr({x:Ce,y:ce}),R&&R.call(A,se),q(se)})})):j(),A};var l=/(<|&lt;|&#60;)/g,s=/(>|&gt;|&#62;)/g;function f(A){return A.replace(l,"\\lt ").replace(s,"\\gt ")}var c=[["$","$"],["\\(","\\)"]];function v(A,C,R){var N=parseInt((MathJax.version||"").split(".")[0]);if(N!==2&&N!==3){r.warn("No MathJax version:",MathJax.version);return}var H,B,X,j,q=function(){return B=r.extendDeepAll({},MathJax.Hub.config),X=MathJax.Hub.processSectionDelay,MathJax.Hub.processSectionDelay!==void 0&&(MathJax.Hub.processSectionDelay=0),MathJax.Hub.Config({messageStyle:"none",tex2jax:{inlineMath:c},displayAlign:"left"})},U=function(){B=r.extendDeepAll({},MathJax.config),MathJax.config.tex||(MathJax.config.tex={}),MathJax.config.tex.inlineMath=c},Z=function(){if(H=MathJax.Hub.config.menuSettings.renderer,H!=="SVG")return MathJax.Hub.setRenderer("SVG")},K=function(){H=MathJax.config.startup.output,H!=="svg"&&(MathJax.config.startup.output="svg")},ee=function(){var oe="math-output-"+r.randstr({},64);j=e.select("body").append("div").attr({id:oe}).style({visibility:"hidden",position:"absolute","font-size":C.fontSize+"px"}).text(f(A));var fe=j.node();return N===2?MathJax.Hub.Typeset(fe):MathJax.typeset([fe])},le=function(){var oe=j.select(N===2?".MathJax_SVG":".MathJax"),fe=!oe.empty()&&j.select("svg").node();if(!fe)r.log("There was an error in the tex syntax.",A),R();else{var pe=fe.getBoundingClientRect(),ge;N===2?ge=e.select("body").select("#MathJax_SVG_glyphs"):ge=oe.select("defs"),R(oe,ge,pe)}j.remove()},ye=function(){if(H!=="SVG")return MathJax.Hub.setRenderer(H)},se=function(){H!=="svg"&&(MathJax.config.startup.output=H)},G=function(){return X!==void 0&&(MathJax.Hub.processSectionDelay=X),MathJax.Hub.Config(B)},J=function(){MathJax.config=B};N===2?MathJax.Hub.Queue(q,Z,ee,le,ye,G):N===3&&(U(),K(),MathJax.startup.defaultReady(),MathJax.startup.promise.then(function(){ee(),le(),se(),J()}))}var u={sup:"font-size:70%",sub:"font-size:70%",b:"font-weight:bold",i:"font-style:italic",a:"cursor:pointer",span:"",em:"font-style:italic;font-weight:bold"},h={sub:"0.3em",sup:"-0.6em"},d={sub:"-0.21em",sup:"0.42em"},p="​",m=["http:","https:","mailto:","",void 0,":"],y=t.NEWLINES=/(\r\n?|\n)/g,b=/(<[^<>]*>)/,w=/<(\/?)([^ >]*)(\s+(.*))?>/i,g=/<br(\s+.*)?>/i;t.BR_TAG_ALL=/<br(\s+.*)?>/gi;var x=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,_=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,T=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,k=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i;function S(A,C){if(!A)return null;var R=A.match(C),N=R&&(R[3]||R[4]);return N&&E(N)}var L=/(^|;)\s*color:/;t.plainText=function(A,C){C=C||{};for(var R=C.len!==void 0&&C.len!==-1?C.len:1/0,N=C.allowedTags!==void 0?C.allowedTags:["br"],H="...",B=H.length,X=A.split(b),j=[],q="",U=0,Z=0;Z<X.length;Z++){var K=X[Z],ee=K.match(w),le=ee&&ee[2].toLowerCase();if(le)N.indexOf(le)!==-1&&(j.push(K),q=le);else{var ye=K.length;if(U+ye<R)j.push(K),U+=ye;else if(U<R){var se=R-U;q&&(q!=="br"||se<=B||ye<=B)&&j.pop(),R>B?j.push(K.substr(0,se-B)+H):j.push(K.substr(0,se));break}q=""}}return j.join("")};var D={mu:"μ",amp:"&",lt:"<",gt:">",nbsp:" ",times:"×",plusmn:"±",deg:"°"},$=/&(#\d+|#x[\da-fA-F]+|[a-z]+);/g;function E(A){return A.replace($,function(C,R){var N;return R.charAt(0)==="#"?N=z(R.charAt(1)==="x"?parseInt(R.substr(2),16):parseInt(R.substr(1),10)):N=D[R],N||C})}t.convertEntities=E;function z(A){if(!(A>1114111)){var C=String.fromCodePoint;if(C)return C(A);var R=String.fromCharCode;return A<=65535?R(A):R((A>>10)+55232,A%1024+56320)}}function O(A,C){C=C.replace(y," ");var R=!1,N=[],H,B=-1;function X(){B++;var ue=document.createElementNS(i.svg,"tspan");e.select(ue).attr({class:"line",dy:B*n+"em"}),A.appendChild(ue),H=ue;var Ce=N;if(N=[{node:ue}],Ce.length>1)for(var ce=1;ce<Ce.length;ce++)j(Ce[ce])}function j(ue){var Ce=ue.type,ce={},De;if(Ce==="a"){De="a";var Ee=ue.target,$e=ue.href,te=ue.popup;$e&&(ce={"xlink:xlink:show":Ee==="_blank"||Ee.charAt(0)!=="_"?"new":"replace",target:Ee,"xlink:xlink:href":$e},te&&(ce.onclick='window.open(this.href.baseVal,this.target.baseVal,"'+te+'");return false;'))}else De="tspan";ue.style&&(ce.style=ue.style);var Te=document.createElementNS(i.svg,De);if(Ce==="sup"||Ce==="sub"){q(H,p),H.appendChild(Te);var ne=document.createElementNS(i.svg,"tspan");q(ne,p),e.select(ne).attr("dy",d[Ce]),ce.dy=h[Ce],H.appendChild(Te),H.appendChild(ne)}else H.appendChild(Te);e.select(Te).attr(ce),H=ue.node=Te,N.push(ue)}function q(ue,Ce){ue.appendChild(document.createTextNode(Ce))}function U(ue){if(N.length===1){r.log("Ignoring unexpected end tag </"+ue+">.",C);return}var Ce=N.pop();ue!==Ce.type&&r.log("Start tag <"+Ce.type+"> doesnt match end tag <"+ue+">. Pretending it did match.",C),H=N[N.length-1].node}var Z=g.test(C);Z?X():(H=A,N=[{node:A}]);for(var K=C.split(b),ee=0;ee<K.length;ee++){var le=K[ee],ye=le.match(w),se=ye&&ye[2].toLowerCase(),G=u[se];if(se==="br")X();else if(G===void 0)q(H,E(le));else if(ye[1])U(se);else{var J=ye[4],oe={type:se},fe=S(J,x);if(fe?(fe=fe.replace(L,"$1 fill:"),G&&(fe+=";"+G)):G&&(fe=G),fe&&(oe.style=fe),se==="a"){R=!0;var pe=S(J,_);if(pe){var ge=I(pe);ge&&(oe.href=ge,oe.target=S(J,T)||"_blank",oe.popup=S(J,k))}}j(oe)}}return R}function I(A){var C=encodeURI(decodeURI(A)),R=document.createElement("a"),N=document.createElement("a");R.href=A,N.href=C;var H=R.protocol,B=N.protocol;return m.indexOf(H)!==-1&&m.indexOf(B)!==-1?C:""}t.sanitizeHTML=function(C){C=C.replace(y," ");for(var R=document.createElement("p"),N=R,H=[],B=C.split(b),X=0;X<B.length;X++){var j=B[X],q=j.match(w),U=q&&q[2].toLowerCase();if(U in u)if(q[1])H.length&&(N=H.pop());else{var Z=q[4],K=S(Z,x),ee=K?{style:K}:{};if(U==="a"){var le=S(Z,_);if(le){var ye=I(le);if(ye){ee.href=ye;var se=S(Z,T);se&&(ee.target=se)}}}var G=document.createElement(U);N.appendChild(G),e.select(G).attr(ee),N=G,H.push(G)}else N.appendChild(document.createTextNode(E(j)))}var J="innerHTML";return R[J]},t.lineCount=function(C){return C.selectAll("tspan.line").size()||1},t.positionText=function(C,R,N){return C.each(function(){var H=e.select(this);function B(q,U){return U===void 0?(U=H.attr(q),U===null&&(H.attr(q,0),U=0)):H.attr(q,U),U}var X=B("x",R),j=B("y",N);this.nodeName==="text"&&H.selectAll("tspan.line").attr({x:X,y:j})})};function P(A,C,R){var N=R.horizontalAlign,H=R.verticalAlign||"top",B=A.node().getBoundingClientRect(),X=C.node().getBoundingClientRect(),j,q,U;return H==="bottom"?q=function(){return B.bottom-j.height}:H==="middle"?q=function(){return B.top+(B.height-j.height)/2}:q=function(){return B.top},N==="right"?U=function(){return B.right-j.width}:N==="center"?U=function(){return B.left+(B.width-j.width)/2}:U=function(){return B.left},function(){j=this.node().getBoundingClientRect();var Z=U()-X.left,K=q()-X.top,ee=R.gd||{};if(R.gd){ee._fullLayout._calcInverseTransform(ee);var le=r.apply3DTransform(ee._fullLayout._invTransform)(Z,K);Z=le[0],K=le[1]}return this.style({top:K+"px",left:Z+"px","z-index":1e3}),this}}var M="1px ";t.makeTextShadow=function(A){var C=M,R=M,N=M;return C+R+N+A+", -"+C+"-"+R+N+A+", "+C+"-"+R+N+A+", -"+C+R+N+A},t.makeEditable=function(A,C){var R=C.gd,N=C.delegate,H=e.dispatch("edit","input","cancel"),B=N||A;if(A.style({"pointer-events":N?"none":"all"}),A.size()!==1)throw new Error("boo");function X(){q(),A.style({opacity:0});var U=B.attr("class"),Z;U?Z="."+U.split(" ")[0]+"-math-group":Z="[class*=-math-group]",Z&&e.select(A.node().parentNode).select(Z).style({opacity:0})}function j(U){var Z=U.node(),K=document.createRange();K.selectNodeContents(Z);var ee=window.getSelection();ee.removeAllRanges(),ee.addRange(K),Z.focus()}function q(){var U=e.select(R),Z=U.select(".svg-container"),K=Z.append("div"),ee=A.node().style,le=parseFloat(ee.fontSize||12),ye=C.text;ye===void 0&&(ye=A.attr("data-unformatted")),K.classed("plugin-editable editable",!0).style({position:"absolute","font-family":ee.fontFamily||"Arial","font-size":le,color:C.fill||ee.fill||"black",opacity:1,"background-color":C.background||"transparent",outline:"#ffffff33 1px solid",margin:[-le/8+1,0,0,-1].join("px ")+"px",padding:"0","box-sizing":"border-box"}).attr({contenteditable:!0}).text(ye).call(P(A,Z,C)).on("blur",function(){R._editing=!1,A.text(this.textContent).style({opacity:1});var se=e.select(this).attr("class"),G;se?G="."+se.split(" ")[0]+"-math-group":G="[class*=-math-group]",G&&e.select(A.node().parentNode).select(G).style({opacity:0});var J=this.textContent;e.select(this).transition().duration(0).remove(),e.select(document).on("mouseup",null),H.edit.call(A,J)}).on("focus",function(){var se=this;R._editing=!0,e.select(document).on("mouseup",function(){if(e.event.target===se)return!1;document.activeElement===K.node()&&K.node().blur()})}).on("keyup",function(){e.event.which===27?(R._editing=!1,A.style({opacity:1}),e.select(this).style({opacity:0}).on("blur",function(){return!1}).transition().remove(),H.cancel.call(A,this.textContent)):(H.input.call(A,this.textContent),e.select(this).call(P(A,Z,C)))}).on("keydown",function(){e.event.which===13&&this.blur()}).call(j)}return C.immediate?X():B.on("click",X),e.rebind(A,H,"on")}})(br);var q_={exports:{}},QL=gt,wf=ga,Ml=wt,Ls=me,Hm=ht,JL=Eo.isValid;function eC(t,e,r){var a=e?Ls.nestedProperty(t,e).get()||{}:t,i=a[r||"color"],n=!1;if(Ls.isArrayOrTypedArray(i)){for(var o=0;o<i.length;o++)if(Ml(i[o])){n=!0;break}}return Ls.isPlainObject(a)&&(n||a.showscale===!0||Ml(a.cmin)&&Ml(a.cmax)||JL(a.colorscale)||Ls.isPlainObject(a.colorbar))}var Om=["showscale","autocolorscale","colorscale","reversescale","colorbar"],Zo=["min","max","mid","auto"];function Z_(t){var e=t._colorAx,r=e||t,a={},i,n,o;for(n=0;n<Om.length;n++)o=Om[n],a[o]=r[o];if(e)for(i="c",n=0;n<Zo.length;n++)o=Zo[n],a[o]=r["c"+o];else{var l;for(n=0;n<Zo.length;n++){if(o=Zo[n],l="c"+o,l in r){a[o]=r[l];continue}l="z"+o,l in r&&(a[o]=r[l])}i=l.charAt(0)}return a._sync=function(s,f){var c=Zo.indexOf(s)!==-1?i+s:s;r[c]=r["_"+c]=f},a}function K_(t){for(var e=Z_(t),r=e.min,a=e.max,i=e.reversescale?Q_(e.colorscale):e.colorscale,n=i.length,o=new Array(n),l=new Array(n),s=0;s<n;s++){var f=i[s];o[s]=r+f[0]*(a-r),l[s]=f[1]}return{domain:o,range:l}}function Q_(t){for(var e=t.length,r=new Array(e),a=e-1,i=0;a>=0;a--,i++){var n=t[a];r[i]=[1-n[0],n[1]]}return r}function J_(t,e){e=e||{};for(var r=t.domain,a=t.range,i=a.length,n=new Array(i),o=0;o<i;o++){var l=wf(a[o]).toRgb();n[o]=[l.r,l.g,l.b,l.a]}var s=QL.scale.linear().domain(r).range(n).clamp(!0),f=e.noNumericCheck,c=e.returnArray,v;return f&&c?v=s:f?v=function(u){return jm(s(u))}:c?v=function(u){return Ml(u)?s(u):wf(u).isValid()?u:Hm.defaultLine}:v=function(u){return Ml(u)?jm(s(u)):wf(u).isValid()?u:Hm.defaultLine},v.domain=s.domain,v.range=function(){return a},v}function tC(t,e){return J_(K_(t),e)}function jm(t){var e={r:t[0],g:t[1],b:t[2],a:t[3]};return wf(e).toRgbString()}var Na={hasColorscale:eC,extractOpts:Z_,extractScale:K_,flipScale:Q_,makeColorScaleFunc:J_,makeColorScaleFuncFromTrace:tC},ew=g_,rC=ew.FORMAT_LINK,aC=ew.DATE_FORMAT_LINK;function iC(t,e){return{valType:"string",dflt:"",editType:"none",description:(e?Wh:tw)("hover text",t)+["By default the values are formatted using "+(e?"generic number format":"`"+t+"axis.hoverformat`")+"."].join(" ")}}function Wh(t,e){return["Sets the "+t+" formatting rule"+(e?"for `"+e+"` ":""),"using d3 formatting mini-languages","which are very similar to those in Python. For numbers, see: "+rC+"."].join(" ")}function tw(t,e){return Wh(t,e)+[" And for dates see: "+aC+".","We add two items to d3's date formatter:","*%h* for half of the year as a decimal number as well as","*%{n}f* for fractional seconds","with n digits. For example, *2016-10-13 09:15:23.456* with tickformat","*%H~%M~%S.%2f* would display *09~15~23.46*"].join(" ")}var jo={axisHoverFormat:iC,descriptionOnlyNumbers:Wh,descriptionWithDates:tw},wu=Mr,so=zr,rw=ra.dash,qh=Qt.extendFlat,Bm=Ht.templatedArray,Gm=jo.descriptionWithDates,nC=or.ONEDAY,Ua=Gr,Tu=Ua.HOUR_PATTERN,ku=Ua.WEEKDAY_PATTERN,Tf={valType:"enumerated",values:["auto","linear","array"],editType:"ticks",impliedEdits:{tick0:void 0,dtick:void 0},description:["Sets the tick mode for this axis.","If *auto*, the number of ticks is set via `nticks`.","If *linear*, the placement of the ticks is determined by","a starting position `tick0` and a tick step `dtick`","(*linear* is the default value if `tick0` and `dtick` are provided).","If *array*, the placement of the ticks is set via `tickvals`","and the tick text is `ticktext`.","(*array* is the default value if `tickvals` is provided)."].join(" ")},oC=qh({},Tf,{values:Tf.values.slice().concat(["sync"]),description:[Tf.description,"If *sync*, the number of ticks will sync with the overlayed axis","set by `overlaying` property."].join(" ")});function Um(t){return{valType:"integer",min:0,dflt:t?5:0,editType:"ticks",description:["Specifies the maximum number of ticks for the particular axis.","The actual number of ticks will be chosen automatically to be","less than or equal to `nticks`.","Has an effect only if `tickmode` is set to *auto*."].join(" ")}}var Vm={valType:"any",editType:"ticks",impliedEdits:{tickmode:"linear"},description:["Sets the placement of the first tick on this axis.","Use with `dtick`.","If the axis `type` is *log*, then you must take the log of your starting tick","(e.g. to set the starting tick to 100, set the `tick0` to 2)","except when `dtick`=*L<f>* (see `dtick` for more info).","If the axis `type` is *date*, it should be a date string, like date data.","If the axis `type` is *category*, it should be a number, using the scale where","each category is assigned a serial number from zero in the order it appears."].join(" ")},Xm={valType:"any",editType:"ticks",impliedEdits:{tickmode:"linear"},description:["Sets the step in-between ticks on this axis. Use with `tick0`.","Must be a positive number, or special strings available to *log* and *date* axes.","If the axis `type` is *log*, then ticks are set every 10^(n*dtick) where n","is the tick number. For example,","to set a tick mark at 1, 10, 100, 1000, ... set dtick to 1.","To set tick marks at 1, 100, 10000, ... set dtick to 2.","To set tick marks at 1, 5, 25, 125, 625, 3125, ... set dtick to log_10(5), or 0.69897000433.","*log* has several special values; *L<f>*, where `f` is a positive number,","gives ticks linearly spaced in value (but not position).","For example `tick0` = 0.1, `dtick` = *L0.5* will put ticks at 0.1, 0.6, 1.1, 1.6 etc.","To show powers of 10 plus small digits between, use *D1* (all digits) or *D2* (only 2 and 5).","`tick0` is ignored for *D1* and *D2*.","If the axis `type` is *date*, then you must convert the time to milliseconds.","For example, to set the interval between ticks to one day,","set `dtick` to 86400000.0.","*date* also has special values *M<n>* gives ticks spaced by a number of months.","`n` must be a positive integer.","To set ticks on the 15th of every third month, set `tick0` to *2000-01-15* and `dtick` to *M3*.","To set ticks every 4 years, set `dtick` to *M48*"].join(" ")},Ym={valType:"data_array",editType:"ticks",description:["Sets the values at which ticks on this axis appear.","Only has an effect if `tickmode` is set to *array*.","Used with `ticktext`."].join(" ")},Wm={valType:"enumerated",values:["outside","inside",""],editType:"ticks",description:["Determines whether ticks are drawn or not.","If **, this axis' ticks are not drawn.","If *outside* (*inside*), this axis' are drawn outside (inside)","the axis lines."].join(" ")};function qm(t){var e={valType:"number",min:0,editType:"ticks",description:"Sets the tick length (in px)."};return t||(e.dflt=5),e}function Zm(t){var e={valType:"number",min:0,editType:"ticks",description:"Sets the tick width (in px)."};return t||(e.dflt=1),e}var Km={valType:"color",dflt:so.defaultLine,editType:"ticks",description:"Sets the tick color."},Qm={valType:"color",dflt:so.lightLine,editType:"ticks",description:"Sets the color of the grid lines."};function Jm(t){var e={valType:"number",min:0,editType:"ticks",description:"Sets the width (in px) of the grid lines."};return t||(e.dflt=1),e}var ey=qh({},rw,{editType:"ticks"}),ty={valType:"boolean",editType:"ticks",description:["Determines whether or not grid lines are drawn.","If *true*, the grid lines are drawn at every tick mark."].join(" ")},Za={visible:{valType:"boolean",editType:"plot",description:["A single toggle to hide the axis while preserving interaction like dragging.","Default is true when a cheater plot is present on the axis, otherwise","false"].join(" ")},color:{valType:"color",dflt:so.defaultLine,editType:"ticks",description:["Sets default for all colors associated with this axis","all at once: line, font, tick, and grid colors.","Grid color is lightened by blending this with the plot background","Individual pieces can override this."].join(" ")},title:{text:{valType:"string",editType:"ticks",description:["Sets the title of this axis.","Note that before the existence of `title.text`, the title's","contents used to be defined as the `title` attribute itself.","This behavior has been deprecated."].join(" ")},font:wu({editType:"ticks",description:["Sets this axis' title font.","Note that the title's font used to be customized","by the now deprecated `titlefont` attribute."].join(" ")}),standoff:{valType:"number",min:0,editType:"ticks",description:["Sets the standoff distance (in px) between the axis labels and the title text","The default value is a function of the axis tick labels, the title `font.size`","and the axis `linewidth`.","Note that the axis title position is always constrained within the margins,","so the actual standoff distance is always less than the set or default value.","By setting `standoff` and turning on `automargin`, plotly.js will push the","margins to fit the axis title at given standoff distance."].join(" ")},editType:"ticks"},type:{valType:"enumerated",values:["-","linear","log","date","category","multicategory"],dflt:"-",editType:"calc",_noTemplating:!0,description:["Sets the axis type.","By default, plotly attempts to determined the axis type","by looking into the data of the traces that referenced","the axis in question."].join(" ")},autotypenumbers:{valType:"enumerated",values:["convert types","strict"],dflt:"convert types",editType:"calc",description:["Using *strict* a numeric string in trace data is not converted to a number.","Using *convert types* a numeric string in trace data may be","treated as a number during automatic axis `type` detection.","Defaults to layout.autotypenumbers."].join(" ")},autorange:{valType:"enumerated",values:[!0,!1,"reversed","min reversed","max reversed","min","max"],dflt:!0,editType:"axrange",impliedEdits:{"range[0]":void 0,"range[1]":void 0},description:["Determines whether or not the range of this axis is","computed in relation to the input data.","See `rangemode` for more info.","If `range` is provided and it has a value for both the","lower and upper bound, `autorange` is set to *false*.","Using *min* applies autorange only to set the minimum.","Using *max* applies autorange only to set the maximum.","Using *min reversed* applies autorange only to set the minimum on a reversed axis.","Using *max reversed* applies autorange only to set the maximum on a reversed axis.","Using *reversed* applies autorange on both ends and reverses the axis direction."].join(" ")},autorangeoptions:{minallowed:{valType:"any",editType:"plot",impliedEdits:{"range[0]":void 0,"range[1]":void 0},description:["Use this value exactly as autorange minimum."].join(" ")},maxallowed:{valType:"any",editType:"plot",impliedEdits:{"range[0]":void 0,"range[1]":void 0},description:["Use this value exactly as autorange maximum."].join(" ")},clipmin:{valType:"any",editType:"plot",impliedEdits:{"range[0]":void 0,"range[1]":void 0},description:["Clip autorange minimum if it goes beyond this value.","Has no effect when `autorangeoptions.minallowed` is provided."].join(" ")},clipmax:{valType:"any",editType:"plot",impliedEdits:{"range[0]":void 0,"range[1]":void 0},description:["Clip autorange maximum if it goes beyond this value.","Has no effect when `autorangeoptions.maxallowed` is provided."].join(" ")},include:{valType:"any",arrayOk:!0,editType:"plot",impliedEdits:{"range[0]":void 0,"range[1]":void 0},description:["Ensure this value is included in autorange."].join(" ")},editType:"plot"},rangemode:{valType:"enumerated",values:["normal","tozero","nonnegative"],dflt:"normal",editType:"plot",description:["If *normal*, the range is computed in relation to the extrema","of the input data.","If *tozero*`, the range extends to 0,","regardless of the input data","If *nonnegative*, the range is non-negative,","regardless of the input data.","Applies only to linear axes."].join(" ")},range:{valType:"info_array",items:[{valType:"any",editType:"axrange",impliedEdits:{"^autorange":!1},anim:!0},{valType:"any",editType:"axrange",impliedEdits:{"^autorange":!1},anim:!0}],editType:"axrange",impliedEdits:{autorange:!1},anim:!0,description:["Sets the range of this axis.","If the axis `type` is *log*, then you must take the log of your","desired range (e.g. to set the range from 1 to 100,","set the range from 0 to 2).","If the axis `type` is *date*, it should be date strings,","like date data, though Date objects and unix milliseconds","will be accepted and converted to strings.","If the axis `type` is *category*, it should be numbers,","using the scale where each category is assigned a serial","number from zero in the order it appears.","Leaving either or both elements `null` impacts the default `autorange`."].join(" ")},minallowed:{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1},description:["Determines the minimum range of this axis."].join(" ")},maxallowed:{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1},description:["Determines the maximum range of this axis."].join(" ")},fixedrange:{valType:"boolean",dflt:!1,editType:"calc",description:["Determines whether or not this axis is zoom-able.","If true, then zoom is disabled."].join(" ")},insiderange:{valType:"info_array",items:[{valType:"any",editType:"plot"},{valType:"any",editType:"plot"}],editType:"plot",description:["Could be used to set the desired inside range of this axis","(excluding the labels) when `ticklabelposition` of","the anchored axis has *inside*.","Not implemented for axes with `type` *log*.","This would be ignored when `range` is provided."].join(" ")},scaleanchor:{valType:"enumerated",values:[Ua.idRegex.x.toString(),Ua.idRegex.y.toString(),!1],editType:"plot",description:["If set to another axis id (e.g. `x2`, `y`), the range of this axis","changes together with the range of the corresponding axis","such that the scale of pixels per unit is in a constant ratio.","Both axes are still zoomable, but when you zoom one, the other will","zoom the same amount, keeping a fixed midpoint.","`constrain` and `constraintoward` determine how we enforce the constraint.","You can chain these, ie `yaxis: {scaleanchor: *x*}, xaxis2: {scaleanchor: *y*}`","but you can only link axes of the same `type`.","The linked axis can have the opposite letter (to constrain the aspect ratio)","or the same letter (to match scales across subplots).","Loops (`yaxis: {scaleanchor: *x*}, xaxis: {scaleanchor: *y*}` or longer) are redundant","and the last constraint encountered will be ignored to avoid possible","inconsistent constraints via `scaleratio`.","Note that setting axes simultaneously in both a `scaleanchor` and a `matches` constraint","is currently forbidden.","Setting `false` allows to remove a default constraint (occasionally,","you may need to prevent a default `scaleanchor` constraint from",'being applied, eg. when having an image trace `yaxis: {scaleanchor: "x"}`',"is set automatically in order for pixels to be rendered as squares,","setting `yaxis: {scaleanchor: false}` allows to remove the constraint)."].join(" ")},scaleratio:{valType:"number",min:0,dflt:1,editType:"plot",description:["If this axis is linked to another by `scaleanchor`, this determines the pixel","to unit scale ratio. For example, if this value is 10, then every unit on","this axis spans 10 times the number of pixels as a unit on the linked axis.","Use this for example to create an elevation profile where the vertical scale","is exaggerated a fixed amount with respect to the horizontal."].join(" ")},constrain:{valType:"enumerated",values:["range","domain"],editType:"plot",description:["If this axis needs to be compressed (either due to its own `scaleanchor` and","`scaleratio` or those of the other axis), determines how that happens:","by increasing the *range*, or by decreasing the *domain*.","Default is *domain* for axes containing image traces, *range* otherwise."].join(" ")},constraintoward:{valType:"enumerated",values:["left","center","right","top","middle","bottom"],editType:"plot",description:["If this axis needs to be compressed (either due to its own `scaleanchor` and","`scaleratio` or those of the other axis), determines which direction we push","the originally specified plot area. Options are *left*, *center* (default),","and *right* for x axes, and *top*, *middle* (default), and *bottom* for y axes."].join(" ")},matches:{valType:"enumerated",values:[Ua.idRegex.x.toString(),Ua.idRegex.y.toString()],editType:"calc",description:["If set to another axis id (e.g. `x2`, `y`), the range of this axis","will match the range of the corresponding axis in data-coordinates space.","Moreover, matching axes share auto-range values, category lists and","histogram auto-bins.","Note that setting axes simultaneously in both a `scaleanchor` and a `matches` constraint","is currently forbidden.","Moreover, note that matching axes must have the same `type`."].join(" ")},rangebreaks:Bm("rangebreak",{enabled:{valType:"boolean",dflt:!0,editType:"calc",description:["Determines whether this axis rangebreak is enabled or disabled.","Please note that `rangebreaks` only work for *date* axis type."].join(" ")},bounds:{valType:"info_array",items:[{valType:"any",editType:"calc"},{valType:"any",editType:"calc"}],editType:"calc",description:["Sets the lower and upper bounds of this axis rangebreak.","Can be used with `pattern`."].join(" ")},pattern:{valType:"enumerated",values:[ku,Tu,""],editType:"calc",description:["Determines a pattern on the time line that generates breaks.","If *"+ku+"* - days of the week in English e.g. 'Sunday' or `sun`","(matching is case-insensitive and considers only the first three characters),","as well as Sunday-based integers between 0 and 6.","If *"+Tu+"* - hour (24-hour clock) as decimal numbers between 0 and 24.","for more info.","Examples:","- { pattern: '"+ku+"', bounds: [6, 1] }"," or simply { bounds: ['sat', 'mon'] }"," breaks from Saturday to Monday (i.e. skips the weekends).","- { pattern: '"+Tu+"', bounds: [17, 8] }"," breaks from 5pm to 8am (i.e. skips non-work hours)."].join(" ")},values:{valType:"info_array",freeLength:!0,editType:"calc",items:{valType:"any",editType:"calc"},description:["Sets the coordinate values corresponding to the rangebreaks.","An alternative to `bounds`.","Use `dvalue` to set the size of the values along the axis."].join(" ")},dvalue:{valType:"number",editType:"calc",min:0,dflt:nC,description:["Sets the size of each `values` item.","The default is one day in milliseconds."].join(" ")},editType:"calc"}),tickmode:oC,nticks:Um(),tick0:Vm,dtick:Xm,ticklabelstep:{valType:"integer",min:1,dflt:1,editType:"ticks",description:["Sets the spacing between tick labels as compared to the spacing between ticks.","A value of 1 (default) means each tick gets a label.","A value of 2 means shows every 2nd label.","A larger value n means only every nth tick is labeled.","`tick0` determines which labels are shown.","Not implemented for axes with `type` *log* or *multicategory*, or when `tickmode` is *array*."].join(" ")},tickvals:Ym,ticktext:{valType:"data_array",editType:"ticks",description:["Sets the text displayed at the ticks position via `tickvals`.","Only has an effect if `tickmode` is set to *array*.","Used with `tickvals`."].join(" ")},ticks:Wm,tickson:{valType:"enumerated",values:["labels","boundaries"],dflt:"labels",editType:"ticks",description:["Determines where ticks and grid lines are drawn with respect to their","corresponding tick labels.","Only has an effect for axes of `type` *category* or *multicategory*.","When set to *boundaries*, ticks and grid lines are drawn half a category","to the left/bottom of labels."].join(" ")},ticklabelmode:{valType:"enumerated",values:["instant","period"],dflt:"instant",editType:"ticks",description:["Determines where tick labels are drawn with respect to their","corresponding ticks and grid lines.","Only has an effect for axes of `type` *date*","When set to *period*, tick labels are drawn in the middle of the period","between ticks."].join(" ")},ticklabelposition:{valType:"enumerated",values:["outside","inside","outside top","inside top","outside left","inside left","outside right","inside right","outside bottom","inside bottom"],dflt:"outside",editType:"calc",description:["Determines where tick labels are drawn with respect to the axis","Please note that","top or bottom has no effect on x axes or when `ticklabelmode` is set to *period*.","Similarly","left or right has no effect on y axes or when `ticklabelmode` is set to *period*.","Has no effect on *multicategory* axes or when `tickson` is set to *boundaries*.","When used on axes linked by `matches` or `scaleanchor`,","no extra padding for inside labels would be added by autorange,","so that the scales could match."].join(" ")},ticklabeloverflow:{valType:"enumerated",values:["allow","hide past div","hide past domain"],editType:"calc",description:["Determines how we handle tick labels that would overflow either the graph div or the domain of the axis.","The default value for inside tick labels is *hide past domain*.","Otherwise on *category* and *multicategory* axes the default is *allow*.","In other cases the default is *hide past div*."].join(" ")},mirror:{valType:"enumerated",values:[!0,"ticks",!1,"all","allticks"],dflt:!1,editType:"ticks+layoutstyle",description:["Determines if the axis lines or/and ticks are mirrored to","the opposite side of the plotting area.","If *true*, the axis lines are mirrored.","If *ticks*, the axis lines and ticks are mirrored.","If *false*, mirroring is disable.","If *all*, axis lines are mirrored on all shared-axes subplots.","If *allticks*, axis lines and ticks are mirrored","on all shared-axes subplots."].join(" ")},ticklen:qm(),tickwidth:Zm(),tickcolor:Km,showticklabels:{valType:"boolean",dflt:!0,editType:"ticks",description:"Determines whether or not the tick labels are drawn."},labelalias:{valType:"any",dflt:!1,editType:"ticks",description:["Replacement text for specific tick or hover labels.","For example using {US: 'USA', CA: 'Canada'} changes US to USA","and CA to Canada. The labels we would have shown must match","the keys exactly, after adding any tickprefix or ticksuffix.","For negative numbers the minus sign symbol used (U+2212) is wider than the regular ascii dash.","That means you need to use −1 instead of -1.","labelalias can be used with any axis type, and both keys (if needed)","and values (if desired) can include html-like tags or MathJax."].join(" ")},automargin:{valType:"flaglist",flags:["height","width","left","right","top","bottom"],extras:[!0,!1],dflt:!1,editType:"ticks",description:["Determines whether long tick labels automatically grow the figure","margins."].join(" ")},showspikes:{valType:"boolean",dflt:!1,editType:"modebar",description:["Determines whether or not spikes (aka droplines) are drawn for this axis.","Note: This only takes affect when hovermode = closest"].join(" ")},spikecolor:{valType:"color",dflt:null,editType:"none",description:"Sets the spike color. If undefined, will use the series color"},spikethickness:{valType:"number",dflt:3,editType:"none",description:"Sets the width (in px) of the zero line."},spikedash:qh({},rw,{dflt:"dash",editType:"none"}),spikemode:{valType:"flaglist",flags:["toaxis","across","marker"],dflt:"toaxis",editType:"none",description:["Determines the drawing mode for the spike line","If *toaxis*, the line is drawn from the data point to the axis the ","series is plotted on.","If *across*, the line is drawn across the entire plot area, and","supercedes *toaxis*.","If *marker*, then a marker dot is drawn on the axis the series is","plotted on"].join(" ")},spikesnap:{valType:"enumerated",values:["data","cursor","hovered data"],dflt:"hovered data",editType:"none",description:"Determines whether spikelines are stuck to the cursor or to the closest datapoints."},tickfont:wu({editType:"ticks",description:"Sets the tick font."}),tickangle:{valType:"angle",dflt:"auto",editType:"ticks",description:["Sets the angle of the tick labels with respect to the horizontal.","For example, a `tickangle` of -90 draws the tick labels","vertically."].join(" ")},tickprefix:{valType:"string",dflt:"",editType:"ticks",description:"Sets a tick label prefix."},showtickprefix:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",editType:"ticks",description:["If *all*, all tick labels are displayed with a prefix.","If *first*, only the first tick is displayed with a prefix.","If *last*, only the last tick is displayed with a suffix.","If *none*, tick prefixes are hidden."].join(" ")},ticksuffix:{valType:"string",dflt:"",editType:"ticks",description:"Sets a tick label suffix."},showticksuffix:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",editType:"ticks",description:"Same as `showtickprefix` but for tick suffixes."},showexponent:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",editType:"ticks",description:["If *all*, all exponents are shown besides their significands.","If *first*, only the exponent of the first tick is shown.","If *last*, only the exponent of the last tick is shown.","If *none*, no exponents appear."].join(" ")},exponentformat:{valType:"enumerated",values:["none","e","E","power","SI","B"],dflt:"B",editType:"ticks",description:["Determines a formatting rule for the tick exponents.","For example, consider the number 1,000,000,000.","If *none*, it appears as 1,000,000,000.","If *e*, 1e+9.","If *E*, 1E+9.","If *power*, 1x10^9 (with 9 in a super script).","If *SI*, 1G.","If *B*, 1B."].join(" ")},minexponent:{valType:"number",dflt:3,min:0,editType:"ticks",description:["Hide SI prefix for 10^n if |n| is below this number.","This only has an effect when `tickformat` is *SI* or *B*."].join(" ")},separatethousands:{valType:"boolean",dflt:!1,editType:"ticks",description:['If "true", even 4-digit integers are separated'].join(" ")},tickformat:{valType:"string",dflt:"",editType:"ticks",description:Gm("tick label")},tickformatstops:Bm("tickformatstop",{enabled:{valType:"boolean",dflt:!0,editType:"ticks",description:["Determines whether or not this stop is used.","If `false`, this stop is ignored even within its `dtickrange`."].join(" ")},dtickrange:{valType:"info_array",items:[{valType:"any",editType:"ticks"},{valType:"any",editType:"ticks"}],editType:"ticks",description:["range [*min*, *max*], where *min*, *max* - dtick values","which describe some zoom level, it is possible to omit *min*","or *max* value by passing *null*"].join(" ")},value:{valType:"string",dflt:"",editType:"ticks",description:["string - dtickformat for described zoom level, the same as *tickformat*"].join(" ")},editType:"ticks"}),hoverformat:{valType:"string",dflt:"",editType:"none",description:Gm("hover text")},showline:{valType:"boolean",dflt:!1,editType:"ticks+layoutstyle",description:["Determines whether or not a line bounding this axis is drawn."].join(" ")},linecolor:{valType:"color",dflt:so.defaultLine,editType:"layoutstyle",description:"Sets the axis line color."},linewidth:{valType:"number",min:0,dflt:1,editType:"ticks+layoutstyle",description:"Sets the width (in px) of the axis line."},showgrid:ty,gridcolor:Qm,gridwidth:Jm(),griddash:ey,zeroline:{valType:"boolean",editType:"ticks",description:["Determines whether or not a line is drawn at along the 0 value","of this axis.","If *true*, the zero line is drawn on top of the grid lines."].join(" ")},zerolinecolor:{valType:"color",dflt:so.defaultLine,editType:"ticks",description:"Sets the line color of the zero line."},zerolinewidth:{valType:"number",dflt:1,editType:"ticks",description:"Sets the width (in px) of the zero line."},showdividers:{valType:"boolean",dflt:!0,editType:"ticks",description:["Determines whether or not a dividers are drawn","between the category levels of this axis.","Only has an effect on *multicategory* axes."].join(" ")},dividercolor:{valType:"color",dflt:so.defaultLine,editType:"ticks",description:["Sets the color of the dividers","Only has an effect on *multicategory* axes."].join(" ")},dividerwidth:{valType:"number",dflt:1,editType:"ticks",description:["Sets the width (in px) of the dividers","Only has an effect on *multicategory* axes."].join(" ")},anchor:{valType:"enumerated",values:["free",Ua.idRegex.x.toString(),Ua.idRegex.y.toString()],editType:"plot",description:["If set to an opposite-letter axis id (e.g. `x2`, `y`), this axis is bound to","the corresponding opposite-letter axis.","If set to *free*, this axis' position is determined by `position`."].join(" ")},side:{valType:"enumerated",values:["top","bottom","left","right"],editType:"plot",description:["Determines whether a x (y) axis is positioned","at the *bottom* (*left*) or *top* (*right*)","of the plotting area."].join(" ")},overlaying:{valType:"enumerated",values:["free",Ua.idRegex.x.toString(),Ua.idRegex.y.toString()],editType:"plot",description:["If set a same-letter axis id, this axis is overlaid on top of","the corresponding same-letter axis, with traces and axes visible for both","axes.","If *false*, this axis does not overlay any same-letter axes.","In this case, for axes with overlapping domains only the highest-numbered","axis will be visible."].join(" ")},minor:{tickmode:Tf,nticks:Um("minor"),tick0:Vm,dtick:Xm,tickvals:Ym,ticks:Wm,ticklen:qm("minor"),tickwidth:Zm("minor"),tickcolor:Km,gridcolor:Qm,gridwidth:Jm("minor"),griddash:ey,showgrid:ty,editType:"ticks"},layer:{valType:"enumerated",values:["above traces","below traces"],dflt:"above traces",editType:"plot",description:["Sets the layer on which this axis is displayed.","If *above traces*, this axis is displayed above all the subplot's traces","If *below traces*, this axis is displayed below all the subplot's traces,","but above the grid lines.","Useful when used together with scatter-like traces with `cliponaxis`","set to *false* to show markers and/or text nodes above this axis."].join(" ")},domain:{valType:"info_array",items:[{valType:"number",min:0,max:1,editType:"plot"},{valType:"number",min:0,max:1,editType:"plot"}],dflt:[0,1],editType:"plot",description:["Sets the domain of this axis (in plot fraction)."].join(" ")},position:{valType:"number",min:0,max:1,dflt:0,editType:"plot",description:["Sets the position of this axis in the plotting space","(in normalized coordinates).","Only has an effect if `anchor` is set to *free*."].join(" ")},autoshift:{valType:"boolean",dflt:!1,editType:"plot",description:["Automatically reposition the axis to avoid","overlap with other axes with the same `overlaying` value.","This repositioning will account for any `shift` amount applied to other","axes on the same side with `autoshift` is set to true.","Only has an effect if `anchor` is set to *free*."].join(" ")},shift:{valType:"number",editType:"plot",description:["Moves the axis a given number of pixels from where it would have been otherwise.","Accepts both positive and negative values, which will shift the axis either right","or left, respectively.","If `autoshift` is set to true, then this defaults to a padding of -3 if `side` is set to *left*.","and defaults to +3 if `side` is set to *right*. Defaults to 0 if `autoshift` is set to false.","Only has an effect if `anchor` is set to *free*."].join(" ")},categoryorder:{valType:"enumerated",values:["trace","category ascending","category descending","array","total ascending","total descending","min ascending","min descending","max ascending","max descending","sum ascending","sum descending","mean ascending","mean descending","median ascending","median descending"],dflt:"trace",editType:"calc",description:["Specifies the ordering logic for the case of categorical variables.","By default, plotly uses *trace*, which specifies the order that is present in the data supplied.","Set `categoryorder` to *category ascending* or *category descending* if order should be determined by","the alphanumerical order of the category names.","Set `categoryorder` to *array* to derive the ordering from the attribute `categoryarray`. If a category","is not found in the `categoryarray` array, the sorting behavior for that attribute will be identical to","the *trace* mode. The unspecified categories will follow the categories in `categoryarray`.","Set `categoryorder` to *total ascending* or *total descending* if order should be determined by the","numerical order of the values.","Similarly, the order can be determined by the min, max, sum, mean or median of all the values."].join(" ")},categoryarray:{valType:"data_array",editType:"calc",description:["Sets the order in which categories on this axis appear.","Only has an effect if `categoryorder` is set to *array*.","Used with `categoryorder`."].join(" ")},uirevision:{valType:"any",editType:"none",description:["Controls persistence of user-driven changes in axis `range`,","`autorange`, and `title` if in `editable: true` configuration.","Defaults to `layout.uirevision`."].join(" ")},editType:"calc",_deprecated:{autotick:{valType:"boolean",editType:"ticks",description:["Obsolete.","Set `tickmode` to *auto* for old `autotick` *true* behavior.","Set `tickmode` to *linear* for `autotick` *false*."].join(" ")},title:{valType:"string",editType:"ticks",description:["Value of `title` is no longer a simple *string* but a set of sub-attributes.","To set the axis' title, please use `title.text` now."].join(" ")},titlefont:wu({editType:"ticks",description:["Former `titlefont` is now the sub-attribute `font` of `title`.","To customize title font properties, please use `title.font` now."].join(" ")})}},Yt=Za,Au=Mr,ry=Qt.extendFlat,lC=Ya.overrideAll,Zh=lC({orientation:{valType:"enumerated",values:["h","v"],dflt:"v",description:"Sets the orientation of the colorbar."},thicknessmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"pixels",description:["Determines whether this color bar's thickness","(i.e. the measure in the constant color direction)","is set in units of plot *fraction* or in *pixels*.","Use `thickness` to set the value."].join(" ")},thickness:{valType:"number",min:0,dflt:30,description:["Sets the thickness of the color bar","This measure excludes the size of the padding, ticks and labels."].join(" ")},lenmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"fraction",description:["Determines whether this color bar's length","(i.e. the measure in the color variation direction)","is set in units of plot *fraction* or in *pixels.","Use `len` to set the value."].join(" ")},len:{valType:"number",min:0,dflt:1,description:["Sets the length of the color bar","This measure excludes the padding of both ends.","That is, the color bar length is this length minus the","padding on both ends."].join(" ")},x:{valType:"number",description:["Sets the x position with respect to `xref` of the color bar (in plot fraction).","When `xref` is *paper*, defaults to 1.02 when `orientation` is *v* and","0.5 when `orientation` is *h*.","When `xref` is *container*, defaults to *1* when `orientation` is *v* and","0.5 when `orientation` is *h*.","Must be between *0* and *1* if `xref` is *container*","and between *-2* and *3* if `xref` is *paper*."].join(" ")},xref:{valType:"enumerated",dflt:"paper",values:["container","paper"],editType:"layoutstyle",description:["Sets the container `x` refers to.","*container* spans the entire `width` of the plot.","*paper* refers to the width of the plotting area only."].join(" ")},xanchor:{valType:"enumerated",values:["left","center","right"],description:["Sets this color bar's horizontal position anchor.","This anchor binds the `x` position to the *left*, *center*","or *right* of the color bar.","Defaults to *left* when `orientation` is *v* and","*center* when `orientation` is *h*."].join(" ")},xpad:{valType:"number",min:0,dflt:10,description:"Sets the amount of padding (in px) along the x direction."},y:{valType:"number",description:["Sets the y position with respect to `yref` of the color bar (in plot fraction).","When `yref` is *paper*, defaults to 0.5 when `orientation` is *v* and","1.02 when `orientation` is *h*.","When `yref` is *container*, defaults to 0.5 when `orientation` is *v* and","1 when `orientation` is *h*.","Must be between *0* and *1* if `yref` is *container*","and between *-2* and *3* if `yref` is *paper*."].join(" ")},yref:{valType:"enumerated",dflt:"paper",values:["container","paper"],editType:"layoutstyle",description:["Sets the container `y` refers to.","*container* spans the entire `height` of the plot.","*paper* refers to the height of the plotting area only."].join(" ")},yanchor:{valType:"enumerated",values:["top","middle","bottom"],description:["Sets this color bar's vertical position anchor","This anchor binds the `y` position to the *top*, *middle*","or *bottom* of the color bar.","Defaults to *middle* when `orientation` is *v* and","*bottom* when `orientation` is *h*."].join(" ")},ypad:{valType:"number",min:0,dflt:10,description:"Sets the amount of padding (in px) along the y direction."},outlinecolor:Yt.linecolor,outlinewidth:Yt.linewidth,bordercolor:Yt.linecolor,borderwidth:{valType:"number",min:0,dflt:0,description:["Sets the width (in px) or the border enclosing this color bar."].join(" ")},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",description:"Sets the color of padded area."},tickmode:Yt.minor.tickmode,nticks:Yt.nticks,tick0:Yt.tick0,dtick:Yt.dtick,tickvals:Yt.tickvals,ticktext:Yt.ticktext,ticks:ry({},Yt.ticks,{dflt:""}),ticklabeloverflow:ry({},Yt.ticklabeloverflow,{description:["Determines how we handle tick labels that would overflow either the graph div or the domain of the axis.","The default value for inside tick labels is *hide past domain*.","In other cases the default is *hide past div*."].join(" ")}),ticklabelposition:{valType:"enumerated",values:["outside","inside","outside top","inside top","outside left","inside left","outside right","inside right","outside bottom","inside bottom"],dflt:"outside",description:["Determines where tick labels are drawn relative to the ticks.","Left and right options are used when `orientation` is *h*,","top and bottom when `orientation` is *v*."].join(" ")},ticklen:Yt.ticklen,tickwidth:Yt.tickwidth,tickcolor:Yt.tickcolor,ticklabelstep:Yt.ticklabelstep,showticklabels:Yt.showticklabels,labelalias:Yt.labelalias,tickfont:Au({description:"Sets the color bar's tick label font"}),tickangle:Yt.tickangle,tickformat:Yt.tickformat,tickformatstops:Yt.tickformatstops,tickprefix:Yt.tickprefix,showtickprefix:Yt.showtickprefix,ticksuffix:Yt.ticksuffix,showticksuffix:Yt.showticksuffix,separatethousands:Yt.separatethousands,exponentformat:Yt.exponentformat,minexponent:Yt.minexponent,showexponent:Yt.showexponent,title:{text:{valType:"string",description:["Sets the title of the color bar.","Note that before the existence of `title.text`, the title's","contents used to be defined as the `title` attribute itself.","This behavior has been deprecated."].join(" ")},font:Au({description:["Sets this color bar's title font.","Note that the title's font used to be set","by the now deprecated `titlefont` attribute."].join(" ")}),side:{valType:"enumerated",values:["right","top","bottom"],description:["Determines the location of color bar's title","with respect to the color bar.","Defaults to *top* when `orientation` if *v* and ","defaults to *right* when `orientation` if *h*.","Note that the title's location used to be set","by the now deprecated `titleside` attribute."].join(" ")}},_deprecated:{title:{valType:"string",description:["Deprecated in favor of color bar's `title.text`.","Note that value of color bar's `title` is no longer a simple","*string* but a set of sub-attributes."].join(" ")},titlefont:Au({description:"Deprecated in favor of color bar's `title.font`."}),titleside:{valType:"enumerated",values:["right","top","bottom"],dflt:"top",description:"Deprecated in favor of color bar's `title.side`."}}},"colorbars","from-root"),sC=Zh,fC=zo.counter,cC=Hh,aw=Eo.scales,uC=cC(aw);function Ko(t){return"`"+t+"`"}var Ln=function(e,r){e=e||"",r=r||{};var a=r.cLetter||"c",i="onlyIfNumerical"in r?r.onlyIfNumerical:!!e,n="noScale"in r?r.noScale:e==="marker.line",o="showScaleDflt"in r?r.showScaleDflt:a==="z",l=typeof r.colorscaleDflt=="string"?aw[r.colorscaleDflt]:null,s=r.editTypeOverride||"",f=e?e+".":"",c,v;"colorAttr"in r?(c=r.colorAttr,v=r.colorAttr):(c={z:"z",c:"color"}[a],v="in "+Ko(f+c));var u=i?" Has an effect only if "+v+" is set to a numerical array.":"",h=a+"auto",d=a+"min",p=a+"max",m=a+"mid",y=Ko(f+h),b=Ko(f+d),w=Ko(f+p),g=b+" and "+w,x={};x[d]=x[p]=void 0;var _={};_[h]=!1;var T={};return c==="color"&&(T.color={valType:"color",arrayOk:!0,editType:s||"style",description:["Sets the",e,"color.","It accepts either a specific color","or an array of numbers that are mapped to the colorscale","relative to the max and min values of the array or relative to",g,"if set."].join(" ")},r.anim&&(T.color.anim=!0)),T[h]={valType:"boolean",dflt:!0,editType:"calc",impliedEdits:x,description:["Determines whether or not the color domain is computed","with respect to the input data (here "+v+") or the bounds set in",g+u,"Defaults to `false` when",g,"are set by the user."].join(" ")},T[d]={valType:"number",dflt:null,editType:s||"plot",impliedEdits:_,description:["Sets the lower bound of the color domain."+u,"Value should have the same units as",v,"and if set,",w,"must be set as well."].join(" ")},T[p]={valType:"number",dflt:null,editType:s||"plot",impliedEdits:_,description:["Sets the upper bound of the color domain."+u,"Value should have the same units as",v,"and if set,",b,"must be set as well."].join(" ")},T[m]={valType:"number",dflt:null,editType:"calc",impliedEdits:x,description:["Sets the mid-point of the color domain by scaling",b,"and/or",w,"to be equidistant to this point."+u,"Value should have the same units as",v+".","Has no effect when",y,"is `false`."].join(" ")},T.colorscale={valType:"colorscale",editType:"calc",dflt:l,impliedEdits:{autocolorscale:!1},description:["Sets the colorscale."+u,"The colorscale must be an array containing","arrays mapping a normalized value to an","rgb, rgba, hex, hsl, hsv, or named color string.","At minimum, a mapping for the lowest (0) and highest (1)","values are required. For example,","`[[0, 'rgb(0,0,255)'], [1, 'rgb(255,0,0)']]`.","To control the bounds of the colorscale in color space,","use",g+".","Alternatively, `colorscale` may be a palette name string","of the following list: "+uC+"."].join(" ")},T.autocolorscale={valType:"boolean",dflt:r.autoColorDflt!==!1,editType:"calc",impliedEdits:{colorscale:void 0},description:["Determines whether the colorscale is a default palette (`autocolorscale: true`)","or the palette determined by",Ko(f+"colorscale")+"."+u,"In case `colorscale` is unspecified or `autocolorscale` is true, the default","palette will be chosen according to whether numbers in the `color` array are","all positive, all negative or mixed."].join(" ")},T.reversescale={valType:"boolean",dflt:!1,editType:"plot",description:["Reverses the color mapping if true."+u,"If true,",b,"will correspond to the last color","in the array and",w,"will correspond to the first color."].join(" ")},n||(T.showscale={valType:"boolean",dflt:o,editType:"calc",description:["Determines whether or not a colorbar is displayed for this trace."+u].join(" ")},T.colorbar=sC),r.noColorAxis||(T.coloraxis={valType:"subplotid",regex:fC("coloraxis"),dflt:null,editType:"calc",description:["Sets a reference to a shared color axis.","References to these shared color axes are *coloraxis*, *coloraxis2*, *coloraxis3*, etc.","Settings for these shared color axes are set in the layout, under","`layout.coloraxis`, `layout.coloraxis2`, etc.","Note that multiple color scales can be linked to the same color axis."].join(" ")}),T},vC=Qt.extendFlat,dC=Ln,Mu=Eo.scales,Su="Note that `autocolorscale` must be true for this attribute to work.",iw={editType:"calc",colorscale:{editType:"calc",sequential:{valType:"colorscale",dflt:Mu.Reds,editType:"calc",description:["Sets the default sequential colorscale for positive values.",Su].join(" ")},sequentialminus:{valType:"colorscale",dflt:Mu.Blues,editType:"calc",description:["Sets the default sequential colorscale for negative values.",Su].join(" ")},diverging:{valType:"colorscale",dflt:Mu.RdBu,editType:"calc",description:["Sets the default diverging colorscale.",Su].join(" ")}},coloraxis:vC({_isSubplotObj:!0,editType:"calc",description:[""].join(" ")},dC("",{colorAttr:"corresponding trace color array(s)",noColorAxis:!0,showScaleDflt:!0}))},hC=me,nw=function(e){return hC.isPlainObject(e.colorbar)},Fc={},Ad=wt,ay=me,ow=or,pC=ow.ONEDAY,mC=ow.ONEWEEK;Fc.dtick=function(t,e){var r=e==="log",a=e==="date",i=e==="category",n=a?pC:1;if(!t)return n;if(Ad(t))return t=Number(t),t<=0?n:i?Math.max(1,Math.round(t)):a?Math.max(.1,t):t;if(typeof t!="string"||!(a||r))return n;var o=t.charAt(0),l=t.substr(1);return l=Ad(l)?Number(l):0,l<=0||!(a&&o==="M"&&l===Math.round(l)||r&&o==="L"||r&&o==="D"&&(l===1||l===2))?n:t};Fc.tick0=function(t,e,r,a){if(e==="date")return ay.cleanDate(t,ay.dateTick0(r,a%mC===0?1:0));if(!(a==="D1"||a==="D2"))return Ad(t)?Number(t):0};var iy=Fc,yC=me.isArrayOrTypedArray,lw=function(e,r,a,i,n){n||(n={});var o=n.isMinor,l=o?e.minor||{}:e,s=o?r.minor:r,f=o?"minor.":"";function c(b){var w=l[b];return w!==void 0?w:(s._template||{})[b]}var v=c("tick0"),u=c("dtick"),h=c("tickvals"),d=yC(h)?"array":u?"linear":"auto",p=a(f+"tickmode",d);if(p==="auto"||p==="sync")a(f+"nticks");else if(p==="linear"){var m=s.dtick=iy.dtick(u,i);s.tick0=iy.tick0(v,i,r.calendar,m)}else if(i!=="multicategory"){var y=a(f+"tickvals");y===void 0?s.tickmode="auto":o||a("ticktext")}},Lu=me,ny=Za,sw=function(e,r,a,i){var n=i.isMinor,o=n?e.minor||{}:e,l=n?r.minor:r,s=n?ny.minor:ny,f=n?"minor.":"",c=Lu.coerce2(o,l,s,"ticklen",n?(r.ticklen||5)*.6:void 0),v=Lu.coerce2(o,l,s,"tickwidth",n?r.tickwidth||1:void 0),u=Lu.coerce2(o,l,s,"tickcolor",(n?r.tickcolor:void 0)||l.color),h=a(f+"ticks",!n&&i.outerTicks||c||v||u?"outside":"");h||(delete l.ticklen,delete l.tickwidth,delete l.tickcolor)},fw=function(e){var r=["showexponent","showtickprefix","showticksuffix"],a=r.filter(function(n){return e[n]!==void 0}),i=function(n){return e[n]===e[a[0]]};if(a.every(i)||a.length===1)return e[a[0]]},Cs=me,gC=Ht,Ka=function(e,r,a){var i=a.name,n=a.inclusionAttr||"visible",o=r[i],l=Cs.isArrayOrTypedArray(e[i])?e[i]:[],s=r[i]=[],f=gC.arrayTemplater(r,i,n),c,v;for(c=0;c<l.length;c++){var u=l[c];Cs.isPlainObject(u)?v=f.newItem(u):(v=f.newItem({}),v[n]=!1),v._index=c,v[n]!==!1&&a.handleItemDefaults(u,v,r,a),s.push(v)}var h=f.defaultItems();for(c=0;c<h.length;c++)v=h[c],v._index=s.length,a.handleItemDefaults({},v,r,a,{}),s.push(v);if(Cs.isArrayOrTypedArray(o)){var d=Math.min(o.length,s.length);for(c=0;c<d;c++)Cs.relinkPrivateKeys(s[c],o[c])}return s},Md=me,bC=ht.contrast,cw=Za,xC=fw,_C=Ka,uw=function(e,r,a,i,n){n||(n={});var o=a("labelalias");Md.isPlainObject(o)||delete r.labelalias;var l=xC(e),s=a("showticklabels");if(s){var f=n.font||{},c=r.color,v=r.ticklabelposition||"",u=v.indexOf("inside")!==-1?bC(n.bgColor):c&&c!==cw.color.dflt?c:f.color;if(Md.coerceFont(a,"tickfont",{family:f.family,size:f.size,color:u}),!n.noTicklabelstep&&i!=="multicategory"&&i!=="log"&&a("ticklabelstep"),n.noAng||a("tickangle"),i!=="category"){var h=a("tickformat");_C(e,r,{name:"tickformatstops",inclusionAttr:"enabled",handleItemDefaults:wC}),r.tickformatstops.length||delete r.tickformatstops,!n.noExp&&!h&&i!=="date"&&(a("showexponent",l),a("exponentformat"),a("minexponent"),a("separatethousands"))}}};function wC(t,e){function r(i,n){return Md.coerce(t,e,cw.tickformatstops,i,n)}var a=r("enabled");a&&(r("dtickrange"),r("value"))}var TC=fw,vw=function(e,r,a,i,n){n||(n={});var o=n.tickSuffixDflt,l=TC(e),s=a("tickprefix");s&&a("showtickprefix",l);var f=a("ticksuffix",o);f&&a("showticksuffix",l)},pi=me,kC=Ht,AC=lw,MC=sw,SC=uw,LC=vw,CC=Zh,dw=function(e,r,a){var i=kC.newContainer(r,"colorbar"),n=e.colorbar||{};function o(D,$){return pi.coerce(n,i,CC,D,$)}var l=a.margin||{t:0,b:0,l:0,r:0},s=a.width-l.l-l.r,f=a.height-l.t-l.b,c=o("orientation"),v=c==="v",u=o("thicknessmode");o("thickness",u==="fraction"?30/(v?s:f):30);var h=o("lenmode");o("len",h==="fraction"?1:v?f:s);var d=o("yref"),p=o("xref"),m=d==="paper",y=p==="paper",b,w,g,x="left";v?(g="middle",x=y?"left":"right",b=y?1.02:1,w=.5):(g=m?"bottom":"top",x="center",b=.5,w=m?1.02:1),pi.coerce(n,i,{x:{valType:"number",min:y?-2:0,max:y?3:1,dflt:b}},"x"),pi.coerce(n,i,{y:{valType:"number",min:m?-2:0,max:m?3:1,dflt:w}},"y"),o("xanchor",x),o("xpad"),o("yanchor",g),o("ypad"),pi.noneOrAll(n,i,["x","y"]),o("outlinecolor"),o("outlinewidth"),o("bordercolor"),o("borderwidth"),o("bgcolor");var _=pi.coerce(n,i,{ticklabelposition:{valType:"enumerated",dflt:"outside",values:v?["outside","inside","outside top","inside top","outside bottom","inside bottom"]:["outside","inside","outside left","inside left","outside right","inside right"]}},"ticklabelposition");o("ticklabeloverflow",_.indexOf("inside")!==-1?"hide past domain":"hide past div"),AC(n,i,o,"linear");var T=a.font,k={outerTicks:!1,font:T};_.indexOf("inside")!==-1&&(k.bgColor="black"),LC(n,i,o,"linear",k),SC(n,i,o,"linear",k),MC(n,i,o,"linear"),o("title.text",a._dfltTitle.colorbar);var S=i.showticklabels?i.tickfont:T,L=pi.extendFlat({},S,{color:T.color,size:pi.bigFont(S.size)});pi.coerceFont(o,"title.font",L),o("title.side",v?"top":"right")},oy=wt,Sd=me,DC=nw,$C=dw,ly=Eo.isValid,PC=ot.traceIs;function Cu(t,e){var r=e.slice(0,e.length-1);return e?Sd.nestedProperty(t,r).get()||{}:t}var fs=function t(e,r,a,i,n){var o=n.prefix,l=n.cLetter,s="_module"in r,f=Cu(e,o),c=Cu(r,o),v=Cu(r._template||{},o)||{},u=function(){return delete e.coloraxis,delete r.coloraxis,t(e,r,a,i,n)};if(s){var h=a._colorAxes||{},d=i(o+"coloraxis");if(d){var p=PC(r,"contour")&&Sd.nestedProperty(r,"contours.coloring").get()||"heatmap",m=h[d];m?(m[2].push(u),m[0]!==p&&(m[0]=!1,Sd.warn(["Ignoring coloraxis:",d,"setting","as it is linked to incompatible colorscales."].join(" ")))):h[d]=[p,r,[u]];return}}var y=f[l+"min"],b=f[l+"max"],w=oy(y)&&oy(b)&&y<b,g=i(o+l+"auto",!w);g?i(o+l+"mid"):(i(o+l+"min"),i(o+l+"max"));var x=f.colorscale,_=v.colorscale,T;if(x!==void 0&&(T=!ly(x)),_!==void 0&&(T=!ly(_)),i(o+"autocolorscale",T),i(o+"colorscale"),i(o+"reversescale"),o!=="marker.line."){var k;o&&s&&(k=DC(f));var S=i(o+"showscale",k);S&&(o&&v&&(c._template=v),$C(f,c,a))}},sy=me,RC=Ht,fy=iw,EC=fs,zC=function(e,r){function a(v,u){return sy.coerce(e,r,fy,v,u)}a("colorscale.sequential"),a("colorscale.sequentialminus"),a("colorscale.diverging");var i=r._colorAxes,n,o;function l(v,u){return sy.coerce(n,o,fy.coloraxis,v,u)}for(var s in i){var f=i[s];if(f[0])n=e[s]||{},o=RC.newContainer(r,s,"coloraxis"),o._name=s,EC(n,o,r,l,{prefix:"",cLetter:"c"});else{for(var c=0;c<f[2].length;c++)f[2][c]();delete r._colorAxes[s]}}},IC=me,FC=Na.hasColorscale,NC=Na.extractOpts,HC=function(e,r){function a(c,v){var u=c["_"+v];u!==void 0&&(c[v]=u)}function i(c,v){var u=v.container?IC.nestedProperty(c,v.container).get():c;if(u)if(u.coloraxis)u._colorAx=r[u.coloraxis];else{var h=NC(u),d=h.auto;(d||h.min===void 0)&&a(u,v.min),(d||h.max===void 0)&&a(u,v.max),h.autocolorscale&&a(u,"colorscale")}}for(var n=0;n<e.length;n++){var o=e[n],l=o._module.colorbar;if(l)if(Array.isArray(l))for(var s=0;s<l.length;s++)i(o,l[s]);else i(o,l);FC(o,"marker.line")&&i(o,{container:"marker.line",min:"cmin",max:"cmax"})}for(var f in r._colorAxes)i(r[f],{min:"cmin",max:"cmax"})},cy=wt,Du=me,OC=Na.extractOpts,Kh=function(e,r,a){var i=e._fullLayout,n=a.vals,o=a.containerStr,l=o?Du.nestedProperty(r,o).get():r,s=OC(l),f=s.auto!==!1,c=s.min,v=s.max,u=s.mid,h=function(){return Du.aggNums(Math.min,null,n)},d=function(){return Du.aggNums(Math.max,null,n)};if(c===void 0?c=h():f&&(l._colorAx&&cy(c)?c=Math.min(c,h()):c=h()),v===void 0?v=d():f&&(l._colorAx&&cy(v)?v=Math.max(v,d()):v=d()),f&&u!==void 0&&(v-u>u-c?c=u-(v-u):v-u<u-c&&(v=u+(u-c))),c===v&&(c-=.5,v+=.5),s._sync("min",c),s._sync("max",v),s.autocolorscale){var p;c*v<0?p=i.colorscale.diverging:c>=0?p=i.colorscale.sequential:p=i.colorscale.sequentialminus,s._sync("colorscale",p)}},Ds=Eo,Rn=Na,wo={moduleType:"component",name:"colorscale",attributes:Ln,layoutAttributes:iw,supplyLayoutDefaults:zC,handleDefaults:fs,crossTraceDefaults:HC,calc:Kh,scales:Ds.scales,defaultScale:Ds.defaultScale,getScale:Ds.get,isValidScale:Ds.isValid,hasColorscale:Rn.hasColorscale,extractOpts:Rn.extractOpts,extractScale:Rn.extractScale,flipScale:Rn.flipScale,makeColorScaleFunc:Rn.makeColorScaleFunc,makeColorScaleFuncFromTrace:Rn.makeColorScaleFuncFromTrace},uy=me,Ir={hasLines:function(t){return t.visible&&t.mode&&t.mode.indexOf("lines")!==-1},hasMarkers:function(t){return t.visible&&(t.mode&&t.mode.indexOf("markers")!==-1||t.type==="splom")},hasText:function(t){return t.visible&&t.mode&&t.mode.indexOf("text")!==-1},isBubble:function(t){return uy.isPlainObject(t.marker)&&uy.isArrayOrTypedArray(t.marker.size)}},jC=wt,hw=function(e,r){r||(r=2);var a=e.marker,i=a.sizeref||1,n=a.sizemin||0,o=a.sizemode==="area"?function(l){return Math.sqrt(l/i)}:function(l){return l/i};return function(l){var s=o(l/r);return jC(s)&&s>0?Math.max(s,n):0}},xa={};(function(t){var e=me;t.getSubplot=function(l){return l.subplot||l.xaxis+l.yaxis||l.geo},t.isTraceInSubplots=function(l,s){if(l.type==="splom"){for(var f=l.xaxes||[],c=l.yaxes||[],v=0;v<f.length;v++)for(var u=0;u<c.length;u++)if(s.indexOf(f[v]+c[u])!==-1)return!0;return!1}return s.indexOf(t.getSubplot(l))!==-1},t.flat=function(l,s){for(var f=new Array(l.length),c=0;c<l.length;c++)f[c]=s;return f},t.p2c=function(l,s){for(var f=new Array(l.length),c=0;c<l.length;c++)f[c]=l[c].p2c(s);return f},t.getDistanceFunction=function(l,s,f,c){return l==="closest"?c||t.quadrature(s,f):l.charAt(0)==="x"?s:f},t.getClosest=function(l,s,f){if(f.index!==!1)f.index>=0&&f.index<l.length?f.distance=0:f.index=!1;else for(var c=0;c<l.length;c++){var v=s(l[c]);v<=f.distance&&(f.index=c,f.distance=v)}return f},t.inbox=function(l,s,f){return l*s<0||l===0?f:1/0},t.quadrature=function(l,s){return function(f){var c=l(f),v=s(f);return Math.sqrt(c*c+v*v)}},t.makeEventData=function(l,s,f){var c="index"in l?l.index:l.pointNumber,v={data:s._input,fullData:s,curveNumber:s.index,pointNumber:c};if(s._indexToPoints){var u=s._indexToPoints[c];u.length===1?v.pointIndex=u[0]:v.pointIndices=u}else v.pointIndex=c;return s._module.eventData?v=s._module.eventData(v,l,s,f,c):("xVal"in l?v.x=l.xVal:"x"in l&&(v.x=l.x),"yVal"in l?v.y=l.yVal:"y"in l&&(v.y=l.y),l.xa&&(v.xaxis=l.xa),l.ya&&(v.yaxis=l.ya),l.zLabelVal!==void 0&&(v.z=l.zLabelVal)),t.appendArrayPointValue(v,s,c),v},t.appendArrayPointValue=function(l,s,f){var c=s._arrayAttrs;if(c)for(var v=0;v<c.length;v++){var u=c[v],h=a(u);if(l[h]===void 0){var d=e.nestedProperty(s,u).get(),p=i(d,f);p!==void 0&&(l[h]=p)}}},t.appendArrayMultiPointValues=function(l,s,f){var c=s._arrayAttrs;if(c)for(var v=0;v<c.length;v++){var u=c[v],h=a(u);if(l[h]===void 0){for(var d=e.nestedProperty(s,u).get(),p=new Array(f.length),m=0;m<f.length;m++)p[m]=i(d,f[m]);l[h]=p}}};var r={ids:"id",locations:"location",labels:"label",values:"value","marker.colors":"color",parents:"parent"};function a(l){return r[l]||l}function i(l,s){if(Array.isArray(s)){if(Array.isArray(l)&&Array.isArray(l[s[0]]))return l[s[0]][s[1]]}else return l[s]}var n={x:!0,y:!0},o={"x unified":!0,"y unified":!0};t.isUnifiedHover=function(l){return typeof l!="string"?!1:!!o[l]},t.isXYhover=function(l){return typeof l!="string"?!1:!!n[l]}})(xa);var $u,vy;function BC(){if(vy)return $u;vy=1;var t=I1,e=gt.round,r="M0,0Z",a=Math.sqrt(2),i=Math.sqrt(3),n=Math.PI,o=Math.cos,l=Math.sin;$u={circle:{n:0,f:function(d,p,m){if(s(p))return r;var y=e(d,2),b="M"+y+",0A"+y+","+y+" 0 1,1 0,-"+y+"A"+y+","+y+" 0 0,1 "+y+",0Z";return m?h(p,m,b):b}},square:{n:1,f:function(d,p,m){if(s(p))return r;var y=e(d,2);return h(p,m,"M"+y+","+y+"H-"+y+"V-"+y+"H"+y+"Z")}},diamond:{n:2,f:function(d,p,m){if(s(p))return r;var y=e(d*1.3,2);return h(p,m,"M"+y+",0L0,"+y+"L-"+y+",0L0,-"+y+"Z")}},cross:{n:3,f:function(d,p,m){if(s(p))return r;var y=e(d*.4,2),b=e(d*1.2,2);return h(p,m,"M"+b+","+y+"H"+y+"V"+b+"H-"+y+"V"+y+"H-"+b+"V-"+y+"H-"+y+"V-"+b+"H"+y+"V-"+y+"H"+b+"Z")}},x:{n:4,f:function(d,p,m){if(s(p))return r;var y=e(d*.8/a,2),b="l"+y+","+y,w="l"+y+",-"+y,g="l-"+y+",-"+y,x="l-"+y+","+y;return h(p,m,"M0,"+y+b+w+g+w+g+x+g+x+b+x+b+"Z")}},"triangle-up":{n:5,f:function(d,p,m){if(s(p))return r;var y=e(d*2/i,2),b=e(d/2,2),w=e(d,2);return h(p,m,"M-"+y+","+b+"H"+y+"L0,-"+w+"Z")}},"triangle-down":{n:6,f:function(d,p,m){if(s(p))return r;var y=e(d*2/i,2),b=e(d/2,2),w=e(d,2);return h(p,m,"M-"+y+",-"+b+"H"+y+"L0,"+w+"Z")}},"triangle-left":{n:7,f:function(d,p,m){if(s(p))return r;var y=e(d*2/i,2),b=e(d/2,2),w=e(d,2);return h(p,m,"M"+b+",-"+y+"V"+y+"L-"+w+",0Z")}},"triangle-right":{n:8,f:function(d,p,m){if(s(p))return r;var y=e(d*2/i,2),b=e(d/2,2),w=e(d,2);return h(p,m,"M-"+b+",-"+y+"V"+y+"L"+w+",0Z")}},"triangle-ne":{n:9,f:function(d,p,m){if(s(p))return r;var y=e(d*.6,2),b=e(d*1.2,2);return h(p,m,"M-"+b+",-"+y+"H"+y+"V"+b+"Z")}},"triangle-se":{n:10,f:function(d,p,m){if(s(p))return r;var y=e(d*.6,2),b=e(d*1.2,2);return h(p,m,"M"+y+",-"+b+"V"+y+"H-"+b+"Z")}},"triangle-sw":{n:11,f:function(d,p,m){if(s(p))return r;var y=e(d*.6,2),b=e(d*1.2,2);return h(p,m,"M"+b+","+y+"H-"+y+"V-"+b+"Z")}},"triangle-nw":{n:12,f:function(d,p,m){if(s(p))return r;var y=e(d*.6,2),b=e(d*1.2,2);return h(p,m,"M-"+y+","+b+"V-"+y+"H"+b+"Z")}},pentagon:{n:13,f:function(d,p,m){if(s(p))return r;var y=e(d*.951,2),b=e(d*.588,2),w=e(-d,2),g=e(d*-.309,2),x=e(d*.809,2);return h(p,m,"M"+y+","+g+"L"+b+","+x+"H-"+b+"L-"+y+","+g+"L0,"+w+"Z")}},hexagon:{n:14,f:function(d,p,m){if(s(p))return r;var y=e(d,2),b=e(d/2,2),w=e(d*i/2,2);return h(p,m,"M"+w+",-"+b+"V"+b+"L0,"+y+"L-"+w+","+b+"V-"+b+"L0,-"+y+"Z")}},hexagon2:{n:15,f:function(d,p,m){if(s(p))return r;var y=e(d,2),b=e(d/2,2),w=e(d*i/2,2);return h(p,m,"M-"+b+","+w+"H"+b+"L"+y+",0L"+b+",-"+w+"H-"+b+"L-"+y+",0Z")}},octagon:{n:16,f:function(d,p,m){if(s(p))return r;var y=e(d*.924,2),b=e(d*.383,2);return h(p,m,"M-"+b+",-"+y+"H"+b+"L"+y+",-"+b+"V"+b+"L"+b+","+y+"H-"+b+"L-"+y+","+b+"V-"+b+"Z")}},star:{n:17,f:function(d,p,m){if(s(p))return r;var y=d*1.4,b=e(y*.225,2),w=e(y*.951,2),g=e(y*.363,2),x=e(y*.588,2),_=e(-y,2),T=e(y*-.309,2),k=e(y*.118,2),S=e(y*.809,2),L=e(y*.382,2);return h(p,m,"M"+b+","+T+"H"+w+"L"+g+","+k+"L"+x+","+S+"L0,"+L+"L-"+x+","+S+"L-"+g+","+k+"L-"+w+","+T+"H-"+b+"L0,"+_+"Z")}},hexagram:{n:18,f:function(d,p,m){if(s(p))return r;var y=e(d*.66,2),b=e(d*.38,2),w=e(d*.76,2);return h(p,m,"M-"+w+",0l-"+b+",-"+y+"h"+w+"l"+b+",-"+y+"l"+b+","+y+"h"+w+"l-"+b+","+y+"l"+b+","+y+"h-"+w+"l-"+b+","+y+"l-"+b+",-"+y+"h-"+w+"Z")}},"star-triangle-up":{n:19,f:function(d,p,m){if(s(p))return r;var y=e(d*i*.8,2),b=e(d*.8,2),w=e(d*1.6,2),g=e(d*4,2),x="A "+g+","+g+" 0 0 1 ";return h(p,m,"M-"+y+","+b+x+y+","+b+x+"0,-"+w+x+"-"+y+","+b+"Z")}},"star-triangle-down":{n:20,f:function(d,p,m){if(s(p))return r;var y=e(d*i*.8,2),b=e(d*.8,2),w=e(d*1.6,2),g=e(d*4,2),x="A "+g+","+g+" 0 0 1 ";return h(p,m,"M"+y+",-"+b+x+"-"+y+",-"+b+x+"0,"+w+x+y+",-"+b+"Z")}},"star-square":{n:21,f:function(d,p,m){if(s(p))return r;var y=e(d*1.1,2),b=e(d*2,2),w="A "+b+","+b+" 0 0 1 ";return h(p,m,"M-"+y+",-"+y+w+"-"+y+","+y+w+y+","+y+w+y+",-"+y+w+"-"+y+",-"+y+"Z")}},"star-diamond":{n:22,f:function(d,p,m){if(s(p))return r;var y=e(d*1.4,2),b=e(d*1.9,2),w="A "+b+","+b+" 0 0 1 ";return h(p,m,"M-"+y+",0"+w+"0,"+y+w+y+",0"+w+"0,-"+y+w+"-"+y+",0Z")}},"diamond-tall":{n:23,f:function(d,p,m){if(s(p))return r;var y=e(d*.7,2),b=e(d*1.4,2);return h(p,m,"M0,"+b+"L"+y+",0L0,-"+b+"L-"+y+",0Z")}},"diamond-wide":{n:24,f:function(d,p,m){if(s(p))return r;var y=e(d*1.4,2),b=e(d*.7,2);return h(p,m,"M0,"+b+"L"+y+",0L0,-"+b+"L-"+y+",0Z")}},hourglass:{n:25,f:function(d,p,m){if(s(p))return r;var y=e(d,2);return h(p,m,"M"+y+","+y+"H-"+y+"L"+y+",-"+y+"H-"+y+"Z")},noDot:!0},bowtie:{n:26,f:function(d,p,m){if(s(p))return r;var y=e(d,2);return h(p,m,"M"+y+","+y+"V-"+y+"L-"+y+","+y+"V-"+y+"Z")},noDot:!0},"circle-cross":{n:27,f:function(d,p,m){if(s(p))return r;var y=e(d,2);return h(p,m,"M0,"+y+"V-"+y+"M"+y+",0H-"+y+"M"+y+",0A"+y+","+y+" 0 1,1 0,-"+y+"A"+y+","+y+" 0 0,1 "+y+",0Z")},needLine:!0,noDot:!0},"circle-x":{n:28,f:function(d,p,m){if(s(p))return r;var y=e(d,2),b=e(d/a,2);return h(p,m,"M"+b+","+b+"L-"+b+",-"+b+"M"+b+",-"+b+"L-"+b+","+b+"M"+y+",0A"+y+","+y+" 0 1,1 0,-"+y+"A"+y+","+y+" 0 0,1 "+y+",0Z")},needLine:!0,noDot:!0},"square-cross":{n:29,f:function(d,p,m){if(s(p))return r;var y=e(d,2);return h(p,m,"M0,"+y+"V-"+y+"M"+y+",0H-"+y+"M"+y+","+y+"H-"+y+"V-"+y+"H"+y+"Z")},needLine:!0,noDot:!0},"square-x":{n:30,f:function(d,p,m){if(s(p))return r;var y=e(d,2);return h(p,m,"M"+y+","+y+"L-"+y+",-"+y+"M"+y+",-"+y+"L-"+y+","+y+"M"+y+","+y+"H-"+y+"V-"+y+"H"+y+"Z")},needLine:!0,noDot:!0},"diamond-cross":{n:31,f:function(d,p,m){if(s(p))return r;var y=e(d*1.3,2);return h(p,m,"M"+y+",0L0,"+y+"L-"+y+",0L0,-"+y+"ZM0,-"+y+"V"+y+"M-"+y+",0H"+y)},needLine:!0,noDot:!0},"diamond-x":{n:32,f:function(d,p,m){if(s(p))return r;var y=e(d*1.3,2),b=e(d*.65,2);return h(p,m,"M"+y+",0L0,"+y+"L-"+y+",0L0,-"+y+"ZM-"+b+",-"+b+"L"+b+","+b+"M-"+b+","+b+"L"+b+",-"+b)},needLine:!0,noDot:!0},"cross-thin":{n:33,f:function(d,p,m){if(s(p))return r;var y=e(d*1.4,2);return h(p,m,"M0,"+y+"V-"+y+"M"+y+",0H-"+y)},needLine:!0,noDot:!0,noFill:!0},"x-thin":{n:34,f:function(d,p,m){if(s(p))return r;var y=e(d,2);return h(p,m,"M"+y+","+y+"L-"+y+",-"+y+"M"+y+",-"+y+"L-"+y+","+y)},needLine:!0,noDot:!0,noFill:!0},asterisk:{n:35,f:function(d,p,m){if(s(p))return r;var y=e(d*1.2,2),b=e(d*.85,2);return h(p,m,"M0,"+y+"V-"+y+"M"+y+",0H-"+y+"M"+b+","+b+"L-"+b+",-"+b+"M"+b+",-"+b+"L-"+b+","+b)},needLine:!0,noDot:!0,noFill:!0},hash:{n:36,f:function(d,p,m){if(s(p))return r;var y=e(d/2,2),b=e(d,2);return h(p,m,"M"+y+","+b+"V-"+b+"M"+(y-b)+",-"+b+"V"+b+"M"+b+","+y+"H-"+b+"M-"+b+","+(y-b)+"H"+b)},needLine:!0,noFill:!0},"y-up":{n:37,f:function(d,p,m){if(s(p))return r;var y=e(d*1.2,2),b=e(d*1.6,2),w=e(d*.8,2);return h(p,m,"M-"+y+","+w+"L0,0M"+y+","+w+"L0,0M0,-"+b+"L0,0")},needLine:!0,noDot:!0,noFill:!0},"y-down":{n:38,f:function(d,p,m){if(s(p))return r;var y=e(d*1.2,2),b=e(d*1.6,2),w=e(d*.8,2);return h(p,m,"M-"+y+",-"+w+"L0,0M"+y+",-"+w+"L0,0M0,"+b+"L0,0")},needLine:!0,noDot:!0,noFill:!0},"y-left":{n:39,f:function(d,p,m){if(s(p))return r;var y=e(d*1.2,2),b=e(d*1.6,2),w=e(d*.8,2);return h(p,m,"M"+w+","+y+"L0,0M"+w+",-"+y+"L0,0M-"+b+",0L0,0")},needLine:!0,noDot:!0,noFill:!0},"y-right":{n:40,f:function(d,p,m){if(s(p))return r;var y=e(d*1.2,2),b=e(d*1.6,2),w=e(d*.8,2);return h(p,m,"M-"+w+","+y+"L0,0M-"+w+",-"+y+"L0,0M"+b+",0L0,0")},needLine:!0,noDot:!0,noFill:!0},"line-ew":{n:41,f:function(d,p,m){if(s(p))return r;var y=e(d*1.4,2);return h(p,m,"M"+y+",0H-"+y)},needLine:!0,noDot:!0,noFill:!0},"line-ns":{n:42,f:function(d,p,m){if(s(p))return r;var y=e(d*1.4,2);return h(p,m,"M0,"+y+"V-"+y)},needLine:!0,noDot:!0,noFill:!0},"line-ne":{n:43,f:function(d,p,m){if(s(p))return r;var y=e(d,2);return h(p,m,"M"+y+",-"+y+"L-"+y+","+y)},needLine:!0,noDot:!0,noFill:!0},"line-nw":{n:44,f:function(d,p,m){if(s(p))return r;var y=e(d,2);return h(p,m,"M"+y+","+y+"L-"+y+",-"+y)},needLine:!0,noDot:!0,noFill:!0},"arrow-up":{n:45,f:function(d,p,m){if(s(p))return r;var y=e(d,2),b=e(d*2,2);return h(p,m,"M0,0L-"+y+","+b+"H"+y+"Z")},backoff:1,noDot:!0},"arrow-down":{n:46,f:function(d,p,m){if(s(p))return r;var y=e(d,2),b=e(d*2,2);return h(p,m,"M0,0L-"+y+",-"+b+"H"+y+"Z")},noDot:!0},"arrow-left":{n:47,f:function(d,p,m){if(s(p))return r;var y=e(d*2,2),b=e(d,2);return h(p,m,"M0,0L"+y+",-"+b+"V"+b+"Z")},noDot:!0},"arrow-right":{n:48,f:function(d,p,m){if(s(p))return r;var y=e(d*2,2),b=e(d,2);return h(p,m,"M0,0L-"+y+",-"+b+"V"+b+"Z")},noDot:!0},"arrow-bar-up":{n:49,f:function(d,p,m){if(s(p))return r;var y=e(d,2),b=e(d*2,2);return h(p,m,"M-"+y+",0H"+y+"M0,0L-"+y+","+b+"H"+y+"Z")},backoff:1,needLine:!0,noDot:!0},"arrow-bar-down":{n:50,f:function(d,p,m){if(s(p))return r;var y=e(d,2),b=e(d*2,2);return h(p,m,"M-"+y+",0H"+y+"M0,0L-"+y+",-"+b+"H"+y+"Z")},needLine:!0,noDot:!0},"arrow-bar-left":{n:51,f:function(d,p,m){if(s(p))return r;var y=e(d*2,2),b=e(d,2);return h(p,m,"M0,-"+b+"V"+b+"M0,0L"+y+",-"+b+"V"+b+"Z")},needLine:!0,noDot:!0},"arrow-bar-right":{n:52,f:function(d,p,m){if(s(p))return r;var y=e(d*2,2),b=e(d,2);return h(p,m,"M0,-"+b+"V"+b+"M0,0L-"+y+",-"+b+"V"+b+"Z")},needLine:!0,noDot:!0},arrow:{n:53,f:function(d,p,m){if(s(p))return r;var y=n/2.5,b=2*d*o(y),w=2*d*l(y);return h(p,m,"M0,0L"+-b+","+w+"L"+b+","+w+"Z")},backoff:.9,noDot:!0},"arrow-wide":{n:54,f:function(d,p,m){if(s(p))return r;var y=n/4,b=2*d*o(y),w=2*d*l(y);return h(p,m,"M0,0L"+-b+","+w+"A "+2*d+","+2*d+" 0 0 1 "+b+","+w+"Z")},backoff:.4,noDot:!0}};function s(d){return d===null}var f,c,v,u;function h(d,p,m){if((!d||d%360===0)&&!p)return m;if(v===d&&u===p&&f===m)return c;v=d,u=p,f=m;function y(z,O){var I=o(z),P=l(z),M=O[0],A=O[1]+(p||0);return[M*I-A*P,M*P+A*I]}for(var b=d/180*n,w=0,g=0,x=t(m),_="",T=0;T<x.length;T++){var k=x[T],S=k[0],L=w,D=g;if(S==="M"||S==="L")w=+k[1],g=+k[2];else if(S==="m"||S==="l")w+=+k[1],g+=+k[2];else if(S==="H")w=+k[1];else if(S==="h")w+=+k[1];else if(S==="V")g=+k[1];else if(S==="v")g+=+k[1];else if(S==="A"){w=+k[1],g=+k[2];var $=y(b,[+k[6],+k[7]]);k[6]=$[0],k[7]=$[1],k[3]=+k[3]+d}(S==="H"||S==="V")&&(S="L"),(S==="h"||S==="v")&&(S="l"),(S==="m"||S==="l")&&(w-=L,g-=D);var E=y(b,[w,g]);(S==="H"||S==="V")&&(S="L"),(S==="M"||S==="L"||S==="m"||S==="l")&&(k[1]=E[0],k[2]=E[1]),k[0]=S,_+=k[0]+k.slice(1).join(",")}return c=_,_}return $u}var gr=gt,jt=me,GC=jt.numberFormat,gn=wt,Ld=ga,Nc=ot,Cr=ht,UC=wo,Fl=jt.strTranslate,Qh=br,VC=Sn,XC=Ur,YC=XC.LINE_SPACING,pw=ns.DESELECTDIM,WC=Ir,qC=hw,ZC=xa.appendArrayPointValue,Re=q_.exports={};Re.font=function(t,e,r,a){jt.isPlainObject(e)&&(a=e.color,r=e.size,e=e.family),e&&t.style("font-family",e),r+1&&t.style("font-size",r+"px"),a&&t.call(Cr.fill,a)};Re.setPosition=function(t,e,r){t.attr("x",e).attr("y",r)};Re.setSize=function(t,e,r){t.attr("width",e).attr("height",r)};Re.setRect=function(t,e,r,a,i){t.call(Re.setPosition,e,r).call(Re.setSize,a,i)};Re.translatePoint=function(t,e,r,a){var i=r.c2p(t.x),n=a.c2p(t.y);if(gn(i)&&gn(n)&&e.node())e.node().nodeName==="text"?e.attr("x",i).attr("y",n):e.attr("transform",Fl(i,n));else return!1;return!0};Re.translatePoints=function(t,e,r){t.each(function(a){var i=gr.select(this);Re.translatePoint(a,i,e,r)})};Re.hideOutsideRangePoint=function(t,e,r,a,i,n){e.attr("display",r.isPtWithinRange(t,i)&&a.isPtWithinRange(t,n)?null:"none")};Re.hideOutsideRangePoints=function(t,e){if(e._hasClipOnAxisFalse){var r=e.xaxis,a=e.yaxis;t.each(function(i){var n=i[0].trace,o=n.xcalendar,l=n.ycalendar,s=Nc.traceIs(n,"bar-like")?".bartext":".point,.textpoint";t.selectAll(s).each(function(f){Re.hideOutsideRangePoint(f,gr.select(this),r,a,o,l)})})}};Re.crispRound=function(t,e,r){return!e||!gn(e)?r||0:t._context.staticPlot?e:e<1?1:Math.round(e)};Re.singleLineStyle=function(t,e,r,a,i){e.style("fill","none");var n=(((t||[])[0]||{}).trace||{}).line||{},o=r||n.width||0,l=i||n.dash||"";Cr.stroke(e,a||n.color),Re.dashLine(e,l,o)};Re.lineGroupStyle=function(t,e,r,a){t.style("fill","none").each(function(i){var n=(((i||[])[0]||{}).trace||{}).line||{},o=e||n.width||0,l=a||n.dash||"";gr.select(this).call(Cr.stroke,r||n.color).call(Re.dashLine,l,o)})};Re.dashLine=function(t,e,r){r=+r||0,e=Re.dashStyle(e,r),t.style({"stroke-dasharray":e,"stroke-width":r+"px"})};Re.dashStyle=function(t,e){e=+e||1;var r=Math.max(e,3);return t==="solid"?t="":t==="dot"?t=r+"px,"+r+"px":t==="dash"?t=3*r+"px,"+3*r+"px":t==="longdash"?t=5*r+"px,"+5*r+"px":t==="dashdot"?t=3*r+"px,"+r+"px,"+r+"px,"+r+"px":t==="longdashdot"&&(t=5*r+"px,"+2*r+"px,"+r+"px,"+2*r+"px"),t};function mw(t,e,r){var a=e.fillpattern,i=a&&Re.getPatternAttr(a.shape,0,"");if(i){var n=Re.getPatternAttr(a.bgcolor,0,null),o=Re.getPatternAttr(a.fgcolor,0,null),l=a.fgopacity,s=Re.getPatternAttr(a.size,0,8),f=Re.getPatternAttr(a.solidity,0,.3),c=e.uid;Re.pattern(t,"point",r,c,i,s,f,void 0,a.fillmode,n,o,l)}else e.fillcolor&&t.call(Cr.fill,e.fillcolor)}Re.singleFillStyle=function(t,e){var r=gr.select(t.node()),a=r.data(),i=((a[0]||[])[0]||{}).trace||{};mw(t,i,e)};Re.fillGroupStyle=function(t,e){t.style("stroke-width",0).each(function(r){var a=gr.select(this);r[0].trace&&mw(a,r[0].trace,e)})};var dy=BC();Re.symbolNames=[];Re.symbolFuncs=[];Re.symbolBackOffs=[];Re.symbolNeedLines={};Re.symbolNoDot={};Re.symbolNoFill={};Re.symbolList=[];Object.keys(dy).forEach(function(t){var e=dy[t],r=e.n;Re.symbolList.push(r,String(r),t,r+100,String(r+100),t+"-open"),Re.symbolNames[r]=t,Re.symbolFuncs[r]=e.f,Re.symbolBackOffs[r]=e.backoff||0,e.needLine&&(Re.symbolNeedLines[r]=!0),e.noDot?Re.symbolNoDot[r]=!0:Re.symbolList.push(r+200,String(r+200),t+"-dot",r+300,String(r+300),t+"-open-dot"),e.noFill&&(Re.symbolNoFill[r]=!0)});var KC=Re.symbolNames.length,QC="M0,0.5L0.5,0L0,-0.5L-0.5,0Z";Re.symbolNumber=function(t){if(gn(t))t=+t;else if(typeof t=="string"){var e=0;t.indexOf("-open")>0&&(e=100,t=t.replace("-open","")),t.indexOf("-dot")>0&&(e+=200,t=t.replace("-dot","")),t=Re.symbolNames.indexOf(t),t>=0&&(t+=e)}return t%100>=KC||t>=400?0:Math.floor(Math.max(t,0))};function yw(t,e,r,a){var i=t%100;return Re.symbolFuncs[i](e,r,a)+(t>=200?QC:"")}var hy={x1:1,x2:0,y1:0,y2:0},py={x1:0,x2:0,y1:1,y2:0},my=GC("~f"),gw={radial:{node:"radialGradient"},radialreversed:{node:"radialGradient",reversed:!0},horizontal:{node:"linearGradient",attrs:hy},horizontalreversed:{node:"linearGradient",attrs:hy,reversed:!0},vertical:{node:"linearGradient",attrs:py},verticalreversed:{node:"linearGradient",attrs:py,reversed:!0}};Re.gradient=function(t,e,r,a,i,n){for(var o=i.length,l=gw[a],s=new Array(o),f=0;f<o;f++)l.reversed?s[o-1-f]=[my((1-i[f][0])*100),i[f][1]]:s[f]=[my(i[f][0]*100),i[f][1]];var c=e._fullLayout,v="g"+c._uid+"-"+r,u=c._defs.select(".gradients").selectAll("#"+v).data([a+s.join(";")],jt.identity);u.exit().remove(),u.enter().append(l.node).each(function(){var h=gr.select(this);l.attrs&&h.attr(l.attrs),h.attr("id",v);var d=h.selectAll("stop").data(s);d.exit().remove(),d.enter().append("stop"),d.each(function(p){var m=Ld(p[1]);gr.select(this).attr({offset:p[0]+"%","stop-color":Cr.tinyRGB(m),"stop-opacity":m.getAlpha()})})}),t.style(n,Jh(v,e)).style(n+"-opacity",null),t.classed("gradient_filled",!0)};Re.pattern=function(t,e,r,a,i,n,o,l,s,f,c,v){var u=e==="legend";l&&(s==="overlay"?(f=l,c=Cr.contrast(f)):(f=void 0,c=l));var h=r._fullLayout,d="p"+h._uid+"-"+a,p,m,y=function(E,z,O,I,P){return I+(P-I)*(E-z)/(O-z)},b,w,g,x,_={},T=Ld(c),k=Cr.tinyRGB(T),S=T.getAlpha(),L=v*S;switch(i){case"/":p=n*Math.sqrt(2),m=n*Math.sqrt(2),b="M-"+p/4+","+m/4+"l"+p/2+",-"+m/2+"M0,"+m+"L"+p+",0M"+p/4*3+","+m/4*5+"l"+p/2+",-"+m/2,w=o*n,x="path",_={d:b,opacity:L,stroke:k,"stroke-width":w+"px"};break;case"\\":p=n*Math.sqrt(2),m=n*Math.sqrt(2),b="M"+p/4*3+",-"+m/4+"l"+p/2+","+m/2+"M0,0L"+p+","+m+"M-"+p/4+","+m/4*3+"l"+p/2+","+m/2,w=o*n,x="path",_={d:b,opacity:L,stroke:k,"stroke-width":w+"px"};break;case"x":p=n*Math.sqrt(2),m=n*Math.sqrt(2),b="M-"+p/4+","+m/4+"l"+p/2+",-"+m/2+"M0,"+m+"L"+p+",0M"+p/4*3+","+m/4*5+"l"+p/2+",-"+m/2+"M"+p/4*3+",-"+m/4+"l"+p/2+","+m/2+"M0,0L"+p+","+m+"M-"+p/4+","+m/4*3+"l"+p/2+","+m/2,w=n-n*Math.sqrt(1-o),x="path",_={d:b,opacity:L,stroke:k,"stroke-width":w+"px"};break;case"|":p=n,m=n,x="path",b="M"+p/2+",0L"+p/2+","+m,w=o*n,x="path",_={d:b,opacity:L,stroke:k,"stroke-width":w+"px"};break;case"-":p=n,m=n,x="path",b="M0,"+m/2+"L"+p+","+m/2,w=o*n,x="path",_={d:b,opacity:L,stroke:k,"stroke-width":w+"px"};break;case"+":p=n,m=n,x="path",b="M"+p/2+",0L"+p/2+","+m+"M0,"+m/2+"L"+p+","+m/2,w=n-n*Math.sqrt(1-o),x="path",_={d:b,opacity:L,stroke:k,"stroke-width":w+"px"};break;case".":p=n,m=n,o<Math.PI/4?g=Math.sqrt(o*n*n/Math.PI):g=y(o,Math.PI/4,1,n/2,n/Math.sqrt(2)),x="circle",_={cx:p/2,cy:m/2,r:g,opacity:L,fill:k};break}var D=[i||"noSh",f||"noBg",c||"noFg",n,o].join(";"),$=h._defs.select(".patterns").selectAll("#"+d).data([D],jt.identity);$.exit().remove(),$.enter().append("pattern").each(function(){var E=gr.select(this);if(E.attr({id:d,width:p+"px",height:m+"px",patternUnits:"userSpaceOnUse",patternTransform:u?"scale(0.8)":""}),f){var z=Ld(f),O=Cr.tinyRGB(z),I=z.getAlpha(),P=E.selectAll("rect").data([0]);P.exit().remove(),P.enter().append("rect").attr({width:p+"px",height:m+"px",fill:O,"fill-opacity":I})}var M=E.selectAll(x).data([0]);M.exit().remove(),M.enter().append(x).attr(_)}),t.style("fill",Jh(d,r)).style("fill-opacity",null),t.classed("pattern_filled",!0)};Re.initGradients=function(t){var e=t._fullLayout,r=jt.ensureSingle(e._defs,"g","gradients");r.selectAll("linearGradient,radialGradient").remove(),gr.select(t).selectAll(".gradient_filled").classed("gradient_filled",!1)};Re.initPatterns=function(t){var e=t._fullLayout,r=jt.ensureSingle(e._defs,"g","patterns");r.selectAll("pattern").remove(),gr.select(t).selectAll(".pattern_filled").classed("pattern_filled",!1)};Re.getPatternAttr=function(t,e,r){return t&&jt.isArrayOrTypedArray(t)?e<t.length?t[e]:r:t};Re.pointStyle=function(t,e,r,a){if(t.size()){var i=Re.makePointStyleFns(e);t.each(function(n){Re.singlePointStyle(n,gr.select(this),e,i,r,a)})}};Re.singlePointStyle=function(t,e,r,a,i,n){var o=r.marker,l=o.line;if(n&&n.i>=0&&t.i===void 0&&(t.i=n.i),e.style("opacity",a.selectedOpacityFn?a.selectedOpacityFn(t):t.mo===void 0?o.opacity:t.mo),a.ms2mrc){var s;t.ms==="various"||o.size==="various"?s=3:s=a.ms2mrc(t.ms),t.mrc=s,a.selectedSizeFn&&(s=t.mrc=a.selectedSizeFn(t));var f=Re.symbolNumber(t.mx||o.symbol)||0;t.om=f%200>=100;var c=tp(t,r),v=ep(t,r);e.attr("d",yw(f,s,c,v))}var u=!1,h,d,p;if(t.so)p=l.outlierwidth,d=l.outliercolor,h=o.outliercolor;else{var m=(l||{}).width;p=(t.mlw+1||m+1||(t.trace?(t.trace.marker.line||{}).width:0)+1)-1||0,"mlc"in t?d=t.mlcc=a.lineScale(t.mlc):jt.isArrayOrTypedArray(l.color)?d=Cr.defaultLine:d=l.color,jt.isArrayOrTypedArray(o.color)&&(h=Cr.defaultLine,u=!0),"mc"in t?h=t.mcc=a.markerScale(t.mc):h=o.color||o.colors||"rgba(0,0,0,0)",a.selectedColorFn&&(h=a.selectedColorFn(t))}if(t.om)e.call(Cr.stroke,h).style({"stroke-width":(p||1)+"px",fill:"none"});else{e.style("stroke-width",(t.isBlank?0:p)+"px");var y=o.gradient,b=t.mgt;b?u=!0:b=y&&y.type,jt.isArrayOrTypedArray(b)&&(b=b[0],gw[b]||(b=0));var w=o.pattern,g=w&&Re.getPatternAttr(w.shape,t.i,"");if(b&&b!=="none"){var x=t.mgc;x?u=!0:x=y.color;var _=r.uid;u&&(_+="-"+t.i),Re.gradient(e,i,_,b,[[0,x],[1,h]],"fill")}else if(g){var T=!1,k=w.fgcolor;!k&&n&&n.color&&(k=n.color,T=!0);var S=Re.getPatternAttr(k,t.i,n&&n.color||null),L=Re.getPatternAttr(w.bgcolor,t.i,null),D=w.fgopacity,$=Re.getPatternAttr(w.size,t.i,8),E=Re.getPatternAttr(w.solidity,t.i,.3);T=T||t.mcc||jt.isArrayOrTypedArray(w.shape)||jt.isArrayOrTypedArray(w.bgcolor)||jt.isArrayOrTypedArray(w.fgcolor)||jt.isArrayOrTypedArray(w.size)||jt.isArrayOrTypedArray(w.solidity);var z=r.uid;T&&(z+="-"+t.i),Re.pattern(e,"point",i,z,g,$,E,t.mcc,w.fillmode,L,S,D)}else jt.isArrayOrTypedArray(h)?Cr.fill(e,h[t.i]):Cr.fill(e,h);p&&Cr.stroke(e,d)}};Re.makePointStyleFns=function(t){var e={},r=t.marker;return e.markerScale=Re.tryColorscale(r,""),e.lineScale=Re.tryColorscale(r,"line"),Nc.traceIs(t,"symbols")&&(e.ms2mrc=WC.isBubble(t)?qC(t):function(){return(r.size||6)/2}),t.selectedpoints&&jt.extendFlat(e,Re.makeSelectedPointStyleFns(t)),e};Re.makeSelectedPointStyleFns=function(t){var e={},r=t.selected||{},a=t.unselected||{},i=t.marker||{},n=r.marker||{},o=a.marker||{},l=i.opacity,s=n.opacity,f=o.opacity,c=s!==void 0,v=f!==void 0;(jt.isArrayOrTypedArray(l)||c||v)&&(e.selectedOpacityFn=function(g){var x=g.mo===void 0?i.opacity:g.mo;return g.selected?c?s:x:v?f:pw*x});var u=i.color,h=n.color,d=o.color;(h||d)&&(e.selectedColorFn=function(g){var x=g.mcc||u;return g.selected?h||x:d||x});var p=i.size,m=n.size,y=o.size,b=m!==void 0,w=y!==void 0;return Nc.traceIs(t,"symbols")&&(b||w)&&(e.selectedSizeFn=function(g){var x=g.mrc||p/2;return g.selected?b?m/2:x:w?y/2:x}),e};Re.makeSelectedTextStyleFns=function(t){var e={},r=t.selected||{},a=t.unselected||{},i=t.textfont||{},n=r.textfont||{},o=a.textfont||{},l=i.color,s=n.color,f=o.color;return e.selectedTextColorFn=function(c){var v=c.tc||l;return c.selected?s||v:f||(s?v:Cr.addOpacity(v,pw))},e};Re.selectedPointStyle=function(t,e){if(!(!t.size()||!e.selectedpoints)){var r=Re.makeSelectedPointStyleFns(e),a=e.marker||{},i=[];r.selectedOpacityFn&&i.push(function(n,o){n.style("opacity",r.selectedOpacityFn(o))}),r.selectedColorFn&&i.push(function(n,o){Cr.fill(n,r.selectedColorFn(o))}),r.selectedSizeFn&&i.push(function(n,o){var l=o.mx||a.symbol||0,s=r.selectedSizeFn(o);n.attr("d",yw(Re.symbolNumber(l),s,tp(o,e),ep(o,e))),o.mrc2=s}),i.length&&t.each(function(n){for(var o=gr.select(this),l=0;l<i.length;l++)i[l](o,n)})}};Re.tryColorscale=function(t,e){var r=e?jt.nestedProperty(t,e).get():t;if(r){var a=r.color;if((r.colorscale||r._colorAx)&&jt.isArrayOrTypedArray(a))return UC.makeColorScaleFuncFromTrace(r)}return jt.identity};var Pu={start:1,end:-1,middle:0,bottom:1,top:-1};function bw(t,e,r,a,i){var n=gr.select(t.node().parentNode),o=e.indexOf("top")!==-1?"top":e.indexOf("bottom")!==-1?"bottom":"middle",l=e.indexOf("left")!==-1?"end":e.indexOf("right")!==-1?"start":"middle",s=a?a/.8+1:0,f=(Qh.lineCount(t)-1)*YC+1,c=Pu[l]*s,v=r*.75+Pu[o]*s+(Pu[o]-1)*f*r/2;t.attr("text-anchor",l),i||n.attr("transform",Fl(c,v))}function xw(t,e){var r=t.ts||e.textfont.size;return gn(r)&&r>0?r:0}Re.textPointStyle=function(t,e,r){if(t.size()){var a;if(e.selectedpoints){var i=Re.makeSelectedTextStyleFns(e);a=i.selectedTextColorFn}var n=e.texttemplate,o=r._fullLayout;t.each(function(l){var s=gr.select(this),f=n?jt.extractOption(l,e,"txt","texttemplate"):jt.extractOption(l,e,"tx","text");if(!f&&f!==0){s.remove();return}if(n){var c=e._module.formatLabels,v=c?c(l,e,o):{},u={};ZC(u,e,l.i);var h=e._meta||{};f=jt.texttemplateString(f,v,o._d3locale,u,l,h)}var d=l.tp||e.textposition,p=xw(l,e),m=a?a(l):l.tc||e.textfont.color;s.call(Re.font,l.tf||e.textfont.family,p,m).text(f).call(Qh.convertToTspans,r).call(bw,d,p,l.mrc)})}};Re.selectedTextStyle=function(t,e){if(!(!t.size()||!e.selectedpoints)){var r=Re.makeSelectedTextStyleFns(e);t.each(function(a){var i=gr.select(this),n=r.selectedTextColorFn(a),o=a.tp||e.textposition,l=xw(a,e);Cr.fill(i,n);var s=Nc.traceIs(e,"bar-like");bw(i,o,l,a.mrc2||a.mrc,s)})}};var yy=.5;Re.smoothopen=function(t,e){if(t.length<3)return"M"+t.join("L");var r="M"+t[0],a=[],i;for(i=1;i<t.length-1;i++)a.push(kf(t[i-1],t[i],t[i+1],e));for(r+="Q"+a[0][0]+" "+t[1],i=2;i<t.length-1;i++)r+="C"+a[i-2][1]+" "+a[i-1][0]+" "+t[i];return r+="Q"+a[t.length-3][1]+" "+t[t.length-1],r};Re.smoothclosed=function(t,e){if(t.length<3)return"M"+t.join("L")+"Z";var r="M"+t[0],a=t.length-1,i=[kf(t[a],t[0],t[1],e)],n;for(n=1;n<a;n++)i.push(kf(t[n-1],t[n],t[n+1],e));for(i.push(kf(t[a-1],t[a],t[0],e)),n=1;n<=a;n++)r+="C"+i[n-1][1]+" "+i[n][0]+" "+t[n];return r+="C"+i[a][1]+" "+i[0][0]+" "+t[0]+"Z",r};var _w,ww;function fo(t,e,r){return r&&(t=Tw(t)),e?vn(t[1]):un(t[0])}function un(t){var e=gr.round(t,2);return _w=e,e}function vn(t){var e=gr.round(t,2);return ww=e,e}function kf(t,e,r,a){var i=t[0]-e[0],n=t[1]-e[1],o=r[0]-e[0],l=r[1]-e[1],s=Math.pow(i*i+n*n,yy/2),f=Math.pow(o*o+l*l,yy/2),c=(f*f*i-s*s*o)*a,v=(f*f*n-s*s*l)*a,u=3*f*(s+f),h=3*s*(s+f);return[[un(e[0]+(u&&c/u)),vn(e[1]+(u&&v/u))],[un(e[0]-(h&&c/h)),vn(e[1]-(h&&v/h))]]}var JC={hv:function(t,e,r){return"H"+un(e[0])+"V"+fo(e,1,r)},vh:function(t,e,r){return"V"+vn(e[1])+"H"+fo(e,0,r)},hvh:function(t,e,r){return"H"+un((t[0]+e[0])/2)+"V"+vn(e[1])+"H"+fo(e,0,r)},vhv:function(t,e,r){return"V"+vn((t[1]+e[1])/2)+"H"+un(e[0])+"V"+fo(e,1,r)}},eD=function(t,e,r){return"L"+fo(e,0,r)+","+fo(e,1,r)};Re.steps=function(t){var e=JC[t]||eD;return function(r){for(var a="M"+un(r[0][0])+","+vn(r[0][1]),i=r.length,n=1;n<i;n++)a+=e(r[n-1],r[n],n===i-1);return a}};function Tw(t,e){var r=t.backoff,a=t.trace,i=t.d,n=t.i;if(r&&a&&a.marker&&a.marker.angle%360===0&&a.line&&a.line.shape!=="spline"){var o=jt.isArrayOrTypedArray(r),l=t,s=e?e[0]:_w||0,f=e?e[1]:ww||0,c=l[0],v=l[1],u=c-s,h=v-f,d=Math.atan2(h,u),p=o?r[n]:r;if(p==="auto"){var m=l.i;a.type==="scatter"&&m--;var y=l.marker,b=y.symbol;jt.isArrayOrTypedArray(b)&&(b=b[m]);var w=y.size;jt.isArrayOrTypedArray(w)&&(w=w[m]),p=y?Re.symbolBackOffs[Re.symbolNumber(b)]*w:0,p+=Re.getMarkerStandoff(i[m],a)||0}var g=c-p*Math.cos(d),x=v-p*Math.sin(d);(g<=c&&g>=s||g>=c&&g<=s)&&(x<=v&&x>=f||x>=v&&x<=f)&&(t=[g,x])}return t}Re.applyBackoff=Tw;Re.makeTester=function(){var t=jt.ensureSingleById(gr.select("body"),"svg","js-plotly-tester",function(r){r.attr(VC.svgAttrs).style({position:"absolute",left:"-10000px",top:"-10000px",width:"9000px",height:"9000px","z-index":"1"})}),e=jt.ensureSingle(t,"path","js-reference-point",function(r){r.attr("d","M0,0H1V1H0Z").style({"stroke-width":0,fill:"black"})});Re.tester=t,Re.testref=e};Re.savedBBoxes={};var Ru=0,tD=1e4;Re.bBox=function(t,e,r){r||(r=gy(t));var a;if(r){if(a=Re.savedBBoxes[r],a)return jt.extendFlat({},a)}else if(t.childNodes.length===1){var i=t.childNodes[0];if(r=gy(i),r){var n=+i.getAttribute("x")||0,o=+i.getAttribute("y")||0,l=i.getAttribute("transform");if(!l){var s=Re.bBox(i,!1,r);return n&&(s.left+=n,s.right+=n),o&&(s.top+=o,s.bottom+=o),s}if(r+="~"+n+"~"+o+"~"+l,a=Re.savedBBoxes[r],a)return jt.extendFlat({},a)}}var f,c;e?f=t:(c=Re.tester.node(),f=t.cloneNode(!0),c.appendChild(f)),gr.select(f).attr("transform",null).call(Qh.positionText,0,0);var v=f.getBoundingClientRect(),u=Re.testref.node().getBoundingClientRect();e||c.removeChild(f);var h={height:v.height,width:v.width,left:v.left-u.left,top:v.top-u.top,right:v.right-u.left,bottom:v.bottom-u.top};return Ru>=tD&&(Re.savedBBoxes={},Ru=0),r&&(Re.savedBBoxes[r]=h),Ru++,jt.extendFlat({},h)};function gy(t){var e=t.getAttribute("data-unformatted");if(e!==null)return e+t.getAttribute("data-math")+t.getAttribute("text-anchor")+t.getAttribute("style")}Re.setClipUrl=function(t,e,r){t.attr("clip-path",Jh(e,r))};function Jh(t,e){if(!t)return null;var r=e._context,a=r._exportedPlot?"":r._baseUrl||"";return a?"url('"+a+"#"+t+"')":"url(#"+t+")"}Re.getTranslate=function(t){var e=/.*\btranslate\((-?\d*\.?\d*)[^-\d]*(-?\d*\.?\d*)[^\d].*/,r=t.attr?"attr":"getAttribute",a=t[r]("transform")||"",i=a.replace(e,function(n,o,l){return[o,l].join(" ")}).split(" ");return{x:+i[0]||0,y:+i[1]||0}};Re.setTranslate=function(t,e,r){var a=/(\btranslate\(.*?\);?)/,i=t.attr?"attr":"getAttribute",n=t.attr?"attr":"setAttribute",o=t[i]("transform")||"";return e=e||0,r=r||0,o=o.replace(a,"").trim(),o+=Fl(e,r),o=o.trim(),t[n]("transform",o),o};Re.getScale=function(t){var e=/.*\bscale\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/,r=t.attr?"attr":"getAttribute",a=t[r]("transform")||"",i=a.replace(e,function(n,o,l){return[o,l].join(" ")}).split(" ");return{x:+i[0]||1,y:+i[1]||1}};Re.setScale=function(t,e,r){var a=/(\bscale\(.*?\);?)/,i=t.attr?"attr":"getAttribute",n=t.attr?"attr":"setAttribute",o=t[i]("transform")||"";return e=e||1,r=r||1,o=o.replace(a,"").trim(),o+="scale("+e+","+r+")",o=o.trim(),t[n]("transform",o),o};var rD=/\s*sc.*/;Re.setPointGroupScale=function(t,e,r){if(e=e||1,r=r||1,!!t){var a=e===1&&r===1?"":"scale("+e+","+r+")";t.each(function(){var i=(this.getAttribute("transform")||"").replace(rD,"");i+=a,i=i.trim(),this.setAttribute("transform",i)})}};var aD=/translate\([^)]*\)\s*$/;Re.setTextPointsScale=function(t,e,r){t&&t.each(function(){var a,i=gr.select(this),n=i.select("text");if(n.node()){var o=parseFloat(n.attr("x")||0),l=parseFloat(n.attr("y")||0),s=(i.attr("transform")||"").match(aD);e===1&&r===1?a=[]:a=[Fl(o,l),"scale("+e+","+r+")",Fl(-o,-l)],s&&a.push(s),i.attr("transform",a.join(""))}})};function ep(t,e){var r;return t&&(r=t.mf),r===void 0&&(r=e.marker&&e.marker.standoff||0),!e._geo&&!e._xA?-r:r}Re.getMarkerStandoff=ep;var Qo=Math.atan2,nn=Math.cos,co=Math.sin;function by(t,e){var r=e[0],a=e[1];return[r*nn(t)-a*co(t),r*co(t)+a*nn(t)]}var xy,_y,wy,Ty,Eu,zu;function tp(t,e){var r=t.ma;r===void 0&&(r=e.marker.angle||0);var a,i,n=e.marker.angleref;if(n==="previous"||n==="north"){if(e._geo){var o=e._geo.project(t.lonlat);a=o[0],i=o[1]}else{var l=e._xA,s=e._yA;if(l&&s)a=l.c2p(t.x),i=s.c2p(t.y);else return 90}if(e._geo){var f=t.lonlat[0],c=t.lonlat[1],v=e._geo.project([f,c+1e-5]),u=e._geo.project([f+1e-5,c]),h=Qo(u[1]-i,u[0]-a),d=Qo(v[1]-i,v[0]-a),p;if(n==="north")p=r/180*Math.PI;else if(n==="previous"){var m=f/180*Math.PI,y=c/180*Math.PI,b=xy/180*Math.PI,w=_y/180*Math.PI,g=b-m,x=nn(w)*co(g),_=co(w)*nn(y)-nn(w)*co(y)*nn(g);p=-Qo(x,_)-Math.PI,xy=f,_y=c}var T=by(h,[nn(p),0]),k=by(d,[co(p),0]);r=Qo(T[1]+k[1],T[0]+k[0])/Math.PI*180,n==="previous"&&!(zu===e.uid&&t.i===Eu+1)&&(r=null)}if(n==="previous"&&!e._geo)if(zu===e.uid&&t.i===Eu+1&&gn(a)&&gn(i)){var S=a-wy,L=i-Ty,D=e.line&&e.line.shape||"",$=D.slice(D.length-1);$==="h"&&(L=0),$==="v"&&(S=0),r+=Qo(L,S)/Math.PI*180+90}else r=null}return wy=a,Ty=i,Eu=t.i,zu=e.uid,r}Re.getMarkerAngle=tp;var $t=q_.exports,$s=gt,iD=wt,ky=cr,Ay=ot,ro=me,My=ro.strTranslate,Sy=$t,Ly=ht,Iu=br,Cy=ns,nD=Ur.OPPOSITE_SIDE,Dy=/ [XY][0-9]* /;function oD(t,e,r){var a=r.propContainer,i=r.propName,n=r.placeholder,o=r.traceIndex,l=r.avoid||{},s=r.attributes,f=r.transform,c=r.containerGroup,v=t._fullLayout,u=1,h=!1,d=a.title,p=(d&&d.text?d.text:"").trim(),m=d&&d.font?d.font:{},y=m.family,b=m.size,w=m.color,g;i==="title.text"?g="titleText":i.indexOf("axis")!==-1?g="axisTitleText":i.indexOf("colorbar"!==-1)&&(g="colorbarTitleText");var x=t._context.edits[g];p===""?u=0:p.replace(Dy," % ")===n.replace(Dy," % ")&&(u=.2,h=!0,x||(p="")),r._meta?p=ro.templateString(p,r._meta):v._meta&&(p=ro.templateString(p,v._meta));var _=p||x,T;c||(c=ro.ensureSingle(v._infolayer,"g","g-"+e),T=v._hColorbarMoveTitle);var k=c.selectAll("text").data(_?[0]:[]);if(k.enter().append("text"),k.text(p).attr("class",e),k.exit().remove(),!_)return c;function S(E){ro.syncOrAsync([L,D],E)}function L(E){var z;return!f&&T&&(f={}),f?(z="",f.rotate&&(z+="rotate("+[f.rotate,s.x,s.y]+")"),(f.offset||T)&&(z+=My(0,(f.offset||0)-(T||0)))):z=null,E.attr("transform",z),E.style({"font-family":y,"font-size":$s.round(b,2)+"px",fill:Ly.rgb(w),opacity:u*Ly.opacity(w),"font-weight":ky.fontWeight}).attr(s).call(Iu.convertToTspans,t),ky.previousPromises(t)}function D(E){var z=$s.select(E.node().parentNode);if(l&&l.selection&&l.side&&p){z.attr("transform",null);var O=nD[l.side],I=l.side==="left"||l.side==="top"?-1:1,P=iD(l.pad)?l.pad:2,M=Sy.bBox(z.node()),A={t:0,b:0,l:0,r:0},C=t._fullLayout._reservedMargin;for(var R in C)for(var N in C[R]){var H=C[R][N];A[N]=Math.max(A[N],H)}var B={left:A.l,top:A.t,right:v.width-A.r,bottom:v.height-A.b},X=l.maxShift||I*(B[l.side]-M[l.side]),j=0;if(X<0)j=X;else{var q=l.offsetLeft||0,U=l.offsetTop||0;M.left-=q,M.right-=q,M.top-=U,M.bottom-=U,l.selection.each(function(){var K=Sy.bBox(this);ro.bBoxIntersect(M,K,P)&&(j=Math.max(j,I*(K[l.side]-M[O])+P))}),j=Math.min(X,j),a._titleScoot=Math.abs(j)}if(j>0||X<0){var Z={left:[-j,0],right:[j,0],top:[0,-j],bottom:[0,j]}[l.side];z.attr("transform",My(Z[0],Z[1]))}}}k.call(S);function $(){u=0,h=!0,k.text(n).on("mouseover.opacity",function(){$s.select(this).transition().duration(Cy.SHOW_PLACEHOLDER).style("opacity",1)}).on("mouseout.opacity",function(){$s.select(this).transition().duration(Cy.HIDE_PLACEHOLDER).style("opacity",0)})}return x&&(p?k.on(".opacity",null):$(),k.call(Iu.makeEditable,{gd:t}).on("edit",function(E){o!==void 0?Ay.call("_guiRestyle",t,i,E,o):Ay.call("_guiRelayout",t,i,E)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(S)}).on("input",function(E){this.text(E||" ").call(Iu.positionText,s.x,s.y)})),k.classed("js-placeholder",h),c}var Hc={draw:oD},lD=gt,sD=zl.utcFormat,Vt=me,fD=Vt.numberFormat,Ha=wt,mi=Vt.cleanNumber,cD=Vt.ms2DateTime,$y=Vt.dateTime2ms,Oa=Vt.ensureNumber,Py=Vt.isArrayOrTypedArray,Oi=or,Ps=Oi.FP_SAFE,Ta=Oi.BADNUM,uD=Oi.LOG_CLIP,vD=Oi.ONEWEEK,Rs=Oi.ONEDAY,Es=Oi.ONEHOUR,Ry=Oi.ONEMIN,Ey=Oi.ONESEC,zs=lr,Bf=Gr,Is=Bf.HOUR_PATTERN,Fs=Bf.WEEKDAY_PATTERN;function Jo(t){return Math.pow(10,t)}function Fu(t){return t!=null}var rp=function(e,r){r=r||{};var a=e._id||"x",i=a.charAt(0);function n(g,x){if(g>0)return Math.log(g)/Math.LN10;if(g<=0&&x&&e.range&&e.range.length===2){var _=e.range[0],T=e.range[1];return .5*(_+T-2*uD*Math.abs(_-T))}else return Ta}function o(g,x,_,T){if((T||{}).msUTC&&Ha(g))return+g;var k=$y(g,_||e.calendar);if(k===Ta)if(Ha(g)){g=+g;var S=Math.floor(Vt.mod(g+.05,1)*10),L=Math.round(g-S/10);k=$y(new Date(L))+S/10}else return Ta;return k}function l(g,x,_){return cD(g,x,_||e.calendar)}function s(g){return e._categories[Math.round(g)]}function f(g){if(Fu(g)){if(e._categoriesMap===void 0&&(e._categoriesMap={}),e._categoriesMap[g]!==void 0)return e._categoriesMap[g];e._categories.push(typeof g=="number"?String(g):g);var x=e._categories.length-1;return e._categoriesMap[g]=x,x}return Ta}function c(g,x){for(var _=new Array(x),T=0;T<x;T++){var k=(g[0]||[])[T],S=(g[1]||[])[T];_[T]=v([k,S])}return _}function v(g){if(e._categoriesMap)return e._categoriesMap[g]}function u(g){var x=v(g);if(x!==void 0)return x;if(Ha(g))return+g}function h(g){return Ha(g)?+g:v(g)}function d(g,x,_){return lD.round(_+x*g,2)}function p(g,x,_){return(g-_)/x}var m=function(x){return Ha(x)?d(x,e._m,e._b):Ta},y=function(g){return p(g,e._m,e._b)};if(e.rangebreaks){var b=i==="y";m=function(g){if(!Ha(g))return Ta;var x=e._rangebreaks.length;if(!x)return d(g,e._m,e._b);var _=b;e.range[0]>e.range[1]&&(_=!_);for(var T=_?-1:1,k=T*g,S=0,L=0;L<x;L++){var D=T*e._rangebreaks[L].min,$=T*e._rangebreaks[L].max;if(k<D)break;if(k>$)S=L+1;else{S=k<(D+$)/2?L:L+1;break}}var E=e._B[S]||0;return isFinite(E)?d(g,e._m2,E):0},y=function(g){var x=e._rangebreaks.length;if(!x)return p(g,e._m,e._b);for(var _=0,T=0;T<x&&!(g<e._rangebreaks[T].pmin);T++)g>e._rangebreaks[T].pmax&&(_=T+1);return p(g,e._m2,e._B[_])}}e.c2l=e.type==="log"?n:Oa,e.l2c=e.type==="log"?Jo:Oa,e.l2p=m,e.p2l=y,e.c2p=e.type==="log"?function(g,x){return m(n(g,x))}:m,e.p2c=e.type==="log"?function(g){return Jo(y(g))}:y,["linear","-"].indexOf(e.type)!==-1?(e.d2r=e.r2d=e.d2c=e.r2c=e.d2l=e.r2l=mi,e.c2d=e.c2r=e.l2d=e.l2r=Oa,e.d2p=e.r2p=function(g){return e.l2p(mi(g))},e.p2d=e.p2r=y,e.cleanPos=Oa):e.type==="log"?(e.d2r=e.d2l=function(g,x){return n(mi(g),x)},e.r2d=e.r2c=function(g){return Jo(mi(g))},e.d2c=e.r2l=mi,e.c2d=e.l2r=Oa,e.c2r=n,e.l2d=Jo,e.d2p=function(g,x){return e.l2p(e.d2r(g,x))},e.p2d=function(g){return Jo(y(g))},e.r2p=function(g){return e.l2p(mi(g))},e.p2r=y,e.cleanPos=Oa):e.type==="date"?(e.d2r=e.r2d=Vt.identity,e.d2c=e.r2c=e.d2l=e.r2l=o,e.c2d=e.c2r=e.l2d=e.l2r=l,e.d2p=e.r2p=function(g,x,_){return e.l2p(o(g,0,_))},e.p2d=e.p2r=function(g,x,_){return l(y(g),x,_)},e.cleanPos=function(g){return Vt.cleanDate(g,Ta,e.calendar)}):e.type==="category"?(e.d2c=e.d2l=f,e.r2d=e.c2d=e.l2d=s,e.d2r=e.d2l_noadd=u,e.r2c=function(g){var x=h(g);return x!==void 0?x:e.fraction2r(.5)},e.l2r=e.c2r=Oa,e.r2l=h,e.d2p=function(g){return e.l2p(e.r2c(g))},e.p2d=function(g){return s(y(g))},e.r2p=e.d2p,e.p2r=y,e.cleanPos=function(g){return typeof g=="string"&&g!==""?g:Oa(g)}):e.type==="multicategory"&&(e.r2d=e.c2d=e.l2d=s,e.d2r=e.d2l_noadd=u,e.r2c=function(g){var x=u(g);return x!==void 0?x:e.fraction2r(.5)},e.r2c_just_indices=v,e.l2r=e.c2r=Oa,e.r2l=u,e.d2p=function(g){return e.l2p(e.r2c(g))},e.p2d=function(g){return s(y(g))},e.r2p=e.d2p,e.p2r=y,e.cleanPos=function(g){return Array.isArray(g)||typeof g=="string"&&g!==""?g:Oa(g)},e.setupMultiCategory=function(g){var x=e._traceIndices,_,T,k=e._matchGroup;if(k&&e._categories.length===0){for(var S in k)if(S!==a){var L=r[zs.id2name(S)];x=x.concat(L._traceIndices)}}var D=[[0,{}],[0,{}]],$=[];for(_=0;_<x.length;_++){var E=g[x[_]];if(i in E){var z=E[i],O=E._length||Vt.minRowLength(z);if(Py(z[0])&&Py(z[1]))for(T=0;T<O;T++){var I=z[0][T],P=z[1][T];Fu(I)&&Fu(P)&&($.push([I,P]),I in D[0][1]||(D[0][1][I]=D[0][0]++),P in D[1][1]||(D[1][1][P]=D[1][0]++))}}}for($.sort(function(M,A){var C=D[0][1],R=C[M[0]]-C[A[0]];if(R)return R;var N=D[1][1];return N[M[1]]-N[A[1]]}),_=0;_<$.length;_++)f($[_])}),e.fraction2r=function(g){var x=e.r2l(e.range[0]),_=e.r2l(e.range[1]);return e.l2r(x+g*(_-x))},e.r2fraction=function(g){var x=e.r2l(e.range[0]),_=e.r2l(e.range[1]);return(e.r2l(g)-x)/(_-x)},e.limitRange=function(g){var x=e.minallowed,_=e.maxallowed;if(!(x===void 0&&_===void 0)){g||(g="range");var T=Vt.nestedProperty(e,g).get(),k=Vt.simpleMap(T,e.r2l),S=k[1]<k[0];S&&k.reverse();var L=Vt.simpleMap([x,_],e.r2l);x!==void 0&&k[0]<L[0]&&(T[S?1:0]=x),_!==void 0&&k[1]>L[1]&&(T[S?0:1]=_)}},e.cleanRange=function(g,x){e._cleanRange(g,x),e.limitRange(g)},e._cleanRange=function(g,x){x||(x={}),g||(g="range");var _=Vt.nestedProperty(e,g).get(),T,k;if(e.type==="date"?k=Vt.dfltRange(e.calendar):i==="y"?k=Bf.DFLTRANGEY:e._name==="realaxis"?k=[0,1]:k=x.dfltRange||Bf.DFLTRANGEX,k=k.slice(),(e.rangemode==="tozero"||e.rangemode==="nonnegative")&&(k[0]=0),!_||_.length!==2){Vt.nestedProperty(e,g).set(k);return}var S=_[0]===null,L=_[1]===null;for(e.type==="date"&&!e.autorange&&(_[0]=Vt.cleanDate(_[0],Ta,e.calendar),_[1]=Vt.cleanDate(_[1],Ta,e.calendar)),T=0;T<2;T++)if(e.type==="date"){if(!Vt.isDateTime(_[T],e.calendar)){e[g]=k;break}if(e.r2l(_[0])===e.r2l(_[1])){var D=Vt.constrain(e.r2l(_[0]),Vt.MIN_MS+1e3,Vt.MAX_MS-1e3);_[0]=e.l2r(D-1e3),_[1]=e.l2r(D+1e3);break}}else{if(!Ha(_[T]))if(!(S||L)&&Ha(_[1-T]))_[T]=_[1-T]*(T?10:.1);else{e[g]=k;break}if(_[T]<-Ps?_[T]=-Ps:_[T]>Ps&&(_[T]=Ps),_[0]===_[1]){var $=Math.max(1,Math.abs(_[0]*1e-6));_[0]-=$,_[1]+=$}}},e.setScale=function(g){var x=r._size;if(e.overlaying){var _=zs.getFromId({_fullLayout:r},e.overlaying);e.domain=_.domain}var T=g&&e._r?"_r":"range",k=e.calendar;e.cleanRange(T);var S=e.r2l(e[T][0],k),L=e.r2l(e[T][1],k),D=i==="y";if(D?(e._offset=x.t+(1-e.domain[1])*x.h,e._length=x.h*(e.domain[1]-e.domain[0]),e._m=e._length/(S-L),e._b=-e._m*L):(e._offset=x.l+e.domain[0]*x.w,e._length=x.w*(e.domain[1]-e.domain[0]),e._m=e._length/(L-S),e._b=-e._m*S),e._rangebreaks=[],e._lBreaks=0,e._m2=0,e._B=[],e.rangebreaks){var $,E;if(e._rangebreaks=e.locateBreaks(Math.min(S,L),Math.max(S,L)),e._rangebreaks.length){for($=0;$<e._rangebreaks.length;$++)E=e._rangebreaks[$],e._lBreaks+=Math.abs(E.max-E.min);var z=D;S>L&&(z=!z),z&&e._rangebreaks.reverse();var O=z?-1:1;for(e._m2=O*e._length/(Math.abs(L-S)-e._lBreaks),e._B.push(-e._m2*(D?L:S)),$=0;$<e._rangebreaks.length;$++)E=e._rangebreaks[$],e._B.push(e._B[e._B.length-1]-O*e._m2*(E.max-E.min));for($=0;$<e._rangebreaks.length;$++)E=e._rangebreaks[$],E.pmin=m(E.min),E.pmax=m(E.max)}}if(!isFinite(e._m)||!isFinite(e._b)||e._length<0)throw r._replotting=!1,new Error("Something went wrong with axis scaling")},e.maskBreaks=function(g){var x=e.rangebreaks||[],_,T,k,S,L;x._cachedPatterns||(x._cachedPatterns=x.map(function(C){return C.enabled&&C.bounds?Vt.simpleMap(C.bounds,C.pattern?mi:e.d2c):null})),x._cachedValues||(x._cachedValues=x.map(function(C){return C.enabled&&C.values?Vt.simpleMap(C.values,e.d2c).sort(Vt.sorterAsc):null}));for(var D=0;D<x.length;D++){var $=x[D];if($.enabled){if($.bounds){var E=$.pattern;switch(_=x._cachedPatterns[D],T=_[0],k=_[1],E){case Fs:L=new Date(g),S=L.getUTCDay(),T>k&&(k+=7,S<T&&(S+=7));break;case Is:L=new Date(g);var z=L.getUTCHours(),O=L.getUTCMinutes(),I=L.getUTCSeconds(),P=L.getUTCMilliseconds();S=z+(O/60+I/3600+P/36e5),T>k&&(k+=24,S<T&&(S+=24));break;case"":S=g;break}if(S>=T&&S<k)return Ta}else for(var M=x._cachedValues[D],A=0;A<M.length;A++)if(T=M[A],k=T+$.dvalue,g>=T&&g<k)return Ta}}return g},e.locateBreaks=function(g,x){var _,T,k,S,L=[];if(!e.rangebreaks)return L;var D=e.rangebreaks.slice().sort(function(N,H){return N.pattern===Fs&&H.pattern===Is?-1:H.pattern===Fs&&N.pattern===Is?1:0}),$=function(N,H){if(N=Vt.constrain(N,g,x),H=Vt.constrain(H,g,x),N!==H){for(var B=!0,X=0;X<L.length;X++){var j=L[X];N<j.max&&H>=j.min&&(N<j.min&&(j.min=N),H>j.max&&(j.max=H),B=!1)}B&&L.push({min:N,max:H})}};for(_=0;_<D.length;_++){var E=D[_];if(E.enabled)if(E.bounds){var z=g,O=x;E.pattern&&(z=Math.floor(z)),T=Vt.simpleMap(E.bounds,E.pattern?mi:e.r2l),k=T[0],S=T[1];var I=new Date(z),P,M;switch(E.pattern){case Fs:M=vD,P=((S<k?7:0)+(S-k))*Rs,z+=k*Rs-(I.getUTCDay()*Rs+I.getUTCHours()*Es+I.getUTCMinutes()*Ry+I.getUTCSeconds()*Ey+I.getUTCMilliseconds());break;case Is:M=Rs,P=((S<k?24:0)+(S-k))*Es,z+=k*Es-(I.getUTCHours()*Es+I.getUTCMinutes()*Ry+I.getUTCSeconds()*Ey+I.getUTCMilliseconds());break;default:z=Math.min(T[0],T[1]),O=Math.max(T[0],T[1]),M=O-z,P=M}for(var A=z;A<O;A+=M)$(A,A+P)}else for(var C=Vt.simpleMap(E.values,e.d2c),R=0;R<C.length;R++)k=C[R],S=k+E.dvalue,$(k,S)}return L.sort(function(N,H){return N.min-H.min}),L},e.makeCalcdata=function(g,x,_){var T,k,S,L,D=e.type,$=D==="date"&&g[x+"calendar"];if(x in g){if(T=g[x],L=g._length||Vt.minRowLength(T),Vt.isTypedArray(T)&&(D==="linear"||D==="log")){if(L===T.length)return T;if(T.subarray)return T.subarray(0,L)}if(D==="multicategory")return c(T,L);for(k=new Array(L),S=0;S<L;S++)k[S]=e.d2c(T[S],0,$,_)}else{var E=x+"0"in g?e.d2c(g[x+"0"],0,$):0,z=g["d"+x]?Number(g["d"+x]):1;for(T=g[{x:"y",y:"x"}[x]],L=g._length||T.length,k=new Array(L),S=0;S<L;S++)k[S]=E+S*z}if(e.rangebreaks)for(S=0;S<L;S++)k[S]=e.maskBreaks(k[S]);return k},e.isValidRange=function(g,x){return Array.isArray(g)&&g.length===2&&(x&&g[0]===null||Ha(e.r2l(g[0])))&&(x&&g[1]===null||Ha(e.r2l(g[1])))},e.getAutorangeDflt=function(g,x){var _=!e.isValidRange(g,"nullOk");return _&&x&&x.reverseDflt?_="reversed":g&&(g[0]===null&&g[1]===null?_=!0:g[0]===null&&g[1]!==null?_="min":g[0]!==null&&g[1]===null&&(_="max")),_},e.isReversed=function(){var g=e.autorange;return g==="reversed"||g==="min reversed"||g==="max reversed"},e.isPtWithinRange=function(g,x){var _=e.c2l(g[i],null,x),T=e.r2l(e.range[0]),k=e.r2l(e.range[1]);return T<k?T<=_&&_<=k:k<=_&&_<=T},e._emptyCategories=function(){e._categories=[],e._categoriesMap={}},e.clearCalc=function(){var g=e._matchGroup;if(g){var x=null,_=null;for(var T in g){var k=r[zs.id2name(T)];if(k._categories){x=k._categories,_=k._categoriesMap;break}}x&&_?(e._categories=x,e._categoriesMap=_):e._emptyCategories()}else e._emptyCategories();if(e._initialCategories)for(var S=0;S<e._initialCategories.length;S++)f(e._initialCategories[S])},e.sortByInitialCategories=function(){var g=[];if(e._emptyCategories(),e._initialCategories)for(var x=0;x<e._initialCategories.length;x++)f(e._initialCategories[x]);g=g.concat(e._traceIndices);var _=e._matchGroup;for(var T in _)if(a!==T){var k=r[zs.id2name(T)];k._categories=e._categories,k._categoriesMap=e._categoriesMap,g=g.concat(k._traceIndices)}return g};var w=r._d3locale;e.type==="date"&&(e._dateFormat=w?w.timeFormat:sD,e._extraFormat=r._extraFormat),e._separators=r.separators,e._numFormat=w?w.numberFormat:fD,delete e._minDtick,delete e._forceTick0},kw=wt,ap=me,dD=or.BADNUM,Gf=ap.isArrayOrTypedArray,hD=ap.isDateTime,pD=ap.cleanNumber,Aw=Math.round,Mw=function(e,r,a){var i=e,n=a.noMultiCategory;if(Gf(i)&&!i.length)return"-";if(!n&&xD(i))return"multicategory";if(n&&Array.isArray(i[0])){for(var o=[],l=0;l<i.length;l++)if(Gf(i[l]))for(var s=0;s<i[l].length;s++)o.push(i[l][s]);i=o}if(gD(i,r))return"date";var f=a.autotypenumbers!=="strict";return bD(i,f)?"category":yD(i,f)?"linear":"-"};function mD(t,e){return e?kw(t):typeof t=="number"}function yD(t,e){for(var r=t.length,a=0;a<r;a++)if(mD(t[a],e))return!0;return!1}function gD(t,e){for(var r=t.length,a=Sw(r),i=0,n=0,o={},l=0;l<r;l+=a){var s=Aw(l),f=t[s],c=String(f);o[c]||(o[c]=1,hD(f,e)&&i++,kw(f)&&n++)}return i>n*2}function Sw(t){return Math.max(1,(t-1)/1e3)}function bD(t,e){for(var r=t.length,a=Sw(r),i=0,n=0,o={},l=0;l<r;l+=a){var s=Aw(l),f=t[s],c=String(f);if(!o[c]){o[c]=1;var v=typeof f;v==="boolean"?n++:(e?pD(f)!==dD:v==="number")?i++:v==="string"&&n++}}return n>i*2}function xD(t){return Gf(t[0])&&Gf(t[1])}var _D=gt,Lw=wt,Pi=me,Af=or.FP_SAFE,wD=ot,TD=$t,Cw=lr,kD=Cw.getFromId,AD=Cw.isLinked,cs={applyAutorangeOptions:$w,getAutoRange:Cd,makePadFn:Dd,doAutoRange:SD,findExtremes:LD,concatExtremes:ip};function Cd(t,e){var r,a,i=[],n=t._fullLayout,o=Dd(n,e,0),l=Dd(n,e,1),s=ip(t,e),f=s.min,c=s.max;if(f.length===0||c.length===0)return Pi.simpleMap(e.range,e.r2l);var v=f[0].val,u=c[0].val;for(r=1;r<f.length&&v===u;r++)v=Math.min(v,f[r].val);for(r=1;r<c.length&&v===u;r++)u=Math.max(u,c[r].val);var h=e.autorange,d=h==="reversed"||h==="min reversed"||h==="max reversed";if(!d&&e.range){var p=Pi.simpleMap(e.range,e.r2l);d=p[1]<p[0]}e.autorange==="reversed"&&(e.autorange=!0);var m=e.rangemode,y=m==="tozero",b=m==="nonnegative",w=e._length,g=w/10,x=0,_,T,k,S,L,D;for(r=0;r<f.length;r++)for(_=f[r],a=0;a<c.length;a++)T=c[a],D=T.val-_.val-zy(e,_.val,T.val),D>0&&(L=w-o(_)-l(T),L>g?D/L>x&&(k=_,S=T,x=D/L):D/w>x&&(k={val:_.val,nopad:1},S={val:T.val,nopad:1},x=D/w));function $(P,M){return Math.max(P,l(M))}if(v===u){var E=v-1,z=v+1;if(y)if(v===0)i=[0,1];else{var O=(v>0?c:f).reduce($,0),I=v/(1-Math.min(.5,O/w));i=v>0?[0,I]:[I,0]}else b?i=[Math.max(0,E),Math.max(1,z)]:i=[E,z]}else y?(k.val>=0&&(k={val:0,nopad:1}),S.val<=0&&(S={val:0,nopad:1})):b&&(k.val-x*o(k)<0&&(k={val:0,nopad:1}),S.val<=0&&(S={val:1,nopad:1})),x=(S.val-k.val-zy(e,_.val,T.val))/(w-o(k)-l(S)),i=[k.val-x*o(k),S.val+x*l(S)];return i=$w(i,e),e.limitRange&&e.limitRange(),d&&i.reverse(),Pi.simpleMap(i,e.l2r||Number)}function zy(t,e,r){var a=0;if(t.rangebreaks)for(var i=t.locateBreaks(e,r),n=0;n<i.length;n++){var o=i[n];a+=o.max-o.min}return a}function Dd(t,e,r){var a=.05*e._length,i=e._anchorAxis||{};if((e.ticklabelposition||"").indexOf("inside")!==-1||(i.ticklabelposition||"").indexOf("inside")!==-1){var n=e.isReversed();if(!n){var o=Pi.simpleMap(e.range,e.r2l);n=o[1]<o[0]}n&&(r=!r)}var l=0;return AD(t,e._id)||(l=MD(t,e,r)),a=Math.max(l,a),e.constrain==="domain"&&e._inputDomain&&(a*=(e._inputDomain[1]-e._inputDomain[0])/(e.domain[1]-e.domain[0])),function(f){return f.nopad?0:f.pad+(f.extrapad?a:l)}}var Iy=3;function MD(t,e,r){var a=0,i=e._id.charAt(0)==="x";for(var n in t._plots){var o=t._plots[n];if(!(e._id!==o.xaxis._id&&e._id!==o.yaxis._id)){var l=(i?o.yaxis:o.xaxis)||{};if((l.ticklabelposition||"").indexOf("inside")!==-1&&(!r&&(l.side==="left"||l.side==="bottom")||r&&(l.side==="top"||l.side==="right"))){if(l._vals){var s=Pi.deg2rad(l._tickAngles[l._id+"tick"]||0),f=Math.abs(Math.cos(s)),c=Math.abs(Math.sin(s));if(!l._vals[0].bb){var v=l._id+"tick",u=l._selections[v];u.each(function(b){var w=_D.select(this),g=w.select(".text-math-group");g.empty()&&(b.bb=TD.bBox(w.node()))})}for(var h=0;h<l._vals.length;h++){var d=l._vals[h],p=d.bb;if(p){var m=2*Iy+p.width,y=2*Iy+p.height;a=Math.max(a,i?Math.max(m*f,y*c):Math.max(y*f,m*c))}}}l.ticks==="inside"&&l.ticklabelposition==="inside"&&(a+=l.ticklen||0)}}}return a}function ip(t,e,r){var a=e._id,i=t._fullData,n=t._fullLayout,o=[],l=[],s,f,c;function v(m,y){for(s=0;s<y.length;s++){var b=m[y[s]],w=(b._extremes||{})[a];if(b.visible===!0&&w){for(f=0;f<w.min.length;f++)c=w.min[f],$d(o,c.val,c.pad,{extrapad:c.extrapad});for(f=0;f<w.max.length;f++)c=w.max[f],Pd(l,c.val,c.pad,{extrapad:c.extrapad})}}}if(v(i,e._traceIndices),v(n.annotations||[],e._annIndices||[]),v(n.shapes||[],e._shapeIndices||[]),e._matchGroup&&!r){for(var u in e._matchGroup)if(u!==e._id){var h=kD(t,u),d=ip(t,h,!0),p=e._length/h._length;for(f=0;f<d.min.length;f++)c=d.min[f],$d(o,c.val,c.pad*p,{extrapad:c.extrapad});for(f=0;f<d.max.length;f++)c=d.max[f],Pd(l,c.val,c.pad*p,{extrapad:c.extrapad})}}return{min:o,max:l}}function SD(t,e,r){if(e.setScale(),e.autorange){e.range=r?r.slice():Cd(t,e),e._r=e.range.slice(),e._rl=Pi.simpleMap(e._r,e.r2l);var a=e._input,i={};i[e._attr+".range"]=e.range,i[e._attr+".autorange"]=e.autorange,wD.call("_storeDirectGUIEdit",t.layout,t._fullLayout._preGUI,i),a.range=e.range.slice(),a.autorange=e.autorange}var n=e._anchorAxis;if(n&&n.rangeslider){var o=n.rangeslider[e._name];o&&o.rangemode==="auto"&&(o.range=Cd(t,e)),n._input.rangeslider[e._name]=Pi.extendFlat({},o)}}function LD(t,e,r){r||(r={}),t._m||t.setScale();var a=[],i=[],n=e.length,o=r.padded||!1,l=r.tozero&&(t.type==="linear"||t.type==="-"),s=t.type==="log",f=!1,c=r.vpadLinearized||!1,v,u,h,d,p,m,y,b,w;function g($){if(Array.isArray($))return f=!0,function(z){return Math.max(Number($[z]||0),0)};var E=Math.max(Number($||0),0);return function(){return E}}var x=g((t._m>0?r.ppadplus:r.ppadminus)||r.ppad||0),_=g((t._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),T=g(r.vpadplus||r.vpad),k=g(r.vpadminus||r.vpad);if(!f){if(b=1/0,w=-1/0,s)for(v=0;v<n;v++)u=e[v],u<b&&u>0&&(b=u),u>w&&u<Af&&(w=u);else for(v=0;v<n;v++)u=e[v],u<b&&u>-Af&&(b=u),u>w&&u<Af&&(w=u);e=[b,w],n=2}var S={tozero:l,extrapad:o};function L($){h=e[$],Lw(h)&&(m=x($),y=_($),c?(d=t.c2l(h)-k($),p=t.c2l(h)+T($)):(b=h-k($),w=h+T($),s&&b<w/10&&(b=w/10),d=t.c2l(b),p=t.c2l(w)),l&&(d=Math.min(0,d),p=Math.max(0,p)),Fy(d)&&$d(a,d,y,S),Fy(p)&&Pd(i,p,m,S))}var D=Math.min(6,n);for(v=0;v<D;v++)L(v);for(v=n-1;v>=D;v--)L(v);return{min:a,max:i,opts:r}}function $d(t,e,r,a){Dw(t,e,r,a,CD)}function Pd(t,e,r,a){Dw(t,e,r,a,DD)}function Dw(t,e,r,a,i){for(var n=a.tozero,o=a.extrapad,l=!0,s=0;s<t.length&&l;s++){var f=t[s];if(i(f.val,e)&&f.pad>=r&&(f.extrapad||!o)){l=!1;break}else i(e,f.val)&&f.pad<=r&&(o||!f.extrapad)&&(t.splice(s,1),s--)}if(l){var c=n&&e===0;t.push({val:e,pad:c?0:r,extrapad:c?!1:o})}}function Fy(t){return Lw(t)&&Math.abs(t)<Af}function CD(t,e){return t<=e}function DD(t,e){return t>=e}function $D(t,e){var r=e.autorangeoptions;return r&&r.minallowed!==void 0&&Uf(e,r.minallowed,r.maxallowed)?r.minallowed:r&&r.clipmin!==void 0&&Uf(e,r.clipmin,r.clipmax)?Math.max(t,e.d2l(r.clipmin)):t}function PD(t,e){var r=e.autorangeoptions;return r&&r.maxallowed!==void 0&&Uf(e,r.minallowed,r.maxallowed)?r.maxallowed:r&&r.clipmax!==void 0&&Uf(e,r.clipmin,r.clipmax)?Math.min(t,e.d2l(r.clipmax)):t}function Uf(t,e,r){return e!==void 0&&r!==void 0?(e=t.d2l(e),r=t.d2l(r),e<r):!0}function $w(t,e){if(!e||!e.autorangeoptions)return t;var r=t[0],a=t[1],i=e.autorangeoptions.include;if(i!==void 0){var n=e.d2l(r),o=e.d2l(a);Pi.isArrayOrTypedArray(i)||(i=[i]);for(var l=0;l<i.length;l++){var s=e.d2l(i[l]);n>=s&&(n=s,r=s),o<=s&&(o=s,a=s)}}return r=$D(r,e),a=PD(a,e),[r,a]}var da=gt,nr=wt,go=cr,Nl=ot,yt=me,To=yt.strTranslate,_l=br,RD=Hc,Hl=ht,aa=$t,ED=Za,Ny=Fc,Fr=or,zD=Fr.ONEMAXYEAR,Vf=Fr.ONEAVGYEAR,Rd=Fr.ONEMINYEAR,ID=Fr.ONEMAXQUARTER,Ed=Fr.ONEAVGQUARTER,zd=Fr.ONEMINQUARTER,FD=Fr.ONEMAXMONTH,ko=Fr.ONEAVGMONTH,Id=Fr.ONEMINMONTH,ma=Fr.ONEWEEK,Br=Fr.ONEDAY,dn=Br/2,si=Fr.ONEHOUR,Xf=Fr.ONEMIN,Fd=Fr.ONESEC,hn=Fr.MINUS_SIGN,Oc=Fr.BADNUM,Nd={K:"zeroline"},Hd={K:"gridline",L:"path"},Od={K:"minor-gridline",L:"path"},Pw={K:"tick",L:"path"},Hy={K:"tick",L:"text"},Oy={width:["x","r","l","xl","xr"],height:["y","t","b","yt","yb"],right:["r","xr"],left:["l","xl"],top:["t","yt"],bottom:["b","yb"]},jc=Ur,Ns=jc.MID_SHIFT,pn=jc.CAP_SHIFT,Yf=jc.LINE_SPACING,ND=jc.OPPOSITE_SIDE,Wf=3,Se=W_.exports={};Se.setConvert=rp;var HD=Mw,ci=lr,OD=ci.idSort,jD=ci.isLinked;Se.id2name=ci.id2name;Se.name2id=ci.name2id;Se.cleanId=ci.cleanId;Se.list=ci.list;Se.listIds=ci.listIds;Se.getFromId=ci.getFromId;Se.getFromTrace=ci.getFromTrace;var Rw=cs;Se.getAutoRange=Rw.getAutoRange;Se.findExtremes=Rw.findExtremes;var BD=1e-4;function np(t){var e=(t[1]-t[0])*BD;return[t[0]-e,t[1]+e]}Se.coerceRef=function(t,e,r,a,i,n){var o=a.charAt(a.length-1),l=r._fullLayout._subplots[o+"axis"],s=a+"ref",f={};return i||(i=l[0]||(typeof n=="string"?n:n[0])),n||(n=i),l=l.concat(l.map(function(c){return c+" domain"})),f[s]={valType:"enumerated",values:l.concat(n?typeof n=="string"?[n]:n:[]),dflt:i},yt.coerce(t,e,f,s)};Se.getRefType=function(t){return t===void 0?t:t==="paper"?"paper":t==="pixel"?"pixel":/( domain)$/.test(t)?"domain":"range"};Se.coercePosition=function(t,e,r,a,i,n){var o,l,s=Se.getRefType(a);if(s!=="range")o=yt.ensureNumber,l=r(i,n);else{var f=Se.getFromId(e,a);n=f.fraction2r(n),l=r(i,n),o=f.cleanPos}t[i]=o(l)};Se.cleanPosition=function(t,e,r){var a=r==="paper"||r==="pixel"?yt.ensureNumber:Se.getFromId(e,r).cleanPos;return a(t)};Se.redrawComponents=function(t,e){e=e||Se.listIds(t);var r=t._fullLayout;function a(i,n,o,l){for(var s=Nl.getComponentMethod(i,n),f={},c=0;c<e.length;c++)for(var v=r[Se.id2name(e[c])],u=v[o],h=0;h<u.length;h++){var d=u[h];if(!f[d]&&(s(t,d),f[d]=1,l))return}}a("annotations","drawOne","_annIndices"),a("shapes","drawOne","_shapeIndices"),a("images","draw","_imgIndices",!0),a("selections","drawOne","_selectionIndices")};var GD=Se.getDataConversions=function(t,e,r,a){var i,n=r==="x"||r==="y"||r==="z"?r:a;if(Array.isArray(n)){if(i={type:HD(a,void 0,{autotypenumbers:t._fullLayout.autotypenumbers}),_categories:[]},Se.setConvert(i),i.type==="category")for(var o=0;o<a.length;o++)i.d2c(a[o])}else i=Se.getFromTrace(t,e,n);return i?{d2c:i.d2c,c2d:i.c2d}:n==="ids"?{d2c:By,c2d:By}:{d2c:jy,c2d:jy}};function jy(t){return+t}function By(t){return String(t)}Se.getDataToCoordFunc=function(t,e,r,a){return GD(t,e,r,a).d2c};Se.counterLetter=function(t){var e=t.charAt(0);if(e==="x")return"y";if(e==="y")return"x"};Se.minDtick=function(t,e,r,a){["log","category","multicategory"].indexOf(t.type)!==-1||!a?t._minDtick=0:t._minDtick===void 0?(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))};Se.saveRangeInitial=function(t,e){for(var r=Se.list(t,"",!0),a=!1,i=0;i<r.length;i++){var n=r[i],o=n._rangeInitial0===void 0&&n._rangeInitial1===void 0,l=o||n.range[0]!==n._rangeInitial0||n.range[1]!==n._rangeInitial1,s=n.autorange;(o&&s!==!0||e&&l)&&(n._rangeInitial0=s==="min"||s==="max reversed"?void 0:n.range[0],n._rangeInitial1=s==="max"||s==="min reversed"?void 0:n.range[1],n._autorangeInitial=s,a=!0)}return a};Se.saveShowSpikeInitial=function(t,e){for(var r=Se.list(t,"",!0),a=!1,i="on",n=0;n<r.length;n++){var o=r[n],l=o._showSpikeInitial===void 0,s=l||o.showspikes!==o._showspikes;(l||e&&s)&&(o._showSpikeInitial=o.showspikes,a=!0),i==="on"&&!o.showspikes&&(i="off")}return t._fullLayout._cartesianSpikesEnabled=i,a};Se.autoBin=function(t,e,r,a,i,n){var o=yt.aggNums(Math.min,null,t),l=yt.aggNums(Math.max,null,t);if(e.type==="category"||e.type==="multicategory")return{start:o-.5,end:l+.5,size:Math.max(1,Math.round(n)||1),_dataSpan:l-o};i||(i=e.calendar);var s;if(e.type==="log"?s={type:"linear",range:[o,l]}:s={type:e.type,range:yt.simpleMap([o,l],e.c2r,0,i),calendar:i},Se.setConvert(s),n=n&&Ny.dtick(n,s.type),n)s.dtick=n,s.tick0=Ny.tick0(void 0,s.type,i);else{var f;if(r)f=(l-o)/r;else{var c=yt.distinctVals(t),v=Math.pow(10,Math.floor(Math.log(c.minDiff)/Math.LN10)),u=v*yt.roundUp(c.minDiff/v,[.9,1.9,4.9,9.9],!0);f=Math.max(u,2*yt.stdev(t)/Math.pow(t.length,a?.25:.4)),nr(f)||(f=1)}Se.autoTicks(s,f)}var h=s.dtick,d=Se.tickIncrement(Se.tickFirst(s),h,"reverse",i),p,m;if(typeof h=="number")d=UD(d,t,s,o,l),m=1+Math.floor((l-d)/h),p=d+m*h;else for(s.dtick.charAt(0)==="M"&&(d=VD(d,t,h,o,i)),p=d,m=0;p<=l;)p=Se.tickIncrement(p,h,!1,i),m++;return{start:e.c2r(d,0,i),end:e.c2r(p,0,i),size:h,_dataSpan:l-o}};function UD(t,e,r,a,i){var n=0,o=0,l=0,s=0;function f(h){return(1+(h-t)*100/r.dtick)%100<2}for(var c=0;c<e.length;c++)e[c]%1===0?l++:nr(e[c])||s++,f(e[c])&&n++,f(e[c]+r.dtick/2)&&o++;var v=e.length-s;if(l===v&&r.type!=="date")r.dtick<1?t=a-.5*r.dtick:(t-=.5,t+r.dtick<a&&(t+=r.dtick));else if(o<v*.1&&(n>v*.3||f(a)||f(i))){var u=r.dtick/2;t+=t+u<a?u:-u}return t}function VD(t,e,r,a,i){var n=yt.findExactDates(e,i),o=.8;if(n.exactDays>o){var l=Number(r.substr(1));n.exactYears>o&&l%12===0?t=Se.tickIncrement(t,"M6","reverse")+Br*1.5:n.exactMonths>o?t=Se.tickIncrement(t,"M1","reverse")+Br*15.5:t-=dn;var s=Se.tickIncrement(t,r);if(s<=a)return s}return t}Se.prepMinorTicks=function(t,e,r){if(!e.minor.dtick){delete t.dtick;var a=e.dtick&&nr(e._tmin),i;if(a){var n=Se.tickIncrement(e._tmin,e.dtick,!0);i=[e._tmin,n*.99+e._tmin*.01]}else{var o=yt.simpleMap(e.range,e.r2l);i=[o[0],.8*o[0]+.2*o[1]]}if(t.range=yt.simpleMap(i,e.l2r),t._isMinor=!0,Se.prepTicks(t,r),a){var l=nr(e.dtick),s=nr(t.dtick),f=l?e.dtick:+e.dtick.substring(1),c=s?t.dtick:+t.dtick.substring(1);l&&s?Nu(f,c)?f===2*ma&&c===2*Br&&(t.dtick=ma):f===2*ma&&c===3*Br?t.dtick=ma:f===ma&&!(e._input.minor||{}).nticks?t.dtick=Br:Gy(f/c,2.5)?t.dtick=f/2:t.dtick=f:String(e.dtick).charAt(0)==="M"?s?t.dtick="M1":Nu(f,c)?f>=12&&c===2&&(t.dtick="M3"):t.dtick=e.dtick:String(t.dtick).charAt(0)==="L"?String(e.dtick).charAt(0)==="L"?Nu(f,c)||(t.dtick=Gy(f/c,2.5)?e.dtick/2:e.dtick):t.dtick="D1":t.dtick==="D2"&&+e.dtick>1&&(t.dtick=1)}t.range=e.range}e.minor._tick0Init===void 0&&(t.tick0=e.tick0)};function Nu(t,e){return Math.abs((t/e+.5)%1-.5)<.001}function Gy(t,e){return Math.abs(t/e-1)<.001}Se.prepTicks=function(t,e){var r=yt.simpleMap(t.range,t.r2l,void 0,void 0,e);if(t.tickmode==="auto"||!t.dtick){var a=t.nticks,i;a||(t.type==="category"||t.type==="multicategory"?(i=t.tickfont?yt.bigFont(t.tickfont.size||12):15,a=t._length/i):(i=t._id.charAt(0)==="y"?40:80,a=yt.constrain(t._length/i,4,9)+1),t._name==="radialaxis"&&(a*=2)),t.minor&&t.minor.tickmode!=="array"||t.tickmode==="array"&&(a*=100),t._roughDTick=Math.abs(r[1]-r[0])/a,Se.autoTicks(t,t._roughDTick),t._minDtick>0&&t.dtick<t._minDtick*2&&(t.dtick=t._minDtick,t.tick0=t.l2r(t._forceTick0))}t.ticklabelmode==="period"&&XD(t),t.tick0||(t.tick0=t.type==="date"?"2000-01-01":0),t.type==="date"&&t.dtick<.1&&(t.dtick=.1),Fw(t)};function Hu(t){return+t.substring(1)}function XD(t){var e;function r(){return!(nr(t.dtick)||t.dtick.charAt(0)!=="M")}var a=r(),i=Se.getTickFormat(t);if(i){var n=t._dtickInit!==t.dtick;/%[fLQsSMX]/.test(i)||(/%[HI]/.test(i)?(e=si,n&&!a&&t.dtick<si&&(t.dtick=si)):/%p/.test(i)?(e=dn,n&&!a&&t.dtick<dn&&(t.dtick=dn)):/%[Aadejuwx]/.test(i)?(e=Br,n&&!a&&t.dtick<Br&&(t.dtick=Br)):/%[UVW]/.test(i)?(e=ma,n&&!a&&t.dtick<ma&&(t.dtick=ma)):/%[Bbm]/.test(i)?(e=ko,n&&(a?Hu(t.dtick)<1:t.dtick<Id)&&(t.dtick="M1")):/%[q]/.test(i)?(e=Ed,n&&(a?Hu(t.dtick)<3:t.dtick<zd)&&(t.dtick="M3")):/%[Yy]/.test(i)&&(e=Vf,n&&(a?Hu(t.dtick)<12:t.dtick<Rd)&&(t.dtick="M12")))}a=r(),a&&t.tick0===t._dowTick0&&(t.tick0=t._rawTick0),t._definedDelta=e}function YD(t,e,r){for(var a=0;a<t.length;a++){var i=t[a].value,n=a,o=a+1;a<t.length-1?(n=a,o=a+1):a>0?(n=a-1,o=a):(n=a,o=a);var l=t[n].value,s=t[o].value,f=Math.abs(s-l),c=r||f,v=0;c>=Rd?f>=Rd&&f<=zD?v=f:v=Vf:r===Ed&&c>=zd?f>=zd&&f<=ID?v=f:v=Ed:c>=Id?f>=Id&&f<=FD?v=f:v=ko:r===ma&&c>=ma?v=ma:c>=Br?v=Br:r===dn&&c>=dn?v=dn:r===si&&c>=si&&(v=si);var u;v>=f&&(v=f,u=!0);var h=i+v;if(e.rangebreaks&&v>0){for(var d=84,p=0,m=0;m<d;m++){var y=(m+.5)/d;e.maskBreaks(i*(1-y)+y*h)!==Oc&&p++}v*=p/d,v||(t[a].drop=!0),u&&f>ma&&(v=f)}(v>0||a===0)&&(t[a].periodX=i+v/2)}}Se.calcTicks=function(e,r){for(var a=e.type,i=e.calendar,n=e.ticklabelstep,o=e.ticklabelmode==="period",l=yt.simpleMap(e.range,e.r2l,void 0,void 0,r),s=l[1]<l[0],f=Math.min(l[0],l[1]),c=Math.max(l[0],l[1]),v=Math.max(1e3,e._length||0),u=[],h=[],d=[],p=[],m=e.minor&&(e.minor.ticks||e.minor.showgrid),y=1;y>=(m?0:1);y--){var b=!y;y?(e._dtickInit=e.dtick,e._tick0Init=e.tick0):(e.minor._dtickInit=e.minor.dtick,e.minor._tick0Init=e.minor.tick0);var w=y?e:yt.extendFlat({},e,e.minor);if(b?Se.prepMinorTicks(w,e,r):Se.prepTicks(w,r),w.tickmode==="array"){y?(d=[],u=Uy(e)):(p=[],h=Uy(e));continue}if(w.tickmode==="sync"){d=[],u=WD(e);continue}var g=np(l),x=g[0],_=g[1],T=nr(w.dtick),k=a==="log"&&!(T||w.dtick.charAt(0)==="L"),S=Se.tickFirst(w,r);if(y){if(e._tmin=S,S<x!==s)break;(a==="category"||a==="multicategory")&&(_=s?Math.max(-.5,_):Math.min(e._categories.length-.5,_))}var L=null,D=S,$;if(y){var E;T?E=e.dtick:a==="date"?typeof e.dtick=="string"&&e.dtick.charAt(0)==="M"&&(E=ko*e.dtick.substring(1)):E=e._roughDTick,$=Math.round((e.r2l(D)-e.r2l(e.tick0))/E)-1}var z=w.dtick;for(w.rangebreaks&&w._tick0Init!==w.tick0&&(D=Ou(D,e),s||(D=Se.tickIncrement(D,z,!s,i))),y&&o&&(D=Se.tickIncrement(D,z,!s,i),$--);s?D>=_:D<=_;D=Se.tickIncrement(D,z,s,i)){if(y&&$++,w.rangebreaks&&!s){if(D<x)continue;if(w.maskBreaks(D)===Oc&&Ou(D,w)>=c)break}if(d.length>v||D===L)break;L=D;var O={value:D};y?(k&&D!==(D|0)&&(O.simpleLabel=!0),n>1&&$%n&&(O.skipLabel=!0),d.push(O)):(O.minor=!0,p.push(O))}}if(m){var I=e.minor.ticks==="inside"&&e.ticks==="outside"||e.minor.ticks==="outside"&&e.ticks==="inside";if(!I){for(var P=d.map(function(G){return G.value}),M=[],A=0;A<p.length;A++){var C=p[A],R=C.value;if(P.indexOf(R)===-1){for(var N=!1,H=0;!N&&H<d.length;H++)1e7+d[H].value===1e7+R&&(N=!0);N||M.push(C)}}p=M}}o&&YD(d,e,e._definedDelta);var B;if(e.rangebreaks){var X=e._id.charAt(0)==="y",j=1;e.tickmode==="auto"&&(j=e.tickfont?e.tickfont.size:12);var q=NaN;for(B=d.length-1;B>-1;B--){if(d[B].drop){d.splice(B,1);continue}d[B].value=Ou(d[B].value,e);var U=e.c2p(d[B].value);(X?q>U-j:q<U+j)?d.splice(s?B+1:B,1):q=U}}fp(e)&&Math.abs(l[1]-l[0])===360&&d.pop(),e._tmax=(d[d.length-1]||{}).value,e._prevDateHead="",e._inCalcTicks=!0;var Z,K=function(G){G.text="",e._prevDateHead=Z};d=d.concat(p);var ee,le;for(B=0;B<d.length;B++){var ye=d[B].minor,se=d[B].value;ye?h.push({x:se,minor:!0}):(Z=e._prevDateHead,ee=Se.tickText(e,se,!1,d[B].simpleLabel),le=d[B].periodX,le!==void 0&&(ee.periodX=le,(le>c||le<f)&&(le>c&&(ee.periodX=c),le<f&&(ee.periodX=f),K(ee))),d[B].skipLabel&&K(ee),u.push(ee))}return u=u.concat(h),e._inCalcTicks=!1,o&&u.length&&(u[0].noTick=!0),u};function Ew(t,e){return t.rangebreaks&&(e=e.filter(function(r){return t.maskBreaks(r.x)!==Oc})),e}function WD(t){var e=t._mainAxis,r=[];if(e._vals){for(var a=0;a<e._vals.length;a++)if(!e._vals[a].noTick){var i=e.l2p(e._vals[a].x),n=t.p2l(i),o=Se.tickText(t,n);e._vals[a].minor&&(o.minor=!0,o.text=""),r.push(o)}}return r=Ew(t,r),r}function Uy(t){var e=yt.simpleMap(t.range,t.r2l),r=np(e),a=Math.min(r[0],r[1]),i=Math.max(r[0],r[1]),n=t.type==="category"?t.d2l_noadd:t.d2l;t.type==="log"&&String(t.dtick).charAt(0)!=="L"&&(t.dtick="L"+Math.pow(10,Math.floor(Math.min(t.range[0],t.range[1]))-1));for(var o=[],l=0;l<=1;l++)if(!(l&&!t.minor)){var s=l?t.minor.tickvals:t.tickvals,f=l?[]:t.ticktext;if(s){Array.isArray(f)||(f=[]);for(var c=0;c<s.length;c++){var v=n(s[c]);if(v>a&&v<i){var u=f[c]===void 0?Se.tickText(t,v):op(t,v,String(f[c]));l&&(u.minor=!0,u.text=""),o.push(u)}}}}return o=Ew(t,o),o}var Hs=[2,5,10],Vy=[1,2,3,6,12],Xy=[1,2,5,10,15,30],qD=[1,2,3,7,14],zw=[-.046,0,.301,.477,.602,.699,.778,.845,.903,.954,1],Iw=[-.301,0,.301,.699,1],ZD=[15,30,45,90,180];function ja(t,e,r){return e*yt.roundUp(t/e,r)}Se.autoTicks=function(t,e,r){var a;function i(v){return Math.pow(v,Math.floor(Math.log(e)/Math.LN10))}if(t.type==="date"){t.tick0=yt.dateTick0(t.calendar,0);var n=2*e;if(n>Vf)e/=Vf,a=i(10),t.dtick="M"+12*ja(e,a,Hs);else if(n>ko)e/=ko,t.dtick="M"+ja(e,1,Vy);else if(n>Br){if(t.dtick=ja(e,Br,t._hasDayOfWeekBreaks?[1,2,7,14]:qD),!r){var o=Se.getTickFormat(t),l=t.ticklabelmode==="period";l&&(t._rawTick0=t.tick0),/%[uVW]/.test(o)?t.tick0=yt.dateTick0(t.calendar,2):t.tick0=yt.dateTick0(t.calendar,1),l&&(t._dowTick0=t.tick0)}}else n>si?t.dtick=ja(e,si,Vy):n>Xf?t.dtick=ja(e,Xf,Xy):n>Fd?t.dtick=ja(e,Fd,Xy):(a=i(10),t.dtick=ja(e,a,Hs))}else if(t.type==="log"){t.tick0=0;var s=yt.simpleMap(t.range,t.r2l);if(t._isMinor&&(e*=1.5),e>.7)t.dtick=Math.ceil(e);else if(Math.abs(s[1]-s[0])<1){var f=1.5*Math.abs((s[1]-s[0])/e);e=Math.abs(Math.pow(10,s[1])-Math.pow(10,s[0]))/f,a=i(10),t.dtick="L"+ja(e,a,Hs)}else t.dtick=e>.3?"D2":"D1"}else t.type==="category"||t.type==="multicategory"?(t.tick0=0,t.dtick=Math.ceil(Math.max(e,1))):fp(t)?(t.tick0=0,a=1,t.dtick=ja(e,a,ZD)):(t.tick0=0,a=i(10),t.dtick=ja(e,a,Hs));if(t.dtick===0&&(t.dtick=1),!nr(t.dtick)&&typeof t.dtick!="string"){var c=t.dtick;throw t.dtick=1,"ax.dtick error: "+String(c)}};function Fw(t){var e=t.dtick;if(t._tickexponent=0,!nr(e)&&typeof e!="string"&&(e=1),(t.type==="category"||t.type==="multicategory")&&(t._tickround=null),t.type==="date"){var r=t.r2l(t.tick0),a=t.l2r(r).replace(/(^-|i)/g,""),i=a.length;if(String(e).charAt(0)==="M")i>10||a.substr(5)!=="01-01"?t._tickround="d":t._tickround=+e.substr(1)%12===0?"y":"m";else if(e>=Br&&i<=10||e>=Br*15)t._tickround="d";else if(e>=Xf&&i<=16||e>=si)t._tickround="M";else if(e>=Fd&&i<=19||e>=Xf)t._tickround="S";else{var n=t.l2r(r+e).replace(/^-/,"").length;t._tickround=Math.max(i,n)-20,t._tickround<0&&(t._tickround=4)}}else if(nr(e)||e.charAt(0)==="L"){var o=t.range.map(t.r2d||Number);nr(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),f=t.minexponent===void 0?3:t.minexponent;Math.abs(s)>f&&(qf(t.exponentformat)&&!lp(s)?t._tickexponent=3*Math.round((s-1)/3):t._tickexponent=s)}else t._tickround=null}Se.tickIncrement=function(t,e,r,a){var i=r?-1:1;if(nr(e))return yt.increment(t,i*e);var n=e.charAt(0),o=i*Number(e.substr(1));if(n==="M")return yt.incrementMonth(t,o,a);if(n==="L")return Math.log(Math.pow(10,t)+o)/Math.LN10;if(n==="D"){var l=e==="D2"?Iw:zw,s=t+i*.01,f=yt.roundUp(yt.mod(s,1),l,r);return Math.floor(s)+Math.log(da.round(Math.pow(10,f),1))/Math.LN10}throw"unrecognized dtick "+String(e)};Se.tickFirst=function(t,e){var r=t.r2l||Number,a=yt.simpleMap(t.range,r,void 0,void 0,e),i=a[1]<a[0],n=i?Math.floor:Math.ceil,o=np(a)[0],l=t.dtick,s=r(t.tick0);if(nr(l)){var f=n((o-s)/l)*l+s;return(t.type==="category"||t.type==="multicategory")&&(f=yt.constrain(f,0,t._categories.length-1)),f}var c=l.charAt(0),v=Number(l.substr(1));if(c==="M"){for(var u=0,h=s,d,p,m;u<10;){if(d=Se.tickIncrement(h,l,i,t.calendar),(d-o)*(h-o)<=0)return i?Math.min(h,d):Math.max(h,d);p=(o-(h+d)/2)/(d-h),m=c+(Math.abs(Math.round(p))||1)*v,h=Se.tickIncrement(h,m,p<0?!i:i,t.calendar),u++}return yt.error("tickFirst did not converge",t),h}else{if(c==="L")return Math.log(n((Math.pow(10,o)-s)/v)*v+s)/Math.LN10;if(c==="D"){var y=l==="D2"?Iw:zw,b=yt.roundUp(yt.mod(o,1),y,i);return Math.floor(o)+Math.log(da.round(Math.pow(10,b),1))/Math.LN10}else throw"unrecognized dtick "+String(l)}};Se.tickText=function(t,e,r,a){var i=op(t,e),n=t.tickmode==="array",o=r||n,l=t.type,s=l==="category"?t.d2l_noadd:t.d2l,f;if(n&&Array.isArray(t.ticktext)){var c=yt.simpleMap(t.range,t.r2l),v=(Math.abs(c[1]-c[0])-(t._lBreaks||0))/1e4;for(f=0;f<t.ticktext.length&&!(Math.abs(e-s(t.tickvals[f]))<v);f++);if(f<t.ticktext.length)return i.text=String(t.ticktext[f]),i}function u(m){if(m===void 0)return!0;if(r)return m==="none";var y={first:t._tmin,last:t._tmax}[m];return m!=="all"&&e!==y}var h=r?"never":t.exponentformat!=="none"&&u(t.showexponent)?"hide":"";if(l==="date"?KD(t,i,r,o):l==="log"?QD(t,i,r,o,h):l==="category"?JD(t,i):l==="multicategory"?e5(t,i,r):fp(t)?r5(t,i,r,o,h):t5(t,i,r,o,h),a||(t.tickprefix&&!u(t.showtickprefix)&&(i.text=t.tickprefix+i.text),t.ticksuffix&&!u(t.showticksuffix)&&(i.text+=t.ticksuffix)),t.labelalias&&t.labelalias.hasOwnProperty(i.text)){var d=t.labelalias[i.text];typeof d=="string"&&(i.text=d)}if(t.tickson==="boundaries"||t.showdividers){var p=function(m){var y=t.l2p(m);return y>=0&&y<=t._length?m:null};i.xbnd=[p(i.x-.5),p(i.x+t.dtick-.5)]}return i};Se.hoverLabelText=function(t,e,r){r&&(t=yt.extendFlat({},t,{hoverformat:r}));var a=Array.isArray(e)?e[0]:e,i=Array.isArray(e)?e[1]:void 0;if(i!==void 0&&i!==a)return Se.hoverLabelText(t,a,r)+" - "+Se.hoverLabelText(t,i,r);var n=t.type==="log"&&a<=0,o=Se.tickText(t,t.c2l(n?-a:a),"hover").text;return n?a===0?"0":hn+o:o};function op(t,e,r){var a=t.tickfont||{};return{x:e,dx:0,dy:0,text:r||"",fontSize:a.size,font:a.family,fontColor:a.color}}function KD(t,e,r,a){var i=t._tickround,n=r&&t.hoverformat||Se.getTickFormat(t);a=!n&&a,a&&(nr(i)?i=4:i={y:"m",m:"d",d:"M",M:"S",S:4}[i]);var o=yt.formatDate(e.x,n,i,t._dateFormat,t.calendar,t._extraFormat),l,s=o.indexOf(`
4
+ `);if(s!==-1&&(l=o.substr(s+1),o=o.substr(0,s)),a&&(l!==void 0&&(o==="00:00:00"||o==="00:00")?(o=l,l=""):o.length===8&&(o=o.replace(/:00$/,""))),l)if(r)i==="d"?o+=", "+l:o=l+(o?", "+o:"");else if(!t._inCalcTicks||t._prevDateHead!==l)t._prevDateHead=l,o+="<br>"+l;else{var f=jl(t),c=t._trueSide||t.side;(!f&&c==="top"||f&&c==="bottom")&&(o+="<br> ")}e.text=o}function QD(t,e,r,a,i){var n=t.dtick,o=e.x,l=t.tickformat,s=typeof n=="string"&&n.charAt(0);if(i==="never"&&(i=""),a&&s!=="L"&&(n="L3",s="L"),l||s==="L")e.text=Ol(Math.pow(10,o),t,i,a);else if(nr(n)||s==="D"&&yt.mod(o+.01,1)<.1){var f=Math.round(o),c=Math.abs(f),v=t.exponentformat;v==="power"||qf(v)&&lp(f)?(f===0?e.text=1:f===1?e.text="10":e.text="10<sup>"+(f>1?"":hn)+c+"</sup>",e.fontSize*=1.25):(v==="e"||v==="E")&&c>2?e.text="1"+v+(f>0?"+":hn)+c:(e.text=Ol(Math.pow(10,o),t,"","fakehover"),n==="D1"&&t._id.charAt(0)==="y"&&(e.dy-=e.fontSize/6))}else if(s==="D")e.text=String(Math.round(Math.pow(10,yt.mod(o,1)))),e.fontSize*=.75;else throw"unrecognized dtick "+String(n);if(t.dtick==="D1"){var u=String(e.text).charAt(0);(u==="0"||u==="1")&&(t._id.charAt(0)==="y"?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 JD(t,e){var r=t._categories[Math.round(e.x)];r===void 0&&(r=""),e.text=String(r)}function e5(t,e,r){var a=Math.round(e.x),i=t._categories[a]||[],n=i[1]===void 0?"":String(i[1]),o=i[0]===void 0?"":String(i[0]);r?e.text=o+" - "+n:(e.text=n,e.text2=o)}function t5(t,e,r,a,i){i==="never"?i="":t.showexponent==="all"&&Math.abs(e.x/t.dtick)<1e-6&&(i="hide"),e.text=Ol(e.x,t,i,a)}function r5(t,e,r,a,i){if(t.thetaunit==="radians"&&!r){var n=e.x/180;if(n===0)e.text="0";else{var o=a5(n);if(o[1]>=100)e.text=Ol(yt.deg2rad(e.x),t,i,a);else{var l=e.x<0;o[1]===1?o[0]===1?e.text="π":e.text=o[0]+"π":e.text=["<sup>",o[0],"</sup>","⁄","<sub>",o[1],"</sub>","π"].join(""),l&&(e.text=hn+e.text)}}}else e.text=Ol(e.x,t,i,a)}function a5(t){function e(l,s){return Math.abs(l-s)<=1e-6}function r(l,s){return e(s,0)?l:r(s,l%s)}function a(l){for(var s=1;!e(Math.round(l*s)/s,l);)s*=10;return s}var i=a(t),n=t*i,o=Math.abs(r(n,i));return[Math.round(n/o),Math.round(i/o)]}var i5=["f","p","n","μ","m","","k","M","G","T"];function qf(t){return t==="SI"||t==="B"}function lp(t){return t>14||t<-15}function Ol(t,e,r,a){var i=t<0,n=e._tickround,o=r||e.exponentformat||"B",l=e._tickexponent,s=Se.getTickFormat(e),f=e.separatethousands;if(a){var c={exponentformat:o,minexponent:e.minexponent,dtick:e.showexponent==="none"?e.dtick:nr(t)&&Math.abs(t)||1,range:e.showexponent==="none"?e.range.map(e.r2d):[0,t||1]};Fw(c),n=(Number(c._tickround)||0)+4,l=c._tickexponent,e.hoverformat&&(s=e.hoverformat)}if(s)return e._numFormat(s)(t).replace(/-/g,hn);var v=Math.pow(10,-n)/2;if(o==="none"&&(l=0),t=Math.abs(t),t<v)t="0",i=!1;else{if(t+=v,l&&(t*=Math.pow(10,-l),n+=l),n===0)t=String(Math.floor(t));else if(n<0){t=String(Math.round(t)),t=t.substr(0,t.length+n);for(var u=n;u<0;u++)t+="0"}else{t=String(t);var h=t.indexOf(".")+1;h&&(t=t.substr(0,h+n).replace(/\.?0+$/,""))}t=yt.numSeparate(t,e._separators,f)}if(l&&o!=="hide"){qf(o)&&lp(l)&&(o="power");var d;l<0?d=hn+-l:o!=="power"?d="+"+l:d=String(l),o==="e"||o==="E"?t+=o+d:o==="power"?t+="×10<sup>"+d+"</sup>":o==="B"&&l===9?t+="B":qf(o)&&(t+=i5[l/3+5])}return i?hn+t:t}Se.getTickFormat=function(t){var e;function r(s){return typeof s!="string"?s:Number(s.replace("M",""))*ko}function a(s,f){var c=["L","D"];if(typeof s==typeof f){if(typeof s=="number")return s-f;var v=c.indexOf(s.charAt(0)),u=c.indexOf(f.charAt(0));return v===u?Number(s.replace(/(L|D)/g,""))-Number(f.replace(/(L|D)/g,"")):v-u}else return typeof s=="number"?1:-1}function i(s,f,c){var v=c||function(d){return d},u=f[0],h=f[1];return(!u&&typeof u!="number"||v(u)<=v(s))&&(!h&&typeof h!="number"||v(h)>=v(s))}function n(s,f){var c=f[0]===null,v=f[1]===null,u=a(s,f[0])>=0,h=a(s,f[1])<=0;return(c||u)&&(v||h)}var o,l;if(t.tickformatstops&&t.tickformatstops.length>0)switch(t.type){case"date":case"linear":{for(e=0;e<t.tickformatstops.length;e++)if(l=t.tickformatstops[e],l.enabled&&i(t.dtick,l.dtickrange,r)){o=l;break}break}case"log":{for(e=0;e<t.tickformatstops.length;e++)if(l=t.tickformatstops[e],l.enabled&&n(t.dtick,l.dtickrange)){o=l;break}break}}return o?o.value:t.tickformat};Se.getSubplots=function(t,e){var r=t._fullLayout._subplots,a=r.cartesian.concat(r.gl2d||[]),i=e?Se.findSubplotsWithAxis(a,e):a;return i.sort(function(n,o){var l=n.substr(1).split("y"),s=o.substr(1).split("y");return l[0]===s[0]?+l[1]-+s[1]:+l[0]-+s[0]}),i};Se.findSubplotsWithAxis=function(t,e){for(var r=new RegExp(e._id.charAt(0)==="x"?"^"+e._id+"y":e._id+"$"),a=[],i=0;i<t.length;i++){var n=t[i];r.test(n)&&a.push(n)}return a};Se.makeClipPaths=function(t){var e=t._fullLayout;if(!e._hasOnlyLargeSploms){var r={_offset:0,_length:e.width,_id:""},a={_offset:0,_length:e.height,_id:""},i=Se.list(t,"x",!0),n=Se.list(t,"y",!0),o=[],l,s;for(l=0;l<i.length;l++)for(o.push({x:i[l],y:a}),s=0;s<n.length;s++)l===0&&o.push({x:r,y:n[s]}),o.push({x:i[l],y:n[s]});var f=e._clips.selectAll(".axesclip").data(o,function(c){return c.x._id+c.y._id});f.enter().append("clipPath").classed("axesclip",!0).attr("id",function(c){return"clip"+e._uid+c.x._id+c.y._id}).append("rect"),f.exit().remove(),f.each(function(c){da.select(this).select("rect").attr({x:c.x._offset||0,y:c.y._offset||0,width:c.x._length||1,height:c.y._length||1})})}};Se.draw=function(t,e,r){var a=t._fullLayout;e==="redraw"&&a._paper.selectAll("g.subplot").each(function(s){var f=s[0],c=a._plots[f];if(c){var v=c.xaxis,u=c.yaxis;c.xaxislayer.selectAll("."+v._id+"tick").remove(),c.yaxislayer.selectAll("."+u._id+"tick").remove(),c.xaxislayer.selectAll("."+v._id+"tick2").remove(),c.yaxislayer.selectAll("."+u._id+"tick2").remove(),c.xaxislayer.selectAll("."+v._id+"divider").remove(),c.yaxislayer.selectAll("."+u._id+"divider").remove(),c.minorGridlayer&&c.minorGridlayer.selectAll("path").remove(),c.gridlayer&&c.gridlayer.selectAll("path").remove(),c.zerolinelayer&&c.zerolinelayer.selectAll("path").remove(),a._infolayer.select(".g-"+v._id+"title").remove(),a._infolayer.select(".g-"+u._id+"title").remove()}});var i=!e||e==="redraw"?Se.listIds(t):e,n=Se.list(t),o=n.filter(function(s){return s.autoshift}).map(function(s){return s.overlaying});i.map(function(s){var f=Se.getFromId(t,s);if(f.tickmode==="sync"&&f.overlaying){var c=i.findIndex(function(v){return v===f.overlaying});c>=0&&i.unshift(i.splice(c,1).shift())}});var l={false:{left:0,right:0}};return yt.syncOrAsync(i.map(function(s){return function(){if(s){var f=Se.getFromId(t,s);r||(r={}),r.axShifts=l,r.overlayingShiftedAx=o;var c=Se.drawOne(t,f,r);return f._shiftPusher&&Ud(f,f._fullDepth||0,l,!0),f._r=f.range.slice(),f._rl=yt.simpleMap(f._r,f.r2l),c}}}))};Se.drawOne=function(t,e,r){r=r||{};var a=r.axShifts||{},i=r.overlayingShiftedAx||[],n,o,l;e.setScale();var s=t._fullLayout,f=e._id,c=f.charAt(0),v=Se.counterLetter(f),u=s._plots[e._mainSubplot];if(!u)return;if(e._shiftPusher=e.autoshift||i.indexOf(e._id)!==-1||i.indexOf(e.overlaying)!==-1,e._shiftPusher&e.anchor==="free"){var h=e.linewidth/2||0;e.ticks==="inside"&&(h+=e.ticklen),Ud(e,h,a,!0),Ud(e,e.shift||0,a,!1)}(r.skipTitle!==!0||e._shift===void 0)&&(e._shift=y5(e,a));var d=u[c+"axislayer"],p=e._mainLinePosition,m=p+=e._shift,y=e._mainMirrorPosition,b=e._vals=Se.calcTicks(e),w=[e.mirror,m,y].join("_");for(n=0;n<b.length;n++)b[n].axInfo=w;e._selections={},e._tickAngles&&(e._prevTickAngles=e._tickAngles),e._tickAngles={},e._depth=null;var g={};function x(pe){var ge=f+(pe||"tick");return g[ge]||(g[ge]=s5(e,ge)),g[ge]}if(e.visible){var _=Se.makeTransTickFn(e),T=Se.makeTransTickLabelFn(e),k,S,L=e.ticks==="inside",D=e.ticks==="outside";if(e.tickson==="boundaries"){var $=n5(e,b);S=Se.clipEnds(e,$),k=L?S:$}else S=Se.clipEnds(e,b),k=L&&e.ticklabelmode!=="period"?S:b;var E=e._gridVals=S,z=l5(e,b);if(!s._hasOnlyLargeSploms){var O=e._subplotsWith,I={};for(n=0;n<O.length;n++){o=O[n],l=s._plots[o];var P=l[v+"axis"],M=P._mainAxis._id;if(!I[M]){I[M]=1;var A=c==="x"?"M0,"+P._offset+"v"+P._length:"M"+P._offset+",0h"+P._length;Se.drawGrid(t,e,{vals:E,counterAxis:P,layer:l.gridlayer.select("."+f),minorLayer:l.minorGridlayer.select("."+f),path:A,transFn:_}),Se.drawZeroLine(t,e,{counterAxis:P,layer:l.zerolinelayer,path:A,transFn:_})}}}var C,R=Se.getTickSigns(e),N=Se.getTickSigns(e,"minor");if(e.ticks||e.minor&&e.minor.ticks){var H=Se.makeTickPath(e,m,R[2]),B=Se.makeTickPath(e,m,N[2],{minor:!0}),X,j,q,U;if(e._anchorAxis&&e.mirror&&e.mirror!==!0?(X=Se.makeTickPath(e,y,R[3]),j=Se.makeTickPath(e,y,N[3],{minor:!0}),q=H+X,U=B+j):(X="",j="",q=H,U=B),e.showdividers&&D&&e.tickson==="boundaries"){var Z={};for(n=0;n<z.length;n++)Z[z[n].x]=1;C=function(pe){return Z[pe.x]?X:q}}else C=function(pe){return pe.minor?U:q}}if(Se.drawTicks(t,e,{vals:k,layer:d,path:C,transFn:_}),e.mirror==="allticks"){var K=Object.keys(e._linepositions||{});for(n=0;n<K.length;n++){o=K[n],l=s._plots[o];var ee=e._linepositions[o]||[],le=ee[0],ye=ee[1],se=ee[2],G=Se.makeTickPath(e,le,se?R[0]:N[0],{minor:se})+Se.makeTickPath(e,ye,se?R[1]:N[1],{minor:se});Se.drawTicks(t,e,{vals:k,layer:l[c+"axislayer"],path:G,transFn:_})}}var J=[];if(J.push(function(){return Se.drawLabels(t,e,{vals:b,layer:d,plotinfo:l,transFn:T,labelFns:Se.makeLabelFns(e,m)})}),e.type==="multicategory"){var oe={x:2,y:10}[c];J.push(function(){var pe={x:"height",y:"width"}[c],ge=x()[pe]+oe+(e._tickAngles[f+"tick"]?e.tickfont.size*Yf:0);return Se.drawLabels(t,e,{vals:o5(e,b),layer:d,cls:f+"tick2",repositionOnUpdate:!0,secondary:!0,transFn:_,labelFns:Se.makeLabelFns(e,m+ge*R[4])})}),J.push(function(){return e._depth=R[4]*(x("tick2")[e.side]-m),c5(t,e,{vals:z,layer:d,path:Se.makeTickPath(e,m,R[4],{len:e._depth}),transFn:_})})}else e.title.hasOwnProperty("standoff")&&J.push(function(){e._depth=R[4]*(x()[e.side]-m)});var fe=Nl.getComponentMethod("rangeslider","isVisible")(e);return!r.skipTitle&&!(fe&&e.side==="bottom")&&J.push(function(){return u5(t,e)}),J.push(function(){var pe=e.side.charAt(0),ge=ND[e.side].charAt(0),ue=Se.getPxPosition(t,e),Ce=D?e.ticklen:0,ce,De,Ee,$e;(e.automargin||fe||e._shiftPusher)&&(e.type==="multicategory"?ce=x("tick2"):(ce=x(),c==="x"&&pe==="b"&&(e._depth=Math.max(ce.width>0?ce.bottom-ue:0,Ce))));var te=0,Te=0;if(e._shiftPusher&&(te=Math.max(Ce,ce.height>0?pe==="l"?ue-ce.left:ce.right-ue:0),e.title.text!==s._dfltTitle[c]&&(Te=(e._titleStandoff||0)+(e._titleScoot||0),pe==="l"&&(Te+=Bd(e))),e._fullDepth=Math.max(te,Te)),e.automargin){De={x:0,y:0,r:0,l:0,t:0,b:0};var ne=[0,1],de=typeof e._shift=="number"?e._shift:0;if(c==="x"){if(pe==="b"?De[pe]=e._depth:(De[pe]=e._depth=Math.max(ce.width>0?ue-ce.top:0,Ce),ne.reverse()),ce.width>0){var he=ce.right-(e._offset+e._length);he>0&&(De.xr=1,De.r=he);var Ae=e._offset-ce.left;Ae>0&&(De.xl=0,De.l=Ae)}}else if(pe==="l"?(e._depth=Math.max(ce.height>0?ue-ce.left:0,Ce),De[pe]=e._depth-de):(e._depth=Math.max(ce.height>0?ce.right-ue:0,Ce),De[pe]=e._depth+de,ne.reverse()),ce.height>0){var Me=ce.bottom-(e._offset+e._length);Me>0&&(De.yb=0,De.b=Me);var we=e._offset-ce.top;we>0&&(De.yt=1,De.t=we)}De[v]=e.anchor==="free"?e.position:e._anchorAxis.domain[ne[0]],e.title.text!==s._dfltTitle[c]&&(De[pe]+=Bd(e)+(e.title.standoff||0)),e.mirror&&e.anchor!=="free"&&(Ee={x:0,y:0,r:0,l:0,t:0,b:0},Ee[ge]=e.linewidth,e.mirror&&e.mirror!==!0&&(Ee[ge]+=Ce),e.mirror===!0||e.mirror==="ticks"?Ee[v]=e._anchorAxis.domain[ne[1]]:(e.mirror==="all"||e.mirror==="allticks")&&(Ee[v]=[e._counterDomainMin,e._counterDomainMax][ne[1]]))}fe&&($e=Nl.getComponentMethod("rangeslider","autoMarginOpts")(t,e)),typeof e.automargin=="string"&&(Yy(De,e.automargin),Yy(Ee,e.automargin)),go.autoMargin(t,sp(e),De),go.autoMargin(t,Hw(e),Ee),go.autoMargin(t,Ow(e),$e)}),yt.syncOrAsync(J)}};function Yy(t,e){if(t){var r=Object.keys(Oy).reduce(function(a,i){return e.indexOf(i)!==-1&&Oy[i].forEach(function(n){a[n]=1}),a},{});Object.keys(t).forEach(function(a){r[a]||(a.length===1?t[a]=0:delete t[a])})}}function n5(t,e){var r=[],a,i=function(n,o){var l=n.xbnd[o];l!==null&&r.push(yt.extendFlat({},n,{x:l}))};if(e.length){for(a=0;a<e.length;a++)i(e[a],0);i(e[a-1],1)}return r}function o5(t,e){for(var r=[],a={},i=0;i<e.length;i++){var n=e[i];a[n.text2]?a[n.text2].push(n.x):a[n.text2]=[n.x]}for(var o in a)r.push(op(t,yt.interp(a[o],.5),o));return r}function l5(t,e){var r=[],a,i,n=e.length&&e[e.length-1].x<e[0].x,o=function(s,f){var c=s.xbnd[f];c!==null&&r.push(yt.extendFlat({},s,{x:c}))};if(t.showdividers&&e.length){for(a=0;a<e.length;a++){var l=e[a];l.text2!==i&&o(l,n?1:0),i=l.text2}o(e[a-1],n?0:1)}return r}function s5(t,e){var r,a,i,n;return t._selections[e].size()?(r=1/0,a=-1/0,i=1/0,n=-1/0,t._selections[e].each(function(){var o=Gd(this),l=aa.bBox(o.node().parentNode);r=Math.min(r,l.top),a=Math.max(a,l.bottom),i=Math.min(i,l.left),n=Math.max(n,l.right)})):(r=0,a=0,i=0,n=0),{top:r,bottom:a,left:i,right:n,height:a-r,width:n-i}}Se.getTickSigns=function(t,e){var r=t._id.charAt(0),a={x:"top",y:"right"}[r],i=t.side===a?1:-1,n=[-1,1,i,-i],o=e?(t.minor||{}).ticks:t.ticks;return o!=="inside"==(r==="x")&&(n=n.map(function(l){return-l})),t.side&&n.push({l:-1,t:-1,r:1,b:1}[t.side.charAt(0)]),n};Se.makeTransTickFn=function(t){return t._id.charAt(0)==="x"?function(e){return To(t._offset+t.l2p(e.x),0)}:function(e){return To(0,t._offset+t.l2p(e.x))}};Se.makeTransTickLabelFn=function(t){var e=f5(t),r=e[0],a=e[1];return t._id.charAt(0)==="x"?function(i){return To(r+t._offset+t.l2p(jd(i)),a)}:function(i){return To(a,r+t._offset+t.l2p(jd(i)))}};function jd(t){return t.periodX!==void 0?t.periodX:t.x}function f5(t){var e=t.ticklabelposition||"",r=function(h){return e.indexOf(h)!==-1},a=r("top"),i=r("left"),n=r("right"),o=r("bottom"),l=r("inside"),s=o||i||a||n;if(!s&&!l)return[0,0];var f=t.side,c=s?(t.tickwidth||0)/2:0,v=Wf,u=t.tickfont?t.tickfont.size:12;return(o||a)&&(c+=u*pn,v+=(t.linewidth||0)/2),(i||n)&&(c+=(t.linewidth||0)/2,v+=Wf),l&&f==="top"&&(v-=u*(1-pn)),(i||a)&&(c=-c),(f==="bottom"||f==="right")&&(v=-v),[s?c:0,l?v:0]}Se.makeTickPath=function(t,e,r,a){a||(a={});var i=a.minor;if(i&&!t.minor)return"";var n=a.len!==void 0?a.len:i?t.minor.ticklen:t.ticklen,o=t._id.charAt(0),l=(t.linewidth||1)/2;return o==="x"?"M0,"+(e+l*r)+"v"+n*r:"M"+(e+l*r)+",0h"+n*r};Se.makeLabelFns=function(t,e,r){var a=t.ticklabelposition||"",i=function($){return a.indexOf($)!==-1},n=i("top"),o=i("left"),l=i("right"),s=i("bottom"),f=s||o||n||l,c=i("inside"),v=a==="inside"&&t.ticks==="inside"||!c&&t.ticks==="outside"&&t.tickson!=="boundaries",u=0,h=0,d=v?t.ticklen:0;if(c?d*=-1:f&&(d=0),v&&(u+=d,r)){var p=yt.deg2rad(r);u=d*Math.cos(p)+1,h=d*Math.sin(p)}t.showticklabels&&(v||t.showline)&&(u+=.2*t.tickfont.size),u+=(t.linewidth||1)/2*(c?-1:1);var m={labelStandoff:u,labelShift:h},y,b,w,g,x=0,_=t.side,T=t._id.charAt(0),k=t.tickangle,S;if(T==="x")S=!c&&_==="bottom"||c&&_==="top",g=S?1:-1,c&&(g*=-1),y=h*g,b=e+u*g,w=S?1:-.2,Math.abs(k)===90&&(c?w+=Ns:k===-90&&_==="bottom"?w=pn:k===90&&_==="top"?w=Ns:w=.5,x=Ns/2*(k/90)),m.xFn=function($){return $.dx+y+x*$.fontSize},m.yFn=function($){return $.dy+b+$.fontSize*w},m.anchorFn=function($,E){if(f){if(o)return"end";if(l)return"start"}return!nr(E)||E===0||E===180?"middle":E*g<0!==c?"end":"start"},m.heightFn=function($,E,z){return E<-60||E>60?-.5*z:t.side==="top"!==c?-z:0};else if(T==="y"){if(S=!c&&_==="left"||c&&_==="right",g=S?1:-1,c&&(g*=-1),y=u,b=h*g,w=0,!c&&Math.abs(k)===90&&(k===-90&&_==="left"||k===90&&_==="right"?w=pn:w=.5),c){var L=nr(k)?+k:0;if(L!==0){var D=yt.deg2rad(L);x=Math.abs(Math.sin(D))*pn*g,w=0}}m.xFn=function($){return $.dx+e-(y+$.fontSize*w)*g+x*$.fontSize},m.yFn=function($){return $.dy+b+$.fontSize*Ns},m.anchorFn=function($,E){return nr(E)&&Math.abs(E)===90?"middle":S?"end":"start"},m.heightFn=function($,E,z){return t.side==="right"&&(E*=-1),E<-30?-z:E<30?-.5*z:0}}return m};function Bc(t){return[t.text,t.x,t.axInfo,t.font,t.fontSize,t.fontColor].join("_")}Se.drawTicks=function(t,e,r){r=r||{};var a=e._id+"tick",i=[].concat(e.minor&&e.minor.ticks?r.vals.filter(function(o){return o.minor&&!o.noTick}):[]).concat(e.ticks?r.vals.filter(function(o){return!o.minor&&!o.noTick}):[]),n=r.layer.selectAll("path."+a).data(i,Bc);n.exit().remove(),n.enter().append("path").classed(a,1).classed("ticks",1).classed("crisp",r.crisp!==!1).each(function(o){return Hl.stroke(da.select(this),o.minor?e.minor.tickcolor:e.tickcolor)}).style("stroke-width",function(o){return aa.crispRound(t,o.minor?e.minor.tickwidth:e.tickwidth,1)+"px"}).attr("d",r.path).style("display",null),Gc(e,[Pw]),n.attr("transform",r.transFn)};Se.drawGrid=function(t,e,r){if(r=r||{},e.tickmode!=="sync"){var a=e._id+"grid",i=e.minor&&e.minor.showgrid,n=i?r.vals.filter(function(y){return y.minor}):[],o=e.showgrid?r.vals.filter(function(y){return!y.minor}):[],l=r.counterAxis;if(l&&Se.shouldShowZeroLine(t,e,l))for(var s=e.tickmode==="array",f=0;f<o.length;f++){var c=o[f].x;if(s?!c:Math.abs(c)<e.dtick/100)if(o=o.slice(0,f).concat(o.slice(f+1)),s)f--;else break}e._gw=aa.crispRound(t,e.gridwidth,1);for(var v=i?aa.crispRound(t,e.minor.gridwidth,1):0,u=r.layer,h=r.minorLayer,d=1;d>=0;d--){var p=d?u:h;if(p){var m=p.selectAll("path."+a).data(d?o:n,Bc);m.exit().remove(),m.enter().append("path").classed(a,1).classed("crisp",r.crisp!==!1),m.attr("transform",r.transFn).attr("d",r.path).each(function(y){return Hl.stroke(da.select(this),y.minor?e.minor.gridcolor:e.gridcolor||"#ddd")}).style("stroke-dasharray",function(y){return aa.dashStyle(y.minor?e.minor.griddash:e.griddash,y.minor?e.minor.gridwidth:e.gridwidth)}).style("stroke-width",function(y){return(y.minor?v:e._gw)+"px"}).style("display",null),typeof r.path=="function"&&m.attr("d",r.path)}}Gc(e,[Hd,Od])}};Se.drawZeroLine=function(t,e,r){r=r||r;var a=e._id+"zl",i=Se.shouldShowZeroLine(t,e,r.counterAxis),n=r.layer.selectAll("path."+a).data(i?[{x:0,id:e._id}]:[]);n.exit().remove(),n.enter().append("path").classed(a,1).classed("zl",1).classed("crisp",r.crisp!==!1).each(function(){r.layer.selectAll("path").sort(function(o,l){return OD(o.id,l.id)})}),n.attr("transform",r.transFn).attr("d",r.path).call(Hl.stroke,e.zerolinecolor||Hl.defaultLine).style("stroke-width",aa.crispRound(t,e.zerolinewidth,e._gw||1)+"px").style("display",null),Gc(e,[Nd])};Se.drawLabels=function(t,e,r){r=r||{};var a=t._fullLayout,i=e._id,n=i.charAt(0),o=r.cls||i+"tick",l=r.vals.filter(function(z){return z.text}),s=r.labelFns,f=r.secondary?0:e.tickangle,c=(e._prevTickAngles||{})[o],v=r.layer.selectAll("g."+o).data(e.showticklabels?l:[],Bc),u=[];v.enter().append("g").classed(o,1).append("text").attr("text-anchor","middle").each(function(z){var O=da.select(this),I=t._promises.length;O.call(_l.positionText,s.xFn(z),s.yFn(z)).call(aa.font,z.font,z.fontSize,z.fontColor).text(z.text).call(_l.convertToTspans,t),t._promises[I]?u.push(t._promises.pop().then(function(){h(O,f)})):h(O,f)}),Gc(e,[Hy]),v.exit().remove(),r.repositionOnUpdate&&v.each(function(z){da.select(this).select("text").call(_l.positionText,s.xFn(z),s.yFn(z))});function h(z,O){z.each(function(I){var P=da.select(this),M=P.select(".text-math-group"),A=s.anchorFn(I,O),C=r.transFn.call(P.node(),I)+(nr(O)&&+O!=0?" rotate("+O+","+s.xFn(I)+","+(s.yFn(I)-I.fontSize/2)+")":""),R=_l.lineCount(P),N=Yf*I.fontSize,H=s.heightFn(I,nr(O)?+O:0,(R-1)*N);if(H&&(C+=To(0,H)),M.empty()){var B=P.select("text");B.attr({transform:C,"text-anchor":A}),B.style("opacity",1),e._adjustTickLabelsOverflow&&e._adjustTickLabelsOverflow()}else{var X=aa.bBox(M.node()).width,j=X*{end:-.5,start:.5}[A];M.attr("transform",C+To(j,0))}})}e._adjustTickLabelsOverflow=function(){var z=e.ticklabeloverflow;if(!(!z||z==="allow")){var O=z.indexOf("hide")!==-1,I=e._id.charAt(0)==="x",P=0,M=I?t._fullLayout.width:t._fullLayout.height;if(z.indexOf("domain")!==-1){var A=yt.simpleMap(e.range,e.r2l);P=e.l2p(A[0])+e._offset,M=e.l2p(A[1])+e._offset}var C=Math.min(P,M),R=Math.max(P,M),N=e.side,H=1/0,B=-1/0;v.each(function(U){var Z=da.select(this),K=Z.select(".text-math-group");if(K.empty()){var ee=aa.bBox(Z.node()),le=0;I?(ee.right>R||ee.left<C)&&(le=1):(ee.bottom>R||ee.top+(e.tickangle?0:U.fontSize/4)<C)&&(le=1);var ye=Z.select("text");le?O&&ye.style("opacity",0):(ye.style("opacity",1),N==="bottom"||N==="right"?H=Math.min(H,I?ee.top:ee.left):H=-1/0,N==="top"||N==="left"?B=Math.max(B,I?ee.bottom:ee.right):B=1/0)}});for(var X in a._plots){var j=a._plots[X];if(!(e._id!==j.xaxis._id&&e._id!==j.yaxis._id)){var q=I?j.yaxis:j.xaxis;q&&(q["_visibleLabelMin_"+e._id]=H,q["_visibleLabelMax_"+e._id]=B)}}}},e._hideCounterAxisInsideTickLabels=function(z){var O=e._id.charAt(0)==="x",I=[];for(var P in a._plots){var M=a._plots[P];e._id!==M.xaxis._id&&e._id!==M.yaxis._id||I.push(O?M.yaxis:M.xaxis)}I.forEach(function(A,C){A&&jl(A)&&(z||[Nd,Od,Hd,Pw,Hy]).forEach(function(R){var N=R.K==="tick"&&R.L==="text"&&e.ticklabelmode==="period",H=a._plots[e._mainSubplot],B;R.K===Nd.K?B=H.zerolinelayer.selectAll("."+e._id+"zl"):R.K===Od.K?B=H.minorGridlayer.selectAll("."+e._id):R.K===Hd.K?B=H.gridlayer.selectAll("."+e._id):B=H[e._id.charAt(0)+"axislayer"],B.each(function(){var X=da.select(this);R.L&&(X=X.selectAll(R.L)),X.each(function(j){var q=e.l2p(N?jd(j):j.x)+e._offset,U=da.select(this);q<e["_visibleLabelMax_"+A._id]&&q>e["_visibleLabelMin_"+A._id]?U.style("display","none"):R.K==="tick"&&!C&&U.style("display",null)})})})})},h(v,c+1?c:f);function d(){return u.length&&Promise.all(u)}var p=null;function m(){if(h(v,f),l.length&&n==="x"&&!nr(f)&&(e.type!=="log"||String(e.dtick).charAt(0)!=="D")){p=0;var z=0,O=[],I;if(v.each(function(ee){z=Math.max(z,ee.fontSize);var le=e.l2p(ee.x),ye=Gd(this),se=aa.bBox(ye.node());O.push({top:0,bottom:10,height:10,left:le-se.width/2,right:le+se.width/2+2,width:se.width+2})}),(e.tickson==="boundaries"||e.showdividers)&&!r.secondary){var P=2;for(e.ticks&&(P+=e.tickwidth/2),I=0;I<O.length;I++){var M=l[I].xbnd,A=O[I];if(M[0]!==null&&A.left-e.l2p(M[0])<P||M[1]!==null&&e.l2p(M[1])-A.right<P){p=90;break}}}else{var C=l.length,R=Math.abs((l[C-1].x-l[0].x)*e._m)/(C-1),N=e.ticklabelposition||"",H=function(ee){return N.indexOf(ee)!==-1},B=H("top"),X=H("left"),j=H("right"),q=H("bottom"),U=q||X||B||j,Z=U?(e.tickwidth||0)+2*Wf:0,K=R<z*2.5||e.type==="multicategory"||e._name==="realaxis";for(I=0;I<O.length-1;I++)if(yt.bBoxIntersect(O[I],O[I+1],Z)){p=K?90:30;break}}p&&h(v,p)}}e._selections&&(e._selections[o]=v);var y=[d];e.automargin&&a._redrawFromAutoMarginCount&&c===90?(p=90,y.push(function(){h(v,c)})):y.push(m),e._tickAngles&&y.push(function(){e._tickAngles[o]=p===null?nr(f)?f:0:p});var b=function(){var z=0,O=0;return v.each(function(I,P){var M=Gd(this),A=M.select(".text-math-group");if(A.empty()){var C;e._vals[P]&&(C=e._vals[P].bb||aa.bBox(M.node()),e._vals[P].bb=C),z=Math.max(z,C.width),O=Math.max(O,C.height)}}),{labelsMaxW:z,labelsMaxH:O}},w=e._anchorAxis;if(w&&(w.autorange||w.insiderange)&&jl(e)&&!jD(a,e._id)&&(a._insideTickLabelsUpdaterange||(a._insideTickLabelsUpdaterange={}),w.autorange&&(a._insideTickLabelsUpdaterange[w._name+".autorange"]=w.autorange,y.push(b)),w.insiderange)){var g=b(),x=e._id.charAt(0)==="y"?g.labelsMaxW:g.labelsMaxH;x+=2*Wf,e.ticklabelposition==="inside"&&(x+=e.ticklen||0);var _=e.side==="right"||e.side==="top"?1:-1,T=_===1?1:0,k=_===1?0:1,S=[];S[k]=w.range[k];var L=w.d2p(w.range[T]),D=w.d2p(w.range[k]),$=Math.abs(D-L);$-x>0?($-=x,x*=1+x/$):x=0,e._id.charAt(0)!=="y"&&(x=-x),S[T]=w.p2d(w.d2p(w.range[T])+_*x),w.autorange==="min"||w.autorange==="max reversed"?(S[0]=null,w._rangeInitial0=void 0,w._rangeInitial1=void 0):(w.autorange==="max"||w.autorange==="min reversed")&&(S[1]=null,w._rangeInitial0=void 0,w._rangeInitial1=void 0),a._insideTickLabelsUpdaterange[w._name+".range"]=S}var E=yt.syncOrAsync(y);return E&&E.then&&t._promises.push(E),E};function c5(t,e,r){var a=e._id+"divider",i=r.vals,n=r.layer.selectAll("path."+a).data(i,Bc);n.exit().remove(),n.enter().insert("path",":first-child").classed(a,1).classed("crisp",1).call(Hl.stroke,e.dividercolor).style("stroke-width",aa.crispRound(t,e.dividerwidth,1)+"px"),n.attr("transform",r.transFn).attr("d",r.path)}Se.getPxPosition=function(t,e){var r=t._fullLayout._size,a=e._id.charAt(0),i=e.side,n;if(e.anchor!=="free"?n=e._anchorAxis:a==="x"?n={_offset:r.t+(1-(e.position||0))*r.h,_length:0}:a==="y"&&(n={_offset:r.l+(e.position||0)*r.w+e._shift,_length:0}),i==="top"||i==="left")return n._offset;if(i==="bottom"||i==="right")return n._offset+n._length};function Bd(t){var e=t.title.font.size,r=(t.title.text.match(_l.BR_TAG_ALL)||[]).length;return t.title.hasOwnProperty("standoff")?r?e*(pn+r*Yf):e*pn:r?e*(r+1)*Yf:e}function u5(t,e){var r=t._fullLayout,a=e._id,i=a.charAt(0),n=e.title.font.size,o;if(e.title.hasOwnProperty("standoff"))o=e._depth+e.title.standoff+Bd(e);else{var l=jl(e);if(e.type==="multicategory")o=e._depth;else{var s=1.5*n;l&&(s=.5*n,e.ticks==="outside"&&(s+=e.ticklen)),o=10+s+(e.linewidth?e.linewidth-1:0)}l||(i==="x"?o+=e.side==="top"?n*(e.showticklabels?1:0):n*(e.showticklabels?1.5:.5):o+=e.side==="right"?n*(e.showticklabels?1:.5):n*(e.showticklabels?.5:0))}var f=Se.getPxPosition(t,e),c,v,u;i==="x"?(v=e._offset+e._length/2,u=e.side==="top"?f-o:f+o):(u=e._offset+e._length/2,v=e.side==="right"?f+o:f-o,c={rotate:"-90",offset:0});var h;if(e.type!=="multicategory"){var d=e._selections[e._id+"tick"];if(h={selection:d,side:e.side},d&&d.node()&&d.node().parentNode){var p=aa.getTranslate(d.node().parentNode);h.offsetLeft=p.x,h.offsetTop=p.y}e.title.hasOwnProperty("standoff")&&(h.pad=0)}return e._titleStandoff=o,RD.draw(t,a+"title",{propContainer:e,propName:e._name+".title.text",placeholder:r._dfltTitle[i],avoid:h,transform:c,attributes:{x:v,y:u,"text-anchor":"middle"}})}Se.shouldShowZeroLine=function(t,e,r){var a=yt.simpleMap(e.range,e.r2l);return a[0]*a[1]<=0&&e.zeroline&&(e.type==="linear"||e.type==="-")&&!(e.rangebreaks&&e.maskBreaks(0)===Oc)&&(Nw(e,0)||!v5(t,e,r,a)||d5(t,e))};Se.clipEnds=function(t,e){return e.filter(function(r){return Nw(t,r.x)})};function Nw(t,e){var r=t.l2p(e);return r>1&&r<t._length-1}function v5(t,e,r,a){var i=r._mainAxis;if(!i)return;var n=t._fullLayout,o=e._id.charAt(0),l=Se.counterLetter(e._id),s=e._offset+(Math.abs(a[0])<Math.abs(a[1])==(o==="x")?0:e._length);function f(d){if(!d.showline||!d.linewidth)return!1;var p=Math.max((d.linewidth+e.zerolinewidth)/2,1);function m(w){return typeof w=="number"&&Math.abs(w-s)<p}if(m(d._mainLinePosition)||m(d._mainMirrorPosition))return!0;var y=d._linepositions||{};for(var b in y)if(m(y[b][0])||m(y[b][1]))return!0}var c=n._plots[r._mainSubplot];if(!(c.mainplotinfo||c).overlays.length)return f(r);for(var v=Se.list(t,l),u=0;u<v.length;u++){var h=v[u];if(h._mainAxis===i&&f(h))return!0}}function d5(t,e){for(var r=t._fullData,a=e._mainSubplot,i=e._id.charAt(0),n=0;n<r.length;n++){var o=r[n];if(o.visible===!0&&o.xaxis+o.yaxis===a&&(Nl.traceIs(o,"bar-like")&&o.orientation==={x:"h",y:"v"}[i]||o.fill&&o.fill.charAt(o.fill.length-1)===i))return!0}return!1}function Gd(t){var e=da.select(t),r=e.select(".text-math-group");return r.empty()?e.select("text"):r}Se.allowAutoMargin=function(t){for(var e=Se.list(t,"",!0),r=0;r<e.length;r++){var a=e[r];a.automargin&&(go.allowAutoMargin(t,sp(a)),a.mirror&&go.allowAutoMargin(t,Hw(a))),Nl.getComponentMethod("rangeslider","isVisible")(a)&&go.allowAutoMargin(t,Ow(a))}};function sp(t){return t._id+".automargin"}function Hw(t){return sp(t)+".mirror"}function Ow(t){return t._id+".rangeslider"}Se.swap=function(t,e){for(var r=h5(t,e),a=0;a<r.length;a++)p5(t,r[a].x,r[a].y)};function h5(t,e){var r=[],a,i;for(a=0;a<e.length;a++){var n=[],o=t._fullData[e[a]].xaxis,l=t._fullData[e[a]].yaxis;if(!(!o||!l)){for(i=0;i<r.length;i++)(r[i].x.indexOf(o)!==-1||r[i].y.indexOf(l)!==-1)&&n.push(i);if(!n.length){r.push({x:[o],y:[l]});continue}var s=r[n[0]],f;if(n.length>1)for(i=1;i<n.length;i++)f=r[n[i]],Os(s.x,f.x),Os(s.y,f.y);Os(s.x,[o]),Os(s.y,[l])}}return r}function Os(t,e){for(var r=0;r<e.length;r++)t.indexOf(e[r])===-1&&t.push(e[r])}function p5(t,e,r){var a=[],i=[],n=t.layout,o,l;for(o=0;o<e.length;o++)a.push(Se.getFromId(t,e[o]));for(o=0;o<r.length;o++)i.push(Se.getFromId(t,r[o]));var s=Object.keys(ED),f=["anchor","domain","overlaying","position","side","tickangle","editType"],c=["linear","log"];for(o=0;o<s.length;o++){var v=s[o],u=a[0][v],h=i[0][v],d=!0,p=!1,m=!1;if(!(v.charAt(0)==="_"||typeof u=="function"||f.indexOf(v)!==-1)){for(l=1;l<a.length&&d;l++){var y=a[l][v];v==="type"&&c.indexOf(u)!==-1&&c.indexOf(y)!==-1&&u!==y?p=!0:y!==u&&(d=!1)}for(l=1;l<i.length&&d;l++){var b=i[l][v];v==="type"&&c.indexOf(h)!==-1&&c.indexOf(b)!==-1&&h!==b?m=!0:i[l][v]!==h&&(d=!1)}d&&(p&&(n[a[0]._name].type="linear"),m&&(n[i[0]._name].type="linear"),m5(n,v,a,i,t._fullLayout._dfltTitle))}}for(o=0;o<t._fullLayout.annotations.length;o++){var w=t._fullLayout.annotations[o];e.indexOf(w.xref)!==-1&&r.indexOf(w.yref)!==-1&&yt.swapAttrs(n.annotations[o],["?"])}}function m5(t,e,r,a,i){var n=yt.nestedProperty,o=n(t[r[0]._name],e).get(),l=n(t[a[0]._name],e).get(),s;for(e==="title"&&(o&&o.text===i.x&&(o.text=i.y),l&&l.text===i.y&&(l.text=i.x)),s=0;s<r.length;s++)n(t,r[s]._name+"."+e).set(l);for(s=0;s<a.length;s++)n(t,a[s]._name+"."+e).set(o)}function fp(t){return t._id==="angularaxis"}function Ou(t,e){for(var r=e._rangebreaks.length,a=0;a<r;a++){var i=e._rangebreaks[a];if(t>=i.min&&t<i.max)return i.max}return t}function jl(t){return(t.ticklabelposition||"").indexOf("inside")!==-1}function Gc(t,e){jl(t._anchorAxis||{})&&t._hideCounterAxisInsideTickLabels&&t._hideCounterAxisInsideTickLabels(e)}function Ud(t,e,r,a){var i=t.anchor!=="free"&&(t.overlaying===void 0||t.overlaying===!1)?t._id:t.overlaying,n;a?n=t.side==="right"?e:-e:n=e,i in r||(r[i]={}),t.side in r[i]||(r[i][t.side]=0),r[i][t.side]+=n}function y5(t,e){return t.autoshift?e[t.overlaying][t.side]:t.shift||0}var Bt=W_.exports,g5=function(e,r,a){var i,n;if(a){var o=r==="reversed"||r==="min reversed"||r==="max reversed";i=a[o?1:0],n=a[o?0:1]}var l=e("autorangeoptions.minallowed",n===null?i:void 0),s=e("autorangeoptions.maxallowed",i===null?n:void 0);l===void 0&&e("autorangeoptions.clipmin"),s===void 0&&e("autorangeoptions.clipmax"),e("autorangeoptions.include")},b5=g5,jw=function(e,r,a,i){var n=r._template||{},o=r.type||n.type||"-";a("minallowed"),a("maxallowed");var l=a("range");if(!l){var s;!i.noInsiderange&&o!=="log"&&(s=a("insiderange"),s&&(s[0]===null||s[1]===null)&&(r.insiderange=!1,s=void 0),s&&(l=a("range",s)))}var f=r.getAutorangeDflt(l,i),c=a("autorange",f),v;l&&(l[0]===null&&l[1]===null||(l[0]===null||l[1]===null)&&(c==="reversed"||c===!0)||l[0]!==null&&(c==="min"||c==="max reversed")||l[1]!==null&&(c==="max"||c==="min reversed"))&&(l=void 0,delete r.range,r.autorange=!0,v=!0),v||(f=r.getAutorangeDflt(l,i),c=a("autorange",f)),c&&(b5(a,c,l),(o==="linear"||o==="-")&&a("rangemode")),r.cleanRange()},ju={},Bw={exports:{}},x5=function(e,r,a,i,n){var o=(e-a)/(i-a),l=o+r/(i-a),s=(o+l)/2;return n==="left"||n==="bottom"?o:n==="center"||n==="middle"?s:n==="right"||n==="top"?l:o<2/3-s?o:l>4/3-s?l:s},Wy=me,_5=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]],w5=function(e,r,a,i){return a==="left"?e=0:a==="center"?e=1:a==="right"?e=2:e=Wy.constrain(Math.floor(e*3),0,2),i==="bottom"?r=0:i==="middle"?r=1:i==="top"?r=2:r=Wy.constrain(Math.floor(r*3),0,2),_5[r][e]},Gw={exports:{}},T5=ls,k5=Rc,A5=Lc.getGraphDiv,M5=Tc,Vd=Gw.exports={};Vd.wrapped=function(t,e,r){t=A5(t),t._fullLayout&&k5.clear(t._fullLayout._uid+M5.HOVERID),Vd.raw(t,e,r)};Vd.raw=function(e,r){var a=e._fullLayout,i=e._hoverdata;r||(r={}),!(r.target&&!e._dragged&&T5.triggerHandler(e,"plotly_beforehover",r)===!1)&&(a._hoverlayer.selectAll("g").remove(),a._hoverlayer.selectAll("line").remove(),a._hoverlayer.selectAll("circle").remove(),e._hoverdata=void 0,r.target&&i&&e.emit("plotly_unhover",{event:r,points:i}))};var S5=Gw.exports,L5=uM,Bu=F1,C5=N1,D5=me.removeElement,$5=Gr,bn=Bw.exports={};bn.align=x5;bn.getCursor=w5;var Uw=S5;bn.unhover=Uw.wrapped;bn.unhoverRaw=Uw.raw;bn.init=function(e){var r=e.gd,a=1,i=r._context.doubleClickDelay,n=e.element,o,l,s,f,c,v,u,h;r._mouseDownTime||(r._mouseDownTime=0),n.style.pointerEvents="all",n.onmousedown=m,C5?(n._ontouchstart&&n.removeEventListener("touchstart",n._ontouchstart),n._ontouchstart=m,n.addEventListener("touchstart",m,{passive:!1})):n.ontouchstart=m;function d(w,g,x){return Math.abs(w)<x&&(w=0),Math.abs(g)<x&&(g=0),[w,g]}var p=e.clampFn||d;function m(w){r._dragged=!1,r._dragging=!0;var g=Gu(w);o=g[0],l=g[1],u=w.target,v=w,h=w.buttons===2||w.ctrlKey,typeof w.clientX>"u"&&typeof w.clientY>"u"&&(w.clientX=o,w.clientY=l),s=new Date().getTime(),s-r._mouseDownTime<i?a+=1:(a=1,r._mouseDownTime=s),e.prepFn&&e.prepFn(w,o,l),Bu&&!h?(c=Vw(),c.style.cursor=window.getComputedStyle(n).cursor):Bu||(c=document,f=window.getComputedStyle(document.documentElement).cursor,document.documentElement.style.cursor=window.getComputedStyle(n).cursor),document.addEventListener("mouseup",b),document.addEventListener("touchend",b),e.dragmode!==!1&&(w.preventDefault(),document.addEventListener("mousemove",y),document.addEventListener("touchmove",y,{passive:!1}))}function y(w){w.preventDefault();var g=Gu(w),x=e.minDrag||$5.MINDRAG,_=p(g[0]-o,g[1]-l,x),T=_[0],k=_[1];(T||k)&&(r._dragged=!0,bn.unhover(r,w)),r._dragged&&e.moveFn&&!h&&(r._dragdata={element:n,dx:T,dy:k},e.moveFn(T,k))}function b(w){if(delete r._dragdata,e.dragmode!==!1&&(w.preventDefault(),document.removeEventListener("mousemove",y),document.removeEventListener("touchmove",y)),document.removeEventListener("mouseup",b),document.removeEventListener("touchend",b),Bu?D5(c):f&&(c.documentElement.style.cursor=f,f=null),!r._dragging){r._dragged=!1;return}if(r._dragging=!1,new Date().getTime()-r._mouseDownTime>i&&(a=Math.max(a-1,1)),r._dragged)e.doneFn&&e.doneFn();else if(e.clickFn&&e.clickFn(a,v),!h){var g;try{g=new MouseEvent("click",w)}catch{var x=Gu(w);g=document.createEvent("MouseEvents"),g.initMouseEvent("click",w.bubbles,w.cancelable,w.view,w.detail,w.screenX,w.screenY,x[0],x[1],w.ctrlKey,w.altKey,w.shiftKey,w.metaKey,w.button,w.relatedTarget)}u.dispatchEvent(g)}r._dragging=!1,r._dragged=!1}};function Vw(){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}bn.coverSlip=Vw;function Gu(t){return L5(t.changedTouches?t.changedTouches[0]:t,document.body)}var Qa=Bw.exports,Uc={},ji=function(e,r){(e.attr("class")||"").split(" ").forEach(function(a){a.indexOf("cursor-")===0&&e.classed(a,!1)}),r&&e.classed("cursor-"+r,!0)},Uu=ji,el="data-savedcursor",qy="!!",P5=function(e,r){var a=e.attr(el);if(r){if(!a){for(var i=(e.attr("class")||"").split(" "),n=0;n<i.length;n++){var o=i[n];o.indexOf("cursor-")===0&&e.attr(el,o.substr(7)).classed(o,!1)}e.attr(el)||e.attr(el,qy)}Uu(e,r)}else a&&(e.attr(el,null),a===qy?Uu(e):Uu(e,a))},Vu=Mr,R5=zr,Xw={_isSubplotObj:!0,visible:{valType:"boolean",dflt:!0,editType:"legend",description:["Determines whether or not this legend is visible."].join(" ")},bgcolor:{valType:"color",editType:"legend",description:["Sets the legend background color.","Defaults to `layout.paper_bgcolor`."].join(" ")},bordercolor:{valType:"color",dflt:R5.defaultLine,editType:"legend",description:"Sets the color of the border enclosing the legend."},borderwidth:{valType:"number",min:0,dflt:0,editType:"legend",description:"Sets the width (in px) of the border enclosing the legend."},font:Vu({editType:"legend",description:"Sets the font used to text the legend items."}),grouptitlefont:Vu({editType:"legend",description:["Sets the font for group titles in legend.","Defaults to `legend.font` with its size increased about 10%."].join(" ")}),orientation:{valType:"enumerated",values:["v","h"],dflt:"v",editType:"legend",description:"Sets the orientation of the legend."},traceorder:{valType:"flaglist",flags:["reversed","grouped"],extras:["normal"],editType:"legend",description:["Determines the order at which the legend items are displayed.","If *normal*, the items are displayed top-to-bottom in the same","order as the input data.","If *reversed*, the items are displayed in the opposite order","as *normal*.","If *grouped*, the items are displayed in groups","(when a trace `legendgroup` is provided).","if *grouped+reversed*, the items are displayed in the opposite order","as *grouped*."].join(" ")},tracegroupgap:{valType:"number",min:0,dflt:10,editType:"legend",description:["Sets the amount of vertical space (in px) between legend groups."].join(" ")},entrywidth:{valType:"number",min:0,editType:"legend",description:["Sets the width (in px or fraction) of the legend.","Use 0 to size the entry based on the text width,","when `entrywidthmode` is set to *pixels*."].join(" ")},entrywidthmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"pixels",editType:"legend",description:"Determines what entrywidth means."},itemsizing:{valType:"enumerated",values:["trace","constant"],dflt:"trace",editType:"legend",description:["Determines if the legend items symbols scale with their corresponding *trace* attributes","or remain *constant* independent of the symbol size on the graph."].join(" ")},itemwidth:{valType:"number",min:30,dflt:30,editType:"legend",description:"Sets the width (in px) of the legend item symbols (the part other than the title.text)."},itemclick:{valType:"enumerated",values:["toggle","toggleothers",!1],dflt:"toggle",editType:"legend",description:["Determines the behavior on legend item click.","*toggle* toggles the visibility of the item clicked on the graph.","*toggleothers* makes the clicked item the sole visible item on the graph.","*false* disables legend item click interactions."].join(" ")},itemdoubleclick:{valType:"enumerated",values:["toggle","toggleothers",!1],dflt:"toggleothers",editType:"legend",description:["Determines the behavior on legend item double-click.","*toggle* toggles the visibility of the item clicked on the graph.","*toggleothers* makes the clicked item the sole visible item on the graph.","*false* disables legend item double-click interactions."].join(" ")},groupclick:{valType:"enumerated",values:["toggleitem","togglegroup"],dflt:"togglegroup",editType:"legend",description:["Determines the behavior on legend group item click.","*toggleitem* toggles the visibility of the individual item clicked on the graph.","*togglegroup* toggles the visibility of all items in the same legendgroup as the item clicked on the graph."].join(" ")},x:{valType:"number",editType:"legend",description:["Sets the x position with respect to `xref` (in normalized coordinates) of the legend.","When `xref` is *paper*, defaults to *1.02* for vertical legends and","defaults to *0* for horizontal legends.","When `xref` is *container*, defaults to *1* for vertical legends and","defaults to *0* for horizontal legends.","Must be between *0* and *1* if `xref` is *container*.","and between *-2* and *3* if `xref` is *paper*."].join(" ")},xref:{valType:"enumerated",dflt:"paper",values:["container","paper"],editType:"layoutstyle",description:["Sets the container `x` refers to.","*container* spans the entire `width` of the plot.","*paper* refers to the width of the plotting area only."].join(" ")},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left",editType:"legend",description:["Sets the legend's horizontal position anchor.","This anchor binds the `x` position to the *left*, *center*","or *right* of the legend.","Value *auto* anchors legends to the right for `x` values greater than or equal to 2/3,","anchors legends to the left for `x` values less than or equal to 1/3 and","anchors legends with respect to their center otherwise."].join(" ")},y:{valType:"number",editType:"legend",description:["Sets the y position with respect to `yref` (in normalized coordinates) of the legend.","When `yref` is *paper*, defaults to *1* for vertical legends,","defaults to *-0.1* for horizontal legends on graphs w/o range sliders and","defaults to *1.1* for horizontal legends on graph with one or multiple range sliders.","When `yref` is *container*, defaults to *1*.","Must be between *0* and *1* if `yref` is *container*","and between *-2* and *3* if `yref` is *paper*."].join(" ")},yref:{valType:"enumerated",dflt:"paper",values:["container","paper"],editType:"layoutstyle",description:["Sets the container `y` refers to.","*container* spans the entire `height` of the plot.","*paper* refers to the height of the plotting area only."].join(" ")},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],editType:"legend",description:["Sets the legend's vertical position anchor","This anchor binds the `y` position to the *top*, *middle*","or *bottom* of the legend.","Value *auto* anchors legends at their bottom for `y` values less than or equal to 1/3,","anchors legends to at their top for `y` values greater than or equal to 2/3 and","anchors legends with respect to their middle otherwise."].join(" ")},uirevision:{valType:"any",editType:"none",description:["Controls persistence of legend-driven changes in trace and pie label","visibility. Defaults to `layout.uirevision`."].join(" ")},valign:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle",editType:"legend",description:["Sets the vertical alignment of the symbols with respect to their associated text."].join(" ")},title:{text:{valType:"string",dflt:"",editType:"legend",description:["Sets the title of the legend."].join(" ")},font:Vu({editType:"legend",description:["Sets this legend's title font.","Defaults to `legend.font` with its size increased about 20%."].join(" ")}),side:{valType:"enumerated",values:["top","left","top left","top center","top right"],editType:"legend",description:["Determines the location of legend's title","with respect to the legend items.","Defaulted to *top* with `orientation` is *h*.","Defaulted to *left* with `orientation` is *v*.","The *top left* options could be used to expand","top center and top right are for horizontal alignment","legend area in both x and y sides."].join(" ")},editType:"legend"},editType:"legend"},Bo={};Bo.isGrouped=function(e){return(e.traceorder||"").indexOf("grouped")!==-1};Bo.isVertical=function(e){return e.orientation!=="h"};Bo.isReversed=function(e){return(e.traceorder||"").indexOf("reversed")!==-1};var Xu=ot,Yr=me,E5=Ht,z5=ba,I5=Xw,F5=os,Yu=Bo;function N5(t,e,r,a){var i=e[t]||{},n=E5.newContainer(r,t);function o(P,M){return Yr.coerce(i,n,I5,P,M)}var l=Yr.coerceFont(o,"font",r.font);o("bgcolor",r.paper_bgcolor),o("bordercolor");var s=o("visible");if(s){for(var f,c=function(P,M){var A=f._input,C=f;return Yr.coerce(A,C,z5,P,M)},v=r.font||{},u=Yr.coerceFont(o,"grouptitlefont",Yr.extendFlat({},v,{size:Math.round(v.size*1.1)})),h=0,d=!1,p="normal",m=(r.shapes||[]).filter(function(P){return P.showlegend}),y=a.concat(m).filter(function(P){return t===(P.legend||"legend")}),b=0;b<y.length;b++)if(f=y[b],!!f.visible){var w=f._isShape;(f.showlegend||f._dfltShowLegend&&!(f._module&&f._module.attributes&&f._module.attributes.showlegend&&f._module.attributes.showlegend.dflt===!1))&&(h++,f.showlegend&&(d=!0,(!w&&Xu.traceIs(f,"pie-like")||f._input.showlegend===!0)&&h++),Yr.coerceFont(c,"legendgrouptitle.font",u)),(!w&&Xu.traceIs(f,"bar")&&r.barmode==="stack"||["tonextx","tonexty"].indexOf(f.fill)!==-1)&&(p=Yu.isGrouped({traceorder:p})?"grouped+reversed":"reversed"),f.legendgroup!==void 0&&f.legendgroup!==""&&(p=Yu.isReversed({traceorder:p})?"reversed+grouped":"grouped")}var g=Yr.coerce(e,r,F5,"showlegend",d&&h>(t==="legend"?1:0));if(g===!1&&(r[t]=void 0),!(g===!1&&!i.uirevision)&&(o("uirevision",r.uirevision),g!==!1)){o("borderwidth");var x=o("orientation"),_=o("yref"),T=o("xref"),k=x==="h",S=_==="paper",L=T==="paper",D,$,E,z="left";k?(D=0,Xu.getComponentMethod("rangeslider","isVisible")(e.xaxis)?S?($=1.1,E="bottom"):($=1,E="top"):S?($=-.1,E="top"):($=0,E="bottom")):($=1,E="auto",L?D=1.02:(D=1,z="right")),Yr.coerce(i,n,{x:{valType:"number",editType:"legend",min:L?-2:0,max:L?3:1,dflt:D}},"x"),Yr.coerce(i,n,{y:{valType:"number",editType:"legend",min:S?-2:0,max:S?3:1,dflt:$}},"y"),o("traceorder",p),Yu.isGrouped(r[t])&&o("tracegroupgap"),o("entrywidth"),o("entrywidthmode"),o("itemsizing"),o("itemwidth"),o("itemclick"),o("itemdoubleclick"),o("groupclick"),o("xanchor",z),o("yanchor",E),o("valign"),Yr.noneOrAll(i,n,["x","y"]);var O=o("title.text");if(O){o("title.side",k?"left":"top");var I=Yr.extendFlat({},l,{size:Yr.bigFont(l.size)});Yr.coerceFont(o,"title.font",I)}}}}var Yw=function(e,r,a){var i,n=a.slice(),o=r.shapes;if(o)for(i=0;i<o.length;i++){var l=o[i];if(l.showlegend){var s={_input:l._input,visible:l.visible,showlegend:l.showlegend,legend:l.legend};n.push(s)}}var f=["legend"];for(i=0;i<n.length;i++)Yr.pushUnique(f,n[i].legend);for(r._legends=[],i=0;i<f.length;i++){var c=f[i];N5(c,e,r,n),r[c]&&r[c].visible&&(r[c]._id=c),r._legends.push(c)}},yi=ot,Mf=me,H5=Mf.pushUnique,Wu=!0,O5=function(e,r,a){var i=r._fullLayout;if(r._dragged||r._editing)return;var n=i.legend.itemclick,o=i.legend.itemdoubleclick,l=i.legend.groupclick;a===1&&n==="toggle"&&o==="toggleothers"&&Wu&&r.data&&r._context.showTips&&Mf.notifier(Mf._(r,"Double-click on legend to isolate one trace"),"long"),Wu=!1;var s;if(a===1?s=n:a===2&&(s=o),!s)return;var f=l==="togglegroup",c=i.hiddenlabels?i.hiddenlabels.slice():[],v=e.data()[0][0];if(v.groupTitle&&v.noClick)return;var u=r._fullData,h=(i.shapes||[]).filter(function(ue){return ue.showlegend}),d=u.concat(h),p=v.trace;p._isShape&&(p=p._fullInput);var m=p.legendgroup,y,b,w,g,x,_,T={},k=[],S=[],L=[];function D(ue,Ce){var ce=k.indexOf(ue),De=T.visible;return De||(De=T.visible=[]),k.indexOf(ue)===-1&&(k.push(ue),ce=k.length-1),De[ce]=Ce,ce}var $=(i.shapes||[]).map(function(ue){return ue._input}),E=!1;function z(ue,Ce){$[ue].visible=Ce,E=!0}function O(ue,Ce){if(!(v.groupTitle&&!f)){var ce=ue._fullInput||ue,De=ce._isShape,Ee=ce.index;if(Ee===void 0&&(Ee=ce._index),yi.hasTransform(ce,"groupby")){var $e=S[Ee];if(!$e){var te=yi.getTransformIndices(ce,"groupby"),Te=te[te.length-1];$e=Mf.keyedContainer(ce,"transforms["+Te+"].styles","target","value.visible"),S[Ee]=$e}var ne=$e.get(ue._group);ne===void 0&&(ne=!0),ne!==!1&&$e.set(ue._group,Ce),L[Ee]=D(Ee,ce.visible!==!1)}else{var de=ce.visible===!1?!1:Ce;De?z(Ee,de):D(Ee,de)}}}var I=p.legend,P=p._fullInput,M=P&&P._isShape;if(!M&&yi.traceIs(p,"pie-like")){var A=v.label,C=c.indexOf(A);if(s==="toggle")C===-1?c.push(A):c.splice(C,1);else if(s==="toggleothers"){var R=C!==-1,N=[];for(y=0;y<r.calcdata.length;y++){var H=r.calcdata[y];for(b=0;b<H.length;b++){var B=H[b],X=B.label;I===H[0].trace.legend&&A!==X&&(c.indexOf(X)===-1&&(R=!0),H5(c,X),N.push(X))}}if(!R)for(var j=0;j<N.length;j++){var q=c.indexOf(N[j]);q!==-1&&c.splice(q,1)}}yi.call("_guiRelayout",r,"hiddenlabels",c)}else{var U=m&&m.length,Z=[],K;if(U)for(y=0;y<d.length;y++)K=d[y],K.visible&&K.legendgroup===m&&Z.push(y);if(s==="toggle"){var ee;switch(p.visible){case!0:ee="legendonly";break;case!1:ee=!1;break;case"legendonly":ee=!0;break}if(U)if(f)for(y=0;y<d.length;y++){var le=d[y];le.visible!==!1&&le.legendgroup===m&&O(le,ee)}else O(p,ee);else O(p,ee)}else if(s==="toggleothers"){var ye,se,G,J,oe,fe=!0;for(y=0;y<d.length;y++)if(oe=d[y],ye=oe===p,G=oe.showlegend!==!0,!(ye||G)&&(se=U&&oe.legendgroup===m,!se&&oe.legend===I&&oe.visible===!0&&!yi.traceIs(oe,"notLegendIsolatable"))){fe=!1;break}for(y=0;y<d.length;y++)if(oe=d[y],!(oe.visible===!1||oe.legend!==I)&&!yi.traceIs(oe,"notLegendIsolatable"))switch(p.visible){case"legendonly":O(oe,!0);break;case!0:J=fe?!0:"legendonly",ye=oe===p,G=oe.showlegend!==!0&&!oe.legendgroup,se=ye||U&&oe.legendgroup===m,O(oe,se||G?!0:J);break}}for(y=0;y<S.length;y++)if(w=S[y],!!w){var pe=w.constructUpdate(),ge=Object.keys(pe);for(b=0;b<ge.length;b++)g=ge[b],_=T[g]=T[g]||[],_[L[y]]=pe[g]}for(x=Object.keys(T),y=0;y<x.length;y++)for(g=x[y],b=0;b<k.length;b++)T[g].hasOwnProperty(b)||(T[g][b]=void 0);E?yi.call("_guiUpdate",r,T,{shapes:$},k):yi.call("_guiRestyle",r,T,k)}},Ww={scrollBarWidth:6,scrollBarMinHeight:20,scrollBarColor:"#808BA4",scrollBarMargin:4,scrollBarEnterAttrs:{rx:20,ry:3,width:0,height:0},titlePad:2,itemGap:5},Zy=ot,qu=Bo,j5=function(e,r,a){var i=r._inHover,n=qu.isGrouped(r),o=qu.isReversed(r),l={},s=[],f=!1,c={},v=0,u=0,h,d;function p(P,M,A){if(r.visible!==!1&&!(a&&P!==r._id))if(M===""||!qu.isGrouped(r)){var C="~~i"+v;s.push(C),l[C]=[A],v++}else s.indexOf(M)===-1?(s.push(M),f=!0,l[M]=[A]):l[M].push(A)}for(h=0;h<e.length;h++){var m=e[h],y=m[0],b=y.trace,w=b.legend,g=b.legendgroup;if(!(!i&&(!b.visible||!b.showlegend)))if(Zy.traceIs(b,"pie-like"))for(c[g]||(c[g]={}),d=0;d<m.length;d++){var x=m[d].label;c[g][x]||(p(w,g,{label:x,color:m[d].color,i:m[d].i,trace:b,pts:m[d].pts}),c[g][x]=!0,u=Math.max(u,(x||"").length))}else p(w,g,y),u=Math.max(u,(b.name||"").length)}if(!s.length)return[];var _=!f||!n,T=[];for(h=0;h<s.length;h++){var k=l[s[h]];_?T.push(k[0]):T.push(k)}for(_&&(T=[T]),h=0;h<T.length;h++){var S=1/0;for(d=0;d<T[h].length;d++){var L=T[h][d].trace.legendrank;S>L&&(S=L)}T[h][0]._groupMinRank=S,T[h][0]._preGroupSort=h}var D=function(P,M){return P[0]._groupMinRank-M[0]._groupMinRank||P[0]._preGroupSort-M[0]._preGroupSort},$=function(P,M){return P.trace.legendrank-M.trace.legendrank||P._preSort-M._preSort};for(T.forEach(function(P,M){P[0]._preGroupSort=M}),T.sort(D),h=0;h<T.length;h++){T[h].forEach(function(P,M){P._preSort=M}),T[h].sort($);var E=T[h][0].trace,z=null;for(d=0;d<T[h].length;d++){var O=T[h][d].trace.legendgrouptitle;if(O&&O.text){z=O,i&&(O.font=r._groupTitleFont);break}}if(o&&T[h].reverse(),z){var I=!1;for(d=0;d<T[h].length;d++)if(Zy.traceIs(T[h][d].trace,"pie-like")){I=!0;break}T[h].unshift({i:-1,groupTitle:z,noClick:I,trace:{showlegend:E.showlegend,legendgroup:E.legendgroup,visible:r.groupclick==="toggleitem"?!0:E.visible}})}for(d=0;d<T[h].length;d++)T[h][d]=[T[h][d]]}return r._lgroupsLength=T.length,r._maxNameLength=u,T},Cn={};(function(t){var e=me;function r(a){return a.indexOf("e")!==-1?a.replace(/[.]?0+e/,"e"):a.indexOf(".")!==-1?a.replace(/[.]?0+$/,""):a}t.formatPiePercent=function(i,n){var o=r((i*100).toPrecision(3));return e.numSeparate(o,n)+"%"},t.formatPieValue=function(i,n){var o=r(i.toPrecision(10));return e.numSeparate(o,n)},t.getFirstFilled=function(i,n){if(Array.isArray(i))for(var o=0;o<n.length;o++){var l=i[n[o]];if(l||l===0||l==="")return l}},t.castOption=function(i,n){if(Array.isArray(i))return t.getFirstFilled(i,n);if(i)return i},t.getRotationAngle=function(a){return(a==="auto"?0:a)*Math.PI/180}})(Cn);var B5=$t,G5=ht,U5=function(e,r,a,i){var n=a.marker.pattern;n&&n.shape?B5.pointStyle(e,a,i,r):G5.fill(e,r.color)},Ky=ht,Qy=Cn.castOption,V5=U5,cp=function(e,r,a,i){var n=a.marker.line,o=Qy(n.color,r.pts)||Ky.defaultLine,l=Qy(n.width,r.pts)||0;e.call(V5,r,a,i).style("stroke-width",l).call(Ky.stroke,o)},Pr=gt,Zu=ot,Lr=me,Jy=Lr.strTranslate,jr=$t,la=ht,Ku=Na.extractOpts,Zf=Ir,X5=cp,Y5=Cn.castOption,W5=Ww,eg=12,tg=5,qi=2,q5=10,En=5,qw=function(e,r,a){var i=r._fullLayout;a||(a=i.legend);var n=a.itemsizing==="constant",o=a.itemwidth,l=(o+W5.itemGap*2)/2,s=Jy(l,0),f=function(T,k,S,L){var D;if(T+1)D=T;else if(k&&k.width>0)D=k.width;else return 0;return n?L:Math.min(D,S)};e.each(function(T){var k=Pr.select(this),S=Lr.ensureSingle(k,"g","layers");S.style("opacity",T[0].trace.opacity);var L=a.valign,D=T[0].lineHeight,$=T[0].height;if(L==="middle"||!D||!$)S.attr("transform",null);else{var E={top:1,bottom:-1}[L],z=E*(.5*(D-$+3));S.attr("transform",Jy(0,z))}var O=S.selectAll("g.legendfill").data([T]);O.enter().append("g").classed("legendfill",!0);var I=S.selectAll("g.legendlines").data([T]);I.enter().append("g").classed("legendlines",!0);var P=S.selectAll("g.legendsymbols").data([T]);P.enter().append("g").classed("legendsymbols",!0),P.selectAll("g.legendpoints").data([T]).enter().append("g").classed("legendpoints",!0)}).each(_).each(u).each(d).each(h).each(m).each(g).each(w).each(c).each(v).each(y).each(b);function c(T){var k=rg(T),S=k.showFill,L=k.showLine,D=k.showGradientLine,$=k.showGradientFill,E=k.anyFill,z=k.anyLine,O=T[0],I=O.trace,P,M,A=Ku(I),C=A.colorscale,R=A.reversescale,N=function(Z){if(Z.size())if(S)jr.fillGroupStyle(Z,r);else{var K="legendfill-"+I.uid;jr.gradient(Z,r,K,Qu(R),C,"fill")}},H=function(Z){if(Z.size()){var K="legendline-"+I.uid;jr.lineGroupStyle(Z),jr.gradient(Z,r,K,Qu(R),C,"stroke")}},B=Zf.hasMarkers(I)||!E?"M5,0":z?"M5,-2":"M5,-3",X=Pr.select(this),j=X.select(".legendfill").selectAll("path").data(S||$?[T]:[]);if(j.enter().append("path").classed("js-fill",!0),j.exit().remove(),j.attr("d",B+"h"+o+"v6h-"+o+"z").call(N),L||D){var q=f(void 0,I.line,q5,tg);M=Lr.minExtend(I,{line:{width:q}}),P=[Lr.minExtend(O,{trace:M})]}var U=X.select(".legendlines").selectAll("path").data(L||D?[P]:[]);U.enter().append("path").classed("js-line",!0),U.exit().remove(),U.attr("d",B+(D?"l"+o+",0.0001":"h"+o)).call(L?jr.lineGroupStyle:H)}function v(T){var k=rg(T),S=k.anyFill,L=k.anyLine,D=k.showLine,$=k.showMarker,E=T[0],z=E.trace,O=!$&&!L&&!S&&Zf.hasText(z),I,P;function M(j,q,U,Z){var K=Lr.nestedProperty(z,j).get(),ee=Lr.isArrayOrTypedArray(K)&&q?q(K):K;if(n&&ee&&Z!==void 0&&(ee=Z),U){if(ee<U[0])return U[0];if(ee>U[1])return U[1]}return ee}function A(j){return E._distinct&&E.index&&j[E.index]?j[E.index]:j[0]}if($||O||D){var C={},R={};if($){C.mc=M("marker.color",A),C.mx=M("marker.symbol",A),C.mo=M("marker.opacity",Lr.mean,[.2,1]),C.mlc=M("marker.line.color",A),C.mlw=M("marker.line.width",Lr.mean,[0,5],qi),R.marker={sizeref:1,sizemin:1,sizemode:"diameter"};var N=M("marker.size",Lr.mean,[2,16],eg);C.ms=N,R.marker.size=N}D&&(R.line={width:M("line.width",A,[0,10],tg)}),O&&(C.tx="Aa",C.tp=M("textposition",A),C.ts=10,C.tc=M("textfont.color",A),C.tf=M("textfont.family",A)),I=[Lr.minExtend(E,C)],P=Lr.minExtend(z,R),P.selectedpoints=null,P.texttemplate=null}var H=Pr.select(this).select("g.legendpoints"),B=H.selectAll("path.scatterpts").data($?I:[]);B.enter().insert("path",":first-child").classed("scatterpts",!0).attr("transform",s),B.exit().remove(),B.call(jr.pointStyle,P,r),$&&(I[0].mrc=3);var X=H.selectAll("g.pointtext").data(O?I:[]);X.enter().append("g").classed("pointtext",!0).append("text").attr("transform",s),X.exit().remove(),X.selectAll("text").call(jr.textPointStyle,P,r)}function u(T){var k=T[0].trace,S=k.type==="waterfall";if(T[0]._distinct&&S){var L=T[0].trace[T[0].dir].marker;return T[0].mc=L.color,T[0].mlw=L.line.width,T[0].mlc=L.line.color,p(T,this,"waterfall")}var D=[];k.visible&&S&&(D=T[0].hasTotals?[["increasing","M-6,-6V6H0Z"],["totals","M6,6H0L-6,-6H-0Z"],["decreasing","M6,6V-6H0Z"]]:[["increasing","M-6,-6V6H6Z"],["decreasing","M6,6V-6H-6Z"]]);var $=Pr.select(this).select("g.legendpoints").selectAll("path.legendwaterfall").data(D);$.enter().append("path").classed("legendwaterfall",!0).attr("transform",s).style("stroke-miterlimit",1),$.exit().remove(),$.each(function(E){var z=Pr.select(this),O=k[E[0]].marker,I=f(void 0,O.line,En,qi);z.attr("d",E[1]).style("stroke-width",I+"px").call(la.fill,O.color),I&&z.call(la.stroke,O.line.color)})}function h(T){p(T,this)}function d(T){p(T,this,"funnel")}function p(T,k,S){var L=T[0].trace,D=L.marker||{},$=D.line||{},E=S?L.visible&&L.type===S:Zu.traceIs(L,"bar"),z=Pr.select(k).select("g.legendpoints").selectAll("path.legend"+S).data(E?[T]:[]);z.enter().append("path").classed("legend"+S,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",s),z.exit().remove(),z.each(function(O){var I=Pr.select(this),P=O[0],M=f(P.mlw,D.line,En,qi);I.style("stroke-width",M+"px");var A=P.mcc;if(!a._inHover&&"mc"in P){var C=Ku(D),R=C.mid;R===void 0&&(R=(C.max+C.min)/2),A=jr.tryColorscale(D,"")(R)}var N=A||P.mc||D.color,H=D.pattern,B=H&&jr.getPatternAttr(H.shape,0,"");if(B){var X=jr.getPatternAttr(H.bgcolor,0,null),j=jr.getPatternAttr(H.fgcolor,0,null),q=H.fgopacity,U=ag(H.size,8,10),Z=ag(H.solidity,.5,1),K="legend-"+L.uid;I.call(jr.pattern,"legend",r,K,B,U,Z,A,H.fillmode,X,j,q)}else I.call(la.fill,N);M&&la.stroke(I,P.mlc||$.color)})}function m(T){var k=T[0].trace,S=Pr.select(this).select("g.legendpoints").selectAll("path.legendbox").data(k.visible&&Zu.traceIs(k,"box-violin")?[T]:[]);S.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform",s),S.exit().remove(),S.each(function(){var L=Pr.select(this);if((k.boxpoints==="all"||k.points==="all")&&la.opacity(k.fillcolor)===0&&la.opacity((k.line||{}).color)===0){var D=Lr.minExtend(k,{marker:{size:n?eg:Lr.constrain(k.marker.size,2,16),sizeref:1,sizemin:1,sizemode:"diameter"}});S.call(jr.pointStyle,D,r)}else{var $=f(void 0,k.line,En,qi);L.style("stroke-width",$+"px").call(la.fill,k.fillcolor),$&&la.stroke(L,k.line.color)}})}function y(T){var k=T[0].trace,S=Pr.select(this).select("g.legendpoints").selectAll("path.legendcandle").data(k.visible&&k.type==="candlestick"?[T,T]:[]);S.enter().append("path").classed("legendcandle",!0).attr("d",function(L,D){return D?"M-15,0H-8M-8,6V-6H8Z":"M15,0H8M8,-6V6H-8Z"}).attr("transform",s).style("stroke-miterlimit",1),S.exit().remove(),S.each(function(L,D){var $=Pr.select(this),E=k[D?"increasing":"decreasing"],z=f(void 0,E.line,En,qi);$.style("stroke-width",z+"px").call(la.fill,E.fillcolor),z&&la.stroke($,E.line.color)})}function b(T){var k=T[0].trace,S=Pr.select(this).select("g.legendpoints").selectAll("path.legendohlc").data(k.visible&&k.type==="ohlc"?[T,T]:[]);S.enter().append("path").classed("legendohlc",!0).attr("d",function(L,D){return D?"M-15,0H0M-8,-6V0":"M15,0H0M8,6V0"}).attr("transform",s).style("stroke-miterlimit",1),S.exit().remove(),S.each(function(L,D){var $=Pr.select(this),E=k[D?"increasing":"decreasing"],z=f(void 0,E.line,En,qi);$.style("fill","none").call(jr.dashLine,E.line.dash,z),z&&la.stroke($,E.line.color)})}function w(T){x(T,this,"pie")}function g(T){x(T,this,"funnelarea")}function x(T,k,S){var L=T[0],D=L.trace,$=S?D.visible&&D.type===S:Zu.traceIs(D,S),E=Pr.select(k).select("g.legendpoints").selectAll("path.legend"+S).data($?[T]:[]);if(E.enter().append("path").classed("legend"+S,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",s),E.exit().remove(),E.size()){var z=D.marker||{},O=f(Y5(z.line.width,L.pts),z.line,En,qi),I="pieLike",P=Lr.minExtend(D,{marker:{line:{width:O}}},I),M=Lr.minExtend(L,{trace:P},I);X5(E,M,P,r)}}function _(T){var k=T[0].trace,S,L=[];if(k.visible)switch(k.type){case"histogram2d":case"heatmap":L=[["M-15,-2V4H15V-2Z"]],S=!0;break;case"choropleth":case"choroplethmapbox":L=[["M-6,-6V6H6V-6Z"]],S=!0;break;case"densitymapbox":L=[["M-6,0 a6,6 0 1,0 12,0 a 6,6 0 1,0 -12,0"]],S="radial";break;case"cone":L=[["M-6,2 A2,2 0 0,0 -6,6 V6L6,4Z"],["M-6,-6 A2,2 0 0,0 -6,-2 L6,-4Z"],["M-6,-2 A2,2 0 0,0 -6,2 L6,0Z"]],S=!1;break;case"streamtube":L=[["M-6,2 A2,2 0 0,0 -6,6 H6 A2,2 0 0,1 6,2 Z"],["M-6,-6 A2,2 0 0,0 -6,-2 H6 A2,2 0 0,1 6,-6 Z"],["M-6,-2 A2,2 0 0,0 -6,2 H6 A2,2 0 0,1 6,-2 Z"]],S=!1;break;case"surface":L=[["M-6,-6 A2,3 0 0,0 -6,0 H6 A2,3 0 0,1 6,-6 Z"],["M-6,1 A2,3 0 0,1 -6,6 H6 A2,3 0 0,0 6,0 Z"]],S=!0;break;case"mesh3d":L=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],S=!1;break;case"volume":L=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],S=!0;break;case"isosurface":L=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6 A12,24 0 0,0 6,-6 L0,6Z"]],S=!1;break}var D=Pr.select(this).select("g.legendpoints").selectAll("path.legend3dandfriends").data(L);D.enter().append("path").classed("legend3dandfriends",!0).attr("transform",s).style("stroke-miterlimit",1),D.exit().remove(),D.each(function($,E){var z=Pr.select(this),O=Ku(k),I=O.colorscale,P=O.reversescale,M=function(N){if(N.size()){var H="legendfill-"+k.uid;jr.gradient(N,r,H,Qu(P,S==="radial"),I,"fill")}},A;if(I){if(!S){var R=I.length;A=E===0?I[P?R-1:0][1]:E===1?I[P?0:R-1][1]:I[Math.floor((R-1)/2)][1]}}else{var C=k.vertexcolor||k.facecolor||k.color;A=Lr.isArrayOrTypedArray(C)?C[E]||C[0]:C}z.attr("d",$[0]),A?z.call(la.fill,A):z.call(M)})}};function Qu(t,e){var r=e?"radial":"horizontal";return r+(t?"":"reversed")}function rg(t){var e=t[0].trace,r=e.contours,a=Zf.hasLines(e),i=Zf.hasMarkers(e),n=e.visible&&e.fill&&e.fill!=="none",o=!1,l=!1;if(r){var s=r.coloring;s==="lines"?o=!0:a=s==="none"||s==="heatmap"||r.showlines,r.type==="constraint"?n=r._operation!=="=":(s==="fill"||s==="heatmap")&&(l=!0)}return{showMarker:i,showLine:a,showFill:n,showGradientLine:o,showGradientFill:l,anyLine:a||o,anyFill:n||l}}function ag(t,e,r){return t&&Lr.isArrayOrTypedArray(t)?e:t>r?r:t}var qr=gt,ar=me,Xd=cr,Si=ot,ig=ls,Ju=Qa,fr=$t,Sf=ht,mn=br,ng=O5,hr=Ww,up=Ur,Zw=up.LINE_SPACING,uo=up.FROM_TL,og=up.FROM_BR,lg=j5,Z5=qw,sg=Bo,ao=1,K5=/^legend[0-9]*$/,Kw=function(e,r){if(r)fg(e,r);else{var a=e._fullLayout,i=a._legends,n=a._infolayer.selectAll('[class^="legend"]');n.each(function(){var f=qr.select(this),c=f.attr("class"),v=c.split(" ")[0];v.match(K5)&&i.indexOf(v)===-1&&f.remove()});for(var o=0;o<i.length;o++){var l=i[o],s=e._fullLayout[l];fg(e,s)}}};function Q5(t,e,r){if(!(e.title.side!=="top center"&&e.title.side!=="top right")){var a=e.title.font,i=a.size*Zw,n=0,o=t.node(),l=fr.bBox(o).width;e.title.side==="top center"?n=.5*(e._width-2*r-2*hr.titlePad-l):e.title.side==="top right"&&(n=e._width-2*r-2*hr.titlePad-l),mn.positionText(t,r+hr.titlePad+n,r+i)}}function fg(t,e){var r=e||{},a=t._fullLayout,i=Vc(r),n,o,l=r._inHover;if(l?(o=r.layer,n="hover"):(o=a._infolayer,n=i),!!o){n+=a._uid,t._legendMouseDownTime||(t._legendMouseDownTime=0);var s;if(l){if(!r.entries)return;s=lg(r.entries,r)}else{for(var f=(t.calcdata||[]).slice(),c=a.shapes,v=0;v<c.length;v++){var u=c[v];if(u.showlegend){var h={_isShape:!0,_fullInput:u,index:u._index,name:u.name||u.label.text||"shape "+u._index,legend:u.legend,legendgroup:u.legendgroup,legendgrouptitle:u.legendgrouptitle,legendrank:u.legendrank,legendwidth:u.legendwidth,showlegend:u.showlegend,visible:u.visible,opacity:u.opacity,mode:u.type==="line"?"lines":"markers",line:u.line,marker:{line:u.line,color:u.fillcolor,size:12,symbol:u.type==="rect"?"square":u.type==="circle"?"circle":"hexagon2"}};f.push([{trace:h}])}}s=a.showlegend&&lg(f,r,a._legends.length>1)}var d=a.hiddenlabels||[];if(!l&&(!a.showlegend||!s.length))return o.selectAll("."+i).remove(),a._topdefs.select("#"+n).remove(),Xd.autoMargin(t,i);var p=ar.ensureSingle(o,"g",i,function(k){l||k.attr("pointer-events","all")}),m=ar.ensureSingleById(a._topdefs,"clipPath",n,function(k){k.append("rect")}),y=ar.ensureSingle(p,"rect","bg",function(k){k.attr("shape-rendering","crispEdges")});y.call(Sf.stroke,r.bordercolor).call(Sf.fill,r.bgcolor).style("stroke-width",r.borderwidth+"px");var b=ar.ensureSingle(p,"g","scrollbox"),w=r.title;r._titleWidth=0,r._titleHeight=0;var g;w.text?(g=ar.ensureSingle(b,"text",i+"titletext"),g.attr("text-anchor","start").call(fr.font,w.font).text(w.text),Lf(g,b,t,r,ao)):b.selectAll("."+i+"titletext").remove();var x=ar.ensureSingle(p,"rect","scrollbar",function(k){k.attr(hr.scrollBarEnterAttrs).call(Sf.fill,hr.scrollBarColor)}),_=b.selectAll("g.groups").data(s);_.enter().append("g").attr("class","groups"),_.exit().remove();var T=_.selectAll("g.traces").data(ar.identity);T.enter().append("g").attr("class","traces"),T.exit().remove(),T.style("opacity",function(k){var S=k[0].trace;return Si.traceIs(S,"pie-like")?d.indexOf(k[0].label)!==-1?.5:1:S.visible==="legendonly"?.5:1}).each(function(){qr.select(this).call(J5,t,r)}).call(Z5,t,r).each(function(){l||qr.select(this).call(e3,t,i)}),ar.syncOrAsync([Xd.previousPromises,function(){return a3(t,_,T,r)},function(){var k=a._size,S=r.borderwidth,L=r.xref==="paper",D=r.yref==="paper";if(w.text&&Q5(g,r,S),!l){var $,E;L?$=k.l+k.w*r.x-uo[Kf(r)]*r._width:$=a.width*r.x-uo[Kf(r)]*r._width,D?E=k.t+k.h*(1-r.y)-uo[Qf(r)]*r._effHeight:E=a.height*(1-r.y)-uo[Qf(r)]*r._effHeight;var z=i3(t,i,$,E);if(z)return;if(a.margin.autoexpand){var O=$,I=E;$=L?ar.constrain($,0,a.width-r._width):O,E=D?ar.constrain(E,0,a.height-r._effHeight):I,$!==O&&ar.log("Constrain "+i+".x to make legend fit inside graph"),E!==I&&ar.log("Constrain "+i+".y to make legend fit inside graph")}fr.setTranslate(p,$,E)}if(x.on(".drag",null),p.on("wheel",null),l||r._height<=r._maxHeight||t._context.staticPlot){var P=r._effHeight;l&&(P=r._height),y.attr({width:r._width-S,height:P-S,x:S/2,y:S/2}),fr.setTranslate(b,0,0),m.select("rect").attr({width:r._width-2*S,height:P-2*S,x:S,y:S}),fr.setClipUrl(b,n,t),fr.setRect(x,0,0,0,0),delete r._scrollY}else{var M=Math.max(hr.scrollBarMinHeight,r._effHeight*r._effHeight/r._height),A=r._effHeight-M-2*hr.scrollBarMargin,C=r._height-r._effHeight,R=A/C,N=Math.min(r._scrollY||0,C);y.attr({width:r._width-2*S+hr.scrollBarWidth+hr.scrollBarMargin,height:r._effHeight-S,x:S/2,y:S/2}),m.select("rect").attr({width:r._width-2*S+hr.scrollBarWidth+hr.scrollBarMargin,height:r._effHeight-2*S,x:S,y:S+N}),fr.setClipUrl(b,n,t),K(N,M,R),p.on("wheel",function(){N=ar.constrain(r._scrollY+qr.event.deltaY/A*C,0,C),K(N,M,R),N!==0&&N!==C&&qr.event.preventDefault()});var H,B,X,j=function(G,J,oe){var fe=(oe-J)/R+G;return ar.constrain(fe,0,C)},q=function(G,J,oe){var fe=(J-oe)/R+G;return ar.constrain(fe,0,C)},U=qr.behavior.drag().on("dragstart",function(){var G=qr.event.sourceEvent;G.type==="touchstart"?H=G.changedTouches[0].clientY:H=G.clientY,X=N}).on("drag",function(){var G=qr.event.sourceEvent;G.buttons===2||G.ctrlKey||(G.type==="touchmove"?B=G.changedTouches[0].clientY:B=G.clientY,N=j(X,H,B),K(N,M,R))});x.call(U);var Z=qr.behavior.drag().on("dragstart",function(){var G=qr.event.sourceEvent;G.type==="touchstart"&&(H=G.changedTouches[0].clientY,X=N)}).on("drag",function(){var G=qr.event.sourceEvent;G.type==="touchmove"&&(B=G.changedTouches[0].clientY,N=q(X,H,B),K(N,M,R))});b.call(Z)}function K(G,J,oe){r._scrollY=t._fullLayout[i]._scrollY=G,fr.setTranslate(b,0,-G),fr.setRect(x,r._width,hr.scrollBarMargin+G*oe,hr.scrollBarWidth,J),m.select("rect").attr("y",S+G)}if(t._context.edits.legendPosition){var ee,le,ye,se;p.classed("cursor-move",!0),Ju.init({element:p.node(),gd:t,prepFn:function(){var G=fr.getTranslate(p);ye=G.x,se=G.y},moveFn:function(G,J){var oe=ye+G,fe=se+J;fr.setTranslate(p,oe,fe),ee=Ju.align(oe,r._width,k.l,k.l+k.w,r.xanchor),le=Ju.align(fe+r._height,-r._height,k.t+k.h,k.t,r.yanchor)},doneFn:function(){if(ee!==void 0&&le!==void 0){var G={};G[i+".x"]=ee,G[i+".y"]=le,Si.call("_guiRelayout",t,G)}},clickFn:function(G,J){var oe=o.selectAll("g.traces").filter(function(){var fe=this.getBoundingClientRect();return J.clientX>=fe.left&&J.clientX<=fe.right&&J.clientY>=fe.top&&J.clientY<=fe.bottom});oe.size()>0&&Qw(t,p,oe,G,J)}})}}],t)}}function js(t,e,r){var a=t[0],i=a.width,n=e.entrywidthmode,o=a.trace.legendwidth||e.entrywidth;return n==="fraction"?e._maxWidth*o:r+(o||i)}function Qw(t,e,r,a,i){var n=r.data()[0][0].trace,o={event:i,node:r.node(),curveNumber:n.index,expandedIndex:n._expandedIndex,data:t.data,layout:t.layout,frames:t._transitionData._frames,config:t._context,fullData:t._fullData,fullLayout:t._fullLayout};n._group&&(o.group=n._group),Si.traceIs(n,"pie-like")&&(o.label=r.datum()[0].label);var l=ig.triggerHandler(t,"plotly_legendclick",o);if(a===1){if(l===!1)return;e._clickTimeout=setTimeout(function(){t._fullLayout&&ng(r,t,a)},t._context.doubleClickDelay)}else if(a===2){e._clickTimeout&&clearTimeout(e._clickTimeout),t._legendMouseDownTime=0;var s=ig.triggerHandler(t,"plotly_legenddoubleclick",o);s!==!1&&l!==!1&&ng(r,t,a)}}function J5(t,e,r){var a=Vc(r),i=t.data()[0][0],n=i.trace,o=Si.traceIs(n,"pie-like"),l=!r._inHover&&e._context.edits.legendText&&!o,s=r._maxNameLength,f,c;i.groupTitle?(f=i.groupTitle.text,c=i.groupTitle.font):(c=r.font,r.entries?f=i.text:(f=o?i.label:n.name,n._meta&&(f=ar.templateString(f,n._meta))));var v=ar.ensureSingle(t,"text",a+"text");v.attr("text-anchor","start").call(fr.font,c).text(l?cg(f,s):f);var u=r.itemwidth+hr.itemGap*2;mn.positionText(v,u,0),l?v.call(mn.makeEditable,{gd:e,text:f}).call(Lf,t,e,r).on("edit",function(h){this.text(cg(h,s)).call(Lf,t,e,r);var d=i.trace._fullInput||{},p={};if(Si.hasTransform(d,"groupby")){var m=Si.getTransformIndices(d,"groupby"),y=m[m.length-1],b=ar.keyedContainer(d,"transforms["+y+"].styles","target","value.name");b.set(i.trace._group,h),p=b.constructUpdate()}else p.name=h;return d._isShape?Si.call("_guiRelayout",e,"shapes["+n.index+"].name",p.name):Si.call("_guiRestyle",e,p,n.index)}):Lf(v,t,e,r)}function cg(t,e){var r=Math.max(4,e);if(t&&t.trim().length>=r/2)return t;t=t||"";for(var a=r-t.length;a>0;a--)t+=" ";return t}function e3(t,e,r){var a=e._context.doubleClickDelay,i,n=1,o=ar.ensureSingle(t,"rect",r+"toggle",function(l){e._context.staticPlot||l.style("cursor","pointer").attr("pointer-events","all"),l.call(Sf.fill,"rgba(0,0,0,0)")});e._context.staticPlot||(o.on("mousedown",function(){i=new Date().getTime(),i-e._legendMouseDownTime<a?n+=1:(n=1,e._legendMouseDownTime=i)}),o.on("mouseup",function(){if(!(e._dragged||e._editing)){var l=e._fullLayout[r];new Date().getTime()-e._legendMouseDownTime>a&&(n=Math.max(n-1,1)),Qw(e,l,t,n,qr.event)}}))}function Lf(t,e,r,a,i){a._inHover&&t.attr("data-notex",!0),mn.convertToTspans(t,r,function(){t3(e,r,a,i)})}function t3(t,e,r,a){var i=t.data()[0][0];if(!r._inHover&&i&&!i.trace.showlegend){t.remove();return}var n=t.select("g[class*=math-group]"),o=n.node(),l=Vc(r);r||(r=e._fullLayout[l]);var s=r.borderwidth,f;a===ao?f=r.title.font:i.groupTitle?f=i.groupTitle.font:f=r.font;var c=f.size*Zw,v,u;if(o){var h=fr.bBox(o);v=h.height,u=h.width,a===ao?fr.setTranslate(n,s,s+v*.75):fr.setTranslate(n,0,v*.25)}else{var d="."+l+(a===ao?"title":"")+"text",p=t.select(d),m=mn.lineCount(p),y=p.node();if(v=c*m,u=y?fr.bBox(y).width:0,a===ao)r.title.side==="left"&&(u+=hr.itemGap*2),mn.positionText(p,s+hr.titlePad,s+c);else{var b=hr.itemGap*2+r.itemwidth;i.groupTitle&&(b=hr.itemGap,u-=r.itemwidth),mn.positionText(p,b,-c*((m-1)/2-.3))}}a===ao?(r._titleWidth=u,r._titleHeight=v):(i.lineHeight=c,i.height=Math.max(v,16)+3,i.width=u)}function r3(t){var e=0,r=0,a=t.title.side;return a&&(a.indexOf("left")!==-1&&(e=t._titleWidth),a.indexOf("top")!==-1&&(r=t._titleHeight)),[e,r]}function a3(t,e,r,a){var i=t._fullLayout,n=Vc(a);a||(a=i[n]);var o=i._size,l=sg.isVertical(a),s=sg.isGrouped(a),f=a.entrywidthmode==="fraction",c=a.borderwidth,v=2*c,u=hr.itemGap,h=a.itemwidth+u*2,d=2*(c+u),p=Qf(a),m=a.y<0||a.y===0&&p==="top",y=a.y>1||a.y===1&&p==="bottom",b=a.tracegroupgap,w={};a._maxHeight=Math.max(m||y?i.height/2:o.h,30);var g=0;a._width=0,a._height=0;var x=r3(a);if(l)r.each(function(X){var j=X[0].height;fr.setTranslate(this,c+x[0],c+x[1]+a._height+j/2+u),a._height+=j,a._width=Math.max(a._width,X[0].width)}),g=h+a._width,a._width+=u+h+v,a._height+=d,s&&(e.each(function(X,j){fr.setTranslate(this,0,j*a.tracegroupgap)}),a._height+=(a._lgroupsLength-1)*a.tracegroupgap);else{var _=Kf(a),T=a.x<0||a.x===0&&_==="right",k=a.x>1||a.x===1&&_==="left",S=y||m,L=i.width/2;a._maxWidth=Math.max(T?S&&_==="left"?o.l+o.w:L:k?S&&_==="right"?o.r+o.w:L:o.w,2*h);var D=0,$=0;r.each(function(X){var j=js(X,a,h);D=Math.max(D,j),$+=j}),g=null;var E=0;if(s){var z=0,O=0,I=0;e.each(function(){var X=0,j=0;qr.select(this).selectAll("g.traces").each(function(U){var Z=js(U,a,h),K=U[0].height;fr.setTranslate(this,x[0],x[1]+c+u+K/2+j),j+=K,X=Math.max(X,Z),w[U[0].trace.legendgroup]=X});var q=X+u;O>0&&q+c+O>a._maxWidth?(E=Math.max(E,O),O=0,I+=z+b,z=j):z=Math.max(z,j),fr.setTranslate(this,O,I),O+=q}),a._width=Math.max(E,O)+c,a._height=I+z+d}else{var P=r.size(),M=$+v+(P-1)*u<a._maxWidth,A=0,C=0,R=0,N=0;r.each(function(X){var j=X[0].height,q=js(X,a,h),U=M?q:D;f||(U+=u),U+c+C-u>=a._maxWidth&&(E=Math.max(E,N),C=0,R+=A,a._height+=A,A=0),fr.setTranslate(this,x[0]+c+C,x[1]+c+R+j/2+u),N=C+q+u,C+=U,A=Math.max(A,j)}),M?(a._width=C+v,a._height=A+d):(a._width=Math.max(E,N)+v,a._height+=A+d)}}a._width=Math.ceil(Math.max(a._width+x[0],a._titleWidth+2*(c+hr.titlePad))),a._height=Math.ceil(Math.max(a._height+x[1],a._titleHeight+2*(c+hr.itemGap))),a._effHeight=Math.min(a._height,a._maxHeight);var H=t._context.edits,B=H.legendText||H.legendPosition;r.each(function(X){var j=qr.select(this).select("."+n+"toggle"),q=X[0].height,U=X[0].trace.legendgroup,Z=js(X,a,h);s&&U!==""&&(Z=w[U]);var K=B?h:g||Z;!l&&!f&&(K+=u/2),fr.setRect(j,0,-q/2,K,q)})}function i3(t,e,r,a){var i=t._fullLayout,n=i[e],o=Kf(n),l=Qf(n),s=n.xref==="paper",f=n.yref==="paper";t._fullLayout._reservedMargin[e]={};var c=n.y<.5?"b":"t",v=n.x<.5?"l":"r",u={r:i.width-r,l:r+n._width,b:i.height-a,t:a+n._effHeight};if(s&&f)return Xd.autoMargin(t,e,{x:n.x,y:n.y,l:n._width*uo[o],r:n._width*og[o],b:n._effHeight*og[l],t:n._effHeight*uo[l]});s?t._fullLayout._reservedMargin[e][c]=u[c]:f||n.orientation==="v"?t._fullLayout._reservedMargin[e][v]=u[v]:t._fullLayout._reservedMargin[e][c]=u[c]}function Kf(t){return ar.isRightAnchor(t)?"right":ar.isCenterAnchor(t)?"center":"left"}function Qf(t){return ar.isBottomAnchor(t)?"bottom":ar.isMiddleAnchor(t)?"middle":"top"}function Vc(t){return t._id||"legend"}var ln=gt,ai=wt,ug=ga,ir=me,ev=ir.strTranslate,n3=ir.strRotate,o3=ls,fa=br,l3=P5,Va=$t,yr=ht,Bs=Qa,Ti=Bt,Ao=ot,Sa=xa,xn=Tc,s3=Yw,f3=Kw,Jw=xn.YANGLE,vp=Math.PI*Jw/180,c3=1/Math.sin(vp),u3=Math.cos(vp),v3=Math.sin(vp),It=xn.HOVERARROWSIZE,Tt=xn.HOVERTEXTPAD,vg={box:!0,ohlc:!0,violin:!0,candlestick:!0},d3={scatter:!0,scattergl:!0,splom:!0};Uc.hover=function(e,r,a,i){e=ir.getGraphDiv(e);var n=r.target;ir.throttle(e._fullLayout._uid+xn.HOVERID,xn.HOVERMINTIME,function(){h3(e,r,a,i,n)})};Uc.loneHover=function(e,r){var a=!0;Array.isArray(e)||(a=!1,e=[e]);var i=r.gd,n=iT(i),o=nT(i),l=e.map(function(m){var y=m._x0||m.x0||m.x||0,b=m._x1||m.x1||m.x||0,w=m._y0||m.y0||m.y||0,g=m._y1||m.y1||m.y||0,x=m.eventData;if(x){var _=Math.min(y,b),T=Math.max(y,b),k=Math.min(w,g),S=Math.max(w,g),L=m.trace;if(Ao.traceIs(L,"gl3d")){var D=i._fullLayout[L.scene]._scene.container,$=D.offsetLeft,E=D.offsetTop;_+=$,T+=$,k+=E,S+=E}x.bbox={x0:_+o,x1:T+o,y0:k+n,y1:S+n},r.inOut_bbox&&r.inOut_bbox.push(x.bbox)}else x=!1;return{color:m.color||yr.defaultLine,x0:m.x0||m.x||0,x1:m.x1||m.x||0,y0:m.y0||m.y||0,y1:m.y1||m.y||0,xLabel:m.xLabel,yLabel:m.yLabel,zLabel:m.zLabel,text:m.text,name:m.name,idealAlign:m.idealAlign,borderColor:m.borderColor,fontFamily:m.fontFamily,fontSize:m.fontSize,fontColor:m.fontColor,nameLength:m.nameLength,textAlign:m.textAlign,trace:m.trace||{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0,hovertemplate:m.hovertemplate||!1,hovertemplateLabels:m.hovertemplateLabels||!1,eventData:x}}),s=!1,f=tT(l,{gd:i,hovermode:"closest",rotateLabels:s,bgColor:r.bgColor||yr.background,container:ln.select(r.container),outerContainer:r.outerContainer||r.container}),c=f.hoverLabels,v=5,u=0,h=0;c.sort(function(m,y){return m.y0-y.y0}).each(function(m,y){var b=m.y0-m.by/2;b-v<u?m.offset=u-b+v:m.offset=0,u=b+m.by+m.offset,y===r.anchorIndex&&(h=m.offset)}).each(function(m){m.offset-=h});var d=i._fullLayout._invScaleX,p=i._fullLayout._invScaleY;return aT(c,s,d,p),a?c:c.node()};function h3(t,e,r,a,i){r||(r="xy");var n=Array.isArray(r)?r:[r],o=t._fullLayout,l=o._plots||[],s=l[r],f=o._has("cartesian");if(s){var c=s.overlays.map(function(V){return V.id});n=n.concat(c)}for(var v=n.length,u=new Array(v),h=new Array(v),d=!1,p=0;p<v;p++){var m=n[p];if(l[m])d=!0,u[p]=l[m].xaxis,h[p]=l[m].yaxis;else if(o[m]&&o[m]._subplot){var y=o[m]._subplot;u[p]=y.xaxis,h[p]=y.yaxis}else{ir.warn("Unrecognized subplot: "+m);return}}var b=e.hovermode||o.hovermode;if(b&&!d&&(b="closest"),["x","y","closest","x unified","y unified"].indexOf(b)===-1||!t.calcdata||t.querySelector(".zoombox")||t._dragging)return Bs.unhoverRaw(t,e);var w=o.hoverdistance;w===-1&&(w=1/0);var g=o.spikedistance;g===-1&&(g=1/0);var x=[],_=[],T,k,S,L,D,$,E,z,O,I,P,M,A,C={hLinePoint:null,vLinePoint:null},R=!1;if(Array.isArray(e))for(b="array",S=0;S<e.length;S++)D=t.calcdata[e[S].curveNumber||0],D&&($=D[0].trace,D[0].trace.hoverinfo!=="skip"&&(_.push(D),$.orientation==="h"&&(R=!0)));else{for(L=0;L<t.calcdata.length;L++)D=t.calcdata[L],$=D[0].trace,$.hoverinfo!=="skip"&&Sa.isTraceInSubplots($,n)&&(_.push(D),$.orientation==="h"&&(R=!0));var N=!i,H,B;if(N)"xpx"in e?H=e.xpx:H=u[0]._length/2,"ypx"in e?B=e.ypx:B=h[0]._length/2;else{if(o3.triggerHandler(t,"plotly_beforehover",e)===!1)return;var X=i.getBoundingClientRect();H=e.clientX-X.left,B=e.clientY-X.top,o._calcInverseTransform(t);var j=ir.apply3DTransform(o._invTransform)(H,B);if(H=j[0],B=j[1],H<0||H>u[0]._length||B<0||B>h[0]._length)return Bs.unhoverRaw(t,e)}if(e.pointerX=H+u[0]._offset,e.pointerY=B+h[0]._offset,"xval"in e?T=Sa.flat(n,e.xval):T=Sa.p2c(u,H),"yval"in e?k=Sa.flat(n,e.yval):k=Sa.p2c(h,B),!ai(T[0])||!ai(k[0]))return ir.warn("Fx.hover failed",e,t),Bs.unhoverRaw(t,e)}var q=1/0;function U(V,ie){for(L=0;L<_.length;L++)if(D=_[L],!(!D||!D[0]||!D[0].trace)&&($=D[0].trace,!($.visible!==!0||$._length===0)&&["carpet","contourcarpet"].indexOf($._module.name)===-1)){if($.type==="splom"?(z=0,E=n[z]):(E=Sa.getSubplot($),z=n.indexOf(E)),O=b,Sa.isUnifiedHover(O)&&(O=O.charAt(0)),M={cd:D,trace:$,xa:u[z],ya:h[z],maxHoverDistance:w,maxSpikeDistance:g,index:!1,distance:Math.min(q,w),spikeDistance:1/0,xSpike:void 0,ySpike:void 0,color:yr.defaultLine,name:$.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},o[E]&&(M.subplot=o[E]._subplot),o._splomScenes&&o._splomScenes[$.uid]&&(M.scene=o._splomScenes[$.uid]),A=x.length,O==="array"){var re=e[L];"pointNumber"in re?(M.index=re.pointNumber,O="closest"):(O="","xval"in re&&(I=re.xval,O="x"),"yval"in re&&(P=re.yval,O=O?"closest":"y"))}else V!==void 0&&ie!==void 0?(I=V,P=ie):(I=T[z],P=k[z]);if(w!==0)if($._module&&$._module.hoverPoints){var ke=$._module.hoverPoints(M,I,P,O,{finiteRange:!0,hoverLayer:o._hoverlayer});if(ke)for(var _e,ve=0;ve<ke.length;ve++)_e=ke[ve],ai(_e.x0)&&ai(_e.y0)&&x.push(g3(_e,b))}else ir.log("Unrecognized trace type in hover:",$);if(b==="closest"&&x.length>A&&(x.splice(0,A),q=x[0].distance),f&&g!==0&&x.length===0){M.distance=g,M.index=!1;var Q=$._module.hoverPoints(M,I,P,"closest",{hoverLayer:o._hoverlayer});if(Q&&(Q=Q.filter(function(st){return st.spikeDistance<=g})),Q&&Q.length){var Le,ze=Q.filter(function(st){return st.xa.showspikes&&st.xa.spikesnap!=="hovered data"});if(ze.length){var Ne=ze[0];ai(Ne.x0)&&ai(Ne.y0)&&(Le=K(Ne),(!C.vLinePoint||C.vLinePoint.spikeDistance>Le.spikeDistance)&&(C.vLinePoint=Le))}var tt=Q.filter(function(st){return st.ya.showspikes&&st.ya.spikesnap!=="hovered data"});if(tt.length){var vt=tt[0];ai(vt.x0)&&ai(vt.y0)&&(Le=K(vt),(!C.hLinePoint||C.hLinePoint.spikeDistance>Le.spikeDistance)&&(C.hLinePoint=Le))}}}}}U();function Z(V,ie,re){for(var ke=null,_e=1/0,ve,Q=0;Q<V.length;Q++)ve=V[Q].spikeDistance,re&&Q===0&&(ve=-1/0),ve<=_e&&ve<=ie&&(ke=V[Q],_e=ve);return ke}function K(V){return V?{xa:V.xa,ya:V.ya,x:V.xSpike!==void 0?V.xSpike:(V.x0+V.x1)/2,y:V.ySpike!==void 0?V.ySpike:(V.y0+V.y1)/2,distance:V.distance,spikeDistance:V.spikeDistance,curveNumber:V.trace.index,color:V.color,pointNumber:V.index}:null}var ee={fullLayout:o,container:o._hoverlayer,event:e},le=t._spikepoints,ye={vLinePoint:C.vLinePoint,hLinePoint:C.hLinePoint};t._spikepoints=ye;var se=function(){x.sort(function(V,ie){return V.distance-ie.distance}),x=x3(x,b)};se();var G=b.charAt(0),J=(G==="x"||G==="y")&&x[0]&&d3[x[0].trace.type];if(f&&g!==0&&x.length!==0){var oe=x.filter(function(V){return V.ya.showspikes}),fe=Z(oe,g,J);C.hLinePoint=K(fe);var pe=x.filter(function(V){return V.xa.showspikes}),ge=Z(pe,g,J);C.vLinePoint=K(ge)}if(x.length===0){var ue=Bs.unhoverRaw(t,e);return f&&(C.hLinePoint!==null||C.vLinePoint!==null)&&pg(le)&&hg(t,C,ee),ue}if(f&&pg(le)&&hg(t,C,ee),Sa.isXYhover(O)&&x[0].length!==0&&x[0].trace.type!=="splom"){var Ce=x[0];vg[Ce.trace.type]?x=x.filter(function(V){return V.trace.index===Ce.trace.index}):x=[Ce];var ce=x.length,De=yg("x",Ce,o),Ee=yg("y",Ce,o);U(De,Ee);var $e=[],te={},Te=0,ne=function(V){var ie=vg[V.trace.type]?eT(V):V.trace.index;if(!te[ie])Te++,te[ie]=Te,$e.push(V);else{var re=te[ie]-1,ke=$e[re];re>0&&Math.abs(V.distance)<Math.abs(ke.distance)&&($e[re]=V)}},de;for(de=0;de<ce;de++)ne(x[de]);for(de=x.length-1;de>ce-1;de--)ne(x[de]);x=$e,se()}var he=t._hoverdata,Ae=[],Me=iT(t),we=nT(t);for(S=0;S<x.length;S++){var be=x[S],Ve=Sa.makeEventData(be,be.trace,be.cd);if(be.hovertemplate!==!1){var Fe=!1;be.cd[be.index]&&be.cd[be.index].ht&&(Fe=be.cd[be.index].ht),be.hovertemplate=Fe||be.trace.hovertemplate||!1}if(be.xa&&be.ya){var Oe=be.x0+be.xa._offset,Ge=be.x1+be.xa._offset,lt=be.y0+be.ya._offset,xe=be.y1+be.ya._offset,Ze=Math.min(Oe,Ge),Xe=Math.max(Oe,Ge),Ye=Math.min(lt,xe),He=Math.max(lt,xe);Ve.bbox={x0:Ze+we,x1:Xe+we,y0:Ye+Me,y1:He+Me}}be.eventData=[Ve],Ae.push(Ve)}t._hoverdata=Ae;var Ue=b==="y"&&(_.length>1||x.length>1)||b==="closest"&&R&&x.length>1,Je=yr.combine(o.plot_bgcolor||yr.background,o.paper_bgcolor),F=tT(x,{gd:t,hovermode:b,rotateLabels:Ue,bgColor:Je,container:o._hoverlayer,outerContainer:o._paper.node(),commonLabelOpts:o.hoverlabel,hoverdistance:o.hoverdistance}),W=F.hoverLabels;if(Sa.isUnifiedHover(b)||(m3(W,Ue,o,F.commonLabelBoundingBox),aT(W,Ue,o._invScaleX,o._invScaleY)),i&&i.tagName){var Y=Ao.getComponentMethod("annotations","hasClickToShow")(t,Ae);l3(ln.select(i),Y?"pointer":"")}!i||a||!b3(t,e,he)||(he&&t.emit("plotly_unhover",{event:e,points:he}),t.emit("plotly_hover",{event:e,points:t._hoverdata,xaxes:u,yaxes:h,xvals:T,yvals:k}))}function eT(t){return[t.trace.index,t.index,t.x0,t.y0,t.name,t.attr,t.xa?t.xa._id:"",t.ya?t.ya._id:""].join(",")}var p3=/<extra>([\s\S]*)<\/extra>/;function tT(t,e){var r=e.gd,a=r._fullLayout,i=e.hovermode,n=e.rotateLabels,o=e.bgColor,l=e.container,s=e.outerContainer,f=e.commonLabelOpts||{};if(t.length===0)return[[]];var c=e.fontFamily||xn.HOVERFONT,v=e.fontSize||xn.HOVERFONTSIZE,u=t[0],h=u.xa,d=u.ya,p=i.charAt(0),m=p+"Label",y=u[m];if(y===void 0&&h.type==="multicategory")for(var b=0;b<t.length&&(y=t[b][m],y===void 0);b++);var w=zn(r,s),g=w.top,x=w.width,_=w.height,T=y!==void 0&&u.distance<=e.hoverdistance&&(i==="x"||i==="y");if(T){var k=!0,S,L;for(S=0;S<t.length;S++)if(k&&t[S].zLabel===void 0&&(k=!1),L=t[S].hoverinfo||t[S].trace.hoverinfo,L){var D=Array.isArray(L)?L:L.split("+");if(D.indexOf("all")===-1&&D.indexOf(i)===-1){T=!1;break}}k&&(T=!1)}var $=l.selectAll("g.axistext").data(T?[0]:[]);$.enter().append("g").classed("axistext",!0),$.exit().remove();var E={minX:0,maxX:0,minY:0,maxY:0};if($.each(function(){var ce=ln.select(this),De=ir.ensureSingle(ce,"path","",function(Ye){Ye.style({"stroke-width":"1px"})}),Ee=ir.ensureSingle(ce,"text","",function(Ye){Ye.attr("data-notex",1)}),$e=f.bgcolor||yr.defaultLine,te=f.bordercolor||yr.contrast($e),Te=yr.contrast($e),ne={family:f.font.family||c,size:f.font.size||v,color:f.font.color||Te};De.style({fill:$e,stroke:te}),Ee.text(y).call(Va.font,ne).call(fa.positionText,0,0).call(fa.convertToTspans,r),ce.attr("transform","");var de=zn(r,Ee.node()),he,Ae;if(i==="x"){var Me=h.side==="top"?"-":"";Ee.attr("text-anchor","middle").call(fa.positionText,0,h.side==="top"?g-de.bottom-It-Tt:g-de.top+It+Tt),he=h._offset+(u.x0+u.x1)/2,Ae=d._offset+(h.side==="top"?0:d._length);var we=de.width/2+Tt;he<we?(he=we,De.attr("d","M-"+(we-It)+",0L-"+(we-It*2)+","+Me+It+"H"+we+"v"+Me+(Tt*2+de.height)+"H-"+we+"V"+Me+It+"Z")):he>a.width-we?(he=a.width-we,De.attr("d","M"+(we-It)+",0L"+we+","+Me+It+"v"+Me+(Tt*2+de.height)+"H-"+we+"V"+Me+It+"H"+(we-It*2)+"Z")):De.attr("d","M0,0L"+It+","+Me+It+"H"+we+"v"+Me+(Tt*2+de.height)+"H-"+we+"V"+Me+It+"H-"+It+"Z"),E.minX=he-we,E.maxX=he+we,h.side==="top"?(E.minY=Ae-(Tt*2+de.height),E.maxY=Ae-Tt):(E.minY=Ae+Tt,E.maxY=Ae+(Tt*2+de.height))}else{var be,Ve,Fe;d.side==="right"?(be="start",Ve=1,Fe="",he=h._offset+h._length):(be="end",Ve=-1,Fe="-",he=h._offset),Ae=d._offset+(u.y0+u.y1)/2,Ee.attr("text-anchor",be),De.attr("d","M0,0L"+Fe+It+","+It+"V"+(Tt+de.height/2)+"h"+Fe+(Tt*2+de.width)+"V-"+(Tt+de.height/2)+"H"+Fe+It+"V-"+It+"Z"),E.minY=Ae-(Tt+de.height/2),E.maxY=Ae+(Tt+de.height/2),d.side==="right"?(E.minX=he+It,E.maxX=he+It+(Tt*2+de.width)):(E.minX=he-It-(Tt*2+de.width),E.maxX=he-It);var Oe=de.height/2,Ge=g-de.top-Oe,lt="clip"+a._uid+"commonlabel"+d._id,xe;if(he<de.width+2*Tt+It){xe="M-"+(It+Tt)+"-"+Oe+"h-"+(de.width-Tt)+"V"+Oe+"h"+(de.width-Tt)+"Z";var Ze=de.width-he+Tt;fa.positionText(Ee,Ze,Ge),be==="end"&&Ee.selectAll("tspan").each(function(){var Ye=ln.select(this),He=Va.tester.append("text").text(Ye.text()).call(Va.font,ne),Ue=zn(r,He.node());Math.round(Ue.width)<Math.round(de.width)&&Ye.attr("x",Ze-Ue.width),He.remove()})}else fa.positionText(Ee,Ve*(Tt+It),Ge),xe=null;var Xe=a._topclips.selectAll("#"+lt).data(xe?[0]:[]);Xe.enter().append("clipPath").attr("id",lt).append("path"),Xe.exit().remove(),Xe.select("path").attr("d",xe),Va.setClipUrl(Ee,xe?lt:null,r)}ce.attr("transform",ev(he,Ae))}),Sa.isUnifiedHover(i)){l.selectAll("g.hovertext").remove();var z=t.filter(function(ce){return ce.hoverinfo!=="none"});if(z.length===0)return[];var O=a.hoverlabel,I=O.font,P={showlegend:!0,legend:{title:{text:y,font:I},font:I,bgcolor:O.bgcolor,bordercolor:O.bordercolor,borderwidth:1,tracegroupgap:7,traceorder:a.legend?a.legend.traceorder:void 0,orientation:"v"}},M={font:I};s3(P,M,r._fullData);var A=M.legend;A.entries=[];for(var C=0;C<z.length;C++){var R=z[C];if(R.hoverinfo!=="none"){var N=dg(R,!0,i,a,y),H=N[0],B=N[1];R.name=B,B!==""?R.text=B+" : "+H:R.text=H;var X=R.cd[R.index];X&&(X.mc&&(R.mc=X.mc),X.mcc&&(R.mc=X.mcc),X.mlc&&(R.mlc=X.mlc),X.mlcc&&(R.mlc=X.mlcc),X.mlw&&(R.mlw=X.mlw),X.mrc&&(R.mrc=X.mrc),X.dir&&(R.dir=X.dir)),R._distinct=!0,A.entries.push([R])}}A.entries.sort(function(ce,De){return ce[0].trace.index-De[0].trace.index}),A.layer=l,A._inHover=!0,A._groupTitleFont=O.grouptitlefont,f3(r,A);var j=l.select("g.legend"),q=zn(r,j.node()),U=q.width+2*Tt,Z=q.height+2*Tt,K=z[0],ee=(K.x0+K.x1)/2,le=(K.y0+K.y1)/2,ye=!(Ao.traceIs(K.trace,"bar-like")||Ao.traceIs(K.trace,"box-violin")),se,G;p==="y"?ye?(G=le-Tt,se=le+Tt):(G=Math.min.apply(null,z.map(function(ce){return Math.min(ce.y0,ce.y1)})),se=Math.max.apply(null,z.map(function(ce){return Math.max(ce.y0,ce.y1)}))):G=se=ir.mean(z.map(function(ce){return(ce.y0+ce.y1)/2}))-Z/2;var J,oe;p==="x"?ye?(J=ee+Tt,oe=ee-Tt):(J=Math.max.apply(null,z.map(function(ce){return Math.max(ce.x0,ce.x1)})),oe=Math.min.apply(null,z.map(function(ce){return Math.min(ce.x0,ce.x1)}))):J=oe=ir.mean(z.map(function(ce){return(ce.x0+ce.x1)/2}))-U/2;var fe=h._offset,pe=d._offset;se+=pe,J+=fe,oe+=fe-U,G+=pe-Z;var ge,ue;return J+U<x&&J>=0?ge=J:oe+U<x&&oe>=0?ge=oe:fe+U<x?ge=fe:J-ee<ee-oe+U?ge=x-U:ge=0,ge+=Tt,se+Z<_&&se>=0?ue=se:G+Z<_&&G>=0?ue=G:pe+Z<_?ue=pe:se-le<le-G+Z?ue=_-Z:ue=0,ue+=Tt,j.attr("transform",ev(ge-1,ue-1)),j}var Ce=l.selectAll("g.hovertext").data(t,function(ce){return eT(ce)});return Ce.enter().append("g").classed("hovertext",!0).each(function(){var ce=ln.select(this);ce.append("rect").call(yr.fill,yr.addOpacity(o,.8)),ce.append("text").classed("name",!0),ce.append("path").style("stroke-width","1px"),ce.append("text").classed("nums",!0).call(Va.font,c,v)}),Ce.exit().remove(),Ce.each(function(ce){var De=ln.select(this).attr("transform",""),Ee=ce.color;Array.isArray(Ee)&&(Ee=Ee[ce.eventData[0].pointNumber]);var $e=ce.bgcolor||Ee,te=yr.combine(yr.opacity($e)?$e:yr.defaultLine,o),Te=yr.combine(yr.opacity(Ee)?Ee:yr.defaultLine,o),ne=ce.borderColor||yr.contrast(te),de=dg(ce,T,i,a,y,De),he=de[0],Ae=de[1],Me=De.select("text.nums").call(Va.font,ce.fontFamily||c,ce.fontSize||v,ce.fontColor||ne).text(he).attr("data-notex",1).call(fa.positionText,0,0).call(fa.convertToTspans,r),we=De.select("text.name"),be=0,Ve=0;if(Ae&&Ae!==he){we.call(Va.font,ce.fontFamily||c,ce.fontSize||v,Te).text(Ae).attr("data-notex",1).call(fa.positionText,0,0).call(fa.convertToTspans,r);var Fe=zn(r,we.node());be=Fe.width+2*Tt,Ve=Fe.height+2*Tt}else we.remove(),De.select("rect").remove();De.select("path").style({fill:te,stroke:ne});var Oe=ce.xa._offset+(ce.x0+ce.x1)/2,Ge=ce.ya._offset+(ce.y0+ce.y1)/2,lt=Math.abs(ce.x1-ce.x0),xe=Math.abs(ce.y1-ce.y0),Ze=zn(r,Me.node()),Xe=Ze.width/a._invScaleX,Ye=Ze.height/a._invScaleY;ce.ty0=(g-Ze.top)/a._invScaleY,ce.bx=Xe+2*Tt,ce.by=Math.max(Ye+2*Tt,Ve),ce.anchor="start",ce.txwidth=Xe,ce.tx2width=be,ce.offset=0;var He=(Xe+It+Tt+be)*a._invScaleX,Ue,Je;if(n)ce.pos=Oe,Ue=Ge+xe/2+He<=_,Je=Ge-xe/2-He>=0,(ce.idealAlign==="top"||!Ue)&&Je?(Ge-=xe/2,ce.anchor="end"):Ue?(Ge+=xe/2,ce.anchor="start"):ce.anchor="middle",ce.crossPos=Ge;else{if(ce.pos=Ge,Ue=Oe+lt/2+He<=x,Je=Oe-lt/2-He>=0,(ce.idealAlign==="left"||!Ue)&&Je)Oe-=lt/2,ce.anchor="end";else if(Ue)Oe+=lt/2,ce.anchor="start";else{ce.anchor="middle";var F=He/2,W=Oe+F-x,Y=Oe-F;W>0&&(Oe-=W),Y<0&&(Oe+=-Y)}ce.crossPos=Oe}Me.attr("text-anchor",ce.anchor),be&&we.attr("text-anchor",ce.anchor),De.attr("transform",ev(Oe,Ge)+(n?n3(Jw):""))}),{hoverLabels:Ce,commonLabelBoundingBox:E}}function dg(t,e,r,a,i,n){var o="",l="";t.nameOverride!==void 0&&(t.name=t.nameOverride),t.name&&(t.trace._meta&&(t.name=ir.templateString(t.name,t.trace._meta)),o=mg(t.name,t.nameLength));var s=r.charAt(0),f=s==="x"?"y":"x";t.zLabel!==void 0?(t.xLabel!==void 0&&(l+="x: "+t.xLabel+"<br>"),t.yLabel!==void 0&&(l+="y: "+t.yLabel+"<br>"),t.trace.type!=="choropleth"&&t.trace.type!=="choroplethmapbox"&&(l+=(l?"z: ":"")+t.zLabel)):e&&t[s+"Label"]===i?l=t[f+"Label"]||"":t.xLabel===void 0?t.yLabel!==void 0&&t.trace.type!=="scattercarpet"&&(l=t.yLabel):t.yLabel===void 0?l=t.xLabel:l="("+t.xLabel+", "+t.yLabel+")",(t.text||t.text===0)&&!Array.isArray(t.text)&&(l+=(l?"<br>":"")+t.text),t.extraText!==void 0&&(l+=(l?"<br>":"")+t.extraText),n&&l===""&&!t.hovertemplate&&(o===""&&n.remove(),l=o);var c=t.hovertemplate||!1;if(c){var v=t.hovertemplateLabels||t;t[s+"Label"]!==i&&(v[s+"other"]=v[s+"Val"],v[s+"otherLabel"]=v[s+"Label"]),l=ir.hovertemplateString(c,v,a._d3locale,t.eventData[0]||{},t.trace._meta),l=l.replace(p3,function(u,h){return o=mg(h,t.nameLength),""})}return[l,o]}function m3(t,e,r,a){var i=e?"xa":"ya",n=e?"ya":"xa",o=0,l=1,s=t.size(),f=new Array(s),c=0,v=a.minX,u=a.maxX,h=a.minY,d=a.maxY,p=function(I){return I*r._invScaleX},m=function(I){return I*r._invScaleY};t.each(function(I){var P=I[i],M=I[n],A=P._id.charAt(0)==="x",C=P.range;c===0&&C&&C[0]>C[1]!==A&&(l=-1);var R=0,N=A?r.width:r.height;if(r.hovermode==="x"||r.hovermode==="y"){var H=rT(I,e),B=I.anchor,X=B==="end"?-1:1,j,q;if(B==="middle")j=I.crossPos+(A?m(H.y-I.by/2):p(I.bx/2+I.tx2width/2)),q=j+(A?m(I.by):p(I.bx));else if(A)j=I.crossPos+m(It+H.y)-m(I.by/2-It),q=j+m(I.by);else{var U=p(X*It+H.x),Z=U+p(X*I.bx);j=I.crossPos+Math.min(U,Z),q=I.crossPos+Math.max(U,Z)}A?h!==void 0&&d!==void 0&&Math.min(q,d)-Math.max(j,h)>1&&(M.side==="left"?(R=M._mainLinePosition,N=r.width):N=M._mainLinePosition):v!==void 0&&u!==void 0&&Math.min(q,u)-Math.max(j,v)>1&&(M.side==="top"?(R=M._mainLinePosition,N=r.height):N=M._mainLinePosition)}f[c++]=[{datum:I,traceIndex:I.trace.index,dp:0,pos:I.pos,posref:I.posref,size:I.by*(A?c3:1)/2,pmin:R,pmax:N}]}),f.sort(function(I,P){return I[0].posref-P[0].posref||l*(P[0].traceIndex-I[0].traceIndex)});var y,b,w,g,x,_,T;function k(I){var P=I[0],M=I[I.length-1];if(b=P.pmin-P.pos-P.dp+P.size,w=M.pos+M.dp+M.size-P.pmax,b>.01){for(x=I.length-1;x>=0;x--)I[x].dp+=b;y=!1}if(!(w<.01)){if(b<-.01){for(x=I.length-1;x>=0;x--)I[x].dp-=w;y=!1}if(y){var A=0;for(g=0;g<I.length;g++)_=I[g],_.pos+_.dp+_.size>P.pmax&&A++;for(g=I.length-1;g>=0&&!(A<=0);g--)_=I[g],_.pos>P.pmax-1&&(_.del=!0,A--);for(g=0;g<I.length&&!(A<=0);g++)if(_=I[g],_.pos<P.pmin+1)for(_.del=!0,A--,w=_.size*2,x=I.length-1;x>=0;x--)I[x].dp-=w;for(g=I.length-1;g>=0&&!(A<=0);g--)_=I[g],_.pos+_.dp+_.size>P.pmax&&(_.del=!0,A--)}}}for(;!y&&o<=s;){for(o++,y=!0,g=0;g<f.length-1;){var S=f[g],L=f[g+1],D=S[S.length-1],$=L[0];if(b=D.pos+D.dp+D.size-$.pos-$.dp+$.size,b>.01&&D.pmin===$.pmin&&D.pmax===$.pmax){for(x=L.length-1;x>=0;x--)L[x].dp+=b;for(S.push.apply(S,L),f.splice(g+1,1),T=0,x=S.length-1;x>=0;x--)T+=S[x].dp;for(w=T/S.length,x=S.length-1;x>=0;x--)S[x].dp-=w;y=!1}else g++}f.forEach(k)}for(g=f.length-1;g>=0;g--){var E=f[g];for(x=E.length-1;x>=0;x--){var z=E[x],O=z.datum;O.offset=z.dp,O.del=z.del}}}function rT(t,e){var r=0,a=t.offset;return e&&(a*=-v3,r=t.offset*u3),{x:r,y:a}}function y3(t){var e={start:1,end:-1,middle:0}[t.anchor],r=e*(It+Tt),a=r+e*(t.txwidth+Tt),i=t.anchor==="middle";return i&&(r-=t.tx2width/2,a+=t.txwidth/2+Tt),{alignShift:e,textShiftX:r,text2ShiftX:a}}function aT(t,e,r,a){var i=function(o){return o*r},n=function(o){return o*a};t.each(function(o){var l=ln.select(this);if(o.del)return l.remove();var s=l.select("text.nums"),f=o.anchor,c=f==="end"?-1:1,v=y3(o),u=rT(o,e),h=u.x,d=u.y,p=f==="middle";l.select("path").attr("d",p?"M-"+i(o.bx/2+o.tx2width/2)+","+n(d-o.by/2)+"h"+i(o.bx)+"v"+n(o.by)+"h-"+i(o.bx)+"Z":"M0,0L"+i(c*It+h)+","+n(It+d)+"v"+n(o.by/2-It)+"h"+i(c*o.bx)+"v-"+n(o.by)+"H"+i(c*It+h)+"V"+n(d-It)+"Z");var m=h+v.textShiftX,y=d+o.ty0-o.by/2+Tt,b=o.textAlign||"auto";b!=="auto"&&(b==="left"&&f!=="start"?(s.attr("text-anchor","start"),m=p?-o.bx/2-o.tx2width/2+Tt:-o.bx-Tt):b==="right"&&f!=="end"&&(s.attr("text-anchor","end"),m=p?o.bx/2-o.tx2width/2-Tt:o.bx+Tt)),s.call(fa.positionText,i(m),n(y)),o.tx2width&&(l.select("text.name").call(fa.positionText,i(v.text2ShiftX+v.alignShift*Tt+h),n(d+o.ty0-o.by/2+Tt)),l.select("rect").call(Va.setRect,i(v.text2ShiftX+(v.alignShift-1)*o.tx2width/2+h),n(d-o.by/2-1),i(o.tx2width),n(o.by+2)))})}function g3(t,e){var r=t.index,a=t.trace||{},i=t.cd[0],n=t.cd[r]||{};function o(u){return u||ai(u)&&u===0}var l=Array.isArray(r)?function(u,h){var d=ir.castOption(i,r,u);return o(d)?d:ir.extractOption({},a,"",h)}:function(u,h){return ir.extractOption(n,a,u,h)};function s(u,h,d){var p=l(h,d);o(p)&&(t[u]=p)}if(s("hoverinfo","hi","hoverinfo"),s("bgcolor","hbg","hoverlabel.bgcolor"),s("borderColor","hbc","hoverlabel.bordercolor"),s("fontFamily","htf","hoverlabel.font.family"),s("fontSize","hts","hoverlabel.font.size"),s("fontColor","htc","hoverlabel.font.color"),s("nameLength","hnl","hoverlabel.namelength"),s("textAlign","hta","hoverlabel.align"),t.posref=e==="y"||e==="closest"&&a.orientation==="h"?t.xa._offset+(t.x0+t.x1)/2:t.ya._offset+(t.y0+t.y1)/2,t.x0=ir.constrain(t.x0,0,t.xa._length),t.x1=ir.constrain(t.x1,0,t.xa._length),t.y0=ir.constrain(t.y0,0,t.ya._length),t.y1=ir.constrain(t.y1,0,t.ya._length),t.xLabelVal!==void 0&&(t.xLabel="xLabel"in t?t.xLabel:Ti.hoverLabelText(t.xa,t.xLabelVal,a.xhoverformat),t.xVal=t.xa.c2d(t.xLabelVal)),t.yLabelVal!==void 0&&(t.yLabel="yLabel"in t?t.yLabel:Ti.hoverLabelText(t.ya,t.yLabelVal,a.yhoverformat),t.yVal=t.ya.c2d(t.yLabelVal)),t.zLabelVal!==void 0&&t.zLabel===void 0&&(t.zLabel=String(t.zLabelVal)),!isNaN(t.xerr)&&!(t.xa.type==="log"&&t.xerr<=0)){var f=Ti.tickText(t.xa,t.xa.c2l(t.xerr),"hover").text;t.xerrneg!==void 0?t.xLabel+=" +"+f+" / -"+Ti.tickText(t.xa,t.xa.c2l(t.xerrneg),"hover").text:t.xLabel+=" ± "+f,e==="x"&&(t.distance+=1)}if(!isNaN(t.yerr)&&!(t.ya.type==="log"&&t.yerr<=0)){var c=Ti.tickText(t.ya,t.ya.c2l(t.yerr),"hover").text;t.yerrneg!==void 0?t.yLabel+=" +"+c+" / -"+Ti.tickText(t.ya,t.ya.c2l(t.yerrneg),"hover").text:t.yLabel+=" ± "+c,e==="y"&&(t.distance+=1)}var v=t.hoverinfo||t.trace.hoverinfo;return v&&v!=="all"&&(v=Array.isArray(v)?v:v.split("+"),v.indexOf("x")===-1&&(t.xLabel=void 0),v.indexOf("y")===-1&&(t.yLabel=void 0),v.indexOf("z")===-1&&(t.zLabel=void 0),v.indexOf("text")===-1&&(t.text=void 0),v.indexOf("name")===-1&&(t.name=void 0)),t}function hg(t,e,r){var a=r.container,i=r.fullLayout,n=i._size,o=r.event,l=!!e.hLinePoint,s=!!e.vLinePoint,f,c;if(a.selectAll(".spikeline").remove(),!!(s||l)){var v=yr.combine(i.plot_bgcolor,i.paper_bgcolor);if(l){var u=e.hLinePoint,h,d;f=u&&u.xa,c=u&&u.ya;var p=c.spikesnap;p==="cursor"?(h=o.pointerX,d=o.pointerY):(h=f._offset+u.x,d=c._offset+u.y);var m=ug.readability(u.color,v)<1.5?yr.contrast(v):u.color,y=c.spikemode,b=c.spikethickness,w=c.spikecolor||m,g=Ti.getPxPosition(t,c),x,_;if(y.indexOf("toaxis")!==-1||y.indexOf("across")!==-1){if(y.indexOf("toaxis")!==-1&&(x=g,_=h),y.indexOf("across")!==-1){var T=c._counterDomainMin,k=c._counterDomainMax;c.anchor==="free"&&(T=Math.min(T,c.position),k=Math.max(k,c.position)),x=n.l+T*n.w,_=n.l+k*n.w}a.insert("line",":first-child").attr({x1:x,x2:_,y1:d,y2:d,"stroke-width":b,stroke:w,"stroke-dasharray":Va.dashStyle(c.spikedash,b)}).classed("spikeline",!0).classed("crisp",!0),a.insert("line",":first-child").attr({x1:x,x2:_,y1:d,y2:d,"stroke-width":b+2,stroke:v}).classed("spikeline",!0).classed("crisp",!0)}y.indexOf("marker")!==-1&&a.insert("circle",":first-child").attr({cx:g+(c.side!=="right"?b:-b),cy:d,r:b,fill:w}).classed("spikeline",!0)}if(s){var S=e.vLinePoint,L,D;f=S&&S.xa,c=S&&S.ya;var $=f.spikesnap;$==="cursor"?(L=o.pointerX,D=o.pointerY):(L=f._offset+S.x,D=c._offset+S.y);var E=ug.readability(S.color,v)<1.5?yr.contrast(v):S.color,z=f.spikemode,O=f.spikethickness,I=f.spikecolor||E,P=Ti.getPxPosition(t,f),M,A;if(z.indexOf("toaxis")!==-1||z.indexOf("across")!==-1){if(z.indexOf("toaxis")!==-1&&(M=P,A=D),z.indexOf("across")!==-1){var C=f._counterDomainMin,R=f._counterDomainMax;f.anchor==="free"&&(C=Math.min(C,f.position),R=Math.max(R,f.position)),M=n.t+(1-R)*n.h,A=n.t+(1-C)*n.h}a.insert("line",":first-child").attr({x1:L,x2:L,y1:M,y2:A,"stroke-width":O,stroke:I,"stroke-dasharray":Va.dashStyle(f.spikedash,O)}).classed("spikeline",!0).classed("crisp",!0),a.insert("line",":first-child").attr({x1:L,x2:L,y1:M,y2:A,"stroke-width":O+2,stroke:v}).classed("spikeline",!0).classed("crisp",!0)}z.indexOf("marker")!==-1&&a.insert("circle",":first-child").attr({cx:L,cy:P-(f.side!=="top"?O:-O),r:O,fill:I}).classed("spikeline",!0)}}}function b3(t,e,r){if(!r||r.length!==t._hoverdata.length)return!0;for(var a=r.length-1;a>=0;a--){var i=r[a],n=t._hoverdata[a];if(i.curveNumber!==n.curveNumber||String(i.pointNumber)!==String(n.pointNumber)||String(i.pointNumbers)!==String(n.pointNumbers))return!0}return!1}function pg(t,e){return!e||e.vLinePoint!==t._spikepoints.vLinePoint||e.hLinePoint!==t._spikepoints.hLinePoint}function mg(t,e){return fa.plainText(t||"",{len:e,allowedTags:["br","sub","sup","b","i","em"]})}function x3(t,e){for(var r=e.charAt(0),a=[],i=[],n=[],o=0;o<t.length;o++){var l=t[o];Ao.traceIs(l.trace,"bar-like")||Ao.traceIs(l.trace,"box-violin")?n.push(l):l.trace[r+"period"]?i.push(l):a.push(l)}return a.concat(i).concat(n)}function yg(t,e,r){var a=e[t+"a"],i=e[t+"Val"],n=e.cd[0];if(a.type==="category"||a.type==="multicategory")i=a._categoriesMap[i];else if(a.type==="date"){var o=e.trace[t+"periodalignment"];if(o){var l=e.cd[e.index],s=l[t+"Start"];s===void 0&&(s=l[t]);var f=l[t+"End"];f===void 0&&(f=l[t]);var c=f-s;o==="end"?i+=c:o==="middle"&&(i+=c/2)}i=a.d2c(i)}return n&&n.t&&n.t.posLetter===a._id&&(r.boxmode==="group"||r.violinmode==="group")&&(i+=n.t.dPos),i}function iT(t){return t.offsetTop+t.clientTop}function nT(t){return t.offsetLeft+t.clientLeft}function zn(t,e){var r=t._fullLayout,a=e.getBoundingClientRect(),i=a.left,n=a.top,o=i+a.width,l=n+a.height,s=ir.apply3DTransform(r._invTransform)(i,n),f=ir.apply3DTransform(r._invTransform)(o,l),c=s[0],v=s[1],u=f[0],h=f[1];return{x:c,y:v,width:u-c,height:h-v,top:Math.min(v,h),left:Math.min(c,u),right:Math.max(c,u),bottom:Math.max(v,h)}}var _3=me,w3=ht,T3=xa.isUnifiedHover,dp=function(e,r,a,i){i=i||{};var n=r.legend;function o(l){i.font[l]||(i.font[l]=n?r.legend.font[l]:r.font[l])}r&&T3(r.hovermode)&&(i.font||(i.font={}),o("size"),o("family"),o("color"),n?(i.bgcolor||(i.bgcolor=w3.combine(r.legend.bgcolor,r.paper_bgcolor)),i.bordercolor||(i.bordercolor=r.legend.bordercolor)):i.bgcolor||(i.bgcolor=r.paper_bgcolor)),a("hoverlabel.bgcolor",i.bgcolor),a("hoverlabel.bordercolor",i.bordercolor),a("hoverlabel.namelength",i.namelength),_3.coerceFont(a,"hoverlabel.font",i.font),a("hoverlabel.align",i.align)},k3=me,A3=dp,M3=as,S3=function(e,r){function a(i,n){return k3.coerce(e,r,M3,i,n)}A3(e,r,a)},gg=me,L3=kc,C3=dp,D3=function(e,r,a,i){function n(l,s){return gg.coerce(e,r,L3,l,s)}var o=gg.extendFlat({},i.hoverlabel);r.hovertemplate&&(o.namelength=-1),C3(e,r,n,o)},$3=me,P3=as,oT=function(e,r){function a(i,n){return r[i]!==void 0?r[i]:$3.coerce(e,r,P3,i,n)}return a("clickmode"),a("hovermode")},bg=me,R3=as,E3=oT,z3=dp,I3=function(e,r){function a(f,c){return bg.coerce(e,r,R3,f,c)}var i=E3(e,r);i&&(a("hoverdistance"),a("spikedistance"));var n=a("dragmode");n==="select"&&a("selectdirection");var o=r._has("mapbox"),l=r._has("geo"),s=r._basePlotModules.length;r.dragmode==="zoom"&&((o||l)&&s===1||o&&l&&s===2)&&(r.dragmode="pan"),z3(e,r,a),bg.coerceFont(a,"hoverlabel.grouptitlefont",r.hoverlabel.font)},Yd=me,xg=ot,F3=function(e){var r=e.calcdata,a=e._fullLayout;function i(f){return function(c){return Yd.coerceHoverinfo({hoverinfo:c},{_module:f._module},a)}}for(var n=0;n<r.length;n++){var o=r[n],l=o[0].trace;if(!xg.traceIs(l,"pie-like")){var s=xg.traceIs(l,"2dMap")?N3:Yd.fillArray;s(l.hoverinfo,o,"hi",i(l)),l.hovertemplate&&s(l.hovertemplate,o,"ht"),l.hoverlabel&&(s(l.hoverlabel.bgcolor,o,"hbg"),s(l.hoverlabel.bordercolor,o,"hbc"),s(l.hoverlabel.font.size,o,"hts"),s(l.hoverlabel.font.color,o,"htc"),s(l.hoverlabel.font.family,o,"htf"),s(l.hoverlabel.namelength,o,"hnl"),s(l.hoverlabel.align,o,"hta"))}}};function N3(t,e,r,a){a=a||Yd.identity,Array.isArray(t)&&(e[0][r]=a(t))}var H3=ot,O3=Uc.hover,j3=function(e,r,a){var i=H3.getComponentMethod("annotations","onClick")(e,e._hoverdata);a!==void 0&&O3(e,r,a,!0);function n(){e.emit("plotly_click",{points:e._hoverdata,event:r})}e._hoverdata&&r&&r.target&&(i&&i.then?i.then(n):n(),r.stopImmediatePropagation&&r.stopImmediatePropagation())},B3=gt,Jf=me,G3=Qa,tl=xa,_g=as,wg=Uc,Ia={moduleType:"component",name:"fx",constants:Tc,schema:{layout:_g},attributes:kc,layoutAttributes:_g,supplyLayoutGlobalDefaults:S3,supplyDefaults:D3,supplyLayoutDefaults:I3,calc:F3,getDistanceFunction:tl.getDistanceFunction,getClosest:tl.getClosest,inbox:tl.inbox,quadrature:tl.quadrature,appendArrayPointValue:tl.appendArrayPointValue,castHoverOption:V3,castHoverinfo:X3,hover:wg.hover,unhover:G3.unhover,loneHover:wg.loneHover,loneUnhover:U3,click:j3};function U3(t){var e=Jf.isD3Selection(t)?t:B3.select(t);e.selectAll("g.hovertext").remove(),e.selectAll(".spikeline").remove()}function V3(t,e,r){return Jf.castOption(t,e,"hoverlabel."+r)}function X3(t,e,r){function a(i){return Jf.coerceHoverinfo({hoverinfo:i},{_module:t._module},e)}return Jf.castOption(t,r,"hoverinfo",a)}var Dn={};(function(t){t.selectMode=function(e){return e==="lasso"||e==="select"},t.drawMode=function(e){return e==="drawclosedpath"||e==="drawopenpath"||e==="drawline"||e==="drawrect"||e==="drawcircle"},t.openMode=function(e){return e==="drawline"||e==="drawopenpath"},t.rectMode=function(e){return e==="select"||e==="drawline"||e==="drawrect"||e==="drawcircle"},t.freeMode=function(e){return e==="lasso"||e==="drawclosedpath"||e==="drawopenpath"},t.selectingOrDrawing=function(e){return t.freeMode(e)||t.rectMode(e)}})(Dn);var hp=function(e){var r=e._fullLayout;r._glcanvas&&r._glcanvas.size()&&r._glcanvas.each(function(a){a.regl&&a.regl.clear({color:!0,depth:!0})})},Xc={},lT={exports:{}},pp={undo:{width:857.1,height:1e3,path:"m857 350q0-87-34-166t-91-137-137-92-166-34q-96 0-183 41t-147 114q-4 6-4 13t5 11l76 77q6 5 14 5 9-1 13-7 41-53 100-82t126-29q58 0 110 23t92 61 61 91 22 111-22 111-61 91-92 61-110 23q-55 0-105-20t-90-57l77-77q17-16 8-38-10-23-33-23h-250q-15 0-25 11t-11 25v250q0 24 22 33 22 10 39-8l72-72q60 57 137 88t159 31q87 0 166-34t137-92 91-137 34-166z",transform:"matrix(1 0 0 -1 0 850)"},home:{width:928.6,height:1e3,path:"m786 296v-267q0-15-11-26t-25-10h-214v214h-143v-214h-214q-15 0-25 10t-11 26v267q0 1 0 2t0 2l321 264 321-264q1-1 1-4z m124 39l-34-41q-5-5-12-6h-2q-7 0-12 3l-386 322-386-322q-7-4-13-4-7 2-12 7l-35 41q-4 5-3 13t6 12l401 334q18 15 42 15t43-15l136-114v109q0 8 5 13t13 5h107q8 0 13-5t5-13v-227l122-102q5-5 6-12t-4-13z",transform:"matrix(1 0 0 -1 0 850)"},"camera-retro":{width:1e3,height:1e3,path:"m518 386q0 8-5 13t-13 5q-37 0-63-27t-26-63q0-8 5-13t13-5 12 5 5 13q0 23 16 38t38 16q8 0 13 5t5 13z m125-73q0-59-42-101t-101-42-101 42-42 101 42 101 101 42 101-42 42-101z m-572-320h858v71h-858v-71z m643 320q0 89-62 152t-152 62-151-62-63-152 63-151 151-63 152 63 62 151z m-571 358h214v72h-214v-72z m-72-107h858v143h-462l-36-71h-360v-72z m929 143v-714q0-30-21-51t-50-21h-858q-29 0-50 21t-21 51v714q0 30 21 51t50 21h858q29 0 50-21t21-51z",transform:"matrix(1 0 0 -1 0 850)"},zoombox:{width:1e3,height:1e3,path:"m1000-25l-250 251c40 63 63 138 63 218 0 224-182 406-407 406-224 0-406-182-406-406s183-406 407-406c80 0 155 22 218 62l250-250 125 125z m-812 250l0 438 437 0 0-438-437 0z m62 375l313 0 0-312-313 0 0 312z",transform:"matrix(1 0 0 -1 0 850)"},pan:{width:1e3,height:1e3,path:"m1000 350l-187 188 0-125-250 0 0 250 125 0-188 187-187-187 125 0 0-250-250 0 0 125-188-188 186-187 0 125 252 0 0-250-125 0 187-188 188 188-125 0 0 250 250 0 0-126 187 188z",transform:"matrix(1 0 0 -1 0 850)"},zoom_plus:{width:875,height:1e3,path:"m1 787l0-875 875 0 0 875-875 0z m687-500l-187 0 0-187-125 0 0 187-188 0 0 125 188 0 0 187 125 0 0-187 187 0 0-125z",transform:"matrix(1 0 0 -1 0 850)"},zoom_minus:{width:875,height:1e3,path:"m0 788l0-876 875 0 0 876-875 0z m688-500l-500 0 0 125 500 0 0-125z",transform:"matrix(1 0 0 -1 0 850)"},autoscale:{width:1e3,height:1e3,path:"m250 850l-187 0-63 0 0-62 0-188 63 0 0 188 187 0 0 62z m688 0l-188 0 0-62 188 0 0-188 62 0 0 188 0 62-62 0z m-875-938l0 188-63 0 0-188 0-62 63 0 187 0 0 62-187 0z m875 188l0-188-188 0 0-62 188 0 62 0 0 62 0 188-62 0z m-125 188l-1 0-93-94-156 156 156 156 92-93 2 0 0 250-250 0 0-2 93-92-156-156-156 156 94 92 0 2-250 0 0-250 0 0 93 93 157-156-157-156-93 94 0 0 0-250 250 0 0 0-94 93 156 157 156-157-93-93 0 0 250 0 0 250z",transform:"matrix(1 0 0 -1 0 850)"},tooltip_basic:{width:1500,height:1e3,path:"m375 725l0 0-375-375 375-374 0-1 1125 0 0 750-1125 0z",transform:"matrix(1 0 0 -1 0 850)"},tooltip_compare:{width:1125,height:1e3,path:"m187 786l0 2-187-188 188-187 0 0 937 0 0 373-938 0z m0-499l0 1-187-188 188-188 0 0 937 0 0 376-938-1z",transform:"matrix(1 0 0 -1 0 850)"},plotlylogo:{width:1542,height:1e3,path:"m0-10h182v-140h-182v140z m228 146h183v-286h-183v286z m225 714h182v-1000h-182v1000z m225-285h182v-715h-182v715z m225 142h183v-857h-183v857z m231-428h182v-429h-182v429z m225-291h183v-138h-183v138z",transform:"matrix(1 0 0 -1 0 850)"},"z-axis":{width:1e3,height:1e3,path:"m833 5l-17 108v41l-130-65 130-66c0 0 0 38 0 39 0-1 36-14 39-25 4-15-6-22-16-30-15-12-39-16-56-20-90-22-187-23-279-23-261 0-341 34-353 59 3 60 228 110 228 110-140-8-351-35-351-116 0-120 293-142 474-142 155 0 477 22 477 142 0 50-74 79-163 96z m-374 94c-58-5-99-21-99-40 0-24 65-43 144-43 79 0 143 19 143 43 0 19-42 34-98 40v216h87l-132 135-133-135h88v-216z m167 515h-136v1c16 16 31 34 46 52l84 109v54h-230v-71h124v-1c-16-17-28-32-44-51l-89-114v-51h245v72z",transform:"matrix(1 0 0 -1 0 850)"},"3d_rotate":{width:1e3,height:1e3,path:"m922 660c-5 4-9 7-14 11-359 263-580-31-580-31l-102 28 58-400c0 1 1 1 2 2 118 108 351 249 351 249s-62 27-100 42c88 83 222 183 347 122 16-8 30-17 44-27-2 1-4 2-6 4z m36-329c0 0 64 229-88 296-62 27-124 14-175-11 157-78 225-208 249-266 8-19 11-31 11-31 2 5 6 15 11 32-5-13-8-20-8-20z m-775-239c70-31 117-50 198-32-121 80-199 346-199 346l-96-15-58-12c0 0 55-226 155-287z m603 133l-317-139c0 0 4-4 19-14 7-5 24-15 24-15s-177-147-389 4c235-287 536-112 536-112l31-22 100 299-4-1z m-298-153c6-4 14-9 24-15 0 0-17 10-24 15z",transform:"matrix(1 0 0 -1 0 850)"},camera:{width:1e3,height:1e3,path:"m500 450c-83 0-150-67-150-150 0-83 67-150 150-150 83 0 150 67 150 150 0 83-67 150-150 150z m400 150h-120c-16 0-34 13-39 29l-31 93c-6 15-23 28-40 28h-340c-16 0-34-13-39-28l-31-94c-6-15-23-28-40-28h-120c-55 0-100-45-100-100v-450c0-55 45-100 100-100h800c55 0 100 45 100 100v450c0 55-45 100-100 100z m-400-550c-138 0-250 112-250 250 0 138 112 250 250 250 138 0 250-112 250-250 0-138-112-250-250-250z m365 380c-19 0-35 16-35 35 0 19 16 35 35 35 19 0 35-16 35-35 0-19-16-35-35-35z",transform:"matrix(1 0 0 -1 0 850)"},movie:{width:1e3,height:1e3,path:"m938 413l-188-125c0 37-17 71-44 94 64 38 107 107 107 187 0 121-98 219-219 219-121 0-219-98-219-219 0-61 25-117 66-156h-115c30 33 49 76 49 125 0 103-84 187-187 187s-188-84-188-187c0-57 26-107 65-141-38-22-65-62-65-109v-250c0-70 56-126 125-126h500c69 0 125 56 125 126l188-126c34 0 62 28 62 63v375c0 35-28 63-62 63z m-750 0c-69 0-125 56-125 125s56 125 125 125 125-56 125-125-56-125-125-125z m406-1c-87 0-157 70-157 157 0 86 70 156 157 156s156-70 156-156-70-157-156-157z",transform:"matrix(1 0 0 -1 0 850)"},question:{width:857.1,height:1e3,path:"m500 82v107q0 8-5 13t-13 5h-107q-8 0-13-5t-5-13v-107q0-8 5-13t13-5h107q8 0 13 5t5 13z m143 375q0 49-31 91t-77 65-95 23q-136 0-207-119-9-14 4-24l74-55q4-4 10-4 9 0 14 7 30 38 48 51 19 14 48 14 27 0 48-15t21-33q0-21-11-34t-38-25q-35-16-65-48t-29-70v-20q0-8 5-13t13-5h107q8 0 13 5t5 13q0 10 12 27t30 28q18 10 28 16t25 19 25 27 16 34 7 45z m214-107q0-117-57-215t-156-156-215-58-216 58-155 156-58 215 58 215 155 156 216 58 215-58 156-156 57-215z",transform:"matrix(1 0 0 -1 0 850)"},disk:{width:857.1,height:1e3,path:"m214-7h429v214h-429v-214z m500 0h72v500q0 8-6 21t-11 20l-157 156q-5 6-19 12t-22 5v-232q0-22-15-38t-38-16h-322q-22 0-37 16t-16 38v232h-72v-714h72v232q0 22 16 38t37 16h465q22 0 38-16t15-38v-232z m-214 518v178q0 8-5 13t-13 5h-107q-7 0-13-5t-5-13v-178q0-8 5-13t13-5h107q7 0 13 5t5 13z m357-18v-518q0-22-15-38t-38-16h-750q-23 0-38 16t-16 38v750q0 22 16 38t38 16h517q23 0 50-12t42-26l156-157q16-15 27-42t11-49z",transform:"matrix(1 0 0 -1 0 850)"},drawopenpath:{width:70,height:70,path:"M33.21,85.65a7.31,7.31,0,0,1-2.59-.48c-8.16-3.11-9.27-19.8-9.88-41.3-.1-3.58-.19-6.68-.35-9-.15-2.1-.67-3.48-1.43-3.79-2.13-.88-7.91,2.32-12,5.86L3,32.38c1.87-1.64,11.55-9.66,18.27-6.9,2.13.87,4.75,3.14,5.17,9,.17,2.43.26,5.59.36,9.25a224.17,224.17,0,0,0,1.5,23.4c1.54,10.76,4,12.22,4.48,12.4.84.32,2.79-.46,5.76-3.59L43,80.07C41.53,81.57,37.68,85.64,33.21,85.65ZM74.81,69a11.34,11.34,0,0,0,6.09-6.72L87.26,44.5,74.72,32,56.9,38.35c-2.37.86-5.57,3.42-6.61,6L38.65,72.14l8.42,8.43ZM55,46.27a7.91,7.91,0,0,1,3.64-3.17l14.8-5.3,8,8L76.11,60.6l-.06.19a6.37,6.37,0,0,1-3,3.43L48.25,74.59,44.62,71Zm16.57,7.82A6.9,6.9,0,1,0,64.64,61,6.91,6.91,0,0,0,71.54,54.09Zm-4.05,0a2.85,2.85,0,1,1-2.85-2.85A2.86,2.86,0,0,1,67.49,54.09Zm-4.13,5.22L60.5,56.45,44.26,72.7l2.86,2.86ZM97.83,35.67,84.14,22l-8.57,8.57L89.26,44.24Zm-13.69-8,8,8-2.85,2.85-8-8Z",transform:"matrix(1 0 0 1 -15 -15)"},drawclosedpath:{width:90,height:90,path:"M88.41,21.12a26.56,26.56,0,0,0-36.18,0l-2.07,2-2.07-2a26.57,26.57,0,0,0-36.18,0,23.74,23.74,0,0,0,0,34.8L48,90.12a3.22,3.22,0,0,0,4.42,0l36-34.21a23.73,23.73,0,0,0,0-34.79ZM84,51.24,50.16,83.35,16.35,51.25a17.28,17.28,0,0,1,0-25.47,20,20,0,0,1,27.3,0l4.29,4.07a3.23,3.23,0,0,0,4.44,0l4.29-4.07a20,20,0,0,1,27.3,0,17.27,17.27,0,0,1,0,25.46ZM66.76,47.68h-33v6.91h33ZM53.35,35H46.44V68h6.91Z",transform:"matrix(1 0 0 1 -5 -5)"},lasso:{width:1031,height:1e3,path:"m1018 538c-36 207-290 336-568 286-277-48-473-256-436-463 10-57 36-108 76-151-13-66 11-137 68-183 34-28 75-41 114-42l-55-70 0 0c-2-1-3-2-4-3-10-14-8-34 5-45 14-11 34-8 45 4 1 1 2 3 2 5l0 0 113 140c16 11 31 24 45 40 4 3 6 7 8 11 48-3 100 0 151 9 278 48 473 255 436 462z m-624-379c-80 14-149 48-197 96 42 42 109 47 156 9 33-26 47-66 41-105z m-187-74c-19 16-33 37-39 60 50-32 109-55 174-68-42-25-95-24-135 8z m360 75c-34-7-69-9-102-8 8 62-16 128-68 170-73 59-175 54-244-5-9 20-16 40-20 61-28 159 121 317 333 354s407-60 434-217c28-159-121-318-333-355z",transform:"matrix(1 0 0 -1 0 850)"},selectbox:{width:1e3,height:1e3,path:"m0 850l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z m285 0l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z m-857-286l0-143 143 0 0 143-143 0z m857 0l0-143 143 0 0 143-143 0z m-857-285l0-143 143 0 0 143-143 0z m857 0l0-143 143 0 0 143-143 0z m-857-286l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z m285 0l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z",transform:"matrix(1 0 0 -1 0 850)"},drawline:{width:70,height:70,path:"M60.64,62.3a11.29,11.29,0,0,0,6.09-6.72l6.35-17.72L60.54,25.31l-17.82,6.4c-2.36.86-5.57,3.41-6.6,6L24.48,65.5l8.42,8.42ZM40.79,39.63a7.89,7.89,0,0,1,3.65-3.17l14.79-5.31,8,8L61.94,54l-.06.19a6.44,6.44,0,0,1-3,3.43L34.07,68l-3.62-3.63Zm16.57,7.81a6.9,6.9,0,1,0-6.89,6.9A6.9,6.9,0,0,0,57.36,47.44Zm-4,0a2.86,2.86,0,1,1-2.85-2.85A2.86,2.86,0,0,1,53.32,47.44Zm-4.13,5.22L46.33,49.8,30.08,66.05l2.86,2.86ZM83.65,29,70,15.34,61.4,23.9,75.09,37.59ZM70,21.06l8,8-2.84,2.85-8-8ZM87,80.49H10.67V87H87Z",transform:"matrix(1 0 0 1 -15 -15)"},drawrect:{width:80,height:80,path:"M78,22V79H21V22H78m9-9H12V88H87V13ZM68,46.22H31V54H68ZM53,32H45.22V69H53Z",transform:"matrix(1 0 0 1 -10 -10)"},drawcircle:{width:80,height:80,path:"M50,84.72C26.84,84.72,8,69.28,8,50.3S26.84,15.87,50,15.87,92,31.31,92,50.3,73.16,84.72,50,84.72Zm0-60.59c-18.6,0-33.74,11.74-33.74,26.17S31.4,76.46,50,76.46,83.74,64.72,83.74,50.3,68.6,24.13,50,24.13Zm17.15,22h-34v7.11h34Zm-13.8-13H46.24v34h7.11Z",transform:"matrix(1 0 0 1 -10 -10)"},eraseshape:{width:80,height:80,path:"M82.77,78H31.85L6,49.57,31.85,21.14H82.77a8.72,8.72,0,0,1,8.65,8.77V69.24A8.72,8.72,0,0,1,82.77,78ZM35.46,69.84H82.77a.57.57,0,0,0,.49-.6V29.91a.57.57,0,0,0-.49-.61H35.46L17,49.57Zm32.68-34.7-24,24,5,5,24-24Zm-19,.53-5,5,24,24,5-5Z",transform:"matrix(1 0 0 1 -10 -10)"},spikeline:{width:1e3,height:1e3,path:"M512 409c0-57-46-104-103-104-57 0-104 47-104 104 0 57 47 103 104 103 57 0 103-46 103-103z m-327-39l92 0 0 92-92 0z m-185 0l92 0 0 92-92 0z m370-186l92 0 0 93-92 0z m0-184l92 0 0 92-92 0z",transform:"matrix(1.5 0 0 -1.5 0 850)"},pencil:{width:1792,height:1792,path:"M491 1536l91-91-235-235-91 91v107h128v128h107zm523-928q0-22-22-22-10 0-17 7l-542 542q-7 7-7 17 0 22 22 22 10 0 17-7l542-542q7-7 7-17zm-54-192l416 416-832 832h-416v-416zm683 96q0 53-37 90l-166 166-416-416 166-165q36-38 90-38 53 0 91 38l235 234q37 39 37 91z",transform:"matrix(1 0 0 1 0 1)"},newplotlylogo:{name:"newplotlylogo",svg:["<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 132 132'>","<defs>"," <style>"," .cls-0{fill:#000;}"," .cls-1{fill:#FFF;}"," .cls-2{fill:#F26;}"," .cls-3{fill:#D69;}"," .cls-4{fill:#BAC;}"," .cls-5{fill:#9EF;}"," </style>","</defs>"," <title>plotly-logomark</title>"," <g id='symbol'>"," <rect class='cls-0' x='0' y='0' width='132' height='132' rx='18' ry='18'/>"," <circle class='cls-5' cx='102' cy='30' r='6'/>"," <circle class='cls-4' cx='78' cy='30' r='6'/>"," <circle class='cls-4' cx='78' cy='54' r='6'/>"," <circle class='cls-3' cx='54' cy='30' r='6'/>"," <circle class='cls-2' cx='30' cy='30' r='6'/>"," <circle class='cls-2' cx='30' cy='54' r='6'/>"," <path class='cls-1' d='M30,72a6,6,0,0,0-6,6v24a6,6,0,0,0,12,0V78A6,6,0,0,0,30,72Z'/>"," <path class='cls-1' d='M78,72a6,6,0,0,0-6,6v24a6,6,0,0,0,12,0V78A6,6,0,0,0,78,72Z'/>"," <path class='cls-1' d='M54,48a6,6,0,0,0-6,6v48a6,6,0,0,0,12,0V54A6,6,0,0,0,54,48Z'/>"," <path class='cls-1' d='M102,48a6,6,0,0,0-6,6v48a6,6,0,0,0,12,0V54A6,6,0,0,0,102,48Z'/>"," </g>","</svg>"].join("")}},Bi={},Gs=32,mp={CIRCLE_SIDES:Gs,i000:0,i090:Gs/4,i180:Gs/2,i270:Gs/4*3,cos45:Math.cos(Math.PI/4),sin45:Math.sin(Math.PI/4),SQRT2:Math.sqrt(2)},Y3=me.strTranslate;function sT(t,e){switch(t.type){case"log":return t.p2d(e);case"date":return t.p2r(e,0,t.calendar);default:return t.p2r(e)}}function W3(t,e){switch(t.type){case"log":return t.d2p(e);case"date":return t.r2p(e,0,t.calendar);default:return t.r2p(e)}}function q3(t){var e=t._id.charAt(0)==="y"?1:0;return function(r){return sT(t,r[e])}}function Z3(t){return Y3(t.xaxis._offset,t.yaxis._offset)}var yp={p2r:sT,r2p:W3,axValue:q3,getTransform:Z3};(function(t){var e=I1,r=mp,a=r.CIRCLE_SIDES,i=r.SQRT2,n=yp,o=n.p2r,l=n.r2p,s=[0,3,4,5,6,1,2],f=[0,3,4,1,2];t.writePaths=function(u){var h=u.length;if(!h)return"M0,0Z";for(var d="",p=0;p<h;p++)for(var m=u[p].length,y=0;y<m;y++){var b=u[p][y][0];if(b==="Z")d+="Z";else for(var w=u[p][y].length,g=0;g<w;g++){var x=g;b==="Q"||b==="S"?x=f[g]:b==="C"&&(x=s[g]),d+=u[p][y][x],g>0&&g<w-1&&(d+=",")}}return d},t.readPaths=function(u,h,d,p){var m=e(u),y=[],b=-1,w=function(){b++,y[b]=[]},g,x=0,_=0,T,k,S=function(){T=x,k=_};S();for(var L=0;L<m.length;L++){var D=[],$,E,z,O,I=m[L][0],P=I;switch(I){case"M":w(),x=+m[L][1],_=+m[L][2],D.push([P,x,_]),S();break;case"Q":case"S":$=+m[L][1],z=+m[L][2],x=+m[L][3],_=+m[L][4],D.push([P,x,_,$,z]);break;case"C":$=+m[L][1],z=+m[L][2],E=+m[L][3],O=+m[L][4],x=+m[L][5],_=+m[L][6],D.push([P,x,_,$,z,E,O]);break;case"T":case"L":x=+m[L][1],_=+m[L][2],D.push([P,x,_]);break;case"H":P="L",x=+m[L][1],D.push([P,x,_]);break;case"V":P="L",_=+m[L][1],D.push([P,x,_]);break;case"A":P="L";var M=+m[L][1],A=+m[L][2];+m[L][4]||(M=-M,A=-A);var C=x-M,R=_;for(g=1;g<=a/2;g++){var N=2*Math.PI*g/a;D.push([P,C+M*Math.cos(N),R+A*Math.sin(N)])}break;case"Z":(x!==T||_!==k)&&(x=T,_=k,D.push([P,x,_]));break}for(var H=(d||{}).domain,B=h._fullLayout._size,X=d&&d.xsizemode==="pixel",j=d&&d.ysizemode==="pixel",q=p===!1,U=0;U<D.length;U++){for(g=0;g+2<7;g+=2){var Z=D[U][g+1],K=D[U][g+2];Z===void 0||K===void 0||(x=Z,_=K,d&&(d.xaxis&&d.xaxis.p2r?(q&&(Z-=d.xaxis._offset),X?Z=l(d.xaxis,d.xanchor)+Z:Z=o(d.xaxis,Z)):(q&&(Z-=B.l),H?Z=H.x[0]+Z/B.w:Z=Z/B.w),d.yaxis&&d.yaxis.p2r?(q&&(K-=d.yaxis._offset),j?K=l(d.yaxis,d.yanchor)-K:K=o(d.yaxis,K)):(q&&(K-=B.t),H?K=H.y[1]-K/B.h:K=1-K/B.h)),D[U][g+1]=Z,D[U][g+2]=K)}y[b].push(D[U].slice())}}return y};function c(u,h){return Math.abs(u-h)<=1e-6}function v(u,h){var d=h[1]-u[1],p=h[2]-u[2];return Math.sqrt(d*d+p*p)}t.pointsOnRectangle=function(u){var h=u.length;if(h!==5)return!1;for(var d=1;d<3;d++){var p=u[0][d]-u[1][d],m=u[3][d]-u[2][d];if(!c(p,m))return!1;var y=u[0][d]-u[3][d],b=u[1][d]-u[2][d];if(!c(y,b))return!1}return!c(u[0][1],u[1][1])&&!c(u[0][1],u[3][1])?!1:!!(v(u[0],u[1])*v(u[0],u[3]))},t.pointsOnEllipse=function(u){var h=u.length;if(h!==a+1)return!1;h=a;for(var d=0;d<h;d++){var p=(h*2-d)%h,m=(h/2+p)%h,y=(h/2+d)%h;if(!c(v(u[d],u[y]),v(u[p],u[m])))return!1}return!0},t.handleEllipse=function(u,h,d){if(!u)return[h,d];var p=t.ellipseOver({x0:h[0],y0:h[1],x1:d[0],y1:d[1]}),m=(p.x1+p.x0)/2,y=(p.y1+p.y0)/2,b=(p.x1-p.x0)/2,w=(p.y1-p.y0)/2;b||(b=w=w/i),w||(w=b=b/i);for(var g=[],x=0;x<a;x++){var _=x*2*Math.PI/a;g.push([m+b*Math.cos(_),y+w*Math.sin(_)])}return g},t.ellipseOver=function(u){var h=u.x0,d=u.y0,p=u.x1,m=u.y1,y=p-h,b=m-d;h-=y,d-=b;var w=(h+p)/2,g=(d+m)/2,x=i;return y*=x,b*=x,{x0:w-y,y0:g-b,x1:w+y,y1:g+b}},t.fixDatesForPaths=function(u,h,d){var p=h.type==="date",m=d.type==="date";if(!p&&!m)return u;for(var y=0;y<u.length;y++)for(var b=0;b<u[y].length;b++)for(var w=0;w+2<u[y][b].length;w+=2)p&&(u[y][b][w+1]=u[y][b][w+1].replace(" ","_")),m&&(u[y][b][w+2]=u[y][b][w+2].replace(" ","_"));return u}})(Bi);var fT=Dn,K3=fT.drawMode,Q3=fT.openMode,Go=mp,Tg=Go.i000,kg=Go.i090,Ag=Go.i180,Mg=Go.i270,J3=Go.cos45,e$=Go.sin45,cT=yp,Us=cT.p2r,gi=cT.r2p,t$=Mn,r$=t$.clearOutline,Yc=Bi,a$=Yc.readPaths,i$=Yc.writePaths,n$=Yc.ellipseOver,o$=Yc.fixDatesForPaths;function l$(t,e){if(t.length){var r=t[0][0];if(r){var a=e.gd,i=e.isActiveShape,n=e.dragmode,o=(a.layout||{}).shapes||[];if(!K3(n)&&i!==void 0){var l=a._fullLayout._activeShapeIndex;if(l<o.length)switch(a._fullLayout.shapes[l].type){case"rect":n="drawrect";break;case"circle":n="drawcircle";break;case"line":n="drawline";break;case"path":var s=o[l].path||"";s[s.length-1]==="Z"?n="drawclosedpath":n="drawopenpath";break}}var f=uT(t,e,n);r$(a);for(var c=e.editHelpers,v=(c||{}).modifyItem,u=[],h=0;h<o.length;h++){var d=a._fullLayout.shapes[h];if(u[h]=d._input,i!==void 0&&h===a._fullLayout._activeShapeIndex){var p=f;switch(d.type){case"line":case"rect":case"circle":v("x0",p.x0),v("x1",p.x1),v("y0",p.y0),v("y1",p.y1);break;case"path":v("path",p.path);break}}}return i===void 0?(u.push(f),u):c?c.getUpdateObj():{}}}}function uT(t,e,r){var a=t[0][0],i=e.gd,n=a.getAttribute("d"),o=i._fullLayout.newshape,l=e.plotinfo,s=e.isActiveShape,f=l.xaxis,c=l.yaxis,v=!!l.domain||!l.xaxis,u=!!l.domain||!l.yaxis,h=Q3(r),d=a$(n,i,l,s),p={editable:!0,visible:o.visible,name:o.name,showlegend:o.showlegend,legend:o.legend,legendwidth:o.legendwidth,legendgroup:o.legendgroup,legendgrouptitle:{text:o.legendgrouptitle.text,font:o.legendgrouptitle.font},legendrank:o.legendrank,label:o.label,xref:v?"paper":f._id,yref:u?"paper":c._id,layer:o.layer,opacity:o.opacity,line:{color:o.line.color,width:o.line.width,dash:o.line.dash}};h||(p.fillcolor=o.fillcolor,p.fillrule=o.fillrule);var m;if(d.length===1&&(m=d[0]),m&&m.length===5&&r==="drawrect")p.type="rect",p.x0=m[0][1],p.y0=m[0][2],p.x1=m[2][1],p.y1=m[2][2];else if(m&&r==="drawline")p.type="line",p.x0=m[0][1],p.y0=m[0][2],p.x1=m[1][1],p.y1=m[1][2];else if(m&&r==="drawcircle"){p.type="circle";var y=m[Tg][1],b=m[kg][1],w=m[Ag][1],g=m[Mg][1],x=m[Tg][2],_=m[kg][2],T=m[Ag][2],k=m[Mg][2],S=l.xaxis&&(l.xaxis.type==="date"||l.xaxis.type==="log"),L=l.yaxis&&(l.yaxis.type==="date"||l.yaxis.type==="log");S&&(y=gi(l.xaxis,y),b=gi(l.xaxis,b),w=gi(l.xaxis,w),g=gi(l.xaxis,g)),L&&(x=gi(l.yaxis,x),_=gi(l.yaxis,_),T=gi(l.yaxis,T),k=gi(l.yaxis,k));var D=(b+g)/2,$=(x+T)/2,E=(g-b+w-y)/2,z=(k-_+T-x)/2,O=n$({x0:D,y0:$,x1:D+E*J3,y1:$+z*e$});S&&(O.x0=Us(l.xaxis,O.x0),O.x1=Us(l.xaxis,O.x1)),L&&(O.y0=Us(l.yaxis,O.y0),O.y1=Us(l.yaxis,O.y1)),p.x0=O.x0,p.y0=O.y0,p.x1=O.x1,p.y1=O.y1}else p.type="path",f&&c&&o$(d,f,c),p.path=i$(d),m=null;return p}var gp={newShapes:l$,createShapeObj:uT},s$=Dn,f$=s$.selectMode,c$=Mn,u$=c$.clearOutline,bp=Bi,v$=bp.readPaths,d$=bp.writePaths,h$=bp.fixDatesForPaths,vT=function(e,r){if(e.length){var a=e[0][0];if(a){var i=a.getAttribute("d"),n=r.gd,o=n._fullLayout.newselection,l=r.plotinfo,s=l.xaxis,f=l.yaxis,c=r.isActiveSelection,v=r.dragmode,u=(n.layout||{}).selections||[];if(!f$(v)&&c!==void 0){var h=n._fullLayout._activeSelectionIndex;if(h<u.length)switch(n._fullLayout.selections[h].type){case"rect":v="select";break;case"path":v="lasso";break}}var d=v$(i,n,l,c),p={xref:s._id,yref:f._id,opacity:o.opacity,line:{color:o.line.color,width:o.line.width,dash:o.line.dash}},m;d.length===1&&(m=d[0]),m&&m.length===5&&v==="select"?(p.type="rect",p.x0=m[0][1],p.y0=m[0][2],p.x1=m[2][1],p.y1=m[2][2]):(p.type="path",s&&f&&h$(d,s,f),p.path=d$(d),m=null),u$(n);for(var y=r.editHelpers,b=(y||{}).modifyItem,w=[],g=0;g<u.length;g++){var x=n._fullLayout.selections[g];if(!x){w[g]=x;continue}if(w[g]=x._input,c!==void 0&&g===n._fullLayout._activeSelectionIndex){var _=p;switch(x.type){case"rect":b("x0",_.x0),b("x1",_.x1),b("y0",_.y0),b("y1",_.y1);break;case"path":b("path",_.path);break}}}return c===void 0?(w.push(p),w):y?y.getUpdateObj():{}}}},Gi={},Wc={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}};(function(t){var e=Wc,r=me,a=Bt;t.rangeToShapePosition=function(n){return n.type==="log"?n.r2d:function(o){return o}},t.shapePositionToRange=function(n){return n.type==="log"?n.d2r:function(o){return o}},t.decodeDate=function(n){return function(o){return o.replace&&(o=o.replace("_"," ")),n(o)}},t.encodeDate=function(n){return function(o){return n(o).replace(" ","_")}},t.extractPathCoords=function(n,o,l){var s=[],f=n.match(e.segmentRE);return f.forEach(function(c){var v=o[c.charAt(0)].drawn;if(v!==void 0){var u=c.substr(1).match(e.paramRE);if(!(!u||u.length<v)){var h=u[v],d=l?h:r.cleanNumber(h);s.push(d)}}}),s},t.getDataToPixel=function(n,o,l,s){var f=n._fullLayout._size,c;if(o)if(s==="domain")c=function(u){return o._length*(l?1-u:u)+o._offset};else{var v=t.shapePositionToRange(o);c=function(u){return o._offset+o.r2p(v(u,!0))},o.type==="date"&&(c=t.decodeDate(c))}else l?c=function(u){return f.t+f.h*(1-u)}:c=function(u){return f.l+f.w*u};return c},t.getPixelToData=function(n,o,l,s){var f=n._fullLayout._size,c;if(o)if(s==="domain")c=function(u){var h=(u-o._offset)/o._length;return l?1-h:h};else{var v=t.rangeToShapePosition(o);c=function(u){return v(o.p2r(u-o._offset))}}else l?c=function(u){return 1-(u-f.t)/f.h}:c=function(u){return(u-f.l)/f.w};return c},t.roundPositionForSharpStrokeRendering=function(n,o){var l=Math.round(o%2)===1,s=Math.round(n);return l?s+.5:s},t.makeShapesOptionsAndPlotinfo=function(n,o){var l=n._fullLayout.shapes[o]||{},s=n._fullLayout._plots[l.xref+l.yref],f=!!s;return f?s._hadPlotinfo=!0:(s={},l.xref&&l.xref!=="paper"&&(s.xaxis=n._fullLayout[l.xref+"axis"]),l.yref&&l.yref!=="paper"&&(s.yaxis=n._fullLayout[l.yref+"axis"])),s.xsizemode=l.xsizemode,s.ysizemode=l.ysizemode,s.xanchor=l.xanchor,s.yanchor=l.yanchor,{options:l,plotinfo:s}},t.makeSelectionsOptionsAndPlotinfo=function(n,o){var l=n._fullLayout.selections[o]||{},s=n._fullLayout._plots[l.xref+l.yref],f=!!s;return f?s._hadPlotinfo=!0:(s={},l.xref&&(s.xaxis=n._fullLayout[l.xref+"axis"]),l.yref&&(s.yaxis=n._fullLayout[l.yref+"axis"])),{options:l,plotinfo:s}},t.getPathString=function(n,o){var l=o.type,s=a.getRefType(o.xref),f=a.getRefType(o.yref),c=a.getFromId(n,o.xref),v=a.getFromId(n,o.yref),u=n._fullLayout._size,h,d,p,m,y,b,w,g;if(c?s==="domain"?d=function(z){return c._offset+c._length*z}:(h=t.shapePositionToRange(c),d=function(z){return c._offset+c.r2p(h(z,!0))}):d=function(z){return u.l+u.w*z},v?f==="domain"?m=function(z){return v._offset+v._length*(1-z)}:(p=t.shapePositionToRange(v),m=function(z){return v._offset+v.r2p(p(z,!0))}):m=function(z){return u.t+u.h*(1-z)},l==="path")return c&&c.type==="date"&&(d=t.decodeDate(d)),v&&v.type==="date"&&(m=t.decodeDate(m)),i(o,d,m);if(o.xsizemode==="pixel"){var x=d(o.xanchor);y=x+o.x0,b=x+o.x1}else y=d(o.x0),b=d(o.x1);if(o.ysizemode==="pixel"){var _=m(o.yanchor);w=_-o.y0,g=_-o.y1}else w=m(o.y0),g=m(o.y1);if(l==="line")return"M"+y+","+w+"L"+b+","+g;if(l==="rect")return"M"+y+","+w+"H"+b+"V"+g+"H"+y+"Z";var T=(y+b)/2,k=(w+g)/2,S=Math.abs(T-y),L=Math.abs(k-w),D="A"+S+","+L,$=T+S+","+k,E=T+","+(k-L);return"M"+$+D+" 0 1,1 "+E+D+" 0 0,1 "+$+"Z"};function i(n,o,l){var s=n.path,f=n.xsizemode,c=n.ysizemode,v=n.xanchor,u=n.yanchor;return s.replace(e.segmentRE,function(h){var d=0,p=h.charAt(0),m=e.paramIsX[p],y=e.paramIsY[p],b=e.numParams[p],w=h.substr(1).replace(e.paramRE,function(g){return m[d]?f==="pixel"?g=o(v)+Number(g):g=o(g):y[d]&&(c==="pixel"?g=l(u)-Number(g):g=l(g)),d++,d>b&&(g="X"),g});return d>b&&(w=w.replace(/[\s,]*X.*/,""),r.log("Ignoring extra params in segment "+h)),p+w})}})(Gi);var p$=me,In=Bt,Sg=br,Lg=$t,m$=Bi.readPaths,Wd=Gi,y$=Wd.getPathString,Cg=Ih,g$=Ur.FROM_TL,dT=function(e,r,a,i){if(i.selectAll(".shape-label").remove(),!!(a.label.text||a.label.texttemplate)){var n;if(a.label.texttemplate){var o={};if(a.type!=="path"){var l=In.getFromId(e,a.xref),s=In.getFromId(e,a.yref);for(var f in Cg){var c=Cg[f](a,l,s);c!==void 0&&(o[f]=c)}}n=p$.texttemplateStringForShapes(a.label.texttemplate,{},e._fullLayout._d3locale,o)}else n=a.label.text;var v={"data-index":r},u=a.label.font,h={"data-notex":1},d=i.append("g").attr(v).classed("shape-label",!0),p=d.append("text").attr(h).classed("shape-label-text",!0).text(n),m,y,b,w;if(a.path){var g=y$(e,a),x=m$(g,e);m=1/0,b=1/0,y=-1/0,w=-1/0;for(var _=0;_<x.length;_++)for(var T=0;T<x[_].length;T++)for(var k=x[_][T],S=1;S<k.length;S+=2){var L=k[S],D=k[S+1];m=Math.min(m,L),y=Math.max(y,L),b=Math.min(b,D),w=Math.max(w,D)}}else{var $=In.getFromId(e,a.xref),E=In.getRefType(a.xref),z=In.getFromId(e,a.yref),O=In.getRefType(a.yref),I=Wd.getDataToPixel(e,$,!1,E),P=Wd.getDataToPixel(e,z,!0,O);m=I(a.x0),y=I(a.x1),b=P(a.y0),w=P(a.y1)}var M=a.label.textangle;M==="auto"&&(a.type==="line"?M=b$(m,b,y,w):M=0),p.call(function(B){return B.call(Lg.font,u).attr({}),Sg.convertToTspans(B,e),B});var A=Lg.bBox(p.node()),C=x$(m,b,y,w,a,M,A),R=C.textx,N=C.texty,H=C.xanchor;p.attr({"text-anchor":{left:"start",center:"middle",right:"end"}[H],y:N,x:R,transform:"rotate("+M+","+R+","+N+")"}).call(Sg.positionText,R,N)}};function b$(t,e,r,a){var i,n;return n=Math.abs(r-t),r>=t?i=e-a:i=a-e,-180/Math.PI*Math.atan2(i,n)}function x$(t,e,r,a,i,n,o){var l=i.label.textposition,s=i.label.textangle,f=i.label.padding,c=i.type,v=Math.PI/180*n,u=Math.sin(v),h=Math.cos(v),d=i.label.xanchor,p=i.label.yanchor,m,y,b,w;if(c==="line"){l==="start"?(m=t,y=e):l==="end"?(m=r,y=a):(m=(t+r)/2,y=(e+a)/2),d==="auto"&&(l==="start"?s==="auto"?r>t?d="left":r<t?d="right":d="center":r>t?d="right":r<t?d="left":d="center":l==="end"?s==="auto"?r>t?d="right":r<t?d="left":d="center":r>t?d="left":r<t?d="right":d="center":d="center");var g={left:1,center:0,right:-1},x={bottom:-1,middle:0,top:1};if(s==="auto"){var _=x[p];b=-f*u*_,w=f*h*_}else{var T=g[d],k=x[p];b=f*T,w=f*k}m=m+b,y=y+w}else b=f+3,l.indexOf("right")!==-1?(m=Math.max(t,r)-b,d==="auto"&&(d="right")):l.indexOf("left")!==-1?(m=Math.min(t,r)+b,d==="auto"&&(d="left")):(m=(t+r)/2,d==="auto"&&(d="center")),l.indexOf("top")!==-1?y=Math.min(e,a):l.indexOf("bottom")!==-1?y=Math.max(e,a):y=(e+a)/2,w=f,p==="bottom"?y=y-w:p==="top"&&(y=y+w);var S=g$[p],L=i.label.font.size,D=o.height,$=(D*S-L)*u,E=-(D*S-L)*h;return{textx:m+$,texty:y+E,xanchor:d}}var _$=me,w$=_$.strTranslate,Dg=Qa,hT=Dn,T$=hT.drawMode,pT=hT.selectMode,mT=ot,$g=ht,qc=mp,k$=qc.i000,A$=qc.i090,M$=qc.i180,S$=qc.i270,L$=Mn,yT=L$.clearOutlineControllers,xp=Bi,Vs=xp.pointsOnRectangle,tv=xp.pointsOnEllipse,C$=xp.writePaths,D$=gp.newShapes,$$=gp.createShapeObj,P$=vT,R$=dT,_p=function t(e,r,a,i){i||(i=0);var n=a.gd;function o(){t(e,r,a,i++),(tv(e[0])||a.hasText)&&l({redrawing:!0})}function l(P){var M={};a.isActiveShape!==void 0&&(a.isActiveShape=!1,M=D$(r,a)),a.isActiveSelection!==void 0&&(a.isActiveSelection=!1,M=P$(r,a),n._fullLayout._reselect=!0),Object.keys(M).length&&mT.call((P||{}).redrawing?"relayout":"_guiRelayout",n,M)}var s=n._fullLayout,f=s._zoomlayer,c=a.dragmode,v=T$(c),u=pT(c);(v||u)&&(n._fullLayout._outlining=!0),yT(n),r.attr("d",C$(e));var h,d,p,m,y;if(!i&&(a.isActiveShape||a.isActiveSelection)){y=E$([],e);var b=f.append("g").attr("class","outline-controllers");L(b),I()}if(v&&a.hasText){var w=f.select(".label-temp"),g=$$(r,a,a.dragmode);R$(n,"label-temp",g,w)}function x(P){p=+P.srcElement.getAttribute("data-i"),m=+P.srcElement.getAttribute("data-j"),h[p][m].moveFn=_}function _(P,M){if(e.length){var A=y[p][m][1],C=y[p][m][2],R=e[p],N=R.length;if(Vs(R)){var H=P,B=M;if(a.isActiveSelection){var X=Pg(R,m);X[1]===R[m][1]?B=0:H=0}for(var j=0;j<N;j++)if(j!==m){var q=R[j];q[1]===R[m][1]&&(q[1]=A+H),q[2]===R[m][2]&&(q[2]=C+B)}if(R[m][1]=A+H,R[m][2]=C+B,!Vs(R))for(var U=0;U<N;U++)for(var Z=0;Z<R[U].length;Z++)R[U][Z]=y[p][U][Z]}else R[m][1]=A+P,R[m][2]=C+M;o()}}function T(){l()}function k(){if(e.length&&e[p]&&e[p].length){for(var P=[],M=0;M<e[p].length;M++)M!==m&&P.push(e[p][M]);P.length>1&&!(P.length===2&&P[1][0]==="Z")&&(m===0&&(P[0][0]="M"),e[p]=P,o(),l())}}function S(P,M){if(P===2){p=+M.srcElement.getAttribute("data-i"),m=+M.srcElement.getAttribute("data-j");var A=e[p];!Vs(A)&&!tv(A)&&k()}}function L(P){h=[];for(var M=0;M<e.length;M++){var A=e[M],C=Vs(A),R=!C&&tv(A);h[M]=[];for(var N=A.length,H=0;H<N;H++)if(A[H][0]!=="Z"&&!(R&&H!==k$&&H!==A$&&H!==M$&&H!==S$)){var B=C&&a.isActiveSelection,X;B&&(X=Pg(A,H));var j=A[H][1],q=A[H][2],U=P.append(B?"rect":"circle").attr("data-i",M).attr("data-j",H).style({fill:$g.background,stroke:$g.defaultLine,"stroke-width":1,"shape-rendering":"crispEdges"});if(B){var Z=X[1]-j,K=X[2]-q,ee=K?5:Math.max(Math.min(25,Math.abs(Z)-5),5),le=Z?5:Math.max(Math.min(25,Math.abs(K)-5),5);U.classed(K?"cursor-ew-resize":"cursor-ns-resize",!0).attr("width",ee).attr("height",le).attr("x",j-ee/2).attr("y",q-le/2).attr("transform",w$(Z/2,K/2))}else U.classed("cursor-grab",!0).attr("r",5).attr("cx",j).attr("cy",q);h[M][H]={element:U.node(),gd:n,prepFn:x,doneFn:T,clickFn:S},Dg.init(h[M][H])}}}function D(P,M){if(e.length)for(var A=0;A<e.length;A++)for(var C=0;C<e[A].length;C++)for(var R=0;R+2<e[A][C].length;R+=2)e[A][C][R+1]=y[A][C][R+1]+P,e[A][C][R+2]=y[A][C][R+2]+M}function $(P,M){D(P,M),o()}function E(P){p=+P.srcElement.getAttribute("data-i"),p||(p=0),d[p].moveFn=$}function z(){l()}function O(P){P===2&&z$(n)}function I(){if(d=[],!!e.length){var P=0;d[P]={element:r[0][0],gd:n,prepFn:E,doneFn:z,clickFn:O},Dg.init(d[P])}}};function E$(t,e){for(var r=0;r<e.length;r++){var a=e[r];t[r]=[];for(var i=0;i<a.length;i++){t[r][i]=[];for(var n=0;n<a[i].length;n++)t[r][i][n]=a[i][n]}}return t}function Pg(t,e){var r=t[e][1],a=t[e][2],i=t.length,n,o,l;return n=(e+1)%i,o=t[n][1],l=t[n][2],o===r&&l===a&&(n=(e+2)%i,o=t[n][1],l=t[n][2]),[n,o,l]}function z$(t){if(pT(t._fullLayout.dragmode)){yT(t);var e=t._fullLayout._activeSelectionIndex,r=(t.layout||{}).selections||[];if(e<r.length){for(var a=[],i=0;i<r.length;i++)i!==e&&a.push(r[i]);delete t._fullLayout._activeSelectionIndex;var n=t._fullLayout.selections[e];t._fullLayout._deselect={xref:n.xref,yref:n.yref},mT.call("_guiRelayout",t,{selections:a})}}}var I$=gt,gT=ot,Rg=me,Fn=Bt,F$=Bi.readPaths,N$=_p,ec=dT,bT=Mn.clearOutlineControllers,rv=ht,wp=$t,H$=Ht.arrayEditor,Eg=Qa,zg=ji,on=Wc,Wr=Gi,qd=Wr.getPathString,Tp={draw:kp,drawOne:xT,eraseActiveShape:B$,drawLabel:ec};function kp(t){var e=t._fullLayout;e._shapeUpperLayer.selectAll("path").remove(),e._shapeLowerLayer.selectAll("path").remove(),e._shapeUpperLayer.selectAll("text").remove(),e._shapeLowerLayer.selectAll("text").remove();for(var r in e._plots){var a=e._plots[r].shapelayer;a&&(a.selectAll("path").remove(),a.selectAll("text").remove())}for(var i=0;i<e.shapes.length;i++)e.shapes[i].visible===!0&&xT(t,i)}function Xs(t){return!!t._fullLayout._outlining}function Zc(t){return!t._context.edits.shapePosition}function xT(t,e){t._fullLayout._paperdiv.selectAll('.shapelayer [data-index="'+e+'"]').remove();var r=Wr.makeShapesOptionsAndPlotinfo(t,e),a=r.options,i=r.plotinfo;if(!a._input||a.visible!==!0)return;if(a.layer!=="below")o(t._fullLayout._shapeUpperLayer);else if(a.xref==="paper"||a.yref==="paper")o(t._fullLayout._shapeLowerLayer);else if(i._hadPlotinfo){var n=i.mainplotinfo||i;o(n.shapelayer)}else o(t._fullLayout._shapeLowerLayer);function o(l){var s=qd(t,a),f={"data-index":e,"fill-rule":a.fillrule,d:s},c=a.opacity,v=a.fillcolor,u=a.line.width?a.line.color:"rgba(0,0,0,0)",h=a.line.width,d=a.line.dash;!h&&a.editable===!0&&(h=5,d="solid");var p=s[s.length-1]!=="Z",m=Zc(t)&&a.editable&&t._fullLayout._activeShapeIndex===e;m&&(v=p?"rgba(0,0,0,0)":t._fullLayout.activeshape.fillcolor,c=t._fullLayout.activeshape.opacity);var y=l.append("g").classed("shape-group",!0).attr({"data-index":e}),b=y.append("path").attr(f).style("opacity",c).call(rv.stroke,u).call(rv.fill,v).call(wp.dashLine,d,h);_T(y,t,a),ec(t,e,a,y);var w;if((m||t._context.edits.shapePosition)&&(w=H$(t.layout,"shapes",a)),m){b.style({cursor:"move"});var g={element:b.node(),plotinfo:i,gd:t,editHelpers:w,hasText:a.label.text||a.label.texttemplate,isActiveShape:!0},x=F$(s,t);N$(x,b,g)}else t._context.edits.shapePosition?O$(t,b,a,e,l,w):a.editable===!0&&b.style("pointer-events",p||rv.opacity(v)*c<=.5?"stroke":"all");b.node().addEventListener("click",function(){return j$(t,b)})}}function _T(t,e,r){var a=(r.xref+r.yref).replace(/paper/g,"").replace(/[xyz][1-9]* *domain/g,"");wp.setClipUrl(t,a?"clip"+e._fullLayout._uid+a:null,e)}function O$(t,e,r,a,i,n){var o=10,l=10,s=r.xsizemode==="pixel",f=r.ysizemode==="pixel",c=r.type==="line",v=r.type==="path",u=n.modifyItem,h,d,p,m,y,b,w,g,x,_,T,k,S,L,D,$=I$.select(e.node().parentNode),E=Fn.getFromId(t,r.xref),z=Fn.getRefType(r.xref),O=Fn.getFromId(t,r.yref),I=Fn.getRefType(r.yref),P=Wr.getDataToPixel(t,E,!1,z),M=Wr.getDataToPixel(t,O,!0,I),A=Wr.getPixelToData(t,E,!1,z),C=Wr.getPixelToData(t,O,!0,I),R=B(),N={element:R.node(),gd:t,prepFn:q,doneFn:U,clickFn:Z},H;Eg.init(N),R.node().onmousemove=j;function B(){return c?X():e}function X(){var G=10,J=Math.max(r.line.width,G),oe=i.append("g").attr("data-index",a).attr("drag-helper",!0);oe.append("path").attr("d",e.attr("d")).style({cursor:"move","stroke-width":J,"stroke-opacity":"0"});var fe={"fill-opacity":"0"},pe=Math.max(J/2,G);return oe.append("circle").attr({"data-line-point":"start-point",cx:s?P(r.xanchor)+r.x0:P(r.x0),cy:f?M(r.yanchor)-r.y0:M(r.y0),r:pe}).style(fe).classed("cursor-grab",!0),oe.append("circle").attr({"data-line-point":"end-point",cx:s?P(r.xanchor)+r.x1:P(r.x1),cy:f?M(r.yanchor)-r.y1:M(r.y1),r:pe}).style(fe).classed("cursor-grab",!0),oe}function j(G){if(Xs(t)){H=null;return}if(c)G.target.tagName==="path"?H="move":H=G.target.attributes["data-line-point"].value==="start-point"?"resize-over-start-point":"resize-over-end-point";else{var J=N.element.getBoundingClientRect(),oe=J.right-J.left,fe=J.bottom-J.top,pe=G.clientX-J.left,ge=G.clientY-J.top,ue=!v&&oe>o&&fe>l&&!G.shiftKey?Eg.getCursor(pe/oe,1-ge/fe):"move";zg(e,ue),H=ue.split("-")[0]}}function q(G){Xs(t)||(s&&(y=P(r.xanchor)),f&&(b=M(r.yanchor)),r.type==="path"?D=r.path:(h=s?r.x0:P(r.x0),d=f?r.y0:M(r.y0),p=s?r.x1:P(r.x1),m=f?r.y1:M(r.y1)),h<p?(x=h,S="x0",_=p,L="x1"):(x=p,S="x1",_=h,L="x0"),!f&&d<m||f&&d>m?(w=d,T="y0",g=m,k="y1"):(w=m,T="y1",g=d,k="y0"),j(G),le(i,r),se(e,r,t),N.moveFn=H==="move"?K:ee,N.altKey=G.altKey)}function U(){Xs(t)||(zg(e),ye(i),_T(e,t,r),gT.call("_guiRelayout",t,n.getUpdateObj()))}function Z(){Xs(t)||ye(i)}function K(G,J){if(r.type==="path"){var oe=function(ge){return ge},fe=oe,pe=oe;s?u("xanchor",r.xanchor=A(y+G)):(fe=function(ue){return A(P(ue)+G)},E&&E.type==="date"&&(fe=Wr.encodeDate(fe))),f?u("yanchor",r.yanchor=C(b+J)):(pe=function(ue){return C(M(ue)+J)},O&&O.type==="date"&&(pe=Wr.encodeDate(pe))),u("path",r.path=Ig(D,fe,pe))}else s?u("xanchor",r.xanchor=A(y+G)):(u("x0",r.x0=A(h+G)),u("x1",r.x1=A(p+G))),f?u("yanchor",r.yanchor=C(b+J)):(u("y0",r.y0=C(d+J)),u("y1",r.y1=C(m+J)));e.attr("d",qd(t,r)),le(i,r),ec(t,a,r,$)}function ee(G,J){if(v){var oe=function(Me){return Me},fe=oe,pe=oe;s?u("xanchor",r.xanchor=A(y+G)):(fe=function(we){return A(P(we)+G)},E&&E.type==="date"&&(fe=Wr.encodeDate(fe))),f?u("yanchor",r.yanchor=C(b+J)):(pe=function(we){return C(M(we)+J)},O&&O.type==="date"&&(pe=Wr.encodeDate(pe))),u("path",r.path=Ig(D,fe,pe))}else if(c){if(H==="resize-over-start-point"){var ge=h+G,ue=f?d-J:d+J;u("x0",r.x0=s?ge:A(ge)),u("y0",r.y0=f?ue:C(ue))}else if(H==="resize-over-end-point"){var Ce=p+G,ce=f?m-J:m+J;u("x1",r.x1=s?Ce:A(Ce)),u("y1",r.y1=f?ce:C(ce))}}else{var De=function(Me){return H.indexOf(Me)!==-1},Ee=De("n"),$e=De("s"),te=De("w"),Te=De("e"),ne=Ee?w+J:w,de=$e?g+J:g,he=te?x+G:x,Ae=Te?_+G:_;f&&(Ee&&(ne=w-J),$e&&(de=g-J)),(!f&&de-ne>l||f&&ne-de>l)&&(u(T,r[T]=f?ne:C(ne)),u(k,r[k]=f?de:C(de))),Ae-he>o&&(u(S,r[S]=s?he:A(he)),u(L,r[L]=s?Ae:A(Ae)))}e.attr("d",qd(t,r)),le(i,r),ec(t,a,r,$)}function le(G,J){(s||f)&&oe();function oe(){var fe=J.type!=="path",pe=G.selectAll(".visual-cue").data([0]),ge=1;pe.enter().append("path").attr({fill:"#fff","fill-rule":"evenodd",stroke:"#000","stroke-width":ge}).classed("visual-cue",!0);var ue=P(s?J.xanchor:Rg.midRange(fe?[J.x0,J.x1]:Wr.extractPathCoords(J.path,on.paramIsX))),Ce=M(f?J.yanchor:Rg.midRange(fe?[J.y0,J.y1]:Wr.extractPathCoords(J.path,on.paramIsY)));if(ue=Wr.roundPositionForSharpStrokeRendering(ue,ge),Ce=Wr.roundPositionForSharpStrokeRendering(Ce,ge),s&&f){var ce="M"+(ue-1-ge)+","+(Ce-1-ge)+"h-8v2h8 v8h2v-8 h8v-2h-8 v-8h-2 Z";pe.attr("d",ce)}else if(s){var De="M"+(ue-1-ge)+","+(Ce-9-ge)+"v18 h2 v-18 Z";pe.attr("d",De)}else{var Ee="M"+(ue-9-ge)+","+(Ce-1-ge)+"h18 v2 h-18 Z";pe.attr("d",Ee)}}}function ye(G){G.selectAll(".visual-cue").remove()}function se(G,J,oe){var fe=J.xref,pe=J.yref,ge=Fn.getFromId(oe,fe),ue=Fn.getFromId(oe,pe),Ce="";fe!=="paper"&&!ge.autorange&&(Ce+=fe),pe!=="paper"&&!ue.autorange&&(Ce+=pe),wp.setClipUrl(G,Ce?"clip"+oe._fullLayout._uid+Ce:null,oe)}}function Ig(t,e,r){return t.replace(on.segmentRE,function(a){var i=0,n=a.charAt(0),o=on.paramIsX[n],l=on.paramIsY[n],s=on.numParams[n],f=a.substr(1).replace(on.paramRE,function(c){return i>=s||(o[i]?c=e(c):l[i]&&(c=r(c)),i++),c});return n+f})}function j$(t,e){if(Zc(t)){var r=e.node(),a=+r.getAttribute("data-index");if(a>=0){if(a===t._fullLayout._activeShapeIndex){Fg(t);return}t._fullLayout._activeShapeIndex=a,t._fullLayout._deactivateShape=Fg,kp(t)}}}function Fg(t){if(Zc(t)){var e=t._fullLayout._activeShapeIndex;e>=0&&(bT(t),delete t._fullLayout._activeShapeIndex,kp(t))}}function B$(t){if(Zc(t)){bT(t);var e=t._fullLayout._activeShapeIndex,r=(t.layout||{}).shapes||[];if(e<r.length){for(var a=[],i=0;i<r.length;i++)i!==e&&a.push(r[i]);return delete t._fullLayout._activeShapeIndex,gT.call("_guiRelayout",t,{shapes:a})}}}var _a=ot,wT=cr,TT=lr,Pt=pp,G$=Tp.eraseActiveShape,io=me,St=io._,Rt=lT.exports={};Rt.toImage={name:"toImage",title:function(t){var e=t._context.toImageButtonOptions||{},r=e.format||"png";return r==="png"?St(t,"Download plot as a png"):St(t,"Download plot")},icon:Pt.camera,click:function(t){var e=t._context.toImageButtonOptions,r={format:e.format||"png"};io.notifier(St(t,"Taking snapshot - this may take a few seconds"),"long"),r.format!=="svg"&&io.isIE()&&(io.notifier(St(t,"IE only supports svg. Changing format to svg."),"long"),r.format="svg"),["filename","width","height","scale"].forEach(function(a){a in e&&(r[a]=e[a])}),_a.call("downloadImage",t,r).then(function(a){io.notifier(St(t,"Snapshot succeeded")+" - "+a,"long")}).catch(function(){io.notifier(St(t,"Sorry, there was a problem downloading your snapshot!"),"long")})}};Rt.sendDataToCloud={name:"sendDataToCloud",title:function(t){return St(t,"Edit in Chart Studio")},icon:Pt.disk,click:function(t){wT.sendDataToCloud(t)}};Rt.editInChartStudio={name:"editInChartStudio",title:function(t){return St(t,"Edit in Chart Studio")},icon:Pt.pencil,click:function(t){wT.sendDataToCloud(t)}};Rt.zoom2d={name:"zoom2d",_cat:"zoom",title:function(t){return St(t,"Zoom")},attr:"dragmode",val:"zoom",icon:Pt.zoombox,click:Nr};Rt.pan2d={name:"pan2d",_cat:"pan",title:function(t){return St(t,"Pan")},attr:"dragmode",val:"pan",icon:Pt.pan,click:Nr};Rt.select2d={name:"select2d",_cat:"select",title:function(t){return St(t,"Box Select")},attr:"dragmode",val:"select",icon:Pt.selectbox,click:Nr};Rt.lasso2d={name:"lasso2d",_cat:"lasso",title:function(t){return St(t,"Lasso Select")},attr:"dragmode",val:"lasso",icon:Pt.lasso,click:Nr};Rt.drawclosedpath={name:"drawclosedpath",title:function(t){return St(t,"Draw closed freeform")},attr:"dragmode",val:"drawclosedpath",icon:Pt.drawclosedpath,click:Nr};Rt.drawopenpath={name:"drawopenpath",title:function(t){return St(t,"Draw open freeform")},attr:"dragmode",val:"drawopenpath",icon:Pt.drawopenpath,click:Nr};Rt.drawline={name:"drawline",title:function(t){return St(t,"Draw line")},attr:"dragmode",val:"drawline",icon:Pt.drawline,click:Nr};Rt.drawrect={name:"drawrect",title:function(t){return St(t,"Draw rectangle")},attr:"dragmode",val:"drawrect",icon:Pt.drawrect,click:Nr};Rt.drawcircle={name:"drawcircle",title:function(t){return St(t,"Draw circle")},attr:"dragmode",val:"drawcircle",icon:Pt.drawcircle,click:Nr};Rt.eraseshape={name:"eraseshape",title:function(t){return St(t,"Erase active shape")},icon:Pt.eraseshape,click:G$};Rt.zoomIn2d={name:"zoomIn2d",_cat:"zoomin",title:function(t){return St(t,"Zoom in")},attr:"zoom",val:"in",icon:Pt.zoom_plus,click:Nr};Rt.zoomOut2d={name:"zoomOut2d",_cat:"zoomout",title:function(t){return St(t,"Zoom out")},attr:"zoom",val:"out",icon:Pt.zoom_minus,click:Nr};Rt.autoScale2d={name:"autoScale2d",_cat:"autoscale",title:function(t){return St(t,"Autoscale")},attr:"zoom",val:"auto",icon:Pt.autoscale,click:Nr};Rt.resetScale2d={name:"resetScale2d",_cat:"resetscale",title:function(t){return St(t,"Reset axes")},attr:"zoom",val:"reset",icon:Pt.home,click:Nr};Rt.hoverClosestCartesian={name:"hoverClosestCartesian",_cat:"hoverclosest",title:function(t){return St(t,"Show closest data on hover")},attr:"hovermode",val:"closest",icon:Pt.tooltip_basic,gravity:"ne",click:Nr};Rt.hoverCompareCartesian={name:"hoverCompareCartesian",_cat:"hoverCompare",title:function(t){return St(t,"Compare data on hover")},attr:"hovermode",val:function(t){return t._fullLayout._isHoriz?"y":"x"},icon:Pt.tooltip_compare,gravity:"ne",click:Nr};function Nr(t,e){var r=e.currentTarget,a=r.getAttribute("data-attr"),i=r.getAttribute("data-val")||!0,n=t._fullLayout,o={},l=TT.list(t,null,!0),s=n._cartesianSpikesEnabled,f,c;if(a==="zoom"){var v=i==="in"?.5:2,u=(1+v)/2,h=(1-v)/2,d;for(c=0;c<l.length;c++)if(f=l[c],!f.fixedrange)if(d=f._name,i==="auto")o[d+".autorange"]=!0;else if(i==="reset")f._rangeInitial0===void 0&&f._rangeInitial1===void 0?o[d+".autorange"]=!0:f._rangeInitial0===void 0?(o[d+".autorange"]=f._autorangeInitial,o[d+".range"]=[null,f._rangeInitial1]):f._rangeInitial1===void 0?(o[d+".range"]=[f._rangeInitial0,null],o[d+".autorange"]=f._autorangeInitial):o[d+".range"]=[f._rangeInitial0,f._rangeInitial1],f._showSpikeInitial!==void 0&&(o[d+".showspikes"]=f._showSpikeInitial,s==="on"&&!f._showSpikeInitial&&(s="off"));else{var p=[f.r2l(f.range[0]),f.r2l(f.range[1])],m=[u*p[0]+h*p[1],u*p[1]+h*p[0]];o[d+".range[0]"]=f.l2r(m[0]),o[d+".range[1]"]=f.l2r(m[1])}}else a==="hovermode"&&(i==="x"||i==="y")&&(i=n._isHoriz?"y":"x",r.setAttribute("data-val",i)),o[a]=i;n._cartesianSpikesEnabled=s,_a.call("_guiRelayout",t,o)}Rt.zoom3d={name:"zoom3d",_cat:"zoom",title:function(t){return St(t,"Zoom")},attr:"scene.dragmode",val:"zoom",icon:Pt.zoombox,click:Kc};Rt.pan3d={name:"pan3d",_cat:"pan",title:function(t){return St(t,"Pan")},attr:"scene.dragmode",val:"pan",icon:Pt.pan,click:Kc};Rt.orbitRotation={name:"orbitRotation",title:function(t){return St(t,"Orbital rotation")},attr:"scene.dragmode",val:"orbit",icon:Pt["3d_rotate"],click:Kc};Rt.tableRotation={name:"tableRotation",title:function(t){return St(t,"Turntable rotation")},attr:"scene.dragmode",val:"turntable",icon:Pt["z-axis"],click:Kc};function Kc(t,e){for(var r=e.currentTarget,a=r.getAttribute("data-attr"),i=r.getAttribute("data-val")||!0,n=t._fullLayout._subplots.gl3d||[],o={},l=a.split("."),s=0;s<n.length;s++)o[n[s]+"."+l[1]]=i;var f=i==="pan"?i:"zoom";o.dragmode=f,_a.call("_guiRelayout",t,o)}Rt.resetCameraDefault3d={name:"resetCameraDefault3d",_cat:"resetCameraDefault",title:function(t){return St(t,"Reset camera to default")},attr:"resetDefault",icon:Pt.home,click:Ap};Rt.resetCameraLastSave3d={name:"resetCameraLastSave3d",_cat:"resetCameraLastSave",title:function(t){return St(t,"Reset camera to last save")},attr:"resetLastSave",icon:Pt.movie,click:Ap};function Ap(t,e){for(var r=e.currentTarget,a=r.getAttribute("data-attr"),i=a==="resetLastSave",n=a==="resetDefault",o=t._fullLayout,l=o._subplots.gl3d||[],s={},f=0;f<l.length;f++){var c=l[f],v=c+".camera",u=c+".aspectratio",h=c+".aspectmode",d=o[c]._scene,p;i?(s[v+".up"]=d.viewInitial.up,s[v+".eye"]=d.viewInitial.eye,s[v+".center"]=d.viewInitial.center,p=!0):n&&(s[v+".up"]=null,s[v+".eye"]=null,s[v+".center"]=null,p=!0),p&&(s[u+".x"]=d.viewInitial.aspectratio.x,s[u+".y"]=d.viewInitial.aspectratio.y,s[u+".z"]=d.viewInitial.aspectratio.z,s[h]=d.viewInitial.aspectmode)}_a.call("_guiRelayout",t,s)}Rt.hoverClosest3d={name:"hoverClosest3d",_cat:"hoverclosest",title:function(t){return St(t,"Toggle show closest data on hover")},attr:"hovermode",val:null,toggle:!0,icon:Pt.tooltip_basic,gravity:"ne",click:U$};function kT(t,e){var r=e.currentTarget,a=r._previousVal,i=t._fullLayout,n=i._subplots.gl3d||[],o=["xaxis","yaxis","zaxis"],l={},s={};if(a)s=a,r._previousVal=null;else{for(var f=0;f<n.length;f++){var c=n[f],v=i[c],u=c+".hovermode";l[u]=v.hovermode,s[u]=!1;for(var h=0;h<3;h++){var d=o[h],p=c+"."+d+".showspikes";s[p]=!1,l[p]=v[d].showspikes}}r._previousVal=l}return s}function U$(t,e){var r=kT(t,e);_a.call("_guiRelayout",t,r)}Rt.zoomInGeo={name:"zoomInGeo",_cat:"zoomin",title:function(t){return St(t,"Zoom in")},attr:"zoom",val:"in",icon:Pt.zoom_plus,click:Mp};Rt.zoomOutGeo={name:"zoomOutGeo",_cat:"zoomout",title:function(t){return St(t,"Zoom out")},attr:"zoom",val:"out",icon:Pt.zoom_minus,click:Mp};Rt.resetGeo={name:"resetGeo",_cat:"reset",title:function(t){return St(t,"Reset")},attr:"reset",val:null,icon:Pt.autoscale,click:Mp};Rt.hoverClosestGeo={name:"hoverClosestGeo",_cat:"hoverclosest",title:function(t){return St(t,"Toggle show closest data on hover")},attr:"hovermode",val:null,toggle:!0,icon:Pt.tooltip_basic,gravity:"ne",click:Sp};function Mp(t,e){for(var r=e.currentTarget,a=r.getAttribute("data-attr"),i=r.getAttribute("data-val")||!0,n=t._fullLayout,o=n._subplots.geo||[],l=0;l<o.length;l++){var s=o[l],f=n[s];if(a==="zoom"){var c=f.projection.scale,v=i==="in"?2*c:.5*c;_a.call("_guiRelayout",t,s+".projection.scale",v)}}a==="reset"&&tc(t,"geo")}Rt.hoverClosestGl2d={name:"hoverClosestGl2d",_cat:"hoverclosest",title:function(t){return St(t,"Toggle show closest data on hover")},attr:"hovermode",val:null,toggle:!0,icon:Pt.tooltip_basic,gravity:"ne",click:Sp};Rt.hoverClosestPie={name:"hoverClosestPie",_cat:"hoverclosest",title:function(t){return St(t,"Toggle show closest data on hover")},attr:"hovermode",val:"closest",icon:Pt.tooltip_basic,gravity:"ne",click:Sp};function AT(t){var e=t._fullLayout;return e.hovermode?!1:e._has("cartesian")?e._isHoriz?"y":"x":"closest"}function Sp(t){var e=AT(t);_a.call("_guiRelayout",t,"hovermode",e)}Rt.resetViewSankey={name:"resetSankeyGroup",title:function(t){return St(t,"Reset view")},icon:Pt.home,click:function(t){for(var e={"node.groups":[],"node.x":[],"node.y":[]},r=0;r<t._fullData.length;r++){var a=t._fullData[r]._viewInitial;e["node.groups"].push(a.node.groups.slice()),e["node.x"].push(a.node.x.slice()),e["node.y"].push(a.node.y.slice())}_a.call("restyle",t,e)}};Rt.toggleHover={name:"toggleHover",title:function(t){return St(t,"Toggle show closest data on hover")},attr:"hovermode",val:null,toggle:!0,icon:Pt.tooltip_basic,gravity:"ne",click:function(t,e){var r=kT(t,e);r.hovermode=AT(t),_a.call("_guiRelayout",t,r)}};Rt.resetViews={name:"resetViews",title:function(t){return St(t,"Reset views")},icon:Pt.home,click:function(t,e){var r=e.currentTarget;r.setAttribute("data-attr","zoom"),r.setAttribute("data-val","reset"),Nr(t,e),r.setAttribute("data-attr","resetLastSave"),Ap(t,e),tc(t,"geo"),tc(t,"mapbox")}};Rt.toggleSpikelines={name:"toggleSpikelines",title:function(t){return St(t,"Toggle Spike Lines")},icon:Pt.spikeline,attr:"_cartesianSpikesEnabled",val:"on",click:function(t){var e=t._fullLayout,r=e._cartesianSpikesEnabled;e._cartesianSpikesEnabled=r==="on"?"off":"on",_a.call("_guiRelayout",t,V$(t))}};function V$(t){for(var e=t._fullLayout,r=e._cartesianSpikesEnabled==="on",a=TT.list(t,null,!0),i={},n=0;n<a.length;n++){var o=a[n];i[o._name+".showspikes"]=r?!0:o._showSpikeInitial}return i}Rt.resetViewMapbox={name:"resetViewMapbox",_cat:"resetView",title:function(t){return St(t,"Reset view")},attr:"reset",icon:Pt.home,click:function(t){tc(t,"mapbox")}};Rt.zoomInMapbox={name:"zoomInMapbox",_cat:"zoomin",title:function(t){return St(t,"Zoom in")},attr:"zoom",val:"in",icon:Pt.zoom_plus,click:MT};Rt.zoomOutMapbox={name:"zoomOutMapbox",_cat:"zoomout",title:function(t){return St(t,"Zoom out")},attr:"zoom",val:"out",icon:Pt.zoom_minus,click:MT};function MT(t,e){for(var r=e.currentTarget,a=r.getAttribute("data-val"),i=t._fullLayout,n=i._subplots.mapbox||[],o=1.05,l={},s=0;s<n.length;s++){var f=n[s],c=i[f].zoom,v=a==="in"?o*c:c/o;l[f+".zoom"]=v}_a.call("_guiRelayout",t,l)}function tc(t,e){for(var r=t._fullLayout,a=r._subplots[e]||[],i={},n=0;n<a.length;n++)for(var o=a[n],l=r[o]._subplot,s=l.viewInitial,f=Object.keys(s),c=0;c<f.length;c++){var v=f[c];i[o+"."+v]=s[v]}_a.call("_guiRelayout",t,i)}var ST=lT.exports,LT=ST,X$=Object.keys(LT),CT=["drawline","drawopenpath","drawclosedpath","drawcircle","drawrect","eraseshape"],DT=["v1hovermode","hoverclosest","hovercompare","togglehover","togglespikelines"].concat(CT),vo=[],Y$=function(t){if(DT.indexOf(t._cat||t.name)===-1){var e=t.name,r=(t._cat||t.name).toLowerCase();vo.indexOf(e)===-1&&vo.push(e),vo.indexOf(r)===-1&&vo.push(r)}};X$.forEach(function(t){Y$(LT[t])});vo.sort();var $T={DRAW_MODES:CT,backButtons:DT,foreButtons:vo},Ng=$T,PT={editType:"modebar",orientation:{valType:"enumerated",values:["v","h"],dflt:"h",editType:"modebar",description:"Sets the orientation of the modebar."},bgcolor:{valType:"color",editType:"modebar",description:"Sets the background color of the modebar."},color:{valType:"color",editType:"modebar",description:"Sets the color of the icons in the modebar."},activecolor:{valType:"color",editType:"modebar",description:"Sets the color of the active or hovered on icons in the modebar."},uirevision:{valType:"any",editType:"none",description:["Controls persistence of user-driven changes related to the modebar,","including `hovermode`, `dragmode`, and `showspikes` at both the","root level and inside subplots. Defaults to `layout.uirevision`."].join(" ")},add:{valType:"string",arrayOk:!0,dflt:"",editType:"modebar",description:["Determines which predefined modebar buttons to add.","Please note that these buttons will only be shown if they are","compatible with all trace types used in a graph.","Similar to `config.modeBarButtonsToAdd` option.","This may include *"+Ng.backButtons.join("*, *")+"*."].join(" ")},remove:{valType:"string",arrayOk:!0,dflt:"",editType:"modebar",description:["Determines which predefined modebar buttons to remove.","Similar to `config.modeBarButtonsToRemove` option.","This may include *"+Ng.foreButtons.join("*, *")+"*."].join(" ")}},W$=me,rl=ht,q$=Ht,Z$=PT,K$=function(e,r){var a=e.modebar||{},i=q$.newContainer(r,"modebar");function n(l,s){return W$.coerce(a,i,Z$,l,s)}n("orientation"),n("bgcolor",rl.addOpacity(r.paper_bgcolor,.5));var o=rl.contrast(rl.rgb(r.modebar.bgcolor));n("color",rl.addOpacity(o,.3)),n("activecolor",rl.addOpacity(o,.7)),n("uirevision",r.uirevision),n("add"),n("remove")},Lp=gt,Q$=wt,oi=me,RT=pp,J$=wc.version,eP=new DOMParser;function ET(t){this.container=t.container,this.element=document.createElement("div"),this.update(t.graphInfo,t.buttons),this.container.appendChild(this.element)}var Ja=ET.prototype;Ja.update=function(t,e){this.graphInfo=t;var r=this.graphInfo._context,a=this.graphInfo._fullLayout,i="modebar-"+a._uid;this.element.setAttribute("id",i),this._uid=i,this.element.className="modebar",r.displayModeBar==="hover"&&(this.element.className+=" modebar--hover ease-bg"),a.modebar.orientation==="v"&&(this.element.className+=" vertical",e=e.reverse());var n=a.modebar,o=r.displayModeBar==="hover"?".js-plotly-plot .plotly:hover ":"";oi.deleteRelatedStyleRule(i),oi.addRelatedStyleRule(i,o+"#"+i+" .modebar-group","background-color: "+n.bgcolor),oi.addRelatedStyleRule(i,"#"+i+" .modebar-btn .icon path","fill: "+n.color),oi.addRelatedStyleRule(i,"#"+i+" .modebar-btn:hover .icon path","fill: "+n.activecolor),oi.addRelatedStyleRule(i,"#"+i+" .modebar-btn.active .icon path","fill: "+n.activecolor);var l=!this.hasButtons(e),s=this.hasLogo!==r.displaylogo,f=this.locale!==r.locale;if(this.locale=r.locale,(l||s||f)&&(this.removeAllButtons(),this.updateButtons(e),r.watermark||r.displaylogo)){var c=this.getLogo();r.watermark&&(c.className=c.className+" watermark"),a.modebar.orientation==="v"?this.element.insertBefore(c,this.element.childNodes[0]):this.element.appendChild(c),this.hasLogo=!0}this.updateActiveButton()};Ja.updateButtons=function(t){var e=this;this.buttons=t,this.buttonElements=[],this.buttonsNames=[],this.buttons.forEach(function(r){var a=e.createGroup();r.forEach(function(i){var n=i.name;if(!n)throw new Error("must provide button 'name' in button config");if(e.buttonsNames.indexOf(n)!==-1)throw new Error("button name '"+n+"' is taken");e.buttonsNames.push(n);var o=e.createButton(i);e.buttonElements.push(o),a.appendChild(o)}),e.element.appendChild(a)})};Ja.createGroup=function(){var t=document.createElement("div");return t.className="modebar-group",t};Ja.createButton=function(t){var e=this,r=document.createElement("a");r.setAttribute("rel","tooltip"),r.className="modebar-btn";var a=t.title;a===void 0?a=t.name:typeof a=="function"&&(a=a(this.graphInfo)),(a||a===0)&&r.setAttribute("data-title",a),t.attr!==void 0&&r.setAttribute("data-attr",t.attr);var i=t.val;i!==void 0&&(typeof i=="function"&&(i=i(this.graphInfo)),r.setAttribute("data-val",i));var n=t.click;if(typeof n!="function")throw new Error("must provide button 'click' function in button config");r.addEventListener("click",function(l){t.click(e.graphInfo,l),e.updateActiveButton(l.currentTarget)}),r.setAttribute("data-toggle",t.toggle||!1),t.toggle&&Lp.select(r).classed("active",!0);var o=t.icon;return typeof o=="function"?r.appendChild(o()):r.appendChild(this.createIcon(o||RT.question)),r.setAttribute("data-gravity",t.gravity||"n"),r};Ja.createIcon=function(t){var e=Q$(t.height)?Number(t.height):t.ascent-t.descent,r="http://www.w3.org/2000/svg",a;if(t.path){a=document.createElementNS(r,"svg"),a.setAttribute("viewBox",[0,0,t.width,e].join(" ")),a.setAttribute("class","icon");var i=document.createElementNS(r,"path");i.setAttribute("d",t.path),t.transform?i.setAttribute("transform",t.transform):t.ascent!==void 0&&i.setAttribute("transform","matrix(1 0 0 -1 0 "+t.ascent+")"),a.appendChild(i)}if(t.svg){var n=eP.parseFromString(t.svg,"application/xml");a=n.childNodes[0]}return a.setAttribute("height","1em"),a.setAttribute("width","1em"),a};Ja.updateActiveButton=function(t){var e=this.graphInfo._fullLayout,r=t!==void 0?t.getAttribute("data-attr"):null;this.buttonElements.forEach(function(a){var i=a.getAttribute("data-val")||!0,n=a.getAttribute("data-attr"),o=a.getAttribute("data-toggle")==="true",l=Lp.select(a);if(o)n===r&&l.classed("active",!l.classed("active"));else{var s=n===null?n:oi.nestedProperty(e,n).get();l.classed("active",s===i)}})};Ja.hasButtons=function(t){var e=this.buttons;if(!e||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 a=0;a<t[r].length;a++)if(t[r][a].name!==e[r][a].name)return!1}return!0};function tP(t){return t+" (v"+J$+")"}Ja.getLogo=function(){var t=this.createGroup(),e=document.createElement("a");return e.href="https://plotly.com/",e.target="_blank",e.setAttribute("data-title",tP(oi._(this.graphInfo,"Produced with Plotly.js"))),e.className="modebar-btn plotlyjsicon modebar-btn--logo",e.appendChild(this.createIcon(RT.newplotlylogo)),t.appendChild(e),t};Ja.removeAllButtons=function(){for(;this.element.firstChild;)this.element.removeChild(this.element.firstChild);this.hasLogo=!1};Ja.destroy=function(){oi.removeElement(this.container.querySelector(".modebar")),oi.deleteRelatedStyleRule(this._uid)};function rP(t,e){var r=t._fullLayout,a=new ET({graphInfo:t,container:r._modebardiv.node(),buttons:e});return r._privateplot&&Lp.select(a.element).append("span").classed("badge-private float--left",!0).text("PRIVATE"),a}var aP=rP,iP=lr,Hg=Ir,Zd=ot,nP=xa.isUnifiedHover,oP=aP,rc=ST,lP=$T.DRAW_MODES,sP=me.extendDeep,fP=function(e){var r=e._fullLayout,a=e._context,i=r._modeBar;if(!a.displayModeBar&&!a.watermark){i&&(i.destroy(),delete r._modeBar);return}if(!Array.isArray(a.modeBarButtonsToRemove))throw new Error(["*modeBarButtonsToRemove* configuration options","must be an array."].join(" "));if(!Array.isArray(a.modeBarButtonsToAdd))throw new Error(["*modeBarButtonsToAdd* configuration options","must be an array."].join(" "));var n=a.modeBarButtons,o;Array.isArray(n)&&n.length?o=pP(n):!a.displayModeBar&&a.watermark?o=[]:o=cP(e),i?i.update(e,o):r._modeBar=oP(e,o)};function cP(t){var e=t._fullLayout,r=t._fullData,a=t._context;function i(M,A){if(typeof A=="string"){if(A.toLowerCase()===M.toLowerCase())return!0}else{var C=A.name,R=A._cat||A.name;if(C===M||R===M.toLowerCase())return!0}return!1}var n=e.modebar.add;typeof n=="string"&&(n=[n]);var o=e.modebar.remove;typeof o=="string"&&(o=[o]);var l=a.modeBarButtonsToAdd.concat(n.filter(function(M){for(var A=0;A<a.modeBarButtonsToRemove.length;A++)if(i(M,a.modeBarButtonsToRemove[A]))return!1;return!0})),s=a.modeBarButtonsToRemove.concat(o.filter(function(M){for(var A=0;A<a.modeBarButtonsToAdd.length;A++)if(i(M,a.modeBarButtonsToAdd[A]))return!1;return!0})),f=e._has("cartesian"),c=e._has("gl3d"),v=e._has("geo"),u=e._has("pie"),h=e._has("funnelarea"),d=e._has("gl2d"),p=e._has("ternary"),m=e._has("mapbox"),y=e._has("polar"),b=e._has("smith"),w=e._has("sankey"),g=uP(e),x=nP(e.hovermode),_=[];function T(M){if(M.length){for(var A=[],C=0;C<M.length;C++){for(var R=M[C],N=rc[R],H=N.name.toLowerCase(),B=(N._cat||N.name).toLowerCase(),X=!1,j=0;j<s.length;j++){var q=s[j].toLowerCase();if(q===H||q===B){X=!0;break}}X||A.push(rc[R])}_.push(A)}}var k=["toImage"];a.showEditInChartStudio?k.push("editInChartStudio"):a.showSendToCloud&&k.push("sendDataToCloud"),T(k);var S=[],L=[],D=[],$=[];(f||d||u||h||p)+v+c+m+y+b>1?(L=["toggleHover"],D=["resetViews"]):v?(S=["zoomInGeo","zoomOutGeo"],L=["hoverClosestGeo"],D=["resetGeo"]):c?(L=["hoverClosest3d"],D=["resetCameraDefault3d","resetCameraLastSave3d"]):m?(S=["zoomInMapbox","zoomOutMapbox"],L=["toggleHover"],D=["resetViewMapbox"]):d?L=["hoverClosestGl2d"]:u?L=["hoverClosestPie"]:w?(L=["hoverClosestCartesian","hoverCompareCartesian"],D=["resetViewSankey"]):L=["toggleHover"],f&&(L=["toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"]),(dP(r)||x)&&(L=[]),(f||d)&&!g&&(S=["zoomIn2d","zoomOut2d","autoScale2d"],D[0]!=="resetViews"&&(D=["resetScale2d"])),c?$=["zoom3d","pan3d","orbitRotation","tableRotation"]:(f||d)&&!g||p?$=["zoom2d","pan2d"]:m||v?$=["pan2d"]:y&&($=["zoom2d"]),vP(r)&&$.push("select2d","lasso2d");var E=[],z=function(M){E.indexOf(M)===-1&&L.indexOf(M)!==-1&&E.push(M)};if(Array.isArray(l)){for(var O=[],I=0;I<l.length;I++){var P=l[I];typeof P=="string"?(P=P.toLowerCase(),lP.indexOf(P)!==-1?(e._has("mapbox")||e._has("cartesian"))&&$.push(P):P==="togglespikelines"?z("toggleSpikelines"):P==="togglehover"?z("toggleHover"):P==="hovercompare"?z("hoverCompareCartesian"):P==="hoverclosest"?(z("hoverClosestCartesian"),z("hoverClosestGeo"),z("hoverClosest3d"),z("hoverClosestGl2d"),z("hoverClosestPie")):P==="v1hovermode"&&(z("toggleHover"),z("hoverClosestCartesian"),z("hoverCompareCartesian"),z("hoverClosestGeo"),z("hoverClosest3d"),z("hoverClosestGl2d"),z("hoverClosestPie"))):O.push(P)}l=O}return T($),T(S.concat(D)),T(E),hP(_,l)}function uP(t){for(var e=iP.list({_fullLayout:t},null,!0),r=0;r<e.length;r++)if(!e[r].fixedrange)return!1;return!0}function vP(t){for(var e=!1,r=0;r<t.length&&!e;r++){var a=t[r];!a._module||!a._module.selectPoints||(Zd.traceIs(a,"scatter-like")?(Hg.hasMarkers(a)||Hg.hasText(a))&&(e=!0):Zd.traceIs(a,"box-violin")?(a.boxpoints==="all"||a.points==="all")&&(e=!0):e=!0)}return e}function dP(t){for(var e=0;e<t.length;e++)if(!Zd.traceIs(t[e],"noHover"))return!1;return!0}function hP(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 pP(t){for(var e=sP([],t),r=0;r<e.length;r++)for(var a=e[r],i=0;i<a.length;i++){var n=a[i];if(typeof n=="string")if(rc[n]!==void 0)e[r][i]=rc[n];else throw new Error(["*modeBarButtons* configuration options","invalid button name"].join(" "))}return e}var zT={moduleType:"component",name:"modebar",layoutAttributes:PT,supplyLayoutDefaults:K$,manage:fP},ui={},mP=Ur.FROM_BL,IT=function(e,r,a){a===void 0&&(a=mP[e.constraintoward||"center"]);var i=[e.r2l(e.range[0]),e.r2l(e.range[1])],n=i[0]+(i[1]-i[0])*a;e.range=e._input.range=[e.l2r(n+(i[0]-n)*r),e.l2r(n+(i[1]-n)*r)],e.setScale()},rn=me,av=cs,Ca=lr.id2name,yP=Za,Og=IT,gP=rp,bP=or.ALMOST_EQUAL,xP=Ur.FROM_BL;ui.handleDefaults=function(t,e,r){var a=r.axIds,i=r.axHasImage,n=e._axisConstraintGroups=[],o=e._axisMatchGroups=[],l,s,f,c,v,u,h,d;for(l=0;l<a.length;l++)c=Ca(a[l]),v=t[c],u=e[c],_P(v,u,{axIds:a,layoutOut:e,hasImage:i[c]});function p(k,S){for(l=0;l<k.length;l++){s=k[l];for(f in s)e[Ca(f)][S]=s}}for(p(o,"_matchGroup"),l=0;l<n.length;l++){s=n[l];for(f in s)if(u=e[Ca(f)],u.fixedrange){for(var m in s){var y=Ca(m);(t[y]||{}).fixedrange===!1&&rn.warn("fixedrange was specified as false for axis "+y+" but was overridden because another axis in its constraint group has fixedrange true"),e[y].fixedrange=!0}break}}for(l=0;l<n.length;){s=n[l];for(f in s){u=e[Ca(f)],u._matchGroup&&Object.keys(u._matchGroup).length===Object.keys(s).length&&(n.splice(l,1),l--);break}l++}p(n,"_constraintGroup");var b=["constrain","range","autorange","rangemode","rangebreaks","categoryorder","categoryarray"],w=!1,g=!1;function x(){d=u[h],h==="rangebreaks"&&(g=u._hasDayOfWeekBreaks)}for(l=0;l<o.length;l++){s=o[l];for(var _=0;_<b.length;_++){h=b[_],d=null;var T;for(f in s)if(c=Ca(f),v=t[c],u=e[c],h in u){if(!u.matches&&(T=u,h in v)){x();break}d===null&&h in v&&x()}if(h==="range"&&d&&v.range&&v.range.length===2&&v.range[0]!==null&&v.range[1]!==null&&(w=!0),h==="autorange"&&d===null&&w&&(d=!1),d===null&&h in T&&(d=T[h]),d!==null)for(f in s)u=e[Ca(f)],u[h]=h==="range"?d.slice():d,h==="rangebreaks"&&(u._hasDayOfWeekBreaks=g,gP(u,e))}}};function _P(t,e,r){var a=r.axIds,i=r.layoutOut,n=r.hasImage,o=i._axisConstraintGroups,l=i._axisMatchGroups,s=e._id,f=s.charAt(0),c=((i._splomAxes||{})[f]||{})[s]||{},v=e._id,u=v.charAt(0)==="x";e._matchGroup=null,e._constraintGroup=null;function h($,E){return rn.coerce(t,e,yP,$,E)}h("constrain",n?"domain":"range"),rn.coerce(t,e,{constraintoward:{valType:"enumerated",values:u?["left","center","right"]:["bottom","middle","top"],dflt:u?"center":"middle"}},"constraintoward");var d=e.type,p,m,y=[];for(p=0;p<a.length;p++)if(m=a[p],m!==v){var b=i[Ca(m)];b.type===d&&y.push(m)}var w=FT(o,v);if(w){var g=[];for(p=0;p<y.length;p++)m=y[p],w[m]||g.push(m);y=g}var x=y.length,_,T;x&&(t.matches||c.matches)&&(_=rn.coerce(t,e,{matches:{valType:"enumerated",values:y,dflt:y.indexOf(c.matches)!==-1?c.matches:void 0}},"matches"));var k=n&&!u?e.anchor:void 0;if(x&&!_&&(t.scaleanchor||k)&&(T=rn.coerce(t,e,{scaleanchor:{valType:"enumerated",values:y.concat([!1])}},"scaleanchor",k)),_){e._matchGroup=iv(l,v,_,1);var S=i[Ca(_)],L=jg(i,e)/jg(i,S);u!==(_.charAt(0)==="x")&&(L=(u?"x":"y")+L),iv(o,v,_,L)}else t.matches&&a.indexOf(t.matches)!==-1&&rn.warn("ignored "+e._name+'.matches: "'+t.matches+'" to avoid an infinite loop');if(T){var D=h("scaleratio");D||(D=e.scaleratio=1),iv(o,v,T,D)}else t.scaleanchor&&a.indexOf(t.scaleanchor)!==-1&&rn.warn("ignored "+e._name+'.scaleanchor: "'+t.scaleanchor+'" to avoid either an infinite loop and possibly inconsistent scaleratios, or because this axis declares a *matches* constraint.')}function jg(t,e){var r=e.domain;return r||(r=t[Ca(e.overlaying)].domain),r[1]-r[0]}function FT(t,e){for(var r=0;r<t.length;r++)if(t[r][e])return t[r];return null}function iv(t,e,r,a){var i,n,o,l,s,f=FT(t,e);f===null?(f={},f[e]=1,s=t.length,t.push(f)):s=t.indexOf(f);var c=Object.keys(f);for(i=0;i<t.length;i++)if(o=t[i],i!==s&&o[r]){var v=o[r];for(n=0;n<c.length;n++)l=c[n],o[l]=nv(v,nv(a,f[l]));t.splice(s,1);return}if(a!==1)for(n=0;n<c.length;n++){var u=c[n];f[u]=nv(a,f[u])}f[r]=1}function nv(t,e){var r="",a="",i,n;typeof t=="string"&&(r=t.match(/^[xy]*/)[0],i=r.length,t=+t.substr(i)),typeof e=="string"&&(a=e.match(/^[xy]*/)[0],n=a.length,e=+e.substr(n));var o=t*e;return!i&&!n?o:!i||!n||r.charAt(0)===a.charAt(0)?r+a+t*e:i===n?o:(i>n?r.substr(n):a.substr(i))+o}function wP(t,e){for(var r=e._size,a=r.h/r.w,i={},n=Object.keys(t),o=0;o<n.length;o++){var l=n[o],s=t[l];if(typeof s=="string"){var f=s.match(/^[xy]*/)[0],c=f.length;s=+s.substr(c);for(var v=f.charAt(0)==="y"?a:1/a,u=0;u<c;u++)s*=v}i[l]=s}return i}ui.enforce=function(e){var r=e._fullLayout,a=r._axisConstraintGroups||[],i,n,o,l,s,f,c,v;for(i=0;i<a.length;i++){o=wP(a[i],r);var u=Object.keys(o),h=1/0,d=0,p=1/0,m={},y={},b=!1;for(n=0;n<u.length;n++)l=u[n],y[l]=s=r[Ca(l)],s._inputDomain?s.domain=s._inputDomain.slice():s._inputDomain=s.domain.slice(),s._inputRange||(s._inputRange=s.range.slice()),s.setScale(),m[l]=f=Math.abs(s._m)/o[l],h=Math.min(h,f),(s.constrain==="domain"||!s._constraintShrinkable)&&(p=Math.min(p,f)),delete s._constraintShrinkable,d=Math.max(d,f),s.constrain==="domain"&&(b=!0);if(!(h>bP*d&&!b)){for(n=0;n<u.length;n++)if(l=u[n],f=m[l],s=y[l],c=s.constrain,f!==p||c==="domain")if(v=f/p,c==="range")Og(s,v);else{var w=s._inputDomain,g=(s.domain[1]-s.domain[0])/(w[1]-w[0]),x=(s.r2l(s.range[1])-s.r2l(s.range[0]))/(s.r2l(s._inputRange[1])-s.r2l(s._inputRange[0]));if(v/=g,v*x<1){s.domain=s._input.domain=w.slice(),Og(s,v);continue}if(x<1&&(s.range=s._input.range=s._inputRange.slice(),v*=x),s.autorange){var _=s.r2l(s.range[0]),T=s.r2l(s.range[1]),k=(_+T)/2,S=k,L=k,D=Math.abs(T-k),$=k-D*v*1.0001,E=k+D*v*1.0001,z=av.makePadFn(r,s,0),O=av.makePadFn(r,s,1);Bg(s,v);var I=Math.abs(s._m),P=av.concatExtremes(e,s),M=P.min,A=P.max,C,R;for(R=0;R<M.length;R++)C=M[R].val-z(M[R])/I,C>$&&C<S&&(S=C);for(R=0;R<A.length;R++)C=A[R].val+O(A[R])/I,C<E&&C>L&&(L=C);var N=(L-S)/(2*D);v/=N,S=s.l2r(S),L=s.l2r(L),s.range=s._input.range=_<T?[S,L]:[L,S]}Bg(s,v)}}}};ui.getAxisGroup=function(e,r){for(var a=e._axisMatchGroups,i=0;i<a.length;i++){var n=a[i];if(n[r])return"g"+i}return r};ui.clean=function(e,r){if(r._inputDomain){for(var a=!1,i=r._id,n=e._fullLayout._axisConstraintGroups,o=0;o<n.length;o++)if(n[o][i]){a=!0;break}(!a||r.constrain!=="domain")&&(r._input.domain=r.domain=r._inputDomain,delete r._inputDomain)}};function Bg(t,e){var r=t._inputDomain,a=xP[t.constraintoward],i=r[0]+(r[1]-r[0])*a;t.domain=t._input.domain=[i+(r[0]-i)/e,i+(r[1]-i)/e],t.setScale()}(function(t){var e=gt,r=ot,a=cr,i=me,n=br,o=hp,l=ht,s=$t,f=Hc,c=zT,v=Bt,u=Ur,h=ui,d=h.enforce,p=h.clean,m=cs.doAutoRange,y="start",b="middle",w="end";t.layoutStyles=function(M){return i.syncOrAsync([a.doAutoMargin,x],M)};function g(M,A,C){for(var R=0;R<C.length;R++){var N=C[R][0],H=C[R][1];if(!(N[0]>=M[1]||N[1]<=M[0])&&H[0]<A[1]&&H[1]>A[0])return!0}return!1}function x(M){var A=M._fullLayout,C=A._size,R=C.p,N=v.list(M,"",!0),H,B,X,j,q,U;if(A._paperdiv.style({width:M._context.responsive&&A.autosize&&!M._context._hasZeroWidth&&!M.layout.width?"100%":A.width+"px",height:M._context.responsive&&A.autosize&&!M._context._hasZeroHeight&&!M.layout.height?"100%":A.height+"px"}).selectAll(".main-svg").call(s.setSize,A.width,A.height),M._context.setBackground(M,A.paper_bgcolor),t.drawMainTitle(M),c.manage(M),!A._has("cartesian"))return a.previousPromises(M);function Z(He,Ue,Je){var F=He._lw/2;if(He._id.charAt(0)==="x"){if(Ue){if(Je==="top")return Ue._offset-R-F}else return C.t+C.h*(1-(He.position||0))+F%1;return Ue._offset+Ue._length+R+F}if(Ue){if(Je==="right")return Ue._offset+Ue._length+R+F}else return C.l+C.w*(He.position||0)+F%1;return Ue._offset-R-F}for(H=0;H<N.length;H++){j=N[H];var K=j._anchorAxis;j._linepositions={},j._lw=s.crispRound(M,j.linewidth,1),j._mainLinePosition=Z(j,K,j.side),j._mainMirrorPosition=j.mirror&&K?Z(j,K,u.OPPOSITE_SIDE[j.side]):null}var ee=[],le=[],ye=[],se=l.opacity(A.paper_bgcolor)===1&&l.opacity(A.plot_bgcolor)===1&&A.paper_bgcolor===A.plot_bgcolor;for(B in A._plots)if(X=A._plots[B],X.mainplot)X.bg&&X.bg.remove(),X.bg=void 0;else{var G=X.xaxis.domain,J=X.yaxis.domain,oe=X.plotgroup;if(g(G,J,ye)){var fe=oe.node(),pe=X.bg=i.ensureSingle(oe,"rect","bg");fe.insertBefore(pe.node(),fe.childNodes[0]),le.push(B)}else oe.select("rect.bg").remove(),ye.push([G,J]),se||(ee.push(B),le.push(B))}var ge=A._bgLayer.selectAll(".bg").data(ee);for(ge.enter().append("rect").classed("bg",!0),ge.exit().remove(),ge.each(function(He){A._plots[He].bg=e.select(this)}),H=0;H<le.length;H++)X=A._plots[le[H]],q=X.xaxis,U=X.yaxis,X.bg&&q._offset!==void 0&&U._offset!==void 0&&X.bg.call(s.setRect,q._offset-R,U._offset-R,q._length+2*R,U._length+2*R).call(l.fill,A.plot_bgcolor).style("stroke-width",0);if(!A._hasOnlyLargeSploms)for(B in A._plots){X=A._plots[B],q=X.xaxis,U=X.yaxis;var ue=X.clipId="clip"+A._uid+B+"plot",Ce=i.ensureSingleById(A._clips,"clipPath",ue,function(He){He.classed("plotclip",!0).append("rect")});X.clipRect=Ce.select("rect").attr({width:q._length,height:U._length}),s.setTranslate(X.plot,q._offset,U._offset);var ce,De;X._hasClipOnAxisFalse?(ce=null,De=ue):(ce=ue,De=null),s.setClipUrl(X.plot,ce,M),X.layerClipId=De}var Ee,$e,te,Te,ne,de,he,Ae,Me,we,be,Ve,Fe;function Oe(He){return"M"+Ee+","+He+"H"+$e}function Ge(He){return"M"+q._offset+","+He+"h"+q._length}function lt(He){return"M"+He+","+Ae+"V"+he}function xe(He){return U._shift!==void 0&&(He+=U._shift),"M"+He+","+U._offset+"v"+U._length}function Ze(He,Ue,Je){if(!He.showline||B!==He._mainSubplot)return"";if(!He._anchorAxis)return Je(He._mainLinePosition);var F=Ue(He._mainLinePosition);return He.mirror&&(F+=Ue(He._mainMirrorPosition)),F}for(B in A._plots){X=A._plots[B],q=X.xaxis,U=X.yaxis;var Xe="M0,0";_(q,B)&&(ne=k(q,"left",U,N),Ee=q._offset-(ne?R+ne:0),de=k(q,"right",U,N),$e=q._offset+q._length+(de?R+de:0),te=Z(q,U,"bottom"),Te=Z(q,U,"top"),Fe=!q._anchorAxis||B!==q._mainSubplot,Fe&&(q.mirror==="allticks"||q.mirror==="all")&&(q._linepositions[B]=[te,Te]),Xe=Ze(q,Oe,Ge),Fe&&q.showline&&(q.mirror==="all"||q.mirror==="allticks")&&(Xe+=Oe(te)+Oe(Te)),X.xlines.style("stroke-width",q._lw+"px").call(l.stroke,q.showline?q.linecolor:"rgba(0,0,0,0)")),X.xlines.attr("d",Xe);var Ye="M0,0";_(U,B)&&(be=k(U,"bottom",q,N),he=U._offset+U._length+(be?R:0),Ve=k(U,"top",q,N),Ae=U._offset-(Ve?R:0),Me=Z(U,q,"left"),we=Z(U,q,"right"),Fe=!U._anchorAxis||B!==U._mainSubplot,Fe&&(U.mirror==="allticks"||U.mirror==="all")&&(U._linepositions[B]=[Me,we]),Ye=Ze(U,lt,xe),Fe&&U.showline&&(U.mirror==="all"||U.mirror==="allticks")&&(Ye+=lt(Me)+lt(we)),X.ylines.style("stroke-width",U._lw+"px").call(l.stroke,U.showline?U.linecolor:"rgba(0,0,0,0)")),X.ylines.attr("d",Ye)}return v.makeClipPaths(M),a.previousPromises(M)}function _(M,A){return(M.ticks||M.showline)&&(A===M._mainSubplot||M.mirror==="all"||M.mirror==="allticks")}function T(M,A,C){if(!C.showline||!C._lw)return!1;if(C.mirror==="all"||C.mirror==="allticks")return!0;var R=C._anchorAxis;if(!R)return!1;var N=u.FROM_BL[A];return C.side===A?R.domain[N]===M.domain[N]:C.mirror&&R.domain[1-N]===M.domain[1-N]}function k(M,A,C,R){if(T(M,A,C))return C._lw;for(var N=0;N<R.length;N++){var H=R[N];if(H._mainAxis===C._mainAxis&&T(M,A,H))return H._lw}return 0}t.drawMainTitle=function(M){var A=M._fullLayout.title,C=M._fullLayout,R=I(C),N=P(C),H=z(C,N),B=E(C,R);if(f.draw(M,"gtitle",{propContainer:C,propName:"title.text",placeholder:C._dfltTitle.plot,attributes:{x:B,y:H,"text-anchor":R,dy:N}}),A.text&&A.automargin){var X=e.selectAll(".gtitle"),j=s.bBox(X.node()).height,q=D(M,A,j);if(q>0){$(M,H,q,j),X.attr({x:B,y:H,"text-anchor":R,dy:O(A.yanchor)}).call(n.positionText,B,H);var U=(A.text.match(n.BR_TAG_ALL)||[]).length;if(U){var Z=u.LINE_SPACING*U+u.MID_SHIFT;A.y===0&&(Z=-Z),X.selectAll(".line").each(function(){var K=+this.getAttribute("dy").slice(0,-2)-Z+"em";this.setAttribute("dy",K)})}}}};function S(M,A,C,R,N){var H=A.yref==="paper"?M._fullLayout._size.h:M._fullLayout.height,B=i.isTopAnchor(A)?R:R-N,X=C==="b"?H-B:B;return i.isTopAnchor(A)&&C==="t"||i.isBottomAnchor(A)&&C==="b"?!1:X<N}function L(M,A,C,R,N){var H=0;return C==="middle"&&(H+=N/2),M==="t"?(C==="top"&&(H+=N),H+=R-A*R):(C==="bottom"&&(H+=N),H+=A*R),H}function D(M,A,C){var R=A.y,N=A.yanchor,H=R>.5?"t":"b",B=M._fullLayout.margin[H],X=0;return A.yref==="paper"?X=C+A.pad.t+A.pad.b:A.yref==="container"&&(X=L(H,R,N,M._fullLayout.height,C)+A.pad.t+A.pad.b),X>B?X:0}function $(M,A,C,R){var N="title.automargin",H=M._fullLayout.title,B=H.y>.5?"t":"b",X={x:H.x,y:H.y,t:0,b:0},j={};H.yref==="paper"&&S(M,H,B,A,R)?X[B]=C:H.yref==="container"&&(j[B]=C,M._fullLayout._reservedMargin[N]=j),a.allowAutoMargin(M,N),a.autoMargin(M,N,X)}function E(M,A){var C=M.title,R=M._size,N=0;switch(A===y?N=C.pad.l:A===w&&(N=-C.pad.r),C.xref){case"paper":return R.l+R.w*C.x+N;case"container":default:return M.width*C.x+N}}function z(M,A){var C=M.title,R=M._size,N=0;if(A==="0em"||!A?N=-C.pad.b:A===u.CAP_SHIFT+"em"&&(N=C.pad.t),C.y==="auto")return R.t/2;switch(C.yref){case"paper":return R.t+R.h-R.h*C.y+N;case"container":default:return M.height-M.height*C.y+N}}function O(M){return M==="top"?u.CAP_SHIFT+.3+"em":M==="bottom"?"-0.3em":u.MID_SHIFT+"em"}function I(M){var A=M.title,C=b;return i.isRightAnchor(A)?C=w:i.isLeftAnchor(A)&&(C=y),C}function P(M){var A=M.title,C="0em";return i.isTopAnchor(A)?C=u.CAP_SHIFT+"em":i.isMiddleAnchor(A)&&(C=u.MID_SHIFT+"em"),C}t.doTraceStyle=function(M){var A=M.calcdata,C=[],R;for(R=0;R<A.length;R++){var N=A[R],H=N[0]||{},B=H.trace||{},X=B._module||{},j=X.arraysToCalcdata;j&&j(N,B);var q=X.editStyle;q&&C.push({fn:q,cd0:H})}if(C.length){for(R=0;R<C.length;R++){var U=C[R];U.fn(M,U.cd0)}o(M),t.redrawReglTraces(M)}return a.style(M),r.getComponentMethod("legend","draw")(M),a.previousPromises(M)},t.doColorBars=function(M){return r.getComponentMethod("colorbar","draw")(M),a.previousPromises(M)},t.layoutReplot=function(M){var A=M.layout;return M.layout=void 0,r.call("_doPlot",M,"",A)},t.doLegend=function(M){return r.getComponentMethod("legend","draw")(M),a.previousPromises(M)},t.doTicksRelayout=function(M){return v.draw(M,"redraw"),M._fullLayout._hasOnlyLargeSploms&&(r.subplotsRegistry.splom.updateGrid(M),o(M),t.redrawReglTraces(M)),t.drawMainTitle(M),a.previousPromises(M)},t.doModeBar=function(M){var A=M._fullLayout;c.manage(M);for(var C=0;C<A._basePlotModules.length;C++){var R=A._basePlotModules[C].updateFx;R&&R(M)}return a.previousPromises(M)},t.doCamera=function(M){for(var A=M._fullLayout,C=A._subplots.gl3d,R=0;R<C.length;R++){var N=A[C[R]],H=N._scene;H.setViewport(N)}},t.drawData=function(M){var A=M._fullLayout;o(M);for(var C=A._basePlotModules,R=0;R<C.length;R++)C[R].plot(M);return t.redrawReglTraces(M),a.style(M),r.getComponentMethod("selections","draw")(M),r.getComponentMethod("shapes","draw")(M),r.getComponentMethod("annotations","draw")(M),r.getComponentMethod("images","draw")(M),A._replotting=!1,a.previousPromises(M)},t.redrawReglTraces=function(M){var A=M._fullLayout;if(A._has("regl")){var C=M._fullData,R=[],N=[],H,B;for(A._hasOnlyLargeSploms&&A._splomGrid.draw(),H=0;H<C.length;H++){var X=C[H];X.visible===!0&&X._length!==0&&(X.type==="splom"?A._splomScenes[X.uid].draw():X.type==="scattergl"?i.pushUnique(R,X.xaxis+X.yaxis):X.type==="scatterpolargl"&&i.pushUnique(N,X.subplot))}for(H=0;H<R.length;H++)B=A._plots[R[H]],B._scene&&B._scene.draw();for(H=0;H<N.length;H++)B=A[N[H]]._subplot,B._scene&&B._scene.draw()}},t.doAutoRangeAndConstraints=function(M){for(var A=v.list(M,"",!0),C,R={},N=0;N<A.length;N++)if(C=A[N],!R[C._id]){R[C._id]=1,p(M,C),m(M,C);var H=C._matchGroup;if(H)for(var B in H){var X=v.getFromId(M,B);m(M,X,C.range),R[B]=1}}d(M)},t.finalDraw=function(M){r.getComponentMethod("rangeslider","draw")(M),r.getComponentMethod("rangeselector","draw")(M)},t.drawMarginPushers=function(M){r.getComponentMethod("legend","draw")(M),r.getComponentMethod("rangeselector","draw")(M),r.getComponentMethod("sliders","draw")(M),r.getComponentMethod("updatemenus","draw")(M),r.getComponentMethod("colorbar","draw")(M)}})(Xc);var TP=Bi.readPaths,kP=_p,NT=Mn.clearOutlineControllers,ov=ht,HT=$t,AP=Ht.arrayEditor,OT=Gi,MP=OT.getPathString,jT={draw:Qc,drawOne:BT,activateLastSelection:CP};function Qc(t){var e=t._fullLayout;NT(t),e._selectionLayer.selectAll("path").remove();for(var r in e._plots){var a=e._plots[r].selectionLayer;a&&a.selectAll("path").remove()}for(var i=0;i<e.selections.length;i++)BT(t,i)}function Jc(t){return t._context.editSelection}function BT(t,e){t._fullLayout._paperdiv.selectAll('.selectionlayer [data-index="'+e+'"]').remove();var r=OT.makeSelectionsOptionsAndPlotinfo(t,e),a=r.options,i=r.plotinfo;if(!a._input)return;n(t._fullLayout._selectionLayer);function n(o){var l=MP(t,a),s={"data-index":e,"fill-rule":"evenodd",d:l},f=a.opacity,c="rgba(0,0,0,0)",v=a.line.color||ov.contrast(t._fullLayout.plot_bgcolor),u=a.line.width,h=a.line.dash;u||(u=5,h="solid");var d=Jc(t)&&t._fullLayout._activeSelectionIndex===e;d&&(c=t._fullLayout.activeselection.fillcolor,f=t._fullLayout.activeselection.opacity);for(var p=[],m=1;m>=0;m--){var y=o.append("path").attr(s).style("opacity",m?.1:f).call(ov.stroke,v).call(ov.fill,c).call(HT.dashLine,m?"solid":h,m?4+u:u);if(SP(y,t,a),d){var b=AP(t.layout,"selections",a);y.style({cursor:"move"});var w={element:y.node(),plotinfo:i,gd:t,editHelpers:b,isActiveSelection:!0},g=TP(l,t);kP(g,y,w)}else y.style("pointer-events",m?"all":"none");p[m]=y}var x=p[0],_=p[1];_.node().addEventListener("click",function(){return LP(t,x)})}}function SP(t,e,r){var a=r.xref+r.yref;HT.setClipUrl(t,"clip"+e._fullLayout._uid+a,e)}function LP(t,e){if(Jc(t)){var r=e.node(),a=+r.getAttribute("data-index");if(a>=0){if(a===t._fullLayout._activeSelectionIndex){Kd(t);return}t._fullLayout._activeSelectionIndex=a,t._fullLayout._deactivateSelection=Kd,Qc(t)}}}function CP(t){if(Jc(t)){var e=t._fullLayout.selections.length-1;t._fullLayout._activeSelectionIndex=e,t._fullLayout._deactivateSelection=Kd,Qc(t)}}function Kd(t){if(Jc(t)){var e=t._fullLayout._activeSelectionIndex;e>=0&&(NT(t),delete t._fullLayout._activeSelectionIndex,Qc(t))}}var GT={exports:{}},lv=Sc.dot,Ys=or.BADNUM,ac=GT.exports={};ac.tester=function(e){var r=e.slice(),a=r[0][0],i=a,n=r[0][1],o=n,l;for((r[r.length-1][0]!==r[0][0]||r[r.length-1][1]!==r[0][1])&&r.push(r[0]),l=1;l<r.length;l++)a=Math.min(a,r[l][0]),i=Math.max(i,r[l][0]),n=Math.min(n,r[l][1]),o=Math.max(o,r[l][1]);var s=!1,f;r.length===5&&(r[0][0]===r[1][0]?r[2][0]===r[3][0]&&r[0][1]===r[3][1]&&r[1][1]===r[2][1]&&(s=!0,f=function(d){return d[0]===r[0][0]}):r[0][1]===r[1][1]&&r[2][1]===r[3][1]&&r[0][0]===r[3][0]&&r[1][0]===r[2][0]&&(s=!0,f=function(d){return d[1]===r[0][1]}));function c(d,p){var m=d[0],y=d[1];return!(m===Ys||m<a||m>i||y===Ys||y<n||y>o||p&&f(d))}function v(d,p){var m=d[0],y=d[1];if(m===Ys||m<a||m>i||y===Ys||y<n||y>o)return!1;var b=r.length,w=r[0][0],g=r[0][1],x=0,_,T,k,S,L;for(_=1;_<b;_++)if(T=w,k=g,w=r[_][0],g=r[_][1],S=Math.min(T,w),!(m<S||m>Math.max(T,w)||y>Math.max(k,g)))if(y<Math.min(k,g))m!==S&&x++;else{if(w===T?L=y:L=k+(m-T)*(g-k)/(w-T),y===L)return!(_===1&&p);y<=L&&m!==S&&x++}return x%2===1}var u=!0,h=r[0];for(l=1;l<r.length;l++)if(h[0]!==r[l][0]||h[1]!==r[l][1]){u=!1;break}return{xmin:a,xmax:i,ymin:n,ymax:o,pts:r,contains:s?c:v,isRect:s,degenerate:u}};ac.isSegmentBent=function(e,r,a,i){var n=e[r],o=[e[a][0]-n[0],e[a][1]-n[1]],l=lv(o,o),s=Math.sqrt(l),f=[-o[1]/s,o[0]/s],c,v,u;for(c=r+1;c<a;c++)if(v=[e[c][0]-n[0],e[c][1]-n[1]],u=lv(v,o),u<0||u>l||Math.abs(lv(v,f))>i)return!0;return!1};ac.filter=function(e,r){var a=[e[0]],i=0,n=0;function o(s){e.push(s);var f=a.length,c=i;a.splice(n+1);for(var v=c+1;v<e.length;v++)(v===e.length-1||ac.isSegmentBent(e,c,v+1,r))&&(a.push(e[v]),a.length<f-2&&(i=v,n=a.length-1),c=v)}if(e.length>1){var l=e.pop();o(l)}return{addPt:o,raw:e,filtered:a}};var UT=GT.exports,DP={BENDPX:1.5,MINSELECT:12,SELECTDELAY:100,SELECTID:"-select"},Gg=vM,$P=dM,Bl=ot,PP=$t.dashStyle,al=ht,RP=Ia,EP=xa.makeEventData,us=Dn,zP=us.freeMode,IP=us.rectMode,Gl=us.drawMode,Cp=us.openMode,Dp=us.selectMode,Ug=Gi,Vg=Wc,VT=_p,XT=Mn.clearOutline,YT=Bi,sv=YT.handleEllipse,FP=YT.readPaths,NP=gp.newShapes,HP=vT,OP=jT.activateLastSelection,Cf=me,jP=Cf.sorterAsc,WT=UT,il=Rc,ha=lr.getFromId,BP=hp,GP=Xc.redrawReglTraces,Df=DP,Ba=Df.MINSELECT,UP=WT.filter,$p=WT.tester,Pp=yp,Xg=Pp.p2r,VP=Pp.axValue,XP=Pp.getTransform;function Rp(t){return t.subplot!==void 0}function YP(t,e,r,a,i){var n=!Rp(a),o=zP(i),l=IP(i),s=Cp(i),f=Gl(i),c=Dp(i),v=i==="drawline",u=i==="drawcircle",h=v||u,d=a.gd,p=d._fullLayout,m=c&&p.newselection.mode==="immediate"&&n,y=p._zoomlayer,b=a.element.getBoundingClientRect(),w=a.plotinfo,g=XP(w),x=e-b.left,_=r-b.top;p._calcInverseTransform(d);var T=Cf.apply3DTransform(p._invTransform)(x,_);x=T[0],_=T[1];var k=p._invScaleX,S=p._invScaleY,L=x,D=_,$="M"+x+","+_,E=a.xaxes[0],z=a.yaxes[0],O=E._length,I=z._length,P=t.altKey&&!(Gl(i)&&s),M,A,C,R,N,H,B;ZT(t,d,a),o&&(M=UP([[x,_]],Df.BENDPX));var X=y.selectAll("path.select-outline-"+w.id).data([1]),j=f?p.newshape:p.newselection;f&&(a.hasText=j.label.text||j.label.texttemplate);var q=f&&!s?j.fillcolor:"rgba(0,0,0,0)",U=j.line.color||(n?al.contrast(d._fullLayout.plot_bgcolor):"#7f7f7f");X.enter().append("path").attr("class","select-outline select-outline-"+w.id).style({opacity:f?j.opacity/2:1,"stroke-dasharray":PP(j.line.dash,j.line.width),"stroke-width":j.line.width+"px","shape-rendering":"crispEdges"}).call(al.stroke,U).call(al.fill,q).attr("fill-rule","evenodd").classed("cursor-move",!!f).attr("transform",g).attr("d",$+"Z");var Z=y.append("path").attr("class","zoombox-corners").style({fill:al.background,stroke:al.defaultLine,"stroke-width":1}).attr("transform",g).attr("d","M0,0Z");if(f&&a.hasText){var K=y.select(".label-temp");K.empty()&&(K=y.append("g").classed("label-temp",!0).classed("select-outline",!0).style({opacity:.8}))}var ee=p._uid+Df.SELECTID,le=[],ye=eu(d,a.xaxes,a.yaxes,a.subplot);m&&!t.shiftKey&&(a._clearSubplotSelections=function(){if(n){var G=E._id,J=z._id;t2(d,G,J,ye);for(var oe=(d.layout||{}).selections||[],fe=[],pe=!1,ge=0;ge<oe.length;ge++){var ue=p.selections[ge];ue.xref!==G||ue.yref!==J?fe.push(oe[ge]):pe=!0}pe&&(d._fullLayout._noEmitSelectedAtStart=!0,Bl.call("_guiRelayout",d,{selections:fe}))}});var se=lR(a);a.moveFn=function(G,J){a._clearSubplotSelections&&(a._clearSubplotSelections(),a._clearSubplotSelections=void 0),L=Math.max(0,Math.min(O,k*G+x)),D=Math.max(0,Math.min(I,S*J+_));var oe=Math.abs(L-x),fe=Math.abs(D-_);if(l){var pe,ge,ue;if(c){var Ce=p.selectdirection;switch(Ce==="any"?fe<Math.min(oe*.6,Ba)?pe="h":oe<Math.min(fe*.6,Ba)?pe="v":pe="d":pe=Ce,pe){case"h":ge=u?I/2:0,ue=I;break;case"v":ge=u?O/2:0,ue=O;break}}if(f)switch(p.newshape.drawdirection){case"vertical":pe="h",ge=u?I/2:0,ue=I;break;case"horizontal":pe="v",ge=u?O/2:0,ue=O;break;case"ortho":oe<fe?(pe="h",ge=_,ue=D):(pe="v",ge=x,ue=L);break;default:pe="d"}pe==="h"?(R=h?sv(u,[L,ge],[L,ue]):[[x,ge],[x,ue],[L,ue],[L,ge]],R.xmin=h?L:Math.min(x,L),R.xmax=h?L:Math.max(x,L),R.ymin=Math.min(ge,ue),R.ymax=Math.max(ge,ue),Z.attr("d","M"+R.xmin+","+(_-Ba)+"h-4v"+2*Ba+"h4ZM"+(R.xmax-1)+","+(_-Ba)+"h4v"+2*Ba+"h-4Z")):pe==="v"?(R=h?sv(u,[ge,D],[ue,D]):[[ge,_],[ge,D],[ue,D],[ue,_]],R.xmin=Math.min(ge,ue),R.xmax=Math.max(ge,ue),R.ymin=h?D:Math.min(_,D),R.ymax=h?D:Math.max(_,D),Z.attr("d","M"+(x-Ba)+","+R.ymin+"v-4h"+2*Ba+"v4ZM"+(x-Ba)+","+(R.ymax-1)+"v4h"+2*Ba+"v-4Z")):pe==="d"&&(R=h?sv(u,[x,_],[L,D]):[[x,_],[x,D],[L,D],[L,_]],R.xmin=Math.min(x,L),R.xmax=Math.max(x,L),R.ymin=Math.min(_,D),R.ymax=Math.max(_,D),Z.attr("d","M0,0Z"))}else o&&(M.addPt([L,D]),R=M.filtered);if(a.selectionDefs&&a.selectionDefs.length?(C=KT(a.mergedPolygons,R,P),R.subtract=P,A=Ep(a.selectionDefs.concat([R]))):(C=[R],A=$p(R)),VT(JT(C,s),X,a),c){var ce=Qd(d,!1),De=ce.eventData?ce.eventData.points.slice():[];ce=Qd(d,!1,A,ye,a),A=ce.selectionTesters,B=ce.eventData;var Ee;M?Ee=M.filtered:Ee=r2(C),il.throttle(ee,Df.SELECTDELAY,function(){le=e2(A,ye);for(var $e=le.slice(),te=0;te<De.length;te++){for(var Te=De[te],ne=!1,de=0;de<$e.length;de++)if($e[de].curveNumber===Te.curveNumber&&$e[de].pointNumber===Te.pointNumber){ne=!0;break}ne||$e.push(Te)}$e.length&&(B||(B={}),B.points=$e),se(B,Ee),sR(d,B)})}},a.clickFn=function(G,J){if(Z.remove(),d._fullLayout._activeShapeIndex>=0){d._fullLayout._deactivateShape(d);return}if(!f){var oe=p.clickmode;il.done(ee).then(function(){if(il.clear(ee),G===2){for(X.remove(),N=0;N<ye.length;N++)H=ye[N],H._module.selectPoints(H,!1);if(Vl(d,ye),Ul(a),Ip(d),ye.length){var fe=ye[0].xaxis,pe=ye[0].yaxis;if(fe&&pe){for(var ge=[],ue=d._fullLayout.selections,Ce=0;Ce<ue.length;Ce++){var ce=ue[Ce];ce&&(ce.xref!==fe._id||ce.yref!==pe._id)&&ge.push(ce)}ge.length<ue.length&&(d._fullLayout._noEmitSelectedAtStart=!0,Bl.call("_guiRelayout",d,{selections:ge}))}}}else oe.indexOf("select")>-1&&qT(J,d,a.xaxes,a.yaxes,a.subplot,a,X),oe==="event"&&Xl(d,void 0);RP.click(d,J,w.id)}).catch(Cf.error)}},a.doneFn=function(){Z.remove(),il.done(ee).then(function(){il.clear(ee),!m&&R&&a.selectionDefs&&(R.subtract=P,a.selectionDefs.push(R),a.mergedPolygons.length=0,[].push.apply(a.mergedPolygons,C)),(m||f)&&Ul(a,m),a.doneFnCompleted&&a.doneFnCompleted(le),c&&Xl(d,B)}).catch(Cf.error)}}function qT(t,e,r,a,i,n,o){var l=e._hoverdata,s=e._fullLayout,f=s.clickmode,c=f.indexOf("event")>-1,v=[],u,h,d,p,m,y,b,w,g,x;if(QP(l)){ZT(t,e,n),u=eu(e,r,a,i);var _=JP(l,u),T=_.pointNumbers.length>0;if(T?eR(u,_):tR(u)&&(b=Wg(_))){for(o&&o.remove(),x=0;x<u.length;x++)h=u[x],h._module.selectPoints(h,!1);Vl(e,u),Ul(n),c&&Ip(e)}else{w=t.shiftKey&&(b!==void 0?b:Wg(_)),d=WP(_.pointNumber,_.searchInfo,w);var k=n.selectionDefs.concat([d]);for(p=Ep(k),x=0;x<u.length;x++)if(m=u[x]._module.selectPoints(u[x],p),y=QT(m,u[x]),v.length)for(var S=0;S<y.length;S++)v.push(y[S]);else v=y;if(g={points:v},Vl(e,u,g),d&&n&&n.selectionDefs.push(d),o){var L=n.mergedPolygons,D=Cp(n.dragmode);VT(JT(L,D),o,n)}c&&Xl(e,g)}}}function WP(t,e,r){return{pointNumber:t,searchInfo:e,subtract:!!r}}function fv(t){return"pointNumber"in t&&"searchInfo"in t}function qP(t){return{xmin:0,xmax:0,ymin:0,ymax:0,pts:[],contains:function(e,r,a,i){var n=t.searchInfo.cd[0].trace._expandedIndex,o=i.cd[0].trace._expandedIndex;return o===n&&a===t.pointNumber},isRect:!1,degenerate:!1,subtract:!!t.subtract}}function Ep(t){if(!t.length)return;for(var e=[],r=fv(t[0])?0:t[0][0][0],a=r,i=fv(t[0])?0:t[0][0][1],n=i,o=0;o<t.length;o++)if(fv(t[o]))e.push(qP(t[o]));else{var l=$p(t[o]);l.subtract=!!t[o].subtract,e.push(l),r=Math.min(r,l.xmin),a=Math.max(a,l.xmax),i=Math.min(i,l.ymin),n=Math.max(n,l.ymax)}function s(f,c,v,u){for(var h=!1,d=0;d<e.length;d++)e[d].contains(f,c,v,u)&&(h=!e[d].subtract);return h}return{xmin:r,xmax:a,ymin:i,ymax:n,pts:[],contains:s,isRect:!1,degenerate:!1}}function ZT(t,e,r){var a=e._fullLayout,i=r.plotinfo,n=r.dragmode,o=a._lastSelectedSubplot&&a._lastSelectedSubplot===i.id,l=(t.shiftKey||t.altKey)&&!(Gl(n)&&Cp(n));o&&l&&i.selection&&i.selection.selectionDefs&&!r.selectionDefs?(r.selectionDefs=i.selection.selectionDefs,r.mergedPolygons=i.selection.mergedPolygons):(!l||!i.selection)&&Ul(r),o||(XT(e),a._lastSelectedSubplot=i.id)}function ZP(t){return t._fullLayout._activeShapeIndex>=0}function KP(t){return t._fullLayout._activeSelectionIndex>=0}function Ul(t,e){var r=t.dragmode,a=t.plotinfo,i=t.gd;ZP(i)&&i._fullLayout._deactivateShape(i),KP(i)&&i._fullLayout._deactivateSelection(i);var n=i._fullLayout,o=n._zoomlayer,l=Gl(r),s=Dp(r);if(l||s){var f=o.selectAll(".select-outline-"+a.id);if(f&&i._fullLayout._outlining){var c;l&&(c=NP(f,t)),c&&Bl.call("_guiRelayout",i,{shapes:c});var v;s&&!Rp(t)&&(v=HP(f,t)),v&&(i._fullLayout._noEmitSelectedAtStart=!0,Bl.call("_guiRelayout",i,{selections:v}).then(function(){e&&OP(i)})),i._fullLayout._outlining=!1}}a.selection={},a.selection.selectionDefs=t.selectionDefs=[],a.selection.mergedPolygons=t.mergedPolygons=[]}function Yg(t){return t._id}function eu(t,e,r,a){if(!t.calcdata)return[];var i=[],n=e.map(Yg),o=r.map(Yg),l,s,f;for(f=0;f<t.calcdata.length;f++)if(l=t.calcdata[f],s=l[0].trace,!(s.visible!==!0||!s._module||!s._module.selectPoints))if(Rp({subplot:a})&&(s.subplot===a||s.geo===a))i.push(Ws(s._module,l,e[0],r[0]));else if(s.type==="splom"){if(s._xaxes[n[0]]&&s._yaxes[o[0]]){var c=Ws(s._module,l,e[0],r[0]);c.scene=t._fullLayout._splomScenes[s.uid],i.push(c)}}else if(s.type==="sankey"){var v=Ws(s._module,l,e[0],r[0]);i.push(v)}else{if(n.indexOf(s.xaxis)===-1||o.indexOf(s.yaxis)===-1)continue;i.push(Ws(s._module,l,ha(t,s.xaxis),ha(t,s.yaxis)))}return i}function Ws(t,e,r,a){return{_module:t,cd:e,xaxis:r,yaxis:a}}function QP(t){return t&&Array.isArray(t)&&t[0].hoverOnBox!==!0}function JP(t,e){var r=t[0],a=-1,i=[],n,o;for(o=0;o<e.length;o++)if(n=e[o],r.fullData._expandedIndex===n.cd[0].trace._expandedIndex){if(r.hoverOnBox===!0)break;r.pointNumber!==void 0?a=r.pointNumber:r.binNumber!==void 0&&(a=r.binNumber,i=r.pointNumbers);break}return{pointNumber:a,pointNumbers:i,searchInfo:n}}function Wg(t){var e=t.searchInfo.cd[0].trace,r=t.pointNumber,a=t.pointNumbers,i=a.length>0,n=i?a[0]:r;return e.selectedpoints?e.selectedpoints.indexOf(n)>-1:!1}function eR(t,e){var r=[],a,i,n,o;for(o=0;o<t.length;o++)a=t[o],a.cd[0].trace.selectedpoints&&a.cd[0].trace.selectedpoints.length>0&&r.push(a);if(r.length===1&&(n=r[0]===e.searchInfo,n&&(i=e.searchInfo.cd[0].trace,i.selectedpoints.length===e.pointNumbers.length))){for(o=0;o<e.pointNumbers.length;o++)if(i.selectedpoints.indexOf(e.pointNumbers[o])<0)return!1;return!0}return!1}function tR(t){var e=0,r,a,i;for(i=0;i<t.length;i++)if(r=t[i],a=r.cd[0].trace,a.selectedpoints&&(a.selectedpoints.length>1||(e+=a.selectedpoints.length,e>1)))return!1;return e===1}function Vl(t,e,r){var a;for(a=0;a<e.length;a++){var i=e[a].cd[0].trace._fullInput,n=t._fullLayout._tracePreGUI[i.uid]||{};n.selectedpoints===void 0&&(n.selectedpoints=i._input.selectedpoints||null)}var o;if(r){var l=r.points||[];for(a=0;a<e.length;a++)o=e[a].cd[0].trace,o._input.selectedpoints=o._fullInput.selectedpoints=[],o._fullInput!==o&&(o.selectedpoints=[]);for(var s=0;s<l.length;s++){var f=l[s],c=f.data,v=f.fullData,u=f.pointIndex,h=f.pointIndices;h?([].push.apply(c.selectedpoints,h),o._fullInput!==o&&[].push.apply(v.selectedpoints,h)):(c.selectedpoints.push(u),o._fullInput!==o&&v.selectedpoints.push(u))}}else for(a=0;a<e.length;a++)o=e[a].cd[0].trace,delete o.selectedpoints,delete o._input.selectedpoints,o._fullInput!==o&&delete o._fullInput.selectedpoints;rR(t,e)}function rR(t,e){for(var r=!1,a=0;a<e.length;a++){var i=e[a],n=i.cd;Bl.traceIs(n[0].trace,"regl")&&(r=!0);var o=i._module,l=o.styleOnSelect||o.style;l&&(l(t,n,n[0].node3),n[0].nodeRangePlot3&&l(t,n,n[0].nodeRangePlot3))}r&&(BP(t),GP(t))}function KT(t,e,r){for(var a=r?Gg.difference:Gg.union,i=a({regions:t},{regions:[e]}),n=i.regions.reverse(),o=0;o<n.length;o++){var l=n[o];l.subtract=zp(l,n.slice(0,o))}return n}function QT(t,e){if(Array.isArray(t))for(var r=e.cd,a=e.cd[0].trace,i=0;i<t.length;i++)t[i]=EP(t[i],a,r);return t}function JT(t,e){for(var r=[],a=0;a<t.length;a++){r[a]=[];for(var i=0;i<t[a].length;i++){r[a][i]=[],r[a][i][0]=i?"L":"M";for(var n=0;n<t[a][i].length;n++)r[a][i].push(t[a][i][n])}e||r[a].push(["Z",r[a][0][1],r[a][0][2]])}return r}function e2(t,e){for(var r=[],a,i,n=0;n<e.length;n++){var o=e[n];i=o._module.selectPoints(o,t),a=QT(i,o),r=r.concat(a)}return r}function Qd(t,e,r,a,i){var n=!!a,o,l,s;i&&(o=i.plotinfo,l=i.xaxes[0]._id,s=i.yaxes[0]._id);var f=[],c=[],v=qg(t),u=t._fullLayout;if(o){var h=u._zoomlayer,d=u.dragmode,p=Gl(d),m=Dp(d);if(p||m){var y=ha(t,l,"x"),b=ha(t,s,"y");if(y&&b){var w=h.selectAll(".select-outline-"+o.id);if(w&&t._fullLayout._outlining&&w.length){for(var g=w[0][0],x=g.getAttribute("d"),_=FP(x,t,o),T=[],k=0;k<_.length;k++){for(var S=_[k],L=[],D=0;D<S.length;D++)L.push([ki(y,S[D][1]),ki(b,S[D][2])]);L.xref=l,L.yref=s,L.subtract=zp(L,T),T.push(L)}v=v.concat(T)}}}}var $=l&&s?[l+s]:u._subplots.cartesian;aR(t);for(var E={},z=0;z<$.length;z++){var O=$[z],I=O.indexOf("y"),P=O.slice(0,I),M=O.slice(I),A=l&&s?r:void 0;if(A=nR(v,P,M,A),A){var C=a;if(!n){var R=ha(t,P,"x"),N=ha(t,M,"y");C=eu(t,[R],[N],O);for(var H=0;H<C.length;H++){var B=C[H],X=B.cd[0],j=X.trace;if(B._module.name==="scattergl"&&!X.t.xpx){var q=j.x,U=j.y,Z=j._length;X.t.xpx=[],X.t.ypx=[];for(var K=0;K<Z;K++)X.t.xpx[K]=R.c2p(q[K]),X.t.ypx[K]=N.c2p(U[K])}B._module.name==="splom"&&(E[j.uid]||(E[j.uid]=!0))}}var ee=e2(A,C);f=f.concat(ee),c=c.concat(C)}}var le={points:f};Vl(t,c,le);var ye=u.clickmode,se=ye.indexOf("event")>-1&&e;if(!o&&e){var G=qg(t,!0);if(G.length){var J=G[0].xref,oe=G[0].yref;if(J&&oe){var fe=r2(G),pe=a2([ha(t,J,"x"),ha(t,oe,"y")]);pe(le,fe)}}t._fullLayout._noEmitSelectedAtStart?t._fullLayout._noEmitSelectedAtStart=!1:se&&Xl(t,le),u._reselect=!1}if(!o&&u._deselect){var ge=u._deselect;l=ge.xref,s=ge.yref,iR(l,s,c)||t2(t,l,s,a),se&&(le.points.length?Xl(t,le):Ip(t)),u._deselect=!1}return{eventData:le,selectionTesters:r}}function aR(t){var e=t.calcdata;if(e)for(var r=0;r<e.length;r++){var a=e[r][0],i=a.trace,n=t._fullLayout._splomScenes;if(n){var o=n[i.uid];o&&(o.selectBatch=[])}}}function iR(t,e,r){for(var a=0;a<r.length;a++){var i=r[a];if(i.xaxis&&i.xaxis._id===t&&i.yaxis&&i.yaxis._id===e)return!0}return!1}function t2(t,e,r,a){a=eu(t,[ha(t,e,"x")],[ha(t,r,"y")],e+r);for(var i=0;i<a.length;i++){var n=a[i];n._module.selectPoints(n,!1)}Vl(t,a)}function nR(t,e,r,a){for(var i,n=0;n<t.length;n++){var o=t[n];if(!(e!==o.xref||r!==o.yref))if(i){var l=!!o.subtract;i=KT(i,o,l),a=Ep(i)}else i=[o],a=$p(o)}return a}function qg(t,e){for(var r=[],a=t._fullLayout,i=a.selections,n=i.length,o=0;o<n;o++)if(!(e&&o!==a._activeSelectionIndex)){var l=i[o];if(l){var s=l.xref,f=l.yref,c=ha(t,s,"x"),v=ha(t,f,"y"),u,h,d,p,m;if(l.type==="rect"){m=[];var y=ki(c,l.x0),b=ki(c,l.x1),w=ki(v,l.y0),g=ki(v,l.y1);m=[[y,w],[y,g],[b,g],[b,w]],u=Math.min(y,b),h=Math.max(y,b),d=Math.min(w,g),p=Math.max(w,g),m.xmin=u,m.xmax=h,m.ymin=d,m.ymax=p,m.xref=s,m.yref=f,m.subtract=!1,m.isRect=!0,r.push(m)}else if(l.type==="path")for(var x=l.path.split("Z"),_=[],T=0;T<x.length;T++){var k=x[T];if(k){k+="Z";var S=Ug.extractPathCoords(k,Vg.paramIsX,"raw"),L=Ug.extractPathCoords(k,Vg.paramIsY,"raw");u=1/0,h=-1/0,d=1/0,p=-1/0,m=[];for(var D=0;D<S.length;D++){var $=ki(c,S[D]),E=ki(v,L[D]);m.push([$,E]),u=Math.min($,u),h=Math.max($,h),d=Math.min(E,d),p=Math.max(E,p)}m.xmin=u,m.xmax=h,m.ymin=d,m.ymax=p,m.xref=s,m.yref=f,m.subtract=zp(m,_),_.push(m),r.push(m)}}}}return r}function zp(t,e){for(var r=!1,a=0;a<e.length;a++)for(var i=e[a],n=0;n<t.length;n++)if($P(t[n],i)){r=!r;break}return r}function ki(t,e){return t.type==="date"&&(e=e.replace("_"," ")),t.type==="log"?t.c2p(e):t.r2p(e,null,t.calendar)}function r2(t){for(var e=t.length,r=[],a=0;a<e;a++){var i=t[a];r=r.concat(i),r=r.concat([i[0]])}return oR(r)}function oR(t){return t.isRect=t.length===5&&t[0][0]===t[4][0]&&t[0][1]===t[4][1]&&t[0][0]===t[1][0]&&t[2][0]===t[3][0]&&t[0][1]===t[3][1]&&t[1][1]===t[2][1]||t[0][1]===t[1][1]&&t[2][1]===t[3][1]&&t[0][0]===t[3][0]&&t[1][0]===t[2][0],t.isRect&&(t.xmin=Math.min(t[0][0],t[2][0]),t.xmax=Math.max(t[0][0],t[2][0]),t.ymin=Math.min(t[0][1],t[2][1]),t.ymax=Math.max(t[0][1],t[2][1])),t}function a2(t){return function(e,r){for(var a,i,n=0;n<t.length;n++){var o=t[n],l=o._id,s=l.charAt(0);if(r.isRect){a||(a={});var f=r[s+"min"],c=r[s+"max"];f!==void 0&&c!==void 0&&(a[l]=[Xg(o,f),Xg(o,c)].sort(jP))}else i||(i={}),i[l]=r.map(VP(o))}a&&(e.range=a),i&&(e.lassoPoints=i)}}function lR(t){var e=t.plotinfo;return e.fillRangeItems||a2(t.xaxes.concat(t.yaxes))}function sR(t,e){t.emit("plotly_selecting",e)}function Xl(t,e){e&&(e.selections=(t.layout||{}).selections||[]),t.emit("plotly_selected",e)}function Ip(t){t.emit("plotly_deselect",null)}var fR={reselect:Qd,prepSelect:YP,clearOutline:XT,clearSelectionsCache:Ul,selectOnClick:qT},i2=[{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}],tu={axisRefDescription:function(t,e,r){return["If set to a",t,"axis id (e.g. *"+t+"* or","*"+t+"2*), the `"+t+"` position refers to a",t,"coordinate. If set to *paper*, the `"+t+"`","position refers to the distance from the",e,"of the plotting","area in normalized coordinates where *0* (*1*) corresponds to the",e,"("+r+"). If set to a",t,"axis ID followed by","*domain* (separated by a space), the position behaves like for","*paper*, but refers to the distance in fractions of the domain","length from the",e,"of the domain of that axis: e.g.,","*"+t+"2 domain* refers to the domain of the second",t," axis and a",t,"position of 0.5 refers to the","point between the",e,"and the",r,"of the domain of the","second",t,"axis."].join(" ")}},Zg=i2,Kg=Mr,qs=Gr,cR=Ht.templatedArray,Zs=tu;function Qg(t){return["In order for absolute positioning of the arrow to work, *a"+t+"ref* must be exactly the same as *"+t+"ref*, otherwise *a"+t+"ref* will revert to *pixel* (explained next).","For relative positioning, *a"+t+"ref* can be set to *pixel*,","in which case the *a"+t+"* value is specified in pixels","relative to *"+t+"*.","Absolute positioning is useful","for trendline annotations which should continue to indicate","the correct trend when zoomed. Relative positioning is useful","for specifying the text offset for an annotated point."].join(" ")}function Jg(t,e,r){return["Sets the",t,"component of the arrow tail about the arrow head.","If `a"+t+"ref` is `pixel`, a positive (negative)","component corresponds to an arrow pointing","from",r,"to",e,"("+e,"to",r+").","If `a"+t+"ref` is not `pixel` and is exactly the same as `"+t+"ref`,","this is an absolute value on that axis,","like `"+t+"`, specified in the same coordinates as `"+t+"ref`."].join(" ")}var vs=cR("annotation",{visible:{valType:"boolean",dflt:!0,editType:"calc+arraydraw",description:["Determines whether or not this annotation is visible."].join(" ")},text:{valType:"string",editType:"calc+arraydraw",description:["Sets the text associated with this annotation.","Plotly uses a subset of HTML tags to do things like","newline (<br>), bold (<b></b>), italics (<i></i>),","hyperlinks (<a href='...'></a>). Tags <em>, <sup>, <sub>","<span> are also supported."].join(" ")},textangle:{valType:"angle",dflt:0,editType:"calc+arraydraw",description:["Sets the angle at which the `text` is drawn","with respect to the horizontal."].join(" ")},font:Kg({editType:"calc+arraydraw",colorEditType:"arraydraw",description:"Sets the annotation text font."}),width:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw",description:["Sets an explicit width for the text box. null (default) lets the","text set the box width. Wider text will be clipped.","There is no automatic wrapping; use <br> to start a new line."].join(" ")},height:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw",description:["Sets an explicit height for the text box. null (default) lets the","text set the box height. Taller text will be clipped."].join(" ")},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw",description:"Sets the opacity of the annotation (text + arrow)."},align:{valType:"enumerated",values:["left","center","right"],dflt:"center",editType:"arraydraw",description:["Sets the horizontal alignment of the `text` within the box.","Has an effect only if `text` spans two or more lines","(i.e. `text` contains one or more <br> HTML tags) or if an","explicit width is set to override the text width."].join(" ")},valign:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle",editType:"arraydraw",description:["Sets the vertical alignment of the `text` within the box.","Has an effect only if an explicit height is set to override","the text height."].join(" ")},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw",description:"Sets the background color of the annotation."},bordercolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw",description:["Sets the color of the border enclosing the annotation `text`."].join(" ")},borderpad:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw",description:["Sets the padding (in px) between the `text`","and the enclosing border."].join(" ")},borderwidth:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw",description:["Sets the width (in px) of the border enclosing","the annotation `text`."].join(" ")},showarrow:{valType:"boolean",dflt:!0,editType:"calc+arraydraw",description:["Determines whether or not the annotation is drawn with an arrow.","If *true*, `text` is placed near the arrow's tail.","If *false*, `text` lines up with the `x` and `y` provided."].join(" ")},arrowcolor:{valType:"color",editType:"arraydraw",description:"Sets the color of the annotation arrow."},arrowhead:{valType:"integer",min:0,max:Zg.length,dflt:1,editType:"arraydraw",description:"Sets the end annotation arrow head style."},startarrowhead:{valType:"integer",min:0,max:Zg.length,dflt:1,editType:"arraydraw",description:"Sets the start annotation arrow head style."},arrowside:{valType:"flaglist",flags:["end","start"],extras:["none"],dflt:"end",editType:"arraydraw",description:"Sets the annotation arrow head position."},arrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw",description:["Sets the size of the end annotation arrow head, relative to `arrowwidth`.","A value of 1 (default) gives a head about 3x as wide as the line."].join(" ")},startarrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw",description:["Sets the size of the start annotation arrow head, relative to `arrowwidth`.","A value of 1 (default) gives a head about 3x as wide as the line."].join(" ")},arrowwidth:{valType:"number",min:.1,editType:"calc+arraydraw",description:"Sets the width (in px) of annotation arrow line."},standoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw",description:["Sets a distance, in pixels, to move the end arrowhead away from the","position it is pointing at, for example to point at the edge of","a marker independent of zoom. Note that this shortens the arrow","from the `ax` / `ay` vector, in contrast to `xshift` / `yshift`","which moves everything by this amount."].join(" ")},startstandoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw",description:["Sets a distance, in pixels, to move the start arrowhead away from the","position it is pointing at, for example to point at the edge of","a marker independent of zoom. Note that this shortens the arrow","from the `ax` / `ay` vector, in contrast to `xshift` / `yshift`","which moves everything by this amount."].join(" ")},ax:{valType:"any",editType:"calc+arraydraw",description:[Jg("x","left","right")].join(" ")},ay:{valType:"any",editType:"calc+arraydraw",description:[Jg("y","top","bottom")].join(" ")},axref:{valType:"enumerated",dflt:"pixel",values:["pixel",qs.idRegex.x.toString()],editType:"calc",description:["Indicates in what coordinates the tail of the","annotation (ax,ay) is specified.",Zs.axisRefDescription("x","left","right"),Qg("x")].join(" ")},ayref:{valType:"enumerated",dflt:"pixel",values:["pixel",qs.idRegex.y.toString()],editType:"calc",description:["Indicates in what coordinates the tail of the","annotation (ax,ay) is specified.",Zs.axisRefDescription("y","bottom","top"),Qg("y")].join(" ")},xref:{valType:"enumerated",values:["paper",qs.idRegex.x.toString()],editType:"calc",description:["Sets the annotation's x coordinate axis.",Zs.axisRefDescription("x","left","right")].join(" ")},x:{valType:"any",editType:"calc+arraydraw",description:["Sets the annotation's x position.","If the axis `type` is *log*, then you must take the","log of your desired range.","If the axis `type` is *date*, it should be date strings,","like date data, though Date objects and unix milliseconds","will be accepted and converted to strings.","If the axis `type` is *category*, it should be numbers,","using the scale where each category is assigned a serial","number from zero in the order it appears."].join(" ")},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto",editType:"calc+arraydraw",description:["Sets the text box's horizontal position anchor","This anchor binds the `x` position to the *left*, *center*","or *right* of the annotation.","For example, if `x` is set to 1, `xref` to *paper* and","`xanchor` to *right* then the right-most portion of the","annotation lines up with the right-most edge of the","plotting area.","If *auto*, the anchor is equivalent to *center* for","data-referenced annotations or if there is an arrow,","whereas for paper-referenced with no arrow, the anchor picked","corresponds to the closest side."].join(" ")},xshift:{valType:"number",dflt:0,editType:"calc+arraydraw",description:["Shifts the position of the whole annotation and arrow to the","right (positive) or left (negative) by this many pixels."].join(" ")},yref:{valType:"enumerated",values:["paper",qs.idRegex.y.toString()],editType:"calc",description:["Sets the annotation's y coordinate axis.",Zs.axisRefDescription("y","bottom","top")].join(" ")},y:{valType:"any",editType:"calc+arraydraw",description:["Sets the annotation's y position.","If the axis `type` is *log*, then you must take the","log of your desired range.","If the axis `type` is *date*, it should be date strings,","like date data, though Date objects and unix milliseconds","will be accepted and converted to strings.","If the axis `type` is *category*, it should be numbers,","using the scale where each category is assigned a serial","number from zero in the order it appears."].join(" ")},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto",editType:"calc+arraydraw",description:["Sets the text box's vertical position anchor","This anchor binds the `y` position to the *top*, *middle*","or *bottom* of the annotation.","For example, if `y` is set to 1, `yref` to *paper* and","`yanchor` to *top* then the top-most portion of the","annotation lines up with the top-most edge of the","plotting area.","If *auto*, the anchor is equivalent to *middle* for","data-referenced annotations or if there is an arrow,","whereas for paper-referenced with no arrow, the anchor picked","corresponds to the closest side."].join(" ")},yshift:{valType:"number",dflt:0,editType:"calc+arraydraw",description:["Shifts the position of the whole annotation and arrow up","(positive) or down (negative) by this many pixels."].join(" ")},clicktoshow:{valType:"enumerated",values:[!1,"onoff","onout"],dflt:!1,editType:"arraydraw",description:["Makes this annotation respond to clicks on the plot.","If you click a data point that exactly matches the `x` and `y`","values of this annotation, and it is hidden (visible: false),","it will appear. In *onoff* mode, you must click the same point","again to make it disappear, so if you click multiple points,","you can show multiple annotations. In *onout* mode, a click","anywhere else in the plot (on another data point or not) will","hide this annotation.","If you need to show/hide this annotation in response to different","`x` or `y` values, you can set `xclick` and/or `yclick`. This is","useful for example to label the side of a bar. To label markers","though, `standoff` is preferred over `xclick` and `yclick`."].join(" ")},xclick:{valType:"any",editType:"arraydraw",description:["Toggle this annotation when clicking a data point whose `x` value","is `xclick` rather than the annotation's `x` value."].join(" ")},yclick:{valType:"any",editType:"arraydraw",description:["Toggle this annotation when clicking a data point whose `y` value","is `yclick` rather than the annotation's `y` value."].join(" ")},hovertext:{valType:"string",editType:"arraydraw",description:["Sets text to appear when hovering over this annotation.","If omitted or blank, no hover label will appear."].join(" ")},hoverlabel:{bgcolor:{valType:"color",editType:"arraydraw",description:["Sets the background color of the hover label.","By default uses the annotation's `bgcolor` made opaque,","or white if it was transparent."].join(" ")},bordercolor:{valType:"color",editType:"arraydraw",description:["Sets the border color of the hover label.","By default uses either dark grey or white, for maximum","contrast with `hoverlabel.bgcolor`."].join(" ")},font:Kg({editType:"arraydraw",description:["Sets the hover label text font.","By default uses the global hover font and size,","with color from `hoverlabel.bordercolor`."].join(" ")}),editType:"arraydraw"},captureevents:{valType:"boolean",editType:"arraydraw",description:["Determines whether the annotation text box captures mouse move","and click events, or allows those events to pass through to data","points in the plot that may be behind the annotation. By default","`captureevents` is *false* unless `hovertext` is provided.","If you use the event `plotly_clickannotation` without `hovertext`","you must explicitly enable `captureevents`."].join(" ")},editType:"calc",_deprecated:{ref:{valType:"string",editType:"calc",description:["Obsolete. Set `xref` and `yref` separately instead."].join(" ")}}}),ru={PTS_LINESONLY:20,minTolerance:.2,toleranceGrowth:10,maxScreensAway:20,eventDataKeys:[]},e0=jo.axisHoverFormat,uR=Dr.texttemplateAttrs,vR=Dr.hovertemplateAttrs,t0=Ln,dR=Mr,hR=ra.dash,pR=ra.pattern,mR=$t,r0=ru,cv=Qt.extendFlat;function a0(t){return{valType:"any",dflt:0,editType:"calc",description:["Only relevant when the axis `type` is *date*.","Sets the period positioning in milliseconds or *M<n>* on the "+t+" axis.","Special values in the form of *M<n>* could be used to declare","the number of months. In this case `n` must be a positive integer."].join(" ")}}function i0(t){return{valType:"any",editType:"calc",description:["Only relevant when the axis `type` is *date*.","Sets the base for period positioning in milliseconds or date string on the "+t+" axis.","When `"+t+"period` is round number of weeks,","the `"+t+"period0` by default would be on a Sunday i.e. 2000-01-02,","otherwise it would be at 2000-01-01."].join(" ")}}function n0(t){return{valType:"enumerated",values:["start","middle","end"],dflt:"middle",editType:"calc",description:["Only relevant when the axis `type` is *date*.","Sets the alignment of data points on the "+t+" axis."].join(" ")}}var Ui={x:{valType:"data_array",editType:"calc+clearAxisTypes",anim:!0,description:"Sets the x coordinates."},x0:{valType:"any",dflt:0,editType:"calc+clearAxisTypes",anim:!0,description:["Alternate to `x`.","Builds a linear space of x coordinates.","Use with `dx`","where `x0` is the starting coordinate and `dx` the step."].join(" ")},dx:{valType:"number",dflt:1,editType:"calc",anim:!0,description:["Sets the x coordinate step.","See `x0` for more info."].join(" ")},y:{valType:"data_array",editType:"calc+clearAxisTypes",anim:!0,description:"Sets the y coordinates."},y0:{valType:"any",dflt:0,editType:"calc+clearAxisTypes",anim:!0,description:["Alternate to `y`.","Builds a linear space of y coordinates.","Use with `dy`","where `y0` is the starting coordinate and `dy` the step."].join(" ")},dy:{valType:"number",dflt:1,editType:"calc",anim:!0,description:["Sets the y coordinate step.","See `y0` for more info."].join(" ")},xperiod:a0("x"),yperiod:a0("y"),xperiod0:i0("x0"),yperiod0:i0("y0"),xperiodalignment:n0("x"),yperiodalignment:n0("y"),xhoverformat:e0("x"),yhoverformat:e0("y"),offsetgroup:{valType:"string",dflt:"",editType:"calc",description:["Set several traces linked to the same position axis","or matching axes to the same","offsetgroup where bars of the same position coordinate will line up."].join(" ")},alignmentgroup:{valType:"string",dflt:"",editType:"calc",description:["Set several traces linked to the same position axis","or matching axes to the same","alignmentgroup. This controls whether bars compute their positional","range dependently or independently."].join(" ")},stackgroup:{valType:"string",dflt:"",editType:"calc",description:["Set several scatter traces (on the same subplot) to the same","stackgroup in order to add their y values (or their x values if","`orientation` is *h*). If blank or omitted this trace will not be","stacked. Stacking also turns `fill` on by default, using *tonexty*","(*tonextx*) if `orientation` is *h* (*v*) and sets the default","`mode` to *lines* irrespective of point count.","You can only stack on a numeric (linear or log) axis.","Traces in a `stackgroup` will only fill to (or be filled to) other","traces in the same group. With multiple `stackgroup`s or some","traces stacked and some not, if fill-linked traces are not already","consecutive, the later ones will be pushed down in the drawing order."].join(" ")},orientation:{valType:"enumerated",values:["v","h"],editType:"calc",description:["Only relevant in the following cases:","1. when `scattermode` is set to *group*.","2. when `stackgroup` is used, and only the first","`orientation` found in the `stackgroup` will be used - including","if `visible` is *legendonly* but not if it is `false`. Sets the","stacking direction. With *v* (*h*), the y (x) values of subsequent","traces are added. Also affects the default value of `fill`."].join(" ")},groupnorm:{valType:"enumerated",values:["","fraction","percent"],dflt:"",editType:"calc",description:["Only relevant when `stackgroup` is used, and only the first","`groupnorm` found in the `stackgroup` will be used - including","if `visible` is *legendonly* but not if it is `false`.","Sets the normalization for the sum of this `stackgroup`.","With *fraction*, the value of each trace at each location is","divided by the sum of all trace values at that location.","*percent* is the same but multiplied by 100 to show percentages.","If there are multiple subplots, or multiple `stackgroup`s on one","subplot, each will be normalized within its own set."].join(" ")},stackgaps:{valType:"enumerated",values:["infer zero","interpolate"],dflt:"infer zero",editType:"calc",description:["Only relevant when `stackgroup` is used, and only the first","`stackgaps` found in the `stackgroup` will be used - including","if `visible` is *legendonly* but not if it is `false`.","Determines how we handle locations at which other traces in this","group have data but this one does not.","With *infer zero* we insert a zero at these locations.","With *interpolate* we linearly interpolate between existing","values, and extrapolate a constant beyond the existing values."].join(" ")},text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc",description:["Sets text elements associated with each (x,y) pair.","If a single string, the same string appears over","all the data points.","If an array of string, the items are mapped in order to the","this trace's (x,y) coordinates.","If trace `hoverinfo` contains a *text* flag and *hovertext* is not set,","these elements will be seen in the hover labels."].join(" ")},texttemplate:uR({},{}),hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"style",description:["Sets hover text elements associated with each (x,y) pair.","If a single string, the same string appears over","all the data points.","If an array of string, the items are mapped in order to the","this trace's (x,y) coordinates.","To be seen, trace `hoverinfo` must contain a *text* flag."].join(" ")},mode:{valType:"flaglist",flags:["lines","markers","text"],extras:["none"],editType:"calc",description:["Determines the drawing mode for this scatter trace.","If the provided `mode` includes *text* then the `text` elements","appear at the coordinates. Otherwise, the `text` elements","appear on hover.","If there are less than "+r0.PTS_LINESONLY+" points","and the trace is not stacked","then the default is *lines+markers*. Otherwise, *lines*."].join(" ")},hoveron:{valType:"flaglist",flags:["points","fills"],editType:"style",description:["Do the hover effects highlight individual points (markers or","line points) or do they highlight filled regions?","If the fill is *toself* or *tonext* and there are no markers","or text, then the default is *fills*, otherwise it is *points*."].join(" ")},hovertemplate:vR({},{keys:r0.eventDataKeys}),line:{color:{valType:"color",editType:"style",anim:!0,description:"Sets the line color."},width:{valType:"number",min:0,dflt:2,editType:"style",anim:!0,description:"Sets the line width (in px)."},shape:{valType:"enumerated",values:["linear","spline","hv","vh","hvh","vhv"],dflt:"linear",editType:"plot",description:["Determines the line shape.","With *spline* the lines are drawn using spline interpolation.","The other available values correspond to step-wise line shapes."].join(" ")},smoothing:{valType:"number",min:0,max:1.3,dflt:1,editType:"plot",description:["Has an effect only if `shape` is set to *spline*","Sets the amount of smoothing.","*0* corresponds to no smoothing (equivalent to a *linear* shape)."].join(" ")},dash:cv({},hR,{editType:"style"}),backoff:{valType:"number",min:0,dflt:"auto",arrayOk:!0,editType:"plot",description:["Sets the line back off from the end point of the nth line segment (in px).","This option is useful e.g. to avoid overlap with arrowhead markers.","With *auto* the lines would trim before markers if `marker.angleref` is set to *previous*."].join(" ")},simplify:{valType:"boolean",dflt:!0,editType:"plot",description:["Simplifies lines by removing nearly-collinear points. When transitioning","lines, it may be desirable to disable this so that the number of points","along the resulting SVG path is unaffected."].join(" ")},editType:"plot"},connectgaps:{valType:"boolean",dflt:!1,editType:"calc",description:["Determines whether or not gaps","(i.e. {nan} or missing values)","in the provided data arrays are connected."].join(" ")},cliponaxis:{valType:"boolean",dflt:!0,editType:"plot",description:["Determines whether or not markers and text nodes","are clipped about the subplot axes.","To show markers and text nodes above axis lines and tick labels,","make sure to set `xaxis.layer` and `yaxis.layer` to *below traces*."].join(" ")},fill:{valType:"enumerated",values:["none","tozeroy","tozerox","tonexty","tonextx","toself","tonext"],editType:"calc",description:["Sets the area to fill with a solid color.","Defaults to *none* unless this trace is stacked, then it gets","*tonexty* (*tonextx*) if `orientation` is *v* (*h*)","Use with `fillcolor` if not *none*.","*tozerox* and *tozeroy* fill to x=0 and y=0 respectively.","*tonextx* and *tonexty* fill between the endpoints of this","trace and the endpoints of the trace before it, connecting those","endpoints with straight lines (to make a stacked area graph);","if there is no trace before it, they behave like *tozerox* and","*tozeroy*.","*toself* connects the endpoints of the trace (or each segment","of the trace if it has gaps) into a closed shape.","*tonext* fills the space between two traces if one completely","encloses the other (eg consecutive contour lines), and behaves like","*toself* if there is no trace before it. *tonext* should not be","used if one trace does not enclose the other.","Traces in a `stackgroup` will only fill to (or be filled to) other","traces in the same group. With multiple `stackgroup`s or some","traces stacked and some not, if fill-linked traces are not already","consecutive, the later ones will be pushed down in the drawing order."].join(" ")},fillcolor:{valType:"color",editType:"style",anim:!0,description:["Sets the fill color.","Defaults to a half-transparent variant of the line color,","marker color, or marker line color, whichever is available."].join(" ")},fillpattern:pR,marker:cv({symbol:{valType:"enumerated",values:mR.symbolList,dflt:"circle",arrayOk:!0,editType:"style",description:["Sets the marker symbol type.","Adding 100 is equivalent to appending *-open* to a symbol name.","Adding 200 is equivalent to appending *-dot* to a symbol name.","Adding 300 is equivalent to appending *-open-dot*","or *dot-open* to a symbol name."].join(" ")},opacity:{valType:"number",min:0,max:1,arrayOk:!0,editType:"style",anim:!0,description:"Sets the marker opacity."},angle:{valType:"angle",dflt:0,arrayOk:!0,editType:"plot",anim:!1,description:["Sets the marker angle in respect to `angleref`."].join(" ")},angleref:{valType:"enumerated",values:["previous","up"],dflt:"up",editType:"plot",anim:!1,description:["Sets the reference for marker angle.","With *previous*, angle 0 points along the line from the previous point to this one.","With *up*, angle 0 points toward the top of the screen."].join(" ")},standoff:{valType:"number",min:0,dflt:0,arrayOk:!0,editType:"plot",anim:!0,description:["Moves the marker away from the data point in the direction of `angle` (in px).","This can be useful for example if you have another marker at this","location and you want to point an arrowhead marker at it."].join(" ")},size:{valType:"number",min:0,dflt:6,arrayOk:!0,editType:"calc",anim:!0,description:"Sets the marker size (in px)."},maxdisplayed:{valType:"number",min:0,dflt:0,editType:"plot",description:["Sets a maximum number of points to be drawn on the graph.","*0* corresponds to no limit."].join(" ")},sizeref:{valType:"number",dflt:1,editType:"calc",description:["Has an effect only if `marker.size` is set to a numerical array.","Sets the scale factor used to determine the rendered size of","marker points. Use with `sizemin` and `sizemode`."].join(" ")},sizemin:{valType:"number",min:0,dflt:0,editType:"calc",description:["Has an effect only if `marker.size` is set to a numerical array.","Sets the minimum size (in px) of the rendered marker points."].join(" ")},sizemode:{valType:"enumerated",values:["diameter","area"],dflt:"diameter",editType:"calc",description:["Has an effect only if `marker.size` is set to a numerical array.","Sets the rule for which the data in `size` is converted","to pixels."].join(" ")},line:cv({width:{valType:"number",min:0,arrayOk:!0,editType:"style",anim:!0,description:"Sets the width (in px) of the lines bounding the marker points."},editType:"calc"},t0("marker.line",{anim:!0})),gradient:{type:{valType:"enumerated",values:["radial","horizontal","vertical","none"],arrayOk:!0,dflt:"none",editType:"calc",description:["Sets the type of gradient used to fill the markers"].join(" ")},color:{valType:"color",arrayOk:!0,editType:"calc",description:["Sets the final color of the gradient fill:","the center color for radial, the right for horizontal,","or the bottom for vertical."].join(" ")},editType:"calc"},editType:"calc"},t0("marker",{anim:!0})),selected:{marker:{opacity:{valType:"number",min:0,max:1,editType:"style",description:"Sets the marker opacity of selected points."},color:{valType:"color",editType:"style",description:"Sets the marker color of selected points."},size:{valType:"number",min:0,editType:"style",description:"Sets the marker size of selected points."},editType:"style"},textfont:{color:{valType:"color",editType:"style",description:"Sets the text font color of selected points."},editType:"style"},editType:"style"},unselected:{marker:{opacity:{valType:"number",min:0,max:1,editType:"style",description:"Sets the marker opacity of unselected points, applied only when a selection exists."},color:{valType:"color",editType:"style",description:"Sets the marker color of unselected points, applied only when a selection exists."},size:{valType:"number",min:0,editType:"style",description:"Sets the marker size of unselected points, applied only when a selection exists."},editType:"style"},textfont:{color:{valType:"color",editType:"style",description:"Sets the text font color of unselected points, applied only when a selection exists."},editType:"style"},editType:"style"},textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right"],dflt:"middle center",arrayOk:!0,editType:"calc",description:["Sets the positions of the `text` elements","with respects to the (x,y) coordinates."].join(" ")},textfont:dR({editType:"calc",colorEditType:"style",arrayOk:!0,description:"Sets the text font."})},o0=vs,l0=Ui.line,yR=ra.dash,Ks=Qt.extendFlat,gR=Ya.overrideAll,bR=Ht.templatedArray,s0=tu,n2=gR(bR("selection",{type:{valType:"enumerated",values:["rect","path"],description:["Specifies the selection type to be drawn.","If *rect*, a rectangle is drawn linking","(`x0`,`y0`), (`x1`,`y0`), (`x1`,`y1`) and (`x0`,`y1`).","If *path*, draw a custom SVG path using `path`."].join(" ")},xref:Ks({},o0.xref,{description:["Sets the selection's x coordinate axis.",s0.axisRefDescription("x","left","right")].join(" ")}),yref:Ks({},o0.yref,{description:["Sets the selection's x coordinate axis.",s0.axisRefDescription("y","bottom","top")].join(" ")}),x0:{valType:"any",description:"Sets the selection's starting x position."},x1:{valType:"any",description:"Sets the selection's end x position."},y0:{valType:"any",description:"Sets the selection's starting y position."},y1:{valType:"any",description:"Sets the selection's end y position."},path:{valType:"string",editType:"arraydraw",description:["For `type` *path* - a valid SVG path similar to `shapes.path` in data coordinates.","Allowed segments are: M, L and Z."].join(" ")},opacity:{valType:"number",min:0,max:1,dflt:.7,editType:"arraydraw",description:"Sets the opacity of the selection."},line:{color:l0.color,width:Ks({},l0.width,{min:1,dflt:1}),dash:Ks({},yR,{dflt:"dot"})}}),"arraydraw","from-root"),f0=me,Qs=Bt,xR=Ka,_R=n2,c0=Gi,wR=function(e,r){xR(e,r,{name:"selections",handleItemDefaults:TR});for(var a=r.selections,i=0;i<a.length;i++){var n=a[i];n&&n.path===void 0&&(n.x0===void 0||n.x1===void 0||n.y0===void 0||n.y1===void 0)&&(r.selections[i]=null)}};function TR(t,e,r){function a(_,T){return f0.coerce(t,e,_R,_,T)}var i=a("path"),n=i?"path":"rect",o=a("type",n),l=o!=="path";l&&delete e.path,a("opacity"),a("line.color"),a("line.width"),a("line.dash");for(var s=["x","y"],f=0;f<2;f++){var c=s[f],v={_fullLayout:r},u,h,d,p=Qs.coerceRef(t,e,v,c);if(u=Qs.getFromId(v,p),u._selectionIndices.push(e._index),d=c0.rangeToShapePosition(u),h=c0.shapePositionToRange(u),l){var m=c+"0",y=c+"1",b=t[m],w=t[y];t[m]=h(t[m],!0),t[y]=h(t[y],!0),Qs.coercePosition(e,v,a,p,m),Qs.coercePosition(e,v,a,p,y);var g=e[m],x=e[y];g!==void 0&&x!==void 0&&(e[m]=d(g),e[y]=d(x),t[m]=b,t[y]=w)}}l&&f0.noneOrAll(t,e,["x0","x1","y0","y1"])}var kR=function(e,r,a){a("newselection.mode");var i=a("newselection.line.width");i&&(a("newselection.line.color"),a("newselection.line.dash")),a("activeselection.fillcolor"),a("activeselection.opacity")},AR=ot,u0=me,v0=lr,au=function(e){return function(a,i){var n=a[e];if(Array.isArray(n))for(var o=AR.subplotsRegistry.cartesian,l=o.idRegex,s=i._subplots,f=s.xaxis,c=s.yaxis,v=s.cartesian,u=i._has("cartesian")||i._has("gl2d"),h=0;h<n.length;h++){var d=n[h];if(u0.isPlainObject(d)){var p=v0.cleanId(d.xref,"x",!1),m=v0.cleanId(d.yref,"y",!1),y=l.x.test(p),b=l.y.test(m);if(y||b){u||u0.pushUnique(i._basePlotModules,o);var w=!1;y&&f.indexOf(p)===-1&&(f.push(p),w=!0),b&&c.indexOf(m)===-1&&(c.push(m),w=!0),w&&y&&b&&v.push(p+m)}}}}},d0=jT,nl=fR,Sl={moduleType:"component",name:"selections",layoutAttributes:n2,supplyLayoutDefaults:wR,supplyDrawNewSelectionDefaults:kR,includeBasePlot:au("selections"),draw:d0.draw,drawOne:d0.drawOne,reselect:nl.reselect,prepSelect:nl.prepSelect,clearOutline:nl.clearOutline,clearSelectionsCache:nl.clearSelectionsCache,selectOnClick:nl.selectOnClick},uv,h0;function MR(){if(h0)return uv;h0=1;var t=gt,e=me,r=e.numberFormat,a=ga,i=N1,n=ot,o=e.strTranslate,l=br,s=ht,f=$t,c=Ia,v=Bt,u=ji,h=Qa,d=Dn,p=d.selectingOrDrawing,m=d.freeMode,y=Ur.FROM_TL,b=hp,w=Xc.redrawReglTraces,g=cr,x=lr.getFromId,_=Sl.prepSelect,T=Sl.clearOutline,k=Sl.selectOnClick,S=IT,L=Gr,D=L.MINDRAG,$=L.MINZOOM,E=!0;function z(G,J,oe,fe,pe,ge,ue,Ce){var ce=G._fullLayout._zoomlayer,De=ue+Ce==="nsew",Ee=(ue+Ce).length===1,$e,te,Te,ne,de,he,Ae,Me,we,be,Ve,Fe,Oe,Ge,lt,xe,Ze,Xe,Ye,He,Ue,Je,F;oe+=J.yaxis._shift;function W(){if($e=J.xaxis,te=J.yaxis,we=$e._length,be=te._length,Ae=$e._offset,Me=te._offset,Te={},Te[$e._id]=$e,ne={},ne[te._id]=te,ue&&Ce)for(var Be=J.overlays,Ie=0;Ie<Be.length;Ie++){var nt=Be[Ie].xaxis;Te[nt._id]=nt;var ft=Be[Ie].yaxis;ne[ft._id]=ft}de=se(Te),he=se(ne),Oe=P(de,Ce),Ge=P(he,ue),lt=!Ge&&!Oe,Fe=le(G,G._fullLayout._axisMatchGroups,Te,ne),Ve=le(G,G._fullLayout._axisConstraintGroups,Te,ne,Fe);var Ke=Ve.isSubplotConstrained||Fe.isSubplotConstrained;xe=Ce||Ke,Ze=ue||Ke;var et=G._fullLayout;Xe=et._has("scattergl"),Ye=et._has("splom"),He=et._has("svg")}W();var Y=N(Ge+Oe,G._fullLayout.dragmode,De),V=I(J,ue+Ce+"drag",Y,oe,fe,pe,ge);if(lt&&!De)return V.onmousedown=null,V.style.pointerEvents="none",V;var ie={element:V,gd:G,plotinfo:J};ie.prepFn=function(Be,Ie,nt){var ft=ie.dragmode,Ke=G._fullLayout.dragmode;Ke!==ft&&(ie.dragmode=Ke),W(),Je=G._fullLayout._invScaleX,F=G._fullLayout._invScaleY,lt||(De?Be.shiftKey?Ke==="pan"?Ke="zoom":p(Ke)||(Ke="pan"):Be.ctrlKey&&(Ke="pan"):Ke="pan"),m(Ke)?ie.minDrag=1:ie.minDrag=void 0,p(Ke)?(ie.xaxes=de,ie.yaxes=he,_(Be,Ie,nt,ie,Ke)):(ie.clickFn=ke,p(ft)&&re(),lt||(Ke==="zoom"?(ie.moveFn=pt,ie.doneFn=Lt,ie.minDrag=1,Et(Be,Ie,nt)):Ke==="pan"&&(ie.moveFn=mt,ie.doneFn=zt))),G._fullLayout._redrag=function(){var et=G._dragdata;if(et&&et.element===V){var it=G._fullLayout.dragmode;p(it)||(W(),mr([0,0,we,be]),ie.moveFn(et.dx,et.dy))}}};function re(){ie.plotinfo.selection=!1,T(G)}function ke(Be,Ie){var nt=ie.gd;if(nt._fullLayout._activeShapeIndex>=0){nt._fullLayout._deactivateShape(nt);return}var ft=nt._fullLayout.clickmode;if(q(nt),Be===2&&!Ee&&Ct(),De)ft.indexOf("select")>-1&&k(Ie,nt,de,he,J.id,ie),ft.indexOf("event")>-1&&c.click(nt,Ie,J.id);else if(Be===1&&Ee){var Ke=ue?te:$e,et=ue==="s"||Ce==="w"?0:1,it=Ke._name+".range["+et+"]",_t=M(Ke,et),kt="left",qt="middle";if(Ke.fixedrange)return;ue?(qt=ue==="n"?"top":"bottom",Ke.side==="right"&&(kt="right")):Ce==="e"&&(kt="right"),nt._context.showAxisRangeEntryBoxes&&t.select(V).call(l.makeEditable,{gd:nt,immediate:!0,background:nt._fullLayout.paper_bgcolor,text:String(_t),fill:Ke.tickfont?Ke.tickfont.color:"#444",horizontalAlign:kt,verticalAlign:qt}).on("edit",function(Gt){var er=Ke.d2r(Gt);er!==void 0&&n.call("_guiRelayout",nt,it,er)})}}h.init(ie);var _e,ve,Q,Le,ze,Ne,tt,vt,st,at;function Et(Be,Ie,nt){var ft=V.getBoundingClientRect();_e=Ie-ft.left,ve=nt-ft.top,G._fullLayout._calcInverseTransform(G);var Ke=e.apply3DTransform(G._fullLayout._invTransform)(_e,ve);_e=Ke[0],ve=Ke[1],Q={l:_e,r:_e,w:0,t:ve,b:ve,h:0},Le=G._hmpixcount?G._hmlumcount/G._hmpixcount:a(G._fullLayout.plot_bgcolor).getLuminance(),ze="M0,0H"+we+"V"+be+"H0V0",Ne=!1,tt="xy",at=!1,vt=H(ce,Le,Ae,Me,ze),st=B(ce,Ae,Me)}function pt(Be,Ie){if(G._transitioningWithDuration)return!1;var nt=Math.max(0,Math.min(we,Je*Be+_e)),ft=Math.max(0,Math.min(be,F*Ie+ve)),Ke=Math.abs(nt-_e),et=Math.abs(ft-ve);Q.l=Math.min(_e,nt),Q.r=Math.max(_e,nt),Q.t=Math.min(ve,ft),Q.b=Math.max(ve,ft);function it(){tt="",Q.r=Q.l,Q.t=Q.b,st.attr("d","M0,0Z")}if(Ve.isSubplotConstrained)Ke>$||et>$?(tt="xy",Ke/we>et/be?(et=Ke*be/we,ve>ft?Q.t=ve-et:Q.b=ve+et):(Ke=et*we/be,_e>nt?Q.l=_e-Ke:Q.r=_e+Ke),st.attr("d",ee(Q))):it();else if(Fe.isSubplotConstrained)if(Ke>$||et>$){tt="xy";var _t=Math.min(Q.l/we,(be-Q.b)/be),kt=Math.max(Q.r/we,(be-Q.t)/be);Q.l=_t*we,Q.r=kt*we,Q.b=(1-_t)*be,Q.t=(1-kt)*be,st.attr("d",ee(Q))}else it();else!Ge||et<Math.min(Math.max(Ke*.6,D),$)?Ke<D||!Oe?it():(Q.t=0,Q.b=be,tt="x",st.attr("d",Z(Q,ve))):!Oe||Ke<Math.min(et*.6,$)?(Q.l=0,Q.r=we,tt="y",st.attr("d",K(Q,_e))):(tt="xy",st.attr("d",ee(Q)));Q.w=Q.r-Q.l,Q.h=Q.b-Q.t,tt&&(at=!0),G._dragged=at,X(vt,st,Q,ze,Ne,Le),rt(),G.emit("plotly_relayouting",Ue),Ne=!0}function rt(){Ue={},(tt==="xy"||tt==="x")&&(A(de,Q.l/we,Q.r/we,Ue,Ve.xaxes),Mt("x",Ue)),(tt==="xy"||tt==="y")&&(A(he,(be-Q.b)/be,(be-Q.t)/be,Ue,Ve.yaxes),Mt("y",Ue))}function Lt(){rt(),q(G),zt(),U(G)}var bt=[0,0,we,be],dt=null,ct=L.REDRAWDELAY,We=J.mainplot?G._fullLayout._plots[J.mainplot]:J;function Qe(Be){if(!G._context._scrollZoom.cartesian&&!G._fullLayout._enablescrollzoom)return;if(re(),G._transitioningWithDuration){Be.preventDefault(),Be.stopPropagation();return}W(),clearTimeout(dt);var Ie=-Be.deltaY;if(isFinite(Ie)||(Ie=Be.wheelDelta/10),!isFinite(Ie)){e.log("Did not find wheel motion attributes: ",Be);return}var nt=Math.exp(-Math.min(Math.max(Ie,-20),20)/200),ft=We.draglayer.select(".nsewdrag").node().getBoundingClientRect(),Ke=(Be.clientX-ft.left)/ft.width,et=(ft.bottom-Be.clientY)/ft.height,it;function _t(kt,qt,Gt){if(kt.fixedrange)return;var er=e.simpleMap(kt.range,kt.r2l),$r=er[0]+(er[1]-er[0])*qt;function Ot(At){return kt.l2r($r+(At-$r)*Gt)}kt.range=er.map(Ot)}if(xe){for(Ce||(Ke=.5),it=0;it<de.length;it++)_t(de[it],Ke,nt);Mt("x"),bt[2]*=nt,bt[0]+=bt[2]*Ke*(1/nt-1)}if(Ze){for(ue||(et=.5),it=0;it<he.length;it++)_t(he[it],et,nt);Mt("y"),bt[3]*=nt,bt[1]+=bt[3]*(1-et)*(1/nt-1)}mr(bt),qe(),G.emit("plotly_relayouting",Ue),dt=setTimeout(function(){G._fullLayout&&(bt=[0,0,we,be],zt())},ct),Be.preventDefault()}ue.length*Ce.length!==1&&ye(V,Qe);function mt(Be,Ie){if(Be=Be*Je,Ie=Ie*F,G._transitioningWithDuration)return;if(G._fullLayout._replotting=!0,Oe==="ew"||Ge==="ns"){var nt=Oe?-Be:0,ft=Ge?-Ie:0;if(Fe.isSubplotConstrained){if(Oe&&Ge){var Ke=(Be/we-Ie/be)/2;Be=Ke*we,Ie=-Ke*be,nt=-Be,ft=-Ie}Ge?nt=-ft*we/be:ft=-nt*be/we}Oe&&(C(de,Be),Mt("x")),Ge&&(C(he,Ie),Mt("y")),mr([nt,ft,we,be]),qe(),G.emit("plotly_relayouting",Ue);return}function et(Ot,At,Ut){for(var xr=1-At,_r,Sr,Vr=0;Vr<Ot.length;Vr++){var wa=Ot[Vr];if(!wa.fixedrange){_r=wa,Sr=wa._rl[xr]+(wa._rl[At]-wa._rl[xr])/R(Ut/wa._length);var Vo=wa.l2r(Sr);Vo!==!1&&Vo!==void 0&&(wa.range[At]=Vo)}}return _r._length*(_r._rl[At]-Sr)/(_r._rl[At]-_r._rl[xr])}var it=Oe==="w"==(Ge==="n")?1:-1;if(Oe&&Ge&&(Ve.isSubplotConstrained||Fe.isSubplotConstrained)){var _t=(Be/we+it*Ie/be)/2;Be=_t*we,Ie=it*_t*be}var kt,qt;if(Oe==="w"?Be=et(de,0,Be):Oe==="e"?Be=et(de,1,-Be):Oe||(Be=0),Ge==="n"?Ie=et(he,1,Ie):Ge==="s"?Ie=et(he,0,-Ie):Ge||(Ie=0),kt=Oe==="w"?Be:0,qt=Ge==="n"?Ie:0,Ve.isSubplotConstrained&&!Fe.isSubplotConstrained||Fe.isSubplotConstrained&&Oe&&Ge&&it>0){var Gt;if(Fe.isSubplotConstrained||!Oe&&Ge.length===1){for(Gt=0;Gt<de.length;Gt++)de[Gt].range=de[Gt]._r.slice(),S(de[Gt],1-Ie/be);Be=Ie*we/be,kt=Be/2}if(Fe.isSubplotConstrained||!Ge&&Oe.length===1){for(Gt=0;Gt<he.length;Gt++)he[Gt].range=he[Gt]._r.slice(),S(he[Gt],1-Be/we);Ie=Be*be/we,qt=Ie/2}}(!Fe.isSubplotConstrained||!Ge)&&Mt("x"),(!Fe.isSubplotConstrained||!Oe)&&Mt("y");var er=we-Be,$r=be-Ie;Fe.isSubplotConstrained&&!(Oe&&Ge)&&(Oe?(qt=kt?0:Be*be/we,$r=er*be/we):(kt=qt?0:Ie*we/be,er=$r*we/be)),mr([kt,qt,er,$r]),qe(),G.emit("plotly_relayouting",Ue)}function Mt(Be,Ie){for(var nt=Fe.isSubplotConstrained?{x:he,y:de}[Be]:Fe[Be+"axes"],ft=Fe.isSubplotConstrained?{x:de,y:he}[Be]:[],Ke=0;Ke<nt.length;Ke++){var et=nt[Ke],it=et._id,_t=Fe.xLinks[it]||Fe.yLinks[it],kt=ft[0]||Te[_t]||ne[_t];kt&&(Ie?(Ie[et._name+".range[0]"]=Ie[kt._name+".range[0]"],Ie[et._name+".range[1]"]=Ie[kt._name+".range[1]"]):et.range=kt.range.slice())}}function qe(){var Be=[],Ie;function nt(it){for(Ie=0;Ie<it.length;Ie++)it[Ie].fixedrange||Be.push(it[Ie]._id)}function ft(it,_t){for(Ie=0;Ie<it.length;Ie++){var kt=it[Ie],qt=kt[_t];!kt.fixedrange&&qt.tickmode==="sync"&&Be.push(qt._id)}}for(xe&&(nt(de),nt(Ve.xaxes),nt(Fe.xaxes),ft(J.overlays,"xaxis")),Ze&&(nt(he),nt(Ve.yaxes),nt(Fe.yaxes),ft(J.overlays,"yaxis")),Ue={},Ie=0;Ie<Be.length;Ie++){var Ke=Be[Ie],et=x(G,Ke);v.drawOne(G,et,{skipTitle:!0}),Ue[et._name+".range[0]"]=et.range[0],Ue[et._name+".range[1]"]=et.range[1]}v.redrawComponents(G,Be)}function Ct(){if(!G._transitioningWithDuration){var Be=G._context.doubleClick,Ie=[];Oe&&(Ie=Ie.concat(de)),Ge&&(Ie=Ie.concat(he)),Fe.xaxes&&(Ie=Ie.concat(Fe.xaxes)),Fe.yaxes&&(Ie=Ie.concat(Fe.yaxes));var nt={},ft,Ke;if(Be==="reset+autosize")for(Be="autosize",Ke=0;Ke<Ie.length;Ke++){ft=Ie[Ke];var et=ft._rangeInitial0,it=ft._rangeInitial1,_t=et!==void 0||it!==void 0;if(_t&&(et!==void 0&&et!==ft.range[0]||it!==void 0&&it!==ft.range[1])||!_t&&ft.autorange!==!0){Be="reset";break}}if(Be==="autosize")for(Ke=0;Ke<Ie.length;Ke++)ft=Ie[Ke],ft.fixedrange||(nt[ft._name+".autorange"]=!0);else if(Be==="reset"){for((Oe||Ve.isSubplotConstrained)&&(Ie=Ie.concat(Ve.xaxes)),Ge&&!Ve.isSubplotConstrained&&(Ie=Ie.concat(Ve.yaxes)),Ve.isSubplotConstrained&&(Oe?Ge||(Ie=Ie.concat(he)):Ie=Ie.concat(de)),Ke=0;Ke<Ie.length;Ke++)if(ft=Ie[Ke],!ft.fixedrange){var kt=ft._name,qt=ft._autorangeInitial;ft._rangeInitial0===void 0&&ft._rangeInitial1===void 0?nt[kt+".autorange"]=!0:ft._rangeInitial0===void 0?(nt[kt+".autorange"]=qt,nt[kt+".range"]=[null,ft._rangeInitial1]):ft._rangeInitial1===void 0?(nt[kt+".range"]=[ft._rangeInitial0,null],nt[kt+".autorange"]=qt):nt[kt+".range"]=[ft._rangeInitial0,ft._rangeInitial1]}}G.emit("plotly_doubleclick",null),n.call("_guiRelayout",G,nt)}}function zt(){mr([0,0,we,be]),e.syncOrAsync([g.previousPromises,function(){G._fullLayout._replotting=!1,n.call("_guiRelayout",G,Ue)}],G)}function mr(Be){var Ie=G._fullLayout,nt=Ie._plots,ft=Ie._subplots.cartesian,Ke,et,it,_t;if(Ye&&n.subplotsRegistry.splom.drag(G),Xe){for(Ke=0;Ke<ft.length;Ke++)if(et=nt[ft[Ke]],it=et.xaxis,_t=et.yaxis,et._scene){var kt=e.simpleMap(it.range,it.r2l),qt=e.simpleMap(_t.range,_t.r2l);it.limitRange&&it.limitRange(),_t.limitRange&&_t.limitRange(),kt=it.range,qt=_t.range,et._scene.update({range:[kt[0],qt[0],kt[1],qt[1]]})}}if((Ye||Xe)&&(b(G),w(G)),He){var Gt=Be[2]/$e._length,er=Be[3]/te._length;for(Ke=0;Ke<ft.length;Ke++){et=nt[ft[Ke]],it=et.xaxis,_t=et.yaxis;var $r=(xe||Fe.isSubplotConstrained)&&!it.fixedrange&&Te[it._id],Ot=(Ze||Fe.isSubplotConstrained)&&!_t.fixedrange&&ne[_t._id],At,Ut,xr,_r;if($r?(At=Gt,xr=Ce||Fe.isSubplotConstrained?Be[0]:kr(it,At)):Fe.xaHash[it._id]?(At=Gt,xr=Be[0]*it._length/$e._length):Fe.yaHash[it._id]?(At=er,xr=Ge==="ns"?-Be[1]*it._length/te._length:kr(it,At,{n:"top",s:"bottom"}[Ge])):(At=vr(it,Gt,er),xr=Or(it,At)),At>1&&(it.maxallowed!==void 0&&xe===(it.range[0]<it.range[1]?"e":"w")||it.minallowed!==void 0&&xe===(it.range[0]<it.range[1]?"w":"e"))&&(At=1,xr=0),Ot?(Ut=er,_r=ue||Fe.isSubplotConstrained?Be[1]:kr(_t,Ut)):Fe.yaHash[_t._id]?(Ut=er,_r=Be[1]*_t._length/te._length):Fe.xaHash[_t._id]?(Ut=Gt,_r=Oe==="ew"?-Be[0]*_t._length/$e._length:kr(_t,Ut,{e:"right",w:"left"}[Oe])):(Ut=vr(_t,Gt,er),_r=Or(_t,Ut)),Ut>1&&(_t.maxallowed!==void 0&&Ze===(_t.range[0]<_t.range[1]?"n":"s")||_t.minallowed!==void 0&&Ze===(_t.range[0]<_t.range[1]?"s":"n"))&&(Ut=1,_r=0),!(!At&&!Ut)){At||(At=1),Ut||(Ut=1);var Sr=it._offset-xr/At,Vr=_t._offset-_r/Ut;et.clipRect.call(f.setTranslate,xr,_r).call(f.setScale,At,Ut),et.plot.call(f.setTranslate,Sr,Vr).call(f.setScale,1/At,1/Ut),(At!==et.xScaleFactor||Ut!==et.yScaleFactor)&&(f.setPointGroupScale(et.zoomScalePts,At,Ut),f.setTextPointsScale(et.zoomScaleTxt,At,Ut)),f.hideOutsideRangePoints(et.clipOnAxisFalseTraces,et),et.xScaleFactor=At,et.yScaleFactor=Ut}}}}function vr(Be,Ie,nt){return Be.fixedrange?0:xe&&Ve.xaHash[Be._id]?Ie:Ze&&(Ve.isSubplotConstrained?Ve.xaHash:Ve.yaHash)[Be._id]?nt:0}function Or(Be,Ie){return Ie?(Be.range=Be._r.slice(),S(Be,Ie),kr(Be,Ie)):0}function kr(Be,Ie,nt){return Be._length*(1-Ie)*y[nt||Be.constraintoward||"middle"]}return V}function O(G,J,oe,fe){var pe=e.ensureSingle(G.draglayer,J,oe,function(ge){ge.classed("drag",!0).style({fill:"transparent","stroke-width":0}).attr("data-subplot",G.id)});return pe.call(u,fe),pe.node()}function I(G,J,oe,fe,pe,ge,ue){var Ce=O(G,"rect",J,oe);return t.select(Ce).call(f.setRect,fe,pe,ge,ue),Ce}function P(G,J){for(var oe=0;oe<G.length;oe++)if(!G[oe].fixedrange)return J;return""}function M(G,J){var oe=G.range[J],fe=Math.abs(oe-G.range[1-J]),pe;return G.type==="date"?oe:G.type==="log"?(pe=Math.ceil(Math.max(0,-Math.log(fe)/Math.LN10))+3,r("."+pe+"g")(Math.pow(10,oe))):(pe=Math.floor(Math.log(Math.abs(oe))/Math.LN10)-Math.floor(Math.log(fe)/Math.LN10)+4,r("."+String(pe)+"g")(oe))}function A(G,J,oe,fe,pe){for(var ge=0;ge<G.length;ge++){var ue=G[ge];if(!ue.fixedrange)if(ue.rangebreaks){var Ce=ue._id.charAt(0)==="y",ce=Ce?1-J:J,De=Ce?1-oe:oe;fe[ue._name+".range[0]"]=ue.l2r(ue.p2l(ce*ue._length)),fe[ue._name+".range[1]"]=ue.l2r(ue.p2l(De*ue._length))}else{var Ee=ue._rl[0],$e=ue._rl[1]-Ee;fe[ue._name+".range[0]"]=ue.l2r(Ee+$e*J),fe[ue._name+".range[1]"]=ue.l2r(Ee+$e*oe)}}if(pe&&pe.length){var te=(J+(1-oe))/2;A(pe,te,1-te,fe,[])}}function C(G,J){for(var oe=0;oe<G.length;oe++){var fe=G[oe];if(!fe.fixedrange){if(fe.rangebreaks){var pe=0,ge=fe._length,ue=fe.p2l(pe+J)-fe.p2l(pe),Ce=fe.p2l(ge+J)-fe.p2l(ge),ce=(ue+Ce)/2;fe.range=[fe.l2r(fe._rl[0]-ce),fe.l2r(fe._rl[1]-ce)]}else fe.range=[fe.l2r(fe._rl[0]-J/fe._m),fe.l2r(fe._rl[1]-J/fe._m)];fe.limitRange&&fe.limitRange()}}}function R(G){return 1-(G>=0?Math.min(G,.9):1/(1/Math.max(G,-.3)+3.222))}function N(G,J,oe){return G?G==="nsew"?oe?"":J==="pan"?"move":"crosshair":G.toLowerCase()+"-resize":"pointer"}function H(G,J,oe,fe,pe){return G.append("path").attr("class","zoombox").style({fill:J>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform",o(oe,fe)).attr("d",pe+"Z")}function B(G,J,oe){return G.append("path").attr("class","zoombox-corners").style({fill:s.background,stroke:s.defaultLine,"stroke-width":1,opacity:0}).attr("transform",o(J,oe)).attr("d","M0,0Z")}function X(G,J,oe,fe,pe,ge){G.attr("d",fe+"M"+oe.l+","+oe.t+"v"+oe.h+"h"+oe.w+"v-"+oe.h+"h-"+oe.w+"Z"),j(G,J,pe,ge)}function j(G,J,oe,fe){oe||(G.transition().style("fill",fe>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),J.transition().style("opacity",1).duration(200))}function q(G){t.select(G).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function U(G){E&&G.data&&G._context.showTips&&(e.notifier(e._(G,"Double-click to zoom back out"),"long"),E=!1)}function Z(G,J){return"M"+(G.l-.5)+","+(J-$-.5)+"h-3v"+(2*$+1)+"h3ZM"+(G.r+.5)+","+(J-$-.5)+"h3v"+(2*$+1)+"h-3Z"}function K(G,J){return"M"+(J-$-.5)+","+(G.t-.5)+"v-3h"+(2*$+1)+"v3ZM"+(J-$-.5)+","+(G.b+.5)+"v3h"+(2*$+1)+"v-3Z"}function ee(G){var J=Math.floor(Math.min(G.b-G.t,G.r-G.l,$)/2);return"M"+(G.l-3.5)+","+(G.t-.5+J)+"h3v"+-J+"h"+J+"v-3h-"+(J+3)+"ZM"+(G.r+3.5)+","+(G.t-.5+J)+"h-3v"+-J+"h"+-J+"v-3h"+(J+3)+"ZM"+(G.r+3.5)+","+(G.b+.5-J)+"h-3v"+J+"h"+-J+"v3h"+(J+3)+"ZM"+(G.l-3.5)+","+(G.b+.5-J)+"h3v"+J+"h"+J+"v3h-"+(J+3)+"Z"}function le(G,J,oe,fe,pe){for(var ge=!1,ue={},Ce={},ce,De,Ee,$e,te=(pe||{}).xaHash,Te=(pe||{}).yaHash,ne=0;ne<J.length;ne++){var de=J[ne];for(ce in oe)if(de[ce]){for(Ee in de)!(pe&&(te[Ee]||Te[Ee]))&&!(Ee.charAt(0)==="x"?oe:fe)[Ee]&&(ue[Ee]=ce);for(De in fe)!(pe&&(te[De]||Te[De]))&&de[De]&&(ge=!0)}for(De in fe)if(de[De])for($e in de)!(pe&&(te[$e]||Te[$e]))&&!($e.charAt(0)==="x"?oe:fe)[$e]&&(Ce[$e]=De)}ge&&(e.extendFlat(ue,Ce),Ce={});var he={},Ae=[];for(Ee in ue){var Me=x(G,Ee);Ae.push(Me),he[Me._id]=Me}var we={},be=[];for($e in Ce){var Ve=x(G,$e);be.push(Ve),we[Ve._id]=Ve}return{xaHash:he,yaHash:we,xaxes:Ae,yaxes:be,xLinks:ue,yLinks:Ce,isSubplotConstrained:ge}}function ye(G,J){if(!i)G.onwheel!==void 0?G.onwheel=J:G.onmousewheel!==void 0?G.onmousewheel=J:G.isAddedWheelEvent||(G.isAddedWheelEvent=!0,G.addEventListener("wheel",J,{passive:!1}));else{var oe=G.onwheel!==void 0?"wheel":"mousewheel";G._onwheel&&G.removeEventListener(oe,G._onwheel),G._onwheel=J,G.addEventListener(oe,J,{passive:!1})}}function se(G){var J=[];for(var oe in G)J.push(G[oe]);return J}return uv={makeDragBox:z,makeDragger:O,makeRectDragger:I,makeZoombox:H,makeCorners:B,updateZoombox:X,xyCorners:ee,transitionZoombox:j,removeZoombox:q,showDoubleClickNotifier:U,attachWheelEventHandler:ye},uv}var p0;function o2(){return p0||(p0=1,function(t){var e=gt,r=Ia,a=Qa,i=ji,n=MR().makeDragBox,o=Gr.DRAGGERSIZE;t.initInteractions=function(s){var f=s._fullLayout;if(s._context.staticPlot){e.select(s).selectAll(".drag").remove();return}if(!(!f._has("cartesian")&&!f._has("splom"))){var c=Object.keys(f._plots||{}).sort(function(u,h){if((f._plots[u].mainplot&&!0)===(f._plots[h].mainplot&&!0)){var d=u.split("y"),p=h.split("y");return d[0]===p[0]?Number(d[1]||1)-Number(p[1]||1):Number(d[0]||1)-Number(p[0]||1)}return f._plots[u].mainplot?1:-1});c.forEach(function(u){var h=f._plots[u],d=h.xaxis,p=h.yaxis;if(!h.mainplot){var m=n(s,h,d._offset,p._offset,d._length,p._length,"ns","ew");m.onmousemove=function(w){s._fullLayout._rehover=function(){s._fullLayout._hoversubplot===u&&s._fullLayout._plots[u]&&r.hover(s,w,u)},r.hover(s,w,u),s._fullLayout._lasthover=m,s._fullLayout._hoversubplot=u},m.onmouseout=function(w){s._dragging||(s._fullLayout._hoversubplot=null,a.unhover(s,w))},s._context.showAxisDragHandles&&(n(s,h,d._offset-o,p._offset-o,o,o,"n","w"),n(s,h,d._offset+d._length,p._offset-o,o,o,"n","e"),n(s,h,d._offset-o,p._offset+p._length,o,o,"s","w"),n(s,h,d._offset+d._length,p._offset+p._length,o,o,"s","e"))}if(s._context.showAxisDragHandles){if(u===d._mainSubplot){var y=d._mainLinePosition;d.side==="top"&&(y-=o),n(s,h,d._offset+d._length*.1,y,d._length*.8,o,"","ew"),n(s,h,d._offset,y,d._length*.1,o,"","w"),n(s,h,d._offset+d._length*.9,y,d._length*.1,o,"","e")}if(u===p._mainSubplot){var b=p._mainLinePosition;p.side!=="right"&&(b-=o),n(s,h,b,p._offset+p._length*.1,o,p._length*.8,"ns",""),n(s,h,b,p._offset+p._length*.9,o,p._length*.1,"s",""),n(s,h,b,p._offset,o,p._length*.1,"n","")}}});var v=f._hoverlayer.node();v.onmousemove=function(u){u.target=s._fullLayout._lasthover,r.hover(s,u,f._hoversubplot)},v.onclick=function(u){u.target=s._fullLayout._lasthover,r.click(s,u)},v.onmousedown=function(u){s._fullLayout._lasthover.onmousedown(u)},t.updateFx(s)}},t.updateFx=function(l){var s=l._fullLayout,f=s.dragmode==="pan"?"move":"crosshair";i(s._draggers,f)}}(ju)),ju}var ds={},m0=ot,SR=function(e){for(var r=m0.layoutArrayContainers,a=m0.layoutArrayRegexes,i=e.split("[")[0],n,o,l=0;l<a.length;l++)if(o=e.match(a[l]),o&&o.index===0){n=o[0];break}if(n||(n=r[r.indexOf(i)]),!n)return!1;var s=e.substr(n.length);return s?(o=s.match(/^\[(0|[1-9][0-9]*)\](\.(.+))?$/),o?{array:n,index:Number(o[1]),property:o[3]||""}:!1):{array:n,index:"",property:""}},LR=Ro,vv=Eh,ol=Fo,CR=Nh.sorterAsc,dv=ot;ds.containerArrayMatch=SR;var DR=ds.isAddVal=function(e){return e==="add"||LR(e)},y0=ds.isRemoveVal=function(e){return e===null||e==="remove"};ds.applyContainerArrayChanges=function(e,r,a,i,n){var o=r.astr,l=dv.getComponentMethod(o,"supplyLayoutDefaults"),s=dv.getComponentMethod(o,"draw"),f=dv.getComponentMethod(o,"drawOne"),c=i.replot||i.recalc||l===vv||s===vv,v=e.layout,u=e._fullLayout;if(a[""]){Object.keys(a).length>1&&ol.warn("Full array edits are incompatible with other edits",o);var h=a[""][""];if(y0(h))r.set(null);else if(Array.isArray(h))r.set(h);else return ol.warn("Unrecognized full array edit value",o,h),!0;return c?!1:(l(v,u),s(e),!0)}var d=Object.keys(a).map(Number).sort(CR),p=r.get(),m=p||[],y=n(u,o).get(),b=[],w=-1,g=m.length,x,_,T,k,S,L,D,$;for(x=0;x<d.length;x++){if(T=d[x],k=a[T],S=Object.keys(k),L=k[""],D=DR(L),T<0||T>m.length-(D?0:1)){ol.warn("index out of range",o,T);continue}if(L!==void 0)S.length>1&&ol.warn("Insertion & removal are incompatible with edits to the same index.",o,T),y0(L)?b.push(T):D?(L==="add"&&(L={}),m.splice(T,0,L),y&&y.splice(T,0,{})):ol.warn("Unrecognized full object edit value",o,T,L),w===-1&&(w=T);else for(_=0;_<S.length;_++)$=o+"["+T+"].",n(m[T],S[_],$).set(k[S[_]])}for(x=b.length-1;x>=0;x--)m.splice(b[x],1),y&&y.splice(b[x],1);if(m.length?p||r.set(m):r.set(null),c)return!1;if(l(v,u),f!==vv){var E;if(w===-1)E=d;else{for(g=Math.max(m.length,g),E=[],x=0;x<d.length&&(T=d[x],!(T>=w));x++)E.push(T);for(x=w;x<g;x++)E.push(x)}for(x=0;x<E.length;x++)f(e,E[x])}else s(e);return!0};var l2={};(function(t){var e=wt,r=hM,a=ot,i=me,n=cr,o=lr,l=ht,s=o.cleanId,f=o.getFromTrace,c=a.traceIs;t.clearPromiseQueue=function(g){Array.isArray(g._promises)&&g._promises.length>0&&i.log("Clearing previous rejected promises from queue."),g._promises=[]},t.cleanLayout=function(g){var x,_;g||(g={}),g.xaxis1&&(g.xaxis||(g.xaxis=g.xaxis1),delete g.xaxis1),g.yaxis1&&(g.yaxis||(g.yaxis=g.yaxis1),delete g.yaxis1),g.scene1&&(g.scene||(g.scene=g.scene1),delete g.scene1);var T=(n.subplotsRegistry.cartesian||{}).attrRegex,k=(n.subplotsRegistry.polar||{}).attrRegex,S=(n.subplotsRegistry.ternary||{}).attrRegex,L=(n.subplotsRegistry.gl3d||{}).attrRegex,D=Object.keys(g);for(x=0;x<D.length;x++){var $=D[x];if(T&&T.test($)){var E=g[$];E.anchor&&E.anchor!=="free"&&(E.anchor=s(E.anchor)),E.overlaying&&(E.overlaying=s(E.overlaying)),E.type||(E.isdate?E.type="date":E.islog?E.type="log":E.isdate===!1&&E.islog===!1&&(E.type="linear")),(E.autorange==="withzero"||E.autorange==="tozero")&&(E.autorange=!0,E.rangemode="tozero"),E.insiderange&&delete E.range,delete E.islog,delete E.isdate,delete E.categories,m(E,"domain")&&delete E.domain,E.autotick!==void 0&&(E.tickmode===void 0&&(E.tickmode=E.autotick?"auto":"linear"),delete E.autotick),u(E)}else if(k&&k.test($)){var z=g[$];u(z.radialaxis)}else if(S&&S.test($)){var O=g[$];u(O.aaxis),u(O.baxis),u(O.caxis)}else if(L&&L.test($)){var I=g[$],P=I.cameraposition;if(Array.isArray(P)&&P[0].length===4){var M=P[0],A=P[1],C=P[2],R=r([],M),N=[];for(_=0;_<3;++_)N[_]=A[_]+C*R[2+4*_];I.camera={eye:{x:N[0],y:N[1],z:N[2]},center:{x:A[0],y:A[1],z:A[2]},up:{x:0,y:0,z:1}},delete I.cameraposition}u(I.xaxis),u(I.yaxis),u(I.zaxis)}}var H=Array.isArray(g.annotations)?g.annotations.length:0;for(x=0;x<H;x++){var B=g.annotations[x];i.isPlainObject(B)&&(B.ref&&(B.ref==="paper"?(B.xref="paper",B.yref="paper"):B.ref==="data"&&(B.xref="x",B.yref="y"),delete B.ref),v(B,"xref"),v(B,"yref"))}var X=Array.isArray(g.shapes)?g.shapes.length:0;for(x=0;x<X;x++){var j=g.shapes[x];i.isPlainObject(j)&&(v(j,"xref"),v(j,"yref"))}var q=Array.isArray(g.images)?g.images.length:0;for(x=0;x<q;x++){var U=g.images[x];i.isPlainObject(U)&&(v(U,"xref"),v(U,"yref"))}var Z=g.legend;return Z&&(Z.x>3?(Z.x=1.02,Z.xanchor="left"):Z.x<-2&&(Z.x=-.02,Z.xanchor="right"),Z.y>3?(Z.y=1.02,Z.yanchor="bottom"):Z.y<-2&&(Z.y=-.02,Z.yanchor="top")),u(g),g.dragmode==="rotate"&&(g.dragmode="orbit"),l.clean(g),g.template&&g.template.layout&&t.cleanLayout(g.template.layout),g};function v(g,x){var _=g[x],T=x.charAt(0);_&&_!=="paper"&&(g[x]=s(_,T,!0))}function u(g){g&&((typeof g.title=="string"||typeof g.title=="number")&&(g.title={text:g.title}),x("titlefont","font"),x("titleposition","position"),x("titleside","side"),x("titleoffset","offset"));function x(_,T){var k=g[_],S=g.title&&g.title[T];k&&!S&&(g.title||(g.title={}),g.title[T]=g[_],delete g[_])}}t.cleanData=function(g){for(var x=0;x<g.length;x++){var _=g[x],T;if(_.type==="histogramy"&&"xbins"in _&&!("ybins"in _)&&(_.ybins=_.xbins,delete _.xbins),_.error_y&&"opacity"in _.error_y){var k=l.defaults,S=_.error_y.color||(c(_,"bar")?l.defaultLine:k[x%k.length]);_.error_y.color=l.addOpacity(l.rgb(S),l.opacity(S)*_.error_y.opacity),delete _.error_y.opacity}if("bardir"in _&&(_.bardir==="h"&&(c(_,"bar")||_.type.substr(0,9)==="histogram")&&(_.orientation="h",t.swapXYData(_)),delete _.bardir),_.type==="histogramy"&&t.swapXYData(_),(_.type==="histogramx"||_.type==="histogramy")&&(_.type="histogram"),"scl"in _&&!("colorscale"in _)&&(_.colorscale=_.scl,delete _.scl),"reversescl"in _&&!("reversescale"in _)&&(_.reversescale=_.reversescl,delete _.reversescl),_.xaxis&&(_.xaxis=s(_.xaxis,"x")),_.yaxis&&(_.yaxis=s(_.yaxis,"y")),c(_,"gl3d")&&_.scene&&(_.scene=n.subplotsRegistry.gl3d.cleanId(_.scene)),!c(_,"pie-like")&&!c(_,"bar-like"))if(Array.isArray(_.textposition))for(T=0;T<_.textposition.length;T++)_.textposition[T]=p(_.textposition[T]);else _.textposition&&(_.textposition=p(_.textposition));var L=a.getModule(_);if(L&&L.colorbar){var D=L.colorbar.container,$=D?_[D]:_;$&&$.colorscale&&($.colorscale==="YIGnBu"&&($.colorscale="YlGnBu"),$.colorscale==="YIOrRd"&&($.colorscale="YlOrRd"))}if(_.type==="surface"&&i.isPlainObject(_.contours)){var E=["x","y","z"];for(T=0;T<E.length;T++){var z=_.contours[E[T]];i.isPlainObject(z)&&(z.highlightColor&&(z.highlightcolor=z.highlightColor,delete z.highlightColor),z.highlightWidth&&(z.highlightwidth=z.highlightWidth,delete z.highlightWidth))}}if(_.type==="candlestick"||_.type==="ohlc"){var O=(_.increasing||{}).showlegend!==!1,I=(_.decreasing||{}).showlegend!==!1,P=h(_.increasing),M=h(_.decreasing);if(P!==!1&&M!==!1){var A=d(P,M,O,I);A&&(_.name=A)}else(P||M)&&!_.name&&(_.name=P||M)}if(Array.isArray(_.transforms)){var C=_.transforms;for(T=0;T<C.length;T++){var R=C[T];if(i.isPlainObject(R))switch(R.type){case"filter":R.filtersrc&&(R.target=R.filtersrc,delete R.filtersrc),R.calendar&&(R.valuecalendar||(R.valuecalendar=R.calendar),delete R.calendar);break;case"groupby":if(R.styles=R.styles||R.style,R.styles&&!Array.isArray(R.styles)){var N=R.styles,H=Object.keys(N);R.styles=[];for(var B=0;B<H.length;B++)R.styles.push({target:H[B],value:N[H[B]]})}break}}}m(_,"line")&&delete _.line,"marker"in _&&(m(_.marker,"line")&&delete _.marker.line,m(_,"marker")&&delete _.marker),l.clean(_),_.autobinx&&(delete _.autobinx,delete _.xbins),_.autobiny&&(delete _.autobiny,delete _.ybins),u(_),_.colorbar&&u(_.colorbar),_.marker&&_.marker.colorbar&&u(_.marker.colorbar),_.line&&_.line.colorbar&&u(_.line.colorbar),_.aaxis&&u(_.aaxis),_.baxis&&u(_.baxis)}};function h(g){if(!i.isPlainObject(g))return!1;var x=g.name;return delete g.name,delete g.showlegend,(typeof x=="string"||typeof x=="number")&&String(x)}function d(g,x,_,T){if(_&&!T)return g;if(T&&!_||!g.trim())return x;if(!x.trim())return g;var k=Math.min(g.length,x.length),S;for(S=0;S<k&&g.charAt(S)===x.charAt(S);S++);var L=g.substr(0,S);return L.trim()}function p(g){var x="middle",_="center";return typeof g=="string"&&(g.indexOf("top")!==-1?x="top":g.indexOf("bottom")!==-1&&(x="bottom"),g.indexOf("left")!==-1?_="left":g.indexOf("right")!==-1&&(_="right")),x+" "+_}function m(g,x){return x in g&&typeof g[x]=="object"&&Object.keys(g[x]).length===0}t.swapXYData=function(g){var x;if(i.swapAttrs(g,["?","?0","d?","?bins","nbins?","autobin?","?src","error_?"]),Array.isArray(g.z)&&Array.isArray(g.z[0])&&(g.transpose?delete g.transpose:g.transpose=!0),g.error_x&&g.error_y){var _=g.error_y,T="copy_ystyle"in _?_.copy_ystyle:!(_.color||_.thickness||_.width);i.swapAttrs(g,["error_?.copy_ystyle"]),T&&i.swapAttrs(g,["error_?.color","error_?.thickness","error_?.width"])}if(typeof g.hoverinfo=="string"){var k=g.hoverinfo.split("+");for(x=0;x<k.length;x++)k[x]==="x"?k[x]="y":k[x]==="y"&&(k[x]="x");g.hoverinfo=k.join("+")}},t.coerceTraceIndices=function(g,x){if(e(x))return[x];if(!Array.isArray(x)||!x.length)return g.data.map(function(k,S){return S});if(Array.isArray(x)){for(var _=[],T=0;T<x.length;T++)i.isIndex(x[T],g.data.length)?_.push(x[T]):i.warn("trace index (",x[T],") is not a number or is out of bounds");return _}return x},t.manageArrayContainers=function(g,x,_){var T=g.obj,k=g.parts,S=k.length,L=k[S-1],D=e(L);if(D&&x===null){var $=k.slice(0,S-1).join("."),E=i.nestedProperty(T,$).get();E.splice(L,1)}else D&&g.get()===void 0&&g.get()===void 0&&(_[g.astr]=null),g.set(x)};var y=/(\.[^\[\]\.]+|\[[^\[\]\.]+\])$/;function b(g){var x=g.search(y);if(x>0)return g.substr(0,x)}t.hasParent=function(g,x){for(var _=b(x);_;){if(_ in g)return!0;_=b(_)}return!1};var w=["x","y","z"];t.clearAxisTypes=function(g,x,_){for(var T=0;T<x.length;T++)for(var k=g._fullData[T],S=0;S<3;S++){var L=f(g,k,w[S]);if(L&&L.type!=="log"){var D=L._name,$=L._id.substr(1);if($.substr(0,5)==="scene"){if(_[$]!==void 0)continue;D=$+"."+D}var E=D+".type";_[D]===void 0&&_[E]===void 0&&i.nestedProperty(g.layout,E).set(null)}}}})(l2);(function(t){var e=gt,r=wt,a=F1,i=me,n=i.nestedProperty,o=ls,l=ML,s=ot,f=Oo,c=cr,v=Bt,u=jw,h=Za,d=$t,p=ht,m=o2().initInteractions,y=Sn,b=Sl.clearOutline,w=Io.dfltConfig,g=ds,x=l2,_=Xc,T=Ya,k=Gr.AX_NAME_PATTERN,S=0,L=5;function D(F,W,Y,V){var ie;if(F=i.getGraphDiv(F),o.init(F),i.isPlainObject(W)){var re=W;W=re.data,Y=re.layout,V=re.config,ie=re.frames}var ke=o.triggerHandler(F,"plotly_beforeplot",[W,Y,V]);if(ke===!1)return Promise.reject();!W&&!Y&&!i.isPlotDiv(F)&&i.warn("Calling _doPlot as if redrawing but this container doesn't yet have a plot.",F);function _e(){if(ie)return t.addFrames(F,ie)}I(F,V),Y||(Y={}),e.select(F).classed("js-plotly-plot",!0),d.makeTester(),Array.isArray(F._promises)||(F._promises=[]);var ve=(F.data||[]).length===0&&Array.isArray(W);Array.isArray(W)&&(x.cleanData(W),ve?F.data=W:F.data.push.apply(F.data,W),F.empty=!1),(!F.layout||ve)&&(F.layout=x.cleanLayout(Y)),c.supplyDefaults(F);var Q=F._fullLayout,Le=Q._has("cartesian");Q._replotting=!0,(ve||Q._shouldCreateBgLayer)&&(Je(F),Q._shouldCreateBgLayer&&delete Q._shouldCreateBgLayer),d.initGradients(F),d.initPatterns(F),ve&&v.saveShowSpikeInitial(F);var ze=!F.calcdata||F.calcdata.length!==(F._fullData||[]).length;ze&&c.doCalcdata(F);for(var Ne=0;Ne<F.calcdata.length;Ne++)F.calcdata[Ne][0].trace=F._fullData[Ne];F._context.responsive?F._responsiveChartHandler||(F._responsiveChartHandler=function(){i.isHidden(F)||c.resize(F)},window.addEventListener("resize",F._responsiveChartHandler)):i.clearResponsive(F);var tt=i.extendFlat({},Q._size),vt=0;function st(){for(var ct=Q._basePlotModules,We=0;We<ct.length;We++)ct[We].drawFramework&&ct[We].drawFramework(F);!Q._glcanvas&&Q._has("gl")&&(Q._glcanvas=Q._glcontainer.selectAll(".gl-canvas").data([{key:"contextLayer",context:!0,pick:!1},{key:"focusLayer",context:!1,pick:!1},{key:"pickLayer",context:!1,pick:!0}],function(qe){return qe.key}),Q._glcanvas.enter().append("canvas").attr("class",function(qe){return"gl-canvas gl-canvas-"+qe.key.replace("Layer","")}).style({position:"absolute",top:0,left:0,overflow:"visible","pointer-events":"none"}));var Qe=F._context.plotGlPixelRatio;if(Q._glcanvas){Q._glcanvas.attr("width",Q.width*Qe).attr("height",Q.height*Qe).style("width",Q.width+"px").style("height",Q.height+"px");var mt=Q._glcanvas.data()[0].regl;if(mt&&(Math.floor(Q.width*Qe)!==mt._gl.drawingBufferWidth||Math.floor(Q.height*Qe)!==mt._gl.drawingBufferHeight)){var Mt="WebGL context buffer and canvas dimensions do not match due to browser/WebGL bug.";if(vt)i.error(Mt);else return i.log(Mt+" Clearing graph and plotting again."),c.cleanPlot([],{},F._fullData,Q),c.supplyDefaults(F),Q=F._fullLayout,c.doCalcdata(F),vt++,st()}}return Q.modebar.orientation==="h"?Q._modebardiv.style("height",null).style("width","100%"):Q._modebardiv.style("width",null).style("height",Q.height+"px"),c.previousPromises(F)}function at(){if(c.clearAutoMarginIds(F),_.drawMarginPushers(F),v.allowAutoMargin(F),F._fullLayout.title.text&&F._fullLayout.title.automargin&&c.allowAutoMargin(F,"title.automargin"),Q._has("pie"))for(var ct=F._fullData,We=0;We<ct.length;We++){var Qe=ct[We];Qe.type==="pie"&&Qe.automargin&&c.allowAutoMargin(F,"pie."+Qe.uid+".automargin")}return c.doAutoMargin(F),c.previousPromises(F)}function Et(){if(c.didMarginChange(tt,Q._size))return i.syncOrAsync([at,_.layoutStyles],F)}function pt(){if(!ze){rt();return}return i.syncOrAsync([s.getComponentMethod("shapes","calcAutorange"),s.getComponentMethod("annotations","calcAutorange"),rt],F)}function rt(){F._transitioning||(_.doAutoRangeAndConstraints(F),ve&&v.saveRangeInitial(F),s.getComponentMethod("rangeslider","calcAutorange")(F))}function Lt(){return v.draw(F,ve?"":"redraw")}var bt=[c.previousPromises,_e,st,at,Et];Le&&bt.push(pt),bt.push(_.layoutStyles),Le&&bt.push(Lt,function(We){var Qe=We._fullLayout._insideTickLabelsUpdaterange;if(Qe)return We._fullLayout._insideTickLabelsUpdaterange=void 0,pe(We,Qe).then(function(){v.saveRangeInitial(We,!0)})}),bt.push(_.drawData,_.finalDraw,m,c.addLinks,c.rehover,c.redrag,c.reselect,c.doAutoMargin,c.previousPromises);var dt=i.syncOrAsync(bt,F);return(!dt||!dt.then)&&(dt=Promise.resolve()),dt.then(function(){return $(F),F})}function $(F){var W=F._fullLayout;W._redrawFromAutoMarginCount?W._redrawFromAutoMarginCount--:F.emit("plotly_afterplot")}function E(F){return i.extendFlat(w,F)}function z(F,W){try{F._fullLayout._paper.style("background",W)}catch(Y){i.error(Y)}}function O(F,W){var Y=p.combine(W,"white");z(F,Y)}function I(F,W){if(!F._context){F._context=i.extendDeep({},w);var Y=e.select("base");F._context._baseUrl=Y.size()&&Y.attr("href")?window.location.href.split("#")[0]:""}var V=F._context,ie,re,ke;if(W){for(re=Object.keys(W),ie=0;ie<re.length;ie++)ke=re[ie],!(ke==="editable"||ke==="edits")&&ke in V&&(ke==="setBackground"&&W[ke]==="opaque"?V[ke]=O:V[ke]=W[ke]);W.plot3dPixelRatio&&!V.plotGlPixelRatio&&(V.plotGlPixelRatio=V.plot3dPixelRatio);var _e=W.editable;if(_e!==void 0)for(V.editable=_e,re=Object.keys(V.edits),ie=0;ie<re.length;ie++)V.edits[re[ie]]=_e;if(W.edits)for(re=Object.keys(W.edits),ie=0;ie<re.length;ie++)ke=re[ie],ke in V.edits&&(V.edits[ke]=W.edits[ke]);V._exportedPlot=W._exportedPlot}V.staticPlot&&(V.editable=!1,V.edits={},V.autosizable=!1,V.scrollZoom=!1,V.doubleClick=!1,V.showTips=!1,V.showLink=!1,V.displayModeBar=!1),V.displayModeBar==="hover"&&!a&&(V.displayModeBar=!0),(V.setBackground==="transparent"||typeof V.setBackground!="function")&&(V.setBackground=z),V._hasZeroHeight=V._hasZeroHeight||F.clientHeight===0,V._hasZeroWidth=V._hasZeroWidth||F.clientWidth===0;var ve=V.scrollZoom,Q=V._scrollZoom={};if(ve===!0)Q.cartesian=1,Q.gl3d=1,Q.geo=1,Q.mapbox=1;else if(typeof ve=="string"){var Le=ve.split("+");for(ie=0;ie<Le.length;ie++)Q[Le[ie]]=1}else ve!==!1&&(Q.gl3d=1,Q.geo=1,Q.mapbox=1)}function P(F){if(F=i.getGraphDiv(F),!i.isPlotDiv(F))throw new Error("This element is not a Plotly plot: "+F);return x.cleanData(F.data),x.cleanLayout(F.layout),F.calcdata=void 0,t._doPlot(F).then(function(){return F.emit("plotly_redraw"),F})}function M(F,W,Y,V){return F=i.getGraphDiv(F),c.cleanPlot([],{},F._fullData||[],F._fullLayout||{}),c.purge(F),t._doPlot(F,W,Y,V)}function A(F,W){var Y=W+1,V=[],ie,re;for(ie=0;ie<F.length;ie++)re=F[ie],re<0?V.push(Y+re):V.push(re);return V}function C(F,W,Y){var V,ie;for(V=0;V<W.length;V++){if(ie=W[V],ie!==parseInt(ie,10))throw new Error("all values in "+Y+" must be integers");if(ie>=F.data.length||ie<-F.data.length)throw new Error(Y+" must be valid indices for gd.data.");if(W.indexOf(ie,V+1)>-1||ie>=0&&W.indexOf(-F.data.length+ie)>-1||ie<0&&W.indexOf(F.data.length+ie)>-1)throw new Error("each index in "+Y+" must be unique.")}}function R(F,W,Y){if(!Array.isArray(F.data))throw new Error("gd.data must be an array.");if(typeof W>"u")throw new Error("currentIndices is a required argument.");if(Array.isArray(W)||(W=[W]),C(F,W,"currentIndices"),typeof Y<"u"&&!Array.isArray(Y)&&(Y=[Y]),typeof Y<"u"&&C(F,Y,"newIndices"),typeof Y<"u"&&W.length!==Y.length)throw new Error("current and new indices must be of equal length.")}function N(F,W,Y){var V,ie;if(!Array.isArray(F.data))throw new Error("gd.data must be an array.");if(typeof W>"u")throw new Error("traces must be defined.");for(Array.isArray(W)||(W=[W]),V=0;V<W.length;V++)if(ie=W[V],typeof ie!="object"||Array.isArray(ie)||ie===null)throw new Error("all values in traces array must be non-array objects");if(typeof Y<"u"&&!Array.isArray(Y)&&(Y=[Y]),typeof Y<"u"&&Y.length!==W.length)throw new Error("if indices is specified, traces.length must equal indices.length")}function H(F,W,Y,V){var ie=i.isPlainObject(V);if(!Array.isArray(F.data))throw new Error("gd.data must be an array");if(!i.isPlainObject(W))throw new Error("update must be a key:value object");if(typeof Y>"u")throw new Error("indices must be an integer or array of integers");C(F,Y,"indices");for(var re in W){if(!Array.isArray(W[re])||W[re].length!==Y.length)throw new Error("attribute "+re+" must be an array of length equal to indices array length");if(ie&&(!(re in V)||!Array.isArray(V[re])||V[re].length!==W[re].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 B(F,W,Y,V){var ie=i.isPlainObject(V),re=[],ke,_e,ve,Q,Le;Array.isArray(Y)||(Y=[Y]),Y=A(Y,F.data.length-1);for(var ze in W)for(var Ne=0;Ne<Y.length;Ne++){if(ke=F.data[Y[Ne]],ve=n(ke,ze),_e=ve.get(),Q=W[ze][Ne],!i.isArrayOrTypedArray(Q))throw new Error("attribute: "+ze+" index: "+Ne+" must be an array");if(!i.isArrayOrTypedArray(_e))throw new Error("cannot extend missing or non-array attribute: "+ze);if(_e.constructor!==Q.constructor)throw new Error("cannot extend array with an array of a different type: "+ze);Le=ie?V[ze][Ne]:V,r(Le)||(Le=-1),re.push({prop:ve,target:_e,insert:Q,maxp:Math.floor(Le)})}return re}function X(F,W,Y,V,ie){H(F,W,Y,V);for(var re=B(F,W,Y,V),ke={},_e={},ve=0;ve<re.length;ve++){var Q=re[ve].prop,Le=re[ve].maxp,ze=ie(re[ve].target,re[ve].insert,Le);Q.set(ze[0]),Array.isArray(ke[Q.astr])||(ke[Q.astr]=[]),ke[Q.astr].push(ze[1]),Array.isArray(_e[Q.astr])||(_e[Q.astr]=[]),_e[Q.astr].push(re[ve].target.length)}return{update:ke,maxPoints:_e}}function j(F,W){var Y=new F.constructor(F.length+W.length);return Y.set(F),Y.set(W,F.length),Y}function q(F,W,Y,V){F=i.getGraphDiv(F);function ie(ve,Q,Le){var ze,Ne;if(i.isTypedArray(ve))if(Le<0){var tt=new ve.constructor(0),vt=j(ve,Q);Le<0?(ze=vt,Ne=tt):(ze=tt,Ne=vt)}else if(ze=new ve.constructor(Le),Ne=new ve.constructor(ve.length+Q.length-Le),Le===Q.length)ze.set(Q),Ne.set(ve);else if(Le<Q.length){var st=Q.length-Le;ze.set(Q.subarray(st)),Ne.set(ve),Ne.set(Q.subarray(0,st),ve.length)}else{var at=Le-Q.length,Et=ve.length-at;ze.set(ve.subarray(Et)),ze.set(Q,at),Ne.set(ve.subarray(0,Et))}else ze=ve.concat(Q),Ne=Le>=0&&Le<ze.length?ze.splice(0,ze.length-Le):[];return[ze,Ne]}var re=X(F,W,Y,V,ie),ke=t.redraw(F),_e=[F,re.update,Y,re.maxPoints];return l.add(F,t.prependTraces,_e,q,arguments),ke}function U(F,W,Y,V){F=i.getGraphDiv(F);function ie(ve,Q,Le){var ze,Ne;if(i.isTypedArray(ve))if(Le<=0){var tt=new ve.constructor(0),vt=j(Q,ve);Le<0?(ze=vt,Ne=tt):(ze=tt,Ne=vt)}else if(ze=new ve.constructor(Le),Ne=new ve.constructor(ve.length+Q.length-Le),Le===Q.length)ze.set(Q),Ne.set(ve);else if(Le<Q.length){var st=Q.length-Le;ze.set(Q.subarray(0,st)),Ne.set(Q.subarray(st)),Ne.set(ve,st)}else{var at=Le-Q.length;ze.set(Q),ze.set(ve.subarray(0,at),Q.length),Ne.set(ve.subarray(at))}else ze=Q.concat(ve),Ne=Le>=0&&Le<ze.length?ze.splice(Le,ze.length):[];return[ze,Ne]}var re=X(F,W,Y,V,ie),ke=t.redraw(F),_e=[F,re.update,Y,re.maxPoints];return l.add(F,t.extendTraces,_e,U,arguments),ke}function Z(F,W,Y){F=i.getGraphDiv(F);var V=[],ie=t.deleteTraces,re=Z,ke=[F,V],_e=[F,W],ve,Q;for(N(F,W,Y),Array.isArray(W)||(W=[W]),W=W.map(function(Le){return i.extendFlat({},Le)}),x.cleanData(W),ve=0;ve<W.length;ve++)F.data.push(W[ve]);for(ve=0;ve<W.length;ve++)V.push(-W.length+ve);if(typeof Y>"u")return Q=t.redraw(F),l.add(F,ie,ke,re,_e),Q;Array.isArray(Y)||(Y=[Y]);try{R(F,V,Y)}catch(Le){throw F.data.splice(F.data.length-W.length,W.length),Le}return l.startSequence(F),l.add(F,ie,ke,re,_e),Q=t.moveTraces(F,V,Y),l.stopSequence(F),Q}function K(F,W){F=i.getGraphDiv(F);var Y=[],V=t.addTraces,ie=K,re=[F,Y,W],ke=[F,W],_e,ve;if(typeof W>"u")throw new Error("indices must be an integer or array of integers.");for(Array.isArray(W)||(W=[W]),C(F,W,"indices"),W=A(W,F.data.length-1),W.sort(i.sorterDes),_e=0;_e<W.length;_e+=1)ve=F.data.splice(W[_e],1)[0],Y.push(ve);var Q=t.redraw(F);return l.add(F,V,re,ie,ke),Q}function ee(F,W,Y){F=i.getGraphDiv(F);var V=[],ie=[],re=ee,ke=ee,_e=[F,Y,W],ve=[F,W,Y],Q;if(R(F,W,Y),W=Array.isArray(W)?W:[W],typeof Y>"u")for(Y=[],Q=0;Q<W.length;Q++)Y.push(-W.length+Q);for(Y=Array.isArray(Y)?Y:[Y],W=A(W,F.data.length-1),Y=A(Y,F.data.length-1),Q=0;Q<F.data.length;Q++)W.indexOf(Q)===-1&&V.push(F.data[Q]);for(Q=0;Q<W.length;Q++)ie.push({newIndex:Y[Q],trace:F.data[W[Q]]});for(ie.sort(function(ze,Ne){return ze.newIndex-Ne.newIndex}),Q=0;Q<ie.length;Q+=1)V.splice(ie[Q].newIndex,0,ie[Q].trace);F.data=V;var Le=t.redraw(F);return l.add(F,re,_e,ke,ve),Le}function le(F,W,Y,V){F=i.getGraphDiv(F),x.clearPromiseQueue(F);var ie={};if(typeof W=="string")ie[W]=Y;else if(i.isPlainObject(W))ie=i.extendFlat({},W),V===void 0&&(V=Y);else return i.warn("Restyle fail.",W,Y,V),Promise.reject();Object.keys(ie).length&&(F.changed=!0);var re=x.coerceTraceIndices(F,V),ke=oe(F,ie,re),_e=ke.flags;_e.calc&&(F.calcdata=void 0),_e.clearAxisTypes&&x.clearAxisTypes(F,re,{});var ve=[];_e.fullReplot?ve.push(t._doPlot):(ve.push(c.previousPromises),c.supplyDefaults(F),_e.markerSize&&(c.doCalcdata(F),ue(ve)),_e.style&&ve.push(_.doTraceStyle),_e.colorbars&&ve.push(_.doColorBars),ve.push($)),ve.push(c.rehover,c.redrag,c.reselect),l.add(F,le,[F,ke.undoit,ke.traces],le,[F,ke.redoit,ke.traces]);var Q=i.syncOrAsync(ve,F);return(!Q||!Q.then)&&(Q=Promise.resolve()),Q.then(function(){return F.emit("plotly_restyle",ke.eventData),F})}function ye(F){return F===void 0?null:F}function se(F,W){return W?function(Y,V,ie){var re=n(Y,V),ke=re.set;return re.set=function(_e){var ve=(ie||"")+V;G(ve,re.get(),_e,F),ke(_e)},re}:n}function G(F,W,Y,V){if(Array.isArray(W)||Array.isArray(Y))for(var ie=Array.isArray(W)?W:[],re=Array.isArray(Y)?Y:[],ke=Math.max(ie.length,re.length),_e=0;_e<ke;_e++)G(F+"["+_e+"]",ie[_e],re[_e],V);else if(i.isPlainObject(W)||i.isPlainObject(Y)){var ve=i.isPlainObject(W)?W:{},Q=i.isPlainObject(Y)?Y:{},Le=i.extendFlat({},ve,Q);for(var ze in Le)G(F+"."+ze,ve[ze],Q[ze],V)}else V[F]===void 0&&(V[F]=ye(W))}function J(F,W,Y){for(var V in Y){var ie=n(F,V);G(V,ie.get(),Y[V],W)}}function oe(F,W,Y){var V=F._fullLayout,ie=F._fullData,re=F.data,ke=V._guiEditing,_e=se(V._preGUI,ke),ve=i.extendDeepAll({},W),Q;fe(W);var Le=T.traceFlags(),ze={},Ne={},tt;function vt(){return Y.map(function(){})}function st(Ot){var At=v.id2name(Ot);tt.indexOf(At)===-1&&tt.push(At)}function at(Ot){return"LAYOUT"+Ot+".autorange"}function Et(Ot){return"LAYOUT"+Ot+".range"}function pt(Ot){for(var At=Ot;At<ie.length;At++)if(ie[At]._input===re[Ot])return ie[At]}function rt(Ot,At,Ut){if(Array.isArray(Ot)){Ot.forEach(function(Vr){rt(Vr,At,Ut)});return}if(!(Ot in W||x.hasParent(W,Ot))){var xr;if(Ot.substr(0,6)==="LAYOUT")xr=_e(F.layout,Ot.replace("LAYOUT",""));else{var _r=Y[Ut],Sr=V._tracePreGUI[pt(_r)._fullInput.uid];xr=se(Sr,ke)(re[_r],Ot)}Ot in Ne||(Ne[Ot]=vt()),Ne[Ot][Ut]===void 0&&(Ne[Ot][Ut]=ye(xr.get())),At!==void 0&&xr.set(At)}}function Lt(Ot){return function(At){return ie[At][Ot]}}function bt(Ot){return function(At,Ut){return At===!1?ie[Y[Ut]][Ot]:null}}for(var dt in W){if(x.hasParent(W,dt))throw new Error("cannot set "+dt+" and a parent attribute simultaneously");var ct=W[dt],We,Qe,mt,Mt,qe,Ct;if((dt==="autobinx"||dt==="autobiny")&&(dt=dt.charAt(dt.length-1)+"bins",Array.isArray(ct)?ct=ct.map(bt(dt)):ct===!1?ct=Y.map(Lt(dt)):ct=null),ze[dt]=ct,dt.substr(0,6)==="LAYOUT"){mt=_e(F.layout,dt.replace("LAYOUT","")),Ne[dt]=[ye(mt.get())],mt.set(Array.isArray(ct)?ct[0]:ct),Le.calc=!0;continue}for(Ne[dt]=vt(),Q=0;Q<Y.length;Q++){We=re[Y[Q]],Qe=pt(Y[Q]);var zt=V._tracePreGUI[Qe._fullInput.uid];if(mt=se(zt,ke)(We,dt),Mt=mt.get(),qe=Array.isArray(ct)?ct[Q%ct.length]:ct,qe!==void 0){var mr=mt.parts[mt.parts.length-1],vr=dt.substr(0,dt.length-mr.length-1),Or=vr?vr+".":"",kr=vr?n(Qe,vr).get():Qe;if(Ct=f.getTraceValObject(Qe,mt.parts),Ct&&Ct.impliedEdits&&qe!==null)for(var Be in Ct.impliedEdits)rt(i.relativeAttr(dt,Be),Ct.impliedEdits[Be],Q);else if((mr==="thicknessmode"||mr==="lenmode")&&Mt!==qe&&(qe==="fraction"||qe==="pixels")&&kr){var Ie=V._size,nt=kr.orient,ft=nt==="top"||nt==="bottom";if(mr==="thicknessmode"){var Ke=ft?Ie.h:Ie.w;rt(Or+"thickness",kr.thickness*(qe==="fraction"?1/Ke:Ke),Q)}else{var et=ft?Ie.w:Ie.h;rt(Or+"len",kr.len*(qe==="fraction"?1/et:et),Q)}}else if(dt==="type"&&(qe==="pie"!=(Mt==="pie")||qe==="funnelarea"!=(Mt==="funnelarea"))){var it="x",_t="y";(qe==="bar"||Mt==="bar")&&We.orientation==="h"&&(it="y",_t="x"),i.swapAttrs(We,["?","?src"],"labels",it),i.swapAttrs(We,["d?","?0"],"label",it),i.swapAttrs(We,["?","?src"],"values",_t),Mt==="pie"||Mt==="funnelarea"?(n(We,"marker.color").set(n(We,"marker.colors").get()),V._pielayer.selectAll("g.trace").remove()):s.traceIs(We,"cartesian")&&n(We,"marker.colors").set(n(We,"marker.color").get())}Ne[dt][Q]=ye(Mt);var kt=["swapxy","swapxyaxes","orientation","orientationaxes"];if(kt.indexOf(dt)!==-1){if(dt==="orientation"){mt.set(qe);var qt=We.x&&!We.y?"h":"v";if((mt.get()||qt)===Qe.orientation)continue}else dt==="orientationaxes"&&(We.orientation={v:"h",h:"v"}[Qe.orientation]);x.swapXYData(We),Le.calc=Le.clearAxisTypes=!0}else c.dataArrayContainers.indexOf(mt.parts[0])!==-1?(x.manageArrayContainers(mt,qe,Ne),Le.calc=!0):(Ct?Ct.arrayOk&&!s.traceIs(Qe,"regl")&&(i.isArrayOrTypedArray(qe)||i.isArrayOrTypedArray(Mt))?Le.calc=!0:T.update(Le,Ct):Le.calc=!0,mt.set(qe))}}if(["swapxyaxes","orientationaxes"].indexOf(dt)!==-1&&v.swap(F,Y),dt==="orientationaxes"){var Gt=n(F.layout,"hovermode"),er=Gt.get();er==="x"?Gt.set("y"):er==="y"?Gt.set("x"):er==="x unified"?Gt.set("y unified"):er==="y unified"&&Gt.set("x unified")}if(["orientation","type"].indexOf(dt)!==-1){for(tt=[],Q=0;Q<Y.length;Q++){var $r=re[Y[Q]];s.traceIs($r,"cartesian")&&(st($r.xaxis||"x"),st($r.yaxis||"y"))}rt(tt.map(at),!0,0),rt(tt.map(Et),[0,1],0)}}return(Le.calc||Le.plot)&&(Le.fullReplot=!0),{flags:Le,undoit:Ne,redoit:ze,traces:Y,eventData:i.extendDeepNoArrays([],[ve,Y])}}function fe(F){var W=i.counterRegex("axis",".title",!1,!1),Y=/colorbar\.title$/,V=Object.keys(F),ie,re,ke;for(ie=0;ie<V.length;ie++)re=V[ie],ke=F[re],(re==="title"||W.test(re)||Y.test(re))&&(typeof ke=="string"||typeof ke=="number")?_e(re,re.replace("title","title.text")):re.indexOf("titlefont")>-1&&re.indexOf("grouptitlefont")===-1?_e(re,re.replace("titlefont","title.font")):re.indexOf("titleposition")>-1?_e(re,re.replace("titleposition","title.position")):re.indexOf("titleside")>-1?_e(re,re.replace("titleside","title.side")):re.indexOf("titleoffset")>-1&&_e(re,re.replace("titleoffset","title.offset"));function _e(ve,Q){F[Q]=F[ve],delete F[ve]}}function pe(F,W,Y){F=i.getGraphDiv(F),x.clearPromiseQueue(F);var V={};if(typeof W=="string")V[W]=Y;else if(i.isPlainObject(W))V=i.extendFlat({},W);else return i.warn("Relayout fail.",W,Y),Promise.reject();Object.keys(V).length&&(F.changed=!0);var ie=Ee(F,V),re=ie.flags;re.calc&&(F.calcdata=void 0);var ke=[c.previousPromises];re.layoutReplot?ke.push(_.layoutReplot):Object.keys(V).length&&(ge(F,re,ie)||c.supplyDefaults(F),re.legend&&ke.push(_.doLegend),re.layoutstyle&&ke.push(_.layoutStyles),re.axrange&&ue(ke,ie.rangesAltered),re.ticks&&ke.push(_.doTicksRelayout),re.modebar&&ke.push(_.doModeBar),re.camera&&ke.push(_.doCamera),re.colorbars&&ke.push(_.doColorBars),ke.push($)),ke.push(c.rehover,c.redrag,c.reselect),l.add(F,pe,[F,ie.undoit],pe,[F,ie.redoit]);var _e=i.syncOrAsync(ke,F);return(!_e||!_e.then)&&(_e=Promise.resolve(F)),_e.then(function(){return F.emit("plotly_relayout",ie.eventData),F})}function ge(F,W,Y){var V=F._fullLayout;if(!W.axrange)return!1;for(var ie in W)if(ie!=="axrange"&&W[ie])return!1;var re,ke,_e=function(tt,vt){return i.coerce(re,ke,h,tt,vt)},ve={};for(var Q in Y.rangesAltered){var Le=v.id2name(Q);if(re=F.layout[Le],ke=V[Le],u(re,ke,_e,ve),ke._matchGroup){for(var ze in ke._matchGroup)if(ze!==Q){var Ne=V[v.id2name(ze)];Ne.autorange=ke.autorange,Ne.range=ke.range.slice(),Ne._input.range=ke.range.slice()}}}return!0}function ue(F,W){var Y=W?function(V){var ie=[],re=!0;for(var ke in W){var _e=v.getFromId(V,ke);if(ie.push(ke),(_e.ticklabelposition||"").indexOf("inside")!==-1&&_e._anchorAxis&&ie.push(_e._anchorAxis._id),_e._matchGroup)for(var ve in _e._matchGroup)W[ve]||ie.push(ve)}return v.draw(V,ie,{skipTitle:re})}:function(V){return v.draw(V,"redraw")};F.push(b,_.doAutoRangeAndConstraints,Y,_.drawData,_.finalDraw)}var Ce=/^[xyz]axis[0-9]*\.range(\[[0|1]\])?$/,ce=/^[xyz]axis[0-9]*\.autorange$/,De=/^[xyz]axis[0-9]*\.domain(\[[0|1]\])?$/;function Ee(F,W){var Y=F.layout,V=F._fullLayout,ie=V._guiEditing,re=se(V._preGUI,ie),ke=Object.keys(W),_e=v.list(F),ve=i.extendDeepAll({},W),Q={},Le,ze,Ne;for(fe(W),ke=Object.keys(W),ze=0;ze<ke.length;ze++)if(ke[ze].indexOf("allaxes")===0){for(Ne=0;Ne<_e.length;Ne++){var tt=_e[Ne]._id.substr(1),vt=tt.indexOf("scene")!==-1?tt+".":"",st=ke[ze].replace("allaxes",vt+_e[Ne]._name);W[st]||(W[st]=W[ke[ze]])}delete W[ke[ze]]}var at=T.layoutFlags(),Et={},pt={};function rt(Sr,Vr){if(Array.isArray(Sr)){Sr.forEach(function(Vo){rt(Vo,Vr)});return}if(!(Sr in W||x.hasParent(W,Sr))){var wa=re(Y,Sr);Sr in pt||(pt[Sr]=ye(wa.get())),Vr!==void 0&&wa.set(Vr)}}var Lt={},bt;function dt(Sr){var Vr=v.name2id(Sr.split(".")[0]);return Lt[Vr]=1,Vr}for(var ct in W){if(x.hasParent(W,ct))throw new Error("cannot set "+ct+" and a parent attribute simultaneously");for(var We=re(Y,ct),Qe=W[ct],mt=We.parts.length,Mt=mt-1;Mt>0&&typeof We.parts[Mt]!="string";)Mt--;var qe=We.parts[Mt],Ct=We.parts[Mt-1]+"."+qe,zt=We.parts.slice(0,Mt).join("."),mr=n(F.layout,zt).get(),vr=n(V,zt).get(),Or=We.get();if(Qe!==void 0){Et[ct]=Qe,pt[ct]=qe==="reverse"?Qe:ye(Or);var kr=f.getLayoutValObject(V,We.parts);if(kr&&kr.impliedEdits&&Qe!==null)for(var Be in kr.impliedEdits)rt(i.relativeAttr(ct,Be),kr.impliedEdits[Be]);if(["width","height"].indexOf(ct)!==-1)if(Qe){rt("autosize",null);var Ie=ct==="height"?"width":"height";rt(Ie,V[Ie])}else V[ct]=F._initialAutoSize[ct];else if(ct==="autosize")rt("width",Qe?null:V.width),rt("height",Qe?null:V.height);else if(Ct.match(Ce))dt(Ct),n(V,zt+"._inputRange").set(null);else if(Ct.match(ce)){dt(Ct),n(V,zt+"._inputRange").set(null);var nt=n(V,zt).get();nt._inputDomain&&(nt._input.domain=nt._inputDomain.slice())}else Ct.match(De)&&n(V,zt+"._inputDomain").set(null);if(qe==="type"){bt=mr;var ft=vr.type==="linear"&&Qe==="log",Ke=vr.type==="log"&&Qe==="linear";if(ft||Ke){if(!bt||!bt.range)rt(zt+".autorange",!0);else if(vr.autorange)ft&&(bt.range=bt.range[1]>bt.range[0]?[1,2]:[2,1]);else{var et=bt.range[0],it=bt.range[1];ft?(et<=0&&it<=0&&rt(zt+".autorange",!0),et<=0?et=it/1e6:it<=0&&(it=et/1e6),rt(zt+".range[0]",Math.log(et)/Math.LN10),rt(zt+".range[1]",Math.log(it)/Math.LN10)):(rt(zt+".range[0]",Math.pow(10,et)),rt(zt+".range[1]",Math.pow(10,it)))}Array.isArray(V._subplots.polar)&&V._subplots.polar.length&&V[We.parts[0]]&&We.parts[1]==="radialaxis"&&delete V[We.parts[0]]._subplot.viewInitial["radialaxis.range"],s.getComponentMethod("annotations","convertCoords")(F,vr,Qe,rt),s.getComponentMethod("images","convertCoords")(F,vr,Qe,rt)}else rt(zt+".autorange",!0),rt(zt+".range",null);n(V,zt+"._inputRange").set(null)}else if(qe.match(k)){var _t=n(V,ct).get(),kt=(Qe||{}).type;(!kt||kt==="-")&&(kt="linear"),s.getComponentMethod("annotations","convertCoords")(F,_t,kt,rt),s.getComponentMethod("images","convertCoords")(F,_t,kt,rt)}var qt=g.containerArrayMatch(ct);if(qt){Le=qt.array,ze=qt.index;var Gt=qt.property,er=kr||{editType:"calc"};ze!==""&&Gt===""&&(g.isAddVal(Qe)?pt[ct]=null:g.isRemoveVal(Qe)?pt[ct]=(n(Y,Le).get()||[])[ze]:i.warn("unrecognized full object value",W)),T.update(at,er),Q[Le]||(Q[Le]={});var $r=Q[Le][ze];$r||($r=Q[Le][ze]={}),$r[Gt]=Qe,delete W[ct]}else qe==="reverse"?(mr.range?mr.range.reverse():(rt(zt+".autorange",!0),mr.range=[1,0]),vr.autorange?at.calc=!0:at.plot=!0):(ct==="dragmode"&&(Qe===!1&&Or!==!1||Qe!==!1&&Or===!1)||V._has("scatter-like")&&V._has("regl")&&ct==="dragmode"&&(Qe==="lasso"||Qe==="select")&&!(Or==="lasso"||Or==="select")||V._has("gl2d")?at.plot=!0:kr?T.update(at,kr):at.calc=!0,We.set(Qe))}}for(Le in Q){var Ot=g.applyContainerArrayChanges(F,re(Y,Le),Q[Le],at,re);Ot||(at.plot=!0)}for(var At in Lt){bt=v.getFromId(F,At);var Ut=bt&&bt._constraintGroup;if(Ut){at.calc=!0;for(var xr in Ut)Lt[xr]||(v.getFromId(F,xr)._constraintShrinkable=!0)}}($e(F)||W.height||W.width)&&(at.plot=!0);var _r=V.shapes;for(ze=0;ze<_r.length;ze++)if(_r[ze].showlegend){at.calc=!0;break}return(at.plot||at.calc)&&(at.layoutReplot=!0),{flags:at,rangesAltered:Lt,undoit:pt,redoit:Et,eventData:ve}}function $e(F){var W=F._fullLayout,Y=W.width,V=W.height;return F.layout.autosize&&c.plotAutoSize(F,F.layout,W),W.width!==Y||W.height!==V}function te(F,W,Y,V){F=i.getGraphDiv(F),x.clearPromiseQueue(F),i.isPlainObject(W)||(W={}),i.isPlainObject(Y)||(Y={}),Object.keys(W).length&&(F.changed=!0),Object.keys(Y).length&&(F.changed=!0);var ie=x.coerceTraceIndices(F,V),re=oe(F,i.extendFlat({},W),ie),ke=re.flags,_e=Ee(F,i.extendFlat({},Y)),ve=_e.flags;(ke.calc||ve.calc)&&(F.calcdata=void 0),ke.clearAxisTypes&&x.clearAxisTypes(F,ie,Y);var Q=[];ve.layoutReplot?Q.push(_.layoutReplot):ke.fullReplot?Q.push(t._doPlot):(Q.push(c.previousPromises),ge(F,ve,_e)||c.supplyDefaults(F),ke.style&&Q.push(_.doTraceStyle),(ke.colorbars||ve.colorbars)&&Q.push(_.doColorBars),ve.legend&&Q.push(_.doLegend),ve.layoutstyle&&Q.push(_.layoutStyles),ve.axrange&&ue(Q,_e.rangesAltered),ve.ticks&&Q.push(_.doTicksRelayout),ve.modebar&&Q.push(_.doModeBar),ve.camera&&Q.push(_.doCamera),Q.push($)),Q.push(c.rehover,c.redrag,c.reselect),l.add(F,te,[F,re.undoit,_e.undoit,re.traces],te,[F,re.redoit,_e.redoit,re.traces]);var Le=i.syncOrAsync(Q,F);return(!Le||!Le.then)&&(Le=Promise.resolve(F)),Le.then(function(){return F.emit("plotly_update",{data:re.eventData,layout:_e.eventData}),F})}function Te(F){return function(Y){Y._fullLayout._guiEditing=!0;var V=F.apply(null,arguments);return Y._fullLayout._guiEditing=!1,V}}var ne=[{pattern:/^hiddenlabels/,attr:"legend.uirevision"},{pattern:/^((x|y)axis\d*)\.((auto)?range|title\.text)/},{pattern:/axis\d*\.showspikes$/,attr:"modebar.uirevision"},{pattern:/(hover|drag)mode$/,attr:"modebar.uirevision"},{pattern:/^(scene\d*)\.camera/},{pattern:/^(geo\d*)\.(projection|center|fitbounds)/},{pattern:/^(ternary\d*\.[abc]axis)\.(min|title\.text)$/},{pattern:/^(polar\d*\.radialaxis)\.((auto)?range|angle|title\.text)/},{pattern:/^(polar\d*\.angularaxis)\.rotation/},{pattern:/^(mapbox\d*)\.(center|zoom|bearing|pitch)/},{pattern:/^legend\.(x|y)$/,attr:"editrevision"},{pattern:/^(shapes|annotations)/,attr:"editrevision"},{pattern:/^title\.text$/,attr:"editrevision"}],de=[{pattern:/^selectedpoints$/,attr:"selectionrevision"},{pattern:/(^|value\.)visible$/,attr:"legend.uirevision"},{pattern:/^dimensions\[\d+\]\.constraintrange/},{pattern:/^node\.(x|y|groups)/},{pattern:/^level$/},{pattern:/(^|value\.)name$/},{pattern:/colorbar\.title\.text$/},{pattern:/colorbar\.(x|y)$/,attr:"editrevision"}];function he(F,W){for(var Y=0;Y<W.length;Y++){var V=W[Y],ie=F.match(V.pattern);if(ie){var re=ie[1]||"";return{head:re,tail:F.substr(re.length+1),attr:V.attr}}}}function Ae(F,W){var Y=n(W,F).get();if(Y!==void 0)return Y;var V=F.split(".");for(V.pop();V.length>1;)if(V.pop(),Y=n(W,V.join(".")+".uirevision").get(),Y!==void 0)return Y;return W.uirevision}function Me(F,W){for(var Y=0;Y<W.length;Y++)if(W[Y]._fullInput.uid===F)return Y;return-1}function we(F,W,Y){for(var V=0;V<W.length;V++)if(W[V].uid===F)return V;return!W[Y]||W[Y].uid?-1:Y}function be(F,W){var Y=i.isPlainObject(F),V=Array.isArray(F);return Y||V?(Y&&i.isPlainObject(W)||V&&Array.isArray(W))&&JSON.stringify(F)===JSON.stringify(W):F===W}function Ve(F,W,Y,V){var ie=V._preGUI,re,ke,_e,ve,Q,Le,ze,Ne,tt,vt,st=[],at={},Et={};for(re in ie){if(Q=he(re,ne),Q){if(tt=Q.head,vt=Q.tail,ke=Q.attr||tt+".uirevision",_e=n(V,ke).get(),ve=_e&&Ae(ke,W),ve&&ve===_e){if(Le=ie[re],Le===null&&(Le=void 0),ze=n(W,re),Ne=ze.get(),be(Ne,Le)){Ne===void 0&&vt==="autorange"&&st.push(tt),ze.set(ye(n(V,re).get()));continue}else if(vt==="autorange"||vt.substr(0,6)==="range["){var pt=ie[tt+".range[0]"],rt=ie[tt+".range[1]"],Lt=ie[tt+".autorange"];if(Lt||Lt===null&&pt===null&&rt===null){if(!(tt in at)){var bt=n(W,tt).get();at[tt]=bt&&(bt.autorange||bt.autorange!==!1&&(!bt.range||bt.range.length!==2))}if(at[tt]){ze.set(ye(n(V,re).get()));continue}}}}}else i.warn("unrecognized GUI edit: "+re);delete ie[re],Q&&Q.tail.substr(0,6)==="range["&&(Et[Q.head]=1)}for(var dt=0;dt<st.length;dt++){var ct=st[dt];if(Et[ct]){var We=n(W,ct).get();We&&delete We.autorange}}var Qe=V._tracePreGUI;for(var mt in Qe){var Mt=Qe[mt],qe=null,Ct;for(re in Mt){if(!qe){var zt=Me(mt,Y);if(zt<0){delete Qe[mt];break}var mr=Y[zt];Ct=mr._fullInput;var vr=we(mt,F,Ct.index);if(vr<0){delete Qe[mt];break}qe=F[vr]}if(Q=he(re,de),Q){if(Q.attr?(_e=n(V,Q.attr).get(),ve=_e&&Ae(Q.attr,W)):(_e=Ct.uirevision,ve=qe.uirevision,ve===void 0&&(ve=W.uirevision)),ve&&ve===_e&&(Le=Mt[re],Le===null&&(Le=void 0),ze=n(qe,re),Ne=ze.get(),be(Ne,Le))){ze.set(ye(n(Ct,re).get()));continue}}else i.warn("unrecognized GUI edit: "+re+" in trace uid "+mt);delete Mt[re]}}}function Fe(F,W,Y,V){var ie,re;function ke(){return t.addFrames(F,ie)}F=i.getGraphDiv(F),x.clearPromiseQueue(F);var _e=F._fullData,ve=F._fullLayout;if(!i.isPlotDiv(F)||!_e||!ve)re=t.newPlot(F,W,Y,V);else{if(i.isPlainObject(W)){var Q=W;W=Q.data,Y=Q.layout,V=Q.config,ie=Q.frames}var Le=!1;if(V){var ze=i.extendDeep({},F._context);F._context=void 0,I(F,V),Le=xe(ze,F._context)}F.data=W||[],x.cleanData(F.data),F.layout=Y||{},x.cleanLayout(F.layout),Ve(F.data,F.layout,_e,ve),c.supplyDefaults(F,{skipUpdateCalc:!0});var Ne=F._fullData,tt=F._fullLayout,vt=tt.datarevision===void 0,st=tt.transition,at=Ge(F,ve,tt,vt,st),Et=at.newDataRevision,pt=Oe(F,_e,Ne,vt,st,Et);if($e(F)&&(at.layoutReplot=!0),pt.calc||at.calc){F.calcdata=void 0;for(var rt=Object.getOwnPropertyNames(tt),Lt=0;Lt<rt.length;Lt++){var bt=rt[Lt],dt=bt.substring(0,5);if(dt==="xaxis"||dt==="yaxis"){var ct=tt[bt]._emptyCategories;ct&&ct()}}}else c.supplyDefaultsUpdateCalc(F.calcdata,Ne);var We=[];if(ie&&(F._transitionData={},c.createTransitionData(F),We.push(ke)),tt.transition&&!Le&&(pt.anim||at.anim))at.ticks&&We.push(_.doTicksRelayout),c.doCalcdata(F),_.doAutoRangeAndConstraints(F),We.push(function(){return c.transitionFromReact(F,pt,at,ve)});else if(pt.fullReplot||at.layoutReplot||Le)F._fullLayout._skipDefaults=!0,We.push(t._doPlot);else{for(var Qe in at.arrays){var mt=at.arrays[Qe];if(mt.length){var Mt=s.getComponentMethod(Qe,"drawOne");if(Mt!==i.noop)for(var qe=0;qe<mt.length;qe++)Mt(F,mt[qe]);else{var Ct=s.getComponentMethod(Qe,"draw");if(Ct===i.noop)throw new Error("cannot draw components: "+Qe);Ct(F)}}}We.push(c.previousPromises),pt.style&&We.push(_.doTraceStyle),(pt.colorbars||at.colorbars)&&We.push(_.doColorBars),at.legend&&We.push(_.doLegend),at.layoutstyle&&We.push(_.layoutStyles),at.axrange&&ue(We),at.ticks&&We.push(_.doTicksRelayout),at.modebar&&We.push(_.doModeBar),at.camera&&We.push(_.doCamera),We.push($)}We.push(c.rehover,c.redrag,c.reselect),re=i.syncOrAsync(We,F),(!re||!re.then)&&(re=Promise.resolve(F))}return re.then(function(){return F.emit("plotly_react",{data:W,layout:Y}),F})}function Oe(F,W,Y,V,ie,re){var ke=W.length===Y.length;if(!ie&&!ke)return{fullReplot:!0,calc:!0};var _e=T.traceFlags();_e.arrays={},_e.nChanges=0,_e.nChangesAnim=0;var ve,Q;function Le(tt){var vt=f.getTraceValObject(Q,tt);return!Q._module.animatable&&vt.anim&&(vt.anim=!1),vt}var ze={getValObject:Le,flags:_e,immutable:V,transition:ie,newDataRevision:re,gd:F},Ne={};for(ve=0;ve<W.length;ve++)if(Y[ve]){if(Q=Y[ve]._fullInput,c.hasMakesDataTransform(Q)&&(Q=Y[ve]),Ne[Q.uid])continue;Ne[Q.uid]=1,lt(W[ve]._fullInput,Q,[],ze)}return(_e.calc||_e.plot)&&(_e.fullReplot=!0),ie&&_e.nChanges&&_e.nChangesAnim&&(_e.anim=_e.nChanges===_e.nChangesAnim&&ke?"all":"some"),_e}function Ge(F,W,Y,V,ie){var re=T.layoutFlags();re.arrays={},re.rangesAltered={},re.nChanges=0,re.nChangesAnim=0;function ke(ve){return f.getLayoutValObject(Y,ve)}var _e={getValObject:ke,flags:re,immutable:V,transition:ie,gd:F};return lt(W,Y,[],_e),(re.plot||re.calc)&&(re.layoutReplot=!0),ie&&re.nChanges&&re.nChangesAnim&&(re.anim=re.nChanges===re.nChangesAnim?"all":"some"),re}function lt(F,W,Y,V){var ie,re,ke,_e=V.getValObject,ve=V.flags,Q=V.immutable,Le=V.inArray,ze=V.arrayIndex;function Ne(){var zt=ie.editType;if(Le&&zt.indexOf("arraydraw")!==-1){i.pushUnique(ve.arrays[Le],ze);return}T.update(ve,ie),zt!=="none"&&ve.nChanges++,V.transition&&ie.anim&&ve.nChangesAnim++,(Ce.test(ke)||ce.test(ke))&&(ve.rangesAltered[Y[0]]=1),De.test(ke)&&n(W,"_inputDomain").set(null),re==="datarevision"&&(ve.newDataRevision=1)}function tt(zt){return zt.valType==="data_array"||zt.arrayOk}for(re in F){if(ve.calc&&!V.transition)return;var vt=F[re],st=W[re],at=Y.concat(re);if(ke=at.join("."),!(re.charAt(0)==="_"||typeof vt=="function"||vt===st)){if((re==="tick0"||re==="dtick")&&Y[0]!=="geo"){var Et=W.tickmode;if(Et==="auto"||Et==="array"||!Et)continue}if(!(re==="range"&&W.autorange)&&!((re==="zmin"||re==="zmax")&&W.type==="contourcarpet")&&(ie=_e(at),!!ie&&!(ie._compareAsJSON&&JSON.stringify(vt)===JSON.stringify(st)))){var pt=ie.valType,rt,Lt=tt(ie),bt=Array.isArray(vt),dt=Array.isArray(st);if(bt&&dt){var ct="_input_"+re,We=F[ct],Qe=W[ct];if(Array.isArray(We)&&We===Qe)continue}if(st===void 0)Lt&&bt?ve.calc=!0:Ne();else if(ie._isLinkedToArray){var mt=[],Mt=!1;Le||(ve.arrays[re]=mt);var qe=Math.min(vt.length,st.length),Ct=Math.max(vt.length,st.length);if(qe!==Ct)if(ie.editType==="arraydraw")Mt=!0;else{Ne();continue}for(rt=0;rt<qe;rt++)lt(vt[rt],st[rt],at.concat(rt),i.extendFlat({inArray:re,arrayIndex:rt},V));if(Mt)for(rt=qe;rt<Ct;rt++)mt.push(rt)}else!pt&&i.isPlainObject(vt)?lt(vt,st,at,V):Lt?bt&&dt?(Q&&(ve.calc=!0),(Q||V.newDataRevision)&&Ne()):bt!==dt?ve.calc=!0:Ne():bt&&dt?(vt.length!==st.length||String(vt)!==String(st))&&Ne():Ne()}}}for(re in W)if(!(re in F||re.charAt(0)==="_"||typeof W[re]=="function"))if(ie=_e(Y.concat(re)),tt(ie)&&Array.isArray(W[re])){ve.calc=!0;return}else Ne()}function xe(F,W){var Y;for(Y in F)if(Y.charAt(0)!=="_"){var V=F[Y],ie=W[Y];if(V!==ie)if(i.isPlainObject(V)&&i.isPlainObject(ie)){if(xe(V,ie))return!0}else if(Array.isArray(V)&&Array.isArray(ie)){if(V.length!==ie.length)return!0;for(var re=0;re<V.length;re++)if(V[re]!==ie[re])if(i.isPlainObject(V[re])&&i.isPlainObject(ie[re])){if(xe(V[re],ie[re]))return!0}else return!0}else return!0}}function Ze(F,W,Y){if(F=i.getGraphDiv(F),!i.isPlotDiv(F))throw new Error("This element is not a Plotly plot: "+F+". It's likely that you've failed to create a plot before animating it. For more details, see https://plotly.com/javascript/animations/");var V=F._transitionData;V._frameQueue||(V._frameQueue=[]),Y=c.supplyAnimationDefaults(Y);var ie=Y.transition,re=Y.frame;V._frameWaitingCnt===void 0&&(V._frameWaitingCnt=0);function ke(Q){return Array.isArray(ie)?Q>=ie.length?ie[0]:ie[Q]:ie}function _e(Q){return Array.isArray(re)?Q>=re.length?re[0]:re[Q]:re}function ve(Q,Le){var ze=0;return function(){if(Q&&++ze===Le)return Q()}}return new Promise(function(Q,Le){function ze(){if(V._frameQueue.length!==0){for(;V._frameQueue.length;){var qe=V._frameQueue.pop();qe.onInterrupt&&qe.onInterrupt()}F.emit("plotly_animationinterrupted",[])}}function Ne(qe){if(qe.length!==0){for(var Ct=0;Ct<qe.length;Ct++){var zt;qe[Ct].type==="byname"?zt=c.computeFrame(F,qe[Ct].name):zt=qe[Ct].data;var mr=_e(Ct),vr=ke(Ct);vr.duration=Math.min(vr.duration,mr.duration);var Or={frame:zt,name:qe[Ct].name,frameOpts:mr,transitionOpts:vr};Ct===qe.length-1&&(Or.onComplete=ve(Q,2),Or.onInterrupt=Le),V._frameQueue.push(Or)}Y.mode==="immediate"&&(V._lastFrameAt=-1/0),V._animationRaf||st()}}function tt(){F.emit("plotly_animated"),window.cancelAnimationFrame(V._animationRaf),V._animationRaf=null}function vt(){V._currentFrame&&V._currentFrame.onComplete&&V._currentFrame.onComplete();var qe=V._currentFrame=V._frameQueue.shift();if(qe){var Ct=qe.name?qe.name.toString():null;F._fullLayout._currentFrame=Ct,V._lastFrameAt=Date.now(),V._timeToNext=qe.frameOpts.duration,c.transition(F,qe.frame.data,qe.frame.layout,x.coerceTraceIndices(F,qe.frame.traces),qe.frameOpts,qe.transitionOpts).then(function(){qe.onComplete&&qe.onComplete()}),F.emit("plotly_animatingframe",{name:Ct,frame:qe.frame,animation:{frame:qe.frameOpts,transition:qe.transitionOpts}})}else tt()}function st(){F.emit("plotly_animating"),V._lastFrameAt=-1/0,V._timeToNext=0,V._runningTransitions=0,V._currentFrame=null;var qe=function(){V._animationRaf=window.requestAnimationFrame(qe),Date.now()-V._lastFrameAt>V._timeToNext&&vt()};qe()}var at=0;function Et(qe){return Array.isArray(ie)?at>=ie.length?qe.transitionOpts=ie[at]:qe.transitionOpts=ie[0]:qe.transitionOpts=ie,at++,qe}var pt,rt,Lt=[],bt=W==null,dt=Array.isArray(W),ct=!bt&&!dt&&i.isPlainObject(W);if(ct)Lt.push({type:"object",data:Et(i.extendFlat({},W))});else if(bt||["string","number"].indexOf(typeof W)!==-1)for(pt=0;pt<V._frames.length;pt++)rt=V._frames[pt],rt&&(bt||String(rt.group)===String(W))&&Lt.push({type:"byname",name:String(rt.name),data:Et({name:rt.name})});else if(dt)for(pt=0;pt<W.length;pt++){var We=W[pt];["number","string"].indexOf(typeof We)!==-1?(We=String(We),Lt.push({type:"byname",name:We,data:Et({name:We})})):i.isPlainObject(We)&&Lt.push({type:"object",data:Et(i.extendFlat({},We))})}for(pt=0;pt<Lt.length;pt++)if(rt=Lt[pt],rt.type==="byname"&&!V._frameHash[rt.data.name]){i.warn('animate failure: frame not found: "'+rt.data.name+'"'),Le();return}["next","immediate"].indexOf(Y.mode)!==-1&&ze(),Y.direction==="reverse"&&Lt.reverse();var Qe=F._fullLayout._currentFrame;if(Qe&&Y.fromcurrent){var mt=-1;for(pt=0;pt<Lt.length;pt++)if(rt=Lt[pt],rt.type==="byname"&&rt.name===Qe){mt=pt;break}if(mt>0&&mt<Lt.length-1){var Mt=[];for(pt=0;pt<Lt.length;pt++)rt=Lt[pt],(Lt[pt].type!=="byname"||pt>mt)&&Mt.push(rt);Lt=Mt}}Lt.length>0?Ne(Lt):(F.emit("plotly_animated"),Q())})}function Xe(F,W,Y){if(F=i.getGraphDiv(F),W==null)return Promise.resolve();if(!i.isPlotDiv(F))throw new Error("This element is not a Plotly plot: "+F+". It's likely that you've failed to create a plot before adding frames. For more details, see https://plotly.com/javascript/animations/");var V,ie,re,ke,_e=F._transitionData._frames,ve=F._transitionData._frameHash;if(!Array.isArray(W))throw new Error("addFrames failure: frameList must be an Array of frame definitions"+W);var Q=_e.length+W.length*2,Le=[],ze={};for(V=W.length-1;V>=0;V--)if(i.isPlainObject(W[V])){var Ne=W[V].name,tt=(ve[Ne]||ze[Ne]||{}).name,vt=W[V].name,st=ve[tt]||ze[tt];tt&&vt&&typeof vt=="number"&&st&&S<L&&(S++,i.warn('addFrames: overwriting frame "'+(ve[tt]||ze[tt]).name+'" with a frame whose name of type "number" also equates to "'+tt+'". This is valid but may potentially lead to unexpected behavior since all plotly.js frame names are stored internally as strings.'),S===L&&i.warn("addFrames: This API call has yielded too many of these warnings. For the rest of this call, further warnings about numeric frame names will be suppressed.")),ze[Ne]={name:Ne},Le.push({frame:c.supplyFrameDefaults(W[V]),index:Y&&Y[V]!==void 0&&Y[V]!==null?Y[V]:Q+V})}Le.sort(function(ct,We){return ct.index>We.index?-1:ct.index<We.index?1:0});var at=[],Et=[],pt=_e.length;for(V=Le.length-1;V>=0;V--){if(ie=Le[V].frame,typeof ie.name=="number"&&i.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!ie.name)for(;ve[ie.name="frame "+F._transitionData._counter++];);if(ve[ie.name]){for(re=0;re<_e.length&&(_e[re]||{}).name!==ie.name;re++);at.push({type:"replace",index:re,value:ie}),Et.unshift({type:"replace",index:re,value:_e[re]})}else ke=Math.max(0,Math.min(Le[V].index,pt)),at.push({type:"insert",index:ke,value:ie}),Et.unshift({type:"delete",index:ke}),pt++}var rt=c.modifyFrames,Lt=c.modifyFrames,bt=[F,Et],dt=[F,at];return l&&l.add(F,rt,bt,Lt,dt),c.modifyFrames(F,at)}function Ye(F,W){if(F=i.getGraphDiv(F),!i.isPlotDiv(F))throw new Error("This element is not a Plotly plot: "+F);var Y,V,ie=F._transitionData._frames,re=[],ke=[];if(!W)for(W=[],Y=0;Y<ie.length;Y++)W.push(Y);for(W=W.slice(),W.sort(),Y=W.length-1;Y>=0;Y--)V=W[Y],re.push({type:"delete",index:V}),ke.unshift({type:"insert",index:V,value:ie[V]});var _e=c.modifyFrames,ve=c.modifyFrames,Q=[F,ke],Le=[F,re];return l&&l.add(F,_e,Q,ve,Le),c.modifyFrames(F,re)}function He(F){F=i.getGraphDiv(F);var W=F._fullLayout||{},Y=F._fullData||[];return c.cleanPlot([],{},Y,W),c.purge(F),o.purge(F),W._container&&W._container.remove(),delete F._context,F}function Ue(F){var W=F._fullLayout,Y=F.getBoundingClientRect();if(!i.equalDomRects(Y,W._lastBBox)){var V=W._invTransform=i.inverseTransformMatrix(i.getFullTransformMatrix(F));W._invScaleX=Math.sqrt(V[0][0]*V[0][0]+V[0][1]*V[0][1]+V[0][2]*V[0][2]),W._invScaleY=Math.sqrt(V[1][0]*V[1][0]+V[1][1]*V[1][1]+V[1][2]*V[1][2]),W._lastBBox=Y}}function Je(F){var W=e.select(F),Y=F._fullLayout;if(Y._calcInverseTransform=Ue,Y._calcInverseTransform(F),Y._container=W.selectAll(".plot-container").data([0]),Y._container.enter().insert("div",":first-child").classed("plot-container",!0).classed("plotly",!0),Y._paperdiv=Y._container.selectAll(".svg-container").data([0]),Y._paperdiv.enter().append("div").classed("user-select-none",!0).classed("svg-container",!0).style("position","relative"),Y._glcontainer=Y._paperdiv.selectAll(".gl-container").data([{}]),Y._glcontainer.enter().append("div").classed("gl-container",!0),Y._paperdiv.selectAll(".main-svg").remove(),Y._paperdiv.select(".modebar-container").remove(),Y._paper=Y._paperdiv.insert("svg",":first-child").classed("main-svg",!0),Y._toppaper=Y._paperdiv.append("svg").classed("main-svg",!0),Y._modebardiv=Y._paperdiv.append("div"),delete Y._modeBar,Y._hoverpaper=Y._paperdiv.append("svg").classed("main-svg",!0),!Y._uid){var V={};e.selectAll("defs").each(function(){this.id&&(V[this.id.split("-")[1]]=1)}),Y._uid=i.randstr(V)}Y._paperdiv.selectAll(".main-svg").attr(y.svgAttrs),Y._defs=Y._paper.append("defs").attr("id","defs-"+Y._uid),Y._clips=Y._defs.append("g").classed("clips",!0),Y._topdefs=Y._toppaper.append("defs").attr("id","topdefs-"+Y._uid),Y._topclips=Y._topdefs.append("g").classed("clips",!0),Y._bgLayer=Y._paper.append("g").classed("bglayer",!0),Y._draggers=Y._paper.append("g").classed("draglayer",!0);var ie=Y._paper.append("g").classed("layer-below",!0);Y._imageLowerLayer=ie.append("g").classed("imagelayer",!0),Y._shapeLowerLayer=ie.append("g").classed("shapelayer",!0),Y._cartesianlayer=Y._paper.append("g").classed("cartesianlayer",!0),Y._polarlayer=Y._paper.append("g").classed("polarlayer",!0),Y._smithlayer=Y._paper.append("g").classed("smithlayer",!0),Y._ternarylayer=Y._paper.append("g").classed("ternarylayer",!0),Y._geolayer=Y._paper.append("g").classed("geolayer",!0),Y._funnelarealayer=Y._paper.append("g").classed("funnelarealayer",!0),Y._pielayer=Y._paper.append("g").classed("pielayer",!0),Y._iciclelayer=Y._paper.append("g").classed("iciclelayer",!0),Y._treemaplayer=Y._paper.append("g").classed("treemaplayer",!0),Y._sunburstlayer=Y._paper.append("g").classed("sunburstlayer",!0),Y._indicatorlayer=Y._toppaper.append("g").classed("indicatorlayer",!0),Y._glimages=Y._paper.append("g").classed("glimages",!0);var re=Y._toppaper.append("g").classed("layer-above",!0);Y._imageUpperLayer=re.append("g").classed("imagelayer",!0),Y._shapeUpperLayer=re.append("g").classed("shapelayer",!0),Y._selectionLayer=Y._toppaper.append("g").classed("selectionlayer",!0),Y._infolayer=Y._toppaper.append("g").classed("infolayer",!0),Y._menulayer=Y._toppaper.append("g").classed("menulayer",!0),Y._zoomlayer=Y._toppaper.append("g").classed("zoomlayer",!0),Y._hoverlayer=Y._hoverpaper.append("g").classed("hoverlayer",!0),Y._modebardiv.classed("modebar-container",!0).style("position","absolute").style("top","0px").style("right","0px"),F.emit("plotly_framework")}t.animate=Ze,t.addFrames=Xe,t.deleteFrames=Ye,t.addTraces=Z,t.deleteTraces=K,t.extendTraces=q,t.moveTraces=ee,t.prependTraces=U,t.newPlot=M,t._doPlot=D,t.purge=He,t.react=Fe,t.redraw=P,t.relayout=pe,t.restyle=le,t.setPlotConfig=E,t.update=te,t._guiRelayout=Te(pe),t._guiRestyle=Te(le),t._guiUpdate=Te(te),t._storeDirectGUIEdit=J})(Vh);var Hr={},$R=ot;Hr.getDelay=function(t){return t._has&&(t._has("gl3d")||t._has("gl2d")||t._has("mapbox"))?500:0};Hr.getRedrawFunc=function(t){return function(){$R.getComponentMethod("colorbar","draw")(t)}};Hr.encodeSVG=function(t){return"data:image/svg+xml,"+encodeURIComponent(t)};Hr.encodeJSON=function(t){return"data:application/json,"+encodeURIComponent(t)};var s2=window.URL||window.webkitURL;Hr.createObjectURL=function(t){return s2.createObjectURL(t)};Hr.revokeObjectURL=function(t){return s2.revokeObjectURL(t)};Hr.createBlob=function(t,e){if(e==="svg")return new window.Blob([t],{type:"image/svg+xml;charset=utf-8"});if(e==="full-json")return new window.Blob([t],{type:"application/json;charset=utf-8"});var r=PR(window.atob(t));return new window.Blob([r],{type:"image/"+e})};Hr.octetStream=function(t){document.location.href="data:application/octet-stream"+t};function PR(t){for(var e=t.length,r=new ArrayBuffer(e),a=new Uint8Array(r),i=0;i<e;i++)a[i]=t.charCodeAt(i);return r}Hr.IMAGE_URL_PREFIX=/^data:image\/\w+;base64,/;Hr.MSG_IE_BAD_FORMAT="Sorry IE does not support downloading from canvas. Try {format:'svg'} instead.";var Jd=gt,RR=me,ER=$t,zR=ht,Js=Sn,hv=/"/g,Ll="TOBESTRIPPED",IR=new RegExp('("'+Ll+")|("+Ll+'")',"g");function FR(t){var e=Jd.select("body").append("div").style({display:"none"}).html(""),r=t.replace(/(&[^;]*;)/gi,function(a){return a==="&lt;"?"&#60;":a==="&rt;"?"&#62;":a.indexOf("<")!==-1||a.indexOf(">")!==-1?"":e.html(a).text()});return e.remove(),r}function NR(t){return t.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&amp;")}var Fp=function(e,r,a){var i=e._fullLayout,n=i._paper,o=i._toppaper,l=i.width,s=i.height,f;n.insert("rect",":first-child").call(ER.setRect,0,0,l,s).call(zR.fill,i.paper_bgcolor);var c=i._basePlotModules||[];for(f=0;f<c.length;f++){var v=c[f];v.toSVG&&v.toSVG(e)}if(o){var u=o.node().childNodes,h=Array.prototype.slice.call(u);for(f=0;f<h.length;f++){var d=h[f];d.childNodes.length&&n.node().appendChild(d)}}i._draggers&&i._draggers.remove(),n.node().style.background="",n.selectAll("text").attr({"data-unformatted":null,"data-math":null}).each(function(){var m=Jd.select(this);if(this.style.visibility==="hidden"||this.style.display==="none"){m.remove();return}else m.style({visibility:null,display:null});var y=this.style.fontFamily;y&&y.indexOf('"')!==-1&&m.style("font-family",y.replace(hv,Ll))}),n.selectAll(".gradient_filled,.pattern_filled").each(function(){var m=Jd.select(this),y=this.style.fill;y&&y.indexOf("url(")!==-1&&m.style("fill",y.replace(hv,Ll));var b=this.style.stroke;b&&b.indexOf("url(")!==-1&&m.style("stroke",b.replace(hv,Ll))}),(r==="pdf"||r==="eps")&&n.selectAll("#MathJax_SVG_glyphs path").attr("stroke-width",0),n.node().setAttributeNS(Js.xmlns,"xmlns",Js.svg),n.node().setAttributeNS(Js.xmlns,"xmlns:xlink",Js.xlink),r==="svg"&&a&&(n.attr("width",a*l),n.attr("height",a*s),n.attr("viewBox","0 0 "+l+" "+s));var p=new window.XMLSerializer().serializeToString(n.node());return p=FR(p),p=NR(p),p=p.replace(IR,"'"),RR.isIE()&&(p=p.replace(/"/gi,"'"),p=p.replace(/(\('#)([^']*)('\))/gi,'("#$2")'),p=p.replace(/(\\')/gi,'"')),p},g0=me,HR=Ah.EventEmitter,Nn=Hr;function OR(t){var e=t.emitter||new HR,r=new Promise(function(a,i){var n=window.Image,o=t.svg,l=t.format||"png";if(g0.isIE()&&l!=="svg"){var s=new Error(Nn.MSG_IE_BAD_FORMAT);return i(s),t.promise?r:e.emit("error",s)}var f=t.canvas,c=t.scale||1,v=t.width||300,u=t.height||150,h=c*v,d=c*u,p=f.getContext("2d",{willReadFrequently:!0}),m=new n,y,b;l==="svg"||g0.isSafari()?b=Nn.encodeSVG(o):(y=Nn.createBlob(o,"svg"),b=Nn.createObjectURL(y)),f.width=h,f.height=d,m.onload=function(){var w;switch(y=null,Nn.revokeObjectURL(b),l!=="svg"&&p.drawImage(m,0,0,h,d),l){case"jpeg":w=f.toDataURL("image/jpeg");break;case"png":w=f.toDataURL("image/png");break;case"webp":w=f.toDataURL("image/webp");break;case"svg":w=b;break;default:var g="Image format is not jpeg, png, svg or webp.";if(i(new Error(g)),!t.promise)return e.emit("error",g)}a(w),t.promise||e.emit("success",w)},m.onerror=function(w){if(y=null,Nn.revokeObjectURL(b),i(w),!t.promise)return e.emit("error",w)},m.src=b});return t.promise?r:e}var Np=OR,b0=wt,x0=Vh,jR=cr,Ga=me,ll=Hr,BR=Fp,GR=Np,UR=wc.version,pv={format:{valType:"enumerated",values:["png","jpeg","webp","svg","full-json"],dflt:"png",description:"Sets the format of exported image."},width:{valType:"number",min:1,description:["Sets the exported image width.","Defaults to the value found in `layout.width`","If set to *null*, the exported image width will match the current graph width."].join(" ")},height:{valType:"number",min:1,description:["Sets the exported image height.","Defaults to the value found in `layout.height`","If set to *null*, the exported image height will match the current graph height."].join(" ")},scale:{valType:"number",min:0,dflt:1,description:["Sets a scaling for the generated image.","If set, all features of a graphs (e.g. text, line width)","are scaled, unlike simply setting","a bigger *width* and *height*."].join(" ")},setBackground:{valType:"any",dflt:!1,description:["Sets the image background mode.","By default, the image background is determined by `layout.paper_bgcolor`,","the *transparent* mode.","One might consider setting `setBackground` to *opaque*","when exporting a *jpeg* image as JPEGs do not support opacity."].join(" ")},imageDataOnly:{valType:"boolean",dflt:!1,description:["Determines whether or not the return value is prefixed by","the image format's corresponding 'data:image;' spec."].join(" ")}};function VR(t,e){e=e||{};var r,a,i,n;Ga.isPlainObject(t)?(r=t.data||[],a=t.layout||{},i=t.config||{},n={}):(t=Ga.getGraphDiv(t),r=Ga.extendDeep([],t.data),a=Ga.extendDeep({},t.layout),i=t._context,n=t._fullLayout||{});function o(_){return!(_ in e)||Ga.validate(e[_],pv[_])}if(!o("width")&&e.width!==null||!o("height")&&e.height!==null)throw new Error("Height and width should be pixel values.");if(!o("format"))throw new Error("Export format is not "+Ga.join2(pv.format.values,", "," or ")+".");var l={};function s(_,T){return Ga.coerce(e,l,pv,_,T)}var f=s("format"),c=s("width"),v=s("height"),u=s("scale"),h=s("setBackground"),d=s("imageDataOnly"),p=document.createElement("div");p.style.position="absolute",p.style.left="-5000px",document.body.appendChild(p);var m=Ga.extendFlat({},a);c?m.width=c:e.width===null&&b0(n.width)&&(m.width=n.width),v?m.height=v:e.height===null&&b0(n.height)&&(m.height=n.height);var y=Ga.extendFlat({},i,{_exportedPlot:!0,staticPlot:!0,setBackground:h}),b=ll.getRedrawFunc(p);function w(){return new Promise(function(_){setTimeout(_,ll.getDelay(p._fullLayout))})}function g(){return new Promise(function(_,T){var k=BR(p,f,u),S=p._fullLayout.width,L=p._fullLayout.height;function D(){x0.purge(p),document.body.removeChild(p)}if(f==="full-json"){var $=jR.graphJson(p,!1,"keepdata","object",!0,!0);return $.version=UR,$=JSON.stringify($),D(),_(d?$:ll.encodeJSON($))}if(D(),f==="svg")return _(d?k:ll.encodeSVG(k));var E=document.createElement("canvas");E.id=Ga.randstr(),GR({format:f,width:S,height:L,scale:u,canvas:E,svg:k,promise:!0}).then(_).catch(T)})}function x(_){return d?_.replace(ll.IMAGE_URL_PREFIX,""):_}return new Promise(function(_,T){x0.newPlot(p,r,m,y).then(b).then(w).then(g).then(function(k){_(x(k))}).catch(function(k){T(k)})})}var f2=VR,ya=me,XR=cr,YR=Oo,WR=Io.dfltConfig,ca=ya.isPlainObject,Ri=Array.isArray,_0=ya.isArrayOrTypedArray,qR=function(e,r){e===void 0&&(e=[]),r===void 0&&(r={});var a=YR.get(),i=[],n={_context:ya.extendFlat({},WR)},o,l;Ri(e)?(n.data=ya.extendDeep([],e),o=e):(n.data=[],o=[],i.push(sr("array","data"))),ca(r)?(n.layout=ya.extendDeep({},r),l=r):(n.layout={},l={},arguments.length>1&&i.push(sr("object","layout"))),XR.supplyDefaults(n);for(var s=n._fullData,f=o.length,c=0;c<f;c++){var v=o[c],u=["data",c];if(!ca(v)){i.push(sr("object",u));continue}var h=s[c],d=h.type,p=a.traces[d].attributes;p.type={valType:"enumerated",values:[d]},h.visible===!1&&v.visible!==!1&&i.push(sr("invisible",u)),Cl(v,h,p,i,u);var m=v.transforms,y=h.transforms;if(m){Ri(m)||i.push(sr("array",u,["transforms"])),u.push("transforms");for(var b=0;b<m.length;b++){var w=["transforms",b],g=m[b].type;if(!ca(m[b])){i.push(sr("object",u,w));continue}var x=a.transforms[g]?a.transforms[g].attributes:{};x.type={valType:"enumerated",values:Object.keys(a.transforms)},Cl(m[b],y[b],x,i,u,w)}}}var _=n._fullLayout,T=ZR(a,s);return Cl(l,_,T,i,"layout"),i.length===0?void 0:i};function Cl(t,e,r,a,i,n){n=n||[];for(var o=Object.keys(t),l=0;l<o.length;l++){var s=o[l];if(s!=="transforms"){var f=n.slice();f.push(s);var c=t[s],v=e[s],u=JR(r,s),h=(u||{}).valType,d=h==="info_array",p=h==="colorscale",m=(u||{}).items;if(!QR(r,s))a.push(sr("schema",i,f));else if(ca(c)&&ca(v)&&h!=="any")Cl(c,v,u,a,i,f);else if(d&&Ri(c)){c.length>v.length&&a.push(sr("unused",i,f.concat(v.length)));var y=v.length,b=Array.isArray(m);b&&(y=Math.min(y,m.length));var w,g,x,_,T;if(u.dimensions===2)for(g=0;g<y;g++)if(Ri(c[g])){c[g].length>v[g].length&&a.push(sr("unused",i,f.concat(g,v[g].length)));var k=v[g].length;for(w=0;w<(b?Math.min(k,m[g].length):k);w++)x=b?m[g][w]:m,_=c[g][w],T=v[g][w],ya.validate(_,x)?T!==_&&T!==+_&&a.push(sr("dynamic",i,f.concat(g,w),_,T)):a.push(sr("value",i,f.concat(g,w),_))}else a.push(sr("array",i,f.concat(g),c[g]));else for(g=0;g<y;g++)x=b?m[g]:m,_=c[g],T=v[g],ya.validate(_,x)?T!==_&&T!==+_&&a.push(sr("dynamic",i,f.concat(g),_,T)):a.push(sr("value",i,f.concat(g),_))}else if(u.items&&!d&&Ri(c)){var S=m[Object.keys(m)[0]],L=[],D,$;for(D=0;D<v.length;D++){var E=v[D]._index||D;if($=f.slice(),$.push(E),ca(c[E])&&ca(v[D])){L.push(E);var z=c[E],O=v[D];ca(z)&&z.visible!==!1&&O.visible===!1?a.push(sr("invisible",i,$)):Cl(z,O,S,a,i,$)}}for(D=0;D<c.length;D++)$=f.slice(),$.push(D),ca(c[D])?L.indexOf(D)===-1&&a.push(sr("unused",i,$)):a.push(sr("object",i,$,c[D]))}else!ca(c)&&ca(v)?a.push(sr("object",i,f,c)):!_0(c)&&_0(v)&&!d&&!p?a.push(sr("array",i,f,c)):s in e?ya.validate(c,u)?u.valType==="enumerated"&&(u.coerceNumber&&c!==+v||c!==v)&&a.push(sr("dynamic",i,f,c,v)):a.push(sr("value",i,f,c)):a.push(sr("unused",i,f,c))}}return a}function ZR(t,e){for(var r=t.layout.layoutAttributes,a=0;a<e.length;a++){var i=e[a],n=t.traces[i.type],o=n.layoutAttributes;o&&(i.subplot?ya.extendFlat(r[n.attributes.subplot.dflt],o):ya.extendFlat(r,o))}return r}var KR={object:function(t,e){var r;return t==="layout"&&e===""?r="The layout argument":t[0]==="data"&&e===""?r="Trace "+t[1]+" in the data argument":r=Zi(t)+"key "+e,r+" must be linked to an object container"},array:function(t,e){var r;return t==="data"?r="The data argument":r=Zi(t)+"key "+e,r+" must be linked to an array container"},schema:function(t,e){return Zi(t)+"key "+e+" is not part of the schema"},unused:function(t,e,r){var a=ca(r)?"container":"key";return Zi(t)+a+" "+e+" did not get coerced"},dynamic:function(t,e,r,a){return[Zi(t)+"key",e,"(set to '"+r+"')","got reset to","'"+a+"'","during defaults."].join(" ")},invisible:function(t,e){return(e?Zi(t)+"item "+e:"Trace "+t[1])+" got defaulted to be not visible"},value:function(t,e,r){return[Zi(t)+"key "+e,"is set to an invalid value ("+r+")"].join(" ")}};function Zi(t){return Ri(t)?"In data trace "+t[1]+", ":"In "+t+", "}function sr(t,e,r,a,i){r=r||"";var n,o;Ri(e)?(n=e[0],o=e[1]):(n=e,o=null);var l=tE(r),s=KR[t](e,l,a,i);return ya.log(s),{code:t,container:n,trace:o,path:r,astr:l,msg:s}}function QR(t,e){var r=c2(e),a=r.keyMinusId,i=r.id;return a in t&&t[a]._isSubplotObj&&i?!0:e in t}function JR(t,e){if(e in t)return t[e];var r=c2(e);return t[r.keyMinusId]}var eE=ya.counterRegex("([a-z]+)");function c2(t){var e=t.match(eE);return{keyMinusId:e&&e[1],id:e&&e[2]}}function tE(t){if(!Ri(t))return String(t);for(var e="",r=0;r<t.length;r++){var a=t[r];typeof a=="number"?e=e.substr(0,e.length-1)+"["+a+"]":e+=a,r<t.length-1&&(e+=".")}return e}var w0=me,sl=Hr;function rE(t,e,r){var a=document.createElement("a"),i="download"in a,n=new Promise(function(o,l){var s,f;if(w0.isIE())return s=sl.createBlob(t,"svg"),window.navigator.msSaveBlob(s,e),s=null,o(e);if(i)return s=sl.createBlob(t,r),f=sl.createObjectURL(s),a.href=f,a.download=e,document.body.appendChild(a),a.click(),document.body.removeChild(a),sl.revokeObjectURL(f),s=null,o(e);if(w0.isSafari()){var c=r==="svg"?",":";base64,";return sl.octetStream(c+encodeURIComponent(t)),o(e)}l(new Error("download error"))});return n}var aE=rE,mv=me,iE=f2,nE=aE,oE=Hr;function lE(t,e){var r;return mv.isPlainObject(t)||(r=mv.getGraphDiv(t)),e=e||{},e.format=e.format||"png",e.width=e.width||null,e.height=e.height||null,e.imageDataOnly=!0,new Promise(function(a,i){r&&r._snapshotInProgress&&i(new Error("Snapshotting already in progress.")),mv.isIE()&&e.format!=="svg"&&i(new Error(oE.MSG_IE_BAD_FORMAT)),r&&(r._snapshotInProgress=!0);var n=iE(t,e),o=e.filename||t.fn||"newplot";o+="."+e.format.replace("-","."),n.then(function(l){return r&&(r._snapshotInProgress=!1),nE(l,o,e.format)}).then(function(l){a(l)}).catch(function(l){r&&(r._snapshotInProgress=!1),i(l)})})}var u2=lE,Hp={},Jr=me,ea=Jr.isPlainObject,v2=Oo,d2=cr,sE=ba,h2=Ht,p2=Io.dfltConfig;Hp.makeTemplate=function(t){t=Jr.isPlainObject(t)?t:Jr.getGraphDiv(t),t=Jr.extendDeep({_context:p2},{data:t.data,layout:t.layout}),d2.supplyDefaults(t);var e=t.data||[],r=t.layout||{};r._basePlotModules=t._fullLayout._basePlotModules,r._modules=t._fullLayout._modules;var a={data:{},layout:{}};e.forEach(function(h){var d={};Dl(h,d,cE.bind(null,h));var p=Jr.coerce(h,{},sE,"type"),m=a.data[p];m||(m=a.data[p]=[]),m.push(d)}),Dl(r,a.layout,fE.bind(null,r)),delete a.layout.template;var i=r.template;if(ea(i)){var n=i.layout,o,l,s,f,c,v;ea(n)&&ic(n,a.layout);var u=i.data;if(ea(u)){for(l in a.data)if(s=u[l],Array.isArray(s)){for(c=a.data[l],v=c.length,f=s.length,o=0;o<v;o++)ic(s[o%f],c[o]);for(o=v;o<f;o++)c.push(Jr.extendDeep({},s[o]))}for(l in u)l in a.data||(a.data[l]=Jr.extendDeep([],u[l]))}}return a};function ic(t,e){t=Jr.extendDeep({},t);var r=Object.keys(t).sort(),a,i;function n(c,v,u){if(ea(v)&&ea(c))ic(c,v);else if(Array.isArray(v)&&Array.isArray(c)){var h=h2.arrayTemplater({_template:t},u);for(i=0;i<v.length;i++){var d=v[i],p=h.newItem(d)._template;p&&ic(p,d)}var m=h.defaultItems();for(i=0;i<m.length;i++)v.push(m[i]._template);for(i=0;i<v.length;i++)delete v[i].templateitemname}}for(a=0;a<r.length;a++){var o=r[a],l=t[o];if(o in e?n(l,e[o],o):e[o]=l,nc(o)===o)for(var s in e){var f=nc(s);s!==f&&f===o&&!(s in t)&&n(l,e[s],o)}}}function nc(t){return t.replace(/[0-9]+$/,"")}function Dl(t,e,r,a,i){var n=i&&r(i);for(var o in t){var l=t[o],s=ua(t,o,a),f=ua(t,o,i),c=r(f);if(!c){var v=nc(o);v!==o&&(f=ua(t,v,i),c=r(f))}if(!(n&&n===c)&&!(!c||c._noTemplating||c.valType==="data_array"||c.arrayOk&&Array.isArray(l)))if(!c.valType&&ea(l))Dl(l,e,r,s,f);else if(c._isLinkedToArray&&Array.isArray(l))for(var u=!1,h=0,d={},p=0;p<l.length;p++){var m=l[p];if(ea(m)){var y=m.name;if(y)d[y]||(Dl(m,e,r,ua(l,h,s),ua(l,h,f)),h++,d[y]=1);else if(!u){var b=h2.arrayDefaultKey(o),w=ua(t,b,a),g=ua(l,h,s);Dl(m,e,r,g,ua(l,h,f));var x=Jr.nestedProperty(e,g),_=Jr.nestedProperty(e,w);_.set(x.get()),x.set(null),u=!0}}}else{var T=Jr.nestedProperty(e,s);T.set(l)}}}function fE(t,e){return v2.getLayoutValObject(t,Jr.nestedProperty({},e).parts)}function cE(t,e){return v2.getTraceValObject(t,Jr.nestedProperty({},e).parts)}function ua(t,e,r){var a;return r?Array.isArray(t)?a=r+"["+e+"]":a=r+"."+e:a=e,a}Hp.validateTemplate=function(t,e){var r=Jr.extendDeep({},{_context:p2,data:t.data,layout:t.layout}),a=r.layout||{};ea(e)||(e=a.template||{});var i=e.layout,n=e.data,o=[];r.layout=a,r.layout.template=e,d2.supplyDefaults(r);var l=r._fullLayout,s=r._fullData,f={};function c(w,g){for(var x in w)if(x.charAt(0)!=="_"&&ea(w[x])){var _=nc(x),T=[],k;for(k=0;k<g.length;k++)T.push(ua(w,x,g[k])),_!==x&&T.push(ua(w,_,g[k]));for(k=0;k<T.length;k++)f[T[k]]=1;c(w[x],T)}}function v(w,g){for(var x in w)if(x.indexOf("defaults")===-1&&ea(w[x])){var _=ua(w,x,g);f[_]?v(w[x],_):o.push({code:"unused",path:_})}}if(ea(i)?(c(l,["layout"]),v(i,"layout")):o.push({code:"layout"}),!ea(n))o.push({code:"data"});else{for(var u={},h,d=0;d<s.length;d++){var p=s[d];h=p.type,u[h]=(u[h]||0)+1,p._fullInput._template||o.push({code:"missing",index:p._fullInput.index,traceType:h})}for(h in n){var m=n[h].length,y=u[h]||0;m>y?o.push({code:"unused",traceType:h,templateCount:m,dataCount:y}):y>m&&o.push({code:"reused",traceType:h,templateCount:m,dataCount:y})}}function b(w,g){for(var x in w)if(x.charAt(0)!=="_"){var _=w[x],T=ua(w,x,g);ea(_)?(Array.isArray(w)&&_._template===!1&&_.templateitemname&&o.push({code:"missing",path:T,templateitemname:_.templateitemname}),b(_,T)):Array.isArray(_)&&uE(_)&&b(_,T)}}if(b({data:s,layout:l},""),o.length)return o.map(vE)};function uE(t){for(var e=0;e<t.length;e++)if(ea(t[e]))return!0}function vE(t){var e;switch(t.code){case"data":e="The template has no key data.";break;case"layout":e="The template has no key layout.";break;case"missing":t.path?e="There are no templates for item "+t.path+" with name "+t.templateitemname:e="There are no templates for trace "+t.index+", of type "+t.traceType+".";break;case"unused":t.path?e="The template item at "+t.path+" was not used in constructing the plot.":t.dataCount?e="Some of the templates of type "+t.traceType+" were not used. The template has "+t.templateCount+" traces, the data only has "+t.dataCount+" of this type.":e="The template has "+t.templateCount+" traces of type "+t.traceType+" but there are none in the data.";break;case"reused":e="Some of the templates of type "+t.traceType+" were used more than once. The template has "+t.templateCount+" traces, the data has "+t.dataCount+" of this type.";break}return t.msg=e,t}var pr=Vh;Wt._doPlot=pr._doPlot;Wt.newPlot=pr.newPlot;Wt.restyle=pr.restyle;Wt.relayout=pr.relayout;Wt.redraw=pr.redraw;Wt.update=pr.update;Wt._guiRestyle=pr._guiRestyle;Wt._guiRelayout=pr._guiRelayout;Wt._guiUpdate=pr._guiUpdate;Wt._storeDirectGUIEdit=pr._storeDirectGUIEdit;Wt.react=pr.react;Wt.extendTraces=pr.extendTraces;Wt.prependTraces=pr.prependTraces;Wt.addTraces=pr.addTraces;Wt.deleteTraces=pr.deleteTraces;Wt.moveTraces=pr.moveTraces;Wt.purge=pr.purge;Wt.addFrames=pr.addFrames;Wt.deleteFrames=pr.deleteFrames;Wt.animate=pr.animate;Wt.setPlotConfig=pr.setPlotConfig;var dE=Lc.getGraphDiv,hE=Tp.eraseActiveShape;Wt.deleteActiveShape=function(t){return hE(dE(t))};Wt.toImage=f2;Wt.validate=qR;Wt.downloadImage=u2;var m2=Hp;Wt.makeTemplate=m2.makeTemplate;Wt.validateTemplate=m2.validateTemplate;var yv=me,pE=ot,Op=function(e,r,a,i){var n=i("x"),o=i("y"),l,s=pE.getComponentMethod("calendars","handleTraceDefaults");if(s(e,r,["x","y"],a),n){var f=yv.minRowLength(n);o?l=Math.min(f,yv.minRowLength(o)):(l=f,i("y0"),i("dy"))}else{if(!o)return 0;l=yv.minRowLength(o),i("x0"),i("dx")}return r._length=l,l},T0=me.dateTick0,mE=or,yE=mE.ONEWEEK;function k0(t,e){return t%yE===0?T0(e,1):T0(e,0)}var iu=function(e,r,a,i,n){if(n||(n={x:!0,y:!0}),n.x){var o=i("xperiod");o&&(i("xperiod0",k0(o,r.xcalendar)),i("xperiodalignment"))}if(n.y){var l=i("yperiod");l&&(i("yperiod0",k0(l,r.ycalendar)),i("yperiodalignment"))}},A0=["orientation","groupnorm","stackgaps"],gE=function(e,r,a,i){var n=a._scatterStackOpts,o=i("stackgroup");if(o){var l=r.xaxis+r.yaxis,s=n[l];s||(s=n[l]={});var f=s[o],c=!1;f?f.traces.push(r):(f=s[o]={traceIndices:[],traces:[r]},c=!0);for(var v={orientation:r.x&&!r.y?"h":"v"},u=0;u<A0.length;u++){var h=A0[u],d=h+"Found";if(!f[d]){var p=e[h]!==void 0,m=h==="orientation";if((p||c)&&(f[h]=i(h,v[h]),m&&(f.fillDflt=f[h]==="h"?"tonextx":"tonexty"),p&&(f[d]=!0,!c&&(delete f.traces[0][h],m))))for(var y=0;y<f.traces.length-1;y++){var b=f.traces[y];b._input.fill!==b.fill&&(b.fill=f.fillDflt)}}}return f}},M0=ht,S0=Na.hasColorscale,L0=fs,bE=Ir,y2=function(e,r,a,i,n,o){var l=bE.isBubble(e),s=(e.line||{}).color,f;if(o=o||{},s&&(a=s),n("marker.symbol"),n("marker.opacity",l?.7:1),n("marker.size"),o.noAngle||(n("marker.angle"),o.noAngleRef||n("marker.angleref"),o.noStandOff||n("marker.standoff")),n("marker.color",a),S0(e,"marker")&&L0(e,r,i,n,{prefix:"marker.",cLetter:"c"}),o.noSelect||(n("selected.marker.color"),n("unselected.marker.color"),n("selected.marker.size"),n("unselected.marker.size")),o.noLine||(s&&!Array.isArray(s)&&r.marker.color!==s?f=s:l?f=M0.background:f=M0.defaultLine,n("marker.line.color",f),S0(e,"marker.line")&&L0(e,r,i,n,{prefix:"marker.line.",cLetter:"c"}),n("marker.line.width",l?1:0)),l&&(n("marker.sizeref"),n("marker.sizemin"),n("marker.sizemode")),o.gradient){var c=n("marker.gradient.type");c!=="none"&&n("marker.gradient.color")}},xE=me.isArrayOrTypedArray,_E=Na.hasColorscale,wE=fs,g2=function(e,r,a,i,n,o){o||(o={});var l=(e.marker||{}).color;if(n("line.color",a),_E(e,"line"))wE(e,r,i,n,{prefix:"line.",cLetter:"c"});else{var s=(xE(l)?!1:l)||a;n("line.color",s)}n("line.width"),o.noDash||n("line.dash"),o.backoff&&n("line.backoff")},TE=function(e,r,a){var i=a("line.shape");i==="spline"&&a("line.smoothing")},kE=me,b2=function(t,e,r,a,i){i=i||{},a("textposition"),kE.coerceFont(a,"textfont",i.font||r.font),i.noSelect||(a("selected.textfont.color"),a("unselected.textfont.color"))},AE=ht,C0=me.isArrayOrTypedArray,x2=function(e,r,a,i){var n=!1;if(r.marker){var o=r.marker.color,l=(r.marker.line||{}).color;o&&!C0(o)?n=o:l&&!C0(l)&&(n=l)}i("fillcolor",AE.addOpacity((r.line||{}).color||n||a,.5))},D0=me,ME=ot,SE=Ui,LE=ru,Hn=Ir,CE=Op,DE=iu,$E=gE,PE=y2,RE=g2,$0=TE,EE=b2,zE=x2,IE=me.coercePattern,FE=function(e,r,a,i){function n(h,d){return D0.coerce(e,r,SE,h,d)}var o=CE(e,r,i,n);if(o||(r.visible=!1),!!r.visible){DE(e,r,i,n),n("xhoverformat"),n("yhoverformat");var l=$E(e,r,i,n);i.scattermode==="group"&&r.orientation===void 0&&n("orientation","v");var s=!l&&o<LE.PTS_LINESONLY?"lines+markers":"lines";n("text"),n("hovertext"),n("mode",s),Hn.hasLines(r)&&(RE(e,r,a,i,n,{backoff:!0}),$0(e,r,n),n("connectgaps"),n("line.simplify")),Hn.hasMarkers(r)&&PE(e,r,a,i,n,{gradient:!0}),Hn.hasText(r)&&(n("texttemplate"),EE(e,r,i,n));var f=[];(Hn.hasMarkers(r)||Hn.hasText(r))&&(n("cliponaxis"),n("marker.maxdisplayed"),f.push("points")),n("fill",l?l.fillDflt:"none"),r.fill!=="none"&&(zE(e,r,a,n),Hn.hasLines(r)||$0(e,r,n),IE(n,"fillpattern",r.fillcolor,!1));var c=(r.line||{}).color,v=(r.marker||{}).color;(r.fill==="tonext"||r.fill==="toself")&&f.push("fills"),n("hoveron",f.join("+")||"points"),r.hoveron!=="fills"&&n("hovertemplate");var u=ME.getComponentMethod("errorbars","supplyDefaults");u(e,r,c||v||a,{axis:"y"}),u(e,r,c||v||a,{axis:"x",inherit:"y"}),D0.coerceSelectionMarkerOpacity(r,n)}},NE=ui.getAxisGroup,jp=function(e,r,a,i){var n=r.orientation,o=r[{v:"x",h:"y"}[n]+"axis"],l=NE(a,o)+n,s=a._alignmentOpts||{},f=i("alignmentgroup"),c=s[l];c||(c=s[l]={});var v=c[f];v?v.traces.push(r):v=c[f]={traces:[r],alignmentIndex:Object.keys(c).length,offsetGroups:{}};var u=i("offsetgroup"),h=v.offsetGroups,d=h[u];u&&(d||(d=h[u]={offsetIndex:Object.keys(h).length}),r._offsetIndex=d.offsetIndex)},HE=me,OE=jp,jE=Ui,_2=function(e,r){var a,i,n;function o(v){return HE.coerce(i._input,i,jE,v)}if(r.scattermode==="group")for(n=0;n<e.length;n++)i=e[n],i.type==="scatter"&&(a=i._input,OE(a,i,r,o));for(n=0;n<e.length;n++){var l=e[n];if(l.type==="scatter"){var s=l.fill;if(!(s==="none"||s==="toself")&&(l.opacity=void 0,s==="tonexty"||s==="tonextx"))for(var f=n-1;f>=0;f--){var c=e[f];if(c.type==="scatter"&&c.xaxis===l.xaxis&&c.yaxis===l.yaxis){c.opacity=void 0;break}}}}},BE=me,GE=Xh,UE=function(t,e){function r(i,n){return BE.coerce(t,e,GE,i,n)}var a=e.barmode==="group";e.scattermode==="group"&&r("scattergap",a?e.bargap:.2)},VE=wt,w2=me,XE=w2.dateTime2ms,ef=w2.incrementMonth,YE=or,WE=YE.ONEAVGMONTH,nu=function(e,r,a,i){if(r.type!=="date")return{vals:i};var n=e[a+"periodalignment"];if(!n)return{vals:i};var o=e[a+"period"],l;if(VE(o)){if(o=+o,o<=0)return{vals:i}}else if(typeof o=="string"&&o.charAt(0)==="M"){var s=+o.substring(1);if(s>0&&Math.round(s)===s)l=s;else return{vals:i}}for(var f=r.calendar,c=n==="start",v=n==="end",u=e[a+"period0"],h=XE(u,f)||0,d=[],p=[],m=[],y=i.length,b=0;b<y;b++){var w=i[b],g,x,_;if(l){for(g=Math.round((w-h)/(l*WE)),_=ef(h,l*g,f);_>w;)_=ef(_,-l,f);for(;_<=w;)_=ef(_,l,f);x=ef(_,-l,f)}else{for(g=Math.round((w-h)/o),_=h+g*o;_>w;)_-=o;for(;_<=w;)_+=o;x=_-o}d[b]=c?x:v?_:(x+_)/2,p[b]=x,m[b]=_}return{vals:d,starts:p,ends:m}},gv=Na.hasColorscale,bv=Kh,P0=Ir,T2=function(e,r){P0.hasLines(r)&&gv(r,"line")&&bv(e,r,{vals:r.line.color,containerStr:"line",cLetter:"c"}),P0.hasMarkers(r)&&(gv(r,"marker")&&bv(e,r,{vals:r.marker.color,containerStr:"marker",cLetter:"c"}),gv(r,"marker.line")&&bv(e,r,{vals:r.marker.line.color,containerStr:"marker.line",cLetter:"c"}))},Ar=me,k2=function(e,r){for(var a=0;a<e.length;a++)e[a].i=a;Ar.mergeArray(r.text,e,"tx"),Ar.mergeArray(r.texttemplate,e,"txt"),Ar.mergeArray(r.hovertext,e,"htx"),Ar.mergeArray(r.customdata,e,"data"),Ar.mergeArray(r.textposition,e,"tp"),r.textfont&&(Ar.mergeArrayCastPositive(r.textfont.size,e,"ts"),Ar.mergeArray(r.textfont.color,e,"tc"),Ar.mergeArray(r.textfont.family,e,"tf"));var i=r.marker;if(i){Ar.mergeArrayCastPositive(i.size,e,"ms"),Ar.mergeArrayCastPositive(i.opacity,e,"mo"),Ar.mergeArray(i.symbol,e,"mx"),Ar.mergeArray(i.angle,e,"ma"),Ar.mergeArray(i.standoff,e,"mf"),Ar.mergeArray(i.color,e,"mc");var n=i.line;i.line&&(Ar.mergeArray(n.color,e,"mlc"),Ar.mergeArrayCastPositive(n.width,e,"mlw"));var o=i.gradient;o&&o.type!=="none"&&(Ar.mergeArray(o.type,e,"mgt"),Ar.mergeArray(o.color,e,"mgc"))}},R0=me,A2=function(e,r){R0.isArrayOrTypedArray(r.selectedpoints)&&R0.tagSelected(e,r)},E0=wt,eh=me,Yl=Bt,z0=nu,xv=or.BADNUM,th=Ir,qE=T2,ZE=k2,KE=A2;function QE(t,e){var r=t._fullLayout,a=e._xA=Yl.getFromId(t,e.xaxis||"x","x"),i=e._yA=Yl.getFromId(t,e.yaxis||"y","y"),n=a.makeCalcdata(e,"x"),o=i.makeCalcdata(e,"y"),l=z0(e,a,"x",n),s=z0(e,i,"y",o),f=l.vals,c=s.vals,v=e._length,u=new Array(v),h=e.ids,d=Bp(e,r,a,i),p=!1,m,y,b,w,g,x;L2(r,e);var _="x",T="y",k;if(d)eh.pushUnique(d.traceIndices,e._expandedIndex),m=d.orientation==="v",m?(T="s",k="x"):(_="s",k="y"),g=d.stackgaps==="interpolate";else{var S=S2(e,v);M2(t,e,a,i,f,c,S)}var L=!!e.xperiodalignment,D=!!e.yperiodalignment;for(y=0;y<v;y++){var $=u[y]={},E=E0(f[y]),z=E0(c[y]);E&&z?($[_]=f[y],$[T]=c[y],L&&($.orig_x=n[y],$.xEnd=l.ends[y],$.xStart=l.starts[y]),D&&($.orig_y=o[y],$.yEnd=s.ends[y],$.yStart=s.starts[y])):d&&(m?E:z)?($[k]=m?f[y]:c[y],$.gap=!0,g?($.s=xv,p=!0):$.s=0):$[_]=$[T]=xv,h&&($.id=String(h[y]))}if(ZE(u,e),qE(t,e),KE(u,e),d){for(y=0;y<u.length;)u[y][k]===xv?u.splice(y,1):y++;if(eh.sort(u,function(M,A){return M[k]-A[k]||M.i-A.i}),p){for(y=0;y<u.length-1&&u[y].gap;)y++;for(x=u[y].s,x||(x=u[y].s=0),b=0;b<y;b++)u[b].s=x;for(w=u.length-1;w>y&&u[w].gap;)w--;for(x=u[w].s,b=u.length-1;b>w;b--)u[b].s=x;for(;y<w;)if(y++,u[y].gap){for(b=y+1;u[b].gap;)b++;for(var O=u[y-1][k],I=u[y-1].s,P=(u[b].s-I)/(u[b][k]-O);y<b;)u[y].s=I+(u[y][k]-O)*P,y++}}}return u}function M2(t,e,r,a,i,n,o){var l=e._length,s=t._fullLayout,f=r._id,c=a._id,v=s._firstScatter[C2(e)]===e.uid,u=(Bp(e,s,r,a)||{}).orientation,h=e.fill;r._minDtick=0,a._minDtick=0;var d={padded:!0},p={padded:!0};o&&(d.ppad=p.ppad=o);var m=l<2||i[0]!==i[l-1]||n[0]!==n[l-1];m&&(h==="tozerox"||h==="tonextx"&&(v||u==="h"))?d.tozero=!0:!(e.error_y||{}).visible&&(h==="tonexty"||h==="tozeroy"||!th.hasMarkers(e)&&!th.hasText(e))&&(d.padded=!1,d.ppad=0),m&&(h==="tozeroy"||h==="tonexty"&&(v||u==="v"))?p.tozero=!0:(h==="tonextx"||h==="tozerox")&&(p.padded=!1),f&&(e._extremes[f]=Yl.findExtremes(r,i,d)),c&&(e._extremes[c]=Yl.findExtremes(a,n,p))}function S2(t,e){if(th.hasMarkers(t)){var r=t.marker,a=1.6*(t.marker.sizeref||1),i;if(t.marker.sizemode==="area"?i=function(f){return Math.max(Math.sqrt((f||0)/a),3)}:i=function(f){return Math.max((f||0)/a,3)},eh.isArrayOrTypedArray(r.size)){var n={type:"linear"};Yl.setConvert(n);for(var o=n.makeCalcdata(t.marker,"size"),l=new Array(e),s=0;s<e;s++)l[s]=i(o[s]);return l}else return i(r.size)}}function L2(t,e){var r=C2(e),a=t._firstScatter;a[r]||(a[r]=e.uid)}function C2(t){var e=t.stackgroup;return t.xaxis+t.yaxis+t.type+(e?"-"+e:"")}function Bp(t,e,r,a){var i=t.stackgroup;if(i){var n=e._scatterStackOpts[r._id+a._id][i],o=n.orientation==="v"?a:r;if(o.type==="linear"||o.type==="log")return n}}var Gp={calc:QE,calcMarkerSize:S2,calcAxisExpansion:M2,setFirstScatter:L2,getStackOpts:Bp},JE=ou,ez=me.distinctVals;function ou(t,e){this.traces=t,this.sepNegVal=e.sepNegVal,this.overlapNoMerge=e.overlapNoMerge;for(var r=1/0,a=e.posAxis._id.charAt(0),i=[],n=0;n<t.length;n++){for(var o=t[n],l=0;l<o.length;l++){var s=o[l],f=s.p;f===void 0&&(f=s[a]),f!==void 0&&i.push(f)}o[0]&&o[0].width1&&(r=Math.min(o[0].width1,r))}this.positions=i;var c=ez(i);this.distinctPositions=c.vals,c.vals.length===1&&r!==1/0?this.minDiff=r:this.minDiff=Math.min(c.minDiff,r);var v=(e.posAxis||{}).type;(v==="category"||v==="multicategory")&&(this.minDiff=1),this.binWidth=this.minDiff,this.bins={}}ou.prototype.put=function(e,r){var a=this.getLabel(e,r),i=this.bins[a]||0;return this.bins[a]=i+r,i};ou.prototype.get=function(e,r){var a=this.getLabel(e,r);return this.bins[a]||0};ou.prototype.getLabel=function(e,r){var a=r<0&&this.sepNegVal?"v":"^",i=this.overlapNoMerge?e:Math.round(e/this.binWidth);return a+i};var zi=wt,rh=me.isArrayOrTypedArray,Mo=or.BADNUM,tz=ot,Wl=Bt,rz=ui.getAxisGroup,lu=JE;function az(t,e){for(var r=e.xaxis,a=e.yaxis,i=t._fullLayout,n=t._fullData,o=t.calcdata,l=[],s=[],f=0;f<n.length;f++){var c=n[f];if(c.visible===!0&&tz.traceIs(c,"bar")&&c.xaxis===r._id&&c.yaxis===a._id&&(c.orientation==="h"?l.push(o[f]):s.push(o[f]),c._computePh))for(var v=t.calcdata[f],u=0;u<v.length;u++)typeof v[u].ph0=="function"&&(v[u].ph0=v[u].ph0()),typeof v[u].ph1=="function"&&(v[u].ph1=v[u].ph1())}var h={xCat:r.type==="category"||r.type==="multicategory",yCat:a.type==="category"||a.type==="multicategory",mode:i.barmode,norm:i.barnorm,gap:i.bargap,groupgap:i.bargroupgap};ah(t,r,a,s,h),ah(t,a,r,l,h)}function ah(t,e,r,a,i){if(a.length){var n,o,l,s,f;switch(iz(r,a),i.mode){case"overlay":_v(e,r,a,i);break;case"group":for(n=[],o=[],l=0;l<a.length;l++)s=a[l],f=s[0].trace,f.offset===void 0?o.push(s):n.push(s);o.length&&nz(t,e,r,o,i),n.length&&_v(e,r,n,i);break;case"stack":case"relative":for(n=[],o=[],l=0;l<a.length;l++)s=a[l],f=s[0].trace,f.base===void 0?o.push(s):n.push(s);o.length&&oz(t,e,r,o,i),n.length&&_v(e,r,n,i);break}cz(a,e)}}function iz(t,e){var r,a;for(r=0;r<e.length;r++){var i=e[r],n=i[0].trace,o=n.type==="funnel"?n._base:n.base,l,s=n.orientation==="h"?n.xcalendar:n.ycalendar,f=t.type==="category"||t.type==="multicategory"?function(){return null}:t.d2c;if(rh(o)){for(a=0;a<Math.min(o.length,i.length);a++)l=f(o[a],0,s),zi(l)?(i[a].b=+l,i[a].hasB=1):i[a].b=0;for(;a<i.length;a++)i[a].b=0}else{l=f(o,0,s);var c=zi(l);for(l=c?l:0,a=0;a<i.length;a++)i[a].b=l,c&&(i[a].hasB=1)}}}function _v(t,e,r,a){for(var i=0;i<r.length;i++){var n=r[i],o=new lu([n],{posAxis:t,sepNegVal:!1,overlapNoMerge:!a.norm});D2(t,o,a),a.norm?(z2(o),Up(e,o,a)):E2(e,o)}}function nz(t,e,r,a,i){var n=new lu(a,{posAxis:e,sepNegVal:!1,overlapNoMerge:!i.norm});lz(t,e,n,i),fz(n,e),i.norm?(z2(n),Up(r,n,i)):E2(r,n)}function oz(t,e,r,a,i){var n=new lu(a,{posAxis:e,sepNegVal:i.mode==="relative",overlapNoMerge:!(i.norm||i.mode==="stack"||i.mode==="relative")});D2(e,n,i),sz(r,n,i);for(var o=0;o<a.length;o++)for(var l=a[o],s=0;s<l.length;s++){var f=l[s];if(f.s!==Mo){var c=f.b+f.s===n.get(f.p,f.s);c&&(f._outmost=!0)}}i.norm&&Up(r,n,i)}function D2(t,e,r){for(var a=e.minDiff,i=e.traces,n=a*(1-r.gap),o=n,l=o*(1-(r.groupgap||0)),s=-l/2,f=0;f<i.length;f++){var c=i[f],v=c[0].t;v.barwidth=l,v.poffset=s,v.bargroupwidth=n,v.bardelta=a}e.binWidth=i[0][0].t.barwidth/100,$2(e),P2(t,e),R2(t,e)}function lz(t,e,r,a){for(var i=t._fullLayout,n=r.positions,o=r.distinctPositions,l=r.minDiff,s=r.traces,f=s.length,c=n.length!==o.length,v=l*(1-a.gap),u=rz(i,e._id)+s[0][0].trace.orientation,h=i._alignmentOpts[u]||{},d=0;d<f;d++){var p=s[d],m=p[0].trace,y=h[m.alignmentgroup]||{},b=Object.keys(y.offsetGroups||{}).length,w;b?w=v/b:w=c?v/f:v;var g=w*(1-(a.groupgap||0)),x;b?x=((2*m._offsetIndex+1-b)*w-g)/2:x=c?((2*d+1-f)*w-g)/2:-g/2;var _=p[0].t;_.barwidth=g,_.poffset=x,_.bargroupwidth=v,_.bardelta=l}r.binWidth=s[0][0].t.barwidth/100,$2(r),P2(e,r),R2(e,r,c)}function $2(t){var e=t.traces,r,a;for(r=0;r<e.length;r++){var i=e[r],n=i[0],o=n.trace,l=n.t,s=o._offset||o.offset,f=l.poffset,c;if(rh(s)){for(c=Array.prototype.slice.call(s,0,i.length),a=0;a<c.length;a++)zi(c[a])||(c[a]=f);for(a=c.length;a<i.length;a++)c.push(f);l.poffset=c}else s!==void 0&&(l.poffset=s);var v=o._width||o.width,u=l.barwidth;if(rh(v)){var h=Array.prototype.slice.call(v,0,i.length);for(a=0;a<h.length;a++)zi(h[a])||(h[a]=u);for(a=h.length;a<i.length;a++)h.push(u);if(l.barwidth=h,s===void 0){for(c=[],a=0;a<i.length;a++)c.push(f+(u-h[a])/2);l.poffset=c}}else v!==void 0&&(l.barwidth=v,s===void 0&&(l.poffset=f+(u-v)/2))}}function P2(t,e){for(var r=e.traces,a=hs(t),i=0;i<r.length;i++)for(var n=r[i],o=n[0].t,l=o.poffset,s=Array.isArray(l),f=o.barwidth,c=Array.isArray(f),v=0;v<n.length;v++){var u=n[v],h=u.w=c?f[v]:f;u.p===void 0&&(u.p=u[a],u["orig_"+a]=u[a]);var d=(s?l[v]:l)+h/2;u[a]=u.p+d}}function R2(t,e,r){var a=e.traces,i=e.minDiff,n=i/2;Wl.minDtick(t,e.minDiff,e.distinctPositions[0],r);for(var o=0;o<a.length;o++){var l=a[o],s=l[0],f=s.trace,c=[],v,u,h,d;for(d=0;d<l.length;d++)v=l[d],u=v.p-n,h=v.p+n,c.push(u,h);if(f.width||f.offset){var p=s.t,m=p.poffset,y=p.barwidth,b=Array.isArray(m),w=Array.isArray(y);for(d=0;d<l.length;d++){v=l[d];var g=b?m[d]:m,x=w?y[d]:y;u=v.p+g,h=u+x,c.push(u,h)}}f._extremes[t._id]=Wl.findExtremes(t,c,{padded:!1})}}function E2(t,e){for(var r=e.traces,a=hs(t),i=0;i<r.length;i++){for(var n=r[i],o=n[0].trace,l=o.type==="scatter",s=o.orientation==="v",f=[],c=!1,v=0;v<n.length;v++){var u=n[v],h=l?0:u.b,d=l?s?u.y:u.x:h+u.s;u[a]=d,f.push(d),u.hasB&&f.push(h),(!u.hasB||!u.b)&&(c=!0)}o._extremes[t._id]=Wl.findExtremes(t,f,{tozero:c,padded:!0})}}function sz(t,e,r){var a=hs(t),i=e.traces,n,o,l,s,f,c;for(s=0;s<i.length;s++)if(n=i[s],o=n[0].trace,o.type==="funnel")for(f=0;f<n.length;f++)c=n[f],c.s!==Mo&&e.put(c.p,-.5*c.s);for(s=0;s<i.length;s++){n=i[s],o=n[0].trace,l=o.type==="funnel";var v=[];for(f=0;f<n.length;f++)if(c=n[f],c.s!==Mo){var u;l?u=c.s:u=c.s+c.b;var h=e.put(c.p,u),d=h+u;c.b=h,c[a]=d,r.norm||(v.push(d),c.hasB&&v.push(h))}r.norm||(o._extremes[t._id]=Wl.findExtremes(t,v,{tozero:!0,padded:!0}))}}function z2(t){for(var e=t.traces,r=0;r<e.length;r++)for(var a=e[r],i=0;i<a.length;i++){var n=a[i];n.s!==Mo&&t.put(n.p,n.b+n.s)}}function fz(t,e){for(var r=t.traces,a=0;a<r.length;a++){var i=r[a],n=i[0].trace;if(n.base===void 0)for(var o=new lu([i],{posAxis:e,sepNegVal:!0,overlapNoMerge:!0}),l=0;l<i.length;l++){var s=i[l];if(s.p!==Mo){var f=o.put(s.p,s.b+s.s);f&&(s.b=f)}}}}function Up(t,e,r){var a=e.traces,i=hs(t),n=r.norm==="fraction"?1:100,o=n/1e9,l=t.l2c(t.c2l(0)),s=r.mode==="stack"?n:l;function f(x){return zi(t.c2l(x))&&(x<l-o||x>s+o||!zi(l))}for(var c=0;c<a.length;c++){for(var v=a[c],u=v[0].trace,h=[],d=!1,p=!1,m=0;m<v.length;m++){var y=v[m];if(y.s!==Mo){var b=Math.abs(n/e.get(y.p,y.s));y.b*=b,y.s*=b;var w=y.b,g=w+y.s;y[i]=g,h.push(g),p=p||f(g),y.hasB&&(h.push(w),p=p||f(w)),(!y.hasB||!y.b)&&(d=!0)}}u._extremes[t._id]=Wl.findExtremes(t,h,{tozero:d,padded:p})}}function cz(t,e){var r=hs(e),a={},i,n,o,l=1/0,s=-1/0;for(i=0;i<t.length;i++)for(o=t[i],n=0;n<o.length;n++){var f=o[n].p;zi(f)&&(l=Math.min(l,f),s=Math.max(s,f))}var c=1e4/(s-l),v=a.round=function(b){return String(Math.round(c*(b-l)))};for(i=0;i<t.length;i++){o=t[i],o[0].t.extents=a;var u=o[0].t.poffset,h=Array.isArray(u);for(n=0;n<o.length;n++){var d=o[n],p=d[r]-d.w/2;if(zi(p)){var m=d[r]+d.w/2,y=v(d.p);a[y]?a[y]=[Math.min(p,a[y][0]),Math.max(m,a[y][1])]:a[y]=[p,m]}d.p0=d.p+(h?u[n]:u),d.p1=d.p0+d.w,d.s0=d.b,d.s1=d.s0+d.s}}}function hs(t){return t._id.charAt(0)}var Vp={crossTraceCalc:az,setGroupPositions:ah},I0=Gp,F0=Vp.setGroupPositions;function uz(t,e){for(var r=e.xaxis,a=e.yaxis,i=t._fullLayout,n=t._fullData,o=t.calcdata,l=[],s=[],f=0;f<n.length;f++){var c=n[f];c.visible===!0&&c.type==="scatter"&&c.xaxis===r._id&&c.yaxis===a._id&&(c.orientation==="h"?l.push(o[f]):c.orientation==="v"&&s.push(o[f]))}var v={mode:i.scattermode,gap:i.scattergap};F0(t,r,a,s,v),F0(t,a,r,l,v)}var vz=function(e,r){e._fullLayout.scattermode==="group"&&uz(e,r);var a=r.xaxis,i=r.yaxis,n=a._id+i._id,o=e._fullLayout._scatterStackOpts[n];if(o){var l=e.calcdata,s,f,c,v,u,h,d,p,m,y,b,w,g,x,_;for(var T in o){y=o[T];var k=y.traceIndices;if(k.length){for(b=y.stackgaps==="interpolate",w=y.groupnorm,y.orientation==="v"?(g="x",x="y"):(g="y",x="x"),_=new Array(k.length),s=0;s<_.length;s++)_[s]=!1;h=l[k[0]];var S=new Array(h.length);for(s=0;s<h.length;s++)S[s]=h[s][g];for(s=1;s<k.length;s++){for(u=l[k[s]],f=c=0;f<u.length;f++){for(d=u[f][g];d>S[c]&&c<S.length;c++)wv(u,f,S[c],s,_,b,g),f++;if(d!==S[c]){for(v=0;v<s;v++)wv(l[k[v]],c,d,v,_,b,g);S.splice(c,0,d)}c++}for(;c<S.length;c++)wv(u,f,S[c],s,_,b,g),f++}var L=S.length;for(f=0;f<h.length;f++){for(p=h[f][x]=h[f].s,s=1;s<k.length;s++)u=l[k[s]],u[0].trace._rawLength=u[0].trace._length,u[0].trace._length=L,p+=u[f].s,u[f][x]=p;if(w)for(m=(w==="fraction"?p:p/100)||1,s=0;s<k.length;s++){var D=l[k[s]][f];D[x]/=m,D.sNorm=D.s/m}}for(s=0;s<k.length;s++){u=l[k[s]];var $=u[0].trace,E=I0.calcMarkerSize($,$._rawLength),z=Array.isArray(E);if(E&&_[s]||z){var O=E;for(E=new Array(L),f=0;f<L;f++)E[f]=u[f].gap?0:z?O[u[f].i]:O}var I=new Array(L),P=new Array(L);for(f=0;f<L;f++)I[f]=u[f].x,P[f]=u[f].y;I0.calcAxisExpansion(e,$,a,i,I,P,E),u[0].t.orientation=y.orientation}}}}};function wv(t,e,r,a,i,n,o){i[a]=!0;var l={i:null,gap:!0,s:0};if(l[o]=r,t.splice(e,0,l),e&&r===t[e-1][o]){var s=t[e-1];l.s=s.s,l.i=s.i,l.gap=s.gap}else n&&(l.s=dz(t,e,r,o));e||(t[0].t=t[1].t,t[0].trace=t[1].trace,delete t[1].t,delete t[1].trace)}function dz(t,e,r,a){var i=t[e-1],n=t[e+1];return n?i?i.s+(n.s-i.s)*(r-i[a])/(n[a]-i[a]):n.s:i.s}var hz=$t,I2=or,fl=I2.BADNUM,F2=I2.LOG_CLIP,N0=F2+.5,H0=F2-.5,oc=me,pz=oc.segmentsIntersect,O0=oc.constrain,Tv=ru,mz=function(e,r){var a=r.trace||{},i=r.xaxis,n=r.yaxis,o=i.type==="log",l=n.type==="log",s=i._length,f=n._length,c=r.backoff,v=a.marker,u=r.connectGaps,h=r.baseTolerance,d=r.shape,p=d==="linear",m=a.fill&&a.fill!=="none",y=[],b=Tv.minTolerance,w=e.length,g=new Array(w),x=0,_,T,k,S,L,D,$,E,z,O,I,P,M,A,C,R;function N(xe){var Ze=e[xe];if(!Ze)return!1;var Xe=r.linearized?i.l2p(Ze.x):i.c2p(Ze.x),Ye=r.linearized?n.l2p(Ze.y):n.c2p(Ze.y);if(Xe===fl){if(o&&(Xe=i.c2p(Ze.x,!0)),Xe===fl)return!1;l&&Ye===fl&&(Xe*=Math.abs(i._m*f*(i._m>0?N0:H0)/(n._m*s*(n._m>0?N0:H0)))),Xe*=1e3}if(Ye===fl){if(l&&(Ye=n.c2p(Ze.y,!0)),Ye===fl)return!1;Ye*=1e3}return[Xe,Ye]}function H(xe,Ze,Xe,Ye){var He=Xe-xe,Ue=Ye-Ze,Je=.5-xe,F=.5-Ze,W=He*He+Ue*Ue,Y=He*Je+Ue*F;if(Y>0&&Y<W){var V=Je*Ue-F*He;if(V*V<W)return!0}}var B,X;function j(xe,Ze){var Xe=xe[0]/s,Ye=xe[1]/f,He=Math.max(0,-Xe,Xe-1,-Ye,Ye-1);return He&&B!==void 0&&H(Xe,Ye,B,X)&&(He=0),He&&Ze&&H(Xe,Ye,Ze[0]/s,Ze[1]/f)&&(He=0),(1+Tv.toleranceGrowth*He)*h}function q(xe,Ze){var Xe=xe[0]-Ze[0],Ye=xe[1]-Ze[1];return Math.sqrt(Xe*Xe+Ye*Ye)}var U=Tv.maxScreensAway,Z=-s*U,K=s*(1+U),ee=-f*U,le=f*(1+U),ye=[[Z,ee,K,ee],[K,ee,K,le],[K,le,Z,le],[Z,le,Z,ee]],se,G,J,oe,fe,pe;function ge(xe,Ze){for(var Xe=[],Ye=0,He=0;He<4;He++){var Ue=ye[He],Je=pz(xe[0],xe[1],Ze[0],Ze[1],Ue[0],Ue[1],Ue[2],Ue[3]);Je&&(!Ye||Math.abs(Je.x-Xe[0][0])>1||Math.abs(Je.y-Xe[0][1])>1)&&(Je=[Je.x,Je.y],Ye&&q(Je,xe)<q(Xe[0],xe)?Xe.unshift(Je):Xe.push(Je),Ye++)}return Xe}function ue(xe){if(xe[0]<Z||xe[0]>K||xe[1]<ee||xe[1]>le)return[O0(xe[0],Z,K),O0(xe[1],ee,le)]}function Ce(xe,Ze){if(xe[0]===Ze[0]&&(xe[0]===Z||xe[0]===K)||xe[1]===Ze[1]&&(xe[1]===ee||xe[1]===le))return!0}function ce(xe,Ze){var Xe=[],Ye=ue(xe),He=ue(Ze);return Ye&&He&&Ce(Ye,He)||(Ye&&Xe.push(Ye),He&&Xe.push(He)),Xe}function De(xe,Ze,Xe){return function(Ye,He){var Ue=ue(Ye),Je=ue(He),F=[];if(Ue&&Je&&Ce(Ue,Je))return F;Ue&&F.push(Ue),Je&&F.push(Je);var W=2*oc.constrain((Ye[xe]+He[xe])/2,Ze,Xe)-((Ue||Ye)[xe]+(Je||He)[xe]);if(W){var Y;Ue&&Je?Y=W>0==Ue[xe]>Je[xe]?Ue:Je:Y=Ue||Je,Y[xe]+=W}return F}}var Ee;d==="linear"||d==="spline"?Ee=ge:d==="hv"||d==="vh"?Ee=ce:d==="hvh"?Ee=De(0,Z,K):d==="vhv"&&(Ee=De(1,ee,le));function $e(xe,Ze){var Xe=Ze[0]-xe[0],Ye=(Ze[1]-xe[1])/Xe,He=(xe[1]*Ze[0]-Ze[1]*xe[0])/Xe;return He>0?[Ye>0?Z:K,le]:[Ye>0?K:Z,ee]}function te(xe){var Ze=xe[0],Xe=xe[1],Ye=Ze===g[x-1][0],He=Xe===g[x-1][1];if(!(Ye&&He))if(x>1){var Ue=Ze===g[x-2][0],Je=Xe===g[x-2][1];Ye&&(Ze===Z||Ze===K)&&Ue?Je?x--:g[x-1]=xe:He&&(Xe===ee||Xe===le)&&Je?Ue?x--:g[x-1]=xe:g[x++]=xe}else g[x++]=xe}function Te(xe){g[x-1][0]!==xe[0]&&g[x-1][1]!==xe[1]&&te([J,oe]),te(xe),fe=null,J=oe=0}var ne=oc.isArrayOrTypedArray(v);function de(xe){if(xe&&c&&(xe.i=_,xe.d=e,xe.trace=a,xe.marker=ne?v[xe.i]:v,xe.backoff=c),B=xe[0]/s,X=xe[1]/f,se=xe[0]<Z?Z:xe[0]>K?K:0,G=xe[1]<ee?ee:xe[1]>le?le:0,se||G){if(!x)g[x++]=[se||xe[0],G||xe[1]];else if(fe){var Ze=Ee(fe,xe);Ze.length>1&&(Te(Ze[0]),g[x++]=Ze[1])}else pe=Ee(g[x-1],xe)[0],g[x++]=pe;var Xe=g[x-1];se&&G&&(Xe[0]!==se||Xe[1]!==G)?(fe&&(J!==se&&oe!==G?te(J&&oe?$e(fe,xe):[J||se,oe||G]):J&&oe&&te([J,oe])),te([se,G])):J-se&&oe-G&&te([se||J,G||oe]),fe=xe,J=se,oe=G}else fe&&Te(Ee(fe,xe)[0]),g[x++]=xe}for(_=0;_<w;_++)if(T=N(_),!!T){for(x=0,fe=null,de(T),_++;_<w;_++){if(S=N(_),!S){if(u)continue;break}if(!p||!r.simplify){de(S);continue}var he=N(_+1);if(O=q(S,T),!(!(m&&(x===0||x===w-1))&&O<j(S,he)*b)){for(E=[(S[0]-T[0])/O,(S[1]-T[1])/O],L=T,I=O,P=A=C=0,$=!1,k=S,_++;_<e.length;_++){if(D=he,he=N(_+1),!D){if(u)continue;break}if(z=[D[0]-T[0],D[1]-T[1]],R=z[0]*E[1]-z[1]*E[0],A=Math.min(A,R),C=Math.max(C,R),C-A>j(D,he))break;k=D,M=z[0]*E[0]+z[1]*E[1],M>I?(I=M,S=D,$=!1):M<P&&(P=M,L=D,$=!0)}if($?(de(S),k!==L&&de(L)):(L!==T&&de(L),k!==S&&de(S)),de(k),_>=e.length||!D)break;de(D),T=D}}fe&&te([J||fe[0],oe||fe[1]]),y.push(g.slice(0,x))}var Ae=d.slice(d.length-1);if(c&&Ae!=="h"&&Ae!=="v"){for(var Me=!1,we=-1,be=[],Ve=0;Ve<y.length;Ve++)for(var Fe=0;Fe<y[Ve].length-1;Fe++){var Oe=y[Ve][Fe],Ge=y[Ve][Fe+1],lt=hz.applyBackoff(Ge,Oe);(lt[0]!==Ge[0]||lt[1]!==Ge[1])&&(Me=!0),be[we+1]||(we++,be[we]=[Oe,[lt[0],lt[1]]])}return Me?be:y}return y},j0={tonextx:1,tonexty:1,tonext:1},N2=function(e,r,a){var i,n,o,l,s,f={},c=!1,v=-1,u=0,h=-1;for(n=0;n<a.length;n++)i=a[n][0].trace,o=i.stackgroup||"",o?o in f?s=f[o]:(s=f[o]=u,u++):i.fill in j0&&h>=0?s=h:(s=h=u,u++),s<v&&(c=!0),i._groupIndex=v=s;var d=a.slice();c&&d.sort(function(m,y){var b=m[0].trace,w=y[0].trace;return b._groupIndex-w._groupIndex||b.index-w.index});var p={};for(n=0;n<d.length;n++)i=d[n][0].trace,o=i.stackgroup||"",i.visible===!0?(i._nexttrace=null,i.fill in j0&&(l=p[o],i._prevtrace=l||null,l&&(l._nexttrace=i)),i._ownfill=i.fill&&(i.fill.substr(0,6)==="tozero"||i.fill==="toself"||i.fill.substr(0,2)==="to"&&!i._prevtrace),p[o]=i):i._prevtrace=i._nexttrace=i._ownfill=null;return d},Da=gt,yz=ot,ql=me,ho=ql.ensureSingle,H2=ql.identity,tr=$t,po=Ir,gz=mz,bz=N2,xz=UT.tester,_z=function(e,r,a,i,n,o){var l,s,f=!n,c=!!n&&n.duration>0,v=bz(e,r,a);if(l=i.selectAll("g.trace").data(v,function(h){return h[0].trace.uid}),l.enter().append("g").attr("class",function(h){return"trace scatter trace"+h[0].trace.uid}).style("stroke-miterlimit",2),l.order(),wz(e,l,r),c){o&&(s=o());var u=Da.transition().duration(n.duration).ease(n.easing).each("end",function(){s&&s()}).each("interrupt",function(){s&&s()});u.each(function(){i.selectAll("g.trace").each(function(h,d){B0(e,d,r,h,v,this,n)})})}else l.each(function(h,d){B0(e,d,r,h,v,this,n)});f&&l.exit().remove(),i.selectAll("path:not([d])").remove()};function wz(t,e,r){e.each(function(a){var i=ho(Da.select(this),"g","fills");tr.setClipUrl(i,r.layerClipId,t);var n=a[0].trace,o=[];n._ownfill&&o.push("_ownFill"),n._nexttrace&&o.push("_nextFill");var l=i.selectAll("g").data(o,H2);l.enter().append("g"),l.exit().each(function(s){n[s]=null}).remove(),l.order().each(function(s){n[s]=ho(Da.select(this),"path","js-fill")})})}function B0(t,e,r,a,i,n,o){var l=t._context.staticPlot,s;Tz(t,e,r,a,i);var f=!!o&&o.duration>0;function c(se){return f?se.transition():se}var v=r.xaxis,u=r.yaxis,h=a[0].trace,d=h.line,p=Da.select(n),m=ho(p,"g","errorbars"),y=ho(p,"g","lines"),b=ho(p,"g","points"),w=ho(p,"g","text");if(yz.getComponentMethod("errorbars","plot")(t,m,r,o),h.visible!==!0)return;c(p).style("opacity",h.opacity);var g,x,_=h.fill.charAt(h.fill.length-1);_!=="x"&&_!=="y"&&(_=""),a[0][r.isRangePlot?"nodeRangePlot3":"node3"]=p;var T="",k=[],S=h._prevtrace;S&&(T=S._prevRevpath||"",x=S._nextFill,k=S._polygons);var L,D,$="",E="",z,O,I,P,M,A,C,R=[],N=ql.noop;if(g=h._ownFill,po.hasLines(h)||h.fill!=="none"){for(x&&x.datum(a),["hv","vh","hvh","vhv"].indexOf(d.shape)!==-1?(z=tr.steps(d.shape),O=tr.steps(d.shape.split("").reverse().join(""))):d.shape==="spline"?z=O=function(se){var G=se[se.length-1];return se.length>1&&se[0][0]===G[0]&&se[0][1]===G[1]?tr.smoothclosed(se.slice(1),d.smoothing):tr.smoothopen(se,d.smoothing)}:z=O=function(se){return"M"+se.join("L")},I=function(se){return O(se.reverse())},R=gz(a,{xaxis:v,yaxis:u,trace:h,connectGaps:h.connectgaps,baseTolerance:Math.max(d.width||1,3)/4,shape:d.shape,backoff:d.backoff,simplify:d.simplify,fill:h.fill}),C=h._polygons=new Array(R.length),s=0;s<R.length;s++)h._polygons[s]=xz(R[s]);R.length&&(P=R[0][0],M=R[R.length-1],A=M[M.length-1]),N=function(se){return function(G){if(L=z(G),D=I(G),$?_?($+="L"+L.substr(1),E=D+("L"+E.substr(1))):($+="Z"+L,E=D+"Z"+E):($=L,E=D),po.hasLines(h)){var J=Da.select(this);if(J.datum(a),se)c(J.style("opacity",0).attr("d",L).call(tr.lineGroupStyle)).style("opacity",1);else{var oe=c(J);oe.attr("d",L),tr.singleLineStyle(a,oe)}}}}}var H=y.selectAll(".js-line").data(R);c(H.exit()).style("opacity",0).remove(),H.each(N(!1)),H.enter().append("path").classed("js-line",!0).style("vector-effect",l?"none":"non-scaling-stroke").call(tr.lineGroupStyle).each(N(!0)),tr.setClipUrl(H,r.layerClipId,t);function B(se){c(se).attr("d","M0,0Z")}R.length?(g?(g.datum(a),P&&A&&(_?(_==="y"?P[1]=A[1]=u.c2p(0,!0):_==="x"&&(P[0]=A[0]=v.c2p(0,!0)),c(g).attr("d","M"+A+"L"+P+"L"+$.substr(1)).call(tr.singleFillStyle,t)):c(g).attr("d",$+"Z").call(tr.singleFillStyle,t))):x&&(h.fill.substr(0,6)==="tonext"&&$&&T?(h.fill==="tonext"?c(x).attr("d",$+"Z"+T+"Z").call(tr.singleFillStyle,t):c(x).attr("d",$+"L"+T.substr(1)+"Z").call(tr.singleFillStyle,t),h._polygons=h._polygons.concat(k)):(B(x),h._polygons=null)),h._prevRevpath=E,h._prevPolygons=C):(g?B(g):x&&B(x),h._polygons=h._prevRevpath=h._prevPolygons=null);function X(se){return se.filter(function(G){return!G.gap&&G.vis})}function j(se){return se.filter(function(G){return G.vis})}function q(se){return se.filter(function(G){return!G.gap})}function U(se){return se.id}function Z(se){if(se.ids)return U}function K(){return!1}function ee(se,G,J){var oe,fe,pe,ge=J[0].trace,ue=po.hasMarkers(ge),Ce=po.hasText(ge),ce=Z(ge),De=K,Ee=K;if(ue||Ce){var $e=H2,te=ge.stackgroup,Te=te&&t._fullLayout._scatterStackOpts[v._id+u._id][te].stackgaps==="infer zero";ge.marker.maxdisplayed||ge._needsCull?$e=Te?j:X:te&&!Te&&($e=q),ue&&(De=$e),Ce&&(Ee=$e)}fe=se.selectAll("path.point"),oe=fe.data(De,ce);var ne=oe.enter().append("path").classed("point",!0);f&&ne.call(tr.pointStyle,ge,t).call(tr.translatePoints,v,u).style("opacity",0).transition().style("opacity",1),oe.order();var de;ue&&(de=tr.makePointStyleFns(ge)),oe.each(function(he){var Ae=Da.select(this),Me=c(Ae);pe=tr.translatePoint(he,Me,v,u),pe?(tr.singlePointStyle(he,Me,ge,de,t),r.layerClipId&&tr.hideOutsideRangePoint(he,Me,v,u,ge.xcalendar,ge.ycalendar),ge.customdata&&Ae.classed("plotly-customdata",he.data!==null&&he.data!==void 0)):Me.remove()}),f?oe.exit().transition().style("opacity",0).remove():oe.exit().remove(),fe=G.selectAll("g"),oe=fe.data(Ee,ce),oe.enter().append("g").classed("textpoint",!0).append("text"),oe.order(),oe.each(function(he){var Ae=Da.select(this),Me=c(Ae.select("text"));pe=tr.translatePoint(he,Me,v,u),pe?r.layerClipId&&tr.hideOutsideRangePoint(he,Ae,v,u,ge.xcalendar,ge.ycalendar):Ae.remove()}),oe.selectAll("text").call(tr.textPointStyle,ge,t).each(function(he){var Ae=v.c2p(he.x),Me=u.c2p(he.y);Da.select(this).selectAll("tspan.line").each(function(){c(Da.select(this)).attr({x:Ae,y:Me})})}),oe.exit().remove()}b.datum(a),w.datum(a),ee(b,w,a);var le=h.cliponaxis===!1,ye=le?null:r.layerClipId;tr.setClipUrl(b,ye,t),tr.setClipUrl(w,ye,t)}function Tz(t,e,r,a,i){var n=r.xaxis,o=r.yaxis,l=Da.extent(ql.simpleMap(n.range,n.r2c)),s=Da.extent(ql.simpleMap(o.range,o.r2c)),f=a[0].trace;if(po.hasMarkers(f)){var c=f.marker.maxdisplayed;if(c!==0){var v=a.filter(function(p){return p.x>=l[0]&&p.x<=l[1]&&p.y>=s[0]&&p.y<=s[1]}),u=Math.ceil(v.length/c),h=0;i.forEach(function(p,m){var y=p[0].trace;po.hasMarkers(y)&&y.marker.maxdisplayed>0&&m<e&&h++});var d=Math.round(h*u/3+Math.floor(h/3)*u/7.1);a.forEach(function(p){delete p.vis}),v.forEach(function(p,m){Math.round((m+d)%u)===0&&(p.vis=!0)})}}}var ps={container:"marker",min:"cmin",max:"cmax"},tf=Bt,O2=function(e,r,a){var i={},n={_fullLayout:a},o=tf.getFromTrace(n,r,"x"),l=tf.getFromTrace(n,r,"y"),s=e.orig_x;s===void 0&&(s=e.x);var f=e.orig_y;return f===void 0&&(f=e.y),i.xLabel=tf.tickText(o,o.c2l(s),!0).text,i.yLabel=tf.tickText(l,l.c2l(f),!0).text,i},kv=gt,So=$t,kz=ot;function Az(t){var e=kv.select(t).selectAll("g.trace.scatter");e.style("opacity",function(r){return r[0].trace.opacity}),e.selectAll("g.points").each(function(r){var a=kv.select(this),i=r.trace||r[0].trace;Xp(a,i,t)}),e.selectAll("g.text").each(function(r){var a=kv.select(this),i=r.trace||r[0].trace;Yp(a,i,t)}),e.selectAll("g.trace path.js-line").call(So.lineGroupStyle),e.selectAll("g.trace path.js-fill").call(So.fillGroupStyle,t),kz.getComponentMethod("errorbars","style")(e)}function Xp(t,e,r){So.pointStyle(t.selectAll("path.point"),e,r)}function Yp(t,e,r){So.textPointStyle(t.selectAll("text"),e,r)}function Mz(t,e,r){var a=e[0].trace;a.selectedpoints?(So.selectedPointStyle(r.selectAll("path.point"),a),So.selectedTextStyle(r.selectAll("text"),a)):(Xp(r,a,t),Yp(r,a,t))}var G0={style:Az,stylePoints:Xp,styleText:Yp,styleOnSelect:Mz},On=ht,Sz=Ir,j2=function(e,r){var a,i;if(e.mode==="lines")return a=e.line.color,a&&On.opacity(a)?a:e.fillcolor;if(e.mode==="none")return e.fill?e.fillcolor:"";var n=r.mcc||(e.marker||{}).color,o=r.mlcc||((e.marker||{}).line||{}).color;return i=n&&On.opacity(n)?n:o&&On.opacity(o)&&(r.mlw||((e.marker||{}).line||{}).width)?o:"",i?On.opacity(i)<.3?On.addOpacity(i,.3):i:(a=(e.line||{}).color,a&&On.opacity(a)&&Sz.hasLines(e)&&e.line.width?a:e.fillcolor)},ih=me,U0=Ia,Lz=ot,Cz=j2,Av=ht,Dz=ih.fillText,$z=function(e,r,a,i){var n=e.cd,o=n[0].trace,l=e.xa,s=e.ya,f=l.c2p(r),c=s.c2p(a),v=[f,c],u=o.hoveron||"",h=o.mode.indexOf("markers")!==-1?3:.5,d=!!o.xperiodalignment,p=!!o.yperiodalignment;if(u.indexOf("points")!==-1){var m=function(K){if(d){var ee=l.c2p(K.xStart),le=l.c2p(K.xEnd);return f>=Math.min(ee,le)&&f<=Math.max(ee,le)?0:1/0}var ye=Math.max(3,K.mrc||0),se=1-1/ye,G=Math.abs(l.c2p(K.x)-f);return G<ye?se*G/ye:G-ye+se},y=function(K){if(p){var ee=s.c2p(K.yStart),le=s.c2p(K.yEnd);return c>=Math.min(ee,le)&&c<=Math.max(ee,le)?0:1/0}var ye=Math.max(3,K.mrc||0),se=1-1/ye,G=Math.abs(s.c2p(K.y)-c);return G<ye?se*G/ye:G-ye+se},b=function(K){var ee=Math.max(h,K.mrc||0),le=l.c2p(K.x)-f,ye=s.c2p(K.y)-c;return Math.max(Math.sqrt(le*le+ye*ye)-ee,1-h/ee)},w=U0.getDistanceFunction(i,m,y,b);if(U0.getClosest(n,w,e),e.index!==!1){var g=n[e.index],x=l.c2p(g.x,!0),_=s.c2p(g.y,!0),T=g.mrc||1;e.index=g.i;var k=n[0].t.orientation,S=k&&(g.sNorm||g.s),L=k==="h"?S:g.orig_x!==void 0?g.orig_x:g.x,D=k==="v"?S:g.orig_y!==void 0?g.orig_y:g.y;return ih.extendFlat(e,{color:Cz(o,g),x0:x-T,x1:x+T,xLabelVal:L,y0:_-T,y1:_+T,yLabelVal:D,spikeDistance:b(g),hovertemplate:o.hovertemplate}),Dz(g,o,e),Lz.getComponentMethod("errorbars","hoverInfo")(g,o,e),[e]}}if(u.indexOf("fills")!==-1&&o._polygons){var $=o._polygons,E=[],z=!1,O=1/0,I=-1/0,P=1/0,M=-1/0,A,C,R,N,H,B,X,j,q;for(A=0;A<$.length;A++)R=$[A],R.contains(v)&&(z=!z,E.push(R),P=Math.min(P,R.ymin),M=Math.max(M,R.ymax));if(z){P=Math.max(P,0),M=Math.min(M,s._length);var U=(P+M)/2;for(A=0;A<E.length;A++)for(N=E[A].pts,C=1;C<N.length;C++)j=N[C-1][1],q=N[C][1],j>U!=q>=U&&(B=N[C-1][0],X=N[C][0],q-j&&(H=B+(X-B)*(U-j)/(q-j),O=Math.min(O,H),I=Math.max(I,H)));O=Math.max(O,0),I=Math.min(I,l._length);var Z=Av.defaultLine;return Av.opacity(o.fillcolor)?Z=o.fillcolor:Av.opacity((o.line||{}).color)&&(Z=o.line.color),ih.extendFlat(e,{distance:e.maxHoverDistance,x0:O,x1:I,y0:U,y1:U,color:Z,hovertemplate:!1}),delete e.index,o.text&&!Array.isArray(o.text)?e.text=String(o.text):e.text=o.name,[e]}}},V0=Ir,Pz=function(e,r){var a=e.cd,i=e.xaxis,n=e.yaxis,o=[],l=a[0].trace,s,f,c,v,u=!V0.hasMarkers(l)&&!V0.hasText(l);if(u)return[];if(r===!1)for(s=0;s<a.length;s++)a[s].selected=0;else for(s=0;s<a.length;s++)f=a[s],c=i.c2p(f.x),v=n.c2p(f.y),f.i!==null&&r.contains([c,v],!1,s,e)?(o.push({pointNumber:f.i,x:i.c2d(f.x),y:n.c2d(f.y)}),f.selected=1):f.selected=0;return o},ur={},Mv,X0;function Rz(){return X0||(X0=1,Mv={xaxis:{valType:"subplotid",dflt:"x",editType:"calc+clearAxisTypes",description:["Sets a reference between this trace's x coordinates and","a 2D cartesian x axis.","If *x* (the default value), the x coordinates refer to","`layout.xaxis`.","If *x2*, the x coordinates refer to `layout.xaxis2`, and so on."].join(" ")},yaxis:{valType:"subplotid",dflt:"y",editType:"calc+clearAxisTypes",description:["Sets a reference between this trace's y coordinates and","a 2D cartesian y axis.","If *y* (the default value), the y coordinates refer to","`layout.yaxis`.","If *y2*, the y coordinates refer to `layout.yaxis2`, and so on."].join(" ")}}),Mv}var Sv,Y0;function Ez(){if(Y0)return Sv;Y0=1;var t=ot.traceIs,e=Mw;Sv=function(l,s,f,c){f("autotypenumbers",c.autotypenumbersDflt);var v=f("type",(c.splomStash||{}).type);v==="-"&&(r(s,c.data),s.type==="-"?s.type="linear":l.type=s.type)};function r(o,l){if(o.type==="-"){var s=o._id,f=s.charAt(0),c;s.indexOf("scene")!==-1&&(s=f);var v=a(l,s,f);if(v){if(v.type==="histogram"&&f==={v:"y",h:"x"}[v.orientation||"v"]){o.type="linear";return}var u=f+"calendar",h=v[u],d={noMultiCategory:!t(v,"cartesian")||t(v,"noMultiCategory")};if(v.type==="box"&&v._hasPreCompStats&&f==={h:"x",v:"y"}[v.orientation||"v"]&&(d.noMultiCategory=!0),d.autotypenumbers=o.autotypenumbers,n(v,f)){var p=i(v),m=[];for(c=0;c<l.length;c++){var y=l[c];!t(y,"box-violin")||(y[f+"axis"]||f)!==s||(y[p]!==void 0?m.push(y[p][0]):y.name!==void 0?m.push(y.name):m.push("text"),y[u]!==h&&(h=void 0))}o.type=e(m,h,d)}else if(v.type==="splom"){var b=v.dimensions,w=b[v._axesDim[s]];w.visible&&(o.type=e(w.values,h,d))}else o.type=e(v[f]||[v[f+"0"]],h,d)}}}function a(o,l,s){for(var f=0;f<o.length;f++){var c=o[f];if(c.type==="splom"&&c._length>0&&(c["_"+s+"axes"]||{})[l])return c;if((c[s+"axis"]||s)===l){if(n(c,s))return c;if((c[s]||[]).length||c[s+"0"])return c}}}function i(o){return{v:"x",h:"y"}[o.orientation||"v"]}function n(o,l){var s=i(o),f=t(o,"box-violin"),c=t(o._fullInput||{},"candlestick");return f&&!c&&l===s&&o[s]===void 0&&o[s+"0"]===void 0}return Sv}function zz(t,e){var r=e.dataAttr||t._id.charAt(0),a={},i,n,o;if(e.axData)i=e.axData;else for(i=[],n=0;n<e.data.length;n++){var l=e.data[n];l[r+"axis"]===t._id&&i.push(l)}for(n=0;n<i.length;n++){var s=i[n][r];for(o=0;o<s.length;o++){var f=s[o];f!=null&&(a[f]=1)}}return Object.keys(a)}var Iz=function(e,r,a,i){if(r.type==="category"){var n=e.categoryarray,o=Array.isArray(n)&&n.length>0,l;o&&(l="array");var s=a("categoryorder",l),f;s==="array"&&(f=a("categoryarray")),!o&&s==="array"&&(s=r.categoryorder="trace"),s==="trace"?r._initialCategories=[]:s==="array"?r._initialCategories=f.slice():(f=zz(r,i).sort(),s==="category ascending"?r._initialCategories=f:s==="category descending"&&(r._initialCategories=f.reverse()))}},W0=ga.mix,Fz=zr,Nz=me,Hz=function(e,r,a,i){i=i||{};var n=i.dfltColor;function o(T,k){return Nz.coerce2(e,r,i.attributes,T,k)}var l=o("linecolor",n),s=o("linewidth"),f=a("showline",i.showLine||!!l||!!s);f||(delete r.linecolor,delete r.linewidth);var c=W0(n,i.bgColor,i.blend||Fz.lightFraction).toRgbString(),v=o("gridcolor",c),u=o("gridwidth"),h=o("griddash"),d=a("showgrid",i.showGrid||!!v||!!u||!!h);if(d||(delete r.gridcolor,delete r.gridwidth,delete r.griddash),i.hasMinor){var p=W0(r.gridcolor,i.bgColor,67).toRgbString(),m=o("minor.gridcolor",p),y=o("minor.gridwidth",r.gridwidth||1),b=o("minor.griddash",r.griddash||"solid"),w=a("minor.showgrid",!!m||!!y||!!b);w||(delete r.minor.gridcolor,delete r.minor.gridwidth,delete r.minor.griddash)}if(!i.noZeroLine){var g=o("zerolinecolor",n),x=o("zerolinewidth"),_=a("zeroline",i.showGrid||!!g||!!x);_||(delete r.zerolinecolor,delete r.zerolinewidth)}},q0=wt,Oz=ot,wl=me,jz=Ht,Bz=Ka,nh=Za,Z0=lw,K0=sw,Gz=uw,Uz=vw,Vz=Iz,Xz=Hz,Yz=jw,Q0=rp,$f=Gr.WEEKDAY_PATTERN,Wz=Gr.HOUR_PATTERN,B2=function(e,r,a,i,n){var o=i.letter,l=i.font||{},s=i.splomStash||{},f=a("visible",!i.visibleDflt),c=r._template||{},v=r.type||c.type||"-",u;if(v==="date"){var h=Oz.getComponentMethod("calendars","handleDefaults");h(e,r,"calendar",i.calendar),i.noTicklabelmode||(u=a("ticklabelmode"))}var d="";(!i.noTicklabelposition||v==="multicategory")&&(d=wl.coerce(e,r,{ticklabelposition:{valType:"enumerated",dflt:"outside",values:u==="period"?["outside","inside"]:o==="x"?["outside","inside","outside left","inside left","outside right","inside right"]:["outside","inside","outside top","inside top","outside bottom","inside bottom"]}},"ticklabelposition")),i.noTicklabeloverflow||a("ticklabeloverflow",d.indexOf("inside")!==-1?"hide past domain":v==="category"||v==="multicategory"?"allow":"hide past div"),Q0(r,n),Yz(e,r,a,i),Vz(e,r,a,i),v!=="category"&&!i.noHover&&a("hoverformat");var p=a("color"),m=p!==nh.color.dflt?p:l.color,y=s.label||n._dfltTitle[o];if(Uz(e,r,a,v,i),!f)return r;a("title.text",y),wl.coerceFont(a,"title.font",{family:l.family,size:wl.bigFont(l.size),color:m}),Z0(e,r,a,v);var b=i.hasMinor;if(b&&(jz.newContainer(r,"minor"),Z0(e,r,a,v,{isMinor:!0})),Gz(e,r,a,v,i),K0(e,r,a,i),b){var w=i.isMinor;i.isMinor=!0,K0(e,r,a,i),i.isMinor=w}Xz(e,r,a,{dfltColor:p,bgColor:i.bgColor,showGrid:i.showGrid,hasMinor:b,attributes:nh}),b&&!r.minor.ticks&&!r.minor.showgrid&&delete r.minor,(r.showline||r.ticks)&&a("mirror");var g=v==="multicategory";if(!i.noTickson&&(v==="category"||g)&&(r.ticks||r.showgrid)){var x;g&&(x="boundaries");var _=a("tickson",x);_==="boundaries"&&delete r.ticklabelposition}if(g){var T=a("showdividers");T&&(a("dividercolor"),a("dividerwidth"))}if(v==="date")if(Bz(e,r,{name:"rangebreaks",inclusionAttr:"enabled",handleItemDefaults:qz}),!r.rangebreaks.length)delete r.rangebreaks;else{for(var k=0;k<r.rangebreaks.length;k++)if(r.rangebreaks[k].pattern===$f){r._hasDayOfWeekBreaks=!0;break}if(Q0(r,n),n._has("scattergl")||n._has("splom"))for(var S=0;S<i.data.length;S++){var L=i.data[S];(L.type==="scattergl"||L.type==="splom")&&(L.visible=!1,wl.warn(L.type+" traces do not work on axes with rangebreaks. Setting trace "+L.index+" to `visible: false`."))}}return r};function qz(t,e,r){function a(u,h){return wl.coerce(t,e,nh.rangebreaks,u,h)}var i=a("enabled");if(i){var n=a("bounds");if(n&&n.length>=2){var o="",l,s;if(n.length===2){for(l=0;l<2;l++)if(s=J0(n[l]),s){o=$f;break}}var f=a("pattern",o);if(f===$f)for(l=0;l<2;l++)s=J0(n[l]),s&&(e.bounds[l]=n[l]=s-1);if(f)for(l=0;l<2;l++)switch(s=n[l],f){case $f:if(!q0(s)){e.enabled=!1;return}if(s=+s,s!==Math.floor(s)||s<0||s>=7){e.enabled=!1;return}e.bounds[l]=n[l]=s;break;case Wz:if(!q0(s)){e.enabled=!1;return}if(s=+s,s<0||s>24){e.enabled=!1;return}e.bounds[l]=n[l]=s;break}if(r.autorange===!1){var c=r.range;if(c[0]<c[1]){if(n[0]<c[0]&&n[1]>c[1]){e.enabled=!1;return}}else if(n[0]>c[0]&&n[1]<c[1]){e.enabled=!1;return}}}else{var v=a("values");if(v&&v.length)a("dvalue");else{e.enabled=!1;return}}}}var Zz={sun:1,mon:2,tue:3,wed:4,thu:5,fri:6,sat:7};function J0(t){if(typeof t=="string")return Zz[t.substr(0,3).toLowerCase()]}var Kz=wt,rf=me,G2=function(e,r,a,i){var n=i.counterAxes||[],o=i.overlayableAxes||[],l=i.letter,s=i.grid,f=i.overlayingDomain,c,v,u,h,d,p;s&&(v=s._domains[l][s._axisMap[r._id]],c=s._anchors[r._id],v&&(u=s[l+"side"].split(" ")[0],h=s.domain[l][u==="right"||u==="top"?1:0])),v=v||[0,1],c=c||(Kz(e.position)?"free":n[0]||"free"),u=u||(l==="x"?"bottom":"left"),h=h||0,d=0,p=!1;var m=rf.coerce(e,r,{anchor:{valType:"enumerated",values:["free"].concat(n),dflt:c}},"anchor"),y=rf.coerce(e,r,{side:{valType:"enumerated",values:l==="x"?["bottom","top"]:["left","right"],dflt:u}},"side");if(m==="free"){if(l==="y"){var b=a("autoshift");b&&(h=y==="left"?f[0]:f[1],p=r.automargin?r.automargin:!0,d=y==="left"?-3:3),a("shift",d)}a("position",h)}a("automargin",p);var w=!1;if(o.length&&(w=rf.coerce(e,r,{overlaying:{valType:"enumerated",values:[!1].concat(o),dflt:!1}},"overlaying")),!w){var g=a("domain",v);g[0]>g[1]-1/4096&&(r.domain=v),rf.noneOrAll(e.domain,r.domain,v),r.tickmode==="sync"&&(r.tickmode="auto")}return a("layer"),r},Lv,eb;function Qz(){if(eb)return Lv;eb=1;var t=me,e=ht,r=xa.isUnifiedHover,a=oT,i=Ht,n=os,o=Za,l=Ez(),s=B2,f=ui,c=G2,v=lr,u=v.id2name,h=v.name2id,d=Gr.AX_ID_PATTERN,p=ot,m=p.traceIs,y=p.getComponentMethod;function b(w,g,x){Array.isArray(w[g])?w[g].push(x):w[g]=[x]}return Lv=function(g,x,_){var T=x.autotypenumbers,k={},S={},L={},D={},$={},E={},z={},O={},I={},P={},M,A;for(M=0;M<_.length;M++){var C=_[M];if(!(!m(C,"cartesian")&&!m(C,"gl2d"))){var R;if(C.xaxis)R=u(C.xaxis),b(k,R,C);else if(C.xaxes)for(A=0;A<C.xaxes.length;A++)b(k,u(C.xaxes[A]),C);var N;if(C.yaxis)N=u(C.yaxis),b(k,N,C);else if(C.yaxes)for(A=0;A<C.yaxes.length;A++)b(k,u(C.yaxes[A]),C);if(C.type==="funnel"?C.orientation==="h"?(R&&(S[R]=!0),N&&(z[N]=!0)):N&&(L[N]=!0):C.type==="image"?(N&&(O[N]=!0),R&&(O[R]=!0)):(N&&($[N]=!0,E[N]=!0),(!m(C,"carpet")||C.type==="carpet"&&!C._cheater)&&R&&(D[R]=!0)),C.type==="carpet"&&C._cheater&&R&&(S[R]=!0),m(C,"2dMap")&&(I[R]=!0,I[N]=!0),m(C,"oriented")){var H=C.orientation==="h"?N:R;P[H]=!0}}}var B=x._subplots,X=B.xaxis,j=B.yaxis,q=t.simpleMap(X,u),U=t.simpleMap(j,u),Z=q.concat(U),K=e.background;X.length&&j.length&&(K=t.coerce(g,x,n,"plot_bgcolor"));var ee=e.combine(K,x.paper_bgcolor),le,ye,se,G,J;function oe(){var Je=k[le]||[];J._traceIndices=Je.map(function(F){return F._expandedIndex}),J._annIndices=[],J._shapeIndices=[],J._selectionIndices=[],J._imgIndices=[],J._subplotsWith=[],J._counterAxes=[],J._name=J._attr=le,J._id=ye}function fe(Je,F){return t.coerce(G,J,o,Je,F)}function pe(Je,F){return t.coerce2(G,J,o,Je,F)}function ge(Je){return Je==="x"?j:X}function ue(Je,F){for(var W=Je==="x"?q:U,Y=[],V=0;V<W.length;V++){var ie=W[V];ie!==F&&!(g[ie]||{}).overlaying&&Y.push(h(ie))}return Y}var Ce={x:ge("x"),y:ge("y")},ce=Ce.x.concat(Ce.y),De={},Ee=[];function $e(){var Je=G.matches;d.test(Je)&&ce.indexOf(Je)===-1&&(De[Je]=G.type,Ee=Object.keys(De))}var te=a(g,x),Te=r(te);for(M=0;M<Z.length;M++){le=Z[M],ye=h(le),se=le.charAt(0),t.isPlainObject(g[le])||(g[le]={}),G=g[le],J=i.newContainer(x,le,se+"axis"),oe();var ne=se==="x"&&!D[le]&&S[le]||se==="y"&&!$[le]&&L[le],de=se==="y"&&(!E[le]&&z[le]||O[le]),he={hasMinor:!0,letter:se,font:x.font,outerTicks:I[le],showGrid:!P[le],data:k[le]||[],bgColor:ee,calendar:x.calendar,automargin:!0,visibleDflt:ne,reverseDflt:de,autotypenumbersDflt:T,splomStash:((x._splomAxes||{})[se]||{})[ye]};fe("uirevision",x.uirevision),l(G,J,fe,he),s(G,J,fe,he,x);var Ae=Te&&se===te.charAt(0),Me=pe("spikecolor",Te?J.color:void 0),we=pe("spikethickness",Te?1.5:void 0),be=pe("spikedash",Te?"dot":void 0),Ve=pe("spikemode",Te?"across":void 0),Fe=pe("spikesnap"),Oe=fe("showspikes",!!Ae||!!Me||!!we||!!be||!!Ve||!!Fe);Oe||(delete J.spikecolor,delete J.spikethickness,delete J.spikedash,delete J.spikemode,delete J.spikesnap);var Ge=u(G.overlaying),lt=[0,1];if(x[Ge]!==void 0){var xe=u(x[Ge].anchor);x[xe]!==void 0&&(lt=x[xe].domain)}c(G,J,fe,{letter:se,counterAxes:Ce[se],overlayableAxes:ue(se,le),grid:x.grid,overlayingDomain:lt}),fe("title.standoff"),$e(),J._input=G}for(M=0;M<Ee.length;){ye=Ee[M++],le=u(ye),se=le.charAt(0),t.isPlainObject(g[le])||(g[le]={}),G=g[le],J=i.newContainer(x,le,se+"axis"),oe();var Ze={letter:se,font:x.font,outerTicks:I[le],showGrid:!P[le],data:[],bgColor:ee,calendar:x.calendar,automargin:!0,visibleDflt:!1,reverseDflt:!1,autotypenumbersDflt:T,splomStash:((x._splomAxes||{})[se]||{})[ye]};fe("uirevision",x.uirevision),J.type=De[ye]||"linear",s(G,J,fe,Ze,x),c(G,J,fe,{letter:se,counterAxes:Ce[se],overlayableAxes:ue(se,le),grid:x.grid}),fe("fixedrange"),$e(),J._input=G}var Xe=y("rangeslider","handleDefaults"),Ye=y("rangeselector","handleDefaults");for(M=0;M<q.length;M++)le=q[M],G=g[le],J=x[le],Xe(g,x,le),J.type==="date"&&Ye(G,J,x,U,J.calendar),fe("fixedrange");for(M=0;M<U.length;M++){le=U[M],G=g[le],J=x[le];var He=x[u(J.anchor)],Ue=y("rangeslider","isVisible")(He);fe("fixedrange",Ue)}f.handleDefaults(g,x,{axIds:ce.concat(Ee).sort(v.idSort),axHasImage:O})},Lv}var Cv,tb;function Jz(){if(tb)return Cv;tb=1;var t=gt,e=ot,r=me,a=$t,i=Bt;return Cv=function(o,l,s,f){var c=o._fullLayout;if(l.length===0){i.redrawComponents(o);return}function v(x){var _=x.xaxis,T=x.yaxis;c._defs.select("#"+x.clipId+"> rect").call(a.setTranslate,0,0).call(a.setScale,1,1),x.plot.call(a.setTranslate,_._offset,T._offset).call(a.setScale,1,1);var k=x.plot.selectAll(".scatterlayer .trace");k.selectAll(".point").call(a.setPointGroupScale,1,1),k.selectAll(".textpoint").call(a.setTextPointsScale,1,1),k.call(a.hideOutsideRangePoints,x)}function u(x,_){var T=x.plotinfo,k=T.xaxis,S=T.yaxis,L=k._length,D=S._length,$=!!x.xr1,E=!!x.yr1,z=[];if($){var O=r.simpleMap(x.xr0,k.r2l),I=r.simpleMap(x.xr1,k.r2l),P=O[1]-O[0],M=I[1]-I[0];z[0]=(O[0]*(1-_)+_*I[0]-O[0])/(O[1]-O[0])*L,z[2]=L*(1-_+_*M/P),k.range[0]=k.l2r(O[0]*(1-_)+_*I[0]),k.range[1]=k.l2r(O[1]*(1-_)+_*I[1])}else z[0]=0,z[2]=L;if(E){var A=r.simpleMap(x.yr0,S.r2l),C=r.simpleMap(x.yr1,S.r2l),R=A[1]-A[0],N=C[1]-C[0];z[1]=(A[1]*(1-_)+_*C[1]-A[1])/(A[0]-A[1])*D,z[3]=D*(1-_+_*N/R),S.range[0]=k.l2r(A[0]*(1-_)+_*C[0]),S.range[1]=S.l2r(A[1]*(1-_)+_*C[1])}else z[1]=0,z[3]=D;i.drawOne(o,k,{skipTitle:!0}),i.drawOne(o,S,{skipTitle:!0}),i.redrawComponents(o,[k._id,S._id]);var H=$?L/z[2]:1,B=E?D/z[3]:1,X=$?z[0]:0,j=E?z[1]:0,q=$?z[0]/z[2]*L:0,U=E?z[1]/z[3]*D:0,Z=k._offset-q,K=S._offset-U;T.clipRect.call(a.setTranslate,X,j).call(a.setScale,1/H,1/B),T.plot.call(a.setTranslate,Z,K).call(a.setScale,H,B),a.setPointGroupScale(T.zoomScalePts,1/H,1/B),a.setTextPointsScale(T.zoomScaleTxt,1/H,1/B)}var h;f&&(h=f());function d(){for(var x={},_=0;_<l.length;_++){var T=l[_],k=T.plotinfo.xaxis,S=T.plotinfo.yaxis;T.xr1&&(x[k._name+".range"]=T.xr1.slice()),T.yr1&&(x[S._name+".range"]=T.yr1.slice())}return h&&h(),e.call("relayout",o,x).then(function(){for(var L=0;L<l.length;L++)v(l[L].plotinfo)})}function p(){for(var x={},_=0;_<l.length;_++){var T=l[_],k=T.plotinfo.xaxis,S=T.plotinfo.yaxis;T.xr0&&(x[k._name+".range"]=T.xr0.slice()),T.yr0&&(x[S._name+".range"]=T.yr0.slice())}return e.call("relayout",o,x).then(function(){for(var L=0;L<l.length;L++)v(l[L].plotinfo)})}var m,y,b,w=t.ease(s.easing);o._transitionData._interruptCallbacks.push(function(){return window.cancelAnimationFrame(b),b=null,p()});function g(){y=Date.now();for(var x=Math.min(1,(y-m)/s.duration),_=w(x),T=0;T<l.length;T++)u(l[T],_);y-m>s.duration?(d(),b=window.cancelAnimationFrame(g)):b=window.requestAnimationFrame(g)}return m=Date.now(),b=window.requestAnimationFrame(g),Promise.resolve()},Cv}var su=gt,rb=ot,lc=me,eI=cr,tI=$t,ab=ss.getModuleCalcData,Di=lr,Xa=Gr,rI=Sn,Nt=lc.ensureSingle;function af(t,e,r){return lc.ensureSingle(t,e,r,function(a){a.datum(r)})}ur.name="cartesian";ur.attr=["xaxis","yaxis"];ur.idRoot=["x","y"];ur.idRegex=Xa.idRegex;ur.attrRegex=Xa.attrRegex;ur.attributes=Rz();ur.layoutAttributes=Za;ur.supplyLayoutDefaults=Qz();ur.transitionAxes=Jz();ur.finalizeSubplots=function(t,e){var r=e._subplots,a=r.xaxis,i=r.yaxis,n=r.cartesian,o=n.concat(r.gl2d||[]),l={},s={},f,c,v;for(f=0;f<o.length;f++){var u=o[f].split("y");l[u[0]]=1,s["y"+u[1]]=1}for(f=0;f<a.length;f++)c=a[f],l[c]||(v=(t[Di.id2name(c)]||{}).anchor,Xa.idRegex.y.test(v)||(v="y"),n.push(c+v),o.push(c+v),s[v]||(s[v]=1,lc.pushUnique(i,v)));for(f=0;f<i.length;f++)v=i[f],s[v]||(c=(t[Di.id2name(v)]||{}).anchor,Xa.idRegex.x.test(c)||(c="x"),n.push(c+v),o.push(c+v),l[c]||(l[c]=1,lc.pushUnique(a,c)));if(!o.length){c="",v="";for(var h in t)if(Xa.attrRegex.test(h)){var d=h.charAt(0);d==="x"?(!c||+h.substr(5)<+c.substr(5))&&(c=h):(!v||+h.substr(5)<+v.substr(5))&&(v=h)}c=c?Di.name2id(c):"x",v=v?Di.name2id(v):"y",a.push(c),i.push(v),n.push(c+v)}};ur.plot=function(t,e,r,a){var i=t._fullLayout,n=i._subplots.cartesian,o=t.calcdata,l;if(!Array.isArray(e))for(e=[],l=0;l<o.length;l++)e.push(l);for(l=0;l<n.length;l++){for(var s=n[l],f=i._plots[s],c=[],v,u=0;u<o.length;u++){var h=o[u],d=h[0].trace;d.xaxis+d.yaxis===s&&((e.indexOf(d.index)!==-1||d.carpet)&&(v&&v[0].trace.xaxis+v[0].trace.yaxis===s&&["tonextx","tonexty","tonext"].indexOf(d.fill)!==-1&&c.indexOf(v)===-1&&c.push(v),c.push(h)),v=h)}U2(t,f,c,r,a)}};function U2(t,e,r,a,i){for(var n=Xa.traceLayerClasses,o=t._fullLayout,l=o._modules,s,f,c,v=[],u=[],h=0;h<l.length;h++){s=l[h];var d=s.name,p=rb.modules[d].categories;if(p.svg){var m=s.layerName||d+"layer",y=s.plot;f=ab(r,y),c=f[0],r=f[1],c.length&&v.push({i:n.indexOf(m),className:m,plotMethod:y,cdModule:c}),p.zoomScale&&u.push("."+m)}}v.sort(function(g,x){return g.i-x.i});var b=e.plot.selectAll("g.mlayer").data(v,function(g){return g.className});if(b.enter().append("g").attr("class",function(g){return g.className}).classed("mlayer",!0).classed("rangeplot",e.isRangePlot),b.exit().remove(),b.order(),b.each(function(g){var x=su.select(this),_=g.className;g.plotMethod(t,e,g.cdModule,x,a,i),Xa.clipOnAxisFalseQuery.indexOf("."+_)===-1&&tI.setClipUrl(x,e.layerClipId,t)}),o._has("scattergl")&&(s=rb.getModule("scattergl"),c=ab(r,s)[0],s.plot(t,e,c)),!t._context.staticPlot&&(e._hasClipOnAxisFalse&&(e.clipOnAxisFalseTraces=e.plot.selectAll(Xa.clipOnAxisFalseQuery.join(",")).selectAll(".trace")),u.length)){var w=e.plot.selectAll(u.join(",")).selectAll(".trace");e.zoomScalePts=w.selectAll("path.point"),e.zoomScaleTxt=w.selectAll(".textpoint")}}ur.clean=function(t,e,r,a){var i=a._plots||{},n=e._plots||{},o=a._subplots||{},l,s,f;if(a._hasOnlyLargeSploms&&!e._hasOnlyLargeSploms)for(f in i)l=i[f],l.plotgroup&&l.plotgroup.remove();var c=a._has&&a._has("gl"),v=e._has&&e._has("gl");if(c&&!v)for(f in i)l=i[f],l._scene&&l._scene.destroy();if(o.xaxis&&o.yaxis){var u=Di.listIds({_fullLayout:a});for(s=0;s<u.length;s++){var h=u[s];e[Di.id2name(h)]||a._infolayer.selectAll(".g-"+h+"title").remove()}}var d=a._has&&a._has("cartesian"),p=e._has&&e._has("cartesian");if(d&&!p)X2(a._cartesianlayer.selectAll(".subplot"),a),a._defs.selectAll(".axesclip").remove(),delete a._axisConstraintGroups,delete a._axisMatchGroups;else if(o.cartesian)for(s=0;s<o.cartesian.length;s++){var m=o.cartesian[s];if(!n[m]){var y="."+m+",."+m+"-x,."+m+"-y";a._cartesianlayer.selectAll(y).remove(),Y2(m,a)}}};ur.drawFramework=function(t){var e=t._fullLayout,r=aI(t),a=e._cartesianlayer.selectAll(".subplot").data(r,String);a.enter().append("g").attr("class",function(i){return"subplot "+i[0]}),a.order(),a.exit().call(X2,e),a.each(function(i){var n=i[0],o=e._plots[n];o.plotgroup=su.select(this),V2(t,o),o.draglayer=Nt(e._draggers,"g",n)})};ur.rangePlot=function(t,e,r){V2(t,e),U2(t,e,r),eI.style(t)};function aI(t){var e=t._fullLayout,r=e._subplots.cartesian,a=r.length,i,n,o,l,s,f,c=[],v=[];for(i=0;i<a;i++){o=r[i],l=e._plots[o],s=l.xaxis,f=l.yaxis;var u=s._mainAxis,h=f._mainAxis,d=u._id+h._id,p=e._plots[d];l.overlays=[],d!==o&&p?(l.mainplot=d,l.mainplotinfo=p,v.push(o)):(l.mainplot=void 0,l.mainplotinfo=void 0,c.push(o))}for(i=0;i<v.length;i++)o=v[i],l=e._plots[o],l.mainplotinfo.overlays.push(l);var m=c.concat(v),y=new Array(a);for(i=0;i<a;i++){o=m[i],l=e._plots[o],s=l.xaxis,f=l.yaxis;var b=[o,s.layer,f.layer,s.overlaying||"",f.overlaying||""];for(n=0;n<l.overlays.length;n++)b.push(l.overlays[n].id);y[i]=b}return y}function V2(t,e){var r=e.plotgroup,a=e.id,i=Xa.layerValue2layerClass[e.xaxis.layer],n=Xa.layerValue2layerClass[e.yaxis.layer],o=t._fullLayout._hasOnlyLargeSploms;if(e.mainplot){var s=e.mainplotinfo,f=s.plotgroup,c=a+"-x",v=a+"-y";e.minorGridlayer=s.minorGridlayer,e.gridlayer=s.gridlayer,e.zerolinelayer=s.zerolinelayer,Nt(s.overlinesBelow,"path",c),Nt(s.overlinesBelow,"path",v),Nt(s.overaxesBelow,"g",c),Nt(s.overaxesBelow,"g",v),e.plot=Nt(s.overplot,"g",a),Nt(s.overlinesAbove,"path",c),Nt(s.overlinesAbove,"path",v),Nt(s.overaxesAbove,"g",c),Nt(s.overaxesAbove,"g",v),e.xlines=f.select(".overlines-"+i).select("."+c),e.ylines=f.select(".overlines-"+n).select("."+v),e.xaxislayer=f.select(".overaxes-"+i).select("."+c),e.yaxislayer=f.select(".overaxes-"+n).select("."+v)}else if(o)e.xlines=Nt(r,"path","xlines-above"),e.ylines=Nt(r,"path","ylines-above"),e.xaxislayer=Nt(r,"g","xaxislayer-above"),e.yaxislayer=Nt(r,"g","yaxislayer-above");else{var l=Nt(r,"g","layer-subplot");e.shapelayer=Nt(l,"g","shapelayer"),e.imagelayer=Nt(l,"g","imagelayer"),e.minorGridlayer=Nt(r,"g","minor-gridlayer"),e.gridlayer=Nt(r,"g","gridlayer"),e.zerolinelayer=Nt(r,"g","zerolinelayer"),Nt(r,"path","xlines-below"),Nt(r,"path","ylines-below"),e.overlinesBelow=Nt(r,"g","overlines-below"),Nt(r,"g","xaxislayer-below"),Nt(r,"g","yaxislayer-below"),e.overaxesBelow=Nt(r,"g","overaxes-below"),e.plot=Nt(r,"g","plot"),e.overplot=Nt(r,"g","overplot"),e.xlines=Nt(r,"path","xlines-above"),e.ylines=Nt(r,"path","ylines-above"),e.overlinesAbove=Nt(r,"g","overlines-above"),Nt(r,"g","xaxislayer-above"),Nt(r,"g","yaxislayer-above"),e.overaxesAbove=Nt(r,"g","overaxes-above"),e.xlines=r.select(".xlines-"+i),e.ylines=r.select(".ylines-"+n),e.xaxislayer=r.select(".xaxislayer-"+i),e.yaxislayer=r.select(".yaxislayer-"+n)}o||(af(e.minorGridlayer,"g",e.xaxis._id),af(e.minorGridlayer,"g",e.yaxis._id),e.minorGridlayer.selectAll("g").map(function(u){return u[0]}).sort(Di.idSort),af(e.gridlayer,"g",e.xaxis._id),af(e.gridlayer,"g",e.yaxis._id),e.gridlayer.selectAll("g").map(function(u){return u[0]}).sort(Di.idSort)),e.xlines.style("fill","none").classed("crisp",!0),e.ylines.style("fill","none").classed("crisp",!0)}function X2(t,e){if(t){var r={};t.each(function(s){var f=s[0],c=su.select(this);c.remove(),Y2(f,e),r[f]=!0});for(var a in e._plots)for(var i=e._plots[a],n=i.overlays||[],o=0;o<n.length;o++){var l=n[o];r[l.id]&&l.plot.selectAll(".trace").remove()}}}function Y2(t,e){e._draggers.selectAll("g."+t).remove(),e._defs.select("#clip"+e._uid+t+"plot").remove()}ur.toSVG=function(t){var e=t._fullLayout._glimages,r=su.select(t).selectAll(".svg-container"),a=r.filter(function(n,o){return o===r.size()-1}).selectAll(".gl-canvas-context, .gl-canvas-focus");function i(){var n=this,o=n.toDataURL("image/png"),l=e.append("svg:image");l.attr({xmlns:rI.svg,"xlink:href":o,preserveAspectRatio:"none",x:0,y:0,width:n.style.width,height:n.style.height})}a.each(i)};ur.updateFx=o2().updateFx;var nf=Ir,iI={hasLines:nf.hasLines,hasMarkers:nf.hasMarkers,hasText:nf.hasText,isBubble:nf.isBubble,attributes:Ui,layoutAttributes:Xh,supplyDefaults:FE,crossTraceDefaults:_2,supplyLayoutDefaults:UE,calc:Gp.calc,crossTraceCalc:vz,arraysToCalcdata:k2,plot:_z,colorbar:ps,formatLabels:O2,style:G0.style,styleOnSelect:G0.styleOnSelect,hoverPoints:$z,selectPoints:Pz,animatable:!0,moduleType:"trace",name:"scatter",basePlotModule:ur,categories:["cartesian","svg","symbols","errorBarsOK","showLegend","scatter-like","zoomScale"],meta:{description:["The scatter trace type encompasses line charts, scatter charts, text charts, and bubble charts.","The data visualized as scatter point or lines is set in `x` and `y`.","Text (appearing either on the chart or on hover only) is via `text`.","Bubble charts are achieved by setting `marker.size` and/or `marker.color`","to numerical arrays."].join(" ")}},nI=gt,oI=ht,ib=i2,Wp=me,lI=Wp.strScale,sI=Wp.strRotate,fI=Wp.strTranslate,cI=function(e,r,a){var i=e.node(),n=ib[a.arrowhead||0],o=ib[a.startarrowhead||0],l=(a.arrowwidth||1)*(a.arrowsize||1),s=(a.arrowwidth||1)*(a.startarrowsize||1),f=r.indexOf("start")>=0,c=r.indexOf("end")>=0,v=n.backoff*l+a.standoff,u=o.backoff*s+a.startstandoff,h,d,p,m;if(i.nodeName==="line"){h={x:+e.attr("x1"),y:+e.attr("y1")},d={x:+e.attr("x2"),y:+e.attr("y2")};var y=h.x-d.x,b=h.y-d.y;if(p=Math.atan2(b,y),m=p+Math.PI,v&&u&&v+u>Math.sqrt(y*y+b*b)){z();return}if(v){if(v*v>y*y+b*b){z();return}var w=v*Math.cos(p),g=v*Math.sin(p);d.x+=w,d.y+=g,e.attr({x2:d.x,y2:d.y})}if(u){if(u*u>y*y+b*b){z();return}var x=u*Math.cos(p),_=u*Math.sin(p);h.x-=x,h.y-=_,e.attr({x1:h.x,y1:h.y})}}else if(i.nodeName==="path"){var T=i.getTotalLength(),k="";if(T<v+u){z();return}var S=i.getPointAtLength(0),L=i.getPointAtLength(.1);p=Math.atan2(S.y-L.y,S.x-L.x),h=i.getPointAtLength(Math.min(u,T)),k="0px,"+u+"px,";var D=i.getPointAtLength(T),$=i.getPointAtLength(T-.1);m=Math.atan2(D.y-$.y,D.x-$.x),d=i.getPointAtLength(Math.max(0,T-v));var E=k?u+v:v;k+=T-E+"px,"+T+"px",e.style("stroke-dasharray",k)}function z(){e.style("stroke-dasharray","0px,100px")}function O(I,P,M,A){I.path&&(I.noRotate&&(M=0),nI.select(i.parentNode).append("path").attr({class:e.attr("class"),d:I.path,transform:fI(P.x,P.y)+sI(M*180/Math.PI)+lI(A)}).style({fill:oI.rgb(a.arrowcolor),"stroke-width":0}))}f&&O(o,h,p,s),c&&O(n,d,m,l)},nb=gt,Dv=ot,uI=cr,_i=me,$v=_i.strTranslate,Zl=Bt,Ki=ht,ei=$t,ob=Ia,Pv=br,Rv=ji,cl=Qa,vI=Ht.arrayEditor,dI=cI,qp={draw:hI,drawOne:W2,drawRaw:q2};function hI(t){var e=t._fullLayout;e._infolayer.selectAll(".annotation").remove();for(var r=0;r<e.annotations.length;r++)e.annotations[r].visible&&W2(t,r);return uI.previousPromises(t)}function W2(t,e){var r=t._fullLayout,a=r.annotations[e]||{},i=Zl.getFromId(t,a.xref),n=Zl.getFromId(t,a.yref);i&&i.setScale(),n&&n.setScale(),q2(t,a,e,!1,i,n)}function bi(t,e,r,a,i){var n=i[r],o=i[r+"ref"],l=r.indexOf("y")!==-1,s=Zl.getRefType(o)==="domain",f=l?a.h:a.w;return t?s?n+(l?-e:e)/t._length:t.p2r(t.r2p(n)+e):n+(l?-e:e)/f}function q2(t,e,r,a,i,n){var o=t._fullLayout,l=t._fullLayout._size,s=t._context.edits,f,c;a?(f="annotation-"+a,c=a+".annotations"):(f="annotation",c="annotations");var v=vI(t.layout,c,e),u=v.modifyBase,h=v.modifyItem,d=v.getUpdateObj;o._infolayer.selectAll("."+f+'[data-index="'+r+'"]').remove();var p="clip"+o._uid+"_ann"+r;if(!e._input||e.visible===!1){nb.selectAll("#"+p).remove();return}var m={x:{},y:{}},y=+e.textangle||0,b=o._infolayer.append("g").classed(f,!0).attr("data-index",String(r)).style("opacity",e.opacity),w=b.append("g").classed("annotation-text-g",!0),g=s[e.showarrow?"annotationTail":"annotationPosition"],x=e.captureevents||s.annotationText||g;function _(A){var C={index:r,annotation:e._input,fullAnnotation:e,event:A};return a&&(C.subplotId=a),C}var T=w.append("g").style("pointer-events",x?"all":null).call(Rv,"pointer").on("click",function(){t._dragging=!1,t.emit("plotly_clickannotation",_(nb.event))});e.hovertext&&T.on("mouseover",function(){var A=e.hoverlabel,C=A.font,R=this.getBoundingClientRect(),N=t.getBoundingClientRect();ob.loneHover({x0:R.left-N.left,x1:R.right-N.left,y:(R.top+R.bottom)/2-N.top,text:e.hovertext,color:A.bgcolor,borderColor:A.bordercolor,fontFamily:C.family,fontSize:C.size,fontColor:C.color},{container:o._hoverlayer.node(),outerContainer:o._paper.node(),gd:t})}).on("mouseout",function(){ob.loneUnhover(o._hoverlayer.node())});var k=e.borderwidth,S=e.borderpad,L=k+S,D=T.append("rect").attr("class","bg").style("stroke-width",k+"px").call(Ki.stroke,e.bordercolor).call(Ki.fill,e.bgcolor),$=e.width||e.height,E=o._topclips.selectAll("#"+p).data($?[0]:[]);E.enter().append("clipPath").classed("annclip",!0).attr("id",p).append("rect"),E.exit().remove();var z=e.font,O=o._meta?_i.templateString(e.text,o._meta):e.text,I=T.append("text").classed("annotation-text",!0).text(O);function P(A){return A.call(ei.font,z).attr({"text-anchor":{left:"start",right:"end"}[e.align]||"middle"}),Pv.convertToTspans(A,t,M),A}function M(){var A=I.selectAll("a");if(A.size()===1&&A.text()===I.text()){var C=T.insert("a",":first-child").attr({"xlink:xlink:href":A.attr("xlink:href"),"xlink:xlink:show":A.attr("xlink:show")}).style({cursor:"pointer"});C.node().appendChild(D.node())}var R=T.select(".annotation-text-math-group"),N=!R.empty(),H=ei.bBox((N?R:I).node()),B=H.width,X=H.height,j=e.width||B,q=e.height||X,U=Math.round(j+2*L),Z=Math.round(q+2*L);function K(Ye,He){return He==="auto"&&(Ye<1/3?He="left":Ye>2/3?He="right":He="center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[He]}for(var ee=!1,le=["x","y"],ye=0;ye<le.length;ye++){var se=le[ye],G=e[se+"ref"]||se,J=e["a"+se+"ref"],oe={x:i,y:n}[se],fe=(y+(se==="x"?0:-90))*Math.PI/180,pe=U*Math.cos(fe),ge=Z*Math.sin(fe),ue=Math.abs(pe)+Math.abs(ge),Ce=e[se+"anchor"],ce=e[se+"shift"]*(se==="x"?1:-1),De=m[se],Ee,$e,te,Te,ne,de=Zl.getRefType(G);if(oe&&de!=="domain"){var he=oe.r2fraction(e[se]);(he<0||he>1)&&(J===G?(he=oe.r2fraction(e["a"+se]),(he<0||he>1)&&(ee=!0)):ee=!0),Ee=oe._offset+oe.r2p(e[se]),Te=.5}else{var Ae=de==="domain";se==="x"?(te=e[se],Ee=Ae?oe._offset+oe._length*te:Ee=l.l+l.w*te):(te=1-e[se],Ee=Ae?oe._offset+oe._length*te:Ee=l.t+l.h*te),Te=e.showarrow?.5:te}if(e.showarrow){De.head=Ee;var Me=e["a"+se];if(ne=pe*K(.5,e.xanchor)-ge*K(.5,e.yanchor),J===G){var we=Zl.getRefType(J);we==="domain"?(se==="y"&&(Me=1-Me),De.tail=oe._offset+oe._length*Me):we==="paper"?se==="y"?(Me=1-Me,De.tail=l.t+l.h*Me):De.tail=l.l+l.w*Me:De.tail=oe._offset+oe.r2p(Me),$e=ne}else De.tail=Ee+Me,$e=ne+Me;De.text=De.tail+ne;var be=o[se==="x"?"width":"height"];if(G==="paper"&&(De.head=_i.constrain(De.head,1,be-1)),J==="pixel"){var Ve=-Math.max(De.tail-3,De.text),Fe=Math.min(De.tail+3,De.text)-be;Ve>0?(De.tail+=Ve,De.text+=Ve):Fe>0&&(De.tail-=Fe,De.text-=Fe)}De.tail+=ce,De.head+=ce}else ne=ue*K(Te,Ce),$e=ne,De.text=Ee+ne;De.text+=ce,ne+=ce,$e+=ce,e["_"+se+"padplus"]=ue/2+$e,e["_"+se+"padminus"]=ue/2-$e,e["_"+se+"size"]=ue,e["_"+se+"shift"]=ne}if(ee){T.remove();return}var Oe=0,Ge=0;if(e.align!=="left"&&(Oe=(j-B)*(e.align==="center"?.5:1)),e.valign!=="top"&&(Ge=(q-X)*(e.valign==="middle"?.5:1)),N)R.select("svg").attr({x:L+Oe-1,y:L+Ge}).call(ei.setClipUrl,$?p:null,t);else{var lt=L+Ge-H.top,xe=L+Oe-H.left;I.call(Pv.positionText,xe,lt).call(ei.setClipUrl,$?p:null,t)}E.select("rect").call(ei.setRect,L,L,j,q),D.call(ei.setRect,k/2,k/2,U-k,Z-k),T.call(ei.setTranslate,Math.round(m.x.text-U/2),Math.round(m.y.text-Z/2)),w.attr({transform:"rotate("+y+","+m.x.text+","+m.y.text+")"});var Ze=function(Ye,He){b.selectAll(".annotation-arrow-g").remove();var Ue=m.x.head,Je=m.y.head,F=m.x.tail+Ye,W=m.y.tail+He,Y=m.x.text+Ye,V=m.y.text+He,ie=_i.rotationXYMatrix(y,Y,V),re=_i.apply2DTransform(ie),ke=_i.apply2DTransform2(ie),_e=+D.attr("width"),ve=+D.attr("height"),Q=Y-.5*_e,Le=Q+_e,ze=V-.5*ve,Ne=ze+ve,tt=[[Q,ze,Q,Ne],[Q,Ne,Le,Ne],[Le,Ne,Le,ze],[Le,ze,Q,ze]].map(ke);if(!tt.reduce(function(Qe,mt){return Qe^!!_i.segmentsIntersect(Ue,Je,Ue+1e6,Je+1e6,mt[0],mt[1],mt[2],mt[3])},!1)){tt.forEach(function(Qe){var mt=_i.segmentsIntersect(F,W,Ue,Je,Qe[0],Qe[1],Qe[2],Qe[3]);mt&&(F=mt.x,W=mt.y)});var vt=e.arrowwidth,st=e.arrowcolor,at=e.arrowside,Et=b.append("g").style({opacity:Ki.opacity(st)}).classed("annotation-arrow-g",!0),pt=Et.append("path").attr("d","M"+F+","+W+"L"+Ue+","+Je).style("stroke-width",vt+"px").call(Ki.stroke,Ki.rgb(st));if(dI(pt,at,e),s.annotationPosition&&pt.node().parentNode&&!a){var rt=Ue,Lt=Je;if(e.standoff){var bt=Math.sqrt(Math.pow(Ue-F,2)+Math.pow(Je-W,2));rt+=e.standoff*(F-Ue)/bt,Lt+=e.standoff*(W-Je)/bt}var dt=Et.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).classed("cursor-move",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(F-rt)+","+(W-Lt),transform:$v(rt,Lt)}).style("stroke-width",vt+6+"px").call(Ki.stroke,"rgba(0,0,0,0)").call(Ki.fill,"rgba(0,0,0,0)"),ct,We;cl.init({element:dt.node(),gd:t,prepFn:function(){var Qe=ei.getTranslate(T);ct=Qe.x,We=Qe.y,i&&i.autorange&&u(i._name+".autorange",!0),n&&n.autorange&&u(n._name+".autorange",!0)},moveFn:function(Qe,mt){var Mt=re(ct,We),qe=Mt[0]+Qe,Ct=Mt[1]+mt;T.call(ei.setTranslate,qe,Ct),h("x",bi(i,Qe,"x",l,e)),h("y",bi(n,mt,"y",l,e)),e.axref===e.xref&&h("ax",bi(i,Qe,"ax",l,e)),e.ayref===e.yref&&h("ay",bi(n,mt,"ay",l,e)),Et.attr("transform",$v(Qe,mt)),w.attr({transform:"rotate("+y+","+qe+","+Ct+")"})},doneFn:function(){Dv.call("_guiRelayout",t,d());var Qe=document.querySelector(".js-notes-box-panel");Qe&&Qe.redraw(Qe.selectedObj)}})}}};if(e.showarrow&&Ze(0,0),g){var Xe;cl.init({element:T.node(),gd:t,prepFn:function(){Xe=w.attr("transform")},moveFn:function(Ye,He){var Ue="pointer";if(e.showarrow)e.axref===e.xref?h("ax",bi(i,Ye,"ax",l,e)):h("ax",e.ax+Ye),e.ayref===e.yref?h("ay",bi(n,He,"ay",l.w,e)):h("ay",e.ay+He),Ze(Ye,He);else{if(a)return;var Je,F;if(i)Je=bi(i,Ye,"x",l,e);else{var W=e._xsize/l.w,Y=e.x+(e._xshift-e.xshift)/l.w-W/2;Je=cl.align(Y+Ye/l.w,W,0,1,e.xanchor)}if(n)F=bi(n,He,"y",l,e);else{var V=e._ysize/l.h,ie=e.y-(e._yshift+e.yshift)/l.h-V/2;F=cl.align(ie-He/l.h,V,0,1,e.yanchor)}h("x",Je),h("y",F),(!i||!n)&&(Ue=cl.getCursor(i?.5:Je,n?.5:F,e.xanchor,e.yanchor))}w.attr({transform:$v(Ye,He)+Xe}),Rv(T,Ue)},clickFn:function(Ye,He){e.captureevents&&t.emit("plotly_clickannotation",_(He))},doneFn:function(){Rv(T),Dv.call("_guiRelayout",t,d());var Ye=document.querySelector(".js-notes-box-panel");Ye&&Ye.redraw(Ye.selectedObj)}})}}s.annotationText?I.call(Pv.makeEditable,{delegate:T,gd:t}).call(P).on("edit",function(A){e.text=A,this.call(P),h("text",A),i&&i.autorange&&u(i._name+".autorange",!0),n&&n.autorange&&u(n._name+".autorange",!0),Dv.call("_guiRelayout",t,d())}):I.call(P)}var lb=me,pI=ot,sb=Ht.arrayEditor,mI={hasClickToShow:yI,onClick:gI};function yI(t,e){var r=Z2(t,e);return r.on.length>0||r.explicitOff.length>0}function gI(t,e){var r=Z2(t,e),a=r.on,i=r.off.concat(r.explicitOff),n={},o=t._fullLayout.annotations,l,s;if(a.length||i.length){for(l=0;l<a.length;l++)s=sb(t.layout,"annotations",o[a[l]]),s.modifyItem("visible",!0),lb.extendFlat(n,s.getUpdateObj());for(l=0;l<i.length;l++)s=sb(t.layout,"annotations",o[i[l]]),s.modifyItem("visible",!1),lb.extendFlat(n,s.getUpdateObj());return pI.call("update",t,{},n)}}function Z2(t,e){var r=t._fullLayout.annotations,a=[],i=[],n=[],o=(e||[]).length,l,s,f,c,v,u,h,d;for(l=0;l<r.length;l++)if(f=r[l],c=f.clicktoshow,c){for(s=0;s<o;s++)if(v=e[s],u=v.xaxis,h=v.yaxis,u._id===f.xref&&h._id===f.yref&&u.d2r(v.x)===fb(f._xclick,u)&&h.d2r(v.y)===fb(f._yclick,h)){f.visible?c==="onout"?d=i:d=n:d=a,d.push(l);break}s===o&&f.visible&&c==="onout"&&i.push(l)}return{on:a,off:i,explicitOff:n}}function fb(t,e){return e.type==="log"?e.l2r(t):e.d2r(t)}var cb=me,jn=ht,K2=function(e,r,a,i){i("opacity");var n=i("bgcolor"),o=i("bordercolor"),l=jn.opacity(o);i("borderpad");var s=i("borderwidth"),f=i("showarrow");i("text",f?" ":a._dfltTitle.annotation),i("textangle"),cb.coerceFont(i,"font",a.font),i("width"),i("align");var c=i("height");if(c&&i("valign"),f){var v=i("arrowside"),u,h;v.indexOf("end")!==-1&&(u=i("arrowhead"),h=i("arrowsize")),v.indexOf("start")!==-1&&(i("startarrowhead",u),i("startarrowsize",h)),i("arrowcolor",l?r.bordercolor:jn.defaultLine),i("arrowwidth",(l&&s||1)*2),i("standoff"),i("startstandoff")}var d=i("hovertext"),p=a.hoverlabel||{};if(d){var m=i("hoverlabel.bgcolor",p.bgcolor||(jn.opacity(n)?jn.rgb(n):jn.defaultLine)),y=i("hoverlabel.bordercolor",p.bordercolor||jn.contrast(m));cb.coerceFont(i,"hoverlabel.font",{family:p.font.family,size:p.font.size,color:p.font.color||y})}i("captureevents",!!d)},Ev=me,Qi=Bt,bI=Ka,xI=K2,_I=vs,wI=function(e,r){bI(e,r,{name:"annotations",handleItemDefaults:TI})};function TI(t,e,r){function a(w,g){return Ev.coerce(t,e,_I,w,g)}var i=a("visible"),n=a("clicktoshow");if(i||n){xI(t,e,r,a);for(var o=e.showarrow,l=["x","y"],s=[-10,-30],f={_fullLayout:r},c=0;c<2;c++){var v=l[c],u=Qi.coerceRef(t,e,f,v,"","paper");if(u!=="paper"){var h=Qi.getFromId(f,u);h._annIndices.push(e._index)}if(Qi.coercePosition(e,f,a,u,v,.5),o){var d="a"+v,p=Qi.coerceRef(t,e,f,d,"pixel",["pixel","paper"]);p!=="pixel"&&p!==u&&(p=e[d]="pixel");var m=p==="pixel"?s[c]:.4;Qi.coercePosition(e,f,a,p,d,m)}a(v+"anchor"),a(v+"shift")}if(Ev.noneOrAll(t,e,["x","y"]),o&&Ev.noneOrAll(t,e,["ax","ay"]),n){var y=a("xclick"),b=a("yclick");e._xclick=y===void 0?e.x:Qi.cleanPosition(y,f,e.xref),e._yclick=b===void 0?e.y:Qi.cleanPosition(b,f,e.yref)}}}var oh=me,sn=Bt,kI=qp.draw,AI=function(e){var r=e._fullLayout,a=oh.filterVisible(r.annotations);if(a.length&&e._fullData.length)return oh.syncOrAsync([kI,MI],e)};function MI(t){var e=t._fullLayout;oh.filterVisible(e.annotations).forEach(function(r){var a=sn.getFromId(t,r.xref),i=sn.getFromId(t,r.yref),n=sn.getRefType(r.xref),o=sn.getRefType(r.yref);r._extremes={},n==="range"&&ub(r,a),o==="range"&&ub(r,i)})}function ub(t,e){var r=e._id,a=r.charAt(0),i=t[a],n=t["a"+a],o=t[a+"ref"],l=t["a"+a+"ref"],s=t["_"+a+"padplus"],f=t["_"+a+"padminus"],c={x:1,y:-1}[a]*t[a+"shift"],v=3*t.arrowsize*t.arrowwidth||0,u=v+c,h=v-c,d=3*t.startarrowsize*t.arrowwidth||0,p=d+c,m=d-c,y;if(l===o){var b=sn.findExtremes(e,[e.r2c(i)],{ppadplus:u,ppadminus:h}),w=sn.findExtremes(e,[e.r2c(n)],{ppadplus:Math.max(s,p),ppadminus:Math.max(f,m)});y={min:[b.min[0],w.min[0]],max:[b.max[0],w.max[0]]}}else p=n?p+n:p,m=n?m-n:m,y=sn.findExtremes(e,[e.r2c(i)],{ppadplus:Math.max(s,u,p),ppadminus:Math.max(f,h,m)});t._extremes[r]=y}var SI=wt,LI=Dh,CI=function(e,r,a,i){r=r||{};var n=a==="log"&&r.type==="linear",o=a==="linear"&&r.type==="log";if(!(n||o))return;var l=e._fullLayout.annotations,s=r._id.charAt(0),f,c;function v(h){var d=f[h],p=null;n?p=LI(d,r.range):p=Math.pow(10,d),SI(p)||(p=null),i(c+h,p)}for(var u=0;u<l.length;u++)f=l[u],c="annotations["+u+"].",f[s+"ref"]===r._id&&v(s),f["a"+s+"ref"]===r._id&&v("a"+s)},zv=qp,vb=mI,DI={moduleType:"component",name:"annotations",layoutAttributes:vs,supplyLayoutDefaults:wI,includeBasePlot:au("annotations"),calcAutorange:AI,draw:zv.draw,drawOne:zv.drawOne,drawRaw:zv.drawRaw,hasClickToShow:vb.hasClickToShow,onClick:vb.onClick,convertCoords:CI},Xt=vs,$I=Ya.overrideAll,PI=Ht.templatedArray,lh=$I(PI("annotation",{visible:Xt.visible,x:{valType:"any",description:["Sets the annotation's x position."].join(" ")},y:{valType:"any",description:["Sets the annotation's y position."].join(" ")},z:{valType:"any",description:["Sets the annotation's z position."].join(" ")},ax:{valType:"number",description:["Sets the x component of the arrow tail about the arrow head (in pixels)."].join(" ")},ay:{valType:"number",description:["Sets the y component of the arrow tail about the arrow head (in pixels)."].join(" ")},xanchor:Xt.xanchor,xshift:Xt.xshift,yanchor:Xt.yanchor,yshift:Xt.yshift,text:Xt.text,textangle:Xt.textangle,font:Xt.font,width:Xt.width,height:Xt.height,opacity:Xt.opacity,align:Xt.align,valign:Xt.valign,bgcolor:Xt.bgcolor,bordercolor:Xt.bordercolor,borderpad:Xt.borderpad,borderwidth:Xt.borderwidth,showarrow:Xt.showarrow,arrowcolor:Xt.arrowcolor,arrowhead:Xt.arrowhead,startarrowhead:Xt.startarrowhead,arrowside:Xt.arrowside,arrowsize:Xt.arrowsize,startarrowsize:Xt.startarrowsize,arrowwidth:Xt.arrowwidth,standoff:Xt.standoff,startstandoff:Xt.startstandoff,hovertext:Xt.hovertext,hoverlabel:Xt.hoverlabel,captureevents:Xt.captureevents}),"calc","from-root"),Iv=me,RI=Bt,EI=Ka,zI=K2,II=lh,FI=function(e,r,a){EI(e,r,{name:"annotations",handleItemDefaults:NI,fullLayout:a.fullLayout})};function NI(t,e,r,a){function i(l,s){return Iv.coerce(t,e,II,l,s)}function n(l){var s=l+"axis",f={_fullLayout:{}};return f._fullLayout[s]=r[s],RI.coercePosition(e,f,i,l,l,.5)}var o=i("visible");o&&(zI(t,e,a.fullLayout,i),n("x"),n("y"),n("z"),Iv.noneOrAll(t,e,["x","y","z"]),e.xref="x",e.yref="y",e.zref="z",i("xanchor"),i("yanchor"),i("xshift"),i("yshift"),e.showarrow&&(e.axref="pixel",e.ayref="pixel",i("ax",-10),i("ay",-30),Iv.noneOrAll(t,e,["ax","ay"])))}var db=me,hb=Bt,HI=function(e){for(var r=e.fullSceneLayout,a=r.annotations,i=0;i<a.length;i++)OI(a[i],e);e.fullLayout._infolayer.selectAll(".annotation-"+e.id).remove()};function OI(t,e){var r=e.fullSceneLayout,a=r.domain,i=e.fullLayout._size,n={pdata:null,type:"linear",autorange:!1,range:[-1/0,1/0]};t._xa={},db.extendFlat(t._xa,n),hb.setConvert(t._xa),t._xa._offset=i.l+a.x[0]*i.w,t._xa.l2p=function(){return .5*(1+t._pdata[0]/t._pdata[3])*i.w*(a.x[1]-a.x[0])},t._ya={},db.extendFlat(t._ya,n),hb.setConvert(t._ya),t._ya._offset=i.t+(1-a.y[1])*i.h,t._ya.l2p=function(){return .5*(1-t._pdata[1]/t._pdata[3])*i.h*(a.y[1]-a.y[0])}}function Fv(t,e){var r=[0,0,0,0],a,i;for(a=0;a<4;++a)for(i=0;i<4;++i)r[i]+=t[4*a+i]*e[a];return r}function jI(t,e){var r=Fv(t.projection,Fv(t.view,Fv(t.model,[e[0],e[1],e[2],1])));return r}var BI=jI,GI=qp.drawRaw,UI=BI,VI=["x","y","z"],XI=function(e){for(var r=e.fullSceneLayout,a=e.dataScale,i=r.annotations,n=0;n<i.length;n++){for(var o=i[n],l=!1,s=0;s<3;s++){var f=VI[s],c=o[f],v=r[f+"axis"],u=v.r2fraction(c);if(u<0||u>1){l=!0;break}}l?e.fullLayout._infolayer.select(".annotation-"+e.id+'[data-index="'+n+'"]').remove():(o._pdata=UI(e.glplot.cameraParams,[r.xaxis.r2l(o.x)*a[0],r.yaxis.r2l(o.y)*a[1],r.zaxis.r2l(o.z)*a[2]]),GI(e.graphDiv,o,n,e.id,o._xa,o._ya))}},YI=ot,pb=me,WI={moduleType:"component",name:"annotations3d",schema:{subplots:{scene:{annotations:lh}}},layoutAttributes:lh,handleDefaults:FI,includeBasePlot:qI,convert:HI,draw:XI};function qI(t,e){var r=YI.subplotsRegistry.gl3d;if(r)for(var a=r.attrRegex,i=Object.keys(t),n=0;n<i.length;n++){var o=i[n];a.test(o)&&(t[o].annotations||[]).length&&(pb.pushUnique(e._basePlotModules,r),pb.pushUnique(e._subplots.gl3d,o))}}var mb=vs,yb=Mr,gb=Ui.line,ZI=ra.dash,ka=Qt.extendFlat,KI=Ht.templatedArray,bb=tu,Bn=ba,QI=Dr.shapeTexttemplateAttrs,JI=Ih,Q2=KI("shape",{visible:ka({},Bn.visible,{editType:"calc+arraydraw",description:["Determines whether or not this shape is visible.","If *legendonly*, the shape is not drawn,","but can appear as a legend item","(provided that the legend itself is visible)."].join(" ")}),showlegend:{valType:"boolean",dflt:!1,editType:"calc+arraydraw",description:["Determines whether or not this","shape is shown in the legend."].join(" ")},legend:ka({},Bn.legend,{editType:"calc+arraydraw",description:["Sets the reference to a legend to show this shape in.","References to these legends are *legend*, *legend2*, *legend3*, etc.","Settings for these legends are set in the layout, under","`layout.legend`, `layout.legend2`, etc."].join(" ")}),legendgroup:ka({},Bn.legendgroup,{editType:"calc+arraydraw",description:["Sets the legend group for this shape.","Traces and shapes part of the same legend group hide/show at the same time","when toggling legend items."].join(" ")}),legendgrouptitle:{text:ka({},Bn.legendgrouptitle.text,{editType:"calc+arraydraw"}),font:yb({editType:"calc+arraydraw",description:["Sets this legend group's title font."].join(" ")}),editType:"calc+arraydraw"},legendrank:ka({},Bn.legendrank,{editType:"calc+arraydraw",description:["Sets the legend rank for this shape.","Items and groups with smaller ranks are presented on top/left side while","with *reversed* `legend.traceorder` they are on bottom/right side.","The default legendrank is 1000,","so that you can use ranks less than 1000 to place certain items before all unranked items,","and ranks greater than 1000 to go after all unranked items.","When having unranked or equal rank items shapes would be displayed after traces","i.e. according to their order in data and layout."].join(" ")}),legendwidth:ka({},Bn.legendwidth,{editType:"calc+arraydraw",description:"Sets the width (in px or fraction) of the legend for this shape."}),type:{valType:"enumerated",values:["circle","rect","path","line"],editType:"calc+arraydraw",description:["Specifies the shape type to be drawn.","If *line*, a line is drawn from (`x0`,`y0`) to (`x1`,`y1`)","with respect to the axes' sizing mode.","If *circle*, a circle is drawn from","((`x0`+`x1`)/2, (`y0`+`y1`)/2))","with radius","(|(`x0`+`x1`)/2 - `x0`|, |(`y0`+`y1`)/2 -`y0`)|)","with respect to the axes' sizing mode.","If *rect*, a rectangle is drawn linking","(`x0`,`y0`), (`x1`,`y0`), (`x1`,`y1`), (`x0`,`y1`), (`x0`,`y0`)","with respect to the axes' sizing mode.","If *path*, draw a custom SVG path using `path`.","with respect to the axes' sizing mode."].join(" ")},layer:{valType:"enumerated",values:["below","above"],dflt:"above",editType:"arraydraw",description:"Specifies whether shapes are drawn below or above traces."},xref:ka({},mb.xref,{description:["Sets the shape's x coordinate axis.",bb.axisRefDescription("x","left","right")].join(" ")}),xsizemode:{valType:"enumerated",values:["scaled","pixel"],dflt:"scaled",editType:"calc+arraydraw",description:["Sets the shapes's sizing mode along the x axis.","If set to *scaled*, `x0`, `x1` and x coordinates within `path` refer to","data values on the x axis or a fraction of the plot area's width","(`xref` set to *paper*).","If set to *pixel*, `xanchor` specifies the x position in terms","of data or plot fraction but `x0`, `x1` and x coordinates within `path`","are pixels relative to `xanchor`. This way, the shape can have","a fixed width while maintaining a position relative to data or","plot fraction."].join(" ")},xanchor:{valType:"any",editType:"calc+arraydraw",description:["Only relevant in conjunction with `xsizemode` set to *pixel*.","Specifies the anchor point on the x axis to which `x0`, `x1`","and x coordinates within `path` are relative to.","E.g. useful to attach a pixel sized shape to a certain data value.","No effect when `xsizemode` not set to *pixel*."].join(" ")},x0:{valType:"any",editType:"calc+arraydraw",description:["Sets the shape's starting x position.","See `type` and `xsizemode` for more info."].join(" ")},x1:{valType:"any",editType:"calc+arraydraw",description:["Sets the shape's end x position.","See `type` and `xsizemode` for more info."].join(" ")},yref:ka({},mb.yref,{description:["Sets the shape's y coordinate axis.",bb.axisRefDescription("y","bottom","top")].join(" ")}),ysizemode:{valType:"enumerated",values:["scaled","pixel"],dflt:"scaled",editType:"calc+arraydraw",description:["Sets the shapes's sizing mode along the y axis.","If set to *scaled*, `y0`, `y1` and y coordinates within `path` refer to","data values on the y axis or a fraction of the plot area's height","(`yref` set to *paper*).","If set to *pixel*, `yanchor` specifies the y position in terms","of data or plot fraction but `y0`, `y1` and y coordinates within `path`","are pixels relative to `yanchor`. This way, the shape can have","a fixed height while maintaining a position relative to data or","plot fraction."].join(" ")},yanchor:{valType:"any",editType:"calc+arraydraw",description:["Only relevant in conjunction with `ysizemode` set to *pixel*.","Specifies the anchor point on the y axis to which `y0`, `y1`","and y coordinates within `path` are relative to.","E.g. useful to attach a pixel sized shape to a certain data value.","No effect when `ysizemode` not set to *pixel*."].join(" ")},y0:{valType:"any",editType:"calc+arraydraw",description:["Sets the shape's starting y position.","See `type` and `ysizemode` for more info."].join(" ")},y1:{valType:"any",editType:"calc+arraydraw",description:["Sets the shape's end y position.","See `type` and `ysizemode` for more info."].join(" ")},path:{valType:"string",editType:"calc+arraydraw",description:["For `type` *path* - a valid SVG path with the pixel values","replaced by data values in `xsizemode`/`ysizemode` being *scaled*","and taken unmodified as pixels relative to `xanchor` and `yanchor`","in case of *pixel* size mode.","There are a few restrictions / quirks","only absolute instructions, not relative. So the allowed segments","are: M, L, H, V, Q, C, T, S, and Z","arcs (A) are not allowed because radius rx and ry are relative.","In the future we could consider supporting relative commands,","but we would have to decide on how to handle date and log axes.","Note that even as is, Q and C Bezier paths that are smooth on","linear axes may not be smooth on log, and vice versa.",'no chained "polybezier" commands - specify the segment type for',"each one.","On category axes, values are numbers scaled to the serial numbers","of categories because using the categories themselves there would","be no way to describe fractional positions","On data axes: because space and T are both normal components of path","strings, we can't use either to separate date from time parts.","Therefore we'll use underscore for this purpose:","2015-02-21_13:45:56.789"].join(" ")},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw",description:"Sets the opacity of the shape."},line:{color:ka({},gb.color,{editType:"arraydraw"}),width:ka({},gb.width,{editType:"calc+arraydraw"}),dash:ka({},ZI,{editType:"arraydraw"}),editType:"calc+arraydraw"},fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw",description:["Sets the color filling the shape's interior. Only applies to closed shapes."].join(" ")},fillrule:{valType:"enumerated",values:["evenodd","nonzero"],dflt:"evenodd",editType:"arraydraw",description:["Determines which regions of complex paths constitute the interior.","For more info please visit https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/fill-rule"].join(" ")},editable:{valType:"boolean",dflt:!1,editType:"calc+arraydraw",description:["Determines whether the shape could be activated for edit or not.","Has no effect when the older editable shapes mode is enabled via","`config.editable` or `config.edits.shapePosition`."].join(" ")},label:{text:{valType:"string",dflt:"",editType:"arraydraw",description:["Sets the text to display with shape.","It is also used for legend item if `name` is not provided."].join(" ")},texttemplate:QI({},{keys:Object.keys(JI)}),font:yb({editType:"calc+arraydraw",colorEditType:"arraydraw",description:"Sets the shape label text font."}),textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right","start","middle","end"],editType:"arraydraw",description:["Sets the position of the label text relative to the shape.","Supported values for rectangles, circles and paths are","*top left*, *top center*, *top right*, *middle left*,","*middle center*, *middle right*, *bottom left*, *bottom center*,","and *bottom right*.","Supported values for lines are *start*, *middle*, and *end*.","Default: *middle center* for rectangles, circles, and paths; *middle* for lines."].join(" ")},textangle:{valType:"angle",dflt:"auto",editType:"calc+arraydraw",description:["Sets the angle at which the label text is drawn","with respect to the horizontal. For lines, angle *auto*","is the same angle as the line. For all other shapes,","angle *auto* is horizontal."].join(" ")},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto",editType:"calc+arraydraw",description:["Sets the label's horizontal position anchor","This anchor binds the specified `textposition` to the *left*, *center*","or *right* of the label text.","For example, if `textposition` is set to *top right* and","`xanchor` to *right* then the right-most portion of the","label text lines up with the right-most edge of the","shape."].join(" ")},yanchor:{valType:"enumerated",values:["top","middle","bottom"],editType:"calc+arraydraw",description:["Sets the label's vertical position anchor","This anchor binds the specified `textposition` to the *top*, *middle*","or *bottom* of the label text.","For example, if `textposition` is set to *top right* and","`yanchor` to *top* then the top-most portion of the","label text lines up with the top-most edge of the","shape."].join(" ")},padding:{valType:"number",dflt:3,min:0,editType:"arraydraw",description:"Sets padding (in px) between edge of label and edge of shape."},editType:"arraydraw"},editType:"arraydraw"}),ul=me,Gn=Bt,eF=Ka,tF=Q2,xb=Gi,rF=function(e,r){eF(e,r,{name:"shapes",handleItemDefaults:iF})};function aF(t,e){return t?"bottom":e.indexOf("top")!==-1?"top":e.indexOf("bottom")!==-1?"bottom":"middle"}function iF(t,e,r){function a(A,C){return ul.coerce(t,e,tF,A,C)}e._isShape=!0;var i=a("visible");if(i){var n=a("showlegend");n&&(a("legend"),a("legendwidth"),a("legendgroup"),a("legendgrouptitle.text"),ul.coerceFont(a,"legendgrouptitle.font"),a("legendrank"));var o=a("path"),l=o?"path":"rect",s=a("type",l),f=s!=="path";f&&delete e.path,a("editable"),a("layer"),a("opacity"),a("fillcolor"),a("fillrule");var c=a("line.width");c&&(a("line.color"),a("line.dash"));for(var v=a("xsizemode"),u=a("ysizemode"),h=["x","y"],d=0;d<2;d++){var p=h[d],m=p+"anchor",y=p==="x"?v:u,b={_fullLayout:r},w,g,x,_=Gn.coerceRef(t,e,b,p,void 0,"paper"),T=Gn.getRefType(_);if(T==="range"?(w=Gn.getFromId(b,_),w._shapeIndices.push(e._index),x=xb.rangeToShapePosition(w),g=xb.shapePositionToRange(w)):g=x=ul.identity,f){var k=.25,S=.75,L=p+"0",D=p+"1",$=t[L],E=t[D];t[L]=g(t[L],!0),t[D]=g(t[D],!0),y==="pixel"?(a(L,0),a(D,10)):(Gn.coercePosition(e,b,a,_,L,k),Gn.coercePosition(e,b,a,_,D,S)),e[L]=x(e[L]),e[D]=x(e[D]),t[L]=$,t[D]=E}if(y==="pixel"){var z=t[m];t[m]=g(t[m],!0),Gn.coercePosition(e,b,a,_,m,.25),e[m]=x(e[m]),t[m]=z}}f&&ul.noneOrAll(t,e,["x0","x1","y0","y1"]);var O=s==="line",I,P;if(f&&(I=a("label.texttemplate")),I||(P=a("label.text")),P||I){a("label.textangle");var M=a("label.textposition",O?"middle":"middle center");a("label.xanchor"),a("label.yanchor",aF(O,M)),a("label.padding"),ul.coerceFont(a,"label.font",r.font)}}}var nF=ht,_b=me;function oF(t,e){return t?"bottom":e.indexOf("top")!==-1?"top":e.indexOf("bottom")!==-1?"bottom":"middle"}var lF=function(e,r,a){a("newshape.visible"),a("newshape.name"),a("newshape.showlegend"),a("newshape.legend"),a("newshape.legendwidth"),a("newshape.legendgroup"),a("newshape.legendgrouptitle.text"),_b.coerceFont(a,"newshape.legendgrouptitle.font"),a("newshape.legendrank"),a("newshape.drawdirection"),a("newshape.layer"),a("newshape.fillcolor"),a("newshape.fillrule"),a("newshape.opacity");var i=a("newshape.line.width");if(i){var n=(e||{}).plot_bgcolor||"#FFF";a("newshape.line.color",nF.contrast(n)),a("newshape.line.dash")}var o=e.dragmode==="drawline",l=a("newshape.label.text"),s=a("newshape.label.texttemplate");if(l||s){a("newshape.label.textangle");var f=a("newshape.label.textposition",o?"middle":"middle center");a("newshape.label.xanchor"),a("newshape.label.yanchor",oF(o,f)),a("newshape.label.padding"),_b.coerceFont(a,"newshape.label.font",r.font)}a("activeshape.fillcolor"),a("activeshape.opacity")},sh=me,Un=Bt,Lo=Wc,J2=Gi,sF=function(e){var r=e._fullLayout,a=sh.filterVisible(r.shapes);if(!(!a.length||!e._fullData.length))for(var i=0;i<a.length;i++){var n=a[i];n._extremes={};var o,l,s=Un.getRefType(n.xref),f=Un.getRefType(n.yref);if(n.xref!=="paper"&&s!=="domain"){var c=n.xsizemode==="pixel"?n.xanchor:n.x0,v=n.xsizemode==="pixel"?n.xanchor:n.x1;o=Un.getFromId(e,n.xref),l=wb(o,c,v,n.path,Lo.paramIsX),l&&(n._extremes[o._id]=Un.findExtremes(o,l,fF(n)))}if(n.yref!=="paper"&&f!=="domain"){var u=n.ysizemode==="pixel"?n.yanchor:n.y0,h=n.ysizemode==="pixel"?n.yanchor:n.y1;o=Un.getFromId(e,n.yref),l=wb(o,u,h,n.path,Lo.paramIsY),l&&(n._extremes[o._id]=Un.findExtremes(o,l,cF(n)))}}};function fF(t){return ek(t.line.width,t.xsizemode,t.x0,t.x1,t.path,!1)}function cF(t){return ek(t.line.width,t.ysizemode,t.y0,t.y1,t.path,!0)}function ek(t,e,r,a,i,n){var o=t/2,l=n;if(e==="pixel"){var s=i?J2.extractPathCoords(i,n?Lo.paramIsY:Lo.paramIsX):[r,a],f=sh.aggNums(Math.max,null,s),c=sh.aggNums(Math.min,null,s),v=c<0?Math.abs(c)+o:o,u=f>0?f+o:o;return{ppad:o,ppadplus:l?v:u,ppadminus:l?u:v}}else return{ppad:o}}function wb(t,e,r,a,i){var n=t.type==="category"||t.type==="multicategory"?t.r2c:t.d2c;if(e!==void 0)return[n(e),n(r)];if(a){var o=1/0,l=-1/0,s=a.match(Lo.segmentRE),f,c,v,u,h;for(t.type==="date"&&(n=J2.decodeDate(n)),f=0;f<s.length;f++)c=s[f],v=i[c.charAt(0)].drawn,v!==void 0&&(u=s[f].substr(1).match(Lo.paramRE),!(!u||u.length<v)&&(h=n(u[v]),h<o&&(o=h),h>l&&(l=h)));if(l>=o)return[o,l]}}var Tb=Tp,uF={moduleType:"component",name:"shapes",layoutAttributes:Q2,supplyLayoutDefaults:rF,supplyDrawNewShapeDefaults:lF,includeBasePlot:au("shapes"),calcAutorange:sF,draw:Tb.draw,drawOne:Tb.drawOne},kb=Gr,vF=Ht.templatedArray,Ab=tu,tk=vF("image",{visible:{valType:"boolean",dflt:!0,editType:"arraydraw",description:["Determines whether or not this image is visible."].join(" ")},source:{valType:"string",editType:"arraydraw",description:["Specifies the URL of the image to be used.","The URL must be accessible from the domain where the","plot code is run, and can be either relative or absolute."].join(" ")},layer:{valType:"enumerated",values:["below","above"],dflt:"above",editType:"arraydraw",description:["Specifies whether images are drawn below or above traces.","When `xref` and `yref` are both set to `paper`,","image is drawn below the entire plot area."].join(" ")},sizex:{valType:"number",dflt:0,editType:"arraydraw",description:["Sets the image container size horizontally.","The image will be sized based on the `position` value.","When `xref` is set to `paper`, units are sized relative","to the plot width.","When `xref` ends with ` domain`, units are sized relative","to the axis width."].join(" ")},sizey:{valType:"number",dflt:0,editType:"arraydraw",description:["Sets the image container size vertically.","The image will be sized based on the `position` value.","When `yref` is set to `paper`, units are sized relative","to the plot height.","When `yref` ends with ` domain`, units are sized relative","to the axis height."].join(" ")},sizing:{valType:"enumerated",values:["fill","contain","stretch"],dflt:"contain",editType:"arraydraw",description:["Specifies which dimension of the image to constrain."].join(" ")},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw",description:"Sets the opacity of the image."},x:{valType:"any",dflt:0,editType:"arraydraw",description:["Sets the image's x position.","When `xref` is set to `paper`, units are sized relative","to the plot height.","See `xref` for more info"].join(" ")},y:{valType:"any",dflt:0,editType:"arraydraw",description:["Sets the image's y position.","When `yref` is set to `paper`, units are sized relative","to the plot height.","See `yref` for more info"].join(" ")},xanchor:{valType:"enumerated",values:["left","center","right"],dflt:"left",editType:"arraydraw",description:"Sets the anchor for the x position"},yanchor:{valType:"enumerated",values:["top","middle","bottom"],dflt:"top",editType:"arraydraw",description:"Sets the anchor for the y position."},xref:{valType:"enumerated",values:["paper",kb.idRegex.x.toString()],dflt:"paper",editType:"arraydraw",description:["Sets the images's x coordinate axis.",Ab.axisRefDescription("x","left","right")].join(" ")},yref:{valType:"enumerated",values:["paper",kb.idRegex.y.toString()],dflt:"paper",editType:"arraydraw",description:["Sets the images's y coordinate axis.",Ab.axisRefDescription("y","bottom","top")].join(" ")},editType:"arraydraw"}),dF=me,Nv=Bt,hF=Ka,pF=tk,mF="images",yF=function(e,r){var a={name:mF,handleItemDefaults:gF};hF(e,r,a)};function gF(t,e,r){function a(u,h){return dF.coerce(t,e,pF,u,h)}var i=a("source"),n=a("visible",!!i);if(!n)return e;a("layer"),a("xanchor"),a("yanchor"),a("sizex"),a("sizey"),a("sizing"),a("opacity");for(var o={_fullLayout:r},l=["x","y"],s=0;s<2;s++){var f=l[s],c=Nv.coerceRef(t,e,o,f,"paper",void 0);if(c!=="paper"){var v=Nv.getFromId(o,c);v._imgIndices.push(e._index)}Nv.coercePosition(e,o,a,c,f,0)}return e}var Mb=gt,bF=$t,Vn=Bt,Sb=lr,xF=Sn,_F=function(e){var r=e._fullLayout,a=[],i={},n=[],o,l;for(l=0;l<r.images.length;l++){var s=r.images[l];if(s.visible)if(s.layer==="below"&&s.xref!=="paper"&&s.yref!=="paper"){o=Sb.ref2id(s.xref)+Sb.ref2id(s.yref);var f=r._plots[o];if(!f){n.push(s);continue}f.mainplot&&(o=f.mainplot.id),i[o]||(i[o]=[]),i[o].push(s)}else s.layer==="above"?a.push(s):n.push(s)}var c={x:{left:{sizing:"xMin",offset:0},center:{sizing:"xMid",offset:-1/2},right:{sizing:"xMax",offset:-1}},y:{top:{sizing:"YMin",offset:0},middle:{sizing:"YMid",offset:-1/2},bottom:{sizing:"YMax",offset:-1}}};function v(b){var w=Mb.select(this);if(this._imgSrc!==b.source)if(w.attr("xmlns",xF.svg),b.source&&b.source.slice(0,5)==="data:")w.attr("xlink:href",b.source),this._imgSrc=b.source;else{var g=new Promise((function(x){var _=new Image;this.img=_,_.setAttribute("crossOrigin","anonymous"),_.onerror=T,_.onload=function(){var k=document.createElement("canvas");k.width=this.width,k.height=this.height;var S=k.getContext("2d",{willReadFrequently:!0});S.drawImage(this,0,0);var L=k.toDataURL("image/png");w.attr("xlink:href",L),x()},w.on("error",T),_.src=b.source,this._imgSrc=b.source;function T(){w.remove(),x()}}).bind(this));e._promises.push(g)}}function u(b){var w=Mb.select(this),g=Vn.getFromId(e,b.xref),x=Vn.getFromId(e,b.yref),_=Vn.getRefType(b.xref)==="domain",T=Vn.getRefType(b.yref)==="domain",k=r._size,S,L;g!==void 0?S=typeof b.xref=="string"&&_?g._length*b.sizex:Math.abs(g.l2p(b.sizex)-g.l2p(0)):S=b.sizex*k.w,x!==void 0?L=typeof b.yref=="string"&&T?x._length*b.sizey:Math.abs(x.l2p(b.sizey)-x.l2p(0)):L=b.sizey*k.h;var D=S*c.x[b.xanchor].offset,$=L*c.y[b.yanchor].offset,E=c.x[b.xanchor].sizing+c.y[b.yanchor].sizing,z,O;switch(g!==void 0?z=typeof b.xref=="string"&&_?g._length*b.x+g._offset:g.r2p(b.x)+g._offset:z=b.x*k.w+k.l,z+=D,x!==void 0?O=typeof b.yref=="string"&&T?x._length*(1-b.y)+x._offset:x.r2p(b.y)+x._offset:O=k.h-b.y*k.h+k.t,O+=$,b.sizing){case"fill":E+=" slice";break;case"stretch":E="none";break}w.attr({x:z,y:O,width:S,height:L,preserveAspectRatio:E,opacity:b.opacity});var I=g&&Vn.getRefType(b.xref)!=="domain"?g._id:"",P=x&&Vn.getRefType(b.yref)!=="domain"?x._id:"",M=I+P;bF.setClipUrl(w,M?"clip"+r._uid+M:null,e)}var h=r._imageLowerLayer.selectAll("image").data(n),d=r._imageUpperLayer.selectAll("image").data(a);h.enter().append("image"),d.enter().append("image"),h.exit().remove(),d.exit().remove(),h.each(function(b){v.bind(this)(b),u.bind(this)(b)}),d.each(function(b){v.bind(this)(b),u.bind(this)(b)});var p=Object.keys(r._plots);for(l=0;l<p.length;l++){o=p[l];var m=r._plots[o];if(m.imagelayer){var y=m.imagelayer.selectAll("image").data(i[o]||[]);y.enter().append("image"),y.exit().remove(),y.each(function(b){v.bind(this)(b),u.bind(this)(b)})}}},Lb=wt,wF=Dh,TF=function(e,r,a,i){r=r||{};var n=a==="log"&&r.type==="linear",o=a==="linear"&&r.type==="log";if(n||o){for(var l=e._fullLayout.images,s=r._id.charAt(0),f,c,v=0;v<l.length;v++)if(f=l[v],c="images["+v+"].",f[s+"ref"]===r._id){var u=f[s],h=f["size"+s],d=null,p=null;if(n){d=wF(u,r.range);var m=h/Math.pow(10,d)/2;p=2*Math.log(m+Math.sqrt(1+m*m))/Math.LN10}else d=Math.pow(10,u),p=d*(Math.pow(10,h/2)-Math.pow(10,-h/2));Lb(d)?Lb(p)||(p=null):(d=null,p=null),i(c+s,d),i(c+"size"+s,p)}}},kF={moduleType:"component",name:"images",layoutAttributes:tk,supplyLayoutDefaults:yF,includeBasePlot:au("images"),draw:_F,convertCoords:TF},Zp={name:"updatemenus",containerClassName:"updatemenu-container",headerGroupClassName:"updatemenu-header-group",headerClassName:"updatemenu-header",headerArrowClassName:"updatemenu-header-arrow",dropdownButtonGroupClassName:"updatemenu-dropdown-button-group",dropdownButtonClassName:"updatemenu-dropdown-button",buttonClassName:"updatemenu-button",itemRectClassName:"updatemenu-item-rect",itemTextClassName:"updatemenu-item-text",menuIndexAttrName:"updatemenu-active-index",autoMarginIdRoot:"updatemenu-",blankHeaderOpts:{label:" "},minWidth:30,minHeight:30,textPadX:24,arrowPadX:16,rx:2,ry:2,textOffsetX:12,textOffsetY:3,arrowOffsetX:4,gapButtonHeader:5,gapButton:2,activeColor:"#F4FAFF",hoverColor:"#F4FAFF",arrowSymbol:{left:"◄",right:"►",up:"▲",down:"▼"}},AF=Mr,MF=zr,SF=Qt.extendFlat,LF=Ya.overrideAll,CF=Fh,rk=Ht.templatedArray,DF=rk("button",{visible:{valType:"boolean",description:"Determines whether or not this button is visible."},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle",description:["Sets the Plotly method to be called on click.","If the `skip` method is used, the API updatemenu will function as normal","but will perform no API calls and will not bind automatically to state","updates. This may be used to create a component interface and attach to","updatemenu events manually via JavaScript."].join(" ")},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}],description:["Sets the arguments values to be passed to the Plotly","method set in `method` on click."].join(" ")},args2:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}],description:["Sets a 2nd set of `args`,","these arguments values are passed to the Plotly","method set in `method` when clicking this button while in the active state.","Use this to create toggle buttons."].join(" ")},label:{valType:"string",dflt:"",description:"Sets the text label to appear on the button."},execute:{valType:"boolean",dflt:!0,description:["When true, the API method is executed. When false, all other behaviors are the same","and command execution is skipped. This may be useful when hooking into, for example,","the `plotly_buttonclicked` method and executing the API command manually without losing","the benefit of the updatemenu automatically binding to the state of the plot through the","specification of `method` and `args`."].join(" ")}}),ak=LF(rk("updatemenu",{_arrayAttrRegexps:[/^updatemenus\[(0|[1-9][0-9]+)\]\.buttons/],visible:{valType:"boolean",description:["Determines whether or not the update menu is visible."].join(" ")},type:{valType:"enumerated",values:["dropdown","buttons"],dflt:"dropdown",description:["Determines whether the buttons are accessible via a dropdown menu","or whether the buttons are stacked horizontally or vertically"].join(" ")},direction:{valType:"enumerated",values:["left","right","up","down"],dflt:"down",description:["Determines the direction in which the buttons are laid out, whether","in a dropdown menu or a row/column of buttons. For `left` and `up`,","the buttons will still appear in left-to-right or top-to-bottom order","respectively."].join(" ")},active:{valType:"integer",min:-1,dflt:0,description:["Determines which button (by index starting from 0) is","considered active."].join(" ")},showactive:{valType:"boolean",dflt:!0,description:"Highlights active dropdown item or active button if true."},buttons:DF,x:{valType:"number",min:-2,max:3,dflt:-.05,description:"Sets the x position (in normalized coordinates) of the update menu."},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"right",description:["Sets the update menu's horizontal position anchor.","This anchor binds the `x` position to the *left*, *center*","or *right* of the range selector."].join(" ")},y:{valType:"number",min:-2,max:3,dflt:1,description:"Sets the y position (in normalized coordinates) of the update menu."},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top",description:["Sets the update menu's vertical position anchor","This anchor binds the `y` position to the *top*, *middle*","or *bottom* of the range selector."].join(" ")},pad:SF(CF({editType:"arraydraw"}),{description:"Sets the padding around the buttons or dropdown menu."}),font:AF({description:"Sets the font of the update menu button text."}),bgcolor:{valType:"color",description:"Sets the background color of the update menu buttons."},bordercolor:{valType:"color",dflt:MF.borderLine,description:"Sets the color of the border enclosing the update menu."},borderwidth:{valType:"number",min:0,dflt:1,editType:"arraydraw",description:"Sets the width (in px) of the border enclosing the update menu."}}),"arraydraw","from-root"),Pf=me,ik=Ka,nk=ak,$F=Zp,PF=$F.name,RF=nk.buttons,EF=function(e,r){var a={name:PF,handleItemDefaults:zF};ik(e,r,a)};function zF(t,e,r){function a(o,l){return Pf.coerce(t,e,nk,o,l)}var i=ik(t,e,{name:"buttons",handleItemDefaults:IF}),n=a("visible",i.length>0);n&&(a("active"),a("direction"),a("type"),a("showactive"),a("x"),a("y"),Pf.noneOrAll(t,e,["x","y"]),a("xanchor"),a("yanchor"),a("pad.t"),a("pad.r"),a("pad.b"),a("pad.l"),Pf.coerceFont(a,"font",r.font),a("bgcolor",r.paper_bgcolor),a("bordercolor"),a("borderwidth"))}function IF(t,e){function r(i,n){return Pf.coerce(t,e,RF,i,n)}var a=r("visible",t.method==="skip"||Array.isArray(t.args));a&&(r("method"),r("args"),r("args2"),r("label"),r("execute"))}var FF=Jt,$a=gt,Cb=ht,bo=$t,sc=me;function Jt(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})}Jt.barWidth=2;Jt.barLength=20;Jt.barRadius=2;Jt.barPad=1;Jt.barColor="#808BA4";Jt.prototype.enable=function(e,r,a){var i=this.gd._fullLayout,n=i.width,o=i.height;this.position=e;var l=this.position.l,s=this.position.w,f=this.position.t,c=this.position.h,v=this.position.direction,u=v==="down",h=v==="left",d=v==="right",p=v==="up",m=s,y=c,b,w,g,x;!u&&!h&&!d&&!p&&(this.position.direction="down",u=!0);var _=u||p;_?(b=l,w=b+m,u?(g=f,x=Math.min(g+y,o),y=x-g):(x=f+y,g=Math.max(x-y,0),y=x-g)):(g=f,x=g+y,h?(w=l+m,b=Math.max(w-m,0),m=w-b):(b=l,w=Math.min(b+m,n),m=w-b)),this._box={l:b,t:g,w:m,h:y};var T=s>m,k=Jt.barLength+2*Jt.barPad,S=Jt.barWidth+2*Jt.barPad,L=l,D=f+c;D+S>o&&(D=o-S);var $=this.container.selectAll("rect.scrollbar-horizontal").data(T?[0]:[]);$.exit().on(".drag",null).remove(),$.enter().append("rect").classed("scrollbar-horizontal",!0).call(Cb.fill,Jt.barColor),T?(this.hbar=$.attr({rx:Jt.barRadius,ry:Jt.barRadius,x:L,y:D,width:k,height:S}),this._hbarXMin=L+k/2,this._hbarTranslateMax=m-k):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var E=c>y,z=Jt.barWidth+2*Jt.barPad,O=Jt.barLength+2*Jt.barPad,I=l+s,P=f;I+z>n&&(I=n-z);var M=this.container.selectAll("rect.scrollbar-vertical").data(E?[0]:[]);M.exit().on(".drag",null).remove(),M.enter().append("rect").classed("scrollbar-vertical",!0).call(Cb.fill,Jt.barColor),E?(this.vbar=M.attr({rx:Jt.barRadius,ry:Jt.barRadius,x:I,y:P,width:z,height:O}),this._vbarYMin=P+O/2,this._vbarTranslateMax=y-O):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var A=this.id,C=b-.5,R=E?w+z+.5:w+.5,N=g-.5,H=T?x+S+.5:x+.5,B=i._topdefs.selectAll("#"+A).data(T||E?[0]:[]);if(B.exit().remove(),B.enter().append("clipPath").attr("id",A).append("rect"),T||E?(this._clipRect=B.select("rect").attr({x:Math.floor(C),y:Math.floor(N),width:Math.ceil(R)-Math.floor(C),height:Math.ceil(H)-Math.floor(N)}),this.container.call(bo.setClipUrl,A,this.gd),this.bg.attr({x:l,y:f,width:s,height:c})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(bo.setClipUrl,null),delete this._clipRect),T||E){var X=$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(X);var j=$a.behavior.drag().on("dragstart",function(){$a.event.sourceEvent.preventDefault(),$a.event.sourceEvent.stopPropagation()}).on("drag",this._onBarDrag.bind(this));T&&this.hbar.on(".drag",null).call(j),E&&this.vbar.on(".drag",null).call(j)}this.setTranslate(r,a)};Jt.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(bo.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)};Jt.prototype._onBoxDrag=function(){var e=this.translateX,r=this.translateY;this.hbar&&(e-=$a.event.dx),this.vbar&&(r-=$a.event.dy),this.setTranslate(e,r)};Jt.prototype._onBoxWheel=function(){var e=this.translateX,r=this.translateY;this.hbar&&(e+=$a.event.deltaY),this.vbar&&(r+=$a.event.deltaY),this.setTranslate(e,r)};Jt.prototype._onBarDrag=function(){var e=this.translateX,r=this.translateY;if(this.hbar){var a=e+this._hbarXMin,i=a+this._hbarTranslateMax,n=sc.constrain($a.event.x,a,i),o=(n-a)/(i-a),l=this.position.w-this._box.w;e=o*l}if(this.vbar){var s=r+this._vbarYMin,f=s+this._vbarTranslateMax,c=sc.constrain($a.event.y,s,f),v=(c-s)/(f-s),u=this.position.h-this._box.h;r=v*u}this.setTranslate(e,r)};Jt.prototype.setTranslate=function(e,r){var a=this.position.w-this._box.w,i=this.position.h-this._box.h;if(e=sc.constrain(e||0,0,a),r=sc.constrain(r||0,0,i),this.translateX=e,this.translateY=r,this.container.call(bo.setTranslate,this._box.l-this.position.l-e,this._box.t-this.position.t-r),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+e-.5),y:Math.floor(this.position.t+r-.5)}),this.hbar){var n=e/a;this.hbar.call(bo.setTranslate,e+n*this._hbarTranslateMax,r)}if(this.vbar){var o=r/i;this.vbar.call(bo.setTranslate,e,r+o*this._vbarTranslateMax)}};var Co=gt,Kl=cr,Ql=ht,Do=$t,ia=me,fc=br,NF=Ht.arrayEditor,ok=Ur.LINE_SPACING,ut=Zp,HF=FF,OF=function(e){var r=e._fullLayout,a=ia.filterVisible(r[ut.name]);function i(u){Kl.autoMargin(e,uk(u))}var n=r._menulayer.selectAll("g."+ut.containerClassName).data(a.length>0?[0]:[]);if(n.enter().append("g").classed(ut.containerClassName,!0).style("cursor","pointer"),n.exit().each(function(){Co.select(this).selectAll("g."+ut.headerGroupClassName).each(i)}).remove(),a.length!==0){var o=n.selectAll("g."+ut.headerGroupClassName).data(a,jF);o.enter().append("g").classed(ut.headerGroupClassName,!0);for(var l=ia.ensureSingle(n,"g",ut.dropdownButtonGroupClassName,function(u){u.style("pointer-events","all")}),s=0;s<a.length;s++){var f=a[s];YF(e,f)}var c="updatemenus"+r._uid,v=new HF(e,l,c);o.enter().size()&&(l.node().parentNode.appendChild(l.node()),l.call(ch)),o.exit().each(function(u){l.call(ch),i(u)}).remove(),o.each(function(u){var h=Co.select(this),d=u.type==="dropdown"?l:null;Kl.manageCommandObserver(e,u,u.buttons,function(p){fh(e,u,u.buttons[p.index],h,d,v,p.index,!0)}),u.type==="dropdown"?(sk(e,h,l,v,u),lk(l,u)&&Jl(e,h,l,v,u)):Jl(e,h,null,null,u)})}};function jF(t){return t._index}function BF(t){return+t.attr(ut.menuIndexAttrName)==-1}function lk(t,e){return+t.attr(ut.menuIndexAttrName)===e._index}function fh(t,e,r,a,i,n,o,l){e.active=o,NF(t.layout,ut.name,e).applyUpdate("active",o),e.type==="buttons"?Jl(t,a,null,null,e):e.type==="dropdown"&&(i.attr(ut.menuIndexAttrName,"-1"),sk(t,a,i,n,e),l||Jl(t,a,i,n,e))}function sk(t,e,r,a,i){var n=ia.ensureSingle(e,"g",ut.headerClassName,function(u){u.style("pointer-events","all")}),o=i._dims,l=i.active,s=i.buttons[l]||ut.blankHeaderOpts,f={y:i.pad.t,yPad:0,x:i.pad.l,xPad:0,index:0},c={width:o.headerWidth,height:o.headerHeight};n.call(Kp,i,s,t).call(vk,i,f,c);var v=ia.ensureSingle(e,"text",ut.headerArrowClassName,function(u){u.attr("text-anchor","end").call(Do.font,i.font).text(ut.arrowSymbol[i.direction])});v.attr({x:o.headerWidth-ut.arrowOffsetX+i.pad.l,y:o.headerHeight/2+ut.textOffsetY+i.pad.t}),n.on("click",function(){r.call(ch,String(lk(r,i)?-1:i._index)),Jl(t,e,r,a,i)}),n.on("mouseover",function(){n.call(fk)}),n.on("mouseout",function(){n.call(ck,i)}),Do.setTranslate(e,o.lx,o.ly)}function Jl(t,e,r,a,i){r||(r=e,r.attr("pointer-events","all"));var n=!BF(r)||i.type==="buttons"?i.buttons:[],o=i.type==="dropdown"?ut.dropdownButtonClassName:ut.buttonClassName,l=r.selectAll("g."+o).data(ia.filterVisible(n)),s=l.enter().append("g").classed(o,!0),f=l.exit();i.type==="dropdown"?(s.attr("opacity","0").transition().attr("opacity","1"),f.transition().attr("opacity","0").remove()):f.remove();var c=0,v=0,u=i._dims,h=["up","down"].indexOf(i.direction)!==-1;i.type==="dropdown"&&(h?v=u.headerHeight+ut.gapButtonHeader:c=u.headerWidth+ut.gapButtonHeader),i.type==="dropdown"&&i.direction==="up"&&(v=-ut.gapButtonHeader+ut.gapButton-u.openHeight),i.type==="dropdown"&&i.direction==="left"&&(c=-ut.gapButtonHeader+ut.gapButton-u.openWidth);var d={x:u.lx+c+i.pad.l,y:u.ly+v+i.pad.t,yPad:ut.gapButton,xPad:ut.gapButton,index:0},p={l:d.x+i.borderwidth,t:d.y+i.borderwidth};l.each(function(m,y){var b=Co.select(this);b.call(Kp,i,m,t).call(vk,i,d),b.on("click",function(){Co.event.defaultPrevented||(m.execute&&(m.args2&&i.active===y?(fh(t,i,m,e,r,a,-1),Kl.executeAPICommand(t,m.method,m.args2)):(fh(t,i,m,e,r,a,y),Kl.executeAPICommand(t,m.method,m.args))),t.emit("plotly_buttonclicked",{menu:i,button:m,active:i.active}))}),b.on("mouseover",function(){b.call(fk)}),b.on("mouseout",function(){b.call(ck,i),l.call(Db,i)})}),l.call(Db,i),h?(p.w=Math.max(u.openWidth,u.headerWidth),p.h=d.y-p.t):(p.w=d.x-p.l,p.h=Math.max(u.openHeight,u.headerHeight)),p.direction=i.direction,a&&(l.size()?GF(t,e,r,a,i,p):UF(a))}function GF(t,e,r,a,i,n){var o=i.direction,l=o==="up"||o==="down",s=i._dims,f=i.active,c,v,u;if(l)for(v=0,u=0;u<f;u++)v+=s.heights[u]+ut.gapButton;else for(c=0,u=0;u<f;u++)c+=s.widths[u]+ut.gapButton;a.enable(n,c,v),a.hbar&&a.hbar.attr("opacity","0").transition().attr("opacity","1"),a.vbar&&a.vbar.attr("opacity","0").transition().attr("opacity","1")}function UF(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 Kp(t,e,r,a){t.call(VF,e).call(XF,e,r,a)}function VF(t,e){var r=ia.ensureSingle(t,"rect",ut.itemRectClassName,function(a){a.attr({rx:ut.rx,ry:ut.ry,"shape-rendering":"crispEdges"})});r.call(Ql.stroke,e.bordercolor).call(Ql.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px")}function XF(t,e,r,a){var i=ia.ensureSingle(t,"text",ut.itemTextClassName,function(l){l.attr({"text-anchor":"start","data-notex":1})}),n=r.label,o=a._fullLayout._meta;o&&(n=ia.templateString(n,o)),i.call(Do.font,e.font).text(n).call(fc.convertToTspans,a)}function Db(t,e){var r=e.active;t.each(function(a,i){var n=Co.select(this);i===r&&e.showactive&&n.select("rect."+ut.itemRectClassName).call(Ql.fill,ut.activeColor)})}function fk(t){t.select("rect."+ut.itemRectClassName).call(Ql.fill,ut.hoverColor)}function ck(t,e){t.select("rect."+ut.itemRectClassName).call(Ql.fill,e.bgcolor)}function YF(t,e){var r=e._dims={width1:0,height1:0,heights:[],widths:[],totalWidth:0,totalHeight:0,openWidth:0,openHeight:0,lx:0,ly:0},a=Do.tester.selectAll("g."+ut.dropdownButtonClassName).data(ia.filterVisible(e.buttons));a.enter().append("g").classed(ut.dropdownButtonClassName,!0);var i=["up","down"].indexOf(e.direction)!==-1;a.each(function(c,v){var u=Co.select(this);u.call(Kp,e,c,t);var h=u.select("."+ut.itemTextClassName),d=h.node()&&Do.bBox(h.node()).width,p=Math.max(d+ut.textPadX,ut.minWidth),m=e.font.size*ok,y=fc.lineCount(h),b=Math.max(m*y,ut.minHeight)+ut.textOffsetY;b=Math.ceil(b),p=Math.ceil(p),r.widths[v]=p,r.heights[v]=b,r.height1=Math.max(r.height1,b),r.width1=Math.max(r.width1,p),i?(r.totalWidth=Math.max(r.totalWidth,p),r.openWidth=r.totalWidth,r.totalHeight+=b+ut.gapButton,r.openHeight+=b+ut.gapButton):(r.totalWidth+=p+ut.gapButton,r.openWidth+=p+ut.gapButton,r.totalHeight=Math.max(r.totalHeight,b),r.openHeight=r.totalHeight)}),i?r.totalHeight-=ut.gapButton:r.totalWidth-=ut.gapButton,r.headerWidth=r.width1+ut.arrowPadX,r.headerHeight=r.height1,e.type==="dropdown"&&(i?(r.width1+=ut.arrowPadX,r.totalHeight=r.height1):r.totalWidth=r.width1,r.totalWidth+=ut.arrowPadX),a.remove();var n=r.totalWidth+e.pad.l+e.pad.r,o=r.totalHeight+e.pad.t+e.pad.b,l=t._fullLayout._size;r.lx=l.l+l.w*e.x,r.ly=l.t+l.h*(1-e.y);var s="left";ia.isRightAnchor(e)&&(r.lx-=n,s="right"),ia.isCenterAnchor(e)&&(r.lx-=n/2,s="center");var f="top";ia.isBottomAnchor(e)&&(r.ly-=o,f="bottom"),ia.isMiddleAnchor(e)&&(r.ly-=o/2,f="middle"),r.totalWidth=Math.ceil(r.totalWidth),r.totalHeight=Math.ceil(r.totalHeight),r.lx=Math.round(r.lx),r.ly=Math.round(r.ly),Kl.autoMargin(t,uk(e),{x:e.x,y:e.y,l:n*({right:1,center:.5}[s]||0),r:n*({left:1,center:.5}[s]||0),b:o*({top:1,middle:.5}[f]||0),t:o*({bottom:1,middle:.5}[f]||0)})}function uk(t){return ut.autoMarginIdRoot+t._index}function vk(t,e,r,a){a=a||{};var i=t.select("."+ut.itemRectClassName),n=t.select("."+ut.itemTextClassName),o=e.borderwidth,l=r.index,s=e._dims;Do.setTranslate(t,o+r.x,o+r.y);var f=["up","down"].indexOf(e.direction)!==-1,c=a.height||(f?s.heights[l]:s.height1);i.attr({x:0,y:0,width:a.width||(f?s.width1:s.widths[l]),height:c});var v=e.font.size*ok,u=fc.lineCount(n),h=(u-1)*v/2;fc.positionText(n,ut.textOffsetX,c/2-h+ut.textOffsetY),f?r.y+=s.heights[l]+r.yPad:r.x+=s.widths[l]+r.xPad,r.index++}function ch(t,e){t.attr(ut.menuIndexAttrName,e||"-1").selectAll("g."+ut.dropdownButtonClassName).remove()}var WF=Zp,qF={moduleType:"component",name:WF.name,layoutAttributes:ak,supplyLayoutDefaults:EF,draw:OF},fu={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},$b=Mr,ZF=Fh,KF=Qt.extendDeepAll,QF=Ya.overrideAll,JF=Cc,dk=Ht.templatedArray,Ji=fu,eN=dk("step",{visible:{valType:"boolean",dflt:!0,description:["Determines whether or not this step is included in the slider."].join(" ")},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle",description:["Sets the Plotly method to be called when the slider value is changed.","If the `skip` method is used, the API slider will function as normal","but will perform no API calls and will not bind automatically to state","updates. This may be used to create a component interface and attach to","slider events manually via JavaScript."].join(" ")},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}],description:["Sets the arguments values to be passed to the Plotly","method set in `method` on slide."].join(" ")},label:{valType:"string",description:"Sets the text label to appear on the slider"},value:{valType:"string",description:["Sets the value of the slider step, used to refer to the step programatically.","Defaults to the slider label if not provided."].join(" ")},execute:{valType:"boolean",dflt:!0,description:["When true, the API method is executed. When false, all other behaviors are the same","and command execution is skipped. This may be useful when hooking into, for example,","the `plotly_sliderchange` method and executing the API command manually without losing","the benefit of the slider automatically binding to the state of the plot through the","specification of `method` and `args`."].join(" ")}}),hk=QF(dk("slider",{visible:{valType:"boolean",dflt:!0,description:["Determines whether or not the slider is visible."].join(" ")},active:{valType:"number",min:0,dflt:0,description:["Determines which button (by index starting from 0) is","considered active."].join(" ")},steps:eN,lenmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"fraction",description:["Determines whether this slider length","is set in units of plot *fraction* or in *pixels.","Use `len` to set the value."].join(" ")},len:{valType:"number",min:0,dflt:1,description:["Sets the length of the slider","This measure excludes the padding of both ends.","That is, the slider's length is this length minus the","padding on both ends."].join(" ")},x:{valType:"number",min:-2,max:3,dflt:0,description:"Sets the x position (in normalized coordinates) of the slider."},pad:KF(ZF({editType:"arraydraw"}),{description:"Set the padding of the slider component along each side."},{t:{dflt:20}}),xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left",description:["Sets the slider's horizontal position anchor.","This anchor binds the `x` position to the *left*, *center*","or *right* of the range selector."].join(" ")},y:{valType:"number",min:-2,max:3,dflt:0,description:"Sets the y position (in normalized coordinates) of the slider."},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top",description:["Sets the slider's vertical position anchor","This anchor binds the `y` position to the *top*, *middle*","or *bottom* of the range selector."].join(" ")},transition:{duration:{valType:"number",min:0,dflt:150,description:"Sets the duration of the slider transition"},easing:{valType:"enumerated",values:JF.transition.easing.values,dflt:"cubic-in-out",description:"Sets the easing function of the slider transition"}},currentvalue:{visible:{valType:"boolean",dflt:!0,description:["Shows the currently-selected value above the slider."].join(" ")},xanchor:{valType:"enumerated",values:["left","center","right"],dflt:"left",description:["The alignment of the value readout relative to the length of the slider."].join(" ")},offset:{valType:"number",dflt:10,description:["The amount of space, in pixels, between the current value label","and the slider."].join(" ")},prefix:{valType:"string",description:"When currentvalue.visible is true, this sets the prefix of the label."},suffix:{valType:"string",description:"When currentvalue.visible is true, this sets the suffix of the label."},font:$b({description:"Sets the font of the current value label text."})},font:$b({description:"Sets the font of the slider step labels."}),activebgcolor:{valType:"color",dflt:Ji.gripBgActiveColor,description:["Sets the background color of the slider grip","while dragging."].join(" ")},bgcolor:{valType:"color",dflt:Ji.railBgColor,description:"Sets the background color of the slider."},bordercolor:{valType:"color",dflt:Ji.railBorderColor,description:"Sets the color of the border enclosing the slider."},borderwidth:{valType:"number",min:0,dflt:Ji.railBorderWidth,description:"Sets the width (in px) of the border enclosing the slider."},ticklen:{valType:"number",min:0,dflt:Ji.tickLength,description:"Sets the length in pixels of step tick marks"},tickcolor:{valType:"color",dflt:Ji.tickColor,description:"Sets the color of the border enclosing the slider."},tickwidth:{valType:"number",min:0,dflt:1,description:"Sets the tick width (in px)."},minorticklen:{valType:"number",min:0,dflt:Ji.minorTickLength,description:"Sets the length in pixels of minor step tick marks"}}),"arraydraw","from-root"),no=me,pk=Ka,mk=hk,tN=fu,rN=tN.name,aN=mk.steps,iN=function(e,r){pk(e,r,{name:rN,handleItemDefaults:nN})};function nN(t,e,r){function a(v,u){return no.coerce(t,e,mk,v,u)}for(var i=pk(t,e,{name:"steps",handleItemDefaults:oN}),n=0,o=0;o<i.length;o++)i[o].visible&&n++;var l;if(n<2?l=e.visible=!1:l=a("visible"),!!l){e._stepCount=n;var s=e._visibleSteps=no.filterVisible(i),f=a("active");(i[f]||{}).visible||(e.active=s[0]._index),a("x"),a("y"),no.noneOrAll(t,e,["x","y"]),a("xanchor"),a("yanchor"),a("len"),a("lenmode"),a("pad.t"),a("pad.r"),a("pad.b"),a("pad.l"),no.coerceFont(a,"font",r.font);var c=a("currentvalue.visible");c&&(a("currentvalue.xanchor"),a("currentvalue.prefix"),a("currentvalue.suffix"),a("currentvalue.offset"),no.coerceFont(a,"currentvalue.font",e.font)),a("transition.duration"),a("transition.easing"),a("bgcolor"),a("activebgcolor"),a("bordercolor"),a("borderwidth"),a("ticklen"),a("tickwidth"),a("tickcolor"),a("minorticklen")}}function oN(t,e){function r(n,o){return no.coerce(t,e,aN,n,o)}var a;if(t.method!=="skip"&&!Array.isArray(t.args)?a=e.visible=!1:a=r("visible"),a){r("method"),r("args");var i=r("label","step-"+e._index);r("value",i),r("execute")}}var Pa=gt,cc=cr,Ii=ht,za=$t,na=me,lN=na.strTranslate,$l=br,sN=Ht.arrayEditor,xt=fu,Qp=Ur,yk=Qp.LINE_SPACING,Hv=Qp.FROM_TL,Ov=Qp.FROM_BR,fN=function(e){var r=e._context.staticPlot,a=e._fullLayout,i=cN(a,e),n=a._infolayer.selectAll("g."+xt.containerClassName).data(i.length>0?[0]:[]);n.enter().append("g").classed(xt.containerClassName,!0).style("cursor",r?null:"ew-resize");function o(c){c._commandObserver&&(c._commandObserver.remove(),delete c._commandObserver),cc.autoMargin(e,gk(c))}if(n.exit().each(function(){Pa.select(this).selectAll("g."+xt.groupClassName).each(o)}).remove(),i.length!==0){var l=n.selectAll("g."+xt.groupClassName).data(i,uN);l.enter().append("g").classed(xt.groupClassName,!0),l.exit().each(o).remove();for(var s=0;s<i.length;s++){var f=i[s];vN(e,f)}l.each(function(c){var v=Pa.select(this);yN(c),cc.manageCommandObserver(e,c,c._visibleSteps,function(u){var h=v.data()[0];h.active!==u.index&&(h._dragging||xk(e,v,h,u.index,!1,!0))}),dN(e,Pa.select(this),c)})}};function gk(t){return xt.autoMarginIdRoot+t._index}function cN(t,e){for(var r=t[xt.name],a=[],i=0;i<r.length;i++){var n=r[i];n.visible&&(n._gd=e,a.push(n))}return a}function uN(t){return t._index}function vN(t,e){var r=za.tester.selectAll("g."+xt.labelGroupClass).data(e._visibleSteps);r.enter().append("g").classed(xt.labelGroupClass,!0);var a=0,i=0;r.each(function(d){var p=Pa.select(this),m=bk(p,{step:d},e),y=m.node();if(y){var b=za.bBox(y);i=Math.max(i,b.height),a=Math.max(a,b.width)}}),r.remove();var n=e._dims={};n.inputAreaWidth=Math.max(xt.railWidth,xt.gripHeight);var o=t._fullLayout._size;n.lx=o.l+o.w*e.x,n.ly=o.t+o.h*(1-e.y),e.lenmode==="fraction"?n.outerLength=Math.round(o.w*e.len):n.outerLength=e.len,n.inputAreaStart=0,n.inputAreaLength=Math.round(n.outerLength-e.pad.l-e.pad.r);var l=n.inputAreaLength-2*xt.stepInset,s=l/(e._stepCount-1),f=a+xt.labelPadding;if(n.labelStride=Math.max(1,Math.ceil(f/s)),n.labelHeight=i,n.currentValueMaxWidth=0,n.currentValueHeight=0,n.currentValueTotalHeight=0,n.currentValueMaxLines=1,e.currentvalue.visible){var c=za.tester.append("g");r.each(function(d){var p=uc(c,e,d.label),m=p.node()&&za.bBox(p.node())||{width:0,height:0},y=$l.lineCount(p);n.currentValueMaxWidth=Math.max(n.currentValueMaxWidth,Math.ceil(m.width)),n.currentValueHeight=Math.max(n.currentValueHeight,Math.ceil(m.height)),n.currentValueMaxLines=Math.max(n.currentValueMaxLines,y)}),n.currentValueTotalHeight=n.currentValueHeight+e.currentvalue.offset,c.remove()}n.height=n.currentValueTotalHeight+xt.tickOffset+e.ticklen+xt.labelOffset+n.labelHeight+e.pad.t+e.pad.b;var v="left";na.isRightAnchor(e)&&(n.lx-=n.outerLength,v="right"),na.isCenterAnchor(e)&&(n.lx-=n.outerLength/2,v="center");var u="top";na.isBottomAnchor(e)&&(n.ly-=n.height,u="bottom"),na.isMiddleAnchor(e)&&(n.ly-=n.height/2,u="middle"),n.outerLength=Math.ceil(n.outerLength),n.height=Math.ceil(n.height),n.lx=Math.round(n.lx),n.ly=Math.round(n.ly);var h={y:e.y,b:n.height*Ov[u],t:n.height*Hv[u]};e.lenmode==="fraction"?(h.l=0,h.xl=e.x-e.len*Hv[v],h.r=0,h.xr=e.x+e.len*Ov[v]):(h.x=e.x,h.l=n.outerLength*Hv[v],h.r=n.outerLength*Ov[v]),cc.autoMargin(t,gk(e),h)}function dN(t,e,r){(r.steps[r.active]||{}).visible||(r.active=r._visibleSteps[0]._index),e.call(uc,r).call(bN,r).call(pN,r).call(mN,r).call(gN,t,r).call(hN,t,r);var a=r._dims;za.setTranslate(e,a.lx+r.pad.l,a.ly+r.pad.t),e.call(wk,r,!1),e.call(uc,r)}function uc(t,e,r){if(e.currentvalue.visible){var a=e._dims,i,n;switch(e.currentvalue.xanchor){case"right":i=a.inputAreaLength-xt.currentValueInset-a.currentValueMaxWidth,n="left";break;case"center":i=a.inputAreaLength*.5,n="middle";break;default:i=xt.currentValueInset,n="left"}var o=na.ensureSingle(t,"text",xt.labelClass,function(u){u.attr({"text-anchor":n,"data-notex":1})}),l=e.currentvalue.prefix?e.currentvalue.prefix:"";if(typeof r=="string")l+=r;else{var s=e.steps[e.active].label,f=e._gd._fullLayout._meta;f&&(s=na.templateString(s,f)),l+=s}e.currentvalue.suffix&&(l+=e.currentvalue.suffix),o.call(za.font,e.currentvalue.font).text(l).call($l.convertToTspans,e._gd);var c=$l.lineCount(o),v=(a.currentValueMaxLines+1-c)*e.currentvalue.font.size*yk;return $l.positionText(o,i,v),o}}function hN(t,e,r){var a=na.ensureSingle(t,"rect",xt.gripRectClass,function(i){i.call(_k,e,t,r).style("pointer-events","all")});a.attr({width:xt.gripWidth,height:xt.gripHeight,rx:xt.gripRadius,ry:xt.gripRadius}).call(Ii.stroke,r.bordercolor).call(Ii.fill,r.bgcolor).style("stroke-width",r.borderwidth+"px")}function bk(t,e,r){var a=na.ensureSingle(t,"text",xt.labelClass,function(o){o.attr({"text-anchor":"middle","data-notex":1})}),i=e.step.label,n=r._gd._fullLayout._meta;return n&&(i=na.templateString(i,n)),a.call(za.font,r.font).text(i).call($l.convertToTspans,r._gd),a}function pN(t,e){var r=na.ensureSingle(t,"g",xt.labelsClass),a=e._dims,i=r.selectAll("g."+xt.labelGroupClass).data(a.labelSteps);i.enter().append("g").classed(xt.labelGroupClass,!0),i.exit().remove(),i.each(function(n){var o=Pa.select(this);o.call(bk,n,e),za.setTranslate(o,Jp(e,n.fraction),xt.tickOffset+e.ticklen+e.font.size*yk+xt.labelOffset+a.currentValueTotalHeight)})}function Pb(t,e,r,a,i){var n=Math.round(a*(r._stepCount-1)),o=r._visibleSteps[n]._index;o!==r.active&&xk(t,e,r,o,!0,i)}function xk(t,e,r,a,i,n){var o=r.active;r.active=a,sN(t.layout,xt.name,r).applyUpdate("active",a);var l=r.steps[r.active];e.call(wk,r,n),e.call(uc,r),t.emit("plotly_sliderchange",{slider:r,step:r.steps[r.active],interaction:i,previousActive:o}),l&&l.method&&i&&(e._nextMethod?(e._nextMethod.step=l,e._nextMethod.doCallback=i,e._nextMethod.doTransition=n):(e._nextMethod={step:l,doCallback:i,doTransition:n},e._nextMethodRaf=window.requestAnimationFrame(function(){var s=e._nextMethod.step;s.method&&(s.execute&&cc.executeAPICommand(t,s.method,s.args),e._nextMethod=null,e._nextMethodRaf=null)})))}function _k(t,e,r){if(e._context.staticPlot)return;var a=r.node(),i=Pa.select(e);function n(){return r.data()[0]}function o(){var l=n();e.emit("plotly_sliderstart",{slider:l});var s=r.select("."+xt.gripRectClass);Pa.event.stopPropagation(),Pa.event.preventDefault(),s.call(Ii.fill,l.activebgcolor);var f=Rb(l,Pa.mouse(a)[0]);Pb(e,r,l,f,!0),l._dragging=!0;function c(){var u=n(),h=Rb(u,Pa.mouse(a)[0]);Pb(e,r,u,h,!1)}i.on("mousemove",c),i.on("touchmove",c);function v(){var u=n();u._dragging=!1,s.call(Ii.fill,u.bgcolor),i.on("mouseup",null),i.on("mousemove",null),i.on("touchend",null),i.on("touchmove",null),e.emit("plotly_sliderend",{slider:u,step:u.steps[u.active]})}i.on("mouseup",v),i.on("touchend",v)}t.on("mousedown",o),t.on("touchstart",o)}function mN(t,e){var r=t.selectAll("rect."+xt.tickRectClass).data(e._visibleSteps),a=e._dims;r.enter().append("rect").classed(xt.tickRectClass,!0),r.exit().remove(),r.attr({width:e.tickwidth+"px","shape-rendering":"crispEdges"}),r.each(function(i,n){var o=n%a.labelStride===0,l=Pa.select(this);l.attr({height:o?e.ticklen:e.minorticklen}).call(Ii.fill,e.tickcolor),za.setTranslate(l,Jp(e,n/(e._stepCount-1))-.5*e.tickwidth,(o?xt.tickOffset:xt.minorTickOffset)+a.currentValueTotalHeight)})}function yN(t){var e=t._dims;e.labelSteps=[];for(var r=t._stepCount,a=0;a<r;a+=e.labelStride)e.labelSteps.push({fraction:a/(r-1),step:t._visibleSteps[a]})}function wk(t,e,r){for(var a=t.select("rect."+xt.gripRectClass),i=0,n=0;n<e._stepCount;n++)if(e._visibleSteps[n]._index===e.active){i=n;break}var o=Jp(e,i/(e._stepCount-1));if(!e._invokingCommand){var l=a;r&&e.transition.duration>0&&(l=l.transition().duration(e.transition.duration).ease(e.transition.easing)),l.attr("transform",lN(o-xt.gripWidth*.5,e._dims.currentValueTotalHeight))}}function Jp(t,e){var r=t._dims;return r.inputAreaStart+xt.stepInset+(r.inputAreaLength-2*xt.stepInset)*Math.min(1,Math.max(0,e))}function Rb(t,e){var r=t._dims;return Math.min(1,Math.max(0,(e-xt.stepInset-r.inputAreaStart)/(r.inputAreaLength-2*xt.stepInset-2*r.inputAreaStart)))}function gN(t,e,r){var a=r._dims,i=na.ensureSingle(t,"rect",xt.railTouchRectClass,function(n){n.call(_k,e,t,r).style("pointer-events","all")});i.attr({width:a.inputAreaLength,height:Math.max(a.inputAreaWidth,xt.tickOffset+r.ticklen+a.labelHeight)}).call(Ii.fill,r.bgcolor).attr("opacity",0),za.setTranslate(i,0,a.currentValueTotalHeight)}function bN(t,e){var r=e._dims,a=r.inputAreaLength-xt.railInset*2,i=na.ensureSingle(t,"rect",xt.railRectClass);i.attr({width:a,height:xt.railWidth,rx:xt.railRadius,ry:xt.railRadius,"shape-rendering":"crispEdges"}).call(Ii.stroke,e.bordercolor).call(Ii.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px"),za.setTranslate(i,xt.railInset,(r.inputAreaWidth-xt.railWidth)*.5+r.currentValueTotalHeight)}var xN=fu,_N={moduleType:"component",name:xN.name,layoutAttributes:hk,supplyLayoutDefaults:iN,draw:fN},Eb=zr,em={bgcolor:{valType:"color",dflt:Eb.background,editType:"plot",description:"Sets the background color of the range slider."},bordercolor:{valType:"color",dflt:Eb.defaultLine,editType:"plot",description:"Sets the border color of the range slider."},borderwidth:{valType:"integer",dflt:0,min:0,editType:"plot",description:"Sets the border width of the range slider."},autorange:{valType:"boolean",dflt:!0,editType:"calc",impliedEdits:{"range[0]":void 0,"range[1]":void 0},description:["Determines whether or not the range slider range is","computed in relation to the input data.","If `range` is provided, then `autorange` is set to *false*."].join(" ")},range:{valType:"info_array",items:[{valType:"any",editType:"calc",impliedEdits:{"^autorange":!1}},{valType:"any",editType:"calc",impliedEdits:{"^autorange":!1}}],editType:"calc",impliedEdits:{autorange:!1},description:["Sets the range of the range slider.","If not set, defaults to the full xaxis range.","If the axis `type` is *log*, then you must take the","log of your desired range.","If the axis `type` is *date*, it should be date strings,","like date data, though Date objects and unix milliseconds","will be accepted and converted to strings.","If the axis `type` is *category*, it should be numbers,","using the scale where each category is assigned a serial","number from zero in the order it appears."].join(" ")},thickness:{valType:"number",dflt:.15,min:0,max:1,editType:"plot",description:["The height of the range slider as a fraction of the","total plot area height."].join(" ")},visible:{valType:"boolean",dflt:!0,editType:"calc",description:["Determines whether or not the range slider will be visible.","If visible, perpendicular axes will be set to `fixedrange`"].join(" ")},editType:"calc"},Tk={_isSubplotObj:!0,rangemode:{valType:"enumerated",values:["auto","fixed","match"],dflt:"match",editType:"calc",description:["Determines whether or not the range of this axis in","the rangeslider use the same value than in the main plot","when zooming in/out.","If *auto*, the autorange will be used.","If *fixed*, the `range` is used.","If *match*, the current range of the corresponding y-axis on the main subplot is used."].join(" ")},range:{valType:"info_array",items:[{valType:"any",editType:"plot"},{valType:"any",editType:"plot"}],editType:"plot",description:["Sets the range of this axis for the rangeslider."].join(" ")},editType:"calc"},cu={},tm={name:"rangeslider",containerClassName:"rangeslider-container",bgClassName:"rangeslider-bg",rangePlotClassName:"rangeslider-rangeplot",maskMinClassName:"rangeslider-mask-min",maskMaxClassName:"rangeslider-mask-max",slideBoxClassName:"rangeslider-slidebox",grabberMinClassName:"rangeslider-grabber-min",grabAreaMinClassName:"rangeslider-grabarea-min",handleMinClassName:"rangeslider-handle-min",grabberMaxClassName:"rangeslider-grabber-max",grabAreaMaxClassName:"rangeslider-grabarea-max",handleMaxClassName:"rangeslider-handle-max",maskMinOppAxisClassName:"rangeslider-mask-min-opp-axis",maskMaxOppAxisClassName:"rangeslider-mask-max-opp-axis",maskColor:"rgba(0,0,0,0.4)",maskOppAxisColor:"rgba(0,0,0,0.2)",slideBoxFill:"transparent",slideBoxCursor:"ew-resize",grabAreaFill:"transparent",grabAreaCursor:"col-resize",grabAreaWidth:10,handleWidth:4,handleRadius:1,handleStrokeWidth:1,extraPad:15},wN=lr,TN=br,kk=tm,kN=Ur.LINE_SPACING,vc=kk.name;function Ak(t){var e=t&&t[vc];return e&&e.visible}cu.isVisible=Ak;cu.makeData=function(t){var e=wN.list({_fullLayout:t},"x",!0),r=t.margin,a=[];if(!t._has("gl2d"))for(var i=0;i<e.length;i++){var n=e[i];if(Ak(n)){a.push(n);var o=n[vc];o._id=vc+n._id,o._height=(t.height-r.b-r.t)*o.thickness,o._offsetShift=Math.floor(o.borderwidth/2)}}t._rangeSliderData=a};cu.autoMarginOpts=function(t,e){var r=t._fullLayout,a=e[vc],i=e._id.charAt(0),n=0,o=0;if(e.side==="bottom"&&(n=e._depth,e.title.text!==r._dfltTitle[i])){o=1.5*e.title.font.size+10+a._offsetShift;var l=(e.title.text.match(TN.BR_TAG_ALL)||[]).length;o+=l*e.title.font.size*kN}return{x:0,y:e._counterDomainMin,l:0,r:0,t:0,b:a._height+n+Math.max(r.margin.b,o),pad:kk.extraPad+a._offsetShift*2}};var jv,zb;function AN(){if(zb)return jv;zb=1;var t=me,e=Ht,r=lr,a=em,i=Tk;return jv=function(o,l,s){var f=o[s],c=l[s];if(!(f.rangeslider||l._requestRangeslider[c._id]))return;t.isPlainObject(f.rangeslider)||(f.rangeslider={});var v=f.rangeslider,u=e.newContainer(c,"rangeslider");function h(L,D){return t.coerce(v,u,a,L,D)}var d,p;function m(L,D){return t.coerce(d,p,i,L,D)}var y=h("visible");if(y){h("bgcolor",l.plot_bgcolor),h("bordercolor"),h("borderwidth"),h("thickness"),h("autorange",!c.isValidRange(v.range)),h("range");var b=l._subplots;if(b)for(var w=b.cartesian.filter(function(L){return L.substr(0,L.indexOf("y"))===r.name2id(s)}).map(function(L){return L.substr(L.indexOf("y"),L.length)}),g=t.simpleMap(w,r.id2name),x=0;x<g.length;x++){var _=g[x];d=v[_]||{},p=e.newContainer(u,_,"yaxis");var T=l[_],k;d.range&&T.isValidRange(d.range)&&(k="fixed");var S=m("rangemode",k);S!=="match"&&m("range",T.range.slice())}u._input=v}},jv}var Bv,Ib;function MN(){if(Ib)return Bv;Ib=1;var t=lr.list,e=cs.getAutoRange,r=tm;return Bv=function(i){for(var n=t(i,"x",!0),o=0;o<n.length;o++){var l=n[o],s=l[r.name];s&&s.visible&&s.autorange&&(s._input.autorange=!0,s._input.range=s.range=e(i,l))}},Bv}var Gv,Fb;function SN(){if(Fb)return Gv;Fb=1;var t=gt,e=ot,r=cr,a=me,i=a.strTranslate,n=$t,o=ht,l=Hc,s=ur,f=lr,c=Qa,v=ji,u=tm;Gv=function(T){for(var k=T._fullLayout,S=k._rangeSliderData,L=0;L<S.length;L++){var D=S[L][u.name];D._clipId=D._id+"-"+k._uid}function $(z){return z._name}var E=k._infolayer.selectAll("g."+u.containerClassName).data(S,$);E.exit().each(function(z){var O=z[u.name];k._topdefs.select("#"+O._clipId).remove()}).remove(),S.length!==0&&(E.enter().append("g").classed(u.containerClassName,!0).attr("pointer-events","all"),E.each(function(z){var O=t.select(this),I=z[u.name],P=k[f.id2name(z.anchor)],M=I[f.id2name(z.anchor)];if(I.range){var A=a.simpleMap(I.range,z.r2l),C=a.simpleMap(z.range,z.r2l),R;C[0]<C[1]?R=[Math.min(A[0],C[0]),Math.max(A[1],C[1])]:R=[Math.max(A[0],C[0]),Math.min(A[1],C[1])],I.range=I._input.range=a.simpleMap(R,z.l2r)}z.cleanRange("rangeslider.range");var N=k._size,H=z.domain;I._width=N.w*(H[1]-H[0]);var B=Math.round(N.l+N.w*H[0]),X=Math.round(N.t+N.h*(1-z._counterDomainMin)+(z.side==="bottom"?z._depth:0)+I._offsetShift+u.extraPad);O.attr("transform",i(B,X)),I._rl=a.simpleMap(I.range,z.r2l);var j=I._rl[0],q=I._rl[1],U=q-j;if(I.p2d=function(fe){return fe/I._width*U+j},I.d2p=function(fe){return(fe-j)/U*I._width},z.rangebreaks){var Z=z.locateBreaks(j,q);if(Z.length){var K,ee,le=0;for(K=0;K<Z.length;K++)ee=Z[K],le+=ee.max-ee.min;var ye=I._width/(q-j-le),se=[-ye*j];for(K=0;K<Z.length;K++)ee=Z[K],se.push(se[se.length-1]-ye*(ee.max-ee.min));for(I.d2p=function(fe){for(var pe=se[0],ge=0;ge<Z.length;ge++){var ue=Z[ge];if(fe>=ue.max)pe=se[ge+1];else if(fe<ue.min)break}return pe+ye*fe},K=0;K<Z.length;K++)ee=Z[K],ee.pmin=I.d2p(ee.min),ee.pmax=I.d2p(ee.max);I.p2d=function(fe){for(var pe=se[0],ge=0;ge<Z.length;ge++){var ue=Z[ge];if(fe>=ue.pmax)pe=se[ge+1];else if(fe<ue.pmin)break}return(fe-pe)/ye}}}if(M.rangemode!=="match"){var G=P.r2l(M.range[0]),J=P.r2l(M.range[1]),oe=J-G;I.d2pOppAxis=function(fe){return(fe-G)/oe*I._height}}O.call(m,T,z,I).call(y,T,z,I).call(b,T,z,I).call(g,T,z,I,M).call(x,T,z,I).call(_,T,z,I),h(O,T,z,I),p(O,T,z,I,P,M),z.side==="bottom"&&l.draw(T,z._id+"title",{propContainer:z,propName:z._name+".title",placeholder:k._dfltTitle.x,attributes:{x:z._offset+z._length/2,y:X+I._height+I._offsetShift+10+1.5*z.title.font.size,"text-anchor":"middle"}})}))};function h(T,k,S,L){if(k._context.staticPlot)return;var D=T.select("rect."+u.slideBoxClassName).node(),$=T.select("rect."+u.grabAreaMinClassName).node(),E=T.select("rect."+u.grabAreaMaxClassName).node();function z(){var O=t.event,I=O.target,P=O.clientX||O.touches[0].clientX,M=P-T.node().getBoundingClientRect().left,A=L.d2p(S._rl[0]),C=L.d2p(S._rl[1]),R=c.coverSlip();this.addEventListener("touchmove",N),this.addEventListener("touchend",H),R.addEventListener("mousemove",N),R.addEventListener("mouseup",H);function N(B){var X=B.clientX||B.touches[0].clientX,j=+X-P,q,U,Z;switch(I){case D:if(Z="ew-resize",A+j>S._length||C+j<0)return;q=A+j,U=C+j;break;case $:if(Z="col-resize",A+j>S._length)return;q=A+j,U=C;break;case E:if(Z="col-resize",C+j<0)return;q=A,U=C+j;break;default:Z="ew-resize",q=M,U=M+j;break}if(U<q){var K=U;U=q,q=K}L._pixelMin=q,L._pixelMax=U,v(t.select(R),Z),d(T,k,S,L)}function H(){R.removeEventListener("mousemove",N),R.removeEventListener("mouseup",H),this.removeEventListener("touchmove",N),this.removeEventListener("touchend",H),a.removeElement(R)}}T.on("mousedown",z),T.on("touchstart",z)}function d(T,k,S,L){function D(z){return S.l2r(a.constrain(z,L._rl[0],L._rl[1]))}var $=D(L.p2d(L._pixelMin)),E=D(L.p2d(L._pixelMax));window.requestAnimationFrame(function(){e.call("_guiRelayout",k,S._name+".range",[$,E])})}function p(T,k,S,L,D,$){var E=u.handleWidth/2;function z(B){return a.constrain(B,0,L._width)}function O(B){return a.constrain(B,0,L._height)}function I(B){return a.constrain(B,-E,L._width+E)}var P=z(L.d2p(S._rl[0])),M=z(L.d2p(S._rl[1]));if(T.select("rect."+u.slideBoxClassName).attr("x",P).attr("width",M-P),T.select("rect."+u.maskMinClassName).attr("width",P),T.select("rect."+u.maskMaxClassName).attr("x",M).attr("width",L._width-M),$.rangemode!=="match"){var A=L._height-O(L.d2pOppAxis(D._rl[1])),C=L._height-O(L.d2pOppAxis(D._rl[0]));T.select("rect."+u.maskMinOppAxisClassName).attr("x",P).attr("height",A).attr("width",M-P),T.select("rect."+u.maskMaxOppAxisClassName).attr("x",P).attr("y",C).attr("height",L._height-C).attr("width",M-P),T.select("rect."+u.slideBoxClassName).attr("y",A).attr("height",C-A)}var R=.5,N=Math.round(I(P-E))-R,H=Math.round(I(M-E))+R;T.select("g."+u.grabberMinClassName).attr("transform",i(N,R)),T.select("g."+u.grabberMaxClassName).attr("transform",i(H,R))}function m(T,k,S,L){var D=a.ensureSingle(T,"rect",u.bgClassName,function(O){O.attr({x:0,y:0,"shape-rendering":"crispEdges"})}),$=L.borderwidth%2===0?L.borderwidth:L.borderwidth-1,E=-L._offsetShift,z=n.crispRound(k,L.borderwidth);D.attr({width:L._width+$,height:L._height+$,transform:i(E,E),"stroke-width":z}).call(o.stroke,L.bordercolor).call(o.fill,L.bgcolor)}function y(T,k,S,L){var D=k._fullLayout,$=a.ensureSingleById(D._topdefs,"clipPath",L._clipId,function(E){E.append("rect").attr({x:0,y:0})});$.select("rect").attr({width:L._width,height:L._height})}function b(T,k,S,L){var D=k.calcdata,$=T.selectAll("g."+u.rangePlotClassName).data(S._subplotsWith,a.identity);$.enter().append("g").attr("class",function(z){return u.rangePlotClassName+" "+z}).call(n.setClipUrl,L._clipId,k),$.order(),$.exit().remove();var E;$.each(function(z,O){var I=t.select(this),P=O===0,M=f.getFromId(k,z,"y"),A=M._name,C=L[A],R={data:[],layout:{xaxis:{type:S.type,domain:[0,1],range:L.range.slice(),calendar:S.calendar},width:L._width,height:L._height,margin:{t:0,b:0,l:0,r:0}},_context:k._context};S.rangebreaks&&(R.layout.xaxis.rangebreaks=S.rangebreaks),R.layout[A]={type:M.type,domain:[0,1],range:C.rangemode!=="match"?C.range.slice():M.range.slice(),calendar:M.calendar},M.rangebreaks&&(R.layout[A].rangebreaks=M.rangebreaks),r.supplyDefaults(R);var N=R._fullLayout.xaxis,H=R._fullLayout[A];N.clearCalc(),N.setScale(),H.clearCalc(),H.setScale();var B={id:z,plotgroup:I,xaxis:N,yaxis:H,isRangePlot:!0};P?E=B:(B.mainplot="xy",B.mainplotinfo=E),s.rangePlot(k,B,w(D,z))})}function w(T,k){for(var S=[],L=0;L<T.length;L++){var D=T[L],$=D[0].trace;$.xaxis+$.yaxis===k&&S.push(D)}return S}function g(T,k,S,L,D){var $=a.ensureSingle(T,"rect",u.maskMinClassName,function(I){I.attr({x:0,y:0,"shape-rendering":"crispEdges"})});$.attr("height",L._height).call(o.fill,u.maskColor);var E=a.ensureSingle(T,"rect",u.maskMaxClassName,function(I){I.attr({y:0,"shape-rendering":"crispEdges"})});if(E.attr("height",L._height).call(o.fill,u.maskColor),D.rangemode!=="match"){var z=a.ensureSingle(T,"rect",u.maskMinOppAxisClassName,function(I){I.attr({y:0,"shape-rendering":"crispEdges"})});z.attr("width",L._width).call(o.fill,u.maskOppAxisColor);var O=a.ensureSingle(T,"rect",u.maskMaxOppAxisClassName,function(I){I.attr({y:0,"shape-rendering":"crispEdges"})});O.attr("width",L._width).style("border-top",u.maskOppBorder).call(o.fill,u.maskOppAxisColor)}}function x(T,k,S,L){if(!k._context.staticPlot){var D=a.ensureSingle(T,"rect",u.slideBoxClassName,function($){$.attr({y:0,cursor:u.slideBoxCursor,"shape-rendering":"crispEdges"})});D.attr({height:L._height,fill:u.slideBoxFill})}}function _(T,k,S,L){var D=a.ensureSingle(T,"g",u.grabberMinClassName),$=a.ensureSingle(T,"g",u.grabberMaxClassName),E={x:0,width:u.handleWidth,rx:u.handleRadius,fill:o.background,stroke:o.defaultLine,"stroke-width":u.handleStrokeWidth,"shape-rendering":"crispEdges"},z={y:Math.round(L._height/4),height:Math.round(L._height/2)},O=a.ensureSingle(D,"rect",u.handleMinClassName,function(C){C.attr(E)});O.attr(z);var I=a.ensureSingle($,"rect",u.handleMaxClassName,function(C){C.attr(E)});I.attr(z);var P={width:u.grabAreaWidth,x:0,y:0,fill:u.grabAreaFill,cursor:k._context.staticPlot?void 0:u.grabAreaCursor},M=a.ensureSingle(D,"rect",u.grabAreaMinClassName,function(C){C.attr(P)});M.attr("height",L._height);var A=a.ensureSingle($,"rect",u.grabAreaMaxClassName,function(C){C.attr(P)});A.attr("height",L._height)}return Gv}var LN=me,CN=em,DN=Tk,Uv=cu,$N={moduleType:"component",name:"rangeslider",schema:{subplots:{xaxis:{rangeslider:LN.extendFlat({},CN,{yaxis:DN})}}},layoutAttributes:em,handleDefaults:AN(),calcAutorange:MN(),draw:SN(),isVisible:Uv.isVisible,makeData:Uv.makeData,autoMarginOpts:Uv.autoMarginOpts},PN=Mr,Nb=zr,RN=Ht.templatedArray,EN=RN("button",{visible:{valType:"boolean",dflt:!0,editType:"plot",description:"Determines whether or not this button is visible."},step:{valType:"enumerated",values:["month","year","day","hour","minute","second","all"],dflt:"month",editType:"plot",description:["The unit of measurement that the `count` value will set the range by."].join(" ")},stepmode:{valType:"enumerated",values:["backward","todate"],dflt:"backward",editType:"plot",description:["Sets the range update mode.","If *backward*, the range update shifts the start of range","back *count* times *step* milliseconds.","If *todate*, the range update shifts the start of range","back to the first timestamp from *count* times","*step* milliseconds back.","For example, with `step` set to *year* and `count` set to *1*","the range update shifts the start of the range back to","January 01 of the current year.","Month and year *todate* are currently available only","for the built-in (Gregorian) calendar."].join(" ")},count:{valType:"number",min:0,dflt:1,editType:"plot",description:["Sets the number of steps to take to update the range.","Use with `step` to specify the update interval."].join(" ")},label:{valType:"string",editType:"plot",description:"Sets the text label to appear on the button."},editType:"plot",description:["Sets the specifications for each buttons.","By default, a range selector comes with no buttons."].join(" ")}),uh={visible:{valType:"boolean",editType:"plot",description:["Determines whether or not this range selector is visible.","Note that range selectors are only available for x axes of","`type` set to or auto-typed to *date*."].join(" ")},buttons:EN,x:{valType:"number",min:-2,max:3,editType:"plot",description:"Sets the x position (in normalized coordinates) of the range selector."},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left",editType:"plot",description:["Sets the range selector's horizontal position anchor.","This anchor binds the `x` position to the *left*, *center*","or *right* of the range selector."].join(" ")},y:{valType:"number",min:-2,max:3,editType:"plot",description:"Sets the y position (in normalized coordinates) of the range selector."},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"bottom",editType:"plot",description:["Sets the range selector's vertical position anchor","This anchor binds the `y` position to the *top*, *middle*","or *bottom* of the range selector."].join(" ")},font:PN({editType:"plot",description:"Sets the font of the range selector button text."}),bgcolor:{valType:"color",dflt:Nb.lightLine,editType:"plot",description:"Sets the background color of the range selector buttons."},activecolor:{valType:"color",editType:"plot",description:"Sets the background color of the active range selector button."},bordercolor:{valType:"color",dflt:Nb.defaultLine,editType:"plot",description:"Sets the color of the border enclosing the range selector."},borderwidth:{valType:"number",min:0,dflt:0,editType:"plot",description:"Sets the width (in px) of the border enclosing the range selector."},editType:"plot"},Mk={yPad:.02,minButtonWidth:30,rx:3,ry:3,lightAmount:25,darkAmount:10},Rf=me,zN=ht,IN=Ht,FN=Ka,Sk=uh,vh=Mk,NN=function(e,r,a,i,n){var o=e.rangeselector||{},l=IN.newContainer(r,"rangeselector");function s(h,d){return Rf.coerce(o,l,Sk,h,d)}var f=FN(o,l,{name:"buttons",handleItemDefaults:HN,calendar:n}),c=s("visible",f.length>0);if(c){var v=ON(r,a,i);s("x",v[0]),s("y",v[1]),Rf.noneOrAll(e,r,["x","y"]),s("xanchor"),s("yanchor"),Rf.coerceFont(s,"font",a.font);var u=s("bgcolor");s("activecolor",zN.contrast(u,vh.lightAmount,vh.darkAmount)),s("bordercolor"),s("borderwidth")}};function HN(t,e,r,a){var i=a.calendar;function n(s,f){return Rf.coerce(t,e,Sk.buttons,s,f)}var o=n("visible");if(o){var l=n("step");l!=="all"&&(i&&i!=="gregorian"&&(l==="month"||l==="year")?e.stepmode="backward":n("stepmode"),n("count")),n("label")}}function ON(t,e,r){for(var a=r.filter(function(l){return e[l].anchor===t._id}),i=0,n=0;n<a.length;n++){var o=e[a[n]].domain;o&&(i=Math.max(o[1],i))}return[t.domain[0],i+vh.yPad]}var jN=pM,BN=me.titleCase,GN=function(e,r){var a=e._name,i={};if(r.step==="all")i[a+".autorange"]=!0;else{var n=UN(e,r);i[a+".range[0]"]=n[0],i[a+".range[1]"]=n[1]}return i};function UN(t,e){var r=t.range,a=new Date(t.r2l(r[1])),i=e.step,n=jN["utc"+BN(i)],o=e.count,l;switch(e.stepmode){case"backward":l=t.l2r(+n.offset(a,-o));break;case"todate":var s=n.offset(a,-o);l=t.l2r(+n.ceil(s));break}var f=r[1];return[l,f]}var dc=gt,VN=ot,XN=cr,Hb=ht,Lk=$t,li=me,Ob=li.strTranslate,Ef=br,YN=lr,rm=Ur,jb=rm.LINE_SPACING,Bb=rm.FROM_TL,Gb=rm.FROM_BR,dh=Mk,WN=GN,qN=function(e){var r=e._fullLayout,a=r._infolayer.selectAll(".rangeselector").data(ZN(e),KN);a.enter().append("g").classed("rangeselector",!0),a.exit().remove(),a.style({cursor:"pointer","pointer-events":"all"}),a.each(function(i){var n=dc.select(this),o=i,l=o.rangeselector,s=n.selectAll("g.button").data(li.filterVisible(l.buttons));s.enter().append("g").classed("button",!0),s.exit().remove(),s.each(function(f){var c=dc.select(this),v=WN(o,f);f._isActive=QN(o,f,v),c.call(Vv,l,f),c.call(e4,l,f,e),c.on("click",function(){e._dragged||VN.call("_guiRelayout",e,v)}),c.on("mouseover",function(){f._isHovered=!0,c.call(Vv,l,f)}),c.on("mouseout",function(){f._isHovered=!1,c.call(Vv,l,f)})}),r4(e,s,l,o._name,n)})};function ZN(t){for(var e=YN.list(t,"x",!0),r=[],a=0;a<e.length;a++){var i=e[a];i.rangeselector&&i.rangeselector.visible&&r.push(i)}return r}function KN(t){return t._id}function QN(t,e,r){if(e.step==="all")return t.autorange===!0;var a=Object.keys(r);return t.range[0]===r[a[0]]&&t.range[1]===r[a[1]]}function Vv(t,e,r){var a=li.ensureSingle(t,"rect","selector-rect",function(i){i.attr("shape-rendering","crispEdges")});a.attr({rx:dh.rx,ry:dh.ry}),a.call(Hb.stroke,e.bordercolor).call(Hb.fill,JN(e,r)).style("stroke-width",e.borderwidth+"px")}function JN(t,e){return e._isActive||e._isHovered?t.activecolor:t.bgcolor}function e4(t,e,r,a){function i(o){Ef.convertToTspans(o,a)}var n=li.ensureSingle(t,"text","selector-text",function(o){o.attr("text-anchor","middle")});n.call(Lk.font,e.font).text(t4(r,a._fullLayout._meta)).call(i)}function t4(t,e){return t.label?e?li.templateString(t.label,e):t.label:t.step==="all"?"all":t.count+t.step.charAt(0)}function r4(t,e,r,a,i){var n=0,o=0,l=r.borderwidth;e.each(function(){var h=dc.select(this),d=h.select(".selector-text"),p=r.font.size*jb,m=Math.max(p*Ef.lineCount(d),16)+3;o=Math.max(o,m)}),e.each(function(){var h=dc.select(this),d=h.select(".selector-rect"),p=h.select(".selector-text"),m=p.node()&&Lk.bBox(p.node()).width,y=r.font.size*jb,b=Ef.lineCount(p),w=Math.max(m+10,dh.minButtonWidth);h.attr("transform",Ob(l+n,l)),d.attr({x:0,y:0,width:w,height:o}),Ef.positionText(p,w/2,o/2-(b-1)*y/2+3),n+=w+5});var s=t._fullLayout._size,f=s.l+s.w*r.x,c=s.t+s.h*(1-r.y),v="left";li.isRightAnchor(r)&&(f-=n,v="right"),li.isCenterAnchor(r)&&(f-=n/2,v="center");var u="top";li.isBottomAnchor(r)&&(c-=o,u="bottom"),li.isMiddleAnchor(r)&&(c-=o/2,u="middle"),n=Math.ceil(n),o=Math.ceil(o),f=Math.round(f),c=Math.round(c),XN.autoMargin(t,a+"-range-selector",{x:r.x,y:r.y,l:n*Bb[v],r:n*Gb[v],b:o*Gb[u],t:o*Bb[u]}),i.attr("transform",Ob(f,c))}var a4={moduleType:"component",name:"rangeselector",schema:{subplots:{xaxis:{rangeselector:uh}}},layoutAttributes:uh,handleDefaults:NN,draw:qN},Vi={},Ub=Qt.extendFlat;Vi.attributes=function(t,e){t=t||{},e=e||{};var r={valType:"info_array",editType:t.editType,items:[{valType:"number",min:0,max:1,editType:t.editType},{valType:"number",min:0,max:1,editType:t.editType}],dflt:[0,1]},a=t.name?t.name+" ":"",i=t.trace?"trace ":"subplot ",n=e.description?" "+e.description:"",o={x:Ub({},r,{description:["Sets the horizontal domain of this ",a,i,"(in plot fraction).",n].join("")}),y:Ub({},r,{description:["Sets the vertical domain of this ",a,i,"(in plot fraction).",n].join("")}),editType:t.editType};return t.noGridCell||(o.row={valType:"integer",min:0,dflt:0,editType:t.editType,description:["If there is a layout grid, use the domain ","for this row in the grid for this ",a,i,".",n].join("")},o.column={valType:"integer",min:0,dflt:0,editType:t.editType,description:["If there is a layout grid, use the domain ","for this column in the grid for this ",a,i,".",n].join("")}),o};Vi.defaults=function(t,e,r,a){var i=a&&a.x||[0,1],n=a&&a.y||[0,1],o=e.grid;if(o){var l=r("domain.column");l!==void 0&&(l<o.columns?i=o._domains.x[l]:delete t.domain.column);var s=r("domain.row");s!==void 0&&(s<o.rows?n=o._domains.y[s]:delete t.domain.row)}var f=r("domain.x",i),c=r("domain.y",n);f[0]<f[1]||(t.domain.x=i.slice()),c[0]<c[1]||(t.domain.y=n.slice())};var i4=me,n4=zo.counter,o4=Vi.attributes,Vb=Gr.idRegex,l4=Ht,hh={rows:{valType:"integer",min:1,editType:"plot",description:["The number of rows in the grid. If you provide a 2D `subplots`","array or a `yaxes` array, its length is used as the default.","But it's also possible to have a different length, if you","want to leave a row at the end for non-cartesian subplots."].join(" ")},roworder:{valType:"enumerated",values:["top to bottom","bottom to top"],dflt:"top to bottom",editType:"plot",description:["Is the first row the top or the bottom? Note that columns","are always enumerated from left to right."].join(" ")},columns:{valType:"integer",min:1,editType:"plot",description:["The number of columns in the grid. If you provide a 2D `subplots`","array, the length of its longest row is used as the default.","If you give an `xaxes` array, its length is used as the default.","But it's also possible to have a different length, if you","want to leave a row at the end for non-cartesian subplots."].join(" ")},subplots:{valType:"info_array",freeLength:!0,dimensions:2,items:{valType:"enumerated",values:[n4("xy").toString(),""],editType:"plot"},editType:"plot",description:["Used for freeform grids, where some axes may be shared across subplots","but others are not. Each entry should be a cartesian subplot id, like","*xy* or *x3y2*, or ** to leave that cell empty. You may reuse x axes","within the same column, and y axes within the same row.","Non-cartesian subplots and traces that support `domain` can place themselves","in this grid separately using the `gridcell` attribute."].join(" ")},xaxes:{valType:"info_array",freeLength:!0,items:{valType:"enumerated",values:[Vb.x.toString(),""],editType:"plot"},editType:"plot",description:["Used with `yaxes` when the x and y axes are shared across columns and rows.","Each entry should be an x axis id like *x*, *x2*, etc., or ** to","not put an x axis in that column. Entries other than ** must be unique.","Ignored if `subplots` is present. If missing but `yaxes` is present,","will generate consecutive IDs."].join(" ")},yaxes:{valType:"info_array",freeLength:!0,items:{valType:"enumerated",values:[Vb.y.toString(),""],editType:"plot"},editType:"plot",description:["Used with `yaxes` when the x and y axes are shared across columns and rows.","Each entry should be an y axis id like *y*, *y2*, etc., or ** to","not put a y axis in that row. Entries other than ** must be unique.","Ignored if `subplots` is present. If missing but `xaxes` is present,","will generate consecutive IDs."].join(" ")},pattern:{valType:"enumerated",values:["independent","coupled"],dflt:"coupled",editType:"plot",description:["If no `subplots`, `xaxes`, or `yaxes` are given but we do have `rows` and `columns`,","we can generate defaults using consecutive axis IDs, in two ways:","*coupled* gives one x axis per column and one y axis per row.","*independent* uses a new xy pair for each cell, left-to-right across each row","then iterating rows according to `roworder`."].join(" ")},xgap:{valType:"number",min:0,max:1,editType:"plot",description:["Horizontal space between grid cells, expressed as a fraction","of the total width available to one cell. Defaults to 0.1","for coupled-axes grids and 0.2 for independent grids."].join(" ")},ygap:{valType:"number",min:0,max:1,editType:"plot",description:["Vertical space between grid cells, expressed as a fraction","of the total height available to one cell. Defaults to 0.1","for coupled-axes grids and 0.3 for independent grids."].join(" ")},domain:o4({name:"grid",editType:"plot",noGridCell:!0},{description:["The first and last cells end exactly at the domain","edges, with no grout around the edges."].join(" ")}),xside:{valType:"enumerated",values:["bottom","bottom plot","top plot","top"],dflt:"bottom plot",editType:"plot",description:["Sets where the x axis labels and titles go. *bottom* means","the very bottom of the grid. *bottom plot* is the lowest plot","that each x axis is used in. *top* and *top plot* are similar."].join(" ")},yside:{valType:"enumerated",values:["left","left plot","right plot","right"],dflt:"left plot",editType:"plot",description:["Sets where the y axis labels and titles go. *left* means","the very left edge of the grid. *left plot* is the leftmost plot","that each y axis is used in. *right* and *right plot* are similar."].join(" ")},editType:"plot"};function hc(t,e,r){var a=e[r+"axes"],i=Object.keys((t._splomAxes||{})[r]||{});if(Array.isArray(a))return a;if(i.length)return i}function s4(t,e){var r=t.grid||{},a=hc(e,r,"x"),i=hc(e,r,"y");if(!t.grid&&!a&&!i)return;var n=Array.isArray(r.subplots)&&Array.isArray(r.subplots[0]),o=Array.isArray(a),l=Array.isArray(i),s=o&&a!==r.xaxes&&l&&i!==r.yaxes,f,c;n?(f=r.subplots.length,c=r.subplots[0].length):(l&&(f=i.length),o&&(c=a.length));var v=l4.newContainer(e,"grid");function u(_,T){return i4.coerce(r,v,hh,_,T)}var h=u("rows",f),d=u("columns",c);if(!(h*d>1)){delete e.grid;return}if(!n&&!o&&!l){var p=u("pattern")==="independent";p&&(n=!0)}v._hasSubplotGrid=n;var m=u("roworder"),y=m==="top to bottom",b=n?.2:.1,w=n?.3:.1,g,x;s&&e._splomGridDflt&&(g=e._splomGridDflt.xside,x=e._splomGridDflt.yside),v._domains={x:Xb("x",u,b,g,d),y:Xb("y",u,w,x,h,y)}}function Xb(t,e,r,a,i,n){var o=e(t+"gap",r),l=e("domain."+t);e(t+"side",a);for(var s=new Array(i),f=l[0],c=(l[1]-f)/(i-o),v=c*(1-o),u=0;u<i;u++){var h=f+c*u;s[n?i-1-u:u]=[h,h+v]}return s}function f4(t,e){var r=e.grid;if(!(!r||!r._domains)){var a=t.grid||{},i=e._subplots,n=r._hasSubplotGrid,o=r.rows,l=r.columns,s=r.pattern==="independent",f,c,v,u,h,d,p,m=r._axisMap={};if(n){var y=a.subplots||[];d=r.subplots=new Array(o);var b=1;for(f=0;f<o;f++){var w=d[f]=new Array(l),g=y[f]||[];for(c=0;c<l;c++)if(s?(h=b===1?"xy":"x"+b+"y"+b,b++):h=g[c],w[c]="",i.cartesian.indexOf(h)!==-1){if(p=h.indexOf("y"),v=h.slice(0,p),u=h.slice(p),m[v]!==void 0&&m[v]!==c||m[u]!==void 0&&m[u]!==f)continue;w[c]=h,m[v]=c,m[u]=f}}}else{var x=hc(e,a,"x"),_=hc(e,a,"y");r.xaxes=Yb(x,i.xaxis,l,m,"x"),r.yaxes=Yb(_,i.yaxis,o,m,"y")}var T=r._anchors={},k=r.roworder==="top to bottom";for(var S in m){var L=S.charAt(0),D=r[L+"side"],$,E,z;if(D.length<8)T[S]="free";else if(L==="x"){if(D.charAt(0)==="t"===k?($=0,E=1,z=o):($=o-1,E=-1,z=-1),n){var O=m[S];for(f=$;f!==z;f+=E)if(h=d[f][O],!!h&&(p=h.indexOf("y"),h.slice(0,p)===S)){T[S]=h.slice(p);break}}else for(f=$;f!==z;f+=E)if(u=r.yaxes[f],i.cartesian.indexOf(S+u)!==-1){T[S]=u;break}}else if(D.charAt(0)==="l"?($=0,E=1,z=l):($=l-1,E=-1,z=-1),n){var I=m[S];for(f=$;f!==z;f+=E)if(h=d[I][f],!!h&&(p=h.indexOf("y"),h.slice(p)===S)){T[S]=h.slice(0,p);break}}else for(f=$;f!==z;f+=E)if(v=r.xaxes[f],i.cartesian.indexOf(v+S)!==-1){T[S]=v;break}}}}function Yb(t,e,r,a,i){var n=new Array(r),o;function l(s,f){e.indexOf(f)!==-1&&a[f]===void 0?(n[s]=f,a[f]=s):n[s]=""}if(Array.isArray(t))for(o=0;o<r;o++)l(o,t[o]);else for(l(0,i),o=1;o<r;o++)l(o,i+(o+1));return n}var c4={moduleType:"component",name:"grid",schema:{layout:{grid:hh}},layoutAttributes:hh,sizeDefaults:s4,contentDefaults:f4},Ck={visible:{valType:"boolean",editType:"calc",description:["Determines whether or not this set of error bars is visible."].join(" ")},type:{valType:"enumerated",values:["percent","constant","sqrt","data"],editType:"calc",description:["Determines the rule used to generate the error bars.","If *constant`, the bar lengths are of a constant value.","Set this constant in `value`.","If *percent*, the bar lengths correspond to a percentage of","underlying data. Set this percentage in `value`.","If *sqrt*, the bar lengths correspond to the square of the","underlying data.","If *data*, the bar lengths are set with data set `array`."].join(" ")},symmetric:{valType:"boolean",editType:"calc",description:["Determines whether or not the error bars have the same length","in both direction","(top/bottom for vertical bars, left/right for horizontal bars."].join(" ")},array:{valType:"data_array",editType:"calc",description:["Sets the data corresponding the length of each error bar.","Values are plotted relative to the underlying data."].join(" ")},arrayminus:{valType:"data_array",editType:"calc",description:["Sets the data corresponding the length of each error bar in the","bottom (left) direction for vertical (horizontal) bars","Values are plotted relative to the underlying data."].join(" ")},value:{valType:"number",min:0,dflt:10,editType:"calc",description:["Sets the value of either the percentage","(if `type` is set to *percent*) or the constant","(if `type` is set to *constant*) corresponding to the lengths of","the error bars."].join(" ")},valueminus:{valType:"number",min:0,dflt:10,editType:"calc",description:["Sets the value of either the percentage","(if `type` is set to *percent*) or the constant","(if `type` is set to *constant*) corresponding to the lengths of","the error bars in the","bottom (left) direction for vertical (horizontal) bars"].join(" ")},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",description:"Sets the stoke color of the error bars."},thickness:{valType:"number",min:0,dflt:2,editType:"style",description:"Sets the thickness (in px) of the error bars."},width:{valType:"number",min:0,editType:"plot",description:["Sets the width (in px) of the cross-bar at both ends","of the error bars."].join(" ")},editType:"calc",_deprecated:{opacity:{valType:"number",editType:"style",description:["Obsolete.","Use the alpha channel in error bar `color` to set the opacity."].join(" ")}}},Xv,Wb;function u4(){if(Wb)return Xv;Wb=1;var t=wt,e=ot,r=me,a=Ht,i=Ck;return Xv=function(n,o,l,s){var f="error_"+s.axis,c=a.newContainer(o,f),v=n[f]||{};function u(w,g){return r.coerce(v,c,i,w,g)}var h=v.array!==void 0||v.value!==void 0||v.type==="sqrt",d=u("visible",h);if(d!==!1){var p=u("type","array"in v?"data":"percent"),m=!0;p!=="sqrt"&&(m=u("symmetric",!((p==="data"?"arrayminus":"valueminus")in v))),p==="data"?(u("array"),u("traceref"),m||(u("arrayminus"),u("tracerefminus"))):(p==="percent"||p==="constant")&&(u("value"),m||u("valueminus"));var y="copy_"+s.inherit+"style";if(s.inherit){var b=o["error_"+s.inherit];(b||{}).visible&&u(y,!(v.color||t(v.thickness)||t(v.width)))}(!s.inherit||!c[y])&&(u("color",l),u("thickness"),u("width",e.traceIs(o,"gl3d")?0:4))}},Xv}var Yv,qb;function Dk(){if(qb)return Yv;qb=1,Yv=function(r){var a=r.type,i=r.symmetric;if(a==="data"){var n=r.array||[];if(i)return function(c,v){var u=+n[v];return[u,u]};var o=r.arrayminus||[];return function(c,v){var u=+n[v],h=+o[v];return!isNaN(u)||!isNaN(h)?[h||0,u||0]:[NaN,NaN]}}else{var l=t(a,r.value),s=t(a,r.valueminus);return i||r.valueminus===void 0?function(c){var v=l(c);return[v,v]}:function(c){return[s(c),l(c)]}}};function t(e,r){if(e==="percent")return function(a){return Math.abs(a*r/100)};if(e==="constant")return function(){return Math.abs(r)};if(e==="sqrt")return function(a){return Math.sqrt(Math.abs(a))}}return Yv}var Wv,Zb;function v4(){if(Zb)return Wv;Zb=1;var t=wt,e=ot,r=Bt,a=me,i=Dk();Wv=function(l){for(var s=l.calcdata,f=0;f<s.length;f++){var c=s[f],v=c[0].trace;if(v.visible===!0&&e.traceIs(v,"errorBarsOK")){var u=r.getFromId(l,v.xaxis),h=r.getFromId(l,v.yaxis);n(c,v,u,"x"),n(c,v,h,"y")}}};function n(o,l,s,f){var c=l["error_"+f]||{},v=c.visible&&["linear","log"].indexOf(s.type)!==-1,u=[];if(v){for(var h=i(c),d=0;d<o.length;d++){var p=o[d],m=p.i;if(m===void 0)m=d;else if(m===null)continue;var y=p[f];if(t(s.c2l(y))){var b=h(y,m);if(t(b[0])&&t(b[1])){var w=p[f+"s"]=y-b[0],g=p[f+"h"]=y+b[1];u.push(w,g)}}}var x=s._id,_=l._extremes[x],T=r.findExtremes(s,u,a.extendFlat({tozero:_.opts.tozero},{padded:!0}));_.min=_.min.concat(T.min),_.max=_.max.concat(T.max)}}return Wv}var qv,Kb;function d4(){if(Kb)return qv;Kb=1;var t=gt,e=wt,r=$t,a=Ir;qv=function(o,l,s,f){var c,v=s.xaxis,u=s.yaxis,h=f&&f.duration>0,d=o._context.staticPlot;l.each(function(p){var m=p[0].trace,y=m.error_x||{},b=m.error_y||{},w;m.ids&&(w=function(T){return T.id});var g=a.hasMarkers(m)&&m.marker.maxdisplayed>0;!b.visible&&!y.visible&&(p=[]);var x=t.select(this).selectAll("g.errorbar").data(p,w);if(x.exit().remove(),!!p.length){y.visible||x.selectAll("path.xerror").remove(),b.visible||x.selectAll("path.yerror").remove(),x.style("opacity",1);var _=x.enter().append("g").classed("errorbar",!0);h&&_.style("opacity",0).transition().duration(f.duration).style("opacity",1),r.setClipUrl(x,s.layerClipId,o),x.each(function(T){var k=t.select(this),S=i(T,v,u);if(!(g&&!T.vis)){var L,D=k.select("path.yerror");if(b.visible&&e(S.x)&&e(S.yh)&&e(S.ys)){var $=b.width;L="M"+(S.x-$)+","+S.yh+"h"+2*$+"m-"+$+",0V"+S.ys,S.noYS||(L+="m-"+$+",0h"+2*$),c=!D.size(),c?D=k.append("path").style("vector-effect",d?"none":"non-scaling-stroke").classed("yerror",!0):h&&(D=D.transition().duration(f.duration).ease(f.easing)),D.attr("d",L)}else D.remove();var E=k.select("path.xerror");if(y.visible&&e(S.y)&&e(S.xh)&&e(S.xs)){var z=(y.copy_ystyle?b:y).width;L="M"+S.xh+","+(S.y-z)+"v"+2*z+"m0,-"+z+"H"+S.xs,S.noXS||(L+="m0,-"+z+"v"+2*z),c=!E.size(),c?E=k.append("path").style("vector-effect",d?"none":"non-scaling-stroke").classed("xerror",!0):h&&(E=E.transition().duration(f.duration).ease(f.easing)),E.attr("d",L)}else E.remove()}})}})};function i(n,o,l){var s={x:o.c2p(n.x),y:l.c2p(n.y)};return n.yh!==void 0&&(s.yh=l.c2p(n.yh),s.ys=l.c2p(n.ys),e(s.ys)||(s.noYS=!0,s.ys=l.c2p(n.ys,!0))),n.xh!==void 0&&(s.xh=o.c2p(n.xh),s.xs=o.c2p(n.xs),e(s.xs)||(s.noXS=!0,s.xs=o.c2p(n.xs,!0))),s}return qv}var Zv,Qb;function h4(){if(Qb)return Zv;Qb=1;var t=gt,e=ht;return Zv=function(a){a.each(function(i){var n=i[0].trace,o=n.error_y||{},l=n.error_x||{},s=t.select(this);s.selectAll("path.yerror").style("stroke-width",o.thickness+"px").call(e.stroke,o.color),l.copy_ystyle&&(l=o),s.selectAll("path.xerror").style("stroke-width",l.thickness+"px").call(e.stroke,l.color)})},Zv}var Pl=me,Jb=Ya.overrideAll,Rl=Ck,fn={error_x:Pl.extendFlat({},Rl),error_y:Pl.extendFlat({},Rl)};delete fn.error_x.copy_zstyle;delete fn.error_y.copy_zstyle;delete fn.error_y.copy_ystyle;var ms={error_x:Pl.extendFlat({},Rl),error_y:Pl.extendFlat({},Rl),error_z:Pl.extendFlat({},Rl)};delete ms.error_x.copy_ystyle;delete ms.error_y.copy_ystyle;delete ms.error_z.copy_ystyle;delete ms.error_z.copy_zstyle;var p4={moduleType:"component",name:"errorbars",schema:{traces:{scatter:fn,bar:fn,histogram:fn,scatter3d:Jb(ms,"calc","nested"),scattergl:Jb(fn,"calc","nested")}},supplyDefaults:u4(),calc:v4(),makeComputeError:Dk(),plot:d4(),style:h4(),hoverInfo:m4};function m4(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))}var y4={cn:{colorbar:"colorbar",cbbg:"cbbg",cbfill:"cbfill",cbfills:"cbfills",cbline:"cbline",cblines:"cblines",cbaxis:"cbaxis",cbtitleunshift:"cbtitleunshift",cbtitle:"cbtitle",cboutline:"cboutline",crisp:"crisp",jsPlaceholder:"js-placeholder"}},wi=gt,Kv=ga,zf=cr,ex=ot,ti=Bt,of=Qa,pa=me,La=pa.strTranslate,$k=Qt.extendFlat,Qv=ji,Aa=$t,Jv=ht,g4=Hc,b4=br,x4=Na.flipScale,_4=B2,w4=G2,T4=Za,am=Ur,tx=am.LINE_SPACING,rx=am.FROM_TL,ax=am.FROM_BR,Kt=y4.cn;function k4(t){var e=t._fullLayout,r=e._infolayer.selectAll("g."+Kt.colorbar).data(A4(t),function(a){return a._id});r.enter().append("g").attr("class",function(a){return a._id}).classed(Kt.colorbar,!0),r.each(function(a){var i=wi.select(this);pa.ensureSingle(i,"rect",Kt.cbbg),pa.ensureSingle(i,"g",Kt.cbfills),pa.ensureSingle(i,"g",Kt.cblines),pa.ensureSingle(i,"g",Kt.cbaxis,function(o){o.classed(Kt.crisp,!0)}),pa.ensureSingle(i,"g",Kt.cbtitleunshift,function(o){o.append("g").classed(Kt.cbtitle,!0)}),pa.ensureSingle(i,"rect",Kt.cboutline);var n=M4(i,a,t);n&&n.then&&(t._promises||[]).push(n),t._context.edits.colorbarPosition&&S4(i,a,t)}),r.exit().each(function(a){zf.autoMargin(t,a._id)}).remove(),r.order()}function A4(t){var e=t._fullLayout,r=t.calcdata,a=[],i,n,o,l;function s(w){return $k(w,{_fillcolor:null,_line:{color:null,width:null,dash:null},_levels:{start:null,end:null,size:null},_filllevels:null,_fillgradient:null,_zrange:null})}function f(){typeof l.calc=="function"?l.calc(t,o,i):(i._fillgradient=n.reversescale?x4(n.colorscale):n.colorscale,i._zrange=[n[l.min],n[l.max]])}for(var c=0;c<r.length;c++){var v=r[c];if(o=v[0].trace,!!o._module){var u=o._module.colorbar;if(o.visible===!0&&u)for(var h=Array.isArray(u),d=h?u:[u],p=0;p<d.length;p++){l=d[p];var m=l.container;n=m?o[m]:o,n&&n.showscale&&(i=s(n.colorbar),i._id="cb"+o.uid+(h&&m?"-"+m:""),i._traceIndex=o.index,i._propPrefix=(m?m+".":"")+"colorbar.",i._meta=o._meta,f(),a.push(i))}}}for(var y in e._colorAxes)if(n=e[y],n.showscale){var b=e._colorAxes[y];i=s(n.colorbar),i._id="cb"+y,i._propPrefix=y+".colorbar.",i._meta=e._meta,l={min:"cmin",max:"cmax"},b[0]!=="heatmap"&&(o=b[1],l.calc=o._module.colorbar.calc),f(),a.push(i)}return a}function M4(t,e,r){var a=e.orientation==="v",i=e.len,n=e.lenmode,o=e.thickness,l=e.thicknessmode,s=e.outlinewidth,f=e.borderwidth,c=e.bgcolor,v=e.xanchor,u=e.yanchor,h=e.xpad,d=e.ypad,p=e.x,m=a?e.y:1-e.y,y=e.yref==="paper",b=e.xref==="paper",w=r._fullLayout,g=w._size,x=e._fillcolor,_=e._line,T=e.title,k=T.side,S=e._zrange||wi.extent((typeof x=="function"?x:_.color).domain()),L=typeof _.color=="function"?_.color:function(){return _.color},D=typeof x=="function"?x:function(){return x},$=e._levels,E=L4(r,e,S),z=E.fill,O=E.line,I=Math.round(o*(l==="fraction"?a?g.w:g.h:1)),P=I/(a?g.w:g.h),M=Math.round(i*(n==="fraction"?a?g.h:g.w:1)),A=M/(a?g.h:g.w),C=b?g.w:r._fullLayout.width,R=y?g.h:r._fullLayout.height,N=Math.round(a?p*C+h:m*R+d),H={center:.5,right:1}[v]||0,B={top:1,middle:.5}[u]||0,X=a?p-H*P:m-B*P,j=a?m-B*A:p-H*A,q=Math.round(a?R*(1-j):C*j);e._lenFrac=A,e._thickFrac=P,e._uFrac=X,e._vFrac=j;var U=e._axis=C4(r,e,S);U.position=P+(a?p+h/g.w:m+d/g.h);var Z=["top","bottom"].indexOf(k)!==-1;if(a&&Z&&(U.title.side=k,U.titlex=p+h/g.w,U.titley=j+(T.side==="top"?A-d/g.h:d/g.h)),!a&&!Z&&(U.title.side=k,U.titley=m+d/g.h,U.titlex=j+h/g.w),_.color&&e.tickmode==="auto"){U.tickmode="linear",U.tick0=$.start;var K=$.size,ee=pa.constrain(M/50,4,15)+1,le=(S[1]-S[0])/((e.nticks||ee)*K);if(le>1){var ye=Math.pow(10,Math.floor(Math.log(le)/Math.LN10));K*=ye*pa.roundUp(le/ye,[2,5,10]),(Math.abs($.start)/$.size+1e-6)%1<2e-6&&(U.tick0=0)}U.dtick=K}U.domain=a?[j+d/g.h,j+A-d/g.h]:[j+h/g.w,j+A-h/g.w],U.setScale(),t.attr("transform",La(Math.round(g.l),Math.round(g.t)));var se=t.select("."+Kt.cbtitleunshift).attr("transform",La(-Math.round(g.l),-Math.round(g.t))),G=U.ticklabelposition,J=U.title.font.size,oe=t.select("."+Kt.cbaxis),fe,pe=0,ge=0;function ue($e,te){var Te={propContainer:U,propName:e._propPrefix+"title",traceIndex:e._traceIndex,_meta:e._meta,placeholder:w._dfltTitle.colorbar,containerGroup:t.select("."+Kt.cbtitle)},ne=$e.charAt(0)==="h"?$e.substr(1):"h"+$e;t.selectAll("."+ne+",."+ne+"-math-group").remove(),g4.draw(r,$e,$k(Te,te||{}))}function Ce(){if(a&&Z||!a&&!Z){var $e,te;k==="top"&&($e=h+g.l+C*p,te=d+g.t+R*(1-j-A)+3+J*.75),k==="bottom"&&($e=h+g.l+C*p,te=d+g.t+R*(1-j)-3-J*.25),k==="right"&&(te=d+g.t+R*m+3+J*.75,$e=h+g.l+C*j),ue(U._id+"title",{attributes:{x:$e,y:te,"text-anchor":a?"start":"middle"}})}}function ce(){if(a&&!Z||!a&&Z){var $e=U.position||0,te=U._offset+U._length/2,Te,ne;if(k==="right")ne=te,Te=g.l+C*$e+10+J*(U.showticklabels?1:.5);else if(Te=te,k==="bottom"&&(ne=g.t+R*$e+10+(G.indexOf("inside")===-1?U.tickfont.size:0)+(U.ticks!=="intside"&&e.ticklen||0)),k==="top"){var de=T.text.split("<br>").length;ne=g.t+R*$e+10-I-tx*J*de}ue((a?"h":"v")+U._id+"title",{avoid:{selection:wi.select(r).selectAll("g."+U._id+"tick"),side:k,offsetTop:a?0:g.t,offsetLeft:a?g.l:0,maxShift:a?w.width:w.height},attributes:{x:Te,y:ne,"text-anchor":"middle"},transform:{rotate:a?-90:0,offset:0}})}}function De(){if(!a&&!Z||a&&Z){var $e=t.select("."+Kt.cbtitle),te=$e.select("text"),Te=[-s/2,s/2],ne=$e.select(".h"+U._id+"title-math-group").node(),de=15.6;te.node()&&(de=parseInt(te.node().style.fontSize,10)*tx);var he;if(ne?(he=Aa.bBox(ne),ge=he.width,pe=he.height,pe>de&&(Te[1]-=(pe-de)/2)):te.node()&&!te.classed(Kt.jsPlaceholder)&&(he=Aa.bBox(te.node()),ge=he.width,pe=he.height),a){if(pe){if(pe+=5,k==="top")U.domain[1]-=pe/g.h,Te[1]*=-1;else{U.domain[0]+=pe/g.h;var Ae=b4.lineCount(te);Te[1]+=(1-Ae)*de}$e.attr("transform",La(Te[0],Te[1])),U.setScale()}}else ge&&(k==="right"&&(U.domain[0]+=(ge+J/2)/g.w),$e.attr("transform",La(Te[0],Te[1])),U.setScale())}t.selectAll("."+Kt.cbfills+",."+Kt.cblines).attr("transform",a?La(0,Math.round(g.h*(1-U.domain[1]))):La(Math.round(g.w*U.domain[0]),0)),oe.attr("transform",a?La(0,Math.round(-g.t)):La(Math.round(-g.l),0));var Me=t.select("."+Kt.cbfills).selectAll("rect."+Kt.cbfill).attr("style","").data(z);Me.enter().append("rect").classed(Kt.cbfill,!0).attr("style",""),Me.exit().remove();var we=S.map(U.c2p).map(Math.round).sort(function(Ge,lt){return Ge-lt});Me.each(function(Ge,lt){var xe=[lt===0?S[0]:(z[lt]+z[lt-1])/2,lt===z.length-1?S[1]:(z[lt]+z[lt+1])/2].map(U.c2p).map(Math.round);a&&(xe[1]=pa.constrain(xe[1]+(xe[1]>xe[0])?1:-1,we[0],we[1]));var Ze=wi.select(this).attr(a?"x":"y",N).attr(a?"y":"x",wi.min(xe)).attr(a?"width":"height",Math.max(I,2)).attr(a?"height":"width",Math.max(wi.max(xe)-wi.min(xe),2));if(e._fillgradient)Aa.gradient(Ze,r,e._id,a?"vertical":"horizontalreversed",e._fillgradient,"fill");else{var Xe=D(Ge).replace("e-","");Ze.attr("fill",Kv(Xe).toHexString())}});var be=t.select("."+Kt.cblines).selectAll("path."+Kt.cbline).data(_.color&&_.width?O:[]);be.enter().append("path").classed(Kt.cbline,!0),be.exit().remove(),be.each(function(Ge){var lt=N,xe=Math.round(U.c2p(Ge))+_.width/2%1;wi.select(this).attr("d","M"+(a?lt+","+xe:xe+","+lt)+(a?"h":"v")+I).call(Aa.lineGroupStyle,_.width,L(Ge),_.dash)}),oe.selectAll("g."+U._id+"tick,path").remove();var Ve=N+I+(s||0)/2-(e.ticks==="outside"?1:0),Fe=ti.calcTicks(U),Oe=ti.getTickSigns(U)[2];return ti.drawTicks(r,U,{vals:U.ticks==="inside"?ti.clipEnds(U,Fe):Fe,layer:oe,path:ti.makeTickPath(U,Ve,Oe),transFn:ti.makeTransTickFn(U)}),ti.drawLabels(r,U,{vals:Fe,layer:oe,transFn:ti.makeTransTickLabelFn(U),labelFns:ti.makeLabelFns(U,Ve)})}function Ee(){var $e,te=I+s/2;G.indexOf("inside")===-1&&($e=Aa.bBox(oe.node()),te+=a?$e.width:$e.height),fe=se.select("text");var Te=0,ne=a&&k==="top",de=!a&&k==="right",he=0;if(fe.node()&&!fe.classed(Kt.jsPlaceholder)){var Ae,Me=se.select(".h"+U._id+"title-math-group").node();Me&&(a&&Z||!a&&!Z)?($e=Aa.bBox(Me),Te=$e.width,Ae=$e.height):($e=Aa.bBox(se.node()),Te=$e.right-g.l-(a?N:q),Ae=$e.bottom-g.t-(a?q:N),!a&&k==="top"&&(te+=$e.height,he=$e.height)),de&&(fe.attr("transform",La(Te/2+J/2,0)),Te*=2),te=Math.max(te,a?Te:Ae)}var we=(a?h:d)*2+te+f+s/2,be=0;!a&&T.text&&u==="bottom"&&m<=0&&(be=we/2,we+=be,he+=be),w._hColorbarMoveTitle=be,w._hColorbarMoveCBTitle=he;var Ve=f+s,Fe=(a?N:q)-Ve/2-(a?h:0),Oe=(a?q:N)-(a?M:d+he-be);t.select("."+Kt.cbbg).attr("x",Fe).attr("y",Oe).attr(a?"width":"height",Math.max(we-be,2)).attr(a?"height":"width",Math.max(M+Ve,2)).call(Jv.fill,c).call(Jv.stroke,e.bordercolor).style("stroke-width",f);var Ge=de?Math.max(Te-10,0):0;t.selectAll("."+Kt.cboutline).attr("x",(a?N:q+h)+Ge).attr("y",(a?q+d-M:N)+(ne?pe:0)).attr(a?"width":"height",Math.max(I,2)).attr(a?"height":"width",Math.max(M-(a?2*d+pe:2*h+Ge),2)).call(Jv.stroke,e.outlinecolor).style({fill:"none","stroke-width":s});var lt=a?H*we:0,xe=a?0:(1-B)*we-he;if(lt=b?g.l-lt:-lt,xe=y?g.t-xe:-xe,t.attr("transform",La(lt,xe)),!a&&(f||Kv(c).getAlpha()&&!Kv.equals(w.paper_bgcolor,c))){var Ze=oe.selectAll("text"),Xe=Ze[0].length,Ye=t.select("."+Kt.cbbg).node(),He=Aa.bBox(Ye),Ue=Aa.getTranslate(t),Je=2;Ze.each(function(Q,Le){var ze=0,Ne=Xe-1;if(Le===ze||Le===Ne){var tt=Aa.bBox(this),vt=Aa.getTranslate(this),st;if(Le===Ne){var at=tt.right+vt.x,Et=He.right+Ue.x+q-f-Je+p;st=Et-at,st>0&&(st=0)}else if(Le===ze){var pt=tt.left+vt.x,rt=He.left+Ue.x+q+f+Je;st=rt-pt,st<0&&(st=0)}st&&(Xe<3?this.setAttribute("transform","translate("+st+",0) "+this.getAttribute("transform")):this.setAttribute("visibility","hidden"))}})}var F={},W=rx[v],Y=ax[v],V=rx[u],ie=ax[u],re=we-I;a?(n==="pixels"?(F.y=m,F.t=M*V,F.b=M*ie):(F.t=F.b=0,F.yt=m+i*V,F.yb=m-i*ie),l==="pixels"?(F.x=p,F.l=we*W,F.r=we*Y):(F.l=re*W,F.r=re*Y,F.xl=p-o*W,F.xr=p+o*Y)):(n==="pixels"?(F.x=p,F.l=M*W,F.r=M*Y):(F.l=F.r=0,F.xl=p+i*W,F.xr=p-i*Y),l==="pixels"?(F.y=1-m,F.t=we*V,F.b=we*ie):(F.t=re*V,F.b=re*ie,F.yt=m-o*V,F.yb=m+o*ie));var ke=e.y<.5?"b":"t",_e=e.x<.5?"l":"r";r._fullLayout._reservedMargin[e._id]={};var ve={r:w.width-Fe-lt,l:Fe+F.r,b:w.height-Oe-xe,t:Oe+F.b};b&&y?zf.autoMargin(r,e._id,F):b?r._fullLayout._reservedMargin[e._id][ke]=ve[ke]:y||a?r._fullLayout._reservedMargin[e._id][_e]=ve[_e]:r._fullLayout._reservedMargin[e._id][ke]=ve[ke]}return pa.syncOrAsync([zf.previousPromises,Ce,De,ce,zf.previousPromises,Ee],r)}function S4(t,e,r){var a=e.orientation==="v",i=r._fullLayout,n=i._size,o,l,s;of.init({element:t.node(),gd:r,prepFn:function(){o=t.attr("transform"),Qv(t)},moveFn:function(f,c){t.attr("transform",o+La(f,c)),l=of.align((a?e._uFrac:e._vFrac)+f/n.w,a?e._thickFrac:e._lenFrac,0,1,e.xanchor),s=of.align((a?e._vFrac:1-e._uFrac)-c/n.h,a?e._lenFrac:e._thickFrac,0,1,e.yanchor);var v=of.getCursor(l,s,e.xanchor,e.yanchor);Qv(t,v)},doneFn:function(){if(Qv(t),l!==void 0&&s!==void 0){var f={};f[e._propPrefix+"x"]=l,f[e._propPrefix+"y"]=s,e._traceIndex!==void 0?ex.call("_guiRestyle",r,f,e._traceIndex):ex.call("_guiRelayout",r,f)}}})}function L4(t,e,r){var a=e._levels,i=[],n=[],o,l,s=a.end+a.size/100,f=a.size,c=1.001*r[0]-.001*r[1],v=1.001*r[1]-.001*r[0];for(l=0;l<1e5&&(o=a.start+l*f,!(f>0?o>=s:o<=s));l++)o>c&&o<v&&i.push(o);if(e._fillgradient)n=[0];else if(typeof e._fillcolor=="function"){var u=e._filllevels;if(u)for(s=u.end+u.size/100,f=u.size,l=0;l<1e5&&(o=u.start+l*f,!(f>0?o>=s:o<=s));l++)o>r[0]&&o<r[1]&&n.push(o);else n=i.map(function(h){return h-a.size/2}),n.push(n[n.length-1]+a.size)}else e._fillcolor&&typeof e._fillcolor=="string"&&(n=[0]);return a.size<0&&(i.reverse(),n.reverse()),{line:i,fill:n}}function C4(t,e,r){var a=t._fullLayout,i=e.orientation==="v",n={type:"linear",range:r,tickmode:e.tickmode,nticks:e.nticks,tick0:e.tick0,dtick:e.dtick,tickvals:e.tickvals,ticktext:e.ticktext,ticks:e.ticks,ticklen:e.ticklen,tickwidth:e.tickwidth,tickcolor:e.tickcolor,showticklabels:e.showticklabels,labelalias:e.labelalias,ticklabelposition:e.ticklabelposition,ticklabeloverflow:e.ticklabeloverflow,ticklabelstep:e.ticklabelstep,tickfont:e.tickfont,tickangle:e.tickangle,tickformat:e.tickformat,exponentformat:e.exponentformat,minexponent:e.minexponent,separatethousands:e.separatethousands,showexponent:e.showexponent,showtickprefix:e.showtickprefix,tickprefix:e.tickprefix,showticksuffix:e.showticksuffix,ticksuffix:e.ticksuffix,title:e.title,showline:!0,anchor:"free",side:i?"right":"bottom",position:1},o=i?"y":"x",l={type:"linear",_id:o+e._id},s={letter:o,font:a.font,noHover:!0,noTickson:!0,noTicklabelmode:!0,noInsideRange:!0,calendar:a.calendar};function f(c,v){return pa.coerce(n,l,T4,c,v)}return _4(n,l,f,s,a),w4(n,l,f,s),l}var D4={draw:k4},$4={moduleType:"component",name:"colorbar",attributes:Zh,supplyDefaults:dw,draw:D4.draw,hasColorbar:nw},P4={moduleType:"component",name:"legend",layoutAttributes:Xw,supplyLayoutDefaults:Yw,draw:Kw,style:qw},R4={moduleType:"locale",name:"en",dictionary:{"Click to enter Colorscale title":"Click to enter Colourscale title"},format:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],periods:["AM","PM"],dateTime:"%a %b %e %X %Y",date:"%d/%m/%Y",time:"%H:%M:%S",decimal:".",thousands:",",grouping:[3],currency:["$",""],year:"%Y",month:"%b %Y",dayMonth:"%b %-d",dayMonthYear:"%b %-d, %Y"}},E4={moduleType:"locale",name:"en-US",dictionary:{"Click to enter Colorscale title":"Click to enter Colorscale title"},format:{date:"%m/%d/%Y"}},z4=ot,Pk=me,ed=Pk.extendFlat,ix=Pk.extendDeep;function nx(t){var e;switch(t){case"themes__thumb":e={autosize:!0,width:150,height:150,title:{text:""},showlegend:!1,margin:{l:5,r:5,t:5,b:5,pad:0},annotations:[]};break;case"thumbnail":e={title:{text:""},hidesources:!0,showlegend:!1,borderwidth:0,bordercolor:"",margin:{l:1,r:1,t:1,b:1,pad:0},annotations:[]};break;default:e={}}return e}function I4(t){var e=["xaxis","yaxis","zaxis"];return e.indexOf(t.slice(0,5))>-1}var Rk=function(e,r){var a,i=e.data,n=e.layout,o=ix([],i),l=ix({},n,nx(r.tileClass)),s=e._context||{};if(r.width&&(l.width=r.width),r.height&&(l.height=r.height),r.tileClass==="thumbnail"||r.tileClass==="themes__thumb"){l.annotations=[];var f=Object.keys(l);for(a=0;a<f.length;a++)I4(f[a])&&(l[f[a]].title={text:""});for(a=0;a<o.length;a++){var c=o[a];c.showscale=!1,c.marker&&(c.marker.showscale=!1),z4.traceIs(c,"pie-like")&&(c.textposition="none")}}if(Array.isArray(r.annotations))for(a=0;a<r.annotations.length;a++)l.annotations.push(r.annotations[a]);var v=Object.keys(l).filter(function(m){return m.match(/^scene\d*$/)});if(v.length){var u={};for(r.tileClass==="thumbnail"&&(u={title:{text:""},showaxeslabels:!1,showticklabels:!1,linetickenable:!1}),a=0;a<v.length;a++){var h=l[v[a]];h.xaxis||(h.xaxis={}),h.yaxis||(h.yaxis={}),h.zaxis||(h.zaxis={}),ed(h.xaxis,u),ed(h.yaxis,u),ed(h.zaxis,u),h._scene=null}}var d=document.createElement("div");r.tileClass&&(d.className=r.tileClass);var p={gd:d,td:d,layout:l,data:o,config:{staticPlot:r.staticPlot===void 0?!0:r.staticPlot,plotGlPixelRatio:r.plotGlPixelRatio===void 0?2:r.plotGlPixelRatio,displaylogo:r.displaylogo||!1,showLink:r.showLink||!1,showTips:r.showTips||!1,mapboxAccessToken:s.mapboxAccessToken}};return r.setBackground!=="transparent"&&(p.config.setBackground=r.setBackground||"opaque"),p.gd.defaultLayout=nx(r.tileClass),p},F4=Ah.EventEmitter,N4=ot,H4=me,ox=Hr,O4=Rk,j4=Fp,B4=Np;function G4(t,e){var r=new F4,a=O4(t,{format:"png"}),i=a.gd;i.style.position="absolute",i.style.left="-5000px",document.body.appendChild(i);function n(){var l=ox.getDelay(i._fullLayout);setTimeout(function(){var s=j4(i),f=document.createElement("canvas");f.id=H4.randstr(),r=B4({format:e.format,width:i._fullLayout.width,height:i._fullLayout.height,canvas:f,emitter:r,svg:s}),r.clean=function(){i&&document.body.removeChild(i)}},l)}var o=ox.getRedrawFunc(i);return N4.call("_doPlot",i,a.data,a.layout,a.config).then(o).then(n).catch(function(l){r.emit("error",l)}),r}var U4=G4,lx=Hr,V4={getDelay:lx.getDelay,getRedrawFunc:lx.getRedrawFunc,clone:Rk,toSVG:Fp,svgToImg:Np,toImage:U4,downloadImage:u2},X4=V4;(function(t){t.version=wc.version;for(var e=ot,r=t.register=e.register,a=Wt,i=Object.keys(a),n=0;n<i.length;n++){var o=i[n];o.charAt(0)!=="_"&&(t[o]=a[o]),r({moduleType:"apiMethod",name:o,fn:a[o]})}r(iI),r([DI,WI,Sl,uF,kF,qF,_N,$N,a4,c4,p4,wo,$4,P4,Ia,zT]),r([R4,E4]),window.PlotlyLocales&&Array.isArray(window.PlotlyLocales)&&(r(window.PlotlyLocales),delete window.PlotlyLocales),t.Icons=pp;var l=Ia,s=cr;t.Plots={resize:s.resize,graphJson:s.graphJson,sendDataToCloud:s.sendDataToCloud},t.Fx={hover:l.hover,unhover:l.unhover,loneHover:l.loneHover,loneUnhover:l.loneUnhover},t.Snapshot=X4,t.PlotSchema=Oo})(B1);var Y4=B1;const jj=Fi(Y4);var ys={TEXTPAD:3,eventDataKeys:["value","label"]},rr=Ui,sx=jo.axisHoverFormat,W4=Dr.hovertemplateAttrs,q4=Dr.texttemplateAttrs,Ek=Ln,Z4=Mr,fx=ys,K4=ra.pattern,cn=Qt.extendFlat,td=Z4({editType:"calc",arrayOk:!0,colorEditType:"style",description:""}),Q4=rr.marker,J4=Q4.line,e6=cn({},J4.width,{dflt:0}),t6=cn({width:e6,editType:"calc"},Ek("marker.line")),r6=cn({line:t6,editType:"calc"},Ek("marker"),{opacity:{valType:"number",arrayOk:!0,dflt:1,min:0,max:1,editType:"style",description:"Sets the opacity of the bars."},pattern:K4}),gs={x:rr.x,x0:rr.x0,dx:rr.dx,y:rr.y,y0:rr.y0,dy:rr.dy,xperiod:rr.xperiod,yperiod:rr.yperiod,xperiod0:rr.xperiod0,yperiod0:rr.yperiod0,xperiodalignment:rr.xperiodalignment,yperiodalignment:rr.yperiodalignment,xhoverformat:sx("x"),yhoverformat:sx("y"),text:rr.text,texttemplate:q4({editType:"plot"},{keys:fx.eventDataKeys}),hovertext:rr.hovertext,hovertemplate:W4({},{keys:fx.eventDataKeys}),textposition:{valType:"enumerated",values:["inside","outside","auto","none"],dflt:"auto",arrayOk:!0,editType:"calc",description:["Specifies the location of the `text`.","*inside* positions `text` inside, next to the bar end","(rotated and scaled if needed).","*outside* positions `text` outside, next to the bar end","(scaled if needed), unless there is another bar stacked on","this one, then the text gets pushed inside.","*auto* tries to position `text` inside the bar, but if","the bar is too small and no bar is stacked on this one","the text is moved outside.","If *none*, no text appears."].join(" ")},insidetextanchor:{valType:"enumerated",values:["end","middle","start"],dflt:"end",editType:"plot",description:["Determines if texts are kept at center or start/end points in `textposition` *inside* mode."].join(" ")},textangle:{valType:"angle",dflt:"auto",editType:"plot",description:["Sets the angle of the tick labels with respect to the bar.","For example, a `tickangle` of -90 draws the tick labels","vertically. With *auto* the texts may automatically be","rotated to fit with the maximum size in bars."].join(" ")},textfont:cn({},td,{description:"Sets the font used for `text`."}),insidetextfont:cn({},td,{description:"Sets the font used for `text` lying inside the bar."}),outsidetextfont:cn({},td,{description:"Sets the font used for `text` lying outside the bar."}),constraintext:{valType:"enumerated",values:["inside","outside","both","none"],dflt:"both",editType:"calc",description:["Constrain the size of text inside or outside a bar to be no","larger than the bar itself."].join(" ")},cliponaxis:cn({},rr.cliponaxis,{description:["Determines whether the text nodes","are clipped about the subplot axes.","To show the text nodes above axis lines and tick labels,","make sure to set `xaxis.layer` and `yaxis.layer` to *below traces*."].join(" ")}),orientation:{valType:"enumerated",values:["v","h"],editType:"calc+clearAxisTypes",description:["Sets the orientation of the bars.","With *v* (*h*), the value of the each bar spans","along the vertical (horizontal)."].join(" ")},base:{valType:"any",dflt:null,arrayOk:!0,editType:"calc",description:["Sets where the bar base is drawn (in position axis units).","In *stack* or *relative* barmode,","traces that set *base* will be excluded","and drawn in *overlay* mode instead."].join(" ")},offset:{valType:"number",dflt:null,arrayOk:!0,editType:"calc",description:["Shifts the position where the bar is drawn","(in position axis units).","In *group* barmode,","traces that set *offset* will be excluded","and drawn in *overlay* mode instead."].join(" ")},width:{valType:"number",dflt:null,min:0,arrayOk:!0,editType:"calc",description:["Sets the bar width (in position axis units)."].join(" ")},marker:r6,offsetgroup:rr.offsetgroup,alignmentgroup:rr.alignmentgroup,selected:{marker:{opacity:rr.selected.marker.opacity,color:rr.selected.marker.color,editType:"style"},textfont:rr.selected.textfont,editType:"style"},unselected:{marker:{opacity:rr.unselected.marker.opacity,color:rr.unselected.marker.color,editType:"style"},textfont:rr.unselected.textfont,editType:"style"},_deprecated:{bardir:{valType:"enumerated",editType:"calc",values:["v","h"],description:"Renamed to `orientation`."}}},im={barmode:{valType:"enumerated",values:["stack","group","overlay","relative"],dflt:"group",editType:"calc",description:["Determines how bars at the same location coordinate","are displayed on the graph.","With *stack*, the bars are stacked on top of one another","With *relative*, the bars are stacked on top of one another,","with negative values below the axis, positive values above","With *group*, the bars are plotted next to one another","centered around the shared location.","With *overlay*, the bars are plotted over one another,","you might need to reduce *opacity* to see multiple bars."].join(" ")},barnorm:{valType:"enumerated",values:["","fraction","percent"],dflt:"",editType:"calc",description:["Sets the normalization for bar traces on the graph.","With *fraction*, the value of each bar is divided by the sum of all","values at that location coordinate.","*percent* is the same but multiplied by 100 to show percentages."].join(" ")},bargap:{valType:"number",min:0,max:1,editType:"calc",description:["Sets the gap (in plot fraction) between bars of","adjacent location coordinates."].join(" ")},bargroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc",description:["Sets the gap (in plot fraction) between bars of","the same location coordinate."].join(" ")}},a6=ht,cx=Na.hasColorscale,ux=fs,i6=me.coercePattern,zk=function(e,r,a,i,n){var o=a("marker.color",i),l=cx(e,"marker");l&&ux(e,r,n,a,{prefix:"marker.",cLetter:"c"}),a("marker.line.color",a6.defaultLine),cx(e,"marker.line")&&ux(e,r,n,a,{prefix:"marker.line.",cLetter:"c"}),a("marker.line.width"),a("marker.opacity"),i6(a,"marker.pattern",o,l),a("selected.marker.color"),a("unselected.marker.color")},$o=me,vx=ht,n6=ot,o6=Op,l6=iu,s6=zk,f6=jp,Ik=gs,lf=$o.coerceFont;function c6(t,e,r,a){function i(f,c){return $o.coerce(t,e,Ik,f,c)}var n=o6(t,e,a,i);if(!n){e.visible=!1;return}l6(t,e,a,i),i("xhoverformat"),i("yhoverformat"),i("orientation",e.x&&!e.y?"h":"v"),i("base"),i("offset"),i("width"),i("text"),i("hovertext"),i("hovertemplate");var o=i("textposition");Fk(t,e,a,i,o,{moduleHasSelected:!0,moduleHasUnselected:!0,moduleHasConstrain:!0,moduleHasCliponaxis:!0,moduleHasTextangle:!0,moduleHasInsideanchor:!0}),s6(t,e,i,r,a);var l=(e.marker.line||{}).color,s=n6.getComponentMethod("errorbars","supplyDefaults");s(t,e,l||vx.defaultLine,{axis:"y"}),s(t,e,l||vx.defaultLine,{axis:"x",inherit:"y"}),$o.coerceSelectionMarkerOpacity(e,i)}function u6(t,e){var r,a;function i(o){return $o.coerce(a._input,a,Ik,o)}if(e.barmode==="group")for(var n=0;n<t.length;n++)a=t[n],a.type==="bar"&&(r=a._input,f6(r,a,e,i))}function Fk(t,e,r,a,i,n){n=n||{};var o=n.moduleHasSelected!==!1,l=n.moduleHasUnselected!==!1,s=n.moduleHasConstrain!==!1,f=n.moduleHasCliponaxis!==!1,c=n.moduleHasTextangle!==!1,v=n.moduleHasInsideanchor!==!1,u=!!n.hasPathbar,h=Array.isArray(i)||i==="auto",d=h||i==="inside",p=h||i==="outside";if(d||p){var m=lf(a,"textfont",r.font),y=$o.extendFlat({},m),b=t.textfont&&t.textfont.color,w=!b;if(w&&delete y.color,lf(a,"insidetextfont",y),u){var g=$o.extendFlat({},m);w&&delete g.color,lf(a,"pathbar.textfont",g)}p&&lf(a,"outsidetextfont",m),o&&a("selected.textfont.color"),l&&a("unselected.textfont.color"),s&&a("constraintext"),f&&a("cliponaxis"),c&&a("textangle"),a("texttemplate")}d&&v&&a("insidetextanchor")}var es={supplyDefaults:c6,crossTraceDefaults:u6,handleText:Fk},v6=ot,d6=Bt,h6=me,p6=im,Nk=function(t,e,r){function a(h,d){return h6.coerce(t,e,p6,h,d)}for(var i=!1,n=!1,o=!1,l={},s=a("barmode"),f=0;f<r.length;f++){var c=r[f];if(v6.traceIs(c,"bar")&&c.visible)i=!0;else continue;if(s==="group"){var v=c.xaxis+c.yaxis;l[v]&&(o=!0),l[v]=!0}if(c.visible&&c.type==="histogram"){var u=d6.getFromId({_fullLayout:e},c[c.orientation==="v"?"xaxis":"yaxis"]);u.type!=="category"&&(n=!0)}}if(!i){delete e.barmode;return}s!=="overlay"&&a("barnorm"),a("bargap",n&&!o?0:.2),a("bargroupgap")},Xn=me,nm=function(e,r){for(var a=0;a<e.length;a++)e[a].i=a;Xn.mergeArray(r.text,e,"tx"),Xn.mergeArray(r.hovertext,e,"htx");var i=r.marker;if(i){Xn.mergeArray(i.opacity,e,"mo",!0),Xn.mergeArray(i.color,e,"mc");var n=i.line;n&&(Xn.mergeArray(n.color,e,"mlc"),Xn.mergeArrayCastPositive(n.width,e,"mlw"))}},dx=Bt,hx=nu,px=Na.hasColorscale,mx=Kh,m6=nm,y6=A2,g6=function(e,r){var a=dx.getFromId(e,r.xaxis||"x"),i=dx.getFromId(e,r.yaxis||"y"),n,o,l,s,f,c,v={msUTC:!!(r.base||r.base===0)};r.orientation==="h"?(n=a.makeCalcdata(r,"x",v),l=i.makeCalcdata(r,"y"),s=hx(r,i,"y",l),f=!!r.yperiodalignment,c="y"):(n=i.makeCalcdata(r,"y",v),l=a.makeCalcdata(r,"x"),s=hx(r,a,"x",l),f=!!r.xperiodalignment,c="x"),o=s.vals;for(var u=Math.min(o.length,n.length),h=new Array(u),d=0;d<u;d++)h[d]={p:o[d],s:n[d]},f&&(h[d].orig_p=l[d],h[d][c+"End"]=s.ends[d],h[d][c+"Start"]=s.starts[d]),r.ids&&(h[d].id=String(r.ids[d]));return px(r,"marker")&&mx(e,r,{vals:r.marker.color,containerStr:"marker",cLetter:"c"}),px(r,"marker.line")&&mx(e,r,{vals:r.marker.line.color,containerStr:"marker.line",cLetter:"c"}),m6(h,r),y6(h,r),h},b6=gt,x6=me;function _6(t,e,r){var a=t._fullLayout,i=a["_"+r+"Text_minsize"];if(i){var n=a.uniformtext.mode==="hide",o;switch(r){case"funnelarea":case"pie":case"sunburst":o="g.slice";break;case"treemap":case"icicle":o="g.slice, g.pathbar";break;default:o="g.points > g.point"}e.selectAll(o).each(function(l){var s=l.transform;if(s){s.scale=n&&s.hide?0:i/s.fontSize;var f=b6.select(this).select("text");x6.setTransormAndDisplay(f,s)}})}}function w6(t,e,r){if(r.uniformtext.mode){var a=Hk(t),i=r.uniformtext.minsize,n=e.scale*e.fontSize;e.hide=n<i,r[a]=r[a]||1/0,e.hide||(r[a]=Math.min(r[a],Math.max(n,i)))}}function T6(t,e){var r=Hk(t);e[r]=void 0}function Hk(t){return"_"+t+"Text_minsize"}var vi={recordMinTextSize:w6,clearMinTextSize:T6,resizeText:_6},di={},k6=wt,A6=ga,M6=me.isArrayOrTypedArray;di.coerceString=function(t,e,r){if(typeof e=="string"){if(e||!t.noBlank)return e}else if((typeof e=="number"||e===!0)&&!t.strict)return String(e);return r!==void 0?r:t.dflt};di.coerceNumber=function(t,e,r){if(k6(e)){e=+e;var a=t.min,i=t.max,n=a!==void 0&&e<a||i!==void 0&&e>i;if(!n)return e}return r!==void 0?r:t.dflt};di.coerceColor=function(t,e,r){return A6(e).isValid()?e:r!==void 0?r:t.dflt};di.coerceEnumerated=function(t,e,r){return t.coerceNumber&&(e=+e),t.values.indexOf(e)!==-1?e:r!==void 0?r:t.dflt};di.getValue=function(t,e){var r;return Array.isArray(t)?e<t.length&&(r=t[e]):r=t,r};di.getLineWidth=function(t,e){var r=0<e.mlw?e.mlw:M6(t.marker.line.width)?0:t.marker.line.width;return r};var El=gt,S6=ht,ts=$t,Ok=me,jk=ot,Bk=vi.resizeText,om=gs,L6=om.textfont,C6=om.insidetextfont,D6=om.outsidetextfont,Yn=di;function $6(t){var e=El.select(t).selectAll("g.barlayer").selectAll("g.trace");Bk(t,e,"bar");var r=e.size(),a=t._fullLayout;e.style("opacity",function(i){return i[0].trace.opacity}).each(function(i){(a.barmode==="stack"&&r>1||a.bargap===0&&a.bargroupgap===0&&!i[0].trace.marker.line.width)&&El.select(this).attr("shape-rendering","crispEdges")}),e.selectAll("g.points").each(function(i){var n=El.select(this),o=i[0].trace;Gk(n,o,t)}),jk.getComponentMethod("errorbars","style")(e)}function Gk(t,e,r){ts.pointStyle(t.selectAll("path"),e,r),Uk(t,e,r)}function Uk(t,e,r){t.selectAll("text").each(function(a){var i=El.select(this),n=Ok.ensureUniformFontSize(r,Vk(i,a,e,r));ts.font(i,n)})}function P6(t,e,r){var a=e[0].trace;a.selectedpoints?R6(r,a,t):(Gk(r,a,t),jk.getComponentMethod("errorbars","style")(r))}function R6(t,e,r){ts.selectedPointStyle(t.selectAll("path"),e),E6(t.selectAll("text"),e,r)}function E6(t,e,r){t.each(function(a){var i=El.select(this),n;if(a.selected){n=Ok.ensureUniformFontSize(r,Vk(i,a,e,r));var o=e.selected.textfont&&e.selected.textfont.color;o&&(n.color=o),ts.font(i,n)}else ts.selectedTextStyle(i,e)})}function Vk(t,e,r,a){var i=a._fullLayout.font,n=r.textfont;if(t.classed("bartext-inside")){var o=qk(e,r);n=Yk(r,e.i,i,o)}else t.classed("bartext-outside")&&(n=Wk(r,e.i,i));return n}function Xk(t,e,r){return lm(L6,t.textfont,e,r)}function Yk(t,e,r,a){var i=Xk(t,e,r),n=t._input.textfont===void 0||t._input.textfont.color===void 0||Array.isArray(t.textfont.color)&&t.textfont.color[e]===void 0;return n&&(i={color:S6.contrast(a),family:i.family,size:i.size}),lm(C6,t.insidetextfont,e,i)}function Wk(t,e,r){var a=Xk(t,e,r);return lm(D6,t.outsidetextfont,e,a)}function lm(t,e,r,a){e=e||{};var i=Yn.getValue(e.family,r),n=Yn.getValue(e.size,r),o=Yn.getValue(e.color,r);return{family:Yn.coerceString(t.family,i,a.family),size:Yn.coerceNumber(t.size,n,a.size),color:Yn.coerceColor(t.color,o,a.color)}}function qk(t,e){return e.type==="waterfall"?e[t.dir].marker.color:t.mcc||t.mc||e.marker.color}var _n={style:$6,styleTextPoints:Uk,styleOnSelect:P6,getInsideTextFont:Yk,getOutsideTextFont:Wk,getBarColor:qk,resizeText:Bk},sf=gt,ff=wt,wr=me,z6=br,I6=ht,Li=$t,F6=ot,pc=Bt.tickText,Zk=vi,N6=Zk.recordMinTextSize,H6=Zk.clearMinTextSize,rd=_n,Po=di,O6=ys,Kk=gs,j6=Kk.text,B6=Kk.textposition,G6=xa.appendArrayPointValue,Ra=O6.TEXTPAD;function U6(t){return t.id}function V6(t){if(t.ids)return U6}function $i(t,e){return t<e?1:-1}function X6(t,e,r,a){var i=[],n=[],o=a?e:r,l=a?r:e;return i[0]=o.c2p(t.s0,!0),n[0]=l.c2p(t.p0,!0),i[1]=o.c2p(t.s1,!0),n[1]=l.c2p(t.p1,!0),a?[i,n]:[n,i]}function Qk(t,e,r,a){if(!e.uniformtext.mode&&Jk(r)){var i;return a&&(i=a()),t.transition().duration(r.duration).ease(r.easing).each("end",function(){i&&i()}).each("interrupt",function(){i&&i()})}else return t}function Jk(t){return t&&t.duration>0}function Y6(t,e,r,a,i,n){var o=e.xaxis,l=e.yaxis,s=t._fullLayout,f=t._context.staticPlot;i||(i={mode:s.barmode,norm:s.barmode,gap:s.bargap,groupgap:s.bargroupgap},H6("bar",s));var c=wr.makeTraceGroups(a,r,"trace bars").each(function(v){var u=sf.select(this),h=v[0].trace,d=h.type==="waterfall",p=h.type==="funnel",m=h.type==="bar",y=m||p,b=0;d&&h.connector.visible&&h.connector.mode==="between"&&(b=h.connector.line.width/2);var w=h.orientation==="h",g=Jk(i),x=wr.ensureSingle(u,"g","points"),_=V6(h),T=x.selectAll("g.point").data(wr.identity,_);T.enter().append("g").classed("point",!0),T.exit().remove(),T.each(function(S,L){var D=sf.select(this),$=X6(S,o,l,w),E=$[0][0],z=$[0][1],O=$[1][0],I=$[1][1],P=(w?z-E:I-O)===0;P&&y&&Po.getLineWidth(h,S)&&(P=!1),P||(P=!ff(E)||!ff(z)||!ff(O)||!ff(I)),S.isBlank=P,P&&(w?z=E:I=O),b&&!P&&(w?(E-=$i(E,z)*b,z+=$i(E,z)*b):(O-=$i(O,I)*b,I+=$i(O,I)*b));var M,A;if(h.type==="waterfall"){if(!P){var C=h[S.dir].marker;M=C.line.width,A=C.color}}else M=Po.getLineWidth(h,S),A=S.mc||h.marker.color;function R(q){var U=sf.round(M/2%1,2);return i.gap===0&&i.groupgap===0?sf.round(Math.round(q)-U,2):q}function N(q,U,Z){return Z&&q===U?q:Math.abs(q-U)>=2?R(q):q>U?Math.ceil(q):Math.floor(q)}if(!t._context.staticPlot){var H=I6.opacity(A),B=H<1||M>.01?R:N;E=B(E,z,w),z=B(z,E,w),O=B(O,I,!w),I=B(I,O,!w)}var X=Qk(wr.ensureSingle(D,"path"),s,i,n);if(X.style("vector-effect",f?"none":"non-scaling-stroke").attr("d",isNaN((z-E)*(I-O))||P&&t._context.staticPlot?"M0,0Z":"M"+E+","+O+"V"+I+"H"+z+"V"+O+"Z").call(Li.setClipUrl,e.layerClipId,t),!s.uniformtext.mode&&g){var j=Li.makePointStyleFns(h);Li.singlePointStyle(S,X,h,j,t)}W6(t,e,D,v,L,E,z,O,I,i,n),e.layerClipId&&Li.hideOutsideRangePoint(S,D.select("text"),o,l,h.xcalendar,h.ycalendar)});var k=h.cliponaxis===!1;Li.setClipUrl(u,k?null:e.layerClipId,t)});F6.getComponentMethod("errorbars","plot")(t,c,e,i)}function W6(t,e,r,a,i,n,o,l,s,f,c){var v=e.xaxis,u=e.yaxis,h=t._fullLayout,d;function p(q,U,Z){var K=wr.ensureSingle(q,"text").text(U).attr({class:"bartext bartext-"+d,"text-anchor":"middle","data-notex":1}).call(Li.font,Z).call(z6.convertToTspans,t);return K}var m=a[0].trace,y=m.orientation==="h",b=Z6(h,a,i,v,u);d=K6(m,i);var w=f.mode==="stack"||f.mode==="relative",g=a[i],x=!w||g._outmost;if(!b||d==="none"||(g.isBlank||n===o||l===s)&&(d==="auto"||d==="inside")){r.select("text").remove();return}var _=h.font,T=rd.getBarColor(a[i],m),k=rd.getInsideTextFont(m,i,_,T),S=rd.getOutsideTextFont(m,i,_),L=r.datum();y?v.type==="log"&&L.s0<=0&&(v.range[0]<v.range[1]?n=0:n=v._length):u.type==="log"&&L.s0<=0&&(u.range[0]<u.range[1]?l=u._length:l=0);var D=Math.abs(o-n)-2*Ra,$=Math.abs(s-l)-2*Ra,E,z,O,I,P;if(d==="outside"&&!x&&!g.hasB&&(d="inside"),d==="auto")if(x){d="inside",P=wr.ensureUniformFontSize(t,k),E=p(r,b,P),z=Li.bBox(E.node()),O=z.width,I=z.height;var M=O>0&&I>0,A=O<=D&&I<=$,C=O<=$&&I<=D,R=y?D>=O*($/I):$>=I*(D/O);M&&(A||C||R)?d="inside":(d="outside",E.remove(),E=null)}else d="inside";if(!E){P=wr.ensureUniformFontSize(t,d==="outside"?S:k),E=p(r,b,P);var N=E.attr("transform");if(E.attr("transform",""),z=Li.bBox(E.node()),O=z.width,I=z.height,E.attr("transform",N),O<=0||I<=0){E.remove();return}}var H=m.textangle,B,X;d==="outside"?(X=m.constraintext==="both"||m.constraintext==="outside",B=q6(n,o,l,s,z,{isHorizontal:y,constrained:X,angle:H})):(X=m.constraintext==="both"||m.constraintext==="inside",B=rA(n,o,l,s,z,{isHorizontal:y,constrained:X,angle:H,anchor:m.insidetextanchor})),B.fontSize=P.size,N6(m.type==="histogram"?"bar":m.type,B,h),g.transform=B;var j=Qk(E,h,f,c);wr.setTransormAndDisplay(j,B)}function eA(t){return t==="auto"?0:t}function tA(t,e){var r=Math.PI/180*e,a=Math.abs(Math.sin(r)),i=Math.abs(Math.cos(r));return{x:t.width*i+t.height*a,y:t.width*a+t.height*i}}function rA(t,e,r,a,i,n){var o=!!n.isHorizontal,l=!!n.constrained,s=n.angle||0,f=n.anchor||"end",c=f==="end",v=f==="start",u=n.leftToRight||0,h=(u+1)/2,d=1-h,p=i.width,m=i.height,y=Math.abs(e-t),b=Math.abs(a-r),w=y>2*Ra&&b>2*Ra?Ra:0;y-=2*w,b-=2*w;var g=eA(s);s==="auto"&&!(p<=y&&m<=b)&&(p>y||m>b)&&(!(p>b||m>y)||p<m!=y<b)&&(g+=90);var x=tA(i,g),_=1;l&&(_=Math.min(1,y/x.x,b/x.y));var T=i.left*d+i.right*h,k=(i.top+i.bottom)/2,S=(t+Ra)*d+(e-Ra)*h,L=(r+a)/2,D=0,$=0;if(v||c){var E=(o?x.x:x.y)/2,z=o?$i(t,e):$i(r,a);o?v?(S=t+z*w,D=-z*E):(S=e-z*w,D=z*E):v?(L=r+z*w,$=-z*E):(L=a-z*w,$=z*E)}return{textX:T,textY:k,targetX:S,targetY:L,anchorX:D,anchorY:$,scale:_,rotate:g}}function q6(t,e,r,a,i,n){var o=!!n.isHorizontal,l=!!n.constrained,s=n.angle||0,f=i.width,c=i.height,v=Math.abs(e-t),u=Math.abs(a-r),h;o?h=u>2*Ra?Ra:0:h=v>2*Ra?Ra:0;var d=1;l&&(d=o?Math.min(1,u/c):Math.min(1,v/f));var p=eA(s),m=tA(i,p),y=(o?m.x:m.y)/2,b=(i.left+i.right)/2,w=(i.top+i.bottom)/2,g=(t+e)/2,x=(r+a)/2,_=0,T=0,k=o?$i(e,t):$i(r,a);return o?(g=e-k*h,_=k*y):(x=a+k*h,T=-k*y),{textX:b,textY:w,targetX:g,targetY:x,anchorX:_,anchorY:T,scale:d,rotate:p}}function Z6(t,e,r,a,i){var n=e[0].trace,o=n.texttemplate,l;return o?l=Q6(t,e,r,a,i):n.textinfo?l=J6(e,r,a,i):l=Po.getValue(n.text,r),Po.coerceString(j6,l)}function K6(t,e){var r=Po.getValue(t.textposition,e);return Po.coerceEnumerated(B6,r)}function Q6(t,e,r,a,i){var n=e[0].trace,o=wr.castOption(n,r,"texttemplate");if(!o)return"";var l=n.type==="histogram",s=n.type==="waterfall",f=n.type==="funnel",c=n.orientation==="h",v,u,h,d;c?(v="y",u=i,h="x",d=a):(v="x",u=a,h="y",d=i);function p(_){return pc(u,u.c2l(_),!0).text}function m(_){return pc(d,d.c2l(_),!0).text}var y=e[r],b={};b.label=y.p,b.labelLabel=b[v+"Label"]=p(y.p);var w=wr.castOption(n,y.i,"text");(w===0||w)&&(b.text=w),b.value=y.s,b.valueLabel=b[h+"Label"]=m(y.s);var g={};G6(g,n,y.i),(l||g.x===void 0)&&(g.x=c?b.value:b.label),(l||g.y===void 0)&&(g.y=c?b.label:b.value),(l||g.xLabel===void 0)&&(g.xLabel=c?b.valueLabel:b.labelLabel),(l||g.yLabel===void 0)&&(g.yLabel=c?b.labelLabel:b.valueLabel),s&&(b.delta=+y.rawS||y.s,b.deltaLabel=m(b.delta),b.final=y.v,b.finalLabel=m(b.final),b.initial=b.final-b.delta,b.initialLabel=m(b.initial)),f&&(b.value=y.s,b.valueLabel=m(b.value),b.percentInitial=y.begR,b.percentInitialLabel=wr.formatPercent(y.begR),b.percentPrevious=y.difR,b.percentPreviousLabel=wr.formatPercent(y.difR),b.percentTotal=y.sumR,b.percenTotalLabel=wr.formatPercent(y.sumR));var x=wr.castOption(n,y.i,"customdata");return x&&(b.customdata=x),wr.texttemplateString(o,b,t._d3locale,g,b,n._meta||{})}function J6(t,e,r,a){var i=t[0].trace,n=i.orientation==="h",o=i.type==="waterfall",l=i.type==="funnel";function s(x){var _=n?a:r;return pc(_,x,!0).text}function f(x){var _=n?r:a;return pc(_,+x,!0).text}var c=i.textinfo,v=t[e],u=c.split("+"),h=[],d,p=function(x){return u.indexOf(x)!==-1};if(p("label")&&h.push(s(t[e].p)),p("text")&&(d=wr.castOption(i,v.i,"text"),(d===0||d)&&h.push(d)),o){var m=+v.rawS||v.s,y=v.v,b=y-m;p("initial")&&h.push(f(b)),p("delta")&&h.push(f(m)),p("final")&&h.push(f(y))}if(l){p("value")&&h.push(f(v.s));var w=0;p("percent initial")&&w++,p("percent previous")&&w++,p("percent total")&&w++;var g=w>1;p("percent initial")&&(d=wr.formatPercent(v.begR),g&&(d+=" of initial"),h.push(d)),p("percent previous")&&(d=wr.formatPercent(v.difR),g&&(d+=" of previous"),h.push(d)),p("percent total")&&(d=wr.formatPercent(v.sumR),g&&(d+=" of total"),h.push(d))}return h.join("<br>")}var sm={plot:Y6,toMoveInsideBar:rA},vl=Ia,e8=ot,yx=ht,t8=me.fillText,r8=di.getLineWidth,ad=Bt.hoverLabelText,a8=or.BADNUM;function i8(t,e,r,a,i){var n=aA(t,e,r,a,i);if(n){var o=n.cd,l=o[0].trace,s=o[n.index];return n.color=iA(l,s),e8.getComponentMethod("errorbars","hoverInfo")(s,l,n),[n]}}function aA(t,e,r,a,i){var n=t.cd,o=n[0].trace,l=n[0].t,s=a==="closest",f=o.type==="waterfall",c=t.maxHoverDistance,v=t.maxSpikeDistance,u,h,d,p,m,y,b;o.orientation==="h"?(u=r,h=e,d="y",p="x",m=O,y=$):(u=e,h=r,d="x",p="y",y=O,m=$);var w=o[d+"period"],g=s||w;function x(j){return T(j,-1)}function _(j){return T(j,1)}function T(j,q){var U=j.w;return j[d]+q*U/2}function k(j){return j[d+"End"]-j[d+"Start"]}var S=s?x:w?function(j){return j.p-k(j)/2}:function(j){return Math.min(x(j),j.p-l.bardelta/2)},L=s?_:w?function(j){return j.p+k(j)/2}:function(j){return Math.max(_(j),j.p+l.bardelta/2)};function D(j,q,U){return i.finiteRange&&(U=0),vl.inbox(j-u,q-u,U+Math.min(1,Math.abs(q-j)/b)-1)}function $(j){return D(S(j),L(j),c)}function E(j){return D(x(j),_(j),v)}function z(j){var q=j[p];if(f){var U=Math.abs(j.rawS)||0;h>0?q+=U:h<0&&(q-=U)}return q}function O(j){var q=h,U=j.b,Z=z(j);return vl.inbox(U-q,Z-q,c+(Z-q)/(Z-U)-1)}function I(j){var q=h,U=j.b,Z=z(j);return vl.inbox(U-q,Z-q,v+(Z-q)/(Z-U)-1)}var P=t[d+"a"],M=t[p+"a"];b=Math.abs(P.r2c(P.range[1])-P.r2c(P.range[0]));function A(j){return(m(j)+y(j))/2}var C=vl.getDistanceFunction(a,m,y,A);if(vl.getClosest(n,C,t),t.index!==!1&&n[t.index].p!==a8){g||(S=function(j){return Math.min(x(j),j.p-l.bargroupwidth/2)},L=function(j){return Math.max(_(j),j.p+l.bargroupwidth/2)});var R=t.index,N=n[R],H=o.base?N.b+N.s:N.s;t[p+"0"]=t[p+"1"]=M.c2p(N[p],!0),t[p+"LabelVal"]=H;var B=l.extents[l.extents.round(N.p)];t[d+"0"]=P.c2p(s?S(N):B[0],!0),t[d+"1"]=P.c2p(s?L(N):B[1],!0);var X=N.orig_p!==void 0;return t[d+"LabelVal"]=X?N.orig_p:N.p,t.labelLabel=ad(P,t[d+"LabelVal"],o[d+"hoverformat"]),t.valueLabel=ad(M,t[p+"LabelVal"],o[p+"hoverformat"]),t.baseLabel=ad(M,N.b,o[p+"hoverformat"]),t.spikeDistance=(I(N)+E(N))/2,t[d+"Spike"]=P.c2p(N.p,!0),t8(N,o,t),t.hovertemplate=o.hovertemplate,t}}function iA(t,e){var r=e.mcc||t.marker.color,a=e.mlcc||t.marker.line.color,i=r8(t,e);if(yx.opacity(r))return r;if(yx.opacity(a)&&i)return a}var nA={hoverPoints:i8,hoverOnBars:aA,getTraceColor:iA},n8=function(e,r,a){return e.x="xVal"in r?r.xVal:r.x,e.y="yVal"in r?r.yVal:r.y,r.xa&&(e.xaxis=r.xa),r.ya&&(e.yaxis=r.ya),a.orientation==="h"?(e.label=e.y,e.value=e.x):(e.label=e.x,e.value=e.y),e},oA=function(e,r){var a=e.cd,i=e.xaxis,n=e.yaxis,o=a[0].trace,l=o.type==="funnel",s=o.orientation==="h",f=[],c;if(r===!1)for(c=0;c<a.length;c++)a[c].selected=0;else for(c=0;c<a.length;c++){var v=a[c],u="ct"in v?v.ct:o8(v,i,n,s,l);r.contains(u,!1,c,e)?(f.push({pointNumber:c,x:i.c2d(v.x),y:n.c2d(v.y)}),v.selected=1):v.selected=0}return f};function o8(t,e,r,a,i){var n=e.c2p(a?t.s0:t.p0,!0),o=e.c2p(a?t.s1:t.p1,!0),l=r.c2p(a?t.p0:t.s0,!0),s=r.c2p(a?t.p1:t.s1,!0);return i?[(n+o)/2,(l+s)/2]:a?[o,(l+s)/2]:[(n+o)/2,s]}var l8={attributes:gs,layoutAttributes:im,supplyDefaults:es.supplyDefaults,crossTraceDefaults:es.crossTraceDefaults,supplyLayoutDefaults:Nk,calc:g6,crossTraceCalc:Vp.crossTraceCalc,colorbar:ps,arraysToCalcdata:nm,plot:sm.plot,style:_n.style,styleOnSelect:_n.styleOnSelect,hoverPoints:nA.hoverPoints,eventData:n8,selectPoints:oA,moduleType:"trace",name:"bar",basePlotModule:ur,categories:["bar-like","cartesian","svg","bar","oriented","errorBarsOK","showLegend","zoomScale"],animatable:!0,meta:{description:["The data visualized by the span of the bars is set in `y`","if `orientation` is set to *v* (the default)","and the labels are set in `x`.","By setting `orientation` to *h*, the roles are interchanged."].join(" ")}},s8=l8;const Bj=Fi(s8);var f8=function(e,r){return{start:{valType:"any",editType:"calc",description:["Sets the starting value for the",e,"axis bins. Defaults to the minimum data value,","shifted down if necessary to make nice round values","and to remove ambiguous bin edges. For example, if most of the","data is integers we shift the bin edges 0.5 down, so a `size`","of 5 would have a default `start` of -0.5, so it is clear","that 0-4 are in the first bin, 5-9 in the second, but","continuous data gets a start of 0 and bins [0,5), [5,10) etc.","Dates behave similarly, and `start` should be a date string.","For category data, `start` is based on the category serial","numbers, and defaults to -0.5.",r?"If multiple non-overlaying histograms share a subplot, the first explicit `start` is used exactly and all others are shifted down (if necessary) to differ from that one by an integer number of bins.":""].join(" ")},end:{valType:"any",editType:"calc",description:["Sets the end value for the",e,"axis bins. The last bin may not end exactly at this value,","we increment the bin edge by `size` from `start` until we","reach or exceed `end`. Defaults to the maximum data value.","Like `start`, for dates use a date string, and for category","data `end` is based on the category serial numbers."].join(" ")},size:{valType:"any",editType:"calc",description:["Sets the size of each",e,"axis bin.","Default behavior: If `nbins"+e+"` is 0 or omitted,","we choose a nice round bin size such that the number of bins","is about the same as the typical number of samples in each bin.","If `nbins"+e+"` is provided, we choose a nice round","bin size giving no more than that many bins.","For date data, use milliseconds or *M<n>* for months, as in","`axis.dtick`. For category data, the number of categories to","bin together (always defaults to 1).",r?"If multiple non-overlaying histograms share a subplot, the first explicit `size` is used and all others discarded. If no `size` is provided,the sample data from all traces is combined to determine `size` as described above.":""].join(" ")},editType:"calc"}},c8={eventDataKeys:["binNumber"]},Xr=gs,gx=jo.axisHoverFormat,u8=Dr.hovertemplateAttrs,v8=Dr.texttemplateAttrs,id=Mr,bx=f8,d8=c8,nd=Qt.extendFlat,lA={x:{valType:"data_array",editType:"calc+clearAxisTypes",description:["Sets the sample data to be binned on the x axis."].join(" ")},y:{valType:"data_array",editType:"calc+clearAxisTypes",description:["Sets the sample data to be binned on the y axis."].join(" ")},xhoverformat:gx("x"),yhoverformat:gx("y"),text:nd({},Xr.text,{description:["Sets hover text elements associated with each bar.","If a single string, the same string appears over all bars.","If an array of string, the items are mapped in order to the","this trace's coordinates."].join(" ")}),hovertext:nd({},Xr.hovertext,{description:"Same as `text`."}),orientation:Xr.orientation,histfunc:{valType:"enumerated",values:["count","sum","avg","min","max"],dflt:"count",editType:"calc",description:["Specifies the binning function used for this histogram trace.","If *count*, the histogram values are computed by counting the","number of values lying inside each bin.","If *sum*, *avg*, *min*, *max*,","the histogram values are computed using","the sum, the average, the minimum or the maximum","of the values lying inside each bin respectively."].join(" ")},histnorm:{valType:"enumerated",values:["","percent","probability","density","probability density"],dflt:"",editType:"calc",description:["Specifies the type of normalization used for this histogram trace.","If **, the span of each bar corresponds to the number of","occurrences (i.e. the number of data points lying inside the bins).","If *percent* / *probability*, the span of each bar corresponds to","the percentage / fraction of occurrences with respect to the total","number of sample points","(here, the sum of all bin HEIGHTS equals 100% / 1).","If *density*, the span of each bar corresponds to the number of","occurrences in a bin divided by the size of the bin interval","(here, the sum of all bin AREAS equals the","total number of sample points).","If *probability density*, the area of each bar corresponds to the","probability that an event will fall into the corresponding bin","(here, the sum of all bin AREAS equals 1)."].join(" ")},cumulative:{enabled:{valType:"boolean",dflt:!1,editType:"calc",description:["If true, display the cumulative distribution by summing the","binned values. Use the `direction` and `centralbin` attributes","to tune the accumulation method.","Note: in this mode, the *density* `histnorm` settings behave","the same as their equivalents without *density*:","** and *density* both rise to the number of data points, and","*probability* and *probability density* both rise to the","number of sample points."].join(" ")},direction:{valType:"enumerated",values:["increasing","decreasing"],dflt:"increasing",editType:"calc",description:["Only applies if cumulative is enabled.","If *increasing* (default) we sum all prior bins, so the result","increases from left to right. If *decreasing* we sum later bins","so the result decreases from left to right."].join(" ")},currentbin:{valType:"enumerated",values:["include","exclude","half"],dflt:"include",editType:"calc",description:["Only applies if cumulative is enabled.","Sets whether the current bin is included, excluded, or has half","of its value included in the current cumulative value.","*include* is the default for compatibility with various other","tools, however it introduces a half-bin bias to the results.","*exclude* makes the opposite half-bin bias, and *half* removes","it."].join(" ")},editType:"calc"},nbinsx:{valType:"integer",min:0,dflt:0,editType:"calc",description:["Specifies the maximum number of desired bins. This value will be used","in an algorithm that will decide the optimal bin size such that the","histogram best visualizes the distribution of the data.","Ignored if `xbins.size` is provided."].join(" ")},xbins:bx("x",!0),nbinsy:{valType:"integer",min:0,dflt:0,editType:"calc",description:["Specifies the maximum number of desired bins. This value will be used","in an algorithm that will decide the optimal bin size such that the","histogram best visualizes the distribution of the data.","Ignored if `ybins.size` is provided."].join(" ")},ybins:bx("y",!0),autobinx:{valType:"boolean",dflt:null,editType:"calc",description:["Obsolete: since v1.42 each bin attribute is auto-determined","separately and `autobinx` is not needed. However, we accept","`autobinx: true` or `false` and will update `xbins` accordingly","before deleting `autobinx` from the trace."].join(" ")},autobiny:{valType:"boolean",dflt:null,editType:"calc",description:["Obsolete: since v1.42 each bin attribute is auto-determined","separately and `autobiny` is not needed. However, we accept","`autobiny: true` or `false` and will update `ybins` accordingly","before deleting `autobiny` from the trace."].join(" ")},bingroup:{valType:"string",dflt:"",editType:"calc",description:["Set a group of histogram traces which will have compatible bin settings.","Note that traces on the same subplot and with the same *orientation*","under `barmode` *stack*, *relative* and *group* are forced into the same bingroup,","Using `bingroup`, traces under `barmode` *overlay* and on different axes","(of the same axis type) can have compatible bin settings.","Note that histogram and histogram2d* trace can share the same `bingroup`"].join(" ")},hovertemplate:u8({},{keys:d8.eventDataKeys}),texttemplate:v8({arrayOk:!1,editType:"plot"},{keys:["label","value"]}),textposition:nd({},Xr.textposition,{arrayOk:!1}),textfont:id({arrayOk:!1,editType:"plot",colorEditType:"style",description:"Sets the text font."}),outsidetextfont:id({arrayOk:!1,editType:"plot",colorEditType:"style",description:"Sets the font used for `text` lying outside the bar."}),insidetextfont:id({arrayOk:!1,editType:"plot",colorEditType:"style",description:"Sets the font used for `text` lying inside the bar."}),insidetextanchor:Xr.insidetextanchor,textangle:Xr.textangle,cliponaxis:Xr.cliponaxis,constraintext:Xr.constraintext,marker:Xr.marker,offsetgroup:Xr.offsetgroup,alignmentgroup:Xr.alignmentgroup,selected:Xr.selected,unselected:Xr.unselected,_deprecated:{bardir:Xr._deprecated.bardir}},xx=ot,dl=me,_x=ht,h8=es.handleText,p8=zk,m8=lA,y8=function(e,r,a,i){function n(b,w){return dl.coerce(e,r,m8,b,w)}var o=n("x"),l=n("y"),s=n("cumulative.enabled");s&&(n("cumulative.direction"),n("cumulative.currentbin")),n("text");var f=n("textposition");h8(e,r,i,n,f,{moduleHasSelected:!0,moduleHasUnselected:!0,moduleHasConstrain:!0,moduleHasCliponaxis:!0,moduleHasTextangle:!0,moduleHasInsideanchor:!0}),n("hovertext"),n("hovertemplate"),n("xhoverformat"),n("yhoverformat");var c=n("orientation",l&&!o?"h":"v"),v=c==="v"?"x":"y",u=c==="v"?"y":"x",h=o&&l?Math.min(dl.minRowLength(o)&&dl.minRowLength(l)):dl.minRowLength(r[v]||[]);if(!h){r.visible=!1;return}r._length=h;var d=xx.getComponentMethod("calendars","handleTraceDefaults");d(e,r,["x","y"],i);var p=r[u];p&&n("histfunc"),n("histnorm"),n("autobin"+v),p8(e,r,n,a,i),dl.coerceSelectionMarkerOpacity(r,n);var m=(r.marker.line||{}).color,y=xx.getComponentMethod("errorbars","supplyDefaults");y(e,r,m||_x.defaultLine,{axis:"y"}),y(e,r,m||_x.defaultLine,{axis:"x",inherit:"y"})},Tl=me,g8=lr,cf=ot.traceIs,b8=jp,wx=Tl.nestedProperty,od=ui.getAxisGroup,Tx=[{aStr:{x:"xbins.start",y:"ybins.start"},name:"start"},{aStr:{x:"xbins.end",y:"ybins.end"},name:"end"},{aStr:{x:"xbins.size",y:"ybins.size"},name:"size"},{aStr:{x:"nbinsx",y:"nbinsy"},name:"nbins"}],x8=["x","y"],_8=function(e,r){var a=r._histogramBinOpts={},i=[],n={},o=[],l,s,f,c,v,u,h;function d(z,O){return Tl.coerce(l._input,l,l._module.attributes,z,O)}function p(z){return z.orientation==="v"?"x":"y"}function m(z,O){var I=g8.getFromTrace({_fullLayout:r},z,O);return I.type}function y(z,O,I){var P=z.uid+"__"+I;O||(O=P);var M=m(z,I),A=z[I+"calendar"]||"",C=a[O],R=!0;C&&(M===C.axType&&A===C.calendar?(R=!1,C.traces.push(z),C.dirs.push(I)):(O=P,M!==C.axType&&Tl.warn(["Attempted to group the bins of trace",z.index,"set on a","type:"+M,"axis","with bins on","type:"+C.axType,"axis."].join(" ")),A!==C.calendar&&Tl.warn(["Attempted to group the bins of trace",z.index,"set with a",A,"calendar","with bins",C.calendar?"on a "+C.calendar+" calendar":"w/o a set calendar"].join(" ")))),R&&(a[O]={traces:[z],dirs:[I],axType:M,calendar:z[I+"calendar"]||""}),z["_"+I+"bingroup"]=O}for(v=0;v<e.length;v++)l=e[v],cf(l,"histogram")&&(i.push(l),delete l._xautoBinFinished,delete l._yautoBinFinished,cf(l,"2dMap")||b8(l._input,l,r,d));var b=r._alignmentOpts||{};for(v=0;v<i.length;v++){if(l=i[v],f="",!cf(l,"2dMap")){if(c=p(l),r.barmode==="group"&&l.alignmentgroup){var w=l[c+"axis"],g=od(r,w)+l.orientation;(b[g]||{})[l.alignmentgroup]&&(f=g)}!f&&r.barmode!=="overlay"&&(f=od(r,l.xaxis)+od(r,l.yaxis)+p(l))}f?(n[f]||(n[f]=[]),n[f].push(l)):o.push(l)}for(f in n){if(s=n[f],s.length===1){o.push(s[0]);continue}var x=!1;for(s.length&&(l=s[0],x=d("bingroup")),f=x||f,v=0;v<s.length;v++){l=s[v];var _=l._input.bingroup;_&&_!==f&&Tl.warn(["Trace",l.index,"must match","within bingroup",f+".","Ignoring its bingroup:",_,"setting."].join(" ")),l.bingroup=f,y(l,f,p(l))}}for(v=0;v<o.length;v++){l=o[v];var T=d("bingroup");if(cf(l,"2dMap"))for(h=0;h<2;h++){c=x8[h];var k=d(c+"bingroup",T?T+"__"+c:null);y(l,k,c)}else y(l,T,p(l))}for(f in a){var S=a[f];for(s=S.traces,u=0;u<Tx.length;u++){var L=Tx[u],D=L.name,$,E;if(!(D==="nbins"&&S.sizeFound)){for(v=0;v<s.length;v++){if(l=s[v],c=S.dirs[v],$=L.aStr[c],wx(l._input,$).get()!==void 0){S[D]=d($),S[D+"Found"]=!0;break}E=(l._autoBin||{})[c]||{},E[D]&&wx(l,$).set(E[D])}if(D==="start"||D==="end")for(;v<s.length;v++)l=s[v],l["_"+c+"bingroup"]&&(E=(l._autoBin||{})[c]||{},d($,E[D]));D==="nbins"&&!S.sizeFound&&!S.nbinsFound&&(l=s[0],S[D]=d($))}}}},Wn=wt,w8={count:function(t,e,r){return r[t]++,1},sum:function(t,e,r,a){var i=a[e];return Wn(i)?(i=Number(i),r[t]+=i,i):0},avg:function(t,e,r,a,i){var n=a[e];return Wn(n)&&(n=Number(n),r[t]+=n,i[t]++),0},min:function(t,e,r,a){var i=a[e];if(Wn(i))if(i=Number(i),Wn(r[t])){if(r[t]>i){var n=i-r[t];return r[t]=i,n}}else return r[t]=i,i;return 0},max:function(t,e,r,a){var i=a[e];if(Wn(i))if(i=Number(i),Wn(r[t])){if(r[t]<i){var n=i-r[t];return r[t]=i,n}}else return r[t]=i,i;return 0}},T8={percent:function(t,e){for(var r=t.length,a=100/e,i=0;i<r;i++)t[i]*=a},probability:function(t,e){for(var r=t.length,a=0;a<r;a++)t[a]/=e},density:function(t,e,r,a){var i=t.length;a=a||1;for(var n=0;n<i;n++)t[n]*=r[n]*a},"probability density":function(t,e,r,a){var i=t.length;a&&(e/=a);for(var n=0;n<i;n++)t[n]*=r[n]/e}},k8=function(e,r){for(var a=e.length,i=0,n=0;n<a;n++)r[n]?(e[n]/=r[n],i+=e[n]):e[n]=null;return i},Uo=or,yn=Uo.ONEAVGYEAR,kx=Uo.ONEAVGMONTH,mc=Uo.ONEDAY,Ax=Uo.ONEHOUR,Mx=Uo.ONEMIN,Sx=Uo.ONESEC,Lx=Bt.tickIncrement,A8=function(e,r,a,i,n){var o=-1.1*r,l=-.1*r,s=e-l,f=a[0],c=a[1],v=Math.min(uf(f+l,f+s,i,n),uf(c+l,c+s,i,n)),u=Math.min(uf(f+o,f+l,i,n),uf(c+o,c+l,i,n)),h,d;if(v>u&&u<Math.abs(c-f)/4e3?(h=v,d=!1):(h=Math.min(v,u),d=!0),i.type==="date"&&h>mc){var p=h===yn?1:6,m=h===yn?"M12":"M1";return function(y,b){var w=i.c2d(y,yn,n),g=w.indexOf("-",p);g>0&&(w=w.substr(0,g));var x=i.d2c(w,0,n);if(x<y){var _=Lx(x,m,!1,n);(x+_)/2<y+e&&(x=_)}return b&&d?Lx(x,m,!0,n):x}}return function(y,b){var w=h*Math.round(y/h);return w+h/10<y&&w+h*.9<y+e&&(w+=h),b&&d&&(w-=h),w}};function uf(t,e,r,a){if(t*e<=0)return 1/0;for(var i=Math.abs(e-t),n=r.type==="date",o=Cx(i,n),l=0;l<10;l++){var s=Cx(o*80,n);if(o===s)break;if(M8(s,t,e,n,r,a))o=s;else break}return o}function Cx(t,e){return e&&t>Sx?t>mc?t>yn*1.1?yn:t>kx*1.1?kx:mc:t>Ax?Ax:t>Mx?Mx:Sx:Math.pow(10,Math.floor(Math.log(t)/Math.LN10))}function M8(t,e,r,a,i,n){if(a&&t>mc){var o=Dx(e,i,n),l=Dx(r,i,n),s=t===yn?0:1;return o[s]!==l[s]}return Math.floor(r/t)-Math.floor(e/t)>.1}function Dx(t,e,r){var a=e.c2d(t,yn,r).split("-");return a[0]===""&&(a.unshift(),a[0]="-"+a[0]),a}var ph=wt,Rr=me,$x=ot,va=Bt,S8=nm,Px=w8,L8=T8,C8=k8,D8=A8;function $8(t,e){var r=[],a=[],i=e.orientation==="h",n=va.getFromId(t,i?e.yaxis:e.xaxis),o=i?"y":"x",l={x:"y",y:"x"}[o],s=e[o+"calendar"],f=e.cumulative,c,v=fm(t,e,n,o),u=v[0],h=v[1],d=typeof u.size=="string",p=[],m=d?p:u,y=[],b=[],w=[],g=0,x=e.histnorm,_=e.histfunc,T=x.indexOf("density")!==-1,k,S,L;f.enabled&&T&&(x=x.replace(/ ?density$/,""),T=!1);var D=_==="max"||_==="min",$=D?null:0,E=Px.count,z=L8[x],O=!1,I=function(le){return n.r2c(le,0,s)},P;for(Rr.isArrayOrTypedArray(e[l])&&_!=="count"&&(P=e[l],O=_==="avg",E=Px[_]),c=I(u.start),S=I(u.end)+(c-va.tickIncrement(c,u.size,!1,s))/1e6;c<S&&r.length<1e6&&(k=va.tickIncrement(c,u.size,!1,s),r.push((c+k)/2),a.push($),w.push([]),p.push(c),T&&y.push(1/(k-c)),O&&b.push(0),!(k<=c));)c=k;p.push(c),!d&&n.type==="date"&&(m={start:I(m.start),end:I(m.end),size:m.size}),t._fullLayout._roundFnOpts||(t._fullLayout._roundFnOpts={});var M=e["_"+o+"bingroup"],A={leftGap:1/0,rightGap:1/0};M&&(t._fullLayout._roundFnOpts[M]||(t._fullLayout._roundFnOpts[M]=A),A=t._fullLayout._roundFnOpts[M]);var C=a.length,R=!0,N=A.leftGap,H=A.rightGap,B={};for(c=0;c<h.length;c++){var X=h[c];L=Rr.findBin(X,m),L>=0&&L<C&&(g+=E(L,c,a,P,b),R&&w[L].length&&X!==h[w[L][0]]&&(R=!1),w[L].push(c),B[c]=L,N=Math.min(N,X-p[L]),H=Math.min(H,p[L+1]-X))}A.leftGap=N,A.rightGap=H;var j;R||(j=function(le,ye){return function(){var se=t._fullLayout._roundFnOpts[M];return D8(se.leftGap,se.rightGap,p,n,s)(le,ye)}}),O&&(g=C8(a,b)),z&&z(a,g,y),f.enabled&&E8(a,f.direction,f.currentbin);var q=Math.min(r.length,a.length),U=[],Z=0,K=q-1;for(c=0;c<q;c++)if(a[c]){Z=c;break}for(c=q-1;c>=Z;c--)if(a[c]){K=c;break}for(c=Z;c<=K;c++)if(ph(r[c])&&ph(a[c])){var ee={p:r[c],s:a[c],b:0};f.enabled||(ee.pts=w[c],R?ee.ph0=ee.ph1=w[c].length?h[w[c][0]]:r[c]:(e._computePh=!0,ee.ph0=j(p[c]),ee.ph1=j(p[c+1],!0))),U.push(ee)}return U.length===1&&(U[0].width1=va.tickIncrement(U[0].p,u.size,!1,s)-U[0].p),S8(U,e),Rr.isArrayOrTypedArray(e.selectedpoints)&&Rr.tagSelected(U,e,B),U}function fm(t,e,r,a,i){var n=a+"bins",o=t._fullLayout,l=e["_"+a+"bingroup"],s=o._histogramBinOpts[l],f=o.barmode==="overlay",c,v,u,h,d,p,m,y=function(X){return r.r2c(X,0,h)},b=function(X){return r.c2r(X,0,h)},w=r.type==="date"?function(X){return X||X===0?Rr.cleanDate(X,null,h):null}:function(X){return ph(X)?Number(X):null};function g(X,j,q){j[X+"Found"]?(j[X]=w(j[X]),j[X]===null&&(j[X]=q[X])):(p[X]=j[X]=q[X],Rr.nestedProperty(v[0],n+"."+X).set(q[X]))}if(e["_"+a+"autoBinFinished"])delete e["_"+a+"autoBinFinished"];else{v=s.traces;var x=[],_=!0,T=!1,k=!1;for(c=0;c<v.length;c++)if(u=v[c],u.visible){var S=s.dirs[c];d=u["_"+S+"pos0"]=r.makeCalcdata(u,S),x=Rr.concat(x,d),delete u["_"+a+"autoBinFinished"],e.visible===!0&&(_?_=!1:(delete u._autoBin,u["_"+a+"autoBinFinished"]=1),$x.traceIs(u,"2dMap")&&(T=!0),u.type==="histogram2dcontour"&&(k=!0))}h=v[0][a+"calendar"];var L=va.autoBin(x,r,s.nbins,T,h,s.sizeFound&&s.size),D=v[0]._autoBin={};if(p=D[s.dirs[0]]={},k&&(s.size||(L.start=b(va.tickIncrement(y(L.start),L.size,!0,h))),s.end===void 0&&(L.end=b(va.tickIncrement(y(L.end),L.size,!1,h)))),f&&!$x.traceIs(e,"2dMap")&&L._dataSpan===0&&r.type!=="category"&&r.type!=="multicategory"&&e.bingroup===""&&typeof e.xbins>"u"){if(i)return[L,d,!0];L=P8(t,e,r,a,n)}m=u.cumulative||{},m.enabled&&m.currentbin!=="include"&&(m.direction==="decreasing"?L.start=b(va.tickIncrement(y(L.start),L.size,!0,h)):L.end=b(va.tickIncrement(y(L.end),L.size,!1,h))),s.size=L.size,s.sizeFound||(p.size=L.size,Rr.nestedProperty(v[0],n+".size").set(L.size)),g("start",s,L),g("end",s,L)}d=e["_"+a+"pos0"],delete e["_"+a+"pos0"];var $=e._input[n]||{},E=Rr.extendFlat({},s),z=s.start,O=r.r2l($.start),I=O!==void 0;if((s.startFound||I)&&O!==r.r2l(z)){var P=I?O:Rr.aggNums(Math.min,null,d),M={type:r.type==="category"||r.type==="multicategory"?"linear":r.type,r2l:r.r2l,dtick:s.size,tick0:z,calendar:h,range:[P,va.tickIncrement(P,s.size,!1,h)].map(r.l2r)},A=va.tickFirst(M);A>r.r2l(P)&&(A=va.tickIncrement(A,s.size,!0,h)),E.start=r.l2r(A),I||Rr.nestedProperty(e,n+".start").set(E.start)}var C=s.end,R=r.r2l($.end),N=R!==void 0;if((s.endFound||N)&&R!==r.r2l(C)){var H=N?R:Rr.aggNums(Math.max,null,d);E.end=r.l2r(H),N||Rr.nestedProperty(e,n+".start").set(E.end)}var B="autobin"+a;return e._input[B]===!1&&(e._input[n]=Rr.extendFlat({},e[n]||{}),delete e._input[B],delete e[B]),[E,d]}function P8(t,e,r,a,i){var n=t._fullLayout,o=R8(t,e),l=!1,s=1/0,f=[e],c,v,u;for(c=0;c<o.length;c++)if(v=o[c],v===e)l=!0;else if(!l)u=n._histogramBinOpts[v["_"+a+"bingroup"]],s=Math.min(s,u.size||v[i].size);else{var h=fm(t,v,r,a,!0),d=h[0],p=h[2];v["_"+a+"autoBinFinished"]=1,v["_"+a+"pos0"]=h[1],p?f.push(v):s=Math.min(s,d.size)}var m=new Array(f.length);for(c=0;c<f.length;c++)for(var y=f[c]["_"+a+"pos0"],b=0;b<y.length;b++)if(y[b]!==void 0){m[c]=y[b];break}for(isFinite(s)||(s=Rr.distinctVals(m).minDiff),c=0;c<f.length;c++){v=f[c];var w=v[a+"calendar"],g={start:r.c2r(m[c]-s/2,0,w),end:r.c2r(m[c]+s/2,0,w),size:s};v._input[i]=v[i]=g,u=n._histogramBinOpts[v["_"+a+"bingroup"]],u&&Rr.extendFlat(u,g)}return e[i]}function R8(t,e){for(var r=e.xaxis,a=e.yaxis,i=e.orientation,n=[],o=t._fullData,l=0;l<o.length;l++){var s=o[l];s.type==="histogram"&&s.visible===!0&&s.orientation===i&&s.xaxis===r&&s.yaxis===a&&n.push(s)}return n}function E8(t,e,r){var a,i,n;function o(s){n=t[s],t[s]/=2}function l(s){i=t[s],t[s]=n+i/2,n+=i}if(r==="half")if(e==="increasing")for(o(0),a=1;a<t.length;a++)l(a);else for(o(t.length-1),a=t.length-2;a>=0;a--)l(a);else if(e==="increasing"){for(a=1;a<t.length;a++)t[a]+=t[a-1];r==="exclude"&&(t.unshift(0),t.pop())}else{for(a=t.length-2;a>=0;a--)t[a]+=t[a+1];r==="exclude"&&(t.push(0),t.shift())}}var z8={calc:$8,calcAllAutoBins:fm},I8=nA.hoverPoints,F8=Bt.hoverLabelText,N8=function(e,r,a,i,n){var o=I8(e,r,a,i,n);if(o){e=o[0];var l=e.cd[e.index],s=e.cd[0].trace;if(!s.cumulative.enabled){var f=s.orientation==="h"?"y":"x";e[f+"Label"]=F8(e[f+"a"],[l.ph0,l.ph1],s[f+"hoverformat"])}return o}},H8=function(e,r,a,i,n){if(e.x="xVal"in r?r.xVal:r.x,e.y="yVal"in r?r.yVal:r.y,"zLabelVal"in r&&(e.z=r.zLabelVal),r.xa&&(e.xaxis=r.xa),r.ya&&(e.yaxis=r.ya),!(a.cumulative||{}).enabled){var o=Array.isArray(n)?i[0].pts[n[0]][n[1]]:i[n].pts;e.pointNumbers=o,e.binNumber=e.pointNumber,delete e.pointNumber,delete e.pointIndex;var l;if(a._indexToPoints){l=[];for(var s=0;s<o.length;s++)l=l.concat(a._indexToPoints[o[s]])}else l=o;e.pointIndices=l}return e},O8={attributes:lA,layoutAttributes:im,supplyDefaults:y8,crossTraceDefaults:_8,supplyLayoutDefaults:Nk,calc:z8.calc,crossTraceCalc:Vp.crossTraceCalc,plot:sm.plot,layerName:"barlayer",style:_n.style,styleOnSelect:_n.styleOnSelect,colorbar:ps,hoverPoints:N8,selectPoints:oA,eventData:H8,moduleType:"trace",name:"histogram",basePlotModule:ur,categories:["bar-like","cartesian","svg","bar","histogram","oriented","errorBarsOK","showLegend"],meta:{description:["The sample data from which statistics are computed is set in `x`","for vertically spanning histograms and","in `y` for horizontally spanning histograms.","Binning options are set `xbins` and `ybins` respectively","if no aggregation data is provided."].join(" ")}},j8=O8;const Gj=Fi(j8);var B8=ba,G8=Vi.attributes,U8=Mr,V8=zr,X8=Dr.hovertemplateAttrs,Y8=Dr.texttemplateAttrs,qn=Qt.extendFlat,W8=ra.pattern,hl=U8({editType:"plot",arrayOk:!0,colorEditType:"plot",description:"Sets the font used for `textinfo`."}),uu={labels:{valType:"data_array",editType:"calc",description:["Sets the sector labels.","If `labels` entries are duplicated, we sum associated `values`","or simply count occurrences if `values` is not provided.","For other array attributes (including color) we use the first","non-empty entry among all occurrences of the label."].join(" ")},label0:{valType:"number",dflt:0,editType:"calc",description:["Alternate to `labels`.","Builds a numeric set of labels.","Use with `dlabel`","where `label0` is the starting label and `dlabel` the step."].join(" ")},dlabel:{valType:"number",dflt:1,editType:"calc",description:"Sets the label step. See `label0` for more info."},values:{valType:"data_array",editType:"calc",description:["Sets the values of the sectors.","If omitted, we count occurrences of each label."].join(" ")},marker:{colors:{valType:"data_array",editType:"calc",description:["Sets the color of each sector.","If not specified, the default trace color set is used","to pick the sector colors."].join(" ")},line:{color:{valType:"color",dflt:V8.defaultLine,arrayOk:!0,editType:"style",description:["Sets the color of the line enclosing each sector."].join(" ")},width:{valType:"number",min:0,dflt:0,arrayOk:!0,editType:"style",description:["Sets the width (in px) of the line enclosing each sector."].join(" ")},editType:"calc"},pattern:W8,editType:"calc"},text:{valType:"data_array",editType:"plot",description:["Sets text elements associated with each sector.","If trace `textinfo` contains a *text* flag, these elements will be seen","on the chart.","If trace `hoverinfo` contains a *text* flag and *hovertext* is not set,","these elements will be seen in the hover labels."].join(" ")},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"style",description:["Sets hover text elements associated with each sector.","If a single string, the same string appears for","all data points.","If an array of string, the items are mapped in order of","this trace's sectors.","To be seen, trace `hoverinfo` must contain a *text* flag."].join(" ")},scalegroup:{valType:"string",dflt:"",editType:"calc",description:["If there are multiple pie charts that should be sized according to","their totals, link them by providing a non-empty group id here","shared by every trace in the same group."].join(" ")},textinfo:{valType:"flaglist",flags:["label","text","value","percent"],extras:["none"],editType:"calc",description:["Determines which trace information appear on the graph."].join(" ")},hoverinfo:qn({},B8.hoverinfo,{flags:["label","text","value","percent","name"]}),hovertemplate:X8({},{keys:["label","color","value","percent","text"]}),texttemplate:Y8({editType:"plot"},{keys:["label","color","value","percent","text"]}),textposition:{valType:"enumerated",values:["inside","outside","auto","none"],dflt:"auto",arrayOk:!0,editType:"plot",description:["Specifies the location of the `textinfo`."].join(" ")},textfont:qn({},hl,{description:"Sets the font used for `textinfo`."}),insidetextorientation:{valType:"enumerated",values:["horizontal","radial","tangential","auto"],dflt:"auto",editType:"plot",description:["Controls the orientation of the text inside chart sectors.","When set to *auto*, text may be oriented in any direction in order","to be as big as possible in the middle of a sector.","The *horizontal* option orients text to be parallel with the bottom","of the chart, and may make text smaller in order to achieve that goal.","The *radial* option orients text along the radius of the sector.","The *tangential* option orients text perpendicular to the radius of the sector."].join(" ")},insidetextfont:qn({},hl,{description:"Sets the font used for `textinfo` lying inside the sector."}),outsidetextfont:qn({},hl,{description:"Sets the font used for `textinfo` lying outside the sector."}),automargin:{valType:"boolean",dflt:!1,editType:"plot",description:["Determines whether outside text labels can push the margins."].join(" ")},title:{text:{valType:"string",dflt:"",editType:"plot",description:["Sets the title of the chart.","If it is empty, no title is displayed.","Note that before the existence of `title.text`, the title's","contents used to be defined as the `title` attribute itself.","This behavior has been deprecated."].join(" ")},font:qn({},hl,{description:["Sets the font used for `title`.","Note that the title's font used to be set","by the now deprecated `titlefont` attribute."].join(" ")}),position:{valType:"enumerated",values:["top left","top center","top right","middle center","bottom left","bottom center","bottom right"],editType:"plot",description:["Specifies the location of the `title`.","Note that the title's position used to be set","by the now deprecated `titleposition` attribute."].join(" ")},editType:"plot"},domain:G8({name:"pie",trace:!0,editType:"calc"}),hole:{valType:"number",min:0,max:1,dflt:0,editType:"calc",description:["Sets the fraction of the radius to cut out of the pie.","Use this to make a donut chart."].join(" ")},sort:{valType:"boolean",dflt:!0,editType:"calc",description:["Determines whether or not the sectors are reordered","from largest to smallest."].join(" ")},direction:{valType:"enumerated",values:["clockwise","counterclockwise"],dflt:"counterclockwise",editType:"calc",description:["Specifies the direction at which succeeding sectors follow","one another."].join(" ")},rotation:{valType:"angle",dflt:0,editType:"calc",description:["Instead of the first slice starting at 12 o'clock,","rotate to some other angle."].join(" ")},pull:{valType:"number",min:0,max:1,dflt:0,arrayOk:!0,editType:"calc",description:["Sets the fraction of larger radius to pull the sectors","out from the center. This can be a constant","to pull all slices apart from each other equally","or an array to highlight one or more slices."].join(" ")},_deprecated:{title:{valType:"string",dflt:"",editType:"calc",description:["Deprecated in favor of `title.text`.","Note that value of `title` is no longer a simple","*string* but a set of sub-attributes."].join(" ")},titlefont:qn({},hl,{description:"Deprecated in favor of `title.font`."}),titleposition:{valType:"enumerated",values:["top left","top center","top right","middle center","bottom left","bottom center","bottom right"],editType:"calc",description:"Deprecated in favor of `title.position`."}}},q8=wt,mh=me,Z8=uu,K8=Vi.defaults,Q8=es.handleText,J8=me.coercePattern;function sA(t,e){var r=Array.isArray(t),a=mh.isArrayOrTypedArray(e),i=Math.min(r?t.length:1/0,a?e.length:1/0);if(isFinite(i)||(i=0),i&&a){for(var n,o=0;o<i;o++){var l=e[o];if(q8(l)&&l>0){n=!0;break}}n||(i=0)}return{hasLabels:r,hasValues:a,len:i}}function fA(t,e,r,a,i){var n=a("marker.line.width");n&&a("marker.line.color",i?void 0:r.paper_bgcolor);var o=a("marker.colors");J8(a,"marker.pattern",o),t.marker&&!e.marker.pattern.fgcolor&&(e.marker.pattern.fgcolor=t.marker.colors),e.marker.pattern.bgcolor||(e.marker.pattern.bgcolor=r.paper_bgcolor)}function eH(t,e,r,a){function i(b,w){return mh.coerce(t,e,Z8,b,w)}var n=i("labels"),o=i("values"),l=sA(n,o),s=l.len;if(e._hasLabels=l.hasLabels,e._hasValues=l.hasValues,!e._hasLabels&&e._hasValues&&(i("label0"),i("dlabel")),!s){e.visible=!1;return}e._length=s,fA(t,e,a,i,!0),i("scalegroup");var f=i("text"),c=i("texttemplate"),v;if(c||(v=i("textinfo",Array.isArray(f)?"text+percent":"percent")),i("hovertext"),i("hovertemplate"),c||v&&v!=="none"){var u=i("textposition");Q8(t,e,a,i,u,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1});var h=Array.isArray(u)||u==="auto",d=h||u==="outside";d&&i("automargin"),(u==="inside"||u==="auto"||Array.isArray(u))&&i("insidetextorientation")}K8(e,a,i);var p=i("hole"),m=i("title.text");if(m){var y=i("title.position",p?"middle center":"top center");!p&&y==="middle center"&&(e.title.position="top center"),mh.coerceFont(i,"title.font",a.font)}i("sort"),i("direction"),i("rotation"),i("pull")}var cA={handleLabelsAndValues:sA,handleMarkerDefaults:fA,supplyDefaults:eH},uA={hiddenlabels:{valType:"data_array",editType:"calc",description:["hiddenlabels is the funnelarea & pie chart analog of","visible:'legendonly'","but it can contain many labels, and can simultaneously","hide slices from several pies/funnelarea charts"].join(" ")},piecolorway:{valType:"colorlist",editType:"calc",description:["Sets the default pie slice colors. Defaults to the main","`colorway` used for trace colors. If you specify a new","list here it can still be extended with lighter and darker","colors, see `extendpiecolors`."].join(" ")},extendpiecolors:{valType:"boolean",dflt:!0,editType:"calc",description:["If `true`, the pie slice colors (whether given by `piecolorway` or","inherited from `colorway`) will be extended to three times its","original length by first repeating every color 20% lighter then","each color 20% darker. This is intended to reduce the likelihood","of reusing the same color when you have many slices, but you can","set `false` to disable.","Colors provided in the trace, using `marker.colors`, are never","extended."].join(" ")}},tH=me,rH=uA,aH=function(e,r){function a(i,n){return tH.coerce(e,r,rH,i,n)}a("hiddenlabels"),a("piecolorway",r.colorway),a("extendpiecolors")},iH=wt,yh=ga,nH=ht,oH={};function lH(t,e){var r=[],a=t._fullLayout,i=a.hiddenlabels||[],n=e.labels,o=e.marker.colors||[],l=e.values,s=e._length,f=e._hasValues&&s,c,v;if(e.dlabel)for(n=new Array(s),c=0;c<s;c++)n[c]=String(e.label0+c*e.dlabel);var u={},h=vA(a["_"+e.type+"colormap"]),d=0,p=!1;for(c=0;c<s;c++){var m,y,b;if(f){if(m=l[c],!iH(m))continue;m=+m}else m=1;y=n[c],(y===void 0||y==="")&&(y=c),y=String(y);var w=u[y];w===void 0?(u[y]=r.length,b=i.indexOf(y)!==-1,b||(d+=m),r.push({v:m,label:y,color:h(o[c],y),i:c,pts:[c],hidden:b})):(p=!0,v=r[w],v.v+=m,v.pts.push(c),v.hidden||(d+=m),v.color===!1&&o[c]&&(v.color=h(o[c],y)))}r=r.filter(function(x){return x.v>=0});var g=e.type==="funnelarea"?p:e.sort;return g&&r.sort(function(x,_){return _.v-x.v}),r[0]&&(r[0].vTotal=d),r}function vA(t){return function(r,a){return!r||(r=yh(r),!r.isValid())?!1:(r=nH.addOpacity(r,r.getAlpha()),t[a]||(t[a]=r),r)}}function sH(t,e){var r=(e||{}).type;r||(r="pie");var a=t._fullLayout,i=t.calcdata,n=a[r+"colorway"],o=a["_"+r+"colormap"];a["extend"+r+"colors"]&&(n=dA(n,oH));for(var l=0,s=0;s<i.length;s++){var f=i[s],c=f[0].trace.type;if(c===r)for(var v=0;v<f.length;v++){var u=f[v];u.color===!1&&(o[u.label]?u.color=o[u.label]:(o[u.label]=u.color=n[l%n.length],l++))}}}function dA(t,e){var r,a=JSON.stringify(t),i=e[a];if(!i){for(i=t.slice(),r=0;r<t.length;r++)i.push(yh(t[r]).lighten(20).toHexString());for(r=0;r<t.length;r++)i.push(yh(t[r]).darken(20).toHexString());e[a]=i}return i}var yc={calc:lH,crossTraceCalc:sH,makePullColorFn:vA,generateExtendedColors:dA},fH=xa.appendArrayMultiPointValues,cH=function(e,r){var a={curveNumber:r.index,pointNumbers:e.pts,data:r._input,fullData:r,label:e.label,color:e.color,value:e.v,percent:e.percent,text:e.text,bbox:e.bbox,v:e.v};return e.pts.length===1&&(a.pointNumber=a.i=e.pts[0]),fH(a,r,e.pts),r.type==="funnelarea"&&(delete a.v,delete a.i),a},Zr=gt,uH=cr,vf=Ia,hA=ht,ni=$t,Er=me,vH=Er.strScale,Rx=Er.strTranslate,gh=br,pA=vi,dH=pA.recordMinTextSize,hH=pA.clearMinTextSize,mA=ys.TEXTPAD,Ft=Cn,df=cH,Ex=me.isValidTextValue;function pH(t,e){var r=t._context.staticPlot,a=t._fullLayout,i=a._size;hH("pie",a),bA(e,t),MA(e,i);var n=Er.makeTraceGroups(a._pielayer,e,"trace").each(function(o){var l=Zr.select(this),s=o[0],f=s.trace;kH(o),l.attr("stroke-linejoin","round"),l.each(function(){var c=Zr.select(this).selectAll("g.slice").data(o);c.enter().append("g").classed("slice",!0),c.exit().remove();var v=[[[],[]],[[],[]]],u=!1;c.each(function(g,x){if(g.hidden){Zr.select(this).selectAll("path,g").remove();return}g.pointNumber=g.i,g.curveNumber=f.index,v[g.pxmid[1]<0?0:1][g.pxmid[0]<0?0:1].push(g);var _=s.cx,T=s.cy,k=Zr.select(this),S=k.selectAll("path.surface").data([g]);if(S.enter().append("path").classed("surface",!0).style({"pointer-events":r?"none":"all"}),k.call(yA,t,o),f.pull){var L=+Ft.castOption(f.pull,g.pts)||0;L>0&&(_+=L*g.pxmid[0],T+=L*g.pxmid[1])}g.cxFinal=_,g.cyFinal=T;function D(M,A,C,R){var N=R*(A[0]-M[0]),H=R*(A[1]-M[1]);return"a"+R*s.r+","+R*s.r+" 0 "+g.largeArc+(C?" 1 ":" 0 ")+N+","+H}var $=f.hole;if(g.v===s.vTotal){var E="M"+(_+g.px0[0])+","+(T+g.px0[1])+D(g.px0,g.pxmid,!0,1)+D(g.pxmid,g.px0,!0,1)+"Z";$?S.attr("d","M"+(_+$*g.px0[0])+","+(T+$*g.px0[1])+D(g.px0,g.pxmid,!1,$)+D(g.pxmid,g.px0,!1,$)+"Z"+E):S.attr("d",E)}else{var z=D(g.px0,g.px1,!0,1);if($){var O=1-$;S.attr("d","M"+(_+$*g.px1[0])+","+(T+$*g.px1[1])+D(g.px1,g.px0,!1,$)+"l"+O*g.px0[0]+","+O*g.px0[1]+z+"Z")}else S.attr("d","M"+_+","+T+"l"+g.px0[0]+","+g.px0[1]+z+"Z")}SA(t,g,s);var I=Ft.castOption(f.textposition,g.pts),P=k.selectAll("g.slicetext").data(g.text&&I!=="none"?[0]:[]);P.enter().append("g").classed("slicetext",!0),P.exit().remove(),P.each(function(){var M=Er.ensureSingle(Zr.select(this),"text","",function(j){j.attr("data-notex",1)}),A=Er.ensureUniformFontSize(t,I==="outside"?yH(f,g,a.font):gA(f,g,a.font));M.text(g.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(ni.font,A).call(gh.convertToTspans,t);var C=ni.bBox(M.node()),R;if(I==="outside")R=Fx(C,g);else if(R=xA(C,g,s),I==="auto"&&R.scale<1){var N=Er.ensureUniformFontSize(t,f.outsidetextfont);M.call(ni.font,N),C=ni.bBox(M.node()),R=Fx(C,g)}var H=R.textPosAngle,B=H===void 0?g.pxmid:If(s.r,H);if(R.targetX=_+B[0]*R.rCenter+(R.x||0),R.targetY=T+B[1]*R.rCenter+(R.y||0),LA(R,C),R.outside){var X=R.targetY;g.yLabelMin=X-C.height/2,g.yLabelMid=X,g.yLabelMax=X+C.height/2,g.labelExtraX=0,g.labelExtraY=0,u=!0}R.fontSize=A.size,dH(f.type,R,a),o[x].transform=R,Er.setTransormAndDisplay(M,R)})});var h=Zr.select(this).selectAll("g.titletext").data(f.title.text?[0]:[]);if(h.enter().append("g").classed("titletext",!0),h.exit().remove(),h.each(function(){var g=Er.ensureSingle(Zr.select(this),"text","",function(T){T.attr("data-notex",1)}),x=f.title.text;f._meta&&(x=Er.templateString(x,f._meta)),g.text(x).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(ni.font,f.title.font).call(gh.convertToTspans,t);var _;f.title.position==="middle center"?_=xH(s):_=kA(s,i),g.attr("transform",Rx(_.x,_.y)+vH(Math.min(1,_.scale))+Rx(_.tx,_.ty))}),u&&wH(v,f),mH(c,f),u&&f.automargin){var d=ni.bBox(l.node()),p=f.domain,m=i.w*(p.x[1]-p.x[0]),y=i.h*(p.y[1]-p.y[0]),b=(.5*m-s.r)/i.w,w=(.5*y-s.r)/i.h;uH.autoMargin(t,"pie."+f.uid+".automargin",{xl:p.x[0]-b,xr:p.x[1]+b,yb:p.y[0]-w,yt:p.y[1]+w,l:Math.max(s.cx-s.r-d.left,0),r:Math.max(d.right-(s.cx+s.r),0),b:Math.max(d.bottom-(s.cy+s.r),0),t:Math.max(s.cy-s.r-d.top,0),pad:5})}})});setTimeout(function(){n.selectAll("tspan").each(function(){var o=Zr.select(this);o.attr("dy")&&o.attr("dy",o.attr("dy"))})},0)}function mH(t,e){t.each(function(r){var a=Zr.select(this);if(!r.labelExtraX&&!r.labelExtraY){a.select("path.textline").remove();return}var i=a.select("g.slicetext text");r.transform.targetX+=r.labelExtraX,r.transform.targetY+=r.labelExtraY,Er.setTransormAndDisplay(i,r.transform);var n=r.cxFinal+r.pxmid[0],o=r.cyFinal+r.pxmid[1],l="M"+n+","+o,s=(r.yLabelMax-r.yLabelMin)*(r.pxmid[0]<0?-1:1)/4;if(r.labelExtraX){var f=r.labelExtraX*r.pxmid[1]/r.pxmid[0],c=r.yLabelMid+r.labelExtraY-(r.cyFinal+r.pxmid[1]);Math.abs(f)>Math.abs(c)?l+="l"+c*r.pxmid[0]/r.pxmid[1]+","+c+"H"+(n+r.labelExtraX+s):l+="l"+r.labelExtraX+","+f+"v"+(c-f)+"h"+s}else l+="V"+(r.yLabelMid+r.labelExtraY)+"h"+s;Er.ensureSingle(a,"path","textline").call(hA.stroke,e.outsidetextfont.color).attr({"stroke-width":Math.min(2,e.outsidetextfont.size/8),d:l,fill:"none"})})}function yA(t,e,r){var a=r[0],i=a.cx,n=a.cy,o=a.trace,l=o.type==="funnelarea";"_hasHoverLabel"in o||(o._hasHoverLabel=!1),"_hasHoverEvent"in o||(o._hasHoverEvent=!1),t.on("mouseover",function(s){var f=e._fullLayout,c=e._fullData[o.index];if(!(e._dragging||f.hovermode===!1)){var v=c.hoverinfo;if(Array.isArray(v)&&(v=vf.castHoverinfo({hoverinfo:[Ft.castOption(v,s.pts)],_module:o._module},f,0)),v==="all"&&(v="label+text+value+percent+name"),c.hovertemplate||v!=="none"&&v!=="skip"&&v){var u=s.rInscribed||0,h=i+s.pxmid[0]*(1-u),d=n+s.pxmid[1]*(1-u),p=f.separators,m=[];if(v&&v.indexOf("label")!==-1&&m.push(s.label),s.text=Ft.castOption(c.hovertext||c.text,s.pts),v&&v.indexOf("text")!==-1){var y=s.text;Er.isValidTextValue(y)&&m.push(y)}s.value=s.v,s.valueLabel=Ft.formatPieValue(s.v,p),v&&v.indexOf("value")!==-1&&m.push(s.valueLabel),s.percent=s.v/a.vTotal,s.percentLabel=Ft.formatPiePercent(s.percent,p),v&&v.indexOf("percent")!==-1&&m.push(s.percentLabel);var b=c.hoverlabel,w=b.font,g=[];vf.loneHover({trace:o,x0:h-u*a.r,x1:h+u*a.r,y:d,_x0:l?i+s.TL[0]:h-u*a.r,_x1:l?i+s.TR[0]:h+u*a.r,_y0:l?n+s.TL[1]:d-u*a.r,_y1:l?n+s.BL[1]:d+u*a.r,text:m.join("<br>"),name:c.hovertemplate||v.indexOf("name")!==-1?c.name:void 0,idealAlign:s.pxmid[0]<0?"left":"right",color:Ft.castOption(b.bgcolor,s.pts)||s.color,borderColor:Ft.castOption(b.bordercolor,s.pts),fontFamily:Ft.castOption(w.family,s.pts),fontSize:Ft.castOption(w.size,s.pts),fontColor:Ft.castOption(w.color,s.pts),nameLength:Ft.castOption(b.namelength,s.pts),textAlign:Ft.castOption(b.align,s.pts),hovertemplate:Ft.castOption(c.hovertemplate,s.pts),hovertemplateLabels:s,eventData:[df(s,c)]},{container:f._hoverlayer.node(),outerContainer:f._paper.node(),gd:e,inOut_bbox:g}),s.bbox=g[0],o._hasHoverLabel=!0}o._hasHoverEvent=!0,e.emit("plotly_hover",{points:[df(s,c)],event:Zr.event})}}),t.on("mouseout",function(s){var f=e._fullLayout,c=e._fullData[o.index],v=Zr.select(this).datum();o._hasHoverEvent&&(s.originalEvent=Zr.event,e.emit("plotly_unhover",{points:[df(v,c)],event:Zr.event}),o._hasHoverEvent=!1),o._hasHoverLabel&&(vf.loneUnhover(f._hoverlayer.node()),o._hasHoverLabel=!1)}),t.on("click",function(s){var f=e._fullLayout,c=e._fullData[o.index];e._dragging||f.hovermode===!1||(e._hoverdata=[df(s,c)],vf.click(e,Zr.event))})}function yH(t,e,r){var a=Ft.castOption(t.outsidetextfont.color,e.pts)||Ft.castOption(t.textfont.color,e.pts)||r.color,i=Ft.castOption(t.outsidetextfont.family,e.pts)||Ft.castOption(t.textfont.family,e.pts)||r.family,n=Ft.castOption(t.outsidetextfont.size,e.pts)||Ft.castOption(t.textfont.size,e.pts)||r.size;return{color:a,family:i,size:n}}function gA(t,e,r){var a=Ft.castOption(t.insidetextfont.color,e.pts);!a&&t._input.textfont&&(a=Ft.castOption(t._input.textfont.color,e.pts));var i=Ft.castOption(t.insidetextfont.family,e.pts)||Ft.castOption(t.textfont.family,e.pts)||r.family,n=Ft.castOption(t.insidetextfont.size,e.pts)||Ft.castOption(t.textfont.size,e.pts)||r.size;return{color:a||hA.contrast(e.color),family:i,size:n}}function bA(t,e){for(var r,a,i=0;i<t.length;i++)if(r=t[i][0],a=r.trace,a.title.text){var n=a.title.text;a._meta&&(n=Er.templateString(n,a._meta));var o=ni.tester.append("text").attr("data-notex",1).text(n).call(ni.font,a.title.font).call(gh.convertToTspans,e),l=ni.bBox(o.node(),!0);r.titleBox={width:l.width,height:l.height},o.remove()}}function xA(t,e,r){var a=r.r||e.rpx1,i=e.rInscribed,n=e.startangle===e.stopangle;if(n)return{rCenter:1-i,scale:0,rotate:0,textPosAngle:0};var o=e.ring,l=o===1&&Math.abs(e.startangle-e.stopangle)===Math.PI*2,s=e.halfangle,f=e.midangle,c=r.trace.insidetextorientation,v=c==="horizontal",u=c==="tangential",h=c==="radial",d=c==="auto",p=[],m;if(!d){var y=function(k,S){if(gH(e,k)){var L=Math.abs(k-e.startangle),D=Math.abs(k-e.stopangle),$=L<D?L:D;S==="tan"?m=Ix(t,a,o,$,0):m=zx(t,a,o,$,Math.PI/2),m.textPosAngle=k,p.push(m)}},b;if(v||u){for(b=4;b>=-4;b-=2)y(Math.PI*b,"tan");for(b=4;b>=-4;b-=2)y(Math.PI*(b+1),"tan")}if(v||h){for(b=4;b>=-4;b-=2)y(Math.PI*(b+1.5),"rad");for(b=4;b>=-4;b-=2)y(Math.PI*(b+.5),"rad")}}if(l||d||v){var w=Math.sqrt(t.width*t.width+t.height*t.height);if(m={scale:i*a*2/w,rCenter:1-i,rotate:0},m.textPosAngle=(e.startangle+e.stopangle)/2,m.scale>=1)return m;p.push(m)}(d||h)&&(m=zx(t,a,o,s,f),m.textPosAngle=(e.startangle+e.stopangle)/2,p.push(m)),(d||u)&&(m=Ix(t,a,o,s,f),m.textPosAngle=(e.startangle+e.stopangle)/2,p.push(m));for(var g=0,x=0,_=0;_<p.length;_++){var T=p[_].scale;if(x<T&&(x=T,g=_),!d&&x>=1)break}return p[g]}function gH(t,e){var r=t.startangle,a=t.stopangle;return r>e&&e>a||r<e&&e<a}function zx(t,e,r,a,i){e=Math.max(0,e-2*mA);var n=t.width/t.height,o=TA(n,a,e,r);return{scale:o*2/t.height,rCenter:_A(n,o/e),rotate:wA(i)}}function Ix(t,e,r,a,i){e=Math.max(0,e-2*mA);var n=t.height/t.width,o=TA(n,a,e,r);return{scale:o*2/t.width,rCenter:_A(n,o/e),rotate:wA(i+Math.PI/2)}}function _A(t,e){return Math.cos(e)-t*e}function wA(t){return(180/Math.PI*t+720)%180-90}function TA(t,e,r,a){var i=t+1/(2*Math.tan(e));return r*Math.min(1/(Math.sqrt(i*i+.5)+i),a/(Math.sqrt(t*t+a/2)+t))}function bH(t,e){return t.v===e.vTotal&&!e.trace.hole?1:Math.min(1/(1+1/Math.sin(t.halfangle)),t.ring/2)}function Fx(t,e){var r=e.pxmid[0],a=e.pxmid[1],i=t.width/2,n=t.height/2;return r<0&&(i*=-1),a<0&&(n*=-1),{scale:1,rCenter:1,rotate:0,x:i+Math.abs(n)*(i>0?1:-1)/2,y:n/(1+r*r/(a*a)),outside:!0}}function xH(t){var e=Math.sqrt(t.titleBox.width*t.titleBox.width+t.titleBox.height*t.titleBox.height);return{x:t.cx,y:t.cy,scale:t.trace.hole*t.r*2/e,tx:0,ty:-t.titleBox.height/2+t.trace.title.font.size}}function kA(t,e){var r=1,a=1,i,n=t.trace,o={x:t.cx,y:t.cy},l={tx:0,ty:0};l.ty+=n.title.font.size,i=AA(n),n.title.position.indexOf("top")!==-1?(o.y-=(1+i)*t.r,l.ty-=t.titleBox.height):n.title.position.indexOf("bottom")!==-1&&(o.y+=(1+i)*t.r);var s=_H(t.r,t.trace.aspectratio),f=e.w*(n.domain.x[1]-n.domain.x[0])/2;return n.title.position.indexOf("left")!==-1?(f=f+s,o.x-=(1+i)*s,l.tx+=t.titleBox.width/2):n.title.position.indexOf("center")!==-1?f*=2:n.title.position.indexOf("right")!==-1&&(f=f+s,o.x+=(1+i)*s,l.tx-=t.titleBox.width/2),r=f/t.titleBox.width,a=bh(t,e)/t.titleBox.height,{x:o.x,y:o.y,scale:Math.min(r,a),tx:l.tx,ty:l.ty}}function _H(t,e){return t/(e===void 0?1:e)}function bh(t,e){var r=t.trace,a=e.h*(r.domain.y[1]-r.domain.y[0]);return Math.min(t.titleBox.height,a/2)}function AA(t){var e=t.pull;if(!e)return 0;var r;if(Array.isArray(e))for(e=0,r=0;r<t.pull.length;r++)t.pull[r]>e&&(e=t.pull[r]);return e}function wH(t,e){var r,a,i,n,o,l,s,f,c,v,u,h,d;function p(w,g){return w.pxmid[1]-g.pxmid[1]}function m(w,g){return g.pxmid[1]-w.pxmid[1]}function y(w,g){g||(g={});var x=g.labelExtraY+(a?g.yLabelMax:g.yLabelMin),_=a?w.yLabelMin:w.yLabelMax,T=a?w.yLabelMax:w.yLabelMin,k=w.cyFinal+o(w.px0[1],w.px1[1]),S=x-_,L,D,$,E,z,O;if(S*s>0&&(w.labelExtraY=S),!!Array.isArray(e.pull))for(D=0;D<v.length;D++)$=v[D],!($===w||(Ft.castOption(e.pull,w.pts)||0)>=(Ft.castOption(e.pull,$.pts)||0))&&((w.pxmid[1]-$.pxmid[1])*s>0?(E=$.cyFinal+o($.px0[1],$.px1[1]),S=E-_-w.labelExtraY,S*s>0&&(w.labelExtraY+=S)):(T+w.labelExtraY-k)*s>0&&(L=3*l*Math.abs(D-v.indexOf(w)),z=$.cxFinal+n($.px0[0],$.px1[0]),O=z+L-(w.cxFinal+w.pxmid[0])-w.labelExtraX,O*l>0&&(w.labelExtraX+=O)))}for(a=0;a<2;a++)for(i=a?p:m,o=a?Math.max:Math.min,s=a?1:-1,r=0;r<2;r++){for(n=r?Math.max:Math.min,l=r?1:-1,f=t[a][r],f.sort(i),c=t[1-a][r],v=c.concat(f),h=[],u=0;u<f.length;u++)f[u].yLabelMid!==void 0&&h.push(f[u]);for(d=!1,u=0;a&&u<c.length;u++)if(c[u].yLabelMid!==void 0){d=c[u];break}for(u=0;u<h.length;u++){var b=u&&h[u-1];d&&!u&&(b=d),y(h[u],b)}}}function MA(t,e){for(var r=[],a=0;a<t.length;a++){var i=t[a][0],n=i.trace,o=n.domain,l=e.w*(o.x[1]-o.x[0]),s=e.h*(o.y[1]-o.y[0]);n.title.text&&n.title.position!=="middle center"&&(s-=bh(i,e));var f=l/2,c=s/2;n.type==="funnelarea"&&!n.scalegroup&&(c/=n.aspectratio),i.r=Math.min(f,c)/(1+AA(n)),i.cx=e.l+e.w*(n.domain.x[1]+n.domain.x[0])/2,i.cy=e.t+e.h*(1-n.domain.y[0])-s/2,n.title.text&&n.title.position.indexOf("bottom")!==-1&&(i.cy-=bh(i,e)),n.scalegroup&&r.indexOf(n.scalegroup)===-1&&r.push(n.scalegroup)}TH(t,r)}function TH(t,e){for(var r,a,i,n=0;n<e.length;n++){var o=1/0,l=e[n];for(a=0;a<t.length;a++)if(r=t[a][0],i=r.trace,i.scalegroup===l){var s;if(i.type==="pie")s=r.r*r.r;else if(i.type==="funnelarea"){var f,c;i.aspectratio>1?(f=r.r,c=f/i.aspectratio):(c=r.r,f=c*i.aspectratio),f*=(1+i.baseratio)/2,s=f*c}o=Math.min(o,s/r.vTotal)}for(a=0;a<t.length;a++)if(r=t[a][0],i=r.trace,i.scalegroup===l){var v=o*r.vTotal;i.type==="funnelarea"&&(v/=(1+i.baseratio)/2,v/=i.aspectratio),r.r=Math.sqrt(v)}}}function kH(t){var e=t[0],r=e.r,a=e.trace,i=Ft.getRotationAngle(a.rotation),n=2*Math.PI/e.vTotal,o="px0",l="px1",s,f,c;if(a.direction==="counterclockwise"){for(s=0;s<t.length&&t[s].hidden;s++);if(s===t.length)return;i+=n*t[s].v,n*=-1,o="px1",l="px0"}for(c=If(r,i),s=0;s<t.length;s++)f=t[s],!f.hidden&&(f[o]=c,f.startangle=i,i+=n*f.v/2,f.pxmid=If(r,i),f.midangle=i,i+=n*f.v/2,c=If(r,i),f.stopangle=i,f[l]=c,f.largeArc=f.v>e.vTotal/2?1:0,f.halfangle=Math.PI*Math.min(f.v/e.vTotal,.5),f.ring=1-a.hole,f.rInscribed=bH(f,e))}function If(t,e){return[t*Math.sin(e),-t*Math.cos(e)]}function SA(t,e,r){var a=t._fullLayout,i=r.trace,n=i.texttemplate,o=i.textinfo;if(!n&&o&&o!=="none"){var l=o.split("+"),s=function(g){return l.indexOf(g)!==-1},f=s("label"),c=s("text"),v=s("value"),u=s("percent"),h=a.separators,d;if(d=f?[e.label]:[],c){var p=Ft.getFirstFilled(i.text,e.pts);Ex(p)&&d.push(p)}v&&d.push(Ft.formatPieValue(e.v,h)),u&&d.push(Ft.formatPiePercent(e.v/r.vTotal,h)),e.text=d.join("<br>")}function m(g){return{label:g.label,value:g.v,valueLabel:Ft.formatPieValue(g.v,a.separators),percent:g.v/r.vTotal,percentLabel:Ft.formatPiePercent(g.v/r.vTotal,a.separators),color:g.color,text:g.text,customdata:Er.castOption(i,g.i,"customdata")}}if(n){var y=Er.castOption(i,e.i,"texttemplate");if(!y)e.text="";else{var b=m(e),w=Ft.getFirstFilled(i.text,e.pts);(Ex(w)||w==="")&&(b.text=w),e.text=Er.texttemplateString(y,b,t._fullLayout._d3locale,b,i._meta||{})}}}function LA(t,e){var r=t.rotate*Math.PI/180,a=Math.cos(r),i=Math.sin(r),n=(e.left+e.right)/2,o=(e.top+e.bottom)/2;t.textX=n*a-o*i,t.textY=n*i+o*a,t.noCenter=!0}var CA={plot:pH,formatSliceLabel:SA,transformInsideText:xA,determineInsideTextFont:gA,positionTitleOutside:kA,prerenderTitles:bA,layoutAreas:MA,attachFxHandlers:yA,computeTransform:LA},Nx=gt,AH=cp,MH=vi.resizeText,SH=function(e){var r=e._fullLayout._pielayer.selectAll(".trace");MH(e,r,"pie"),r.each(function(a){var i=a[0],n=i.trace,o=Nx.select(this);o.style({opacity:n.opacity}),o.selectAll("path.surface").each(function(l){Nx.select(this).call(AH,l,n,e)})})},DA={};(function(t){var e=cr;t.name="pie",t.plot=function(r,a,i,n){e.plotBasePlot(t.name,r,a,i,n)},t.clean=function(r,a,i,n){e.cleanBasePlot(t.name,r,a,i,n)}})(DA);var LH={attributes:uu,supplyDefaults:cA.supplyDefaults,supplyLayoutDefaults:aH,layoutAttributes:uA,calc:yc.calc,crossTraceCalc:yc.crossTraceCalc,plot:CA.plot,style:SH,styleOne:cp,moduleType:"trace",name:"pie",basePlotModule:DA,categories:["pie-like","pie","showLegend"],meta:{description:["A data visualized by the sectors of the pie is set in `values`.","The sector labels are set in `labels`.","The sector colors are set in `marker.colors`"].join(" ")}},CH=LH;const Uj=Fi(CH);var $A={INCREASING:{COLOR:"#3D9970",SYMBOL:"▲"},DECREASING:{COLOR:"#FF4136",SYMBOL:"▼"}},Ff=me.extendFlat,Nf=Ui,Hx=jo.axisHoverFormat,xh=ra.dash,DH=kc,PA=$A,$H=PA.INCREASING.COLOR,PH=PA.DECREASING.COLOR,gc=Nf.line;function Ox(t){return{line:{color:Ff({},gc.color,{dflt:t}),width:gc.width,dash:xh,editType:"style"},editType:"style"}}var RA={xperiod:Nf.xperiod,xperiod0:Nf.xperiod0,xperiodalignment:Nf.xperiodalignment,xhoverformat:Hx("x"),yhoverformat:Hx("y"),x:{valType:"data_array",editType:"calc+clearAxisTypes",description:["Sets the x coordinates.","If absent, linear coordinate will be generated."].join(" ")},open:{valType:"data_array",editType:"calc",description:"Sets the open values."},high:{valType:"data_array",editType:"calc",description:"Sets the high values."},low:{valType:"data_array",editType:"calc",description:"Sets the low values."},close:{valType:"data_array",editType:"calc",description:"Sets the close values."},line:{width:Ff({},gc.width,{description:[gc.width,"Note that this style setting can also be set per","direction via `increasing.line.width` and","`decreasing.line.width`."].join(" ")}),dash:Ff({},xh,{description:[xh.description,"Note that this style setting can also be set per","direction via `increasing.line.dash` and","`decreasing.line.dash`."].join(" ")}),editType:"style"},increasing:Ox($H),decreasing:Ox(PH),text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc",description:["Sets hover text elements associated with each sample point.","If a single string, the same string appears over","all the data points.","If an array of string, the items are mapped in order to","this trace's sample points."].join(" ")},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"calc",description:"Same as `text`."},tickwidth:{valType:"number",min:0,max:.5,dflt:.3,editType:"calc",description:["Sets the width of the open/close tick marks","relative to the *x* minimal interval."].join(" ")},hoverlabel:Ff({},DH.hoverlabel,{split:{valType:"boolean",dflt:!1,editType:"style",description:["Show hover information (open, close, high, low) in","separate labels."].join(" ")}})},RH=ot,EH=me,zH=function(e,r,a,i){var n=a("x"),o=a("open"),l=a("high"),s=a("low"),f=a("close");a("hoverlabel.split");var c=RH.getComponentMethod("calendars","handleTraceDefaults");if(c(e,r,["x"],i),!!(o&&l&&s&&f)){var v=Math.min(o.length,l.length,s.length,f.length);return n&&(v=Math.min(v,EH.minRowLength(n))),r._length=v,v}},IH=me,FH=zH,NH=iu,HH=RA,OH=function(e,r,a,i){function n(l,s){return IH.coerce(e,r,HH,l,s)}var o=FH(e,r,n,i);if(!o){r.visible=!1;return}NH(e,r,i,n,{x:!0}),n("xhoverformat"),n("yhoverformat"),n("line.width"),n("line.dash"),jx(e,r,n,"increasing"),jx(e,r,n,"decreasing"),n("text"),n("hovertext"),n("tickwidth"),i._requestRangeslider[r.xaxis]=!0};function jx(t,e,r,a){r(a+".line.color"),r(a+".line.width",e.line.width),r(a+".line.dash",e.line.dash)}var vu=me,hf=vu._,Hf=Bt,jH=nu,pl=or.BADNUM;function BH(t,e){var r=Hf.getFromId(t,e.xaxis),a=Hf.getFromId(t,e.yaxis),i=UH(t,r,e),n=e._minDiff;e._minDiff=null;var o=e._origX;e._origX=null;var l=e._xcalc;e._xcalc=null;var s=EA(t,e,o,l,a,GH);return e._extremes[r._id]=Hf.findExtremes(r,l,{vpad:n/2}),s.length?(vu.extendFlat(s[0].t,{wHover:n/2,tickLen:i}),s):[{t:{empty:!0}}]}function GH(t,e,r,a){return{o:t,h:e,l:r,c:a}}function EA(t,e,r,a,i,n){for(var o=i.makeCalcdata(e,"open"),l=i.makeCalcdata(e,"high"),s=i.makeCalcdata(e,"low"),f=i.makeCalcdata(e,"close"),c=Array.isArray(e.text),v=Array.isArray(e.hovertext),u=!0,h=null,d=!!e.xperiodalignment,p=[],m=0;m<a.length;m++){var y=a[m],b=o[m],w=l[m],g=s[m],x=f[m];if(y!==pl&&b!==pl&&w!==pl&&g!==pl&&x!==pl){x===b?h!==null&&x!==h&&(u=x>h):u=x>b,h=x;var _=n(b,w,g,x);_.pos=y,_.yc=(b+x)/2,_.i=m,_.dir=u?"increasing":"decreasing",_.x=_.pos,_.y=[g,w],d&&(_.orig_p=r[m]),c&&(_.tx=e.text[m]),v&&(_.htx=e.hovertext[m]),p.push(_)}else p.push({pos:y,empty:!0})}return e._extremes[i._id]=Hf.findExtremes(i,vu.concat(s,l),{padded:!0}),p.length&&(p[0].t={labels:{open:hf(t,"open:")+" ",high:hf(t,"high:")+" ",low:hf(t,"low:")+" ",close:hf(t,"close:")+" "}}),p}function UH(t,e,r){var a=r._minDiff;if(!a){var i=t._fullData,n=[];a=1/0;var o;for(o=0;o<i.length;o++){var l=i[o];if(l.type==="ohlc"&&l.visible===!0&&l.xaxis===e._id){n.push(l);var s=e.makeCalcdata(l,"x");l._origX=s;var f=jH(r,e,"x",s).vals;l._xcalc=f;var c=vu.distinctVals(f).minDiff;c&&isFinite(c)&&(a=Math.min(a,c))}}for(a===1/0&&(a=1),o=0;o<n.length;o++)n[o]._minDiff=a}return a*r.tickwidth}var VH={calc:BH,calcCommon:EA},XH=gt,Bx=me,YH=function(e,r,a,i){var n=r.yaxis,o=r.xaxis,l=!!o.rangebreaks;Bx.makeTraceGroups(i,a,"trace ohlc").each(function(s){var f=XH.select(this),c=s[0],v=c.t,u=c.trace;if(u.visible!==!0||v.empty){f.remove();return}var h=v.tickLen,d=f.selectAll("path").data(Bx.identity);d.enter().append("path"),d.exit().remove(),d.attr("d",function(p){if(p.empty)return"M0,0Z";var m=o.c2p(p.pos-h,!0),y=o.c2p(p.pos+h,!0),b=l?(m+y)/2:o.c2p(p.pos,!0),w=n.c2p(p.o,!0),g=n.c2p(p.h,!0),x=n.c2p(p.l,!0),_=n.c2p(p.c,!0);return"M"+m+","+w+"H"+b+"M"+b+","+g+"V"+x+"M"+y+","+_+"H"+b})})},ld=gt,WH=$t,qH=ht,ZH=function(e,r,a){var i=a||ld.select(e).selectAll("g.ohlclayer").selectAll("g.trace");i.style("opacity",function(n){return n[0].trace.opacity}),i.each(function(n){var o=n[0].trace;ld.select(this).selectAll("path").each(function(l){if(!l.empty){var s=o[l.dir].line;ld.select(this).style("fill","none").call(qH.stroke,s.color).call(WH.dashLine,s.dash,s.width).style("opacity",o.selectedpoints&&!l.selected?.3:1)}})})},_h=Bt,KH=me,pf=Ia,QH=ht,JH=me.fillText,Gx=$A,e7={increasing:Gx.INCREASING.SYMBOL,decreasing:Gx.DECREASING.SYMBOL};function t7(t,e,r,a){var i=t.cd,n=i[0].trace;return n.hoverlabel.split?IA(t,e,r,a):FA(t,e,r,a)}function zA(t,e,r,a){var i=t.cd,n=t.xa,o=i[0].trace,l=i[0].t,s=o.type,f=s==="ohlc"?"l":"min",c=s==="ohlc"?"h":"max",v,u,h=l.bPos||0,d=function(L){return L.pos+h-e},p=l.bdPos||l.tickLen,m=l.wHover,y=Math.min(1,p/Math.abs(n.r2c(n.range[1])-n.r2c(n.range[0])));v=t.maxHoverDistance-y,u=t.maxSpikeDistance-y;function b(L){var D=d(L);return pf.inbox(D-m,D+m,v)}function w(L){var D=L[f],$=L[c];return D===$||pf.inbox(D-r,$-r,v)}function g(L){return(b(L)+w(L))/2}var x=pf.getDistanceFunction(a,b,w,g);if(pf.getClosest(i,x,t),t.index===!1)return null;var _=i[t.index];if(_.empty)return null;var T=_.dir,k=o[T],S=k.line.color;return QH.opacity(S)&&k.line.width?t.color=S:t.color=k.fillcolor,t.x0=n.c2p(_.pos+h-p,!0),t.x1=n.c2p(_.pos+h+p,!0),t.xLabelVal=_.orig_p!==void 0?_.orig_p:_.pos,t.spikeDistance=g(_)*u/v,t.xSpike=n.c2p(_.pos,!0),t}function IA(t,e,r,a){var i=t.cd,n=t.ya,o=i[0].trace,l=i[0].t,s=[],f=zA(t,e,r,a);if(!f)return[];var c=f.index,v=i[c],u=v.hi||o.hoverinfo,h=u.split("+"),d=u==="all",p=d||h.indexOf("y")!==-1;if(!p)return[];for(var m=["high","open","close","low"],y={},b=0;b<m.length;b++){var w=m[b],g=o[w][f.index],x=n.c2p(g,!0),_;g in y?(_=y[g],_.yLabel+="<br>"+l.labels[w]+_h.hoverLabelText(n,g,o.yhoverformat)):(_=KH.extendFlat({},f),_.y0=_.y1=x,_.yLabelVal=g,_.yLabel=l.labels[w]+_h.hoverLabelText(n,g,o.yhoverformat),_.name="",s.push(_),y[g]=_)}return s}function FA(t,e,r,a){var i=t.cd,n=t.ya,o=i[0].trace,l=i[0].t,s=zA(t,e,r,a);if(!s)return[];var f=s.index,c=i[f],v=s.index=c.i,u=c.dir;function h(g){return l.labels[g]+_h.hoverLabelText(n,o[g][v],o.yhoverformat)}var d=c.hi||o.hoverinfo,p=d.split("+"),m=d==="all",y=m||p.indexOf("y")!==-1,b=m||p.indexOf("text")!==-1,w=y?[h("open"),h("high"),h("low"),h("close")+" "+e7[u]]:[];return b&&JH(c,o,w),s.extraText=w.join("<br>"),s.y0=s.y1=n.c2p(c.yc,!0),[s]}var r7={hoverPoints:t7,hoverSplit:IA,hoverOnPoints:FA},a7=function(e,r){var a=e.cd,i=e.xaxis,n=e.yaxis,o=[],l,s=a[0].t.bPos||0;if(r===!1)for(l=0;l<a.length;l++)a[l].selected=0;else for(l=0;l<a.length;l++){var f=a[l];r.contains([i.c2p(f.pos+s),n.c2p(f.yc)],null,f.i,e)?(o.push({pointNumber:f.i,x:i.c2d(f.pos),y:n.c2d(f.yc)}),f.selected=1):f.selected=0}return o},i7={moduleType:"trace",name:"ohlc",basePlotModule:ur,categories:["cartesian","svg","showLegend"],meta:{description:["The ohlc (short for Open-High-Low-Close) is a style of financial chart describing","open, high, low and close for a given `x` coordinate (most likely time).","The tip of the lines represent the `low` and `high` values and","the horizontal segments represent the `open` and `close` values.","Sample points where the close value is higher (lower) then the open","value are called increasing (decreasing).","By default, increasing items are drawn in green whereas","decreasing are drawn in red."].join(" ")},attributes:RA,supplyDefaults:OH,calc:VH.calc,plot:YH,style:ZH,hoverPoints:r7.hoverPoints,selectPoints:a7},n7=i7;const Vj=Fi(n7);var o7=ot,Ma=me,l7=j2;function s7(t,e,r,a){var i=t.cd,n=i[0].t,o=i[0].trace,l=t.xa,s=t.ya,f=n.x,c=n.y,v=l.c2p(e),u=s.c2p(r),h=t.distance,d;if(n.tree){var p=l.p2c(v-h),m=l.p2c(v+h),y=s.p2c(u-h),b=s.p2c(u+h);a==="x"?d=n.tree.range(Math.min(p,m),Math.min(s._rl[0],s._rl[1]),Math.max(p,m),Math.max(s._rl[0],s._rl[1])):d=n.tree.range(Math.min(p,m),Math.min(y,b),Math.max(p,m),Math.max(y,b))}else d=n.ids;var w,g,x,_,T,k,S,L,D,$=h;if(a==="x"){var E=!!o.xperiodalignment,z=!!o.yperiodalignment;for(T=0;T<d.length;T++){if(w=d[T],x=f[w],k=Math.abs(l.c2p(x)-v),E){var O=l.c2p(o._xStarts[w]),I=l.c2p(o._xEnds[w]);k=v>=Math.min(O,I)&&v<=Math.max(O,I)?0:1/0}if(k<$){if($=k,_=c[w],S=s.c2p(_)-u,z){var P=s.c2p(o._yStarts[w]),M=s.c2p(o._yEnds[w]);S=u>=Math.min(P,M)&&u<=Math.max(P,M)?0:1/0}D=Math.sqrt(k*k+S*S),g=d[T]}}}else for(T=d.length-1;T>-1;T--)w=d[T],x=f[w],_=c[w],k=l.c2p(x)-v,S=s.c2p(_)-u,L=Math.sqrt(k*k+S*S),L<$&&($=D=L,g=w);return t.index=g,t.distance=$,t.dxy=D,g===void 0?[t]:[NA(t,f,c,o)]}function NA(t,e,r,a){var i=t.xa,n=t.ya,o=t.distance,l=t.dxy,s=t.index,f={pointNumber:s,x:e[s],y:r[s]};f.tx=Array.isArray(a.text)?a.text[s]:a.text,f.htx=Array.isArray(a.hovertext)?a.hovertext[s]:a.hovertext,f.data=Array.isArray(a.customdata)?a.customdata[s]:a.customdata,f.tp=Array.isArray(a.textposition)?a.textposition[s]:a.textposition;var c=a.textfont;c&&(f.ts=Ma.isArrayOrTypedArray(c.size)?c.size[s]:c.size,f.tc=Array.isArray(c.color)?c.color[s]:c.color,f.tf=Array.isArray(c.family)?c.family[s]:c.family);var v=a.marker;v&&(f.ms=Ma.isArrayOrTypedArray(v.size)?v.size[s]:v.size,f.mo=Ma.isArrayOrTypedArray(v.opacity)?v.opacity[s]:v.opacity,f.mx=Ma.isArrayOrTypedArray(v.symbol)?v.symbol[s]:v.symbol,f.ma=Ma.isArrayOrTypedArray(v.angle)?v.angle[s]:v.angle,f.mc=Ma.isArrayOrTypedArray(v.color)?v.color[s]:v.color);var u=v&&v.line;u&&(f.mlc=Array.isArray(u.color)?u.color[s]:u.color,f.mlw=Ma.isArrayOrTypedArray(u.width)?u.width[s]:u.width);var h=v&&v.gradient;h&&h.type!=="none"&&(f.mgt=Array.isArray(h.type)?h.type[s]:h.type,f.mgc=Array.isArray(h.color)?h.color[s]:h.color);var d=i.c2p(f.x,!0),p=n.c2p(f.y,!0),m=f.mrc||1,y=a.hoverlabel;y&&(f.hbg=Array.isArray(y.bgcolor)?y.bgcolor[s]:y.bgcolor,f.hbc=Array.isArray(y.bordercolor)?y.bordercolor[s]:y.bordercolor,f.hts=Ma.isArrayOrTypedArray(y.font.size)?y.font.size[s]:y.font.size,f.htc=Array.isArray(y.font.color)?y.font.color[s]:y.font.color,f.htf=Array.isArray(y.font.family)?y.font.family[s]:y.font.family,f.hnl=Ma.isArrayOrTypedArray(y.namelength)?y.namelength[s]:y.namelength);var b=a.hoverinfo;b&&(f.hi=Array.isArray(b)?b[s]:b);var w=a.hovertemplate;w&&(f.ht=Array.isArray(w)?w[s]:w);var g={};g[t.index]=f;var x=a._origX,_=a._origY,T=Ma.extendFlat({},t,{color:l7(a,f),x0:d-m,x1:d+m,xLabelVal:x?x[s]:f.x,y0:p-m,y1:p+m,yLabelVal:_?_[s]:f.y,cd:g,distance:o,spikeDistance:l,hovertemplate:f.ht});return f.htx?T.text=f.htx:f.tx?T.text=f.tx:a.text&&(T.text=a.text),Ma.fillText(f,a,T),o7.getComponentMethod("errorbars","hoverInfo")(f,a,T),T}var f7={hoverPoints:s7,calcHover:NA},HA={exports:{}},Ux=20,du={TOO_MANY_POINTS:1e5,SYMBOL_SDF_SIZE:200,SYMBOL_SIZE:Ux,SYMBOL_STROKE:Ux/20,DOT_RE:/-dot/,OPEN_RE:/-open/,DASHES:{solid:[1],dot:[1,1],dash:[4,1],longdash:[8,1],dashdot:[4,1,1,1],longdashdot:[8,1,1,1]}},c7=ba,Zt=Ui,Vx=jo.axisHoverFormat,Xx=Ln,u7=Hh,sd=Qt.extendFlat,v7=Ya.overrideAll,d7=du.DASHES,Yx=Zt.line,ii=Zt.marker,h7=ii.line,mo=HA.exports=v7({x:Zt.x,x0:Zt.x0,dx:Zt.dx,y:Zt.y,y0:Zt.y0,dy:Zt.dy,xperiod:Zt.xperiod,yperiod:Zt.yperiod,xperiod0:Zt.xperiod0,yperiod0:Zt.yperiod0,xperiodalignment:Zt.xperiodalignment,yperiodalignment:Zt.yperiodalignment,xhoverformat:Vx("x"),yhoverformat:Vx("y"),text:Zt.text,hovertext:Zt.hovertext,textposition:Zt.textposition,textfont:Zt.textfont,mode:{valType:"flaglist",flags:["lines","markers","text"],extras:["none"],description:["Determines the drawing mode for this scatter trace."].join(" ")},line:{color:Yx.color,width:Yx.width,shape:{valType:"enumerated",values:["linear","hv","vh","hvh","vhv"],dflt:"linear",editType:"plot",description:["Determines the line shape.","The values correspond to step-wise line shapes."].join(" ")},dash:{valType:"enumerated",values:u7(d7),dflt:"solid",description:"Sets the style of the lines."}},marker:sd({},Xx("marker"),{symbol:ii.symbol,angle:ii.angle,size:ii.size,sizeref:ii.sizeref,sizemin:ii.sizemin,sizemode:ii.sizemode,opacity:ii.opacity,colorbar:ii.colorbar,line:sd({},Xx("marker.line"),{width:h7.width})}),connectgaps:Zt.connectgaps,fill:sd({},Zt.fill,{dflt:"none"}),fillcolor:Zt.fillcolor,selected:{marker:Zt.selected.marker,textfont:Zt.selected.textfont},unselected:{marker:Zt.unselected.marker,textfont:Zt.unselected.textfont},opacity:c7.opacity},"calc","nested");mo.x.editType=mo.y.editType=mo.x0.editType=mo.y0.editType="calc+clearAxisTypes";mo.hovertemplate=Zt.hovertemplate;mo.texttemplate=Zt.texttemplate;var OA=HA.exports,hu={},jA=du;hu.isOpenSymbol=function(t){return typeof t=="string"?jA.OPEN_RE.test(t):t%200>100};hu.isDotSymbol=function(t){return typeof t=="string"?jA.DOT_RE.test(t):t>200};var Wx=me,p7=ot,m7=hu,y7=OA,g7=ru,mf=Ir,b7=Op,x7=iu,_7=y2,w7=g2,T7=x2,k7=b2,A7=function(e,r,a,i){function n(h,d){return Wx.coerce(e,r,y7,h,d)}var o=e.marker?m7.isOpenSymbol(e.marker.symbol):!1,l=mf.isBubble(e),s=b7(e,r,i,n);if(!s){r.visible=!1;return}x7(e,r,i,n),n("xhoverformat"),n("yhoverformat");var f=s<g7.PTS_LINESONLY?"lines+markers":"lines";n("text"),n("hovertext"),n("hovertemplate"),n("mode",f),mf.hasLines(r)&&(n("connectgaps"),w7(e,r,a,i,n),n("line.shape")),mf.hasMarkers(r)&&(_7(e,r,a,i,n,{noAngleRef:!0,noStandOff:!0}),n("marker.line.width",o||l?1:0)),mf.hasText(r)&&(n("texttemplate"),k7(e,r,i,n));var c=(r.line||{}).color,v=(r.marker||{}).color;n("fill"),r.fill!=="none"&&T7(e,r,a,n);var u=p7.getComponentMethod("errorbars","supplyDefaults");u(e,r,c||v||a,{axis:"y"}),u(e,r,c||v||a,{axis:"x",inherit:"y"}),Wx.coerceSelectionMarkerOpacity(r,n)},M7=O2,S7=function(e,r,a){var i=e.i;return"x"in e||(e.x=r._x[i]),"y"in e||(e.y=r._y[i]),M7(e,r,a)},BA=wt,L7=ga,bc=H1,xc=wo,C7=zr.defaultLine,qx=ta.isArrayOrTypedArray,wh=bc(C7),GA=1;function Zx(t,e){var r=t;return r[3]*=e,r}function Kx(t){if(BA(t))return wh;var e=bc(t);return e.length?e:wh}function Qx(t){return BA(t)?t:GA}function D7(t,e,r){var a=t.color,i=qx(a),n=qx(e),o=xc.extractOpts(t),l=[],s,f,c,v,u;if(o.colorscale!==void 0?s=xc.makeColorScaleFuncFromTrace(t):s=Kx,i?f=function(d,p){return d[p]===void 0?wh:bc(s(d[p]))}:f=Kx,n?c=function(d,p){return d[p]===void 0?GA:Qx(d[p])}:c=Qx,i||n)for(var h=0;h<r;h++)v=f(a,h),u=c(e,h),l[h]=Zx(v,u);else l=Zx(bc(a),e);return l}function $7(t){var e=xc.extractOpts(t),r=e.colorscale;return e.reversescale&&(r=xc.flipScale(e.colorscale)),r.map(function(a){var i=a[0],n=L7(a[1]),o=n.toRgb();return{index:i,rgb:[o.r,o.g,o.b,o.a]}})}var P7={formatColor:D7,parseColorScale:$7},Of=wt,R7=mM,yf=H1,E7=ot,Qr=me,oo=$t,Jx=lr,e1=P7.formatColor,xo=Ir,z7=hw,Th=hu,bs=du,I7=ns.DESELECTDIM,t1={start:1,left:1,end:-1,right:-1,middle:0,center:0,bottom:1,top:-1},F7=xa.appendArrayPointValue;function N7(t,e){var r,a={marker:void 0,markerSel:void 0,markerUnsel:void 0,line:void 0,fill:void 0,errorX:void 0,errorY:void 0,text:void 0,textSel:void 0,textUnsel:void 0},i=t._context.plotGlPixelRatio;if(e.visible!==!0)return a;if(xo.hasText(e)&&(a.text=UA(t,e),a.textSel=r1(t,e,e.selected),a.textUnsel=r1(t,e,e.unselected)),xo.hasMarkers(e)&&(a.marker=cm(t,e),a.markerSel=kh(t,e,e.selected),a.markerUnsel=kh(t,e,e.unselected),!e.unselected&&Qr.isArrayOrTypedArray(e.marker.opacity))){var n=e.marker.opacity;for(a.markerUnsel.opacity=new Array(n.length),r=0;r<n.length;r++)a.markerUnsel.opacity[r]=I7*n[r]}if(xo.hasLines(e)){a.line={overlay:!0,thickness:e.line.width*i,color:e.line.color,opacity:e.opacity};var o=(bs.DASHES[e.line.dash]||[1]).slice();for(r=0;r<o.length;++r)o[r]*=e.line.width*i;a.line.dashes=o}return e.error_x&&e.error_x.visible&&(a.errorX=a1(e,e.error_x,i)),e.error_y&&e.error_y.visible&&(a.errorY=a1(e,e.error_y,i)),e.fill&&e.fill!=="none"&&(a.fill={closed:!0,fill:e.fillcolor,thickness:0}),a}function UA(t,e){var r=t._fullLayout,a=e._length,i=e.textfont,n=e.textposition,o=Array.isArray(n)?n:[n],l=i.color,s=i.size,f=i.family,c={},v,u=t._context.plotGlPixelRatio,h=e.texttemplate;if(h){c.text=[];var d=r._d3locale,p=Array.isArray(h),m=p?Math.min(h.length,a):a,y=p?function(k){return h[k]}:function(){return h};for(v=0;v<m;v++){var b={i:v},w=e._module.formatLabels(b,e,r),g={};F7(g,e,v);var x=e._meta||{};c.text.push(Qr.texttemplateString(y(v),w,d,g,b,x))}}else Array.isArray(e.text)&&e.text.length<a?c.text=e.text.slice():c.text=e.text;if(Array.isArray(c.text))for(v=c.text.length;v<a;v++)c.text[v]="";for(c.opacity=e.opacity,c.font={},c.align=[],c.baseline=[],v=0;v<o.length;v++){var _=o[v].split(/\s+/);switch(_[1]){case"left":c.align.push("right");break;case"right":c.align.push("left");break;default:c.align.push(_[1])}switch(_[0]){case"top":c.baseline.push("bottom");break;case"bottom":c.baseline.push("top");break;default:c.baseline.push(_[0])}}if(Array.isArray(l))for(c.color=new Array(a),v=0;v<a;v++)c.color[v]=l[v];else c.color=l;if(Qr.isArrayOrTypedArray(s)||Array.isArray(f))for(c.font=new Array(a),v=0;v<a;v++){var T=c.font[v]={};T.size=(Qr.isTypedArray(s)?s[v]:Array.isArray(s)?Of(s[v])?s[v]:0:s)*u,T.family=Array.isArray(f)?f[v]:f}else c.font={size:s*u,family:f};return c}function cm(t,e){var r=e._length,a=e.marker,i={},n,o=Qr.isArrayOrTypedArray(a.symbol),l=Qr.isArrayOrTypedArray(a.angle),s=Qr.isArrayOrTypedArray(a.color),f=Qr.isArrayOrTypedArray(a.line.color),c=Qr.isArrayOrTypedArray(a.opacity),v=Qr.isArrayOrTypedArray(a.size),u=Qr.isArrayOrTypedArray(a.line.width),h;if(o||(h=Th.isOpenSymbol(a.symbol)),o||s||f||c||l){i.symbols=new Array(r),i.angles=new Array(r),i.colors=new Array(r),i.borderColors=new Array(r);var d=a.symbol,p=a.angle,m=e1(a,a.opacity,r),y=e1(a.line,a.opacity,r);if(!Array.isArray(y[0])){var b=y;for(y=Array(r),n=0;n<r;n++)y[n]=b}if(!Array.isArray(m[0])){var w=m;for(m=Array(r),n=0;n<r;n++)m[n]=w}if(!Array.isArray(d)){var g=d;for(d=Array(r),n=0;n<r;n++)d[n]=g}if(!Array.isArray(p)){var x=p;for(p=Array(r),n=0;n<r;n++)p[n]=x}for(i.symbols=d,i.angles=p,i.colors=m,i.borderColors=y,n=0;n<r;n++)o&&(h=Th.isOpenSymbol(a.symbol[n])),h&&(y[n]=m[n].slice(),m[n]=m[n].slice(),m[n][3]=0);for(i.opacity=e.opacity,i.markers=new Array(r),n=0;n<r;n++)i.markers[n]=o1({mx:i.symbols[n],ma:i.angles[n]},e)}else h?(i.color=yf(a.color,"uint8"),i.color[3]=0,i.borderColor=yf(a.color,"uint8")):(i.color=yf(a.color,"uint8"),i.borderColor=yf(a.line.color,"uint8")),i.opacity=e.opacity*a.opacity,i.marker=o1({mx:a.symbol,ma:a.angle},e);var _=1,T=z7(e,_),k;if(v||u){var S=i.sizes=new Array(r),L=i.borderSizes=new Array(r),D=0,$;if(v){for(n=0;n<r;n++)S[n]=T(a.size[n]),D+=S[n];$=D/r}else for(k=T(a.size),n=0;n<r;n++)S[n]=k;if(u)for(n=0;n<r;n++)L[n]=a.line.width[n];else for(k=a.line.width,n=0;n<r;n++)L[n]=k;i.sizeAvg=$}else i.size=T(a&&a.size||10),i.borderSizes=T(a.line.width);return i}function kh(t,e,r){var a=e.marker,i={};return r&&(r.marker&&r.marker.symbol?i=cm(t,Qr.extendFlat({},a,r.marker)):r.marker&&(r.marker.size&&(i.size=r.marker.size),r.marker.color&&(i.colors=r.marker.color),r.marker.opacity!==void 0&&(i.opacity=r.marker.opacity))),i}function r1(t,e,r){var a={};if(!r)return a;if(r.textfont){var i={opacity:1,text:e.text,texttemplate:e.texttemplate,textposition:e.textposition,textfont:Qr.extendFlat({},e.textfont)};r.textfont&&Qr.extendFlat(i.textfont,r.textfont),a=UA(t,i)}return a}function a1(t,e,r){var a={capSize:e.width*2*r,lineWidth:e.thickness*r,color:e.color};return e.copy_ystyle&&(a=t.error_y),a}var i1=bs.SYMBOL_SDF_SIZE,an=bs.SYMBOL_SIZE,n1=bs.SYMBOL_STROKE,fd={},H7=oo.symbolFuncs[0](an*.05);function o1(t,e){var r=t.mx;if(r==="circle")return null;var a,i,n=oo.symbolNumber(r),o=oo.symbolFuncs[n%100],l=!!oo.symbolNoDot[n%100],s=!!oo.symbolNoFill[n%100],f=Th.isDotSymbol(r);if(t.ma&&(r+="_"+t.ma),fd[r])return fd[r];var c=oo.getMarkerAngle(t,e);return f&&!l?a=o(an*1.1,c)+H7:a=o(an,c),i=R7(a,{w:i1,h:i1,viewBox:[-an,-an,an,an],stroke:s?n1:-n1}),fd[r]=i,i||null}function O7(t,e,r){var a=r.length,i=a/2,n,o;if(xo.hasLines(e)&&i)if(e.line.shape==="hv"){for(n=[],o=0;o<i-1;o++)isNaN(r[o*2])||isNaN(r[o*2+1])?n.push(NaN,NaN,NaN,NaN):(n.push(r[o*2],r[o*2+1]),!isNaN(r[o*2+2])&&!isNaN(r[o*2+3])?n.push(r[o*2+2],r[o*2+1]):n.push(NaN,NaN));n.push(r[a-2],r[a-1])}else if(e.line.shape==="hvh"){for(n=[],o=0;o<i-1;o++)if(isNaN(r[o*2])||isNaN(r[o*2+1])||isNaN(r[o*2+2])||isNaN(r[o*2+3]))!isNaN(r[o*2])&&!isNaN(r[o*2+1])?n.push(r[o*2],r[o*2+1]):n.push(NaN,NaN),n.push(NaN,NaN);else{var l=(r[o*2]+r[o*2+2])/2;n.push(r[o*2],r[o*2+1],l,r[o*2+1],l,r[o*2+3])}n.push(r[a-2],r[a-1])}else if(e.line.shape==="vhv"){for(n=[],o=0;o<i-1;o++)if(isNaN(r[o*2])||isNaN(r[o*2+1])||isNaN(r[o*2+2])||isNaN(r[o*2+3]))!isNaN(r[o*2])&&!isNaN(r[o*2+1])?n.push(r[o*2],r[o*2+1]):n.push(NaN,NaN),n.push(NaN,NaN);else{var s=(r[o*2+1]+r[o*2+3])/2;n.push(r[o*2],r[o*2+1],r[o*2],s,r[o*2+2],s)}n.push(r[a-2],r[a-1])}else if(e.line.shape==="vh"){for(n=[],o=0;o<i-1;o++)isNaN(r[o*2])||isNaN(r[o*2+1])?n.push(NaN,NaN,NaN,NaN):(n.push(r[o*2],r[o*2+1]),!isNaN(r[o*2+2])&&!isNaN(r[o*2+3])?n.push(r[o*2],r[o*2+3]):n.push(NaN,NaN));n.push(r[a-2],r[a-1])}else n=r;var f=!1;for(o=0;o<n.length;o++)if(isNaN(n[o])){f=!0;break}var c=f||n.length>bs.TOO_MANY_POINTS||xo.hasMarkers(e)?"rect":"round";if(f&&e.connectgaps){var v=n[0],u=n[1];for(o=0;o<n.length;o+=2)isNaN(n[o])||isNaN(n[o+1])?(n[o]=v,n[o+1]=u):(v=n[o],u=n[o+1])}return{join:c,positions:n}}function j7(t,e,r,a,i){var n=E7.getComponentMethod("errorbars","makeComputeError"),o=Jx.getFromId(t,e.xaxis,"x"),l=Jx.getFromId(t,e.yaxis,"y"),s=r.length/2,f={};function c(v,u){var h=u._id.charAt(0),d=e["error_"+h];if(d&&d.visible&&(u.type==="linear"||u.type==="log")){for(var p=n(d),m={x:0,y:1}[h],y={x:[0,1,2,3],y:[2,3,0,1]}[h],b=new Float64Array(4*s),w=1/0,g=-1/0,x=0,_=0;x<s;x++,_+=4){var T=v[x];if(Of(T)){var k=r[x*2+m],S=p(T,x),L=S[0],D=S[1];if(Of(L)&&Of(D)){var $=T-L,E=T+D;b[_+y[0]]=k-u.c2l($),b[_+y[1]]=u.c2l(E)-k,b[_+y[2]]=0,b[_+y[3]]=0,w=Math.min(w,T-L),g=Math.max(g,T+D)}}}f[h]={positions:r,errors:b,_bnds:[w,g]}}}return c(a,o),c(i,l),f}function B7(t,e,r,a){var i=e._length,n={},o;if(xo.hasMarkers(e)){var l=r.font,s=r.align,f=r.baseline;for(n.offset=new Array(i),o=0;o<i;o++){var c=a.sizes?a.sizes[o]:a.size,v=Array.isArray(l)?l[o].size:l.size,u=Array.isArray(s)?s.length>1?s[o]:s[0]:s,h=Array.isArray(f)?f.length>1?f[o]:f[0]:f,d=t1[u],p=t1[h],m=c?c/.8+1:0,y=-p*m-p*.5;n.offset[o]=[d*m/v,y/v]}}return n}var G7={style:N7,markerStyle:cm,markerSelection:kh,linePositions:O7,errorBarPositions:j7,textPosition:B7},gf=me,U7=function(e,r){var a=r._scene,i={count:0,dirty:!0,lineOptions:[],fillOptions:[],markerOptions:[],markerSelectedOptions:[],markerUnselectedOptions:[],errorXOptions:[],errorYOptions:[],textOptions:[],textSelectedOptions:[],textUnselectedOptions:[],selectBatch:[],unselectBatch:[]},n={fill2d:!1,scatter2d:!1,error2d:!1,line2d:!1,glText:!1,select2d:!1};return r._scene||(a=r._scene={},a.init=function(){gf.extendFlat(a,n,i)},a.init(),a.update=function(l){var s=gf.repeat(l,a.count);if(a.fill2d&&a.fill2d.update(s),a.scatter2d&&a.scatter2d.update(s),a.line2d&&a.line2d.update(s),a.error2d&&a.error2d.update(s.concat(s)),a.select2d&&a.select2d.update(s),a.glText)for(var f=0;f<a.count;f++)a.glText[f].update(l)},a.draw=function(){for(var l=a.count,s=a.fill2d,f=a.error2d,c=a.line2d,v=a.scatter2d,u=a.glText,h=a.select2d,d=a.selectBatch,p=a.unselectBatch,m=0;m<l;m++){if(s&&a.fillOrder[m]&&s.draw(a.fillOrder[m]),c&&a.lineOptions[m]&&c.draw(m),f&&(a.errorXOptions[m]&&f.draw(m),a.errorYOptions[m]&&f.draw(m+l)),v&&a.markerOptions[m])if(p[m].length){var y=gf.repeat([],a.count);y[m]=p[m],v.draw(y)}else d[m].length||v.draw(m);u[m]&&a.textOptions[m]&&u[m].render()}h&&h.draw(d),a.dirty=!1},a.destroy=function(){a.fill2d&&a.fill2d.destroy&&a.fill2d.destroy(),a.scatter2d&&a.scatter2d.destroy&&a.scatter2d.destroy(),a.error2d&&a.error2d.destroy&&a.error2d.destroy(),a.line2d&&a.line2d.destroy&&a.line2d.destroy(),a.select2d&&a.select2d.destroy&&a.select2d.destroy(),a.glText&&a.glText.forEach(function(l){l.destroy&&l.destroy()}),a.lineOptions=null,a.fillOptions=null,a.markerOptions=null,a.markerSelectedOptions=null,a.markerUnselectedOptions=null,a.errorXOptions=null,a.errorYOptions=null,a.textOptions=null,a.textSelectedOptions=null,a.textUnselectedOptions=null,a.selectBatch=null,a.unselectBatch=null,r._scene=null}),a.dirty||gf.extendFlat(a,i),a},V7=yM,Zn=me,l1=lr,X7=cs.findExtremes,s1=nu,um=Gp,Y7=um.calcMarkerSize,W7=um.calcAxisExpansion,q7=um.setFirstScatter,Z7=T2,Kn=G7,K7=U7,f1=or.BADNUM,Q7=du.TOO_MANY_POINTS,J7=function(e,r){var a=e._fullLayout,i=r._xA=l1.getFromId(e,r.xaxis,"x"),n=r._yA=l1.getFromId(e,r.yaxis,"y"),o=a._plots[r.xaxis+r.yaxis],l=r._length,s=l>=Q7,f=l*2,c={},v,u=i.makeCalcdata(r,"x"),h=n.makeCalcdata(r,"y"),d=s1(r,i,"x",u),p=s1(r,n,"y",h),m=d.vals,y=p.vals;r._x=m,r._y=y,r.xperiodalignment&&(r._origX=u,r._xStarts=d.starts,r._xEnds=d.ends),r.yperiodalignment&&(r._origY=h,r._yStarts=p.starts,r._yEnds=p.ends);var b=new Array(f),w=new Array(l);for(v=0;v<l;v++)b[v*2]=m[v]===f1?NaN:m[v],b[v*2+1]=y[v]===f1?NaN:y[v],w[v]=v;if(i.type==="log")for(v=0;v<f;v+=2)b[v]=i.c2l(b[v]);if(n.type==="log")for(v=1;v<f;v+=2)b[v]=n.c2l(b[v]);s&&i.type!=="log"&&n.type!=="log"?c.tree=V7(b):c.ids=w,Z7(e,r);var g=eO(e,o,r,b,m,y),x=K7(e,o);q7(a,r);var _;return s?g.marker&&(_=g.marker.sizeAvg||Math.max(g.marker.size,3)):_=Y7(r,l),W7(e,r,i,n,m,y,_),g.errorX&&c1(r,i,g.errorX),g.errorY&&c1(r,n,g.errorY),g.fill&&!x.fill2d&&(x.fill2d=!0),g.marker&&!x.scatter2d&&(x.scatter2d=!0),g.line&&!x.line2d&&(x.line2d=!0),(g.errorX||g.errorY)&&!x.error2d&&(x.error2d=!0),g.text&&!x.glText&&(x.glText=!0),g.marker&&(g.marker.snap=l),x.lineOptions.push(g.line),x.errorXOptions.push(g.errorX),x.errorYOptions.push(g.errorY),x.fillOptions.push(g.fill),x.markerOptions.push(g.marker),x.markerSelectedOptions.push(g.markerSel),x.markerUnselectedOptions.push(g.markerUnsel),x.textOptions.push(g.text),x.textSelectedOptions.push(g.textSel),x.textUnselectedOptions.push(g.textUnsel),x.selectBatch.push([]),x.unselectBatch.push([]),c._scene=x,c.index=x.count,c.x=m,c.y=y,c.positions=b,x.count++,[{x:!1,y:!1,t:c,trace:r}]};function c1(t,e,r){var a=t._extremes[e._id],i=X7(e,r._bnds,{padded:!0});a.min=a.min.concat(i.min),a.max=a.max.concat(i.max)}function eO(t,e,r,a,i,n){var o=Kn.style(t,r);if(o.marker&&(o.marker.positions=a),o.line&&a.length>1&&Zn.extendFlat(o.line,Kn.linePositions(t,r,a)),o.errorX||o.errorY){var l=Kn.errorBarPositions(t,r,a,i,n);o.errorX&&Zn.extendFlat(o.errorX,l.x),o.errorY&&Zn.extendFlat(o.errorY,l.y)}return o.text&&(Zn.extendFlat(o.text,{positions:a},Kn.textPosition(t,r,o.text,o.marker)),Zn.extendFlat(o.textSel,{positions:a},Kn.textPosition(t,r,o.text,o.markerSel)),Zn.extendFlat(o.textUnsel,{positions:a},Kn.textPosition(t,r,o.text,o.markerUnsel))),o}var tO=me,rO=ht,aO=ns.DESELECTDIM;function iO(t){var e=t[0],r=e.trace,a=e.t,i=a._scene,n=a.index,o=i.selectBatch[n],l=i.unselectBatch[n],s=i.textOptions[n],f=i.textSelectedOptions[n]||{},c=i.textUnselectedOptions[n]||{},v=tO.extendFlat({},s),u,h;if(o.length||l.length){var d=f.color,p=c.color,m=s.color,y=Array.isArray(m);for(v.color=new Array(r._length),u=0;u<o.length;u++)h=o[u],v.color[h]=d||(y?m[h]:m);for(u=0;u<l.length;u++){h=l[u];var b=y?m[h]:m;v.color[h]=p||(d?b:rO.addOpacity(b,aO))}}i.glText[n].update(v)}var VA={styleTextSelection:iO},u1=Ir,nO=VA.styleTextSelection,oO=function(e,r){var a=e.cd,i=e.xaxis,n=e.yaxis,o=[],l=a[0].trace,s=a[0].t,f=l._length,c=s.x,v=s.y,u=s._scene,h=s.index;if(!u)return o;var d=u1.hasText(l),p=u1.hasMarkers(l),m=!p&&!d;if(l.visible!==!0||m)return o;var y=[],b=[];if(r!==!1&&!r.degenerate)for(var w=0;w<f;w++)r.contains([s.xpx[w],s.ypx[w]],!1,w,e)?(y.push(w),o.push({pointNumber:w,x:i.c2d(c[w]),y:n.c2d(v[w])})):b.push(w);if(p){var g=u.scatter2d;if(!y.length&&!b.length){var x=new Array(u.count);x[h]=u.markerOptions[h],g.update.apply(g,x)}else if(!u.selectBatch[h].length&&!u.unselectBatch[h].length){var _=new Array(u.count);_[h]=u.markerUnselectedOptions[h],g.update.apply(g,_)}}return u.selectBatch[h]=y,u.unselectBatch[h]=b,d&&nO(a),o},lO=f7,sO={moduleType:"trace",name:"scattergl",basePlotModule:ur,categories:["gl","regl","cartesian","symbols","errorBarsOK","showLegend","scatter-like"],attributes:OA,supplyDefaults:A7,crossTraceDefaults:_2,colorbar:ps,formatLabels:S7,calc:J7,hoverPoints:lO.hoverPoints,selectPoints:oO,meta:{hrName:"scatter_gl",description:["The data visualized as scatter point or lines is set in `x` and `y`","using the WebGL plotting engine.","Bubble charts are achieved by setting `marker.size` and/or `marker.color`","to a numerical arrays."].join(" ")}},XA={exports:{}},v1=ht,fO=function(){},cO=function(e){for(var r in e)typeof e[r]=="function"&&(e[r]=fO);e.destroy=function(){e.container.parentNode.removeChild(e.container)};var a=document.createElement("div");a.className="no-webgl",a.style.cursor="pointer",a.style.fontSize="24px",a.style.color=v1.defaults[0],a.style.position="absolute",a.style.left=a.style.top="0px",a.style.width=a.style.height="100%",a.style["background-color"]=v1.lightLine,a.style["z-index"]=30;var i=document.createElement("p");return i.textContent="WebGL is not supported by your browser - visit https://get.webgl.org for more info",i.style.position="relative",i.style.top="50%",i.style.left="50%",i.style.height="30%",i.style.width="50%",i.style.margin="-15% 0 0 -25%",a.appendChild(i),e.container.appendChild(a),e.container.style.background="#FFFFFF",e.container.onclick=function(){window.open("https://get.webgl.org")},!1},uO=cO,vO=gM,dO=function(e,r,a){var i=e._fullLayout,n=!0;return i._glcanvas.each(function(o){if(o.regl){o.regl.preloadCachedCode(a);return}if(!(o.pick&&!i._has("parcoords"))){try{o.regl=vO({canvas:this,attributes:{antialias:!o.pick,preserveDrawingBuffer:!0},pixelRatio:e._context.plotGlPixelRatio||lM.devicePixelRatio,extensions:r||[],cachedCode:a||{}})}catch{n=!1}o.regl||(n=!1),n&&this.addEventListener("webglcontextlost",function(l){e&&e.emit&&e.emit("plotly_webglcontextlost",{event:l,layer:o.key})},!1)}}),n||uO({container:i._glcontainer.node()}),n},d1=bM,h1=xM,hO=_M,p1=wM,cd=me,pO=Dn.selectMode,mO=dO,yO=Ir,gO=N2,bO=VA.styleTextSelection,YA={};function xO(t,e,r,a){var i=t._size,n=t.width*a,o=t.height*a,l=i.l*a,s=i.b*a,f=i.r*a,c=i.t*a,v=i.w*a,u=i.h*a;return[l+e.domain[0]*v,s+r.domain[0]*u,n-f-(1-e.domain[1])*v,o-c-(1-r.domain[1])*u]}var _O=XA.exports=function(e,r,a){if(a.length){var i=e._fullLayout,n=r._scene,o=r.xaxis,l=r.yaxis,s,f;if(n){var c=mO(e,["ANGLE_instanced_arrays","OES_element_index_uint"],YA);if(!c){n.init();return}var v=n.count,u=i._glcanvas.data()[0].regl;if(gO(e,r,a),n.dirty){if(n.error2d===!0&&(n.error2d=hO(u)),n.line2d===!0&&(n.line2d=h1(u)),n.scatter2d===!0&&(n.scatter2d=d1(u)),n.fill2d===!0&&(n.fill2d=h1(u)),n.glText===!0)for(n.glText=new Array(v),s=0;s<v;s++)n.glText[s]=new p1(u);if(n.glText){if(v>n.glText.length){var h=v-n.glText.length;for(s=0;s<h;s++)n.glText.push(new p1(u))}else if(v<n.glText.length){var d=n.glText.length-v,p=n.glText.splice(v,d);p.forEach(function(A){A.destroy()})}for(s=0;s<v;s++)n.glText[s].update(n.textOptions[s])}if(n.line2d&&(n.line2d.update(n.lineOptions),n.lineOptions=n.lineOptions.map(function(A){if(A&&A.positions){for(var C=A.positions,R=0;R<C.length&&(isNaN(C[R])||isNaN(C[R+1]));)R+=2;for(var N=C.length-2;N>R&&(isNaN(C[N])||isNaN(C[N+1]));)N-=2;A.positions=C.slice(R,N+2)}return A}),n.line2d.update(n.lineOptions)),n.error2d){var m=(n.errorXOptions||[]).concat(n.errorYOptions||[]);n.error2d.update(m)}n.scatter2d&&n.scatter2d.update(n.markerOptions),n.fillOrder=cd.repeat(null,v),n.fill2d&&(n.fillOptions=n.fillOptions.map(function(A,C){var R=a[C];if(!(!A||!R||!R[0]||!R[0].trace)){var N=R[0],H=N.trace,B=N.t,X=n.lineOptions[C],j,q,U=[];H._ownfill&&U.push(C),H._nexttrace&&U.push(C+1),U.length&&(n.fillOrder[C]=U);var Z=[],K=X&&X.positions||B.positions,ee,le;if(H.fill==="tozeroy"){for(ee=0;ee<K.length&&isNaN(K[ee+1]);)ee+=2;for(le=K.length-2;le>ee&&isNaN(K[le+1]);)le-=2;K[ee+1]!==0&&(Z=[K[ee],0]),Z=Z.concat(K.slice(ee,le+2)),K[le+1]!==0&&(Z=Z.concat([K[le],0]))}else if(H.fill==="tozerox"){for(ee=0;ee<K.length&&isNaN(K[ee]);)ee+=2;for(le=K.length-2;le>ee&&isNaN(K[le]);)le-=2;K[ee]!==0&&(Z=[0,K[ee+1]]),Z=Z.concat(K.slice(ee,le+2)),K[le]!==0&&(Z=Z.concat([0,K[le+1]]))}else if(H.fill==="toself"||H.fill==="tonext"){for(Z=[],j=0,A.splitNull=!0,q=0;q<K.length;q+=2)(isNaN(K[q])||isNaN(K[q+1]))&&(Z=Z.concat(K.slice(j,q)),Z.push(K[j],K[j+1]),Z.push(null,null),j=q+2);Z=Z.concat(K.slice(j)),j&&Z.push(K[j],K[j+1])}else{var ye=H._nexttrace;if(ye){var se=n.lineOptions[C+1];if(se){var G=se.positions;if(H.fill==="tonexty"){for(Z=K.slice(),C=Math.floor(G.length/2);C--;){var J=G[C*2],oe=G[C*2+1];isNaN(J)||isNaN(oe)||Z.push(J,oe)}A.fill=ye.fillcolor}}}}if(H._prevtrace&&H._prevtrace.fill==="tonext"){var fe=n.lineOptions[C-1].positions,pe=Z.length/2;j=pe;var ge=[j];for(q=0;q<fe.length;q+=2)(isNaN(fe[q])||isNaN(fe[q+1]))&&(ge.push(q/2+pe+1),j=q+2);Z=Z.concat(fe),A.hole=ge}return A.fillmode=H.fill,A.opacity=H.opacity,A.positions=Z,A}}),n.fill2d.update(n.fillOptions))}var y=i.dragmode,b=pO(y),w=i.clickmode.indexOf("select")>-1;for(s=0;s<v;s++){var g=a[s][0],x=g.trace,_=g.t,T=_.index,k=x._length,S=_.x,L=_.y;if(x.selectedpoints||b||w){if(b||(b=!0),x.selectedpoints){var D=n.selectBatch[T]=cd.selIndices2selPoints(x),$={};for(f=0;f<D.length;f++)$[D[f]]=1;var E=[];for(f=0;f<k;f++)$[f]||E.push(f);n.unselectBatch[T]=E}var z=_.xpx=new Array(k),O=_.ypx=new Array(k);for(f=0;f<k;f++)z[f]=o.c2p(S[f]),O[f]=l.c2p(L[f])}else _.xpx=_.ypx=null}if(b){if(n.select2d||(n.select2d=d1(i._glcanvas.data()[1].regl)),n.scatter2d){var I=new Array(v);for(s=0;s<v;s++)I[s]=n.selectBatch[s].length||n.unselectBatch[s].length?n.markerUnselectedOptions[s]:{};n.scatter2d.update(I)}n.select2d&&(n.select2d.update(n.markerOptions),n.select2d.update(n.markerSelectedOptions)),n.glText&&a.forEach(function(A){var C=((A||[])[0]||{}).trace||{};yO.hasText(C)&&bO(A)})}else n.scatter2d&&n.scatter2d.update(n.markerOptions);var P={viewport:xO(i,o,l,e._context.plotGlPixelRatio),range:[(o._rl||o.range)[0],(l._rl||l.range)[0],(o._rl||o.range)[1],(l._rl||l.range)[1]]},M=cd.repeat(P,n.count);n.fill2d&&n.fill2d.update(M),n.line2d&&n.line2d.update(M),n.error2d&&n.error2d.update(M.concat(M)),n.scatter2d&&n.scatter2d.update(M),n.select2d&&n.select2d.update(M),n.glText&&n.glText.forEach(function(A){A.update(P)})}}};_O.reglPrecompiled=YA;var wO=XA.exports,WA=sO;WA.plot=wO;var TO=WA,kO=TO;const Xj=Fi(kO);var qA={};(function(t){var e=cr;t.name="treemap",t.plot=function(r,a,i,n){e.plotBasePlot(t.name,r,a,i,n)},t.clean=function(r,a,i,n){e.cleanBasePlot(t.name,r,a,i,n)}})(qA);var ZA={CLICK_TRANSITION_TIME:750,CLICK_TRANSITION_EASING:"linear",eventDataKeys:["currentPath","root","entry","percentRoot","percentEntry","percentParent"]},AO=ba,MO=Dr.hovertemplateAttrs,SO=Dr.texttemplateAttrs,LO=Ln,CO=Vi.attributes,ri=uu,m1=ZA,ml=Qt.extendFlat,DO=ra.pattern,$O={labels:{valType:"data_array",editType:"calc",description:["Sets the labels of each of the sectors."].join(" ")},parents:{valType:"data_array",editType:"calc",description:["Sets the parent sectors for each of the sectors.","Empty string items '' are understood to reference","the root node in the hierarchy.",'If `ids` is filled, `parents` items are understood to be "ids" themselves.',"When `ids` is not set, plotly attempts to find matching items in `labels`,","but beware they must be unique."].join(" ")},values:{valType:"data_array",editType:"calc",description:["Sets the values associated with each of the sectors.","Use with `branchvalues` to determine how the values are summed."].join(" ")},branchvalues:{valType:"enumerated",values:["remainder","total"],dflt:"remainder",editType:"calc",description:["Determines how the items in `values` are summed.","When set to *total*, items in `values` are taken to be value of all its descendants.","When set to *remainder*, items in `values` corresponding to the root and the branches sectors","are taken to be the extra part not part of the sum of the values at their leaves."].join(" ")},count:{valType:"flaglist",flags:["branches","leaves"],dflt:"leaves",editType:"calc",description:["Determines default for `values` when it is not provided,","by inferring a 1 for each of the *leaves* and/or *branches*, otherwise 0."].join(" ")},level:{valType:"any",editType:"plot",anim:!0,description:["Sets the level from which this trace hierarchy is rendered.","Set `level` to `''` to start from the root node in the hierarchy.",'Must be an "id" if `ids` is filled in, otherwise plotly attempts to find a matching',"item in `labels`."].join(" ")},maxdepth:{valType:"integer",editType:"plot",dflt:-1,description:["Sets the number of rendered sectors from any given `level`.","Set `maxdepth` to *-1* to render all the levels in the hierarchy."].join(" ")},marker:ml({colors:{valType:"data_array",editType:"calc",description:["Sets the color of each sector of this trace.","If not specified, the default trace color set is used","to pick the sector colors."].join(" ")},line:{color:ml({},ri.marker.line.color,{dflt:null,description:["Sets the color of the line enclosing each sector.","Defaults to the `paper_bgcolor` value."].join(" ")}),width:ml({},ri.marker.line.width,{dflt:1}),editType:"calc"},pattern:DO,editType:"calc"},LO("marker",{colorAttr:"colors",anim:!1})),leaf:{opacity:{valType:"number",editType:"style",min:0,max:1,description:["Sets the opacity of the leaves. With colorscale","it is defaulted to 1; otherwise it is defaulted to 0.7"].join(" ")},editType:"plot"},text:ri.text,textinfo:{valType:"flaglist",flags:["label","text","value","current path","percent root","percent entry","percent parent"],extras:["none"],editType:"plot",description:["Determines which trace information appear on the graph."].join(" ")},texttemplate:SO({editType:"plot"},{keys:m1.eventDataKeys.concat(["label","value"])}),hovertext:ri.hovertext,hoverinfo:ml({},AO.hoverinfo,{flags:["label","text","value","name","current path","percent root","percent entry","percent parent"],dflt:"label+text+value+name"}),hovertemplate:MO({},{keys:m1.eventDataKeys}),textfont:ri.textfont,insidetextorientation:ri.insidetextorientation,insidetextfont:ri.insidetextfont,outsidetextfont:ml({},ri.outsidetextfont,{description:["Sets the font used for `textinfo` lying outside the sector.","This option refers to the root of the hierarchy","presented at the center of a sunburst graph.","Please note that if a hierarchy has multiple root nodes,","this option won't have any effect and `insidetextfont` would be used."].join(" ")}),rotation:{valType:"angle",dflt:0,editType:"plot",description:["Rotates the whole diagram counterclockwise by some angle.","By default the first slice starts at 3 o'clock."].join(" ")},sort:ri.sort,root:{color:{valType:"color",editType:"calc",dflt:"rgba(0,0,0,0)",description:["sets the color of the root node for a sunburst/treemap/icicle trace.","this has no effect when a colorscale is used to set the markers."].join(" ")},editType:"calc"},domain:CO({name:"sunburst",trace:!0,editType:"calc"})},pu={CLICK_TRANSITION_TIME:750,CLICK_TRANSITION_EASING:"poly",eventDataKeys:["currentPath","root","entry","percentRoot","percentEntry","percentParent"],gapWithPathbar:1},PO=Dr.hovertemplateAttrs,RO=Dr.texttemplateAttrs,EO=Ln,zO=Vi.attributes,en=uu,sa=$O,y1=pu,ud=Qt.extendFlat,IO=ra.pattern,KA={labels:sa.labels,parents:sa.parents,values:sa.values,branchvalues:sa.branchvalues,count:sa.count,level:sa.level,maxdepth:sa.maxdepth,tiling:{packing:{valType:"enumerated",values:["squarify","binary","dice","slice","slice-dice","dice-slice"],dflt:"squarify",editType:"plot",description:["Determines d3 treemap solver.","For more info please refer to https://github.com/d3/d3-hierarchy#treemap-tiling"].join(" ")},squarifyratio:{valType:"number",min:1,dflt:1,editType:"plot",description:["When using *squarify* `packing` algorithm, according to https://github.com/d3/d3-hierarchy/blob/v3.1.1/README.md#squarify_ratio","this option specifies the desired aspect ratio of the generated rectangles.","The ratio must be specified as a number greater than or equal to one.","Note that the orientation of the generated rectangles (tall or wide)","is not implied by the ratio; for example, a ratio of two will attempt","to produce a mixture of rectangles whose width:height ratio is either 2:1 or 1:2.","When using *squarify*, unlike d3 which uses the Golden Ratio i.e. 1.618034,","Plotly applies 1 to increase squares in treemap layouts."].join(" ")},flip:{valType:"flaglist",flags:["x","y"],dflt:"",editType:"plot",description:["Determines if the positions obtained from solver are flipped on each axis."].join(" ")},pad:{valType:"number",min:0,dflt:3,editType:"plot",description:["Sets the inner padding (in px)."].join(" ")},editType:"calc"},marker:ud({pad:{t:{valType:"number",min:0,editType:"plot",description:["Sets the padding form the top (in px)."].join(" ")},l:{valType:"number",min:0,editType:"plot",description:["Sets the padding form the left (in px)."].join(" ")},r:{valType:"number",min:0,editType:"plot",description:["Sets the padding form the right (in px)."].join(" ")},b:{valType:"number",min:0,editType:"plot",description:["Sets the padding form the bottom (in px)."].join(" ")},editType:"calc"},colors:sa.marker.colors,pattern:IO,depthfade:{valType:"enumerated",values:[!0,!1,"reversed"],editType:"style",description:["Determines if the sector colors are faded towards","the background from the leaves up to the headers.","This option is unavailable when a `colorscale` is present,","defaults to false when `marker.colors` is set,","but otherwise defaults to true.","When set to *reversed*, the fading direction is inverted,","that is the top elements within hierarchy are drawn with fully saturated colors","while the leaves are faded towards the background color."].join(" ")},line:sa.marker.line,cornerradius:{valType:"number",min:0,dflt:0,editType:"plot",description:["Sets the maximum rounding of corners (in px)."].join(" ")},editType:"calc"},EO("marker",{colorAttr:"colors",anim:!1})),pathbar:{visible:{valType:"boolean",dflt:!0,editType:"plot",description:["Determines if the path bar is drawn","i.e. outside the trace `domain` and","with one pixel gap."].join(" ")},side:{valType:"enumerated",values:["top","bottom"],dflt:"top",editType:"plot",description:["Determines on which side of the the treemap the","`pathbar` should be presented."].join(" ")},edgeshape:{valType:"enumerated",values:[">","<","|","/","\\"],dflt:">",editType:"plot",description:["Determines which shape is used for edges between `barpath` labels."].join(" ")},thickness:{valType:"number",min:12,editType:"plot",description:["Sets the thickness of `pathbar` (in px). If not specified the `pathbar.textfont.size` is used","with 3 pixles extra padding on each side."].join(" ")},textfont:ud({},en.textfont,{description:"Sets the font used inside `pathbar`."}),editType:"calc"},text:en.text,textinfo:sa.textinfo,texttemplate:RO({editType:"plot"},{keys:y1.eventDataKeys.concat(["label","value"])}),hovertext:en.hovertext,hoverinfo:sa.hoverinfo,hovertemplate:PO({},{keys:y1.eventDataKeys}),textfont:en.textfont,insidetextfont:en.insidetextfont,outsidetextfont:ud({},en.outsidetextfont,{description:["Sets the font used for `textinfo` lying outside the sector.","This option refers to the root of the hierarchy","presented on top left corner of a treemap graph.","Please note that if a hierarchy has multiple root nodes,","this option won't have any effect and `insidetextfont` would be used."].join(" ")}),textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right"],dflt:"top left",editType:"plot",description:["Sets the positions of the `text` elements."].join(" ")},sort:en.sort,root:sa.root,domain:zO({name:"treemap",trace:!0,editType:"calc"})},QA={treemapcolorway:{valType:"colorlist",editType:"calc",description:["Sets the default treemap slice colors. Defaults to the main","`colorway` used for trace colors. If you specify a new","list here it can still be extended with lighter and darker","colors, see `extendtreemapcolors`."].join(" ")},extendtreemapcolors:{valType:"boolean",dflt:!0,editType:"calc",description:["If `true`, the treemap slice colors (whether given by `treemapcolorway` or","inherited from `colorway`) will be extended to three times its","original length by first repeating every color 20% lighter then","each color 20% darker. This is intended to reduce the likelihood","of reusing the same color when you have many slices, but you can","set `false` to disable.","Colors provided in the trace, using `marker.colors`, are never","extended."].join(" ")}},FO=me,NO=KA,HO=ht,OO=Vi.defaults,jO=es.handleText,BO=ys.TEXTPAD,GO=cA.handleMarkerDefaults,JA=wo,UO=JA.hasColorscale,VO=JA.handleDefaults,XO=function(e,r,a,i){function n(m,y){return FO.coerce(e,r,NO,m,y)}var o=n("labels"),l=n("parents");if(!o||!o.length||!l||!l.length){r.visible=!1;return}var s=n("values");s&&s.length?n("branchvalues"):n("count"),n("level"),n("maxdepth");var f=n("tiling.packing");f==="squarify"&&n("tiling.squarifyratio"),n("tiling.flip"),n("tiling.pad");var c=n("text");n("texttemplate"),r.texttemplate||n("textinfo",Array.isArray(c)?"text+label":"label"),n("hovertext"),n("hovertemplate");var v=n("pathbar.visible"),u="auto";jO(e,r,i,n,u,{hasPathbar:v,moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),n("textposition");var h=r.textposition.indexOf("bottom")!==-1;GO(e,r,i,n);var d=r._hasColorscale=UO(e,"marker","colors")||(e.marker||{}).coloraxis;d?VO(e,r,i,n,{prefix:"marker.",cLetter:"c"}):n("marker.depthfade",!(r.marker.colors||[]).length);var p=r.textfont.size*2;n("marker.pad.t",h?p/4:p),n("marker.pad.l",p/4),n("marker.pad.r",p/4),n("marker.pad.b",h?p:p/4),n("marker.cornerradius"),r._hovered={marker:{line:{width:2,color:HO.contrast(i.paper_bgcolor)}}},v&&(n("pathbar.thickness",r.pathbar.textfont.size+2*BO),n("pathbar.side"),n("pathbar.edgeshape")),n("sort"),n("root.color"),OO(r,i,n),r._length=null},YO=me,WO=QA,qO=function(e,r){function a(i,n){return YO.coerce(e,r,WO,i,n)}a("treemapcolorway",r.colorway),a("extendtreemapcolors")},_c={},eM={};(function(t){var e=Mh,r=wt,a=me,i=wo.makeColorScaleFuncFromTrace,n=yc.makePullColorFn,o=yc.generateExtendedColors,l=wo.calc,s=or.ALMOST_EQUAL,f={},c={},v={};t.calc=function(h,d){var p=h._fullLayout,m=d.ids,y=a.isArrayOrTypedArray(m),b=d.labels,w=d.parents,g=d.values,x=a.isArrayOrTypedArray(g),_=[],T={},k={},S=function(K,ee){T[K]?T[K].push(ee):T[K]=[ee],k[ee]=1},L=function(K){return K||typeof K=="number"},D=function(K){return!x||r(g[K])&&g[K]>=0},$,E,z;y?($=Math.min(m.length,w.length),E=function(K){return L(m[K])&&D(K)},z=function(K){return String(m[K])}):($=Math.min(b.length,w.length),E=function(K){return L(b[K])&&D(K)},z=function(K){return String(b[K])}),x&&($=Math.min($,g.length));for(var O=0;O<$;O++)if(E(O)){var I=z(O),P=L(w[O])?String(w[O]):"",M={i:O,id:I,pid:P,label:L(b[O])?String(b[O]):""};x&&(M.v=+g[O]),_.push(M),S(P,I)}if(T[""]){if(T[""].length>1){for(var R=a.randstr(),N=0;N<_.length;N++)_[N].pid===""&&(_[N].pid=R);_.unshift({hasMultipleRoots:!0,id:R,pid:"",label:""})}}else{var A=[],C;for(C in T)k[C]||A.push(C);if(A.length===1)C=A[0],_.unshift({hasImpliedRoot:!0,id:C,pid:"",label:C});else return a.warn(["Multiple implied roots, cannot build",d.type,"hierarchy of",d.name+".","These roots include:",A.join(", ")].join(" "))}var H;try{H=e.stratify().id(function(K){return K.id}).parentId(function(K){return K.pid})(_)}catch(K){return a.warn(["Failed to build",d.type,"hierarchy of",d.name+".","Error:",K.message].join(" "))}var B=e.hierarchy(H),X=!1;if(x)switch(d.branchvalues){case"remainder":B.sum(function(K){return K.data.v});break;case"total":B.each(function(K){var ee=K.data.data,le=ee.v;if(K.children){var ye=K.children.reduce(function(se,G){return se+G.data.data.v},0);if((ee.hasImpliedRoot||ee.hasMultipleRoots)&&(le=ye),le<ye*s)return X=!0,a.warn(["Total value for node",K.data.data.id,"of",d.name,"is smaller than the sum of its children.",`
5
+ parent value =`,le,`
6
+ children sum =`,ye].join(" "))}K.value=le});break}else u(B,d,{branches:d.count.indexOf("branches")!==-1,leaves:d.count.indexOf("leaves")!==-1});if(!X){d.sort&&B.sort(function(K,ee){return ee.value-K.value});var j,q,U=d.marker.colors||[],Z=!!U.length;return d._hasColorscale?(Z||(U=x?d.values:d._values),l(h,d,{vals:U,containerStr:"marker",cLetter:"c"}),q=i(d.marker)):j=n(p["_"+d.type+"colormap"]),B.each(function(K){var ee=K.data.data;ee.color=d._hasColorscale?q(U[ee.i]):j(U[ee.i],ee.id)}),_[0].hierarchy=B,_}},t._runCrossTraceCalc=function(h,d){var p=d._fullLayout,m=d.calcdata,y=p[h+"colorway"],b=p["_"+h+"colormap"];p["extend"+h+"colors"]&&(y=o(y,h==="icicle"?v:h==="treemap"?c:f));var w=0,g;function x(S){var L=S.data.data,D=L.id;L.color===!1&&(b[D]?L.color=b[D]:S.parent?S.parent.parent?L.color=S.parent.data.data.color:(b[D]=L.color=y[w%y.length],w++):L.color=g)}for(var _=0;_<m.length;_++){var T=m[_],k=T[0];k.trace.type===h&&k.hierarchy&&(g=k.trace.root.color,k.hierarchy.each(x))}},t.crossTraceCalc=function(h){return t._runCrossTraceCalc("sunburst",h)};function u(h,d,p){var m=0,y=h.children;if(y){for(var b=y.length,w=0;w<b;w++)m+=u(y[w],d,p);p.branches&&m++}else p.leaves&&m++;return h.value=h.data.data.value=m,d._values||(d._values=[]),d._values[h.data.data.i]=m,m}})(eM);var tM=eM;_c.calc=function(t,e){return tM.calc(t,e)};_c.crossTraceCalc=function(t){return tM._runCrossTraceCalc("treemap",t)};var Xi={};(function(t){var e=me,r=ht,a=ji,i=Cn;t.findEntryWithLevel=function(s,f){var c;return f&&s.eachAfter(function(v){if(t.getPtId(v)===f)return c=v.copy()}),c||s},t.findEntryWithChild=function(s,f){var c;return s.eachAfter(function(v){for(var u=v.children||[],h=0;h<u.length;h++){var d=u[h];if(t.getPtId(d)===f)return c=v.copy()}}),c||s},t.isEntry=function(s){return!s.parent},t.isLeaf=function(s){return!s.children},t.getPtId=function(s){return s.data.data.id},t.getPtLabel=function(s){return s.data.data.label},t.getValue=function(s){return s.value},t.isHierarchyRoot=function(s){return l(s)===""},t.setSliceCursor=function(s,f,c){var v=c.isTransitioning;if(!v){var u=s.datum();v=c.hideOnRoot&&t.isHierarchyRoot(u)||c.hideOnLeaves&&t.isLeaf(u)}a(s,v?null:"pointer")};function n(s,f,c){return{color:t.getOutsideTextFontKey("color",s,f,c),family:t.getOutsideTextFontKey("family",s,f,c),size:t.getOutsideTextFontKey("size",s,f,c)}}function o(s,f,c,v){var u=(v||{}).onPathbar,h=f.data.data,d=h.i,p=e.castOption(s,d,(u?"pathbar.textfont":"insidetextfont")+".color");return!p&&s._input.textfont&&(p=e.castOption(s._input,d,"textfont.color")),{color:p||r.contrast(h.color),family:t.getInsideTextFontKey("family",s,f,c,v),size:t.getInsideTextFontKey("size",s,f,c,v)}}t.getInsideTextFontKey=function(s,f,c,v,u){var h=(u||{}).onPathbar,d=h?"pathbar.textfont":"insidetextfont",p=c.data.data.i;return e.castOption(f,p,d+"."+s)||e.castOption(f,p,"textfont."+s)||v.size},t.getOutsideTextFontKey=function(s,f,c,v){var u=c.data.data.i;return e.castOption(f,u,"outsidetextfont."+s)||e.castOption(f,u,"textfont."+s)||v.size},t.isOutsideText=function(s,f){return!s._hasColorscale&&t.isHierarchyRoot(f)},t.determineTextFont=function(s,f,c,v){return t.isOutsideText(s,f)?n(s,f,c):o(s,f,c,v)},t.hasTransition=function(s){return!!(s&&s.duration>0)},t.getMaxDepth=function(s){return s.maxdepth>=0?s.maxdepth:1/0},t.isHeader=function(s,f){return!(t.isLeaf(s)||s.depth===f._maxDepth-1)};function l(s){return s.data.data.pid}t.getParent=function(s,f){return t.findEntryWithLevel(s,l(f))},t.listPath=function(s,f){var c=s.parent;if(!c)return[];var v=f?[c.data[f]]:[c];return t.listPath(c,f).concat(v)},t.getPath=function(s){return t.listPath(s,"label").join("/")+"/"},t.formatValue=i.formatPieValue,t.formatPercent=function(s,f){var c=e.formatPercent(s,0);return c==="0%"&&(c=i.formatPiePercent(s,f)),c}})(Xi);var ZO=function t(e,r,a){var i;a.swapXY&&(i=e.x0,e.x0=e.y0,e.y0=i,i=e.x1,e.x1=e.y1,e.y1=i),a.flipX&&(i=e.x0,e.x0=r[0]-e.x1,e.x1=r[0]-i),a.flipY&&(i=e.y0,e.y0=r[1]-e.y1,e.y1=r[1]-i);var n=e.children;if(n)for(var o=0;o<n.length;o++)t(n[o],r,a)},lo=Mh,KO=ZO,rM=function(e,r,a){var i=a.flipX,n=a.flipY,o=a.packing==="dice-slice",l=a.pad[n?"bottom":"top"],s=a.pad[i?"right":"left"],f=a.pad[i?"left":"right"],c=a.pad[n?"top":"bottom"],v;o&&(v=s,s=l,l=v,v=f,f=c,c=v);var u=lo.treemap().tile(QO(a.packing,a.squarifyratio)).paddingInner(a.pad.inner).paddingLeft(s).paddingRight(f).paddingTop(l).paddingBottom(c).size(o?[r[1],r[0]]:r)(e);return(o||i||n)&&KO(u,r,{swapXY:o,flipX:i,flipY:n}),u};function QO(t,e){switch(t){case"squarify":return lo.treemapSquarify.ratio(e);case"binary":return lo.treemapBinary;case"dice":return lo.treemapDice;case"slice":return lo.treemapSlice;default:return lo.treemapSliceDice}}var JO=$t,ej=ht,aM=function(e,r,a,i,n){var o=r.data.data,l=o.i,s=n||o.color;if(l>=0){r.i=o.i;var f=a.marker;f.pattern?(!f.colors||!f.pattern.shape)&&(f.color=s,r.color=s):(f.color=s,r.color=s),JO.pointStyle(e,a,i,r)}else ej.fill(e,s)},g1=gt,Qn=ht,b1=me,vd=Xi,tj=vi.resizeText,rj=aM;function aj(t){var e=t._fullLayout._treemaplayer.selectAll(".trace");tj(t,e,"treemap"),e.each(function(r){var a=g1.select(this),i=r[0],n=i.trace;a.style("opacity",n.opacity),a.selectAll("path.surface").each(function(o){g1.select(this).call(iM,o,n,t,{hovered:!1})})})}function iM(t,e,r,a,i){var n=(i||{}).hovered,o=e.data.data,l=o.i,s,f,c=o.color,v=vd.isHierarchyRoot(e),u=1;if(n)s=r._hovered.marker.line.color,f=r._hovered.marker.line.width;else if(v&&c===r.root.color)u=100,s="rgba(0,0,0,0)",f=0;else if(s=b1.castOption(r,l,"marker.line.color")||Qn.defaultLine,f=b1.castOption(r,l,"marker.line.width")||0,!r._hasColorscale&&!e.onPathbar){var h=r.marker.depthfade;if(h){var d=Qn.combine(Qn.addOpacity(r._backgroundColor,.75),c),p;if(h===!0){var m=vd.getMaxDepth(r);isFinite(m)?vd.isLeaf(e)?p=0:p=r._maxVisibleLayers-(e.data.depth-r._entryDepth):p=e.data.height+1}else p=e.data.depth-r._entryDepth,r._atRootLevel||p++;if(p>0)for(var y=0;y<p;y++){var b=.5*y/p;c=Qn.combine(Qn.addOpacity(d,b),c)}}}t.call(rj,e,r,a,c).style("stroke-width",f).call(Qn.stroke,s).style("opacity",u)}var vm={style:aj,styleOne:iM},Jn=gt,x1=ot,ij=xa.appendArrayPointValue,yl=Ia,_1=me,nj=ls,dr=Xi,oj=Cn,lj=oj.formatPieValue,dm=function(e,r,a,i,n){var o=i[0],l=o.trace,s=o.hierarchy,f=l.type==="sunburst",c=l.type==="treemap"||l.type==="icicle";"_hasHoverLabel"in l||(l._hasHoverLabel=!1),"_hasHoverEvent"in l||(l._hasHoverEvent=!1);var v=function(d){var p=a._fullLayout;if(!(a._dragging||p.hovermode===!1)){var m=a._fullData[l.index],y=d.data.data,b=y.i,w=dr.isHierarchyRoot(d),g=dr.getParent(s,d),x=dr.getValue(d),_=function(H){return _1.castOption(m,b,H)},T=_("hovertemplate"),k=yl.castHoverinfo(m,p,b),S=p.separators,L;if(T||k&&k!=="none"&&k!=="skip"){var D,$;f&&(D=o.cx+d.pxmid[0]*(1-d.rInscribed),$=o.cy+d.pxmid[1]*(1-d.rInscribed)),c&&(D=d._hoverX,$=d._hoverY);var E={},z=[],O=[],I=function(H){return z.indexOf(H)!==-1};k&&(z=k==="all"?m._module.attributes.hoverinfo.flags:k.split("+")),E.label=y.label,I("label")&&E.label&&O.push(E.label),y.hasOwnProperty("v")&&(E.value=y.v,E.valueLabel=lj(E.value,S),I("value")&&O.push(E.valueLabel)),E.currentPath=d.currentPath=dr.getPath(d.data),I("current path")&&!w&&O.push(E.currentPath);var P,M=[],A=function(){M.indexOf(P)===-1&&(O.push(P),M.push(P))};E.percentParent=d.percentParent=x/dr.getValue(g),E.parent=d.parentString=dr.getPtLabel(g),I("percent parent")&&(P=dr.formatPercent(E.percentParent,S)+" of "+E.parent,A()),E.percentEntry=d.percentEntry=x/dr.getValue(r),E.entry=d.entry=dr.getPtLabel(r),I("percent entry")&&!w&&!d.onPathbar&&(P=dr.formatPercent(E.percentEntry,S)+" of "+E.entry,A()),E.percentRoot=d.percentRoot=x/dr.getValue(s),E.root=d.root=dr.getPtLabel(s),I("percent root")&&!w&&(P=dr.formatPercent(E.percentRoot,S)+" of "+E.root,A()),E.text=_("hovertext")||_("text"),I("text")&&(P=E.text,_1.isValidTextValue(P)&&O.push(P)),L=[gl(d,m,n.eventDataKeys)];var C={trace:m,y:$,_x0:d._x0,_x1:d._x1,_y0:d._y0,_y1:d._y1,text:O.join("<br>"),name:T||I("name")?m.name:void 0,color:_("hoverlabel.bgcolor")||y.color,borderColor:_("hoverlabel.bordercolor"),fontFamily:_("hoverlabel.font.family"),fontSize:_("hoverlabel.font.size"),fontColor:_("hoverlabel.font.color"),nameLength:_("hoverlabel.namelength"),textAlign:_("hoverlabel.align"),hovertemplate:T,hovertemplateLabels:E,eventData:L};f&&(C.x0=D-d.rInscribed*d.rpx1,C.x1=D+d.rInscribed*d.rpx1,C.idealAlign=d.pxmid[0]<0?"left":"right"),c&&(C.x=D,C.idealAlign=D<0?"left":"right");var R=[];yl.loneHover(C,{container:p._hoverlayer.node(),outerContainer:p._paper.node(),gd:a,inOut_bbox:R}),L[0].bbox=R[0],l._hasHoverLabel=!0}if(c){var N=e.select("path.surface");n.styleOne(N,d,m,a,{hovered:!0})}l._hasHoverEvent=!0,a.emit("plotly_hover",{points:L||[gl(d,m,n.eventDataKeys)],event:Jn.event})}},u=function(d){var p=a._fullLayout,m=a._fullData[l.index],y=Jn.select(this).datum();if(l._hasHoverEvent&&(d.originalEvent=Jn.event,a.emit("plotly_unhover",{points:[gl(y,m,n.eventDataKeys)],event:Jn.event}),l._hasHoverEvent=!1),l._hasHoverLabel&&(yl.loneUnhover(p._hoverlayer.node()),l._hasHoverLabel=!1),c){var b=e.select("path.surface");n.styleOne(b,y,m,a,{hovered:!1})}},h=function(d){var p=a._fullLayout,m=a._fullData[l.index],y=f&&(dr.isHierarchyRoot(d)||dr.isLeaf(d)),b=dr.getPtId(d),w=dr.isEntry(d)?dr.findEntryWithChild(s,b):dr.findEntryWithLevel(s,b),g=dr.getPtId(w),x={points:[gl(d,m,n.eventDataKeys)],event:Jn.event};y||(x.nextLevel=g);var _=nj.triggerHandler(a,"plotly_"+l.type+"click",x);if(_!==!1&&p.hovermode&&(a._hoverdata=[gl(d,m,n.eventDataKeys)],yl.click(a,Jn.event)),!y&&_!==!1&&!a._dragging&&!a._transitioning){x1.call("_storeDirectGUIEdit",m,p._tracePreGUI[m.uid],{level:m.level});var T={data:[{level:g}],traces:[l.index]},k={frame:{redraw:!1,duration:n.transitionTime},transition:{duration:n.transitionTime,easing:n.transitionEasing},mode:"immediate",fromcurrent:!0};yl.loneUnhover(p._hoverlayer.node()),x1.call("animate",a,T,k)}};e.on("mouseover",v),e.on("mouseout",u),e.on("click",h)};function gl(t,e,r){for(var a=t.data.data,i={curveNumber:e.index,pointNumber:a.i,data:e._input,fullData:e},n=0;n<r.length;n++){var o=r[n];o in t&&(i[o]=t[o])}return"parentString"in t&&!dr.isHierarchyRoot(t)&&(i.parent=t.parentString),ij(i,e,a.i),i}var w1=gt,bf=me,T1=$t,sj=br,fj=rM,k1=vm.styleOne,dd=pu,eo=Xi,cj=dm,hd=!0,uj=function(e,r,a,i,n){var o=n.barDifY,l=n.width,s=n.height,f=n.viewX,c=n.viewY,v=n.pathSlice,u=n.toMoveInsideSlice,h=n.strTransform,d=n.hasTransition,p=n.handleSlicesExit,m=n.makeUpdateSliceInterpolator,y=n.makeUpdateTextInterpolator,b={},w=e._context.staticPlot,g=e._fullLayout,x=r[0],_=x.trace,T=x.hierarchy,k=l/_._entryDepth,S=eo.listPath(a.data,"id"),L=fj(T.copy(),[l,s],{packing:"dice",pad:{inner:0,top:0,left:0,right:0,bottom:0}}).descendants();L=L.filter(function($){var E=S.indexOf($.data.id);return E===-1?!1:($.x0=k*E,$.x1=k*(E+1),$.y0=o,$.y1=o+s,$.onPathbar=!0,!0)}),L.reverse(),i=i.data(L,eo.getPtId),i.enter().append("g").classed("pathbar",!0),p(i,hd,b,[l,s],v),i.order();var D=i;d&&(D=D.transition().each("end",function(){var $=w1.select(this);eo.setSliceCursor($,e,{hideOnRoot:!1,hideOnLeaves:!1,isTransitioning:!1})})),D.each(function($){$._x0=f($.x0),$._x1=f($.x1),$._y0=c($.y0),$._y1=c($.y1),$._hoverX=f($.x1-Math.min(l,s)/2),$._hoverY=c($.y1-s/2);var E=w1.select(this),z=bf.ensureSingle(E,"path","surface",function(M){M.style("pointer-events",w?"none":"all")});d?z.transition().attrTween("d",function(M){var A=m(M,hd,b,[l,s]);return function(C){return v(A(C))}}):z.attr("d",v),E.call(cj,a,e,r,{styleOne:k1,eventDataKeys:dd.eventDataKeys,transitionTime:dd.CLICK_TRANSITION_TIME,transitionEasing:dd.CLICK_TRANSITION_EASING}).call(eo.setSliceCursor,e,{hideOnRoot:!1,hideOnLeaves:!1,isTransitioning:e._transitioning}),z.call(k1,$,_,e,{hovered:!1}),$._text=(eo.getPtLabel($)||"").split("<br>").join(" ")||"";var O=bf.ensureSingle(E,"g","slicetext"),I=bf.ensureSingle(O,"text","",function(M){M.attr("data-notex",1)}),P=bf.ensureUniformFontSize(e,eo.determineTextFont(_,$,g.font,{onPathbar:!0}));I.text($._text||" ").classed("slicetext",!0).attr("text-anchor","start").call(T1.font,P).call(sj.convertToTspans,e),$.textBB=T1.bBox(I.node()),$.transform=u($,{fontSize:P.size,onPathbar:!0}),$.transform.fontSize=P.size,d?I.transition().attrTween("transform",function(M){var A=y(M,hd,b,[l,s]);return function(C){return h(A(C))}}):I.attr("transform",h($))})},A1=gt,pd=O1.interpolate,Ai=Xi,bl=me,M1=ys.TEXTPAD,vj=sm,dj=vj.toMoveInsideBar,hj=vi,md=hj.recordMinTextSize,pj=pu,mj=uj;function tn(t){return Ai.isHierarchyRoot(t)?"":Ai.getPtId(t)}var yj=function(e,r,a,i,n){var o=e._fullLayout,l=r[0],s=l.trace,f=s.type,c=f==="icicle",v=l.hierarchy,u=Ai.findEntryWithLevel(v,s.level),h=A1.select(a),d=h.selectAll("g.pathbar"),p=h.selectAll("g.slice");if(!u){d.remove(),p.remove();return}var m=Ai.isHierarchyRoot(u),y=!o.uniformtext.mode&&Ai.hasTransition(i),b=Ai.getMaxDepth(s),w=function(te){return te.data.depth-u.data.depth<b},g=o._size,x=s.domain,_=g.w*(x.x[1]-x.x[0]),T=g.h*(x.y[1]-x.y[0]),k=_,S=s.pathbar.thickness,L=s.marker.line.width+pj.gapWithPathbar,D=s.pathbar.visible?s.pathbar.side.indexOf("bottom")>-1?T+L:-(S+L):0,$={x0:k,x1:k,y0:D,y1:D+S},E=function(te,Te,ne){var de=s.tiling.pad,he=function(be){return be-de<=Te.x0},Ae=function(be){return be+de>=Te.x1},Me=function(be){return be-de<=Te.y0},we=function(be){return be+de>=Te.y1};return te.x0===Te.x0&&te.x1===Te.x1&&te.y0===Te.y0&&te.y1===Te.y1?{x0:te.x0,x1:te.x1,y0:te.y0,y1:te.y1}:{x0:he(te.x0-de)?0:Ae(te.x0-de)?ne[0]:te.x0,x1:he(te.x1+de)?0:Ae(te.x1+de)?ne[0]:te.x1,y0:Me(te.y0-de)?0:we(te.y0-de)?ne[1]:te.y0,y1:Me(te.y1+de)?0:we(te.y1+de)?ne[1]:te.y1}},z=null,O={},I={},P=null,M=function(te,Te){return Te?O[tn(te)]:I[tn(te)]},A=function(te,Te,ne,de){if(Te)return O[tn(v)]||$;var he=I[s.level]||ne;return w(te)?E(te,he,de):{}};l.hasMultipleRoots&&m&&b++,s._maxDepth=b,s._backgroundColor=o.paper_bgcolor,s._entryDepth=u.data.depth,s._atRootLevel=m;var C=-_/2+g.l+g.w*(x.x[1]+x.x[0])/2,R=-T/2+g.t+g.h*(1-(x.y[1]+x.y[0])/2),N=function(te){return C+te},H=function(te){return R+te},B=H(0),X=N(0),j=function(te){return X+te},q=function(te){return B+te};function U(te,Te){return te+","+Te}var Z=j(0),K=function(te){te.x=Math.max(Z,te.x)},ee=s.pathbar.edgeshape,le=function(te){var Te=j(Math.max(Math.min(te.x0,te.x0),0)),ne=j(Math.min(Math.max(te.x1,te.x1),k)),de=q(te.y0),he=q(te.y1),Ae=S/2,Me={},we={};Me.x=Te,we.x=ne,Me.y=we.y=(de+he)/2;var be={x:Te,y:de},Ve={x:ne,y:de},Fe={x:ne,y:he},Oe={x:Te,y:he};return ee===">"?(be.x-=Ae,Ve.x-=Ae,Fe.x-=Ae,Oe.x-=Ae):ee==="/"?(Fe.x-=Ae,Oe.x-=Ae,Me.x-=Ae/2,we.x-=Ae/2):ee==="\\"?(be.x-=Ae,Ve.x-=Ae,Me.x-=Ae/2,we.x-=Ae/2):ee==="<"&&(Me.x-=Ae,we.x-=Ae),K(be),K(Oe),K(Me),K(Ve),K(Fe),K(we),"M"+U(be.x,be.y)+"L"+U(Ve.x,Ve.y)+"L"+U(we.x,we.y)+"L"+U(Fe.x,Fe.y)+"L"+U(Oe.x,Oe.y)+"L"+U(Me.x,Me.y)+"Z"},ye=s[c?"tiling":"marker"].pad,se=function(te){return s.textposition.indexOf(te)!==-1},G=se("top"),J=se("left"),oe=se("right"),fe=se("bottom"),pe=function(te){var Te=N(te.x0),ne=N(te.x1),de=H(te.y0),he=H(te.y1),Ae=ne-Te,Me=he-de;if(!Ae||!Me)return"";var we=s.marker.cornerradius||0,be=Math.min(we,Ae/2,Me/2);be&&te.data&&te.data.data&&te.data.data.label&&(G&&(be=Math.min(be,ye.t)),J&&(be=Math.min(be,ye.l)),oe&&(be=Math.min(be,ye.r)),fe&&(be=Math.min(be,ye.b)));var Ve=function(Fe,Oe){return be?"a"+U(be,be)+" 0 0 1 "+U(Fe,Oe):""};return"M"+U(Te,de+be)+Ve(be,-be)+"L"+U(ne-be,de)+Ve(be,be)+"L"+U(ne,he-be)+Ve(-be,be)+"L"+U(Te+be,he)+Ve(-be,-be)+"Z"},ge=function(te,Te){var ne=te.x0,de=te.x1,he=te.y0,Ae=te.y1,Me=te.textBB,we=G||Te.isHeader&&!fe,be=we?"start":fe?"end":"middle",Ve=se("right"),Fe=se("left")||Te.onPathbar,Oe=Fe?-1:Ve?1:0;if(Te.isHeader){if(ne+=(c?ye:ye.l)-M1,de-=(c?ye:ye.r)-M1,ne>=de){var Ge=(ne+de)/2;ne=Ge,de=Ge}var lt;fe?(lt=Ae-(c?ye:ye.b),he<lt&&lt<Ae&&(he=lt)):(lt=he+(c?ye:ye.t),he<lt&&lt<Ae&&(Ae=lt))}var xe=dj(ne,de,he,Ae,Me,{isHorizontal:!1,constrained:!0,angle:0,anchor:be,leftToRight:Oe});return xe.fontSize=Te.fontSize,xe.targetX=N(xe.targetX),xe.targetY=H(xe.targetY),isNaN(xe.targetX)||isNaN(xe.targetY)?{}:(ne!==de&&he!==Ae&&md(s.type,xe,o),{scale:xe.scale,rotate:xe.rotate,textX:xe.textX,textY:xe.textY,anchorX:xe.anchorX,anchorY:xe.anchorY,targetX:xe.targetX,targetY:xe.targetY})},ue=function(te,Te){for(var ne,de=0,he=te;!ne&&de<b;)de++,he=he.parent,he?ne=M(he,Te):de=b;return ne||{}},Ce=function(te,Te,ne,de){var he=M(te,Te),Ae;if(Te)Ae=$;else{var Me=M(u,Te);Me?Ae=E(te,Me,de):Ae={}}return pd(he,Ae)},ce=function(te,Te,ne,de,he){var Ae=M(te,Te),Me;if(Ae)Me=Ae;else if(Te)Me=$;else if(z)if(te.parent){var we=P||ne;we&&!Te?Me=E(te,we,de):(Me={},bl.extendFlat(Me,ue(te,Te)))}else Me=bl.extendFlat({},te),c&&(he.orientation==="h"?he.flipX?Me.x0=te.x1:Me.x1=0:he.flipY?Me.y0=te.y1:Me.y1=0);else Me={};return pd(Me,{x0:te.x0,x1:te.x1,y0:te.y0,y1:te.y1})},De=function(te,Te,ne,de){var he=M(te,Te),Ae={},Me=A(te,Te,ne,de);bl.extendFlat(Ae,{transform:ge({x0:Me.x0,x1:Me.x1,y0:Me.y0,y1:Me.y1,textBB:te.textBB,_text:te._text},{isHeader:Ai.isHeader(te,s)})}),he?Ae=he:te.parent&&bl.extendFlat(Ae,ue(te,Te));var we=te.transform;return te.x0!==te.x1&&te.y0!==te.y1&&md(s.type,we,o),pd(Ae,{transform:{scale:we.scale,rotate:we.rotate,textX:we.textX,textY:we.textY,anchorX:we.anchorX,anchorY:we.anchorY,targetX:we.targetX,targetY:we.targetY}})},Ee=function(te,Te,ne,de,he){var Ae=de[0],Me=de[1];y?te.exit().transition().each(function(){var we=A1.select(this),be=we.select("path.surface");be.transition().attrTween("d",function(Fe){var Oe=Ce(Fe,Te,ne,[Ae,Me]);return function(Ge){return he(Oe(Ge))}});var Ve=we.select("g.slicetext");Ve.attr("opacity",0)}).remove():te.exit().remove()},$e=function(te){var Te=te.transform;return te.x0!==te.x1&&te.y0!==te.y1&&md(s.type,Te,o),bl.getTextTransform({textX:Te.textX,textY:Te.textY,anchorX:Te.anchorX,anchorY:Te.anchorY,targetX:Te.targetX,targetY:Te.targetY,scale:Te.scale,rotate:Te.rotate})};y&&(d.each(function(te){O[tn(te)]={x0:te.x0,x1:te.x1,y0:te.y0,y1:te.y1},te.transform&&(O[tn(te)].transform={textX:te.transform.textX,textY:te.transform.textY,anchorX:te.transform.anchorX,anchorY:te.transform.anchorY,targetX:te.transform.targetX,targetY:te.transform.targetY,scale:te.transform.scale,rotate:te.transform.rotate})}),p.each(function(te){I[tn(te)]={x0:te.x0,x1:te.x1,y0:te.y0,y1:te.y1},te.transform&&(I[tn(te)].transform={textX:te.transform.textX,textY:te.transform.textY,anchorX:te.transform.anchorX,anchorY:te.transform.anchorY,targetX:te.transform.targetX,targetY:te.transform.targetY,scale:te.transform.scale,rotate:te.transform.rotate}),!z&&Ai.isEntry(te)&&(z=te)})),P=n(e,r,u,p,{width:_,height:T,viewX:N,viewY:H,pathSlice:pe,toMoveInsideSlice:ge,prevEntry:z,makeUpdateSliceInterpolator:ce,makeUpdateTextInterpolator:De,handleSlicesExit:Ee,hasTransition:y,strTransform:$e}),s.pathbar.visible?mj(e,r,u,d,{barDifY:D,width:k,height:S,viewX:j,viewY:q,pathSlice:le,toMoveInsideSlice:ge,makeUpdateSliceInterpolator:ce,makeUpdateTextInterpolator:De,handleSlicesExit:Ee,hasTransition:y,strTransform:$e}):d.remove()},gj=gt,bj=Xi,xj=vi,_j=xj.clearMinTextSize,wj=_n.resizeText,S1=yj,Tj=function(e,r,a,i,n){var o=n.type,l=n.drawDescendants,s=e._fullLayout,f=s["_"+o+"layer"],c,v,u=!a;if(_j(o,s),c=f.selectAll("g.trace."+o).data(r,function(d){return d[0].trace.uid}),c.enter().append("g").classed("trace",!0).classed(o,!0),c.order(),!s.uniformtext.mode&&bj.hasTransition(a)){i&&(v=i());var h=gj.transition().duration(a.duration).ease(a.easing).each("end",function(){v&&v()}).each("interrupt",function(){v&&v()});h.each(function(){f.selectAll("g.trace").each(function(d){S1(e,d,this,a,l)})})}else c.each(function(d){S1(e,d,this,a,l)}),s.uniformtext.mode&&wj(e,f.selectAll(".trace"),o);u&&c.exit().remove()},nM={},L1=gt,C1=ht,D1=me,kj=vi.resizeText,Aj=aM;function Mj(t){var e=t._fullLayout._sunburstlayer.selectAll(".trace");kj(t,e,"sunburst"),e.each(function(r){var a=L1.select(this),i=r[0],n=i.trace;a.style("opacity",n.opacity),a.selectAll("path.surface").each(function(o){L1.select(this).call(oM,o,n,t)})})}function oM(t,e,r,a){var i=e.data.data,n=!e.children,o=i.i,l=D1.castOption(r,o,"marker.line.color")||C1.defaultLine,s=D1.castOption(r,o,"marker.line.width")||0;t.call(Aj,e,r,a).style("stroke-width",s).call(C1.stroke,l).style("opacity",n?r.leaf.opacity:null)}var Sj={style:Mj,styleOne:oM};(function(t){var e=gt,r=Mh,a=O1.interpolate,i=$t,n=me,o=br,l=vi,s=l.recordMinTextSize,f=l.clearMinTextSize,c=CA,v=Cn.getRotationAngle,u=c.computeTransform,h=c.transformInsideText,d=Sj.styleOne,p=_n.resizeText,m=dm,y=ZA,b=Xi;t.plot=function(k,S,L,D){var $=k._fullLayout,E=$._sunburstlayer,z,O,I=!L,P=!$.uniformtext.mode&&b.hasTransition(L);if(f("sunburst",$),z=E.selectAll("g.trace.sunburst").data(S,function(A){return A[0].trace.uid}),z.enter().append("g").classed("trace",!0).classed("sunburst",!0).attr("stroke-linejoin","round"),z.order(),P){D&&(O=D());var M=e.transition().duration(L.duration).ease(L.easing).each("end",function(){O&&O()}).each("interrupt",function(){O&&O()});M.each(function(){E.selectAll("g.trace").each(function(A){w(k,A,this,L)})})}else z.each(function(A){w(k,A,this,L)}),$.uniformtext.mode&&p(k,$._sunburstlayer.selectAll(".trace"),"sunburst");I&&z.exit().remove()};function w(k,S,L,D){var $=k._context.staticPlot,E=k._fullLayout,z=!E.uniformtext.mode&&b.hasTransition(D),O=e.select(L),I=O.selectAll("g.slice"),P=S[0],M=P.trace,A=P.hierarchy,C=b.findEntryWithLevel(A,M.level),R=b.getMaxDepth(M),N=E._size,H=M.domain,B=N.w*(H.x[1]-H.x[0]),X=N.h*(H.y[1]-H.y[0]),j=.5*Math.min(B,X),q=P.cx=N.l+N.w*(H.x[1]+H.x[0])/2,U=P.cy=N.t+N.h*(1-H.y[0])-X/2;if(!C)return I.remove();var Z=null,K={};z&&I.each(function(ne){K[b.getPtId(ne)]={rpx0:ne.rpx0,rpx1:ne.rpx1,x0:ne.x0,x1:ne.x1,transform:ne.transform},!Z&&b.isEntry(ne)&&(Z=ne)});var ee=g(C).descendants(),le=C.height+1,ye=0,se=R;P.hasMultipleRoots&&b.isHierarchyRoot(C)&&(ee=ee.slice(1),le-=1,ye=1,se+=1),ee=ee.filter(function(ne){return ne.y1<=se});var G=v(M.rotation);G&&ee.forEach(function(ne){ne.x0+=G,ne.x1+=G});var J=Math.min(le,R),oe=function(ne){return(ne-ye)/J*j},fe=function(ne,de){return[ne*Math.cos(de),-ne*Math.sin(de)]},pe=function(ne){return n.pathAnnulus(ne.rpx0,ne.rpx1,ne.x0,ne.x1,q,U)},ge=function(ne){return q+_(ne)[0]*(ne.transform.rCenter||0)+(ne.transform.x||0)},ue=function(ne){return U+_(ne)[1]*(ne.transform.rCenter||0)+(ne.transform.y||0)};I=I.data(ee,b.getPtId),I.enter().append("g").classed("slice",!0),z?I.exit().transition().each(function(){var ne=e.select(this),de=ne.select("path.surface");de.transition().attrTween("d",function(Ae){var Me=Ee(Ae);return function(we){return pe(Me(we))}});var he=ne.select("g.slicetext");he.attr("opacity",0)}).remove():I.exit().remove(),I.order();var Ce=null;if(z&&Z){var ce=b.getPtId(Z);I.each(function(ne){Ce===null&&b.getPtId(ne)===ce&&(Ce=ne.x1)})}var De=I;z&&(De=De.transition().each("end",function(){var ne=e.select(this);b.setSliceCursor(ne,k,{hideOnRoot:!0,hideOnLeaves:!0,isTransitioning:!1})})),De.each(function(ne){var de=e.select(this),he=n.ensureSingle(de,"path","surface",function(Fe){Fe.style("pointer-events",$?"none":"all")});ne.rpx0=oe(ne.y0),ne.rpx1=oe(ne.y1),ne.xmid=(ne.x0+ne.x1)/2,ne.pxmid=fe(ne.rpx1,ne.xmid),ne.midangle=-(ne.xmid-Math.PI/2),ne.startangle=-(ne.x0-Math.PI/2),ne.stopangle=-(ne.x1-Math.PI/2),ne.halfangle=.5*Math.min(n.angleDelta(ne.x0,ne.x1)||Math.PI,Math.PI),ne.ring=1-ne.rpx0/ne.rpx1,ne.rInscribed=x(ne),z?he.transition().attrTween("d",function(Fe){var Oe=$e(Fe);return function(Ge){return pe(Oe(Ge))}}):he.attr("d",pe),de.call(m,C,k,S,{eventDataKeys:y.eventDataKeys,transitionTime:y.CLICK_TRANSITION_TIME,transitionEasing:y.CLICK_TRANSITION_EASING}).call(b.setSliceCursor,k,{hideOnRoot:!0,hideOnLeaves:!0,isTransitioning:k._transitioning}),he.call(d,ne,M,k);var Ae=n.ensureSingle(de,"g","slicetext"),Me=n.ensureSingle(Ae,"text","",function(Fe){Fe.attr("data-notex",1)}),we=n.ensureUniformFontSize(k,b.determineTextFont(M,ne,E.font));Me.text(t.formatSliceLabel(ne,C,M,S,E)).classed("slicetext",!0).attr("text-anchor","middle").call(i.font,we).call(o.convertToTspans,k);var be=i.bBox(Me.node());ne.transform=h(be,ne,P),ne.transform.targetX=ge(ne),ne.transform.targetY=ue(ne);var Ve=function(Fe,Oe){var Ge=Fe.transform;return u(Ge,Oe),Ge.fontSize=we.size,s(M.type,Ge,E),n.getTextTransform(Ge)};z?Me.transition().attrTween("transform",function(Fe){var Oe=te(Fe);return function(Ge){return Ve(Oe(Ge),be)}}):Me.attr("transform",Ve(ne,be))});function Ee(ne){var de=b.getPtId(ne),he=K[de],Ae=K[b.getPtId(C)],Me;if(Ae){var we=(ne.x1>Ae.x1?2*Math.PI:0)+G;Me=ne.rpx1<Ae.rpx1?{x0:ne.x0,x1:ne.x1,rpx0:0,rpx1:0}:{x0:we,x1:we,rpx0:ne.rpx0,rpx1:ne.rpx1}}else{var be,Ve=b.getPtId(ne.parent);I.each(function(xe){if(b.getPtId(xe)===Ve)return be=xe});var Fe=be.children,Oe;Fe.forEach(function(xe,Ze){if(b.getPtId(xe)===de)return Oe=Ze});var Ge=Fe.length,lt=a(be.x0,be.x1);Me={rpx0:j,rpx1:j,x0:lt(Oe/Ge),x1:lt((Oe+1)/Ge)}}return a(he,Me)}function $e(ne){var de=K[b.getPtId(ne)],he,Ae={x0:ne.x0,x1:ne.x1,rpx0:ne.rpx0,rpx1:ne.rpx1};if(de)he=de;else if(Z)if(ne.parent)if(Ce){var Me=(ne.x1>Ce?2*Math.PI:0)+G;he={x0:Me,x1:Me}}else he={rpx0:j,rpx1:j},n.extendFlat(he,Te(ne));else he={rpx0:0,rpx1:0};else he={x0:G,x1:G};return a(he,Ae)}function te(ne){var de=K[b.getPtId(ne)],he,Ae=ne.transform;if(de)he=de;else if(he={rpx1:ne.rpx1,transform:{textPosAngle:Ae.textPosAngle,scale:0,rotate:Ae.rotate,rCenter:Ae.rCenter,x:Ae.x,y:Ae.y}},Z)if(ne.parent)if(Ce){var Me=ne.x1>Ce?2*Math.PI:0;he.x0=he.x1=Me}else n.extendFlat(he,Te(ne));else he.x0=he.x1=G;else he.x0=he.x1=G;var we=a(he.transform.textPosAngle,ne.transform.textPosAngle),be=a(he.rpx1,ne.rpx1),Ve=a(he.x0,ne.x0),Fe=a(he.x1,ne.x1),Oe=a(he.transform.scale,Ae.scale),Ge=a(he.transform.rotate,Ae.rotate),lt=Ae.rCenter===0?3:he.transform.rCenter===0?1/3:1,xe=a(he.transform.rCenter,Ae.rCenter),Ze=function(Xe){return xe(Math.pow(Xe,lt))};return function(Xe){var Ye=be(Xe),He=Ve(Xe),Ue=Fe(Xe),Je=Ze(Xe),F=fe(Ye,(He+Ue)/2),W=we(Xe),Y={pxmid:F,rpx1:Ye,transform:{textPosAngle:W,rCenter:Je,x:Ae.x,y:Ae.y}};return s(M.type,Ae,E),{transform:{targetX:ge(Y),targetY:ue(Y),scale:Oe(Xe),rotate:Ge(Xe),rCenter:Je}}}}function Te(ne){var de=ne.parent,he=K[b.getPtId(de)],Ae={};if(he){var Me=de.children,we=Me.indexOf(ne),be=Me.length,Ve=a(he.x0,he.x1);Ae.x0=Ve(we/be),Ae.x1=Ve(we/be)}else Ae.x0=Ae.x1=0;return Ae}}function g(k){return r.partition().size([2*Math.PI,k.height+1])(k)}t.formatSliceLabel=function(k,S,L,D,$){var E=L.texttemplate,z=L.textinfo;if(!E&&(!z||z==="none"))return"";var O=$.separators,I=D[0],P=k.data.data,M=I.hierarchy,A=b.isHierarchyRoot(k),C=b.getParent(M,k),R=b.getValue(k);if(!E){var N=z.split("+"),H=function(ye){return N.indexOf(ye)!==-1},B=[],X;if(H("label")&&P.label&&B.push(P.label),P.hasOwnProperty("v")&&H("value")&&B.push(b.formatValue(P.v,O)),!A){H("current path")&&B.push(b.getPath(k.data));var j=0;H("percent parent")&&j++,H("percent entry")&&j++,H("percent root")&&j++;var q=j>1;if(j){var U,Z=function(ye){X=b.formatPercent(U,O),q&&(X+=" of "+ye),B.push(X)};H("percent parent")&&!A&&(U=R/b.getValue(C),Z("parent")),H("percent entry")&&(U=R/b.getValue(S),Z("entry")),H("percent root")&&(U=R/b.getValue(M),Z("root"))}}return H("text")&&(X=n.castOption(L,P.i,"text"),n.isValidTextValue(X)&&B.push(X)),B.join("<br>")}var K=n.castOption(L,P.i,"texttemplate");if(!K)return"";var ee={};P.label&&(ee.label=P.label),P.hasOwnProperty("v")&&(ee.value=P.v,ee.valueLabel=b.formatValue(P.v,O)),ee.currentPath=b.getPath(k.data),A||(ee.percentParent=R/b.getValue(C),ee.percentParentLabel=b.formatPercent(ee.percentParent,O),ee.parent=b.getPtLabel(C)),ee.percentEntry=R/b.getValue(S),ee.percentEntryLabel=b.formatPercent(ee.percentEntry,O),ee.entry=b.getPtLabel(S),ee.percentRoot=R/b.getValue(M),ee.percentRootLabel=b.formatPercent(ee.percentRoot,O),ee.root=b.getPtLabel(M),P.hasOwnProperty("color")&&(ee.color=P.color);var le=n.castOption(L,P.i,"text");return(n.isValidTextValue(le)||le==="")&&(ee.text=le),ee.customdata=n.castOption(L,P.i,"customdata"),n.texttemplateString(K,ee,$._d3locale,ee,L._meta||{})};function x(k){return k.rpx0===0&&n.isFullCircle([k.x0,k.x1])?1:Math.max(0,Math.min(1/(1+1/Math.sin(k.halfangle)),k.ring/2))}function _(k){return T(k.rpx1,k.transform.textPosAngle)}function T(k,S){return[k*Math.sin(S),-k*Math.cos(S)]}})(nM);var $1=gt,xf=me,P1=$t,Lj=br,Cj=rM,R1=vm.styleOne,yd=pu,xi=Xi,Dj=dm,$j=nM.formatSliceLabel,gd=!1,Pj=function(e,r,a,i,n){var o=n.width,l=n.height,s=n.viewX,f=n.viewY,c=n.pathSlice,v=n.toMoveInsideSlice,u=n.strTransform,h=n.hasTransition,d=n.handleSlicesExit,p=n.makeUpdateSliceInterpolator,m=n.makeUpdateTextInterpolator,y=n.prevEntry,b={},w=e._context.staticPlot,g=e._fullLayout,x=r[0],_=x.trace,T=_.textposition.indexOf("left")!==-1,k=_.textposition.indexOf("right")!==-1,S=_.textposition.indexOf("bottom")!==-1,L=!S&&!_.marker.pad.t||S&&!_.marker.pad.b,D=Cj(a,[o,l],{packing:_.tiling.packing,squarifyratio:_.tiling.squarifyratio,flipX:_.tiling.flip.indexOf("x")>-1,flipY:_.tiling.flip.indexOf("y")>-1,pad:{inner:_.tiling.pad,top:_.marker.pad.t,left:_.marker.pad.l,right:_.marker.pad.r,bottom:_.marker.pad.b}}),$=D.descendants(),E=1/0,z=-1/0;$.forEach(function(A){var C=A.depth;C>=_._maxDepth?(A.x0=A.x1=(A.x0+A.x1)/2,A.y0=A.y1=(A.y0+A.y1)/2):(E=Math.min(E,C),z=Math.max(z,C))}),i=i.data($,xi.getPtId),_._maxVisibleLayers=isFinite(z)?z-E+1:0,i.enter().append("g").classed("slice",!0),d(i,gd,b,[o,l],c),i.order();var O=null;if(h&&y){var I=xi.getPtId(y);i.each(function(A){O===null&&xi.getPtId(A)===I&&(O={x0:A.x0,x1:A.x1,y0:A.y0,y1:A.y1})})}var P=function(){return O||{x0:0,x1:o,y0:0,y1:l}},M=i;return h&&(M=M.transition().each("end",function(){var A=$1.select(this);xi.setSliceCursor(A,e,{hideOnRoot:!0,hideOnLeaves:!1,isTransitioning:!1})})),M.each(function(A){var C=xi.isHeader(A,_);A._x0=s(A.x0),A._x1=s(A.x1),A._y0=f(A.y0),A._y1=f(A.y1),A._hoverX=s(A.x1-_.marker.pad.r),A._hoverY=f(S?A.y1-_.marker.pad.b/2:A.y0+_.marker.pad.t/2);var R=$1.select(this),N=xf.ensureSingle(R,"path","surface",function(j){j.style("pointer-events",w?"none":"all")});h?N.transition().attrTween("d",function(j){var q=p(j,gd,P(),[o,l]);return function(U){return c(q(U))}}):N.attr("d",c),R.call(Dj,a,e,r,{styleOne:R1,eventDataKeys:yd.eventDataKeys,transitionTime:yd.CLICK_TRANSITION_TIME,transitionEasing:yd.CLICK_TRANSITION_EASING}).call(xi.setSliceCursor,e,{isTransitioning:e._transitioning}),N.call(R1,A,_,e,{hovered:!1}),A.x0===A.x1||A.y0===A.y1?A._text="":C?A._text=L?"":xi.getPtLabel(A)||"":A._text=$j(A,a,_,r,g)||"";var H=xf.ensureSingle(R,"g","slicetext"),B=xf.ensureSingle(H,"text","",function(j){j.attr("data-notex",1)}),X=xf.ensureUniformFontSize(e,xi.determineTextFont(_,A,g.font));B.text(A._text||" ").classed("slicetext",!0).attr("text-anchor",k?"end":T||C?"start":"middle").call(P1.font,X).call(Lj.convertToTspans,e),A.textBB=P1.bBox(B.node()),A.transform=v(A,{fontSize:X.size,isHeader:C}),A.transform.fontSize=X.size,h?B.transition().attrTween("transform",function(j){var q=m(j,gd,P(),[o,l]);return function(U){return u(q(U))}}):B.attr("transform",u(A))}),O},Rj=Tj,Ej=Pj,zj=function(e,r,a,i){return Rj(e,r,a,i,{type:"treemap",drawDescendants:Ej})},Ij={moduleType:"trace",name:"treemap",basePlotModule:qA,categories:[],animatable:!0,attributes:KA,layoutAttributes:QA,supplyDefaults:XO,supplyLayoutDefaults:qO,calc:_c.calc,crossTraceCalc:_c.crossTraceCalc,plot:zj,style:vm.style,colorbar:ps,meta:{description:["Visualize hierarchal data from leaves (and/or outer branches) towards root","with rectangles. The treemap sectors are determined by the entries in","*labels* or *ids* and in *parents*."].join(" ")}},Fj=Ij;const Yj=Fi(Fj);export{jj as P,Bj as b,Oj as c,Gj as h,Vj as o,Uj as p,Xj as s,Yj as t};
7
+ //# sourceMappingURL=plotly-9a15c985.js.map