UNPKG

apexcharts

Version:

A JavaScript Chart Library

5 lines 51.8 kB
/*! * ApexCharts v6.6.1 * (c) 2018-2026 ApexCharts */ "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,n=(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},l=(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),c=b.__apex_Graphics,g=b.__apex_DataLabels,p=b.__apex_BrowserAPIs_BrowserAPIs,u=b.__apex_Environment_Environment;function x(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)&&!!(u.isBrowser()&&t.globals.dataChanged&&t.globals.shouldAnimate)}function f(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 n=null==(o=t.globals.labels)?void 0:o[s];return null!=n&&""!==String(n)?"c:"+(Array.isArray(n)?n.join(" "):String(n)):"j:"+s}function v(t){const e=new Map;return t.map(t=>{const s=e.get(t)||0;return e.set(t,s+1),0===s?t:`${t}#${s}`})}function y(t,e,s=!1,a=!1){var i,r;if(!x(t))return null;const o=t.globals.prevStreamFrame;if(!o)return null;const n=null==(i=o.seriesY)?void 0:i[e],l=null==(r=t.seriesData.series)?void 0:r[e];if(!Array.isArray(n)||!Array.isArray(l))return null;if(!n.length||!l.length)return null;const h=v(n.map((t,s)=>function(t,e,s){var a,i;if(t.isXNumeric){const i=null==(a=t.seriesX)?void 0:a[e];if(i&&i.length&&null!=i[s])return"x:"+i[s]}const r=null==(i=t.labels)?void 0:i[s];return null!=r&&""!==String(r)?"c:"+(Array.isArray(r)?r.join(" "):String(r)):"j:"+s}(o,e,s))),d=v(l.map((s,a)=>f(t,e,a))),b=function(t,e){const s=new Map;t.forEach((t,e)=>{s.has(t)||s.set(t,e)});const a=new Array(e.length),i=new Set;let r=-1,o=!0,n=t.length===e.length;e.forEach((t,e)=>{const l=s.has(t)&&!i.has(s.get(t))?s.get(t):-1;a[e]=l,-1!==l&&(i.add(l),l<r&&(o=!1),r=l),l!==e&&(n=!1)});const l=[];for(let e=0;e<t.length;e++)i.has(e)||l.push(e);return{toOld:a,exits:l,ordered:o,changed:!n}}(h,d);return(b.ordered||a)&&(b.changed||s)?{join:b,oldKeys:h,newKeys:d}:null}function m({w:t,elSeries:e,record:s,newKeys:a,isHorizontal:i,speed:r}){var o;if(!x(t))return;if(!s||!Array.isArray(s.paths)||!(null==e?void 0:e.node))return;const n=new Set(a),l=s.paths.filter(t=>t&&t.d&&null!=t.key&&!n.has(t.key));if(!l.length)return;const h=new c(t),d=null==(o=t.globals.colors)?void 0:o[parseInt(String(s.realIndex),10)];l.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"}),n=o.node;n.setAttribute("pointer-events","none"),o.attr("clip-path",`url(#gridRectBarMask${t.globals.cuid})`),e.node.insertBefore(n,e.node.firstChild);const l=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=n.getBBox();l&&t&&(b=i?Math.abs(l.x-t.x)<=Math.abs(l.x-(t.x+t.width))?"left center":"right center":Math.abs(l.y-(t.y+t.height))<=Math.abs(l.y-t.y)?"center bottom":"center top")}catch(t){}const c=n.style;c.transformBox="fill-box",c.transformOrigin=b;const g=Math.max(1,r||1),u=performance.now(),x=e=>{if(t.globals.isDestroyed||!n.parentNode)return;const s=Math.max(0,Math.min(1,(e-u)/g)),a=1-Math.pow(1-s,3),r=1-a;c.transform=i?`scaleX(${r})`:`scaleY(${r})`,c.opacity=String(1-a),s<1?p.requestAnimationFrame(x):n.parentNode.removeChild(n)};p.requestAnimationFrame(x)})}class C{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:g,barWidth:p,barXPosition:u,barYPosition:x,visibleSeries:f}=t,v=this.w,y=new c(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+g*(f+1)-m):(C=e+p*f,w=s+g*f);let P=null,I=null,H=e,R=s,W={};const k=v.config.dataLabels,L=this.barCtx.barOptions.dataLabels,X=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 D=k.offsetX,A=k.offsetY;let S={width:0,height:0};if(v.config.dataLabels.enabled){const t=v.seriesData.series[r][o];S=y.getTextRects(v.config.dataLabels.formatter?v.config.dataLabels.formatter(t,l(n({},v),{seriesIndex:r,dataPointIndex:o,w:v})):v.formatters.yLabelFormatters[0](t),parseFloat(k.style.fontSize).toString())}const F={x:e,y:s,i:r,j:o,realIndex:h,columnGroupIndex:d,bcx:C,bcy:w,barHeight:g,barWidth:p,textRects:S,strokeWidth:m,dataLabelsX:H,dataLabelsY:R,dataLabelsConfig:k,barDataLabelsConfig:L,barTotalDataLabelsConfig:X,offX:D,offY:A};return W=this.barCtx.isHorizontal?this.calculateBarsDataLabelsPosition(F):this.calculateColumnsDataLabelsPosition(F),P=this.drawCalculatedDataLabels({x:W.dataLabelsX,y:W.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:g,textRects:S,dataLabelsConfig:k}),v.config.chart.stacked&&X.enabled&&(I=this.drawTotalDataLabels({x:W.totalDataLabelsX,y:W.totalDataLabelsY,barWidth:p,barHeight:g,realIndex:h,textAnchor:W.totalDataLabelsAnchor,val:this.getStackedTotalDataLabel({realIndex:h,j:o}),dataLabelsConfig:k,barTotalDataLabelsConfig:X})),{dataLabelsPos:W,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,l(n({},s),{seriesIndex:t,dataPointIndex:e,w:s}))),a}calculateColumnsDataLabelsPosition(t){const e=this.w;let s,a,{i:i,j:r,realIndex:o,y:n,bcx:l,barWidth:h,barHeight:d,textRects:b,dataLabelsX:g,dataLabelsY:p,dataLabelsConfig:u,barDataLabelsConfig:x,barTotalDataLabelsConfig:f,strokeWidth:v,offX:y,offY:m}=t;const C=l;d=Math.abs(d);const w="vertical"===e.config.plotOptions.bar.dataLabels.orientation,{zeroEncounters:P}=this.barCtx.barHelpers.getZeroValueEncounters({i:i,j:r});l-=v/2;const I=e.layout.gridWidth/e.globals.dataPoints;if(this.barCtx.isVerticalGroupedRangeBar?g+=h/2:(g=e.axisFlags.isXNumeric?l-h/2+y:l-I+h/2+y,!e.config.chart.stacked&&P>0&&e.config.plotOptions.bar.hideZeroBarsWhenGrouped&&(g-=h*P)),w){const t=2;g=g+b.height/2-v/2-t}const H=e.seriesData.series[i][r]<0;let R=n;switch(this.barCtx.isReversed&&(R=n+(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 W=R;if(e.labelData.seriesGroups.forEach(t=>{var e;null==(e=this.barCtx[t.join(",")])||e.prevY.forEach(t=>{W=H?Math.max(t[r],W):Math.min(t[r],W)})}),this.barCtx.lastActiveBarSerieIndex===o&&f.enabled){const t=18,i=new c(this.barCtx.w).getTextRects(this.getStackedTotalDataLabel({realIndex:o,j:r}),u.fontSize);s=H?W-i.height/2-m-f.offsetY+t:W+i.height+m+f.offsetY-t;const n=I;a=C+(e.axisFlags.isXNumeric?-h*e.globals.barGroups.length/2:e.globals.barGroups.length*h/2-(e.globals.barGroups.length-1)*h-n)+f.offsetX}return e.config.chart.stacked||(p<0?p=0+v:p+b.height/3>e.layout.gridHeight&&(p=e.layout.gridHeight-v)),{bcx:l,bcy:n,dataLabelsX:g,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:n,barHeight:l,barWidth:h,textRects:d,dataLabelsX:b,strokeWidth:g,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=n+l/2+v-(null!=(e=d.centerOffset)?e:0)}else C=n-(this.barCtx.isRangeBar?0:y)+l/2+d.height/2+v-3;!s.config.chart.stacked&&m>0&&s.config.plotOptions.bar.hideZeroBarsWhenGrouped&&(C-=l*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-g-f:R-h+g+f;break;case"top":b=H?R-g-f:R-g+f}let W=R;if(s.labelData.seriesGroups.forEach(t=>{var e;null==(e=this.barCtx[t.join(",")])||e.prevX.forEach(t=>{W=H?Math.min(t[r],W):Math.max(t[r],W)})}),this.barCtx.lastActiveBarSerieIndex===o&&x.enabled){const t=new c(this.barCtx.w).getTextRects(this.getStackedTotalDataLabel({realIndex:o,j:r}),p.fontSize);H?(w=W-g-f-x.offsetX,I="end"):w=W+f+x.offsetX+(this.barCtx.isReversed?-(h+g):g),P=C-d.height/2+t.height/2+x.offsetY+g,s.globals.barGroups.length>1&&(P-=s.globals.barGroups.length/2*(l/2))}return s.config.chart.stacked||("start"===p.textAnchor?b-d.width<0?b=H?d.width+g-f:g+f:b+d.width>s.layout.gridWidth&&(b=H?s.layout.gridWidth-g:s.layout.gridWidth-d.width-g):"middle"===p.textAnchor?b-d.width/2<0?b=d.width/2+g:b+d.width/2>s.layout.gridWidth&&(b=s.layout.gridWidth-d.width/2-g):"end"===p.textAnchor&&(b<1?b=d.width+g:b+1>s.layout.gridWidth&&(b=s.layout.gridWidth-d.width-g))),{bcx:a,bcy:n,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}){var b,p;const u=this.w;let x="rotate(0)";"vertical"===u.config.plotOptions.bar.dataLabels.orientation&&(x=`rotate(-90, ${t}, ${e})`);const v=new g(this.barCtx.w,this.barCtx.ctx),y=new c(this.barCtx.w),m=d.formatter;let C=null;const w=u.globals.collapsedSeriesIndices.indexOf(a)>-1;if(d.enabled&&!w){C=y.group({class:"apexcharts-data-labels",transform:x});const c=u.config.dataLabels;((null==(b=c.animate)?void 0:b.enabled)||(null==(p=c.countUp)?void 0:p.enabled))&&(C.node.setAttribute("data:dlKey",`${a}::${f(u,a,i)}`),C.node.setAttribute("data:dlJ",String(i)),"number"==typeof s&&isFinite(s)&&C.node.setAttribute("data:dlVal",String(s)));let g="";void 0!==s&&(g=m(s,l(n({},u),{seriesIndex:a,dataPointIndex:i,w:u}))),!s&&u.config.plotOptions.bar.hideZeroBarsWhenGrouped&&(g="");const w=u.seriesData.series[a][i]<0,P=u.config.plotOptions.bar.dataLabels.position;if("vertical"===u.config.plotOptions.bar.dataLabels.orientation&&("top"===P&&(d.textAnchor=w?"end":"start"),"center"===P&&(d.textAnchor="middle"),"bottom"===P&&(d.textAnchor=w?"end":"start")),this.barCtx.isRangeBar&&this.barCtx.barOptions.dataLabels.hideOverflowingLabels){h<y.getTextRects(g,parseFloat(d.style.fontSize).toString()).width&&(g="")}u.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 I=n({},d);this.barCtx.isHorizontal&&s<0&&("start"===d.textAnchor?I.textAnchor="end":"end"===d.textAnchor&&(I.textAnchor="start")),v.plotDataLabelsText({x:t,y:e,text:g,i:a,j:i,parent:C,dataLabelsConfig:I,alwaysDrawDataLabel:!0,offsetCorrection:!0})}return C}drawTotalDataLabels({x:t,y:e,val:s,realIndex:a,textAnchor:i,barTotalDataLabelsConfig:r}){const o=new c(this.barCtx.w);let n;return r.enabled&&void 0!==t&&void 0!==e&&this.barCtx.lastActiveBarSerieIndex===a&&(n=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})),n}}const w=b.__apex_Series,P=b.__apex_Fill,I=b.__apex_Utils;class H{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),I.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,n,l,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),n=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),n=r/b*parseInt(this.barCtx.barOptions.columnWidth,10)/100,n<1&&(n=1)}if(-1===String(this.barCtx.barOptions.columnWidth).indexOf("%")&&(n=parseInt(this.barCtx.barOptions.columnWidth,10)),l=e.layout.gridHeight-this.barCtx.baseLineY[this.barCtx.translationsIndex]-(this.barCtx.isReversed?e.layout.gridHeight:0)+(this.barCtx.isReversed?2*this.barCtx.baseLineY[this.barCtx.translationsIndex]:0),e.axisFlags.isXNumeric){s=this.barCtx.getBarXForNumericXAxis({x:s,j:0,realIndex:t,barWidth:n}).x}else s=e.globals.padHorizontal+I.noExponents(r-n*this.barCtx.seriesLen)/2}return e.globals.barHeight=o,e.globals.barWidth=n,{x:s,y:a,yDivision:i,xDivision:r,barHeight:o,barWidth:n,zeroH:l,zeroW:h}}initializeStackedPrevVars(t){t.w.labelData.seriesGroups.forEach(e=>{t[e]||(t[e]={}),t[e].prevY=[],t[e].prevX=[],t[e].prevYF=[],t[e].prevXF=[],t[e].prevYVal=[],t[e].prevXVal=[]})}initializeStackedXYVars(t){t.w.labelData.seriesGroups.forEach(e=>{t[e]||(t[e]={}),t[e].xArrj=[],t[e].xArrjF=[],t[e].xArrjVal=[],t[e].yArrj=[],t[e].yArrjF=[],t[e].yArrjVal=[]})}getPathFillColor(t,e,s,a){var i,r,o,n;const l=this.w,h=new P(this.barCtx.w);let d=null;const b=this.barCtx.barOptions.distributed?s:e;let c=!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,c=!0)})}return{color:h.fillPath({seriesNumber:this.barCtx.barOptions.distributed?b:a,dataPointIndex:s,color:d,value:t[e][s],fillConfig:null==(i=l.config.series[e].data[s])?void 0:i.fill,fillType:(null==(o=null==(r=l.config.series[e].data[s])?void 0:r.fill)?void 0:o.type)?null==(n=l.config.series[e].data[s])?void 0:n.fill.type:Array.isArray(l.config.fill.type)?l.config.fill.type[a]:l.config.fill.type}),useRangeColor:c}}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 n=this.w.config.chart.type;for(let e=0;e<r;e++){const s=[],a=[];let l=0;for(let r=0;r<i;r++){const i=t[r][e];i>0?(s.push(r),l++):i<0&&(a.push(r),l++)}if(s.length>0&&0===a.length)if(1===s.length)o[s[0]][e]="bar"===n&&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"===n&&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===l){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 n=this.w,l=new c(this.barCtx.w),h=new w(this.barCtx.w).getActiveConfigSeriesIndex();if(this.barCtx.barOptions.colors.backgroundBarColors.length>0&&h===e){t>=this.barCtx.barOptions.colors.backgroundBarColors.length&&(t%=this.barCtx.barOptions.colors.backgroundBarColors.length);const e=this.barCtx.barOptions.colors.backgroundBarColors[t],h=l.drawRect(void 0!==s?s:0,void 0!==i?i:0,void 0!==a?a:n.layout.gridWidth,void 0!==r?r:n.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:n,realIndex:l,i:h,j:d,w:b}){var g,p,u;const x=new c(this.barCtx.w);(i=Array.isArray(i)?i[l]:i)||(i=0);let f=t,v=e;(null==(g=b.config.series[l].data[d])?void 0:g.columnWidthOffset)&&(v=e-b.config.series[l].data[d].columnWidthOffset/2,f=t+b.config.series[l].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[l][d]?" Z":" z";let H=x.move(m,s)+x.line(m,a)+x.line(C,a)+P+I;"none"!==this.arrBorderRadius[l][d]&&(H=x.roundPathCorners(H,b.config.plotOptions.bar.borderRadius));let R=null;const W=null==(u=null==(p=this.barCtx.ctx)?void 0:p.morphTypeChange)?void 0:u.getInitialPathFor(l,d);if(W?R=W:b.globals.previousPaths.length>0&&(R=this.barCtx.getPreviousPath(l,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[n],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:n}){var l,h;const d=new c(this.barCtx.w),b=n.layout.gridWidth/2,g=t=>Math.abs(t/this.barCtx.invertedYRatio)/2,p=g(s[a][i]),u=i===s[a].length-1,x="taper"===n.config.plotOptions.funnel.lastShape?"taper":"flat";let f;f=u?"taper"===x?0:p:g(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 W=null==(h=null==(l=this.barCtx.ctx)?void 0:l.morphTypeChange)?void 0:h.getInitialPathFor(r,i);return W?R=W:n.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 n=0;const l=[];for(let t=0;t<i.length;t++){const e=n/r;n+=i[t];const a=n/r,h=e*s,d=a*s;l.push({y:h,height:d-h,topHalf:e*o,bottomHalf:a*o})}return l}getPyramidPaths({barYPosition:t,barHeight:e,topHalf:s,bottomHalf:a,realIndex:i,j:r,strokeWidth:o,w:n}){var l,h;const d=new c(this.barCtx.w),b=n.layout.gridWidth/2,g=o/2,p=t+g,u=t+e-g,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==(l=this.barCtx.ctx)?void 0:l.morphTypeChange)?void 0:h.getInitialPathFor(i,r);return w?C=w:n.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:n,realIndex:l,i:h,j:d,w:b}){var g,p,u;const x=new c(this.barCtx.w);(i=Array.isArray(i)?i[l]:i)||(i=0);let f=t,v=e;(null==(g=b.config.series[l].data[d])?void 0:g.barHeightOffset)&&(f=t-b.config.series[l].data[d].barHeightOffset/2,v=e+b.config.series[l].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[l][d]?" Z":" z";let W=x.move(s,m)+x.line(a,m)+x.line(a,C)+H+R;"none"!==this.arrBorderRadius[l][d]&&(W=x.roundPathCorners(W,b.config.plotOptions.bar.borderRadius));let k=null;const L=null==(u=null==(p=this.barCtx.ctx)?void 0:p.morphTypeChange)?void 0:u.getInitialPathFor(l,d);if(L?k=L:b.globals.previousPaths.length>0&&(k=this.barCtx.getPreviousPath(l,d,W)),null==k){const t=P?x.line(I,C):H;k=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[n],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:W,pathFrom:k}}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],l(n({},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 c(this.barCtx.w),n=o.group({className:"apexcharts-bar-goals-groups"});n.node.classList.add("apexcharts-element-hidden"),this.barCtx.w.globals.delayedElements.push({el:n.node}),n.attr("clip-path",`url(#gridRectMarkerMask${this.barCtx.w.globals.cuid})`);let l=null;return this.barCtx.isHorizontal?Array.isArray(s)&&s.forEach(t=>{if(t.x>=-1&&t.x<=o.w.layout.gridWidth+1){const s=void 0!==t.attrs.strokeHeight?t.attrs.strokeHeight:r/2,a=e+s+r/2;l=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),n.add(l)}}):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;l=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),n.add(l)}}),n}drawBarShadow({prevPaths:t,currPaths:e,color:s,realIndex:a,j:i}){const r=this.w,{x:o,x1:n,barYPosition:l}=t,{x:h,x1:d,barYPosition:b}=e,g=l+e.barHeight,p=new c(this.barCtx.w),u=new I,x=p.move(n,g)+p.line(o,g)+p.line(h,b)+p.line(d,b)+p.line(n,g)+("around"===r.config.plotOptions.bar.borderRadiusApplication||"both"===this.arrBorderRadius[a][i]?" Z":" z");return p.drawPath({d:x,fill:u.shadeColor(.5,I.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 R=b.__apex_CoreUtils,W=b.__apex_Filters,k=b.__apex_Animations_computeStagger;class L{static xRatio(t){const e=t.layout.gridWidth||1;return(t.globals.maxX-t.globals.minX)/e}static dataXToPx(t,e){return(e-t.globals.minX)/L.xRatio(t)}static pxToDataX(t,e){return t.globals.minX+e*L.xRatio(t)}}class X{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._layoutShiftCache=null,this.series=[],this.elSeries=null,this.visibleI=0,this.isReversed=!1;const a=new w(this.w);this.lastActiveBarSerieIndex=a.getActiveConfigSeriesIndex("desc",["bar","column"]),this.columnGroupIndices=[];const i=a.getBarSeriesIndices(),r=new R(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 H(this)}draw(t,e){var s,a,i;const r=this.w,o=new c(this.w),h=new R(this.w);t=h.getLogSeries(t),this.series=t,this.yRatio=h.getLogYRatios(this.yRatio),this.barHelpers.initVariables(t);const d=o.group({class:"apexcharts-bar-series apexcharts-plot-series"});r.config.dataLabels.enabled&&(this.totalItems,this.barOptions.dataLabels.maxItems);for(let h=0,b=0;h<t.length;h++,b++){let c,g;const p=[],u=[],x=r.globals.comboCharts?e[h]:h,{columnGroupIndex:v}=this.barHelpers.getGroupIndex(x),y=o.group({class:"apexcharts-series",rel:h+1,seriesName:I.escapeString(r.seriesData.seriesNames[x]),"data:realIndex":x});w.addCollapsedClassToSeries(this.w,y,x),t[h].length>0&&(this.visibleI=this.visibleI+1),this.yRatio.length>1&&(this.yaxisIndex=r.globals.seriesYAxisReverseMap[x],this.translationsIndex=x);const C=this.translationsIndex;this.isReversed=r.config.yaxis[this.yaxisIndex]&&r.config.yaxis[this.yaxisIndex].reversed,this.isPyramid&&(this.pyramidLayout=this.barHelpers.computePyramidLayout(t[h]));const P=this.barHelpers.initialPositions(x),{y:H,yDivision:R,zeroW:k,x:L,xDivision:X,zeroH:D}=P;let A=P.barHeight,S=P.barWidth;g=H,c=L,this.isHorizontal||u.push(c+(null!=S?S:0)/2);const F=o.group({class:"apexcharts-datalabels","data:realIndex":x});r.globals.delayedElements.push({el:F.node,holdUntilComplete:!(null==(s=r.config.dataLabels.animate)?void 0:s.enabled)&&this.isLengthTransition(x)}),F.node.classList.add("apexcharts-element-hidden");const O=o.group({class:"apexcharts-bar-goals-markers"}),Y=o.group({class:"apexcharts-bar-shadows"});r.globals.delayedElements.push({el:Y.node}),Y.node.classList.add("apexcharts-element-hidden");for(let e=0;e<t[h].length;e++){const s=this.barHelpers.getStrokeWidth(h,e,x);let o=null;const d={indexes:{i:h,j:e,realIndex:x,translationsIndex:C,bc:b},x:c,y:g,strokeWidth:s,elSeries:y};this.isHorizontal?(o=this.drawBarPaths(l(n({},d),{barHeight:A,zeroW:k,yDivision:R})),S=this.series[h][e]/this.invertedYRatio):(o=this.drawColumnPaths(l(n({},d),{xDivision:X,barWidth:S,zeroH:D})),A=this.series[h][e]/this.yRatio[C]);const f=this.barHelpers.getPathFillColor(t,h,e,x);if(this.isFunnel&&!this.isPyramid&&this.barOptions.isFunnel3d&&"trapezoid"!==(null==(a=r.config.plotOptions.funnel)?void 0:a.shape)&&this.pathArr.length&&e>0){const t=this.barHelpers.drawBarShadow({color:"string"==typeof f.color&&-1===(null==(i=f.color)?void 0:i.indexOf("url"))?f.color:I.hexToRgba(r.globals.colors[h]),prevPaths:this.pathArr[this.pathArr.length-1],currPaths:o,realIndex:x,j:e});if(Y.add(t),r.config.chart.dropShadow.enabled){new W(this.w).dropShadow(t,r.config.chart.dropShadow,x)}}this.pathArr.push(o);const m=this.barHelpers.drawGoalLine({barXPosition:o.barXPosition,barYPosition:o.barYPosition,goalX:o.goalX,goalY:o.goalY,barHeight:A,barWidth:S});m&&O.add(m),g=o.y,c=o.x,e>0&&u.push(c+(null!=S?S:0)/2),p.push(g),this.renderSeries(l(n({realIndex:x,pathFill:f.color},f.useRangeColor?{lineFill:f.color}:{}),{j:e,i:h,columnGroupIndex:v,pathFrom:o.pathFrom,pathTo:o.pathTo,strokeWidth:s,elSeries:y,x:c,y:g,series:t,barHeight:Math.abs(o.barHeight?o.barHeight:A),barWidth:Math.abs(o.barWidth?o.barWidth:S),elDataLabelsWrap:F,elGoalsMarkers:O,elBarShadows:Y,visibleSeries:this.visibleI,type:"bar"}))}if(r.globals.seriesXvalues[x]=u,r.globals.seriesYvalues[x]=p,r.globals.previousPaths.length>0){const e=[];for(let s=0;s<t[h].length;s++)e.push(f(r,x,s));m({w:r,elSeries:y,record:this._prevRecord(x),newKeys:e,isHorizontal:this.isHorizontal,speed:r.config.chart.animations.dynamicAnimation.speed})}d.add(y)}return d}renderSeries({realIndex:t,pathFill:e,lineFill:s,j:a,i:i,columnGroupIndex:r,pathFrom:o,pathTo:n,strokeWidth:l,elSeries:h,x:d,y:b,y1:g,y2:p,series:u,barHeight:x,barWidth:v,barXPosition:y,barYPosition:m,elDataLabelsWrap:w,elGoalsMarkers:P,elBarShadows:I,visibleSeries:H,type:R,classes:L}){var X;const D=this.w,A=new c(this.w,this.ctx),S=function(t,e){const s=t&&t.renderer;return s&&s.kind&&"svg"!==s.kind?s:e}(this.ctx,A);let F=!1;if(h._bindingsDelegated||(h._bindingsDelegated=!0,A.setupEventDelegation(h,`.apexcharts-${R}-area`)),!s){let e=function(t){const e=D.config.stroke.colors;let s;return Array.isArray(e)&&e.length>0&&(s=e[t],s||(s=""),"function"==typeof s)?s({value:D.seriesData.series[t][a],dataPointIndex:a,w:D}):s};const i="function"==typeof D.globals.stroke.colors[t]?e(t):D.globals.stroke.colors[t];s=this.barOptions.distributed?D.globals.stroke.colors[a]:i}const O=new C(this).handleBarDataLabels({x:d,y:b,y1:g,y2:p,i:i,j:a,series:u,realIndex:t,columnGroupIndex:r,barHeight:x,barWidth:v,barXPosition:y,barYPosition:m,visibleSeries:H});D.globals.isBarHorizontal||(O.dataLabelsPos.dataLabelsX+Math.max(v,D.globals.barPadForNumericAxis)<0||O.dataLabelsPos.dataLabelsX-Math.max(v,D.globals.barPadForNumericAxis)>D.layout.gridWidth)&&(F=!0),D.config.series[i].data[a]&&D.config.series[i].data[a].strokeColor&&(s=D.config.series[i].data[a].strokeColor),this.isNullValue&&(e="none");const Y=D.config.chart.animations,j=Y.animateGradually;let B=0;if(j&&!1!==j.enabled&&!(D.globals.dataChanged&&this.isLayoutShift(t))){const t=D.globals.dataPoints||1,e=j.delay||0,s=Math.min(e,.5*Y.speed/Math.max(1,t));let r=k({style:"sequential",index:a,baseDelay:s});D.config.chart.stacked&&(r+=i*s*.5);B=r/(e||1)}if(!F){const r=!0===(null==(X=this.ctx.morphTypeChange)?void 0:X.isActive())?this.ctx.morphTypeChange.getSpeed():D.config.chart.animations.dynamicAnimation.speed,d=S.renderPaths({i:i,j:a,realIndex:t,pathFrom:o,pathTo:n,stroke:s,strokeWidth:l,strokeLineCap:D.config.stroke.lineCap,fill:e,animationDelay:B,initialSpeed:D.config.chart.animations.speed,dataChangeSpeed:r,className:`apexcharts-${R}-area ${L}`,chartType:R,bindEventsOnPaths:!1});d.attr("clip-path",`url(#gridRectBarMask${D.globals.cuid})`);const b=D.config.forecastDataPoints;b.count>0&&a>=D.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!==g&&void 0!==p&&(d.attr("data-range-y1",g),d.attr("data-range-y2",p));new W(this.w).setSelectionFilter(d,t,a),h.add(d),d.attr({cy:O.dataLabelsPos.bcy,cx:O.dataLabelsPos.bcx,j:a,val:D.seriesData.series[i][a],barHeight:x,barWidth:v,"data:pathKey":f(D,t,a)}),"canvas"===S.kind&&(D.globals.barCanvasCoords||(D.globals.barCanvasCoords={}),D.globals.barCanvasCoords[t]||(D.globals.barCanvasCoords[t]={}),D.globals.barCanvasCoords[t][a]={cx:O.dataLabelsPos.bcx,cy:O.dataLabelsPos.bcy,barWidth:v}),null!==O.dataLabels&&w.add(O.dataLabels),O.totalDataLabels&&w.add(O.totalDataLabels),h.add(w),P&&h.add(P),I&&h.add(I)}return h}drawBarPaths({indexes:t,barHeight:e,strokeWidth:s,zeroW:a,x:i,y:r,yDivision:o,elSeries:n}){const l=this.w,h=t.i,d=t.j;let b;if(l.axisFlags.isXNumeric)b=(r=(l.seriesData.seriesX[h][d]-l.globals.minX)/this.invertedXRatio-e)+e*this.visibleI;else if(l.config.plotOptions.bar.hideZeroBarsWhenGrouped){const{nonZeroColumns:t,zeroEncounters:s}=this.barHelpers.getZeroValueEncounters({i:h,j:d});t>0&&(e=this.seriesLen*e/t),b=r+e*this.visibleI,b-=e*s}else b=r+e*this.visibleI;const c=this.isFunnel&&"trapezoid"===l.config.plotOptions.funnel.shape,g=this.isPyramid&&this.pyramidLayout?this.pyramidLayout[d]:null,p=!!g;if(g)b=g.y,e=g.height;else if(this.isFunnel&&!c){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=g?this.barHelpers.getPyramidPaths({barYPosition:b,barHeight:e,topHalf:g.topHalf,bottomHalf:g.bottomHalf,realIndex:t.realIndex,j:d,strokeWidth:s,w:l}):c?this.barHelpers.getFunnelTrapezoidPaths({barYPosition:b,barHeight:e,series:this.series,i:h,j:d,realIndex:t.realIndex,strokeWidth:s,w:l}):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:l}),(c||p)&&(a=u.x1,i=u.x),l.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:n}),{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:n}){const l=this.w,h=t.realIndex,d=t.translationsIndex,b=t.i,c=t.j,g=t.bc;let p;if(l.axisFlags.isXNumeric){const t=this.getBarXForNumericXAxis({x:e,j:c,realIndex:h,barWidth:i});e=t.x,p=t.barXPosition}else if(l.config.plotOptions.bar.hideZeroBarsWhenGrouped){const{nonZeroColumns:t,zeroEncounters:s}=this.barHelpers.getZeroValueEncounters({i:b,j:c});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][c],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:c,w:l});return l.axisFlags.isXNumeric||(e+=a),this.barHelpers.barBackground({bc:g,j:c,i:b,x1:p-o/2-i*this.visibleI,x2:i*this.seriesLen+o/2,elSeries:n}),{pathTo:u.pathTo,pathFrom:u.pathFrom,x:e,y:s,goalY:this.barHelpers.getGoalValues("y",null,r,b,c,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),I.isNumber(i.seriesData.seriesX[r][a])&&(t=L.dataXToPx(i,i.seriesData.seriesX[r][a])-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(x(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(f(a,t,s))){i=!0;break}}else i=o>0}return this._ltCache[t]=i,i}isLayoutShift(t){if(this.isLengthTransition(t))return!0;if(this._layoutShiftCache||(this._layoutShiftCache={}),void 0!==this._layoutShiftCache[t])return this._layoutShiftCache[t];const e=y(this.w,t,!0,!0),s=!(!e||!e.join.changed);return this._layoutShiftCache[t]=s,s}getPreviousPath(t,e,s){const a=this.w,i=this._prevRecord(t);if(!i)return x(a)?null:s;let r=null,o=!1;const n=this._prevKeyedPaths(t);if(n){const s=n.get(f(a,t,e));s?r=s.d:o=!0}else void 0!==i.paths[e]?r=i.paths[e].d:o=!0;return r&&X.pathCommandCount(r)===X.pathCommandCount(s)?r:o&&x(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:X,column:X,barStacked:class extends X{draw(t,e){const s=this.w;this.graphics=new c(this.w),this.bar=new X(this.w,this.ctx,this.xyRatios);const a=new R(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:c}=this.barHelpers.getGroupIndex(d);this.groupCtx=this[s.labelData.seriesGroups[b]];const g=[],p=[];let u=0;this.yRatio.length>1&&(this.yaxisIndex=s.globals.seriesYAxisReverseMap[d][0],u=d),this.isReversed=s.config.yaxis[this.yaxisIndex]&&s.config.yaxis[this.yaxisIndex].reversed;let x=this.graphics.group({class:"apexcharts-series",seriesName:I.escapeString(s.seriesData.seriesNames[d]),rel:a+1,"data:realIndex":d});w.addCollapsedClassToSeries(this.w,x,d);const f=this.graphics.group({class:"apexcharts-datalabels","data:realIndex":d}),v=this.graphics.group({class:"apexcharts-bar-goals-markers"}),y=this.initialPositions(r,o,void 0,void 0,void 0,void 0,u),{xDivision:m,yDivision:C,zeroH:P,zeroW:H}=y;let R=y.barHeight,W=y.barWidth;o=y.y,r=y.x,s.globals.barHeight=R,s.globals.barWidth=W,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(()=>P),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),y={indexes:{i:a,j:e,realIndex:d,translationsIndex:u,bc:h},strokeWidth:i,x:r,y:o,elSeries:x,columnGroupIndex:c,seriesGroup:s.labelData.seriesGroups[b]};let w=null;this.isHorizontal?(w=this.drawStackedBarPaths(l(n({},y),{zeroW:H,barHeight:R,yDivision:C})),W=this.series[a][e]/this.invertedYRatio):(w=this.drawStackedColumnPaths(l(n({},y),{xDivision:m,barWidth:W,zeroH:P})),R=this.series[a][e]/this.yRatio[u]);const I=this.barHelpers.drawGoalLine({barXPosition:w.barXPosition,barYPosition:w.barYPosition,goalX:w.goalX,goalY:w.goalY,barHeight:R,barWidth:W});I&&v.add(I),o=w.y,r=w.x,g.push(r),p.push(o);const k=this.barHelpers.getPathFillColor(t,a,e,d);let L="";const X=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=X),x=this.renderSeries(l(n({realIndex:d,pathFill:k.color},k.useRangeColor?{lineFill:k.color}:{}),{j:e,i:a,columnGroupIndex:c,pathFrom:w.pathFrom,pathTo:w.pathTo,strokeWidth:i,elSeries:x,x:r,y:o,series:t,barHeight:R,barWidth:W,elDataLabelsWrap:f,elGoalsMarkers:v,type:"bar",visibleSeries:c,classes:L}))}s.globals.seriesXvalues[d]=g,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(x)}return i}initialPositions(t,e,s,a,i,r,o){const n=this.w;let l,h;if(this.isHorizontal){a=n.layout.gridHeight/n.globals.dataPoints;const t=n.config.plotOptions.bar.barHeight;l=-1===String(t).indexOf("%")?parseInt(t,10):a*parseInt(t,10)/100,r=n.globals.padHorizontal+(this.isReversed?n.layout.gridWidth-this.baseLineInvertedY:this.baseLineInvertedY),e=(a-l)/2}else{h=s=n.layout.gridWidth/n.globals.dataPoints;const e=n.config.plotOptions.bar.columnWidth;n.axisFlags.isXNumeric&&n.globals.dataPoints>1?h=(s=n.globals.minXDiff/this.xRatio)*parseInt(this.barOptions.columnWidth,10)/100:-1===String(e).indexOf("%")?h=parseInt(e,10):h*=parseInt(e,10)/100,i=this.isReversed?this.baseLineY[o]:n.layout.gridHeight-this.baseLineY[o],t=n.globals.padHorizontal+(s-h)/2}const d=n.globals.barGroups.length||1;return{x:t,y:e,yDivision:a,xDivision:s,barHeight:(null!=l?l: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:n,yDivision:l,elSeries:h}){var d,b,c,g,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=n.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==(c=this.series[v])?void 0:c[y])?f:f+(null==(g=this.series[v])?void 0:g[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:n,i:v,j:y,w:u});return this.barHelpers.barBackground({j:y,i:v,y1:x,y2:e,elSeries:h}),r+=l,{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:n,elSeries:l}){var h,d,b,c,g,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 W=y;if(n&&(W=n.indexOf(v.seriesData.seriesNames[w])),W>0&&!v.axisFlags.isXNumeric||W>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[W-1]&&this.groupCtx.prevY[W-1].length)for(let t=1;t<s;t++)if(!isNaN(null==(h=this.groupCtx.prevY[W-t])?void 0:h[m])){e=this.groupCtx.prevY[W-t][m];break}for(let a=1;a<s;a++){if((null==(d=this.groupCtx.prevYVal[W-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==(c=this.groupCtx.prevYVal[W-a])?void 0:c[m])>=0){t=(null==(g=this.series[y])?void 0:g[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,W).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 k=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:n,realIndex:t.realIndex,i:y,j:m,w:v});return this.barHelpers.barBackground({bc:C,j:m,i:y,x1:I,x2:i,elSeries:l}),{pathTo:k.pathTo,pathFrom:k.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 X{draw(t,e){var s,a,i,r,o,l,h,d,b;const g=this.w,p=new c(this.w);this.rangeBarOptions=this.w.config.plotOptions.rangeBar,this.series=t,this.seriesRangeStart=g.rangeData.seriesRangeStart,this.seriesRangeEnd=g.rangeData.seriesRangeEnd,this.barHelpers.initVariables(t);const u=p.group({class:"apexcharts-rangebar-series apexcharts-plot-series"});for(let c=0;c<t.length;c++){let x,f;const v=g.globals.comboCharts?e[c]:c,{columnGroupIndex:y}=this.barHelpers.getGroupIndex(v),m=p.group({class:"apexcharts-series",seriesName:I.escapeString(g.seriesData.seriesNames[v]),rel:c+1,"data:realIndex":v});w.addCollapsedClassToSeries(this.w,m,v),t[c].length>0&&(this.visibleI=this.visibleI+1);let C=0;this.yRatio.length>1&&(this.yaxisIndex=g.globals.seriesYAxisReverseMap[v][0],C=v);const P=this.barHelpers.initialPositions(v),{y:H,zeroW:R,x:W,zeroH:k}=P;let L=null!=(s=P.barWidth)?s:0,X=null!=(a=P.barHeight)?a:0;const D=null!=(i=P.yDivision)?i:0,A=null!=(r=P.xDivision)?r:0;f=H,x=W;const S=p.group({class:"apexcharts-datalabels","data:realIndex":v}),F=p.group({class:"apexcharts-rangebar-goals-markers"});for(let e=0;e<g.globals.dataPoints;e++){const s=this.barHelpers.getStrokeWidth(c,e,v),a=this.seriesRangeStart[c][e],i=this.seriesRangeEnd[c][e];let r=null,p=null,u=null;const w={x:x,y:f,strokeWidth:s,elSeries:m};let I=this.seriesLen;if(g.config.plotOptions.bar.rangeBarGroupRows&&(I=1),void 0===(null==(o=g.config.series[c].data)?void 0:o[e]))break;if(this.isHorizontal){u=f+X*this.visibleI;const t=(D-X*I)/2;if(null==(h=null==(l=g.config.series[c].data)?void 0:l[e])?void 0:h.x){const s=this.detectOverlappingBars({i:c,j:e,barYPosition:u,srty:t,barHeight:X,yDivision:D,initPositions:P});X=s.barHeight,u=s.barYPosition}r=this.drawRangeBarPaths(n({indexes:{i:c,j:e,realIndex:v},barHeight:X,barYPosition:u,zeroW:R,yDivision:D,y1:a,y2:i},w)),L=r.barWidth}else{g.axisFlags.isXNumeric&&(x=(g.seriesData.seriesX[c][e]-g.globals.minX)/this.xRatio-L/2),p=x+L*this.visibleI;const t=(A-L*I)/2;if(null==(b=null==(d=g.config.series[c].data)?void 0:d[e])?void 0:b.x){const s=this.detectOverlappingBars({i:c,j:e,barXPosition:p,srtx:t,barWidth:L,xDivision:A,initPositions:P});L=s.barWidth,p=s.barXPosition}r=this.drawRangeColumnPaths(n({indexes:{i:c,j:e,realIndex:v,translationsIndex:C},barWidth:L,barXPosition:p,zeroH:k,xDivision:A},w)),X=r.barHeight}const H=this.barHelpers.drawGoalLine({barXPosition:r.barXPosition,barYPosition:u,goalX:r.goalX,goalY:r.goalY,barHeight:X,barWidth:L});H&&F.add(H),f=r.y,x=r.x;const W=this.barHelpers.getPathFillColor(t,c,e,v);this.renderSeries({realIndex:v,pathFill:W.color,lineFill:W.useRangeColor?W.color:g.globals.stroke.colors[v],j:e,i:c,x:x,y:f,y1:a,y2:i,pathFrom:r.pathFrom,pathTo:r.pathTo,strokeWidth:s,elSeries:m,series:t,barHeight:X,barWidth:L,barXPosition:p,barYPosition:u,columnGroupIndex:y,elDataLabelsWrap:S,elGoalsMarkers:F,visibleSeries:this.visibleI,type:"rangebar"})}u.add(m)}return u}detectOverlappingBars({i:t,j:e,barYPosition:s,barXPosition:a,srty:i,srtx:r,barHeight:o,barWidth:n,yDivision:l,xDivision:h,initPositions:d}){var b,c,g,p;const u=this.w;let x=[];const f=null==(c=null==(b=u.config.series[t].data)?void 0:b[e])?void 0:c.rangeName,v=null==(p=null==(g=u.config.series[t].data)?void 0:g[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+l*m:i+o*this.visibleI+l*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+l*(100-parseInt(this.barOptions.barHeight,10))/100/2+o*(this.visibleI+x.indexOf(f))+l*m))):(m>-1&&!u.labelData.timescaleLabels.length&&(a=u.config.plotOptions.bar.rangeBarGroupRows?r+h*m:r+n*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=(n=d.barW