apexcharts 7.2.0 → 7.4.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/LICENSE +30 -11
- package/dist/apexcharts.common.js +2 -2
- package/dist/apexcharts.core.js +545 -463
- package/dist/apexcharts.core.min.js +2 -2
- package/dist/apexcharts.esm.js +1149 -801
- package/dist/apexcharts.js +684 -254
- package/dist/apexcharts.min.js +2 -2
- package/dist/apexcharts.ssr.common.js +2 -2
- package/dist/apexcharts.ssr.esm.js +684 -254
- package/dist/area.common.js +1 -1
- package/dist/area.esm.js +1 -1
- package/dist/bar.common.js +2 -2
- package/dist/bar.esm.js +20 -10
- package/dist/bar.js +2 -2
- package/dist/boxPlot.common.js +2 -2
- package/dist/boxPlot.esm.js +20 -10
- package/dist/bubble.common.js +1 -1
- package/dist/bubble.esm.js +1 -1
- package/dist/candlestick.common.js +2 -2
- package/dist/candlestick.esm.js +20 -10
- package/dist/candlestick.js +2 -2
- package/dist/column.common.js +2 -2
- package/dist/column.esm.js +20 -10
- package/dist/core.common.js +2 -2
- package/dist/core.esm.js +545 -463
- package/dist/donut.common.js +1 -1
- package/dist/donut.esm.js +1 -1
- package/dist/dumbbell.common.js +2 -2
- package/dist/dumbbell.esm.js +20 -10
- package/dist/features/all.common.js +2 -2
- package/dist/features/all.esm.js +364 -26
- package/dist/features/annotations.common.js +1 -1
- package/dist/features/annotations.esm.js +1 -1
- package/dist/features/annotations.js +1 -1
- package/dist/features/context-menu.common.js +1 -1
- package/dist/features/context-menu.esm.js +1 -1
- package/dist/features/context-menu.js +1 -1
- package/dist/features/drilldown.common.js +1 -1
- package/dist/features/drilldown.esm.js +1 -1
- package/dist/features/drilldown.js +1 -1
- package/dist/features/dumbbell.common.js +1 -1
- package/dist/features/dumbbell.esm.js +1 -1
- package/dist/features/dumbbell.js +1 -1
- package/dist/features/exports.common.js +2 -2
- package/dist/features/exports.esm.js +12 -14
- package/dist/features/exports.js +2 -2
- package/dist/features/facet.common.js +1 -1
- package/dist/features/facet.esm.js +1 -1
- package/dist/features/facet.js +1 -1
- package/dist/features/history.common.js +1 -1
- package/dist/features/history.esm.js +1 -1
- package/dist/features/history.js +1 -1
- package/dist/features/ink.common.js +1 -1
- package/dist/features/ink.esm.js +1 -1
- package/dist/features/ink.js +1 -1
- package/dist/features/keyboard.common.js +2 -2
- package/dist/features/keyboard.esm.js +14 -1
- package/dist/features/keyboard.js +2 -2
- package/dist/features/legend.common.js +1 -1
- package/dist/features/legend.esm.js +1 -1
- package/dist/features/legend.js +1 -1
- package/dist/features/link.common.js +1 -1
- package/dist/features/link.esm.js +38 -38
- package/dist/features/link.js +1 -1
- package/dist/features/marks.common.js +1 -1
- package/dist/features/marks.esm.js +1 -1
- package/dist/features/marks.js +1 -1
- package/dist/features/measure.common.js +1 -1
- package/dist/features/measure.esm.js +1 -1
- package/dist/features/measure.js +1 -1
- package/dist/features/morph.common.js +1 -1
- package/dist/features/morph.esm.js +1 -1
- package/dist/features/morph.js +1 -1
- package/dist/features/perspectives.common.js +1 -1
- package/dist/features/perspectives.esm.js +11 -11
- package/dist/features/perspectives.js +1 -1
- package/dist/features/raincloud.common.js +1 -1
- package/dist/features/raincloud.esm.js +1 -1
- package/dist/features/raincloud.js +1 -1
- package/dist/features/renderer-canvas.common.js +1 -1
- package/dist/features/renderer-canvas.esm.js +1 -1
- package/dist/features/renderer-canvas.js +1 -1
- package/dist/features/stats.common.js +1 -1
- package/dist/features/stats.esm.js +1 -1
- package/dist/features/stats.js +1 -1
- package/dist/features/storyboard.common.js +1 -1
- package/dist/features/storyboard.esm.js +11 -11
- package/dist/features/storyboard.js +1 -1
- package/dist/features/streamgraph.common.js +1 -1
- package/dist/features/streamgraph.esm.js +1 -1
- package/dist/features/streamgraph.js +1 -1
- package/dist/features/toolbar.common.js +2 -2
- package/dist/features/toolbar.esm.js +172 -25
- package/dist/features/toolbar.js +2 -2
- package/dist/features/trellis.common.js +1 -1
- package/dist/features/trellis.esm.js +1 -1
- package/dist/features/trellis.js +1 -1
- package/dist/features/waterfall.common.js +1 -1
- package/dist/features/waterfall.esm.js +1 -1
- package/dist/features/waterfall.js +1 -1
- package/dist/features/weave.common.js +2 -2
- package/dist/features/weave.esm.js +180 -2
- package/dist/features/weave.js +2 -2
- package/dist/heatmap.common.js +1 -1
- package/dist/heatmap.esm.js +1 -1
- package/dist/heatmap.js +1 -1
- package/dist/histogram.common.js +2 -2
- package/dist/histogram.esm.js +20 -10
- package/dist/line.common.js +1 -1
- package/dist/line.esm.js +1 -1
- package/dist/line.js +1 -1
- package/dist/pictograms.common.js +1 -1
- package/dist/pictograms.esm.js +1 -1
- package/dist/pictograms.js +1 -1
- package/dist/pie.common.js +1 -1
- package/dist/pie.esm.js +1 -1
- package/dist/pie.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/radar.js +1 -1
- package/dist/radialBar.common.js +1 -1
- package/dist/radialBar.esm.js +1 -1
- package/dist/radialBar.js +1 -1
- package/dist/raincloud.common.js +2 -2
- package/dist/raincloud.esm.js +20 -10
- package/dist/rangeArea.common.js +1 -1
- package/dist/rangeArea.esm.js +1 -1
- package/dist/rangeBar.common.js +2 -2
- package/dist/rangeBar.esm.js +20 -10
- package/dist/scatter.common.js +1 -1
- package/dist/scatter.esm.js +1 -1
- package/dist/streamgraph.common.js +1 -1
- package/dist/streamgraph.esm.js +1 -1
- package/dist/sunburst.common.js +1 -1
- package/dist/sunburst.esm.js +1 -1
- package/dist/sunburst.js +1 -1
- package/dist/treemap.common.js +1 -1
- package/dist/treemap.esm.js +1 -1
- package/dist/treemap.js +1 -1
- package/dist/unit-shapes.common.js +1 -1
- package/dist/unit-shapes.esm.js +1 -1
- package/dist/unit-shapes.js +1 -1
- package/dist/unit.common.js +1 -1
- package/dist/unit.esm.js +79 -79
- package/dist/unit.js +1 -1
- package/dist/violin.common.js +2 -2
- package/dist/violin.esm.js +20 -10
- package/dist/violin.js +2 -2
- package/dist/waterfall.common.js +2 -2
- package/dist/waterfall.esm.js +20 -10
- package/package.json +2 -2
- package/src/apexcharts.js +39 -15
- package/src/charts/common/bar/Helpers.js +31 -12
- package/src/modules/Data.js +8 -2
- package/src/modules/Exports.js +14 -12
- package/src/modules/Formatters.js +24 -1
- package/src/modules/Range.js +28 -1
- package/src/modules/Toolbar.js +112 -2
- package/src/modules/ZoomPanSelection.js +85 -7
- package/src/modules/accessibility/KeyboardNavigation.js +14 -0
- package/src/modules/axes/YAxis.js +12 -15
- package/src/modules/helpers/UpdateHelpers.js +25 -8
- package/src/modules/settings/Globals.js +5 -10
- package/src/modules/settings/Options.js +15 -0
- package/src/modules/weave/PluginAPI.js +57 -1
- package/src/modules/weave/WeaveHost.js +148 -0
- package/src/ssr/DOMShim.js +50 -0
- package/src/types/internal.d.ts +1 -1
- package/src/utils/Utils.js +6 -9
- package/types/apexcharts.d.ts +17 -0
package/dist/bar.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* ApexCharts v7.
|
|
2
|
+
* ApexCharts v7.4.0
|
|
3
3
|
* (c) 2018-2026 ApexCharts
|
|
4
4
|
*/
|
|
5
|
-
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).ApexBar={})}(this,function(t){"use strict";var e=Object.defineProperty,s=Object.defineProperties,a=Object.getOwnPropertyDescriptors,i=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable,n=(t,s,a)=>s in t?e(t,s,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[s]=a,l=(t,e)=>{for(var s in e||(e={}))r.call(e,s)&&n(t,s,e[s]);if(i)for(var s of i(e))o.call(e,s)&&n(t,s,e[s]);return t},h=(t,e)=>s(t,a(e));const d=globalThis.ApexCharts,b=globalThis.ApexCharts.__internals.__apex_Graphics,c=globalThis.ApexCharts.__internals.__apex_DataLabels,g=(t,e,s,a)=>{if("function"!=typeof t)return t;const i=t({series:e.seriesData.series,seriesIndex:s,dataPointIndex:a,w:e});return Number.isFinite(i)?i:0},u=globalThis.ApexCharts.__internals.__apex_BrowserAPIs_BrowserAPIs,p=globalThis.ApexCharts.__internals.__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)&&!!(p.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 b(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),p=performance.now(),x=e=>{if(t.globals.isDestroyed||!n.parentNode)return;const s=Math.max(0,Math.min(1,(e-p)/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?u.requestAnimationFrame(x):n.parentNode.removeChild(n)};u.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){var e,s;const{x:a,y:i,y1:r,y2:o,i:n,j:d,realIndex:c,columnGroupIndex:u,barHeight:p,barWidth:x,barXPosition:f,barYPosition:v,visibleSeries:y}=t,m=this.w,C=new b(this.barCtx.w),w=m.waterfallData&&m.waterfallData.values,I=w&&w[c]&&null!=w[c][d]?w[c][d]:null,P=Array.isArray(this.barCtx.strokeWidth)?this.barCtx.strokeWidth[c]:this.barCtx.strokeWidth;let L,H;m.axisFlags.isXNumeric&&!m.globals.isBarHorizontal?(L=a+x*(y+1),H=i+p*(y+1)-P):(L=a+x*y,H=i+p*y);let S=null,R=null,D=a,k=i,A={};const X=m.config.dataLabels,W=this.barCtx.barOptions.dataLabels,F=this.barCtx.barOptions.dataLabels.total;void 0!==v&&(this.barCtx.isRangeBar||this.barCtx.isPyramid)&&(H=v,k=v),void 0!==f&&this.barCtx.isVerticalGroupedRangeBar&&(L=f,D=f);const O=g(X.offsetX,m,c,d),Y=g(X.offsetY,m,c,d);let T={width:0,height:0};if(m.config.dataLabels.enabled){const t=null!==I?I:m.seriesData.series[c][d];T=C.getTextRects(m.config.dataLabels.formatter?m.config.dataLabels.formatter(t,h(l({},m),{seriesIndex:c,dataPointIndex:d,w:m})):m.formatters.yLabelFormatters[0](t),parseFloat(X.style.fontSize).toString(),X.style.fontFamily,void 0,!0,X.style.fontWeight)}const _={x:a,y:i,i:n,j:d,realIndex:c,columnGroupIndex:u,bcx:L,bcy:H,barHeight:p,barWidth:x,textRects:T,strokeWidth:P,dataLabelsX:D,dataLabelsY:k,dataLabelsConfig:X,barDataLabelsConfig:W,barTotalDataLabelsConfig:F,offX:O,offY:Y};if(A=this.barCtx.isHorizontal?this.calculateBarsDataLabelsPosition(_):this.calculateColumnsDataLabelsPosition(_),null!==I&&this.barCtx.isHorizontal&&"center"===W.position){const t=null==(s=null==(e=m.waterfallData.geometry)?void 0:e[c])?void 0:s[d];t&&t.horizontal&&(A.dataLabelsX=(t.levelStart+t.levelEnd)/2+O)}return S=this.drawCalculatedDataLabels({x:A.dataLabelsX,y:A.dataLabelsY,val:null!==I?I:this.barCtx.isRangeBar?[r,o]:"100%"===m.config.chart.stackType?m.globals.seriesPercent[c][d]:m.seriesData.series[c][d],i:c,j:d,barWidth:x,barHeight:p,textRects:T,dataLabelsConfig:X}),m.config.chart.stacked&&F.enabled&&(R=this.drawTotalDataLabels({x:A.totalDataLabelsX,y:A.totalDataLabelsY,barWidth:x,barHeight:p,realIndex:c,j:d,textAnchor:A.totalDataLabelsAnchor,val:this.getStackedTotalDataLabel({realIndex:c,j:d}),rawVal:this.getStackedTotalValue({realIndex:c,j:d}),dataLabelsConfig:X,barTotalDataLabelsConfig:F})),{dataLabelsPos:A,dataLabels:S,totalDataLabels:R}}hasMultipleSeriesGroups(){return this.w.labelData.seriesGroups.length>1}getTotalGroupContext(t){if(!this.hasMultipleSeriesGroups())return null;const e=this.barCtx.barHelpers.getSeriesGroupIndex(t);return e<0?null:{groupIndex:e,group:this.w.labelData.seriesGroups[e]}}drawsStackedTotal(t){const e=this.barCtx.lastActiveBarSerieIndexByGroup,s=this.getTotalGroupContext(t);return s&&e&&e.length>s.groupIndex?e[s.groupIndex]===t:this.barCtx.lastActiveBarSerieIndex===t}getStackedTotalValue({realIndex:t,j:e}){const s=this.w,a=this.getTotalGroupContext(t),i=s.seriesData.stackedSeriesTotalsByGroups;return a&&i&&i[a.groupIndex]?i[a.groupIndex][e]:this.barCtx.stackedSeriesTotals[e]}getStackedTotalDataLabel({realIndex:t,j:e}){const s=this.w;let a=this.getStackedTotalValue({realIndex:t,j:e});return this.totalFormatter&&(a=this.totalFormatter(a,h(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:n,bcx:l,barWidth:h,barHeight:d,textRects:c,dataLabelsX:g,dataLabelsY:u,dataLabelsConfig:p,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:I}=this.barCtx.barHelpers.getZeroValueEncounters({i:i,j:r});l-=v/2;const P=e.layout.gridWidth/e.globals.dataPoints;if(this.barCtx.isVerticalGroupedRangeBar?g+=h/2:(g=e.axisFlags.isXNumeric?l-h/2+y:l-P+h/2+y,!e.config.chart.stacked&&I>0&&e.config.plotOptions.bar.hideZeroBarsWhenGrouped&&(g-=h*I)),w){const t=2;g=g+c.height/2-v/2-t}const L=e.seriesData.series[i][r]<0;let H=n;switch(this.barCtx.isReversed&&(H=n+(L?d:-d)),x.position){case"center":u=w?L?H-d/2+m:H+d/2-m:L?H-d/2+c.height/2+m:H+d/2+c.height/2-m;break;case"bottom":u=w?L?H-d+m:H+d-m:L?H-d+c.height+v+m:H+d-c.height/2+v-m;break;case"top":u=w?L?H+m:H-m:L?H-c.height/2-m:H+c.height+m}let S=H;const R=this.getTotalGroupContext(o);if((R?[R.group]:e.labelData.seriesGroups).forEach(t=>{var e;null==(e=this.barCtx[t.join(",")])||e.prevY.forEach(t=>{S=L?Math.max(t[r],S):Math.min(t[r],S)})}),this.drawsStackedTotal(o)&&f.enabled){const t=18,i=new b(this.barCtx.w).getTextRects(this.getStackedTotalDataLabel({realIndex:o,j:r}),p.fontSize);s=L?S-i.height/2-m-f.offsetY+t:S+i.height+m+f.offsetY-t;const n=P;a=C+(e.axisFlags.isXNumeric?-h/2:h/2-n)+f.offsetX}return e.config.chart.stacked||(u<0?u=0+v:u+c.height/3>e.layout.gridHeight&&(u=e.layout.gridHeight-v)),{bcx:l,bcy:n,dataLabelsX:g,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:n,barHeight:l,barWidth:h,textRects:d,dataLabelsX:c,strokeWidth:g,dataLabelsConfig:u,barDataLabelsConfig:p,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,I;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 P="start";const L=s.seriesData.series[i][r]<0;let H=a;if(this.barCtx.isReversed&&(H=a+(L?-h:h),P=L?"start":"end"),this.barCtx.isPyramid)c=s.layout.gridWidth/2+f;else switch(p.position){case"center":c=L?H+h/2-f:Math.max(d.width/2,H-h/2)+f;break;case"bottom":c=L?H+h-g-f:H-h+g+f;break;case"top":c=L?H-g-f:H-g+f}let S=H;const R=this.getTotalGroupContext(o);if((R?[R.group]:s.labelData.seriesGroups).forEach(t=>{var e;null==(e=this.barCtx[t.join(",")])||e.prevX.forEach(t=>{S=L?Math.min(t[r],S):Math.max(t[r],S)})}),this.drawsStackedTotal(o)&&x.enabled){const t=new b(this.barCtx.w).getTextRects(this.getStackedTotalDataLabel({realIndex:o,j:r}),u.fontSize);L?(w=S-g-f-x.offsetX,P="end"):w=S+f+x.offsetX+(this.barCtx.isReversed?-(h+g):g),I=C-d.height/2+t.height/2+x.offsetY+g,s.globals.barGroups.length>1&&!R&&(I-=s.globals.barGroups.length/2*(l/2))}if(!s.config.chart.stacked){const t=L&&"middle"!==u.textAnchor?"start"===u.textAnchor?"end":"start":u.textAnchor;let e;e="vertical"===p.orientation?d.height/2:"end"===t?d.width:"middle"===t?d.width/2:0;const a=("vertical"===p.orientation?d.height:d.width)-e;c+a>s.layout.gridWidth-g&&(c=s.layout.gridWidth-a-g),c-e<g&&(c=e+g)}return{bcx:a,bcy:n,dataLabelsX:c,dataLabelsY:C,totalDataLabelsX:w,totalDataLabelsY:I,totalDataLabelsAnchor:P}}drawCalculatedDataLabels({x:t,y:e,val:s,i:a,j:i,textRects:r,barHeight:o,barWidth:n,dataLabelsConfig:d}){var g,u,p;const x=this.w;let v="rotate(0)";"vertical"===x.config.plotOptions.bar.dataLabels.orientation&&(v=`rotate(-90, ${t}, ${e})`);const y=new c(this.barCtx.w,this.barCtx.ctx),m=new b(this.barCtx.w),C=d.formatter;let w=null;const I=x.globals.collapsedSeriesIndices.indexOf(a)>-1,P=(x.globals.collapsingSeriesIndices||[]).indexOf(a)>-1;if(P){const t=null==(g=x.globals.prevDataLabels)?void 0:g.get(`${a}::${f(x,a,i)}`);t&&isFinite(t.val)&&(s=t.val)}if(d.enabled&&(!I||P)){w=m.group({class:"apexcharts-data-labels",transform:v});const b=x.config.dataLabels;((null==(u=b.animate)?void 0:u.enabled)||(null==(p=b.countUp)?void 0:p.enabled))&&(w.node.setAttribute("data:dlKey",`${a}::${f(x,a,i)}`),w.node.setAttribute("data:dlJ",String(i)),"number"==typeof s&&isFinite(s)&&w.node.setAttribute("data:dlVal",String(s)));let c="";void 0!==s&&(c=C(s,h(l({},x),{seriesIndex:a,dataPointIndex:i,w:x}))),!s&&x.config.plotOptions.bar.hideZeroBarsWhenGrouped&&(c="");const g=x.seriesData.series[a][i]<0,I=x.config.plotOptions.bar.dataLabels.position;if("vertical"===x.config.plotOptions.bar.dataLabels.orientation&&("top"===I&&(d.textAnchor=g?"end":"start"),"center"===I&&(d.textAnchor="middle"),"bottom"===I&&(d.textAnchor=g?"end":"start")),this.barCtx.isRangeBar&&this.barCtx.barOptions.dataLabels.hideOverflowingLabels){n<m.getTextRects(c,parseFloat(d.style.fontSize).toString()).width&&(c="")}x.config.chart.stacked&&this.barCtx.barOptions.dataLabels.hideOverflowingLabels&&!P&&(this.barCtx.isHorizontal?r.width/1.6>Math.abs(n)&&(c=""):r.height/1.6>Math.abs(o)&&(c=""));const L=l({},d);this.barCtx.isHorizontal&&s<0&&("start"===d.textAnchor?L.textAnchor="end":"end"===d.textAnchor&&(L.textAnchor="start")),y.plotDataLabelsText({x:t,y:e,text:c,i:a,j:i,parent:w,dataLabelsConfig:L,alwaysDrawDataLabel:!0,offsetCorrection:!0})}return w}drawTotalDataLabels({x:t,y:e,val:s,rawVal:a,realIndex:i,j:r,textAnchor:o,barTotalDataLabelsConfig:n}){var l,h;const d=new b(this.barCtx.w);let c;if(n.enabled&&void 0!==t&&void 0!==e&&this.drawsStackedTotal(i)){c=d.drawText({x:t,y:e,foreColor:n.style.color,text:s,textAnchor:o,fontFamily:n.style.fontFamily,fontSize:n.style.fontSize,fontWeight:n.style.fontWeight}),c.attr({class:"apexcharts-datalabel-total",cx:t,cy:e});const b=this.w.config.dataLabels;if((null==(l=b.animate)?void 0:l.enabled)||(null==(h=b.countUp)?void 0:h.enabled)){const{groupIndex:t}=this.barCtx.barHelpers.getGroupIndex(i);c.node.setAttribute("data:dlTotalKey",`${t}::${f(this.w,i,r)}`),c.node.setAttribute("data:dlTotalSeries",String(i)),"number"==typeof a&&isFinite(a)&&c.node.setAttribute("data:dlTotalVal",String(a))}}return c}}const w=globalThis.ApexCharts.__internals.__apex_Series,I=globalThis.ApexCharts.__internals.__apex_Fill,P=globalThis.ApexCharts.__internals.__apex_Utils;function L(t){var e,s,a,i,r,o,n;return"histogram"===(null==(s=null==(e=null==t?void 0:t.config)?void 0:e.chart)?void 0:s.requestedType)&&(!1!==(null==(i=null==(a=t.config.plotOptions)?void 0:a.histogram)?void 0:i.overlap)&&(null!=(n=null==(o=null==(r=t.seriesData)?void 0:r.series)?void 0:o.length)?n:0)>1)}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),P.isSafari()&&(this.arrBorderRadius=this.arrBorderRadius.map(t=>t.map(t=>"none"))),0===this.barCtx.seriesLen&&(this.barCtx.seriesLen=1)}barSlotXSpan(){const t=this.w;if(void 0!==this._slotXSpan)return this._slotXSpan;let e=0;if(t.globals.dataPoints<=1){const s=t.globals.maxX-t.globals.minX;e=s>0?s/4:0}else if(e=this._unionMinXGap(),!(e>0&&isFinite(e))){const s=t.globals.minXDiff;e=s>0&&isFinite(s)&&.5!==s?s:0}return this._slotXSpan=e,e}_unionMinXGap(){const t=this.w.seriesData.seriesX||[],e=[];for(let s=0;s<t.length;s++){const a=t[s];Array.isArray(a)&&a.length>0&&e.push(a)}if(!e.length)return 0;const s=new Array(e.length).fill(0);let a=NaN,i=1/0;for(;;){let t=1/0,r=-1;for(let a=0;a<e.length;a++){const i=e[a];for(;s[a]<i.length&&"number"!=typeof i[s[a]];)s[a]++;if(s[a]>=i.length)continue;const o=i[s[a]];o==o?o<t&&(t=o,r=a):(s[a]++,a--)}if(-1===r)break;if(s[r]++,a==a){const e=t-a;e>0&&e<i&&(i=e)}a=t}return isFinite(i)?i:0}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||L(e))&&(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=this.barSlotXSpan();e>0&&e/t>0&&(r=e/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+P.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;const r=this.w,o=new I(this.barCtx.w);let n=null;const l=this.barCtx.barOptions.distributed?s:e;let h=!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&&(n=a.color,h=!0)})}const d=this.getDumbbellConnectorFill(e,s)||(null==(i=r.config.series[e].data[s])?void 0:i.fill),b=this.barCtx.barOptions.isDumbbell?r.config.plotOptions.bar.dumbbell.connector:null;let c;b&&b.color&&(n=b.color,c=b.opacity);return{color:o.fillPath({seriesNumber:this.barCtx.barOptions.distributed?l:a,dataPointIndex:s,color:n,opacity:c,value:t[e][s],fillConfig:d,fillType:(null==d?void 0:d.type)?d.type:Array.isArray(r.config.fill.type)?r.config.fill.type[a]:r.config.fill.type}),useRangeColor:h}}getDumbbellConnectorFill(t,e){const s=this.w;if(!this.barCtx.barOptions.isDumbbell)return null;const a=s.dumbbellData;if(!a||"series"!==a.form)return null;const i=s.config.plotOptions.bar.dumbbell.connector;if(i.color)return null;const r=a.order[e];if(!r)return null;const o=s.globals.colors[r[0]],n=s.globals.colors[r[1]];return o&&n?{type:"gradient",gradient:{type:this.barCtx.isHorizontal?"horizontal":"vertical",gradientFrom:o,gradientTo:n,opacityFrom:i.opacity,opacityTo:i.opacity,stops:[0,100],inverseColors:!this.barCtx.isHorizontal}}:null}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}getStackedSeriesIndices(t){const e=this.w,s=e.labelData.seriesGroups,a=e.globals.columnSeries?new Set(e.globals.columnSeries.i):null,i=t=>!a||a.has(t);if(!s||s.length<2){const e=Array.from({length:t},(t,e)=>e).filter(i);return e.length?[e]:[]}const r=Array.from({length:s.length},()=>[]),o=[];for(let e=0;e<t;e++){if(!i(e))continue;const t=this.getSeriesGroupIndex(e);t>-1?r[t].push(e):o.push(e)}return o.length&&r.push(o),r.filter(t=>t.length>0)}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="bar"===this.w.config.chart.type&&1===r,l=n?"top":"both",h=n?"top":"bottom";for(const e of this.getStackedSeriesIndices(i))for(let s=0;s<r;s++){const a=[],i=[];for(const r of e){const e=t[r][s];e>0?a.push(r):e<0&&i.push(r)}if(a.length>0&&0===i.length)if(1===a.length)o[a[0]][s]=l;else{const t=a[0],e=a[a.length-1];for(const i of a)o[i][s]=i===t?h:i===e?"top":"none"}else if(i.length>0&&0===a.length)if(1===i.length)o[i[0]][s]="both";else{const t=Math.max(...i),e=Math.min(...i);for(const a of i)o[a][s]=a===t?"bottom":a===e?"top":"none"}else if(a.length>0&&i.length>0){const t=a[a.length-1];for(const e of a)o[e][s]=e===t?"top":"none";const e=Math.max(...i);for(const t of i)o[t][s]=t===e?"bottom":"none"}}return o}barBackground({j:t,i:e,x1:s,x2:a,y1:i,y2:r,elSeries:o}){const n=this.w,l=new b(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:c}){var g,u,p;const x=new b(this.barCtx.w);(i=Array.isArray(i)?i[l]:i)||(i=0);let f=t,v=e;(null==(g=c.config.series[l].data[d])?void 0:g.columnWidthOffset)&&(v=e-c.config.series[l].data[d].columnWidthOffset/2,f=t+c.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 I=x.line(C,s),P="around"===c.config.plotOptions.bar.borderRadiusApplication||"both"===this.arrBorderRadius[l][d]?" Z":" z",L=x.move(m,s)+x.line(m,a)+x.line(C,a)+I+P;let H=L;"none"!==this.arrBorderRadius[l][d]&&(H=x.roundPathCorners(H,c.config.plotOptions.bar.borderRadius));let S=null;const R=null==(p=null==(u=this.barCtx.ctx)?void 0:u.morphTypeChange)?void 0:p.getInitialPathFor(l,d);if(R?S=R:c.globals.previousPaths.length>0&&(S=this.barCtx.getPreviousPath(l,d,H,L)),null==S&&(S=x.move(m,s)+x.line(m,s)+I+I+I+I+I+x.line(m,s)+P),c.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:S,drawnBox:{x1:m,x2:C,y1:s,y2:a}}}getFunnelTrapezoidPaths({barYPosition:t,barHeight:e,series:s,i:a,j:i,realIndex:r,strokeWidth:o,w:n}){var l,h;const d=new b(this.barCtx.w),c=n.layout.gridWidth/2,g=t=>Math.abs(t/this.barCtx.invertedYRatio)/2,u=g(s[a][i]),p=i===s[a].length-1,x="taper"===n.config.plotOptions.funnel.lastShape?"taper":"flat";let f;f=p?"taper"===x?0:u:g(s[a][i+1]);const v=o/2,y=t+v,m=t+e-v,C=c-u,w=c+u,I=c-f,P=c+f,L=d.move(C,y)+d.line(w,y)+d.line(P,m)+d.line(I,m)+" Z";let H=null;const S=null==(h=null==(l=this.barCtx.ctx)?void 0:l.morphTypeChange)?void 0:h.getInitialPathFor(r,i);return S?H=S:n.globals.previousPaths.length>0&&(H=this.barCtx.getPreviousPath(r,i,L)),null==H&&(H=d.move(c,y)+d.line(c,y)+d.line(c,m)+d.line(c,m)+" Z"),{pathTo:L,pathFrom:H,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 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 b(this.barCtx.w),c=n.layout.gridWidth/2,g=o/2,u=t+g,p=t+e-g,x=c-s,f=c+s,v=c-a,y=c+a,m=d.move(x,u)+d.line(f,u)+d.line(y,p)+d.line(v,p)+" 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(c,u)+d.line(c,u)+d.line(c,p)+d.line(c,p)+" Z"),{pathTo:m,pathFrom:C,x:f,x1:x,barXPosition:c}}getBarpaths({barYPosition:t,barHeight:e,x1:s,x2:a,strokeWidth:i,isReversed:r,series:o,seriesGroup:n,realIndex:l,i:h,j:d,w:c}){var g,u,p;const x=new b(this.barCtx.w);(i=Array.isArray(i)?i[l]:i)||(i=0);let f=t,v=e;(null==(g=c.config.series[l].data[d])?void 0:g.barHeightOffset)&&(f=t-c.config.series[l].data[d].barHeightOffset/2,v=e+c.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 I=this.barCtx.isFunnel,P=I?(s+a)/2:s,L=x.line(s,C),H="around"===c.config.plotOptions.bar.borderRadiusApplication||"both"===this.arrBorderRadius[l][d]?" Z":" z",S=x.move(s,m)+x.line(a,m)+x.line(a,C)+L+H;let R=S;"none"!==this.arrBorderRadius[l][d]&&(R=x.roundPathCorners(R,c.config.plotOptions.bar.borderRadius));let D=null;const k=null==(p=null==(u=this.barCtx.ctx)?void 0:u.morphTypeChange)?void 0:p.getInitialPathFor(l,d);if(k?D=k:c.globals.previousPaths.length>0&&(D=this.barCtx.getPreviousPath(l,d,R,S)),null==D){const t=I?x.line(P,C):L;D=x.move(P,m)+x.line(P,m)+t+t+t+t+t+x.line(P,m)+H}if(c.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:R,pathFrom:D,drawnBox:{x1:s,x2:a,y1:m,y2:C}}}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,n=[],d=(a,i)=>{n.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){const e=this.getDumbbellEnds(a,i);if(e.length){const s={strokeHeight:"x"===t?0:o.globals.markers.size[a],strokeWidth:"x"===t?o.globals.markers.size[a]:0,strokeDashArray:0,strokeLineCap:"round"};let r=0,n=0;for(let t=1;t<e.length;t++)e[t].value<e[r].value&&(r=t),e[t].value>e[n].value&&(n=t);const b=o.config.plotOptions.bar.dumbbell.dataLabels;e.forEach((t,e)=>{const o=h(l({},s),{strokeColor:t.color});!b.enabled||e!==r&&e!==n||(o.label={text:this.getDumbbellLabelText(t.value,a,i,t.index),color:b.colorFromMarker?t.color:Array.isArray(b.style.colors)?b.style.colors[t.index]||b.style.colors[0]:b.style.colors,outward:e===r&&r!==n?-1:1}),d(t.value,o)})}}return n}getDumbbellEnds(t,e){const s=this.w,a=[],i=s.dumbbellData;if(i&&"series"===i.form){const t=i.values[e]||[];for(let e=0;e<t.length;e++){const r=t[e];null!==r&&-1===i.hidden.indexOf(e)&&a.push({value:r,color:s.globals.colors[e],index:e})}return a}if(!s.rangeData.seriesRange.length)return a;const r=this.barCtx.barOptions.dumbbellColors?this.barCtx.barOptions.dumbbellColors:s.globals.colors,o=e=>Array.isArray(r[t])?r[t][e]:r[t];return[{value:s.rangeData.seriesRangeStart[t][e],color:o(0),index:0},{value:s.rangeData.seriesRangeEnd[t][e],color:o(1),index:1}]}getDumbbellLabelText(t,e,s,a){const i=this.w,r=i.config.plotOptions.bar.dumbbell.dataLabels;if("function"==typeof r.formatter)return r.formatter(t,{seriesIndex:e,dataPointIndex:s,endpointIndex:a,w:i});const o=this.barCtx.isHorizontal?i.formatters.xLabelFormatter:i.formatters.yLabelFormatters[0];return"function"==typeof o?o(t,s,i):String(t)}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 b(this.barCtx.w),n=o.group({class:"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),t.attrs.label&&n.add(this.drawDumbbellLabel(t.attrs,{x:t.x,y:a-s,horizontal:!0,markerSize:t.attrs.strokeWidth||0}))}}):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),e.attrs.label&&n.add(this.drawDumbbellLabel(e.attrs,{x:a-s,y:e.y,horizontal:!1,markerSize:e.attrs.strokeHeight||0}))}}),n}drawDumbbellLabel(t,e){const s=this.w,a=new b(s),i=s.config.plotOptions.bar.dumbbell.dataLabels,r=e.markerSize/2+i.offset,o=t.label.outward;return a.drawText({x:e.x+(e.horizontal?r*o:0),y:e.y-(e.horizontal?0:r*o),text:t.label.text,textAnchor:e.horizontal?o<0?"end":"start":"middle",dominantBaseline:e.horizontal?"central":o<0?"hanging":"auto",foreColor:t.label.color,fontSize:i.style.fontSize,fontFamily:i.style.fontFamily,fontWeight:i.style.fontWeight,cssClass:"apexcharts-dumbbell-label"})}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:c}=e,g=l+e.barHeight,u=new b(this.barCtx.w),p=new P,x=u.move(n,g)+u.line(o,g)+u.line(h,c)+u.line(d,c)+u.line(n,g)+("around"===r.config.plotOptions.bar.borderRadiusApplication||"both"===this.arrBorderRadius[a][i]?" Z":" z");return u.drawPath({d:x,fill:p.shadeColor(.5,P.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}}getSeriesGroupIndex(t){const e=this.w;return e.labelData.seriesGroups.findIndex(s=>s.indexOf(e.seriesData.seriesNames[t])>-1)}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 S=globalThis.ApexCharts.__internals.__apex_CoreUtils,R=globalThis.ApexCharts.__internals.__apex_Filters,D=globalThis.ApexCharts.__internals;D.__apex_Animations;const k=D.__apex_Animations_computeStagger;D.__apex_Animations_applyAnimationPolicy,D.__apex_Animations_prefersReducedMotion,D.__apex_Animations_applyProgressiveReveal;class A{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)/A.xRatio(t)}static pxToDataX(t,e){return t.globals.minX+e*A.xRatio(t)}static screenXToPlotPx(t,e){const s=t.dom.baseEl,a=s&&s.querySelector(".apexcharts-svg");if(!a)return e-t.layout.translateX;const i=a.getBoundingClientRect(),r=t.globals.svgWidth?i.width/t.globals.svgWidth:1;return(e-i.left)/(r||1)-t.layout.translateX}}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._pathToInterp=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.lastActiveBarSerieIndexByGroup=a.getActiveConfigSeriesIndexByGroup(["bar","column"]),this.columnGroupIndices=[];const i=a.getBarSeriesIndices(),r=new S(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 b(this.w),n=new S(this.w);t=n.getLogSeries(t),this.series=t,this.yRatio=n.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&&console.warn("WARNING: DataLabels are enabled but there are too many to display. This may cause performance issue when rendering - ApexCharts");for(let n=0,b=0;n<t.length;n++,b++){let c,g;const u=[],p=[],x=r.globals.comboCharts?e[n]:n,{columnGroupIndex:v}=this.barHelpers.getGroupIndex(x),y=o.group({class:"apexcharts-series",rel:n+1,seriesName:P.escapeString(r.seriesData.seriesNames[x]),"data:realIndex":x});w.addCollapsedClassToSeries(this.w,y,x),t[n].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[n]));const I=this.barHelpers.initialPositions(x),{y:L,yDivision:H,zeroW:S,x:D,xDivision:k,zeroH:A}=I;let X=I.barHeight,W=I.barWidth;g=L,c=D,this.isHorizontal||p.push(c+(null!=W?W: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[n].length;e++){const s=this.barHelpers.getStrokeWidth(n,e,x);let o=null;const d={indexes:{i:n,j:e,realIndex:x,translationsIndex:C,bc:b},x:c,y:g,strokeWidth:s,elSeries:y};this.isHorizontal?(o=this.drawBarPaths(h(l({},d),{barHeight:X,zeroW:S,yDivision:H})),W=this.series[n][e]/this.invertedYRatio):(o=this.drawColumnPaths(h(l({},d),{xDivision:k,barWidth:W,zeroH:A})),X=this.series[n][e]/this.yRatio[C]);const f=this.barHelpers.getPathFillColor(t,n,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:P.hexToRgba(r.globals.colors[n]),prevPaths:this.pathArr[this.pathArr.length-1],currPaths:o,realIndex:x,j:e});if(Y.add(t),r.config.chart.dropShadow.enabled){new R(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:X,barWidth:W});m&&O.add(m),g=o.y,c=o.x,e>0&&p.push(c+(null!=W?W:0)/2),u.push(g),this.renderSeries(h(l({realIndex:x,pathFill:f.color},f.useRangeColor?{lineFill:f.color}:{}),{j:e,i:n,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:X),barWidth:Math.abs(o.barWidth?o.barWidth:W),elDataLabelsWrap:F,elGoalsMarkers:O,elBarShadows:Y,visibleSeries:this.visibleI,type:"bar"}))}if(r.globals.seriesXvalues[x]=p,r.globals.seriesYvalues[x]=u,r.globals.previousPaths.length>0){const e=[];for(let s=0;s<t[n].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:c,y1:g,y2:u,series:p,barHeight:x,barWidth:v,barXPosition:y,barYPosition:m,elDataLabelsWrap:w,elGoalsMarkers:I,elBarShadows:P,visibleSeries:L,type:H,classes:S}){var D,A,X,W,F,O,Y;const T=this.w,_=new b(this.w,this.ctx),B=function(t,e){const s=t&&t.renderer;return s&&s.kind&&"svg"!==s.kind?s:e}(this.ctx,_);let j=!1;const G=this._pathToInterp;if(this._pathToInterp=null,h._bindingsDelegated||(h._bindingsDelegated=!0,_.setupEventDelegation(h,`.apexcharts-${H}-area`)),!s){let e=function(t){const e=T.config.stroke.colors;let s;return Array.isArray(e)&&e.length>0&&(s=e[t],s||(s=""),"function"==typeof s)?s({value:T.seriesData.series[t][a],dataPointIndex:a,w:T}):s};const i="function"==typeof T.globals.stroke.colors[t]?e(t):T.globals.stroke.colors[t];s=this.barOptions.distributed?T.globals.stroke.colors[a]:i}const z=T.config.chart.animations,M=z.animateGradually;let N=0,V=0;if(M&&!1!==M.enabled&&!(T.globals.dataChanged&&this.isLayoutShift(t))){const t=T.globals.dataPoints||1,e=M.delay||0,s=Math.min(e,.5*z.speed/Math.max(1,t));V=k({style:"sequential",index:a,baseDelay:s}),T.config.chart.stacked&&!T.globals.dataChanged&&(V+=i*s*.5);N=V/(e||1)}const E=new C(this).handleBarDataLabels({x:d,y:c,y1:g,y2:u,i:i,j:a,series:p,realIndex:t,columnGroupIndex:r,barHeight:x,barWidth:v,barXPosition:y,barYPosition:m,visibleSeries:L});if(V>0){const t=T.config.dataLabels;if((null==(D=t.animate)?void 0:D.enabled)||(null==(A=t.countUp)?void 0:A.enabled)){const t=String(Math.round(V));null==(W=null==(X=E.dataLabels)?void 0:X.node)||W.setAttribute("data:dlDelay",t),null==(O=null==(F=E.totalDataLabels)?void 0:F.node)||O.setAttribute("data:dlDelay",t)}}if(T.globals.isBarHorizontal||(E.dataLabelsPos.dataLabelsX+Math.max(v,T.globals.barPadForNumericAxis)<0||E.dataLabelsPos.dataLabelsX-Math.max(v,T.globals.barPadForNumericAxis)>T.layout.gridWidth)&&(j=!0),T.config.series[i].data[a]&&T.config.series[i].data[a].strokeColor&&(s=T.config.series[i].data[a].strokeColor),this.isNullValue&&-1===T.globals.collapsingSeriesIndices.indexOf(t)&&(e="none"),!j){const r=!0===(null==(Y=this.ctx.morphTypeChange)?void 0:Y.isActive()),d=r?this.ctx.morphTypeChange.getSpeed():T.config.chart.animations.dynamicAnimation.speed,b=r&&this.ctx.morphTypeChange.claimsTargetMark(t,a);b&&(o=n,N=0);const c=B.renderPaths({i:i,j:a,realIndex:t,pathFrom:o,pathTo:n,stroke:s,strokeWidth:l,strokeLineCap:T.config.stroke.lineCap,fill:e,pathToInterp:G,animationDelay:N,initialSpeed:T.config.chart.animations.speed,dataChangeSpeed:d,className:`apexcharts-${H}-area${S?` ${S}`:""}`,chartType:H,bindEventsOnPaths:!1});c.attr("clip-path",`url(#gridRectBarMask${T.globals.cuid})`),b&&(c.node.setAttribute("opacity","0"),c.node.setAttribute("data-piece-hidden","1"));const p=T.config.forecastDataPoints;p.count>0&&a>=T.globals.dataPoints-p.count&&(c.node.setAttribute("stroke-dasharray",p.dashArray),c.node.setAttribute("stroke-width",p.strokeWidth),c.node.setAttribute("fill-opacity",p.fillOpacity)),void 0!==g&&void 0!==u&&(c.attr("data-range-y1",g),c.attr("data-range-y2",u));new R(this.w).setSelectionFilter(c,t,a),h.add(c),c.attr({cy:E.dataLabelsPos.bcy,cx:E.dataLabelsPos.bcx,j:a,val:T.seriesData.series[i][a],barHeight:x,barWidth:v,"data:pathKey":f(T,t,a)}),"canvas"===B.kind&&(T.globals.barCanvasCoords||(T.globals.barCanvasCoords={}),T.globals.barCanvasCoords[t]||(T.globals.barCanvasCoords[t]={}),T.globals.barCanvasCoords[t][a]={cx:E.dataLabelsPos.bcx,cy:E.dataLabelsPos.bcy,barWidth:v}),null!==E.dataLabels&&w.add(E.dataLabels),E.totalDataLabels&&w.add(E.totalDataLabels),h.add(w),I&&h.add(I),P&&h.add(P)}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,u=!!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 p;return i=this.barHelpers.getXForValue(this.series[h][d],null!=a?a:0),p=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||u)&&(a=p.x1,i=p.x),l.axisFlags.isXNumeric||u||(r+=o),u&&(r=b),this.barHelpers.barBackground({j:d,i:h,y1:b-e*this.visibleI,y2:e*this.seriesLen,elSeries:n}),{pathTo:p.pathTo,pathFrom:p.pathFrom,x1:a,x:i,y:r,goalX:this.barHelpers.getGoalValues("x",a,null,t.realIndex,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 u;if(l.axisFlags.isXNumeric){const t=this.getBarXForNumericXAxis({x:e,j:c,realIndex:h,barWidth:i});e=t.x,u=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),u=e+i*this.visibleI,u-=i*s}else u=e+i*this.visibleI;s=this.barHelpers.getYForValue(this.series[b][c],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:b,j:c,w:l});return l.axisFlags.isXNumeric||(e+=a),this.barHelpers.barBackground({bc:g,j:c,i:b,x1:u-o/2-i*this.visibleI,x2:i*this.seriesLen+o/2,elSeries:n}),{pathTo:p.pathTo,pathFrom:p.pathFrom,x:e,y:s,goalY:this.barHelpers.getGoalValues("y",null,r,h,c,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),P.isNumber(i.seriesData.seriesX[r][a])&&(t=A.dataXToPx(i,i.seriesData.seriesX[r][a])-e*this.seriesLen/2),{barXPosition:t+(L(i)?0: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,a){const i=this.w;this._pathToInterp=null;const r=this._prevRecord(t);if(!r)return x(i)?null:s;let o=null,n=!1;const l=this._prevKeyedPaths(t);if(l){const s=l.get(f(i,t,e));s?o=s.d:n=!0}else void 0!==r.paths[e]?o=r.paths[e].d:n=!0;if(o){const t=X.pathCommandCount(o),e=X.pathCommandCount(s);if(t===e)return o;const r=new b(i),n=t=>{const e=X.pathBox(t);return e?Math.min(e.maxX-e.minX,e.maxY-e.minY):0},l=t<e?n(o)>1:n(s)>1;if(t<e){const t=r.roundPathCorners(o,0);if(X.pathCommandCount(t)===e){if(l&&a){const t=r.roundPathCorners(a,0);X.pathCommandCount(t)===e&&(this._pathToInterp=t)}return t}}else{const e=r.roundPathCorners(s,0);if(X.pathCommandCount(e)===t){if(this._pathToInterp=e,l){const e=X.squareLike(o),s=e?r.roundPathCorners(e,0):null;if(s&&X.pathCommandCount(s)===t)return s}return o}}}return n&&x(i)?null:s}static pathBox(t){if(!t)return null;const e=[],s=/([MLC])([^MLCZz]*)/g;let a;for(;null!==(a=s.exec(t));){const t=a[2].trim().split(/[\s,]+/).map(Number);t.length<2||t.some(isNaN)||e.push([t[t.length-2],t[t.length-1]])}if(e.length<3)return null;const i=e.map(t=>t[0]),r=e.map(t=>t[1]);return{minX:Math.min(...i),maxX:Math.max(...i),minY:Math.min(...r),maxY:Math.max(...r),start:e[0],vertical:Math.abs(e[1][0]-e[0][0])<Math.abs(e[1][1]-e[0][1])}}static squareLike(t){const e=X.pathBox(t);if(!e)return null;const{minX:s,maxX:a,minY:i,maxY:r,start:o,vertical:n}=e,l=(t,e,s)=>Math.abs(t-e)<=Math.abs(t-s)?[e,s]:[s,e];let h,d,b,c;n?(h=Math.abs(o[0]-s)<=Math.abs(o[0]-a)?s:a,d=h===s?a:s,[b,c]=l(o[1],i,r)):(b=Math.abs(o[1]-i)<=Math.abs(o[1]-r)?i:r,c=b===i?r:i,[h,d]=l(o[0],s,a));const g=t.trim().endsWith("Z")?" Z":" z";return n?`M ${h} ${b} L ${h} ${c} L ${d} ${c} L ${d} ${b}${g}`:`M ${h} ${b} L ${d} ${b} L ${d} ${c} L ${h} ${c}${g}`}getPreviousFlip(t,e){const s=this.w,a=this._prevRecord(t);if(!a)return null;const i=this._prevKeyedPaths(t),r=i?i.get(f(s,t,e)):a.paths[e];return r?!!r.flip:null}static pathCommandCount(t){if(!t)return 0;const e=t.match(/[A-Za-z]/g);return e?e.length:0}}d.use({bar:X,column:X,barStacked:class extends X{draw(t,e){const s=this.w;this.graphics=new b(this.w),this.bar=new X(this.w,this.ctx,this.xyRatios);const a=new S(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;const n=s.config.chart.animations,d=n.enabled&&n.dynamicAnimation.enabled&&s.globals.previousPaths.length>0;let c=!1;for(let a=0,n=0;a<t.length;a++,n++){const b=s.globals.comboCharts?e[a]:a,{groupIndex:g,columnGroupIndex:u}=this.barHelpers.getGroupIndex(b);this.groupCtx=this[s.labelData.seriesGroups[g]];const p=[],x=[];let f=0;this.yRatio.length>1&&(this.yaxisIndex=s.globals.seriesYAxisReverseMap[b][0],f=b),this.isReversed=s.config.yaxis[this.yaxisIndex]&&s.config.yaxis[this.yaxisIndex].reversed;let v=this.graphics.group({class:"apexcharts-series",seriesName:P.escapeString(s.seriesData.seriesNames[b]),rel:a+1,"data:realIndex":b});w.addCollapsedClassToSeries(this.w,v,b);const y=this.graphics.group({class:"apexcharts-datalabels","data:realIndex":b});w.addCollapsedClassToSeries(this.w,y,b),(s.globals.collapsingSeriesIndices||[]).indexOf(b)>-1&&y.node.style.setProperty("--apexcharts-dl-exit",`${s.config.chart.animations.dynamicAnimation.speed}ms`);const m=this.graphics.group({class:"apexcharts-bar-goals-markers"}),C=this.initialPositions(r,o,void 0,void 0,void 0,void 0,f),{xDivision:I,yDivision:L,zeroH:H,zeroW:S}=C;let R=C.barHeight,D=C.barWidth;o=C.y,r=C.x,s.globals.barHeight=R,s.globals.barWidth=D,this.barHelpers.initializeStackedXYVars(this),1===this.groupCtx.prevY.length&&this.groupCtx.prevY[0].every(t=>isNaN(t))&&(this.groupCtx.prevY[0]=this.groupCtx.prevY[0].map(()=>H),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,b),C={indexes:{i:a,j:e,realIndex:b,translationsIndex:f,bc:n},strokeWidth:i,x:r,y:o,elSeries:v,columnGroupIndex:u,seriesGroup:s.labelData.seriesGroups[g]};let w=null;this.isHorizontal?(w=this.drawStackedBarPaths(h(l({},C),{zeroW:S,barHeight:R,yDivision:L})),D=this.series[a][e]/this.invertedYRatio):(w=this.drawStackedColumnPaths(h(l({},C),{xDivision:I,barWidth:D,zeroH:H})),R=this.series[a][e]/this.yRatio[f]);const P=this.barHelpers.drawGoalLine({barXPosition:w.barXPosition,barYPosition:w.barYPosition,goalX:w.goalX,goalY:w.goalY,barHeight:R,barWidth:D});P&&m.add(P),o=w.y,r=w.x,p.push(r),x.push(o);const k=this.barHelpers.getPathFillColor(t,a,e,b);let A="";const X=s.globals.isBarHorizontal?"apexcharts-flip-x":"apexcharts-flip-y",W="bottom"===this.barHelpers.arrBorderRadius[b][e]&&s.seriesData.series[b][e]>0||"top"===this.barHelpers.arrBorderRadius[b][e]&&s.seriesData.series[b][e]<0,F=d&&!W&&this.getPreviousFlip(b,e);(W||F)&&(A=X),F&&(A+=" apexcharts-flip-held",c=!0),v=this.renderSeries(h(l({realIndex:b,pathFill:k.color},k.useRangeColor?{lineFill:k.color}:{}),{j:e,i:a,columnGroupIndex:u,pathFrom:w.pathFrom,pathTo:w.pathTo,strokeWidth:i,elSeries:v,x:r,y:o,series:t,barHeight:R,barWidth:D,elDataLabelsWrap:y,elGoalsMarkers:m,type:"bar",visibleSeries:u,classes:A}))}s.globals.seriesXvalues[b]=p,s.globals.seriesYvalues[b]=x,this.groupCtx.prevY.push(this.groupCtx.yArrj),this.groupCtx.prevYF.push(this.groupCtx.yArrjF),this.groupCtx.prevYVal.push(this.groupCtx.yArrjVal),this.groupCtx.prevX.push(this.groupCtx.xArrj),this.groupCtx.prevXF.push(this.groupCtx.xArrjF),this.groupCtx.prevXVal.push(this.groupCtx.xArrjVal),i.add(v)}return c&&this.settleHeldMirrors(),i}settleHeldMirrors(){const t=this.w;if(!p.isBrowser())return;const e=t.config.chart.animations,s=(e.dynamicAnimation.speed||0)+(e.speed||0)+100;setTimeout(()=>{!t.globals.isDestroyed&&P.elementExists(t.dom.baseEl)&&t.dom.baseEl.querySelectorAll(".apexcharts-flip-held").forEach(t=>{t.classList.remove("apexcharts-flip-held","apexcharts-flip-y","apexcharts-flip-x")})},s)}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,a=n.axisFlags.isXNumeric?this.barHelpers.barSlotXSpan():0;a>0?h=(s=a/this.xRatio)*parseInt(this.barOptions.columnWidth,10)/100:h*=parseInt(e,10)/100,-1===String(e).indexOf("%")&&(h=parseInt(e,10)),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,u;const p=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];const I=this.groupCtx.prevX.length;if(I>0){let t=a;this.groupCtx.prevXVal[I-1][y]<0?t=(null==(d=this.series[v])?void 0:d[y])>=0?this.groupCtx.prevX[I-1][y]+w-2*(this.isReversed?w:0):this.groupCtx.prevX[I-1][y]:this.groupCtx.prevXVal[I-1][y]>=0&&(t=(null==(b=this.series[v])?void 0:b[y])>=0?this.groupCtx.prevX[I-1][y]:this.groupCtx.prevX[I-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==(u=this.series[v])?void 0:u[y])/this.invertedYRatio:0);const P=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:p});return this.barHelpers.barBackground({j:y,i:v,y1:x,y2:e,elSeries:h}),r+=l,{pathTo:P.pathTo,pathFrom:P.pathFrom,goalX:this.barHelpers.getGoalValues("x",a,null,m,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,u,p,x,f;const v=this.w,y=t.i,m=t.j,C=t.bc,w=t.realIndex,I=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 P=e+o*i;let L,H=0;for(let t=0;t<this.groupCtx.prevYF.length;t++)H+=isNaN(this.groupCtx.prevYF[t][m])?0:this.groupCtx.prevYF[t][m];const S=this.groupCtx.prevY.length;if(S>0&&!v.axisFlags.isXNumeric||S>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[S-1]&&this.groupCtx.prevY[S-1].length)for(let t=1;t<s;t++)if(!isNaN(null==(h=this.groupCtx.prevY[S-t])?void 0:h[m])){e=this.groupCtx.prevY[S-t][m];break}for(let a=1;a<s;a++){if((null==(d=this.groupCtx.prevYVal[S-a])?void 0:d[m])<0){t=(null==(b=this.series[y])?void 0:b[m])>=0?e-H+2*(this.isReversed?H:0):e;break}if((null==(c=this.groupCtx.prevYVal[S-a])?void 0:c[m])>=0){t=(null==(g=this.series[y])?void 0:g[m])>=0?e:e+H-2*(this.isReversed?H:0);break}}void 0===t&&(t=v.layout.gridHeight),L=(null==(u=this.groupCtx.prevYF[0])?void 0:u.every(t=>0===t))&&this.groupCtx.prevYF.slice(1,S).every(t=>t.every(t=>isNaN(t)))?r:t}else L=r;s=(null==(p=this.series[y])?void 0:p[m])?L-(null==(x=this.series[y])?void 0:x[m])/this.yRatio[I]+2*(this.isReversed?(null==(f=this.series[y])?void 0:f[m])/this.yRatio[I]:0):L;const R=this.barHelpers.getColumnPaths({barXPosition:P,barWidth:i,y1:L,y2:s,yRatio:this.yRatio[I],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:P,x2:i,elSeries:l}),{pathTo:R.pathTo,pathFrom:R.pathFrom,goalY:this.barHelpers.getGoalValues("y",null,r,w,m,0),barXPosition:P,x:v.axisFlags.isXNumeric?e:e+a,y:s}}},rangeBar:class extends X{draw(t,e){var s,a,i,r,o,n,h,d,c;const g=this.w,u=new b(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 p=u.group({class:"apexcharts-rangebar-series apexcharts-plot-series"});for(let b=0;b<t.length;b++){let x,f;const v=g.globals.comboCharts?e[b]:b,{columnGroupIndex:y}=this.barHelpers.getGroupIndex(v),m=u.group({class:"apexcharts-series",seriesName:P.escapeString(g.seriesData.seriesNames[v]),rel:b+1,"data:realIndex":v});w.addCollapsedClassToSeries(this.w,m,v),t[b].length>0&&(this.visibleI=this.visibleI+1);let C=0;this.yRatio.length>1&&(this.yaxisIndex=g.globals.seriesYAxisReverseMap[v][0],C=v);const I=this.barHelpers.initialPositions(v),{y:L,zeroW:H,x:S,zeroH:R}=I;let D=null!=(s=I.barWidth)?s:0,k=null!=(a=I.barHeight)?a:0;const A=null!=(i=I.yDivision)?i:0,X=null!=(r=I.xDivision)?r:0;f=L,x=S;const W=u.group({class:"apexcharts-datalabels","data:realIndex":v}),F=u.group({class:"apexcharts-rangebar-goals-markers"});for(let e=0;e<g.globals.dataPoints;e++){const s=this.barHelpers.getStrokeWidth(b,e,v),a=this.seriesRangeStart[b][e],i=this.seriesRangeEnd[b][e];let r=null,u=null,p=null;const w={x:x,y:f,strokeWidth:s,elSeries:m};let P=this.seriesLen;if(g.config.plotOptions.bar.rangeBarGroupRows&&(P=1),void 0===(null==(o=g.config.series[b].data)?void 0:o[e]))break;if(this.isHorizontal){p=f+k*this.visibleI;const t=(A-k*P)/2;if(null==(h=null==(n=g.config.series[b].data)?void 0:n[e])?void 0:h.x){const s=this.detectOverlappingBars({i:b,j:e,barYPosition:p,srty:t,barHeight:k,yDivision:A,initPositions:I});k=s.barHeight,p=s.barYPosition}r=this.drawRangeBarPaths(l({indexes:{i:b,j:e,realIndex:v},barHeight:k,barYPosition:p,zeroW:H,yDivision:A,y1:a,y2:i},w)),D=r.barWidth}else{g.axisFlags.isXNumeric&&(x=(g.seriesData.seriesX[b][e]-g.globals.minX)/this.xRatio-D/2),u=x+D*this.visibleI;const t=(X-D*P)/2;if(null==(c=null==(d=g.config.series[b].data)?void 0:d[e])?void 0:c.x){const s=this.detectOverlappingBars({i:b,j:e,barXPosition:u,srtx:t,barWidth:D,xDivision:X,initPositions:I});D=s.barWidth,u=s.barXPosition}r=this.drawRangeColumnPaths(l({indexes:{i:b,j:e,realIndex:v,translationsIndex:C},barWidth:D,barXPosition:u,zeroH:R,xDivision:X},w)),k=r.barHeight}const L=this.barHelpers.drawGoalLine({barXPosition:r.barXPosition,barYPosition:p,goalX:r.goalX,goalY:r.goalY,barHeight:k,barWidth:D});L&&F.add(L),f=r.y,x=r.x;const S=this.barHelpers.getPathFillColor(t,b,e,v);this.renderSeries({realIndex:v,pathFill:S.color,lineFill:S.useRangeColor?S.color:g.globals.stroke.colors[v],j:e,i:b,x:x,y:f,y1:a,y2:i,pathFrom:r.pathFrom,pathTo:r.pathTo,strokeWidth:s,elSeries:m,series:t,barHeight:k,barWidth:D,barXPosition:u,barYPosition:p,columnGroupIndex:y,elDataLabelsWrap:W,elGoalsMarkers:F,visibleSeries:this.visibleI,type:"rangebar"})}p.add(m)}return p}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,u;const p=this.w;let x=[];const f=null==(c=null==(b=p.globals.seriesRangeName)?void 0:b[t])?void 0:c[e],v=null==(u=null==(g=p.config.series[t].data)?void 0:g[e])?void 0:u.x,y=Array.isArray(v)?v.join(" "):v,m=p.labelData.labels.map(t=>Array.isArray(t)?t.join(" "):t).indexOf(y),C=p.rangeData.seriesRange[t].findIndex(t=>{var e;return t.x===y&&(null==(e=t.overlaps)?void 0:e.size)>0});return this.isHorizontal?(s=p.config.plotOptions.bar.rangeBarGroupRows?i+l*m:i+o*this.visibleI+l*m,C>-1&&!p.config.plotOptions.bar.rangeBarOverlap&&(x=Array.from(p.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&&!p.labelData.timescaleLabels.length&&(a=p.config.plotOptions.bar.rangeBarGroupRows?r+h*m:r+n*this.visibleI+h*m),C>-1&&!p.config.plotOptions.bar.rangeBarOverlap&&(x=Array.from(p.rangeData.seriesRange[t][C].overlaps),x.indexOf(f)>-1&&(a=(n=d.barWidth/x.length)*this.visibleI+h*(100-parseInt(this.barOptions.barWidth,10))/100/2+n*(this.visibleI+x.indexOf(f))+h*m))),{barYPosition:s,barXPosition:a,barHeight:o,barWidth:n}}drawRangeColumnPaths({indexes:t,x:e,xDivision:s,barWidth:a,barXPosition:i,zeroH:r}){var o,n;const l=this.w,{i:h,j:d,realIndex:b,translationsIndex:c}=t,g=this.yRatio[c],u=this.getRangeValue(b,d);let p=Math.min(u.start,u.end),x=Math.max(u.start,u.end);const f=!(void 0===(null==(o=this.series[h])?void 0:o[d])||null===(null==(n=this.series[h])?void 0:n[d]));f?(p=r-p/g,x=r-x/g):p=r;const v=Math.abs(x-p),y=this.barHelpers.getColumnPaths({barXPosition:i,barWidth:a,y1:p,y2:x,strokeWidth:this.strokeWidth,series:this.seriesRangeEnd,realIndex:b,i:b,j:d,w:l});if(f){const t=y.drawnBox,e=u.end>=u.start;this.recordColumnGeometry(b,d,{slotStart:t.x1,slotEnd:t.x2,levelStart:e?t.y1:t.y2,levelEnd:e?t.y2:t.y1,horizontal:!1})}if(l.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:y.pathTo,pathFrom:y.pathFrom,barHeight:v,x:e,y:u.start<0&&u.end<0?p:x,goalY:this.barHelpers.getGoalValues("y",null,r,b,d,c),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:n}){const l=this.w,{realIndex:h,j:d}=t,b=this.preventBarOverflow(n+s/this.invertedYRatio),c=this.preventBarOverflow(n+a/this.invertedYRatio),g=this.getRangeValue(h,d),u=Math.abs(c-b),p=this.barHelpers.getBarpaths({barYPosition:o,barHeight:r,x1:b,x2:c,strokeWidth:this.strokeWidth,series:this.seriesRangeEnd,i:h,realIndex:h,j:d,w:l});if(null!=g.start&&null!=g.end){const t=p.drawnBox;this.recordColumnGeometry(h,d,{slotStart:t.y1,slotEnd:t.y2,levelStart:t.x1,levelEnd:t.x2,horizontal:!0})}return l.axisFlags.isXNumeric||(e+=i),{pathTo:p.pathTo,pathFrom:p.pathFrom,barWidth:u,x:g.start<0&&g.end<0?b:c,goalX:this.barHelpers.getGoalValues("x",n,null,h,d,0),y:e}}recordColumnGeometry(t,e,s){const a=this.w.waterfallData&&this.w.waterfallData.geometry;a&&isFinite(s.slotStart)&&isFinite(s.levelEnd)&&(a[t]||(a[t]=[]),a[t][e]=s)}getRangeValue(t,e){const s=this.w;return{start:s.rangeData.seriesRangeStart[t][e],end:s.rangeData.seriesRangeEnd[t][e]}}}}),t.default=d,Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
5
|
+
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).ApexBar={})}(this,function(t){"use strict";var e=Object.defineProperty,s=Object.defineProperties,a=Object.getOwnPropertyDescriptors,i=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable,n=(t,s,a)=>s in t?e(t,s,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[s]=a,l=(t,e)=>{for(var s in e||(e={}))r.call(e,s)&&n(t,s,e[s]);if(i)for(var s of i(e))o.call(e,s)&&n(t,s,e[s]);return t},h=(t,e)=>s(t,a(e));const d=globalThis.ApexCharts,b=globalThis.ApexCharts.__internals.__apex_Graphics,c=globalThis.ApexCharts.__internals.__apex_DataLabels,g=(t,e,s,a)=>{if("function"!=typeof t)return t;const i=t({series:e.seriesData.series,seriesIndex:s,dataPointIndex:a,w:e});return Number.isFinite(i)?i:0},u=globalThis.ApexCharts.__internals.__apex_BrowserAPIs_BrowserAPIs,p=globalThis.ApexCharts.__internals.__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)&&!!(p.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 b(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),p=performance.now(),x=e=>{if(t.globals.isDestroyed||!n.parentNode)return;const s=Math.max(0,Math.min(1,(e-p)/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?u.requestAnimationFrame(x):n.parentNode.removeChild(n)};u.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){var e,s;const{x:a,y:i,y1:r,y2:o,i:n,j:d,realIndex:c,columnGroupIndex:u,barHeight:p,barWidth:x,barXPosition:f,barYPosition:v,visibleSeries:y}=t,m=this.w,C=new b(this.barCtx.w),w=m.waterfallData&&m.waterfallData.values,I=w&&w[c]&&null!=w[c][d]?w[c][d]:null,P=Array.isArray(this.barCtx.strokeWidth)?this.barCtx.strokeWidth[c]:this.barCtx.strokeWidth;let L,H;m.axisFlags.isXNumeric&&!m.globals.isBarHorizontal?(L=a+x*(y+1),H=i+p*(y+1)-P):(L=a+x*y,H=i+p*y);let S=null,R=null,k=a,D=i,A={};const X=m.config.dataLabels,W=this.barCtx.barOptions.dataLabels,F=this.barCtx.barOptions.dataLabels.total;void 0!==v&&(this.barCtx.isRangeBar||this.barCtx.isPyramid)&&(H=v,D=v),void 0!==f&&this.barCtx.isVerticalGroupedRangeBar&&(L=f,k=f);const O=g(X.offsetX,m,c,d),Y=g(X.offsetY,m,c,d);let T={width:0,height:0};if(m.config.dataLabels.enabled){const t=null!==I?I:m.seriesData.series[c][d];T=C.getTextRects(m.config.dataLabels.formatter?m.config.dataLabels.formatter(t,h(l({},m),{seriesIndex:c,dataPointIndex:d,w:m})):m.formatters.yLabelFormatters[0](t),parseFloat(X.style.fontSize).toString(),X.style.fontFamily,void 0,!0,X.style.fontWeight)}const _={x:a,y:i,i:n,j:d,realIndex:c,columnGroupIndex:u,bcx:L,bcy:H,barHeight:p,barWidth:x,textRects:T,strokeWidth:P,dataLabelsX:k,dataLabelsY:D,dataLabelsConfig:X,barDataLabelsConfig:W,barTotalDataLabelsConfig:F,offX:O,offY:Y};if(A=this.barCtx.isHorizontal?this.calculateBarsDataLabelsPosition(_):this.calculateColumnsDataLabelsPosition(_),null!==I&&this.barCtx.isHorizontal&&"center"===W.position){const t=null==(s=null==(e=m.waterfallData.geometry)?void 0:e[c])?void 0:s[d];t&&t.horizontal&&(A.dataLabelsX=(t.levelStart+t.levelEnd)/2+O)}return S=this.drawCalculatedDataLabels({x:A.dataLabelsX,y:A.dataLabelsY,val:null!==I?I:this.barCtx.isRangeBar?[r,o]:"100%"===m.config.chart.stackType?m.globals.seriesPercent[c][d]:m.seriesData.series[c][d],i:c,j:d,barWidth:x,barHeight:p,textRects:T,dataLabelsConfig:X}),m.config.chart.stacked&&F.enabled&&(R=this.drawTotalDataLabels({x:A.totalDataLabelsX,y:A.totalDataLabelsY,barWidth:x,barHeight:p,realIndex:c,j:d,textAnchor:A.totalDataLabelsAnchor,val:this.getStackedTotalDataLabel({realIndex:c,j:d}),rawVal:this.getStackedTotalValue({realIndex:c,j:d}),dataLabelsConfig:X,barTotalDataLabelsConfig:F})),{dataLabelsPos:A,dataLabels:S,totalDataLabels:R}}hasMultipleSeriesGroups(){return this.w.labelData.seriesGroups.length>1}getTotalGroupContext(t){if(!this.hasMultipleSeriesGroups())return null;const e=this.barCtx.barHelpers.getSeriesGroupIndex(t);return e<0?null:{groupIndex:e,group:this.w.labelData.seriesGroups[e]}}drawsStackedTotal(t){const e=this.barCtx.lastActiveBarSerieIndexByGroup,s=this.getTotalGroupContext(t);return s&&e&&e.length>s.groupIndex?e[s.groupIndex]===t:this.barCtx.lastActiveBarSerieIndex===t}getStackedTotalValue({realIndex:t,j:e}){const s=this.w,a=this.getTotalGroupContext(t),i=s.seriesData.stackedSeriesTotalsByGroups;return a&&i&&i[a.groupIndex]?i[a.groupIndex][e]:this.barCtx.stackedSeriesTotals[e]}getStackedTotalDataLabel({realIndex:t,j:e}){const s=this.w;let a=this.getStackedTotalValue({realIndex:t,j:e});return this.totalFormatter&&(a=this.totalFormatter(a,h(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:n,bcx:l,barWidth:h,barHeight:d,textRects:c,dataLabelsX:g,dataLabelsY:u,dataLabelsConfig:p,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:I}=this.barCtx.barHelpers.getZeroValueEncounters({i:i,j:r});l-=v/2;const P=e.layout.gridWidth/e.globals.dataPoints;if(this.barCtx.isVerticalGroupedRangeBar?g+=h/2:(g=e.axisFlags.isXNumeric?l-h/2+y:l-P+h/2+y,!e.config.chart.stacked&&I>0&&e.config.plotOptions.bar.hideZeroBarsWhenGrouped&&(g-=h*I)),w){const t=2;g=g+c.height/2-v/2-t}const L=e.seriesData.series[i][r]<0;let H=n;switch(this.barCtx.isReversed&&(H=n+(L?d:-d)),x.position){case"center":u=w?L?H-d/2+m:H+d/2-m:L?H-d/2+c.height/2+m:H+d/2+c.height/2-m;break;case"bottom":u=w?L?H-d+m:H+d-m:L?H-d+c.height+v+m:H+d-c.height/2+v-m;break;case"top":u=w?L?H+m:H-m:L?H-c.height/2-m:H+c.height+m}let S=H;const R=this.getTotalGroupContext(o);if((R?[R.group]:e.labelData.seriesGroups).forEach(t=>{var e;null==(e=this.barCtx[t.join(",")])||e.prevY.forEach(t=>{S=L?Math.max(t[r],S):Math.min(t[r],S)})}),this.drawsStackedTotal(o)&&f.enabled){const t=18,i=new b(this.barCtx.w).getTextRects(this.getStackedTotalDataLabel({realIndex:o,j:r}),p.fontSize);s=L?S-i.height/2-m-f.offsetY+t:S+i.height+m+f.offsetY-t;const n=P;a=C+(e.axisFlags.isXNumeric?-h/2:h/2-n)+f.offsetX}return e.config.chart.stacked||(u<0?u=0+v:u+c.height/3>e.layout.gridHeight&&(u=e.layout.gridHeight-v)),{bcx:l,bcy:n,dataLabelsX:g,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:n,barHeight:l,barWidth:h,textRects:d,dataLabelsX:c,strokeWidth:g,dataLabelsConfig:u,barDataLabelsConfig:p,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,I;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 P="start";const L=s.seriesData.series[i][r]<0;let H=a;if(this.barCtx.isReversed&&(H=a+(L?-h:h),P=L?"start":"end"),this.barCtx.isPyramid)c=s.layout.gridWidth/2+f;else switch(p.position){case"center":c=L?H+h/2-f:Math.max(d.width/2,H-h/2)+f;break;case"bottom":c=L?H+h-g-f:H-h+g+f;break;case"top":c=L?H-g-f:H-g+f}let S=H;const R=this.getTotalGroupContext(o);if((R?[R.group]:s.labelData.seriesGroups).forEach(t=>{var e;null==(e=this.barCtx[t.join(",")])||e.prevX.forEach(t=>{S=L?Math.min(t[r],S):Math.max(t[r],S)})}),this.drawsStackedTotal(o)&&x.enabled){const t=new b(this.barCtx.w).getTextRects(this.getStackedTotalDataLabel({realIndex:o,j:r}),u.fontSize);L?(w=S-g-f-x.offsetX,P="end"):w=S+f+x.offsetX+(this.barCtx.isReversed?-(h+g):g),I=C-d.height/2+t.height/2+x.offsetY+g,s.globals.barGroups.length>1&&!R&&(I-=s.globals.barGroups.length/2*(l/2))}if(!s.config.chart.stacked){const t=L&&"middle"!==u.textAnchor?"start"===u.textAnchor?"end":"start":u.textAnchor;let e;e="vertical"===p.orientation?d.height/2:"end"===t?d.width:"middle"===t?d.width/2:0;const a=("vertical"===p.orientation?d.height:d.width)-e;c+a>s.layout.gridWidth-g&&(c=s.layout.gridWidth-a-g),c-e<g&&(c=e+g)}return{bcx:a,bcy:n,dataLabelsX:c,dataLabelsY:C,totalDataLabelsX:w,totalDataLabelsY:I,totalDataLabelsAnchor:P}}drawCalculatedDataLabels({x:t,y:e,val:s,i:a,j:i,textRects:r,barHeight:o,barWidth:n,dataLabelsConfig:d}){var g,u,p;const x=this.w;let v="rotate(0)";"vertical"===x.config.plotOptions.bar.dataLabels.orientation&&(v=`rotate(-90, ${t}, ${e})`);const y=new c(this.barCtx.w,this.barCtx.ctx),m=new b(this.barCtx.w),C=d.formatter;let w=null;const I=x.globals.collapsedSeriesIndices.indexOf(a)>-1,P=(x.globals.collapsingSeriesIndices||[]).indexOf(a)>-1;if(P){const t=null==(g=x.globals.prevDataLabels)?void 0:g.get(`${a}::${f(x,a,i)}`);t&&isFinite(t.val)&&(s=t.val)}if(d.enabled&&(!I||P)){w=m.group({class:"apexcharts-data-labels",transform:v});const b=x.config.dataLabels;((null==(u=b.animate)?void 0:u.enabled)||(null==(p=b.countUp)?void 0:p.enabled))&&(w.node.setAttribute("data:dlKey",`${a}::${f(x,a,i)}`),w.node.setAttribute("data:dlJ",String(i)),"number"==typeof s&&isFinite(s)&&w.node.setAttribute("data:dlVal",String(s)));let c="";void 0!==s&&(c=C(s,h(l({},x),{seriesIndex:a,dataPointIndex:i,w:x}))),!s&&x.config.plotOptions.bar.hideZeroBarsWhenGrouped&&(c="");const g=x.seriesData.series[a][i]<0,I=x.config.plotOptions.bar.dataLabels.position;if("vertical"===x.config.plotOptions.bar.dataLabels.orientation&&("top"===I&&(d.textAnchor=g?"end":"start"),"center"===I&&(d.textAnchor="middle"),"bottom"===I&&(d.textAnchor=g?"end":"start")),this.barCtx.isRangeBar&&this.barCtx.barOptions.dataLabels.hideOverflowingLabels){n<m.getTextRects(c,parseFloat(d.style.fontSize).toString()).width&&(c="")}x.config.chart.stacked&&this.barCtx.barOptions.dataLabels.hideOverflowingLabels&&!P&&(this.barCtx.isHorizontal?r.width/1.6>Math.abs(n)&&(c=""):r.height/1.6>Math.abs(o)&&(c=""));const L=l({},d);this.barCtx.isHorizontal&&s<0&&("start"===d.textAnchor?L.textAnchor="end":"end"===d.textAnchor&&(L.textAnchor="start")),y.plotDataLabelsText({x:t,y:e,text:c,i:a,j:i,parent:w,dataLabelsConfig:L,alwaysDrawDataLabel:!0,offsetCorrection:!0})}return w}drawTotalDataLabels({x:t,y:e,val:s,rawVal:a,realIndex:i,j:r,textAnchor:o,barTotalDataLabelsConfig:n}){var l,h;const d=new b(this.barCtx.w);let c;if(n.enabled&&void 0!==t&&void 0!==e&&this.drawsStackedTotal(i)){c=d.drawText({x:t,y:e,foreColor:n.style.color,text:s,textAnchor:o,fontFamily:n.style.fontFamily,fontSize:n.style.fontSize,fontWeight:n.style.fontWeight}),c.attr({class:"apexcharts-datalabel-total",cx:t,cy:e});const b=this.w.config.dataLabels;if((null==(l=b.animate)?void 0:l.enabled)||(null==(h=b.countUp)?void 0:h.enabled)){const{groupIndex:t}=this.barCtx.barHelpers.getGroupIndex(i);c.node.setAttribute("data:dlTotalKey",`${t}::${f(this.w,i,r)}`),c.node.setAttribute("data:dlTotalSeries",String(i)),"number"==typeof a&&isFinite(a)&&c.node.setAttribute("data:dlTotalVal",String(a))}}return c}}const w=globalThis.ApexCharts.__internals.__apex_Series,I=globalThis.ApexCharts.__internals.__apex_Fill,P=globalThis.ApexCharts.__internals.__apex_Utils;function L(t){var e,s,a,i,r,o,n;return"histogram"===(null==(s=null==(e=null==t?void 0:t.config)?void 0:e.chart)?void 0:s.requestedType)&&(!1!==(null==(i=null==(a=t.config.plotOptions)?void 0:a.histogram)?void 0:i.overlap)&&(null!=(n=null==(o=null==(r=t.seriesData)?void 0:r.series)?void 0:o.length)?n:0)>1)}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),P.isSafari()&&(this.arrBorderRadius=this.arrBorderRadius.map(t=>t.map(t=>"none"))),0===this.barCtx.seriesLen&&(this.barCtx.seriesLen=1)}barSlotXSpan(){const t=this.w;if(void 0!==this._slotXSpan)return this._slotXSpan;let e=0;if(t.globals.dataPoints<=1){const s=t.globals.maxX-t.globals.minX;e=s>0?s/4:0}else if(e=this._unionMinXGap(),!(e>0&&isFinite(e))){const s=t.globals.minXDiff;e=s>0&&isFinite(s)&&.5!==s?s:0}return this._slotXSpan=e,e}_unionMinXGap(){const t=this.w.seriesData.seriesX||[],e=[];for(let s=0;s<t.length;s++){const a=t[s];Array.isArray(a)&&a.length>0&&e.push(a)}if(!e.length)return 0;const s=new Array(e.length).fill(0);let a=NaN,i=1/0;for(;;){let t=1/0,r=-1;for(let a=0;a<e.length;a++){const i=e[a];for(;s[a]<i.length&&"number"!=typeof i[s[a]];)s[a]++;if(s[a]>=i.length)continue;const o=i[s[a]];o==o?o<t&&(t=o,r=a):(s[a]++,a--)}if(-1===r)break;if(s[r]++,a==a){const e=t-a;e>0&&e<i&&(i=e)}a=t}return isFinite(i)?i:0}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||L(e))&&(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=this.barSlotXSpan();e>0&&e/t>0&&(r=e/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+P.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;const r=this.w,o=new I(this.barCtx.w);let n=null;const l=this.barCtx.barOptions.distributed?s:e;let h=!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&&(n=a.color,h=!0)})}const d=this.getDumbbellConnectorFill(e,s)||(null==(i=r.config.series[e].data[s])?void 0:i.fill),b=this.barCtx.barOptions.isDumbbell?r.config.plotOptions.bar.dumbbell.connector:null;let c;b&&b.color&&(n=b.color,c=b.opacity);return{color:o.fillPath({seriesNumber:this.barCtx.barOptions.distributed?l:a,dataPointIndex:s,color:n,opacity:c,value:t[e][s],fillConfig:d,fillType:(null==d?void 0:d.type)?d.type:Array.isArray(r.config.fill.type)?r.config.fill.type[a]:r.config.fill.type}),useRangeColor:h}}getDumbbellConnectorFill(t,e){const s=this.w;if(!this.barCtx.barOptions.isDumbbell)return null;const a=s.dumbbellData;if(!a||"series"!==a.form)return null;const i=s.config.plotOptions.bar.dumbbell.connector;if(i.color)return null;const r=a.order[e];if(!r)return null;const o=s.globals.colors[r[0]],n=s.globals.colors[r[1]];return o&&n?{type:"gradient",gradient:{type:this.barCtx.isHorizontal?"horizontal":"vertical",gradientFrom:o,gradientTo:n,opacityFrom:i.opacity,opacityTo:i.opacity,stops:[0,100],inverseColors:!this.barCtx.isHorizontal}}:null}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}getStackedSeriesIndices(t){const e=this.w,s=e.labelData.seriesGroups,a=e.globals.columnSeries?new Set(e.globals.columnSeries.i):null,i=t=>!a||a.has(t);if(!s||s.length<2){const e=Array.from({length:t},(t,e)=>e).filter(i);return e.length?[e]:[]}const r=Array.from({length:s.length},()=>[]),o=[];for(let e=0;e<t;e++){if(!i(e))continue;const t=this.getSeriesGroupIndex(e);t>-1?r[t].push(e):o.push(e)}return o.length&&r.push(o),r.filter(t=>t.length>0)}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="last"===s.config.plotOptions.bar.borderRadiusWhenStacked,l=n?"top":"both",h=n?"bottom":"both",d=n?"none":"bottom",b=n?"none":"top";for(const e of this.getStackedSeriesIndices(i))for(let s=0;s<r;s++){const a=[],i=[];for(const r of e){const e=t[r][s];e>0?a.push(r):e<0&&i.push(r)}if(a.length>0&&0===i.length)if(1===a.length)o[a[0]][s]=l;else{const t=a[0],e=a[a.length-1];for(const i of a)o[i][s]=i===t?d:i===e?"top":"none"}else if(i.length>0&&0===a.length)if(1===i.length)o[i[0]][s]=h;else{const t=Math.min(...i),e=Math.max(...i);for(const a of i)o[a][s]=a===t?b:a===e?"bottom":"none"}else if(a.length>0&&i.length>0){const t=a[a.length-1];for(const e of a)o[e][s]=e===t?"top":"none";const e=Math.max(...i);for(const t of i)o[t][s]=t===e?"bottom":"none"}}return o}barBackground({j:t,i:e,x1:s,x2:a,y1:i,y2:r,elSeries:o}){const n=this.w,l=new b(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:c}){var g,u,p;const x=new b(this.barCtx.w);(i=Array.isArray(i)?i[l]:i)||(i=0);let f=t,v=e;(null==(g=c.config.series[l].data[d])?void 0:g.columnWidthOffset)&&(v=e-c.config.series[l].data[d].columnWidthOffset/2,f=t+c.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 I=x.line(C,s),P="around"===c.config.plotOptions.bar.borderRadiusApplication||"both"===this.arrBorderRadius[l][d]?" Z":" z",L=x.move(m,s)+x.line(m,a)+x.line(C,a)+I+P;let H=L;"none"!==this.arrBorderRadius[l][d]&&(H=x.roundPathCorners(H,c.config.plotOptions.bar.borderRadius));let S=null;const R=null==(p=null==(u=this.barCtx.ctx)?void 0:u.morphTypeChange)?void 0:p.getInitialPathFor(l,d);if(R?S=R:c.globals.previousPaths.length>0&&(S=this.barCtx.getPreviousPath(l,d,H,L)),null==S&&(S=x.move(m,s)+x.line(m,s)+I+I+I+I+I+x.line(m,s)+P),c.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:S,drawnBox:{x1:m,x2:C,y1:s,y2:a}}}getFunnelTrapezoidPaths({barYPosition:t,barHeight:e,series:s,i:a,j:i,realIndex:r,strokeWidth:o,w:n}){var l,h;const d=new b(this.barCtx.w),c=n.layout.gridWidth/2,g=t=>Math.abs(t/this.barCtx.invertedYRatio)/2,u=g(s[a][i]),p=i===s[a].length-1,x="taper"===n.config.plotOptions.funnel.lastShape?"taper":"flat";let f;f=p?"taper"===x?0:u:g(s[a][i+1]);const v=o/2,y=t+v,m=t+e-v,C=c-u,w=c+u,I=c-f,P=c+f,L=d.move(C,y)+d.line(w,y)+d.line(P,m)+d.line(I,m)+" Z";let H=null;const S=null==(h=null==(l=this.barCtx.ctx)?void 0:l.morphTypeChange)?void 0:h.getInitialPathFor(r,i);return S?H=S:n.globals.previousPaths.length>0&&(H=this.barCtx.getPreviousPath(r,i,L)),null==H&&(H=d.move(c,y)+d.line(c,y)+d.line(c,m)+d.line(c,m)+" Z"),{pathTo:L,pathFrom:H,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 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 b(this.barCtx.w),c=n.layout.gridWidth/2,g=o/2,u=t+g,p=t+e-g,x=c-s,f=c+s,v=c-a,y=c+a,m=d.move(x,u)+d.line(f,u)+d.line(y,p)+d.line(v,p)+" 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(c,u)+d.line(c,u)+d.line(c,p)+d.line(c,p)+" Z"),{pathTo:m,pathFrom:C,x:f,x1:x,barXPosition:c}}getBarpaths({barYPosition:t,barHeight:e,x1:s,x2:a,strokeWidth:i,isReversed:r,series:o,seriesGroup:n,realIndex:l,i:h,j:d,w:c}){var g,u,p;const x=new b(this.barCtx.w);(i=Array.isArray(i)?i[l]:i)||(i=0);let f=t,v=e;(null==(g=c.config.series[l].data[d])?void 0:g.barHeightOffset)&&(f=t-c.config.series[l].data[d].barHeightOffset/2,v=e+c.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 I=this.barCtx.isFunnel,P=I?(s+a)/2:s,L=x.line(s,C),H="around"===c.config.plotOptions.bar.borderRadiusApplication||"both"===this.arrBorderRadius[l][d]?" Z":" z",S=x.move(s,m)+x.line(a,m)+x.line(a,C)+L+H;let R=S;"none"!==this.arrBorderRadius[l][d]&&(R=x.roundPathCorners(R,c.config.plotOptions.bar.borderRadius));let k=null;const D=null==(p=null==(u=this.barCtx.ctx)?void 0:u.morphTypeChange)?void 0:p.getInitialPathFor(l,d);if(D?k=D:c.globals.previousPaths.length>0&&(k=this.barCtx.getPreviousPath(l,d,R,S)),null==k){const t=I?x.line(P,C):L;k=x.move(P,m)+x.line(P,m)+t+t+t+t+t+x.line(P,m)+H}if(c.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:R,pathFrom:k,drawnBox:{x1:s,x2:a,y1:m,y2:C}}}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,n=[],d=(a,i)=>{n.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){const e=this.getDumbbellEnds(a,i);if(e.length){const s={strokeHeight:"x"===t?0:o.globals.markers.size[a],strokeWidth:"x"===t?o.globals.markers.size[a]:0,strokeDashArray:0,strokeLineCap:"round"};let r=0,n=0;for(let t=1;t<e.length;t++)e[t].value<e[r].value&&(r=t),e[t].value>e[n].value&&(n=t);const b=o.config.plotOptions.bar.dumbbell.dataLabels;e.forEach((t,e)=>{const o=h(l({},s),{strokeColor:t.color});!b.enabled||e!==r&&e!==n||(o.label={text:this.getDumbbellLabelText(t.value,a,i,t.index),color:b.colorFromMarker?t.color:Array.isArray(b.style.colors)?b.style.colors[t.index]||b.style.colors[0]:b.style.colors,outward:e===r&&r!==n?-1:1}),d(t.value,o)})}}return n}getDumbbellEnds(t,e){const s=this.w,a=[],i=s.dumbbellData;if(i&&"series"===i.form){const t=i.values[e]||[];for(let e=0;e<t.length;e++){const r=t[e];null!==r&&-1===i.hidden.indexOf(e)&&a.push({value:r,color:s.globals.colors[e],index:e})}return a}if(!s.rangeData.seriesRange.length)return a;const r=this.barCtx.barOptions.dumbbellColors?this.barCtx.barOptions.dumbbellColors:s.globals.colors,o=e=>Array.isArray(r[t])?r[t][e]:r[t];return[{value:s.rangeData.seriesRangeStart[t][e],color:o(0),index:0},{value:s.rangeData.seriesRangeEnd[t][e],color:o(1),index:1}]}getDumbbellLabelText(t,e,s,a){const i=this.w,r=i.config.plotOptions.bar.dumbbell.dataLabels;if("function"==typeof r.formatter)return r.formatter(t,{seriesIndex:e,dataPointIndex:s,endpointIndex:a,w:i});const o=this.barCtx.isHorizontal?i.formatters.xLabelFormatter:i.formatters.yLabelFormatters[0];return"function"==typeof o?o(t,s,i):String(t)}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 b(this.barCtx.w),n=o.group({class:"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),t.attrs.label&&n.add(this.drawDumbbellLabel(t.attrs,{x:t.x,y:a-s,horizontal:!0,markerSize:t.attrs.strokeWidth||0}))}}):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),e.attrs.label&&n.add(this.drawDumbbellLabel(e.attrs,{x:a-s,y:e.y,horizontal:!1,markerSize:e.attrs.strokeHeight||0}))}}),n}drawDumbbellLabel(t,e){const s=this.w,a=new b(s),i=s.config.plotOptions.bar.dumbbell.dataLabels,r=e.markerSize/2+i.offset,o=t.label.outward;return a.drawText({x:e.x+(e.horizontal?r*o:0),y:e.y-(e.horizontal?0:r*o),text:t.label.text,textAnchor:e.horizontal?o<0?"end":"start":"middle",dominantBaseline:e.horizontal?"central":o<0?"hanging":"auto",foreColor:t.label.color,fontSize:i.style.fontSize,fontFamily:i.style.fontFamily,fontWeight:i.style.fontWeight,cssClass:"apexcharts-dumbbell-label"})}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:c}=e,g=l+e.barHeight,u=new b(this.barCtx.w),p=new P,x=u.move(n,g)+u.line(o,g)+u.line(h,c)+u.line(d,c)+u.line(n,g)+("around"===r.config.plotOptions.bar.borderRadiusApplication||"both"===this.arrBorderRadius[a][i]?" Z":" z");return u.drawPath({d:x,fill:p.shadeColor(.5,P.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}}getSeriesGroupIndex(t){const e=this.w;return e.labelData.seriesGroups.findIndex(s=>s.indexOf(e.seriesData.seriesNames[t])>-1)}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 S=globalThis.ApexCharts.__internals.__apex_CoreUtils,R=globalThis.ApexCharts.__internals.__apex_Filters,k=globalThis.ApexCharts.__internals;k.__apex_Animations;const D=k.__apex_Animations_computeStagger;k.__apex_Animations_applyAnimationPolicy,k.__apex_Animations_prefersReducedMotion,k.__apex_Animations_applyProgressiveReveal;class A{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)/A.xRatio(t)}static pxToDataX(t,e){return t.globals.minX+e*A.xRatio(t)}static screenXToPlotPx(t,e){const s=t.dom.baseEl,a=s&&s.querySelector(".apexcharts-svg");if(!a)return e-t.layout.translateX;const i=a.getBoundingClientRect(),r=t.globals.svgWidth?i.width/t.globals.svgWidth:1;return(e-i.left)/(r||1)-t.layout.translateX}}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._pathToInterp=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.lastActiveBarSerieIndexByGroup=a.getActiveConfigSeriesIndexByGroup(["bar","column"]),this.columnGroupIndices=[];const i=a.getBarSeriesIndices(),r=new S(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 b(this.w),n=new S(this.w);t=n.getLogSeries(t),this.series=t,this.yRatio=n.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&&console.warn("WARNING: DataLabels are enabled but there are too many to display. This may cause performance issue when rendering - ApexCharts");for(let n=0,b=0;n<t.length;n++,b++){let c,g;const u=[],p=[],x=r.globals.comboCharts?e[n]:n,{columnGroupIndex:v}=this.barHelpers.getGroupIndex(x),y=o.group({class:"apexcharts-series",rel:n+1,seriesName:P.escapeString(r.seriesData.seriesNames[x]),"data:realIndex":x});w.addCollapsedClassToSeries(this.w,y,x),t[n].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[n]));const I=this.barHelpers.initialPositions(x),{y:L,yDivision:H,zeroW:S,x:k,xDivision:D,zeroH:A}=I;let X=I.barHeight,W=I.barWidth;g=L,c=k,this.isHorizontal||p.push(c+(null!=W?W: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[n].length;e++){const s=this.barHelpers.getStrokeWidth(n,e,x);let o=null;const d={indexes:{i:n,j:e,realIndex:x,translationsIndex:C,bc:b},x:c,y:g,strokeWidth:s,elSeries:y};this.isHorizontal?(o=this.drawBarPaths(h(l({},d),{barHeight:X,zeroW:S,yDivision:H})),W=this.series[n][e]/this.invertedYRatio):(o=this.drawColumnPaths(h(l({},d),{xDivision:D,barWidth:W,zeroH:A})),X=this.series[n][e]/this.yRatio[C]);const f=this.barHelpers.getPathFillColor(t,n,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:P.hexToRgba(r.globals.colors[n]),prevPaths:this.pathArr[this.pathArr.length-1],currPaths:o,realIndex:x,j:e});if(Y.add(t),r.config.chart.dropShadow.enabled){new R(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:X,barWidth:W});m&&O.add(m),g=o.y,c=o.x,e>0&&p.push(c+(null!=W?W:0)/2),u.push(g),this.renderSeries(h(l({realIndex:x,pathFill:f.color},f.useRangeColor?{lineFill:f.color}:{}),{j:e,i:n,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:X),barWidth:Math.abs(o.barWidth?o.barWidth:W),elDataLabelsWrap:F,elGoalsMarkers:O,elBarShadows:Y,visibleSeries:this.visibleI,type:"bar"}))}if(r.globals.seriesXvalues[x]=p,r.globals.seriesYvalues[x]=u,r.globals.previousPaths.length>0){const e=[];for(let s=0;s<t[n].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:c,y1:g,y2:u,series:p,barHeight:x,barWidth:v,barXPosition:y,barYPosition:m,elDataLabelsWrap:w,elGoalsMarkers:I,elBarShadows:P,visibleSeries:L,type:H,classes:S}){var k,A,X,W,F,O,Y;const T=this.w,_=new b(this.w,this.ctx),B=function(t,e){const s=t&&t.renderer;return s&&s.kind&&"svg"!==s.kind?s:e}(this.ctx,_);let j=!1;const G=this._pathToInterp;if(this._pathToInterp=null,h._bindingsDelegated||(h._bindingsDelegated=!0,_.setupEventDelegation(h,`.apexcharts-${H}-area`)),!s){let e=function(t){const e=T.config.stroke.colors;let s;return Array.isArray(e)&&e.length>0&&(s=e[t],s||(s=""),"function"==typeof s)?s({value:T.seriesData.series[t][a],dataPointIndex:a,w:T}):s};const i="function"==typeof T.globals.stroke.colors[t]?e(t):T.globals.stroke.colors[t];s=this.barOptions.distributed?T.globals.stroke.colors[a]:i}const z=T.config.chart.animations,M=z.animateGradually;let N=0,V=0;if(M&&!1!==M.enabled&&!(T.globals.dataChanged&&this.isLayoutShift(t))){const t=T.globals.dataPoints||1,e=M.delay||0,s=Math.min(e,.5*z.speed/Math.max(1,t));V=D({style:"sequential",index:a,baseDelay:s}),T.config.chart.stacked&&!T.globals.dataChanged&&(V+=i*s*.5);N=V/(e||1)}const E=new C(this).handleBarDataLabels({x:d,y:c,y1:g,y2:u,i:i,j:a,series:p,realIndex:t,columnGroupIndex:r,barHeight:x,barWidth:v,barXPosition:y,barYPosition:m,visibleSeries:L});if(V>0){const t=T.config.dataLabels;if((null==(k=t.animate)?void 0:k.enabled)||(null==(A=t.countUp)?void 0:A.enabled)){const t=String(Math.round(V));null==(W=null==(X=E.dataLabels)?void 0:X.node)||W.setAttribute("data:dlDelay",t),null==(O=null==(F=E.totalDataLabels)?void 0:F.node)||O.setAttribute("data:dlDelay",t)}}if(T.globals.isBarHorizontal||(E.dataLabelsPos.dataLabelsX+Math.max(v,T.globals.barPadForNumericAxis)<0||E.dataLabelsPos.dataLabelsX-Math.max(v,T.globals.barPadForNumericAxis)>T.layout.gridWidth)&&(j=!0),T.config.series[i].data[a]&&T.config.series[i].data[a].strokeColor&&(s=T.config.series[i].data[a].strokeColor),this.isNullValue&&-1===T.globals.collapsingSeriesIndices.indexOf(t)&&(e="none"),!j){const r=!0===(null==(Y=this.ctx.morphTypeChange)?void 0:Y.isActive()),d=r?this.ctx.morphTypeChange.getSpeed():T.config.chart.animations.dynamicAnimation.speed,b=r&&this.ctx.morphTypeChange.claimsTargetMark(t,a);b&&(o=n,N=0);const c=B.renderPaths({i:i,j:a,realIndex:t,pathFrom:o,pathTo:n,stroke:s,strokeWidth:l,strokeLineCap:T.config.stroke.lineCap,fill:e,pathToInterp:G,animationDelay:N,initialSpeed:T.config.chart.animations.speed,dataChangeSpeed:d,className:`apexcharts-${H}-area${S?` ${S}`:""}`,chartType:H,bindEventsOnPaths:!1});c.attr("clip-path",`url(#gridRectBarMask${T.globals.cuid})`),b&&(c.node.setAttribute("opacity","0"),c.node.setAttribute("data-piece-hidden","1"));const p=T.config.forecastDataPoints;p.count>0&&a>=T.globals.dataPoints-p.count&&(c.node.setAttribute("stroke-dasharray",p.dashArray),c.node.setAttribute("stroke-width",p.strokeWidth),c.node.setAttribute("fill-opacity",p.fillOpacity)),void 0!==g&&void 0!==u&&(c.attr("data-range-y1",g),c.attr("data-range-y2",u));new R(this.w).setSelectionFilter(c,t,a),h.add(c),c.attr({cy:E.dataLabelsPos.bcy,cx:E.dataLabelsPos.bcx,j:a,val:T.seriesData.series[i][a],barHeight:x,barWidth:v,"data:pathKey":f(T,t,a)}),"canvas"===B.kind&&(T.globals.barCanvasCoords||(T.globals.barCanvasCoords={}),T.globals.barCanvasCoords[t]||(T.globals.barCanvasCoords[t]={}),T.globals.barCanvasCoords[t][a]={cx:E.dataLabelsPos.bcx,cy:E.dataLabelsPos.bcy,barWidth:v}),null!==E.dataLabels&&w.add(E.dataLabels),E.totalDataLabels&&w.add(E.totalDataLabels),h.add(w),I&&h.add(I),P&&h.add(P)}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,u=!!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 p;return i=this.barHelpers.getXForValue(this.series[h][d],null!=a?a:0),p=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||u)&&(a=p.x1,i=p.x),l.axisFlags.isXNumeric||u||(r+=o),u&&(r=b),this.barHelpers.barBackground({j:d,i:h,y1:b-e*this.visibleI,y2:e*this.seriesLen,elSeries:n}),{pathTo:p.pathTo,pathFrom:p.pathFrom,x1:a,x:i,y:r,goalX:this.barHelpers.getGoalValues("x",a,null,t.realIndex,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 u;if(l.axisFlags.isXNumeric){const t=this.getBarXForNumericXAxis({x:e,j:c,realIndex:h,barWidth:i});e=t.x,u=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),u=e+i*this.visibleI,u-=i*s}else u=e+i*this.visibleI;s=this.barHelpers.getYForValue(this.series[b][c],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:b,j:c,w:l});return l.axisFlags.isXNumeric||(e+=a),this.barHelpers.barBackground({bc:g,j:c,i:b,x1:u-o/2-i*this.visibleI,x2:i*this.seriesLen+o/2,elSeries:n}),{pathTo:p.pathTo,pathFrom:p.pathFrom,x:e,y:s,goalY:this.barHelpers.getGoalValues("y",null,r,h,c,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),P.isNumber(i.seriesData.seriesX[r][a])&&(t=A.dataXToPx(i,i.seriesData.seriesX[r][a])-e*this.seriesLen/2),{barXPosition:t+(L(i)?0: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,a){const i=this.w;this._pathToInterp=null;const r=this._prevRecord(t);if(!r)return x(i)?null:s;let o=null,n=!1;const l=this._prevKeyedPaths(t);if(l){const s=l.get(f(i,t,e));s?o=s.d:n=!0}else void 0!==r.paths[e]?o=r.paths[e].d:n=!0;if(o){const t=X.pathCommandCount(o),e=X.pathCommandCount(s);if(t===e)return o;const r=new b(i),n=t=>{const e=X.pathBox(t);return e?Math.min(e.maxX-e.minX,e.maxY-e.minY):0},l=t<e?n(o)>1:n(s)>1;if(t<e){const t=r.roundPathCorners(o,0);if(X.pathCommandCount(t)===e){if(l&&a){const t=r.roundPathCorners(a,0);X.pathCommandCount(t)===e&&(this._pathToInterp=t)}return t}}else{const e=r.roundPathCorners(s,0);if(X.pathCommandCount(e)===t){if(this._pathToInterp=e,l){const e=X.squareLike(o),s=e?r.roundPathCorners(e,0):null;if(s&&X.pathCommandCount(s)===t)return s}return o}}}return n&&x(i)?null:s}static pathBox(t){if(!t)return null;const e=[],s=/([MLC])([^MLCZz]*)/g;let a;for(;null!==(a=s.exec(t));){const t=a[2].trim().split(/[\s,]+/).map(Number);t.length<2||t.some(isNaN)||e.push([t[t.length-2],t[t.length-1]])}if(e.length<3)return null;const i=e.map(t=>t[0]),r=e.map(t=>t[1]);return{minX:Math.min(...i),maxX:Math.max(...i),minY:Math.min(...r),maxY:Math.max(...r),start:e[0],vertical:Math.abs(e[1][0]-e[0][0])<Math.abs(e[1][1]-e[0][1])}}static squareLike(t){const e=X.pathBox(t);if(!e)return null;const{minX:s,maxX:a,minY:i,maxY:r,start:o,vertical:n}=e,l=(t,e,s)=>Math.abs(t-e)<=Math.abs(t-s)?[e,s]:[s,e];let h,d,b,c;n?(h=Math.abs(o[0]-s)<=Math.abs(o[0]-a)?s:a,d=h===s?a:s,[b,c]=l(o[1],i,r)):(b=Math.abs(o[1]-i)<=Math.abs(o[1]-r)?i:r,c=b===i?r:i,[h,d]=l(o[0],s,a));const g=t.trim().endsWith("Z")?" Z":" z";return n?`M ${h} ${b} L ${h} ${c} L ${d} ${c} L ${d} ${b}${g}`:`M ${h} ${b} L ${d} ${b} L ${d} ${c} L ${h} ${c}${g}`}getPreviousFlip(t,e){const s=this.w,a=this._prevRecord(t);if(!a)return null;const i=this._prevKeyedPaths(t),r=i?i.get(f(s,t,e)):a.paths[e];return r?!!r.flip:null}static pathCommandCount(t){if(!t)return 0;const e=t.match(/[A-Za-z]/g);return e?e.length:0}}d.use({bar:X,column:X,barStacked:class extends X{draw(t,e){const s=this.w;this.graphics=new b(this.w),this.bar=new X(this.w,this.ctx,this.xyRatios);const a=new S(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;const n=s.config.chart.animations,d=n.enabled&&n.dynamicAnimation.enabled&&s.globals.previousPaths.length>0;let c=!1;for(let a=0,n=0;a<t.length;a++,n++){const b=s.globals.comboCharts?e[a]:a,{groupIndex:g,columnGroupIndex:u}=this.barHelpers.getGroupIndex(b);this.groupCtx=this[s.labelData.seriesGroups[g]];const p=[],x=[];let f=0;this.yRatio.length>1&&(this.yaxisIndex=s.globals.seriesYAxisReverseMap[b][0],f=b),this.isReversed=s.config.yaxis[this.yaxisIndex]&&s.config.yaxis[this.yaxisIndex].reversed;let v=this.graphics.group({class:"apexcharts-series",seriesName:P.escapeString(s.seriesData.seriesNames[b]),rel:a+1,"data:realIndex":b});w.addCollapsedClassToSeries(this.w,v,b);const y=this.graphics.group({class:"apexcharts-datalabels","data:realIndex":b});w.addCollapsedClassToSeries(this.w,y,b),(s.globals.collapsingSeriesIndices||[]).indexOf(b)>-1&&y.node.style.setProperty("--apexcharts-dl-exit",`${s.config.chart.animations.dynamicAnimation.speed}ms`);const m=this.graphics.group({class:"apexcharts-bar-goals-markers"}),C=this.initialPositions(r,o,void 0,void 0,void 0,void 0,f),{xDivision:I,yDivision:L,zeroH:H,zeroW:S}=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(()=>H),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,b),C={indexes:{i:a,j:e,realIndex:b,translationsIndex:f,bc:n},strokeWidth:i,x:r,y:o,elSeries:v,columnGroupIndex:u,seriesGroup:s.labelData.seriesGroups[g]};let w=null;this.isHorizontal?(w=this.drawStackedBarPaths(h(l({},C),{zeroW:S,barHeight:R,yDivision:L})),k=this.series[a][e]/this.invertedYRatio):(w=this.drawStackedColumnPaths(h(l({},C),{xDivision:I,barWidth:k,zeroH:H})),R=this.series[a][e]/this.yRatio[f]);const P=this.barHelpers.drawGoalLine({barXPosition:w.barXPosition,barYPosition:w.barYPosition,goalX:w.goalX,goalY:w.goalY,barHeight:R,barWidth:k});P&&m.add(P),o=w.y,r=w.x,p.push(r),x.push(o);const D=this.barHelpers.getPathFillColor(t,a,e,b);let A="";const X=s.globals.isBarHorizontal?"apexcharts-flip-x":"apexcharts-flip-y",W="bottom"===this.barHelpers.arrBorderRadius[b][e]&&s.seriesData.series[b][e]>0||"top"===this.barHelpers.arrBorderRadius[b][e]&&s.seriesData.series[b][e]<0,F=d&&!W&&this.getPreviousFlip(b,e);(W||F)&&(A=X),F&&(A+=" apexcharts-flip-held",c=!0),v=this.renderSeries(h(l({realIndex:b,pathFill:D.color},D.useRangeColor?{lineFill:D.color}:{}),{j:e,i:a,columnGroupIndex:u,pathFrom:w.pathFrom,pathTo:w.pathTo,strokeWidth:i,elSeries:v,x:r,y:o,series:t,barHeight:R,barWidth:k,elDataLabelsWrap:y,elGoalsMarkers:m,type:"bar",visibleSeries:u,classes:A}))}s.globals.seriesXvalues[b]=p,s.globals.seriesYvalues[b]=x,this.groupCtx.prevY.push(this.groupCtx.yArrj),this.groupCtx.prevYF.push(this.groupCtx.yArrjF),this.groupCtx.prevYVal.push(this.groupCtx.yArrjVal),this.groupCtx.prevX.push(this.groupCtx.xArrj),this.groupCtx.prevXF.push(this.groupCtx.xArrjF),this.groupCtx.prevXVal.push(this.groupCtx.xArrjVal),i.add(v)}return c&&this.settleHeldMirrors(),i}settleHeldMirrors(){const t=this.w;if(!p.isBrowser())return;const e=t.config.chart.animations,s=(e.dynamicAnimation.speed||0)+(e.speed||0)+100;setTimeout(()=>{!t.globals.isDestroyed&&P.elementExists(t.dom.baseEl)&&t.dom.baseEl.querySelectorAll(".apexcharts-flip-held").forEach(t=>{t.classList.remove("apexcharts-flip-held","apexcharts-flip-y","apexcharts-flip-x")})},s)}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,a=n.axisFlags.isXNumeric?this.barHelpers.barSlotXSpan():0;a>0?h=(s=a/this.xRatio)*parseInt(this.barOptions.columnWidth,10)/100:h*=parseInt(e,10)/100,-1===String(e).indexOf("%")&&(h=parseInt(e,10)),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,u;const p=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];const I=this.groupCtx.prevX.length;if(I>0){let t=a;this.groupCtx.prevXVal[I-1][y]<0?t=(null==(d=this.series[v])?void 0:d[y])>=0?this.groupCtx.prevX[I-1][y]+w-2*(this.isReversed?w:0):this.groupCtx.prevX[I-1][y]:this.groupCtx.prevXVal[I-1][y]>=0&&(t=(null==(b=this.series[v])?void 0:b[y])>=0?this.groupCtx.prevX[I-1][y]:this.groupCtx.prevX[I-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==(u=this.series[v])?void 0:u[y])/this.invertedYRatio:0);const P=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:p});return this.barHelpers.barBackground({j:y,i:v,y1:x,y2:e,elSeries:h}),r+=l,{pathTo:P.pathTo,pathFrom:P.pathFrom,goalX:this.barHelpers.getGoalValues("x",a,null,m,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,u,p,x,f;const v=this.w,y=t.i,m=t.j,C=t.bc,w=t.realIndex,I=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 P=e+o*i;let L,H=0;for(let t=0;t<this.groupCtx.prevYF.length;t++)H+=isNaN(this.groupCtx.prevYF[t][m])?0:this.groupCtx.prevYF[t][m];const S=this.groupCtx.prevY.length;if(S>0&&!v.axisFlags.isXNumeric||S>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[S-1]&&this.groupCtx.prevY[S-1].length)for(let t=1;t<s;t++)if(!isNaN(null==(h=this.groupCtx.prevY[S-t])?void 0:h[m])){e=this.groupCtx.prevY[S-t][m];break}for(let a=1;a<s;a++){if((null==(d=this.groupCtx.prevYVal[S-a])?void 0:d[m])<0){t=(null==(b=this.series[y])?void 0:b[m])>=0?e-H+2*(this.isReversed?H:0):e;break}if((null==(c=this.groupCtx.prevYVal[S-a])?void 0:c[m])>=0){t=(null==(g=this.series[y])?void 0:g[m])>=0?e:e+H-2*(this.isReversed?H:0);break}}void 0===t&&(t=v.layout.gridHeight),L=(null==(u=this.groupCtx.prevYF[0])?void 0:u.every(t=>0===t))&&this.groupCtx.prevYF.slice(1,S).every(t=>t.every(t=>isNaN(t)))?r:t}else L=r;s=(null==(p=this.series[y])?void 0:p[m])?L-(null==(x=this.series[y])?void 0:x[m])/this.yRatio[I]+2*(this.isReversed?(null==(f=this.series[y])?void 0:f[m])/this.yRatio[I]:0):L;const R=this.barHelpers.getColumnPaths({barXPosition:P,barWidth:i,y1:L,y2:s,yRatio:this.yRatio[I],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:P,x2:i,elSeries:l}),{pathTo:R.pathTo,pathFrom:R.pathFrom,goalY:this.barHelpers.getGoalValues("y",null,r,w,m,0),barXPosition:P,x:v.axisFlags.isXNumeric?e:e+a,y:s}}},rangeBar:class extends X{draw(t,e){var s,a,i,r,o,n,h,d,c;const g=this.w,u=new b(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 p=u.group({class:"apexcharts-rangebar-series apexcharts-plot-series"});for(let b=0;b<t.length;b++){let x,f;const v=g.globals.comboCharts?e[b]:b,{columnGroupIndex:y}=this.barHelpers.getGroupIndex(v),m=u.group({class:"apexcharts-series",seriesName:P.escapeString(g.seriesData.seriesNames[v]),rel:b+1,"data:realIndex":v});w.addCollapsedClassToSeries(this.w,m,v),t[b].length>0&&(this.visibleI=this.visibleI+1);let C=0;this.yRatio.length>1&&(this.yaxisIndex=g.globals.seriesYAxisReverseMap[v][0],C=v);const I=this.barHelpers.initialPositions(v),{y:L,zeroW:H,x:S,zeroH:R}=I;let k=null!=(s=I.barWidth)?s:0,D=null!=(a=I.barHeight)?a:0;const A=null!=(i=I.yDivision)?i:0,X=null!=(r=I.xDivision)?r:0;f=L,x=S;const W=u.group({class:"apexcharts-datalabels","data:realIndex":v}),F=u.group({class:"apexcharts-rangebar-goals-markers"});for(let e=0;e<g.globals.dataPoints;e++){const s=this.barHelpers.getStrokeWidth(b,e,v),a=this.seriesRangeStart[b][e],i=this.seriesRangeEnd[b][e];let r=null,u=null,p=null;const w={x:x,y:f,strokeWidth:s,elSeries:m};let P=this.seriesLen;if(g.config.plotOptions.bar.rangeBarGroupRows&&(P=1),void 0===(null==(o=g.config.series[b].data)?void 0:o[e]))break;if(this.isHorizontal){p=f+D*this.visibleI;const t=(A-D*P)/2;if(null==(h=null==(n=g.config.series[b].data)?void 0:n[e])?void 0:h.x){const s=this.detectOverlappingBars({i:b,j:e,barYPosition:p,srty:t,barHeight:D,yDivision:A,initPositions:I});D=s.barHeight,p=s.barYPosition}r=this.drawRangeBarPaths(l({indexes:{i:b,j:e,realIndex:v},barHeight:D,barYPosition:p,zeroW:H,yDivision:A,y1:a,y2:i},w)),k=r.barWidth}else{g.axisFlags.isXNumeric&&(x=(g.seriesData.seriesX[b][e]-g.globals.minX)/this.xRatio-k/2),u=x+k*this.visibleI;const t=(X-k*P)/2;if(null==(c=null==(d=g.config.series[b].data)?void 0:d[e])?void 0:c.x){const s=this.detectOverlappingBars({i:b,j:e,barXPosition:u,srtx:t,barWidth:k,xDivision:X,initPositions:I});k=s.barWidth,u=s.barXPosition}r=this.drawRangeColumnPaths(l({indexes:{i:b,j:e,realIndex:v,translationsIndex:C},barWidth:k,barXPosition:u,zeroH:R,xDivision:X},w)),D=r.barHeight}const L=this.barHelpers.drawGoalLine({barXPosition:r.barXPosition,barYPosition:p,goalX:r.goalX,goalY:r.goalY,barHeight:D,barWidth:k});L&&F.add(L),f=r.y,x=r.x;const S=this.barHelpers.getPathFillColor(t,b,e,v);this.renderSeries({realIndex:v,pathFill:S.color,lineFill:S.useRangeColor?S.color:g.globals.stroke.colors[v],j:e,i:b,x:x,y:f,y1:a,y2:i,pathFrom:r.pathFrom,pathTo:r.pathTo,strokeWidth:s,elSeries:m,series:t,barHeight:D,barWidth:k,barXPosition:u,barYPosition:p,columnGroupIndex:y,elDataLabelsWrap:W,elGoalsMarkers:F,visibleSeries:this.visibleI,type:"rangebar"})}p.add(m)}return p}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,u;const p=this.w;let x=[];const f=null==(c=null==(b=p.globals.seriesRangeName)?void 0:b[t])?void 0:c[e],v=null==(u=null==(g=p.config.series[t].data)?void 0:g[e])?void 0:u.x,y=Array.isArray(v)?v.join(" "):v,m=p.labelData.labels.map(t=>Array.isArray(t)?t.join(" "):t).indexOf(y),C=p.rangeData.seriesRange[t].findIndex(t=>{var e;return t.x===y&&(null==(e=t.overlaps)?void 0:e.size)>0});return this.isHorizontal?(s=p.config.plotOptions.bar.rangeBarGroupRows?i+l*m:i+o*this.visibleI+l*m,C>-1&&!p.config.plotOptions.bar.rangeBarOverlap&&(x=Array.from(p.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&&!p.labelData.timescaleLabels.length&&(a=p.config.plotOptions.bar.rangeBarGroupRows?r+h*m:r+n*this.visibleI+h*m),C>-1&&!p.config.plotOptions.bar.rangeBarOverlap&&(x=Array.from(p.rangeData.seriesRange[t][C].overlaps),x.indexOf(f)>-1&&(a=(n=d.barWidth/x.length)*this.visibleI+h*(100-parseInt(this.barOptions.barWidth,10))/100/2+n*(this.visibleI+x.indexOf(f))+h*m))),{barYPosition:s,barXPosition:a,barHeight:o,barWidth:n}}drawRangeColumnPaths({indexes:t,x:e,xDivision:s,barWidth:a,barXPosition:i,zeroH:r}){var o,n;const l=this.w,{i:h,j:d,realIndex:b,translationsIndex:c}=t,g=this.yRatio[c],u=this.getRangeValue(b,d);let p=Math.min(u.start,u.end),x=Math.max(u.start,u.end);const f=!(void 0===(null==(o=this.series[h])?void 0:o[d])||null===(null==(n=this.series[h])?void 0:n[d]));f?(p=r-p/g,x=r-x/g):p=r;const v=Math.abs(x-p),y=this.barHelpers.getColumnPaths({barXPosition:i,barWidth:a,y1:p,y2:x,strokeWidth:this.strokeWidth,series:this.seriesRangeEnd,realIndex:b,i:b,j:d,w:l});if(f){const t=y.drawnBox,e=u.end>=u.start;this.recordColumnGeometry(b,d,{slotStart:t.x1,slotEnd:t.x2,levelStart:e?t.y1:t.y2,levelEnd:e?t.y2:t.y1,horizontal:!1})}if(l.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:y.pathTo,pathFrom:y.pathFrom,barHeight:v,x:e,y:u.start<0&&u.end<0?p:x,goalY:this.barHelpers.getGoalValues("y",null,r,b,d,c),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:n}){const l=this.w,{realIndex:h,j:d}=t,b=this.preventBarOverflow(n+s/this.invertedYRatio),c=this.preventBarOverflow(n+a/this.invertedYRatio),g=this.getRangeValue(h,d),u=Math.abs(c-b),p=this.barHelpers.getBarpaths({barYPosition:o,barHeight:r,x1:b,x2:c,strokeWidth:this.strokeWidth,series:this.seriesRangeEnd,i:h,realIndex:h,j:d,w:l});if(null!=g.start&&null!=g.end){const t=p.drawnBox;this.recordColumnGeometry(h,d,{slotStart:t.y1,slotEnd:t.y2,levelStart:t.x1,levelEnd:t.x2,horizontal:!0})}return l.axisFlags.isXNumeric||(e+=i),{pathTo:p.pathTo,pathFrom:p.pathFrom,barWidth:u,x:g.start<0&&g.end<0?b:c,goalX:this.barHelpers.getGoalValues("x",n,null,h,d,0),y:e}}recordColumnGeometry(t,e,s){const a=this.w.waterfallData&&this.w.waterfallData.geometry;a&&isFinite(s.slotStart)&&isFinite(s.levelEnd)&&(a[t]||(a[t]=[]),a[t][e]=s)}getRangeValue(t,e){const s=this.w;return{start:s.rangeData.seriesRangeStart[t][e],end:s.rangeData.seriesRangeEnd[t][e]}}}}),t.default=d,Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|