apexcharts 8.2.0 → 8.3.1
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/README.md +7 -7
- package/dist/apexcharts.common.js +2 -2
- package/dist/apexcharts.core.js +19793 -19713
- package/dist/apexcharts.core.min.js +2 -2
- package/dist/apexcharts.css +38 -8
- package/dist/apexcharts.esm.js +1882 -1625
- package/dist/apexcharts.full.js +22044 -21634
- package/dist/apexcharts.full.min.js +2 -2
- package/dist/apexcharts.js +21414 -21124
- package/dist/apexcharts.min.js +2 -2
- package/dist/apexcharts.ssr.common.js +2 -2
- package/dist/apexcharts.ssr.esm.js +21413 -21123
- package/dist/area.common.js +2 -2
- package/dist/area.esm.js +91 -40
- package/dist/bar.common.js +2 -2
- package/dist/bar.esm.js +478 -406
- package/dist/bar.js +2 -2
- package/dist/boxPlot.common.js +2 -2
- package/dist/boxPlot.esm.js +409 -334
- package/dist/bubble.common.js +2 -2
- package/dist/bubble.esm.js +91 -40
- package/dist/candlestick.common.js +2 -2
- package/dist/candlestick.esm.js +409 -334
- package/dist/candlestick.js +2 -2
- package/dist/column.common.js +2 -2
- package/dist/column.esm.js +478 -406
- package/dist/core.common.js +2 -2
- package/dist/core.esm.js +19793 -19713
- package/dist/donut.common.js +2 -2
- package/dist/donut.esm.js +3 -9
- package/dist/dumbbell.common.js +2 -2
- package/dist/dumbbell.esm.js +478 -406
- package/dist/features/all.common.js +2 -2
- package/dist/features/all.esm.js +442 -324
- package/dist/features/annotations.common.js +2 -2
- package/dist/features/annotations.esm.js +65 -48
- package/dist/features/annotations.js +2 -2
- 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 +2 -2
- package/dist/features/drilldown.esm.js +4 -2
- package/dist/features/drilldown.js +2 -2
- 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 +10 -4
- 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/highlight-filter.common.js +2 -2
- package/dist/features/highlight-filter.esm.js +14 -9
- package/dist/features/highlight-filter.js +2 -2
- 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 +97 -145
- package/dist/features/keyboard.js +2 -2
- package/dist/features/legend.common.js +2 -2
- package/dist/features/legend.esm.js +64 -44
- package/dist/features/legend.js +2 -2
- package/dist/features/link.common.js +1 -1
- package/dist/features/link.esm.js +1 -1
- 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 +2 -2
- package/dist/features/morph.esm.js +9 -5
- package/dist/features/morph.js +2 -2
- package/dist/features/perspectives.common.js +2 -2
- package/dist/features/perspectives.esm.js +4 -1
- package/dist/features/perspectives.js +2 -2
- package/dist/features/raincloud.common.js +2 -2
- package/dist/features/raincloud.esm.js +26 -27
- package/dist/features/raincloud.js +2 -2
- package/dist/features/renderer-canvas.common.js +2 -2
- package/dist/features/renderer-canvas.esm.js +2 -1
- package/dist/features/renderer-canvas.js +2 -2
- package/dist/features/stats.common.js +2 -2
- package/dist/features/stats.esm.js +52 -59
- package/dist/features/stats.js +2 -2
- package/dist/features/storyboard.common.js +2 -2
- package/dist/features/storyboard.esm.js +4 -1
- package/dist/features/storyboard.js +2 -2
- package/dist/features/streamgraph.common.js +2 -2
- package/dist/features/streamgraph.esm.js +48 -14
- package/dist/features/streamgraph.js +2 -2
- package/dist/features/toolbar.common.js +2 -2
- package/dist/features/toolbar.esm.js +148 -18
- package/dist/features/toolbar.js +2 -2
- package/dist/features/trellis.common.js +2 -2
- package/dist/features/trellis.esm.js +150 -63
- package/dist/features/trellis.js +2 -2
- 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 +13 -12
- package/dist/features/weave.js +2 -2
- package/dist/full.common.js +2 -2
- package/dist/full.esm.js +1068 -842
- package/dist/heatmap.common.js +2 -2
- package/dist/heatmap.esm.js +3 -17
- package/dist/heatmap.js +2 -2
- package/dist/histogram.common.js +2 -2
- package/dist/histogram.esm.js +529 -464
- package/dist/icicle.common.js +2 -2
- package/dist/icicle.esm.js +80 -46
- package/dist/icicle.js +2 -2
- package/dist/line.common.js +2 -2
- package/dist/line.esm.js +91 -40
- package/dist/line.js +2 -2
- package/dist/locales/en.json +2 -1
- package/dist/locales/ro.json +3 -2
- 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 +2 -2
- package/dist/pie.esm.js +3 -9
- package/dist/pie.js +2 -2
- package/dist/polarArea.common.js +2 -2
- package/dist/polarArea.esm.js +3 -9
- package/dist/radar.common.js +2 -2
- package/dist/radar.esm.js +5 -4
- package/dist/radar.js +2 -2
- package/dist/radialBar.common.js +2 -2
- package/dist/radialBar.esm.js +5 -12
- package/dist/radialBar.js +2 -2
- package/dist/raincloud.common.js +2 -2
- package/dist/raincloud.esm.js +97 -52
- package/dist/rangeArea.common.js +2 -2
- package/dist/rangeArea.esm.js +91 -40
- package/dist/rangeBar.common.js +2 -2
- package/dist/rangeBar.esm.js +478 -406
- package/dist/scatter.common.js +2 -2
- package/dist/scatter.esm.js +91 -40
- package/dist/streamgraph.common.js +2 -2
- package/dist/streamgraph.esm.js +138 -53
- package/dist/sunburst.common.js +2 -2
- package/dist/sunburst.esm.js +116 -94
- package/dist/sunburst.js +2 -2
- package/dist/treemap.common.js +2 -2
- package/dist/treemap.esm.js +138 -104
- package/dist/treemap.js +2 -2
- 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 +2 -2
- package/dist/unit.esm.js +280 -202
- package/dist/unit.js +2 -2
- package/dist/violin.common.js +2 -2
- package/dist/violin.esm.js +72 -26
- package/dist/violin.js +2 -2
- package/dist/waterfall.common.js +2 -2
- package/dist/waterfall.esm.js +477 -405
- package/package.json +1 -1
- package/src/apexcharts.js +40 -59
- package/src/assets/apexcharts.css +38 -8
- package/src/charts/Bar.js +62 -55
- package/src/charts/BarStacked.js +80 -88
- package/src/charts/BoxCandleStick.js +28 -31
- package/src/charts/Icicle.js +68 -47
- package/src/charts/Line.js +118 -42
- package/src/charts/Pie.js +2 -8
- package/src/charts/Radar.js +5 -7
- package/src/charts/Radial.js +2 -6
- package/src/charts/RangeBar.js +47 -43
- package/src/charts/Sunburst.js +101 -98
- package/src/charts/Treemap.js +150 -88
- package/src/charts/Unit.js +368 -250
- package/src/charts/Violin.js +48 -30
- package/src/charts/common/Breadcrumb.js +2 -2
- package/src/charts/common/Hierarchy.js +32 -11
- package/src/charts/common/Jitter.js +32 -7
- package/src/charts/common/Stats.js +30 -23
- package/src/charts/common/bar/DataLabels.js +76 -81
- package/src/charts/common/bar/Helpers.js +43 -7
- package/src/charts/common/line/Helpers.js +12 -15
- package/src/charts/common/partition/NodeTooltip.js +29 -7
- package/src/charts/common/partition/Partition.js +33 -1
- package/src/charts/common/treemap/Helpers.js +3 -11
- package/src/charts/common/treemap/Nested.js +2 -3
- package/src/features/raincloud.js +16 -10
- package/src/features/stats.js +67 -62
- package/src/locales/en.json +2 -1
- package/src/locales/ro.json +3 -2
- package/src/modules/Animations.js +102 -95
- package/src/modules/AxisMapping.js +47 -12
- package/src/modules/Core.js +4 -0
- package/src/modules/CoreUtils.js +18 -42
- package/src/modules/Data.js +23 -24
- package/src/modules/DataLabels.js +6 -6
- package/src/modules/Exports.js +12 -5
- package/src/modules/Fill.js +17 -8
- package/src/modules/Filters.js +50 -50
- package/src/modules/Graphics.js +69 -51
- package/src/modules/Markers.js +3 -1
- package/src/modules/MorphTypeChange.js +13 -7
- package/src/modules/Range.js +44 -29
- package/src/modules/RendererController.js +17 -3
- package/src/modules/Scales.js +32 -9
- package/src/modules/Series.js +41 -19
- package/src/modules/Theme.js +1 -1
- package/src/modules/Toolbar.js +3 -2
- package/src/modules/UnitMarkRegistry.js +0 -5
- package/src/modules/ZoomPanSelection.js +123 -2
- package/src/modules/accessibility/KeyboardNavigation.js +114 -186
- package/src/modules/animations/Easing.js +2 -1
- package/src/modules/animations/LengthTransition.js +22 -2
- package/src/modules/annotations/Helpers.js +68 -52
- package/src/modules/axes/Grid.js +21 -7
- package/src/modules/axes/YAxis.js +8 -9
- package/src/modules/dimensions/Dimensions.js +9 -3
- package/src/modules/dimensions/Grid.js +2 -2
- package/src/modules/dimensions/XAxis.js +2 -5
- package/src/modules/drilldown/Breadcrumb.js +5 -2
- package/src/modules/helpers/Destroy.js +1 -1
- package/src/modules/helpers/UpdateHelpers.js +33 -15
- package/src/modules/highlightFilter/HighlightFilter.js +8 -9
- package/src/modules/highlightFilter/TreemapPart.js +2 -2
- package/src/modules/legend/HeatmapGradientLegend.js +76 -45
- package/src/modules/legend/Helpers.js +8 -1
- package/src/modules/legend/Legend.js +11 -12
- package/src/modules/license/LicenseEnforcer.js +5 -0
- package/src/modules/settings/Defaults.js +28 -56
- package/src/modules/settings/Globals.js +5 -0
- package/src/modules/settings/Options.js +7 -7
- package/src/modules/settings/TypeAliases.js +33 -16
- package/src/modules/streamgraph/StreamLabels.js +1 -0
- package/src/modules/tooltip/Labels.js +73 -76
- package/src/modules/tooltip/Marker.js +25 -21
- package/src/modules/tooltip/Position.js +88 -51
- package/src/modules/tooltip/Tooltip.js +242 -255
- package/src/modules/tooltip/Utils.js +71 -130
- package/src/modules/tooltip/constants.js +5 -5
- package/src/modules/trellis/Trellis.js +6 -0
- package/src/modules/trellis/TrellisChrome.js +18 -7
- package/src/modules/trellis/TrellisSync.js +2 -0
- package/src/modules/trellis/TrellisTooltip.js +2 -11
- package/src/modules/weave/WeaveHost.js +18 -12
- package/src/renderers/canvas/CanvasGraphics.js +1 -0
- package/src/ssr/DOMShim.js +10 -0
- package/src/svg/SVGFilter.js +26 -17
- package/src/types/internal.d.ts +9 -3
- package/src/utils/Utils.js +0 -14
- package/types/apexcharts.d.ts +33 -12
package/dist/treemap.common.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* ApexCharts v8.
|
|
2
|
+
* ApexCharts v8.3.1
|
|
3
3
|
* (c) 2018-2026 ApexCharts
|
|
4
4
|
*/
|
|
5
|
-
"use strict";var t=Object.defineProperty,e=Object.defineProperties,r=Object.getOwnPropertyDescriptors,a=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable,i=(e,r,a)=>r in e?t(e,r,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[r]=a,s=(t,e)=>{for(var r in e||(e={}))n.call(e,r)&&i(t,r,e[r]);if(a)for(var r of a(e))o.call(e,r)&&i(t,r,e[r]);return t},l=(t,a)=>e(t,r(a));Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});function h(t){if(t&&t.__esModule)return t;const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t)for(const r in t)if("default"!==r){const a=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,a.get?a:{enumerable:!0,get:()=>t[r]})}return e.default=t,Object.freeze(e)}const c=h(require("apexcharts/core"));function d(t,e,r,a){const n=a*a,o=r*r;return Math.max(n*e/o,o/(n*t))}function u(t,e,r,a,n,o){if(0===t)return!0;return d(e,r,a,o)>=d(Math.min(e,n),Math.max(r,n),a+n,o)}function p(t,e,r,a,n,o,i,s){if(i>=s){const i=a/s;let l=o;for(let a=0;a<r;a++){const r=e[a]/i;t.push([n,l,n+i,l+r]),l+=r}}else{const s=a/i;let l=n;for(let a=0;a<r;a++){const r=e[a]/s;t.push([l,o,l+r,o+s]),l+=r}}}function f(t){const e=t.children;if(e&&e.length){let r=0;for(let t=0;t<e.length;t++)r+=f(e[t]);return t._area=r,r}const r=Number(t.value),a=isNaN(r)?0:Math.abs(r);return t._area=a,a}function m(t,e,r,a,n,o,i,s){const l=t.length;if(0===l||a<=0||n<=0)return;const h=new Array(l);let c=0;for(let e=0;e<l;e++)h[e]=t[e]._area,c+=h[e];if(c<=0)return;const d=function(t,e,r,a,n){const o=[],i=t.length;if(0===i)return o;const s=new Array(i);let l=0,h=0,c=1/0,d=-1/0,f=0;for(;f<i;){const i=Math.min(a,n),m=t[f];if(u(l,c,d,h,m,i))s[l]=m,l++,h+=m,m<c&&(c=m),m>d&&(d=m),f++;else{if(p(o,s,l,h,e,r,a,n),a>=n){const t=h/n;e+=t,a-=t}else{const t=h/a;r+=t,n-=t}l=0,h=0,c=1/0,d=-1/0}}return l>0&&p(o,s,l,h,e,r,a,n),o}(function(t,e){let r=0;for(let e=0;e<t.length;e++)r+=t[e];const a=e/r,n=new Array(t.length);for(let e=0;e<t.length;e++)n[e]=t[e]*a;return n}(h,a*n),e,r,a,n);for(let e=0;e<l;e++){const r=t[e],a=d[e];if(!a)continue;r.rect=a,r.depth=o;const n=r.children;if(!n||!n.length)continue;const l=a[2]-a[0],h=a[3]-a[1];let c=Math.max(0,i(r,o,l,h)||0);(2*c>=l||2*c>=h)&&(c=0);let u=Math.max(0,s(r,o,l,h)||0);u>0&&h-2*c-u<u&&(u=0),r.headerHeight=u,m(n,a[0]+c,a[1]+u+c,l-2*c,h-u-2*c,o+1,i,s)}}const g={generateNested:function(t,e,r,a={}){if(!Array.isArray(t)||0===t.length)return t||[];const n=a.padding||(()=>0),o=a.header||(()=>0);for(let e=0;e<t.length;e++)f(t[e]);return m(t,0,0,e,r,0,n,o),t}},b=c.__apex_Graphics,x=c.__apex_Animations,y=c.__apex_Fill,w=c.__apex_Utils,v=c.__apex_DataLabels,_=(t,e,r,a)=>{if("function"!=typeof t)return t;const n=t({series:e.seriesData.series,seriesIndex:r,dataPointIndex:a,w:e});return Number.isFinite(n)?n:0};class A{constructor(t,e){this.ctx=e,this.w=t}checkColorRange(){const t=this.w;let e=!1;const r=t.config.plotOptions[t.config.chart.type];return r.colorScale.ranges.length>0&&r.colorScale.ranges.map(t=>{t.from<=0&&(e=!0)}),e}getShadeColor(t,e,r,a){const n=this.w;let o=1;const i=n.config.plotOptions[t].shadeIntensity,s=this.determineColor(t,e,r);n.globals.hasNegs||a?o=n.config.plotOptions[t].reverseNegativeShade?s.percent<0?s.percent/100*(1.25*i):(1-s.percent/100)*(1.25*i):s.percent<=0?1-(1+s.percent/100)*i:(1-s.percent/100)*i:(o=1-s.percent/100,"treemap"===t&&(o=(1-s.percent/100)*(1.25*i)));let l=s.color;const h=new w;if(n.config.plotOptions[t].enableShades)if("dark"===this.w.config.theme.mode){const t=h.shadeColor(-1*o,s.color);l=w.hexToRgba(w.isColorHex(t)?t:w.rgb2hex(t),n.config.fill.opacity)}else{const t=h.shadeColor(o,s.color);l=w.hexToRgba(w.isColorHex(t)?t:w.rgb2hex(t),n.config.fill.opacity)}return{color:l,colorProps:s}}determineColor(t,e,r){const a=this.w,n=a.seriesData.series[e][r],o=a.config.plotOptions[t];let i=o.colorScale.inverse?r:e;o.distributed&&"treemap"===a.config.chart.type&&(i=r);let s,l,h=a.globals.colors[i],c=null;if(o.distributed||"heatmap"!==t){const t=a.seriesData.series[e];s=t.length?t[0]:0,l=s;for(let e=1;e<t.length;e++)t[e]<s&&(s=t[e]),t[e]>l&&(l=t[e])}else s=a.globals.minY,l=a.globals.maxY;const d=o.colorScale.min,u=o.colorScale.max;void 0!==d&&void 0!==u&&u>d?(s=d,l=u):void 0!==d&&(s=d<a.globals.minY?d:a.globals.minY,l=u>a.globals.maxY?u:a.globals.maxY);const p=Math.abs(l)+Math.abs(s),f=Math.min(Math.max(n,s),l);let m=0===p?0:100*f/p;if(o.colorScale.ranges.length>0){o.colorScale.ranges.map(t=>{if(n>=t.from&&n<=t.to){h=t.color,c=t.foreColor?t.foreColor:null,s=t.from,l=t.to;const e=Math.abs(l)+Math.abs(s);m=0===e?0:100*n/e}})}return{color:h,foreColor:c,percent:m}}calculateDataLabels({text:t,x:e,y:r,i:a,j:n,colorProps:o,fontSize:i}){const s=this.w,l=s.config.dataLabels,h=new b(this.w),c=new v(this.w,this.ctx);let d=null;if(l.enabled){d=h.group({class:"apexcharts-data-labels"});const u=_(l.offsetX,s,a,n),p=_(l.offsetY,s,a,n),f=e+u,m=r+parseFloat(l.style.fontSize)/3+p;c.plotDataLabelsText({x:f,y:m,text:t,i:a,j:n,color:o.foreColor,parent:d,fontSize:i,dataLabelsConfig:l})}return d}}const S=c.__apex_Filters,C=c.__apex_Series,M=c.__apex_Environment_Environment;function E(t,e,r,a,n,o=null,i={}){var s,l,h;const c=e&&"object"==typeof e,d=c&&null!=(l=null!=(s=e.x)?s:e.name)?l:"",u=Number(c?null!=(h=e.y)?h:e.value:e),p={name:String(d),value:isNaN(u)?null:u,color:c&&e.color?e.color:void 0,_key:`${n}/${r}:${d}`};if(a&&!p.color&&(p.color=a[r%a.length]),i.keepDatum&&(p._datum=e),c&&Array.isArray(e.children)&&e.children.length)p.children=e.children.map((e,r)=>E(t,e,r,null,p._key,o,i));else if(c&&null!=e.drilldown&&!1!==i.expandDrilldown){const r=o||new Set;if(!r.has(e.drilldown)){const a=function(t,e){const r=t.config.drilldown;return(r&&Array.isArray(r.series)?r.series:[]).find(t=>t&&t.id===e)}(t,e.drilldown);if(a&&Array.isArray(a.data)&&a.data.length){const n=new Set(r);n.add(e.drilldown);const o=Array.isArray(a.colors)?a.colors:null;p.children=a.data.map((e,r)=>E(t,e,r,o,p._key,n,i))}}}return p}function k(t){t.children&&t.children.length&&(t.children.forEach(t=>k(t)),(null==t.value||isNaN(t.value))&&(t.value=t.children.reduce((t,e)=>t+Math.max(0,e.value||0),0))),(null==t.value||isNaN(t.value))&&(t.value=0)}function L(t){if("string"!=typeof t)return"";const e=t.indexOf("/");return-1===e?"":t.slice(e)}function N(t){const e=t.globals.treemapRoots;if(e&&e.length)return{roots:e,maxDepth:t.globals.treemapMaxDepth||1,nested:!0};const r=function(t,e,r={}){const a=e||t.config.series;return Array.isArray(a)?a.map((e,a)=>{var n,o;const i=e&&Array.isArray(e.data)?e.data:[],s=`${a}:${null!=(n=null==e?void 0:e.name)?n:""}`;return{name:String(null!=(o=null==e?void 0:e.name)?o:""),value:null,color:(null==e?void 0:e.color)||void 0,_key:s,_seriesIndex:a,children:i.map((e,a)=>E(t,e,a,null,s,null,r))}}):[]}(t,t.config.series,{keepDatum:!0,expandDrilldown:!1});r.forEach(k);const{maxDepth:a}=function(t){const e=[];let r=0;return t.forEach((t,a)=>{const n=[],o=(t,e,i)=>{t._parent=i,t._depth=e,t._si=a,t._leaf=!(t.children&&t.children.length),e>r&&(r=e),t._leaf?(t._di=n.length,n.push(t)):(t._di=-1,t.children.forEach(r=>o(r,e+1,t)))};o(t,0,null),e.push(n)}),{leaves:e,maxDepth:r}}(r);return{roots:r,maxDepth:a,nested:!1}}const F=c.__apex_BrowserAPIs_BrowserAPIs,P=c.__apex_Easing_resolveEasing;const T=["#cf4d3f","#8f9499","#26a75b"],$=(t,e,r)=>t+(e-t)*r;function O(t){return Math.max(0,Math.min(255,Math.round(t))).toString(16).padStart(2,"0")}function z(t,e,r){const a=w.parseHex(W(t)),n=w.parseHex(W(e));return a&&n?"#"+O($(a[0],n[0],r))+O($(a[1],n[1],r))+O($(a[2],n[2],r)):t}function W(t){if("string"!=typeof t)return"#000000";if(w.isColorHex(t))return t;return w.rgb2hex(t)||"#000000"}function R(t,e,r,a){var n,o,i;if(!e||"object"!=typeof e)return null;const s=null==(i=null==(o=null==(n=t.config.plotOptions)?void 0:n.treemap)?void 0:o.colorScale)?void 0:i.colorValue;let l;if(l="function"==typeof s?s(e,{seriesIndex:r,dataPointIndex:a,w:t}):"string"==typeof s?e[s]:e.colorValue,null==l)return null;const h=Number(l);return Number.isFinite(h)?h:null}function B(t){var e,r,a;const n=null==(a=null==(r=null==(e=t.config)?void 0:e.plotOptions)?void 0:r.treemap)?void 0:a.colorScale,o=n&&n.gradient;if(!o)return null;if(!1===o.enabled)return null;const i=t.config.series||[];let s=1/0,l=-1/0,h=!1;for(let e=0;e<i.length;e++){const r=i[e]&&i[e].data;if(Array.isArray(r))for(let a=0;a<r.length;a++){const n=R(t,r[a],e,a);null!=n&&(h=!0,n<s&&(s=n),n>l&&(l=n))}}if(!h&&!0!==o.enabled)return null;Number.isFinite(s)||(s=0,l=0);let c=Number.isFinite(Number(o.min))?Number(o.min):s,d=Number.isFinite(Number(o.max))?Number(o.max):l,u=null;if(null===o.midpoint?u=null:Number.isFinite(Number(o.midpoint))?u=Number(o.midpoint):c<0&&d>0&&(u=0),null!=u&&!1!==o.symmetric&&!Number.isFinite(Number(o.min))&&!Number.isFinite(Number(o.max))){const t=Math.max(Math.abs(c-u),Math.abs(d-u));c=u-t,d=u+t}d===c&&(c-=.5,d+=.5);const p=function(t,e,r,a){if(Array.isArray(t.stops)&&t.stops.length>=2)return t.stops.filter(t=>t&&Number.isFinite(Number(t.value))).map(t=>({value:Number(t.value),color:W(t.color)})).sort((t,e)=>t.value-e.value);const n=(Array.isArray(t.colors)&&t.colors.length>=2?t.colors:T).map(W),o=n.length;if(null!=a&&o>=3){const t=Math.floor((o-1)/2),i=[];for(let r=0;r<=t;r++)i.push({value:$(e,a,r/t),color:n[r]});for(let e=t+1;e<o;e++)i.push({value:$(a,r,(e-t)/(o-1-t)),color:n[e]});return i}return n.map((t,a)=>({value:$(e,r,a/(o-1)),color:t}))}(o,c,d,u);if(p.length<2)return null;const f=d-c,m=p.map(t=>({percent:0===f?0:(t.value-c)/f,color:t.color}));return{min:c,max:d,midpoint:u,stops:p,at:t=>{if(!Number.isFinite(t))return p[Math.floor(p.length/2)].color;if(t<=p[0].value)return p[0].color;const e=p[p.length-1];if(t>=e.value)return e.color;for(let e=1;e<p.length;e++){const r=p[e];if(t<=r.value){const a=p[e-1],n=r.value-a.value,o=0===n?0:(t-a.value)/n;return z(a.color,r.color,o)}}return e.color},legendStops:m}}function I(t){const e=W(t);return w.getContrastRatio(e,"#ffffff")>=w.getContrastRatio(e,"#000000")?"#ffffff":"#000000"}const D="http://www.w3.org/1999/xhtml";function q(t,e){const r=t.config.drilldown&&t.config.drilldown.breadcrumb||{};return s(s({show:!0,position:"top-left",separator:" / ",rootLabel:"All",offsetX:0,offsetY:0,formatter:void 0},r),e||{})}function j(t){const e=t.dom.elWrap;if(!e)return;const r=e.querySelector(".apexcharts-breadcrumb");r&&r.parentNode&&r.parentNode.removeChild(r)}const H=t=>"string"==typeof t&&/^(#|rgb)/i.test(t);function Y(t,e,r,a){return H(r)&&H(a)&&r!==a?[l(s({},t),{fill:r}),l(s({},e),{fill:a})]:[t,e]}const K=t=>C.treemapHeaderLook(t);c.default.use({treemap:class{constructor(t,e){this.ctx=e,this.w=t,this.strokeWidth=this.w.config.stroke.width,this.helpers=new A(t,e),this.dynamicAnim=this.w.config.chart.animations.dynamicAnimation,this.labels=[],this.roots=[],this.drawn=[],this.nested=!1,this.showParents=!1,this.scale=null,this._levelCache=null,this._total=null,this._avgLabelSize=null,this._tooltipEl=null,this._morphLeafIndex=0,this.camera=null}draw(){var t,e;const r=this.w,a=new b(this.w,this.ctx),n=new y(this.w),o=a.group({class:"apexcharts-treemap"});if(r.globals.noData)return o;this.negRange=this.helpers.checkColorRange(),r.config.series.forEach((t,e)=>{Array.isArray(this.labels[e])||(this.labels[e]=[]),t.data.forEach(t=>{this.labels[e].push(t.x)})});const i=N(r);this.nested=i.nested,this.roots=i.roots,this.scale=B(r);const l=1===i.roots.length?i.roots[0].children||[]:i.roots;this.drawn=l;const h=r.config.plotOptions.treemap.parents;this.showParents=!0===h.show||!1!==h.show&&this.nested;const c=this._resolveFocus(l),d=c?[c]:l;g.generateNested(d,r.layout.gridWidth,r.layout.gridHeight,{padding:(t,e,r,a)=>this.showParents?this._levelPadding(e,r,a):0,header:(t,e,r,a)=>this.showParents?this._levelHeader(t,e,r,a):0}),this.camera=this._zoomCamera();const u=null==(t=this.ctx.highlightFilter)?void 0:t.treemap(this),p=null==(e=this.ctx)?void 0:e.morphTypeChange,f=!!p&&"function"==typeof p.isActive&&p.isActive()&&"function"==typeof p.getInitialPathAt;this._morphLeafIndex=0;const m=this._leavesBySeries(d,r.config.series.length),x=this.showParents?this._parentsBySeries(d,r.config.series.length):[];return m.forEach((t,e)=>{var i;const l=a.group({class:"apexcharts-series apexcharts-treemap-series",seriesName:w.escapeString(r.seriesData.seriesNames[e]),rel:e+1,"data:realIndex":e});if(C.addCollapsedClassToSeries(this.w,l,e),a.setupEventDelegation(l,".apexcharts-treemap-rect"),r.config.chart.dropShadow.enabled){const t=r.config.chart.dropShadow;new S(this.w).dropShadow(o,t,e)}const h=a.group({class:"apexcharts-data-labels"}),c={xMin:1/0,yMin:1/0,xMax:-1/0,yMax:-1/0},d={xMin:1/0,yMin:1/0};this.showParents&&(x[e]||[]).forEach(t=>{this._drawParent(l,t,e)});const p=r.config.chart.animations,m=p.animateGradually,g=m&&!1!==m.enabled,b=new Array(t.length).fill(0);if(g){const e=t.length||1,r=Math.min(m.delay||0,.5*p.speed/e);t.map((t,e)=>{return{j:e,area:t.rect?(r=t.rect,(r[2]-r[0])*(r[3]-r[1])):0};var r}).sort((t,e)=>e.area-t.area).forEach((t,e)=>{b[t.j]=e*r})}t.forEach((t,o)=>{var i;const h=t.rect;if(!h)return;const p=t._di,m=h[0],g=h[1],x=h[2],y=h[3];x>m&&y>g&&(c.xMin=Math.min(c.xMin,m),c.yMin=Math.min(c.yMin,g),c.xMax=Math.max(c.xMax,x),c.yMax=Math.max(c.yMax,y));const w=this._leafColor(e,p),v=w.color;let _=n.fillPath({color:v,seriesNumber:e,dataPointIndex:p});const A=f?this._morphSourceForLeaf(t):null,S=A?a.drawPath({d:this._tilePath(m,g,x,y),fill:"#fff",stroke:r.config.plotOptions.treemap.useFillColorAsStroke?v:r.globals.stroke.colors[e],strokeWidth:this.strokeWidth,fillOpacity:1}):a.drawRect(m,g,x-m,y-g,r.config.plotOptions.treemap.borderRadius,"#fff",1,this.strokeWidth,r.config.plotOptions.treemap.useFillColorAsStroke?v:r.globals.stroke.colors[e]);_=(null==u?void 0:u(S,e,p,_,t))||_,S.attr({cx:m,cy:g,index:e,i:e,j:p,width:x-m,height:y-g,fill:_}),S.node.classList.add("apexcharts-treemap-rect"),S.node.setAttribute("data:key",L(t._key));let M={x:m+(x-m)/2,y:g+(y-g)/2,width:0,height:0};const E={x:m,y:g,width:x-m,height:y-g};A?this._morphTile(S,A,this._tilePath(m,g,x,y),this.ctx.morphTypeChange.getSpeed(),e,p):r.config.chart.animations.enabled&&!r.globals.dataChanged&&(r.globals.resized?r.globals.animationEnded=!0:this.animateTreemap(S,M,E,r.config.chart.animations.speed,b[o]||0));let k=null,N=null,F=null;if(r.globals.dataChanged){let t=1;if(this.dynamicAnim.enabled&&r.globals.shouldAnimate){t=this.dynamicAnim.speed;const a=null==(i=r.globals.previousPaths[e])?void 0:i[p],n=s({},E);if(!(null==a?void 0:a.rect)&&this.camera&&(M=this.camera.back(E),N={x:M.x+M.width/2,y:M.y+M.height/2}),null==a?void 0:a.rect){M=s({},a.rect),M.width>0&&M.height>0&&(d.xMin=Math.min(d.xMin,M.x),d.yMin=Math.min(d.yMin,M.y),N={x:M.x+M.width/2,y:M.y+M.height/2},F="string"==typeof a.label?a.label:null,a.labelFading&&this.camera&&(F=""));const t=t=>"string"==typeof t&&/^(#|rgb)/i.test(t);t(a.fill)&&t(_)&&a.fill!==_&&(M.fill=a.fill,n.fill=_)}k=this.animateTreemap(S,M,n,t)}}let P=this.getFontSize(h);"truncate"===r.config.plotOptions.treemap.dataLabels.format&&(P=parseInt(String(r.config.dataLabels.style.fontSize),10));let T=null;if(r.config.dataLabels.enabled&&this._labelCanShow(P,x-m,y-g)){let a=r.config.dataLabels.formatter(this.labels[e][p],{value:r.seriesData.series[e][p],seriesIndex:e,dataPointIndex:p,w:r,highlight:t.highlight});"truncate"===r.config.plotOptions.treemap.dataLabels.format&&(a=this.truncateLabels(String(a),P,m,g,x,y)),r.seriesData.series[e][p]&&(T=this.helpers.calculateDataLabels({text:a,x:(m+x)/2,y:(g+y)/2+this.strokeWidth/2+P/3,i:e,j:p,colorProps:w,fontSize:P})),r.config.dataLabels.enabled&&T&&this.rotateToFitLabel(T,P,a,m,g,x,y)}if(l.add(S),null!==T&&(T.node.setAttribute("data:key",L(t._key)),l.add(T),k)){const t=!N||""===F||!!this.camera&&null!==F&&F!==C.treemapLabelLook(T.node);this._rideTile(T.node,N,m,g,x,y,k,t)}});const y=r.config.plotOptions.treemap.seriesTitle;if(!this.showParents&&r.config.series.length>1&&y&&y.show){const t=r.config.series[e].name||"";if(t&&c.xMin<1/0&&c.yMin<1/0){const{offsetX:e,offsetY:n,borderColor:o,borderWidth:s,borderRadius:h,style:u}=y,p=u.color||r.config.chart.foreColor,f={left:u.padding.left,right:u.padding.right,top:u.padding.top,bottom:u.padding.bottom},m=a.getTextRects(t,u.fontSize,u.fontFamily),g=m.width+f.left+f.right,b=m.height+f.top+f.bottom,x=c.xMin+(e||0),w=c.yMin+(n||0),v=a.drawRect(x,w,g,b,h,u.background,1,s,o),_=x+f.left,A=w+f.top+.75*(null!=(i=null==m?void 0:m.height)?i:0),S=a.drawText({x:_,y:A,text:t,fontSize:u.fontSize,fontFamily:u.fontFamily,fontWeight:u.fontWeight,foreColor:p,cssClass:u.cssClass||""}),C=d.xMin-c.xMin,M=d.yMin-c.yMin;if(Number.isFinite(C)&&Number.isFinite(M)&&(C||M)){const t=this.dynamicAnim.speed;this.animateTreemap(v,{x:x+C,y:w+M},{x:x,y:w},t),this.animateTreemap(S,{x:_+C,y:A+M},{x:_,y:A},t)}l.add(v),l.add(S)}}l.add(h),o.add(l)}),this.camera&&this._playZoomExit(o),this._renderBreadcrumb(),o}_levelCfg(t){if(this._levelCache||(this._levelCache=[]),this._levelCache[t])return this._levelCache[t];const e=this.w.config.plotOptions.treemap,r=e.parents||{},a=(e.levels||[])[t]||{},n=l(s(s({},r),a),{header:l(s(s({},r.header||{}),a.header||{}),{style:s(s({},(r.header||{}).style||{}),(a.header||{}).style||{})}),hover:s(s({},r.hover||{}),a.hover||{})});return this._levelCache[t]=n,n}_levelPadding(t,e,r){const a=this._levelCfg(t);return Number(a.padding)||0}_levelHeader(t,e,r,a){const n=this._levelCfg(e).header||{};if(!1===n.show)return 0;const o=Number(n.height);if(!Number.isFinite(o)||o<=0)return 0;return r<(Number(n.minWidth)||40)||a<2*o?0:o}_leavesBySeries(t,e){const r=new Array(Math.max(1,e));for(let t=0;t<r.length;t++)r[t]=[];const a=t=>{if(t.children&&t.children.length)t.children.forEach(a);else{const e=t._si||0;r[e]&&r[e].push(t)}};return t.forEach(a),r}_parentsBySeries(t,e){const r=new Array(Math.max(1,e));for(let t=0;t<r.length;t++)r[t]=[];const a=t=>{if(!t.children||!t.children.length)return;const e=t._si||0;r[e]&&r[e].push(t),t.children.forEach(a)};return t.forEach(a),r.forEach(t=>t.sort((t,e)=>(t.depth||0)-(e.depth||0))),r}_leafColor(t,e){const r=this.w;if(this.scale){const a=function(t,e,r){const a=t.config.series[e];return R(t,a&&Array.isArray(a.data)?a.data[r]:null,e,r)}(r,t,e);if(null!=a){const t=this.scale.at(a);return{color:t,foreColor:I(t),colorProps:{color:t,foreColor:I(t),percent:0}}}}return this.helpers.getShadeColor(r.config.chart.type,t,e,this.negRange)}_parentChrome(t){const e=this.w,r=this._levelCfg(t),a="dark"===e.config.theme.mode,n=(r.header||{}).style||{},o=Math.min(t,3),i=a?255:0,s=`${i},${i},${i}`;return{fill:r.fill||`rgba(${s},${(a?.04:.03)+.02*o})`,fillOpacity:null==r.fillOpacity?1:r.fillOpacity,borderColor:r.borderColor||`rgba(${s},${a?.18:.14})`,borderWidth:null==r.borderWidth?1:r.borderWidth,borderRadius:null==r.borderRadius?e.config.plotOptions.treemap.borderRadius:r.borderRadius,headerBg:n.background||`rgba(${s},${a?.1:.07})`,headerColor:n.color||(a?"#e8e8e8":e.config.chart.foreColor),headerFontSize:n.fontSize||"12px",headerFontFamily:n.fontFamily||e.config.chart.fontFamily,headerFontWeight:null==n.fontWeight?600:n.fontWeight,hoverColor:r.hover&&r.hover.color||(a?"rgba(255,255,255,0.85)":"rgba(0,0,0,0.7)"),hoverWidth:r.hover&&r.hover.width||2,hoverShow:!(r.hover&&!1===r.hover.show)}}_drawParent(t,e,r){var a,n,o,i;const s=e.rect;if(!s)return;const l=this.w,h=new b(this.w,this.ctx),c=e.depth||0,d=this._levelCfg(c),u=this._parentChrome(c),p=s[0],f=s[1],m=s[2]-s[0],g=s[3]-s[1];if(m<=0||g<=0)return;const y=h.group({class:"apexcharts-treemap-parent","data:depth":c,"data:name":w.escapeString(e.name)}),v=L(e._key),_=this._morphKeyed()?this.ctx.morphTypeChange.getInitialPathForKey(v):null,A=_?h.drawPath({d:this._tilePath(p,f,p+m,f+g),fill:u.fill,stroke:u.borderColor,strokeWidth:u.borderWidth,fillOpacity:u.fillOpacity}):h.drawRect(p,f,m,g,u.borderRadius,u.fill,u.fillOpacity,u.borderWidth,u.borderColor);A.node.classList.add("apexcharts-treemap-parent-rect"),A.node.setAttribute("data:key",v),A.node.setAttribute("data:depth",String(c)),_&&this._morphTile(A,_,this._tilePath(p,f,p+m,f+g),this.ctx.morphTypeChange.getSpeed(),r,c);let S=null,C=null,M=!1;const E=l.config.chart.animations.dynamicAnimation;if(!_&&l.globals.dataChanged&&E.enabled&&l.globals.shouldAnimate){const t=E.speed;if(S=null!=(n=null==(a=l.globals.prevTreemapParents)?void 0:a.get(`${r}|${v}`))?n:null,!S&&this.camera){S=this.camera.back({x:p,y:f,width:m,height:g}),M=!0;const e=l.layout;S.x<e.gridWidth&&S.y<e.gridHeight&&S.x+S.width>0&&S.y+S.height>0&&y.attr({opacity:0}).animate(t).attr({opacity:1})}S?C=new x(l).animateRect(A,...Y({x:S.x,y:S.y,width:S.width,height:S.height},{x:p,y:f,width:m,height:g},S.fill,A.node.getAttribute("fill")),t,()=>{}):y.attr({opacity:0}).animate(t).attr({opacity:1})}y.add(A);const k=e.headerHeight||0;let N="";if(k>0){const t=d.header||{},a=h.drawRect(p,f,m,k,0,u.headerBg,1,0,"transparent");if(a.node.classList.add("apexcharts-treemap-parent-header"),y.add(a),S){const t=S.header,e={x:p,y:f,width:m,height:k};new x(l).animateRect(a,...Y(t?{x:t.x,y:t.y,width:t.width,height:t.height}:M&&this.camera?this.camera.back(e):{x:S.x,y:S.y,width:S.width,height:0},e,null==t?void 0:t.fill,a.node.getAttribute("fill")),l.config.chart.animations.dynamicAnimation.speed,()=>{})}let n=String(null!=(o=e.name)?o:"");"function"==typeof t.formatter?n=String(t.formatter(e.name,{value:e.value,depth:c,seriesIndex:r,node:e,w:l})):t.showValue&&(n=`${n} ${this._formatValue(e.value)}`),N=n;const s=Number(t.offsetX)||0,b=t.align||"left",w=6,v=Math.max(0,m-2*w-Math.abs(s)),_=parseFloat(String(u.headerFontSize))||12,E=h.getTextBasedOnMaxWidth({text:n,maxWidth:v,fontSize:_});if(E){let e=p+w+s,r="start";"center"===b?(e=p+m/2+s,r="middle"):"right"===b&&(e=p+m-w+s,r="end");const a=h.drawText({x:e,y:f+k/2+_/3+(Number(t.offsetY)||0),text:E,textAnchor:r,fontSize:u.headerFontSize,fontFamily:u.headerFontFamily,fontWeight:u.headerFontWeight,foreColor:u.headerColor,cssClass:`apexcharts-treemap-parent-label ${t.style&&t.style.cssClass||""}`});if(a.node.setAttribute("pointer-events","none"),y.add(a),C&&S){const t=t=>"center"===b?t.x+t.width/2:"right"===b?t.x+t.width:t.x,e={x:t(S)-t({x:p,width:m})+(p+m/2),y:S.y-f+(f+g/2)},r=!!this.camera&&!M&&(null==(i=S.header)?void 0:i.look)!==K(a.node);this._rideTile(a.node,e,p,f,p+m,f+g,C,r)}}this._attachParentEvents(a.node,e,u,A),this._makeParentAccessible(a.node,e,u,A,N)}this._attachParentEvents(A.node,e,u,A),y.node.setAttribute("role","group"),y.node.setAttribute("aria-label",this._parentLabel(e,N)),t.add(y)}_parentLabel(t,e){const r=this._drawnTotal(),a=r>0?(t._area/r*100).toFixed(1):"0",n=this._countLeaves(t);return`${e&&String(e).trim()?String(e).replace(/\s+/g," ").trim():`${t.name}, ${this._formatValue(t._area)}`}, ${n} ${1===n?"item":"items"}, ${a}% of total`}_makeParentAccessible(t,e,r,a,n){t&&t.setAttribute&&this._zoomEnabled()&&(t.setAttribute("role","button"),t.setAttribute("tabindex","0"),t.setAttribute("aria-label",`${this._parentLabel(e,n)}. Zoom in`),t.setAttribute("aria-expanded","false"),M.isBrowser()&&t.addEventListener&&(t.addEventListener("focus",()=>{a.node.setAttribute("stroke",r.hoverColor),a.node.setAttribute("stroke-width",String(r.hoverWidth+1))}),t.addEventListener("blur",()=>{a.node.setAttribute("stroke",r.borderColor),a.node.setAttribute("stroke-width",String(r.borderWidth))}),t.addEventListener("keydown",t=>{"Enter"!==t.key&&" "!==t.key&&"Spacebar"!==t.key||(t.preventDefault(),this._zoomTo(e,!0))})))}_attachParentEvents(t,e,r,a){if(!M.isBrowser()||!t||!t.addEventListener)return;const n=this.w;r.hoverShow&&(t.addEventListener("mouseenter",()=>{a.node.setAttribute("stroke",r.hoverColor),a.node.setAttribute("stroke-width",String(r.hoverWidth))}),t.addEventListener("mouseleave",()=>{a.node.setAttribute("stroke",r.borderColor),a.node.setAttribute("stroke-width",String(r.borderWidth))})),n.config.tooltip.enabled&&(t.addEventListener("mouseenter",t=>this._showParentTooltip(t,e)),t.addEventListener("mousemove",t=>this._positionTooltip(t)),t.addEventListener("mouseleave",()=>this._hideParentTooltip())),this._zoomEnabled()&&(t.style.cursor="pointer",t.addEventListener("click",()=>this._zoomTo(e)))}_zoomEnabled(){const t=this.w,e=t.config.plotOptions.treemap.zoom;if(!e||!e.enabled||!this.showParents)return!1;const r=t.config.drilldown;return!(this.ctx.drilldown&&r&&r.enabled&&Array.isArray(r.series)&&r.series.length)||(this._warnedZoomConflict||(this._warnedZoomConflict=!0,console.warn("ApexCharts treemap: `plotOptions.treemap.zoom` and the drilldown feature both navigate the hierarchy, so zoom is ignored here. Drop `drilldown.series` to zoom a nested treemap instead.")),!1)}_resolveFocus(t){const e=this.w.globals.treemapFocusKey;if(!e||!this._zoomEnabled())return null;let r=null;const a=t=>{r||(t._key!==e?t.children&&t.children.forEach(a):r=t)};return t.forEach(a),r&&r.children&&r.children.length?r:null}_zoomTo(t,e=!1){const r=this.w;if(!t||!t.children||!t.children.length)return;const a=r.globals.treemapFocusKey===t._key?null:t._key,n=this._refocus(a);e&&n&&"function"==typeof n.then&&n.then(()=>{if(!M.isBrowser())return;const t=r.dom.baseEl.querySelector(".apexcharts-breadcrumb .apexcharts-breadcrumb-item");if(t&&t.focus)return void t.focus();const e=r.dom.baseEl.querySelector(".apexcharts-treemap-parent-header[tabindex]");e&&e.focus&&e.focus()})}_refocus(t){var e;const r=this.w,a=r.globals,n=r.config.chart.animations,o=!(!n.enabled||!n.dynamicAnimation.enabled);return a.treemapZoom=o&&M.isBrowser()?{from:null!=(e=a.treemapFocusKey)?e:null,to:t}:null,a.treemapFocusKey=t,this._hideParentTooltip(),a.shouldAnimate=o,a.resized=!0,a.dataChanged=!0,a.treemapZoom&&this.ctx.series.getPreviousPaths(),this.ctx.update()}_zoomCamera(){var t;const e=this.w,r=e.globals.treemapZoom;e.globals.treemapZoom=null;const a=e.globals.prevTreemapParents;if(!(r&&a&&e.globals.dataChanged&&e.globals.shouldAnimate))return null;const n=new Map,o=t=>{n.set(t._key,t),t.children&&t.children.forEach(o)};this.drawn.forEach(o);const i=(t,e)=>{for(let r=n.get(t);r;r=r._parent)if(r._key===e)return!0;return!1},{from:s,to:l}=r,h=l&&(null==s||i(l,s))?l:s&&(null==l||i(s,l))?s:null,c=h?n.get(h):null;if(!h||!c||!c.rect)return null;let d=c;for(;d._parent;)d=d._parent;const u=Math.max(0,this.roots.indexOf(d)),p=null!=(t=a.get(`${u}|${L(h)}`))?t:null,f=c.rect,m=f[0],g=f[1],b=f[2]-f[0],x=f[3]-f[1];if(!p||!(p.width>0&&p.height>0&&b>0&&x>0))return null;const y=p,w=b/y.width,v=x/y.height;return{fwd:t=>({x:m+(t.x-y.x)*w,y:g+(t.y-y.y)*v,width:t.width*w,height:t.height*v}),back:t=>({x:y.x+(t.x-m)/w,y:y.y+(t.y-g)/v,width:t.width/w,height:t.height/v})}}_playZoomExit(t){const e=this.w,r=this.camera,a=e.globals.prevTreemapView;if(e.globals.prevTreemapView=null,!r||!M.isBrowser())return;const n=t.node,o=new b(this.w,this.ctx),i=[["apexcharts-treemap-rect","T"],["apexcharts-treemap-parent-rect","P"],["apexcharts-data-labels","L"]],s=t=>{var e;const r=i.find(([e])=>t.classList.contains(e)),a=null==(e=t.closest(".apexcharts-series"))?void 0:e.getAttribute("data:realIndex");return r?`${r[1]}${a}|${t.getAttribute("data:key")}`:""},l=(t,e)=>{var r;return parseFloat(null!=(r=t.getAttribute(e))?r:"")},h=t=>({x:l(t,"x"),y:l(t,"y"),width:l(t,"width"),height:l(t,"height")}),c=t=>({x:t.x+t.width/2,y:t.y+t.height/2}),d=new Map;n.querySelectorAll("[data\\:key]").forEach(t=>{const e=s(t);e&&d.set(e,t)});const u=[],p=(t,e)=>{const r=h(t);[r.x,r.y,r.width,r.height].every(Number.isFinite)&&u.push(a=>{t.setAttribute("x",String(r.x+(e.x-r.x)*a)),t.setAttribute("y",String(r.y+(e.y-r.y)*a)),t.setAttribute("width",String(r.width+(e.width-r.width)*a)),t.setAttribute("height",String(r.height+(e.height-r.height)*a))})},f=(t,e,r=!1)=>{var a;const n=t.getAttribute("transform")||"",o=parseFloat(null!=(a=t.getAttribute("opacity"))?a:"1"),i=Number.isFinite(o)?o:1;u.push(a=>{t.setAttribute("transform",`translate(${e.x*a} ${e.y*a}) ${n}`.trim()),r&&t.setAttribute("opacity",String(i*(1-a)))})},m=t=>{[t,...t.querySelectorAll("*")].forEach(t=>{t.removeAttribute("data:key"),["role","tabindex","aria-label","aria-expanded"].forEach(e=>t.removeAttribute(e)),t.classList.remove("apexcharts-treemap-rect","apexcharts-treemap-parent","apexcharts-treemap-parent-rect","apexcharts-treemap-parent-header","apexcharts-treemap-parent-label","apexcharts-data-labels")})},g=o.group({class:"apexcharts-treemap-ghosts"}).node,x=o.group({class:"apexcharts-treemap-ghosts"}).node;if(a){const t=[...a.querySelectorAll(":scope > .apexcharts-treemap-ghosts")];t.forEach((e,a)=>{e.querySelectorAll("rect").forEach(t=>p(t,r.fwd(h(t)))),e.querySelectorAll("text").forEach(t=>{const e=t=>{const e=/^translate\(\s*([-+.\deE]+)[\s,]+([-+.\deE]+)\s*\)/.exec(((null==t?void 0:t.getAttribute("transform"))||"").trim());return e?[parseFloat(e[1]),parseFloat(e[2])]:[0,0]},[a,n]=e(t.parentElement),[o,i]=e(t),s={x:l(t,"x")+a+o,y:l(t,"y")+n+i,width:0,height:0};if(!Number.isFinite(s.x)||!Number.isFinite(s.y))return;const h=r.fwd(s);f(t,{x:h.x-s.x,y:h.y-s.y})}),[...e.childNodes].forEach(e=>(a===t.length-1&&t.length>1?x:g).appendChild(e)),e.remove()});const n=new Map;a.querySelectorAll(".apexcharts-treemap-rect[data\\:key]").forEach(t=>n.set(s(t),t)),a.querySelectorAll(".apexcharts-data-labels[data\\:key]").forEach(t=>{const e=s(t),a=d.get(e);if(a&&!(t=>{var e;return parseFloat(null!=(e=t.getAttribute("opacity"))?e:"1")<.999})(t)&&C.treemapLabelLook(a)===C.treemapLabelLook(t))return;const o=n.get(`T${e.slice(1)}`);if(!o)return;const i=c(h(o)),l=d.get(`T${e.slice(1)}`),u=c(l?h(l):r.fwd(h(o)));f(t,{x:u.x-i.x,y:u.y-i.y},!!l),m(t),x.appendChild(t)}),a.querySelectorAll(".apexcharts-treemap-parent").forEach(t=>{var a;const n=t.querySelector(".apexcharts-treemap-parent-rect[data\\:key]");if(!n||"rect"!==n.tagName.toLowerCase())return;const o=d.get(s(n));if(o){const e=t.querySelector(".apexcharts-treemap-parent-label"),r=null==(a=o.parentElement)?void 0:a.querySelector(".apexcharts-treemap-parent-label");if(e&&K(e)!==K(r)){const t=h(n),r=h(o),a=e.getAttribute("text-anchor"),i=t=>"middle"===a?t.x+t.width/2:"end"===a?t.x+t.width:t.x;f(e,{x:i(r)-i(t),y:r.y-t.y},!0),m(e),x.appendChild(e)}return}t.querySelectorAll("rect").forEach(t=>p(t,r.fwd(h(t)))),t.querySelectorAll("text").forEach(t=>{const e={x:l(t,"x"),y:l(t,"y"),width:0,height:0};if(!Number.isFinite(e.x)||!Number.isFinite(e.y))return;const a=r.fwd(e);f(t,{x:a.x-e.x,y:a.y-e.y})});const i=r.fwd(h(n)),c=e.layout;i.x<c.gridWidth&&i.y<c.gridHeight&&i.x+i.width>0&&i.y+i.height>0&&u.push(e=>t.setAttribute("opacity",String(1-e))),m(t),g.appendChild(t)}),n.forEach((t,e)=>{d.has(e)||"rect"!==t.tagName.toLowerCase()||(p(t,r.fwd(h(t))),m(t),g.appendChild(t))});const o=a.querySelector(":scope > defs.apexcharts-treemap-ghost-defs");o&&g.insertBefore(o,g.firstChild)}[g,x].forEach(t=>{t.setAttribute("pointer-events","none"),t.setAttribute("aria-hidden","true")}),n.insertBefore(g,n.firstChild),n.appendChild(x),n.setAttribute("clip-path",`url(#gridRectMask${e.globals.cuid})`),function(t,e,r,a,n){const o=performance.now(),i=s=>{if(t.globals.isDestroyed)return;const l=Math.max(0,Math.min(1,(s-o)/e));a(r(l),l),l<1?F.requestAnimationFrame(i):n&&n()};F.requestAnimationFrame(i)}(e,Math.max(1,this.dynamicAnim.speed||1),P(e.config.chart.animations.easing),t=>u.forEach(e=>e(t)),()=>{g.remove(),x.remove(),n.removeAttribute("clip-path")})}_focusChain(){const t=[],e=new Set(this.drawn||[]);let r=this._resolveFocus(this.drawn||[]);for(;r&&(t.unshift(r),!e.has(r));)r=r._parent;return t}_breadcrumbCfg(){const t=this.w.config.plotOptions.treemap.zoom;return q(this.w,t&&t.breadcrumb)}_renderBreadcrumb(){if(!M.isBrowser())return;const t=this.w;if(!t.dom.elWrap)return;if(j(t),!this._zoomEnabled())return;const e=this._focusChain();if(!e.length)return;const r=function(t,e){if(!M.isBrowser())return null;const r=t.dom.elWrap;if(!r)return null;j(t);const a=e.config||q(t);if(!1===a.show)return null;const n=e.crumbs||[];if(n.length<2)return null;const o=F.createElementNS(D,"nav");o.setAttribute("class","apexcharts-breadcrumb"),o.setAttribute("aria-label",e.ariaLabel||"Breadcrumb"),function(t,e){const r=e.offsetX||0,a=e.offsetY||0;t.style.position="absolute",t.style.top=a+"px","top-right"===e.position?t.style.right=3-r+"px":t.style.left=r+"px"}(o,a),e.compact&&(o.style.fontSize="11px",o.style.padding="0 2px");const i=null!=a.separator?a.separator:" / ";return n.forEach((t,r)=>{var s;if(r>0){const t=F.createElementNS(D,"span");t.setAttribute("class","apexcharts-breadcrumb-separator"),t.setAttribute("aria-hidden","true"),t.textContent=i,o.appendChild(t)}let l=0===r?null!=(s=a.rootLabel)?s:"All":t.label;if("function"==typeof a.formatter&&(l=a.formatter(l,{index:r,depth:n.length-1,data:t.data})),r===n.length-1){const t=F.createElementNS(D,"span");return t.setAttribute("class","apexcharts-breadcrumb-item apexcharts-breadcrumb-current"),t.setAttribute("aria-current","page"),t.textContent=String(l),void o.appendChild(t)}const h=F.createElementNS(D,"button");if(h.setAttribute("type","button"),h.setAttribute("class","apexcharts-breadcrumb-item"),0===r){const t=F.createElementNS(D,"span");t.setAttribute("class","apexcharts-breadcrumb-arrow"),t.setAttribute("aria-hidden","true"),t.textContent="\u2190",h.appendChild(t)}const c=F.createElementNS(D,"span");c.setAttribute("class","apexcharts-breadcrumb-label"),c.textContent=String(l),h.appendChild(c),h.addEventListener("click",()=>e.onNavigate(r,t)),o.appendChild(h)}),r.appendChild(o),o}(t,{ariaLabel:"Treemap breadcrumb",config:this._breadcrumbCfg(),compact:!0,crumbs:[{label:"All",data:null}].concat(e.map(t=>({label:t.name,data:t}))),onNavigate:(t,e)=>{this._refocus(e.data?e.data._key:null)}});r&&(this._placeBreadcrumb(r),function(t,e){const r=[".apexcharts-title-text",".apexcharts-subtitle-text"].map(e=>t.dom.baseEl.querySelector(e)).filter(t=>null!==t);if(!r.length)return;const a=t.dom.elWrap.getBoundingClientRect().top;for(let t=0;t<r.length+1;t++){const t=e.getBoundingClientRect(),n=r.find(e=>{const r=e.getBoundingClientRect();return t.left<r.right&&t.right>r.left&&t.top<r.bottom&&t.bottom>r.top});if(!n)break;e.style.top=n.getBoundingClientRect().bottom-a+4+"px"}}(t,r))}_placeBreadcrumb(t){var e,r;const a=this.w,n=a.layout.translateY||0,o=null==(r=null==(e=this.ctx)?void 0:e.dimensions)?void 0:r.dimHelpers,i=o?o.getTitleSubtitleCoords("title").height+o.getTitleSubtitleCoords("subtitle").height:0,s=t.getBoundingClientRect().height||18;if(n-i>=s+1)return void(t.style.top=n-s-1+"px");t.style.top=`${i}px`;const l="dark"===a.config.theme.mode;t.style.background=l?"rgba(20,24,30,0.82)":"rgba(255,255,255,0.86)",t.style.borderRadius="4px"}_showParentTooltip(t,e){const r=this.w,a=this._tip();if(!a)return;const n=this._drawnTotal(),o=e._parent?e._parent._area:n,i=n>0?(e._area/n*100).toFixed(1):"0.0",s=o>0?(e._area/o*100).toFixed(1):i,l=this.w.config.plotOptions.treemap.parents,h=l&&l.tooltip&&l.tooltip.formatter,c=this._countLeaves(e);let d;if("function"==typeof h)d=h({name:e.name,value:e._area,depth:e.depth||0,leafCount:c,percentOfParent:Number(s),percentOfTotal:Number(i),node:e,w:r});else{const t=this._parentChrome(e.depth||0).headerBg;d=`<div class="apexcharts-tooltip-series-group apexcharts-active" style="display:flex;${r.config.tooltip.fillSeriesColor?`background-color:${t};`:""}"><div class="apexcharts-tooltip-text"><div class="apexcharts-tooltip-y-group"><span class="apexcharts-tooltip-text-y-label">${w.escapeString(e.name)}: </span><span class="apexcharts-tooltip-text-y-value">${this._formatValue(e._area)}</span></div><div class="apexcharts-tooltip-y-group"><span class="apexcharts-tooltip-text-y-label">${c} items, </span><span class="apexcharts-tooltip-text-y-value">${s}% of parent, ${i}% of total</span></div></div></div>`}a.innerHTML=d,a.classList.add("apexcharts-active"),a.removeAttribute("aria-hidden"),this._positionTooltip(t)}_tip(){const t=this.w.dom.elWrap;let e=this._tooltipEl;if(!(null==e?void 0:e.isConnected)){e=t.querySelector(".apexcharts-treemap-tooltip");const r=!e&&t.querySelector(".apexcharts-tooltip");r&&(e=r.cloneNode(!1),e.classList.add("apexcharts-treemap-tooltip"),t.appendChild(e)),this._tooltipEl=e}return e}_positionTooltip(t){const e=this._tip();if(!e)return;const r=this.w.dom.elWrap.getBoundingClientRect(),a=e.offsetWidth,n=e.offsetHeight;let o=t.clientX-r.left+12;o+a>r.width&&(o=t.clientX-r.left-a-12),o=Math.max(0,Math.min(o,r.width-a));let i=t.clientY-r.top+12;i+n>r.height&&(i=t.clientY-r.top-n-12),i=Math.max(0,Math.min(i,r.height-n)),e.style.left=o+"px",e.style.top=i+"px"}_hideParentTooltip(){const t=this._tooltipEl;null==t||t.classList.remove("apexcharts-active"),null==t||t.setAttribute("aria-hidden","true")}_drawnTotal(){return null==this._total&&(this._total=(this.drawn||[]).reduce((t,e)=>t+this._subtreeArea(e),0)),this._total||0}_subtreeArea(t){if(null!=t._area)return t._area;const e=t.children;if(e&&e.length){let t=0;for(let r=0;r<e.length;r++)t+=this._subtreeArea(e[r]);return t}const r=Number(t.value);return isNaN(r)?0:Math.abs(r)}_countLeaves(t){return t.children&&t.children.length?t.children.reduce((t,e)=>t+this._countLeaves(e),0):1}_formatValue(t){var e,r,a,n,o;const i=this.w,s=(null==(r=null==(e=i.config.tooltip)?void 0:e.y)?void 0:r.formatter)||(null==(o=null==(n=null==(a=i.config.yaxis)?void 0:a[0])?void 0:n.labels)?void 0:o.formatter);if("function"==typeof s)try{return String(s(t,{seriesIndex:0,dataPointIndex:0,w:i}))}catch(t){}return String(t)}_labelCanShow(t,e,r){if(!Number.isFinite(t)||t<=0)return!1;const a=this.w.config.plotOptions.treemap.dataLabels;return!(t<(a&&null!=a.minFontSize?Number(a.minFontSize):0))&&Math.max(e,r)>=t}_averageLabelSize(){if(null!=this._avgLabelSize)return this._avgLabelSize;const t=this.labels.flat();let e=0;for(const r of t)e+=String(null!=r?r:"").length;return this._avgLabelSize=e/(t.length||1),this._avgLabelSize}getFontSize(t){const e=this.w,r=this._averageLabelSize();return function(t,a){const n=t*a,o=Math.pow(n,.5);return Math.min(o/r,parseInt(e.config.dataLabels.style.fontSize,10))}(t[2]-t[0],t[3]-t[1])}rotateToFitLabel(t,e,r,a,n,o,i){const s=new b(this.w),l=s.getTextRects(r,String(e));if(l.width+this.w.config.stroke.width+5>o-a&&l.width<=i-n){const e=s.rotateAroundCenter(t.node);t.node.setAttribute("transform",`rotate(-90 ${e.x} ${e.y}) translate(${l.height/3})`)}}truncateLabels(t,e,r,a,n,o){const i=new b(this.w),s=i.getTextRects(t,String(e)).width+this.w.config.stroke.width+5>n-r&&o-a>n-r?o-a:n-r,l=i.getTextBasedOnMaxWidth({text:t,maxWidth:s,fontSize:e});return t.length!==l.length&&s/e<5?"":l}_morphKeyed(){var t;const e=null==(t=this.ctx)?void 0:t.morphTypeChange;return!(!e||"function"!=typeof e.hasKeyedMarks||!e.hasKeyedMarks()||"function"!=typeof e.getInitialPathForKey)}_morphSourceForLeaf(t){var e;const r=null==(e=this.ctx)?void 0:e.morphTypeChange;if(!r||"function"!=typeof r.getInitialPathAt)return null;if(this._morphKeyed()){const e=r.getInitialPathForKey(L(t._key));if(e)return e}return r.getInitialPathAt(this._morphLeafIndex++)}_tilePath(t,e,r,a){return`M ${t} ${e} L ${r} ${e} L ${r} ${a} L ${t} ${a} Z`}_morphTile(t,e,r,a,n,o){new x(this.w,this.ctx).morphSVG(t,n,o,"none",e,r,a,0)}_rideTile(t,e,r,a,n,o,i,s=!e){const l=t.getAttribute("transform")||"",h=e?e.x-(r+n)/2:0,c=e?e.y-(a+o)/2:0,d=e=>{if(e>=1)return l?t.setAttribute("transform",l):t.removeAttribute("transform"),void t.removeAttribute("opacity");const r=1-e;t.setAttribute("transform",`translate(${h*r} ${c*r}) ${l}`.trim()),s&&t.setAttribute("opacity",String(e))};d(0),i.during(d)}animateTreemap(t,e,r,a,n=0){const o=new x(this.w);return o.animateRect(t,e,r,a,()=>{o.animationCompleted(t)},n)}}}),Object.defineProperty(exports,"default",{enumerable:!0,get:()=>c.default});
|
|
5
|
+
"use strict";var t=Object.defineProperty,e=Object.defineProperties,r=Object.getOwnPropertyDescriptors,a=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable,i=(e,r,a)=>r in e?t(e,r,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[r]=a,l=(t,e)=>{for(var r in e||(e={}))n.call(e,r)&&i(t,r,e[r]);if(a)for(var r of a(e))o.call(e,r)&&i(t,r,e[r]);return t},s=(t,a)=>e(t,r(a));Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});function h(t){if(t&&t.__esModule)return t;const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t)for(const r in t)if("default"!==r){const a=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,a.get?a:{enumerable:!0,get:()=>t[r]})}return e.default=t,Object.freeze(e)}const c=h(require("apexcharts/core"));function d(t,e,r,a){const n=a*a,o=r*r;return Math.max(n*e/o,o/(n*t))}function u(t,e,r,a,n,o){if(0===t)return!0;return d(e,r,a,o)>=d(Math.min(e,n),Math.max(r,n),a+n,o)}function p(t,e,r,a,n,o,i,l){if(i>=l){const i=a/l;let s=o;for(let a=0;a<r;a++){const r=e[a]/i;t.push([n,s,n+i,s+r]),s+=r}}else{const l=a/i;let s=n;for(let a=0;a<r;a++){const r=e[a]/l;t.push([s,o,s+r,o+l]),s+=r}}}function f(t){const e=t.children;if(e&&e.length){let r=0;for(let t=0;t<e.length;t++)r+=f(e[t]);return t._area=r,r}const r=Number(t.value),a=isNaN(r)?0:Math.abs(r);return t._area=a,a}function m(t,e,r,a,n,o,i,l){const s=t.length;if(0===s||a<=0||n<=0)return;const h=new Array(s);let c=0;for(let e=0;e<s;e++)h[e]=t[e]._area,c+=h[e];if(c<=0)return;const d=function(t,e,r,a,n){const o=[],i=t.length;if(0===i)return o;const l=new Array(i);let s=0,h=0,c=1/0,d=-1/0,f=0;for(;f<i;){const i=Math.min(a,n),m=t[f];if(u(s,c,d,h,m,i))l[s]=m,s++,h+=m,m<c&&(c=m),m>d&&(d=m),f++;else{if(p(o,l,s,h,e,r,a,n),a>=n){const t=h/n;e+=t,a-=t}else{const t=h/a;r+=t,n-=t}s=0,h=0,c=1/0,d=-1/0}}return s>0&&p(o,l,s,h,e,r,a,n),o}(function(t,e){let r=0;for(let e=0;e<t.length;e++)r+=t[e];const a=e/r,n=new Array(t.length);for(let e=0;e<t.length;e++)n[e]=t[e]*a;return n}(h,a*n),e,r,a,n);for(let e=0;e<s;e++){const r=t[e],a=d[e];if(!a)continue;r.rect=a,r.depth=o;const n=r.children;if(!n||!n.length)continue;const s=a[2]-a[0],h=a[3]-a[1];let c=Math.max(0,i(r,o,s,h)||0);(2*c>=s||2*c>=h)&&(c=0);let u=Math.max(0,l(r,o,s,h)||0);u>0&&h-2*c-u<u&&(u=0),r.headerHeight=u,m(n,a[0]+c,a[1]+u+c,s-2*c,h-u-2*c,o+1,i,l)}}const g={generateNested:function(t,e,r,a={}){if(!Array.isArray(t)||0===t.length)return t||[];const n=a.padding||(()=>0),o=a.header||(()=>0);for(let e=0;e<t.length;e++)f(t[e]);return m(t,0,0,e,r,0,n,o),t}},b=c.__apex_Graphics,y=c.__apex_Animations,x=c.__apex_Fill,w=c.__apex_Utils,v=c.__apex_DataLabels;class _{constructor(t,e){this.ctx=e,this.w=t}checkColorRange(){const t=this.w;let e=!1;const r=t.config.plotOptions[t.config.chart.type];return r.colorScale.ranges.length>0&&r.colorScale.ranges.map(t=>{t.from<=0&&(e=!0)}),e}getShadeColor(t,e,r,a){const n=this.w;let o=1;const i=n.config.plotOptions[t].shadeIntensity,l=this.determineColor(t,e,r);n.globals.hasNegs||a?o=n.config.plotOptions[t].reverseNegativeShade?l.percent<0?l.percent/100*(1.25*i):(1-l.percent/100)*(1.25*i):l.percent<=0?1-(1+l.percent/100)*i:(1-l.percent/100)*i:(o=1-l.percent/100,"treemap"===t&&(o=(1-l.percent/100)*(1.25*i)));let s=l.color;const h=new w;if(n.config.plotOptions[t].enableShades)if("dark"===this.w.config.theme.mode){const t=h.shadeColor(-1*o,l.color);s=w.hexToRgba(w.isColorHex(t)?t:w.rgb2hex(t),n.config.fill.opacity)}else{const t=h.shadeColor(o,l.color);s=w.hexToRgba(w.isColorHex(t)?t:w.rgb2hex(t),n.config.fill.opacity)}return{color:s,colorProps:l}}determineColor(t,e,r){const a=this.w,n=a.seriesData.series[e][r],o=a.config.plotOptions[t];let i=o.colorScale.inverse?r:e;o.distributed&&"treemap"===a.config.chart.type&&(i=r);let l,s,h=a.globals.colors[i],c=null;if(o.distributed||"heatmap"!==t){const t=a.seriesData.series[e];l=t.length?t[0]:0,s=l;for(let e=1;e<t.length;e++)t[e]<l&&(l=t[e]),t[e]>s&&(s=t[e])}else l=a.globals.minY,s=a.globals.maxY;const d=o.colorScale.min,u=o.colorScale.max;void 0!==d&&void 0!==u&&u>d?(l=d,s=u):void 0!==d&&(l=d<a.globals.minY?d:a.globals.minY,s=u>a.globals.maxY?u:a.globals.maxY);const p=Math.abs(s)+Math.abs(l),f=Math.min(Math.max(n,l),s);let m=0===p?0:100*f/p;if(o.colorScale.ranges.length>0){o.colorScale.ranges.map(t=>{if(n>=t.from&&n<=t.to){h=t.color,c=t.foreColor?t.foreColor:null,l=t.from,s=t.to;const e=Math.abs(s)+Math.abs(l);m=0===e?0:100*n/e}})}return{color:h,foreColor:c,percent:m}}calculateDataLabels({text:t,x:e,y:r,i:a,j:n,colorProps:o,fontSize:i}){const l=this.w.config.dataLabels,s=new b(this.w),h=new v(this.w,this.ctx);let c=null;return l.enabled&&(c=s.group({class:"apexcharts-data-labels"}),h.plotDataLabelsText({x:e,y:r+parseFloat(l.style.fontSize)/3,text:t,i:a,j:n,color:o.foreColor,parent:c,fontSize:i,dataLabelsConfig:l})),c}}const A=c.__apex_Filters,S=c.__apex_Series,C=c.__apex_Environment_Environment;function M(t,e){var r;const a=String(t).replace(/\//g,"%2F"),n=(null!=(r=e.get(a))?r:-1)+1;return e.set(a,n),`${n}:${a}`}function k(t,e,r,a,n,o=null,i={},l=new Map){var s,h,c;const d=e&&"object"==typeof e,u=d&&null!=(h=null!=(s=e.x)?s:e.name)?h:"",p=d?null!=(c=e.y)?c:e.value:e,f=null==p||""===p?NaN:Number(p),m={name:String(u),value:isNaN(f)?null:f,color:d&&e.color?e.color:void 0,_key:`${n}/${M(u,l)}`};a&&!m.color&&(m.color=a[r%a.length]),i.keepDatum&&(m._datum=e);const g=new Map;if(d&&Array.isArray(e.children)&&e.children.length)m.children=e.children.map((e,r)=>k(t,e,r,null,m._key,o,i,g));else if(d&&null!=e.drilldown&&!1!==i.expandDrilldown){const r=o||new Set;if(!r.has(e.drilldown)){const a=function(t,e){const r=t.config.drilldown;return(r&&Array.isArray(r.series)?r.series:[]).find(t=>t&&t.id===e)}(t,e.drilldown);if(a&&Array.isArray(a.data)&&a.data.length){const n=new Set(r);n.add(e.drilldown);const o=Array.isArray(a.colors)?a.colors:null;m.children=a.data.map((e,r)=>k(t,e,r,o,m._key,n,i,g))}}}return m}function E(t){t.children&&t.children.length&&(t.children.forEach(t=>E(t)),(null==t.value||isNaN(t.value))&&(t.value=t.children.reduce((t,e)=>t+Math.max(0,e.value||0),0))),(null==t.value||isNaN(t.value))&&(t.value=0)}function L(t){if("string"!=typeof t)return"";const e=t.indexOf("/");return-1===e?"":t.slice(e)}function F(t){const e=t.globals.treemapRoots;if(e&&e.length)return{roots:e,maxDepth:t.globals.treemapMaxDepth||1};const r=function(t,e,r={}){const a=e||t.config.series;if(!Array.isArray(a))return[];const n=new Map;return a.map((e,a)=>{var o,i;const l=e&&Array.isArray(e.data)?e.data:[],s=M(null!=(o=null==e?void 0:e.name)?o:"",n),h=new Map;return{name:String(null!=(i=null==e?void 0:e.name)?i:""),value:null,color:(null==e?void 0:e.color)||void 0,_key:s,_seriesIndex:a,children:l.map((e,a)=>k(t,e,a,null,s,null,r,h))}})}(t,t.config.series,{keepDatum:!0,expandDrilldown:!1});r.forEach(E);const{maxDepth:a}=function(t){const e=[];let r=0;return t.forEach((t,a)=>{const n=[],o=(t,e,i)=>{t._parent=i,t._depth=e,t._si=a,t._leaf=!(t.children&&t.children.length),e>r&&(r=e),t._leaf?(t._di=n.length,n.push(t)):(t._di=-1,t.children.forEach(r=>o(r,e+1,t)))};o(t,0,null),e.push(n)}),{leaves:e,maxDepth:r}}(r);return{roots:r,maxDepth:a}}const N=c.__apex_BrowserAPIs_BrowserAPIs,P=c.__apex_Easing_resolveEasing;const $=["#cf4d3f","#8f9499","#26a75b"],T=(t,e,r)=>t+(e-t)*r;function O(t){return Math.max(0,Math.min(255,Math.round(t))).toString(16).padStart(2,"0")}function z(t,e,r){const a=w.parseHex(W(t)),n=w.parseHex(W(e));return a&&n?"#"+O(T(a[0],n[0],r))+O(T(a[1],n[1],r))+O(T(a[2],n[2],r)):t}function W(t){if("string"!=typeof t)return"#000000";if(w.isColorHex(t))return t;return w.rgb2hex(t)||"#000000"}function R(t,e,r,a){var n,o,i;if(!e||"object"!=typeof e)return null;const l=null==(i=null==(o=null==(n=t.config.plotOptions)?void 0:n.treemap)?void 0:o.colorScale)?void 0:i.colorValue;let s;if(s="function"==typeof l?l(e,{seriesIndex:r,dataPointIndex:a,w:t}):"string"==typeof l?e[l]:e.colorValue,null==s)return null;const h=Number(s);return Number.isFinite(h)?h:null}function B(t){var e,r,a;const n=null==(a=null==(r=null==(e=t.config)?void 0:e.plotOptions)?void 0:r.treemap)?void 0:a.colorScale,o=n&&n.gradient;if(!o)return null;if(!1===o.enabled)return null;const i=t.config.series||[];let l=1/0,s=-1/0,h=!1;for(let e=0;e<i.length;e++){const r=i[e]&&i[e].data;if(Array.isArray(r))for(let a=0;a<r.length;a++){const n=R(t,r[a],e,a);null!=n&&(h=!0,n<l&&(l=n),n>s&&(s=n))}}if(!h&&!0!==o.enabled)return null;Number.isFinite(l)||(l=0,s=0);let c=Number.isFinite(Number(o.min))?Number(o.min):l,d=Number.isFinite(Number(o.max))?Number(o.max):s,u=null;if(null===o.midpoint?u=null:Number.isFinite(Number(o.midpoint))?u=Number(o.midpoint):c<0&&d>0&&(u=0),null!=u&&!1!==o.symmetric&&!Number.isFinite(Number(o.min))&&!Number.isFinite(Number(o.max))){const t=Math.max(Math.abs(c-u),Math.abs(d-u));c=u-t,d=u+t}d===c&&(c-=.5,d+=.5);const p=function(t,e,r,a){if(Array.isArray(t.stops)&&t.stops.length>=2)return t.stops.filter(t=>t&&Number.isFinite(Number(t.value))).map(t=>({value:Number(t.value),color:W(t.color)})).sort((t,e)=>t.value-e.value);const n=(Array.isArray(t.colors)&&t.colors.length>=2?t.colors:$).map(W),o=n.length;if(null!=a&&o>=3){const t=Math.floor((o-1)/2),i=[];for(let r=0;r<=t;r++)i.push({value:T(e,a,r/t),color:n[r]});for(let e=t+1;e<o;e++)i.push({value:T(a,r,(e-t)/(o-1-t)),color:n[e]});return i}return n.map((t,a)=>({value:T(e,r,a/(o-1)),color:t}))}(o,c,d,u);if(p.length<2)return null;const f=d-c,m=p.map(t=>({percent:0===f?0:(t.value-c)/f,color:t.color}));return{min:c,max:d,midpoint:u,stops:p,at:t=>{if(!Number.isFinite(t))return p[Math.floor(p.length/2)].color;if(t<=p[0].value)return p[0].color;const e=p[p.length-1];if(t>=e.value)return e.color;for(let e=1;e<p.length;e++){const r=p[e];if(t<=r.value){const a=p[e-1],n=r.value-a.value,o=0===n?0:(t-a.value)/n;return z(a.color,r.color,o)}}return e.color},legendStops:m}}function D(t){const e=W(t);return w.getContrastRatio(e,"#ffffff")>=w.getContrastRatio(e,"#000000")?"#ffffff":"#000000"}const I="http://www.w3.org/1999/xhtml";function q(t,e){const r=t.config.drilldown&&t.config.drilldown.breadcrumb||{};return l(l({show:!0,position:"top-left",separator:" / ",rootLabel:"All",offsetX:0,offsetY:0,formatter:void 0},r),e||{})}function j(t){const e=t.dom.elWrap;if(!e)return;const r=e.querySelector(".apexcharts-breadcrumb");r&&r.parentNode&&r.parentNode.removeChild(r)}const H=t=>"string"==typeof t&&/^(#|rgb)/i.test(t);function K(t,e,r,a){return H(r)&&H(a)&&r!==a?[s(l({},t),{fill:r}),s(l({},e),{fill:a})]:[t,e]}const Y=t=>{var e;const r=t.config.plotOptions.treemap.parents.show;return!0===r||!1!==r&&!!(null==(e=t.globals.treemapRoots)?void 0:e.length)},V=t=>S.treemapHeaderLook(t);c.default.use({treemap:class{constructor(t,e){this.ctx=e,this.w=t,this.strokeWidth=this.w.config.stroke.width,this.helpers=new _(t,e),this.dynamicAnim=this.w.config.chart.animations.dynamicAnimation,this.labels=[],this.roots=[],this.drawn=[],this.showParents=!1,this.scale=null,this._levelCache=null,this._total=null,this._avgLabelSize=null,this._tooltipEl=null,this._morphLeafIndex=0,this.camera=null}draw(){var t,e;const r=this.w,a=new b(this.w,this.ctx),n=new x(this.w),o=a.group({class:"apexcharts-treemap"});if(r.globals.noData)return o;this.negRange=this.helpers.checkColorRange(),r.config.series.forEach((t,e)=>{Array.isArray(this.labels[e])||(this.labels[e]=[]),t.data.forEach(t=>{this.labels[e].push(t.x)})});const i=F(r);this.roots=i.roots,this.scale=B(r);const s=1===i.roots.length?i.roots[0].children||[]:i.roots;this.drawn=s,this.showParents=Y(r);const h=this._resolveFocus(s),c=h?[h]:s;g.generateNested(c,r.layout.gridWidth,r.layout.gridHeight,{padding:(t,e,r,a)=>this.showParents?this._levelPadding(e,r,a):0,header:(t,e,r,a)=>this.showParents?this._levelHeader(t,e,r,a):0}),this.camera=this._zoomCamera();const d=null==(t=this.ctx.highlightFilter)?void 0:t.treemap(this),u=null==(e=this.ctx)?void 0:e.morphTypeChange,p=!!u&&"function"==typeof u.isActive&&u.isActive()&&"function"==typeof u.getInitialPathAt;this._morphLeafIndex=0;const f=this._leavesBySeries(c,r.config.series.length),m=this.showParents?this._parentsBySeries(c,r.config.series.length):[];return f.forEach((t,e)=>{var i;const s=a.group({class:"apexcharts-series apexcharts-treemap-series",seriesName:w.escapeString(r.seriesData.seriesNames[e]),rel:e+1,"data:realIndex":e});if(S.addCollapsedClassToSeries(this.w,s,e),a.setupEventDelegation(s,".apexcharts-treemap-rect"),r.config.chart.dropShadow.enabled){const t=r.config.chart.dropShadow;new A(this.w).dropShadow(s,t,e)}const h=a.group({class:"apexcharts-data-labels"}),c={xMin:1/0,yMin:1/0,xMax:-1/0,yMax:-1/0},u={xMin:1/0,yMin:1/0};this.showParents&&(m[e]||[]).forEach(t=>{this._drawParent(s,t,e)});const f=r.config.chart.animations,g=f.animateGradually,b=g&&!1!==g.enabled,y=new Array(t.length).fill(0);if(b){const e=t.length||1,r=Math.min(g.delay||0,.5*f.speed/e);t.map((t,e)=>{return{j:e,area:t.rect?(r=t.rect,(r[2]-r[0])*(r[3]-r[1])):0};var r}).sort((t,e)=>e.area-t.area).forEach((t,e)=>{y[t.j]=e*r})}t.forEach((t,o)=>{var i;const h=t.rect;if(!h)return;const f=t._di,m=h[0],g=h[1],b=h[2],x=h[3];b>m&&x>g&&(c.xMin=Math.min(c.xMin,m),c.yMin=Math.min(c.yMin,g),c.xMax=Math.max(c.xMax,b),c.yMax=Math.max(c.yMax,x));const w=this._leafColor(e,f),v=w.color;let _=n.fillPath({color:v,seriesNumber:e,dataPointIndex:f});const A=p?this._morphSourceForLeaf(t):null,C=A?a.drawPath({d:this._tilePath(m,g,b,x),fill:"#fff",stroke:r.config.plotOptions.treemap.useFillColorAsStroke?v:r.globals.stroke.colors[e],strokeWidth:this.strokeWidth,fillOpacity:1}):a.drawRect(m,g,b-m,x-g,r.config.plotOptions.treemap.borderRadius,"#fff",1,this.strokeWidth,r.config.plotOptions.treemap.useFillColorAsStroke?v:r.globals.stroke.colors[e]);_=(null==d?void 0:d(C,e,f,_,t))||_,C.attr({cx:m,cy:g,index:e,i:e,j:f,width:b-m,height:x-g,fill:_}),C.node.classList.add("apexcharts-treemap-rect"),C.node.setAttribute("data:key",L(t._key));let M=null,k={x:m+(b-m)/2,y:g+(x-g)/2,width:0,height:0};const E={x:m,y:g,width:b-m,height:x-g};A?this._morphTile(C,A,this._tilePath(m,g,b,x),this.ctx.morphTypeChange.getSpeed(),e,f):r.config.chart.animations.enabled&&!r.globals.dataChanged&&(r.globals.resized?r.globals.animationEnded=!0:M=this.animateTreemap(C,k,E,r.config.chart.animations.speed,y[o]||0));let F=null,N=null;if(r.globals.dataChanged){let t=1;if(this.dynamicAnim.enabled&&r.globals.shouldAnimate){t=this.dynamicAnim.speed;const a=null==(i=r.globals.previousPaths[e])?void 0:i[f],n=l({},E);if(!(null==a?void 0:a.rect)&&this.camera&&(k=this.camera.back(E),F={x:k.x+k.width/2,y:k.y+k.height/2}),null==a?void 0:a.rect){k=l({},a.rect),k.width>0&&k.height>0&&(u.xMin=Math.min(u.xMin,k.x),u.yMin=Math.min(u.yMin,k.y),F={x:k.x+k.width/2,y:k.y+k.height/2},N="string"==typeof a.label?a.label:null,a.labelFading&&this.camera&&(N=""));const t=t=>"string"==typeof t&&/^(#|rgb)/i.test(t);t(a.fill)&&t(_)&&a.fill!==_&&(k.fill=a.fill,n.fill=_)}M=this.animateTreemap(C,k,n,t)}}let P=this.getFontSize(h);"truncate"===r.config.plotOptions.treemap.dataLabels.format&&(P=parseInt(String(r.config.dataLabels.style.fontSize),10));let $=null;if(r.config.dataLabels.enabled&&this._labelCanShow(P,b-m,x-g)){let a=r.config.dataLabels.formatter(this.labels[e][f],{value:r.seriesData.series[e][f],seriesIndex:e,dataPointIndex:f,w:r,highlight:t.highlight});"truncate"===r.config.plotOptions.treemap.dataLabels.format&&(a=this.truncateLabels(String(a),P,m,g,b,x)),r.seriesData.series[e][f]&&($=this.helpers.calculateDataLabels({text:a,x:(m+b)/2,y:(g+x)/2+this.strokeWidth/2+P/3,i:e,j:f,colorProps:w,fontSize:P})),r.config.dataLabels.enabled&&$&&this.rotateToFitLabel($,P,a,m,g,b,x)}if(s.add(C),null!==$&&($.node.setAttribute("data:key",L(t._key)),s.add($),M)){const t=!F||""===N||!!this.camera&&null!==N&&N!==S.treemapLabelLook($.node);this._rideTile($.node,F,m,g,b,x,M,t)}});const x=r.config.plotOptions.treemap.seriesTitle;if(!this.showParents&&r.config.series.length>1&&x&&x.show){const t=r.config.series[e].name||"";if(t&&c.xMin<1/0&&c.yMin<1/0){const{offsetX:e,offsetY:n,borderColor:o,borderWidth:l,borderRadius:h,style:d}=x,p=d.color||r.config.chart.foreColor,f={left:d.padding.left,right:d.padding.right,top:d.padding.top,bottom:d.padding.bottom},m=a.getTextRects(t,d.fontSize,d.fontFamily),g=m.width+f.left+f.right,b=m.height+f.top+f.bottom,y=c.xMin+(e||0),w=c.yMin+(n||0),v=a.drawRect(y,w,g,b,h,d.background,1,l,o),_=y+f.left,A=w+f.top+.75*(null!=(i=null==m?void 0:m.height)?i:0),S=a.drawText({x:_,y:A,text:t,fontSize:d.fontSize,fontFamily:d.fontFamily,fontWeight:d.fontWeight,foreColor:p,cssClass:d.cssClass||""}),C=u.xMin-c.xMin,M=u.yMin-c.yMin;if(Number.isFinite(C)&&Number.isFinite(M)&&(C||M)){const t=this.dynamicAnim.speed;this.animateTreemap(v,{x:y+C,y:w+M},{x:y,y:w},t),this.animateTreemap(S,{x:_+C,y:A+M},{x:_,y:A},t)}s.add(v),s.add(S)}}s.add(h),o.add(s)}),this.camera&&this._playZoomExit(o),this._renderBreadcrumb(),o}_levelCfg(t){if(this._levelCache||(this._levelCache=[]),this._levelCache[t])return this._levelCache[t];const e=this.w.config.plotOptions.treemap,r=e.parents||{},a=(e.levels||[])[t]||{},n=s(l(l({},r),a),{header:s(l(l({},r.header||{}),a.header||{}),{style:l(l({},(r.header||{}).style||{}),(a.header||{}).style||{})}),hover:l(l({},r.hover||{}),a.hover||{})});return this._levelCache[t]=n,n}_levelPadding(t,e,r){const a=this._levelCfg(t);return Number(a.padding)||0}_levelHeader(t,e,r,a){const n=this._levelCfg(e).header||{};if(!1===n.show)return 0;const o=Number(n.height);if(!Number.isFinite(o)||o<=0)return 0;return r<(Number(n.minWidth)||40)||a<2*o?0:o}_leavesBySeries(t,e){const r=new Array(Math.max(1,e));for(let t=0;t<r.length;t++)r[t]=[];const a=t=>{if(t.children&&t.children.length)t.children.forEach(a);else{const e=t._si||0;r[e]&&r[e].push(t)}};return t.forEach(a),r}_parentsBySeries(t,e){const r=new Array(Math.max(1,e));for(let t=0;t<r.length;t++)r[t]=[];const a=t=>{if(!t.children||!t.children.length)return;const e=t._si||0;r[e]&&r[e].push(t),t.children.forEach(a)};return t.forEach(a),r.forEach(t=>t.sort((t,e)=>(t.depth||0)-(e.depth||0))),r}_leafColor(t,e){const r=this.w;if(this.scale){const a=function(t,e,r){const a=t.config.series[e];return R(t,a&&Array.isArray(a.data)?a.data[r]:null,e,r)}(r,t,e);if(null!=a){const t=this.scale.at(a);return{color:t,foreColor:D(t),colorProps:{color:t,foreColor:D(t),percent:0}}}}return this.helpers.getShadeColor(r.config.chart.type,t,e,this.negRange)}_parentChrome(t){const e=this.w,r=this._levelCfg(t),a="dark"===e.config.theme.mode,n=(r.header||{}).style||{},o=Math.min(t,3),i=a?255:0,l=`${i},${i},${i}`;return{fill:r.fill||`rgba(${l},${(a?.04:.03)+.02*o})`,fillOpacity:null==r.fillOpacity?1:r.fillOpacity,borderColor:r.borderColor||`rgba(${l},${a?.18:.14})`,borderWidth:null==r.borderWidth?1:r.borderWidth,borderRadius:null==r.borderRadius?e.config.plotOptions.treemap.borderRadius:r.borderRadius,headerBg:n.background||`rgba(${l},${a?.1:.07})`,headerColor:n.color||(a?"#e8e8e8":e.config.chart.foreColor),headerFontSize:n.fontSize||"12px",headerFontFamily:n.fontFamily||e.config.chart.fontFamily,headerFontWeight:null==n.fontWeight?600:n.fontWeight,hoverColor:r.hover&&r.hover.color||(a?"rgba(255,255,255,0.85)":"rgba(0,0,0,0.7)"),hoverWidth:r.hover&&r.hover.width||2,hoverShow:!(r.hover&&!1===r.hover.show)}}_drawParent(t,e,r){var a,n,o,i;const l=e.rect;if(!l)return;const s=this.w,h=new b(this.w,this.ctx),c=e.depth||0,d=this._levelCfg(c),u=this._parentChrome(c),p=l[0],f=l[1],m=l[2]-l[0],g=l[3]-l[1];if(m<=0||g<=0)return;const x=h.group({class:"apexcharts-treemap-parent","data:depth":c,"data:name":e.name}),w=L(e._key),v=this._morphKeyed()?this.ctx.morphTypeChange.getInitialPathForKey(w):null,_=v?h.drawPath({d:this._tilePath(p,f,p+m,f+g),fill:u.fill,stroke:u.borderColor,strokeWidth:u.borderWidth,fillOpacity:u.fillOpacity}):h.drawRect(p,f,m,g,u.borderRadius,u.fill,u.fillOpacity,u.borderWidth,u.borderColor);_.node.classList.add("apexcharts-treemap-parent-rect"),_.node.setAttribute("data:key",w),_.node.setAttribute("data:depth",String(c)),v&&this._morphTile(_,v,this._tilePath(p,f,p+m,f+g),this.ctx.morphTypeChange.getSpeed(),r,c);let A=null,S=null,C=!1;const M=s.config.chart.animations.dynamicAnimation;if(!v&&s.globals.dataChanged&&M.enabled&&s.globals.shouldAnimate){const t=M.speed;if(A=null!=(n=null==(a=s.globals.prevTreemapParents)?void 0:a.get(`${r}|${w}`))?n:null,!A&&this.camera){A=this.camera.back({x:p,y:f,width:m,height:g}),C=!0;const e=s.layout;A.x<e.gridWidth&&A.y<e.gridHeight&&A.x+A.width>0&&A.y+A.height>0&&x.attr({opacity:0}).animate(t).attr({opacity:1})}A?S=new y(s).animateRect(_,...K({x:A.x,y:A.y,width:A.width,height:A.height},{x:p,y:f,width:m,height:g},A.fill,_.node.getAttribute("fill")),t,()=>{}):x.attr({opacity:0}).animate(t).attr({opacity:1})}x.add(_);const k=e.headerHeight||0;let E="";if(k>0){const t=d.header||{},a=h.drawRect(p,f,m,k,0,u.headerBg,1,0,"transparent");if(a.node.classList.add("apexcharts-treemap-parent-header"),x.add(a),A){const t=A.header,e={x:p,y:f,width:m,height:k};new y(s).animateRect(a,...K(t?{x:t.x,y:t.y,width:t.width,height:t.height}:C&&this.camera?this.camera.back(e):{x:A.x,y:A.y,width:A.width,height:0},e,null==t?void 0:t.fill,a.node.getAttribute("fill")),s.config.chart.animations.dynamicAnimation.speed,()=>{})}let n=String(null!=(o=e.name)?o:"");"function"==typeof t.formatter?n=String(t.formatter(e.name,{value:e._area,depth:c,seriesIndex:r,node:e,w:s})):t.showValue&&(n=`${n} ${this._formatValue(e._area,e._si)}`),E=n;const l=Number(t.offsetX)||0,b=t.align||"left",w=6,v=Math.max(0,m-2*w-Math.abs(l)),M=parseFloat(String(u.headerFontSize))||12,L=h.getTextBasedOnMaxWidth({text:n,maxWidth:v,fontSize:M,fontFamily:u.headerFontFamily,fontWeight:u.headerFontWeight});if(L){let e=p+w+l,r="start";"center"===b?(e=p+m/2+l,r="middle"):"right"===b&&(e=p+m-w+l,r="end");const a=h.drawText({x:e,y:f+k/2+M/3+(Number(t.offsetY)||0),text:L,textAnchor:r,fontSize:u.headerFontSize,fontFamily:u.headerFontFamily,fontWeight:u.headerFontWeight,foreColor:u.headerColor,cssClass:`apexcharts-treemap-parent-label ${t.style&&t.style.cssClass||""}`});if(a.node.setAttribute("pointer-events","none"),x.add(a),S&&A){const t=t=>"center"===b?t.x+t.width/2:"right"===b?t.x+t.width:t.x,e={x:t(A)-t({x:p,width:m})+(p+m/2),y:A.y-f+(f+g/2)},r=!!this.camera&&!C&&(null==(i=A.header)?void 0:i.look)!==V(a.node);this._rideTile(a.node,e,p,f,p+m,f+g,S,r)}}this._attachParentEvents(a.node,e,u,_),this._makeParentAccessible(a.node,e,u,_,E)}this._attachParentEvents(_.node,e,u,_),x.node.setAttribute("role","group"),x.node.setAttribute("aria-label",this._parentLabel(e,E)),t.add(x)}_parentLabel(t,e){const r=this._drawnTotal(),a=r>0?(t._area/r*100).toFixed(1):"0",n=this._countLeaves(t);return`${e&&String(e).trim()?String(e).replace(/\s+/g," ").trim():`${t.name}, ${this._formatValue(t._area,t._si)}`}, ${n} ${1===n?"item":"items"}, ${a}% of total`}_makeParentAccessible(t,e,r,a,n){const o=this.w.config.chart.accessibility;if(!t||!t.setAttribute)return;if(!o.enabled||!o.keyboard.enabled||!this._zoomEnabled())return;const i=this.w.globals.treemapFocusKey===e._key;t.tmKey=e._key,t.setAttribute("role","button"),t.setAttribute("tabindex","0"),t.setAttribute("aria-label",`${this._parentLabel(e,n)}. Zoom ${i?"out":"in"}`),t.setAttribute("aria-expanded",i),C.isBrowser()&&t.addEventListener&&(t.addEventListener("focus",()=>{a.node.setAttribute("stroke",r.hoverColor),a.node.setAttribute("stroke-width",String(r.hoverWidth+1))}),t.addEventListener("blur",()=>{a.node.setAttribute("stroke",r.borderColor),a.node.setAttribute("stroke-width",String(r.borderWidth))}),t.addEventListener("keydown",t=>{"Enter"!==t.key&&" "!==t.key&&"Spacebar"!==t.key||(t.preventDefault(),this._zoomTo(e,!0))}))}_attachParentEvents(t,e,r,a){if(!C.isBrowser()||!t||!t.addEventListener)return;const n=this.w;r.hoverShow&&(t.addEventListener("mouseenter",()=>{a.node.setAttribute("stroke",r.hoverColor),a.node.setAttribute("stroke-width",String(r.hoverWidth))}),t.addEventListener("mouseleave",()=>{a.node.setAttribute("stroke",r.borderColor),a.node.setAttribute("stroke-width",String(r.borderWidth))})),n.config.tooltip.enabled&&(t.addEventListener("mouseenter",t=>this._showParentTooltip(t,e)),t.addEventListener("mousemove",t=>this._positionTooltip(t)),t.addEventListener("mouseleave",()=>this._hideParentTooltip())),this._zoomEnabled()&&(t.style.cursor="pointer",t.addEventListener("click",()=>this._zoomTo(e)))}zoomLive(t,e){var r;const a=t.config.plotOptions.treemap.zoom;if(!(null==a?void 0:a.enabled)||!Y(t))return!1;const n=t.config.drilldown;return e&&(null==n?void 0:n.enabled)&&((null==(r=n.series)?void 0:r.length)||n.onDrillDown)?null:a}_zoomEnabled(){const t=this.ctx.drilldown,e=this.zoomLive(this.w,t);return null!==e||t.zoomWarned||(t.zoomWarned=!0,console.warn("ApexCharts treemap: zoom is ignored while drilldown is active (plotOptions.treemap.zoom vs drilldown series or onDrillDown).")),!!e}_resolveFocus(t){const e=this.w.globals.treemapFocusKey;if(!e||!this._zoomEnabled())return null;let r=null;const a=t=>{r||(t._key!==e?t.children&&t.children.forEach(a):r=t)};return t.forEach(a),r&&r.children&&r.children.length&&this._subtreeArea(r)>0?r:(this.w.globals.treemapFocusKey=null,null)}_zoomTo(t,e=!1){const r=this.w;if(!t||!t.children||!t.children.length)return;const a=r.globals.treemapFocusKey===t._key?null:t._key;this._refocus(a,e)}_refocus(t,e){const r=this.w,a=r.globals,n=a.treemapFocusKey,o=r.config.chart.animations,i=!(!o.enabled||!o.dynamicAnimation.enabled);a.treemapZoom=i&&C.isBrowser()?{from:null!=n?n:null,to:t}:null,a.treemapFocusKey=t,this._hideParentTooltip(),a.shouldAnimate=i,a.resized=!0,a.dataChanged=!0,a.treemapZoom&&this.ctx.series.getPreviousPaths();const l=this.ctx.update();e&&l.then(()=>{const t=r.dom.baseEl,e=Array.from(t.querySelectorAll(".apexcharts-treemap-parent-header[tabindex]"));(t.querySelector(".apexcharts-breadcrumb-item")||e.find(t=>t.tmKey===n)||e[0]||t).focus()})}_zoomCamera(){var t;const e=this.w,r=e.globals.treemapZoom;e.globals.treemapZoom=null;const a=e.globals.prevTreemapParents;if(!(r&&a&&e.globals.dataChanged&&e.globals.shouldAnimate))return null;const n=new Map,o=t=>{n.set(t._key,t),t.children&&t.children.forEach(o)};this.drawn.forEach(o);const i=(t,e)=>{for(let r=n.get(t);r;r=r._parent)if(r._key===e)return!0;return!1},{from:l,to:s}=r,h=s&&(null==l||i(s,l))?s:l&&(null==s||i(l,s))?l:null,c=h?n.get(h):null;if(!h||!c||!c.rect)return null;let d=c;for(;d._parent;)d=d._parent;const u=Math.max(0,this.roots.indexOf(d)),p=null!=(t=a.get(`${u}|${L(h)}`))?t:null,f=c.rect,m=f[0],g=f[1],b=f[2]-f[0],y=f[3]-f[1];if(!p||!(p.width>0&&p.height>0&&b>0&&y>0))return null;const x=p,w=b/x.width,v=y/x.height;return{fwd:t=>({x:m+(t.x-x.x)*w,y:g+(t.y-x.y)*v,width:t.width*w,height:t.height*v}),back:t=>({x:x.x+(t.x-m)/w,y:x.y+(t.y-g)/v,width:t.width/w,height:t.height/v})}}_playZoomExit(t){const e=this.w,r=this.camera,a=e.globals.prevTreemapView;if(e.globals.prevTreemapView=null,!r||!C.isBrowser())return;const n=t.node,o=new b(this.w,this.ctx),i=[["apexcharts-treemap-rect","T"],["apexcharts-treemap-parent-rect","P"],["apexcharts-data-labels","L"]],l=t=>{var e;const r=i.find(([e])=>t.classList.contains(e)),a=null==(e=t.closest(".apexcharts-series"))?void 0:e.getAttribute("data:realIndex");return r?`${r[1]}${a}|${t.getAttribute("data:key")}`:""},s=(t,e)=>{var r;return parseFloat(null!=(r=t.getAttribute(e))?r:"")},h=t=>({x:s(t,"x"),y:s(t,"y"),width:s(t,"width"),height:s(t,"height")}),c=t=>({x:t.x+t.width/2,y:t.y+t.height/2}),d=new Map;n.querySelectorAll("[data\\:key]").forEach(t=>{const e=l(t);e&&d.set(e,t)});const u=[],p=(t,e)=>{const r=h(t);[r.x,r.y,r.width,r.height].every(Number.isFinite)&&u.push(a=>{t.setAttribute("x",String(r.x+(e.x-r.x)*a)),t.setAttribute("y",String(r.y+(e.y-r.y)*a)),t.setAttribute("width",String(r.width+(e.width-r.width)*a)),t.setAttribute("height",String(r.height+(e.height-r.height)*a))})},f=(t,e,r=!1)=>{var a;const n=t.getAttribute("transform")||"",o=parseFloat(null!=(a=t.getAttribute("opacity"))?a:"1"),i=Number.isFinite(o)?o:1;u.push(a=>{t.setAttribute("transform",`translate(${e.x*a} ${e.y*a}) ${n}`.trim()),r&&t.setAttribute("opacity",String(i*(1-a)))})},m=t=>{[t,...t.querySelectorAll("*")].forEach(t=>{t.removeAttribute("data:key"),["role","tabindex","aria-label","aria-expanded"].forEach(e=>t.removeAttribute(e)),t.classList.remove("apexcharts-treemap-rect","apexcharts-treemap-parent","apexcharts-treemap-parent-rect","apexcharts-treemap-parent-header","apexcharts-treemap-parent-label","apexcharts-data-labels")})},g=o.group({class:"apexcharts-treemap-ghosts"}).node,y=o.group({class:"apexcharts-treemap-ghosts"}).node;if(a){const t=[...a.querySelectorAll(":scope > .apexcharts-treemap-ghosts")];t.forEach((e,a)=>{e.querySelectorAll("rect").forEach(t=>p(t,r.fwd(h(t)))),e.querySelectorAll("text").forEach(t=>{const e=t=>{const e=/^translate\(\s*([-+.\deE]+)[\s,]+([-+.\deE]+)\s*\)/.exec(((null==t?void 0:t.getAttribute("transform"))||"").trim());return e?[parseFloat(e[1]),parseFloat(e[2])]:[0,0]},[a,n]=e(t.parentElement),[o,i]=e(t),l={x:s(t,"x")+a+o,y:s(t,"y")+n+i,width:0,height:0};if(!Number.isFinite(l.x)||!Number.isFinite(l.y))return;const h=r.fwd(l);f(t,{x:h.x-l.x,y:h.y-l.y})}),[...e.childNodes].forEach(e=>(a===t.length-1&&t.length>1?y:g).appendChild(e)),e.remove()});const n=new Map;a.querySelectorAll(".apexcharts-treemap-rect[data\\:key]").forEach(t=>n.set(l(t),t)),a.querySelectorAll(".apexcharts-data-labels[data\\:key]").forEach(t=>{const e=l(t),a=d.get(e);if(a&&!(t=>{var e;return parseFloat(null!=(e=t.getAttribute("opacity"))?e:"1")<.999})(t)&&S.treemapLabelLook(a)===S.treemapLabelLook(t))return;const o=n.get(`T${e.slice(1)}`);if(!o)return;const i=c(h(o)),s=d.get(`T${e.slice(1)}`),u=c(s?h(s):r.fwd(h(o)));f(t,{x:u.x-i.x,y:u.y-i.y},!!s),m(t),y.appendChild(t)}),a.querySelectorAll(".apexcharts-treemap-parent").forEach(t=>{var a;const n=t.querySelector(".apexcharts-treemap-parent-rect[data\\:key]");if(!n||"rect"!==n.tagName.toLowerCase())return;const o=d.get(l(n));if(o){const e=t.querySelector(".apexcharts-treemap-parent-label"),r=null==(a=o.parentElement)?void 0:a.querySelector(".apexcharts-treemap-parent-label");if(e&&V(e)!==V(r)){const t=h(n),r=h(o),a=e.getAttribute("text-anchor"),i=t=>"middle"===a?t.x+t.width/2:"end"===a?t.x+t.width:t.x;f(e,{x:i(r)-i(t),y:r.y-t.y},!0),m(e),y.appendChild(e)}return}t.querySelectorAll("rect").forEach(t=>p(t,r.fwd(h(t)))),t.querySelectorAll("text").forEach(t=>{const e={x:s(t,"x"),y:s(t,"y"),width:0,height:0};if(!Number.isFinite(e.x)||!Number.isFinite(e.y))return;const a=r.fwd(e);f(t,{x:a.x-e.x,y:a.y-e.y})});const i=r.fwd(h(n)),c=e.layout;i.x<c.gridWidth&&i.y<c.gridHeight&&i.x+i.width>0&&i.y+i.height>0&&u.push(e=>t.setAttribute("opacity",String(1-e))),m(t),g.appendChild(t)}),n.forEach((t,e)=>{d.has(e)||"rect"!==t.tagName.toLowerCase()||(p(t,r.fwd(h(t))),m(t),g.appendChild(t))});const o=a.querySelector(":scope > defs.apexcharts-treemap-ghost-defs");o&&g.insertBefore(o,g.firstChild)}[g,y].forEach(t=>{t.setAttribute("pointer-events","none"),t.setAttribute("aria-hidden","true")}),n.insertBefore(g,n.firstChild),n.appendChild(y),n.setAttribute("clip-path",`url(#gridRectMask${e.globals.cuid})`),function(t,e,r,a,n){const o=performance.now(),i=l=>{if(t.globals.isDestroyed)return;const s=Math.max(0,Math.min(1,(l-o)/e));a(r(s),s),s<1?N.requestAnimationFrame(i):n&&n()};N.requestAnimationFrame(i)}(e,Math.max(1,this.dynamicAnim.speed||1),P(e.config.chart.animations.easing),t=>u.forEach(e=>e(t)),()=>{g.remove(),y.remove(),n.removeAttribute("clip-path")})}_focusChain(){const t=[],e=new Set(this.drawn||[]);let r=this._resolveFocus(this.drawn||[]);for(;r&&(t.unshift(r),!e.has(r));)r=r._parent;return t}_breadcrumbCfg(){const t=this.w.config.plotOptions.treemap.zoom;return q(this.w,t&&t.breadcrumb)}_renderBreadcrumb(){if(!C.isBrowser())return;const t=this.w;if(!t.dom.elWrap)return;if(j(t),!this._zoomEnabled())return;const e=this._focusChain();if(!e.length)return;const r=function(t,e){if(!C.isBrowser())return null;const r=t.dom.elWrap;if(!r)return null;j(t);const a=e.config||q(t);if(!1===a.show)return null;const n=e.crumbs||[];if(n.length<2)return null;const o=N.createElementNS(I,"nav");o.setAttribute("class","apexcharts-breadcrumb"),o.setAttribute("aria-label",e.ariaLabel||"Breadcrumb"),function(t,e){const r=e.offsetX||0,a=e.offsetY||0;t.style.position="absolute",t.style.top=a+"px","top-right"===e.position?t.style.right=3-r+"px":t.style.left=r+"px"}(o,a),e.compact&&(o.style.fontSize="11px",o.style.padding="0 2px");const i=null!=a.separator?a.separator:" / ";return n.forEach((t,r)=>{var l;if(r>0){const t=N.createElementNS(I,"span");t.setAttribute("class","apexcharts-breadcrumb-separator"),t.setAttribute("aria-hidden","true"),t.textContent=i,o.appendChild(t)}let s=0===r?null!=(l=a.rootLabel)?l:"All":t.label;if("function"==typeof a.formatter&&(s=a.formatter(s,{index:r,depth:n.length-1,data:t.data})),r===n.length-1){const t=N.createElementNS(I,"span");return t.setAttribute("class","apexcharts-breadcrumb-item apexcharts-breadcrumb-current"),t.setAttribute("aria-current","page"),t.textContent=String(s),void o.appendChild(t)}const h=N.createElementNS(I,"button");if(h.setAttribute("type","button"),h.setAttribute("class","apexcharts-breadcrumb-item"),0===r){const t=N.createElementNS(I,"span");t.setAttribute("class","apexcharts-breadcrumb-arrow"),t.setAttribute("aria-hidden","true"),t.textContent="\u2190",h.appendChild(t)}const c=N.createElementNS(I,"span");c.setAttribute("class","apexcharts-breadcrumb-label"),c.textContent=String(s),h.appendChild(c),h.addEventListener("click",a=>e.onNavigate(r,t,a)),o.appendChild(h)}),r.appendChild(o),o}(t,{ariaLabel:"Treemap breadcrumb",config:this._breadcrumbCfg(),compact:!0,crumbs:[{label:"All",data:null}].concat(e.map(t=>({label:t.name,data:t}))),onNavigate:(t,e,r)=>{this._refocus(e.data?e.data._key:null,!r.detail)}});r&&(this._placeBreadcrumb(r),function(t,e){const r=[".apexcharts-title-text",".apexcharts-subtitle-text"].map(e=>t.dom.baseEl.querySelector(e)).filter(t=>null!==t);if(!r.length)return;const a=t.dom.elWrap.getBoundingClientRect().top;for(let t=0;t<r.length+1;t++){const t=e.getBoundingClientRect(),n=r.find(e=>{const r=e.getBoundingClientRect();return t.left<r.right&&t.right>r.left&&t.top<r.bottom&&t.bottom>r.top});if(!n)break;e.style.top=n.getBoundingClientRect().bottom-a+4+"px"}}(t,r))}_placeBreadcrumb(t){var e,r;const a=this.w,n=a.layout.translateY||0,o=null==(r=null==(e=this.ctx)?void 0:e.dimensions)?void 0:r.dimHelpers,i=o?o.getTitleSubtitleCoords("title").height+o.getTitleSubtitleCoords("subtitle").height:0,l=t.getBoundingClientRect().height||18,s=this._breadcrumbCfg().offsetY||0;if(n-i>=l+1)return void(t.style.top=`${n-l-1+s}px`);t.style.top=`${i+s}px`;const h="dark"===a.config.theme.mode;t.style.background=h?"rgba(20,24,30,0.82)":"rgba(255,255,255,0.86)",t.style.borderRadius="4px"}_showParentTooltip(t,e){const r=this.w,a=this._tip();if(!a)return;const n=this._drawnTotal(),o=e._parent?this._subtreeArea(e._parent):n,i=n>0?(e._area/n*100).toFixed(1):"0.0",l=o>0?(e._area/o*100).toFixed(1):i,s=this.w.config.plotOptions.treemap.parents,h=s&&s.tooltip&&s.tooltip.formatter,c=this._countLeaves(e);let d;if("function"==typeof h)d=h({name:e.name,value:e._area,depth:e.depth||0,leafCount:c,percentOfParent:Number(l),percentOfTotal:Number(i),node:e,w:r});else{const t=this._parentChrome(e.depth||0).headerBg;d=`<div class="apexcharts-tooltip-series-group apexcharts-active" style="display:flex;${r.config.tooltip.fillSeriesColor?`background-color:${t};`:""}"><div class="apexcharts-tooltip-text"><div class="apexcharts-tooltip-y-group"><span class="apexcharts-tooltip-text-y-label">${String(e.name).replace(/&/g,"&").replace(/</g,"<")}: </span><span class="apexcharts-tooltip-text-y-value">${this._formatValue(e._area,e._si)}</span></div><div class="apexcharts-tooltip-y-group"><span class="apexcharts-tooltip-text-y-label">${c} items, </span><span class="apexcharts-tooltip-text-y-value">${l}% of parent, ${i}% of total</span></div></div></div>`}a.innerHTML=d,a.classList.add("apexcharts-active"),a.removeAttribute("aria-hidden"),this._positionTooltip(t)}_tip(){const t=this.w.dom.elWrap;let e=this._tooltipEl;if(!(null==e?void 0:e.isConnected)){e=t.querySelector(".apexcharts-treemap-tooltip");const r=!e&&t.querySelector(".apexcharts-tooltip");r&&(e=r.cloneNode(!1),e.classList.add("apexcharts-treemap-tooltip"),t.appendChild(e)),this._tooltipEl=e}return e}_positionTooltip(t){const e=this._tip();if(!e)return;const r=this.w.dom.elWrap.getBoundingClientRect(),a=e.offsetWidth,n=e.offsetHeight;let o=t.clientX-r.left+12;o+a>r.width&&(o=t.clientX-r.left-a-12),o=Math.max(0,Math.min(o,r.width-a));let i=t.clientY-r.top+12;i+n>r.height&&(i=t.clientY-r.top-n-12),i=Math.max(0,Math.min(i,r.height-n)),e.style.left=o+"px",e.style.top=i+"px"}_hideParentTooltip(){const t=this._tooltipEl;null==t||t.classList.remove("apexcharts-active"),null==t||t.setAttribute("aria-hidden","true")}_drawnTotal(){return null==this._total&&(this._total=(this.drawn||[]).reduce((t,e)=>t+this._subtreeArea(e),0)),this._total||0}_subtreeArea(t){if(null!=t._area)return t._area;const e=t.children;if(e&&e.length){let t=0;for(let r=0;r<e.length;r++)t+=this._subtreeArea(e[r]);return t}const r=Number(t.value);return isNaN(r)?0:Math.abs(r)}_countLeaves(t){return t.children&&t.children.length?t.children.reduce((t,e)=>t+this._countLeaves(e),0):1}_formatValue(t,e){var r,a,n,o,i;const l=this.w,s=(null==(a=null==(r=l.config.tooltip)?void 0:r.y)?void 0:a.formatter)||(null==(i=null==(o=null==(n=l.config.yaxis)?void 0:n[0])?void 0:o.labels)?void 0:i.formatter);if("function"==typeof s)try{return String(s(t,{seriesIndex:e||0,dataPointIndex:-1,w:l}))}catch(t){}return String(t)}_labelCanShow(t,e,r){if(!Number.isFinite(t)||t<=0)return!1;const a=this.w.config.plotOptions.treemap.dataLabels;return!(t<(a&&null!=a.minFontSize?Number(a.minFontSize):0))&&Math.max(e,r)>=t}_averageLabelSize(){if(null!=this._avgLabelSize)return this._avgLabelSize;const t=this.labels.flat();let e=0;for(const r of t)e+=String(null!=r?r:"").length;return this._avgLabelSize=e/(t.length||1),this._avgLabelSize}getFontSize(t){const e=this.w,r=this._averageLabelSize();return function(t,a){const n=t*a,o=Math.pow(n,.5);return Math.min(o/r,parseInt(e.config.dataLabels.style.fontSize,10))}(t[2]-t[0],t[3]-t[1])}rotateToFitLabel(t,e,r,a,n,o,i){const l=new b(this.w),s=this._labelRect(l,r,e);if(s.width+this.w.config.stroke.width+5>o-a&&s.width<=i-n){const e=l.rotateAroundCenter(t.node);t.node.setAttribute("transform",`rotate(-90 ${e.x} ${e.y}) translate(${s.height/3})`)}}_labelRect(t,e,r){const a=this.w.config.dataLabels.style;return t.getTextRects(e,String(r),a.fontFamily,"",!0,a.fontWeight)}truncateLabels(t,e,r,a,n,o){const i=new b(this.w),h=this._labelRect(i,t,e).width+this.w.config.stroke.width+5>n-r&&o-a>n-r?o-a:n-r,c=i.getTextBasedOnMaxWidth(s(l({},this.w.config.dataLabels.style),{text:t,maxWidth:h,fontSize:e}));return t.length!==c.length&&h/e<5?"":c}_morphKeyed(){var t;const e=null==(t=this.ctx)?void 0:t.morphTypeChange;return!(!e||"function"!=typeof e.hasKeyedMarks||!e.hasKeyedMarks()||"function"!=typeof e.getInitialPathForKey)}_morphSourceForLeaf(t){var e;const r=null==(e=this.ctx)?void 0:e.morphTypeChange;if(!r||"function"!=typeof r.getInitialPathAt)return null;if(this._morphKeyed()){const e=r.getInitialPathForKey(L(t._key));if(e)return e}return r.getInitialPathAt(this._morphLeafIndex++)}_tilePath(t,e,r,a){return`M ${t} ${e} L ${r} ${e} L ${r} ${a} L ${t} ${a} Z`}_morphTile(t,e,r,a,n,o){new y(this.w,this.ctx).morphSVG(t,n,o,"none",e,r,a,0)}_rideTile(t,e,r,a,n,o,i,l=!e){const s=t.getAttribute("transform")||"",h=e?e.x-(r+n)/2:0,c=e?e.y-(a+o)/2:0,d=e=>{if(e>=1)return s?t.setAttribute("transform",s):t.removeAttribute("transform"),void t.removeAttribute("opacity");const r=1-e;t.setAttribute("transform",`translate(${h*r} ${c*r}) ${s}`.trim()),l&&t.setAttribute("opacity",String(e))};d(0),i.during(d)}animateTreemap(t,e,r,a,n=0){const o=new y(this.w);return o.animateRect(t,e,r,a,()=>{o.animationCompleted(t)},n)}}}),Object.defineProperty(exports,"default",{enumerable:!0,get:()=>c.default});
|