UNPKG

apexcharts

Version:

A JavaScript Chart Library

6 lines 424 kB
/*!
 * ApexCharts v7.0.0
 * (c) 2018-2026 ApexCharts
 */
"use strict";var t=Object.defineProperty,e=Object.defineProperties,i=Object.getOwnPropertyDescriptors,s=Object.getOwnPropertySymbols,a=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable,n=(e,i,s)=>i in e?t(e,i,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[i]=s,o=(t,e)=>{for(var i in e||(e={}))a.call(e,i)&&n(t,i,e[i]);if(s)for(var i of s(e))r.call(e,i)&&n(t,i,e[i]);return t},l=(t,s)=>e(t,i(s));Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});function h(t){if(t&&t.__esModule)return t;const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t)for(const i in t)if("default"!==i){const s=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(e,i,s.get?s:{enumerable:!0,get:()=>t[i]})}return e.default=t,Object.freeze(e)}const c=h(require("apexcharts/core")),d=c.__apex_charts_Scatter,u=c.__apex_Animations,p=c.__apex_Animations_computeStagger,g=c.__apex_Animations_applyAnimationPolicy,f=c.__apex_Animations_prefersReducedMotion,m=c.__apex_Animations_applyProgressiveReveal,x=c.__apex_Base,b=c.__apex_ChartFactory_register,y=c.__apex_ChartFactory_getChartClass,w=c.__apex_ChartFactory_isCustom,v=c.__apex_Core,_=c.__apex_CoreUtils,A=c.__apex_Crosshairs,S=c.__apex_Data,C=c.__apex_DataLabels,k=c.__apex_Events,M=c.__apex_Fill,P=c.__apex_Filters,L=c.__apex_Formatters,I=c.__apex_Graphics,E=c.__apex_Markers,R=c.__apex_Range,D=c.__apex_Responsive,F=c.__apex_Scales,X=c.__apex_Series,T=c.__apex_Theme,z=c.__apex_TimeScale,Y=c.__apex_TitleSubtitle,W=c.__apex_axes_Axes,O=c.__apex_axes_AxesUtils,B=c.__apex_axes_Grid,$=c.__apex_axes_XAxis,N=c.__apex_axes_YAxis,H=c.__apex_dimensions_Dimensions,j=c.__apex_dimensions_Grid,V=c.__apex_dimensions_Helpers,G=c.__apex_dimensions_XAxis,q=c.__apex_dimensions_YAxis,Z=c.__apex_helpers_Destroy,U=c.__apex_helpers_InitCtxVariables,K=c.__apex_helpers_Localization,J=c.__apex_helpers_UpdateHelpers,Q=c.__apex_Config,tt=c.__apex_Defaults,et=c.__apex_Globals,it=c.__apex_Options,st=c.__apex_tooltip_AxesTooltip,at=c.__apex_tooltip_Intersect,rt=c.__apex_tooltip_Labels,nt=c.__apex_tooltip_Marker,ot=c.__apex_tooltip_Position,lt=c.__apex_tooltip_Tooltip,ht=c.__apex_tooltip_Utils,ct=c.__apex_BrowserAPIs_BrowserAPIs,dt=c.__apex_DOMShim_SSRDOMShim,ut=c.__apex_DOMShim_SSRElement,pt=c.__apex_DOMShim_SSRClassList,gt=c.__apex_PathMorphing_parsePath,ft=c.__apex_PathMorphing_morphPaths,mt=c.__apex_PathMorphing_pathBbox,xt=c.__apex_PathMorphing_arrayToPath,bt=c.__apex_SVGAnimation_SVGAnimationRunner,yt=c.__apex_SVGAnimation_installAnimationMethods,wt=c.__apex_SVGContainer,vt=c.__apex_SVGDraggable_installDraggable,_t=c.__apex_SVGElement,At=c.__apex_SVGFilter_SVGFilter,St=c.__apex_SVGFilter_FilterBuilder,Ct=c.__apex_SVGFilter_installFilterMethods,kt=c.__apex_SVGGradient_SVGGradient,Mt=c.__apex_SVGPattern_SVGPattern,Pt=c.__apex_SVGSelectable_installSelectable,Lt=c.__apex_index_SVG,It=c.__apex_index_Box,Et=c.__apex_math_SVGNS,Rt=c.__apex_math_Point,Dt=c.__apex_math_Matrix,Ft=c.__apex_math_Box,Xt=c.__apex_Constants_LINE_HEIGHT_RATIO,Tt=c.__apex_Constants_NICE_SCALE_ALLOWED_MAG_MSD,zt=c.__apex_Constants_NICE_SCALE_DEFAULT_TICKS,Yt=c.__apex_DateTime,Wt=c.__apex_Environment_Environment,Ot=c.__apex_PerformanceCache,Bt=c.__apex_Resize_addResizeListener,$t=c.__apex_Resize_removeResizeListener,Nt=c.__apex_ThemePalettes_getThemePalettes,Ht=c.__apex_Utils,jt=Object.freeze(Object.defineProperty({__proto__:null,__apex_Animations:u,__apex_Animations_applyAnimationPolicy:g,__apex_Animations_applyProgressiveReveal:m,__apex_Animations_computeStagger:p,__apex_Animations_prefersReducedMotion:f,__apex_Base:x,__apex_BrowserAPIs_BrowserAPIs:ct,__apex_ChartFactory_getChartClass:y,__apex_ChartFactory_isCustom:w,__apex_ChartFactory_register:b,__apex_Config:Q,__apex_Constants_LINE_HEIGHT_RATIO:Xt,__apex_Constants_NICE_SCALE_ALLOWED_MAG_MSD:Tt,__apex_Constants_NICE_SCALE_DEFAULT_TICKS:zt,__apex_Core:v,__apex_CoreUtils:_,__apex_Crosshairs:A,__apex_DOMShim_SSRClassList:pt,__apex_DOMShim_SSRDOMShim:dt,__apex_DOMShim_SSRElement:ut,__apex_Data:S,__apex_DataLabels:C,__apex_DateTime:Yt,__apex_Defaults:tt,__apex_Environment_Environment:Wt,__apex_Events:k,__apex_Fill:M,__apex_Filters:P,__apex_Formatters:L,__apex_Globals:et,__apex_Graphics:I,__apex_Markers:E,__apex_Options:it,__apex_PathMorphing_arrayToPath:xt,__apex_PathMorphing_morphPaths:ft,__apex_PathMorphing_parsePath:gt,__apex_PathMorphing_pathBbox:mt,__apex_PerformanceCache:Ot,__apex_Range:R,__apex_Resize_addResizeListener:Bt,__apex_Resize_removeResizeListener:$t,__apex_Responsive:D,__apex_SVGAnimation_SVGAnimationRunner:bt,__apex_SVGAnimation_installAnimationMethods:yt,__apex_SVGContainer:wt,__apex_SVGDraggable_installDraggable:vt,__apex_SVGElement:_t,__apex_SVGFilter_FilterBuilder:St,__apex_SVGFilter_SVGFilter:At,__apex_SVGFilter_installFilterMethods:Ct,__apex_SVGGradient_SVGGradient:kt,__apex_SVGPattern_SVGPattern:Mt,__apex_SVGSelectable_installSelectable:Pt,__apex_Scales:F,__apex_Series:X,__apex_Theme:T,__apex_ThemePalettes_getThemePalettes:Nt,__apex_TimeScale:z,__apex_TitleSubtitle:Y,__apex_Utils:Ht,__apex_axes_Axes:W,__apex_axes_AxesUtils:O,__apex_axes_Grid:B,__apex_axes_XAxis:$,__apex_axes_YAxis:N,__apex_charts_Scatter:d,__apex_dimensions_Dimensions:H,__apex_dimensions_Grid:j,__apex_dimensions_Helpers:V,__apex_dimensions_XAxis:G,__apex_dimensions_YAxis:q,__apex_helpers_Destroy:Z,__apex_helpers_InitCtxVariables:U,__apex_helpers_Localization:K,__apex_helpers_UpdateHelpers:J,__apex_index_Box:It,__apex_index_SVG:Lt,__apex_math_Box:Ft,__apex_math_Matrix:Dt,__apex_math_Point:Rt,__apex_math_SVGNS:Et,__apex_tooltip_AxesTooltip:st,__apex_tooltip_Intersect:at,__apex_tooltip_Labels:rt,__apex_tooltip_Marker:nt,__apex_tooltip_Position:ot,__apex_tooltip_Tooltip:lt,__apex_tooltip_Utils:ht,default:c.default},Symbol.toStringTag,{value:"Module"}));class Vt{constructor(t,e){this.w=t,this.ctx=e}svgStringToNode(t){return(new DOMParser).parseFromString(t,"image/svg+xml").documentElement}scaleSvgNode(t,e){const i=parseFloat(t.getAttributeNS(null,"width")),s=parseFloat(t.getAttributeNS(null,"height"));t.setAttributeNS(null,"width",i*e),t.setAttributeNS(null,"height",s*e),t.setAttributeNS(null,"viewBox","0 0 "+i+" "+s)}inlineCanvasLayers(t){const e=this.w.dom.elWrap.querySelectorAll(".apexcharts-series-canvas");if(!e.length)return;const i=t.querySelectorAll(".apexcharts-canvas-series");for(let t=0;t<e.length&&t<i.length;t++){let s;try{s=e[t].toDataURL()}catch(t){continue}const a=i[t],r=document.createElementNS(Et,"image");r.setAttribute("x",a.getAttribute("x")||"0"),r.setAttribute("y",a.getAttribute("y")||"0"),r.setAttribute("width",a.getAttribute("width")||"0"),r.setAttribute("height",a.getAttribute("height")||"0"),r.setAttribute("href",s),r.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",s),a.parentNode&&a.parentNode.replaceChild(r,a)}}queryStyleable(t,e){return Array.prototype.slice.call(t.querySelectorAll(e))}setStyleDefaults(t,e){Object.keys(e).forEach(i=>{""===t.style.getPropertyValue(i)&&t.style.setProperty(i,e[i])})}applyExportStyles(t){const e=this.w;this.queryStyleable(t,"style").forEach(t=>t.remove()),this.queryStyleable(t,[".apexcharts-tooltip",".apexcharts-toolbar",".apexcharts-xaxistooltip",".apexcharts-yaxistooltip",".apexcharts-xcrosshairs",".apexcharts-ycrosshairs",".apexcharts-zoom-rect",".apexcharts-selection-rect"].join(", ")).forEach(t=>{t.style.setProperty("display","none","important")}),this.queryStyleable(t,".apexcharts-flip-y").forEach(t=>{this.setStyleDefaults(t,{transform:"scaleY(-1) translateY(-100%)","transform-origin":"top","transform-box":"fill-box"})}),this.queryStyleable(t,".apexcharts-flip-x").forEach(t=>{this.setStyleDefaults(t,{transform:"scaleX(-1)","transform-origin":"center","transform-box":"fill-box"})}),e.config.legend.show&&e.dom.elLegendWrap&&e.dom.elLegendWrap.children.length&&(this.queryStyleable(t,".apexcharts-legend").forEach(t=>{this.setStyleDefaults(t,{display:"flex",overflow:"auto",padding:"0 10px"});const e=t.classList,i=e.contains("apx-legend-position-left")||e.contains("apx-legend-position-right"),s=e.contains("apx-legend-position-top")||e.contains("apx-legend-position-bottom");e.contains("apexcharts-legend-group-horizontal")&&this.setStyleDefaults(t,{"flex-direction":"column"}),i&&this.setStyleDefaults(t,{"flex-direction":"column",bottom:"0"}),s&&this.setStyleDefaults(t,{"flex-wrap":"wrap"}),i||s&&e.contains("apexcharts-align-left")?this.setStyleDefaults(t,{"justify-content":"flex-start","align-items":"flex-start"}):s&&e.contains("apexcharts-align-center")?this.setStyleDefaults(t,{"justify-content":"center","align-items":"center"}):s&&e.contains("apexcharts-align-right")&&this.setStyleDefaults(t,{"justify-content":"flex-end","align-items":"flex-end"})}),this.queryStyleable(t,".apexcharts-legend-group").forEach(t=>{this.setStyleDefaults(t,{display:"flex"})}),this.queryStyleable(t,".apexcharts-legend-group-vertical").forEach(t=>{this.setStyleDefaults(t,{"flex-direction":"column-reverse"})}),this.queryStyleable(t,".apexcharts-legend-series").forEach(t=>{this.setStyleDefaults(t,{cursor:t.classList.contains("apexcharts-no-click")?"auto":"pointer","line-height":"normal",display:"flex","align-items":"center"})}),this.queryStyleable(t,".apexcharts-legend-text").forEach(t=>{this.setStyleDefaults(t,{position:"relative","font-size":"14px"})}),this.queryStyleable(t,".apexcharts-legend-marker").forEach(t=>{this.setStyleDefaults(t,{position:"relative",display:"flex","align-items":"center","justify-content":"center",cursor:"pointer","margin-right":"1px"})}),this.queryStyleable(t,".apexcharts-inactive-legend").forEach(t=>{this.setStyleDefaults(t,{opacity:"0.45"})}),this.queryStyleable(t,".apexcharts-legend .apexcharts-hidden-zero-series, .apexcharts-legend .apexcharts-hidden-null-series").forEach(t=>{t.style.setProperty("display","none","important")}))}resolveExportBackground(){const t=this.w,e=t.config.chart.background;return e&&"transparent"!==e?e:"dark"===t.config.theme.mode?"#343A3F":"#fff"}collectFontFamilies(){const t=new Set,e=this.w;if(!Wt.isBrowser()||!e.dom.elWrap)return t;const i=this.queryStyleable(e.dom.elWrap,"text, tspan, .apexcharts-legend-text, .apexcharts-title-text, .apexcharts-subtitle-text");return[e.dom.elWrap,...i].forEach(e=>{const i=ct.getComputedStyle(e),s=i&&i.fontFamily;s&&s.split(",").forEach(e=>{const i=e.trim().replace(/^['"]|['"]$/g,"");i&&t.add(i.toLowerCase())})}),t}collectFontFaceRules(){if(!Wt.isBrowser())return Promise.resolve([]);const t=[],e=[],i=e=>{(e.match(/@font-face\s*\{[^}]*\}/gi)||[]).forEach(e=>{const i=e.match(/font-family\s*:\s*([^;}]+)/i);if(!i)return;const s=i[1].trim().replace(/^['"]|['"]$/g,"");t.push({family:s.toLowerCase(),css:e})})};return Array.from(document.styleSheets||[]).forEach(t=>{let s=null;try{s=t.cssRules}catch(t){s=null}s?Array.from(s).forEach(t=>{5===t.type&&t.cssText&&i(t.cssText)}):t.href&&e.push(fetch(t.href).then(t=>t.ok?t.text():"").then(i).catch(()=>{}))}),Promise.all(e).then(()=>t)}embedFonts(t){const e=this.w;if(!Wt.isBrowser()||!e.config.chart.toolbar.export.embedFonts||"function"!=typeof fetch)return Promise.resolve();const i=this.collectFontFamilies();return i.size?this.collectFontFaceRules().then(t=>{const e=t.filter(t=>i.has(t.family));return e.length?Promise.all(e.map(t=>this.inlineFontFaceUrls(t.css).catch(()=>null))):Promise.resolve([])}).then(e=>{const i=(e||[]).filter(Boolean).join("\n");if(!i)return;const s=document.createElementNS(Et,"style");s.textContent=i,t.insertBefore(s,t.firstChild)}).catch(()=>{}):Promise.resolve()}inlineFontFaceUrls(t){const e=[],i=/url\(\s*(['"]?)([^'")]+)\1\s*\)/gi;let s;for(;null!==(s=i.exec(t));)s[2].startsWith("data:")||e.push(s[2]);return e.length?Promise.all(e.map(t=>this.fetchAsDataUri(t).then(e=>({url:t,dataUri:e})).catch(()=>({url:t,dataUri:null})))).then(e=>{let i=t,s=0;return e.forEach(({url:t,dataUri:e})=>{e&&(i=i.split(t).join(e),s++)}),s?i:null}):Promise.resolve(t.includes("data:")?t:null)}fetchAsDataUri(t){return"function"!=typeof fetch||"function"!=typeof btoa?Promise.reject(new Error("fetch unavailable")):fetch(t).then(e=>{if(!e.ok)throw new Error(`HTTP ${e.status} for ${t}`);const i=e.headers.get("content-type")||"application/octet-stream";return e.arrayBuffer().then(t=>{const e=new Uint8Array(t);let s="";for(let t=0;t<e.length;t+=32768)s+=String.fromCharCode.apply(null,e.subarray(t,t+32768));return`data:${i};base64,${btoa(s)}`})})}getSvgString(t){return new Promise(e=>{const i=this.w;let s=t||i.config.chart.toolbar.export.scale||i.config.chart.toolbar.export.width/i.globals.svgWidth;s||(s=1);const a=i.globals.svgWidth*s,r=i.globals.svgHeight*s,n=i.dom.elWrap.cloneNode(!0);n.style.width=a+"px",n.style.height=r+"px",this.inlineCanvasLayers(n),this.applyExportStyles(n);const o=(new XMLSerializer).serializeToString(n);let l=`\n        <svg xmlns="http://www.w3.org/2000/svg"\n          version="1.1"\n          xmlns:xlink="http://www.w3.org/1999/xlink"\n          class="apexcharts-svg"\n          xmlns:data="ApexChartsNS"\n          transform="translate(0, 0)"\n          width="${i.globals.svgWidth}px" height="${i.globals.svgHeight}px">\n          <foreignObject width="100%" height="100%">\n            <div xmlns="http://www.w3.org/1999/xhtml" style="width:${a}px; height:${r}px;">\n              ${o}\n            </div>\n          </foreignObject>\n        </svg>\n      `;const h=this.svgStringToNode(l);1!==s&&this.scaleSvgNode(h,s),Promise.all([this.convertImagesToBase64(h),this.embedFonts(h)]).then(()=>{l=(new XMLSerializer).serializeToString(h),e(l.replace(/&nbsp;/g,"&#160;"))})})}convertImagesToBase64(t){const e="http://www.w3.org/1999/xlink",i=t.getElementsByTagName("image"),s=Array.from(i).map(t=>{const i=t.getAttributeNS(e,"href"),s=t.getAttribute("href"),a=i||s;if(!a||a.startsWith("data:"))return Promise.resolve();const r=a=>{i&&t.setAttributeNS(e,"href",a),!s&&i||t.setAttribute("href",a)};return this.fetchAsDataUri(a).then(r).catch(()=>this.getBase64FromUrl(a).then(r).catch(t=>{}))});return Promise.all(s)}getBase64FromUrl(t){return Wt.isSSR()?Promise.resolve(t):new Promise((e,i)=>{const s=new Image;s.crossOrigin="Anonymous",s.onload=()=>{const t=document.createElement("canvas");t.width=s.width,t.height=s.height;const i=t.getContext("2d");i&&i.drawImage(s,0,0),e(t.toDataURL())},s.onerror=i,s.src=t})}svgUrl(){return new Promise(t=>{this.getSvgString().then(e=>{const i=new Blob([e],{type:"image/svg+xml;charset=utf-8"});t(URL.createObjectURL(i))})})}dataURI(t){return Wt.isSSR()?Promise.resolve({imgURI:""}):new Promise(e=>{const i=this.w,s=t?t.scale||t.width/i.globals.svgWidth:1,a=document.createElement("canvas");a.width=i.globals.svgWidth*s,a.height=parseInt(i.dom.elWrap.style.height,10)*s;const r=this.resolveExportBackground(),n=a.getContext("2d");n&&(n.fillStyle=r,n.fillRect(0,0,a.width,a.height),this.getSvgString(s).then(t=>{const i="data:image/svg+xml,"+encodeURIComponent(t),s=new Image;s.crossOrigin="anonymous",s.onload=()=>{n.drawImage(s,0,0);const t=a;if(t.msToBlob){const i=t.msToBlob();e({blob:i})}else{const t=a.toDataURL("image/png");e({imgURI:t})}},s.src=i}))})}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,i=t?{scale:t}:e?{width:e}:void 0;this.dataURI(i).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:i=",",lineDelimiter:s="\n"}){const a=this.w;t||(t=a.config.series);let r=[];const n=[];let o="";const l=a.seriesData.series.map((t,e)=>-1===a.globals.collapsedSeriesIndices.indexOf(e)?t:[]),h=t=>{if(null==t||Ht.isNumber(t))return t;const e=String(t);return/^[=+\-@\t\r]/.test(e)?`'${e}`:e},c=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():Ht.isNumber(t)?t:h(t.split(i).join("")),d=t=>"function"==typeof a.config.chart.toolbar.export.csv.valueFormatter?a.config.chart.toolbar.export.csv.valueFormatter(t):h(t),u=Math.max(...t.map(t=>t.data?t.data.length:0)),p=new S(this.w),g=new O(this.w,{theme:this.ctx.theme,timeScale:this.ctx.timeScale}),f=t=>{let e="";if(a.globals.axisCharts){if("category"===a.config.xaxis.type||a.config.xaxis.convertedCatToNumeric)if(a.globals.isBarHorizontal){const i=a.formatters.yLabelFormatters[0],s=new X(this.ctx.w).getActiveConfigSeriesIndex();e=i(a.labelData.labels[t],{seriesIndex:s,dataPointIndex:t,w:a})}else e=g.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(" ")),Ht.isNumber(e)?e:e.split(i).join(""))},m=(e,s)=>{var o,h,g,m,x,b;if(r.length&&0===s&&n.push(r.join(i)),e.data){const y=e.data.length?e.data:[...Array(u)].map(()=>"");for(let u=0;u<y.length;u++){r=[];let y=f(u);if("nullvalue"!==y){if(y||(p.isFormatXY()?y=t[s].data[u].x:p.isFormat2DArray()&&(y=t[s].data[u]?t[s].data[u][0]:"")),0===s){r.push(c(y));for(let e=0;e<a.seriesData.series.length;e++){const i=p.isFormatXY()?null==(o=t[e].data[u])?void 0:o.y:l[e][u];r.push(d(i))}}("candlestick"===a.config.chart.type||e.type&&"candlestick"===e.type)&&(r.pop(),r.push(a.candleData.seriesCandleO[s][u]),r.push(a.candleData.seriesCandleH[s][u]),r.push(a.candleData.seriesCandleL[s][u]),r.push(a.candleData.seriesCandleC[s][u])),("boxPlot"===a.config.chart.type||e.type&&"boxPlot"===e.type)&&(r.pop(),r.push(a.candleData.seriesCandleO[s][u]),r.push(a.candleData.seriesCandleH[s][u]),r.push(a.candleData.seriesCandleM[s][u]),r.push(a.candleData.seriesCandleL[s][u]),r.push(a.candleData.seriesCandleC[s][u])),"rangeBar"===a.config.chart.type&&(r.pop(),r.push(a.rangeData.seriesRangeStart[s][u]),r.push(a.rangeData.seriesRangeEnd[s][u])),("violin"===a.config.chart.type||e.type&&"violin"===e.type)&&(r.pop(),r.push(null==(h=a.violinData.seriesViolinMin[s])?void 0:h[u]),r.push(null==(g=a.violinData.seriesViolinMax[s])?void 0:g[u]),r.push(null!=(b=null==(x=null==(m=a.violinData.seriesViolinPoints[s])?void 0:m[u])?void 0:x.length)?b:0)),r.length&&n.push(r.join(i))}}}};r.push(a.config.chart.toolbar.export.csv.headerCategory),"boxPlot"===a.config.chart.type?(r.push("minimum"),r.push("q1"),r.push("median"),r.push("q3"),r.push("maximum")):"candlestick"===a.config.chart.type?(r.push("open"),r.push("high"),r.push("low"),r.push("close")):"rangeBar"===a.config.chart.type?(r.push("minimum"),r.push("maximum")):"violin"===a.config.chart.type?(r.push("minimum"),r.push("maximum"),r.push("observations")):t.map((t,e)=>{const s=(t.name?t.name:`series-${e}`)+"";a.globals.axisCharts&&r.push(s.split(i).join("")?s.split(i).join(""):`series-${e}`)}),a.globals.axisCharts||(r.push(a.config.chart.toolbar.export.csv.headerValue),n.push(r.join(i))),a.globals.allSeriesHasEqualX||!a.globals.axisCharts||a.config.xaxis.categories.length||a.config.labels.length?t.map((t,e)=>{a.globals.axisCharts?m(t,e):(r=[],r.push(c(a.labelData.labels[e])),r.push(d(l[e])),n.push(r.join(i)))}):(()=>{const e=new Set,s={};t.forEach((i,a)=>{null==i||i.data.forEach(i=>{let r,n;if(p.isFormatXY())r=i.x,n=i.y;else{if(!p.isFormat2DArray())return;r=i[0],n=i[1]}s[r]||(s[r]=Array(t.length).fill("")),s[r][a]=d(n),e.add(r)})}),r.length&&n.push(r.join(i)),Array.from(e).sort().forEach(t=>{const e=s[t];n.push([c(t),...e].join(i))})})(),o+=n.join(s),this.triggerDownload("data:text/csv; charset=utf-8,"+encodeURIComponent("\ufeff"+o),e||a.config.chart.toolbar.export.csv.filename,".csv")}triggerDownload(t,e,i){if(Wt.isSSR())return;const s=document.createElement("a");s.href=t,s.download=(e||this.w.globals.chartID)+i,document.body.appendChild(s),s.click(),document.body.removeChild(s)}}c.default.registerFeatures({exports:Vt});let Gt=class{constructor(t){this.w=t.w,this.lgCtx=t}getLegendStyles(){if(Wt.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 i=document.createTextNode(".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} ");return t.appendChild(i),t}getLegendDimensions(){const t=this.w.dom.baseEl.querySelector(".apexcharts-legend");if(!t)return{clwh:0,clww:0};const{width:e,height:i}=t.getBoundingClientRect();return{clwh:i,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 i,s,a;const r=this.w;if(r.globals.axisCharts||"radialBar"===r.config.chart.type){r.globals.resized=!0;let n=null,o=null;if(r.globals.risingSeries=[],r.globals.axisCharts){if(n=null!=(i=Array.prototype.find.call(r.dom.baseEl.querySelectorAll(".apexcharts-series"),e=>e.getAttribute("data:realIndex")===String(t)))?i:null,!n)return;o=parseInt(null!=(s=n.getAttribute("data:realIndex"))?s:"",10)}else{if(n=r.dom.baseEl.querySelector(`.apexcharts-series[rel='${t+1}']`),!n)return;o=parseInt(null!=(a=n.getAttribute("rel"))?a:"",10)-1}if(e){[{cs:r.globals.collapsedSeries,csi:r.globals.collapsedSeriesIndices},{cs:r.globals.ancillaryCollapsedSeries,csi:r.globals.ancillaryCollapsedSeriesIndices}].forEach(t=>{const e=t.cs,i=t.csi;this.riseCollapsedSeries(e,i,o)})}else this.hideSeries({seriesEl:n,realIndex:o});if(r.config.chart.accessibility.enabled){const e=r.dom.baseEl.querySelector(`.apexcharts-legend-series[rel="${t+1}"]`);if(e){const i=r.globals.collapsedSeriesIndices.includes(o)||r.globals.ancillaryCollapsedSeriesIndices.includes(o);e.setAttribute("aria-pressed",i?"true":"false");const s=e.querySelector(".apexcharts-legend-text"),a=s?s.textContent:r.seriesData.seriesNames[t],n=i?"hidden":"visible";e.setAttribute("aria-label",`${a}, ${n}. Press Enter or Space to toggle.`)}}}else{if(r.globals.resized=!0,r.globals.risingSeries=[],e)this.riseCollapsedSeries(r.globals.collapsedSeries,r.globals.collapsedSeriesIndices,t);else{const e=this.getSeriesAfterCollapsing({realIndex:t});this.lgCtx.updateSeries(e,r.config.chart.animations.dynamicAnimation.enabled)}if(r.config.chart.accessibility.enabled){const e=r.dom.baseEl.querySelector(`.apexcharts-legend-series[rel="${t+1}"]`);if(e){const i=r.globals.collapsedSeriesIndices.includes(t);e.setAttribute("aria-pressed",i?"true":"false");const s=e.querySelector(".apexcharts-legend-text"),a=s?s.textContent:r.seriesData.seriesNames[t],n=i?"hidden":"visible";e.setAttribute("aria-label",`${a}, ${n}. Press Enter or Space to toggle.`)}}}}_nonAxisSliceContainer(t){const e=this.w.config.chart.type;return("pie"===e||"donut"===e||"polarArea"===e||"sunburst"===e)&&1===t.length&&t[0]&&"object"==typeof t[0]&&Array.isArray(t[0].data)?t[0].data:t}_readSliceValue(t){return"unit"===this.w.config.chart.type&&t&&Array.isArray(t.data)?t.data:t&&"object"==typeof t?t.y:t}_writeSliceValue(t,e,i){const s=t[e];"unit"===this.w.config.chart.type&&s&&Array.isArray(s.data)?s.data=Array.isArray(i)?i:[]:s&&"object"==typeof s?s.y=i:t[e]=i}getSeriesAfterCollapsing({realIndex:t}){var e,i;const s=this.w,a=s.globals,r=Ht.clone(s.config.series);if(a.axisCharts){const e=s.config.yaxis[a.seriesYAxisReverseMap[t]],i={index:t,data:r[t].data.slice(),type:r[t].type||s.config.chart.type,name:(a.seriesNames||[])[t]};if(e&&e.show&&e.showAlways)a.ancillaryCollapsedSeriesIndices.indexOf(t)<0&&(a.ancillaryCollapsedSeries.push(i),a.ancillaryCollapsedSeriesIndices.push(t));else if(a.collapsedSeriesIndices.indexOf(t)<0){a.collapsedSeries.push(i),a.collapsedSeriesIndices.push(t);const e=a.risingSeries.indexOf(t);a.risingSeries.splice(e,1)}}else if(a.collapsedSeriesIndices.indexOf(t)<0){const n=this._nonAxisSliceContainer(r);a.collapsedSeries.push({index:t,data:this._readSliceValue(n[t]),type:null!=(i=null==(e=s.config.series[t])?void 0:e.type)?i:"line",name:(a.seriesNames||[])[t]}),a.collapsedSeriesIndices.push(t)}const n=a.axisCharts?s.config.series.length:this._nonAxisSliceContainer(r).length;return a.allSeriesCollapsed=a.collapsedSeries.length+a.ancillaryCollapsedSeries.length===n,this._getSeriesBasedOnCollapsedState(r)}hideSeries({seriesEl:t,realIndex:e}){const i=this.w,s=this.getSeriesAfterCollapsing({realIndex:e}),a=t.childNodes;for(let t=0;t<a.length;t++)a[t].classList.contains("apexcharts-series-markers-wrap")&&(a[t].classList.contains("apexcharts-hide")?a[t].classList.remove("apexcharts-hide"):a[t].classList.add("apexcharts-hide"));const r=i.config.chart.animations.dynamicAnimation.enabled;r&&(i.globals.collapsingSeriesIndices=[e]);const n=()=>{i.globals.collapsingSeriesIndices=[]},o=this.lgCtx.updateSeries(s,r);n(),o&&"function"==typeof o.then&&o.then(n,n)}riseCollapsedSeries(t,e,i){const s=this.w;let a=Ht.clone(s.config.series);if(t.length>0){for(let r=0;r<t.length;r++)if(t[r].index===i){if(s.globals.axisCharts)a[i].data=t[r].data.slice(),a[i].hidden=!1;else{const e=this._nonAxisSliceContainer(a);this._writeSliceValue(e,i,t[r].data)}t.splice(r,1),e.splice(r,1),s.globals.risingSeries.push(i),r--}a=this._getSeriesBasedOnCollapsedState(a),this.lgCtx.updateSeries(a,s.config.chart.animations.dynamicAnimation.enabled)}}_getSeriesBasedOnCollapsedState(t){const e=this.w;let i=0;if(e.globals.axisCharts)t.forEach((s,a)=>{e.globals.collapsedSeriesIndices.indexOf(a)<0&&e.globals.ancillaryCollapsedSeriesIndices.indexOf(a)<0||(t[a].data=[],i++)});else{const s=this._nonAxisSliceContainer(t);s.forEach((t,a)=>{e.globals.collapsedSeriesIndices.indexOf(a)<0||(this._writeSliceValue(s,a,0),i++)})}const s=e.globals.axisCharts?t.length:this._nonAxisSliceContainer(t).length;return e.globals.allSeriesCollapsed=i===s,t}};const qt=["#cf4d3f","#8f9499","#26a75b"],Zt=(t,e,i)=>t+(e-t)*i;function Ut(t){return Math.max(0,Math.min(255,Math.round(t))).toString(16).padStart(2,"0")}function Kt(t,e,i){const s=Ht.parseHex(Jt(t)),a=Ht.parseHex(Jt(e));return s&&a?"#"+Ut(Zt(s[0],a[0],i))+Ut(Zt(s[1],a[1],i))+Ut(Zt(s[2],a[2],i)):t}function Jt(t){if("string"!=typeof t)return"#000000";if(Ht.isColorHex(t))return t;return Ht.rgb2hex(t)||"#000000"}function Qt(t,e,i){const s=t.config.series[e];return te(t,s&&Array.isArray(s.data)?s.data[i]:null,e,i)}function te(t,e,i,s){var a,r,n;if(!e||"object"!=typeof e)return null;const o=null==(n=null==(r=null==(a=t.config.plotOptions)?void 0:a.treemap)?void 0:r.colorScale)?void 0:n.colorValue;let l;if(l="function"==typeof o?o(e,{seriesIndex:i,dataPointIndex:s,w:t}):"string"==typeof o?e[o]:e.colorValue,null==l)return null;const h=Number(l);return Number.isFinite(h)?h:null}function ee(t){var e,i,s;const a=null==(s=null==(i=null==(e=t.config)?void 0:e.plotOptions)?void 0:i.treemap)?void 0:s.colorScale,r=a&&a.gradient;if(!r)return null;if(!1===r.enabled)return null;const n=t.config.series||[];let o=1/0,l=-1/0,h=!1;for(let e=0;e<n.length;e++){const i=n[e]&&n[e].data;if(Array.isArray(i))for(let s=0;s<i.length;s++){const a=te(t,i[s],e,s);null!=a&&(h=!0,a<o&&(o=a),a>l&&(l=a))}}if(!h&&!0!==r.enabled)return null;Number.isFinite(o)||(o=0,l=0);let c=Number.isFinite(Number(r.min))?Number(r.min):o,d=Number.isFinite(Number(r.max))?Number(r.max):l,u=null;if(null===r.midpoint?u=null:Number.isFinite(Number(r.midpoint))?u=Number(r.midpoint):c<0&&d>0&&(u=0),null!=u&&!1!==r.symmetric&&!Number.isFinite(Number(r.min))&&!Number.isFinite(Number(r.max))){const t=Math.max(Math.abs(c-u),Math.abs(d-u));c=u-t,d=u+t}d===c&&(c-=.5,d+=.5);const p=function(t,e,i,s){if(Array.isArray(t.stops)&&t.stops.length>=2)return t.stops.filter(t=>t&&Number.isFinite(Number(t.value))).map(t=>({value:Number(t.value),color:Jt(t.color)})).sort((t,e)=>t.value-e.value);const a=(Array.isArray(t.colors)&&t.colors.length>=2?t.colors:qt).map(Jt),r=a.length;if(null!=s&&r>=3){const t=Math.floor((r-1)/2),n=[];for(let i=0;i<=t;i++)n.push({value:Zt(e,s,i/t),color:a[i]});for(let e=t+1;e<r;e++)n.push({value:Zt(s,i,(e-t)/(r-1-t)),color:a[e]});return n}return a.map((t,s)=>({value:Zt(e,i,s/(r-1)),color:t}))}(r,c,d,u);if(p.length<2)return null;const g=d-c,f=p.map(t=>({percent:0===g?0:(t.value-c)/g,color:t.color}));return{min:c,max:d,midpoint:u,stops:p,at:t=>{if(!Number.isFinite(t))return p[Math.floor(p.length/2)].color;if(t<=p[0].value)return p[0].color;const e=p[p.length-1];if(t>=e.value)return e.color;for(let e=1;e<p.length;e++){const i=p[e];if(t<=i.value){const s=p[e-1],a=i.value-s.value,r=0===a?0:(t-s.value)/a;return Kt(s.color,i.color,r)}}return e.color},legendStops:f}}function ie(t){const e=Jt(t);return Ht.getContrastRatio(e,"#ffffff")>=Ht.getContrastRatio(e,"#000000")?"#ffffff":"#000000"}const se="http://www.w3.org/2000/svg";class ae{constructor(t,e){this.w=t,this.ctx=e,this.svgEl=null,this.arrowEl=null,this.hoverValueEl=null,this._min=0,this._max=0,this._geom=null,this._bandHitEls=[],this._activeBandIndex=-1,this._targetEl=null,this._onCellEnter=this._onCellEnter.bind(this),this._onCellLeave=this._onCellLeave.bind(this),this._onBandEnter=this._onBandEnter.bind(this),this._onBandLeave=this._onBandLeave.bind(this)}_getFormatter(){const t=this._cfg();return"function"==typeof t.formatter?t.formatter:t=>{if(!Number.isFinite(t))return String(t);const e=Math.abs(t);return e>=1e3?t.toFixed(0):e>=10?t.toFixed(1):t.toFixed(2)}}static colorScaleOf(t){var e,i,s,a,r;const n=null==(i=null==(e=null==t?void 0:t.config)?void 0:e.chart)?void 0:i.type;return n&&(null==(r=null==(a=null==(s=null==t?void 0:t.config)?void 0:s.plotOptions)?void 0:a[n])?void 0:r.colorScale)||null}static configFor(t){const e=ae.colorScaleOf(t);return e&&e.gradientLegend||null}_cfg(){return ae.configFor(this.w)||{}}static isEnabled(t){if(!ae.supports(t))return!1;const e=ae.configFor(t);return!(!e||!e.enabled)}static supports(t){var e,i;const s=null==(i=null==(e=null==t?void 0:t.config)?void 0:e.chart)?void 0:i.type;return"heatmap"===s||"treemap"===s}draw(t=null){var e,i,s,a,r,n,o,l;const h=this.w;this._targetEl=t;const c=t||h.dom.elLegendWrap;if(!c)return;const d=this._cfg(),u=h.config.legend.position,p="left"===u||"right"===u,g=null!=(i=null==(e=d.arrow)?void 0:e.size)?i:8,f=g+4,m=d.showLabels?28:4,x=d.showLabels?20:4,b=d.showLabels?44:0,y=this._resolveStripLength(p?d.height:d.width,p),w=d.thickness,v=p?Math.max(w+f+4,b):y+2*m,_=p?y+2*x:w+f+4,A=(v-(w+f))/2,S=p?"left"===u?A:A+f:m,C=p?x:"top"===u?f:4,k=ct.createElementNS(se,"svg");k.setAttribute("class","apexcharts-heatmap-gradient-legend apexcharts-gradient-legend"),k.setAttribute("width",String(v)),k.setAttribute("height",String(_)),k.setAttribute("overflow","visible");const M=ct.createElementNS(se,"defs"),P=`apexcharts-heatmap-gradient-${h.globals.cuid}`,L=ct.createElementNS(se,"linearGradient");L.setAttribute("id",P),p?(L.setAttribute("x1","0"),L.setAttribute("y1","1"),L.setAttribute("x2","0"),L.setAttribute("y2","0")):(L.setAttribute("x1","0"),L.setAttribute("y1","0"),L.setAttribute("x2","1"),L.setAttribute("y2","0"));const{min:I,max:E,stops:R,bands:D}=this._computeStops();this._min=I,this._max=E,R.forEach(t=>{const e=ct.createElementNS(se,"stop");e.setAttribute("offset",`${(100*t.percent).toFixed(2)}%`),e.setAttribute("stop-color",t.color),L.appendChild(e)}),M.appendChild(L),k.appendChild(M);const F=ct.createElementNS(se,"rect");if(F.setAttribute("x",String(S)),F.setAttribute("y",String(C)),F.setAttribute("width",String(p?w:y)),F.setAttribute("height",String(p?y:w)),F.setAttribute("rx","2"),F.setAttribute("fill",`url(#${P})`),k.appendChild(F),d.showLabels){const t=(null==(s=d.labelStyle)?void 0:s.colors)||(Array.isArray(h.config.legend.labels.colors)?h.config.legend.labels.colors[0]:h.config.legend.labels.colors)||h.config.chart.foreColor,e=(null==(a=d.labelStyle)?void 0:a.fontSize)||"11px",i=(null==(r=d.labelStyle)?void 0:r.fontFamily)||h.config.chart.fontFamily,n=this._getFormatter(),o=(s,a,r,n)=>{const o=ct.createElementNS(se,"text");return o.setAttribute("x",String(a)),o.setAttribute("y",String(r)),o.setAttribute("text-anchor",n),o.setAttribute("dominant-baseline","middle"),o.setAttribute("fill",t),o.setAttribute("font-size",e),i&&o.setAttribute("font-family",i),o.textContent=String(s),o};if(p){const t=S+w/2;k.appendChild(o(n(I),t,C+y+10,"middle")),k.appendChild(o(n(E),t,C-10,"middle"))}else{const t=C+w/2;k.appendChild(o(n(I),S-6,t,"end")),k.appendChild(o(n(E),S+y+6,t,"start"))}}const X=(null==(n=d.arrow)?void 0:n.color)||h.config.chart.foreColor,T=this._buildArrow(g,X,u);if(k.appendChild(T),this.arrowEl=T,this._bandHitEls=[],h.config.legend.onItemHover.highlightDataSeries&&D.length>0&&D.forEach(t=>{const e=ct.createElementNS(se,"rect");if(p){const i=C+y-t.p2*y,s=C+y-t.p1*y;e.setAttribute("x",String(S)),e.setAttribute("y",String(i)),e.setAttribute("width",String(w)),e.setAttribute("height",String(Math.max(0,s-i)))}else e.setAttribute("x",String(S+t.p1*y)),e.setAttribute("y",String(C)),e.setAttribute("width",String(Math.max(0,(t.p2-t.p1)*y))),e.setAttribute("height",String(w));e.setAttribute("fill","transparent"),e.setAttribute("class","apexcharts-heatmap-gradient-band"),e.setAttribute("data:range-index",String(t.index)),e.style.cursor="pointer",k.appendChild(e),this._bandHitEls.push(e)}),this._geom={isVertical:p,position:u,stripX:S,stripY:C,stripLength:y,stripThickness:w,arrowSize:g,svgWidth:v,svgHeight:_},d.showHoverValue){const t=ct.createElement("div");t.classList.add("apexcharts-heatmap-gradient-legend-value"),t.style.position="absolute",t.style.fontSize=(null==(o=d.labelStyle)?void 0:o.fontSize)||"11px",t.style.fontFamily=(null==(l=d.labelStyle)?void 0:l.fontFamily)||h.config.chart.fontFamily||"",t.style.color=h.config.chart.foreColor,t.style.background="rgba(0,0,0,0.65)",t.style.color="#fff",t.style.padding="2px 6px",t.style.borderRadius="3px",t.style.pointerEvents="none",t.style.whiteSpace="nowrap",t.style.opacity="0",t.style.transition="opacity 120ms ease",this.hoverValueEl=t}c.classList.add("apexcharts-heatmap-gradient-legend-wrap"),c.classList.add("apx-legend-position-"+u),c.appendChild(k),this.hoverValueEl&&c.appendChild(this.hoverValueEl),this.svgEl=k,t?(c.style.width=v+"px",c.style.height=_+"px",c.style.position="relative",c.style.overflow="visible"):this._applyWrapAlignment(c,u,p,v,_),this._attachHoverListeners(),this._attachBandHoverListeners()}_resolveStripLength(t,e){const i=this.w,s=e?i.globals.svgHeight||i.config.chart.height||300:i.globals.svgWidth||i.config.chart.width||600;if("string"==typeof t){const e=t.trim();if(e.endsWith("%")){const t=parseFloat(e)||0;return Math.max(20,s*t/100)}const i=parseFloat(e);return Number.isFinite(i)?i:200}return"number"==typeof t&&Number.isFinite(t)?t:200}_applyWrapAlignment(t,e,i,s,a){const r=this.w,n=this._cfg().align||"center",o=12,l=r.globals.svgWidth||r.config.chart.width||600,h=r.globals.svgHeight||r.config.chart.height||300,c=r.config.legend.offsetX||0,d=r.config.legend.offsetY||0;if(t.style.position="absolute",t.style.display="block",t.style.overflow="visible",t.style.padding="0",t.style.width=s+"px",t.style.height=a+"px",t.style.right="auto",t.style.bottom="auto",i){const i=h-a-24;let r;r="start"===n?o:"end"===n?o+Math.max(0,i):o+Math.max(0,i)/2,t.style.top=r+d+"px",t.style.left="left"===e?o+c+"px":l-s-o+c+"px"}else{const i=l-s-24;let r;r="start"===n?o:"end"===n?o+Math.max(0,i):o+Math.max(0,i)/2,t.style.left=r+c+"px",t.style.top="top"===e?o+d+"px":h-a-o+d+"px"}}repositionToPlot(){var t,e;if(!Wt.isBrowser())return;if(this._targetEl)return;const i=this.w,s=i.globals,a=i.dom.elLegendWrap;if(!a||!this._geom)return;if(!Number.isFinite(s.gridWidth)||!Number.isFinite(s.gridHeight))return;const{isVertical:r,position:n,svgWidth:o,svgHeight:l,stripX:h,stripY:c,stripThickness:d}=this._geom,u=this._cfg().align||"center",p=i.config.legend.offsetX||0,g=i.config.legend.offsetY||0,f=null==(e=null==(t=this.ctx)?void 0:t.dimensions)?void 0:e.dimHelpers,m=f?f.getTitleSubtitleCoords("title").height+f.getTitleSubtitleCoords("subtitle").height:0,x=i.layout.xAxisHeight||0,b=(t,e)=>{const i=Math.max(0,t-e);return"start"===u?0:"end"===u?i:i/2};if(r){a.style.top=s.translateY+b(s.gridHeight,l)+g+"px";const t=(("left"===n?0:s.translateX+s.gridWidth)+("left"===n?s.translateX:s.svgWidth))/2;a.style.left=t-h-d/2+p+"px"}else{a.style.left=s.translateX+b(s.gridWidth,o)+p+"px";const t=(("top"===n?m:s.translateY+s.gridHeight+x)+("top"===n?s.translateY:s.svgHeight))/2;a.style.top=t-c-d/2+g+"px"}ct.requestAnimationFrame(()=>this._enforceMinPlotGap())}_enforceMinPlotGap(){const t=this.w,e=t.dom.elLegendWrap,i=this.svgEl&&this.svgEl.querySelector("rect"),s=t.dom.baseEl.querySelector(".apexcharts-grid");if(!(e&&i&&s&&this._geom))return;const a=i.getBoundingClientRect(),r=s.getBoundingClientRect();if(!(a.width&&a.height&&r.width&&r.height))return;const{isVertical:n,position:o}=this._geom;if(n){const t="left"===o?r.left-a.right:a.left-r.right;if(t<16){const i=parseFloat(e.style.left)||0,s=16-t;e.style.left=i+("left"===o?-s:s)+"px"}}else{const t="top"===o?r.top-a.bottom:a.top-r.bottom;if(t<16){const i=parseFloat(e.style.top)||0,s=16-t;e.style.top=i+("top"===o?-s:s)+"px"}}}destroy(){var t,e,i,s,a,r,n;for(let i=0;i<this._bandHitEls.length;i++){const s=this._bandHitEls[i];null==(t=s.removeEventListener)||t.call(s,"mousemove",this._onBandEnter),null==(e=s.removeEventListener)||e.call(s,"mouseout",this._onBandLeave)}if(this._bandHitEls=[],this._activeBandIndex=-1,null==(i=this.ctx)?void 0:i.events)try{null==(a=(s=this.ctx.events).removeEventListener)||a.call(s,"dataPointMouseEnter",this._onCellEnter),null==(n=(r=this.ctx.events).removeEventListener)||n.call(r,"dataPointMouseLeave",this._onCellLeave)}catch(t){}}_attachBandHoverListeners(){if(Wt.isBrowser())for(let t=0;t<this._bandHitEls.length;t++){const e=this._bandHitEls[t];e.addEventListener("mousemove",this._onBandEnter),e.addEventListener("mouseout",this._onBandLeave)}}_onBandEnter(t){var e,i,s,a;const r=this.w,n=t.currentTarget,o=parseInt(null!=(e=n.getAttribute("data:range-index"))?e:"-1",10);o<0||o===this._activeBandIndex||(this._activeBandIndex=o,null==(a=null==(s=null==(i=this.ctx)?void 0:i.events)?void 0:s.fireEvent)||a.call(s,"legendHover",[this.ctx,o,r]),new X(r).highlightRangeInSeries(o,"highlight"))}_onBandLeave(){if(this._activeBandIndex<0)return;const t=this._activeBandIndex;this._activeBandIndex=-1,new X(this.w).highlightRangeInSeries(t,"reset")}_attachHoverListeners(){var t,e;Wt.isBrowser()&&(null==(e=null==(t=this.ctx)?void 0:t.events)?void 0:e.addEventListener)&&(this.ctx.events.addEventListener("dataPointMouseEnter",this._onCellEnter),this.ctx.events.addEventListener("dataPointMouseLeave",this._onCellLeave))}_onCellEnter(...t){var e,i,s;const a=this.w;if(!this.arrowEl)return;const r=t[t.length-1];if(!r||"object"!=typeof r)return;const n=r.seriesIndex,o=r.dataPointIndex;if("number"!=typeof n||"number"!=typeof o)return;if(!ae.supports(a))return;let l;l=this._continuous?Qt(a,n,o):null==(s=null==(i=null==(e=a.seriesData)?void 0:e.series)?void 0:i[n])?void 0:s[o],null==l||Number.isNaN(l)||this._positionArrow(l)}_onCellLeave(){this.arrowEl&&(this.arrowEl.setAttribute("opacity","0"),this.hoverValueEl&&(this.hoverValueEl.style.opacity="0"))}_positionArrow(t){if(!this.arrowEl||!this._geom)return;const{isVertical:e,position:i,stripX:s,stripY:a,stripLength:r,stripThickness:n,arrowSize:o}=this._geom,l=this._min,h=this._max-l;let c;if(c=0===h?.5:(t-l)/h,c<0&&(c=0),c>1&&(c=1),e){const t=a+r-c*r;let e,l;"left"===i?(e=s+n,l=e+o):(e=s,l=e-o);const h=[`${e},${t}`,`${l},${t-o/2}`,`${l},${t+o/2}`].join(" ");this.arrowEl.setAttribute("points",h)}else{const t=s+c*r;let e,l;"top"===i?(e=a+n,l=e+o):(e=a,l=e-o);const h=[`${t},${e}`,`${t-o/2},${l}`,`${t+o/2},${l}`].join(" ");this.arrowEl.setAttribute("points",h)}if(this.arrowEl.setAttribute("opacity","1"),this.hoverValueEl){const l=this._getFormatter();if(this.hoverValueEl.textContent=l(t),e){const t=a+r-c*r;"left"===i?this.hoverValueEl.style.left=`${s+n+o+8}px`:(this.hoverValueEl.style.left=s-o-8+"px",this.hoverValueEl.style.transform="translateX(-100%)"),this.hoverValueEl.style.top=t-9+"px"}else{const t=s+c*r;this.hoverValueEl.style.left=`${t}px`,this.hoverValueEl.style.transform="translateX(-50%)",this.hoverValueEl.style.top="top"===i?`${a+n+o+8}px`:a-o-18+"px"}this.hoverValueEl.style.opacity="1"}}_buildArrow(t,e,i){const s=ct.createElementNS(se,"polygon");return s.setAttribute("fill",e),s.setAttribute("opacity","0"),s.setAttribute("class","apexcharts-heatmap-gradient-arrow"),s.setAttribute("points","0,0 0,0 0,0"),s.setAttribute("pointer-events","none"),s}_computeStops(){var t,e;const i=this.w,s=ae.colorScaleOf(i)||{},a=this._cfg(),r=ee(i);if(r)return this._continuous=!0,{min:r.min,max:r.max,stops:r.legendStops,bands:[]};this._continuous=!1;let n=1/0,h=-1/0;const c=(null==(t=i.seriesData)?void 0:t.series)||[];for(let t=0;t<c.length;t++){const e=c[t];if(e)for(let t=0;t<e.length;t++){const i=e[t];null==i||Number.isNaN(i)||(i<n&&(n=i),i>h&&(h=i))}}Number.isFinite(n)||(n=0),Number.isFinite(h)||(h=0);let d=n,u=h;void 0!==s.min&&void 0!==s.max&&s.max>s.min?(d=s.min,u=s.max):(void 0!==s.min&&(d=s.min<n?s.min:n),void 0!==s.max&&(u=s.max>h?s.max:h));const p=[],g=[];if(s.ranges&&s.ranges.length>0){const t=s.ranges.map((t,e)=>l(o({},t),{_originalIndex:e})).sort((t,e)=>t.from-e.from),e=t[0].from,i=t[t.length-1].to;d=e,u=i;const a=i-e||1;t.forEach(t=>{const i=(t.from-e)/a,s=(t.to-e)/a;p.push({percent:(i+s)/2,color:t.color}),g.push({index:t._originalIndex,p1:i,p2:s})})}else{const t=i.globals.colors[0]||"#008FFB",s=new Ht,r=i.config.plotOptions[i.config.chart.type]||{},n=null!=(e=r.shadeIntensity)?e:.5,o=i.globals.hasNegs,l=Math.max(2,a.stops||16);for(let e=0;e<l;e++){const a=e/(l-1),h=d+a*(u-d),c=Math.abs(u)+Math.abs(d),g=0===c?0:100*h/c;let f;f=o?r.reverseNegativeShade?g<0?g/100*(1.25*n):1.25*n*(1-g/100):g<=0?1-(1+g/100)*n:(1-g/100)*n:1-g/100,f>1&&(f=1),f<-1&&(f=-1);const m=r.enableShades?s.shadeColor("dark"===i.config.theme.mode?-1*f:f,t):t;p.push({percent:a,color:m})}}return{min:d,max:u,stops:p,bands:g}}}c.default.registerFeatures({legend:class{constructor(t,e){this.w=t,this.ctx=e,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 Gt(this)}init(){const t=this.w,e=t.globals,i=t.config;this.isBarsDistributed="bar"===i.chart.type&&i.plotOptions.bar.distributed&&1===i.series.length;const s=i.legend.showForSingleSeries&&1===this.w.seriesData.series.length||this.isBarsDistributed||"heatmap"===i.chart.type||ae.isEnabled(t)||this.w.seriesData.series.length>1;if(this.legendHelpers.appendToForeignObject(),(s||!e.axisCharts)&&i.legend.show){const e=t.dom.elLegendWrap;for(;e.firstChild;)e.removeChild(e.firstChild);this.heatmapGradientLegend&&(this.heatmapGradientLegend.destroy(),this.heatmapGradientLegend=null),ae.isEnabled(t)?(this.heatmapGradientLegend=new ae(t,this.ctx),this.heatmapGradientLegend.draw()):(this.drawLegends(),"bottom"===i.legend.position||"top"===i.legend.position?this.legendAlignHorizontal():"right"!==i.legend.position&&"left"!==i.legend.position||this.legendAlignVertical())}}createLegendMarker({i:t,fillcolor:e}){const i=this.w,s=ct.createElement("span");s.classList.add("apexcharts-legend-marker");const a=i.config.legend.markers.shape||i.config.markers.shape;let r=a;Array.isArray(a)&&(r=a[t]);const n=Array.isArray(i.config.legend.markers.size)?parseFloat(i.config.legend.markers.size[t]):parseFloat(i.config.legend.markers.size),h=Array.isArray(i.config.legend.markers.offsetX)?parseFloat(i.config.legend.markers.offsetX[t]):parseFloat(i.config.legend.markers.offsetX),c=Array.isArray(i.config.legend.markers.offsetY)?parseFloat(i.config.legend.markers.offsetY[t]):parseFloat(i.config.legend.markers.offsetY),d=Array.isArray(i.config.legend.markers.strokeWidth)?parseFloat(i.config.legend.markers.strokeWidth[t]):parseFloat(i.config.legend.markers.strokeWidth),u=s.style;if(u.height=2*(n+d)+"px",u.width=2*(n+d)+"px",u.left=h+"px",u.top=c+"px",i.config.legend.markers.customHTML)u.background="transparent",u.color=e[t],Array.isArray(i.config.legend.markers.customHTML)?i.config.legend.markers.customHTML[t]&&(s.innerHTML=i.config.legend.markers.customHTML[t]()):s.innerHTML=i.config.legend.markers.customHTML();else{const a=new E(this.ctx.w,this.ctx).getMarkerConfig({cssClass:`apexcharts-legend-marker apexcharts-marker apexcharts-marker-${r}`,seriesIndex:t,strokeWidth:d,size:n}),h=(Wt.isBrowser()?window.SVG:global.SVG)().addTo(s).size("100%","100%"),c=new I(this.w).drawMarker(0,0,l(o({},a),{pointFillColor:Array.isArray(e)?e[t]:a.pointFillColor,shape:r}));i.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(c)}return s}drawLegends(){var t;const e=this,i=this.w,s=i.dom.elLegendWrap,a=i.config.legend.fontFamily;let r=i.seriesData.seriesNames,n=i.config.legend.markers.fillColors?i.config.legend.markers.fillColors.slice():i.globals.colors.slice();if("heatmap"===i.config.chart.type){const t=i.config.plotOptions.heatmap.colorScale.ranges;r=t.map(t=>t.name?t.name:t.from+" - "+t.to),n=t.map(t=>t.color)}else this.isBarsDistributed&&(r=i.labelData.labels.slice());i.config.legend.customLegendItems.length&&(r=i.config.legend.customLegendItems);const o=i.formatters.legendFormatter,l=i.config.legend.inverseOrder,h=[];i.labelData.seriesGroups.length>1&&i.config.legend.clusterGroupedSeries&&i.labelData.seriesGroups.forEach((t,e)=>{h[e]=ct.createElement("div"),h[e].classList.add("apexcharts-legend-group",`apexcharts-legend-group-${e}`),"horizontal"===i.config.legend.clusterGroupedSeriesOrientation?s.classList.add("apexcharts-legend-group-horizontal"):h[e].classList.add("apexcharts-legend-group-vertical")});for(let e=l?r.length-1:0;l?e>=0:e<=r.length-1;l?e--:e++){const l=o(r[e],{seriesIndex:e,w:i});let c=!1,d=!1;if(i.globals.collapsedSeries.length>0)for(let t=0;t<i.globals.collapsedSeries.length;t++)i.globals.collapsedSeries[t].index===e&&(c=!0);if(i.globals.ancillaryCollapsedSeriesIndices.length>0)for(let t=0;t<i.globals.ancillaryCollapsedSeriesIndices.length;t++)i.globals.ancillaryCollapsedSeriesIndices[t]===e&&(d=!0);const u=this.createLegendMarker({i:e,fillcolor:n});I.setAttrs(u,{rel:e+1,"data:collapsed":c||d}),(c||d)&&u.classList.add("apexcharts-inactive-legend");const p=ct.createElement("div");if(i.config.chart.accessibility.enabled&&i.config.chart.accessibility.keyboard.enabled){p.setAttribute("role","button"),p.setAttribute("tabindex","0");const t=Array.isArray(l)?l.join(" "):l,e=c||d,i=e?"hidden":"visible";p.setAttribute("aria-label",`${t}, ${i}. Press Enter or Space to toggle.`),p.setAttribute("aria-pressed",e?"true":"false")}const g=ct.createElement("span");g.classList.add("apexcharts-legend-text"),g.innerHTML=Array.isArray(l)?l.join(" "):l;let f=i.config.legend.labels.useSeriesColors?i.globals.colors[e]:Array.isArray(i.config.legend.labels.colors)?null==(t=i.config.legend.labels.colors)?void 0:t[e]:i.config.legend.labels.colors;f||(f=i.config.chart.foreColor),g.style.color=f,g.style.fontSize=i.config.legend.fontSize,g.style.fontWeight=i.config.legend.fontWeight,g.style.fontFamily=a||i.config.chart.fontFamily,I.setAttrs(g,{rel:e+1,i:e,"data:default-text":encodeURIComponent(l),"data:collapsed":c||d}),p.appendChild(u),p.appendChild(g);const m=new _(this.w);if(!i.config.legend.showForZeroSeries){0===m.getSeriesTotalByIndex(e)&&m.seriesHaveSameValues(e)&&!m.isSeriesNull(e)&&-1===i.globals.collapsedSeriesIndices.indexOf(e)&&-1===i.globals.ancillaryCollapsedSeriesIndices.indexOf(e)&&p.classList.add("apexcharts-hidden-zero-series")}i.config.legend.showForNullSeries||m.isSeriesNull(e)&&-1===i.globals.collapsedSeriesIndices.indexOf(e)&&-1===i.globals.ancillaryCollapsedSeriesIndices.indexOf(e)&&p.classList.add("apexcharts-hidden-null-series"),h.length?i.labelData.seriesGroups.forEach((t,a)=>{var r,n;t.includes(null!=(n=null==(r=i.config.series[e])?void 0:r.name)?n:"")&&(s.appendChild(h[a]),h[a].appendChild(p))}):s.appendChild(p),s.classList.add(`apexcharts-align-${i.config.legend.horizontalAlign}`),s.classList.add("apx-legend-position-"+i.config.legend.position),p.classList.add("apexcharts-legend-series"),p.style.margin=`${i.config.legend.itemMargin.vertical}px ${i.config.legend.itemMargin.horizontal}px`,s.style.width=i.config.legend.width?i.config.legend.width+"px":"",s.style.height=i.config.legend.height?i.config.legend.height+"px":"",I.setAttrs(p,{rel:e+1,seriesName:Ht.escapeString(r[e]),"data:collapsed":c||d}),(c||d)&&p.classList.add("apexcharts-inactive-legend"),i.config.legend.onItemClick.toggleDataSeries||p.classList.add("apexcharts-no-click")}i.dom.elWrap.addEventListener("click",e.onLegendClick,!0),i.config.legend.onItemHover.highlightDataSeries&&0===i.config.legend.customLegendItems.length&&(i.dom.elWrap.addEventListener("mousemove",e.onLegendHovered,!0),i.dom.elWrap.addEventListener("mouseout",e.onLegendHovered,!0)),i.config.chart.accessibility.enabled&&i.config.chart.accessibility.keyboard.enabled&&i.dom.elWrap.addEventListener("keydown",e.onLegendKeyDown.bind(e),!0)}setLegendWrapXY(t,e){const i=this.w,s=i.dom.elLegendWrap,a=s.clientHeight;let r=0,n=0;if("bottom"===i.config.legend.position)n=i.globals.svgHeight-Math.min(a,i.globals.svgHeight/2)-5;else if("top"===i.config.legend.position){const t=new H(this.w,this.ctx),e=t.dimHelpers.getTitleSubtitleCoords("title").height,i=t.dimHelpers.getTitleSubtitleCoords("subtitle").height;n=(e>0?e-10:0)+(i>0?i-10:0)}s.style.position="absolute",r=r+t+i.config.legend.offsetX,n=n+e+i.config.legend.offsetY,s.style.left=r+"px",s.style.top=n+"px","right"===i.config.legend.position&&(s.style.left="auto",s.style.right=25+i.config.legend.offsetX+"px");["width","height"].forEach(t=>{s&&s.style[t]&&(s.style[t]=parseInt(String(i.config.legend[t]),10)+"px")})}legendAlignHorizontal(){const t=this.w;t.dom.elLegendWrap.style.right="0";const e=new H(this.w,this.ctx),i=e.dimHelpers.getTitleSubtitleCoords("title"),s=e.dimHelpers.getTitleSubtitleCoords("subtitle");let a=0;"top"===t.config.legend.position&&(a=i.height+s.height+t.config.title.margin+t.config.subtitle.margin-10),this.setLegendWrapXY(20,a)}legendAlignVertical(){const t=this.w,e=this.legendHelpers.getLegendDimensions();let i=0;"left"===t.config.legend.position&&(i=20),"right"===t.config.legend.position&&(i=t.globals.svgWidth-e.clww-10),this.setLegendWrapXY(i,20)}onLegendHovered(t){var e;const i=this.w,s=t.target,a=s.classList.contains("apexcharts-legend-series")||s.classList.contains("apexcharts-legend-text")||s.classList.contains("apexcharts-legend-marker");if("heatmap"===i.config.chart.type||this.isBarsDistributed){if(a){const i=parseInt(null!=(e=s.getAttribute("rel"))?e:"0",10)-1;this.ctx.events.fireEvent("legendHover",[this.ctx,i,this.w]);const a=new X(this.ctx.w);"mousemove"===t.type?a.highlightRangeInSeries(i,"highlight"):"mouseout"===t.type&&a.highlightRangeInSeries(i,"reset")}}else if(!s.classList.contains("apexcharts-inactive-legend")&&a){new X(this.ctx.w).toggleSeriesOnHover(t,s)}}onLegendKeyDown(t){const e=this,i=this.w,s=t.target;if((s.classList.contains("apexcharts-legend-series")||s.classList.contains("apexcharts-legend-text")||s.classList.contains("apexcharts-legend-marker"))&&("Enter"===t.key||" "===t.key)){t.preventDefault();const a=s.getAttribute("rel");e.onLegendClick(t),null!==a&&i.config.legend.onItemClick.toggleDataSeries&&requestAnimationFrame(()=>{const t=i.dom.baseEl.querySelector(`.apexcharts-legend-series[rel="${a}"]`);t&&t.focus()})}}onLegendClick(t){var e;const i=this.w,s=t.target;if(!i.config.legend.customLegendItems.length&&(s.classList.contains("apexcharts-legend-series")||s.classList.contains("apexcharts-legend-text")||s.classList.contains("apexcharts-legend-marker"))){const t=parseInt(null!=(e=s.getAttribute("rel"))?e:"0",10)-1,a="true"===s.getAttribute("data:collapsed"),r=this.w.config.chart.events.legendClick;"function"==typeof r&&r(this.ctx,t,this.w),this.ctx.events.fireEvent("legendClick",[this.ctx,t,this.w]);const n=this.w.config.legend.markers.onClick;"function"==typeof n&&s.classList.contains("apexcharts-legend-marker")&&(n(this.ctx,t,this.w),this.ctx.events.fireEvent("legendMarkerClick",[this.ctx,t,this.w]));"treemap"!==i.config.chart.type&&"heatmap"!==i.config.chart.type&&!this.isBarsDistributed&&i.config.legend.onItemClick.toggleDataSeries&&this.legendHelpers.toggleDataSeries(t,a)}}}});class re{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.elMeasure=null,this.elZoomReset=null,this.elMenuIcon=null,this.elMenu=null,this.elMenuItems=[],this.t=null}createToolbar(){var t,e;const i=this.w,s=()=>ct.createElementNS("http://www.w3.org/1999/xhtml","div"),a=()=>{const t=ct.createElementNS("http://www.w3.org/1999/xhtml","button");return t.setAttribute("type","button"),t},r=s();if(r.setAttribute("class","apexcharts-toolbar"),r.style.top=i.config.chart.toolbar.offsetY+"px",r.style.right=3-i.config.chart.toolbar.offsetX+"px",i.dom.elWrap.appendChild(r),this.elZoom=a(),this.elZoomIn=a(),this.elZoomOut=a(),this.elPan=a(),this.elSelection=a(),this.elMeasure=a(),this.elZoomReset=a(),this.elMenuIcon=a(),this.elMenu=s(),this.elCustomIcons=[],this.t=i.config.chart.toolbar.tools,Array.isArray(this.t.customIcons))for(let t=0;t<this.t.customIcons.length;t++)this.elCustomIcons.push(a());const n=[],o=(t,e,s)=>{const a=t.toLowerCase();this.t[a]&&i.config.chart.zoom.enabled&&n.push({el:e,icon:"string"==typeof this.t[a]?this.t[a]:s,title:this.localeValues[t],class:`apexcharts-${a}-icon`})};o("zoomIn",this.elZoomIn,'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n    <path d="M12 5v14M5 12h14"/>\n</svg>\n'),o("zoomOut",this.elZoomOut,'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n    <path d="M5 12h14"/>\n</svg>\n');const l=t=>{this.t[t]&&i.config.chart[t].enabled&&n.push({el:"zoom"===t?this.elZoom:this.elSelection,icon:"string"==typeof this.t[t]?this.t[t]:"zoom"===t?'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n    <circle cx="11" cy="11" r="7"/>\n    <path d="m21 21-4.3-4.3M8 11h6M11 8v6"/>\n</svg>\n':'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n    <path d="M5 3a2 2 0 0 0-2 2"/>\n    <path d="M19 3a2 2 0 0 1 2 2"/>\n    <path d="M21 19a2 2 0 0 1-2 2"/>\n    <path d="M5 21a2 2 0 0 1-2-2"/>\n    <path d="M9 3h1M14 3h1M9 21h1M14 21h1M3 9v1M3 14v1M21 9v1M21 14v1"/>\n</svg>\n',title:this.localeValues["zoom"===t?"selectionZoom":"selection"],class:`apexcharts-${t}-icon`})};l("zoom"),l("selection"),this.t.pan&&i.config.chart.zoom.enabled&&n.push({el:this.elPan,icon:"string"==typeof this.t.pan?this.t.pan:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n    <path d="M5 9 2 12l3 3"/>\n    <path d="M9 5l3-3 3 3"/>\n    <path d="M15 19l-3 3-3-3"/>\n    <path d="M19 9l3 3-3 3"/>\n    <path d="M2 12h20"/>\n    <path d="M12 2v20"/>\n</svg>\n',title:this.localeValues.pan,class:"apexcharts-pan-icon"}),this.t.measure&&i.config.chart.measure&&i.config.chart.measure.enabled&&n.push({el:this.elMeasure,icon:"string"==typeof this.t.measure?this.t.measure:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n    <path d="M21.3 15.3a2.4 2.4 0 0 1 0 3.4l-2.6 2.6a2.4 2.4 0 0 1-3.4 0L2.7 8.7a2.4 2.4 0 0 1 0-3.4l2.6-2.6a2.4 2.4 0 0 1 3.4 0Z"/>\n    <path d="m14.5 12.5 2-2"/>\n    <path d="m11.5 9.5 2-2"/>\n    <path d="m8.5 6.5 2-2"/>\n    <path d="m17.5 15.5 2-2"/>\n</svg>\n',title:this.localeValues.measure||"Measure",class:"apexcharts-measure-icon"}),o("reset",this.elZoomReset,'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n    <path d="M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"/>\n    <path d="M3 3v5h5"/>\n</svg>\n'),this.t.download&&n.push({el:this.elMenuIcon,icon:"string"==typeof this.t.download?this.t.download:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n    <path d="M4 6h16M4 12h16M4 18h16"/>\n</svg>\n',title:this.localeValues.menu,class:"apexcharts-menu-icon"});for(let t=0;t<this.elCustomIcons.length;t++)n.push({el:this.elCustomIcons[t],icon:this.t.customIcons[t].icon,title:this.t.customIcons[t].title,index:this.t.customIcons[t].index,class:"apexcharts-toolbar-custom-icon "+this.t.customIcons[t].class});n.forEach((t,e)=>{t.index&&Ht.moveIndexInArray(n,e,t.index)});for(let t=0;t<n.length;t++)I.setAttrs(n[t].el,{class:n[t].class,title:n[t].title,"aria-label":n[t].title}),n[t].el.innerHTML=n[t].icon,r.appendChild(n[t].el);this.elZoom.parentNode&&this.elZoom.setAttribute("aria-pressed",String(!!i.interact.zoomEnabled)),this.elSelection.parentNode&&this.elSelection.setAttribute("aria-pressed",String(!!i.interact.selectionEnabled)),this.elPan.parentNode&&this.elPan.setAttribute("aria-pressed",String(!!i.interact.panEnabled)),this.elMeasure.parentNode&&this.elMeasure.setAttribute("aria-pressed",String(!!i.interact.measureEnabled)),this.elMenuIcon.parentNode&&(this.elMenuIcon.setAttribute("aria-haspopup","true"),this.elMenuIcon.setAttribute("aria-expanded","false")),this._createHamburgerMenu(r),i.interact.zoomEnabled?this.elZoom.classList.add(this.selectedClass):i.interact.panEnabled?this.elPan.classList.add(this.selectedClass):i.interact.selectionEnabled?this.elSelection.classList.add(this.selectedClass):i.interact.measureEnabled&&this.elMeasure&&(this.elMeasure.classList.add(this.selectedClass),null==(e=null==(t=this.ctx.measure)?void 0:t.startMeasure)||e.call(t)),this.addToolbarEventListeners()}_createHamburgerMenu(t){this.elMenuItems=[],t.appendChild(this.elMenu),I.setAttrs(this.elMenu,{class:"apexcharts-menu",role:"menu"});const e=[{name:"exportSVG",title:this.localeValues.exportToSVG},{name:"exportPNG",title:this.localeValues.exportToPNG},{name:"exportCSV",title:this.localeValues.exportToCSV}];for(let t=0;t<e.length;t++)this.elMenuItems.push(ct.createElementNS("http://www.w3.org/1999/xhtml","div")),this.elMenuItems[t].innerHTML=e[t].title,I.setAttrs(this.elMenuItems[t],{class:`apexcharts-menu-item ${e[t].name}`,title:e[t].title,role:"menuitem",tabindex:"-1"}),this.elMenu.appendChild(this.elMenuItems[t])}addToolbarEventListeners(){var t,e,i,s,a,r,n,o,l;null==(t=this.elZoomReset)||t.addEventListener("click",this.handleZoomReset.bind(this)),null==(e=this.elSelection)||e.addEventListener("click",this.toggleZoomSelection.bind(this,"selection")),null==(i=this.elZoom)||i.addEventListener("click",this.toggleZoomSelection.bind(this,"zoom")),null==(s=this.elZoomIn)||s.addEventListener("click",this.handleZoomIn.bind(this)),null==(a=this.elZoomOut)||a.addEventListener("click",this.handleZoomOut.bind(this)),null==(r=this.elPan)||r.addEventListener("click",this.togglePanning.bind(this)),null==(n=this.elMeasure)||n.addEventListener("click",this.toggleMeasure.bind(this)),null==(o=this.elMenuIcon)||o.addEventListener("click",this.toggleMenu.bind(this)),this.elMenuItems.forEach(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<this.t.customIcons.length;t++)this.elCustomIcons[t].addEventListener("click",this.t.customIcons[t].click.bind(this,this.ctx,this.ctx.w));[this.elZoomReset,this.elSelection,this.elZoom,this.elZoomIn,this.elZoomOut,this.elPan,this.elMeasure,this.elMenuIcon,...this.elCustomIcons].forEach(t=>{t.addEventListener("keydown",e=>{if("Enter"===e.key||" "===e.key){e.preventDefault();const i=t.className;t.click(),requestAnimationFrame(()=>{const t=this.w.dom.baseEl;if(!t)return;const e=i.split(" ").find(t=>t.startsWith("apexcharts-"));if(!e)return;const s=t.querySelector(`.${e}`);s&&s.focus()})}})}),null==(l=this.elMenuIcon)||l.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",i=>{var s;if("ArrowDown"===i.key){i.preventDefault();(this.elMenuItems[e+1]||this.elMenuItems[0]).focus()}else if("ArrowUp"===i.key){i.preventDefault();(this.elMenuItems[e-1]||this.elMenuItems[this.elMenuItems.length-1]).focus()}else"Escape"===i.key||"Tab"===i.key?(this._closeMenu(),null==(s=this.elMenuIcon)||s.focus(),"Tab"===i.key||i.preventDefault()):"Enter"!==i.key&&" "!==i.key||(i.preventDefault(),t.click())})})}toggleZoomSelection(t){this.ctx.getSyncedCharts().forEach(e=>{const i=e.ctx.toolbar,s="selection"===t?"selectionEnabled":"zoomEnabled",a=!!e.w.globals[s];i.toggleOtherControls();const r="selection"===t?i.elSelection:i.elZoom;a||(e.w.globals[s]=!0,r.classList.add(i.selectedClass)),r.setAttribute("aria-pressed",String(!!e.w.globals[s]))})}toggleMeasure(){var t,e,i,s;const a=this.w,r=!a.interact.measureEnabled;this.toggleOtherControls(),r&&(a.interact.measureEnabled=!0,null==(t=this.elMeasure)||t.classList.add(this.selectedClass),null==(i=null==(e=this.ctx.measure)?void 0:e.startMeasure)||i.call(e)),null==(s=this.elMeasure)||s.setAttribute("aria-pressed",String(a.interact.measureEnabled))}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")),this.elMeasure||(this.elMeasure=t.dom.baseEl.querySelector(".apexcharts-measure-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,i="pan"===t?this.elZoom:this.elPan;e&&e.classList.add(this.selectedClass),i&&i.classList.remove(this.selectedClass)}togglePanning(){this.ctx.getSyncedCharts().forEach(t=>{const e=t.ctx.toolbar,i=!!t.w.interact.panEnabled;e.toggleOtherControls(),i||(t.w.interact.panEnabled=!0,e.elPan.classList.add(e.selectedClass)),e.elPan.setAttribute("aria-pressed",String(!!t.w.interact.panEnabled))})}toggleOtherControls(){var t,e,i;const s=this.w;s.interact.panEnabled=!1,s.interact.zoomEnabled=!1,s.interact.selectionEnabled=!1,s.interact.measureEnabled&&(s.interact.measureEnabled=!1,null==(e=null==(t=this.ctx.measure)?void 0:t.stopMeasure)||e.call(t),null==(i=this.elMeasure)||i.setAttribute("aria-pressed","false")),this.getToolbarIconsReference();[this.elPan,this.elSelection,this.elZoom,this.elMeasure].forEach(t=>{t&&t.classList.remove(this.selectedClass)})}_currentXRange(){const t=this.w;return t.axisFlags.isRangeBar?{minX:t.globals.minY,maxX:t.globals.maxY}:{minX:t.globals.minX,maxX:t.globals.maxX}}handleZoomIn(){const t=this.w,{minX:e,maxX:i}=this._currentXRange();this.minX=e,this.maxX=i;const s=(e+i)/2,a=(e+s)/2,r=(i+s)/2,n=this._getNewMinXMaxX(a,r);t.interact.disableZoomIn||this.zoomUpdateOptions(n.minX,n.maxX)}handleZoomOut(){const t=this.w,{minX:e,maxX:i}=this._currentXRange();if(this.minX=e,this.maxX=i,"datetime"===t.config.xaxis.type&&new Date(e).getUTCFullYear()<1e3)return;const s=(e+i)/2,a=e-(s-e),r=i-(s-i),n=this._getNewMinXMaxX(a,r);t.interact.disableZoomOut||this.zoomUpdateOptions(n.minX,n.maxX)}_getNewMinXMaxX(t,e){const i=this.w.config.xaxis.convertedCatToNumeric;return{minX:i?Math.floor(t):t,maxX:i?Math.floor(e):e}}zoomUpdateOptions(t,e){const i=this.w;if(void 0===t&&void 0===e)return void this.handleZoomReset();if(i.config.xaxis.convertedCatToNumeric&&(t<1&&(t=1,e=i.globals.dataPoints),e-t<2))return;let s={min:t,max:e};const a=this.getBeforeZoomRange(s,void 0);a&&(s=a.xaxis);const r={xaxis:s};if(!i.globals.initialConfig)return;const n=Ht.clone(i.globals.initialConfig.yaxis);i.config.chart.group||(r.yaxis=n),this.w.interact.zoomed=!0,this.ctx.updateHelpers._updateOptions(r,!1,this.w.config.chart.animations.dynamicAnimation.enabled),this.zoomCallback(s,n)}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 i=null;return"function"==typeof this.ev.beforeZoom&&(i=this.ev.beforeZoom(this,{xaxis:t,yaxis:e})),i}toggleMenu(){window.setTimeout(()=>{var t,e,i;(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==(i=this.elMenuIcon)||i.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,i=new Vt(this.w,this.ctx);switch(t){case"svg":i.exportToSVG();break;case"png":i.exportToPng();break;case"csv":i.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.interact.zoomed)return;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 i=e.config.chart.events.beforeResetZoom(t,e);i&&t.updateHelpers.revertDefaultAxisMinMax(i)}"function"==typeof e.config.chart.events.zoomed&&t.ctx.toolbar.zoomCallback({min:e.config.xaxis.min,max:e.config.xaxis.max});const i=t.ctx.series.emptyCollapsedSeries(Ht.clone(e.globals.initialSeries));t.updateHelpers._updateSeries(i,e.config.chart.animations.dynamicAnimation.enabled),e.interact.zoomed=!1})}destroy(){this.elZoom=null,this.elZoomIn=null,this.elZoomOut=null,this.elPan=null,this.elSelection=null,this.elMeasure=null,this.elZoomReset=null,this.elMenuIcon=null}}class ne{static xRatio(t){const e=t.layout.gridWidth||1;return(t.globals.maxX-t.globals.minX)/e}static dataXToPx(t,e){return(e-t.globals.minX)/ne.xRatio(t)}static pxToDataX(t,e){return t.globals.minX+e*ne.xRatio(t)}static screenXToPlotPx(t,e){const i=t.dom.baseEl,s=i&&i.querySelector(".apexcharts-svg");if(!s)return e-t.layout.translateX;const a=s.getBoundingClientRect(),r=t.globals.svgWidth?a.width/t.globals.svgWidth:1;return(e-a.left)/(r||1)-t.layout.translateX}}c.default.registerFeatures({toolbar:re,zoomPanSelection:class extends re{constructor(t,e){super(t,e),this.w=t,this.ctx=e,this.dragged=!1,this.graphics=new I(this.w),this.eventList=["mousedown","mouseleave","mousemove","touchstart","touchmove","mouseup","touchend"],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"}init({xyRatios:t}){const e=this.w,i=this;this.xyRatios=t,this.zoomRect=this.graphics.drawRect(0,0,0,0),this.selectionRect=this.graphics.drawRect(0,0,0,0),this.constraints=new It(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 s;null==(s=this.hoverArea)||s.addEventListener(e,i.svgMouseEvents.bind(i,t),{capture:!1,passive:!0})}),this._wheelZoomEnabled()&&this.hoverArea.addEventListener("wheel",i.mouseWheelEvent.bind(i),{capture:!1,passive:!1}),this._momentumEnabled()&&["touchstart","touchmove","touchend","touchcancel"].forEach(t=>{var e;null==(e=this.hoverArea)||e.addEventListener(t,i.momentumTouch.bind(i),{capture:!1,passive:!1})}))}destroy(){this.slDraggableRect&&(this.slDraggableRect.draggable(!1),this.slDraggableRect.off(),this.selectionRect.off()),this.selectionRect=null,this.zoomRect=null}svgMouseEvents(t,e){const i=this.w,s=this.ctx.toolbar;if(i.interact.momentum&&i.interact.momentum.busy)return;if(this._momentumEnabled()&&e.touches&&e.touches.length>1)return;const a=i.interact.zoomEnabled?i.config.chart.zoom.type:i.config.chart.selection.type,r=i.config.chart.toolbar.autoSelected;if("measure"!==r&&(e.shiftKey?(i.interact.shiftWasPressed=!0,s.enableZoomPanFromToolbar("pan"===r?"zoom":"pan")):i.interact.shiftWasPressed&&(s.enableZoomPanFromToolbar(r),i.interact.shiftWasPressed=!1)),!e.target)return;const n=e.target.classList;let o;e.target.parentNode&&null!==e.target.parentNode&&(o=e.target.parentNode.classList);if(!(n.contains("apexcharts-legend-marker")||n.contains("apexcharts-legend-text")||o&&o.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=this._gridRect();if(!t)return;this.startX=this._screenXToPlotPx(this.clientX),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:a,xyRatios:this.xyRatios})):(this.w.interact.mousedown&&i.interact.zoomEnabled||this.w.interact.mousedown&&i.interact.selectionEnabled)&&(this.selection=this.selectionDrawing({context:this,zoomtype:a}))),"mouseup"!==e.type&&"touchend"!==e.type&&"mouseleave"!==e.type||this.handleMouseUp({zoomtype:a}),this.makeSelectionRectDraggable()}}handleMouseUp({zoomtype:t,isResized:e}){const i=this.w,s=this._gridRect();s&&(this.w.interact.mousedown||e)&&(this.endX=this._screenXToPlotPx(this.clientX),this.endY=this.clientY-s.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}_incidentalZoomEnabled(t){var e,i,s;const a=this.w.config.chart;return!(!a.zoom||!a.zoom.enabled)&&("auto"!==t?!!t:!(!(null==(e=a.toolbar)?void 0:e.show)||!(null==(s=null==(i=a.toolbar)?void 0:i.tools)?void 0:s.reset)))}_wheelZoomEnabled(){const{zoom:t}=this.w.config.chart;return this._incidentalZoomEnabled(t&&t.allowMouseWheelZoom)}_wheel(){const t=this.w.interact;return t.wheel||(t.wheel={factor:1,clientX:0,rafId:null,endTimer:null}),t.wheel}mouseWheelEvent(t){t.preventDefault();const e=this._wheel();let i=t.deltaY;1===t.deltaMode?i*=33:2===t.deltaMode&&(i*=330),e.factor*=Math.pow(2,i/240),e.clientX=t.clientX,null==e.rafId&&(e.rafId=requestAnimationFrame(()=>this._applyWheelZoom())),e.endTimer&&clearTimeout(e.endTimer),e.endTimer=setTimeout(()=>this._endWheelZoom(),150)}_applyWheelZoom(){const t=this.w,e=this._wheel();e.rafId=null;const i=e.factor;if(e.factor=1,1===i||t.globals.isDestroyed)return;const s=this._gridRect();if(!s||!s.width)return;const{min:a,max:r}=this._currentXWindow(),n=r-a,o=Math.min(Math.max((e.clientX-s.left)/s.width,0),1);let l=n*i;const h=this._clampBounds();if(h){const e=t.globals.minXDiff>0&&isFinite(t.globals.minXDiff)?t.globals.minXDiff:0,i=Math.max(2*e,1e-6*(h.max-h.min));l<i&&(l=i),l>h.max-h.min&&(l=h.max-h.min)}let c=a+o*n-o*l,d=c+l;const u=1e-9*n;if(Math.abs(c-a)<u&&Math.abs(d-r)<u)return;if(isNaN(c)||isNaN(d))return;const p=this.getBeforeZoomRange({min:c,max:d},void 0);p&&p.xaxis&&(c=p.xaxis.min,d=p.xaxis.max),this._applyXRange(c,d,!0)}_endWheelZoom(){const t=this.w;if(this._wheel().endTimer=null,t.globals.isDestroyed||!t.interact.zoomed)return;const{min:e,max:i}=this._currentXWindow(),s=t.globals.initialConfig?Ht.clone(t.globals.initialConfig.yaxis):[],a=this.ctx.toolbar;a&&a.zoomCallback({min:e,max:i},s)}makeSelectionRectDraggable(){const t=this.w;if(!this.selectionRect)return;const e=this.selectionRect.node.getBoundingClientRect();e.width>0&&e.height>0&&(this.selectionRect.select(!1).resize(!1),this.selectionRect.select({createRot:()=>{},updateRot:()=>{},createHandle:(t,e,i,s,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",()=>{var e;if(t.interact.selectionEnabled)t.interact.selection={x:parseFloat(this.selectionRect.node.getAttribute("x")),y:parseFloat(this.selectionRect.node.getAttribute("y")),width:parseFloat(this.selectionRect.node.getAttribute("width")),height:parseFloat(this.selectionRect.node.getAttribute("height"))},clearTimeout(null!=(e=this.w.globals.selectionResizeTimer)?e:void 0),this.w.globals.selectionResizeTimer=window.setTimeout(()=>{this._emitSelectionFromRect()},30);else{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(o({},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 i=ne.dataXToPx(t,t.config.chart.selection.xaxis.min),s=ne.dataXToPx(t,t.config.chart.selection.xaxis.max)-i;t.axisFlags.isRangeBar&&(i=(t.config.chart.selection.xaxis.min-t.globals.yAxisScale[0].niceMin)/e.invertedYRatio,s=(t.config.chart.selection.xaxis.max-t.config.chart.selection.xaxis.min)/e.invertedYRatio);const a={x:i,y:0,width:s,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:i,height:s,translateX:a=0,translateY:r=0}){const n=this.w,o=this.zoomRect,l=this.selectionRect;if(this.dragged||null!==n.interact.selection){const h={transform:"translate("+a+", "+r+")"};n.interact.zoomEnabled&&this.dragged&&(i<0&&(i=1),o.attr({x:t,y:e,width:i,height:s,fill:n.config.chart.zoom.zoomedArea.fill.color,"fill-opacity":n.config.chart.zoom.zoomedArea.fill.opacity,stroke:n.config.chart.zoom.zoomedArea.stroke.color,"stroke-width":n.config.chart.zoom.zoomedArea.stroke.width,"stroke-opacity":n.config.chart.zoom.zoomedArea.stroke.opacity}),I.setAttrs(o.node,h)),n.interact.selectionEnabled&&(l.attr({x:t,y:e,width:i>0?i:0,height:s>0?s:0,fill:n.config.chart.selection.fill.color,"fill-opacity":n.config.chart.selection.fill.opacity,stroke:n.config.chart.selection.stroke.color,"stroke-width":n.config.chart.selection.stroke.width,"stroke-dasharray":n.config.chart.selection.stroke.dashArray,"stroke-opacity":n.config.chart.selection.stroke.opacity}),I.setAttrs(l.node,h))}}hideSelectionRect(t){t&&t.attr({x:0,y:0,width:0,height:0})}selectionDrawing({context:t,zoomtype:e}){const i=this.w,s=t,a=this._gridRect();if(!a)return;const r=s.startX-1,n=s.startY;let h=!1,c=!1;const d=this._screenXToPlotPx(s.clientX),u=s.clientY-a.top;let p=d-r,g=u-n,f={translateX:i.layout.translateX,translateY:i.layout.translateY};return Math.abs(p+r)>i.layout.gridWidth?p=i.layout.gridWidth-r:d<0&&(p=r),r>d&&(h=!0,p=Math.abs(p)),n>u&&(c=!0,g=Math.abs(g)),f="x"===e?{x:h?r-p:r,y:0,width:p,height:i.layout.gridHeight}:"y"===e?{x:0,y:c?n-g:n,width:i.layout.gridWidth,height:g}:{x:h?r-p:r,y:c?n-g:n,width:p,height:g},f=l(o({},f),{translateX:i.layout.translateX,translateY:i.layout.translateY}),s.drawSelectionRect(f),s.selectionDragging("resizing"),f}selectionDragging(t,e){var i;const s=this.w;if(!e)return;e.preventDefault();const{handler:a,box:r}=e.detail,n=this.constraints;let{x:o,y:l}=r;o<n.x&&(o=n.x),l<n.y&&(l=n.y),r.x2>n.x2&&(o=n.x2-r.w),r.y2>n.y2&&(l=n.y2-r.h),a.move(o,l);const h=this.selectionRect;let c=0;"resizing"===t&&(c=30);const d=t=>parseFloat(h.node.getAttribute(t)),u={x:d("x"),y:d("y"),width:d("width"),height:d("height")};s.interact.selection=u;const p=s.config.chart.link,g=!(!p||!p.enabled&&"function"!=typeof p.dimension);("function"==typeof s.config.chart.events.selection||g)&&s.interact.selectionEnabled&&(clearTimeout(null!=(i=this.w.globals.selectionResizeTimer)?i:void 0),this.w.globals.selectionResizeTimer=window.setTimeout(()=>{this._emitSelectionFromRect()},c))}_emitSelectionFromRect(){var t;const e=this.w;if(!e.interact.selectionEnabled)return;const i=e.config.chart.link,s=!(!i||!i.enabled&&"function"!=typeof i.dimension);if("function"!=typeof e.config.chart.events.selection&&!s)return;const a=this._gridRect();if(!a)return;const r=this.selectionRect.node.getBoundingClientRect(),n=this.xyRatios;let o,l,h,c;const d=this._screenXToPlotPx(r.left),u=this._screenXToPlotPx(r.right);if(e.axisFlags.isRangeBar)o=e.globals.yAxisScale[0].niceMin+d*n.invertedYRatio,l=e.globals.yAxisScale[0].niceMin+u*n.invertedYRatio,h=0,c=1;else{if(!e.globals.xAxisScale)return;o=ne.pxToDataX(e,d),l=ne.pxToDataX(e,u),h=e.globals.yAxisScale[0].niceMin+(a.bottom-r.bottom)*n.yRatio[0],c=e.globals.yAxisScale[0].niceMax-(r.top-a.top)*n.yRatio[0]}const p={xaxis:{min:o,max:l},yaxis:{min:h,max:c}};"function"==typeof e.config.chart.events.selection&&e.config.chart.events.selection(this.ctx,p),e.config.chart.brush.enabled&&void 0!==e.config.chart.events.brushScrolled&&e.config.chart.events.brushScrolled(this.ctx,p),null==(t=this.ctx.linkedViews)||t.onSourceSelection(p.xaxis)}selectionDrawn({context:t,zoomtype:e}){var i;const s=this.w,a=t,r=this.xyRatios,n=this.ctx.toolbar,o=s.interact.zoomEnabled?a.zoomRect.node.getBoundingClientRect():a.selectionRect.node.getBoundingClientRect(),l=a._gridRect();if(!l)return;const h=this._screenXToPlotPx(o.left),c=this._screenXToPlotPx(o.right),d=o.top-l.top,u=o.bottom-l.top;let p,g;s.axisFlags.isRangeBar?(p=s.globals.yAxisScale[0].niceMin+h*r.invertedYRatio,g=s.globals.yAxisScale[0].niceMin+c*r.invertedYRatio):(p=ne.pxToDataX(s,h),g=ne.pxToDataX(s,c));const f=[],m=[];if(s.config.yaxis.forEach((t,e)=>{const i=s.globals.seriesYAxisMap[e][0],a=s.globals.yAxisScale[e].niceMax-r.yRatio[i]*d,n=s.globals.yAxisScale[e].niceMax-r.yRatio[i]*u;f.push(a),m.push(n)}),a.dragged&&(a.dragX>10||a.dragY>10)&&p!==g)if(s.interact.zoomEnabled){if(!s.globals.initialConfig)return;let t=Ht.clone(s.globals.initialConfig.yaxis),i=Ht.clone(s.globals.initialConfig.xaxis);if(s.interact.zoomed=!0,s.config.xaxis.convertedCatToNumeric&&(p=Math.floor(p),g=Math.floor(g),p<1&&(p=1,g=s.globals.dataPoints),g-p<2&&(g=p+1)),"xy"!==e&&"x"!==e||(i={min:p,max:g}),"xy"!==e&&"y"!==e||t.forEach((e,i)=>{t[i].min=m[i],t[i].max=f[i]}),n){const e=n.getBeforeZoomRange(i,t);e&&(i=e.xaxis?e.xaxis:i,t=e.yaxis?e.yaxis:t)}const r={xaxis:i};s.config.chart.group||(r.yaxis=t),a.ctx.updateHelpers._updateOptions(r,!1,a.w.config.chart.animations.dynamicAnimation.enabled),"function"==typeof s.config.chart.events.zoomed&&n.zoomCallback(i,t)}else if(s.interact.selectionEnabled){let t=null,r=null;if(r={min:p,max:g},"xy"===e||"y"===e){const e=Ht.clone(s.config.yaxis);t=e,e.forEach((t,i)=>{e[i].min=m[i],e[i].max=f[i]})}s.interact.selection=a.selection,"function"==typeof s.config.chart.events.selection&&s.config.chart.events.selection(a.ctx,{xaxis:r,yaxis:t}),null==(i=a.ctx.linkedViews)||i.onSourceSelection(r)}}panDragging({context:t}){var e;const i=this.w,s=t;if(void 0!==i.interact.lastClientPosition.x){const t=i.interact.lastClientPosition.x-s.clientX,a=(null!=(e=i.interact.lastClientPosition.y)?e:0)-s.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")}i.interact.lastClientPosition={x:s.clientX,y:s.clientY};const a=i.axisFlags.isRangeBar?i.globals.minY:i.globals.minX,r=i.axisFlags.isRangeBar?i.globals.maxY:i.globals.maxX;s.panScrolled(a,r)}panScrolled(t,e){var i,s;const a=this.w,r=this.xyRatios;if(!a.globals.initialConfig)return;const n=Ht.clone(a.globals.initialConfig.yaxis);let o=r.xRatio,l=a.globals.minX,h=a.globals.maxX;if(a.axisFlags.isRangeBar&&(o=r.invertedYRatio,l=a.globals.minY,h=a.globals.maxY),"left"===this.moveDirection?(t=l+a.layout.gridWidth/15*o,e=h+a.layout.gridWidth/15*o):"right"===this.moveDirection&&(t=l-a.layout.gridWidth/15*o,e=h-a.layout.gridWidth/15*o),!a.axisFlags.isRangeBar){const r=null!=(i=a.globals.dataReducerRawMinX)?i:a.globals.initialMinX,n=null!=(s=a.globals.dataReducerRawMaxX)?s:a.globals.initialMaxX;(t<r||e>n)&&(t=l,e=h)}const c={xaxis:{min:t,max:e}};a.config.chart.group||(c.yaxis=n),this.updateScrolledChart(c,t,e)}updateScrolledChart(t,e,i){const s=this.w;if(this.ctx.updateHelpers._updateOptions(t,!1,!1),"function"==typeof s.config.chart.events.scrolled){const t={xaxis:{min:e,max:i}};s.config.chart.events.scrolled(this.ctx,t),this.ctx.events.fireEvent("scrolled",t)}}_momentumEnabled(){return this._pinchEnabled()||this._panInertiaEnabled()}_pinchEnabled(){return this._incidentalZoomEnabled(this.w.config.chart.zoom.pinch)}_panInertiaEnabled(){const t=this.w.config.chart;return!(!t.pan||!t.pan.inertia)}_m(){const t=this.w.interact;return t.momentum||(t.momentum={busy:!1,pinch:null,panState:null,samples:[],inertiaRAF:null}),t.momentum}_currentXWindow(){const t=this.w;return t.axisFlags.isRangeBar?{min:t.globals.minY,max:t.globals.maxY}:{min:t.globals.minX,max:t.globals.maxX}}_gridRect(){const t=this.w.dom.baseEl,e=t&&t.querySelector(".apexcharts-grid");return e?e.getBoundingClientRect():null}_screenXToPlotPx(t){return ne.screenXToPlotPx(this.w,t)}_clampBounds(){var t,e;const i=this.w;return i.axisFlags.isRangeBar?null:{min:null!=(t=i.globals.dataReducerRawMinX)?t:i.globals.initialMinX,max:null!=(e=i.globals.dataReducerRawMaxX)?e:i.globals.initialMaxX}}_applyXRange(t,e,i){const s=this.w;if(!s.globals.initialConfig)return!1;const a=this._currentXWindow(),r=i&&e-t>a.max-a.min,n=this._clampBounds();if(n){const i=e-t;t<n.min&&(e=(t=n.min)+i),e>n.max&&(t=(e=n.max)-i),t<n.min&&(t=n.min)}if(s.config.xaxis.convertedCatToNumeric&&(t=Math.floor(t),e=r?Math.ceil(e):Math.floor(e),t<1&&(t=1),n&&e>n.max&&(e=Math.floor(n.max)),e-t<2))return!1;if(!(e>t))return!1;const o={xaxis:{min:t,max:e}};return s.config.chart.group||(o.yaxis=Ht.clone(s.globals.initialConfig.yaxis)),i&&(s.interact.zoomed=!0),this.ctx.updateHelpers._updateOptions(o,!1,!1),{minX:t,maxX:e}}_cancelInertia(){const t=this._m();null!=t.inertiaRAF&&(cancelAnimationFrame(t.inertiaRAF),t.inertiaRAF=null)}_fireScrolled(){const t=this.w;if("function"!=typeof t.config.chart.events.scrolled)return;const{min:e,max:i}=this._currentXWindow(),s={xaxis:{min:e,max:i}};t.config.chart.events.scrolled(this.ctx,s),this.ctx.events.fireEvent("scrolled",s)}_pushSample(t,e){const i=this._m().samples;for(i.push({x:t,t:e});i.length>6;)i.shift()}momentumTouch(t){const e=this.w,i=this._m(),s=t.type;if("touchstart"===s){this._cancelInertia();const s=this._gridRect();if(!s)return;if(t.touches.length>=2&&this._pinchEnabled())t.preventDefault(),i.busy=!0,i.panState=null,this._beginPinch(t,s);else if(1===t.touches.length&&this._panInertiaEnabled()&&e.interact.panEnabled){i.busy=!0,i.pinch=null;const s=t.touches[0],a=this._currentXWindow(),r=e.layout.gridWidth||1;i.panState={startX:s.clientX,startY:s.clientY,axis:null,minX0:a.min,maxX0:a.max,ratio0:(a.max-a.min)/r},i.samples=[{x:s.clientX,t:t.timeStamp}]}return}"touchmove"!==s?(i.pinch?t.touches.length<2&&this._endPinch():i.panState&&0===t.touches.length&&this._endPan(),0===t.touches.length&&(e.interact.mousedown=!1,this.dragged=!1,null!=i.inertiaRAF||i.pinch||i.panState||(i.busy=!1))):i.pinch&&t.touches.length>=2?(t.preventDefault(),this._movePinch(t)):i.panState&&1===t.touches.length&&this._movePan(t)}_beginPinch(t,e){const i=this.w,s=t.touches[0],a=t.touches[1],r=Math.hypot(a.clientX-s.clientX,a.clientY-s.clientY)||1,n=(s.clientX+a.clientX)/2-e.left-i.globals.barPadForNumericAxis,{min:o,max:l}=this._currentXWindow();this._m().pinch={d0:r,cx0:n,minX0:o,maxX0:l,gridWidth:i.layout.gridWidth||1}}_movePinch(t){const e=this.w,i=this._m().pinch;if(!i)return;const s=this._gridRect();if(!s)return;const a=t.touches[0],r=t.touches[1],n=Math.hypot(r.clientX-a.clientX,r.clientY-a.clientY)||1,o=(a.clientX+r.clientX)/2-s.left-e.globals.barPadForNumericAxis,l=i.maxX0-i.minX0,h=l*(i.d0/n);let c=i.minX0+i.cx0/i.gridWidth*l-o/i.gridWidth*h,d=c+h;const u=this._clampBounds();if(u){const t=e.globals.minXDiff>0&&isFinite(e.globals.minXDiff)?e.globals.minXDiff:0,i=Math.max(2*t,1e-6*(u.max-u.min));if(d-c<i){const t=(c+d)/2;c=t-i/2,d=t+i/2}}this._applyXRange(c,d,!0)}_endPinch(){const t=this.w;this._m().pinch=null;const{min:e,max:i}=this._currentXWindow(),s={min:e,max:i},a=t.globals.initialConfig?Ht.clone(t.globals.initialConfig.yaxis):[],r=this.ctx.toolbar;r&&r.zoomCallback(s,a)}_movePan(t){const e=this._m(),i=e.panState,s=t.touches[0];if(!i.axis){const a=Math.abs(s.clientX-i.startX),r=Math.abs(s.clientY-i.startY);if(a<6&&r<6)return void this._pushSample(s.clientX,t.timeStamp);if(r>a)return e.busy=!1,void(e.panState=null);i.axis="x"}if("x"!==i.axis)return;t.preventDefault();const a=(s.clientX-i.startX)*i.ratio0;this._pushSample(s.clientX,t.timeStamp),this._applyXRange(i.minX0-a,i.maxX0-a,!1)}_endPan(){const t=this._m(),e=t.panState;t.panState=null;let i=0;const s=t.samples;if(s.length>=2){const t=s[0],e=s[s.length-1],a=e.t-t.t;a>0&&(i=(e.x-t.x)/a)}t.samples=[],e&&"x"===e.axis&&this._panInertiaEnabled()&&Math.abs(i)>.05?this._startInertia(i):(t.busy=!1,this._fireScrolled())}_startInertia(t){const e=this.w,i=this._m(),s=e.config.chart.pan&&e.config.chart.pan.friction,a="number"==typeof s?Math.min(Math.max(s,.5),.999):.92;let r=t,n=null;i.busy=!0;const o=t=>{if(e.globals.isDestroyed)return i.inertiaRAF=null,void(i.busy=!1);if(null==n)return n=t,void(i.inertiaRAF=requestAnimationFrame(o));const s=t-n;if(n=t,r*=Math.pow(a,s/16.6667),Math.abs(r)<.02)return i.inertiaRAF=null,i.busy=!1,void this._fireScrolled();const l=this._currentXWindow(),h=e.layout.gridWidth||1,c=(l.max-l.min)/h,d=r*s*c,u=this._applyXRange(l.min-d,l.max-d,!1),p=this._clampBounds();if(!u||p&&(d>0&&u.minX<=p.min+1e-6*(p.max-p.min)||d<0&&u.maxX>=p.max-1e-6*(p.max-p.min)))return i.inertiaRAF=null,i.busy=!1,void this._fireScrolled();i.inertiaRAF=requestAnimationFrame(o)};i.inertiaRAF=requestAnimationFrame(o)}}});let oe=class{constructor(t){this.w=t.w,this.annoCtx=t}setOrientations(t,e=null){var i,s;const a=this.w;if("vertical"===t.label.orientation){const r=null!==e?e:0,n=a.dom.baseEl.querySelector(`.apexcharts-xaxis-annotations .apexcharts-xaxis-annotation-label[rel='${r}']`);if(null!==n){const e=n.getBBox();n.setAttribute("x",String(parseFloat(null!=(i=n.getAttribute("x"))?i:"0")-e.height+4));const a="top"===t.label.position?e.width:-e.width;n.setAttribute("y",String(parseFloat(null!=(s=n.getAttribute("y"))?s:"0")+a));const{x:r,y:o}=this.annoCtx.graphics.rotateAroundCenter(n);n.setAttribute("transform",`rotate(-90 ${r} ${o})`)}}}addBackgroundToAnno(t,e){const i=this.w;if(!t||!e.label.text||!String(e.label.text).trim())return null;const s=i.dom.baseEl.querySelector(".apexcharts-grid");if(!s)return null;const a=s.getBoundingClientRect(),r=s.getBBox(),n=a.width/r.width||1,o=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 u=a.left-r.x*n,p=a.top-r.y*n,g=(o.left-u)/n-l,f=(o.top-p)/n-c,m=this.annoCtx.graphics.drawRect(g,f,o.width/n+l+h,o.height/n+c+d,e.label.borderRadius,e.label.style.background,1,e.label.borderWidth,e.label.borderColor,0);return e.id&&m.node.classList.add(e.id),m}annotationsBackground(){const t=this.w,e=(e,i,s)=>{const a=t.dom.baseEl.querySelector(`.apexcharts-${s}-annotations .apexcharts-${s}-annotation-label[rel='${i}']`);if(a){const i=a.parentNode,s=this.addBackgroundToAnno(a,e);if(s){null==i||i.insertBefore(s.node,a);const r=a.getAttribute("x");null!==r&&m(s,parseFloat(r),t),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,i)=>e(t,i,"xaxis")),t.config.annotations.yaxis.forEach((t,i)=>e(t,i,"yaxis")),t.config.annotations.points.forEach((t,i)=>e(t,i,"point"))}usesCategoryX(){const t=this.w;return("category"===t.config.xaxis.type||t.config.xaxis.convertedCatToNumeric)&&!this.annoCtx.invertAxis&&!t.axisFlags.dataFormatXNumeric&&!t.config.chart.sparkline.enabled}hasXDomain(){const t=this.w;return this.annoCtx.invertAxis?Ht.isNumber(t.globals.minY)&&Ht.isNumber(t.globals.yRange[0]):this.usesCategoryX()?t.labelData.labels.length>0||t.labelData.categoryLabels.length>0:Ht.isNumber(t.globals.minX)&&Ht.isNumber(t.globals.xRange)}getY1Y2(t,e){var i,s,a;const r=this.w,n="y1"===t?e.y:e.y2,o="string"==typeof n&&n.includes("px");let l,h=!1;if(this.annoCtx.invertAxis){const t=r.config.xaxis.convertedCatToNumeric?r.labelData.categoryLabels:r.labelData.labels,s=t.indexOf(n);if(!o&&-1===s)return{yP:0,clipped:!0};const a=r.dom.baseEl.querySelector(`.apexcharts-yaxis-texts-g text:nth-child(${s+1})`);l=a?parseFloat(null!=(i=a.getAttribute("y"))?i:"0"):(r.layout.gridHeight/t.length-1)*(s+1)-r.globals.barHeight,void 0!==e.seriesIndex&&r.globals.barHeight&&(l-=r.globals.barHeight/2*(r.seriesData.series.length-1)-r.globals.barHeight*e.seriesIndex)}else{if(!r.config.yaxis[e.yAxisIndex])return{yP:0,clipped:!0};const t=r.globals.seriesYAxisMap[e.yAxisIndex],i=null!=(s=null==t?void 0:t[0])?s:null;if(null===i&&r.seriesData.series.length)return{yP:0,clipped:!0};const o=null===i?r.globals.minY:r.globals.minYArr[i],c=null===i?r.globals.maxY-r.globals.minY:r.globals.yRange[i],d=r.config.yaxis[e.yAxisIndex].logarithmic&&null!==i?new _(this.w).getLogVal(r.config.yaxis[e.yAxisIndex].logBase,n,i)/r.globals.yLogRatio[i]:(n-o)/(c/r.layout.gridHeight);l=r.layout.gridHeight-Math.min(Math.max(d,0),r.layout.gridHeight),h=d>r.layout.gridHeight||d<0,!e.marker||void 0!==e.y&&null!==e.y||(l=0),(null==(a=r.config.yaxis[e.yAxisIndex])?void 0:a.reversed)&&(l=d)}return o&&(l=parseFloat(n)),{yP:l,clipped:h}}getX1X2(t,e){const i=this.w,s="x1"===t?e.x:e.x2,a=this.annoCtx.invertAxis?i.globals.minY:i.globals.minX,r=this.annoCtx.invertAxis?i.globals.maxY:i.globals.maxX,n=this.annoCtx.invertAxis?i.globals.yRange[0]:i.globals.xRange;let o=!1;const l="string"==typeof s&&s.includes("px"),h=null==s&&e.marker;if(!l&&!h&&!this.hasXDomain())return{x:0,clipped:!0};let c=this.annoCtx.inversedReversedAxis?(r-s)/(n/i.layout.gridWidth):(s-a)/(n/i.layout.gridWidth);return"category"!==i.config.xaxis.type&&!i.config.xaxis.convertedCatToNumeric||this.annoCtx.invertAxis||i.axisFlags.dataFormatXNumeric||i.config.chart.sparkline.enabled||(c=this.getStringX(s)),"string"==typeof s&&s.includes("px")&&(c=parseFloat(s)),null==s&&e.marker&&(c=i.layout.gridWidth),void 0!==e.seriesIndex&&i.globals.barWidth&&!this.annoCtx.invertAxis&&(c-=i.globals.barWidth/2*(i.seriesData.series.length-1)-i.globals.barWidth*e.seriesIndex),"number"!=typeof c&&(c=0,o=!0),parseFloat(c.toFixed(10))>parseFloat(i.layout.gridWidth.toFixed(10))?(c=i.layout.gridWidth,o=!0):c<0&&(c=0,o=!0),{x:c,clipped:o}}getStringX(t){var e;const i=this.w;let s=t;if(i.config.xaxis.convertedCatToNumeric&&i.labelData.categoryLabels.length){const e=String(t);t=i.labelData.categoryLabels.findIndex(t=>String(t)===e)+1}const a=i.labelData.labels.map(t=>Array.isArray(t)?t.join(" "):t).indexOf(t),r=i.dom.baseEl.querySelector(`.apexcharts-xaxis-texts-g text:nth-child(${a+1})`);return r&&(s=parseFloat(null!=(e=r.getAttribute("x"))?e:"0")),s}};class le{constructor(t){this.w=t.w,this.annoCtx=t,this.invertAxis=this.annoCtx.invertAxis,this.helpers=new oe(this.annoCtx)}addXaxisAnnotation(t,e,i){const s=this.w,a=this.helpers.getX1X2("x1",t);let r=a.x;const n=a.clipped;let o,l=!0;const h=t.label.text,c=t.strokeDashArray;if(Ht.isNumber(r)){if(null===t.x2||void 0===t.x2){if(!n){const i=this.annoCtx.graphics.drawLine(r+t.offsetX,0+t.offsetY,r+t.offsetX,s.layout.gridHeight+t.offsetY,t.borderColor,c,t.borderWidth);e.appendChild(i.node),t.id&&i.node.classList.add(t.id),m(i,r+t.offsetX,s)}}else{const i=this.helpers.getX1X2("x2",t);if(o=i.x,l=i.clipped,o<r){const t=r;r=o,o=t}const a=this.annoCtx.graphics.drawRect(r+t.offsetX,0+t.offsetY,o-r,s.layout.gridHeight+t.offsetY,0,t.fillColor,t.opacity,1,t.borderColor,c);a.node.classList.add("apexcharts-annotation-rect"),a.attr("clip-path",`url(#gridRectMask${s.globals.cuid})`),e.appendChild(a.node),t.id&&a.node.classList.add(t.id),m(a,r+t.offsetX,s)}if(!n||!l){const a=this.annoCtx.graphics.getTextRects(h,t.label.style.fontSize),n="top"===t.label.position?4:"center"===t.label.position?s.layout.gridHeight/2+("vertical"===t.label.orientation?a.width/2:0):s.layout.gridHeight,o=this.annoCtx.graphics.drawText({x:r+t.label.offsetX,y:n+t.label.offsetY-("vertical"===t.label.orientation?"top"===t.label.position?a.width/2-12:-a.width/2:0),text:h,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-xaxis-annotation-label ${t.label.style.cssClass} ${t.id?t.id:""}`});o.attr({rel:i}),e.appendChild(o.node),m(o,r+t.label.offsetX,s),this.annoCtx.helpers.setOrientations(t,i)}}}drawXAxisAnnotations(){const t=this.w,e=this.annoCtx.graphics.group({class:"apexcharts-xaxis-annotations"});return t.config.annotations.xaxis.map((t,i)=>{this.addXaxisAnnotation(t,e.node,i)}),e}}class he{constructor(t){this.w=t.w,this.annoCtx=t,this.helpers=new oe(this.annoCtx),this.axesUtils=new O(this.annoCtx.w,{theme:this.annoCtx.theme,timeScale:this.annoCtx.timeScale})}addYaxisAnnotation(t,e,i){const s=this.w,a=t.strokeDashArray;let r=this.helpers.getY1Y2("y1",t),n=r.yP;const o=r.clipped;let l,h=!0,c=!1;const d=t.label.text;if(null===t.y2||void 0===t.y2){if(!o){c=!0;const i=this.annoCtx.graphics.drawLine(0+t.offsetX,n+t.offsetY,this._getYAxisAnnotationWidth(t),n+t.offsetY,t.borderColor,a,t.borderWidth);e.appendChild(i.node),t.id&&i.node.classList.add(t.id)}}else{if(r=this.helpers.getY1Y2("y2",t),l=r.yP,h=r.clipped,l>n){const t=n;n=l,l=t}if(!o||!h){c=!0;const i=this.annoCtx.graphics.drawRect(0+t.offsetX,l+t.offsetY,this._getYAxisAnnotationWidth(t),n-l,0,t.fillColor,t.opacity,1,t.borderColor,a);i.node.classList.add("apexcharts-annotation-rect"),i.attr("clip-path",`url(#gridRectMask${s.globals.cuid})`),e.appendChild(i.node),t.id&&i.node.classList.add(t.id)}}if(c){const a="right"===t.label.position?s.layout.gridWidth:"center"===t.label.position?s.layout.gridWidth/2:0,r=this.annoCtx.graphics.drawText({x:a+t.label.offsetX,y:(null!=l?l:n)+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:""}`});r.attr({rel:i}),e.appendChild(r.node)}}_getYAxisAnnotationWidth(t){const e=this.w;let i=e.layout.gridWidth;return i=t.width.indexOf("%")>-1?e.layout.gridWidth*parseInt(t.width,10)/100:parseInt(t.width,10),i+t.offsetX}drawYAxisAnnotations(){const t=this.w,e=this.annoCtx.graphics.group({class:"apexcharts-yaxis-annotations"});return t.config.annotations.yaxis.forEach((t,i)=>{t.yAxisIndex=this.axesUtils.translateYAxisIndex(t.yAxisIndex),this.axesUtils.isYAxisHidden(t.yAxisIndex)&&this.axesUtils.yAxisAllSeriesCollapsed(t.yAxisIndex)||this.addYaxisAnnotation(t,e.node,i)}),e}}class ce{constructor(t){this.w=t.w,this.annoCtx=t,this.helpers=new oe(this.annoCtx)}addPointAnnotation(t,e,i){const s=this.w;if(s.globals.collapsedSeriesIndices.indexOf(t.seriesIndex)>-1)return;const a=this.helpers.getX1X2("x1",t),r=a.x,n=a.clipped,o=this.helpers.getY1Y2("y1",t),l=o.yP,h=o.clipped;if(Ht.isNumber(r)&&!h&&!n){const a={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 n=this.annoCtx.graphics.drawMarker(r+t.marker.offsetX,l+t.marker.offsetY,a);e.appendChild(n.node);const o=[n.node];m(n,r,s);const h=t.label.text?t.label.text:"",c=this.annoCtx.graphics.drawText({x:r+t.label.offsetX,y:l+t.label.offsetY-t.marker.size-parseFloat(t.label.style.fontSize)/1.6,text:h,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(c.attr({rel:i}),e.appendChild(c.node),m(c,r,s),t.customSVG.SVG){const i=this.annoCtx.graphics.group({class:"apexcharts-point-annotations-custom-svg "+t.customSVG.cssClass});i.attr({transform:`translate(${r+t.customSVG.offsetX}, ${l+t.customSVG.offsetY})`}),i.node.innerHTML=t.customSVG.SVG,e.appendChild(i.node),o.push(i.node)}if(t.image.path){const e=t.image.width?t.image.width:20,i=t.image.height?t.image.height:20;n=this.annoCtx.addImage({x:r+t.image.offsetX-e/2,y:l+t.image.offsetY-i/2,width:e,height:i,path:t.image.path,appendTo:".apexcharts-point-annotations"}),o.push(n.node)}t.tooltip&&t.tooltip.enabled&&o.forEach(e=>{e.addEventListener("mouseenter",()=>{this.showPointTooltip(t,e)}),e.addEventListener("mouseleave",()=>{this.hidePointTooltip()})}),t.mouseEnter&&n.node.addEventListener("mouseenter",t.mouseEnter.bind(this,t)),t.mouseLeave&&n.node.addEventListener("mouseleave",t.mouseLeave.bind(this,t)),t.click&&n.node.addEventListener("click",t.click.bind(this,t))}}getPointTooltipEl(){const t=this.w;let e=t.dom.elWrap.querySelector(".apexcharts-annotation-tooltip");return e||(e=ct.createElementNS("http://www.w3.org/1999/xhtml","div"),e.classList.add("apexcharts-tooltip","apexcharts-annotation-tooltip"),t.dom.elWrap.appendChild(e)),e}getPointTooltipContent(t){const e=this.w,i=t.tooltip||{};if("function"==typeof i.formatter)return i.formatter({annotation:t,seriesIndex:t.seriesIndex,id:t.id,w:e});let s=null!=i.text?i.text:t.label&&t.label.text;return Array.isArray(s)&&(s=s.join("<br/>")),null==s?"":String(s)}showPointTooltip(t,e){const i=this.w,s=this.getPointTooltipContent(t);if(!s)return;const a=this.getPointTooltipEl();a.innerHTML=s;const r=t.tooltip.theme||i.config.tooltip.theme||"light";a.classList.remove("apexcharts-theme-light","apexcharts-theme-dark"),a.classList.add(`apexcharts-theme-${r}`),a.classList.add("apexcharts-active");const n=i.dom.elWrap.getBoundingClientRect(),o=e.getBoundingClientRect(),l=a.getBoundingClientRect(),h=t.tooltip.offsetX||0,c=t.tooltip.offsetY||0;let d=o.left-n.left+o.width/2-l.width/2,u=o.top-n.top-l.height-10;d=Math.max(0,Math.min(d,n.width-l.width)),u<0&&(u=o.top-n.top+o.height+10),a.style.left=d+h+"px",a.style.top=u+c+"px"}hidePointTooltip(){const t=this.w.dom.elWrap.querySelector(".apexcharts-annotation-tooltip");t&&t.classList.remove("apexcharts-active")}drawPointAnnotations(){const t=this.w,e=this.annoCtx.graphics.group({class:"apexcharts-point-annotations"});return t.config.annotations.points.map((t,i)=>{this.addPointAnnotation(t,e.node,i)}),e}}c.default.registerFeatures({annotations:class{constructor(t,{theme:e=null,timeScale:i=null}={}){this.w=t,this.theme=e,this.timeScale=i,this.invertAxis=void 0,this.inversedReversedAxis=void 0,this.graphics=new I(this.w),this.w.globals.isBarHorizontal&&(this.invertAxis=!0),this.helpers=new oe(this),this.xAxisAnnotations=new le(this),this.yAxisAnnotations=new he(this),this.pointsAnnotations=new ce(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){const e=this.yAxisAnnotations.drawYAxisAnnotations(),i=this.xAxisAnnotations.drawXAxisAnnotations(),s=this.pointsAnnotations.drawPointAnnotations(),a=t.config.chart.animations.enabled,r=[e,i,s],n=[i.node,e.node,s.node],o="line"===t.config.chart.type||"area"===t.config.chart.type||"rangeArea"===t.config.chart.type,l=[o,!1,o];for(let e=0;e<3;e++)t.dom.elGraphical.add(r[e]),!a||t.globals.resized||t.globals.dataChanged||"scatter"!==t.config.chart.type&&"bubble"!==t.config.chart.type&&t.globals.dataPoints>1&&!l[e]&&n[e].classList.add("apexcharts-element-hidden"),t.globals.delayedElements.push({el:n[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,i){this.xAxisAnnotations.addXaxisAnnotation(t,e,i)}addYaxisAnnotation(t,e,i){this.yAxisAnnotations.addYaxisAnnotation(t,e,i)}addPointAnnotation(t,e,i){this.pointsAnnotations.addPointAnnotation(t,e,i)}addText(t){const{x:e,y:i,text:s,textAnchor:a,foreColor:r,fontSize:n,fontFamily:o,fontWeight:l,cssClass:h,backgroundColor:c,borderWidth:d,strokeDashArray:u,borderRadius:p,borderColor:g,appendTo:f=".apexcharts-svg",paddingLeft:m=4,paddingRight:x=4,paddingBottom:b=2,paddingTop:y=2}=t,w=this.w,v=this.graphics.drawText({x:e,y:i,text:s,textAnchor:a||"start",fontSize:n||"12px",fontWeight:l||"regular",fontFamily:o||w.config.chart.fontFamily,foreColor:r||w.config.chart.foreColor,cssClass:h}),_=w.dom.baseEl.querySelector(f);_&&_.appendChild(v.node);const A=v.bbox();if(s){const t=this.graphics.drawRect(A.x-m,A.y-y,A.width+m+x,A.height+b+y,p,c||"transparent",1,d,g,u);_.insertBefore(t.node,v.node)}}addImage(t){const e=this.w,{path:i,x:s=0,y:a=0,width:r=20,height:n=20,appendTo:o=".apexcharts-svg"}=t,l=e.dom.Paper.image(i);l.size(r,n).move(s,a);const h=e.dom.baseEl.querySelector(o);return h&&h.appendChild(l.node),l}addXaxisAnnotationExternal(t,e,i){return this.addAnnotationExternal({params:t,pushToMemory:e,context:i,type:"xaxis",contextMethod:i.addXaxisAnnotation}),i}addYaxisAnnotationExternal(t,e,i){return this.addAnnotationExternal({params:t,pushToMemory:e,context:i,type:"yaxis",contextMethod:i.addYaxisAnnotation}),i}addPointAnnotationExternal(t,e,i){return void 0===this.invertAxis&&(this.invertAxis=i.w.globals.isBarHorizontal),this.addAnnotationExternal({params:t,pushToMemory:e,context:i,type:"point",contextMethod:i.addPointAnnotation}),i}addAnnotationExternal({params:t,pushToMemory:e,context:i,type:s,contextMethod:a}){const r=i,n=r.w,o=n.dom.baseEl.querySelector(`.apexcharts-${s}-annotations`),l=o.childNodes.length+1,h=new it,c=Object.assign({},"xaxis"===s?h.xAxisAnnotation:"yaxis"===s?h.yAxisAnnotation:h.pointAnnotation),d=Ht.extend(c,t);switch(s){case"xaxis":this.addXaxisAnnotation(d,o,l);break;case"yaxis":this.addYaxisAnnotation(d,o,l);break;case"point":this.addPointAnnotation(d,o,l)}const u=n.dom.baseEl.querySelector(`.apexcharts-${s}-annotations .apexcharts-${s}-annotation-label[rel='${l}']`),p=this.helpers.addBackgroundToAnno(u,d);return p&&o.insertBefore(p.node,u),e&&n.globals.memory.methodsToExec.push({context:r,id:d.id?d.id:Ht.randomId(),method:a,label:"addAnnotation",params:t}),i}_removeAnnotationTooltip(t){const e=t.dom.elWrap&&t.dom.elWrap.querySelector(".apexcharts-annotation-tooltip");e&&e.parentNode&&e.parentNode.removeChild(e)}clearAnnotations(t){const e=t.w;this._removeAnnotationTooltip(e);const i=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(i,t=>{for(;t.firstChild;)t.removeChild(t.firstChild)})}removeAnnotation(t,e){const i=t.w;this._removeAnnotationTooltip(i);const s=i.dom.baseEl.querySelectorAll(`.${e}`);s&&(i.globals.memory.methodsToExec.map((t,s)=>{t.id===e&&i.globals.memory.methodsToExec.splice(s,1)}),Object.keys(i.config.annotations).forEach(t=>{const s=i.config.annotations[t];Array.isArray(s)&&(i.config.annotations[t]=s.filter(t=>t.id!==e))}),Array.prototype.forEach.call(s,t=>{t.parentElement.removeChild(t)}))}}});function de(t,e){if(!(e>0))return[];if(1===e)return[o({},t)];const i=t.width>=t.height,s=i?t.width:t.height,a=i?t.height:t.width,r=a>0?s/a:e;let n=Math.max(1,Math.ceil(Math.sqrt(r*e)));n>e&&(n=e);const l=Math.floor(e/n);let h=e-l*n;const c=[],d=s/n;let u=0;for(let e=0;e<n;e++){const e=l+(h>0?1:0);h>0&&h--;const s=e>0?a/e:0;for(let a=0;a<e;a++)c.push(i?{x:t.x+u,y:t.y+a*s,width:d,height:s}:{x:t.x+a*s,y:t.y+u,width:s,height:d});u+=d}return c}function ue(t,e,i){if(!(e>0))return[];const s=t.width>=t.height,a=s?t.width:t.height,r=s?t.height:t.width,n=s?t.y:t.x,o=n+r,l=r>0?a/r:e;let h=Math.max(Math.ceil(Math.sqrt(l*e)),Math.ceil(a/16));h>=1||(h=1),h>e&&(h=e);const c=Math.floor(e/h);let d=e-c*h;const u=[],p=a/h;let g=s?t.x:t.y;for(let t=0;t<h;t++){const t=c+(d>0?1:0);d>0&&d--;const e=[],a=i(g,g+p,s);if(Array.isArray(a))for(let t=0;t<a.length;t++){const i=a[t];if(!i)continue;const s=Math.max(n,Math.min(i[0],i[1])),r=Math.min(o,Math.max(i[0],i[1]));r>s&&e.push([s,r])}e.length||e.push([n,o]);const r=e.reduce((t,e)=>t+(e[1]-e[0]),0),l=e.map(i=>r>0?(i[1]-i[0])/r*t:t/e.length),h=l.map(t=>Math.floor(t));let f=h.reduce((t,e)=>t+e,0);const m=l.map((t,e)=>({i:e,frac:t-Math.floor(t)})).sort((t,e)=>e.frac-t.frac);for(let e=0;f<t;e++,f++)h[m[e%m.length].i]++;for(let t=0;t<e.length;t++){const i=h[t];if(i<=0)continue;const a=e[t][0],r=(e[t][1]-a)/i;for(let t=0;t<i;t++)u.push(s?{x:g,y:a+t*r,width:p,height:r}:{x:a+t*r,y:g,width:r,height:p})}g+=p}return u}function pe(t,e,i,s,a,r){let n=a===i?0:Math.round((t-i)/(a-i)*32767),o=r===s?0:Math.round((e-s)/(r-s)*32767),l=0;for(let t=32768;t>=1;t/=2){const e=(n&t)>0?1:0,i=(o&t)>0?1:0;if(l+=t*t*(3*e^i),0===i){1===e&&(n=t-1-n,o=t-1-o);const i=n;n=o,o=i}}return l}function ge(t,e){let i=1/0,s=1/0,a=-1/0,r=-1/0;const n=t.map(t=>{const[n,o]=e(t);return n<i&&(i=n),n>a&&(a=n),o<s&&(s=o),o>r&&(r=o),[n,o]});return t.map((t,e)=>({item:t,d:pe(n[e][0],n[e][1],i,s,a,r)})).sort((t,e)=>t.d-e.d).map(t=>t.item)}function fe(t){if(!t||"string"!=typeof t)return null;const e=t.trim();if("#"===e[0]){const t=e.slice(1);return 3===t.length?[parseInt(t[0]+t[0],16),parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),1]:6===t.length||8===t.length?[parseInt(t.slice(0,2),16),parseInt(t.slice(2,4),16),parseInt(t.slice(4,6),16),8===t.length?parseInt(t.slice(6,8),16)/255:1]:null}const i=e.match(/^rgba?\(([^)]+)\)$/i);if(i){const t=i[1].split(",").map(t=>parseFloat(t));return t.length<3||t.some(t=>!isFinite(t))?null:[t[0],t[1],t[2],t.length>3?t[3]:1]}return null}function me(t,e){const i=fe(t),s=fe(e);return i&&s?t=>{const e=Math.round(i[0]+(s[0]-i[0])*t),a=Math.round(i[1]+(s[1]-i[1])*t),r=Math.round(i[2]+(s[2]-i[2])*t),n=i[3]+(s[3]-i[3])*t;return n>=1?`rgb(${e},${a},${r})`:`rgba(${e},${a},${r},${n})`}:null}function xe(t){return t<.5?4*t*t*t:1-Math.pow(-2*t+2,3)/2}c.default.registerFeatures({keyboardNavigation:class{constructor(t,e){this.w=t,this.ctx=e,this.seriesIndex=0,this.dataPointIndex=0,this.active=!1,this._tooltipDismissed=!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),this._onPointerDown=this._onPointerDown.bind(this),this._lastPointerDownAt=0}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("mousedown",this._onPointerDown,{capture:!0}),t.addEventListener("pointerdown",this._onPointerDown,{capture:!0}),t.addEventListener("touchstart",this._onPointerDown,{capture:!0,passive:!0}),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;this.ctx.events.removeEventListener("legendClick",this._onLegendClick),e&&(e.removeEventListener("focus",this._onFocus),e.removeEventListener("blur",this._onBlur),e.removeEventListener("keydown",this._onKeyDown),e.removeEventListener("mousedown",this._onPointerDown,{capture:!0}),e.removeEventListener("pointerdown",this._onPointerDown,{capture:!0}),e.removeEventListener("touchstart",this._onPointerDown,{capture:!0}))}_onPointerDown(){this._lastPointerDownAt=Date.now()}handleKey(t){}_onFocus(){this._isNavEnabled()&&(Date.now()-this._lastPointerDownAt<100||(this.active=!0,this._clampCursor(),this._snapToVisibleRange(),this._showCurrentPoint()))}_onBlur(){this.active=!1,this._tooltipDismissed=!1,this._hideFocus()}_onLegendClick(){this.active&&(this.active=!1,this._hideFocus())}_onKeyDown(t){var e,i,s;if(this._isNavEnabled()&&this.active){if(t.shiftKey&&("ArrowRight"===t.key||"ArrowLeft"===t.key)&&this._canPan())return t.preventDefault(),void this._panBy("ArrowRight"===t.key?1:-1);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"+":case"=":this._canZoom()&&(t.preventDefault(),null==(e=this.ctx.toolbar)||e.handleZoomIn(),this._announce("Zoomed in"));break;case"-":case"_":this._canZoom()&&(t.preventDefault(),null==(i=this.ctx.toolbar)||i.handleZoomOut(),this._announce("Zoomed out"));break;case"0":this._canZoom()&&this.w.interact.zoomed&&(t.preventDefault(),null==(s=this.ctx.toolbar)||s.handleZoomReset(),this._announce("Zoom reset"));break;case"Escape":t.preventDefault(),this._tooltipDismissed?(this.active=!1,this._tooltipDismissed=!1,this._hideFocus()):(this._tooltipDismissed=!0,this._hideFocus())}}}_canZoom(){const t=this.w;return Boolean(t.globals.axisCharts&&t.config.chart.zoom&&t.config.chart.zoom.enabled)}_canPan(){return this._canZoom()}_panBy(t){const e=this.w,i=this.ctx.toolbar;if(!i)return;const s=Number(e.globals.minX),a=Number(e.globals.maxX);if(!isFinite(s)||!isFinite(a)||s===a)return;const r=.1*(a-s)*t;i.zoomUpdateOptions(s+r,a+r),this._announce(t>0?"Panned right":"Panned left")}_move(t,e){const i=this.w,s=i.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 r=this.seriesIndex+t,n=0;for(;n<a&&(r<0&&(r=s?a-1:0),r>=a&&(r=s?0:a-1),i.globals.collapsedSeriesIndices.includes(r));)r+=t,n++;this.seriesIndex=r;const o=this._getDataPointCount(r);this.dataPointIndex>=o&&(this.dataPointIndex=o-1)}if(0!==e){const t=this._getDataPointCount(this.seriesIndex);let i=this.dataPointIndex+e;i<0&&(i=s?t-1:0),i>=t&&(i=s?0:t-1),this.dataPointIndex=i,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,i=this._getDataPointCount(e);let s=this.dataPointIndex,a=0;if(Array.isArray(t.seriesData.series[e])){for(;a<i&&null===t.seriesData.series[e][s];)s=(s+1)%i,a++;this.dataPointIndex=s}}_skipNullBackward(){const t=this.w,e=this.seriesIndex,i=this._getDataPointCount(e);let s=this.dataPointIndex,a=0;if(Array.isArray(t.seriesData.series[e])){for(;a<i&&null===t.seriesData.series[e][s];)s=(s-1+i)%i,a++;this.dataPointIndex=s}}_showCurrentPoint(){const{seriesIndex:t,dataPointIndex:e}=this,i=this.w,s=i.globals.tooltip;s&&s.ttItems&&(i.interact.capturedSeriesIndex=t,i.interact.capturedDataPointIndex=e,this._applyFocusClass(t,e),this._showTooltip(t,e,s))}_hideFocus(){const t=this.w,e=t.globals.tooltip;if(this._removeFocusClass(),this._leaveHoveredBar(),!e)return;e.marker&&e.marker.resetPointsSize(),this._enlargedScatterMarker=null;const i=e.getElTooltip();i&&(i.classList.remove("apexcharts-active"),t.config.chart.accessibility.enabled&&t.config.chart.accessibility.announcements.enabled&&i.setAttribute("aria-hidden","true")),t.dom.baseEl.classList.remove("apexcharts-tooltip-active");const s=e.getElXCrosshairs();s&&s.classList.remove("apexcharts-active")}_showTooltip(t,e,i){const s=this.w,a=s.config.chart.type,r=i.getElTooltip();if(!r)return;const n=i.getCachedDimensions();i.tooltipRect={x:0,y:0,ttWidth:n.ttWidth||0,ttHeight:n.ttHeight||0},this._setSyntheticEvent(t,e,i),s.dom.baseEl.classList.add("apexcharts-tooltip-active"),r.classList.add("apexcharts-active"),s.config.chart.accessibility.enabled&&s.config.chart.accessibility.announcements.enabled&&r.removeAttribute("aria-hidden"),"pie"===a||"donut"===a||"polarArea"===a?this._showTooltipNonAxis(t,e,i,r):"radialBar"===a?this._showTooltipRadialBar(t,e,i,r):"heatmap"===a||"treemap"===a?this._showTooltipHeatTree(t,e,i,r,a):"bar"===a||"candlestick"===a||"boxPlot"===a||"violin"===a||"rangeBar"===a?this._showTooltipBar(t,e,i):this._showTooltipAxisLine(t,e,i)}_setSyntheticEvent(t,e,i){const s=this.w,a=s.config.chart.type;let r=0,n=0;const o=this._getFocusableElement(t,e);if(o){const t=o.getBoundingClientRect();r=t.left+t.width/2,n=t.top+t.height/2}else if(s.globals.pointsArray&&s.globals.pointsArray[t]&&s.globals.pointsArray[t][e]){const a=s.globals.pointsArray[t][e],o=i.getElGrid&&i.getElGrid();if(o){const t=o.getBoundingClientRect();r=t.left+(a[0]||0),n=t.top+(a[1]||0)}}else{const t=s.dom.Paper&&s.dom.Paper.node;if(t){const e=t.getBoundingClientRect();r=e.left+e.width/2,n=e.top+e.height/2}}if(("line"===a||"area"===a||"rangeArea"===a||"scatter"===a||"bubble"===a||"radar"===a)&&s.globals.pointsArray&&s.globals.pointsArray[t]&&s.globals.pointsArray[t][e]){const a=s.globals.pointsArray[t][e],o=i.getElGrid&&i.getElGrid();if(o){const t=o.getBoundingClientRect();r=t.left+(a[0]||0),n=t.top+(a[1]||0)}}i.e={type:"mousemove",clientX:r,clientY:n}}_showTooltipBar(t,e,i){var s,a,r,n;const h=this.w,c=i.tConfig.shared&&(i.tooltipUtil.isXoverlap(e)||h.globals.isBarHorizontal)&&i.tooltipUtil.isInitialSeriesSameLen(),d=null==(n=null==(r=null==(a=null==(s=h.rangeData.seriesRange)?void 0:s[t])?void 0:a[e])?void 0:r.y)?void 0:n[0];i.tooltipLabels.drawSeriesTexts(l(o(o({ttItems:i.ttItems,i:t,j:e},void 0!==(null==d?void 0:d.y1)&&{y1:d.y1}),void 0!==(null==d?void 0:d.y2)&&{y2:d.y2}),{shared:c}));const u=`.apexcharts-series[data\\:realIndex='${t}']`,p=h.dom.Paper.findOne(`${u} path[j='${e}'], ${u} circle[j='${e}'], ${u} rect[j='${e}']`);if(p){this._leaveHoveredBar();new I(this.w,this.ctx).pathMouseEnter(p,null),this._hoveredBarEl=p}if(h.globals.isBarHorizontal){const t=p&&p.node;if(t){const e=h.dom.elWrap.getBoundingClientRect(),s=t.getBoundingClientRect(),a=s.left-e.left,r=s.top-e.top,n=s.height,o=s.width,l=i.tooltipRect.ttWidth||0,c=r+n/2-(i.tooltipRect.ttHeight||0)/2;let d=a+o;a<(i.xyRatios&&null!=i.xyRatios.baseLineInvertedY?i.xyRatios.baseLineInvertedY:e.width/2)&&(d=a-l);const u=i.getElTooltip();u&&(u.style.left=d+"px",u.style.top=c+"px")}}else i.tooltipPosition.moveStickyTooltipOverBars(e,t)}_showTooltipAxisLine(t,e,i){const s=this.w,a=s.config.chart.type,r=i.tConfig.shared&&i.tooltipUtil.isXoverlap(e)&&i.tooltipUtil.isInitialSeriesSameLen();i.tooltipLabels.drawSeriesTexts({ttItems:i.ttItems,i:t,j:e,shared:r});const n="scatter"===a||"bubble"===a,o=s.globals.markers.largestSize>0&&!s.globals.markers.batched;n?this._showScatterBubblePoint(t,e,i):o?r?i.marker.enlargePoints(e):i.tooltipPosition.moveDynamicPointOnHover(e,t):r?i.tooltipPosition.moveDynamicPointsOnHover(e):i.tooltipPosition.moveDynamicPointOnHover(e,t)}_showScatterBubblePoint(t,e,i){const s=this.w.dom.baseEl;this._enlargedScatterMarker&&(i.marker.oldPointSize(this._enlargedScatterMarker),this._enlargedScatterMarker=null);const a=s.querySelector(`.apexcharts-series[data\\:realIndex='${t}']`);if(!a)return;const r=a.querySelector(`.apexcharts-marker[rel='${e}']`);r&&(i.marker.enlargeCurrentPoint(e,r),this._enlargedScatterMarker=r)}_showTooltipNonAxis(t,e,i,s){const a=this.w;i.tooltipLabels.drawSeriesTexts({ttItems:i.ttItems,i:e,shared:!1});const r=s.getBoundingClientRect(),n=r.width||i.tooltipRect.ttWidth||0,o=r.height||i.tooltipRect.ttHeight||0,l=a.dom.baseEl.querySelector(`.apexcharts-pie-area[j='${e}']`),h=i.getSliceAnchor(l);h&&(s.style.left=h.x-n/2+"px",s.style.top=h.y-o-10+"px")}_showTooltipRadialBar(t,e,i,s){var a;const r=this.w;i.tooltipLabels.drawSeriesTexts({ttItems:i.ttItems,i:t,shared:!1});const{ttWidth:n=0,ttHeight:o=0}=i.getCachedDimensions(),l=r.dom.baseEl.querySelector(`.apexcharts-radialbar-series[data\\:realIndex='${t}'] path`);if(l){const e=parseFloat(null!=(a=l.getAttribute("data:angle"))?a:"")||0,i=(r.config.plotOptions.radialBar.startAngle||0)+e/2,h=r.layout.gridWidth/2,c=r.layout.gridHeight/2,d=r.globals.radialSize||Math.min(r.layout.gridWidth,r.layout.gridHeight)/2,u=r.seriesData.series.length,p=d/Math.max(u,1),g=d-t*p,f=(g+(g-p))/2,m=Ht.polarToCartesian(h,c,f,i),x=m.x+(r.layout.translateX||0),b=m.y+(r.layout.translateY||0);s.style.left=x-n/2+"px",s.style.top=b-o-10+"px"}}_showTooltipHeatTree(t,e,i,s,a){var r,n;const o=this.w;i.tooltipLabels.drawSeriesTexts({ttItems:i.ttItems,i:t,j:e,shared:!1});const l=s.getBoundingClientRect(),h=l.width||i.tooltipRect.ttWidth||0,c=l.height||i.tooltipRect.ttHeight||0,d="heatmap"===a?"apexcharts-heatmap-rect":"apexcharts-treemap-rect",u=o.dom.baseEl.querySelector(`.${d}[i='${t}'][j='${e}']`);if(u){const t=o.dom.elWrap.getBoundingClientRect(),e=u.getBoundingClientRect(),a=e.left-t.left,l=e.top-t.top,d=e.width,p=e.height,g=parseFloat(null!=(r=u.getAttribute("cx"))?r:""),f=parseFloat(null!=(n=u.getAttribute("width"))?n:"");i.tooltipPosition.moveXCrosshairs(g+f/2);let m=a+d+h/2;const x=l+p/2-c/2;a+d>o.layout.gridWidth/2&&(m=a-h/2),s.style.left=m+"px",s.style.top=x+"px"}}_applyFocusClass(t,e){this._removeFocusClass();const i=this._getFocusableElement(t,e)||this._getBatchedFocusEl(t);if(i){i.classList.add("apexcharts-keyboard-focused"),i.setAttribute("role","img");const s=this._buildPointLabel(t,e);s&&i.setAttribute("aria-label",s),this._focusedEl=i}}_getBatchedFocusEl(t){return this.w.globals.markers.batched?this.w.dom.baseEl.querySelector(`.apexcharts-series[data\\:realIndex='${t}'] .apexcharts-series-markers path`):null}_removeFocusClass(){this._focusedEl&&(this._focusedEl.classList.remove("apexcharts-keyboard-focused"),this._focusedEl.removeAttribute("role"),this._focusedEl.removeAttribute("aria-label"),this._focusedEl=null)}_buildPointLabel(t,e){var i,s,a,r,n,o,l,h;const c=this.w,d=c.config.chart.type,u=c.seriesData.seriesNames||[],p=c.seriesData.series||[];if("pie"===d||"donut"===d||"polarArea"===d){const t=null!=(s=(null==(i=c.labelData)?void 0:i.labels)&&c.labelData.labels[e])?s:"",a=Array.isArray(p)?p[e]:"";return t?`${t}: ${a}`:`${a}`}if("radialBar"===d){return`${u[t]||`Series ${t+1}`}: ${Array.isArray(p)?p[t]:""}`}const g=u[t]||`Series ${t+1}`,f=(Array.isArray(p[t])?p[t]:[])[e];let m=null==f?"":String(f);const x=null==(r=null==(a=c.formatters)?void 0:a.yLabelFormatters)?void 0:r[t];if("function"==typeof x)try{m=x(f,{seriesIndex:t,dataPointIndex:e,w:c})}catch(t){}let b="";const y=null==(n=c.labelData)?void 0:n.categoryLabels,w=null==(l=null==(o=c.seriesData)?void 0:o.seriesX)?void 0:l[t];if(Array.isArray(y)&&null!=y[e])b=String(y[e]);else if(Array.isArray(w)&&null!=w[e]){const i=null==(h=c.formatters)?void 0:h.xLabelFormatter;if("function"==typeof i)try{b=String(i(w[e],{seriesIndex:t,dataPointIndex:e,w:c}))}catch(t){b=String(w[e])}else b=String(w[e])}return b?`${g}: ${m}, ${b}`:`${g}: ${m}`}_leaveHoveredBar(){if(this._hoveredBarEl){new I(this.w,this.ctx).pathMouseLeave(this._hoveredBarEl,null),this._hoveredBarEl=null}}_getFocusableElement(t,e){const i=this.w,s=i.config.chart.type,a=i.dom.baseEl;if("pie"===s||"donut"===s||"polarArea"===s)return a.querySelector(`.apexcharts-pie-area[j='${e}']`);if("heatmap"===s)return a.querySelector(`.apexcharts-heatmap-rect[i='${t}'][j='${e}']`);if("treemap"===s)return a.querySelector(`.apexcharts-treemap-rect[i='${t}'][j='${e}']`);if("radialBar"===s)return a.querySelector(`.apexcharts-radialbar-series[data\\:realIndex='${t}'] path`);if("bar"===s||"candlestick"===s||"boxPlot"===s||"violin"===s||"rangeBar"===s)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,i=e.config.chart.type;if("pie"===i||"donut"===i||"polarArea"===i)return e.seriesData.series.length;const s=e.seriesData.series;return s[t]&&Array.isArray(s[t])?s[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,i=this.seriesIndex;if(!t.interact.zoomed)return;const s=t.seriesData.seriesX&&t.seriesData.seriesX[i];if(!s||!s.length)return;const a=e.minX,r=e.maxX;if(void 0===a||void 0===r)return;const n=s[this.dataPointIndex];if(n>=a&&n<=r)return;const o=s.length;for(let t=0;t<o;t++)if(s[t]>=a&&s[t]<=r)return void(this.dataPointIndex=t)}_snapToVisibleRangeInDirection(t){const e=this.w,i=e.globals,s=this.seriesIndex,a=e.seriesData.seriesX&&e.seriesData.seriesX[s];if(!a||!a.length)return;const r=i.minX,n=i.maxX;if(void 0===r||void 0===n)return;const o=a.length;if(t>=0){for(let t=0;t<o;t++)if(a[t]>=r&&a[t]<=n)return void(this.dataPointIndex=t)}else for(let t=o-1;t>=0;t--)if(a[t]>=r&&a[t]<=n)return void(this.dataPointIndex=t)}_isDataPointVisible(t,e){const i=this.w,s=i.globals;if(!i.interact.zoomed)return!0;const a=i.seriesData.seriesX&&i.seriesData.seriesX[t];if(!a)return!0;const r=a[e];return void 0===r||r>=s.minX&&r<=s.maxX}_announce(t){const e=this.w;if(!e.config.chart.accessibility.announcements.enabled)return;const i=e.dom.baseEl;if(!i)return;const s=i.querySelector(".apexcharts-sr-status");s&&(s.textContent="",setTimeout(()=>{s.textContent=t},0))}}});const be=new Set(["bar","funnel","pyramid","histogram"]),ye=new Set(["pie","donut","polarArea","radialBar","gauge"]),we=new Set(["unit","waffle"]),ve=new Set(["treemap","sunburst"]),_e=new Set(["boxPlot","violin"]),Ae=1500;function Se(t){return be.has(t)?"bar":ye.has(t)?"radial":we.has(t)?"unit":ve.has(t)?"partition":_e.has(t)?"summary":null}c.default.registerFeatures({morphTypeChange:class{constructor(t,e){this.w=t,this.ctx=e,this._snapshot=null,this._ghost=null,this._pieceLayer=null,this._pieceCancel=null}canMorphTypes(t,e){if(t===e)return!1;const i=Se(t),s=Se(e);return!(!i||!s)&&("partition"===i==("partition"===s)||"unit"!==i&&"unit"!==s)}isCompatibleSeriesShape(t,e,i){if(!Array.isArray(i)||0===i.length)return!1;const s=Se(t),a=Se(e);return"unit"===a?!!i.every(t=>"number"==typeof t)||i.every(t=>t&&"object"==typeof t&&Array.isArray(t.data)):"partition"===a||("radial"===a?!!i.every(t=>"number"==typeof t)||1===i.length&&i[0]&&"object"==typeof i[0]&&Array.isArray(i[0].data):"bar"===a||"summary"===a?i.every(t=>t&&"object"==typeof t&&Array.isArray(t.data)):null!==s&&null!==a)}captureBeforeDestroy({fromType:t,toType:e,newSeries:i}){if(this._snapshot=null,this._removeGhost(),this._cancelPieces(),!Wt.isBrowser())return!1;const s=this.w.config.chart.animations;if(!s||!1===s.enabled)return!1;if(s.chartTypeMorph&&!1===s.chartTypeMorph.enabled)return!1;if(s.respectReducedMotion&&f())return!1;if(!this.canMorphTypes(t,e))return!1;if(!this.isCompatibleSeriesShape(t,e,i))return!1;const{marks:a,branches:r,unitDots:n}=this._captureFromDOM(t);if(!a.length)return!1;const o=this._buildMapping(a,t,e,i,r);if(0===o.size)return!1;this._snapshot={fromType:t,toType:e,mapping:o,oldLayout:{translateX:this.w.layout.translateX||0,translateY:this.w.layout.translateY||0}};const l=Se(t),h=Se(e),c=this._canProbePaths();if("unit"===h&&("bar"===l||"summary"===l||"radial"===l&&c)){const t=this._countUnitSeries(i);this._snapshot.pieceOut=t>0&&t<=Ae}else if("unit"===l&&("bar"===h||"summary"===h||"radial"===h&&c)){let t=0;if(n.forEach(e=>{t+=e.length}),t>0&&t<=Ae){this._snapshot.pieceIn=!0,this._snapshot.sourceDots=n;const t=[];"radial"===h?(Array.isArray(i)?i:[]).forEach((e,i)=>{t.push(`${i}:0`)}):(Array.isArray(i)?i:[]).forEach((e,i)=>{const s=e&&Array.isArray(e.data)?e.data:[];for(let e=0;e<s.length;e++)t.push(`${i}:${e}`)}),this._snapshot.keyOrder=t}}return!this._needsGhost(t,e)||this._snapshot.pieceOut||this._snapshot.pieceIn||this._captureGhost(),this.w.globals.previousPaths=[],!0}_needsGhost(t,e){return"unit"===Se(t)||"unit"===Se(e)}_captureGhost(){var t,e;const i=null==(t=this.w.dom)?void 0:t.Paper,s=i&&i.node;if(!s||"function"!=typeof s.cloneNode)return;const a=s.cloneNode(!0),r=[".apexcharts-xaxis",".apexcharts-yaxis",".apexcharts-grid",".apexcharts-gridlines-horizontal",".apexcharts-gridlines-vertical",".apexcharts-legend",".apexcharts-title-text",".apexcharts-subtitle-text",".apexcharts-annotations",".apexcharts-zoom-rect",".apexcharts-selection-rect",".apexcharts-xcrosshairs",".apexcharts-ycrosshairs"];"function"==typeof a.querySelectorAll&&r.forEach(t=>{a.querySelectorAll(t).forEach(t=>{t.parentNode&&t.parentNode.removeChild(t)})}),"function"==typeof a.querySelectorAll&&a.querySelectorAll("[id]").forEach(t=>{t.removeAttribute("id")}),null==(e=a.removeAttribute)||e.call(a,"id"),this._ghost=a}_mountGhost(){var t,e,i;const s=this._ghost;if(!s||!Wt.isBrowser())return;const a=null==(t=this.w.dom)?void 0:t.elWrap;if(!a||"function"!=typeof a.appendChild)return void(this._ghost=null);const r=s.style;r&&(r.position="absolute",r.left="0",r.top="0",r.background="transparent",r.pointerEvents="none",r.opacity="1"),null==(e=s.setAttribute)||e.call(s,"aria-hidden","true"),null==(i=s.setAttribute)||i.call(s,"class","apexcharts-morph-ghost"),a.appendChild(s);const n=this.getSpeed(),o=Math.max(120,Math.round(.55*n));ct.requestAnimationFrame(()=>{r&&(r.transition=`opacity ${o}ms ease-in`,r.opacity="0")}),setTimeout(()=>this._removeGhost(),o+60)}_removeGhost(){const t=this._ghost;this._ghost=null,t&&t.parentNode&&t.parentNode.removeChild(t)}_countUnitSeries(t){if(!Array.isArray(t))return 0;let e=0;for(const i of t){if(!i||"object"!=typeof i||!Array.isArray(i.data))return 0;e+=i.data.length}return e}usesPieceTakeover(){return!(!this._snapshot||!this._snapshot.pieceOut)}claimsTargetMark(t,e){return!!(this._snapshot&&this._snapshot.pieceIn&&this._snapshot.mapping.has(`${t}:${e}`))}_makePieceLayer(){var t,e;const i=null==(t=this.w.dom)?void 0:t.elGraphical,s=i&&i.node;if(!s||"function"!=typeof s.appendChild)return null;const a=ct.createElementNS("http://www.w3.org/2000/svg","g");if(!a)return null;a.setAttribute("class","apexcharts-morph-pieces"),a.setAttribute("pointer-events","none");const r=null==(e=this.w.globals)?void 0:e.cuid;return r&&a.setAttribute("clip-path",`url(#gridRectBarMask${r})`),s.appendChild(a),this._pieceLayer=a,a}_revealPieceHidden(){var t;const e=null==(t=this.w.globals.dom)?void 0:t.baseEl;e&&"function"==typeof e.querySelectorAll&&e.querySelectorAll("[data-piece-hidden]").forEach(t=>{t.removeAttribute("opacity"),t.removeAttribute("data-piece-hidden")})}_cancelPieces(){this._pieceCancel&&(this._pieceCancel(),this._pieceCancel=null);const t=this._pieceLayer;this._pieceLayer=null,t&&t.parentNode&&t.parentNode.removeChild(t),this._revealPieceHidden()}_canProbePaths(){if(!Wt.isBrowser())return!1;const t=ct.createElementNS("http://www.w3.org/2000/svg","path");return!!t&&"function"==typeof t.isPointInFill}_makeExtentProber(t,e,i){const s=i.ownerDocument.createElementNS("http://www.w3.org/2000/svg","path");s.setAttribute("d",t),s.setAttribute("fill","#000"),s.setAttribute("stroke","#000"),s.setAttribute("stroke-width","3"),s.setAttribute("visibility","hidden"),i.appendChild(s);const a=s.ownerSVGElement;if("function"!=typeof s.isPointInFill||!a||"function"!=typeof a.createSVGPoint)return i.removeChild(s),null;const r=a.createSVGPoint(),n=(t,e)=>{r.x=t,r.y=e;const i=s;return i.isPointInFill(r)||"function"==typeof i.isPointInStroke&&i.isPointInStroke(r)},o=48;return{intervalsAt:(t,i,s)=>{const a=s?e.y:e.x,r=a+(s?e.height:e.width);if(!(r>a))return null;const l=(t,e)=>s?n(e,t):n(t,e),h=[t+.1*(i-t),(t+i)/2,i-.1*(i-t)],c=(t,e,i)=>{let s=e,a=t;for(let t=0;t<6;t++){const t=(s+a)/2;l(t,i)?a=t:s=t}return(s+a)/2},d=(r-a)/o,u=new Array(49).fill(null);let p=!1;for(const t of h)for(let e=0;e<=o;e++)null===u[e]&&l(a+e*d,t)&&(u[e]=t,p=!0);if(!p)return null;const g=[];let f=-1;for(let t=0;t<=49;t++){const e=t<=o&&null!==u[t];if(e&&f<0&&(f=t),!e&&f>=0){const e=t-1,i=u[f],s=0===f?a:c(a+f*d,a+(f-1)*d,i),n=e===o?r:c(a+e*d,a+(e+1)*d,u[e]);n>s&&g.push([s,n]),f=-1}}return g.length?g:null},dispose:()=>{s.parentNode&&s.parentNode.removeChild(s)}}}_separatePieces(){var t;const e=this._snapshot,i=null==(t=this.w.globals.dom)?void 0:t.baseEl;if(!e||!i)return this._revealPieceHidden();const s=new Map;let a=0;if(i.querySelectorAll(".apexcharts-unit-area").forEach(t=>{var e,i,r,n,o,l,h;const c=parseInt(null!=(e=t.getAttribute("i"))?e:"",10);if(isNaN(c))return;const d=t.getAttribute("cx");let u,p,g=3;if(null!=d)u=parseFloat(d),p=parseFloat(null!=(i=t.getAttribute("cy"))?i:""),g=parseFloat(null!=(r=t.getAttribute("r"))?r:"3")||3;else{const e=parseFloat(null!=(n=t.getAttribute("width"))?n:"0")||0,i=parseFloat(null!=(o=t.getAttribute("height"))?o:"0")||0;u=parseFloat(null!=(l=t.getAttribute("x"))?l:"")+e/2,p=parseFloat(null!=(h=t.getAttribute("y"))?h:"")+i/2,g=Math.max(e,i)/2||3}if(!isFinite(u)||!isFinite(p))return;let f=s.get(c);f||(f=[],s.set(c,f)),f.push({el:t,x:u,y:p,r:g,fill:t.getAttribute("fill")}),a++}),0===a||a>Ae)return this._revealPieceHidden();const r=this._makePieceLayer();if(!r)return this._revealPieceHidden();const n=[],o=r.ownerDocument,l=Se(e.fromType),h="summary"===l||"radial"===l;if(Array.from(s.keys()).sort((t,e)=>t-e).forEach(t=>{var i;const a=s.get(t),l=this.getInitialBBoxFor(t),c=e.mapping.get(`${t}:0`);if(!l||!c)return void a.forEach(t=>{t.el.removeAttribute("opacity"),t.el.removeAttribute("data-piece-hidden")});const d=c.fill&&0!==c.fill.indexOf("url(")?c.fill:(null==(i=this.w.globals.colors)?void 0:i[t])||a[0].fill;let u=null;if(h){const e=this.getInitialPathFor(t,0);e&&(u=this._makeExtentProber(e,l,r))}const p=u?ue(l,a.length,u.intervalsAt):de(l,a.length);u&&u.dispose();const g=ge(p,t=>[t.x+t.width/2,t.y+t.height/2]),f=ge(a,t=>[t.x,t.y]);for(let e=0;e<f.length;e++){const i=g[e],s=f[e],a=o.createElementNS("http://www.w3.org/2000/svg","rect");a.setAttribute("data-i",String(t)),a.setAttribute("x",String(i.x)),a.setAttribute("y",String(i.y)),a.setAttribute("width",String(i.width)),a.setAttribute("height",String(i.height)),a.setAttribute("rx","0"),a.setAttribute("fill",String(d)),r.appendChild(a),n.push({el:a,from:{x:i.x,y:i.y,width:i.width,height:i.height,rx:0},to:{x:s.x-s.r,y:s.y-s.r,width:2*s.r,height:2*s.r,rx:s.r},fill:me(d,s.fill),fillEnd:s.fill,delay:0,meta:{dotEl:s.el}})}}),!n.length)return this._cancelPieces();this._runPieces(n,t=>{const e=t.meta.dotEl;e.removeAttribute("opacity"),e.removeAttribute("data-piece-hidden"),t.el.parentNode&&t.el.parentNode.removeChild(t.el)})}_combinePieces(){var t,e;const i=this._snapshot,s=null==(t=this.w.globals.dom)?void 0:t.baseEl;if(!(i&&i.sourceDots&&i.keyOrder&&s))return this._revealPieceHidden();const a=this._collectTargetMarks(i.toType);if(!a.size)return this._revealPieceHidden();const r=i.oldLayout.translateX-(this.w.layout.translateX||0),n=i.oldLayout.translateY-(this.w.layout.translateY||0),o=Array.from(i.sourceDots.keys()).sort((t,e)=>t-e),l=this._makePieceLayer();if(!l)return this._revealPieceHidden();const h=l.ownerDocument,c=[],d=Se(i.toType),u="summary"===d||"radial"===d;for(let t=0;t<o.length;t++){const s=i.sourceDots.get(o[t]),d=i.keyOrder[t],p=d?a.get(d):null;if(!p||!s||!s.length){p&&p.els.forEach(t=>{t.removeAttribute("opacity"),t.removeAttribute("data-piece-hidden")});continue}const g=p.fill&&0!==p.fill.indexOf("url(")?p.fill:(null==(e=this.w.globals.colors)?void 0:e[p.realIndex])||s[0].fill;let f=null;if(u){const t=p.d||p.els.map(t=>t.getAttribute("pathTo")||t.getAttribute("d")).filter(Boolean).join(" ");t&&(f=this._makeExtentProber(t,p.bbox,l))}const m=f?ue(p.bbox,s.length,f.intervalsAt):de(p.bbox,s.length);f&&f.dispose();const x=ge(m,t=>[t.x+t.width/2,t.y+t.height/2]),b=ge(s,t=>[t.x,t.y]),y={remaining:b.length,els:p.els,tiles:[]};for(let t=0;t<b.length;t++){const e=b[t],i=x[t],s=h.createElementNS("http://www.w3.org/2000/svg","rect"),a=e.x+r-e.r,o=e.y+n-e.r;s.setAttribute("data-key",d),s.setAttribute("x",String(a)),s.setAttribute("y",String(o)),s.setAttribute("width",String(2*e.r)),s.setAttribute("height",String(2*e.r)),s.setAttribute("rx",String(e.r)),s.setAttribute("fill",String(e.fill||g)),l.appendChild(s),y.tiles.push(s),c.push({el:s,from:{x:a,y:o,width:2*e.r,height:2*e.r,rx:e.r},to:{x:i.x,y:i.y,width:i.width,height:i.height,rx:0},fill:me(e.fill,g),fillEnd:String(g),delay:0,meta:{markState:y}})}}if(!c.length)return this._cancelPieces();this._runPieces(c,t=>{const e=t.meta.markState;e.remaining--,0===e.remaining&&(e.els.forEach(t=>{t.removeAttribute("opacity"),t.removeAttribute("data-piece-hidden")}),e.tiles.forEach(t=>{t.parentNode&&t.parentNode.removeChild(t)}))})}_runPieces(t,e){const i=this.getSpeed(),s=Math.min(300,.35*i),a=Math.max(180,i-s);for(let e=0;e<t.length;e++)t[e].delay=t.length>1?e/(t.length-1)*s:0;this._pieceCancel=function({pieces:t,duration:e,onPieceDone:i,onAllDone:s}){let a=!1;const r=Date.now(),n=Math.max(1,e),o=(t,e)=>{const i=t.from,s=t.to,a=t.el;a.setAttribute("x",String(i.x+(s.x-i.x)*e)),a.setAttribute("y",String(i.y+(s.y-i.y)*e)),a.setAttribute("width",String(Math.max(0,i.width+(s.width-i.width)*e))),a.setAttribute("height",String(Math.max(0,i.height+(s.height-i.height)*e))),a.setAttribute("rx",String(Math.max(0,i.rx+(s.rx-i.rx)*e))),t.fill?a.setAttribute("fill",t.fill(e)):e>=1&&t.fillEnd&&a.setAttribute("fill",t.fillEnd)},l=()=>{if(a)return;const e=Date.now()-r;let h=!1;for(let s=0;s<t.length;s++){const a=t[s];if(a._done)continue;const r=(e-a.delay)/n;if(r<1&&(h=!0),r<=0)continue;const l=Math.min(1,r);o(a,xe(l)),l>=1&&(a._done=!0,i&&i(a))}h?ct.requestAnimationFrame(l):s&&s()};return ct.requestAnimationFrame(l),()=>{a=!0}}({pieces:t,duration:a,onPieceDone:e,onAllDone:()=>{this._pieceCancel=null,this._cancelPieces()}})}_collectTargetMarks(t){var e;const i=null==(e=this.w.globals.dom)?void 0:e.baseEl,s=new Map;if(!i)return s;const a=Se(t);if("radial"===a)return i.querySelectorAll(".apexcharts-pie-series .apexcharts-pie-area").forEach((t,e)=>{const i=t.getAttribute("data:pathFinal")||t.getAttribute("d");if(!i||!i.trim())return;const a=this._pathBBox(i);a&&s.set(`${e}:0`,{realIndex:e,j:0,d:i,bbox:{x:a.minX,y:a.minY,width:a.maxX-a.minX,height:a.maxY-a.minY},fill:t.getAttribute("fill"),els:[t]})}),s;const r="summary"===a?`.apexcharts-${t}-series`:".apexcharts-bar-series";return i.querySelectorAll(`${r} .apexcharts-series`).forEach(t=>{var e;const i=parseInt(null!=(e=t.getAttribute("data:realIndex"))?e:"0",10)||0;let a=0;t.querySelectorAll("path[pathTo]").forEach(t=>{var e;const r=t.getAttribute("pathTo")||t.getAttribute("d");if(!r||!r.trim())return;const n=parseInt(null!=(e=t.getAttribute("j"))?e:"",10),o=isNaN(n)?a++:n,l=this._pathBBox(r);if(!l)return;const h=`${i}:${o}`,c=s.get(h);c?(c.els.push(t),c.bbox={x:Math.min(c.bbox.x,l.minX),y:Math.min(c.bbox.y,l.minY),width:Math.max(c.bbox.x+c.bbox.width,l.maxX)-Math.min(c.bbox.x,l.minX),height:Math.max(c.bbox.y+c.bbox.height,l.maxY)-Math.min(c.bbox.y,l.minY)}):s.set(h,{realIndex:i,j:o,bbox:{x:l.minX,y:l.minY,width:l.maxX-l.minX,height:l.maxY-l.minY},fill:t.getAttribute("fill"),els:[t]})})}),s}_captureFromDOM(t){var e;const i=null==(e=this.w.globals.dom)?void 0:e.baseEl;if(!i)return{marks:[],branches:[],unitDots:new Map};const s=[],a=[],r=new Map,n=Se(t);if("bar"===n){i.querySelectorAll(".apexcharts-bar-series .apexcharts-series").forEach(t=>{var e;const i=parseInt(null!=(e=t.getAttribute("data:realIndex"))?e:"0",10);t.querySelectorAll("path[pathTo]").forEach((t,e)=>{const a=t.getAttribute("pathTo")||t.getAttribute("d");a&&s.push({realIndex:i,j:e,d:a,fill:t.getAttribute("fill")})})})}else if("summary"===n){const e=new Map;i.querySelectorAll(`.apexcharts-${t}-area`).forEach(t=>{var i,s;const a=parseInt(null!=(i=t.getAttribute("j"))?i:"",10);if(isNaN(a))return;const r=t.getAttribute("pathTo")||t.getAttribute("d");if(!r||!r.trim())return;const n="function"==typeof t.closest?t.closest(".apexcharts-series"):null,o=parseInt(null!=(s=null==n?void 0:n.getAttribute("data:realIndex"))?s:"0",10)||0,l=`${o}:${a}`,h=e.get(l);h?h.d+=` ${r}`:e.set(l,{realIndex:o,j:a,d:r,fill:t.getAttribute("fill")})}),Array.from(e.values()).sort((t,e)=>t.realIndex-e.realIndex||t.j-e.j).forEach(t=>s.push(t))}else if("partition"===n)if("treemap"===t){const t=t=>{var e,i,s,a;const r=parseFloat(null!=(e=t.getAttribute("x"))?e:""),n=parseFloat(null!=(i=t.getAttribute("y"))?i:""),o=parseFloat(null!=(s=t.getAttribute("width"))?s:""),l=parseFloat(null!=(a=t.getAttribute("height"))?a:"");return[r,n,o,l].every(t=>isFinite(t))?`M ${r} ${n} L ${r+o} ${n} L ${r+o} ${n+l} L ${r} ${n+l} Z`:null};i.querySelectorAll(".apexcharts-treemap-rect").forEach(e=>{var i,a;const r=t(e);r&&s.push({realIndex:parseInt(null!=(i=e.getAttribute("i"))?i:"0",10)||0,j:parseInt(null!=(a=e.getAttribute("j"))?a:"0",10)||0,d:r,fill:e.getAttribute("fill"),key:e.getAttribute("data:key")||null})});i.querySelectorAll(".apexcharts-treemap-parent-rect").forEach(e=>{const i=t(e),s=e.getAttribute("data:key");i&&s&&a.push({key:s,d:i,fill:e.getAttribute("fill")})})}else{const t=i.querySelectorAll(".apexcharts-sunburst-arc"),e=[];t.forEach(t=>{"true"===t.getAttribute("data:leaf")&&e.push(t)});(e.length?e:Array.from(t)).forEach((t,e)=>{const i=t.getAttribute("d");i&&i.trim()&&s.push({realIndex:e,j:0,d:i,fill:t.getAttribute("fill"),key:t.getAttribute("data:key")||null})}),t.forEach(t=>{if("true"===t.getAttribute("data:leaf"))return;const e=t.getAttribute("d"),i=t.getAttribute("data:key");e&&e.trim()&&i&&a.push({key:i,d:e,fill:t.getAttribute("fill")})})}else if("unit"===n){const t=i.querySelectorAll(".apexcharts-unit-area"),e=new Map;t.forEach(t=>{var i,s,a,n,o,l,h;const c=parseInt(null!=(i=t.getAttribute("i"))?i:"",10);if(isNaN(c))return;const d=t.getAttribute("cx");let u,p,g=3;if(null!=d)u=parseFloat(d),p=parseFloat(null!=(s=t.getAttribute("cy"))?s:""),g=parseFloat(null!=(a=t.getAttribute("r"))?a:"3")||3;else{const e=parseFloat(null!=(n=t.getAttribute("width"))?n:"0")||0,i=parseFloat(null!=(o=t.getAttribute("height"))?o:"0")||0;u=parseFloat(null!=(l=t.getAttribute("x"))?l:"")+e/2,p=parseFloat(null!=(h=t.getAttribute("y"))?h:"")+i/2,g=Math.max(e,i)/2||3}if(!isFinite(u)||!isFinite(p))return;let f=r.get(c);f||(f=[],r.set(c,f)),f.push({x:u,y:p,r:g,fill:t.getAttribute("fill")});const m=e.get(c);m?(u<m.minX&&(m.minX=u),u>m.maxX&&(m.maxX=u),p<m.minY&&(m.minY=p),p>m.maxY&&(m.maxY=p)):e.set(c,{minX:u,minY:p,maxX:u,maxY:p,fill:t.getAttribute("fill")})}),Array.from(e.keys()).sort((t,e)=>t-e).forEach(t=>{const i=e.get(t),a=i.minX-2,r=i.minY-2,n=i.maxX+2,o=i.maxY+2;s.push({realIndex:t,j:0,d:`M ${a} ${r} L ${n} ${r} L ${n} ${o} L ${a} ${o} Z`,fill:i.fill})})}else if("radial"===n)if("radialBar"===t||"gauge"===t){const t=this.w.layout.gridWidth/2,e=Math.min(this.w.layout.gridWidth,this.w.layout.gridHeight)/2;i.querySelectorAll(".apexcharts-radial-series .apexcharts-radialbar-area").forEach(i=>{var a;const r=i.parentElement,n=parseInt(null!=(a=null==r?void 0:r.getAttribute("data:realIndex"))?a:"0",10),o=i.getAttribute("d");if(!o)return;const l=parseFloat(i.getAttribute("stroke-width")||"0"),h=l>1&&this._radialArcToFilledSegment(o,l,t,e)||o;s.push({realIndex:n,j:0,d:h,fill:i.getAttribute("stroke")})})}else{i.querySelectorAll(".apexcharts-pie-series .apexcharts-pie-area").forEach((t,e)=>{const i=t.getAttribute("d");i&&s.push({realIndex:e,j:0,d:i,fill:t.getAttribute("fill")})})}return{marks:s,branches:a,unitDots:r}}_radialArcToFilledSegment(t,e,i,s){const a=t.match(/M\s*(-?[\d.]+)\s+(-?[\d.]+)\s+A\s*(-?[\d.]+)\s+(?:-?[\d.]+)\s+(?:-?[\d.]+)\s+(\d)\s+(\d)\s+(-?[\d.]+)\s+(-?[\d.]+)/);if(!a)return null;const r=parseFloat(a[1]),n=parseFloat(a[2]),o=parseFloat(a[3]),l=parseInt(a[4],10),h=parseInt(a[5],10),c=parseFloat(a[6]),d=parseFloat(a[7]);if(!isFinite(o)||o<=0)return null;const u=e/2,p=o+u,g=Math.max(0,o-u),f=(t,e,a)=>{const r=t-i,n=e-s,o=Math.sqrt(r*r+n*n);if(0===o)return{x:i,y:s};const l=a/o;return{x:i+r*l,y:s+n*l}},m=f(r,n,p),x=f(c,d,p),b=f(r,n,g),y=f(c,d,g),w=h?0:1;return`M ${m.x} ${m.y} A ${p} ${p} 0 ${l} ${h} ${x.x} ${x.y} L ${y.x} ${y.y} A ${g} ${g} 0 ${l} ${w} ${b.x} ${b.y} Z`}buildRingSegmentPath(t,e,i,s,a,r){const n=s/2,o=i+n,l=Math.max(0,i-n),h=(a-90)*Math.PI/180,c=(r-90)*Math.PI/180,d=t+o*Math.cos(h),u=e+o*Math.sin(h),p=t+o*Math.cos(c),g=e+o*Math.sin(c),f=t+l*Math.cos(h),m=e+l*Math.sin(h),x=t+l*Math.cos(c),b=e+l*Math.sin(c),y=r>a?1:0,w=Math.abs(r-a)>180?1:0;return`M ${d} ${u} A ${o} ${o} 0 ${w} ${y} ${p} ${g} L ${x} ${b} A ${l} ${l} 0 ${w} ${1-y} ${f} ${m} Z`}getFromType(){return this._snapshot?this._snapshot.fromType:null}_buildMapping(t,e,i,s,a){const r=new Map,n=Se(i),o=t.slice().sort((t,e)=>t.realIndex-e.realIndex||t.j-e.j);if("partition"===n&&a&&a.length){const t=o.filter(t=>t.key);t.length===o.length&&(t.forEach(t=>{r.set(`key:${t.key}`,{d:t.d,fill:t.fill})}),a.forEach(t=>{r.set(`key:${t.key}`,{d:t.d,fill:t.fill})}))}if("radial"===n||"unit"===n||"partition"===n)return o.forEach((t,e)=>{r.set(`${e}:0`,{d:t.d,fill:t.fill})}),r;if("bar"===n||"summary"===n){const t=[];return(Array.isArray(s)?s:[]).forEach((e,i)=>{const s=e&&Array.isArray(e.data)?e.data:[];for(let e=0;e<s.length;e++)t.push({realIndex:i,j:e})}),o.forEach((e,i)=>{const s=t[i];s&&r.set(`${s.realIndex}:${s.j}`,{d:e.d,fill:e.fill})}),r}return r}isActive(){return null!==this._snapshot}getInitialPathFor(t,e){if(!this._snapshot)return null;const i=this._snapshot.mapping.get(`${t}:${e}`);if(!i)return null;const s=this._snapshot.oldLayout.translateX-(this.w.layout.translateX||0),a=this._snapshot.oldLayout.translateY-(this.w.layout.translateY||0);return 0===s&&0===a?i.d:this._translatePathD(i.d,s,a)}_translatePathD(t,e,i){if(0===e&&0===i)return t;return gt(t).map(t=>{const s=t[0];return"Z"===s?"Z":"M"===s||"L"===s||"T"===s?`${s} ${t[1]+e} ${t[2]+i}`:"H"===s?`${s} ${t[1]+e}`:"V"===s?`${s} ${t[1]+i}`:"C"===s?`${s} ${t[1]+e} ${t[2]+i} ${t[3]+e} ${t[4]+i} ${t[5]+e} ${t[6]+i}`:"S"===s||"Q"===s?`${s} ${t[1]+e} ${t[2]+i} ${t[3]+e} ${t[4]+i}`:"A"===s?`${s} ${t[1]} ${t[2]} ${t[3]} ${t[4]} ${t[5]} ${t[6]+e} ${t[7]+i}`:t.join(" ")}).join(" ")}getInitialCenterFor(t){const e=this.getInitialBBoxFor(t);return e?{x:e.x+e.width/2,y:e.y+e.height/2}:null}getInitialPathAt(t){return this.getInitialPathFor(t,0)}getInitialPathForKey(t){return this._snapshot&&t?this.getInitialPathFor("key",t):null}hasKeyedMarks(){if(!this._snapshot)return!1;for(const t of this._snapshot.mapping.keys())if("string"==typeof t&&t.startsWith("key:"))return!0;return!1}getInitialSlotFor(t,e,i){const s=this.getInitialBBoxFor(t);if(!s)return null;const a=s.x+s.width/2,r=s.y+s.height/2;if(!(i>1&&e>=0))return{x:a,y:r};const n=(Math.min(e,i-1)+.5)/i;return s.height>=s.width?{x:a,y:s.y+s.height*(1-n)}:{x:s.x+s.width*n,y:r}}getInitialBBoxFor(t){if(!this._snapshot)return null;const e=this._snapshot.mapping.get(`${t}:0`);if(!e)return null;const i=this._pathBBox(e.d);if(!i)return null;const s=this._snapshot.oldLayout.translateX-(this.w.layout.translateX||0),a=this._snapshot.oldLayout.translateY-(this.w.layout.translateY||0);return{x:i.minX+s,y:i.minY+a,width:i.maxX-i.minX,height:i.maxY-i.minY}}_pathBBox(t){const e=gt(t);let i=1/0,s=1/0,a=-1/0,r=-1/0,n=!1;return e.forEach(t=>{const e=t[0];if("Z"===e)return;let o=[];if("H"===e)o=[[t[1],(s+r)/2||t[1]]];else if("V"===e)o=[[(i+a)/2||t[1],t[1]]];else if("A"===e)o=[[t[6],t[7]]];else for(let e=1;e+1<t.length;e+=2)o.push([t[e],t[e+1]]);o.forEach(([t,e])=>{isFinite(t)&&isFinite(e)&&(n=!0,t<i&&(i=t),t>a&&(a=t),e<s&&(s=e),e>r&&(r=e))})}),n?{minX:i,minY:s,maxX:a,maxY:r}:null}getInitialFillFor(t,e){if(!this._snapshot)return null;const i=this._snapshot.mapping.get(`${t}:${e}`);return i?i.fill:null}getSpeed(){const t=this.w.config.chart.animations;return t.chartTypeMorph&&t.chartTypeMorph.speed||t.speed||600}applyChromeFade(){var t;if(!this._snapshot||!Wt.isBrowser())return;const e=null==(t=this.w.globals.dom)?void 0:t.baseEl;if(!e)return;this._snapshot.pieceOut?this._separatePieces():this._snapshot.pieceIn?this._combinePieces():this._mountGhost();const i=this.getSpeed();[".apexcharts-xaxis",".apexcharts-yaxis",".apexcharts-grid",".apexcharts-gridlines-horizontal",".apexcharts-gridlines-vertical",".apexcharts-legend",".apexcharts-title-text",".apexcharts-subtitle-text"].forEach(t=>{e.querySelectorAll(t).forEach(t=>{t.style&&(t.style.opacity="0",t.style.transition=`opacity ${i}ms ease-out`,ct.requestAnimationFrame(()=>{t.style.opacity="1"}),setTimeout(()=>{t.style.transition="",t.style.opacity=""},i+80))})}),setTimeout(()=>this.cleanup(),i+100)}cleanup(){this._snapshot=null,this._removeGhost(),this._cancelPieces()}}});const Ce="http://www.w3.org/1999/xhtml";function ke(t,e){const i=t.config.drilldown&&t.config.drilldown.breadcrumb||{};return o(o({show:!0,position:"top-left",separator:" / ",rootLabel:"All",offsetX:0,offsetY:0,formatter:void 0},i),e||{})}function Me(t,e){const i=[".apexcharts-title-text",".apexcharts-subtitle-text"].map(e=>t.dom.baseEl.querySelector(e)).filter(t=>null!==t);if(!i.length)return;const s=t.dom.elWrap.getBoundingClientRect().top;for(let t=0;t<i.length+1;t++){const t=e.getBoundingClientRect(),a=i.find(e=>{const i=e.getBoundingClientRect();return t.left<i.right&&t.right>i.left&&t.top<i.bottom&&t.bottom>i.top});if(!a)break;e.style.top=a.getBoundingClientRect().bottom-s+4+"px"}}function Pe(t,e,i,s){var a;const r=null==(a=null==e?void 0:e.dimensions)?void 0:a.dimHelpers,n=r?r.getTitleSubtitleCoords("title").height+r.getTitleSubtitleCoords("subtitle").height:0,o=i.getBoundingClientRect().height||18,l=s&&s.offsetY||0,h=function(t,e){const i=t.layout.translateY||0,s=t.dom.elWrap;if(!s)return i;const a=t.dom.baseEl.querySelectorAll(".apexcharts-yaxis-label");if(!a.length)return i;const r=s.getBoundingClientRect().top,n=e.getBoundingClientRect();let o=i;for(let t=0;t<a.length;t++){const e=a[t].getBoundingClientRect();e.height&&(e.left>=n.right||e.right<=n.left||(o=Math.min(o,e.top-r)))}return o}(t,i);if(h-n>=o+1)return i.style.top=`${h-o-1+l}px`,!0;i.style.top=`${n+l}px`;const c="dark"===t.config.theme.mode;return i.style.background=c?"rgba(20,24,30,0.82)":"rgba(255,255,255,0.86)",i.style.borderRadius="4px",!1}function Le(t){const e=t.dom.elWrap;if(!e)return;const i=e.querySelector(".apexcharts-breadcrumb");i&&i.parentNode&&i.parentNode.removeChild(i)}const Ie="http://www.w3.org/1999/xhtml";class Ee{constructor(t,e,i){this.w=t,this.ctx=e,this.drilldown=i}render(t){if(!Wt.isBrowser())return;const e=this.w,i=e.dom.elWrap;if(!i)return;const s=i.querySelector(".apexcharts-breadcrumb");s&&s.parentNode&&s.parentNode.removeChild(s);const a=e.config.drilldown&&e.config.drilldown.breadcrumb;if(!a||!1===a.show)return;if(0===this.drilldown.depth)return;const r=ct.createElementNS(Ie,"nav");r.setAttribute("class","apexcharts-breadcrumb"),r.setAttribute("aria-label","Drilldown breadcrumb"),this._position(r,a);const n=null!=a.separator?a.separator:" / ";t.forEach((e,i)=>{if(i>0){const t=ct.createElementNS(Ie,"span");t.setAttribute("class","apexcharts-breadcrumb-separator"),t.setAttribute("aria-hidden","true"),t.textContent=n,r.appendChild(t)}const s=this._label(e,i);if(i===t.length-1){const t=ct.createElementNS(Ie,"span");t.setAttribute("class","apexcharts-breadcrumb-item apexcharts-breadcrumb-current"),t.setAttribute("aria-current","page"),t.textContent=s,r.appendChild(t)}else{const t=ct.createElementNS(Ie,"button");if(t.setAttribute("type","button"),t.setAttribute("class","apexcharts-breadcrumb-item"),0===i){const e=ct.createElementNS(Ie,"span");e.setAttribute("class","apexcharts-breadcrumb-arrow"),e.setAttribute("aria-hidden","true"),e.textContent="\u2190",t.appendChild(e)}const e=ct.createElementNS(Ie,"span");e.setAttribute("class","apexcharts-breadcrumb-label"),e.textContent=s,t.appendChild(e),t.addEventListener("click",()=>this.drilldown.drillToLevel(i)),r.appendChild(t)}}),i.appendChild(r),this.w.globals.axisCharts&&Pe(this.w,this.ctx,r,a),this._avoidChromeOverlap(r)}_avoidChromeOverlap(t){const e=this.w,i=[".apexcharts-title-text",".apexcharts-subtitle-text"].map(t=>e.dom.baseEl.querySelector(t)).filter(t=>null!==t);if(!i.length)return;const s=e.dom.elWrap.getBoundingClientRect().top;for(let e=0;e<i.length+1;e++){const e=t.getBoundingClientRect(),a=i.find(t=>{const i=t.getBoundingClientRect();return e.left<i.right&&e.right>i.left&&e.top<i.bottom&&e.bottom>i.top});if(!a)break;t.style.top=a.getBoundingClientRect().bottom-s+4+"px"}}_label(t,e){const i=this.w.config.drilldown.breadcrumb;let s;if(0===e)s=null!=i.rootLabel?i.rootLabel:"All";else{const e=(this.w.config.drilldown.series||[]).find(e=>e&&e.id===t);s=e&&e.name||String(t)}return"function"==typeof i.formatter?i.formatter(s,{index:e,depth:this.drilldown.depth}):s}_position(t,e){const i=e.offsetX||0,s=e.offsetY||0;t.style.position="absolute",t.style.top=s+"px","top-right"===e.position?t.style.right=3-i+"px":t.style.left=i+"px"}}const Re="http://www.w3.org/1999/xhtml",De="apexcharts-drilldown-loading";class Fe{constructor(t){this.w=t,this.el=null}_cfg(){const t=this.w.config.drilldown,e=t&&t.loading;return!1===e?{show:!1}:e||{}}show(){if(!Wt.isBrowser())return;const t=this._cfg();if(!1===t.show)return;const e=this.w.dom.elWrap;if(!e)return;this.hide();const i=ct.createElementNS(Re,"div");i.setAttribute("class",De),i.setAttribute("role","status"),i.setAttribute("aria-live","polite"),i.setAttribute("aria-label",t.text||"Loading");const s=ct.createElementNS(Re,"div");if(s.setAttribute("class",`${De}-spinner`),s.setAttribute("aria-hidden","true"),i.appendChild(s),t.text){const e=ct.createElementNS(Re,"span");e.setAttribute("class",`${De}-text`),e.textContent=t.text,i.appendChild(e)}e.appendChild(i),this.el=i}hide(){const t=this.w.dom.elWrap;if(t){const e=t.querySelectorAll(`.${De}`);for(let t=0;t<e.length;t++){const i=e[t];i.parentNode&&i.parentNode.removeChild(i)}}else this.el&&this.el.parentNode&&this.el.parentNode.removeChild(this.el);this.el=null}}const Xe="__apexDrilldownMarker";c.default.registerFeatures({drilldown:class{constructor(t,e){this.w=t,this.ctx=e,this.stack=[],this.rootSnapshot=null,this._wired=!1,this._asyncCache=new Map,this._pending=null,this._warnedUnreachable=!1,this._warnedNoSliceOffset=!1,this.breadcrumb=new Ee(t,e,this),this.loading=new Fe(t),this._onPointSelect=this._onPointSelect.bind(this),this._afterRender=this._afterRender.bind(this),this._onPlotDown=this._onPlotDown.bind(this),this._onPlotClick=this._onPlotClick.bind(this),this._downAt=null,this._plotClickWired=null,this.init()}init(){const t=this.w;t.config.drilldown&&t.config.drilldown.enabled&&(this._wired||(this._wired=!0,this.ctx.addEventListener("dataPointSelection",this._onPointSelect),this.ctx.addEventListener("mounted",this._afterRender),this.ctx.addEventListener("updated",this._afterRender),t.config.markers&&(t.config.markers.discrete=this._drillMarkers(t.config.series))))}get path(){return["root",...this.stack.map(t=>t.id)]}get depth(){return this.stack.length}drillDown(t,e,i){const s=this._resolveChild(t);return s?this._drillInto(s,e,i):"function"==typeof this.w.config.drilldown.onDrillDown?this._drillDownAsync(t,e,i):Promise.resolve(this.ctx)}drillUp(){return this.drillToLevel(this.stack.length-1)}drillToRoot(){return this.drillToLevel(0)}drillToLevel(t){const e=this.stack.length;if(t<0||t>=e)return Promise.resolve(this.ctx);const i=this.path[this.path.length-1],s=0===t?this.rootSnapshot:this.stack[t].restore;this.stack=this.stack.slice(0,t);const a=this.path[this.path.length-1];return this._apply(this._viewFromSnapshot(s),"up",{from:i,to:a})}_resolveChild(t){const e=this.w.config.drilldown&&this.w.config.drilldown.series;return Array.isArray(e)&&e.find(e=>e&&e.id===t)||null}_drillInto(t,e,i){if(this.stack.length>=32)return Promise.resolve(this.ctx);this.rootSnapshot||(this.rootSnapshot=this._snapshot());const s=this.path[this.path.length-1];return this.stack.push({id:t.id,name:t.name,restore:this._snapshot()}),this._apply(this._viewFromChild(t),"down",{from:s,to:t.id,point:e,seriesIndex:i&&i.seriesIndex,dataPointIndex:i&&i.dataPointIndex})}_drillDownAsync(t,e,i){const s=this.w.config.drilldown.onDrillDown,a=this._cacheGet(t);if(a)return this._drillInto(a,e,i);if(this._pending)return this._pending;let r;this.loading.show();try{r=s({id:t,point:e,seriesIndex:i&&i.seriesIndex,dataPointIndex:i&&i.dataPointIndex})}catch(e){return this.loading.hide(),this._fire("drillDownError",{id:t,error:e}),Promise.resolve(this.ctx)}const n=()=>{this._pending=null,this.loading.hide()},h=Promise.resolve(r).then(s=>{if(n(),this._isDead())return this.ctx;if(!s||!s.data)return this._fire("drillDownError",{id:t,error:new Error(`drilldown: onDrillDown resolved without a drillable level for id "${t}" (expected an object with a \`data\` array).`)}),this.ctx;const a=null!=s.id?s:l(o({},s),{id:t});return this._cacheSet(t,a),this._drillInto(a,e,i)},e=>(n(),this._isDead()||this._fire("drillDownError",{id:t,error:e}),this.ctx));return this._pending=h,h}_isDead(){const t=this.w;return!t||!t.globals||!0===t.globals.isDestroyed}_cacheEnabled(){const t=this.w.config.drilldown;return!(!t||!1===t.cache)}_cacheGet(t){return this._cacheEnabled()&&null!=t&&this._asyncCache.get(t)||null}_cacheSet(t,e){this._cacheEnabled()&&null!=t&&this._asyncCache.set(t,e)}clearCache(t){return null==t?this._asyncCache.clear():this._asyncCache.delete(t),this.ctx}_snapshot(){const t=this.w.config,e=this._overrideFields(),i={series:this._uncollapseSeries(Ht.clone(t.series))};return Array.isArray(t.labels)&&t.labels.length&&(i.labels=Ht.clone(t.labels)),i.chart={type:t.chart.type,stacked:t.chart.stacked},e.has("xaxis")&&(i.xaxis=Ht.clone(t.xaxis)),e.has("yaxis")&&(i.yaxis=Ht.clone(t.yaxis)),e.has("colors")&&(i.colors=t.colors?Ht.clone(t.colors):void 0),e.has("plotOptions")&&(i.plotOptions=Ht.clone(t.plotOptions)),e.has("fill")&&(i.fill=Ht.clone(t.fill)),e.has("legend")&&(i.legend=Ht.clone(t.legend)),i}_uncollapseSeries(t){const e=this.w,i=e.globals,s=[...i.collapsedSeries||[],...i.ancillaryCollapsedSeries||[]];if(!s.length)return t;const a=e.config.chart.type,r=("pie"===a||"donut"===a||"polarArea"===a)&&1===t.length&&t[0]&&"object"==typeof t[0]&&Array.isArray(t[0].data)?t[0].data:t;for(const e of s){const s=e.index;i.axisCharts?t[s]&&(t[s].data=Array.isArray(e.data)?e.data.slice():e.data):r[s]&&"object"==typeof r[s]?r[s].y=e.data:void 0!==r[s]&&(r[s]=e.data)}return t}_overrideFields(){const t=new Set,e=this.w.config.drilldown&&this.w.config.drilldown.series||[];for(const i of e)i&&(i.xaxis&&t.add("xaxis"),i.yaxis&&t.add("yaxis"),i.colors&&t.add("colors"),i.plotOptions&&t.add("plotOptions"),i.fill&&t.add("fill"),i.legend&&t.add("legend"));return t}_copyOptionalViewFields(t,e){e.xaxis&&(t.xaxis=e.xaxis),e.yaxis&&(t.yaxis=e.yaxis),e.colors&&(t.colors=e.colors),e.plotOptions&&(t.plotOptions=e.plotOptions),e.fill&&(t.fill=e.fill),e.legend&&(t.legend=e.legend)}_viewFromChild(t){const e={};Array.isArray(t.series)?e.series=t.series:e.series=[{name:t.name||"",data:t.data}];const i={};return t.chart&&t.chart.type&&(i.type=t.chart.type),t.chart&&null!=t.chart.stacked&&(i.stacked=t.chart.stacked),Object.keys(i).length&&(e.chart=i),this._copyOptionalViewFields(e,t),e}_viewFromSnapshot(t){const e={series:t.series,chart:t.chart};return t.labels&&t.labels.length&&(e.labels=t.labels),this._copyOptionalViewFields(e,t),e}_apply(t,e,i){const s=this.w;s.interact.selectedDataPoints=[],s.globals.collapsedSeries=[],s.globals.collapsedSeriesIndices=[],s.globals.ancillaryCollapsedSeries=[],s.globals.ancillaryCollapsedSeriesIndices=[],s.globals.allSeriesCollapsed=!1,s.globals.risingSeries=[],t.markers=l(o({},t.markers||{}),{discrete:this._drillMarkers(t.series)});const a=(!s.config.drilldown.animation||!1!==s.config.drilldown.animation.enabled)&&!1!==s.config.chart.animations.enabled;"down"===e&&this._fire("drillDownStart",i);const r=e=>this.ctx.updateOptions(t,!1,e,!1,!1),n=()=>(this._fire("down"===e?"drillDownEnd":"drillUp",i),this.ctx);if(a&&this._zoomEnabled()){const t=this._triggerOrigin(i);if(t)return this._zoomDrill(t,e,()=>r(!1)).then(n)}return r(a).then(n)}_zoomEnabled(){const t=this.w.config.drilldown&&this.w.config.drilldown.animation;return!(!t||!t.zoomFromPoint)}_svgNode(){const t=this.w.dom&&this.w.dom.Paper;return t&&t.node?t.node:null}_markGroup(){const t=this._svgNode();return t&&"function"==typeof t.querySelector?t.querySelector(".apexcharts-plot-series, .apexcharts-heatmap, .apexcharts-treemap"):null}_triggerOrigin(t){if(!Wt.isBrowser())return null;const e=this._svgNode(),i=this._markGroup();if(!e||!i||"function"!=typeof i.animate||"function"!=typeof e.getBoundingClientRect)return null;const s=e.getBoundingClientRect();let a=null;if(t&&null!=t.seriesIndex&&null!=t.dataPointIndex&&this.w.dom.baseEl&&(a=this.w.dom.baseEl.querySelector(`[index="${t.seriesIndex}"][j="${t.dataPointIndex}"]`)),a&&"function"==typeof a.getBoundingClientRect){const t=a.getBoundingClientRect();return{x:t.left+t.width/2-s.left,y:t.top+t.height/2-s.top}}const r=i.getBoundingClientRect();return{x:r.left+r.width/2-s.left,y:r.top+r.height/2-s.top}}_zoomDrill(t,e,i){return s=this,a=null,r=function*(){const s=this._zoomDuration(),a="down"===e,r=Math.round(.55*s),n=a?"scale(1.03)":"scale(0.97)",o=a?"scaleX(0.55) scaleY(0.85)":"scale(1.04)",l=e=>{e.style.transformBox="view-box",e.style.transformOrigin=`${t.x}px ${t.y}px`},h=this._markGroup();let c=null;if(h){l(h),c=h.animate([{transform:"scale(1)",opacity:1},{transform:n,opacity:0}],{duration:r,easing:"ease-in",fill:"forwards"});try{yield c.finished}catch(t){}}yield i();const d=this._markGroup();if(d){l(d),d.style.opacity="0",d.style.transform=o,c&&h===d&&c.cancel();const t=d.animate([{transform:o,opacity:0},{transform:"scale(1)",opacity:1}],{duration:s,easing:"cubic-bezier(0.16, 1, 0.3, 1)",fill:"forwards"});try{yield t.finished}catch(t){}(u=d).style.transform="",u.style.opacity="",u.style.transformOrigin="",u.style.transformBox="",t.cancel()}var u},new Promise((t,e)=>{var i=t=>{try{o(r.next(t))}catch(t){e(t)}},n=t=>{try{o(r.throw(t))}catch(t){e(t)}},o=e=>e.done?t(e.value):Promise.resolve(e.value).then(i,n);o((r=r.apply(s,a)).next())});var s,a,r}_zoomDuration(){const t=this.w.config.drilldown&&this.w.config.drilldown.animation,e=t&&"number"==typeof t.speed?t.speed:260;return Math.max(80,e)}_fire(t,e){const i=this.w.config.chart.events&&this.w.config.chart.events[t];"function"==typeof i&&i(e,this.ctx,this.w),this.ctx.events.fireEvent(t,[e,this.ctx,this.w])}_onPointSelect(t,e,i){if(!i)return;const s=this._pointAt(i.seriesIndex,i.dataPointIndex);return s&&"object"==typeof s&&null!=s.drilldown?this.drillDown(s.drilldown,s,i):"function"==typeof this.w.config.drilldown.onDrillDown?this._drillDownAsync(null,s,i):void 0}_pointAt(t,e){const i=this.w.config.series;if(!Array.isArray(i)||null==t||null==e)return null;const s=i[t];return s&&Array.isArray(s.data)&&null!=s.data[e]?s.data[e]:null}_afterRender(){const t=this.w;t.config.drilldown&&t.config.drilldown.enabled&&(this._markDrillableTargets(),this._wirePlotClick(),this.breadcrumb.render(this.path),t.config.markers&&(t.config.markers.discrete=this._drillMarkers(t.config.series)))}_markDrillableTargets(){if(!Wt.isBrowser())return;const t=this.w,e=t.dom.baseEl,i=t.config.series;if(!e||!Array.isArray(i))return;let s=0;i.forEach((t,i)=>{const a=t&&Array.isArray(t.data)?t.data:null;a&&a.forEach((t,a)=>{if(!t||"object"!=typeof t||null==t.drilldown)return;const r=e.querySelectorAll(`[index="${i}"][j="${a}"]`);r.length||s++,r.forEach(t=>{this._isClickThroughMark(t)&&t.classList.remove("no-pointer-events"),t.classList.add("apexcharts-drilldown-target")})})}),s&&!this._warnedUnreachable&&(this._warnedUnreachable=!0)}warnSliceOffsetDisabled(){this._warnedNoSliceOffset||(this._warnedNoSliceOffset=!0)}_wirePlotClick(){if(!Wt.isBrowser())return;const t=this.w.dom.baseEl;t&&this._plotClickWired!==t&&(this._plotClickWired&&(this._plotClickWired.removeEventListener("mousedown",this._onPlotDown),this._plotClickWired.removeEventListener("click",this._onPlotClick)),t.addEventListener("mousedown",this._onPlotDown),t.addEventListener("click",this._onPlotClick),this._plotClickWired=t)}_onPlotDown(t){this._downAt={x:t.clientX,y:t.clientY}}_onPlotClick(t){const e=this.w;if(!e.config.drilldown||!e.config.drilldown.enabled)return;const i=this._downAt;if(this._downAt=null,i&&Math.hypot(t.clientX-i.x,t.clientY-i.y)>4)return;const s=t.target;if(!s||"function"!=typeof s.closest)return;if(s.closest(".apexcharts-drilldown-target"))return;if(s.closest(".apexcharts-legend, .apexcharts-toolbar, .apexcharts-breadcrumb, .apexcharts-menu, .apexcharts-tooltip"))return;const a=e.interact.capturedSeriesIndex,r=e.interact.capturedDataPointIndex;if(null==a||null==r||a<0||r<0)return;if(!this._isPointBasedSeries(e.config.series[a]))return;const n=this._pointAt(a,r);return n&&"object"==typeof n&&null!=n.drilldown?this.drillDown(n.drilldown,n,{seriesIndex:a,dataPointIndex:r}):void 0}_isClickThroughMark(t){return!(!t.classList||!t.classList.contains("no-pointer-events"))&&(!!t.classList.contains("apexcharts-marker")&&!("function"==typeof t.closest&&t.closest(".apexcharts-tooltip")))}_drillMarkers(t){const e=this.w,i=e.config.drilldown,s=Array.isArray(e.config.markers&&e.config.markers.discrete)?e.config.markers.discrete.filter(t=>!t||!t[Xe]):[],a=i&&i.marker||{};if(!1===a.show||!Array.isArray(t))return s;const r=[];return t.forEach((t,e)=>{if(!this._seriesNeedsDrillMarker(e,t))return;const i=t&&Array.isArray(t.data)?t.data:null;i&&i.forEach((t,i)=>{if(!t||"object"!=typeof t||null==t.drilldown)return;const s={seriesIndex:e,dataPointIndex:i,[Xe]:!0};void 0!==a.size&&(s.size=a.size),void 0!==a.shape&&(s.shape=a.shape),void 0!==a.fillColor&&(s.fillColor=a.fillColor),void 0!==a.strokeColor&&(s.strokeColor=a.strokeColor),r.push(s)})}),s.concat(r)}_seriesNeedsDrillMarker(t,e){if(!this._isPointBasedSeries(e))return!1;const i=this.w.config.markers&&this.w.config.markers.size,s=Array.isArray(i)?i[t]:i;return!(Number(s)>0)}_isPointBasedSeries(t){const e=t&&t.type||this.w.config.chart.type;return"line"===e||"area"===e}}});const Te="__apexcharts_plugins__";function ze(t){return function(){const t=globalThis;return t[Te]||(t[Te]={}),t[Te]}()[t]||null}const Ye=["updateOptions","updateSeries","appendData","appendSeries","toggleSeries","showSeries","hideSeries","highlightSeries","isSeriesHidden","zoomX","addXaxisAnnotation","addYaxisAnnotation","addPointAnnotation","clearAnnotations","removeAnnotation","dataURI","exportToCSV"];function We(t){const e={};return Ye.forEach(i=>{"function"==typeof t[i]&&(e[i]=t[i].bind(t))}),Object.freeze(e)}function Oe(t,e){const i=t&&t.renderer;return i&&i.kind&&"svg"!==i.kind?i:e}c.default.registerFeatures({weave:class{constructor(t,e){this.w=t,this.ctx=e,this.active=[],this._layers=new Map,this._currentScales=null,this._lastPluginsRef=null,this._lastData=null,this._updatedWired=!1,this._onUpdated=this._onUpdated.bind(this),this._init()}_init(){(this.w.config.plugins||[]).map((t,e)=>({entry:t,order:null!=t.order?t.order:e})).sort((t,e)=>t.order-e.order).forEach(t=>this._activate(t.entry)),this._lastPluginsRef=this.w.config.plugins,this._wireUpdated()}_wireUpdated(){this._updatedWired||(this.ctx.addEventListener("updated",this._onUpdated),this._updatedWired=!0)}_onUpdated(){this.dispatch("afterUpdate",{pass:"update"})}_activate(t){const e=ze(t.name);if(!e)return;const i=null!=e.apiVersion?e.apiVersion:1;if(1!==Math.trunc(i))return;const s={def:e,options:Object.freeze(o({},t.options||{})),handlers:new Map,disabled:!1,failures:0,api:null};s.api=function(t,e){const i=t.ctx,s=t.w,a={name:e.def.name,version:1,get options(){return e.options},on(t,i){const s=e.handlers;return s.has(t)||s.set(t,[]),s.get(t).push(i),a},off(t,i){const s=e.handlers.get(t);if(s){const t=s.indexOf(i);t>-1&&s.splice(t,1)}return a},store:{},layer:i=>t._layer(e.def.name,i||{}),get scales(){return t._currentScales},get data(){return t._lastData||(t._lastData=t._dataSnapshot())},theme:Object.freeze({get mode(){return s.config.theme.mode},get foreColor(){return s.config.chart.foreColor},seriesColor:t=>s.globals.colors[t],token:e=>t._token(e)}),chart:We(i),emit(t,s){i.events.fireEvent(`plugin:${e.def.name}:${t}`,[i,s])},get el(){return s.dom.baseEl}};return Object.freeze(a)}(this,s),this.active.push(s),this._guard(s,"setup",()=>e.setup(s.api))}dispatch(t,e){if("draw"===t&&(this._reconcile(),this._resetLayers()),this._lastData=null,!this.active.length)return;"afterParse"===t?this._currentScales=null:e&&"xyRatios"in e&&this._setScales(e.xyRatios);const i=e&&e.pass||"full";let s=null;for(const e of this.active){if(e.disabled)continue;const a=e.handlers.get(t);if(!a||!a.length)continue;null===s&&(s=this._dataSnapshot(),this._lastData=s);const r={api:e.api,scales:this._currentScales,data:s,pass:i,hook:t};for(const i of a.slice())this._guard(e,t,()=>i(r))}}_guard(t,e,i){if(!t.disabled)try{i()}catch(e){t.failures=(t.failures||0)+1,t.failures>=3&&(t.disabled=!0)}}_setScales(t){const e=this.w,i=e.globals,s=e.layout;if(!t||!i.axisCharts)return void(this._currentScales=null);const a=t.xRatio,r=t.yRatio||[],n=t=>null!=i.maxYArr[t]?i.maxYArr[t]:i.maxY,o=t=>null!=i.minYArr[t]?i.minYArr[t]:i.minY;this._currentScales={x:t=>s.translateX+(t-i.minX)/a,y:(t,e=0)=>s.translateY+(n(e)-t)/(t=>null!=r[t]?r[t]:r[0])(e),domainX:[i.minX,i.maxX],domainY:(t=0)=>[o(t),n(t)],gridWidth:s.gridWidth,gridHeight:s.gridHeight,ratios:t}}_dataSnapshot(){const t=this.w,e=t.globals,i=t.seriesData.series||[],s=t.seriesData.seriesX||[];return i.map((t,i)=>{const a=s[i]||[],r=(t||[]).map((t,e)=>({x:null!=a[e]?a[e]:e,y:t}));return{name:e.seriesNames?e.seriesNames[i]:void 0,hidden:(e.collapsedSeriesIndices||[]).includes(i),color:e.colors?e.colors[i]:void 0,points:r}})}_token(t){const e=this.w,i=e.globals;switch(t){case"foreColor":return e.config.chart.foreColor;case"background":return e.config.chart.background;case"accent":case"primary":return i.colors?i.colors[0]:void 0;default:return/^series-\d+$/.test(t)&&i.colors?i.colors[Number(t.split("-")[1])]:void 0}}_layer(t,{z:e="front",className:i=""}={}){let s=this._layers.get(t);if(!s){s=this.ctx.graphics.group({class:`apexcharts-plugin-${t} ${i}`.trim()});const a=this.w.dom.elGraphical.node;"behind"===e?a.insertBefore(s.node,a.firstChild):a.appendChild(s.node),s.node.setAttribute("aria-hidden","true"),this._layers.set(t,s)}return function(t,e){const i=e=>(e&&t.add(e),e),s={get node(){return t.node},path(t={}){const{d:s="",stroke:a="#000",width:r=1,fill:n="none",opacity:o=1,dash:l=0,className:h=""}=t;return i(e.drawPath({d:s,stroke:a,strokeWidth:r,fill:n,fillOpacity:"none"===n?0:o,strokeOpacity:o,strokeDashArray:l,classes:h}))},line(t={}){const{x1:s,y1:a,x2:r,y2:n,stroke:o="#000",width:l=1,dash:h=0}=t;return i(e.drawLine(s,a,r,n,o,h,l))},rect(t={}){const{x:s=0,y:a=0,w:r=0,h:n=0,r:o=0,fill:l="#000",stroke:h=null,opacity:c=1}=t;return i(e.drawRect(s,a,r,n,o,l,c,null!=h?1:null,h))},circle(t={}){const{cx:s=0,cy:a=0,r:r=0,fill:n="#000",stroke:o=null}=t;return i(e.drawCircle(r,{cx:s,cy:a,fill:n,stroke:o||"none"}))},text(t={}){const{x:s=0,y:a=0,text:r="",color:n,size:o,anchor:l="start",weight:h}=t;return i(e.drawText({x:s,y:a,text:r,textAnchor:l,fontSize:o,foreColor:n,fontWeight:h}))},clear(){const e=t.node;for(;e.firstChild;)e.removeChild(e.firstChild);return s}};return s}(s,this.ctx.graphics)}_resetLayers(){const t=this.w.dom.elGraphical,e=t&&t.node;if(e){const t=e.querySelectorAll('g[class*="apexcharts-plugin-"]');Array.prototype.forEach.call(t,t=>t.remove())}this._layers.clear()}_reconcile(){const t=this.w.config.plugins||[];if(t===this._lastPluginsRef)return;this._lastPluginsRef=t;const e=new Map(t.map((t,e)=>[t.name,{entry:t,order:null!=t.order?t.order:e}]));for(let t=this.active.length-1;t>=0;t--){const i=this.active[t],s=e.get(i.def.name);s?i.options=Object.freeze(o({},s.entry.options||{})):(this._guard(i,"destroy",()=>i.def.destroy&&i.def.destroy(i.api)),this.active.splice(t,1))}const i=new Set(this.active.map(t=>t.def.name)),s=[];e.forEach((t,e)=>{i.has(e)||s.push(t)}),s.sort((t,e)=>t.order-e.order).forEach(t=>this._activate(t.entry))}teardown(t){if(!t){this.dispatch("destroy");for(const t of this.active)this._guard(t,"destroy",()=>t.def.destroy&&t.def.destroy(t.api));this.active=[],this._updatedWired&&(this.ctx.removeEventListener&&this.ctx.removeEventListener("updated",this._onUpdated),this._updatedWired=!1)}this._layers.clear()}}}),c.default._customSeriesFactory=function(t,e){const i=class{constructor(t,e,i){this.w=t,this.ctx=e,this.xyRatios=i,this._warned=!1}draw(t,i,s){var a,r;const n=this.w,o=new I(n,this.ctx),l=Oe(this.ctx,o),h=o.group({class:"apexcharts-marks-series"});return t.forEach((t,i)=>{var a;const r=Array.isArray(s)?s[i]:i,c=o.group({class:"apexcharts-series",rel:r+1,seriesName:Ht.escapeString(n.seriesData.seriesNames[r]),"data:realIndex":r}),d=this._scales(r,(n.seriesData.series[r]||[]).length),u=n.globals.colors[r],p=(null==(a=n.config.series[r])?void 0:a.data)||[],g=n.seriesData.seriesX[r]||[],f=n.seriesData.series[r]||[];n.globals.seriesXvalues[r]=[],n.globals.seriesYvalues[r]=[],void 0===n.globals.pointsArray[r]&&(n.globals.pointsArray[r]=[]);for(let t=0;t<f.length;t++){const i=f[t];if(null==i)continue;const s=g[t],a=d.xAt(t,s),o=d.y(i),h=this._api(l,c,r,t);try{e.renderItem({datum:p[t],x:a,y:o,scales:d,api:h,seriesIndex:r,dataPointIndex:t,color:u})}catch(t){this._warned||(this._warned=!0)}n.globals.seriesXvalues[r][t]=a,n.globals.seriesYvalues[r][t]=o,n.globals.pointsArray[r][t]=[a,o]}o.setupEventDelegation(c,".apexcharts-marks-mark"),h.add(c)}),null==(r=null==(a=this.ctx.animations)?void 0:a.animationCompleted)||r.call(a,h),h}_scales(t,e){var i,s,a,r;const n=this.w.globals,o=this.w.config,l=this.xyRatios.xRatio,h=this.xyRatios.yRatio,c=null!=(s=null==(i=n.seriesYAxisReverseMap)?void 0:i[t])?s:0,d=Array.isArray(h)?null!=(a=h[c])?a:h[0]:h,u=n.maxYArr,p=Array.isArray(u)&&u.length&&null!=(r=u[c])?r:n.maxY,g=n.gridWidth,f=n.gridHeight,m=!n.isXNumeric,x=e||n.dataPoints||1,b=x>0?g/x:g,y="on"===o.xaxis.tickPlacement,w=t=>l?(t-n.minX)/l:g/2,v=n.minXDiff||1;return{x:w,xAt:(t,e)=>m?y&&x>1?t/(x-1)*g:(t+.5)*b:w(e),y:t=>(p-t)/d,gridWidth:g,gridHeight:f,band:m?b:l?v/l:g}}_api(t,e,i,s){const a=t=>{if(t){try{t.node.setAttribute("index",String(i)),t.node.setAttribute("j",String(s)),t.node.classList.add("apexcharts-marks-mark")}catch(t){}e.add(t)}return t};return{path:(e={})=>{var i,s,r,n,o,l,h,c,d;return a(t.drawPath({d:e.d||"",stroke:null!=(i=e.stroke)?i:"#000",strokeWidth:null!=(r=null!=(s=e.width)?s:e.strokeWidth)?r:1,fill:null!=(n=e.fill)?n:"none",fillOpacity:null!=(l=e.fillOpacity)?l:e.fill&&"none"!==e.fill?null!=(o=e.opacity)?o:1:0,strokeOpacity:null!=(c=null!=(h=e.strokeOpacity)?h:e.opacity)?c:1,strokeDashArray:null!=(d=e.dash)?d:0,strokeLinecap:e.lineCap}))},line:(e={})=>{var i,s,r,n;return a(t.drawLine(e.x1,e.y1,e.x2,e.y2,null!=(i=e.stroke)?i:"#000",null!=(s=e.dash)?s:0,null!=(n=null!=(r=e.width)?r:e.strokeWidth)?n:1))},rect:(e={})=>{var i,s,r,n,o,l,h,c;return a(t.drawRect(null!=(i=e.x)?i:0,null!=(s=e.y)?s:0,null!=(r=e.w)?r:0,null!=(n=e.h)?n:0,null!=(o=e.r)?o:0,null!=(l=e.fill)?l:"#000",null!=(h=e.opacity)?h:1,null!=e.stroke?null!=(c=e.strokeWidth)?c:1:null,e.stroke))},circle:(e={})=>{var i,s,r,n,o;return a(t.drawCircle(null!=(i=e.r)?i:0,{cx:null!=(s=e.cx)?s:0,cy:null!=(r=e.cy)?r:0,fill:null!=(n=e.fill)?n:"#000",stroke:e.stroke||"none","stroke-width":null!=(o=e.strokeWidth)?o:e.stroke?1:0}))},text:(e={})=>{var i,s,r,n;return a(t.drawText({x:null!=(i=e.x)?i:0,y:null!=(s=e.y)?s:0,text:null!=(r=e.text)?r:"",textAnchor:null!=(n=e.anchor)?n:"start",fontSize:e.size,foreColor:e.color,fontWeight:e.weight}))}}}};return i.dataType=e.dataType||"xy",i.yExtent="function"==typeof e.yExtent?e.yExtent:null,i};class Be{constructor(t,e){if(this.w=t,this.ctx=e,"os"!==t.config.theme.follow||!Wt.isBrowser())return;const i=this._ensureMedia();i&&(this._applyToConfig(i),this._ensureListeners(i))}_ensureMedia(){if(!this.ctx._osThemeMedia){const t=ct.matchMedia("(prefers-color-scheme: dark)"),e=ct.matchMedia("(prefers-contrast: more)");if(!t&&!e)return null;this.ctx._osThemeMedia={dark:t,contrast:e,handler:null}}return this.ctx._osThemeMedia}_applyToConfig(t){const e=this.w.config.theme;t.dark&&(e.mode=t.dark.matches?"dark":"light"),t.contrast&&t.contrast.matches&&(e.accessibility=e.accessibility||{},e.accessibility.colorBlindMode="highContrast")}_ensureListeners(t){if(t.handler)return;const e=this.ctx,i=()=>{const t=e._osThemeMedia;if(!t)return;const i={mode:t.dark&&t.dark.matches?"dark":"light"};t.contrast&&t.contrast.matches?i.accessibility={colorBlindMode:"highContrast"}:i.accessibility={colorBlindMode:""},e.updateOptions({theme:i},!1,!0,!1)};Be._add(t.dark,i),Be._add(t.contrast,i),t.handler=i}teardown(){const t=this.ctx._osThemeMedia;t&&(t.handler&&(Be._remove(t.dark,t.handler),Be._remove(t.contrast,t.handler)),this.ctx._osThemeMedia=null)}static _add(t,e){t&&("function"==typeof t.addEventListener?t.addEventListener("change",e):"function"==typeof t.addListener&&t.addListener(e))}static _remove(t,e){t&&("function"==typeof t.removeEventListener?t.removeEventListener("change",e):"function"==typeof t.removeListener&&t.removeListener(e))}}c.default.registerFeatures({osThemeWatcher:Be});const $e="__apexcharts_series_transforms__";function Ne(t,e){t&&"string"==typeof t&&"function"==typeof e&&(globalThis[$e][t]=e)}globalThis[$e]||(globalThis[$e]={});const He="__apexcharts_row_sources__";function je(t,e){t&&"string"==typeof t&&"function"==typeof e&&(globalThis[He][t]=e)}globalThis[He]||(globalThis[He]={});function Ve(t,e){const i=t.length;if(0===i)return NaN;if(1===i)return t[0];const s=(i-1)*e,a=Math.floor(s),r=Math.ceil(s);return a===r?t[a]:t[a]+(t[r]-t[a])*(s-a)}function Ge(t){const e=t.length;if(e<2)return 0;let i=0;for(let s=0;s<e;s++)i+=t[s];const s=i/e;let a=0;for(let i=0;i<e;i++){const e=t[i]-s;a+=e*e}return Math.sqrt(a/e)}function qe(t,e={}){if(!Array.isArray(t)||0===t.length)return null;const i=t.slice().sort((t,e)=>t-e);let s=i[0],a=i[i.length-1];const r=e.range;if(Array.isArray(r)&&2===r.length){const t=Number(r[0]),e=Number(r[1]);isFinite(t)&&isFinite(e)&&e>t&&(s=t,a=e)}if(!(a>s)){const t=Math.abs(s)>0?.05*Math.abs(s):.5;return{edges:[s-t,s+t],binWidth:2*t,rule:"single",capped:!1}}const n=a-s;let o,l;if("number"==typeof e.binWidth&&e.binWidth>0)o=e.binWidth,l="binWidth";else if("number"==typeof e.bins&&e.bins>=1)o=n/Math.floor(e.bins),l="count";else{const t=function(t,e,i){const s=t.length,a=t=>e/Math.max(1,Math.ceil(t));switch(i){case"sqrt":return{width:a(Math.sqrt(s)),rule:"sqrt"};case"rice":return{width:a(2*Math.cbrt(s)),rule:"rice"};case"scott":{const e=Ge(t);return e>0?{width:3.49*e*Math.pow(s,-1/3),rule:"scott"}:{width:a(Math.log2(s)+1),rule:"sturges"}}case"fd":{const e=Ve(t,.75)-Ve(t,.25);return e>0?{width:2*e*Math.pow(s,-1/3),rule:"fd"}:{width:a(Math.log2(s)+1),rule:"sturges"}}case"auto":{const e=a(Math.log2(s)+1),i=Ve(t,.75)-Ve(t,.25);if(i<=0)return{width:e,rule:"sturges"};const r=2*i*Math.pow(s,-1/3);return r<e?{width:r,rule:"fd"}:{width:e,rule:"sturges"}}default:return{width:a(Math.log2(s)+1),rule:"sturges"}}}(i,n,"string"==typeof e.bins?e.bins:"auto");o=t.width,l=t.rule}(!isFinite(o)||o<=0)&&(o=n);let h=Math.ceil(n/o);(!isFinite(h)||h<1)&&(h=1);let c=!1;h>1e3&&(h=1e3,o=n/h,c=!0),o=n/h;const d=new Array(h+1);for(let t=0;t<=h;t++)d[t]=s+t*o;return d[h]=Math.max(d[h],a),{edges:d,binWidth:o,rule:l,capped:c}}function Ze(t,e){const i=e.length-1;if(!(t>=e[0])||t>e[i])return-1;if(t===e[i])return i-1;const s=(e[i]-e[0])/i;if(s>0){let a=Math.floor((t-e[0])/s);return a<0&&(a=0),a>i-1&&(a=i-1),t<e[a]?a--:t>=e[a+1]&&a++,a<0||a>i-1?-1:a}let a=0,r=i-1;for(;a<=r;){const i=a+r>>1;if(t<e[i])r=i-1;else{if(!(t>=e[i+1]))return i;a=i+1}}return-1}function Ue(t){const e=[];if(!Array.isArray(t))return e;for(let i=0;i<t.length;i++){const s=t[i];let a=s;Array.isArray(s)?a=1===s.length?s[0]:s[1]:s&&"object"==typeof s&&(a=void 0!==s.y?s.y:s.x);const r=Ht.parseNumber(a);null!==r&&isFinite(r)&&e.push(r)}return e}const Ke=new WeakSet;function Je(t,e){var i;if(!t||"object"!=typeof t||Array.isArray(t))return null;let s=null;if(Array.isArray(t.points)?s=t.points:Array.isArray(null==(i=t.y)?void 0:i.points)?s=t.y.points:e&&Array.isArray(t.y)&&"number"==typeof t.y[0]&&(s=t.y),!s)return null;const a=[];for(let t=0;t<s.length;t++){const e=Ht.parseNumber(s[t]);null!==e&&isFinite(e)&&a.push(e)}return a.length?a:null}function Qe(t,e,i){const s=i&&null!=i.maxRows?i.maxRows:3e3,a=function(t,e){let i=0,s=0;for(const e of t)i+=e.length,e.length>s&&(s=e.length);if(i<=e)return{clusters:t,stride:1,total:i,kept:i};const a=e=>{let i=0;for(const s of t)i+=Math.ceil(s.length/e);return i};let r=Math.max(2,Math.ceil(i/e));for(;r<s&&a(r)>e;)r++;let n=0;return{clusters:t.map(t=>{const e=[];for(let i=0;i<t.length;i+=r)e.push(t[i]);return n+=e.length,e}),stride:r,total:i,kept:n}}(e.map(t=>t.rows),s);a.stride;const r=t.globals&&t.globals.colors||[];return e.map((t,e)=>{const i=r[t.realIndex]||r[0];return{name:t.name,data:a.clusters[e].map((s,a)=>o({id:`${t.realIndex}:${e}:${a}`,x:t.name,y:s},i?{fillColor:i}:{}))}})}function ti(t){if(!isFinite(t))return String(t);const e=Math.round(t);return Math.abs(t-e)<1e-6?String(e):String(Number(t.toFixed(2)))}function ei(t){return(e,i)=>{var s;const a=t(e);if(!Array.isArray(a)||!a.length)return null;const r=e.globals&&e.globals.collapsedSeriesIndices||[],n=e.globals&&((null==(s=e.globals.categoryLabels)?void 0:s.length)?e.globals.categoryLabels:e.globals.labels)||[],o=[];return a.forEach((t,i)=>{var s;if(-1!==r.indexOf(i))return;if(!Array.isArray(t))return;const l=e.seriesData&&(null==(s=e.seriesData.seriesNames)?void 0:s[i]);t.forEach((t,e)=>{const s=null!=n[e]?String(n[e]):`#${e+1}`;o.push({name:a.length>1&&l?`${l} ${s}`:s,realIndex:i,rows:Array.isArray(t)?t.slice():[]})})}),o.length?Qe(e,o,i):null}}const ii=ei(t=>{var e;return null==(e=t.candleData)?void 0:e.seriesBoxPoints}),si=ei(t=>{var e;return null==(e=t.violinData)?void 0:e.seriesViolinPoints});Ne("histogram",function(t,e){var i;const s=e.config,a=e.globals;if(!Array.isArray(t))return t;a.histogramRawSeries||(a.histogramRawSeries=t.map(t=>l(o({},t),{data:Array.isArray(null==t?void 0:t.data)?t.data.slice():null==t?void 0:t.data})));const r=a.histogramRawSeries,n=(null==(i=s.plotOptions)?void 0:i.histogram)||{},h=r.map(t=>Ue(null==t?void 0:t.data));let c=[];if(1===h.length)c=h[0];else for(const t of h)c=c.concat(t);const d=qe(c,{bins:n.bins,binWidth:n.binWidth,range:n.range});if(!d)return e.histogramData={edges:[],binWidth:0,counts:[],rule:"",capped:!1},r;const{edges:u,binWidth:p}=d,g=h.map(t=>function(t,e){const i=new Array(Math.max(0,e.length-1)).fill(0);for(let s=0;s<t.length;s++){const a=Ze(t[s],e);a>=0&&i[a]++}return i}(t,u));e.histogramData={edges:u,binWidth:p,counts:g,rule:d.rule,capped:d.capped};const f=a.collapsedSeriesIndices||[];return r.map((t,e)=>{if(-1!==f.indexOf(e))return l(o({},t),{data:[]});const i=function(t,e={}){let i=t.slice();if(e.cumulative){let t=0;i=i.map(e=>t+=e)}const s=t.reduce((t,e)=>t+e,0);if(s<=0)return i;if("relative"===e.normalize)return i.map(t=>t/s*100);if("density"===e.normalize){const t=e.binWidth;if("number"==typeof t&&t>0)return i.map(e=>e/(s*t))}return i}(g[e],{normalize:n.normalize,cumulative:n.cumulative,binWidth:p}),s=[];for(let t=0;t<i.length;t++)s.push({x:(u[t]+u[t+1])/2,y:i[t]});return l(o({},t),{data:s})})}),Ne("boxPlot",function(t,e){var i,s;if(!Array.isArray(t))return t;const a=(null==(s=null==(i=e.config.plotOptions)?void 0:i.boxPlot)?void 0:s.whiskers)||"minmax";return t.map(t=>{if(!Array.isArray(null==t?void 0:t.data))return t;let e=!1;const i=t.data.map(t=>{if(Array.isArray(null==t?void 0:t.y)&&5===t.y.length&&!Ke.has(t))return t;const i=Je(t,!1);if(!i)return t;const s=function(t,e={}){if(!Array.isArray(t)||0===t.length)return null;const i=t.slice().sort((t,e)=>t-e),s=Ve(i,.25),a=Ve(i,.5),r=Ve(i,.75),n=r-s;let o=i[0],l=i[i.length-1],h=[];if("tukey"===e.whiskers&&n>0){const t=s-1.5*n,e=r+1.5*n;let a=0;for(;a<i.length&&i[a]<t;)a++;let c=i.length-1;for(;c>=0&&i[c]>e;)c--;a<=c&&(o=i[a],l=i[c],h=i.slice(0,a).concat(i.slice(c+1)))}return{summary:[o,s,a,r,l],outliers:h,iqr:n}}(i,{whiskers:a});if(!s)return t;e=!0;const r=l(o({},t),{y:s.summary,points:i});return Ke.add(r),r});return e?l(o({},t),{data:i}):t})}),Ne("violin",function(t,e){var i,s;if(!Array.isArray(t))return t;const a=(null==(s=null==(i=e.config.plotOptions)?void 0:i.violin)?void 0:s.kde)||{};return t.map(t=>{if(!Array.isArray(null==t?void 0:t.data))return t;let e=!1;const i=t.data.map(t=>{var i;if(Array.isArray(null==(i=null==t?void 0:t.y)?void 0:i.density)&&t.y.density.length&&!Ke.has(t))return t;const s=Je(t,!0);if(!s)return t;const r=function(t,e={}){if(!Array.isArray(t)||0===t.length)return null;const i=t.slice().sort((t,e)=>t-e),s=i.length;let a=e.bandwidth;if(!("number"==typeof a&&a>0)){const t=Ge(i),e=Ve(i,.75)-Ve(i,.25);a=.9*(e>0?Math.min(t,e/1.349):t)*Math.pow(s,-.2)}if(!isFinite(a)||a<=0){const t=i[0],e=Math.abs(t)>0?.001*Math.abs(t):.001;return{density:[[t-e,0],[t,1],[t+e,0]],bandwidth:e}}const r=Math.max(8,Math.floor(e.resolution||64)),n=i[0]-2*a,o=(i[s-1]+2*a-n)/(r-1),l=1/(s*a*Math.sqrt(2*Math.PI)),h=[];for(let t=0;t<r;t++){const e=n+t*o;let r=0;for(let t=0;t<s;t++){const s=(e-i[t])/a;r+=Math.exp(-.5*s*s)}h.push([e,r*l])}return{density:h,bandwidth:a}}(s,{bandwidth:a.bandwidth,resolution:a.resolution});if(!r)return t;e=!0;const n=l(o({},t),{y:{density:r.density,points:s}});return Ke.add(n),n});return e?l(o({},t),{data:i}):t})}),je("histogram",function(t,e){const i=t.globals,s=t.histogramData,a=i&&i.histogramRawSeries;if(!s||!Array.isArray(s.edges)||s.edges.length<2)return null;if(!Array.isArray(a)||!a.length)return null;const r=i&&i.collapsedSeriesIndices||[],n=s.edges,o=[];return a.forEach((e,i)=>{var s;if(-1!==r.indexOf(i))return;const l=function(t,e){const i=Math.max(0,e.length-1),s=new Array(i);for(let t=0;t<i;t++)s[t]=[];for(let i=0;i<t.length;i++){const a=Ze(t[i],e);a>=0&&s[a].push(t[i])}return s}(Ue(e&&e.data),n),h=t.seriesData&&(null==(s=t.seriesData.seriesNames)?void 0:s[i])||(null==e?void 0:e.name);l.forEach((t,e)=>{const s=`${ti(n[e])}-${ti(n[e+1])}`;o.push({name:a.length>1&&h?`${h} ${s}`:s,realIndex:i,rows:t})})}),o.length?Qe(t,o,e):null}),je("boxPlot",ii),je("violin",si);const ai=(t,e,i,s)=>{if("function"!=typeof t)return t;const a=t({series:e.seriesData.series,seriesIndex:i,dataPointIndex:s,w:e});return Number.isFinite(a)?a:0};function ri(t){return-Math.cos(t*Math.PI)/2+.5}function ni(t,e,i,s){t=Math.min(Math.max(t,0),1),i=Math.min(Math.max(i,0),1);const a=3*t,r=3*(i-t)-a,n=1-a-r,o=3*e,l=3*(s-e)-o,h=1-o-l,c=t=>((n*t+r)*t+a)*t;return t=>t<=0?0:t>=1?1:(t=>((h*t+l)*t+o)*t)((t=>{let e=0,i=1,s=t;if(s<e)return e;if(s>i)return i;for(;e<i;){const a=c(s);if(Math.abs(a-t)<1e-4)return s;t>a?e=s:i=s,s=(e+i)/2}return s})(t))}const oi=new Map;function li(t){return"function"==typeof t?hi(t):(e=t,Array.isArray(e)&&4===e.length&&e.every(t=>"number"==typeof t)?ni(t[0],t[1],t[2],t[3]):"string"==typeof t&&oi.has(t)?hi(oi.get(t)):ri);var e}function hi(t){return e=>{const i=t(e);return"number"==typeof i&&isFinite(i)?i:e}}function ci(t,e,i){if(!t||"string"!=typeof t)return null;const s=gt(t);if(!s.length||"M"!==s[0][0])return null;for(let t=1;t<s.length;t++)if("M"===s[t][0])return null;let a=s,r=null;if(i){if(s.length<5)return null;if(r=s.slice(-3),a=s.slice(0,-3),"Z"!==r[2][0])return null;if("L"!==r[1][0])return null;if("L"!==r[0][0]&&"C"!==r[0][0])return null}else if("Z"===s[s.length-1][0])return null;if(a.length!==e||a.length<2)return null;const n=a[1][0];if("L"!==n&&"C"!==n)return null;for(let t=2;t<a.length;t++)if(a[t][0]!==n)return null;const o=a.map(t=>"C"===t[0]?[Number(t[5]),Number(t[6])]:[Number(t[1]),Number(t[2])]);for(const t of o)if(!isFinite(t[0])||!isFinite(t[1]))return null;return{body:a,closing:r,segType:n,anchors:o}}function di(t,e,i){return[t[0]+(e[0]-t[0])*i,t[1]+(e[1]-t[1])*i]}function ui(t,e,i){const s=t,a=[e[1],e[2]],r=[e[3],e[4]],n=[e[5],e[6]],o=di(s,a,i),l=di(a,r,i),h=di(r,n,i),c=di(o,l,i),d=di(l,h,i),u=di(c,d,i);return{first:["C",o[0],o[1],c[0],c[1],u[0],u[1]],second:["C",d[0],d[1],h[0],h[1],n[0],n[1]],mid:u}}function pi(t,e,i){const s=[e[1],e[2]],a=di(t,s,i);return{first:["L",a[0],a[1]],second:["L",s[0],s[1]],mid:a}}function gi(t,e){const{body:i,closing:s,segType:a,anchors:r}=t,n=r.length,o=e.length,l=t=>"C"===a?["C",t[0],t[1],t[0],t[1],t[0],t[1]]:["L",t[0],t[1]],h=[["M",r[0][0],r[0][1]]];let c=0;for(;c<o&&0!==e[c];)c++;for(let t=1;t<=c;t++)h.push(l(r[0]));let d=c+1;for(let t=0;t<n-1;t++){let s=0;for(;d+s<o&&-1===e[d+s];)s++;const n=i[t+1];if(s){const e=s+1;let i=r[t],o=n;for(let t=0;t<s;t++){const s=1/(e-t),r="C"===a?ui(i,o,s):pi(i,o,s);h.push(r.first),i=r.mid,o=r.second}h.push(o)}else h.push(n.slice());d+=s+1}for(;d<o;)h.push(l(r[n-1])),d++;return s&&s.forEach(t=>h.push(t.slice())),h}function fi(t,e,i,s,a,r){const n=ci(t,s,r);if(!n)return null;const o=ci(e,a,r);if(!o)return null;if(n.segType!==o.segType)return null;if((n.closing||o.closing)&&(!n.closing||!o.closing||n.closing[0][0]!==o.closing[0][0]))return null;const l=i.map(t=>t.oldJ),h=i.map(t=>t.newJ);return{from:xt(gi(n,l)),toInterp:xt(gi(o,h))}}function mi(t){var e;const i=t.config.chart.animations;if(!i||!1===i.enabled)return!1;if(!i.dynamicAnimation||!1===i.dynamicAnimation.enabled)return!1;const s=null!=(e=i.largeDatasetThreshold)?e:0;return!(s>0&&t.globals.dataPoints>s)&&!!(Wt.isBrowser()&&t.globals.dataChanged&&t.globals.shouldAnimate)}function xi(t,e,i){var s,a,r,n;if(null==(s=t.axisFlags)?void 0:s.isXNumeric){const s=null==(r=null==(a=t.seriesData)?void 0:a.seriesX)?void 0:r[e];if(s&&s.length&&null!=s[i])return"x:"+s[i]}const o=null==(n=t.globals.labels)?void 0:n[i];return null!=o&&""!==String(o)?"c:"+(Array.isArray(o)?o.join(" "):String(o)):"j:"+i}function bi(t){const e=new Map;return t.map(t=>{const i=e.get(t)||0;return e.set(t,i+1),0===i?t:`${t}#${i}`})}function yi(t,e,i=!1,s=!1){var a,r;if(!mi(t))return null;const n=t.globals.prevStreamFrame;if(!n)return null;const o=null==(a=n.seriesY)?void 0:a[e],l=null==(r=t.seriesData.series)?void 0:r[e];if(!Array.isArray(o)||!Array.isArray(l))return null;if(!o.length||!l.length)return null;const h=bi(o.map((t,i)=>function(t,e,i){var s,a;if(t.isXNumeric){const a=null==(s=t.seriesX)?void 0:s[e];if(a&&a.length&&null!=a[i])return"x:"+a[i]}const r=null==(a=t.labels)?void 0:a[i];return null!=r&&""!==String(r)?"c:"+(Array.isArray(r)?r.join(" "):String(r)):"j:"+i}(n,e,i))),c=bi(l.map((i,s)=>xi(t,e,s))),d=function(t,e){const i=new Map;t.forEach((t,e)=>{i.has(t)||i.set(t,e)});const s=new Array(e.length),a=new Set;let r=-1,n=!0,o=t.length===e.length;e.forEach((t,e)=>{const l=i.has(t)&&!a.has(i.get(t))?i.get(t):-1;s[e]=l,-1!==l&&(a.add(l),l<r&&(n=!1),r=l),l!==e&&(o=!1)});const l=[];for(let e=0;e<t.length;e++)a.has(e)||l.push(e);return{toOld:s,exits:l,ordered:n,changed:!o}}(h,c);return(d.ordered||s)&&(d.changed||i)?{join:d,oldKeys:h,newKeys:c}:null}function wi(t,e,i,s,a){const r=performance.now(),n=o=>{if(t.globals.isDestroyed)return;const l=Math.max(0,Math.min(1,(o-r)/e));s(i(l),l),l<1?ct.requestAnimationFrame(n):a&&a()};ct.requestAnimationFrame(n)}function vi(t,{elPointsMain:e,realIndex:i,speed:s}){var a,r,n,o;if(!(null==e?void 0:e.node))return!1;const l=yi(t,i,!0);if(!l)return!1;const h=t.globals.prevStreamFrame;if(!h)return!1;const c=null==(a=h.xPixels)?void 0:a[i],d=null==(r=h.yPixels)?void 0:r[i];if(!c||!d)return!1;const u=e.node.querySelectorAll(".apexcharts-marker");if(!u.length)return!1;const p=(null==(n=t.globals.seriesXvalues)?void 0:n[i])||[],g=(null==(o=t.globals.seriesYvalues)?void 0:o[i])||[],f=function(t){var e,i;const s=t.config.chart.animations;return li(null!=(i=null==(e=s.dynamicAnimation)?void 0:e.easing)?i:s.easing)}(t),m=Math.max(1,s||1);return e.node.classList.remove("apexcharts-element-hidden"),u.forEach(e=>{var s,a,r,n,o,u,x,b,y;const w=parseInt(null!=(a=null!=(s=e.getAttribute("j"))?s:e.getAttribute("rel"))?a:"",10);if(!isFinite(w)||w<0||w>=l.join.toOld.length)return;const v=l.join.toOld[w],_=null!=p[w]&&null!=g[w]?[p[w],g[w]]:null;if(-1===v||!_){const i=e.style;return i.opacity="0",void wi(t,m,f,t=>{i.opacity=String(t)},()=>{i.opacity=""})}const A=(null!=(r=c[v])?r:NaN)-_[0],S=(null!=(n=d[v])?n:NaN)-_[1];if(!isFinite(A)||!isFinite(S))return;const C=null!=(x=null==(u=null==(o=h.rPixels)?void 0:o[i])?void 0:u[v])?x:NaN,k=parseFloat(null!=(y=null!=(b=e.getAttribute("r"))?b:e.getAttribute("default-marker-size"))?y:""),M=isFinite(C)&&isFinite(k)&&k>0&&Math.abs(C-k)>.25;if(!(Math.abs(A)>=.5||Math.abs(S)>=.5)&&!M)return;const P=t=>{const i=A*(1-t),s=S*(1-t);if(M){const a=(C+(k-C)*t)/k;e.setAttribute("transform",`translate(${i+_[0]*(1-a)}, ${s+_[1]*(1-a)}) scale(${a})`)}else e.setAttribute("transform",`translate(${i}, ${s})`)};P(0),wi(t,m,f,P,()=>{e.removeAttribute("transform")})}),!0}function _i(t,{type:e,realIndex:i,pathFromLine:s,pathFromArea:a,linePaths:r,areaPaths:n}){var o,l;const h=yi(t,i);if(!h)return null;const{join:c,oldKeys:d,newKeys:u}=h,p=t.globals.prevStreamFrame;if(!p)return null;const g=null==(o=p.seriesY)?void 0:o[i],f=null==(l=t.seriesData.series)?void 0:l[i];if(g.length<2||f.length<2)return null;if(g.some(t=>null===t)||f.some(t=>null===t))return null;const m=function(t,e){const i=new Set(t.exits),s=[];let a=0;for(let e=0;e<t.toOld.length;e++){const r=t.toOld[e];if(-1!==r){for(;a<r;)i.has(a)&&s.push({oldJ:a,newJ:-1}),a++;s.push({oldJ:r,newJ:e}),a=r+1}else s.push({oldJ:-1,newJ:e})}for(;a<e;)i.has(a)&&s.push({oldJ:a,newJ:-1}),a++;return s}(c,d.length),x={};return Array.isArray(r)&&1===r.length&&s&&(x.line=fi(s,r[0],m,d.length,u.length,!1)),"area"===e&&Array.isArray(n)&&1===n.length&&a&&(x.area=fi(a,n[0],m,d.length,u.length,!0)),x.line||x.area?x:null}function Ai({w:t,elSeries:e,record:i,newKeys:s,isHorizontal:a,speed:r}){var n;if(!mi(t))return;if(!i||!Array.isArray(i.paths)||!(null==e?void 0:e.node))return;const o=new Set(s),l=i.paths.filter(t=>t&&t.d&&null!=t.key&&!o.has(t.key));if(!l.length)return;const h=new I(t),c=null==(n=t.globals.colors)?void 0:n[parseInt(String(i.realIndex),10)];l.forEach(i=>{let s=i.fill||c||"#c8c8c8";0===String(s).indexOf("url(")&&(s=c||"#c8c8c8");const n=h.drawPath({d:i.d,stroke:"none",strokeWidth:0,fill:s,fillOpacity:1,classes:"apexcharts-bar-ghost"}),o=n.node;o.setAttribute("pointer-events","none"),n.attr("clip-path",`url(#gridRectBarMask${t.globals.cuid})`),e.node.insertBefore(o,e.node.firstChild);const l=function(t){const e=/^M\s*([+-]?[\d.eE]+)[\s,]+([+-]?[\d.eE]+)/.exec(t||"");if(!e)return null;const i=parseFloat(e[1]),s=parseFloat(e[2]);return isFinite(i)&&isFinite(s)?{x:i,y:s}:null}(i.d);let d=a?"left center":"center bottom";try{const t=o.getBBox();l&&t&&(d=a?Math.abs(l.x-t.x)<=Math.abs(l.x-(t.x+t.width))?"left center":"right center":Math.abs(l.y-(t.y+t.height))<=Math.abs(l.y-t.y)?"center bottom":"center top")}catch(t){}const u=o.style;u.transformBox="fill-box",u.transformOrigin=d;const p=Math.max(1,r||1),g=performance.now(),f=e=>{if(t.globals.isDestroyed||!o.parentNode)return;const i=Math.max(0,Math.min(1,(e-g)/p)),s=1-Math.pow(1-i,3),r=1-s;u.transform=a?`scaleX(${r})`:`scaleY(${r})`,u.opacity=String(1-s),i<1?ct.requestAnimationFrame(f):o.parentNode.removeChild(o)};ct.requestAnimationFrame(f)})}oi.set("linear",t=>t),oi.set("easeInOutSine",ri),oi.set("easeInSine",t=>1-Math.cos(t*Math.PI/2)),oi.set("easeOutSine",t=>Math.sin(t*Math.PI/2)),oi.set("easeInQuad",t=>t*t),oi.set("easeOutQuad",t=>1-(1-t)*(1-t)),oi.set("easeInOutQuad",t=>t<.5?2*t*t:1-Math.pow(-2*t+2,2)/2),oi.set("easeInCubic",t=>t*t*t),oi.set("easeOutCubic",t=>1-Math.pow(1-t,3)),oi.set("easeInOutCubic",t=>t<.5?4*t*t*t:1-Math.pow(-2*t+2,3)/2),oi.set("easeOutBack",t=>{const e=1.70158;return 1+2.70158*Math.pow(t-1,3)+e*Math.pow(t-1,2)}),oi.set("easeInOutBack",t=>{const e=2.5949095;return t<.5?Math.pow(2*t,2)*(7.189819*t-e)/2:(Math.pow(2*t-2,2)*((e+1)*(2*t-2)+e)+2)/2});class Si{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:i,y1:s,y2:a,i:r,j:n,realIndex:h,columnGroupIndex:c,series:d,barHeight:u,barWidth:p,barXPosition:g,barYPosition:f,visibleSeries:m}=t,x=this.w,b=new I(this.barCtx.w),y=Array.isArray(this.barCtx.strokeWidth)?this.barCtx.strokeWidth[h]:this.barCtx.strokeWidth;let w,v;x.axisFlags.isXNumeric&&!x.globals.isBarHorizontal?(w=e+p*(m+1),v=i+u*(m+1)-y):(w=e+p*m,v=i+u*m);let _=null,A=null,S=e,C=i,k={};const M=x.config.dataLabels,P=this.barCtx.barOptions.dataLabels,L=this.barCtx.barOptions.dataLabels.total;void 0!==f&&(this.barCtx.isRangeBar||this.barCtx.isPyramid)&&(v=f,C=f),void 0!==g&&this.barCtx.isVerticalGroupedRangeBar&&(w=g,S=g);const E=ai(M.offsetX,x,h,n),R=ai(M.offsetY,x,h,n);let D={width:0,height:0};if(x.config.dataLabels.enabled){const t=x.seriesData.series[h][n];D=b.getTextRects(x.config.dataLabels.formatter?x.config.dataLabels.formatter(t,l(o({},x),{seriesIndex:h,dataPointIndex:n,w:x})):x.formatters.yLabelFormatters[0](t),parseFloat(M.style.fontSize).toString(),M.style.fontFamily,void 0,!0,M.style.fontWeight)}const F={x:e,y:i,i:r,j:n,realIndex:h,columnGroupIndex:c,bcx:w,bcy:v,barHeight:u,barWidth:p,textRects:D,strokeWidth:y,dataLabelsX:S,dataLabelsY:C,dataLabelsConfig:M,barDataLabelsConfig:P,barTotalDataLabelsConfig:L,offX:E,offY:R};return k=this.barCtx.isHorizontal?this.calculateBarsDataLabelsPosition(F):this.calculateColumnsDataLabelsPosition(F),_=this.drawCalculatedDataLabels({x:k.dataLabelsX,y:k.dataLabelsY,val:this.barCtx.isRangeBar?[s,a]:"100%"===x.config.chart.stackType?d[h][n]:x.seriesData.series[h][n],i:h,j:n,barWidth:p,barHeight:u,textRects:D,dataLabelsConfig:M}),x.config.chart.stacked&&L.enabled&&(A=this.drawTotalDataLabels({x:k.totalDataLabelsX,y:k.totalDataLabelsY,barWidth:p,barHeight:u,realIndex:h,j:n,textAnchor:k.totalDataLabelsAnchor,val:this.getStackedTotalDataLabel({realIndex:h,j:n}),rawVal:this.getStackedTotalValue({realIndex:h,j:n}),dataLabelsConfig:M,barTotalDataLabelsConfig:L})),{dataLabelsPos:k,dataLabels:_,totalDataLabels:A}}hasMultipleSeriesGroups(){return this.w.labelData.seriesGroups.length>1}getTotalGroupContext(t){if(!this.hasMultipleSeriesGroups())return null;const e=this.barCtx.barHelpers.getSeriesGroupIndex(t);return e<0?null:{groupIndex:e,group:this.w.labelData.seriesGroups[e]}}drawsStackedTotal(t){const e=this.barCtx.lastActiveBarSerieIndexByGroup,i=this.getTotalGroupContext(t);return i&&e&&e.length>i.groupIndex?e[i.groupIndex]===t:this.barCtx.lastActiveBarSerieIndex===t}getStackedTotalValue({realIndex:t,j:e}){const i=this.w,s=this.getTotalGroupContext(t),a=i.seriesData.stackedSeriesTotalsByGroups;return s&&a&&a[s.groupIndex]?a[s.groupIndex][e]:this.barCtx.stackedSeriesTotals[e]}getStackedTotalDataLabel({realIndex:t,j:e}){const i=this.w;let s=this.getStackedTotalValue({realIndex:t,j:e});return this.totalFormatter&&(s=this.totalFormatter(s,l(o({},i),{seriesIndex:t,dataPointIndex:e,w:i}))),s}calculateColumnsDataLabelsPosition(t){const e=this.w;let i,s,{i:a,j:r,realIndex:n,y:o,bcx:l,barWidth:h,barHeight:c,textRects:d,dataLabelsX:u,dataLabelsY:p,dataLabelsConfig:g,barDataLabelsConfig:f,barTotalDataLabelsConfig:m,strokeWidth:x,offX:b,offY:y}=t;const w=l;c=Math.abs(c);const v="vertical"===e.config.plotOptions.bar.dataLabels.orientation,{zeroEncounters:_}=this.barCtx.barHelpers.getZeroValueEncounters({i:a,j:r});l-=x/2;const A=e.layout.gridWidth/e.globals.dataPoints;if(this.barCtx.isVerticalGroupedRangeBar?u+=h/2:(u=e.axisFlags.isXNumeric?l-h/2+b:l-A+h/2+b,!e.config.chart.stacked&&_>0&&e.config.plotOptions.bar.hideZeroBarsWhenGrouped&&(u-=h*_)),v){const t=2;u=u+d.height/2-x/2-t}const S=e.seriesData.series[a][r]<0;let C=o;switch(this.barCtx.isReversed&&(C=o+(S?c:-c)),f.position){case"center":p=v?S?C-c/2+y:C+c/2-y:S?C-c/2+d.height/2+y:C+c/2+d.height/2-y;break;case"bottom":p=v?S?C-c+y:C+c-y:S?C-c+d.height+x+y:C+c-d.height/2+x-y;break;case"top":p=v?S?C+y:C-y:S?C-d.height/2-y:C+d.height+y}let k=C;const M=this.getTotalGroupContext(n);if((M?[M.group]:e.labelData.seriesGroups).forEach(t=>{var e;null==(e=this.barCtx[t.join(",")])||e.prevY.forEach(t=>{k=S?Math.max(t[r],k):Math.min(t[r],k)})}),this.drawsStackedTotal(n)&&m.enabled){const t=18,a=new I(this.barCtx.w).getTextRects(this.getStackedTotalDataLabel({realIndex:n,j:r}),g.fontSize);i=S?k-a.height/2-y-m.offsetY+t:k+a.height+y+m.offsetY-t;const o=A;s=w+(e.axisFlags.isXNumeric?-h/2:h/2-o)+m.offsetX}return e.config.chart.stacked||(p<0?p=0+x:p+d.height/3>e.layout.gridHeight&&(p=e.layout.gridHeight-x)),{bcx:l,bcy:o,dataLabelsX:u,dataLabelsY:p,totalDataLabelsX:s,totalDataLabelsY:i,totalDataLabelsAnchor:"middle"}}calculateBarsDataLabelsPosition(t){var e;const i=this.w;let{x:s,i:a,j:r,realIndex:n,bcy:o,barHeight:l,barWidth:h,textRects:c,dataLabelsX:d,strokeWidth:u,dataLabelsConfig:p,barDataLabelsConfig:g,barTotalDataLabelsConfig:f,offX:m,offY:x}=t;const b=i.layout.gridHeight/i.globals.dataPoints,{zeroEncounters:y}=this.barCtx.barHelpers.getZeroValueEncounters({i:a,j:r});let w,v,_;if(h=Math.abs(h),this.barCtx.isPyramid){w=o+l/2+x-(null!=(e=c.centerOffset)?e:0)}else w=o-(this.barCtx.isRangeBar?0:b)+l/2+c.height/2+x-3;!i.config.chart.stacked&&y>0&&i.config.plotOptions.bar.hideZeroBarsWhenGrouped&&(w-=l*y);let A="start";const S=i.seriesData.series[a][r]<0;let C=s;if(this.barCtx.isReversed&&(C=s+(S?-h:h),A=S?"start":"end"),this.barCtx.isPyramid)d=i.layout.gridWidth/2+m;else switch(g.position){case"center":d=S?C+h/2-m:Math.max(c.width/2,C-h/2)+m;break;case"bottom":d=S?C+h-u-m:C-h+u+m;break;case"top":d=S?C-u-m:C-u+m}let k=C;const M=this.getTotalGroupContext(n);if((M?[M.group]:i.labelData.seriesGroups).forEach(t=>{var e;null==(e=this.barCtx[t.join(",")])||e.prevX.forEach(t=>{k=S?Math.min(t[r],k):Math.max(t[r],k)})}),this.drawsStackedTotal(n)&&f.enabled){const t=new I(this.barCtx.w).getTextRects(this.getStackedTotalDataLabel({realIndex:n,j:r}),p.fontSize);S?(v=k-u-m-f.offsetX,A="end"):v=k+m+f.offsetX+(this.barCtx.isReversed?-(h+u):u),_=w-c.height/2+t.height/2+f.offsetY+u,i.globals.barGroups.length>1&&!M&&(_-=i.globals.barGroups.length/2*(l/2))}if(!i.config.chart.stacked){const t=S&&"middle"!==p.textAnchor?"start"===p.textAnchor?"end":"start":p.textAnchor;let e;e="vertical"===g.orientation?c.height/2:"end"===t?c.width:"middle"===t?c.width/2:0;const s=("vertical"===g.orientation?c.height:c.width)-e;d+s>i.layout.gridWidth-u&&(d=i.layout.gridWidth-s-u),d-e<u&&(d=e+u)}return{bcx:s,bcy:o,dataLabelsX:d,dataLabelsY:w,totalDataLabelsX:v,totalDataLabelsY:_,totalDataLabelsAnchor:A}}drawCalculatedDataLabels({x:t,y:e,val:i,i:s,j:a,textRects:r,barHeight:n,barWidth:h,dataLabelsConfig:c}){var d,u,p;const g=this.w;let f="rotate(0)";"vertical"===g.config.plotOptions.bar.dataLabels.orientation&&(f=`rotate(-90, ${t}, ${e})`);const m=new C(this.barCtx.w,this.barCtx.ctx),x=new I(this.barCtx.w),b=c.formatter;let y=null;const w=g.globals.collapsedSeriesIndices.indexOf(s)>-1,v=(g.globals.collapsingSeriesIndices||[]).indexOf(s)>-1;if(v){const t=null==(d=g.globals.prevDataLabels)?void 0:d.get(`${s}::${xi(g,s,a)}`);t&&isFinite(t.val)&&(i=t.val)}if(c.enabled&&(!w||v)){y=x.group({class:"apexcharts-data-labels",transform:f});const d=g.config.dataLabels;((null==(u=d.animate)?void 0:u.enabled)||(null==(p=d.countUp)?void 0:p.enabled))&&(y.node.setAttribute("data:dlKey",`${s}::${xi(g,s,a)}`),y.node.setAttribute("data:dlJ",String(a)),"number"==typeof i&&isFinite(i)&&y.node.setAttribute("data:dlVal",String(i)));let w="";void 0!==i&&(w=b(i,l(o({},g),{seriesIndex:s,dataPointIndex:a,w:g}))),!i&&g.config.plotOptions.bar.hideZeroBarsWhenGrouped&&(w="");const _=g.seriesData.series[s][a]<0,A=g.config.plotOptions.bar.dataLabels.position;if("vertical"===g.config.plotOptions.bar.dataLabels.orientation&&("top"===A&&(c.textAnchor=_?"end":"start"),"center"===A&&(c.textAnchor="middle"),"bottom"===A&&(c.textAnchor=_?"end":"start")),this.barCtx.isRangeBar&&this.barCtx.barOptions.dataLabels.hideOverflowingLabels){h<x.getTextRects(w,parseFloat(c.style.fontSize).toString()).width&&(w="")}g.config.chart.stacked&&this.barCtx.barOptions.dataLabels.hideOverflowingLabels&&!v&&(this.barCtx.isHorizontal?r.width/1.6>Math.abs(h)&&(w=""):r.height/1.6>Math.abs(n)&&(w=""));const S=o({},c);this.barCtx.isHorizontal&&i<0&&("start"===c.textAnchor?S.textAnchor="end":"end"===c.textAnchor&&(S.textAnchor="start")),m.plotDataLabelsText({x:t,y:e,text:w,i:s,j:a,parent:y,dataLabelsConfig:S,alwaysDrawDataLabel:!0,offsetCorrection:!0})}return y}drawTotalDataLabels({x:t,y:e,val:i,rawVal:s,realIndex:a,j:r,textAnchor:n,barTotalDataLabelsConfig:o}){var l,h;const c=new I(this.barCtx.w);let d;if(o.enabled&&void 0!==t&&void 0!==e&&this.drawsStackedTotal(a)){d=c.drawText({x:t,y:e,foreColor:o.style.color,text:i,textAnchor:n,fontFamily:o.style.fontFamily,fontSize:o.style.fontSize,fontWeight:o.style.fontWeight}),d.attr({class:"apexcharts-datalabel-total",cx:t,cy:e});const u=this.w.config.dataLabels;if((null==(l=u.animate)?void 0:l.enabled)||(null==(h=u.countUp)?void 0:h.enabled)){const{groupIndex:t}=this.barCtx.barHelpers.getGroupIndex(a);d.node.setAttribute("data:dlTotalKey",`${t}::${xi(this.w,a,r)}`),d.node.setAttribute("data:dlTotalSeries",String(a)),"number"==typeof s&&isFinite(s)&&d.node.setAttribute("data:dlTotalVal",String(s))}}return d}}function Ci(t){var e,i,s,a,r,n,o;return"histogram"===(null==(i=null==(e=null==t?void 0:t.config)?void 0:e.chart)?void 0:i.requestedType)&&(!1!==(null==(a=null==(s=t.config.plotOptions)?void 0:s.histogram)?void 0:a.overlap)&&(null!=(o=null==(n=null==(r=t.seriesData)?void 0:r.series)?void 0:n.length)?o:0)>1)}let ki=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 i=0;i<t.length;i++)if(t[i].length>0&&(this.barCtx.seriesLen=this.barCtx.seriesLen+1,this.barCtx.totalItems+=t[i].length),e.axisFlags.isXNumeric)for(let s=0;s<t[i].length;s++)e.seriesData.seriesX[i][s]>e.globals.minX&&e.seriesData.seriesX[i][s]<e.globals.maxX&&this.barCtx.visibleItems++;else this.barCtx.visibleItems=e.globals.dataPoints;this.arrBorderRadius=this.createBorderRadiusArr(e.seriesData.series),Ht.isSafari()&&(this.arrBorderRadius=this.arrBorderRadius.map(t=>t.map(t=>"none"))),0===this.barCtx.seriesLen&&(this.barCtx.seriesLen=1)}initialPositions(t){const e=this.w;let i,s,a,r,n,o,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||Ci(e))&&(d=1),this.barCtx.isHorizontal)a=e.layout.gridHeight/c,n=a/d,e.axisFlags.isXNumeric&&(a=e.layout.gridHeight/this.barCtx.totalItems,n=a/this.barCtx.seriesLen),n=n*parseInt(this.barCtx.barOptions.barHeight,10)/100,-1===String(this.barCtx.barOptions.barHeight).indexOf("%")&&(n=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),s=(a-n*this.barCtx.seriesLen)/2;else{if(r=e.layout.gridWidth/this.barCtx.visibleItems,e.config.xaxis.convertedCatToNumeric&&(r=e.layout.gridWidth/e.globals.dataPoints),o=r/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&&(r=e.globals.minXDiff/t),o=r/d*parseInt(this.barCtx.barOptions.columnWidth,10)/100,o<1&&(o=1)}if(-1===String(this.barCtx.barOptions.columnWidth).indexOf("%")&&(o=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){i=this.barCtx.getBarXForNumericXAxis({x:i,j:0,realIndex:t,barWidth:o}).x}else i=e.globals.padHorizontal+Ht.noExponents(r-o*this.barCtx.seriesLen)/2}return e.globals.barHeight=n,e.globals.barWidth=o,{x:i,y:s,yDivision:a,xDivision:r,barHeight:n,barWidth:o,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,i,s){var a,r,n,o;const l=this.w,h=new M(this.barCtx.w);let c=null;const d=this.barCtx.barOptions.distributed?i:e;let u=!1;if(this.barCtx.barOptions.colors.ranges.length>0){this.barCtx.barOptions.colors.ranges.map(s=>{t[e][i]>=s.from&&t[e][i]<=s.to&&(c=s.color,u=!0)})}return{color:h.fillPath({seriesNumber:this.barCtx.barOptions.distributed?d:s,dataPointIndex:i,color:c,value:t[e][i],fillConfig:null==(a=l.config.series[e].data[i])?void 0:a.fill,fillType:(null==(n=null==(r=l.config.series[e].data[i])?void 0:r.fill)?void 0:n.type)?null==(o=l.config.series[e].data[i])?void 0:o.fill.type:Array.isArray(l.config.fill.type)?l.config.fill.type[s]:l.config.fill.type}),useRangeColor:u}}getStrokeWidth(t,e,i){let s=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||(s=Array.isArray(this.barCtx.strokeWidth)?this.barCtx.strokeWidth[i]:this.barCtx.strokeWidth)),s}getStackedSeriesIndices(t){const e=this.w.labelData.seriesGroups;if(!e||e.length<2)return[Array.from({length:t},(t,e)=>e)];const i=Array.from({length:e.length},()=>[]),s=[];for(let e=0;e<t;e++){const t=this.getSeriesGroupIndex(e);t>-1?i[t].push(e):s.push(e)}return s.length&&i.push(s),i.filter(t=>t.length>0)}createBorderRadiusArr(t){var e;const i=this.w,s=!this.w.config.chart.stacked||i.config.plotOptions.bar.borderRadius<=0,a=t.length,r=0|(null==(e=t[0])?void 0:e.length),n=Array.from({length:a},()=>Array(r).fill(s?"top":"none"));if(s)return n;const o="bar"===this.w.config.chart.type&&1===r,l=o?"top":"both",h=o?"top":"bottom";for(const e of this.getStackedSeriesIndices(a))for(let i=0;i<r;i++){const s=[],a=[];for(const r of e){const e=t[r][i];e>0?s.push(r):e<0&&a.push(r)}if(s.length>0&&0===a.length)if(1===s.length)n[s[0]][i]=l;else{const t=s[0],e=s[s.length-1];for(const a of s)n[a][i]=a===t?h:a===e?"top":"none"}else if(a.length>0&&0===s.length)if(1===a.length)n[a[0]][i]="both";else{const t=Math.max(...a),e=Math.min(...a);for(const s of a)n[s][i]=s===t?"bottom":s===e?"top":"none"}else if(s.length>0&&a.length>0){const t=s[s.length-1];for(const e of s)n[e][i]=e===t?"top":"none";const e=Math.max(...a);for(const t of a)n[t][i]=t===e?"bottom":"none"}}return n}barBackground({j:t,i:e,x1:i,x2:s,y1:a,y2:r,elSeries:n}){const o=this.w,l=new I(this.barCtx.w),h=new X(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!==i?i:0,void 0!==a?a:0,void 0!==s?s:o.layout.gridWidth,void 0!==r?r:o.layout.gridHeight,this.barCtx.barOptions.colors.backgroundBarRadius,e,this.barCtx.barOptions.colors.backgroundBarOpacity);n.add(h),h.node.classList.add("apexcharts-backgroundBar")}}getColumnPaths({barWidth:t,barXPosition:e,y1:i,y2:s,strokeWidth:a,isReversed:r,series:n,seriesGroup:o,realIndex:l,i:h,j:c,w:d}){var u,p,g;const f=new I(this.barCtx.w);(a=Array.isArray(a)?a[l]:a)||(a=0);let m=t,x=e;(null==(u=d.config.series[l].data[c])?void 0:u.columnWidthOffset)&&(x=e-d.config.series[l].data[c].columnWidthOffset/2,m=t+d.config.series[l].data[c].columnWidthOffset);const b=a/2,y=x+b,w=x+m-b,v=(n[h][c]>=0?1:-1)*(r?-1:1);i+=.001-b*v,s+=.001+b*v;const _=f.line(w,i),A="around"===d.config.plotOptions.bar.borderRadiusApplication||"both"===this.arrBorderRadius[l][c]?" Z":" z",S=f.move(y,i)+f.line(y,s)+f.line(w,s)+_+A;let C=S;"none"!==this.arrBorderRadius[l][c]&&(C=f.roundPathCorners(C,d.config.plotOptions.bar.borderRadius));let k=null;const M=null==(g=null==(p=this.barCtx.ctx)?void 0:p.morphTypeChange)?void 0:g.getInitialPathFor(l,c);if(M?k=M:d.globals.previousPaths.length>0&&(k=this.barCtx.getPreviousPath(l,c,C,S)),null==k&&(k=f.move(y,i)+f.line(y,i)+_+_+_+_+_+f.line(y,i)+A),d.config.chart.stacked){let t=this.barCtx;t=this.barCtx[o],t.yArrj.push(s-b*v),t.yArrjF.push(Math.abs(i-s+a*v)),t.yArrjVal.push(this.barCtx.series[h][c])}return{pathTo:C,pathFrom:k}}getFunnelTrapezoidPaths({barYPosition:t,barHeight:e,series:i,i:s,j:a,realIndex:r,strokeWidth:n,w:o}){var l,h;const c=new I(this.barCtx.w),d=o.layout.gridWidth/2,u=t=>Math.abs(t/this.barCtx.invertedYRatio)/2,p=u(i[s][a]),g=a===i[s].length-1,f="taper"===o.config.plotOptions.funnel.lastShape?"taper":"flat";let m;m=g?"taper"===f?0:p:u(i[s][a+1]);const x=n/2,b=t+x,y=t+e-x,w=d-p,v=d+p,_=d-m,A=d+m,S=c.move(w,b)+c.line(v,b)+c.line(A,y)+c.line(_,y)+" Z";let C=null;const k=null==(h=null==(l=this.barCtx.ctx)?void 0:l.morphTypeChange)?void 0:h.getInitialPathFor(r,a);return k?C=k:o.globals.previousPaths.length>0&&(C=this.barCtx.getPreviousPath(r,a,S)),null==C&&(C=c.move(d,b)+c.line(d,b)+c.line(d,y)+c.line(d,y)+" Z"),{pathTo:S,pathFrom:C,x:v,x1:w,barXPosition:d}}computePyramidLayout(t){const e=this.w,i=e.layout.gridHeight,s=e.layout.gridWidth,a=t.map(t=>Math.abs(Number(t)||0)),r=a.reduce((t,e)=>t+e,0);if(0===r||i<=0)return a.map(()=>({y:0,height:0,topHalf:0,bottomHalf:0}));const n=s/2;let o=0;const l=[];for(let t=0;t<a.length;t++){const e=o/r;o+=a[t];const s=o/r,h=e*i,c=s*i;l.push({y:h,height:c-h,topHalf:e*n,bottomHalf:s*n})}return l}getPyramidPaths({barYPosition:t,barHeight:e,topHalf:i,bottomHalf:s,realIndex:a,j:r,strokeWidth:n,w:o}){var l,h;const c=new I(this.barCtx.w),d=o.layout.gridWidth/2,u=n/2,p=t+u,g=t+e-u,f=d-i,m=d+i,x=d-s,b=d+s,y=c.move(f,p)+c.line(m,p)+c.line(b,g)+c.line(x,g)+" Z";let w=null;const v=null==(h=null==(l=this.barCtx.ctx)?void 0:l.morphTypeChange)?void 0:h.getInitialPathFor(a,r);return v?w=v:o.globals.previousPaths.length>0&&(w=this.barCtx.getPreviousPath(a,r,y)),null==w&&(w=c.move(d,p)+c.line(d,p)+c.line(d,g)+c.line(d,g)+" Z"),{pathTo:y,pathFrom:w,x:m,x1:f,barXPosition:d}}getBarpaths({barYPosition:t,barHeight:e,x1:i,x2:s,strokeWidth:a,isReversed:r,series:n,seriesGroup:o,realIndex:l,i:h,j:c,w:d}){var u,p,g;const f=new I(this.barCtx.w);(a=Array.isArray(a)?a[l]:a)||(a=0);let m=t,x=e;(null==(u=d.config.series[l].data[c])?void 0:u.barHeightOffset)&&(m=t-d.config.series[l].data[c].barHeightOffset/2,x=e+d.config.series[l].data[c].barHeightOffset);const b=a/2,y=m+b,w=m+x-b,v=(n[h][c]>=0?1:-1)*(r?-1:1);i+=.001+b*v,s+=.001-b*v;const _=this.barCtx.isFunnel,A=_?(i+s)/2:i,S=f.line(i,w),C="around"===d.config.plotOptions.bar.borderRadiusApplication||"both"===this.arrBorderRadius[l][c]?" Z":" z",k=f.move(i,y)+f.line(s,y)+f.line(s,w)+S+C;let M=k;"none"!==this.arrBorderRadius[l][c]&&(M=f.roundPathCorners(M,d.config.plotOptions.bar.borderRadius));let P=null;const L=null==(g=null==(p=this.barCtx.ctx)?void 0:p.morphTypeChange)?void 0:g.getInitialPathFor(l,c);if(L?P=L:d.globals.previousPaths.length>0&&(P=this.barCtx.getPreviousPath(l,c,M,k)),null==P){const t=_?f.line(A,w):S;P=f.move(A,y)+f.line(A,y)+t+t+t+t+t+f.line(A,y)+C}if(d.config.chart.stacked){let t=this.barCtx;t=this.barCtx[o],t.xArrj.push(s+b*v),t.xArrjF.push(Math.abs(i-s-a*v)),t.xArrjVal.push(this.barCtx.series[h][c])}return{pathTo:M,pathFrom:P}}getXForValue(t,e,i=!0){let s=i?e:null;return null!=t&&(s=e+t/this.barCtx.invertedYRatio-2*(this.barCtx.isReversed?t/this.barCtx.invertedYRatio:0)),s}getYForValue(t,e,i,s=!0){let a=s?e:null;return null!=t&&(a=e-t/this.barCtx.yRatio[i]+2*(this.barCtx.isReversed?t/this.barCtx.yRatio[i]:0)),a}getGoalValues(t,e,i,s,a,r){const n=this.w,h=[],c=(s,a)=>{h.push({[t]:"x"===t?this.getXForValue(s,e,!1):this.getYForValue(s,i,r,!1),attrs:a})};if(n.seriesData.seriesGoals[s]&&n.seriesData.seriesGoals[s][a]&&Array.isArray(n.seriesData.seriesGoals[s][a])&&n.seriesData.seriesGoals[s][a].forEach(t=>{c(t.value,t)}),this.barCtx.barOptions.isDumbbell&&n.rangeData.seriesRange.length){const e=this.barCtx.barOptions.dumbbellColors?this.barCtx.barOptions.dumbbellColors:n.globals.colors,i={strokeHeight:"x"===t?0:n.globals.markers.size[s],strokeWidth:"x"===t?n.globals.markers.size[s]:0,strokeDashArray:0,strokeLineCap:"round",strokeColor:Array.isArray(e[s])?e[s][0]:e[s]};c(n.rangeData.seriesRangeStart[s][a],i),c(n.rangeData.seriesRangeEnd[s][a],l(o({},i),{strokeColor:Array.isArray(e[s])?e[s][1]:e[s]}))}return h}drawGoalLine({barXPosition:t,barYPosition:e,goalX:i,goalY:s,barWidth:a,barHeight:r}){if(!(Array.isArray(i)&&i.length>0||Array.isArray(s)&&s.length>0))return null;const n=new I(this.barCtx.w),o=n.group({className:"apexcharts-bar-goals-groups"});o.node.classList.add("apexcharts-element-hidden"),this.barCtx.w.globals.delayedElements.push({el:o.node}),o.attr("clip-path",`url(#gridRectMarkerMask${this.barCtx.w.globals.cuid})`);let l=null;return this.barCtx.isHorizontal?Array.isArray(i)&&i.forEach(t=>{if(t.x>=-1&&t.x<=n.w.layout.gridWidth+1){const i=void 0!==t.attrs.strokeHeight?t.attrs.strokeHeight:r/2,s=e+i+r/2;l=n.drawLine(t.x,s-2*i,t.x,s,t.attrs.strokeColor?t.attrs.strokeColor:void 0,t.attrs.strokeDashArray,t.attrs.strokeWidth?t.attrs.strokeWidth:2,t.attrs.strokeLineCap),o.add(l)}}):Array.isArray(s)&&s.forEach(e=>{if(e.y>=-1&&e.y<=n.w.layout.gridHeight+1){const i=void 0!==e.attrs.strokeWidth?e.attrs.strokeWidth:a/2,s=t+i+a/2;l=n.drawLine(s-2*i,e.y,s,e.y,e.attrs.strokeColor?e.attrs.strokeColor:void 0,e.attrs.strokeDashArray,e.attrs.strokeHeight?e.attrs.strokeHeight:2,e.attrs.strokeLineCap),o.add(l)}}),o}drawBarShadow({prevPaths:t,currPaths:e,color:i,realIndex:s,j:a}){const r=this.w,{x:n,x1:o,barYPosition:l}=t,{x:h,x1:c,barYPosition:d}=e,u=l+e.barHeight,p=new I(this.barCtx.w),g=new Ht,f=p.move(o,u)+p.line(n,u)+p.line(h,d)+p.line(c,d)+p.line(o,u)+("around"===r.config.plotOptions.bar.borderRadiusApplication||"both"===this.arrBorderRadius[s][a]?" Z":" z");return p.drawPath({d:f,fill:g.shadeColor(.5,Ht.rgb2hex(i)),stroke:"none",strokeWidth:0,fillOpacity:1,classes:"apexcharts-bar-shadow apexcharts-decoration-element"})}getZeroValueEncounters({i:t,j:e}){var i;const s=this.w;let a=0,r=0;return(s.config.plotOptions.bar.horizontal?s.seriesData.series.map((t,e)=>e):(null==(i=s.globals.columnSeries)?void 0:i.i.map(t=>t))||[]).forEach(i=>{const n=s.globals.seriesPercent[i][e];n&&a++,i<t&&0===n&&r++}),{nonZeroColumns:a,zeroEncounters:r}}getSeriesGroupIndex(t){const e=this.w;return e.labelData.seriesGroups.findIndex(i=>i.indexOf(e.seriesData.seriesNames[t])>-1)}getGroupIndex(t){const e=this.w,i=e.labelData.seriesGroups.findIndex(i=>i.indexOf(e.seriesData.seriesNames[t])>-1),s=this.barCtx.columnGroupIndices;let a=s.indexOf(i);return a<0&&(s.push(i),a=s.length-1),{groupIndex:i,columnGroupIndex:a}}};class Mi{constructor(t,e,i){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.isPyramid=this.barOptions.isPyramid,this.pyramidLayout=null,this.xyRatios=i,this.xRatio=0,this.yRatio=[],this.invertedXRatio=0,this.invertedYRatio=0,this.baseLineY=[],this.baseLineInvertedY=0,null!==this.xyRatios&&(this.xRatio=i.xRatio,this.yRatio=i.yRatio,this.invertedXRatio=i.invertedXRatio,this.invertedYRatio=i.invertedYRatio,this.baseLineY=i.baseLineY,this.baseLineInvertedY=i.baseLineInvertedY),this.yaxisIndex=0,this.translationsIndex=0,this.seriesLen=0,this.pathArr=[],this._prevKeyed=null,this._ltCache=null,this._layoutShiftCache=null,this._pathToInterp=null,this.series=[],this.elSeries=null,this.visibleI=0,this.isReversed=!1;const s=new X(this.w);this.lastActiveBarSerieIndex=s.getActiveConfigSeriesIndex("desc",["bar","column"]),this.lastActiveBarSerieIndexByGroup=s.getActiveConfigSeriesIndexByGroup(["bar","column"]),this.columnGroupIndices=[];const a=s.getBarSeriesIndices(),r=new _(this.w);this.stackedSeriesTotals=r.getStackedSeriesTotals(this.w.config.series.map((t,e)=>-1===a.indexOf(e)?e:-1).filter(t=>-1!==t)),this.barHelpers=new ki(this)}draw(t,e){var i,s,a;const r=this.w,n=new I(this.w),h=new _(this.w);t=h.getLogSeries(t),this.series=t,this.yRatio=h.getLogYRatios(this.yRatio),this.barHelpers.initVariables(t);const c=n.group({class:"apexcharts-bar-series apexcharts-plot-series"});r.config.dataLabels.enabled&&(this.totalItems,this.barOptions.dataLabels.maxItems);for(let h=0,d=0;h<t.length;h++,d++){let u,p;const g=[],f=[],m=r.globals.comboCharts?e[h]:h,{columnGroupIndex:x}=this.barHelpers.getGroupIndex(m),b=n.group({class:"apexcharts-series",rel:h+1,seriesName:Ht.escapeString(r.seriesData.seriesNames[m]),"data:realIndex":m});X.addCollapsedClassToSeries(this.w,b,m),t[h].length>0&&(this.visibleI=this.visibleI+1),this.yRatio.length>1&&(this.yaxisIndex=r.globals.seriesYAxisReverseMap[m],this.translationsIndex=m);const y=this.translationsIndex;this.isReversed=r.config.yaxis[this.yaxisIndex]&&r.config.yaxis[this.yaxisIndex].reversed,this.isPyramid&&(this.pyramidLayout=this.barHelpers.computePyramidLayout(t[h]));const w=this.barHelpers.initialPositions(m),{y:v,yDivision:_,zeroW:A,x:S,xDivision:C,zeroH:k}=w;let M=w.barHeight,L=w.barWidth;p=v,u=S,this.isHorizontal||f.push(u+(null!=L?L:0)/2);const I=n.group({class:"apexcharts-datalabels","data:realIndex":m});r.globals.delayedElements.push({el:I.node,holdUntilComplete:!(null==(i=r.config.dataLabels.animate)?void 0:i.enabled)&&this.isLengthTransition(m)}),I.node.classList.add("apexcharts-element-hidden");const E=n.group({class:"apexcharts-bar-goals-markers"}),R=n.group({class:"apexcharts-bar-shadows"});r.globals.delayedElements.push({el:R.node}),R.node.classList.add("apexcharts-element-hidden");for(let e=0;e<t[h].length;e++){const i=this.barHelpers.getStrokeWidth(h,e,m);let n=null;const c={indexes:{i:h,j:e,realIndex:m,translationsIndex:y,bc:d},x:u,y:p,strokeWidth:i,elSeries:b};this.isHorizontal?(n=this.drawBarPaths(l(o({},c),{barHeight:M,zeroW:A,yDivision:_})),L=this.series[h][e]/this.invertedYRatio):(n=this.drawColumnPaths(l(o({},c),{xDivision:C,barWidth:L,zeroH:k})),M=this.series[h][e]/this.yRatio[y]);const w=this.barHelpers.getPathFillColor(t,h,e,m);if(this.isFunnel&&!this.isPyramid&&this.barOptions.isFunnel3d&&"trapezoid"!==(null==(s=r.config.plotOptions.funnel)?void 0:s.shape)&&this.pathArr.length&&e>0){const t=this.barHelpers.drawBarShadow({color:"string"==typeof w.color&&-1===(null==(a=w.color)?void 0:a.indexOf("url"))?w.color:Ht.hexToRgba(r.globals.colors[h]),prevPaths:this.pathArr[this.pathArr.length-1],currPaths:n,realIndex:m,j:e});if(R.add(t),r.config.chart.dropShadow.enabled){new P(this.w).dropShadow(t,r.config.chart.dropShadow,m)}}this.pathArr.push(n);const v=this.barHelpers.drawGoalLine({barXPosition:n.barXPosition,barYPosition:n.barYPosition,goalX:n.goalX,goalY:n.goalY,barHeight:M,barWidth:L});v&&E.add(v),p=n.y,u=n.x,e>0&&f.push(u+(null!=L?L:0)/2),g.push(p),this.renderSeries(l(o({realIndex:m,pathFill:w.color},w.useRangeColor?{lineFill:w.color}:{}),{j:e,i:h,columnGroupIndex:x,pathFrom:n.pathFrom,pathTo:n.pathTo,strokeWidth:i,elSeries:b,x:u,y:p,series:t,barHeight:Math.abs(n.barHeight?n.barHeight:M),barWidth:Math.abs(n.barWidth?n.barWidth:L),elDataLabelsWrap:I,elGoalsMarkers:E,elBarShadows:R,visibleSeries:this.visibleI,type:"bar"}))}if(r.globals.seriesXvalues[m]=f,r.globals.seriesYvalues[m]=g,r.globals.previousPaths.length>0){const e=[];for(let i=0;i<t[h].length;i++)e.push(xi(r,m,i));Ai({w:r,elSeries:b,record:this._prevRecord(m),newKeys:e,isHorizontal:this.isHorizontal,speed:r.config.chart.animations.dynamicAnimation.speed})}c.add(b)}return c}renderSeries({realIndex:t,pathFill:e,lineFill:i,j:s,i:a,columnGroupIndex:r,pathFrom:n,pathTo:o,strokeWidth:l,elSeries:h,x:c,y:d,y1:u,y2:g,series:f,barHeight:m,barWidth:x,barXPosition:b,barYPosition:y,elDataLabelsWrap:w,elGoalsMarkers:v,elBarShadows:_,visibleSeries:A,type:S,classes:C}){var k,M,L,E,R,D,F;const X=this.w,T=new I(this.w,this.ctx),z=Oe(this.ctx,T);let Y=!1;const W=this._pathToInterp;if(this._pathToInterp=null,h._bindingsDelegated||(h._bindingsDelegated=!0,T.setupEventDelegation(h,`.apexcharts-${S}-area`)),!i){let e=function(t){const e=X.config.stroke.colors;let i;return Array.isArray(e)&&e.length>0&&(i=e[t],i||(i=""),"function"==typeof i)?i({value:X.seriesData.series[t][s],dataPointIndex:s,w:X}):i};const a="function"==typeof X.globals.stroke.colors[t]?e(t):X.globals.stroke.colors[t];i=this.barOptions.distributed?X.globals.stroke.colors[s]:a}const O=X.config.chart.animations,B=O.animateGradually;let $=0,N=0;if(B&&!1!==B.enabled&&!(X.globals.dataChanged&&this.isLayoutShift(t))){const t=X.globals.dataPoints||1,e=B.delay||0,i=Math.min(e,.5*O.speed/Math.max(1,t));N=p({style:"sequential",index:s,baseDelay:i}),X.config.chart.stacked&&!X.globals.dataChanged&&(N+=a*i*.5);$=N/(e||1)}const H=new Si(this).handleBarDataLabels({x:c,y:d,y1:u,y2:g,i:a,j:s,series:f,realIndex:t,columnGroupIndex:r,barHeight:m,barWidth:x,barXPosition:b,barYPosition:y,visibleSeries:A});if(N>0){const t=X.config.dataLabels;if((null==(k=t.animate)?void 0:k.enabled)||(null==(M=t.countUp)?void 0:M.enabled)){const t=String(Math.round(N));null==(E=null==(L=H.dataLabels)?void 0:L.node)||E.setAttribute("data:dlDelay",t),null==(D=null==(R=H.totalDataLabels)?void 0:R.node)||D.setAttribute("data:dlDelay",t)}}if(X.globals.isBarHorizontal||(H.dataLabelsPos.dataLabelsX+Math.max(x,X.globals.barPadForNumericAxis)<0||H.dataLabelsPos.dataLabelsX-Math.max(x,X.globals.barPadForNumericAxis)>X.layout.gridWidth)&&(Y=!0),X.config.series[a].data[s]&&X.config.series[a].data[s].strokeColor&&(i=X.config.series[a].data[s].strokeColor),this.isNullValue&&-1===X.globals.collapsingSeriesIndices.indexOf(t)&&(e="none"),!Y){const r=!0===(null==(F=this.ctx.morphTypeChange)?void 0:F.isActive()),c=r?this.ctx.morphTypeChange.getSpeed():X.config.chart.animations.dynamicAnimation.speed,d=r&&this.ctx.morphTypeChange.claimsTargetMark(t,s);d&&(n=o,$=0);const p=z.renderPaths({i:a,j:s,realIndex:t,pathFrom:n,pathTo:o,stroke:i,strokeWidth:l,strokeLineCap:X.config.stroke.lineCap,fill:e,pathToInterp:W,animationDelay:$,initialSpeed:X.config.chart.animations.speed,dataChangeSpeed:c,className:`apexcharts-${S}-area${C?` ${C}`:""}`,chartType:S,bindEventsOnPaths:!1});p.attr("clip-path",`url(#gridRectBarMask${X.globals.cuid})`),d&&(p.node.setAttribute("opacity","0"),p.node.setAttribute("data-piece-hidden","1"));const f=X.config.forecastDataPoints;f.count>0&&s>=X.globals.dataPoints-f.count&&(p.node.setAttribute("stroke-dasharray",f.dashArray),p.node.setAttribute("stroke-width",f.strokeWidth),p.node.setAttribute("fill-opacity",f.fillOpacity)),void 0!==u&&void 0!==g&&(p.attr("data-range-y1",u),p.attr("data-range-y2",g));new P(this.w).setSelectionFilter(p,t,s),h.add(p),p.attr({cy:H.dataLabelsPos.bcy,cx:H.dataLabelsPos.bcx,j:s,val:X.seriesData.series[a][s],barHeight:m,barWidth:x,"data:pathKey":xi(X,t,s)}),"canvas"===z.kind&&(X.globals.barCanvasCoords||(X.globals.barCanvasCoords={}),X.globals.barCanvasCoords[t]||(X.globals.barCanvasCoords[t]={}),X.globals.barCanvasCoords[t][s]={cx:H.dataLabelsPos.bcx,cy:H.dataLabelsPos.bcy,barWidth:x}),null!==H.dataLabels&&w.add(H.dataLabels),H.totalDataLabels&&w.add(H.totalDataLabels),h.add(w),v&&h.add(v),_&&h.add(_)}return h}drawBarPaths({indexes:t,barHeight:e,strokeWidth:i,zeroW:s,x:a,y:r,yDivision:n,elSeries:o}){const l=this.w,h=t.i,c=t.j;let d;if(l.axisFlags.isXNumeric)d=(r=(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:i}=this.barHelpers.getZeroValueEncounters({i:h,j:c});t>0&&(e=this.seriesLen*e/t),d=r+e*this.visibleI,d-=e*i}else d=r+e*this.visibleI;const u=this.isFunnel&&"trapezoid"===l.config.plotOptions.funnel.shape,p=this.isPyramid&&this.pyramidLayout?this.pyramidLayout[c]:null,g=!!p;if(p)d=p.y,e=p.height;else if(this.isFunnel&&!u){const t=null!=s?s:0;s=t-(this.barHelpers.getXForValue(this.series[h][c],t)-t)/2}let f;return a=this.barHelpers.getXForValue(this.series[h][c],null!=s?s:0),f=p?this.barHelpers.getPyramidPaths({barYPosition:d,barHeight:e,topHalf:p.topHalf,bottomHalf:p.bottomHalf,realIndex:t.realIndex,j:c,strokeWidth:i,w:l}):u?this.barHelpers.getFunnelTrapezoidPaths({barYPosition:d,barHeight:e,series:this.series,i:h,j:c,realIndex:t.realIndex,strokeWidth:i,w:l}):this.barHelpers.getBarpaths({barYPosition:d,barHeight:e,x1:s,x2:a,strokeWidth:i,isReversed:this.isReversed,series:this.series,realIndex:t.realIndex,i:h,j:c,w:l}),(u||g)&&(s=f.x1,a=f.x),l.axisFlags.isXNumeric||g||(r+=n),g&&(r=d),this.barHelpers.barBackground({j:c,i:h,y1:d-e*this.visibleI,y2:e*this.seriesLen,elSeries:o}),{pathTo:f.pathTo,pathFrom:f.pathFrom,x1:s,x:a,y:r,goalX:this.barHelpers.getGoalValues("x",s,null,t.realIndex,c,0),barYPosition:d,barHeight:e}}drawColumnPaths({indexes:t,x:e,y:i,xDivision:s,barWidth:a,zeroH:r,strokeWidth:n,elSeries:o}){const l=this.w,h=t.realIndex,c=t.translationsIndex,d=t.i,u=t.j,p=t.bc;let g;if(l.axisFlags.isXNumeric){const t=this.getBarXForNumericXAxis({x:e,j:u,realIndex:h,barWidth:a});e=t.x,g=t.barXPosition}else if(l.config.plotOptions.bar.hideZeroBarsWhenGrouped){const{nonZeroColumns:t,zeroEncounters:i}=this.barHelpers.getZeroValueEncounters({i:d,j:u});t>0&&(a=this.seriesLen*a/t),g=e+a*this.visibleI,g-=a*i}else g=e+a*this.visibleI;i=this.barHelpers.getYForValue(this.series[d][u],r,c);const f=this.barHelpers.getColumnPaths({barXPosition:g,barWidth:a,y1:r,y2:i,strokeWidth:n,isReversed:this.isReversed,series:this.series,realIndex:h,i:d,j:u,w:l});return l.axisFlags.isXNumeric||(e+=s),this.barHelpers.barBackground({bc:p,j:u,i:d,x1:g-n/2-a*this.visibleI,x2:a*this.seriesLen+n/2,elSeries:o}),{pathTo:f.pathTo,pathFrom:f.pathFrom,x:e,y:i,goalY:this.barHelpers.getGoalValues("y",null,r,h,u,c),barXPosition:g,barWidth:a}}getBarXForNumericXAxis({x:t,barWidth:e,realIndex:i,j:s}){const a=this.w;let r=i;return a.seriesData.seriesX[i].length||(r=a.globals.maxValsInArrayIndex),Ht.isNumber(a.seriesData.seriesX[r][s])&&(t=ne.dataXToPx(a,a.seriesData.seriesX[r][s])-e*this.seriesLen/2),{barXPosition:t+(Ci(a)?0:e*this.visibleI),x:t}}_prevRecord(t){const e=this.w;let i=null;for(let s=0;s<e.globals.previousPaths.length;s++){const a=e.globals.previousPaths[s];a.paths&&a.paths.length>0&&parseInt(a.realIndex,10)===parseInt(String(t),10)&&(i=a)}return i}_prevKeyedPaths(t){if(this._prevKeyed||(this._prevKeyed={}),void 0!==this._prevKeyed[t])return this._prevKeyed[t];const e=this._prevRecord(t);let i=null;if(e&&e.paths.every(t=>null!=t.key)){const t=new Map;e.paths.forEach(e=>{t.set(e.key,e)}),i=t}return this._prevKeyed[t]=i,i}isLengthTransition(t){var e,i;if(this._ltCache||(this._ltCache={}),void 0!==this._ltCache[t])return this._ltCache[t];const s=this.w;let a=!1;if(mi(s)&&s.globals.previousPaths.length>0){const r=this._prevRecord(t),n=null!=(i=null==(e=s.seriesData.series[t])?void 0:e.length)?i:0;if(r)if(r.paths.length!==n)a=!0;else{const e=this._prevKeyedPaths(t);if(e)for(let i=0;i<n;i++)if(!e.has(xi(s,t,i))){a=!0;break}}else a=n>0}return this._ltCache[t]=a,a}isLayoutShift(t){if(this.isLengthTransition(t))return!0;if(this._layoutShiftCache||(this._layoutShiftCache={}),void 0!==this._layoutShiftCache[t])return this._layoutShiftCache[t];const e=yi(this.w,t,!0,!0),i=!(!e||!e.join.changed);return this._layoutShiftCache[t]=i,i}getPreviousPath(t,e,i,s){const a=this.w;this._pathToInterp=null;const r=this._prevRecord(t);if(!r)return mi(a)?null:i;let n=null,o=!1;const l=this._prevKeyedPaths(t);if(l){const i=l.get(xi(a,t,e));i?n=i.d:o=!0}else void 0!==r.paths[e]?n=r.paths[e].d:o=!0;if(n){const t=Mi.pathCommandCount(n),e=Mi.pathCommandCount(i);if(t===e)return n;const r=new I(a),o=t=>{const e=Mi.pathBox(t);return e?Math.min(e.maxX-e.minX,e.maxY-e.minY):0},l=t<e?o(n)>1:o(i)>1;if(t<e){const t=r.roundPathCorners(n,0);if(Mi.pathCommandCount(t)===e){if(l&&s){const t=r.roundPathCorners(s,0);Mi.pathCommandCount(t)===e&&(this._pathToInterp=t)}return t}}else{const e=r.roundPathCorners(i,0);if(Mi.pathCommandCount(e)===t){if(this._pathToInterp=e,l){const e=Mi.squareLike(n),i=e?r.roundPathCorners(e,0):null;if(i&&Mi.pathCommandCount(i)===t)return i}return n}}}return o&&mi(a)?null:i}static pathBox(t){if(!t)return null;const e=[],i=/([MLC])([^MLCZz]*)/g;let s;for(;null!==(s=i.exec(t));){const t=s[2].trim().split(/[\s,]+/).map(Number);t.length<2||t.some(isNaN)||e.push([t[t.length-2],t[t.length-1]])}if(e.length<3)return null;const a=e.map(t=>t[0]),r=e.map(t=>t[1]);return{minX:Math.min(...a),maxX:Math.max(...a),minY:Math.min(...r),maxY:Math.max(...r),start:e[0],vertical:Math.abs(e[1][0]-e[0][0])<Math.abs(e[1][1]-e[0][1])}}static squareLike(t){const e=Mi.pathBox(t);if(!e)return null;const{minX:i,maxX:s,minY:a,maxY:r,start:n,vertical:o}=e,l=(t,e,i)=>Math.abs(t-e)<=Math.abs(t-i)?[e,i]:[i,e];let h,c,d,u;o?(h=Math.abs(n[0]-i)<=Math.abs(n[0]-s)?i:s,c=h===i?s:i,[d,u]=l(n[1],a,r)):(d=Math.abs(n[1]-a)<=Math.abs(n[1]-r)?a:r,u=d===a?r:a,[h,c]=l(n[0],i,s));const p=t.trim().endsWith("Z")?" Z":" z";return o?`M ${h} ${d} L ${h} ${u} L ${c} ${u} L ${c} ${d}${p}`:`M ${h} ${d} L ${c} ${d} L ${c} ${u} L ${h} ${u}${p}`}getPreviousFlip(t,e){const i=this.w,s=this._prevRecord(t);if(!s)return null;const a=this._prevKeyedPaths(t),r=a?a.get(xi(i,t,e)):s.paths[e];return r?!!r.flip:null}static pathCommandCount(t){if(!t)return 0;const e=t.match(/[A-Za-z]/g);return e?e.length:0}}function Pi({w:t,points:e,seedA:i,seedB:s,center:a,halfExtent:r,alongFn:n,isHorizontal:o,options:l,clampAt:h}){const c=l;if(!c||!1===c.show)return[];if(!e||!e.length)return[];const d=c.maxPoints||3e3,u=e.length>d?Math.ceil(e.length/d):1,p=null!=c.size?c.size:2.5,g=r*(null!=c.jitter?c.jitter:.5),f=!1!==c.constrainToViolin&&"function"==typeof h,m="square"===c.shape,x=c.colorScale,b=x&&Array.isArray(x.colors)&&x.colors.length>0,y=b?Math.max(2,x.steps||24):1,w=b&&null!=x.min?x.min:t.globals.minY,v=(b&&null!=x.max?x.max:t.globals.maxY)-w||1,_=b?new Array(y).fill(""):[""];for(let t=0;t<e.length;t+=u){const r=e[t],l=n(r);let c=2*(Ri(7919*i+100003*s+t)-.5)*g;if(f){const t=h(r);c>t&&(c=t),c<-t&&(c=-t)}const d=o?l:a+c,u=o?a+c:l,x=m?Fi(d,u,p):Di(d,u,p);if(b){let t=(r-w)/v;t<0&&(t=0),t>1&&(t=1),_[Math.round(t*(y-1))]+=x}else _[0]+=x}if(!b)return _[0]?[{fill:null,d:_[0]}]:[];const A=[];for(let t=0;t<y;t++)_[t]&&A.push({fill:Ei(x.colors,t/(y-1)),d:_[t]});return A}function Li({graphics:t,w:e,elSeries:i,pointsByCat:s,options:a,distributed:r,realIndex:n,wrapClass:o,pointClass:l}){if(!a||!1===a.show||!s.length)return;const h=null!=a.opacity?a.opacity:.9,c=null!=a.strokeColor?a.strokeColor:"#fff",d=null!=a.strokeWidth?a.strokeWidth:1,u=e.config.chart.animations.enabled&&!e.globals.resized&&!e.globals.dataChanged,p=t.group({class:u?`${o} apexcharts-element-hidden`:o});u&&e.globals.delayedElements.push({el:p.node}),s.forEach(({groups:i,j:s})=>{const o=r?e.globals.colors[s]:e.globals.colors[n],u=a.fillColor,g="series"===u?o:"series-dark"===u?Ii(o,.45):u||Ii(o,.45);i.forEach(i=>{const a=t.drawPath({d:i.d,fill:null!=i.fill?i.fill:g,stroke:d>0?c:"none",strokeWidth:d,fillOpacity:h,classes:l});a.attr("data:realIndex",n),a.attr("j",s),a.attr("clip-path",`url(#gridRectBarMask${e.globals.cuid})`),a.node.style.pointerEvents="none",p.add(a)})}),i.add(p)}function Ii(t,e){const i=Ht.parseHex(t);if(!i)return t;const s=Math.max(0,1-e);return`rgb(${Math.round(i[0]*s)},${Math.round(i[1]*s)},${Math.round(i[2]*s)})`}function Ei(t,e){if(!t.length)return"#000";if(1===t.length)return t[0];const i=Math.max(0,Math.min(1,e))*(t.length-1),s=Math.floor(i),a=i-s,r=Ht.parseHex(t[s])||[0,0,0],n=Ht.parseHex(t[Math.min(s+1,t.length-1)])||r,o=(t,e)=>Math.round(t+(e-t)*a);return`rgb(${o(r[0],n[0])},${o(r[1],n[1])},${o(r[2],n[2])})`}function Ri(t){let e=(2654435769^t)>>>0;return e=Math.imul(e^e>>>16,73244475),e=Math.imul(e^e>>>16,73244475),((e^e>>>16)>>>0)/4294967296}function Di(t,e,i){return`M ${t-i} ${e} a ${i} ${i} 0 1 0 ${2*i} 0 a ${i} ${i} 0 1 0 ${-2*i} 0 `}function Fi(t,e,i){return`M ${t-i} ${e-i} h ${2*i} v ${2*i} h ${-2*i} z `}class Xi extends Mi{draw(t,e,i){var s;const a=this.w,r=new I(this.w),n=a.globals.comboCharts?e:a.config.chart.type,h=new M(this.w);this.candlestickOptions=this.w.config.plotOptions.candlestick,this.boxOptions=this.w.config.plotOptions.boxPlot,this.isHorizontal=a.config.plotOptions.bar.horizontal,this.isOHLC=this.candlestickOptions&&"ohlc"===this.candlestickOptions.type,this.coreUtils=new _(this.w),t=this.coreUtils.getLogSeries(t),this.series=t,this.yRatio=this.coreUtils.getLogYRatios(this.yRatio),this.barHelpers.initVariables(t);const c=r.group({class:`apexcharts-${n}-series apexcharts-plot-series`});for(let e=0;e<t.length;e++){let n,d;this.isBoxPlot="boxPlot"===a.config.chart.type||"boxPlot"===a.config.series[e].type;const u=[],p=[],g=a.globals.comboCharts?i[e]:e,{columnGroupIndex:f}=this.barHelpers.getGroupIndex(g),m=r.group({class:"apexcharts-series",seriesName:Ht.escapeString(a.seriesData.seriesNames[g]),rel:e+1,"data:realIndex":g});X.addCollapsedClassToSeries(this.w,m,g),t[e].length>0&&(this.visibleI=this.visibleI+1);let x=0;this.yRatio.length>1&&(this.yaxisIndex=a.globals.seriesYAxisReverseMap[g][0],x=g);const b=this.barHelpers.initialPositions(g),{y:y,barHeight:w,yDivision:v,zeroW:_,x:A,barWidth:S,xDivision:C,zeroH:k}=b;d=y,n=A,p.push(n+(null!=S?S:0)/2);const M=r.group({class:"apexcharts-datalabels","data:realIndex":g}),P=r.group({class:"apexcharts-bar-goals-markers"}),L=this.isBoxPlot?this.boxOptions.points:null,I=[],E=a.layout.gridWidth,R=null!=S?S:0;for(let i=0;i<a.globals.dataPoints;i++){const r=this.barHelpers.getStrokeWidth(e,i,g);let c=null;const b={indexes:{i:e,j:i,realIndex:g,translationsIndex:x},x:n,y:d,strokeWidth:r,elSeries:m};if(c=this.isHorizontal?this.drawHorizontalBoxPaths(l(o({},b),{yDivision:v,barHeight:w,zeroW:_})):this.drawVerticalBoxPaths(l(o({},b),{xDivision:C,barWidth:S,zeroH:k,cullBounds:{lo:-R,hi:E+R}})),d=c.y,n=c.x,i>0&&p.push(n+(null!=S?S:0)/2),u.push(d),c.culled)continue;const y=this.barHelpers.drawGoalLine({barXPosition:c.barXPosition,barYPosition:c.barYPosition,goalX:c.goalX,goalY:c.goalY,barHeight:w,barWidth:S});if(y&&P.add(y),c.pathTo.forEach((s,o)=>{const l=!this.isBoxPlot&&this.candlestickOptions.wick.useFillColor?c.color[o]:a.globals.stroke.colors[e],u=h.fillPath({seriesNumber:g,dataPointIndex:i,color:c.color[o],value:t[e][i]});this.renderSeries({realIndex:g,pathFill:u,lineFill:l,j:i,i:e,pathFrom:c.pathFrom,pathTo:s,strokeWidth:r,elSeries:m,x:n,y:d,series:t,columnGroupIndex:f,barHeight:w,barWidth:S,elDataLabelsWrap:M,elGoalsMarkers:P,visibleSeries:this.visibleI,type:a.config.chart.type})}),L&&!1!==L.show){const t=null==(s=a.candleData.seriesBoxPoints[g])?void 0:s[i];if(t&&t.length){const e=t=>this.coreUtils.getLogValAtSeriesIndex(t,g);let s,r,n;if(this.isHorizontal){const t=this.invertedYRatio,i=null!=w?w:0,a=null!=_?_:0;s=c.barYPosition+i/2,r=i/2,n=i=>a+e(i)/t}else{const t=this.yRatio[x],i=null!=S?S:0,a=null!=k?k:0;s=c.barXPosition+i/2,r=i/2,n=i=>a-e(i)/t}const o=Pi({w:a,points:t,seedA:g,seedB:i,center:s,halfExtent:r,alongFn:n,isHorizontal:this.isHorizontal,options:L});o.length&&I.push({groups:o,j:i})}}}L&&Li({graphics:r,w:a,elSeries:m,pointsByCat:I,options:L,distributed:a.config.plotOptions.bar.distributed,realIndex:g,wrapClass:"apexcharts-boxPlot-points-wrap",pointClass:"apexcharts-boxPlot-points"}),a.globals.seriesXvalues[g]=p,a.globals.seriesYvalues[g]=u,c.add(m)}return c}drawVerticalBoxPaths({indexes:t,x:e,xDivision:i,barWidth:s,zeroH:a,strokeWidth:r,cullBounds:n=null}){var o,l,h,c;const d=this.w,u=new I(this.w),p=t.i,g=t.j,{colors:f}=d.config.plotOptions.candlestick,{colors:m}=this.boxOptions,x=t.realIndex,b=t=>Array.isArray(t)?t[x]:t,y=b(f.upward),w=b(f.downward),v=this.yRatio[t.translationsIndex],_=this.getOHLCValue(x,g);let A=a,S=a,C=_.o<_.c?[y]:[w];this.isBoxPlot&&(C=[b(m.lower),b(m.upper)]);let k=Math.min(_.o,_.c),M=Math.max(_.o,_.c),P=_.m;d.axisFlags.isXNumeric&&(e=(d.seriesData.seriesX[x][g]-d.globals.minX)/this.xRatio-s/2);const L=e+s*this.visibleI;if(void 0===(null==(o=this.series[p])?void 0:o[g])||null===(null==(l=this.series[p])?void 0:l[g])?(k=a,M=a):(k=a-k/v,M=a-M/v,A=a-_.h/v,S=a-_.l/v,P=a-_.m/v),n&&(L+s<n.lo||L>n.hi))return{pathTo:null,pathFrom:null,x:d.axisFlags.isXNumeric?e:e+i,y:M,barXPosition:L,color:C,culled:!0};let E;if(this.isOHLC){const t=L+s/2,e=a-_.o/v,i=a-_.c/v;E=[u.move(t,A)+u.line(t,S)+u.move(t,e)+u.line(L,e)+u.move(t,i)+u.line(L+s,i)]}else E=this.isBoxPlot?[u.move(L,k)+u.line(L+s/2,k)+u.line(L+s/2,A)+u.line(L+s/4,A)+u.line(L+s-s/4,A)+u.line(L+s/2,A)+u.line(L+s/2,k)+u.line(L+s,k)+u.line(L+s,P)+u.line(L,P)+u.line(L,k+r/2),u.move(L,P)+u.line(L+s,P)+u.line(L+s,M)+u.line(L+s/2,M)+u.line(L+s/2,S)+u.line(L+s-s/4,S)+u.line(L+s/4,S)+u.line(L+s/2,S)+u.line(L+s/2,M)+u.line(L,M)+u.line(L,P)+"z"]:[u.move(L,M)+u.line(L+s/2,M)+u.line(L+s/2,A)+u.line(L+s/2,M)+u.line(L+s,M)+u.line(L+s,k)+u.line(L+s/2,k)+u.line(L+s/2,S)+u.line(L+s/2,k)+u.line(L,k)+u.line(L,M-r/2)];let R=null;const D=null==(c=null==(h=this.ctx)?void 0:h.morphTypeChange)?void 0:c.getInitialPathFor(x,g);return D?R=D:d.globals.previousPaths.length>0&&(R=this.getPreviousPath(x,g,E[0])),null==R&&(R=u.move(L+s/2,k)+u.move(L,k)),d.axisFlags.isXNumeric||(e+=i),{pathTo:E,pathFrom:R,x:e,y:M,goalY:this.barHelpers.getGoalValues("y",null,a,x,g,t.translationsIndex),barXPosition:L,color:C}}drawHorizontalBoxPaths({indexes:t,y:e,yDivision:i,barHeight:s,zeroW:a,strokeWidth:r}){var n,o,l,h;const c=this.w,d=new I(this.w),u=t.i,p=t.j,g=t.realIndex,{colors:f}=c.config.plotOptions.candlestick,{colors:m}=this.boxOptions,x=t=>Array.isArray(t)?t[g]:t,b=this.invertedYRatio,y=this.getOHLCValue(g,p);let w=y.o<y.c?[x(f.upward)]:[x(f.downward)];this.isBoxPlot&&(w=[x(m.lower),x(m.upper)]);let v=a,_=a,A=Math.min(y.o,y.c),S=Math.max(y.o,y.c),C=y.m;c.axisFlags.isXNumeric&&(e=(c.seriesData.seriesX[g][p]-c.globals.minX)/this.invertedXRatio-s/2);const k=e+s*this.visibleI;void 0===(null==(n=this.series[u])?void 0:n[p])||null===(null==(o=this.series[u])?void 0:o[p])?(A=a,S=a):(A=a+A/b,S=a+S/b,v=a+y.h/b,_=a+y.l/b,C=a+y.m/b);const M=[d.move(A,k)+d.line(A,k+s/2)+d.line(v,k+s/2)+d.line(v,k+s/2-s/4)+d.line(v,k+s/2+s/4)+d.line(v,k+s/2)+d.line(A,k+s/2)+d.line(A,k+s)+d.line(C,k+s)+d.line(C,k)+d.line(A+r/2,k),d.move(C,k)+d.line(C,k+s)+d.line(S,k+s)+d.line(S,k+s/2)+d.line(_,k+s/2)+d.line(_,k+s-s/4)+d.line(_,k+s/4)+d.line(_,k+s/2)+d.line(S,k+s/2)+d.line(S,k)+d.line(C,k)+"z"];let P=null;const L=null==(h=null==(l=this.ctx)?void 0:l.morphTypeChange)?void 0:h.getInitialPathFor(g,p);return L?P=L:c.globals.previousPaths.length>0&&(P=this.getPreviousPath(g,p,M[0])),null==P&&(P=d.move(A,k+s/2)+d.move(A,k)),c.axisFlags.isXNumeric||(e+=i),{pathTo:M,pathFrom:P,x:S,y:e,goalX:this.barHelpers.getGoalValues("x",a,null,g,p,0),barYPosition:k,color:w}}getOHLCValue(t,e){const i=this.w,s=this.coreUtils,a=i=>i[t]&&null!=i[t][e]?s.getLogValAtSeriesIndex(i[t][e],t):0,r=a(i.candleData.seriesCandleH),n=a(i.candleData.seriesCandleO),o=a(i.candleData.seriesCandleM),l=a(i.candleData.seriesCandleC),h=a(i.candleData.seriesCandleL);return{o:this.isBoxPlot?r:n,h:this.isBoxPlot?n:r,m:o,l:this.isBoxPlot?l:h,c:this.isBoxPlot?h:l}}}const Ti=t=>{const e=function(t){const e=[];let i=t[0],s=t[1],a=e[0]=Wi(i,s),r=1;for(let n=t.length-1;r<n;r++)i=s,s=t[r+1],e[r]=.5*(a+(a=Wi(i,s)));return e[r]=a,e}(t),i=t.length-1,s=[];let a,r,n,o;for(let s=0;s<i;s++)n=Wi(t[s],t[s+1]),Math.abs(n)<1e-6?e[s]=e[s+1]=0:(a=e[s]/n,r=e[s+1]/n,o=a*a+r*r,o>9&&(o=3*n/Math.sqrt(o),e[s]=o*a,e[s+1]=o*r));for(let a=0;a<=i;a++)o=(t[Math.min(i,a+1)][0]-t[Math.max(0,a-1)][0])/(6*(1+e[a]*e[a])),s.push([o||0,e[a]*o||0]);return s},zi=t=>{let e="";for(let i=0;i<t.length;i++){const s=t[i],a=s.length;a>4?(e+=`C${s[0]}, ${s[1]}`,e+=`, ${s[2]}, ${s[3]}`,e+=`, ${s[4]}, ${s[5]}`):a>2&&(e+=`S${s[0]}, ${s[1]}`,e+=`, ${s[2]}, ${s[3]}`)}return e},Yi={points(t){const e=Ti(t),i=t[1],s=t[0],a=[],r=e[1],n=e[0];a.push(s,[s[0]+n[0],s[1]+n[1],i[0]-r[0],i[1]-r[1],i[0],i[1]]);for(let i=2,s=e.length;i<s;i++){const s=t[i],r=e[i];a.push([s[0]-r[0],s[1]-r[1],s[0],s[1]])}return a},slice(t,e,i){const s=t.slice(e,i);if(e){if(i-e>1&&s[1].length<6){const t=s[0].length;s[1]=[2*s[0][t-2]-s[0][t-4],2*s[0][t-1]-s[0][t-3]].concat(s[1])}s[0]=s[0].slice(-2)}return s}};function Wi(t,e){return(e[1]-t[1])/(e[0]-t[0])}function Oi(t){const e=[];for(let i=0;i<t.length;i+=2)e.push(t[i+1],t[i]);return e}class Bi{constructor(t,e){this.ctx=e,this.w=t}checkColorRange(){const t=this.w;let e=!1;const i=t.config.plotOptions[t.config.chart.type];return i.colorScale.ranges.length>0&&i.colorScale.ranges.map(t=>{t.from<=0&&(e=!0)}),e}getShadeColor(t,e,i,s){const a=this.w;let r=1;const n=a.config.plotOptions[t].shadeIntensity,o=this.determineColor(t,e,i);a.globals.hasNegs||s?r=a.config.plotOptions[t].reverseNegativeShade?o.percent<0?o.percent/100*(1.25*n):(1-o.percent/100)*(1.25*n):o.percent<=0?1-(1+o.percent/100)*n:(1-o.percent/100)*n:(r=1-o.percent/100,"treemap"===t&&(r=(1-o.percent/100)*(1.25*n)));let l=o.color;const h=new Ht;if(a.config.plotOptions[t].enableShades)if("dark"===this.w.config.theme.mode){const t=h.shadeColor(-1*r,o.color);l=Ht.hexToRgba(Ht.isColorHex(t)?t:Ht.rgb2hex(t),a.config.fill.opacity)}else{const t=h.shadeColor(r,o.color);l=Ht.hexToRgba(Ht.isColorHex(t)?t:Ht.rgb2hex(t),a.config.fill.opacity)}return{color:l,colorProps:o}}determineColor(t,e,i){const s=this.w,a=s.seriesData.series[e][i],r=s.config.plotOptions[t];let n=r.colorScale.inverse?i:e;r.distributed&&"treemap"===s.config.chart.type&&(n=i);let o,l,h=s.globals.colors[n],c=null;if(r.distributed||"heatmap"!==t){const t=s.seriesData.series[e];o=t.length?t[0]:0,l=o;for(let e=1;e<t.length;e++)t[e]<o&&(o=t[e]),t[e]>l&&(l=t[e])}else o=s.globals.minY,l=s.globals.maxY;const d=r.colorScale.min,u=r.colorScale.max;void 0!==d&&void 0!==u&&u>d?(o=d,l=u):void 0!==d&&(o=d<s.globals.minY?d:s.globals.minY,l=u>s.globals.maxY?u:s.globals.maxY);const p=Math.abs(l)+Math.abs(o),g=Math.min(Math.max(a,o),l);let f=0===p?0:100*g/p;if(r.colorScale.ranges.length>0){r.colorScale.ranges.map(t=>{if(a>=t.from&&a<=t.to){h=t.color,c=t.foreColor?t.foreColor:null,o=t.from,l=t.to;const e=Math.abs(l)+Math.abs(o);f=0===e?0:100*a/e}})}return{color:h,foreColor:c,percent:f}}calculateDataLabels({text:t,x:e,y:i,i:s,j:a,colorProps:r,fontSize:n}){const o=this.w,l=o.config.dataLabels,h=new I(this.w),c=new C(this.w,this.ctx);let d=null;if(l.enabled){d=h.group({class:"apexcharts-data-labels"});const u=ai(l.offsetX,o,s,a),p=ai(l.offsetY,o,s,a),g=e+u,f=i+parseFloat(l.style.fontSize)/3+p;c.plotDataLabelsText({x:g,y:f,text:t,i:s,j:a,color:r.foreColor,parent:d,fontSize:n,dataLabelsConfig:l})}return d}}class $i{constructor(t){this.w=t.w,this.lineCtx=t}sameValueSeriesFix(t,e){const i=this.w;if("gradient"===i.config.fill.type||"gradient"===i.config.fill.type[t]){if(new _(this.lineCtx.w).seriesHaveSameValues(t)){const i=e[t].slice();i[i.length-1]=i[i.length-1]+1e-6,e[t]=i}}return e}calculatePoints({series:t,realIndex:e,x:i,y:s,i:a,j:r,prevY:n}){const o=this.w,l=[],h=[];let c=this.lineCtx.categoryAxisCorrection+o.config.markers.offsetX;return o.axisFlags.isXNumeric&&(c=(o.seriesData.seriesX[e][0]-o.globals.minX)/this.lineCtx.xRatio+o.config.markers.offsetX),0===r&&(l.push(c),h.push(Ht.isNumber(t[a][0])?n+o.config.markers.offsetY:null)),l.push(i+o.config.markers.offsetX),h.push(Ht.isNumber(t[a][r+1])?s+o.config.markers.offsetY:null),{x:l,y:h}}checkPreviousPaths({pathFromLine:t,pathFromArea:e,realIndex:i}){const s=this.w;for(let a=0;a<s.globals.previousPaths.length;a++){const r=s.globals.previousPaths[a];("line"===r.type||"area"===r.type)&&r.paths.length>0&&parseInt(r.realIndex,10)===parseInt(i,10)&&("line"===r.type?(this.lineCtx.appendPathFrom=!1,t=s.globals.previousPaths[a].paths[0].d):"area"===r.type&&(this.lineCtx.appendPathFrom=!1,e=s.globals.previousPaths[a].paths[0].d,s.config.stroke.show&&s.globals.previousPaths[a].paths[1]&&(t=s.globals.previousPaths[a].paths[1].d)))}return{pathFromLine:t,pathFromArea:e}}determineFirstPrevY({i:t,realIndex:e,series:i,prevY:s,lineYPosition:a,translationsIndex:r}){var n,o,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==(n=this.w.config.series[e])?void 0:n.type)||"column"===(null==(o=this.w.config.series[e])?void 0:o.type));if(void 0!==(null==(l=i[t])?void 0:l[0])){if(c)if(t>0){const t=this.lineCtx.stackTopAt(e,0);a=void 0===t?this.lineCtx.zeroY:t}else a=this.lineCtx.zeroY;else a=this.lineCtx.zeroY;s=a-i[t][0]/this.lineCtx.yRatio[r]+2*(this.lineCtx.isReversed?i[t][0]/this.lineCtx.yRatio[r]:0)}else if(c&&t>0&&void 0===i[t][0])for(let e=t-1;e>=0;e--)if(null!==i[e][0]&&void 0!==i[e][0]){s=a=this.lineCtx.prevSeriesY[e][0];break}return{prevY:s,lineYPosition:a}}}const Ni=/[+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?/gi;function Hi(t,e){const{ax:i,bx:s,ay:a,by:r}=e,n=[],o=/([MmLlHhVvCcSsQqTtAaZz])([^MmLlHhVvCcSsQqTtAaZz]*)/g;let l;for(;null!==(l=o.exec(t));){const t=l[1].toUpperCase(),e=(l[2].match(Ni)||[]).map(parseFloat);if("Z"===t){n.push("z");continue}if("H"===t){for(const t of e)n.push(`H ${i*t+s}`);continue}if("V"===t){for(const t of e)n.push(`V ${a*t+r}`);continue}if("A"===t){for(let t=0;t+6<e.length;t+=7)n.push(`A ${e[t]} ${e[t+1]} ${e[t+2]} ${e[t+3]} ${e[t+4]} ${i*e[t+5]+s} ${a*e[t+6]+r}`);continue}const o=[];for(let t=0;t+1<e.length;t+=2)o.push(`${i*e[t]+s} ${a*e[t+1]+r}`);o.length&&n.push(`${t} ${o.join(" ")}`)}return n.join(" ")}class ji{constructor(t,e,i,s){this.ctx=e,this.w=t,this.xyRatios=i,this.xRatio=0,this.yRatio=[],this.zRatio=0,this.baseLineY=[],this.pointsChart=!("bubble"!==this.w.config.chart.type&&"scatter"!==this.w.config.chart.type)||s,this.scatter=new d(this.w,this.ctx),this.noNegatives=this.w.globals.minX===Number.MAX_VALUE,this.lineHelpers=new $i(this),this.markers=new E(this.w,this.ctx),this.prevSeriesY=[],this.prevSeriesYByX=new Map,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,this._elLastPointsWrap=null}draw(t,e,i,s){var a;const r=this.w,n=new I(this.w),h=r.globals.comboCharts?e:r.config.chart.type,c=n.group({class:`apexcharts-${h}-series apexcharts-plot-series`}),d=new _(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=[],this.prevSeriesYByX=new Map;const u=[];for(let e=0;e<t.length;e++){t=this.lineHelpers.sameValueSeriesFix(e,t);const a=r.globals.comboCharts?i[e]:e,n=this.yRatio.length>1?a:0;this._initSerieVariables(t,e,a);const c=[],d=[],p=[];let g=r.globals.padHorizontal+this.categoryAxisCorrection;const f=1,m=[],x=[];X.addCollapsedClassToSeries(this.w,this.elSeries,a),r.axisFlags.isXNumeric&&r.seriesData.seriesX.length>0&&(g=(r.seriesData.seriesX[a][0]-r.globals.minX)/this.xRatio),p.push(g);const b=g;let y;const w=b;let v=this.zeroY,_=this.zeroY;const A=0;v=this.lineHelpers.determineFirstPrevY({i:e,realIndex:a,series:t,prevY:v,lineYPosition:A,translationsIndex:n}).prevY,"monotoneCubic"===r.config.stroke.curve&&null===t[e][0]?c.push(null):c.push(v);const S=v;let C;"rangeArea"===h&&(C=this.lineHelpers.determineFirstPrevY({i:e,realIndex:a,series:s,prevY:_,lineYPosition:A,translationsIndex:n}),_=C.prevY,y=_,d.push(null!==c[0]?_:null));const k=this._calculatePathsFrom({type:h,series:t,i:e,realIndex:a,translationsIndex:n,prevX:w,prevY:v,prevY2:_}),M=[c[0]],P=[d[0]],L={type:h,series:t,realIndex:a,translationsIndex:n,i:e,x:g,y:f,pX:b,pY:S,pathsFrom:k,linePaths:m,areaPaths:x,seriesIndex:i,lineYPosition:A,xArrj:p,yArrj:c,y2Arrj:d,seriesRangeEnd:s},I=this._iterateOverDataPoints(l(o({},L),{iterations:"rangeArea"===h?t[e].length-1:void 0,isRangeStart:!0}));if("rangeArea"===h){const t=this._calculatePathsFrom({series:s,i:e,realIndex:a,prevX:w,prevY:_}),i=this._iterateOverDataPoints(l(o({},L),{series:s,xArrj:[g],yArrj:M,y2Arrj:P,pY:y,areaPaths:I.areaPaths,pathsFrom:t,iterations:s[e].length-1,isRangeStart:!1})),r=I.linePaths.length/2;for(let t=0;t<r;t++)I.linePaths[t]=i.linePaths[t+r]+I.linePaths[t];I.linePaths.splice(r),I.pathFromLine=i.pathFromLine+I.pathFromLine}else/z\s*$/i.test(I.pathFromArea)||(I.pathFromArea+="z");this._handlePaths({type:h,realIndex:a,i:e,paths:I}),this.markers.flushBatch(this.elPointsMain,a),this.elSeries.add(this.elPointsMain),this.elSeries.add(this.elDataLabelsWrap),u.push(this.elSeries)}if(void 0!==(null==(a=r.config.series[0])?void 0:a.zIndex)&&u.sort((t,e)=>Number(t.node.getAttribute("zIndex"))-Number(e.node.getAttribute("zIndex"))),r.config.chart.stacked)for(let t=u.length-1;t>=0;t--)c.add(u[t]);else for(let t=0;t<u.length;t++)c.add(u[t]);return c}_initSerieVariables(t,e,i){const s=this.w,a=new I(this.w);this.xDivision=s.layout.gridWidth/(s.globals.dataPoints-("on"===s.config.xaxis.tickPlacement?1:0)),this.strokeWidth=Array.isArray(s.config.stroke.width)?s.config.stroke.width[i]:s.config.stroke.width;let r=0;this.yRatio.length>1&&(this.yaxisIndex=s.globals.seriesYAxisReverseMap[i],r=i),this.isReversed=s.config.yaxis[this.yaxisIndex]&&s.config.yaxis[this.yaxisIndex].reversed,this.zeroY=s.layout.gridHeight-this.baseLineY[r]-(this.isReversed?s.layout.gridHeight:0)+(this.isReversed?2*this.baseLineY[r]:0),this.areaBottomY=this.zeroY,(this.zeroY>s.layout.gridHeight||"end"===s.config.plotOptions.area.fillTo)&&(this.areaBottomY=s.layout.gridHeight),this.categoryAxisCorrection=this.xDivision/2;const n=s.config.series[i];if(this.elSeries=a.group({class:"apexcharts-series",zIndex:void 0!==n.zIndex?n.zIndex:i,seriesName:Ht.escapeString(s.seriesData.seriesNames[i])}),this.elPointsMain=a.group({class:"apexcharts-series-markers-wrap","data:realIndex":i}),this.markers.resetSeriesWrapCache(),this._elLastPointsWrap=null,s.globals.hasNullValues){const t=this.markers.plotChartMarkers({pointsPos:{x:[0],y:[s.layout.gridHeight+s.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":i});const o=t[e].length===s.globals.dataPoints;this.elSeries.attr({"data:longestSeries":o,rel:e+1,"data:realIndex":i}),this.appendPathFrom=!0}_calculatePathsFrom({type:t,series:e,i:i,realIndex:s,translationsIndex:a,prevX:r,prevY:n,prevY2:o}){const l=this.w,h=new I(this.w);let c,d,u,p;if(null===e[i][0]){for(let t=0;t<e[i].length;t++)if(null!==e[i][t]){r=this.xDivision*t,n=this.zeroY-e[i][t]/this.yRatio[a],c=h.move(r,n),d=h.move(r,this.areaBottomY);break}}else c=h.move(r,n),"rangeArea"===t&&(c=h.move(r,o)+h.line(r,n)),d=h.move(r,this.areaBottomY)+h.line(r,n);if(u=h.move(0,this.areaBottomY)+h.line(0,this.areaBottomY),p=h.move(0,this.areaBottomY)+h.line(0,this.areaBottomY),l.globals.previousPaths.length>0){const t=this.lineHelpers.checkPreviousPaths({pathFromLine:u,pathFromArea:p,realIndex:s});u=t.pathFromLine,p=t.pathFromArea}return{prevX:r,prevY:n,linePath:c,areaPath:d,pathFromLine:u,pathFromArea:p}}_stackKey(t,e){if(!this.w.axisFlags.isXNumeric)return e;const i=this.w.seriesData.seriesX[t];return i?i[e]:void 0}stackTopAt(t,e){const i=this._stackKey(t,e);if(null!=i)return this.prevSeriesYByX.get(i)}_recordStackTops(t,e){const i=this.w;if(Array.isArray(e)&&-1===i.globals.collapsedSeriesIndices.indexOf(t)&&-1===i.globals.ancillaryCollapsedSeriesIndices.indexOf(t))for(let i=0;i<e.length;i++){const s=this._stackKey(t,i);if(null==s)continue;const a=e[i];Ht.isNumber(a)&&this.prevSeriesYByX.set(s,a)}}_handlePaths({type:t,realIndex:e,i:i,paths:s}){var a,r,n,h,c,d,u;const p=this.w,g=new I(this.w),f=Oe(this.ctx,g),m=new M(this.w);this.prevSeriesY.push(s.yArrj),this._recordStackTops(e,s.yArrj);let x=null;"line"!==t&&"area"!==t||!p.globals.dataChanged||(x=function(t,e,i,s){var a;const r=t.globals,n=r.prevStreamFrame;if(!n||!r.dataChanged||!(null==(a=t.axisFlags)?void 0:a.isXNumeric))return null;const o=n.seriesX[e],l=n.seriesY[e],h=t.seriesData.seriesX[e],c=t.seriesData.series[e];if(!(o&&l&&h&&c))return null;if(o.length<3||h.length<3)return null;let d=-1;for(let t=0;t<o.length;t++)if(o[t]===h[0]){d=t;break}if(-1===d)return null;const u=Math.min(o.length-d,h.length);if(u<2)return null;const p=h.length-u;if(0===d&&0===p)return null;for(let t=0;t<u;t++){if(o[d+t]!==h[t])return null;const e=l[d+t],i=c[t];if(e!==i&&(null!=e||null!=i))return null}const g=n.xPixels[e],f=n.yPixels[e];if(!g||!f)return null;let m=-1,x=-1;for(let t=0;t<u;t++)null!=g[d+t]&&null!=f[d+t]&&null!=i[t]&&null!=s[t]&&(-1===m&&(m=t),x=t);if(-1===m||x<=m)return null;const b=i[m],y=i[x],w=g[d+m],v=g[d+x];if(Math.abs(y-b)<1e-6)return null;const _=(v-w)/(y-b),A=w-_*b;if(!isFinite(_)||!isFinite(A))return null;if(Math.abs(_-1)>.02)return null;if(Math.abs(A)<.5)return null;let S=m,C=m;for(let t=m;t<=x;t++){const e=s[t];null!=e&&null!=f[d+t]&&(e<s[S]&&(S=t),e>s[C]&&(C=t))}let k=1,M=0;const P=s[S],L=s[C];if(Math.abs(L-P)>1e-6?(k=(f[d+C]-f[d+S])/(L-P),M=f[d+S]-k*P):M=f[d+S]-P,!isFinite(k)||!isFinite(M)||k<.2||k>5)return null;const I=Math.floor((m+x)/2);if(I!==m&&I!==x&&null!=i[I]&&null!=g[d+I]){const t=_*i[I]+A;if(Math.abs(t-g[d+I])>1.5)return null;if(null!=s[I]&&null!=f[d+I]){const t=k*s[I]+M;if(Math.abs(t-f[d+I])>1.5)return null}}return r.streamScrolled=!0,{ax:_,bx:A,ay:k,by:M}}(p,e,s.xArrj,s.yArrj));let b=null;x||"line"!==t&&"area"!==t||(b=_i(p,{type:t,realIndex:e,pathFromLine:s.pathFromLine,pathFromArea:s.pathFromArea,linePaths:s.linePaths,areaPaths:s.areaPaths})),p.globals.seriesXvalues[e]=s.xArrj,p.globals.seriesYvalues[e]=s.yArrj;const y=p.config.forecastDataPoints;if(y.count>0&&"rangeArea"!==t){const t=p.globals.seriesXvalues[e][p.globals.seriesXvalues[e].length-y.count-1],i=g.drawRect(t,0,p.layout.gridWidth,p.layout.gridHeight,0);p.dom.elForecastMask.appendChild(i.node);const s=g.drawRect(0,0,t,p.layout.gridHeight,0);p.dom.elNonForecastMask.appendChild(s.node)}this.pointsChart?vi(p,{elPointsMain:this.elPointsMain,realIndex:e,speed:p.config.chart.animations.dynamicAnimation.speed}):(p.globals.delayedElements.push({el:this.elPointsMain.node,index:e}),vi(p,{elPointsMain:this.elPointsMain,realIndex:e,speed:p.config.chart.animations.dynamicAnimation.speed}),yi(p,e)&&(null==(a=this.elDataLabelsWrap)?void 0:a.node)&&(this.elDataLabelsWrap.node.classList.add("apexcharts-element-hidden"),p.globals.delayedElements.push({el:this.elDataLabelsWrap.node,holdUntilComplete:!0})));const w={i:i,realIndex:e,animationDelay:i,initialSpeed:p.config.chart.animations.speed,dataChangeSpeed:p.config.chart.animations.dynamicAnimation.speed,className:`apexcharts-${t}`},v=s.numericXY,_="line"===t||"area"===t,A=_&&s.linePaths.length>1?[s.linePaths.join(" ")]:s.linePaths,S=_&&s.areaPaths.length>1?[s.areaPaths.join(" ")]:s.areaPaths;if("area"===t){const t=m.fillPath({seriesNumber:e});for(let e=0;e<S.length;e++){const i=f.renderPaths(l(o({},w),{pathFrom:x?Hi(s.areaPaths[e],x):null!=(n=null==(r=null==b?void 0:b.area)?void 0:r.from)?n:s.pathFromArea,pathTo:S[e],pathToNumeric:v?{xs:v.xs,ys:v.ys,closeY:v.areaCloseY}:void 0,pathToInterp:null==(h=null==b?void 0:b.area)?void 0:h.toInterp,scrollMorph:!!x,stroke:"none",strokeWidth:0,strokeLineCap:null,fill:t}));this.elSeries.add(i)}}if(p.config.stroke.show&&!this.pointsChart){let a=null;if("line"===t)a=m.fillPath({seriesNumber:e,i:i});else if("solid"===p.config.stroke.fill.type)a=p.globals.stroke.colors[e];else{const t=p.config.fill;p.config.fill=p.config.stroke.fill,a=m.fillPath({seriesNumber:e,i:i}),p.config.fill=t}for(let i=0;i<A.length;i++){let r=a;"rangeArea"===t&&(r=m.fillPath({seriesNumber:e}));const n=l(o({},w),{pathFrom:x?Hi(s.linePaths[i],x):null!=(d=null==(c=null==b?void 0:b.line)?void 0:c.from)?d:s.pathFromLine,pathTo:A[i],pathToNumeric:v?{xs:v.xs,ys:v.ys}:void 0,pathToInterp:null==(u=null==b?void 0:b.line)?void 0:u.toInterp,scrollMorph:!!x,stroke:a,strokeWidth:this.strokeWidth,strokeLineCap:p.config.stroke.lineCap,fill:"rangeArea"===t?r:"none"}),h=f.renderPaths(n);if(this.elSeries.add(h),h.attr("fill-rule","evenodd"),y.count>0&&"rangeArea"!==t){const t=f.renderPaths(n);t.node.setAttribute("stroke-dasharray",y.dashArray),y.strokeWidth&&t.node.setAttribute("stroke-width",y.strokeWidth),this.elSeries.add(t),t.attr("clip-path",`url(#forecastMask${p.globals.cuid})`),h.attr("clip-path",`url(#nonForecastMask${p.globals.cuid})`)}}}}_iterateOverDataPoints({type:t,series:e,iterations:i,realIndex:s,translationsIndex:a,i:r,x:n,y:o,pX:l,pY:h,pathsFrom:c,linePaths:d,areaPaths:u,seriesIndex:p,lineYPosition:g,xArrj:f,yArrj:m,y2Arrj:x,isRangeStart:b,seriesRangeEnd:y}){var w,v;const _=this.w,A=new I(this.w),S=this.yRatio;let{prevY:C,linePath:k,areaPath:M,pathFromLine:P,pathFromArea:L}=c;const E=Ht.isNumber(_.globals.minYArr[s])?_.globals.minYArr[s]:_.globals.minY;i||(i=_.globals.dataPoints>1?_.globals.dataPoints-1:_.globals.dataPoints);const R=(t,e)=>e-t/S[a]+2*(this.isReversed?t/S[a]:0);let D=o;const F=_.config.chart.stacked&&!_.globals.comboCharts||_.config.chart.stacked&&_.globals.comboCharts&&(!this.w.config.chart.stackOnlyBar||"bar"===(null==(w=this.w.config.series[s])?void 0:w.type)||"column"===(null==(v=this.w.config.series[s])?void 0:v.type));let X=_.config.stroke.curve;Array.isArray(X)&&(X=Array.isArray(p)?X[p[r]]:X[r]);let T,z=0;const Y=this.pointsChart?this._scatterJitterPx(s):null;if("straight"===X&&!this.pointsChart){const p=this._fastStraightPath({type:t,series:e,i:r,realIndex:s,translationsIndex:a,iterations:i,x:n,y:o,pX:l,pY:h,pathsFrom:c,linePaths:d,areaPaths:u,xArrj:f,yArrj:m,y2Arrj:x,stackSeries:F});if(p)return p}for(let a=0;a<i&&0!==e[r].length;a++){const c=void 0===e[r][a+1]||null===e[r][a+1];if(_.axisFlags.isXNumeric){let t=_.seriesData.seriesX[s][a+1];void 0===_.seriesData.seriesX[s][a+1]&&(t=_.seriesData.seriesX[s][i-1]),n=(t-_.globals.minX)/this.xRatio}else n+=this.xDivision;if(F)if(r>0&&_.globals.collapsedSeries.length<_.config.series.length-1){if((t=>{var e;for(let i=t;i>=0;i--){const t=null!=(e=null==p?void 0:p[i])?e:i;if(-1===_.globals.collapsedSeriesIndices.indexOf(t)&&-1===_.globals.ancillaryCollapsedSeriesIndices.indexOf(t))return i}return-1})(r-1)<0)g=this.zeroY;else{const t=this.stackTopAt(s,a+1);g=void 0===t?this.zeroY:t}}else g=this.zeroY;else g=this.zeroY;c?o=R(E,g):(o=R(e[r][a+1],g),"rangeArea"===t&&(D=R(y[r][a+1],g)));let w=n,v=o;if(Y){const t=100003*s+(a+1);Y.x&&(w=n+2*(Ri(7919*t+13)-.5)*Y.x),Y.y&&(v=o+2*(Ri(6271*t+97)-.5)*Y.y)}f.push(null===e[r][a+1]?null:w),!c||"smooth"!==_.config.stroke.curve&&"monotoneCubic"!==_.config.stroke.curve?(m.push(v),x.push(D)):(m.push(null),x.push(null));const S=this.lineHelpers.calculatePoints({series:e,x:w,y:v,realIndex:s,i:r,j:a,prevY:C}),I=this._createPaths({type:t,series:e,i:r,j:a,x:n,y:o,y2:D,xArrj:f,yArrj:m,y2Arrj:x,pX:l,pY:h,pathState:z,segmentStartX:T,linePath:k,areaPath:M,linePaths:d,areaPaths:u,curve:X,isRangeStart:b});u=I.areaPaths,d=I.linePaths,l=I.pX,h=I.pY,z=I.pathState,T=I.segmentStartX,M=I.areaPath,k=I.linePath,!this.appendPathFrom||_.globals.hasNullValues||"monotoneCubic"===X&&"rangeArea"===t||(P+=A.line(n,this.areaBottomY),L+=A.line(n,this.areaBottomY)),this.handleNullDataPoints(e,S,r,a,s),this._handleMarkersAndLabels({type:t,pointsPos:S,i:r,j:a,realIndex:s,isRangeStart:b})}return{yArrj:m,xArrj:f,pathFromArea:L,areaPaths:u,pathFromLine:P,linePaths:d,linePath:k,areaPath:M}}_handleMarkersAndLabels({type:t,pointsPos:e,isRangeStart:i,i:s,j:a,realIndex:r}){const n=this.w,o=new C(this.w,this.ctx);if(this.pointsChart)this.scatter.draw(this.elSeries,a,{realIndex:r,pointsPos:e,zRatio:this.zRatio,elParent:this.elPointsMain});else{!(!n.globals.dataChanged&&!n.globals.resized&&!n.globals.markers.batched)&&n.seriesData.series[s].length>1&&this.elPointsMain.node.classList.add("apexcharts-element-hidden");const t=this.markers.plotChartMarkers({pointsPos:e,seriesIndex:r,j:a+1});null!==t&&t!==this._elLastPointsWrap&&(this.elPointsMain.add(t),this._elLastPointsWrap=t)}const l=o.drawDataLabel({type:t,isRangeStart:i,pos:e,i:r,j:a+1});null!==l&&this.elDataLabelsWrap.add(l)}_scatterJitterPx(t){var e;const i=this.w,s=null==(e=i.config.plotOptions.scatter)?void 0:e.jitter;if(!s||!s.enabled||!s.x&&!s.y)return null;const a=i.axisFlags.isXNumeric&&this.xRatio?1/this.xRatio:this.xDivision,r=this.yRatio.length>1?t:0,n=this.yRatio[r]?1/this.yRatio[r]:0;return{x:(s.x||0)*a,y:(s.y||0)*n}}_fastStraightPath({type:t,series:e,i:i,realIndex:s,translationsIndex:a,iterations:r,x:n,y:o,pX:l,pY:h,pathsFrom:c,linePaths:d,areaPaths:u,xArrj:p,yArrj:g,y2Arrj:f,stackSeries:m}){const x=this.w;if("line"!==t&&"area"!==t)return null;if(x.globals.comboCharts||m)return null;if(x.config.dataLabels.enabled)return null;if(x.config.markers.discrete.length)return null;if(x.globals.markers.size[s]>0)return null;const b=e[i],y=b.length;if(!r||y<2||y-1!==r)return null;for(let t=0;t<=r;t++){const e=b[t];if(null==e)return null}const w=x.axisFlags.isXNumeric,v=w?x.seriesData.seriesX[s]:null;if(w&&(!v||v.length<y))return null;const _=this.yRatio[a],A=this.isReversed,S=this.zeroY,C=this.areaBottomY,k=this.xRatio,M=x.globals.minX,P=this.xDivision,L=x.config.markers.offsetX,I=x.config.markers.offsetY,E=this.appendPathFrom&&!x.globals.hasNullValues;let{pathFromLine:R,pathFromArea:D}=c;const F=this.ctx&&this.ctx.renderer,X=!(!F||!F.kind||"svg"===F.kind),T=!X||x.globals.dataChanged&&!!x.globals.prevStreamFrame,z=X?new Float64Array(y):null,Y=X?new Float64Array(y):null;z&&Y&&(z[0]=l,Y[0]=h),void 0===x.globals.pointsArray[s]&&(x.globals.pointsArray[s]=[]);const W=x.globals.pointsArray[s],O=v?(v[0]-M)/k+L:this.categoryAxisCorrection+L;W.push([O,c.prevY+I]);const B=T?new Array(r+1):[];T&&(B[0]="M "+l+" "+h);const $=T&&E?new Array(r):null;let N=n,H=l,j=h;for(let t=0;t<r;t++){v?H=(v[t+1]-M)/k:(N+=P,H=N);const e=b[t+1];j=S-e/_+2*(A?e/_:0),p.push(H),g.push(j),f.push(o),W.push([H+L,j+I]),T&&(B[t+1]=" L "+H+" "+j,$&&($[t]=" L "+H+" "+C)),z&&Y&&(z[t+1]=H,Y[t+1]=j)}let V="",G="";if(T&&(V=B.join(""),G=V+" L "+H+" "+C+" L "+l+" "+C+"z"),$){const t=$.join("");R+=t,D+=t}else!T&&E&&(R+=" L "+H+" "+C,D+=" L "+H+" "+C);return d.push(V),u.push(G),{yArrj:g,xArrj:p,pathFromArea:D,areaPaths:u,pathFromLine:R,linePaths:d,linePath:V,areaPath:G,numericXY:z?{xs:z,ys:Y,areaCloseY:C}:void 0}}_createPaths({type:t,series:e,i:i,j:s,x:a,y:r,xArrj:n,yArrj:o,y2:l,y2Arrj:h,pX:c,pY:d,pathState:u,segmentStartX:p,linePath:g,areaPath:f,linePaths:m,areaPaths:x,curve:b,isRangeStart:y}){const w=new I(this.w),v=this.areaBottomY,_="rangeArea"===t,A="rangeArea"===t&&y;switch(b){case"monotoneCubic":{const t=y?o:h,a=(t,e)=>t.map((t,i)=>[t,e[i]]).filter(t=>null!==t[1]),r=t=>{const e=[];let i=0;return t.forEach(t=>{null!==t?i++:i>0&&(e.push(i),i=0)}),i>0&&e.push(i),e},l=(t,e)=>{const i=r(t),s=[];for(let t=0,a=0;t<i.length;a+=i[t++])s[t]=Yi.slice(e,a,a+i[t]);return s};switch(u){case 0:if(null===t[s+1])break;u=1;case 1:if(!(_?n.length===e[i].length:s===e[i].length-2))break;case 2:{const e=y?n:n.slice().reverse(),i=y?t:t.slice().reverse(),s=a(e,i),r=s.length>1?Yi.points(s):s;let o=[];_&&(A?x=s:o=x.reverse());let h=0,c=0;if(l(i,r).forEach(t=>{h++;const e=zi(t),i=c;c+=t.length;const a=c-1;A?g=w.move(s[i][0],s[i][1])+e:_?g=w.move(o[i][0],o[i][1])+w.line(s[i][0],s[i][1])+e+w.line(o[a][0],o[a][1]):(g=w.move(s[i][0],s[i][1])+e,f=g+w.line(s[a][0],v)+w.line(s[i][0],v)+"z",x.push(f)),m.push(g)}),_&&h>1&&!A){const t=m.slice(h).reverse();m.splice(h),t.forEach(t=>m.push(t))}u=0;break}}break}case"smooth":{const t=.35*(a-c);if(null===e[i][s])u=0;else switch(u){case 0:if(p=c,g=A?w.move(c,h[s])+w.line(c,d):w.move(c,d),f=w.move(c,d),null===e[i][s+1]||void 0===e[i][s+1]){m.push(g),x.push(f);break}if(u=1,s<e[i].length-2){const e=w.curve(c+t,d,a-t,r,a,r);g+=e,f+=e;break}case 1:if(null===e[i][s+1])g+=A?w.line(c,l):w.move(c,d),f+=w.line(c,v)+w.line(p,v)+"z",m.push(g),x.push(f),u=-1;else{const n=w.curve(c+t,d,a-t,r,a,r);g+=n,f+=n,s>=e[i].length-2&&(A&&(g+=w.curve(a,r,a,r,a,l)+w.move(a,l)),f+=w.curve(a,r,a,r,a,v)+w.line(p,v)+"z",m.push(g),x.push(f),u=-1)}}c=a,d=r;break}default:{const t=(t,e,i)=>{let s="";switch(t){case"stepline":s=w.line(e,null,"H")+w.line(null,i,"V");break;case"linestep":s=w.line(null,i,"V")+w.line(e,null,"H");break;case"straight":s=w.line(e,i)}return s};if(null===e[i][s])u=0;else switch(u){case 0:if(p=c,g=A?w.move(c,h[s])+w.line(c,d):w.move(c,d),f=w.move(c,d),null===e[i][s+1]||void 0===e[i][s+1]){m.push(g),x.push(f);break}if(u=1,s<e[i].length-2){const e=t(b,a,r);g+=e,f+=e;break}case 1:if(null===e[i][s+1])g+=A?w.line(c,l):w.move(c,d),f+=w.line(c,v)+w.line(p,v)+"z",m.push(g),x.push(f),u=-1;else{const n=t(b,a,r);g+=n,f+=n,s>=e[i].length-2&&(A&&(g+=w.line(a,l)),f+=w.line(a,v)+w.line(p,v)+"z",m.push(g),x.push(f),u=-1)}}c=a,d=r;break}}return{linePaths:m,areaPaths:x,pX:c,pY:d,pathState:u,segmentStartX:p,linePath:g,areaPath:f}}handleNullDataPoints(t,e,i,s,a){const r=this.w;if(null===t[i][s]&&r.config.markers.showNullDataPoints||1===t[i].length){let t=this.strokeWidth-r.config.markers.strokeWidth/2;t>0||(t=0);const i=this.markers.plotChartMarkers({pointsPos:e,seriesIndex:a,j:s+1,pSize:t,alwaysDrawMarker:!0});null!==i&&this.elPointsMain.add(i)}}}function Vi(t,e){const{lines:i,lineHeight:s,anchor:a,elbow:r,labelX:n,labelY:o,side:l,connector:h,style:c,foreColor:d}=e,u=new I(t),p=u.group({class:e.groupClass||"apexcharts-outer-label-group"});if(h.show){const t=`M ${a.x} ${a.y} L ${r.x} ${r.y} L ${n} ${o}`,i=u.drawPath({d:t,stroke:h.color,strokeWidth:h.width,fill:"none",strokeLinecap:"round"});i.node.classList.add(e.connectorClass||"apexcharts-outer-label-connector"),p.add(i)}const g="right"===l?n+4:n-4,f=i.length,m=o-(f-1)*s/2,x=u.drawText({x:g,y:m,text:1===f?i[0]:i,textAnchor:"right"===l?"start":"end",fontSize:c.fontSize,fontFamily:c.fontFamily,fontWeight:c.fontWeight,foreColor:d,dominantBaseline:"central",cssClass:e.textClass||"apexcharts-outer-label"});if(f>1){const t=x.node.getElementsByTagName("tspan");for(let e=0;e<t.length;e++)t[e].setAttribute("x",`${g}`),t[e].setAttribute("dy",0===e?"0":`${s}`)}return p.add(x),p}function Gi(t,e,i,s){const a=t.slice().sort((t,e)=>t.idealY-e.idealY);a.forEach(t=>{t.labelY=t.idealY});for(let t=1;t<a.length;t++)a[t].labelY-a[t-1].labelY<e&&(a[t].labelY=a[t-1].labelY+e);const r=a[a.length-1],n=r?r.labelY-i:0;if(n>0)for(let t=a.length-1;t>=0;t--)a[t].labelY-=n,t<a.length-1&&a[t+1].labelY-a[t].labelY<e&&(a[t].labelY=a[t+1].labelY-e);if(null!=s&&a.length&&a[0].labelY<s){const t=s-a[0].labelY;for(let e=0;e<a.length;e++)a[e].labelY+=t}}class qi{constructor(t){this.w=t}drawYAxisTexts(t,e,i,s){const a=this.w,r=a.config.yaxis[0],n=a.formatters.yLabelFormatters[0];return new I(this.w).drawText({x:t+r.labels.offsetX,y:e+r.labels.offsetY,text:n(s,i),textAnchor:"middle",fontSize:r.labels.style.fontSize,fontFamily:r.labels.style.fontFamily,foreColor:Array.isArray(r.labels.style.colors)?r.labels.style.colors[i]:r.labels.style.colors})}getMaxLabelWidth(t,{fontSize:e,fontFamily:i}={}){const s=new I(this.w);let a=0;return t.forEach(t=>{if(null==t||""===t)return;const r=s.getTextRects(`${t}`,e||"12px",i,"");a=Math.max(a,r.width)}),a}drawExternalLabel(t){return Vi(this.w,l(o({},t),{groupClass:"apexcharts-pie-name-label-group",textClass:"apexcharts-pie-name-label",connectorClass:"apexcharts-pie-label-connector"}))}}const Zi=Math.PI/180,Ui=180/Math.PI;function Ki(t,e,i,s){return{x:t+i*Math.cos((s-90)*Zi),y:e+i*Math.sin((s-90)*Zi)}}const Ji=t=>`${t.x} ${t.y}`;function Qi({cx:t,cy:e,rIn:i,rOut:s,a0:a,a1:r,r:n,spanDeg:o}){const l=(i,s)=>Ki(t,e,i,s),h=n/s*Ui,c=n/i*Ui,d=l(s,a+h),u=l(s,r-h),p=o-2*h>180?1:0,g=l(s,r),f=l(s-n,r),m=l(s,a),x=l(s-n,a),b=l(i,r-c),y=l(i,a+c),w=o-2*c>180?1:0,v=l(i,r),_=l(i+n,r),A=l(i,a),S=l(i+n,a);return["M",Ji(d),"A",s,s,0,p,1,Ji(u),"Q",Ji(g),Ji(f),"L",Ji(_),"Q",Ji(v),Ji(b),"A",i,i,0,w,0,Ji(y),"Q",Ji(A),Ji(S),"L",Ji(x),"Q",Ji(m),Ji(d),"Z"].join(" ")}function ts({cx:t,cy:e,rIn:i,rOut:s,a0:a,a1:r,spanDeg:n}){const o=(i,s)=>Ki(t,e,i,s),l=n>180?1:0,h=o(s,a),c=o(s,r),d=o(i,r),u=o(i,a);return["M",Ji(h),"A",s,s,0,l,1,Ji(c),"L",Ji(d),"A",i,i,0,l,0,Ji(u),"Z"].join(" ")}class es{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.externalCfg=t.config.plotOptions.pie.dataLabels.external;const i=t.config.dataLabels.style;this.externalLabelStyle={fontSize:this.externalCfg.fontSize||i.fontSize,fontFamily:this.externalCfg.fontFamily||i.fontFamily,fontWeight:this.externalCfg.fontWeight||i.fontWeight},this.externalLabels=[],this.externalLabelMaxLines=1,this.externalLabelLineH=parseFloat(this.externalLabelStyle.fontSize)||12,t.globals.pieExternalLabelMarginY=0,this.showExternalLabels=this.externalCfg.show&&"polarArea"!==this.chartType,this.showExternalLabels&&!t.globals.noData&&this.reserveExternalLabelSpace(),this.donutSize=t.globals.radialSize*parseInt(t.config.plotOptions.pie.donut.size,10)/100;const s=t.config.plotOptions.pie.customScale,a=t.layout.gridWidth/2,r=t.layout.gridHeight/2;this.translateX=a-a*s,this.translateY=r-r*s,this.dataLabelsGroup=new I(this.w).group({class:"apexcharts-datalabels-group",transform:`translate(${this.translateX}, ${this.translateY}) scale(${s})`}),this.maxY=0,this.sliceLabels=[],this.sliceSizes=[],this.prevSliceSizes=[],this.sliceLabelGroups={},this.externalLabelGroups={},this.elHoverOutline=null,this.elHoverOutlinePath=null,this.hoverOutlineIndex=-1,this.prevSectorAngleArr=[]}getExternalLabelText(t){var e,i,s;const a=this.w,r=a.seriesData.seriesNames[t],n=this.externalCfg.formatter;return"function"==typeof n?n(r,{seriesIndex:t,percent:null==(i=null==(e=a.globals.seriesPercent)?void 0:e[t])?void 0:i[0],value:null==(s=a.globals.seriesTotals)?void 0:s[t],w:a}):null==r?"":`${r}`}getExternalLabelLines(t){const e=this.getExternalLabelText(t);return(Array.isArray(e)?e:`${null==e?"":e}`.split("\n")).map(t=>null==t?"":`${t}`)}reserveExternalLabelSpace(){const t=this.w,e=new qi(t),i=(t.seriesData.seriesNames||[]).map((t,e)=>this.getExternalLabelLines(e)),s=e.getMaxLabelWidth(i.flat(),{fontSize:this.externalLabelStyle.fontSize,fontFamily:this.externalLabelStyle.fontFamily});this.externalLabelMaxLines=i.reduce((t,e)=>Math.max(t,e.length),1),this.externalLabelLineH=Math.round(1.35*(parseFloat(this.externalLabelStyle.fontSize)||12));const a=this.externalCfg.connector,r=this.externalLabelMaxLines*this.externalLabelLineH,n=s+(a.length||0)+(a.gap||0)+12,o=r/2+(a.gap||0)+6,l=Math.min(t.globals.radialSize,t.layout.gridWidth/2-n,t.layout.gridHeight/2-o);t.globals.radialSize=Math.max(l,.15*this.defaultSize),t.globals.pieExternalLabelMarginY=o;const h=t.config.chart.height?String(t.config.chart.height):"",c=""!==h&&"auto"!==h;this.centerY=c?t.layout.gridHeight/2:t.globals.radialSize+o}draw(t){var e;const i=this.w,s=new I(this.w),a=s.group({class:"apexcharts-pie"});if(i.globals.noData)return a;let r=0;for(let e=0;e<t.length;e++)r+=Ht.negToZero(t[e]);const n=[],o=s.group();0===r&&(r=1e-5),t.forEach(t=>{this.maxY=Math.max(this.maxY,t)}),i.config.yaxis[0].max&&(this.maxY=i.config.yaxis[0].max),"back"===i.config.grid.position&&"polarArea"===this.chartType&&this.drawPolarElements(a);const l=i.globals.collapsedSeriesIndices||[];let h=1;if("polarArea"===this.chartType){let e=0;for(let i=0;i<t.length;i++)-1===l.indexOf(i)&&e++;h=Math.max(1,e)}for(let e=0;e<t.length;e++){const s=this.fullAngle*Ht.negToZero(t[e])/r;n.push(s),"polarArea"===this.chartType?(n[e]=l.indexOf(e)>-1?0:this.fullAngle/h,this.sliceSizes.push(i.globals.radialSize*t[e]/(this.maxY||1))):this.sliceSizes.push(i.globals.radialSize)}const c=!0===(null==(e=this.ctx.morphTypeChange)?void 0:e.isActive());if(i.globals.dataChanged&&!c)if("polarArea"===this.chartType){const t=i.globals.previousPaths,e=i.globals.prevPolarAngles;if(Array.isArray(e)&&e.length===t.length)this.prevSectorAngleArr=e.slice();else for(let e=0;e<t.length;e++)this.prevSectorAngleArr.push(this.fullAngle/Math.max(1,t.length));let s=0;for(let e=0;e<t.length;e++)s=Math.max(s,Ht.negToZero(t[e]));i.config.yaxis[0].max&&(s=i.config.yaxis[0].max),this.prevSliceSizes=t.map(t=>i.globals.radialSize*Ht.negToZero(t)/(s||1))}else{let t,e=0;for(let t=0;t<i.globals.previousPaths.length;t++)e+=Ht.negToZero(i.globals.previousPaths[t]);for(let s=0;s<i.globals.previousPaths.length;s++)t=this.fullAngle*Ht.negToZero(i.globals.previousPaths[s])/e,this.prevSectorAngleArr.push(t)}if("polarArea"===this.chartType&&(i.globals.prevPolarAngles=n.slice()),this.donutSize<0&&(this.donutSize=0),"donut"===this.chartType){const t=s.drawCircle(this.donutSize);t.attr({cx:this.centerX,cy:this.centerY,fill:i.config.plotOptions.pie.donut.background?i.config.plotOptions.pie.donut.background:"transparent"}),o.add(t)}const d=this.drawArcs(n,t);if(this.sliceLabels.forEach(t=>{d.add(t)}),o.attr({transform:`translate(${this.translateX}, ${this.translateY}) scale(${i.config.plotOptions.pie.customScale})`}),o.add(d),a.add(o),this.donutDataLabels.show){const t=this.initialAnim&&!i.globals.resized&&!i.globals.dataChanged&&this.animDur>0,e=this.renderInnerDataLabels(this.dataLabelsGroup,this.donutDataLabels,{hollowSize:this.donutSize,centerX:this.centerX,centerY:this.centerY,opacity:t?0:this.donutDataLabels.show});if(t){const t=this.dataLabelsGroup.node;t.style.transition="opacity 280ms ease-out",setTimeout(()=>{t.style.opacity="1"},this.animDur)}a.add(e)}return"front"===i.config.grid.position&&"polarArea"===this.chartType&&this.drawPolarElements(a),a}drawArcs(t,e){var i,s,a,r,n;const o=this.w,l=new P(this.w),h=new I(this.w),c=new M(this.w),d=h.group({class:"apexcharts-slices"});this.elHoverOutline=h.group({class:"apexcharts-pie-hover-outline"}),this.elHoverOutline.node.style.pointerEvents="none",this.elHoverOutline.node.style.opacity="0",o.config.chart.animations.enabled&&(this.elHoverOutline.node.style.transition="opacity 180ms ease-out"),d.add(this.elHoverOutline);let u=this.initialAngle,p=this.initialAngle,g=this.initialAngle,f=this.initialAngle;this.strokeWidth=o.config.stroke.show?o.config.stroke.width:0;const m=!0===(null==(i=this.ctx.morphTypeChange)?void 0:i.isActive());for(let i=0;i<t.length;i++){const x=h.group({class:"apexcharts-series apexcharts-pie-series",seriesName:Ht.escapeString(o.seriesData.seriesNames[i]),rel:i+1,"data:realIndex":i});d.add(x),u=g,p=f,g=u+t[i],f=p+this.prevSectorAngleArr[i];const b=g<u?this.fullAngle+g-u:g-u,y=c.fillPath({seriesNumber:i,size:this.sliceSizes[i],value:e[i]}),w=m?this.ctx.morphTypeChange.getInitialPathFor(i,0):null,v="polarArea"===this.chartType&&o.globals.dataChanged&&!m?this.prevSliceSizes[i]||0:void 0,_=w||this.getChangedPath(p,f,v),A=h.drawPath({d:_,stroke:Array.isArray(this.lineColorArr)?null!=(s=this.lineColorArr[i])?s:this.lineColorArr[i%this.lineColorArr.length]:this.lineColorArr,strokeWidth:0,fill:y,fillOpacity:o.config.fill.opacity,classes:`apexcharts-pie-area apexcharts-${this.chartType.toLowerCase()}-slice-${i}`});if(A.attr({index:0,j:i}),l.setSelectionFilter(A,0,i),o.config.chart.dropShadow.enabled){const t=o.config.chart.dropShadow;l.dropShadow(A,t,i)}this.addListeners(A,this.donutDataLabels,i);let S={x:0,y:0};const C=(u+b/2)%this.fullAngle;let k={x:this.centerX,y:this.centerY};"pie"===this.chartType||"polarArea"===this.chartType?(S=Ht.polarToCartesian(this.centerX,this.centerY,o.globals.radialSize/1.25+o.config.plotOptions.pie.dataLabels.offset,C),k=Ht.polarToCartesian(this.centerX,this.centerY,o.globals.radialSize/2,C)):"donut"===this.chartType&&(S=Ht.polarToCartesian(this.centerX,this.centerY,(o.globals.radialSize+this.donutSize)/2+o.config.plotOptions.pie.dataLabels.offset,C),k=Ht.polarToCartesian(this.centerX,this.centerY,(o.globals.radialSize+this.donutSize)/2,C)),I.setAttrs(A.node,{"data:angle":b,"data:startAngle":u,"data:strokeWidth":this.strokeWidth,"data:value":e[i],"data:cx":k.x,"data:cy":k.y}),x.add(A);let M=!1;if(m){const t=this.getPiePath({me:this,startAngle:u,angle:b,size:this.sliceSizes[i]});A.node.setAttribute("data:pathFinal",t),M=!0===(null==(r=(a=this.ctx.morphTypeChange).claimsTargetMark)?void 0:r.call(a,i,0)),M&&(A.attr({d:t}),A.node.setAttribute("data:pathOrig",t),A.node.setAttribute("opacity","0"),A.node.setAttribute("data-piece-hidden","1"))}let L=0;if(!this.initialAnim||o.globals.resized||o.globals.dataChanged?this.animBeginArr.push(0):(L=b/this.fullAngle*o.config.chart.animations.speed,0===L&&(L=1),this.animDur=L+this.animDur,this.animBeginArr.push(this.animDur)),M);else if(m&&w){const t=this.getPiePath({me:this,startAngle:u,angle:b,size:this.sliceSizes[i]}),e=this.ctx.morphTypeChange.getSpeed(),s=this.ctx.animations;A.node.setAttribute("data:pathOrig",t);const a=A.animate(e).plot(t,"polygons").attr({"stroke-width":this.strokeWidth});a&&"function"==typeof a.after?a.after(()=>s.animationCompleted(A)):s.animationCompleted(A)}else this.dynamicAnim&&o.globals.dataChanged?this.animatePaths(A,{size:this.sliceSizes[i],prevSize:v,endAngle:g,startAngle:u,prevStartAngle:p,prevEndAngle:f,animateStartingPos:!0,i:i,animBeginArr:this.animBeginArr,shouldSetPrevPaths:!0,dur:o.config.chart.animations.dynamicAnimation.speed}):this.animatePaths(A,{size:this.sliceSizes[i],endAngle:g,startAngle:u,i:i,totalItems:t.length-1,animBeginArr:this.animBeginArr,dur:L});if(this.getExpandOffset()>0?A.node.addEventListener("mouseup",this.pieClicked.bind(this,i)):0===i&&P.drilldownBlocksSliceOffset(o)&&(null==(n=this.ctx.drilldown)||n.warnSliceOffsetDisabled()),void 0!==o.interact.selectedDataPoints[0]&&o.interact.selectedDataPoints[0].indexOf(i)>-1)if(this.initialAnim&&!o.globals.resized&&!o.globals.dataChanged&&this.animDur>0){const t=this,e=i;setTimeout(()=>t.pieClicked(e,{animate:!1}),this.animDur)}else this.pieClicked(i,{animate:!1});if(o.config.dataLabels.enabled){const e=S.x,s=S.y;let a=100*b/this.fullAngle+"%";if(0!==b&&o.config.plotOptions.pie.dataLabels.minAngleToShowLabel<t[i]){const t=o.config.dataLabels.formatter;void 0!==t&&(a=t(o.globals.seriesPercent[i][0],{seriesIndex:i,w:o}));const r=o.globals.dataLabels.style.colors[i],n=h.group({class:"apexcharts-datalabels"}),c=h.drawText({x:e,y:s,text:a,textAnchor:"middle",fontSize:o.config.dataLabels.style.fontSize,fontFamily:o.config.dataLabels.style.fontFamily,fontWeight:o.config.dataLabels.style.fontWeight,foreColor:r});if(n.add(c),o.config.dataLabels.dropShadow.enabled){const t=o.config.dataLabels.dropShadow;l.dropShadow(c,t)}c.node.classList.add("apexcharts-pie-label"),o.config.chart.animations.animate&&!1===o.globals.resized&&(c.node.classList.add("apexcharts-pie-label-delay"),c.node.style.animationDelay=o.config.chart.animations.speed/940+"s"),this.sliceLabels.push(n),this.sliceLabelGroups[i]=n.node}}if(this.showExternalLabels&&0!==b){const t=this.getExternalLabelLines(i);if(t.some(t=>""!==t)){const e=Ht.polarToCartesian(this.centerX,this.centerY,o.globals.radialSize,C),s=Ht.polarToCartesian(this.centerX,this.centerY,o.globals.radialSize+(this.externalCfg.connector.gap||0),C),a=s.x>=this.centerX,r=a?s.x+(this.externalCfg.connector.length||0):s.x-(this.externalCfg.connector.length||0);this.externalLabels.push({i:i,lines:t,anchor:e,elbow:s,side:a?"right":"left",labelX:r+parseFloat(this.externalCfg.offsetX||0),idealY:s.y+parseFloat(this.externalCfg.offsetY||0),connectorColor:this.externalCfg.connector.color||o.globals.colors[i],foreColor:this.externalCfg.color||o.config.chart.foreColor})}}}if(this.showExternalLabels&&this.externalLabels.length){this.placeExternalLabels();const t=Wt.isBrowser()&&(m||this.dynamicAnim&&o.globals.dataChanged||this.initialAnim&&!o.globals.resized&&!o.globals.dataChanged);this.externalLabels.forEach(e=>{const i=new qi(o).drawExternalLabel({lines:e.lines,lineHeight:this.externalLabelLineH,anchor:e.anchor,elbow:e.elbow,labelX:e.labelX,labelY:e.labelY,side:e.side,connector:{show:this.externalCfg.connector.show,width:this.externalCfg.connector.width,color:e.connectorColor},style:this.externalLabelStyle,foreColor:e.foreColor});t&&(i.node.classList.add("apexcharts-element-hidden"),o.globals.delayedElements.push({el:i.node})),this.externalLabelGroups[e.i]=i.node,d.add(i)})}return d}placeExternalLabels(){const t=this.w,e=this.externalLabelMaxLines*this.externalLabelLineH+2,i=this.centerY+t.globals.radialSize+t.globals.pieExternalLabelMarginY;["left","right"].forEach(t=>{Gi(this.externalLabels.filter(e=>e.side===t),e,i)})}addListeners(t,e,i){const s=new I(this.w,this.ctx);t.node.addEventListener("mouseenter",s.pathMouseEnter.bind(s,t)),t.node.addEventListener("mouseleave",s.pathMouseLeave.bind(s,t)),t.node.addEventListener("mouseleave",this.revertDataLabelsInner.bind(this)),"number"==typeof i&&(t.node.addEventListener("mouseenter",this.showHoverOutline.bind(this,i)),t.node.addEventListener("mouseleave",this.hideHoverOutline.bind(this))),t.node.addEventListener("mousedown",s.pathMouseDown.bind(s,t)),this.donutDataLabels.total.showAlways||(t.node.addEventListener("mouseenter",this.printDataLabelsInner.bind(this,t.node,e)),t.node.addEventListener("mousedown",this.printDataLabelsInner.bind(this,t.node,e)))}animatePaths(t,e){const i=this.w;let s=e.endAngle<e.startAngle?this.fullAngle+e.endAngle-e.startAngle:e.endAngle-e.startAngle,a=s,r=e.startAngle;const n=e.startAngle;void 0!==e.prevStartAngle&&void 0!==e.prevEndAngle&&(r=e.prevEndAngle,a=e.prevEndAngle<e.prevStartAngle?this.fullAngle+e.prevEndAngle-e.prevStartAngle:e.prevEndAngle-e.prevStartAngle),e.i===i.config.series.length-1&&(s+n>this.fullAngle?e.endAngle=e.endAngle-(s+n):s+n<this.fullAngle&&(e.endAngle=e.endAngle+(this.fullAngle-(s+n)))),s===this.fullAngle&&(s=this.fullAngle-.01),this.animateArc(t,r,n,s,a,e)}animateArc(t,e,i,s,a,r){const n=this,o=this.w,l=new u(this.w),h=r.size;let c;(isNaN(e)||isNaN(a))&&(e=i,a=s,r.dur=0);let d=s,p=i;const g=e<i?this.fullAngle+e-i:e-i,f="number"==typeof r.prevSize;o.globals.dataChanged&&r.shouldSetPrevPaths&&r.prevEndAngle&&(c=n.getPiePath({me:n,startAngle:r.prevStartAngle,angle:r.prevEndAngle<r.prevStartAngle?this.fullAngle+r.prevEndAngle-r.prevStartAngle:r.prevEndAngle-r.prevStartAngle,size:f?r.prevSize:h}),t.attr({d:c})),0!==r.dur?t.animate(r.dur,r.animBeginArr[r.i]).after(function(){"pie"!==n.chartType&&"donut"!==n.chartType&&"polarArea"!==n.chartType||this.animate(o.config.chart.animations.dynamicAnimation.speed).attr({"stroke-width":n.strokeWidth}),r.i===o.config.series.length-1&&l.animationCompleted(t)}).during(o=>{d=g+(s-g)*o,r.animateStartingPos&&(d=a+(s-a)*o,p=e-a+(i-(e-a))*o),c=n.getPiePath({me:n,startAngle:p,angle:d,size:f?r.prevSize+(h-r.prevSize)*o:h}),t.node.setAttribute("data:pathOrig",c),t.attr({d:c})}):(c=n.getPiePath({me:n,startAngle:p,angle:s,size:h}),r.isTrack||(o.globals.animationEnded=!0),t.node.setAttribute("data:pathOrig",c),t.attr({d:c,"stroke-width":n.strokeWidth}))}pieClicked(t,e){const i=this.w,s=!(e&&!1===e.animate),a=i.dom.Paper.findOne(`.apexcharts-${this.chartType.toLowerCase()}-slice-${t}`);if(!a)return;if("true"===a.attr("data:pieClicked"))return a.attr({"data:pieClicked":"false"}),this.revertDataLabelsInner(),void this.offsetSlice(t,0,s);const r=i.dom.baseEl.getElementsByClassName("apexcharts-pie-area");Array.prototype.forEach.call(r,t=>{const e="true"===t.getAttribute("data:pieClicked");t.setAttribute("data:pieClicked","false"),e&&this.offsetSlice(parseInt(t.getAttribute("j"),10),0,s)}),i.interact.capturedDataPointIndex=t,a.attr("data:pieClicked","true"),this.offsetSlice(t,this.getExpandOffset(),s)}getExpandOffset(){const t=this.w.config.plotOptions.pie;if(!t.expandOnClick||"polarArea"===this.chartType)return 0;if(P.drilldownBlocksSliceOffset(this.w))return 0;const e=Number(t.expandOffset);return Number.isFinite(e)&&e>0?e:0}getSliceMovers(t){const e=this.w.dom.Paper.findOne(`.apexcharts-${this.chartType.toLowerCase()}-slice-${t}`);return[e?e.node:null,this.sliceLabelGroups[t],this.externalLabelGroups[t],this.hoverOutlineIndex===t&&this.elHoverOutlinePath?this.elHoverOutlinePath.node:null].filter(Boolean)}offsetSlice(t,e,i=!0){const s=this.w;if(!s.dom.Paper.findOne(`.apexcharts-${this.chartType.toLowerCase()}-slice-${t}`))return;const{dx:a,dy:r}=this.getSliceOffsetVector(t,e),n=`translate(${a} ${r})`,o=i&&s.config.chart.animations.enabled?"transform 320ms cubic-bezier(0.25, 0.8, 0.3, 1)":"";this.getSliceMovers(t).forEach(t=>{t.style.transition=o,t.setAttribute("transform",n)})}getSliceOffsetVector(t,e){const i=this.w.dom.Paper.findOne(`.apexcharts-${this.chartType.toLowerCase()}-slice-${t}`),s=i?parseFloat(i.attr("data:angle")):NaN;if(!e||!Number.isFinite(s)||s>=this.fullAngle)return{dx:0,dy:0};const a=parseFloat(i.attr("data:startAngle")),r=Math.PI*(a+s/2-90)/180;return{dx:e*Math.cos(r),dy:e*Math.sin(r)}}showHoverOutline(t){const e=this.w;if(!P.hoverOutlineOwnsHoverState(e))return;if(!this.elHoverOutline)return;const i=this.getHoverOutlinePath(t);if(!i)return;const s=e.config.plotOptions.pie.hoverOutline,a=s.color||e.globals.colors[t];if(!this.elHoverOutlinePath){const t=new I(e);this.elHoverOutlinePath=t.drawPath({d:i,fill:a,strokeWidth:0,classes:"apexcharts-pie-hover-outline-band"}),this.elHoverOutline.add(this.elHoverOutlinePath)}this.elHoverOutlinePath.attr({d:i,fill:a,"fill-opacity":s.opacity});const{dx:r,dy:n}=this.getSliceOffsetVector(t,this.isSliceOut(t)?this.getExpandOffset():0);this.elHoverOutlinePath.node.style.transition="",this.elHoverOutlinePath.node.setAttribute("transform",`translate(${r} ${n})`),this.hoverOutlineIndex=t,this.elHoverOutline.node.style.opacity="1"}hideHoverOutline(){this.elHoverOutline&&(this.elHoverOutline.node.style.opacity="0")}isSliceOut(t){const e=this.w.dom.Paper.findOne(`.apexcharts-${this.chartType.toLowerCase()}-slice-${t}`);return!!e&&"true"===e.attr("data:pieClicked")}getHoverOutlinePath(t){const e=this.w,i=e.config.plotOptions.pie.hoverOutline,s=e.dom.Paper.findOne(`.apexcharts-${this.chartType.toLowerCase()}-slice-${t}`);if(!s)return null;const a=parseFloat(s.attr("data:angle"));if(!Number.isFinite(a)||a<=0)return null;const r=this.sliceSizes[t],n=Number(i.size);if(!Number.isFinite(r)||!Number.isFinite(n)||n<=0)return null;const{startDeg:h,spanDeg:c}=this.getSliceExtent({me:this,startAngle:parseFloat(s.attr("data:startAngle")),angle:a,size:r});if(!(c>0))return null;const d=r+(this.strokeWidth||0)/2+(Number(i.gap)||0),u=d+n,p={cx:this.centerX,cy:this.centerY,rIn:d,rOut:u,a0:h,a1:h+c,spanDeg:c},g=Math.min(n/2,c*Math.PI/180/2*d);return g>.5?Qi(l(o({},p),{r:g})):ts(p)}getChangedPath(t,e,i){let s="";return this.dynamicAnim&&this.w.globals.dataChanged&&(s=this.getPiePath({me:this,startAngle:t,angle:e-t,size:"number"==typeof i?i:this.size})),s}getSliceExtent({me:t,startAngle:e,angle:i,size:s}){const a=this.w;let r=e,n=i+e;Math.ceil(n)>=this.fullAngle+this.w.config.plotOptions.pie.startAngle%this.fullAngle&&(n=this.fullAngle+this.w.config.plotOptions.pie.startAngle%this.fullAngle-.01);let o=n-r;const l="pie"===t.chartType||"donut"===t.chartType||"polarArea"===t.chartType,h=a.config.plotOptions.pie.spacing;if(l&&h>0&&o>0){const e="donut"===t.chartType?(s+t.donutSize)/2:s,i=e>0?h/e*(180/Math.PI):0,a=Math.min(i/2,Math.max(0,o/2-.5));r+=a,o-=2*a}return n=r+o,Math.ceil(n)>this.fullAngle&&(n-=this.fullAngle),{startDeg:r,spanDeg:o,endDeg:n}}getPiePath({me:t,startAngle:e,angle:i,size:s}){let a;const r=this.w,n=new I(this.w),{startDeg:o,spanDeg:l,endDeg:h}=this.getSliceExtent({me:t,startAngle:e,angle:i,size:s}),c="pie"===t.chartType||"donut"===t.chartType||"polarArea"===t.chartType,d=Math.PI*(o-90)/180,u=r.config.plotOptions.pie.borderRadius;if(u>0&&c){const e=this.getRoundedSlicePath({me:t,startDeg:o,spanDeg:l,size:s,borderRadius:u});if(e)return e}const p=Math.PI*(h-90)/180,g=t.centerX+s*Math.cos(d),f=t.centerY+s*Math.sin(d),m=t.centerX+s*Math.cos(p),x=t.centerY+s*Math.sin(p),b=Ht.polarToCartesian(t.centerX,t.centerY,t.donutSize,h),y=Ht.polarToCartesian(t.centerX,t.centerY,t.donutSize,o),w=l>180?1:0,v=["M",g,f,"A",s,s,0,w,1,m,x];return a="donut"===t.chartType?[...v,"L",b.x,b.y,"A",t.donutSize,t.donutSize,0,w,0,y.x,y.y,"L",g,f,"z"].join(" "):"pie"===t.chartType||"polarArea"===t.chartType?[...v,"L",t.centerX,t.centerY,"L",g,f].join(" "):[...v].join(" "),n.roundPathCorners(a,2*this.strokeWidth)}getRoundedSlicePath({me:t,startDeg:e,spanDeg:i,size:s,borderRadius:a}){if(!(i>0))return null;const r=Math.PI/180,n=t.centerX,o=t.centerY,l="donut"===t.chartType,h=s,c=l?t.donutSize:0,d=i*r;let u=a;if(u=Math.min(u,d*h/2),l?(u=Math.min(u,d*c/2),u=Math.min(u,(h-c)/2)):u=Math.min(u,h/2),!(u>.5))return null;const p=e,g=e+i;return l?Qi({cx:n,cy:o,rIn:c,rOut:h,a0:p,a1:g,r:u,spanDeg:i}):function({cx:t,cy:e,rOut:i,a0:s,a1:a,r:r,spanDeg:n}){const o=(i,s)=>Ki(t,e,i,s),l=r/i*Ui,h=o(i,s+l),c=o(i,a-l),d=n-2*l>180?1:0,u=o(i,a),p=o(i-r,a),g=o(i,s),f=o(i-r,s);return["M",Ji(h),"A",i,i,0,d,1,Ji(c),"Q",Ji(u),Ji(p),"L",`${t} ${e}`,"L",Ji(f),"Q",Ji(g),Ji(h),"Z"].join(" ")}({cx:n,cy:o,rOut:h,a0:p,a1:g,r:u,spanDeg:i})}drawPolarElements(t){const e=this.w,i=new F(this.w),s=new I(this.w),a=new qi(this.w),r=s.group(),n=s.group(),o=i.niceScale(0,Math.ceil(this.maxY),0),l=o.result.reverse(),h=o.result.length;this.maxY=o.niceMax;let c=e.globals.radialSize;const d=c/(h-1);for(let t=0;t<h-1;t++){const i=s.drawCircle(c);if(i.attr({cx:this.centerX,cy:this.centerY,fill:"none","stroke-width":e.config.plotOptions.polarArea.rings.strokeWidth,stroke:e.config.plotOptions.polarArea.rings.strokeColor}),e.config.yaxis[0].show){const i=a.drawYAxisTexts(this.centerX,this.centerY-c+parseInt(e.config.yaxis[0].labels.style.fontSize,10)/2,t,l[t]);n.add(i)}r.add(i),c-=d}this.drawSpokes(t),t.add(r),t.add(n)}renderInnerDataLabels(t,e,i){const s=this.w,a=new I(this.w),r=e.total.show;t.node.innerHTML="",t.node.style.opacity=i.opacity;const n=i.centerX,o=this.donutDataLabels.total.label?i.centerY:i.centerY-i.centerY/6;let l,h;l=void 0===e.name.color?s.globals.colors[0]:e.name.color;let c=e.name.fontSize,d=e.name.fontFamily,u=e.name.fontWeight;h=void 0===e.value.color?s.config.chart.foreColor:e.value.color;const p=e.value.formatter;let g="",f="";if(r?(l=e.total.color,c=e.total.fontSize,d=e.total.fontFamily,u=e.total.fontWeight,f=this.donutDataLabels.total.label?e.total.label:"",g=e.total.formatter(s)):1===s.seriesData.series.length&&(g=p(s.seriesData.series[0],s),f=s.seriesData.seriesNames[0]),f&&(f=e.name.formatter(f,e.total.show,s)),e.name.show){const i=a.drawText({x:n,y:o+parseFloat(e.name.offsetY),text:f,textAnchor:"middle",foreColor:l,fontSize:c,fontWeight:u,fontFamily:d});i.node.classList.add("apexcharts-datalabel-label"),t.add(i)}if(e.value.show){const i=e.name.show?parseFloat(e.value.offsetY)+16:e.value.offsetY,s=a.drawText({x:n,y:o+i,text:g,textAnchor:"middle",foreColor:h,fontWeight:e.value.fontWeight,fontSize:e.value.fontSize,fontFamily:e.value.fontFamily});s.node.classList.add("apexcharts-datalabel-value"),t.add(s)}return t}printInnerLabels(t,e,i,s){const a=this.w;let r;s?r=void 0===t.name.color?a.globals.colors[parseInt(s.parentNode.getAttribute("rel"),10)-1]:t.name.color:a.seriesData.series.length>1&&t.total.show&&(r=t.total.color);const n=a.dom.baseEl.querySelector(".apexcharts-datalabel-label"),o=a.dom.baseEl.querySelector(".apexcharts-datalabel-value");i=(0,t.value.formatter)(i,a),s||"function"!=typeof t.total.formatter||(i=t.total.formatter(a));const l=e===t.total.label;if(e=this.donutDataLabels.total.label?t.name.formatter(e,l,a):"",null!==n&&(n.textContent=e),null!==o&&(o.textContent=i),null!==n){n.style.fill=r}}printDataLabelsInner(t,e){const i=this.w,s=t.getAttribute("data:value"),a=i.seriesData.seriesNames[parseInt(t.parentNode.getAttribute("rel"),10)-1];i.seriesData.series.length>1&&this.printInnerLabels(e,a,s,t);const r=i.dom.baseEl.querySelector(".apexcharts-datalabels-group");if(null!==r){r.style.opacity="1"}}drawSpokes(t){const e=this.w,i=new I(this.w),s=e.config.plotOptions.polarArea.spokes;if(0===s.strokeWidth)return;const a=[],r=360/e.seriesData.series.length;for(let t=0;t<e.seriesData.series.length;t++)a.push(Ht.polarToCartesian(this.centerX,this.centerY,e.globals.radialSize,e.config.plotOptions.pie.startAngle+r*t));a.forEach((e,a)=>{const r=i.drawLine(e.x,e.y,this.centerX,this.centerY,Array.isArray(s.connectorColors)?s.connectorColors[a]:s.connectorColors);t.add(r)})}revertDataLabelsInner(){const t=this.w;if(this.donutDataLabels.show){const e=t.dom.Paper.findOne(".apexcharts-datalabels-group"),i=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(i)}}}function is(t,e){let i=0;for(let e=0;e<t.length;e++)i+=t[e];const s=e/i,a=new Array(t.length);for(let e=0;e<t.length;e++)a[e]=t[e]*s;return a}function ss(t,e,i,s){const a=s*s,r=i*i;return Math.max(a*e/r,r/(a*t))}function as(t,e,i,s,a,r){if(0===t)return!0;return ss(e,i,s,r)>=ss(Math.min(e,a),Math.max(i,a),s+a,r)}function rs(t,e,i,s,a,r,n,o){if(n>=o){const n=s/o;let l=r;for(let s=0;s<i;s++){const i=e[s]/n;t.push([a,l,a+n,l+i]),l+=i}}else{const o=s/n;let l=a;for(let s=0;s<i;s++){const i=e[s]/o;t.push([l,r,l+i,r+o]),l+=i}}}function ns(t,e,i,s,a){const r=[],n=t.length;if(0===n)return r;const o=new Array(n);let l=0,h=0,c=1/0,d=-1/0,u=0;for(;u<n;){const n=Math.min(s,a),p=t[u];if(as(l,c,d,h,p,n))o[l]=p,l++,h+=p,p<c&&(c=p),p>d&&(d=p),u++;else{if(rs(r,o,l,h,e,i,s,a),s>=a){const t=h/a;e+=t,s-=t}else{const t=h/s;i+=t,a-=t}l=0,h=0,c=1/0,d=-1/0}}return l>0&&rs(r,o,l,h,e,i,s,a),r}function os(t){const e=t.children;if(e&&e.length){let i=0;for(let t=0;t<e.length;t++)i+=os(e[t]);return t._area=i,i}const i=Number(t.value),s=isNaN(i)?0:Math.abs(i);return t._area=s,s}function ls(t,e,i,s,a,r,n,o){const l=t.length;if(0===l||s<=0||a<=0)return;const h=new Array(l);let c=0;for(let e=0;e<l;e++)h[e]=t[e]._area,c+=h[e];if(c<=0)return;const d=ns(is(h,s*a),e,i,s,a);for(let e=0;e<l;e++){const i=t[e],s=d[e];if(!s)continue;i.rect=s,i.depth=r;const a=i.children;if(!a||!a.length)continue;const l=s[2]-s[0],h=s[3]-s[1];let c=Math.max(0,n(i,r,l,h)||0);(2*c>=l||2*c>=h)&&(c=0);let u=Math.max(0,o(i,r,l,h)||0);u>0&&h-2*c-u<u&&(u=0),i.headerHeight=u,ls(a,s[0]+c,s[1]+u+c,l-2*c,h-u-2*c,r+1,n,o)}}const hs={generate:function(t,e,i){const s=t.length,a=new Array(s);for(let e=0;e<s;e++){let i=0;const s=t[e];for(let t=0;t<s.length;t++)i+=s[t];a[e]=i}const r=ns(is(a,e*i),0,0,e,i),n=new Array(s);for(let e=0;e<s;e++){const i=r[e],s=i[0],a=i[1],o=i[2]-s,l=i[3]-a;n[e]=ns(is(t[e],o*l),s,a,o,l)}return n},generateNested:function(t,e,i,s={}){if(!Array.isArray(t)||0===t.length)return t||[];const a=s.padding||(()=>0),r=s.header||(()=>0);for(let e=0;e<t.length;e++)os(t[e]);return ls(t,0,0,e,i,0,a,r),t}};function cs(t,e,i,s,a,r=null,n={}){var o,l,h;const c=e&&"object"==typeof e,d=c&&null!=(l=null!=(o=e.x)?o:e.name)?l:"",u=Number(c?null!=(h=e.y)?h:e.value:e),p={name:String(d),value:isNaN(u)?null:u,color:c&&e.color?e.color:void 0,_key:`${a}/${i}:${d}`};if(s&&!p.color&&(p.color=s[i%s.length]),n.keepDatum&&(p._datum=e),c&&Array.isArray(e.children)&&e.children.length)p.children=e.children.map((e,i)=>cs(t,e,i,null,p._key,r,n));else if(c&&null!=e.drilldown&&!1!==n.expandDrilldown){const i=r||new Set;if(!i.has(e.drilldown)){const s=function(t,e){const i=t.config.drilldown;return(i&&Array.isArray(i.series)?i.series:[]).find(t=>t&&t.id===e)}(t,e.drilldown);if(s&&Array.isArray(s.data)&&s.data.length){const a=new Set(i);a.add(e.drilldown);const r=Array.isArray(s.colors)?s.colors:null;p.children=s.data.map((e,i)=>cs(t,e,i,r,p._key,a,n))}}}return p}function ds(t){t.children&&t.children.length&&(t.children.forEach(t=>ds(t)),(null==t.value||isNaN(t.value))&&(t.value=t.children.reduce((t,e)=>t+Math.max(0,e.value||0),0))),(null==t.value||isNaN(t.value))&&(t.value=0)}function us(t){if("string"!=typeof t)return"";const e=t.indexOf("/");return-1===e?"":t.slice(e)}function ps(t){const e=t.globals.treemapRoots;if(e&&e.length)return{roots:e,maxDepth:t.globals.treemapMaxDepth||1,nested:!0};const i=function(t,e,i={}){const s=e||t.config.series;return Array.isArray(s)?s.map((e,s)=>{var a,r;const n=e&&Array.isArray(e.data)?e.data:[],o=`${s}:${null!=(a=null==e?void 0:e.name)?a:""}`;return{name:String(null!=(r=null==e?void 0:e.name)?r:""),value:null,color:(null==e?void 0:e.color)||void 0,_key:o,_seriesIndex:s,children:n.map((e,s)=>cs(t,e,s,null,o,null,i))}}):[]}(t,t.config.series,{keepDatum:!0,expandDrilldown:!1});i.forEach(ds);const{maxDepth:s}=function(t){const e=[];let i=0;return t.forEach((t,s)=>{const a=[],r=(t,e,n)=>{t._parent=n,t._depth=e,t._si=s,t._leaf=!(t.children&&t.children.length),e>i&&(i=e),t._leaf?(t._di=a.length,a.push(t)):(t._di=-1,t.children.forEach(i=>r(i,e+1,t)))};r(t,0,null),e.push(a)}),{leaves:e,maxDepth:i}}(i);return{roots:i,maxDepth:s,nested:!1}}const gs=1/45;function fs(t,e,i,s){return{value:t,velocity:0,target:t,stiffness:e,damping:i}}function ms(t,e){if(e<=0)return bs(t);let i=e;for(;i>0;){const e=Math.min(i,gs),s=-t.stiffness*(t.value-t.target)-t.damping*t.velocity;t.velocity+=s*e,t.value+=t.velocity*e,i-=e}return!!bs(t)&&(t.value=t.target,t.velocity=0,!0)}function xs(t,e){t.target=e}function bs(t){var e,i;const s=null!=(e=t.restVelocity)?e:.05,a=null!=(i=t.restDisplacement)?i:.05;return Math.abs(t.velocity)<s&&Math.abs(t.value-t.target)<a}const ys={crisp:[210,26],gentle:[120,20],snappy:[320,30]};const ws="__apexcharts_unit_layouts__";function vs(t){return t&&globalThis[ws][t]||null}globalThis[ws]||(globalThis[ws]={});const _s="__apexcharts_unit_marks__";function As(t,e){if("string"==typeof t){const e=t.trim();return e?Object.freeze({name:"anonymous",path:e,viewBox:[0,0,100,100]}):null}if(!t||"object"!=typeof t)return null;if("string"!=typeof t.path||!t.path.trim())return null;const i=Array.isArray(t.viewBox)&&4===t.viewBox.length?t.viewBox.map(Number):[0,0,100,100];return!i.every(t=>isFinite(t))||i[2]<=0||i[3]<=0?null:Object.freeze(l(o({},t),{name:t.name||"anonymous",path:t.path.trim(),viewBox:i,fillRule:"evenodd"===t.fillRule?"evenodd":void 0}))}function Ss(t){return t&&globalThis[_s][t]||null}globalThis[_s]||(globalThis[_s]={});const Cs=Math.PI*(3-Math.sqrt(5));function ks(t){return 1-Math.pow(1-t,3)}function Ms(t){return t<.5?4*t*t*t:1-Math.pow(-2*t+2,3)/2}function Ps(t,e){const[i,s]=null!=(r=ys[null!=(a=t)?a:"crisp"])?r:ys.crisp;var a,r;const n=800/Math.max(1,e);return[i*n*n,s*n]}const Ls=Math.PI/180,Is=180/Math.PI,Es="http://www.w3.org/2000/svg",Rs="http://www.w3.org/1999/xhtml",Ds=(t,e,i)=>t+(e-t)*i;c.default.use({line:ji,area:ji,scatter:ji,bubble:ji,rangeArea:ji,bar:Mi,column:Mi,barStacked:class extends Mi{draw(t,e){const i=this.w;this.graphics=new I(this.w),this.bar=new Mi(this.w,this.ctx,this.xyRatios);const s=new _(this.w);t=s.getLogSeries(t),this.yRatio=s.getLogYRatios(this.yRatio),this.barHelpers.initVariables(t),"100%"===i.config.chart.stackType&&(t=i.globals.comboCharts?e.map(t=>i.globals.seriesPercent[t]):i.globals.seriesPercent.slice()),this.series=t,this.barHelpers.initializeStackedPrevVars(this);const a=this.graphics.group({class:"apexcharts-bar-series apexcharts-plot-series"});let r=0,n=0;const h=i.config.chart.animations,c=h.enabled&&h.dynamicAnimation.enabled&&i.globals.previousPaths.length>0;let d=!1;for(let s=0,h=0;s<t.length;s++,h++){const u=i.globals.comboCharts?e[s]:s,{groupIndex:p,columnGroupIndex:g}=this.barHelpers.getGroupIndex(u);this.groupCtx=this[i.labelData.seriesGroups[p]];const f=[],m=[];let x=0;this.yRatio.length>1&&(this.yaxisIndex=i.globals.seriesYAxisReverseMap[u][0],x=u),this.isReversed=i.config.yaxis[this.yaxisIndex]&&i.config.yaxis[this.yaxisIndex].reversed;let b=this.graphics.group({class:"apexcharts-series",seriesName:Ht.escapeString(i.seriesData.seriesNames[u]),rel:s+1,"data:realIndex":u});X.addCollapsedClassToSeries(this.w,b,u);const y=this.graphics.group({class:"apexcharts-datalabels","data:realIndex":u});X.addCollapsedClassToSeries(this.w,y,u),(i.globals.collapsingSeriesIndices||[]).indexOf(u)>-1&&y.node.style.setProperty("--apexcharts-dl-exit",`${i.config.chart.animations.dynamicAnimation.speed}ms`);const w=this.graphics.group({class:"apexcharts-bar-goals-markers"}),v=this.initialPositions(r,n,void 0,void 0,void 0,void 0,x),{xDivision:_,yDivision:A,zeroH:S,zeroW:C}=v;let k=v.barHeight,M=v.barWidth;n=v.y,r=v.x,i.globals.barHeight=k,i.globals.barWidth=M,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(()=>S),this.groupCtx.prevYF[0]=this.groupCtx.prevYF[0].map(()=>0));for(let e=0;e<i.globals.dataPoints;e++){const a=this.barHelpers.getStrokeWidth(s,e,u),v={indexes:{i:s,j:e,realIndex:u,translationsIndex:x,bc:h},strokeWidth:a,x:r,y:n,elSeries:b,columnGroupIndex:g,seriesGroup:i.labelData.seriesGroups[p]};let P=null;this.isHorizontal?(P=this.drawStackedBarPaths(l(o({},v),{zeroW:C,barHeight:k,yDivision:A})),M=this.series[s][e]/this.invertedYRatio):(P=this.drawStackedColumnPaths(l(o({},v),{xDivision:_,barWidth:M,zeroH:S})),k=this.series[s][e]/this.yRatio[x]);const L=this.barHelpers.drawGoalLine({barXPosition:P.barXPosition,barYPosition:P.barYPosition,goalX:P.goalX,goalY:P.goalY,barHeight:k,barWidth:M});L&&w.add(L),n=P.y,r=P.x,f.push(r),m.push(n);const I=this.barHelpers.getPathFillColor(t,s,e,u);let E="";const R=i.globals.isBarHorizontal?"apexcharts-flip-x":"apexcharts-flip-y",D="bottom"===this.barHelpers.arrBorderRadius[u][e]&&i.seriesData.series[u][e]>0||"top"===this.barHelpers.arrBorderRadius[u][e]&&i.seriesData.series[u][e]<0,F=c&&!D&&this.getPreviousFlip(u,e);(D||F)&&(E=R),F&&(E+=" apexcharts-flip-held",d=!0),b=this.renderSeries(l(o({realIndex:u,pathFill:I.color},I.useRangeColor?{lineFill:I.color}:{}),{j:e,i:s,columnGroupIndex:g,pathFrom:P.pathFrom,pathTo:P.pathTo,strokeWidth:a,elSeries:b,x:r,y:n,series:t,barHeight:k,barWidth:M,elDataLabelsWrap:y,elGoalsMarkers:w,type:"bar",visibleSeries:g,classes:E}))}i.globals.seriesXvalues[u]=f,i.globals.seriesYvalues[u]=m,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(b)}return d&&this.settleHeldMirrors(),a}settleHeldMirrors(){const t=this.w;if(!Wt.isBrowser())return;const e=t.config.chart.animations,i=(e.dynamicAnimation.speed||0)+(e.speed||0)+100;setTimeout(()=>{!t.globals.isDestroyed&&Ht.elementExists(t.dom.baseEl)&&t.dom.baseEl.querySelectorAll(".apexcharts-flip-held").forEach(t=>{t.classList.remove("apexcharts-flip-held","apexcharts-flip-y","apexcharts-flip-x")})},i)}initialPositions(t,e,i,s,a,r,n){const o=this.w;let l,h;if(this.isHorizontal){s=o.layout.gridHeight/o.globals.dataPoints;const t=o.config.plotOptions.bar.barHeight;l=-1===String(t).indexOf("%")?parseInt(t,10):s*parseInt(t,10)/100,r=o.globals.padHorizontal+(this.isReversed?o.layout.gridWidth-this.baseLineInvertedY:this.baseLineInvertedY),e=(s-l)/2}else{h=i=o.layout.gridWidth/o.globals.dataPoints;const e=o.config.plotOptions.bar.columnWidth;o.axisFlags.isXNumeric&&o.globals.dataPoints>1?h=(i=o.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[n]:o.layout.gridHeight-this.baseLineY[n],t=o.globals.padHorizontal+(i-h)/2}const c=o.globals.barGroups.length||1;return{x:t,y:e,yDivision:s,xDivision:i,barHeight:(null!=l?l:0)/c,barWidth:(null!=h?h:0)/c,zeroH:a,zeroW:r}}drawStackedBarPaths({indexes:t,barHeight:e,strokeWidth:i,zeroW:s,x:a,y:r,columnGroupIndex:n,seriesGroup:o,yDivision:l,elSeries:h}){var c,d,u,p,g;const f=this.w,m=r+n*e;let x;const b=t.i,y=t.j,w=t.realIndex,v=t.translationsIndex;let _=0;for(let t=0;t<this.groupCtx.prevXF.length;t++)_+=this.groupCtx.prevXF[t][y];let A=b;if(f.config.series[w].name&&(A=o.indexOf(f.config.series[w].name)),A>0){let t=s;this.groupCtx.prevXVal[A-1][y]<0?t=(null==(c=this.series[b])?void 0:c[y])>=0?this.groupCtx.prevX[A-1][y]+_-2*(this.isReversed?_:0):this.groupCtx.prevX[A-1][y]:this.groupCtx.prevXVal[A-1][y]>=0&&(t=(null==(d=this.series[b])?void 0:d[y])>=0?this.groupCtx.prevX[A-1][y]:this.groupCtx.prevX[A-1][y]-_+2*(this.isReversed?_:0)),x=t}else x=s;a=null===(null==(u=this.series[b])?void 0:u[y])?x:x+(null==(p=this.series[b])?void 0:p[y])/this.invertedYRatio-2*(this.isReversed?(null==(g=this.series[b])?void 0:g[y])/this.invertedYRatio:0);const S=this.barHelpers.getBarpaths({barYPosition:m,barHeight:e,x1:x,x2:a,strokeWidth:i,isReversed:this.isReversed,series:this.series,realIndex:t.realIndex,seriesGroup:o,i:b,j:y,w:f});return this.barHelpers.barBackground({j:y,i:b,y1:m,y2:e,elSeries:h}),r+=l,{pathTo:S.pathTo,pathFrom:S.pathFrom,goalX:this.barHelpers.getGoalValues("x",s,null,w,y,v),barXPosition:x,barYPosition:m,x:a,y:r}}drawStackedColumnPaths({indexes:t,x:e,y:i,xDivision:s,barWidth:a,zeroH:r,columnGroupIndex:n,seriesGroup:o,elSeries:l}){var h,c,d,u,p,g,f,m,x;const b=this.w,y=t.i,w=t.j,v=t.bc,_=t.realIndex,A=t.translationsIndex;if(b.axisFlags.isXNumeric){let t=b.seriesData.seriesX[_][w];t||(t=0),e=(t-b.globals.minX)/this.xRatio-a/2*b.globals.barGroups.length}const S=e+n*a;let C,k=0;for(let t=0;t<this.groupCtx.prevYF.length;t++)k+=isNaN(this.groupCtx.prevYF[t][w])?0:this.groupCtx.prevYF[t][w];let M=y;if(o&&(M=o.indexOf(b.seriesData.seriesNames[_])),M>0&&!b.axisFlags.isXNumeric||M>0&&b.axisFlags.isXNumeric&&b.seriesData.seriesX[_-1][w]===b.seriesData.seriesX[_][w]){let t,e;const i=Math.min(this.yRatio.length+1,_+1);if(void 0!==this.groupCtx.prevY[M-1]&&this.groupCtx.prevY[M-1].length)for(let t=1;t<i;t++)if(!isNaN(null==(h=this.groupCtx.prevY[M-t])?void 0:h[w])){e=this.groupCtx.prevY[M-t][w];break}for(let s=1;s<i;s++){if((null==(c=this.groupCtx.prevYVal[M-s])?void 0:c[w])<0){t=(null==(d=this.series[y])?void 0:d[w])>=0?e-k+2*(this.isReversed?k:0):e;break}if((null==(u=this.groupCtx.prevYVal[M-s])?void 0:u[w])>=0){t=(null==(p=this.series[y])?void 0:p[w])>=0?e:e+k-2*(this.isReversed?k:0);break}}void 0===t&&(t=b.layout.gridHeight),C=(null==(g=this.groupCtx.prevYF[0])?void 0:g.every(t=>0===t))&&this.groupCtx.prevYF.slice(1,M).every(t=>t.every(t=>isNaN(t)))?r:t}else C=r;i=(null==(f=this.series[y])?void 0:f[w])?C-(null==(m=this.series[y])?void 0:m[w])/this.yRatio[A]+2*(this.isReversed?(null==(x=this.series[y])?void 0:x[w])/this.yRatio[A]:0):C;const P=this.barHelpers.getColumnPaths({barXPosition:S,barWidth:a,y1:C,y2:i,yRatio:this.yRatio[A],strokeWidth:this.strokeWidth,isReversed:this.isReversed,series:this.series,seriesGroup:o,realIndex:t.realIndex,i:y,j:w,w:b});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,r,_,w,0),barXPosition:S,x:b.axisFlags.isXNumeric?e:e+s,y:i}}},rangeBar:class extends Mi{draw(t,e){var i,s,a,r,n,l,h,c,d;const u=this.w,p=new I(this.w);this.rangeBarOptions=this.w.config.plotOptions.rangeBar,this.series=t,this.seriesRangeStart=u.rangeData.seriesRangeStart,this.seriesRangeEnd=u.rangeData.seriesRangeEnd,this.barHelpers.initVariables(t);const g=p.group({class:"apexcharts-rangebar-series apexcharts-plot-series"});for(let f=0;f<t.length;f++){let m,x;const b=u.globals.comboCharts?e[f]:f,{columnGroupIndex:y}=this.barHelpers.getGroupIndex(b),w=p.group({class:"apexcharts-series",seriesName:Ht.escapeString(u.seriesData.seriesNames[b]),rel:f+1,"data:realIndex":b});X.addCollapsedClassToSeries(this.w,w,b),t[f].length>0&&(this.visibleI=this.visibleI+1);let v=0;this.yRatio.length>1&&(this.yaxisIndex=u.globals.seriesYAxisReverseMap[b][0],v=b);const _=this.barHelpers.initialPositions(b),{y:A,zeroW:S,x:C,zeroH:k}=_;let M=null!=(i=_.barWidth)?i:0,P=null!=(s=_.barHeight)?s:0;const L=null!=(a=_.yDivision)?a:0,I=null!=(r=_.xDivision)?r:0;x=A,m=C;const E=p.group({class:"apexcharts-datalabels","data:realIndex":b}),R=p.group({class:"apexcharts-rangebar-goals-markers"});for(let e=0;e<u.globals.dataPoints;e++){const i=this.barHelpers.getStrokeWidth(f,e,b),s=this.seriesRangeStart[f][e],a=this.seriesRangeEnd[f][e];let r=null,p=null,g=null;const A={x:m,y:x,strokeWidth:i,elSeries:w};let C=this.seriesLen;if(u.config.plotOptions.bar.rangeBarGroupRows&&(C=1),void 0===(null==(n=u.config.series[f].data)?void 0:n[e]))break;if(this.isHorizontal){g=x+P*this.visibleI;const t=(L-P*C)/2;if(null==(h=null==(l=u.config.series[f].data)?void 0:l[e])?void 0:h.x){const i=this.detectOverlappingBars({i:f,j:e,barYPosition:g,srty:t,barHeight:P,yDivision:L,initPositions:_});P=i.barHeight,g=i.barYPosition}r=this.drawRangeBarPaths(o({indexes:{i:f,j:e,realIndex:b},barHeight:P,barYPosition:g,zeroW:S,yDivision:L,y1:s,y2:a},A)),M=r.barWidth}else{u.axisFlags.isXNumeric&&(m=(u.seriesData.seriesX[f][e]-u.globals.minX)/this.xRatio-M/2),p=m+M*this.visibleI;const t=(I-M*C)/2;if(null==(d=null==(c=u.config.series[f].data)?void 0:c[e])?void 0:d.x){const i=this.detectOverlappingBars({i:f,j:e,barXPosition:p,srtx:t,barWidth:M,xDivision:I,initPositions:_});M=i.barWidth,p=i.barXPosition}r=this.drawRangeColumnPaths(o({indexes:{i:f,j:e,realIndex:b,translationsIndex:v},barWidth:M,barXPosition:p,zeroH:k,xDivision:I},A)),P=r.barHeight}const D=this.barHelpers.drawGoalLine({barXPosition:r.barXPosition,barYPosition:g,goalX:r.goalX,goalY:r.goalY,barHeight:P,barWidth:M});D&&R.add(D),x=r.y,m=r.x;const F=this.barHelpers.getPathFillColor(t,f,e,b);this.renderSeries({realIndex:b,pathFill:F.color,lineFill:F.useRangeColor?F.color:u.globals.stroke.colors[b],j:e,i:f,x:m,y:x,y1:s,y2:a,pathFrom:r.pathFrom,pathTo:r.pathTo,strokeWidth:i,elSeries:w,series:t,barHeight:P,barWidth:M,barXPosition:p,barYPosition:g,columnGroupIndex:y,elDataLabelsWrap:E,elGoalsMarkers:R,visibleSeries:this.visibleI,type:"rangebar"})}g.add(w)}return g}detectOverlappingBars({i:t,j:e,barYPosition:i,barXPosition:s,srty:a,srtx:r,barHeight:n,barWidth:o,yDivision:l,xDivision:h,initPositions:c}){var d,u,p,g;const f=this.w;let m=[];const x=null==(u=null==(d=f.globals.seriesRangeName)?void 0:d[t])?void 0:u[e],b=null==(g=null==(p=f.config.series[t].data)?void 0:p[e])?void 0:g.x,y=Array.isArray(b)?b.join(" "):b,w=f.labelData.labels.map(t=>Array.isArray(t)?t.join(" "):t).indexOf(y),v=f.rangeData.seriesRange[t].findIndex(t=>{var e;return t.x===y&&(null==(e=t.overlaps)?void 0:e.size)>0});return this.isHorizontal?(i=f.config.plotOptions.bar.rangeBarGroupRows?a+l*w:a+n*this.visibleI+l*w,v>-1&&!f.config.plotOptions.bar.rangeBarOverlap&&(m=Array.from(f.rangeData.seriesRange[t][v].overlaps),m.indexOf(x)>-1&&(i=(n=c.barHeight/m.length)*this.visibleI+l*(100-parseInt(this.barOptions.barHeight,10))/100/2+n*(this.visibleI+m.indexOf(x))+l*w))):(w>-1&&!f.labelData.timescaleLabels.length&&(s=f.config.plotOptions.bar.rangeBarGroupRows?r+h*w:r+o*this.visibleI+h*w),v>-1&&!f.config.plotOptions.bar.rangeBarOverlap&&(m=Array.from(f.rangeData.seriesRange[t][v].overlaps),m.indexOf(x)>-1&&(s=(o=c.barWidth/m.length)*this.visibleI+h*(100-parseInt(this.barOptions.barWidth,10))/100/2+o*(this.visibleI+m.indexOf(x))+h*w))),{barYPosition:i,barXPosition:s,barHeight:n,barWidth:o}}drawRangeColumnPaths({indexes:t,x:e,xDivision:i,barWidth:s,barXPosition:a,zeroH:r}){var n,o;const l=this.w,{i:h,j:c,realIndex:d,translationsIndex:u}=t,p=this.yRatio[u],g=this.getRangeValue(d,c);let f=Math.min(g.start,g.end),m=Math.max(g.start,g.end);void 0===(null==(n=this.series[h])?void 0:n[c])||null===(null==(o=this.series[h])?void 0:o[c])?f=r:(f=r-f/p,m=r-m/p);const x=Math.abs(m-f),b=this.barHelpers.getColumnPaths({barXPosition:a,barWidth:s,y1:f,y2:m,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:s});e=t.x,a=t.barXPosition}else e+=i;return{pathTo:b.pathTo,pathFrom:b.pathFrom,barHeight:x,x:e,y:g.start<0&&g.end<0?f:m,goalY:this.barHelpers.getGoalValues("y",null,r,d,c,u),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:i,y2:s,yDivision:a,barHeight:r,barYPosition:n,zeroW:o}){const l=this.w,{realIndex:h,j:c}=t,d=this.preventBarOverflow(o+i/this.invertedYRatio),u=this.preventBarOverflow(o+s/this.invertedYRatio),p=this.getRangeValue(h,c),g=Math.abs(u-d),f=this.barHelpers.getBarpaths({barYPosition:n,barHeight:r,x1:d,x2:u,strokeWidth:this.strokeWidth,series:this.seriesRangeEnd,i:h,realIndex:h,j:c,w:l});return l.axisFlags.isXNumeric||(e+=a),{pathTo:f.pathTo,pathFrom:f.pathFrom,barWidth:g,x:p.start<0&&p.end<0?d:u,goalX:this.barHelpers.getGoalValues("x",o,null,h,c,0),y:e}}getRangeValue(t,e){const i=this.w;return{start:i.rangeData.seriesRangeStart[t][e],end:i.rangeData.seriesRangeEnd[t][e]}}},candlestick:Xi,boxPlot:Xi,violin:class extends Mi{draw(t,e,i){const s=this.w,a=new I(this.w),r=new M(this.w);this.violinOptions=s.config.plotOptions.violin,this.pointsOptions=this.violinOptions.points,this.bandwidthScale=this.violinOptions.bandwidthScale||1,this.normalize=this.violinOptions.normalize||"individual",this.distributed=s.config.plotOptions.bar.distributed,this.isHorizontal=s.config.plotOptions.bar.horizontal,this.coreUtils=new _(this.w),t=this.coreUtils.getLogSeries(t),this.series=t,this.yRatio=this.coreUtils.getLogYRatios(this.yRatio),this.barHelpers.initVariables(t);const n=a.group({class:"apexcharts-violin-series apexcharts-plot-series"});for(let e=0;e<t.length;e++){let o,l;const h=[],c=[],d=s.globals.comboCharts?i[e]:e,{columnGroupIndex:u}=this.barHelpers.getGroupIndex(d),p=a.group({class:"apexcharts-series",seriesName:Ht.escapeString(s.seriesData.seriesNames[d]),rel:e+1,"data:realIndex":d});X.addCollapsedClassToSeries(this.w,p,d),t[e].length>0&&(this.visibleI=this.visibleI+1);let g=0;this.yRatio.length>1&&(this.yaxisIndex=s.globals.seriesYAxisReverseMap[d][0],g=d);const f=this.barHelpers.initialPositions(d),{y:m,barHeight:x,yDivision:b,zeroW:y,x:w,barWidth:v,xDivision:_,zeroH:A}=f;l=m,o=w,c.push(o+(null!=v?v:0)/2);const S=a.group({class:"apexcharts-datalabels","data:realIndex":d});if(this.seriesMaxWeight=0,"group"===this.normalize){(s.violinData.seriesViolinDensity[d]||[]).forEach(t=>{t&&t.maxWeight>this.seriesMaxWeight&&(this.seriesMaxWeight=t.maxWeight)})}const C=[];for(let i=0;i<s.globals.dataPoints;i++){const a=this.barHelpers.getStrokeWidth(e,i,d),n=this.isHorizontal?this.drawHorizontalViolin({indexes:{i:e,j:i,realIndex:d,translationsIndex:g},y:l,yDivision:b,barHeight:x,zeroW:y}):this.drawVerticalViolin({indexes:{i:e,j:i,realIndex:d,translationsIndex:g},x:o,xDivision:_,barWidth:v,zeroH:A});o=n.x,l=n.y,i>0&&c.push(n.center),h.push(n.alongRepresentative);const f=this.buildPointsSubPath({realIndex:d,j:i,center:n.center,halfExtent:n.halfExtent,alongFn:n.alongFn,density:n.density,maxWeight:n.maxWeight});f.length&&C.push({groups:f,j:i});const m=r.fillPath({seriesNumber:this.distributed?i:d,dataPointIndex:i,color:this.distributed?s.globals.colors[i]:void 0,value:t[e][i]});this.renderSeries({realIndex:d,pathFill:m,lineFill:s.globals.stroke.colors[d],j:i,i:e,pathFrom:n.pathFrom,pathTo:n.pathTo,strokeWidth:a,elSeries:p,x:o,y:l,series:t,columnGroupIndex:u,barHeight:x,barWidth:v,elDataLabelsWrap:S,visibleSeries:this.visibleI,type:"violin"});const w=p.node.querySelector(`path.apexcharts-violin-area[j='${i}']`);w&&isFinite(n.alongRepresentative)&&w.setAttribute(this.isHorizontal?"cx":"cy",`${n.alongRepresentative}`)}Li({graphics:a,w:s,elSeries:p,pointsByCat:C,options:this.pointsOptions,distributed:this.distributed,realIndex:d,wrapClass:"apexcharts-violin-points-wrap",pointClass:"apexcharts-violin-points"}),s.globals.seriesXvalues[d]=c,s.globals.seriesYvalues[d]=h,n.add(p)}return n}drawVerticalViolin({indexes:t,x:e,xDivision:i,barWidth:s,zeroH:a}){var r,n,o;const l=this.w,{realIndex:h,j:c,translationsIndex:d}=t,u=this.yRatio[d];l.axisFlags.isXNumeric&&(e=(l.seriesData.seriesX[h][c]-l.globals.minX)/this.xRatio-s/2);const p=e+s*this.visibleI+s/2,g=s/2,f=this.getDensity(h,c),m=this.effectiveMaxWeight(f),x=t=>a-this.logVal(t,h)/u,b=this.buildBodyPath({nodes:f.nodes,center:p,halfExtent:g,maxWeight:m,vertical:!0,alongFn:x,collapsed:!1});let y=null;const w=null==(n=null==(r=this.ctx)?void 0:r.morphTypeChange)?void 0:n.getInitialPathFor(h,c);return w?y=w:l.globals.previousPaths.length>0&&(y=this.getPreviousPath(h,c,b)),null==y&&(y=this.buildBodyPath({nodes:f.nodes,center:p,halfExtent:g,maxWeight:m,vertical:!0,alongFn:x,collapsed:!0})),l.axisFlags.isXNumeric||(e+=i),{pathTo:b,pathFrom:y,x:e,y:a,center:p,halfExtent:g,alongFn:x,density:f,maxWeight:m,alongRepresentative:x(null!=(o=this.series[t.i][c])?o:0)}}drawHorizontalViolin({indexes:t,y:e,yDivision:i,barHeight:s,zeroW:a}){var r,n,o;const l=this.w,{realIndex:h,j:c}=t,d=this.invertedYRatio;l.axisFlags.isXNumeric&&(e=(l.seriesData.seriesX[h][c]-l.globals.minX)/this.invertedXRatio-s/2);const u=e+s*this.visibleI+s/2,p=s/2,g=this.getDensity(h,c),f=this.effectiveMaxWeight(g),m=t=>a+this.logVal(t,h)/d,x=this.buildBodyPath({nodes:g.nodes,center:u,halfExtent:p,maxWeight:f,vertical:!1,alongFn:m,collapsed:!1});let b=null;const y=null==(n=null==(r=this.ctx)?void 0:r.morphTypeChange)?void 0:n.getInitialPathFor(h,c);return y?b=y:l.globals.previousPaths.length>0&&(b=this.getPreviousPath(h,c,x)),null==b&&(b=this.buildBodyPath({nodes:g.nodes,center:u,halfExtent:p,maxWeight:f,vertical:!1,alongFn:m,collapsed:!0})),l.axisFlags.isXNumeric||(e+=i),{pathTo:x,pathFrom:b,x:a,y:e,center:u,halfExtent:p,alongFn:m,maxWeight:f,density:g,alongRepresentative:m(null!=(o=this.series[t.i][c])?o:0)}}getDensity(t,e){var i;const s=null==(i=this.w.violinData.seriesViolinDensity[t])?void 0:i[e];if(!s||!s.values.length)return{nodes:[],maxWeight:0};const a=s.values.map((t,e)=>e);a.sort((t,e)=>s.values[t]-s.values[e]);const r=[];let n=null;for(const t of a){const e=s.values[t];null!==n&&e===n||(r.push({v:e,w:s.weights[t]}),n=e)}return{nodes:r,maxWeight:s.maxWeight}}effectiveMaxWeight(t){return"group"===this.normalize&&this.seriesMaxWeight>0?this.seriesMaxWeight:t.maxWeight}buildBodyPath({nodes:t,center:e,halfExtent:i,maxWeight:s,vertical:a,alongFn:r,collapsed:n}){const o=new I(this.w);if(0===t.length){const t=r(0);return a?o.move(e,t)+o.line(e,t):o.move(t,e)+o.line(t,e)}const l=t=>{if(n||s<=0)return 0;const e=t/s*i*this.bandwidthScale;return Math.min(i,Math.max(0,e))},h=[],c=[];for(let i=0;i<t.length;i++){const s=r(t[i].v),n=l(t[i].w);a?(h.push([e+n,s]),c.push([e-n,s])):(h.push([s,e+n]),c.push([s,e-n]))}return c.reverse(),this.smoothSegment(h,a,!1)+this.smoothSegment(c,a,!0)+"z"}smoothSegment(t,e,i){const s=new I(this.w),a=t[0];let r=i?s.line(a[0],a[1]):s.move(a[0],a[1]);if(t.length<3||!this.strictlyMonotonic(t,e)){for(let e=1;e<t.length;e++)r+=s.line(t[e][0],t[e][1]);return r}const n=t.map(([t,i])=>e?[i,t]:[t,i]),o=Yi.points(n),l=e?o.map(Oi):o;return r+=zi(l),r}strictlyMonotonic(t,e){const i=e?1:0;for(let e=1;e<t.length;e++)if(t[e][i]===t[e-1][i])return!1;return!0}buildPointsSubPath({realIndex:t,j:e,center:i,halfExtent:s,alongFn:a,density:r,maxWeight:n}){var o;return Pi({w:this.w,points:null==(o=this.w.violinData.seriesViolinPoints[t])?void 0:o[e],seedA:t,seedB:e,center:i,halfExtent:s,alongFn:a,isHorizontal:this.isHorizontal,options:this.pointsOptions,clampAt:t=>this.halfWidthAtValue(t,r,s,n)})}halfWidthAtValue(t,e,i,s){const{nodes:a}=e,r=null!=s?s:e.maxWeight;if(!a.length||r<=0)return 0;const n=t=>Math.min(i,t/r*i*this.bandwidthScale);if(t<=a[0].v)return n(a[0].w);if(t>=a[a.length-1].v)return n(a[a.length-1].w);for(let e=1;e<a.length;e++)if(t<=a[e].v){const i=a[e-1],s=a[e],r=s.v===i.v?0:(t-i.v)/(s.v-i.v);return n(i.w+(s.w-i.w)*r)}return 0}logVal(t,e){return this.coreUtils.getLogValAtSeriesIndex(t,e)}},pie:es,donut:es,polarArea:es,radialBar:class extends es{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){var e;const i=this.w,s=new I(this.w),a=s.group({class:"apexcharts-radialbar"});if(i.globals.noData)return a;const r=s.group(),n=this.defaultSize/2,o=i.layout.gridWidth/2;let l=this.defaultSize/2.05;i.config.chart.sparkline.enabled||(l=l-i.config.stroke.width-i.config.chart.dropShadow.blur);const h=i.globals.fill.colors,c=i.config.plotOptions.radialBar,d=Array.isArray(c.bands)&&c.bands.length>0,u=d&&c.bandsStyle&&c.bandsStyle.hideTrackWhenPresent,p="needle"===c.shape;if(c.track.show&&!u){const e=this.drawTracks({size:l,centerX:o,centerY:n,colorArr:h,series:t});r.add(e)}if(d){const e=this.drawBands({size:l,centerX:o,centerY:n,series:t});r.add(e)}const g=this.drawArcs({size:l,centerX:o,centerY:n,colorArr:h,series:t,skipValueArc:p&&!(null==(e=c.needle)?void 0:e.showValueArc)});if(c.ticks&&c.ticks.show){const e=this.drawTicks({size:l,centerX:o,centerY:n,series:t});if(this.initialAnim&&!i.globals.dataChanged&&!i.globals.resized&&Wt.isBrowser()&&i.globals.shouldAnimate){const t=e.node;t.style.opacity="0",t.style.transition="opacity 280ms ease-out";const s=i.config.chart.animations.speed||800;setTimeout(()=>{t.style.opacity="1"},s)}r.add(e)}if(p){const e=this.drawNeedle({size:l,centerX:o,centerY:n,series:t});r.add(e)}let f=360;i.config.plotOptions.radialBar.startAngle<0&&(f=this.totalAngle);const m=(360-f)/360;if(i.globals.radialSize=l-l*m,this.radialDataLabels.value.show){const t=Math.max(this.radialDataLabels.value.offsetY,this.radialDataLabels.name.offsetY);i.globals.radialSize+=t*m}return r.add(g.g),"front"===i.config.plotOptions.radialBar.hollow.position&&(g.g.add(g.elHollow),g.dataLabels&&g.g.add(g.dataLabels)),a.add(r),a}drawTracks(t){const e=this.w,i=new I(this.w),s=i.group({class:"apexcharts-tracks"}),a=new P(this.w),r=new M(this.w),n=this.getStrokeWidth(t);t.size=t.size-n/2;for(let o=0;o<t.series.length;o++){const l=i.group({class:"apexcharts-radialbar-track apexcharts-track"});s.add(l),l.attr({rel:o+1}),t.size=t.size-n-this.margin;const h=e.config.plotOptions.radialBar.track,c=r.fillPath({seriesNumber:0,size:t.size,fillColors:Array.isArray(h.background)?h.background[o]:h.background,solid:!0}),d=this.trackStartAngle;let u=this.trackEndAngle;Math.abs(u)+Math.abs(d)>=360&&(u=360-Math.abs(this.startAngle)-.1);const p=i.drawPath({d:"",stroke:c,strokeWidth:n*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-"+o),this.animatePaths(p,{centerX:t.centerX,centerY:t.centerY,endAngle:u,startAngle:d,size:t.size,i:o,totalItems:2,animBeginArr:0,dur:0,isTrack:!0})}return s}drawArcs(t){var e;const i=this.w,s=new I(this.w),a=new M(this.w),r=new P(this.w),n=s.group(),o=this.getStrokeWidth(t);t.size=t.size-o/2;let l=i.config.plotOptions.radialBar.hollow.background;const h=t.size-o*t.series.length-this.margin*t.series.length-o*parseInt(i.config.plotOptions.radialBar.track.strokeWidth,10)/100/2,c=h-i.config.plotOptions.radialBar.hollow.margin;void 0!==i.config.plotOptions.radialBar.hollow.image&&(l=this.drawHollowImage(t,n,h,l));const d=this.drawHollow({size:c,centerX:t.centerX,centerY:t.centerY,fill:l||"transparent"});if(i.config.plotOptions.radialBar.hollow.dropShadow.enabled){const t=i.config.plotOptions.radialBar.hollow.dropShadow;r.dropShadow(d,t)}let u=1;!this.radialDataLabels.total.show&&i.seriesData.series.length>1&&(u=0);let p=null;if(this.radialDataLabels.show){const e=i.dom.Paper.findOne(".apexcharts-datalabels-group");p=this.renderInnerDataLabels(e,this.radialDataLabels,{hollowSize:h,centerX:t.centerX,centerY:t.centerY,opacity:u})}"back"===i.config.plotOptions.radialBar.hollow.position&&(n.add(d),p&&n.add(p));let g=!1;i.config.plotOptions.radialBar.inverseOrder&&(g=!0);const f=!0===(null==(e=this.ctx.morphTypeChange)?void 0:e.isActive());for(let e=g?t.series.length-1:0;g?e>=0:e<t.series.length;g?e--:e++){const l=s.group({class:"apexcharts-series apexcharts-radial-series",seriesName:Ht.escapeString(i.seriesData.seriesNames[e])});n.add(l),l.attr({rel:e+1,"data:realIndex":e}),X.addCollapsedClassToSeries(this.w,l,e),t.size=t.size-o-this.margin;const h=a.fillPath({seriesNumber:e,size:t.size,value:t.series[e]}),c=this.startAngle;let d;const u=i.config.plotOptions.radialBar,p="number"==typeof u.min?u.min:0,g="number"==typeof u.max?u.max:100,m=g===p?1:g-p,x=t=>{const e=Math.min(Math.max(t,p),g);return Math.max(0,(e-p)/m)},b=x(Ht.negToZero(t.series[e]));let y,w=Math.round(this.totalAngle*b)+this.startAngle;i.globals.dataChanged&&(d=this.startAngle,y=Math.round(this.totalAngle*x(Ht.negToZero(i.globals.previousPaths[e])))+d);Math.abs(w)+Math.abs(c)>360&&(w-=.01);Math.abs(y)+Math.abs(d)>360&&(y-=.01);const v=w-c,_=Array.isArray(i.config.stroke.dashArray)?i.config.stroke.dashArray[e]:i.config.stroke.dashArray,A=f?this.ctx.morphTypeChange.getInitialPathFor(e,0):null,S=f?this.ctx.morphTypeChange.getFromType():null,C=!!A&&("bar"===S||"funnel"===S||"pyramid"===S||"pie"===S||"donut"===S||"polarArea"===S),k=s.drawPath({d:A||"",stroke:C||t.skipValueArc?"transparent":h,strokeWidth:C||t.skipValueArc?0:o,fill:C?h:"none",fillOpacity:i.config.fill.opacity,classes:"apexcharts-radialbar-area apexcharts-radialbar-slice-"+e,strokeDashArray:_}),M=c+v/2,P=Ht.polarToCartesian(t.centerX,t.centerY,t.size,M);if(I.setAttrs(k.node,{"data:angle":v,"data:value":t.series[e],"data:cx":P.x,"data:cy":P.y}),i.config.chart.dropShadow.enabled){const t=i.config.chart.dropShadow;r.dropShadow(k,t,e)}if(r.setSelectionFilter(k,0,e),this.addListeners(k,this.radialDataLabels),l.add(k),k.attr({index:0,j:e}),this.barLabels.enabled){const a=Ht.polarToCartesian(t.centerX,t.centerY,t.size,c),r=this.barLabels.formatter(i.seriesData.seriesNames[e],{seriesIndex:e,w:i}),n=["apexcharts-radialbar-label"];this.barLabels.onClick||n.push("apexcharts-no-click");let o=this.barLabels.useSeriesColors?i.globals.colors[e]:i.config.chart.foreColor;o||(o=i.config.chart.foreColor);const h=a.x+this.barLabels.offsetX,d=a.y+this.barLabels.offsetY,u=s.drawText({x:h,y:d,text:r,textAnchor:"end",dominantBaseline:"middle",fontFamily:this.barLabels.fontFamily,fontWeight:this.barLabels.fontWeight,fontSize:this.barLabels.fontSize,foreColor:o,cssClass:n.join(" ")});u.on("click",this.onBarLabelClick),u.attr({rel:e+1}),0!==c&&u.attr({"transform-origin":`${h} ${d}`,transform:`rotate(${c} 0 0)`}),l.add(u)}let L=0;if(!this.initialAnim||i.globals.resized||i.globals.dataChanged||(L=i.config.chart.animations.speed),i.globals.dataChanged&&(L=i.config.chart.animations.dynamicAnimation.speed),this.animDur=L/(1.2*t.series.length)+this.animDur,this.animBeginArr.push(this.animDur),f&&A){const e=this.ctx.morphTypeChange.getSpeed(),i=this.getPiePath({me:this,startAngle:c,angle:v,size:t.size});if(C){const s=this.ctx.morphTypeChange.buildRingSegmentPath(t.centerX,t.centerY,t.size,o,c,c+v);k.animate(e).plot(s,"polygons").after(function(){this.attr({d:i,fill:"none",stroke:t.skipValueArc?"transparent":h,"stroke-width":t.skipValueArc?0:o})})}else k.animate(e).plot(i,"polygons").attr({"stroke-width":o})}else this.animatePaths(k,{centerX:t.centerX,centerY:t.centerY,endAngle:w,startAngle:c,prevEndAngle:y,prevStartAngle:d,size:t.size,i:e,totalItems:2,animBeginArr:this.animBeginArr,dur:L,shouldSetPrevPaths:!0})}return{g:n,elHollow:d,dataLabels:p}}_angleAtValue(t){const e=this.w.config.plotOptions.radialBar,i="number"==typeof e.min?e.min:0,s="number"==typeof e.max?e.max:100,a=s===i?i+1:s,r=(Math.max(i,Math.min(a,Number(t)))-i)/(a-i);return this.startAngle+r*(this.endAngle-this.startAngle)}_describeArc(t,e,i,s,a){const r=Ht.polarToCartesian(t,e,i,a),n=Ht.polarToCartesian(t,e,i,s),o=a-s,l=Math.abs(o)>180?1:0;return`M ${r.x} ${r.y} A ${i} ${i} 0 ${l} 0 ${n.x} ${n.y}`}drawBands(t){const e=this.w,i=new I(this.w),s=e.config.plotOptions.radialBar,a=s.bands||[],r=i.group({class:"apexcharts-gauge-bands"}),n=this.getStrokeWidth(t),o=t.size-n/2-n-this.margin,l=n*parseInt(s.bandsStyle.strokeWidth,10)/100,h="number"==typeof s.min?s.min:0,c="number"==typeof s.max?s.max:100,d=c===h?0:(s.bandsStyle.gap||0)*((this.endAngle-this.startAngle)/(c-h));for(let e=0;e<a.length;e++){const n=a[e];if(void 0===n.from||void 0===n.to)continue;const h=this._angleAtValue(n.from),c=this._angleAtValue(n.to),u=Math.min(h,c)+d/2,p=Math.max(h,c)-d/2;if(p-u<=0)continue;const g=i.drawPath({d:this._describeArc(t.centerX,t.centerY,o,u,p),stroke:n.color||"#ccc",strokeWidth:l,fill:"none",strokeLinecap:s.bandsStyle.linecap||"butt",classes:"apexcharts-gauge-band"});g.node.setAttribute("data-band-index",String(e)),r.add(g)}return r}drawTicks(t){var e,i,s,a;const r=this.w,n=new I(this.w),o=r.config.plotOptions.radialBar,l=o.ticks,h=n.group({class:"apexcharts-gauge-ticks"}),c=this.getStrokeWidth(t),d=t.size-c/2-c-this.margin,u="number"==typeof o.min?o.min:0,p="number"==typeof o.max?o.max:100,g=Math.max(2,null!=(i=null==(e=l.major)?void 0:e.count)?i:11),f=Math.max(0,null!=(a=null==(s=l.minor)?void 0:s.count)?a:0),m=(e,i,s)=>{var a,r,o;const c=this._angleAtValue(e),u=null!=(a=i.length)?a:8,p="inside"===i.placement?d-u:d,g="inside"===i.placement?d:d+u,f=Ht.polarToCartesian(t.centerX,t.centerY,p,c),m=Ht.polarToCartesian(t.centerX,t.centerY,g,c),x=n.drawLine(f.x,f.y,m.x,m.y,i.color||(s?"#666":"#999"),0,i.width||(s?2:1));if(h.add(x),s&&(null==(r=l.labels)?void 0:r.show)){const s=("inside"===i.placement?p:g)+("inside"===i.placement?-1:1)*(null!=(o=l.labels.offset)?o:6),a=Ht.polarToCartesian(t.centerX,t.centerY,s,c),r="function"==typeof l.labels.formatter?l.labels.formatter(e):String(e),d=n.drawText({x:a.x,y:a.y,text:r,textAnchor:"middle",dominantBaseline:"middle",fontFamily:l.labels.fontFamily,fontSize:l.labels.fontSize,fontWeight:l.labels.fontWeight,foreColor:l.labels.color,cssClass:"apexcharts-gauge-tick-label"});h.add(d)}};for(let t=0;t<g;t++){if(m(u+t/(g-1)*(p-u),l.major||{},!0),t<g-1&&f>0)for(let e=1;e<=f;e++){m(u+(t+e/(f+1))/(g-1)*(p-u),l.minor||{},!1)}}return h}drawNeedle(t){var e,i,s,a,r;const n=this.w,o=new I(this.w),l=n.config.plotOptions.radialBar.needle||{},h=o.group({class:"apexcharts-gauge-needle"});if(!t.series||0===t.series.length)return h;const c=this.getStrokeWidth(t),d=t.size-c/2-c-this.margin,u="string"==typeof l.length&&l.length.endsWith("%")?d*parseInt(l.length,10)/100:Number(l.length||.85*d),p=null!=(e=l.baseWidth)?e:4,g=null!=(i=l.tipWidth)?i:1,f=l.color||"#333",m=t.centerX,x=Number(null!=(s=l.offsetY)?s:0),b=t.centerY+x,y=`M ${m+p/2} ${b} A ${p/2} ${p/2} 0 0 1 ${m-p/2} ${b} L ${m-g/2} ${b-u} L ${m+g/2} ${b-u} Z`,w=o.drawPath({d:y,stroke:f,strokeWidth:0,fill:f,classes:"apexcharts-gauge-needle-shape"});h.add(w);const v=Number(t.series[0]),_=this._angleAtValue(v),A=this.initialAnim&&!n.globals.dataChanged&&!n.globals.resized,S=this.ctx,C="number"==typeof S._lastNeedleAngle?S._lastNeedleAngle:this.startAngle;S._lastNeedleAngle=_;if(Wt.isBrowser()&&n.globals.shouldAnimate&&(A||n.globals.dataChanged)&&C!==_){const t=h.node;t.setAttribute("transform-origin",`${m} ${b}`),t.setAttribute("transform",`rotate(${C})`);const e=(null==(a=l.animation)?void 0:a.duration)&&Number(l.animation.duration)||l.animationSpeed&&Number(l.animationSpeed)||(null==(r=n.config.chart.animations.dynamicAnimation)?void 0:r.speed)||n.config.chart.animations.speed||800,i=1.70158,s=i+1,o=A?t=>1+s*Math.pow(t-1,3)+i*Math.pow(t-1,2):t=>1-Math.pow(1-t,3);null!=n.globals.radialNeedleRAF&&(ct.cancelAnimationFrame(n.globals.radialNeedleRAF),n.globals.radialNeedleRAF=null);const c=performance.now(),d=i=>{if(this.w.globals.isDestroyed)return void(n.globals.radialNeedleRAF=null);const s=Math.max(0,Math.min(1,(i-c)/e)),a=C+(_-C)*o(s);t.setAttribute("transform",`rotate(${a})`),n.globals.radialNeedleRAF=s<1?ct.requestAnimationFrame(d):null};n.globals.radialNeedleRAF=ct.requestAnimationFrame(d)}else h.attr({"transform-origin":`${m} ${b}`,transform:`rotate(${_})`});return h}drawHollow(t){var e;const i=new I(this.w),s=this.w.config.plotOptions.radialBar.hollow,a=i.drawCircle(2*t.size),r={class:"apexcharts-radialbar-hollow",cx:t.centerX,cy:t.centerY,r:t.size,fill:t.fill};return(s.stroke||s.strokeDasharray)&&(r.stroke=s.stroke||"transparent",r["stroke-width"]=null!=(e=s.strokeWidth)?e:1,s.strokeDasharray&&(r["stroke-dasharray"]=s.strokeDasharray)),a.attr(r),a}drawHollowImage(t,e,i,s){const a=this.w,r=new M(this.w),n=Ht.randomId(),o=a.config.plotOptions.radialBar.hollow.image;if(a.config.plotOptions.radialBar.hollow.imageClipped)r.clippedImgArea({width:i,height:i,image:o,patternID:`pattern${a.globals.cuid}${n}`}),s=`url(#pattern${a.globals.cuid}${n})`;else{const i=a.config.plotOptions.radialBar.hollow.imageWidth,s=a.config.plotOptions.radialBar.hollow.imageHeight;if(void 0===i&&void 0===s){const i=a.dom.Paper.image(o,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(i)}else{const r=a.dom.Paper.image(o,function(){this.move(t.centerX-i/2+a.config.plotOptions.radialBar.hollow.imageOffsetX,t.centerY-s/2+a.config.plotOptions.radialBar.hollow.imageOffsetY),this.size(i,s)});e.add(r)}}return s}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 i=t.target,s=parseInt(null!=(e=i.getAttribute("rel"))?e:"",10)-1,a=this.barLabels.onClick,r=this.w;a&&a(r.seriesData.seriesNames[s],{w:r,seriesIndex:s})}},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 I(this.w),this.lineColorArr=void 0!==t.globals.stroke.colors?t.globals.stroke.colors:t.globals.colors,this.defaultSize=t.globals.svgHeight<t.globals.svgWidth?t.layout.gridHeight:t.layout.gridWidth,this.isLog=t.config.yaxis[0].logarithmic,this.logBase=t.config.yaxis[0].logBase,this.coreUtils=new _(this.w),this.maxValue=this.isLog?this.coreUtils.getLogVal(this.logBase,t.globals.maxY,0):t.globals.maxY,this.minValue=this.isLog?this.coreUtils.getLogVal(this.logBase,this.w.globals.minY,0):t.globals.minY,this.polygons=t.config.plotOptions.radar.polygons,this.strokeWidth=t.config.stroke.show?t.config.stroke.width:0,this.size=this.defaultSize/2.1-this.strokeWidth-t.config.chart.dropShadow.blur,t.config.xaxis.labels.show&&(this.size=this.size-t.layout.xAxisLabelsWidth/1.75),void 0!==t.config.plotOptions.radar.size&&(this.size=t.config.plotOptions.radar.size),this.dataRadiusOfPercent=[],this.dataRadius=[],this.angleArr=[],this.dataPointsLen=0,this.disAngle=0,this.yaxisLabelsTextsPos=[]}draw(t){const e=this.w,i=new M(this.w),s=[],a=new C(this.w,this.ctx);t.length&&(this.dataPointsLen=t[e.globals.maxValsInArrayIndex].length),this.disAngle=2*Math.PI/this.dataPointsLen;const r=e.layout.gridWidth/2,n=e.layout.gridHeight/2,h=r+e.config.plotOptions.radar.offsetX,c=n+e.config.plotOptions.radar.offsetY,d=this.graphics.group({class:"apexcharts-radar-series apexcharts-plot-series",transform:`translate(${h||0}, ${c||0})`});let u=[],p=null,g=null;if(this.yaxisLabels=this.graphics.group({class:"apexcharts-yaxis"}),t.forEach((t,r)=>{const n=t.length===e.globals.dataPoints,h=this.graphics.group().attr({class:"apexcharts-series","data:longestSeries":n,seriesName:Ht.escapeString(e.seriesData.seriesNames[r]),rel:r+1,"data:realIndex":r});this.dataRadiusOfPercent[r]=[],this.dataRadius[r]=[],this.angleArr[r]=[],t.forEach((t,e)=>{const i=Math.abs(this.maxValue-this.minValue);t-=this.minValue,this.isLog&&(t=this.coreUtils.getLogVal(this.logBase,t,0)),this.dataRadiusOfPercent[r][e]=t/i,this.dataRadius[r][e]=this.dataRadiusOfPercent[r][e]*this.size,this.angleArr[r][e]=e*this.disAngle}),u=this.getDataPointsPos(this.dataRadius[r],this.angleArr[r]);const c=this.createPaths(u,{x:0,y:0});p=this.graphics.group({class:"apexcharts-series-markers-wrap apexcharts-element-hidden"}),g=this.graphics.group({class:"apexcharts-datalabels","data:realIndex":r}),e.globals.delayedElements.push({el:p.node,index:r});const d={i:r,realIndex:r,animationDelay:r,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[r],strokeLineCap:e.config.stroke.lineCap};let f=null;e.globals.previousPaths.length>0&&(f=this.getPreviousPath(r));for(let t=0;t<c.linePathsTo.length;t++){const s=this.graphics.renderPaths(l(o({},d),{pathFrom:null===f?c.linePathsFrom[t]:f,pathTo:c.linePathsTo[t],strokeWidth:Array.isArray(this.strokeWidth)?this.strokeWidth[r]:this.strokeWidth,fill:"none",drawShadow:!1}));h.add(s);const a=i.fillPath({seriesNumber:r}),n=this.graphics.renderPaths(l(o({},d),{pathFrom:null===f?c.areaPathsFrom[t]:f,pathTo:c.areaPathsTo[t],strokeWidth:0,fill:a,drawShadow:!1,drawMask:{type:"radial",cx:0,cy:0,r:this.size}}));if(e.config.chart.dropShadow.enabled){const t=new P(this.w),i=e.config.chart.dropShadow;t.dropShadow(n,Object.assign({},i,{noUserSpaceOnUse:!0}),r)}h.add(n)}t.forEach((t,i)=>{const s=new E(this.w,this.ctx).getMarkerConfig({cssClass:"apexcharts-marker",seriesIndex:r,dataPointIndex:i});s.pSize||(s.pSize=5,s.pointFillColor="transparent",s.pointStrokeColor="transparent",s.pointStrokeWidth=0);const n=this.graphics.drawMarker(u[i].x,u[i].y,s);n.attr("rel",i),n.attr("j",i),n.attr("index",r),n.node.setAttribute("default-marker-size",s.pSize);const l=this.graphics.group({class:"apexcharts-series-markers"});l&&l.add(n),p.add(l),h.add(p);const c=e.config.dataLabels;if(c.enabled){const t=c.formatter(e.seriesData.series[r][i],{seriesIndex:r,dataPointIndex:i,w:e});a.plotDataLabelsText({x:u[i].x,y:u[i].y,text:t,textAnchor:"middle",i:r,j:r,seriesIndex:r,dataPointIndex:i,parent:g,offsetCorrection:!1,dataLabelsConfig:o({},c)})}h.add(g)}),s.push(h)}),this.drawPolygons({parent:d}),e.config.xaxis.labels.show){const t=this.drawXAxisTexts();d.add(t)}return s.forEach(t=>{d.add(t)}),d.add(this.yaxisLabels),d}drawPolygons(t){const e=this.w,{parent:i}=t,s=new qi(this.w),a=e.globals.yAxisScale[0].result.reverse(),r=a.length,n=[],o=this.size/(r-1);for(let t=0;t<r;t++)n[t]=o*t;n.reverse();const l=[],h=[];n.forEach((t,e)=>{const i=Ht.getPolygonPos(t,this.dataPointsLen);let s="";i.forEach((t,i)=>{if(0===e){const e=this.graphics.drawLine(t.x,t.y,0,0,Array.isArray(this.polygons.connectorColors)?this.polygons.connectorColors[i]:this.polygons.connectorColors);h.push(e)}0===i&&this.yaxisLabelsTextsPos.push({x:t.x,y:t.y}),s+=t.x+","+t.y+" "}),l.push(s)}),l.forEach((t,s)=>{const a=this.polygons.strokeColors,r=this.polygons.strokeWidth,n=this.graphics.drawPolygon(t,Array.isArray(a)?a[s]:a,Array.isArray(r)?r[s]:r,e.globals.radarPolygons.fill.colors[s]);i.add(n)}),h.forEach(t=>{i.add(t)}),e.config.yaxis[0].show&&this.yaxisLabelsTextsPos.forEach((t,e)=>{const i=s.drawYAxisTexts(t.x,t.y,e,a[e]);this.yaxisLabels.add(i)})}drawXAxisTexts(){const t=this.w,e=t.config.xaxis.labels,i=this.graphics.group({class:"apexcharts-xaxis"}),s=Ht.getPolygonPos(this.size,this.dataPointsLen);return t.labelData.labels.forEach((a,r)=>{const n=t.config.xaxis.labels.formatter,l=new C(this.w,this.ctx);if(s[r]){const h=this.getTextPos(s[r],this.size),c=n(a,{seriesIndex:-1,dataPointIndex:r,w:t});l.plotDataLabelsText({x:h.newX,y:h.newY,text:c,textAnchor:h.textAnchor,i:r,j:r,parent:i,className:"apexcharts-xaxis-label",color:Array.isArray(e.style.colors)&&e.style.colors[r]?e.style.colors[r]:"#a8a8a8",dataLabelsConfig:o({textAnchor:h.textAnchor,dropShadow:{enabled:!1}},e),offsetCorrection:!1}).on("click",e=>{if("function"==typeof t.config.chart.events.xAxisLabelClick){const i=Object.assign({},t,{labelIndex:r});t.config.chart.events.xAxisLabelClick(e,this.ctx,i)}})}}),i}createPaths(t,e){const i=[];let s=[];const a=[];let r=[];if(t.length){s=[this.graphics.move(e.x,e.y)],r=[this.graphics.move(e.x,e.y)];let n=this.graphics.move(t[0].x,t[0].y),o=this.graphics.move(t[0].x,t[0].y);t.forEach((e,i)=>{n+=this.graphics.line(e.x,e.y),o+=this.graphics.line(e.x,e.y),i===t.length-1&&(n+="Z",o+="Z")}),i.push(n),a.push(o)}return{linePathsFrom:s,linePathsTo:i,areaPathsFrom:r,areaPathsTo:a}}getTextPos(t,e){let i="middle",s=t.x,a=t.y;return Math.abs(t.x)>=10?t.x>0?(i="start",s+=10):t.x<0&&(i="end",s-=10):i="middle",Math.abs(t.y)>=e-10&&(t.y<0?a-=10:t.y>0&&(a+=10)),{textAnchor:i,newX:s,newY:a}}getPreviousPath(t){const e=this.w;let i=null;for(let s=0;s<e.globals.previousPaths.length;s++){const a=e.globals.previousPaths[s];a.paths.length>0&&parseInt(a.realIndex,10)===parseInt(String(t),10)&&void 0!==e.globals.previousPaths[s].paths[0]&&(i=e.globals.previousPaths[s].paths[0].d)}return i}getDataPointsPos(t,e,i=this.dataPointsLen){t=t||[],e=e||[];const s=[];for(let a=0;a<i;a++){const i={};i.x=t[a]*Math.sin(e[a]),i.y=-t[a]*Math.cos(e[a]),s.push(i)}return s}},heatmap:class{constructor(t,e,i){this.ctx=e,this.w=t,this.xRatio=i.xRatio,this.yRatio=i.yRatio,this.dynamicAnim=this.w.config.chart.animations.dynamicAnimation,this.helpers=new Bi(t,e),this.rectRadius=this.w.config.plotOptions.heatmap.radius,this.strokeWidth=this.w.config.stroke.show?this.w.config.stroke.width:0}draw(t){var e,i;const s=this.w,a=new I(this.w,this.ctx),r=Oe(this.ctx,a),n=r!==a&&"function"==typeof r.drawRectCell,o=a.group({class:"apexcharts-heatmap"});o.attr("clip-path",`url(#gridRectMask${s.globals.cuid})`);const l=s.layout.gridWidth/s.globals.dataPoints,h=s.layout.gridHeight/s.seriesData.series.length,c=("numeric"===s.config.xaxis.type||"datetime"===s.config.xaxis.type)&&s.axisFlags.isXNumeric&&this.xRatio>0;let d=l;if(c){const t=s.globals.minXDiff;d=Number.isFinite(t)&&t>0?t/this.xRatio:l}const u=Array.isArray(s.config.fill.opacity)?null!=(e=s.config.fill.opacity[0])?e:1:null!=(i=s.config.fill.opacity)?i:1;let p=0,g=!1;this.negRange=this.helpers.checkColorRange();const f=t.slice();s.config.yaxis[0].reversed&&(g=!0,f.reverse());for(let e=g?0:f.length-1;g?e<f.length:e>=0;g?e++:e--){const i=a.group({class:"apexcharts-series apexcharts-heatmap-series",seriesName:Ht.escapeString(s.seriesData.seriesNames[e]),rel:e+1,"data:realIndex":e});if(X.addCollapsedClassToSeries(this.w,i,e),n||a.setupEventDelegation(i,".apexcharts-heatmap-rect"),s.config.chart.dropShadow.enabled){const t=s.config.chart.dropShadow;new P(this.w).dropShadow(i,t,e)}let g=0;const m=s.config.plotOptions.heatmap.shadeIntensity;let x=0;for(let o=0;o<s.globals.dataPoints;o++){if(!c&&s.seriesData.seriesX.length&&!s.globals.allSeriesHasEqualX&&s.globals.minX+s.globals.minXDiff*o<s.seriesData.seriesX[e][x]){g+=l;continue}if(x>=f[e].length)break;const b=c?d:l;if(c){const t=s.seriesData.seriesX[e]?s.seriesData.seriesX[e][x]:null;if(null==t||t!=t){x++;continue}g=(t-s.globals.minX)/this.xRatio-d/2}const y=this.helpers.getShadeColor(s.config.chart.type,e,x,this.negRange);let w=y.color;const v=y.colorProps;if("image"===s.config.fill.type){w=new M(this.w).fillPath({seriesNumber:e,dataPointIndex:x,opacity:s.globals.hasNegs?v.percent<0?1-(1+v.percent/100):m+v.percent/100:v.percent/100,patternID:Ht.randomId(),width:s.config.fill.image.width?s.config.fill.image.width:b,height:s.config.fill.image.height?s.config.fill.image.height:h})}const _=this.rectRadius,A=s.config.plotOptions.heatmap.useFillColorAsStroke?w:s.globals.stroke.colors[0];if(n)r.drawRectCell(g,p,b,h,{fill:w,fillOpacity:u,stroke:A,strokeWidth:this.strokeWidth,radius:_,seriesIndex:e,dataPointIndex:x});else{const r=a.drawRect(g,p,b,h,_);if(r.attr({cx:g,cy:p}),r.node.classList.add("apexcharts-heatmap-rect"),i.add(r),r.attr({fill:w,i:e,index:e,j:x,val:t[e][x],"stroke-width":this.strokeWidth,stroke:A,color:w}),s.config.chart.animations.enabled&&!s.globals.dataChanged){let t=1;s.globals.resized||(t=s.config.chart.animations.speed),this.animateHeatMap(r,g,p,b,h,t,e,x)}if(s.globals.dataChanged){let t=1;if(this.dynamicAnim.enabled&&s.globals.shouldAnimate){t=this.dynamicAnim.speed;let i=s.globals.previousPaths[e]&&s.globals.previousPaths[e][x]&&s.globals.previousPaths[e][x].color;i||(i="rgba(255, 255, 255, 0)"),this.animateHeatColor(r,Ht.isColorHex(i)?i:Ht.rgb2hex(i),Ht.isColorHex(w)?w:Ht.rgb2hex(w),t)}}}const S=(0,s.config.dataLabels.formatter)(s.seriesData.series[e][x],{value:s.seriesData.series[e][x],seriesIndex:e,dataPointIndex:x,w:s}),C=this.helpers.calculateDataLabels({text:S,x:g+b/2,y:p+h/2,i:e,j:x,colorProps:v,series:f});null!==C&&i.add(C),c||(g+=l),x++}p+=h,o.add(i)}const m=s.globals.yAxisScale[0].result.slice();return s.config.yaxis[0].reversed?m.unshift(""):m.push(""),s.globals.yAxisScale[0].result=m,o}animateHeatMap(t,e,i,s,a,r,n=0,o=0){const l=this.w,h=new u(this.w),c=l.config.chart.animations.animateGradually;let d=0;if(c&&!1!==c.enabled){const t=((l.seriesData.series||[]).length||1)+(l.globals.dataPoints||1)-2,e=Math.min(c.delay||0,.5*r/Math.max(1,t));d=p({style:"diagonal",index:o,row:n,col:o,baseDelay:e})}h.animateRect(t,{x:e+s/2,y:i+a/2,width:0,height:0},{x:e,y:i,width:s,height:a},r,()=>{h.animationCompleted(t)},d)}animateHeatColor(t,e,i,s){t.attr({fill:e}).animate(s).attr({fill:i})}},treemap:class{constructor(t,e){this.ctx=e,this.w=t,this.strokeWidth=this.w.config.stroke.width,this.helpers=new Bi(t,e),this.dynamicAnim=this.w.config.chart.animations.dynamicAnimation,this.labels=[],this.roots=[],this.drawn=[],this.nested=!1,this.showParents=!1,this.scale=null,this._levelCache=null,this._total=null,this._avgLabelSize=null,this._tooltipEl=null,this._tipOwned=!1,this._morphLeafIndex=0}draw(t){var e;const i=this.w,s=new I(this.w,this.ctx),a=new M(this.w),r=s.group({class:"apexcharts-treemap"});if(i.globals.noData)return r;t.forEach(t=>{t.map(t=>Math.abs(t))}),this.negRange=this.helpers.checkColorRange(),i.config.series.forEach((t,e)=>{t.data.forEach(t=>{Array.isArray(this.labels[e])||(this.labels[e]=[]),this.labels[e].push(t.x)})});const n=ps(i);this.nested=n.nested,this.roots=n.roots,this.scale=ee(i);const o=1===n.roots.length?n.roots[0].children||[]:n.roots;this.drawn=o;const l=i.config.plotOptions.treemap.parents;this.showParents=!0===l.show||!1!==l.show&&this.nested;const h=this._resolveFocus(o),c=h?[h]:o;hs.generateNested(c,i.layout.gridWidth,i.layout.gridHeight,{padding:(t,e,i,s)=>this.showParents?this._levelPadding(e,i,s):0,header:(t,e,i,s)=>this.showParents?this._levelHeader(t,e,i,s):0});const d=null==(e=this.ctx)?void 0:e.morphTypeChange,u=!!d&&"function"==typeof d.isActive&&d.isActive()&&"function"==typeof d.getInitialPathAt;this._morphLeafIndex=0;const p=this._leavesBySeries(c,i.config.series.length),g=this.showParents?this._parentsBySeries(c,i.config.series.length):[];return p.forEach((e,n)=>{var o;const l=s.group({class:"apexcharts-series apexcharts-treemap-series",seriesName:Ht.escapeString(i.seriesData.seriesNames[n]),rel:n+1,"data:realIndex":n});if(s.setupEventDelegation(l,".apexcharts-treemap-rect"),i.config.chart.dropShadow.enabled){const t=i.config.chart.dropShadow;new P(this.w).dropShadow(r,t,n)}const h=s.group({class:"apexcharts-data-labels"}),c={xMin:1/0,yMin:1/0,xMax:-1/0,yMax:-1/0};this.showParents&&(g[n]||[]).forEach(t=>{this._drawParent(l,t,n)});const d=i.config.chart.animations,p=d.animateGradually,f=p&&!1!==p.enabled,m=new Array(e.length).fill(0);if(f){const t=e.length||1,i=Math.min(p.delay||0,.5*d.speed/t);e.map((t,e)=>{return{j:e,area:t.rect?(i=t.rect,(i[2]-i[0])*(i[3]-i[1])):0};var i}).sort((t,e)=>e.area-t.area).forEach((t,e)=>{m[t.j]=e*i})}e.forEach((e,r)=>{const o=e.rect;if(!o)return;const h=e._di,d=o[0],p=o[1],g=o[2],f=o[3];c.xMin=Math.min(c.xMin,d),c.yMin=Math.min(c.yMin,p),c.xMax=Math.max(c.xMax,g),c.yMax=Math.max(c.yMax,f);const x=this._leafColor(n,h),b=x.color,y=a.fillPath({color:b,seriesNumber:n,dataPointIndex:h}),w=u?this._morphSourceForLeaf(e):null,v=w?s.drawPath({d:this._tilePath(d,p,g,f),fill:"#fff",stroke:i.config.plotOptions.treemap.useFillColorAsStroke?b:i.globals.stroke.colors[n],strokeWidth:this.strokeWidth,fillOpacity:1}):s.drawRect(d,p,g-d,f-p,i.config.plotOptions.treemap.borderRadius,"#fff",1,this.strokeWidth,i.config.plotOptions.treemap.useFillColorAsStroke?b:i.globals.stroke.colors[n]);v.attr({cx:d,cy:p,index:n,i:n,j:h,width:g-d,height:f-p,fill:y}),v.node.classList.add("apexcharts-treemap-rect"),v.node.setAttribute("data:key",us(e._key));let _={x:d+(g-d)/2,y:p+(f-p)/2,width:0,height:0};const A={x:d,y:p,width:g-d,height:f-p};if(w)this._morphTile(v,w,this._tilePath(d,p,g,f),this.ctx.morphTypeChange.getSpeed(),n,h);else if(i.config.chart.animations.enabled&&!i.globals.dataChanged){let t=1;i.globals.resized||(t=i.config.chart.animations.speed),this.animateTreemap(v,_,A,t,m[r]||0)}if(i.globals.dataChanged){let t=1;this.dynamicAnim.enabled&&i.globals.shouldAnimate&&(t=this.dynamicAnim.speed,i.globals.previousPaths[n]&&i.globals.previousPaths[n][h]&&i.globals.previousPaths[n][h].rect&&(_=i.globals.previousPaths[n][h].rect),this.animateTreemap(v,_,A,t))}let S=this.getFontSize(o);"truncate"===i.config.plotOptions.treemap.dataLabels.format&&(S=parseInt(String(i.config.dataLabels.style.fontSize),10));let C=null;if(i.config.dataLabels.enabled&&this._labelCanShow(S,g-d,f-p)){let e=i.config.dataLabels.formatter(this.labels[n][h],{value:i.seriesData.series[n][h],seriesIndex:n,dataPointIndex:h,w:i});"truncate"===i.config.plotOptions.treemap.dataLabels.format&&(e=this.truncateLabels(String(e),S,d,p,g,f)),i.seriesData.series[n][h]&&(C=this.helpers.calculateDataLabels({text:e,x:(d+g)/2,y:(p+f)/2+this.strokeWidth/2+S/3,i:n,j:h,colorProps:x,fontSize:S,series:t})),i.config.dataLabels.enabled&&C&&this.rotateToFitLabel(C,S,e,d,p,g,f)}l.add(v),null!==C&&l.add(C)});const x=i.config.plotOptions.treemap.seriesTitle;if(!this.showParents&&i.config.series.length>1&&x&&x.show){const t=i.config.series[n].name||"";if(t&&c.xMin<1/0&&c.yMin<1/0){const{offsetX:e,offsetY:a,borderColor:r,borderWidth:n,borderRadius:h,style:d}=x,u=d.color||i.config.chart.foreColor,p={left:d.padding.left,right:d.padding.right,top:d.padding.top,bottom:d.padding.bottom},g=s.getTextRects(t,d.fontSize,d.fontFamily),f=g.width+p.left+p.right,m=g.height+p.top+p.bottom,b=c.xMin+(e||0),y=c.yMin+(a||0),w=s.drawRect(b,y,f,m,h,d.background,1,n,r),v=s.drawText({x:b+p.left,y:y+p.top+.75*(null!=(o=null==g?void 0:g.height)?o:0),text:t,fontSize:d.fontSize,fontFamily:d.fontFamily,fontWeight:d.fontWeight,foreColor:u,cssClass:d.cssClass||""});l.add(w),l.add(v)}}l.add(h),r.add(l)}),this._renderBreadcrumb(),r}_levelCfg(t){if(this._levelCache||(this._levelCache=[]),this._levelCache[t])return this._levelCache[t];const e=this.w.config.plotOptions.treemap,i=e.parents||{},s=(e.levels||[])[t]||{},a=l(o(o({},i),s),{header:l(o(o({},i.header||{}),s.header||{}),{style:o(o({},(i.header||{}).style||{}),(s.header||{}).style||{})}),hover:o(o({},i.hover||{}),s.hover||{})});return this._levelCache[t]=a,a}_levelPadding(t,e,i){const s=this._levelCfg(t);return Number(s.padding)||0}_levelHeader(t,e,i,s){const a=this._levelCfg(e).header||{};if(!1===a.show)return 0;const r=Number(a.height);if(!Number.isFinite(r)||r<=0)return 0;return i<(Number(a.minWidth)||40)||s<2*r?0:r}_leavesBySeries(t,e){const i=new Array(Math.max(1,e));for(let t=0;t<i.length;t++)i[t]=[];const s=t=>{if(t.children&&t.children.length)t.children.forEach(s);else{const e=t._si||0;i[e]&&i[e].push(t)}};return t.forEach(s),i}_parentsBySeries(t,e){const i=new Array(Math.max(1,e));for(let t=0;t<i.length;t++)i[t]=[];const s=t=>{if(!t.children||!t.children.length)return;const e=t._si||0;i[e]&&i[e].push(t),t.children.forEach(s)};return t.forEach(s),i.forEach(t=>t.sort((t,e)=>(t.depth||0)-(e.depth||0))),i}_leafColor(t,e){const i=this.w;if(this.scale){const s=Qt(i,t,e);if(null!=s){const t=this.scale.at(s);return{color:t,foreColor:ie(t),colorProps:{color:t,foreColor:ie(t),percent:0}}}}return this.helpers.getShadeColor(i.config.chart.type,t,e,this.negRange)}_parentChrome(t){const e=this.w,i=this._levelCfg(t),s="dark"===e.config.theme.mode,a=(i.header||{}).style||{},r=Math.min(t,3),n=s?255:0,o=`${n},${n},${n}`;return{fill:i.fill||`rgba(${o},${(s?.04:.03)+.02*r})`,fillOpacity:null==i.fillOpacity?1:i.fillOpacity,borderColor:i.borderColor||`rgba(${o},${s?.18:.14})`,borderWidth:null==i.borderWidth?1:i.borderWidth,borderRadius:null==i.borderRadius?e.config.plotOptions.treemap.borderRadius:i.borderRadius,headerBg:a.background||`rgba(${o},${s?.1:.07})`,headerColor:a.color||(s?"#e8e8e8":e.config.chart.foreColor),headerFontSize:a.fontSize||"12px",headerFontFamily:a.fontFamily||e.config.chart.fontFamily,headerFontWeight:null==a.fontWeight?600:a.fontWeight,hoverColor:i.hover&&i.hover.color||(s?"rgba(255,255,255,0.85)":"rgba(0,0,0,0.7)"),hoverWidth:i.hover&&i.hover.width||2,hoverShow:!(i.hover&&!1===i.hover.show)}}_drawParent(t,e,i){var s;const a=e.rect;if(!a)return;const r=this.w,n=new I(this.w,this.ctx),o=e.depth||0,l=this._levelCfg(o),h=this._parentChrome(o),c=a[0],d=a[1],u=a[2]-a[0],p=a[3]-a[1];if(u<=0||p<=0)return;const g=n.group({class:"apexcharts-treemap-parent","data:depth":o,"data:name":Ht.escapeString(e.name)}),f=us(e._key),m=this._morphKeyed()?this.ctx.morphTypeChange.getInitialPathForKey(f):null,x=m?n.drawPath({d:this._tilePath(c,d,c+u,d+p),fill:h.fill,stroke:h.borderColor,strokeWidth:h.borderWidth,fillOpacity:h.fillOpacity}):n.drawRect(c,d,u,p,h.borderRadius,h.fill,h.fillOpacity,h.borderWidth,h.borderColor);x.node.classList.add("apexcharts-treemap-parent-rect"),x.node.setAttribute("data:key",f),x.node.setAttribute("data:depth",String(o)),m&&this._morphTile(x,m,this._tilePath(c,d,c+u,d+p),this.ctx.morphTypeChange.getSpeed(),i,o),g.add(x);const b=e.headerHeight||0;let y="";if(b>0){const t=l.header||{},a=n.drawRect(c,d,u,b,0,h.headerBg,1,0,"transparent");a.node.classList.add("apexcharts-treemap-parent-header"),g.add(a);let p=String(null!=(s=e.name)?s:"");"function"==typeof t.formatter?p=String(t.formatter(e.name,{value:e.value,depth:o,seriesIndex:i,node:e,w:r})):t.showValue&&(p=`${p}  ${this._formatValue(e.value)}`),y=p;const f=Number(t.offsetX)||0,m=t.align||"left",w=6,v=Math.max(0,u-2*w-Math.abs(f)),_=parseFloat(String(h.headerFontSize))||12,A=n.getTextBasedOnMaxWidth({text:p,maxWidth:v,fontSize:_});if(A){let e=c+w+f,i="start";"center"===m?(e=c+u/2+f,i="middle"):"right"===m&&(e=c+u-w+f,i="end");const s=n.drawText({x:e,y:d+b/2+_/3+(Number(t.offsetY)||0),text:A,textAnchor:i,fontSize:h.headerFontSize,fontFamily:h.headerFontFamily,fontWeight:h.headerFontWeight,foreColor:h.headerColor,cssClass:`apexcharts-treemap-parent-label ${t.style&&t.style.cssClass||""}`});s.node.setAttribute("pointer-events","none"),g.add(s)}this._attachParentEvents(a.node,e,h,x),this._makeParentAccessible(a.node,e,h,x,y)}this._attachParentEvents(x.node,e,h,x),g.node.setAttribute("role","group"),g.node.setAttribute("aria-label",this._parentLabel(e,y)),t.add(g)}_parentLabel(t,e){const i=this._drawnTotal(),s=i>0?(t._area/i*100).toFixed(1):"0",a=this._countLeaves(t);return`${e&&String(e).trim()?String(e).replace(/\s+/g," ").trim():`${t.name}, ${this._formatValue(t._area)}`}, ${a} ${1===a?"item":"items"}, ${s}% of total`}_makeParentAccessible(t,e,i,s,a){t&&t.setAttribute&&this._zoomEnabled()&&(t.setAttribute("role","button"),t.setAttribute("tabindex","0"),t.setAttribute("aria-label",`${this._parentLabel(e,a)}. Zoom in`),t.setAttribute("aria-expanded","false"),Wt.isBrowser()&&t.addEventListener&&(t.addEventListener("focus",()=>{s.node.setAttribute("stroke",i.hoverColor),s.node.setAttribute("stroke-width",String(i.hoverWidth+1))}),t.addEventListener("blur",()=>{s.node.setAttribute("stroke",i.borderColor),s.node.setAttribute("stroke-width",String(i.borderWidth))}),t.addEventListener("keydown",t=>{"Enter"!==t.key&&" "!==t.key&&"Spacebar"!==t.key||(t.preventDefault(),this._zoomTo(e,!0))})))}_attachParentEvents(t,e,i,s){if(!Wt.isBrowser()||!t||!t.addEventListener)return;const a=this.w;i.hoverShow&&(t.addEventListener("mouseenter",()=>{s.node.setAttribute("stroke",i.hoverColor),s.node.setAttribute("stroke-width",String(i.hoverWidth))}),t.addEventListener("mouseleave",()=>{s.node.setAttribute("stroke",i.borderColor),s.node.setAttribute("stroke-width",String(i.borderWidth))})),a.config.tooltip.enabled&&(t.addEventListener("mouseenter",t=>this._showParentTooltip(t,e)),t.addEventListener("mousemove",t=>this._positionTooltip(t)),t.addEventListener("mouseleave",()=>this._hideParentTooltip())),this._zoomEnabled()&&(t.style.cursor="pointer",t.addEventListener("click",()=>this._zoomTo(e)))}_zoomEnabled(){const t=this.w,e=t.config.plotOptions.treemap.zoom;if(!e||!e.enabled||!this.showParents)return!1;const i=t.config.drilldown;return!(i&&i.enabled&&Array.isArray(i.series)&&i.series.length)||(this._warnedZoomConflict||(this._warnedZoomConflict=!0),!1)}_resolveFocus(t){const e=this.w.globals.treemapFocusKey;if(!e||!this._zoomEnabled())return null;let i=null;const s=t=>{i||(t._key!==e?t.children&&t.children.forEach(s):i=t)};return t.forEach(s),i&&i.children&&i.children.length?i:null}_zoomTo(t,e=!1){const i=this.w;if(!t||!t.children||!t.children.length)return;const s=i.globals.treemapFocusKey===t._key?null:t._key;i.globals.treemapFocusKey=s,this._hideParentTooltip();const a=this.ctx.update();e&&a&&"function"==typeof a.then&&a.then(()=>{if(!Wt.isBrowser())return;const t=i.dom.baseEl.querySelector(".apexcharts-breadcrumb .apexcharts-breadcrumb-item");if(t&&t.focus)return void t.focus();const e=i.dom.baseEl.querySelector(".apexcharts-treemap-parent-header[tabindex]");e&&e.focus&&e.focus()})}_focusChain(){const t=[],e=new Set(this.drawn||[]);let i=this._resolveFocus(this.drawn||[]);for(;i&&(t.unshift(i),!e.has(i));)i=i._parent;return t}_breadcrumbCfg(){const t=this.w.config.plotOptions.treemap.zoom;return ke(this.w,t&&t.breadcrumb)}_renderBreadcrumb(){if(!Wt.isBrowser())return;const t=this.w;if(!t.dom.elWrap)return;if(Le(t),!this._zoomEnabled())return;const e=this._focusChain();if(!e.length)return;const i=function(t,e){if(!Wt.isBrowser())return null;const i=t.dom.elWrap;if(!i)return null;Le(t);const s=e.config||ke(t);if(!1===s.show)return null;const a=e.crumbs||[];if(a.length<2)return null;const r=ct.createElementNS(Ce,"nav");r.setAttribute("class","apexcharts-breadcrumb"),r.setAttribute("aria-label",e.ariaLabel||"Breadcrumb"),function(t,e){const i=e.offsetX||0,s=e.offsetY||0;t.style.position="absolute",t.style.top=s+"px","top-right"===e.position?t.style.right=3-i+"px":t.style.left=i+"px"}(r,s),e.compact&&(r.style.fontSize="11px",r.style.padding="0 2px");const n=null!=s.separator?s.separator:" / ";return a.forEach((t,i)=>{var o;if(i>0){const t=ct.createElementNS(Ce,"span");t.setAttribute("class","apexcharts-breadcrumb-separator"),t.setAttribute("aria-hidden","true"),t.textContent=n,r.appendChild(t)}let l=0===i?null!=(o=s.rootLabel)?o:"All":t.label;if("function"==typeof s.formatter&&(l=s.formatter(l,{index:i,depth:a.length-1,data:t.data})),i===a.length-1){const t=ct.createElementNS(Ce,"span");return t.setAttribute("class","apexcharts-breadcrumb-item apexcharts-breadcrumb-current"),t.setAttribute("aria-current","page"),t.textContent=String(l),void r.appendChild(t)}const h=ct.createElementNS(Ce,"button");if(h.setAttribute("type","button"),h.setAttribute("class","apexcharts-breadcrumb-item"),0===i){const t=ct.createElementNS(Ce,"span");t.setAttribute("class","apexcharts-breadcrumb-arrow"),t.setAttribute("aria-hidden","true"),t.textContent="\u2190",h.appendChild(t)}const c=ct.createElementNS(Ce,"span");c.setAttribute("class","apexcharts-breadcrumb-label"),c.textContent=String(l),h.appendChild(c),h.addEventListener("click",()=>e.onNavigate(i,t)),r.appendChild(h)}),i.appendChild(r),r}(t,{ariaLabel:"Treemap breadcrumb",config:this._breadcrumbCfg(),compact:!0,crumbs:[{label:"All",data:null}].concat(e.map(t=>({label:t.name,data:t}))),onNavigate:(e,i)=>{t.globals.treemapFocusKey=i.data?i.data._key:null,this._hideParentTooltip(),this.ctx.update()}});i&&(this._placeBreadcrumb(i),Me(t,i))}_placeBreadcrumb(t){var e,i;const s=this.w,a=s.layout.translateY||0,r=null==(i=null==(e=this.ctx)?void 0:e.dimensions)?void 0:i.dimHelpers,n=r?r.getTitleSubtitleCoords("title").height+r.getTitleSubtitleCoords("subtitle").height:0,o=t.getBoundingClientRect().height||18;if(a-n>=o+1)return void(t.style.top=a-o-1+"px");t.style.top=`${n}px`;const l="dark"===s.config.theme.mode;t.style.background=l?"rgba(20,24,30,0.82)":"rgba(255,255,255,0.86)",t.style.borderRadius="4px"}_showParentTooltip(t,e){const i=this.w,s=this._tip();if(!s)return;const a=this._drawnTotal(),r=e._parent?e._parent._area:a,n=a>0?(e._area/a*100).toFixed(1):"0.0",o=r>0?(e._area/r*100).toFixed(1):n,l=this.w.config.plotOptions.treemap.parents,h=l&&l.tooltip&&l.tooltip.formatter,c=this._countLeaves(e);let d;if("function"==typeof h)d=h({name:e.name,value:e._area,depth:e.depth||0,leafCount:c,percentOfParent:Number(o),percentOfTotal:Number(n),node:e,w:i});else{const t=this._parentChrome(e.depth||0).headerBg;d=`<div class="apexcharts-tooltip-series-group apexcharts-active" style="display:flex;${i.config.tooltip.fillSeriesColor?`background-color:${t};`:""}"><div class="apexcharts-tooltip-text"><div class="apexcharts-tooltip-y-group"><span class="apexcharts-tooltip-text-y-label">${Ht.escapeString(e.name)}: </span><span class="apexcharts-tooltip-text-y-value">${this._formatValue(e._area)}</span></div><div class="apexcharts-tooltip-y-group"><span class="apexcharts-tooltip-text-y-label">${c} items, </span><span class="apexcharts-tooltip-text-y-value">${o}% of parent, ${n}% of total</span></div></div></div>`}s.innerHTML=d,s.classList.add("apexcharts-active"),s.style.opacity="1",this._tipOwned=!0,this._positionTooltip(t)}_tip(){return this._tooltipEl||(this._tooltipEl=this.w.dom.baseEl.querySelector(".apexcharts-tooltip")),this._tooltipEl}_positionTooltip(t){const e=this._tip();if(!e||!this._tipOwned)return;const i=this.w.dom.elWrap.getBoundingClientRect(),s=e.offsetWidth,a=e.offsetHeight;let r=t.clientX-i.left+12;r+s>i.width&&(r=t.clientX-i.left-s-12),r=Math.max(0,Math.min(r,i.width-s));let n=t.clientY-i.top+12;n+a>i.height&&(n=t.clientY-i.top-a-12),n=Math.max(0,Math.min(n,i.height-a)),e.style.left=r+"px",e.style.top=n+"px"}_hideParentTooltip(){const t=this._tip();t&&this._tipOwned&&(this._tipOwned=!1,t.classList.remove("apexcharts-active"),t.style.opacity="0")}_drawnTotal(){return null==this._total&&(this._total=(this.drawn||[]).reduce((t,e)=>t+this._subtreeArea(e),0)),this._total||0}_subtreeArea(t){if(null!=t._area)return t._area;const e=t.children;if(e&&e.length){let t=0;for(let i=0;i<e.length;i++)t+=this._subtreeArea(e[i]);return t}const i=Number(t.value);return isNaN(i)?0:Math.abs(i)}_countLeaves(t){return t.children&&t.children.length?t.children.reduce((t,e)=>t+this._countLeaves(e),0):1}_formatValue(t){var e,i,s,a,r;const n=this.w,o=(null==(i=null==(e=n.config.tooltip)?void 0:e.y)?void 0:i.formatter)||(null==(r=null==(a=null==(s=n.config.yaxis)?void 0:s[0])?void 0:a.labels)?void 0:r.formatter);if("function"==typeof o)try{return String(o(t,{seriesIndex:0,dataPointIndex:0,w:n}))}catch(t){}return String(t)}_labelCanShow(t,e,i){if(!Number.isFinite(t)||t<=0)return!1;const s=this.w.config.plotOptions.treemap.dataLabels;return!(t<(s&&null!=s.minFontSize?Number(s.minFontSize):0))&&Math.max(e,i)>=t}_averageLabelSize(){if(null!=this._avgLabelSize)return this._avgLabelSize;return this._avgLabelSize=function t(e){let i,s=0;if(Array.isArray(e[0]))for(i=0;i<e.length;i++)s+=t(e[i]);else for(i=0;i<e.length;i++)s+=e[i].length;return s}(this.labels)/function t(e){let i,s=0;if(Array.isArray(e[0]))for(i=0;i<e.length;i++)s+=t(e[i]);else for(i=0;i<e.length;i++)s+=1;return s}(this.labels),this._avgLabelSize}getFontSize(t){const e=this.w,i=this._averageLabelSize();return function(t,s){const a=t*s,r=Math.pow(a,.5);return Math.min(r/i,parseInt(e.config.dataLabels.style.fontSize,10))}(t[2]-t[0],t[3]-t[1])}rotateToFitLabel(t,e,i,s,a,r,n){const o=new I(this.w),l=o.getTextRects(i,String(e));if(l.width+this.w.config.stroke.width+5>r-s&&l.width<=n-a){const e=o.rotateAroundCenter(t.node);t.node.setAttribute("transform",`rotate(-90 ${e.x} ${e.y}) translate(${l.height/3})`)}}truncateLabels(t,e,i,s,a,r){const n=new I(this.w),o=n.getTextRects(t,String(e)).width+this.w.config.stroke.width+5>a-i&&r-s>a-i?r-s:a-i,l=n.getTextBasedOnMaxWidth({text:t,maxWidth:o,fontSize:e});return t.length!==l.length&&o/e<5?"":l}_morphKeyed(){var t;const e=null==(t=this.ctx)?void 0:t.morphTypeChange;return!(!e||"function"!=typeof e.hasKeyedMarks||!e.hasKeyedMarks()||"function"!=typeof e.getInitialPathForKey)}_morphSourceForLeaf(t){var e;const i=null==(e=this.ctx)?void 0:e.morphTypeChange;if(!i||"function"!=typeof i.getInitialPathAt)return null;if(this._morphKeyed()){const e=i.getInitialPathForKey(us(t._key));if(e)return e}return i.getInitialPathAt(this._morphLeafIndex++)}_tilePath(t,e,i,s){return`M ${t} ${e} L ${i} ${e} L ${i} ${s} L ${t} ${s} Z`}_morphTile(t,e,i,s,a,r){new u(this.w,this.ctx).morphSVG(t,a,r,"none",e,i,s,0)}animateTreemap(t,e,i,s,a=0){const r=new u(this.w);r.animateRect(t,e,i,s,()=>{r.animationCompleted(t)},a)}},unit:class{constructor(t,e){this.ctx=e,this.w=t,this._lastDotR=1,this._gridTrack=null,this._gridDenom=1,this._scatterAxis=null,this._specCache=new Map,this._markWarned=null}draw(t){const e=this.w,i=new I(e,this.ctx),s=i.group({class:"apexcharts-unit"});if(e.globals.noData||!Array.isArray(t)||0===t.length)return s;const a=e.config.plotOptions.unit,r="packed"===a.layout?"packed":"columns"===a.layout?"columns":"grid"===a.layout?"grid":"scatter"===a.layout?"scatter":"arc"===a.layout?"arc":"custom"===a.layout?"custom":"grouped",n=a.transition,o="flow"===n,l="identity"===n,h=a.unitValue>0?a.unitValue:1;let c=t.map(t=>{const e=Math.abs(Ht.parseNumber(t))/h;return e>0?Math.max(1,Math.round(e)):0});c=this._applyMaxUnits(c,a.maxUnits);const d=c.reduce((t,e)=>t+e,0),u="packed"===r?this._layoutPacked(c,a):"columns"===r?this._layoutColumns(c,a):"grid"===r?this._layoutGrid(c,a):"scatter"===r?this._layoutScatter(a):"arc"===r?this._layoutArc(c,a):"custom"===r?this._layoutCustom(c,a):this._layoutGrouped(c,a),p="grid"===r&&!(!a.grid||!a.grid.split);p&&this._drawGridTrack(s,i,a),"scatter"===r&&this._drawScatterAxes(s,i);const g=this._lastDotR,f=this._shouldAnimate(),m=this.ctx&&this.ctx.morphTypeChange,x=f&&!!m&&"function"==typeof m.isActive&&m.isActive()&&"function"==typeof m.getInitialCenterFor,b=x&&"function"==typeof m.getInitialSlotFor,y=x&&"function"==typeof m.usesPieceTakeover&&m.usesPieceTakeover(),w=f&&!x&&this.ctx?this.ctx._unitPrevDots:null,v=new Map,_=[],A=e.seriesData.unitData||[],S=this._bubbleStats(A,a,g);let C=0;if(u.forEach(t=>{const n=e.globals.colors[t.i]||e.globals.colors[0]||"#008FFB",h=i.group({class:"apexcharts-series",seriesName:Ht.escapeString(e.seriesData.seriesNames[t.i]||`series-${t.i+1}`),rel:t.i+1,"data:realIndex":t.i}),u=x&&!b?m.getInitialCenterFor(t.i):null,k=t.dots.length,M=A[t.i];if(t.dots.forEach((e,s)=>{const r=null!=e.j?e.j:s,c=M?M[r]:void 0,d=c&&"object"==typeof c&&c.fillColor?c.fillColor:n,x=null!=e.r?e.r:S?this._radiusForValue(this._unitValueOf(c),S):g,A=this._markSpecFor(a,c,t.i,x),P=this._drawDot(i,a,x,d,t.i,r,A);let L;if(h.add(P),l){const t=c&&"object"==typeof c?null!=c.id?c.id:c.name:void 0;L=null!=t?`id:${t}`:`g:${C}`}else L=o?String(C):null!=e.slot?`slot:${e.slot}`:`${t.i}:${r}`;if(C++,v.set(L,{x:e.x,y:e.y,fill:d,r:x,spec:A}),y)this._place(P.node,A,e.x,e.y),P.node.setAttribute("opacity","0"),P.node.setAttribute("data-piece-hidden","1");else if(f){const i=w&&w.get(L),s=i||(b?m.getInitialSlotFor(t.i,r,k):u),n=a.gather&&a.gather.enter||"burst",o=p||"fade"===n||"rise"===n,l=s?s.x:o?e.x:t.cx,h=s?s.y:"rise"!==n||p?o?e.y:t.cy:e.y+14;P.node.style.opacity=s?"1":"0",this._place(P.node,A,l,h),_.push({node:P.node,spec:A,x:e.x,y:e.y,cx0:l,cy0:h,key:L,r0:i&&null!=i.r?i.r:x,r1:x,fill0:i?i.fill:d,fill1:d,delay:0,isEnter:!s})}else this._place(P.node,A,e.x,e.y)}),("grouped"===r||"columns"===r||p)&&a.clusterLabels&&a.clusterLabels.show&&c[t.i]>0){const e=p?this._gridDenom:d;this._drawClusterLabel(h,t,c[t.i],e,a,n)}s.add(h)}),this._outerLabelsOn(a)&&this._drawOuterLabels(s,u,c,d,a,f&&!w),w){const t=this._collectExits(w,v,a);if(t.length){const e=i.group({class:"apexcharts-unit-exits"});s.add(e),this._runExits(e,t,a)}}return this.ctx&&(this.ctx._unitPrevDots=v),!this.ctx||f&&!x||(this.ctx._unitSprings=null),f&&_.length?this._runGather(_):e.globals.animationEnded=!0,s}_applyMaxUnits(t,e){const i=t.reduce((t,e)=>t+e,0);if(!e||e<=0||i<=e)return t;const s=e/i;return t.map(t=>t>0?Math.max(1,Math.round(t*s)):0)}_layoutCustom(t,e){const i=this.w,s=i.layout.gridWidth,a=i.layout.gridHeight,r=t.reduce((t,e)=>t+e,0),n=this._resolveLayoutProvider(e);if(!n)return this._layoutGrouped(t,e);const o=this._outerLabelsOn(e)?this._outerLabelGutter(t,e):0;this._lastOuterGutter=o;const l={x:o,y:0,width:Math.max(1,s-2*o),height:a},h=Math.sqrt(l.width*l.height/Math.PI),c=this._resolveStep(e,h,r);this._lastDotR=this._dotRadiusFromStep(c,e);const d=this._lastDotR,u=this._layoutObjects(t,d);let p;try{p=n(u,l)}catch(i){return this._layoutGrouped(t,e)}if(!Array.isArray(p))return this._layoutGrouped(t,e);const g=new Map;p.forEach(t=>{t&&isFinite(t.x)&&isFinite(t.y)&&g.set(String(t.id),{x:t.x,y:t.y,r:"number"==typeof t.r&&t.r>0?t.r:void 0})});const f=t.map((t,e)=>({i:e,cx:s/2,cy:a/2,outerR:d,dots:[]}));return u.forEach(t=>{const e=g.get(t.id);e&&f[t.seriesIndex].dots.push({x:e.x,y:e.y,r:e.r,j:t.dataPointIndex})}),f.forEach(t=>{if(!t.dots.length)return;let e=0,i=0;t.dots.forEach(t=>{e+=t.x,i+=t.y}),t.cx=e/t.dots.length,t.cy=i/t.dots.length;let s=0;t.dots.forEach(e=>{s=Math.max(s,Math.hypot(e.x-t.cx,e.y-t.cy))}),t.outerR=s+d}),f}_layoutObjects(t,e){const i=this.w,s=i.seriesData.unitData||[],a=i.seriesData.seriesNames||[],r=[];let n=0;return t.forEach((t,i)=>{var o;const l=s[i];for(let s=0;s<t;s++){const t=l?l[s]:void 0,h=!t||"object"!=typeof t||null==t.id&&null==t.name?`${i}:${s}`:String(null!=t.id?t.id:t.name);r.push({id:h,index:n,seriesIndex:i,dataPointIndex:s,label:a[i],value:null!=(o=this._unitValueOf(t))?o:void 0,datum:t,r:e}),n++}}),r}_resolveLayoutProvider(t){const e=t.positions;if("function"==typeof e)return e;if("string"==typeof e&&e){const t=vs(e);if(t)return t}return null}_layoutGrouped(t,e){const i=this.w,s=i.layout.gridWidth,a=i.layout.gridHeight,r=e.clusterLabels&&e.clusterLabels.show?30:6,n=t.map((t,e)=>e).filter(e=>t[e]>0),o=Math.max(1,n.length),l=new Array(t.length).fill(-1);n.forEach((t,e)=>l[t]=e);const h=s/o,c=a-r,d=Math.max(1,...t),u=.08*Math.min(h,c),p=Math.max(4,Math.min(h,c)/2-u),g=this._resolveStep(e,p,d);this._lastDotR=this._dotRadiusFromStep(g,e);const f=this._lastDotR,m=r+c/2,x=t.map(t=>g*Math.sqrt(Math.max(1,t))+f);let b=t.map((t,e)=>(t=>l[t]>=0?h*(l[t]+.5):s/2)(e));const y=n.map(t=>x[t]);let w=!1;for(let t=1;t<o;t++)if(b[n[t]]-b[n[t-1]]<y[t]+y[t-1]){w=!0;break}if(w){const e=Math.max(2*f,8),i=y.reduce((t,e)=>t+2*e,0)+e*(o-1);let a;if(i<=s){let t=(s-i)/2;a=y.map(i=>{const s=t+i;return t+=2*i+e,s})}else if(1===o)a=[s/2];else{const t=y[0],e=s-y[o-1];a=y.map((i,s)=>t+(e-t)*s/(o-1))}b=t.map((t,e)=>l[e]>=0?a[l[e]]:s/2)}return t.map((t,e)=>({i:e,cx:b[e],cy:m,outerR:x[e],dots:this._spiral(b[e],m,t,g,0)}))}_layoutPacked(t,e){const i=this.w,s=i.layout.gridWidth,a=i.layout.gridHeight,r=Math.max(1,t.reduce((t,e)=>t+e,0)),n=Math.max(4,Math.min(s,a-6)/2-.06*Math.min(s,a)),o=this._resolveStep(e,n,r);this._lastDotR=this._dotRadiusFromStep(o,e);const l=s/2,h=6+(a-6)/2,c=t.map((t,e)=>e);!1!==e.sortByGroup&&c.sort((e,i)=>t[e]-t[i]);const d=t.map((t,e)=>({i:e,cx:l,cy:h,outerR:o*Math.sqrt(r)+this._lastDotR,dots:[]}));let u=0;return c.forEach(e=>{for(let i=0;i<t[e];i++){const t=o*Math.sqrt(u+.5),i=u*Cs;d[e].dots.push({x:l+t*Math.cos(i),y:h+t*Math.sin(i),slot:u}),u++}}),d}_layoutArc(t,e){const i=this.w,s=i.layout.gridWidth,a=i.layout.gridHeight,r=Math.max(1,t.reduce((t,e)=>t+e,0)),n=e.arc||{},o="number"==typeof n.startAngle?n.startAngle:-90,l="number"==typeof n.endAngle?n.endAngle:90,h=o*Math.PI/180,c=l*Math.PI/180,d=c-h||Math.PI,u=Math.max(0,Math.min(.95,"number"==typeof n.innerRadiusRatio?n.innerRadiusRatio:.4)),p=t=>Math.sin(t),g=t=>-Math.cos(t),f=this._arcBounds(h,c),m=.04*Math.min(s,a),x=Math.max(1e-6,f.maxX-f.minX),b=Math.max(1e-6,f.maxY-f.minY),y=Math.max(4,Math.min((s-2*m)/x,(a-2*m)/b)),w=y*u,v=s/2-(f.minX+f.maxX)/2*y,_=a/2-(f.minY+f.maxY)/2*y,A=this._arcAllocate(r,w,y,d,e);this._lastDotR=A.dotR;const S=[];for(let t=0;t<A.R;t++){const e=A.radii[t],i=A.seatsPerRow[t];for(let t=0;t<i;t++){const s=1===i?(h+c)/2:h+d*(t+.5)/i;S.push({a:s,x:v+e*p(s),y:_+e*g(s)})}}S.sort((t,e)=>t.a-e.a);const C=t.map((t,e)=>({i:e,cx:v,cy:_,outerR:y,dots:[]}));let k=0,M=0;return S.forEach((e,i)=>{for(;k<t.length&&M>=t[k];)k++,M=0;k>=t.length||(C[k].dots.push({x:e.x,y:e.y,slot:i}),M++)}),C}_arcBounds(t,e){const i=t=>Math.sin(t),s=t=>-Math.cos(t),a=Math.min(t,e),r=Math.max(t,e),n=[0,i(t),i(e)],o=[0,s(t),s(e)],l=Math.PI/2;for(let t=Math.ceil(a/l);t*l<=r;t++)n.push(i(t*l)),o.push(s(t*l));return{minX:Math.min(...n),maxX:Math.max(...n),minY:Math.min(...o),maxY:Math.max(...o)}}_arcAllocate(t,e,i,s,a){const r=a.spacing>0?a.spacing:1.05,n=Math.abs(s)||Math.PI,o=this._fixedRadius(a),l=s=>{s=Math.max(1,Math.round(s));const a=[];for(let t=0;t<s;t++)a.push(1===s?(e+i)/2:e+t/(s-1)*(i-e));const o=a.reduce((t,e)=>t+e,0)||1,l=a.map(e=>t*e/o),h=l.map(t=>Math.floor(t));let c=t-h.reduce((t,e)=>t+e,0);for(l.map((t,e)=>({idx:e,frac:t-Math.floor(t)})).sort((t,e)=>e.frac-t.frac).forEach(t=>{c>0&&(h[t.idx]++,c--)});c>0;)h[s-1]++,c--;const d=1===s?i-e||i:(i-e)/(s-1);let u=1/0;for(let t=0;t<s;t++){const e=h[t];if(e<=0)continue;const i=a[t]*n/e;i<u&&(u=i)}const p=Math.min(d,u);return{R:s,radii:a,seatsPerRow:h,dotR:Math.max(1,p/(2*r))}},h=a.arc&&a.arc.rows;let c;if("number"==typeof h&&h>=1)c=l(h);else if(o){c=l((i-e)/(2*o*r)+1)}else{const e=Math.max(1,Math.min(40,Math.ceil(Math.sqrt(t))+6));c=l(1);for(let t=2;t<=e;t++){const e=l(t);e.dotR>c.dotR&&(c=e)}}return o&&(c.dotR=o),c}_layoutColumns(t,e){const i=this.w,s=i.layout.gridWidth,a=i.layout.gridHeight,r=!(!e.clusterLabels||!e.clusterLabels.show),n=r&&"bottom"===e.clusterLabels.position,o=r&&!n?30:6,l=t.map((t,e)=>e).filter(e=>t[e]>0),h=Math.max(1,l.length),c=new Array(t.length).fill(-1);l.forEach((t,e)=>c[t]=e);const d=s/h,u=.62*d,p=Math.max(8,.04*a)+(n?30:0),g=Math.max(4,a-o-p),f=Math.max(1,...t),m=e.spacing>0?e.spacing:1,x=e.columns?e.columns.size:void 0;let b;b="image"!==e.shape&&"auto"===x?null:"image"!==e.shape&&"number"==typeof x&&x>0?x:this._fixedRadius(e);let y=1,w=0;if(b){w=2*b*m,this._lastDotR=b;const t=Math.max(1,Math.floor(g/w)),e=Math.max(1,Math.floor(u/w));y=Math.max(1,Math.min(e,Math.ceil(f/t)))}else{let t=0;const e=Math.max(1,Math.min(40,Math.round(u/4)));for(let i=1;i<=e;i++){const e=Math.ceil(f/i),s=Math.min(u/i,g/e);s>t&&(t=s,y=i)}w=t,this._lastDotR=Math.max(1,w/(2*m))}const v=this._lastDotR,_=Math.ceil(f/y),A=o+(g+Math.min(g,_*w))/2;return t.map((t,e)=>{const i=c[e]>=0?d*(c[e]+.5):s/2,a=Math.ceil(Math.max(1,t)/y)*w,r=i-y*w/2+w/2,n=[];for(let e=0;e<t;e++){const t=Math.floor(e/y),i=e%y;n.push({x:r+i*w,y:A-v-t*w})}return{i:e,cx:i,cy:A-a/2,outerR:a/2,flat:!0,dots:n}})}_layoutGrid(t,e){if(e.grid&&e.grid.split)return this._layoutGridSplit(t,e);this._gridTrack=null;const i=this.w,s=i.layout.gridWidth,a=i.layout.gridHeight,r=e.grid||{},n=Math.max(1,Math.round(r.columns>0?r.columns:10)),o="top"===r.fillFrom?"top":"bottom",l=r.total>0?this._largestRemainder(t,Math.round(r.total)):t.slice(),h=l.reduce((t,e)=>t+e,0),c=Math.max(1,Math.ceil(Math.max(1,h)/n)),d=e.spacing>0?e.spacing:1,u=Math.max(4,s),p=Math.max(4,a-6),g=this._fixedRadius(e);let f=0;g?(f=2*g*d,this._lastDotR=g):(f=Math.min(u/n,p/c),this._lastDotR=Math.max(1,f/(2*d)));const m=n*f,x=c*f,b=(s-m)/2+f/2,y=6+(p-x)/2,w=t=>"bottom"===o?y+x-f/2-t*f:y+f/2+t*f,v=t.map((t,e)=>({i:e,cx:s/2,cy:6+p/2,outerR:Math.max(m,x)/2,dots:[]}));let _=0;for(let t=0;t<l.length;t++)for(let e=0;e<l[t];e++){const e=_%n,i=Math.floor(_/n);v[t].dots.push({x:b+e*f,y:w(i),slot:_}),_++}return v}_layoutGridSplit(t,e){const i=this.w,s=i.layout.gridWidth,a=i.layout.gridHeight,r=e.grid||{},n=Math.max(1,Math.round(r.columns>0?r.columns:10)),o="top"===r.fillFrom?"top":"bottom",l=Math.max(1,Math.round(r.total>0?r.total:100)),h=Math.max(1,Math.ceil(l/n)),c=t.map((t,e)=>e).filter(e=>t[e]>0),d=Math.max(1,c.length),u=r.max>0?r.max:Math.max(1,...t),p=Math.max(1,Math.round(r.tileColumns>0?r.tileColumns:Math.ceil(Math.sqrt(d)))),g=Math.max(1,Math.ceil(d/p)),f=!(e.clusterLabels&&!1===e.clusterLabels.show),m=f&&e.clusterLabels&&"bottom"===e.clusterLabels.position,x=f&&!m?22:4,b=f&&m?22:4,y=s/p,w=a/g,v=Math.max(4,.86*y),_=Math.max(4,w-x-b),A=e.spacing>0?e.spacing:1,S=this._fixedRadius(e);let C=0;S?(C=2*S*A,this._lastDotR=S):(C=Math.min(v/n,_/h),this._lastDotR=Math.max(1,C/(2*A)));const k=n*C,M=h*C,P=(t,e)=>"bottom"===o?t+M-C/2-e*C:t+C/2+e*C,L=[],I=[];return c.forEach((e,i)=>{const s=i%p,a=Math.floor(i/p),r=s*y,o=r+(y-k)/2+C/2,h=a*w+x+(_-M)/2,c=t=>({x:o+t%n*C,y:P(h,Math.floor(t/n))});for(let t=0;t<l;t++)L.push(c(t));const d=Math.max(0,Math.min(l,Math.round(t[e]/u*l))),g=[];for(let t=0;t<d;t++){const e=c(t);g.push({x:e.x,y:e.y,slot:i*l+t})}I.push({i:e,cx:r+y/2,cy:h+M/2,outerR:M/2,flat:!0,split:!0,dots:g})}),this._gridDenom=u,this._gridTrack={cells:L},I}_drawGridTrack(t,e,i){const s=this._gridTrack;if(!s||!s.cells||!s.cells.length)return;const a=this._lastDotR,r=(i.grid||{}).trackColor||"rgba(128,128,128,0.14)",n=e.group({class:"apexcharts-unit-track"});s.cells.forEach(t=>{let s;if("square"===i.shape){const n=2*a;s=e.drawRect(0,0,n,n,i.borderRadius||0,r,1,0,"none"),s.node.setAttribute("fill",r),s.node.setAttribute("x",String(t.x-a)),s.node.setAttribute("y",String(t.y-a))}else s=e.drawCircle(a,{fill:r,"stroke-width":0,stroke:"none"}),s.node.setAttribute("fill",r),s.node.setAttribute("cx",String(t.x)),s.node.setAttribute("cy",String(t.y));s.node.classList.add("apexcharts-unit-track-cell"),n.add(s)}),t.add(n)}_layoutScatter(t){const e=this.w,i=t.scatter||{};if("value"===i.y)return this._layoutScatter2D(t);if("vertical"===i.orientation)return this._layoutScatterVertical(t);const s=e.layout.gridWidth,a=e.layout.gridHeight,r=e.seriesData.unitData||[],n=e.seriesData.seriesNames||[],o=t=>this._unitValueOf(t),l=this._scatterSizeStats(i,r),h=r.map(t=>Array.isArray(t)?t.map(o):[]),c=t=>null!=t&&isFinite(t),d=h.map((t,e)=>e).filter(t=>h[t].some(c)),u=Math.max(1,d.length);let p=1/0,g=-1/0;h.forEach(t=>t.forEach(t=>{null!=t&&isFinite(t)&&(t<p&&(p=t),t>g&&(g=t))})),p===1/0&&(p=0,g=1);const f=Math.max(2,Math.round(i.tickAmount>0?i.tickAmount:5)),m=this._scatterValueDomain(i,p,g,f),x=m.min,b=m.max,y=b-x||1,w=null!=i.laneLabelWidth?Math.max(0,i.laneLabelWidth):u>1?92:8,v=30+(i.xTitle?20:0),_=w,A=s-8,S=a-v,C=Math.max(4,A-_),k=Math.max(4,S-10),M=t=>_+(t-x)/y*C,P=k/u;let L=0;const I=this._fixedRadius(t);if(I)L=I;else{const t=Math.max(1,...d.map(t=>h[t].filter(c).length));L=Math.max(2,Math.min(6,.12*P,C/(2.5*Math.sqrt(t))))}this._lastDotR=L;const E=t.spacing>0?t.spacing:1,R=Math.max(.5,L*E),D="jitter"===i.spread,F=[],X=[],T=l?l.rMax:L;d.forEach((t,e)=>{const i=(t=>10+P*(t+.5))(e);X.push({i:t,cy:i,name:n[t]||`series-${t+1}`});const s=(r[t]||[]).map((t,e)=>{const s=o(t),a={j:e,px:M(c(s)?s:x),y:i};return l&&(a.r=this._scatterRadius(t,l,L)),a});if(D){const t=Math.max(T,P/2-T);s.forEach((e,s)=>{const a=(9301*s+49297)%233280/233280;e.y=i+(2*a-1)*t})}else this._beeswarm(s,i,L,R,T);F.push({i:t,cx:(_+A)/2,cy:i,outerR:P/2,dots:s.map(t=>({x:t.px,y:t.y,r:t.r}))})});const z=m.ticks;return this._scatterAxis={mode:"1d",plotL:_,plotR:A,plotT:10,plotB:S,xMin:x,xMax:b,plotX:M,ticks:z,lanes:X,xTitle:i.xTitle,formatter:"function"==typeof i.xFormatter?i.xFormatter:null,gridlines:!1!==i.gridlines},F}_layoutScatterVertical(t){const e=this.w,i=t.scatter||{},s=e.layout.gridWidth,a=e.layout.gridHeight,r=e.seriesData.unitData||[],n=e.seriesData.seriesNames||[],o=t=>this._unitValueOf(t),l=this._scatterSizeStats(i,r),h=r.map(t=>Array.isArray(t)?t.map(o):[]),c=t=>null!=t&&isFinite(t),d=h.map((t,e)=>e).filter(t=>h[t].some(c)),u=Math.max(1,d.length);let p=1/0,g=-1/0;h.forEach(t=>t.forEach(t=>{null!=t&&isFinite(t)&&(t<p&&(p=t),t>g&&(g=t))})),p===1/0&&(p=0,g=1);const f=Math.max(2,Math.round(i.tickAmount>0?i.tickAmount:5)),m=this._scatterValueDomain(i,p,g,f),x=m.min,b=m.max,y=b-x||1,w=46+(i.xTitle?18:0),v=s-10,_=a-(u>1?26:10),A=Math.max(4,v-w),S=Math.max(4,_-10),C=t=>_-(t-x)/y*S,k=A/u;let M=0;const P=this._fixedRadius(t);if(P)M=P;else{const t=Math.max(1,...d.map(t=>h[t].filter(c).length));M=Math.max(2,Math.min(6,.12*k,S/(2.5*Math.sqrt(t))))}this._lastDotR=M;const L=t.spacing>0?t.spacing:1,I=Math.max(.5,M*L),E="jitter"===i.spread,R=[],D=[],F=l?l.rMax:M;d.forEach((t,e)=>{const i=(t=>w+k*(t+.5))(e);D.push({i:t,cx:i,name:n[t]||`series-${t+1}`});const s=(r[t]||[]).map((t,e)=>{const s=o(t),a={j:e,py:C(c(s)?s:x),x:i};return l&&(a.r=this._scatterRadius(t,l,M)),a});if(E){const t=Math.max(F,k/2-F);s.forEach((e,s)=>{const a=(9301*s+49297)%233280/233280;e.x=i+(2*a-1)*t})}else this._beeswarm(s,i,M,I,F,!0);R.push({i:t,cx:i,cy:(10+_)/2,outerR:k/2,dots:s.map(t=>({x:t.x,y:t.py,r:t.r}))})});const X=m.ticks;return this._scatterAxis={mode:"1d",orientation:"vertical",plotL:w,plotR:v,plotT:10,plotB:_,vMin:x,vMax:b,plotY:C,ticks:X,lanes:D,valueTitle:i.xTitle,formatter:"function"==typeof i.xFormatter?i.xFormatter:null,gridlines:!1!==i.gridlines},R}_layoutScatter2D(t){const e=this.w,i=e.layout.gridWidth,s=e.layout.gridHeight,a=t.scatter||{},r=e.seriesData.unitData||[],n=t=>"number"==typeof t&&isFinite(t),o=t=>t&&"object"==typeof t?t.x:null,l=t=>t&&"object"==typeof t?null!=t.y?t.y:t.value:null,h=r.map((t,e)=>e).filter(t=>(r[t]||[]).some(t=>n(o(t))&&n(l(t))));let c=1/0,d=-1/0,u=1/0,p=-1/0;r.forEach(t=>(t||[]).forEach(t=>{const e=o(t),i=l(t);n(e)&&n(i)&&(e<c&&(c=e),e>d&&(d=e),i<u&&(u=i),i>p&&(p=i))})),c===1/0&&(c=0,d=1,u=0,p=1);const g=Math.max(2,Math.round(a.tickAmount>0?a.tickAmount:5)),f=Math.max(2,Math.round(a.yTickAmount>0?a.yTickAmount:5)),m=this._niceScale(null!=a.xMin?a.xMin:c,null!=a.xMax?a.xMax:d,g),x=this._niceScale(null!=a.yMin?a.yMin:u,null!=a.yMax?a.yMax:p,f),b=null!=a.xMin?a.xMin:m.min,y=null!=a.xMax?a.xMax:m.max,w=null!=a.yMin?a.yMin:x.min,v=null!=a.yMax?a.yMax:x.max,_=y-b||1,A=v-w||1,S=46+(a.yTitle?18:0),C=30+(a.xTitle?20:0),k=S,M=i-12,P=s-C,L=Math.max(4,M-k),I=Math.max(4,P-10),E=t=>k+(t-b)/_*L,R=t=>P-(t-w)/A*I,D=this._scatterSizeStats(a,r),F=this._fixedRadius(t)||5;this._lastDotR=F;const X=[];h.forEach(t=>{const e=(r[t]||[]).map(t=>{const e=o(t),i=l(t);return{x:E(n(e)?e:b),y:R(n(i)?i:w),r:D?this._scatterRadius(t,D,F):void 0}});X.push({i:t,cx:(k+M)/2,cy:(10+P)/2,outerR:I/2,dots:e})});const T=(t,e,i,s,a,r)=>{const n=[];if(a)for(let e=0;e<r;e++)n.push(t+i*e/(r-1));else{const a=s||i/Math.max(1,r-1);for(let i=t;i<=e+.5*a;i+=a)n.push(Math.abs(i)<1e-9*a?0:i)}return n};return this._scatterAxis={mode:"2d",plotL:k,plotR:M,plotT:10,plotB:P,plotX:E,plotY:R,xTicks:T(b,y,_,m.spacing,null!=a.xMin||null!=a.xMax,g),yTicks:T(w,v,A,x.spacing,null!=a.yMin||null!=a.yMax,f),xTitle:a.xTitle,yTitle:a.yTitle,xFormatter:"function"==typeof a.xFormatter?a.xFormatter:null,yFormatter:"function"==typeof a.yFormatter?a.yFormatter:null,gridlines:!1!==a.gridlines},X}_scatterSizeStats(t,e){const i=t&&t.sizeRange;if(!Array.isArray(i)||i.length<2)return null;const s=Math.max(.5,+i[0]),a=Math.max(s,+i[1]),r=t.sizeField||"z";let n=1/0,o=-1/0;return e.forEach(t=>(t||[]).forEach(t=>{const e=t&&"object"==typeof t?t[r]:null;"number"==typeof e&&isFinite(e)&&(e<n&&(n=e),e>o&&(o=e))})),n===1/0?null:{zmin:n,zmax:o,rMin:s,rMax:a,field:r}}_scatterRadius(t,e,i){if(!e)return i;const s=t&&"object"==typeof t?t[e.field]:null;if("number"!=typeof s||!isFinite(s))return e.rMin;const a=e.zmax>e.zmin?(s-e.zmin)/(e.zmax-e.zmin):1,r=Math.max(0,Math.min(1,a)),n=e.rMin*e.rMin,o=e.rMax*e.rMax;return Math.sqrt(n+r*(o-n))}_beeswarm(t,e,i,s,a,r=!1){const n=r?"py":"px",o=r?"x":"y",l=t.slice().sort((t,e)=>t[n]-e[n]),h=[],c=null!=a?a:i;l.forEach(t=>{const a=null!=t.r?t.r:i;let r=0;for(let i=0;i<2e3;i++){const o=0===i?0:Math.ceil(i/2)*s*(i%2?1:-1),l=e+o;let d=!0;for(let e=h.length-1;e>=0;e--){const i=h[e],s=t[n]-i.f;if(s>a+c)break;const r=a+i.r,o=l-i.s;if(s*s+o*o<r*r){d=!1;break}}if(d){r=o;break}}t[o]=e+r,h.push({f:t[n],s:t[o],r:a})})}_scatterValueDomain(t,e,i,s){const a=(t,e,i)=>{const s=[];for(let a=t;a<=e+.5*i;a+=i)s.push(Math.abs(a)<1e-9*i?0:a);return s};if(null!=t.xMin||null!=t.xMax){let r=null!=t.xMin?t.xMin:e,n=null!=t.xMax?t.xMax:i;n>r||(n=r+1);const o=(n-r)/Math.max(1,s-1);return e<r&&(r-=Math.ceil((r-e)/o)*o),i>n&&(n+=Math.ceil((i-n)/o)*o),{min:r,max:n,ticks:a(r,n,o)}}const r=this._niceScale(e,i,s),n=r.spacing||(r.max-r.min)/Math.max(1,s-1);return{min:r.min,max:r.max,ticks:a(r.min,r.max,n)}}_niceScale(t,e,i){const s=t;let a=e;a>s||(a=s+1);const r=this._niceNum(a-s,!1),n=this._niceNum(r/Math.max(1,i-1),!0);return{min:Math.floor(s/n)*n,max:Math.ceil(a/n)*n,spacing:n}}_niceNum(t,e){const i=t>0?t:1,s=Math.floor(Math.log(i)/Math.LN10),a=i/Math.pow(10,s);let r;return r=e?a<1.5?1:a<3?2:a<7?5:10:a<=1?1:a<=2?2:a<=5?5:10,r*Math.pow(10,s)}_drawScatterAxes(t,e){const i=this.w;if(!Wt.isBrowser())return;const s=this._scatterAxis;if(!s)return;const a="http://www.w3.org/2000/svg",r=e.group({class:"apexcharts-unit-axis"}),n=i.config.grid&&i.config.grid.borderColor||"rgba(128,128,128,0.18)",o="rgba(128,128,128,0.5)",l=i.config.xaxis&&i.config.xaxis.labels&&i.config.xaxis.labels.style&&i.config.xaxis.labels.style.colors,h=Array.isArray(l)?l[0]:l,c=h||"rgba(120,130,140,0.9)",d=(t,e,i,s,n)=>{const o=ct.createElementNS(a,"line");o.setAttribute("x1",String(t)),o.setAttribute("y1",String(e)),o.setAttribute("x2",String(i)),o.setAttribute("y2",String(s)),o.setAttribute("stroke",n),o.setAttribute("shape-rendering","crispEdges"),r.node.appendChild(o)},u=(t,e,s,n,o,l,h,c)=>{const d=ct.createElementNS(a,"text");d.setAttribute("class",c),d.setAttribute("x",String(e)),d.setAttribute("y",String(s)),d.setAttribute("text-anchor",n),d.setAttribute("dominant-baseline","middle"),d.setAttribute("font-size",`${l}px`),d.setAttribute("font-family",i.config.chart.fontFamily||"inherit"),d.setAttribute("font-weight",String(h)),d.setAttribute("fill",o),d.textContent=t,r.node.appendChild(d)};if("2d"!==s.mode){if("vertical"===s.orientation){if(s.ticks.forEach(t=>{const e=s.plotY(t);s.gridlines&&d(s.plotL,e,s.plotR,e,n);const i=s.formatter?String(s.formatter(t)):this._formatTick(t);u(i,s.plotL-8,e,"end",c,11,400,"apexcharts-unit-tick")}),d(s.plotL,s.plotT,s.plotL,s.plotB,o),s.valueTitle){const t=ct.createElementNS(a,"text");t.setAttribute("class","apexcharts-unit-axis-title");const e=14,n=(s.plotT+s.plotB)/2;t.setAttribute("x",String(e)),t.setAttribute("y",String(n)),t.setAttribute("text-anchor","middle"),t.setAttribute("font-size","12px"),t.setAttribute("font-family",i.config.chart.fontFamily||"inherit"),t.setAttribute("font-weight","600"),t.setAttribute("fill",c),t.setAttribute("transform",`rotate(-90 ${e} ${n})`),t.textContent=String(s.valueTitle),r.node.appendChild(t)}return s.lanes.forEach(t=>{const e=h||i.globals.colors[t.i]||i.globals.colors[0]||"#008FFB";u(t.name,t.cx,s.plotB+16,"middle",e,12,600,"apexcharts-unit-lane-label")}),void t.add(r)}s.ticks.forEach((t,e)=>{const i=s.plotX(t);s.gridlines&&d(i,s.plotT,i,s.plotB,n);const a=s.formatter?String(s.formatter(t)):this._formatTick(t),r=0===e?"start":e===s.ticks.length-1?"end":"middle";u(a,i,s.plotB+14,r,c,11,400,"apexcharts-unit-tick")}),d(s.plotL,s.plotB,s.plotR,s.plotB,o),s.xTitle&&u(String(s.xTitle),(s.plotL+s.plotR)/2,s.plotB+32,"middle",c,12,600,"apexcharts-unit-axis-title"),s.plotL>12&&s.lanes.forEach(t=>{const e=h||i.globals.colors[t.i]||i.globals.colors[0]||"#008FFB";u(t.name,s.plotL-8,t.cy,"end",e,12,600,"apexcharts-unit-lane-label")}),t.add(r)}else{if(s.yTicks.forEach(t=>{const e=s.plotY(t);s.gridlines&&d(s.plotL,e,s.plotR,e,n);const i=s.yFormatter?String(s.yFormatter(t)):this._formatTick(t);u(i,s.plotL-8,e,"end",c,11,400,"apexcharts-unit-tick")}),s.xTicks.forEach(t=>{const e=s.plotX(t);s.gridlines&&d(e,s.plotT,e,s.plotB,n);const i=s.xFormatter?String(s.xFormatter(t)):this._formatTick(t);u(i,e,s.plotB+14,"middle",c,11,400,"apexcharts-unit-tick")}),d(s.plotL,s.plotB,s.plotR,s.plotB,o),d(s.plotL,s.plotT,s.plotL,s.plotB,o),s.xTitle&&u(String(s.xTitle),(s.plotL+s.plotR)/2,s.plotB+32,"middle",c,12,600,"apexcharts-unit-axis-title"),s.yTitle){const t=ct.createElementNS(a,"text");t.setAttribute("class","apexcharts-unit-axis-title");const e=14,n=(s.plotT+s.plotB)/2;t.setAttribute("x",String(e)),t.setAttribute("y",String(n)),t.setAttribute("text-anchor","middle"),t.setAttribute("font-size","12px"),t.setAttribute("font-family",i.config.chart.fontFamily||"inherit"),t.setAttribute("font-weight","600"),t.setAttribute("fill",c),t.setAttribute("transform",`rotate(-90 ${e} ${n})`),t.textContent=String(s.yTitle),r.node.appendChild(t)}t.add(r)}}_formatTick(t){if(!isFinite(t))return"";const e=Math.abs(t);return e>=1e6?+(t/1e6).toFixed(1)+"M":e>=1e4?+(t/1e3).toFixed(1)+"k":Number.isInteger(t)?String(t):String(+t.toFixed(2))}_largestRemainder(t,e){const i=t.reduce((t,e)=>t+e,0);if(i<=0||e<=0)return t.map(()=>0);const s=t.map(t=>t/i*e),a=s.map(t=>Math.floor(t)),r=a.reduce((t,e)=>t+e,0),n=Math.max(0,e-r),o=s.map((t,e)=>({i:e,frac:t-Math.floor(t)})).sort((t,e)=>e.frac-t.frac),l=a.slice();for(let t=0;t<n&&t<o.length;t++)l[o[t].i]++;return l}_spiral(t,e,i,s,a){const r=[];for(let n=0;n<i;n++){const i=a+n,o=s*Math.sqrt(i+.5),l=i*Cs;r.push({x:t+o*Math.cos(l),y:e+o*Math.sin(l)})}return r}_fixedRadius(t){return"image"===t.shape&&t.image?Math.max(t.image.width||20,t.image.height||20)/2:this._bubbleActive(t)&&"number"==typeof t.sizeByValue.maxRadius?t.sizeByValue.maxRadius>0?t.sizeByValue.maxRadius:null:"number"==typeof t.size&&t.size>0?t.size:null}_bubbleActive(t){const e=t.sizeByValue;return!(!e||!e.enabled||"image"===t.shape||"square"===t.shape)}_unitValueOf(t){if("number"==typeof t)return t;if(t&&"object"==typeof t){const e=null!=t.value?t.value:t.y;return"number"==typeof e?e:null}return null}_radiusForValue(t,e){if(null==t||!isFinite(t))return e.minR;const i=e.max>e.min?(t-e.min)/(e.max-e.min):1,s=Math.max(0,Math.min(1,i));if("linear"===e.scale)return e.minR+s*(e.maxR-e.minR);const a=e.minR*e.minR,r=e.maxR*e.maxR;return Math.sqrt(a+s*(r-a))}_bubbleStats(t,e,i){if(!this._bubbleActive(e))return null;let s=1/0,a=-1/0;if(t.forEach(t=>{t&&t.forEach(t=>{const e=this._unitValueOf(t);null!=e&&isFinite(e)&&(e<s&&(s=e),e>a&&(a=e))})}),s===1/0||a<s)return null;const r=e.sizeByValue,n=i,o=Math.max(1,Math.min(n,"number"==typeof r.minRadius?r.minRadius:.35*n));return{min:s,max:a,minR:o,maxR:n,scale:"linear"===r.scale?"linear":"area"}}_resolveStep(t,e,i){const s=t.spacing>0?t.spacing:1,a=this._fixedRadius(t);return a?2*a*s:e/(Math.sqrt(Math.max(1,i))+.5)}_dotRadiusFromStep(t,e){const i=e.spacing>0?e.spacing:1,s=this._fixedRadius(e);return s||Math.max(1,t/(2*i))}_isCorner(t){return"square"===t.shape||"image"===t.shape}_halfExtent(t,e){if("image"===t.shape&&t.image)return{hx:(t.image.width||20)/2,hy:(t.image.height||20)/2};const i=null!=e?e:this._lastDotR;return{hx:i,hy:i}}_place(t,e,i,s){const a=e;2===a.pk?t.setAttribute("transform","translate("+(i-a.ox)+","+(s-a.oy)+a.tail):1===a.pk?(t.setAttribute("x",String(i-a.hx)),t.setAttribute("y",String(s-a.hy))):(t.setAttribute("cx",String(i)),t.setAttribute("cy",String(s)))}_baseSpec(t,e){const i=null!=e?e:this._lastDotR;if(!this._isCorner(t))return{pk:0,r:i};const{hx:s,hy:a}=this._halfExtent(t,i);return{pk:1,hx:s,hy:a,r:i}}_resolveMark(t){if(null==t)return null;if("object"==typeof t)return As(t);if("string"!=typeof t||!t)return null;const e=t.trim();if("M"===e[0]||"m"===e[0])return As(e);const i=Ss(e);return i||(this._markWarned||(this._markWarned=new Set),this._markWarned.has(e)||this._markWarned.add(e),null)}_glyphSpec(t,e,i){const s=Math.round(10*e)/10,a=t.name+"|"+t.path.length+"|"+s,r=this._specCache.get(a);if(r)return r;const n=t.viewBox||[0,0,100,100],o=2*s*(1-Math.max(0,Math.min(.9,i.padding||0)))*("number"==typeof i.scale&&i.scale>0?i.scale:1),l="width"===i.fit?o/n[2]:"height"===i.fit?o/n[3]:o/Math.max(n[2],n[3]),h=Object.freeze({pk:2,mark:t,d:t.path,fillRule:t.fillRule,s:l,ox:(n[0]+n[2]/2)*l,oy:(n[1]+n[3]/2)*l,tail:") scale("+l+")",r:s});return this._specCache.set(a,h),h}_markSpecFor(t,e,i,s){if("pictogram"!==t.shape)return this._baseSpec(t,s);const a=t.pictogram||{},r=e&&"object"==typeof e?e.mark:void 0,n=Array.isArray(a.mark)?a.mark[i%a.mark.length]:a.mark,h=this._resolveMark(null!=r?r:n);return h?this._glyphSpec(h,s,a):this._baseSpec(l(o({},t),{shape:"square"===a.fallback?"square":"circle"}),s)}_drawDot(t,e,i,s,a,r,n){const o=this.w,l=o.config.stroke.show?o.config.stroke.width:0,h=Array.isArray(o.globals.stroke.colors)&&o.globals.stroke.colors[a]||"none",c="number"==typeof o.config.fill.opacity?o.config.fill.opacity:1;let d;if(n&&2===n.pk)d=o.dom.Paper.path(n.d),d.node.setAttribute("fill",s),"evenodd"===n.fillRule&&d.node.setAttribute("fill-rule","evenodd"),c<1&&d.node.setAttribute("fill-opacity",String(c)),d.node.setAttribute("data:r",String(n.r));else if("image"===e.shape&&e.image&&e.image.src){const t=e.image.width||20,i=e.image.height||20;d=o.dom.Paper.image(e.image.src),d.node.setAttribute("width",String(t)),d.node.setAttribute("height",String(i)),d.node.setAttribute("preserveAspectRatio","xMidYMid meet"),e.image.tint&&d.node.setAttribute("filter",`url(#${this._tintFilter(s)})`)}else if("square"===e.shape){const a=2*i;d=t.drawRect(0,0,a,a,e.borderRadius||0,s,1,l,h),d.node.setAttribute("fill",s),c<1&&d.node.setAttribute("fill-opacity",String(c))}else d=t.drawCircle(i,{fill:s,"stroke-width":l,stroke:h}),d.node.setAttribute("fill",s),c<1&&d.node.setAttribute("fill-opacity",String(c));return d.node.classList.add("apexcharts-unit-area"),d.node.setAttribute("i",String(a)),d.node.setAttribute("j",String(r)),d}_tintFilter(t){const e=this.w,i="http://www.w3.org/2000/svg",s=String(t).replace(/[^a-zA-Z0-9]/g,""),a=`apexcharts-unit-tint-${e.globals.chartID}-${s}`,r=e.dom.Paper.node;if(r.querySelector(`#${a}`))return a;let n=r.querySelector("defs");n||(n=ct.createElementNS(i,"defs"),r.insertBefore(n,r.firstChild));const o=ct.createElementNS(i,"filter");o.setAttribute("id",a),o.setAttribute("x","0%"),o.setAttribute("y","0%"),o.setAttribute("width","100%"),o.setAttribute("height","100%");const l=ct.createElementNS(i,"feFlood");l.setAttribute("flood-color",t),l.setAttribute("result","flood");const h=ct.createElementNS(i,"feComposite");return h.setAttribute("in","flood"),h.setAttribute("in2","SourceAlpha"),h.setAttribute("operator","in"),o.appendChild(l),o.appendChild(h),n.appendChild(o),a}_placeDot(t,e,i,s,a){this._place(t,a||this._baseSpec(e),i,s)}_rgb(t){if("string"!=typeof t)return null;let e=t.trim();if("#"===e[0]){4===e.length&&(e="#"+e[1]+e[1]+e[2]+e[2]+e[3]+e[3]);const t=parseInt(e.slice(1,7),16);return isNaN(t)?null:[t>>16&255,t>>8&255,255&t]}const i=e.match(/rgba?\(([^)]+)\)/);if(i){const t=i[1].split(",").map(t=>parseFloat(t));if(t.length>=3&&t.every(t=>!isNaN(t)))return[t[0],t[1],t[2]]}return null}_shouldAnimate(){const t=this.w,e=t.config.chart.animations;return!!Wt.isBrowser()&&(!(!e||!1===e.enabled)&&(!1!==t.globals.shouldAnimate&&(!(t.globals.resized&&!t.globals.dataChanged)&&(!e.respectReducedMotion||!f()))))}_seedSprings(t,e,i){const[s,a]=Ps(e.spring,i),r=this.ctx?this.ctx._unitSprings:null,n=new Map;for(let e=0;e<t.length;e++){const i=t[e],o=r&&!i.isEnter&&null!=i.key?r.get(i.key):null,l=o?o.x:fs(i.cx0,s,a),h=o?o.y:fs(i.cy0,s,a);o&&(l.stiffness=s,h.stiffness=s,l.damping=a,h.damping=a,i.cx0=l.value,i.cy0=h.value,this._place(i.node,i.spec,i.cx0,i.cy0),0===l.velocity&&0===h.velocity||(i.delay=0)),i.sx=l,i.sy=h,null!=i.key&&n.set(i.key,{x:l,y:h})}this.ctx&&(this.ctx._unitSprings=n)}_runGather(t){const e=this.w,i=e.config.plotOptions.unit,s=Math.max(1,e.config.chart.animations.speed||800),a=Math.min(.6*s,450),r=t.length;for(let e=0;e<r;e++)t[e].delay=r>1?e/(r-1)*a:0;const n=i.gather||{},o=n.motion||"auto";"spring"===o||"auto"===o&&(!n.easing||"outCubic"===n.easing)?this._seedSprings(t,n,s):this.ctx&&(this.ctx._unitSprings=null);for(let e=0;e<r;e++){const i=t[e];0===i.spec.pk&&null!=i.r0&&null!=i.r1&&i.r0!==i.r1&&i.node.setAttribute("r",String(i.r0))}for(let e=0;e<r;e++){const i=t[e];i.fill0&&i.fill1&&i.fill0!==i.fill1&&(i._c0=this._rgb(i.fill0),i._c1=this._rgb(i.fill1))}const l="outBack"===n.easing?(h="number"==typeof n.overshoot?n.overshoot:1.70158,t=>1+(h+1)*Math.pow(t-1,3)+h*Math.pow(t-1,2)):"inOutCubic"===n.easing?Ms:ks;var h;null!=this.w.globals.unitGatherRAF&&(ct.cancelAnimationFrame(this.w.globals.unitGatherRAF),this.w.globals.unitGatherRAF=null);const c=performance.now();let d=c;const u=e=>{if(this.w.globals.isDestroyed)return this.w.globals.unitGatherRAF=null,void(this.w.globals.animationEnded=!0);const i=Math.min(.25,Math.max(0,(e-d)/1e3));d=e;let a=!0;for(let n=0;n<r;n++){const r=t[n],o=e-c-r.delay,h=Math.max(0,Math.min(1,o/s)),d=ks(h);let u,p;if(r.sx&&r.sy){o>=0&&!r.released&&(xs(r.sx,r.x),xs(r.sy,r.y),r.released=!0);const t=ms(r.sx,i),e=ms(r.sy,i);r.released&&t&&e||(a=!1),u=r.sx.value,p=r.sy.value}else{const t=l(h);u=r.cx0+(r.x-r.cx0)*t,p=r.cy0+(r.y-r.cy0)*t}if(this._place(r.node,r.spec,u,p),r.isEnter&&(r.node.style.opacity=String(Math.min(1,2.5*h))),r._c0&&r._c1){const t=Math.round(r._c0[0]+(r._c1[0]-r._c0[0])*d),e=Math.round(r._c0[1]+(r._c1[1]-r._c0[1])*d),i=Math.round(r._c0[2]+(r._c1[2]-r._c0[2])*d);r.node.setAttribute("fill",`rgb(${t},${e},${i})`)}0===r.spec.pk&&null!=r.r0&&null!=r.r1&&r.r0!==r.r1&&r.node.setAttribute("r",String(r.r0+(r.r1-r.r0)*d)),h<1&&(a=!1)}if(a){for(let e=0;e<r;e++){const i=t[e];i.node.style.opacity="",i._c1&&i.fill1&&i.node.setAttribute("fill",i.fill1),0===i.spec.pk&&null!=i.r0&&null!=i.r1&&i.r0!==i.r1&&i.node.setAttribute("r",String(i.r1))}this.w.globals.unitGatherRAF=null,this.w.globals.animationEnded=!0}else this.w.globals.unitGatherRAF=ct.requestAnimationFrame(u)};this.w.globals.unitGatherRAF=ct.requestAnimationFrame(u)}_collectExits(t,e,i){const s=Math.max(0,i.maxUnits||5e3),a=[];for(const[i,r]of t)if(!e.has(i)&&(a.push(r),a.length>=s))break;return a}_runExits(t,e,i){const s=this.w,a=new I(s,this.ctx),r=this._lastDotR,n=s.layout.gridWidth/2,o=s.layout.gridHeight/2,l="grid"===i.layout||"scatter"===i.layout||"arc"===i.layout||"custom"===i.layout?0:.35,h=[];if(e.forEach(e=>{const s=null!=e.r?e.r:r,n=e.spec||this._baseSpec(i,s),o=this._drawDot(a,i,s,e.fill,0,0,n);o.node.classList.add("apexcharts-unit-exit"),this._place(o.node,n,e.x,e.y),t.add(o),h.push({node:o.node,x0:e.x,y0:e.y,spec:n})}),!this._shouldAnimate())return void h.forEach(t=>t.node.remove());const c=Math.max(1,s.config.chart.animations.speed||800);null!=this.w.globals.unitExitRAF&&(ct.cancelAnimationFrame(this.w.globals.unitExitRAF),this.w.globals.unitExitRAF=null);const d=performance.now(),u=e=>{if(this.w.globals.isDestroyed)return void(this.w.globals.unitExitRAF=null);const i=Math.max(0,Math.min(1,(e-d)/c)),s=ks(i);for(let t=0;t<h.length;t++){const e=h[t];if(l){const t=e.x0+(n-e.x0)*s*l,i=e.y0+(o-e.y0)*s*l;this._place(e.node,e.spec,t,i)}e.node.style.opacity=String(1-s)}i<1?this.w.globals.unitExitRAF=ct.requestAnimationFrame(u):(this.w.globals.unitExitRAF=null,t.node&&t.node.remove())};this.w.globals.unitExitRAF=ct.requestAnimationFrame(u)}_outerLabelsOn(t){const e=t.clusterLabels;return!!("custom"===t.layout&&e&&!1!==e.show&&e.external&&e.external.show)}_outerLabelLines(t,e,i,s){const a=this.w,r=a.seriesData.seriesNames[t]||`series-${t+1}`,n=i>0?e/i*100:0,o=s.clusterLabels,l="function"==typeof o.formatter?o.formatter(r,{seriesIndex:t,value:e,percent:n,w:a}):`${r}\n${n.toFixed(1)}%`;return String(l).split("\n")}_outerLabelGutter(t,e){const i=this.w,s=e.clusterLabels,a=s.external.connector||{},r=t.reduce((t,e)=>t+e,0),n=[];if(t.forEach((t,i)=>{t>0&&n.push(...this._outerLabelLines(i,t,r,e))}),!n.length)return 0;const o=function(t,e,i={}){const s=new I(t),a=i.fontSize||"12px",r=parseFloat(a)||12;let n=0;return e.forEach(t=>{if(null==t||""===t)return;const e=`${t}`,o=s.getTextRects(e,a,i.fontFamily,"").width;n=Math.max(n,o>0?o:e.length*r*.58)}),n}(i,n,{fontSize:s.fontSize,fontFamily:s.fontFamily||i.config.chart.fontFamily}),l=o+(null!=a.gap?a.gap:8)+(null!=a.length?a.length:22)+8+Math.abs(parseFloat(s.external.offsetX)||0);return Math.min(l,.25*i.layout.gridWidth)}_drawOuterLabels(t,e,i,s,a,r){const n=this.w;if(!Wt.isBrowser())return;const o=a.clusterLabels,l=o.external,h=l.connector||{},c=null!=h.gap?h.gap:8,d=null!=h.length?h.length:22,u=parseFloat(l.offsetX)||0,p=parseFloat(l.offsetY)||0,g=n.layout.gridWidth,f=n.layout.gridHeight,m=this._lastDotR,x=e.filter(t=>t.dots.length>0);if(!x.length)return;let b=0,y=0;if(x.length>1){const t=x.map(t=>t.cx),e=x.map(t=>t.cy);b=Math.max(...t)-Math.min(...t),y=Math.max(...e)-Math.min(...e)}const w=b>y,v=parseFloat(o.fontSize)||13,_=Math.round(1.35*v),A=[];if(x.slice().sort((t,e)=>t.cy-e.cy).forEach((t,e)=>{const r=this._outerLabelLines(t.i,i[t.i],s,a);if(!r.some(t=>""!==t))return;const n=w?t.cx>=g/2?"right":"left":e%2==0?"right":"left",o="right"===n?1:-1;let l=t.dots[0],h=-1/0;t.dots.forEach(e=>{const i=o*e.x-.75*Math.abs(e.y-t.cy);i>h&&(h=i,l=e)});const f={x:l.x+o*(l.r||m),y:l.y},x={x:f.x+o*c,y:f.y};A.push({i:t.i,lines:r,anchor:f,elbow:x,labelX:x.x+o*d+u,idealY:f.y+p,labelY:f.y+p,side:n})}),!A.length)return;const S=A.reduce((t,e)=>Math.max(t,e.lines.length),1)*_,C=S/2;["left","right"].forEach(t=>{Gi(A.filter(e=>e.side===t),S+2,f-C,C)});const k=new I(n,this.ctx).group({class:"apexcharts-unit-outer-labels"});if(r){const t=Math.max(1,n.config.chart.animations.speed||800);k.node.classList.add("apexcharts-unit-label-delay"),k.node.style.animationDelay=Math.min(.45*t,600)/1e3+"s"}A.forEach(t=>{const e=n.globals.colors[t.i]||n.globals.colors[0]||"#008FFB";k.add(Vi(n,{lines:t.lines,lineHeight:_,anchor:t.anchor,elbow:t.elbow,labelX:t.labelX,labelY:t.labelY,side:t.side,connector:{show:!1!==h.show,width:null!=h.width?h.width:1.5,color:h.color||e},style:{fontSize:o.fontSize,fontFamily:o.fontFamily||n.config.chart.fontFamily,fontWeight:o.fontWeight},foreColor:o.color||n.config.chart.foreColor,groupClass:"apexcharts-unit-outer-label-group",textClass:"apexcharts-unit-outer-label",connectorClass:"apexcharts-unit-label-connector"}))}),t.add(k)}_drawClusterLabel(t,e,i,s,a,r){const n=this.w;if(!Wt.isBrowser())return;const o="http://www.w3.org/2000/svg",l=n.seriesData.seriesNames[e.i]||`series-${e.i+1}`,h=s>0?i/s*100:0,c=a.clusterLabels,d=parseFloat(c.fontSize)||13;let u;u="function"==typeof c.formatter?c.formatter(l,{seriesIndex:e.i,value:i,percent:h,w:n}):`${l} (${h.toFixed(1)}%)`;const p="string"==typeof u?u:String(u),g=ct.createElementNS(o,"text");g.setAttribute("class","apexcharts-unit-label"),g.setAttribute("text-anchor","middle"),g.setAttribute("font-size",`${d}px`),g.setAttribute("font-family",c.fontFamily||n.config.chart.fontFamily||"inherit"),g.setAttribute("font-weight",String(c.fontWeight||600)),g.setAttribute("fill",c.color||r);const f="bottom"===c.position,m=e.outerR+.6*d+3+(c.offsetY||0),x=p.length*d*.55;if(!f&&!e.flat&&!1!==c.curved&&x<=Math.PI*m*.95){const i=e.cy,s=`M ${e.cx-m} ${i} A ${m} ${m} 0 0 1 ${e.cx+m} ${i}`,a=`apexcharts-unit-label-${n.globals.chartID}-${e.i}`,r=ct.createElementNS(o,"path");r.setAttribute("id",a),r.setAttribute("d",s),r.setAttribute("fill","none"),r.setAttribute("stroke","none");const l=ct.createElementNS(o,"textPath");l.setAttribute("href",`#${a}`),l.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",`#${a}`),l.setAttribute("startOffset","50%"),l.textContent=p,g.appendChild(l),t.node.appendChild(r)}else{g.setAttribute("x",String(e.cx));const t=f?e.cy+e.outerR+d+6+(c.offsetY||0):e.cy-e.outerR-6-(c.offsetY||0);g.setAttribute("y",String(t)),g.textContent=p}t.node.appendChild(g)}},sunburst:class{constructor(t,e){this.ctx=e,this.w=t;const i=t.config;this.cfg=i.plotOptions.sunburst,this.strokeWidth=i.stroke.show?i.stroke.width:0,this.strokeColor=Array.isArray(i.stroke.colors)?i.stroke.colors[0]:i.stroke.colors||"#fff",this.startAngle=this.cfg.startAngle,this.endAngle=this.cfg.endAngle,this.maxDepth=0,this.centerX=0,this.centerY=0,this.maxRadius=0,this.total=1,this._focusMaxDepth=0,this._focus=null,this._zoomGen=0,this._roots=[],this._nodesAll=[],this._innerR=()=>0,this._outerR=()=>0,this._tooltipEl=null,this._lblSeq=0,this._morphLeafIndex=0,this._graphics=null,this._ringsG=null,this._labelsG=null}draw(t){const e=this.w,i=new I(this.w);this._graphics=i;const s=i.group({class:"apexcharts-sunburst"});if(e.globals.noData||!t||!t.length)return s;const a=e.layout.gridWidth,r=e.layout.gridHeight;if(this.centerX=a/2+(this.cfg.offsetX||0),this.centerY=r/2+(this.cfg.offsetY||0),this.maxRadius=Math.min(a,r)/2.05-this.strokeWidth-(e.config.chart.sparkline.enabled?0:e.config.chart.dropShadow.blur),this.maxRadius<5)return s;if(this._roots=this._buildHierarchy(),!this._roots.length)return s;this._roots.forEach(t=>this._fillValues(t)),this._validateStrict(),this._nodesAll=[];const n=e.globals.colors||[];this._roots.forEach((t,e)=>{this._colorPass(t,t.color||n[e%n.length]||"#008FFB")}),this.total=this._roots.reduce((t,e)=>t+Math.max(0,e.value),0)||1,this._ringsG=i.group({class:"apexcharts-sunburst-rings"}),this._labelsG=i.group({class:"apexcharts-sunburst-labels"}),s.add(this._ringsG),s.add(this._labelsG),this._focus=null,this._relayout(this._focus);const o=e.config.chart.animations;let l="none";return o.enabled&&(e.globals.dataChanged?o.dynamicAnimation.enabled&&(l="update"):e.globals.resized||(l="intro")),this._applyLayout(l),this._renderBreadcrumb(),s}_buildHierarchy(){return function(t,e={}){const i=t.config.series,s=i&&i[0],a=s&&Array.isArray(s.data)?s.data:i;return Array.isArray(a)?a.map((i,s)=>cs(t,i,s,null,"",null,e)):[]}(this.w)}_fillValues(t){ds(t)}_validateStrict(){if("strict"!==this.cfg.partition)return;let t=!1;const e=i=>{if(i.children&&i.children.length){const s=i.children.reduce((t,e)=>t+Math.max(0,e.value||0),0);!t&&null!=i.value&&Math.abs(s-i.value)>.5&&(t=!0),i.children.forEach(e)}};this._roots.forEach(e)}_colorPass(t,e){t._color=t.color||e,this._nodesAll.push(t),t.children&&t.children.forEach(e=>this._colorPass(e,e.color||this._lighten(t._color,this.cfg.tint)))}_relayout(t){if(this._nodesAll.forEach(t=>{t._show=!1}),this._focusMaxDepth=0,t)this._placeVis(t,0,this.startAngle,this.endAngle,t._parent);else{const t=this._roots.reduce((t,e)=>t+Math.max(0,e.value),0)||1;let e=this.startAngle;this._roots.forEach(i=>{const s=(this.endAngle-this.startAngle)*Math.max(0,i.value)/t;this._placeVis(i,0,e,e+s,null),e+=s})}const e=this._parseSize(this.cfg.innerSize,this.maxRadius),i=this._focusMaxDepth+1,s=(this.maxRadius-e)/i,a=i>1?1:0;this._innerR=t=>e+t*s+(t>0?a/2:0),this._outerR=t=>e+(t+1)*s-a/2,this._nodesAll.forEach(t=>{t._show&&(t._iR=this._innerR(t._vDepth),t._oR=t._leaf&&"extend"===this.cfg.leaf&&t._vDepth<this._focusMaxDepth?this.maxRadius:this._outerR(t._vDepth))})}_placeVis(t,e,i,s,a){if(t._show=!0,t._vDepth=e,t._a0=i,t._a1=s,t._parent=a,t._leaf=!(t.children&&t.children.length),e>this._focusMaxDepth&&(this._focusMaxDepth=e),!t._leaf){const a=t.children.reduce((t,e)=>t+Math.max(0,e.value),0)||1;let r=i;t.children.forEach(n=>{const o=(s-i)*Math.max(0,n.value)/a;this._placeVis(n,e+1,r,r+o,t),r+=o})}}_applyLayout(t){var e;const i=this.w.config.chart.animations,s=i.enabled?"none"===t?0:"update"===t?i.dynamicAnimation.speed||350:i.speed||500:0,a=++this._zoomGen,r=null==(e=this.ctx)?void 0:e.morphTypeChange,n=!!r&&"function"==typeof r.isActive&&r.isActive()&&"function"==typeof r.getInitialPathAt,o=n?r.getSpeed():0;this._morphLeafIndex=0;const l="update"===t?this.ctx._sunburstPrevGeoms:null;this._nodesAll.forEach(e=>{if(e._show){const i={a0:e._a0,a1:e._a1,iR:e._iR,oR:e._oR};e._el||(e._el=this._createArcEl(e));const r=n?this._morphSourceFor(e):null;if(r&&o>0)this._morphArcFrom(e,r,i,o,a);else if(("intro"===t||n)&&s>0)this._sweepArc(e,i,n?o:s,a);else{let t,r=!1;if(e._cur)t=e._cur;else if(l&&l.get(e._key))t=l.get(e._key);else{const e=(i.a0+i.a1)/2;t={a0:e,a1:e,iR:i.iR,oR:i.iR},r=!0}this._animateArc(e,t,i,s,!1,r,a)}}else if(e._el&&e._cur){const t=(e._cur.a0+e._cur.a1)/2,i={a0:t,a1:t,iR:e._cur.iR,oR:e._cur.iR};this._animateArc(e,e._cur,i,s,!0,!1,a)}});const h=new Map;this._nodesAll.forEach(t=>{t._show&&h.set(t._key,{a0:t._a0,a1:t._a1,iR:t._iR,oR:t._oR})}),this.ctx._sunburstPrevGeoms=h,this._renderLabels(s)}_morphSourceFor(t){const e=this.ctx,i=e&&e.morphTypeChange;return i?"function"==typeof i.hasKeyedMarks&&i.hasKeyedMarks()&&"function"==typeof i.getInitialPathForKey?i.getInitialPathForKey(us(t._key)):t.children&&t.children.length?null:i.getInitialPathAt(this._morphLeafIndex++):null}_morphArcFrom(t,e,i,s,a){const r=t._el,n=this._arcPath(i.iR,i.oR,i.a0,i.a1,this.cfg.borderRadius);r.node.style.display="",r.attr({d:e,opacity:1}),t._cur=i,this._zoomGen===a&&new u(this.w,this.ctx).morphSVG(r,0,null,t._color,e,n,s,0)}_sweepArc(t,e,i,s){const a=t._el,r=this.cfg.borderRadius,n=this.startAngle,o=this.endAngle;a.node.style.display="",a.attr({d:"",opacity:1}),a.animate(i).during(i=>{if(this._zoomGen!==s)return;const l=n+(o-n)*i;if(l<=e.a0+.01)return void a.attr({d:""});const h=Math.min(e.a1,l);a.attr({d:this._arcPath(e.iR,e.oR,e.a0,h,r)}),t._cur={a0:e.a0,a1:h,iR:e.iR,oR:e.oR}}).after(()=>{this._zoomGen===s&&(t._cur=e)})}_createArcEl(t){const e=this._graphics.drawPath({d:"",fill:t._color,stroke:this.strokeColor,strokeWidth:this.strokeWidth,fillOpacity:1,classes:"apexcharts-sunburst-arc"}),i=e.node;return i.setAttribute("data:name",t.name),i.setAttribute("data:value",String(t.value)),i.setAttribute("data:key",us(t._key)),i.setAttribute("data:leaf",String(!(t.children&&t.children.length))),this._attachTooltip(i,t),Wt.isBrowser()&&(i.addEventListener("click",()=>this._zoomTo(t)),i.style.cursor="pointer"),this._ringsG.add(e),e}_animateArc(t,e,i,s,a,r,n){const o=t._el,l=this.cfg.borderRadius;if(o.attr({fill:t._color}),0===s)return o.attr({d:this._arcPath(i.iR,i.oR,i.a0,i.a1,l),opacity:a?0:1}),o.node.style.display=a?"none":"",void(t._cur=a?null:i);o.node.style.display="";const h=a?Number(o.attr("opacity"))||1:r?0:1,c=a?0:1;o.attr({opacity:h}),o.animate(s).during(s=>{if(this._zoomGen!==n)return;const a=Ds(e.a0,i.a0,s),r=Ds(e.a1,i.a1,s),d=Ds(e.iR,i.iR,s),u=Ds(e.oR,i.oR,s);o.attr({d:this._arcPath(d,u,a,r,l),opacity:Ds(h,c,s)}),t._cur={a0:a,a1:r,iR:d,oR:u}}).after(()=>{this._zoomGen===n&&(a?(o.node.style.display="none",t._cur=null):t._cur=i)})}_renderLabels(t){const e=this._labelsG;for(;e.node.firstChild;)e.node.removeChild(e.node.firstChild);this.cfg.dataLabels.show&&(this._nodesAll.forEach(t=>{t._show&&(t._a1-t._a0<this.cfg.dataLabels.minAngleToShow||this._renderCurvedLabel(t))}),t>0?(e.attr({opacity:0}),e.animate(250,t).attr({opacity:1})):e.attr({opacity:1}))}_renderCurvedLabel(t){if(!Wt.isBrowser())return;const e=this.cfg.dataLabels.style,i=this.w,s=(t._iR+t._oR)/2,a=(t._a0+t._a1)/2,r=a>90&&a<270,n=Math.min(s>0?4/s*Is:0,(t._a1-t._a0)/2),o=r?t._a1-n:t._a0+n,l=r?t._a0+n:t._a1-n,h=this._ptAt(s,o),c=this._ptAt(s,l),d=Math.abs(l-o)>180?1:0,u=r?0:1,p=`apx-sb-lbl-${i.globals.cuid}-${this._lblSeq++}`,g=ct.createElementNS(Es,"path");g.setAttribute("id",p),g.setAttribute("d",`M ${h.x} ${h.y} A ${s} ${s} 0 ${d} ${u} ${c.x} ${c.y}`),g.setAttribute("fill","none"),g.setAttribute("stroke","none");const f=e.colors,m=(Array.isArray(f)?f[0]:f)||"#fff",x=ct.createElementNS(Es,"text");x.setAttribute("font-size",e.fontSize||"12px"),e.fontFamily&&x.setAttribute("font-family",e.fontFamily),x.setAttribute("font-weight",String(e.fontWeight||400)),x.setAttribute("fill",m),x.setAttribute("dominant-baseline","central"),x.style.pointerEvents="none";const b=ct.createElementNS(Es,"textPath");b.setAttribute("href","#"+p),b.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href","#"+p),b.setAttribute("startOffset","50%"),b.setAttribute("text-anchor","middle"),b.textContent=this._truncate(t.name,s,t._a1-t._a0,e.fontSize),x.appendChild(b),this._labelsG.node.appendChild(g),this._labelsG.node.appendChild(x)}_truncate(t,e,i,s){const a=e*i*Ls-8,r=.58*(parseFloat(s)||12),n=Math.floor(a/r);return n>=t.length?t:n<=1?"":t.slice(0,Math.max(1,n-1))+"\u2026"}_zoomTo(t){if(!1===this.cfg.zoomOnClick)return;const e=t===this._focus?t._parent||null:t;e!==this._focus&&(this._focus=!e||e.children&&e.children.length?e:e._parent||null,this._relayout(this._focus),this._applyLayout("zoom"),this._renderBreadcrumb())}_focusChain(){const t=[];let e=this._focus;for(;e;)t.unshift(e),e=e._parent;return t}_renderBreadcrumb(){if(!Wt.isBrowser())return;const t=this.w.dom.elWrap;if(!t)return;const e=t.querySelector(".apexcharts-breadcrumb");if(e&&e.parentNode&&e.parentNode.removeChild(e),!this._focus)return;const i=ct.createElementNS(Rs,"nav");i.setAttribute("class","apexcharts-breadcrumb"),i.setAttribute("aria-label","Sunburst breadcrumb"),i.style.position="absolute",i.style.top="0px",i.style.left="0px";const s=[{name:"All",node:null}].concat(this._focusChain().map(t=>({name:t.name,node:t})));s.forEach((t,e)=>{if(e>0){const t=ct.createElementNS(Rs,"span");t.setAttribute("class","apexcharts-breadcrumb-separator"),t.textContent=" / ",i.appendChild(t)}if(e===s.length-1){const e=ct.createElementNS(Rs,"span");e.setAttribute("class","apexcharts-breadcrumb-item apexcharts-breadcrumb-current"),e.textContent=t.name,i.appendChild(e)}else{const s=ct.createElementNS(Rs,"button");if(s.setAttribute("type","button"),s.setAttribute("class","apexcharts-breadcrumb-item"),0===e){const t=ct.createElementNS(Rs,"span");t.setAttribute("class","apexcharts-breadcrumb-arrow"),t.textContent="\u2190",s.appendChild(t)}const a=ct.createElementNS(Rs,"span");a.setAttribute("class","apexcharts-breadcrumb-label"),a.textContent=t.name,s.appendChild(a),s.addEventListener("click",()=>{this._focus=t.node,this._relayout(this._focus),this._applyLayout("zoom"),this._renderBreadcrumb()}),i.appendChild(s)}}),t.appendChild(i),this._avoidChromeOverlap(i)}_avoidChromeOverlap(t){Me(this.w,t)}_ptAt(t,e){return{x:this.centerX+t*Math.cos((e-90)*Ls),y:this.centerY+t*Math.sin((e-90)*Ls)}}_arcPath(t,e,i,s,a){if(e<=t+.01)return"";let r=s-i;const n=this.cfg.spacing;if(n>0&&r>0&&e>0){const t=n/e*Is,a=Math.min(t/2,Math.max(0,r/2-.25));r=(s-=a)-(i+=a)}if(r<=0)return"";const o=r*Ls,l=this.centerX,h=this.centerY;let c=a;return c=Math.min(c,o*t/2,o*e/2,(e-t)/2),c>.5?Qi({cx:l,cy:h,rIn:t,rOut:e,a0:i,a1:s,r:c,spanDeg:r}):ts({cx:l,cy:h,rIn:t,rOut:e,a0:i,a1:s,spanDeg:r})}_tip(){return this._tooltipEl||(this._tooltipEl=this.w.dom.baseEl.querySelector(".apexcharts-tooltip")),this._tooltipEl}_attachTooltip(t,e){this.w.config.tooltip.enabled&&Wt.isBrowser()&&(t.addEventListener("mouseenter",t=>this._showTooltip(t,e)),t.addEventListener("mousemove",t=>this._positionTooltip(t)),t.addEventListener("mouseleave",()=>this._hideTooltip()))}_showTooltip(t,e){const i=this._tip();if(!i)return;const s=this.w,a=(e.value/this.total*100).toFixed(1),r=e._parent?e._parent.value:this.total,n=r>0?(e.value/r*100).toFixed(1):a,o=s.config.tooltip.fillSeriesColor?`background-color:${e._color};`:"";i.innerHTML=`<div class="apexcharts-tooltip-series-group apexcharts-active" style="display:flex;${o}"><span class="apexcharts-tooltip-marker" style="background-color:${e._color}"></span><div class="apexcharts-tooltip-text"><div class="apexcharts-tooltip-y-group"><span class="apexcharts-tooltip-text-y-label">${e.name}: </span><span class="apexcharts-tooltip-text-y-value">${e.value} (${n}% of parent, ${a}% of total)</span></div></div></div>`,i.classList.add("apexcharts-active"),i.style.opacity="1",this._positionTooltip(t)}_positionTooltip(t){const e=this._tip();if(!e)return;const i=this.w.dom.elWrap.getBoundingClientRect(),s=e.offsetWidth,a=e.offsetHeight;let r=t.clientX-i.left+12;r+s>i.width&&(r=t.clientX-i.left-s-12),r=Math.max(0,Math.min(r,i.width-s));let n=t.clientY-i.top+12;n+a>i.height&&(n=t.clientY-i.top-a-12),n=Math.max(0,Math.min(n,i.height-a)),e.style.left=r+"px",e.style.top=n+"px"}_hideTooltip(){const t=this._tip();t&&(t.classList.remove("apexcharts-active"),t.style.opacity="0")}_parseSize(t,e){if("number"==typeof t)return t;const i=String(t).trim();if(i.endsWith("%"))return parseFloat(i)/100*e;const s=parseFloat(i);return isNaN(s)?.15*e:s}_lighten(t,e){if("string"!=typeof t||"#"!==t[0])return t;let i=t.slice(1);if(3===i.length&&(i=i.split("").map(t=>t+t).join("")),6!==i.length)return t;const s=parseInt(i,16);if(isNaN(s))return t;let a=s>>16&255,r=s>>8&255,n=255&s;return a=Math.round(a+(255-a)*e),r=Math.round(r+(255-r)*e),n=Math.round(n+(255-n)*e),"#"+((1<<24)+(a<<16)+(r<<8)+n).toString(16).slice(1)}}}),Object.defineProperty(c.default,"__internals",{value:jt,enumerable:!1,writable:!1,configurable:!1}),Object.defineProperty(exports,"default",{enumerable:!0,get:()=>c.default});