i&&(i=r),na&&(a=n))}}),e===1/0?{x:0,y:0,width:0,height:0}:{x:e,y:s,width:i-e,height:a-s}}function Ht(t){switch(t[0]){case"z":case"Z":t[0]="L",t[1]=this.start[0],t[2]=this.start[1];break;case"H":t[0]="L",t[2]=this.pos[1];break;case"V":t[0]="L",t[2]=t[1],t[1]=this.pos[0];break;case"T":t[0]="Q",t[3]=t[1],t[4]=t[2],t[1]=this.reflection[1],t[2]=this.reflection[0];break;case"S":t[0]="C",t[6]=t[4],t[5]=t[3],t[4]=t[2],t[3]=t[1],t[2]=this.reflection[1],t[1]=this.reflection[0]}return t}function Nt(t){var e=t.length;return this.pos=[t[e-2],t[e-1]],-1!="SCQT".indexOf(t[0])&&(this.reflection=[2*this.pos[0]-t[e-4],2*this.pos[1]-t[e-3]]),t}function Ot(t){var e,s=[t];switch(t[0]){case"M":return this.pos=this.start=[t[1],t[2]],s;case"L":t[5]=t[3]=t[1],t[6]=t[4]=t[2],t[1]=this.pos[0],t[2]=this.pos[1];break;case"Q":t[6]=t[4],t[5]=t[3],t[4]=1*t[4]/3+2*t[2]/3,t[3]=1*t[3]/3+2*t[1]/3,t[2]=1*this.pos[1]/3+2*t[2]/3,t[1]=1*this.pos[0]/3+2*t[1]/3;break;case"A":s=function(t,e){var s,i,a,o,r,n,l,h,c,d,g,p,x,u,f,b,m,y,w,v,A,C,S,k,D,L,P=Math.abs(e[1]),M=Math.abs(e[2]),I=e[3]%360,E=e[4],F=e[5],X=e[6],T=e[7],z=new R(t[0],t[1]),B=new R(X,T),H=[];if(0===P||0===M||z.x===B.x&&z.y===B.y)return[["C",z.x,z.y,B.x,B.y,B.x,B.y]];s=new R((z.x-B.x)/2,(z.y-B.y)/2).transform(new Y(0,0,0,0,0,0).rotate(I)),(i=s.x*s.x/(P*P)+s.y*s.y/(M*M))>1&&(P*=i=Math.sqrt(i),M*=i);a=new Y(0,0,0,0,0,0).rotate(I).scale(1/P,1/M).rotate(-I),z=z.transform(a),B=B.transform(a),o=[B.x-z.x,B.y-z.y],n=o[0]*o[0]+o[1]*o[1],r=Math.sqrt(n),o[0]/=r,o[1]/=r,l=n<4?Math.sqrt(1-n/4):0,E===F&&(l*=-1);h=new R((B.x+z.x)/2+l*-o[1],(B.y+z.y)/2+l*o[0]),c=new R(z.x-h.x,z.y-h.y),d=new R(B.x-h.x,B.y-h.y),g=Math.acos(c.x/Math.sqrt(c.x*c.x+c.y*c.y)),c.y<0&&(g*=-1);p=Math.acos(d.x/Math.sqrt(d.x*d.x+d.y*d.y)),d.y<0&&(p*=-1);F&&g>p&&(p+=2*Math.PI);!F&&g t.join(" ")).join(" ")}}function $t(t){if(!t||"string"!=typeof t)return null;if("#"===t[0]){let e=t.slice(1);3===e.length&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]);const s=parseInt(e,16);return[s>>16&255,s>>8&255,255&s,1]}const e=t.match(/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*([\d.]+))?\s*\)/);return e?[+e[1],+e[2],+e[3],void 0!==e[4]?+e[4]:1]:null}function jt(t,e,s){return`rgba(${Math.round(t[0]+(e[0]-t[0])*s)},${Math.round(t[1]+(e[1]-t[1])*s)},${Math.round(t[2]+(e[2]-t[2])*s)},${t[3]+(e[3]-t[3])*s})`}class Vt{constructor(t,e,s){this.el=t,this.duration=null!=e?e:300,this.delay=s||0,this._attrTarget=null,this._plotTarget=null,this._afterCb=null,this._duringCb=null,this._next=null,this._root=null,this._scheduled=!1}attr(t){return this._attrTarget=t,this._schedule(),this}plot(t){return this._plotTarget=t,this._schedule(),this}after(t){return this._afterCb=t,this._schedule(),this}during(t){return this._duringCb=t,this._schedule(),this}animate(t,e){const s=new Vt(this.el,t,e);return this._next=s,s._root=this._root||this,s}_schedule(){const t=this._root||this;t._scheduled||(t._scheduled=!0,queueMicrotask(()=>t._executeChain()))}_executeChain(){const t=[];let e=this;for(;e;)t.push(e),e=e._next;let s=0;t.forEach(t=>{s+=t.delay,t._execute(s),s+=t.duration})}_execute(t){const e=this.el,s=this.duration;if(s<=1){const s=()=>{this._attrTarget&&e.attr(this._attrTarget),this._plotTarget&&e.plot(this._plotTarget),this._afterCb&&this._afterCb.call(e)};return void(t>0?setTimeout(s,t):s())}const i=()=>{const t={},i={},a={};if(this._attrTarget)for(const s of Object.keys(this._attrTarget)){const o=e.attr(s);t[s]=o;const r=$t(o),n=$t(String(this._attrTarget[s]));r&&n&&(i[s]=r,a[s]=n)}let o=null;if(this._plotTarget){const t=e.attr("d")||"";try{o=Gt(t,this._plotTarget)}catch(t){o=null}}const r=performance.now(),n=l=>{const h=l-r,c=Math.min(h/s,1),d=(g=c,-Math.cos(g*Math.PI)/2+.5);var g;if(this._attrTarget)if(c>=1)e.attr(this._attrTarget);else{const s={};for(const e of Object.keys(this._attrTarget))if(i[e]&&a[e])s[e]=jt(i[e],a[e],d);else{const i=parseFloat(t[e]),a=parseFloat(this._attrTarget[e]);isNaN(i)||isNaN(a)||(s[e]=i+(a-i)*d)}e.attr(s)}o&&c<1&&e.attr("d",o(d)),this._duringCb&&this._duringCb(d),c<1?b.requestAnimationFrame(n):(this._plotTarget&&e.attr("d",this._plotTarget),this._afterCb&&this._afterCb.call(e))};b.requestAnimationFrame(n)};t>0?setTimeout(i,t):i()}}var Ut;function qt(){const t=b.createElementNS(z,"svg"),e=new Et(t);return e.attr({xmlns:z}),e}(Ut=kt).prototype.filterWith=function(t){const e=new zt;this._filter=e;let s=this.node;for(;s&&"svg"!==s.nodeName;)s=s.parentNode;if(s){let t=s.querySelector("defs");t||(t=b.createElementNS(z,"defs"),s.insertBefore(t,s.firstChild)),t.appendChild(e.node)}return t(new Rt(e)),this.attr("filter","url(#"+e._id+")"),this},Ut.prototype.unfilter=function(t){return this._filter&&(this.node.removeAttribute("filter"),t&&this._filter.node&&this._filter.node.parentNode&&this._filter.node.parentNode.removeChild(this._filter.node),this._filter=null),this},Ut.prototype.filterer=function(){return this._filter},function(t){t.prototype.animate=function(t,e){return new Vt(this,t,e)}}(kt),function(t){t.prototype.draggable=function(t){if(!1===t)return this._dragCleanup&&(this._dragCleanup(),this._dragCleanup=null),this;const e=this,s=t||{},i=t=>{if(t.button&&0!==t.button)return;t.stopPropagation();const i="touchstart"===t.type?t.touches[0]:t,a=e.node,o=parseFloat(a.getAttribute("x"))||0,r=parseFloat(a.getAttribute("y"))||0,n=i.clientX,l=i.clientY,h=a.ownerSVGElement;let d=null;h&&(d=h.getScreenCTM());const g=t=>{const e="touchmove"===t.type?t.touches[0]:t;let i=e.clientX-n,h=e.clientY-l;d&&(i/=d.a,h/=d.d);let c=o+i,g=r+h;const p=parseFloat(a.getAttribute("width"))||0,x=parseFloat(a.getAttribute("height"))||0;void 0!==s.minX&&cs.maxX&&(c=s.maxX-p),void 0!==s.maxY&&g+x>s.maxY&&(g=s.maxY-x);const u=new CustomEvent("dragmove",{detail:{handler:{move:function(t,e){a.setAttribute("x",t),a.setAttribute("y",e)}},box:{x:c,y:g,w:p,h:x,x2:c+p,y2:g+x}}});a.dispatchEvent(u)},p=()=>{c.isBrowser()&&(document.removeEventListener("mousemove",g),document.removeEventListener("touchmove",g),document.removeEventListener("mouseup",p),document.removeEventListener("touchend",p))};c.isBrowser()&&(document.addEventListener("mousemove",g),document.addEventListener("touchmove",g),document.addEventListener("mouseup",p),document.addEventListener("touchend",p))};return e.node.addEventListener("mousedown",i),e.node.addEventListener("touchstart",i),e._dragCleanup=()=>{e.node.removeEventListener("mousedown",i),e.node.removeEventListener("touchstart",i)},e}}(kt),function(t){t.prototype.select=function(t){if(!1===t)return this._selectCleanup&&(this._selectCleanup(),this._selectCleanup=null),this;const e=this,{createHandle:s,updateHandle:i}=t,a=document.createElementNS(z,"g");a.setAttribute("class","svg_select_points");const o=e.node.parentNode;o&&o.appendChild(a);const r={},n=["t","b","l","r","lt","rt","lb","rb"];n.forEach((t,e)=>{const i=new Et(document.createElementNS(z,"g"));a.appendChild(i.node);const o=s(i,[0,0],e,[],t);r[t]={group:i,handle:o}});const l=()=>{const t=parseFloat(e.attr("x"))||0,s=parseFloat(e.attr("y"))||0,o=parseFloat(e.attr("width"))||0,l=parseFloat(e.attr("height"))||0,h=e.node.getAttribute("transform");h?a.setAttribute("transform",h):a.removeAttribute("transform");const c={t:[t+o/2,s],b:[t+o/2,s+l],l:[t,s+l/2],r:[t+o,s+l/2],lt:[t,s],rt:[t+o,s],lb:[t,s+l],rb:[t+o,s+l]};n.forEach(t=>{r[t]&&c[t]&&i(r[t].group,c[t])})};return l(),e._selectHandles=a,e._selectHandlesMap=r,e._updateSelectPositions=l,e._selectCleanup=()=>{a.parentNode&&a.parentNode.removeChild(a),e._selectHandles=null,e._selectHandlesMap=null,e._updateSelectPositions=null},e},t.prototype.resize=function(t){if(!1===t)return this._resizeCleanup&&(this._resizeCleanup(),this._resizeCleanup=null),this;const e=this,s=e._selectHandlesMap;if(!s)return e;const i=[],a=t=>{const a=s[t];if(!a||!a.group||!a.group.node)return;const o=a.group.node,r=s=>{if(s.button&&0!==s.button)return;s.stopPropagation();const i=("touchstart"===s.type?s.touches[0]:s).clientX,a=e.node.ownerSVGElement;let o=null;a&&(o=a.getScreenCTM());const r=parseFloat(e.attr("x"))||0,n=parseFloat(e.attr("width"))||0,l=s=>{let a=("touchmove"===s.type?s.touches[0]:s).clientX-i;o&&(a/=o.a);let l=r,h=n;"l"===t?(l=r+a,h=n-a):"r"===t&&(h=n+a),h<0&&(h=0),e.attr({x:l,width:h}),e._updateSelectPositions&&e._updateSelectPositions();const c=new CustomEvent("resize",{detail:{el:e}});e.node.dispatchEvent(c)},h=()=>{c.isBrowser()&&(document.removeEventListener("mousemove",l),document.removeEventListener("touchmove",l),document.removeEventListener("mouseup",h),document.removeEventListener("touchend",h));const t=new CustomEvent("resize",{detail:{el:e}});e.node.dispatchEvent(t)};c.isBrowser()&&(document.addEventListener("mousemove",l),document.addEventListener("touchmove",l),document.addEventListener("mouseup",h),document.addEventListener("touchend",h))};o.addEventListener("mousedown",r),o.addEventListener("touchstart",r),i.push(()=>{o.removeEventListener("mousedown",r),o.removeEventListener("touchstart",r)})};return a("l"),a("r"),e._resizeCleanup=()=>{i.forEach(t=>t())},e}}(kt),qt.xlink="http://www.w3.org/1999/xlink",c.isBrowser()&&void 0===window.SVG&&(window.SVG=qt),c.isBrowser()?(void 0===window.SVG&&(window.SVG=qt),void 0===window.Apex&&(window.Apex={})):"undefined"!=typeof global&&(void 0===global.Apex&&(global.Apex={}),void 0===global.SVG&&(global.SVG=qt));const Zt=class t{static registerFeatures(e){for(const[s,i]of Object.entries(e))t._featureRegistry.set(s,i)}constructor(t){this.ctx=t,this.w=t.w}initModules(){this.ctx.publicMethods=["updateOptions","updateSeries","appendData","appendSeries","isSeriesHidden","highlightSeries","toggleSeries","showSeries","hideSeries","setLocale","resetSeries","zoomX","toggleDataPointSelection","dataURI","exportToCSV","addXaxisAnnotation","addYaxisAnnotation","addPointAnnotation","clearAnnotations","removeAnnotation","paper","destroy"],this.ctx.eventList=["click","mousedown","mousemove","mouseleave","touchstart","touchmove","touchleave","mouseup","touchend","keydown","keyup"],this.ctx.animations=new F(this.w,this.ctx),this.ctx.axes=new J(this.w,this.ctx),this.ctx.core=new ut(this.ctx.el,this.w,this.ctx),this.ctx.config=new D({}),this.ctx.data=new ft(this.w,{resetGlobals:()=>this.ctx.core.resetGlobals(),isMultipleY:()=>this.ctx.core.isMultipleY()}),this.ctx.grid=new j(this.w,this.ctx),this.ctx.graphics=new T(this.w,this.ctx),this.ctx.coreUtils=new E(this.w),this.ctx.crosshairs=new Q(this.w),this.ctx.events=new Z(this.w,this.ctx),this.ctx.fill=new H(this.w),this.ctx.localization=new K(this.w),this.ctx.options=new k,this.ctx.responsive=new tt(this.w),this.ctx.series=new et(this.w,{toggleDataSeries:(...t)=>{var e;return null==(e=this.ctx.legend)?void 0:e.legendHelpers.toggleDataSeries(...t)},revertDefaultAxisMinMax:()=>this.ctx.updateHelpers.revertDefaultAxisMinMax(),updateSeries:(...t)=>this.ctx.updateHelpers._updateSeries(...t)}),this.ctx.theme=new st(this.w),this.ctx.formatters=new w(this.w),this.ctx.titleSubtitle=new it(this.w),this.ctx.dimensions=new lt(this.w,this.ctx),this.ctx.updateHelpers=new bt(this.w,this.ctx);const t=new St(this.w,this.ctx);this.w.globals.tooltip=t,Object.defineProperty(this.ctx,"tooltip",{get(){return this.w.globals.tooltip},configurable:!0}),this._initOptionalModules()}_initOptionalModules(){const e=t._featureRegistry,s=this.w,i=this.ctx,a=e.get("exports");i.exports=a?new a(s,i):null;const o=e.get("legend");i.legend=o?new o(s,i):null;const r=e.get("toolbar");Object.defineProperty(i,"toolbar",{get(){var t;return!this._toolbar&&r&&(this._toolbar=new r(s,this)),null!=(t=this._toolbar)?t:null},configurable:!0});const n=e.get("zoomPanSelection");Object.defineProperty(i,"zoomPanSelection",{get(){var t;return!this._zoomPanSelection&&n&&(this._zoomPanSelection=new n(s,this)),null!=(t=this._zoomPanSelection)?t:null},configurable:!0});const l=e.get("keyboardNavigation");Object.defineProperty(i,"keyboardNavigation",{get(){var t;return!this._keyboardNavigation&&l&&(this._keyboardNavigation=new l(s,this)),null!=(t=this._keyboardNavigation)?t:null},configurable:!0})}};h(Zt,"_featureRegistry",new Map);let Kt=Zt;class Jt{constructor(t){this.ctx=t,this.w=t.w}clear({isUpdating:t}){this.ctx._zoomPanSelection&&this.ctx._zoomPanSelection.destroy(),this.ctx._toolbar&&this.ctx._toolbar.destroy(),this.w.globals.resizeObserver&&"function"==typeof this.w.globals.resizeObserver.disconnect&&(this.w.globals.resizeObserver.disconnect(),this.w.globals.resizeObserver=null),_.invalidateAll(this.w),t?(this.ctx._zoomPanSelection=null,this.ctx._toolbar=null,this.ctx._keyboardNavigation=null):(this.ctx.animations=null,this.ctx.axes=null,this.ctx.annotations=null,this.ctx.core=null,this.ctx.data=null,this.ctx.grid=null,this.ctx.series=null,this.ctx.responsive=null,this.ctx.theme=null,this.ctx.formatters=null,this.ctx.titleSubtitle=null,this.ctx.legend=null,this.ctx.dimensions=null,this.ctx.options=null,this.ctx.crosshairs=null,this.ctx._zoomPanSelection=null,this.ctx.updateHelpers=null,this.ctx._toolbar=null,this.ctx.localization=null,this.ctx._keyboardNavigation=null,this.ctx.w.globals.tooltip=null),this.clearDomElements({isUpdating:t})}killSVG(t){t.each(function(){this.removeClass("*"),this.off()},!0),t.clear()}clearDomElements({isUpdating:t}){const e=this.w.dom;if(c.isBrowser()){const s=e.Paper.node;s.parentNode&&s.parentNode.parentNode&&!t&&(s.parentNode.parentNode.style.minHeight="unset");const i=e.baseEl;if(i&&this.ctx.eventList.forEach(t=>{i.removeEventListener(t,this.ctx.events.documentEvent)}),null!==this.ctx.el)for(;this.ctx.el.firstChild;)this.ctx.el.removeChild(this.ctx.el.firstChild);this.killSVG(e.Paper),e.Paper.remove()}e.elWrap=null,e.elGraphical=null,e.elLegendWrap=null,e.elLegendForeign=null,e.baseEl=null,e.elGridRect=null,e.elGridRectMask=null,e.elGridRectBarMask=null,e.elGridRectMarkerMask=null,e.elForecastMask=null,e.elNonForecastMask=null,e.elDefs=null}}const Qt=new WeakMap;class te{constructor(t,e){h(this,"core"),h(this,"responsive"),h(this,"axes"),h(this,"grid"),h(this,"graphics"),h(this,"coreUtils"),h(this,"crosshairs"),h(this,"events"),h(this,"fill"),h(this,"localization"),h(this,"options"),h(this,"series"),h(this,"theme"),h(this,"formatters"),h(this,"titleSubtitle"),h(this,"dimensions"),h(this,"updateHelpers"),h(this,"tooltip"),h(this,"data"),h(this,"animations"),h(this,"exports"),h(this,"legend"),h(this,"toolbar"),h(this,"zoomPanSelection"),h(this,"keyboardNavigation"),h(this,"annotations"),h(this,"timeScale"),h(this,"_keyboardNavigation"),h(this,"windowResizeHandler"),h(this,"parentResizeHandler"),h(this,"publicMethods",[]),h(this,"eventList",[]),h(this,"config"),this.opts=e,this.ctx=this,this.w=new I(e).init(),this.el=t,this.w.globals.cuid=m.randomId(),this.w.globals.chartID=this.w.config.chart.id?m.escapeString(this.w.config.chart.id):this.w.globals.cuid;new Kt(this).initModules(),this.lastUpdateOptions=null,this.create=this.create.bind(this),c.isBrowser()&&(this.windowResizeHandler=this._windowResizeHandler.bind(this),this.parentResizeHandler=this._parentResizeCallback.bind(this))}render(){var t,e;return(null==(e=null==(t=this.w)?void 0:t.config)?void 0:e.chart)?new Promise((t,e)=>{var s;if(m.elementExists(this.el)){void 0===Apex._chartInstances&&(Apex._chartInstances=[]),this.w.config.chart.id&&Apex._chartInstances.push({id:this.w.globals.chartID,group:this.w.config.chart.group,chart:this}),this.setLocale(this.w.config.chart.defaultLocale);const i=this.w.config.chart.events.beforeMount;if("function"==typeof i&&i(this,this.w),this.events.fireEvent("beforeMount",[this,this.w]),c.isBrowser()){window.addEventListener("resize",this.windowResizeHandler),function(t,e){if(c.isSSR())return;let s=!1;if(t.nodeType!==Node.DOCUMENT_FRAGMENT_NODE){const e=t.getBoundingClientRect();"none"!==t.style.display&&0!==e.width||(s=!0)}const i=new ResizeObserver(i=>{s&&e.call(t,i),s=!0});t.nodeType===Node.DOCUMENT_FRAGMENT_NODE?Array.from(t.children).forEach(t=>i.observe(t)):i.observe(t),Qt.set(e,i)}(this.el.parentNode,this.parentResizeHandler);const t=this.el.getRootNode&&this.el.getRootNode(),e=m.is("ShadowRoot",t),i=this.el.ownerDocument;let a=e?t.getElementById("apexcharts-css"):i.getElementById("apexcharts-css");if(!a){a=b.createElementNS("http://www.w3.org/1999/xhtml","style"),a.id="apexcharts-css",a.textContent='@keyframes opaque {\n 0% {\n opacity: 0\n }\n\n to {\n opacity: 1\n }\n}\n\n@keyframes resizeanim {\n\n 0%,\n to {\n opacity: 0\n }\n}\n\n.apexcharts-canvas {\n position: relative;\n direction: ltr !important;\n user-select: none\n}\n\n.apexcharts-canvas ::-webkit-scrollbar {\n -webkit-appearance: none;\n width: 6px\n}\n\n.apexcharts-canvas ::-webkit-scrollbar-thumb {\n border-radius: 4px;\n background-color: rgba(0, 0, 0, .5);\n box-shadow: 0 0 1px rgba(255, 255, 255, .5);\n -webkit-box-shadow: 0 0 1px rgba(255, 255, 255, .5)\n}\n\n.apexcharts-inner {\n position: relative\n}\n\n.apexcharts-text tspan {\n font-family: inherit\n}\n\nrect.legend-mouseover-inactive,\n.legend-mouseover-inactive rect,\n.legend-mouseover-inactive path,\n.legend-mouseover-inactive circle,\n.legend-mouseover-inactive line,\n.legend-mouseover-inactive text.apexcharts-yaxis-title-text,\n.legend-mouseover-inactive text.apexcharts-yaxis-label {\n transition: .15s ease all;\n opacity: .2\n}\n\n.apexcharts-legend-text {\n padding-left: 15px;\n margin-left: -15px;\n}\n\n.apexcharts-legend-series[role="button"]:focus {\n outline: 2px solid #008FFB;\n outline-offset: 2px;\n}\n\n.apexcharts-legend-series[role="button"]:focus:not(:focus-visible) {\n outline: none;\n}\n\n.apexcharts-legend-series[role="button"]:focus-visible {\n outline: 2px solid #008FFB;\n outline-offset: 2px;\n}\n\n.apexcharts-series-collapsed {\n opacity: 0\n}\n\n/* Keyboard navigation focus indicator on SVG data elements.\n SVG elements don\'t support CSS outline, so we use stroke. */\n.apexcharts-bar-area.apexcharts-keyboard-focused,\n.apexcharts-candlestick-area.apexcharts-keyboard-focused,\n.apexcharts-boxPlot-area.apexcharts-keyboard-focused,\n.apexcharts-rangebar-area.apexcharts-keyboard-focused,\n.apexcharts-pie-area.apexcharts-keyboard-focused,\n.apexcharts-heatmap-rect.apexcharts-keyboard-focused,\n.apexcharts-treemap-rect.apexcharts-keyboard-focused {\n stroke: #008FFB;\n stroke-width: 2;\n stroke-opacity: 1;\n}\n\n.apexcharts-tooltip {\n border-radius: 5px;\n box-shadow: 2px 2px 6px -4px #999;\n cursor: default;\n font-size: 14px;\n left: 62px;\n opacity: 0;\n pointer-events: none;\n position: absolute;\n top: 20px;\n display: flex;\n flex-direction: column;\n overflow: hidden;\n white-space: nowrap;\n z-index: 12;\n transition: .15s ease all\n}\n\n.apexcharts-tooltip.apexcharts-active {\n opacity: 1;\n transition: .15s ease all\n}\n\n.apexcharts-tooltip.apexcharts-theme-light {\n border: 1px solid #e3e3e3;\n background: rgba(255, 255, 255, .96)\n}\n\n.apexcharts-tooltip.apexcharts-theme-dark {\n color: #fff;\n background: rgba(30, 30, 30, .8)\n}\n\n.apexcharts-tooltip * {\n font-family: inherit\n}\n\n.apexcharts-tooltip-title {\n padding: 6px;\n font-size: 15px;\n margin-bottom: 4px\n}\n\n.apexcharts-tooltip.apexcharts-theme-light .apexcharts-tooltip-title {\n background: #eceff1;\n border-bottom: 1px solid #ddd\n}\n\n.apexcharts-tooltip.apexcharts-theme-dark .apexcharts-tooltip-title {\n background: rgba(0, 0, 0, .7);\n border-bottom: 1px solid #333\n}\n\n.apexcharts-tooltip-text-goals-value,\n.apexcharts-tooltip-text-y-value,\n.apexcharts-tooltip-text-z-value {\n display: inline-block;\n margin-left: 5px;\n font-weight: 600\n}\n\n.apexcharts-tooltip-text-goals-label:empty,\n.apexcharts-tooltip-text-goals-value:empty,\n.apexcharts-tooltip-text-y-label:empty,\n.apexcharts-tooltip-text-y-value:empty,\n.apexcharts-tooltip-text-z-value:empty,\n.apexcharts-tooltip-title:empty {\n display: none\n}\n\n.apexcharts-tooltip-text-goals-label,\n.apexcharts-tooltip-text-goals-value {\n padding: 6px 0 5px\n}\n\n.apexcharts-tooltip-goals-group,\n.apexcharts-tooltip-text-goals-label,\n.apexcharts-tooltip-text-goals-value {\n display: flex\n}\n\n.apexcharts-tooltip-text-goals-label:not(:empty),\n.apexcharts-tooltip-text-goals-value:not(:empty) {\n margin-top: -6px\n}\n\n.apexcharts-tooltip-marker {\n display: inline-block;\n position: relative;\n width: 16px;\n height: 16px;\n font-size: 16px;\n line-height: 16px;\n margin-right: 4px;\n text-align: center;\n vertical-align: middle;\n color: inherit;\n}\n\n.apexcharts-tooltip-marker::before {\n content: "";\n display: inline-block;\n width: 100%;\n text-align: center;\n color: currentcolor;\n text-rendering: optimizeLegibility;\n -webkit-font-smoothing: antialiased;\n font-size: 26px;\n font-family: Arial, Helvetica, sans-serif;\n line-height: 14px;\n font-weight: 900;\n}\n\n.apexcharts-tooltip-marker[shape="circle"]::before {\n content: "\\25CF";\n}\n\n.apexcharts-tooltip-marker[shape="square"]::before,\n.apexcharts-tooltip-marker[shape="rect"]::before {\n content: "\\25A0";\n transform: translate(-1px, -2px);\n}\n\n.apexcharts-tooltip-marker[shape="line"]::before {\n content: "\\2500";\n}\n\n.apexcharts-tooltip-marker[shape="diamond"]::before {\n content: "\\25C6";\n font-size: 28px;\n}\n\n.apexcharts-tooltip-marker[shape="triangle"]::before {\n content: "\\25B2";\n font-size: 22px;\n}\n\n.apexcharts-tooltip-marker[shape="cross"]::before {\n content: "\\2715";\n font-size: 18px;\n}\n\n.apexcharts-tooltip-marker[shape="plus"]::before {\n content: "\\2715";\n transform: rotate(45deg) translate(-1px, -1px);\n font-size: 18px;\n}\n\n.apexcharts-tooltip-marker[shape="star"]::before {\n content: "\\2605";\n font-size: 18px;\n}\n\n.apexcharts-tooltip-marker[shape="sparkle"]::before {\n content: "\\2726";\n font-size: 20px;\n}\n\n.apexcharts-tooltip-series-group {\n padding: 0 10px;\n display: none;\n text-align: left;\n justify-content: left;\n align-items: center\n}\n\n.apexcharts-tooltip-series-group.apexcharts-active .apexcharts-tooltip-marker {\n opacity: 1\n}\n\n.apexcharts-tooltip-series-group.apexcharts-active,\n.apexcharts-tooltip-series-group:last-child {\n padding-bottom: 4px\n}\n\n.apexcharts-tooltip-y-group {\n padding: 6px 0 5px\n}\n\n.apexcharts-custom-tooltip,\n.apexcharts-tooltip-box {\n padding: 4px 8px\n}\n\n.apexcharts-tooltip-boxPlot {\n display: flex;\n flex-direction: column-reverse\n}\n\n.apexcharts-tooltip-box>div {\n margin: 4px 0\n}\n\n.apexcharts-tooltip-box span.value {\n font-weight: 700\n}\n\n.apexcharts-tooltip-rangebar {\n padding: 5px 8px\n}\n\n.apexcharts-tooltip-rangebar .category {\n font-weight: 600;\n color: #777\n}\n\n.apexcharts-tooltip-rangebar .series-name {\n font-weight: 700;\n display: block;\n margin-bottom: 5px\n}\n\n.apexcharts-xaxistooltip,\n.apexcharts-yaxistooltip {\n opacity: 0;\n pointer-events: none;\n color: #373d3f;\n font-size: 13px;\n text-align: center;\n border-radius: 2px;\n position: absolute;\n z-index: 10;\n background: #eceff1;\n border: 1px solid #90a4ae\n}\n\n.apexcharts-xaxistooltip {\n padding: 9px 10px;\n transition: .15s ease all\n}\n\n.apexcharts-xaxistooltip.apexcharts-theme-dark {\n background: rgba(0, 0, 0, .7);\n border: 1px solid rgba(0, 0, 0, .5);\n color: #fff\n}\n\n.apexcharts-xaxistooltip:after,\n.apexcharts-xaxistooltip:before {\n left: 50%;\n border: solid transparent;\n content: " ";\n height: 0;\n width: 0;\n position: absolute;\n pointer-events: none\n}\n\n.apexcharts-xaxistooltip:after {\n border-color: transparent;\n border-width: 6px;\n margin-left: -6px\n}\n\n.apexcharts-xaxistooltip:before {\n border-color: transparent;\n border-width: 7px;\n margin-left: -7px\n}\n\n.apexcharts-xaxistooltip-bottom:after,\n.apexcharts-xaxistooltip-bottom:before {\n bottom: 100%\n}\n\n.apexcharts-xaxistooltip-top:after,\n.apexcharts-xaxistooltip-top:before {\n top: 100%\n}\n\n.apexcharts-xaxistooltip-bottom:after {\n border-bottom-color: #eceff1\n}\n\n.apexcharts-xaxistooltip-bottom:before {\n border-bottom-color: #90a4ae\n}\n\n.apexcharts-xaxistooltip-bottom.apexcharts-theme-dark:after,\n.apexcharts-xaxistooltip-bottom.apexcharts-theme-dark:before {\n border-bottom-color: rgba(0, 0, 0, .5)\n}\n\n.apexcharts-xaxistooltip-top:after {\n border-top-color: #eceff1\n}\n\n.apexcharts-xaxistooltip-top:before {\n border-top-color: #90a4ae\n}\n\n.apexcharts-xaxistooltip-top.apexcharts-theme-dark:after,\n.apexcharts-xaxistooltip-top.apexcharts-theme-dark:before {\n border-top-color: rgba(0, 0, 0, .5)\n}\n\n.apexcharts-xaxistooltip.apexcharts-active {\n opacity: 1;\n transition: .15s ease all\n}\n\n.apexcharts-yaxistooltip {\n padding: 4px 10px\n}\n\n.apexcharts-yaxistooltip.apexcharts-theme-dark {\n background: rgba(0, 0, 0, .7);\n border: 1px solid rgba(0, 0, 0, .5);\n color: #fff\n}\n\n.apexcharts-yaxistooltip:after,\n.apexcharts-yaxistooltip:before {\n top: 50%;\n border: solid transparent;\n content: " ";\n height: 0;\n width: 0;\n position: absolute;\n pointer-events: none\n}\n\n.apexcharts-yaxistooltip:after {\n border-color: transparent;\n border-width: 6px;\n margin-top: -6px\n}\n\n.apexcharts-yaxistooltip:before {\n border-color: transparent;\n border-width: 7px;\n margin-top: -7px\n}\n\n.apexcharts-yaxistooltip-left:after,\n.apexcharts-yaxistooltip-left:before {\n left: 100%\n}\n\n.apexcharts-yaxistooltip-right:after,\n.apexcharts-yaxistooltip-right:before {\n right: 100%\n}\n\n.apexcharts-yaxistooltip-left:after {\n border-left-color: #eceff1\n}\n\n.apexcharts-yaxistooltip-left:before {\n border-left-color: #90a4ae\n}\n\n.apexcharts-yaxistooltip-left.apexcharts-theme-dark:after,\n.apexcharts-yaxistooltip-left.apexcharts-theme-dark:before {\n border-left-color: rgba(0, 0, 0, .5)\n}\n\n.apexcharts-yaxistooltip-right:after {\n border-right-color: #eceff1\n}\n\n.apexcharts-yaxistooltip-right:before {\n border-right-color: #90a4ae\n}\n\n.apexcharts-yaxistooltip-right.apexcharts-theme-dark:after,\n.apexcharts-yaxistooltip-right.apexcharts-theme-dark:before {\n border-right-color: rgba(0, 0, 0, .5)\n}\n\n.apexcharts-yaxistooltip.apexcharts-active {\n opacity: 1\n}\n\n.apexcharts-yaxistooltip-hidden {\n display: none\n}\n\n.apexcharts-xcrosshairs,\n.apexcharts-ycrosshairs {\n pointer-events: none;\n opacity: 0;\n transition: .15s ease all\n}\n\n.apexcharts-xcrosshairs.apexcharts-active,\n.apexcharts-ycrosshairs.apexcharts-active {\n opacity: 1;\n transition: .15s ease all\n}\n\n.apexcharts-ycrosshairs-hidden {\n opacity: 0\n}\n\n.apexcharts-selection-rect {\n cursor: move\n}\n\n.svg_select_shape {\n stroke-width: 1;\n stroke-dasharray: 10 10;\n stroke: black;\n stroke-opacity: 0.1;\n pointer-events: none;\n fill: none;\n}\n\n.svg_select_handle {\n stroke-width: 3;\n stroke: black;\n fill: none;\n}\n\n.svg_select_handle_r {\n cursor: e-resize;\n}\n\n.svg_select_handle_l {\n cursor: w-resize;\n}\n\n.apexcharts-svg.apexcharts-zoomable.hovering-zoom {\n cursor: crosshair\n}\n\n.apexcharts-svg.apexcharts-zoomable.hovering-pan {\n cursor: move\n}\n\n.apexcharts-menu-icon,\n.apexcharts-pan-icon,\n.apexcharts-reset-icon,\n.apexcharts-selection-icon,\n.apexcharts-toolbar-custom-icon,\n.apexcharts-zoom-icon,\n.apexcharts-zoomin-icon,\n.apexcharts-zoomout-icon {\n cursor: pointer;\n width: 20px;\n height: 20px;\n line-height: 24px;\n color: #6e8192;\n text-align: center\n}\n\n.apexcharts-menu-icon svg,\n.apexcharts-reset-icon svg,\n.apexcharts-zoom-icon svg,\n.apexcharts-zoomin-icon svg,\n.apexcharts-zoomout-icon svg {\n fill: #6e8192\n}\n\n.apexcharts-selection-icon svg {\n fill: #444;\n transform: scale(.76)\n}\n\n.apexcharts-theme-dark .apexcharts-menu-icon svg,\n.apexcharts-theme-dark .apexcharts-pan-icon svg,\n.apexcharts-theme-dark .apexcharts-reset-icon svg,\n.apexcharts-theme-dark .apexcharts-selection-icon svg,\n.apexcharts-theme-dark .apexcharts-toolbar-custom-icon svg,\n.apexcharts-theme-dark .apexcharts-zoom-icon svg,\n.apexcharts-theme-dark .apexcharts-zoomin-icon svg,\n.apexcharts-theme-dark .apexcharts-zoomout-icon svg {\n fill: #f3f4f5\n}\n\n.apexcharts-canvas .apexcharts-reset-zoom-icon.apexcharts-selected svg,\n.apexcharts-canvas .apexcharts-selection-icon.apexcharts-selected svg,\n.apexcharts-canvas .apexcharts-zoom-icon.apexcharts-selected svg {\n fill: #008ffb\n}\n\n.apexcharts-theme-light .apexcharts-menu-icon:hover svg,\n.apexcharts-theme-light .apexcharts-reset-icon:hover svg,\n.apexcharts-theme-light .apexcharts-selection-icon:not(.apexcharts-selected):hover svg,\n.apexcharts-theme-light .apexcharts-zoom-icon:not(.apexcharts-selected):hover svg,\n.apexcharts-theme-light .apexcharts-zoomin-icon:hover svg,\n.apexcharts-theme-light .apexcharts-zoomout-icon:hover svg {\n fill: #333\n}\n\n.apexcharts-menu-icon,\n.apexcharts-selection-icon {\n position: relative\n}\n\n.apexcharts-reset-icon {\n margin-left: 5px\n}\n\n.apexcharts-menu-icon,\n.apexcharts-reset-icon,\n.apexcharts-zoom-icon {\n transform: scale(.85)\n}\n\n.apexcharts-zoomin-icon,\n.apexcharts-zoomout-icon {\n transform: scale(.7)\n}\n\n.apexcharts-zoomout-icon {\n margin-right: 3px\n}\n\n.apexcharts-pan-icon {\n transform: scale(.62);\n position: relative;\n left: 1px;\n top: 0\n}\n\n.apexcharts-pan-icon svg {\n fill: #fff;\n stroke: #6e8192;\n stroke-width: 2\n}\n\n.apexcharts-pan-icon.apexcharts-selected svg {\n stroke: #008ffb\n}\n\n.apexcharts-pan-icon:not(.apexcharts-selected):hover svg {\n stroke: #333\n}\n\n.apexcharts-toolbar {\n position: absolute;\n z-index: 11;\n max-width: 176px;\n text-align: right;\n border-radius: 3px;\n padding: 0 6px 2px;\n display: flex;\n justify-content: space-between;\n align-items: center\n}\n\n.apexcharts-menu {\n background: #fff;\n position: absolute;\n top: 100%;\n border: 1px solid #ddd;\n border-radius: 3px;\n padding: 3px;\n right: 10px;\n opacity: 0;\n min-width: 110px;\n transition: .15s ease all;\n pointer-events: none\n}\n\n.apexcharts-menu.apexcharts-menu-open {\n opacity: 1;\n pointer-events: all;\n transition: .15s ease all\n}\n\n.apexcharts-menu-item {\n padding: 6px 7px;\n font-size: 12px;\n cursor: pointer\n}\n\n.apexcharts-theme-light .apexcharts-menu-item:hover {\n background: #eee\n}\n\n.apexcharts-theme-dark .apexcharts-menu {\n background: rgba(0, 0, 0, .7);\n color: #fff\n}\n\n@media screen and (min-width:768px) {\n .apexcharts-canvas:hover .apexcharts-toolbar {\n opacity: 1\n }\n}\n\n/* Toolbar keyboard accessibility: show toolbar when any button inside it is focused */\n.apexcharts-toolbar:focus-within {\n opacity: 1\n}\n\n/* Focus indicator for toolbar icon buttons */\n.apexcharts-menu-icon:focus-visible,\n.apexcharts-pan-icon:focus-visible,\n.apexcharts-reset-icon:focus-visible,\n.apexcharts-selection-icon:focus-visible,\n.apexcharts-toolbar-custom-icon:focus-visible,\n.apexcharts-zoom-icon:focus-visible,\n.apexcharts-zoomin-icon:focus-visible,\n.apexcharts-zoomout-icon:focus-visible {\n outline: 2px solid #008FFB;\n outline-offset: 2px;\n border-radius: 2px\n}\n\n/* Focus indicator for hamburger menu items */\n.apexcharts-menu-item:focus-visible {\n outline: 2px solid #008FFB;\n outline-offset: -2px;\n background: #eee\n}\n\n.apexcharts-canvas .apexcharts-element-hidden,\n.apexcharts-datalabel.apexcharts-element-hidden,\n.apexcharts-hide .apexcharts-series-points {\n opacity: 0;\n}\n\n.apexcharts-hidden-element-shown {\n opacity: 1;\n transition: 0.25s ease all;\n}\n\n.apexcharts-datalabel,\n.apexcharts-datalabel-label,\n.apexcharts-datalabel-value,\n.apexcharts-datalabels,\n.apexcharts-pie-label {\n cursor: default;\n pointer-events: none\n}\n\n.apexcharts-pie-label-delay {\n opacity: 0;\n animation-name: opaque;\n animation-duration: .3s;\n animation-fill-mode: forwards;\n animation-timing-function: ease\n}\n\n.apexcharts-radialbar-label {\n cursor: pointer;\n}\n\n.apexcharts-annotation-rect,\n.apexcharts-area-series .apexcharts-area,\n.apexcharts-gridline,\n.apexcharts-line,\n.apexcharts-point-annotation-label,\n.apexcharts-radar-series path:not(.apexcharts-marker),\n.apexcharts-radar-series polygon,\n.apexcharts-toolbar svg,\n.apexcharts-tooltip .apexcharts-marker,\n.apexcharts-xaxis-annotation-label,\n.apexcharts-yaxis-annotation-label,\n.apexcharts-zoom-rect,\n.no-pointer-events {\n pointer-events: none\n}\n\n.apexcharts-tooltip-active .apexcharts-marker {\n transition: .15s ease all\n}\n\n.apexcharts-radar-series .apexcharts-yaxis {\n pointer-events: none;\n}\n\n.resize-triggers {\n animation: 1ms resizeanim;\n visibility: hidden;\n opacity: 0;\n height: 100%;\n width: 100%;\n overflow: hidden\n}\n\n.contract-trigger:before,\n.resize-triggers,\n.resize-triggers>div {\n content: " ";\n display: block;\n position: absolute;\n top: 0;\n left: 0\n}\n\n.resize-triggers>div {\n height: 100%;\n width: 100%;\n background: #eee;\n overflow: auto\n}\n\n.contract-trigger:before {\n overflow: hidden;\n width: 200%;\n height: 200%\n}\n\n.apexcharts-bar-goals-markers {\n pointer-events: none\n}\n\n.apexcharts-bar-shadows {\n pointer-events: none\n}\n\n.apexcharts-rangebar-goals-markers {\n pointer-events: none\n}\n\n.apexcharts-disable-transitions * {\n transition: none !important;\n}';const o=(null==(s=this.opts.chart)?void 0:s.nonce)||this.w.config.chart.nonce;o&&a.setAttribute("nonce",o),e?t.prepend(a):!1!==this.w.config.chart.injectStyleSheet&&i.head.appendChild(a)}}const a=this.create(this.w.config.series,{});if(!a)return t(this);this.mount(a).then(()=>{"function"==typeof this.w.config.chart.events.mounted&&this.w.config.chart.events.mounted(this,this.w),this.events.fireEvent("mounted",[this,this.w]),t(a)}).catch(t=>{var s,i;const a=t instanceof Error?t:new Error(String(t)),o=a;o.chartId=null==(i=null==(s=this.w)?void 0:s.globals)?void 0:i.chartID,o.el=this.el,e(a)})}else e(new Error("Element not found"))}):Promise.reject(new Error("ApexCharts: chart configuration is missing or invalid. Ensure the options object includes a `chart` property."))}create(t,e){var s;const i=this.w;if(!this.core){new Kt(this).initModules()}const a=this.w.globals;if(a.noData=!1,a.animationEnded=!1,!m.elementExists(this.el))return a.animationEnded=!0,null;if(this.responsive.checkResponsiveConfig(e),i.config.xaxis.convertedCatToNumeric){new C(i.config).convertCatToNumericXaxis(i.config,this.ctx)}if(this.core.setupElements(),"treemap"===i.config.chart.type&&(i.config.grid.show=!1,i.config.yaxis[0].show=!1),0===a.svgWidth)return a.animationEnded=!0,null;let o=t;t.forEach((t,e)=>{t.hidden&&(o=this.legend.legendHelpers.getSeriesAfterCollapsing({realIndex:e}))});const r=E.checkComboSeries(o,i.config.chart.type);a.comboCharts=r.comboCharts,a.comboBarCount=r.comboBarCount;const n=o.every(t=>t.data&&0===t.data.length);(0===o.length||n&&a.collapsedSeries.length<1)&&this.series.handleNoData(),c.isBrowser()&&this.events.setupEventHandlers();const l=this.data.parseData(o);this._writeParsedSeriesData(l.seriesData),this._writeParsedRangeData(l.rangeData),this._writeParsedCandleData(l.candleData),this._writeParsedLabelData(l.labelData),this._writeParsedAxisFlags(l.axisFlags),this.theme.init();new N(this.w,this).setGlobalMarkerSize(),this.formatters.setLabelFormatters(),this.titleSubtitle.draw(),a.noData&&a.collapsedSeries.length!==i.seriesData.series.length&&!i.config.legend.showForSingleSeries||null==(s=this.legend)||s.init(),this.series.hasAllSeriesEqualX(),a.axisCharts&&(this.core.coreCalculations(),"category"!==i.config.xaxis.type&&this.formatters.setLabelFormatters(),this.ctx.toolbar&&(this.ctx.toolbar.minX=i.globals.minX,this.ctx.toolbar.maxX=i.globals.maxX)),this.formatters.heatmapLabelFormatters();new E(this.w).getLargestMarkerSize();const h=this.dimensions.plotCoords();this._writeLayoutCoords(h.layout);const d=this.core.xySettings();this.grid.createGridMask();const g=this.core.plotChartType(o,d),p=new W(this.w,this);p.bringForward(),i.config.dataLabels.background.enabled&&p.dataLabelsBackground(),this.core.shiftGraphPosition(),i.globals.dataPoints>50&&i.dom.elWrap.classList.add("apexcharts-disable-transitions");return{elGraph:g,xyRatios:d,dimensions:{plot:{left:i.layout.translateX,top:i.layout.translateY,width:i.layout.gridWidth,height:i.layout.gridHeight}}}}mount(t=null){const e=this,s=e.w;return new Promise((i,a)=>{var o,r,n,l,h,d,g,p,x;if(null===e.el)return a(new Error("Not enough data to display or target element not found"));(null===t||s.globals.allSeriesCollapsed)&&e.series.handleNoData(),e.grid=new j(e.w,e);const u=e.grid.drawGrid(),f=Kt._featureRegistry.get("annotations");if(e.annotations=f?new f(e.w,{theme:e.theme,timeScale:e.timeScale}):null,null==(o=e.annotations)||o.drawImageAnnos(),null==(r=e.annotations)||r.drawTextAnnos(),"back"===s.config.grid.position&&(u&&s.dom.elGraphical.add(u.el),(null==(n=null==u?void 0:u.elGridBorders)?void 0:n.node)&&s.dom.elGraphical.add(u.elGridBorders)),Array.isArray(t.elGraph))for(let e=0;e{-1===s.globals.ignoreYAxisIndexes.indexOf(e)&&m.yAxisTitleRotate(e,t.opposite)})),null==(h=e.annotations)||h.drawAxesAnnotations(),!s.globals.noData){if(c.isBrowser()&&s.config.tooltip.enabled&&!s.globals.noData&&(null==(d=e.w.globals.tooltip)||d.drawTooltip(t.xyRatios)),s.config.chart.accessibility.enabled&&s.config.chart.accessibility.keyboard.enabled&&s.config.chart.accessibility.keyboard.navigation.enabled&&(null==(g=e.keyboardNavigation)||g.init()),c.isBrowser()&&s.globals.axisCharts&&(s.axisFlags.isXNumeric||s.config.xaxis.convertedCatToNumeric||s.axisFlags.isRangeBar))(s.config.chart.zoom.enabled||s.config.chart.selection&&s.config.chart.selection.enabled||s.config.chart.pan&&s.config.chart.pan.enabled)&&(null==(p=e.zoomPanSelection)||p.init({xyRatios:t.xyRatios}));else{const t=s.config.chart.toolbar.tools;["zoom","zoomin","zoomout","selection","pan","reset"].forEach(e=>{t[e]=!1})}s.config.chart.toolbar.show&&!s.globals.allSeriesCollapsed&&(null==(x=e.toolbar)||x.createToolbar())}s.globals.memory.methodsToExec.length>0&&s.globals.memory.methodsToExec.forEach(t=>{t.method(t.params,!1,t.context)}),s.globals.axisCharts||s.globals.noData||e.core.resizeNonAxisCharts(),i(e)})}destroy(){c.isBrowser()&&(window.removeEventListener("resize",this.windowResizeHandler),function(t,e){if(c.isSSR())return;const s=Qt.get(e);s&&(s.disconnect(),Qt.delete(e))}(this.el.parentNode,this.parentResizeHandler));const t=this.w.config.chart.id;t&&Apex._chartInstances.forEach((e,s)=>{e.id===m.escapeString(t)&&Apex._chartInstances.splice(s,1)}),this._keyboardNavigation&&this._keyboardNavigation.destroy(),new Jt(this.ctx).clear({isUpdating:!1})}updateOptions(t,e=!1,s=!0,i=!0,a=!0){const o=this.w;if(o.interact.selection=void 0,this.lastUpdateOptions){if(m.shallowEqual(this.lastUpdateOptions,t))return Promise.resolve(this);if(t.series&&this.lastUpdateOptions.series&&JSON.stringify(this.lastUpdateOptions.series)===JSON.stringify(t.series)){const e=n({},t),s=n({},this.lastUpdateOptions);if(delete e.series,delete s.series,m.shallowEqual(e,s))return Promise.resolve(this)}}return t.series&&(this.data.resetParsingFlags(),this.series.resetSeries(!1,!0,!1),t.series.length&&t.series[0].data&&(t.series=t.series.map((t,e)=>this.updateHelpers._extendSeries(t,e))),this.updateHelpers.revertDefaultAxisMinMax()),t.xaxis&&(t=this.updateHelpers.forceXAxisUpdate(t)),t.yaxis&&(t=this.updateHelpers.forceYAxisUpdate(t)),o.globals.collapsedSeriesIndices.length>0&&this.series.clearPreviousPaths(),t.theme&&(t=this.theme.updateThemeOptions(t)),this.updateHelpers._updateOptions(t,e,s,i,a)}updateSeries(t=[],e=!0,s=!0){return this.data.resetParsingFlags(),this.series.resetSeries(!1),this.updateHelpers.revertDefaultAxisMinMax(),this.updateHelpers._updateSeries(t,e,s)}appendSeries(t,e=!0,s=!0){this.data.resetParsingFlags();const i=this.w.config.series.slice();return i.push(t),this.series.resetSeries(!1),this.updateHelpers.revertDefaultAxisMinMax(),this.updateHelpers._updateSeries(i,e,s)}appendData(t,e=!0){const s=this;s.data.resetParsingFlags(),s.w.globals.dataChanged=!0,s.series.getPreviousPaths();const i=s.w.config.series.slice();for(let e=0;e{if(this.lastUpdateOptions&&JSON.stringify(this.lastUpdateOptions)===JSON.stringify(t))return e(this);this.lastUpdateOptions=m.clone(t),new Jt(this.ctx).clear({isUpdating:!0});const i=this.create(this.w.config.series,null!=t?t:{});if(!i)return e(this);this.mount(i).then(()=>{"function"==typeof this.w.config.chart.events.updated&&this.w.config.chart.events.updated(this,this.w),this.events.fireEvent("updated",[this,this.w]),this.w.globals.isDirty=!0,e(this)}).catch(t=>{s(t)})})}fastUpdate(t){return new Promise((e,s)=>{var i;try{const s=this.w,a=s.globals;a.shouldAnimate=t,a.dataChanged=!0,a.animationEnded=!1,_.invalidateSelectors(s);const o=s.globals;o.maxY=-Number.MAX_VALUE,o.minY=Number.MIN_VALUE,o.minYArr=[],o.maxYArr=[],o.maxX=-Number.MAX_VALUE,o.minX=Number.MAX_VALUE,o.initialMaxX=-Number.MAX_VALUE,o.initialMinX=Number.MAX_VALUE,o.yAxisScale=[],o.xAxisScale=null,o.xAxisTicksPositions=[],o.xRange=0,o.yRange=[],o.zRange=0,o.xTickAmount=0,o.multiAxisTickAmount=0,o.pointsArray=[],o.dataLabelsRects=[],o.lastDrawnDataLabelsIndexes=[],o.textRectsCache=new Map,o.domCache=new Map,o.cachedSelectors={},o.disableZoomIn=!1,o.disableZoomOut=!1,a.axisCharts&&(this.core.coreCalculations(),"category"!==s.config.xaxis.type&&this.formatters.setLabelFormatters());const r=this.core.xySettings(),n=s.dom.elGraphical.node;n.querySelectorAll(".apexcharts-series, .apexcharts-datalabels, .apexcharts-datalabels-background").forEach(t=>{var e;return null==(e=t.parentNode)?void 0:e.removeChild(t)});const l=this.core.plotChartType(s.config.series,r),h=n.querySelector(".apexcharts-grid"),d=Array.isArray(l)?l:[l];h&&"front"===s.config.grid.position?d.forEach(t=>{const e=t&&t.node?t.node:t;e&&n.insertBefore(e,h)}):d.forEach(t=>{s.dom.elGraphical.add(t)});const g=new W(s,this);g.bringForward(),s.config.dataLabels.background.enabled&&g.dataLabelsBackground(),c.isBrowser()&&s.config.tooltip.enabled&&!a.noData&&(null==(i=s.globals.tooltip)||i.drawTooltip(r)),"function"==typeof s.config.chart.events.updated&&s.config.chart.events.updated(this,s),this.events.fireEvent("updated",[this,s]),a.isDirty=!0,e(this)}catch(t){s(t)}})}getSyncedCharts(){const t=this.getGroupedCharts();let e=[this];return t.length&&(e=[],t.forEach(t=>{e.push(t)})),e}getGroupedCharts(){return Apex._chartInstances.filter(t=>{if(t.group)return!0}).map(t=>this.w.config.chart.group===t.group?t.chart:this)}static getChartByID(t){const e=m.escapeString(t);if(!Apex._chartInstances)return;const s=Apex._chartInstances.filter(t=>t.id===e)[0];return s&&s.chart}static initOnLoad(){var t;const e=document.querySelectorAll("[data-apexcharts]");for(let s=0;s{this.w.globals.resized=!0,this.w.globals.dataChanged=!1,this.ctx.update()},150)}_windowResizeHandler(){var t;clearTimeout(null!=(t=this.w.globals.resizeTimer)?t:void 0);let{redrawOnWindowResize:e}=this.w.config.chart;"function"==typeof e&&(e=e()),e&&this._windowResize()}}const ee=".apexcharts-flip-y {\n transform: scaleY(-1) translateY(-100%);\n transform-origin: top;\n transform-box: fill-box;\n}\n.apexcharts-flip-x {\n transform: scaleX(-1);\n transform-origin: center;\n transform-box: fill-box;\n}\n.apexcharts-legend {\n display: flex;\n overflow: auto;\n padding: 0 10px;\n}\n.apexcharts-legend.apexcharts-legend-group-horizontal {\n flex-direction: column;\n}\n.apexcharts-legend-group {\n display: flex;\n}\n.apexcharts-legend-group-vertical {\n flex-direction: column-reverse;\n}\n.apexcharts-legend.apx-legend-position-bottom, .apexcharts-legend.apx-legend-position-top {\n flex-wrap: wrap\n}\n.apexcharts-legend.apx-legend-position-right, .apexcharts-legend.apx-legend-position-left {\n flex-direction: column;\n bottom: 0;\n}\n.apexcharts-legend.apx-legend-position-bottom.apexcharts-align-left, .apexcharts-legend.apx-legend-position-top.apexcharts-align-left, .apexcharts-legend.apx-legend-position-right, .apexcharts-legend.apx-legend-position-left {\n justify-content: flex-start;\n align-items: flex-start;\n}\n.apexcharts-legend.apx-legend-position-bottom.apexcharts-align-center, .apexcharts-legend.apx-legend-position-top.apexcharts-align-center {\n justify-content: center;\n align-items: center;\n}\n.apexcharts-legend.apx-legend-position-bottom.apexcharts-align-right, .apexcharts-legend.apx-legend-position-top.apexcharts-align-right {\n justify-content: flex-end;\n align-items: flex-end;\n}\n.apexcharts-legend-series {\n cursor: pointer;\n line-height: normal;\n display: flex;\n align-items: center;\n}\n.apexcharts-legend-text {\n position: relative;\n font-size: 14px;\n}\n.apexcharts-legend-text *, .apexcharts-legend-marker * {\n pointer-events: none;\n}\n.apexcharts-legend-marker {\n position: relative;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n margin-right: 1px;\n}\n\n.apexcharts-legend-series.apexcharts-no-click {\n cursor: auto;\n}\n.apexcharts-legend .apexcharts-hidden-zero-series, .apexcharts-legend .apexcharts-hidden-null-series {\n display: none !important;\n}\n.apexcharts-inactive-legend {\n opacity: 0.45;\n} ";class se{constructor(t,e){this.w=t,this.ctx=e}svgStringToNode(t){return(new DOMParser).parseFromString(t,"image/svg+xml").documentElement}scaleSvgNode(t,e){const s=parseFloat(t.getAttributeNS(null,"width")),i=parseFloat(t.getAttributeNS(null,"height"));t.setAttributeNS(null,"width",s*e),t.setAttributeNS(null,"height",i*e),t.setAttributeNS(null,"viewBox","0 0 "+s+" "+i)}getSvgString(t){return new Promise(e=>{const s=this.w;let i=t||s.config.chart.toolbar.export.scale||s.config.chart.toolbar.export.width/s.globals.svgWidth;i||(i=1);const a=s.globals.svgWidth*i,o=s.globals.svgHeight*i,r=s.dom.elWrap.cloneNode(!0);r.style.width=a+"px",r.style.height=o+"px";const n=(new XMLSerializer).serializeToString(r);let l="\n .apexcharts-tooltip, .apexcharts-toolbar, .apexcharts-xaxistooltip, .apexcharts-yaxistooltip, .apexcharts-xcrosshairs, .apexcharts-ycrosshairs, .apexcharts-zoom-rect, .apexcharts-selection-rect {\n display: none;\n }\n ";s.config.legend.show&&s.dom.elLegendWrap&&s.dom.elLegendWrap.children.length>0&&(l+=ee);let h=`\n \n \n \n \n ${n}\n
\n \n \n `;const c=this.svgStringToNode(h);1!==i&&this.scaleSvgNode(c,i),this.convertImagesToBase64(c).then(()=>{h=(new XMLSerializer).serializeToString(c),e(h.replace(/ /g," "))})})}convertImagesToBase64(t){const e=t.getElementsByTagName("image"),s=Array.from(e).map(t=>{const e=t.getAttributeNS("http://www.w3.org/1999/xlink","href");return e&&!e.startsWith("data:")?this.getBase64FromUrl(e).then(e=>{t.setAttributeNS("http://www.w3.org/1999/xlink","href",e)}).catch(t=>{}):Promise.resolve()});return Promise.all(s)}getBase64FromUrl(t){return c.isSSR()?Promise.resolve(t):new Promise((e,s)=>{const i=new Image;i.crossOrigin="Anonymous",i.onload=()=>{const t=document.createElement("canvas");t.width=i.width,t.height=i.height;const s=t.getContext("2d");s&&s.drawImage(i,0,0),e(t.toDataURL())},i.onerror=s,i.src=t})}svgUrl(){return new Promise(t=>{this.getSvgString().then(e=>{const s=new Blob([e],{type:"image/svg+xml;charset=utf-8"});t(URL.createObjectURL(s))})})}dataURI(t){return c.isSSR()?Promise.resolve({imgURI:""}):new Promise(e=>{const s=this.w,i=t?t.scale||t.width/s.globals.svgWidth:1,a=document.createElement("canvas");a.width=s.globals.svgWidth*i,a.height=parseInt(s.dom.elWrap.style.height,10)*i;const o="transparent"!==s.config.chart.background&&s.config.chart.background?s.config.chart.background:"#fff",r=a.getContext("2d");r&&(r.fillStyle=o,r.fillRect(0,0,a.width*i,a.height*i),this.getSvgString(i).then(t=>{const s="data:image/svg+xml,"+encodeURIComponent(t),i=new Image;i.crossOrigin="anonymous",i.onload=()=>{r.drawImage(i,0,0);const t=a;if(t.msToBlob){const s=t.msToBlob();e({blob:s})}else{const t=a.toDataURL("image/png");e({imgURI:t})}},i.src=s}))})}exportToSVG(){this.svgUrl().then(t=>{this.triggerDownload(t,this.w.config.chart.toolbar.export.svg.filename,".svg")})}exportToPng(){const t=this.w.config.chart.toolbar.export.scale,e=this.w.config.chart.toolbar.export.width,s=t?{scale:t}:e?{width:e}:void 0;this.dataURI(s).then(({imgURI:t,blob:e})=>{e?navigator.msSaveOrOpenBlob(e,this.w.globals.chartID+".png"):this.triggerDownload(t,this.w.config.chart.toolbar.export.png.filename,".png")})}exportToCSV({series:t,fileName:e,columnDelimiter:s=",",lineDelimiter:i="\n"}){const a=this.w;t||(t=a.config.series);let o=[];const r=[];let n="";const l=a.seriesData.series.map((t,e)=>-1===a.globals.collapsedSeriesIndices.indexOf(e)?t:[]),h=t=>"function"==typeof a.config.chart.toolbar.export.csv.categoryFormatter?a.config.chart.toolbar.export.csv.categoryFormatter(t):"datetime"===a.config.xaxis.type&&String(t).length>=10?new Date(t).toDateString():m.isNumber(t)?t:t.split(s).join(""),c=t=>"function"==typeof a.config.chart.toolbar.export.csv.valueFormatter?a.config.chart.toolbar.export.csv.valueFormatter(t):t,d=Math.max(...t.map(t=>t.data?t.data.length:0)),g=new ft(this.w),p=new G(this.w,{theme:this.ctx.theme,timeScale:this.ctx.timeScale}),x=t=>{let e="";if(a.globals.axisCharts){if("category"===a.config.xaxis.type||a.config.xaxis.convertedCatToNumeric)if(a.globals.isBarHorizontal){const s=a.formatters.yLabelFormatters[0],i=new et(this.ctx.w).getActiveConfigSeriesIndex();e=s(a.labelData.labels[t],{seriesIndex:i,dataPointIndex:t,w:a})}else e=p.getLabel(a.labelData.labels,a.labelData.timescaleLabels,0,t).text;"datetime"===a.config.xaxis.type&&(a.config.xaxis.categories.length?e=a.config.xaxis.categories[t]:a.config.labels.length&&(e=a.config.labels[t]))}else e=a.config.labels[t];return null===e?"nullvalue":(Array.isArray(e)&&(e=e.join(" ")),m.isNumber(e)?e:e.split(s).join(""))},u=(e,i)=>{var n;if(o.length&&0===i&&r.push(o.join(s)),e.data){e.data=e.data.length&&e.data||[...Array(d)].map(()=>"");for(let d=0;d{const i=(t.name?t.name:`series-${e}`)+"";a.globals.axisCharts&&o.push(i.split(s).join("")?i.split(s).join(""):`series-${e}`)}),a.globals.axisCharts||(o.push(a.config.chart.toolbar.export.csv.headerValue),r.push(o.join(s))),a.globals.allSeriesHasEqualX||!a.globals.axisCharts||a.config.xaxis.categories.length||a.config.labels.length?t.map((t,e)=>{a.globals.axisCharts?u(t,e):(o=[],o.push(h(a.labelData.labels[e])),o.push(c(l[e])),r.push(o.join(s)))}):(()=>{const e=new Set,i={};t.forEach((s,a)=>{null==s||s.data.forEach(s=>{let o,r;if(g.isFormatXY())o=s.x,r=s.y;else{if(!g.isFormat2DArray())return;o=s[0],r=s[1]}i[o]||(i[o]=Array(t.length).fill("")),i[o][a]=c(r),e.add(o)})}),o.length&&r.push(o.join(s)),Array.from(e).sort().forEach(t=>{r.push([h(t),i[t].join(s)])})})(),n+=r.join(i),this.triggerDownload("data:text/csv; charset=utf-8,"+encodeURIComponent("\ufeff"+n),e||a.config.chart.toolbar.export.csv.filename,".csv")}triggerDownload(t,e,s){if(c.isSSR())return;const i=document.createElement("a");i.href=t,i.download=(e||this.w.globals.chartID)+s,document.body.appendChild(i),i.click(),document.body.removeChild(i)}}te.registerFeatures({exports:se});let ie=class{constructor(t){this.w=t.w,this.lgCtx=t}getLegendStyles(){if(c.isSSR())return null;const t=document.createElement("style");t.setAttribute("type","text/css");const e=this.w.config.chart.nonce;e&&t.setAttribute("nonce",e);const s=document.createTextNode(ee);return t.appendChild(s),t}getLegendDimensions(){const t=this.w.dom.baseEl.querySelector(".apexcharts-legend");if(!t)return{clwh:0,clww:0};const{width:e,height:s}=t.getBoundingClientRect();return{clwh:s,clww:e}}appendToForeignObject(){var t;const e=this.getLegendStyles();!1!==this.w.config.chart.injectStyleSheet&&e&&(null==(t=this.w.dom.elLegendForeign)||t.appendChild(e))}toggleDataSeries(t,e){var s,i;const a=this.w;if(a.globals.axisCharts||"radialBar"===a.config.chart.type){a.globals.resized=!0;let o=null,r=null;if(a.globals.risingSeries=[],a.globals.axisCharts){if(o=a.dom.baseEl.querySelector(`.apexcharts-series[data\\:realIndex='${t}']`),!o)return;r=parseInt(null!=(s=o.getAttribute("data:realIndex"))?s:"",10)}else{if(o=a.dom.baseEl.querySelector(`.apexcharts-series[rel='${t+1}']`),!o)return;r=parseInt(null!=(i=o.getAttribute("rel"))?i:"",10)-1}if(e){[{cs:a.globals.collapsedSeries,csi:a.globals.collapsedSeriesIndices},{cs:a.globals.ancillaryCollapsedSeries,csi:a.globals.ancillaryCollapsedSeriesIndices}].forEach(t=>{const e=t.cs,s=t.csi;this.riseCollapsedSeries(e,s,r)})}else this.hideSeries({seriesEl:o,realIndex:r});if(a.config.chart.accessibility.enabled){const e=a.dom.baseEl.querySelector(`.apexcharts-legend-series[rel="${t+1}"]`);if(e){const s=a.globals.collapsedSeriesIndices.includes(r)||a.globals.ancillaryCollapsedSeriesIndices.includes(r);e.setAttribute("aria-pressed",s?"true":"false");const i=e.querySelector(".apexcharts-legend-text"),o=i?i.textContent:a.seriesData.seriesNames[t],n=s?"hidden":"visible";e.setAttribute("aria-label",`${o}, ${n}. Press Enter or Space to toggle.`)}}}else{const e=a.dom.Paper.findOne(` .apexcharts-series[rel='${t+1}'] path`),s=a.config.chart.type;if("pie"===s||"polarArea"===s||"donut"===s){const t=a.config.plotOptions.pie.donut.labels;new T(this.w).pathMouseDown(e,null),this.lgCtx.printDataLabelsInner(e.node,t)}if(a.config.chart.accessibility.enabled){const e=a.dom.baseEl.querySelector(`.apexcharts-legend-series[rel="${t+1}"]`);if(e){const s=a.globals.collapsedSeriesIndices.includes(t);e.setAttribute("aria-pressed",s?"true":"false");const i=e.querySelector(".apexcharts-legend-text"),o=i?i.textContent:a.seriesData.seriesNames[t],r=s?"hidden":"visible";e.setAttribute("aria-label",`${o}, ${r}. Press Enter or Space to toggle.`)}}}}getSeriesAfterCollapsing({realIndex:t}){var e;const s=this.w,i=s.globals,a=m.clone(s.config.series);if(i.axisCharts){const e=s.config.yaxis[i.seriesYAxisReverseMap[t]],o={index:t,data:a[t].data.slice(),type:a[t].type||s.config.chart.type};if(e&&e.show&&e.showAlways)i.ancillaryCollapsedSeriesIndices.indexOf(t)<0&&(i.ancillaryCollapsedSeries.push(o),i.ancillaryCollapsedSeriesIndices.push(t));else if(i.collapsedSeriesIndices.indexOf(t)<0){i.collapsedSeries.push(o),i.collapsedSeriesIndices.push(t);const e=i.risingSeries.indexOf(t);i.risingSeries.splice(e,1)}}else i.collapsedSeries.push({index:t,data:a[t],type:null!=(e=s.config.series[t].type)?e:"line"}),i.collapsedSeriesIndices.push(t);return i.allSeriesCollapsed=i.collapsedSeries.length+i.ancillaryCollapsedSeries.length===s.config.series.length,this._getSeriesBasedOnCollapsedState(a)}hideSeries({seriesEl:t,realIndex:e}){const s=this.w,i=this.getSeriesAfterCollapsing({realIndex:e}),a=t.childNodes;for(let t=0;t0){for(let o=0;o{e.globals.collapsedSeriesIndices.indexOf(a)<0&&e.globals.ancillaryCollapsedSeriesIndices.indexOf(a)<0||(t[a].data=[],s++)}):t.forEach((i,a)=>{e.globals.collapsedSeriesIndices.indexOf(a)<0||(t[a]=0,s++)}),e.globals.allSeriesCollapsed=s===t.length,t}};te.registerFeatures({legend:class{constructor(t,e){this.w=t,this.ctx=e,this.printDataLabelsInner=(...t)=>{var s;return null==(s=e.pie)?void 0:s.printDataLabelsInner(...t)},this.updateSeries=(...t)=>e.updateHelpers._updateSeries(...t),this.onLegendClick=this.onLegendClick.bind(this),this.onLegendHovered=this.onLegendHovered.bind(this),this.isBarsDistributed="bar"===this.w.config.chart.type&&this.w.config.plotOptions.bar.distributed&&1===this.w.config.series.length,this.legendHelpers=new ie(this)}init(){const t=this.w,e=t.globals,s=t.config,i=s.legend.showForSingleSeries&&1===this.w.seriesData.series.length||this.isBarsDistributed||this.w.seriesData.series.length>1;if(this.legendHelpers.appendToForeignObject(),(i||!e.axisCharts)&&s.legend.show){const e=t.dom.elLegendWrap;for(;e.firstChild;)e.removeChild(e.firstChild);this.drawLegends(),"bottom"===s.legend.position||"top"===s.legend.position?this.legendAlignHorizontal():"right"!==s.legend.position&&"left"!==s.legend.position||this.legendAlignVertical()}}createLegendMarker({i:t,fillcolor:e}){const s=this.w,i=b.createElement("span");i.classList.add("apexcharts-legend-marker");const a=s.config.legend.markers.shape||s.config.markers.shape;let o=a;Array.isArray(a)&&(o=a[t]);const r=Array.isArray(s.config.legend.markers.size)?parseFloat(s.config.legend.markers.size[t]):parseFloat(s.config.legend.markers.size),h=Array.isArray(s.config.legend.markers.offsetX)?parseFloat(s.config.legend.markers.offsetX[t]):parseFloat(s.config.legend.markers.offsetX),d=Array.isArray(s.config.legend.markers.offsetY)?parseFloat(s.config.legend.markers.offsetY[t]):parseFloat(s.config.legend.markers.offsetY),g=Array.isArray(s.config.legend.markers.strokeWidth)?parseFloat(s.config.legend.markers.strokeWidth[t]):parseFloat(s.config.legend.markers.strokeWidth),p=i.style;if(p.height=2*(r+g)+"px",p.width=2*(r+g)+"px",p.left=h+"px",p.top=d+"px",s.config.legend.markers.customHTML)p.background="transparent",p.color=e[t],Array.isArray(s.config.legend.markers.customHTML)?s.config.legend.markers.customHTML[t]&&(i.innerHTML=s.config.legend.markers.customHTML[t]()):i.innerHTML=s.config.legend.markers.customHTML();else{const a=new N(this.ctx.w,this.ctx).getMarkerConfig({cssClass:`apexcharts-legend-marker apexcharts-marker apexcharts-marker-${o}`,seriesIndex:t,strokeWidth:g,size:r}),h=(c.isBrowser()?window.SVG:global.SVG)().addTo(i).size("100%","100%"),d=new T(this.w).drawMarker(0,0,l(n({},a),{pointFillColor:Array.isArray(e)?e[t]:a.pointFillColor,shape:o}));s.dom.Paper.find(".apexcharts-legend-marker.apexcharts-marker").forEach(t=>{t.node.classList.contains("apexcharts-marker-triangle")?t.node.style.transform="translate(50%, 45%)":t.node.style.transform="translate(50%, 50%)"}),h.add(d)}return i}drawLegends(){var t;const e=this,s=this.w,i=s.dom.elLegendWrap,a=s.config.legend.fontFamily;let o=s.seriesData.seriesNames,r=s.config.legend.markers.fillColors?s.config.legend.markers.fillColors.slice():s.globals.colors.slice();if("heatmap"===s.config.chart.type){const t=s.config.plotOptions.heatmap.colorScale.ranges;o=t.map(t=>t.name?t.name:t.from+" - "+t.to),r=t.map(t=>t.color)}else this.isBarsDistributed&&(o=s.labelData.labels.slice());s.config.legend.customLegendItems.length&&(o=s.config.legend.customLegendItems);const n=s.formatters.legendFormatter,l=s.config.legend.inverseOrder,h=[];s.labelData.seriesGroups.length>1&&s.config.legend.clusterGroupedSeries&&s.labelData.seriesGroups.forEach((t,e)=>{h[e]=b.createElement("div"),h[e].classList.add("apexcharts-legend-group",`apexcharts-legend-group-${e}`),"horizontal"===s.config.legend.clusterGroupedSeriesOrientation?i.classList.add("apexcharts-legend-group-horizontal"):h[e].classList.add("apexcharts-legend-group-vertical")});for(let e=l?o.length-1:0;l?e>=0:e<=o.length-1;l?e--:e++){const l=n(o[e],{seriesIndex:e,w:s});let c=!1,d=!1;if(s.globals.collapsedSeries.length>0)for(let t=0;t0)for(let t=0;t{var o,r;t.includes(null!=(r=null==(o=s.config.series[e])?void 0:o.name)?r:"")&&(i.appendChild(h[a]),h[a].appendChild(p))}):i.appendChild(p),i.classList.add(`apexcharts-align-${s.config.legend.horizontalAlign}`),i.classList.add("apx-legend-position-"+s.config.legend.position),p.classList.add("apexcharts-legend-series"),p.style.margin=`${s.config.legend.itemMargin.vertical}px ${s.config.legend.itemMargin.horizontal}px`,i.style.width=s.config.legend.width?s.config.legend.width+"px":"",i.style.height=s.config.legend.height?s.config.legend.height+"px":"",T.setAttrs(p,{rel:e+1,seriesName:m.escapeString(o[e]),"data:collapsed":c||d}),(c||d)&&p.classList.add("apexcharts-inactive-legend"),s.config.legend.onItemClick.toggleDataSeries||p.classList.add("apexcharts-no-click")}s.dom.elWrap.addEventListener("click",e.onLegendClick,!0),s.config.legend.onItemHover.highlightDataSeries&&0===s.config.legend.customLegendItems.length&&(s.dom.elWrap.addEventListener("mousemove",e.onLegendHovered,!0),s.dom.elWrap.addEventListener("mouseout",e.onLegendHovered,!0)),s.config.chart.accessibility.enabled&&s.config.chart.accessibility.keyboard.enabled&&s.dom.elWrap.addEventListener("keydown",e.onLegendKeyDown.bind(e),!0)}setLegendWrapXY(t,e){const s=this.w,i=s.dom.elLegendWrap,a=i.clientHeight;let o=0,r=0;if("bottom"===s.config.legend.position)r=s.globals.svgHeight-Math.min(a,s.globals.svgHeight/2)-5;else if("top"===s.config.legend.position){const t=new lt(this.w,this.ctx),e=t.dimHelpers.getTitleSubtitleCoords("title").height,s=t.dimHelpers.getTitleSubtitleCoords("subtitle").height;r=(e>0?e-10:0)+(s>0?s-10:0)}i.style.position="absolute",o=o+t+s.config.legend.offsetX,r=r+e+s.config.legend.offsetY,i.style.left=o+"px",i.style.top=r+"px","right"===s.config.legend.position&&(i.style.left="auto",i.style.right=25+s.config.legend.offsetX+"px");["width","height"].forEach(t=>{i&&i.style[t]&&(i.style[t]=parseInt(String(s.config.legend[t]),10)+"px")})}legendAlignHorizontal(){const t=this.w;t.dom.elLegendWrap.style.right="0";const e=new lt(this.w,this.ctx),s=e.dimHelpers.getTitleSubtitleCoords("title"),i=e.dimHelpers.getTitleSubtitleCoords("subtitle");let a=0;"top"===t.config.legend.position&&(a=s.height+i.height+t.config.title.margin+t.config.subtitle.margin-10),this.setLegendWrapXY(20,a)}legendAlignVertical(){const t=this.w,e=this.legendHelpers.getLegendDimensions();let s=0;"left"===t.config.legend.position&&(s=20),"right"===t.config.legend.position&&(s=t.globals.svgWidth-e.clww-10),this.setLegendWrapXY(s,20)}onLegendHovered(t){var e;const s=this.w,i=t.target,a=i.classList.contains("apexcharts-legend-series")||i.classList.contains("apexcharts-legend-text")||i.classList.contains("apexcharts-legend-marker");if("heatmap"===s.config.chart.type||this.isBarsDistributed){if(a){const s=parseInt(null!=(e=i.getAttribute("rel"))?e:"0",10)-1;this.ctx.events.fireEvent("legendHover",[this.ctx,s,this.w]);new et(this.ctx.w).highlightRangeInSeries(t,i)}}else if(!i.classList.contains("apexcharts-inactive-legend")&&a){new et(this.ctx.w).toggleSeriesOnHover(t,i)}}onLegendKeyDown(t){const e=this,s=this.w,i=t.target;if((i.classList.contains("apexcharts-legend-series")||i.classList.contains("apexcharts-legend-text")||i.classList.contains("apexcharts-legend-marker"))&&("Enter"===t.key||" "===t.key)){t.preventDefault();const a=i.getAttribute("rel");e.onLegendClick(t),null!==a&&s.config.legend.onItemClick.toggleDataSeries&&requestAnimationFrame(()=>{const t=s.dom.baseEl.querySelector(`.apexcharts-legend-series[rel="${a}"]`);t&&t.focus()})}}onLegendClick(t){var e;const s=this.w,i=t.target;if(!s.config.legend.customLegendItems.length&&(i.classList.contains("apexcharts-legend-series")||i.classList.contains("apexcharts-legend-text")||i.classList.contains("apexcharts-legend-marker"))){const t=parseInt(null!=(e=i.getAttribute("rel"))?e:"0",10)-1,a="true"===i.getAttribute("data:collapsed"),o=this.w.config.chart.events.legendClick;"function"==typeof o&&o(this.ctx,t,this.w),this.ctx.events.fireEvent("legendClick",[this.ctx,t,this.w]);const r=this.w.config.legend.markers.onClick;"function"==typeof r&&i.classList.contains("apexcharts-legend-marker")&&(r(this.ctx,t,this.w),this.ctx.events.fireEvent("legendMarkerClick",[this.ctx,t,this.w]));"treemap"!==s.config.chart.type&&"heatmap"!==s.config.chart.type&&!this.isBarsDistributed&&s.config.legend.onItemClick.toggleDataSeries&&this.legendHelpers.toggleDataSeries(t,a)}}}});class ae{constructor(t,e){this.w=t,this.ctx=e,this.ev=this.w.config.chart.events,this.selectedClass="apexcharts-selected",this.localeValues=this.w.globals.locale.toolbar,this.minX=t.globals.minX,this.maxX=t.globals.maxX,this.elZoom=null,this.elZoomIn=null,this.elZoomOut=null,this.elPan=null,this.elSelection=null,this.elZoomReset=null,this.elMenuIcon=null,this.elMenu=null,this.elMenuItems=[],this.t=null}createToolbar(){const t=this.w,e=()=>b.createElementNS("http://www.w3.org/1999/xhtml","div"),s=e();if(s.setAttribute("class","apexcharts-toolbar"),s.style.top=t.config.chart.toolbar.offsetY+"px",s.style.right=3-t.config.chart.toolbar.offsetX+"px",t.dom.elWrap.appendChild(s),this.elZoom=e(),this.elZoomIn=e(),this.elZoomOut=e(),this.elPan=e(),this.elSelection=e(),this.elZoomReset=e(),this.elMenuIcon=e(),this.elMenu=e(),this.elCustomIcons=[],this.t=t.config.chart.toolbar.tools,Array.isArray(this.t.customIcons))for(let t=0;t{const o=e.toLowerCase();this.t[o]&&t.config.chart.zoom.enabled&&i.push({el:s,icon:"string"==typeof this.t[o]?this.t[o]:a,title:this.localeValues[e],class:`apexcharts-${o}-icon`})};a("zoomIn",this.elZoomIn,'\n \n \n \n'),a("zoomOut",this.elZoomOut,'\n \n \n \n');const o=e=>{this.t[e]&&t.config.chart[e].enabled&&i.push({el:"zoom"===e?this.elZoom:this.elSelection,icon:"string"==typeof this.t[e]?this.t[e]:"zoom"===e?'\n \n \n \n ':'\n \n \n ',title:this.localeValues["zoom"===e?"selectionZoom":"selection"],class:`apexcharts-${e}-icon`})};o("zoom"),o("selection"),this.t.pan&&t.config.chart.zoom.enabled&&i.push({el:this.elPan,icon:"string"==typeof this.t.pan?this.t.pan:'\n \n \n \n \n \n \n \n ',title:this.localeValues.pan,class:"apexcharts-pan-icon"}),a("reset",this.elZoomReset,'\n \n \n '),this.t.download&&i.push({el:this.elMenuIcon,icon:"string"==typeof this.t.download?this.t.download:' ',title:this.localeValues.menu,class:"apexcharts-menu-icon"});for(let t=0;t{t.index&&m.moveIndexInArray(i,e,t.index)});for(let t=0;t{t.classList.contains("exportSVG")?t.addEventListener("click",this.handleDownload.bind(this,"svg")):t.classList.contains("exportPNG")?t.addEventListener("click",this.handleDownload.bind(this,"png")):t.classList.contains("exportCSV")&&t.addEventListener("click",this.handleDownload.bind(this,"csv"))});for(let t=0;t{t.addEventListener("keydown",e=>{if("Enter"===e.key||" "===e.key){e.preventDefault();const s=t.className;t.click(),requestAnimationFrame(()=>{const t=this.w.dom.baseEl;if(!t)return;const e=s.split(" ").find(t=>t.startsWith("apexcharts-"));if(!e)return;const i=t.querySelector(`.${e}`);i&&i.focus()})}})}),null==(n=this.elMenuIcon)||n.addEventListener("keydown",t=>{var e;"ArrowDown"!==t.key&&"ArrowUp"!==t.key||(t.preventDefault(),(null==(e=this.elMenu)?void 0:e.classList.contains("apexcharts-menu-open"))||this.toggleMenu(),window.setTimeout(()=>{const e="ArrowDown"===t.key?0:this.elMenuItems.length-1;this.elMenuItems[e]&&this.elMenuItems[e].focus()},20))}),this.elMenuItems.forEach((t,e)=>{t.addEventListener("keydown",s=>{var i;if("ArrowDown"===s.key){s.preventDefault();(this.elMenuItems[e+1]||this.elMenuItems[0]).focus()}else if("ArrowUp"===s.key){s.preventDefault();(this.elMenuItems[e-1]||this.elMenuItems[this.elMenuItems.length-1]).focus()}else"Escape"===s.key||"Tab"===s.key?(this._closeMenu(),null==(i=this.elMenuIcon)||i.focus(),"Tab"===s.key||s.preventDefault()):"Enter"!==s.key&&" "!==s.key||(s.preventDefault(),t.click())})})}toggleZoomSelection(t){this.ctx.getSyncedCharts().forEach(e=>{e.ctx.toolbar.toggleOtherControls();const s="selection"===t?e.ctx.toolbar.elSelection:e.ctx.toolbar.elZoom,i="selection"===t?"selectionEnabled":"zoomEnabled";e.w.globals[i]=!e.w.globals[i],s.classList.contains(e.ctx.toolbar.selectedClass)?s.classList.remove(e.ctx.toolbar.selectedClass):s.classList.add(e.ctx.toolbar.selectedClass),s.setAttribute("aria-pressed",String(e.w.globals[i]))})}getToolbarIconsReference(){const t=this.w;this.elZoom||(this.elZoom=t.dom.baseEl.querySelector(".apexcharts-zoom-icon")),this.elPan||(this.elPan=t.dom.baseEl.querySelector(".apexcharts-pan-icon")),this.elSelection||(this.elSelection=t.dom.baseEl.querySelector(".apexcharts-selection-icon"))}enableZoomPanFromToolbar(t){this.toggleOtherControls(),"pan"===t?this.w.interact.panEnabled=!0:this.w.interact.zoomEnabled=!0;const e="pan"===t?this.elPan:this.elZoom,s="pan"===t?this.elZoom:this.elPan;e&&e.classList.add(this.selectedClass),s&&s.classList.remove(this.selectedClass)}togglePanning(){this.ctx.getSyncedCharts().forEach(t=>{t.ctx.toolbar.toggleOtherControls(),t.w.interact.panEnabled=!t.w.interact.panEnabled,t.ctx.toolbar.elPan.classList.contains(t.ctx.toolbar.selectedClass)?t.ctx.toolbar.elPan.classList.remove(t.ctx.toolbar.selectedClass):t.ctx.toolbar.elPan.classList.add(t.ctx.toolbar.selectedClass),t.ctx.toolbar.elPan.setAttribute("aria-pressed",String(t.w.interact.panEnabled))})}toggleOtherControls(){const t=this.w;t.interact.panEnabled=!1,t.interact.zoomEnabled=!1,t.interact.selectionEnabled=!1,this.getToolbarIconsReference();[this.elPan,this.elSelection,this.elZoom].forEach(t=>{t&&t.classList.remove(this.selectedClass)})}handleZoomIn(){const t=this.w;t.axisFlags.isRangeBar&&(this.minX=t.globals.minY,this.maxX=t.globals.maxY);const e=(this.minX+this.maxX)/2,s=(this.minX+e)/2,i=(this.maxX+e)/2,a=this._getNewMinXMaxX(s,i);t.interact.disableZoomIn||this.zoomUpdateOptions(a.minX,a.maxX)}handleZoomOut(){const t=this.w;if(t.axisFlags.isRangeBar&&(this.minX=t.globals.minY,this.maxX=t.globals.maxY),"datetime"===t.config.xaxis.type&&new Date(this.minX).getUTCFullYear()<1e3)return;const e=(this.minX+this.maxX)/2,s=this.minX-(e-this.minX),i=this.maxX-(e-this.maxX),a=this._getNewMinXMaxX(s,i);t.interact.disableZoomOut||this.zoomUpdateOptions(a.minX,a.maxX)}_getNewMinXMaxX(t,e){const s=this.w.config.xaxis.convertedCatToNumeric;return{minX:s?Math.floor(t):t,maxX:s?Math.floor(e):e}}zoomUpdateOptions(t,e){const s=this.w;if(void 0===t&&void 0===e)return void this.handleZoomReset();if(s.config.xaxis.convertedCatToNumeric&&(t<1&&(t=1,e=s.globals.dataPoints),e-t<2))return;let i={min:t,max:e};const a=this.getBeforeZoomRange(i,void 0);a&&(i=a.xaxis);const o={xaxis:i};if(!s.globals.initialConfig)return;const r=m.clone(s.globals.initialConfig.yaxis);s.config.chart.group||(o.yaxis=r),this.w.interact.zoomed=!0,this.ctx.updateHelpers._updateOptions(o,!1,this.w.config.chart.animations.dynamicAnimation.enabled),this.zoomCallback(i,r)}zoomCallback(t,e){"function"==typeof this.ev.zoomed&&(this.ev.zoomed(this.ctx,{xaxis:t,yaxis:e}),this.ctx.events.fireEvent("zoomed",{xaxis:t,yaxis:e}))}getBeforeZoomRange(t,e){let s=null;return"function"==typeof this.ev.beforeZoom&&(s=this.ev.beforeZoom(this,{xaxis:t,yaxis:e})),s}toggleMenu(){window.setTimeout(()=>{var t,e,s;(null==(t=this.elMenu)?void 0:t.classList.contains("apexcharts-menu-open"))?this._closeMenu():(null==(e=this.elMenu)||e.classList.add("apexcharts-menu-open"),null==(s=this.elMenuIcon)||s.setAttribute("aria-expanded","true"))},0)}_closeMenu(){var t,e;null==(t=this.elMenu)||t.classList.remove("apexcharts-menu-open"),null==(e=this.elMenuIcon)||e.setAttribute("aria-expanded","false")}handleDownload(t){const e=this.w,s=new se(this.w,this.ctx);switch(t){case"svg":s.exportToSVG();break;case"png":s.exportToPng();break;case"csv":s.exportToCSV({series:e.config.series,columnDelimiter:e.config.chart.toolbar.export.csv.columnDelimiter})}}handleZoomReset(){this.ctx.getSyncedCharts().forEach(t=>{const e=t.w;if(e.globals.lastXAxis.min=e.globals.initialConfig.xaxis.min,e.globals.lastXAxis.max=e.globals.initialConfig.xaxis.max,t.updateHelpers.revertDefaultAxisMinMax(),"function"==typeof e.config.chart.events.beforeResetZoom){const s=e.config.chart.events.beforeResetZoom(t,e);s&&t.updateHelpers.revertDefaultAxisMinMax(s)}"function"==typeof e.config.chart.events.zoomed&&t.ctx.toolbar.zoomCallback({min:e.config.xaxis.min,max:e.config.xaxis.max}),e.interact.zoomed=!1;const s=t.ctx.series.emptyCollapsedSeries(m.clone(e.globals.initialSeries));t.updateHelpers._updateSeries(s,e.config.chart.animations.dynamicAnimation.enabled)})}destroy(){this.elZoom=null,this.elZoomIn=null,this.elZoomOut=null,this.elPan=null,this.elSelection=null,this.elZoomReset=null,this.elMenuIcon=null}}te.registerFeatures({toolbar:ae,zoomPanSelection:class extends ae{constructor(t,e){super(t,e),this.w=t,this.ctx=e,this.dragged=!1,this.graphics=new T(this.w),this.eventList=["mousedown","mouseleave","mousemove","touchstart","touchmove","mouseup","touchend","wheel"],this.clientX=0,this.clientY=0,this.startX=0,this.endX=0,this.dragX=0,this.startY=0,this.endY=0,this.dragY=0,this.moveDirection="none",this.debounceTimer=null,this.debounceDelay=100,this.wheelDelay=400}init({xyRatios:t}){const e=this.w,s=this;this.xyRatios=t,this.zoomRect=this.graphics.drawRect(0,0,0,0),this.selectionRect=this.graphics.drawRect(0,0,0,0),this.gridRect=e.dom.baseEl.querySelector(".apexcharts-grid"),this.constraints=new B(0,0,e.layout.gridWidth,e.layout.gridHeight),this.zoomRect.node.classList.add("apexcharts-zoom-rect"),this.selectionRect.node.classList.add("apexcharts-selection-rect"),e.dom.Paper.add(this.zoomRect),e.dom.Paper.add(this.selectionRect),"x"===e.config.chart.selection.type?this.slDraggableRect=this.selectionRect.draggable({minX:0,minY:0,maxX:e.layout.gridWidth,maxY:e.layout.gridHeight}).on("dragmove.namespace",this.selectionDragging.bind(this,"dragging")):"y"===e.config.chart.selection.type?this.slDraggableRect=this.selectionRect.draggable({minX:0,maxX:e.layout.gridWidth}).on("dragmove.namespace",this.selectionDragging.bind(this,"dragging")):this.slDraggableRect=this.selectionRect.draggable().on("dragmove.namespace",this.selectionDragging.bind(this,"dragging")),this.preselectedSelection(),this.hoverArea=e.dom.baseEl.querySelector(`${e.globals.chartClass} .apexcharts-svg`),this.hoverArea&&(this.hoverArea.classList.add("apexcharts-zoomable"),this.eventList.forEach(e=>{var i;null==(i=this.hoverArea)||i.addEventListener(e,s.svgMouseEvents.bind(s,t),{capture:!1,passive:!0})}),e.config.chart.zoom.enabled&&e.config.chart.zoom.allowMouseWheelZoom&&this.hoverArea.addEventListener("wheel",s.mouseWheelEvent.bind(s),{capture:!1,passive:!1}))}destroy(){this.slDraggableRect&&(this.slDraggableRect.draggable(!1),this.slDraggableRect.off(),this.selectionRect.off()),this.selectionRect=null,this.zoomRect=null,this.gridRect=null}svgMouseEvents(t,e){var s;const i=this.w,a=this.ctx.toolbar,o=i.interact.zoomEnabled?i.config.chart.zoom.type:i.config.chart.selection.type,r=i.config.chart.toolbar.autoSelected;if(e.shiftKey?(this.shiftWasPressed=!0,a.enableZoomPanFromToolbar("pan"===r?"zoom":"pan")):this.shiftWasPressed&&(a.enableZoomPanFromToolbar(r),this.shiftWasPressed=!1),!e.target)return;const n=e.target.classList;let l;e.target.parentNode&&null!==e.target.parentNode&&(l=e.target.parentNode.classList);if(!(n.contains("apexcharts-legend-marker")||n.contains("apexcharts-legend-text")||l&&l.contains("apexcharts-toolbar"))){if(this.clientX="touchmove"===e.type||"touchstart"===e.type?e.touches[0].clientX:"touchend"===e.type?e.changedTouches[0].clientX:e.clientX,this.clientY="touchmove"===e.type||"touchstart"===e.type?e.touches[0].clientY:"touchend"===e.type?e.changedTouches[0].clientY:e.clientY,"mousedown"===e.type&&1===e.which||"touchstart"===e.type){const t=null==(s=this.gridRect)?void 0:s.getBoundingClientRect();if(!t)return;this.startX=this.clientX-t.left-i.globals.barPadForNumericAxis,this.startY=this.clientY-t.top,this.dragged=!1,this.w.interact.mousedown=!0}("mousemove"===e.type&&1===e.which||"touchmove"===e.type)&&(this.dragged=!0,i.interact.panEnabled?(i.interact.selection=null,this.w.interact.mousedown&&this.panDragging({context:this,zoomtype:o,xyRatios:t})):(this.w.interact.mousedown&&i.interact.zoomEnabled||this.w.interact.mousedown&&i.interact.selectionEnabled)&&(this.selection=this.selectionDrawing({context:this,zoomtype:o}))),"mouseup"!==e.type&&"touchend"!==e.type&&"mouseleave"!==e.type||this.handleMouseUp({zoomtype:o}),this.makeSelectionRectDraggable()}}handleMouseUp({zoomtype:t,isResized:e}){var s;const i=this.w,a=null==(s=this.gridRect)?void 0:s.getBoundingClientRect();a&&(this.w.interact.mousedown||e)&&(this.endX=this.clientX-a.left-i.globals.barPadForNumericAxis,this.endY=this.clientY-a.top,this.dragX=Math.abs(this.endX-this.startX),this.dragY=Math.abs(this.endY-this.startY),(i.interact.zoomEnabled||i.interact.selectionEnabled)&&this.selectionDrawn({context:this,zoomtype:t})),i.interact.zoomEnabled&&this.hideSelectionRect(this.selectionRect),this.dragged=!1,this.w.interact.mousedown=!1}mouseWheelEvent(t){const e=this.w;t.preventDefault();const s=Date.now();s-e.interact.lastWheelExecution>this.wheelDelay&&(this.executeMouseWheelZoom(t),e.interact.lastWheelExecution=s),this.debounceTimer&&clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout(()=>{s-e.interact.lastWheelExecution>this.wheelDelay&&(this.executeMouseWheelZoom(t),e.interact.lastWheelExecution=s)},this.debounceDelay)}executeMouseWheelZoom(t){var e;const s=this.w;this.minX=s.axisFlags.isRangeBar?s.globals.minY:s.globals.minX,this.maxX=s.axisFlags.isRangeBar?s.globals.maxY:s.globals.maxX;const i=null==(e=this.gridRect)?void 0:e.getBoundingClientRect();if(!i)return;const a=(t.clientX-i.left)/i.width,o=this.minX,r=this.maxX,n=r-o;let l,h,c;if(t.deltaY<0){l=.5*n;const t=o+a*n;h=t-l/2,c=t+l/2}else l=1.5*n,h=o-l/2,c=r+l/2;if(!s.axisFlags.isRangeBar){h=Math.max(h,s.globals.initialMinX),c=Math.min(c,s.globals.initialMaxX);const t=.01*(s.globals.initialMaxX-s.globals.initialMinX);if(c-h0&&e.height>0&&(this.selectionRect.select(!1).resize(!1),this.selectionRect.select({createRot:()=>{},updateRot:()=>{},createHandle:(t,e,s,i,a)=>"l"===a||"r"===a?t.circle(8).css({"stroke-width":1,stroke:"#333",fill:"#fff"}):t.circle(0),updateHandle:(t,e)=>t.center(e[0],e[1])}).resize().on("resize",()=>{const e=t.interact.zoomEnabled?t.config.chart.zoom.type:t.config.chart.selection.type;this.handleMouseUp({zoomtype:e,isResized:!0})}))}preselectedSelection(){const t=this.w,e=this.xyRatios;if(!t.interact.zoomEnabled)if(void 0!==t.interact.selection&&null!==t.interact.selection)this.drawSelectionRect(l(n({},t.interact.selection),{translateX:t.layout.translateX,translateY:t.layout.translateY}));else if(void 0!==t.config.chart.selection.xaxis.min&&void 0!==t.config.chart.selection.xaxis.max){let s=(t.config.chart.selection.xaxis.min-t.globals.minX)/e.xRatio,i=t.layout.gridWidth-(t.globals.maxX-t.config.chart.selection.xaxis.max)/e.xRatio-s;t.axisFlags.isRangeBar&&(s=(t.config.chart.selection.xaxis.min-t.globals.yAxisScale[0].niceMin)/e.invertedYRatio,i=(t.config.chart.selection.xaxis.max-t.config.chart.selection.xaxis.min)/e.invertedYRatio);const a={x:s,y:0,width:i,height:t.layout.gridHeight,translateX:t.layout.translateX,translateY:t.layout.translateY,selectionEnabled:!0};this.drawSelectionRect(a),this.makeSelectionRectDraggable(),"function"==typeof t.config.chart.events.selection&&t.config.chart.events.selection(this.ctx,{xaxis:{min:t.config.chart.selection.xaxis.min,max:t.config.chart.selection.xaxis.max},yaxis:{}})}}drawSelectionRect({x:t,y:e,width:s,height:i,translateX:a=0,translateY:o=0}){const r=this.w,n=this.zoomRect,l=this.selectionRect;if(this.dragged||null!==r.interact.selection){const h={transform:"translate("+a+", "+o+")"};r.interact.zoomEnabled&&this.dragged&&(s<0&&(s=1),n.attr({x:t,y:e,width:s,height:i,fill:r.config.chart.zoom.zoomedArea.fill.color,"fill-opacity":r.config.chart.zoom.zoomedArea.fill.opacity,stroke:r.config.chart.zoom.zoomedArea.stroke.color,"stroke-width":r.config.chart.zoom.zoomedArea.stroke.width,"stroke-opacity":r.config.chart.zoom.zoomedArea.stroke.opacity}),T.setAttrs(n.node,h)),r.interact.selectionEnabled&&(l.attr({x:t,y:e,width:s>0?s:0,height:i>0?i:0,fill:r.config.chart.selection.fill.color,"fill-opacity":r.config.chart.selection.fill.opacity,stroke:r.config.chart.selection.stroke.color,"stroke-width":r.config.chart.selection.stroke.width,"stroke-dasharray":r.config.chart.selection.stroke.dashArray,"stroke-opacity":r.config.chart.selection.stroke.opacity}),T.setAttrs(l.node,h))}}hideSelectionRect(t){t&&t.attr({x:0,y:0,width:0,height:0})}selectionDrawing({context:t,zoomtype:e}){var s;const i=this.w,a=t,o=null==(s=this.gridRect)?void 0:s.getBoundingClientRect();if(!o)return;const r=a.startX-1,h=a.startY;let c=!1,d=!1;const g=a.clientX-o.left-i.globals.barPadForNumericAxis,p=a.clientY-o.top;let x=g-r,u=p-h,f={translateX:i.layout.translateX,translateY:i.layout.translateY};return Math.abs(x+r)>i.layout.gridWidth?x=i.layout.gridWidth-r:g<0&&(x=r),r>g&&(c=!0,x=Math.abs(x)),h>p&&(d=!0,u=Math.abs(u)),f="x"===e?{x:c?r-x:r,y:0,width:x,height:i.layout.gridHeight}:"y"===e?{x:0,y:d?h-u:h,width:i.layout.gridWidth,height:u}:{x:c?r-x:r,y:d?h-u:h,width:x,height:u},f=l(n({},f),{translateX:i.layout.translateX,translateY:i.layout.translateY}),a.drawSelectionRect(f),a.selectionDragging("resizing"),f}selectionDragging(t,e){var s;const i=this.w;if(!e)return;e.preventDefault();const{handler:a,box:o}=e.detail,r=this.constraints;let{x:n,y:l}=o;nr.x2&&(n=r.x2-o.w),o.y2>r.y2&&(l=r.y2-o.h),a.move(n,l);const h=this.xyRatios,c=this.selectionRect;let d=0;"resizing"===t&&(d=30);const g=t=>parseFloat(c.node.getAttribute(t)),p={x:g("x"),y:g("y"),width:g("width"),height:g("height")};i.interact.selection=p,"function"==typeof i.config.chart.events.selection&&i.interact.selectionEnabled&&(clearTimeout(null!=(s=this.w.globals.selectionResizeTimer)?s:void 0),this.w.globals.selectionResizeTimer=window.setTimeout(()=>{var t;const e=null==(t=this.gridRect)?void 0:t.getBoundingClientRect();if(!e)return;const s=c.node.getBoundingClientRect();let a,o,r,n;if(i.axisFlags.isRangeBar)a=i.globals.yAxisScale[0].niceMin+(s.left-e.left)*h.invertedYRatio,o=i.globals.yAxisScale[0].niceMin+(s.right-e.left)*h.invertedYRatio,r=0,n=1;else{if(!i.globals.xAxisScale)return;a=i.globals.xAxisScale.niceMin+(s.left-e.left)*h.xRatio,o=i.globals.xAxisScale.niceMin+(s.right-e.left)*h.xRatio,r=i.globals.yAxisScale[0].niceMin+(e.bottom-s.bottom)*h.yRatio[0],n=i.globals.yAxisScale[0].niceMax-(s.top-e.top)*h.yRatio[0]}const l={xaxis:{min:a,max:o},yaxis:{min:r,max:n}};i.config.chart.events.selection(this.ctx,l),i.config.chart.brush.enabled&&void 0!==i.config.chart.events.brushScrolled&&i.config.chart.events.brushScrolled(this.ctx,l)},d))}selectionDrawn({context:t,zoomtype:e}){var s,i;const a=this.w,o=t,r=this.xyRatios,n=this.ctx.toolbar,l=a.interact.zoomEnabled?o.zoomRect.node.getBoundingClientRect():o.selectionRect.node.getBoundingClientRect(),h=o.gridRect.getBoundingClientRect(),c=l.left-h.left-a.globals.barPadForNumericAxis,d=l.right-h.left-a.globals.barPadForNumericAxis,g=l.top-h.top,p=l.bottom-h.top;let x,u;if(a.axisFlags.isRangeBar)x=a.globals.yAxisScale[0].niceMin+c*r.invertedYRatio,u=a.globals.yAxisScale[0].niceMin+d*r.invertedYRatio;else{const t=null!=(i=null==(s=a.globals.xAxisScale)?void 0:s.niceMin)?i:0;x=t+c*r.xRatio,u=t+d*r.xRatio}const f=[],b=[];if(a.config.yaxis.forEach((t,e)=>{const s=a.globals.seriesYAxisMap[e][0],i=a.globals.yAxisScale[e].niceMax-r.yRatio[s]*g,o=a.globals.yAxisScale[e].niceMax-r.yRatio[s]*p;f.push(i),b.push(o)}),o.dragged&&(o.dragX>10||o.dragY>10)&&x!==u)if(a.interact.zoomEnabled){if(!a.globals.initialConfig)return;let t=m.clone(a.globals.initialConfig.yaxis),s=m.clone(a.globals.initialConfig.xaxis);if(a.interact.zoomed=!0,a.config.xaxis.convertedCatToNumeric&&(x=Math.floor(x),u=Math.floor(u),x<1&&(x=1,u=a.globals.dataPoints),u-x<2&&(u=x+1)),"xy"!==e&&"x"!==e||(s={min:x,max:u}),"xy"!==e&&"y"!==e||t.forEach((e,s)=>{t[s].min=b[s],t[s].max=f[s]}),n){const e=n.getBeforeZoomRange(s,t);e&&(s=e.xaxis?e.xaxis:s,t=e.yaxis?e.yaxis:t)}const i={xaxis:s};a.config.chart.group||(i.yaxis=t),o.ctx.updateHelpers._updateOptions(i,!1,o.w.config.chart.animations.dynamicAnimation.enabled),"function"==typeof a.config.chart.events.zoomed&&n.zoomCallback(s,t)}else if(a.interact.selectionEnabled){let t=null,s=null;if(s={min:x,max:u},"xy"===e||"y"===e){const e=m.clone(a.config.yaxis);t=e,e.forEach((t,s)=>{e[s].min=b[s],e[s].max=f[s]})}a.interact.selection=o.selection,"function"==typeof a.config.chart.events.selection&&a.config.chart.events.selection(o.ctx,{xaxis:s,yaxis:t})}}panDragging({context:t}){var e;const s=this.w,i=t;if(void 0!==s.interact.lastClientPosition.x){const t=s.interact.lastClientPosition.x-i.clientX,a=(null!=(e=s.interact.lastClientPosition.y)?e:0)-i.clientY;Math.abs(t)>Math.abs(a)&&t>0?this.moveDirection="left":Math.abs(t)>Math.abs(a)&&t<0?this.moveDirection="right":Math.abs(a)>Math.abs(t)&&a>0?this.moveDirection="up":Math.abs(a)>Math.abs(t)&&a<0&&(this.moveDirection="down")}s.interact.lastClientPosition={x:i.clientX,y:i.clientY};const a=s.axisFlags.isRangeBar?s.globals.minY:s.globals.minX,o=s.axisFlags.isRangeBar?s.globals.maxY:s.globals.maxX;i.panScrolled(a,o)}panScrolled(t,e){const s=this.w,i=this.xyRatios;if(!s.globals.initialConfig)return;const a=m.clone(s.globals.initialConfig.yaxis);let o=i.xRatio,r=s.globals.minX,n=s.globals.maxX;s.axisFlags.isRangeBar&&(o=i.invertedYRatio,r=s.globals.minY,n=s.globals.maxY),"left"===this.moveDirection?(t=r+s.layout.gridWidth/15*o,e=n+s.layout.gridWidth/15*o):"right"===this.moveDirection&&(t=r-s.layout.gridWidth/15*o,e=n-s.layout.gridWidth/15*o),s.axisFlags.isRangeBar||(ts.globals.initialMaxX)&&(t=r,e=n);const l={xaxis:{min:t,max:e}};s.config.chart.group||(l.yaxis=a),this.updateScrolledChart(l,t,e)}updateScrolledChart(t,e,s){const i=this.w;if(this.ctx.updateHelpers._updateOptions(t,!1,!1),"function"==typeof i.config.chart.events.scrolled){const t={xaxis:{min:e,max:s}};i.config.chart.events.scrolled(this.ctx,t),this.ctx.events.fireEvent("scrolled",t)}}}});let oe=class{constructor(t){this.w=t.w,this.annoCtx=t}setOrientations(t,e=null){var s,i;const a=this.w;if("vertical"===t.label.orientation){const o=null!==e?e:0,r=a.dom.baseEl.querySelector(`.apexcharts-xaxis-annotations .apexcharts-xaxis-annotation-label[rel='${o}']`);if(null!==r){const e=r.getBBox();r.setAttribute("x",String(parseFloat(null!=(s=r.getAttribute("x"))?s:"0")-e.height+4));const a="top"===t.label.position?e.width:-e.width;r.setAttribute("y",String(parseFloat(null!=(i=r.getAttribute("y"))?i:"0")+a));const{x:o,y:n}=this.annoCtx.graphics.rotateAroundCenter(r);r.setAttribute("transform",`rotate(-90 ${o} ${n})`)}}}addBackgroundToAnno(t,e){const s=this.w;if(!t||!e.label.text||!String(e.label.text).trim())return null;const i=s.dom.baseEl.querySelector(".apexcharts-grid");if(!i)return null;const a=i.getBoundingClientRect(),o=i.getBBox(),r=a.width/o.width||1,n=t.getBoundingClientRect();let{left:l,right:h,top:c,bottom:d}=e.label.style.padding;"vertical"===e.label.orientation&&([c,d,l,h]=[l,h,c,d]);const g=(n.left-a.left)/r-l,p=(n.top-a.top)/r-c,x=this.annoCtx.graphics.drawRect(g-s.globals.barPadForNumericAxis,p,n.width/r+l+h,n.height/r+c+d,e.label.borderRadius,e.label.style.background,1,e.label.borderWidth,e.label.borderColor,0);return e.id&&x.node.classList.add(e.id),x}annotationsBackground(){const t=this.w,e=(e,s,i)=>{const a=t.dom.baseEl.querySelector(`.apexcharts-${i}-annotations .apexcharts-${i}-annotation-label[rel='${s}']`);if(a){const t=a.parentNode,s=this.addBackgroundToAnno(a,e);s&&(null==t||t.insertBefore(s.node,a),e.label.mouseEnter&&s.node.addEventListener("mouseenter",e.label.mouseEnter.bind(this,e)),e.label.mouseLeave&&s.node.addEventListener("mouseleave",e.label.mouseLeave.bind(this,e)),e.label.click&&s.node.addEventListener("click",e.label.click.bind(this,e)))}};t.config.annotations.xaxis.forEach((t,s)=>e(t,s,"xaxis")),t.config.annotations.yaxis.forEach((t,s)=>e(t,s,"yaxis")),t.config.annotations.points.forEach((t,s)=>e(t,s,"point"))}getY1Y2(t,e){var s,i;const a=this.w,o="y1"===t?e.y:e.y2;let r,n=!1;if(this.annoCtx.invertAxis){const t=a.config.xaxis.convertedCatToNumeric?a.labelData.categoryLabels:a.labelData.labels,i=t.indexOf(o),n=a.dom.baseEl.querySelector(`.apexcharts-yaxis-texts-g text:nth-child(${i+1})`);r=n?parseFloat(null!=(s=n.getAttribute("y"))?s:"0"):(a.layout.gridHeight/t.length-1)*(i+1)-a.globals.barHeight,void 0!==e.seriesIndex&&a.globals.barHeight&&(r-=a.globals.barHeight/2*(a.seriesData.series.length-1)-a.globals.barHeight*e.seriesIndex)}else{const t=a.globals.seriesYAxisMap[e.yAxisIndex][0],s=a.config.yaxis[e.yAxisIndex].logarithmic?new E(this.w).getLogVal(a.config.yaxis[e.yAxisIndex].logBase,o,t)/a.globals.yLogRatio[t]:(o-a.globals.minYArr[t])/(a.globals.yRange[t]/a.layout.gridHeight);r=a.layout.gridHeight-Math.min(Math.max(s,0),a.layout.gridHeight),n=s>a.layout.gridHeight||s<0,!e.marker||void 0!==e.y&&null!==e.y||(r=0),(null==(i=a.config.yaxis[e.yAxisIndex])?void 0:i.reversed)&&(r=s)}return"string"==typeof o&&o.includes("px")&&(r=parseFloat(o)),{yP:r,clipped:n}}getX1X2(t,e){const s=this.w,i="x1"===t?e.x:e.x2,a=this.annoCtx.invertAxis?s.globals.minY:s.globals.minX,o=this.annoCtx.invertAxis?s.globals.maxY:s.globals.maxX,r=this.annoCtx.invertAxis?s.globals.yRange[0]:s.globals.xRange;let n=!1,l=this.annoCtx.inversedReversedAxis?(o-i)/(r/s.layout.gridWidth):(i-a)/(r/s.layout.gridWidth);return"category"!==s.config.xaxis.type&&!s.config.xaxis.convertedCatToNumeric||this.annoCtx.invertAxis||s.axisFlags.dataFormatXNumeric||s.config.chart.sparkline.enabled||(l=this.getStringX(i)),"string"==typeof i&&i.includes("px")&&(l=parseFloat(i)),null==i&&e.marker&&(l=s.layout.gridWidth),void 0!==e.seriesIndex&&s.globals.barWidth&&!this.annoCtx.invertAxis&&(l-=s.globals.barWidth/2*(s.seriesData.series.length-1)-s.globals.barWidth*e.seriesIndex),"number"!=typeof l&&(l=0,n=!0),parseFloat(l.toFixed(10))>parseFloat(s.layout.gridWidth.toFixed(10))?(l=s.layout.gridWidth,n=!0):l<0&&(l=0,n=!0),{x:l,clipped:n}}getStringX(t){var e;const s=this.w;let i=t;s.config.xaxis.convertedCatToNumeric&&s.labelData.categoryLabels.length&&(t=s.labelData.categoryLabels.indexOf(String(t))+1);const a=s.labelData.labels.map(t=>Array.isArray(t)?t.join(" "):t).indexOf(t),o=s.dom.baseEl.querySelector(`.apexcharts-xaxis-texts-g text:nth-child(${a+1})`);return o&&(i=parseFloat(null!=(e=o.getAttribute("x"))?e:"0")),i}};class re{constructor(t){this.w=t.w,this.annoCtx=t,this.invertAxis=this.annoCtx.invertAxis,this.helpers=new oe(this.annoCtx)}addXaxisAnnotation(t,e,s){const i=this.w,a=this.helpers.getX1X2("x1",t);let o=a.x;const r=a.clipped;let n,l=!0;const h=t.label.text,c=t.strokeDashArray;if(m.isNumber(o)){if(null===t.x2||void 0===t.x2){if(!r){const s=this.annoCtx.graphics.drawLine(o+t.offsetX,0+t.offsetY,o+t.offsetX,i.layout.gridHeight+t.offsetY,t.borderColor,c,t.borderWidth);e.appendChild(s.node),t.id&&s.node.classList.add(t.id)}}else{const s=this.helpers.getX1X2("x2",t);if(n=s.x,l=s.clipped,n{this.addXaxisAnnotation(t,e.node,s)}),e}}class ne{constructor(t){this.w=t.w,this.annoCtx=t,this.helpers=new oe(this.annoCtx),this.axesUtils=new G(this.annoCtx.w,{theme:this.annoCtx.theme,timeScale:this.annoCtx.timeScale})}addYaxisAnnotation(t,e,s){const i=this.w,a=t.strokeDashArray;let o=this.helpers.getY1Y2("y1",t),r=o.yP;const n=o.clipped;let l,h=!0,c=!1;const d=t.label.text;if(null===t.y2||void 0===t.y2){if(!n){c=!0;const s=this.annoCtx.graphics.drawLine(0+t.offsetX,r+t.offsetY,this._getYAxisAnnotationWidth(t),r+t.offsetY,t.borderColor,a,t.borderWidth);e.appendChild(s.node),t.id&&s.node.classList.add(t.id)}}else{if(o=this.helpers.getY1Y2("y2",t),l=o.yP,h=o.clipped,l>r){const t=r;r=l,l=t}if(!n||!h){c=!0;const s=this.annoCtx.graphics.drawRect(0+t.offsetX,l+t.offsetY,this._getYAxisAnnotationWidth(t),r-l,0,t.fillColor,t.opacity,1,t.borderColor,a);s.node.classList.add("apexcharts-annotation-rect"),s.attr("clip-path",`url(#gridRectMask${i.globals.cuid})`),e.appendChild(s.node),t.id&&s.node.classList.add(t.id)}}if(c){const a="right"===t.label.position?i.layout.gridWidth:"center"===t.label.position?i.layout.gridWidth/2:0,o=this.annoCtx.graphics.drawText({x:a+t.label.offsetX,y:(null!=l?l:r)+t.label.offsetY-3,text:d,textAnchor:t.label.textAnchor,fontSize:t.label.style.fontSize,fontFamily:t.label.style.fontFamily,fontWeight:t.label.style.fontWeight,foreColor:t.label.style.color,cssClass:`apexcharts-yaxis-annotation-label ${t.label.style.cssClass} ${t.id?t.id:""}`});o.attr({rel:s}),e.appendChild(o.node)}}_getYAxisAnnotationWidth(t){const e=this.w;let s=e.layout.gridWidth;return s=t.width.indexOf("%")>-1?e.layout.gridWidth*parseInt(t.width,10)/100:parseInt(t.width,10),s+t.offsetX}drawYAxisAnnotations(){const t=this.w,e=this.annoCtx.graphics.group({class:"apexcharts-yaxis-annotations"});return t.config.annotations.yaxis.forEach((t,s)=>{t.yAxisIndex=this.axesUtils.translateYAxisIndex(t.yAxisIndex),this.axesUtils.isYAxisHidden(t.yAxisIndex)&&this.axesUtils.yAxisAllSeriesCollapsed(t.yAxisIndex)||this.addYaxisAnnotation(t,e.node,s)}),e}}class le{constructor(t){this.w=t.w,this.annoCtx=t,this.helpers=new oe(this.annoCtx)}addPointAnnotation(t,e,s){if(this.w.globals.collapsedSeriesIndices.indexOf(t.seriesIndex)>-1)return;const i=this.helpers.getX1X2("x1",t),a=i.x,o=i.clipped,r=this.helpers.getY1Y2("y1",t),n=r.yP,l=r.clipped;if(m.isNumber(a)&&!l&&!o){const i={pSize:t.marker.size,pointStrokeWidth:t.marker.strokeWidth,pointFillColor:t.marker.fillColor,pointStrokeColor:t.marker.strokeColor,shape:t.marker.shape,pRadius:t.marker.radius,class:`apexcharts-point-annotation-marker ${t.marker.cssClass} ${t.id?t.id:""}`};let o=this.annoCtx.graphics.drawMarker(a+t.marker.offsetX,n+t.marker.offsetY,i);e.appendChild(o.node);const r=t.label.text?t.label.text:"",l=this.annoCtx.graphics.drawText({x:a+t.label.offsetX,y:n+t.label.offsetY-t.marker.size-parseFloat(t.label.style.fontSize)/1.6,text:r,textAnchor:t.label.textAnchor,fontSize:t.label.style.fontSize,fontFamily:t.label.style.fontFamily,fontWeight:t.label.style.fontWeight,foreColor:t.label.style.color,cssClass:`apexcharts-point-annotation-label ${t.label.style.cssClass} ${t.id?t.id:""}`});if(l.attr({rel:s}),e.appendChild(l.node),t.customSVG.SVG){const s=this.annoCtx.graphics.group({class:"apexcharts-point-annotations-custom-svg "+t.customSVG.cssClass});s.attr({transform:`translate(${a+t.customSVG.offsetX}, ${n+t.customSVG.offsetY})`}),s.node.innerHTML=t.customSVG.SVG,e.appendChild(s.node)}if(t.image.path){const e=t.image.width?t.image.width:20,s=t.image.height?t.image.height:20;o=this.annoCtx.addImage({x:a+t.image.offsetX-e/2,y:n+t.image.offsetY-s/2,width:e,height:s,path:t.image.path,appendTo:".apexcharts-point-annotations"})}t.mouseEnter&&o.node.addEventListener("mouseenter",t.mouseEnter.bind(this,t)),t.mouseLeave&&o.node.addEventListener("mouseleave",t.mouseLeave.bind(this,t)),t.click&&o.node.addEventListener("click",t.click.bind(this,t))}}drawPointAnnotations(){const t=this.w,e=this.annoCtx.graphics.group({class:"apexcharts-point-annotations"});return t.config.annotations.points.map((t,s)=>{this.addPointAnnotation(t,e.node,s)}),e}}te.registerFeatures({annotations:class{constructor(t,{theme:e=null,timeScale:s=null}={}){this.w=t,this.theme=e,this.timeScale=s,this.invertAxis=void 0,this.inversedReversedAxis=void 0,this.graphics=new T(this.w),this.w.globals.isBarHorizontal&&(this.invertAxis=!0),this.helpers=new oe(this),this.xAxisAnnotations=new re(this),this.yAxisAnnotations=new ne(this),this.pointsAnnotations=new le(this),this.w.globals.isBarHorizontal&&this.w.config.yaxis[0].reversed&&(this.inversedReversedAxis=!0),this.xDivision=this.w.layout.gridWidth/this.w.globals.dataPoints}drawAxesAnnotations(){const t=this.w;if(t.globals.axisCharts&&t.globals.dataPoints){const e=this.yAxisAnnotations.drawYAxisAnnotations(),s=this.xAxisAnnotations.drawXAxisAnnotations(),i=this.pointsAnnotations.drawPointAnnotations(),a=t.config.chart.animations.enabled,o=[e,s,i],r=[s.node,e.node,i.node];for(let e=0;e<3;e++)t.dom.elGraphical.add(o[e]),!a||t.globals.resized||t.globals.dataChanged||"scatter"!==t.config.chart.type&&"bubble"!==t.config.chart.type&&t.globals.dataPoints>1&&r[e].classList.add("apexcharts-element-hidden"),t.globals.delayedElements.push({el:r[e],index:0});this.helpers.annotationsBackground()}}drawImageAnnos(){this.w.config.annotations.images.map(t=>{this.addImage(t)})}drawTextAnnos(){this.w.config.annotations.texts.map(t=>{this.addText(t)})}addXaxisAnnotation(t,e,s){this.xAxisAnnotations.addXaxisAnnotation(t,e,s)}addYaxisAnnotation(t,e,s){this.yAxisAnnotations.addYaxisAnnotation(t,e,s)}addPointAnnotation(t,e,s){this.pointsAnnotations.addPointAnnotation(t,e,s)}addText(t){const{x:e,y:s,text:i,textAnchor:a,foreColor:o,fontSize:r,fontFamily:n,fontWeight:l,cssClass:h,backgroundColor:c,borderWidth:d,strokeDashArray:g,borderRadius:p,borderColor:x,appendTo:u=".apexcharts-svg",paddingLeft:f=4,paddingRight:b=4,paddingBottom:m=2,paddingTop:y=2}=t,w=this.w,v=this.graphics.drawText({x:e,y:s,text:i,textAnchor:a||"start",fontSize:r||"12px",fontWeight:l||"regular",fontFamily:n||w.config.chart.fontFamily,foreColor:o||w.config.chart.foreColor,cssClass:h}),A=w.dom.baseEl.querySelector(u);A&&A.appendChild(v.node);const C=v.bbox();if(i){const t=this.graphics.drawRect(C.x-f,C.y-y,C.width+f+b,C.height+m+y,p,c||"transparent",1,d,x,g);A.insertBefore(t.node,v.node)}}addImage(t){const e=this.w,{path:s,x:i=0,y:a=0,width:o=20,height:r=20,appendTo:n=".apexcharts-svg"}=t,l=e.dom.Paper.image(s);l.size(o,r).move(i,a);const h=e.dom.baseEl.querySelector(n);return h&&h.appendChild(l.node),l}addXaxisAnnotationExternal(t,e,s){return this.addAnnotationExternal({params:t,pushToMemory:e,context:s,type:"xaxis",contextMethod:s.addXaxisAnnotation}),s}addYaxisAnnotationExternal(t,e,s){return this.addAnnotationExternal({params:t,pushToMemory:e,context:s,type:"yaxis",contextMethod:s.addYaxisAnnotation}),s}addPointAnnotationExternal(t,e,s){return void 0===this.invertAxis&&(this.invertAxis=s.w.globals.isBarHorizontal),this.addAnnotationExternal({params:t,pushToMemory:e,context:s,type:"point",contextMethod:s.addPointAnnotation}),s}addAnnotationExternal({params:t,pushToMemory:e,context:s,type:i,contextMethod:a}){const o=s,r=o.w,n=r.dom.baseEl.querySelector(`.apexcharts-${i}-annotations`),l=n.childNodes.length+1,h=new k,c=Object.assign({},"xaxis"===i?h.xAxisAnnotation:"yaxis"===i?h.yAxisAnnotation:h.pointAnnotation),d=m.extend(c,t);switch(i){case"xaxis":this.addXaxisAnnotation(d,n,l);break;case"yaxis":this.addYaxisAnnotation(d,n,l);break;case"point":this.addPointAnnotation(d,n,l)}const g=r.dom.baseEl.querySelector(`.apexcharts-${i}-annotations .apexcharts-${i}-annotation-label[rel='${l}']`),p=this.helpers.addBackgroundToAnno(g,d);return p&&n.insertBefore(p.node,g),e&&r.globals.memory.methodsToExec.push({context:o,id:d.id?d.id:m.randomId(),method:a,label:"addAnnotation",params:t}),s}clearAnnotations(t){const e=t.w,s=e.dom.baseEl.querySelectorAll(".apexcharts-yaxis-annotations, .apexcharts-xaxis-annotations, .apexcharts-point-annotations");for(let t=e.globals.memory.methodsToExec.length-1;t>=0;t--)"addText"!==e.globals.memory.methodsToExec[t].label&&"addAnnotation"!==e.globals.memory.methodsToExec[t].label||e.globals.memory.methodsToExec.splice(t,1);Array.prototype.forEach.call(s,t=>{for(;t.firstChild;)t.removeChild(t.firstChild)})}removeAnnotation(t,e){const s=t.w,i=s.dom.baseEl.querySelectorAll(`.${e}`);i&&(s.globals.memory.methodsToExec.map((t,i)=>{t.id===e&&s.globals.memory.methodsToExec.splice(i,1)}),Object.keys(s.config.annotations).forEach(t=>{const i=s.config.annotations[t];Array.isArray(i)&&(s.config.annotations[t]=i.filter(t=>t.id!==e))}),Array.prototype.forEach.call(i,t=>{t.parentElement.removeChild(t)}))}}});te.registerFeatures({keyboardNavigation:class{constructor(t,e){this.w=t,this.ctx=e,this.seriesIndex=0,this.dataPointIndex=0,this.active=!1,this._focusedEl=null,this._hoveredBarEl=null,this._enlargedScatterMarker=null,this._onKeyDown=this._onKeyDown.bind(this),this._onFocus=this._onFocus.bind(this),this._onBlur=this._onBlur.bind(this),this._onLegendClick=this._onLegendClick.bind(this)}init(){const t=this.w.dom.Paper.node;t&&(t.setAttribute("tabindex","0"),t.addEventListener("focus",this._onFocus),t.addEventListener("blur",this._onBlur),t.addEventListener("keydown",this._onKeyDown,{passive:!1}),this.ctx.events.addEventListener("legendClick",this._onLegendClick))}destroy(){const t=this.w,e=t.dom.Paper&&t.dom.Paper.node;e&&(e.removeEventListener("focus",this._onFocus),e.removeEventListener("blur",this._onBlur),e.removeEventListener("keydown",this._onKeyDown),this.ctx.events.removeEventListener("legendClick",this._onLegendClick))}handleKey(t){}_onFocus(){this._isNavEnabled()&&(this.active=!0,this._clampCursor(),this._snapToVisibleRange(),this._showCurrentPoint())}_onBlur(){this.active=!1,this._hideFocus()}_onLegendClick(){this.active&&(this.active=!1,this._hideFocus())}_onKeyDown(t){if(this._isNavEnabled()&&this.active)switch(t.key){case"ArrowRight":t.preventDefault(),this._move(0,1);break;case"ArrowLeft":t.preventDefault(),this._move(0,-1);break;case"ArrowUp":t.preventDefault(),this._move(-1,0);break;case"ArrowDown":t.preventDefault(),this._move(1,0);break;case"Home":t.preventDefault(),this.dataPointIndex=0,this._skipNullForward(),this._showCurrentPoint();break;case"End":t.preventDefault(),this.dataPointIndex=this._getDataPointCount(this.seriesIndex)-1,this._skipNullBackward(),this._showCurrentPoint();break;case"Enter":case" ":t.preventDefault(),this._fireClick();break;case"Escape":t.preventDefault(),this.active=!1,this._hideFocus()}}_move(t,e){const s=this.w,i=s.config.chart.accessibility.keyboard.navigation.wrapAround;if(0!==t){const e=this.w.globals.tooltip;if(e&&e.tConfig&&e.tConfig.shared){const t=this.dataPointIndex;if(e.tooltipUtil&&e.tooltipUtil.isXoverlap(t)&&e.tooltipUtil.isInitialSeriesSameLen())return}const a=this._getSeriesCount();let o=this.seriesIndex+t,r=0;for(;r=a&&(o=i?0:a-1),s.globals.collapsedSeriesIndices.includes(o));)o+=t,r++;this.seriesIndex=o;const n=this._getDataPointCount(o);this.dataPointIndex>=n&&(this.dataPointIndex=n-1)}if(0!==e){const t=this._getDataPointCount(this.seriesIndex);let s=this.dataPointIndex+e;s<0&&(s=i?t-1:0),s>=t&&(s=i?0:t-1),this.dataPointIndex=s,e>0?this._skipNullForward():this._skipNullBackward(),this._isDataPointVisible(this.seriesIndex,this.dataPointIndex)||this._snapToVisibleRangeInDirection(e)}this._showCurrentPoint()}_skipNullForward(){const t=this.w,e=this.seriesIndex,s=this._getDataPointCount(e);let i=this.dataPointIndex,a=0;if(Array.isArray(t.seriesData.series[e])){for(;a0;r?this._showScatterBubblePoint(t,e,s):n?o?s.marker.enlargePoints(e):s.tooltipPosition.moveDynamicPointOnHover(e,t):o?s.tooltipPosition.moveDynamicPointsOnHover(e):s.tooltipPosition.moveDynamicPointOnHover(e,t)}_showScatterBubblePoint(t,e,s){const i=this.w.dom.baseEl;this._enlargedScatterMarker&&(s.marker.oldPointSize(this._enlargedScatterMarker),this._enlargedScatterMarker=null);const a=i.querySelector(`.apexcharts-series[data\\:realIndex='${t}']`);if(!a)return;const o=a.querySelector(`.apexcharts-marker[rel='${e}']`);o&&(s.marker.enlargeCurrentPoint(e,o),this._enlargedScatterMarker=o)}_showTooltipNonAxis(t,e,s,i){var a,o;const r=this.w;s.tooltipLabels.drawSeriesTexts({ttItems:s.ttItems,i:e,shared:!1});const n=i.getBoundingClientRect(),l=n.width||s.tooltipRect.ttWidth||0,h=n.height||s.tooltipRect.ttHeight||0,c=r.dom.baseEl.querySelector(`.apexcharts-pie-area[j='${e}']`);if(c){const t=parseFloat(null!=(a=c.getAttribute("data:cx"))?a:""),e=parseFloat(null!=(o=c.getAttribute("data:cy"))?o:"");if(!isNaN(t)&&!isNaN(e)){const s=r.dom.Paper.node.getBoundingClientRect(),a=r.dom.elWrap.getBoundingClientRect(),o=s.left-a.left,n=s.top-a.top;i.style.left=o+t-l/2+"px",i.style.top=n+e-h-10+"px"}}}_showTooltipRadialBar(t,e,s,i){var a;const o=this.w;s.tooltipLabels.drawSeriesTexts({ttItems:s.ttItems,i:t,shared:!1});const{ttWidth:r=0,ttHeight:n=0}=s.getCachedDimensions(),l=o.dom.baseEl.querySelector(`.apexcharts-radialbar-series[data\\:realIndex='${t}'] path`);if(l){const e=parseFloat(null!=(a=l.getAttribute("data:angle"))?a:"")||0,s=(o.config.plotOptions.radialBar.startAngle||0)+e/2,h=o.layout.gridWidth/2,c=o.layout.gridHeight/2,d=o.globals.radialSize||Math.min(o.layout.gridWidth,o.layout.gridHeight)/2,g=o.seriesData.series.length,p=d/Math.max(g,1),x=d-t*p,u=(x+(x-p))/2,f=m.polarToCartesian(h,c,u,s),b=f.x+(o.layout.translateX||0),y=f.y+(o.layout.translateY||0);i.style.left=b-r/2+"px",i.style.top=y-n-10+"px"}}_showTooltipHeatTree(t,e,s,i,a){var o,r;const n=this.w;s.tooltipLabels.drawSeriesTexts({ttItems:s.ttItems,i:t,j:e,shared:!1});const l=i.getBoundingClientRect(),h=l.width||s.tooltipRect.ttWidth||0,c=l.height||s.tooltipRect.ttHeight||0,d="heatmap"===a?"apexcharts-heatmap-rect":"apexcharts-treemap-rect",g=n.dom.baseEl.querySelector(`.${d}[i='${t}'][j='${e}']`);if(g){const t=n.dom.elWrap.getBoundingClientRect(),e=g.getBoundingClientRect(),a=e.left-t.left,l=e.top-t.top,d=e.width,p=e.height,x=parseFloat(null!=(o=g.getAttribute("cx"))?o:""),u=parseFloat(null!=(r=g.getAttribute("width"))?r:"");s.tooltipPosition.moveXCrosshairs(x+u/2);let f=a+d+h/2;const b=l+p/2-c/2;a+d>n.layout.gridWidth/2&&(f=a-h/2),i.style.left=f+"px",i.style.top=b+"px"}}_applyFocusClass(t,e){this._removeFocusClass();const s=this._getFocusableElement(t,e);s&&(s.classList.add("apexcharts-keyboard-focused"),this._focusedEl=s)}_removeFocusClass(){this._focusedEl&&(this._focusedEl.classList.remove("apexcharts-keyboard-focused"),this._focusedEl=null)}_leaveHoveredBar(){if(this._hoveredBarEl){new T(this.w,this.ctx).pathMouseLeave(this._hoveredBarEl,null),this._hoveredBarEl=null}}_getFocusableElement(t,e){const s=this.w,i=s.config.chart.type,a=s.dom.baseEl;if("pie"===i||"donut"===i||"polarArea"===i)return a.querySelector(`.apexcharts-pie-area[j='${e}']`);if("heatmap"===i)return a.querySelector(`.apexcharts-heatmap-rect[i='${t}'][j='${e}']`);if("treemap"===i)return a.querySelector(`.apexcharts-treemap-rect[i='${t}'][j='${e}']`);if("radialBar"===i)return a.querySelector(`.apexcharts-radialbar-series[data\\:realIndex='${t}'] path`);if("bar"===i||"candlestick"===i||"boxPlot"===i||"rangeBar"===i)return a.querySelector(`.apexcharts-series[data\\:realIndex='${t}'] path[j='${e}']`);return a.querySelector(`.apexcharts-series[data\\:realIndex='${t}'] .apexcharts-marker[rel='${e}']`)||null}_fireClick(){const t=this.w.globals.tooltip;if(!t)return;t.markerClick({type:"mouseup",clientX:0,clientY:0},this.seriesIndex,this.dataPointIndex)}_isNavEnabled(){const t=this.w.config.chart.accessibility;return t.enabled&&t.keyboard.enabled&&t.keyboard.navigation.enabled}_getSeriesCount(){const t=this.w,e=t.config.chart.type;return"pie"===e||"donut"===e||"polarArea"===e?1:t.seriesData.series.length}_getDataPointCount(t){const e=this.w,s=e.config.chart.type;if("pie"===s||"donut"===s||"polarArea"===s)return e.seriesData.series.length;const i=e.seriesData.series;return i[t]&&Array.isArray(i[t])?i[t].length:0}_clampCursor(){const t=this._getSeriesCount();this.seriesIndex>=t&&(this.seriesIndex=t-1),this.seriesIndex<0&&(this.seriesIndex=0);const e=this._getDataPointCount(this.seriesIndex);this.dataPointIndex>=e&&(this.dataPointIndex=e-1),this.dataPointIndex<0&&(this.dataPointIndex=0)}_snapToVisibleRange(){const t=this.w,e=t.globals,s=this.seriesIndex;if(!t.interact.zoomed)return;const i=t.seriesData.seriesX&&t.seriesData.seriesX[s];if(!i||!i.length)return;const a=e.minX,o=e.maxX;if(void 0===a||void 0===o)return;const r=i[this.dataPointIndex];if(r>=a&&r<=o)return;const n=i.length;for(let t=0;t=a&&i[t]<=o)return void(this.dataPointIndex=t)}_snapToVisibleRangeInDirection(t){const e=this.w,s=e.globals,i=this.seriesIndex,a=e.seriesData.seriesX&&e.seriesData.seriesX[i];if(!a||!a.length)return;const o=s.minX,r=s.maxX;if(void 0===o||void 0===r)return;const n=a.length;if(t>=0){for(let t=0;t=o&&a[t]<=r)return void(this.dataPointIndex=t)}else for(let t=n-1;t>=0;t--)if(a[t]>=o&&a[t]<=r)return void(this.dataPointIndex=t)}_isDataPointVisible(t,e){const s=this.w,i=s.globals;if(!s.interact.zoomed)return!0;const a=s.seriesData.seriesX&&s.seriesData.seriesX[t];if(!a)return!0;const o=a[e];return void 0===o||o>=i.minX&&o<=i.maxX}}});class he{constructor(t){this.w=t.w,this.barCtx=t,this.totalFormatter=this.w.config.plotOptions.bar.dataLabels.total.formatter,this.totalFormatter||(this.totalFormatter=this.w.config.dataLabels.formatter)}handleBarDataLabels(t){const{x:e,y:s,y1:i,y2:a,i:o,j:r,realIndex:h,columnGroupIndex:c,series:d,barHeight:g,barWidth:p,barXPosition:x,barYPosition:u,visibleSeries:f}=t,b=this.w,m=new T(this.barCtx.w),y=Array.isArray(this.barCtx.strokeWidth)?this.barCtx.strokeWidth[h]:this.barCtx.strokeWidth;let w,v;b.axisFlags.isXNumeric&&!b.globals.isBarHorizontal?(w=e+p*(f+1),v=s+g*(f+1)-y):(w=e+p*f,v=s+g*f);let A=null,C=null,S=e,k=s,D={};const L=b.config.dataLabels,P=this.barCtx.barOptions.dataLabels,M=this.barCtx.barOptions.dataLabels.total;void 0!==u&&this.barCtx.isRangeBar&&(v=u,k=u),void 0!==x&&this.barCtx.isVerticalGroupedRangeBar&&(w=x,S=x);const I=L.offsetX,E=L.offsetY;let F={width:0,height:0};if(b.config.dataLabels.enabled){const t=b.seriesData.series[o][r];F=m.getTextRects(b.config.dataLabels.formatter?b.config.dataLabels.formatter(t,l(n({},b),{seriesIndex:o,dataPointIndex:r,w:b})):b.formatters.yLabelFormatters[0](t),parseFloat(L.style.fontSize).toString())}const X={x:e,y:s,i:o,j:r,realIndex:h,columnGroupIndex:c,bcx:w,bcy:v,barHeight:g,barWidth:p,textRects:F,strokeWidth:y,dataLabelsX:S,dataLabelsY:k,dataLabelsConfig:L,barDataLabelsConfig:P,barTotalDataLabelsConfig:M,offX:I,offY:E};return D=this.barCtx.isHorizontal?this.calculateBarsDataLabelsPosition(X):this.calculateColumnsDataLabelsPosition(X),A=this.drawCalculatedDataLabels({x:D.dataLabelsX,y:D.dataLabelsY,val:this.barCtx.isRangeBar?[i,a]:"100%"===b.config.chart.stackType?d[h][r]:b.seriesData.series[h][r],i:h,j:r,barWidth:p,barHeight:g,textRects:F,dataLabelsConfig:L}),b.config.chart.stacked&&M.enabled&&(C=this.drawTotalDataLabels({x:D.totalDataLabelsX,y:D.totalDataLabelsY,barWidth:p,barHeight:g,realIndex:h,textAnchor:D.totalDataLabelsAnchor,val:this.getStackedTotalDataLabel({realIndex:h,j:r}),dataLabelsConfig:L,barTotalDataLabelsConfig:M})),{dataLabelsPos:D,dataLabels:A,totalDataLabels:C}}getStackedTotalDataLabel({realIndex:t,j:e}){const s=this.w;let i=this.barCtx.stackedSeriesTotals[e];return this.totalFormatter&&(i=this.totalFormatter(i,l(n({},s),{seriesIndex:t,dataPointIndex:e,w:s}))),i}calculateColumnsDataLabelsPosition(t){const e=this.w;let s,i,{i:a,j:o,realIndex:r,y:n,bcx:l,barWidth:h,barHeight:c,textRects:d,dataLabelsX:g,dataLabelsY:p,dataLabelsConfig:x,barDataLabelsConfig:u,barTotalDataLabelsConfig:f,strokeWidth:b,offX:m,offY:y}=t;const w=l;c=Math.abs(c);const v="vertical"===e.config.plotOptions.bar.dataLabels.orientation,{zeroEncounters:A}=this.barCtx.barHelpers.getZeroValueEncounters({i:a,j:o});l-=b/2;const C=e.layout.gridWidth/e.globals.dataPoints;if(this.barCtx.isVerticalGroupedRangeBar?g+=h/2:(g=e.axisFlags.isXNumeric?l-h/2+m:l-C+h/2+m,!e.config.chart.stacked&&A>0&&e.config.plotOptions.bar.hideZeroBarsWhenGrouped&&(g-=h*A)),v){const t=2;g=g+d.height/2-b/2-t}const S=e.seriesData.series[a][o]<0;let k=n;switch(this.barCtx.isReversed&&(k=n+(S?c:-c)),u.position){case"center":p=v?S?k-c/2+y:k+c/2-y:S?k-c/2+d.height/2+y:k+c/2+d.height/2-y;break;case"bottom":p=v?S?k-c+y:k+c-y:S?k-c+d.height+b+y:k+c-d.height/2+b-y;break;case"top":p=v?S?k+y:k-y:S?k-d.height/2-y:k+d.height+y}let D=k;if(e.labelData.seriesGroups.forEach(t=>{var e;null==(e=this.barCtx[t.join(",")])||e.prevY.forEach(t=>{D=S?Math.max(t[o],D):Math.min(t[o],D)})}),this.barCtx.lastActiveBarSerieIndex===r&&f.enabled){const t=18,a=new T(this.barCtx.w).getTextRects(this.getStackedTotalDataLabel({realIndex:r,j:o}),x.fontSize);s=S?D-a.height/2-y-f.offsetY+t:D+a.height+y+f.offsetY-t;const n=C;i=w+(e.axisFlags.isXNumeric?-h*e.globals.barGroups.length/2:e.globals.barGroups.length*h/2-(e.globals.barGroups.length-1)*h-n)+f.offsetX}return e.config.chart.stacked||(p<0?p=0+b:p+d.height/3>e.layout.gridHeight&&(p=e.layout.gridHeight-b)),{bcx:l,bcy:n,dataLabelsX:g,dataLabelsY:p,totalDataLabelsX:i,totalDataLabelsY:s,totalDataLabelsAnchor:"middle"}}calculateBarsDataLabelsPosition(t){const e=this.w;let{x:s,i:i,j:a,realIndex:o,bcy:r,barHeight:n,barWidth:l,textRects:h,dataLabelsX:c,strokeWidth:d,dataLabelsConfig:g,barDataLabelsConfig:p,barTotalDataLabelsConfig:x,offX:u,offY:f}=t;const b=e.layout.gridHeight/e.globals.dataPoints,{zeroEncounters:m}=this.barCtx.barHelpers.getZeroValueEncounters({i:i,j:a});l=Math.abs(l);let y,w,v=r-(this.barCtx.isRangeBar?0:b)+n/2+h.height/2+f-3;!e.config.chart.stacked&&m>0&&e.config.plotOptions.bar.hideZeroBarsWhenGrouped&&(v-=n*m);let A="start";const C=e.seriesData.series[i][a]<0;let S=s;switch(this.barCtx.isReversed&&(S=s+(C?-l:l),A=C?"start":"end"),p.position){case"center":c=C?S+l/2-u:Math.max(h.width/2,S-l/2)+u;break;case"bottom":c=C?S+l-d-u:S-l+d+u;break;case"top":c=C?S-d-u:S-d+u}let k=S;if(e.labelData.seriesGroups.forEach(t=>{var e;null==(e=this.barCtx[t.join(",")])||e.prevX.forEach(t=>{k=C?Math.min(t[a],k):Math.max(t[a],k)})}),this.barCtx.lastActiveBarSerieIndex===o&&x.enabled){const t=new T(this.barCtx.w).getTextRects(this.getStackedTotalDataLabel({realIndex:o,j:a}),g.fontSize);C?(y=k-d-u-x.offsetX,A="end"):y=k+u+x.offsetX+(this.barCtx.isReversed?-(l+d):d),w=v-h.height/2+t.height/2+x.offsetY+d,e.globals.barGroups.length>1&&(w-=e.globals.barGroups.length/2*(n/2))}return e.config.chart.stacked||("start"===g.textAnchor?c-h.width<0?c=C?h.width+d:d:c+h.width>e.layout.gridWidth&&(c=C?e.layout.gridWidth-d:e.layout.gridWidth-h.width-d):"middle"===g.textAnchor?c-h.width/2<0?c=h.width/2+d:c+h.width/2>e.layout.gridWidth&&(c=e.layout.gridWidth-h.width/2-d):"end"===g.textAnchor&&(c<1?c=h.width+d:c+1>e.layout.gridWidth&&(c=e.layout.gridWidth-h.width-d))),{bcx:s,bcy:r,dataLabelsX:c,dataLabelsY:v,totalDataLabelsX:y,totalDataLabelsY:w,totalDataLabelsAnchor:A}}drawCalculatedDataLabels({x:t,y:e,val:s,i:i,j:a,textRects:o,barHeight:r,barWidth:h,dataLabelsConfig:c}){const d=this.w;let g="rotate(0)";"vertical"===d.config.plotOptions.bar.dataLabels.orientation&&(g=`rotate(-90, ${t}, ${e})`);const p=new W(this.barCtx.w,this.barCtx.ctx),x=new T(this.barCtx.w),u=c.formatter;let f=null;const b=d.globals.collapsedSeriesIndices.indexOf(i)>-1;if(c.enabled&&!b){f=x.group({class:"apexcharts-data-labels",transform:g});let b="";void 0!==s&&(b=u(s,l(n({},d),{seriesIndex:i,dataPointIndex:a,w:d}))),!s&&d.config.plotOptions.bar.hideZeroBarsWhenGrouped&&(b="");const m=d.seriesData.series[i][a]<0,y=d.config.plotOptions.bar.dataLabels.position;if("vertical"===d.config.plotOptions.bar.dataLabels.orientation&&("top"===y&&(c.textAnchor=m?"end":"start"),"center"===y&&(c.textAnchor="middle"),"bottom"===y&&(c.textAnchor=m?"end":"start")),this.barCtx.isRangeBar&&this.barCtx.barOptions.dataLabels.hideOverflowingLabels){hMath.abs(h)&&(b=""):o.height/1.6>Math.abs(r)&&(b=""));const w=n({},c);this.barCtx.isHorizontal&&s<0&&("start"===c.textAnchor?w.textAnchor="end":"end"===c.textAnchor&&(w.textAnchor="start")),p.plotDataLabelsText({x:t,y:e,text:b,i:i,j:a,parent:f,dataLabelsConfig:w,alwaysDrawDataLabel:!0,offsetCorrection:!0})}return f}drawTotalDataLabels({x:t,y:e,val:s,realIndex:i,textAnchor:a,barTotalDataLabelsConfig:o}){const r=new T(this.barCtx.w);let n;return o.enabled&&void 0!==t&&void 0!==e&&this.barCtx.lastActiveBarSerieIndex===i&&(n=r.drawText({x:t,y:e,foreColor:o.style.color,text:s,textAnchor:a,fontFamily:o.style.fontFamily,fontSize:o.style.fontSize,fontWeight:o.style.fontWeight})),n}}let ce=class{constructor(t){this.w=t.w,this.barCtx=t}initVariables(t){const e=this.w;this.barCtx.series=t,this.barCtx.totalItems=0,this.barCtx.seriesLen=0,this.barCtx.visibleI=-1,this.barCtx.visibleItems=1;for(let s=0;s0&&(this.barCtx.seriesLen=this.barCtx.seriesLen+1,this.barCtx.totalItems+=t[s].length),e.axisFlags.isXNumeric)for(let i=0;ie.globals.minX&&e.seriesData.seriesX[s][i]t.map(t=>"none"))),0===this.barCtx.seriesLen&&(this.barCtx.seriesLen=1),this.barCtx.zeroSerieses=[],e.globals.comboCharts||this.checkZeroSeries({series:t})}initialPositions(t){const e=this.w;let s,i,a,o,r,n,l,h,c=e.globals.dataPoints;this.barCtx.isRangeBar&&(c=e.labelData.labels.length);let d=this.barCtx.seriesLen;if(e.config.plotOptions.bar.rangeBarGroupRows&&(d=1),this.barCtx.isHorizontal)a=e.layout.gridHeight/c,r=a/d,e.axisFlags.isXNumeric&&(a=e.layout.gridHeight/this.barCtx.totalItems,r=a/this.barCtx.seriesLen),r=r*parseInt(this.barCtx.barOptions.barHeight,10)/100,-1===String(this.barCtx.barOptions.barHeight).indexOf("%")&&(r=parseInt(this.barCtx.barOptions.barHeight,10)),h=this.barCtx.baseLineInvertedY+e.globals.padHorizontal+(this.barCtx.isReversed?e.layout.gridWidth:0)-(this.barCtx.isReversed?2*this.barCtx.baseLineInvertedY:0),this.barCtx.isFunnel&&(h=e.layout.gridWidth/2),i=(a-r*this.barCtx.seriesLen)/2;else{if(o=e.layout.gridWidth/this.barCtx.visibleItems,e.config.xaxis.convertedCatToNumeric&&(o=e.layout.gridWidth/e.globals.dataPoints),n=o/d*parseInt(this.barCtx.barOptions.columnWidth,10)/100,e.axisFlags.isXNumeric){const t=this.barCtx.xRatio;e.globals.minXDiff&&.5!==e.globals.minXDiff&&e.globals.minXDiff/t>0&&(o=e.globals.minXDiff/t),n=o/d*parseInt(this.barCtx.barOptions.columnWidth,10)/100,n<1&&(n=1)}if(-1===String(this.barCtx.barOptions.columnWidth).indexOf("%")&&(n=parseInt(this.barCtx.barOptions.columnWidth,10)),l=e.layout.gridHeight-this.barCtx.baseLineY[this.barCtx.translationsIndex]-(this.barCtx.isReversed?e.layout.gridHeight:0)+(this.barCtx.isReversed?2*this.barCtx.baseLineY[this.barCtx.translationsIndex]:0),e.axisFlags.isXNumeric){s=this.barCtx.getBarXForNumericXAxis({x:s,j:0,realIndex:t,barWidth:n}).x}else s=e.globals.padHorizontal+m.noExponents(o-n*this.barCtx.seriesLen)/2}return e.globals.barHeight=r,e.globals.barWidth=n,{x:s,y:i,yDivision:a,xDivision:o,barHeight:r,barWidth:n,zeroH:l,zeroW:h}}initializeStackedPrevVars(t){t.w.labelData.seriesGroups.forEach(e=>{t[e]||(t[e]={}),t[e].prevY=[],t[e].prevX=[],t[e].prevYF=[],t[e].prevXF=[],t[e].prevYVal=[],t[e].prevXVal=[]})}initializeStackedXYVars(t){t.w.labelData.seriesGroups.forEach(e=>{t[e]||(t[e]={}),t[e].xArrj=[],t[e].xArrjF=[],t[e].xArrjVal=[],t[e].yArrj=[],t[e].yArrjF=[],t[e].yArrjVal=[]})}getPathFillColor(t,e,s,i){var a,o,r,n;const l=this.w,h=new H(this.barCtx.w);let c=null;const d=this.barCtx.barOptions.distributed?s:e;let g=!1;if(this.barCtx.barOptions.colors.ranges.length>0){this.barCtx.barOptions.colors.ranges.map(i=>{t[e][s]>=i.from&&t[e][s]<=i.to&&(c=i.color,g=!0)})}return{color:h.fillPath({seriesNumber:this.barCtx.barOptions.distributed?d:i,dataPointIndex:s,color:c,value:t[e][s],fillConfig:null==(a=l.config.series[e].data[s])?void 0:a.fill,fillType:(null==(r=null==(o=l.config.series[e].data[s])?void 0:o.fill)?void 0:r.type)?null==(n=l.config.series[e].data[s])?void 0:n.fill.type:Array.isArray(l.config.fill.type)?l.config.fill.type[i]:l.config.fill.type}),useRangeColor:g}}getStrokeWidth(t,e,s){let i=0;const a=this.w;return void 0===this.barCtx.series[t][e]||null===this.barCtx.series[t][e]||"bar"===a.config.chart.type&&!this.barCtx.series[t][e]?this.barCtx.isNullValue=!0:this.barCtx.isNullValue=!1,a.config.stroke.show&&(this.barCtx.isNullValue||(i=Array.isArray(this.barCtx.strokeWidth)?this.barCtx.strokeWidth[s]:this.barCtx.strokeWidth)),i}createBorderRadiusArr(t){var e;const s=this.w,i=!this.w.config.chart.stacked||s.config.plotOptions.bar.borderRadius<=0,a=t.length,o=0|(null==(e=t[0])?void 0:e.length),r=Array.from({length:a},()=>Array(o).fill(i?"top":"none"));if(i)return r;const n=this.w.config.chart.type;for(let e=0;e0?(s.push(o),l++):a<0&&(i.push(o),l++)}if(s.length>0&&0===i.length)if(1===s.length)r[s[0]][e]="bar"===n&&1===o?"top":"both";else{const t=s[0],i=s[s.length-1];for(const a of s)r[a][e]=a===t?"bar"===n&&1===o?"top":"bottom":a===i?"top":"none"}else if(i.length>0&&0===s.length)if(1===i.length)r[i[0]][e]="both";else{const t=Math.max(...i),s=Math.min(...i);for(const a of i)r[a][e]=a===t?"bottom":a===s?"top":"none"}else if(s.length>0&&i.length>0){const t=s[s.length-1];for(const i of s)r[i][e]=i===t?"top":"none";const a=Math.max(...i);for(const t of i)r[t][e]=t===a?"bottom":"none"}else if(1===l){r[s[0]||i[0]][e]="both"}}return r}barBackground({j:t,i:e,x1:s,x2:i,y1:a,y2:o,elSeries:r}){const n=this.w,l=new T(this.barCtx.w),h=new et(this.barCtx.w).getActiveConfigSeriesIndex();if(this.barCtx.barOptions.colors.backgroundBarColors.length>0&&h===e){t>=this.barCtx.barOptions.colors.backgroundBarColors.length&&(t%=this.barCtx.barOptions.colors.backgroundBarColors.length);const e=this.barCtx.barOptions.colors.backgroundBarColors[t],h=l.drawRect(void 0!==s?s:0,void 0!==a?a:0,void 0!==i?i:n.layout.gridWidth,void 0!==o?o:n.layout.gridHeight,this.barCtx.barOptions.colors.backgroundBarRadius,e,this.barCtx.barOptions.colors.backgroundBarOpacity);r.add(h),h.node.classList.add("apexcharts-backgroundBar")}}getColumnPaths({barWidth:t,barXPosition:e,y1:s,y2:i,strokeWidth:a,isReversed:o,series:r,seriesGroup:n,realIndex:l,i:h,j:c,w:d}){var g;const p=new T(this.barCtx.w);(a=Array.isArray(a)?a[l]:a)||(a=0);let x=t,u=e;(null==(g=d.config.series[l].data[c])?void 0:g.columnWidthOffset)&&(u=e-d.config.series[l].data[c].columnWidthOffset/2,x=t+d.config.series[l].data[c].columnWidthOffset);const f=a/2,b=u+f,m=u+x-f,y=(r[h][c]>=0?1:-1)*(o?-1:1);s+=.001-f*y,i+=.001+f*y;let w=p.move(b,s),v=p.move(b,s);const A=p.line(m,s);if(d.globals.previousPaths.length>0&&(v=this.barCtx.getPreviousPath(l,c,!1)),w=w+p.line(b,i)+p.line(m,i)+A+("around"===d.config.plotOptions.bar.borderRadiusApplication||"both"===this.arrBorderRadius[l][c]?" Z":" z"),v=v+p.line(b,s)+A+A+A+A+A+p.line(b,s)+("around"===d.config.plotOptions.bar.borderRadiusApplication||"both"===this.arrBorderRadius[l][c]?" Z":" z"),"none"!==this.arrBorderRadius[l][c]&&(w=p.roundPathCorners(w,d.config.plotOptions.bar.borderRadius)),d.config.chart.stacked){let t=this.barCtx;t=this.barCtx[n],t.yArrj.push(i-f*y),t.yArrjF.push(Math.abs(s-i+a*y)),t.yArrjVal.push(this.barCtx.series[h][c])}return{pathTo:w,pathFrom:v}}getBarpaths({barYPosition:t,barHeight:e,x1:s,x2:i,strokeWidth:a,isReversed:o,series:r,seriesGroup:n,realIndex:l,i:h,j:c,w:d}){var g;const p=new T(this.barCtx.w);(a=Array.isArray(a)?a[l]:a)||(a=0);let x=t,u=e;(null==(g=d.config.series[l].data[c])?void 0:g.barHeightOffset)&&(x=t-d.config.series[l].data[c].barHeightOffset/2,u=e+d.config.series[l].data[c].barHeightOffset);const f=a/2,b=x+f,m=x+u-f,y=(r[h][c]>=0?1:-1)*(o?-1:1);s+=.001+f*y,i+=.001-f*y;let w=p.move(s,b),v=p.move(s,b);d.globals.previousPaths.length>0&&(v=this.barCtx.getPreviousPath(l,c,!1));const A=p.line(s,m);if(w=w+p.line(i,b)+p.line(i,m)+A+("around"===d.config.plotOptions.bar.borderRadiusApplication||"both"===this.arrBorderRadius[l][c]?" Z":" z"),v=v+p.line(s,b)+A+A+A+A+A+p.line(s,b)+("around"===d.config.plotOptions.bar.borderRadiusApplication||"both"===this.arrBorderRadius[l][c]?" Z":" z"),"none"!==this.arrBorderRadius[l][c]&&(w=p.roundPathCorners(w,d.config.plotOptions.bar.borderRadius)),d.config.chart.stacked){let t=this.barCtx;t=this.barCtx[n],t.xArrj.push(i+f*y),t.xArrjF.push(Math.abs(s-i-a*y)),t.xArrjVal.push(this.barCtx.series[h][c])}return{pathTo:w,pathFrom:v}}checkZeroSeries({series:t}){const e=this.w;for(let s=0;s{h.push({[t]:"x"===t?this.getXForValue(i,e,!1):this.getYForValue(i,s,o,!1),attrs:a})};if(r.seriesData.seriesGoals[i]&&r.seriesData.seriesGoals[i][a]&&Array.isArray(r.seriesData.seriesGoals[i][a])&&r.seriesData.seriesGoals[i][a].forEach(t=>{c(t.value,t)}),this.barCtx.barOptions.isDumbbell&&r.rangeData.seriesRange.length){const e=this.barCtx.barOptions.dumbbellColors?this.barCtx.barOptions.dumbbellColors:r.globals.colors,s={strokeHeight:"x"===t?0:r.globals.markers.size[i],strokeWidth:"x"===t?r.globals.markers.size[i]:0,strokeDashArray:0,strokeLineCap:"round",strokeColor:Array.isArray(e[i])?e[i][0]:e[i]};c(r.rangeData.seriesRangeStart[i][a],s),c(r.rangeData.seriesRangeEnd[i][a],l(n({},s),{strokeColor:Array.isArray(e[i])?e[i][1]:e[i]}))}return h}drawGoalLine({barXPosition:t,barYPosition:e,goalX:s,goalY:i,barWidth:a,barHeight:o}){const r=new T(this.barCtx.w),n=r.group({className:"apexcharts-bar-goals-groups"});n.node.classList.add("apexcharts-element-hidden"),this.barCtx.w.globals.delayedElements.push({el:n.node}),n.attr("clip-path",`url(#gridRectMarkerMask${this.barCtx.w.globals.cuid})`);let l=null;return this.barCtx.isHorizontal?Array.isArray(s)&&s.forEach(t=>{if(t.x>=-1&&t.x<=r.w.layout.gridWidth+1){const s=void 0!==t.attrs.strokeHeight?t.attrs.strokeHeight:o/2,i=e+s+o/2;l=r.drawLine(t.x,i-2*s,t.x,i,t.attrs.strokeColor?t.attrs.strokeColor:void 0,t.attrs.strokeDashArray,t.attrs.strokeWidth?t.attrs.strokeWidth:2,t.attrs.strokeLineCap),n.add(l)}}):Array.isArray(i)&&i.forEach(e=>{if(e.y>=-1&&e.y<=r.w.layout.gridHeight+1){const s=void 0!==e.attrs.strokeWidth?e.attrs.strokeWidth:a/2,i=t+s+a/2;l=r.drawLine(i-2*s,e.y,i,e.y,e.attrs.strokeColor?e.attrs.strokeColor:void 0,e.attrs.strokeDashArray,e.attrs.strokeHeight?e.attrs.strokeHeight:2,e.attrs.strokeLineCap),n.add(l)}}),n}drawBarShadow({prevPaths:t,currPaths:e,color:s,realIndex:i,j:a}){const o=this.w,{x:r,x1:n,barYPosition:l}=t,{x:h,x1:c,barYPosition:d}=e,g=l+e.barHeight,p=new T(this.barCtx.w),x=new m,u=p.move(n,g)+p.line(r,g)+p.line(h,d)+p.line(c,d)+p.line(n,g)+("around"===o.config.plotOptions.bar.borderRadiusApplication||"both"===this.arrBorderRadius[i][a]?" Z":" z");return p.drawPath({d:u,fill:x.shadeColor(.5,m.rgb2hex(s)),stroke:"none",strokeWidth:0,fillOpacity:1,classes:"apexcharts-bar-shadow apexcharts-decoration-element"})}getZeroValueEncounters({i:t,j:e}){var s;const i=this.w;let a=0,o=0;return(i.config.plotOptions.bar.horizontal?i.seriesData.series.map((t,e)=>e):(null==(s=i.globals.columnSeries)?void 0:s.i.map(t=>t))||[]).forEach(s=>{const r=i.globals.seriesPercent[s][e];r&&a++,ss.indexOf(e.seriesData.seriesNames[t])>-1),i=this.barCtx.columnGroupIndices;let a=i.indexOf(s);return a<0&&(i.push(s),a=i.length-1),{groupIndex:s,columnGroupIndex:a}}};class de{constructor(t,e,s){this.ctx=e,this.w=t,this.barOptions=t.config.plotOptions.bar,this.isHorizontal=this.barOptions.horizontal,this.strokeWidth=t.config.stroke.width,this.isNullValue=!1,this.isRangeBar=t.rangeData.seriesRange.length&&this.isHorizontal,this.isVerticalGroupedRangeBar=!t.globals.isBarHorizontal&&t.rangeData.seriesRange.length&&t.config.plotOptions.bar.rangeBarGroupRows,this.isFunnel=this.barOptions.isFunnel,this.xyRatios=s,this.xRatio=0,this.yRatio=[],this.invertedXRatio=0,this.invertedYRatio=0,this.baseLineY=[],this.baseLineInvertedY=0,null!==this.xyRatios&&(this.xRatio=s.xRatio,this.yRatio=s.yRatio,this.invertedXRatio=s.invertedXRatio,this.invertedYRatio=s.invertedYRatio,this.baseLineY=s.baseLineY,this.baseLineInvertedY=s.baseLineInvertedY),this.yaxisIndex=0,this.translationsIndex=0,this.seriesLen=0,this.pathArr=[],this.series=[],this.elSeries=null,this.visibleI=0,this.isReversed=!1;const i=new et(this.w);this.lastActiveBarSerieIndex=i.getActiveConfigSeriesIndex("desc",["bar","column"]),this.columnGroupIndices=[];const a=i.getBarSeriesIndices(),o=new E(this.w);this.stackedSeriesTotals=o.getStackedSeriesTotals(this.w.config.series.map((t,e)=>-1===a.indexOf(e)?e:-1).filter(t=>-1!==t)),this.barHelpers=new ce(this)}draw(t,e){var s;const i=this.w,a=new T(this.w),o=new E(this.w);t=o.getLogSeries(t),this.series=t,this.yRatio=o.getLogYRatios(this.yRatio),this.barHelpers.initVariables(t);const r=a.group({class:"apexcharts-bar-series apexcharts-plot-series"});i.config.dataLabels.enabled&&(this.totalItems,this.barOptions.dataLabels.maxItems);for(let o=0,h=0;o0&&(this.visibleI=this.visibleI+1),this.yRatio.length>1&&(this.yaxisIndex=i.globals.seriesYAxisReverseMap[x],this.translationsIndex=x);const b=this.translationsIndex;this.isReversed=i.config.yaxis[this.yaxisIndex]&&i.config.yaxis[this.yaxisIndex].reversed;const y=this.barHelpers.initialPositions(x),{y:w,yDivision:v,zeroW:A,x:C,xDivision:S,zeroH:k}=y;let D=y.barHeight,L=y.barWidth;d=w,c=C,this.isHorizontal||p.push(c+(null!=L?L:0)/2);const P=a.group({class:"apexcharts-datalabels","data:realIndex":x});i.globals.delayedElements.push({el:P.node}),P.node.classList.add("apexcharts-element-hidden");const M=a.group({class:"apexcharts-bar-goals-markers"}),I=a.group({class:"apexcharts-bar-shadows"});i.globals.delayedElements.push({el:I.node}),I.node.classList.add("apexcharts-element-hidden");for(let e=0;e0){const t=this.barHelpers.drawBarShadow({color:"string"==typeof w.color&&-1===(null==(s=w.color)?void 0:s.indexOf("url"))?w.color:m.hexToRgba(i.globals.colors[o]),prevPaths:this.pathArr[this.pathArr.length-1],currPaths:r,realIndex:x,j:e});if(I.add(t),i.config.chart.dropShadow.enabled){new X(this.w).dropShadow(t,i.config.chart.dropShadow,x)}}this.pathArr.push(r);const C=this.barHelpers.drawGoalLine({barXPosition:r.barXPosition,barYPosition:r.barYPosition,goalX:r.goalX,goalY:r.goalY,barHeight:D,barWidth:L});C&&M.add(C),d=r.y,c=r.x,e>0&&p.push(c+(null!=L?L:0)/2),g.push(d),this.renderSeries(l(n({realIndex:x,pathFill:w.color},w.useRangeColor?{lineFill:w.color}:{}),{j:e,i:o,columnGroupIndex:u,pathFrom:r.pathFrom,pathTo:r.pathTo,strokeWidth:a,elSeries:f,x:c,y:d,series:t,barHeight:Math.abs(r.barHeight?r.barHeight:D),barWidth:Math.abs(r.barWidth?r.barWidth:L),elDataLabelsWrap:P,elGoalsMarkers:M,elBarShadows:I,visibleSeries:this.visibleI,type:"bar"}))}i.globals.seriesXvalues[x]=p,i.globals.seriesYvalues[x]=g,r.add(f)}return r}renderSeries({realIndex:t,pathFill:e,lineFill:s,j:i,i:a,columnGroupIndex:o,pathFrom:r,pathTo:n,strokeWidth:l,elSeries:h,x:c,y:d,y1:g,y2:p,series:x,barHeight:u,barWidth:f,barXPosition:b,barYPosition:m,elDataLabelsWrap:y,elGoalsMarkers:w,elBarShadows:v,visibleSeries:A,type:C,classes:S}){const k=this.w,D=new T(this.w,this.ctx);let L=!1;if(h._bindingsDelegated||(h._bindingsDelegated=!0,D.setupEventDelegation(h,`.apexcharts-${C}-area`)),!s){let e=function(t){const e=k.config.stroke.colors;let s;return Array.isArray(e)&&e.length>0&&(s=e[t],s||(s=""),"function"==typeof s)?s({value:k.seriesData.series[t][i],dataPointIndex:i,w:k}):s};const a="function"==typeof k.globals.stroke.colors[t]?e(t):k.globals.stroke.colors[t];s=this.barOptions.distributed?k.globals.stroke.colors[i]:a}const P=new he(this).handleBarDataLabels({x:c,y:d,y1:g,y2:p,i:a,j:i,series:x,realIndex:t,columnGroupIndex:o,barHeight:u,barWidth:f,barXPosition:b,barYPosition:m,visibleSeries:A});k.globals.isBarHorizontal||(P.dataLabelsPos.dataLabelsX+Math.max(f,k.globals.barPadForNumericAxis)<0||P.dataLabelsPos.dataLabelsX-Math.max(f,k.globals.barPadForNumericAxis)>k.layout.gridWidth)&&(L=!0),k.config.series[a].data[i]&&k.config.series[a].data[i].strokeColor&&(s=k.config.series[a].data[i].strokeColor),this.isNullValue&&(e="none");const M=i/k.config.chart.animations.animateGradually.delay*(k.config.chart.animations.speed/k.globals.dataPoints)/2.4;if(!L){const o=D.renderPaths({i:a,j:i,realIndex:t,pathFrom:r,pathTo:n,stroke:s,strokeWidth:l,strokeLineCap:k.config.stroke.lineCap,fill:e,animationDelay:M,initialSpeed:k.config.chart.animations.speed,dataChangeSpeed:k.config.chart.animations.dynamicAnimation.speed,className:`apexcharts-${C}-area ${S}`,chartType:C,bindEventsOnPaths:!1});o.attr("clip-path",`url(#gridRectBarMask${k.globals.cuid})`);const c=k.config.forecastDataPoints;c.count>0&&i>=k.globals.dataPoints-c.count&&(o.node.setAttribute("stroke-dasharray",c.dashArray),o.node.setAttribute("stroke-width",c.strokeWidth),o.node.setAttribute("fill-opacity",c.fillOpacity)),void 0!==g&&void 0!==p&&(o.attr("data-range-y1",g),o.attr("data-range-y2",p));new X(this.w).setSelectionFilter(o,t,i),h.add(o),o.attr({cy:P.dataLabelsPos.bcy,cx:P.dataLabelsPos.bcx,j:i,val:k.seriesData.series[a][i],barHeight:u,barWidth:f}),null!==P.dataLabels&&y.add(P.dataLabels),P.totalDataLabels&&y.add(P.totalDataLabels),h.add(y),w&&h.add(w),v&&h.add(v)}return h}drawBarPaths({indexes:t,barHeight:e,strokeWidth:s,zeroW:i,x:a,y:o,yDivision:r,elSeries:n}){const l=this.w,h=t.i,c=t.j;let d;if(l.axisFlags.isXNumeric)d=(o=(l.seriesData.seriesX[h][c]-l.globals.minX)/this.invertedXRatio-e)+e*this.visibleI;else if(l.config.plotOptions.bar.hideZeroBarsWhenGrouped){const{nonZeroColumns:t,zeroEncounters:s}=this.barHelpers.getZeroValueEncounters({i:h,j:c});t>0&&(e=this.seriesLen*e/t),d=o+e*this.visibleI,d-=e*s}else d=o+e*this.visibleI;if(this.isFunnel){const t=null!=i?i:0;i=t-(this.barHelpers.getXForValue(this.series[h][c],t)-t)/2}a=this.barHelpers.getXForValue(this.series[h][c],null!=i?i:0);const g=this.barHelpers.getBarpaths({barYPosition:d,barHeight:e,x1:i,x2:a,strokeWidth:s,isReversed:this.isReversed,series:this.series,realIndex:t.realIndex,i:h,j:c,w:l});return l.axisFlags.isXNumeric||(o+=r),this.barHelpers.barBackground({j:c,i:h,y1:d-e*this.visibleI,y2:e*this.seriesLen,elSeries:n}),{pathTo:g.pathTo,pathFrom:g.pathFrom,x1:i,x:a,y:o,goalX:this.barHelpers.getGoalValues("x",i,null,h,c,0),barYPosition:d,barHeight:e}}drawColumnPaths({indexes:t,x:e,y:s,xDivision:i,barWidth:a,zeroH:o,strokeWidth:r,elSeries:n}){const l=this.w,h=t.realIndex,c=t.translationsIndex,d=t.i,g=t.j,p=t.bc;let x;if(l.axisFlags.isXNumeric){const t=this.getBarXForNumericXAxis({x:e,j:g,realIndex:h,barWidth:a});e=t.x,x=t.barXPosition}else if(l.config.plotOptions.bar.hideZeroBarsWhenGrouped){const{nonZeroColumns:t,zeroEncounters:s}=this.barHelpers.getZeroValueEncounters({i:d,j:g});t>0&&(a=this.seriesLen*a/t),x=e+a*this.visibleI,x-=a*s}else x=e+a*this.visibleI;s=this.barHelpers.getYForValue(this.series[d][g],o,c);const u=this.barHelpers.getColumnPaths({barXPosition:x,barWidth:a,y1:o,y2:s,strokeWidth:r,isReversed:this.isReversed,series:this.series,realIndex:h,i:d,j:g,w:l});return l.axisFlags.isXNumeric||(e+=i),this.barHelpers.barBackground({bc:p,j:g,i:d,x1:x-r/2-a*this.visibleI,x2:a*this.seriesLen+r/2,elSeries:n}),{pathTo:u.pathTo,pathFrom:u.pathFrom,x:e,y:s,goalY:this.barHelpers.getGoalValues("y",null,o,d,g,c),barXPosition:x,barWidth:a}}getBarXForNumericXAxis({x:t,barWidth:e,realIndex:s,j:i}){const a=this.w;let o=s;return a.seriesData.seriesX[s].length||(o=a.globals.maxValsInArrayIndex),m.isNumber(a.seriesData.seriesX[o][i])&&(t=(a.seriesData.seriesX[o][i]-a.globals.minX)/this.xRatio-e*this.seriesLen/2),{barXPosition:t+e*this.visibleI,x:t}}getPreviousPath(t,e){const s=this.w;let i="M 0 0";for(let a=0;a0&&parseInt(o.realIndex,10)===parseInt(String(t),10)&&void 0!==s.globals.previousPaths[a].paths[e]&&(i=s.globals.previousPaths[a].paths[e].d)}return i}}class ge extends de{draw(t,e,s){const i=this.w,a=new T(this.w),o=i.globals.comboCharts?e:i.config.chart.type,r=new H(this.w);this.candlestickOptions=this.w.config.plotOptions.candlestick,this.boxOptions=this.w.config.plotOptions.boxPlot,this.isHorizontal=i.config.plotOptions.bar.horizontal,this.isOHLC=this.candlestickOptions&&"ohlc"===this.candlestickOptions.type,this.coreUtils=new E(this.w),t=this.coreUtils.getLogSeries(t),this.series=t,this.yRatio=this.coreUtils.getLogYRatios(this.yRatio),this.barHelpers.initVariables(t);const h=a.group({class:`apexcharts-${o}-series apexcharts-plot-series`});for(let e=0;e0&&(this.visibleI=this.visibleI+1);let f=0;this.yRatio.length>1&&(this.yaxisIndex=i.globals.seriesYAxisReverseMap[p][0],f=p);const b=this.barHelpers.initialPositions(p),{y:y,barHeight:w,yDivision:v,zeroW:A,x:C,barWidth:S,xDivision:k,zeroH:D}=b;c=y,o=C,g.push(o+(null!=S?S:0)/2);const L=a.group({class:"apexcharts-datalabels","data:realIndex":p}),P=a.group({class:"apexcharts-bar-goals-markers"});for(let s=0;s0&&g.push(o+(null!=S?S:0)/2),d.push(c),h.pathTo.forEach((n,l)=>{const d=!this.isBoxPlot&&this.candlestickOptions.wick.useFillColor?h.color[l]:i.globals.stroke.colors[e],g=r.fillPath({seriesNumber:p,dataPointIndex:s,color:h.color[l],value:t[e][s]});this.renderSeries({realIndex:p,pathFill:g,lineFill:d,j:s,i:e,pathFrom:h.pathFrom,pathTo:n,strokeWidth:a,elSeries:u,x:o,y:c,series:t,columnGroupIndex:x,barHeight:w,barWidth:S,elDataLabelsWrap:L,elGoalsMarkers:P,visibleSeries:this.visibleI,type:i.config.chart.type})})}i.globals.seriesXvalues[p]=g,i.globals.seriesYvalues[p]=d,h.add(u)}return h}drawVerticalBoxPaths({indexes:t,x:e,xDivision:s,barWidth:i,zeroH:a,strokeWidth:o}){var r,n;const l=this.w,h=new T(this.w),c=t.i,d=t.j,{colors:g}=l.config.plotOptions.candlestick,{colors:p}=this.boxOptions,x=t.realIndex,u=t=>Array.isArray(t)?t[x]:t,f=u(g.upward),b=u(g.downward),m=this.yRatio[t.translationsIndex],y=this.getOHLCValue(x,d);let w=a,v=a,A=y.o0&&(P=this.getPreviousPath(x,d)),this.isOHLC){const t=D+i/2,e=a-y.o/m,s=a-y.c/m;L=[h.move(t,w)+h.line(t,v)+h.move(t,e)+h.line(D,e)+h.move(t,s)+h.line(D+i,s)]}else L=this.isBoxPlot?[h.move(D,C)+h.line(D+i/2,C)+h.line(D+i/2,w)+h.line(D+i/4,w)+h.line(D+i-i/4,w)+h.line(D+i/2,w)+h.line(D+i/2,C)+h.line(D+i,C)+h.line(D+i,k)+h.line(D,k)+h.line(D,C+o/2),h.move(D,k)+h.line(D+i,k)+h.line(D+i,S)+h.line(D+i/2,S)+h.line(D+i/2,v)+h.line(D+i-i/4,v)+h.line(D+i/4,v)+h.line(D+i/2,v)+h.line(D+i/2,S)+h.line(D,S)+h.line(D,k)+"z"]:[h.move(D,S)+h.line(D+i/2,S)+h.line(D+i/2,w)+h.line(D+i/2,S)+h.line(D+i,S)+h.line(D+i,C)+h.line(D+i/2,C)+h.line(D+i/2,v)+h.line(D+i/2,C)+h.line(D,C)+h.line(D,S-o/2)];return P+=h.move(D,C),l.axisFlags.isXNumeric||(e+=s),{pathTo:L,pathFrom:P,x:e,y:S,goalY:this.barHelpers.getGoalValues("y",null,a,c,d,t.translationsIndex),barXPosition:D,color:A}}drawHorizontalBoxPaths({indexes:t,y:e,yDivision:s,barHeight:i,zeroW:a,strokeWidth:o}){var r,n;const l=this.w,h=new T(this.w),c=t.i,d=t.j,g=t.realIndex,{colors:p}=l.config.plotOptions.candlestick,{colors:x}=this.boxOptions,u=t=>Array.isArray(t)?t[g]:t,f=this.invertedYRatio,b=this.getOHLCValue(g,d);let m=b.o0&&(k=this.getPreviousPath(g,d));const D=[h.move(v,S)+h.line(v,S+i/2)+h.line(y,S+i/2)+h.line(y,S+i/2-i/4)+h.line(y,S+i/2+i/4)+h.line(y,S+i/2)+h.line(v,S+i/2)+h.line(v,S+i)+h.line(C,S+i)+h.line(C,S)+h.line(v+o/2,S),h.move(C,S)+h.line(C,S+i)+h.line(A,S+i)+h.line(A,S+i/2)+h.line(w,S+i/2)+h.line(w,S+i-i/4)+h.line(w,S+i/4)+h.line(w,S+i/2)+h.line(A,S+i/2)+h.line(A,S)+h.line(C,S)+"z"];return k+=h.move(v,S),l.axisFlags.isXNumeric||(e+=s),{pathTo:D,pathFrom:k,x:A,y:e,goalX:this.barHelpers.getGoalValues("x",a,null,c,d,0),barYPosition:S,color:m}}getOHLCValue(t,e){const s=this.w,i=this.coreUtils,a=s=>s[t]&&null!=s[t][e]?i.getLogValAtSeriesIndex(s[t][e],t):0,o=a(s.candleData.seriesCandleH),r=a(s.candleData.seriesCandleO),n=a(s.candleData.seriesCandleM),l=a(s.candleData.seriesCandleC),h=a(s.candleData.seriesCandleL);return{o:this.isBoxPlot?o:r,h:this.isBoxPlot?r:o,m:n,l:this.isBoxPlot?l:h,c:this.isBoxPlot?h:l}}}class pe{constructor(t,e){this.ctx=e,this.w=t}checkColorRange(){const t=this.w;let e=!1;const s=t.config.plotOptions[t.config.chart.type];return s.colorScale.ranges.length>0&&s.colorScale.ranges.map(t=>{t.from<=0&&(e=!0)}),e}getShadeColor(t,e,s,i){const a=this.w;let o=1;const r=a.config.plotOptions[t].shadeIntensity,n=this.determineColor(t,e,s);a.globals.hasNegs||i?o=a.config.plotOptions[t].reverseNegativeShade?n.percent<0?n.percent/100*(1.25*r):(1-n.percent/100)*(1.25*r):n.percent<=0?1-(1+n.percent/100)*r:(1-n.percent/100)*r:(o=1-n.percent/100,"treemap"===t&&(o=(1-n.percent/100)*(1.25*r)));let l=n.color;const h=new m;if(a.config.plotOptions[t].enableShades)if("dark"===this.w.config.theme.mode){const t=h.shadeColor(-1*o,n.color);l=m.hexToRgba(m.isColorHex(t)?t:m.rgb2hex(t),a.config.fill.opacity)}else{const t=h.shadeColor(o,n.color);l=m.hexToRgba(m.isColorHex(t)?t:m.rgb2hex(t),a.config.fill.opacity)}return{color:l,colorProps:n}}determineColor(t,e,s){const i=this.w,a=i.seriesData.series[e][s],o=i.config.plotOptions[t];let r=o.colorScale.inverse?s:e;o.distributed&&"treemap"===i.config.chart.type&&(r=s);let n=i.globals.colors[r],l=null,h=Math.min(...i.seriesData.series[e]),c=Math.max(...i.seriesData.series[e]);o.distributed||"heatmap"!==t||(h=i.globals.minY,c=i.globals.maxY),void 0!==o.colorScale.min&&(h=o.colorScale.mini.globals.maxY?o.colorScale.max:i.globals.maxY);const d=Math.abs(c)+Math.abs(h);let g=100*a/(0===d?d-1e-6:d);if(o.colorScale.ranges.length>0){o.colorScale.ranges.map(t=>{if(a>=t.from&&a<=t.to){n=t.color,l=t.foreColor?t.foreColor:null,h=t.from,c=t.to;const e=Math.abs(c)+Math.abs(h);g=100*a/(0===e?e-1e-6:e)}})}return{color:n,foreColor:l,percent:g}}calculateDataLabels({text:t,x:e,y:s,i:i,j:a,colorProps:o,fontSize:r}){const n=this.w.config.dataLabels,l=new T(this.w),h=new W(this.w,this.ctx);let c=null;if(n.enabled){c=l.group({class:"apexcharts-data-labels"});const d=n.offsetX,g=n.offsetY,p=e+d,x=s+parseFloat(n.style.fontSize)/3+g;h.plotDataLabelsText({x:p,y:x,text:t,i:i,j:a,color:o.foreColor,parent:c,fontSize:r,dataLabelsConfig:n})}return c}}class xe{constructor(t){this.w=t.w,this.lineCtx=t}sameValueSeriesFix(t,e){const s=this.w;if("gradient"===s.config.fill.type||"gradient"===s.config.fill.type[t]){if(new E(this.lineCtx.w).seriesHaveSameValues(t)){const s=e[t].slice();s[s.length-1]=s[s.length-1]+1e-6,e[t]=s}}return e}calculatePoints({series:t,realIndex:e,x:s,y:i,i:a,j:o,prevY:r}){const n=this.w,l=[],h=[];let c=this.lineCtx.categoryAxisCorrection+n.config.markers.offsetX;return n.axisFlags.isXNumeric&&(c=(n.seriesData.seriesX[e][0]-n.globals.minX)/this.lineCtx.xRatio+n.config.markers.offsetX),0===o&&(l.push(c),h.push(m.isNumber(t[a][0])?r+n.config.markers.offsetY:null)),l.push(s+n.config.markers.offsetX),h.push(m.isNumber(t[a][o+1])?i+n.config.markers.offsetY:null),{x:l,y:h}}checkPreviousPaths({pathFromLine:t,pathFromArea:e,realIndex:s}){const i=this.w;for(let a=0;a0&&parseInt(o.realIndex,10)===parseInt(s,10)&&("line"===o.type?(this.lineCtx.appendPathFrom=!1,t=i.globals.previousPaths[a].paths[0].d):"area"===o.type&&(this.lineCtx.appendPathFrom=!1,e=i.globals.previousPaths[a].paths[0].d,i.config.stroke.show&&i.globals.previousPaths[a].paths[1]&&(t=i.globals.previousPaths[a].paths[1].d)))}return{pathFromLine:t,pathFromArea:e}}determineFirstPrevY({i:t,realIndex:e,series:s,prevY:i,lineYPosition:a,translationsIndex:o}){var r,n,l;const h=this.w,c=h.config.chart.stacked&&!h.globals.comboCharts||h.config.chart.stacked&&h.globals.comboCharts&&(!this.w.config.chart.stackOnlyBar||"bar"===(null==(r=this.w.config.series[e])?void 0:r.type)||"column"===(null==(n=this.w.config.series[e])?void 0:n.type));if(void 0!==(null==(l=s[t])?void 0:l[0]))i=(a=c&&t>0?this.lineCtx.prevSeriesY[t-1][0]:this.lineCtx.zeroY)-s[t][0]/this.lineCtx.yRatio[o]+2*(this.lineCtx.isReversed?s[t][0]/this.lineCtx.yRatio[o]:0);else if(c&&t>0&&void 0===s[t][0])for(let e=t-1;e>=0;e--)if(null!==s[e][0]&&void 0!==s[e][0]){i=a=this.lineCtx.prevSeriesY[e][0];break}return{prevY:i,lineYPosition:a}}}const ue=t=>{const e=function(t){const e=[];let s=t[0],i=t[1],a=e[0]=be(s,i),o=1;for(let r=t.length-1;o9&&(n=3*r/Math.sqrt(n),e[i]=n*a,e[i+1]=n*o));for(let a=0;a<=s;a++)n=(t[Math.min(s,a+1)][0]-t[Math.max(0,a-1)][0])/(6*(1+e[a]*e[a])),i.push([n||0,e[a]*n||0]);return i},fe={points(t){const e=ue(t),s=t[1],i=t[0],a=[],o=e[1],r=e[0];a.push(i,[i[0]+r[0],i[1]+r[1],s[0]-o[0],s[1]-o[1],s[0],s[1]]);for(let s=2,i=e.length;s1&&i[1].length<6){const t=i[0].length;i[1]=[2*i[0][t-2]-i[0][t-4],2*i[0][t-1]-i[0][t-3]].concat(i[1])}i[0]=i[0].slice(-2)}return i}};function be(t,e){return(e[1]-t[1])/(e[0]-t[0])}class me{constructor(t,e,s,i){this.ctx=e,this.w=t,this.xyRatios=s,this.xRatio=0,this.yRatio=[],this.zRatio=0,this.baseLineY=[],this.pointsChart=!("bubble"!==this.w.config.chart.type&&"scatter"!==this.w.config.chart.type)||i,this.scatter=new O(this.w,this.ctx),this.noNegatives=this.w.globals.minX===Number.MAX_VALUE,this.lineHelpers=new xe(this),this.markers=new N(this.w,this.ctx),this.prevSeriesY=[],this.categoryAxisCorrection=0,this.yaxisIndex=0,this.xDivision=0,this.zeroY=0,this.areaBottomY=0,this.strokeWidth=0,this.isReversed=!1,this.appendPathFrom=!1,this.elSeries=null,this.elPointsMain=null,this.elDataLabelsWrap=null}draw(t,e,s,i){var a;const o=this.w,r=new T(this.w),h=o.globals.comboCharts?e:o.config.chart.type,c=r.group({class:`apexcharts-${h}-series apexcharts-plot-series`}),d=new E(this.w);this.yRatio=this.xyRatios.yRatio,this.zRatio=this.xyRatios.zRatio,this.xRatio=this.xyRatios.xRatio,this.baseLineY=this.xyRatios.baseLineY,t=d.getLogSeries(t),this.yRatio=d.getLogYRatios(this.yRatio),this.prevSeriesY=[];const g=[];for(let e=0;e1?a:0;this._initSerieVariables(t,e,a);const c=[],d=[],p=[];let x=o.globals.padHorizontal+this.categoryAxisCorrection;const u=1,f=[],b=[];et.addCollapsedClassToSeries(this.w,this.elSeries,a),o.axisFlags.isXNumeric&&o.seriesData.seriesX.length>0&&(x=(o.seriesData.seriesX[a][0]-o.globals.minX)/this.xRatio),p.push(x);const m=x;let y;const w=m;let v=this.zeroY,A=this.zeroY;const C=0;v=this.lineHelpers.determineFirstPrevY({i:e,realIndex:a,series:t,prevY:v,lineYPosition:C,translationsIndex:r}).prevY,"monotoneCubic"===o.config.stroke.curve&&null===t[e][0]?c.push(null):c.push(v);const S=v;let k;"rangeArea"===h&&(k=this.lineHelpers.determineFirstPrevY({i:e,realIndex:a,series:i,prevY:A,lineYPosition:C,translationsIndex:r}),A=k.prevY,y=A,d.push(null!==c[0]?A:null));const D=this._calculatePathsFrom({type:h,series:t,i:e,realIndex:a,translationsIndex:r,prevX:w,prevY:v,prevY2:A}),L=[c[0]],P=[d[0]],M={type:h,series:t,realIndex:a,translationsIndex:r,i:e,x:x,y:u,pX:m,pY:S,pathsFrom:D,linePaths:f,areaPaths:b,seriesIndex:s,lineYPosition:C,xArrj:p,yArrj:c,y2Arrj:d,seriesRangeEnd:i},I=this._iterateOverDataPoints(l(n({},M),{iterations:"rangeArea"===h?t[e].length-1:void 0,isRangeStart:!0}));if("rangeArea"===h){const t=this._calculatePathsFrom({series:i,i:e,realIndex:a,prevX:w,prevY:A}),s=this._iterateOverDataPoints(l(n({},M),{series:i,xArrj:[x],yArrj:L,y2Arrj:P,pY:y,areaPaths:I.areaPaths,pathsFrom:t,iterations:i[e].length-1,isRangeStart:!1})),o=I.linePaths.length/2;for(let t=0;tNumber(t.node.getAttribute("zIndex"))-Number(e.node.getAttribute("zIndex"))),o.config.chart.stacked)for(let t=g.length-1;t>=0;t--)c.add(g[t]);else for(let t=0;t1&&(this.yaxisIndex=i.globals.seriesYAxisReverseMap[s],o=s),this.isReversed=i.config.yaxis[this.yaxisIndex]&&i.config.yaxis[this.yaxisIndex].reversed,this.zeroY=i.layout.gridHeight-this.baseLineY[o]-(this.isReversed?i.layout.gridHeight:0)+(this.isReversed?2*this.baseLineY[o]:0),this.areaBottomY=this.zeroY,(this.zeroY>i.layout.gridHeight||"end"===i.config.plotOptions.area.fillTo)&&(this.areaBottomY=i.layout.gridHeight),this.categoryAxisCorrection=this.xDivision/2;const r=i.config.series[s];if(this.elSeries=a.group({class:"apexcharts-series",zIndex:void 0!==r.zIndex?r.zIndex:s,seriesName:m.escapeString(i.seriesData.seriesNames[s])}),this.elPointsMain=a.group({class:"apexcharts-series-markers-wrap","data:realIndex":s}),i.globals.hasNullValues){const t=this.markers.plotChartMarkers({pointsPos:{x:[0],y:[i.layout.gridHeight+i.globals.markers.largestSize]},seriesIndex:e,j:0,pSize:.1,alwaysDrawMarker:!0,isVirtualPoint:!0});null!==t&&this.elPointsMain.add(t)}this.elDataLabelsWrap=a.group({class:"apexcharts-datalabels","data:realIndex":s});const n=t[e].length===i.globals.dataPoints;this.elSeries.attr({"data:longestSeries":n,rel:e+1,"data:realIndex":s}),this.appendPathFrom=!0}_calculatePathsFrom({type:t,series:e,i:s,realIndex:i,translationsIndex:a,prevX:o,prevY:r,prevY2:n}){const l=this.w,h=new T(this.w);let c,d,g,p;if(null===e[s][0]){for(let t=0;t0){const t=this.lineHelpers.checkPreviousPaths({pathFromLine:g,pathFromArea:p,realIndex:i});g=t.pathFromLine,p=t.pathFromArea}return{prevX:o,prevY:r,linePath:c,areaPath:d,pathFromLine:g,pathFromArea:p}}_handlePaths({type:t,realIndex:e,i:s,paths:i}){const a=this.w,o=new T(this.w),r=new H(this.w);this.prevSeriesY.push(i.yArrj),a.globals.seriesXvalues[e]=i.xArrj,a.globals.seriesYvalues[e]=i.yArrj;const h=a.config.forecastDataPoints;if(h.count>0&&"rangeArea"!==t){const t=a.globals.seriesXvalues[e][a.globals.seriesXvalues[e].length-h.count-1],s=o.drawRect(t,0,a.layout.gridWidth,a.layout.gridHeight,0);a.dom.elForecastMask.appendChild(s.node);const i=o.drawRect(0,0,t,a.layout.gridHeight,0);a.dom.elNonForecastMask.appendChild(i.node)}this.pointsChart||a.globals.delayedElements.push({el:this.elPointsMain.node,index:e});const c={i:s,realIndex:e,animationDelay:s,initialSpeed:a.config.chart.animations.speed,dataChangeSpeed:a.config.chart.animations.dynamicAnimation.speed,className:`apexcharts-${t}`};if("area"===t){const t=r.fillPath({seriesNumber:e});for(let e=0;e0&&"rangeArea"!==t){const t=o.renderPaths(p);t.node.setAttribute("stroke-dasharray",h.dashArray),h.strokeWidth&&t.node.setAttribute("stroke-width",h.strokeWidth),this.elSeries.add(t),t.attr("clip-path",`url(#forecastMask${a.globals.cuid})`),x.attr("clip-path",`url(#nonForecastMask${a.globals.cuid})`)}}}}_iterateOverDataPoints({type:t,series:e,iterations:s,realIndex:i,translationsIndex:a,i:o,x:r,y:n,pX:l,pY:h,pathsFrom:c,linePaths:d,areaPaths:g,seriesIndex:p,lineYPosition:x,xArrj:u,yArrj:f,y2Arrj:b,isRangeStart:y,seriesRangeEnd:w}){var v,A;const C=this.w,S=new T(this.w),k=this.yRatio;let{prevY:D,linePath:L,areaPath:P,pathFromLine:M,pathFromArea:I}=c;const E=m.isNumber(C.globals.minYArr[i])?C.globals.minYArr[i]:C.globals.minY;s||(s=C.globals.dataPoints>1?C.globals.dataPoints-1:C.globals.dataPoints);const F=(t,e)=>e-t/k[a]+2*(this.isReversed?t/k[a]:0);let X=n;const z=C.config.chart.stacked&&!C.globals.comboCharts||C.config.chart.stacked&&C.globals.comboCharts&&(!this.w.config.chart.stackOnlyBar||"bar"===(null==(v=this.w.config.series[i])?void 0:v.type)||"column"===(null==(A=this.w.config.series[i])?void 0:A.type));let R=C.config.stroke.curve;Array.isArray(R)&&(R=Array.isArray(p)?R[p[o]]:R[o]);let Y,B=0;for(let a=0;a0&&C.globals.collapsedSeries.length{for(let e=t;e>0;e--){if(!(C.globals.collapsedSeriesIndices.indexOf((null==p?void 0:p[e])||e)>-1))return e;e--}return 0};x=this.prevSeriesY[t(o-1)][a+1]}else x=this.zeroY;else x=this.zeroY;c?n=F(E,x):(n=F(e[o][a+1],x),"rangeArea"===t&&(X=F(w[o][a+1],x))),u.push(null===e[o][a+1]?null:r),!c||"smooth"!==C.config.stroke.curve&&"monotoneCubic"!==C.config.stroke.curve?(f.push(n),b.push(X)):(f.push(null),b.push(null));const m=this.lineHelpers.calculatePoints({series:e,x:r,y:n,realIndex:i,i:o,j:a,prevY:D}),v=this._createPaths({type:t,series:e,i:o,j:a,x:r,y:n,y2:X,xArrj:u,yArrj:f,y2Arrj:b,pX:l,pY:h,pathState:B,segmentStartX:Y,linePath:L,areaPath:P,linePaths:d,areaPaths:g,curve:R,isRangeStart:y});g=v.areaPaths,d=v.linePaths,l=v.pX,h=v.pY,B=v.pathState,Y=v.segmentStartX,P=v.areaPath,L=v.linePath,!this.appendPathFrom||C.globals.hasNullValues||"monotoneCubic"===R&&"rangeArea"===t||(M+=S.line(r,this.areaBottomY),I+=S.line(r,this.areaBottomY)),this.handleNullDataPoints(e,m,o,a,i),this._handleMarkersAndLabels({type:t,pointsPos:m,i:o,j:a,realIndex:i,isRangeStart:y})}return{yArrj:f,xArrj:u,pathFromArea:I,areaPaths:g,pathFromLine:M,linePaths:d,linePath:L,areaPath:P}}_handleMarkersAndLabels({type:t,pointsPos:e,isRangeStart:s,i:i,j:a,realIndex:o}){const r=this.w,n=new W(this.w,this.ctx);if(this.pointsChart)this.scatter.draw(this.elSeries,a,{realIndex:o,pointsPos:e,zRatio:this.zRatio,elParent:this.elPointsMain});else{r.seriesData.series[i].length>1&&this.elPointsMain.node.classList.add("apexcharts-element-hidden");const t=this.markers.plotChartMarkers({pointsPos:e,seriesIndex:o,j:a+1});null!==t&&this.elPointsMain.add(t)}const l=n.drawDataLabel({type:t,isRangeStart:s,pos:e,i:o,j:a+1});null!==l&&this.elDataLabelsWrap.add(l)}_createPaths({type:t,series:e,i:s,j:i,x:a,y:o,xArrj:r,yArrj:n,y2:l,y2Arrj:h,pX:c,pY:d,pathState:g,segmentStartX:p,linePath:x,areaPath:u,linePaths:f,areaPaths:b,curve:m,isRangeStart:y}){const w=new T(this.w),v=this.areaBottomY,A="rangeArea"===t,C="rangeArea"===t&&y;switch(m){case"monotoneCubic":{const t=y?n:h,a=(t,e)=>t.map((t,s)=>[t,e[s]]).filter(t=>null!==t[1]),o=t=>{const e=[];let s=0;return t.forEach(t=>{null!==t?s++:s>0&&(e.push(s),s=0)}),s>0&&e.push(s),e},l=(t,e)=>{const s=o(t),i=[];for(let t=0,a=0;t1?fe.points(i):i;let n=[];A&&(C?b=i:n=b.reverse());let h=0,c=0;if(l(s,o).forEach(t=>{h++;const e=(t=>{let e="";for(let s=0;s4?(e+=`C${i[0]}, ${i[1]}`,e+=`, ${i[2]}, ${i[3]}`,e+=`, ${i[4]}, ${i[5]}`):a>2&&(e+=`S${i[0]}, ${i[1]}`,e+=`, ${i[2]}, ${i[3]}`)}return e})(t),s=c;c+=t.length;const a=c-1;C?x=w.move(i[s][0],i[s][1])+e:A?x=w.move(n[s][0],n[s][1])+w.line(i[s][0],i[s][1])+e+w.line(n[a][0],n[a][1]):(x=w.move(i[s][0],i[s][1])+e,u=x+w.line(i[a][0],v)+w.line(i[s][0],v)+"z",b.push(u)),f.push(x)}),A&&h>1&&!C){const t=f.slice(h).reverse();f.splice(h),t.forEach(t=>f.push(t))}g=0;break}}break}case"smooth":{const t=.35*(a-c);if(null===e[s][i])g=0;else switch(g){case 0:if(p=c,x=C?w.move(c,h[i])+w.line(c,d):w.move(c,d),u=w.move(c,d),null===e[s][i+1]||void 0===e[s][i+1]){f.push(x),b.push(u);break}if(g=1,i=e[s].length-2&&(C&&(x+=w.curve(a,o,a,o,a,l)+w.move(a,l)),u+=w.curve(a,o,a,o,a,v)+w.line(p,v)+"z",f.push(x),b.push(u),g=-1)}}c=a,d=o;break}default:{const t=(t,e,s)=>{let i="";switch(t){case"stepline":i=w.line(e,null,"H")+w.line(null,s,"V");break;case"linestep":i=w.line(null,s,"V")+w.line(e,null,"H");break;case"straight":i=w.line(e,s)}return i};if(null===e[s][i])g=0;else switch(g){case 0:if(p=c,x=C?w.move(c,h[i])+w.line(c,d):w.move(c,d),u=w.move(c,d),null===e[s][i+1]||void 0===e[s][i+1]){f.push(x),b.push(u);break}if(g=1,i=e[s].length-2&&(C&&(x+=w.line(a,l)),u+=w.line(a,v)+w.line(p,v)+"z",f.push(x),b.push(u),g=-1)}}c=a,d=o;break}}return{linePaths:f,areaPaths:b,pX:c,pY:d,pathState:g,segmentStartX:p,linePath:x,areaPath:u}}handleNullDataPoints(t,e,s,i,a){const o=this.w;if(null===t[s][i]&&o.config.markers.showNullDataPoints||1===t[s].length){let t=this.strokeWidth-o.config.markers.strokeWidth/2;t>0||(t=0);const s=this.markers.plotChartMarkers({pointsPos:e,seriesIndex:a,j:i+1,pSize:t,alwaysDrawMarker:!0});null!==s&&this.elPointsMain.add(s)}}}class ye{constructor(t){this.w=t}drawYAxisTexts(t,e,s,i){const a=this.w,o=a.config.yaxis[0],r=a.formatters.yLabelFormatters[0];return new T(this.w).drawText({x:t+o.labels.offsetX,y:e+o.labels.offsetY,text:r(i,s),textAnchor:"middle",fontSize:o.labels.style.fontSize,fontFamily:o.labels.style.fontFamily,foreColor:Array.isArray(o.labels.style.colors)?o.labels.style.colors[s]:o.labels.style.colors})}}class we{constructor(t,e){this.ctx=e,this.w=t,this.chartType=this.w.config.chart.type,this.initialAnim=this.w.config.chart.animations.enabled,this.dynamicAnim=this.initialAnim&&this.w.config.chart.animations.dynamicAnimation.enabled,this.animBeginArr=[0],this.animDur=0,this.donutDataLabels=this.w.config.plotOptions.pie.donut.labels,this.lineColorArr=void 0!==t.globals.stroke.colors?t.globals.stroke.colors:t.globals.colors,this.defaultSize=Math.min(t.layout.gridWidth,t.layout.gridHeight),this.centerY=this.defaultSize/2,this.centerX=t.layout.gridWidth/2,"radialBar"===t.config.chart.type?this.fullAngle=360:this.fullAngle=Math.abs(t.config.plotOptions.pie.endAngle-t.config.plotOptions.pie.startAngle),this.initialAngle=t.config.plotOptions.pie.startAngle%this.fullAngle,t.globals.radialSize=this.defaultSize/2.05-t.config.stroke.width-(t.config.chart.sparkline.enabled?0:t.config.chart.dropShadow.blur),this.donutSize=t.globals.radialSize*parseInt(t.config.plotOptions.pie.donut.size,10)/100;const s=t.config.plotOptions.pie.customScale,i=t.layout.gridWidth/2,a=t.layout.gridHeight/2;this.translateX=i-i*s,this.translateY=a-a*s,this.dataLabelsGroup=new T(this.w).group({class:"apexcharts-datalabels-group",transform:`translate(${this.translateX}, ${this.translateY}) scale(${s})`}),this.maxY=0,this.sliceLabels=[],this.sliceSizes=[],this.prevSectorAngleArr=[]}draw(t){const e=this.w,s=new T(this.w),i=s.group({class:"apexcharts-pie"});if(e.globals.noData)return i;let a=0;for(let e=0;e{this.maxY=Math.max(this.maxY,t)}),e.config.yaxis[0].max&&(this.maxY=e.config.yaxis[0].max),"back"===e.config.grid.position&&"polarArea"===this.chartType&&this.drawPolarElements(i);for(let s=0;s{n.add(t)}),r.attr({transform:`translate(${this.translateX}, ${this.translateY}) scale(${e.config.plotOptions.pie.customScale})`}),r.add(n),i.add(r),this.donutDataLabels.show){const t=this.renderInnerDataLabels(this.dataLabelsGroup,this.donutDataLabels,{hollowSize:this.donutSize,centerX:this.centerX,centerY:this.centerY,opacity:this.donutDataLabels.show});i.add(t)}return"front"===e.config.grid.position&&"polarArea"===this.chartType&&this.drawPolarElements(i),i}drawArcs(t,e){const s=this.w,i=new X(this.w),a=new T(this.w),o=new H(this.w),r=a.group({class:"apexcharts-slices"});let n=this.initialAngle,l=this.initialAngle,h=this.initialAngle,c=this.initialAngle;this.strokeWidth=s.config.stroke.show?s.config.stroke.width:0;for(let d=0;d-1&&this.pieClicked(d),s.config.dataLabels.enabled){const e=b.x,o=b.y;let r=100*p/this.fullAngle+"%";if(0!==p&&s.config.plotOptions.pie.dataLabels.minAngleToShowLabelthis.fullAngle?e.endAngle=e.endAngle-(i+r):i+r{d=p+(i-p)*n,o.animateStartingPos&&(d=a+(i-a)*n,g=e-a+(s-(e-a))*n),c=r.getPiePath({me:r,startAngle:g,angle:d,size:h}),t.node.setAttribute("data:pathOrig",c),t.attr({d:c})}):(c=r.getPiePath({me:r,startAngle:g,angle:i,size:h}),o.isTrack||(n.globals.animationEnded=!0),t.node.setAttribute("data:pathOrig",c),t.attr({d:c,"stroke-width":r.strokeWidth}))}pieClicked(t){const e=this.w,s=this,i=s.sliceSizes[t]+(e.config.plotOptions.pie.expandOnClick?4:0),a=e.dom.Paper.findOne(`.apexcharts-${s.chartType.toLowerCase()}-slice-${t}`);if("true"===a.attr("data:pieClicked")){a.attr({"data:pieClicked":"false"}),this.revertDataLabelsInner();const t=a.attr("data:pathOrig");return void a.attr({d:t})}{const s=e.dom.baseEl.getElementsByClassName("apexcharts-pie-area");Array.prototype.forEach.call(s,t=>{t.setAttribute("data:pieClicked","false");const e=t.getAttribute("data:pathOrig");e&&t.setAttribute("d",e)}),e.interact.capturedDataPointIndex=t,a.attr("data:pieClicked","true")}const o=parseInt(a.attr("data:startAngle"),10),r=parseInt(a.attr("data:angle"),10),n=s.getPiePath({me:s,startAngle:o,angle:r,size:i});360!==r&&a.plot(n)}getChangedPath(t,e){let s="";return this.dynamicAnim&&this.w.globals.dataChanged&&(s=this.getPiePath({me:this,startAngle:t,angle:e-t,size:this.size})),s}getPiePath({me:t,startAngle:e,angle:s,size:i}){let a;const o=new T(this.w),r=e,n=Math.PI*(r-90)/180;let l=s+e;Math.ceil(l)>=this.fullAngle+this.w.config.plotOptions.pie.startAngle%this.fullAngle&&(l=this.fullAngle+this.w.config.plotOptions.pie.startAngle%this.fullAngle-.01),Math.ceil(l)>this.fullAngle&&(l-=this.fullAngle);const h=Math.PI*(l-90)/180,c=t.centerX+i*Math.cos(n),d=t.centerY+i*Math.sin(n),g=t.centerX+i*Math.cos(h),p=t.centerY+i*Math.sin(h),x=m.polarToCartesian(t.centerX,t.centerY,t.donutSize,l),u=m.polarToCartesian(t.centerX,t.centerY,t.donutSize,r),f=s>180?1:0,b=["M",c,d,"A",i,i,0,f,1,g,p];return a="donut"===t.chartType?[...b,"L",x.x,x.y,"A",t.donutSize,t.donutSize,0,f,0,u.x,u.y,"L",c,d,"z"].join(" "):"pie"===t.chartType||"polarArea"===t.chartType?[...b,"L",t.centerX,t.centerY,"L",c,d].join(" "):[...b].join(" "),o.roundPathCorners(a,2*this.strokeWidth)}drawPolarElements(t){const e=this.w,s=new V(this.w),i=new T(this.w),a=new ye(this.w),o=i.group(),r=i.group(),n=s.niceScale(0,Math.ceil(this.maxY),0),l=n.result.reverse(),h=n.result.length;this.maxY=n.niceMax;let c=e.globals.radialSize;const d=c/(h-1);for(let t=0;t1&&t.total.show&&(o=t.total.color);const r=a.dom.baseEl.querySelector(".apexcharts-datalabel-label"),n=a.dom.baseEl.querySelector(".apexcharts-datalabel-value");s=(0,t.value.formatter)(s,a),i||"function"!=typeof t.total.formatter||(s=t.total.formatter(a));const l=e===t.total.label;if(e=this.donutDataLabels.total.label?t.name.formatter(e,l,a):"",null!==r&&(r.textContent=e),null!==n&&(n.textContent=s),null!==r){r.style.fill=o}}printDataLabelsInner(t,e){const s=this.w,i=t.getAttribute("data:value"),a=s.seriesData.seriesNames[parseInt(t.parentNode.getAttribute("rel"),10)-1];s.seriesData.series.length>1&&this.printInnerLabels(e,a,i,t);const o=s.dom.baseEl.querySelector(".apexcharts-datalabels-group");if(null!==o){o.style.opacity="1"}}drawSpokes(t){const e=this.w,s=new T(this.w),i=e.config.plotOptions.polarArea.spokes;if(0===i.strokeWidth)return;const a=[],o=360/e.seriesData.series.length;for(let t=0;t{const o=s.drawLine(e.x,e.y,this.centerX,this.centerY,Array.isArray(i.connectorColors)?i.connectorColors[a]:i.connectorColors);t.add(o)})}revertDataLabelsInner(){const t=this.w;if(this.donutDataLabels.show){const e=t.dom.Paper.findOne(".apexcharts-datalabels-group"),s=this.renderInnerDataLabels(e,this.donutDataLabels,{hollowSize:this.donutSize,centerX:this.centerX,centerY:this.centerY,opacity:this.donutDataLabels.show});t.dom.Paper.findOne(".apexcharts-radialbar, .apexcharts-pie").add(s)}}}function ve(t,e){let s=0;for(let e=0;e=Ae(Math.min(e,a),Math.max(s,a),i+a,o)}function Se(t,e,s,i,a,o,r,n){if(r>=n){const r=i/n;let l=o;for(let i=0;id&&(d=p),g++;else{if(Se(o,n,l,h,e,s,i,a),i>=a){const t=h/a;e+=t,i-=t}else{const t=h/i;s+=t,a-=t}l=0,h=0,c=1/0,d=-1/0}}return l>0&&Se(o,n,l,h,e,s,i,a),o}const De={generate:function(t,e,s){const i=t.length,a=new Array(i);for(let e=0;es.globals.seriesPercent[t]):s.globals.seriesPercent.slice()),this.series=t,this.barHelpers.initializeStackedPrevVars(this);const a=this.graphics.group({class:"apexcharts-bar-series apexcharts-plot-series"});let o=0,r=0;for(let i=0,h=0;i1&&(this.yaxisIndex=s.globals.seriesYAxisReverseMap[c][0],u=c),this.isReversed=s.config.yaxis[this.yaxisIndex]&&s.config.yaxis[this.yaxisIndex].reversed;let f=this.graphics.group({class:"apexcharts-series",seriesName:m.escapeString(s.seriesData.seriesNames[c]),rel:i+1,"data:realIndex":c});et.addCollapsedClassToSeries(this.w,f,c);const b=this.graphics.group({class:"apexcharts-datalabels","data:realIndex":c}),y=this.graphics.group({class:"apexcharts-bar-goals-markers"}),w=this.initialPositions(o,r,void 0,void 0,void 0,void 0,u),{xDivision:v,yDivision:A,zeroH:C,zeroW:S}=w;let k=w.barHeight,D=w.barWidth;r=w.y,o=w.x,s.globals.barHeight=k,s.globals.barWidth=D,this.barHelpers.initializeStackedXYVars(this),1===this.groupCtx.prevY.length&&this.groupCtx.prevY[0].every(t=>isNaN(t))&&(this.groupCtx.prevY[0]=this.groupCtx.prevY[0].map(()=>C),this.groupCtx.prevYF[0]=this.groupCtx.prevYF[0].map(()=>0));for(let e=0;e0||"top"===this.barHelpers.arrBorderRadius[c][e]&&s.seriesData.series[c][e]<0)&&(M=I),f=this.renderSeries(l(n({realIndex:c,pathFill:P.color},P.useRangeColor?{lineFill:P.color}:{}),{j:e,i:i,columnGroupIndex:g,pathFrom:w.pathFrom,pathTo:w.pathTo,strokeWidth:a,elSeries:f,x:o,y:r,series:t,barHeight:k,barWidth:D,elDataLabelsWrap:b,elGoalsMarkers:y,type:"bar",visibleSeries:g,classes:M}))}s.globals.seriesXvalues[c]=p,s.globals.seriesYvalues[c]=x,this.groupCtx.prevY.push(this.groupCtx.yArrj),this.groupCtx.prevYF.push(this.groupCtx.yArrjF),this.groupCtx.prevYVal.push(this.groupCtx.yArrjVal),this.groupCtx.prevX.push(this.groupCtx.xArrj),this.groupCtx.prevXF.push(this.groupCtx.xArrjF),this.groupCtx.prevXVal.push(this.groupCtx.xArrjVal),a.add(f)}return a}initialPositions(t,e,s,i,a,o,r){const n=this.w;let l,h;if(this.isHorizontal){i=n.layout.gridHeight/n.globals.dataPoints;const t=n.config.plotOptions.bar.barHeight;l=-1===String(t).indexOf("%")?parseInt(t,10):i*parseInt(t,10)/100,o=n.globals.padHorizontal+(this.isReversed?n.layout.gridWidth-this.baseLineInvertedY:this.baseLineInvertedY),e=(i-l)/2}else{h=s=n.layout.gridWidth/n.globals.dataPoints;const e=n.config.plotOptions.bar.columnWidth;n.axisFlags.isXNumeric&&n.globals.dataPoints>1?h=(s=n.globals.minXDiff/this.xRatio)*parseInt(this.barOptions.columnWidth,10)/100:-1===String(e).indexOf("%")?h=parseInt(e,10):h*=parseInt(e,10)/100,a=this.isReversed?this.baseLineY[r]:n.layout.gridHeight-this.baseLineY[r],t=n.globals.padHorizontal+(s-h)/2}const c=n.globals.barGroups.length||1;return{x:t,y:e,yDivision:i,xDivision:s,barHeight:(null!=l?l:0)/c,barWidth:(null!=h?h:0)/c,zeroH:a,zeroW:o}}drawStackedBarPaths({indexes:t,barHeight:e,strokeWidth:s,zeroW:i,x:a,y:o,columnGroupIndex:r,seriesGroup:n,yDivision:l,elSeries:h}){var c,d,g,p,x;const u=this.w,f=o+r*e;let b;const m=t.i,y=t.j,w=t.realIndex,v=t.translationsIndex;let A=0;for(let t=0;t0){let t=i;this.groupCtx.prevXVal[C-1][y]<0?t=(null==(c=this.series[m])?void 0:c[y])>=0?this.groupCtx.prevX[C-1][y]+A-2*(this.isReversed?A:0):this.groupCtx.prevX[C-1][y]:this.groupCtx.prevXVal[C-1][y]>=0&&(t=(null==(d=this.series[m])?void 0:d[y])>=0?this.groupCtx.prevX[C-1][y]:this.groupCtx.prevX[C-1][y]-A+2*(this.isReversed?A:0)),b=t}else b=i;a=null===(null==(g=this.series[m])?void 0:g[y])?b:b+(null==(p=this.series[m])?void 0:p[y])/this.invertedYRatio-2*(this.isReversed?(null==(x=this.series[m])?void 0:x[y])/this.invertedYRatio:0);const S=this.barHelpers.getBarpaths({barYPosition:f,barHeight:e,x1:b,x2:a,strokeWidth:s,isReversed:this.isReversed,series:this.series,realIndex:t.realIndex,seriesGroup:n,i:m,j:y,w:u});return this.barHelpers.barBackground({j:y,i:m,y1:f,y2:e,elSeries:h}),o+=l,{pathTo:S.pathTo,pathFrom:S.pathFrom,goalX:this.barHelpers.getGoalValues("x",i,null,m,y,v),barXPosition:b,barYPosition:f,x:a,y:o}}drawStackedColumnPaths({indexes:t,x:e,y:s,xDivision:i,barWidth:a,zeroH:o,columnGroupIndex:r,seriesGroup:n,elSeries:l}){var h,c,d,g,p,x,u,f,b;const m=this.w,y=t.i,w=t.j,v=t.bc,A=t.realIndex,C=t.translationsIndex;if(m.axisFlags.isXNumeric){let t=m.seriesData.seriesX[A][w];t||(t=0),e=(t-m.globals.minX)/this.xRatio-a/2*m.globals.barGroups.length}const S=e+r*a;let k,D=0;for(let t=0;t0&&!m.axisFlags.isXNumeric||L>0&&m.axisFlags.isXNumeric&&m.seriesData.seriesX[A-1][w]===m.seriesData.seriesX[A][w]){let t,e;const s=Math.min(this.yRatio.length+1,A+1);if(void 0!==this.groupCtx.prevY[L-1]&&this.groupCtx.prevY[L-1].length)for(let t=1;t=0?e-D+2*(this.isReversed?D:0):e;break}if((null==(g=this.groupCtx.prevYVal[L-i])?void 0:g[w])>=0){t=(null==(p=this.series[y])?void 0:p[w])>=0?e:e+D-2*(this.isReversed?D:0);break}}void 0===t&&(t=m.layout.gridHeight),k=(null==(x=this.groupCtx.prevYF[0])?void 0:x.every(t=>0===t))&&this.groupCtx.prevYF.slice(1,L).every(t=>t.every(t=>isNaN(t)))?o:t}else k=o;s=(null==(u=this.series[y])?void 0:u[w])?k-(null==(f=this.series[y])?void 0:f[w])/this.yRatio[C]+2*(this.isReversed?(null==(b=this.series[y])?void 0:b[w])/this.yRatio[C]:0):k;const P=this.barHelpers.getColumnPaths({barXPosition:S,barWidth:a,y1:k,y2:s,yRatio:this.yRatio[C],strokeWidth:this.strokeWidth,isReversed:this.isReversed,series:this.series,seriesGroup:n,realIndex:t.realIndex,i:y,j:w,w:m});return this.barHelpers.barBackground({bc:v,j:w,i:y,x1:S,x2:a,elSeries:l}),{pathTo:P.pathTo,pathFrom:P.pathFrom,goalY:this.barHelpers.getGoalValues("y",null,o,y,w,0),barXPosition:S,x:m.axisFlags.isXNumeric?e:e+i,y:s}}},rangeBar:class extends de{draw(t,e){var s,i,a,o,r,l,h,c,d;const g=this.w,p=new T(this.w);this.rangeBarOptions=this.w.config.plotOptions.rangeBar,this.series=t,this.seriesRangeStart=g.rangeData.seriesRangeStart,this.seriesRangeEnd=g.rangeData.seriesRangeEnd,this.barHelpers.initVariables(t);const x=p.group({class:"apexcharts-rangebar-series apexcharts-plot-series"});for(let u=0;u0&&(this.visibleI=this.visibleI+1);let A=0;this.yRatio.length>1&&(this.yaxisIndex=g.globals.seriesYAxisReverseMap[y][0],A=y);const C=this.barHelpers.initialPositions(y),{y:S,zeroW:k,x:D,zeroH:L}=C;let P=null!=(s=C.barWidth)?s:0,M=null!=(i=C.barHeight)?i:0;const I=null!=(a=C.yDivision)?a:0,E=null!=(o=C.xDivision)?o:0;b=S,f=D;const F=p.group({class:"apexcharts-datalabels","data:realIndex":y}),X=p.group({class:"apexcharts-rangebar-goals-markers"});for(let e=0;eArray.isArray(t)?t.join(" "):t).indexOf(y),v=u.rangeData.seriesRange[t].findIndex(t=>{var e;return t.x===y&&(null==(e=t.overlaps)?void 0:e.size)>0});return this.isHorizontal?(s=u.config.plotOptions.bar.rangeBarGroupRows?a+l*w:a+r*this.visibleI+l*w,v>-1&&!u.config.plotOptions.bar.rangeBarOverlap&&(f=Array.from(u.rangeData.seriesRange[t][v].overlaps),f.indexOf(b)>-1&&(s=(r=c.barHeight/f.length)*this.visibleI+l*(100-parseInt(this.barOptions.barHeight,10))/100/2+r*(this.visibleI+f.indexOf(b))+l*w))):(w>-1&&!u.labelData.timescaleLabels.length&&(i=u.config.plotOptions.bar.rangeBarGroupRows?o+h*w:o+n*this.visibleI+h*w),v>-1&&!u.config.plotOptions.bar.rangeBarOverlap&&(f=Array.from(u.rangeData.seriesRange[t][v].overlaps),f.indexOf(b)>-1&&(i=(n=c.barWidth/f.length)*this.visibleI+h*(100-parseInt(this.barOptions.barWidth,10))/100/2+n*(this.visibleI+f.indexOf(b))+h*w))),{barYPosition:s,barXPosition:i,barHeight:r,barWidth:n}}drawRangeColumnPaths({indexes:t,x:e,xDivision:s,barWidth:i,barXPosition:a,zeroH:o}){var r,n;const l=this.w,{i:h,j:c,realIndex:d,translationsIndex:g}=t,p=this.yRatio[g],x=this.getRangeValue(d,c);let u=Math.min(x.start,x.end),f=Math.max(x.start,x.end);void 0===(null==(r=this.series[h])?void 0:r[c])||null===(null==(n=this.series[h])?void 0:n[c])?u=o:(u=o-u/p,f=o-f/p);const b=Math.abs(f-u),m=this.barHelpers.getColumnPaths({barXPosition:a,barWidth:i,y1:u,y2:f,strokeWidth:this.strokeWidth,series:this.seriesRangeEnd,realIndex:d,i:d,j:c,w:l});if(l.axisFlags.isXNumeric){const t=this.getBarXForNumericXAxis({x:e,j:c,realIndex:d,barWidth:i});e=t.x,a=t.barXPosition}else e+=s;return{pathTo:m.pathTo,pathFrom:m.pathFrom,barHeight:b,x:e,y:x.start<0&&x.end<0?u:f,goalY:this.barHelpers.getGoalValues("y",null,o,h,c,g),barXPosition:a}}preventBarOverflow(t){const e=this.w;return t<0&&(t=0),t>e.layout.gridWidth&&(t=e.layout.gridWidth),t}drawRangeBarPaths({indexes:t,y:e,y1:s,y2:i,yDivision:a,barHeight:o,barYPosition:r,zeroW:n}){const l=this.w,{realIndex:h,j:c}=t,d=this.preventBarOverflow(n+s/this.invertedYRatio),g=this.preventBarOverflow(n+i/this.invertedYRatio),p=this.getRangeValue(h,c),x=Math.abs(g-d),u=this.barHelpers.getBarpaths({barYPosition:r,barHeight:o,x1:d,x2:g,strokeWidth:this.strokeWidth,series:this.seriesRangeEnd,i:h,realIndex:h,j:c,w:l});return l.axisFlags.isXNumeric||(e+=a),{pathTo:u.pathTo,pathFrom:u.pathFrom,barWidth:x,x:p.start<0&&p.end<0?d:g,goalX:this.barHelpers.getGoalValues("x",n,null,h,c,0),y:e}}getRangeValue(t,e){const s=this.w;return{start:s.rangeData.seriesRangeStart[t][e],end:s.rangeData.seriesRangeEnd[t][e]}}},candlestick:ge,boxPlot:ge,pie:we,donut:we,polarArea:we,radialBar:class extends we{constructor(t,e){super(t,e),this.ctx=e,this.w=t,this.animBeginArr=[0],this.animDur=0,this.startAngle=t.config.plotOptions.radialBar.startAngle,this.endAngle=t.config.plotOptions.radialBar.endAngle,this.totalAngle=Math.abs(t.config.plotOptions.radialBar.endAngle-t.config.plotOptions.radialBar.startAngle),this.trackStartAngle=t.config.plotOptions.radialBar.track.startAngle,this.trackEndAngle=t.config.plotOptions.radialBar.track.endAngle,this.barLabels=this.w.config.plotOptions.radialBar.barLabels,this.donutDataLabels=this.w.config.plotOptions.radialBar.dataLabels,this.radialDataLabels=this.donutDataLabels,this.trackStartAngle||(this.trackStartAngle=this.startAngle),this.trackEndAngle||(this.trackEndAngle=this.endAngle),360===this.endAngle&&(this.endAngle=359.99),this.margin=parseInt(t.config.plotOptions.radialBar.track.margin,10),this.onBarLabelClick=this.onBarLabelClick.bind(this)}draw(t){const e=this.w,s=new T(this.w),i=s.group({class:"apexcharts-radialbar"});if(e.globals.noData)return i;const a=s.group(),o=this.defaultSize/2,r=e.layout.gridWidth/2;let n=this.defaultSize/2.05;e.config.chart.sparkline.enabled||(n=n-e.config.stroke.width-e.config.chart.dropShadow.blur);const l=e.globals.fill.colors;if(e.config.plotOptions.radialBar.track.show){const e=this.drawTracks({size:n,centerX:r,centerY:o,colorArr:l,series:t});a.add(e)}const h=this.drawArcs({size:n,centerX:r,centerY:o,colorArr:l,series:t});let c=360;e.config.plotOptions.radialBar.startAngle<0&&(c=this.totalAngle);const d=(360-c)/360;if(e.globals.radialSize=n-n*d,this.radialDataLabels.value.show){const t=Math.max(this.radialDataLabels.value.offsetY,this.radialDataLabels.name.offsetY);e.globals.radialSize+=t*d}return a.add(h.g),"front"===e.config.plotOptions.radialBar.hollow.position&&(h.g.add(h.elHollow),h.dataLabels&&h.g.add(h.dataLabels)),i.add(a),i}drawTracks(t){const e=this.w,s=new T(this.w),i=s.group({class:"apexcharts-tracks"}),a=new X(this.w),o=new H(this.w),r=this.getStrokeWidth(t);t.size=t.size-r/2;for(let n=0;n=360&&(g=360-Math.abs(this.startAngle)-.1);const p=s.drawPath({d:"",stroke:c,strokeWidth:r*parseInt(h.strokeWidth,10)/100,fill:"none",strokeOpacity:h.opacity,classes:"apexcharts-radialbar-area"});if(h.dropShadow.enabled){const t=h.dropShadow;a.dropShadow(p,t)}l.add(p),p.attr("id","apexcharts-radialbarTrack-"+n),this.animatePaths(p,{centerX:t.centerX,centerY:t.centerY,endAngle:g,startAngle:d,size:t.size,i:n,totalItems:2,animBeginArr:0,dur:0,isTrack:!0})}return i}drawArcs(t){const e=this.w,s=new T(this.w),i=new H(this.w),a=new X(this.w),o=s.group(),r=this.getStrokeWidth(t);t.size=t.size-r/2;let n=e.config.plotOptions.radialBar.hollow.background;const l=t.size-r*t.series.length-this.margin*t.series.length-r*parseInt(e.config.plotOptions.radialBar.track.strokeWidth,10)/100/2,h=l-e.config.plotOptions.radialBar.hollow.margin;void 0!==e.config.plotOptions.radialBar.hollow.image&&(n=this.drawHollowImage(t,o,l,n));const c=this.drawHollow({size:h,centerX:t.centerX,centerY:t.centerY,fill:n||"transparent"});if(e.config.plotOptions.radialBar.hollow.dropShadow.enabled){const t=e.config.plotOptions.radialBar.hollow.dropShadow;a.dropShadow(c,t)}let d=1;!this.radialDataLabels.total.show&&e.seriesData.series.length>1&&(d=0);let g=null;if(this.radialDataLabels.show){const s=e.dom.Paper.findOne(".apexcharts-datalabels-group");g=this.renderInnerDataLabels(s,this.radialDataLabels,{hollowSize:l,centerX:t.centerX,centerY:t.centerY,opacity:d})}"back"===e.config.plotOptions.radialBar.hollow.position&&(o.add(c),g&&o.add(g));let p=!1;e.config.plotOptions.radialBar.inverseOrder&&(p=!0);for(let n=p?t.series.length-1:0;p?n>=0:n100?100:t.series[n])/100;let p,x=Math.round(this.totalAngle*g)+this.startAngle;e.globals.dataChanged&&(d=this.startAngle,p=Math.round(this.totalAngle*m.negToZero(e.globals.previousPaths[n])/100)+d);Math.abs(x)+Math.abs(c)>360&&(x-=.01);Math.abs(p)+Math.abs(d)>360&&(p-=.01);const u=x-c,f=Array.isArray(e.config.stroke.dashArray)?e.config.stroke.dashArray[n]:e.config.stroke.dashArray,b=s.drawPath({d:"",stroke:h,strokeWidth:r,fill:"none",fillOpacity:e.config.fill.opacity,classes:"apexcharts-radialbar-area apexcharts-radialbar-slice-"+n,strokeDashArray:f}),y=c+u/2,w=m.polarToCartesian(t.centerX,t.centerY,t.size,y);if(T.setAttrs(b.node,{"data:angle":u,"data:value":t.series[n],"data:cx":w.x,"data:cy":w.y}),e.config.chart.dropShadow.enabled){const t=e.config.chart.dropShadow;a.dropShadow(b,t,n)}if(a.setSelectionFilter(b,0,n),this.addListeners(b,this.radialDataLabels),l.add(b),b.attr({index:0,j:n}),this.barLabels.enabled){const i=m.polarToCartesian(t.centerX,t.centerY,t.size,c),a=this.barLabels.formatter(e.seriesData.seriesNames[n],{seriesIndex:n,w:e}),o=["apexcharts-radialbar-label"];this.barLabels.onClick||o.push("apexcharts-no-click");let r=this.barLabels.useSeriesColors?e.globals.colors[n]:e.config.chart.foreColor;r||(r=e.config.chart.foreColor);const h=i.x+this.barLabels.offsetX,d=i.y+this.barLabels.offsetY,g=s.drawText({x:h,y:d,text:a,textAnchor:"end",dominantBaseline:"middle",fontFamily:this.barLabels.fontFamily,fontWeight:this.barLabels.fontWeight,fontSize:this.barLabels.fontSize,foreColor:r,cssClass:o.join(" ")});g.on("click",this.onBarLabelClick),g.attr({rel:n+1}),0!==c&&g.attr({"transform-origin":`${h} ${d}`,transform:`rotate(${c} 0 0)`}),l.add(g)}let v=0;!this.initialAnim||e.globals.resized||e.globals.dataChanged||(v=e.config.chart.animations.speed),e.globals.dataChanged&&(v=e.config.chart.animations.dynamicAnimation.speed),this.animDur=v/(1.2*t.series.length)+this.animDur,this.animBeginArr.push(this.animDur),this.animatePaths(b,{centerX:t.centerX,centerY:t.centerY,endAngle:x,startAngle:c,prevEndAngle:p,prevStartAngle:d,size:t.size,i:n,totalItems:2,animBeginArr:this.animBeginArr,dur:v,shouldSetPrevPaths:!0})}return{g:o,elHollow:c,dataLabels:g}}drawHollow(t){const e=new T(this.w).drawCircle(2*t.size);return e.attr({class:"apexcharts-radialbar-hollow",cx:t.centerX,cy:t.centerY,r:t.size,fill:t.fill}),e}drawHollowImage(t,e,s,i){const a=this.w,o=new H(this.w),r=m.randomId(),n=a.config.plotOptions.radialBar.hollow.image;if(a.config.plotOptions.radialBar.hollow.imageClipped)o.clippedImgArea({width:s,height:s,image:n,patternID:`pattern${a.globals.cuid}${r}`}),i=`url(#pattern${a.globals.cuid}${r})`;else{const s=a.config.plotOptions.radialBar.hollow.imageWidth,i=a.config.plotOptions.radialBar.hollow.imageHeight;if(void 0===s&&void 0===i){const s=a.dom.Paper.image(n,function(e){this.move(t.centerX-e.width/2+a.config.plotOptions.radialBar.hollow.imageOffsetX,t.centerY-e.height/2+a.config.plotOptions.radialBar.hollow.imageOffsetY)});e.add(s)}else{const o=a.dom.Paper.image(n,function(){this.move(t.centerX-s/2+a.config.plotOptions.radialBar.hollow.imageOffsetX,t.centerY-i/2+a.config.plotOptions.radialBar.hollow.imageOffsetY),this.size(s,i)});e.add(o)}}return i}getStrokeWidth(t){const e=this.w;return t.size*(100-parseInt(e.config.plotOptions.radialBar.hollow.size,10))/100/(t.series.length+1)-this.margin}onBarLabelClick(t){var e;const s=t.target,i=parseInt(null!=(e=s.getAttribute("rel"))?e:"",10)-1,a=this.barLabels.onClick,o=this.w;a&&a(o.seriesData.seriesNames[i],{w:o,seriesIndex:i})}},radar:class{constructor(t,e){this.ctx=e,this.w=t,this.chartType=this.w.config.chart.type,this.initialAnim=this.w.config.chart.animations.enabled,this.dynamicAnim=this.initialAnim&&this.w.config.chart.animations.dynamicAnimation.enabled,this.animDur=0,this.graphics=new T(this.w),this.lineColorArr=void 0!==t.globals.stroke.colors?t.globals.stroke.colors:t.globals.colors,this.defaultSize=t.globals.svgHeight{const r=t.length===e.globals.dataPoints,h=this.graphics.group().attr({class:"apexcharts-series","data:longestSeries":r,seriesName:m.escapeString(e.seriesData.seriesNames[o]),rel:o+1,"data:realIndex":o});this.dataRadiusOfPercent[o]=[],this.dataRadius[o]=[],this.angleArr[o]=[],t.forEach((t,e)=>{const s=Math.abs(this.maxValue-this.minValue);t-=this.minValue,this.isLog&&(t=this.coreUtils.getLogVal(this.logBase,t,0)),this.dataRadiusOfPercent[o][e]=t/s,this.dataRadius[o][e]=this.dataRadiusOfPercent[o][e]*this.size,this.angleArr[o][e]=e*this.disAngle}),g=this.getDataPointsPos(this.dataRadius[o],this.angleArr[o]);const c=this.createPaths(g,{x:0,y:0});p=this.graphics.group({class:"apexcharts-series-markers-wrap apexcharts-element-hidden"}),x=this.graphics.group({class:"apexcharts-datalabels","data:realIndex":o}),e.globals.delayedElements.push({el:p.node,index:o});const d={i:o,realIndex:o,animationDelay:o,initialSpeed:e.config.chart.animations.speed,dataChangeSpeed:e.config.chart.animations.dynamicAnimation.speed,className:"apexcharts-radar",shouldClipToGrid:!1,bindEventsOnPaths:!1,stroke:e.globals.stroke.colors[o],strokeLineCap:e.config.stroke.lineCap};let u=null;e.globals.previousPaths.length>0&&(u=this.getPreviousPath(o));for(let t=0;t{const i=new N(this.w,this.ctx).getMarkerConfig({cssClass:"apexcharts-marker",seriesIndex:o,dataPointIndex:s}),r=this.graphics.drawMarker(g[s].x,g[s].y,i);r.attr("rel",s),r.attr("j",s),r.attr("index",o),r.node.setAttribute("default-marker-size",i.pSize);const l=this.graphics.group({class:"apexcharts-series-markers"});l&&l.add(r),p.add(l),h.add(p);const c=e.config.dataLabels;if(c.enabled){const t=c.formatter(e.seriesData.series[o][s],{seriesIndex:o,dataPointIndex:s,w:e});a.plotDataLabelsText({x:g[s].x,y:g[s].y,text:t,textAnchor:"middle",i:o,j:o,parent:x,offsetCorrection:!1,dataLabelsConfig:n({},c)})}h.add(x)}),i.push(h)}),this.drawPolygons({parent:d}),e.config.xaxis.labels.show){const t=this.drawXAxisTexts();d.add(t)}return i.forEach(t=>{d.add(t)}),d.add(this.yaxisLabels),d}drawPolygons(t){const e=this.w,{parent:s}=t,i=new ye(this.w),a=e.globals.yAxisScale[0].result.reverse(),o=a.length,r=[],n=this.size/(o-1);for(let t=0;t{const s=m.getPolygonPos(t,this.dataPointsLen);let i="";s.forEach((t,s)=>{if(0===e){const e=this.graphics.drawLine(t.x,t.y,0,0,Array.isArray(this.polygons.connectorColors)?this.polygons.connectorColors[s]:this.polygons.connectorColors);h.push(e)}0===s&&this.yaxisLabelsTextsPos.push({x:t.x,y:t.y}),i+=t.x+","+t.y+" "}),l.push(i)}),l.forEach((t,i)=>{const a=this.polygons.strokeColors,o=this.polygons.strokeWidth,r=this.graphics.drawPolygon(t,Array.isArray(a)?a[i]:a,Array.isArray(o)?o[i]:o,e.globals.radarPolygons.fill.colors[i]);s.add(r)}),h.forEach(t=>{s.add(t)}),e.config.yaxis[0].show&&this.yaxisLabelsTextsPos.forEach((t,e)=>{const s=i.drawYAxisTexts(t.x,t.y,e,a[e]);this.yaxisLabels.add(s)})}drawXAxisTexts(){const t=this.w,e=t.config.xaxis.labels,s=this.graphics.group({class:"apexcharts-xaxis"}),i=m.getPolygonPos(this.size,this.dataPointsLen);return t.labelData.labels.forEach((a,o)=>{const r=t.config.xaxis.labels.formatter,l=new W(this.w,this.ctx);if(i[o]){const h=this.getTextPos(i[o],this.size),c=r(a,{seriesIndex:-1,dataPointIndex:o,w:t});l.plotDataLabelsText({x:h.newX,y:h.newY,text:c,textAnchor:h.textAnchor,i:o,j:o,parent:s,className:"apexcharts-xaxis-label",color:Array.isArray(e.style.colors)&&e.style.colors[o]?e.style.colors[o]:"#a8a8a8",dataLabelsConfig:n({textAnchor:h.textAnchor,dropShadow:{enabled:!1}},e),offsetCorrection:!1}).on("click",e=>{if("function"==typeof t.config.chart.events.xAxisLabelClick){const s=Object.assign({},t,{labelIndex:o});t.config.chart.events.xAxisLabelClick(e,this.ctx,s)}})}}),s}createPaths(t,e){const s=[];let i=[];const a=[];let o=[];if(t.length){i=[this.graphics.move(e.x,e.y)],o=[this.graphics.move(e.x,e.y)];let r=this.graphics.move(t[0].x,t[0].y),n=this.graphics.move(t[0].x,t[0].y);t.forEach((e,s)=>{r+=this.graphics.line(e.x,e.y),n+=this.graphics.line(e.x,e.y),s===t.length-1&&(r+="Z",n+="Z")}),s.push(r),a.push(n)}return{linePathsFrom:i,linePathsTo:s,areaPathsFrom:o,areaPathsTo:a}}getTextPos(t,e){let s="middle",i=t.x,a=t.y;return Math.abs(t.x)>=10?t.x>0?(s="start",i+=10):t.x<0&&(s="end",i-=10):s="middle",Math.abs(t.y)>=e-10&&(t.y<0?a-=10:t.y>0&&(a+=10)),{textAnchor:s,newX:i,newY:a}}getPreviousPath(t){const e=this.w;let s=null;for(let i=0;i0&&parseInt(a.realIndex,10)===parseInt(String(t),10)&&void 0!==e.globals.previousPaths[i].paths[0]&&(s=e.globals.previousPaths[i].paths[0].d)}return s}getDataPointsPos(t,e,s=this.dataPointsLen){t=t||[],e=e||[];const i=[];for(let a=0;a=0;n?h++:h--){const n=s.group({class:"apexcharts-series apexcharts-heatmap-series",seriesName:m.escapeString(e.seriesData.seriesNames[h]),rel:h+1,"data:realIndex":h});if(et.addCollapsedClassToSeries(this.w,n,h),s.setupEventDelegation(n,".apexcharts-heatmap-rect"),e.config.chart.dropShadow.enabled){const t=e.config.chart.dropShadow;new X(this.w).dropShadow(n,t,h)}let c=0;const d=e.config.plotOptions.heatmap.shadeIntensity;let g=0;for(let i=0;i=l[h].length)break;const p=this.helpers.getShadeColor(e.config.chart.type,h,g,this.negRange);let x=p.color;const u=p.colorProps;if("image"===e.config.fill.type){x=new H(this.w).fillPath({seriesNumber:h,dataPointIndex:g,opacity:e.globals.hasNegs?u.percent<0?1-(1+u.percent/100):d+u.percent/100:u.percent/100,patternID:m.randomId(),width:e.config.fill.image.width?e.config.fill.image.width:a,height:e.config.fill.image.height?e.config.fill.image.height:o})}const f=this.rectRadius,b=s.drawRect(c,r,a,o,f);if(b.attr({cx:c,cy:r}),b.node.classList.add("apexcharts-heatmap-rect"),n.add(b),b.attr({fill:x,i:h,index:h,j:g,val:t[h][g],"stroke-width":this.strokeWidth,stroke:e.config.plotOptions.heatmap.useFillColorAsStroke?x:e.globals.stroke.colors[0],color:x}),e.config.chart.animations.enabled&&!e.globals.dataChanged){let t=1;e.globals.resized||(t=e.config.chart.animations.speed),this.animateHeatMap(b,c,r,a,o,t)}if(e.globals.dataChanged){let t=1;if(this.dynamicAnim.enabled&&e.globals.shouldAnimate){t=this.dynamicAnim.speed;let s=e.globals.previousPaths[h]&&e.globals.previousPaths[h][g]&&e.globals.previousPaths[h][g].color;s||(s="rgba(255, 255, 255, 0)"),this.animateHeatColor(b,m.isColorHex(s)?s:m.rgb2hex(s),m.isColorHex(x)?x:m.rgb2hex(x),t)}}const y=(0,e.config.dataLabels.formatter)(e.seriesData.series[h][g],{value:e.seriesData.series[h][g],seriesIndex:h,dataPointIndex:g,w:e}),w=this.helpers.calculateDataLabels({text:y,x:c+a/2,y:r+o/2,i:h,j:g,colorProps:u,series:l});null!==w&&n.add(w),c+=a,g++}r+=o,i.add(n)}const h=e.globals.yAxisScale[0].result.slice();return e.config.yaxis[0].reversed?h.unshift(""):h.push(""),e.globals.yAxisScale[0].result=h,i}animateHeatMap(t,e,s,i,a,o){const r=new F(this.w);r.animateRect(t,{x:e+i/2,y:s+a/2,width:0,height:0},{x:e,y:s,width:i,height:a},o,()=>{r.animationCompleted(t)})}animateHeatColor(t,e,s,i){t.attr({fill:e}).animate(i).attr({fill:s})}},treemap:class{constructor(t,e){this.ctx=e,this.w=t,this.strokeWidth=this.w.config.stroke.width,this.helpers=new pe(t,e),this.dynamicAnim=this.w.config.chart.animations.dynamicAnimation,this.labels=[]}draw(t){const e=this.w,s=new T(this.w,this.ctx),i=new H(this.w),a=s.group({class:"apexcharts-treemap"});if(e.globals.noData)return a;const o=[];t.forEach(t=>{const e=t.map(t=>Math.abs(t));o.push(e)}),this.negRange=this.helpers.checkColorRange(),e.config.series.forEach((t,e)=>{t.data.forEach(t=>{Array.isArray(this.labels[e])||(this.labels[e]=[]),this.labels[e].push(t.x)})});return De.generate(o,e.layout.gridWidth,e.layout.gridHeight).forEach((o,r)=>{var n;const l=s.group({class:"apexcharts-series apexcharts-treemap-series",seriesName:m.escapeString(e.seriesData.seriesNames[r]),rel:r+1,"data:realIndex":r});if(s.setupEventDelegation(l,".apexcharts-treemap-rect"),e.config.chart.dropShadow.enabled){const t=e.config.chart.dropShadow;new X(this.w).dropShadow(a,t,r)}const h=s.group({class:"apexcharts-data-labels"}),c={xMin:1/0,yMin:1/0,xMax:-1/0,yMax:-1/0};o.forEach((a,o)=>{const n=a[0],h=a[1],d=a[2],g=a[3];c.xMin=Math.min(c.xMin,n),c.yMin=Math.min(c.yMin,h),c.xMax=Math.max(c.xMax,d),c.yMax=Math.max(c.yMax,g);const p=this.helpers.getShadeColor(e.config.chart.type,r,o,this.negRange),x=p.color,u=i.fillPath({color:x,seriesNumber:r,dataPointIndex:o}),f=s.drawRect(n,h,d-n,g-h,e.config.plotOptions.treemap.borderRadius,"#fff",1,this.strokeWidth,e.config.plotOptions.treemap.useFillColorAsStroke?x:e.globals.stroke.colors[r]);f.attr({cx:n,cy:h,index:r,i:r,j:o,width:d-n,height:g-h,fill:u}),f.node.classList.add("apexcharts-treemap-rect");let b={x:n+(d-n)/2,y:h+(g-h)/2,width:0,height:0};const m={x:n,y:h,width:d-n,height:g-h};if(e.config.chart.animations.enabled&&!e.globals.dataChanged){let t=1;e.globals.resized||(t=e.config.chart.animations.speed),this.animateTreemap(f,b,m,t)}if(e.globals.dataChanged){let t=1;this.dynamicAnim.enabled&&e.globals.shouldAnimate&&(t=this.dynamicAnim.speed,e.globals.previousPaths[r]&&e.globals.previousPaths[r][o]&&e.globals.previousPaths[r][o].rect&&(b=e.globals.previousPaths[r][o].rect),this.animateTreemap(f,b,m,t))}let y=this.getFontSize(a),w=e.config.dataLabels.formatter(this.labels[r][o],{value:e.seriesData.series[r][o],seriesIndex:r,dataPointIndex:o,w:e});"truncate"===e.config.plotOptions.treemap.dataLabels.format&&(y=parseInt(String(e.config.dataLabels.style.fontSize),10),w=this.truncateLabels(String(w),y,n,h,d,g));let v=null;e.seriesData.series[r][o]&&(v=this.helpers.calculateDataLabels({text:w,x:(n+d)/2,y:(h+g)/2+this.strokeWidth/2+y/3,i:r,j:o,colorProps:p,fontSize:y,series:t})),e.config.dataLabels.enabled&&v&&this.rotateToFitLabel(v,y,w,n,h,d,g),l.add(f),null!==v&&l.add(v)});const d=e.config.plotOptions.treemap.seriesTitle;if(e.config.series.length>1&&d&&d.show){const t=e.config.series[r].name||"";if(t&&c.xMin<1/0&&c.yMin<1/0){const{offsetX:i,offsetY:a,borderColor:o,borderWidth:r,borderRadius:h,style:g}=d,p=g.color||e.config.chart.foreColor,x={left:g.padding.left,right:g.padding.right,top:g.padding.top,bottom:g.padding.bottom},u=s.getTextRects(t,g.fontSize,g.fontFamily),f=u.width+x.left+x.right,b=u.height+x.top+x.bottom,m=c.xMin+(i||0),y=c.yMin+(a||0),w=s.drawRect(m,y,f,b,h,g.background,1,r,o),v=s.drawText({x:m+x.left,y:y+x.top+.75*(null!=(n=null==u?void 0:u.height)?n:0),text:t,fontSize:g.fontSize,fontFamily:g.fontFamily,fontWeight:g.fontWeight,foreColor:p,cssClass:g.cssClass||""});l.add(w),l.add(v)}}l.add(h),a.add(l)}),a}getFontSize(t){const e=this.w;const s=function t(e){let s,i=0;if(Array.isArray(e[0]))for(s=0;so-i&&l.width<=r-a){const e=n.rotateAroundCenter(t.node);t.node.setAttribute("transform",`rotate(-90 ${e.x} ${e.y}) translate(${l.height/3})`)}}truncateLabels(t,e,s,i,a,o){const r=new T(this.w),n=r.getTextRects(t,String(e)).width+this.w.config.stroke.width+5>a-s&&o-i>a-s?o-i:a-s,l=r.getTextBasedOnMaxWidth({text:t,maxWidth:n,fontSize:e});return t.length!==l.length&&n/e<5?"":l}animateTreemap(t,e,s,i){const a=new F(this.w);a.animateRect(t,e,s,i,()=>{a.animationCompleted(t)})}}}),te});
\ No newline at end of file
+!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).ApexCharts=e()}(this,function(){"use strict";var t=Object.defineProperty,e=Object.defineProperties,s=Object.getOwnPropertyDescriptors,i=Object.getOwnPropertySymbols,a=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable,r=(e,s,i)=>s in e?t(e,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[s]=i,n=(t,e)=>{for(var s in e||(e={}))a.call(e,s)&&r(t,s,e[s]);if(i)for(var s of i(e))o.call(e,s)&&r(t,s,e[s]);return t},l=(t,i)=>e(t,s(i)),h=(t,e,s)=>r(t,"symbol"!=typeof e?e+"":e,s);class c{static isSSR(){return"undefined"==typeof window||"undefined"==typeof document}static isBrowser(){return!this.isSSR()}static hasAPI(t){return!this.isSSR()&&void 0!==window[t]}static getApex(){return"undefined"!=typeof window&&window.Apex?window.Apex:"undefined"!=typeof global&&global.Apex?global.Apex:{}}}class d{constructor(t,e=null){this.nodeName=t,this.namespaceURI=e,this.attributes=new Map,this.children=[],this.textContent="",this.style={},this.classList=new g,this.parentNode=null,this._ssrWidth=void 0,this._ssrHeight=void 0,this._ssrMode=void 0}setAttribute(t,e){this.attributes.set(t,e)}getAttribute(t){return this.attributes.get(t)}removeAttribute(t){this.attributes.delete(t)}hasAttribute(t){return this.attributes.has(t)}appendChild(t){if(t&&t!==this){if(t.parentNode&&t.parentNode!==this)t.parentNode.removeChild(t);else if(t.parentNode===this){const e=this.children.indexOf(t);-1!==e&&this.children.splice(e,1)}t.parentNode=this,this.children.push(t)}return t}removeChild(t){const e=this.children.indexOf(t);return-1!==e&&(this.children.splice(e,1),t.parentNode=null),t}insertBefore(t,e){if(!e)return this.appendChild(t);if(t.parentNode&&t.parentNode!==this)t.parentNode.removeChild(t);else if(t.parentNode===this){const e=this.children.indexOf(t);-1!==e&&this.children.splice(e,1)}const s=this.children.indexOf(e);return-1!==s&&(t.parentNode=this,this.children.splice(s,0,t)),t}cloneNode(t=!1){const e=new d(this.nodeName,this.namespaceURI);return e.textContent=this.textContent,this.attributes.forEach((t,s)=>{e.attributes.set(s,t)}),Object.assign(e.style,this.style),t&&this.children.forEach(t=>{t.cloneNode&&e.appendChild(t.cloneNode(!0))}),e}getBoundingClientRect(){return{width:this._ssrWidth||0,height:this._ssrHeight||0,top:0,left:0,right:this._ssrWidth||0,bottom:this._ssrHeight||0,x:0,y:0}}getRootNode(){let t=this;for(;t.parentNode;)t=t.parentNode;return t}querySelector(){return null}querySelectorAll(){return[]}getElementsByClassName(){return[]}addEventListener(){}removeEventListener(){}get childNodes(){return this.children}toString(){let t="";if(this.attributes.forEach((e,s)=>{t+=` ${s}="${e}"`}),0===this.children.length&&!this.textContent)return`<${this.nodeName}${t}/>`;const e=this.children.map(t=>t.toString()).join("");return`<${this.nodeName}${t}>${this.textContent}${e}${this.nodeName}>`}get innerHTML(){return this.children.map(t=>t.toString()).join("")}set innerHTML(t){this.children=[],this.textContent=t}get outerHTML(){return this.toString()}get isConnected(){return!0}}class g{constructor(){this.classes=new Set}add(...t){t.forEach(t=>this.classes.add(t))}remove(...t){t.forEach(t=>this.classes.delete(t))}contains(t){return this.classes.has(t)}toggle(t,e){return!0===e?(this.classes.add(t),!0):!1===e||this.classes.has(t)?(this.classes.delete(t),!1):(this.classes.add(t),!0)}toString(){return Array.from(this.classes).join(" ")}}class p{constructor(){this.SVGNS="http://www.w3.org/2000/svg",this.XLINKNS="http://www.w3.org/1999/xlink"}createElementNS(t,e){return new d(e,t)}createTextNode(t){const e={nodeName:"#text",nodeType:3,textContent:t,toString:()=>e.textContent};return e}querySelector(){return null}querySelectorAll(){return[]}getComputedStyle(){return{}}getBoundingClientRect(t){return t&&t.getBoundingClientRect?t.getBoundingClientRect():{width:0,height:0,top:0,left:0,right:0,bottom:0,x:0,y:0}}createXMLSerializer(){return{serializeToString:t=>t.toString?t.toString():""}}createDOMParser(){return{parseFromString(t,e){const s=new d("root");return s.innerHTML=t,{documentElement:s}}}}}let u=null,x=null,f=null;class b{static init(){c.isSSR()&&!u&&(u=new p)}static createElement(t){return c.isSSR()?(u||this.init(),u.createElementNS(null,t)):document.createElement(t)}static createElementNS(t,e){return c.isSSR()?(u||this.init(),u.createElementNS(t,e)):document.createElementNS(t,e)}static createTextNode(t){return c.isSSR()?(u||this.init(),u.createTextNode(t)):document.createTextNode(t)}static querySelector(t){return c.isSSR()?null:document.querySelector(t)}static querySelectorAll(t){return c.isSSR()?[]:document.querySelectorAll(t)}static getComputedStyle(t){return c.isSSR()?{}:window.getComputedStyle(t)}static getBoundingClientRect(t){return c.isSSR()?(u||this.init(),u.getBoundingClientRect(t)):t?t.getBoundingClientRect():{width:0,height:0,top:0,left:0,right:0,bottom:0,x:0,y:0}}static getXMLSerializer(){return c.isSSR()?(u||this.init(),x||(x=u.createXMLSerializer()),x):(x||(x=new XMLSerializer),x)}static getDOMParser(){return c.isSSR()?(u||this.init(),f||(f=u.createDOMParser()),f):(f||(f=new DOMParser),f)}static addWindowEventListener(t,e,s){c.isBrowser()&&window.addEventListener(t,e,s)}static removeWindowEventListener(t,e,s){c.isBrowser()&&window.removeEventListener(t,e,s)}static requestAnimationFrame(t){return c.isBrowser()?window.requestAnimationFrame(t):(t(0),null)}static cancelAnimationFrame(t){c.isBrowser()&&t&&window.cancelAnimationFrame(t)}static elementExists(t){return!!t&&(c.isSSR()?!0===t._ssrMode||void 0!==t.nodeName:!!t.getRootNode&&(t.getRootNode({composed:!0})===document||t.isConnected))}static getWindow(){return c.isBrowser()?window:null}static getDocument(){return c.isBrowser()?document:null}static _getShim(){return u}static _resetShim(){u=null,x=null,f=null}}let m=class t{static isObject(t){return t&&"object"==typeof t&&!Array.isArray(t)}static is(t,e){return Object.prototype.toString.call(e)==="[object "+t+"]"}static isSafari(){return c.isBrowser()&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}static extend(t,e){const s=Object.assign({},t);return this.isObject(t)&&this.isObject(e)&&Object.keys(e).forEach(i=>{this.isObject(e[i])?i in t?s[i]=this.extend(t[i],e[i]):Object.assign(s,{[i]:e[i]}):Object.assign(s,{[i]:e[i]})}),s}static extendArray(e,s){const i=[];return e.map(e=>{i.push(t.extend(s,e))}),e=i}static monthMod(t){return t%12}static clone(t,e=new WeakMap,s=!1){if(null===t||"object"!=typeof t)return t;if(e.has(t))return e.get(t);let i;if(Array.isArray(t))if(s)i=t.slice();else{i=[],e.set(t,i);for(let s=0;s(Array.isArray(e)&&(e=e.reduce((t,e)=>t.length>e.length?t:e)),t.length>e.length?t:e),0)}static hexToRgba(t="#999999",e=.6){"#"!==t.substring(0,1)&&(t="#999999");const s=t.replace("#",""),i=s.match(new RegExp("(.{"+s.length/3+"})","g"))||[];for(let t=0;tt+t).join("")),/^[0-9a-fA-F]{6}$/.test(e)?[parseInt(e.slice(0,2),16),parseInt(e.slice(2,4),16),parseInt(e.slice(4,6),16)]:null}static relativeLuminance([t,e,s]){const i=t=>{const e=t/255;return e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)};return.2126*i(t)+.7152*i(e)+.0722*i(s)}static getContrastRatio(e,s){const i=t.parseHex(e),a=t.parseHex(s);if(!i||!a)return 0;const o=t.relativeLuminance(i),r=t.relativeLuminance(a);return(Math.max(o,r)+.05)/(Math.min(o,r)+.05)}static rgb2hex(t){return(t=t.match(/^rgba?[\s+]?\([\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?/i))&&4===t.length?"#"+("0"+parseInt(t[1],10).toString(16)).slice(-2)+("0"+parseInt(t[2],10).toString(16)).slice(-2)+("0"+parseInt(t[3],10).toString(16)).slice(-2):""}shadeRGBColor(t,e){const s=e.split(","),i=t<0?0:255,a=t<0?-1*t:t,o=parseInt(s[0].slice(4),10),r=parseInt(s[1],10),n=parseInt(s[2],10);return"rgb("+(Math.round((i-o)*a)+o)+","+(Math.round((i-r)*a)+r)+","+(Math.round((i-n)*a)+n)+")"}shadeHexColor(t,e){const s=parseInt(e.slice(1),16),i=t<0?0:255,a=t<0?-1*t:t,o=s>>16,r=s>>8&255,n=255&s;return"#"+(16777216+65536*(Math.round((i-o)*a)+o)+256*(Math.round((i-r)*a)+r)+(Math.round((i-n)*a)+n)).toString(16).slice(1)}shadeColor(e,s){return t.isColorHex(s)?this.shadeHexColor(e,s):this.shadeRGBColor(e,s)}static isColorHex(t){return/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)|(^#[0-9A-F]{8}$)/i.test(t)}static isCSSVariable(t){if("string"!=typeof t)return!1;const e=t.trim();return e.startsWith("var(")&&e.endsWith(")")}static getThemeColor(e){if(!t.isCSSVariable(e))return e;if(c.isSSR())return e;const s=document.createElement("div");let i;s.style.cssText="position:fixed; left: -9999px; visibility:hidden;",s.style.color=e,document.body.appendChild(s);try{i=window.getComputedStyle(s).color}finally{s.parentNode&&s.parentNode.removeChild(s)}return i}static applyOpacityToColor(t,e){const s=Number(e);if(!Number.isFinite(s))return t;if(s<=0)return"transparent";if(s>=1)return t;return`color-mix(in srgb, ${t} ${Math.round(100*s)}%, transparent)`}static getPolygonPos(t,e){const s=[],i=2*Math.PI/e;for(let a=0;a{}[\]\\/]/gi,e),s}static negToZero(t){return t<0?0:t}static moveIndexInArray(t,e,s){if(s>=t.length){let e=s-t.length+1;for(;e--;)t.push(void 0)}return t.splice(s,0,t.splice(e,1)[0]),t}static extractNumber(t){return parseFloat(t.replace(/[^\d.]*/g,""))}static findAncestor(t,e){for(;(t=t.parentElement)&&!t.classList.contains(e););return t}static setELstyles(t,e){for(const s in e)Object.prototype.hasOwnProperty.call(e,s)&&(t.style.key=e[s])}static preciseAddition(t,e){const s=(String(t).split(".")[1]||"").length,i=(String(e).split(".")[1]||"").length,a=Math.pow(10,Math.max(s,i));return(Math.round(t*a)+Math.round(e*a))/a}static isNumber(t){return!isNaN(t)&&parseFloat(String(Number(t)))===t&&!isNaN(parseInt(t,10))}static isFloat(t){return Number(t)===t&&t%1!=0}static isMsEdge(){if(c.isSSR())return!1;const t=window.navigator.userAgent,e=t.indexOf("Edge/");return e>0&&parseInt(t.substring(e+5,t.indexOf(".",e)),10)}static getGCD(t,e,s=7){let i=Math.pow(10,s-Math.floor(Math.log10(Math.max(t,e))));for(i>1?(t=Math.round(Math.abs(t)*i),e=Math.round(Math.abs(e)*i)):i=1;e;){const s=e;e=t%e,t=s}return t/i}static getPrimeFactors(t){const e=[];let s=2;for(;t>=2;)t%s==0?(e.push(s),t/=s):s++;return e}static mod(t,e,s=7){const i=Math.pow(10,s-Math.floor(Math.log10(Math.max(t,e))));return(t=Math.round(Math.abs(t)*i))%(e=Math.round(Math.abs(e)*i))/i}};class y{constructor(t){this.w=t,this.months31=[1,3,5,7,8,10,12],this.months30=[2,4,6,9,11],this.daysCntOfYear=[0,31,59,90,120,151,181,212,243,273,304,334]}isValidDate(t){return"number"!=typeof t&&!isNaN(this.parseDate(t))}getTimeStamp(t){if(!Date.parse(t))return t;return this.w.config.xaxis.labels.datetimeUTC?new Date(new Date(t).toISOString().substr(0,25)).getTime():new Date(t).getTime()}getDate(t){return this.w.config.xaxis.labels.datetimeUTC?new Date(new Date(t).toUTCString()):new Date(t)}parseDate(t){const e=Date.parse(t);if(!isNaN(e))return this.getTimeStamp(t);let s=Date.parse(t.replace(/-/g,"/").replace(/[a-z]+/gi," "));return s=this.getTimeStamp(s),s}parseDateWithTimezone(t){return Date.parse(t.replace(/-/g,"/").replace(/[a-z]+/gi," "))}formatDate(t,e){const s=this.w.globals.locale,i=this.w.config.xaxis.labels.datetimeUTC,a=["\0",...s.months],o=["\x01",...s.shortMonths],r=["\x02",...s.days],n=["\x03",...s.shortDays];function l(t,e=2){let s=t+"";for(;s.length12?g-12:0===g?12:g;e=(e=(e=(e=e.replace(/(^|[^\\])HH+/g,"$1"+l(g))).replace(/(^|[^\\])H/g,"$1"+g)).replace(/(^|[^\\])hh+/g,"$1"+l(p))).replace(/(^|[^\\])h/g,"$1"+p);const u=i?t.getUTCMinutes():t.getMinutes();e=(e=e.replace(/(^|[^\\])mm+/g,"$1"+l(u))).replace(/(^|[^\\])m/g,"$1"+u);const x=i?t.getUTCSeconds():t.getSeconds();e=(e=e.replace(/(^|[^\\])ss+/g,"$1"+l(x))).replace(/(^|[^\\])s/g,"$1"+x);let f=i?t.getUTCMilliseconds():t.getMilliseconds();e=e.replace(/(^|[^\\])fff+/g,"$1"+l(f,3)),f=Math.round(f/10),e=e.replace(/(^|[^\\])ff/g,"$1"+l(f)),f=Math.round(f/10);const b=g<12?"AM":"PM";e=(e=(e=e.replace(/(^|[^\\])f/g,"$1"+f)).replace(/(^|[^\\])TT+/g,"$1"+b)).replace(/(^|[^\\])T/g,"$1"+b.charAt(0));const m=b.toLowerCase();e=(e=e.replace(/(^|[^\\])tt+/g,"$1"+m)).replace(/(^|[^\\])t/g,"$1"+m.charAt(0));let y=-t.getTimezoneOffset(),w=i||!y?"Z":y>0?"+":"-";if(!i){y=Math.abs(y);const t=y%60;w+=l(Math.floor(y/60))+":"+l(t)}e=e.replace(/(^|[^\\])K/g,"$1"+w);const v=(i?t.getUTCDay():t.getDay())+1;return e=(e=(e=(e=(e=e.replace(new RegExp(r[0],"g"),r[v])).replace(new RegExp(n[0],"g"),n[v])).replace(new RegExp(a[0],"g"),a[c])).replace(new RegExp(o[0],"g"),o[c])).replace(/\\(.)/g,"$1")}getTimeUnitsfromTimestamp(t,e){const s=this.w;void 0!==s.config.xaxis.min&&(t=s.config.xaxis.min),void 0!==s.config.xaxis.max&&(e=s.config.xaxis.max);const i=this.getDate(t),a=this.getDate(e),o=this.formatDate(i,"yyyy MM dd HH mm ss fff").split(" "),r=this.formatDate(a,"yyyy MM dd HH mm ss fff").split(" ");return{minMillisecond:parseInt(o[6],10),maxMillisecond:parseInt(r[6],10),minSecond:parseInt(o[5],10),maxSecond:parseInt(r[5],10),minMinute:parseInt(o[4],10),maxMinute:parseInt(r[4],10),minHour:parseInt(o[3],10),maxHour:parseInt(r[3],10),minDate:parseInt(o[2],10),maxDate:parseInt(r[2],10),minMonth:parseInt(o[1],10)-1,maxMonth:parseInt(r[1],10)-1,minYear:parseInt(o[0],10),maxYear:parseInt(r[0],10)}}isLeapYear(t){return t%4==0&&t%100!=0||t%400==0}calculcateLastDaysOfMonth(t,e,s){return this.determineDaysOfMonths(t,e)-s}determineDaysOfYear(t){let e=365;return this.isLeapYear(t)&&(e=366),e}determineRemainingDaysOfYear(t,e,s){let i=this.daysCntOfYear[e]+s;return e>1&&this.isLeapYear(t)&&i++,i}determineDaysOfMonths(t,e){let s=30;switch(t=m.monthMod(t),!0){case this.months30.indexOf(t)>-1:2===t&&(s=this.isLeapYear(e)?29:28);break;case this.months31.indexOf(t)>-1:default:s=31}return s}getDateFields(t,e){const s=new Date(t);return e?{year:s.getUTCFullYear(),month:s.getUTCMonth(),date:s.getUTCDate(),hour:s.getUTCHours(),minute:s.getUTCMinutes(),second:s.getUTCSeconds(),ms:s.getUTCMilliseconds(),weekday:s.getUTCDay()}:{year:s.getFullYear(),month:s.getMonth(),date:s.getDate(),hour:s.getHours(),minute:s.getMinutes(),second:s.getSeconds(),ms:s.getMilliseconds(),weekday:s.getDay()}}addInterval(t,e,s,i){const a=new Date(t);if(i)switch(e){case"year":a.setUTCFullYear(a.getUTCFullYear()+s);break;case"month":a.setUTCMonth(a.getUTCMonth()+s);break;case"week":a.setUTCDate(a.getUTCDate()+7*s);break;case"day":a.setUTCDate(a.getUTCDate()+s);break;case"hour":a.setUTCHours(a.getUTCHours()+s);break;case"minute":a.setUTCMinutes(a.getUTCMinutes()+s);break;case"second":a.setUTCSeconds(a.getUTCSeconds()+s)}else switch(e){case"year":a.setFullYear(a.getFullYear()+s);break;case"month":a.setMonth(a.getMonth()+s);break;case"week":a.setDate(a.getDate()+7*s);break;case"day":a.setDate(a.getDate()+s);break;case"hour":a.setHours(a.getHours()+s);break;case"minute":a.setMinutes(a.getMinutes()+s);break;case"second":a.setSeconds(a.getSeconds()+s)}return a.getTime()}ceilToBoundary(t,e,s,i){const a=new Date(t);if(i)switch(e){case"second":{const e=a.getUTCSeconds(),i=Math.ceil(e/s)*s;return i===e&&0===a.getUTCMilliseconds()?t:(a.setUTCMilliseconds(0),a.setUTCSeconds(i),a.getTime())}case"minute":{const e=a.getUTCMinutes(),i=Math.ceil(e/s)*s;return i===e&&0===a.getUTCSeconds()&&0===a.getUTCMilliseconds()?t:(a.setUTCMilliseconds(0),a.setUTCSeconds(0),a.setUTCMinutes(i),a.getTime())}case"hour":{const e=a.getUTCHours(),i=Math.ceil(e/s)*s;return i===e&&0===a.getUTCMinutes()&&0===a.getUTCSeconds()&&0===a.getUTCMilliseconds()?t:(a.setUTCMilliseconds(0),a.setUTCSeconds(0),a.setUTCMinutes(0),a.setUTCHours(i),a.getTime())}case"day":return 0===a.getUTCHours()&&0===a.getUTCMinutes()&&0===a.getUTCSeconds()&&0===a.getUTCMilliseconds()?t:(a.setUTCMilliseconds(0),a.setUTCSeconds(0),a.setUTCMinutes(0),a.setUTCHours(0),a.setUTCDate(a.getUTCDate()+1),a.getTime());case"week":{const e=6048e5,i=Date.UTC(1970,0,5);a.setUTCMilliseconds(0),a.setUTCSeconds(0),a.setUTCMinutes(0),a.setUTCHours(0);const o=a.getTime(),r=Math.ceil((o-i)/e),n=i+Math.ceil(r/s)*s*e;return n>=t?n:n+s*e}case"month":{const e=a.getUTCMonth(),i=Math.ceil(e/s)*s;return i===e&&1===a.getUTCDate()&&0===a.getUTCHours()&&0===a.getUTCMinutes()&&0===a.getUTCSeconds()&&0===a.getUTCMilliseconds()?t:(a.setUTCMilliseconds(0),a.setUTCSeconds(0),a.setUTCMinutes(0),a.setUTCHours(0),a.setUTCDate(1),a.setUTCMonth(i),a.getTime())}case"year":{const e=a.getUTCFullYear(),i=Math.ceil(e/s)*s;return i===e&&0===a.getUTCMonth()&&1===a.getUTCDate()&&0===a.getUTCHours()&&0===a.getUTCMinutes()&&0===a.getUTCSeconds()&&0===a.getUTCMilliseconds()?t:Date.UTC(i,0,1)}}else switch(e){case"second":{const e=a.getSeconds(),i=Math.ceil(e/s)*s;return i===e&&0===a.getMilliseconds()?t:(a.setMilliseconds(0),a.setSeconds(i),a.getTime())}case"minute":{const e=a.getMinutes(),i=Math.ceil(e/s)*s;return i===e&&0===a.getSeconds()&&0===a.getMilliseconds()?t:(a.setMilliseconds(0),a.setSeconds(0),a.setMinutes(i),a.getTime())}case"hour":{const e=a.getHours(),i=Math.ceil(e/s)*s;return i===e&&0===a.getMinutes()&&0===a.getSeconds()&&0===a.getMilliseconds()?t:(a.setMilliseconds(0),a.setSeconds(0),a.setMinutes(0),a.setHours(i),a.getTime())}case"day":return 0===a.getHours()&&0===a.getMinutes()&&0===a.getSeconds()&&0===a.getMilliseconds()?t:(a.setMilliseconds(0),a.setSeconds(0),a.setMinutes(0),a.setHours(0),a.setDate(a.getDate()+1),a.getTime());case"week":{const e=6048e5,i=new Date(1970,0,5).getTime();a.setMilliseconds(0),a.setSeconds(0),a.setMinutes(0),a.setHours(0);const o=a.getTime(),r=Math.ceil((o-i)/e),n=i+Math.ceil(r/s)*s*e;return n>=t?n:n+s*e}case"month":{const e=a.getMonth(),i=Math.ceil(e/s)*s;return i===e&&1===a.getDate()&&0===a.getHours()&&0===a.getMinutes()&&0===a.getSeconds()&&0===a.getMilliseconds()?t:(a.setMilliseconds(0),a.setSeconds(0),a.setMinutes(0),a.setHours(0),a.setDate(1),a.setMonth(i),a.getTime())}case"year":{const e=a.getFullYear(),i=Math.ceil(e/s)*s;return i===e&&0===a.getMonth()&&1===a.getDate()&&0===a.getHours()&&0===a.getMinutes()&&0===a.getSeconds()&&0===a.getMilliseconds()?t:new Date(i,0,1).getTime()}}return t}isAtBoundary(t,e,s){const i=this.getDateFields(t,s);switch(e){case"year":return 0===i.month&&1===i.date&&0===i.hour&&0===i.minute&&0===i.second&&0===i.ms;case"month":return 1===i.date&&0===i.hour&&0===i.minute&&0===i.second&&0===i.ms;case"day":return 0===i.hour&&0===i.minute&&0===i.second&&0===i.ms;case"hour":return 0===i.minute&&0===i.second&&0===i.ms;case"minute":return 0===i.second&&0===i.ms;case"second":return 0===i.ms}return!1}}class w{constructor(t){this.w=t,this.tooltipKeyFormat="dd MMM"}xLabelFormat(t,e,s,i){const a=this.w;if("datetime"===a.config.xaxis.type&&void 0===a.config.xaxis.labels.formatter&&void 0===a.config.tooltip.x.formatter){const t=new y(this.w);return t.formatDate(t.getDate(e),a.config.tooltip.x.format)}return t(e,s,i)}defaultGeneralFormatter(t){return Array.isArray(t)?t.map(t=>t):t}defaultYFormatter(t,e){const s=this.w;if(m.isNumber(t))if(0!==s.globals.yValueDecimal)t=t.toFixed(void 0!==e.decimalsInFloat?e.decimalsInFloat:s.globals.yValueDecimal);else{const e=t.toFixed(0);t=Number(e)===t?e:t.toFixed(1)}return t}setLabelFormatters(){const t=this.w,e=t.formatters;return e.xaxisTooltipFormatter=t=>this.defaultGeneralFormatter(t),e.ttKeyFormatter=t=>this.defaultGeneralFormatter(t),e.ttZFormatter=t=>t,e.legendFormatter=t=>this.defaultGeneralFormatter(t),void 0!==t.config.xaxis.labels.formatter?e.xLabelFormatter=t.config.xaxis.labels.formatter:e.xLabelFormatter=e=>{if(m.isNumber(e)){if(!t.config.xaxis.convertedCatToNumeric&&"numeric"===t.config.xaxis.type){if(m.isNumber(t.config.xaxis.decimalsInFloat))return e.toFixed(t.config.xaxis.decimalsInFloat);{const s=t.globals.maxX-t.globals.minX;if(s>0){const t=s/10,i=Math.max(0,-Math.floor(Math.log10(t)));return e.toFixed(i)}return e.toFixed(0)}}if(t.globals.isBarHorizontal){if(t.globals.maxY-t.globals.minYArr<4)return e.toFixed(1)}return e.toFixed(0)}return e},"function"==typeof t.config.tooltip.x.formatter?e.ttKeyFormatter=t.config.tooltip.x.formatter:e.ttKeyFormatter=e.xLabelFormatter,"function"==typeof t.config.xaxis.tooltip.formatter&&(e.xaxisTooltipFormatter=t.config.xaxis.tooltip.formatter),(Array.isArray(t.config.tooltip.y)||void 0!==t.config.tooltip.y.formatter)&&(e.ttVal=t.config.tooltip.y),void 0!==t.config.tooltip.z.formatter&&(e.ttZFormatter=t.config.tooltip.z.formatter),void 0!==t.config.legend.formatter&&(e.legendFormatter=t.config.legend.formatter),e.yLabelFormatters=[],t.config.yaxis.forEach((s,i)=>{void 0!==s.labels.formatter?e.yLabelFormatters[i]=s.labels.formatter:e.yLabelFormatters[i]=e=>t.globals.xyCharts?Array.isArray(e)?e.map(t=>this.defaultYFormatter(t,s)):this.defaultYFormatter(e,s):e}),t.globals}heatmapLabelFormatters(){const t=this.w;if("heatmap"===t.config.chart.type){t.globals.yAxisScale[0].result=t.seriesData.seriesNames.slice();const e=t.seriesData.seriesNames.reduce((t,e)=>t.length>e.length?t:e,0);t.globals.yAxisScale[0].niceMax=e,t.globals.yAxisScale[0].niceMin=e}}}const v=({isTimeline:t,seriesIndex:e,dataPointIndex:s,y1:i,y2:a,w:o})=>{var r;let n=o.rangeData.seriesRangeStart[e][s],l=o.rangeData.seriesRangeEnd[e][s],h=o.labelData.labels[s],c=o.config.series[e].name?o.config.series[e].name:"";const d=o.formatters.ttKeyFormatter,g=o.config.tooltip.y.title.formatter,p={w:o,seriesIndex:e,dataPointIndex:s,start:n,end:l};if("function"==typeof g&&(c=g(c,p)),(null==(r=o.config.series[e].data[s])?void 0:r.x)&&(h=o.config.series[e].data[s].x),!t&&"datetime"===o.config.xaxis.type){h=new w(o).xLabelFormat(o.formatters.ttKeyFormatter,h,h,{i:void 0,dateFormatter:new y(o).formatDate,w:o})}"function"==typeof d&&(h=d(h,p)),Number.isFinite(i)&&Number.isFinite(a)&&(n=i,l=a);let u="",x="";const f=o.globals.colors[e];if(void 0===o.config.tooltip.x.formatter)if("datetime"===o.config.xaxis.type){const t=new y(o);u=t.formatDate(t.getDate(n),o.config.tooltip.x.format),x=t.formatDate(t.getDate(l),o.config.tooltip.x.format)}else u=n,x=l;else u=o.config.tooltip.x.formatter(n),x=o.config.tooltip.x.formatter(l);return{start:n,end:l,startVal:u,endVal:x,ylabel:h,color:f,seriesName:c}},A=t=>{let{color:e,seriesName:s,ylabel:i,start:a,end:o,seriesIndex:r,dataPointIndex:n}=t;const l=t.w.globals.tooltip.tooltipLabels.getFormatters(r);a=l.yLbFormatter(a),o=l.yLbFormatter(o);const h=l.yLbFormatter(t.w.seriesData.series[r][n]);let c="";const d=`\n ${a}\n - \n ${o}\n `;return c=t.w.globals.comboCharts?"rangeArea"===t.w.config.series[r].type||"rangeBar"===t.w.config.series[r].type?d:`${h} `:d,'"};class C{constructor(t){this.opts=t}hideYAxis(){this.opts.yaxis[0].show=!1,this.opts.yaxis[0].title.text="",this.opts.yaxis[0].axisBorder.show=!1,this.opts.yaxis[0].axisTicks.show=!1,this.opts.yaxis[0].floating=!0}line(){return{dataLabels:{enabled:!1},stroke:{width:5,curve:"straight"},markers:{size:0,hover:{sizeOffset:6}},xaxis:{crosshairs:{width:1}}}}sparkline(t){this.hideYAxis();return m.extend(t,{grid:{show:!1,padding:{left:0,right:0,top:0,bottom:0}},legend:{show:!1},xaxis:{labels:{show:!1},tooltip:{enabled:!1},axisBorder:{show:!1},axisTicks:{show:!1}},chart:{toolbar:{show:!1},zoom:{enabled:!1}},dataLabels:{enabled:!1}})}slope(){return this.hideYAxis(),{chart:{toolbar:{show:!1},zoom:{enabled:!1}},dataLabels:{enabled:!0,formatter(t,e){const s=e.w.config.series[e.seriesIndex].name;return null!==t?s+": "+t:""},background:{enabled:!1},offsetX:-5},grid:{xaxis:{lines:{show:!0}},yaxis:{lines:{show:!1}}},xaxis:{position:"top",labels:{style:{fontSize:14,fontWeight:900}},tooltip:{enabled:!1},crosshairs:{show:!1}},markers:{size:8,hover:{sizeOffset:1}},legend:{show:!1},tooltip:{shared:!1,intersect:!0,followCursor:!0},stroke:{width:5,curve:"straight"}}}bar(){return{chart:{stacked:!1},plotOptions:{bar:{dataLabels:{position:"center"}}},dataLabels:{style:{colors:["#fff"]},background:{enabled:!1}},stroke:{width:0,lineCap:"square"},fill:{opacity:.85},legend:{markers:{shape:"square"}},tooltip:{shared:!1,intersect:!0},xaxis:{tooltip:{enabled:!1},tickPlacement:"between",crosshairs:{width:"barWidth",position:"back",fill:{type:"gradient"},dropShadow:{enabled:!1},stroke:{width:0}}}}}funnel(){return this.hideYAxis(),l(n({},this.bar()),{chart:{animations:{speed:800,animateGradually:{enabled:!1}}},plotOptions:{bar:{horizontal:!0,borderRadiusApplication:"around",borderRadius:0,dataLabels:{position:"center"}}},grid:{show:!1,padding:{left:0,right:0}},xaxis:{labels:{show:!1},tooltip:{enabled:!1},axisBorder:{show:!1},axisTicks:{show:!1}}})}pyramid(){return this.funnel()}gauge(){const t=this.radialBar();return l(n({},t),{plotOptions:{radialBar:{startAngle:-135,endAngle:135,hollow:{margin:0,size:"60%"},track:{background:"#e7e7e7",strokeWidth:"100%",margin:5},dataLabels:{name:{show:!1},value:{show:!0,fontSize:"32px",fontWeight:600,offsetY:8}}}}})}candlestick(){return{stroke:{width:1},fill:{opacity:1},dataLabels:{enabled:!1},tooltip:{shared:!0,custom:({seriesIndex:t,dataPointIndex:e,w:s})=>this._getBoxTooltip(s,t,e,["Open","High","","Low","Close"],"candlestick")},states:{active:{filter:{type:"none"}}},xaxis:{crosshairs:{width:1}}}}boxPlot(){return{chart:{animations:{dynamicAnimation:{enabled:!1}}},stroke:{width:1,colors:["#24292e"]},dataLabels:{enabled:!1},tooltip:{shared:!0,custom:({seriesIndex:t,dataPointIndex:e,w:s})=>this._getBoxTooltip(s,t,e,["Minimum","Q1","Median","Q3","Maximum"],"boxPlot")},markers:{size:7,strokeWidth:1,strokeColors:"#111"},xaxis:{crosshairs:{width:1}}}}rangeBar(){return{chart:{animations:{animateGradually:!1}},stroke:{width:0,lineCap:"square"},plotOptions:{bar:{borderRadius:0,dataLabels:{position:"center"}}},dataLabels:{enabled:!1,formatter(t,{seriesIndex:e,dataPointIndex:s,w:i}){const a=()=>{const t=i.rangeData.seriesRangeStart[e][s];return i.rangeData.seriesRangeEnd[e][s]-t};return i.globals.comboCharts?"rangeBar"===i.config.series[e].type||"rangeArea"===i.config.series[e].type?a():t:a()},background:{enabled:!1},style:{colors:["#fff"]}},markers:{size:10},tooltip:{shared:!1,followCursor:!0,custom:t=>t.w.config.plotOptions&&t.w.config.plotOptions.bar&&t.w.config.plotOptions.bar.horizontal?(t=>{const{color:e,seriesName:s,ylabel:i,startVal:a,endVal:o}=v(l(n({},t),{isTimeline:!0}));return A(l(n({},t),{color:e,seriesName:s,ylabel:i,start:a,end:o}))})(t):(t=>{const{color:e,seriesName:s,ylabel:i,start:a,end:o}=v(t);return A(l(n({},t),{color:e,seriesName:s,ylabel:i,start:a,end:o}))})(t)},xaxis:{tickPlacement:"between",tooltip:{enabled:!1},crosshairs:{stroke:{width:0}}}}}dumbbell(t){var e,s;return(null==(e=t.plotOptions.bar)?void 0:e.barHeight)||(t.plotOptions.bar.barHeight=2),(null==(s=t.plotOptions.bar)?void 0:s.columnWidth)||(t.plotOptions.bar.columnWidth=2),t}area(){return{stroke:{width:4,fill:{type:"solid",gradient:{inverseColors:!1,shade:"light",type:"vertical",opacityFrom:.65,opacityTo:.5,stops:[0,100,100]}}},fill:{type:"gradient",gradient:{inverseColors:!1,shade:"light",type:"vertical",opacityFrom:.65,opacityTo:.5,stops:[0,100,100]}},markers:{size:0,hover:{sizeOffset:6}},tooltip:{followCursor:!1}}}rangeArea(){return{stroke:{curve:"straight",width:0},fill:{type:"solid",opacity:.6},markers:{size:0},states:{hover:{filter:{type:"none"}},active:{filter:{type:"none"}}},tooltip:{intersect:!1,shared:!0,followCursor:!0,custom:t=>(t=>{const{color:e,seriesName:s,ylabel:i,start:a,end:o}=v(t);return A(l(n({},t),{color:e,seriesName:s,ylabel:i,start:a,end:o}))})(t)}}}brush(t){return m.extend(t,{chart:{toolbar:{autoSelected:"selection",show:!1},zoom:{enabled:!1}},dataLabels:{enabled:!1},stroke:{width:1},tooltip:{enabled:!1},xaxis:{tooltip:{enabled:!1}}})}stacked100(t){t.dataLabels=t.dataLabels||{},t.dataLabels.formatter=t.dataLabels.formatter||void 0;const e=t.dataLabels.formatter;t.yaxis.forEach((e,s)=>{t.yaxis[s].min=0,t.yaxis[s].max=100});return"bar"===t.chart.type&&(t.dataLabels.formatter=e||function(t){return"number"==typeof t&&t?t.toFixed(0)+"%":t}),t}stackedBars(){const t=this.bar();return l(n({},t),{plotOptions:l(n({},t.plotOptions),{bar:l(n({},t.plotOptions.bar),{borderRadiusApplication:"end",borderRadiusWhenStacked:"last"})})})}convertCatToNumeric(t){return t.xaxis.convertedCatToNumeric=!0,t}convertCatToNumericXaxis(t,e){t.xaxis.type="numeric",t.xaxis.labels=t.xaxis.labels||{},t.xaxis.labels.formatter=t.xaxis.labels.formatter||function(t){return m.isNumber(t)?Math.floor(t):t};const s=t.xaxis.labels.formatter;let i=t.xaxis.categories&&t.xaxis.categories.length?t.xaxis.categories:t.labels;return e&&e.length&&(i=e.map(t=>Array.isArray(t)?t:String(t))),i&&i.length&&(t.xaxis.labels.formatter=function(t){return m.isNumber(t)?s(i[Math.floor(t)-1]):s(t)}),t.xaxis.categories=[],t.labels=[],t.xaxis.tickAmount=t.xaxis.tickAmount||"dataPoints",t}bubble(){return{dataLabels:{style:{colors:["#fff"]}},tooltip:{shared:!1,intersect:!0},xaxis:{crosshairs:{width:0}},fill:{type:"solid",gradient:{shade:"light",inverse:!0,shadeIntensity:.55,opacityFrom:.4,opacityTo:.8}}}}scatter(){return{dataLabels:{enabled:!1},tooltip:{shared:!1,intersect:!0},markers:{size:6,strokeWidth:1,hover:{sizeOffset:2}}}}heatmap(){return{chart:{stacked:!1},fill:{opacity:1},dataLabels:{style:{colors:["#fff"]}},stroke:{colors:["#fff"]},tooltip:{followCursor:!0,marker:{show:!1},x:{show:!1}},legend:{position:"top",markers:{shape:"square"}},grid:{padding:{right:20}}}}treemap(){return{chart:{zoom:{enabled:!1}},dataLabels:{style:{fontSize:14,fontWeight:600,colors:["#fff"]}},stroke:{show:!0,width:2,colors:["#fff"]},legend:{show:!1},fill:{opacity:1,gradient:{stops:[0,100]}},tooltip:{followCursor:!0,x:{show:!1}},grid:{padding:{left:0,right:0}},xaxis:{crosshairs:{show:!1},tooltip:{enabled:!1}}}}pie(){return{chart:{toolbar:{show:!1}},plotOptions:{pie:{donut:{labels:{show:!1}}}},dataLabels:{formatter:t=>t.toFixed(1)+"%",style:{colors:["#fff"]},background:{enabled:!1},dropShadow:{enabled:!0}},stroke:{colors:["#fff"]},fill:{opacity:1,gradient:{shade:"light",stops:[0,100]}},tooltip:{theme:"dark",fillSeriesColor:!0},legend:{position:"right"},grid:{padding:{left:0,right:0,top:0,bottom:0}}}}donut(){return{chart:{toolbar:{show:!1}},dataLabels:{formatter:t=>t.toFixed(1)+"%",style:{colors:["#fff"]},background:{enabled:!1},dropShadow:{enabled:!0}},stroke:{colors:["#fff"]},fill:{opacity:1,gradient:{shade:"light",shadeIntensity:.35,stops:[80,100],opacityFrom:1,opacityTo:1}},tooltip:{theme:"dark",fillSeriesColor:!0},legend:{position:"right"},grid:{padding:{left:0,right:0,top:0,bottom:0}}}}polarArea(){return{chart:{toolbar:{show:!1}},dataLabels:{formatter:t=>t.toFixed(1)+"%",enabled:!1},stroke:{show:!0,width:2},fill:{opacity:.7},tooltip:{theme:"dark",fillSeriesColor:!0},legend:{position:"right"},grid:{padding:{left:0,right:0,top:0,bottom:0}}}}radar(){return this.opts.yaxis[0].labels.offsetY=this.opts.yaxis[0].labels.offsetY?this.opts.yaxis[0].labels.offsetY:6,{dataLabels:{enabled:!1,style:{fontSize:"11px"}},stroke:{width:2},markers:{size:5,strokeWidth:1,strokeOpacity:1},fill:{opacity:.2},tooltip:{shared:!1,intersect:!0,followCursor:!0},grid:{show:!1,padding:{left:0,right:0,top:0,bottom:0}},xaxis:{labels:{formatter:t=>t,style:{colors:["#a8a8a8"],fontSize:"11px"}},tooltip:{enabled:!1},crosshairs:{show:!1}}}}radialBar(){return{chart:{animations:{dynamicAnimation:{enabled:!0,speed:800}},toolbar:{show:!1}},stroke:{lineCap:"butt"},fill:{gradient:{shade:"dark",shadeIntensity:.4,inverseColors:!1,type:"diagonal2",opacityFrom:1,opacityTo:1,stops:[70,98,100]}},legend:{show:!1,position:"right"},tooltip:{enabled:!1,fillSeriesColor:!0},grid:{padding:{left:0,right:0,top:0,bottom:0}}}}_getBoxTooltip(t,e,s,i,a){const o=t.candleData.seriesCandleO[e][s],r=t.candleData.seriesCandleH[e][s],n=t.candleData.seriesCandleM[e][s],l=t.candleData.seriesCandleL[e][s],h=t.candleData.seriesCandleC[e][s],c=t.config.series[e];return c.type&&c.type!==a?`\n ${c.name?c.name:"series-"+(e+1)}: ${t.seriesData.series[e][s]} \n
`:`"}}const S={name:"en",options:{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"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],toolbar:{exportToSVG:"Download SVG",exportToPNG:"Download PNG",exportToCSV:"Download CSV",menu:"Menu",selection:"Selection",selectionZoom:"Selection Zoom",zoomIn:"Zoom In",zoomOut:"Zoom Out",pan:"Panning",reset:"Reset Zoom"}}};class k{constructor(){this.yAxis={show:!0,showAlways:!1,showForNullSeries:!0,seriesName:void 0,opposite:!1,reversed:!1,logarithmic:!1,logBase:10,tickAmount:void 0,stepSize:void 0,forceNiceScale:!1,alignZero:!1,max:void 0,min:void 0,floating:!1,decimalsInFloat:void 0,labels:{show:!0,showDuplicates:!1,minWidth:0,maxWidth:160,offsetX:0,offsetY:0,align:void 0,rotate:0,padding:20,style:{colors:[],fontSize:"11px",fontWeight:400,fontFamily:void 0,cssClass:""},formatter:void 0},axisBorder:{show:!1,color:"#e0e0e0",width:1,offsetX:0,offsetY:0},axisTicks:{show:!1,color:"#e0e0e0",width:6,offsetX:0,offsetY:0},title:{text:void 0,rotate:-90,offsetY:0,offsetX:0,style:{color:void 0,fontSize:"11px",fontWeight:900,fontFamily:void 0,cssClass:""}},tooltip:{enabled:!1,offsetX:0},crosshairs:{show:!0,position:"front",stroke:{color:"#b6b6b6",width:1,dashArray:0}}},this.pointAnnotation={id:void 0,x:0,y:null,yAxisIndex:0,seriesIndex:void 0,mouseEnter:void 0,mouseLeave:void 0,click:void 0,marker:{size:4,fillColor:"#fff",strokeWidth:2,strokeColor:"#333",shape:"circle",offsetX:0,offsetY:0,cssClass:""},label:{borderColor:"#c2c2c2",borderWidth:1,borderRadius:2,text:void 0,textAnchor:"middle",offsetX:0,offsetY:0,mouseEnter:void 0,mouseLeave:void 0,click:void 0,style:{background:"#fff",color:void 0,fontSize:"11px",fontFamily:void 0,fontWeight:400,cssClass:"",padding:{left:5,right:5,top:2,bottom:2}}},customSVG:{SVG:void 0,cssClass:void 0,offsetX:0,offsetY:0},image:{path:void 0,width:20,height:20,offsetX:0,offsetY:0}},this.yAxisAnnotation={id:void 0,y:0,y2:null,strokeDashArray:1,fillColor:"#c2c2c2",borderColor:"#c2c2c2",borderWidth:1,opacity:.3,offsetX:0,offsetY:0,width:"100%",yAxisIndex:0,label:{borderColor:"#c2c2c2",borderWidth:1,borderRadius:2,text:void 0,textAnchor:"end",position:"right",offsetX:0,offsetY:-3,mouseEnter:void 0,mouseLeave:void 0,click:void 0,style:{background:"#fff",color:void 0,fontSize:"11px",fontFamily:void 0,fontWeight:400,cssClass:"",padding:{left:5,right:5,top:2,bottom:2}}}},this.xAxisAnnotation={id:void 0,x:0,x2:null,strokeDashArray:1,fillColor:"#c2c2c2",borderColor:"#c2c2c2",borderWidth:1,opacity:.3,offsetX:0,offsetY:0,label:{borderColor:"#c2c2c2",borderWidth:1,borderRadius:2,text:void 0,textAnchor:"middle",orientation:"vertical",position:"top",offsetX:0,offsetY:0,mouseEnter:void 0,mouseLeave:void 0,click:void 0,style:{background:"#fff",color:void 0,fontSize:"11px",fontFamily:void 0,fontWeight:400,cssClass:"",padding:{left:5,right:5,top:2,bottom:2}}}},this.text={x:0,y:0,text:"",textAnchor:"start",foreColor:void 0,fontSize:"13px",fontFamily:void 0,fontWeight:400,appendTo:".apexcharts-annotations",backgroundColor:"transparent",borderColor:"#c2c2c2",borderRadius:0,borderWidth:0,paddingLeft:4,paddingRight:4,paddingTop:2,paddingBottom:2}}init(){return{annotations:{yaxis:[this.yAxisAnnotation],xaxis:[this.xAxisAnnotation],points:[this.pointAnnotation],texts:[],images:[],shapes:[]},chart:{animations:{enabled:!0,speed:800,animateGradually:{delay:150,enabled:!0},dynamicAnimation:{enabled:!0,speed:350},chartTypeMorph:{enabled:!0,speed:600},respectReducedMotion:!0},background:"",locales:[S],defaultLocale:"en",dropShadow:{enabled:!1,enabledOnSeries:void 0,top:2,left:2,blur:4,color:"#000",opacity:.7},events:{animationEnd:void 0,beforeMount:void 0,mounted:void 0,updated:void 0,click:void 0,mouseMove:void 0,mouseLeave:void 0,xAxisLabelClick:void 0,legendClick:void 0,markerClick:void 0,selection:void 0,dataPointSelection:void 0,dataPointMouseEnter:void 0,dataPointMouseLeave:void 0,beforeZoom:void 0,beforeResetZoom:void 0,zoomed:void 0,scrolled:void 0,brushScrolled:void 0,keyDown:void 0,keyUp:void 0},foreColor:"#373d3f",fontFamily:"Helvetica, Arial, sans-serif",height:"auto",parentHeightOffset:15,redrawOnParentResize:!0,redrawOnWindowResize:!0,id:void 0,group:void 0,nonce:void 0,offsetX:0,offsetY:0,injectStyleSheet:!0,selection:{enabled:!1,type:"x",fill:{color:"#24292e",opacity:.1},stroke:{width:1,color:"#24292e",opacity:.4,dashArray:3},xaxis:{min:void 0,max:void 0},yaxis:{min:void 0,max:void 0}},sparkline:{enabled:!1},brush:{enabled:!1,autoScaleYaxis:!0,target:void 0,targets:void 0},stacked:!1,stackOnlyBar:!0,stackType:"normal",toolbar:{show:!0,offsetX:0,offsetY:0,tools:{download:!0,selection:!0,zoom:!0,zoomin:!0,zoomout:!0,pan:!0,reset:!0,customIcons:[]},export:{csv:{filename:void 0,columnDelimiter:",",headerCategory:"category",headerValue:"value",categoryFormatter:void 0,valueFormatter:void 0},png:{filename:void 0},svg:{filename:void 0},scale:void 0,width:void 0},autoSelected:"zoom"},type:"line",width:"100%",zoom:{enabled:!0,type:"x",autoScaleYaxis:!1,allowMouseWheelZoom:!0,zoomedArea:{fill:{color:"#90CAF9",opacity:.4},stroke:{color:"#0D47A1",opacity:.4,width:1}}},accessibility:{enabled:!0,description:void 0,announcements:{enabled:!0},keyboard:{enabled:!0,navigation:{enabled:!0,wrapAround:!1}}},dataReducer:{enabled:!1,algorithm:"lttb",targetPoints:250,threshold:500}},parsing:{x:void 0,y:void 0},plotOptions:{line:{isSlopeChart:!1,colors:{threshold:0,colorAboveThreshold:void 0,colorBelowThreshold:void 0}},area:{fillTo:"origin"},bar:{horizontal:!1,columnWidth:"70%",barHeight:"70%",distributed:!1,borderRadius:0,borderRadiusApplication:"around",borderRadiusWhenStacked:"last",rangeBarOverlap:!0,rangeBarGroupRows:!1,hideZeroBarsWhenGrouped:!1,isDumbbell:!1,dumbbellColors:void 0,isFunnel:!1,isFunnel3d:!0,colors:{ranges:[],backgroundBarColors:[],backgroundBarOpacity:1,backgroundBarRadius:0},dataLabels:{position:"top",maxItems:100,hideOverflowingLabels:!0,orientation:"horizontal",total:{enabled:!1,formatter:void 0,offsetX:0,offsetY:0,style:{color:"#373d3f",fontSize:"12px",fontFamily:void 0,fontWeight:600}}}},bubble:{zScaling:!0,minBubbleRadius:void 0,maxBubbleRadius:void 0},candlestick:{colors:{upward:"#00B746",downward:"#EF403C"},wick:{useFillColor:!0}},boxPlot:{colors:{upper:"#00E396",lower:"#008FFB"}},heatmap:{radius:2,enableShades:!0,shadeIntensity:.5,reverseNegativeShade:!1,distributed:!1,useFillColorAsStroke:!1,colorScale:{inverse:!1,ranges:[],min:void 0,max:void 0,gradientLegend:{enabled:!1,width:"70%",height:"70%",thickness:12,align:"center",stops:16,showLabels:!0,showHoverValue:!0,labelStyle:{fontSize:"11px",fontFamily:void 0,colors:void 0},arrow:{size:8,color:void 0},formatter:void 0}}},funnel:{shape:"rectangle",lastShape:"flat"},treemap:{enableShades:!0,shadeIntensity:.5,distributed:!1,reverseNegativeShade:!1,useFillColorAsStroke:!1,borderRadius:4,dataLabels:{format:"scale"},colorScale:{inverse:!1,ranges:[],min:void 0,max:void 0},seriesTitle:{show:!0,offsetY:1,offsetX:1,borderColor:"#000",borderWidth:1,borderRadius:2,style:{background:"rgba(0, 0, 0, 0.6)",color:"#fff",fontSize:"12px",fontFamily:void 0,fontWeight:400,cssClass:"",padding:{left:6,right:6,top:2,bottom:2}}}},radialBar:{inverseOrder:!1,startAngle:0,endAngle:360,offsetX:0,offsetY:0,shape:"arc",min:0,max:100,bands:[],bandsStyle:{strokeWidth:"40%",gap:0,hideTrackWhenPresent:!0},ticks:{show:!1,major:{count:11,length:10,width:2,color:"#666",placement:"outside"},minor:{count:4,length:5,width:1,color:"#999",placement:"outside"},labels:{show:!1,offset:6,fontSize:"11px",fontFamily:void 0,fontWeight:400,color:"#666",formatter:t=>String(t)}},needle:{color:"#333",length:"85%",baseWidth:4,tipWidth:1,offsetY:0,showValueArc:!1,animation:{enabled:!0,duration:800,easing:"ease-out"}},hollow:{margin:5,size:"50%",background:"transparent",image:void 0,imageWidth:150,imageHeight:150,imageOffsetX:0,imageOffsetY:0,imageClipped:!0,position:"front",stroke:void 0,strokeWidth:1,strokeDasharray:void 0,dropShadow:{enabled:!1,top:0,left:0,blur:3,color:"#000",opacity:.5}},track:{show:!0,startAngle:void 0,endAngle:void 0,background:"#f2f2f2",strokeWidth:"97%",opacity:1,margin:5,dropShadow:{enabled:!1,top:0,left:0,blur:3,color:"#000",opacity:.5}},dataLabels:{show:!0,name:{show:!0,fontSize:"16px",fontFamily:void 0,fontWeight:600,color:void 0,offsetY:0,formatter:t=>t},value:{show:!0,fontSize:"14px",fontFamily:void 0,fontWeight:400,color:void 0,offsetY:16,formatter:t=>t+"%"},total:{show:!1,label:"Total",fontSize:"16px",fontWeight:600,fontFamily:void 0,color:void 0,formatter:t=>t.globals.seriesTotals.reduce((t,e)=>t+e,0)/t.seriesData.series.length+"%"}},barLabels:{enabled:!1,offsetX:0,offsetY:0,useSeriesColors:!0,fontFamily:void 0,fontWeight:600,fontSize:"16px",formatter:t=>t,onClick:void 0}},pie:{customScale:1,offsetX:0,offsetY:0,startAngle:0,endAngle:360,expandOnClick:!0,dataLabels:{offset:0,minAngleToShowLabel:10},donut:{size:"65%",background:"transparent",labels:{show:!1,name:{show:!0,fontSize:"16px",fontFamily:void 0,fontWeight:600,color:void 0,offsetY:-10,formatter:t=>t},value:{show:!0,fontSize:"20px",fontFamily:void 0,fontWeight:400,color:void 0,offsetY:10,formatter:t=>t},total:{show:!1,showAlways:!1,label:"Total",fontSize:"16px",fontWeight:400,fontFamily:void 0,color:void 0,formatter:t=>t.globals.seriesTotals.reduce((t,e)=>t+e,0)}}}},polarArea:{rings:{strokeWidth:1,strokeColor:"#e8e8e8"},spokes:{strokeWidth:1,connectorColors:"#e8e8e8"}},radar:{size:void 0,offsetX:0,offsetY:0,polygons:{strokeWidth:1,strokeColors:"#e8e8e8",connectorColors:"#e8e8e8",fill:{colors:void 0}}}},colors:void 0,dataLabels:{enabled:!0,enabledOnSeries:void 0,formatter:t=>null!==t?t:"",textAnchor:"middle",distributed:!1,offsetX:0,offsetY:0,style:{fontSize:"12px",fontFamily:void 0,fontWeight:600,colors:void 0},background:{enabled:!0,foreColor:"#fff",backgroundColor:void 0,borderRadius:2,padding:4,opacity:.9,borderWidth:1,borderColor:"#fff",dropShadow:{enabled:!1,top:1,left:1,blur:1,color:"#000",opacity:.8}},dropShadow:{enabled:!1,top:1,left:1,blur:1,color:"#000",opacity:.8}},fill:{type:"solid",colors:void 0,opacity:.85,gradient:{shade:"dark",type:"horizontal",shadeIntensity:.5,gradientToColors:void 0,inverseColors:!0,opacityFrom:1,opacityTo:1,stops:[0,50,100],colorStops:[]},image:{src:[],width:void 0,height:void 0},pattern:{style:"squares",width:6,height:6,strokeWidth:2}},forecastDataPoints:{count:0,fillOpacity:.5,strokeWidth:void 0,dashArray:4},grid:{show:!0,borderColor:"#e0e0e0",strokeDashArray:0,position:"back",xaxis:{lines:{show:!1}},yaxis:{lines:{show:!0}},row:{colors:void 0,opacity:.5},column:{colors:void 0,opacity:.5},padding:{top:0,right:10,bottom:0,left:12}},labels:[],legend:{show:!0,showForSingleSeries:!1,showForNullSeries:!0,showForZeroSeries:!0,floating:!1,position:"bottom",horizontalAlign:"center",inverseOrder:!1,fontSize:"12px",fontFamily:void 0,fontWeight:400,width:void 0,height:void 0,formatter:void 0,tooltipHoverFormatter:void 0,offsetX:-20,offsetY:4,customLegendItems:[],clusterGroupedSeries:!0,clusterGroupedSeriesOrientation:"vertical",labels:{colors:void 0,useSeriesColors:!1},markers:{size:7,fillColors:void 0,strokeWidth:1,shape:void 0,offsetX:0,offsetY:0,customHTML:void 0,onClick:void 0},itemMargin:{horizontal:5,vertical:4},onItemClick:{toggleDataSeries:!0},onItemHover:{highlightDataSeries:!0}},markers:{discrete:[],size:0,colors:void 0,strokeColors:"#fff",strokeWidth:2,strokeOpacity:.9,strokeDashArray:0,fillOpacity:1,shape:"circle",offsetX:0,offsetY:0,showNullDataPoints:!0,onClick:void 0,onDblClick:void 0,hover:{size:void 0,sizeOffset:3}},noData:{text:void 0,align:"center",offsetX:0,offsetY:0,style:{color:void 0,fontSize:"14px",fontFamily:void 0}},responsive:[],series:void 0,states:{hover:{filter:{type:"lighten"}},active:{allowMultipleDataPointsSelection:!1,filter:{type:"darken"}}},title:{text:void 0,align:"left",margin:5,offsetX:0,offsetY:0,floating:!1,style:{fontSize:"14px",fontWeight:900,fontFamily:void 0,color:void 0}},subtitle:{text:void 0,align:"left",margin:5,offsetX:0,offsetY:30,floating:!1,style:{fontSize:"12px",fontWeight:400,fontFamily:void 0,color:void 0}},stroke:{show:!0,curve:"smooth",lineCap:"butt",width:2,colors:void 0,dashArray:0,fill:{type:"solid",colors:void 0,opacity:.85,gradient:{shade:"dark",type:"horizontal",shadeIntensity:.5,gradientToColors:void 0,inverseColors:!0,opacityFrom:1,opacityTo:1,stops:[0,50,100],colorStops:[]}}},tooltip:{enabled:!0,enabledOnSeries:void 0,shared:!0,hideEmptySeries:!1,followCursor:!1,intersect:!1,inverseOrder:!1,arrow:!0,custom:void 0,fillSeriesColor:!1,theme:"light",cssClass:"",style:{fontSize:"12px",fontFamily:void 0,background:void 0},onDatasetHover:{highlightDataSeries:!1},x:{show:!0,format:"dd MMM",formatter:void 0},y:{formatter:void 0,title:{formatter:t=>t?t+": ":""}},z:{formatter:void 0,title:"Size: "},marker:{show:!0,fillColors:void 0},items:{display:"flex"},fixed:{enabled:!1,position:"topRight",offsetX:0,offsetY:0}},xaxis:{type:"category",categories:[],convertedCatToNumeric:!1,offsetX:0,offsetY:0,overwriteCategories:void 0,labels:{show:!0,rotate:-45,rotateAlways:!1,hideOverlappingLabels:!0,trim:!1,minHeight:void 0,maxHeight:120,showDuplicates:!0,style:{colors:[],fontSize:"12px",fontWeight:400,fontFamily:void 0,cssClass:""},offsetX:0,offsetY:0,format:void 0,formatter:void 0,datetimeUTC:!0,datetimeFormatter:{year:"yyyy",month:"MMM",day:"dd MMM",hour:"HH:mm",minute:"HH:mm",second:"HH:mm:ss"}},group:{groups:[],style:{colors:[],fontSize:"12px",fontWeight:400,fontFamily:void 0,cssClass:""}},axisBorder:{show:!0,color:"#e0e0e0",width:"100%",height:1,offsetX:0,offsetY:0},axisTicks:{show:!0,color:"#e0e0e0",height:6,offsetX:0,offsetY:0},stepSize:void 0,tickAmount:void 0,tickPlacement:"on",min:void 0,max:void 0,range:void 0,floating:!1,decimalsInFloat:void 0,position:"bottom",title:{text:void 0,offsetX:0,offsetY:0,style:{color:void 0,fontSize:"12px",fontWeight:900,fontFamily:void 0,cssClass:""}},crosshairs:{show:!0,width:1,position:"back",opacity:.9,stroke:{color:"#b6b6b6",width:1,dashArray:3},fill:{type:"solid",color:"#B1B9C4",gradient:{colorFrom:"#D8E3F0",colorTo:"#BED1E6",stops:[0,100],opacityFrom:.4,opacityTo:.5}},dropShadow:{enabled:!1,left:0,top:0,blur:1,opacity:.8}},tooltip:{enabled:!0,offsetY:0,formatter:void 0,style:{fontSize:"12px",fontFamily:void 0}}},yaxis:this.yAxis,theme:{mode:"",palette:"palette1",monochrome:{enabled:!1,color:"#008FFB",shadeTo:"light",shadeIntensity:.65},accessibility:{colorBlindMode:""}}}}}class D{constructor(t){this.opts=t}init({responsiveOverride:t}){var e,s,i,a,o,r,n,l,h,d;let g=this.opts;const p=new k,u=new C(g);g=this.normalizeAliasedChartType(g),this.chartType=g.chart.type,g=this.extendYAxis(g),g=this.extendAnnotations(g);let x=p.init(),f={};if(g&&"object"==typeof g){let p={};const b=["line","area","bar","candlestick","boxPlot","rangeBar","rangeArea","bubble","scatter","heatmap","treemap","pie","polarArea","donut","radar","radialBar"],y=g.chart.requestedType;p="funnel"===y||"pyramid"===y?u[y]():"gauge"===y?u.gauge():-1!==b.indexOf(g.chart.type)?u[g.chart.type]():u.line(),(null==(s=null==(e=g.plotOptions)?void 0:e.bar)?void 0:s.isFunnel)&&(p=u.funnel()),g.chart.stacked&&"bar"===g.chart.type&&(p=u.stackedBars()),(null==(i=g.chart.brush)?void 0:i.enabled)&&(p=u.brush(p)),(null==(o=null==(a=g.plotOptions)?void 0:a.line)?void 0:o.isSlopeChart)&&(p=u.slope()),g.chart.stacked&&"100%"===g.chart.stackType&&(g=u.stacked100(g)),(null==(n=null==(r=g.plotOptions)?void 0:r.bar)?void 0:n.isDumbbell)&&(g=u.dumbbell(g)),this.checkForDarkTheme(c.getApex()),this.checkForDarkTheme(g),g.xaxis=g.xaxis||c.getApex().xaxis||{},t||(g.xaxis.convertedCatToNumeric=!1),g=this.checkForCatToNumericXAxis(this.chartType,p,g),((null==(l=g.chart.sparkline)?void 0:l.enabled)||(null==(d=null==(h=c.getApex().chart)?void 0:h.sparkline)?void 0:d.enabled))&&(p=u.sparkline(p)),f=m.extend(x,p)}const b=m.extend(f,c.getApex());return x=m.extend(b,g),x=this.handleUserInputErrors(x),x}normalizeAliasedChartType(t){if(!t||!t.chart)return t;const e=t.chart.type;return"funnel"!==e&&"pyramid"!==e&&"gauge"!==e||(t.chart.requestedType=e,"funnel"===e||"pyramid"===e?(t.plotOptions=t.plotOptions||{},t.plotOptions.bar=t.plotOptions.bar||{},t.plotOptions.bar.isFunnel=!0,t.plotOptions.bar.horizontal=!0,t.chart.type="bar",t.plotOptions.bar.isPyramid="pyramid"===e):"gauge"===e&&(t.chart.type="radialBar")),t}checkForCatToNumericXAxis(t,e,s){var i,a;const o=new C(s),r=("bar"===t||"boxPlot"===t)&&(null==(a=null==(i=s.plotOptions)?void 0:i.bar)?void 0:a.horizontal),n="pie"===t||"polarArea"===t||"donut"===t||"radar"===t||"radialBar"===t||"heatmap"===t,l="datetime"!==s.xaxis.type&&"numeric"!==s.xaxis.type,h=s.xaxis.tickPlacement?s.xaxis.tickPlacement:e.xaxis&&e.xaxis.tickPlacement;return r||n||!l||"between"===h||(s=o.convertCatToNumeric(s)),s}extendYAxis(t,e){const s=new k;(void 0===t.yaxis||!t.yaxis||Array.isArray(t.yaxis)&&0===t.yaxis.length)&&(t.yaxis={});const i=c.getApex();t.yaxis.constructor!==Array&&i.yaxis&&i.yaxis.constructor!==Array&&(t.yaxis=m.extend(t.yaxis,i.yaxis)),t.yaxis.constructor!==Array?t.yaxis=[m.extend(s.yAxis,t.yaxis)]:t.yaxis=m.extendArray(t.yaxis,s.yAxis);let a=!1;t.yaxis.forEach(t=>{t.logarithmic&&(a=!0)});let o=t.series;return e&&!o&&(o=e.config.series),a&&o.length!==t.yaxis.length&&o.length&&(t.yaxis=o.map((e,i)=>{if(e.name||(o[i].name=`series-${i+1}`),t.yaxis[i])return t.yaxis[i].seriesName=o[i].name,t.yaxis[i];{const e=m.extend(s.yAxis,t.yaxis[0]);return e.show=!1,e}})),a&&o.length>1&&(o.length,t.yaxis.length),t}extendAnnotations(t){return void 0===t.annotations&&(t.annotations={},t.annotations.yaxis=[],t.annotations.xaxis=[],t.annotations.points=[]),t=this.extendYAxisAnnotations(t),t=this.extendXAxisAnnotations(t),t=this.extendPointAnnotations(t)}extendYAxisAnnotations(t){const e=new k;return t.annotations.yaxis=m.extendArray(void 0!==t.annotations.yaxis?t.annotations.yaxis:[],e.yAxisAnnotation),t}extendXAxisAnnotations(t){const e=new k;return t.annotations.xaxis=m.extendArray(void 0!==t.annotations.xaxis?t.annotations.xaxis:[],e.xAxisAnnotation),t}extendPointAnnotations(t){const e=new k;return t.annotations.points=m.extendArray(void 0!==t.annotations.points?t.annotations.points:[],e.pointAnnotation),t}checkForDarkTheme(t){t.theme&&"dark"===t.theme.mode&&(t.tooltip||(t.tooltip={}),"light"!==t.tooltip.theme&&(t.tooltip.theme="dark"),t.chart.foreColor||(t.chart.foreColor="#f6f7f8"),t.theme.palette||(t.theme.palette="palette4"))}handleUserInputErrors(t){const e=t;if(e.tooltip.shared&&e.tooltip.intersect)throw new Error("tooltip.shared cannot be enabled when tooltip.intersect is true. Turn off any other option by setting it to false.");if("bar"===e.chart.type&&e.plotOptions.bar.horizontal){if(e.yaxis.length>1)throw new Error("Multiple Y Axis for bars are not supported. Switch to column chart by setting plotOptions.bar.horizontal=false");e.yaxis[0].reversed&&(e.yaxis[0].opposite=!0),e.xaxis.tooltip.enabled=!1,e.yaxis[0].tooltip.enabled=!1,e.chart.zoom.enabled=!1}return"bar"!==e.chart.type&&"rangeBar"!==e.chart.type||e.tooltip.shared&&"barWidth"===e.xaxis.crosshairs.width&&e.series.length>1&&(e.xaxis.crosshairs.width="tickWidth"),"candlestick"!==e.chart.type&&"boxPlot"!==e.chart.type||e.yaxis[0].reversed&&(e.yaxis[0].reversed=!1),e}}const L=[[1,1,2,5,5,5,10,10,10,10,10],[1,1,2,5,5,5,10,10,10,10,10]],M=[1,2,4,4,6,6,6,6,6,6,6,6,6,6,6,6,6,6,12,12,12,12,12,12,12,12,12,24];class P{initGlobalVars(t){t.series=[],t.seriesCandleO=[],t.seriesCandleH=[],t.seriesCandleM=[],t.seriesCandleL=[],t.seriesCandleC=[],t.seriesRangeStart=[],t.seriesRangeEnd=[],t.seriesRange=[],t.seriesPercent=[],t.seriesGoals=[],t.seriesX=[],t.seriesZ=[],t.seriesNames=[],t.seriesTotals=[],t.seriesLog=[],t.seriesColors=[],t.stackedSeriesTotals=[],t.seriesXvalues=[],t.seriesYvalues=[],t.dataWasParsed=!1,t.originalSeries=null,t.maxValsInArrayIndex=0,t.yValueDecimal=0,t.allSeriesHasEqualX=!0,t.labels=[],t.hasXaxisGroups=!1,t.groups=[],t.barGroups=[],t.lineGroups=[],t.areaGroups=[],t.hasSeriesGroups=!1,t.seriesGroups=[],t.categoryLabels=[],t.timescaleLabels=[],t.noLabelsProvided=!1,t.isXNumeric=!1,t.skipLastTimelinelabel=!1,t.skipFirstTimelinelabel=!1,t.isDataXYZ=!1,t.isMultiLineX=!1,t.isMultipleYAxis=!1,t.maxY=-Number.MAX_VALUE,t.minY=Number.MIN_VALUE,t.minYArr=[],t.maxYArr=[],t.maxX=-Number.MAX_VALUE,t.minX=Number.MAX_VALUE,t.initialMaxX=-Number.MAX_VALUE,t.initialMinX=Number.MAX_VALUE,t.maxDate=0,t.minDate=Number.MAX_VALUE,t.minZ=Number.MAX_VALUE,t.maxZ=-Number.MAX_VALUE,t.minXDiff=Number.MAX_VALUE,t.yAxisScale=[],t.xAxisScale=null,t.xAxisTicksPositions=[],t.xRange=0,t.yRange=[],t.zRange=0,t.dataPoints=0,t.xTickAmount=0,t.multiAxisTickAmount=0,t.disableZoomIn=!1,t.disableZoomOut=!1,t.yLabelsCoords=[],t.yTitleCoords=[],t.barPadForNumericAxis=0,t.padHorizontal=0,t.rotateXLabels=!1,t.overlappingXLabels=!1,t.radialSize=0,t.barHeight=0,t.barWidth=0,t.animationEnded=!1,t.resizeTimer=null,t.selectionResizeTimer=null,t.lastWheelExecution=0,t.delayedElements=[],t.pointsArray=[],t.dataLabelsRects=[],t.lastDrawnDataLabelsIndexes=[],t.textRectsCache=new Map,t.domCache=new Map,t.dimensionCache={},t.cachedSelectors={},t.seriesNS||this._attachNamespaces(t)}_attachNamespaces(t){const e=(e,s,i=s)=>{Object.defineProperty(e,i,{get:()=>t[s],set(e){t[s]=e},enumerable:!0,configurable:!0})},s={};e(s,"series","data");for(const t of["seriesNames","seriesX","seriesZ","seriesXvalues","seriesYvalues","seriesGoals","seriesLog","seriesColors","seriesPercent","seriesTotals","stackedSeriesTotals","seriesCandleO","seriesCandleH","seriesCandleM","seriesCandleL","seriesCandleC","seriesRangeStart","seriesRangeEnd","seriesRange","seriesYAxisMap","seriesYAxisReverseMap","seriesGroups","barGroups","lineGroups","areaGroups","originalSeries","collapsedSeries","collapsedSeriesIndices","ancillaryCollapsedSeries","ancillaryCollapsedSeriesIndices","allSeriesCollapsed","risingSeries","previousPaths","ignoreYAxisIndexes","labels","categoryLabels","timescaleLabels","groups"])e(s,t);Object.defineProperty(t,"seriesNS",{value:s,writable:!1,enumerable:!1,configurable:!0});const i={};for(const t of["minX","maxX","initialMinX","initialMaxX","minY","maxY","minYArr","maxYArr","minZ","maxZ","minDate","maxDate","minXDiff","xRange","yRange","zRange","xAxisScale","yAxisScale","xAxisTicksPositions","xTickAmount","multiAxisTickAmount","dataPoints","maxValsInArrayIndex","isXNumeric","isMultipleYAxis","isMultiLineX","isDataXYZ","dataFormatXNumeric","allSeriesHasEqualX","hasNullValues","dataWasParsed","hasXaxisGroups","hasSeriesGroups","skipFirstTimelinelabel","skipLastTimelinelabel","yValueDecimal","invalidLogScale","noLabelsProvided"])e(i,t);Object.defineProperty(t,"axes",{value:i,writable:!1,enumerable:!1,configurable:!0});const a={};for(const t of["svgWidth","svgHeight","gridWidth","gridHeight","translateX","translateY","translateXAxisX","translateXAxisY","translateYAxisX","xAxisLabelsHeight","xAxisGroupLabelsHeight","xAxisLabelsWidth","yAxisLabelsWidth","yAxisWidths","yLabelsCoords","yTitleCoords","padHorizontal","barPadForNumericAxis","rotateXLabels","scaleX","scaleY","radialSize","defaultLabels","overlappingXLabels"])e(a,t);Object.defineProperty(t,"layout",{value:a,writable:!1,enumerable:!1,configurable:!0});const o={};for(const t of["domCache","dimensionCache","cachedSelectors","textRectsCache","pointsArray","dataLabelsRects","lastDrawnDataLabelsIndexes","delayedElements","resizeTimer","selectionResizeTimer","resizeObserver"])e(o,t);Object.defineProperty(t,"cache",{value:o,writable:!1,enumerable:!1,configurable:!0})}globalVars(t){return{chartID:null,cuid:null,events:{beforeMount:[],mounted:[],updated:[],clicked:[],selection:[],dataPointSelection:[],zoomed:[],scrolled:[]},colors:[],fill:{colors:[]},stroke:{colors:[]},dataLabels:{style:{colors:[]}},radarPolygons:{fill:{colors:[]}},markers:{colors:[],size:t.markers.size,largestSize:0},LINE_HEIGHT_RATIO:1.618,axisCharts:!0,isSlopeChart:t.plotOptions.line.isSlopeChart,comboCharts:!1,initialConfig:null,initialSeries:[],lastXAxis:[],lastYAxis:[],allSeriesCollapsed:!1,collapsedSeries:[],collapsedSeriesIndices:[],ancillaryCollapsedSeries:[],ancillaryCollapsedSeriesIndices:[],risingSeries:[],ignoreYAxisIndexes:[],isDirty:!1,isExecCalled:!1,dataChanged:!1,resized:!1,invalidLogScale:!1,hasNullValues:!1,columnSeries:null,yaxis:null,total:0,shouldAnimate:!0,previousPaths:[],svgWidth:0,svgHeight:0,defaultLabels:!1,yAxisLabelsWidth:0,scaleX:1,scaleY:1,translateYAxisX:[],yAxisWidths:[],tooltip:null,resizeObserver:null,locale:{},memory:{methodsToExec:[]},niceScaleAllowedMagMsd:L,niceScaleDefaultTicks:M,seriesYAxisMap:[],seriesYAxisReverseMap:[],noData:!1}}init(t){const e=this.globalVars(t);return this.initGlobalVars(e),e.initialConfig=m.extend({},t),e.initialSeries=m.clone(t.series),e.lastXAxis=m.clone(e.initialConfig.xaxis),e.lastYAxis=m.clone(e.initialConfig.yaxis),e}}class T{constructor(t){this.opts=t}init(){const t=new D(this.opts).init({responsiveOverride:!1}),e=(new P).init(t),s={config:t,globals:e,dom:{},interact:{zoomEnabled:"zoom"===t.chart.toolbar.autoSelected&&t.chart.toolbar.tools.zoom&&t.chart.zoom.enabled,panEnabled:"pan"===t.chart.toolbar.autoSelected&&t.chart.toolbar.tools.pan,selectionEnabled:"selection"===t.chart.toolbar.autoSelected&&t.chart.toolbar.tools.selection,zoomed:!1,selection:void 0,visibleXRange:void 0,selectedDataPoints:[],mousedown:!1,clientX:null,clientY:null,lastClientPosition:{},lastWheelExecution:0,capturedSeriesIndex:-1,capturedDataPointIndex:-1,disableZoomIn:!1,disableZoomOut:!1,isTouchDevice:!!c.isBrowser()&&("ontouchstart"in window||navigator.maxTouchPoints>0)},formatters:{xLabelFormatter:void 0,yLabelFormatters:[],xaxisTooltipFormatter:void 0,ttKeyFormatter:void 0,ttVal:void 0,ttZFormatter:void 0,legendFormatter:void 0},candleData:{seriesCandleO:[],seriesCandleH:[],seriesCandleM:[],seriesCandleL:[],seriesCandleC:[]},rangeData:{seriesRangeStart:[],seriesRangeEnd:[],seriesRange:[]},labelData:{labels:[],categoryLabels:[],timescaleLabels:[],hasXaxisGroups:!1,groups:[],seriesGroups:[]},axisFlags:{isXNumeric:!1,dataFormatXNumeric:!1,isDataXYZ:!1,isRangeData:!1,isRangeBar:!1,isMultiLineX:!1,noLabelsProvided:!1,dataWasParsed:!1},seriesData:{series:[],seriesNames:[],seriesX:[],seriesZ:[],seriesColors:[],seriesGoals:[],stackedSeriesTotals:[],stackedSeriesTotalsByGroups:[]},layout:{gridHeight:0,gridWidth:0,translateX:0,translateY:0,translateXAxisX:0,translateXAxisY:0,rotateXLabels:!1,xAxisHeight:0,xAxisLabelsHeight:0,xAxisGroupLabelsHeight:0,xAxisLabelsWidth:0,yLabelsCoords:[],yTitleCoords:[]}};Object.defineProperty(e,"dom",{get:()=>s.dom,set(t){s.dom=t},enumerable:!1,configurable:!0});for(const t of["xLabelFormatter","yLabelFormatters","xaxisTooltipFormatter","ttKeyFormatter","ttVal","ttZFormatter","legendFormatter"])Object.defineProperty(e,t,{get:()=>s.formatters[t],set(e){s.formatters[t]=e},enumerable:!1,configurable:!0});for(const t of["zoomEnabled","panEnabled","selectionEnabled","zoomed","selection","visibleXRange","selectedDataPoints","mousedown","clientX","clientY","lastClientPosition","lastWheelExecution","capturedSeriesIndex","capturedDataPointIndex","disableZoomIn","disableZoomOut","isTouchDevice"])Object.defineProperty(e,t,{get:()=>s.interact[t],set(e){s.interact[t]=e},enumerable:!1,configurable:!0});for(const t of["gridHeight","gridWidth","translateX","translateY","translateXAxisX","translateXAxisY","rotateXLabels","xAxisHeight","xAxisLabelsHeight","xAxisGroupLabelsHeight","xAxisLabelsWidth","yLabelsCoords","yTitleCoords"])Object.defineProperty(e,t,{get:()=>s.layout[t],set(e){s.layout[t]=e},enumerable:!1,configurable:!0});for(const t of["series","seriesNames","seriesX","seriesZ","seriesColors","seriesGoals","stackedSeriesTotals","stackedSeriesTotalsByGroups"])Object.defineProperty(e,t,{get:()=>s.seriesData[t],set(e){s.seriesData[t]=e},enumerable:!1,configurable:!0});for(const t of["isXNumeric","dataFormatXNumeric","isDataXYZ","isRangeData","isRangeBar","isMultiLineX","noLabelsProvided","dataWasParsed"])Object.defineProperty(e,t,{get:()=>s.axisFlags[t],set(e){s.axisFlags[t]=e},enumerable:!1,configurable:!0});for(const t of["labels","categoryLabels","timescaleLabels","hasXaxisGroups","groups","seriesGroups"])Object.defineProperty(e,t,{get:()=>s.labelData[t],set(e){s.labelData[t]=e},enumerable:!1,configurable:!0});for(const t of["seriesRangeStart","seriesRangeEnd","seriesRange"])Object.defineProperty(e,t,{get:()=>s.rangeData[t],set(e){s.rangeData[t]=e},enumerable:!1,configurable:!0});for(const t of["seriesCandleO","seriesCandleH","seriesCandleM","seriesCandleL","seriesCandleC"])Object.defineProperty(e,t,{get:()=>s.candleData[t],set(e){s.candleData[t]=e},enumerable:!1,configurable:!0});return s}}class E{constructor(t){this.w=t}static checkComboSeries(t,e){let s=!1,i=0,a=0;return void 0===e&&(e="line"),t.length&&void 0!==t[0].type&&t.forEach(t=>{"bar"!==t.type&&"column"!==t.type&&"candlestick"!==t.type&&"boxPlot"!==t.type||i++,void 0!==t.type&&t.type!==e&&a++}),a>0&&(s=!0),{comboBarCount:i,comboCharts:s}}getStackedSeriesTotals(t=[]){const e=this.w,s=[];if(0===e.seriesData.series.length)return s;for(let i=0;it+e,0);{const e=this.w.seriesData.series[t];return Array.isArray(e)?e.reduce((t,e)=>t+e,0):null!=e?e:0}}getStackedSeriesTotalsByGroups(){const t=this.w,e=[];return t.labelData.seriesGroups.forEach(s=>{const i=[];t.config.series.forEach((e,a)=>{s.indexOf(t.seriesData.seriesNames[a])>-1&&i.push(a)});const a=t.seriesData.series.map((t,e)=>-1===i.indexOf(e)?e:-1).filter(t=>-1!==t);e.push(this.getStackedSeriesTotals(a))}),e}setSeriesYAxisMappings(){const t=this.w.globals,e=this.w.config;let s=[];const i=[],a=[],o=this.w.seriesData.series.length>e.yaxis.length||e.yaxis.some(t=>Array.isArray(t.seriesName));e.series.forEach((t,e)=>{a.push(e),i.push(null)}),e.yaxis.forEach((t,e)=>{s[e]=[]});const r=[];e.yaxis.forEach((t,i)=>{let n=!1;if(t.seriesName){let r=[];Array.isArray(t.seriesName)?r=t.seriesName:r.push(t.seriesName),r.forEach(t=>{e.series.forEach((e,r)=>{if(e.name===t){let t=r;i===r||o?(!o||a.indexOf(r)>-1)&&s[i].push([i,r]):(s[r].push([r,i]),t=i),n=!0,t=a.indexOf(t),-1!==t&&a.splice(t,1)}})})}n||r.push(i)}),s=s.map(t=>{const e=[];return t.forEach(t=>{i[t[1]]=t[0],e.push(t[1])}),e});let n=e.yaxis.length-1;for(let t=0;t{s[n].push(t),i[t]=n}),t.seriesYAxisMap=s.map(t=>t),t.seriesYAxisReverseMap=i.map(t=>t),t.seriesYAxisMap.forEach((t,s)=>{t.forEach(t=>{if(e.series[t]&&void 0===e.series[t].group){e.series[t].group="apexcharts-axis-".concat(s.toString())}})})}isSeriesNull(t=null){let e=[];const s=this.w.config.series;return e=null===t?s.filter(t=>null!==t):s[t]&&Array.isArray(s[t].data)?s[t].data.filter(t=>null!==t):null!==s[t]&&void 0!==s[t]?[s[t]]:[],0===e.length}seriesHaveSameValues(t){const e=this.w.seriesData.series[t];return!Array.isArray(e)||e.every((t,e,s)=>t===s[0])}getCategoryLabels(t){const e=this.w;let s=t.slice();return e.config.xaxis.convertedCatToNumeric&&(s=t.map(t=>e.config.xaxis.labels.formatter(t-e.globals.minX+1))),s}getLargestSeries(){const t=this.w;t.globals.maxValsInArrayIndex=t.seriesData.series.map(t=>t.length).indexOf(Math.max.apply(Math,t.seriesData.series.map(t=>t.length)))}getLargestMarkerSize(){const t=this.w;let e=0;return t.globals.markers.size.forEach(t=>{e=Math.max(e,t)}),t.config.markers.discrete&&t.config.markers.discrete.length&&t.config.markers.discrete.forEach(t=>{e=Math.max(e,t.size)}),e>0&&(t.config.markers.hover.size>0?e=t.config.markers.hover.size:e+=t.config.markers.hover.sizeOffset),t.globals.markers.largestSize=e,e}getSeriesTotals(){const t=this.w;t.globals.seriesTotals=t.seriesData.series.map(t=>{let e=0;if(Array.isArray(t))for(let s=0;s{let o=0;for(let r=0;rt&&s.seriesData.seriesX[a][r]{const s=[];if(Array.isArray(e))for(let i=0;it+e,0);s.push(i)}return s})}getCalculatedRatios(){const t=this.w,e=t.globals,s=[];let i=0,a=0,o=0,r=0,n=[],l=.1,h=0;if(e.yRange=[],e.isMultipleYAxis)for(let t=0;t0){const o=(e,i)=>{const a=t.config.yaxis[t.globals.seriesYAxisReverseMap[i]],o=e<0?-1:1;return e=Math.abs(e),a.logarithmic&&(e=this.getBaseLog(a.logBase,e)),-o*e/s[i]};if(e.isMultipleYAxis){n=[];for(let t=0;t{const i=e.globals.seriesYAxisReverseMap[s];return e.config.yaxis[i]&&e.config.yaxis[i].logarithmic?t.map(t=>null===t?null:this.getLogVal(e.config.yaxis[i].logBase,t,s)):t}),e.globals.invalidLogScale?t:e.globals.seriesLog}getLogValAtSeriesIndex(t,e){if(null===t)return null;const s=this.w,i=s.globals.seriesYAxisReverseMap[e];return s.config.yaxis[i]&&s.config.yaxis[i].logarithmic?this.getLogVal(s.config.yaxis[i].logBase,t,e):t}getBaseLog(t,e){return Math.log(e)/Math.log(t)}getLogVal(t,e,s){if(e<=0)return 0;const i=this.w,a=0===i.globals.minYArr[s]?-1:this.getBaseLog(t,i.globals.minYArr[s]),o=(0===i.globals.maxYArr[s]?0:this.getBaseLog(t,i.globals.maxYArr[s]))-a;if(e<1)return e/o;return(this.getBaseLog(t,e)-a)/o}getLogYRatios(t){const e=this.w,s=this.w.globals,i=s;return i.yLogRatio=t.slice(),i.logYRange=s.yRange.map((t,a)=>{const o=e.globals.seriesYAxisReverseMap[a];if(e.config.yaxis[o]&&this.w.config.yaxis[o].logarithmic){let t=-Number.MAX_VALUE,o=Number.MIN_VALUE,r=1;return s.seriesLog.forEach((s,i)=>{s.forEach(s=>{e.config.yaxis[i]&&e.config.yaxis[i].logarithmic&&(t=Math.max(s,t),o=Math.min(s,o))})}),r=Math.pow(s.yRange[a],Math.abs(o-t)/s.yRange[a]),i.yLogRatio[a]=r/this.w.layout.gridHeight,r}}),i.invalidLogScale?t.slice():i.yLogRatio}static extendArrayProps(t,e,s){var i,a;return(null==e?void 0:e.yaxis)&&(e=t.extendYAxis(e,s)),(null==e?void 0:e.annotations)&&(e.annotations.yaxis&&(e=t.extendYAxisAnnotations(e)),(null==(i=null==e?void 0:e.annotations)?void 0:i.xaxis)&&(e=t.extendXAxisAnnotations(e)),(null==(a=null==e?void 0:e.annotations)?void 0:a.points)&&(e=t.extendPointAnnotations(e))),e}drawSeriesByGroup(t,e,s,i){const a=this.w,o=[];return t.series.length>0&&e.forEach(e=>{const r=[],n=[];t.i.forEach((s,i)=>{a.config.series[s].group===e&&(r.push(t.series[i]),n.push(s))}),r.length>0&&o.push(i.draw(r,s,n))}),o}}const F="http://www.w3.org/2000/svg";function I(t){return 1-Math.pow(1-t,3)}let X=null;function R(){if(!c.isBrowser())return!1;try{return X||(X=window.matchMedia("(prefers-reduced-motion: reduce)")),!!X.matches}catch(t){return!1}}function Y(t,e,s){if(!c.isBrowser())return!1;if(s.globals.dataChanged||s.globals.resized)return!1;const i=s.config.chart.animations;if(!i||!1===i.enabled)return!1;const a=s.config.chart.type;if("line"!==a&&"area"!==a&&"rangeArea"!==a)return!1;if(!(s.layout.gridWidth>0))return!1;const o=2*(i.speed||800),r=Math.max(0,Math.min(1,e/s.layout.gridWidth)),n=(1-Math.cbrt(1-r))*o,l=t.node.style;l.opacity="0";let h=null;const d=t=>{null===h&&(h=t),t-h>=n?l.opacity="":b.requestAnimationFrame(d)};return b.requestAnimationFrame(d),!0}function z(t){const e=t.style,s=t.index||0,i="number"==typeof t.baseDelay?t.baseDelay:40,a=t.row||0,o=t.col||0,r=t.groupIndex||0,n=t.perGroup||1,l=t.centerDistance||0;switch(e){case"none":return 0;case"diagonal":return(a+o)*i;case"group":return r*i+s%n*(i/4);case"centroid":return l*i*(s+1);default:return s*i}}class B{constructor(t,e){this.w=t,this.ctx=e}animateLine(t,e,s,i){t.attr(e).animate(i).attr(s)}animateMarker(t,e,s,i){t.attr({opacity:0}).animate(e).attr({opacity:1}).after(()=>{i()})}animatePop(t,{speed:e,delay:s=0,onComplete:i}){const a=this.w;if(!c.isBrowser()||!a.globals.shouldAnimate||e<1)return void(i&&i());const o=t.node.style;o.transformBox="fill-box",o.transformOrigin="center",o.transform="scale(0)",o.opacity="0";const r=performance.now()+s,n=t=>{const s=Math.max(0,Math.min(1,(t-r)/e));o.transform=`scale(${function(t){const e=1.70158;return 1+2.70158*Math.pow(t-1,3)+e*Math.pow(t-1,2)}(s)})`,o.opacity=String(Math.min(1,2*s)),s<1?b.requestAnimationFrame(n):(o.transform="",o.transformOrigin="",o.transformBox="",o.opacity="",i&&i())};b.requestAnimationFrame(n)}animateRect(t,e,s,i,a,o=0){t.attr(e).animate(i,o).attr(s).after(()=>a())}animatePathsGradually(t){const{el:e,realIndex:s,j:i,fill:a,pathFrom:o,pathTo:r,speed:n,delay:l}=t,h=this.w;let c=0;h.config.chart.animations.animateGradually.enabled&&(c=h.config.chart.animations.animateGradually.delay),h.config.chart.animations.dynamicAnimation.enabled&&h.globals.dataChanged&&"bar"!==h.config.chart.type&&(c=0),this.morphSVG(e,s,i,"line"!==h.config.chart.type||h.globals.comboCharts?a:"stroke",o,r,n,l*c)}showDelayedElements(){this.w.globals.delayedElements.forEach(t=>{const e=t.el;e.classList.remove("apexcharts-element-hidden"),e.classList.add("apexcharts-hidden-element-shown")})}animationCompleted(t){const e=this.w;e.globals.animationEnded||(e.globals.animationEnded=!0,this.showDelayedElements(),"function"==typeof e.config.chart.events.animationEnd&&e.config.chart.events.animationEnd(this.ctx,{el:t,w:e}))}animateDraw(t,{realIndex:e,j:s,isFill:i,isLast:a,speed:o,delay:r,mask:n}){const l=this.w,h=this,d=()=>{a&&l.globals.shouldAnimate&&h.animationCompleted(t),h.showDelayedElements()};if(!c.isBrowser()||!l.globals.shouldAnimate||o<1)return void d();const g=t.node,p=()=>{const t=n&&"radial"===n.type,a=l.layout.gridWidth+8,h=n&&n.cx||0,c=n&&n.cy||0,p=(n&&n.r||l.layout.gridWidth/2)+4,u=`apexDrawMask${l.globals.cuid}-${e}-${null!=s?s:0}-${i?"f":"s"}`,x=b.createElementNS(F,"mask");let f;if(x.setAttribute("id",u),x.setAttribute("maskUnits","userSpaceOnUse"),t){const t=p;x.setAttribute("x",String(h-t)),x.setAttribute("y",String(c-t)),x.setAttribute("width",String(2*t)),x.setAttribute("height",String(2*t)),f=b.createElementNS(F,"circle"),f.setAttribute("cx",String(h)),f.setAttribute("cy",String(c)),f.setAttribute("r","0"),f.setAttribute("fill","#fff")}else x.setAttribute("x",String(-4)),x.setAttribute("y",String(-4)),x.setAttribute("width",String(a)),x.setAttribute("height",String(l.layout.gridHeight+8)),f=b.createElementNS(F,"rect"),f.setAttribute("x",String(-4)),f.setAttribute("y",String(-4)),f.setAttribute("width","0"),f.setAttribute("height",String(l.layout.gridHeight+8)),f.setAttribute("fill","#fff");x.appendChild(f),l.dom.elDefs.node.appendChild(x),g.setAttribute("mask",`url(#${u})`);const m=performance.now()+(r||0),y=e=>{const s=Math.max(0,Math.min(1,(e-m)/o)),i=I(s);t?f.setAttribute("r",String(i*p)):f.setAttribute("width",String(i*a)),s<1?b.requestAnimationFrame(y):(g.removeAttribute("mask"),x.parentNode&&x.parentNode.removeChild(x),d())};b.requestAnimationFrame(y)};b.requestAnimationFrame(()=>{if(i)return void p();const t=g.getAttribute("stroke-dasharray");if(!!t&&"0"!==t&&""!==t)return void p();let e=0;try{"function"==typeof g.getTotalLength&&(e=g.getTotalLength())}catch(t){e=0}e?(t=>{g.setAttribute("stroke-dasharray",String(t)),g.setAttribute("stroke-dashoffset",String(t));const e=performance.now()+(r||0),s=i=>{const a=Math.max(0,Math.min(1,(i-e)/o));g.setAttribute("stroke-dashoffset",String(t*(1-I(a)))),a<1?b.requestAnimationFrame(s):(g.removeAttribute("stroke-dasharray"),g.removeAttribute("stroke-dashoffset"),d())};b.requestAnimationFrame(s)})(e):d()})}morphSVG(t,e,s,i,a,o,r,n){var l,h;const c=this.w;a||(a=t.attr("pathFrom")),o||(o=t.attr("pathTo"));const d=()=>("radar"===c.config.chart.type&&(r=1),`M 0 ${c.layout.gridHeight}`);(!a||a.indexOf("undefined")>-1||a.indexOf("NaN")>-1)&&(a=d()),(!o.trim()||o.indexOf("undefined")>-1||o.indexOf("NaN")>-1)&&(o=d()),c.globals.shouldAnimate||(r=1);const g=!0===(null==(h=null==(l=this.ctx)?void 0:l.morphTypeChange)?void 0:h.isActive())?"polygons":"commands";t.plot(a).animate(1,n).plot(a).animate(r,n).plot(o,g).after(()=>{m.isNumber(s)?s===c.seriesData.series[c.globals.maxValsInArrayIndex].length-2&&c.globals.shouldAnimate&&this.animationCompleted(t):"none"!==i&&c.globals.shouldAnimate&&(!c.globals.comboCharts&&e===c.seriesData.series.length-1||c.globals.comboCharts)&&this.animationCompleted(t),this.showDelayedElements()})}}class H{constructor(t){this.w=t}getDefaultFilter(t,e){const s=this.w;t.unfilter&&t.unfilter(!0),s.config.chart.dropShadow.enabled&&this.dropShadow(t,s.config.chart.dropShadow,e)}applyFilter(t,e,s){var i,a,o;const r=this.w;if(t.unfilter&&t.unfilter(!0),"none"===s)return void this.getDefaultFilter(t,e);const n=r.config.chart.dropShadow,l="lighten"===s?2:.3;t.filterWith&&(t.filterWith(t=>{t.colorMatrix({type:"matrix",values:`\n ${l} 0 0 0 0\n 0 ${l} 0 0 0\n 0 0 ${l} 0 0\n 0 0 0 1 0\n `,in:"SourceGraphic",result:"brightness"}),n.enabled&&this.addShadow(t,e,n,"brightness")}),n.noUserSpaceOnUse||null==(a=null==(i=t.filterer())?void 0:i.node)||a.setAttribute("filterUnits","userSpaceOnUse"),this._scaleFilterSize(null==(o=t.filterer())?void 0:o.node))}addShadow(t,e,s,i){var a;const o=this.w;let{blur:r,top:n,left:l,color:h,opacity:c}=s;if(h=Array.isArray(h)?h[e]:h,(null==(a=o.config.chart.dropShadow.enabledOnSeries)?void 0:a.length)>0&&-1===o.config.chart.dropShadow.enabledOnSeries.indexOf(e))return t;t.offset({in:i,dx:l,dy:n,result:"offset"}),t.gaussianBlur({in:"offset",stdDeviation:r,result:"blur"}),t.flood({"flood-color":h,"flood-opacity":c,result:"flood"}),t.composite({in:"flood",in2:"blur",operator:"in",result:"shadow"}),t.merge(["shadow",i])}dropShadow(t,e,s=0){var i,a,o,r,n;const l=this.w;return t.unfilter&&t.unfilter(!0),m.isMsEdge()&&"radialBar"===l.config.chart.type||(null==(i=l.config.chart.dropShadow.enabledOnSeries)?void 0:i.length)>0&&-1===(null==(a=l.config.chart.dropShadow.enabledOnSeries)?void 0:a.indexOf(s))||t.filterWith&&(t.filterWith(t=>{this.addShadow(t,s,e,"SourceGraphic")}),e.noUserSpaceOnUse||null==(r=null==(o=t.filterer())?void 0:o.node)||r.setAttribute("filterUnits","userSpaceOnUse"),this._scaleFilterSize(null==(n=t.filterer())?void 0:n.node)),t}setSelectionFilter(t,e,s){const i=this.w;if(void 0!==i.interact.selectedDataPoints[e]&&i.interact.selectedDataPoints[e].indexOf(s)>-1){t.node.setAttribute("selected",!0);const s=i.config.states.active.filter;"none"!==s&&this.applyFilter(t,e,s.type)}}_scaleFilterSize(t){if(!t)return;(e=>{for(const s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.setAttribute(s,e[s])})({width:"200%",height:"200%",x:"-50%",y:"-50%"})}}class N{constructor(t,e=null){this.w=t,this.ctx=e}roundPathCorners(t,e){function s(t,e,s){var a=e.x-t.x,o=e.y-t.y,r=Math.sqrt(a*a+o*o);return i(t,e,Math.min(1,s/r))}function i(t,e,s){return{x:t.x+(e.x-t.x)*s,y:t.y+(e.y-t.y)*s}}function a(t,e){t.length>2&&(t[t.length-2]=e.x,t[t.length-1]=e.y)}function o(t){return{x:parseFloat(t[t.length-2]),y:parseFloat(t[t.length-1])}}t.indexOf("NaN")>-1&&(t="");var r=t.split(/[,\s]/).reduce(function(t,e){var s=e.match(/^([a-zA-Z])(.+)/);return s?(t.push(s[1]),t.push(s[2])):t.push(e),t},[]).reduce(function(t,e){return parseFloat(e)==e&&t.length?t[t.length-1].push(e):t.push([e]),t},[]),n=[];if(r.length>1){var l=o(r[0]),h=null;"Z"==r[r.length-1][0]&&r[0].length>2&&(h=["L",l.x,l.y],r[r.length-1]=h),n.push(r[0]);for(var c=1;c2&&"L"==g[0]&&p.length>2&&"L"==p[0]){var u,x,f=o(d),b=o(g),m=o(p);u=s(b,f,e),x=s(b,m,e),a(g,u),g.origPoint=b,n.push(g);var y=i(u,b,.5),w=i(b,x,.5),v=["C",y.x,y.y,w.x,w.y,x.x,x.y];v.origPoint=b,n.push(v)}else n.push(g)}if(h){var A=o(n[n.length-1]);n.push(["Z"]),a(n[0],A)}}else n=r;return n.reduce(function(t,e){return t+e.join(" ")+" "},"")}drawLine(t,e,s,i,a="#a8a8a8",o=0,r=null,n="butt"){return this.w.dom.Paper.line().attr({x1:t,y1:e,x2:s,y2:i,stroke:a,"stroke-dasharray":o,"stroke-width":r,"stroke-linecap":n})}drawRect(t=0,e=0,s=0,i=0,a=0,o="#fefefe",r=1,n=null,l=null,h=0){const c=this.w.dom.Paper.rect();return c.attr({x:t,y:e,width:s>0?s:0,height:i>0?i:0,rx:a,ry:a,opacity:r,"stroke-width":null!==n?n:0,stroke:null!==l?l:"none","stroke-dasharray":h}),c.node.setAttribute("fill",o),c}drawPolygon(t,e="#e1e1e1",s=1,i="none"){return this.w.dom.Paper.polygon(t).attr({fill:i,stroke:e,"stroke-width":s})}drawCircle(t,e=null){t<0&&(t=0);const s=this.w.dom.Paper.circle(2*t);return null!==e&&s.attr(e),s}drawPath({d:t="",stroke:e="#a8a8a8",strokeWidth:s=1,fill:i,fillOpacity:a=1,strokeOpacity:o=1,classes:r,strokeLinecap:n=null,strokeDashArray:l=0}){const h=this.w;null===n&&(n=h.config.stroke.lineCap),(t.indexOf("undefined")>-1||t.indexOf("NaN")>-1)&&(t=`M 0 ${h.layout.gridHeight}`);return h.dom.Paper.path(t).attr({fill:i,"fill-opacity":a,stroke:e,"stroke-opacity":o,"stroke-linecap":n,"stroke-width":s,"stroke-dasharray":l,class:r})}group(t=null){const e=this.w.dom.Paper.group();return null!==t&&e.attr(t),e}move(t,e){return["M",t,e].join(" ")}line(t,e,s=null){return"H"===s?[" H",t].join(" "):"V"===s?[" V",e].join(" "):[" L",t,e].join(" ")}curve(t,e,s,i,a,o){return["C",t,e,s,i,a,o].join(" ")}quadraticCurve(t,e,s,i){return["Q",t,e,s,i].join(" ")}arc(t,e,s,i,a,o,r,n=!1){let l="A";n&&(l="a");return[l,t,e,s,i,a,o,r].join(" ")}renderPaths({j:t,realIndex:e,pathFrom:s,pathTo:i,stroke:a,strokeWidth:o,strokeLinecap:r,fill:h,animationDelay:c,initialSpeed:d,dataChangeSpeed:g,className:p,chartType:u,shouldClipToGrid:x=!0,bindEventsOnPaths:f=!0,drawShadow:b=!0,drawMask:m=null}){var y;const w=this.w,v=new H(this.w),A=new B(this.w,null!=(y=this.ctx)?y:void 0),C=this.w.config.chart.animations.enabled,S=C&&this.w.config.chart.animations.dynamicAnimation.enabled;if(s&&s.startsWith("M 0 0 ")&&i){const t=i.match(/^M\s+[\d.-]+\s+[\d.-]+/);t&&(s=s.replace(/^M\s+0\s+0/,t[0]))}let k;const D=!!(C&&!w.globals.resized||S&&w.globals.dataChanged&&w.globals.shouldAnimate),L="string"==typeof p&&(p.indexOf("apexcharts-line")>-1||p.indexOf("apexcharts-area")>-1||p.indexOf("apexcharts-rangeArea")>-1||p.indexOf("apexcharts-radar")>-1),M=!(!C||w.globals.resized||w.globals.dataChanged||!L);D&&!M?k=s:(k=i,D||(w.globals.animationEnded=!0));const P=w.config.stroke.dashArray;let T=0;T=Array.isArray(P)?P[e]:w.config.stroke.dashArray;const E=this.drawPath({d:k,stroke:a,strokeWidth:o,fill:h,fillOpacity:1,classes:p,strokeLinecap:r,strokeDashArray:T});E.attr("index",e),x&&("bar"===u&&!w.globals.isBarHorizontal||w.globals.comboCharts?E.attr({"clip-path":`url(#gridRectBarMask${w.globals.cuid})`}):E.attr({"clip-path":`url(#gridRectMask${w.globals.cuid})`})),w.config.chart.dropShadow.enabled&&b&&v.dropShadow(E,w.config.chart.dropShadow,e),f&&(E.node.addEventListener("mouseenter",this.pathMouseEnter.bind(this,E)),E.node.addEventListener("mouseleave",this.pathMouseLeave.bind(this,E)),E.node.addEventListener("mousedown",this.pathMouseDown.bind(this,E))),E.attr({pathTo:i,pathFrom:s});const F={el:E,j:t,realIndex:e,pathFrom:s,pathTo:i,fill:h,strokeWidth:o,delay:c};if(!C||w.globals.resized||w.globals.dataChanged)!w.globals.resized&&w.globals.dataChanged||A.showDelayedElements();else if(M){const s=2*d,i="none"===a||0===o,r=w.seriesData.series.length,n=!!w.globals.comboCharts||e===r-1;A.animateDraw(E,{realIndex:e,j:t,isFill:i,isLast:n,speed:s,delay:0,mask:m})}else A.animatePathsGradually(l(n({},F),{speed:d}));return w.globals.dataChanged&&S&&D&&A.animatePathsGradually(l(n({},F),{speed:g})),E}drawPattern(t,e,s,i="#a8a8a8",a=0){return this.w.dom.Paper.pattern(e,s,o=>{"horizontalLines"===t?o.line(0,0,s,0).stroke({color:i,width:a+1}):"verticalLines"===t?o.line(0,0,0,e).stroke({color:i,width:a+1}):"slantedLines"===t?o.line(0,0,e,s).stroke({color:i,width:a}):"squares"===t?o.rect(e,s).fill("none").stroke({color:i,width:a}):"circles"===t&&o.circle(e).fill("none").stroke({color:i,width:a})})}drawGradient(t,e,s,i,a,o=null,r=null,n=[],l=0){const h=this.w;let c;e.length<9&&0===e.indexOf("#")&&(e=m.hexToRgba(e,i)),s.length<9&&0===s.indexOf("#")&&(s=m.hexToRgba(s,a));let d=0,g=1,p=1,u=null;null!==r&&(d=void 0!==r[0]?r[0]/100:0,g=void 0!==r[1]?r[1]/100:1,p=void 0!==r[2]?r[2]/100:1,u=void 0!==r[3]?r[3]/100:null);const x=!("donut"!==h.config.chart.type&&"pie"!==h.config.chart.type&&"polarArea"!==h.config.chart.type&&"bubble"!==h.config.chart.type);if(c=n&&0!==n.length?h.dom.Paper.gradient(x?"radial":"linear",t=>{(Array.isArray(n[l])?n[l]:n).forEach(e=>{t.stop(e.offset/100,e.color,e.opacity)})}):h.dom.Paper.gradient(x?"radial":"linear",t=>{t.stop(d,e,i),t.stop(g,s,a),t.stop(p,s,a),null!==u&&t.stop(u,e,i)}),x){const t=h.layout.gridWidth/2,e=h.layout.gridHeight/2;"bubble"!==h.config.chart.type?c.attr({gradientUnits:"userSpaceOnUse",cx:t,cy:e,r:o}):c.attr({cx:.5,cy:.5,r:.8,fx:.2,fy:.2})}else"vertical"===t?c.from(0,0).to(0,1):"diagonal"===t?c.from(0,0).to(1,1):"horizontal"===t?c.from(0,1).to(1,1):"diagonal2"===t&&c.from(1,0).to(0,1);return c}getTextBasedOnMaxWidth({text:t,maxWidth:e,fontSize:s,fontFamily:i}){const a=this.getTextRects(t,s,i,""),o=a.width/t.length,r=Math.floor(e/o);return e{for(let e=0;et.tspan(x))),b.attr({x:t,y:e,"text-anchor":i,"dominant-baseline":p,"font-size":a,"font-family":o,"font-weight":r,fill:l,class:"apexcharts-text "+d}),b.node.style.fontFamily=o,b.node.style.opacity=h,b}getMarkerPath(t,e,s,i){let a="";switch(s){case"cross":a=`M ${t-(i/=1.4)} ${e-i} L ${t+i} ${e+i} M ${t-i} ${e+i} L ${t+i} ${e-i}`;break;case"plus":a=`M ${t-(i/=1.12)} ${e} L ${t+i} ${e} M ${t} ${e-i} L ${t} ${e+i}`;break;case"star":case"sparkle":{let o=5;i*=1.15,"sparkle"===s&&(i/=1.1,o=4);const r=Math.PI/o;for(let s=0;s<=2*o;s++){const o=s*r,n=s%2==0?i:i/2;a+=(0===s?"M":"L")+(t+n*Math.sin(o))+","+(e-n*Math.cos(o))}a+="Z";break}case"triangle":a=`M ${t} ${e-i} \n L ${t+i} ${e+i} \n L ${t-i} ${e+i} \n Z`;break;case"square":case"rect":a=`M ${t-(i/=1.125)} ${e-i} \n L ${t+i} ${e-i} \n L ${t+i} ${e+i} \n L ${t-i} ${e+i} \n Z`;break;case"diamond":a=`M ${t} ${e-(i*=1.05)} \n L ${t+i} ${e} \n L ${t} ${e+i} \n L ${t-i} ${e} \n Z`;break;case"line":a=`M ${t-(i/=1.1)} ${e} \n L ${t+i} ${e}`;break;default:a=`M ${t}, ${e} \n m -${(i*=2)/2}, 0 \n a ${i/2},${i/2} 0 1,0 ${i},0 \n a ${i/2},${i/2} 0 1,0 -${i},0`}return a}drawMarkerShape(t,e,s,i,a){const o=this.drawPath({d:this.getMarkerPath(t,e,s,i),stroke:a.pointStrokeColor,strokeDashArray:a.pointStrokeDashArray,strokeWidth:a.pointStrokeWidth,fill:a.pointFillColor,fillOpacity:a.pointFillOpacity,strokeOpacity:a.pointStrokeOpacity});return o.attr({cx:t,cy:e,shape:a.shape,class:a.class?a.class:""}),o}drawMarker(t,e,s){t=t||0;let i=s.pSize||0;return m.isNumber(e)||(i=0,e=0),this.drawMarkerShape(t,e,null==s?void 0:s.shape,i,n(n({},s),"line"===s.shape||"plus"===s.shape||"cross"===s.shape?{pointStrokeColor:s.pointFillColor,pointStrokeOpacity:s.pointFillOpacity}:{}))}pathMouseEnter(t,e){var s,i;const a=this.w,o=new H(this.w),r=parseInt(null!=(s=t.node.getAttribute("index"))?s:"",10),n=parseInt(null!=(i=t.node.getAttribute("j"))?i:"",10);if(!(isNaN(r)||isNaN(n)||("function"==typeof a.config.chart.events.dataPointMouseEnter&&a.config.chart.events.dataPointMouseEnter(e,this.ctx,{seriesIndex:r,dataPointIndex:n,w:a}),N._fireEvent(a,"dataPointMouseEnter",[e,this.ctx,{seriesIndex:r,dataPointIndex:n,w:a}]),"none"!==a.config.states.active.filter.type&&"true"===t.node.getAttribute("selected")||"none"===a.config.states.hover.filter.type||a.interact.isTouchDevice))){const e=a.config.states.hover.filter;o.applyFilter(t,r,e.type)}}pathMouseLeave(t,e){var s,i;const a=this.w,o=new H(this.w),r=parseInt(null!=(s=t.node.getAttribute("index"))?s:"",10),n=parseInt(null!=(i=t.node.getAttribute("j"))?i:"",10);isNaN(r)||isNaN(n)||("function"==typeof a.config.chart.events.dataPointMouseLeave&&a.config.chart.events.dataPointMouseLeave(e,this.ctx,{seriesIndex:r,dataPointIndex:n,w:a}),N._fireEvent(a,"dataPointMouseLeave",[e,this.ctx,{seriesIndex:r,dataPointIndex:n,w:a}]),"none"!==a.config.states.active.filter.type&&"true"===t.node.getAttribute("selected")||"none"!==a.config.states.hover.filter.type&&o.getDefaultFilter(t,r))}pathMouseDown(t,e){var s,i;const a=this.w,o=new H(this.w),r=parseInt(null!=(s=t.node.getAttribute("index"))?s:"",10),n=parseInt(null!=(i=t.node.getAttribute("j"))?i:"",10);if(isNaN(r)||isNaN(n))return;let l="false";if("true"===t.node.getAttribute("selected")){t.node.setAttribute("selected","false");const e=a.interact.selectedDataPoints[r].indexOf(n);e>-1&&a.interact.selectedDataPoints[r].splice(e,1)}else{if(!a.config.states.active.allowMultipleDataPointsSelection&&a.interact.selectedDataPoints.length>0){a.interact.selectedDataPoints=[];const t=a.dom.Paper.find(".apexcharts-series path:not(.apexcharts-decoration-element)"),e=a.dom.Paper.find(".apexcharts-series circle:not(.apexcharts-decoration-element), .apexcharts-series rect:not(.apexcharts-decoration-element)"),s=t=>{Array.prototype.forEach.call(t,t=>{t.node.setAttribute("selected","false"),o.getDefaultFilter(t,r)})};s(t),s(e)}t.node.setAttribute("selected","true"),l="true",void 0===a.interact.selectedDataPoints[r]&&(a.interact.selectedDataPoints[r]=[]),a.interact.selectedDataPoints[r].push(n)}if("true"===l){const e=a.config.states.active.filter;if("none"!==e)o.applyFilter(t,r,e.type);else if("none"!==a.config.states.hover.filter&&!a.interact.isTouchDevice){const e=a.config.states.hover.filter;o.applyFilter(t,r,e.type)}}else if("none"!==a.config.states.active.filter.type)if("none"===a.config.states.hover.filter.type||a.interact.isTouchDevice)o.getDefaultFilter(t,r);else{const e=a.config.states.hover.filter;o.applyFilter(t,r,e.type)}"function"==typeof a.config.chart.events.dataPointSelection&&a.config.chart.events.dataPointSelection(e,this.ctx,{selectedDataPoints:a.interact.selectedDataPoints,seriesIndex:r,dataPointIndex:n,w:a}),e&&N._fireEvent(a,"dataPointSelection",[e,this.ctx,{selectedDataPoints:a.interact.selectedDataPoints,seriesIndex:r,dataPointIndex:n,w:a}])}rotateAroundCenter(t){let e={};t&&"function"==typeof t.getBBox&&(e=t.getBBox());return{x:e.x+e.width/2,y:e.y+e.height/2}}setupEventDelegation(t,e){let s=null;t.node.addEventListener("mouseover",i=>{const a=N._findDelegateTarget(i.target,t.node,e);a&&a!==s&&(s&&s.instance&&this.pathMouseLeave(s.instance,i),s=a,a.instance&&this.pathMouseEnter(a.instance,i))}),t.node.addEventListener("mouseout",i=>{if(!s)return;(i.relatedTarget?N._findDelegateTarget(i.relatedTarget,t.node,e):null)!==s&&(s&&s.instance&&this.pathMouseLeave(s.instance,i),s=null)}),t.node.addEventListener("mousedown",s=>{const i=N._findDelegateTarget(s.target,t.node,e);i&&i.instance&&this.pathMouseDown(i.instance,s)})}static _fireEvent(t,e,s){const i=t.globals.events;if(!i||!Object.prototype.hasOwnProperty.call(i,e))return;const a=i[e];for(let t=0;t0&&t.getComputedTextLength()>=s/1.1)){for(let i=e.length-3;i>0;i-=3)if(t.getSubStringLength(0,i)<=s/1.1)return void(t.textContent=e.substring(0,i)+"...");t.textContent="."}}}const W="http://www.w3.org/2000/svg";class O{constructor(t,e){"object"==typeof t?(this.x=t.x,this.y=t.y):(this.x=t||0,this.y=e||0)}transform(t){return t.apply(this)}clone(){return new O(this.x,this.y)}}class _{constructor(t,e,s,i,a,o){this.a=null!=t?t:1,this.b=null!=e?e:0,this.c=null!=s?s:0,this.d=null!=i?i:1,this.e=null!=a?a:0,this.f=null!=o?o:0}rotate(t){const e=t*Math.PI/180,s=Math.cos(e),i=Math.sin(e);return this.multiply(new _(s,i,-i,s,0,0))}scale(t,e){return this.multiply(new _(t,0,0,null!=e?e:t,0,0))}multiply(t){return new _(this.a*t.a+this.c*t.b,this.b*t.a+this.d*t.b,this.a*t.c+this.c*t.d,this.b*t.c+this.d*t.d,this.a*t.e+this.c*t.f+this.e,this.b*t.e+this.d*t.f+this.f)}apply(t){return new O(this.a*t.x+this.c*t.y+this.e,this.b*t.x+this.d*t.y+this.f)}}class ${constructor(t,e,s,i){this.x=t,this.y=e,this.w=s,this.h=i,this.width=s,this.height=i,this.x2=t+s,this.y2=e+i}}class G{constructor(t){this.w=t,this.opts=null,this.seriesIndex=0,this.patternIDs=[]}clippedImgArea(t){const e=this.w,s=e.config,i=parseInt(String(e.layout.gridWidth),10),a=parseInt(String(e.layout.gridHeight),10),o=i>a?i:a,r=t.image;let n=0,l=0;void 0===t.width&&void 0===t.height?void 0!==s.fill.image.width&&void 0!==s.fill.image.height?(n=s.fill.image.width+1,l=s.fill.image.height):(n=o+1,l=o):(n=t.width,l=t.height);const h=b.createElementNS(W,"pattern");N.setAttrs(h,{id:t.patternID,patternUnits:t.patternUnits?t.patternUnits:"userSpaceOnUse",width:n+"px",height:l+"px"});const d=b.createElementNS(W,"image");h.appendChild(d);const g=c.isBrowser()?window.SVG:global.SVG;d.setAttributeNS(g.xlink,"href",r),N.setAttrs(d,{x:0,y:0,preserveAspectRatio:"none",width:n+"px",height:l+"px"}),d.style.opacity=t.opacity,e.dom.elDefs.node.appendChild(h)}getSeriesIndex(t){const e=this.w,s=e.config.chart.type;return("bar"===s||"rangeBar"===s)&&e.config.plotOptions.bar.distributed||"heatmap"===s||"treemap"===s?this.seriesIndex=t.seriesNumber:this.seriesIndex=t.seriesNumber%e.seriesData.series.length,this.seriesIndex}computeColorStops(t,e){const s=this.w;let i=null,a=null;for(const s of t)s>=e.threshold?(null===i||s>i)&&(i=s):(null===a||s-1?p=m.getOpacityFromRGBA(d):f=m.hexToRgba(m.rgb2hex(d),p);const b=m.isCSSVariable(d)?m.getThemeColor(d):d;if("pattern"===g&&(l=this.handlePatternFill({fillConfig:t.fillConfig,patternFill:l,fillColor:b,defaultColor:f})),u){const e=r.fill.gradient.colorStops?[...r.fill.gradient.colorStops]:[];let s=r.fill.gradient.type;c&&(e[this.seriesIndex]=this.computeColorStops(o.seriesData.series[this.seriesIndex],r.plotOptions.line.colors),s="vertical"),h=this.handleGradientFill({type:s,fillConfig:t.fillConfig,fillColor:b,fillOpacity:p,colorStops:e,i:this.seriesIndex})}if("image"===g){const e=r.fill.image.src,s=t.patternID?t.patternID:"",i=`pattern${o.globals.cuid}${t.seriesNumber+1}${s}`;-1===this.patternIDs.indexOf(i)&&(this.clippedImgArea({opacity:p,image:Array.isArray(e)?t.seriesNumber-1&&(p=m.getOpacityFromRGBA(g));let u=void 0===r.gradient.opacityTo?s:Array.isArray(r.gradient.opacityTo)?r.gradient.opacityTo[o]:r.gradient.opacityTo;if(void 0===r.gradient.gradientToColors||0===r.gradient.gradientToColors.length)d="dark"===r.gradient.shade?c.shadeColor(-1*parseFloat(r.gradient.shadeIntensity),e.indexOf("rgb")>-1?m.rgb2hex(e):e):c.shadeColor(parseFloat(r.gradient.shadeIntensity),e.indexOf("rgb")>-1?m.rgb2hex(e):e);else if(r.gradient.gradientToColors[l.seriesNumber]){const t=r.gradient.gradientToColors[l.seriesNumber];d=t,t.indexOf("rgba")>-1&&(u=m.getOpacityFromRGBA(t))}else d=e;if(r.gradient.gradientFrom&&(g=r.gradient.gradientFrom),r.gradient.gradientTo&&(d=r.gradient.gradientTo),r.gradient.inverseColors){const t=g;g=d,d=t}return g.indexOf("rgb")>-1&&(g=m.rgb2hex(g)),d.indexOf("rgb")>-1&&(d=m.rgb2hex(d)),h.drawGradient(t,g,d,p,u,l.size,r.gradient.stops,a,o)}}class j{constructor(t,e){this.w=t,this.ctx=e,this._filters=new H(this.w),this._graphics=new N(this.w,this.ctx)}setGlobalMarkerSize(){const t=this.w;if(t.globals.markers.size=Array.isArray(t.config.markers.size)?t.config.markers.size:[t.config.markers.size],t.globals.markers.size.length>0){if(t.globals.markers.size.lengtht.config.markers.size)}plotChartMarkers({pointsPos:t,seriesIndex:e,j:s,pSize:i,alwaysDrawMarker:a=!1,isVirtualPoint:o=!1}){const r=this.w,n=e,l=t;let h=null;const c=new N(this.w),d=r.config.markers.discrete&&r.config.markers.discrete.length;if(Array.isArray(l.x))for(let t=0;t0:r.config.markers.size>0)||a||d){u||(x+=` w${m.randomId()}`);const s=this.getMarkerConfig({cssClass:x,seriesIndex:e,dataPointIndex:p}),o=r.config.series[n];if(o.data[p]&&(o.data[p].fillColor&&(s.pointFillColor=o.data[p].fillColor),o.data[p].strokeColor&&(s.pointStrokeColor=o.data[p].strokeColor)),void 0!==i&&(s.pSize=i),(l.x[t]<-r.globals.markers.largestSize||l.x[t]>r.layout.gridWidth+r.globals.markers.largestSize||l.y[t]<-r.globals.markers.largestSize||l.y[t]>r.layout.gridHeight+r.globals.markers.largestSize)&&(s.pSize=0),!u){(r.globals.markers.size[e]>0||a||d)&&!h&&(h=c.group({class:a||d?"":"apexcharts-series-markers"}),h.attr("clip-path",`url(#gridRectMarkerMask${r.globals.cuid})`),this.setupMarkerDelegation(h)),g=c.drawMarker(l.x[t],l.y[t],s),g.attr("rel",p),g.attr("j",p),g.attr("index",e),g.node.setAttribute("default-marker-size",s.pSize),Y(g,l.x[t],r),this._filters.setSelectionFilter(g,e,p),h&&h.add(g)}}else void 0===r.globals.pointsArray[e]&&(r.globals.pointsArray[e]=[]),r.globals.pointsArray[e].push([l.x[t],l.y[t]])}return h}getMarkerConfig({cssClass:t,seriesIndex:e,dataPointIndex:s=null,radius:i=null,size:a=null,strokeWidth:o=null}){const r=this.w,n=this.getMarkerStyle(e);let l=null===a?r.globals.markers.size[e]:a;const h=r.config.markers;return null!==s&&h.discrete.length&&h.discrete.map(t=>{t.seriesIndex===e&&t.dataPointIndex===s&&(n.pointStrokeColor=t.strokeColor,n.pointFillColor=t.fillColor,l=t.size,n.pointShape=t.shape)}),{pSize:null===i?l:i,pRadius:null!==i?i:h.radius,pointStrokeWidth:null!==o?o:Array.isArray(h.strokeWidth)?h.strokeWidth[e]:h.strokeWidth,pointStrokeColor:n.pointStrokeColor,pointFillColor:n.pointFillColor,shape:n.pointShape||(Array.isArray(h.shape)?h.shape[e]:h.shape),class:t,pointStrokeOpacity:Array.isArray(h.strokeOpacity)?h.strokeOpacity[e]:h.strokeOpacity,pointStrokeDashArray:Array.isArray(h.strokeDashArray)?h.strokeDashArray[e]:h.strokeDashArray,pointFillOpacity:Array.isArray(h.fillOpacity)?h.fillOpacity[e]:h.fillOpacity,seriesIndex:e}}setupMarkerDelegation(t){const e=this.w,s=".apexcharts-marker";this._graphics.setupEventDelegation(t,s),t.node.addEventListener("click",i=>{if(e.config.markers.onClick){N._findDelegateTarget(i.target,t.node,s)&&e.config.markers.onClick(i)}}),t.node.addEventListener("dblclick",i=>{if(e.config.markers.onDblClick){N._findDelegateTarget(i.target,t.node,s)&&e.config.markers.onDblClick(i)}}),t.node.addEventListener("touchstart",e=>{const i=N._findDelegateTarget(e.target,t.node,s);i&&i.instance&&this._graphics.pathMouseDown(i.instance,e)},{passive:!0})}addEvents(t){const e=this.w;t.node.addEventListener("mouseenter",this._graphics.pathMouseEnter.bind(this.ctx,t)),t.node.addEventListener("mouseleave",this._graphics.pathMouseLeave.bind(this.ctx,t)),t.node.addEventListener("mousedown",this._graphics.pathMouseDown.bind(this.ctx,t)),t.node.addEventListener("click",e.config.markers.onClick),t.node.addEventListener("dblclick",e.config.markers.onDblClick),t.node.addEventListener("touchstart",this._graphics.pathMouseDown.bind(this.ctx,t),{passive:!0})}getMarkerStyle(t){const e=this.w,s=e.globals.markers.colors,i=e.config.markers.strokeColor||e.config.markers.strokeColors;return{pointStrokeColor:Array.isArray(i)?i[t]:i,pointFillColor:Array.isArray(s)?s[t]:s}}}class V{constructor(t,e){this.ctx=e,this.w=t,this.initialAnim=this.w.config.chart.animations.enabled,this.anim=new B(this.w),this.filters=new H(this.w),this.fill=new G(this.w),this.markers=new j(this.w,this.ctx),this.graphics=new N(this.w)}draw(t,e,s){const i=this.w,a=this.graphics,o=s.realIndex,r=s.pointsPos,n=s.zRatio,l=s.elParent,h=a.group({class:`apexcharts-series-markers apexcharts-series-${i.config.chart.type}`});if(h.attr("clip-path",`url(#gridRectMarkerMask${i.globals.cuid})`),this.markers.setupMarkerDelegation(h),Array.isArray(r.x))for(let t=0;tt.maxBubbleRadius&&(c=t.maxBubbleRadius)}const d=r.x[t],g=r.y[t];if(c=c||0,null!==g&&void 0!==i.seriesData.series[o][s]||(a=!1),a){const t=this.drawPoint(d,g,c,o,s,e);h.add(t)}l.add(h)}}drawPoint(t,e,s,i,a,o){const r=this.w,n=i,l=this.anim,h=this.filters,c=this.fill,d=this.markers,g=this.graphics,p=d.getMarkerConfig({cssClass:"apexcharts-marker",seriesIndex:n,dataPointIndex:a,radius:"bubble"===r.config.chart.type||r.globals.comboCharts&&r.config.series[i]&&"bubble"===r.config.series[i].type?s:null});let u=c.fillPath({seriesNumber:i,dataPointIndex:a,color:p.pointFillColor,patternUnits:"objectBoundingBox",value:r.seriesData.series[i][o]});const x=g.drawMarker(t,e,p),f=r.config.series[n];if(f.data[a]&&f.data[a].fillColor&&(u=f.data[a].fillColor),x.attr({fill:u}),r.config.chart.dropShadow.enabled){const t=r.config.chart.dropShadow;h.dropShadow(x,t,i)}if(!this.initialAnim||r.globals.dataChanged||r.globals.resized)r.globals.animationEnded=!0;else{const t=r.config.chart.animations,e=t.speed,s=r.globals.dataPoints||1,i=t.animateGradually,o=i&&!1!==i.enabled?Math.min(20,.5*e/Math.max(1,s)):0,n=z({style:o>0?"sequential":"none",index:a,baseDelay:o});l.animatePop(x,{speed:e,delay:n,onComplete:()=>l.animationCompleted(x)})}return x.attr({rel:a,j:a,index:i,"default-marker-size":p.pSize}),h.setSelectionFilter(x,i,a),x.node.classList.add("apexcharts-marker"),x}centerTextInBubble(t){const e=this.w;return{y:t+=parseInt(e.config.dataLabels.style.fontSize,10)/4}}}class U{constructor(t,e=null){this.w=t,this.ctx=e}dataLabelsCorrection(t,e,s,i,a,o,r){const n=this.w;let l=!1;const h=new N(this.w).getTextRects(s,r),c=h.width,d=h.height;e<0&&(e=0),e>n.layout.gridHeight+d&&(e=n.layout.gridHeight+d/2),void 0===n.globals.dataLabelsRects[i]&&(n.globals.dataLabelsRects[i]=[]),n.globals.dataLabelsRects[i].push({x:t,y:e,width:c,height:d});const g=n.globals.dataLabelsRects[i].length-2,p=void 0!==n.globals.lastDrawnDataLabelsIndexes[i]?n.globals.lastDrawnDataLabelsIndexes[i][n.globals.lastDrawnDataLabelsIndexes[i].length-1]:0;if(void 0!==n.globals.dataLabelsRects[i][g]){const s=n.globals.dataLabelsRects[i][p];(t>s.x+s.width||e>s.y+s.height||e+dr.config.dataLabels.formatter(t,{seriesIndex:s,dataPointIndex:d,w:r});if("bubble"===r.config.chart.type){o=r.seriesData.seriesZ[s][d],l=p(o),c=e.y[n];c=new V(this.w,this.ctx).centerTextInBubble(c).y}else void 0!==o&&(l=p(o));let u=r.config.dataLabels.textAnchor;r.globals.isSlopeChart&&(u=0===d?"end":d===r.config.series[s].data.length-1?"start":"middle"),this.plotDataLabelsText({x:h,y:c,text:l,i:s,j:d,parent:g,offsetCorrection:!0,dataLabelsConfig:r.config.dataLabels,textAnchor:u})}return g}plotDataLabelsText(t){const e=this.w,s=new N(this.w);let{x:i,y:a,i:o,j:r,text:n,textAnchor:l,fontSize:h,parent:c,dataLabelsConfig:d,color:g,alwaysDrawDataLabel:p,offsetCorrection:u,className:x}=t,f=null;if(Array.isArray(e.config.dataLabels.enabledOnSeries)&&e.config.dataLabels.enabledOnSeries.indexOf(o)<0)return f;let b={x:i,y:a,drawnextLabel:!0,textRects:null};if(u&&(b=this.dataLabelsCorrection(i,a,n,o,r,p,parseInt(d.style.fontSize,10).toString())),e.interact.zoomed||(i=b.x,a=b.y),b.textRects){const t=e.globals.barPadForNumericAxis||0;(i<-(t+20)-b.textRects.width||i>e.layout.gridWidth+b.textRects.width+t+30)&&(n="")}let m=e.globals.dataLabels.style.colors[o];(("bar"===e.config.chart.type||"rangeBar"===e.config.chart.type)&&e.config.plotOptions.bar.distributed||e.config.dataLabels.distributed)&&(m=e.globals.dataLabels.style.colors[r]),"function"==typeof m&&(m=m({series:e.seriesData.series,seriesIndex:o,dataPointIndex:r,w:e})),g&&(m=g);let y=d.offsetX,w=d.offsetY;if("bar"!==e.config.chart.type&&"rangeBar"!==e.config.chart.type||(y=0,w=0),e.globals.isSlopeChart&&(0!==r&&(y=-2*d.offsetX+5),0!==r&&r!==e.config.series[o].data.length-1&&(y=0)),b.drawnextLabel){if("middle"===l&&i===e.layout.gridWidth&&(l="end"),f=s.drawText({x:i+y,y:a+w,foreColor:m,textAnchor:l||d.textAnchor,text:n,fontSize:h||d.style.fontSize,fontFamily:d.style.fontFamily,fontWeight:d.style.fontWeight||"normal"}),f.attr({class:x||"apexcharts-datalabel",cx:i,cy:a}),d.dropShadow.enabled){const t=d.dropShadow;new H(this.w).dropShadow(f,t)}c.add(f),Y(f,i,e),void 0===e.globals.lastDrawnDataLabelsIndexes[o]&&(e.globals.lastDrawnDataLabelsIndexes[o]=[]),e.globals.lastDrawnDataLabelsIndexes[o].push(r)}return f}addBackgroundToDataLabel(t,e){const s=this.w,i=s.config.dataLabels.background,a=i.padding,o=i.padding/2,r=e.width,n=e.height,l=new N(this.w).drawRect(e.x-a,e.y-o/2,r+2*a,n+o,i.borderRadius,"transparent"!==s.config.chart.background&&s.config.chart.background?s.config.chart.background:"#fff",i.opacity,i.borderWidth,i.borderColor);if(i.dropShadow.enabled){new H(this.w).dropShadow(l,i.dropShadow)}return l}dataLabelsBackground(){var t;const e=this.w;if("bubble"===e.config.chart.type)return;const s=e.dom.baseEl.querySelectorAll(".apexcharts-datalabels text");for(let i=0;i0?(s=e[i].position,h=e[i].value):"datetime"===n.config.xaxis.type&&void 0===d&&(h=""),void 0===h&&(h=""),h=Array.isArray(h)?h:h.toString();const u=new N(this.w);let x={};x=n.layout.rotateXLabels&&r?u.getTextRects(h,parseInt(o,10).toString(),null,`rotate(${n.config.xaxis.labels.rotate} 0 0)`,!1):u.getTextRects(h,parseInt(o,10).toString());const f=!n.config.xaxis.labels.showDuplicates&&this.timeScale;return!Array.isArray(h)&&("NaN"===String(h)||a.indexOf(h)>=0&&f)&&(h=""),{x:s,text:h,textRect:x}}checkLabelBasedOnTickamount(t,e,s){const i=this.w;let a=i.config.xaxis.tickAmount;if("dataPoints"===a&&(a=Math.round(i.layout.gridWidth/120)),a>s)return e;return t%Math.round(s/(a+1))===0||(e.text=""),e}checkForOverflowingLabels(t,e,s,i,a){const o=this.w;if(0===t&&o.globals.skipFirstTimelinelabel&&(e.text=""),t===s-1&&o.globals.skipLastTimelinelabel&&(e.text=""),o.config.xaxis.labels.hideOverlappingLabels&&i.length>0){const t=a[a.length-1];if(o.config.xaxis.labels.trim&&"datetime"!==o.config.xaxis.type)return e;e.x-1===e.collapsedSeriesIndices.indexOf(t))}translateYAxisIndex(t){const e=this.w,s=e.globals,i=e.config.yaxis;return e.seriesData.series.length>i.length||i.some(t=>Array.isArray(t.seriesName))?t:s.seriesYAxisReverseMap[t]}isYAxisHidden(t){const e=this.w,s=e.config.yaxis[t];if(!s.show||this.yAxisAllSeriesCollapsed(t))return!0;if(!s.showForNullSeries){const s=e.globals.seriesYAxisMap[t],i=new E(this.w);return s.every(t=>i.isSeriesNull(t))}return!1}getYAxisForeColor(t,e){var s;const i=this.w;return Array.isArray(t)&&i.globals.yAxisScale[e]&&(null==(s=this.theme)||s.pushExtraColors(t,i.globals.yAxisScale[e].result.length,!1)),t}drawYAxisTicks(t,e,s,i,a,o,r){const n=this.w,l=new N(this.w);let h=n.layout.translateY+n.config.yaxis[a].labels.offsetY;if(n.globals.isBarHorizontal?h=0:"heatmap"===n.config.chart.type&&(h+=o/2),i.show&&e>0){!0===n.config.yaxis[a].opposite&&(t+=i.width);for(let a=e;a>=0;a--){const e=l.drawLine(t+s.offsetX-i.width+i.offsetX,h+i.offsetY,t+s.offsetX+i.offsetX,h+i.offsetY,i.color);r.add(e),h+=o}}}}class K{constructor(t,e,s){this.w=t,this.ctx=e,this.elgrid=s,this.axesUtils=new Z(t,{theme:e.theme,timeScale:e.timeScale}),this.xaxisLabels=t.labelData.labels.slice(),t.labelData.timescaleLabels.length>0&&!t.globals.isBarHorizontal&&(this.xaxisLabels=t.labelData.timescaleLabels.slice()),t.config.xaxis.overwriteCategories&&(this.xaxisLabels=t.config.xaxis.overwriteCategories),this.drawnLabels=[],this.drawnLabelsRects=[],"top"===t.config.xaxis.position?this.offY=0:this.offY=t.layout.gridHeight,this.offY=this.offY+t.config.xaxis.axisBorder.offsetY,this.isCategoryBarHorizontal="bar"===t.config.chart.type&&t.config.plotOptions.bar.horizontal,this.xaxisFontSize=t.config.xaxis.labels.style.fontSize,this.xaxisFontFamily=t.config.xaxis.labels.style.fontFamily,this.xaxisForeColors=t.config.xaxis.labels.style.colors,this.xaxisBorderWidth=t.config.xaxis.axisBorder.width,this.isCategoryBarHorizontal&&(this.xaxisBorderWidth=t.config.yaxis[0].axisBorder.width.toString()),String(this.xaxisBorderWidth).indexOf("%")>-1?this.xaxisBorderWidth=t.layout.gridWidth*parseInt(this.xaxisBorderWidth,10)/100:this.xaxisBorderWidth=parseInt(this.xaxisBorderWidth,10),this.xaxisBorderHeight=t.config.xaxis.axisBorder.height,this.yaxis=t.config.yaxis[0]}drawXaxis(){const t=this.w,e=new N(this.w),s=e.group({class:"apexcharts-xaxis",transform:`translate(${t.config.xaxis.offsetX}, ${t.config.xaxis.offsetY})`}),i=e.group({class:"apexcharts-xaxis-texts-g",transform:`translate(${t.layout.translateXAxisX}, ${t.layout.translateXAxisY})`});s.add(i);let a=[];for(let t=0;te),t.labelData.hasXaxisGroups){const s=t.labelData.groups;a=[];for(let t=0;ts[t].cols*e,o)}if(void 0!==t.config.xaxis.title.text){const i=e.group({class:"apexcharts-xaxis-title"}),a=e.drawText({x:t.layout.gridWidth/2+t.config.xaxis.title.offsetX,y:this.offY+parseFloat(this.xaxisFontSize)+("bottom"===t.config.xaxis.position?t.layout.xAxisLabelsHeight:-t.layout.xAxisLabelsHeight-10)+t.config.xaxis.title.offsetY,text:t.config.xaxis.title.text,textAnchor:"middle",fontSize:t.config.xaxis.title.style.fontSize,fontFamily:t.config.xaxis.title.style.fontFamily,fontWeight:t.config.xaxis.title.style.fontWeight,foreColor:t.config.xaxis.title.style.color,cssClass:"apexcharts-xaxis-title-text "+t.config.xaxis.title.style.cssClass});i.add(a),s.add(i)}if(t.config.xaxis.axisBorder.show){const i=t.globals.barPadForNumericAxis,a=e.drawLine(t.globals.padHorizontal+t.config.xaxis.axisBorder.offsetX-i,this.offY,this.xaxisBorderWidth+i,this.offY,t.config.xaxis.axisBorder.color,0,this.xaxisBorderHeight);this.elgrid&&this.elgrid.elGridBorders&&t.config.grid.show?this.elgrid.elGridBorders.add(a):s.add(a)}return s}drawXAxisLabelAndGroup(t,e,s,i,a,o,r={}){var n,l;const h=[],c=[],d=this.w,g=r.xaxisFontSize||this.xaxisFontSize,p=r.xaxisFontFamily||this.xaxisFontFamily,u=r.xaxisForeColors||this.xaxisForeColors,x=r.fontWeight||d.config.xaxis.labels.style.fontWeight,f=r.cssClass||d.config.xaxis.labels.style.cssClass;let m,y=d.globals.padHorizontal;const w=i.length;let v="category"===d.config.xaxis.type?d.globals.dataPoints:w;if(0===v&&w>v&&(v=w),a){const t=Math.max(Number(d.config.xaxis.tickAmount)||1,v>1?v-1:v);m=d.layout.gridWidth/Math.min(t,w-1),y=y+o(0,m)/2+d.config.xaxis.labels.offsetX}else m=d.layout.gridWidth/v,y=y+o(0,m)+d.config.xaxis.labels.offsetX;for(let a=0;a<=w-1;a++){let r=y-o(a,m)/2+d.config.xaxis.labels.offsetX;0===a&&1===w&&m/2===y&&1===v&&(r=d.layout.gridWidth/2);let A=this.axesUtils.getLabel(i,d.labelData.timescaleLabels,r,a,h,g,t),C=28;d.layout.rotateXLabels&&t&&(C=22),d.config.xaxis.title.text&&"top"===d.config.xaxis.position&&(C+=parseFloat(d.config.xaxis.title.style.fontSize)+2),t||(C=C+parseFloat(g)+(d.layout.xAxisLabelsHeight-d.layout.xAxisGroupLabelsHeight)+(d.layout.rotateXLabels?10:0));A=void 0!==d.config.xaxis.tickAmount&&"dataPoints"!==d.config.xaxis.tickAmount&&"datetime"!==d.config.xaxis.type?this.axesUtils.checkLabelBasedOnTickamount(a,A,w):this.axesUtils.checkForOverflowingLabels(a,A,w,h,c);const S=()=>t&&d.config.xaxis.convertedCatToNumeric?u[d.globals.minX+a-1]:u[a],k=(null!=(l=null==(n=A.textRect)?void 0:n.width)?l:0)/2,D=A.x+k<0;if(d.config.xaxis.labels.show&&!D){const i=e.drawText({x:A.x,y:this.offY+d.config.xaxis.labels.offsetY+C-("top"===d.config.xaxis.position?d.layout.xAxisHeight+d.config.xaxis.axisTicks.height-2:0),text:A.text,textAnchor:"middle",fontWeight:x,fontSize:g,fontFamily:p,foreColor:Array.isArray(u)?S():u,isPlainText:!1,cssClass:(t?"apexcharts-xaxis-label ":"apexcharts-xaxis-group-label ")+f});if(s.add(i),i.on("click",t=>{if("function"==typeof d.config.chart.events.xAxisLabelClick){const e=Object.assign({},d,{labelIndex:a});d.config.chart.events.xAxisLabelClick(t,this.ctx,e)}}),t){const t=b.createElementNS(W,"title");t.textContent=Array.isArray(A.text)?A.text.join(" "):A.text,i.node.appendChild(t),""!==A.text&&(h.push(A.text),c.push(A))}}aArray.isArray(d)?d[i]:d;let p=0;Array.isArray(a)&&(p=a.length/2*parseInt(c.style.fontSize,10));let u=c.offsetX-15,x="end";this.yaxis.opposite&&(x="start"),"left"===e.config.yaxis[0].labels.align?(u=c.offsetX,x="start"):"center"===e.config.yaxis[0].labels.align?(u=c.offsetX,x="middle"):"right"===e.config.yaxis[0].labels.align&&(x="end");const f=s.drawText({x:u,y:l+n+c.offsetY-p,text:a,textAnchor:x,foreColor:g(),fontSize:c.style.fontSize,fontFamily:c.style.fontFamily,fontWeight:c.style.fontWeight,isPlainText:!1,cssClass:"apexcharts-yaxis-label "+c.style.cssClass,maxWidth:c.maxWidth});o.add(f),f.on("click",t=>{if("function"==typeof e.config.chart.events.xAxisLabelClick){const s=Object.assign({},e,{labelIndex:i});e.config.chart.events.xAxisLabelClick(t,this.ctx,s)}});const m=b.createElementNS(W,"title");if(m.textContent=Array.isArray(a)?a.join(" "):a,f.node.appendChild(m),0!==e.config.yaxis[t].labels.rotate){const i=s.rotateAroundCenter(f.node);f.node.setAttribute("transform",`rotate(${e.config.yaxis[t].labels.rotate} 0 ${i.y})`)}l+=n}if(void 0!==e.config.yaxis[0].title.text){const t=s.group({class:"apexcharts-yaxis-title apexcharts-xaxis-title-inversed",transform:"translate("+i+", 0)"}),o=s.drawText({x:e.config.yaxis[0].title.offsetX,y:e.layout.gridHeight/2+e.config.yaxis[0].title.offsetY,text:e.config.yaxis[0].title.text,textAnchor:"middle",foreColor:e.config.yaxis[0].title.style.color,fontSize:e.config.yaxis[0].title.style.fontSize,fontWeight:e.config.yaxis[0].title.style.fontWeight,fontFamily:e.config.yaxis[0].title.style.fontFamily,cssClass:"apexcharts-yaxis-title-text "+e.config.yaxis[0].title.style.cssClass});t.add(o),a.add(t)}let d=0;this.isCategoryBarHorizontal&&e.config.yaxis[0].opposite&&(d=e.layout.gridWidth);const g=e.config.xaxis.axisBorder;if(g.show){const t=s.drawLine(e.globals.padHorizontal+g.offsetX+d,1+g.offsetY,e.globals.padHorizontal+g.offsetX+d,e.layout.gridHeight+g.offsetY,g.color,0);this.elgrid&&this.elgrid.elGridBorders&&e.config.grid.show?this.elgrid.elGridBorders.add(t):a.add(t)}return e.config.yaxis[0].axisTicks.show&&this.axesUtils.drawYAxisTicks(d,r.length,e.config.yaxis[0].axisBorder,e.config.yaxis[0].axisTicks,0,n,a),a}drawXaxisTicks(t,e,s){const i=this.w,a=t;if(t<0||t-2>i.layout.gridWidth)return;const o=this.offY+i.config.xaxis.axisTicks.offsetY;if(e=e+o+i.config.xaxis.axisTicks.height,"top"===i.config.xaxis.position&&(e=o-i.config.xaxis.axisTicks.height),i.config.xaxis.axisTicks.show){const r=new N(this.w).drawLine(t+i.config.xaxis.axisTicks.offsetX,o+i.config.xaxis.offsetY,a+i.config.xaxis.axisTicks.offsetX,e+i.config.xaxis.offsetY,i.config.xaxis.axisTicks.color);s.add(r),r.node.classList.add("apexcharts-xaxis-tick")}}getXAxisTicksPositions(){const t=this.w,e=[],s=this.xaxisLabels.length;let i=t.globals.padHorizontal;if(t.labelData.timescaleLabels.length>0)for(let t=0;t{a.placeTextWithEllipsis(t,t.textContent,i.layout.xAxisLabelsHeight-("bottom"===i.config.legend.position?20:10))})}else{const t=i.layout.gridWidth/(i.labelData.labels.length+1);for(let e=0;e{a.placeTextWithEllipsis(e,e.textContent,t)})}}if(n.length>0){const o=n[n.length-1].getBBox(),r=n[0].getBBox();o.x<-20&&(null==(t=n[n.length-1].parentNode)||t.removeChild(n[n.length-1])),r.x+r.width>i.layout.gridWidth&&!i.globals.isBarHorizontal&&(null==(e=n[0].parentNode)||e.removeChild(n[0]));for(let t=0;t0&&(this.xaxisLabels=t.labelData.timescaleLabels.slice())}drawGridArea(t=null){const e=this.w,s=new N(this.w);t||(t=s.group({class:"apexcharts-grid"}));const i=s.drawLine(e.globals.padHorizontal,1,e.globals.padHorizontal,e.layout.gridHeight,"transparent"),a=s.drawLine(e.globals.padHorizontal,e.layout.gridHeight,e.layout.gridWidth,e.layout.gridHeight,"transparent");return t.add(a),t.add(i),t}drawGrid(){if(this.w.globals.axisCharts){const t=this.renderGrid();return this.drawGridArea(t.el),t}return null}createGridMask(){const t=this.w,e=t.globals,s=new N(this.w),i=Array.isArray(t.config.stroke.width)?Math.max(...t.config.stroke.width):t.config.stroke.width,a=t=>{const e=b.createElementNS(W,"clipPath");return e.setAttribute("id",t),e};t.dom.elGridRectMask=a(`gridRectMask${e.cuid}`),t.dom.elGridRectBarMask=a(`gridRectBarMask${e.cuid}`),t.dom.elGridRectMarkerMask=a(`gridRectMarkerMask${e.cuid}`),t.dom.elForecastMask=a(`forecastMask${e.cuid}`),t.dom.elNonForecastMask=a(`nonForecastMask${e.cuid}`);let o=0,r=0;(["bar","rangeBar","candlestick","boxPlot"].includes(t.config.chart.type)||t.globals.comboBarCount>0)&&t.axisFlags.isXNumeric&&!t.globals.isBarHorizontal&&(o=Math.max(t.config.grid.padding.left,e.barPadForNumericAxis),r=Math.max(t.config.grid.padding.right,e.barPadForNumericAxis)),t.dom.elGridRect=s.drawRect(-i/2-2,-i/2-2,t.layout.gridWidth+i+4,t.layout.gridHeight+i+4,0,"#fff"),t.dom.elGridRectBar=s.drawRect(-i/2-o-2,-i/2-2,t.layout.gridWidth+i+r+o+4,t.layout.gridHeight+i+4,0,"#fff");const n=t.globals.markers.largestSize;t.dom.elGridRectMarker=s.drawRect(Math.min(-i/2-o-2,-n),-n,t.layout.gridWidth+Math.max(i+r+o+4,2*n),t.layout.gridHeight+2*n,0,"#fff"),t.dom.elGridRectMask.appendChild(t.dom.elGridRect.node),t.dom.elGridRectBarMask.appendChild(t.dom.elGridRectBar.node),t.dom.elGridRectMarkerMask.appendChild(t.dom.elGridRectMarker.node);const l=t.dom.elDefs.node;l.appendChild(t.dom.elGridRectMask),l.appendChild(t.dom.elGridRectBarMask),l.appendChild(t.dom.elGridRectMarkerMask),l.appendChild(t.dom.elForecastMask),l.appendChild(t.dom.elNonForecastMask)}_drawGridLines({i:t,x1:e,y1:s,x2:i,y2:a,xCount:o,parent:r}){const n=this.w;if(!(0===t&&n.globals.skipFirstTimelinelabel||t===o-1&&n.globals.skipLastTimelinelabel&&!n.config.xaxis.labels.formatter||"radar"===n.config.chart.type)){n.config.grid.xaxis.lines.show&&this._drawGridLine({i:t,x1:e,y1:s,x2:i,y2:a,xCount:o,parent:r});let l=0;if(n.labelData.hasXaxisGroups&&"between"===n.config.xaxis.tickPlacement){const e=n.labelData.groups;if(e){let s=0;for(let i=0;s{for(let r=0;r{for(let n=0;n0&&"datetime"!==i.config.xaxis.type&&(n=a.yAxisScale[r].result.length-1)),this._drawXYLines({xCount:n,tickAmount:l})):(n=l,l=a.xTickAmount,this._drawInvertedXYLines({xCount:n,tickAmount:l})),this.drawGridBands(n,l),{el:this.elg,elGridBorders:this.elGridBorders,xAxisTickWidth:i.layout.gridWidth/n}}drawGridBands(t,e){var s,i,a,o,r;const n=this.w,l=(t,s,i,a,o,r)=>{for(let l=0,h=0;l=n.config.grid[t].colors.length&&(h=0),this._drawGridBandRect({c:h,x1:i,y1:a,x2:o,y2:r,type:t}),a+=n.layout.gridHeight/e};if((null==(s=n.config.grid.row.colors)?void 0:s.length)>0&&l("row",e,0,0,n.layout.gridWidth,n.layout.gridHeight/e),(null==(i=n.config.grid.column.colors)?void 0:i.length)>0){let e=n.globals.isBarHorizontal||"on"!==n.config.xaxis.tickPlacement||"category"!==n.config.xaxis.type&&!n.config.xaxis.convertedCatToNumeric?t:t-1;n.axisFlags.isXNumeric&&(e=(null!=(o=null==(a=n.globals.xAxisScale)?void 0:a.result.length)?o:1)-1);let s=n.globals.padHorizontal;const i=0;let l=n.globals.padHorizontal+n.layout.gridWidth/e;const h=n.layout.gridHeight;for(let a=0,o=0;a=n.config.grid.column.colors.length&&(o=0),"datetime"===n.config.xaxis.type&&(s=this.xaxisLabels[a].position,l=((null==(r=this.xaxisLabels[a+1])?void 0:r.position)||n.layout.gridWidth)-this.xaxisLabels[a].position),this._drawGridBandRect({c:o,x1:s,y1:i,x2:l,y2:h,type:"column"}),s+=n.layout.gridWidth/e}}}class Q{constructor(t){this.w=t,this.coreUtils=new E(this.w)}niceScale(t,e,s=0){const i=1e-11,a=this.w,o=a.globals;let r,n,l,h;o.isBarHorizontal?(r=a.config.xaxis,n=Math.max((o.svgWidth-100)/25,2)):(r=a.config.yaxis[s],n=Math.max((o.svgHeight-100)/15,2)),m.isNumber(n)||(n=10),l=void 0!==r.min&&null!==r.min,h=void 0!==r.max&&null!==r.min;let c=void 0!==r.stepSize&&null!==r.stepSize,d=void 0!==r.tickAmount&&null!==r.tickAmount,g=d?r.tickAmount:M[Math.min(Math.round(n/2),M.length-1)];if(o.isMultipleYAxis&&!d&&o.multiAxisTickAmount>0&&(g=o.multiAxisTickAmount,d=!0),g="dataPoints"===g?o.dataPoints-1:Math.abs(Math.round(g)),(t===Number.MIN_VALUE&&0===e||!m.isNumber(t)&&!m.isNumber(e)||t===Number.MIN_VALUE&&e===-Number.MAX_VALUE)&&(t=m.isNumber(r.min)?r.min:0,e=m.isNumber(r.max)?r.max:t+g,o.allSeriesCollapsed=!1),t>e){const s=e;e=t,t=s}else t===e&&(t=0===t?0:t-1,e=0===e?2:e+1);const p=[];g<1&&(g=1);let u=g,x=Math.abs(e-t);!l&&t>0&&t/x<.15&&(t=0,l=!0),!h&&e<0&&-e/x<.15&&(e=0,h=!0),x=Math.abs(e-t);let f=x/u,b=f;const y=Math.floor(Math.log10(b)),w=Math.pow(10,y);let v=Math.ceil(b/w);if(v=L[0===o.yValueDecimal?0:1][v],b=v*w,f=b,o.isBarHorizontal&&r.stepSize&&"datetime"!==r.type?(f=r.stepSize,c=!0):c&&(f=r.stepSize),c&&r.forceNiceScale){const t=Math.floor(Math.log10(f));f*=Math.pow(10,y-t)}if(l&&h){let t=x/u;if(d)if(c)if(0!=m.mod(x,f)){const e=m.getGCD(f,t);f=t/e<10?e:t}else 0==m.mod(f,t)?f=t:(t=f,d=!1);else f=t;else if(c)0==m.mod(x,f)?t=f:f=t;else if(0==m.mod(x,f))t=f;else{u=Math.ceil(x/f),t=x/u;const e=m.getGCD(x,f);x/en&&(t=e-f*g,t+=f*Math.floor((s-t)/f))}else if(l)if(d)e=t+f*u;else{const s=e;e=f*Math.ceil(e/f),Math.abs(e-t)/m.getGCD(x,f)>n&&(e=t+f*g,e+=f*Math.ceil((s-e)/f))}}else if(o.isMultipleYAxis&&d){const s=f*Math.floor(t/f);let i=s+f*u;i0&&t16&&m.getPrimeFactors(u).length<2&&u++),!d&&r.forceNiceScale&&0===o.yValueDecimal&&u>x&&(u=x,f=Math.round(x/u)),u>n&&(!d&&!c||r.forceNiceScale)){const t=m.getPrimeFactors(u),e=t.length-1;let s=u;t:for(var A=0;AD);return{result:p,niceMin:p[0],niceMax:p[p.length-1]}}linearScale(t,e,s=10,i=0,a=void 0){const o=Math.abs(e-t);let r=[];if(t===e)return r=[t],{result:r,niceMin:r[0],niceMax:r[r.length-1]};"dataPoints"===(s=this._adjustTicksForSmallRange(s,i,o))&&(s=this.w.globals.dataPoints-1);const n=s;a||(a=o/n);if(0!==a&&isFinite(a)){const t=Math.floor(Math.log10(Math.abs(a))),e=Math.max(2,2-t),s=Math.pow(10,e);a=Math.round((a+Number.EPSILON)*s)/s}let l=s===Number.MAX_VALUE?5:n;s===Number.MAX_VALUE&&(a=1);let h=t;for(;l>=0;)r.push(h),h=m.preciseAddition(h,a),l-=1;return{result:r,niceMin:r[0],niceMax:r[r.length-1]}}logarithmicScaleNice(t,e,s){e<=0&&(e=Math.max(t,s)),t<=0&&(t=Math.min(e,s));const i=[],a=Math.ceil(Math.log(e)/Math.log(s)+1);for(let e=Math.floor(Math.log(t)/Math.log(s));e5?(i.allSeriesCollapsed=!1,i.yAxisScale[t]=o.forceNiceScale?this.logarithmicScaleNice(e,s,o.logBase):this.logarithmicScale(e,s,o.logBase)):s!==-Number.MAX_VALUE&&m.isNumber(s)&&e!==Number.MAX_VALUE&&m.isNumber(e)?(i.allSeriesCollapsed=!1,i.yAxisScale[t]=this.niceScale(e,s,t)):i.yAxisScale[t]=this.niceScale(Number.MIN_VALUE,0,t)}setXScale(t,e){const s=this.w,i=s.globals;if(e!==-Number.MAX_VALUE&&m.isNumber(e)){const a=i.xTickAmount;i.xAxisScale=this.linearScale(t,e,a,0,void 0===s.config.xaxis.max?s.config.xaxis.stepSize:void 0)}else i.xAxisScale=this.linearScale(0,10,10);return i.xAxisScale}scaleMultipleYAxes(){const t=this.w.config,e=this.w.globals;this.coreUtils.setSeriesYAxisMappings();const s=e.seriesYAxisMap,i=e.minYArr,a=e.maxYArr,o=[],r=!e.isBarHorizontal;if(e.allSeriesCollapsed=!0,e.barGroups=[],s.forEach((s,n)=>{const l=[];if(s.forEach(e=>{var s;const i=null==(s=t.series[e])?void 0:s.group;l.indexOf(i)<0&&l.push(i)}),s.length>0){let h,c,d=Number.MAX_VALUE,g=-Number.MAX_VALUE,p=d,u=g;if(t.chart.stacked){const i=new Array(e.dataPoints).fill(0),a=[],o=[],r=[];l.forEach(()=>{a.push(i.map(()=>Number.MIN_VALUE)),o.push(i.map(()=>Number.MIN_VALUE)),r.push(i.map(()=>Number.MIN_VALUE))});for(let i=0;i{if(t.series[d].group===e)for(let t=0;t=0?o[s][t]+=e:r[s][t]+=e,a[s][t]+=e,p=Math.min(p,e),u=Math.max(u,e)}})),"bar"!==h&&"column"!==h||e.barGroups.push(c)}h||(h=t.chart.type),"bar"===h||"column"===h?l.forEach((t,e)=>{d=Math.min(d,Math.min.apply(null,r[e])),g=Math.max(g,Math.max.apply(null,o[e]))}):(l.forEach((t,e)=>{p=Math.min(p,Math.min.apply(null,a[e])),u=Math.max(u,Math.max.apply(null,a[e]))}),d=p,g=u),d===Number.MIN_VALUE&&g===Number.MIN_VALUE&&(g=-Number.MAX_VALUE)}else for(let t=0;ts.indexOf(t)===e);const x=t.yaxis[n];r&&!0===x.alignZero&&!x.logarithmic&&void 0===x.min&&void 0===x.max&&e.ignoreYAxisIndexes.indexOf(n)<0&&m.isNumber(d)&&m.isNumber(g)?o.push({ai:n,minY:d,maxY:g}):(this.setYScaleForIndex(n,d,g),s.forEach(t=>{i[t]=e.yAxisScale[n].niceMin,a[t]=e.yAxisScale[n].niceMax}))}else this.setYScaleForIndex(n,0,-Number.MAX_VALUE)}),o.length>=2){o.forEach(t=>{this.setYScaleForIndex(t.ai,t.minY,t.maxY),s[t.ai].forEach(s=>{i[s]=e.yAxisScale[t.ai].niceMin,a[s]=e.yAxisScale[t.ai].niceMax})});let t=0;o.forEach(s=>{const i=e.yAxisScale[s.ai],a=i.niceMax-i.niceMin;if(a>0){const e=-i.niceMin/a;e>t&&(t=e)}}),t>1&&(t=1),t<0&&(t=0);const r=t=>{if(t<=0)return 1;const e=Math.floor(Math.log10(t)),s=Math.pow(10,e),i=t/s;let a;return a=i<=1+1e-9?1:i<=2+1e-9?2:i<=2.5+1e-9?2.5:i<=5+1e-9?5:10,a*s};o.forEach(o=>{const n=e.yAxisScale[o.ai];if(!n.result||n.result.length<2)return;const l=n.niceMax-n.niceMin;if(l<=0)return;const h=-n.niceMin/l;if(Math.abs(h-t)<=1e-9)return;const c=ht&&t>1e-9;if(!c&&!d)return;const g=c?-t*n.niceMax/(1-t):n.niceMin,p=d?-n.niceMin*(1-t)/t:n.niceMax,u=p-g;if(u<=0)return;const x=Math.max(n.result.length,5),f=r(u/Math.max(x-1,1));if(f<=0)return;let b,y;if(c){b=Math.floor(g/f+1e-9)*f;const e=t>1e-9?b*(t-1)/t:n.niceMax,s=Math.max(e,n.niceMax);y=Math.ceil(s/f-1e-9)*f}else{y=Math.ceil(p/f-1e-9)*f;const e=t<1-1e-9?-t*y/(1-t):n.niceMin,s=Math.min(e,n.niceMin);b=Math.floor(s/f+1e-9)*f}n.result=[];for(let t=b;t<=y+1e-9*f;t=m.preciseAddition(t,f))n.result.push(m.stripNumber(t,7));n.niceMin=b,n.niceMax=y,s[o.ai].forEach(t=>{i[t]=n.niceMin,a[t]=n.niceMax})})}else if(1===o.length){const t=o[0];this.setYScaleForIndex(t.ai,t.minY,t.maxY),s[t.ai].forEach(s=>{i[s]=e.yAxisScale[t.ai].niceMin,a[s]=e.yAxisScale[t.ai].niceMax})}}}class tt{constructor(t){this.w=t,this.scales=new Q(this.w)}init(){this.setYRange(),this.setXRange(),this.setZRange()}getMinYMaxY(t,e=Number.MAX_VALUE,s=-Number.MAX_VALUE,i=null){var a,o,r,n,l;const h=this.w.config,c=this.w.globals;let d=-Number.MAX_VALUE,g=Number.MIN_VALUE;null===i&&(i=t+1);const p=this.w.seriesData.series;let u=p,x=p;"candlestick"===h.chart.type?(u=this.w.candleData.seriesCandleL,x=this.w.candleData.seriesCandleH):"boxPlot"===h.chart.type?(u=this.w.candleData.seriesCandleO,x=this.w.candleData.seriesCandleC):this.w.axisFlags.isRangeData&&(u=this.w.rangeData.seriesRangeStart,x=this.w.rangeData.seriesRangeEnd);let f=!1;if(this.w.seriesData.seriesX.length>=i){const t=null==(a=c.brushSource)?void 0:a.w.config.chart.brush;(h.chart.zoom.enabled&&h.chart.zoom.autoScaleYaxis||(null==t?void 0:t.enabled)&&(null==t?void 0:t.autoScaleYaxis))&&(f=!0)}for(let a=t;avoid 0!==t).length),this.w.labelData.labels.length&&"datetime"!==h.xaxis.type&&0!==this.w.seriesData.series.reduce((t,e)=>t+e.length,0)&&(c.dataPoints=Math.max(c.dataPoints,this.w.labelData.labels.length));let i=0,b=p[a].length-1;if(f){if(h.xaxis.min)for(;ii&&this.w.seriesData.seriesX[a][b]>h.xaxis.max;b--);}for(let h=i;h<=b&&h{d=Math.max(d,t.value),e=Math.min(e,t.value)}),s=d,i=m.noExponents(i),m.isFloat(i)&&(c.yValueDecimal=Math.max(c.yValueDecimal,i.toString().split(".")[1].length)),g>(null==(n=u[a])?void 0:n[h])&&(null==(l=u[a])?void 0:l[h])<0&&(g=u[a][h])}else c.hasNullValues=!0}"bar"!==t&&"column"!==t||(g<0&&d<0&&(d=0,s=Math.max(s,0)),g===Number.MIN_VALUE&&(g=0,e=Math.min(e,0)))}return"rangeBar"===h.chart.type&&this.w.rangeData.seriesRangeStart.length&&c.isBarHorizontal&&(g=e),"bar"===h.chart.type&&(g<0&&d<0&&(d=0),g===Number.MIN_VALUE&&(g=0)),{minY:g,maxY:d,lowestY:e,highestY:s}}setYRange(){const t=this.w.globals,e=this.w.config;t.maxY=-Number.MAX_VALUE,t.minY=Number.MIN_VALUE;let s,i=Number.MAX_VALUE;if(t.isMultipleYAxis){i=Number.MAX_VALUE;for(let e=0;e{void 0!==e.max&&("number"==typeof e.max?t.maxYArr[s]=e.max:"function"==typeof e.max&&(t.maxYArr[s]=e.max(t.isMultipleYAxis?t.maxYArr[s]:t.maxY)),t.maxY=t.maxYArr[s]),void 0!==e.min&&("number"==typeof e.min?t.minYArr[s]=e.min:"function"==typeof e.min&&(t.minYArr[s]=e.min(t.isMultipleYAxis?t.minYArr[s]===Number.MIN_VALUE?0:t.minYArr[s]:t.minY)),t.minY=t.minYArr[s])}),t.isBarHorizontal){["min","max"].forEach(s=>{void 0!==e.xaxis[s]&&"number"==typeof e.xaxis[s]&&("min"===s?t.minY=e.xaxis[s]:t.maxY=e.xaxis[s])})}return t.isMultipleYAxis?(this.scales.scaleMultipleYAxes(),t.minY=i):(this.scales.setYScaleForIndex(0,t.minY,t.maxY),t.minY=t.yAxisScale[0].niceMin,t.maxY=t.yAxisScale[0].niceMax,t.minYArr[0]=t.minY,t.maxYArr[0]=t.maxY),t.barGroups=[],t.lineGroups=[],t.areaGroups=[],e.series.forEach(s=>{const i=s;switch(i.type||e.chart.type){case"bar":case"column":t.barGroups.push(i.group);break;case"line":t.lineGroups.push(i.group);break;case"area":t.areaGroups.push(i.group)}}),t.barGroups=t.barGroups.filter((t,e,s)=>s.indexOf(t)===e),t.lineGroups=t.lineGroups.filter((t,e,s)=>s.indexOf(t)===e),t.areaGroups=t.areaGroups.filter((t,e,s)=>s.indexOf(t)===e),{minY:t.minY,maxY:t.maxY,minYArr:t.minYArr,maxYArr:t.maxYArr,yAxisScale:t.yAxisScale}}setXRange(){const t=this.w.globals,e=this.w.config,s="numeric"===e.xaxis.type||"datetime"===e.xaxis.type||"category"===e.xaxis.type&&!this.w.axisFlags.noLabelsProvided||this.w.axisFlags.noLabelsProvided||this.w.axisFlags.isXNumeric,i=()=>{for(let e=0;et.dataPoints&&0!==t.dataPoints&&(i=t.dataPoints-1);else if("dataPoints"===e.xaxis.tickAmount){if(this.w.seriesData.series.length>1&&(i=this.w.seriesData.series[t.maxValsInArrayIndex].length-1),this.w.axisFlags.isXNumeric){const e=Math.round(t.maxX-t.minX);e<30&&(i=e)}}else i=e.xaxis.tickAmount;if(t.xTickAmount=i,void 0!==e.xaxis.max&&"number"==typeof e.xaxis.max&&(t.maxX=e.xaxis.max),void 0!==e.xaxis.min&&"number"==typeof e.xaxis.min&&(t.minX=e.xaxis.min),void 0!==e.xaxis.range&&(t.minX=t.maxX-e.xaxis.range),t.minX!==Number.MAX_VALUE&&t.maxX!==-Number.MAX_VALUE)if(e.xaxis.convertedCatToNumeric&&!this.w.axisFlags.dataFormatXNumeric){const e=[];for(let s=t.minX-1;s0&&(t.xAxisScale=this.scales.linearScale(1,this.w.labelData.labels.length,i-1,0,e.xaxis.stepSize),this.w.seriesData.seriesX=this.w.labelData.labels.slice());s&&(this.w.labelData.labels=t.xAxisScale.result.slice())}return t.isBarHorizontal&&this.w.labelData.labels.length&&(t.xTickAmount=this.w.labelData.labels.length),this._handleSingleDataPoint(),this._getMinXDiff(),{minX:t.minX,maxX:t.maxX}}setZRange(){const t=this.w.globals;if(this.w.axisFlags.isDataXYZ)for(let e=0;e{if(e.length){1===e.length&&e.push(this.w.seriesData.seriesX[t.maxValsInArrayIndex][this.w.seriesData.seriesX[t.maxValsInArrayIndex].length-1]);const s=e.slice();s.sort((t,e)=>t-e),s.forEach((e,i)=>{if(i>0){const a=e-s[i-1];a>0&&(t.minXDiff=Math.min(a,t.minXDiff))}}),1!==t.dataPoints&&t.minXDiff!==Number.MAX_VALUE||(t.minXDiff=.5)}})}_setStackedMinMax(){const t=this.w.globals;if(!this.w.seriesData.series.length)return;let e=this.w.labelData.seriesGroups;e.length||(e=[this.w.seriesData.seriesNames.map(t=>t)]);const s={},i={};e.forEach(e=>{s[e]=[],i[e]=[];this.w.config.series.map((t,s)=>e.indexOf(this.w.seriesData.seriesNames[s])>-1?s:null).filter(t=>null!==t).forEach(a=>{var o,r,n,l;for(let h=0;h0?s[e][h]+=parseFloat(String(this.w.seriesData.series[a][h]))+1e-4:i[e][h]+=parseFloat(String(this.w.seriesData.series[a][h])))}})}),Object.entries(s).forEach(([e])=>{s[e].forEach((a,o)=>{t.maxY=Math.max(t.maxY,s[e][o]),t.minY=Math.min(t.minY,i[e][o])})})}}class et{constructor(t,{theme:e=null,timeScale:s=null}={},i){this.w=t,this.elgrid=i,this.xaxisFontSize=t.config.xaxis.labels.style.fontSize,this.axisFontFamily=t.config.xaxis.labels.style.fontFamily,this.xaxisForeColors=t.config.xaxis.labels.style.colors,this.isCategoryBarHorizontal="bar"===t.config.chart.type&&t.config.plotOptions.bar.horizontal,this.xAxisoffX="bottom"===t.config.xaxis.position?t.layout.gridHeight:0,this.drawnLabels=[],this.axesUtils=new Z(t,{theme:e,timeScale:s})}drawYaxis(t){const e=this.w,s=new N(this.w),i=e.config.yaxis[t].labels.style,{fontSize:a,fontFamily:o,fontWeight:r}=i,n=s.group({class:"apexcharts-yaxis",rel:t,transform:`translate(${e.globals.translateYAxisX[t]}, 0)`});if(this.axesUtils.isYAxisHidden(t))return n;const l=s.group({class:"apexcharts-yaxis-texts-g"});n.add(l);const h=e.globals.yAxisScale[t].result.length-1,c=e.layout.gridHeight/h,d=e.formatters.yLabelFormatters[t],g=this.axesUtils.checkForReversedLabels(t,e.globals.yAxisScale[t].result.slice());if(e.config.yaxis[t].labels.show){let n=e.layout.translateY+e.config.yaxis[t].labels.offsetY;e.globals.isBarHorizontal?n=0:"heatmap"===e.config.chart.type&&(n-=c/2),n+=parseInt(a,10)/3;let p=null;for(let u=h;u>=0;u--){const h=d(g[u],u,e);let x=e.config.yaxis[t].labels.padding;e.config.yaxis[t].opposite&&0!==e.config.yaxis.length&&(x*=-1);const f=this.getTextAnchor(e.config.yaxis[t].labels.align,e.config.yaxis[t].opposite),b=this.axesUtils.getYAxisForeColor(i.colors,t),m=Array.isArray(b)?b[u]:b,y=Array.from(e.dom.baseEl.querySelectorAll(`.apexcharts-yaxis[rel='${t}'] .apexcharts-yaxis-label tspan`)).map(t=>t.textContent),w=s.drawText({x:x,y:n,text:y.includes(h)&&!e.config.yaxis[t].labels.showDuplicates?"":h,textAnchor:f,fontSize:a,fontFamily:o,fontWeight:r,maxWidth:e.config.yaxis[t].labels.maxWidth,foreColor:m,isPlainText:!1,cssClass:`apexcharts-yaxis-label ${i.cssClass}`});l.add(w),this.addTooltip(w,h),null===p&&(p=w),0!==e.config.yaxis[t].labels.rotate&&this.rotateLabel(s,w,p,e.config.yaxis[t].labels.rotate),n+=c}}return this.addYAxisTitle(s,n,t),this.addAxisBorder(s,n,t,h,c),n}getTextAnchor(t,e){return"left"===t?"start":"center"===t?"middle":"right"===t?"end":e?"start":"end"}addTooltip(t,e){const s=b.createElementNS(W,"title");s.textContent=Array.isArray(e)?e.join(" "):e,t.node.appendChild(s)}rotateLabel(t,e,s,i){const a=t.rotateAroundCenter(s.node),o=t.rotateAroundCenter(e.node);e.node.setAttribute("transform",`rotate(${i} ${a.x} ${o.y})`)}addYAxisTitle(t,e,s){const i=this.w;if(void 0!==i.config.yaxis[s].title.text){const a=t.group({class:"apexcharts-yaxis-title"}),o=i.config.yaxis[s].opposite?i.globals.translateYAxisX[s]:0,r=t.drawText({x:o,y:i.layout.gridHeight/2+i.layout.translateY+i.config.yaxis[s].title.offsetY,text:i.config.yaxis[s].title.text,textAnchor:"end",foreColor:i.config.yaxis[s].title.style.color,fontSize:i.config.yaxis[s].title.style.fontSize,fontWeight:i.config.yaxis[s].title.style.fontWeight,fontFamily:i.config.yaxis[s].title.style.fontFamily,cssClass:`apexcharts-yaxis-title-text ${i.config.yaxis[s].title.style.cssClass}`});a.add(r),e.add(a)}}addAxisBorder(t,e,s,i,a){const o=this.w,r=o.config.yaxis[s].axisBorder;let n=31+r.offsetX;if(o.config.yaxis[s].opposite&&(n=-31-r.offsetX),r.show){const s=t.drawLine(n,o.layout.translateY+r.offsetY-2,n,o.layout.gridHeight+o.layout.translateY+r.offsetY+2,r.color,0,r.width);e.add(s)}o.config.yaxis[s].axisTicks.show&&this.axesUtils.drawYAxisTicks(n,i,r,o.config.yaxis[s].axisTicks,s,a,e)}drawYaxisInversed(t){const e=this.w,s=new N(this.w),i=s.group({class:"apexcharts-xaxis apexcharts-yaxis-inversed"}),a=s.group({class:"apexcharts-xaxis-texts-g",transform:`translate(${e.layout.translateXAxisX}, ${e.layout.translateXAxisY})`});i.add(a);let o=e.globals.yAxisScale[t].result.length-1;const r=e.layout.gridWidth/o+.1;let n=r+e.config.xaxis.labels.offsetX;const l=e.formatters.xLabelFormatter;let h=this.axesUtils.checkForReversedLabels(t,e.globals.yAxisScale[t].result.slice());const c=e.labelData.timescaleLabels;if(c.length>0&&(this.xaxisLabels=c.slice(),h=c.slice(),o=h.length),e.config.xaxis.labels.show)for(let i=c.length?0:o;c.length?i