apexcharts 6.2.0 → 6.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/apexcharts.common.js +2 -2
- package/dist/apexcharts.esm.js +611 -96
- package/dist/apexcharts.js +611 -96
- package/dist/apexcharts.min.js +2 -2
- package/dist/apexcharts.ssr.common.js +2 -2
- package/dist/apexcharts.ssr.esm.js +611 -96
- package/dist/area.common.js +2 -2
- package/dist/area.esm.js +2 -2
- package/dist/bar.common.js +1 -1
- package/dist/bar.esm.js +1 -1
- package/dist/boxPlot.common.js +1 -1
- package/dist/boxPlot.esm.js +1 -1
- package/dist/bubble.common.js +2 -2
- package/dist/bubble.esm.js +2 -2
- package/dist/candlestick.common.js +1 -1
- package/dist/candlestick.esm.js +1 -1
- package/dist/column.common.js +1 -1
- package/dist/column.esm.js +1 -1
- package/dist/core.common.js +2 -2
- package/dist/core.esm.js +578 -76
- package/dist/donut.common.js +1 -1
- package/dist/donut.esm.js +1 -1
- package/dist/features/all.common.js +2 -2
- package/dist/features/all.esm.js +33 -20
- package/dist/features/annotations.common.js +1 -1
- package/dist/features/annotations.esm.js +1 -1
- package/dist/features/context-menu.common.js +1 -1
- package/dist/features/context-menu.esm.js +1 -1
- package/dist/features/drilldown.common.js +1 -1
- package/dist/features/drilldown.esm.js +1 -1
- package/dist/features/exports.common.js +1 -1
- package/dist/features/exports.esm.js +1 -1
- package/dist/features/facet.common.js +1 -1
- package/dist/features/facet.esm.js +1 -1
- package/dist/features/history.common.js +1 -1
- package/dist/features/history.esm.js +1 -1
- package/dist/features/ink.common.js +1 -1
- package/dist/features/ink.esm.js +1 -1
- package/dist/features/keyboard.common.js +1 -1
- package/dist/features/keyboard.esm.js +1 -1
- package/dist/features/legend.common.js +1 -1
- package/dist/features/legend.esm.js +1 -1
- package/dist/features/link.common.js +1 -1
- package/dist/features/link.esm.js +1 -1
- package/dist/features/marks.common.js +1 -1
- package/dist/features/marks.esm.js +1 -1
- package/dist/features/measure.common.js +1 -1
- package/dist/features/measure.esm.js +1 -1
- package/dist/features/morph.common.js +1 -1
- package/dist/features/morph.esm.js +1 -1
- package/dist/features/perspectives.common.js +1 -1
- package/dist/features/perspectives.esm.js +1 -1
- package/dist/features/renderer-canvas.common.js +2 -2
- package/dist/features/renderer-canvas.esm.js +15 -1
- package/dist/features/storyboard.common.js +1 -1
- package/dist/features/storyboard.esm.js +1 -1
- package/dist/features/toolbar.common.js +2 -2
- package/dist/features/toolbar.esm.js +19 -20
- package/dist/features/weave.common.js +1 -1
- package/dist/features/weave.esm.js +1 -1
- package/dist/heatmap.common.js +1 -1
- package/dist/heatmap.esm.js +1 -1
- package/dist/line.common.js +2 -2
- package/dist/line.esm.js +2 -2
- package/dist/pie.common.js +1 -1
- package/dist/pie.esm.js +1 -1
- package/dist/polarArea.common.js +1 -1
- package/dist/polarArea.esm.js +1 -1
- package/dist/radar.common.js +1 -1
- package/dist/radar.esm.js +1 -1
- package/dist/radialBar.common.js +1 -1
- package/dist/radialBar.esm.js +1 -1
- package/dist/rangeArea.common.js +2 -2
- package/dist/rangeArea.esm.js +2 -2
- package/dist/rangeBar.common.js +1 -1
- package/dist/rangeBar.esm.js +1 -1
- package/dist/scatter.common.js +2 -2
- package/dist/scatter.esm.js +2 -2
- package/dist/treemap.common.js +1 -1
- package/dist/treemap.esm.js +1 -1
- package/dist/violin.common.js +1 -1
- package/dist/violin.esm.js +1 -1
- package/package.json +1 -1
- package/src/apexcharts.js +300 -33
- package/src/charts/Line.js +7 -5
- package/src/modules/Core.js +19 -0
- package/src/modules/Crosshairs.js +24 -5
- package/src/modules/Data.js +198 -14
- package/src/modules/Range.js +160 -32
- package/src/modules/Series.js +19 -0
- package/src/modules/ZoomPanSelection.js +16 -11
- package/src/modules/helpers/UpdateHelpers.js +16 -5
- package/src/modules/settings/Globals.js +50 -1
- package/src/modules/tooltip/AxesTooltip.js +7 -1
- package/src/modules/tooltip/Utils.js +5 -1
- package/src/renderers/canvas/CanvasRenderer.js +16 -0
- package/src/types/internal.d.ts +23 -0
package/dist/area.common.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* ApexCharts v6.
|
|
2
|
+
* ApexCharts v6.3.0
|
|
3
3
|
* (c) 2018-2026 ApexCharts
|
|
4
4
|
*/
|
|
5
|
-
"use strict";var e=Object.defineProperty,t=Object.defineProperties,s=Object.getOwnPropertyDescriptors,i=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable,a=(t,s,i)=>s in t?e(t,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[s]=i,l=(e,t)=>{for(var s in t||(t={}))r.call(t,s)&&a(e,s,t[s]);if(i)for(var s of i(t))n.call(t,s)&&a(e,s,t[s]);return e},o=(e,i)=>t(e,s(i));Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const h=require("apexcharts/core");function u(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e)for(const s in e)if("default"!==s){const i=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(t,s,i.get?i:{enumerable:!0,get:()=>e[s]})}return t.default=e,Object.freeze(t)}const c=u(h),p=c.__apex_CoreUtils,d=c.__apex_Graphics,g=c.__apex_Fill,f=c.__apex_DataLabels,m=c.__apex_Markers,x=c.__apex_charts_Scatter,y=c.__apex_Series,b=c.__apex_Utils;class v{constructor(e){this.w=e.w,this.lineCtx=e}sameValueSeriesFix(e,t){const s=this.w;if("gradient"===s.config.fill.type||"gradient"===s.config.fill.type[e]){if(new p(this.lineCtx.w).seriesHaveSameValues(e)){const s=t[e].slice();s[s.length-1]=s[s.length-1]+1e-6,t[e]=s}}return t}calculatePoints({series:e,realIndex:t,x:s,y:i,i:r,j:n,prevY:a}){const l=this.w,o=[],h=[];let u=this.lineCtx.categoryAxisCorrection+l.config.markers.offsetX;return l.axisFlags.isXNumeric&&(u=(l.seriesData.seriesX[t][0]-l.globals.minX)/this.lineCtx.xRatio+l.config.markers.offsetX),0===n&&(o.push(u),h.push(b.isNumber(e[r][0])?a+l.config.markers.offsetY:null)),o.push(s+l.config.markers.offsetX),h.push(b.isNumber(e[r][n+1])?i+l.config.markers.offsetY:null),{x:o,y:h}}checkPreviousPaths({pathFromLine:e,pathFromArea:t,realIndex:s}){const i=this.w;for(let r=0;r<i.globals.previousPaths.length;r++){const n=i.globals.previousPaths[r];("line"===n.type||"area"===n.type)&&n.paths.length>0&&parseInt(n.realIndex,10)===parseInt(s,10)&&("line"===n.type?(this.lineCtx.appendPathFrom=!1,e=i.globals.previousPaths[r].paths[0].d):"area"===n.type&&(this.lineCtx.appendPathFrom=!1,t=i.globals.previousPaths[r].paths[0].d,i.config.stroke.show&&i.globals.previousPaths[r].paths[1]&&(e=i.globals.previousPaths[r].paths[1].d)))}return{pathFromLine:e,pathFromArea:t}}determineFirstPrevY({i:e,realIndex:t,series:s,prevY:i,lineYPosition:r,translationsIndex:n}){var a,l,o;const h=this.w,u=h.config.chart.stacked&&!h.globals.comboCharts||h.config.chart.stacked&&h.globals.comboCharts&&(!this.w.config.chart.stackOnlyBar||"bar"===(null==(a=this.w.config.series[t])?void 0:a.type)||"column"===(null==(l=this.w.config.series[t])?void 0:l.type));if(void 0!==(null==(o=s[e])?void 0:o[0]))i=(r=u&&e>0?this.lineCtx.prevSeriesY[e-1][0]:this.lineCtx.zeroY)-s[e][0]/this.lineCtx.yRatio[n]+2*(this.lineCtx.isReversed?s[e][0]/this.lineCtx.yRatio[n]:0);else if(u&&e>0&&void 0===s[e][0])for(let t=e-1;t>=0;t--)if(null!==s[t][0]&&void 0!==s[t][0]){i=r=this.lineCtx.prevSeriesY[t][0];break}return{prevY:i,lineYPosition:r}}}function P(e){let t=(2654435769^e)>>>0;return t=Math.imul(t^t>>>16,73244475),t=Math.imul(t^t>>>16,73244475),((t^t>>>16)>>>0)/4294967296}const A=e=>{const t=function(e){const t=[];let s=e[0],i=e[1],r=t[0]=k(s,i),n=1;for(let a=e.length-1;n<a;n++)s=i,i=e[n+1],t[n]=.5*(r+(r=k(s,i)));return t[n]=r,t}(e),s=e.length-1,i=[];let r,n,a,l;for(let i=0;i<s;i++)a=k(e[i],e[i+1]),Math.abs(a)<1e-6?t[i]=t[i+1]=0:(r=t[i]/a,n=t[i+1]/a,l=r*r+n*n,l>9&&(l=3*a/Math.sqrt(l),t[i]=l*r,t[i+1]=l*n));for(let r=0;r<=s;r++)l=(e[Math.min(s,r+1)][0]-e[Math.max(0,r-1)][0])/(6*(1+t[r]*t[r])),i.push([l||0,t[r]*l||0]);return i},w={points(e){const t=A(e),s=e[1],i=e[0],r=[],n=t[1],a=t[0];r.push(i,[i[0]+a[0],i[1]+a[1],s[0]-n[0],s[1]-n[1],s[0],s[1]]);for(let s=2,i=t.length;s<i;s++){const i=e[s],n=t[s];r.push([i[0]-n[0],i[1]-n[1],i[0],i[1]])}return r},slice(e,t,s){const i=e.slice(t,s);if(t){if(s-t>1&&i[1].length<6){const e=i[0].length;i[1]=[2*i[0][e-2]-i[0][e-4],2*i[0][e-1]-i[0][e-3]].concat(i[1])}i[0]=i[0].slice(-2)}return i}};function k(e,t){return(t[1]-e[1])/(t[0]-e[0])}const Y=/[+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?/gi;function F(e,t){const{ax:s,bx:i,ay:r,by:n}=t,a=[],l=/([MmLlHhVvCcSsQqTtAaZz])([^MmLlHhVvCcSsQqTtAaZz]*)/g;let o;for(;null!==(o=l.exec(e));){const e=o[1].toUpperCase(),t=(o[2].match(Y)||[]).map(parseFloat);if("Z"===e){a.push("z");continue}if("H"===e){for(const e of t)a.push(`H ${s*e+i}`);continue}if("V"===e){for(const e of t)a.push(`V ${r*e+n}`);continue}if("A"===e){for(let e=0;e+6<t.length;e+=7)a.push(`A ${t[e]} ${t[e+1]} ${t[e+2]} ${t[e+3]} ${t[e+4]} ${s*t[e+5]+i} ${r*t[e+6]+n}`);continue}const l=[];for(let e=0;e+1<t.length;e+=2)l.push(`${s*t[e]+i} ${r*t[e+1]+n}`);l.length&&a.push(`${e} ${l.join(" ")}`)}return a.join(" ")}const M=c.__apex_BrowserAPIs_BrowserAPIs,S=c.__apex_Environment_Environment;function I(e){return-Math.cos(e*Math.PI)/2+.5}function C(e,t,s,i){e=Math.min(Math.max(e,0),1),s=Math.min(Math.max(s,0),1);const r=3*e,n=3*(s-e)-r,a=1-r-n,l=3*t,o=3*(i-t)-l,h=1-l-o,u=e=>((a*e+n)*e+r)*e,c=e=>(3*a*e+2*n)*e+r;return e=>e<=0?0:e>=1?1:(e=>((h*e+o)*e+l)*e)((e=>{let t=e;for(let s=0;s<5;s++){const s=c(t);if(0===s)break;t-=(u(t)-e)/s}let s=0,i=1;if(t=e,t<s)return s;if(t>i)return i;for(;s<i;){const r=u(t);if(Math.abs(r-e)<1e-4)return t;e>r?s=t:i=t,t=(s+i)/2}return t})(e))}const _=new Map;function j(e){return"function"==typeof e?e:(t=e,Array.isArray(t)&&4===t.length&&t.every(e=>"number"==typeof e)?C(e[0],e[1],e[2],e[3]):"string"==typeof e&&_.has(e)?_.get(e):I);var t}_.set("linear",e=>e),_.set("easeInOutSine",I),_.set("easeInSine",e=>1-Math.cos(e*Math.PI/2)),_.set("easeOutSine",e=>Math.sin(e*Math.PI/2)),_.set("easeInQuad",e=>e*e),_.set("easeOutQuad",e=>1-(1-e)*(1-e)),_.set("easeInOutQuad",e=>e<.5?2*e*e:1-Math.pow(-2*e+2,2)/2),_.set("easeInCubic",e=>e*e*e),_.set("easeOutCubic",e=>1-Math.pow(1-e,3)),_.set("easeInOutCubic",e=>e<.5?4*e*e*e:1-Math.pow(-2*e+2,3)/2),_.set("easeOutBack",e=>{const t=1.70158;return 1+2.70158*Math.pow(e-1,3)+t*Math.pow(e-1,2)}),_.set("easeInOutBack",e=>{const t=2.5949095;return e<.5?Math.pow(2*e,2)*(7.189819*e-t)/2:(Math.pow(2*e-2,2)*((t+1)*(2*e-2)+t)+2)/2});const L=c.__apex_PathMorphing_parsePath,R=c.__apex_PathMorphing_arrayToPath;function X(e,t,s){if(!e||"string"!=typeof e)return null;const i=L(e);if(!i.length||"M"!==i[0][0])return null;for(let e=1;e<i.length;e++)if("M"===i[e][0])return null;let r=i,n=null;if(s){if(i.length<5)return null;if(n=i.slice(-3),r=i.slice(0,-3),"Z"!==n[2][0])return null;if("L"!==n[1][0])return null;if("L"!==n[0][0]&&"C"!==n[0][0])return null}else if("Z"===i[i.length-1][0])return null;if(r.length!==t||r.length<2)return null;const a=r[1][0];if("L"!==a&&"C"!==a)return null;for(let e=2;e<r.length;e++)if(r[e][0]!==a)return null;const l=r.map(e=>"C"===e[0]?[Number(e[5]),Number(e[6])]:[Number(e[1]),Number(e[2])]);for(const e of l)if(!isFinite(e[0])||!isFinite(e[1]))return null;return{body:r,closing:n,segType:a,anchors:l}}function D(e,t,s){return[e[0]+(t[0]-e[0])*s,e[1]+(t[1]-e[1])*s]}function z(e,t,s){const i=e,r=[t[1],t[2]],n=[t[3],t[4]],a=[t[5],t[6]],l=D(i,r,s),o=D(r,n,s),h=D(n,a,s),u=D(l,o,s),c=D(o,h,s),p=D(u,c,s);return{first:["C",l[0],l[1],u[0],u[1],p[0],p[1]],second:["C",c[0],c[1],h[0],h[1],a[0],a[1]],mid:p}}function N(e,t,s){const i=[t[1],t[2]],r=D(e,i,s);return{first:["L",r[0],r[1]],second:["L",i[0],i[1]],mid:r}}function O(e,t){const{body:s,closing:i,segType:r,anchors:n}=e,a=n.length,l=t.length,o=e=>"C"===r?["C",e[0],e[1],e[0],e[1],e[0],e[1]]:["L",e[0],e[1]],h=[["M",n[0][0],n[0][1]]];let u=0;for(;u<l&&0!==t[u];)u++;for(let e=1;e<=u;e++)h.push(o(n[0]));let c=u+1;for(let e=0;e<a-1;e++){let i=0;for(;c+i<l&&-1===t[c+i];)i++;const a=s[e+1];if(i){const t=i+1;let s=n[e],l=a;for(let e=0;e<i;e++){const i=1/(t-e),n="C"===r?z(s,l,i):N(s,l,i);h.push(n.first),s=n.mid,l=n.second}h.push(l)}else h.push(a.slice());c+=i+1}for(;c<l;)h.push(o(n[a-1])),c++;return i&&i.forEach(e=>h.push(e.slice())),h}function $(e,t,s,i,r,n){const a=X(e,i,n);if(!a)return null;const l=X(t,r,n);if(!l)return null;if(a.segType!==l.segType)return null;if((a.closing||l.closing)&&(!a.closing||!l.closing||a.closing[0][0]!==l.closing[0][0]))return null;const o=s.map(e=>e.oldJ),h=s.map(e=>e.newJ);return{from:R(O(a,o)),toInterp:R(O(l,h))}}function W(e){const t=new Map;return e.map(e=>{const s=t.get(e)||0;return t.set(e,s+1),0===s?e:`${e}#${s}`})}function H(e,t,s=!1){var i,r;if(!function(e){var t;const s=e.config.chart.animations;if(!s||!1===s.enabled)return!1;if(!s.dynamicAnimation||!1===s.dynamicAnimation.enabled)return!1;const i=null!=(t=s.largeDatasetThreshold)?t:0;return!(i>0&&e.globals.dataPoints>i||!(S.isBrowser()&&e.globals.dataChanged&&e.globals.shouldAnimate))}(e))return null;const n=e.globals.prevStreamFrame;if(!n)return null;const a=null==(i=n.seriesY)?void 0:i[t],l=null==(r=e.seriesData.series)?void 0:r[t];if(!Array.isArray(a)||!Array.isArray(l))return null;if(!a.length||!l.length)return null;const o=W(a.map((e,s)=>function(e,t,s){var i,r;if(e.isXNumeric){const r=null==(i=e.seriesX)?void 0:i[t];if(r&&r.length&&null!=r[s])return"x:"+r[s]}const n=null==(r=e.labels)?void 0:r[s];return null!=n&&""!==String(n)?"c:"+(Array.isArray(n)?n.join(" "):String(n)):"j:"+s}(n,t,s))),h=W(l.map((s,i)=>function(e,t,s){var i,r,n,a;if(null==(i=e.axisFlags)?void 0:i.isXNumeric){const i=null==(n=null==(r=e.seriesData)?void 0:r.seriesX)?void 0:n[t];if(i&&i.length&&null!=i[s])return"x:"+i[s]}const l=null==(a=e.globals.labels)?void 0:a[s];return null!=l&&""!==String(l)?"c:"+(Array.isArray(l)?l.join(" "):String(l)):"j:"+s}(e,t,i))),u=function(e,t){const s=new Map;e.forEach((e,t)=>{s.has(e)||s.set(e,t)});const i=new Array(t.length),r=new Set;let n=-1,a=!0,l=e.length===t.length;t.forEach((e,t)=>{const o=s.has(e)&&!r.has(s.get(e))?s.get(e):-1;i[t]=o,-1!==o&&(r.add(o),o<n&&(a=!1),n=o),o!==t&&(l=!1)});const o=[];for(let t=0;t<e.length;t++)r.has(t)||o.push(t);return{toOld:i,exits:o,ordered:a,changed:!l}}(o,h);return u.ordered&&(u.changed||s)?{join:u,oldKeys:o,newKeys:h}:null}function B(e,t,s,i,r){const n=performance.now(),a=l=>{if(e.globals.isDestroyed)return;const o=Math.max(0,Math.min(1,(l-n)/t));i(s(o),o),o<1?M.requestAnimationFrame(a):r&&r()};M.requestAnimationFrame(a)}function T(e,{elPointsMain:t,realIndex:s,speed:i}){var r,n,a,l;if(!(null==t?void 0:t.node))return!1;const o=H(e,s,!0);if(!o)return!1;const h=e.globals.prevStreamFrame;if(!h)return!1;const u=null==(r=h.xPixels)?void 0:r[s],c=null==(n=h.yPixels)?void 0:n[s];if(!u||!c)return!1;const p=t.node.querySelectorAll(".apexcharts-marker");if(!p.length)return!1;const d=(null==(a=e.globals.seriesXvalues)?void 0:a[s])||[],g=(null==(l=e.globals.seriesYvalues)?void 0:l[s])||[],f=function(e){var t,s;const i=e.config.chart.animations;return j(null!=(s=null==(t=i.dynamicAnimation)?void 0:t.easing)?s:i.easing)}(e),m=Math.max(1,i||1);return t.node.classList.remove("apexcharts-element-hidden"),p.forEach(t=>{var i,r,n,a,l,p,x,y,b;const v=parseInt(null!=(r=null!=(i=t.getAttribute("j"))?i:t.getAttribute("rel"))?r:"",10);if(!isFinite(v)||v<0||v>=o.join.toOld.length)return;const P=o.join.toOld[v],A=null!=d[v]&&null!=g[v]?[d[v],g[v]]:null;if(-1===P||!A){const s=t.style;return s.opacity="0",void B(e,m,f,e=>{s.opacity=String(e)},()=>{s.opacity=""})}const w=(null!=(n=u[P])?n:NaN)-A[0],k=(null!=(a=c[P])?a:NaN)-A[1];if(!isFinite(w)||!isFinite(k))return;const Y=null!=(x=null==(p=null==(l=h.rPixels)?void 0:l[s])?void 0:p[P])?x:NaN,F=parseFloat(null!=(b=null!=(y=t.getAttribute("r"))?y:t.getAttribute("default-marker-size"))?b:""),M=isFinite(Y)&&isFinite(F)&&F>0&&Math.abs(Y-F)>.25;if(!(Math.abs(w)>=.5||Math.abs(k)>=.5)&&!M)return;const S=e=>{const s=w*(1-e),i=k*(1-e);if(M){const r=(Y+(F-Y)*e)/F;t.setAttribute("transform",`translate(${s+A[0]*(1-r)}, ${i+A[1]*(1-r)}) scale(${r})`)}else t.setAttribute("transform",`translate(${s}, ${i})`)};S(0),B(e,m,f,S,()=>{t.removeAttribute("transform")})}),!0}function V(e,{type:t,realIndex:s,pathFromLine:i,pathFromArea:r,linePaths:n,areaPaths:a}){var l,o;const h=H(e,s);if(!h)return null;const{join:u,oldKeys:c,newKeys:p}=h,d=e.globals.prevStreamFrame;if(!d)return null;const g=null==(l=d.seriesY)?void 0:l[s],f=null==(o=e.seriesData.series)?void 0:o[s];if(g.length<2||f.length<2)return null;if(g.some(e=>null===e)||f.some(e=>null===e))return null;const m=function(e,t){const s=new Set(e.exits),i=[];let r=0;for(let t=0;t<e.toOld.length;t++){const n=e.toOld[t];if(-1!==n){for(;r<n;)s.has(r)&&i.push({oldJ:r,newJ:-1}),r++;i.push({oldJ:n,newJ:t}),r=n+1}else i.push({oldJ:-1,newJ:t})}for(;r<t;)s.has(r)&&i.push({oldJ:r,newJ:-1}),r++;return i}(u,c.length),x={};return Array.isArray(n)&&1===n.length&&i&&(x.line=$(i,n[0],m,c.length,p.length,!1)),"area"===t&&Array.isArray(a)&&1===a.length&&r&&(x.area=$(r,a[0],m,c.length,p.length,!0)),x.line||x.area?x:null}class E{constructor(e,t,s,i){this.ctx=t,this.w=e,this.xyRatios=s,this.xRatio=0,this.yRatio=[],this.zRatio=0,this.baseLineY=[],this.pointsChart=!("bubble"!==this.w.config.chart.type&&"scatter"!==this.w.config.chart.type)||i,this.scatter=new x(this.w,this.ctx),this.noNegatives=this.w.globals.minX===Number.MAX_VALUE,this.lineHelpers=new v(this),this.markers=new m(this.w,this.ctx),this.prevSeriesY=[],this.categoryAxisCorrection=0,this.yaxisIndex=0,this.xDivision=0,this.zeroY=0,this.areaBottomY=0,this.strokeWidth=0,this.isReversed=!1,this.appendPathFrom=!1,this.elSeries=null,this.elPointsMain=null,this.elDataLabelsWrap=null,this._elLastPointsWrap=null}draw(e,t,s,i){var r;const n=this.w,a=new d(this.w),h=n.globals.comboCharts?t:n.config.chart.type,u=a.group({class:`apexcharts-${h}-series apexcharts-plot-series`}),c=new p(this.w);this.yRatio=this.xyRatios.yRatio,this.zRatio=this.xyRatios.zRatio,this.xRatio=this.xyRatios.xRatio,this.baseLineY=this.xyRatios.baseLineY,e=c.getLogSeries(e),this.yRatio=c.getLogYRatios(this.yRatio),this.prevSeriesY=[];const g=[];for(let t=0;t<e.length;t++){e=this.lineHelpers.sameValueSeriesFix(t,e);const r=n.globals.comboCharts?s[t]:t,a=this.yRatio.length>1?r:0;this._initSerieVariables(e,t,r);const u=[],c=[],p=[];let d=n.globals.padHorizontal+this.categoryAxisCorrection;const f=1,m=[],x=[];y.addCollapsedClassToSeries(this.w,this.elSeries,r),n.axisFlags.isXNumeric&&n.seriesData.seriesX.length>0&&(d=(n.seriesData.seriesX[r][0]-n.globals.minX)/this.xRatio),p.push(d);const b=d;let v;const P=b;let A=this.zeroY,w=this.zeroY;const k=0;A=this.lineHelpers.determineFirstPrevY({i:t,realIndex:r,series:e,prevY:A,lineYPosition:k,translationsIndex:a}).prevY,"monotoneCubic"===n.config.stroke.curve&&null===e[t][0]?u.push(null):u.push(A);const Y=A;let F;"rangeArea"===h&&(F=this.lineHelpers.determineFirstPrevY({i:t,realIndex:r,series:i,prevY:w,lineYPosition:k,translationsIndex:a}),w=F.prevY,v=w,c.push(null!==u[0]?w:null));const M=this._calculatePathsFrom({type:h,series:e,i:t,realIndex:r,translationsIndex:a,prevX:P,prevY:A,prevY2:w}),S=[u[0]],I=[c[0]],C={type:h,series:e,realIndex:r,translationsIndex:a,i:t,x:d,y:f,pX:b,pY:Y,pathsFrom:M,linePaths:m,areaPaths:x,seriesIndex:s,lineYPosition:k,xArrj:p,yArrj:u,y2Arrj:c,seriesRangeEnd:i},_=this._iterateOverDataPoints(o(l({},C),{iterations:"rangeArea"===h?e[t].length-1:void 0,isRangeStart:!0}));if("rangeArea"===h){const e=this._calculatePathsFrom({series:i,i:t,realIndex:r,prevX:P,prevY:w}),s=this._iterateOverDataPoints(o(l({},C),{series:i,xArrj:[d],yArrj:S,y2Arrj:I,pY:v,areaPaths:_.areaPaths,pathsFrom:e,iterations:i[t].length-1,isRangeStart:!1})),n=_.linePaths.length/2;for(let e=0;e<n;e++)_.linePaths[e]=s.linePaths[e+n]+_.linePaths[e];_.linePaths.splice(n),_.pathFromLine=s.pathFromLine+_.pathFromLine}else/z\s*$/i.test(_.pathFromArea)||(_.pathFromArea+="z");this._handlePaths({type:h,realIndex:r,i:t,paths:_}),this.elSeries.add(this.elPointsMain),this.elSeries.add(this.elDataLabelsWrap),g.push(this.elSeries)}if(void 0!==(null==(r=n.config.series[0])?void 0:r.zIndex)&&g.sort((e,t)=>Number(e.node.getAttribute("zIndex"))-Number(t.node.getAttribute("zIndex"))),n.config.chart.stacked)for(let e=g.length-1;e>=0;e--)u.add(g[e]);else for(let e=0;e<g.length;e++)u.add(g[e]);return u}_initSerieVariables(e,t,s){const i=this.w,r=new d(this.w);this.xDivision=i.layout.gridWidth/(i.globals.dataPoints-("on"===i.config.xaxis.tickPlacement?1:0)),this.strokeWidth=Array.isArray(i.config.stroke.width)?i.config.stroke.width[s]:i.config.stroke.width;let n=0;this.yRatio.length>1&&(this.yaxisIndex=i.globals.seriesYAxisReverseMap[s],n=s),this.isReversed=i.config.yaxis[this.yaxisIndex]&&i.config.yaxis[this.yaxisIndex].reversed,this.zeroY=i.layout.gridHeight-this.baseLineY[n]-(this.isReversed?i.layout.gridHeight:0)+(this.isReversed?2*this.baseLineY[n]:0),this.areaBottomY=this.zeroY,(this.zeroY>i.layout.gridHeight||"end"===i.config.plotOptions.area.fillTo)&&(this.areaBottomY=i.layout.gridHeight),this.categoryAxisCorrection=this.xDivision/2;const a=i.config.series[s];if(this.elSeries=r.group({class:"apexcharts-series",zIndex:void 0!==a.zIndex?a.zIndex:s,seriesName:b.escapeString(i.seriesData.seriesNames[s])}),this.elPointsMain=r.group({class:"apexcharts-series-markers-wrap","data:realIndex":s}),this.markers.resetSeriesWrapCache(),this._elLastPointsWrap=null,i.globals.hasNullValues){const e=this.markers.plotChartMarkers({pointsPos:{x:[0],y:[i.layout.gridHeight+i.globals.markers.largestSize]},seriesIndex:t,j:0,pSize:.1,alwaysDrawMarker:!0,isVirtualPoint:!0});null!==e&&this.elPointsMain.add(e)}this.elDataLabelsWrap=r.group({class:"apexcharts-datalabels","data:realIndex":s});const l=e[t].length===i.globals.dataPoints;this.elSeries.attr({"data:longestSeries":l,rel:t+1,"data:realIndex":s}),this.appendPathFrom=!0}_calculatePathsFrom({type:e,series:t,i:s,realIndex:i,translationsIndex:r,prevX:n,prevY:a,prevY2:l}){const o=this.w,h=new d(this.w);let u,c,p,g;if(null===t[s][0]){for(let e=0;e<t[s].length;e++)if(null!==t[s][e]){n=this.xDivision*e,a=this.zeroY-t[s][e]/this.yRatio[r],u=h.move(n,a),c=h.move(n,this.areaBottomY);break}}else u=h.move(n,a),"rangeArea"===e&&(u=h.move(n,l)+h.line(n,a)),c=h.move(n,this.areaBottomY)+h.line(n,a);if(p=h.move(0,this.areaBottomY)+h.line(0,this.areaBottomY),g=h.move(0,this.areaBottomY)+h.line(0,this.areaBottomY),o.globals.previousPaths.length>0){const e=this.lineHelpers.checkPreviousPaths({pathFromLine:p,pathFromArea:g,realIndex:i});p=e.pathFromLine,g=e.pathFromArea}return{prevX:n,prevY:a,linePath:u,areaPath:c,pathFromLine:p,pathFromArea:g}}_handlePaths({type:e,realIndex:t,i:s,paths:i}){var r,n,a,h,u,c,p;const f=this.w,m=new d(this.w),x=function(e,t){const s=e&&e.renderer;return s&&s.kind&&"svg"!==s.kind?s:t}(this.ctx,m),y=new g(this.w);this.prevSeriesY.push(i.yArrj);let b=null;"line"!==e&&"area"!==e||!f.globals.dataChanged||(b=function(e,t,s,i){var r;const n=e.globals,a=n.prevStreamFrame;if(!a||!n.dataChanged||!(null==(r=e.axisFlags)?void 0:r.isXNumeric))return null;const l=a.seriesX[t],o=a.seriesY[t],h=e.seriesData.seriesX[t],u=e.seriesData.series[t];if(!(l&&o&&h&&u))return null;if(l.length<3||h.length<3)return null;let c=-1;for(let e=0;e<l.length;e++)if(l[e]===h[0]){c=e;break}if(-1===c)return null;const p=Math.min(l.length-c,h.length);if(p<2)return null;const d=h.length-p;if(0===c&&0===d)return null;for(let e=0;e<p;e++){if(l[c+e]!==h[e])return null;const t=o[c+e],s=u[e];if(t!==s&&(null!=t||null!=s))return null}const g=a.xPixels[t],f=a.yPixels[t];if(!g||!f)return null;let m=-1,x=-1;for(let e=0;e<p;e++)null!=g[c+e]&&null!=f[c+e]&&null!=s[e]&&null!=i[e]&&(-1===m&&(m=e),x=e);if(-1===m||x<=m)return null;const y=s[m],b=s[x],v=g[c+m],P=g[c+x];if(Math.abs(b-y)<1e-6)return null;const A=(P-v)/(b-y),w=v-A*y;if(!isFinite(A)||!isFinite(w))return null;if(Math.abs(A-1)>.02)return null;if(Math.abs(w)<.5)return null;let k=m,Y=m;for(let e=m;e<=x;e++){const t=i[e];null!=t&&null!=f[c+e]&&(t<i[k]&&(k=e),t>i[Y]&&(Y=e))}let F=1,M=0;const S=i[k],I=i[Y];if(Math.abs(I-S)>1e-6?(F=(f[c+Y]-f[c+k])/(I-S),M=f[c+k]-F*S):M=f[c+k]-S,!isFinite(F)||!isFinite(M)||F<.2||F>5)return null;const C=Math.floor((m+x)/2);if(C!==m&&C!==x&&null!=s[C]&&null!=g[c+C]){const e=A*s[C]+w;if(Math.abs(e-g[c+C])>1.5)return null;if(null!=i[C]&&null!=f[c+C]){const e=F*i[C]+M;if(Math.abs(e-f[c+C])>1.5)return null}}return{ax:A,bx:w,ay:F,by:M}}(f,t,i.xArrj,i.yArrj));let v=null;b||"line"!==e&&"area"!==e||(v=V(f,{type:e,realIndex:t,pathFromLine:i.pathFromLine,pathFromArea:i.pathFromArea,linePaths:i.linePaths,areaPaths:i.areaPaths})),f.globals.seriesXvalues[t]=i.xArrj,f.globals.seriesYvalues[t]=i.yArrj;const P=f.config.forecastDataPoints;if(P.count>0&&"rangeArea"!==e){const e=f.globals.seriesXvalues[t][f.globals.seriesXvalues[t].length-P.count-1],s=m.drawRect(e,0,f.layout.gridWidth,f.layout.gridHeight,0);f.dom.elForecastMask.appendChild(s.node);const i=m.drawRect(0,0,e,f.layout.gridHeight,0);f.dom.elNonForecastMask.appendChild(i.node)}this.pointsChart?T(f,{elPointsMain:this.elPointsMain,realIndex:t,speed:f.config.chart.animations.dynamicAnimation.speed}):(f.globals.delayedElements.push({el:this.elPointsMain.node,index:t}),T(f,{elPointsMain:this.elPointsMain,realIndex:t,speed:f.config.chart.animations.dynamicAnimation.speed}),H(f,t)&&(null==(r=this.elDataLabelsWrap)?void 0:r.node)&&(this.elDataLabelsWrap.node.classList.add("apexcharts-element-hidden"),f.globals.delayedElements.push({el:this.elDataLabelsWrap.node,holdUntilComplete:!0})));const A={i:s,realIndex:t,animationDelay:s,initialSpeed:f.config.chart.animations.speed,dataChangeSpeed:f.config.chart.animations.dynamicAnimation.speed,className:`apexcharts-${e}`},w=i.numericXY;if("area"===e){const e=y.fillPath({seriesNumber:t});for(let t=0;t<i.areaPaths.length;t++){const s=x.renderPaths(o(l({},A),{pathFrom:b?F(i.areaPaths[t],b):null!=(a=null==(n=null==v?void 0:v.area)?void 0:n.from)?a:i.pathFromArea,pathTo:i.areaPaths[t],pathToNumeric:w?{xs:w.xs,ys:w.ys,closeY:w.areaCloseY}:void 0,pathToInterp:null==(h=null==v?void 0:v.area)?void 0:h.toInterp,scrollMorph:!!b,stroke:"none",strokeWidth:0,strokeLineCap:null,fill:e}));this.elSeries.add(s)}}if(f.config.stroke.show&&!this.pointsChart){let r=null;if("line"===e)r=y.fillPath({seriesNumber:t,i:s});else if("solid"===f.config.stroke.fill.type)r=f.globals.stroke.colors[t];else{const e=f.config.fill;f.config.fill=f.config.stroke.fill,r=y.fillPath({seriesNumber:t,i:s}),f.config.fill=e}for(let s=0;s<i.linePaths.length;s++){let n=r;"rangeArea"===e&&(n=y.fillPath({seriesNumber:t}));const a=o(l({},A),{pathFrom:b?F(i.linePaths[s],b):null!=(c=null==(u=null==v?void 0:v.line)?void 0:u.from)?c:i.pathFromLine,pathTo:i.linePaths[s],pathToNumeric:w?{xs:w.xs,ys:w.ys}:void 0,pathToInterp:null==(p=null==v?void 0:v.line)?void 0:p.toInterp,scrollMorph:!!b,stroke:r,strokeWidth:this.strokeWidth,strokeLineCap:f.config.stroke.lineCap,fill:"rangeArea"===e?n:"none"}),h=x.renderPaths(a);if(this.elSeries.add(h),h.attr("fill-rule","evenodd"),P.count>0&&"rangeArea"!==e){const e=x.renderPaths(a);e.node.setAttribute("stroke-dasharray",P.dashArray),P.strokeWidth&&e.node.setAttribute("stroke-width",P.strokeWidth),this.elSeries.add(e),e.attr("clip-path",`url(#forecastMask${f.globals.cuid})`),h.attr("clip-path",`url(#nonForecastMask${f.globals.cuid})`)}}}}_iterateOverDataPoints({type:e,series:t,iterations:s,realIndex:i,translationsIndex:r,i:n,x:a,y:l,pX:o,pY:h,pathsFrom:u,linePaths:c,areaPaths:p,seriesIndex:g,lineYPosition:f,xArrj:m,yArrj:x,y2Arrj:y,isRangeStart:v,seriesRangeEnd:A}){var w,k;const Y=this.w,F=new d(this.w),M=this.yRatio;let{prevY:S,linePath:I,areaPath:C,pathFromLine:_,pathFromArea:j}=u;const L=b.isNumber(Y.globals.minYArr[i])?Y.globals.minYArr[i]:Y.globals.minY;s||(s=Y.globals.dataPoints>1?Y.globals.dataPoints-1:Y.globals.dataPoints);const R=(e,t)=>t-e/M[r]+2*(this.isReversed?e/M[r]:0);let X=l;const D=Y.config.chart.stacked&&!Y.globals.comboCharts||Y.config.chart.stacked&&Y.globals.comboCharts&&(!this.w.config.chart.stackOnlyBar||"bar"===(null==(w=this.w.config.series[i])?void 0:w.type)||"column"===(null==(k=this.w.config.series[i])?void 0:k.type));let z=Y.config.stroke.curve;Array.isArray(z)&&(z=Array.isArray(g)?z[g[n]]:z[n]);let N,O=0;const $=this.pointsChart?this._scatterJitterPx(i):null;if("straight"===z&&!this.pointsChart){const d=this._fastStraightPath({type:e,series:t,i:n,realIndex:i,translationsIndex:r,iterations:s,x:a,y:l,pX:o,pY:h,pathsFrom:u,linePaths:c,areaPaths:p,xArrj:m,yArrj:x,y2Arrj:y,stackSeries:D});if(d)return d}for(let r=0;r<s&&0!==t[n].length;r++){const u=void 0===t[n][r+1]||null===t[n][r+1];if(Y.axisFlags.isXNumeric){let e=Y.seriesData.seriesX[i][r+1];void 0===Y.seriesData.seriesX[i][r+1]&&(e=Y.seriesData.seriesX[i][s-1]),a=(e-Y.globals.minX)/this.xRatio}else a+=this.xDivision;if(D)if(n>0&&Y.globals.collapsedSeries.length<Y.config.series.length-1){const e=e=>{for(let t=e;t>0;t--){if(!(Y.globals.collapsedSeriesIndices.indexOf((null==g?void 0:g[t])||t)>-1))return t;t--}return 0};f=this.prevSeriesY[e(n-1)][r+1]}else f=this.zeroY;else f=this.zeroY;u?l=R(L,f):(l=R(t[n][r+1],f),"rangeArea"===e&&(X=R(A[n][r+1],f)));let d=a,b=l;if($){const e=100003*i+(r+1);$.x&&(d=a+2*(P(7919*e+13)-.5)*$.x),$.y&&(b=l+2*(P(6271*e+97)-.5)*$.y)}m.push(null===t[n][r+1]?null:d),!u||"smooth"!==Y.config.stroke.curve&&"monotoneCubic"!==Y.config.stroke.curve?(x.push(b),y.push(X)):(x.push(null),y.push(null));const w=this.lineHelpers.calculatePoints({series:t,x:d,y:b,realIndex:i,i:n,j:r,prevY:S}),k=this._createPaths({type:e,series:t,i:n,j:r,x:a,y:l,y2:X,xArrj:m,yArrj:x,y2Arrj:y,pX:o,pY:h,pathState:O,segmentStartX:N,linePath:I,areaPath:C,linePaths:c,areaPaths:p,curve:z,isRangeStart:v});p=k.areaPaths,c=k.linePaths,o=k.pX,h=k.pY,O=k.pathState,N=k.segmentStartX,C=k.areaPath,I=k.linePath,!this.appendPathFrom||Y.globals.hasNullValues||"monotoneCubic"===z&&"rangeArea"===e||(_+=F.line(a,this.areaBottomY),j+=F.line(a,this.areaBottomY)),this.handleNullDataPoints(t,w,n,r,i),this._handleMarkersAndLabels({type:e,pointsPos:w,i:n,j:r,realIndex:i,isRangeStart:v})}return{yArrj:x,xArrj:m,pathFromArea:j,areaPaths:p,pathFromLine:_,linePaths:c,linePath:I,areaPath:C}}_handleMarkersAndLabels({type:e,pointsPos:t,isRangeStart:s,i:i,j:r,realIndex:n}){const a=this.w,l=new f(this.w,this.ctx);if(this.pointsChart)this.scatter.draw(this.elSeries,r,{realIndex:n,pointsPos:t,zRatio:this.zRatio,elParent:this.elPointsMain});else{!(!a.globals.dataChanged&&!a.globals.resized)&&a.seriesData.series[i].length>1&&this.elPointsMain.node.classList.add("apexcharts-element-hidden");const e=this.markers.plotChartMarkers({pointsPos:t,seriesIndex:n,j:r+1});null!==e&&e!==this._elLastPointsWrap&&(this.elPointsMain.add(e),this._elLastPointsWrap=e)}const o=l.drawDataLabel({type:e,isRangeStart:s,pos:t,i:n,j:r+1});null!==o&&this.elDataLabelsWrap.add(o)}_scatterJitterPx(e){var t;const s=this.w,i=null==(t=s.config.plotOptions.scatter)?void 0:t.jitter;if(!i||!i.enabled||!i.x&&!i.y)return null;const r=s.axisFlags.isXNumeric&&this.xRatio?1/this.xRatio:this.xDivision,n=this.yRatio.length>1?e:0,a=this.yRatio[n]?1/this.yRatio[n]:0;return{x:(i.x||0)*r,y:(i.y||0)*a}}_fastStraightPath({type:e,series:t,i:s,realIndex:i,translationsIndex:r,iterations:n,x:a,y:l,pX:o,pY:h,pathsFrom:u,linePaths:c,areaPaths:p,xArrj:d,yArrj:g,y2Arrj:f,stackSeries:m}){const x=this.w;if("line"!==e&&"area"!==e)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[i]>0)return null;const y=t[s],b=y.length;if(!n||b<2||b-1!==n)return null;for(let e=0;e<=n;e++){const t=y[e];if(null==t)return null}const v=x.axisFlags.isXNumeric,P=v?x.seriesData.seriesX[i]:null;if(v&&(!P||P.length<b))return null;const A=this.yRatio[r],w=this.isReversed,k=this.zeroY,Y=this.areaBottomY,F=this.xRatio,M=x.globals.minX,S=this.xDivision,I=x.config.markers.offsetX,C=x.config.markers.offsetY,_=this.appendPathFrom&&!x.globals.hasNullValues;let{pathFromLine:j,pathFromArea:L}=u;const R=this.ctx&&this.ctx.renderer,X=!(!R||!R.kind||"svg"===R.kind),D=!X||x.globals.dataChanged,z=X?new Float64Array(b):null,N=X?new Float64Array(b):null;z&&N&&(z[0]=o,N[0]=h),void 0===x.globals.pointsArray[i]&&(x.globals.pointsArray[i]=[]);const O=x.globals.pointsArray[i],$=P?(P[0]-M)/F+I:this.categoryAxisCorrection+I;O.push([$,u.prevY+C]);const W=D?new Array(n+1):[];D&&(W[0]="M "+o+" "+h);const H=D&&_?new Array(n):null;let B=a,T=o,V=h;for(let e=0;e<n;e++){P?T=(P[e+1]-M)/F:(B+=S,T=B);const t=y[e+1];V=k-t/A+2*(w?t/A:0),d.push(T),g.push(V),f.push(l),O.push([T+I,V+C]),D&&(W[e+1]=" L "+T+" "+V,H&&(H[e]=" L "+T+" "+Y)),z&&N&&(z[e+1]=T,N[e+1]=V)}let E="",J="";if(D&&(E=W.join(""),J=E+" L "+T+" "+Y+" L "+o+" "+Y+"z"),H){const e=H.join("");j+=e,L+=e}else!D&&_&&(j+=" L "+T+" "+Y,L+=" L "+T+" "+Y);return c.push(E),p.push(J),{yArrj:g,xArrj:d,pathFromArea:L,areaPaths:p,pathFromLine:j,linePaths:c,linePath:E,areaPath:J,numericXY:z?{xs:z,ys:N,areaCloseY:Y}:void 0}}_createPaths({type:e,series:t,i:s,j:i,x:r,y:n,xArrj:a,yArrj:l,y2:o,y2Arrj:h,pX:u,pY:c,pathState:p,segmentStartX:g,linePath:f,areaPath:m,linePaths:x,areaPaths:y,curve:b,isRangeStart:v}){const P=new d(this.w),A=this.areaBottomY,k="rangeArea"===e,Y="rangeArea"===e&&v;switch(b){case"monotoneCubic":{const e=v?l:h,r=(e,t)=>e.map((e,s)=>[e,t[s]]).filter(e=>null!==e[1]),n=e=>{const t=[];let s=0;return e.forEach(e=>{null!==e?s++:s>0&&(t.push(s),s=0)}),s>0&&t.push(s),t},o=(e,t)=>{const s=n(e),i=[];for(let e=0,r=0;e<s.length;r+=s[e++])i[e]=w.slice(t,r,r+s[e]);return i};switch(p){case 0:if(null===e[i+1])break;p=1;case 1:if(!(k?a.length===t[s].length:i===t[s].length-2))break;case 2:{const t=v?a:a.slice().reverse(),s=v?e:e.slice().reverse(),i=r(t,s),n=i.length>1?w.points(i):i;let l=[];k&&(Y?y=i:l=y.reverse());let h=0,u=0;if(o(s,n).forEach(e=>{h++;const t=(e=>{let t="";for(let s=0;s<e.length;s++){const i=e[s],r=i.length;r>4?(t+=`C${i[0]}, ${i[1]}`,t+=`, ${i[2]}, ${i[3]}`,t+=`, ${i[4]}, ${i[5]}`):r>2&&(t+=`S${i[0]}, ${i[1]}`,t+=`, ${i[2]}, ${i[3]}`)}return t})(e),s=u;u+=e.length;const r=u-1;Y?f=P.move(i[s][0],i[s][1])+t:k?f=P.move(l[s][0],l[s][1])+P.line(i[s][0],i[s][1])+t+P.line(l[r][0],l[r][1]):(f=P.move(i[s][0],i[s][1])+t,m=f+P.line(i[r][0],A)+P.line(i[s][0],A)+"z",y.push(m)),x.push(f)}),k&&h>1&&!Y){const e=x.slice(h).reverse();x.splice(h),e.forEach(e=>x.push(e))}p=0;break}}break}case"smooth":{const e=.35*(r-u);if(null===t[s][i])p=0;else switch(p){case 0:if(g=u,f=Y?P.move(u,h[i])+P.line(u,c):P.move(u,c),m=P.move(u,c),null===t[s][i+1]||void 0===t[s][i+1]){x.push(f),y.push(m);break}if(p=1,i<t[s].length-2){const t=P.curve(u+e,c,r-e,n,r,n);f+=t,m+=t;break}case 1:if(null===t[s][i+1])f+=Y?P.line(u,o):P.move(u,c),m+=P.line(u,A)+P.line(g,A)+"z",x.push(f),y.push(m),p=-1;else{const a=P.curve(u+e,c,r-e,n,r,n);f+=a,m+=a,i>=t[s].length-2&&(Y&&(f+=P.curve(r,n,r,n,r,o)+P.move(r,o)),m+=P.curve(r,n,r,n,r,A)+P.line(g,A)+"z",x.push(f),y.push(m),p=-1)}}u=r,c=n;break}default:{const e=(e,t,s)=>{let i="";switch(e){case"stepline":i=P.line(t,null,"H")+P.line(null,s,"V");break;case"linestep":i=P.line(null,s,"V")+P.line(t,null,"H");break;case"straight":i=P.line(t,s)}return i};if(null===t[s][i])p=0;else switch(p){case 0:if(g=u,f=Y?P.move(u,h[i])+P.line(u,c):P.move(u,c),m=P.move(u,c),null===t[s][i+1]||void 0===t[s][i+1]){x.push(f),y.push(m);break}if(p=1,i<t[s].length-2){const t=e(b,r,n);f+=t,m+=t;break}case 1:if(null===t[s][i+1])f+=Y?P.line(u,o):P.move(u,c),m+=P.line(u,A)+P.line(g,A)+"z",x.push(f),y.push(m),p=-1;else{const a=e(b,r,n);f+=a,m+=a,i>=t[s].length-2&&(Y&&(f+=P.line(r,o)),m+=P.line(r,A)+P.line(g,A)+"z",x.push(f),y.push(m),p=-1)}}u=r,c=n;break}}return{linePaths:x,areaPaths:y,pX:u,pY:c,pathState:p,segmentStartX:g,linePath:f,areaPath:m}}handleNullDataPoints(e,t,s,i,r){const n=this.w;if(null===e[s][i]&&n.config.markers.showNullDataPoints||1===e[s].length){let e=this.strokeWidth-n.config.markers.strokeWidth/2;e>0||(e=0);const s=this.markers.plotChartMarkers({pointsPos:t,seriesIndex:r,j:i+1,pSize:e,alwaysDrawMarker:!0});null!==s&&this.elPointsMain.add(s)}}}h.use({line:E,area:E,scatter:E,bubble:E,rangeArea:E}),exports.default=h;
|
|
5
|
+
"use strict";var e=Object.defineProperty,t=Object.defineProperties,s=Object.getOwnPropertyDescriptors,i=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable,a=(t,s,i)=>s in t?e(t,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[s]=i,l=(e,t)=>{for(var s in t||(t={}))r.call(t,s)&&a(e,s,t[s]);if(i)for(var s of i(t))n.call(t,s)&&a(e,s,t[s]);return e},o=(e,i)=>t(e,s(i));Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const h=require("apexcharts/core");function u(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e)for(const s in e)if("default"!==s){const i=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(t,s,i.get?i:{enumerable:!0,get:()=>e[s]})}return t.default=e,Object.freeze(t)}const c=u(h),p=c.__apex_CoreUtils,d=c.__apex_Graphics,g=c.__apex_Fill,f=c.__apex_DataLabels,m=c.__apex_Markers,x=c.__apex_charts_Scatter,y=c.__apex_Series,b=c.__apex_Utils;class v{constructor(e){this.w=e.w,this.lineCtx=e}sameValueSeriesFix(e,t){const s=this.w;if("gradient"===s.config.fill.type||"gradient"===s.config.fill.type[e]){if(new p(this.lineCtx.w).seriesHaveSameValues(e)){const s=t[e].slice();s[s.length-1]=s[s.length-1]+1e-6,t[e]=s}}return t}calculatePoints({series:e,realIndex:t,x:s,y:i,i:r,j:n,prevY:a}){const l=this.w,o=[],h=[];let u=this.lineCtx.categoryAxisCorrection+l.config.markers.offsetX;return l.axisFlags.isXNumeric&&(u=(l.seriesData.seriesX[t][0]-l.globals.minX)/this.lineCtx.xRatio+l.config.markers.offsetX),0===n&&(o.push(u),h.push(b.isNumber(e[r][0])?a+l.config.markers.offsetY:null)),o.push(s+l.config.markers.offsetX),h.push(b.isNumber(e[r][n+1])?i+l.config.markers.offsetY:null),{x:o,y:h}}checkPreviousPaths({pathFromLine:e,pathFromArea:t,realIndex:s}){const i=this.w;for(let r=0;r<i.globals.previousPaths.length;r++){const n=i.globals.previousPaths[r];("line"===n.type||"area"===n.type)&&n.paths.length>0&&parseInt(n.realIndex,10)===parseInt(s,10)&&("line"===n.type?(this.lineCtx.appendPathFrom=!1,e=i.globals.previousPaths[r].paths[0].d):"area"===n.type&&(this.lineCtx.appendPathFrom=!1,t=i.globals.previousPaths[r].paths[0].d,i.config.stroke.show&&i.globals.previousPaths[r].paths[1]&&(e=i.globals.previousPaths[r].paths[1].d)))}return{pathFromLine:e,pathFromArea:t}}determineFirstPrevY({i:e,realIndex:t,series:s,prevY:i,lineYPosition:r,translationsIndex:n}){var a,l,o;const h=this.w,u=h.config.chart.stacked&&!h.globals.comboCharts||h.config.chart.stacked&&h.globals.comboCharts&&(!this.w.config.chart.stackOnlyBar||"bar"===(null==(a=this.w.config.series[t])?void 0:a.type)||"column"===(null==(l=this.w.config.series[t])?void 0:l.type));if(void 0!==(null==(o=s[e])?void 0:o[0]))i=(r=u&&e>0?this.lineCtx.prevSeriesY[e-1][0]:this.lineCtx.zeroY)-s[e][0]/this.lineCtx.yRatio[n]+2*(this.lineCtx.isReversed?s[e][0]/this.lineCtx.yRatio[n]:0);else if(u&&e>0&&void 0===s[e][0])for(let t=e-1;t>=0;t--)if(null!==s[t][0]&&void 0!==s[t][0]){i=r=this.lineCtx.prevSeriesY[t][0];break}return{prevY:i,lineYPosition:r}}}function P(e){let t=(2654435769^e)>>>0;return t=Math.imul(t^t>>>16,73244475),t=Math.imul(t^t>>>16,73244475),((t^t>>>16)>>>0)/4294967296}const A=e=>{const t=function(e){const t=[];let s=e[0],i=e[1],r=t[0]=k(s,i),n=1;for(let a=e.length-1;n<a;n++)s=i,i=e[n+1],t[n]=.5*(r+(r=k(s,i)));return t[n]=r,t}(e),s=e.length-1,i=[];let r,n,a,l;for(let i=0;i<s;i++)a=k(e[i],e[i+1]),Math.abs(a)<1e-6?t[i]=t[i+1]=0:(r=t[i]/a,n=t[i+1]/a,l=r*r+n*n,l>9&&(l=3*a/Math.sqrt(l),t[i]=l*r,t[i+1]=l*n));for(let r=0;r<=s;r++)l=(e[Math.min(s,r+1)][0]-e[Math.max(0,r-1)][0])/(6*(1+t[r]*t[r])),i.push([l||0,t[r]*l||0]);return i},w={points(e){const t=A(e),s=e[1],i=e[0],r=[],n=t[1],a=t[0];r.push(i,[i[0]+a[0],i[1]+a[1],s[0]-n[0],s[1]-n[1],s[0],s[1]]);for(let s=2,i=t.length;s<i;s++){const i=e[s],n=t[s];r.push([i[0]-n[0],i[1]-n[1],i[0],i[1]])}return r},slice(e,t,s){const i=e.slice(t,s);if(t){if(s-t>1&&i[1].length<6){const e=i[0].length;i[1]=[2*i[0][e-2]-i[0][e-4],2*i[0][e-1]-i[0][e-3]].concat(i[1])}i[0]=i[0].slice(-2)}return i}};function k(e,t){return(t[1]-e[1])/(t[0]-e[0])}const Y=/[+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?/gi;function F(e,t){const{ax:s,bx:i,ay:r,by:n}=t,a=[],l=/([MmLlHhVvCcSsQqTtAaZz])([^MmLlHhVvCcSsQqTtAaZz]*)/g;let o;for(;null!==(o=l.exec(e));){const e=o[1].toUpperCase(),t=(o[2].match(Y)||[]).map(parseFloat);if("Z"===e){a.push("z");continue}if("H"===e){for(const e of t)a.push(`H ${s*e+i}`);continue}if("V"===e){for(const e of t)a.push(`V ${r*e+n}`);continue}if("A"===e){for(let e=0;e+6<t.length;e+=7)a.push(`A ${t[e]} ${t[e+1]} ${t[e+2]} ${t[e+3]} ${t[e+4]} ${s*t[e+5]+i} ${r*t[e+6]+n}`);continue}const l=[];for(let e=0;e+1<t.length;e+=2)l.push(`${s*t[e]+i} ${r*t[e+1]+n}`);l.length&&a.push(`${e} ${l.join(" ")}`)}return a.join(" ")}const M=c.__apex_BrowserAPIs_BrowserAPIs,S=c.__apex_Environment_Environment;function I(e){return-Math.cos(e*Math.PI)/2+.5}function C(e,t,s,i){e=Math.min(Math.max(e,0),1),s=Math.min(Math.max(s,0),1);const r=3*e,n=3*(s-e)-r,a=1-r-n,l=3*t,o=3*(i-t)-l,h=1-l-o,u=e=>((a*e+n)*e+r)*e,c=e=>(3*a*e+2*n)*e+r;return e=>e<=0?0:e>=1?1:(e=>((h*e+o)*e+l)*e)((e=>{let t=e;for(let s=0;s<5;s++){const s=c(t);if(0===s)break;t-=(u(t)-e)/s}let s=0,i=1;if(t=e,t<s)return s;if(t>i)return i;for(;s<i;){const r=u(t);if(Math.abs(r-e)<1e-4)return t;e>r?s=t:i=t,t=(s+i)/2}return t})(e))}const _=new Map;function j(e){return"function"==typeof e?e:(t=e,Array.isArray(t)&&4===t.length&&t.every(e=>"number"==typeof e)?C(e[0],e[1],e[2],e[3]):"string"==typeof e&&_.has(e)?_.get(e):I);var t}_.set("linear",e=>e),_.set("easeInOutSine",I),_.set("easeInSine",e=>1-Math.cos(e*Math.PI/2)),_.set("easeOutSine",e=>Math.sin(e*Math.PI/2)),_.set("easeInQuad",e=>e*e),_.set("easeOutQuad",e=>1-(1-e)*(1-e)),_.set("easeInOutQuad",e=>e<.5?2*e*e:1-Math.pow(-2*e+2,2)/2),_.set("easeInCubic",e=>e*e*e),_.set("easeOutCubic",e=>1-Math.pow(1-e,3)),_.set("easeInOutCubic",e=>e<.5?4*e*e*e:1-Math.pow(-2*e+2,3)/2),_.set("easeOutBack",e=>{const t=1.70158;return 1+2.70158*Math.pow(e-1,3)+t*Math.pow(e-1,2)}),_.set("easeInOutBack",e=>{const t=2.5949095;return e<.5?Math.pow(2*e,2)*(7.189819*e-t)/2:(Math.pow(2*e-2,2)*((t+1)*(2*e-2)+t)+2)/2});const L=c.__apex_PathMorphing_parsePath,R=c.__apex_PathMorphing_arrayToPath;function X(e,t,s){if(!e||"string"!=typeof e)return null;const i=L(e);if(!i.length||"M"!==i[0][0])return null;for(let e=1;e<i.length;e++)if("M"===i[e][0])return null;let r=i,n=null;if(s){if(i.length<5)return null;if(n=i.slice(-3),r=i.slice(0,-3),"Z"!==n[2][0])return null;if("L"!==n[1][0])return null;if("L"!==n[0][0]&&"C"!==n[0][0])return null}else if("Z"===i[i.length-1][0])return null;if(r.length!==t||r.length<2)return null;const a=r[1][0];if("L"!==a&&"C"!==a)return null;for(let e=2;e<r.length;e++)if(r[e][0]!==a)return null;const l=r.map(e=>"C"===e[0]?[Number(e[5]),Number(e[6])]:[Number(e[1]),Number(e[2])]);for(const e of l)if(!isFinite(e[0])||!isFinite(e[1]))return null;return{body:r,closing:n,segType:a,anchors:l}}function D(e,t,s){return[e[0]+(t[0]-e[0])*s,e[1]+(t[1]-e[1])*s]}function z(e,t,s){const i=e,r=[t[1],t[2]],n=[t[3],t[4]],a=[t[5],t[6]],l=D(i,r,s),o=D(r,n,s),h=D(n,a,s),u=D(l,o,s),c=D(o,h,s),p=D(u,c,s);return{first:["C",l[0],l[1],u[0],u[1],p[0],p[1]],second:["C",c[0],c[1],h[0],h[1],a[0],a[1]],mid:p}}function N(e,t,s){const i=[t[1],t[2]],r=D(e,i,s);return{first:["L",r[0],r[1]],second:["L",i[0],i[1]],mid:r}}function O(e,t){const{body:s,closing:i,segType:r,anchors:n}=e,a=n.length,l=t.length,o=e=>"C"===r?["C",e[0],e[1],e[0],e[1],e[0],e[1]]:["L",e[0],e[1]],h=[["M",n[0][0],n[0][1]]];let u=0;for(;u<l&&0!==t[u];)u++;for(let e=1;e<=u;e++)h.push(o(n[0]));let c=u+1;for(let e=0;e<a-1;e++){let i=0;for(;c+i<l&&-1===t[c+i];)i++;const a=s[e+1];if(i){const t=i+1;let s=n[e],l=a;for(let e=0;e<i;e++){const i=1/(t-e),n="C"===r?z(s,l,i):N(s,l,i);h.push(n.first),s=n.mid,l=n.second}h.push(l)}else h.push(a.slice());c+=i+1}for(;c<l;)h.push(o(n[a-1])),c++;return i&&i.forEach(e=>h.push(e.slice())),h}function $(e,t,s,i,r,n){const a=X(e,i,n);if(!a)return null;const l=X(t,r,n);if(!l)return null;if(a.segType!==l.segType)return null;if((a.closing||l.closing)&&(!a.closing||!l.closing||a.closing[0][0]!==l.closing[0][0]))return null;const o=s.map(e=>e.oldJ),h=s.map(e=>e.newJ);return{from:R(O(a,o)),toInterp:R(O(l,h))}}function W(e){const t=new Map;return e.map(e=>{const s=t.get(e)||0;return t.set(e,s+1),0===s?e:`${e}#${s}`})}function H(e,t,s=!1){var i,r;if(!function(e){var t;const s=e.config.chart.animations;if(!s||!1===s.enabled)return!1;if(!s.dynamicAnimation||!1===s.dynamicAnimation.enabled)return!1;const i=null!=(t=s.largeDatasetThreshold)?t:0;return!(i>0&&e.globals.dataPoints>i||!(S.isBrowser()&&e.globals.dataChanged&&e.globals.shouldAnimate))}(e))return null;const n=e.globals.prevStreamFrame;if(!n)return null;const a=null==(i=n.seriesY)?void 0:i[t],l=null==(r=e.seriesData.series)?void 0:r[t];if(!Array.isArray(a)||!Array.isArray(l))return null;if(!a.length||!l.length)return null;const o=W(a.map((e,s)=>function(e,t,s){var i,r;if(e.isXNumeric){const r=null==(i=e.seriesX)?void 0:i[t];if(r&&r.length&&null!=r[s])return"x:"+r[s]}const n=null==(r=e.labels)?void 0:r[s];return null!=n&&""!==String(n)?"c:"+(Array.isArray(n)?n.join(" "):String(n)):"j:"+s}(n,t,s))),h=W(l.map((s,i)=>function(e,t,s){var i,r,n,a;if(null==(i=e.axisFlags)?void 0:i.isXNumeric){const i=null==(n=null==(r=e.seriesData)?void 0:r.seriesX)?void 0:n[t];if(i&&i.length&&null!=i[s])return"x:"+i[s]}const l=null==(a=e.globals.labels)?void 0:a[s];return null!=l&&""!==String(l)?"c:"+(Array.isArray(l)?l.join(" "):String(l)):"j:"+s}(e,t,i))),u=function(e,t){const s=new Map;e.forEach((e,t)=>{s.has(e)||s.set(e,t)});const i=new Array(t.length),r=new Set;let n=-1,a=!0,l=e.length===t.length;t.forEach((e,t)=>{const o=s.has(e)&&!r.has(s.get(e))?s.get(e):-1;i[t]=o,-1!==o&&(r.add(o),o<n&&(a=!1),n=o),o!==t&&(l=!1)});const o=[];for(let t=0;t<e.length;t++)r.has(t)||o.push(t);return{toOld:i,exits:o,ordered:a,changed:!l}}(o,h);return u.ordered&&(u.changed||s)?{join:u,oldKeys:o,newKeys:h}:null}function B(e,t,s,i,r){const n=performance.now(),a=l=>{if(e.globals.isDestroyed)return;const o=Math.max(0,Math.min(1,(l-n)/t));i(s(o),o),o<1?M.requestAnimationFrame(a):r&&r()};M.requestAnimationFrame(a)}function T(e,{elPointsMain:t,realIndex:s,speed:i}){var r,n,a,l;if(!(null==t?void 0:t.node))return!1;const o=H(e,s,!0);if(!o)return!1;const h=e.globals.prevStreamFrame;if(!h)return!1;const u=null==(r=h.xPixels)?void 0:r[s],c=null==(n=h.yPixels)?void 0:n[s];if(!u||!c)return!1;const p=t.node.querySelectorAll(".apexcharts-marker");if(!p.length)return!1;const d=(null==(a=e.globals.seriesXvalues)?void 0:a[s])||[],g=(null==(l=e.globals.seriesYvalues)?void 0:l[s])||[],f=function(e){var t,s;const i=e.config.chart.animations;return j(null!=(s=null==(t=i.dynamicAnimation)?void 0:t.easing)?s:i.easing)}(e),m=Math.max(1,i||1);return t.node.classList.remove("apexcharts-element-hidden"),p.forEach(t=>{var i,r,n,a,l,p,x,y,b;const v=parseInt(null!=(r=null!=(i=t.getAttribute("j"))?i:t.getAttribute("rel"))?r:"",10);if(!isFinite(v)||v<0||v>=o.join.toOld.length)return;const P=o.join.toOld[v],A=null!=d[v]&&null!=g[v]?[d[v],g[v]]:null;if(-1===P||!A){const s=t.style;return s.opacity="0",void B(e,m,f,e=>{s.opacity=String(e)},()=>{s.opacity=""})}const w=(null!=(n=u[P])?n:NaN)-A[0],k=(null!=(a=c[P])?a:NaN)-A[1];if(!isFinite(w)||!isFinite(k))return;const Y=null!=(x=null==(p=null==(l=h.rPixels)?void 0:l[s])?void 0:p[P])?x:NaN,F=parseFloat(null!=(b=null!=(y=t.getAttribute("r"))?y:t.getAttribute("default-marker-size"))?b:""),M=isFinite(Y)&&isFinite(F)&&F>0&&Math.abs(Y-F)>.25;if(!(Math.abs(w)>=.5||Math.abs(k)>=.5)&&!M)return;const S=e=>{const s=w*(1-e),i=k*(1-e);if(M){const r=(Y+(F-Y)*e)/F;t.setAttribute("transform",`translate(${s+A[0]*(1-r)}, ${i+A[1]*(1-r)}) scale(${r})`)}else t.setAttribute("transform",`translate(${s}, ${i})`)};S(0),B(e,m,f,S,()=>{t.removeAttribute("transform")})}),!0}function V(e,{type:t,realIndex:s,pathFromLine:i,pathFromArea:r,linePaths:n,areaPaths:a}){var l,o;const h=H(e,s);if(!h)return null;const{join:u,oldKeys:c,newKeys:p}=h,d=e.globals.prevStreamFrame;if(!d)return null;const g=null==(l=d.seriesY)?void 0:l[s],f=null==(o=e.seriesData.series)?void 0:o[s];if(g.length<2||f.length<2)return null;if(g.some(e=>null===e)||f.some(e=>null===e))return null;const m=function(e,t){const s=new Set(e.exits),i=[];let r=0;for(let t=0;t<e.toOld.length;t++){const n=e.toOld[t];if(-1!==n){for(;r<n;)s.has(r)&&i.push({oldJ:r,newJ:-1}),r++;i.push({oldJ:n,newJ:t}),r=n+1}else i.push({oldJ:-1,newJ:t})}for(;r<t;)s.has(r)&&i.push({oldJ:r,newJ:-1}),r++;return i}(u,c.length),x={};return Array.isArray(n)&&1===n.length&&i&&(x.line=$(i,n[0],m,c.length,p.length,!1)),"area"===t&&Array.isArray(a)&&1===a.length&&r&&(x.area=$(r,a[0],m,c.length,p.length,!0)),x.line||x.area?x:null}class E{constructor(e,t,s,i){this.ctx=t,this.w=e,this.xyRatios=s,this.xRatio=0,this.yRatio=[],this.zRatio=0,this.baseLineY=[],this.pointsChart=!("bubble"!==this.w.config.chart.type&&"scatter"!==this.w.config.chart.type)||i,this.scatter=new x(this.w,this.ctx),this.noNegatives=this.w.globals.minX===Number.MAX_VALUE,this.lineHelpers=new v(this),this.markers=new m(this.w,this.ctx),this.prevSeriesY=[],this.categoryAxisCorrection=0,this.yaxisIndex=0,this.xDivision=0,this.zeroY=0,this.areaBottomY=0,this.strokeWidth=0,this.isReversed=!1,this.appendPathFrom=!1,this.elSeries=null,this.elPointsMain=null,this.elDataLabelsWrap=null,this._elLastPointsWrap=null}draw(e,t,s,i){var r;const n=this.w,a=new d(this.w),h=n.globals.comboCharts?t:n.config.chart.type,u=a.group({class:`apexcharts-${h}-series apexcharts-plot-series`}),c=new p(this.w);this.yRatio=this.xyRatios.yRatio,this.zRatio=this.xyRatios.zRatio,this.xRatio=this.xyRatios.xRatio,this.baseLineY=this.xyRatios.baseLineY,e=c.getLogSeries(e),this.yRatio=c.getLogYRatios(this.yRatio),this.prevSeriesY=[];const g=[];for(let t=0;t<e.length;t++){e=this.lineHelpers.sameValueSeriesFix(t,e);const r=n.globals.comboCharts?s[t]:t,a=this.yRatio.length>1?r:0;this._initSerieVariables(e,t,r);const u=[],c=[],p=[];let d=n.globals.padHorizontal+this.categoryAxisCorrection;const f=1,m=[],x=[];y.addCollapsedClassToSeries(this.w,this.elSeries,r),n.axisFlags.isXNumeric&&n.seriesData.seriesX.length>0&&(d=(n.seriesData.seriesX[r][0]-n.globals.minX)/this.xRatio),p.push(d);const b=d;let v;const P=b;let A=this.zeroY,w=this.zeroY;const k=0;A=this.lineHelpers.determineFirstPrevY({i:t,realIndex:r,series:e,prevY:A,lineYPosition:k,translationsIndex:a}).prevY,"monotoneCubic"===n.config.stroke.curve&&null===e[t][0]?u.push(null):u.push(A);const Y=A;let F;"rangeArea"===h&&(F=this.lineHelpers.determineFirstPrevY({i:t,realIndex:r,series:i,prevY:w,lineYPosition:k,translationsIndex:a}),w=F.prevY,v=w,c.push(null!==u[0]?w:null));const M=this._calculatePathsFrom({type:h,series:e,i:t,realIndex:r,translationsIndex:a,prevX:P,prevY:A,prevY2:w}),S=[u[0]],I=[c[0]],C={type:h,series:e,realIndex:r,translationsIndex:a,i:t,x:d,y:f,pX:b,pY:Y,pathsFrom:M,linePaths:m,areaPaths:x,seriesIndex:s,lineYPosition:k,xArrj:p,yArrj:u,y2Arrj:c,seriesRangeEnd:i},_=this._iterateOverDataPoints(o(l({},C),{iterations:"rangeArea"===h?e[t].length-1:void 0,isRangeStart:!0}));if("rangeArea"===h){const e=this._calculatePathsFrom({series:i,i:t,realIndex:r,prevX:P,prevY:w}),s=this._iterateOverDataPoints(o(l({},C),{series:i,xArrj:[d],yArrj:S,y2Arrj:I,pY:v,areaPaths:_.areaPaths,pathsFrom:e,iterations:i[t].length-1,isRangeStart:!1})),n=_.linePaths.length/2;for(let e=0;e<n;e++)_.linePaths[e]=s.linePaths[e+n]+_.linePaths[e];_.linePaths.splice(n),_.pathFromLine=s.pathFromLine+_.pathFromLine}else/z\s*$/i.test(_.pathFromArea)||(_.pathFromArea+="z");this._handlePaths({type:h,realIndex:r,i:t,paths:_}),this.elSeries.add(this.elPointsMain),this.elSeries.add(this.elDataLabelsWrap),g.push(this.elSeries)}if(void 0!==(null==(r=n.config.series[0])?void 0:r.zIndex)&&g.sort((e,t)=>Number(e.node.getAttribute("zIndex"))-Number(t.node.getAttribute("zIndex"))),n.config.chart.stacked)for(let e=g.length-1;e>=0;e--)u.add(g[e]);else for(let e=0;e<g.length;e++)u.add(g[e]);return u}_initSerieVariables(e,t,s){const i=this.w,r=new d(this.w);this.xDivision=i.layout.gridWidth/(i.globals.dataPoints-("on"===i.config.xaxis.tickPlacement?1:0)),this.strokeWidth=Array.isArray(i.config.stroke.width)?i.config.stroke.width[s]:i.config.stroke.width;let n=0;this.yRatio.length>1&&(this.yaxisIndex=i.globals.seriesYAxisReverseMap[s],n=s),this.isReversed=i.config.yaxis[this.yaxisIndex]&&i.config.yaxis[this.yaxisIndex].reversed,this.zeroY=i.layout.gridHeight-this.baseLineY[n]-(this.isReversed?i.layout.gridHeight:0)+(this.isReversed?2*this.baseLineY[n]:0),this.areaBottomY=this.zeroY,(this.zeroY>i.layout.gridHeight||"end"===i.config.plotOptions.area.fillTo)&&(this.areaBottomY=i.layout.gridHeight),this.categoryAxisCorrection=this.xDivision/2;const a=i.config.series[s];if(this.elSeries=r.group({class:"apexcharts-series",zIndex:void 0!==a.zIndex?a.zIndex:s,seriesName:b.escapeString(i.seriesData.seriesNames[s])}),this.elPointsMain=r.group({class:"apexcharts-series-markers-wrap","data:realIndex":s}),this.markers.resetSeriesWrapCache(),this._elLastPointsWrap=null,i.globals.hasNullValues){const e=this.markers.plotChartMarkers({pointsPos:{x:[0],y:[i.layout.gridHeight+i.globals.markers.largestSize]},seriesIndex:t,j:0,pSize:.1,alwaysDrawMarker:!0,isVirtualPoint:!0});null!==e&&this.elPointsMain.add(e)}this.elDataLabelsWrap=r.group({class:"apexcharts-datalabels","data:realIndex":s});const l=e[t].length===i.globals.dataPoints;this.elSeries.attr({"data:longestSeries":l,rel:t+1,"data:realIndex":s}),this.appendPathFrom=!0}_calculatePathsFrom({type:e,series:t,i:s,realIndex:i,translationsIndex:r,prevX:n,prevY:a,prevY2:l}){const o=this.w,h=new d(this.w);let u,c,p,g;if(null===t[s][0]){for(let e=0;e<t[s].length;e++)if(null!==t[s][e]){n=this.xDivision*e,a=this.zeroY-t[s][e]/this.yRatio[r],u=h.move(n,a),c=h.move(n,this.areaBottomY);break}}else u=h.move(n,a),"rangeArea"===e&&(u=h.move(n,l)+h.line(n,a)),c=h.move(n,this.areaBottomY)+h.line(n,a);if(p=h.move(0,this.areaBottomY)+h.line(0,this.areaBottomY),g=h.move(0,this.areaBottomY)+h.line(0,this.areaBottomY),o.globals.previousPaths.length>0){const e=this.lineHelpers.checkPreviousPaths({pathFromLine:p,pathFromArea:g,realIndex:i});p=e.pathFromLine,g=e.pathFromArea}return{prevX:n,prevY:a,linePath:u,areaPath:c,pathFromLine:p,pathFromArea:g}}_handlePaths({type:e,realIndex:t,i:s,paths:i}){var r,n,a,h,u,c,p;const f=this.w,m=new d(this.w),x=function(e,t){const s=e&&e.renderer;return s&&s.kind&&"svg"!==s.kind?s:t}(this.ctx,m),y=new g(this.w);this.prevSeriesY.push(i.yArrj);let b=null;"line"!==e&&"area"!==e||!f.globals.dataChanged||(b=function(e,t,s,i){var r;const n=e.globals,a=n.prevStreamFrame;if(!a||!n.dataChanged||!(null==(r=e.axisFlags)?void 0:r.isXNumeric))return null;const l=a.seriesX[t],o=a.seriesY[t],h=e.seriesData.seriesX[t],u=e.seriesData.series[t];if(!(l&&o&&h&&u))return null;if(l.length<3||h.length<3)return null;let c=-1;for(let e=0;e<l.length;e++)if(l[e]===h[0]){c=e;break}if(-1===c)return null;const p=Math.min(l.length-c,h.length);if(p<2)return null;const d=h.length-p;if(0===c&&0===d)return null;for(let e=0;e<p;e++){if(l[c+e]!==h[e])return null;const t=o[c+e],s=u[e];if(t!==s&&(null!=t||null!=s))return null}const g=a.xPixels[t],f=a.yPixels[t];if(!g||!f)return null;let m=-1,x=-1;for(let e=0;e<p;e++)null!=g[c+e]&&null!=f[c+e]&&null!=s[e]&&null!=i[e]&&(-1===m&&(m=e),x=e);if(-1===m||x<=m)return null;const y=s[m],b=s[x],v=g[c+m],P=g[c+x];if(Math.abs(b-y)<1e-6)return null;const A=(P-v)/(b-y),w=v-A*y;if(!isFinite(A)||!isFinite(w))return null;if(Math.abs(A-1)>.02)return null;if(Math.abs(w)<.5)return null;let k=m,Y=m;for(let e=m;e<=x;e++){const t=i[e];null!=t&&null!=f[c+e]&&(t<i[k]&&(k=e),t>i[Y]&&(Y=e))}let F=1,M=0;const S=i[k],I=i[Y];if(Math.abs(I-S)>1e-6?(F=(f[c+Y]-f[c+k])/(I-S),M=f[c+k]-F*S):M=f[c+k]-S,!isFinite(F)||!isFinite(M)||F<.2||F>5)return null;const C=Math.floor((m+x)/2);if(C!==m&&C!==x&&null!=s[C]&&null!=g[c+C]){const e=A*s[C]+w;if(Math.abs(e-g[c+C])>1.5)return null;if(null!=i[C]&&null!=f[c+C]){const e=F*i[C]+M;if(Math.abs(e-f[c+C])>1.5)return null}}return{ax:A,bx:w,ay:F,by:M}}(f,t,i.xArrj,i.yArrj));let v=null;b||"line"!==e&&"area"!==e||(v=V(f,{type:e,realIndex:t,pathFromLine:i.pathFromLine,pathFromArea:i.pathFromArea,linePaths:i.linePaths,areaPaths:i.areaPaths})),f.globals.seriesXvalues[t]=i.xArrj,f.globals.seriesYvalues[t]=i.yArrj;const P=f.config.forecastDataPoints;if(P.count>0&&"rangeArea"!==e){const e=f.globals.seriesXvalues[t][f.globals.seriesXvalues[t].length-P.count-1],s=m.drawRect(e,0,f.layout.gridWidth,f.layout.gridHeight,0);f.dom.elForecastMask.appendChild(s.node);const i=m.drawRect(0,0,e,f.layout.gridHeight,0);f.dom.elNonForecastMask.appendChild(i.node)}this.pointsChart?T(f,{elPointsMain:this.elPointsMain,realIndex:t,speed:f.config.chart.animations.dynamicAnimation.speed}):(f.globals.delayedElements.push({el:this.elPointsMain.node,index:t}),T(f,{elPointsMain:this.elPointsMain,realIndex:t,speed:f.config.chart.animations.dynamicAnimation.speed}),H(f,t)&&(null==(r=this.elDataLabelsWrap)?void 0:r.node)&&(this.elDataLabelsWrap.node.classList.add("apexcharts-element-hidden"),f.globals.delayedElements.push({el:this.elDataLabelsWrap.node,holdUntilComplete:!0})));const A={i:s,realIndex:t,animationDelay:s,initialSpeed:f.config.chart.animations.speed,dataChangeSpeed:f.config.chart.animations.dynamicAnimation.speed,className:`apexcharts-${e}`},w=i.numericXY;if("area"===e){const e=y.fillPath({seriesNumber:t});for(let t=0;t<i.areaPaths.length;t++){const s=x.renderPaths(o(l({},A),{pathFrom:b?F(i.areaPaths[t],b):null!=(a=null==(n=null==v?void 0:v.area)?void 0:n.from)?a:i.pathFromArea,pathTo:i.areaPaths[t],pathToNumeric:w?{xs:w.xs,ys:w.ys,closeY:w.areaCloseY}:void 0,pathToInterp:null==(h=null==v?void 0:v.area)?void 0:h.toInterp,scrollMorph:!!b,stroke:"none",strokeWidth:0,strokeLineCap:null,fill:e}));this.elSeries.add(s)}}if(f.config.stroke.show&&!this.pointsChart){let r=null;if("line"===e)r=y.fillPath({seriesNumber:t,i:s});else if("solid"===f.config.stroke.fill.type)r=f.globals.stroke.colors[t];else{const e=f.config.fill;f.config.fill=f.config.stroke.fill,r=y.fillPath({seriesNumber:t,i:s}),f.config.fill=e}for(let s=0;s<i.linePaths.length;s++){let n=r;"rangeArea"===e&&(n=y.fillPath({seriesNumber:t}));const a=o(l({},A),{pathFrom:b?F(i.linePaths[s],b):null!=(c=null==(u=null==v?void 0:v.line)?void 0:u.from)?c:i.pathFromLine,pathTo:i.linePaths[s],pathToNumeric:w?{xs:w.xs,ys:w.ys}:void 0,pathToInterp:null==(p=null==v?void 0:v.line)?void 0:p.toInterp,scrollMorph:!!b,stroke:r,strokeWidth:this.strokeWidth,strokeLineCap:f.config.stroke.lineCap,fill:"rangeArea"===e?n:"none"}),h=x.renderPaths(a);if(this.elSeries.add(h),h.attr("fill-rule","evenodd"),P.count>0&&"rangeArea"!==e){const e=x.renderPaths(a);e.node.setAttribute("stroke-dasharray",P.dashArray),P.strokeWidth&&e.node.setAttribute("stroke-width",P.strokeWidth),this.elSeries.add(e),e.attr("clip-path",`url(#forecastMask${f.globals.cuid})`),h.attr("clip-path",`url(#nonForecastMask${f.globals.cuid})`)}}}}_iterateOverDataPoints({type:e,series:t,iterations:s,realIndex:i,translationsIndex:r,i:n,x:a,y:l,pX:o,pY:h,pathsFrom:u,linePaths:c,areaPaths:p,seriesIndex:g,lineYPosition:f,xArrj:m,yArrj:x,y2Arrj:y,isRangeStart:v,seriesRangeEnd:A}){var w,k;const Y=this.w,F=new d(this.w),M=this.yRatio;let{prevY:S,linePath:I,areaPath:C,pathFromLine:_,pathFromArea:j}=u;const L=b.isNumber(Y.globals.minYArr[i])?Y.globals.minYArr[i]:Y.globals.minY;s||(s=Y.globals.dataPoints>1?Y.globals.dataPoints-1:Y.globals.dataPoints);const R=(e,t)=>t-e/M[r]+2*(this.isReversed?e/M[r]:0);let X=l;const D=Y.config.chart.stacked&&!Y.globals.comboCharts||Y.config.chart.stacked&&Y.globals.comboCharts&&(!this.w.config.chart.stackOnlyBar||"bar"===(null==(w=this.w.config.series[i])?void 0:w.type)||"column"===(null==(k=this.w.config.series[i])?void 0:k.type));let z=Y.config.stroke.curve;Array.isArray(z)&&(z=Array.isArray(g)?z[g[n]]:z[n]);let N,O=0;const $=this.pointsChart?this._scatterJitterPx(i):null;if("straight"===z&&!this.pointsChart){const d=this._fastStraightPath({type:e,series:t,i:n,realIndex:i,translationsIndex:r,iterations:s,x:a,y:l,pX:o,pY:h,pathsFrom:u,linePaths:c,areaPaths:p,xArrj:m,yArrj:x,y2Arrj:y,stackSeries:D});if(d)return d}for(let r=0;r<s&&0!==t[n].length;r++){const u=void 0===t[n][r+1]||null===t[n][r+1];if(Y.axisFlags.isXNumeric){let e=Y.seriesData.seriesX[i][r+1];void 0===Y.seriesData.seriesX[i][r+1]&&(e=Y.seriesData.seriesX[i][s-1]),a=(e-Y.globals.minX)/this.xRatio}else a+=this.xDivision;if(D)if(n>0&&Y.globals.collapsedSeries.length<Y.config.series.length-1){const e=e=>{for(let t=e;t>0;t--){if(!(Y.globals.collapsedSeriesIndices.indexOf((null==g?void 0:g[t])||t)>-1))return t;t--}return 0};f=this.prevSeriesY[e(n-1)][r+1]}else f=this.zeroY;else f=this.zeroY;u?l=R(L,f):(l=R(t[n][r+1],f),"rangeArea"===e&&(X=R(A[n][r+1],f)));let d=a,b=l;if($){const e=100003*i+(r+1);$.x&&(d=a+2*(P(7919*e+13)-.5)*$.x),$.y&&(b=l+2*(P(6271*e+97)-.5)*$.y)}m.push(null===t[n][r+1]?null:d),!u||"smooth"!==Y.config.stroke.curve&&"monotoneCubic"!==Y.config.stroke.curve?(x.push(b),y.push(X)):(x.push(null),y.push(null));const w=this.lineHelpers.calculatePoints({series:t,x:d,y:b,realIndex:i,i:n,j:r,prevY:S}),k=this._createPaths({type:e,series:t,i:n,j:r,x:a,y:l,y2:X,xArrj:m,yArrj:x,y2Arrj:y,pX:o,pY:h,pathState:O,segmentStartX:N,linePath:I,areaPath:C,linePaths:c,areaPaths:p,curve:z,isRangeStart:v});p=k.areaPaths,c=k.linePaths,o=k.pX,h=k.pY,O=k.pathState,N=k.segmentStartX,C=k.areaPath,I=k.linePath,!this.appendPathFrom||Y.globals.hasNullValues||"monotoneCubic"===z&&"rangeArea"===e||(_+=F.line(a,this.areaBottomY),j+=F.line(a,this.areaBottomY)),this.handleNullDataPoints(t,w,n,r,i),this._handleMarkersAndLabels({type:e,pointsPos:w,i:n,j:r,realIndex:i,isRangeStart:v})}return{yArrj:x,xArrj:m,pathFromArea:j,areaPaths:p,pathFromLine:_,linePaths:c,linePath:I,areaPath:C}}_handleMarkersAndLabels({type:e,pointsPos:t,isRangeStart:s,i:i,j:r,realIndex:n}){const a=this.w,l=new f(this.w,this.ctx);if(this.pointsChart)this.scatter.draw(this.elSeries,r,{realIndex:n,pointsPos:t,zRatio:this.zRatio,elParent:this.elPointsMain});else{!(!a.globals.dataChanged&&!a.globals.resized)&&a.seriesData.series[i].length>1&&this.elPointsMain.node.classList.add("apexcharts-element-hidden");const e=this.markers.plotChartMarkers({pointsPos:t,seriesIndex:n,j:r+1});null!==e&&e!==this._elLastPointsWrap&&(this.elPointsMain.add(e),this._elLastPointsWrap=e)}const o=l.drawDataLabel({type:e,isRangeStart:s,pos:t,i:n,j:r+1});null!==o&&this.elDataLabelsWrap.add(o)}_scatterJitterPx(e){var t;const s=this.w,i=null==(t=s.config.plotOptions.scatter)?void 0:t.jitter;if(!i||!i.enabled||!i.x&&!i.y)return null;const r=s.axisFlags.isXNumeric&&this.xRatio?1/this.xRatio:this.xDivision,n=this.yRatio.length>1?e:0,a=this.yRatio[n]?1/this.yRatio[n]:0;return{x:(i.x||0)*r,y:(i.y||0)*a}}_fastStraightPath({type:e,series:t,i:s,realIndex:i,translationsIndex:r,iterations:n,x:a,y:l,pX:o,pY:h,pathsFrom:u,linePaths:c,areaPaths:p,xArrj:d,yArrj:g,y2Arrj:f,stackSeries:m}){const x=this.w;if("line"!==e&&"area"!==e)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[i]>0)return null;const y=t[s],b=y.length;if(!n||b<2||b-1!==n)return null;for(let e=0;e<=n;e++){const t=y[e];if(null==t)return null}const v=x.axisFlags.isXNumeric,P=v?x.seriesData.seriesX[i]:null;if(v&&(!P||P.length<b))return null;const A=this.yRatio[r],w=this.isReversed,k=this.zeroY,Y=this.areaBottomY,F=this.xRatio,M=x.globals.minX,S=this.xDivision,I=x.config.markers.offsetX,C=x.config.markers.offsetY,_=this.appendPathFrom&&!x.globals.hasNullValues;let{pathFromLine:j,pathFromArea:L}=u;const R=this.ctx&&this.ctx.renderer,X=!(!R||!R.kind||"svg"===R.kind),D=!X||x.globals.dataChanged&&!!x.globals.prevStreamFrame,z=X?new Float64Array(b):null,N=X?new Float64Array(b):null;z&&N&&(z[0]=o,N[0]=h),void 0===x.globals.pointsArray[i]&&(x.globals.pointsArray[i]=[]);const O=x.globals.pointsArray[i],$=P?(P[0]-M)/F+I:this.categoryAxisCorrection+I;O.push([$,u.prevY+C]);const W=D?new Array(n+1):[];D&&(W[0]="M "+o+" "+h);const H=D&&_?new Array(n):null;let B=a,T=o,V=h;for(let e=0;e<n;e++){P?T=(P[e+1]-M)/F:(B+=S,T=B);const t=y[e+1];V=k-t/A+2*(w?t/A:0),d.push(T),g.push(V),f.push(l),O.push([T+I,V+C]),D&&(W[e+1]=" L "+T+" "+V,H&&(H[e]=" L "+T+" "+Y)),z&&N&&(z[e+1]=T,N[e+1]=V)}let E="",J="";if(D&&(E=W.join(""),J=E+" L "+T+" "+Y+" L "+o+" "+Y+"z"),H){const e=H.join("");j+=e,L+=e}else!D&&_&&(j+=" L "+T+" "+Y,L+=" L "+T+" "+Y);return c.push(E),p.push(J),{yArrj:g,xArrj:d,pathFromArea:L,areaPaths:p,pathFromLine:j,linePaths:c,linePath:E,areaPath:J,numericXY:z?{xs:z,ys:N,areaCloseY:Y}:void 0}}_createPaths({type:e,series:t,i:s,j:i,x:r,y:n,xArrj:a,yArrj:l,y2:o,y2Arrj:h,pX:u,pY:c,pathState:p,segmentStartX:g,linePath:f,areaPath:m,linePaths:x,areaPaths:y,curve:b,isRangeStart:v}){const P=new d(this.w),A=this.areaBottomY,k="rangeArea"===e,Y="rangeArea"===e&&v;switch(b){case"monotoneCubic":{const e=v?l:h,r=(e,t)=>e.map((e,s)=>[e,t[s]]).filter(e=>null!==e[1]),n=e=>{const t=[];let s=0;return e.forEach(e=>{null!==e?s++:s>0&&(t.push(s),s=0)}),s>0&&t.push(s),t},o=(e,t)=>{const s=n(e),i=[];for(let e=0,r=0;e<s.length;r+=s[e++])i[e]=w.slice(t,r,r+s[e]);return i};switch(p){case 0:if(null===e[i+1])break;p=1;case 1:if(!(k?a.length===t[s].length:i===t[s].length-2))break;case 2:{const t=v?a:a.slice().reverse(),s=v?e:e.slice().reverse(),i=r(t,s),n=i.length>1?w.points(i):i;let l=[];k&&(Y?y=i:l=y.reverse());let h=0,u=0;if(o(s,n).forEach(e=>{h++;const t=(e=>{let t="";for(let s=0;s<e.length;s++){const i=e[s],r=i.length;r>4?(t+=`C${i[0]}, ${i[1]}`,t+=`, ${i[2]}, ${i[3]}`,t+=`, ${i[4]}, ${i[5]}`):r>2&&(t+=`S${i[0]}, ${i[1]}`,t+=`, ${i[2]}, ${i[3]}`)}return t})(e),s=u;u+=e.length;const r=u-1;Y?f=P.move(i[s][0],i[s][1])+t:k?f=P.move(l[s][0],l[s][1])+P.line(i[s][0],i[s][1])+t+P.line(l[r][0],l[r][1]):(f=P.move(i[s][0],i[s][1])+t,m=f+P.line(i[r][0],A)+P.line(i[s][0],A)+"z",y.push(m)),x.push(f)}),k&&h>1&&!Y){const e=x.slice(h).reverse();x.splice(h),e.forEach(e=>x.push(e))}p=0;break}}break}case"smooth":{const e=.35*(r-u);if(null===t[s][i])p=0;else switch(p){case 0:if(g=u,f=Y?P.move(u,h[i])+P.line(u,c):P.move(u,c),m=P.move(u,c),null===t[s][i+1]||void 0===t[s][i+1]){x.push(f),y.push(m);break}if(p=1,i<t[s].length-2){const t=P.curve(u+e,c,r-e,n,r,n);f+=t,m+=t;break}case 1:if(null===t[s][i+1])f+=Y?P.line(u,o):P.move(u,c),m+=P.line(u,A)+P.line(g,A)+"z",x.push(f),y.push(m),p=-1;else{const a=P.curve(u+e,c,r-e,n,r,n);f+=a,m+=a,i>=t[s].length-2&&(Y&&(f+=P.curve(r,n,r,n,r,o)+P.move(r,o)),m+=P.curve(r,n,r,n,r,A)+P.line(g,A)+"z",x.push(f),y.push(m),p=-1)}}u=r,c=n;break}default:{const e=(e,t,s)=>{let i="";switch(e){case"stepline":i=P.line(t,null,"H")+P.line(null,s,"V");break;case"linestep":i=P.line(null,s,"V")+P.line(t,null,"H");break;case"straight":i=P.line(t,s)}return i};if(null===t[s][i])p=0;else switch(p){case 0:if(g=u,f=Y?P.move(u,h[i])+P.line(u,c):P.move(u,c),m=P.move(u,c),null===t[s][i+1]||void 0===t[s][i+1]){x.push(f),y.push(m);break}if(p=1,i<t[s].length-2){const t=e(b,r,n);f+=t,m+=t;break}case 1:if(null===t[s][i+1])f+=Y?P.line(u,o):P.move(u,c),m+=P.line(u,A)+P.line(g,A)+"z",x.push(f),y.push(m),p=-1;else{const a=e(b,r,n);f+=a,m+=a,i>=t[s].length-2&&(Y&&(f+=P.line(r,o)),m+=P.line(r,A)+P.line(g,A)+"z",x.push(f),y.push(m),p=-1)}}u=r,c=n;break}}return{linePaths:x,areaPaths:y,pX:u,pY:c,pathState:p,segmentStartX:g,linePath:f,areaPath:m}}handleNullDataPoints(e,t,s,i,r){const n=this.w;if(null===e[s][i]&&n.config.markers.showNullDataPoints||1===e[s].length){let e=this.strokeWidth-n.config.markers.strokeWidth/2;e>0||(e=0);const s=this.markers.plotChartMarkers({pointsPos:t,seriesIndex:r,j:i+1,pSize:e,alwaysDrawMarker:!0});null!==s&&this.elPointsMain.add(s)}}}h.use({line:E,area:E,scatter:E,bubble:E,rangeArea:E}),exports.default=h;
|
package/dist/area.esm.js
CHANGED
|
@@ -18,7 +18,7 @@ var __spreadValues = (a, b) => {
|
|
|
18
18
|
};
|
|
19
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
20
|
/*!
|
|
21
|
-
* ApexCharts v6.
|
|
21
|
+
* ApexCharts v6.3.0
|
|
22
22
|
* (c) 2018-2026 ApexCharts
|
|
23
23
|
*/
|
|
24
24
|
import * as _core from "apexcharts/core";
|
|
@@ -1654,7 +1654,7 @@ class Line {
|
|
|
1654
1654
|
let { pathFromLine, pathFromArea } = pathsFrom;
|
|
1655
1655
|
const r = this.ctx && this.ctx.renderer;
|
|
1656
1656
|
const canvasMode = !!(r && r.kind && r.kind !== "svg");
|
|
1657
|
-
const buildStrings = !canvasMode || w.globals.dataChanged;
|
|
1657
|
+
const buildStrings = !canvasMode || w.globals.dataChanged && !!w.globals.prevStreamFrame;
|
|
1658
1658
|
const nxs = canvasMode ? new Float64Array(n) : null;
|
|
1659
1659
|
const nys = canvasMode ? new Float64Array(n) : null;
|
|
1660
1660
|
if (nxs && nys) {
|
package/dist/bar.common.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* ApexCharts v6.
|
|
2
|
+
* ApexCharts v6.3.0
|
|
3
3
|
* (c) 2018-2026 ApexCharts
|
|
4
4
|
*/
|
|
5
5
|
"use strict";var t=Object.defineProperty,e=Object.defineProperties,s=Object.getOwnPropertyDescriptors,a=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable,o=(e,s,a)=>s in e?t(e,s,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[s]=a,l=(t,e)=>{for(var s in e||(e={}))i.call(e,s)&&o(t,s,e[s]);if(a)for(var s of a(e))r.call(e,s)&&o(t,s,e[s]);return t},n=(t,a)=>e(t,s(a));Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const h=require("apexcharts/core");function d(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t)for(const s in t)if("default"!==s){const a=Object.getOwnPropertyDescriptor(t,s);Object.defineProperty(e,s,a.get?a:{enumerable:!0,get:()=>t[s]})}return e.default=t,Object.freeze(e)}const b=d(h),g=b.__apex_Graphics,c=b.__apex_DataLabels;class p{constructor(t){this.w=t.w,this.barCtx=t,this.totalFormatter=this.w.config.plotOptions.bar.dataLabels.total.formatter,this.totalFormatter||(this.totalFormatter=this.w.config.dataLabels.formatter)}handleBarDataLabels(t){const{x:e,y:s,y1:a,y2:i,i:r,j:o,realIndex:h,columnGroupIndex:d,series:b,barHeight:c,barWidth:p,barXPosition:u,barYPosition:x,visibleSeries:f}=t,v=this.w,y=new g(this.barCtx.w),m=Array.isArray(this.barCtx.strokeWidth)?this.barCtx.strokeWidth[h]:this.barCtx.strokeWidth;let C,w;v.axisFlags.isXNumeric&&!v.globals.isBarHorizontal?(C=e+p*(f+1),w=s+c*(f+1)-m):(C=e+p*f,w=s+c*f);let P=null,I=null,H=e,R=s,k={};const W=v.config.dataLabels,L=this.barCtx.barOptions.dataLabels,D=this.barCtx.barOptions.dataLabels.total;void 0!==x&&(this.barCtx.isRangeBar||this.barCtx.isPyramid)&&(w=x,R=x),void 0!==u&&this.barCtx.isVerticalGroupedRangeBar&&(C=u,H=u);const X=W.offsetX,F=W.offsetY;let O={width:0,height:0};if(v.config.dataLabels.enabled){const t=v.seriesData.series[r][o];O=y.getTextRects(v.config.dataLabels.formatter?v.config.dataLabels.formatter(t,n(l({},v),{seriesIndex:r,dataPointIndex:o,w:v})):v.formatters.yLabelFormatters[0](t),parseFloat(W.style.fontSize).toString())}const A={x:e,y:s,i:r,j:o,realIndex:h,columnGroupIndex:d,bcx:C,bcy:w,barHeight:c,barWidth:p,textRects:O,strokeWidth:m,dataLabelsX:H,dataLabelsY:R,dataLabelsConfig:W,barDataLabelsConfig:L,barTotalDataLabelsConfig:D,offX:X,offY:F};return k=this.barCtx.isHorizontal?this.calculateBarsDataLabelsPosition(A):this.calculateColumnsDataLabelsPosition(A),P=this.drawCalculatedDataLabels({x:k.dataLabelsX,y:k.dataLabelsY,val:this.barCtx.isRangeBar?[a,i]:"100%"===v.config.chart.stackType?b[h][o]:v.seriesData.series[h][o],i:h,j:o,barWidth:p,barHeight:c,textRects:O,dataLabelsConfig:W}),v.config.chart.stacked&&D.enabled&&(I=this.drawTotalDataLabels({x:k.totalDataLabelsX,y:k.totalDataLabelsY,barWidth:p,barHeight:c,realIndex:h,textAnchor:k.totalDataLabelsAnchor,val:this.getStackedTotalDataLabel({realIndex:h,j:o}),dataLabelsConfig:W,barTotalDataLabelsConfig:D})),{dataLabelsPos:k,dataLabels:P,totalDataLabels:I}}getStackedTotalDataLabel({realIndex:t,j:e}){const s=this.w;let a=this.barCtx.stackedSeriesTotals[e];return this.totalFormatter&&(a=this.totalFormatter(a,n(l({},s),{seriesIndex:t,dataPointIndex:e,w:s}))),a}calculateColumnsDataLabelsPosition(t){const e=this.w;let s,a,{i:i,j:r,realIndex:o,y:l,bcx:n,barWidth:h,barHeight:d,textRects:b,dataLabelsX:c,dataLabelsY:p,dataLabelsConfig:u,barDataLabelsConfig:x,barTotalDataLabelsConfig:f,strokeWidth:v,offX:y,offY:m}=t;const C=n;d=Math.abs(d);const w="vertical"===e.config.plotOptions.bar.dataLabels.orientation,{zeroEncounters:P}=this.barCtx.barHelpers.getZeroValueEncounters({i:i,j:r});n-=v/2;const I=e.layout.gridWidth/e.globals.dataPoints;if(this.barCtx.isVerticalGroupedRangeBar?c+=h/2:(c=e.axisFlags.isXNumeric?n-h/2+y:n-I+h/2+y,!e.config.chart.stacked&&P>0&&e.config.plotOptions.bar.hideZeroBarsWhenGrouped&&(c-=h*P)),w){const t=2;c=c+b.height/2-v/2-t}const H=e.seriesData.series[i][r]<0;let R=l;switch(this.barCtx.isReversed&&(R=l+(H?d:-d)),x.position){case"center":p=w?H?R-d/2+m:R+d/2-m:H?R-d/2+b.height/2+m:R+d/2+b.height/2-m;break;case"bottom":p=w?H?R-d+m:R+d-m:H?R-d+b.height+v+m:R+d-b.height/2+v-m;break;case"top":p=w?H?R+m:R-m:H?R-b.height/2-m:R+b.height+m}let k=R;if(e.labelData.seriesGroups.forEach(t=>{var e;null==(e=this.barCtx[t.join(",")])||e.prevY.forEach(t=>{k=H?Math.max(t[r],k):Math.min(t[r],k)})}),this.barCtx.lastActiveBarSerieIndex===o&&f.enabled){const t=18,i=new g(this.barCtx.w).getTextRects(this.getStackedTotalDataLabel({realIndex:o,j:r}),u.fontSize);s=H?k-i.height/2-m-f.offsetY+t:k+i.height+m+f.offsetY-t;const l=I;a=C+(e.axisFlags.isXNumeric?-h*e.globals.barGroups.length/2:e.globals.barGroups.length*h/2-(e.globals.barGroups.length-1)*h-l)+f.offsetX}return e.config.chart.stacked||(p<0?p=0+v:p+b.height/3>e.layout.gridHeight&&(p=e.layout.gridHeight-v)),{bcx:n,bcy:l,dataLabelsX:c,dataLabelsY:p,totalDataLabelsX:a,totalDataLabelsY:s,totalDataLabelsAnchor:"middle"}}calculateBarsDataLabelsPosition(t){var e;const s=this.w;let{x:a,i:i,j:r,realIndex:o,bcy:l,barHeight:n,barWidth:h,textRects:d,dataLabelsX:b,strokeWidth:c,dataLabelsConfig:p,barDataLabelsConfig:u,barTotalDataLabelsConfig:x,offX:f,offY:v}=t;const y=s.layout.gridHeight/s.globals.dataPoints,{zeroEncounters:m}=this.barCtx.barHelpers.getZeroValueEncounters({i:i,j:r});let C,w,P;if(h=Math.abs(h),this.barCtx.isPyramid){C=l+n/2+v-(null!=(e=d.centerOffset)?e:0)}else C=l-(this.barCtx.isRangeBar?0:y)+n/2+d.height/2+v-3;!s.config.chart.stacked&&m>0&&s.config.plotOptions.bar.hideZeroBarsWhenGrouped&&(C-=n*m);let I="start";const H=s.seriesData.series[i][r]<0;let R=a;if(this.barCtx.isReversed&&(R=a+(H?-h:h),I=H?"start":"end"),this.barCtx.isPyramid)b=s.layout.gridWidth/2+f;else switch(u.position){case"center":b=H?R+h/2-f:Math.max(d.width/2,R-h/2)+f;break;case"bottom":b=H?R+h-c-f:R-h+c+f;break;case"top":b=H?R-c-f:R-c+f}let k=R;if(s.labelData.seriesGroups.forEach(t=>{var e;null==(e=this.barCtx[t.join(",")])||e.prevX.forEach(t=>{k=H?Math.min(t[r],k):Math.max(t[r],k)})}),this.barCtx.lastActiveBarSerieIndex===o&&x.enabled){const t=new g(this.barCtx.w).getTextRects(this.getStackedTotalDataLabel({realIndex:o,j:r}),p.fontSize);H?(w=k-c-f-x.offsetX,I="end"):w=k+f+x.offsetX+(this.barCtx.isReversed?-(h+c):c),P=C-d.height/2+t.height/2+x.offsetY+c,s.globals.barGroups.length>1&&(P-=s.globals.barGroups.length/2*(n/2))}return s.config.chart.stacked||("start"===p.textAnchor?b-d.width<0?b=H?d.width+c:c:b+d.width>s.layout.gridWidth&&(b=H?s.layout.gridWidth-c:s.layout.gridWidth-d.width-c):"middle"===p.textAnchor?b-d.width/2<0?b=d.width/2+c:b+d.width/2>s.layout.gridWidth&&(b=s.layout.gridWidth-d.width/2-c):"end"===p.textAnchor&&(b<1?b=d.width+c:b+1>s.layout.gridWidth&&(b=s.layout.gridWidth-d.width-c))),{bcx:a,bcy:l,dataLabelsX:b,dataLabelsY:C,totalDataLabelsX:w,totalDataLabelsY:P,totalDataLabelsAnchor:I}}drawCalculatedDataLabels({x:t,y:e,val:s,i:a,j:i,textRects:r,barHeight:o,barWidth:h,dataLabelsConfig:d}){const b=this.w;let p="rotate(0)";"vertical"===b.config.plotOptions.bar.dataLabels.orientation&&(p=`rotate(-90, ${t}, ${e})`);const u=new c(this.barCtx.w,this.barCtx.ctx),x=new g(this.barCtx.w),f=d.formatter;let v=null;const y=b.globals.collapsedSeriesIndices.indexOf(a)>-1;if(d.enabled&&!y){v=x.group({class:"apexcharts-data-labels",transform:p});let g="";void 0!==s&&(g=f(s,n(l({},b),{seriesIndex:a,dataPointIndex:i,w:b}))),!s&&b.config.plotOptions.bar.hideZeroBarsWhenGrouped&&(g="");const c=b.seriesData.series[a][i]<0,y=b.config.plotOptions.bar.dataLabels.position;if("vertical"===b.config.plotOptions.bar.dataLabels.orientation&&("top"===y&&(d.textAnchor=c?"end":"start"),"center"===y&&(d.textAnchor="middle"),"bottom"===y&&(d.textAnchor=c?"end":"start")),this.barCtx.isRangeBar&&this.barCtx.barOptions.dataLabels.hideOverflowingLabels){h<x.getTextRects(g,parseFloat(d.style.fontSize).toString()).width&&(g="")}b.config.chart.stacked&&this.barCtx.barOptions.dataLabels.hideOverflowingLabels&&(this.barCtx.isHorizontal?r.width/1.6>Math.abs(h)&&(g=""):r.height/1.6>Math.abs(o)&&(g=""));const m=l({},d);this.barCtx.isHorizontal&&s<0&&("start"===d.textAnchor?m.textAnchor="end":"end"===d.textAnchor&&(m.textAnchor="start")),u.plotDataLabelsText({x:t,y:e,text:g,i:a,j:i,parent:v,dataLabelsConfig:m,alwaysDrawDataLabel:!0,offsetCorrection:!0})}return v}drawTotalDataLabels({x:t,y:e,val:s,realIndex:a,textAnchor:i,barTotalDataLabelsConfig:r}){const o=new g(this.barCtx.w);let l;return r.enabled&&void 0!==t&&void 0!==e&&this.barCtx.lastActiveBarSerieIndex===a&&(l=o.drawText({x:t,y:e,foreColor:r.style.color,text:s,textAnchor:i,fontFamily:r.style.fontFamily,fontSize:r.style.fontSize,fontWeight:r.style.fontWeight})),l}}const u=b.__apex_Series,x=b.__apex_Fill,f=b.__apex_Utils;class v{constructor(t){this.w=t.w,this.barCtx=t}initVariables(t){const e=this.w;this.barCtx.series=t,this.barCtx.totalItems=0,this.barCtx.seriesLen=0,this.barCtx.visibleI=-1,this.barCtx.visibleItems=1;for(let s=0;s<t.length;s++)if(t[s].length>0&&(this.barCtx.seriesLen=this.barCtx.seriesLen+1,this.barCtx.totalItems+=t[s].length),e.axisFlags.isXNumeric)for(let a=0;a<t[s].length;a++)e.seriesData.seriesX[s][a]>e.globals.minX&&e.seriesData.seriesX[s][a]<e.globals.maxX&&this.barCtx.visibleItems++;else this.barCtx.visibleItems=e.globals.dataPoints;this.arrBorderRadius=this.createBorderRadiusArr(e.seriesData.series),f.isSafari()&&(this.arrBorderRadius=this.arrBorderRadius.map(t=>t.map(t=>"none"))),0===this.barCtx.seriesLen&&(this.barCtx.seriesLen=1),this.barCtx.zeroSerieses=[],e.globals.comboCharts||this.checkZeroSeries({series:t})}initialPositions(t){const e=this.w;let s,a,i,r,o,l,n,h,d=e.globals.dataPoints;this.barCtx.isRangeBar&&(d=e.labelData.labels.length);let b=this.barCtx.seriesLen;if(e.config.plotOptions.bar.rangeBarGroupRows&&(b=1),this.barCtx.isHorizontal)i=e.layout.gridHeight/d,o=i/b,e.axisFlags.isXNumeric&&(i=e.layout.gridHeight/this.barCtx.totalItems,o=i/this.barCtx.seriesLen),o=o*parseInt(this.barCtx.barOptions.barHeight,10)/100,-1===String(this.barCtx.barOptions.barHeight).indexOf("%")&&(o=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),a=(i-o*this.barCtx.seriesLen)/2;else{if(r=e.layout.gridWidth/this.barCtx.visibleItems,e.config.xaxis.convertedCatToNumeric&&(r=e.layout.gridWidth/e.globals.dataPoints),l=r/b*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),l=r/b*parseInt(this.barCtx.barOptions.columnWidth,10)/100,l<1&&(l=1)}if(-1===String(this.barCtx.barOptions.columnWidth).indexOf("%")&&(l=parseInt(this.barCtx.barOptions.columnWidth,10)),n=e.layout.gridHeight-this.barCtx.baseLineY[this.barCtx.translationsIndex]-(this.barCtx.isReversed?e.layout.gridHeight:0)+(this.barCtx.isReversed?2*this.barCtx.baseLineY[this.barCtx.translationsIndex]:0),e.axisFlags.isXNumeric){s=this.barCtx.getBarXForNumericXAxis({x:s,j:0,realIndex:t,barWidth:l}).x}else s=e.globals.padHorizontal+f.noExponents(r-l*this.barCtx.seriesLen)/2}return e.globals.barHeight=o,e.globals.barWidth=l,{x:s,y:a,yDivision:i,xDivision:r,barHeight:o,barWidth:l,zeroH:n,zeroW:h}}initializeStackedPrevVars(t){t.w.labelData.seriesGroups.forEach(e=>{t[e]||(t[e]={}),t[e].prevY=[],t[e].prevX=[],t[e].prevYF=[],t[e].prevXF=[],t[e].prevYVal=[],t[e].prevXVal=[]})}initializeStackedXYVars(t){t.w.labelData.seriesGroups.forEach(e=>{t[e]||(t[e]={}),t[e].xArrj=[],t[e].xArrjF=[],t[e].xArrjVal=[],t[e].yArrj=[],t[e].yArrjF=[],t[e].yArrjVal=[]})}getPathFillColor(t,e,s,a){var i,r,o,l;const n=this.w,h=new x(this.barCtx.w);let d=null;const b=this.barCtx.barOptions.distributed?s:e;let g=!1;if(this.barCtx.barOptions.colors.ranges.length>0){this.barCtx.barOptions.colors.ranges.map(a=>{t[e][s]>=a.from&&t[e][s]<=a.to&&(d=a.color,g=!0)})}return{color:h.fillPath({seriesNumber:this.barCtx.barOptions.distributed?b:a,dataPointIndex:s,color:d,value:t[e][s],fillConfig:null==(i=n.config.series[e].data[s])?void 0:i.fill,fillType:(null==(o=null==(r=n.config.series[e].data[s])?void 0:r.fill)?void 0:o.type)?null==(l=n.config.series[e].data[s])?void 0:l.fill.type:Array.isArray(n.config.fill.type)?n.config.fill.type[a]:n.config.fill.type}),useRangeColor:g}}getStrokeWidth(t,e,s){let a=0;const i=this.w;return void 0===this.barCtx.series[t][e]||null===this.barCtx.series[t][e]||"bar"===i.config.chart.type&&!this.barCtx.series[t][e]?this.barCtx.isNullValue=!0:this.barCtx.isNullValue=!1,i.config.stroke.show&&(this.barCtx.isNullValue||(a=Array.isArray(this.barCtx.strokeWidth)?this.barCtx.strokeWidth[s]:this.barCtx.strokeWidth)),a}createBorderRadiusArr(t){var e;const s=this.w,a=!this.w.config.chart.stacked||s.config.plotOptions.bar.borderRadius<=0,i=t.length,r=0|(null==(e=t[0])?void 0:e.length),o=Array.from({length:i},()=>Array(r).fill(a?"top":"none"));if(a)return o;const l=this.w.config.chart.type;for(let e=0;e<r;e++){const s=[],a=[];let n=0;for(let r=0;r<i;r++){const i=t[r][e];i>0?(s.push(r),n++):i<0&&(a.push(r),n++)}if(s.length>0&&0===a.length)if(1===s.length)o[s[0]][e]="bar"===l&&1===r?"top":"both";else{const t=s[0],a=s[s.length-1];for(const i of s)o[i][e]=i===t?"bar"===l&&1===r?"top":"bottom":i===a?"top":"none"}else if(a.length>0&&0===s.length)if(1===a.length)o[a[0]][e]="both";else{const t=Math.max(...a),s=Math.min(...a);for(const i of a)o[i][e]=i===t?"bottom":i===s?"top":"none"}else if(s.length>0&&a.length>0){const t=s[s.length-1];for(const a of s)o[a][e]=a===t?"top":"none";const i=Math.max(...a);for(const t of a)o[t][e]=t===i?"bottom":"none"}else if(1===n){o[s[0]||a[0]][e]="both"}}return o}barBackground({j:t,i:e,x1:s,x2:a,y1:i,y2:r,elSeries:o}){const l=this.w,n=new g(this.barCtx.w),h=new u(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=n.drawRect(void 0!==s?s:0,void 0!==i?i:0,void 0!==a?a:l.layout.gridWidth,void 0!==r?r:l.layout.gridHeight,this.barCtx.barOptions.colors.backgroundBarRadius,e,this.barCtx.barOptions.colors.backgroundBarOpacity);o.add(h),h.node.classList.add("apexcharts-backgroundBar")}}getColumnPaths({barWidth:t,barXPosition:e,y1:s,y2:a,strokeWidth:i,isReversed:r,series:o,seriesGroup:l,realIndex:n,i:h,j:d,w:b}){var c,p,u;const x=new g(this.barCtx.w);(i=Array.isArray(i)?i[n]:i)||(i=0);let f=t,v=e;(null==(c=b.config.series[n].data[d])?void 0:c.columnWidthOffset)&&(v=e-b.config.series[n].data[d].columnWidthOffset/2,f=t+b.config.series[n].data[d].columnWidthOffset);const y=i/2,m=v+y,C=v+f-y,w=(o[h][d]>=0?1:-1)*(r?-1:1);s+=.001-y*w,a+=.001+y*w;const P=x.line(C,s),I="around"===b.config.plotOptions.bar.borderRadiusApplication||"both"===this.arrBorderRadius[n][d]?" Z":" z";let H=x.move(m,s)+x.line(m,a)+x.line(C,a)+P+I;"none"!==this.arrBorderRadius[n][d]&&(H=x.roundPathCorners(H,b.config.plotOptions.bar.borderRadius));let R=null;const k=null==(u=null==(p=this.barCtx.ctx)?void 0:p.morphTypeChange)?void 0:u.getInitialPathFor(n,d);if(k?R=k:b.globals.previousPaths.length>0&&(R=this.barCtx.getPreviousPath(n,d,H)),null==R&&(R=x.move(m,s)+x.line(m,s)+P+P+P+P+P+x.line(m,s)+I),b.config.chart.stacked){let t=this.barCtx;t=this.barCtx[l],t.yArrj.push(a-y*w),t.yArrjF.push(Math.abs(s-a+i*w)),t.yArrjVal.push(this.barCtx.series[h][d])}return{pathTo:H,pathFrom:R}}getFunnelTrapezoidPaths({barYPosition:t,barHeight:e,series:s,i:a,j:i,realIndex:r,strokeWidth:o,w:l}){var n,h;const d=new g(this.barCtx.w),b=l.layout.gridWidth/2,c=t=>Math.abs(t/this.barCtx.invertedYRatio)/2,p=c(s[a][i]),u=i===s[a].length-1,x="taper"===l.config.plotOptions.funnel.lastShape?"taper":"flat";let f;f=u?"taper"===x?0:p:c(s[a][i+1]);const v=o/2,y=t+v,m=t+e-v,C=b-p,w=b+p,P=b-f,I=b+f,H=d.move(C,y)+d.line(w,y)+d.line(I,m)+d.line(P,m)+" Z";let R=null;const k=null==(h=null==(n=this.barCtx.ctx)?void 0:n.morphTypeChange)?void 0:h.getInitialPathFor(r,i);return k?R=k:l.globals.previousPaths.length>0&&(R=this.barCtx.getPreviousPath(r,i,H)),null==R&&(R=d.move(b,y)+d.line(b,y)+d.line(b,m)+d.line(b,m)+" Z"),{pathTo:H,pathFrom:R,x:w,x1:C,barXPosition:b}}computePyramidLayout(t){const e=this.w,s=e.layout.gridHeight,a=e.layout.gridWidth,i=t.map(t=>Math.abs(Number(t)||0)),r=i.reduce((t,e)=>t+e,0);if(0===r||s<=0)return i.map(()=>({y:0,height:0,topHalf:0,bottomHalf:0}));const o=a/2;let l=0;const n=[];for(let t=0;t<i.length;t++){const e=l/r;l+=i[t];const a=l/r,h=e*s,d=a*s;n.push({y:h,height:d-h,topHalf:e*o,bottomHalf:a*o})}return n}getPyramidPaths({barYPosition:t,barHeight:e,topHalf:s,bottomHalf:a,realIndex:i,j:r,strokeWidth:o,w:l}){var n,h;const d=new g(this.barCtx.w),b=l.layout.gridWidth/2,c=o/2,p=t+c,u=t+e-c,x=b-s,f=b+s,v=b-a,y=b+a,m=d.move(x,p)+d.line(f,p)+d.line(y,u)+d.line(v,u)+" Z";let C=null;const w=null==(h=null==(n=this.barCtx.ctx)?void 0:n.morphTypeChange)?void 0:h.getInitialPathFor(i,r);return w?C=w:l.globals.previousPaths.length>0&&(C=this.barCtx.getPreviousPath(i,r,m)),null==C&&(C=d.move(b,p)+d.line(b,p)+d.line(b,u)+d.line(b,u)+" Z"),{pathTo:m,pathFrom:C,x:f,x1:x,barXPosition:b}}getBarpaths({barYPosition:t,barHeight:e,x1:s,x2:a,strokeWidth:i,isReversed:r,series:o,seriesGroup:l,realIndex:n,i:h,j:d,w:b}){var c,p,u;const x=new g(this.barCtx.w);(i=Array.isArray(i)?i[n]:i)||(i=0);let f=t,v=e;(null==(c=b.config.series[n].data[d])?void 0:c.barHeightOffset)&&(f=t-b.config.series[n].data[d].barHeightOffset/2,v=e+b.config.series[n].data[d].barHeightOffset);const y=i/2,m=f+y,C=f+v-y,w=(o[h][d]>=0?1:-1)*(r?-1:1);s+=.001+y*w,a+=.001-y*w;const P=this.barCtx.isFunnel,I=P?(s+a)/2:s,H=x.line(s,C),R="around"===b.config.plotOptions.bar.borderRadiusApplication||"both"===this.arrBorderRadius[n][d]?" Z":" z";let k=x.move(s,m)+x.line(a,m)+x.line(a,C)+H+R;"none"!==this.arrBorderRadius[n][d]&&(k=x.roundPathCorners(k,b.config.plotOptions.bar.borderRadius));let W=null;const L=null==(u=null==(p=this.barCtx.ctx)?void 0:p.morphTypeChange)?void 0:u.getInitialPathFor(n,d);if(L?W=L:b.globals.previousPaths.length>0&&(W=this.barCtx.getPreviousPath(n,d,k)),null==W){const t=P?x.line(I,C):H;W=x.move(I,m)+x.line(I,m)+t+t+t+t+t+x.line(I,m)+R}if(b.config.chart.stacked){let t=this.barCtx;t=this.barCtx[l],t.xArrj.push(a+y*w),t.xArrjF.push(Math.abs(s-a-i*w)),t.xArrjVal.push(this.barCtx.series[h][d])}return{pathTo:k,pathFrom:W}}checkZeroSeries({series:t}){const e=this.w;for(let s=0;s<t.length;s++){let a=0;for(let i=0;i<t[e.globals.maxValsInArrayIndex].length;i++)a+=t[s][i];0===a&&this.barCtx.zeroSerieses.push(s)}}getXForValue(t,e,s=!0){let a=s?e:null;return null!=t&&(a=e+t/this.barCtx.invertedYRatio-2*(this.barCtx.isReversed?t/this.barCtx.invertedYRatio:0)),a}getYForValue(t,e,s,a=!0){let i=a?e:null;return null!=t&&(i=e-t/this.barCtx.yRatio[s]+2*(this.barCtx.isReversed?t/this.barCtx.yRatio[s]:0)),i}getGoalValues(t,e,s,a,i,r){const o=this.w,h=[],d=(a,i)=>{h.push({[t]:"x"===t?this.getXForValue(a,e,!1):this.getYForValue(a,s,r,!1),attrs:i})};if(o.seriesData.seriesGoals[a]&&o.seriesData.seriesGoals[a][i]&&Array.isArray(o.seriesData.seriesGoals[a][i])&&o.seriesData.seriesGoals[a][i].forEach(t=>{d(t.value,t)}),this.barCtx.barOptions.isDumbbell&&o.rangeData.seriesRange.length){const e=this.barCtx.barOptions.dumbbellColors?this.barCtx.barOptions.dumbbellColors:o.globals.colors,s={strokeHeight:"x"===t?0:o.globals.markers.size[a],strokeWidth:"x"===t?o.globals.markers.size[a]:0,strokeDashArray:0,strokeLineCap:"round",strokeColor:Array.isArray(e[a])?e[a][0]:e[a]};d(o.rangeData.seriesRangeStart[a][i],s),d(o.rangeData.seriesRangeEnd[a][i],n(l({},s),{strokeColor:Array.isArray(e[a])?e[a][1]:e[a]}))}return h}drawGoalLine({barXPosition:t,barYPosition:e,goalX:s,goalY:a,barWidth:i,barHeight:r}){if(!(Array.isArray(s)&&s.length>0||Array.isArray(a)&&a.length>0))return null;const o=new g(this.barCtx.w),l=o.group({className:"apexcharts-bar-goals-groups"});l.node.classList.add("apexcharts-element-hidden"),this.barCtx.w.globals.delayedElements.push({el:l.node}),l.attr("clip-path",`url(#gridRectMarkerMask${this.barCtx.w.globals.cuid})`);let n=null;return this.barCtx.isHorizontal?Array.isArray(s)&&s.forEach(t=>{if(t.x>=-1&&t.x<=o.w.layout.gridWidth+1){const s=void 0!==t.attrs.strokeHeight?t.attrs.strokeHeight:r/2,a=e+s+r/2;n=o.drawLine(t.x,a-2*s,t.x,a,t.attrs.strokeColor?t.attrs.strokeColor:void 0,t.attrs.strokeDashArray,t.attrs.strokeWidth?t.attrs.strokeWidth:2,t.attrs.strokeLineCap),l.add(n)}}):Array.isArray(a)&&a.forEach(e=>{if(e.y>=-1&&e.y<=o.w.layout.gridHeight+1){const s=void 0!==e.attrs.strokeWidth?e.attrs.strokeWidth:i/2,a=t+s+i/2;n=o.drawLine(a-2*s,e.y,a,e.y,e.attrs.strokeColor?e.attrs.strokeColor:void 0,e.attrs.strokeDashArray,e.attrs.strokeHeight?e.attrs.strokeHeight:2,e.attrs.strokeLineCap),l.add(n)}}),l}drawBarShadow({prevPaths:t,currPaths:e,color:s,realIndex:a,j:i}){const r=this.w,{x:o,x1:l,barYPosition:n}=t,{x:h,x1:d,barYPosition:b}=e,c=n+e.barHeight,p=new g(this.barCtx.w),u=new f,x=p.move(l,c)+p.line(o,c)+p.line(h,b)+p.line(d,b)+p.line(l,c)+("around"===r.config.plotOptions.bar.borderRadiusApplication||"both"===this.arrBorderRadius[a][i]?" Z":" z");return p.drawPath({d:x,fill:u.shadeColor(.5,f.rgb2hex(s)),stroke:"none",strokeWidth:0,fillOpacity:1,classes:"apexcharts-bar-shadow apexcharts-decoration-element"})}getZeroValueEncounters({i:t,j:e}){var s;const a=this.w;let i=0,r=0;return(a.config.plotOptions.bar.horizontal?a.seriesData.series.map((t,e)=>e):(null==(s=a.globals.columnSeries)?void 0:s.i.map(t=>t))||[]).forEach(s=>{const o=a.globals.seriesPercent[s][e];o&&i++,s<t&&0===o&&r++}),{nonZeroColumns:i,zeroEncounters:r}}getGroupIndex(t){const e=this.w,s=e.labelData.seriesGroups.findIndex(s=>s.indexOf(e.seriesData.seriesNames[t])>-1),a=this.barCtx.columnGroupIndices;let i=a.indexOf(s);return i<0&&(a.push(s),i=a.length-1),{groupIndex:s,columnGroupIndex:i}}}const y=b.__apex_CoreUtils,m=b.__apex_Filters,C=b.__apex_Animations_computeStagger,w=b.__apex_BrowserAPIs_BrowserAPIs,P=b.__apex_Environment_Environment;function I(t){var e;const s=t.config.chart.animations;if(!s||!1===s.enabled)return!1;if(!s.dynamicAnimation||!1===s.dynamicAnimation.enabled)return!1;const a=null!=(e=s.largeDatasetThreshold)?e:0;return!(a>0&&t.globals.dataPoints>a)&&!!(P.isBrowser()&&t.globals.dataChanged&&t.globals.shouldAnimate)}function H(t,e,s){var a,i,r,o;if(null==(a=t.axisFlags)?void 0:a.isXNumeric){const a=null==(r=null==(i=t.seriesData)?void 0:i.seriesX)?void 0:r[e];if(a&&a.length&&null!=a[s])return"x:"+a[s]}const l=null==(o=t.globals.labels)?void 0:o[s];return null!=l&&""!==String(l)?"c:"+(Array.isArray(l)?l.join(" "):String(l)):"j:"+s}function R({w:t,elSeries:e,record:s,newKeys:a,isHorizontal:i,speed:r}){var o;if(!I(t))return;if(!s||!Array.isArray(s.paths)||!(null==e?void 0:e.node))return;const l=new Set(a),n=s.paths.filter(t=>t&&t.d&&null!=t.key&&!l.has(t.key));if(!n.length)return;const h=new g(t),d=null==(o=t.globals.colors)?void 0:o[parseInt(String(s.realIndex),10)];n.forEach(s=>{let a=s.fill||d||"#c8c8c8";0===String(a).indexOf("url(")&&(a=d||"#c8c8c8");const o=h.drawPath({d:s.d,stroke:"none",strokeWidth:0,fill:a,fillOpacity:1,classes:"apexcharts-bar-ghost"}),l=o.node;l.setAttribute("pointer-events","none"),o.attr("clip-path",`url(#gridRectBarMask${t.globals.cuid})`),e.node.insertBefore(l,e.node.firstChild);const n=function(t){const e=/^M\s*([+-]?[\d.eE]+)[\s,]+([+-]?[\d.eE]+)/.exec(t||"");if(!e)return null;const s=parseFloat(e[1]),a=parseFloat(e[2]);return isFinite(s)&&isFinite(a)?{x:s,y:a}:null}(s.d);let b=i?"left center":"center bottom";try{const t=l.getBBox();n&&t&&(b=i?Math.abs(n.x-t.x)<=Math.abs(n.x-(t.x+t.width))?"left center":"right center":Math.abs(n.y-(t.y+t.height))<=Math.abs(n.y-t.y)?"center bottom":"center top")}catch(t){}const g=l.style;g.transformBox="fill-box",g.transformOrigin=b;const c=Math.max(1,r||1),p=performance.now(),u=e=>{if(t.globals.isDestroyed||!l.parentNode)return;const s=Math.max(0,Math.min(1,(e-p)/c)),a=1-Math.pow(1-s,3),r=1-a;g.transform=i?`scaleX(${r})`:`scaleY(${r})`,g.opacity=String(1-a),s<1?w.requestAnimationFrame(u):l.parentNode.removeChild(l)};w.requestAnimationFrame(u)})}class k{constructor(t,e,s){this.ctx=e,this.w=t,this.barOptions=t.config.plotOptions.bar,this.isHorizontal=this.barOptions.horizontal,this.strokeWidth=t.config.stroke.width,this.isNullValue=!1,this.isRangeBar=t.rangeData.seriesRange.length&&this.isHorizontal,this.isVerticalGroupedRangeBar=!t.globals.isBarHorizontal&&t.rangeData.seriesRange.length&&t.config.plotOptions.bar.rangeBarGroupRows,this.isFunnel=this.barOptions.isFunnel,this.isPyramid=this.barOptions.isPyramid,this.pyramidLayout=null,this.xyRatios=s,this.xRatio=0,this.yRatio=[],this.invertedXRatio=0,this.invertedYRatio=0,this.baseLineY=[],this.baseLineInvertedY=0,null!==this.xyRatios&&(this.xRatio=s.xRatio,this.yRatio=s.yRatio,this.invertedXRatio=s.invertedXRatio,this.invertedYRatio=s.invertedYRatio,this.baseLineY=s.baseLineY,this.baseLineInvertedY=s.baseLineInvertedY),this.yaxisIndex=0,this.translationsIndex=0,this.seriesLen=0,this.pathArr=[],this._prevKeyed=null,this._ltCache=null,this.series=[],this.elSeries=null,this.visibleI=0,this.isReversed=!1;const a=new u(this.w);this.lastActiveBarSerieIndex=a.getActiveConfigSeriesIndex("desc",["bar","column"]),this.columnGroupIndices=[];const i=a.getBarSeriesIndices(),r=new y(this.w);this.stackedSeriesTotals=r.getStackedSeriesTotals(this.w.config.series.map((t,e)=>-1===i.indexOf(e)?e:-1).filter(t=>-1!==t)),this.barHelpers=new v(this)}draw(t,e){var s,a;const i=this.w,r=new g(this.w),o=new y(this.w);t=o.getLogSeries(t),this.series=t,this.yRatio=o.getLogYRatios(this.yRatio),this.barHelpers.initVariables(t);const h=r.group({class:"apexcharts-bar-series apexcharts-plot-series"});i.config.dataLabels.enabled&&(this.totalItems,this.barOptions.dataLabels.maxItems);for(let o=0,d=0;o<t.length;o++,d++){let b,g;const c=[],p=[],x=i.globals.comboCharts?e[o]:o,{columnGroupIndex:v}=this.barHelpers.getGroupIndex(x),y=r.group({class:"apexcharts-series",rel:o+1,seriesName:f.escapeString(i.seriesData.seriesNames[x]),"data:realIndex":x});u.addCollapsedClassToSeries(this.w,y,x),t[o].length>0&&(this.visibleI=this.visibleI+1),this.yRatio.length>1&&(this.yaxisIndex=i.globals.seriesYAxisReverseMap[x],this.translationsIndex=x);const C=this.translationsIndex;this.isReversed=i.config.yaxis[this.yaxisIndex]&&i.config.yaxis[this.yaxisIndex].reversed,this.isPyramid&&(this.pyramidLayout=this.barHelpers.computePyramidLayout(t[o]));const w=this.barHelpers.initialPositions(x),{y:P,yDivision:I,zeroW:k,x:W,xDivision:L,zeroH:D}=w;let X=w.barHeight,F=w.barWidth;g=P,b=W,this.isHorizontal||p.push(b+(null!=F?F:0)/2);const O=r.group({class:"apexcharts-datalabels","data:realIndex":x});i.globals.delayedElements.push({el:O.node,holdUntilComplete:this.isLengthTransition(x)}),O.node.classList.add("apexcharts-element-hidden");const A=r.group({class:"apexcharts-bar-goals-markers"}),Y=r.group({class:"apexcharts-bar-shadows"});i.globals.delayedElements.push({el:Y.node}),Y.node.classList.add("apexcharts-element-hidden");for(let e=0;e<t[o].length;e++){const r=this.barHelpers.getStrokeWidth(o,e,x);let h=null;const u={indexes:{i:o,j:e,realIndex:x,translationsIndex:C,bc:d},x:b,y:g,strokeWidth:r,elSeries:y};this.isHorizontal?(h=this.drawBarPaths(n(l({},u),{barHeight:X,zeroW:k,yDivision:I})),F=this.series[o][e]/this.invertedYRatio):(h=this.drawColumnPaths(n(l({},u),{xDivision:L,barWidth:F,zeroH:D})),X=this.series[o][e]/this.yRatio[C]);const w=this.barHelpers.getPathFillColor(t,o,e,x);if(this.isFunnel&&!this.isPyramid&&this.barOptions.isFunnel3d&&"trapezoid"!==(null==(s=i.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:f.hexToRgba(i.globals.colors[o]),prevPaths:this.pathArr[this.pathArr.length-1],currPaths:h,realIndex:x,j:e});if(Y.add(t),i.config.chart.dropShadow.enabled){new m(this.w).dropShadow(t,i.config.chart.dropShadow,x)}}this.pathArr.push(h);const P=this.barHelpers.drawGoalLine({barXPosition:h.barXPosition,barYPosition:h.barYPosition,goalX:h.goalX,goalY:h.goalY,barHeight:X,barWidth:F});P&&A.add(P),g=h.y,b=h.x,e>0&&p.push(b+(null!=F?F:0)/2),c.push(g),this.renderSeries(n(l({realIndex:x,pathFill:w.color},w.useRangeColor?{lineFill:w.color}:{}),{j:e,i:o,columnGroupIndex:v,pathFrom:h.pathFrom,pathTo:h.pathTo,strokeWidth:r,elSeries:y,x:b,y:g,series:t,barHeight:Math.abs(h.barHeight?h.barHeight:X),barWidth:Math.abs(h.barWidth?h.barWidth:F),elDataLabelsWrap:O,elGoalsMarkers:A,elBarShadows:Y,visibleSeries:this.visibleI,type:"bar"}))}if(i.globals.seriesXvalues[x]=p,i.globals.seriesYvalues[x]=c,i.globals.previousPaths.length>0){const e=[];for(let s=0;s<t[o].length;s++)e.push(H(i,x,s));R({w:i,elSeries:y,record:this._prevRecord(x),newKeys:e,isHorizontal:this.isHorizontal,speed:i.config.chart.animations.dynamicAnimation.speed})}h.add(y)}return h}renderSeries({realIndex:t,pathFill:e,lineFill:s,j:a,i:i,columnGroupIndex:r,pathFrom:o,pathTo:l,strokeWidth:n,elSeries:h,x:d,y:b,y1:c,y2:u,series:x,barHeight:f,barWidth:v,barXPosition:y,barYPosition:w,elDataLabelsWrap:P,elGoalsMarkers:I,elBarShadows:R,visibleSeries:k,type:W,classes:L}){var D;const X=this.w,F=new g(this.w,this.ctx),O=function(t,e){const s=t&&t.renderer;return s&&s.kind&&"svg"!==s.kind?s:e}(this.ctx,F);let A=!1;if(h._bindingsDelegated||(h._bindingsDelegated=!0,F.setupEventDelegation(h,`.apexcharts-${W}-area`)),!s){let e=function(t){const e=X.config.stroke.colors;let s;return Array.isArray(e)&&e.length>0&&(s=e[t],s||(s=""),"function"==typeof s)?s({value:X.seriesData.series[t][a],dataPointIndex:a,w:X}):s};const i="function"==typeof X.globals.stroke.colors[t]?e(t):X.globals.stroke.colors[t];s=this.barOptions.distributed?X.globals.stroke.colors[a]:i}const Y=new p(this).handleBarDataLabels({x:d,y:b,y1:c,y2:u,i:i,j:a,series:x,realIndex:t,columnGroupIndex:r,barHeight:f,barWidth:v,barXPosition:y,barYPosition:w,visibleSeries:k});X.globals.isBarHorizontal||(Y.dataLabelsPos.dataLabelsX+Math.max(v,X.globals.barPadForNumericAxis)<0||Y.dataLabelsPos.dataLabelsX-Math.max(v,X.globals.barPadForNumericAxis)>X.layout.gridWidth)&&(A=!0),X.config.series[i].data[a]&&X.config.series[i].data[a].strokeColor&&(s=X.config.series[i].data[a].strokeColor),this.isNullValue&&(e="none");const S=X.config.chart.animations,j=S.animateGradually;let B=0;if(j&&!1!==j.enabled&&!(X.globals.dataChanged&&this.isLengthTransition(t))){const t=X.globals.dataPoints||1,e=j.delay||0,s=Math.min(e,.5*S.speed/Math.max(1,t));let r=C({style:"sequential",index:a,baseDelay:s});X.config.chart.stacked&&(r+=i*s*.5);B=r/(e||1)}if(!A){const r=!0===(null==(D=this.ctx.morphTypeChange)?void 0:D.isActive())?this.ctx.morphTypeChange.getSpeed():X.config.chart.animations.dynamicAnimation.speed,d=O.renderPaths({i:i,j:a,realIndex:t,pathFrom:o,pathTo:l,stroke:s,strokeWidth:n,strokeLineCap:X.config.stroke.lineCap,fill:e,animationDelay:B,initialSpeed:X.config.chart.animations.speed,dataChangeSpeed:r,className:`apexcharts-${W}-area ${L}`,chartType:W,bindEventsOnPaths:!1});d.attr("clip-path",`url(#gridRectBarMask${X.globals.cuid})`);const b=X.config.forecastDataPoints;b.count>0&&a>=X.globals.dataPoints-b.count&&(d.node.setAttribute("stroke-dasharray",b.dashArray),d.node.setAttribute("stroke-width",b.strokeWidth),d.node.setAttribute("fill-opacity",b.fillOpacity)),void 0!==c&&void 0!==u&&(d.attr("data-range-y1",c),d.attr("data-range-y2",u));new m(this.w).setSelectionFilter(d,t,a),h.add(d),d.attr({cy:Y.dataLabelsPos.bcy,cx:Y.dataLabelsPos.bcx,j:a,val:X.seriesData.series[i][a],barHeight:f,barWidth:v,"data:pathKey":H(X,t,a)}),"canvas"===O.kind&&(X.globals.barCanvasCoords||(X.globals.barCanvasCoords={}),X.globals.barCanvasCoords[t]||(X.globals.barCanvasCoords[t]={}),X.globals.barCanvasCoords[t][a]={cx:Y.dataLabelsPos.bcx,cy:Y.dataLabelsPos.bcy,barWidth:v}),null!==Y.dataLabels&&P.add(Y.dataLabels),Y.totalDataLabels&&P.add(Y.totalDataLabels),h.add(P),I&&h.add(I),R&&h.add(R)}return h}drawBarPaths({indexes:t,barHeight:e,strokeWidth:s,zeroW:a,x:i,y:r,yDivision:o,elSeries:l}){const n=this.w,h=t.i,d=t.j;let b;if(n.axisFlags.isXNumeric)b=(r=(n.seriesData.seriesX[h][d]-n.globals.minX)/this.invertedXRatio-e)+e*this.visibleI;else if(n.config.plotOptions.bar.hideZeroBarsWhenGrouped){const{nonZeroColumns:t,zeroEncounters:s}=this.barHelpers.getZeroValueEncounters({i:h,j:d});t>0&&(e=this.seriesLen*e/t),b=r+e*this.visibleI,b-=e*s}else b=r+e*this.visibleI;const g=this.isFunnel&&"trapezoid"===n.config.plotOptions.funnel.shape,c=this.isPyramid&&this.pyramidLayout?this.pyramidLayout[d]:null,p=!!c;if(c)b=c.y,e=c.height;else if(this.isFunnel&&!g){const t=null!=a?a:0;a=t-(this.barHelpers.getXForValue(this.series[h][d],t)-t)/2}let u;return i=this.barHelpers.getXForValue(this.series[h][d],null!=a?a:0),u=c?this.barHelpers.getPyramidPaths({barYPosition:b,barHeight:e,topHalf:c.topHalf,bottomHalf:c.bottomHalf,realIndex:t.realIndex,j:d,strokeWidth:s,w:n}):g?this.barHelpers.getFunnelTrapezoidPaths({barYPosition:b,barHeight:e,series:this.series,i:h,j:d,realIndex:t.realIndex,strokeWidth:s,w:n}):this.barHelpers.getBarpaths({barYPosition:b,barHeight:e,x1:a,x2:i,strokeWidth:s,isReversed:this.isReversed,series:this.series,realIndex:t.realIndex,i:h,j:d,w:n}),(g||p)&&(a=u.x1,i=u.x),n.axisFlags.isXNumeric||p||(r+=o),p&&(r=b),this.barHelpers.barBackground({j:d,i:h,y1:b-e*this.visibleI,y2:e*this.seriesLen,elSeries:l}),{pathTo:u.pathTo,pathFrom:u.pathFrom,x1:a,x:i,y:r,goalX:this.barHelpers.getGoalValues("x",a,null,h,d,0),barYPosition:b,barHeight:e}}drawColumnPaths({indexes:t,x:e,y:s,xDivision:a,barWidth:i,zeroH:r,strokeWidth:o,elSeries:l}){const n=this.w,h=t.realIndex,d=t.translationsIndex,b=t.i,g=t.j,c=t.bc;let p;if(n.axisFlags.isXNumeric){const t=this.getBarXForNumericXAxis({x:e,j:g,realIndex:h,barWidth:i});e=t.x,p=t.barXPosition}else if(n.config.plotOptions.bar.hideZeroBarsWhenGrouped){const{nonZeroColumns:t,zeroEncounters:s}=this.barHelpers.getZeroValueEncounters({i:b,j:g});t>0&&(i=this.seriesLen*i/t),p=e+i*this.visibleI,p-=i*s}else p=e+i*this.visibleI;s=this.barHelpers.getYForValue(this.series[b][g],r,d);const u=this.barHelpers.getColumnPaths({barXPosition:p,barWidth:i,y1:r,y2:s,strokeWidth:o,isReversed:this.isReversed,series:this.series,realIndex:h,i:b,j:g,w:n});return n.axisFlags.isXNumeric||(e+=a),this.barHelpers.barBackground({bc:c,j:g,i:b,x1:p-o/2-i*this.visibleI,x2:i*this.seriesLen+o/2,elSeries:l}),{pathTo:u.pathTo,pathFrom:u.pathFrom,x:e,y:s,goalY:this.barHelpers.getGoalValues("y",null,r,b,g,d),barXPosition:p,barWidth:i}}getBarXForNumericXAxis({x:t,barWidth:e,realIndex:s,j:a}){const i=this.w;let r=s;return i.seriesData.seriesX[s].length||(r=i.globals.maxValsInArrayIndex),f.isNumber(i.seriesData.seriesX[r][a])&&(t=(i.seriesData.seriesX[r][a]-i.globals.minX)/this.xRatio-e*this.seriesLen/2),{barXPosition:t+e*this.visibleI,x:t}}_prevRecord(t){const e=this.w;let s=null;for(let a=0;a<e.globals.previousPaths.length;a++){const i=e.globals.previousPaths[a];i.paths&&i.paths.length>0&&parseInt(i.realIndex,10)===parseInt(String(t),10)&&(s=i)}return s}_prevKeyedPaths(t){if(this._prevKeyed||(this._prevKeyed={}),void 0!==this._prevKeyed[t])return this._prevKeyed[t];const e=this._prevRecord(t);let s=null;if(e&&e.paths.every(t=>null!=t.key)){const t=new Map;e.paths.forEach(e=>{t.set(e.key,e)}),s=t}return this._prevKeyed[t]=s,s}isLengthTransition(t){var e,s;if(this._ltCache||(this._ltCache={}),void 0!==this._ltCache[t])return this._ltCache[t];const a=this.w;let i=!1;if(I(a)&&a.globals.previousPaths.length>0){const r=this._prevRecord(t),o=null!=(s=null==(e=a.seriesData.series[t])?void 0:e.length)?s:0;if(r)if(r.paths.length!==o)i=!0;else{const e=this._prevKeyedPaths(t);if(e)for(let s=0;s<o;s++)if(!e.has(H(a,t,s))){i=!0;break}}else i=o>0}return this._ltCache[t]=i,i}getPreviousPath(t,e,s){const a=this.w,i=this._prevRecord(t);if(!i)return I(a)?null:s;let r=null,o=!1;const l=this._prevKeyedPaths(t);if(l){const s=l.get(H(a,t,e));s?r=s.d:o=!0}else void 0!==i.paths[e]?r=i.paths[e].d:o=!0;return r&&k.pathCommandCount(r)===k.pathCommandCount(s)?r:o&&I(a)?null:s}static pathCommandCount(t){if(!t)return 0;const e=t.match(/[A-Za-z]/g);return e?e.length:0}}h.use({bar:k,column:k,barStacked:class extends k{draw(t,e){const s=this.w;this.graphics=new g(this.w),this.bar=new k(this.w,this.ctx,this.xyRatios);const a=new y(this.w);t=a.getLogSeries(t),this.yRatio=a.getLogYRatios(this.yRatio),this.barHelpers.initVariables(t),"100%"===s.config.chart.stackType&&(t=s.globals.comboCharts?e.map(t=>s.globals.seriesPercent[t]):s.globals.seriesPercent.slice()),this.series=t,this.barHelpers.initializeStackedPrevVars(this);const i=this.graphics.group({class:"apexcharts-bar-series apexcharts-plot-series"});let r=0,o=0;for(let a=0,h=0;a<t.length;a++,h++){const d=s.globals.comboCharts?e[a]:a,{groupIndex:b,columnGroupIndex:g}=this.barHelpers.getGroupIndex(d);this.groupCtx=this[s.labelData.seriesGroups[b]];const c=[],p=[];let x=0;this.yRatio.length>1&&(this.yaxisIndex=s.globals.seriesYAxisReverseMap[d][0],x=d),this.isReversed=s.config.yaxis[this.yaxisIndex]&&s.config.yaxis[this.yaxisIndex].reversed;let v=this.graphics.group({class:"apexcharts-series",seriesName:f.escapeString(s.seriesData.seriesNames[d]),rel:a+1,"data:realIndex":d});u.addCollapsedClassToSeries(this.w,v,d);const y=this.graphics.group({class:"apexcharts-datalabels","data:realIndex":d}),m=this.graphics.group({class:"apexcharts-bar-goals-markers"}),C=this.initialPositions(r,o,void 0,void 0,void 0,void 0,x),{xDivision:w,yDivision:P,zeroH:I,zeroW:H}=C;let R=C.barHeight,k=C.barWidth;o=C.y,r=C.x,s.globals.barHeight=R,s.globals.barWidth=k,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(()=>I),this.groupCtx.prevYF[0]=this.groupCtx.prevYF[0].map(()=>0));for(let e=0;e<s.globals.dataPoints;e++){const i=this.barHelpers.getStrokeWidth(a,e,d),u={indexes:{i:a,j:e,realIndex:d,translationsIndex:x,bc:h},strokeWidth:i,x:r,y:o,elSeries:v,columnGroupIndex:g,seriesGroup:s.labelData.seriesGroups[b]};let f=null;this.isHorizontal?(f=this.drawStackedBarPaths(n(l({},u),{zeroW:H,barHeight:R,yDivision:P})),k=this.series[a][e]/this.invertedYRatio):(f=this.drawStackedColumnPaths(n(l({},u),{xDivision:w,barWidth:k,zeroH:I})),R=this.series[a][e]/this.yRatio[x]);const C=this.barHelpers.drawGoalLine({barXPosition:f.barXPosition,barYPosition:f.barYPosition,goalX:f.goalX,goalY:f.goalY,barHeight:R,barWidth:k});C&&m.add(C),o=f.y,r=f.x,c.push(r),p.push(o);const W=this.barHelpers.getPathFillColor(t,a,e,d);let L="";const D=s.globals.isBarHorizontal?"apexcharts-flip-x":"apexcharts-flip-y";("bottom"===this.barHelpers.arrBorderRadius[d][e]&&s.seriesData.series[d][e]>0||"top"===this.barHelpers.arrBorderRadius[d][e]&&s.seriesData.series[d][e]<0)&&(L=D),v=this.renderSeries(n(l({realIndex:d,pathFill:W.color},W.useRangeColor?{lineFill:W.color}:{}),{j:e,i:a,columnGroupIndex:g,pathFrom:f.pathFrom,pathTo:f.pathTo,strokeWidth:i,elSeries:v,x:r,y:o,series:t,barHeight:R,barWidth:k,elDataLabelsWrap:y,elGoalsMarkers:m,type:"bar",visibleSeries:g,classes:L}))}s.globals.seriesXvalues[d]=c,s.globals.seriesYvalues[d]=p,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),i.add(v)}return i}initialPositions(t,e,s,a,i,r,o){const l=this.w;let n,h;if(this.isHorizontal){a=l.layout.gridHeight/l.globals.dataPoints;const t=l.config.plotOptions.bar.barHeight;n=-1===String(t).indexOf("%")?parseInt(t,10):a*parseInt(t,10)/100,r=l.globals.padHorizontal+(this.isReversed?l.layout.gridWidth-this.baseLineInvertedY:this.baseLineInvertedY),e=(a-n)/2}else{h=s=l.layout.gridWidth/l.globals.dataPoints;const e=l.config.plotOptions.bar.columnWidth;l.axisFlags.isXNumeric&&l.globals.dataPoints>1?h=(s=l.globals.minXDiff/this.xRatio)*parseInt(this.barOptions.columnWidth,10)/100:-1===String(e).indexOf("%")?h=parseInt(e,10):h*=parseInt(e,10)/100,i=this.isReversed?this.baseLineY[o]:l.layout.gridHeight-this.baseLineY[o],t=l.globals.padHorizontal+(s-h)/2}const d=l.globals.barGroups.length||1;return{x:t,y:e,yDivision:a,xDivision:s,barHeight:(null!=n?n:0)/d,barWidth:(null!=h?h:0)/d,zeroH:i,zeroW:r}}drawStackedBarPaths({indexes:t,barHeight:e,strokeWidth:s,zeroW:a,x:i,y:r,columnGroupIndex:o,seriesGroup:l,yDivision:n,elSeries:h}){var d,b,g,c,p;const u=this.w,x=r+o*e;let f;const v=t.i,y=t.j,m=t.realIndex,C=t.translationsIndex;let w=0;for(let t=0;t<this.groupCtx.prevXF.length;t++)w+=this.groupCtx.prevXF[t][y];let P=v;if(u.config.series[m].name&&(P=l.indexOf(u.config.series[m].name)),P>0){let t=a;this.groupCtx.prevXVal[P-1][y]<0?t=(null==(d=this.series[v])?void 0:d[y])>=0?this.groupCtx.prevX[P-1][y]+w-2*(this.isReversed?w:0):this.groupCtx.prevX[P-1][y]:this.groupCtx.prevXVal[P-1][y]>=0&&(t=(null==(b=this.series[v])?void 0:b[y])>=0?this.groupCtx.prevX[P-1][y]:this.groupCtx.prevX[P-1][y]-w+2*(this.isReversed?w:0)),f=t}else f=a;i=null===(null==(g=this.series[v])?void 0:g[y])?f:f+(null==(c=this.series[v])?void 0:c[y])/this.invertedYRatio-2*(this.isReversed?(null==(p=this.series[v])?void 0:p[y])/this.invertedYRatio:0);const I=this.barHelpers.getBarpaths({barYPosition:x,barHeight:e,x1:f,x2:i,strokeWidth:s,isReversed:this.isReversed,series:this.series,realIndex:t.realIndex,seriesGroup:l,i:v,j:y,w:u});return this.barHelpers.barBackground({j:y,i:v,y1:x,y2:e,elSeries:h}),r+=n,{pathTo:I.pathTo,pathFrom:I.pathFrom,goalX:this.barHelpers.getGoalValues("x",a,null,v,y,C),barXPosition:f,barYPosition:x,x:i,y:r}}drawStackedColumnPaths({indexes:t,x:e,y:s,xDivision:a,barWidth:i,zeroH:r,columnGroupIndex:o,seriesGroup:l,elSeries:n}){var h,d,b,g,c,p,u,x,f;const v=this.w,y=t.i,m=t.j,C=t.bc,w=t.realIndex,P=t.translationsIndex;if(v.axisFlags.isXNumeric){let t=v.seriesData.seriesX[w][m];t||(t=0),e=(t-v.globals.minX)/this.xRatio-i/2*v.globals.barGroups.length}const I=e+o*i;let H,R=0;for(let t=0;t<this.groupCtx.prevYF.length;t++)R+=isNaN(this.groupCtx.prevYF[t][m])?0:this.groupCtx.prevYF[t][m];let k=y;if(l&&(k=l.indexOf(v.seriesData.seriesNames[w])),k>0&&!v.axisFlags.isXNumeric||k>0&&v.axisFlags.isXNumeric&&v.seriesData.seriesX[w-1][m]===v.seriesData.seriesX[w][m]){let t,e;const s=Math.min(this.yRatio.length+1,w+1);if(void 0!==this.groupCtx.prevY[k-1]&&this.groupCtx.prevY[k-1].length)for(let t=1;t<s;t++)if(!isNaN(null==(h=this.groupCtx.prevY[k-t])?void 0:h[m])){e=this.groupCtx.prevY[k-t][m];break}for(let a=1;a<s;a++){if((null==(d=this.groupCtx.prevYVal[k-a])?void 0:d[m])<0){t=(null==(b=this.series[y])?void 0:b[m])>=0?e-R+2*(this.isReversed?R:0):e;break}if((null==(g=this.groupCtx.prevYVal[k-a])?void 0:g[m])>=0){t=(null==(c=this.series[y])?void 0:c[m])>=0?e:e+R-2*(this.isReversed?R:0);break}}void 0===t&&(t=v.layout.gridHeight),H=(null==(p=this.groupCtx.prevYF[0])?void 0:p.every(t=>0===t))&&this.groupCtx.prevYF.slice(1,k).every(t=>t.every(t=>isNaN(t)))?r:t}else H=r;s=(null==(u=this.series[y])?void 0:u[m])?H-(null==(x=this.series[y])?void 0:x[m])/this.yRatio[P]+2*(this.isReversed?(null==(f=this.series[y])?void 0:f[m])/this.yRatio[P]:0):H;const W=this.barHelpers.getColumnPaths({barXPosition:I,barWidth:i,y1:H,y2:s,yRatio:this.yRatio[P],strokeWidth:this.strokeWidth,isReversed:this.isReversed,series:this.series,seriesGroup:l,realIndex:t.realIndex,i:y,j:m,w:v});return this.barHelpers.barBackground({bc:C,j:m,i:y,x1:I,x2:i,elSeries:n}),{pathTo:W.pathTo,pathFrom:W.pathFrom,goalY:this.barHelpers.getGoalValues("y",null,r,y,m,0),barXPosition:I,x:v.axisFlags.isXNumeric?e:e+a,y:s}}},rangeBar:class extends k{draw(t,e){var s,a,i,r,o,n,h,d,b;const c=this.w,p=new g(this.w);this.rangeBarOptions=this.w.config.plotOptions.rangeBar,this.series=t,this.seriesRangeStart=c.rangeData.seriesRangeStart,this.seriesRangeEnd=c.rangeData.seriesRangeEnd,this.barHelpers.initVariables(t);const x=p.group({class:"apexcharts-rangebar-series apexcharts-plot-series"});for(let g=0;g<t.length;g++){let v,y;const m=c.globals.comboCharts?e[g]:g,{columnGroupIndex:C}=this.barHelpers.getGroupIndex(m),w=p.group({class:"apexcharts-series",seriesName:f.escapeString(c.seriesData.seriesNames[m]),rel:g+1,"data:realIndex":m});u.addCollapsedClassToSeries(this.w,w,m),t[g].length>0&&(this.visibleI=this.visibleI+1);let P=0;this.yRatio.length>1&&(this.yaxisIndex=c.globals.seriesYAxisReverseMap[m][0],P=m);const I=this.barHelpers.initialPositions(m),{y:H,zeroW:R,x:k,zeroH:W}=I;let L=null!=(s=I.barWidth)?s:0,D=null!=(a=I.barHeight)?a:0;const X=null!=(i=I.yDivision)?i:0,F=null!=(r=I.xDivision)?r:0;y=H,v=k;const O=p.group({class:"apexcharts-datalabels","data:realIndex":m}),A=p.group({class:"apexcharts-rangebar-goals-markers"});for(let e=0;e<c.globals.dataPoints;e++){const s=this.barHelpers.getStrokeWidth(g,e,m),a=this.seriesRangeStart[g][e],i=this.seriesRangeEnd[g][e];let r=null,p=null,u=null;const x={x:v,y:y,strokeWidth:s,elSeries:w};let f=this.seriesLen;if(c.config.plotOptions.bar.rangeBarGroupRows&&(f=1),void 0===(null==(o=c.config.series[g].data)?void 0:o[e]))break;if(this.isHorizontal){u=y+D*this.visibleI;const t=(X-D*f)/2;if(null==(h=null==(n=c.config.series[g].data)?void 0:n[e])?void 0:h.x){const s=this.detectOverlappingBars({i:g,j:e,barYPosition:u,srty:t,barHeight:D,yDivision:X,initPositions:I});D=s.barHeight,u=s.barYPosition}r=this.drawRangeBarPaths(l({indexes:{i:g,j:e,realIndex:m},barHeight:D,barYPosition:u,zeroW:R,yDivision:X,y1:a,y2:i},x)),L=r.barWidth}else{c.axisFlags.isXNumeric&&(v=(c.seriesData.seriesX[g][e]-c.globals.minX)/this.xRatio-L/2),p=v+L*this.visibleI;const t=(F-L*f)/2;if(null==(b=null==(d=c.config.series[g].data)?void 0:d[e])?void 0:b.x){const s=this.detectOverlappingBars({i:g,j:e,barXPosition:p,srtx:t,barWidth:L,xDivision:F,initPositions:I});L=s.barWidth,p=s.barXPosition}r=this.drawRangeColumnPaths(l({indexes:{i:g,j:e,realIndex:m,translationsIndex:P},barWidth:L,barXPosition:p,zeroH:W,xDivision:F},x)),D=r.barHeight}const H=this.barHelpers.drawGoalLine({barXPosition:r.barXPosition,barYPosition:u,goalX:r.goalX,goalY:r.goalY,barHeight:D,barWidth:L});H&&A.add(H),y=r.y,v=r.x;const k=this.barHelpers.getPathFillColor(t,g,e,m);this.renderSeries({realIndex:m,pathFill:k.color,lineFill:k.useRangeColor?k.color:c.globals.stroke.colors[m],j:e,i:g,x:v,y:y,y1:a,y2:i,pathFrom:r.pathFrom,pathTo:r.pathTo,strokeWidth:s,elSeries:w,series:t,barHeight:D,barWidth:L,barXPosition:p,barYPosition:u,columnGroupIndex:C,elDataLabelsWrap:O,elGoalsMarkers:A,visibleSeries:this.visibleI,type:"rangebar"})}x.add(w)}return x}detectOverlappingBars({i:t,j:e,barYPosition:s,barXPosition:a,srty:i,srtx:r,barHeight:o,barWidth:l,yDivision:n,xDivision:h,initPositions:d}){var b,g,c,p;const u=this.w;let x=[];const f=null==(g=null==(b=u.config.series[t].data)?void 0:b[e])?void 0:g.rangeName,v=null==(p=null==(c=u.config.series[t].data)?void 0:c[e])?void 0:p.x,y=Array.isArray(v)?v.join(" "):v,m=u.labelData.labels.map(t=>Array.isArray(t)?t.join(" "):t).indexOf(y),C=u.rangeData.seriesRange[t].findIndex(t=>{var e;return t.x===y&&(null==(e=t.overlaps)?void 0:e.size)>0});return this.isHorizontal?(s=u.config.plotOptions.bar.rangeBarGroupRows?i+n*m:i+o*this.visibleI+n*m,C>-1&&!u.config.plotOptions.bar.rangeBarOverlap&&(x=Array.from(u.rangeData.seriesRange[t][C].overlaps),x.indexOf(f)>-1&&(s=(o=d.barHeight/x.length)*this.visibleI+n*(100-parseInt(this.barOptions.barHeight,10))/100/2+o*(this.visibleI+x.indexOf(f))+n*m))):(m>-1&&!u.labelData.timescaleLabels.length&&(a=u.config.plotOptions.bar.rangeBarGroupRows?r+h*m:r+l*this.visibleI+h*m),C>-1&&!u.config.plotOptions.bar.rangeBarOverlap&&(x=Array.from(u.rangeData.seriesRange[t][C].overlaps),x.indexOf(f)>-1&&(a=(l=d.barWidth/x.length)*this.visibleI+h*(100-parseInt(this.barOptions.barWidth,10))/100/2+l*(this.visibleI+x.indexOf(f))+h*m))),{barYPosition:s,barXPosition:a,barHeight:o,barWidth:l}}drawRangeColumnPaths({indexes:t,x:e,xDivision:s,barWidth:a,barXPosition:i,zeroH:r}){var o,l;const n=this.w,{i:h,j:d,realIndex:b,translationsIndex:g}=t,c=this.yRatio[g],p=this.getRangeValue(b,d);let u=Math.min(p.start,p.end),x=Math.max(p.start,p.end);void 0===(null==(o=this.series[h])?void 0:o[d])||null===(null==(l=this.series[h])?void 0:l[d])?u=r:(u=r-u/c,x=r-x/c);const f=Math.abs(x-u),v=this.barHelpers.getColumnPaths({barXPosition:i,barWidth:a,y1:u,y2:x,strokeWidth:this.strokeWidth,series:this.seriesRangeEnd,realIndex:b,i:b,j:d,w:n});if(n.axisFlags.isXNumeric){const t=this.getBarXForNumericXAxis({x:e,j:d,realIndex:b,barWidth:a});e=t.x,i=t.barXPosition}else e+=s;return{pathTo:v.pathTo,pathFrom:v.pathFrom,barHeight:f,x:e,y:p.start<0&&p.end<0?u:x,goalY:this.barHelpers.getGoalValues("y",null,r,h,d,g),barXPosition:i}}preventBarOverflow(t){const e=this.w;return t<0&&(t=0),t>e.layout.gridWidth&&(t=e.layout.gridWidth),t}drawRangeBarPaths({indexes:t,y:e,y1:s,y2:a,yDivision:i,barHeight:r,barYPosition:o,zeroW:l}){const n=this.w,{realIndex:h,j:d}=t,b=this.preventBarOverflow(l+s/this.invertedYRatio),g=this.preventBarOverflow(l+a/this.invertedYRatio),c=this.getRangeValue(h,d),p=Math.abs(g-b),u=this.barHelpers.getBarpaths({barYPosition:o,barHeight:r,x1:b,x2:g,strokeWidth:this.strokeWidth,series:this.seriesRangeEnd,i:h,realIndex:h,j:d,w:n});return n.axisFlags.isXNumeric||(e+=i),{pathTo:u.pathTo,pathFrom:u.pathFrom,barWidth:p,x:c.start<0&&c.end<0?b:g,goalX:this.barHelpers.getGoalValues("x",l,null,h,d,0),y:e}}getRangeValue(t,e){const s=this.w;return{start:s.rangeData.seriesRangeStart[t][e],end:s.rangeData.seriesRangeEnd[t][e]}}}}),exports.default=h;
|
package/dist/bar.esm.js
CHANGED
package/dist/boxPlot.common.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* ApexCharts v6.
|
|
2
|
+
* ApexCharts v6.3.0
|
|
3
3
|
* (c) 2018-2026 ApexCharts
|
|
4
4
|
*/
|
|
5
5
|
"use strict";var t=Object.defineProperty,e=Object.defineProperties,s=Object.getOwnPropertyDescriptors,a=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable,o=(e,s,a)=>s in e?t(e,s,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[s]=a,l=(t,e)=>{for(var s in e||(e={}))i.call(e,s)&&o(t,s,e[s]);if(a)for(var s of a(e))r.call(e,s)&&o(t,s,e[s]);return t},n=(t,a)=>e(t,s(a));Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const h=require("apexcharts/core");function d(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t)for(const s in t)if("default"!==s){const a=Object.getOwnPropertyDescriptor(t,s);Object.defineProperty(e,s,a.get?a:{enumerable:!0,get:()=>t[s]})}return e.default=t,Object.freeze(e)}const c=d(h),b=c.__apex_CoreUtils,g=c.__apex_Graphics,u=c.__apex_DataLabels;class p{constructor(t){this.w=t.w,this.barCtx=t,this.totalFormatter=this.w.config.plotOptions.bar.dataLabels.total.formatter,this.totalFormatter||(this.totalFormatter=this.w.config.dataLabels.formatter)}handleBarDataLabels(t){const{x:e,y:s,y1:a,y2:i,i:r,j:o,realIndex:h,columnGroupIndex:d,series:c,barHeight:b,barWidth:u,barXPosition:p,barYPosition:x,visibleSeries:f}=t,y=this.w,m=new g(this.barCtx.w),v=Array.isArray(this.barCtx.strokeWidth)?this.barCtx.strokeWidth[h]:this.barCtx.strokeWidth;let C,w;y.axisFlags.isXNumeric&&!y.globals.isBarHorizontal?(C=e+u*(f+1),w=s+b*(f+1)-v):(C=e+u*f,w=s+b*f);let P=null,L=null,I=e,k=s,H={};const W=y.config.dataLabels,A=this.barCtx.barOptions.dataLabels,D=this.barCtx.barOptions.dataLabels.total;void 0!==x&&(this.barCtx.isRangeBar||this.barCtx.isPyramid)&&(w=x,k=x),void 0!==p&&this.barCtx.isVerticalGroupedRangeBar&&(C=p,I=p);const O=W.offsetX,R=W.offsetY;let X={width:0,height:0};if(y.config.dataLabels.enabled){const t=y.seriesData.series[r][o];X=m.getTextRects(y.config.dataLabels.formatter?y.config.dataLabels.formatter(t,n(l({},y),{seriesIndex:r,dataPointIndex:o,w:y})):y.formatters.yLabelFormatters[0](t),parseFloat(W.style.fontSize).toString())}const F={x:e,y:s,i:r,j:o,realIndex:h,columnGroupIndex:d,bcx:C,bcy:w,barHeight:b,barWidth:u,textRects:X,strokeWidth:v,dataLabelsX:I,dataLabelsY:k,dataLabelsConfig:W,barDataLabelsConfig:A,barTotalDataLabelsConfig:D,offX:O,offY:R};return H=this.barCtx.isHorizontal?this.calculateBarsDataLabelsPosition(F):this.calculateColumnsDataLabelsPosition(F),P=this.drawCalculatedDataLabels({x:H.dataLabelsX,y:H.dataLabelsY,val:this.barCtx.isRangeBar?[a,i]:"100%"===y.config.chart.stackType?c[h][o]:y.seriesData.series[h][o],i:h,j:o,barWidth:u,barHeight:b,textRects:X,dataLabelsConfig:W}),y.config.chart.stacked&&D.enabled&&(L=this.drawTotalDataLabels({x:H.totalDataLabelsX,y:H.totalDataLabelsY,barWidth:u,barHeight:b,realIndex:h,textAnchor:H.totalDataLabelsAnchor,val:this.getStackedTotalDataLabel({realIndex:h,j:o}),dataLabelsConfig:W,barTotalDataLabelsConfig:D})),{dataLabelsPos:H,dataLabels:P,totalDataLabels:L}}getStackedTotalDataLabel({realIndex:t,j:e}){const s=this.w;let a=this.barCtx.stackedSeriesTotals[e];return this.totalFormatter&&(a=this.totalFormatter(a,n(l({},s),{seriesIndex:t,dataPointIndex:e,w:s}))),a}calculateColumnsDataLabelsPosition(t){const e=this.w;let s,a,{i:i,j:r,realIndex:o,y:l,bcx:n,barWidth:h,barHeight:d,textRects:c,dataLabelsX:b,dataLabelsY:u,dataLabelsConfig:p,barDataLabelsConfig:x,barTotalDataLabelsConfig:f,strokeWidth:y,offX:m,offY:v}=t;const C=n;d=Math.abs(d);const w="vertical"===e.config.plotOptions.bar.dataLabels.orientation,{zeroEncounters:P}=this.barCtx.barHelpers.getZeroValueEncounters({i:i,j:r});n-=y/2;const L=e.layout.gridWidth/e.globals.dataPoints;if(this.barCtx.isVerticalGroupedRangeBar?b+=h/2:(b=e.axisFlags.isXNumeric?n-h/2+m:n-L+h/2+m,!e.config.chart.stacked&&P>0&&e.config.plotOptions.bar.hideZeroBarsWhenGrouped&&(b-=h*P)),w){const t=2;b=b+c.height/2-y/2-t}const I=e.seriesData.series[i][r]<0;let k=l;switch(this.barCtx.isReversed&&(k=l+(I?d:-d)),x.position){case"center":u=w?I?k-d/2+v:k+d/2-v:I?k-d/2+c.height/2+v:k+d/2+c.height/2-v;break;case"bottom":u=w?I?k-d+v:k+d-v:I?k-d+c.height+y+v:k+d-c.height/2+y-v;break;case"top":u=w?I?k+v:k-v:I?k-c.height/2-v:k+c.height+v}let H=k;if(e.labelData.seriesGroups.forEach(t=>{var e;null==(e=this.barCtx[t.join(",")])||e.prevY.forEach(t=>{H=I?Math.max(t[r],H):Math.min(t[r],H)})}),this.barCtx.lastActiveBarSerieIndex===o&&f.enabled){const t=18,i=new g(this.barCtx.w).getTextRects(this.getStackedTotalDataLabel({realIndex:o,j:r}),p.fontSize);s=I?H-i.height/2-v-f.offsetY+t:H+i.height+v+f.offsetY-t;const l=L;a=C+(e.axisFlags.isXNumeric?-h*e.globals.barGroups.length/2:e.globals.barGroups.length*h/2-(e.globals.barGroups.length-1)*h-l)+f.offsetX}return e.config.chart.stacked||(u<0?u=0+y:u+c.height/3>e.layout.gridHeight&&(u=e.layout.gridHeight-y)),{bcx:n,bcy:l,dataLabelsX:b,dataLabelsY:u,totalDataLabelsX:a,totalDataLabelsY:s,totalDataLabelsAnchor:"middle"}}calculateBarsDataLabelsPosition(t){var e;const s=this.w;let{x:a,i:i,j:r,realIndex:o,bcy:l,barHeight:n,barWidth:h,textRects:d,dataLabelsX:c,strokeWidth:b,dataLabelsConfig:u,barDataLabelsConfig:p,barTotalDataLabelsConfig:x,offX:f,offY:y}=t;const m=s.layout.gridHeight/s.globals.dataPoints,{zeroEncounters:v}=this.barCtx.barHelpers.getZeroValueEncounters({i:i,j:r});let C,w,P;if(h=Math.abs(h),this.barCtx.isPyramid){C=l+n/2+y-(null!=(e=d.centerOffset)?e:0)}else C=l-(this.barCtx.isRangeBar?0:m)+n/2+d.height/2+y-3;!s.config.chart.stacked&&v>0&&s.config.plotOptions.bar.hideZeroBarsWhenGrouped&&(C-=n*v);let L="start";const I=s.seriesData.series[i][r]<0;let k=a;if(this.barCtx.isReversed&&(k=a+(I?-h:h),L=I?"start":"end"),this.barCtx.isPyramid)c=s.layout.gridWidth/2+f;else switch(p.position){case"center":c=I?k+h/2-f:Math.max(d.width/2,k-h/2)+f;break;case"bottom":c=I?k+h-b-f:k-h+b+f;break;case"top":c=I?k-b-f:k-b+f}let H=k;if(s.labelData.seriesGroups.forEach(t=>{var e;null==(e=this.barCtx[t.join(",")])||e.prevX.forEach(t=>{H=I?Math.min(t[r],H):Math.max(t[r],H)})}),this.barCtx.lastActiveBarSerieIndex===o&&x.enabled){const t=new g(this.barCtx.w).getTextRects(this.getStackedTotalDataLabel({realIndex:o,j:r}),u.fontSize);I?(w=H-b-f-x.offsetX,L="end"):w=H+f+x.offsetX+(this.barCtx.isReversed?-(h+b):b),P=C-d.height/2+t.height/2+x.offsetY+b,s.globals.barGroups.length>1&&(P-=s.globals.barGroups.length/2*(n/2))}return s.config.chart.stacked||("start"===u.textAnchor?c-d.width<0?c=I?d.width+b:b:c+d.width>s.layout.gridWidth&&(c=I?s.layout.gridWidth-b:s.layout.gridWidth-d.width-b):"middle"===u.textAnchor?c-d.width/2<0?c=d.width/2+b:c+d.width/2>s.layout.gridWidth&&(c=s.layout.gridWidth-d.width/2-b):"end"===u.textAnchor&&(c<1?c=d.width+b:c+1>s.layout.gridWidth&&(c=s.layout.gridWidth-d.width-b))),{bcx:a,bcy:l,dataLabelsX:c,dataLabelsY:C,totalDataLabelsX:w,totalDataLabelsY:P,totalDataLabelsAnchor:L}}drawCalculatedDataLabels({x:t,y:e,val:s,i:a,j:i,textRects:r,barHeight:o,barWidth:h,dataLabelsConfig:d}){const c=this.w;let b="rotate(0)";"vertical"===c.config.plotOptions.bar.dataLabels.orientation&&(b=`rotate(-90, ${t}, ${e})`);const p=new u(this.barCtx.w,this.barCtx.ctx),x=new g(this.barCtx.w),f=d.formatter;let y=null;const m=c.globals.collapsedSeriesIndices.indexOf(a)>-1;if(d.enabled&&!m){y=x.group({class:"apexcharts-data-labels",transform:b});let g="";void 0!==s&&(g=f(s,n(l({},c),{seriesIndex:a,dataPointIndex:i,w:c}))),!s&&c.config.plotOptions.bar.hideZeroBarsWhenGrouped&&(g="");const u=c.seriesData.series[a][i]<0,m=c.config.plotOptions.bar.dataLabels.position;if("vertical"===c.config.plotOptions.bar.dataLabels.orientation&&("top"===m&&(d.textAnchor=u?"end":"start"),"center"===m&&(d.textAnchor="middle"),"bottom"===m&&(d.textAnchor=u?"end":"start")),this.barCtx.isRangeBar&&this.barCtx.barOptions.dataLabels.hideOverflowingLabels){h<x.getTextRects(g,parseFloat(d.style.fontSize).toString()).width&&(g="")}c.config.chart.stacked&&this.barCtx.barOptions.dataLabels.hideOverflowingLabels&&(this.barCtx.isHorizontal?r.width/1.6>Math.abs(h)&&(g=""):r.height/1.6>Math.abs(o)&&(g=""));const v=l({},d);this.barCtx.isHorizontal&&s<0&&("start"===d.textAnchor?v.textAnchor="end":"end"===d.textAnchor&&(v.textAnchor="start")),p.plotDataLabelsText({x:t,y:e,text:g,i:a,j:i,parent:y,dataLabelsConfig:v,alwaysDrawDataLabel:!0,offsetCorrection:!0})}return y}drawTotalDataLabels({x:t,y:e,val:s,realIndex:a,textAnchor:i,barTotalDataLabelsConfig:r}){const o=new g(this.barCtx.w);let l;return r.enabled&&void 0!==t&&void 0!==e&&this.barCtx.lastActiveBarSerieIndex===a&&(l=o.drawText({x:t,y:e,foreColor:r.style.color,text:s,textAnchor:i,fontFamily:r.style.fontFamily,fontSize:r.style.fontSize,fontWeight:r.style.fontWeight})),l}}const x=c.__apex_Series,f=c.__apex_Fill,y=c.__apex_Utils;class m{constructor(t){this.w=t.w,this.barCtx=t}initVariables(t){const e=this.w;this.barCtx.series=t,this.barCtx.totalItems=0,this.barCtx.seriesLen=0,this.barCtx.visibleI=-1,this.barCtx.visibleItems=1;for(let s=0;s<t.length;s++)if(t[s].length>0&&(this.barCtx.seriesLen=this.barCtx.seriesLen+1,this.barCtx.totalItems+=t[s].length),e.axisFlags.isXNumeric)for(let a=0;a<t[s].length;a++)e.seriesData.seriesX[s][a]>e.globals.minX&&e.seriesData.seriesX[s][a]<e.globals.maxX&&this.barCtx.visibleItems++;else this.barCtx.visibleItems=e.globals.dataPoints;this.arrBorderRadius=this.createBorderRadiusArr(e.seriesData.series),y.isSafari()&&(this.arrBorderRadius=this.arrBorderRadius.map(t=>t.map(t=>"none"))),0===this.barCtx.seriesLen&&(this.barCtx.seriesLen=1),this.barCtx.zeroSerieses=[],e.globals.comboCharts||this.checkZeroSeries({series:t})}initialPositions(t){const e=this.w;let s,a,i,r,o,l,n,h,d=e.globals.dataPoints;this.barCtx.isRangeBar&&(d=e.labelData.labels.length);let c=this.barCtx.seriesLen;if(e.config.plotOptions.bar.rangeBarGroupRows&&(c=1),this.barCtx.isHorizontal)i=e.layout.gridHeight/d,o=i/c,e.axisFlags.isXNumeric&&(i=e.layout.gridHeight/this.barCtx.totalItems,o=i/this.barCtx.seriesLen),o=o*parseInt(this.barCtx.barOptions.barHeight,10)/100,-1===String(this.barCtx.barOptions.barHeight).indexOf("%")&&(o=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),a=(i-o*this.barCtx.seriesLen)/2;else{if(r=e.layout.gridWidth/this.barCtx.visibleItems,e.config.xaxis.convertedCatToNumeric&&(r=e.layout.gridWidth/e.globals.dataPoints),l=r/c*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),l=r/c*parseInt(this.barCtx.barOptions.columnWidth,10)/100,l<1&&(l=1)}if(-1===String(this.barCtx.barOptions.columnWidth).indexOf("%")&&(l=parseInt(this.barCtx.barOptions.columnWidth,10)),n=e.layout.gridHeight-this.barCtx.baseLineY[this.barCtx.translationsIndex]-(this.barCtx.isReversed?e.layout.gridHeight:0)+(this.barCtx.isReversed?2*this.barCtx.baseLineY[this.barCtx.translationsIndex]:0),e.axisFlags.isXNumeric){s=this.barCtx.getBarXForNumericXAxis({x:s,j:0,realIndex:t,barWidth:l}).x}else s=e.globals.padHorizontal+y.noExponents(r-l*this.barCtx.seriesLen)/2}return e.globals.barHeight=o,e.globals.barWidth=l,{x:s,y:a,yDivision:i,xDivision:r,barHeight:o,barWidth:l,zeroH:n,zeroW:h}}initializeStackedPrevVars(t){t.w.labelData.seriesGroups.forEach(e=>{t[e]||(t[e]={}),t[e].prevY=[],t[e].prevX=[],t[e].prevYF=[],t[e].prevXF=[],t[e].prevYVal=[],t[e].prevXVal=[]})}initializeStackedXYVars(t){t.w.labelData.seriesGroups.forEach(e=>{t[e]||(t[e]={}),t[e].xArrj=[],t[e].xArrjF=[],t[e].xArrjVal=[],t[e].yArrj=[],t[e].yArrjF=[],t[e].yArrjVal=[]})}getPathFillColor(t,e,s,a){var i,r,o,l;const n=this.w,h=new f(this.barCtx.w);let d=null;const c=this.barCtx.barOptions.distributed?s:e;let b=!1;if(this.barCtx.barOptions.colors.ranges.length>0){this.barCtx.barOptions.colors.ranges.map(a=>{t[e][s]>=a.from&&t[e][s]<=a.to&&(d=a.color,b=!0)})}return{color:h.fillPath({seriesNumber:this.barCtx.barOptions.distributed?c:a,dataPointIndex:s,color:d,value:t[e][s],fillConfig:null==(i=n.config.series[e].data[s])?void 0:i.fill,fillType:(null==(o=null==(r=n.config.series[e].data[s])?void 0:r.fill)?void 0:o.type)?null==(l=n.config.series[e].data[s])?void 0:l.fill.type:Array.isArray(n.config.fill.type)?n.config.fill.type[a]:n.config.fill.type}),useRangeColor:b}}getStrokeWidth(t,e,s){let a=0;const i=this.w;return void 0===this.barCtx.series[t][e]||null===this.barCtx.series[t][e]||"bar"===i.config.chart.type&&!this.barCtx.series[t][e]?this.barCtx.isNullValue=!0:this.barCtx.isNullValue=!1,i.config.stroke.show&&(this.barCtx.isNullValue||(a=Array.isArray(this.barCtx.strokeWidth)?this.barCtx.strokeWidth[s]:this.barCtx.strokeWidth)),a}createBorderRadiusArr(t){var e;const s=this.w,a=!this.w.config.chart.stacked||s.config.plotOptions.bar.borderRadius<=0,i=t.length,r=0|(null==(e=t[0])?void 0:e.length),o=Array.from({length:i},()=>Array(r).fill(a?"top":"none"));if(a)return o;const l=this.w.config.chart.type;for(let e=0;e<r;e++){const s=[],a=[];let n=0;for(let r=0;r<i;r++){const i=t[r][e];i>0?(s.push(r),n++):i<0&&(a.push(r),n++)}if(s.length>0&&0===a.length)if(1===s.length)o[s[0]][e]="bar"===l&&1===r?"top":"both";else{const t=s[0],a=s[s.length-1];for(const i of s)o[i][e]=i===t?"bar"===l&&1===r?"top":"bottom":i===a?"top":"none"}else if(a.length>0&&0===s.length)if(1===a.length)o[a[0]][e]="both";else{const t=Math.max(...a),s=Math.min(...a);for(const i of a)o[i][e]=i===t?"bottom":i===s?"top":"none"}else if(s.length>0&&a.length>0){const t=s[s.length-1];for(const a of s)o[a][e]=a===t?"top":"none";const i=Math.max(...a);for(const t of a)o[t][e]=t===i?"bottom":"none"}else if(1===n){o[s[0]||a[0]][e]="both"}}return o}barBackground({j:t,i:e,x1:s,x2:a,y1:i,y2:r,elSeries:o}){const l=this.w,n=new g(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=n.drawRect(void 0!==s?s:0,void 0!==i?i:0,void 0!==a?a:l.layout.gridWidth,void 0!==r?r:l.layout.gridHeight,this.barCtx.barOptions.colors.backgroundBarRadius,e,this.barCtx.barOptions.colors.backgroundBarOpacity);o.add(h),h.node.classList.add("apexcharts-backgroundBar")}}getColumnPaths({barWidth:t,barXPosition:e,y1:s,y2:a,strokeWidth:i,isReversed:r,series:o,seriesGroup:l,realIndex:n,i:h,j:d,w:c}){var b,u,p;const x=new g(this.barCtx.w);(i=Array.isArray(i)?i[n]:i)||(i=0);let f=t,y=e;(null==(b=c.config.series[n].data[d])?void 0:b.columnWidthOffset)&&(y=e-c.config.series[n].data[d].columnWidthOffset/2,f=t+c.config.series[n].data[d].columnWidthOffset);const m=i/2,v=y+m,C=y+f-m,w=(o[h][d]>=0?1:-1)*(r?-1:1);s+=.001-m*w,a+=.001+m*w;const P=x.line(C,s),L="around"===c.config.plotOptions.bar.borderRadiusApplication||"both"===this.arrBorderRadius[n][d]?" Z":" z";let I=x.move(v,s)+x.line(v,a)+x.line(C,a)+P+L;"none"!==this.arrBorderRadius[n][d]&&(I=x.roundPathCorners(I,c.config.plotOptions.bar.borderRadius));let k=null;const H=null==(p=null==(u=this.barCtx.ctx)?void 0:u.morphTypeChange)?void 0:p.getInitialPathFor(n,d);if(H?k=H:c.globals.previousPaths.length>0&&(k=this.barCtx.getPreviousPath(n,d,I)),null==k&&(k=x.move(v,s)+x.line(v,s)+P+P+P+P+P+x.line(v,s)+L),c.config.chart.stacked){let t=this.barCtx;t=this.barCtx[l],t.yArrj.push(a-m*w),t.yArrjF.push(Math.abs(s-a+i*w)),t.yArrjVal.push(this.barCtx.series[h][d])}return{pathTo:I,pathFrom:k}}getFunnelTrapezoidPaths({barYPosition:t,barHeight:e,series:s,i:a,j:i,realIndex:r,strokeWidth:o,w:l}){var n,h;const d=new g(this.barCtx.w),c=l.layout.gridWidth/2,b=t=>Math.abs(t/this.barCtx.invertedYRatio)/2,u=b(s[a][i]),p=i===s[a].length-1,x="taper"===l.config.plotOptions.funnel.lastShape?"taper":"flat";let f;f=p?"taper"===x?0:u:b(s[a][i+1]);const y=o/2,m=t+y,v=t+e-y,C=c-u,w=c+u,P=c-f,L=c+f,I=d.move(C,m)+d.line(w,m)+d.line(L,v)+d.line(P,v)+" Z";let k=null;const H=null==(h=null==(n=this.barCtx.ctx)?void 0:n.morphTypeChange)?void 0:h.getInitialPathFor(r,i);return H?k=H:l.globals.previousPaths.length>0&&(k=this.barCtx.getPreviousPath(r,i,I)),null==k&&(k=d.move(c,m)+d.line(c,m)+d.line(c,v)+d.line(c,v)+" Z"),{pathTo:I,pathFrom:k,x:w,x1:C,barXPosition:c}}computePyramidLayout(t){const e=this.w,s=e.layout.gridHeight,a=e.layout.gridWidth,i=t.map(t=>Math.abs(Number(t)||0)),r=i.reduce((t,e)=>t+e,0);if(0===r||s<=0)return i.map(()=>({y:0,height:0,topHalf:0,bottomHalf:0}));const o=a/2;let l=0;const n=[];for(let t=0;t<i.length;t++){const e=l/r;l+=i[t];const a=l/r,h=e*s,d=a*s;n.push({y:h,height:d-h,topHalf:e*o,bottomHalf:a*o})}return n}getPyramidPaths({barYPosition:t,barHeight:e,topHalf:s,bottomHalf:a,realIndex:i,j:r,strokeWidth:o,w:l}){var n,h;const d=new g(this.barCtx.w),c=l.layout.gridWidth/2,b=o/2,u=t+b,p=t+e-b,x=c-s,f=c+s,y=c-a,m=c+a,v=d.move(x,u)+d.line(f,u)+d.line(m,p)+d.line(y,p)+" Z";let C=null;const w=null==(h=null==(n=this.barCtx.ctx)?void 0:n.morphTypeChange)?void 0:h.getInitialPathFor(i,r);return w?C=w:l.globals.previousPaths.length>0&&(C=this.barCtx.getPreviousPath(i,r,v)),null==C&&(C=d.move(c,u)+d.line(c,u)+d.line(c,p)+d.line(c,p)+" Z"),{pathTo:v,pathFrom:C,x:f,x1:x,barXPosition:c}}getBarpaths({barYPosition:t,barHeight:e,x1:s,x2:a,strokeWidth:i,isReversed:r,series:o,seriesGroup:l,realIndex:n,i:h,j:d,w:c}){var b,u,p;const x=new g(this.barCtx.w);(i=Array.isArray(i)?i[n]:i)||(i=0);let f=t,y=e;(null==(b=c.config.series[n].data[d])?void 0:b.barHeightOffset)&&(f=t-c.config.series[n].data[d].barHeightOffset/2,y=e+c.config.series[n].data[d].barHeightOffset);const m=i/2,v=f+m,C=f+y-m,w=(o[h][d]>=0?1:-1)*(r?-1:1);s+=.001+m*w,a+=.001-m*w;const P=this.barCtx.isFunnel,L=P?(s+a)/2:s,I=x.line(s,C),k="around"===c.config.plotOptions.bar.borderRadiusApplication||"both"===this.arrBorderRadius[n][d]?" Z":" z";let H=x.move(s,v)+x.line(a,v)+x.line(a,C)+I+k;"none"!==this.arrBorderRadius[n][d]&&(H=x.roundPathCorners(H,c.config.plotOptions.bar.borderRadius));let W=null;const A=null==(p=null==(u=this.barCtx.ctx)?void 0:u.morphTypeChange)?void 0:p.getInitialPathFor(n,d);if(A?W=A:c.globals.previousPaths.length>0&&(W=this.barCtx.getPreviousPath(n,d,H)),null==W){const t=P?x.line(L,C):I;W=x.move(L,v)+x.line(L,v)+t+t+t+t+t+x.line(L,v)+k}if(c.config.chart.stacked){let t=this.barCtx;t=this.barCtx[l],t.xArrj.push(a+m*w),t.xArrjF.push(Math.abs(s-a-i*w)),t.xArrjVal.push(this.barCtx.series[h][d])}return{pathTo:H,pathFrom:W}}checkZeroSeries({series:t}){const e=this.w;for(let s=0;s<t.length;s++){let a=0;for(let i=0;i<t[e.globals.maxValsInArrayIndex].length;i++)a+=t[s][i];0===a&&this.barCtx.zeroSerieses.push(s)}}getXForValue(t,e,s=!0){let a=s?e:null;return null!=t&&(a=e+t/this.barCtx.invertedYRatio-2*(this.barCtx.isReversed?t/this.barCtx.invertedYRatio:0)),a}getYForValue(t,e,s,a=!0){let i=a?e:null;return null!=t&&(i=e-t/this.barCtx.yRatio[s]+2*(this.barCtx.isReversed?t/this.barCtx.yRatio[s]:0)),i}getGoalValues(t,e,s,a,i,r){const o=this.w,h=[],d=(a,i)=>{h.push({[t]:"x"===t?this.getXForValue(a,e,!1):this.getYForValue(a,s,r,!1),attrs:i})};if(o.seriesData.seriesGoals[a]&&o.seriesData.seriesGoals[a][i]&&Array.isArray(o.seriesData.seriesGoals[a][i])&&o.seriesData.seriesGoals[a][i].forEach(t=>{d(t.value,t)}),this.barCtx.barOptions.isDumbbell&&o.rangeData.seriesRange.length){const e=this.barCtx.barOptions.dumbbellColors?this.barCtx.barOptions.dumbbellColors:o.globals.colors,s={strokeHeight:"x"===t?0:o.globals.markers.size[a],strokeWidth:"x"===t?o.globals.markers.size[a]:0,strokeDashArray:0,strokeLineCap:"round",strokeColor:Array.isArray(e[a])?e[a][0]:e[a]};d(o.rangeData.seriesRangeStart[a][i],s),d(o.rangeData.seriesRangeEnd[a][i],n(l({},s),{strokeColor:Array.isArray(e[a])?e[a][1]:e[a]}))}return h}drawGoalLine({barXPosition:t,barYPosition:e,goalX:s,goalY:a,barWidth:i,barHeight:r}){if(!(Array.isArray(s)&&s.length>0||Array.isArray(a)&&a.length>0))return null;const o=new g(this.barCtx.w),l=o.group({className:"apexcharts-bar-goals-groups"});l.node.classList.add("apexcharts-element-hidden"),this.barCtx.w.globals.delayedElements.push({el:l.node}),l.attr("clip-path",`url(#gridRectMarkerMask${this.barCtx.w.globals.cuid})`);let n=null;return this.barCtx.isHorizontal?Array.isArray(s)&&s.forEach(t=>{if(t.x>=-1&&t.x<=o.w.layout.gridWidth+1){const s=void 0!==t.attrs.strokeHeight?t.attrs.strokeHeight:r/2,a=e+s+r/2;n=o.drawLine(t.x,a-2*s,t.x,a,t.attrs.strokeColor?t.attrs.strokeColor:void 0,t.attrs.strokeDashArray,t.attrs.strokeWidth?t.attrs.strokeWidth:2,t.attrs.strokeLineCap),l.add(n)}}):Array.isArray(a)&&a.forEach(e=>{if(e.y>=-1&&e.y<=o.w.layout.gridHeight+1){const s=void 0!==e.attrs.strokeWidth?e.attrs.strokeWidth:i/2,a=t+s+i/2;n=o.drawLine(a-2*s,e.y,a,e.y,e.attrs.strokeColor?e.attrs.strokeColor:void 0,e.attrs.strokeDashArray,e.attrs.strokeHeight?e.attrs.strokeHeight:2,e.attrs.strokeLineCap),l.add(n)}}),l}drawBarShadow({prevPaths:t,currPaths:e,color:s,realIndex:a,j:i}){const r=this.w,{x:o,x1:l,barYPosition:n}=t,{x:h,x1:d,barYPosition:c}=e,b=n+e.barHeight,u=new g(this.barCtx.w),p=new y,x=u.move(l,b)+u.line(o,b)+u.line(h,c)+u.line(d,c)+u.line(l,b)+("around"===r.config.plotOptions.bar.borderRadiusApplication||"both"===this.arrBorderRadius[a][i]?" Z":" z");return u.drawPath({d:x,fill:p.shadeColor(.5,y.rgb2hex(s)),stroke:"none",strokeWidth:0,fillOpacity:1,classes:"apexcharts-bar-shadow apexcharts-decoration-element"})}getZeroValueEncounters({i:t,j:e}){var s;const a=this.w;let i=0,r=0;return(a.config.plotOptions.bar.horizontal?a.seriesData.series.map((t,e)=>e):(null==(s=a.globals.columnSeries)?void 0:s.i.map(t=>t))||[]).forEach(s=>{const o=a.globals.seriesPercent[s][e];o&&i++,s<t&&0===o&&r++}),{nonZeroColumns:i,zeroEncounters:r}}getGroupIndex(t){const e=this.w,s=e.labelData.seriesGroups.findIndex(s=>s.indexOf(e.seriesData.seriesNames[t])>-1),a=this.barCtx.columnGroupIndices;let i=a.indexOf(s);return i<0&&(a.push(s),i=a.length-1),{groupIndex:s,columnGroupIndex:i}}}const v=c.__apex_Filters,C=c.__apex_Animations_computeStagger,w=c.__apex_BrowserAPIs_BrowserAPIs,P=c.__apex_Environment_Environment;function L(t){var e;const s=t.config.chart.animations;if(!s||!1===s.enabled)return!1;if(!s.dynamicAnimation||!1===s.dynamicAnimation.enabled)return!1;const a=null!=(e=s.largeDatasetThreshold)?e:0;return!(a>0&&t.globals.dataPoints>a)&&!!(P.isBrowser()&&t.globals.dataChanged&&t.globals.shouldAnimate)}function I(t,e,s){var a,i,r,o;if(null==(a=t.axisFlags)?void 0:a.isXNumeric){const a=null==(r=null==(i=t.seriesData)?void 0:i.seriesX)?void 0:r[e];if(a&&a.length&&null!=a[s])return"x:"+a[s]}const l=null==(o=t.globals.labels)?void 0:o[s];return null!=l&&""!==String(l)?"c:"+(Array.isArray(l)?l.join(" "):String(l)):"j:"+s}function k({w:t,elSeries:e,record:s,newKeys:a,isHorizontal:i,speed:r}){var o;if(!L(t))return;if(!s||!Array.isArray(s.paths)||!(null==e?void 0:e.node))return;const l=new Set(a),n=s.paths.filter(t=>t&&t.d&&null!=t.key&&!l.has(t.key));if(!n.length)return;const h=new g(t),d=null==(o=t.globals.colors)?void 0:o[parseInt(String(s.realIndex),10)];n.forEach(s=>{let a=s.fill||d||"#c8c8c8";0===String(a).indexOf("url(")&&(a=d||"#c8c8c8");const o=h.drawPath({d:s.d,stroke:"none",strokeWidth:0,fill:a,fillOpacity:1,classes:"apexcharts-bar-ghost"}),l=o.node;l.setAttribute("pointer-events","none"),o.attr("clip-path",`url(#gridRectBarMask${t.globals.cuid})`),e.node.insertBefore(l,e.node.firstChild);const n=function(t){const e=/^M\s*([+-]?[\d.eE]+)[\s,]+([+-]?[\d.eE]+)/.exec(t||"");if(!e)return null;const s=parseFloat(e[1]),a=parseFloat(e[2]);return isFinite(s)&&isFinite(a)?{x:s,y:a}:null}(s.d);let c=i?"left center":"center bottom";try{const t=l.getBBox();n&&t&&(c=i?Math.abs(n.x-t.x)<=Math.abs(n.x-(t.x+t.width))?"left center":"right center":Math.abs(n.y-(t.y+t.height))<=Math.abs(n.y-t.y)?"center bottom":"center top")}catch(t){}const b=l.style;b.transformBox="fill-box",b.transformOrigin=c;const g=Math.max(1,r||1),u=performance.now(),p=e=>{if(t.globals.isDestroyed||!l.parentNode)return;const s=Math.max(0,Math.min(1,(e-u)/g)),a=1-Math.pow(1-s,3),r=1-a;b.transform=i?`scaleX(${r})`:`scaleY(${r})`,b.opacity=String(1-a),s<1?w.requestAnimationFrame(p):l.parentNode.removeChild(l)};w.requestAnimationFrame(p)})}class H{constructor(t,e,s){this.ctx=e,this.w=t,this.barOptions=t.config.plotOptions.bar,this.isHorizontal=this.barOptions.horizontal,this.strokeWidth=t.config.stroke.width,this.isNullValue=!1,this.isRangeBar=t.rangeData.seriesRange.length&&this.isHorizontal,this.isVerticalGroupedRangeBar=!t.globals.isBarHorizontal&&t.rangeData.seriesRange.length&&t.config.plotOptions.bar.rangeBarGroupRows,this.isFunnel=this.barOptions.isFunnel,this.isPyramid=this.barOptions.isPyramid,this.pyramidLayout=null,this.xyRatios=s,this.xRatio=0,this.yRatio=[],this.invertedXRatio=0,this.invertedYRatio=0,this.baseLineY=[],this.baseLineInvertedY=0,null!==this.xyRatios&&(this.xRatio=s.xRatio,this.yRatio=s.yRatio,this.invertedXRatio=s.invertedXRatio,this.invertedYRatio=s.invertedYRatio,this.baseLineY=s.baseLineY,this.baseLineInvertedY=s.baseLineInvertedY),this.yaxisIndex=0,this.translationsIndex=0,this.seriesLen=0,this.pathArr=[],this._prevKeyed=null,this._ltCache=null,this.series=[],this.elSeries=null,this.visibleI=0,this.isReversed=!1;const a=new x(this.w);this.lastActiveBarSerieIndex=a.getActiveConfigSeriesIndex("desc",["bar","column"]),this.columnGroupIndices=[];const i=a.getBarSeriesIndices(),r=new b(this.w);this.stackedSeriesTotals=r.getStackedSeriesTotals(this.w.config.series.map((t,e)=>-1===i.indexOf(e)?e:-1).filter(t=>-1!==t)),this.barHelpers=new m(this)}draw(t,e){var s,a;const i=this.w,r=new g(this.w),o=new b(this.w);t=o.getLogSeries(t),this.series=t,this.yRatio=o.getLogYRatios(this.yRatio),this.barHelpers.initVariables(t);const h=r.group({class:"apexcharts-bar-series apexcharts-plot-series"});i.config.dataLabels.enabled&&(this.totalItems,this.barOptions.dataLabels.maxItems);for(let o=0,d=0;o<t.length;o++,d++){let c,b;const g=[],u=[],p=i.globals.comboCharts?e[o]:o,{columnGroupIndex:f}=this.barHelpers.getGroupIndex(p),m=r.group({class:"apexcharts-series",rel:o+1,seriesName:y.escapeString(i.seriesData.seriesNames[p]),"data:realIndex":p});x.addCollapsedClassToSeries(this.w,m,p),t[o].length>0&&(this.visibleI=this.visibleI+1),this.yRatio.length>1&&(this.yaxisIndex=i.globals.seriesYAxisReverseMap[p],this.translationsIndex=p);const C=this.translationsIndex;this.isReversed=i.config.yaxis[this.yaxisIndex]&&i.config.yaxis[this.yaxisIndex].reversed,this.isPyramid&&(this.pyramidLayout=this.barHelpers.computePyramidLayout(t[o]));const w=this.barHelpers.initialPositions(p),{y:P,yDivision:L,zeroW:H,x:W,xDivision:A,zeroH:D}=w;let O=w.barHeight,R=w.barWidth;b=P,c=W,this.isHorizontal||u.push(c+(null!=R?R:0)/2);const X=r.group({class:"apexcharts-datalabels","data:realIndex":p});i.globals.delayedElements.push({el:X.node,holdUntilComplete:this.isLengthTransition(p)}),X.node.classList.add("apexcharts-element-hidden");const F=r.group({class:"apexcharts-bar-goals-markers"}),S=r.group({class:"apexcharts-bar-shadows"});i.globals.delayedElements.push({el:S.node}),S.node.classList.add("apexcharts-element-hidden");for(let e=0;e<t[o].length;e++){const r=this.barHelpers.getStrokeWidth(o,e,p);let h=null;const x={indexes:{i:o,j:e,realIndex:p,translationsIndex:C,bc:d},x:c,y:b,strokeWidth:r,elSeries:m};this.isHorizontal?(h=this.drawBarPaths(n(l({},x),{barHeight:O,zeroW:H,yDivision:L})),R=this.series[o][e]/this.invertedYRatio):(h=this.drawColumnPaths(n(l({},x),{xDivision:A,barWidth:R,zeroH:D})),O=this.series[o][e]/this.yRatio[C]);const w=this.barHelpers.getPathFillColor(t,o,e,p);if(this.isFunnel&&!this.isPyramid&&this.barOptions.isFunnel3d&&"trapezoid"!==(null==(s=i.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:y.hexToRgba(i.globals.colors[o]),prevPaths:this.pathArr[this.pathArr.length-1],currPaths:h,realIndex:p,j:e});if(S.add(t),i.config.chart.dropShadow.enabled){new v(this.w).dropShadow(t,i.config.chart.dropShadow,p)}}this.pathArr.push(h);const P=this.barHelpers.drawGoalLine({barXPosition:h.barXPosition,barYPosition:h.barYPosition,goalX:h.goalX,goalY:h.goalY,barHeight:O,barWidth:R});P&&F.add(P),b=h.y,c=h.x,e>0&&u.push(c+(null!=R?R:0)/2),g.push(b),this.renderSeries(n(l({realIndex:p,pathFill:w.color},w.useRangeColor?{lineFill:w.color}:{}),{j:e,i:o,columnGroupIndex:f,pathFrom:h.pathFrom,pathTo:h.pathTo,strokeWidth:r,elSeries:m,x:c,y:b,series:t,barHeight:Math.abs(h.barHeight?h.barHeight:O),barWidth:Math.abs(h.barWidth?h.barWidth:R),elDataLabelsWrap:X,elGoalsMarkers:F,elBarShadows:S,visibleSeries:this.visibleI,type:"bar"}))}if(i.globals.seriesXvalues[p]=u,i.globals.seriesYvalues[p]=g,i.globals.previousPaths.length>0){const e=[];for(let s=0;s<t[o].length;s++)e.push(I(i,p,s));k({w:i,elSeries:m,record:this._prevRecord(p),newKeys:e,isHorizontal:this.isHorizontal,speed:i.config.chart.animations.dynamicAnimation.speed})}h.add(m)}return h}renderSeries({realIndex:t,pathFill:e,lineFill:s,j:a,i:i,columnGroupIndex:r,pathFrom:o,pathTo:l,strokeWidth:n,elSeries:h,x:d,y:c,y1:b,y2:u,series:x,barHeight:f,barWidth:y,barXPosition:m,barYPosition:w,elDataLabelsWrap:P,elGoalsMarkers:L,elBarShadows:k,visibleSeries:H,type:W,classes:A}){var D;const O=this.w,R=new g(this.w,this.ctx),X=function(t,e){const s=t&&t.renderer;return s&&s.kind&&"svg"!==s.kind?s:e}(this.ctx,R);let F=!1;if(h._bindingsDelegated||(h._bindingsDelegated=!0,R.setupEventDelegation(h,`.apexcharts-${W}-area`)),!s){let e=function(t){const e=O.config.stroke.colors;let s;return Array.isArray(e)&&e.length>0&&(s=e[t],s||(s=""),"function"==typeof s)?s({value:O.seriesData.series[t][a],dataPointIndex:a,w:O}):s};const i="function"==typeof O.globals.stroke.colors[t]?e(t):O.globals.stroke.colors[t];s=this.barOptions.distributed?O.globals.stroke.colors[a]:i}const S=new p(this).handleBarDataLabels({x:d,y:c,y1:b,y2:u,i:i,j:a,series:x,realIndex:t,columnGroupIndex:r,barHeight:f,barWidth:y,barXPosition:m,barYPosition:w,visibleSeries:H});O.globals.isBarHorizontal||(S.dataLabelsPos.dataLabelsX+Math.max(y,O.globals.barPadForNumericAxis)<0||S.dataLabelsPos.dataLabelsX-Math.max(y,O.globals.barPadForNumericAxis)>O.layout.gridWidth)&&(F=!0),O.config.series[i].data[a]&&O.config.series[i].data[a].strokeColor&&(s=O.config.series[i].data[a].strokeColor),this.isNullValue&&(e="none");const B=O.config.chart.animations,Y=B.animateGradually;let j=0;if(Y&&!1!==Y.enabled&&!(O.globals.dataChanged&&this.isLengthTransition(t))){const t=O.globals.dataPoints||1,e=Y.delay||0,s=Math.min(e,.5*B.speed/Math.max(1,t));let r=C({style:"sequential",index:a,baseDelay:s});O.config.chart.stacked&&(r+=i*s*.5);j=r/(e||1)}if(!F){const r=!0===(null==(D=this.ctx.morphTypeChange)?void 0:D.isActive())?this.ctx.morphTypeChange.getSpeed():O.config.chart.animations.dynamicAnimation.speed,d=X.renderPaths({i:i,j:a,realIndex:t,pathFrom:o,pathTo:l,stroke:s,strokeWidth:n,strokeLineCap:O.config.stroke.lineCap,fill:e,animationDelay:j,initialSpeed:O.config.chart.animations.speed,dataChangeSpeed:r,className:`apexcharts-${W}-area ${A}`,chartType:W,bindEventsOnPaths:!1});d.attr("clip-path",`url(#gridRectBarMask${O.globals.cuid})`);const c=O.config.forecastDataPoints;c.count>0&&a>=O.globals.dataPoints-c.count&&(d.node.setAttribute("stroke-dasharray",c.dashArray),d.node.setAttribute("stroke-width",c.strokeWidth),d.node.setAttribute("fill-opacity",c.fillOpacity)),void 0!==b&&void 0!==u&&(d.attr("data-range-y1",b),d.attr("data-range-y2",u));new v(this.w).setSelectionFilter(d,t,a),h.add(d),d.attr({cy:S.dataLabelsPos.bcy,cx:S.dataLabelsPos.bcx,j:a,val:O.seriesData.series[i][a],barHeight:f,barWidth:y,"data:pathKey":I(O,t,a)}),"canvas"===X.kind&&(O.globals.barCanvasCoords||(O.globals.barCanvasCoords={}),O.globals.barCanvasCoords[t]||(O.globals.barCanvasCoords[t]={}),O.globals.barCanvasCoords[t][a]={cx:S.dataLabelsPos.bcx,cy:S.dataLabelsPos.bcy,barWidth:y}),null!==S.dataLabels&&P.add(S.dataLabels),S.totalDataLabels&&P.add(S.totalDataLabels),h.add(P),L&&h.add(L),k&&h.add(k)}return h}drawBarPaths({indexes:t,barHeight:e,strokeWidth:s,zeroW:a,x:i,y:r,yDivision:o,elSeries:l}){const n=this.w,h=t.i,d=t.j;let c;if(n.axisFlags.isXNumeric)c=(r=(n.seriesData.seriesX[h][d]-n.globals.minX)/this.invertedXRatio-e)+e*this.visibleI;else if(n.config.plotOptions.bar.hideZeroBarsWhenGrouped){const{nonZeroColumns:t,zeroEncounters:s}=this.barHelpers.getZeroValueEncounters({i:h,j:d});t>0&&(e=this.seriesLen*e/t),c=r+e*this.visibleI,c-=e*s}else c=r+e*this.visibleI;const b=this.isFunnel&&"trapezoid"===n.config.plotOptions.funnel.shape,g=this.isPyramid&&this.pyramidLayout?this.pyramidLayout[d]:null,u=!!g;if(g)c=g.y,e=g.height;else if(this.isFunnel&&!b){const t=null!=a?a:0;a=t-(this.barHelpers.getXForValue(this.series[h][d],t)-t)/2}let p;return i=this.barHelpers.getXForValue(this.series[h][d],null!=a?a:0),p=g?this.barHelpers.getPyramidPaths({barYPosition:c,barHeight:e,topHalf:g.topHalf,bottomHalf:g.bottomHalf,realIndex:t.realIndex,j:d,strokeWidth:s,w:n}):b?this.barHelpers.getFunnelTrapezoidPaths({barYPosition:c,barHeight:e,series:this.series,i:h,j:d,realIndex:t.realIndex,strokeWidth:s,w:n}):this.barHelpers.getBarpaths({barYPosition:c,barHeight:e,x1:a,x2:i,strokeWidth:s,isReversed:this.isReversed,series:this.series,realIndex:t.realIndex,i:h,j:d,w:n}),(b||u)&&(a=p.x1,i=p.x),n.axisFlags.isXNumeric||u||(r+=o),u&&(r=c),this.barHelpers.barBackground({j:d,i:h,y1:c-e*this.visibleI,y2:e*this.seriesLen,elSeries:l}),{pathTo:p.pathTo,pathFrom:p.pathFrom,x1:a,x:i,y:r,goalX:this.barHelpers.getGoalValues("x",a,null,h,d,0),barYPosition:c,barHeight:e}}drawColumnPaths({indexes:t,x:e,y:s,xDivision:a,barWidth:i,zeroH:r,strokeWidth:o,elSeries:l}){const n=this.w,h=t.realIndex,d=t.translationsIndex,c=t.i,b=t.j,g=t.bc;let u;if(n.axisFlags.isXNumeric){const t=this.getBarXForNumericXAxis({x:e,j:b,realIndex:h,barWidth:i});e=t.x,u=t.barXPosition}else if(n.config.plotOptions.bar.hideZeroBarsWhenGrouped){const{nonZeroColumns:t,zeroEncounters:s}=this.barHelpers.getZeroValueEncounters({i:c,j:b});t>0&&(i=this.seriesLen*i/t),u=e+i*this.visibleI,u-=i*s}else u=e+i*this.visibleI;s=this.barHelpers.getYForValue(this.series[c][b],r,d);const p=this.barHelpers.getColumnPaths({barXPosition:u,barWidth:i,y1:r,y2:s,strokeWidth:o,isReversed:this.isReversed,series:this.series,realIndex:h,i:c,j:b,w:n});return n.axisFlags.isXNumeric||(e+=a),this.barHelpers.barBackground({bc:g,j:b,i:c,x1:u-o/2-i*this.visibleI,x2:i*this.seriesLen+o/2,elSeries:l}),{pathTo:p.pathTo,pathFrom:p.pathFrom,x:e,y:s,goalY:this.barHelpers.getGoalValues("y",null,r,c,b,d),barXPosition:u,barWidth:i}}getBarXForNumericXAxis({x:t,barWidth:e,realIndex:s,j:a}){const i=this.w;let r=s;return i.seriesData.seriesX[s].length||(r=i.globals.maxValsInArrayIndex),y.isNumber(i.seriesData.seriesX[r][a])&&(t=(i.seriesData.seriesX[r][a]-i.globals.minX)/this.xRatio-e*this.seriesLen/2),{barXPosition:t+e*this.visibleI,x:t}}_prevRecord(t){const e=this.w;let s=null;for(let a=0;a<e.globals.previousPaths.length;a++){const i=e.globals.previousPaths[a];i.paths&&i.paths.length>0&&parseInt(i.realIndex,10)===parseInt(String(t),10)&&(s=i)}return s}_prevKeyedPaths(t){if(this._prevKeyed||(this._prevKeyed={}),void 0!==this._prevKeyed[t])return this._prevKeyed[t];const e=this._prevRecord(t);let s=null;if(e&&e.paths.every(t=>null!=t.key)){const t=new Map;e.paths.forEach(e=>{t.set(e.key,e)}),s=t}return this._prevKeyed[t]=s,s}isLengthTransition(t){var e,s;if(this._ltCache||(this._ltCache={}),void 0!==this._ltCache[t])return this._ltCache[t];const a=this.w;let i=!1;if(L(a)&&a.globals.previousPaths.length>0){const r=this._prevRecord(t),o=null!=(s=null==(e=a.seriesData.series[t])?void 0:e.length)?s:0;if(r)if(r.paths.length!==o)i=!0;else{const e=this._prevKeyedPaths(t);if(e)for(let s=0;s<o;s++)if(!e.has(I(a,t,s))){i=!0;break}}else i=o>0}return this._ltCache[t]=i,i}getPreviousPath(t,e,s){const a=this.w,i=this._prevRecord(t);if(!i)return L(a)?null:s;let r=null,o=!1;const l=this._prevKeyedPaths(t);if(l){const s=l.get(I(a,t,e));s?r=s.d:o=!0}else void 0!==i.paths[e]?r=i.paths[e].d:o=!0;return r&&H.pathCommandCount(r)===H.pathCommandCount(s)?r:o&&L(a)?null:s}static pathCommandCount(t){if(!t)return 0;const e=t.match(/[A-Za-z]/g);return e?e.length:0}}function W({w:t,points:e,seedA:s,seedB:a,center:i,halfExtent:r,alongFn:o,isHorizontal:l,options:n,clampAt:h}){const d=n;if(!d||!1===d.show)return[];if(!e||!e.length)return[];const c=d.maxPoints||3e3,b=e.length>c?Math.ceil(e.length/c):1,g=null!=d.size?d.size:2.5,u=r*(null!=d.jitter?d.jitter:.5),p=!1!==d.constrainToViolin&&"function"==typeof h,x="square"===d.shape,f=d.colorScale,y=f&&Array.isArray(f.colors)&&f.colors.length>0,m=y?Math.max(2,f.steps||24):1,v=y&&null!=f.min?f.min:t.globals.minY,C=(y&&null!=f.max?f.max:t.globals.maxY)-v||1,w=y?new Array(m).fill(""):[""];for(let t=0;t<e.length;t+=b){const r=e[t],n=o(r);let d=2*(R(7919*s+100003*a+t)-.5)*u;if(p){const t=h(r);d>t&&(d=t),d<-t&&(d=-t)}const c=l?n:i+d,b=l?i+d:n,f=x?F(c,b,g):X(c,b,g);if(y){let t=(r-v)/C;t<0&&(t=0),t>1&&(t=1),w[Math.round(t*(m-1))]+=f}else w[0]+=f}if(!y)return w[0]?[{fill:null,d:w[0]}]:[];const P=[];for(let t=0;t<m;t++)w[t]&&P.push({fill:O(f.colors,t/(m-1)),d:w[t]});return P}function A({graphics:t,w:e,elSeries:s,pointsByCat:a,options:i,distributed:r,realIndex:o,wrapClass:l,pointClass:n}){if(!i||!1===i.show||!a.length)return;const h=null!=i.opacity?i.opacity:.9,d=null!=i.strokeColor?i.strokeColor:"#fff",c=null!=i.strokeWidth?i.strokeWidth:1,b=e.config.chart.animations.enabled&&!e.globals.resized&&!e.globals.dataChanged,g=t.group({class:b?`${l} apexcharts-element-hidden`:l});b&&e.globals.delayedElements.push({el:g.node}),a.forEach(({groups:s,j:a})=>{const l=r?e.globals.colors[a]:e.globals.colors[o],b=i.fillColor,u="series"===b?l:"series-dark"===b?D(l,.45):b||D(l,.45);s.forEach(s=>{const i=t.drawPath({d:s.d,fill:null!=s.fill?s.fill:u,stroke:c>0?d:"none",strokeWidth:c,fillOpacity:h,classes:n});i.attr("data:realIndex",o),i.attr("j",a),i.attr("clip-path",`url(#gridRectBarMask${e.globals.cuid})`),i.node.style.pointerEvents="none",g.add(i)})}),s.add(g)}function D(t,e){const s=y.parseHex(t);if(!s)return t;const a=Math.max(0,1-e);return`rgb(${Math.round(s[0]*a)},${Math.round(s[1]*a)},${Math.round(s[2]*a)})`}function O(t,e){if(!t.length)return"#000";if(1===t.length)return t[0];const s=Math.max(0,Math.min(1,e))*(t.length-1),a=Math.floor(s),i=s-a,r=y.parseHex(t[a])||[0,0,0],o=y.parseHex(t[Math.min(a+1,t.length-1)])||r,l=(t,e)=>Math.round(t+(e-t)*i);return`rgb(${l(r[0],o[0])},${l(r[1],o[1])},${l(r[2],o[2])})`}function R(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 X(t,e,s){return`M ${t-s} ${e} a ${s} ${s} 0 1 0 ${2*s} 0 a ${s} ${s} 0 1 0 ${-2*s} 0 `}function F(t,e,s){return`M ${t-s} ${e-s} h ${2*s} v ${2*s} h ${-2*s} z `}class S extends H{draw(t,e,s){var a;const i=this.w,r=new g(this.w),o=i.globals.comboCharts?e:i.config.chart.type,h=new f(this.w);this.candlestickOptions=this.w.config.plotOptions.candlestick,this.boxOptions=this.w.config.plotOptions.boxPlot,this.isHorizontal=i.config.plotOptions.bar.horizontal,this.isOHLC=this.candlestickOptions&&"ohlc"===this.candlestickOptions.type,this.coreUtils=new b(this.w),t=this.coreUtils.getLogSeries(t),this.series=t,this.yRatio=this.coreUtils.getLogYRatios(this.yRatio),this.barHelpers.initVariables(t);const d=r.group({class:`apexcharts-${o}-series apexcharts-plot-series`});for(let e=0;e<t.length;e++){let o,c;this.isBoxPlot="boxPlot"===i.config.chart.type||"boxPlot"===i.config.series[e].type;const b=[],g=[],u=i.globals.comboCharts?s[e]:e,{columnGroupIndex:p}=this.barHelpers.getGroupIndex(u),f=r.group({class:"apexcharts-series",seriesName:y.escapeString(i.seriesData.seriesNames[u]),rel:e+1,"data:realIndex":u});x.addCollapsedClassToSeries(this.w,f,u),t[e].length>0&&(this.visibleI=this.visibleI+1);let m=0;this.yRatio.length>1&&(this.yaxisIndex=i.globals.seriesYAxisReverseMap[u][0],m=u);const v=this.barHelpers.initialPositions(u),{y:C,barHeight:w,yDivision:P,zeroW:L,x:I,barWidth:k,xDivision:H,zeroH:D}=v;c=C,o=I,g.push(o+(null!=k?k:0)/2);const O=r.group({class:"apexcharts-datalabels","data:realIndex":u}),R=r.group({class:"apexcharts-bar-goals-markers"}),X=this.isBoxPlot?this.boxOptions.points:null,F=[],S=i.layout.gridWidth,B=null!=k?k:0;for(let s=0;s<i.globals.dataPoints;s++){const r=this.barHelpers.getStrokeWidth(e,s,u);let d=null;const x={indexes:{i:e,j:s,realIndex:u,translationsIndex:m},x:o,y:c,strokeWidth:r,elSeries:f};if(d=this.isHorizontal?this.drawHorizontalBoxPaths(n(l({},x),{yDivision:P,barHeight:w,zeroW:L})):this.drawVerticalBoxPaths(n(l({},x),{xDivision:H,barWidth:k,zeroH:D,cullBounds:{lo:-B,hi:S+B}})),c=d.y,o=d.x,s>0&&g.push(o+(null!=k?k:0)/2),b.push(c),d.culled)continue;const y=this.barHelpers.drawGoalLine({barXPosition:d.barXPosition,barYPosition:d.barYPosition,goalX:d.goalX,goalY:d.goalY,barHeight:w,barWidth:k});if(y&&R.add(y),d.pathTo.forEach((a,l)=>{const n=!this.isBoxPlot&&this.candlestickOptions.wick.useFillColor?d.color[l]:i.globals.stroke.colors[e],b=h.fillPath({seriesNumber:u,dataPointIndex:s,color:d.color[l],value:t[e][s]});this.renderSeries({realIndex:u,pathFill:b,lineFill:n,j:s,i:e,pathFrom:d.pathFrom,pathTo:a,strokeWidth:r,elSeries:f,x:o,y:c,series:t,columnGroupIndex:p,barHeight:w,barWidth:k,elDataLabelsWrap:O,elGoalsMarkers:R,visibleSeries:this.visibleI,type:i.config.chart.type})}),X&&!1!==X.show){const t=null==(a=i.candleData.seriesBoxPoints[u])?void 0:a[s];if(t&&t.length){const e=t=>this.coreUtils.getLogValAtSeriesIndex(t,u);let a,r,o;if(this.isHorizontal){const t=this.invertedYRatio,s=null!=w?w:0,i=null!=L?L:0;a=d.barYPosition+s/2,r=s/2,o=s=>i+e(s)/t}else{const t=this.yRatio[m],s=null!=k?k:0,i=null!=D?D:0;a=d.barXPosition+s/2,r=s/2,o=s=>i-e(s)/t}const l=W({w:i,points:t,seedA:u,seedB:s,center:a,halfExtent:r,alongFn:o,isHorizontal:this.isHorizontal,options:X});l.length&&F.push({groups:l,j:s})}}}X&&A({graphics:r,w:i,elSeries:f,pointsByCat:F,options:X,distributed:i.config.plotOptions.bar.distributed,realIndex:u,wrapClass:"apexcharts-boxPlot-points-wrap",pointClass:"apexcharts-boxPlot-points"}),i.globals.seriesXvalues[u]=g,i.globals.seriesYvalues[u]=b,d.add(f)}return d}drawVerticalBoxPaths({indexes:t,x:e,xDivision:s,barWidth:a,zeroH:i,strokeWidth:r,cullBounds:o=null}){var l,n;const h=this.w,d=new g(this.w),c=t.i,b=t.j,{colors:u}=h.config.plotOptions.candlestick,{colors:p}=this.boxOptions,x=t.realIndex,f=t=>Array.isArray(t)?t[x]:t,y=f(u.upward),m=f(u.downward),v=this.yRatio[t.translationsIndex],C=this.getOHLCValue(x,b);let w=i,P=i,L=C.o<C.c?[y]:[m];this.isBoxPlot&&(L=[f(p.lower),f(p.upper)]);let I=Math.min(C.o,C.c),k=Math.max(C.o,C.c),H=C.m;h.axisFlags.isXNumeric&&(e=(h.seriesData.seriesX[x][b]-h.globals.minX)/this.xRatio-a/2);const W=e+a*this.visibleI;if(void 0===(null==(l=this.series[c])?void 0:l[b])||null===(null==(n=this.series[c])?void 0:n[b])?(I=i,k=i):(I=i-I/v,k=i-k/v,w=i-C.h/v,P=i-C.l/v,H=i-C.m/v),o&&(W+a<o.lo||W>o.hi))return{pathTo:null,pathFrom:null,x:h.axisFlags.isXNumeric?e:e+s,y:k,barXPosition:W,color:L,culled:!0};let A;if(this.isOHLC){const t=W+a/2,e=i-C.o/v,s=i-C.c/v;A=[d.move(t,w)+d.line(t,P)+d.move(t,e)+d.line(W,e)+d.move(t,s)+d.line(W+a,s)]}else A=this.isBoxPlot?[d.move(W,I)+d.line(W+a/2,I)+d.line(W+a/2,w)+d.line(W+a/4,w)+d.line(W+a-a/4,w)+d.line(W+a/2,w)+d.line(W+a/2,I)+d.line(W+a,I)+d.line(W+a,H)+d.line(W,H)+d.line(W,I+r/2),d.move(W,H)+d.line(W+a,H)+d.line(W+a,k)+d.line(W+a/2,k)+d.line(W+a/2,P)+d.line(W+a-a/4,P)+d.line(W+a/4,P)+d.line(W+a/2,P)+d.line(W+a/2,k)+d.line(W,k)+d.line(W,H)+"z"]:[d.move(W,k)+d.line(W+a/2,k)+d.line(W+a/2,w)+d.line(W+a/2,k)+d.line(W+a,k)+d.line(W+a,I)+d.line(W+a/2,I)+d.line(W+a/2,P)+d.line(W+a/2,I)+d.line(W,I)+d.line(W,k-r/2)];let D=null;return h.globals.previousPaths.length>0&&(D=this.getPreviousPath(x,b,A[0])),null==D&&(D=d.move(W+a/2,I)+d.move(W,I)),h.axisFlags.isXNumeric||(e+=s),{pathTo:A,pathFrom:D,x:e,y:k,goalY:this.barHelpers.getGoalValues("y",null,i,c,b,t.translationsIndex),barXPosition:W,color:L}}drawHorizontalBoxPaths({indexes:t,y:e,yDivision:s,barHeight:a,zeroW:i,strokeWidth:r}){var o,l;const n=this.w,h=new g(this.w),d=t.i,c=t.j,b=t.realIndex,{colors:u}=n.config.plotOptions.candlestick,{colors:p}=this.boxOptions,x=t=>Array.isArray(t)?t[b]:t,f=this.invertedYRatio,y=this.getOHLCValue(b,c);let m=y.o<y.c?[x(u.upward)]:[x(u.downward)];this.isBoxPlot&&(m=[x(p.lower),x(p.upper)]);let v=i,C=i,w=Math.min(y.o,y.c),P=Math.max(y.o,y.c),L=y.m;n.axisFlags.isXNumeric&&(e=(n.seriesData.seriesX[b][c]-n.globals.minX)/this.invertedXRatio-a/2);const I=e+a*this.visibleI;void 0===(null==(o=this.series[d])?void 0:o[c])||null===(null==(l=this.series[d])?void 0:l[c])?(w=i,P=i):(w=i+w/f,P=i+P/f,v=i+y.h/f,C=i+y.l/f,L=i+y.m/f);const k=[h.move(w,I)+h.line(w,I+a/2)+h.line(v,I+a/2)+h.line(v,I+a/2-a/4)+h.line(v,I+a/2+a/4)+h.line(v,I+a/2)+h.line(w,I+a/2)+h.line(w,I+a)+h.line(L,I+a)+h.line(L,I)+h.line(w+r/2,I),h.move(L,I)+h.line(L,I+a)+h.line(P,I+a)+h.line(P,I+a/2)+h.line(C,I+a/2)+h.line(C,I+a-a/4)+h.line(C,I+a/4)+h.line(C,I+a/2)+h.line(P,I+a/2)+h.line(P,I)+h.line(L,I)+"z"];let H=null;return n.globals.previousPaths.length>0&&(H=this.getPreviousPath(b,c,k[0])),null==H&&(H=h.move(w,I+a/2)+h.move(w,I)),n.axisFlags.isXNumeric||(e+=s),{pathTo:k,pathFrom:H,x:P,y:e,goalX:this.barHelpers.getGoalValues("x",i,null,d,c,0),barYPosition:I,color:m}}getOHLCValue(t,e){const s=this.w,a=this.coreUtils,i=s=>s[t]&&null!=s[t][e]?a.getLogValAtSeriesIndex(s[t][e],t):0,r=i(s.candleData.seriesCandleH),o=i(s.candleData.seriesCandleO),l=i(s.candleData.seriesCandleM),n=i(s.candleData.seriesCandleC),h=i(s.candleData.seriesCandleL);return{o:this.isBoxPlot?r:o,h:this.isBoxPlot?o:r,m:l,l:this.isBoxPlot?n:h,c:this.isBoxPlot?h:n}}}h.use({candlestick:S,boxPlot:S}),exports.default=h;
|
package/dist/boxPlot.esm.js
CHANGED