UNPKG

apexcharts

Version:

A JavaScript Chart Library

6 lines 897 kB
/*!
 * ApexCharts v7.0.0
 * (c) 2018-2026 ApexCharts
 */
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).ApexCharts=e()}(this,function(){"use strict";var t=Object.defineProperty,e=Object.defineProperties,i=Object.getOwnPropertyDescriptors,s=Object.getOwnPropertySymbols,a=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable,n=(e,i,s)=>i in e?t(e,i,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[i]=s,o=(t,e)=>{for(var i in e||(e={}))a.call(e,i)&&n(t,i,e[i]);if(s)for(var i of s(e))r.call(e,i)&&n(t,i,e[i]);return t},l=(t,s)=>e(t,i(s)),h=(t,e,i)=>n(t,"symbol"!=typeof e?e+"":e,i),c=(t,e,i)=>new Promise((s,a)=>{var r=t=>{try{o(i.next(t))}catch(t){a(t)}},n=t=>{try{o(i.throw(t))}catch(t){a(t)}},o=t=>t.done?s(t.value):Promise.resolve(t.value).then(r,n);o((i=i.apply(t,e)).next())});class d{static isSSR(){return"undefined"==typeof window||"undefined"==typeof document}static isBrowser(){return!this.isSSR()}static hasAPI(t){return!this.isSSR()&&void 0!==window[t]}static getApex(){return"undefined"!=typeof window&&window.Apex?window.Apex:"undefined"!=typeof global&&global.Apex?global.Apex:{}}}class p{constructor(t,e=null){this.nodeName=t,this.namespaceURI=e,this.attributes=new Map,this.children=[],this.textContent="",this.style={},this.classList=new u,this.parentNode=null,this._ssrWidth=void 0,this._ssrHeight=void 0,this._ssrMode=void 0}setAttribute(t,e){this.attributes.set(t,e)}getAttribute(t){return this.attributes.get(t)}removeAttribute(t){this.attributes.delete(t)}hasAttribute(t){return this.attributes.has(t)}appendChild(t){if(t&&t!==this){if(t.parentNode&&t.parentNode!==this)t.parentNode.removeChild(t);else if(t.parentNode===this){const e=this.children.indexOf(t);-1!==e&&this.children.splice(e,1)}t.parentNode=this,this.children.push(t)}return t}removeChild(t){const e=this.children.indexOf(t);return-1!==e&&(this.children.splice(e,1),t.parentNode=null),t}insertBefore(t,e){if(!e)return this.appendChild(t);if(t.parentNode&&t.parentNode!==this)t.parentNode.removeChild(t);else if(t.parentNode===this){const e=this.children.indexOf(t);-1!==e&&this.children.splice(e,1)}const i=this.children.indexOf(e);return-1!==i&&(t.parentNode=this,this.children.splice(i,0,t)),t}cloneNode(t=!1){const e=new p(this.nodeName,this.namespaceURI);return e.textContent=this.textContent,this.attributes.forEach((t,i)=>{e.attributes.set(i,t)}),Object.assign(e.style,this.style),t&&this.children.forEach(t=>{t.cloneNode&&e.appendChild(t.cloneNode(!0))}),e}getBoundingClientRect(){return{width:this._ssrWidth||0,height:this._ssrHeight||0,top:0,left:0,right:this._ssrWidth||0,bottom:this._ssrHeight||0,x:0,y:0}}getRootNode(){let t=this;for(;t.parentNode;)t=t.parentNode;return t}querySelector(){return null}querySelectorAll(){return[]}getElementsByClassName(){return[]}addEventListener(){}removeEventListener(){}get childNodes(){return this.children}toString(){let t="";if(this.attributes.forEach((e,i)=>{t+=` ${i}="${e}"`}),0===this.children.length&&!this.textContent)return`<${this.nodeName}${t}/>`;const e=this.children.map(t=>t.toString()).join("");return`<${this.nodeName}${t}>${this.textContent}${e}</${this.nodeName}>`}get innerHTML(){return this.children.map(t=>t.toString()).join("")}set innerHTML(t){this.children=[],this.textContent=t}get outerHTML(){return this.toString()}get isConnected(){return!0}}class u{constructor(){this.classes=new Set}add(...t){t.forEach(t=>this.classes.add(t))}remove(...t){t.forEach(t=>this.classes.delete(t))}contains(t){return this.classes.has(t)}toggle(t,e){return!0===e?(this.classes.add(t),!0):!1===e||this.classes.has(t)?(this.classes.delete(t),!1):(this.classes.add(t),!0)}toString(){return Array.from(this.classes).join(" ")}}class g{constructor(){this.SVGNS="http://www.w3.org/2000/svg",this.XLINKNS="http://www.w3.org/1999/xlink"}createElementNS(t,e){return new p(e,t)}createTextNode(t){const e={nodeName:"#text",nodeType:3,textContent:t,toString:()=>e.textContent};return e}querySelector(){return null}querySelectorAll(){return[]}getComputedStyle(){return{}}getBoundingClientRect(t){return t&&t.getBoundingClientRect?t.getBoundingClientRect():{width:0,height:0,top:0,left:0,right:0,bottom:0,x:0,y:0}}createXMLSerializer(){return{serializeToString:t=>t.toString?t.toString():""}}createDOMParser(){return{parseFromString(t,e){const i=new p("root");return i.innerHTML=t,{documentElement:i}}}}}let f=null,x=null,m=null;class b{static init(){d.isSSR()&&!f&&(f=new g)}static createElement(t){return d.isSSR()?(f||this.init(),f.createElementNS(null,t)):document.createElement(t)}static createElementNS(t,e){return d.isSSR()?(f||this.init(),f.createElementNS(t,e)):document.createElementNS(t,e)}static createTextNode(t){return d.isSSR()?(f||this.init(),f.createTextNode(t)):document.createTextNode(t)}static querySelector(t){return d.isSSR()?null:document.querySelector(t)}static querySelectorAll(t){return d.isSSR()?[]:document.querySelectorAll(t)}static getComputedStyle(t){return d.isSSR()?{}:window.getComputedStyle(t)}static matchMedia(t){if(d.isSSR()||"function"!=typeof window.matchMedia)return null;try{return window.matchMedia(t)}catch(t){return null}}static getBoundingClientRect(t){return d.isSSR()?(f||this.init(),f.getBoundingClientRect(t)):t?t.getBoundingClientRect():{width:0,height:0,top:0,left:0,right:0,bottom:0,x:0,y:0}}static getXMLSerializer(){return d.isSSR()?(f||this.init(),x||(x=f.createXMLSerializer()),x):(x||(x=new XMLSerializer),x)}static getDOMParser(){return d.isSSR()?(f||this.init(),m||(m=f.createDOMParser()),m):(m||(m=new DOMParser),m)}static addWindowEventListener(t,e,i){d.isBrowser()&&window.addEventListener(t,e,i)}static removeWindowEventListener(t,e,i){d.isBrowser()&&window.removeEventListener(t,e,i)}static requestAnimationFrame(t){return d.isBrowser()?window.requestAnimationFrame(t):(t(0),null)}static cancelAnimationFrame(t){d.isBrowser()&&t&&window.cancelAnimationFrame(t)}static elementExists(t){return!!t&&(d.isSSR()?!0===t._ssrMode||void 0!==t.nodeName:!!t.getRootNode&&(t.getRootNode({composed:!0})===document||t.isConnected))}static getWindow(){return d.isBrowser()?window:null}static getDocument(){return d.isBrowser()?document:null}static _getShim(){return f}static _resetShim(){f=null,x=null,m=null}}const y=new WeakMap;let w=0,v=class t{static isObject(t){return t&&"object"==typeof t&&!Array.isArray(t)}static is(t,e){return Object.prototype.toString.call(e)==="[object "+t+"]"}static isSafari(){return d.isBrowser()&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}static extend(t,e){if(!this.isObject(t)&&this.isObject(e))return this.clone(e);const i=Object.assign({},t);return this.isObject(t)&&this.isObject(e)&&Object.keys(e).forEach(s=>{this.isObject(e[s])?s in t?i[s]=this.extend(t[s],e[s]):Object.assign(i,{[s]:e[s]}):Object.assign(i,{[s]:e[s]})}),i}static extendArray(e,i){const s=[];return e.map(e=>{s.push(t.extend(i,e))}),e=s}static monthMod(t){return t%12}static clone(t,e=new WeakMap,i=!1){if(null===t||"object"!=typeof t)return t;if(e.has(t))return e.get(t);let s;if(Array.isArray(t))if(i)s=t.slice();else{s=[],e.set(t,s);for(let i=0;i<t.length;i++)s[i]=this.clone(t[i],e,!1)}else if(t instanceof Date)s=new Date(t.getTime());else if(i)s=Object.assign({},t);else{s={},e.set(t,s);for(const i in t)Object.prototype.hasOwnProperty.call(t,i)&&(s[i]=this.clone(t[i],e,!1))}return s}static shallowClone(t){return null===t||"object"!=typeof t?t:Array.isArray(t)?t.slice():Object.assign({},t)}static stringifyForCompare(t){return JSON.stringify(t,(t,e)=>{if("function"!=typeof e)return e;let i=y.get(e);return void 0===i&&(i=++w,y.set(e,i)),`__apx_fn_${i}`})}static shallowEqual(t,e){if(t===e)return!0;if(!t||!e)return!1;if("object"!=typeof t||"object"!=typeof e)return t===e;const i=Object.keys(t),s=Object.keys(e);if(i.length!==s.length)return!1;for(const s of i)if(t[s]!==e[s])return!1;return!0}static log10(t){return Math.log(t)/Math.LN10}static roundToBase10(t){return Math.pow(10,Math.floor(Math.log10(t)))}static roundToBase(t,e){return Math.pow(e,Math.floor(Math.log(t)/Math.log(e)))}static parseNumber(t){return"number"==typeof t||null===t?t:parseFloat(t)}static stripNumber(t,e=2){return Number.isInteger(t)?t:parseFloat(t.toPrecision(e))}static randomId(){return(Math.random()+1).toString(36).substring(4)}static noExponents(t){return t.toString().includes("e")?Math.round(t):t}static elementExists(t){return!(!t||!t.isConnected)}static getDimensions(t){if(!t)return[0,0];if(d.isSSR())return[t._ssrWidth||400,t._ssrHeight||300];let e;try{e=getComputedStyle(t,null)}catch(e){return[t.clientWidth||0,t.clientHeight||0]}let i=t.clientWidth,s=t.clientHeight;if(!i||!s){const e=t.getBoundingClientRect();i=i||e.width,s=s||e.height}return s-=parseFloat(e.paddingTop)+parseFloat(e.paddingBottom),i-=parseFloat(e.paddingLeft)+parseFloat(e.paddingRight),[i,s]}static getBoundingClientRect(t){if(!t)return{top:0,right:0,bottom:0,left:0,width:0,height:0,x:0,y:0};if(d.isSSR())return b.getBoundingClientRect(t);const e=t.getBoundingClientRect();return{top:e.top,right:e.right,bottom:e.bottom,left:e.left,width:t.clientWidth,height:t.clientHeight,x:e.left,y:e.top}}static getLargestStringFromArr(t){return t.reduce((t,e)=>(Array.isArray(e)&&(e=e.reduce((t,e)=>t.length>e.length?t:e)),t.length>e.length?t:e),0)}static hexToRgba(t="#999999",e=.6){"#"!==t.substring(0,1)&&(t="#999999");const i=t.replace("#",""),s=i.match(new RegExp("(.{"+i.length/3+"})","g"))||[];for(let t=0;t<s.length;t++)s[t]=parseInt(1===s[t].length?s[t]+s[t]:s[t],16);return void 0!==e&&s.push(e),"rgba("+s.join(",")+")"}static getOpacityFromRGBA(t){return parseFloat(t.replace(/^.*,(.+)\)/,"$1"))}static parseHex(t){if("string"!=typeof t)return null;let e=t.trim().replace("#","");return 3===e.length&&(e=e.split("").map(t=>t+t).join("")),/^[0-9a-fA-F]{6}$/.test(e)?[parseInt(e.slice(0,2),16),parseInt(e.slice(2,4),16),parseInt(e.slice(4,6),16)]:null}static relativeLuminance([t,e,i]){const s=t=>{const e=t/255;return e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)};return.2126*s(t)+.7152*s(e)+.0722*s(i)}static getContrastRatio(e,i){const s=t.parseHex(e),a=t.parseHex(i);if(!s||!a)return 0;const r=t.relativeLuminance(s),n=t.relativeLuminance(a);return(Math.max(r,n)+.05)/(Math.min(r,n)+.05)}static rgb2hex(t){return(t=t.match(/^rgba?[\s+]?\([\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?/i))&&4===t.length?"#"+("0"+parseInt(t[1],10).toString(16)).slice(-2)+("0"+parseInt(t[2],10).toString(16)).slice(-2)+("0"+parseInt(t[3],10).toString(16)).slice(-2):""}shadeRGBColor(t,e){const i=e.split(","),s=t<0?0:255,a=t<0?-1*t:t,r=parseInt(i[0].slice(4),10),n=parseInt(i[1],10),o=parseInt(i[2],10);return"rgb("+(Math.round((s-r)*a)+r)+","+(Math.round((s-n)*a)+n)+","+(Math.round((s-o)*a)+o)+")"}shadeHexColor(t,e){const i=parseInt(e.slice(1),16),s=t<0?0:255,a=t<0?-1*t:t,r=i>>16,n=i>>8&255,o=255&i;return"#"+(16777216+65536*(Math.round((s-r)*a)+r)+256*(Math.round((s-n)*a)+n)+(Math.round((s-o)*a)+o)).toString(16).slice(1)}shadeColor(e,i){return t.isColorHex(i)?this.shadeHexColor(e,i):this.shadeRGBColor(e,i)}static isColorHex(t){return/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)|(^#[0-9A-F]{8}$)/i.test(t)}static isCSSVariable(t){if("string"!=typeof t)return!1;const e=t.trim();return e.startsWith("var(")&&e.endsWith(")")}static getThemeColor(e){if(!t.isCSSVariable(e))return e;if(d.isSSR())return e;const i=document.createElement("div");let s;i.style.cssText="position:fixed; left: -9999px; visibility:hidden;",i.style.color=e,document.body.appendChild(i);try{s=window.getComputedStyle(i).color}finally{i.parentNode&&i.parentNode.removeChild(i)}return s}static applyOpacityToColor(t,e){const i=Number(e);if(!Number.isFinite(i))return t;if(i<=0)return"transparent";if(i>=1)return t;return`color-mix(in srgb, ${t} ${Math.round(100*i)}%, transparent)`}static getPolygonPos(t,e){const i=[],s=2*Math.PI/e;for(let a=0;a<e;a++){const e={};e.x=t*Math.sin(a*s),e.y=-t*Math.cos(a*s),i.push(e)}return i}static polarToCartesian(t,e,i,s){const a=(s-90)*Math.PI/180;return{x:t+i*Math.cos(a),y:e+i*Math.sin(a)}}static escapeString(t,e="x"){let i=t.toString().slice();return i=i.replace(/[` ~!@#$%^&*()|+=?;:'",.<>{}[\]\\/]/gi,e),i}static negToZero(t){return t<0?0:t}static moveIndexInArray(t,e,i){if(i>=t.length){let e=i-t.length+1;for(;e--;)t.push(void 0)}return t.splice(i,0,t.splice(e,1)[0]),t}static extractNumber(t){return parseFloat(t.replace(/[^\d.]*/g,""))}static findAncestor(t,e){for(;(t=t.parentElement)&&!t.classList.contains(e););return t}static setELstyles(t,e){for(const i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t.style[i]=e[i])}static preciseAddition(t,e){const i=(String(t).split(".")[1]||"").length,s=(String(e).split(".")[1]||"").length,a=Math.pow(10,Math.max(i,s));return(Math.round(t*a)+Math.round(e*a))/a}static isNumber(t){return!isNaN(t)&&parseFloat(String(Number(t)))===t&&!isNaN(parseInt(t,10))}static isFloat(t){return Number(t)===t&&t%1!=0}static isMsEdge(){if(d.isSSR())return!1;const t=window.navigator.userAgent,e=t.indexOf("Edge/");return e>0&&parseInt(t.substring(e+5,t.indexOf(".",e)),10)}static getGCD(t,e,i=7){let s=Math.pow(10,i-Math.floor(Math.log10(Math.max(t,e))));for(s>1?(t=Math.round(Math.abs(t)*s),e=Math.round(Math.abs(e)*s)):s=1;e;){const i=e;e=t%e,t=i}return t/s}static getPrimeFactors(t){const e=[];let i=2;for(;t>=2;)t%i==0?(e.push(i),t/=i):i++;return e}static mod(t,e,i=7){const s=Math.pow(10,i-Math.floor(Math.log10(Math.max(t,e))));return(t=Math.round(Math.abs(t)*s))%(e=Math.round(Math.abs(e)*s))/s}};class A{constructor(t){this.w=t,this.months31=[1,3,5,7,8,10,12],this.months30=[2,4,6,9,11],this.daysCntOfYear=[0,31,59,90,120,151,181,212,243,273,304,334]}isValidDate(t){return"number"!=typeof t&&!isNaN(this.parseDate(t))}getTimeStamp(t){if(isNaN(Date.parse(t)))return t;return this.w.config.xaxis.labels.datetimeUTC?new Date(new Date(t).toISOString().substr(0,25)).getTime():new Date(t).getTime()}getDate(t){return this.w.config.xaxis.labels.datetimeUTC?new Date(new Date(t).toUTCString()):new Date(t)}parseDate(t){const e=Date.parse(t);if(!isNaN(e))return this.getTimeStamp(t);let i=Date.parse(t.replace(/-/g,"/").replace(/[a-z]+/gi," "));return i=this.getTimeStamp(i),i}parseDateWithTimezone(t){return Date.parse(t.replace(/-/g,"/").replace(/[a-z]+/gi," "))}formatDate(t,e){const i=this.w.globals.locale,s=this.w.config.xaxis.labels.datetimeUTC,a=["\0",...i.months],r=["\x01",...i.shortMonths],n=["\x02",...i.days],o=["\x03",...i.shortDays];function l(t,e=2){let i=t+"";for(;i.length<e;)i="0"+i;return i}const h=s?t.getUTCFullYear():t.getFullYear();e=(e=(e=e.replace(/(^|[^\\])yyyy+/g,"$1"+h)).replace(/(^|[^\\])yy/g,"$1"+h.toString().substr(2,2))).replace(/(^|[^\\])y/g,"$1"+h);const c=(s?t.getUTCMonth():t.getMonth())+1;e=(e=(e=(e=e.replace(/(^|[^\\])MMMM+/g,"$1"+a[0])).replace(/(^|[^\\])MMM/g,"$1"+r[0])).replace(/(^|[^\\])MM/g,"$1"+l(c))).replace(/(^|[^\\])M/g,"$1"+c);const d=s?t.getUTCDate():t.getDate();e=(e=(e=(e=e.replace(/(^|[^\\])dddd+/g,"$1"+n[0])).replace(/(^|[^\\])ddd/g,"$1"+o[0])).replace(/(^|[^\\])dd/g,"$1"+l(d))).replace(/(^|[^\\])d/g,"$1"+d);const p=s?t.getUTCHours():t.getHours(),u=p>12?p-12:0===p?12:p;e=(e=(e=(e=e.replace(/(^|[^\\])HH+/g,"$1"+l(p))).replace(/(^|[^\\])H/g,"$1"+p)).replace(/(^|[^\\])hh+/g,"$1"+l(u))).replace(/(^|[^\\])h/g,"$1"+u);const g=s?t.getUTCMinutes():t.getMinutes();e=(e=e.replace(/(^|[^\\])mm+/g,"$1"+l(g))).replace(/(^|[^\\])m/g,"$1"+g);const f=s?t.getUTCSeconds():t.getSeconds();e=(e=e.replace(/(^|[^\\])ss+/g,"$1"+l(f))).replace(/(^|[^\\])s/g,"$1"+f);let x=s?t.getUTCMilliseconds():t.getMilliseconds();e=e.replace(/(^|[^\\])fff+/g,"$1"+l(x,3)),x=Math.round(x/10),e=e.replace(/(^|[^\\])ff/g,"$1"+l(x)),x=Math.round(x/10);const m=p<12?"AM":"PM";e=(e=(e=e.replace(/(^|[^\\])f/g,"$1"+x)).replace(/(^|[^\\])TT+/g,"$1"+m)).replace(/(^|[^\\])T/g,"$1"+m.charAt(0));const b=m.toLowerCase();e=(e=e.replace(/(^|[^\\])tt+/g,"$1"+b)).replace(/(^|[^\\])t/g,"$1"+b.charAt(0));let y=-t.getTimezoneOffset(),w=s||!y?"Z":y>0?"+":"-";if(!s){y=Math.abs(y);const t=y%60;w+=l(Math.floor(y/60))+":"+l(t)}e=e.replace(/(^|[^\\])K/g,"$1"+w);const v=(s?t.getUTCDay():t.getDay())+1;return e=(e=(e=(e=(e=e.replace(new RegExp(n[0],"g"),n[v])).replace(new RegExp(o[0],"g"),o[v])).replace(new RegExp(a[0],"g"),a[c])).replace(new RegExp(r[0],"g"),r[c])).replace(/\\(.)/g,"$1")}getTimeUnitsfromTimestamp(t,e){const i=this.w;void 0!==i.config.xaxis.min&&(t=i.config.xaxis.min),void 0!==i.config.xaxis.max&&(e=i.config.xaxis.max);const s=this.getDate(t),a=this.getDate(e),r=this.formatDate(s,"yyyy MM dd HH mm ss fff").split(" "),n=this.formatDate(a,"yyyy MM dd HH mm ss fff").split(" ");return{minMillisecond:parseInt(r[6],10),maxMillisecond:parseInt(n[6],10),minSecond:parseInt(r[5],10),maxSecond:parseInt(n[5],10),minMinute:parseInt(r[4],10),maxMinute:parseInt(n[4],10),minHour:parseInt(r[3],10),maxHour:parseInt(n[3],10),minDate:parseInt(r[2],10),maxDate:parseInt(n[2],10),minMonth:parseInt(r[1],10)-1,maxMonth:parseInt(n[1],10)-1,minYear:parseInt(r[0],10),maxYear:parseInt(n[0],10)}}isLeapYear(t){return t%4==0&&t%100!=0||t%400==0}calculcateLastDaysOfMonth(t,e,i){return this.determineDaysOfMonths(t,e)-i}determineDaysOfYear(t){let e=365;return this.isLeapYear(t)&&(e=366),e}determineRemainingDaysOfYear(t,e,i){let s=this.daysCntOfYear[e]+i;return e>1&&this.isLeapYear(t)&&s++,s}determineDaysOfMonths(t,e){let i=30;switch(t=v.monthMod(t),!0){case this.months30.indexOf(t)>-1:2===t&&(i=this.isLeapYear(e)?29:28);break;case this.months31.indexOf(t)>-1:default:i=31}return i}getDateFields(t,e){const i=new Date(t);return e?{year:i.getUTCFullYear(),month:i.getUTCMonth(),date:i.getUTCDate(),hour:i.getUTCHours(),minute:i.getUTCMinutes(),second:i.getUTCSeconds(),ms:i.getUTCMilliseconds(),weekday:i.getUTCDay()}:{year:i.getFullYear(),month:i.getMonth(),date:i.getDate(),hour:i.getHours(),minute:i.getMinutes(),second:i.getSeconds(),ms:i.getMilliseconds(),weekday:i.getDay()}}addInterval(t,e,i,s){const a=new Date(t);if(s)switch(e){case"year":a.setUTCFullYear(a.getUTCFullYear()+i);break;case"month":a.setUTCMonth(a.getUTCMonth()+i);break;case"week":a.setUTCDate(a.getUTCDate()+7*i);break;case"day":a.setUTCDate(a.getUTCDate()+i);break;case"hour":a.setUTCHours(a.getUTCHours()+i);break;case"minute":a.setUTCMinutes(a.getUTCMinutes()+i);break;case"second":a.setUTCSeconds(a.getUTCSeconds()+i)}else switch(e){case"year":a.setFullYear(a.getFullYear()+i);break;case"month":a.setMonth(a.getMonth()+i);break;case"week":a.setDate(a.getDate()+7*i);break;case"day":a.setDate(a.getDate()+i);break;case"hour":a.setHours(a.getHours()+i);break;case"minute":a.setMinutes(a.getMinutes()+i);break;case"second":a.setSeconds(a.getSeconds()+i)}return a.getTime()}ceilToBoundary(t,e,i,s){const a=new Date(t);if(s)switch(e){case"second":{const e=a.getUTCSeconds(),s=Math.ceil(e/i)*i;return s===e&&0===a.getUTCMilliseconds()?t:(a.setUTCMilliseconds(0),a.setUTCSeconds(s),a.getTime())}case"minute":{const e=a.getUTCMinutes(),s=Math.ceil(e/i)*i;return s===e&&0===a.getUTCSeconds()&&0===a.getUTCMilliseconds()?t:(a.setUTCMilliseconds(0),a.setUTCSeconds(0),a.setUTCMinutes(s),a.getTime())}case"hour":{const e=a.getUTCHours(),s=Math.ceil(e/i)*i;return s===e&&0===a.getUTCMinutes()&&0===a.getUTCSeconds()&&0===a.getUTCMilliseconds()?t:(a.setUTCMilliseconds(0),a.setUTCSeconds(0),a.setUTCMinutes(0),a.setUTCHours(s),a.getTime())}case"day":return 0===a.getUTCHours()&&0===a.getUTCMinutes()&&0===a.getUTCSeconds()&&0===a.getUTCMilliseconds()?t:(a.setUTCMilliseconds(0),a.setUTCSeconds(0),a.setUTCMinutes(0),a.setUTCHours(0),a.setUTCDate(a.getUTCDate()+1),a.getTime());case"week":{const e=6048e5,s=Date.UTC(1970,0,5);a.setUTCMilliseconds(0),a.setUTCSeconds(0),a.setUTCMinutes(0),a.setUTCHours(0);const r=a.getTime(),n=Math.ceil((r-s)/e),o=s+Math.ceil(n/i)*i*e;return o>=t?o:o+i*e}case"month":{const e=a.getUTCMonth(),s=Math.ceil(e/i)*i;return s===e&&1===a.getUTCDate()&&0===a.getUTCHours()&&0===a.getUTCMinutes()&&0===a.getUTCSeconds()&&0===a.getUTCMilliseconds()?t:(a.setUTCMilliseconds(0),a.setUTCSeconds(0),a.setUTCMinutes(0),a.setUTCHours(0),a.setUTCDate(1),a.setUTCMonth(s),a.getTime())}case"year":{const e=a.getUTCFullYear(),s=Math.ceil(e/i)*i;return s===e&&0===a.getUTCMonth()&&1===a.getUTCDate()&&0===a.getUTCHours()&&0===a.getUTCMinutes()&&0===a.getUTCSeconds()&&0===a.getUTCMilliseconds()?t:Date.UTC(s,0,1)}}else switch(e){case"second":{const e=a.getSeconds(),s=Math.ceil(e/i)*i;return s===e&&0===a.getMilliseconds()?t:(a.setMilliseconds(0),a.setSeconds(s),a.getTime())}case"minute":{const e=a.getMinutes(),s=Math.ceil(e/i)*i;return s===e&&0===a.getSeconds()&&0===a.getMilliseconds()?t:(a.setMilliseconds(0),a.setSeconds(0),a.setMinutes(s),a.getTime())}case"hour":{const e=a.getHours(),s=Math.ceil(e/i)*i;return s===e&&0===a.getMinutes()&&0===a.getSeconds()&&0===a.getMilliseconds()?t:(a.setMilliseconds(0),a.setSeconds(0),a.setMinutes(0),a.setHours(s),a.getTime())}case"day":return 0===a.getHours()&&0===a.getMinutes()&&0===a.getSeconds()&&0===a.getMilliseconds()?t:(a.setMilliseconds(0),a.setSeconds(0),a.setMinutes(0),a.setHours(0),a.setDate(a.getDate()+1),a.getTime());case"week":{const e=6048e5,s=new Date(1970,0,5).getTime();a.setMilliseconds(0),a.setSeconds(0),a.setMinutes(0),a.setHours(0);const r=a.getTime(),n=Math.ceil((r-s)/e),o=s+Math.ceil(n/i)*i*e;return o>=t?o:o+i*e}case"month":{const e=a.getMonth(),s=Math.ceil(e/i)*i;return s===e&&1===a.getDate()&&0===a.getHours()&&0===a.getMinutes()&&0===a.getSeconds()&&0===a.getMilliseconds()?t:(a.setMilliseconds(0),a.setSeconds(0),a.setMinutes(0),a.setHours(0),a.setDate(1),a.setMonth(s),a.getTime())}case"year":{const e=a.getFullYear(),s=Math.ceil(e/i)*i;return s===e&&0===a.getMonth()&&1===a.getDate()&&0===a.getHours()&&0===a.getMinutes()&&0===a.getSeconds()&&0===a.getMilliseconds()?t:new Date(s,0,1).getTime()}}return t}isAtBoundary(t,e,i){const s=this.getDateFields(t,i);switch(e){case"year":return 0===s.month&&1===s.date&&0===s.hour&&0===s.minute&&0===s.second&&0===s.ms;case"month":return 1===s.date&&0===s.hour&&0===s.minute&&0===s.second&&0===s.ms;case"day":return 0===s.hour&&0===s.minute&&0===s.second&&0===s.ms;case"hour":return 0===s.minute&&0===s.second&&0===s.ms;case"minute":return 0===s.second&&0===s.ms;case"second":return 0===s.ms}return!1}}class S{constructor(t){this.w=t,this.tooltipKeyFormat="dd MMM"}xLabelFormat(t,e,i,s){const a=this.w;if("datetime"===a.config.xaxis.type&&void 0===a.config.xaxis.labels.formatter&&void 0===a.config.tooltip.x.formatter){const t=new A(this.w);return t.formatDate(t.getDate(e),a.config.tooltip.x.format)}return t(e,i,s)}defaultGeneralFormatter(t){return Array.isArray(t)?t.map(t=>t):t}defaultYFormatter(t,e){const i=this.w;if(v.isNumber(t))if(0!==i.globals.yValueDecimal)t=t.toFixed(void 0!==e.decimalsInFloat?e.decimalsInFloat:i.globals.yValueDecimal);else{const e=t.toFixed(0);t=Number(e)===t?e:t.toFixed(1)}return t}setLabelFormatters(){const t=this.w,e=t.formatters;return e.xaxisTooltipFormatter=t=>this.defaultGeneralFormatter(t),e.ttKeyFormatter=t=>this.defaultGeneralFormatter(t),e.ttZFormatter=t=>t,e.legendFormatter=t=>this.defaultGeneralFormatter(t),void 0!==t.config.xaxis.labels.formatter?e.xLabelFormatter=t.config.xaxis.labels.formatter:e.xLabelFormatter=e=>{if(v.isNumber(e)){if(!t.config.xaxis.convertedCatToNumeric&&"numeric"===t.config.xaxis.type){if(v.isNumber(t.config.xaxis.decimalsInFloat))return e.toFixed(t.config.xaxis.decimalsInFloat);{const i=t.globals.maxX-t.globals.minX;if(i>0){const t=i/10,s=Math.max(0,-Math.floor(Math.log10(t)));return e.toFixed(s)}return e.toFixed(0)}}if(t.globals.isBarHorizontal){if(t.globals.maxY-t.globals.minY<4)return e.toFixed(1)}return e.toFixed(0)}return e},"function"==typeof t.config.tooltip.x.formatter?e.ttKeyFormatter=t.config.tooltip.x.formatter:e.ttKeyFormatter=e.xLabelFormatter,"function"==typeof t.config.xaxis.tooltip.formatter&&(e.xaxisTooltipFormatter=t.config.xaxis.tooltip.formatter),(Array.isArray(t.config.tooltip.y)||void 0!==t.config.tooltip.y.formatter)&&(e.ttVal=t.config.tooltip.y),void 0!==t.config.tooltip.z.formatter&&(e.ttZFormatter=t.config.tooltip.z.formatter),void 0!==t.config.legend.formatter&&(e.legendFormatter=t.config.legend.formatter),e.yLabelFormatters=[],t.config.yaxis.forEach((i,s)=>{if(void 0!==i.labels.formatter)e.yLabelFormatters[s]=i.labels.formatter;else if("violin"===t.config.chart.type){const i=t=>"number"==typeof t&&isFinite(t)?""+Math.round(100*t)/100:t;e.yLabelFormatters[s]=e=>t.globals.xyCharts?Array.isArray(e)?e.map(i):i(e):e}else e.yLabelFormatters[s]=e=>t.globals.xyCharts?Array.isArray(e)?e.map(t=>this.defaultYFormatter(t,i)):this.defaultYFormatter(e,i):e}),t.globals}heatmapLabelFormatters(){const t=this.w;if("heatmap"===t.config.chart.type){t.globals.yAxisScale[0].result=t.seriesData.seriesNames.slice();const e=t.seriesData.seriesNames.reduce((t,e)=>t.length>e.length?t:e,0);t.globals.yAxisScale[0].niceMax=e,t.globals.yAxisScale[0].niceMin=e}}}const C={name:"en",options:{months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],toolbar:{exportToSVG:"Download SVG",exportToPNG:"Download PNG",exportToCSV:"Download CSV",menu:"Menu",selection:"Selection",selectionZoom:"Selection Zoom",zoomIn:"Zoom In",zoomOut:"Zoom Out",pan:"Panning",reset:"Reset Zoom",measure:"Measure"}}};class k{constructor(){this.yAxis={show:!0,showAlways:!1,showForNullSeries:!0,seriesName:void 0,opposite:!1,reversed:!1,logarithmic:!1,logBase:10,tickAmount:void 0,stepSize:void 0,forceNiceScale:!1,alignZero:!1,max:void 0,min:void 0,floating:!1,decimalsInFloat:void 0,labels:{show:!0,showDuplicates:!1,minWidth:0,maxWidth:160,offsetX:0,offsetY:0,align:void 0,rotate:0,padding:20,style:{colors:[],fontSize:"11px",fontWeight:400,fontFamily:void 0,cssClass:""},formatter:void 0},axisBorder:{show:!1,color:"#e0e0e0",width:1,offsetX:0,offsetY:0},axisTicks:{show:!1,color:"#e0e0e0",width:6,offsetX:0,offsetY:0},title:{text:void 0,rotate:-90,offsetY:0,offsetX:0,style:{color:void 0,fontSize:"11px",fontWeight:900,fontFamily:void 0,cssClass:""}},tooltip:{enabled:!1,offsetX:0},crosshairs:{show:!0,position:"front",stroke:{color:"#b6b6b6",width:1,dashArray:0}}},this.pointAnnotation={id:void 0,x:0,y:null,yAxisIndex:0,seriesIndex:void 0,mouseEnter:void 0,mouseLeave:void 0,click:void 0,marker:{size:4,fillColor:"#fff",strokeWidth:2,strokeColor:"#333",shape:"circle",offsetX:0,offsetY:0,cssClass:""},label:{borderColor:"#c2c2c2",borderWidth:1,borderRadius:2,text:void 0,textAnchor:"middle",offsetX:0,offsetY:0,mouseEnter:void 0,mouseLeave:void 0,click:void 0,style:{background:"#fff",color:void 0,fontSize:"11px",fontFamily:void 0,fontWeight:400,cssClass:"",padding:{left:5,right:5,top:2,bottom:2}}},customSVG:{SVG:void 0,cssClass:void 0,offsetX:0,offsetY:0},image:{path:void 0,width:20,height:20,offsetX:0,offsetY:0},tooltip:{enabled:!1,text:void 0,formatter:void 0,theme:void 0,offsetX:0,offsetY:0}},this.yAxisAnnotation={id:void 0,y:0,y2:null,strokeDashArray:1,fillColor:"#c2c2c2",borderColor:"#c2c2c2",borderWidth:1,opacity:.3,offsetX:0,offsetY:0,width:"100%",yAxisIndex:0,label:{borderColor:"#c2c2c2",borderWidth:1,borderRadius:2,text:void 0,textAnchor:"end",position:"right",offsetX:0,offsetY:-3,mouseEnter:void 0,mouseLeave:void 0,click:void 0,style:{background:"#fff",color:void 0,fontSize:"11px",fontFamily:void 0,fontWeight:400,cssClass:"",padding:{left:5,right:5,top:2,bottom:2}}}},this.xAxisAnnotation={id:void 0,x:0,x2:null,strokeDashArray:1,fillColor:"#c2c2c2",borderColor:"#c2c2c2",borderWidth:1,opacity:.3,offsetX:0,offsetY:0,label:{borderColor:"#c2c2c2",borderWidth:1,borderRadius:2,text:void 0,textAnchor:"middle",orientation:"vertical",position:"top",offsetX:0,offsetY:0,mouseEnter:void 0,mouseLeave:void 0,click:void 0,style:{background:"#fff",color:void 0,fontSize:"11px",fontFamily:void 0,fontWeight:400,cssClass:"",padding:{left:5,right:5,top:2,bottom:2}}}},this.text={x:0,y:0,text:"",textAnchor:"start",foreColor:void 0,fontSize:"13px",fontFamily:void 0,fontWeight:400,appendTo:".apexcharts-annotations",backgroundColor:"transparent",borderColor:"#c2c2c2",borderRadius:0,borderWidth:0,paddingLeft:4,paddingRight:4,paddingTop:2,paddingBottom:2}}init(){return{annotations:{yaxis:[this.yAxisAnnotation],xaxis:[this.xAxisAnnotation],points:[this.pointAnnotation],texts:[],images:[],shapes:[]},plugins:[],trellis:{by:void 0,row:void 0,column:void 0,emptyPanels:"placeholder",data:void 0,x:void 0,y:void 0,seriesBy:void 0,columns:"auto",minPanelWidth:220,gap:12,aspectRatio:1.6,panelHeight:void 0,order:"first-seen",limit:void 0,virtualize:"auto",scales:{x:"shared",y:"shared",color:"shared",size:"shared"},header:{show:!0,formatter:void 0,style:{fontSize:void 0,fontWeight:void 0,color:void 0}},axes:{labels:"edges"},legend:"shared",toolbar:"shared",tooltip:"panel",zoom:"sync",promote:!0,radiusByTotal:!1,targetTicks:3,panel:void 0},chart:{animations:{enabled:!0,speed:800,easing:"easeInOutSine",animateGradually:{delay:150,enabled:!0},dynamicAnimation:{enabled:!0,speed:350,easing:void 0},chartTypeMorph:{enabled:!0,speed:600},respectReducedMotion:!0,largeDatasetThreshold:1e3},background:"",locales:[C],defaultLocale:"en",perspectives:{serializeOptions:["theme","xaxis","yaxis","title","subtitle"]},history:{enabled:!1,maxDepth:100,coalesceMs:250,keyboard:!0},renderer:"svg",rendererThreshold:8e3,layers:{series:"auto",grid:"svg",annotations:"svg",dataLabels:"svg"},dropShadow:{enabled:!1,enabledOnSeries:void 0,top:2,left:2,blur:4,color:"#000",opacity:.7},events:{animationEnd:void 0,beforeMount:void 0,mounted:void 0,updated:void 0,click:void 0,mouseMove:void 0,mouseLeave:void 0,xAxisLabelClick:void 0,legendClick:void 0,markerClick:void 0,selection:void 0,dataPointSelection:void 0,dataPointMouseEnter:void 0,dataPointMouseLeave:void 0,beforeZoom:void 0,beforeResetZoom:void 0,zoomed:void 0,scrolled:void 0,brushScrolled:void 0,crossFilter:void 0,filterChange:void 0,annotationDragged:void 0,annotationEdited:void 0,annotationCreated:void 0,annotationStyled:void 0,annotationDeleted:void 0,measured:void 0,keyDown:void 0,keyUp:void 0},foreColor:"#373d3f",fontFamily:"Helvetica, Arial, sans-serif",height:"auto",parentHeightOffset:15,redrawOnParentResize:!0,redrawOnWindowResize:!0,id:void 0,group:void 0,nonce:void 0,license:void 0,offsetX:0,offsetY:0,injectStyleSheet:!0,selection:{enabled:!1,type:"x",fill:{color:"#24292e",opacity:.1},stroke:{width:1,color:"#24292e",opacity:.4,dashArray:3},xaxis:{min:void 0,max:void 0},yaxis:{min:void 0,max:void 0}},sparkline:{enabled:!1},brush:{enabled:!1,autoScaleYaxis:!0,target:void 0,targets:void 0},link:{enabled:!1,mode:"highlight",dimOpacity:.2,id:void 0,dimension:void 0,reduce:void 0,type:void 0,bins:void 0,order:void 0,seriesName:void 0},ink:{enabled:!1,palette:!1,snap:!1,noteColors:void 0},measure:{enabled:!1,mode:"span",key:"m",pinOnRelease:!0,colors:{up:void 0,down:void 0,neutral:void 0,guide:void 0},band:!0,guides:!0,markers:!0,format:{x:void 0,y:void 0,percent:void 0},label:void 0},contextMenu:{enabled:!1,items:["annotate","xline","yline","measure"],labels:{annotate:void 0,xline:void 0,yline:void 0,measure:void 0},noteText:"Note",line:{text:"",strokeDashArray:4,color:void 0}},stacked:!1,stackOnlyBar:!0,stackType:"normal",streaming:{enabled:!1,maxPoints:void 0},toolbar:{show:!0,offsetX:0,offsetY:0,tools:{download:!0,selection:!0,zoom:!0,zoomin:!0,zoomout:!0,pan:!0,reset:!0,measure:!0,customIcons:[]},export:{csv:{filename:void 0,columnDelimiter:",",headerCategory:"category",headerValue:"value",categoryFormatter:void 0,valueFormatter:void 0},png:{filename:void 0},svg:{filename:void 0},scale:void 0,width:void 0,embedFonts:!0},autoSelected:"zoom"},type:"line",width:"100%",zoom:{enabled:!0,type:"x",autoScaleYaxis:!1,allowMouseWheelZoom:"auto",pinch:"auto",zoomedArea:{fill:{color:"#90CAF9",opacity:.4},stroke:{color:"#0D47A1",opacity:.4,width:1}}},pan:{inertia:!0,friction:.92},accessibility:{enabled:!0,description:void 0,announcements:{enabled:!0},keyboard:{enabled:!0,navigation:{enabled:!0,wrapAround:!1}}},dataReducer:{enabled:!1,algorithm:"lttb",targetPoints:250,threshold:500}},parsing:{x:void 0,y:void 0},plotOptions:{line:{isSlopeChart:!1,colors:{threshold:0,colorAboveThreshold:void 0,colorBelowThreshold:void 0}},area:{fillTo:"origin"},bar:{horizontal:!1,columnWidth:"70%",barHeight:"70%",distributed:!1,borderRadius:0,borderRadiusApplication:"around",rangeBarOverlap:!0,rangeBarGroupRows:!1,hideZeroBarsWhenGrouped:!1,isDumbbell:!1,dumbbellColors:void 0,isFunnel:!1,isFunnel3d:!0,colors:{ranges:[],backgroundBarColors:[],backgroundBarOpacity:1,backgroundBarRadius:0},dataLabels:{position:"top",maxItems:100,hideOverflowingLabels:!0,orientation:"horizontal",total:{enabled:!1,formatter:void 0,offsetX:0,offsetY:0,style:{color:"#373d3f",fontSize:"12px",fontFamily:void 0,fontWeight:600}}}},bubble:{zScaling:!0,minBubbleRadius:void 0,maxBubbleRadius:void 0,minZ:void 0,maxZ:void 0},scatter:{jitter:{enabled:!1,x:0,y:0,distributed:!1,maxPoints:5e3}},candlestick:{colors:{upward:"#00B746",downward:"#EF403C"},wick:{useFillColor:!0}},boxPlot:{colors:{upper:"#00E396",lower:"#008FFB"},whiskers:"minmax",points:{show:!1,shape:"circle",size:2.5,jitter:.5,maxPoints:3e3,opacity:.9,fillColor:"series-dark",strokeColor:"#fff",strokeWidth:1}},violin:{bandwidthScale:1,kde:{bandwidth:void 0,resolution:64},normalize:"individual",points:{show:!0,shape:"circle",size:2.5,jitter:.5,constrainToViolin:!0,maxPoints:3e3,opacity:.9,fillColor:"series-dark",strokeColor:"#fff",strokeWidth:1}},histogram:{bins:"auto",binWidth:void 0,range:void 0,normalize:"count",cumulative:!1,overlap:!0},heatmap:{radius:2,enableShades:!0,shadeIntensity:.5,reverseNegativeShade:!1,distributed:!1,useFillColorAsStroke:!1,colorScale:{inverse:!1,ranges:[],min:void 0,max:void 0,gradientLegend:{enabled:!1,width:"70%",height:"70%",thickness:12,align:"center",stops:16,showLabels:!0,showHoverValue:!0,labelStyle:{fontSize:"11px",fontFamily:void 0,colors:void 0},arrow:{size:8,color:void 0},formatter:void 0}}},funnel:{shape:"rectangle",lastShape:"flat"},treemap:{enableShades:!0,shadeIntensity:.5,distributed:!1,reverseNegativeShade:!1,useFillColorAsStroke:!1,borderRadius:4,dataLabels:{format:"scale",minFontSize:4},colorScale:{inverse:!1,ranges:[],min:void 0,max:void 0,colorValue:void 0,gradient:{enabled:void 0,min:void 0,max:void 0,midpoint:void 0,symmetric:!0,colors:void 0,stops:void 0},gradientLegend:{enabled:!1,width:"70%",height:"70%",thickness:12,align:"center",stops:16,showLabels:!0,showHoverValue:!0,labelStyle:{fontSize:"11px",fontFamily:void 0,colors:void 0},arrow:{size:8,color:void 0},formatter:void 0}},nested:{enabled:void 0,drilldownAsLevels:!1},parents:{show:"auto",padding:4,fill:void 0,fillOpacity:1,borderColor:void 0,borderWidth:1,borderRadius:void 0,hover:{show:!0,color:void 0,width:2},header:{show:!0,height:22,minWidth:40,align:"left",offsetX:0,offsetY:0,showValue:!1,formatter:void 0,style:{fontSize:"12px",fontFamily:void 0,fontWeight:600,color:void 0,background:void 0,cssClass:""}},tooltip:{formatter:void 0}},levels:[],zoom:{enabled:!1,breadcrumb:void 0},seriesTitle:{show:!0,offsetY:1,offsetX:1,borderColor:"#000",borderWidth:1,borderRadius:2,style:{background:"rgba(0, 0, 0, 0.6)",color:"#fff",fontSize:"12px",fontFamily:void 0,fontWeight:400,cssClass:"",padding:{left:6,right:6,top:2,bottom:2}}}},unit:{layout:"grouped",positions:void 0,transition:"group",shape:"circle",image:{src:void 0,width:20,height:20,tint:!1},pictogram:{mark:void 0,fit:"contain",scale:1,padding:0,fallback:"circle"},size:"auto",columns:{size:"inherit"},grid:{columns:10,total:void 0,fillFrom:"bottom",split:!1,tileColumns:void 0,max:void 0,trackColor:void 0},scatter:{y:"lanes",spread:"swarm",orientation:"horizontal",tickAmount:5,xMin:void 0,xMax:void 0,xTitle:void 0,xFormatter:void 0,yTickAmount:5,yMin:void 0,yMax:void 0,yTitle:void 0,yFormatter:void 0,sizeField:"z",sizeRange:void 0,laneLabelWidth:void 0,gridlines:!0},sizeByValue:{enabled:!1,maxRadius:"auto",minRadius:void 0,scale:"area"},spacing:1.05,borderRadius:0,gather:{motion:"auto",spring:"crisp",easing:"outCubic",overshoot:1.70158,enter:"burst"},arc:{startAngle:-90,endAngle:90,innerRadiusRatio:.4,rows:"auto"},unitValue:1,maxUnits:5e3,sortByGroup:!0,clusterLabels:{show:!0,position:"top",curved:!0,fontSize:"13px",fontFamily:void 0,fontWeight:600,color:void 0,offsetY:0,formatter:void 0,external:{show:!1,connector:{show:!0,width:1.5,color:void 0,gap:8,length:22},offsetX:0,offsetY:0}},tooltip:{formatter:void 0}},radialBar:{inverseOrder:!1,startAngle:0,endAngle:360,offsetX:0,offsetY:0,shape:"arc",min:0,max:100,bands:[],bandsStyle:{strokeWidth:"40%",gap:0,hideTrackWhenPresent:!0},ticks:{show:!1,major:{count:11,length:10,width:2,color:"#666",placement:"outside"},minor:{count:4,length:5,width:1,color:"#999",placement:"outside"},labels:{show:!1,offset:6,fontSize:"11px",fontFamily:void 0,fontWeight:400,color:"#666",formatter:t=>String(t)}},needle:{color:"#333",length:"85%",baseWidth:4,tipWidth:1,offsetY:0,showValueArc:!1,animation:{enabled:!0,duration:800,easing:"ease-out"}},hollow:{margin:5,size:"50%",background:"transparent",image:void 0,imageWidth:150,imageHeight:150,imageOffsetX:0,imageOffsetY:0,imageClipped:!0,position:"front",stroke:void 0,strokeWidth:1,strokeDasharray:void 0,dropShadow:{enabled:!1,top:0,left:0,blur:3,color:"#000",opacity:.5}},track:{show:!0,startAngle:void 0,endAngle:void 0,background:"#f2f2f2",strokeWidth:"97%",opacity:1,margin:5,dropShadow:{enabled:!1,top:0,left:0,blur:3,color:"#000",opacity:.5}},dataLabels:{show:!0,name:{show:!0,fontSize:"16px",fontFamily:void 0,fontWeight:600,color:void 0,offsetY:0,formatter:t=>t},value:{show:!0,fontSize:"14px",fontFamily:void 0,fontWeight:400,color:void 0,offsetY:16,formatter:t=>t+"%"},total:{show:!1,label:"Total",fontSize:"16px",fontWeight:600,fontFamily:void 0,color:void 0,formatter:t=>t.globals.seriesTotals.reduce((t,e)=>t+e,0)/t.seriesData.series.length+"%"}},barLabels:{enabled:!1,offsetX:0,offsetY:0,useSeriesColors:!0,fontFamily:void 0,fontWeight:600,fontSize:"16px",formatter:t=>t,onClick:void 0}},pie:{customScale:1,offsetX:0,offsetY:0,startAngle:0,endAngle:360,expandOnClick:!0,expandOffset:10,hoverOutline:{show:!0,size:8,gap:0,opacity:.3,color:void 0},borderRadius:0,spacing:0,dataLabels:{offset:0,minAngleToShowLabel:10,external:{show:!1,offsetX:0,offsetY:0,fontSize:void 0,fontFamily:void 0,fontWeight:void 0,color:void 0,formatter:void 0,connector:{show:!0,width:1,color:void 0,length:16,gap:6}}},donut:{size:"65%",background:"transparent",labels:{show:!1,name:{show:!0,fontSize:"16px",fontFamily:void 0,fontWeight:600,color:void 0,offsetY:-10,formatter:t=>t},value:{show:!0,fontSize:"20px",fontFamily:void 0,fontWeight:400,color:void 0,offsetY:10,formatter:t=>t},total:{show:!1,showAlways:!1,label:"Total",fontSize:"16px",fontWeight:400,fontFamily:void 0,color:void 0,formatter:t=>t.globals.seriesTotals.reduce((t,e)=>t+e,0)}}}},polarArea:{rings:{strokeWidth:1,strokeColor:"#e8e8e8"},spokes:{strokeWidth:1,connectorColors:"#e8e8e8"}},sunburst:{offsetX:0,offsetY:0,startAngle:0,endAngle:360,innerSize:"15%",borderRadius:0,spacing:1,leaf:"extend",partition:"normalize",tint:.14,zoomOnClick:!0,dataLabels:{show:!0,minAngleToShow:8,style:{fontSize:"12px",fontFamily:void 0,fontWeight:400,colors:void 0}}},radar:{size:void 0,offsetX:0,offsetY:0,polygons:{strokeWidth:1,strokeColors:"#e8e8e8",connectorColors:"#e8e8e8",fill:{colors:void 0}}}},colors:void 0,dataLabels:{enabled:!0,enabledOnSeries:void 0,formatter:t=>null!==t?t:"",textAnchor:"middle",distributed:!1,offsetX:0,offsetY:0,style:{fontSize:"12px",fontFamily:void 0,fontWeight:600,colors:void 0},background:{enabled:!0,foreColor:"#fff",backgroundColor:void 0,borderRadius:2,padding:4,opacity:.9,borderWidth:1,borderColor:"#fff",dropShadow:{enabled:!1,top:1,left:1,blur:1,color:"#000",opacity:.8}},dropShadow:{enabled:!1,top:1,left:1,blur:1,color:"#000",opacity:.8},animate:{enabled:!0},countUp:{enabled:!1}},fill:{type:"solid",colors:void 0,opacity:.85,gradient:{shade:"dark",type:"horizontal",shadeIntensity:.5,gradientToColors:void 0,inverseColors:!0,opacityFrom:1,opacityTo:1,stops:[0,50,100],colorStops:[]},image:{src:[],width:void 0,height:void 0},pattern:{style:"squares",width:6,height:6,strokeWidth:2}},forecastDataPoints:{count:0,fillOpacity:.5,strokeWidth:void 0,dashArray:4},grid:{show:!0,borderColor:"#e0e0e0",strokeDashArray:0,position:"back",xaxis:{lines:{show:!1}},yaxis:{lines:{show:!0}},row:{colors:void 0,opacity:.5},column:{colors:void 0,opacity:.5},padding:{top:0,right:10,bottom:0,left:12}},labels:[],drilldown:{enabled:!1,series:[],breadcrumb:{show:!0,position:"top-left",separator:" / ",rootLabel:"All",offsetX:0,offsetY:0},animation:{enabled:!0,zoomFromPoint:!1,speed:260},loading:{show:!0},cache:!0,marker:{show:!0,size:6,strokeColor:"#fff"}},legend:{show:!0,showForSingleSeries:!1,showForNullSeries:!0,showForZeroSeries:!0,floating:!1,position:"bottom",horizontalAlign:"center",inverseOrder:!1,fontSize:"12px",fontFamily:void 0,fontWeight:400,width:void 0,height:void 0,formatter:void 0,tooltipHoverFormatter:void 0,offsetX:-20,offsetY:4,customLegendItems:[],clusterGroupedSeries:!0,clusterGroupedSeriesOrientation:"vertical",labels:{colors:void 0,useSeriesColors:!1},markers:{size:7,fillColors:void 0,strokeWidth:1,shape:void 0,offsetX:0,offsetY:0,customHTML:void 0,onClick:void 0},itemMargin:{horizontal:5,vertical:4},onItemClick:{toggleDataSeries:!0},onItemHover:{highlightDataSeries:!0}},markers:{discrete:[],size:0,colors:void 0,strokeColors:"#fff",strokeWidth:2,strokeOpacity:.9,strokeDashArray:0,fillOpacity:1,shape:"circle",offsetX:0,offsetY:0,showNullDataPoints:!0,onClick:void 0,onDblClick:void 0,hover:{size:void 0,sizeOffset:3},largeDatasetThreshold:0},noData:{text:void 0,align:"center",offsetX:0,offsetY:0,style:{color:void 0,fontSize:"14px",fontFamily:void 0}},responsive:[],series:void 0,states:{hover:{filter:{type:"lighten",value:.15}},active:{allowMultipleDataPointsSelection:!1,filter:{type:"darken",value:.35}}},title:{text:void 0,align:"left",margin:5,offsetX:0,offsetY:0,floating:!1,style:{fontSize:"14px",fontWeight:900,fontFamily:void 0,color:void 0}},subtitle:{text:void 0,align:"left",margin:5,offsetX:0,offsetY:30,floating:!1,style:{fontSize:"12px",fontWeight:400,fontFamily:void 0,color:void 0}},stroke:{show:!0,curve:"smooth",lineCap:"butt",width:2,colors:void 0,dashArray:0,fill:{type:"solid",colors:void 0,opacity:.85,gradient:{shade:"dark",type:"horizontal",shadeIntensity:.5,gradientToColors:void 0,inverseColors:!0,opacityFrom:1,opacityTo:1,stops:[0,50,100],colorStops:[]}}},tooltip:{enabled:!0,enabledOnSeries:void 0,shared:!0,hideEmptySeries:!1,followCursor:!1,intersect:!1,inverseOrder:!1,arrow:!0,compact:!1,custom:void 0,fillSeriesColor:!1,theme:"light",cssClass:"",style:{fontSize:"12px",fontFamily:void 0,background:void 0},onDatasetHover:{highlightDataSeries:!1},x:{show:!0,format:"dd MMM",formatter:void 0},y:{formatter:void 0,title:{formatter:t=>t?t+": ":""}},z:{formatter:void 0,title:"Size: "},marker:{show:!0,fillColors:void 0},items:{display:"flex"},fixed:{enabled:!1,position:"topRight",offsetX:0,offsetY:0}},xaxis:{type:"category",categories:[],convertedCatToNumeric:!1,offsetX:0,offsetY:0,overwriteCategories:void 0,labels:{show:!0,rotate:-45,rotateAlways:!1,hideOverlappingLabels:!0,trim:!1,minHeight:void 0,maxHeight:120,showDuplicates:!0,style:{colors:[],fontSize:"12px",fontWeight:400,fontFamily:void 0,cssClass:""},offsetX:0,offsetY:0,format:void 0,formatter:void 0,datetimeUTC:!0,datetimeFormatter:{year:"yyyy",month:"MMM",day:"dd MMM",hour:"HH:mm",minute:"HH:mm",second:"HH:mm:ss"}},group:{groups:[],style:{colors:[],fontSize:"12px",fontWeight:400,fontFamily:void 0,cssClass:""}},axisBorder:{show:!0,color:"#e0e0e0",width:"100%",height:1,offsetX:0,offsetY:0},axisTicks:{show:!0,color:"#e0e0e0",height:6,offsetX:0,offsetY:0},stepSize:void 0,tickAmount:void 0,tickPlacement:"on",min:void 0,max:void 0,range:void 0,floating:!1,decimalsInFloat:void 0,position:"bottom",title:{text:void 0,offsetX:0,offsetY:0,style:{color:void 0,fontSize:"12px",fontWeight:900,fontFamily:void 0,cssClass:""}},crosshairs:{show:!0,width:1,position:"back",opacity:.9,stroke:{color:"#b6b6b6",width:1,dashArray:3},fill:{type:"solid",color:"#B1B9C4",gradient:{colorFrom:"#D8E3F0",colorTo:"#BED1E6",stops:[0,100],opacityFrom:.4,opacityTo:.5}},dropShadow:{enabled:!1,left:0,top:0,blur:1,opacity:.8}},tooltip:{enabled:!1,offsetY:0,formatter:void 0,style:{fontSize:"12px",fontFamily:void 0}}},yaxis:this.yAxis,theme:{mode:"",palette:"palette1",tokens:!0,follow:!1,name:"",monochrome:{enabled:!1,color:"#008FFB",shadeTo:"light",shadeIntensity:.65},accessibility:{colorBlindMode:""}}}}}const _="_apexOwnedByType",M=(t,e)=>(e[_]=t,e),D=["tooltip.custom","tooltip.shared","tooltip.intersect","tooltip.followCursor","dataLabels.enabled","dataLabels.formatter","plotOptions.bar.dataLabels.position","markers.size","states.hover.filter.type","states.active.filter.type","xaxis.crosshairs.width","xaxis.tickPlacement","xaxis.tooltip.enabled","chart.zoom.enabled","chart.animations.dynamicAnimation.enabled"],L=(t,e)=>{let i=t;for(const t of e.split(".")){if(null==i||"object"!=typeof i)return;i=i[t]}return i},P=(t,e,i)=>{const s=e.split("."),a=s.pop();let r=t;for(const t of s)null!=r[t]&&"object"==typeof r[t]||(r[t]={}),r=r[t];void 0===i?delete r[a]:r[a]=i},E={funnel:"bar",pyramid:"bar",gauge:"radialBar",waffle:"unit",histogram:"bar"},T=(t,e)=>{var i,s;const a=E[t];return{chart:{type:a||t,requestedType:a?t:void 0,stacked:null==(i=e.chart)?void 0:i.stacked},plotOptions:{bar:{isFunnel:"funnel"===t||"pyramid"===t},histogram:null==(s=e.plotOptions)?void 0:s.histogram},series:e.series,yaxis:[{title:{},labels:{},axisBorder:{},axisTicks:{}}]}},F=(t,e)=>{if("function"==typeof t)return!!Array.isArray(t[_])||"function"==typeof e&&String(t)===String(e);if("function"==typeof e)return void 0===t;if(t===e)return!0;try{return JSON.stringify(t)===JSON.stringify(e)}catch(t){return!1}},I=({isTimeline:t,seriesIndex:e,dataPointIndex:i,y1:s,y2:a,w:r})=>{var n;let o=r.rangeData.seriesRangeStart[e][i],l=r.rangeData.seriesRangeEnd[e][i],h=r.labelData.labels[i],c=r.config.series[e].name?r.config.series[e].name:"";const d=r.formatters.ttKeyFormatter,p=r.config.tooltip.y.title.formatter,u={w:r,seriesIndex:e,dataPointIndex:i,start:o,end:l};if("function"==typeof p&&(c=p(c,u)),(null==(n=r.config.series[e].data[i])?void 0:n.x)&&(h=r.config.series[e].data[i].x),!t&&"datetime"===r.config.xaxis.type){h=new S(r).xLabelFormat(r.formatters.ttKeyFormatter,h,h,{i:void 0,dateFormatter:new A(r).formatDate,w:r})}"function"==typeof d&&(h=d(h,u)),Number.isFinite(s)&&Number.isFinite(a)&&(o=s,l=a);let g="",f="";const x=r.globals.colors[e];if(void 0===r.config.tooltip.x.formatter)if("datetime"===r.config.xaxis.type){const t=new A(r);g=t.formatDate(t.getDate(o),r.config.tooltip.x.format),f=t.formatDate(t.getDate(l),r.config.tooltip.x.format)}else g=o,f=l;else g=r.config.tooltip.x.formatter(o),f=r.config.tooltip.x.formatter(l);return{start:o,end:l,startVal:g,endVal:f,ylabel:h,color:x,seriesName:c}},R=t=>{let{color:e,seriesName:i,ylabel:s,start:a,end:r,seriesIndex:n,dataPointIndex:o}=t;const l=t.w.globals.tooltip.tooltipLabels.getFormatters(n);a=l.yLbFormatter(a),r=l.yLbFormatter(r);const h=l.yLbFormatter(t.w.seriesData.series[n][o]);let c="";const d=`<span class="value start-value">\n  ${a}\n  </span> <span class="separator">-</span> <span class="value end-value">\n  ${r}\n  </span>`;return c=t.w.globals.comboCharts?"rangeArea"===t.w.config.series[n].type||"rangeBar"===t.w.config.series[n].type?d:`<span>${h}</span>`:d,'<div class="apexcharts-tooltip-rangebar"><div> <span class="series-name" style="color: '+e+'">'+(i||"")+'</span></div><div> <span class="category">'+s+": </span> "+c+" </div></div>"};class X{constructor(t){this.opts=t}static forType(t){var e,i;const s=new X(t),a=t.chart.requestedType;let r;return r="funnel"===a||"pyramid"===a?s[a]():"gauge"===a?s.gauge():"histogram"===a?s.histogram():-1!==["line","area","bar","candlestick","boxPlot","violin","rangeBar","rangeArea","bubble","scatter","heatmap","treemap","unit","sunburst","pie","polarArea","donut","radar","radialBar"].indexOf(t.chart.type)?s[t.chart.type]():s.line(),(null==(i=null==(e=t.plotOptions)?void 0:e.bar)?void 0:i.isFunnel)&&(r=s.funnel()),t.chart.stacked&&"bar"===t.chart.type&&(r=s.stackedBars()),r}static handOverTypeDefaults(t,e,i){const s=t.chart.requestedType||t.chart.type;if(!e||e===s)return;const a=(new k).init(),r=v.extend(a,X.forType(T(e,t))),n=v.extend(a,X.forType(T(s,t)));for(const e of D){if(i&&void 0!==L(i,e))continue;const s=L(r,e),a=L(n,e);void 0===s&&void 0===a||F(L(t,e),s)&&P(t,e,a)}}hideYAxis(){this.opts.yaxis[0].show=!1,this.opts.yaxis[0].title.text="",this.opts.yaxis[0].axisBorder.show=!1,this.opts.yaxis[0].axisTicks.show=!1,this.opts.yaxis[0].floating=!0}line(){return{dataLabels:{enabled:!1},stroke:{width:5,curve:"straight"},markers:{size:0,hover:{sizeOffset:6}},xaxis:{crosshairs:{width:1}}}}sparkline(t){this.hideYAxis();return v.extend(t,{grid:{show:!1,padding:{left:0,right:0,top:0,bottom:0}},legend:{show:!1},xaxis:{labels:{show:!1},tooltip:{enabled:!1},axisBorder:{show:!1},axisTicks:{show:!1}},chart:{toolbar:{show:!1},zoom:{enabled:!1}},dataLabels:{enabled:!1}})}slope(){return this.hideYAxis(),{chart:{toolbar:{show:!1},zoom:{enabled:!1}},dataLabels:{enabled:!0,formatter(t,e){const i=e.w.config.series[e.seriesIndex].name;return null!==t?i+": "+t:""},background:{enabled:!1},offsetX:-5},grid:{xaxis:{lines:{show:!0}},yaxis:{lines:{show:!1}}},xaxis:{position:"top",labels:{style:{fontSize:14,fontWeight:900}},tooltip:{enabled:!1},crosshairs:{show:!1}},markers:{size:8,hover:{sizeOffset:1}},legend:{show:!1},tooltip:{shared:!1,intersect:!0,followCursor:!0},stroke:{width:5,curve:"straight"}}}bar(){return{chart:{stacked:!1},plotOptions:{bar:{dataLabels:{position:"center"}}},dataLabels:{style:{colors:["#fff"]},background:{enabled:!1}},stroke:{width:0,lineCap:"square"},fill:{opacity:.85},legend:{markers:{shape:"square"}},tooltip:{shared:!1,intersect:!0},xaxis:{tooltip:{enabled:!1},tickPlacement:"between",crosshairs:{width:"barWidth",position:"back",fill:{type:"gradient"},dropShadow:{enabled:!1},stroke:{width:0}}}}}funnel(){return this.hideYAxis(),l(o({},this.bar()),{chart:{animations:{speed:800,animateGradually:{enabled:!1}}},plotOptions:{bar:{horizontal:!0,borderRadiusApplication:"around",borderRadius:0,dataLabels:{position:"center"}}},grid:{show:!1,padding:{left:0,right:0}},xaxis:{labels:{show:!1},tooltip:{enabled:!1},axisBorder:{show:!1},axisTicks:{show:!1}}})}pyramid(){return this.funnel()}gauge(){const t=this.radialBar();return l(o({},t),{plotOptions:{radialBar:{startAngle:-135,endAngle:135,hollow:{margin:0,size:"60%"},track:{background:"#e7e7e7",strokeWidth:"100%",margin:5},dataLabels:{name:{show:!1},value:{show:!0,fontSize:"32px",fontWeight:600,offsetY:8}}}}})}histogram(){var t,e,i,s;const a=Array.isArray(null==(t=this.opts)?void 0:t.series)&&this.opts.series.length>1&&!1!==(null==(s=null==(i=null==(e=this.opts)?void 0:e.plotOptions)?void 0:i.histogram)?void 0:s.overlap);return l(o({},this.bar()),{chart:{stacked:!1,zoom:{enabled:!1},animations:{animateGradually:{enabled:!1}}},plotOptions:{bar:{columnWidth:"100%",borderRadius:0,dataLabels:{position:"top"}}},dataLabels:{enabled:!1},fill:a?{opacity:.65}:{},stroke:a?{show:!1}:{show:!0,width:1,colors:["#fff"]},xaxis:{type:"numeric",tooltip:{enabled:!1}},tooltip:{shared:a,intersect:!1,x:{formatter:(t,e)=>{var i,s;const a=null==(s=null==(i=null==e?void 0:e.w)?void 0:i.histogramData)?void 0:s.edges,r=null==e?void 0:e.dataPointIndex;if(!Array.isArray(a)||"number"!=typeof r||r<0)return String(t);const n=a[r],o=a[r+1];if(void 0===n||void 0===o)return String(t);const l=t=>Number.isInteger(t)?String(t):t.toFixed(2);return`${l(n)} to ${l(o)}`}}}})}candlestick(){return{stroke:{width:1},fill:{opacity:1},dataLabels:{enabled:!1},tooltip:{shared:!0,custom:M(["candlestick"],({seriesIndex:t,dataPointIndex:e,w:i})=>this._getBoxTooltip(i,t,e,["Open","High","","Low","Close"],"candlestick"))},states:{active:{filter:{type:"none"}}},xaxis:{crosshairs:{width:1}}}}boxPlot(){return{chart:{animations:{dynamicAnimation:{enabled:!1}}},stroke:{width:1,colors:["#24292e"]},dataLabels:{enabled:!1},tooltip:{shared:!0,custom:M(["boxPlot"],({seriesIndex:t,dataPointIndex:e,w:i})=>this._getBoxTooltip(i,t,e,["Minimum","Q1","Median","Q3","Maximum"],"boxPlot"))},markers:{size:7,strokeWidth:1,strokeColors:"#111"},xaxis:{crosshairs:{width:1}}}}violin(){return{chart:{zoom:{enabled:!1},animations:{dynamicAnimation:{enabled:!1}}},stroke:{width:1,colors:["#24292e"]},fill:{opacity:.7},dataLabels:{enabled:!1},tooltip:{shared:!0,custom:M(["violin"],({seriesIndex:t,dataPointIndex:e,w:i})=>this._getViolinTooltip(i,t,e))},states:{active:{filter:{type:"none"}}},xaxis:{crosshairs:{width:1}}}}rangeBar(){return{chart:{animations:{animateGradually:!1}},stroke:{width:0,lineCap:"square"},plotOptions:{bar:{borderRadius:0,dataLabels:{position:"center"}}},dataLabels:{enabled:!1,formatter(t,{seriesIndex:e,dataPointIndex:i,w:s}){const a=()=>{const t=s.rangeData.seriesRangeStart[e][i];return s.rangeData.seriesRangeEnd[e][i]-t};return s.globals.comboCharts?"rangeBar"===s.config.series[e].type||"rangeArea"===s.config.series[e].type?a():t:a()},background:{enabled:!1},style:{colors:["#fff"]}},markers:{size:10},tooltip:{shared:!1,followCursor:!0,custom:M(["rangeBar"],t=>t.w.config.plotOptions&&t.w.config.plotOptions.bar&&t.w.config.plotOptions.bar.horizontal?(t=>{const{color:e,seriesName:i,ylabel:s,startVal:a,endVal:r}=I(l(o({},t),{isTimeline:!0}));return R(l(o({},t),{color:e,seriesName:i,ylabel:s,start:a,end:r}))})(t):(t=>{const{color:e,seriesName:i,ylabel:s,start:a,end:r}=I(t);return R(l(o({},t),{color:e,seriesName:i,ylabel:s,start:a,end:r}))})(t))},xaxis:{tickPlacement:"between",tooltip:{enabled:!1},crosshairs:{stroke:{width:0}}}}}dumbbell(t){var e,i;return(null==(e=t.plotOptions.bar)?void 0:e.barHeight)||(t.plotOptions.bar.barHeight=2),(null==(i=t.plotOptions.bar)?void 0:i.columnWidth)||(t.plotOptions.bar.columnWidth=2),t}area(){return{stroke:{width:4,fill:{type:"solid",gradient:{inverseColors:!1,shade:"light",type:"vertical",opacityFrom:.65,opacityTo:.5,stops:[0,100,100]}}},fill:{type:"gradient",gradient:{inverseColors:!1,shade:"light",type:"vertical",opacityFrom:.65,opacityTo:.5,stops:[0,100,100]}},markers:{size:0,hover:{sizeOffset:6}},tooltip:{followCursor:!1}}}rangeArea(){return{stroke:{curve:"straight",width:0},fill:{type:"solid",opacity:.6},markers:{size:0},states:{hover:{filter:{type:"none"}},active:{filter:{type:"none"}}},tooltip:{intersect:!1,shared:!0,followCursor:!0,custom:M(["rangeArea"],t=>(t=>{const{color:e,seriesName:i,ylabel:s,start:a,end:r}=I(t);return R(l(o({},t),{color:e,seriesName:i,ylabel:s,start:a,end:r}))})(t))}}}brush(t){return v.extend(t,{chart:{toolbar:{autoSelected:"selection",show:!1},zoom:{enabled:!1}},dataLabels:{enabled:!1},stroke:{width:1},tooltip:{enabled:!1},xaxis:{tooltip:{enabled:!1}}})}stacked100(t){t.dataLabels=t.dataLabels||{},t.dataLabels.formatter=t.dataLabels.formatter||void 0;const e=t.dataLabels.formatter;t.yaxis.forEach((e,i)=>{t.yaxis[i].min=0,t.yaxis[i].max=100});return"bar"===t.chart.type&&(t.dataLabels.formatter=e||function(t){return"number"==typeof t&&t?t.toFixed(0)+"%":t}),t}stackedBars(){const t=this.bar();return l(o({},t),{plotOptions:l(o({},t.plotOptions),{bar:l(o({},t.plotOptions.bar),{borderRadiusApplication:"end"})})})}convertCatToNumeric(t){return t.xaxis.convertedCatToNumeric=!0,t}convertCatToNumericXaxis(t,e){t.xaxis.type="numeric",t.xaxis.labels=t.xaxis.labels||{},t.xaxis.labels.formatter=t.xaxis.labels.formatter||function(t){return v.isNumber(t)?Math.floor(t):t};const i=t.xaxis.labels.formatter;let s=t.xaxis.categories&&t.xaxis.categories.length?t.xaxis.categories:t.labels;return e&&e.length&&(s=e.map(t=>Array.isArray(t)?t:String(t))),s&&s.length&&(t.xaxis.labels.formatter=function(t){return v.isNumber(t)?i(s[Math.floor(t)-1]):i(t)}),t.xaxis.categories=[],t.labels=[],t.xaxis.tickAmount=t.xaxis.tickAmount||"dataPoints",t}bubble(){return{dataLabels:{style:{colors:["#fff"]}},tooltip:{shared:!1,intersect:!0},xaxis:{crosshairs:{width:0}},fill:{type:"solid",gradient:{shade:"light",inverse:!0,shadeIntensity:.55,opacityFrom:.4,opacityTo:.8}}}}scatter(){return{dataLabels:{enabled:!1},tooltip:{shared:!1,intersect:!0},markers:{size:6,strokeWidth:1,hover:{sizeOffset:2}}}}heatmap(){return{chart:{stacked:!1,zoom:{enabled:!1}},fill:{opacity:1},dataLabels:{style:{colors:["#fff"]}},stroke:{colors:["#fff"]},tooltip:{followCursor:!1,marker:{show:!1},x:{show:!1}},legend:{position:"top",markers:{shape:"square"}},grid:{padding:{right:20}}}}treemap(){return{chart:{zoom:{enabled:!1}},dataLabels:{style:{fontSize:14,fontWeight:600,colors:["#fff"]}},stroke:{show:!0,width:2,colors:["#fff"]},legend:{show:!1},fill:{opacity:1,gradient:{stops:[0,100]}},tooltip:{followCursor:!0,x:{show:!1}},grid:{padding:{left:0,right:0}},xaxis:{crosshairs:{show:!1},tooltip:{enabled:!1},axisTicks:{show:!1}}}}unit(){return{chart:{toolbar:{show:!1}},dataLabels:{enabled:!1},stroke:{show:!1,width:0},fill:{opacity:1},tooltip:{followCursor:!0,x:{show:!1}},legend:{show:!0,position:"bottom"},grid:{padding:{left:0,right:0,top:0,bottom:0}}}}sunburst(){return{chart:{toolbar:{show:!1}},dataLabels:{style:{colors:["#fff"]},dropShadow:{enabled:!0}},stroke:{colors:["#fff"]},fill:{opacity:1},legend:{position:"right"},grid:{padding:{left:0,right:0,top:0,bottom:0}}}}pie(){return{chart:{toolbar:{show:!1}},plotOptions:{pie:{donut:{labels:{show:!1}}}},dataLabels:{formatter:t=>"number"==typeof t?t.toFixed(1)+"%":t,style:{colors:["#fff"]},background:{enabled:!1},dropShadow:{enabled:!0}},stroke:{colors:["#fff"]},fill:{opacity:1,gradient:{shade:"light",stops:[0,100]}},tooltip:{theme:"dark",fillSeriesColor:!0},legend:{position:"right"},grid:{padding:{left:0,right:0,top:0,bottom:0}}}}donut(){return{chart:{toolbar:{show:!1}},dataLabels:{formatter:t=>"number"==typeof t?t.toFixed(1)+"%":t,style:{colors:["#fff"]},background:{enabled:!1},dropShadow:{enabled:!0}},stroke:{colors:["#fff"]},fill:{opacity:1,gradient:{shade:"light",shadeIntensity:.35,stops:[80,100],opacityFrom:1,opacityTo:1}},tooltip:{theme:"dark",fillSeriesColor:!0},legend:{position:"right"},grid:{padding:{left:0,right:0,top:0,bottom:0}}}}polarArea(){return{chart:{toolbar:{show:!1}},dataLabels:{formatter:t=>"number"==typeof t?t.toFixed(1)+"%":t,enabled:!1},stroke:{show:!0,width:2},fill:{opacity:.7},tooltip:{theme:"dark",fillSeriesColor:!0},legend:{position:"right"},grid:{padding:{left:0,right:0,top:0,bottom:0}}}}radar(){return this.opts.yaxis[0].labels.offsetY=this.opts.yaxis[0].labels.offsetY?this.opts.yaxis[0].labels.offsetY:6,{dataLabels:{enabled:!1,style:{fontSize:"11px"}},stroke:{width:2},markers:{size:5,strokeWidth:1,strokeOpacity:1},fill:{opacity:.2},tooltip:{shared:!1,intersect:!0,followCursor:!0},grid:{show:!1,padding:{left:0,right:0,top:0,bottom:0}},xaxis:{labels:{formatter:t=>t,style:{colors:["#a8a8a8"],fontSize:"11px"}},tooltip:{enabled:!1},crosshairs:{show:!1}}}}radialBar(){return{chart:{animations:{dynamicAnimation:{enabled:!0,speed:800}},toolbar:{show:!1}},stroke:{lineCap:"butt"},fill:{gradient:{shade:"dark",shadeIntensity:.4,inverseColors:!1,type:"diagonal2",opacityFrom:1,opacityTo:1,stops:[70,98,100]}},legend:{show:!1,position:"right"},tooltip:{enabled:!1,fillSeriesColor:!0},grid:{padding:{left:0,right:0,top:0,bottom:0}}}}_getBoxTooltip(t,e,i,s,a){const r=t.candleData.seriesCandleO[e][i],n=t.candleData.seriesCandleH[e][i],o=t.candleData.seriesCandleM[e][i],l=t.candleData.seriesCandleL[e][i],h=t.candleData.seriesCandleC[e][i],c=t.config.series[e];return c.type&&c.type!==a?`<div class="apexcharts-custom-tooltip">\n          ${c.name?c.name:"series-"+(e+1)}: <strong>${t.seriesData.series[e][i]}</strong>\n        </div>`:`<div class="apexcharts-tooltip-box apexcharts-tooltip-${t.config.chart.type}"><div>${s[0]}: <span class="value">`+r+`</span></div><div>${s[1]}: <span class="value">`+n+"</span></div>"+(o?`<div>${s[2]}: <span class="value">`+o+"</span></div>":"")+`<div>${s[3]}: <span class="value">`+l+`</span></div><div>${s[4]}: <span class="value">`+h+"</span></div></div>"}_getViolinTooltip(t,e,i){var s,a,r;const n=null==(s=t.violinData.seriesViolinMin[e])?void 0:s[i],o=null==(a=t.violinData.seriesViolinMax[e])?void 0:a[i],l=(null==(r=t.violinData.seriesViolinPoints[e])?void 0:r[i])||[],h=t.config.series[e].name||"series-"+(e+1);return`<div class="apexcharts-tooltip-box apexcharts-tooltip-${t.config.chart.type}"><div class="apexcharts-tooltip-violin-name">${h}</div><div>Min: <span class="value">${n}</span></div><div>Max: <span class="value">${o}</span></div><div>Observations: <span class="value">${l.length}</span></div></div>`}}class z{constructor(t){this.opts=t}init({responsiveOverride:t}){var e,i,s,a,r,n,o,l;let h=this.opts;const c=new k,p=new X(h);h=this.normalizeAliasedChartType(h),this.chartType=h.chart.type,h=this.extendYAxis(h),h=this.extendAnnotations(h);let u=c.init(),g={};if(h&&"object"==typeof h){let c=X.forType(h);(null==(e=h.chart.brush)?void 0:e.enabled)&&(c=p.brush(c)),(null==(s=null==(i=h.plotOptions)?void 0:i.line)?void 0:s.isSlopeChart)&&(c=p.slope()),h.chart.stacked&&"100%"===h.chart.stackType&&(h=p.stacked100(h)),(null==(r=null==(a=h.plotOptions)?void 0:a.bar)?void 0:r.isDumbbell)&&(h=p.dumbbell(h)),this.checkForDarkTheme(d.getApex()),this.checkForDarkTheme(h),h.xaxis=h.xaxis||d.getApex().xaxis||{},t||(h.xaxis.convertedCatToNumeric=!1),h=this.checkForCatToNumericXAxis(this.chartType,c,h),((null==(n=h.chart.sparkline)?void 0:n.enabled)||(null==(l=null==(o=d.getApex().chart)?void 0:o.sparkline)?void 0:l.enabled))&&(c=p.sparkline(c)),g=v.extend(u,c)}const f=v.extend(g,d.getApex());return u=v.extend(f,h),u=this.handleUserInputErrors(u),u}normalizeAliasedChartType(t){if(!t||!t.chart)return t;const e=t.chart.type;return"funnel"!==e&&"pyramid"!==e&&"gauge"!==e&&"waffle"!==e&&"histogram"!==e||(t.chart.requestedType=e,"waffle"===e?(t.plotOptions=t.plotOptions||{},t.plotOptions.unit=t.plotOptions.unit||{},null==t.plotOptions.unit.layout&&(t.plotOptions.unit.layout="grid"),null==t.plotOptions.unit.shape&&(t.plotOptions.unit.shape="square"),t.chart.type="unit"):"funnel"===e||"pyramid"===e?(t.plotOptions=t.plotOptions||{},t.plotOptions.bar=t.plotOptions.bar||{},t.plotOptions.bar.isFunnel=!0,t.plotOptions.bar.horizontal=!0,t.chart.type="bar",t.plotOptions.bar.isPyramid="pyramid"===e):"gauge"===e?t.chart.type="radialBar":"histogram"===e&&(t.xaxis=t.xaxis||{},null==t.xaxis.type&&(t.xaxis.type="numeric"),t.chart.type="bar")),t}checkForCatToNumericXAxis(t,e,i){var s,a,r,n,o;const l=new X(i),h=("bar"===t||"boxPlot"===t||"violin"===t)&&(null==(a=null==(s=i.plotOptions)?void 0:s.bar)?void 0:a.horizontal),c="pie"===t||"polarArea"===t||"donut"===t||"radar"===t||"radialBar"===t||"heatmap"===t||"unit"===t||"sunburst"===t,d="datetime"!==i.xaxis.type&&"numeric"!==i.xaxis.type,p=("scatter"===t||"bubble"===t)&&(null==(o=null==(n=null==(r=i.plotOptions)?void 0:r.scatter)?void 0:n.jitter)?void 0:o.enabled),u=i.xaxis.tickPlacement?i.xaxis.tickPlacement:e.xaxis&&e.xaxis.tickPlacement;return h||c||p||!d||"between"===u||(i=l.convertCatToNumeric(i)),i}extendYAxis(t,e){const i=new k;(void 0===t.yaxis||!t.yaxis||Array.isArray(t.yaxis)&&0===t.yaxis.length)&&(t.yaxis={});const s=d.getApex();t.yaxis.constructor!==Array&&s.yaxis&&s.yaxis.constructor!==Array&&(t.yaxis=v.extend(t.yaxis,s.yaxis)),t.yaxis.constructor!==Array?t.yaxis=[v.extend(i.yAxis,t.yaxis)]:t.yaxis=v.extendArray(t.yaxis,i.yAxis);let a=!1;t.yaxis.forEach(t=>{t.logarithmic&&(a=!0)});let r=t.series;return e&&!r&&(r=e.config.series),a&&r.length!==t.yaxis.length&&r.length&&(t.yaxis=r.map((e,s)=>{if(e.name||(r[s].name=`series-${s+1}`),t.yaxis[s])return t.yaxis[s].seriesName=r[s].name,t.yaxis[s];{const e=v.extend(i.yAxis,t.yaxis[0]);return e.show=!1,e}})),a&&r.length>1&&(r.length,t.yaxis.length),t}extendAnnotations(t){return void 0===t.annotations&&(t.annotations={},t.annotations.yaxis=[],t.annotations.xaxis=[],t.annotations.points=[]),t=this.extendYAxisAnnotations(t),t=this.extendXAxisAnnotations(t),t=this.extendPointAnnotations(t)}extendYAxisAnnotations(t){const e=new k;return t.annotations.yaxis=v.extendArray(void 0!==t.annotations.yaxis?t.annotations.yaxis:[],e.yAxisAnnotation),t}extendXAxisAnnotations(t){const e=new k;return t.annotations.xaxis=v.extendArray(void 0!==t.annotations.xaxis?t.annotations.xaxis:[],e.xAxisAnnotation),t}extendPointAnnotations(t){const e=new k;return t.annotations.points=v.extendArray(void 0!==t.annotations.points?t.annotations.points:[],e.pointAnnotation),t}checkForDarkTheme(t){t.theme&&"dark"===t.theme.mode&&(t.tooltip||(t.tooltip={}),"light"!==t.tooltip.theme&&(t.tooltip.theme="dark"),t.chart.foreColor||(t.chart.foreColor="#f6f7f8"),t.theme.palette||(t.theme.palette="palette4"))}handleUserInputErrors(t){const e=t;if(e.tooltip.shared&&e.tooltip.intersect)throw new Error("tooltip.shared cannot be enabled when tooltip.intersect is true. Turn off any other option by setting it to false.");if("bar"===e.chart.type&&e.plotOptions.bar.horizontal){if(e.yaxis.length>1)throw new Error("Multiple Y Axis for bars are not supported. Switch to column chart by setting plotOptions.bar.horizontal=false");e.yaxis[0].reversed&&(e.yaxis[0].opposite=!0),e.xaxis.tooltip.enabled=!1,e.yaxis[0].tooltip.enabled=!1,e.chart.zoom.enabled=!1}return"bar"!==e.chart.type&&"rangeBar"!==e.chart.type||e.tooltip.shared&&"barWidth"===e.xaxis.crosshairs.width&&e.series.length>1&&(e.xaxis.crosshairs.width="tickWidth"),"candlestick"!==e.chart.type&&"boxPlot"!==e.chart.type||e.yaxis[0].reversed&&(e.yaxis[0].reversed=!1),e}}const B=1.618,N=[[1,1,2,5,5,5,10,10,10,10,10],[1,1,2,5,5,5,10,10,10,10,10]],Y=[1,2,4,4,6,6,6,6,6,6,6,6,6,6,6,6,6,6,12,12,12,12,12,12,12,12,12,24];class O{initGlobalVars(t){t.series=[],t.seriesCandleO=[],t.seriesCandleH=[],t.seriesCandleM=[],t.seriesCandleL=[],t.seriesCandleC=[],t.seriesRangeStart=[],t.seriesRangeEnd=[],t.seriesRange=[],t.seriesPercent=[],t.seriesGoals=[],t.seriesX=[],t.seriesZ=[],t.seriesNames=[],t.seriesTotals=[],t.seriesLog=[],t.seriesColors=[],t.stackedSeriesTotals=[],t.seriesXvalues=[],t.seriesYvalues=[],t.dataWasParsed=!1,t.originalSeries=null,t.maxValsInArrayIndex=0,t.yValueDecimal=0,t.allSeriesHasEqualX=!0,t.hasNullValues=!1,t.invalidLogScale=!1,t.seriesRangeName={},t.labels=[],t.hasXaxisGroups=!1,t.groups=[],t.barGroups=[],t.lineGroups=[],t.areaGroups=[],t.hasSeriesGroups=!1,t.seriesGroups=[],t.categoryLabels=[],t.timescaleLabels=[],t.noLabelsProvided=!1,t.isXNumeric=!1,t.skipLastTimelinelabel=!1,t.skipFirstTimelinelabel=!1,t.isDataXYZ=!1,t.isMultiLineX=!1,t.isMultipleYAxis=!1,t.maxY=-Number.MAX_VALUE,t.minY=Number.MIN_VALUE,t.minYArr=[],t.maxYArr=[],t.maxX=-Number.MAX_VALUE,t.minX=Number.MAX_VALUE,t.initialMaxX=-Number.MAX_VALUE,t.initialMinX=Number.MAX_VALUE,t.maxDate=0,t.minDate=Number.MAX_VALUE,t.minZ=Number.MAX_VALUE,t.maxZ=-Number.MAX_VALUE,t.minXDiff=Number.MAX_VALUE,t.yAxisScale=[],t.xAxisScale=null,t.xAxisTicksPositions=[],t.xRange=0,t.yRange=[],t.zRange=0,t.dataPoints=0,t.xTickAmount=0,t.multiAxisTickAmount=0,t.disableZoomIn=!1,t.disableZoomOut=!1,t.yLabelsCoords=[],t.yTitleCoords=[],t.barPadForNumericAxis=0,t.padHorizontal=0,t.rotateXLabels=!1,t.overlappingXLabels=!1,t.radialSize=0,t.barHeight=0,t.barWidth=0,t.animationEnded=!1,t.isDestroyed=!1,t.bulkRevealScheduled=!1,t.resizeTimer=null,t.selectionResizeTimer=null,t.delayedElements=[],t.pointsArray=[],t.barCanvasCoords=null,t.activeRenderer=null,t.dataLabelsRects=[],t.lastDrawnDataLabelsIndexes=[],t.textRectsCache=new Map,t.domCache=new Map,t.dimensionCache={},t.cachedSelectors={},t.seriesNS||this._attachNamespaces(t)}_attachNamespaces(t){const e=(e,i,s=i)=>{Object.defineProperty(e,s,{get:()=>t[i],set(e){t[i]=e},enumerable:!0,configurable:!0})},i={};e(i,"series","data");for(const t of["seriesNames","seriesX","seriesZ","seriesXvalues","seriesYvalues","seriesGoals","seriesLog","seriesColors","seriesPercent","seriesTotals","stackedSeriesTotals","seriesCandleO","seriesCandleH","seriesCandleM","seriesCandleL","seriesCandleC","seriesRangeStart","seriesRangeEnd","seriesRange","seriesYAxisMap","seriesYAxisReverseMap","seriesGroups","barGroups","lineGroups","areaGroups","originalSeries","collapsedSeries","collapsedSeriesIndices","ancillaryCollapsedSeries","ancillaryCollapsedSeriesIndices","collapsingSeriesIndices","allSeriesCollapsed","risingSeries","previousPaths","ignoreYAxisIndexes","labels","categoryLabels","timescaleLabels","groups"])e(i,t);Object.defineProperty(t,"seriesNS",{value:i,writable:!1,enumerable:!1,configurable:!0});const s={};for(const t of["minX","maxX","initialMinX","initialMaxX","minY","maxY","minYArr","maxYArr","minZ","maxZ","minDate","maxDate","minXDiff","xRange","yRange","zRange","xAxisScale","yAxisScale","xAxisTicksPositions","xTickAmount","multiAxisTickAmount","dataPoints","maxValsInArrayIndex","isXNumeric","isMultipleYAxis","isMultiLineX","isDataXYZ","dataFormatXNumeric","allSeriesHasEqualX","hasNullValues","dataWasParsed","hasXaxisGroups","hasSeriesGroups","skipFirstTimelinelabel","skipLastTimelinelabel","yValueDecimal","invalidLogScale","noLabelsProvided"])e(s,t);Object.defineProperty(t,"axes",{value:s,writable:!1,enumerable:!1,configurable:!0});const a={};for(const t of["svgWidth","svgHeight","gridWidth","gridHeight","translateX","translateY","translateXAxisX","translateXAxisY","translateYAxisX","xAxisLabelsHeight","xAxisGroupLabelsHeight","xAxisLabelsWidth","yAxisLabelsWidth","yAxisWidths","yLabelsCoords","yTitleCoords","padHorizontal","barPadForNumericAxis","rotateXLabels","scaleX","scaleY","radialSize","defaultLabels","overlappingXLabels"])e(a,t);Object.defineProperty(t,"layout",{value:a,writable:!1,enumerable:!1,configurable:!0});const r={};for(const t of["domCache","dimensionCache","cachedSelectors","textRectsCache","pointsArray","dataLabelsRects","lastDrawnDataLabelsIndexes","delayedElements","resizeTimer","selectionResizeTimer","resizeObserver"])e(r,t);Object.defineProperty(t,"cache",{value:r,writable:!1,enumerable:!1,configurable:!0})}globalVars(t){return{chartID:null,cuid:null,events:{beforeMount:[],mounted:[],updated:[],clicked:[],selection:[],dataPointSelection:[],zoomed:[],scrolled:[]},colors:[],fill:{colors:[]},radialNeedleRAF:null,unitGatherRAF:null,unitExitRAF:null,stroke:{colors:[]},dataLabels:{style:{colors:[]}},radarPolygons:{fill:{colors:[]}},markers:{colors:[],size:t.markers.size,largestSize:0,batched:!1},LINE_HEIGHT_RATIO:B,axisCharts:!0,isSlopeChart:t.plotOptions.line.isSlopeChart,comboCharts:!1,initialConfig:null,initialSeries:[],tokenSurface:void 0,lastXAxis:[],lastYAxis:[],allSeriesCollapsed:!1,collapsedSeries:[],collapsedSeriesIndices:[],ancillaryCollapsedSeries:[],ancillaryCollapsedSeriesIndices:[],collapsingSeriesIndices:[],risingSeries:[],ignoreYAxisIndexes:[],isDirty:!1,isExecCalled:!1,dataChanged:!1,resized:!1,columnSeries:null,yaxis:null,total:0,shouldAnimate:!0,previousPaths:[],prevPolarAngles:null,prevStreamFrame:null,streamScrolled:!1,prevChromeFrame:null,svgWidth:0,svgHeight:0,lastResizeSignature:null,defaultLabels:!1,yAxisLabelsWidth:0,scaleX:1,scaleY:1,translateYAxisX:[],yAxisWidths:[],tooltip:null,resizeObserver:null,locale:{},memory:{methodsToExec:[]},niceScaleAllowedMagMsd:N,niceScaleDefaultTicks:Y,seriesYAxisMap:[],seriesYAxisReverseMap:[],noData:!1}}defineLazyInitialSeries(t){let e=[],i=null;Object.defineProperty(t,"initialSeries",{configurable:!0,enumerable:!0,get:()=>(null===i&&(i=v.clone(e)),i),set(s){e=Array.isArray(s)?s.map(t=>t&&"object"==typeof t&&!Array.isArray(t)?o({},t):t):s,i=null,t._initialSeriesPeek=e}}),t._initialSeriesPeek=e}init(t){const e=this.globalVars(t);return this.initGlobalVars(e),this.defineLazyInitialSeries(e),e.initialConfig=v.extend({},t),e.initialSeries=t.series,e.lastXAxis=v.clone(e.initialConfig.xaxis),e.lastYAxis=v.clone(e.initialConfig.yaxis),e}}class W{constructor(t){this.opts=t}init(){const t=new z(this.opts).init({responsiveOverride:!1}),e=(new O).init(t),i={config:t,globals:e,dom:{},interact:{zoomEnabled:"zoom"===t.chart.toolbar.autoSelected&&t.chart.toolbar.tools.zoom&&t.chart.zoom.enabled,panEnabled:"pan"===t.chart.toolbar.autoSelected&&t.chart.toolbar.tools.pan,selectionEnabled:"selection"===t.chart.toolbar.autoSelected&&t.chart.toolbar.tools.selection,measureEnabled:"measure"===t.chart.toolbar.autoSelected&&!!t.chart.toolbar.tools.measure&&!(!t.chart.measure||!t.chart.measure.enabled),zoomed:!1,selection:void 0,visibleXRange:void 0,selectedDataPoints:[],mousedown:!1,clientX:null,clientY:null,lastClientPosition:{},capturedSeriesIndex:-1,capturedDataPointIndex:-1,disableZoomIn:!1,disableZoomOut:!1,isTouchDevice:!!d.isBrowser()&&("ontouchstart"in window||navigator.maxTouchPoints>0)},formatters:{xLabelFormatter:void 0,yLabelFormatters:[],xaxisTooltipFormatter:void 0,ttKeyFormatter:void 0,ttVal:void 0,ttZFormatter:void 0,legendFormatter:void 0},candleData:{seriesCandleO:[],seriesCandleH:[],seriesCandleM:[],seriesCandleL:[],seriesCandleC:[],seriesBoxPoints:[]},rangeData:{seriesRangeStart:[],seriesRangeEnd:[],seriesRange:[]},violinData:{seriesViolinDensity:[],seriesViolinPoints:[],seriesViolinMin:[],seriesViolinMax:[]},histogramData:{edges:[],binWidth:0,counts:[],rule:"",capped:!1},labelData:{labels:[],categoryLabels:[],timescaleLabels:[],hasXaxisGroups:!1,groups:[],seriesGroups:[]},axisFlags:{isXNumeric:!1,dataFormatXNumeric:!1,isDataXYZ:!1,isRangeData:!1,isRangeBar:!1,isMultiLineX:!1,noLabelsProvided:!1,dataWasParsed:!1},seriesData:{series:[],seriesNames:[],seriesX:[],seriesZ:[],seriesColors:[],seriesGoals:[],stackedSeriesTotals:[],stackedSeriesTotalsByGroups:[],unitData:[]},layout:{gridHeight:0,gridWidth:0,translateX:0,translateY:0,translateXAxisX:0,translateXAxisY:0,rotateXLabels:!1,xAxisHeight:0,xAxisLabelsHeight:0,xAxisGroupLabelsHeight:0,xAxisLabelsWidth:0,yLabelsCoords:[],yTitleCoords:[],gridPad:{top:0,right:0,bottom:0,left:0}}};Object.defineProperty(e,"dom",{get:()=>i.dom,set(t){i.dom=t},enumerable:!1,configurable:!0});for(const t of["xLabelFormatter","yLabelFormatters","xaxisTooltipFormatter","ttKeyFormatter","ttVal","ttZFormatter","legendFormatter"])Object.defineProperty(e,t,{get:()=>i.formatters[t],set(e){i.formatters[t]=e},enumerable:!1,configurable:!0});for(const t of["zoomEnabled","panEnabled","selectionEnabled","zoomed","selection","visibleXRange","selectedDataPoints","mousedown","clientX","clientY","lastClientPosition","capturedSeriesIndex","capturedDataPointIndex","disableZoomIn","disableZoomOut","isTouchDevice"])Object.defineProperty(e,t,{get:()=>i.interact[t],set(e){i.interact[t]=e},enumerable:!1,configurable:!0});for(const t of["gridHeight","gridWidth","translateX","translateY","translateXAxisX","translateXAxisY","rotateXLabels","xAxisHeight","xAxisLabelsHeight","xAxisGroupLabelsHeight","xAxisLabelsWidth","yLabelsCoords","yTitleCoords","gridPad"])Object.defineProperty(e,t,{get:()=>i.layout[t],set(e){i.layout[t]=e},enumerable:!1,configurable:!0});for(const t of["series","seriesNames","seriesX","seriesZ","seriesColors","seriesGoals","stackedSeriesTotals","stackedSeriesTotalsByGroups"])Object.defineProperty(e,t,{get:()=>i.seriesData[t],set(e){i.seriesData[t]=e},enumerable:!1,configurable:!0});for(const t of["isXNumeric","dataFormatXNumeric","isDataXYZ","isRangeData","isRangeBar","isMultiLineX","noLabelsProvided","dataWasParsed"])Object.defineProperty(e,t,{get:()=>i.axisFlags[t],set(e){i.axisFlags[t]=e},enumerable:!1,configurable:!0});for(const t of["labels","categoryLabels","timescaleLabels","hasXaxisGroups","groups","seriesGroups"])Object.defineProperty(e,t,{get:()=>i.labelData[t],set(e){i.labelData[t]=e},enumerable:!1,configurable:!0});for(const t of["seriesRangeStart","seriesRangeEnd","seriesRange"])Object.defineProperty(e,t,{get:()=>i.rangeData[t],set(e){i.rangeData[t]=e},enumerable:!1,configurable:!0});for(const t of["seriesCandleO","seriesCandleH","seriesCandleM","seriesCandleL","seriesCandleC"])Object.defineProperty(e,t,{get:()=>i.candleData[t],set(e){i.candleData[t]=e},enumerable:!1,configurable:!0});for(const t of["seriesViolinDensity","seriesViolinPoints","seriesViolinMin","seriesViolinMax"])Object.defineProperty(e,t,{get:()=>i.violinData[t],set(e){i.violinData[t]=e},enumerable:!1,configurable:!0});return i}}class H{constructor(t){this.w=t}static checkComboSeries(t,e){let i=!1,s=0,a=0;return void 0===e&&(e="line"),t.length&&void 0!==t[0].type&&t.forEach(t=>{"bar"!==t.type&&"column"!==t.type&&"candlestick"!==t.type&&"boxPlot"!==t.type&&"violin"!==t.type||s++,void 0!==t.type&&t.type!==e&&a++}),a>0&&(i=!0),{comboBarCount:s,comboCharts:i}}getStackedSeriesTotals(t=[]){const e=this.w,i=[];if(0===e.seriesData.series.length)return i;for(let s=0;s<e.seriesData.series[e.globals.maxValsInArrayIndex].length;s++){let a=0;for(let i=0;i<e.seriesData.series.length;i++)void 0!==e.seriesData.series[i][s]&&-1===t.indexOf(i)&&(a+=e.seriesData.series[i][s]);i.push(a)}return i}getSeriesTotalByIndex(t=null){if(null===t)return this.w.config.series.reduce((t,e)=>t+e,0);{const e=this.w.seriesData.series[t];return Array.isArray(e)?e.reduce((t,e)=>t+e,0):null!=e?e:0}}getStackedSeriesTotalsByGroups(){const t=this.w,e=[];return t.labelData.seriesGroups.forEach(i=>{const s=[];t.config.series.forEach((e,a)=>{i.indexOf(t.seriesData.seriesNames[a])>-1&&s.push(a)});const a=t.seriesData.series.map((t,e)=>-1===s.indexOf(e)?e:-1).filter(t=>-1!==t);e.push(this.getStackedSeriesTotals(a))}),e}setSeriesYAxisMappings(){const t=this.w.globals,e=this.w.config;let i=[];const s=[],a=[],r=this.w.seriesData.series.length>e.yaxis.length||e.yaxis.some(t=>Array.isArray(t.seriesName));e.series.forEach((t,e)=>{a.push(e),s.push(null)}),e.yaxis.forEach((t,e)=>{i[e]=[]});const n=[];e.yaxis.forEach((t,s)=>{let o=!1;if(t.seriesName){let n=[];Array.isArray(t.seriesName)?n=t.seriesName:n.push(t.seriesName),n.forEach(t=>{e.series.forEach((e,n)=>{if(e.name===t){let t=n;s===n||r?(!r||a.indexOf(n)>-1)&&i[s].push([s,n]):(i[n].push([n,s]),t=s),o=!0,t=a.indexOf(t),-1!==t&&a.splice(t,1)}})})}o||n.push(s)}),i=i.map(t=>{const e=[];return t.forEach(t=>{s[t[1]]=t[0],e.push(t[1])}),e});let o=e.yaxis.length-1;for(let t=0;t<n.length&&(o=n[t],i[o]=[],a);t++){const t=a[0];a.shift(),i[o].push(t),s[t]=o}a.forEach(t=>{i[o].push(t),s[t]=o}),t.seriesYAxisMap=i.map(t=>t),t.seriesYAxisReverseMap=s.map(t=>t),t.seriesYAxisMap.forEach((t,i)=>{t.forEach(t=>{if(e.series[t]&&void 0===e.series[t].group){e.series[t].group="apexcharts-axis-".concat(i.toString())}})})}isSeriesNull(t=null){let e=[];const i=this.w.config.series;return e=null===t?i.filter(t=>null!==t):i[t]&&Array.isArray(i[t].data)?i[t].data.filter(t=>null!==t):null!==i[t]&&void 0!==i[t]?[i[t]]:[],0===e.length}seriesHaveSameValues(t){const e=this.w.seriesData.series[t];return!Array.isArray(e)||e.every((t,e,i)=>t===i[0])}getCategoryLabels(t){const e=this.w;let i=t.slice();return e.config.xaxis.convertedCatToNumeric&&(i=t.map(t=>e.config.xaxis.labels.formatter(t-e.globals.minX+1))),i}getLargestSeries(){const t=this.w;t.globals.maxValsInArrayIndex=t.seriesData.series.map(t=>t.length).indexOf(Math.max.apply(Math,t.seriesData.series.map(t=>t.length)))}getLargestMarkerSize(){const t=this.w;let e=0;return t.globals.markers.size.forEach(t=>{e=Math.max(e,t)}),t.config.markers.discrete&&t.config.markers.discrete.length&&t.config.markers.discrete.forEach(t=>{e=Math.max(e,t.size)}),e>0&&(t.config.markers.hover.size>0?e=t.config.markers.hover.size:e+=t.config.markers.hover.sizeOffset),t.globals.markers.largestSize=e,e}getSeriesTotals(){const t=this.w;t.globals.seriesTotals=t.seriesData.series.map(t=>{let e=0;if(Array.isArray(t))for(let i=0;i<t.length;i++)e+=t[i];else e+=t;return e})}getSeriesTotalsXRange(t,e){const i=this.w;return i.seriesData.series.map((s,a)=>{let r=0;for(let n=0;n<s.length;n++)i.seriesData.seriesX[a][n]>t&&i.seriesData.seriesX[a][n]<e&&(r+=s[n]);return r})}getPercentSeries(){const t=this.w;t.globals.seriesPercent=t.seriesData.series.map(e=>{const i=[];if(Array.isArray(e))for(let s=0;s<e.length;s++){const a=t.seriesData.stackedSeriesTotals[s];let r=0;a&&(r=100*e[s]/a),i.push(r)}else{const s=100*e/t.globals.seriesTotals.reduce((t,e)=>t+e,0);i.push(s)}return i})}getCalculatedRatios(){const t=this.w,e=t.globals,i=[];let s=0,a=0,r=0,n=0,o=[],l=.1,h=0;if(e.yRange=[],e.isMultipleYAxis)for(let t=0;t<e.minYArr.length;t++)e.yRange.push(Math.abs(e.minYArr[t]-e.maxYArr[t])),o.push(0);else e.yRange.push(Math.abs(e.minY-e.maxY));e.xRange=Math.abs(e.maxX-e.minX),e.zRange=Math.abs(e.maxZ-e.minZ);for(let t=0;t<e.yRange.length;t++)i.push(e.yRange[t]/this.w.layout.gridHeight);if(a=e.xRange/this.w.layout.gridWidth,s=e.yRange/this.w.layout.gridWidth,r=e.xRange/this.w.layout.gridHeight,n=e.zRange/this.w.layout.gridHeight*16,n||(n=1),e.minY!==Number.MIN_VALUE&&0!==Math.abs(e.minY)){e.hasNegs=!0}if(t.globals.seriesYAxisReverseMap.length>0){const r=(e,s)=>{const a=t.config.yaxis[t.globals.seriesYAxisReverseMap[s]];if(!a)return 0;if(a.logarithmic)return 0;return-(e<0?-1:1)*(e=Math.abs(e))/i[s]};if(e.isMultipleYAxis){o=[];for(let t=0;t<i.length;t++)o.push(r(e.minYArr[t],t))}else o=[],o.push(r(e.minY,0)),e.minY!==Number.MIN_VALUE&&0!==Math.abs(e.minY)&&(l=-e.minY/s,h=e.minX/a)}else o=[],o.push(0),l=0,h=0;return{yRatio:i,invertedYRatio:s,zRatio:n,xRatio:a,invertedXRatio:r,baseLineInvertedY:l,baseLineY:o,baseLineX:h}}getLogSeries(t){const e=this.w;return e.globals.seriesLog=t.map((t,i)=>{const s=e.globals.seriesYAxisReverseMap[i];return e.config.yaxis[s]&&e.config.yaxis[s].logarithmic?t.map(t=>null===t?null:this.getLogVal(e.config.yaxis[s].logBase,t,i)):t}),e.globals.invalidLogScale?t:e.globals.seriesLog}getLogValAtSeriesIndex(t,e){if(null===t)return null;const i=this.w,s=i.globals.seriesYAxisReverseMap[e];return i.config.yaxis[s]&&i.config.yaxis[s].logarithmic?this.getLogVal(i.config.yaxis[s].logBase,t,e):t}getBaseLog(t,e){return Math.log(e)/Math.log(t)}getLogVal(t,e,i){if(e<=0)return 0;const s=this.w,a=0===s.globals.minYArr[i]?-1:this.getBaseLog(t,s.globals.minYArr[i]),r=(0===s.globals.maxYArr[i]?0:this.getBaseLog(t,s.globals.maxYArr[i]))-a;return(this.getBaseLog(t,e)-a)/r}getLogYRatios(t){const e=this.w,i=this.w.globals,s=i;return s.yLogRatio=t.slice(),s.logYRange=i.yRange.map((t,a)=>{const r=e.globals.seriesYAxisReverseMap[a];if(e.config.yaxis[r]&&this.w.config.yaxis[r].logarithmic){const t=1;return s.yLogRatio[a]=t/this.w.layout.gridHeight,t}return i.yRange[a]}),s.invalidLogScale?t.slice():s.yLogRatio}static extendArrayProps(t,e,i){var s,a;return(null==e?void 0:e.yaxis)&&(e=t.extendYAxis(e,i)),(null==e?void 0:e.annotations)&&(e.annotations.yaxis&&(e=t.extendYAxisAnnotations(e)),(null==(s=null==e?void 0:e.annotations)?void 0:s.xaxis)&&(e=t.extendXAxisAnnotations(e)),(null==(a=null==e?void 0:e.annotations)?void 0:a.points)&&(e=t.extendPointAnnotations(e))),e}drawSeriesByGroup(t,e,i,s){const a=this.w,r=[];return t.series.length>0&&e.forEach(e=>{const n=[],o=[];t.i.forEach((i,s)=>{a.config.series[i].group===e&&(n.push(t.series[s]),o.push(i))}),n.length>0&&r.push(s.draw(n,i,o))}),r}}const $="http://www.w3.org/2000/svg";class G{constructor(t,e){"object"==typeof t?(this.x=t.x,this.y=t.y):(this.x=t||0,this.y=e||0)}transform(t){return t.apply(this)}clone(){return new G(this.x,this.y)}}class j{constructor(t,e,i,s,a,r){this.a=null!=t?t:1,this.b=null!=e?e:0,this.c=null!=i?i:0,this.d=null!=s?s:1,this.e=null!=a?a:0,this.f=null!=r?r:0}rotate(t){const e=t*Math.PI/180,i=Math.cos(e),s=Math.sin(e);return this.multiply(new j(i,s,-s,i,0,0))}scale(t,e){return this.multiply(new j(t,0,0,null!=e?e:t,0,0))}multiply(t){return new j(this.a*t.a+this.c*t.b,this.b*t.a+this.d*t.b,this.a*t.c+this.c*t.d,this.b*t.c+this.d*t.d,this.a*t.e+this.c*t.f+this.e,this.b*t.e+this.d*t.f+this.f)}apply(t){return new G(this.a*t.x+this.c*t.y+this.e,this.b*t.x+this.d*t.y+this.f)}}class V{constructor(t,e,i,s){this.x=t,this.y=e,this.w=i,this.h=s,this.width=i,this.height=s,this.x2=t+i,this.y2=e+s}}function U(t){if(!t||"string"!=typeof t)return[["M",0,0]];const e=[],i=/([MmLlHhVvCcSsQqTtAaZz])\s*/g,s=/[+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?/gi;let a;const r=[],n=[];for(;null!==(a=i.exec(t));)r.push(a[1]),n.push(a.index);for(let i=0;i<r.length;i++){const a=n[i]+r[i].length,o=i+1<n.length?n[i+1]:t.length,l=t.substring(a,o),h=[];let c;for(s.lastIndex=0;null!==(c=s.exec(l));)h.push(parseFloat(c[0]));const d=r[i].toUpperCase();if("Z"===d)e.push(["Z"]);else if("M"===d||"L"===d||"T"===d)for(let t=0;t<h.length;t+=2)e.push([d,h[t],h[t+1]]);else if("H"===d)for(let t=0;t<h.length;t++)e.push([d,h[t]]);else if("V"===d)for(let t=0;t<h.length;t++)e.push([d,h[t]]);else if("C"===d)for(let t=0;t<h.length;t+=6)e.push([d,h[t],h[t+1],h[t+2],h[t+3],h[t+4],h[t+5]]);else if("S"===d||"Q"===d)for(let t=0;t<h.length;t+=4)e.push([d,h[t],h[t+1],h[t+2],h[t+3]]);else if("A"===d)for(let t=0;t<h.length;t+=7)e.push([d,h[t],h[t+1],h[t+2],h[t+3],h[t+4],h[t+5],h[t+6]])}return 0===e.length&&e.push(["M",0,0]),e}function q(t){let e=1/0,i=1/0,s=-1/0,a=-1/0;return t.forEach(t=>{for(let r=1;r<t.length;r+=2)if(r+1<=t.length){const n=t[r],o=t[r+1];"number"==typeof n&&"number"==typeof o&&(n<e&&(e=n),n>s&&(s=n),o<i&&(i=o),o>a&&(a=o))}}),e===1/0?{x:0,y:0,width:0,height:0}:{x:e,y:i,width:s-e,height:a-i}}function Z(t){return t.map(t=>t.join(" ")).join(" ")}function K(t){switch(t[0]){case"z":case"Z":t[0]="L",t[1]=this.start[0],t[2]=this.start[1];break;case"H":t[0]="L",t[2]=this.pos[1];break;case"V":t[0]="L",t[2]=t[1],t[1]=this.pos[0];break;case"T":t[0]="Q",t[3]=t[1],t[4]=t[2],t[1]=this.reflection[1],t[2]=this.reflection[0];break;case"S":t[0]="C",t[6]=t[4],t[5]=t[3],t[4]=t[2],t[3]=t[1],t[2]=this.reflection[1],t[1]=this.reflection[0]}return t}function J(t){var e=t.length;return this.pos=[t[e-2],t[e-1]],-1!="SCQT".indexOf(t[0])&&(this.reflection=[2*this.pos[0]-t[e-4],2*this.pos[1]-t[e-3]]),t}function Q(t){var e,i=[t];switch(t[0]){case"M":return this.pos=this.start=[t[1],t[2]],i;case"L":t[5]=t[3]=t[1],t[6]=t[4]=t[2],t[1]=this.pos[0],t[2]=this.pos[1];break;case"Q":t[6]=t[4],t[5]=t[3],t[4]=1*t[4]/3+2*t[2]/3,t[3]=1*t[3]/3+2*t[1]/3,t[2]=1*this.pos[1]/3+2*t[2]/3,t[1]=1*this.pos[0]/3+2*t[1]/3;break;case"A":i=function(t,e){var i,s,a,r,n,o,l,h,c,d,p,u,g,f,x,m,b,y,w,v,A,S,C,k,_,M,D=Math.abs(e[1]),L=Math.abs(e[2]),P=e[3]%360,E=e[4],T=e[5],F=e[6],I=e[7],R=new G(t[0],t[1]),X=new G(F,I),z=[];if(0===D||0===L||R.x===X.x&&R.y===X.y)return[["C",R.x,R.y,X.x,X.y,X.x,X.y]];i=new G((R.x-X.x)/2,(R.y-X.y)/2).transform((new j).rotate(P)),(s=i.x*i.x/(D*D)+i.y*i.y/(L*L))>1&&(D*=s=Math.sqrt(s),L*=s);a=(new j).rotate(P).scale(1/D,1/L).rotate(-P),R=R.transform(a),X=X.transform(a),r=[X.x-R.x,X.y-R.y],o=r[0]*r[0]+r[1]*r[1],n=Math.sqrt(o),r[0]/=n,r[1]/=n,l=o<4?Math.sqrt(1-o/4):0,E===T&&(l*=-1);h=new G((X.x+R.x)/2+l*-r[1],(X.y+R.y)/2+l*r[0]),c=new G(R.x-h.x,R.y-h.y),d=new G(X.x-h.x,X.y-h.y),p=Math.acos(c.x/Math.sqrt(c.x*c.x+c.y*c.y)),c.y<0&&(p*=-1);u=Math.acos(d.x/Math.sqrt(d.x*d.x+d.y*d.y)),d.y<0&&(u*=-1);T&&p>u&&(u+=2*Math.PI);!T&&p<u&&(u-=2*Math.PI);for(f=Math.ceil(2*Math.abs(p-u)/Math.PI),m=[],b=p,g=(u-p)/f,x=4*Math.tan(g/4)/3,A=0;A<=f;A++)w=Math.cos(b),y=Math.sin(b),v=new G(h.x+w,h.y+y),m[A]=[new G(v.x+x*y,v.y-x*w),v,new G(v.x-x*y,v.y+x*w)],b+=g;for(m[0][0]=m[0][1].clone(),m[m.length-1][2]=m[m.length-1][1].clone(),a=(new j).rotate(P).scale(D,L).rotate(-P),A=0,S=m.length;A<S;A++)m[A][0]=m[A][0].transform(a),m[A][1]=m[A][1].transform(a),m[A][2]=m[A][2].transform(a);for(A=1,S=m.length;A<S;A++)C=(v=m[A-1][2]).x,k=v.y,_=(v=m[A][0]).x,M=v.y,F=(v=m[A][1]).x,I=v.y,z.push(["C",C,k,_,M,F,I]);return z}(null!=(e=this.pos)?e:[],t),t=i[0]}return t[0]="C",this.pos=[t[5],t[6]],this.reflection=[2*t[5]-t[3],2*t[6]-t[4]],i}function tt(t,e){if(!1===e)return!1;for(var i=e,s=t.length;i<s;++i)if("M"==t[i][0])return i;return!1}function et(t,e,i,s,a,r){for(var n=t.slice(e,i||void 0),o=s.slice(a,r||void 0),l=0,h={pos:[0,0],start:[0,0]},c={pos:[0,0],start:[0,0]};n[l]=K.call(h,n[l]),o[l]=K.call(c,o[l]),n[l][0]!=o[l][0]||"M"==n[l][0]||"A"==n[l][0]&&(n[l][4]!=o[l][4]||n[l][5]!=o[l][5])?(Array.prototype.splice.apply(n,[l,1].concat(Q.call(h,n[l]))),Array.prototype.splice.apply(o,[l,1].concat(Q.call(c,o[l])))):(n[l]=J.call(h,n[l]),o[l]=J.call(c,o[l])),++l!=n.length||l!=o.length;)l==n.length&&n.push(["C",h.pos[0],h.pos[1],h.pos[0],h.pos[1],h.pos[0],h.pos[1]]),l==o.length&&o.push(["C",c.pos[0],c.pos[1],c.pos[0],c.pos[1],c.pos[0],c.pos[1]]);return{start:n,dest:o}}function it(t,e){var i=function(t,e){for(var i,s=U(t),a=U(e),r=0,n=0,o=!1,l=!1;!1!==r||!1!==n;){if(o=tt(s,!1!==r&&r+1),l=tt(a,!1!==n&&n+1),!1===r){const t=q(i.start);r=0==t.height||0==t.width?s.push(s[0])-1:s.push(["M",t.x+t.width/2,t.y+t.height/2])-1}if(!1===n){const t=q(i.dest);n=0==t.height||0==t.width?a.push(a[0])-1:a.push(["M",t.x+t.width/2,t.y+t.height/2])-1}i=et(s,r,o,a,n,l),s=s.slice(0,r).concat(i.start,!1===o?[]:s.slice(o)),a=a.slice(0,n).concat(i.dest,!1===l?[]:a.slice(l)),r=!1!==o&&r+i.start.length,n=!1!==l&&n+i.dest.length}return{start:s,dest:a}}(t,e),s=i.start,a=i.dest;return function(t){return Z(s.map(function(e,i){return a[i].map(function(s,r){return 0===r?s:e[r]+(a[i][r]-e[r])*t})}))}}let st=null,at=null;function rt(t,e){const i=new Array(e);if(!d.isBrowser()){const s=q(U(t)),a=s.x+s.width/2,r=s.y+s.height/2;for(let t=0;t<e;t++)i[t]={x:a,y:r};return i}st||(st=document.createElementNS("http://www.w3.org/2000/svg","svg"),st.setAttribute("width","0"),st.setAttribute("height","0"),st.setAttribute("style","position:absolute;width:0;height:0;visibility:hidden;pointer-events:none;"),at=document.createElementNS("http://www.w3.org/2000/svg","path"),st.appendChild(at),document.body.appendChild(st)),at.setAttribute("d",t||"M0 0");let s=0;try{s=at.getTotalLength()}catch(t){s=0}if(!s||!isFinite(s)){const s=q(U(t)),a=s.x+s.width/2,r=s.y+s.height/2;for(let t=0;t<e;t++)i[t]={x:a,y:r};return i}for(let t=0;t<e;t++)try{const a=at.getPointAtLength(t/e*s);i[t]={x:a.x,y:a.y}}catch(e){i[t]={x:0,y:0}}return i}function nt(t){return-Math.cos(t*Math.PI)/2+.5}let ot=nt;function lt(t){if(!t||"string"!=typeof t)return null;if("#"===t[0]){let e=t.slice(1);3===e.length&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]);const i=parseInt(e,16);return[i>>16&255,i>>8&255,255&i,1]}const e=t.match(/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*([\d.]+))?\s*\)/);return e?[+e[1],+e[2],+e[3],void 0!==e[4]?+e[4]:1]:null}function ht(t,e,i){return`rgba(${Math.round(t[0]+(e[0]-t[0])*i)},${Math.round(t[1]+(e[1]-t[1])*i)},${Math.round(t[2]+(e[2]-t[2])*i)},${t[3]+(e[3]-t[3])*i})`}class ct{constructor(t,e,i){this.el=t,this.duration=null!=e?e:300,this.delay=i||0,this._attrTarget=null,this._plotTarget=null,this._plotSnap=null,this._plotAlgorithm="commands",this._afterCb=null,this._duringCb=null,this._easing=null,this._next=null,this._root=null,this._scheduled=!1}ease(t){return"function"==typeof t&&(this._easing=t),this._schedule(),this}attr(t){return this._attrTarget=t,this._schedule(),this}plot(t,e,i){return this._plotTarget=t,e&&(this._plotAlgorithm=e),this._plotSnap=i||null,this._schedule(),this}after(t){return this._afterCb=t,this._schedule(),this}during(t){return this._duringCb=t,this._schedule(),this}animate(t,e){const i=new ct(this.el,t,e);return this._next=i,i._root=this._root||this,i}_schedule(){const t=this._root||this;t._scheduled||(t._scheduled=!0,queueMicrotask(()=>t._executeChain()))}_executeChain(){const t=[];let e=this;for(;e;)t.push(e),e=e._next;let i=0;t.forEach(t=>{i+=t.delay,t._execute(i),i+=t.duration})}_execute(t){const e=this.el,i=this.duration;if(i<=1){const i=()=>{this._attrTarget&&e.attr(this._attrTarget),this._plotTarget&&e.plot(this._plotSnap||this._plotTarget),this._afterCb&&this._afterCb.call(e)};return void(t>0?setTimeout(i,t):i())}const s=()=>{const t={},s={},a={};if(this._attrTarget)for(const i of Object.keys(this._attrTarget)){const r=e.attr(i);t[i]=r;const n=lt(r),o=lt(String(this._attrTarget[i]));n&&o&&(s[i]=n,a[i]=o)}let r=null;if(this._plotTarget){const t=e.attr("d")||"";try{r="polygons"===this._plotAlgorithm?function(t,e,i=96){const s=rt(t,i),a=rt(e,i);let r=0,n=1/0;for(let t=0;t<i;t++){let e=0;for(let r=0;r<i;r++){const o=s[(r+t)%i],l=a[r],h=o.x-l.x,c=o.y-l.y;if(e+=h*h+c*c,e>=n)break}e<n&&(n=e,r=t)}const o=new Array(i);for(let t=0;t<i;t++)o[t]=s[(t+r)%i];return function(t){let e="";for(let s=0;s<i;s++){const i=o[s],r=a[s],n=i.x+(r.x-i.x)*t,l=i.y+(r.y-i.y)*t;e+=(0===s?"M":"L")+n.toFixed(3)+" "+l.toFixed(3)+" "}return e+"Z"}}(t,this._plotTarget):it(t,this._plotTarget)}catch(t){r=null}}const n=performance.now(),o=this._easing||ot,l=h=>{const c=h-n,d=Math.min(c/i,1),p=o(d);if(this._attrTarget)if(d>=1)e.attr(this._attrTarget);else{const i={};for(const e of Object.keys(this._attrTarget))if(s[e]&&a[e])i[e]=ht(s[e],a[e],p);else{const s=parseFloat(t[e]),a=parseFloat(this._attrTarget[e]);isNaN(s)||isNaN(a)||(i[e]=s+(a-s)*p)}e.attr(i)}r&&d<1&&e.attr("d",r(p)),this._duringCb&&this._duringCb(p),d<1?b.requestAnimationFrame(l):(this._plotTarget&&e.attr("d",this._plotSnap||this._plotTarget),this._afterCb&&this._afterCb.call(e))};b.requestAnimationFrame(l)};t>0?setTimeout(s,t):s()}}function dt(t){t.prototype.animate=function(t,e){return new ct(this,t,e)}}function pt(t){return-Math.cos(t*Math.PI)/2+.5}function ut(t,e,i,s){t=Math.min(Math.max(t,0),1),i=Math.min(Math.max(i,0),1);const a=3*t,r=3*(i-t)-a,n=1-a-r,o=3*e,l=3*(s-e)-o,h=1-o-l,c=t=>((n*t+r)*t+a)*t;return t=>t<=0?0:t>=1?1:(t=>((h*t+l)*t+o)*t)((t=>{let e=0,i=1,s=t;if(s<e)return e;if(s>i)return i;for(;e<i;){const a=c(s);if(Math.abs(a-t)<1e-4)return s;t>a?e=s:i=s,s=(e+i)/2}return s})(t))}const gt=new Map;function ft(t){return"function"==typeof t?xt(t):(e=t,Array.isArray(e)&&4===e.length&&e.every(t=>"number"==typeof t)?ut(t[0],t[1],t[2],t[3]):"string"==typeof t&&gt.has(t)?xt(gt.get(t)):pt);var e}function xt(t){return e=>{const i=t(e);return"number"==typeof i&&isFinite(i)?i:e}}gt.set("linear",t=>t),gt.set("easeInOutSine",pt),gt.set("easeInSine",t=>1-Math.cos(t*Math.PI/2)),gt.set("easeOutSine",t=>Math.sin(t*Math.PI/2)),gt.set("easeInQuad",t=>t*t),gt.set("easeOutQuad",t=>1-(1-t)*(1-t)),gt.set("easeInOutQuad",t=>t<.5?2*t*t:1-Math.pow(-2*t+2,2)/2),gt.set("easeInCubic",t=>t*t*t),gt.set("easeOutCubic",t=>1-Math.pow(1-t,3)),gt.set("easeInOutCubic",t=>t<.5?4*t*t*t:1-Math.pow(-2*t+2,3)/2),gt.set("easeOutBack",t=>{const e=1.70158;return 1+2.70158*Math.pow(t-1,3)+e*Math.pow(t-1,2)}),gt.set("easeInOutBack",t=>{const e=2.5949095;return t<.5?Math.pow(2*t,2)*(7.189819*t-e)/2:(Math.pow(2*t-2,2)*((e+1)*(2*t-2)+e)+2)/2});const mt="http://www.w3.org/2000/svg";function bt(t){return 1-Math.pow(1-t,3)}let yt=null;function wt(){if(!d.isBrowser())return!1;try{return yt||(yt=window.matchMedia("(prefers-reduced-motion: reduce)")),!!yt.matches}catch(t){return!1}}function vt(t,e,i){if(!d.isBrowser())return!1;if(i.globals.dataChanged||i.globals.resized)return!1;const s=i.config.chart.animations;if(!s||!1===s.enabled)return!1;const a=i.config.chart.type;if("line"!==a&&"area"!==a&&"rangeArea"!==a)return!1;if(!(i.layout.gridWidth>0))return!1;const r=2*(s.speed||800),n=Math.max(0,Math.min(1,e/i.layout.gridWidth)),o=(1-Math.cbrt(1-n))*r,l=t.node.style;l.opacity="0";let h=null;const c=t=>{null===h&&(h=t),t-h>=o?l.opacity="":b.requestAnimationFrame(c)};return b.requestAnimationFrame(c),!0}function At(t){const e=t.config.chart.animations;var i;e&&(!1!==e.respectReducedMotion&&wt()&&(e.enabled=!1,e.dynamicAnimation&&(e.dynamicAnimation.enabled=!1)),i=ft(e.easing),ot="function"==typeof i?i:nt)}function St(t){const e=t.style,i=t.index||0,s="number"==typeof t.baseDelay?t.baseDelay:40,a=t.row||0,r=t.col||0,n=t.groupIndex||0,o=t.perGroup||1,l=t.centerDistance||0;switch(e){case"none":return 0;case"diagonal":return(a+r)*s;case"group":return n*s+i%o*(s/4);case"centroid":return l*s*(i+1);default:return i*s}}class Ct{constructor(t,e){this.w=t,this.ctx=e}animateLine(t,e,i,s){t.attr(e).animate(s).attr(i)}animateMarker(t,e,i,s){t.attr({opacity:0}).animate(e).attr({opacity:1}).after(()=>{s()})}animatePop(t,{speed:e,delay:i=0,onComplete:s}){const a=this.w;if(!d.isBrowser()||!a.globals.shouldAnimate||e<1)return void(s&&s());const r=t.node.style;r.transformBox="fill-box",r.transformOrigin="center",r.transform="scale(0)",r.opacity="0";const n=performance.now()+i,o=t=>{if(a.globals.isDestroyed)return;const i=Math.max(0,Math.min(1,(t-n)/e));r.transform=`scale(${function(t){const e=1.70158;return 1+2.70158*Math.pow(t-1,3)+e*Math.pow(t-1,2)}(i)})`,r.opacity=String(Math.min(1,2*i)),i<1?b.requestAnimationFrame(o):(r.transform="",r.transformOrigin="",r.transformBox="",r.opacity="",s&&s())};b.requestAnimationFrame(o)}animateRect(t,e,i,s,a,r=0){t.attr(e).animate(s,r).attr(i).after(()=>a())}animatePathsGradually(t){const{el:e,realIndex:i,j:s,fill:a,pathFrom:r,pathTo:n,pathToInterp:o,speed:l,delay:h,scrollMorph:c}=t,d=this.w;let p=0;d.config.chart.animations.animateGradually.enabled&&(p=d.config.chart.animations.animateGradually.delay),d.config.chart.animations.dynamicAnimation.enabled&&d.globals.dataChanged&&"bar"!==d.config.chart.type&&(p=0),this.morphSVG(e,i,s,"line"!==d.config.chart.type||d.globals.comboCharts?a:"stroke",r,n,l,h*p,c,o)}revealBulk(t){const e=this.w;t.node.classList.add("apexcharts-element-hidden"),e.globals.delayedElements.push({el:t.node}),d.isBrowser()&&e.globals.shouldAnimate?e.globals.bulkRevealScheduled||(e.globals.bulkRevealScheduled=!0,b.requestAnimationFrame(()=>{e.globals.isDestroyed||(e.globals.bulkRevealScheduled=!1,this.animationCompleted(t))})):this.animationCompleted(t)}showDelayedElements(){this.w.globals.delayedElements.forEach(t=>{if(t.holdUntilComplete&&!this.w.globals.animationEnded)return;const e=t.el;e.classList.remove("apexcharts-element-hidden"),e.classList.add("apexcharts-hidden-element-shown")})}animationCompleted(t){const e=this.w;e.globals.animationEnded||(e.globals.animationEnded=!0,this.showDelayedElements(),"function"==typeof e.config.chart.events.animationEnd&&e.config.chart.events.animationEnd(this.ctx,{el:t,w:e}))}animateDraw(t,{realIndex:e,j:i,isFill:s,isLast:a,speed:r,delay:n,mask:o}){const l=this.w,h=this,c=()=>{a&&l.globals.shouldAnimate&&h.animationCompleted(t),h.showDelayedElements()};if(!d.isBrowser()||!l.globals.shouldAnimate||r<1)return void c();const p=t.node,u=()=>{const t=o&&"radial"===o.type,a=l.layout.gridWidth+8,h=o&&o.cx||0,d=o&&o.cy||0,u=(o&&o.r||l.layout.gridWidth/2)+4,g=`apexDrawMask${l.globals.cuid}-${e}-${null!=i?i:0}-${s?"f":"s"}`,f=b.createElementNS(mt,"mask");let x;if(f.setAttribute("id",g),f.setAttribute("maskUnits","userSpaceOnUse"),t){const t=u;f.setAttribute("x",String(h-t)),f.setAttribute("y",String(d-t)),f.setAttribute("width",String(2*t)),f.setAttribute("height",String(2*t)),x=b.createElementNS(mt,"circle"),x.setAttribute("cx",String(h)),x.setAttribute("cy",String(d)),x.setAttribute("r","0"),x.setAttribute("fill","#fff")}else f.setAttribute("x",String(-4)),f.setAttribute("y",String(-4)),f.setAttribute("width",String(a)),f.setAttribute("height",String(l.layout.gridHeight+8)),x=b.createElementNS(mt,"rect"),x.setAttribute("x",String(-4)),x.setAttribute("y",String(-4)),x.setAttribute("width","0"),x.setAttribute("height",String(l.layout.gridHeight+8)),x.setAttribute("fill","#fff");f.appendChild(x),l.dom.elDefs.node.appendChild(f),p.setAttribute("mask",`url(#${g})`);const m=performance.now()+(n||0),y=e=>{if(l.globals.isDestroyed)return;const i=Math.max(0,Math.min(1,(e-m)/r)),s=bt(i);t?x.setAttribute("r",String(s*u)):x.setAttribute("width",String(s*a)),i<1?b.requestAnimationFrame(y):(p.removeAttribute("mask"),f.parentNode&&f.parentNode.removeChild(f),c())};b.requestAnimationFrame(y)};b.requestAnimationFrame(()=>{if(l.globals.isDestroyed)return;if(s)return void u();const t=p.getAttribute("stroke-dasharray");if(!!t&&"0"!==t&&""!==t)return void u();let e=0;try{"function"==typeof p.getTotalLength&&(e=p.getTotalLength())}catch(t){e=0}e?(t=>{p.setAttribute("stroke-dasharray",String(t)),p.setAttribute("stroke-dashoffset",String(t));const e=performance.now()+(n||0),i=s=>{if(l.globals.isDestroyed)return;const a=Math.max(0,Math.min(1,(s-e)/r));p.setAttribute("stroke-dashoffset",String(t*(1-bt(a)))),a<1?b.requestAnimationFrame(i):(p.removeAttribute("stroke-dasharray"),p.removeAttribute("stroke-dashoffset"),c())};b.requestAnimationFrame(i)})(e):c()})}morphSVG(t,e,i,s,a,r,n,o,l,h){var c,d;const p=this.w;a||(a=t.attr("pathFrom")),r||(r=t.attr("pathTo"));const u=()=>("radar"===p.config.chart.type&&(n=1),`M 0 ${p.layout.gridHeight}`);(!a||a.indexOf("undefined")>-1||a.indexOf("NaN")>-1)&&(a=u()),(!r.trim()||r.indexOf("undefined")>-1||r.indexOf("NaN")>-1)&&(r=u(),h=void 0),h&&(!h.trim()||h.indexOf("undefined")>-1||h.indexOf("NaN")>-1)&&(h=void 0),p.globals.shouldAnimate||(n=1);const g=!0===(null==(d=null==(c=this.ctx)?void 0:c.morphTypeChange)?void 0:d.isActive())?"polygons":"commands";let f=null;if(p.globals.dataChanged){const t=p.config.chart.animations.dynamicAnimation.easing;null!=t?f=ft(t):l&&(f=ft("linear"))}const x=t.plot(a).animate(n,o);f&&x.ease(f),x.plot(h||r,g,h?r:void 0).after(()=>{if(v.isNumber(i)){const e=p.seriesData.series[p.globals.maxValsInArrayIndex];e&&i===e.length-2&&p.globals.shouldAnimate&&this.animationCompleted(t)}else"none"!==s&&p.globals.shouldAnimate&&(!p.globals.comboCharts&&e===p.seriesData.series.length-1||p.globals.comboCharts)&&this.animationCompleted(t);this.showDelayedElements()})}}const kt=.15,_t=.35;class Mt{constructor(t){this.w=t}static isSliceChart(t){const e=t.config.chart.type;return"pie"===e||"donut"===e||"polarArea"===e}static hoverOutlineOwnsHoverState(t){var e;return Mt.isSliceChart(t)&&"none"!==t.config.states.hover.filter.type&&!0===(null==(e=t.config.plotOptions.pie.hoverOutline)?void 0:e.show)}static sliceOffsetOwnsActiveState(t){return Mt.isSliceChart(t)&&"polarArea"!==t.config.chart.type&&!0===t.config.plotOptions.pie.expandOnClick&&t.config.plotOptions.pie.expandOffset>0&&!Mt.drilldownBlocksSliceOffset(t)}static drilldownBlocksSliceOffset(t){var e;return Mt.isSliceChart(t)&&!0===(null==(e=t.config.drilldown)?void 0:e.enabled)}getDefaultFilter(t,e){const i=this.w;t.unfilter&&t.unfilter(!0),i.config.chart.dropShadow.enabled&&this.dropShadow(t,i.config.chart.dropShadow,e)}applyFilter(t,e,i,s){var a,r,n;const o=this.w;if(t.unfilter&&t.unfilter(!0),"none"===i)return void this.getDefaultFilter(t,e);const l=o.config.chart.dropShadow,h="lighten"===i?kt:_t,c=Math.max(0,Math.min(1,"number"==typeof s?s:h)),d=1-c,p="lighten"===i?c:0;t.filterWith&&(t.filterWith(t=>{t.colorMatrix({type:"matrix",values:`\n            ${d} 0 0 0 ${p}\n            0 ${d} 0 0 ${p}\n            0 0 ${d} 0 ${p}\n            0 0 0 1 0\n          `,in:"SourceGraphic",result:"brightness"}),l.enabled&&this.addShadow(t,e,l,"brightness")}),l.noUserSpaceOnUse||null==(r=null==(a=t.filterer())?void 0:a.node)||r.setAttribute("filterUnits","userSpaceOnUse"),this._scaleFilterSize(null==(n=t.filterer())?void 0:n.node))}addShadow(t,e,i,s){var a;const r=this.w;let{blur:n,top:o,left:l,color:h,opacity:c}=i;if(h=Array.isArray(h)?h[e]:h,(null==(a=r.config.chart.dropShadow.enabledOnSeries)?void 0:a.length)>0&&-1===r.config.chart.dropShadow.enabledOnSeries.indexOf(e))return t;t.offset({in:s,dx:l,dy:o,result:"offset"}),t.gaussianBlur({in:"offset",stdDeviation:n,result:"blur"}),t.flood({"flood-color":h,"flood-opacity":c,result:"flood"}),t.composite({in:"flood",in2:"blur",operator:"in",result:"shadow"}),t.merge(["shadow",s])}dropShadow(t,e,i=0){var s,a,r,n,o;const l=this.w;return t.unfilter&&t.unfilter(!0),v.isMsEdge()&&"radialBar"===l.config.chart.type||(null==(s=l.config.chart.dropShadow.enabledOnSeries)?void 0:s.length)>0&&-1===(null==(a=l.config.chart.dropShadow.enabledOnSeries)?void 0:a.indexOf(i))||t.filterWith&&(t.filterWith(t=>{this.addShadow(t,i,e,"SourceGraphic")}),e.noUserSpaceOnUse||null==(n=null==(r=t.filterer())?void 0:r.node)||n.setAttribute("filterUnits","userSpaceOnUse"),this._scaleFilterSize(null==(o=t.filterer())?void 0:o.node)),t}setSelectionFilter(t,e,i){const s=this.w;if(void 0!==s.interact.selectedDataPoints[e]&&s.interact.selectedDataPoints[e].indexOf(i)>-1){if(t.node.setAttribute("selected",!0),Mt.sliceOffsetOwnsActiveState(s))return;const i=s.config.states.active.filter;"none"!==i.type&&this.applyFilter(t,e,i.type,i.value)}}_scaleFilterSize(t){if(!t)return;(e=>{for(const i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.setAttribute(i,e[i])})({width:"200%",height:"200%",x:"-50%",y:"-50%"})}}class Dt{constructor(t,e=null){this.w=t,this.ctx=e}roundPathCorners(t,e){function i(t,e,i){var a=e.x-t.x,r=e.y-t.y,n=Math.sqrt(a*a+r*r);return n?s(t,e,Math.min(1,i/n)):{x:t.x,y:t.y}}function s(t,e,i){return{x:t.x+(e.x-t.x)*i,y:t.y+(e.y-t.y)*i}}function a(t,e){t.length>2&&(t[t.length-2]=e.x,t[t.length-1]=e.y)}function r(t){return{x:parseFloat(t[t.length-2]),y:parseFloat(t[t.length-1])}}t.indexOf("NaN")>-1&&(t="");var n=t.split(/[,\s]/).reduce(function(t,e){var i=e.match(/^([a-zA-Z])(.+)/);return i?(t.push(i[1]),t.push(i[2])):t.push(e),t},[]).reduce(function(t,e){return parseFloat(e)==e&&t.length?t[t.length-1].push(e):t.push([e]),t},[]),o=[];if(n.length>1){var l=r(n[0]),h=null;"Z"==n[n.length-1][0]&&n[0].length>2&&(h=["L",l.x,l.y],n[n.length-1]=h),o.push(n[0]);for(var c=1;c<n.length;c++){var d=o[o.length-1],p=n[c],u=p==h?n[1]:n[c+1];if(u&&d&&d.length>2&&"L"==p[0]&&u.length>2&&"L"==u[0]){var g,f,x=r(d),m=r(p),b=r(u);g=i(m,x,e),f=i(m,b,e),a(p,g),p.origPoint=m,o.push(p);var y=s(g,m,.5),w=s(m,f,.5),v=["C",y.x,y.y,w.x,w.y,f.x,f.y];v.origPoint=m,o.push(v)}else o.push(p)}if(h){var A=r(o[o.length-1]);o.push(["Z"]),a(o[0],A)}}else o=n;return o.reduce(function(t,e){return t+e.join(" ")+" "},"")}drawLine(t,e,i,s,a="#a8a8a8",r=0,n=null,o="butt"){return this.w.dom.Paper.line().attr({x1:t,y1:e,x2:i,y2:s,stroke:a,"stroke-dasharray":r,"stroke-width":n,"stroke-linecap":o})}drawRect(t=0,e=0,i=0,s=0,a=0,r="#fefefe",n=1,o=null,l=null,h=0){const c=this.w.dom.Paper.rect();return c.attr({x:t,y:e,width:i>0?i:0,height:s>0?s:0,rx:a,ry:a,opacity:n,"stroke-width":null!==o?o:0,stroke:null!==l?l:"none","stroke-dasharray":h}),c.node.setAttribute("fill",r),c}drawPolygon(t,e="#e1e1e1",i=1,s="none"){return this.w.dom.Paper.polygon(t).attr({fill:s,stroke:e,"stroke-width":i})}drawCircle(t,e=null){t<0&&(t=0);const i=this.w.dom.Paper.circle(2*t);return null!==e&&i.attr(e),i}drawPath({d:t="",stroke:e="#a8a8a8",strokeWidth:i=1,fill:s,fillOpacity:a=1,strokeOpacity:r=1,classes:n,strokeLinecap:o=null,strokeDashArray:l=0}){const h=this.w;null===o&&(o=h.config.stroke.lineCap),(t.indexOf("undefined")>-1||t.indexOf("NaN")>-1)&&(t=`M 0 ${h.layout.gridHeight}`);return h.dom.Paper.path(t).attr({fill:s,"fill-opacity":a,stroke:e,"stroke-opacity":r,"stroke-linecap":o,"stroke-width":i,"stroke-dasharray":l,class:n})}group(t=null){const e=this.w.dom.Paper.group();return null!==t&&e.attr(t),e}move(t,e){return["M",t,e].join(" ")}line(t,e,i=null){return"H"===i?[" H",t].join(" "):"V"===i?[" V",e].join(" "):[" L",t,e].join(" ")}curve(t,e,i,s,a,r){return["C",t,e,i,s,a,r].join(" ")}quadraticCurve(t,e,i,s){return["Q",t,e,i,s].join(" ")}arc(t,e,i,s,a,r,n,o=!1){let l="A";o&&(l="a");return[l,t,e,i,s,a,r,n].join(" ")}renderPaths({j:t,realIndex:e,pathFrom:i,pathTo:s,pathToInterp:a,stroke:r,strokeWidth:n,strokeLinecap:h,fill:c,animationDelay:d,initialSpeed:p,dataChangeSpeed:u,className:g,chartType:f,shouldClipToGrid:x=!0,bindEventsOnPaths:m=!0,drawShadow:b=!0,drawMask:y=null,scrollMorph:w=!1}){var v,A,S,C;const k=this.w,_=new Mt(this.w),M=new Ct(this.w,null!=(v=this.ctx)?v:void 0),D=this.w.config.chart.animations.enabled,L=D&&this.w.config.chart.animations.dynamicAnimation.enabled;if(i&&i.startsWith("M 0 0 ")&&s){const t=s.match(/^M\s+[\d.-]+\s+[\d.-]+/);t&&(i=i.replace(/^M\s+0\s+0/,t[0]))}let P;const E=!0===(null==(S=null==(A=this.ctx)?void 0:A.morphTypeChange)?void 0:S.isActive()),T=!!(D&&!k.globals.resized||L&&k.globals.dataChanged&&k.globals.shouldAnimate||E&&D&&k.globals.shouldAnimate),F="string"==typeof g&&(g.indexOf("apexcharts-line")>-1||g.indexOf("apexcharts-area")>-1||g.indexOf("apexcharts-rangeArea")>-1||g.indexOf("apexcharts-radar")>-1),I=!(!D||k.globals.resized||k.globals.dataChanged||!F),R=null!=(C=k.config.chart.animations.largeDatasetThreshold)?C:0,X=!!(T&&!I&&R>0&&k.globals.dataPoints>R),z=!(!("candlestick"===f||"boxPlot"===f)||!T||I||!k.globals.dataChanged||E),B=X||z;!T||I||B?(P=s,T||(k.globals.animationEnded=!0)):P=i;const N=k.config.stroke.dashArray;let Y=0;Y=Array.isArray(N)?N[e]:k.config.stroke.dashArray;const O=this.drawPath({d:P,stroke:r,strokeWidth:n,fill:c,fillOpacity:1,classes:g,strokeLinecap:h,strokeDashArray:Y});O.attr("index",e),x&&("bar"===f&&!k.globals.isBarHorizontal||k.globals.comboCharts?O.attr({"clip-path":`url(#gridRectBarMask${k.globals.cuid})`}):O.attr({"clip-path":`url(#gridRectMask${k.globals.cuid})`})),k.config.chart.dropShadow.enabled&&b&&_.dropShadow(O,k.config.chart.dropShadow,e),m&&(O.node.addEventListener("mouseenter",this.pathMouseEnter.bind(this,O)),O.node.addEventListener("mouseleave",this.pathMouseLeave.bind(this,O)),O.node.addEventListener("mousedown",this.pathMouseDown.bind(this,O))),O.attr({pathTo:s,pathFrom:i});const W={el:O,j:t,realIndex:e,pathFrom:i,pathTo:s,pathToInterp:a,fill:c,strokeWidth:n,delay:d,scrollMorph:w};if(!D||k.globals.resized||k.globals.dataChanged)!k.globals.resized&&k.globals.dataChanged||B||M.showDelayedElements();else if(I){const i=2*p,s="none"===r||0===n,a=k.seriesData.series.length,o=!!k.globals.comboCharts||e===a-1;M.animateDraw(O,{realIndex:e,j:t,isFill:s,isLast:o,speed:i,delay:0,mask:y})}else B||M.animatePathsGradually(l(o({},W),{speed:p}));return T&&!B&&(k.globals.dataChanged&&L||E)&&M.animatePathsGradually(l(o({},W),{speed:u})),B&&M.revealBulk(O),O}drawPattern(t,e,i,s="#a8a8a8",a=0){return this.w.dom.Paper.pattern(e,i,r=>{"horizontalLines"===t?r.line(0,0,i,0).stroke({color:s,width:a+1}):"verticalLines"===t?r.line(0,0,0,e).stroke({color:s,width:a+1}):"slantedLines"===t?r.line(0,0,e,i).stroke({color:s,width:a}):"squares"===t?r.rect(e,i).fill("none").stroke({color:s,width:a}):"circles"===t&&r.circle(e).fill("none").stroke({color:s,width:a})})}drawGradient(t,e,i,s,a,r=null,n=null,o=[],l=0,h=!1){const c=this.w;let d;e.length<9&&0===e.indexOf("#")&&(e=v.hexToRgba(e,s)),i.length<9&&0===i.indexOf("#")&&(i=v.hexToRgba(i,a));let p=0,u=1,g=1,f=null;null!==n&&(p=void 0!==n[0]?n[0]/100:0,u=void 0!==n[1]?n[1]/100:1,g=void 0!==n[2]?n[2]/100:1,f=void 0!==n[3]?n[3]/100:null);const x=!("donut"!==c.config.chart.type&&"pie"!==c.config.chart.type&&"polarArea"!==c.config.chart.type&&"bubble"!==c.config.chart.type);if(d=o&&0!==o.length?c.dom.Paper.gradient(x?"radial":"linear",t=>{(Array.isArray(o[l])?o[l]:Array.isArray(o[0])?o[0]||[]:o).forEach(e=>{t.stop(e.offset/100,e.color,e.opacity)})}):c.dom.Paper.gradient(x?"radial":"linear",t=>{t.stop(p,e,s),t.stop(u,i,a),t.stop(g,i,a),null!==f&&t.stop(f,e,s)}),x){const t=c.layout.gridWidth/2,e=c.layout.gridHeight/2;"bubble"!==c.config.chart.type?d.attr({gradientUnits:"userSpaceOnUse",cx:t,cy:e,r:r}):d.attr({cx:.5,cy:.5,r:.8,fx:.2,fy:.2})}else"vertical"===t?h?(d.attr({gradientUnits:"userSpaceOnUse"}),d.from(0,0).to(0,c.layout.gridHeight)):d.from(0,0).to(0,1):"diagonal"===t?d.from(0,0).to(1,1):"horizontal"===t?d.from(0,1).to(1,1):"diagonal2"===t&&d.from(1,0).to(0,1);return d}getTextBasedOnMaxWidth({text:t,maxWidth:e,fontSize:i,fontFamily:s}){const a=this.getTextRects(t,i,s,""),r=a.width/t.length,n=Math.floor(e/r);return e<a.width?t.slice(0,n-3)+"...":t}drawText({x:t,y:e,text:i,textAnchor:s,fontSize:a,fontFamily:r,fontWeight:n,foreColor:l,opacity:h,maxWidth:c,cssClass:d="",isPlainText:p=!0,dominantBaseline:u="auto"}){const g=this.w;void 0===i&&(i="");let f=i;s||(s="start"),l&&l.length||(l=g.config.chart.foreColor),r=r||g.config.chart.fontFamily,n=n||"regular";const x={maxWidth:c,fontSize:a=a||"11px",fontFamily:r};let m;return Array.isArray(i)?m=g.dom.Paper.text(t=>{for(let e=0;e<i.length;e++)f=i[e],c&&(f=this.getTextBasedOnMaxWidth(o({text:i[e]},x))),0===e?t.tspan(f):t.tspan(f).newLine()}):(c&&(f=this.getTextBasedOnMaxWidth(o({text:i},x))),m=p?g.dom.Paper.plain(i):g.dom.Paper.text(t=>t.tspan(f))),m.attr({x:t,y:e,"text-anchor":s,"dominant-baseline":u,"font-size":a,"font-family":r,"font-weight":n,fill:l,class:"apexcharts-text "+d}),m.node.style.fontFamily=r,m.node.style.opacity=h,m}getMarkerPath(t,e,i,s){let a="";switch(i){case"cross":a=`M ${t-(s/=1.4)} ${e-s} L ${t+s} ${e+s}  M ${t-s} ${e+s} L ${t+s} ${e-s}`;break;case"plus":a=`M ${t-(s/=1.12)} ${e} L ${t+s} ${e}  M ${t} ${e-s} L ${t} ${e+s}`;break;case"star":case"sparkle":{let r=5;s*=1.15,"sparkle"===i&&(s/=1.1,r=4);const n=Math.PI/r;for(let i=0;i<=2*r;i++){const r=i*n,o=i%2==0?s:s/2;a+=(0===i?"M":"L")+(t+o*Math.sin(r))+","+(e-o*Math.cos(r))}a+="Z";break}case"triangle":a=`M ${t} ${e-s} \n             L ${t+s} ${e+s} \n             L ${t-s} ${e+s} \n             Z`;break;case"square":case"rect":a=`M ${t-(s/=1.125)} ${e-s} \n           L ${t+s} ${e-s} \n           L ${t+s} ${e+s} \n           L ${t-s} ${e+s} \n           Z`;break;case"diamond":a=`M ${t} ${e-(s*=1.05)} \n             L ${t+s} ${e} \n             L ${t} ${e+s} \n             L ${t-s} ${e} \n            Z`;break;case"line":a=`M ${t-(s/=1.1)} ${e} \n           L ${t+s} ${e}`;break;default:a=`M ${t}, ${e} \n           m -${(s*=2)/2}, 0 \n           a ${s/2},${s/2} 0 1,0 ${s},0 \n           a ${s/2},${s/2} 0 1,0 -${s},0`}return a}drawMarkerShape(t,e,i,s,a){const r=this.drawPath({d:this.getMarkerPath(t,e,i,s),stroke:a.pointStrokeColor,strokeDashArray:a.pointStrokeDashArray,strokeWidth:a.pointStrokeWidth,fill:a.pointFillColor,fillOpacity:a.pointFillOpacity,strokeOpacity:a.pointStrokeOpacity});return r.attr({cx:t,cy:e,shape:a.shape,class:a.class?a.class:""}),r}drawMarker(t,e,i){t=t||0;let s=i.pSize||0;return v.isNumber(e)||(s=0,e=0),this.drawMarkerShape(t,e,null==i?void 0:i.shape,s,o(o({},i),"line"===i.shape||"plus"===i.shape||"cross"===i.shape?{pointStrokeColor:i.pointFillColor,pointStrokeOpacity:i.pointFillOpacity}:{}))}pathMouseEnter(t,e){var i,s;const a=this.w,r=new Mt(this.w),n=parseInt(null!=(i=t.node.getAttribute("index"))?i:"",10),o=parseInt(null!=(s=t.node.getAttribute("j"))?s:"",10);if(!(isNaN(n)||isNaN(o)||("function"==typeof a.config.chart.events.dataPointMouseEnter&&a.config.chart.events.dataPointMouseEnter(e,this.ctx,{seriesIndex:n,dataPointIndex:o,w:a}),Dt._fireEvent(a,"dataPointMouseEnter",[e,this.ctx,{seriesIndex:n,dataPointIndex:o,w:a}]),"none"!==a.config.states.active.filter.type&&"true"===t.node.getAttribute("selected")||Mt.hoverOutlineOwnsHoverState(a)||"none"===a.config.states.hover.filter.type||a.interact.isTouchDevice))){const e=a.config.states.hover.filter;r.applyFilter(t,n,e.type,e.value)}}pathMouseLeave(t,e){var i,s;const a=this.w,r=new Mt(this.w),n=parseInt(null!=(i=t.node.getAttribute("index"))?i:"",10),o=parseInt(null!=(s=t.node.getAttribute("j"))?s:"",10);isNaN(n)||isNaN(o)||("function"==typeof a.config.chart.events.dataPointMouseLeave&&a.config.chart.events.dataPointMouseLeave(e,this.ctx,{seriesIndex:n,dataPointIndex:o,w:a}),Dt._fireEvent(a,"dataPointMouseLeave",[e,this.ctx,{seriesIndex:n,dataPointIndex:o,w:a}]),"none"!==a.config.states.active.filter.type&&"true"===t.node.getAttribute("selected")||Mt.hoverOutlineOwnsHoverState(a)||"none"!==a.config.states.hover.filter.type&&r.getDefaultFilter(t,n))}_clearAllDataPointSelections(t,e){const i=this.w;i.interact.selectedDataPoints=[];const s=i.dom.Paper.find(".apexcharts-series path:not(.apexcharts-decoration-element)"),a=i.dom.Paper.find(".apexcharts-series circle:not(.apexcharts-decoration-element), .apexcharts-series rect:not(.apexcharts-decoration-element)"),r=i=>{Array.prototype.forEach.call(i,i=>{i.node.setAttribute("selected","false"),t.getDefaultFilter(i,e)})};r(s),r(a)}_togglePointSelection(t,e,i,s){const a=this.w;if("true"===t.node.getAttribute("selected")){t.node.setAttribute("selected","false");const e=a.interact.selectedDataPoints[i].indexOf(s);return e>-1&&a.interact.selectedDataPoints[i].splice(e,1),"false"}return!a.config.states.active.allowMultipleDataPointsSelection&&a.interact.selectedDataPoints.length>0&&this._clearAllDataPointSelections(e,i),t.node.setAttribute("selected","true"),void 0===a.interact.selectedDataPoints[i]&&(a.interact.selectedDataPoints[i]=[]),a.interact.selectedDataPoints[i].push(s),"true"}_applyPointSelectionFilter(t,e,i,s){const a=this.w;if(!Mt.sliceOffsetOwnsActiveState(a))if("true"===s){const s=a.config.states.active.filter;if("none"!==s)e.applyFilter(t,i,s.type,s.value);else if("none"!==a.config.states.hover.filter&&!a.interact.isTouchDevice){const s=a.config.states.hover.filter;e.applyFilter(t,i,s.type,s.value)}}else if("none"!==a.config.states.active.filter.type)if("none"===a.config.states.hover.filter.type||a.interact.isTouchDevice)e.getDefaultFilter(t,i);else{const s=a.config.states.hover.filter;e.applyFilter(t,i,s.type,s.value)}}pathMouseDown(t,e){var i,s;const a=this.w,r=new Mt(this.w),n=parseInt(null!=(i=t.node.getAttribute("index"))?i:"",10),o=parseInt(null!=(s=t.node.getAttribute("j"))?s:"",10);if(isNaN(n)||isNaN(o))return;const l=a.config.chart.link;if(!!(!l||"function"!=typeof l.dimension&&!l.enabled)){const e=this._togglePointSelection(t,r,n,o);this._applyPointSelectionFilter(t,r,n,e)}"function"==typeof a.config.chart.events.dataPointSelection&&a.config.chart.events.dataPointSelection(e,this.ctx,{selectedDataPoints:a.interact.selectedDataPoints,seriesIndex:n,dataPointIndex:o,w:a}),e&&Dt._fireEvent(a,"dataPointSelection",[e,this.ctx,{selectedDataPoints:a.interact.selectedDataPoints,seriesIndex:n,dataPointIndex:o,w:a}])}rotateAroundCenter(t){let e={};t&&"function"==typeof t.getBBox&&(e=t.getBBox());return{x:e.x+e.width/2,y:e.y+e.height/2}}setupEventDelegation(t,e){let i=null;t.node.addEventListener("mouseover",s=>{const a=Dt._findDelegateTarget(s.target,t.node,e);a&&a!==i&&(i&&i.instance&&this.pathMouseLeave(i.instance,s),i=a,a.instance&&this.pathMouseEnter(a.instance,s))}),t.node.addEventListener("mouseout",s=>{if(!i)return;(s.relatedTarget?Dt._findDelegateTarget(s.relatedTarget,t.node,e):null)!==i&&(i&&i.instance&&this.pathMouseLeave(i.instance,s),i=null)}),t.node.addEventListener("mousedown",i=>{const s=Dt._findDelegateTarget(i.target,t.node,e);s&&s.instance&&this.pathMouseDown(s.instance,i)})}static _fireEvent(t,e,i){const s=t.globals.events;if(!s||!Object.prototype.hasOwnProperty.call(s,e))return;const a=s[e];for(let t=0;t<a.length;t++)a[t].apply(null,i)}static _findDelegateTarget(t,e,i){for(;t&&t!==e&&t!==document;){if(t.matches&&t.matches(i))return t;t=t.parentNode}return null}static setAttrs(t,e){for(const i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.setAttribute(i,e[i])}getTextRects(t,e,i,s,a=!0,r){const n=this.w,o=[t,e,i,s,a,r].join("\0"),l=n.globals.textRectsCache;if(l&&l.has(o))return l.get(o);const h=this.drawText({x:-200,y:-200,text:t,textAnchor:"start",fontSize:e,fontFamily:i,fontWeight:r,foreColor:"#fff",opacity:0});s&&h.attr("transform",s),n.dom.Paper.add(h);let c=h.bbox();const d=c.y;a||(c=h.node.getBoundingClientRect()),h.remove();const p={width:c.width,height:c.height,centerOffset:a?d+c.height/2- -200:0};return l&&l.set(o,p),p}placeTextWithEllipsis(t,e,i){if("function"==typeof t.getComputedTextLength&&(t.textContent=e,e.length>0&&t.getComputedTextLength()>=i/1.1)){for(let s=e.length-3;s>0;s-=3)if(t.getSubStringLength(0,s)<=i/1.1)return void(t.textContent=e.substring(0,s)+"...");t.textContent="."}}}class Lt{constructor(t){this.w=t,this.opts=null,this.seriesIndex=0,this.patternIDs=[]}clippedImgArea(t){const e=this.w,i=e.config,s=parseInt(String(e.layout.gridWidth),10),a=parseInt(String(e.layout.gridHeight),10),r=s>a?s:a,n=t.image;let o=0,l=0;void 0===t.width&&void 0===t.height?void 0!==i.fill.image.width&&void 0!==i.fill.image.height?(o=i.fill.image.width+1,l=i.fill.image.height):(o=r+1,l=r):(o=t.width,l=t.height);const h=b.createElementNS($,"pattern");Dt.setAttrs(h,{id:t.patternID,patternUnits:t.patternUnits?t.patternUnits:"userSpaceOnUse",width:o+"px",height:l+"px"});const c=b.createElementNS($,"image");h.appendChild(c);const p=d.isBrowser()?window.SVG:global.SVG;c.setAttributeNS(p.xlink,"href",n),Dt.setAttrs(c,{x:0,y:0,preserveAspectRatio:"none",width:o+"px",height:l+"px"}),c.style.opacity=t.opacity,e.dom.elDefs.node.appendChild(h)}getSeriesIndex(t){const e=this.w,i=e.config.chart.type;return("bar"===i||"rangeBar"===i)&&e.config.plotOptions.bar.distributed||"heatmap"===i||"treemap"===i?this.seriesIndex=t.seriesNumber:this.seriesIndex=t.seriesNumber%e.seriesData.series.length,this.seriesIndex}getSeriesAxisRange(t){var e,i,s;const a=this.w,r=null!=(i=null==(e=a.globals.seriesYAxisReverseMap)?void 0:e[t])?i:0;return{minY:v.isNumber(a.globals.minYArr[t])?a.globals.minYArr[t]:a.globals.minY,maxY:v.isNumber(a.globals.maxYArr[t])?a.globals.maxYArr[t]:a.globals.maxY,reversed:!!(null==(s=a.config.yaxis[r])?void 0:s.reversed)}}computeColorStops(t,e){const i=this.w,{threshold:s,colorAboveThreshold:a,colorBelowThreshold:r}=e,{minY:n,maxY:o}=t,l=o-n;let h=0===l?s>o?0:100:(o-s)/l*100;t.reversed&&(h=100-h),h=Math.max(0,Math.min(h,100));const c=Array.isArray(i.config.fill.opacity)?i.config.fill.opacity[this.seriesIndex]:i.config.fill.opacity,d={offset:h,color:a,opacity:c},p={offset:h,color:r,opacity:c};return t.reversed?[p,d]:[d,p]}fillPath(t){var e,i,s,a;const r=this.w;this.opts=t;const n=this.w.config;let o,l,h;this.seriesIndex=this.getSeriesIndex(t);const c=n.plotOptions.line.colors.colorAboveThreshold&&n.plotOptions.line.colors.colorBelowThreshold;let d=this.getFillColors()[this.seriesIndex];void 0!==r.seriesData.seriesColors[this.seriesIndex]&&(d=r.seriesData.seriesColors[this.seriesIndex]),"function"==typeof d&&(d=d({seriesIndex:this.seriesIndex,dataPointIndex:t.dataPointIndex,value:t.value,w:r}));const p=t.fillType?t.fillType:this.getFillType(this.seriesIndex);let u=Array.isArray(n.fill.opacity)?n.fill.opacity[this.seriesIndex]:n.fill.opacity;const g="gradient"===p||c;t.color&&(d=t.color);const f=r.config.series[this.seriesIndex];(null==(i=null==(e=null==f?void 0:f.data)?void 0:e[t.dataPointIndex])?void 0:i.fillColor)&&(d=null==(a=null==(s=null==f?void 0:f.data)?void 0:s[t.dataPointIndex])?void 0:a.fillColor),d||(d="#fff"),void 0!==t.opacity&&null!==t.opacity&&(u=t.opacity);let x=d;v.isCSSVariable(d)?x=v.applyOpacityToColor(d,u):-1===d.indexOf("rgb")?-1===d.indexOf("#")?x=d:d.length<9&&(x=v.hexToRgba(d,u)):d.indexOf("rgba")>-1?u=v.getOpacityFromRGBA(d):x=v.hexToRgba(v.rgb2hex(d),u);const m=v.isCSSVariable(d)?v.getThemeColor(d):d;if("pattern"===p&&(l=this.handlePatternFill({fillConfig:t.fillConfig,patternFill:l,fillColor:m,defaultColor:x})),g){const e=n.fill.gradient.colorStops?[...n.fill.gradient.colorStops]:[];let i=n.fill.gradient.type;c&&(e[this.seriesIndex]=this.computeColorStops(this.getSeriesAxisRange(this.seriesIndex),n.plotOptions.line.colors),i="vertical"),h=this.handleGradientFill({type:i,fillConfig:t.fillConfig,fillColor:m,fillOpacity:u,colorStops:e,i:this.seriesIndex,verticalUserSpace:c})}if("image"===p){const e=n.fill.image.src,i=t.patternID?t.patternID:"",s=`pattern${r.globals.cuid}${t.seriesNumber+1}${i}`;-1===this.patternIDs.indexOf(s)&&(this.clippedImgArea({opacity:u,image:Array.isArray(e)?t.seriesNumber<e.length?e[t.seriesNumber]:e[0]:e,width:t.width?t.width:void 0,height:t.height?t.height:void 0,patternUnits:t.patternUnits,patternID:s}),this.patternIDs.push(s)),o=`url(#${s})`}else o=g?h:"pattern"===p?l:x;return t.solid&&(o=x),o}getFillType(t){const e=this.w;return Array.isArray(e.config.fill.type)?e.config.fill.type[t]:e.config.fill.type}getFillColors(){const t=this.w,e=t.config,i=this.opts;let s=[];return t.globals.comboCharts?"line"===t.config.series[this.seriesIndex].type?Array.isArray(t.globals.stroke.colors)?s=t.globals.stroke.colors:s.push(t.globals.stroke.colors):Array.isArray(t.globals.fill.colors)?s=t.globals.fill.colors:s.push(t.globals.fill.colors):"line"===e.chart.type?Array.isArray(t.globals.stroke.colors)?s=t.globals.stroke.colors:s.push(t.globals.stroke.colors):Array.isArray(t.globals.fill.colors)?s=t.globals.fill.colors:s.push(t.globals.fill.colors),void 0!==i.fillColors&&(s=[],Array.isArray(i.fillColors)?s=i.fillColors.slice():s.push(i.fillColors)),s}handlePatternFill({fillConfig:t,patternFill:e,fillColor:i,defaultColor:s}){let a=this.w.config.fill;t&&(a=t);const r=this.opts,n=new Dt(this.w),o=Array.isArray(a.pattern.strokeWidth)?a.pattern.strokeWidth[this.seriesIndex]:a.pattern.strokeWidth,l=i;if(Array.isArray(a.pattern.style))if(void 0!==a.pattern.style[r.seriesNumber]){e=n.drawPattern(a.pattern.style[r.seriesNumber],a.pattern.width,a.pattern.height,l,o)}else e=s;else e=n.drawPattern(a.pattern.style,a.pattern.width,a.pattern.height,l,o);return e}handleGradientFill({type:t,fillColor:e,fillOpacity:i,fillConfig:s,colorStops:a,i:r,verticalUserSpace:n=!1}){let l=this.w.config.fill;s&&(l=o(o({},l),s));const h=this.opts,c=new Dt(this.w),d=new v;t=t||l.gradient.type;let p,u=e,g=void 0===l.gradient.opacityFrom?i:Array.isArray(l.gradient.opacityFrom)?l.gradient.opacityFrom[r]:l.gradient.opacityFrom;u.indexOf("rgba")>-1&&(g=v.getOpacityFromRGBA(u));let f=void 0===l.gradient.opacityTo?i:Array.isArray(l.gradient.opacityTo)?l.gradient.opacityTo[r]:l.gradient.opacityTo;if(void 0===l.gradient.gradientToColors||0===l.gradient.gradientToColors.length)p="dark"===l.gradient.shade?d.shadeColor(-1*parseFloat(l.gradient.shadeIntensity),e.indexOf("rgb")>-1?v.rgb2hex(e):e):d.shadeColor(parseFloat(l.gradient.shadeIntensity),e.indexOf("rgb")>-1?v.rgb2hex(e):e);else if(l.gradient.gradientToColors[h.seriesNumber]){const t=l.gradient.gradientToColors[h.seriesNumber];p=t,t.indexOf("rgba")>-1&&(f=v.getOpacityFromRGBA(t))}else p=e;if(l.gradient.gradientFrom&&(u=l.gradient.gradientFrom),l.gradient.gradientTo&&(p=l.gradient.gradientTo),l.gradient.inverseColors){const t=u;u=p,p=t}return u.indexOf("rgb")>-1&&(u=v.rgb2hex(u)),p.indexOf("rgb")>-1&&(p=v.rgb2hex(p)),c.drawGradient(t,u,p,g,f,h.size,l.gradient.stops,a,r,n)}}const Pt=["none","lighten","darken"];function Et(t,e){const i=t&&t.renderer;return i&&i.kind&&"svg"!==i.kind?i:e}function Tt(t){var e,i;const s=t.config.fill&&t.config.fill.type,a=t=>"pattern"===t||"image"===t||"gradient"===t;if(Array.isArray(s)?s.some(a):a(s))return!0;const r=null==(i=null==(e=t.config.plotOptions)?void 0:e.line)?void 0:i.colors;if(r&&r.colorAboveThreshold&&r.colorBelowThreshold)return!0;const n=t.config.states||{},o=n.hover&&n.hover.filter&&n.hover.filter.type,l=n.active&&n.active.filter&&n.active.filter.type;return!(!o||Pt.includes(o))||!(!l||Pt.includes(l))}class Ft{constructor(t,e){this.w=t,this.ctx=e,this._filters=new Mt(this.w),this._graphics=new Dt(this.w,this.ctx),this._seriesWrap=null,this._seriesWrapIndex=-1,this._batch=null}resetSeriesWrapCache(){this._seriesWrap=null,this._seriesWrapIndex=-1,this._batch=null}static markersAreInert(t){const e=t.config.chart.type;return!("line"!==e&&"area"!==e||t.globals.comboCharts||t.config.tooltip.intersect)}_shouldBatch(){var t,e,i,s,a;const r=this.w,n=r.config.markers,o=null!=(t=n.largeDatasetThreshold)?t:0;if(o<=0)return!1;if("canvas"===(null==(i=null==(e=this.ctx)?void 0:e.renderer)?void 0:i.kind))return!1;if(!Ft.markersAreInert(r))return!1;if(n.discrete&&n.discrete.length)return!1;if(n.onClick||n.onDblClick)return!1;if(null==(s=r.config.chart.events)?void 0:s.dataPointSelection)return!1;const l=r.seriesData.series;if(!Array.isArray(l)||!l.length)return!1;let h=!1;for(let t=0;t<l.length;t++){if(!Array.isArray(l[t]))return!1;let e=!1,i=!1;const s=null==(a=r.config.series[t])?void 0:a.data;for(let a=0;a<l[t].length;a++){null===l[t][a]&&(e=!0);const r=Array.isArray(s)?s[a]:null;if(r&&(r.fillColor||r.strokeColor)){i=!0;break}}if(i)return!1;(r.globals.markers.size[t]>0||e&&n.showNullDataPoints)&&(l[t].length>o&&(h=!0))}return h}setGlobalMarkerSize(){const t=this.w;if(t.globals.markers.size=Array.isArray(t.config.markers.size)?t.config.markers.size:[t.config.markers.size],t.globals.markers.size.length>0){if(t.globals.markers.size.length<t.seriesData.series.length+1)for(let e=0;e<=t.seriesData.series.length;e++)void 0===t.globals.markers.size[e]&&t.globals.markers.size.push(t.globals.markers.size[0])}else t.globals.markers.size=t.config.series.map(()=>t.config.markers.size);t.globals.markers.batched=this._shouldBatch()}plotChartMarkers({pointsPos:t,seriesIndex:e,j:i,pSize:s,alwaysDrawMarker:a=!1,isVirtualPoint:r=!1}){const n=this.w,o=e,l=t;let h=null;const c=new Dt(this.w),d=Et(this.ctx,c),p=n.config.markers.discrete&&n.config.markers.discrete.length;if(Array.isArray(l.x))for(let t=0;t<l.x.length;t++){let u,g=i,f=!v.isNumber(l.y[t]);0===n.globals.markers.largestSize&&n.globals.hasNullValues&&null!==n.seriesData.series[o][i+1]&&!r&&(f=!0),1===i&&0===t&&(g=0),1===i&&1===t&&(g=1);let x="apexcharts-marker";Ft.markersAreInert(n)&&(x+=" no-pointer-events");const m=Array.isArray(n.config.markers.size)?n.globals.markers.size[e]>0:n.config.markers.size>0;if(n.globals.markers.batched&&(m||a)&&!p&&!r)this._batchPoint(e,g,l.x[t],l.y[t],{invalid:f,graphics:c,pSize:a?s:void 0,trackPoint:!a});else if(m||a||p){"canvas"===d.kind&&(void 0===n.globals.pointsArray[e]&&(n.globals.pointsArray[e]=[]),n.globals.pointsArray[e][g]=[l.x[t],l.y[t]]),f||(x+=` w${v.randomId()}`);const i=this.getMarkerConfig({cssClass:x,seriesIndex:e,dataPointIndex:g}),r=n.config.series[o];if(r.data[g]&&(r.data[g].fillColor&&(i.pointFillColor=r.data[g].fillColor),r.data[g].strokeColor&&(i.pointStrokeColor=r.data[g].strokeColor)),void 0!==s&&(i.pSize=s),(l.x[t]<-n.globals.markers.largestSize||l.x[t]>n.layout.gridWidth+n.globals.markers.largestSize||l.y[t]<-n.globals.markers.largestSize||l.y[t]>n.layout.gridHeight+n.globals.markers.largestSize)&&(i.pSize=0),!f){if((n.globals.markers.size[e]>0||a||p)&&!h){const t=!a&&!p;t&&this._seriesWrap&&this._seriesWrapIndex===e?h=this._seriesWrap:(h=d.group({class:t?"apexcharts-series-markers":""}),h.attr("clip-path",`url(#gridRectMarkerMask${n.globals.cuid})`),this.setupMarkerDelegation(h),t&&(this._seriesWrap=h,this._seriesWrapIndex=e))}u=d.drawMarker(l.x[t],l.y[t],i),u.attr("rel",g),u.attr("j",g),u.attr("index",e),u.node.setAttribute("default-marker-size",i.pSize),vt(u,l.x[t],n),this._filters.setSelectionFilter(u,e,g),h&&h.add(u)}}else void 0===n.globals.pointsArray[e]&&(n.globals.pointsArray[e]=[]),n.globals.pointsArray[e].push([l.x[t],l.y[t]])}return h}_batchPoint(t,e,i,s,{invalid:a,graphics:r,pSize:n,trackPoint:o}){const l=this.w;if(o&&(void 0===l.globals.pointsArray[t]&&(l.globals.pointsArray[t]=[]),l.globals.pointsArray[t][e]=[i,s]),a)return;this._batch&&this._batch.seriesIndex===t||(this._batch={seriesIndex:t,opts:this.getMarkerConfig({cssClass:"",seriesIndex:t}),sizes:new Map});const h=void 0===n?this._batch.opts.pSize:n;if(!(h>0))return;const c=l.globals.markers.largestSize;if(i<-c||i>l.layout.gridWidth+c||s<-c||s>l.layout.gridHeight+c)return;let d=this._batch.sizes.get(h);d||(d=[],this._batch.sizes.set(h,d)),d.push(r.getMarkerPath(i,s,this._batch.opts.shape,h))}flushBatch(t,e){const i=this._batch;if(this._batch=null,!i||i.seriesIndex!==e||!i.sizes.size)return[];const s=this.w,a=new Dt(this.w),r=i.opts,n="line"===r.shape||"plus"===r.shape||"cross"===r.shape,o=n?r.pointFillColor:r.pointStrokeColor,l=n?r.pointFillOpacity:r.pointStrokeOpacity,h=[];return i.sizes.forEach((i,n)=>{if(!i.length)return;const c=a.drawPath({d:i.join(" "),fill:r.pointFillColor,fillOpacity:r.pointFillOpacity,stroke:o,strokeOpacity:l,strokeWidth:r.pointStrokeWidth,strokeDashArray:r.pointStrokeDashArray});c.attr({class:"apexcharts-marker-batch"+(Ft.markersAreInert(s)?" no-pointer-events":""),"clip-path":`url(#gridRectMarkerMask${s.globals.cuid})`,shape:r.shape,index:e,"default-marker-size":n}),t.add(c),h.push(c)}),h}getMarkerConfig({cssClass:t,seriesIndex:e,dataPointIndex:i=null,radius:s=null,size:a=null,strokeWidth:r=null}){const n=this.w,o=this.getMarkerStyle(e);let l=null===a?n.globals.markers.size[e]:a;const h=n.config.markers;return null!==i&&h.discrete.length&&h.discrete.map(t=>{t.seriesIndex===e&&t.dataPointIndex===i&&(void 0!==t.strokeColor&&(o.pointStrokeColor=t.strokeColor),void 0!==t.fillColor&&(o.pointFillColor=t.fillColor),void 0!==t.size&&(l=t.size),void 0!==t.shape&&(o.pointShape=t.shape))}),{pSize:null===s?l:s,pRadius:null!==s?s:h.radius,pointStrokeWidth:null!==r?r:Array.isArray(h.strokeWidth)?h.strokeWidth[e]:h.strokeWidth,pointStrokeColor:o.pointStrokeColor,pointFillColor:o.pointFillColor,shape:o.pointShape||(Array.isArray(h.shape)?h.shape[e]:h.shape),class:t,pointStrokeOpacity:Array.isArray(h.strokeOpacity)?h.strokeOpacity[e]:h.strokeOpacity,pointStrokeDashArray:Array.isArray(h.strokeDashArray)?h.strokeDashArray[e]:h.strokeDashArray,pointFillOpacity:Array.isArray(h.fillOpacity)?h.fillOpacity[e]:h.fillOpacity,seriesIndex:e}}setupMarkerDelegation(t){const e=this.w,i=".apexcharts-marker";this._graphics.setupEventDelegation(t,i),t.node.addEventListener("click",s=>{if(e.config.markers.onClick){Dt._findDelegateTarget(s.target,t.node,i)&&e.config.markers.onClick(s)}}),t.node.addEventListener("dblclick",s=>{if(e.config.markers.onDblClick){Dt._findDelegateTarget(s.target,t.node,i)&&e.config.markers.onDblClick(s)}}),t.node.addEventListener("touchstart",e=>{const s=Dt._findDelegateTarget(e.target,t.node,i);s&&s.instance&&this._graphics.pathMouseDown(s.instance,e)},{passive:!0})}getMarkerStyle(t){const e=this.w,i=e.globals.markers.colors,s=e.config.markers.strokeColor||e.config.markers.strokeColors;return{pointStrokeColor:Array.isArray(s)?s[t]:s,pointFillColor:Array.isArray(i)?i[t]:i}}}class It{constructor(t,e){this.ctx=e,this.w=t,this.initialAnim=this.w.config.chart.animations.enabled,this.anim=new Ct(this.w),this.filters=new Mt(this.w),this.fill=new Lt(this.w),this.markers=new Ft(this.w,this.ctx),this.graphics=new Dt(this.w),this._elPointsWrap=null,this._elPointsWrapParent=null,this._perSeries=null}draw(t,e,i){const s=this.w,a=this.graphics,r=Et(this.ctx,a),n=i.realIndex,o=i.pointsPos,l=i.zRatio,h=i.elParent;let c=this._elPointsWrap;if(c&&this._elPointsWrapParent===h||(c=r.group({class:`apexcharts-series-markers apexcharts-series-${s.config.chart.type}`}),c.attr("clip-path",`url(#gridRectMarkerMask${s.globals.cuid})`),this.markers.setupMarkerDelegation(c),h.add(c),this._elPointsWrap=c,this._elPointsWrapParent=h,this._perSeries=this._buildPerSeriesCache(n,r)),Array.isArray(o.x))for(let t=0;t<o.x.length;t++){let i=e+1,a=!0;0===e&&0===t&&(i=0),0===e&&1===t&&(i=1);let h=s.globals.markers.size[n];if(l!==1/0){const t=s.config.plotOptions.bubble;h=s.seriesData.seriesZ[n][i],t.zScaling&&(h/=l),t.minBubbleRadius&&h<t.minBubbleRadius&&(h=t.minBubbleRadius),t.maxBubbleRadius&&h>t.maxBubbleRadius&&(h=t.maxBubbleRadius)}const d=o.x[t],p=o.y[t];if(h=h||0,null!==p&&void 0!==s.seriesData.series[n][i]||(a=!1),a){const t=this.drawPoint(d,p,h,n,i,e);c.add(t),"canvas"===r.kind&&(void 0===s.globals.pointsArray[n]&&(s.globals.pointsArray[n]=[]),s.globals.pointsArray[n][i]=[d,p])}}}_buildPerSeriesCache(t,e){var i;const s=this.w;return{realIndex:t,emit:e,isBubble:"bubble"===s.config.chart.type||s.globals.comboCharts&&s.config.series[t]&&"bubble"===s.config.series[t].type,canCacheConfig:!s.config.markers.discrete.length,markerConfig:null,fillCacheable:void 0,fillCircle:void 0,dropShadowEnabled:s.config.chart.dropShadow.enabled,doInitialAnim:this.initialAnim&&!s.globals.dataChanged&&!s.globals.resized,jitter:null==(i=s.config.plotOptions.scatter)?void 0:i.jitter,anim:null}}drawPoint(t,e,i,s,a,r){var n;const o=this.w,l=s,h=this.anim,c=this.filters,d=this.fill,p=this.markers;let u=this._perSeries;u&&u.realIndex===s||(u=this._perSeries=this._buildPerSeriesCache(s,Et(this.ctx,this.graphics)));const g=u.emit;let f;u.canCacheConfig?(u.markerConfig||(u.markerConfig=p.getMarkerConfig({cssClass:"apexcharts-marker",seriesIndex:l,dataPointIndex:a,radius:u.isBubble?i:null})),f=u.markerConfig,u.isBubble&&(f.pSize=i,f.pRadius=i)):f=p.getMarkerConfig({cssClass:"apexcharts-marker",seriesIndex:l,dataPointIndex:a,radius:u.isBubble?i:null});const x=o.config.series[l].data[a];let m;void 0!==u.fillCircle?m=u.fillCircle:(m=d.fillPath({seriesNumber:s,dataPointIndex:a,color:f.pointFillColor,patternUnits:"objectBoundingBox",value:o.seriesData.series[s][r]}),void 0===u.fillCacheable&&(u.fillCacheable=u.canCacheConfig&&"solid"===d.getFillType(s)&&"string"==typeof f.pointFillColor&&!!f.pointFillColor),u.fillCacheable&&!(null==x?void 0:x.fillColor)&&(u.fillCircle=m));const b=g.drawMarker(t,e,f);(null==x?void 0:x.fillColor)&&(m=x.fillColor);const y=u.jitter;if((null==y?void 0:y.enabled)&&y.distributed&&o.globals.colors.length){const t=Math.round(null==(n=o.seriesData.seriesX[s])?void 0:n[a]);isNaN(t)||(m=o.globals.colors[t%o.globals.colors.length])}if(b.attr({fill:m}),u.dropShadowEnabled){const t=o.config.chart.dropShadow;c.dropShadow(b,t,s)}if(u.doInitialAnim){if(!u.anim){const t=o.config.chart.animations,e=o.globals.dataPoints||1,i=t.animateGradually,s=i&&!1!==i.enabled;u.anim={popSpeed:t.speed,baseDelay:s?Math.min(20,.5*t.speed/Math.max(1,e)):0}}const t=St({style:u.anim.baseDelay>0?"sequential":"none",index:a,baseDelay:u.anim.baseDelay});h.animatePop(b,{speed:u.anim.popSpeed,delay:t,onComplete:()=>h.animationCompleted(b)})}else o.globals.animationEnded=!0;return b.attr({rel:a,j:a,index:s,"default-marker-size":f.pSize}),c.setSelectionFilter(b,s,a),b}centerTextInBubble(t){const e=this.w;return{y:t+=parseInt(e.config.dataLabels.style.fontSize,10)/4}}}const Rt=(t,e,i,s)=>{if("function"!=typeof t)return t;const a=t({series:e.seriesData.series,seriesIndex:i,dataPointIndex:s,w:e});return Number.isFinite(a)?a:0};class Xt{constructor(t,e=null){this.w=t,this.ctx=e}dataLabelsCorrection(t,e,i,s,a,r,n){const o=this.w;let l=!1;const h=new Dt(this.w).getTextRects(i,n),c=h.width,d=h.height;e<0&&(e=0),e>o.layout.gridHeight+d&&(e=o.layout.gridHeight+d/2),void 0===o.globals.dataLabelsRects[s]&&(o.globals.dataLabelsRects[s]=[]),o.globals.dataLabelsRects[s].push({x:t,y:e,width:c,height:d});const p=o.globals.dataLabelsRects[s].length-2,u=void 0!==o.globals.lastDrawnDataLabelsIndexes[s]?o.globals.lastDrawnDataLabelsIndexes[s][o.globals.lastDrawnDataLabelsIndexes[s].length-1]:0;if(void 0!==o.globals.dataLabelsRects[s][p]){const i=o.globals.dataLabelsRects[s][u];(t>i.x+i.width||e>i.y+i.height||e+d<i.y||t+c<i.x)&&(l=!0)}return(0===a||r)&&(l=!0),{x:t,y:e,textRects:h,drawnextLabel:l}}drawDataLabel({type:t,pos:e,i:i,j:s,isRangeStart:a,strokeWidth:r=2}){const n=this.w,o=new Dt(this.w),l=n.config.dataLabels;let h=0,c=0,d=s,p=null;if(-1!==n.globals.collapsedSeriesIndices.indexOf(i)||!l.enabled||!Array.isArray(e.x))return p;p=o.group({class:"apexcharts-data-labels"});for(let o=0;o<e.x.length;o++)if(1===s&&0===o&&(d=0),1===s&&1===o&&(d=1),h=e.x[o]+Rt(l.offsetX,n,i,d),c=e.y[o]+Rt(l.offsetY,n,i,d)+r,!isNaN(h)){let s=n.seriesData.series[i][d];"rangeArea"===t&&(s=a?n.rangeData.seriesRangeStart[i][d]:n.rangeData.seriesRangeEnd[i][d]);let r="";const l=t=>n.config.dataLabels.formatter(t,{seriesIndex:i,dataPointIndex:d,w:n});if("bubble"===n.config.chart.type){s=n.seriesData.seriesZ[i][d],r=l(s),c=e.y[o];c=new It(this.w,this.ctx).centerTextInBubble(c).y}else void 0!==s&&(r=l(s));let u=n.config.dataLabels.textAnchor;n.globals.isSlopeChart&&(u=0===d?"end":d===n.config.series[i].data.length-1?"start":"middle"),this.plotDataLabelsText({x:h,y:c,text:r,i:i,j:d,parent:p,offsetCorrection:!0,dataLabelsConfig:n.config.dataLabels,textAnchor:u})}return p}plotDataLabelsText(t){const e=this.w,i=new Dt(this.w);let{x:s,y:a,i:r,j:n,text:o,textAnchor:l,fontSize:h,parent:c,dataLabelsConfig:d,color:p,alwaysDrawDataLabel:u,offsetCorrection:g,className:f,seriesIndex:x=r,dataPointIndex:m=n}=t,b=null;if(Array.isArray(e.config.dataLabels.enabledOnSeries)&&e.config.dataLabels.enabledOnSeries.indexOf(r)<0)return b;let y={x:s,y:a,drawnextLabel:!0,textRects:null};if(g&&(y=this.dataLabelsCorrection(s,a,o,r,n,u,parseInt(d.style.fontSize,10).toString())),e.interact.zoomed||(s=y.x,a=y.y),y.textRects){const t=e.globals.barPadForNumericAxis||0;(s<-(t+20)-y.textRects.width||s>e.layout.gridWidth+y.textRects.width+t+30)&&(o="")}let w=e.globals.dataLabels.style.colors[r];(("bar"===e.config.chart.type||"rangeBar"===e.config.chart.type)&&e.config.plotOptions.bar.distributed||e.config.dataLabels.distributed)&&(w=e.globals.dataLabels.style.colors[n]),"function"==typeof w&&(w=w({series:e.seriesData.series,seriesIndex:r,dataPointIndex:n,w:e})),p&&(w=p);const v="bar"===e.config.chart.type||"rangeBar"===e.config.chart.type,A=v?0:Rt(d.offsetX,e,x,m);let S=A;const C=v?0:Rt(d.offsetY,e,x,m);if(e.globals.isSlopeChart&&(0!==n&&(S=-2*A+5),0!==n&&n!==e.config.series[r].data.length-1&&(S=0)),y.drawnextLabel){if("middle"===l&&s===e.layout.gridWidth&&(l="end"),b=i.drawText({x:s+S,y:a+C,foreColor:w,textAnchor:l||d.textAnchor,text:o,fontSize:h||d.style.fontSize,fontFamily:d.style.fontFamily,fontWeight:d.style.fontWeight||"normal"}),b.attr({class:f||"apexcharts-datalabel",cx:s,cy:a}),d.dropShadow.enabled){const t=d.dropShadow;new Mt(this.w).dropShadow(b,t)}c.add(b),vt(b,s,e),void 0===e.globals.lastDrawnDataLabelsIndexes[r]&&(e.globals.lastDrawnDataLabelsIndexes[r]=[]),e.globals.lastDrawnDataLabelsIndexes[r].push(n)}return b}addBackgroundToDataLabel(t,e){const i=this.w,s=i.config.dataLabels.background,a=s.padding,r=s.padding/2,n=e.width,o=e.height,l=new Dt(this.w).drawRect(e.x-a,e.y-r/2,n+2*a,o+r,s.borderRadius,"transparent"!==i.config.chart.background&&i.config.chart.background?i.config.chart.background:"#fff",s.opacity,s.borderWidth,s.borderColor);if(s.dropShadow.enabled){new Mt(this.w).dropShadow(l,s.dropShadow)}return l}dataLabelsBackground(){var t;const e=this.w;if("bubble"===e.config.chart.type)return;const i=e.dom.baseEl.querySelectorAll(".apexcharts-datalabels text");for(let s=0;s<i.length;s++){const a=i[s],r=a.getBBox();let n=null;if(r.width&&r.height&&(n=this.addBackgroundToDataLabel(a,r)),n){null==(t=a.parentNode)||t.insertBefore(n.node,a);const i=e.config.dataLabels.background.backgroundColor||a.getAttribute("fill");e.config.chart.animations.enabled&&!e.globals.resized&&!e.globals.dataChanged?n.animate().attr({fill:i}):n.attr({fill:i}),a.setAttribute("fill",e.config.dataLabels.background.foreColor);const s=a.getAttribute("cx");null!==s&&vt(n,parseFloat(s),e)}}}bringForward(){const t=this.w,e=t.dom.baseEl.querySelectorAll(".apexcharts-datalabels"),i=t.dom.baseEl.querySelector(".apexcharts-plot-series:last-child");for(let t=0;t<e.length;t++)i&&i.insertBefore(e[t],i.nextSibling)}}class zt{static invalidateAll(t){t&&t.globals&&(t.globals.cachedSelectors&&(t.globals.cachedSelectors={}),t.globals.domCache&&t.globals.domCache.clear(),t.globals.dimensionCache={})}static invalidateDimensions(t){t&&t.globals&&(t.globals.dimensionCache={})}static invalidateSelectors(t){t&&t.globals&&t.globals.cachedSelectors&&(t.globals.cachedSelectors={})}static getCachedSelector(t,e,i){return t&&t.globals?(t.globals.cachedSelectors||(t.globals.cachedSelectors={}),t.globals.cachedSelectors[e]||(t.globals.cachedSelectors[e]=i()),t.globals.cachedSelectors[e]):i()}static getCachedDimension(t,e,i,s=1e3){if(!t||!t.globals)return i();t.globals.dimensionCache||(t.globals.dimensionCache={});const a=t.globals.dimensionCache[e],r=Date.now();if(a&&a.lastUpdate&&r-a.lastUpdate<s)return a.value;const n=i();return t.globals.dimensionCache[e]={value:n,lastUpdate:r},n}static cacheDOMElement(t,e,i){t&&t.globals&&(t.globals.domCache||(t.globals.domCache=new Map),t.globals.domCache.set(e,i))}static getCachedDOMElement(t,e){return t&&t.globals&&t.globals.domCache&&t.globals.domCache.get(e)||null}}class Bt{constructor(t,{theme:e=null,timeScale:i=null}={}){this.w=t,this.theme=e,this.timeScale=i}getLabel(t,e,i,s,a=[],r="12px",n=!0){const o=this.w,l=void 0===t[s]?"":t[s];let h=l;const c=o.formatters.xLabelFormatter,d=o.config.xaxis.labels.formatter,p=new S(this.w),u=l;n&&(h=p.xLabelFormat(c,l,u,{i:s,dateFormatter:new A(this.w).formatDate,w:o}),void 0!==d&&(h=d(l,t[s],{i:s,dateFormatter:new A(this.w).formatDate,w:o}))),e.length>0?(i=e[s].position,h=e[s].value):"datetime"===o.config.xaxis.type&&void 0===d&&(h=""),void 0===h&&(h=""),h=Array.isArray(h)?h:h.toString();const g=new Dt(this.w);let f={};f=o.layout.rotateXLabels&&n?g.getTextRects(h,parseInt(r,10).toString(),null,`rotate(${o.config.xaxis.labels.rotate} 0 0)`,!1):g.getTextRects(h,parseInt(r,10).toString());const x=!o.config.xaxis.labels.showDuplicates&&this.timeScale;return!Array.isArray(h)&&("NaN"===String(h)||a.indexOf(h)>=0&&x)&&(h=""),{x:i,text:h,textRect:f}}checkLabelBasedOnTickamount(t,e,i){const s=this.w;let a=s.config.xaxis.tickAmount;if("dataPoints"===a&&(a=Math.round(s.layout.gridWidth/120)),a>i)return e;return t%Math.round(i/(a+1))===0||(e.text=""),e}checkForOverflowingLabels(t,e,i,s,a){const r=this.w;if(0===t&&r.globals.skipFirstTimelinelabel&&(e.text=""),t===i-1&&r.globals.skipLastTimelinelabel&&(e.text=""),r.config.xaxis.labels.hideOverlappingLabels&&s.length>0){const t=a[a.length-1];if(r.config.xaxis.labels.trim&&"datetime"!==r.config.xaxis.type)return e;e.x<t.textRect.width/(r.layout.rotateXLabels?Math.max(Math.abs(r.config.xaxis.labels.rotate),1)/12:1.01)+t.x&&(e.text="")}return e}checkForReversedLabels(t,e){const i=this.w;return i.config.yaxis[t]&&i.config.yaxis[t].reversed&&e.reverse(),e}yAxisAllSeriesCollapsed(t){const e=this.w.globals;return!e.seriesYAxisMap[t].some(t=>-1===e.collapsedSeriesIndices.indexOf(t))}translateYAxisIndex(t){const e=this.w,i=e.globals,s=e.config.yaxis;return e.seriesData.series.length>s.length||s.some(t=>Array.isArray(t.seriesName))?t:i.seriesYAxisReverseMap[t]}isYAxisHidden(t){const e=this.w,i=e.config.yaxis[t];if(!i.show||this.yAxisAllSeriesCollapsed(t))return!0;if(!i.showForNullSeries){const i=e.globals.seriesYAxisMap[t],s=new H(this.w);return i.every(t=>s.isSeriesNull(t))}return!1}getYAxisForeColor(t,e){var i;const s=this.w;return Array.isArray(t)&&s.globals.yAxisScale[e]&&(null==(i=this.theme)||i.pushExtraColors(t,s.globals.yAxisScale[e].result.length,!1)),t}drawYAxisTicks(t,e,i,s,a,r,n){const o=this.w,l=new Dt(this.w);let h=o.layout.translateY+o.config.yaxis[a].labels.offsetY;if(o.globals.isBarHorizontal?h=0:"heatmap"===o.config.chart.type&&(h+=r/2),s.show&&e>0){!0===o.config.yaxis[a].opposite&&(t+=s.width);for(let a=e;a>=0;a--){const e=l.drawLine(t+i.offsetX-s.width+s.offsetX,h+s.offsetY,t+i.offsetX+s.offsetX,h+s.offsetY,s.color);n.add(e),h+=r}}}}class Nt{constructor(t,e,i){this.w=t,this.ctx=e,this.elgrid=i,this.axesUtils=new Bt(t,{theme:e.theme,timeScale:e.timeScale}),this.xaxisLabels=t.labelData.labels.slice(),t.labelData.timescaleLabels.length>0&&!t.globals.isBarHorizontal&&(this.xaxisLabels=t.labelData.timescaleLabels.slice()),t.config.xaxis.overwriteCategories&&(this.xaxisLabels=t.config.xaxis.overwriteCategories),this.drawnLabels=[],this.drawnLabelsRects=[],"top"===t.config.xaxis.position?this.offY=0:this.offY=t.layout.gridHeight,this.offY=this.offY+t.config.xaxis.axisBorder.offsetY,this.isCategoryBarHorizontal="bar"===t.config.chart.type&&t.config.plotOptions.bar.horizontal,this.xaxisFontSize=t.config.xaxis.labels.style.fontSize,this.xaxisFontFamily=t.config.xaxis.labels.style.fontFamily,this.xaxisForeColors=t.config.xaxis.labels.style.colors,this.xaxisBorderWidth=t.config.xaxis.axisBorder.width,this.isCategoryBarHorizontal&&(this.xaxisBorderWidth=t.config.yaxis[0].axisBorder.width.toString()),String(this.xaxisBorderWidth).indexOf("%")>-1?this.xaxisBorderWidth=t.layout.gridWidth*parseInt(this.xaxisBorderWidth,10)/100:this.xaxisBorderWidth=parseInt(this.xaxisBorderWidth,10),this.xaxisBorderHeight=t.config.xaxis.axisBorder.height,this.yaxis=t.config.yaxis[0]}drawXaxis(){const t=this.w,e=new Dt(this.w),i=e.group({class:"apexcharts-xaxis",transform:`translate(${t.config.xaxis.offsetX}, ${t.config.xaxis.offsetY})`}),s=e.group({class:"apexcharts-xaxis-texts-g",transform:`translate(${t.layout.translateXAxisX}, ${t.layout.translateXAxisY})`});i.add(s);let a=[];for(let t=0;t<this.xaxisLabels.length;t++)a.push(this.xaxisLabels[t]);if(this.drawXAxisLabelAndGroup(!0,e,s,a,t.axisFlags.isXNumeric,(t,e)=>e),t.labelData.hasXaxisGroups){const i=t.labelData.groups;a=[];for(let t=0;t<i.length;t++)a.push(i[t].title);const r={};t.config.xaxis.group.style&&(r.xaxisFontSize=t.config.xaxis.group.style.fontSize,r.xaxisFontFamily=t.config.xaxis.group.style.fontFamily,r.xaxisForeColors=t.config.xaxis.group.style.colors,r.fontWeight=t.config.xaxis.group.style.fontWeight,r.cssClass=t.config.xaxis.group.style.cssClass),this.drawXAxisLabelAndGroup(!1,e,s,a,!1,(t,e)=>i[t].cols*e,r)}if(void 0!==t.config.xaxis.title.text){const s=e.group({class:"apexcharts-xaxis-title"}),a=e.drawText({x:t.layout.gridWidth/2+t.config.xaxis.title.offsetX,y:this.offY+parseFloat(this.xaxisFontSize)+("bottom"===t.config.xaxis.position?t.layout.xAxisLabelsHeight:-t.layout.xAxisLabelsHeight-10)+t.config.xaxis.title.offsetY,text:t.config.xaxis.title.text,textAnchor:"middle",fontSize:t.config.xaxis.title.style.fontSize,fontFamily:t.config.xaxis.title.style.fontFamily,fontWeight:t.config.xaxis.title.style.fontWeight,foreColor:t.config.xaxis.title.style.color,cssClass:"apexcharts-xaxis-title-text "+t.config.xaxis.title.style.cssClass});s.add(a),i.add(s)}if(t.config.xaxis.axisBorder.show){const s=t.globals.barPadForNumericAxis,a=e.drawLine(t.globals.padHorizontal+t.config.xaxis.axisBorder.offsetX-s,this.offY,this.xaxisBorderWidth+s,this.offY,t.config.xaxis.axisBorder.color,0,this.xaxisBorderHeight);this.elgrid&&this.elgrid.elGridBorders&&t.config.grid.show?this.elgrid.elGridBorders.add(a):i.add(a)}return i}drawXAxisLabelAndGroup(t,e,i,s,a,r,n={}){var o,l;const h=[],c=[],d=this.w,p=n.xaxisFontSize||this.xaxisFontSize,u=n.xaxisFontFamily||this.xaxisFontFamily,g=n.xaxisForeColors||this.xaxisForeColors,f=n.fontWeight||d.config.xaxis.labels.style.fontWeight,x=n.cssClass||d.config.xaxis.labels.style.cssClass;let m,y=d.globals.padHorizontal;const w=s.length;let v="category"===d.config.xaxis.type?d.globals.dataPoints:w;if(0===v&&w>v&&(v=w),a){const t=Math.max(Number(d.config.xaxis.tickAmount)||1,v>1?v-1:v);m=d.layout.gridWidth/Math.min(t,w-1),y=y+r(0,m)/2+d.config.xaxis.labels.offsetX}else m=d.layout.gridWidth/v,y=y+r(0,m)+d.config.xaxis.labels.offsetX;for(let a=0;a<=w-1;a++){let n=y-r(a,m)/2+d.config.xaxis.labels.offsetX;0===a&&1===w&&m/2===y&&1===v&&(n=d.layout.gridWidth/2);let A=this.axesUtils.getLabel(s,d.labelData.timescaleLabels,n,a,h,p,t),S=28;d.layout.rotateXLabels&&t&&(S=22),d.config.xaxis.title.text&&"top"===d.config.xaxis.position&&(S+=parseFloat(d.config.xaxis.title.style.fontSize)+2),t||(S=S+parseFloat(p)+(d.layout.xAxisLabelsHeight-d.layout.xAxisGroupLabelsHeight)+(d.layout.rotateXLabels?10:0));A=void 0!==d.config.xaxis.tickAmount&&"dataPoints"!==d.config.xaxis.tickAmount&&"datetime"!==d.config.xaxis.type?this.axesUtils.checkLabelBasedOnTickamount(a,A,w):this.axesUtils.checkForOverflowingLabels(a,A,w,h,c);const C=()=>t&&d.config.xaxis.convertedCatToNumeric?g[d.globals.minX+a-1]:g[a],k=(null!=(l=null==(o=A.textRect)?void 0:o.width)?l:0)/2,_=A.x+k<0;if(d.config.xaxis.labels.show&&!_){const s=e.drawText({x:A.x,y:this.offY+d.config.xaxis.labels.offsetY+S-("top"===d.config.xaxis.position?d.layout.xAxisHeight+d.config.xaxis.axisTicks.height-2:0),text:A.text,textAnchor:"middle",fontWeight:f,fontSize:p,fontFamily:u,foreColor:Array.isArray(g)?C():g,isPlainText:!1,cssClass:(t?"apexcharts-xaxis-label ":"apexcharts-xaxis-group-label ")+x});if(i.add(s),s.on("click",t=>{if("function"==typeof d.config.chart.events.xAxisLabelClick){const e=Object.assign({},d,{labelIndex:a});d.config.chart.events.xAxisLabelClick(t,this.ctx,e)}}),t){const t=b.createElementNS($,"title");t.textContent=Array.isArray(A.text)?A.text.join(" "):A.text,s.node.appendChild(t),""!==A.text&&(h.push(A.text),c.push(A))}}a<w-1&&(y+=r(a+1,m))}}drawXaxisInversed(t){const e=this.w,i=new Dt(this.w),s=e.config.yaxis[0].opposite?e.globals.translateYAxisX[t]:0,a=i.group({class:"apexcharts-yaxis apexcharts-xaxis-inversed",rel:t}),r=i.group({class:"apexcharts-yaxis-texts-g apexcharts-xaxis-inversed-texts-g",transform:"translate("+s+", 0)"});a.add(r);const n=[];if(e.config.yaxis[t].show)for(let t=0;t<this.xaxisLabels.length;t++)n.push(this.xaxisLabels[t]);const o=e.layout.gridHeight/n.length;let l=-o/2.2;const h=e.formatters.yLabelFormatters[0],c=e.config.yaxis[0].labels;if(c.show)for(let s=0;s<=n.length-1;s++){let a=void 0===n[s]?"":n[s];a=h(a,{seriesIndex:t,dataPointIndex:s,w:e});const d=this.axesUtils.getYAxisForeColor(c.style.colors,t),p=()=>Array.isArray(d)?d[s]:d;let u=0;Array.isArray(a)&&(u=a.length/2*parseInt(c.style.fontSize,10));let g=c.offsetX-15,f="end";this.yaxis.opposite&&(f="start"),"left"===e.config.yaxis[0].labels.align?(g=c.offsetX,f="start"):"center"===e.config.yaxis[0].labels.align?(g=c.offsetX,f="middle"):"right"===e.config.yaxis[0].labels.align&&(f="end");const x=i.drawText({x:g,y:l+o+c.offsetY-u,text:a,textAnchor:f,foreColor:p(),fontSize:c.style.fontSize,fontFamily:c.style.fontFamily,fontWeight:c.style.fontWeight,isPlainText:!1,cssClass:"apexcharts-yaxis-label "+c.style.cssClass,maxWidth:c.maxWidth});r.add(x),x.on("click",t=>{if("function"==typeof e.config.chart.events.xAxisLabelClick){const i=Object.assign({},e,{labelIndex:s});e.config.chart.events.xAxisLabelClick(t,this.ctx,i)}});const m=b.createElementNS($,"title");if(m.textContent=Array.isArray(a)?a.join(" "):a,x.node.appendChild(m),0!==e.config.yaxis[t].labels.rotate){const s=i.rotateAroundCenter(x.node);x.node.setAttribute("transform",`rotate(${e.config.yaxis[t].labels.rotate} 0 ${s.y})`)}l+=o}if(void 0!==e.config.yaxis[0].title.text){const t=i.group({class:"apexcharts-yaxis-title apexcharts-xaxis-title-inversed",transform:"translate("+s+", 0)"}),r=i.drawText({x:e.config.yaxis[0].title.offsetX,y:e.layout.gridHeight/2+e.config.yaxis[0].title.offsetY,text:e.config.yaxis[0].title.text,textAnchor:"middle",foreColor:e.config.yaxis[0].title.style.color,fontSize:e.config.yaxis[0].title.style.fontSize,fontWeight:e.config.yaxis[0].title.style.fontWeight,fontFamily:e.config.yaxis[0].title.style.fontFamily,cssClass:"apexcharts-yaxis-title-text "+e.config.yaxis[0].title.style.cssClass});t.add(r),a.add(t)}let d=0;this.isCategoryBarHorizontal&&e.config.yaxis[0].opposite&&(d=e.layout.gridWidth);const p=e.config.xaxis.axisBorder;if(p.show){const t=i.drawLine(e.globals.padHorizontal+p.offsetX+d,1+p.offsetY,e.globals.padHorizontal+p.offsetX+d,e.layout.gridHeight+p.offsetY,p.color,0);this.elgrid&&this.elgrid.elGridBorders&&e.config.grid.show?this.elgrid.elGridBorders.add(t):a.add(t)}return e.config.yaxis[0].axisTicks.show&&this.axesUtils.drawYAxisTicks(d,n.length,e.config.yaxis[0].axisBorder,e.config.yaxis[0].axisTicks,0,o,a),a}drawXaxisTicks(t,e,i){const s=this.w,a=t;if(t<0||t-2>s.layout.gridWidth)return;const r=this.offY+s.config.xaxis.axisTicks.offsetY;if(e=e+r+s.config.xaxis.axisTicks.height,"top"===s.config.xaxis.position&&(e=r-s.config.xaxis.axisTicks.height),s.config.xaxis.axisTicks.show){const n=new Dt(this.w).drawLine(t+s.config.xaxis.axisTicks.offsetX,r+s.config.xaxis.offsetY,a+s.config.xaxis.axisTicks.offsetX,e+s.config.xaxis.offsetY,s.config.xaxis.axisTicks.color);i.add(n),n.node.classList.add("apexcharts-xaxis-tick")}}getXAxisTicksPositions(){const t=this.w,e=[],i=this.xaxisLabels.length;let s=t.globals.padHorizontal;if(t.labelData.timescaleLabels.length>0)for(let t=0;t<i;t++)s=this.xaxisLabels[t].position,e.push(s);else{const a=i;for(let i=0;i<a;i++){let i=a;t.axisFlags.isXNumeric&&"bar"!==t.config.chart.type&&(i-=1),s+=t.layout.gridWidth/i,e.push(s)}}return e}xAxisLabelCorrections(){var t,e,i;const s=this.w,a=new Dt(this.w),r=s.dom.baseEl.querySelector(".apexcharts-xaxis-texts-g"),n=s.dom.baseEl.querySelectorAll(".apexcharts-xaxis-texts-g text:not(.apexcharts-xaxis-group-label)"),o=s.dom.baseEl.querySelectorAll(".apexcharts-yaxis-inversed text"),l=s.dom.baseEl.querySelectorAll(".apexcharts-xaxis-inversed-texts-g text tspan");if(s.layout.rotateXLabels||s.config.xaxis.labels.rotateAlways)for(let t=0;t<n.length;t++){const e=a.rotateAroundCenter(n[t]);e.y=e.y-1,e.x=e.x+1,n[t].setAttribute("transform",`rotate(${s.config.xaxis.labels.rotate} ${e.x} ${e.y})`),n[t].setAttribute("text-anchor","end"),null==r||r.setAttribute("transform","translate(0, -10)");const i=n[t].childNodes;s.config.xaxis.labels.trim&&Array.prototype.forEach.call(i,t=>{a.placeTextWithEllipsis(t,t.textContent,s.layout.xAxisLabelsHeight-("bottom"===s.config.legend.position?20:10))})}else{const t=s.layout.gridWidth/(s.labelData.labels.length+1);for(let e=0;e<n.length;e++){const i=n[e].childNodes;s.config.xaxis.labels.trim&&"datetime"!==s.config.xaxis.type&&Array.prototype.forEach.call(i,e=>{a.placeTextWithEllipsis(e,e.textContent,t)})}}if(o.length>0){const r=o[o.length-1].getBBox(),n=o[0].getBBox();r.x<-20&&(null==(t=o[o.length-1].parentNode)||t.removeChild(o[o.length-1])),n.x+n.width>s.layout.gridWidth&&!s.globals.isBarHorizontal&&(null==(e=o[0].parentNode)||e.removeChild(o[0]));for(let t=0;t<l.length;t++)a.placeTextWithEllipsis(l[t],null!=(i=l[t].textContent)?i:"",s.config.yaxis[0].labels.maxWidth-(s.config.yaxis[0].title.text?2*parseFloat(s.config.yaxis[0].title.style.fontSize):0)-15)}}}class Yt{constructor(t,e){this.w=t,this.ctx=e,this.xaxisLabels=t.labelData.labels.slice(),this.axesUtils=new Bt(e.w,{theme:e.theme,timeScale:e.timeScale}),this.isRangeBar=t.rangeData.seriesRange.length&&t.globals.isBarHorizontal,t.labelData.timescaleLabels.length>0&&(this.xaxisLabels=t.labelData.timescaleLabels.slice())}drawGridArea(t=null){const e=this.w,i=new Dt(this.w);t||(t=i.group({class:"apexcharts-grid"}));const s=i.drawLine(e.globals.padHorizontal,1,e.globals.padHorizontal,e.layout.gridHeight,"transparent"),a=i.drawLine(e.globals.padHorizontal,e.layout.gridHeight,e.layout.gridWidth,e.layout.gridHeight,"transparent");return t.add(a),t.add(s),t}drawGrid(){if(this.w.globals.axisCharts){const t=this.renderGrid();return this.drawGridArea(t.el),t}return null}createGridMask(){const t=this.w,e=t.globals,i=new Dt(this.w),s=Array.isArray(t.config.stroke.width)?Math.max(...t.config.stroke.width):t.config.stroke.width,a=t=>{const e=b.createElementNS($,"clipPath");return e.setAttribute("id",t),e};t.dom.elGridRectMask=a(`gridRectMask${e.cuid}`),t.dom.elGridRectBarMask=a(`gridRectBarMask${e.cuid}`),t.dom.elGridRectMarkerMask=a(`gridRectMarkerMask${e.cuid}`),t.dom.elForecastMask=a(`forecastMask${e.cuid}`),t.dom.elNonForecastMask=a(`nonForecastMask${e.cuid}`);let r=0,n=0;(["bar","rangeBar","candlestick","boxPlot","violin"].includes(t.config.chart.type)||t.globals.comboBarCount>0)&&t.axisFlags.isXNumeric&&!t.globals.isBarHorizontal&&(r=Math.max(t.layout.gridPad.left,e.barPadForNumericAxis),n=Math.max(t.layout.gridPad.right,e.barPadForNumericAxis)),t.dom.elGridRect=i.drawRect(-s/2-2,-s/2-2,t.layout.gridWidth+s+4,t.layout.gridHeight+s+4,0,"#fff"),t.dom.elGridRectBar=i.drawRect(-s/2-r-2,-s/2-2,t.layout.gridWidth+s+n+r+4,t.layout.gridHeight+s+4,0,"#fff");const o=t.globals.markers.largestSize;t.dom.elGridRectMarker=i.drawRect(Math.min(-s/2-r-2,-o),-o,t.layout.gridWidth+Math.max(s+n+r+4,2*o),t.layout.gridHeight+2*o,0,"#fff"),t.dom.elGridRectMask.appendChild(t.dom.elGridRect.node),t.dom.elGridRectBarMask.appendChild(t.dom.elGridRectBar.node),t.dom.elGridRectMarkerMask.appendChild(t.dom.elGridRectMarker.node);const l=t.dom.elDefs.node;l.appendChild(t.dom.elGridRectMask),l.appendChild(t.dom.elGridRectBarMask),l.appendChild(t.dom.elGridRectMarkerMask),l.appendChild(t.dom.elForecastMask),l.appendChild(t.dom.elNonForecastMask)}_drawGridLines({i:t,x1:e,y1:i,x2:s,y2:a,xCount:r,parent:n}){const o=this.w;if(!(0===t&&o.globals.skipFirstTimelinelabel||t===r-1&&o.globals.skipLastTimelinelabel&&!o.config.xaxis.labels.formatter||"radar"===o.config.chart.type)){o.config.grid.xaxis.lines.show&&this._drawGridLine({i:t,x1:e,y1:i,x2:s,y2:a,xCount:r,parent:n});let l=0;if(o.labelData.hasXaxisGroups&&"between"===o.config.xaxis.tickPlacement){const e=o.labelData.groups;if(e){let i=0;for(let s=0;i<t&&s<e.length;s++)i+=e[s].cols;i===t&&(l=.6*o.layout.xAxisLabelsHeight)}}new Nt(this.w,this.ctx).drawXaxisTicks(e,l,o.dom.elGraphical)}}_drawGridLine({i:t,x1:e,y1:i,x2:s,y2:a,xCount:r,parent:n}){const o=this.w,l=n.node.classList.contains("apexcharts-gridlines-horizontal"),h=o.globals.barPadForNumericAxis,c=0===i&&0===a||0===e&&0===s||i===o.layout.gridHeight&&a===o.layout.gridHeight||o.globals.isBarHorizontal&&(0===t||t===r-1),d=new Dt(this.w).drawLine(e-(l?h:0),i,s+(l?h:0),a,o.config.grid.borderColor,o.config.grid.strokeDashArray);d.node.classList.add("apexcharts-gridline"),c&&o.config.grid.show?this.elGridBorders.add(d):n.add(d)}_drawGridBandRect({c:t,x1:e,y1:i,x2:s,y2:a,type:r}){const n=this.w,o=new Dt(this.w),l=n.globals.barPadForNumericAxis,h=n.config.grid[r].colors[t],c=o.drawRect(e-("row"===r?l:0),i,s+("row"===r?2*l:0),a,0,h,n.config.grid[r].opacity);this.elg.add(c),c.attr("clip-path",`url(#gridRectMask${n.globals.cuid})`),c.node.classList.add(`apexcharts-grid-${r}`)}_drawXYLines({xCount:t,tickAmount:e}){var i;const s=this.w,a=({xC:e,x1:i,y1:a,x2:r,y2:n})=>{for(let o=0;o<e;o++)i=this.xaxisLabels[o].position,r=this.xaxisLabels[o].position,i<0||i-2>s.layout.gridWidth||this._drawGridLines({i:o,x1:i,y1:a,x2:r,y2:n,xCount:t,parent:this.elgridLinesV})},r=({xC:e,x1:i,y1:a,x2:r,y2:n})=>{for(let o=0;o<e+(s.axisFlags.isXNumeric?0:1);o++)0===o&&1===e&&1===s.globals.dataPoints&&(r=i=s.layout.gridWidth/2),this._drawGridLines({i:o,x1:i,y1:a,x2:r,y2:n,xCount:t,parent:this.elgridLinesV}),r=i+=s.layout.gridWidth/(s.axisFlags.isXNumeric?e-1:e)};if(s.config.grid.xaxis.lines.show||s.config.xaxis.axisTicks.show){const e=s.globals.padHorizontal,n=0;let o;const l=s.layout.gridHeight;s.labelData.timescaleLabels.length?a({xC:t,x1:e,y1:n,x2:o,y2:l}):(s.axisFlags.isXNumeric&&(t=null==(i=s.globals.xAxisScale)?void 0:i.result.length),r({xC:t,x1:e,y1:n,x2:o,y2:l}))}if(s.config.grid.yaxis.lines.show){const t=0;let i=0,a=0;const r=s.layout.gridWidth;let n=e+1;this.isRangeBar&&(n=s.labelData.labels.length);for(let o=0;o<n+(this.isRangeBar?1:0);o++)this._drawGridLine({i:o,xCount:n+(this.isRangeBar?1:0),x1:t,y1:i,x2:r,y2:a,parent:this.elgridLinesH}),i+=s.layout.gridHeight/(this.isRangeBar?n:e),a=i}}_drawInvertedXYLines({xCount:t}){const e=this.w;if(e.config.grid.xaxis.lines.show||e.config.xaxis.axisTicks.show){let i=e.globals.padHorizontal;const s=0;let a;const r=e.layout.gridHeight;for(let n=0;n<t+1;n++){e.config.grid.xaxis.lines.show&&this._drawGridLine({i:n,xCount:t+1,x1:i,y1:s,x2:a,y2:r,parent:this.elgridLinesV});new Nt(this.w,this.ctx).drawXaxisTicks(i,0,e.dom.elGraphical),i+=e.layout.gridWidth/t,a=i}}if(e.config.grid.yaxis.lines.show){const t=0;let i=0,s=0;const a=e.layout.gridWidth;for(let r=0;r<e.globals.dataPoints+1;r++)this._drawGridLine({i:r,xCount:e.globals.dataPoints+1,x1:t,y1:i,x2:a,y2:s,parent:this.elgridLinesH}),i+=e.layout.gridHeight/e.globals.dataPoints,s=i}}renderGrid(){var t,e,i;const s=this.w,a=s.globals,r=new Dt(this.w);this.elg=r.group({class:"apexcharts-grid"}),this.elgridLinesH=r.group({class:"apexcharts-gridlines-horizontal"}),this.elgridLinesV=r.group({class:"apexcharts-gridlines-vertical"}),this.elGridBorders=r.group({class:"apexcharts-grid-borders"}),this.elg.add(this.elgridLinesH),this.elg.add(this.elgridLinesV),s.config.grid.show||(this.elgridLinesV.hide(),this.elgridLinesH.hide(),this.elGridBorders.hide());let n=0;for(;n<a.seriesYAxisMap.length&&a.ignoreYAxisIndexes.includes(n);)n++;n===a.seriesYAxisMap.length&&(n=0);let o,l=a.yAxisScale[n].result.length-1;return!a.isBarHorizontal||this.isRangeBar?(o=this.xaxisLabels.length,this.isRangeBar&&(l=s.labelData.labels.length,s.config.xaxis.tickAmount&&s.config.xaxis.labels.formatter&&(o=s.config.xaxis.tickAmount),(null==(i=null==(e=null==(t=a.yAxisScale)?void 0:t[n])?void 0:e.result)?void 0:i.length)>0&&"datetime"!==s.config.xaxis.type&&(o=a.yAxisScale[n].result.length-1)),this._drawXYLines({xCount:o,tickAmount:l})):(o=l,l=a.xTickAmount,this._drawInvertedXYLines({xCount:o,tickAmount:l})),this.drawGridBands(o,l),{el:this.elg,elGridBorders:this.elGridBorders,xAxisTickWidth:s.layout.gridWidth/o}}drawGridBands(t,e){var i,s,a,r,n;const o=this.w,l=(t,i,s,a,r,n)=>{for(let l=0,h=0;l<i;l++,h++)h>=o.config.grid[t].colors.length&&(h=0),this._drawGridBandRect({c:h,x1:s,y1:a,x2:r,y2:n,type:t}),a+=o.layout.gridHeight/e};if((null==(i=o.config.grid.row.colors)?void 0:i.length)>0&&l("row",e,0,0,o.layout.gridWidth,o.layout.gridHeight/e),(null==(s=o.config.grid.column.colors)?void 0:s.length)>0){let e=o.globals.isBarHorizontal||"on"!==o.config.xaxis.tickPlacement||"category"!==o.config.xaxis.type&&!o.config.xaxis.convertedCatToNumeric?t:t-1;o.axisFlags.isXNumeric&&(e=(null!=(r=null==(a=o.globals.xAxisScale)?void 0:a.result.length)?r:1)-1);let i=o.globals.padHorizontal;const s=0;let l=o.globals.padHorizontal+o.layout.gridWidth/e;const h=o.layout.gridHeight;for(let a=0,r=0;a<t;a++,r++)r>=o.config.grid.column.colors.length&&(r=0),"datetime"===o.config.xaxis.type&&(i=this.xaxisLabels[a].position,l=((null==(n=this.xaxisLabels[a+1])?void 0:n.position)||o.layout.gridWidth)-this.xaxisLabels[a].position),this._drawGridBandRect({c:r,x1:i,y1:s,x2:l,y2:h,type:"column"}),i+=o.layout.gridWidth/e}}}class Ot{constructor(t){this.w=t,this.coreUtils=new H(this.w)}niceScale(t,e,i=0){const s=1e-11,a=this.w,r=a.globals;let n,o,l,h;r.isBarHorizontal?(n=a.config.xaxis,o=Math.max((r.svgWidth-100)/25,2)):(n=a.config.yaxis[i],o=Math.max((r.svgHeight-100)/15,2)),v.isNumber(o)||(o=10),l=void 0!==n.min&&null!==n.min,h=void 0!==n.max&&null!==n.max;let c=void 0!==n.stepSize&&null!==n.stepSize,d=void 0!==n.tickAmount&&null!==n.tickAmount,p=d?n.tickAmount:Y[Math.min(Math.round(o/2),Y.length-1)];if(r.isMultipleYAxis&&!d&&r.multiAxisTickAmount>0&&(p=r.multiAxisTickAmount,d=!0),p="dataPoints"===p?r.dataPoints-1:Math.abs(Math.round(p)),(t===Number.MIN_VALUE&&0===e||!v.isNumber(t)&&!v.isNumber(e)||t===Number.MIN_VALUE&&e===-Number.MAX_VALUE)&&(t=v.isNumber(n.min)?n.min:0,e=v.isNumber(n.max)?n.max:t+p,r.allSeriesCollapsed=!1),t>e){const i=e;e=t,t=i}else t===e&&(t=0===t?0:t-1,e=0===e?2:e+1);const u=[];p<1&&(p=1);let g=p,f=Math.abs(e-t);!l&&t>0&&t/f<.15&&(t=0,l=!0),!h&&e<0&&-e/f<.15&&(e=0,h=!0),f=Math.abs(e-t);let x=f/g,m=x;const b=Math.floor(Math.log10(m)),y=Math.pow(10,b);let w=Math.ceil(m/y);if(w=N[0===r.yValueDecimal?0:1][w],m=w*y,x=m,r.isBarHorizontal&&n.stepSize&&"datetime"!==n.type?(x=n.stepSize,c=!0):c&&(x=n.stepSize),c&&n.forceNiceScale){const t=Math.floor(Math.log10(x));x*=Math.pow(10,b-t)}if(l&&h){let t=f/g;if(d)if(c)if(0!=v.mod(f,x)){const e=v.getGCD(x,t);x=t/e<10?e:t}else 0==v.mod(x,t)?x=t:(t=x,d=!1);else x=t;else if(c)0==v.mod(f,x)?t=x:x=t;else if(0==v.mod(f,x))t=x;else{g=Math.ceil(f/x),t=f/g;const e=v.getGCD(f,x);f/e<o&&(t=e),x=t}g=Math.round(f/x)}else{if(l||h){if(h)if(d)t=e-x*g;else{const i=t;t=x*Math.floor(t/x),Math.abs(e-t)/v.getGCD(f,x)>o&&(t=e-x*p,t+=x*Math.floor((i-t)/x))}else if(l)if(d)e=t+x*g;else{const i=e;e=x*Math.ceil(e/x),Math.abs(e-t)/v.getGCD(f,x)>o&&(e=t+x*p,e+=x*Math.ceil((i-e)/x))}}else if(r.isMultipleYAxis&&d){const i=x*Math.floor(t/x);let s=i+x*g;s<e&&(x*=2),s=e,e=(t=i)+x*g,f=Math.abs(e-t),t>0&&t<Math.abs(s-e)&&(t=0,e=x*g),e<0&&-e<Math.abs(i-t)&&(e=0,t=-x*g)}else t=x*Math.floor(t/x),e=x*Math.ceil(e/x);f=Math.abs(e-t),x=v.getGCD(f,x),g=Math.round(f/x)}if(d||l||h||(g=Math.ceil((f-s)/(x+s)),g>16&&v.getPrimeFactors(g).length<2&&g++),!d&&n.forceNiceScale&&0===r.yValueDecimal&&g>f&&(g=f,x=Math.round(f/g)),g>o&&(!d&&!c||n.forceNiceScale)){const t=v.getPrimeFactors(g),e=t.length-1;let i=g;t:for(var A=0;A<e;A++)for(var S=0;S<=e-A;S++){const s=Math.min(S+A,e);let a=i,r=1;for(var C=S;C<=s;C++)r*=t[C];if(a/=r,a<o){i=a;break t}}x=i===g?f:f/i,g=Math.round(f/x)}r.isMultipleYAxis&&0==r.multiAxisTickAmount&&r.ignoreYAxisIndexes.indexOf(i)<0&&(r.multiAxisTickAmount=g);let k=t-x;const _=x*s;do{k+=x,u.push(v.stripNumber(k,7))}while(e-k>_);return{result:u,niceMin:u[0],niceMax:u[u.length-1]}}linearScale(t,e,i=10,s=0,a=void 0){const r=Math.abs(e-t);let n=[];if(t===e)return n=[t],{result:n,niceMin:n[0],niceMax:n[n.length-1]};"dataPoints"===(i=this._adjustTicksForSmallRange(i,s,r))&&(i=this.w.globals.dataPoints-1);const o=i;a||(a=r/o);if(0!==a&&isFinite(a)){const t=Math.floor(Math.log10(Math.abs(a))),e=Math.max(2,2-t),i=Math.pow(10,e);a=Math.round((a+Number.EPSILON)*i)/i}let l=i===Number.MAX_VALUE?5:o;i===Number.MAX_VALUE&&(a=1);let h=t;for(;l>=0;)n.push(h),h=v.preciseAddition(h,a),l-=1;return{result:n,niceMin:n[0],niceMax:n[n.length-1]}}_resolveLogTickAmount(t){let e=t.tickAmount;return"dataPoints"===e&&(e=this.w.globals.dataPoints-1),v.isNumber(e)&&e>=1?Number(e):null}_thinToTickAmount(t,e){if(null===e||!v.isNumber(e)||e<1)return t;const i=e+1;if(t.length<=i)return t;const s=t.length-1;let a=null;for(let t=1;t<=s;t++){if(s%t!==0)continue;const e=s/t+1;e>i||(null===a||e>a.count)&&(a={stride:t,count:e})}if(!a)return[t[0],t[t.length-1]];const r=[];for(let e=0;e<t.length;e+=a.stride)r.push(t[e]);return r}logarithmicScaleNice(t,e,i,s=null){e<=0&&(e=Math.max(t,i)),t<=0&&(t=Math.min(e,i));const a=[],r=Math.ceil(Math.log(e)/Math.log(i)+1);for(let e=Math.floor(Math.log(t)/Math.log(i));e<r;e++)a.push(Math.pow(i,e));const n=this._thinToTickAmount(a,s);return{result:n,niceMin:n[0],niceMax:n[n.length-1]}}_logDomainSpan(t,e,i){return i||(i=10),i<=1?0:(e<=0&&(e=Math.max(t,i)),t<=0&&(t=Math.min(e,i)),t<=0||e<=0?0:Math.abs(Math.log(e)/Math.log(i)-Math.log(t)/Math.log(i)))}logarithmicScale(t,e,i,s=null){e<=0&&(e=Math.max(t,i)),t<=0&&(t=Math.min(e,i));const a=[],r=Math.log(e)/Math.log(i),n=Math.log(t)/Math.log(i),o=r-n,l=null!==s?s:Math.max(1,Math.round(o)),h=o/l;for(let t=0,e=n;t<l;t++,e+=h)a.push(Math.pow(i,e));return a.push(Math.pow(i,r)),{result:a,niceMin:t,niceMax:e}}_adjustTicksForSmallRange(t,e,i){let s=t;if(void 0!==e&&this.w.config.yaxis[e].labels.formatter&&void 0===this.w.config.yaxis[e].tickAmount){const t=Number(this.w.config.yaxis[e].labels.formatter(1));v.isNumber(t)&&0===this.w.globals.yValueDecimal&&(s=Math.ceil(i))}return s<t?s:t}setYScaleForIndex(t,e,i){const s=this.w.globals,a=this.w.config,r=s.isBarHorizontal?a.xaxis:a.yaxis[t];void 0===s.yAxisScale[t]&&(s.yAxisScale[t]=[]);const n=Math.abs(i-e),o=r.logarithmic&&this._logDomainSpan(e,i,r.logBase)>=1,l=r.logarithmic&&(o||n>5);if(r.logarithmic&&!l&&(s.invalidLogScale=!0),l){s.allSeriesCollapsed=!1;const a=this._resolveLogTickAmount(r);s.yAxisScale[t]=r.forceNiceScale?this.logarithmicScaleNice(e,i,r.logBase,a):this.logarithmicScale(e,i,r.logBase,a)}else i!==-Number.MAX_VALUE&&v.isNumber(i)&&e!==Number.MAX_VALUE&&v.isNumber(e)?(s.allSeriesCollapsed=!1,s.yAxisScale[t]=this.niceScale(e,i,t)):s.yAxisScale[t]=this.niceScale(Number.MIN_VALUE,0,t)}setXScale(t,e){const i=this.w,s=i.globals;if(e!==-Number.MAX_VALUE&&v.isNumber(e)){const a=s.xTickAmount;s.xAxisScale=this.linearScale(t,e,a,0,void 0===i.config.xaxis.max?i.config.xaxis.stepSize:void 0)}else s.xAxisScale=this.linearScale(0,10,10);return s.xAxisScale}scaleMultipleYAxes(){const t=this.w.config,e=this.w.globals;this.coreUtils.setSeriesYAxisMappings();const i=e.seriesYAxisMap,s=e.minYArr,a=e.maxYArr,r=[],n=!e.isBarHorizontal;if(e.allSeriesCollapsed=!0,e.barGroups=[],i.forEach((i,o)=>{const l=[];if(i.forEach(e=>{var i;const s=null==(i=t.series[e])?void 0:i.group;l.indexOf(s)<0&&l.push(s)}),i.length>0){let h,c,d=Number.MAX_VALUE,p=-Number.MAX_VALUE,u=d,g=p;if(t.chart.stacked){const s=new Array(e.dataPoints).fill(0),a=[],r=[],n=[];l.forEach(()=>{a.push(s.map(()=>Number.MIN_VALUE)),r.push(s.map(()=>Number.MIN_VALUE)),n.push(s.map(()=>Number.MIN_VALUE))});for(let s=0;s<i.length;s++){!h&&t.series[i[s]].type&&(h=t.series[i[s]].type);const d=i[s];c=t.series[d].group?t.series[d].group:"axis-".concat(o.toString());!(e.collapsedSeriesIndices.indexOf(d)<0&&e.ancillaryCollapsedSeriesIndices.indexOf(d)<0)||(e.allSeriesCollapsed=!1,l.forEach((e,i)=>{if(t.series[d].group===e)for(let t=0;t<this.w.seriesData.series[d].length;t++){const e=this.w.seriesData.series[d][t];e>=0?r[i][t]+=e:n[i][t]+=e,a[i][t]+=e,u=Math.min(u,e),g=Math.max(g,e)}})),"bar"!==h&&"column"!==h||e.barGroups.push(c)}h||(h=t.chart.type),"bar"===h||"column"===h?l.forEach((t,e)=>{d=Math.min(d,Math.min.apply(null,n[e])),p=Math.max(p,Math.max.apply(null,r[e]))}):(l.forEach((t,e)=>{u=Math.min(u,Math.min.apply(null,a[e])),g=Math.max(g,Math.max.apply(null,a[e]))}),d=u,p=g),d===Number.MIN_VALUE&&p===Number.MIN_VALUE&&(p=-Number.MAX_VALUE)}else for(let t=0;t<i.length;t++){const r=i[t];d=Math.min(d,s[r]),p=Math.max(p,a[r]);!(e.collapsedSeriesIndices.indexOf(r)<0&&e.ancillaryCollapsedSeriesIndices.indexOf(r)<0)||(e.allSeriesCollapsed=!1)}void 0!==t.yaxis[o].min&&(d="function"==typeof t.yaxis[o].min?t.yaxis[o].min(d):t.yaxis[o].min),void 0!==t.yaxis[o].max&&(p="function"==typeof t.yaxis[o].max?t.yaxis[o].max(p):t.yaxis[o].max),e.barGroups=e.barGroups.filter((t,e,i)=>i.indexOf(t)===e);const f=t.yaxis[o];n&&!0===f.alignZero&&!f.logarithmic&&void 0===f.min&&void 0===f.max&&e.ignoreYAxisIndexes.indexOf(o)<0&&v.isNumber(d)&&v.isNumber(p)?r.push({ai:o,minY:d,maxY:p}):(this.setYScaleForIndex(o,d,p),i.forEach(t=>{s[t]=e.yAxisScale[o].niceMin,a[t]=e.yAxisScale[o].niceMax}))}else this.setYScaleForIndex(o,0,-Number.MAX_VALUE)}),r.length>=2){r.forEach(t=>{this.setYScaleForIndex(t.ai,t.minY,t.maxY),i[t.ai].forEach(i=>{s[i]=e.yAxisScale[t.ai].niceMin,a[i]=e.yAxisScale[t.ai].niceMax})});let t=0;r.forEach(i=>{const s=e.yAxisScale[i.ai],a=s.niceMax-s.niceMin;if(a>0){const e=-s.niceMin/a;e>t&&(t=e)}}),t>1&&(t=1),t<0&&(t=0);const n=t=>{if(t<=0)return 1;const e=Math.floor(Math.log10(t)),i=Math.pow(10,e),s=t/i;let a;return a=s<=1+1e-9?1:s<=2+1e-9?2:s<=2.5+1e-9?2.5:s<=5+1e-9?5:10,a*i};r.forEach(r=>{const o=e.yAxisScale[r.ai];if(!o.result||o.result.length<2)return;const l=o.niceMax-o.niceMin;if(l<=0)return;const h=-o.niceMin/l;if(Math.abs(h-t)<=1e-9)return;const c=h<t&&t<1-1e-9,d=!c&&h>t&&t>1e-9;if(!c&&!d)return;const p=c?-t*o.niceMax/(1-t):o.niceMin,u=d?-o.niceMin*(1-t)/t:o.niceMax,g=u-p;if(g<=0)return;const f=Math.max(o.result.length,5),x=n(g/Math.max(f-1,1));if(x<=0)return;let m,b;if(c){m=Math.floor(p/x+1e-9)*x;const e=t>1e-9?m*(t-1)/t:o.niceMax,i=Math.max(e,o.niceMax);b=Math.ceil(i/x-1e-9)*x}else{b=Math.ceil(u/x-1e-9)*x;const e=t<1-1e-9?-t*b/(1-t):o.niceMin,i=Math.min(e,o.niceMin);m=Math.floor(i/x+1e-9)*x}o.result=[];for(let t=m;t<=b+1e-9*x;t=v.preciseAddition(t,x))o.result.push(v.stripNumber(t,7));o.niceMin=m,o.niceMax=b,i[r.ai].forEach(t=>{s[t]=o.niceMin,a[t]=o.niceMax})})}else if(1===r.length){const t=r[0];this.setYScaleForIndex(t.ai,t.minY,t.maxY),i[t.ai].forEach(i=>{s[i]=e.yAxisScale[t.ai].niceMin,a[i]=e.yAxisScale[t.ai].niceMax})}}}class Wt{constructor(t){this.w=t,this.scales=new Ot(this.w)}init(){this.setYRange(),this.setXRange(),this.setZRange()}_xPixelTolerance(t){const e=this.w.layout.gridWidth;if(!e||!t||!t.length)return 0;const i=this.w.config.xaxis,s="number"==typeof i.min?i.min:t[0],a="number"==typeof i.max?i.max:t[t.length-1];return a>s?(a-s)/e:0}getMinYMaxY(t,e=Number.MAX_VALUE,i=-Number.MAX_VALUE,s=null){var a,r,n,o,l,h,c,d,p;const u=this.w.config,g=this.w.globals;let f=-Number.MAX_VALUE,x=Number.MIN_VALUE;null===s&&(s=t+1);const m=this.w.seriesData.series;let b=m,y=m;"candlestick"===u.chart.type?(b=this.w.candleData.seriesCandleL,y=this.w.candleData.seriesCandleH):"boxPlot"===u.chart.type?(b=this.w.candleData.seriesCandleO,y=this.w.candleData.seriesCandleC):"violin"===u.chart.type?(b=this.w.violinData.seriesViolinMin,y=this.w.violinData.seriesViolinMax):this.w.axisFlags.isRangeData&&(b=this.w.rangeData.seriesRangeStart,y=this.w.rangeData.seriesRangeEnd);let w=!1;if(this.w.seriesData.seriesX.length>=s){const t=null==(a=g.brushSource)?void 0:a.w.config.chart.brush;(u.chart.zoom.enabled&&u.chart.zoom.autoScaleYaxis||(null==t?void 0:t.enabled)&&(null==t?void 0:t.autoScaleYaxis))&&(w=!0)}for(let a=t;a<s;a++){g.dataPoints=Math.max(g.dataPoints,m[a].length);const t=u.series[a].type;this.w.labelData.categoryLabels.length&&(g.dataPoints=this.w.labelData.categoryLabels.filter(t=>void 0!==t).length),this.w.labelData.labels.length&&"datetime"!==u.xaxis.type&&0!==this.w.seriesData.series.reduce((t,e)=>t+e.length,0)&&(g.dataPoints=Math.max(g.dataPoints,this.w.labelData.labels.length));let s=0,A=m[a].length-1;if(w){const t=this._xPixelTolerance(this.w.seriesData.seriesX[a]);if(u.xaxis.min){const e=u.xaxis.min-t;for(;s<A&&this.w.seriesData.seriesX[a][s]<e;s++);}if(u.xaxis.max){const e=u.xaxis.max+t;for(;A>s&&this.w.seriesData.seriesX[a][A]>e;A--);}}if(b===m&&y===m&&"boxPlot"!==u.chart.type&&"candlestick"!==t&&"boxPlot"!==t&&"violin"!==t&&"rangeArea"!==t&&"rangeBar"!==t&&!(this.w.seriesData.seriesGoals[a]&&this.w.seriesData.seriesGoals[a].length)){const n=m[a],o=Math.min(A,n.length-1),l=null==(r=this.w.seriesData._parsedExtrema)?void 0:r[a];if(l&&l.ref===n&&l.len===n.length&&0===s&&o===n.length-1)l.maxY>f&&(f=l.maxY),l.lowestY<e&&(e=l.lowestY),l.negMinY<0&&l.negMinY<x&&(x=l.negMinY),l.yDec>g.yValueDecimal&&(g.yValueDecimal=l.yDec),l.hasNulls&&(g.hasNullValues=!0);else{let t=g.yValueDecimal,i=!1;for(let a=s;a<=o;a++){const s=n[a];if(null!==s&&"number"==typeof s&&s==s&&s!==1/0&&s!==-1/0){if(s>f&&(f=s),s<e&&(e=s),x>s&&s<0&&(x=s),!Number.isInteger(s)){const e=s<0?-s:s;if(e>=1e-6&&e<1e21){const e=""+s,i=e.indexOf("."),a=-1===i?0:e.length-i-1;a>t&&(t=a)}else{const e=v.noExponents(s);v.isFloat(e)&&(t=Math.max(t,e.toString().split(".")[1].length))}}}else i=!0}g.yValueDecimal=t,i&&(g.hasNullValues=!0)}i=f,"bar"!==t&&"column"!==t||(x<0&&f<0&&(f=0,i=Math.max(i,0)),x===Number.MIN_VALUE&&(x=0,e=Math.min(e,0)));continue}for(let r=s;r<=A&&r<this.w.seriesData.series[a].length;r++){let s=m[a][r];if(null!==s&&v.isNumber(s)){switch(void 0!==(null==(n=y[a])?void 0:n[r])&&(f=Math.max(f,y[a][r]),e=Math.min(e,y[a][r])),void 0!==(null==(o=b[a])?void 0:o[r])&&(e=Math.min(e,b[a][r]),i=Math.max(i,b[a][r])),t){case"candlestick":void 0!==this.w.candleData.seriesCandleC[a][r]&&(f=Math.max(f,this.w.candleData.seriesCandleH[a][r]),e=Math.min(e,this.w.candleData.seriesCandleL[a][r]));break;case"boxPlot":void 0!==this.w.candleData.seriesCandleC[a][r]&&(f=Math.max(f,this.w.candleData.seriesCandleC[a][r]),e=Math.min(e,this.w.candleData.seriesCandleO[a][r]));break;case"violin":void 0!==(null==(l=this.w.violinData.seriesViolinMax[a])?void 0:l[r])&&(f=Math.max(f,this.w.violinData.seriesViolinMax[a][r]),e=Math.min(e,this.w.violinData.seriesViolinMin[a][r]))}if(t&&"candlestick"!==t&&"boxPlot"!==t&&"violin"!==t&&"rangeArea"!==t&&"rangeBar"!==t&&(f=Math.max(f,this.w.seriesData.series[a][r]),e=Math.min(e,this.w.seriesData.series[a][r])),this.w.seriesData.seriesGoals[a]&&this.w.seriesData.seriesGoals[a][r]&&Array.isArray(this.w.seriesData.seriesGoals[a][r])&&this.w.seriesData.seriesGoals[a][r].forEach(t=>{f=Math.max(f,t.value),e=Math.min(e,t.value)}),"boxPlot"===this.w.config.chart.type||"boxPlot"===t){const t=null==(c=null==(h=this.w.candleData.seriesBoxPoints)?void 0:h[a])?void 0:c[r];if(t)for(let i=0;i<t.length;i++){const s=t[i];"number"==typeof s&&(f=Math.max(f,s),e=Math.min(e,s))}}i=f,s=v.noExponents(s),v.isFloat(s)&&(g.yValueDecimal=Math.max(g.yValueDecimal,s.toString().split(".")[1].length)),x>(null==(d=b[a])?void 0:d[r])&&(null==(p=b[a])?void 0:p[r])<0&&(x=b[a][r])}else g.hasNullValues=!0}"bar"!==t&&"column"!==t||(x<0&&f<0&&(f=0,i=Math.max(i,0)),x===Number.MIN_VALUE&&(x=0,e=Math.min(e,0)))}return"rangeBar"===u.chart.type&&this.w.rangeData.seriesRangeStart.length&&g.isBarHorizontal&&(x=e),"bar"===u.chart.type&&(x<0&&f<0&&(f=0),x===Number.MIN_VALUE&&(x=0)),{minY:x,maxY:f,lowestY:e,highestY:i}}setYRange(){const t=this.w.globals,e=this.w.config;t.maxY=-Number.MAX_VALUE,t.minY=Number.MIN_VALUE;let i,s=Number.MAX_VALUE;if(t.isMultipleYAxis){s=Number.MAX_VALUE;for(let e=0;e<this.w.seriesData.series.length;e++)i=this.getMinYMaxY(e),t.minYArr[e]=i.lowestY,t.maxYArr[e]=i.highestY,s=Math.min(s,i.lowestY)}if(i=this.getMinYMaxY(0,s,void 0,this.w.seriesData.series.length),"bar"===e.chart.type?(t.minY=i.minY,t.maxY=i.maxY):(t.minY=i.lowestY,t.maxY=i.highestY),s=i.lowestY,e.chart.stacked&&this._setStackedMinMax(),"line"===e.chart.type||"area"===e.chart.type||"scatter"===e.chart.type||"candlestick"===e.chart.type||"boxPlot"===e.chart.type||"violin"===e.chart.type||"rangeBar"===e.chart.type&&!t.isBarHorizontal?t.minY===Number.MIN_VALUE&&s!==-Number.MAX_VALUE&&s!==t.maxY&&(t.minY=s):t.minY=t.minY!==Number.MIN_VALUE?Math.min(i.minY,t.minY):i.minY,e.yaxis.forEach((e,i)=>{void 0!==e.max&&("number"==typeof e.max?t.maxYArr[i]=e.max:"function"==typeof e.max&&(t.maxYArr[i]=e.max(t.isMultipleYAxis?t.maxYArr[i]:t.maxY)),t.maxY=t.maxYArr[i]),void 0!==e.min&&("number"==typeof e.min?t.minYArr[i]=e.min:"function"==typeof e.min&&(t.minYArr[i]=e.min(t.isMultipleYAxis?t.minYArr[i]===Number.MIN_VALUE?0:t.minYArr[i]:t.minY)),t.minY=t.minYArr[i])}),t.isBarHorizontal){["min","max"].forEach(i=>{void 0!==e.xaxis[i]&&"number"==typeof e.xaxis[i]&&("min"===i?t.minY=e.xaxis[i]:t.maxY=e.xaxis[i])})}return t.isMultipleYAxis?(this.scales.scaleMultipleYAxes(),t.minY=s):(this.scales.setYScaleForIndex(0,t.minY,t.maxY),t.minY=t.yAxisScale[0].niceMin,t.maxY=t.yAxisScale[0].niceMax,t.minYArr[0]=t.minY,t.maxYArr[0]=t.maxY),t.barGroups=[],t.lineGroups=[],t.areaGroups=[],e.series.forEach(i=>{const s=i;switch(s.type||e.chart.type){case"bar":case"column":t.barGroups.push(s.group);break;case"line":t.lineGroups.push(s.group);break;case"area":t.areaGroups.push(s.group)}}),t.barGroups=t.barGroups.filter((t,e,i)=>i.indexOf(t)===e),t.lineGroups=t.lineGroups.filter((t,e,i)=>i.indexOf(t)===e),t.areaGroups=t.areaGroups.filter((t,e,i)=>i.indexOf(t)===e),{minY:t.minY,maxY:t.maxY,minYArr:t.minYArr,maxYArr:t.maxYArr,yAxisScale:t.yAxisScale}}setXRange(){const t=this.w.globals,e=this.w.config,i="numeric"===e.xaxis.type||"datetime"===e.xaxis.type||"category"===e.xaxis.type&&!this.w.axisFlags.noLabelsProvided||this.w.axisFlags.noLabelsProvided||this.w.axisFlags.isXNumeric,s=()=>{var e;let i=t.minX,s=t.maxX;for(let t=0;t<this.w.seriesData.series.length;t++){const a=this.w.labelData.labels[t];if(!a)continue;const r=null==(e=this.w.seriesData._parsedExtrema)?void 0:e[t];if(r&&r.xNumeric&&r.xref===a&&r.len===a.length)r.maxX>s&&(s=r.maxX),r.minX<i&&(i=r.minX);else for(let t=0;t<a.length;t++){const e=a[t];null!==e&&"number"==typeof e&&e==e&&(e>s&&(s=e),e<i&&(i=e))}}t.maxX=s,t.initialMaxX=s,t.minX=i,t.initialMinX=i};if(this.w.axisFlags.isXNumeric&&s(),this.w.axisFlags.noLabelsProvided&&0===e.xaxis.categories.length&&(t.maxX=this.w.labelData.labels[this.w.labelData.labels.length-1],t.initialMaxX=this.w.labelData.labels[this.w.labelData.labels.length-1],t.minX=1,t.initialMinX=1),this.w.axisFlags.isXNumeric||this.w.axisFlags.noLabelsProvided||this.w.axisFlags.dataFormatXNumeric){let s=10;if(void 0===e.xaxis.tickAmount)s=Math.round(t.svgWidth/150),"numeric"===e.xaxis.type&&t.dataPoints<30&&(s=t.dataPoints-1),s>t.dataPoints&&0!==t.dataPoints&&(s=t.dataPoints-1);else if("dataPoints"===e.xaxis.tickAmount){if(this.w.seriesData.series.length>1&&(s=this.w.seriesData.series[t.maxValsInArrayIndex].length-1),this.w.axisFlags.isXNumeric){const e=Math.round(t.maxX-t.minX);e<30&&(s=e)}}else s=e.xaxis.tickAmount;if(t.xTickAmount=s,void 0!==e.xaxis.max&&"number"==typeof e.xaxis.max&&(t.maxX=e.xaxis.max),void 0!==e.xaxis.min&&"number"==typeof e.xaxis.min&&(t.minX=e.xaxis.min),void 0!==e.xaxis.range&&(t.minX=t.maxX-e.xaxis.range),t.minX!==Number.MAX_VALUE&&t.maxX!==-Number.MAX_VALUE)if(e.xaxis.convertedCatToNumeric&&!this.w.axisFlags.dataFormatXNumeric){const e=[];for(let i=t.minX-1;i<t.maxX;i++)e.push(i+1);t.xAxisScale={result:e,niceMin:e[0],niceMax:e[e.length-1]}}else t.xAxisScale=this.scales.setXScale(t.minX,t.maxX);else t.xAxisScale=this.scales.linearScale(0,s,s,0,e.xaxis.stepSize),this.w.axisFlags.noLabelsProvided&&this.w.labelData.labels.length>0&&(t.xAxisScale=this.scales.linearScale(1,this.w.labelData.labels.length,s-1,0,e.xaxis.stepSize),this.w.seriesData.seriesX=this.w.labelData.labels.slice());i&&(this.w.labelData.labels=t.xAxisScale.result.slice())}return t.isBarHorizontal&&this.w.labelData.labels.length&&(t.xTickAmount=this.w.labelData.labels.length),this._handleSingleDataPoint(),this._getMinXDiff(),{minX:t.minX,maxX:t.maxX}}setZRange(){var t;const e=this.w.globals;if(!this.w.axisFlags.isDataXYZ)return;for(let t=0;t<this.w.seriesData.series.length;t++)if(void 0!==this.w.seriesData.seriesZ[t])for(let i=0;i<this.w.seriesData.seriesZ[t].length;i++)null!==this.w.seriesData.seriesZ[t][i]&&v.isNumber(this.w.seriesData.seriesZ[t][i])&&(e.maxZ=Math.max(e.maxZ,this.w.seriesData.seriesZ[t][i]),e.minZ=Math.min(e.minZ,this.w.seriesData.seriesZ[t][i]));const i=(null==(t=this.w.config.plotOptions)?void 0:t.bubble)||{};v.isNumber(i.minZ)&&i.minZ<e.minZ&&(e.minZ=i.minZ),v.isNumber(i.maxZ)&&i.maxZ>e.maxZ&&(e.maxZ=i.maxZ)}_handleSingleDataPoint(){const t=this.w.globals,e=this.w.config;if(t.minX===t.maxX){const i=new A(this.w);if("datetime"===e.xaxis.type){const s=i.getDate(t.minX);e.xaxis.labels.datetimeUTC?s.setUTCDate(s.getUTCDate()-2):s.setDate(s.getDate()-2),t.minX=new Date(s).getTime();const a=i.getDate(t.maxX);e.xaxis.labels.datetimeUTC?a.setUTCDate(a.getUTCDate()+2):a.setDate(a.getDate()+2),t.maxX=new Date(a).getTime()}else("numeric"===e.xaxis.type||"category"===e.xaxis.type&&!this.w.axisFlags.noLabelsProvided)&&(t.minX=t.minX-2,t.initialMinX=t.minX,t.maxX=t.maxX+2,t.initialMaxX=t.maxX)}}_getMinXDiff(){const t=this.w.globals;this.w.axisFlags.isXNumeric&&this.w.seriesData.seriesX.forEach((e,i)=>{var s;if(e.length){1===e.length&&e.push(this.w.seriesData.seriesX[t.maxValsInArrayIndex][this.w.seriesData.seriesX[t.maxValsInArrayIndex].length-1]);const a=null==(s=this.w.seriesData._parsedExtrema)?void 0:s[i];if(a&&a.xNumeric&&a.xSorted&&a.xref===e&&a.len===e.length)return a.minXDiff<t.minXDiff&&(t.minXDiff=a.minXDiff),void(1!==t.dataPoints&&t.minXDiff!==Number.MAX_VALUE||(t.minXDiff=.5));let r=!0,n=t.minXDiff;for(let t=1;t<e.length;t++){const i=e[t]-e[t-1];if(i>0)i<n&&(n=i);else if(i<0){r=!1;break}}if(r)return t.minXDiff=n,void(1!==t.dataPoints&&t.minXDiff!==Number.MAX_VALUE||(t.minXDiff=.5));const o=e.slice();o.sort((t,e)=>t-e),o.forEach((e,i)=>{if(i>0){const s=e-o[i-1];s>0&&(t.minXDiff=Math.min(s,t.minXDiff))}}),1!==t.dataPoints&&t.minXDiff!==Number.MAX_VALUE||(t.minXDiff=.5)}})}_setStackedMinMax(){const t=this.w.globals;if(!this.w.seriesData.series.length)return;let e=this.w.labelData.seriesGroups;e.length||(e=[this.w.seriesData.seriesNames.map(t=>t)]);const i={},s={};e.forEach(e=>{i[e]=[],s[e]=[];this.w.config.series.map((t,i)=>e.indexOf(this.w.seriesData.seriesNames[i])>-1?i:null).filter(t=>null!==t).forEach(a=>{var r,n,o,l;for(let h=0;h<this.w.seriesData.series[t.maxValsInArrayIndex].length;h++){void 0===i[e][h]&&(i[e][h]=0,s[e][h]=0);(this.w.config.chart.stacked&&!t.comboCharts||this.w.config.chart.stacked&&t.comboCharts&&(!this.w.config.chart.stackOnlyBar||"bar"===(null==(n=null==(r=this.w.config.series)?void 0:r[a])?void 0:n.type)||"column"===(null==(l=null==(o=this.w.config.series)?void 0:o[a])?void 0:l.type)))&&null!==this.w.seriesData.series[a][h]&&v.isNumber(this.w.seriesData.series[a][h])&&(this.w.seriesData.series[a][h]>0?i[e][h]+=parseFloat(String(this.w.seriesData.series[a][h]))+1e-4:s[e][h]+=parseFloat(String(this.w.seriesData.series[a][h])))}})}),Object.entries(i).forEach(([e])=>{i[e].forEach((a,r)=>{t.maxY=Math.max(t.maxY,i[e][r]),t.minY=Math.min(t.minY,s[e][r])})})}}function Ht(){return{palette1:["#008FFB","#00A86F","#CA8501","#FF4560","#846DD5"],palette2:["#6978CB","#039DE2","#49A84D","#B39105","#D68000"],palette3:["#209FCC","#648291","#D4526E","#0FA783","#A19285"],palette4:["#2FA59D","#73A20B","#099DE1","#FD5D5D","#648291"],palette5:["#2B908F","#F56566","#2EAB16","#FA4443","#1EA2BD"],palette6:["#449DD1","#F86624","#EA3A4A","#9C63D1","#899E2A"],palette7:["#DF475B","#1B998B","#7E75B7","#F46036","#B1911B"],palette8:["#9C63D1","#F86624","#B38F04","#EA3A4A","#2FA2B3"],palette9:["#98776F","#A19285","#A8705E","#BA6560","#A0927F"],palette10:["#C91EFF","#A94BFD","#6C6AFE","#2983FF","#009ED8"],cvdDeuteranopia:["#0072B2","#E69F00","#56B4E9","#009E73","#F0E442","#D55E00","#CC79A7"],cvdProtanopia:["#0077BB","#EE7733","#009988","#EE3377","#BBBBBB","#33BBEE","#CC3311"],cvdTritanopia:["#CC3311","#009988","#EE7733","#0077BB","#EE3377","#BBBBBB","#33BBEE"],highContrast:["#005A9C","#C00000","#007A33","#6C3483","#7B3F00","#0097A7","#4A235A"]}}class $t{constructor(t,{theme:e=null,timeScale:i=null}={},s){this.w=t,this.elgrid=s,this.xaxisFontSize=t.config.xaxis.labels.style.fontSize,this.axisFontFamily=t.config.xaxis.labels.style.fontFamily,this.xaxisForeColors=t.config.xaxis.labels.style.colors,this.isCategoryBarHorizontal="bar"===t.config.chart.type&&t.config.plotOptions.bar.horizontal,this.xAxisoffX="bottom"===t.config.xaxis.position?t.layout.gridHeight:0,this.drawnLabels=[],this.axesUtils=new Bt(t,{theme:e,timeScale:i})}drawYaxis(t){const e=this.w,i=new Dt(this.w),s=e.config.yaxis[t].labels.style,{fontSize:a,fontFamily:r,fontWeight:n}=s,o=i.group({class:"apexcharts-yaxis",rel:t,transform:`translate(${e.globals.translateYAxisX[t]}, 0)`});if(this.axesUtils.isYAxisHidden(t))return o;const l=i.group({class:"apexcharts-yaxis-texts-g"});o.add(l);const h=e.globals.yAxisScale[t].result.length-1,c=e.layout.gridHeight/h,d=e.formatters.yLabelFormatters[t],p=this.axesUtils.checkForReversedLabels(t,e.globals.yAxisScale[t].result.slice());let u=1;if("heatmap"===e.config.chart.type&&!e.config.yaxis[t].labels.formatter){const t=parseInt(a,10)||11,i=Math.max(1,Math.floor(e.layout.gridHeight/(1.4*t))),s=h+1;s>i&&(u=Math.ceil(s/i))}if(e.config.yaxis[t].labels.show){let o=e.layout.translateY+e.config.yaxis[t].labels.offsetY;e.globals.isBarHorizontal?o=0:"heatmap"===e.config.chart.type&&(o-=c/2),o+=parseInt(a,10)/3;let g=null;for(let f=h;f>=0;f--){const h=u>1&&f%u!==0?"":d(p[f],f,e);let x=e.config.yaxis[t].labels.padding;e.config.yaxis[t].opposite&&0!==e.config.yaxis.length&&(x*=-1);const m=this.getTextAnchor(e.config.yaxis[t].labels.align,e.config.yaxis[t].opposite),b=this.axesUtils.getYAxisForeColor(s.colors,t),y=Array.isArray(b)?b[f]:b,w=Array.from(e.dom.baseEl.querySelectorAll(`.apexcharts-yaxis[rel='${t}'] .apexcharts-yaxis-label tspan`)).map(t=>t.textContent),v=i.drawText({x:x,y:o,text:w.includes(h)&&!e.config.yaxis[t].labels.showDuplicates?"":h,textAnchor:m,fontSize:a,fontFamily:r,fontWeight:n,maxWidth:e.config.yaxis[t].labels.maxWidth,foreColor:y,isPlainText:!1,cssClass:`apexcharts-yaxis-label ${s.cssClass}`});l.add(v),this.addTooltip(v,h),null===g&&(g=v),0!==e.config.yaxis[t].labels.rotate&&this.rotateLabel(i,v,g,e.config.yaxis[t].labels.rotate),o+=c}}return this.addYAxisTitle(i,o,t),this.addAxisBorder(i,o,t,h,c),o}getTextAnchor(t,e){return"left"===t?"start":"center"===t?"middle":"right"===t?"end":e?"start":"end"}addTooltip(t,e){const i=b.createElementNS($,"title");i.textContent=Array.isArray(e)?e.join(" "):e,t.node.appendChild(i)}rotateLabel(t,e,i,s){const a=t.rotateAroundCenter(i.node),r=t.rotateAroundCenter(e.node);e.node.setAttribute("transform",`rotate(${s} ${a.x} ${r.y})`)}addYAxisTitle(t,e,i){const s=this.w;if(void 0!==s.config.yaxis[i].title.text){const a=t.group({class:"apexcharts-yaxis-title"}),r=s.config.yaxis[i].opposite?s.globals.translateYAxisX[i]:0,n=t.drawText({x:r,y:s.layout.gridHeight/2+s.layout.translateY+s.config.yaxis[i].title.offsetY,text:s.config.yaxis[i].title.text,textAnchor:"end",foreColor:s.config.yaxis[i].title.style.color,fontSize:s.config.yaxis[i].title.style.fontSize,fontWeight:s.config.yaxis[i].title.style.fontWeight,fontFamily:s.config.yaxis[i].title.style.fontFamily,cssClass:`apexcharts-yaxis-title-text ${s.config.yaxis[i].title.style.cssClass}`});a.add(n),e.add(a)}}addAxisBorder(t,e,i,s,a){const r=this.w,n=r.config.yaxis[i].axisBorder;let o=31+n.offsetX;if(r.config.yaxis[i].opposite&&(o=-31-n.offsetX),n.show){const i=t.drawLine(o,r.layout.translateY+n.offsetY-2,o,r.layout.gridHeight+r.layout.translateY+n.offsetY+2,n.color,0,n.width);e.add(i)}r.config.yaxis[i].axisTicks.show&&this.axesUtils.drawYAxisTicks(o,s,n,r.config.yaxis[i].axisTicks,i,a,e)}drawYaxisInversed(t){const e=this.w,i=new Dt(this.w),s=i.group({class:"apexcharts-xaxis apexcharts-yaxis-inversed"}),a=i.group({class:"apexcharts-xaxis-texts-g",transform:`translate(${e.layout.translateXAxisX}, ${e.layout.translateXAxisY})`});s.add(a);let r=e.globals.yAxisScale[t].result.length-1;const n=e.layout.gridWidth/r+.1;let o=n+e.config.xaxis.labels.offsetX;const l=e.formatters.xLabelFormatter;let h=this.axesUtils.checkForReversedLabels(t,e.globals.yAxisScale[t].result.slice());const c=e.labelData.timescaleLabels;if(c.length>0&&(this.xaxisLabels=c.slice(),h=c.slice(),r=h.length),e.config.xaxis.labels.show)for(let s=c.length?0:r;c.length?s<c.length:s>=0;c.length?s++:s--){let r=null==l?void 0:l(h[s],s,e),d=e.layout.gridWidth+e.globals.padHorizontal-(o-n+e.config.xaxis.labels.offsetX);if(c.length){const t=this.axesUtils.getLabel(h,c,d,s,this.drawnLabels,this.xaxisFontSize);d=t.x,r=t.text,this.drawnLabels.push(t.text),0===s&&e.globals.skipFirstTimelinelabel&&(r=""),s===h.length-1&&e.globals.skipLastTimelinelabel&&(r="")}const p=i.drawText({x:d,y:this.xAxisoffX+e.config.xaxis.labels.offsetY+30-("top"===e.config.xaxis.position?e.layout.xAxisHeight+e.config.xaxis.axisTicks.height-2:0),text:r,textAnchor:"middle",foreColor:Array.isArray(this.xaxisForeColors)?this.xaxisForeColors[t]:this.xaxisForeColors,fontSize:this.xaxisFontSize,fontFamily:this.axisFontFamily,fontWeight:e.config.xaxis.labels.style.fontWeight,isPlainText:!1,cssClass:`apexcharts-xaxis-label ${e.config.xaxis.labels.style.cssClass}`});a.add(p),this.addTooltip(p,r),o+=n}return this.inversedYAxisTitleText(s),this.inversedYAxisBorder(s),s}inversedYAxisBorder(t){const e=this.w,i=new Dt(this.w),s=e.config.xaxis.axisBorder;if(s.show){let a=0;"bar"===e.config.chart.type&&e.axisFlags.isXNumeric&&(a-=15);const r=i.drawLine(e.globals.padHorizontal+a+s.offsetX,this.xAxisoffX,e.layout.gridWidth,this.xAxisoffX,s.color,0,s.height);this.elgrid&&this.elgrid.elGridBorders&&e.config.grid.show?this.elgrid.elGridBorders.add(r):t.add(r)}}inversedYAxisTitleText(t){const e=this.w,i=new Dt(this.w);if(void 0!==e.config.xaxis.title.text){const s=i.group({class:"apexcharts-xaxis-title apexcharts-yaxis-title-inversed"}),a=i.drawText({x:e.layout.gridWidth/2+e.config.xaxis.title.offsetX,y:this.xAxisoffX+parseFloat(this.xaxisFontSize)+parseFloat(e.config.xaxis.title.style.fontSize)+e.config.xaxis.title.offsetY+20,text:e.config.xaxis.title.text,textAnchor:"middle",fontSize:e.config.xaxis.title.style.fontSize,fontFamily:e.config.xaxis.title.style.fontFamily,fontWeight:e.config.xaxis.title.style.fontWeight,foreColor:e.config.xaxis.title.style.color,cssClass:`apexcharts-xaxis-title-text ${e.config.xaxis.title.style.cssClass}`});s.add(a),t.add(s)}}yAxisTitleRotate(t,e){const i=this.w,s=new Dt(this.w),a=i.dom.baseEl.querySelector(`.apexcharts-yaxis[rel='${t}'] .apexcharts-yaxis-texts-g`),r=a?a.getBoundingClientRect():{width:0,height:0},n=i.dom.baseEl.querySelector(`.apexcharts-yaxis[rel='${t}'] .apexcharts-yaxis-title text`),o=n?n.getBoundingClientRect():{width:0,height:0};if(n){const a=this.xPaddingForYAxisTitle(t,r,o,e);n.setAttribute("x",String(a.xPos-(e?10:0)));const l=s.rotateAroundCenter(n);n.setAttribute("transform",`rotate(${e?-1*i.config.yaxis[t].title.rotate:i.config.yaxis[t].title.rotate} ${l.x} ${l.y})`)}}xPaddingForYAxisTitle(t,e,i,s){const a=this.w;let r=0,n=10;return void 0===a.config.yaxis[t].title.text||t<0?{xPos:r,padd:0}:(s?r=e.width+a.config.yaxis[t].title.offsetX+i.width/2+n/2:(r=-1*e.width+a.config.yaxis[t].title.offsetX+n/2+i.width/2,a.globals.isBarHorizontal&&(n=25,r=-1*e.width-a.config.yaxis[t].title.offsetX-n)),{xPos:r,padd:n})}setYAxisXPosition(t,e){const i=this.w;let s=0,a=0,r=18,n=1;i.config.yaxis.length>1&&(this.multipleYs=!0),i.config.yaxis.forEach((o,l)=>{const h=i.globals.ignoreYAxisIndexes.includes(l)||!o.show||o.floating||0===t[l].width,c=t[l].width+e[l].width;o.opposite?i.globals.isBarHorizontal?(a=i.layout.gridWidth+i.layout.translateX-1,i.globals.translateYAxisX[l]=a-o.labels.offsetX):(a=i.layout.gridWidth+i.layout.translateX+n,h||(n+=c+20),i.globals.translateYAxisX[l]=a-o.labels.offsetX+20):(s=i.layout.translateX-r,h||(r+=c+20),i.globals.translateYAxisX[l]=s+o.labels.offsetX)})}setYAxisTextAlignments(){const t=this.w;Array.from(t.dom.baseEl.getElementsByClassName("apexcharts-yaxis")).forEach((e,i)=>{const s=t.config.yaxis[i];if(s&&!s.floating&&void 0!==s.labels.align){const e=t.dom.baseEl.querySelector(`.apexcharts-yaxis[rel='${i}'] .apexcharts-yaxis-texts-g`),a=Array.from(t.dom.baseEl.querySelectorAll(`.apexcharts-yaxis[rel='${i}'] .apexcharts-yaxis-label`)),r=e.getBoundingClientRect();a.forEach(t=>{t.setAttribute("text-anchor",s.labels.align)}),"left"!==s.labels.align||s.opposite?"center"===s.labels.align?e.setAttribute("transform",`translate(${r.width/2*(s.opposite?1:-1)}, 0)`):"right"===s.labels.align&&s.opposite&&e.setAttribute("transform",`translate(${r.width}, 0)`):e.setAttribute("transform",`translate(-${r.width}, 0)`)}})}}class Gt{constructor(t,e){this.w=t,this.ctx=e,this.documentEvent=this.documentEvent.bind(this)}addEventListener(t,e){const i=this.w;Object.prototype.hasOwnProperty.call(i.globals.events,t)?i.globals.events[t].push(e):i.globals.events[t]=[e]}removeEventListener(t,e){const i=this.w;if(!Object.prototype.hasOwnProperty.call(i.globals.events,t))return;const s=i.globals.events[t].indexOf(e);-1!==s&&i.globals.events[t].splice(s,1)}fireEvent(t,e){const i=this.w;if(!Object.prototype.hasOwnProperty.call(i.globals.events,t))return;e&&e.length||(e=[]);const s=i.globals.events[t],a=s.length;for(let t=0;t<a;t++)s[t].apply(null,e)}setupEventHandlers(){const t=this.w,e=this.ctx,i=t.dom.baseEl.querySelector(t.globals.chartClass);this.ctx.eventList.forEach(s=>{null==i||i.addEventListener(s,i=>{const s=null===i.target.getAttribute("i")&&-1!==t.interact.capturedSeriesIndex?t.interact.capturedSeriesIndex:i.target.getAttribute("i"),a=null===i.target.getAttribute("j")&&-1!==t.interact.capturedDataPointIndex?t.interact.capturedDataPointIndex:i.target.getAttribute("j"),r=Object.assign({},t,{seriesIndex:t.globals.axisCharts?s:0,dataPointIndex:a});"keydown"===i.type?t.config.chart.accessibility.enabled&&t.config.chart.accessibility.keyboard.enabled&&(e.ctx.keyboardNavigation&&e.ctx.keyboardNavigation.handleKey(i),"function"==typeof t.config.chart.events.keyDown&&t.config.chart.events.keyDown(i,e,r),e.ctx.events.fireEvent("keydown",[i,e,r])):"keyup"===i.type?t.config.chart.accessibility.enabled&&t.config.chart.accessibility.keyboard.enabled&&("function"==typeof t.config.chart.events.keyUp&&t.config.chart.events.keyUp(i,e,r),e.ctx.events.fireEvent("keyup",[i,e,r])):"mousemove"===i.type||"touchmove"===i.type?"function"==typeof t.config.chart.events.mouseMove&&t.config.chart.events.mouseMove(i,e,r):"mouseleave"===i.type||"touchleave"===i.type?"function"==typeof t.config.chart.events.mouseLeave&&t.config.chart.events.mouseLeave(i,e,r):("mouseup"===i.type&&1===i.which||"touchend"===i.type)&&("function"==typeof t.config.chart.events.click&&t.config.chart.events.click(i,e,r),e.ctx.events.fireEvent("click",[i,e,r]))},{capture:!1,passive:!0})}),this.ctx.eventList.forEach(e=>{t.dom.baseEl.addEventListener(e,this.documentEvent,{passive:!0})}),this.ctx.core.setupBrushHandler()}documentEvent(t){const e=this.w,i=t.target.className;if("click"===t.type){const t=e.dom.baseEl.querySelector(".apexcharts-menu");t&&t.classList.contains("apexcharts-menu-open")&&"apexcharts-menu-icon"!==i&&t.classList.remove("apexcharts-menu-open")}e.interact.clientX="touchmove"===t.type?t.touches[0].clientX:t.clientX,e.interact.clientY="touchmove"===t.type?t.touches[0].clientY:t.clientY}}class jt{constructor(t){this.w=t}setCurrentLocaleValues(t){let e=this.w.config.chart.locales;const i=d.getApex();i.chart&&i.chart.locales&&i.chart.locales.length>0&&(e=this.w.config.chart.locales.concat(i.chart.locales));const s=e.filter(e=>e.name===t)[0];if(!s)throw new Error("Wrong locale name provided. Please make sure you set the correct locale name in options");{const t=v.extend(C,s);this.w.globals.locale=t.options}}}class Vt{constructor(t,e){this.w=t,this.ctx=e}drawAxis(t,e){const i=this.w.globals,s=this.w.config,a=new Nt(this.w,this.ctx,e),r=new $t(this.w,{theme:this.ctx.theme,timeScale:this.ctx.timeScale},e);if(i.axisCharts&&"radar"!==t){let t,e;i.isBarHorizontal?(e=r.drawYaxisInversed(0),t=a.drawXaxisInversed(0),this.w.dom.elGraphical.add(t),this.w.dom.elGraphical.add(e)):(t=a.drawXaxis(),this.w.dom.elGraphical.add(t),s.yaxis.map((t,s)=>{if(-1===i.ignoreYAxisIndexes.indexOf(s)&&(e=r.drawYaxis(s),this.w.dom.Paper.add(e),"back"===this.w.config.grid.position)){const t=this.w.dom.Paper.children()[1];t&&(t.remove(),this.w.dom.Paper.add(t))}}))}}}class Ut{constructor(t){this.w=t}drawXCrosshairs(){const t=this.w;t.dom.elGraphical.node.querySelectorAll(":scope > .apexcharts-xcrosshairs").forEach(t=>t.remove());const e=new Dt(this.w),i=new Mt(this.w),s=t.config.xaxis.crosshairs.fill.gradient,a=t.config.xaxis.crosshairs.dropShadow,r=t.config.xaxis.crosshairs.fill.type,n=s.colorFrom,o=s.colorTo,l=s.opacityFrom,h=s.opacityTo,c=s.stops,d=a.enabled,p=a.left,u=a.top,g=a.blur,f=a.color,x=a.opacity;let m=t.config.xaxis.crosshairs.fill.color;if(t.config.xaxis.crosshairs.show){"gradient"===r&&(m=e.drawGradient("vertical",n,o,l,h,null,c,[]));let s=1===t.config.xaxis.crosshairs.width?e.drawLine(0,0,0,0):e.drawRect(),a=t.layout.gridHeight;(!v.isNumber(a)||a<0)&&(a=0);let b=t.config.xaxis.crosshairs.width;(!v.isNumber(b)||Number(b)<0)&&(b=0),s.attr({class:"apexcharts-xcrosshairs",x:0,y:0,y2:a,width:b,height:a,fill:m,filter:"none","fill-opacity":t.config.xaxis.crosshairs.opacity,stroke:t.config.xaxis.crosshairs.stroke.color,"stroke-width":t.config.xaxis.crosshairs.stroke.width,"stroke-dasharray":t.config.xaxis.crosshairs.stroke.dashArray}),d&&(s=i.dropShadow(s,{left:p,top:u,blur:g,color:f,opacity:x})),t.dom.elGraphical.add(s)}}drawYCrosshairs(){const t=this.w;t.dom.elGraphical.node.querySelectorAll(":scope > .apexcharts-ycrosshairs, :scope > .apexcharts-ycrosshairs-hidden").forEach(t=>t.remove());const e=new Dt(this.w),i=t.config.yaxis[0].crosshairs,s=t.globals.barPadForNumericAxis;if(t.config.yaxis[0].crosshairs.show){const a=e.drawLine(-s,0,t.layout.gridWidth+s,0,i.stroke.color,i.stroke.dashArray,i.stroke.width);a.attr({class:"apexcharts-ycrosshairs"}),t.dom.elGraphical.add(a)}const a=e.drawLine(-s,0,t.layout.gridWidth+s,0,i.stroke.color,0,0);a.attr({class:"apexcharts-ycrosshairs-hidden"}),t.dom.elGraphical.add(a)}}function qt(t,e){if(!v.isObject(t)||!v.isObject(e))return void 0!==e?e:t;const i=o({},t);for(const s of Object.keys(e)){const a=e[s];void 0!==a&&(v.isObject(a)&&v.isObject(t[s])?i[s]=qt(t[s],a):i[s]=a)}return i}class Zt{constructor(t){this.w=t,this._activeBreakpoint=null}checkResponsiveConfig(t){const e=this.w,i=e.config;if(0===i.responsive.length)return;const s=i.responsive.slice();s.sort((t,e)=>t.breakpoint>e.breakpoint?1:e.breakpoint>t.breakpoint?-1:0).reverse();const a=new z({}),r=(t={})=>{var i;const r=s[0].breakpoint,n=d.isBrowser()?window.innerWidth>0?window.innerWidth:screen.width:0;if(n>r){if(null!==this._activeBreakpoint){if(!e.globals.initialConfig)return;const i=v.clone(e.globals.initialConfig);i.series=v.clone(e.config.series);const s=H.extendArrayProps(a,i,e);t=v.extend(s,t),this.overrideResponsiveOptions(t),this._activeBreakpoint=null}}else for(let r=0;r<s.length;r++)if(n<s[r].breakpoint){const n=(null==(i=s[r].options)?void 0:i.yaxis)?v.clone(s[r].options.yaxis):null;if(t=H.extendArrayProps(a,s[r].options,e),t=v.extend(e.config,t),Array.isArray(e.config.yaxis)&&n){const i=Array.isArray(n)?n:[n];t=l(o({},t),{yaxis:e.config.yaxis.map((t,e)=>qt(t,i[e]))})}this.overrideResponsiveOptions(t),this._activeBreakpoint=s[r].breakpoint}};if(t){let i=H.extendArrayProps(a,t,e);i=v.extend(e.config,i),i=v.extend(i,t),r(i)}else r({})}overrideResponsiveOptions(t){const e=new z(t).init({responsiveOverride:!0});this.w.config=e}}const Kt=/[+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?/gi;function Jt(t,e){const{ax:i,bx:s,ay:a,by:r}=e,n=[],o=/([MmLlHhVvCcSsQqTtAaZz])([^MmLlHhVvCcSsQqTtAaZz]*)/g;let l;for(;null!==(l=o.exec(t));){const t=l[1].toUpperCase(),e=(l[2].match(Kt)||[]).map(parseFloat);if("Z"===t){n.push("z");continue}if("H"===t){for(const t of e)n.push(`H ${i*t+s}`);continue}if("V"===t){for(const t of e)n.push(`V ${a*t+r}`);continue}if("A"===t){for(let t=0;t+6<e.length;t+=7)n.push(`A ${e[t]} ${e[t+1]} ${e[t+2]} ${e[t+3]} ${e[t+4]} ${i*e[t+5]+s} ${a*e[t+6]+r}`);continue}const o=[];for(let t=0;t+1<e.length;t+=2)o.push(`${i*e[t]+s} ${a*e[t+1]+r}`);o.length&&n.push(`${t} ${o.join(" ")}`)}return n.join(" ")}function Qt(t,e,i){if(!t||"string"!=typeof t)return null;const s=U(t);if(!s.length||"M"!==s[0][0])return null;for(let t=1;t<s.length;t++)if("M"===s[t][0])return null;let a=s,r=null;if(i){if(s.length<5)return null;if(r=s.slice(-3),a=s.slice(0,-3),"Z"!==r[2][0])return null;if("L"!==r[1][0])return null;if("L"!==r[0][0]&&"C"!==r[0][0])return null}else if("Z"===s[s.length-1][0])return null;if(a.length!==e||a.length<2)return null;const n=a[1][0];if("L"!==n&&"C"!==n)return null;for(let t=2;t<a.length;t++)if(a[t][0]!==n)return null;const o=a.map(t=>"C"===t[0]?[Number(t[5]),Number(t[6])]:[Number(t[1]),Number(t[2])]);for(const t of o)if(!isFinite(t[0])||!isFinite(t[1]))return null;return{body:a,closing:r,segType:n,anchors:o}}function te(t,e,i){return[t[0]+(e[0]-t[0])*i,t[1]+(e[1]-t[1])*i]}function ee(t,e,i){const s=t,a=[e[1],e[2]],r=[e[3],e[4]],n=[e[5],e[6]],o=te(s,a,i),l=te(a,r,i),h=te(r,n,i),c=te(o,l,i),d=te(l,h,i),p=te(c,d,i);return{first:["C",o[0],o[1],c[0],c[1],p[0],p[1]],second:["C",d[0],d[1],h[0],h[1],n[0],n[1]],mid:p}}function ie(t,e,i){const s=[e[1],e[2]],a=te(t,s,i);return{first:["L",a[0],a[1]],second:["L",s[0],s[1]],mid:a}}function se(t,e){const{body:i,closing:s,segType:a,anchors:r}=t,n=r.length,o=e.length,l=t=>"C"===a?["C",t[0],t[1],t[0],t[1],t[0],t[1]]:["L",t[0],t[1]],h=[["M",r[0][0],r[0][1]]];let c=0;for(;c<o&&0!==e[c];)c++;for(let t=1;t<=c;t++)h.push(l(r[0]));let d=c+1;for(let t=0;t<n-1;t++){let s=0;for(;d+s<o&&-1===e[d+s];)s++;const n=i[t+1];if(s){const e=s+1;let i=r[t],o=n;for(let t=0;t<s;t++){const s=1/(e-t),r="C"===a?ee(i,o,s):ie(i,o,s);h.push(r.first),i=r.mid,o=r.second}h.push(o)}else h.push(n.slice());d+=s+1}for(;d<o;)h.push(l(r[n-1])),d++;return s&&s.forEach(t=>h.push(t.slice())),h}function ae(t,e,i,s,a,r){const n=Qt(t,s,r);if(!n)return null;const o=Qt(e,a,r);if(!o)return null;if(n.segType!==o.segType)return null;if((n.closing||o.closing)&&(!n.closing||!o.closing||n.closing[0][0]!==o.closing[0][0]))return null;const l=i.map(t=>t.oldJ),h=i.map(t=>t.newJ);return{from:Z(se(n,l)),toInterp:Z(se(o,h))}}function re(t){var e;const i=t.config.chart.animations;if(!i||!1===i.enabled)return!1;if(!i.dynamicAnimation||!1===i.dynamicAnimation.enabled)return!1;const s=null!=(e=i.largeDatasetThreshold)?e:0;return!(s>0&&t.globals.dataPoints>s)&&!!(d.isBrowser()&&t.globals.dataChanged&&t.globals.shouldAnimate)}function ne(t,e,i){var s,a,r,n;if(null==(s=t.axisFlags)?void 0:s.isXNumeric){const s=null==(r=null==(a=t.seriesData)?void 0:a.seriesX)?void 0:r[e];if(s&&s.length&&null!=s[i])return"x:"+s[i]}const o=null==(n=t.globals.labels)?void 0:n[i];return null!=o&&""!==String(o)?"c:"+(Array.isArray(o)?o.join(" "):String(o)):"j:"+i}function oe(t){const e=new Map;return t.map(t=>{const i=e.get(t)||0;return e.set(t,i+1),0===i?t:`${t}#${i}`})}function le(t,e,i=!1,s=!1){var a,r;if(!re(t))return null;const n=t.globals.prevStreamFrame;if(!n)return null;const o=null==(a=n.seriesY)?void 0:a[e],l=null==(r=t.seriesData.series)?void 0:r[e];if(!Array.isArray(o)||!Array.isArray(l))return null;if(!o.length||!l.length)return null;const h=oe(o.map((t,i)=>function(t,e,i){var s,a;if(t.isXNumeric){const a=null==(s=t.seriesX)?void 0:s[e];if(a&&a.length&&null!=a[i])return"x:"+a[i]}const r=null==(a=t.labels)?void 0:a[i];return null!=r&&""!==String(r)?"c:"+(Array.isArray(r)?r.join(" "):String(r)):"j:"+i}(n,e,i))),c=oe(l.map((i,s)=>ne(t,e,s))),d=function(t,e){const i=new Map;t.forEach((t,e)=>{i.has(t)||i.set(t,e)});const s=new Array(e.length),a=new Set;let r=-1,n=!0,o=t.length===e.length;e.forEach((t,e)=>{const l=i.has(t)&&!a.has(i.get(t))?i.get(t):-1;s[e]=l,-1!==l&&(a.add(l),l<r&&(n=!1),r=l),l!==e&&(o=!1)});const l=[];for(let e=0;e<t.length;e++)a.has(e)||l.push(e);return{toOld:s,exits:l,ordered:n,changed:!o}}(h,c);return(d.ordered||s)&&(d.changed||i)?{join:d,oldKeys:h,newKeys:c}:null}function he(t){var e,i;const s=t.config.chart.animations;return ft(null!=(i=null==(e=s.dynamicAnimation)?void 0:e.easing)?i:s.easing)}function ce(t,e,i,s,a){const r=performance.now(),n=o=>{if(t.globals.isDestroyed)return;const l=Math.max(0,Math.min(1,(o-r)/e));s(i(l),l),l<1?b.requestAnimationFrame(n):a&&a()};b.requestAnimationFrame(n)}function de(t,{elPointsMain:e,realIndex:i,speed:s}){var a,r,n,o;if(!(null==e?void 0:e.node))return!1;const l=le(t,i,!0);if(!l)return!1;const h=t.globals.prevStreamFrame;if(!h)return!1;const c=null==(a=h.xPixels)?void 0:a[i],d=null==(r=h.yPixels)?void 0:r[i];if(!c||!d)return!1;const p=e.node.querySelectorAll(".apexcharts-marker");if(!p.length)return!1;const u=(null==(n=t.globals.seriesXvalues)?void 0:n[i])||[],g=(null==(o=t.globals.seriesYvalues)?void 0:o[i])||[],f=he(t),x=Math.max(1,s||1);return e.node.classList.remove("apexcharts-element-hidden"),p.forEach(e=>{var s,a,r,n,o,p,m,b,y;const w=parseInt(null!=(a=null!=(s=e.getAttribute("j"))?s:e.getAttribute("rel"))?a:"",10);if(!isFinite(w)||w<0||w>=l.join.toOld.length)return;const v=l.join.toOld[w],A=null!=u[w]&&null!=g[w]?[u[w],g[w]]:null;if(-1===v||!A){const i=e.style;return i.opacity="0",void ce(t,x,f,t=>{i.opacity=String(t)},()=>{i.opacity=""})}const S=(null!=(r=c[v])?r:NaN)-A[0],C=(null!=(n=d[v])?n:NaN)-A[1];if(!isFinite(S)||!isFinite(C))return;const k=null!=(m=null==(p=null==(o=h.rPixels)?void 0:o[i])?void 0:p[v])?m:NaN,_=parseFloat(null!=(y=null!=(b=e.getAttribute("r"))?b:e.getAttribute("default-marker-size"))?y:""),M=isFinite(k)&&isFinite(_)&&_>0&&Math.abs(k-_)>.25;if(!(Math.abs(S)>=.5||Math.abs(C)>=.5)&&!M)return;const D=t=>{const i=S*(1-t),s=C*(1-t);if(M){const a=(k+(_-k)*t)/_;e.setAttribute("transform",`translate(${i+A[0]*(1-a)}, ${s+A[1]*(1-a)}) scale(${a})`)}else e.setAttribute("transform",`translate(${i}, ${s})`)};D(0),ce(t,x,f,D,()=>{e.removeAttribute("transform")})}),!0}function pe(t,{type:e,realIndex:i,pathFromLine:s,pathFromArea:a,linePaths:r,areaPaths:n}){var o,l;const h=le(t,i);if(!h)return null;const{join:c,oldKeys:d,newKeys:p}=h,u=t.globals.prevStreamFrame;if(!u)return null;const g=null==(o=u.seriesY)?void 0:o[i],f=null==(l=t.seriesData.series)?void 0:l[i];if(g.length<2||f.length<2)return null;if(g.some(t=>null===t)||f.some(t=>null===t))return null;const x=function(t,e){const i=new Set(t.exits),s=[];let a=0;for(let e=0;e<t.toOld.length;e++){const r=t.toOld[e];if(-1!==r){for(;a<r;)i.has(a)&&s.push({oldJ:a,newJ:-1}),a++;s.push({oldJ:r,newJ:e}),a=r+1}else s.push({oldJ:-1,newJ:e})}for(;a<e;)i.has(a)&&s.push({oldJ:a,newJ:-1}),a++;return s}(c,d.length),m={};return Array.isArray(r)&&1===r.length&&s&&(m.line=ae(s,r[0],x,d.length,p.length,!1)),"area"===e&&Array.isArray(n)&&1===n.length&&a&&(m.area=ae(a,n[0],x,d.length,p.length,!0)),m.line||m.area?m:null}function ue({w:t,elSeries:e,record:i,newKeys:s,isHorizontal:a,speed:r}){var n;if(!re(t))return;if(!i||!Array.isArray(i.paths)||!(null==e?void 0:e.node))return;const o=new Set(s),l=i.paths.filter(t=>t&&t.d&&null!=t.key&&!o.has(t.key));if(!l.length)return;const h=new Dt(t),c=null==(n=t.globals.colors)?void 0:n[parseInt(String(i.realIndex),10)];l.forEach(i=>{let s=i.fill||c||"#c8c8c8";0===String(s).indexOf("url(")&&(s=c||"#c8c8c8");const n=h.drawPath({d:i.d,stroke:"none",strokeWidth:0,fill:s,fillOpacity:1,classes:"apexcharts-bar-ghost"}),o=n.node;o.setAttribute("pointer-events","none"),n.attr("clip-path",`url(#gridRectBarMask${t.globals.cuid})`),e.node.insertBefore(o,e.node.firstChild);const l=function(t){const e=/^M\s*([+-]?[\d.eE]+)[\s,]+([+-]?[\d.eE]+)/.exec(t||"");if(!e)return null;const i=parseFloat(e[1]),s=parseFloat(e[2]);return isFinite(i)&&isFinite(s)?{x:i,y:s}:null}(i.d);let d=a?"left center":"center bottom";try{const t=o.getBBox();l&&t&&(d=a?Math.abs(l.x-t.x)<=Math.abs(l.x-(t.x+t.width))?"left center":"right center":Math.abs(l.y-(t.y+t.height))<=Math.abs(l.y-t.y)?"center bottom":"center top")}catch(t){}const p=o.style;p.transformBox="fill-box",p.transformOrigin=d;const u=Math.max(1,r||1),g=performance.now(),f=e=>{if(t.globals.isDestroyed||!o.parentNode)return;const i=Math.max(0,Math.min(1,(e-g)/u)),s=1-Math.pow(1-i,3),r=1-s;p.transform=a?`scaleX(${r})`:`scaleY(${r})`,p.opacity=String(1-s),i<1?b.requestAnimationFrame(f):o.parentNode.removeChild(o)};b.requestAnimationFrame(f)})}function ge(t,e,i){return[...t.querySelectorAll(e)].map(t=>{var e,s,a;return{text:t.textContent||"",display:null!=(a=null!=(s=null==(e=t.querySelector("tspan"))?void 0:e.textContent)?s:t.textContent)?a:"",pos:parseFloat(t.getAttribute(i)||""),transform:t.getAttribute("transform")}})}function fe(t,e,i){return[...t.querySelectorAll(e)].map(t=>parseFloat(t.getAttribute(i)||""))}const xe=":not(.apexcharts-tick-ghost)",me=`.apexcharts-xaxis-texts-g text:not(.apexcharts-xaxis-group-label)${xe}`,be=`.apexcharts-yaxis-texts-g text${xe}`,ye=`.apexcharts-gridlines-vertical line${xe}`,we=`.apexcharts-gridlines-horizontal line${xe}`;function ve(t){var e,i;const s=t.globals;if(!(null==(e=t.axisFlags)?void 0:e.isXNumeric)||s.isBarHorizontal)return null;if(null==(i=t.config.xaxis)?void 0:i.reversed)return null;const a=s.minX,r=s.maxX,n=t.layout.gridWidth;return isFinite(a)&&isFinite(r)&&r>a&&n>0?{min:a,max:r,width:n}:null}function Ae(t,e){var i;const s=t.globals;if(s.isBarHorizontal)return null;if(!Array.isArray(t.config.yaxis)||1!==t.config.yaxis.length)return null;if(null==(i=t.config.yaxis[0])?void 0:i.logarithmic)return null;const a=s.minY,r=s.maxY;if(!(isFinite(a)&&isFinite(r)&&r>a))return null;const n=e.map(t=>t.pos).filter(t=>isFinite(t));return n.length<2?null:{min:a,max:r,pLo:Math.max(...n),pHi:Math.min(...n)}}function Se(t,e){if(!t||!e)return null;const i=t.pHi-t.pLo,s=e.pHi-e.pLo,a=t.max-t.min,r=e.max-e.min;if(!(i&&s&&a>0&&r>0))return null;return{toNew:n=>e.pLo+((e=>t.min+(e-t.pLo)/i*a)(n)-e.min)/r*s,toOld:n=>t.pLo+((t=>e.min+(t-e.pLo)/s*r)(n)-t.min)/a*i}}function Ce(t,e,i,s){const a=e.style;a.opacity="0",ce(t,i,s,t=>{a.opacity=String(t)},()=>{a.opacity=""})}function ke(t,e,i,s,a,r,n){i.forEach(t=>e.setAttribute(t,String(s))),ce(t,r,n,t=>{const r=String(s+(a-s)*t);i.forEach(t=>e.setAttribute(t,r))},()=>{i.forEach(t=>e.setAttribute(t,String(a)))})}function _e(t,{template:e,display:i,attrs:s,from:a,to:r,duration:n,ease:o}){const l=e.parentNode;if(!l)return;const h=e.cloneNode(!0);if(h.classList.add("apexcharts-tick-ghost"),h.setAttribute("pointer-events","none"),h.removeAttribute("id"),void 0!==i){const t=h.querySelector("tspan");t?t.textContent=i:h.textContent=i;const e=h.querySelector("title");e&&(e.textContent=i)}s.forEach(t=>h.setAttribute(t,String(a)));const c=h.style;c.opacity="1",l.appendChild(h),ce(t,n,o,t=>{const e=String(a+(r-a)*t);s.forEach(t=>h.setAttribute(t,e)),c.opacity=String(1-t)},()=>{h.parentNode&&h.parentNode.removeChild(h)})}function Me(t,{newLabels:e,oldLabels:i,posAttr:s,newLines:a,oldLines:r,lineAttrs:n,duration:h,ease:c,project:d}){const p=new Map;i.forEach((t,e)=>{p.has(t.text)||p.set(t.text,l(o({},t),{i:e}))});const u=new Set,g=a.length===e.length,f=r.length===i.length,x=i.map(t=>t.pos).concat(e.map(t=>parseFloat(t.getAttribute(s)||""))).filter(t=>isFinite(t)),m=Math.min(...x),b=Math.max(...x),y=Math.max(40,.25*(b-m)),w=t=>Math.max(m-y,Math.min(b+y,t)),v=(e,i)=>{if(!e)return;const s=parseFloat(e.getAttribute(n[0])||""),a=r[i.i];isFinite(s)&&isFinite(a)&&ke(t,e,n,a,s,h,c)};if(e.forEach((e,i)=>{const r=parseFloat(e.getAttribute(s)||""),o=p.get(e.textContent||""),l=g?a[i]:null;o&&u.add(o.i);const f=e.getAttribute("transform");if(o&&isFinite(o.pos)){if(isFinite(r)&&!(Math.abs(o.pos-r)<.5)){if(f||o.transform){const i=o.pos-r;if(isFinite(i)){const a=f||"";ce(t,h,c,t=>{const r=i*(1-t),n="x"===s?`translate(${r} 0)`:`translate(0 ${r})`;e.setAttribute("transform",`${n} ${a}`.trim())},()=>{a?e.setAttribute("transform",a):e.removeAttribute("transform")})}return void v(l,o)}ke(t,e,[s],o.pos,r,h,c),v(l,o)}}else if(!o){if(d&&isFinite(r)&&!f){const i=isFinite(d.toOld(r))?w(d.toOld(r)):NaN;isFinite(i)&&Math.abs(i-r)>.5&&(ke(t,e,[s],i,r,h,c),l&&ke(t,l,n,i,r,h,c))}Ce(t,e,h,c),l&&Ce(t,l,h,c)}}),!d||!e.length)return;let A=0;i.forEach((i,o)=>{if(u.has(o))return;if(!isFinite(i.pos)||i.transform)return;if(A>=20)return;const l=d.toNew(i.pos);!isFinite(l)||Math.abs(l-i.pos)<.5||(A++,_e(t,{template:e[0],display:i.display,attrs:[s],from:i.pos,to:w(l),duration:h,ease:c}),f&&a.length&&isFinite(r[o])&&_e(t,{template:a[0],attrs:n,from:r[o],to:w(d.toNew(r[o])),duration:h,ease:c}))})}function De(t){const e=t.globals,i=e.prevChromeFrame;if(e.prevChromeFrame=null,!i||!e.axisCharts||!d.isBrowser())return;if(!re(t))return;if(!(t.seriesData.series||[]).some((e,i)=>null!==le(t,i,!0,!0)))return;const s=t.dom.baseEl;if(!v.elementExists(s))return;const a=Math.max(1,t.config.chart.animations.dynamicAnimation.speed||1),r=he(t);try{const e=[...s.querySelectorAll(be)],n=function(t,e){if(!t||!e)return null;const i=t.max-t.min,s=e.max-e.min;return i>0&&s>0&&t.width>0&&e.width>0?{toNew:a=>(t.min+a/t.width*i-e.min)/s*e.width,toOld:a=>(e.min+a/e.width*s-t.min)/i*t.width}:null}(i.xScale,ve(t)),o=Se(i.yAnchors,Ae(t,e.map(t=>({pos:parseFloat(t.getAttribute("y")||"")}))));Me(t,{newLabels:[...s.querySelectorAll(me)],oldLabels:i.xLabels,posAttr:"x",newLines:[...s.querySelectorAll(ye)],oldLines:i.vGrid,lineAttrs:["x1","x2"],duration:a,ease:r,project:n}),Me(t,{newLabels:e,oldLabels:i.yLabels,posAttr:"y",newLines:[...s.querySelectorAll(we)],oldLines:i.hGrid,lineAttrs:["y1","y2"],duration:a,ease:r,project:o})}catch(t){}}const Le=".apexcharts-data-labels[data\\:dlKey]",Pe=".apexcharts-datalabel",Ee=".apexcharts-datalabel-total[data\\:dlTotalKey]";function Te(t){var e,i;const s=t.config.dataLabels;return!(!(null==(e=null==s?void 0:s.animate)?void 0:e.enabled)&&!(null==(i=null==s?void 0:s.countUp)?void 0:i.enabled))}function Fe(t){if(!isFinite(t))return 0;const e=String(Math.abs(t)),i=e.indexOf("e");if(-1!==i){const t=e.slice(0,i),s=parseInt(e.slice(i+1),10),a=t.indexOf("."),r=-1===a?0:t.length-a-1;return Math.min(6,Math.max(0,r-s))}const s=e.indexOf(".");return-1===s?0:Math.min(6,e.length-s-1)}function Ie(t,e){const i=t.querySelector("tspan");i?i.textContent=e:t.textContent=e}function Re(t,{el:e,oldCx:i,oldCy:s,duration:a,ease:r,delay:n=0}){const o=e.hasAttribute("cx")?e:e.querySelector(Pe);if(!o)return;const l=i-parseFloat(o.getAttribute("cx")||""),h=s-parseFloat(o.getAttribute("cy")||"");if(!isFinite(l)||!isFinite(h))return;if(Math.abs(l)+Math.abs(h)<=.5)return;const c=e.getAttribute("transform")||"",d=()=>ce(t,a,r,t=>{const i=1-t;e.setAttribute("transform",`translate(${l*i} ${h*i}) ${c}`.trim())},()=>{c?e.setAttribute("transform",c):e.removeAttribute("transform")});n>0?(e.setAttribute("transform",`translate(${l} ${h}) ${c}`.trim()),setTimeout(()=>{t.globals.isDestroyed||d()},n)):d()}function Xe(t,{el:e,from:i,to:s,formatter:a,fmtOpts:r,duration:n,ease:o,delay:l=0}){if(!isFinite(i)||!isFinite(s))return;if(Math.abs(s-i)<=1e-9)return;const h=Math.max(Fe(i),Fe(s)),c=t=>{const e=Number(t.toFixed(h));let i=e;if("function"==typeof a)try{i=a(e,r)}catch(t){i=e}return String(i)},d=()=>ce(t,n,o,t=>{Ie(e,c(i+(s-i)*t))},()=>{Ie(e,c(s))});l>0?(Ie(e,c(i)),setTimeout(()=>{t.globals.isDestroyed||d()},l)):d()}function ze(t){var e,i;const s=t.globals,a=s.prevDataLabels;if(s.prevDataLabels=null,!a||!s.axisCharts||!d.isBrowser())return;if(!Te(t))return;if(!re(t))return;const r=t.dom.baseEl;if(!v.elementExists(r))return;const n=t.config.dataLabels,h=!!(null==(e=n.animate)?void 0:e.enabled),c=!!(null==(i=n.countUp)?void 0:i.enabled),p=n.formatter,u=Math.max(1,t.config.chart.animations.dynamicAnimation.speed||1),g=he(t);try{r.querySelectorAll(Le).forEach(e=>{const i=e.getAttribute("data:dlKey");if(!i)return;const s=e.querySelector(Pe);if(!s)return;const r=a.get(i),n=parseInt(e.getAttribute("data:dlDelay")||"0",10)||0;if(h&&(r&&isFinite(r.cx)&&isFinite(r.cy)?Re(t,{el:e,oldCx:r.cx,oldCy:r.cy,duration:u,ease:g,delay:n}):r||function(t,e,i,s){const a=e.style;a.opacity="0",ce(t,i,s,t=>{a.opacity=String(t)},()=>{a.opacity=""})}(t,e,u,g)),c&&r){const a=parseInt(i,10),h=parseInt(e.getAttribute("data:dlJ")||"",10);Xe(t,{el:s,from:r.val,to:parseFloat(e.getAttribute("data:dlVal")||""),formatter:p,fmtOpts:l(o({},t),{seriesIndex:a,dataPointIndex:isFinite(h)?h:0,w:t}),duration:u,ease:g,delay:n})}});const e=t.config.plotOptions.bar.dataLabels.total.formatter||p;r.querySelectorAll(Ee).forEach(i=>{const s=i.getAttribute("data:dlTotalKey");if(!s)return;const r=a.get(`total::${s}`);if(!r)return;const n=parseInt(i.getAttribute("data:dlDelay")||"0",10)||0;if(h&&isFinite(r.cx)&&isFinite(r.cy)&&Re(t,{el:i,oldCx:r.cx,oldCy:r.cy,duration:u,ease:g,delay:n}),c){const a=parseInt(i.getAttribute("data:dlTotalSeries")||s,10);Xe(t,{el:i,from:r.val,to:parseFloat(i.getAttribute("data:dlTotalVal")||""),formatter:e,fmtOpts:l(o({},t),{seriesIndex:a,dataPointIndex:0,w:t}),duration:u,ease:g,delay:n})}})}catch(t){}}class Be{constructor(t,{toggleDataSeries:e,revertDefaultAxisMinMax:i,updateSeries:s}={}){this.w=t,this._toggleDataSeries=e||null,this._revertDefaultAxisMinMax=i||null,this._updateSeries=s||null,this.legendInactiveClass="legend-mouseover-inactive"}clearSeriesCache(){const t=this.w;t.globals.cachedSelectors&&(delete t.globals.cachedSelectors.allSeriesEls,delete t.globals.cachedSelectors.highlightSeriesEls)}getAllSeriesEls(){const t=this.w,e="allSeriesEls";return t.globals.cachedSelectors[e]||(t.globals.cachedSelectors[e]=t.dom.baseEl.getElementsByClassName("apexcharts-series")),t.globals.cachedSelectors[e]}getSeriesByName(t){return this.w.dom.baseEl.querySelector(`.apexcharts-inner .apexcharts-series[seriesName='${v.escapeString(t)}']`)}isSeriesHidden(t){var e;const i=this.getSeriesByName(t),s=parseInt(null!=(e=i.getAttribute("data:realIndex"))?e:"0",10);return{isHidden:i.classList.contains("apexcharts-series-collapsed"),realIndex:s}}addCollapsedClassToSeries(t,e){Be.addCollapsedClassToSeries(this.w,t,e)}static addCollapsedClassToSeries(t,e,i){let s=!1;function a(t){for(let a=0;a<t.length;a++)t[a].index===i&&(e.node.classList.add("apexcharts-series-collapsed"),s=!0)}if(a(t.globals.collapsedSeries),a(t.globals.ancillaryCollapsedSeries),!s)return;if(-1===(t.globals.collapsingSeriesIndices||[]).indexOf(i))return;if(e.node.classList.add("apexcharts-series-collapsing"),!d.isBrowser())return;const r=t.config.chart.animations,n=(r.dynamicAnimation.speed||0)+(r.speed||0)+100;setTimeout(()=>{t.globals.isDestroyed||e.node.classList.remove("apexcharts-series-collapsing")},n)}toggleSeries(t){var e;const i=this.isSeriesHidden(t);return null==(e=this._toggleDataSeries)||e.call(this,i.realIndex,i.isHidden),i.isHidden}showSeries(t){var e;const i=this.isSeriesHidden(t);i.isHidden&&(null==(e=this._toggleDataSeries)||e.call(this,i.realIndex,!0))}hideSeries(t){var e;const i=this.isSeriesHidden(t);i.isHidden||null==(e=this._toggleDataSeries)||e.call(this,i.realIndex,!1)}prepareDataUpdate(){const t=this.w;this.clearSeriesCache(),t.globals.previousPaths=[],t.globals.collapsedSeries=[],t.globals.ancillaryCollapsedSeries=[],t.globals.collapsedSeriesIndices=[],t.globals.ancillaryCollapsedSeriesIndices=[]}resetSeries(t=!0,e=!0,i=!0){var s,a;const r=this.w;this.clearSeriesCache();let n=v.clone(r.globals.initialSeries);Array.isArray(n)||(n=v.clone(r.config.series)||[]),r.globals.previousPaths=[],i?(r.globals.collapsedSeries=[],r.globals.ancillaryCollapsedSeries=[],r.globals.collapsedSeriesIndices=[],r.globals.ancillaryCollapsedSeriesIndices=[]):n=this.emptyCollapsedSeries(n),r.config.series=n,t&&(e&&(r.interact.zoomed=!1,null==(s=this._revertDefaultAxisMinMax)||s.call(this)),null==(a=this._updateSeries)||a.call(this,n,r.config.chart.animations.dynamicAnimation.enabled))}emptyCollapsedSeries(t){const e=this.w;if(!Array.isArray(t))return t;for(let i=0;i<t.length;i++)e.globals.collapsedSeriesIndices.indexOf(i)>-1&&(t[i]&&"object"==typeof t[i]?t[i].data=[]:t[i]=0);return t}_deriveSeriesNames(){const t=this.w,e=t.config.series||[],i=t.config.labels||[];return e.map((t,e)=>t&&"object"==typeof t&&null!=t.name?String(t.name):null!=i[e]?String(i[e]):`series-${e+1}`)}reconcileCollapsedByName(){const t=this.w,e=t.globals,i=this._deriveSeriesNames(),s=s=>{const a=[],r=[];return s.forEach(s=>{const n=s&&null!=s.name?i.indexOf(s.name):s.index;if(null==n||n<0||n>=t.config.series.length)return;const o=t.config.series[n];s.index=n,s.data=e.axisCharts?o&&o.data?o.data.slice():[]:o,a.push(s),r.push(n)}),{records:a,indices:r}},a=s(e.collapsedSeries);e.collapsedSeries=a.records,e.collapsedSeriesIndices=a.indices;const r=s(e.ancillaryCollapsedSeries);e.ancillaryCollapsedSeries=r.records,e.ancillaryCollapsedSeriesIndices=r.indices,e.allSeriesCollapsed=e.collapsedSeries.length+e.ancillaryCollapsedSeries.length===t.config.series.length,this.emptyCollapsedSeries(t.config.series)}canvasRestyle(t){const e=this.w.globals.activeRenderer;e&&"canvas"===e.kind&&"function"==typeof e.restyle&&e.restyle(t)}highlightSeries(t){var e;const i=this.w,s=this.getSeriesByName(t),a=parseInt(null!=(e=null==s?void 0:s.getAttribute("data:realIndex"))?e:"",10),r="highlightSeriesEls";let n=i.globals.cachedSelectors[r];n||(n=i.dom.baseEl.querySelectorAll(".apexcharts-series, .apexcharts-datalabels, .apexcharts-yaxis"),i.globals.cachedSelectors[r]=n);let o=null,l=null,h=null;if(i.globals.axisCharts||"radialBar"===i.config.chart.type)if(i.globals.axisCharts){o=i.dom.baseEl.querySelector(`.apexcharts-series[data\\:realIndex='${a}']`),l=i.dom.baseEl.querySelector(`.apexcharts-datalabels[data\\:realIndex='${a}']`);const t=i.globals.seriesYAxisReverseMap[a];h=i.dom.baseEl.querySelector(`.apexcharts-yaxis[rel='${t}']`)}else o=i.dom.baseEl.querySelector(`.apexcharts-series[rel='${a+1}']`);else o=i.dom.baseEl.querySelector(`.apexcharts-series[rel='${a+1}'] path`);for(let t=0;t<n.length;t++){n[t].classList.add(this.legendInactiveClass)}if(o){if(!i.globals.axisCharts){const t=o.parentNode;null==t||t.classList.remove(this.legendInactiveClass)}o.classList.remove(this.legendInactiveClass),null!==l&&l.classList.remove(this.legendInactiveClass),null!==h&&h.classList.remove(this.legendInactiveClass)}else for(let t=0;t<n.length;t++){n[t].classList.remove(this.legendInactiveClass)}this.canvasRestyle(o&&!Number.isNaN(a)?{active:a,opacity:.2}:null)}toggleSeriesOnHover(t,e){const i=this.w;e||(e=t.target);const s=i.dom.baseEl.querySelectorAll(".apexcharts-series, .apexcharts-datalabels, .apexcharts-yaxis");if("mousemove"===t.type){const t=parseInt(e.getAttribute("rel"),10)-1;this.highlightSeries(i.seriesData.seriesNames[t])}else if("mouseout"===t.type){for(let t=0;t<s.length;t++)s[t].classList.remove(this.legendInactiveClass);this.canvasRestyle(null)}}highlightRangeInSeries(t,e){const i=this.w,s=i.dom.baseEl.getElementsByClassName("apexcharts-heatmap-rect"),a=t=>{for(let e=0;e<s.length;e++){const i=s[e].classList;"function"==typeof i[t]&&i[t](this.legendInactiveClass)}};if("reset"===e)return void a("remove");const r=i.config.plotOptions.heatmap.colorScale.ranges,n=r&&r[t];if(n){a("add");for(let t=0;t<s.length;t++){const e=Number(s[t].getAttribute("val"));e>=n.from&&e<=n.to&&s[t].classList.remove(this.legendInactiveClass)}}}getActiveConfigSeriesIndex(t="asc",e=[]){const i=this.w;let s=0;if(i.config.series.length>1){const a=i.config.series.map((t,s)=>t.data&&t.data.length>0&&-1===i.globals.collapsedSeriesIndices.indexOf(s)&&(!i.globals.comboCharts||0===e.length||e.length&&e.indexOf(i.config.series[s].type)>-1)?s:-1);for(let e="asc"===t?0:a.length-1;"asc"===t?e<a.length:e>=0;"asc"===t?e++:e--)if(-1!==a[e]){s=a[e];break}}return s}getActiveConfigSeriesIndexByGroup(t=[]){const e=this.w;return(e.labelData.seriesGroups||[]).map(i=>{let s=-1;return e.config.series.forEach((a,r)=>{if(-1===i.indexOf(e.seriesData.seriesNames[r]))return;if(e.globals.comboCharts&&t.length&&-1===t.indexOf(a.type))return;a.data&&a.data.length>0&&-1===e.globals.collapsedSeriesIndices.indexOf(r)&&(s=r)}),s})}getBarSeriesIndices(){return this.w.globals.comboCharts?this.w.config.series.map((t,e)=>"bar"===t.type||"column"===t.type?e:-1).filter(t=>-1!==t):this.w.config.series.map((t,e)=>e)}getPreviousPaths(){var t,e,i,s;const a=this.w;if(function(t){var e,i,s;const a=t.globals;if(a.streamScrolled=!1,!a.axisCharts||!t.seriesData||!Array.isArray(t.seriesData.series)||0===t.seriesData.series.length)return void(a.prevStreamFrame=null);const r=[];(null==(i=null==(e=t.dom)?void 0:e.baseEl)?void 0:i.querySelectorAll)&&t.dom.baseEl.querySelectorAll(".apexcharts-marker").forEach(t=>{var e,i,s,a,n;const o=parseInt(null!=(e=t.getAttribute("index"))?e:"",10),l=parseInt(null!=(s=null!=(i=t.getAttribute("j"))?i:t.getAttribute("rel"))?s:"",10),h=parseFloat(null!=(n=null!=(a=t.getAttribute("r"))?a:t.getAttribute("default-marker-size"))?n:"");isFinite(o)&&isFinite(l)&&isFinite(h)&&((r[o]=r[o]||[])[l]=h)}),a.prevStreamFrame={seriesX:(t.seriesData.seriesX||[]).slice(),seriesY:t.seriesData.series.slice(),xPixels:(a.seriesXvalues||[]).slice(),yPixels:(a.seriesYvalues||[]).slice(),rPixels:r,labels:(a.labels||[]).slice(),isXNumeric:!!(null==(s=t.axisFlags)?void 0:s.isXNumeric)}}(a),function(t){const e=t.globals;if(e.prevChromeFrame=null,!e.axisCharts||!d.isBrowser())return;const i=t.dom.baseEl;if(v.elementExists(i))try{const s=ge(i,be,"y");e.prevChromeFrame={xLabels:ge(i,me,"x"),yLabels:s,vGrid:fe(i,ye,"x1"),hGrid:fe(i,we,"y1"),xScale:ve(t),yAnchors:Ae(t,s)}}catch(t){e.prevChromeFrame=null}}(a),function(t){const e=t.globals;if(e.prevDataLabels=null,!e.axisCharts||!d.isBrowser())return;if(!Te(t))return;const i=t.dom.baseEl;if(v.elementExists(i))try{const t=new Map;i.querySelectorAll(Le).forEach(e=>{const i=e.getAttribute("data:dlKey");if(!i)return;const s=e.querySelector(Pe);s&&t.set(i,{cx:parseFloat(s.getAttribute("cx")||""),cy:parseFloat(s.getAttribute("cy")||""),val:parseFloat(e.getAttribute("data:dlVal")||"")})}),i.querySelectorAll(Ee).forEach(e=>{const i=e.getAttribute("data:dlTotalKey");i&&t.set(`total::${i}`,{cx:parseFloat(e.getAttribute("cx")||""),cy:parseFloat(e.getAttribute("cy")||""),val:parseFloat(e.getAttribute("data:dlTotalVal")||"")})}),e.prevDataLabels=t.size?t:null}catch(t){e.prevDataLabels=null}}(a),!a.globals.axisCharts)return void(a.globals.previousPaths=a.seriesData.series);if(!v.elementExists(a.dom.baseEl))return void(a.globals.previousPaths=[]);function r(t,e,i){const s=t[e].childNodes,r={type:i,paths:[],realIndex:t[e].getAttribute("data:realIndex")};for(let t=0;t<s.length;t++)if(s[t].hasAttribute("pathTo")){const e=s[t].getAttribute("pathTo");r.paths.push({d:e,key:s[t].getAttribute("data:pathKey"),fill:s[t].getAttribute("fill"),flip:s[t].classList.contains("apexcharts-flip-y")||s[t].classList.contains("apexcharts-flip-x")})}a.globals.previousPaths.push(r)}a.globals.previousPaths=[];["line","area","bar","rangebar","rangeArea","candlestick","radar"].forEach(t=>{const e=(i=t,a.dom.baseEl.querySelectorAll(`.apexcharts-${i}-series .apexcharts-series`));var i;for(let i=0;i<e.length;i++)r(e,i,t)});const n=a.dom.baseEl.querySelectorAll(`.apexcharts-${a.config.chart.type} .apexcharts-series`);if(n.length>0)for(let r=0;r<n.length;r++){const n=a.dom.baseEl.querySelectorAll(`.apexcharts-${a.config.chart.type} .apexcharts-series[data\\:realIndex='${r}'] rect`),o=[];for(let a=0;a<n.length;a++){const r=t=>n[a].getAttribute(t),l={x:parseFloat(null!=(t=r("x"))?t:"0"),y:parseFloat(null!=(e=r("y"))?e:"0"),width:parseFloat(null!=(i=r("width"))?i:"0"),height:parseFloat(null!=(s=r("height"))?s:"0")};o.push({rect:l,color:n[a].getAttribute("color")})}a.globals.previousPaths.push(o)}}clearPreviousPaths(){const t=this.w;t.globals.previousPaths=[],t.globals.allSeriesCollapsed=!1}handleNoData(){const t=this.w,e=t.config.noData,i=new Dt(this.w);let s=t.globals.svgWidth/2,a=t.globals.svgHeight/2,r="middle";if(t.globals.noData=!0,t.globals.animationEnded=!0,"left"===e.align?(s=10,r="start"):"right"===e.align&&(s=t.globals.svgWidth-10,r="end"),"top"===e.verticalAlign?a=50:"bottom"===e.verticalAlign&&(a=t.globals.svgHeight-50),s+=e.offsetX,a=a+parseInt(e.style.fontSize,10)+2+e.offsetY,void 0!==e.text&&""!==e.text){const n=i.drawText({x:s,y:a,text:e.text,textAnchor:r,fontSize:e.style.fontSize,fontFamily:e.style.fontFamily,foreColor:e.style.color,opacity:1,cssClass:"apexcharts-text-nodata"});t.dom.Paper.add(n)}}setNullSeriesToZeroValues(t){const e=this.w;for(let i=0;i<t.length;i++)if(0===t[i].length)for(let s=0;s<t[e.globals.maxValsInArrayIndex].length;s++)t[i].push(0);return t}hasAllSeriesEqualX(){let t=!0;const e=this.w,i=this.filteredSeriesX();for(let e=0;e<i.length-1;e++)if(i[e][0]!==i[e+1][0]){t=!1;break}return e.globals.allSeriesHasEqualX=t,t}filteredSeriesX(){return this.w.seriesData.seriesX.map(t=>t.length>0?t:[])}}const Ne={accent:"--apx-accent",fore:"--apx-fore",grid:"--apx-grid",surface:"--apx-surface"};const Ye="__apexcharts_themes__";function Oe(){return globalThis[Ye]}globalThis[Ye]||(globalThis[Ye]={});const We="#373d3f",He="#f6f7f8",$e="#e0e0e0";class Ge{constructor(t){this.w=t,this.colors=[],this.isColorFn=!1,this.isHeatmapDistributed=this.checkHeatmapDistributed(),this.isBarDistributed=this.checkBarDistributed(),this._tokens={},this._namedTheme=null}checkHeatmapDistributed(){const{chart:t,plotOptions:e}=this.w.config;return"treemap"===t.type&&e.treemap&&e.treemap.distributed||"heatmap"===t.type&&e.heatmap&&e.heatmap.distributed}checkBarDistributed(){const{chart:t,plotOptions:e}=this.w.config;return e.bar&&e.bar.distributed&&("bar"===t.type||"rangeBar"===t.type)}init(){this.setDefaultColors()}setDefaultColors(){var t;const e=this.w,i=new v;var s;this._namedTheme=(s=e.config.theme.name)&&Oe()[s]||null,this._applyNamedThemeMode(),e.dom.elWrap.classList.add(`apexcharts-theme-${e.config.theme.mode||"light"}`),this._applyModeDefaults(),this._tokens=this._resolveTokens(),this.applyTokenChrome(this._tokens);const a=null==(t=e.config.theme.accessibility)?void 0:t.colorBlindMode;if(a){e.globals.colors=this.getColorBlindColors(a),this.applySeriesColors(e.seriesData.seriesColors,e.globals.colors);const t=e.globals.colors.slice();return this.pushExtraColors(e.globals.colors),this.applyColorTypes(["fill","stroke"],t),this.applyDataLabelsColors(t),this.applyRadarPolygonsColors(),this.applyMarkersColors(t),void("highContrast"===a&&e.dom.elWrap.classList.add("apexcharts-high-contrast"))}const r=[...e.config.colors||e.config.fill.colors||[]];e.globals.colors=this.getColors(r),this.applySeriesColors(e.seriesData.seriesColors,e.globals.colors),e.config.theme.monochrome.enabled&&(e.globals.colors=this.getMonochromeColors(e.config.theme.monochrome,e.seriesData.series,i));const n=e.globals.colors.slice();this.pushExtraColors(e.globals.colors),this.applyColorTypes(["fill","stroke"],n),this.applyDataLabelsColors(n),this.applyRadarPolygonsColors(),this.applyMarkersColors(n)}_applyModeDefaults(){const t=this.w,e=t.config.theme.mode;"dark"===e?(t.config.chart.foreColor===We&&(t.config.chart.foreColor=He),"palette1"===t.config.theme.palette&&(t.config.theme.palette="palette4"),t.config.tooltip&&"light"!==t.config.tooltip.theme&&(t.config.tooltip.theme="dark")):"light"===e&&(t.config.chart.foreColor===He&&(t.config.chart.foreColor=We),"palette4"===t.config.theme.palette&&(t.config.theme.palette="palette1"))}_applyNamedThemeMode(){const t=this._namedTheme;if(!t)return;const e=this.w.config.theme;t.mode&&!e.mode&&(e.mode=t.mode),!t.accessibility||!t.accessibility.colorBlindMode||e.accessibility&&e.accessibility.colorBlindMode||(e.accessibility=e.accessibility||{},e.accessibility.colorBlindMode=t.accessibility.colorBlindMode),t.monochrome&&t.monochrome.enabled&&!e.monochrome.enabled&&(e.monochrome=o(o({},e.monochrome),t.monochrome))}_resolveTokens(){const t=this._namedTheme&&this._namedTheme.tokens||{},e=this._shouldUseTokens()?function(t){if(!d.isBrowser())return{};const e=t.dom&&(t.dom.elWrap||t.dom.baseEl)||null;if(!e)return{};const i=b.getComputedStyle(e);if(!i||"function"!=typeof i.getPropertyValue)return{};const s=t=>{const e=i.getPropertyValue(t);return e?String(e).trim():""},a={};for(const t in Ne){const e=s(Ne[t]);e&&(a[t]=e)}const r=[];for(let t=1;t<=24;t++){const e=s(`--apx-series-${t}`);if(!e)break;r.push(e)}return r.length&&(a.series=r),a}(this.w):{};return o(o({},t),e)}_shouldUseTokens(){return!1!==this.w.config.theme.tokens}applyTokenChrome(t){if(!t)return;const e=this.w;if(!t.fore||e.config.chart.foreColor!==We&&e.config.chart.foreColor!==He||(e.config.chart.foreColor=t.fore),t.grid){e.config.grid.borderColor===$e&&(e.config.grid.borderColor=t.grid);const i=e=>{e&&(e.axisBorder&&e.axisBorder.color===$e&&(e.axisBorder.color=t.grid),e.axisTicks&&e.axisTicks.color===$e&&(e.axisTicks.color=t.grid))};i(e.config.xaxis),Array.isArray(e.config.yaxis)?e.config.yaxis.forEach(i):i(e.config.yaxis)}const i=e.globals.tokenSurface,s=e.config.chart.background,a=!s||s===i;if(t.surface){if(a){e.config.chart.background=t.surface,e.globals.tokenSurface=t.surface;const i=e.dom.Paper&&e.dom.Paper.node;i&&i.style&&(i.style.background=t.surface)}}else if(i&&s===i){e.config.chart.background="",e.globals.tokenSurface=void 0;const t=e.dom.Paper&&e.dom.Paper.node;t&&t.style&&(t.style.background="")}}getColors(t){const e=this.w;return t&&0!==t.length?Array.isArray(t)&&t.length>0&&"function"==typeof t[0]?(this.isColorFn=!0,e.config.series.map((i,s)=>{const a=t[s]||t[0];return"function"==typeof a?a({value:e.globals.axisCharts?e.seriesData.series[s][0]||0:e.seriesData.series[s],seriesIndex:s,dataPointIndex:s,w:this.w}):a})):t:this.predefined()}applySeriesColors(t,e){t.forEach((t,i)=>{t&&(e[i]=t)})}getMonochromeColors(t,e,i){const{color:s,shadeIntensity:a,shadeTo:r}=t,n=this.isBarDistributed||this.isHeatmapDistributed?e[0].length*e.length:e.length,o=1/(n/a);let l=0;return Array.from({length:n},()=>{const t="dark"===r?i.shadeColor(-1*l,s):i.shadeColor(l,s);return l+=o,t})}applyColorTypes(t,e){const i=this.w;t.forEach(t=>{i.globals[t].colors=void 0===i.config[t].colors?this.isColorFn?i.config.colors:e:i.config[t].colors.slice(),this.pushExtraColors(i.globals[t].colors)})}applyDataLabelsColors(t){const e=this.w;e.globals.dataLabels.style.colors=void 0===e.config.dataLabels.style.colors?t:e.config.dataLabels.style.colors.slice(),this.pushExtraColors(e.globals.dataLabels.style.colors,50)}applyRadarPolygonsColors(){const t=this.w;t.globals.radarPolygons.fill.colors=void 0===t.config.plotOptions.radar.polygons.fill.colors?["dark"===t.config.theme.mode?"#343A3F":"none"]:t.config.plotOptions.radar.polygons.fill.colors.slice(),this.pushExtraColors(t.globals.radarPolygons.fill.colors,20)}applyMarkersColors(t){const e=this.w;e.globals.markers.colors=void 0===e.config.markers.colors?t:e.config.markers.colors.slice(),this.pushExtraColors(e.globals.markers.colors)}pushExtraColors(t,e,i=null){const s=this.w;let a=e||s.seriesData.series.length;if(null===i&&(i=this.isBarDistributed||this.isHeatmapDistributed||"heatmap"===s.config.chart.type&&s.config.plotOptions.heatmap&&s.config.plotOptions.heatmap.colorScale.inverse),i&&s.seriesData.series.length&&(a=s.seriesData.series[s.globals.maxValsInArrayIndex].length*s.seriesData.series.length),t.length<a){const e=a-t.length;for(let i=0;i<e;i++)t.push(t[i])}}getColorBlindColors(t){const e={palette1:["#008FFB","#00A86F","#CA8501","#FF4560","#846DD5"],palette2:["#6978CB","#039DE2","#49A84D","#B39105","#D68000"],palette3:["#209FCC","#648291","#D4526E","#0FA783","#A19285"],palette4:["#2FA59D","#73A20B","#099DE1","#FD5D5D","#648291"],palette5:["#2B908F","#F56566","#2EAB16","#FA4443","#1EA2BD"],palette6:["#449DD1","#F86624","#EA3A4A","#9C63D1","#899E2A"],palette7:["#DF475B","#1B998B","#7E75B7","#F46036","#B1911B"],palette8:["#9C63D1","#F86624","#B38F04","#EA3A4A","#2FA2B3"],palette9:["#98776F","#A19285","#A8705E","#BA6560","#A0927F"],palette10:["#C91EFF","#A94BFD","#6C6AFE","#2983FF","#009ED8"],cvdDeuteranopia:["#0072B2","#E69F00","#56B4E9","#009E73","#F0E442","#D55E00","#CC79A7"],cvdProtanopia:["#0077BB","#EE7733","#009988","#EE3377","#BBBBBB","#33BBEE","#CC3311"],cvdTritanopia:["#CC3311","#009988","#EE7733","#0077BB","#EE3377","#BBBBBB","#33BBEE"],highContrast:["#005A9C","#C00000","#007A33","#6C3483","#7B3F00","#0097A7","#4A235A"]};return({deuteranopia:e.cvdDeuteranopia,protanopia:e.cvdProtanopia,tritanopia:e.cvdTritanopia,highContrast:e.highContrast}[t]||e.palette1).slice()}updateThemeOptions(t){t.chart=t.chart||{},t.tooltip=t.tooltip||{};const e=t.theme.mode,i="dark"===e?"palette4":"light"===e?"palette1":t.theme.palette||"palette1",s="dark"===e?"#f6f7f8":"light"===e?"#373d3f":t.chart.foreColor||"#373d3f";return t.tooltip.theme=e||"light",t.chart.foreColor=s,t.theme.palette=i,t}predefined(){const t={palette1:["#008FFB","#00A86F","#CA8501","#FF4560","#846DD5"],palette2:["#6978CB","#039DE2","#49A84D","#B39105","#D68000"],palette3:["#209FCC","#648291","#D4526E","#0FA783","#A19285"],palette4:["#2FA59D","#73A20B","#099DE1","#FD5D5D","#648291"],palette5:["#2B908F","#F56566","#2EAB16","#FA4443","#1EA2BD"],palette6:["#449DD1","#F86624","#EA3A4A","#9C63D1","#899E2A"],palette7:["#DF475B","#1B998B","#7E75B7","#F46036","#B1911B"],palette8:["#9C63D1","#F86624","#B38F04","#EA3A4A","#2FA2B3"],palette9:["#98776F","#A19285","#A8705E","#BA6560","#A0927F"],palette10:["#C91EFF","#A94BFD","#6C6AFE","#2983FF","#009ED8"],cvdDeuteranopia:["#0072B2","#E69F00","#56B4E9","#009E73","#F0E442","#D55E00","#CC79A7"],cvdProtanopia:["#0077BB","#EE7733","#009988","#EE3377","#BBBBBB","#33BBEE","#CC3311"],cvdTritanopia:["#CC3311","#009988","#EE7733","#0077BB","#EE3377","#BBBBBB","#33BBEE"],highContrast:["#005A9C","#C00000","#007A33","#6C3483","#7B3F00","#0097A7","#4A235A"]},e=t[this.w.config.theme.palette]||t.palette1,i=this._tokens||{};if(Array.isArray(i.series)&&i.series.length)return i.series.slice();if(i.accent)return[i.accent,...e];const s=this._namedTheme;return s&&Array.isArray(s.palette)&&s.palette.length?s.palette.slice():e}}class je{constructor(t){this.w=t}draw(){this.drawTitleSubtitle("title"),this.drawTitleSubtitle("subtitle")}drawTitleSubtitle(t){const e=this.w,i="title"===t?e.config.title:e.config.subtitle;let s=e.globals.svgWidth/2,a=i.offsetY,r="middle";if("left"===i.align?(s=10,r="start"):"right"===i.align&&(s=e.globals.svgWidth-10,r="end"),s+=i.offsetX,a=a+parseInt(i.style.fontSize,10)+i.margin/2,void 0!==i.text){const n=new Dt(this.w).drawText({x:s,y:a,text:i.text,textAnchor:r,fontSize:i.style.fontSize,fontFamily:i.style.fontFamily,fontWeight:i.style.fontWeight,foreColor:i.style.color,opacity:1});n.node.setAttribute("class",`apexcharts-${t}-text`),e.dom.Paper.add(n)}}}let Ve=class{constructor(t){this.w=t.w,this.dCtx=t}getTitleSubtitleCoords(t){const e=this.w;let i=0,s=0;const a="title"===t?e.config.title.floating:e.config.subtitle.floating,r=e.dom.baseEl.querySelector(`.apexcharts-${t}-text`);if(null!==r&&!a){const t=r.getBoundingClientRect();i=t.width,s=e.globals.axisCharts?t.height+5:t.height}return{width:i,height:s}}getLegendsRect(){const t=this.w,e=t.dom.elLegendWrap;t.config.legend.height||"top"!==t.config.legend.position&&"bottom"!==t.config.legend.position||e&&(e.style.maxHeight=t.globals.svgHeight/2+"px");const i=Object.assign({},v.getBoundingClientRect(e));return null!==e&&!t.config.legend.floating&&t.config.legend.show?this.dCtx.lgRect={x:i.x,y:i.y,height:i.height,width:0===i.height?0:i.width}:this.dCtx.lgRect={x:0,y:0,height:0,width:0},"left"!==t.config.legend.position&&"right"!==t.config.legend.position||1.5*this.dCtx.lgRect.width>t.globals.svgWidth&&(this.dCtx.lgRect.width=t.globals.svgWidth/1.5),this.dCtx.lgRect}getDatalabelsRect(){const t=this.w,e=[];t.config.series.forEach((i,s)=>{i.data.forEach((i,a)=>{const r=(n=t.seriesData.series[s][a],t.config.dataLabels.formatter(n,{seriesIndex:s,dataPointIndex:a,w:t}));var n;e.push(r)})});const i=v.getLargestStringFromArr(e),s=new Dt(this.w),a=t.config.dataLabels.style,r=s.getTextRects(i,parseInt(a.fontSize).toString(),a.fontFamily);return{width:1.05*r.width,height:r.height}}getLargestStringFromMultiArr(t,e){let i=t;if(this.w.axisFlags.isMultiLineX){const t=e.map(t=>Array.isArray(t)?t.length:1),s=Math.max(...t);i=e[t.indexOf(s)]}return i}getSparklineStrokeInset(){const t=this.w,e=Array.isArray(t.config.stroke.width)?Math.max(...t.config.stroke.width):t.config.stroke.width,i=e/2;if(!(t.config.stroke.show&&i>0))return{top:0,bottom:0};const s=t.globals.maxY-t.globals.minY,a=this._getSeriesYExtremes();if(!(this._strokeTracesDataPoints()&&s>0&&a))return{top:i,bottom:i};const r=Math.max(t.globals.svgHeight-e,0),n=r*(t.globals.maxY-a.max)/s,o=r*(a.min-t.globals.minY)/s;return{top:Math.min(Math.max(i-n,0),i),bottom:Math.min(Math.max(i-o,0),i)}}_strokeTracesDataPoints(){const t=this.w;if(!t.globals.axisCharts||t.config.chart.stacked)return!1;const e=["line","area","scatter"];return t.config.series.every(i=>e.includes(i.type||t.config.chart.type))}_getSeriesYExtremes(){let t=1/0,e=-1/0;return this.w.seriesData.series.forEach(i=>{Array.isArray(i)&&i.forEach(i=>{Number.isFinite(i)&&(i<t&&(t=i),i>e&&(e=i))})}),t===1/0?null:{min:t,max:e}}};class Ue{constructor(t){this.w=t.w,this.dCtx=t}getxAxisLabelsCoords(){const t=this.w;let e,i=t.labelData.labels.slice();if(t.config.xaxis.convertedCatToNumeric&&0===i.length&&(i=t.labelData.categoryLabels),t.labelData.timescaleLabels.length>0){const i=this.getxAxisTimeScaleLabelsCoords();e={width:i.width,height:i.height},t.layout.rotateXLabels=!1}else{this.dCtx.lgWidthForSideLegends="left"!==t.config.legend.position&&"right"!==t.config.legend.position||t.config.legend.floating?0:this.dCtx.lgRect.width;const s=t.formatters.xLabelFormatter;let a=v.getLargestStringFromArr(i),r=this.dCtx.dimHelpers.getLargestStringFromMultiArr(a,i);t.globals.isBarHorizontal&&(a=t.globals.yAxisScale[0].result.reduce((t,e)=>t.length>e.length?t:e,0),r=a);const n=new S(this.w),o=a;a=n.xLabelFormat(s,a,o,{i:void 0,dateFormatter:new A(this.w).formatDate,w:t}),r=n.xLabelFormat(s,r,o,{i:void 0,dateFormatter:new A(this.w).formatDate,w:t}),(t.config.xaxis.convertedCatToNumeric&&void 0===a||""===String(a).trim())&&(a="1",r=a);const l=new Dt(this.w);let h=l.getTextRects(a,t.config.xaxis.labels.style.fontSize),c=h;if(a!==r&&(c=l.getTextRects(r,t.config.xaxis.labels.style.fontSize)),e={width:h.width>=c.width?h.width:c.width,height:h.height>=c.height?h.height:c.height},e.width*i.length>t.globals.svgWidth-this.dCtx.lgWidthForSideLegends-this.dCtx.yAxisWidth-this.dCtx.gridPad.left-this.dCtx.gridPad.right&&0!==t.config.xaxis.labels.rotate||t.config.xaxis.labels.rotateAlways){if(!t.globals.isBarHorizontal){t.layout.rotateXLabels=!0;const i=e=>l.getTextRects(e,t.config.xaxis.labels.style.fontSize,t.config.xaxis.labels.style.fontFamily,`rotate(${t.config.xaxis.labels.rotate} 0 0)`,!1);h=i(a),a!==r&&(c=i(r)),e.height=(h.height>c.height?h.height:c.height)/1.5,e.width=h.width>c.width?h.width:c.width}}else t.layout.rotateXLabels=!1}return t.config.xaxis.labels.show||(e={width:0,height:0}),{width:e.width,height:e.height}}getxAxisGroupLabelsCoords(){var t;const e=this.w;if(!e.labelData.hasXaxisGroups)return{width:0,height:0};const i=(null==(t=e.config.xaxis.group.style)?void 0:t.fontSize)||e.config.xaxis.labels.style.fontSize,s=e.labelData.groups.map(t=>t.title);let a;const r=v.getLargestStringFromArr(s),n=this.dCtx.dimHelpers.getLargestStringFromMultiArr(r,s),o=new Dt(this.w),l=o.getTextRects(r,i);let h=l;return r!==n&&(h=o.getTextRects(n,i)),a={width:l.width>=h.width?l.width:h.width,height:l.height>=h.height?l.height:h.height},e.config.xaxis.labels.show||(a={width:0,height:0}),{width:a.width,height:a.height}}getxAxisTitleCoords(){const t=this.w;let e=0,i=0;if(void 0!==t.config.xaxis.title.text){const s=new Dt(this.w).getTextRects(t.config.xaxis.title.text,t.config.xaxis.title.style.fontSize);e=s.width,i=s.height}return{width:e,height:i}}getxAxisTimeScaleLabelsCoords(){const t=this.w;this.dCtx.timescaleLabels=t.labelData.timescaleLabels.slice();const e=this.dCtx.timescaleLabels.map(t=>t.value),i=e.reduce((t,e)=>void 0===t?0:t.length>e.length?t:e,0),s=new Dt(this.w).getTextRects(i,t.config.xaxis.labels.style.fontSize);return 1.05*s.width*e.length>t.layout.gridWidth&&0!==t.config.xaxis.labels.rotate&&(t.globals.overlappingXLabels=!0),s}additionalPaddingXLabels(t){const e=this.w,i=e.globals,s=e.config,a=s.xaxis.type,r=t.width;i.skipLastTimelinelabel=!1,i.skipFirstTimelinelabel=!1;const n=e.config.yaxis[0].opposite&&e.globals.isBarHorizontal,o=t=>{if(this.dCtx.timescaleLabels&&this.dCtx.timescaleLabels.length){const a=this.dCtx.timescaleLabels[0],n=this.dCtx.timescaleLabels[this.dCtx.timescaleLabels.length-1].position+r/1.75-this.dCtx.yAxisWidthRight,o=a.position-r/1.75+this.dCtx.yAxisWidthLeft,l="right"===e.config.legend.position&&this.dCtx.lgRect.width>0?this.dCtx.lgRect.width:0;n>i.svgWidth-e.layout.translateX-l&&(i.skipLastTimelinelabel=!0),o<-(t.show&&!t.floating||"bar"!==s.chart.type&&"candlestick"!==s.chart.type&&"rangeBar"!==s.chart.type&&"boxPlot"!==s.chart.type&&"violin"!==s.chart.type?10:r/1.75)&&(i.skipFirstTimelinelabel=!0)}else"datetime"===a?this.dCtx.gridPad.right<r&&!e.layout.rotateXLabels&&(i.skipLastTimelinelabel=!0):"datetime"!==a&&this.dCtx.gridPad.right<r/2-this.dCtx.yAxisWidthRight&&!e.layout.rotateXLabels&&!e.config.xaxis.labels.trim&&(this.dCtx.xPadRight=r/2+1)},l=(t,e)=>{s.yaxis.length>1&&(t=>-1!==i.collapsedSeriesIndices.indexOf(t))(e)||o(t)};s.yaxis.forEach((t,e)=>{n?(this.dCtx.gridPad.left<r&&(this.dCtx.xPadLeft=r/2+1),this.dCtx.xPadRight=r/2+1):l(t,e)})}}class qe{constructor(t){this.w=t.w,this.dCtx=t}getyAxisLabelsCoords(){const t=this.w,e=[];let i=10;const s=new Bt(this.w,{theme:this.dCtx.theme,timeScale:this.dCtx.timeScale});return t.config.yaxis.map((a,r)=>{const n={seriesIndex:r,dataPointIndex:-1,w:t},o=t.globals.yAxisScale[r];let l=0;if(!s.isYAxisHidden(r)&&a.labels.show&&void 0!==a.labels.minWidth&&(l=a.labels.minWidth),!s.isYAxisHidden(r)&&a.labels.show&&o.result.length){const s=t.formatters.yLabelFormatters[r],h=o.niceMin===Number.MIN_VALUE?0:o.niceMin;let c=o.result.reduce((t,e)=>{var i,a;return(null==(i=String(s(t,n)))?void 0:i.length)>(null==(a=String(s(e,n)))?void 0:a.length)?t:e},h);c=s(c,n);let d=c;if(void 0!==c&&0!==c.length||(c=o.niceMax),1===String(c).length&&(c+=".0",d=c),t.globals.isBarHorizontal){i=0;const e=t.labelData.labels.slice();c=v.getLargestStringFromArr(e),c=s(c,{seriesIndex:r,dataPointIndex:-1,w:t}),d=this.dCtx.dimHelpers.getLargestStringFromMultiArr(c,e)}const p=new Dt(this.w),u="rotate(".concat(a.labels.rotate," 0 0)"),g=p.getTextRects(c,a.labels.style.fontSize,a.labels.style.fontFamily,u,!1);let f=g;c!==d&&(f=p.getTextRects(d,a.labels.style.fontSize,a.labels.style.fontFamily,u,!1)),e.push({width:(l>f.width||l>g.width?l:f.width>g.width?f.width:g.width)+i,height:f.height>g.height?f.height:g.height})}else e.push({width:0,height:0})}),e}getyAxisTitleCoords(){const t=this.w,e=[];return t.config.yaxis.map(t=>{if(t.show&&void 0!==t.title.text){const i=new Dt(this.w),s="rotate(".concat(t.title.rotate," 0 0)"),a=i.getTextRects(t.title.text,t.title.style.fontSize,t.title.style.fontFamily,s,!1);e.push({width:a.width,height:a.height})}else e.push({width:0,height:0})}),e}getTotalYAxisWidth(){const t=this.w;let e=0,i=0,s=0;const a=t.globals.yAxisScale.length>1?10:0,r=new Bt(this.w,{theme:this.dCtx.theme,timeScale:this.dCtx.timeScale}),n=(n,o)=>{const l=t.config.yaxis[o].floating;let h=0;n.width>0&&!l?(h=n.width+a,function(e){return t.globals.ignoreYAxisIndexes.indexOf(e)>-1}(o)&&(h=h-n.width-a)):h=l||r.isYAxisHidden(o)?0:5,t.config.yaxis[o].opposite?s+=h:i+=h,e+=h};return t.layout.yLabelsCoords.map((t,e)=>{n(t,e)}),t.layout.yTitleCoords.map((t,e)=>{n(t,e)}),t.globals.isBarHorizontal&&!t.config.yaxis[0].floating&&(e=t.layout.yLabelsCoords[0].width+t.layout.yTitleCoords[0].width+15),this.dCtx.yAxisWidthLeft=i,this.dCtx.yAxisWidthRight=s,e}}class Ze{constructor(t){this.w=t.w,this.dCtx=t}gridPadForColumnsInNumericAxis(t){const{w:e}=this,{config:i,globals:s}=e;if(s.noData||s.collapsedSeries.length+s.ancillaryCollapsedSeries.length===i.series.length)return 0;const a=t=>["bar","rangeBar","candlestick","boxPlot","violin"].includes(t),r=i.chart.type;let n=0,o=a(r)?i.series.length:1;s.comboBarCount>0&&(o=s.comboBarCount),s.collapsedSeries.forEach(t=>{a(t.type)&&(o-=1)}),i.chart.stacked&&(o=1);const l=a(r)||s.comboBarCount>0;let h=Math.abs(s.initialMaxX-s.initialMinX);if(l&&e.axisFlags.isXNumeric&&!s.isBarHorizontal&&o>0&&0!==h){h<=3&&(h=s.dataPoints);const e=h/t;let a=s.minXDiff&&s.minXDiff/e>0?s.minXDiff/e:0;a>t/2&&(a/=2),n=a*parseInt(i.plotOptions.bar.columnWidth,10)/100,n<1&&(n=1),s.barPadForNumericAxis=n}return n}gridPadForStackedTotalDataLabels(){const{w:t}=this,e=t.config.plotOptions.bar.dataLabels.total;if(!t.globals.isBarHorizontal||!t.config.chart.stacked||"100%"!==t.config.chart.stackType||!e.enabled)return;const i=t.seriesData.stackedSeriesTotals||[];if(!i.length)return;const s=e.formatter||t.config.dataLabels.formatter,a=i.map((e,i)=>String(s?s(e,l(o({},t),{seriesIndex:0,dataPointIndex:i,w:t})):e)),r=new Dt(t).getTextRects(v.getLargestStringFromArr(a),parseFloat(e.style.fontSize).toString(),e.style.fontFamily).width+Math.abs(e.offsetX||0)+2;this.dCtx.xPadRight=Math.max(this.dCtx.xPadRight,r)}gridPadFortitleSubtitle(){const{w:t}=this,{globals:e}=t;let i=this.dCtx.isSparkline||!e.axisCharts?0:10;["title","subtitle"].forEach(s=>{void 0!==t.config[s].text?i+=t.config[s].margin:i+=this.dCtx.isSparkline||!e.axisCharts?0:5}),!t.config.legend.show||"bottom"!==t.config.legend.position||t.config.legend.floating||e.axisCharts||(i+=10);const s=this.dCtx.dimHelpers.getTitleSubtitleCoords("title"),a=this.dCtx.dimHelpers.getTitleSubtitleCoords("subtitle");this.dCtx.titleBlockPad=i,t.layout.gridHeight-=s.height+a.height+i,t.layout.translateY+=s.height+a.height+i}setGridXPosForDualYAxis(t,e){const{w:i}=this,s=new Bt(this.w,{theme:this.dCtx.theme,timeScale:this.dCtx.timeScale});i.config.yaxis.forEach((a,r)=>{-1!==i.globals.ignoreYAxisIndexes.indexOf(r)||a.floating||s.isYAxisHidden(r)||(a.opposite&&(i.layout.translateX-=e[r].width+t[r].width+parseInt(a.labels.style.fontSize,10)/1.2+12),i.layout.translateX<2&&(i.layout.translateX=2))})}}const Ke="http://www.w3.org/1999/xhtml";function Je(t,e){const i=t.config.drilldown&&t.config.drilldown.breadcrumb||{};return o(o({show:!0,position:"top-left",separator:" / ",rootLabel:"All",offsetX:0,offsetY:0,formatter:void 0},i),e||{})}function Qe(t,e){const i=[".apexcharts-title-text",".apexcharts-subtitle-text"].map(e=>t.dom.baseEl.querySelector(e)).filter(t=>null!==t);if(!i.length)return;const s=t.dom.elWrap.getBoundingClientRect().top;for(let t=0;t<i.length+1;t++){const t=e.getBoundingClientRect(),a=i.find(e=>{const i=e.getBoundingClientRect();return t.left<i.right&&t.right>i.left&&t.top<i.bottom&&t.bottom>i.top});if(!a)break;e.style.top=a.getBoundingClientRect().bottom-s+4+"px"}}function ti(t,e,i,s){var a;const r=null==(a=null==e?void 0:e.dimensions)?void 0:a.dimHelpers,n=r?r.getTitleSubtitleCoords("title").height+r.getTitleSubtitleCoords("subtitle").height:0,o=i.getBoundingClientRect().height||18,l=s&&s.offsetY||0,h=function(t,e){const i=t.layout.translateY||0,s=t.dom.elWrap;if(!s)return i;const a=t.dom.baseEl.querySelectorAll(".apexcharts-yaxis-label");if(!a.length)return i;const r=s.getBoundingClientRect().top,n=e.getBoundingClientRect();let o=i;for(let t=0;t<a.length;t++){const e=a[t].getBoundingClientRect();e.height&&(e.left>=n.right||e.right<=n.left||(o=Math.min(o,e.top-r)))}return o}(t,i);if(h-n>=o+1)return i.style.top=`${h-o-1+l}px`,!0;i.style.top=`${n+l}px`;const c="dark"===t.config.theme.mode;return i.style.background=c?"rgba(20,24,30,0.82)":"rgba(255,255,255,0.86)",i.style.borderRadius="4px",!1}function ei(t){const e=t.dom.elWrap;if(!e)return;const i=e.querySelector(".apexcharts-breadcrumb");i&&i.parentNode&&i.parentNode.removeChild(i)}class ii{constructor(t,e){this.w=t,this.ctx=e,this.theme=e.theme,this.timeScale=e.timeScale,this.lgRect={},this.yAxisWidth=0,this.yAxisWidthLeft=0,this.yAxisWidthRight=0,this.xAxisHeight=0,this.isSparkline=this.w.config.chart.sparkline.enabled,this.dimHelpers=new Ve(this),this.dimYAxis=new qe(this),this.dimXAxis=new Ue(this),this.dimGrid=new Ze(this),this.lgWidthForSideLegends=0,this.gridPad=o({},this.w.config.grid.padding),this.xPadRight=0,this.titleBlockPad=0,this.xPadLeft=0,this.datalabelsCoords={width:0,height:0},this.xAxisWidth=0,this.timescaleLabels=[]}plotCoords(){const t=this.w,e=t.globals;if(this.gridPad=o({},t.config.grid.padding),this.lgRect=this.dimHelpers.getLegendsRect(),this.datalabelsCoords={width:0,height:0},this.isSparkline){this.w.globals.markers.largestSize>0&&Object.entries(this.gridPad).forEach(([t,e])=>{this.gridPad[t]=Math.max(e,this.w.globals.markers.largestSize/1.5)});const t=this.dimHelpers.getSparklineStrokeInset();this.gridPad.top=Math.max(t.top,this.gridPad.top),this.gridPad.bottom=Math.max(t.bottom,this.gridPad.bottom)}e.axisCharts?this.setDimensionsForAxisCharts():this.setDimensionsForNonAxisCharts(),this.dimGrid.gridPadFortitleSubtitle(),this.gridPadForBreadcrumb(),this.dimGrid.gridPadForStackedTotalDataLabels(),t.layout.gridHeight=t.layout.gridHeight-this.gridPad.top-this.gridPad.bottom,t.layout.gridWidth=t.layout.gridWidth-this.gridPad.left-this.gridPad.right-this.xPadRight-this.xPadLeft;const i=this.dimGrid.gridPadForColumnsInNumericAxis(t.layout.gridWidth);return t.layout.gridWidth=t.layout.gridWidth-2*i,t.layout.translateX=t.layout.translateX+this.gridPad.left+this.xPadLeft+(i>0?i:0),t.layout.translateY=t.layout.translateY+this.gridPad.top,{layout:{gridHeight:t.layout.gridHeight,gridWidth:t.layout.gridWidth,translateX:t.layout.translateX,translateY:t.layout.translateY,translateXAxisX:t.layout.translateXAxisX,translateXAxisY:t.layout.translateXAxisY,rotateXLabels:t.layout.rotateXLabels,xAxisHeight:t.layout.xAxisHeight,xAxisLabelsHeight:t.layout.xAxisLabelsHeight,xAxisGroupLabelsHeight:t.layout.xAxisGroupLabelsHeight,xAxisLabelsWidth:t.layout.xAxisLabelsWidth,yLabelsCoords:t.layout.yLabelsCoords,yTitleCoords:t.layout.yTitleCoords,gridPad:o({},this.gridPad)}}}gridPadForBreadcrumb(){var t,e,i,s,a,r;const n=this.w,o="treemap"===n.config.chart.type;if(o){const i=null==(e=null==(t=n.config.plotOptions)?void 0:t.treemap)?void 0:e.zoom;if(i&&i.enabled){if(!1===Je(n,i.breadcrumb).show)return;return void(this.gridPad.top+=22)}}if(!n.globals.axisCharts)return;if(!this.ctx.drilldown)return;if(!n.config.drilldown||!n.config.drilldown.enabled)return;if(!1===Je(n).show)return;const l=parseFloat(String(null==(r=null==(a=null==(s=null==(i=n.config.yaxis)?void 0:i[0])?void 0:s.labels)?void 0:a.style)?void 0:r.fontSize))||11,h=24+(o?0:Math.ceil(l*B/2)),c=o?0:this.titleBlockPad||0;this.gridPad.top+=Math.max(0,h-c)}setDimensionsForAxisCharts(){const t=this.w,e=t.globals,i=this.dimYAxis.getyAxisLabelsCoords(),s=this.dimYAxis.getyAxisTitleCoords();e.isSlopeChart&&(this.datalabelsCoords=this.dimHelpers.getDatalabelsRect()),t.layout.yLabelsCoords=[],t.layout.yTitleCoords=[],t.config.yaxis.map((e,a)=>{t.layout.yLabelsCoords.push({width:i[a].width,index:a}),t.layout.yTitleCoords.push({width:s[a].width,index:a})}),this.yAxisWidth=this.dimYAxis.getTotalYAxisWidth();const a=this.dimXAxis.getxAxisLabelsCoords(),r=this.dimXAxis.getxAxisGroupLabelsCoords(),n=this.dimXAxis.getxAxisTitleCoords();this.conditionalChecksForAxisCoords(a,n,r),t.layout.translateXAxisY=t.layout.rotateXLabels?this.xAxisHeight/8:-4,t.layout.translateXAxisX=t.layout.rotateXLabels&&t.axisFlags.isXNumeric&&t.config.xaxis.labels.rotate<=-45?-this.xAxisWidth/4:0,t.globals.isBarHorizontal&&(t.layout.rotateXLabels=!1,t.layout.translateXAxisY=(parseInt(t.config.xaxis.labels.style.fontSize,10)||12)/1.5*-1),t.layout.translateXAxisY=t.layout.translateXAxisY+t.config.xaxis.labels.offsetY,t.layout.translateXAxisX=t.layout.translateXAxisX+t.config.xaxis.labels.offsetX;let o=this.yAxisWidth,l=this.xAxisHeight;t.layout.xAxisLabelsHeight=this.xAxisHeight-n.height,t.layout.xAxisGroupLabelsHeight=t.layout.xAxisLabelsHeight-a.height,t.layout.xAxisLabelsWidth=this.xAxisWidth,t.layout.xAxisHeight=this.xAxisHeight;let h=10;("radar"===t.config.chart.type||this.isSparkline)&&(o=0,l=0),this.isSparkline&&(this.lgRect={height:0,width:0}),(this.isSparkline||"treemap"===t.config.chart.type)&&(o=0,l=0,h=0),this.isSparkline||"treemap"===t.config.chart.type||this.dimXAxis.additionalPaddingXLabels(a);const c=()=>{t.layout.translateX=o+this.datalabelsCoords.width,t.layout.gridHeight=e.svgHeight-this.lgRect.height-l-(this.isSparkline||"treemap"===t.config.chart.type?0:t.layout.rotateXLabels?10:15),t.layout.gridWidth=e.svgWidth-o-2*this.datalabelsCoords.width};switch("top"===t.config.xaxis.position&&(h=t.layout.xAxisHeight-t.config.xaxis.axisTicks.height-5),t.config.legend.position){case"bottom":t.layout.translateY=h,c();break;case"top":t.layout.translateY=this.lgRect.height+h,c();break;case"left":t.layout.translateY=h,t.layout.translateX=this.lgRect.width+o+this.datalabelsCoords.width,t.layout.gridHeight=e.svgHeight-l-12,t.layout.gridWidth=e.svgWidth-this.lgRect.width-o-2*this.datalabelsCoords.width;break;case"right":t.layout.translateY=h,t.layout.translateX=o+this.datalabelsCoords.width,t.layout.gridHeight=e.svgHeight-l-12,t.layout.gridWidth=e.svgWidth-this.lgRect.width-o-2*this.datalabelsCoords.width-5;break;default:throw new Error("Legend position not supported")}this.dimGrid.setGridXPosForDualYAxis(s,i);new $t(this.w,{theme:this.theme,timeScale:this.timeScale}).setYAxisXPosition(i,s)}setDimensionsForNonAxisCharts(){const t=this.w,e=t.globals,i=t.config;let s=0;if(t.config.legend.show&&!t.config.legend.floating&&(s=20),"unit"===i.chart.type){const a=i.legend.show&&!i.legend.floating,r=i.legend.position;let n=0,o=0;return a&&("bottom"===r||"top"===r?n=this.lgRect.height:o=this.lgRect.width+s),t.layout.gridWidth=e.svgWidth-o,t.layout.gridHeight=e.svgHeight-n,t.layout.translateX="left"===r?o:0,void(t.layout.translateY="top"===r?n:0)}const a="sunburst"===i.chart.type?"sunburst":"pie"===i.chart.type||"polarArea"===i.chart.type||"donut"===i.chart.type?"pie":"radialBar",r=i.plotOptions[a].offsetY,n=i.plotOptions[a].offsetX;if(!i.legend.show||i.legend.floating){t.layout.gridHeight=e.svgHeight;const i=t.dom.elWrap.getBoundingClientRect().width;return t.layout.gridWidth=Math.min(i,t.layout.gridHeight),t.layout.translateY=r,void(t.layout.translateX=n+(e.svgWidth-t.layout.gridWidth)/2)}switch(i.legend.position){case"bottom":t.layout.gridHeight=e.svgHeight-this.lgRect.height,t.layout.gridWidth=e.svgWidth,t.layout.translateY=r-10,t.layout.translateX=n+(e.svgWidth-t.layout.gridWidth)/2;break;case"top":t.layout.gridHeight=e.svgHeight-this.lgRect.height,t.layout.gridWidth=e.svgWidth,t.layout.translateY=this.lgRect.height+r+10,t.layout.translateX=n+(e.svgWidth-t.layout.gridWidth)/2;break;case"left":t.layout.gridWidth=e.svgWidth-this.lgRect.width-s,t.layout.gridHeight="auto"!==i.chart.height?e.svgHeight:t.layout.gridWidth,t.layout.translateY=r,t.layout.translateX=n+this.lgRect.width+s;break;case"right":t.layout.gridWidth=e.svgWidth-this.lgRect.width-s-5,t.layout.gridHeight="auto"!==i.chart.height?e.svgHeight:t.layout.gridWidth,t.layout.translateY=r,t.layout.translateX=n+10;break;default:throw new Error("Legend position not supported")}}conditionalChecksForAxisCoords(t,e,i){const s=this.w,a=s.labelData.hasXaxisGroups?2:1,r=i.height+t.height+e.height,n=s.axisFlags.isMultiLineX?1.2:B,o=s.layout.rotateXLabels?22:10,l=s.layout.rotateXLabels&&"bottom"===s.config.legend.position?10:0;this.xAxisHeight=r*n+a*o+l,this.xAxisWidth=t.width,this.xAxisHeight-e.height>s.config.xaxis.labels.maxHeight&&(this.xAxisHeight=s.config.xaxis.labels.maxHeight),s.config.xaxis.labels.minHeight&&this.xAxisHeight<s.config.xaxis.labels.minHeight&&(this.xAxisHeight=s.config.xaxis.labels.minHeight),s.config.xaxis.floating&&(this.xAxisHeight=0);let h=0,c=0;s.config.yaxis.forEach(t=>{h+=t.labels.minWidth,c+=t.labels.maxWidth}),this.yAxisWidth<h&&(this.yAxisWidth=h),this.yAxisWidth>c&&(this.yAxisWidth=c)}}const si=1e3,ai=6e4,ri=36e5,ni=24*ri,oi=7*ni,li=30*ni,hi=365*ni,ci=10/86400,di=[{unit:"second",step:1,approxMs:si},{unit:"second",step:5,approxMs:5e3},{unit:"second",step:15,approxMs:15e3},{unit:"second",step:30,approxMs:3e4},{unit:"minute",step:1,approxMs:ai},{unit:"minute",step:5,approxMs:3e5},{unit:"minute",step:15,approxMs:9e5},{unit:"minute",step:30,approxMs:18e5},{unit:"hour",step:1,approxMs:ri},{unit:"hour",step:3,approxMs:3*ri},{unit:"hour",step:6,approxMs:6*ri},{unit:"hour",step:12,approxMs:12*ri},{unit:"day",step:1,approxMs:ni},{unit:"day",step:2,approxMs:2*ni},{unit:"week",step:1,approxMs:oi},{unit:"week",step:2,approxMs:2*oi},{unit:"month",step:1,approxMs:li},{unit:"month",step:3,approxMs:7776e6},{unit:"month",step:6,approxMs:15552e6},{unit:"year",step:1,approxMs:hi},{unit:"year",step:2,approxMs:63072e6},{unit:"year",step:5,approxMs:15768e7},{unit:"year",step:10,approxMs:31536e7},{unit:"year",step:25,approxMs:7884e8},{unit:"year",step:50,approxMs:15768e8},{unit:"year",step:100,approxMs:31536e8}];class pi{constructor(t,e){this.w=t,this.ctx=e,this.tickInterval=null,this.timeScaleArray=[],this.utc=t.config.xaxis.labels.datetimeUTC}calculateTimeScaleTicks(t,e){const i=this.w;if(i.globals.allSeriesCollapsed)return i.labelData.labels=[],i.labelData.timescaleLabels=[],this.timeScaleArray=[],[];const s=e-t,a=s/ni;i.interact.disableZoomIn=!1,i.interact.disableZoomOut=!1,a<ci?i.interact.disableZoomIn=!0:a>5e4&&(i.interact.disableZoomOut=!0);const r=Number.isFinite(i.config.xaxis.tickAmount)?i.config.xaxis.tickAmount:10;this.tickInterval=function(t,e){(!Number.isFinite(e)||e<=0)&&(e=10);if(t<=0)return di[0];const i=t/e;let s=di[0],a=1/0;for(const t of di){const e=Math.abs(Math.log(t.approxMs/i));e<a&&(a=e,s=t)}return s}(s,r);const n=this.generateBaseTicks(t,e,this.tickInterval);return this.timeScaleArray=n,n}generateBaseTicks(t,e,i){const s=this.w,a=new A(s),r=this.utc,n=s.layout.gridWidth,o=e-t,l=[];let h=a.ceilToBoundary(t,i.unit,i.step,r),c=0;for(;h<=e&&c<5e3;){const e=a.getDateFields(h,r),s=o>0?(h-t)/o*n:0;l.push({timestamp:h,position:s,unit:i.unit,year:e.year,month:e.month+1,day:e.date,hour:e.hour,minute:e.minute,second:e.second,value:h}),h=a.addInterval(h,i.unit,i.step,r),c++}return l}recalcDimensionsBasedOnFormat(t){const e=this.w,i=this.formatDates(t),s=this.removeOverlappingTS(i);e.labelData.timescaleLabels=s.slice();const a=new ii(this.w,this.ctx).plotCoords();this.ctx._writeLayoutCoords(a.layout)}formatDates(t){const e=this.w,i=new A(e),s=e.config.xaxis.labels.format,a=e.config.xaxis.labels.datetimeFormatter,r=this.utc,n=(t,e=2)=>String(t).padStart(e,"0"),o=s||this._effectiveFormat(t,a);return t.map(t=>{const e=i.getDate(t.timestamp),s=i.formatDate(e,o);return{dateString:`${t.year}-${n(t.month)}-${n(t.day)}T${n(t.hour)}:${n(t.minute)}:${n(t.second)}.000${r?"Z":""}`,position:t.position,value:s,unit:t.unit,year:t.year,month:t.month}})}_effectiveFormat(t,e){if(0===t.length)return e.day||"dd MMM";const i=this.tickInterval&&this.tickInterval.unit||t[0].unit,s=e["week"===i?"day":i]||e.day||"dd MMM",a=t[0],r=t[t.length-1],n=a.year!==r.year,o=n||a.month!==r.month||a.day!==r.day,l=/y/i.test(s),h=/M/.test(s),c=/d/i.test(s);if("month"===i||"week"===i)return n&&!l?s+" yyyy":s;if("day"===i)return n&&!l?s+" yyyy":s;if("hour"===i||"minute"===i||"second"===i){if(o&&!c&&!h){return(n?"dd MMM yyyy":"dd MMM")+" "+s}return s}return s}removeOverlappingTS(t){if(0===t.length)return[];const e=this.w,i=new Dt(e);let s,a=!1;t[0].value&&t.every(e=>e.value.length===t[0].value.length)&&(a=!0,s=i.getTextRects(t[0].value,e.config.xaxis.labels.style.fontSize).width);let r=0;return t.map((n,o)=>{if(0===o)return n;if(!e.config.xaxis.labels.hideOverlappingLabels)return n;const l=a?s:i.getTextRects(t[r].value,e.config.xaxis.labels.style.fontSize).width,h=t[r].position;return n.position>h+l+10?(r=o,n):null}).filter(t=>null!==t)}}const ui="__apexcharts_registry__",gi="__apexcharts_custom_types__";function fi(){return globalThis[ui]}function xi(){return globalThis[gi]}function mi(t){return xi().has(t)}function bi(t){Object.assign(fi(),t)}function yi(t){const e=fi()[t];if(!e)throw new Error(`ApexCharts: chart type "${t}" is not registered. Bundler: import 'apexcharts/${t}'. Script tag: add <script src=".../dist/${t}.js"> after apexcharts.core.js, or load the full apexcharts.js instead.`);return e}globalThis[ui]||(globalThis[ui]={}),globalThis[gi]||(globalThis[gi]=new Set);class wi{constructor(t,e,i){this.w=e,this.ctx=i,this.el=t}setupElements(){const{globals:t,config:e}=this.w,i=e.chart.type,s=["line","area","bar","rangeBar","rangeArea","candlestick","boxPlot","violin","scatter","bubble"],a=[...s,"radar","heatmap","treemap"],r=!a.includes(i)&&!["pie","donut","polarArea","radialBar"].includes(i)&&mi(i);t.axisCharts=a.includes(i)||r,t.xyCharts=s.includes(i)||r,t.isBarHorizontal=["bar","rangeBar","boxPlot","violin"].includes(i)&&e.plotOptions.bar.horizontal,t.chartClass=`.apexcharts${t.chartID}`,this.w.dom.baseEl=this.el,this.w.dom.elWrap=b.createElementNS("http://www.w3.org/1999/xhtml","div"),Dt.setAttrs(this.w.dom.elWrap,{id:t.chartClass.substring(1),class:`apexcharts-canvas ${t.chartClass.substring(1)}`}),this.el.appendChild(this.w.dom.elWrap);const n=globalThis.SVG;if(this.w.dom.Paper=n().addTo(this.w.dom.elWrap),this.w.dom.Paper.attr({class:"apexcharts-svg","xmlns:data":"ApexChartsNS",transform:`translate(${e.chart.offsetX}, ${e.chart.offsetY})`}),this.w.dom.Paper.node.style.background="dark"!==e.theme.mode||e.chart.background?"light"!==e.theme.mode||e.chart.background?e.chart.background:"#fff":"#343A3F",this.setSVGDimensions(),this.w.dom.elLegendForeign=b.createElementNS($,"foreignObject"),Dt.setAttrs(this.w.dom.elLegendForeign,{x:0,y:0,width:t.svgWidth,height:t.svgHeight}),this.w.dom.elLegendWrap=b.createElementNS("http://www.w3.org/1999/xhtml","div"),this.w.dom.elLegendWrap.classList.add("apexcharts-legend"),this.w.dom.elWrap.appendChild(this.w.dom.elLegendWrap),this.w.dom.Paper.node.appendChild(this.w.dom.elLegendForeign),e.chart.accessibility.enabled&&e.chart.accessibility.announcements.enabled){const t=b.createElement("div");t.className="apexcharts-sr-status",t.setAttribute("role","status"),t.setAttribute("aria-live","polite"),t.setAttribute("aria-atomic","true"),this.w.dom.elWrap.appendChild(t)}if(e.chart.accessibility.enabled){const t=this.getAccessibleChartLabel(),i=e.chart.accessibility.keyboard.enabled&&e.chart.accessibility.keyboard.navigation.enabled?"application":"img";if(this.w.dom.Paper.attr({role:i,"aria-label":t}),e.chart.accessibility.description){const t=b.createElementNS($,"desc");t.textContent=e.chart.accessibility.description,this.w.dom.Paper.node.insertBefore(t,this.w.dom.elLegendForeign.nextSibling)}}this.w.dom.elGraphical=this.w.dom.Paper.group().attr({class:"apexcharts-inner apexcharts-graphical"}),this.w.dom.elDefs=this.w.dom.Paper.defs(),this.w.dom.Paper.add(this.w.dom.elGraphical),this.w.dom.elGraphical.add(this.w.dom.elDefs)}_classifySeriesByType(t){const{w:e}=this,{config:i,globals:s}=e,a={line:{series:[],i:[]},area:{series:[],i:[]},scatter:{series:[],i:[]},bubble:{series:[],i:[]},bar:{series:[],i:[]},candlestick:{series:[],i:[]},boxPlot:{series:[],i:[]},violin:{series:[],i:[]},rangeBar:{series:[],i:[]},rangeArea:{series:[],seriesRangeEnd:[],i:[]}},r={},n=i.chart.type||"line";let o=null,l=0;return this.w.seriesData.series.forEach((i,s)=>{var h,c;const d="column"===(null==(h=t[s])?void 0:h.type)?"bar":(null==(c=t[s])?void 0:c.type)||("column"===n?"bar":n),p=a;p[d]?("rangeArea"===d?(p[d].series.push(this.w.rangeData.seriesRangeStart[s]),p[d].seriesRangeEnd.push(this.w.rangeData.seriesRangeEnd[s])):p[d].series.push(i),p[d].i.push(s),"bar"===d&&(e.globals.columnSeries=a.bar)):["heatmap","treemap","pie","donut","polarArea","radialBar","radar","unit","sunburst"].includes(d)?o=d:mi(d)&&(r[d]||(r[d]={series:[],i:[]}),r[d].series.push(i),r[d].i.push(s)),n!==d&&"scatter"!==d&&l++}),l>0&&a.bar.series.length>0&&i.plotOptions.bar.horizontal&&(l-=a.bar.series.length,a.bar={series:[],i:[]},e.globals.columnSeries={series:[],i:[]}),s.comboCharts||(s.comboCharts=l>0),{seriesTypes:a,customBuckets:r}}plotChartType(t,e){const{w:i,ctx:s}=this,a=s.renderer&&"canvas"===s.renderer.kind;a&&s.renderer.beginSeries();const{seriesTypes:r,customBuckets:n}=this._classifySeriesByType(t),o=this._instantiateSeriesRenderers(r,e),l=this._assembleSeriesGraphics(r,n,o,e);if(a){const t=s.renderer;if(t&&t._repaintHostInPlace){t._repaintHostInPlace=!1;const e=this.w.dom.elGraphical.node.querySelector(".apexcharts-canvas-series-wrap");if(e&&t.canRepaintInPlace&&t.canRepaintInPlace()){t.repaintInPlace();return(Array.isArray(l)?l:[l]).forEach(t=>{t&&t.node&&e.appendChild(t.node)}),[]}}const e=s.renderer.present();if(e){const t=new Dt(i).group({class:"apexcharts-canvas-series-wrap"});t.add(e);return(Array.isArray(l)?l:[l]).forEach(e=>{e&&t.add(e)}),t}}return l}_instantiateSeriesRenderers(t,e){const{w:i,ctx:s}=this,{config:a,globals:r}=i,n=t.line.series.length>0||t.area.series.length>0||t.scatter.series.length>0||t.bubble.series.length>0||t.rangeArea.series.length>0||!r.comboCharts&&["line","area","scatter","bubble","rangeArea"].includes(a.chart.type)?new(yi("line"))(s.w,s,e):null,o=t.candlestick.series.length>0||t.boxPlot.series.length>0||!r.comboCharts&&["candlestick","boxPlot"].includes(a.chart.type)?new(yi("candlestick"))(s.w,s,e):null,l=t.violin.series.length>0||!r.comboCharts&&"violin"===a.chart.type?new(yi("violin"))(s.w,s,e):null,h=!r.comboCharts&&["pie","donut","polarArea"].includes(a.chart.type);s.pie=h?new(yi("pie"))(s.w,s):null;const c=t.rangeBar.series.length>0||!r.comboCharts&&"rangeBar"===a.chart.type;return s.rangeBar=c?new(yi("rangeBar"))(s.w,s,e):null,{line:n,boxCandlestick:o,violin:l}}_assembleSeriesGraphics(t,e,i,s){const{w:a,ctx:r}=this,{config:n,globals:o}=a,{line:l,boxCandlestick:h,violin:c}=i;let d=[];if(o.comboCharts){const i=new H(this.w);if(t.area.series.length>0&&d.push(...i.drawSeriesByGroup(t.area,o.areaGroups,"area",l)),t.bar.series.length>0)if(n.chart.stacked){const e=new(yi("barStacked"))(r.w,r,s);d.push(e.draw(t.bar.series,t.bar.i))}else r.bar=new(yi("bar"))(r.w,r,s),d.push(r.bar.draw(t.bar.series,t.bar.i));if(t.rangeArea.series.length>0&&d.push(l.draw(t.rangeArea.series,"rangeArea",t.rangeArea.i,t.rangeArea.seriesRangeEnd)),t.line.series.length>0&&d.push(...i.drawSeriesByGroup(t.line,o.lineGroups,"line",l)),t.candlestick.series.length>0&&d.push(h.draw(t.candlestick.series,"candlestick",t.candlestick.i)),t.boxPlot.series.length>0&&d.push(h.draw(t.boxPlot.series,"boxPlot",t.boxPlot.i)),t.violin.series.length>0&&d.push(c.draw(t.violin.series,"violin",t.violin.i)),t.rangeBar.series.length>0&&d.push(r.rangeBar.draw(t.rangeBar.series,t.rangeBar.i)),t.scatter.series.length>0){const e=new(yi("line"))(r.w,r,s,!0);d.push(e.draw(t.scatter.series,"scatter",t.scatter.i))}if(t.bubble.series.length>0){const e=new(yi("line"))(r.w,r,s,!0);d.push(e.draw(t.bubble.series,"bubble",t.bubble.i))}Object.keys(e).forEach(t=>{const i=e[t];if(i.series.length>0){const e=new(yi(t))(r.w,r,s);d.push(e.draw(i.series,t,i.i))}})}else{const t=n.chart.type;switch(t){case"line":d=l.draw(this.w.seriesData.series,"line");break;case"area":d=l.draw(this.w.seriesData.series,"area");break;case"bar":if(n.chart.stacked){const t=new(yi("barStacked"))(r.w,r,s);d=t.draw(this.w.seriesData.series)}else r.bar=new(yi("bar"))(r.w,r,s),d=r.bar.draw(this.w.seriesData.series);break;case"candlestick":d=h.draw(this.w.seriesData.series,"candlestick");break;case"boxPlot":d=h.draw(this.w.seriesData.series,t);break;case"violin":d=c.draw(this.w.seriesData.series,"violin");break;case"rangeBar":d=r.rangeBar.draw(this.w.seriesData.series);break;case"rangeArea":d=l.draw(this.w.rangeData.seriesRangeStart,"rangeArea",void 0,this.w.rangeData.seriesRangeEnd);break;case"heatmap":{const t=new(yi("heatmap"))(r.w,r,s);d=t.draw(this.w.seriesData.series);break}case"treemap":{const t=new(yi("treemap"))(r.w,r);d=t.draw(this.w.seriesData.series);break}case"unit":{const t=new(yi("unit"))(r.w,r);d=t.draw(this.w.seriesData.series);break}case"sunburst":{const t=new(yi("sunburst"))(r.w,r);d=t.draw(this.w.seriesData.series);break}case"pie":case"donut":case"polarArea":d=r.pie.draw(this.w.seriesData.series);break;case"radialBar":{const t=new(yi("radialBar"))(r.w,r);d=t.draw(this.w.seriesData.series);break}case"radar":{const t=new(yi("radar"))(r.w,r);d=t.draw(this.w.seriesData.series);break}default:if(mi(t)){const e=new(yi(t))(r.w,r,s);d=e.draw(this.w.seriesData.series,t)}else d=l.draw(this.w.seriesData.series)}}return d}_extractDimensionUnit(t){return String(t).split(/[0-9]+/g).pop()}setSVGDimensions(){var t;const{globals:e,config:i}=this.w;i.chart.width=i.chart.width||"100%",i.chart.height=i.chart.height||"auto";const s=i.chart.width,a=i.chart.height;e.svgWidth=NaN,e.svgHeight=NaN;let r=v.getDimensions(this.el);const n=this._extractDimensionUnit(s);"%"===n?v.isNumber(r[0])&&(0===r[0].width&&(r=v.getDimensions(this.el.parentNode)),e.svgWidth=r[0]*parseInt(s,10)/100):"px"!==n&&""!==n||(e.svgWidth=parseInt(s,10));const o=this._extractDimensionUnit(a);if("auto"!==a&&""!==a)if("%"===o){const t=v.getDimensions(this.el.parentNode);e.svgHeight=t[1]*parseInt(a,10)/100}else e.svgHeight=parseInt(a,10);else e.svgHeight=e.axisCharts?e.svgWidth/1.61:e.svgWidth/1.2;if(e.svgWidth=Math.max(e.svgWidth,0),e.svgHeight=Math.max(e.svgHeight,0),Dt.setAttrs(this.w.dom.Paper.node,{width:e.svgWidth,height:e.svgHeight}),"%"!==o&&d.isBrowser()){const s=e.axisCharts&&(i.grid.show||i.dataLabels.enabled||i.xaxis.labels.show||i.xaxis.axisBorder.show||i.xaxis.axisTicks.show||i.yaxis.some(t=>t.show&&(t.labels.show||t.axisBorder.show||t.axisTicks.show))),a=i.chart.sparkline.enabled||!s?0:i.chart.parentHeightOffset,r=this.w.dom.Paper.node;(null==(t=r.parentNode)?void 0:t.parentNode)&&(r.parentNode.parentNode.style.minHeight=`${e.svgHeight+a}px`)}this.w.dom.elWrap.style.width=`${e.svgWidth}px`,this.w.dom.elWrap.style.height=`${e.svgHeight}px`,e.lastResizeSignature=this.getResizeSignature()}getResizeSignature(){const{config:t}=this.w,e=(t.chart.width||"100%").toString().trim(),i=(t.chart.height||"auto").toString().trim();let s=0,a=0;if(e.endsWith("%")){let t=v.getDimensions(this.el);t[0]||(t=v.getDimensions(this.el.parentNode)),s=t[0]||0}i.endsWith("%")&&(a=v.getDimensions(this.el.parentNode)[1]||0);const r={w:Math.round(s),h:Math.round(a)};return t.responsive&&t.responsive.length&&d.isBrowser()&&(r.iw=window.innerWidth),r}shiftGraphPosition(){const{globals:t}=this.w,{translateY:e,translateX:i}=t;Dt.setAttrs(this.w.dom.elGraphical.node,{transform:`translate(${i}, ${e})`})}resizeNonAxisCharts(){var t,e,i,s,a,r,n,o,l;const{w:h}=this,c=h.config.chart.height?String(h.config.chart.height):"",p=""!==c&&"auto"!==c,u=c.includes("%");let g=0,f=h.config.chart.sparkline.enabled?1:15;f+=h.layout.gridPad.bottom,["top","bottom"].includes(h.config.legend.position)&&h.config.legend.show&&!h.config.legend.floating&&(g=(null!=(e=null==(t=this.ctx.legend)?void 0:t.legendHelpers.getLegendDimensions().clwh)?e:0)+7);const x=h.dom.baseEl.querySelector(".apexcharts-radialbar, .apexcharts-pie, .apexcharts-sunburst"),m=h.globals.pieExternalLabelMarginY||0;let b=m>0?2*h.globals.radialSize+2*m:2.05*h.globals.radialSize;const y="sunburst"===h.config.chart.type?"sunburst":"pie"===h.config.chart.type||"donut"===h.config.chart.type||"polarArea"===h.config.chart.type?"pie":"radialBar",w=Math.abs(h.config.plotOptions[y].endAngle-h.config.plotOptions[y].startAngle);if(x&&!h.config.chart.sparkline.enabled&&w<360){const t=v.getBoundingClientRect(this.w.dom.Paper.node);let e=1/0,l=-1/0;const c=i=>{var s,a,r,n;if(null==(s=i.classList)?void 0:s.contains("apexcharts-radialbar-hollow"))return;const o=null==(r=null==(a=i.tagName)?void 0:a.toLowerCase)?void 0:r.call(a);if("text"===o||"tspan"===o)return;const h=Array.from(null!=(n=i.children)?n:[]);if(h.length>0)return void h.forEach(t=>c(t));const d=v.getBoundingClientRect(i);if(d.bottom-d.top>0){const i=d.top-t.top,s=d.bottom-t.top;i<e&&(e=i),s>l&&(l=s)}};if(Array.from(null!=(i=x.children)?i:[]).forEach(t=>c(t)),Number.isFinite(e)||(e=0),!Number.isFinite(l)){const e=v.getBoundingClientRect(x);l=e.bottom-t.top}const p=Math.max(f,.2*h.globals.radialSize),m=Math.max(p-e,0);0!==m&&(h.layout.translateY=(null!=(s=h.layout.translateY)?s:0)+m,Dt.setAttrs(this.w.dom.elGraphical.node,{transform:`translate(${null!=(a=h.layout.translateX)?a:0}, ${h.layout.translateY})`}),l+=m),b=l>0?l:2.05*h.globals.radialSize;const y=Math.max(p,e),w=Math.ceil(b+g+y),A=null!=(r=h.config.chart.offsetY)?r:0,S=w+Math.max(A,0);if(!u){if(this.w.dom.elLegendForeign&&this.w.dom.elLegendForeign.setAttribute("height",String(S)),this.w.dom.elWrap.style.height=`${S}px`,Dt.setAttrs(this.w.dom.Paper.node,{height:w}),d.isBrowser()){const t=null==(n=this.w.dom.Paper.node.parentNode)?void 0:n.parentNode;t&&(t.style.minHeight=`${S}px`)}h.globals.svgHeight=w,"bottom"===h.config.legend.position&&h.config.legend.show&&!h.config.legend.floating&&(null==(o=this.ctx.legend)||o.setLegendWrapXY(20,0))}return}const A=Math.ceil(b+this.w.layout.translateY+g+f);if(!p&&(this.w.dom.elLegendForeign&&this.w.dom.elLegendForeign.setAttribute("height",String(A)),this.w.dom.elWrap.style.height=`${A}px`,Dt.setAttrs(this.w.dom.Paper.node,{height:A}),d.isBrowser())){const t=null==(l=this.w.dom.Paper.node.parentNode)?void 0:l.parentNode;t&&(t.style.minHeight=`${A}px`)}}coreCalculations(){new Wt(this.w).init()}resetGlobals(){const t=()=>this.w.config.series.map(()=>[]),e=new O,{globals:i}=this.w,s={dataWasParsed:this.w.axisFlags.dataWasParsed,originalSeries:i.originalSeries};e.initGlobalVars(i),i.seriesXvalues=t(),i.seriesYvalues=t(),s.dataWasParsed&&(this.w.axisFlags.dataWasParsed=s.dataWasParsed,i.originalSeries=s.originalSeries)}isMultipleY(){return!!(Array.isArray(this.w.config.yaxis)&&this.w.config.yaxis.length>1)&&(this.w.globals.isMultipleYAxis=!0,!0)}xySettings(){const{w:t}=this;let e=null;if(t.globals.axisCharts){if("back"===t.config.xaxis.crosshairs.position&&new Ut(this.w).drawXCrosshairs(),"back"===t.config.yaxis[0].crosshairs.position&&new Ut(this.w).drawYCrosshairs(),"datetime"===t.config.xaxis.type&&void 0===t.config.xaxis.labels.formatter){this.ctx.timeScale=new pi(this.w,this.ctx);let e=[];isFinite(t.globals.minX)&&isFinite(t.globals.maxX)&&!t.globals.isBarHorizontal?e=this.ctx.timeScale.calculateTimeScaleTicks(t.globals.minX,t.globals.maxX):t.globals.isBarHorizontal&&(e=this.ctx.timeScale.calculateTimeScaleTicks(t.globals.minY,t.globals.maxY)),this.ctx.timeScale.recalcDimensionsBasedOnFormat(e)}e=new H(this.w).getCalculatedRatios()}return e}updateSourceChart(t){this.ctx.w.interact.selection=void 0,this.ctx.updateHelpers._updateOptions({chart:{selection:{xaxis:{min:t.w.globals.minX,max:t.w.globals.maxX}}}},!1,!1)}setupBrushHandler(){const{ctx:t,w:e}=this;if(e.config.chart.brush.enabled&&"function"!=typeof e.config.chart.events.selection){const i=Array.isArray(e.config.chart.brush.targets)?e.config.chart.brush.targets:[e.config.chart.brush.target];i.forEach(e=>{const i=t.constructor.getChartByID(e);i&&(i.w.globals.brushSource=this.ctx,"function"!=typeof i.w.config.chart.events.zoomed&&(i.w.config.chart.events.zoomed=()=>this.updateSourceChart(i)),"function"!=typeof i.w.config.chart.events.scrolled&&(i.w.config.chart.events.scrolled=()=>this.updateSourceChart(i)))}),e.config.chart.events.selection=(e,s)=>{i.forEach(e=>{const i=t.constructor.getChartByID(e);i&&i.ctx.updateHelpers._updateOptions({xaxis:{min:s.xaxis.min,max:s.xaxis.max}},!1,!1,!1,!1)})}}}getAccessibleChartLabel(){const t=this.w,e=t.config;if(e.chart.accessibility&&e.chart.accessibility.description)return e.chart.accessibility.description;const i=e.chart.type,s=[];if(e.title.text)s.push(`${e.title.text}. ${i} chart`),e.subtitle.text&&s.push(e.subtitle.text);else{const a=Array.isArray(t.seriesData.seriesNames)&&t.seriesData.seriesNames.length?t.seriesData.seriesNames.filter(Boolean):Array.isArray(e.series)?e.series.map(t=>"object"==typeof t&&null!==t?t.name:null).filter(Boolean):[],r=t.seriesData.series.length||(e.series?e.series.length:0);a.length?s.push(`${i} chart with ${r} data series: ${a.join(", ")}`):s.push(`${i} chart with ${r} data series`)}return s.join(". ")}}const vi="__apexcharts_series_transforms__";function Ai(){return globalThis[vi]}function Si(t,e){t&&"string"==typeof t&&"function"==typeof e&&(Ai()[t]=e)}function Ci(t,e,i,s,a,r=null,n={}){var o,l,h;const c=e&&"object"==typeof e,d=c&&null!=(l=null!=(o=e.x)?o:e.name)?l:"",p=Number(c?null!=(h=e.y)?h:e.value:e),u={name:String(d),value:isNaN(p)?null:p,color:c&&e.color?e.color:void 0,_key:`${a}/${i}:${d}`};if(s&&!u.color&&(u.color=s[i%s.length]),n.keepDatum&&(u._datum=e),c&&Array.isArray(e.children)&&e.children.length)u.children=e.children.map((e,i)=>Ci(t,e,i,null,u._key,r,n));else if(c&&null!=e.drilldown&&!1!==n.expandDrilldown){const i=r||new Set;if(!i.has(e.drilldown)){const s=function(t,e){const i=t.config.drilldown;return(i&&Array.isArray(i.series)?i.series:[]).find(t=>t&&t.id===e)}(t,e.drilldown);if(s&&Array.isArray(s.data)&&s.data.length){const a=new Set(i);a.add(e.drilldown);const r=Array.isArray(s.colors)?s.colors:null;u.children=s.data.map((e,i)=>Ci(t,e,i,r,u._key,a,n))}}}return u}function ki(t,e,i={}){const s=e||t.config.series;return Array.isArray(s)?s.map((e,s)=>{var a,r;const n=e&&Array.isArray(e.data)?e.data:[],o=`${s}:${null!=(a=null==e?void 0:e.name)?a:""}`;return{name:String(null!=(r=null==e?void 0:e.name)?r:""),value:null,color:(null==e?void 0:e.color)||void 0,_key:o,_seriesIndex:s,children:n.map((e,s)=>Ci(t,e,s,null,o,null,i))}}):[]}function _i(t){t.children&&t.children.length&&(t.children.forEach(t=>_i(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 Mi(t){if("string"!=typeof t)return"";const e=t.indexOf("/");return-1===e?"":t.slice(e)}function Di(t){var e,i,s,a;return!!(null==(a=null==(s=null==(i=null==(e=null==t?void 0:t.config)?void 0:e.plotOptions)?void 0:i.treemap)?void 0:s.nested)?void 0:a.drilldownAsLevels)}function Li(t,e){var i,s,a;const r=null==(a=null==(s=null==(i=null==t?void 0:t.config)?void 0:i.plotOptions)?void 0:s.treemap)?void 0:a.nested;return(!r||!1!==r.enabled)&&function(t,e={}){if(!Array.isArray(t))return!1;const i=!1!==e.drilldown;for(let e=0;e<t.length;e++){const s=t[e]&&t[e].data;if(Array.isArray(s))for(let t=0;t<s.length;t++){const e=s[t];if(e&&"object"==typeof e){if(Array.isArray(e.children)&&e.children.length)return!0;if(i&&null!=e.drilldown)return!0}}}return!1}(e,{drilldown:Di(t)})}function Pi(t){const e=[];let i=0;return t.forEach((t,s)=>{const a=[],r=(t,e,n)=>{t._parent=n,t._depth=e,t._si=s,t._leaf=!(t.children&&t.children.length),e>i&&(i=e),t._leaf?(t._di=a.length,a.push(t)):(t._di=-1,t.children.forEach(i=>r(i,e+1,t)))};r(t,0,null),e.push(a)}),{leaves:e,maxDepth:i}}function Ei(t){const e=t._datum;if(e&&"object"==typeof e){const i=l(o({},e),{x:t.name,y:t.value});return delete i.children,i}return{x:t.name,y:t.value}}globalThis[vi]||(globalThis[vi]={});const Ti=["histogram"];class Fi{constructor(t,{resetGlobals:e=()=>{},isMultipleY:i=()=>{}}={}){this.w=t,this.resetGlobals=e,this.isMultipleY=i,this.twoDSeries=[],this.threeDSeries=[],this.twoDSeriesX=[],this.seriesGoals=[],this._warnedMissingTransform=!1,this.coreUtils=new H(this.w),this.activeSeriesIndex=0}getFirstDataPoint(){const t=this.w.config.series,e=new Be(this.w);this.activeSeriesIndex=e.getActiveConfigSeriesIndex();const i=t[this.activeSeriesIndex];return i&&i.data&&i.data.length>0&&null!==i.data[0]&&void 0!==i.data[0]?i.data[0]:null}isMultiFormat(){return this.isFormatXY()||this.isFormat2DArray()}isFormatXY(){var t;const e=this.getFirstDataPoint();if(!e||void 0===e.x)return!1;const i=null==(t=this.w.config.series[this.activeSeriesIndex])?void 0:t.data;if(i){const t=t=>t&&void 0!==t.x;for(let e=1;e<Math.min(3,i.length)&&!0===t(i[e]);e++);}return!0}isFormat2DArray(){const t=this.getFirstDataPoint();return t&&Array.isArray(t)}_fast2DArrayParse(t,e){var i,s;const a=t.length;if(0===a)return!1;const r=new Array(a),n=new Array(a);let o=-Number.MAX_VALUE,l=Number.MAX_VALUE,h=1/0,c=!1,d=0,p=!0,u=1/0,g=-1/0,f=!0,x=1/0,m=NaN;for(let e=0;e<a;e++){const i=t[e];if(!Array.isArray(i)||i.length>2)return!1;const s=i[0],a=i[1];if(p)if("number"==typeof s){s==s&&(s<u&&(u=s),s>g&&(g=s));const t=s-m;t>0?t<x&&(x=t):t<0&&(f=!1),m=s}else p=!1;if("number"==typeof a)if(a==a&&a!==1/0&&a!==-1/0){if(a>o&&(o=a),a<l&&(l=a),a<0&&a<h&&(h=a),!Number.isInteger(a)){const t=a<0?-a:a;if(t>=1e-6&&t<1e21){const t=""+a,e=t.indexOf("."),i=-1===e?0:t.length-e-1;i>d&&(d=i)}else{const t=v.noExponents(a);v.isFloat(t)&&(d=Math.max(d,t.toString().split(".")[1].length))}}}else c=!0;else{if(null!==a)return!1;c=!0}r[e]=a,n[e]=s}this.twoDSeries=r,this.twoDSeriesX=n,this.w.axisFlags.dataFormatXNumeric=!0;return(null!=(s=(i=this.w.seriesData)._parsedExtrema)?s:i._parsedExtrema=[])[e]={ref:r,len:a,maxY:o,lowestY:l,negMinY:h,hasNulls:c,yDec:d,xref:n,xNumeric:p,minX:u,maxX:g,xSorted:f,minXDiff:x},!0}handleFormat2DArray(t,e){const i=this.w.config,s=t[e].data,a="boxPlot"===i.chart.type||"boxPlot"===i.series[e].type;if(a||"datetime"===i.xaxis.type||!this._fast2DArrayParse(s,e))for(let t=0;t<s.length;t++){const e=s[t],r=e[0],n=e[1],o=e[2];if(void 0!==n&&(Array.isArray(n)&&4===n.length&&!a?this.twoDSeries.push(v.parseNumber(n[3])):e.length>=5?this.twoDSeries.push(v.parseNumber(e[4])):this.twoDSeries.push(v.parseNumber(n)),this.w.axisFlags.dataFormatXNumeric=!0),"datetime"===i.xaxis.type){const t=new Date(r).getTime();this.twoDSeriesX.push(t)}else this.twoDSeriesX.push(r);void 0!==o&&(this.threeDSeries.push(o),this.w.axisFlags.isDataXYZ=!0)}}handleFormatXY(t,e){const i=this.w.config,s=this.w.globals,a=new A(this.w),r=t[e].data;let n=e;s.collapsedSeriesIndices.indexOf(e)>-1&&(n=this.activeSeriesIndex);const o=t[n].data;for(let t=0;t<r.length;t++){const i=r[t];if(void 0!==i.y){const t=Array.isArray(i.y)?v.parseNumber(i.y[i.y.length-1]):v.parseNumber(i.y);this.twoDSeries.push(t)}void 0===this.seriesGoals[e]&&(this.seriesGoals[e]=[]),void 0!==i.goals&&Array.isArray(i.goals)?this.seriesGoals[e].push(i.goals):this.seriesGoals[e].push(null),void 0!==i.z&&(this.threeDSeries.push(i.z),this.w.axisFlags.isDataXYZ=!0)}for(let t=0;t<o.length;t++){const e=o[t].x,r="string"==typeof e,n=Array.isArray(e),l=!n&&!!a.isValidDate(e);if(r||l)if(r||i.xaxis.convertedCatToNumeric){const t=s.isBarHorizontal&&this.w.axisFlags.isRangeData;"datetime"!==i.xaxis.type||t?(this.fallbackToCategory=!0,this.twoDSeriesX.push(e),isNaN(e)||"category"===this.w.config.xaxis.type||"string"==typeof e||(this.w.axisFlags.isXNumeric=!0)):this.twoDSeriesX.push(a.parseDate(e))}else"datetime"===i.xaxis.type?this.twoDSeriesX.push(e instanceof Date?e.getTime():a.parseDate(e.toString())):(this.w.axisFlags.dataFormatXNumeric=!0,this.w.axisFlags.isXNumeric=!0,this.twoDSeriesX.push(parseFloat(e)));else n?(this.fallbackToCategory=!0,this.twoDSeriesX.push(e)):(this.w.axisFlags.isXNumeric=!0,this.w.axisFlags.dataFormatXNumeric=!0,this.twoDSeriesX.push(e))}}handleRangeData(t,e){let i={start:[],end:[],rangeUniques:[]};return this.isFormat2DArray()?i=this.handleRangeDataFormat("array",t,e):this.isFormatXY()&&(i=this.handleRangeDataFormat("xy",t,e)),this.w.rangeData.seriesRangeStart[e]=void 0===i.start?[]:i.start,this.w.rangeData.seriesRangeEnd[e]=void 0===i.end?[]:i.end,this.w.rangeData.seriesRange[e]=i.rangeUniques,this.w.rangeData.seriesRange.forEach(t=>{t&&t.forEach(t=>{const e=t.y,i=e.length;if(!(i<=1))for(let s=0;s<i;s++){const a=e[s],r=a.y1,n=a.y2;for(let o=s+1;o<i;o++){const i=e[o],s=i.y1;if(r<=i.y2&&s<=n){const e=t;e.overlaps.add(a.rangeName),e.overlaps.add(i.rangeName)}}}})}),i}handleCustomRangeData(t,e,i){const s=t[e].data||[],a=[],r=[];for(let t=0;t<s.length;t++){const e=s[t];let n,o;if("function"==typeof i){let s=i(e,t);Array.isArray(s)||(s=[s]);const a=s.map(t=>v.parseNumber(t)).filter(t=>null!==t&&!isNaN(t));n=a.length?Math.min(...a):null,o=a.length?Math.max(...a):null}else{const t=null==e?null:e.y;Array.isArray(t)?(n=v.parseNumber(t[0]),o=v.parseNumber(t[t.length-1])):n=o=v.parseNumber(t)}a.push(n),r.push(o)}this.w.rangeData.seriesRangeStart[e]=a,this.w.rangeData.seriesRangeEnd[e]=r}handleCandleStickBoxData(t,e){let i={o:[],h:[],m:[],l:[],c:[]};return this.isFormat2DArray()?i=this.handleCandleStickBoxDataFormat("array",t,e):this.isFormatXY()&&(i=this.handleCandleStickBoxDataFormat("xy",t,e)),this.w.candleData.seriesCandleO[e]=i.o,this.w.candleData.seriesCandleH[e]=i.h,this.w.candleData.seriesCandleM[e]=i.m,this.w.candleData.seriesCandleL[e]=i.l,this.w.candleData.seriesCandleC[e]=i.c,this.w.candleData.seriesBoxPoints[e]=i.points||[],i}handleViolinData(t,e){var i,s,a,r,n,o;const l=this.w,h=t[e].data,c=[],d=[],p=[],u=[],g=[];for(let t=0;t<h.length;t++){const e=h[t],l=null!=(a=null!=(s=null==(i=null==e?void 0:e.y)?void 0:i.density)?s:null==e?void 0:e[1])?a:[],f=null!=(o=null!=(n=null==(r=null==e?void 0:e.y)?void 0:r.points)?n:null==e?void 0:e[2])?o:[],x=[],m=[];let b=0,y=null,w=1/0,A=-1/0;for(let t=0;t<l.length;t++){const e=v.parseNumber(l[t][0]),i=v.parseNumber(l[t][1]);null!==e&&null!==i&&(x.push(e),m.push(i),i>b&&(b=i,y=e),e<w&&(w=e),e>A&&(A=e))}const S=[];for(let t=0;t<f.length;t++){const e=v.parseNumber(f[t]);null!==e&&(S.push(e),e<w&&(w=e),e>A&&(A=e))}c.push({values:x,weights:m,maxWeight:b}),d.push(S),p.push(w===1/0?0:w),u.push(A===-1/0?0:A),g.push(null!==y?y:S.length?S[Math.floor(S.length/2)]:0)}l.violinData.seriesViolinDensity[e]=c,l.violinData.seriesViolinPoints[e]=d,l.violinData.seriesViolinMin[e]=p,l.violinData.seriesViolinMax[e]=u,this.twoDSeries=g}handleRangeDataFormat(t,e,i){const s=[],a=[],r=new Map,n=[];if(e[i].data.forEach(t=>{if(!r.has(t.x)){const e={x:t.x,overlaps:new Set,y:[]};r.set(t.x,e),n.push(e)}}),"array"===t)for(let t=0;t<e[i].data.length;t++)Array.isArray(e[i].data[t])?(s.push(e[i].data[t][1][0]),a.push(e[i].data[t][1][1])):(s.push(e[i].data[t]),a.push(e[i].data[t]));else if("xy"===t)for(let t=0;t<e[i].data.length;t++){const n=Array.isArray(e[i].data[t].y),o=v.randomId(),l=e[i].data[t].x,h={y1:n?e[i].data[t].y[0]:e[i].data[t].y,y2:n?e[i].data[t].y[1]:e[i].data[t].y,rangeName:o},c=this.w.globals;c.seriesRangeName||(c.seriesRangeName={}),c.seriesRangeName[i]||(c.seriesRangeName[i]={}),c.seriesRangeName[i][t]=o;const d=r.get(l);d&&d.y.push(h),s.push(h.y1),a.push(h.y2)}return{start:s,end:a,rangeUniques:n}}handleCandleStickBoxDataFormat(t,e,i){const s=this.w,a="boxPlot"===s.config.chart.type||"boxPlot"===s.config.series[i].type,r=[],n=[],o=[],l=[],h=[],c=[],d=e[i].data;let p;if("array"===t){const t=d[0];p=a&&t&&6===t.length||!a&&t&&5===t.length?t=>t.slice(1):t=>Array.isArray(t[1])?t[1]:[]}else p=t=>Array.isArray(t.y)?t.y:[];for(let t=0;t<d.length;t++){const e=p(d[t]);e&&e.length>=2&&(r.push(e[0]),n.push(e[1]),a?(o.push(e[2]),l.push(e[3]),h.push(e[4])):(l.push(e[2]),h.push(e[3])));const i=d[t]&&d[t].points;c.push(Array.isArray(i)?i:[])}return{o:r,h:n,m:o,l:l,c:h,points:c}}parseDataAxisCharts(t){var e,i,s,a,r,n;const h=this.w.config,c=this.w.globals,d=new A(this.w);this.w.seriesData._parsedExtrema=[];const p=h.labels.length>0?h.labels.slice():h.xaxis.categories.slice();this.w.axisFlags.isRangeBar="rangeBar"===h.chart.type&&c.isBarHorizontal,this.w.labelData.hasXaxisGroups="category"===h.xaxis.type&&h.xaxis.group.groups.length>0,this.w.labelData.hasXaxisGroups&&(this.w.labelData.groups=h.xaxis.group.groups),t.forEach((t,e)=>{void 0!==t.name?this.w.seriesData.seriesNames.push(t.name):this.w.seriesData.seriesNames.push("series-"+parseInt(String(e+1),10))}),this.coreUtils.setSeriesYAxisMappings();const u=[],g=[...new Set(h.series.map(t=>t.group))];h.series.forEach((t,e)=>{const i=g.indexOf(t.group);u[i]||(u[i]=[]),u[i].push(this.w.seriesData.seriesNames[e])}),this.w.labelData.seriesGroups=u;const f=()=>{for(let t=0;t<p.length;t++)if("string"==typeof p[t]){if(!d.isValidDate(p[t]))throw new Error("You have provided invalid Date format. Please provide a valid JavaScript Date");this.twoDSeriesX.push(d.parseDate(p[t]))}else this.twoDSeriesX.push(p[t])};for(let d=0;d<t.length;d++){this.twoDSeries=[],this.twoDSeriesX=[],this.threeDSeries=[],void 0===t[d].data&&(t[d]=l(o({},t[d]),{data:[]}));const u=h.chart.dataReducer,g=null==(i=null==(e=c.dataReducerRawSeries)?void 0:e[d])?void 0:i.data;if((null==u?void 0:u.enabled)&&this.isMultiFormat()&&Array.isArray(g)&&g.length>(null!=(s=u.threshold)?s:500)){const e=null!=(a=u.targetPoints)?a:250,i=h.xaxis.min,s=h.xaxis.max,c=null==i&&null==s?g:Fi.sliceByXRange(g,i,s);let p=c;if(c.length>e){const t=Array.isArray(c[0])?null==(n=c[0])?void 0:n[1]:null==(r=c[0])?void 0:r.y;Array.isArray(t)?4===t.length?p=Fi.ohlcAggregate(c,e):2===t.length&&(p=Fi.rangeAggregate(c,e)):p=Fi.lttbDownsample(c,e)}t[d]=l(o({},t[d]),{data:p})}"rangeBar"!==h.chart.type&&"rangeArea"!==h.chart.type&&"rangeBar"!==t[d].type&&"rangeArea"!==t[d].type||(this.w.axisFlags.isRangeData=!0,this.handleRangeData(t,d));const x=t[d].type||h.chart.type;if(mi(x)){const e=yi(x),i=e&&e.yExtent;(e&&"rangeXY"===e.dataType||"function"==typeof i)&&(this.w.axisFlags.isRangeData=!0,this.handleCustomRangeData(t,d,i))}if(this.isMultiFormat())this.isFormat2DArray()?this.handleFormat2DArray(t,d):this.isFormatXY()&&this.handleFormatXY(t,d),"candlestick"!==h.chart.type&&"candlestick"!==t[d].type&&"boxPlot"!==h.chart.type&&"boxPlot"!==t[d].type||this.handleCandleStickBoxData(t,d),"violin"!==h.chart.type&&"violin"!==t[d].type||this.handleViolinData(t,d),this.w.seriesData.series.push(this.twoDSeries),this.w.labelData.labels.push(this.twoDSeriesX),this.w.seriesData.seriesX.push(this.twoDSeriesX),this.w.seriesData.seriesGoals=this.seriesGoals,d!==this.activeSeriesIndex||this.fallbackToCategory||(this.w.axisFlags.isXNumeric=!0);else{"datetime"===h.xaxis.type?(this.w.axisFlags.isXNumeric=!0,f(),this.w.seriesData.seriesX.push(this.twoDSeriesX)):"numeric"===h.xaxis.type&&(this.w.axisFlags.isXNumeric=!0,p.length>0&&(this.twoDSeriesX=p,this.w.seriesData.seriesX.push(this.twoDSeriesX))),this.w.labelData.labels.push(this.twoDSeriesX);const e=t[d].data.map(t=>v.parseNumber(t));this.w.seriesData.series.push(e)}this.w.seriesData.seriesZ.push(this.threeDSeries),void 0!==t[d].color?this.w.seriesData.seriesColors.push(t[d].color):this.w.seriesData.seriesColors.push(void 0)}return this.w}parseDataNonAxisCharts(t){const e=this.w.config;this.w.seriesData.unitData=[];const i=Array.isArray(t)&&t.every(t=>"number"==typeof t)&&e.labels.length>0,s=Array.isArray(t)&&t.some(t=>t&&"object"==typeof t&&t.data||t&&"object"==typeof t&&t.parsing);if("unit"===e.chart.type&&s&&!i)return this.parseUnitSeries(t);if(i){this.w.seriesData.series=t.slice(),this.w.seriesData.seriesNames=e.labels.slice();for(let t=0;t<this.w.seriesData.series.length;t++)void 0===this.w.seriesData.seriesNames[t]&&this.w.seriesData.seriesNames.push("series-"+(t+1));return this.w}if(Array.isArray(t)&&t.every(t=>"number"==typeof t)){this.w.seriesData.series=t.slice(),this.w.seriesData.seriesNames=[];for(let t=0;t<this.w.seriesData.series.length;t++)this.w.seriesData.seriesNames.push(e.labels[t]||`series-${t+1}`);return this.w}const a=this.extractPieDataFromSeries(t);this.w.seriesData.series=a.values,this.w.seriesData.seriesNames=a.labels,"radialBar"===e.chart.type&&(this.w.seriesData.series=this.w.seriesData.series.map(t=>{const e=v.parseNumber(t);return e}));for(let t=0;t<this.w.seriesData.series.length;t++)void 0===this.w.seriesData.seriesNames[t]&&this.w.seriesData.seriesNames.push("series-"+(t+1));return this.w}parseUnitSeries(t){const e=this.w.config,i=[],s=[],a=[];return t.forEach((t,r)=>{var n;const o=t&&Array.isArray(t.data)?t.data:[];i.push(o.length);const l=t&&void 0!==t.name&&null!==t.name?t.name:void 0;s.push(null!=(n=null!=l?l:e.labels[r])?n:`series-${r+1}`),a.push(o.slice())}),this.w.seriesData.series=i,this.w.seriesData.seriesNames=s,this.w.seriesData.unitData=a,this.w}resetParsingFlags(){const t=this.w;t.axisFlags.dataWasParsed=!1,t.globals.originalSeries=null,t.config.series&&t.config.series.forEach(t=>{t.__apexParsed&&delete t.__apexParsed})}extractPieDataFromSeries(t){const e=[],i=[];if(!Array.isArray(t))return{values:[],labels:[]};if(0===t.length)return{values:[],labels:[]};const s=t[0];return"object"==typeof s&&null!==s&&s.data?(this.extractPieDataFromSeriesObjects(t,e,i),{values:e,labels:i}):{values:[],labels:[]}}extractPieDataFromSeriesObjects(t,e,i){t.forEach((t,s)=>{t.data&&Array.isArray(t.data)&&t.data.forEach(t=>{"object"==typeof t&&null!==t&&void 0!==t.x&&void 0!==t.y&&(i.push(String(t.x)),e.push(v.parseNumber(t.y)))})})}handleExternalLabelsData(t){const e=this.w.config;if(e.xaxis.categories.length>0)this.w.labelData.labels=e.xaxis.categories;else if(e.labels.length>0)this.w.labelData.labels=e.labels.slice();else if(this.fallbackToCategory){if(this.w.labelData.labels=this.w.labelData.labels[0],this.w.rangeData.seriesRange.length){this.w.rangeData.seriesRange.map(t=>{t.forEach(t=>{this.w.labelData.labels.indexOf(t.x)<0&&t.x&&this.w.labelData.labels.push(t.x)})});const t=this.w.labelData.labels;if(t.length>0&&("number"==typeof t[0]||"string"==typeof t[0]))this.w.labelData.labels=[...new Set(t)];else{const e=new Map;for(const i of t){const t=JSON.stringify(i);e.has(t)||e.set(t,i)}this.w.labelData.labels=Array.from(e.values())}}if(e.xaxis.convertedCatToNumeric){new X(e).convertCatToNumericXaxis(e,this.w.seriesData.seriesX[0]),this._generateExternalLabels(t)}}else this._generateExternalLabels(t)}_generateExternalLabels(t){const e=this.w.globals,i=this.w.config;let s=[];if(e.axisCharts){if(this.w.seriesData.series.length>0)if(this.isFormatXY()){const t=i.series.map(t=>{const e=new Map;for(const i of t.data)e.has(i.x)||e.set(i.x,i);return Array.from(e.values())}),e=t.reduce((t,e,i,s)=>s[t].length>e.length?t:i,0);for(let i=0;i<t[e].length;i++)s.push(i+1)}else for(let t=0;t<this.w.seriesData.series[e.maxValsInArrayIndex].length;t++)s.push(t+1);this.w.seriesData.seriesX=[];for(let e=0;e<t.length;e++)this.w.seriesData.seriesX.push(s);this.w.globals.isBarHorizontal||(this.w.axisFlags.isXNumeric=!0)}if(0===s.length){s=e.axisCharts?[]:this.w.seriesData.series.map((t,e)=>e+1);for(let e=0;e<t.length;e++)this.w.seriesData.seriesX.push(s)}this.w.labelData.labels=s,i.xaxis.convertedCatToNumeric&&(this.w.labelData.categoryLabels=s.map(t=>i.xaxis.labels.formatter(t))),this.w.axisFlags.noLabelsProvided=!0}parseRawDataIfNeeded(t){const e=this.w.config,i=this.w.globals,s=e.parsing;if(this.w.axisFlags.dataWasParsed)return t;const a=!(!s||!(s.x||s.y||s.z)),r=t.some(t=>t.parsing&&(t.parsing.x||t.parsing.y||t.parsing.z));if(!a&&!r)return t;const n=t.map((t,e)=>{var i,a,r,n;if(!t.data||!Array.isArray(t.data)||0===t.data.length)return t;const h={x:(null==(i=t.parsing)?void 0:i.x)||(null==s?void 0:s.x),y:(null==(a=t.parsing)?void 0:a.y)||(null==s?void 0:s.y),z:(null==(r=t.parsing)?void 0:r.z)||(null==s?void 0:s.z)};if(!h.x&&!h.y)return t;const c=t.data[0];if("object"==typeof c&&null!==c&&(Object.prototype.hasOwnProperty.call(c,"x")||Object.prototype.hasOwnProperty.call(c,"y"))||Array.isArray(c))return t;if(!h.x||!h.y||Array.isArray(h.y)&&0===h.y.length){const e=[];h.x||e.push("x"),(!h.y||Array.isArray(h.y)&&0===h.y.length)&&e.push("y");n=t.name;return t}const d=t.data.map((t,e)=>{if("object"!=typeof t||null===t)return t;const i=this.getNestedValue(t,h.x);let s,a;if(Array.isArray(h.y)){const e=h.y.map(e=>this.getNestedValue(t,e));"bubble"===this.w.config.chart.type?(e.length,s=e[0]):s=e}else s=this.getNestedValue(t,h.y);h.z&&(a=this.getNestedValue(t,h.z));const r={x:i,y:s,z:void 0};if("bubble"===this.w.config.chart.type&&Array.isArray(h.y)&&2===h.y.length){const e=this.getNestedValue(t,h.y[1]);void 0!==e&&(r.z=e)}return void 0!==a&&(r.z=a),r});return l(o({},t),{data:d,__apexParsed:!0})});return this.w.axisFlags.dataWasParsed=!0,i.originalSeries||(i.originalSeries=v.clone(t)),n}getNestedValue(t,e){if(!t||"object"!=typeof t||!e)return;if(-1===e.indexOf("."))return t[e];const i=e.split(".");let s=t;for(let t=0;t<i.length;t++){if(null==s||"object"!=typeof s)return;s=s[i[t]]}return s}applySeriesTransform(t){const e=this.w.config,i=e.chart.requestedType||e.chart.type,s=function(t){return t&&Ai()[t]||null}(i);return s?s(t,this.w):Array.isArray(t)&&-1!==Ti.indexOf(i)?(this._warnedMissingTransform||(this._warnedMissingTransform=!0),t.map(t=>l(o({},t),{data:[]}))):t}flattenTreemapHierarchy(t){const e=this.w,i=e.globals;if("treemap"!==e.config.chart.type||!Array.isArray(t))return t;if(!i.treemapRawSeries){if(!Li(e,t))return i.treemapRoots=null,t;i.treemapRawSeries=t.map(t=>l(o({},t),{data:Array.isArray(null==t?void 0:t.data)?t.data.slice():null==t?void 0:t.data}))}const{roots:s,leafSeries:a,maxDepth:r}=function(t,e){const i=ki(t,e,{keepDatum:!0,expandDrilldown:Di(t)});i.forEach(_i);const{leaves:s,maxDepth:a}=Pi(i);return{roots:i,leafSeries:e.map((t,e)=>l(o({},t),{data:(s[e]||[]).map(Ei)})),maxDepth:a}}(e,i.treemapRawSeries);return i.treemapRoots=s,i.treemapMaxDepth=r,a}expandScatterJitterData(t){var e,i;const s=this.w.config,a="scatter"===s.chart.type||"bubble"===s.chart.type,r=null==(i=null==(e=s.plotOptions)?void 0:e.scatter)?void 0:i.jitter;if(!(a&&r&&r.enabled&&Array.isArray(t)))return t;if(!t.some(t=>Array.isArray(null==t?void 0:t.data)&&t.data.some(t=>t&&!Array.isArray(t)&&Array.isArray(t.y))))return"datetime"!==s.xaxis.type&&(Array.isArray(s.xaxis.categories)&&s.xaxis.categories.length?this._applyBandAxis(s.xaxis.categories.slice()):Array.isArray(s.xaxis._scatterBandLabels)&&s.xaxis._scatterBandLabels.length&&this._applyBandAxis(s.xaxis._scatterBandLabels)),t;const n=[],h=new Map;t.forEach(t=>{Array.isArray(null==t?void 0:t.data)&&t.data.forEach(t=>{if(t&&Array.isArray(t.y)){const e=String(t.x);h.has(e)||(h.set(e,n.length),n.push(t.x))}})});const c=r.maxPoints||5e3,d=t.map(t=>{if(!Array.isArray(null==t?void 0:t.data))return t;const e=[];return t.data.forEach(t=>{if(t&&Array.isArray(t.y)){const i=h.get(String(t.x)),s=t.y,a=s.length>c?Math.ceil(s.length/c):1;for(let t=0;t<s.length;t+=a){const a=v.parseNumber(s[t]);null!==a&&e.push({x:i,y:a})}}else if(t&&"object"==typeof t&&!Array.isArray(t)){const i=String(t.x);e.push({x:h.has(i)?h.get(i):t.x,y:t.y})}else e.push(t)}),l(o({},t),{data:e})});return this._applyBandAxis(n),d}_applyBandAxis(t){var e;const i=this.w.config.xaxis,s=t.length;if(!s)return;const a=i._scatterBand=i._scatterBand||{};if(i._scatterBandLabels=t.slice(),i.type="numeric",(null==(e=this.w.interact)?void 0:e.zoomed)&&"number"==typeof i.min&&"number"==typeof i.max&&isFinite(i.min)&&isFinite(i.max)){const t=t=>Math.max(0,Math.min(s-1,t));let e=t(Math.round(i.min+.49)),r=t(Math.round(i.max-.49));r<e&&(e=r=t(Math.round((i.min+i.max)/2))),i.min=e-1,i.max=r+1,i.tickAmount=r-e+2,a.min=!0,a.max=!0,a.tick=!0}else(null==i.min||a.min)&&(i.min=-1,a.min=!0),(null==i.max||a.max)&&(i.max=s,a.max=!0),(null==i.tickAmount||"dataPoints"===i.tickAmount||a.tick)&&(i.tickAmount=s+1,a.tick=!0);i.labels=i.labels||{};const r=i.labels.formatter;if("function"!=typeof r||r._scatterBand){const e=e=>{const i=Math.round(e);return Math.abs(e-i)<1e-6&&void 0!==t[i]?t[i]:""};e._scatterBand=!0,i.labels.formatter=e}}parseData(t){var e,i,s,a,r,n,h;const c=this.w,d=c.config,p=c.globals;if(t=this.parseRawDataIfNeeded(t),t=this.applySeriesTransform(t),t=this.expandScatterJitterData(t),t=this.flattenTreemapHierarchy(t),(null==(e=d.chart.dataReducer)?void 0:e.enabled)&&p.axisCharts&&!p.dataReducerRawSeries){p.dataReducerRawSeries=t.map(t=>({data:Array.isArray(null==t?void 0:t.data)?t.data.slice():null==t?void 0:t.data}));let e=1/0,n=-1/0;for(const o of t){const t=null==o?void 0:o.data;if(!Array.isArray(t)||0===t.length)continue;const l=!Array.isArray(t[0]),h=l?null==(i=t[0])?void 0:i.x:null==(s=t[0])?void 0:s[0],c=l?null==(a=t[t.length-1])?void 0:a.x:null==(r=t[t.length-1])?void 0:r[0];"number"==typeof h&&(e=Math.min(e,h)),"number"==typeof c&&(n=Math.max(n,c))}e!==1/0&&(p.dataReducerRawMinX=e,p.dataReducerRawMaxX=n)}if(p.dataReducerRawSeries&&(null==(n=d.chart.dataReducer)?void 0:n.enabled)&&(t=t.map(t=>o({},t))),d.series=t,p.dataReducerRawSeries&&(null==(h=d.chart.dataReducer)?void 0:h.enabled)){const e=p.dataReducerRawSeries;p.initialSeries=t.map((t,i)=>{var s,a,r;return l(o({},t),{data:null!=(r=null==(a=null==(s=e[i])?void 0:s.data)?void 0:a.slice())?r:t.data})})}else p.histogramRawSeries?p.initialSeries=p.histogramRawSeries:p.treemapRawSeries?p.initialSeries=p.treemapRawSeries:p.initialSeries=t;if(this.excludeCollapsedSeriesInYAxis(),this.fallbackToCategory=!1,this.resetGlobals(),this.isMultipleY(),p.axisCharts?(this.parseDataAxisCharts(t),this.coreUtils.getLargestSeries()):this.parseDataNonAxisCharts(t),d.chart.stacked){const t=new Be(this.w);this.w.seriesData.series=t.setNullSeriesToZeroValues(this.w.seriesData.series)}this.coreUtils.getSeriesTotals(),p.axisCharts?(Fi._defineLazyResult(this.w.seriesData,"stackedSeriesTotals",()=>this.coreUtils.getStackedSeriesTotals()),Fi._defineLazyResult(this.w.seriesData,"stackedSeriesTotalsByGroups",()=>this.coreUtils.getStackedSeriesTotalsByGroups()),Fi._defineLazyResult(p,"seriesPercent",()=>(this.coreUtils.getPercentSeries(),p.seriesPercent))):this.coreUtils.getPercentSeries(),this.w.axisFlags.dataFormatXNumeric||this.w.axisFlags.isXNumeric&&("numeric"!==d.xaxis.type||0!==d.labels.length||0!==d.xaxis.categories.length)||this.handleExternalLabelsData(t);const u=this.coreUtils.getCategoryLabels(this.w.labelData.labels);for(let t=0;t<u.length;t++)if(Array.isArray(u[t])){this.w.axisFlags.isMultiLineX=!0;break}return{seriesData:{series:this.w.seriesData.series,seriesNames:this.w.seriesData.seriesNames,seriesX:this.w.seriesData.seriesX,seriesZ:this.w.seriesData.seriesZ,seriesColors:this.w.seriesData.seriesColors,seriesGoals:this.w.seriesData.seriesGoals,unitData:this.w.seriesData.unitData,noLabelsProvided:this.w.axisFlags.noLabelsProvided},rangeData:{seriesRangeStart:this.w.rangeData.seriesRangeStart,seriesRangeEnd:this.w.rangeData.seriesRangeEnd,seriesRange:this.w.rangeData.seriesRange},candleData:{seriesCandleO:this.w.candleData.seriesCandleO,seriesCandleH:this.w.candleData.seriesCandleH,seriesCandleM:this.w.candleData.seriesCandleM,seriesCandleL:this.w.candleData.seriesCandleL,seriesCandleC:this.w.candleData.seriesCandleC,seriesBoxPoints:this.w.candleData.seriesBoxPoints},labelData:{labels:this.w.labelData.labels,categoryLabels:this.w.labelData.categoryLabels},axisFlags:{isXNumeric:this.w.axisFlags.isXNumeric,dataFormatXNumeric:this.w.axisFlags.dataFormatXNumeric,isDataXYZ:this.w.axisFlags.isDataXYZ,isRangeData:this.w.axisFlags.isRangeData,isRangeBar:this.w.axisFlags.isRangeBar,isMultiLineX:this.w.axisFlags.isMultiLineX,dataWasParsed:this.w.axisFlags.dataWasParsed,hasXaxisGroups:this.w.labelData.hasXaxisGroups,groups:this.w.labelData.groups,seriesGroups:this.w.labelData.seriesGroups}}}static _defineLazyResult(t,e,i){let s,a=!1;Object.defineProperty(t,e,{configurable:!0,enumerable:!0,get:()=>(a||(a=!0,s=i()),s),set(t){a=!0,s=t}})}static sliceByXRange(t,e,i){const s=t.length;if(0===s)return t;const a=!Array.isArray(t[0])?t=>t.x:t=>t[0];let r=0;if(null!=e){let i=0,n=s-1;for(;i<=n;){const s=i+n>>1;a(t[s])<e?i=s+1:n=s-1}r=Math.max(0,i-1)}let n=s;if(null!=i){let e=0,r=s-1;for(;e<=r;){const s=e+r>>1;a(t[s])>i?r=s-1:e=s+1}n=Math.min(s,e+1)}return 0===r&&n===s?t.slice():t.slice(r,n)}static lttbDownsample(t,e){const i=t.length;if(e>=i||e<3)return t;const s=!Array.isArray(t[0]),a=s?t=>t.x:t=>t[0],r=s?t=>t.y:t=>t[1],n=[];n.push(t[0]);const o=(i-2)/(e-2);let l=0;for(let s=0;s<e-2;s++){const e=Math.floor((s+1)*o)+1,h=Math.min(Math.floor((s+2)*o)+1,i);let c=0,d=0;const p=h-e;for(let i=e;i<h;i++)c+=a(t[i]),d+=r(t[i]);c/=p,d/=p;const u=Math.floor(s*o)+1,g=Math.min(Math.floor((s+1)*o)+1,i),f=a(t[l]),x=r(t[l]);let m=-1,b=u;for(let e=u;e<g;e++){const i=.5*Math.abs((f-c)*(r(t[e])-x)-(f-a(t[e]))*(d-x));i>m&&(m=i,b=e)}n.push(t[b]),l=b}return n.push(t[i-1]),n}static ohlcAggregate(t,e){const i=t.length;if(e>=i||e<1)return t;const s=!Array.isArray(t[0]),a=s?t=>t.x:t=>t[0],r=s?t=>t.y:t=>t[1],n=s?(t,e)=>({x:t,y:e}):(t,e)=>[t,e],o=[],l=i/e;for(let s=0;s<e;s++){const h=Math.floor(s*l),c=s===e-1?i:Math.floor((s+1)*l);if(c<=h)continue;const d=r(t[h]),p=d[0];let u=d[1],g=d[2],f=d[3];for(let e=h+1;e<c;e++){const i=r(t[e]);i[1]>u&&(u=i[1]),i[2]<g&&(g=i[2]),f=i[3]}o.push(n(a(t[h]),[p,u,g,f]))}return o}static rangeAggregate(t,e){const i=t.length;if(e>=i||e<1)return t;const s=!Array.isArray(t[0]),a=s?t=>t.x:t=>t[0],r=s?t=>t.y:t=>t[1],n=s?(t,e)=>({x:t,y:e}):(t,e)=>[t,e],o=[],l=i/e;for(let s=0;s<e;s++){const h=Math.floor(s*l),c=s===e-1?i:Math.floor((s+1)*l);if(c<=h)continue;let d=1/0,p=-1/0;for(let e=h;e<c;e++){const i=r(t[e]);if(null!=i)for(let t=0;t<2;t++){const e=i[t];null!=e&&isFinite(e)&&(e<d&&(d=e),e>p&&(p=e))}}o.push(n(a(t[h]),d===1/0?[null,null]:[d,p]))}return o}excludeCollapsedSeriesInYAxis(){const t=this.w,e=[];t.globals.seriesYAxisMap.forEach((i,s)=>{let a=0;i.forEach(e=>{-1!==t.globals.collapsedSeriesIndices.indexOf(e)&&a++}),a>0&&a==i.length&&e.push(s)}),t.globals.ignoreYAxisIndexes=e.map(t=>t)}}class Ii{constructor(t,e){this.w=t,this.ctx=e}_updateOptions(t,e=!1,i=!0,s=!0,a=!1){return new Promise((r,n)=>{let o=[this.ctx];s&&(o=this.ctx.getSyncedCharts()),this.w.globals.isExecCalled&&(o=[this.ctx],this.w.globals.isExecCalled=!1),o.forEach((s,l)=>{var h,c;const d=s.w;d.globals.shouldAnimate=i,e||(d.globals.resized=!0,d.globals.dataChanged=!0,i&&d.config.chart.animations.enabled&&s.series.getPreviousPaths());const p=d.config.chart.requestedType||d.config.chart.type;if(i&&t&&"object"==typeof t){const e=null==(h=null==t?void 0:t.chart)?void 0:h.type;e&&e!==p&&(null==(c=s.morphTypeChange)||c.captureBeforeDestroy({fromType:p,toType:e,newSeries:t.series||d.config.series}))}if(t&&"object"==typeof t){s.config=new z(t);const e=t.chart&&t.chart.type,i="funnel"===e||"pyramid"===e||"gauge"===e,r=!!d.config.chart.requestedType;if(e&&!i&&r){t.chart=t.chart||{},t.chart.requestedType=e;const i=d.config.chart.requestedType;"funnel"!==i&&"pyramid"!==i||(t.plotOptions=t.plotOptions||{},t.plotOptions.bar=t.plotOptions.bar||{},void 0===t.plotOptions.bar.isFunnel&&(t.plotOptions.bar.isFunnel=!1),void 0===t.plotOptions.bar.isPyramid&&(t.plotOptions.bar.isPyramid=!1))}s.config.normalizeAliasedChartType(t),t=H.extendArrayProps(s.config,t,d),s.w.globals.chartID!==this.w.globals.chartID&&(delete t.series,delete t.yaxis),d.config=v.extend(d.config,t),X.handOverTypeDefaults(d.config,p,t),a&&(d.globals.lastXAxis=t.xaxis?v.clone(t.xaxis):[],d.globals.lastYAxis=t.yaxis?v.clone(t.yaxis):[],d.globals.initialConfig=v.extend({},d.config),d.globals.initialSeries=d.config.series),t.series&&(d.globals.collapsedSeriesIndices.length>0||d.globals.ancillaryCollapsedSeriesIndices.length>0)&&s.series.reconcileCollapsedByName()}return s.update(t).then(()=>{l===o.length-1&&r(s)}).catch(n)})})}_updateSeries(t,e,i=!1){return new Promise((s,a)=>{const r=this.w;r.globals.shouldAnimate=e,r.globals.dataChanged=!0;const n=JSON.stringify({y:(r.globals.yAxisScale||[]).map(t=>t?t.result:null),xMin:r.globals.minX,xMax:r.globals.maxX});zt.invalidateSelectors(r),e&&r.config.chart.animations.enabled&&this.ctx.series.getPreviousPaths();const o=r.config.series.length,l=r.config.series.map(t=>{var e,i;return null!=(i=null==(e=null==t?void 0:t.data)?void 0:e.length)?i:0});i&&(r.globals.dataReducerRawSeries=null,r.globals.histogramRawSeries=null,r.globals.treemapRawSeries=null),this.ctx.data.resetParsingFlags();const h=this.ctx.data.parseData(t);return this.ctx._writeParsedSeriesData(h.seriesData),this.ctx._writeParsedRangeData(h.rangeData),this.ctx._writeParsedCandleData(h.candleData),this.ctx._writeParsedLabelData(h.labelData),this.ctx._writeParsedAxisFlags(h.axisFlags),i&&(r.globals.initialConfig&&(r.globals.initialConfig.series=r.config.series),r.globals.initialSeries=r.config.series),this._canUseFastPath(t,o,l,r)?this.ctx.fastUpdate(e,n).then(()=>{s(this.ctx)}).catch(a):(this.ctx._updateStats&&this.ctx._updateStats.full++,this.ctx.update().then(()=>{s(this.ctx)}).catch(a))})}_canUseFastPath(t,e,i,s){return!!s.dom.elGraphical&&(!!s.globals.axisCharts&&(t.length===e&&(!t.some((t,e)=>{var s,a;return(null!=(a=null==(s=null==t?void 0:t.data)?void 0:s.length)?a:0)!==i[e]})&&(!(s.globals.collapsedSeries.length>0)&&(!(s.globals.ancillaryCollapsedSeries.length>0)&&(!(s.globals.risingSeries.length>0)&&(!s.globals.comboCharts&&!s.interact.zoomed)))))))}_extendSeries(t,e){const i=this.w,s=i.config.series[e];return l(o({},i.config.series[e]),{name:t.name?t.name:null==s?void 0:s.name,color:t.color?t.color:null==s?void 0:s.color,type:t.type?t.type:null==s?void 0:s.type,group:t.group?t.group:null==s?void 0:s.group,hidden:void 0!==t.hidden?t.hidden:null==s?void 0:s.hidden,data:t.data?t.data:null==s?void 0:s.data,zIndex:void 0!==t.zIndex?t.zIndex:e})}toggleDataPointSelection(t,e){const i=this.w;let s=null;const a=`.apexcharts-series[data\\:realIndex='${t}']`;if(i.globals.axisCharts?s=i.dom.Paper.findOne(`${a} path[j='${e}'], ${a} circle[j='${e}'], ${a} rect[j='${e}']`):void 0===e&&(s=i.dom.Paper.findOne(`${a} path[j='${t}']`),"pie"!==i.config.chart.type&&"polarArea"!==i.config.chart.type&&"donut"!==i.config.chart.type||this.ctx.pie.pieClicked(t)),!s)return null;new Dt(this.w).pathMouseDown(s,null);return s.node?s.node:null}forceXAxisUpdate(t){const e=this.w;if(["min","max"].forEach(i=>{void 0!==t.xaxis[i]&&(e.config.xaxis[i]=t.xaxis[i],e.globals.lastXAxis[i]=t.xaxis[i])}),t.xaxis.categories&&t.xaxis.categories.length&&(e.config.xaxis.categories=t.xaxis.categories),e.config.xaxis.convertedCatToNumeric){const e=new X(t);t=e.convertCatToNumericXaxis(t,this.ctx)}return t}forceYAxisUpdate(t){return t.chart&&t.chart.stacked&&"100%"===t.chart.stackType&&(Array.isArray(t.yaxis)?t.yaxis.forEach((e,i)=>{t.yaxis[i].min=0,t.yaxis[i].max=100}):(t.yaxis.min=0,t.yaxis.max=100)),t}revertDefaultAxisMinMax(t){const e=this.w;let i=e.globals.lastXAxis,s=e.globals.lastYAxis;t&&t.xaxis&&(i=t.xaxis),t&&t.yaxis&&(s=t.yaxis);const a=i;e.config.xaxis.min=a.min,e.config.xaxis.max=a.max;const r=t=>{if(void 0!==s[t]){const i=s[t];e.config.yaxis[t].min=i.min,e.config.yaxis[t].max=i.max}};e.config.yaxis.map((t,i)=>{e.interact.zoomed||void 0!==s[i]?r(i):void 0!==this.ctx.opts.yaxis[i]&&(t.min=this.ctx.opts.yaxis[i].min,t.max=this.ctx.opts.yaxis[i].max)})}}class Ri{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)/Ri.xRatio(t)}static pxToDataX(t,e){return t.globals.minX+e*Ri.xRatio(t)}static screenXToPlotPx(t,e){const i=t.dom.baseEl,s=i&&i.querySelector(".apexcharts-svg");if(!s)return e-t.layout.translateX;const a=s.getBoundingClientRect(),r=t.globals.svgWidth?a.width/t.globals.svgWidth:1;return(e-a.left)/(r||1)-t.layout.translateX}}class Xi{constructor(t){this.w=t.w,this.ttCtx=t}static hoverTarget(t){return t?(t.eventPhase&&t.target&&(t.apexHoverTarget=t.target),t.apexHoverTarget||t.target):null}getNearestValues({hoverArea:t,elGrid:e,clientX:i,clientY:s}){var a,r;const n=this.w,o=e.getBoundingClientRect(),l=n.layout.gridWidth,h=o.height;let c=l/(n.globals.dataPoints-1);const d=h/n.globals.dataPoints,p=this.hasBars();!n.globals.comboCharts&&!p||n.config.xaxis.convertedCatToNumeric||(c=l/n.globals.dataPoints);const u=Ri.screenXToPlotPx(n,i),g=s-o.top,f=n.globals.barPadForNumericAxis||0;u<-f||g<0||u>l+f||g>h?(t.classList.remove("hovering-zoom"),t.classList.remove("hovering-pan")):n.interact.zoomEnabled?(t.classList.remove("hovering-pan"),t.classList.add("hovering-zoom")):n.interact.panEnabled&&(t.classList.remove("hovering-zoom"),t.classList.add("hovering-pan"));let x=Math.round(u/c);const m=Math.floor(g/d);p&&!n.config.xaxis.convertedCatToNumeric&&(x=Math.ceil(u/c),x-=1);let b=null,y=null,w=n.globals.seriesXvalues.map(t=>t.filter(t=>v.isNumber(t)));const A=n.globals.seriesYvalues.map(t=>t.filter(t=>v.isNumber(t)));return n.axisFlags.isXNumeric&&(y=this.closestInMultiArray(u,g,w,A),b=y.index,x=null!=(a=y.j)?a:0,null!==b&&n.globals.hasNullValues&&(w=n.globals.seriesXvalues[b],y=this.closestInArray(u,w),x=null!=(r=y.j)?r:0)),n.interact.capturedSeriesIndex=null===b?-1:b,(!x||x<1)&&(x=0),n.globals.isBarHorizontal?n.interact.capturedDataPointIndex=m:n.interact.capturedDataPointIndex=x,{capturedSeries:b,j:n.globals.isBarHorizontal?m:x,hoverX:u,hoverY:g}}getFirstActiveXArray(t){const e=this.w;let i=0;const s=t.map((t,e)=>t.length>0?e:-1);for(let t=0;t<s.length;t++)if(-1!==s[t]&&-1===e.globals.collapsedSeriesIndices.indexOf(t)&&-1===e.globals.ancillaryCollapsedSeriesIndices.indexOf(t)){i=s[t];break}return i}closestInMultiArray(t,e,i,s){const a=this.w,r=t=>-1===a.globals.collapsedSeriesIndices.indexOf(t)&&-1===a.globals.ancillaryCollapsedSeriesIndices.indexOf(t),n=a.config.chart.type,o=!a.globals.comboCharts&&("line"===n||"area"===n);let l=1/0,h=null,c=null;if(a.globals.allSeriesHasEqualX){let a=1/0;for(let e=0;e<i.length;e++){if(!r(e))continue;const n=i[e],o=s[e],l=Math.min(n.length,o.length);for(let e=0;e<l;e++){const i=Math.abs(t-n[e]);i<a&&(a=i,c=e)}}if(null!==c)if(o){let a=1/0;for(let n=0;n<i.length;n++){if(!r(n))continue;const o=i[n],l=s[n],d=Math.min(o.length,l.length);if(d<2){const t=l[c];if("number"!=typeof t)continue;const i=Math.abs(e-t);i<a&&(a=i,h=n);continue}for(let i=0;i<d-1;i++){const s=this._distanceToSegment(t,e,o[i],l[i],o[i+1],l[i+1]);s.dist<a&&(a=s.dist,h=n)}}}else{let t=1/0;for(let a=0;a<i.length;a++){if(!r(a))continue;const i=s[a][c];if("number"!=typeof i)continue;const n=Math.abs(e-i);n<t&&(t=n,h=a)}}return{index:h,j:c}}for(let a=0;a<i.length;a++){if(!r(a))continue;const n=i[a],d=s[a],p=Math.min(n.length,d.length);if(o&&p>=2)for(let i=0;i<p-1;i++){const s=this._distanceToSegment(t,e,n[i],d[i],n[i+1],d[i+1]);s.dist<l&&(l=s.dist,h=a,c=s.t<.5?i:i+1)}else for(let i=0;i<p;i++){const s=t-n[i],r=e-d[i],o=Math.sqrt(s*s+r*r);o<l&&(l=o,h=a,c=i)}}return{index:h,j:c}}_distanceToSegment(t,e,i,s,a,r){const n=a-i,o=r-s,l=n*n+o*o;let h=0===l?0:((t-i)*n+(e-s)*o)/l;h<0?h=0:h>1&&(h=1);const c=t-(i+h*n),d=e-(s+h*o);return{dist:Math.sqrt(c*c+d*d),t:h}}closestInArray(t,e){const i=e[0];let s=null,a=Math.abs(t-i);for(let i=0;i<e.length;i++){const r=Math.abs(t-e[i]);r<a&&(a=r,s=i)}return{j:s}}isXoverlap(t){const e=[],i=this.w.seriesData.seriesX.filter(t=>void 0!==t[0]);if(i.length>0)for(let s=0;s<i.length-1;s++)void 0!==i[s][t]&&void 0!==i[s+1][t]&&i[s][t]!==i[s+1][t]&&e.push("unEqual");return 0===e.length}isInitialSeriesSameLen(){var t,e,i,s;let a=!0;const r=(null==(e=null!=(t=this.w.globals._initialSeriesPeek)?t:this.w.globals.initialSeries)?void 0:e.filter((t,e)=>{var i;return!(null==(i=this.w.globals.collapsedSeriesIndices)?void 0:i.includes(e))}))||[];for(let t=0;t<r.length-1;t++){if(!(null==(i=r[t])?void 0:i.data)||!(null==(s=r[t+1])?void 0:s.data))return!0;if(r[t].data.length!==r[t+1].data.length){a=!1;break}}return a}getBarsHeight(t){return[...t].reduce((t,e)=>t+e.getBBox().height,0)}getElMarkers(t){return"number"==typeof t?this.w.dom.baseEl.querySelectorAll(`.apexcharts-series[data\\:realIndex='${t}'] .apexcharts-series-markers-wrap > *`):this.w.dom.baseEl.querySelectorAll(".apexcharts-series-markers-wrap > *")}getAllMarkers(t=!1){let e=[...this.w.dom.baseEl.querySelectorAll(".apexcharts-series-markers-wrap")];t&&(e=e.filter(t=>{const e=Number(t.getAttribute("data:realIndex"));return-1===this.w.globals.collapsedSeriesIndices.indexOf(e)})),e.sort((t,e)=>{var i=Number(t.getAttribute("data:realIndex")),s=Number(e.getAttribute("data:realIndex"));return s<i?1:s>i?-1:0});const i=[];return e.forEach(t=>{i.push(t.querySelector(".apexcharts-marker"))}),i}hasMarkers(t){return this.getElMarkers(t).length>0}getPathFromPoint(t,e){const i=Number(t.getAttribute("cx")),s=Number(t.getAttribute("cy")),a=t.getAttribute("shape");return new Dt(this.w).getMarkerPath(i,s,a,e)}getElBars(){return this.w.dom.baseEl.querySelectorAll(".apexcharts-bar-series,  .apexcharts-candlestick-series, .apexcharts-boxPlot-series, .apexcharts-violin-series, .apexcharts-rangebar-series")}hasBars(){return this.getElBars().length>0}getHoverMarkerSize(t){const e=this.w;let i=e.config.markers.hover.size;return void 0===i&&(i=e.globals.markers.size[t]+e.config.markers.hover.sizeOffset),i}toggleAllTooltipSeriesGroups(t){const e=this.w,i=this.ttCtx;0===i.allTooltipSeriesGroups.length&&(i.allTooltipSeriesGroups=e.dom.baseEl.querySelectorAll(".apexcharts-tooltip-series-group"));const s=i.allTooltipSeriesGroups;for(let i=0;i<s.length;i++)"enable"===t?(s[i].classList.add("apexcharts-active"),s[i].style.display=e.config.tooltip.items.display):(s[i].classList.remove("apexcharts-active"),s[i].style.display="none")}}class zi{constructor(t){this.w=t.w,this.ttCtx=t,this.tooltipUtil=new Xi(t)}drawSeriesTexts({shared:t=!0,ttItems:e,i:i=0,j:s=null,y1:a,y2:r,e:n}){const o=this.w;void 0!==o.config.tooltip.custom?this.handleCustomTooltip({i:i,j:s,y1:a,y2:r,w:o}):this.toggleActiveInactiveSeries(t,i);const l=this.getValuesToPrint({i:i,j:s});this.printLabels({i:i,j:s,values:l,ttItems:e,shared:t,e:n});const h=this.ttCtx.getElTooltip();h&&(this.ttCtx.tooltipRect.ttWidth=h.getBoundingClientRect().width,this.ttCtx.tooltipRect.ttHeight=h.getBoundingClientRect().height)}printLabels({i:t,j:e,values:i,ttItems:s,shared:a,e:r}){const n=this.w,{xVal:o,zVal:l,xAxisTTVal:h}=i,c=n.seriesData.series.length,d=null!==e&&n.config.plotOptions.bar.distributed?n.globals.colors[e]:n.globals.colors[t];for(let i=0;i<c;i++){const p=n.config.tooltip.inverseOrder?c-1-i:i,u=this.computeSeriesRow({i:t,j:e,t:i,tIndex:p,shared:a,e:r,basePColor:d});this.DOMHandling({i:t,t:p,j:e,ttItems:s,values:{val:u.val,goalVals:u.goalVals,xVal:o,xAxisTTVal:h,zVal:l},seriesName:u.seriesName,shared:a,pColor:u.pColor})}}computeSeriesRow({i:t,j:e,tIndex:i,shared:s,e:a,basePColor:r}){const n=this.w;let h,c=this.getFormatters(t),d=r,p=[],u="treemap"===n.config.chart.type?c.yLbTitleFormatter(String(n.config.series[t].data[e].x),{series:n.seriesData.series,seriesIndex:t,dataPointIndex:e,w:n}):this.getSeriesName({fn:c.yLbTitleFormatter,index:t,seriesIndex:t,j:e});return n.globals.axisCharts&&(s?(c=this.getFormatters(i),u=this.getSeriesName({fn:c.yLbTitleFormatter,index:i,seriesIndex:t,j:e}),d=n.globals.colors[i],h=this.formatYValue(c,i,e),p=this.formatGoalVals(c,i,e)):(d=this.resolvePatternColor(a,d),h=this.formatYValue(c,t,e),p=this.formatGoalVals(c,t,e))),null===e&&(h=c.yLbFormatter(n.seriesData.series[t],l(o({},n),{seriesIndex:t,dataPointIndex:t}))),{seriesName:u,val:h,goalVals:p,pColor:d}}formatYValue(t,e,i){var s,a,r,n;const o=this.w;return o.axisFlags.isRangeData?t.yLbFormatter(null==(a=null==(s=o.rangeData.seriesRangeStart)?void 0:s[e])?void 0:a[i],{series:o.rangeData.seriesRangeStart,seriesIndex:e,dataPointIndex:i,w:o})+" - "+t.yLbFormatter(null==(n=null==(r=o.rangeData.seriesRangeEnd)?void 0:r[e])?void 0:n[i],{series:o.rangeData.seriesRangeEnd,seriesIndex:e,dataPointIndex:i,w:o}):t.yLbFormatter(o.seriesData.series[e][i],{series:o.seriesData.series,seriesIndex:e,dataPointIndex:i,w:o})}formatGoalVals(t,e,i){var s;const a=this.w,r=null==(s=a.seriesData.seriesGoals[e])?void 0:s[i];return Array.isArray(r)?r.map(s=>({attrs:s,val:t.yLbFormatter(s.value,{seriesIndex:e,dataPointIndex:i,w:a})})):[]}resolvePatternColor(t,e){var i,s,a,r;const n=this.w,o=null==(s=null==(i=Xi.hoverTarget(t))?void 0:i.getAttribute)?void 0:s.call(i,"fill");if(!o)return e;if(-1===o.indexOf("url"))return o;if(-1===o.indexOf("Pattern"))return e;const l=n.dom.baseEl.querySelector(o.substr(4).slice(0,-1));return null!=(r=null==(a=null==l?void 0:l.childNodes[0])?void 0:a.getAttribute("stroke"))?r:e}getFormatters(t){const e=this.w;let i,s=e.formatters.yLabelFormatters[t];return void 0!==e.formatters.ttVal?Array.isArray(e.formatters.ttVal)?(s=e.formatters.ttVal[t]&&e.formatters.ttVal[t].formatter,i=e.formatters.ttVal[t]&&e.formatters.ttVal[t].title&&e.formatters.ttVal[t].title.formatter):(s=e.formatters.ttVal.formatter,"function"==typeof e.formatters.ttVal.title.formatter&&(i=e.formatters.ttVal.title.formatter)):i=e.config.tooltip.y.title.formatter,"function"!=typeof s&&(s=e.formatters.yLabelFormatters[0]?e.formatters.yLabelFormatters[0]:function(t){return t}),"function"!=typeof i&&(i=function(t){return t?t+": ":""}),{yLbFormatter:s,yLbTitleFormatter:i}}getSeriesName({fn:t,index:e,seriesIndex:i,j:s}){const a=this.w;return t(String(a.seriesData.seriesNames[e]),{series:a.seriesData.series,seriesIndex:i,dataPointIndex:s,w:a})}DOMHandling({t:t,j:e,ttItems:i,values:s,seriesName:a,shared:r,pColor:n}){const o=this.w,l=this.ttCtx,{val:h,goalVals:c,xVal:d,xAxisTTVal:p,zVal:u}=s;if(!i||!i[t])return;let g=null;g=i[t].children,o.config.tooltip.fillSeriesColor&&(i[t].style.backgroundColor=n,g[0].style.display="none"),l.showTooltipTitle&&(null===l.tooltipTitle&&(l.tooltipTitle=o.dom.baseEl.querySelector(".apexcharts-tooltip-title")),l.tooltipTitle&&(l.tooltipTitle.innerHTML=d)),l.isXAxisTooltipEnabled&&l.xaxisTooltipText&&(l.xaxisTooltipText.innerHTML=""!==p?p:d);const f=i[t].querySelector(".apexcharts-tooltip-text-y-label");f&&(f.innerHTML=a||"");const x=i[t].querySelector(".apexcharts-tooltip-text-y-value");x&&(x.innerHTML=void 0!==h?h:""),g[0]&&g[0].classList.contains("apexcharts-tooltip-marker")&&(o.config.tooltip.marker.fillColors&&Array.isArray(o.config.tooltip.marker.fillColors)&&(n=o.config.tooltip.marker.fillColors[t]),o.config.tooltip.fillSeriesColor?g[0].style.backgroundColor=n:g[0].style.color=n),o.config.tooltip.marker.show||(g[0].style.display="none");const m=i[t].querySelector(".apexcharts-tooltip-text-goals-label"),b=i[t].querySelector(".apexcharts-tooltip-text-goals-value");if(c.length&&o.seriesData.seriesGoals[t]){const i=()=>{let t="<div>",e="<div>";c.forEach(i=>{t+=` <div style="display: flex"><span class="apexcharts-tooltip-marker" style="background-color: ${i.attrs.strokeColor}; height: 3px; border-radius: 0; top: 5px;"></span> ${i.attrs.name}</div>`,e+=`<div>${i.val}</div>`}),m.innerHTML=t+"</div>",b.innerHTML=e+"</div>"};r?o.seriesData.seriesGoals[t][e]&&Array.isArray(o.seriesData.seriesGoals[t][e])?i():(m.innerHTML="",b.innerHTML=""):i()}else m.innerHTML="",b.innerHTML="";if(null!==u){i[t].querySelector(".apexcharts-tooltip-text-z-label").innerHTML=o.config.tooltip.z.title;i[t].querySelector(".apexcharts-tooltip-text-z-value").innerHTML=void 0!==u?u:""}if(r&&g[0]){if(o.config.tooltip.hideEmptySeries){const e=i[t].querySelector(".apexcharts-tooltip-marker"),s=i[t].querySelector(".apexcharts-tooltip-text");0==parseFloat(h)?(e.style.display="none",s.style.display="none"):(e.style.display="block",s.style.display="block")}null==h||o.globals.ancillaryCollapsedSeriesIndices.indexOf(t)>-1||o.globals.collapsedSeriesIndices.indexOf(t)>-1||Array.isArray(l.tConfig.enabledOnSeries)&&-1===l.tConfig.enabledOnSeries.indexOf(t)?g[0].parentNode.style.display="none":g[0].parentNode.style.display=o.config.tooltip.items.display}else Array.isArray(l.tConfig.enabledOnSeries)&&-1===l.tConfig.enabledOnSeries.indexOf(t)&&(g[0].parentNode.style.display="none")}toggleActiveInactiveSeries(t,e){const i=this.w;if(t)this.tooltipUtil.toggleAllTooltipSeriesGroups("enable");else{this.tooltipUtil.toggleAllTooltipSeriesGroups("disable");const t=i.dom.baseEl.querySelector(`.apexcharts-tooltip-series-group-${e}`);if(t){const e=t;e.classList.add("apexcharts-active"),e.style.display=i.config.tooltip.items.display}}}getValuesToPrint({i:t,j:e}){var i,s,a,r,n,o,l,h;const c=this.w,d=c.seriesData.seriesX.map(t=>t.length>0?t:[]);let p="",u="",g=null,f=null;const x={series:c.seriesData.series,seriesIndex:t,dataPointIndex:e,w:c},m=c.formatters.ttZFormatter;if(null===e)f=c.seriesData.series[t];else if(c.axisFlags.isXNumeric&&"treemap"!==c.config.chart.type){if(p=d[t][e],0===d[t].length){p=d[this.tooltipUtil.getFirstActiveXArray(d)][e]}}else{p=new Fi(this.w).isFormatXY()?void 0!==c.config.series[t].data[e]?c.config.series[t].data[e].x:"":void 0!==c.labelData.labels[e]?c.labelData.labels[e]:""}const b=p;if(c.axisFlags.isXNumeric&&"datetime"===c.config.xaxis.type){p=new S(this.w).xLabelFormat(c.formatters.ttKeyFormatter,b,b,{i:void 0,dateFormatter:new A(this.w).formatDate,w:this.w})}else p=c.globals.isBarHorizontal?c.formatters.yLabelFormatters[0](b,x):null!=(a=null==(s=(i=c.formatters).xLabelFormatter)?void 0:s.call(i,b,x))?a:b;return void 0!==c.config.tooltip.x.formatter&&(p=null!=(o=null==(n=(r=c.formatters).ttKeyFormatter)?void 0:n.call(r,b,x))?o:b),c.seriesData.seriesZ.length>0&&c.seriesData.seriesZ[t].length>0&&(g=null==m?void 0:m(c.seriesData.seriesZ[t][e],c)),u="function"==typeof c.config.xaxis.tooltip.formatter?null==(h=(l=c.formatters).xaxisTooltipFormatter)?void 0:h.call(l,b,x):p,{val:Array.isArray(f)?f.join(" "):f,xVal:Array.isArray(p)?p.join(" "):p,xAxisTTVal:Array.isArray(u)?u.join(" "):u,zVal:g}}handleCustomTooltip({i:t,j:e,y1:i,y2:s,w:a}){const r=this.ttCtx.getElTooltip();let n=a.config.tooltip.custom;if(Array.isArray(n)&&(n=n[t]),"function"!=typeof n)return;const o=n({series:a.seriesData.series,seriesIndex:t,dataPointIndex:e,y1:i,y2:s,w:a});if(r){const t=r.querySelector(".apexcharts-tooltip-arrow");"string"==typeof o||"number"==typeof o?r.innerHTML=String(o):null!=o&&(o instanceof Element||"string"==typeof o.nodeName)&&(r.innerHTML="",r.appendChild(o.cloneNode(!0))),t&&r.appendChild(t)}}}class Bi{constructor(t){this.ttCtx=t,this.w=t.w}moveXCrosshairs(t,e=null){const i=this.ttCtx,s=this.w,a=i.getElXCrosshairs();let r=t-i.xcrosshairsWidth/2;const n=s.labelData.labels.slice().length;if(null!==e&&(r=s.layout.gridWidth/n*e),null===a||s.globals.isBarHorizontal||(a.setAttribute("x",String(r)),a.setAttribute("x1",String(r)),a.setAttribute("x2",String(r)),a.setAttribute("y2",String(s.layout.gridHeight)),a.classList.add("apexcharts-active")),r<0&&(r=0),r>s.layout.gridWidth&&(r=s.layout.gridWidth),i.isXAxisTooltipEnabled){let t=r;"tickWidth"!==s.config.xaxis.crosshairs.width&&"barWidth"!==s.config.xaxis.crosshairs.width||(t=r+i.xcrosshairsWidth/2),this.moveXAxisTooltip(t)}}moveYCrosshairs(t){const e=this.ttCtx;null!==e.ycrosshairs&&Dt.setAttrs(e.ycrosshairs,{y1:t,y2:t}),null!==e.ycrosshairsHidden&&Dt.setAttrs(e.ycrosshairsHidden,{y1:t,y2:t})}moveXAxisTooltip(t){var e,i;const s=this.w,a=this.ttCtx;if(null!==a.xaxisTooltip&&0!==a.xcrosshairsWidth){a.xaxisTooltip.classList.add("apexcharts-active");const r=a.xaxisOffY+s.config.xaxis.tooltip.offsetY+s.layout.translateY+5+s.config.xaxis.offsetY;if(t-=a.xaxisTooltip.getBoundingClientRect().width/2,!isNaN(t)){t+=s.layout.translateX;const n=new Dt(this.w).getTextRects(null!=(i=null==(e=a.xaxisTooltipText)?void 0:e.innerHTML)?i:"",s.config.xaxis.labels.style.fontSize);a.xaxisTooltipText&&(a.xaxisTooltipText.style.minWidth=n.width+"px"),a.xaxisTooltip.style.left=t+"px",a.xaxisTooltip.style.top=r+"px"}}}moveYAxisTooltip(t){var e,i;const s=this.w,a=this.ttCtx;null===a.yaxisTTEls&&(a.yaxisTTEls=[...s.dom.baseEl.querySelectorAll(".apexcharts-yaxistooltip")]);const r=parseInt(null!=(i=null==(e=a.ycrosshairsHidden)?void 0:e.getAttribute("y1"))?i:"0",10);let n=s.layout.translateY+r;if(a.yaxisTTEls){const e=a.yaxisTTEls[t].getBoundingClientRect(),i=e.height;let r;const o=s.dom.baseEl.querySelector(`.apexcharts-yaxis[rel='${t}'] .apexcharts-yaxis-texts-g`),l=s.dom.elWrap.getBoundingClientRect();if(o){const t=o.getBoundingClientRect();if(t.width>0){r=t.left+t.width/2-l.left-e.width/2}}if(null==r){const i=4;r=s.config.yaxis[t].opposite?s.globals.translateYAxisX[t]+i:s.globals.translateYAxisX[t]-e.width-i}n-=i/2,-1===s.globals.ignoreYAxisIndexes.indexOf(t)&&n>0&&n<s.layout.gridHeight?(a.yaxisTTEls[t].classList.add("apexcharts-active"),a.yaxisTTEls[t].style.top=n+"px",a.yaxisTTEls[t].style.left=r+s.config.yaxis[t].tooltip.offsetX+"px"):a.yaxisTTEls[t].classList.remove("apexcharts-active")}}moveTooltip(t,e,i=null){const s=this.ttCtx.getElTooltip();if(!s)return;const a=this.computeTooltipPosition(t,e,i);null!==a&&this.applyTooltipPosition(s,a)}computeTooltipPosition(t,e,i=null){var s,a,r,n,o,l,h;const c=this.w,d=this.ttCtx,p=d.tooltipRect,u=!!c.config.tooltip.arrow,g=null!==i?parseFloat(String(i)):1,f=p.ttHeight||0,x=p.ttWidth||0,m=parseFloat(String(t)),b=parseFloat(String(e));if(isNaN(m)||isNaN(b))return null;const y=g+(u?7:0)+0;let w=m+y;const v=b+c.layout.translateY;let A=u?v-f/2+g/2:b+g/2,S="right";if(w>c.layout.gridWidth/2&&(w=m-x-y,S="left"),w>c.layout.gridWidth-x-10&&(w="left"===S?Math.min(c.layout.gridWidth-x,w):c.layout.gridWidth-x),w<-20&&(w=-20),c.config.tooltip.followCursor){const t=d.getElGrid();if(!t)return null;const e=t.getBoundingClientRect();w=d.e.clientX-e.left,w>c.layout.gridWidth/2?(w-=x,S="left"):S="right",A=d.e.clientY+c.layout.translateY-e.top,A>c.layout.gridHeight/2&&(A-=f)}else if(!c.globals.isBarHorizontal)if(u){const t=c.layout.translateY,e=c.layout.translateY+c.layout.gridHeight;A+f>e&&(A=e-f),A<t&&(A=t)}else f/2+A>c.layout.gridHeight&&(A=c.layout.gridHeight-f+c.layout.translateY);if(isNaN(w))return null;w+=c.layout.translateX;const C=null==(a=null==(s=c.config)?void 0:s.chart)?void 0:a.accessibility;if((null==C?void 0:C.enabled)&&(null==(n=null==(r=null==C?void 0:C.keyboard)?void 0:r.navigation)?void 0:n.enabled)&&(null==(h=null==(l=null==(o=c.dom)?void 0:o.baseEl)?void 0:l.querySelector)?void 0:h.call(l,".apexcharts-keyboard-focused"))){const t=u?v:b,e=(g||1)+12,i=A,s=A+f;!isNaN(t)&&f>0&&i<t+e&&s>t-e&&(A=t-f-e,A<0&&(A=t+e))}let k=null;if(u&&f>0){const t=v-A,e=10,i=f-10;k=Math.max(e,Math.min(i,t))}return{x:w,y:A,placement:S,arrowY:k}}applyTooltipPosition(t,e){if(!t)return;const i="true"!==t.dataset.positioned;i&&(t.style.transitionProperty="none"),t.style.left=e.x+"px",t.style.top=e.y+"px",e.placement&&(t.dataset.placement=e.placement),null!=e.arrowY&&t.style.setProperty("--apx-tt-arrow-y",e.arrowY+"px"),null!=e.arrowX&&t.style.setProperty("--apx-tt-arrow-x",e.arrowX+"px"),i&&(t.offsetWidth,t.dataset.positioned="true",requestAnimationFrame(()=>{t.style.transitionProperty=""}))}moveMarkers(t,e){var i;const s=this.w,a=this.ttCtx;if(s.globals.markers.size[t]>0&&!s.globals.markers.batched){const r=s.dom.baseEl.querySelectorAll(` .apexcharts-series[data\\:realIndex='${t}'] .apexcharts-marker`);for(let t=0;t<r.length;t++)parseInt(null!=(i=r[t].getAttribute("rel"))?i:"0",10)===e&&(a.marker.resetPointsSize(),a.marker.enlargeCurrentPoint(e,r[t]))}else a.marker.resetPointsSize(),this.moveDynamicPointOnHover(e,t)}moveDynamicPointOnHover(t,e){var i,s,a,r,n;const o=this.w,l=this.ttCtx;let h=0,c=0;const d=new Dt(this.w),p=o.globals.pointsArray,u=l.tooltipUtil.getHoverMarkerSize(e),g=o.config.series[e].type;if(g&&("column"===g||"candlestick"===g||"boxPlot"===g||"violin"===g))return;h=null==(s=null==(i=p[e])?void 0:i[t])?void 0:s[0],c=(null==(r=null==(a=p[e])?void 0:a[t])?void 0:r[1])||0;const f=o.dom.baseEl.querySelector(`.apexcharts-series[data\\:realIndex='${e}'] .apexcharts-series-markers path`);if(f&&c<o.layout.gridHeight&&c>0){const t=null!=(n=f.getAttribute("shape"))?n:"circle",e=d.getMarkerPath(h,c,t,1.5*u);f.setAttribute("d",e)}this.moveXCrosshairs(h),l.fixedTooltip||this.moveTooltip(h,c,u)}moveDynamicPointsOnHover(t){var e,i;const s=this.ttCtx,a=s.w;let r=0,n=0,o=0;const l=a.globals.pointsArray,h=new Be(this.w),c=new Dt(this.w);o=h.getActiveConfigSeriesIndex("asc",["line","area","scatter","bubble"]);const d=s.tooltipUtil.getHoverMarkerSize(o);if((null==(e=l[o])?void 0:e[t])&&(r=l[o][t][0],n=l[o][t][1]),isNaN(r))return;const p=s.tooltipUtil.getAllMarkers();if(p.length)for(let e=0;e<a.seriesData.series.length;e++){const s=l[e];if(a.globals.comboCharts&&void 0===s&&p.splice(e,0,null),p[e]&&s&&s.length){let s,n=l[e][t][1];p[e].setAttribute("cx",r);const o=null!=(i=p[e].getAttribute("shape"))?i:"circle";if("rangeArea"===a.config.chart.type&&!a.globals.comboCharts){const i=t+a.seriesData.series[e].length;s=l[e][i][1];n-=Math.abs(n-s)/2}if(null!==n&&!isNaN(n)&&n<a.layout.gridHeight+d&&n+d>0){const t=c.getMarkerPath(r,n,o,d);p[e].setAttribute("d",t)}else p[e].setAttribute("d","")}}this.moveXCrosshairs(r),s.fixedTooltip||this.moveTooltip(r,n||a.layout.gridHeight,d)}moveStickyTooltipOverBars(t,e){var i,s,a,r,n;const o=this.w,l=this.ttCtx;let h=o.globals.columnSeries?o.globals.columnSeries.length:o.seriesData.series.length;o.config.chart.stacked&&(h=o.globals.barGroups.length);let c=h>=2&&h%2==0?Math.floor(h/2):Math.floor(h/2)+1;if(o.globals.isBarHorizontal){c=new Be(this.w).getActiveConfigSeriesIndex("desc")+1}let d=o.dom.baseEl.querySelector(`.apexcharts-bar-series .apexcharts-series[rel='${c}'] path[j='${t}'], .apexcharts-candlestick-series .apexcharts-series[rel='${c}'] path[j='${t}'], .apexcharts-boxPlot-series .apexcharts-series[rel='${c}'] path[j='${t}'], .apexcharts-violin-series .apexcharts-series[rel='${c}'] path[j='${t}'], .apexcharts-rangebar-series .apexcharts-series[rel='${c}'] path[j='${t}']`);d||"number"!=typeof e||(d=o.dom.baseEl.querySelector(`.apexcharts-bar-series .apexcharts-series[data\\:realIndex='${e}'] path[j='${t}'],\n        .apexcharts-candlestick-series .apexcharts-series[data\\:realIndex='${e}'] path[j='${t}'],\n        .apexcharts-boxPlot-series .apexcharts-series[data\\:realIndex='${e}'] path[j='${t}'],\n        .apexcharts-violin-series .apexcharts-series[data\\:realIndex='${e}'] path[j='${t}'],\n        .apexcharts-rangebar-series .apexcharts-series[data\\:realIndex='${e}'] path[j='${t}']`));let p=null;const u=o.globals.barCanvasCoords;if(!d&&u&&(p="number"==typeof e&&(null==(i=u[e])?void 0:i[t])||null,!p))for(const e in u)if(null==(s=u[e])?void 0:s[t]){p=u[e][t];break}let g=d?parseFloat(null!=(a=d.getAttribute("cx"))?a:"0"):p?p.cx:0,f=d?parseFloat(null!=(r=d.getAttribute("cy"))?r:"0"):p?p.cy:0;const x=d?parseFloat(null!=(n=d.getAttribute("barWidth"))?n:"0"):p?p.barWidth:0,m=l.getElGrid();if(!m)return;const b=m.getBoundingClientRect(),y=d&&(d.classList.contains("apexcharts-candlestick-area")||d.classList.contains("apexcharts-boxPlot-area"));if(o.axisFlags.isXNumeric){if(d&&!y){const e=this._datapointCenterXFromBars(t);null!=e?g=e:g-=h%2!=0?x/2:0}d&&y&&(g-=x/2)}else o.globals.isBarHorizontal||p||(g=l.xAxisTicksPositions[t-1]+l.dataPointsDividedWidth/2,isNaN(g)&&(g=l.xAxisTicksPositions[t]-l.dataPointsDividedWidth/2));if(o.globals.isBarHorizontal?f-=l.tooltipRect.ttHeight:o.config.tooltip.followCursor?f=l.e.clientY-b.top-l.tooltipRect.ttHeight/2:f+l.tooltipRect.ttHeight+15>o.layout.gridHeight&&(f=o.layout.gridHeight),o.globals.isBarHorizontal||this.moveXCrosshairs(g),!l.fixedTooltip){if(o.globals.isBarHorizontal&&!o.config.tooltip.followCursor){if(this.placeHorizontalSharedTooltip(t))return}this.moveTooltip(g,f||o.layout.gridHeight)}}_datapointCenterXFromBars(t){var e,i;const s=this.w,a=s.dom.baseEl.querySelectorAll(`.apexcharts-bar-series path[j='${t}'],.apexcharts-rangebar-series path[j='${t}']`);if(!a.length)return null;let r=1/0,n=-1/0;for(const t of a){const s=t.parentNode;if(null==(i=null==(e=null==s?void 0:s.classList)?void 0:e.contains)?void 0:i.call(e,"apexcharts-series-collapsed"))continue;const a=t.getBoundingClientRect();0===a.width&&0===a.height||(a.left<r&&(r=a.left),a.right>n&&(n=a.right))}return isFinite(r)?Ri.screenXToPlotPx(s,(r+n)/2):null}placeHorizontalSharedTooltip(t){var e,i;const s=this.w,a=this.ttCtx,r=a.getElTooltip();if(!r)return!1;const n=a.getElGrid();if(!n)return!1;const o=n.getBoundingClientRect(),l=s.dom.baseEl.querySelectorAll(`.apexcharts-bar-series path[j='${t}'],.apexcharts-rangebar-series path[j='${t}'],.apexcharts-boxPlot-series path[j='${t}']`);if(!l.length)return!1;let h=1/0,c=-1/0,d=1/0,p=-1/0;for(const t of l){const s=t.parentNode;if(null==(i=null==(e=null==s?void 0:s.classList)?void 0:e.contains)?void 0:i.call(e,"apexcharts-series-collapsed"))continue;const a=t.getBoundingClientRect();0===a.width&&0===a.height||(a.left<h&&(h=a.left),a.right>c&&(c=a.right),a.top<d&&(d=a.top),a.bottom>p&&(p=a.bottom))}if(!isFinite(h))return!1;const u=a.tooltipRect.ttWidth||0,g=a.tooltipRect.ttHeight||0,f=(h+c)/2-o.left+s.layout.translateX,x=d-o.top+s.layout.translateY,m=p-o.top+s.layout.translateY,b=s.layout.translateY,y=s.layout.translateY+s.layout.gridHeight,w=s.layout.translateX,v=s.layout.translateX+s.layout.gridWidth;let A="top",S=x-g-7;if(S<b){const t=m+7;t+g<=y&&(A="bottom",S=t)}let C=f-u/2;C<w&&(C=w),C+u>v&&(C=v-u);const k=Math.max(10,Math.min(u-10,f-C));return this.applyTooltipPosition(r,{x:C,y:S,placement:A,arrowY:null,arrowX:k}),!0}}function Ni(t){const e=t=>`<svg viewBox="0 0 12 12" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">${t}</svg>`;switch(t){case"square":case"rect":return e('<rect x="1" y="1" width="10" height="10" rx="1" fill="currentColor"/>');case"line":return e('<rect x="0" y="5" width="12" height="2" rx="1" fill="currentColor"/>');case"diamond":return e('<path d="M6 0.5 L11.5 6 L6 11.5 L0.5 6 Z" fill="currentColor"/>');case"triangle":return e('<path d="M6 1 L11.2 10.5 L0.8 10.5 Z" fill="currentColor"/>');case"cross":return e('<path d="M2 2 L10 10 M10 2 L2 10" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>');case"plus":return e('<path d="M6 1 L6 11 M1 6 L11 6" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>');case"star":return e('<path d="M6 0.5 L7.5 4.4 L11.5 4.7 L8.4 7.2 L9.5 11.1 L6 8.9 L2.5 11.1 L3.6 7.2 L0.5 4.7 L4.5 4.4 Z" fill="currentColor"/>');case"sparkle":return e('<path d="M6 0.5 L7 5 L11.5 6 L7 7 L6 11.5 L5 7 L0.5 6 L5 5 Z" fill="currentColor"/>');default:return e('<circle cx="6" cy="6" r="5" fill="currentColor"/>')}}class Yi{constructor(t){this.w=t.w,this.ttCtx=t,this.ctx=t.ctx,this.tooltipPosition=new Bi(t)}drawDynamicPoints(){const t=this.w,e=new Dt(this.w),i=new Ft(this.w,this.ctx),s=[...t.dom.baseEl.querySelectorAll(".apexcharts-series")];t.config.chart.stacked&&s.sort((t,e)=>parseFloat(t.getAttribute("data:realIndex"))-parseFloat(e.getAttribute("data:realIndex")));for(let a=0;a<s.length;a++){const r=s[a].querySelector(".apexcharts-series-markers-wrap");if(null!==r){let s=`apexcharts-marker w${(Math.random()+1).toString(36).substring(4)}`;Ft.markersAreInert(t)&&(s+=" no-pointer-events");const a=i.getMarkerConfig({cssClass:s,seriesIndex:Number(r.getAttribute("data:realIndex"))}),n=e.drawMarker(0,0,a);n.node.setAttribute("default-marker-size",0);const o=b.createElementNS($,"g");o.classList.add("apexcharts-series-markers"),o.appendChild(n.node),r.appendChild(o)}}}enlargeCurrentPoint(t,e,i=null,s=null){const a=this.w;let r=a.config.markers.hover.size;"bubble"!==a.config.chart.type&&(r=this.newPointSize(t,e));let n=e.getAttribute("cx"),o=e.getAttribute("cy");if(null!==i&&null!==s&&(n=i,o=s),this.tooltipPosition.moveXCrosshairs(n),!this.fixedTooltip){if("radar"===a.config.chart.type){const t=this.ttCtx.getElGrid();if(!t)return;const e=t.getBoundingClientRect();n=this.ttCtx.e.clientX-e.left}this.tooltipPosition.moveTooltip(n,o,r)}}enlargePoints(t){var e,i;const s=this.w,a=this,r=this.ttCtx,n=t,o=s.dom.baseEl.querySelectorAll(".apexcharts-series:not(.apexcharts-series-collapsed) .apexcharts-marker");let l=s.config.markers.hover.size;for(let t=0;t<o.length;t++){const h=o[t].getAttribute("rel"),c=o[t].getAttribute("index");if(void 0===l&&(l=s.globals.markers.size[c]+s.config.markers.hover.sizeOffset),n===parseInt(null!=h?h:"0",10)){a.newPointSize(n,o[t]);const s=null!=(e=o[t].getAttribute("cx"))?e:"0",h=null!=(i=o[t].getAttribute("cy"))?i:"0";a.tooltipPosition.moveXCrosshairs(parseFloat(s)),r.fixedTooltip||a.tooltipPosition.moveTooltip(parseFloat(s),parseFloat(h),l)}else a.oldPointSize(o[t])}}newPointSize(t,e){const i=this.w;let s=i.config.markers.hover.size;const a=0===t?e.parentNode.firstChild:e.parentNode.lastChild;if("0"!==a.getAttribute("default-marker-size")){const t=parseInt(a.getAttribute("index"),10);void 0===s&&(s=i.globals.markers.size[t]+i.config.markers.hover.sizeOffset),s<0&&(s=0);const r=this.ttCtx.tooltipUtil.getPathFromPoint(e,s);return e.setAttribute("d",r),s}}oldPointSize(t){const e=parseFloat(t.getAttribute("default-marker-size")),i=this.ttCtx.tooltipUtil.getPathFromPoint(t,e);t.setAttribute("d",i)}resetPointsSize(){var t;const e=this.w.dom.baseEl.querySelectorAll(".apexcharts-series:not(.apexcharts-series-collapsed) .apexcharts-marker");for(let i=0;i<e.length;i++){const s=parseFloat(null!=(t=e[i].getAttribute("default-marker-size"))?t:"0");if(v.isNumber(s)&&s>0){const t=this.ttCtx.tooltipUtil.getPathFromPoint(e[i],s);e[i].setAttribute("d",t)}else e[i].setAttribute("d","M0,0")}}}class Oi{constructor(t){this.w=t.w;const e=this.w;this.ttCtx=t,this.isVerticalGroupedRangeBar=!e.globals.isBarHorizontal&&"rangeBar"===e.config.chart.type&&e.config.plotOptions.bar.rangeBarGroupRows}getAttr(t,e){var i;return parseFloat(null!=(i=Xi.hoverTarget(t).getAttribute(e))?i:"")}handleHeatTreeTooltip({e:t,opt:e,x:i,y:s,type:a}){var r,n;const o=this.ttCtx,l=this.w,h=l.globals.activeRenderer,c="heatmap"===a&&h&&"canvas"===h.kind&&"function"==typeof h.hitTest,d=Xi.hoverTarget(t);let p,u,g,f,x,m;if(c){const a=e.elGrid.getBoundingClientRect(),r="touchmove"===t.type?t.touches[0].clientX:t.clientX,n="touchmove"===t.type?t.touches[0].clientY:t.clientY,o=h.hitTest(r-a.left,n-a.top);if(!o)return{x:i,y:s,noHit:!0};p=o.seriesIndex,u=o.dataPointIndex,g=o.x,f=o.y,x=o.width,m=o.height}else{if(!d.classList.contains(`apexcharts-${a}-rect`))return{x:i,y:s};p=this.getAttr(t,"i"),u=this.getAttr(t,"j"),g=this.getAttr(t,"cx"),f=this.getAttr(t,"cy"),x=this.getAttr(t,"width"),m=this.getAttr(t,"height")}o.tooltipLabels.drawSeriesTexts({ttItems:e.ttItems,i:p,j:u,shared:!1,e:t}),l.interact.capturedSeriesIndex=p,l.interact.capturedDataPointIndex=u,o.tooltipPosition.moveXCrosshairs(g+x/2);const b=o.getElTooltip();if("heatmap"===a&&l.config.tooltip.arrow&&!l.config.tooltip.followCursor&&b){const t=e.elGrid.getBoundingClientRect(),i=l.dom.elWrap.getBoundingClientRect(),s=t.left-i.left;let a,r,n,h;if(c)a=g,r=f,n=g+x,h=f+m;else{const e=d.getBoundingClientRect();a=e.left-t.left,r=e.top-t.top,n=e.right-t.left,h=e.bottom-t.top}const p=o.tooltipRect.ttWidth||0,u=o.tooltipRect.ttHeight||0,y=(a+n)/2+s,w=r+l.layout.translateY,v=h+l.layout.translateY,A=l.layout.translateY,S=l.layout.translateY+l.layout.gridHeight,C=s,k=s+l.layout.gridWidth;let _="top",M=w-u-7;if(M<A){const t=v+7;t+u<=S?(_="bottom",M=t):M=A}let D=y-p/2;D<C&&(D=C),D+p>k&&(D=k-p);const L=Math.max(10,Math.min(p-10,y-D));return o.tooltipPosition.applyTooltipPosition(b,{x:D,y:M,placement:_,arrowY:null,arrowX:L}),{x:D,y:M,positioned:!0}}if(i=g+o.tooltipRect.ttWidth/2+x,s=f+o.tooltipRect.ttHeight/2-m/2,i>l.layout.gridWidth/2&&(i=g-o.tooltipRect.ttWidth/2+x),o.w.config.tooltip.followCursor){const t=l.dom.elWrap.getBoundingClientRect();i=(null!=(r=l.interact.clientX)?r:0)-t.left-(i>l.layout.gridWidth/2?o.tooltipRect.ttWidth:0),s=(null!=(n=l.interact.clientY)?n:0)-t.top-(s>l.layout.gridHeight/2?o.tooltipRect.ttHeight:0)}return{x:i,y:s}}handleMarkerTooltip({e:t,opt:e,x:i,y:s}){const a=this.w,r=this.ttCtx;let n,o;if(Xi.hoverTarget(t).classList.contains("apexcharts-marker")){const l=parseInt(e.paths.getAttribute("cx"),10),h=parseInt(e.paths.getAttribute("cy"),10),c=parseFloat(e.paths.getAttribute("val"));if(o=parseInt(e.paths.getAttribute("rel"),10),n=parseInt(e.paths.parentNode.parentNode.parentNode.getAttribute("rel"),10)-1,r.intersect){const t=v.findAncestor(e.paths,"apexcharts-series");t&&(n=parseInt(t.getAttribute("data:realIndex"),10))}r.tooltipLabels.drawSeriesTexts({ttItems:e.ttItems,i:n,j:o,shared:!r.showOnIntersect&&a.config.tooltip.shared,e:t}),"mouseup"===t.type&&r.markerClick(t,n,o),a.interact.capturedSeriesIndex=n,a.interact.capturedDataPointIndex=o;if(i=l,!!a.config.tooltip.arrow?s=h:(s=h+a.layout.translateY-1.4*r.tooltipRect.ttHeight,c<0&&(s=h)),r.w.config.tooltip.followCursor){const t=r.getElGrid();if(!t)return{x:i,y:s};const e=t.getBoundingClientRect();s=r.e.clientY+a.layout.translateY-e.top}r.marker.enlargeCurrentPoint(o,e.paths,i,s)}return{x:i,y:s}}handleBarTooltip({e:t,opt:e}){var i,s,a;const r=this.w,n=this.ttCtx,o=n.getElTooltip();let l,h=0,c=0,d=0,p=0;const u=this.getBarTooltipXY({e:t,opt:e});if(null===u.j&&0===u.barHeight&&0===u.barWidth)return;p=u.i;const g=u.j;if(r.interact.capturedSeriesIndex=p,r.interact.capturedDataPointIndex=null!==g?g:r.interact.capturedDataPointIndex,r.globals.isBarHorizontal&&n.tooltipUtil.hasBars()||!r.config.tooltip.shared?(c=u.x,d=u.y,l=Array.isArray(r.config.stroke.width)?r.config.stroke.width[p]:r.config.stroke.width,h=c):r.globals.comboCharts||r.config.tooltip.shared||(h/=2),isNaN(d)&&(d=r.globals.svgHeight-n.tooltipRect.ttHeight),c+n.tooltipRect.ttWidth>r.layout.gridWidth?c-=n.tooltipRect.ttWidth:c<0&&(c=0),n.w.config.tooltip.followCursor){if(!n.getElGrid())return}if(null===n.tooltip&&(n.tooltip=r.dom.baseEl.querySelector(".apexcharts-tooltip:not(.apexcharts-annotation-tooltip)")),r.config.tooltip.shared||(r.globals.comboBarCount>0?n.tooltipPosition.moveXCrosshairs(h+l/2):n.tooltipPosition.moveXCrosshairs(h)),!n.fixedTooltip&&(!r.config.tooltip.shared||r.globals.isBarHorizontal&&n.tooltipUtil.hasBars())&&(d=d+r.layout.translateY-n.tooltipRect.ttHeight/2,o)){const t=n.tooltipRect.ttWidth||0,e=n.tooltipRect.ttHeight||0,l=!!r.config.tooltip.arrow,{barAnchorXInGrid:h,barAnchorYInGrid:p,barRectInGrid:g}=u,f=null==(i=n.getElGrid())?void 0:i.getBoundingClientRect(),x=r.dom.elWrap.getBoundingClientRect(),m=f?f.left-x.left:r.layout.translateX;let b,y=null,w=null,v=c+m,A=d;if(l&&r.globals.isBarHorizontal&&null!=g){const i=r.layout.translateY,s=r.layout.translateY+r.layout.gridHeight,a=m,n=m+r.layout.gridWidth,o=(g.left+g.right)/2+m,l=g.top+r.layout.translateY,h=g.bottom+r.layout.translateY;let c=l-e-7;if(b="top",c<i){const t=h+7;t+e<=s&&(b="bottom",c=t)}A=c,v=o-t/2,v<a&&(v=a),v+t>n&&(v=n-t),w=Math.max(10,Math.min(t-10,o-v))}else if(l&&null!=h&&null!=p){const i=h+m,n=m+r.layout.gridWidth/2,o=(null!=(s=null==g?void 0:g.left)?s:h)+m,l=(null!=(a=null==g?void 0:g.right)?a:h)+m;if(i<n?(b="right",v=l+7):(b="left",v=o-t-7),g){A=(g.top+g.bottom)/2+r.layout.translateY-e/2;const t=r.layout.translateY,i=r.layout.translateY+r.layout.gridHeight;A<t&&(A=t),A+e>i&&(A=i-e)}if(e>0&&g){const t=(g.top+g.bottom)/2+r.layout.translateY;y=Math.max(10,Math.min(e-10,t-A))}}n.tooltipPosition.applyTooltipPosition(o,{x:v,y:A,placement:b,arrowY:y,arrowX:w})}}getBarTooltipXY({e:t,opt:e}){const i=this.w;let s=null;const a=this.ttCtx;let r=0,n=0,o=0,l=0,h=0,c=null,d=null,p=null,u=null,g=null;const f=Xi.hoverTarget(t),x=f.classList;if(x.contains("apexcharts-bar-area")||x.contains("apexcharts-candlestick-area")||x.contains("apexcharts-boxPlot-area")||x.contains("apexcharts-rangebar-area")){const x=f,m=x.getBoundingClientRect(),b=e.elGrid.getBoundingClientRect(),y=m.height;h=m.height;const w=m.width,v=parseInt(x.getAttribute("cx"),10),A=parseInt(x.getAttribute("cy"),10);c=v,d=A,l=parseFloat(x.getAttribute("barWidth"));const S=m.left-b.left,C=m.top-b.top,k=C+y/2;p=S+w/2,u=i.globals.isBarHorizontal?k:C,g={left:S,top:C,right:S+w,bottom:C+y};const _="touchmove"===t.type?t.touches[0].clientX:t.clientX;s=parseInt(x.getAttribute("j"),10),r=parseInt(x.parentNode.getAttribute("rel"),10)-1;const M=x.getAttribute("data-range-y1"),D=x.getAttribute("data-range-y2");i.globals.comboCharts&&(r=parseInt(x.parentNode.getAttribute("data:realIndex"),10));const L=t=>i.axisFlags.isXNumeric?v-w/2:this.isVerticalGroupedRangeBar?v+w/2:v-a.dataPointsDividedWidth+w/2,P=()=>A-a.dataPointsDividedHeight+y/2-a.tooltipRect.ttHeight/2;a.tooltipLabels.drawSeriesTexts({ttItems:e.ttItems,i:r,j:s,y1:M?parseInt(M,10):null,y2:D?parseInt(D,10):null,shared:!a.showOnIntersect&&i.config.tooltip.shared,e:t}),i.config.tooltip.followCursor?i.globals.isBarHorizontal?(n=_-b.left+15,o=P()):(n=L(n),o=t.clientY-b.top-a.tooltipRect.ttHeight/2-15):i.globals.isBarHorizontal?(n=v,a.xyRatios&&n<a.xyRatios.baseLineInvertedY&&(n=v-a.tooltipRect.ttWidth),o=P()):(n=L(n),o=A)}return{x:n,y:o,barHeight:h,barWidth:l,i:r,j:s,barCx:c,barCy:d,barAnchorXInGrid:p,barAnchorYInGrid:u,barRectInGrid:g}}}class Wi{constructor(t){this.w=t.w,this.ttCtx=t}drawXaxisTooltip(){const t=this.w,e=this.ttCtx,i="bottom"===t.config.xaxis.position;e.xaxisOffY=i?t.layout.gridHeight+1:-t.layout.xAxisHeight-t.config.xaxis.axisTicks.height+3;const s=i?"apexcharts-xaxistooltip apexcharts-xaxistooltip-bottom":"apexcharts-xaxistooltip apexcharts-xaxistooltip-top",a=t.dom.elWrap;if(e.isXAxisTooltipEnabled){null===t.dom.baseEl.querySelector(".apexcharts-xaxistooltip")&&(e.xaxisTooltip=b.createElementNS("http://www.w3.org/1999/xhtml","div"),e.xaxisTooltip.setAttribute("class",s+" apexcharts-theme-"+t.config.tooltip.theme),a.appendChild(e.xaxisTooltip),e.xaxisTooltipText=b.createElementNS("http://www.w3.org/1999/xhtml","div"),e.xaxisTooltipText.classList.add("apexcharts-xaxistooltip-text"),e.xaxisTooltipText.style.fontFamily=t.config.xaxis.tooltip.style.fontFamily||t.config.chart.fontFamily,e.xaxisTooltipText.style.fontSize=t.config.xaxis.tooltip.style.fontSize,e.xaxisTooltip.appendChild(e.xaxisTooltipText))}}drawYaxisTooltip(){const t=this.w,e=this.ttCtx;for(let i=0;i<t.config.yaxis.length;i++){const s=t.config.yaxis[i].opposite||t.config.yaxis[i].crosshairs.opposite;e.yaxisOffX=s?t.layout.gridWidth+1:1;const a=s?`apexcharts-yaxistooltip apexcharts-yaxistooltip-${i} apexcharts-yaxistooltip-right`:`apexcharts-yaxistooltip apexcharts-yaxistooltip-${i} apexcharts-yaxistooltip-left`,r=t.dom.elWrap;null===t.dom.baseEl.querySelector(`.apexcharts-yaxistooltip.apexcharts-yaxistooltip-${i}`)&&(e.yaxisTooltip=b.createElementNS("http://www.w3.org/1999/xhtml","div"),e.yaxisTooltip.setAttribute("class",a+" apexcharts-theme-"+t.config.tooltip.theme),r.appendChild(e.yaxisTooltip),0===i&&(e.yaxisTooltipText=[]),e.yaxisTooltipText[i]=b.createElementNS("http://www.w3.org/1999/xhtml","div"),e.yaxisTooltipText[i].classList.add("apexcharts-yaxistooltip-text"),e.yaxisTooltip.appendChild(e.yaxisTooltipText[i]))}}setXCrosshairWidth(){var t,e;const i=this.w,s=this.ttCtx,a=s.getElXCrosshairs();if(s.xcrosshairsWidth=parseInt(i.config.xaxis.crosshairs.width,10),i.globals.comboCharts){const t=i.dom.baseEl.querySelector(".apexcharts-bar-area");if(null!==t&&"barWidth"===i.config.xaxis.crosshairs.width){const i=parseFloat(null!=(e=t.getAttribute("barWidth"))?e:"0");s.xcrosshairsWidth=i}else if("tickWidth"===i.config.xaxis.crosshairs.width){const t=i.labelData.labels.length;s.xcrosshairsWidth=i.layout.gridWidth/t}}else if("tickWidth"===i.config.xaxis.crosshairs.width){const t=i.labelData.labels.length;s.xcrosshairsWidth=i.layout.gridWidth/t}else if("barWidth"===i.config.xaxis.crosshairs.width){const e=i.dom.baseEl.querySelector(".apexcharts-bar-area");if(null!==e){const i=parseFloat(null!=(t=e.getAttribute("barWidth"))?t:"0");s.xcrosshairsWidth=i}else s.xcrosshairsWidth=1}i.globals.isBarHorizontal&&(s.xcrosshairsWidth=0),null!==a&&s.xcrosshairsWidth>0&&a.setAttribute("width",String(s.xcrosshairsWidth))}handleYCrosshair(){const t=this.w,e=this.ttCtx;e.ycrosshairs=t.dom.baseEl.querySelector(".apexcharts-ycrosshairs"),e.ycrosshairsHidden=t.dom.baseEl.querySelector(".apexcharts-ycrosshairs-hidden")}drawYaxisTooltipText(t,e,i){const s=this.ttCtx,a=this.w,r=a.globals,n=r.seriesYAxisMap[t];if(s.yaxisTooltips[t]&&n.length>0){const o=a.formatters.yLabelFormatters[t],l=s.getElGrid();if(!l)return;const h=l.getBoundingClientRect(),c=n[0];let d=0;i.yRatio.length>1&&(d=c);const p=(e-h.top)*i.yRatio[d],u=r.maxYArr[c]-r.minYArr[c];let g=r.minYArr[c]+(u-p);a.config.yaxis[t].reversed&&(g=r.maxYArr[c]-(u-p)),s.tooltipPosition.moveYCrosshairs(e-h.top),s.yaxisTooltipText[t].innerHTML=o(g),s.tooltipPosition.moveYAxisTooltip(t)}}}class Hi{constructor(t,e){this.w=t,this.ctx=e,this.tConfig=t.config.tooltip,this.tooltipUtil=new Xi(this),this.tooltipLabels=new zi(this),this.tooltipPosition=new Bi(this),this.marker=new Yi(this),this.intersect=new Oi(this),this.axesTooltip=new Wi(this),this.showOnIntersect=this.tConfig.intersect,this.showTooltipTitle=this.tConfig.x.show,this.fixedTooltip=this.tConfig.fixed.enabled,this.xaxisTooltip=null,this.xaxisTooltipText=null,this.yaxisTooltip=null,this.yaxisTooltipText=null,this.yaxisTTEls=null,this.xaxisOffY=0,this.yaxisOffX=0,this.xcrosshairsWidth=0,this.ycrosshairs=null,this.ycrosshairsHidden=null,this.tooltip=null,this.e=null,this.isBarShared=!t.globals.isBarHorizontal&&this.tConfig.shared,this.lastHoverTime=Date.now(),this.dimensionUpdateScheduled=!1,this.xyRatios=null,this.isXAxisTooltipEnabled=!1,this.yaxisTooltips=[],this.allTooltipSeriesGroups=[],this.xAxisTicksPositions=null,this.dataPointsDividedHeight=0,this.dataPointsDividedWidth=0,this.tooltipTitle=null,this.legendLabels=null,this.ttItems=null,this.seriesBound=null,this.seriesHoverTimeout=void 0,this.clientX=0,this.clientY=0,this.barSeriesHeight=0,this.tooltipRect={x:0,y:0,ttWidth:0,ttHeight:0}}setupDimensionCache(){const t=this.w,e=this.getElTooltip();e&&(this.updateDimensionCache(),"undefined"==typeof ResizeObserver||t.globals.resizeObserver||(t.globals.resizeObserver=new ResizeObserver(()=>{this.dimensionUpdateScheduled||(this.dimensionUpdateScheduled=!0,requestAnimationFrame(()=>{this.updateDimensionCache(),this.dimensionUpdateScheduled=!1}))}),t.globals.resizeObserver.observe(e)))}updateDimensionCache(){const t=this.w,e=this.getElTooltip();if(!e)return;const i=e.getBoundingClientRect();t.globals.dimensionCache.tooltip={width:i.width,height:i.height,lastUpdate:Date.now()}}getCachedDimensions(){const t=this.w;if(t.globals.dimensionCache.tooltip){const e=t.globals.dimensionCache.tooltip;if(Date.now()-e.lastUpdate<1e3)return{ttWidth:e.width,ttHeight:e.height}}this.updateDimensionCache();const e=t.globals.dimensionCache.tooltip;return e?{ttWidth:e.width,ttHeight:e.height}:{ttWidth:0,ttHeight:0}}getElTooltip(t){return t||(t=this),t.w.dom.baseEl?t.w.dom.baseEl.querySelector(".apexcharts-tooltip:not(.apexcharts-annotation-tooltip)"):null}getElXCrosshairs(){return this.w.dom.baseEl.querySelector(".apexcharts-xcrosshairs")}getElGrid(){return this.w.dom.baseEl.querySelector(".apexcharts-grid")}drawTooltip(t){const e=this.w;this.xyRatios=t,this.isXAxisTooltipEnabled=e.config.xaxis.tooltip.enabled&&e.globals.axisCharts,this.yaxisTooltips=e.config.yaxis.map(t=>!!(t.show&&t.tooltip.enabled&&e.globals.axisCharts)),this.allTooltipSeriesGroups=[],e.globals.axisCharts||(this.showTooltipTitle=!1);const i=this.getElTooltip();(null==i?void 0:i.parentNode)&&i.parentNode.removeChild(i),this.tooltipTitle=null;const s=b.createElementNS("http://www.w3.org/1999/xhtml","div");s.classList.add("apexcharts-tooltip"),e.config.tooltip.cssClass&&s.classList.add(e.config.tooltip.cssClass),s.classList.add(`apexcharts-theme-${this.tConfig.theme||"light"}`),this.tConfig.fillSeriesColor&&s.classList.add("apexcharts-tooltip-fill-series"),this.tConfig.compact&&(s.classList.add("apexcharts-tooltip-compact"),1===e.config.series.length&&s.classList.add("apexcharts-tooltip-value-only")),this.tConfig.style&&this.tConfig.style.background&&s.style.setProperty("--apx-tt-bg",this.tConfig.style.background);const a=this.tConfig.shared&&e.config.series.length>1&&!e.globals.isBarHorizontal&&"heatmap"!==e.config.chart.type;if(this.tConfig.arrow&&!this.tConfig.followCursor&&!this.tConfig.fixed.enabled&&!a&&!this.tConfig.fillSeriesColor&&e.globals.axisCharts){const t=b.createElementNS("http://www.w3.org/1999/xhtml","div");t.classList.add("apexcharts-tooltip-arrow"),s.appendChild(t)}if(e.config.chart.accessibility.enabled&&e.config.chart.accessibility.announcements.enabled&&(s.setAttribute("role","tooltip"),s.setAttribute("aria-live","polite"),s.setAttribute("aria-atomic","true"),s.setAttribute("aria-hidden","true")),e.dom.elWrap.appendChild(s),e.globals.axisCharts){this.axesTooltip.drawXaxisTooltip(),this.axesTooltip.drawYaxisTooltip(),this.axesTooltip.setXCrosshairWidth(),this.axesTooltip.handleYCrosshair();const t=new Nt(this.w,this.ctx,void 0);this.xAxisTicksPositions=t.getXAxisTicksPositions()}if(!e.globals.comboCharts&&!this.tConfig.intersect&&"rangeBar"!==e.config.chart.type||this.tConfig.shared||(this.showOnIntersect=!0),(0===e.config.markers.size||0===e.globals.markers.largestSize||e.globals.markers.batched)&&this.marker.drawDynamicPoints(),e.globals.collapsedSeries.length===e.seriesData.series.length)return;this.dataPointsDividedHeight=e.layout.gridHeight/e.globals.dataPoints,this.dataPointsDividedWidth=e.layout.gridWidth/e.globals.dataPoints,this.showTooltipTitle&&(this.tooltipTitle=b.createElementNS("http://www.w3.org/1999/xhtml","div"),this.tooltipTitle.classList.add("apexcharts-tooltip-title"),this.tooltipTitle.style.fontFamily=this.tConfig.style.fontFamily||e.config.chart.fontFamily,this.tooltipTitle.style.fontSize=this.tConfig.style.fontSize,s.appendChild(this.tooltipTitle));let r=e.seriesData.series.length;(e.globals.xyCharts||e.globals.comboCharts)&&this.tConfig.shared&&(r=this.showOnIntersect?1:e.seriesData.series.length),this.legendLabels=e.dom.baseEl.querySelectorAll(".apexcharts-legend-text"),this.ttItems=this.createTTElements(r),this.addSVGEvents(),this.setupDimensionCache()}createTTElements(t){const e=this.w,i=[],s=this.getElTooltip();if(!s)return i;for(let a=0;a<t;a++){const r=b.createElementNS("http://www.w3.org/1999/xhtml","div");r.classList.add("apexcharts-tooltip-series-group",`apexcharts-tooltip-series-group-${a}`),r.style.order=String(e.config.tooltip.inverseOrder?t-a:a+1);const n=b.createElementNS("http://www.w3.org/1999/xhtml","span");n.classList.add("apexcharts-tooltip-marker"),e.config.tooltip.fillSeriesColor?n.style.backgroundColor=e.globals.colors[a]:n.style.color=e.globals.colors[a];const o=e.config.markers.shape;let l=o;Array.isArray(o)&&(l=o[a]),n.setAttribute("shape",l),n.innerHTML=Ni(l),r.appendChild(n);const h=b.createElementNS("http://www.w3.org/1999/xhtml","div");h.classList.add("apexcharts-tooltip-text"),h.style.fontFamily=this.tConfig.style.fontFamily||e.config.chart.fontFamily,h.style.fontSize=this.tConfig.style.fontSize,["y","goals","z"].forEach(t=>{const e=b.createElementNS("http://www.w3.org/1999/xhtml","div");e.classList.add(`apexcharts-tooltip-${t}-group`);const i=b.createElementNS("http://www.w3.org/1999/xhtml","span");i.classList.add(`apexcharts-tooltip-text-${t}-label`),e.appendChild(i);const s=b.createElementNS("http://www.w3.org/1999/xhtml","span");s.classList.add(`apexcharts-tooltip-text-${t}-value`),e.appendChild(s),h.appendChild(e)}),r.appendChild(h),s.appendChild(r),i.push(r)}return i}addSVGEvents(){const t=this.w,e=t.config.chart.type,i=this.getElTooltip();if(!i)return;const s=!("bar"!==e&&"candlestick"!==e&&"boxPlot"!==e&&"violin"!==e&&"rangeBar"!==e),a="area"===e||"line"===e||"scatter"===e||"bubble"===e||"radar"===e,r=a&&!t.globals.xyCharts,n=t.dom.Paper.node,o=this.getElGrid();o&&(this.seriesBound=o.getBoundingClientRect());const l=[],h=[],c={hoverArea:n,elGrid:o,tooltipEl:i,tooltipY:l,tooltipX:h,ttItems:this.ttItems};let d;if(t.globals.axisCharts&&(a?d=t.dom.baseEl.querySelectorAll(".apexcharts-series[data\\:longestSeries='true'] .apexcharts-marker"):s?d=t.dom.baseEl.querySelectorAll(".apexcharts-series .apexcharts-bar-area, .apexcharts-series .apexcharts-candlestick-area, .apexcharts-series .apexcharts-boxPlot-area, .apexcharts-series .apexcharts-violin-area, .apexcharts-series .apexcharts-rangebar-area"):"heatmap"!==e&&"treemap"!==e||(d=t.dom.baseEl.querySelectorAll(".apexcharts-series .apexcharts-heatmap, .apexcharts-series .apexcharts-treemap")),d&&d.length))for(let t=0;t<d.length;t++)l.push(d[t].getAttribute("cy")),h.push(d[t].getAttribute("cx"));if(t.globals.xyCharts&&!this.showOnIntersect||t.globals.comboCharts&&!this.showOnIntersect||s&&this.tooltipUtil.hasBars()&&this.tConfig.shared)this.addPathsEventListeners([n],c);else if(s&&!t.globals.comboCharts||a&&this.showOnIntersect||r)this.addDatapointEventsListeners(c);else if("heatmap"===e&&t.globals.activeRenderer&&"canvas"===t.globals.activeRenderer.kind)this.addPathsEventListeners([n],c);else if(!t.globals.axisCharts||"heatmap"===e||"treemap"===e){const e=t.dom.baseEl.querySelectorAll(".apexcharts-series");this.addPathsEventListeners(e,c)}if(this.showOnIntersect){const e=t.dom.baseEl.querySelectorAll(".apexcharts-line-series .apexcharts-marker, .apexcharts-area-series .apexcharts-marker");e.length>0&&this.addPathsEventListeners(e,c),this.tooltipUtil.hasBars()&&!this.tConfig.shared&&this.addDatapointEventsListeners(c)}}drawFixedTooltipRect(){const t=this.w,e=this.getElTooltip();if(!e)return{x:0,y:0,ttWidth:0,ttHeight:0};const i=e.getBoundingClientRect(),s=i.width+10,a=i.height+10;let r=this.tConfig.fixed.offsetX,n=this.tConfig.fixed.offsetY;const o=this.tConfig.fixed.position.toLowerCase();return o.indexOf("right")>-1&&(r=r+t.globals.svgWidth-s+10),o.indexOf("bottom")>-1&&(n=n+t.globals.svgHeight-a-10),this.tooltipPosition.applyTooltipPosition(e,{x:r,y:n}),{x:r,y:n,ttWidth:s,ttHeight:a}}addDatapointEventsListeners(t){const e=this.w.dom.baseEl.querySelectorAll(".apexcharts-series-markers .apexcharts-marker, .apexcharts-bar-area, .apexcharts-candlestick-area, .apexcharts-boxPlot-area, .apexcharts-rangebar-area");this.addPathsEventListeners(e,t)}addPathsEventListeners(t,e){const i=this;for(let s=0;s<t.length;s++){const a={paths:t[s],tooltipEl:e.tooltipEl,tooltipY:e.tooltipY,tooltipX:e.tooltipX,elGrid:e.elGrid,hoverArea:e.hoverArea,ttItems:e.ttItems};["mousemove","mouseup","touchmove","mouseout","touchend"].map(e=>t[s].addEventListener(e,i.onSeriesHover.bind(i,a),{capture:!1,passive:!0}))}}onSeriesHover(t,e){Xi.hoverTarget(e);const i=Date.now()-this.lastHoverTime;i>=20?this.seriesHover(t,e):(clearTimeout(this.seriesHoverTimeout),this.seriesHoverTimeout=setTimeout(()=>{this.seriesHover(t,e)},20-i))}seriesHover(t,e){if(this.w.globals.isDestroyed)return;this.lastHoverTime=Date.now();let i=[];const s=this.w,a=t=>{var e,i,s;const a=null==(s=null==(i=null==(e=null==t?void 0:t.w)?void 0:e.config)?void 0:i.chart)?void 0:s.link;return!(!a||"function"!=typeof a.dimension)};s.config.chart.group&&!a(this.ctx)&&(i=this.ctx.getSyncedCharts().filter(t=>!a(t))),s.globals.axisCharts&&(s.globals.minX===-1/0&&s.globals.maxX===1/0||0===s.globals.dataPoints)||(i.length?i.forEach(i=>{const s=this.getElTooltip(i),a={paths:t.paths,tooltipEl:s,tooltipY:t.tooltipY,tooltipX:t.tooltipX,elGrid:t.elGrid,hoverArea:t.hoverArea,ttItems:i.w.globals.tooltip.ttItems};i.w.globals.minX===this.w.globals.minX&&i.w.globals.maxX===this.w.globals.maxX&&i.w.globals.tooltip.seriesHoverByContext({chartCtx:i,ttCtx:i.w.globals.tooltip,opt:a,e:e})}):this.seriesHoverByContext({chartCtx:this.ctx,ttCtx:this.w.globals.tooltip,opt:t,e:e}))}seriesHoverByContext({chartCtx:t,ttCtx:e,opt:i,e:s}){var a;const r=t.w;if(!this.getElTooltip(t))return;const n=e.getCachedDimensions();if(e.tooltipRect={x:0,y:0,ttWidth:n.ttWidth,ttHeight:n.ttHeight},e.e=s,e.tooltipUtil.hasBars()&&!r.globals.comboCharts&&!e.isBarShared&&this.tConfig.onDatasetHover.highlightDataSeries){new Be(t.w).toggleSeriesOnHover(s,null==(a=Xi.hoverTarget(s))?void 0:a.parentNode)}r.globals.axisCharts?e.axisChartsTooltips({e:s,opt:i,tooltipRect:e.tooltipRect}):e.nonAxisChartsTooltips({e:s,opt:i,tooltipRect:e.tooltipRect}),e.fixedTooltip&&e.drawFixedTooltipRect()}axisChartsTooltips({e:t,opt:e}){var i;const s=this.w;let a,r;if(!e.elGrid)return;const n=e.elGrid.getBoundingClientRect(),o="touchmove"===t.type?t.touches[0].clientX:t.clientX,l="touchmove"===t.type?t.touches[0].clientY:t.clientY;if(this.clientY=l,this.clientX=o,s.interact.capturedSeriesIndex=-1,s.interact.capturedDataPointIndex=-1,l<n.top||l>n.top+n.height)return void this.handleMouseOut(e);if(s.dom.elWrap.querySelector(".apexcharts-annotation-tooltip.apexcharts-active"))return void this.handleMouseOut(e);if(Array.isArray(this.tConfig.enabledOnSeries)&&!s.config.tooltip.shared){const t=parseInt(e.paths.getAttribute("index"),10);if(this.tConfig.enabledOnSeries.indexOf(t)<0)return void this.handleMouseOut(e)}const h=this.getElTooltip();if(!h)return;const c=this.getElXCrosshairs(),d=["heatmap","treemap"].includes(s.config.chart.type);let p=[];s.config.chart.group&&!d&&(p=this.ctx.getSyncedCharts());const u=s.globals.xyCharts||"bar"===s.config.chart.type&&!s.globals.isBarHorizontal&&this.tooltipUtil.hasBars()&&this.tConfig.shared||s.globals.comboCharts&&this.tooltipUtil.hasBars();if("mousemove"===t.type||"touchmove"===t.type||"mouseup"===t.type){if(s.globals.collapsedSeries.length+s.globals.ancillaryCollapsedSeries.length===s.seriesData.series.length)return;null!==c&&c.classList.add("apexcharts-active");const n=null==(i=this.yaxisTooltips)?void 0:i.filter(t=>!0===t),g=this.ycrosshairs;if(null!==g&&(null==n?void 0:n.length)&&g.classList.add("apexcharts-active"),!d&&(u&&!this.showOnIntersect||p.length>1))this.handleStickyTooltip(t,o,l,e);else if("heatmap"===s.config.chart.type||"treemap"===s.config.chart.type){const i=this.intersect.handleHeatTreeTooltip({e:t,opt:e,x:a,y:r,type:s.config.chart.type});if(i.noHit)return void this.handleMouseOut(e);a=i.x,r=i.y,i.positioned||(h.style.left=a+"px",h.style.top=r+"px")}else this.tooltipUtil.hasBars()&&this.intersect.handleBarTooltip({e:t,opt:e}),this.tooltipUtil.hasMarkers(0)&&this.intersect.handleMarkerTooltip({e:t,opt:e,x:a,y:r});if(this.yaxisTooltips&&this.yaxisTooltips.length)for(let t=0;t<s.config.yaxis.length;t++)this.axesTooltip.drawYaxisTooltipText(t,l,this.xyRatios);s.dom.baseEl.classList.add("apexcharts-tooltip-active"),e.tooltipEl.classList.add("apexcharts-active"),s.config.chart.accessibility.enabled&&s.config.chart.accessibility.announcements.enabled&&e.tooltipEl.removeAttribute("aria-hidden")}else"mouseout"!==t.type&&"touchend"!==t.type||this.handleMouseOut(e)}getSliceAnchor(t){var e,i;const s=this.w,a=parseFloat(null!=(e=null==t?void 0:t.getAttribute("data:cx"))?e:""),r=parseFloat(null!=(i=null==t?void 0:t.getAttribute("data:cy"))?i:"");if(isNaN(a)||isNaN(r))return null;const n=s.dom.elWrap.getBoundingClientRect(),o="function"==typeof t.getScreenCTM?t.getScreenCTM():null;if(!o){const t=s.dom.Paper.node.getBoundingClientRect();return{x:t.left-n.left+a,y:t.top-n.top+r}}return{x:o.a*a+o.c*r+o.e-n.left,y:o.b*a+o.d*r+o.f-n.top}}nonAxisChartsTooltips({e:t,opt:e,tooltipRect:i}){var s,a,r,n;const o=this.w,l=e.paths.getAttribute("rel"),h=this.getElTooltip();if(!h)return;const c=o.dom.elWrap.getBoundingClientRect();if("mousemove"===t.type||"touchmove"===t.type){if(o.dom.baseEl.classList.add("apexcharts-tooltip-active"),h.classList.add("apexcharts-active"),o.config.chart.accessibility.enabled&&o.config.chart.accessibility.announcements.enabled&&h.removeAttribute("aria-hidden"),"unit"===o.config.chart.type){const e=Xi.hoverTarget(t),i=e&&"function"==typeof e.closest?e.closest(".apexcharts-unit-area"):null;if(!i)return;this.renderUnitTooltip(i)}else this.tooltipLabels.drawSeriesTexts({ttItems:e.ttItems,i:parseInt(l,10)-1,shared:!1});let n,d;const p=e.paths.querySelector("path[data\\:cx]")||e.paths,u=o.config.tooltip.intersect?this.getSliceAnchor(p):null;if(u?(n=u.x-i.ttWidth/2,d=u.y-i.ttHeight-10):(n=(null!=(s=o.interact.clientX)?s:0)-c.left-i.ttWidth/2,d=(null!=(a=o.interact.clientY)?a:0)-c.top-i.ttHeight-10),h.style.left=n+"px",h.style.top=d+"px",o.config.legend.tooltipHoverFormatter){const t=o.config.legend.tooltipHoverFormatter,e=l-1,i=null==(r=this.legendLabels)?void 0:r[e];if(!i)return;const s=t(i.getAttribute("data:default-text"),{seriesIndex:e,dataPointIndex:e,w:o});i.innerHTML=s}}else"mouseout"!==t.type&&"touchend"!==t.type||(h.classList.remove("apexcharts-active"),o.dom.baseEl.classList.remove("apexcharts-tooltip-active"),o.config.legend.tooltipHoverFormatter&&(null==(n=this.legendLabels)||n.forEach(t=>{const e=t.getAttribute("data:default-text");t.innerHTML=decodeURIComponent(null!=e?e:"")})))}renderUnitTooltip(t){var e,i,s,a,r;const n=this.w,o=this.getElTooltip();if(!o)return;const l=parseInt(t.getAttribute("i")||"0",10),h=parseInt(t.getAttribute("j")||"0",10);if("function"==typeof n.config.tooltip.custom)return void this.tooltipLabels.handleCustomTooltip({i:l,j:h,y1:null,y2:null,w:n});const c=n.seriesData.seriesNames[l]||`series-${l+1}`,d=Math.round(Number(n.seriesData.series[l])||0),p=t.parentNode,u=p&&p.querySelectorAll?p.querySelectorAll(".apexcharts-unit-area").length:d,g=n.config.plotOptions.unit||{},f=g.unitValue>0?g.unitValue:1,x=n.seriesData.unitData&&n.seriesData.unitData[l],m=x?x[h]:void 0,b=m&&"object"==typeof m?m:null,y=b&&b.fillColor||n.globals.colors&&n.globals.colors[l]||"#008FFB";let w;const v=g.tooltip&&g.tooltip.formatter;if("function"==typeof v)w=v({seriesName:c,seriesIndex:l,dataPointIndex:h,count:u,value:d,unitValue:f,datum:m,color:y,w:n});else if(null!=m){const t=b&&null!=(s=null!=(i=null!=(e=b.name)?e:b.label)?i:b.x)?s:null,n=b?null!=(r=null!=(a=b.value)?a:b.y)?r:null:m;w=null!=t&&null!=n?`${t}: ${n}`:null!=t?String(t):null!=n?String(n):`#${(h+1).toLocaleString()} of ${u.toLocaleString()}`}else w=`#${(h+1).toLocaleString()} of ${u.toLocaleString()}`,1!==f&&(w+=` &middot; ${f.toLocaleString()} per dot`);const A=n.config.chart.fontFamily||"inherit",S=n.config.tooltip.style&&n.config.tooltip.style.fontSize||"12px",C=o.querySelector(".apexcharts-tooltip-arrow");o.innerHTML=`<div class="apexcharts-tooltip-title" style="font-family: ${A}; font-size: ${S};">${c}</div><div class="apexcharts-tooltip-series-group apexcharts-active" style="display: flex;"><span class="apexcharts-tooltip-marker" style="background-color: ${y};"></span><div class="apexcharts-tooltip-text" style="font-family: ${A}; font-size: ${S};"><div class="apexcharts-tooltip-y-group"><span class="apexcharts-tooltip-text-y-value">${w}</span></div></div></div>`,C&&o.appendChild(C);const k=o.getBoundingClientRect();this.tooltipRect.ttWidth=k.width,this.tooltipRect.ttHeight=k.height}handleStickyTooltip(t,e,i,s){const a=this.w,r=this.tooltipUtil.getNearestValues({context:this,hoverArea:s.hoverArea,elGrid:s.elGrid,clientX:e,clientY:i}),n=r.j;let o=r.capturedSeries;null!==o&&a.globals.collapsedSeriesIndices.includes(null!=o?o:-1)&&(o=null);const l=a.globals.barPadForNumericAxis||0;if(r.hoverX<-l||r.hoverX>a.layout.gridWidth+l)this.handleMouseOut(s);else if(null!==o)this.handleStickyCapturedSeries(t,null!=o?o:-1,s,null!=n?n:0);else if(this.tooltipUtil.isXoverlap(null!=n?n:0)||a.globals.isBarHorizontal){const e=a.seriesData.series.findIndex((t,e)=>!a.globals.collapsedSeriesIndices.includes(e));this.create(t,this,e,null!=n?n:0,s.ttItems)}}handleStickyCapturedSeries(t,e,i,s){const a=this.w;if(!this.tConfig.shared){if(null===a.seriesData.series[e][s])return void this.handleMouseOut(i)}if(void 0!==a.seriesData.series[e][s])this.tConfig.shared&&this.tooltipUtil.isXoverlap(s)&&this.tooltipUtil.isInitialSeriesSameLen()?this.create(t,this,e,s,i.ttItems):this.create(t,this,e,s,i.ttItems,!1);else if(this.tooltipUtil.isXoverlap(s)){const e=a.seriesData.series.findIndex((t,e)=>!a.globals.collapsedSeriesIndices.includes(e));this.create(t,this,e,s,i.ttItems)}}deactivateHoverFilter(){const t=this.w,e=new Dt(this.w,this.ctx),i=t.dom.Paper.find(".apexcharts-bar-area");for(let t=0;t<i.length;t++)e.pathMouseLeave(i[t],void 0)}handleMouseOut(t){var e,i;const s=this.w,a=this.getElXCrosshairs();s.dom.baseEl.classList.remove("apexcharts-tooltip-active"),t.tooltipEl.classList.remove("apexcharts-active"),delete t.tooltipEl.dataset.positioned,s.config.chart.accessibility.enabled&&s.config.chart.accessibility.announcements.enabled&&t.tooltipEl.setAttribute("aria-hidden","true"),this.deactivateHoverFilter(),"bubble"!==s.config.chart.type&&this.marker.resetPointsSize(),null!==a&&a.classList.remove("apexcharts-active");const r=this.ycrosshairs;if(null!==r&&r.classList.remove("apexcharts-active"),this.isXAxisTooltipEnabled&&(null==(e=this.xaxisTooltip)||e.classList.remove("apexcharts-active")),this.yaxisTooltips&&this.yaxisTooltips.length){null===this.yaxisTTEls&&(this.yaxisTTEls=[...s.dom.baseEl.querySelectorAll(".apexcharts-yaxistooltip")]);for(let t=0;t<this.yaxisTTEls.length;t++)this.yaxisTTEls[t].classList.remove("apexcharts-active")}s.config.legend.tooltipHoverFormatter&&(null==(i=this.legendLabels)||i.forEach(t=>{const e=t.getAttribute("data:default-text");t.innerHTML=decodeURIComponent(null!=e?e:"")}))}markerClick(t,e,i){const s=this.w;"function"==typeof s.config.chart.events.markerClick&&s.config.chart.events.markerClick(t,this.ctx,{seriesIndex:e,dataPointIndex:i,w:s}),this.ctx.events.fireEvent("markerClick",[t,this.ctx,{seriesIndex:e,dataPointIndex:i,w:s}])}_hasCustomSeries(){const t=this.w;if(mi(t.config.chart.type))return!0;return(t.config.series||[]).some(t=>t&&t.type&&mi(t.type))}create(t,e,i,s,a,r=null){var n,h,c,d,p,u,g,f,x,m,b,y,w,v,A,S,C,k,_,M,D;const L=this.w,P=e;"mouseup"===t.type&&this.markerClick(t,i,s),null===r&&(r=this.tConfig.shared);const E=this.tooltipUtil.hasMarkers(i),T="canvas"===(null==(h=null==(n=this.ctx)?void 0:n.renderer)?void 0:h.kind),F=T&&!this.tooltipUtil.hasBars(),I=!T&&!E&&!this.tooltipUtil.hasBars()&&this._hasCustomSeries(),R=F||I,X=this.tooltipUtil.getElBars(),z=()=>{L.globals.markers.largestSize>0&&!T&&!L.globals.markers.batched?P.marker.enlargePoints(s):P.tooltipPosition.moveDynamicPointsOnHover(s)};if(L.config.legend.tooltipHoverFormatter){const t=L.config.legend.tooltipHoverFormatter,e=Array.from(null!=(c=this.legendLabels)?c:[]);e.forEach(t=>{const e=t.getAttribute("data:default-text");t.innerHTML=decodeURIComponent(null!=e?e:"")});for(let a=0;a<e.length;a++){const n=e[a],o=parseInt(null!=(d=n.getAttribute("i"))?d:"",10),l=decodeURIComponent(null!=(p=n.getAttribute("data:default-text"))?p:""),h=t(l,{seriesIndex:r?o:i,dataPointIndex:s,w:L});if(r)n.innerHTML=L.globals.collapsedSeriesIndices.indexOf(o)<0?h:l;else if(n.innerHTML=o===i?h:l,i===o)break}}const B=L.rangeData,N=o(o({ttItems:a,i:i,j:s},void 0!==(null==(x=null==(f=null==(g=null==(u=B.seriesRange)?void 0:u[i])?void 0:g[s])?void 0:f.y[0])?void 0:x.y1)&&{y1:null==(w=null==(y=null==(b=null==(m=B.seriesRange)?void 0:m[i])?void 0:b[s])?void 0:y.y[0])?void 0:w.y1}),void 0!==(null==(C=null==(S=null==(A=null==(v=B.seriesRange)?void 0:v[i])?void 0:A[s])?void 0:S.y[0])?void 0:C.y2)&&{y2:null==(D=null==(M=null==(_=null==(k=B.seriesRange)?void 0:k[i])?void 0:_[s])?void 0:M.y[0])?void 0:D.y2});if(r){if(P.tooltipLabels.drawSeriesTexts(l(o({},N),{shared:!this.showOnIntersect&&this.tConfig.shared})),E||R)z();else if(this.tooltipUtil.hasBars()&&(T&&P.tooltipPosition.moveStickyTooltipOverBars(s,i),this.barSeriesHeight=this.tooltipUtil.getBarsHeight([...X]),this.barSeriesHeight>0)){const t=new Dt(this.w,this.ctx),e=L.dom.Paper.find(`.apexcharts-bar-area[j='${s}']`);this.deactivateHoverFilter();P.tooltipUtil.getAllMarkers(!0).length&&!this.barSeriesHeight&&z(),P.tooltipPosition.moveStickyTooltipOverBars(s,i);for(let i=0;i<e.length;i++)t.pathMouseEnter(e[i],void 0)}}else P.tooltipLabels.drawSeriesTexts(o({shared:!1},N)),this.tooltipUtil.hasBars()&&P.tooltipPosition.moveStickyTooltipOverBars(s,i),E?P.tooltipPosition.moveMarkers(i,s):R&&P.tooltipPosition.moveDynamicPointOnHover(s,i)}}class $i{constructor(t,e){this.w=t,this.ctx=e,this.kind="svg"}beginSeries(){}present(){return null}clear(){}group(t){return this.ctx.graphics.group(t)}drawPath(t){return this.ctx.graphics.drawPath(t)}drawLine(...t){return this.ctx.graphics.drawLine(...t)}drawRect(...t){return this.ctx.graphics.drawRect(...t)}drawCircle(t,e){return this.ctx.graphics.drawCircle(t,e)}drawText(t){return this.ctx.graphics.drawText(t)}renderPaths(t){return this.ctx.graphics.renderPaths(t)}drawMarker(t,e,i={}){return this.ctx.graphics.drawMarker(t,e,i)}supports(t){return!0}hitTest(){return null}restyle(){}toBitmap(){return null}destroy(){}}const Gi="__apexcharts_renderers__";function ji(){const t=globalThis;return t[Gi]||(t[Gi]=new Map),t[Gi]}class Vi{static get _rendererRegistry(){return ji()}static registerRenderer(t,e){ji().set(t,e)}static unregisterRenderer(t){ji().delete(t)}constructor(t,e){this.w=t,this.ctx=e,this.svg=new $i(t,e),this.active=this.svg,this._activeKind="svg",this._instances={}}_desiredKind(){const t=this.w.config.chart,e=t.renderer||"svg";if(!d.isBrowser())return"svg";if("svg"===e)return"svg";if(Tt(this.w))return"svg";if("canvas"===e)return"canvas";return function(t){const e=t.config.series||[],i=t.config.chart.type,s="scatter"===i||"bubble"===i,a=t.config.markers&&t.config.markers.size,r=Array.isArray(a)?a.some(t=>t>0):(a||0)>0,n=!(!t.config.dataLabels||!t.config.dataLabels.enabled),o="heatmap"===i;let l=0,h=0;return e.forEach(t=>{const e=Array.isArray(t.data)?t.data.length:0;e>h&&(h=e),(s||r||o)&&(l+=e),n&&(l+=e)}),h>=5e4&&(l=Math.max(l,h)),l}(this.w)>=(t.rendererThreshold||8e3)?"canvas":"svg"}resolve(){const t=this.w.config.chart.renderer||"svg",e=this._desiredKind();if("svg"!==e){const t=ji().get(e);if(t)return this._instances[e]||(this._instances[e]=t(this.w,this.ctx)),this.active=this._instances[e],this._activeKind=e,this.ctx.renderer=this.active,this.w.globals.activeRenderer=this.active,this._activeKind}else"canvas"===t&&Tt(this.w);return this.active=this.svg,this._activeKind="svg",this.ctx.renderer=this.active,this.w.globals.activeRenderer=this.active,this._activeKind}getActiveKind(){return this._activeKind}teardown(){for(const t in this._instances){const e=this._instances[t];e&&"function"==typeof e.destroy&&e.destroy()}this._instances={},this.active=this.svg,this._activeKind="svg"}}class Ui{constructor(t){this.node=t,t&&(t.instance=this),this._listeners=[],this._filter=null}attr(t,e){if("string"==typeof t&&void 0===e)return this.node.getAttribute(t);const i="string"==typeof t?{[t]:e}:t;for(const t in i){let e=i[t];null===e?this.node.removeAttribute(t):void 0!==e&&("number"==typeof e&&isNaN(e)&&(e=0),this.node.setAttribute(t,e))}if("text"===this.node.nodeName&&null!=i.x){const t=this.node.querySelectorAll("tspan[data-newline]");for(let e=0;e<t.length;e++)t[e].setAttribute("x",i.x)}return this}css(t){for(const e in t)this.node.style[e]=t[e];return this}fill(t){return"object"==typeof t?this.attr(t):this.attr("fill",t)}stroke(t){return"object"==typeof t?(void 0!==t.color&&this.attr("stroke",t.color),void 0!==t.width&&this.attr("stroke-width",t.width),void 0!==t.dasharray&&this.attr("stroke-dasharray",t.dasharray),void 0!==t.linecap&&this.attr("stroke-linecap",t.linecap),void 0!==t.opacity&&this.attr("stroke-opacity",t.opacity),this):this.attr("stroke",t)}size(t,e){return this.attr({width:t,height:e})}move(t,e){return this.attr({x:t,y:e})}center(t,e){if("g"===this.node.nodeName){const i=this.bbox(),s=t-(i.x+i.width/2),a=e-(i.y+i.height/2);return this.attr("transform",`translate(${s}, ${a})`)}return this.attr({cx:t,cy:e})}add(t){return t&&t.__isCanvasMark||this.node.appendChild(t.node||t),this}addTo(t){return(t.node||t).appendChild(this.node),this}remove(){return this.node.parentNode&&this.node.parentNode.removeChild(this.node),this}clear(){for(;this.node.firstChild;)this.node.removeChild(this.node.firstChild);return this}find(t){return Array.from(this.node.querySelectorAll(t)).map(t=>t.instance||new Ui(t))}findOne(t){const e=this.node.querySelector(t);return e?e.instance||new Ui(e):null}on(t,e){const i=t.split(".")[0];return this._listeners.push({event:t,eventType:i,handler:e}),this.node.addEventListener(i,e),this}off(t,e){if(t||e)if(t&&!e){const e=t.split(".")[0];this._listeners=this._listeners.filter(t=>t.eventType!==e||(this.node.removeEventListener(t.eventType,t.handler),!1))}else{const i=t.split(".")[0];this._listeners=this._listeners.filter(t=>t.eventType!==i||t.handler!==e||(this.node.removeEventListener(t.eventType,t.handler),!1))}else this._listeners.forEach(t=>{this.node.removeEventListener(t.eventType,t.handler)}),this._listeners=[];return this}each(t,e){return Array.from(this.node.children).forEach(i=>{const s=i.instance||new Ui(i);t.call(s),e&&s.each(t,e)}),this}removeClass(t){return"*"===t?this.node.removeAttribute("class"):this.node.classList.remove(t),this}children(){return Array.from(this.node.childNodes).filter(t=>1===t.nodeType).map(t=>t.instance||new Ui(t))}hide(){return this.node.style.display="none",this}show(){return this.node.style.display="",this}bbox(){if("function"==typeof this.node.getBBox)try{return this.node.getBBox()}catch(t){}return{x:0,y:0,width:0,height:0}}tspan(t){const e=b.createElementNS("http://www.w3.org/2000/svg","tspan");return e.textContent=t,this.node.appendChild(e),new Ui(e)}plot(t){return"string"==typeof t&&this.attr("d",t),this}animate(){throw new Error("Animation module not loaded")}filterWith(){throw new Error("Filter module not loaded")}}let qi=0;class Zi extends Ui{constructor(t,e,i){const s="radial"===e?"radialGradient":"linearGradient";super(b.createElementNS($,s)),this._id="SvgjsGradient"+ ++qi,this.attr("id",this._id),"function"==typeof i&&i(new Ki(this));let a=t.node.querySelector("defs");a||(a=b.createElementNS($,"defs"),t.node.appendChild(a)),a.appendChild(this.node)}stop(t,e,i){const s=b.createElementNS($,"stop");return s.setAttribute("offset",t),s.setAttribute("stop-color",e),void 0!==i&&s.setAttribute("stop-opacity",String(i)),this.node.appendChild(s),this}from(t,e){return this.attr({x1:t,y1:e})}to(t,e){return this.attr({x2:t,y2:e})}url(){return"url(#"+this._id+")"}toString(){return this.url()}valueOf(){return this.url()}fill(){return this.url()}}class Ki{constructor(t){this.gradient=t}stop(t,e,i){return this.gradient.stop(t,e,i),this}}let Ji=0;class Qi extends Ui{constructor(t,e,i,s){if(super(b.createElementNS($,"pattern")),this._id="SvgjsPattern"+ ++Ji,this.attr({id:this._id,width:e,height:i,patternUnits:"userSpaceOnUse"}),"function"==typeof s){s(new ts(this.node))}let a=t.node.querySelector("defs");a||(a=b.createElementNS($,"defs"),t.node.appendChild(a)),a.appendChild(this.node)}url(){return"url(#"+this._id+")"}toString(){return this.url()}valueOf(){return this.url()}fill(){return this.url()}}class ts extends Ui{line(t,e,i,s){const a=this._make("line");return void 0!==t&&a.attr({x1:t,y1:e,x2:i,y2:s}),a}rect(t,e){const i=this._make("rect");return void 0!==t&&i.attr({width:t,height:e}),i}circle(t){const e=this._make("circle");return void 0!==t&&e.attr({r:t/2,cx:t/2,cy:t/2}),e}path(t){const e=this._make("path");return t&&e.attr("d",t),e}polygon(t){const e=this._make("polygon");return t&&e.attr("points",t),e}group(){return this._makeContainer("g")}defs(){return this._makeContainer("defs")}plain(t){const e=b.createElementNS($,"text");e.textContent=t;const i=new Ui(e);return this.node.appendChild(e),i}text(t){const e=b.createElementNS($,"text"),i=new Ui(e);return this.node.appendChild(e),"function"==typeof t&&t(new es(e)),i}image(t,e){const i=b.createElementNS($,"image");i.setAttributeNS("http://www.w3.org/1999/xlink","href",t);const s=new Ui(i);if(this.node.appendChild(i),"function"==typeof e&&d.isBrowser()){const i=new Image;i.onload=function(){s.size(i.width,i.height),e.call(s,{width:i.width,height:i.height})},i.src=t}return s}gradient(t,e){return new Zi(this,t,e)}pattern(t,e,i){return new Qi(this,t,e,i)}_make(t){const e=b.createElementNS($,t);return this.node.appendChild(e),new Ui(e)}_makeContainer(t){const e=b.createElementNS($,t);return this.node.appendChild(e),new ts(e)}}class es{constructor(t){this.textNode=t}tspan(t){const e=b.createElementNS($,"tspan");return e.textContent=t,this.textNode.appendChild(e),new is(e,this.textNode)}}class is{constructor(t,e){this.node=t,this.textNode=e}newLine(){return this.node.setAttribute("dy","1.1em"),this.node.dataset.newline="1",this}}let ss=0;class as extends Ui{constructor(){super(b.createElementNS($,"filter")),this._id="SvgjsFilter"+ ++ss,this.attr("id",this._id)}}class rs{constructor(t){this.filter=t}colorMatrix(t){return this._primitive("feColorMatrix",t)}offset(t){return this._primitive("feOffset",t)}gaussianBlur(t){return this._primitive("feGaussianBlur",t)}flood(t){return this._primitive("feFlood",t)}composite(t){return this._primitive("feComposite",t)}merge(t){const e=b.createElementNS($,"feMerge");return t.forEach(t=>{const i=b.createElementNS($,"feMergeNode");i.setAttribute("in",t),e.appendChild(i)}),this.filter.node.appendChild(e),new Ui(e)}_primitive(t,e){const i=b.createElementNS($,t);for(const t in e)i.setAttribute(t,e[t]);return this.filter.node.appendChild(i),new Ui(i)}}function ns(t){t.prototype.filterWith=function(t){const e=new as;this._filter=e;let i=this.node;for(;i&&"svg"!==i.nodeName;)i=i.parentNode;if(i){let t=i.querySelector("defs");t||(t=b.createElementNS($,"defs"),i.insertBefore(t,i.firstChild)),t.appendChild(e.node)}return t(new rs(e)),this.attr("filter","url(#"+e._id+")"),this},t.prototype.unfilter=function(t){return this._filter&&(this.node.removeAttribute("filter"),t&&this._filter.node&&this._filter.node.parentNode&&this._filter.node.parentNode.removeChild(this._filter.node),this._filter=null),this},t.prototype.filterer=function(){return this._filter}}function os(t){t.prototype.draggable=function(t){if(!1===t)return this._dragCleanup&&(this._dragCleanup(),this._dragCleanup=null),this;const e=this,i=t||{},s=t=>{if(t.button&&0!==t.button)return;t.stopPropagation();const s="touchstart"===t.type?t.touches[0]:t,a=e.node,r=parseFloat(a.getAttribute("x"))||0,n=parseFloat(a.getAttribute("y"))||0,o=s.clientX,l=s.clientY,h=a.ownerSVGElement;let c=null;h&&(c=h.getScreenCTM());const p=t=>{const e="touchmove"===t.type?t.touches[0]:t;let s=e.clientX-o,h=e.clientY-l;c&&(s/=c.a,h/=c.d);let d=r+s,p=n+h;const u=parseFloat(a.getAttribute("width"))||0,g=parseFloat(a.getAttribute("height"))||0;void 0!==i.minX&&d<i.minX&&(d=i.minX),void 0!==i.minY&&p<i.minY&&(p=i.minY),void 0!==i.maxX&&d+u>i.maxX&&(d=i.maxX-u),void 0!==i.maxY&&p+g>i.maxY&&(p=i.maxY-g);const f=new CustomEvent("dragmove",{detail:{handler:{move:function(t,e){a.setAttribute("x",t),a.setAttribute("y",e)}},box:{x:d,y:p,w:u,h:g,x2:d+u,y2:p+g}}});a.dispatchEvent(f)},u=()=>{d.isBrowser()&&(document.removeEventListener("mousemove",p),document.removeEventListener("touchmove",p),document.removeEventListener("mouseup",u),document.removeEventListener("touchend",u)),e._activeDrag=null};d.isBrowser()&&(document.addEventListener("mousemove",p),document.addEventListener("touchmove",p),document.addEventListener("mouseup",u),document.addEventListener("touchend",u),e._activeDrag={onMove:p,onUp:u})};return e.node.addEventListener("mousedown",s),e.node.addEventListener("touchstart",s),e._dragCleanup=()=>{e.node.removeEventListener("mousedown",s),e.node.removeEventListener("touchstart",s),e._activeDrag&&d.isBrowser()&&(document.removeEventListener("mousemove",e._activeDrag.onMove),document.removeEventListener("touchmove",e._activeDrag.onMove),document.removeEventListener("mouseup",e._activeDrag.onUp),document.removeEventListener("touchend",e._activeDrag.onUp),e._activeDrag=null)},e}}function ls(t){t.prototype.select=function(t){if(!1===t)return this._selectCleanup&&(this._selectCleanup(),this._selectCleanup=null),this;const e=this,{createHandle:i,updateHandle:s}=t,a=document.createElementNS($,"g");a.setAttribute("class","svg_select_points");const r=e.node.parentNode;r&&r.appendChild(a);const n={},o=["t","b","l","r","lt","rt","lb","rb"];o.forEach((t,e)=>{const s=new ts(document.createElementNS($,"g"));a.appendChild(s.node);const r=i(s,[0,0],e,[],t);n[t]={group:s,handle:r}});const l=()=>{const t=parseFloat(e.attr("x"))||0,i=parseFloat(e.attr("y"))||0,r=parseFloat(e.attr("width"))||0,l=parseFloat(e.attr("height"))||0,h=e.node.getAttribute("transform");h?a.setAttribute("transform",h):a.removeAttribute("transform");const c={t:[t+r/2,i],b:[t+r/2,i+l],l:[t,i+l/2],r:[t+r,i+l/2],lt:[t,i],rt:[t+r,i],lb:[t,i+l],rb:[t+r,i+l]};o.forEach(t=>{n[t]&&c[t]&&s(n[t].group,c[t])})};return l(),e._selectHandles=a,e._selectHandlesMap=n,e._updateSelectPositions=l,e._selectCleanup=()=>{a.parentNode&&a.parentNode.removeChild(a),e._selectHandles=null,e._selectHandlesMap=null,e._updateSelectPositions=null},e},t.prototype.resize=function(t){if(!1===t)return this._resizeCleanup&&(this._resizeCleanup(),this._resizeCleanup=null),this;const e=this,i=e._selectHandlesMap;if(!i)return e;const s=[],a=t=>{const a=i[t];if(!a||!a.group||!a.group.node)return;const r=a.group.node,n=i=>{if(i.button&&0!==i.button)return;i.stopPropagation();const s=("touchstart"===i.type?i.touches[0]:i).clientX,a=e.node.ownerSVGElement;let r=null;a&&(r=a.getScreenCTM());const n=parseFloat(e.attr("x"))||0,o=parseFloat(e.attr("width"))||0,l=i=>{let a=("touchmove"===i.type?i.touches[0]:i).clientX-s;r&&(a/=r.a);let l=n,h=o;"l"===t?(l=n+a,h=o-a):"r"===t&&(h=o+a),h<0&&(h=0),e.attr({x:l,width:h}),e._updateSelectPositions&&e._updateSelectPositions();const c=new CustomEvent("resize",{detail:{el:e}});e.node.dispatchEvent(c)},h=()=>{d.isBrowser()&&(document.removeEventListener("mousemove",l),document.removeEventListener("touchmove",l),document.removeEventListener("mouseup",h),document.removeEventListener("touchend",h));const t=new CustomEvent("resize",{detail:{el:e}});e.node.dispatchEvent(t)};d.isBrowser()&&(document.addEventListener("mousemove",l),document.addEventListener("touchmove",l),document.addEventListener("mouseup",h),document.addEventListener("touchend",h))};r.addEventListener("mousedown",n),r.addEventListener("touchstart",n),s.push(()=>{r.removeEventListener("mousedown",n),r.removeEventListener("touchstart",n)})};return a("l"),a("r"),e._resizeCleanup=()=>{s.forEach(t=>t())},e}}function hs(){const t=b.createElementNS($,"svg"),e=new ts(t);return e.attr({xmlns:$}),e}ns(Ui),dt(Ui),os(Ui),ls(Ui),hs.xlink="http://www.w3.org/1999/xlink",d.isBrowser()&&void 0===window.SVG&&(window.SVG=hs),d.isBrowser()?(void 0===window.SVG&&(window.SVG=hs),void 0===window.Apex&&(window.Apex={})):"undefined"!=typeof global&&(void 0===global.Apex&&(global.Apex={}),void 0===global.SVG&&(global.SVG=hs));const cs="__apexcharts_features_v1__";globalThis[cs]||(globalThis[cs]=new Map);class ds{static get _featureRegistry(){return globalThis[cs]}static registerFeatures(t){for(const[e,i]of Object.entries(t))ds._featureRegistry.set(e,i)}constructor(t){this.ctx=t,this.w=t.w}initModules(){this.ctx.publicMethods=["updateOptions","updateSeries","appendData","appendSeries","isSeriesHidden","highlightSeries","toggleSeries","showSeries","hideSeries","setLocale","resetSeries","zoomX","toggleDataPointSelection","dataURI","exportToCSV","addXaxisAnnotation","addYaxisAnnotation","addPointAnnotation","clearAnnotations","removeAnnotation","drillDown","drillUp","drillToRoot","clearDrilldownCache","paper","getActiveRenderer","destroy"],this.ctx.eventList=["click","mousedown","mousemove","mouseleave","touchstart","touchmove","touchleave","mouseup","touchend","keydown","keyup"],this.ctx.animations=new Ct(this.w,this.ctx),this.ctx.axes=new Vt(this.w,this.ctx),this.ctx.core=new wi(this.ctx.el,this.w,this.ctx),this.ctx.config=new z({}),this.ctx.data=new Fi(this.w,{resetGlobals:()=>this.ctx.core.resetGlobals(),isMultipleY:()=>this.ctx.core.isMultipleY()}),this.ctx.grid=new Yt(this.w,this.ctx),this.ctx.graphics=new Dt(this.w,this.ctx),this.ctx.coreUtils=new H(this.w),this.ctx.crosshairs=new Ut(this.w),this.ctx.events=new Gt(this.w,this.ctx),this.ctx.fill=new Lt(this.w),this.ctx.localization=new jt(this.w),this.ctx.options=new k,this.ctx.responsive=new Zt(this.w),this.ctx.series=new Be(this.w,{toggleDataSeries:(...t)=>{var e;return null==(e=this.ctx.legend)?void 0:e.legendHelpers.toggleDataSeries(...t)},revertDefaultAxisMinMax:()=>this.ctx.updateHelpers.revertDefaultAxisMinMax(),updateSeries:(...t)=>this.ctx.updateHelpers._updateSeries(...t)}),this.ctx.theme=new Ge(this.w),this.ctx.formatters=new S(this.w),this.ctx.titleSubtitle=new je(this.w),this.ctx.dimensions=new ii(this.w,this.ctx),this.ctx.updateHelpers=new Ii(this.w,this.ctx),this.ctx.rendererController=new Vi(this.w,this.ctx),this.ctx.renderer=this.ctx.rendererController.active;const t=new Hi(this.w,this.ctx);this.w.globals.tooltip=t,Object.defineProperty(this.ctx,"tooltip",{get(){return this.w.globals.tooltip},configurable:!0}),this._initOptionalModules()}_initOptionalModules(){const t=ds._featureRegistry,e=this.w,i=this.ctx,s=t.get("exports");i.exports=s?new s(e,i):null;const a=t.get("legend");i.legend=a?new a(e,i):null;const r=t.get("morphTypeChange");i.morphTypeChange=r?new r(e,i):null;const n=t.get("drilldown");i.drilldown=n?new n(e,i):null;const o=t.get("perspectives");i.perspectives=o?new o(e,i):null;const l=t.get("storyboard");i.storyboard=l?new l(e,i):null;const h=t.get("history");i.history=h?new h(e,i):null;const c=t.get("linkedViews");i.linkedViews=c?new c(e,i):null;const d=t.get("ink");i.ink=d?new d(e,i):null;const p=t.get("measure");i.measure=p?new p(e,i):null;const u=t.get("contextMenu");i.contextMenu=u?new u(e,i):null;const g=t.get("weave");i.weave=g?new g(e,i):null;const f=t.get("trellis");i.trellis=f?new f(e,i):null;const x=t.get("osThemeWatcher");i.osThemeWatcher=x?new x(e,i):null;const m=t.get("toolbar");Object.defineProperty(i,"toolbar",{get(){var t;return!this._toolbar&&m&&(this._toolbar=new m(e,this)),null!=(t=this._toolbar)?t:null},configurable:!0});const b=t.get("zoomPanSelection");Object.defineProperty(i,"zoomPanSelection",{get(){var t;return!this._zoomPanSelection&&b&&(this._zoomPanSelection=new b(e,this)),null!=(t=this._zoomPanSelection)?t:null},configurable:!0});const y=t.get("keyboardNavigation");Object.defineProperty(i,"keyboardNavigation",{get(){var t;return!this._keyboardNavigation&&y&&(this._keyboardNavigation=new y(e,this)),null!=(t=this._keyboardNavigation)?t:null},configurable:!0})}}class ps{constructor(t){this.ctx=t,this.w=t.w}clear({isUpdating:t}){var e,i,s,a,r,n,o,l,h,c,d,p,u;null==(e=this.ctx.weave)||e.teardown(t),t||(this.w.globals.isDestroyed=!0),this.ctx._zoomPanSelection&&this.ctx._zoomPanSelection.destroy(),this.ctx._toolbar&&this.ctx._toolbar.destroy(),this.w.globals.resizeObserver&&"function"==typeof this.w.globals.resizeObserver.disconnect&&(this.w.globals.resizeObserver.disconnect(),this.w.globals.resizeObserver=null),zt.invalidateAll(this.w),t?(this.ctx._zoomPanSelection=null,this.ctx._toolbar=null,null==(i=this.ctx._keyboardNavigation)||i.destroy(),this.ctx._keyboardNavigation=null):(null==(s=this.ctx.perspectives)||s.teardown(),this.ctx.perspectives=null,null==(a=this.ctx.storyboard)||a.teardown(),this.ctx.storyboard=null,null==(r=this.ctx.history)||r.teardown(),this.ctx.history=null,null==(n=this.ctx.linkedViews)||n.teardown(),this.ctx.linkedViews=null,null==(o=this.ctx.trellis)||o.teardown(),this.ctx.trellis=null,null==(l=this.ctx.ink)||l.teardown(),this.ctx.ink=null,null==(h=this.ctx.measure)||h.teardown(),this.ctx.measure=null,null==(c=this.ctx.contextMenu)||c.teardown(),this.ctx.contextMenu=null,null==(d=this.ctx.osThemeWatcher)||d.teardown(),this.ctx.osThemeWatcher=null,this.ctx.weave=null,null==(u=null==(p=this.ctx.rendererController)?void 0:p.teardown)||u.call(p),this.ctx.rendererController=null,this.ctx.renderer=null,this.ctx.drilldown=null,this.ctx.morphTypeChange=null,this.ctx.exports=null,this.ctx.animations=null,this.ctx.axes=null,this.ctx.annotations=null,this.ctx.core=null,this.ctx.data=null,this.ctx.grid=null,this.ctx.series=null,this.ctx.responsive=null,this.ctx.theme=null,this.ctx.formatters=null,this.ctx.titleSubtitle=null,this.ctx.legend=null,this.ctx.dimensions=null,this.ctx.options=null,this.ctx.crosshairs=null,this.ctx._zoomPanSelection=null,this.ctx.updateHelpers=null,this.ctx._toolbar=null,this.ctx.localization=null,this.ctx._keyboardNavigation=null,this.ctx.w.globals.tooltip=null),this.clearDomElements({isUpdating:t})}killSVG(t){t.each(function(){this.removeClass("*"),this.off()},!0),t.clear()}clearDomElements({isUpdating:t}){const e=this.w.dom;if(d.isBrowser()&&e.Paper){const i=e.Paper.node;i.parentNode&&i.parentNode.parentNode&&!t&&(i.parentNode.parentNode.style.minHeight="unset");const s=e.baseEl;if(s&&this.ctx.eventList.forEach(t=>{s.removeEventListener(t,this.ctx.events.documentEvent)}),null!==this.ctx.el)for(;this.ctx.el.firstChild;)this.ctx.el.removeChild(this.ctx.el.firstChild);this.killSVG(e.Paper),e.Paper.remove()}e.Paper=null,e.elWrap=null,e.elGraphical=null,e.elLegendWrap=null,e.elLegendForeign=null,e.baseEl=null,e.elGridRect=null,e.elGridRectMask=null,e.elGridRectBarMask=null,e.elGridRectMarkerMask=null,e.elForecastMask=null,e.elNonForecastMask=null,e.elDefs=null}}const us="__apexcharts_unit_layouts__";function gs(){return globalThis[us]}globalThis[us]||(globalThis[us]={});const fs="__apexcharts_unit_marks__";function xs(){return globalThis[fs]}function ms(t,e){if("string"==typeof t){const i=t.trim();return i?Object.freeze({name:e||"anonymous",path:i,viewBox:[0,0,100,100]}):null}if(!t||"object"!=typeof t)return null;if("string"!=typeof t.path||!t.path.trim())return null;const i=Array.isArray(t.viewBox)&&4===t.viewBox.length?t.viewBox.map(Number):[0,0,100,100];return!i.every(t=>isFinite(t))||i[2]<=0||i[3]<=0?null:Object.freeze(l(o({},t),{name:e||t.name||"anonymous",path:t.path.trim(),viewBox:i,fillRule:"evenodd"===t.fillRule?"evenodd":void 0}))}globalThis[fs]||(globalThis[fs]={});const bs="__apexcharts_row_sources__";function ys(){return globalThis[bs]}function ws(t,e){t&&"string"==typeof t&&"function"==typeof e&&(ys()[t]=e)}function vs(t){return t&&ys()[t]||null}globalThis[bs]||(globalThis[bs]={});const As="__apexcharts_plugins__";function Ss(){const t=globalThis;return t[As]||(t[As]={}),t[As]}const Cs=new WeakMap;function ks(t,e){if(d.isSSR())return;let i=!1;if(t.nodeType!==Node.DOCUMENT_FRAGMENT_NODE){const e=t.getBoundingClientRect();"none"!==t.style.display&&0!==e.width||(i=!0)}const s=new ResizeObserver(s=>{i&&e.call(t,s),i=!0});t.nodeType===Node.DOCUMENT_FRAGMENT_NODE?Array.from(t.children).forEach(t=>s.observe(t)):s.observe(t),Cs.set(e,s)}function _s(t,e){if(d.isSSR())return;const i=Cs.get(e);i&&(i.disconnect(),Cs.delete(e))}const Ms=globalThis.console;function Ds(t){Ms.error(t)}function Ls(t){Ms.warn(t)}const Ps="APEX-",Es=new Date("2027-07-31T00:00:00Z"),Ts="__apex_license_v1__";function Fs(){const t=globalThis;let e=t[Ts];return e||(e={key:null,listeners:new Set,result:null},t[Ts]=e),e}const Is=class{static get licenseKey(){return Fs().key}static set licenseKey(t){Fs().key=t}static get listeners(){return Fs().listeners}static get validationResult(){return Fs().result}static set validationResult(t){Fs().result=t}static getKey(){return this.licenseKey}static getLicenseStatus(){return this.licenseKey?(this.validationResult=this.validateKey(this.licenseKey),this.validationResult):{expired:!1,signatureVerified:!1,valid:!1}}static isKeyValid(t){return!!t&&this.validateKey(t).valid}static isLicenseValid(){return this.getLicenseStatus().valid}static onChange(t){return this.listeners.add(t),()=>{this.listeners.delete(t)}}static setLicense(t){var e,i;if(!t)return this.licenseKey=null,void this.publish({expired:!1,signatureVerified:!1,valid:!1});const s=this.validateKey(t);s.valid||t===this.licenseKey||!(null==(i=this.validationResult)?void 0:i.valid)?(this.licenseKey=t,this.publish(s),s.valid||Ds(`[Apex] ${s.message}`)):Ls(`[Apex] Ignoring license key: ${null!=(e=s.message)?e:"it is not valid"} A valid license is already active on this page.`)}static validateKey(t){const e=this.parseKey(t),i=this.validateStructure(t,e);if(!i.valid||!(null==e?void 0:e.signature))return i;const s=this.verdicts.get(t);return!1===s?{data:e.data,expired:!1,message:"Invalid license key. The license signature does not verify.",signatureVerified:!0,valid:!1}:(void 0===s&&this.verifySignature(t,e,i),l(o({},i),{signatureVerified:!0===s}))}static _resetSignatureState(){this.verdicts.clear(),this.verifying.clear(),this.warnedUnverifiable=!1,this.epoch++}static base64ToBytes(t){const e=t.replace(/-/g,"+").replace(/_/g,"/"),i=e.padEnd(4*Math.ceil(e.length/4),"="),s=globalThis.atob;if("function"!=typeof s)throw new Error("no base64 decoder available");const a=s(i),r=new Uint8Array(a.length);for(let t=0;t<a.length;t++)r[t]=a.charCodeAt(t);return r}static canonicalPayload(t){const e=t.domains&&t.domains.length>0?t.domains.join(","):"";return`v1|${t.issueDate}|${t.expiryDate}|${t.plan}|${e}`}static notify(t){for(const e of this.listeners)try{e(t)}catch(t){}}static parseKey(t){if("string"!=typeof t||!t.startsWith(Ps))return null;const e=t.slice(5);if(!e)return null;try{const t=(new TextDecoder).decode(this.base64ToBytes(e)),i=JSON.parse(t);return i.issueDate&&i.expiryDate&&i.plan?{data:{domains:Array.isArray(i.domains)?i.domains:void 0,expiryDate:i.expiryDate,issueDate:i.issueDate,plan:i.plan,valid:!0},signature:"string"==typeof i.sig&&i.sig?i.sig:null}:null}catch(t){return null}}static publish(t){this.validationResult=t,this.notify(t)}static validateStructure(t,e){const i=t=>({expired:!1,message:t,signatureVerified:!1,valid:!1});if("string"!=typeof t||!t.startsWith(Ps))return i('Invalid license key format. License key must start with "APEX-".');if(!e)return i("Invalid license key. Unable to decode license data.");const{data:s,signature:a}=e;if(!a&&new Date>=Es)return i("This license key is in the old unsigned format, which is no longer accepted. Please request a replacement key.");if(new Date(s.expiryDate)<new Date)return{data:s,expired:!0,message:`License expired on ${s.expiryDate}. Please renew your license.`,signatureVerified:!1,valid:!1};if(s.domains&&s.domains.length>0){const t="undefined"==typeof location?"":location.hostname;if(!s.domains.some(e=>t===e||t.endsWith(`.${e}`)))return{data:s,expired:!1,message:`License is not valid for this domain (${t}). Allowed domains: ${s.domains.join(", ")}.`,signatureVerified:!1,valid:!1}}return{data:s,expired:!1,signatureVerified:!1,valid:!0}}static verifySignature(t,e,i){return c(this,null,function*(){var s;if(this.verifying.has(t)||this.verdicts.has(t))return;this.verifying.add(t);const a=this.epoch,r=null==(s=globalThis.crypto)?void 0:s.subtle;if(!r||0===this.publicKeysSpki.length)return this.verifying.delete(t),void(this.warnedUnverifiable||(this.warnedUnverifiable=!0,Ls(r?"[Apex] No license signing key is configured in this build, so license signatures cannot be verified.":"[Apex] Web Crypto is unavailable (a secure context is required), so the license signature cannot be verified.")));const n=(new TextEncoder).encode(this.canonicalPayload(e.data));let h=!1;for(const t of this.publicKeysSpki){try{const i=yield r.importKey("spki",this.base64ToBytes(t),{name:"ECDSA",namedCurve:"P-256"},!1,["verify"]);h=yield r.verify({hash:"SHA-256",name:"ECDSA"},i,this.base64ToBytes(e.signature),n)}catch(t){h=!1}if(h)break}if(this.verifying.delete(t),this.epoch!==a)return;if(this.verdicts.set(t,h),h){const e=l(o({},i),{signatureVerified:!0});return void(this.licenseKey===t?this.publish(e):this.notify(e))}const c="Invalid license key. The license signature does not verify.",d={data:e.data,expired:!1,message:c,signatureVerified:!0,valid:!1};this.licenseKey===t?this.publish(d):this.notify(d),Ds(`[Apex] ${c}`)})}};Is.publicKeysSpki=["MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEQIaK9UMD6n0oR/FIy8QdL0uSzKMQlf1BB+tOrji4/WuHsyRNxeDhVykoSsNURozMi1xhmqWvBH1L//xIfugTPA=="],Is.verdicts=new Map,Is.verifying=new Set,Is.warnedUnverifiable=!1,Is.epoch=0;let Rs=Is;const Xs=class{static applyStyles(t){Object.assign(t.style,this.CRITICAL_STYLES,{backgroundImage:this.createWatermarkPattern(),backgroundRepeat:"repeat"})}static node(t){return t?t.querySelector(`[${this.WATERMARK_ATTR}]`):null}static add(t,e){return t&&"undefined"!=typeof document?(this.setManaged(t,e),this.paint(t)):null}static exists(t){return!!this.node(t)}static remove(t,e){t&&(this.setManaged(t,e),this.erase(t))}static untrack(t){this.managed.delete(t)}static createWatermarkPattern(){const t=this.WATERMARK_TEXT;return`url("data:image/svg+xml,${encodeURIComponent(`\n      <svg xmlns="http://www.w3.org/2000/svg" width="300" height="200">\n        <text\n          x="50%"\n          y="50%"\n          dominant-baseline="middle"\n          text-anchor="middle"\n          font-family="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Arial, sans-serif"\n          font-size="18"\n          font-weight="600"\n          fill="rgba(134, 134, 134, 0.1)"\n          transform="rotate(-35, 100, 60)"\n        >${t}</text>\n      </svg>\n    `.trim())}")`}static erase(t){var e;null==(e=this.node(t))||e.remove()}static paint(t){let e=this.node(t);return e||(e=document.createElement("div"),e.setAttribute(this.WATERMARK_ATTR,""),t.appendChild(e)),this.applyStyles(e),"function"==typeof getComputedStyle&&"static"===getComputedStyle(t).position&&(t.style.position="relative"),e}static reconcile(){const t=Rs.isLicenseValid();for(const e of this.managed)e.isConnected?t?this.erase(e):this.paint(e):this.managed.delete(e)}static setManaged(t,e){!1!==(null==e?void 0:e.manage)?this.track(t):this.managed.delete(t)}static track(t){this.managed.add(t),this.subscribed||(this.subscribed=!0,Rs.onChange(()=>{this.reconcile()}))}};Xs.WATERMARK_ATTR="data-apexcharts-watermark",Xs.WATERMARK_TEXT="APEXCHARTS",Xs.ATTR="data-apexcharts-watermark",Xs.CRITICAL_STYLES={bottom:"0",display:"block",left:"0",msUserSelect:"none",opacity:"1",pointerEvents:"none",position:"absolute",right:"0",top:"0",userSelect:"none",visibility:"visible",webkitUserSelect:"none",zIndex:"10000"},Xs.managed=new Set,Xs.subscribed=!1;let zs=Xs;const Bs=1/45;function Ns(t,e,i,s){return{value:t,velocity:0,target:t,stiffness:e,damping:i}}function Ys(t,e){if(e<=0)return Ws(t);let i=e;for(;i>0;){const e=Math.min(i,Bs),s=-t.stiffness*(t.value-t.target)-t.damping*t.velocity;t.velocity+=s*e,t.value+=t.velocity*e,i-=e}return!!Ws(t)&&(t.value=t.target,t.velocity=0,!0)}function Os(t,e){t.target=e}function Ws(t){var e,i;const s=null!=(e=t.restVelocity)?e:.05,a=null!=(i=t.restDisplacement)?i:.05;return Math.abs(t.velocity)<s&&Math.abs(t.value-t.target)<a}const Hs={crisp:[210,26],gentle:[120,20],snappy:[320,30]};const $s=new Set;const Gs=new Set(["premium","enterprise"]);function js(t,e){const i=zs.add(e,{manage:!1});if(!i||"undefined"==typeof MutationObserver)return;if(t._wmNodeObserver&&t._wmObservedNode===i)return;t._wmNodeObserver&&t._wmNodeObserver.disconnect();const s=new MutationObserver(()=>{const t=zs.node(e);t&&(s.disconnect(),zs.applyStyles(t),s.takeRecords(),s.observe(t,{attributes:!0,attributeFilter:["style"]}))});s.observe(i,{attributes:!0,attributeFilter:["style"]}),t._wmNodeObserver=s,t._wmObservedNode=i}function Vs(t,e){t._wmWrapObserver&&(t._wmWrapObserver.disconnect(),t._wmWrapObserver=null),t._wmNodeObserver&&(t._wmNodeObserver.disconnect(),t._wmNodeObserver=null),t._wmObservedNode=null;const i=e||t.w&&t.w.dom&&t.w.dom.elWrap;i&&zs.remove(i,{manage:!1})}function Us(t,e){try{if(!d.isBrowser())return;if(t&&t.globals&&t.globals.isDestroyed)return void $s.delete(e);const i=t&&t.dom&&t.dom.elWrap;if(!i)return;const s=function(t,e){const i=t&&t.config&&t.config.chart||{},s=[];"unit"===i.type&&s.push("unit"),e.trellis&&"function"==typeof e.trellis.isActive&&e.trellis.isActive()&&s.push("trellis"),e.storyboard&&e.storyboard._used&&s.push("storyboard");const a=i.link;return e.linkedViews&&a&&(!0===a.enabled||"function"==typeof a.dimension)&&s.push("link"),e.ink&&i.ink&&!0===i.ink.enabled&&s.push("ink"),e.measure&&i.measure&&!0===i.measure.enabled&&s.push("measure"),e.contextMenu&&i.contextMenu&&!0===i.contextMenu.enabled&&s.push("context-menu"),e.perspectives&&e.perspectives._used&&s.push("perspectives"),e.history&&i.history&&!0===i.history.enabled&&s.push("history"),s}(t,e);if(0===s.length)return $s.delete(e),void Vs(e,i);$s.add(e);const a=function(t){const e=t&&t.config&&t.config.chart&&t.config.chart.license;if(e)return e;const i=Rs.getKey();if(i)return i;const s=d.getApex();return s&&s.license?s.license:null}(t);if(function(t){if(!t)return!1;const e=Rs.validateKey(t);if(!e.valid)return!1;const i=e.data&&e.data.plan;return"string"==typeof i&&Gs.has(i.toLowerCase())}(a))return void Vs(e,i);!function(t,e){if(js(t,e),"undefined"==typeof MutationObserver||t._wmWrapObserver)return;const i=new MutationObserver(()=>{zs.node(e)||js(t,e)});i.observe(e,{childList:!0}),t._wmWrapObserver=i}(e,i),function(t,e,i){if(t._premiumLicenseNotified)return;if(t._premiumLicenseNotified=!0,i.length,!e)return;const s=Rs.validateKey(e);if(s.valid)return void(s.data&&s.data.plan);Rs.getKey()}(e,a,s)}catch(t){}}function qs(){if(!d.isBrowser())return;const t=new Set,e=d.getApex(),i=e&&e._chartInstances;Array.isArray(i)&&i.forEach(e=>{const i=e&&e.chart;i&&i.w&&!i.w.globals.isDestroyed&&(t.add(i),Us(i.w,i))}),Array.from($s).forEach(e=>{const i=e&&e.w,s=i&&i.dom&&i.dom.elWrap;i&&!i.globals.isDestroyed&&s&&!1!==s.isConnected?t.has(e)||Us(i,e):$s.delete(e)})}Rs.onChange(qs);const Zs=class t{constructor(t,e){h(this,"core"),h(this,"responsive"),h(this,"axes"),h(this,"grid"),h(this,"graphics"),h(this,"coreUtils"),h(this,"crosshairs"),h(this,"events"),h(this,"fill"),h(this,"localization"),h(this,"options"),h(this,"series"),h(this,"theme"),h(this,"formatters"),h(this,"titleSubtitle"),h(this,"dimensions"),h(this,"updateHelpers"),h(this,"tooltip"),h(this,"data"),h(this,"animations"),h(this,"exports"),h(this,"legend"),h(this,"toolbar"),h(this,"zoomPanSelection"),h(this,"keyboardNavigation"),h(this,"annotations"),h(this,"morphTypeChange"),h(this,"timeScale"),h(this,"_keyboardNavigation"),h(this,"_zoomPanSelection"),h(this,"windowResizeHandler"),h(this,"parentResizeHandler"),h(this,"publicMethods",[]),h(this,"eventList",[]),h(this,"_renderPromise",null),h(this,"config"),h(this,"perspectives"),h(this,"storyboard"),h(this,"history"),h(this,"linkedViews"),h(this,"trellis"),h(this,"ink"),h(this,"measure"),h(this,"contextMenu"),h(this,"weave"),h(this,"renderer"),h(this,"rendererController"),this.opts=e,this.ctx=this,this.w=new W(e).init(),this.el=t,this.w.globals.cuid=v.randomId(),this.w.globals.chartID=this.w.config.chart.id?v.escapeString(this.w.config.chart.id):this.w.globals.cuid,At(this.w);new ds(this).initModules(),this.lastUpdateOptions=null,this._updateStats={fast:0,fastWithAxes:0,full:0},this.create=this.create.bind(this),d.isBrowser()&&(this.windowResizeHandler=this._windowResizeHandler.bind(this),this.parentResizeHandler=this._parentResizeCallback.bind(this))}render(){var t,e;if(!(null==(e=null==(t=this.w)?void 0:t.config)?void 0:e.chart))return Promise.reject(new Error("ApexCharts: chart configuration is missing or invalid. Ensure the options object includes a `chart` property."));if(this._renderPromise)return this._renderPromise;const i=new Promise((t,e)=>{var i,s,a,r,n,o,l,h,c,p,u,g,f;if(v.elementExists(this.el)){void 0===Apex._chartInstances&&(Apex._chartInstances=[]),this.w.config.chart.id&&Apex._chartInstances.push({id:this.w.globals.chartID,group:this.w.config.chart.group,chart:this}),this.setLocale(this.w.config.chart.defaultLocale);const x=this.w.config.chart.events.beforeMount;"function"==typeof x&&x(this,this.w),this.events.fireEvent("beforeMount",[this,this.w]);const m=this.w.config.trellis,y=!(!m||!(m.by||m.row||m.column)),w=!!(y&&this.trellis&&this.trellis.isActive());if(y&&this.trellis,(null==(s=null==(i=this.w.config.chart)?void 0:i.measure)?void 0:s.enabled)&&this.measure,(null==(r=null==(a=this.w.config.chart)?void 0:a.link)?void 0:r.enabled)&&this.linkedViews,!this.ink){null==(o=null==(n=this.w.config.chart)?void 0:n.ink)||o.enabled,(null!=(h=null==(l=this.w.config.annotations)?void 0:l.points)?h:[]).some(t=>t&&t.draggable)}if((null==(p=null==(c=this.w.config.chart)?void 0:c.contextMenu)?void 0:p.enabled)&&this.contextMenu,(null==(g=null==(u=this.w.config.chart)?void 0:u.history)?void 0:g.enabled)&&this.history,d.isBrowser()){w||(window.addEventListener("resize",this.windowResizeHandler),ks(this.el.parentNode,this.parentResizeHandler));const t=this.el.getRootNode&&this.el.getRootNode(),e=v.is("ShadowRoot",t),i=this.el.ownerDocument;let s=e?t.getElementById("apexcharts-css"):i.getElementById("apexcharts-css");if(!s){s=b.createElementNS("http://www.w3.org/1999/xhtml","style"),s.id="apexcharts-css",s.textContent="@keyframes opaque {\n  0% {\n    opacity: 0\n  }\n\n  to {\n    opacity: 1\n  }\n}\n\n@keyframes resizeanim {\n\n  0%,\n  to {\n    opacity: 0\n  }\n}\n\n.apexcharts-canvas {\n  position: relative;\n  direction: ltr !important;\n  user-select: none;\n  /* Focus indicator colour. Themes override below. */\n  --apexcharts-focus-color: #008FFB;\n}\n\n/* Dark theme & high-contrast: brighter focus colour for sufficient contrast. */\n.apexcharts-canvas .apexcharts-theme-dark,\n.apexcharts-theme-dark.apexcharts-canvas {\n  --apexcharts-focus-color: #FFD500;\n}\n.apexcharts-canvas.apexcharts-high-contrast,\n.apexcharts-high-contrast.apexcharts-canvas {\n  --apexcharts-focus-color: #FFFF00;\n}\n\n/* Visually-hidden aria-live status region (WCAG 4.1.3 Status Messages). */\n.apexcharts-sr-status {\n  position: absolute;\n  width: 1px;\n  height: 1px;\n  padding: 0;\n  margin: -1px;\n  overflow: hidden;\n  clip: rect(0, 0, 0, 0);\n  white-space: nowrap;\n  border: 0;\n}\n\n/* Respect OS-level reduced-motion preference (WCAG 2.3.3). */\n@media (prefers-reduced-motion: reduce) {\n  .apexcharts-canvas *,\n  .apexcharts-canvas *::before,\n  .apexcharts-canvas *::after {\n    animation-duration: 0.01ms !important;\n    animation-iteration-count: 1 !important;\n    transition-duration: 0.01ms !important;\n  }\n}\n\n.apexcharts-canvas ::-webkit-scrollbar {\n  -webkit-appearance: none;\n  width: 6px\n}\n\n.apexcharts-canvas ::-webkit-scrollbar-thumb {\n  border-radius: 4px;\n  background-color: rgba(0, 0, 0, .5);\n  box-shadow: 0 0 1px rgba(255, 255, 255, .5);\n  -webkit-box-shadow: 0 0 1px rgba(255, 255, 255, .5)\n}\n\n.apexcharts-inner {\n  position: relative\n}\n\n.apexcharts-text tspan {\n  font-family: inherit\n}\n\nrect.legend-mouseover-inactive,\n.legend-mouseover-inactive rect,\n.legend-mouseover-inactive path,\n.legend-mouseover-inactive circle,\n.legend-mouseover-inactive line,\n.legend-mouseover-inactive text.apexcharts-yaxis-title-text,\n.legend-mouseover-inactive text.apexcharts-yaxis-label {\n  transition: .15s ease all;\n  opacity: .2\n}\n\n/* Linked Views (#4): per-mark crossfilter dim. Applied to individual data\n   marks (not whole series) whose x is outside the brushed range. Opacity is\n   overridable per chart via the --apx-cf-dim custom property. */\n.apexcharts-crossfilter-dimmed {\n  transition: opacity .25s ease;\n  opacity: var(--apx-cf-dim, .2)\n}\n\n/* Linked Views (#4): default styling for the built-in crossfilter data table\n   (cf.dataTable). Deliberately light so host styles can override. */\n.apexcharts-cf-table {\n  border-collapse: collapse;\n  width: 100%;\n  font-size: 13px;\n}\n.apexcharts-cf-table caption {\n  caption-side: bottom;\n  text-align: right;\n  padding: 6px 2px;\n  font-size: 12px;\n  opacity: .7\n}\n.apexcharts-cf-table th,\n.apexcharts-cf-table td {\n  padding: 6px 10px;\n  text-align: left;\n  border-bottom: 1px solid rgba(0, 0, 0, .08)\n}\n.apexcharts-cf-table th {\n  font-weight: 600;\n  border-bottom-width: 2px\n}\n.apexcharts-cf-table tbody tr:hover {\n  background: rgba(99, 102, 241, .06)\n}\n\n/* Measure ruler (#18): measure / delta ruler.\n   Theme via these classes or the --apx-measure-* custom properties below\n   (config `chart.measure.colors` overrides both). The ruler group also carries\n   a direction class: apexcharts-measure-up | -down | -flat.\n   Element classes:\n     .apexcharts-measure-band     shaded span band\n     .apexcharts-measure-vline    vertical guide lines\n     .apexcharts-measure-line     free-mode diagonal line\n     .apexcharts-measure-label-bg readout box     .apexcharts-measure-label text\n   Colors are applied as SVG presentation attributes, so any rule you write on\n   these classes overrides them. */\n.apexcharts-canvas {\n  --apx-measure-up: #16a34a;\n  --apx-measure-down: #dc2626;\n  --apx-measure-neutral: #64748b;\n  --apx-measure-guide: #94a3b8;\n}\n.apexcharts-measure-capture {\n  cursor: crosshair;\n}\n\n/* Radial Actions (#chrome): right-click context menu. Theme via these classes\n   or the --apx-menu-* custom properties. */\n.apexcharts-canvas {\n  --apx-menu-bg: #ffffff;\n  --apx-menu-fg: #1e293b;\n  --apx-menu-border: #e2e8f0;\n  --apx-menu-hover: #f1f5f9;\n  --apx-menu-shadow: rgba(15, 23, 42, 0.18);\n}\n.apexcharts-context-menu {\n  min-width: 168px;\n  padding: 4px;\n  border-radius: 8px;\n  background: var(--apx-menu-bg);\n  border: 1px solid var(--apx-menu-border);\n  box-shadow: 0 6px 22px var(--apx-menu-shadow);\n  font-family: Helvetica, Arial, sans-serif;\n  font-size: 13px;\n  z-index: 20;\n  user-select: none;\n}\n.apexcharts-context-menu-item {\n  display: block;\n  width: 100%;\n  box-sizing: border-box;\n  text-align: left;\n  padding: 7px 12px;\n  border: 0;\n  border-radius: 5px;\n  background: transparent;\n  color: var(--apx-menu-fg);\n  font: inherit;\n  cursor: pointer;\n}\n.apexcharts-context-menu-item:hover,\n.apexcharts-context-menu-item--active {\n  background: var(--apx-menu-hover);\n}\n.apexcharts-context-menu-item:focus {\n  outline: none;\n}\n\n/* Ink Layer (#7): the floating note editor card, opened by clicking an\n   ink-managed annotation. Theme via these classes or the --apx-ink-* vars. */\n.apexcharts-canvas {\n  --apx-ink-card-bg: #ffffff;\n  --apx-ink-card-fg: #1e293b;\n  --apx-ink-card-border: #e2e8f0;\n  --apx-ink-card-hover: #f1f5f9;\n  --apx-ink-card-accent: #6366f1;\n  --apx-ink-card-shadow: rgba(15, 23, 42, 0.18);\n}\n.apexcharts-ink-card {\n  position: absolute;\n  z-index: 25;\n  display: flex;\n  flex-direction: column;\n  gap: 6px;\n  padding: 8px;\n  border-radius: 8px;\n  background: var(--apx-ink-card-bg);\n  border: 1px solid var(--apx-ink-card-border);\n  box-shadow: 0 6px 22px var(--apx-ink-card-shadow);\n  font-family: Helvetica, Arial, sans-serif;\n  font-size: 12px;\n  color: var(--apx-ink-card-fg);\n  user-select: none;\n}\n.apexcharts-ink-card-row {\n  display: flex;\n  align-items: center;\n  gap: 4px;\n}\n.apexcharts-ink-card input.apexcharts-ink-editor {\n  flex: 1 1 auto;\n  width: 150px;\n  min-width: 0;\n  box-sizing: border-box;\n  padding: 4px 6px;\n  font: inherit;\n  color: inherit;\n  background: transparent;\n  border: 1px solid var(--apx-ink-card-border);\n  border-radius: 5px;\n}\n.apexcharts-ink-card input.apexcharts-ink-editor:focus {\n  outline: none;\n  border-color: var(--apx-ink-card-accent);\n}\n.apexcharts-ink-btn {\n  flex: 0 0 auto;\n  width: 24px;\n  height: 24px;\n  display: inline-flex;\n  align-items: center;\n  justify-content: center;\n  padding: 0;\n  border: 0;\n  border-radius: 5px;\n  background: transparent;\n  color: inherit;\n  font: inherit;\n  font-size: 12px;\n  line-height: 1;\n  cursor: pointer;\n}\n.apexcharts-ink-btn:hover,\n.apexcharts-ink-btn--active {\n  background: var(--apx-ink-card-hover);\n}\n.apexcharts-ink-btn:focus-visible,\n.apexcharts-ink-swatch:focus-visible {\n  outline: 2px solid var(--apx-ink-card-accent);\n  outline-offset: 1px;\n}\n.apexcharts-ink-btn--bold {\n  font-weight: 700;\n}\n.apexcharts-ink-btn--delete:hover {\n  color: #dc2626;\n}\n.apexcharts-ink-swatch {\n  flex: 0 0 auto;\n  width: 16px;\n  height: 16px;\n  padding: 0;\n  border: 1px solid rgba(100, 116, 139, 0.45);\n  border-radius: 50%;\n  cursor: pointer;\n}\n.apexcharts-ink-swatch--active {\n  box-shadow:\n    0 0 0 2px var(--apx-ink-card-bg),\n    0 0 0 4px var(--apx-ink-card-accent);\n}\n.apexcharts-ink-sep {\n  flex: 0 0 auto;\n  width: 1px;\n  height: 16px;\n  margin: 0 2px;\n  background: var(--apx-ink-card-border);\n}\n.apexcharts-ink-cardlabel {\n  flex: 0 0 auto;\n  font-size: 10px;\n  letter-spacing: 0.4px;\n  text-transform: uppercase;\n  opacity: 0.65;\n  margin-right: 2px;\n}\n.apexcharts-ink-marker-size {\n  flex: 0 0 auto;\n  min-width: 16px;\n  text-align: center;\n  font-variant-numeric: tabular-nums;\n}\n\n.apexcharts-legend-text {\n  padding-left: 15px;\n  margin-left: -15px;\n}\n\n.apexcharts-legend-series[role=\"button\"]:focus {\n  outline: 2px solid var(--apexcharts-focus-color, #008FFB);\n  outline-offset: 2px;\n}\n\n.apexcharts-legend-series[role=\"button\"]:focus:not(:focus-visible) {\n  outline: none;\n}\n\n.apexcharts-legend-series[role=\"button\"]:focus-visible {\n  outline: 2px solid var(--apexcharts-focus-color, #008FFB);\n  outline-offset: 2px;\n}\n\n.apexcharts-series-collapsed {\n  opacity: 0\n}\n\n/* A series still playing its exit tween stays painted so it can visibly shrink\n   away, hiding it on the first frame leaves a hole in a stacked chart for the\n   length of the animation. Dropped once the tween lands. */\n.apexcharts-series-collapsed.apexcharts-series-collapsing {\n  opacity: 1\n}\n\n/* Its labels ride the shrinking marks, but a mark runs out of room for its text\n   well before it reaches zero, so fade them across the exit instead of holding\n   them crisp over a sliver. Duration is set inline from dynamicAnimation.speed. */\n.apexcharts-datalabels.apexcharts-series-collapsing {\n  animation: apexcharts-datalabels-exit var(--apexcharts-dl-exit, 400ms) ease-in\n    forwards;\n}\n\n@keyframes apexcharts-datalabels-exit {\n  from {\n    opacity: 1\n  }\n  to {\n    opacity: 0\n  }\n}\n\n.apexcharts-canvas svg:focus:not(:focus-visible) {\n  outline: none;\n}\n\n/* Keyboard navigation focus indicator on SVG data elements.\n   SVG elements don't support CSS outline, so we use stroke. */\n.apexcharts-bar-area.apexcharts-keyboard-focused,\n.apexcharts-candlestick-area.apexcharts-keyboard-focused,\n.apexcharts-boxPlot-area.apexcharts-keyboard-focused,\n.apexcharts-rangebar-area.apexcharts-keyboard-focused,\n.apexcharts-pie-area.apexcharts-keyboard-focused,\n.apexcharts-heatmap-rect.apexcharts-keyboard-focused,\n.apexcharts-treemap-rect.apexcharts-keyboard-focused {\n  stroke: var(--apexcharts-focus-color, #008FFB);\n  stroke-width: 2;\n  stroke-opacity: 1;\n}\n\n.apexcharts-tooltip {\n  --apx-tt-bg: #ffffff;\n  /* Shared by the body and the arrow's two outward facets, so the\n   * hairline reads as one continuous outline around the whole shape.\n   * Keep it strong enough to survive on its own: the shadow below is\n   * elevation, not edge definition. */\n  --apx-tt-border: rgba(15, 23, 42, 0.12);\n  /* Elevation, in three layers: a tight contact shadow that anchors the\n   * bottom edge, a directional key shadow for the lift, and a wide\n   * ambient one that grounds the whole box. Each is weaker and more\n   * diffuse than the last.\n   *\n   * A tooltip is unusual in that it floats over *data*, so reach costs\n   * more than it does on a page: every pixel the shadow travels tints a\n   * bar or a line the reader is trying to compare. These numbers are\n   * tuned to keep the near-edge contrast that reads as elevation while\n   * dropping the long low haze that only muddies the plot.\n   *\n   * Note there is deliberately no `0 0 0 1px` ring layer. That used to\n   * stand in for edge definition back when --apx-tt-border was barely\n   * visible; now that the border is a real hairline (and the arrow\n   * shares it) a ring only double-draws the outline, and being spread\n   * rather than offset it leaked ink upward too, flattening the lift.\n   *\n   * `--apx-tt-shadow-dir` flips the whole stack's Y in one place \u2014 see\n   * the `[data-placement=\"bottom\"]` rule further down. */\n  --apx-tt-shadow-dir: 1;\n  --apx-tt-shadow: 0 calc(var(--apx-tt-shadow-dir) * 1px) 2px rgba(15, 23, 42, 0.06), 0 calc(var(--apx-tt-shadow-dir) * 4px) 8px -2px rgba(15, 23, 42, 0.10), 0 calc(var(--apx-tt-shadow-dir) * 12px) 20px -8px rgba(15, 23, 42, 0.14);\n  --apx-tt-arrow-bg: var(--apx-tt-bg);\n  --apx-tt-color: #0f172a;\n  --apx-tt-color-muted: rgba(15, 23, 42, 0.55);\n  border-radius: 8px;\n  background: var(--apx-tt-bg);\n  border: 1px solid var(--apx-tt-border);\n  box-shadow: var(--apx-tt-shadow);\n  color: var(--apx-tt-color);\n  cursor: default;\n  font-size: 13px;\n  left: 0;\n  top: 0;\n  opacity: 0;\n  pointer-events: none;\n  position: absolute;\n  display: flex;\n  flex-direction: column;\n  padding: 2px 0;\n  white-space: nowrap;\n  z-index: 12;\n  transition: opacity .12s ease\n}\n\n/* While the tooltip is visible, smoothly animate position changes\n * between data points. Kept short (160 ms) and ease-out so it stays\n * responsive \u2014 too long would feel laggy when sweeping across many\n * points fast. The position transition is only attached after the\n * first paint (Position.applyTooltipPosition flips `data-positioned`\n * once the tooltip has been placed) so the *first* show doesn't slide\n * the tooltip in from the previously-stale (0,0) coordinates. */\n.apexcharts-tooltip.apexcharts-active {\n  opacity: 1;\n  transition: opacity .12s ease\n}\n.apexcharts-tooltip.apexcharts-active[data-positioned=\"true\"] {\n  transition: opacity .12s ease, left .16s ease-out, top .16s ease-out\n}\n\n.apexcharts-tooltip.apexcharts-theme-light {\n  /* defaults already set above; class kept for backward-compat selectors */\n}\n\n.apexcharts-tooltip.apexcharts-theme-dark {\n  --apx-tt-bg: #1c1c1f;\n  --apx-tt-border: rgba(255, 255, 255, 0.16);\n  /* Dark needs more alpha than light to register at all, but not as much\n   * as it used to: the light rim above now carries the edge, so the\n   * shadow is free to be pure elevation instead of doubling as an\n   * outline. Same geometry as light, heavier ink. */\n  --apx-tt-shadow: 0 calc(var(--apx-tt-shadow-dir) * 1px) 2px rgba(0, 0, 0, 0.24), 0 calc(var(--apx-tt-shadow-dir) * 4px) 8px -2px rgba(0, 0, 0, 0.30), 0 calc(var(--apx-tt-shadow-dir) * 12px) 20px -8px rgba(0, 0, 0, 0.38);\n  --apx-tt-color: #f3f4f6;\n  --apx-tt-color-muted: rgba(243, 244, 246, 0.55);\n}\n\n.apexcharts-tooltip * {\n  font-family: inherit\n}\n\n/* Point-annotation hover tooltip (apexcharts/apexcharts.js#2424). Reuses the\n * glass body/border/shadow from `.apexcharts-tooltip` but holds free-form\n * content, so it needs its own padding, wrapping and a sane max width. */\n.apexcharts-tooltip.apexcharts-annotation-tooltip {\n  padding: 6px 10px;\n  max-width: 240px;\n  white-space: normal;\n  line-height: 1.4;\n  pointer-events: none;\n  z-index: 13\n}\n\n.apexcharts-tooltip-title {\n  padding: 8px 12px 4px;\n  font-size: 12px;\n  font-weight: 600;\n  letter-spacing: 0.01em;\n  color: var(--apx-tt-color-muted);\n  background: transparent;\n  border-bottom: none;\n  margin-bottom: 0\n}\n\n.apexcharts-tooltip.apexcharts-theme-light .apexcharts-tooltip-title,\n.apexcharts-tooltip.apexcharts-theme-dark .apexcharts-tooltip-title {\n  background: transparent;\n  border-bottom: none\n}\n\n/* `fillSeriesColor`: each series-group already paints itself with the\n * series colour. Drop the glass body entirely (transparent bg, no\n * border, no backdrop-filter, no padding) and clip the coloured\n * series-group(s) to the tooltip's rounded corners so they fill the\n * shell edge-to-edge. Text inside the coloured group is forced to\n * white for contrast. */\n.apexcharts-tooltip.apexcharts-tooltip-fill-series {\n  background: transparent;\n  -webkit-backdrop-filter: none;\n  backdrop-filter: none;\n  border: none;\n  padding: 0;\n  overflow: hidden;\n  color: #fff\n}\n\n.apexcharts-tooltip.apexcharts-tooltip-fill-series .apexcharts-tooltip-title {\n  background: rgba(0, 0, 0, 0.22);\n  color: #fff;\n  opacity: 1;\n  padding: 6px 12px\n}\n\n.apexcharts-tooltip.apexcharts-tooltip-fill-series .apexcharts-tooltip-series-group {\n  color: #fff\n}\n\n/* Arrow connector \u2014 a 45\xb0-rotated square straddling the body's edge, so\n * the body's 1px border runs continuously out across the arrow and back.\n * The two facets that face away from the tooltip carry the border; the\n * two that face into it carry none, and the square's opaque fill covers\n * the segment of the body's own border it sits on, hiding the seam.\n *\n * This is why it's a rotated square and not a triangle: `clip-path`\n * erases `border` and `box-shadow` along with everything outside the\n * polygon, which left `filter: drop-shadow` as the only way to suggest\n * an edge \u2014 and a drop-shadow can only ever blur one, never draw a\n * hairline. Nothing here needs a filter.\n *\n * Geometry: a square of side S rotated 45\xb0 reaches S/\u221a2 from its centre\n * to each corner, so S = 10px gives the ~7px tip overhang that\n * ARROW_TIP_OVERHANG assumes (tooltip/constants.js) over a ~14px base.\n * The offsets park the square's *centre* 1px outside the padding box\n * (-6px = -1px border - 10px/2), i.e. exactly on the body's border line,\n * so the two borders meet end to end instead of overlapping or gapping.\n * `box-sizing` must be border-box or the bordered sides would grow the\n * square asymmetrically and knock its centre off that line. */\n.apexcharts-tooltip-arrow {\n  position: absolute;\n  box-sizing: border-box;\n  width: 10px;\n  height: 10px;\n  background: var(--apx-tt-arrow-bg);\n  transform: rotate(45deg);\n  pointer-events: none;\n  top: calc(var(--apx-tt-arrow-y, 50%) - 5px)\n}\n\n/* Which two sides face outward depends on the placement. Under\n * `rotate(45deg)` the square's bottom-left corner swings to the left,\n * top-right to the right, top-left to the top and bottom-right to the\n * bottom \u2014 so the pair of borders below is always the two sharing the\n * corner that ends up as the tip. */\n.apexcharts-tooltip[data-placement=\"right\"] .apexcharts-tooltip-arrow {\n  left: -6px;\n  border-left: 1px solid var(--apx-tt-border);\n  border-bottom: 1px solid var(--apx-tt-border)\n}\n\n.apexcharts-tooltip[data-placement=\"left\"] .apexcharts-tooltip-arrow {\n  right: -6px;\n  border-top: 1px solid var(--apx-tt-border);\n  border-right: 1px solid var(--apx-tt-border)\n}\n\n/* Vertical arrow variants: tooltip is above/below the data point and the\n * arrow points down/up. The base rule above uses `--apx-tt-arrow-y` for\n * left/right placement; for top/bottom we centre on `--apx-tt-arrow-x`\n * instead (set by applyTooltipPosition). */\n.apexcharts-tooltip[data-placement=\"top\"] .apexcharts-tooltip-arrow,\n.apexcharts-tooltip[data-placement=\"bottom\"] .apexcharts-tooltip-arrow {\n  top: auto;\n  left: calc(var(--apx-tt-arrow-x, 50%) - 5px)\n}\n\n.apexcharts-tooltip[data-placement=\"top\"] .apexcharts-tooltip-arrow {\n  bottom: -6px;\n  border-right: 1px solid var(--apx-tt-border);\n  border-bottom: 1px solid var(--apx-tt-border)\n}\n\n.apexcharts-tooltip[data-placement=\"bottom\"] .apexcharts-tooltip-arrow {\n  top: -6px;\n  border-top: 1px solid var(--apx-tt-border);\n  border-left: 1px solid var(--apx-tt-border)\n}\n\n/* When the tooltip is flipped below the data point, the default\n * downward-biased shadow leaves its top edge undefined. Negating the\n * direction casts the whole elevation upward instead, so the shadow\n * falls between the tooltip and the mark above it. One multiplier flips\n * all three layers together; the arrow needs no counterpart, since its\n * border doesn't depend on light direction. */\n.apexcharts-tooltip[data-placement=\"bottom\"] {\n  --apx-tt-shadow-dir: -1\n}\n\n.apexcharts-tooltip-text-goals-value,\n.apexcharts-tooltip-text-y-value,\n.apexcharts-tooltip-text-z-value {\n  display: inline-block;\n  margin-left: 5px;\n  font-weight: 600\n}\n\n.apexcharts-tooltip-text-goals-label:empty,\n.apexcharts-tooltip-text-goals-value:empty,\n.apexcharts-tooltip-text-y-label:empty,\n.apexcharts-tooltip-text-y-value:empty,\n.apexcharts-tooltip-text-z-value:empty,\n.apexcharts-tooltip-title:empty {\n  display: none\n}\n\n.apexcharts-tooltip-text-goals-label,\n.apexcharts-tooltip-text-goals-value {\n  padding: 6px 0 5px\n}\n\n.apexcharts-tooltip-goals-group,\n.apexcharts-tooltip-text-goals-label,\n.apexcharts-tooltip-text-goals-value {\n  display: flex\n}\n\n.apexcharts-tooltip-text-goals-label:not(:empty),\n.apexcharts-tooltip-text-goals-value:not(:empty) {\n  margin-top: -6px\n}\n\n.apexcharts-tooltip-marker {\n  display: inline-flex;\n  align-items: center;\n  justify-content: center;\n  position: relative;\n  width: 12px;\n  height: 12px;\n  margin-right: 6px;\n  vertical-align: middle;\n  color: inherit;\n}\n\n.apexcharts-tooltip-marker svg {\n  width: 100%;\n  height: 100%;\n  display: block;\n}\n\n.apexcharts-tooltip-series-group {\n  padding: 4px 12px;\n  display: none;\n  gap: 8px;\n  text-align: left;\n  justify-content: left;\n  align-items: center\n}\n\n.apexcharts-tooltip-series-group.apexcharts-active .apexcharts-tooltip-marker {\n  opacity: 1\n}\n\n.apexcharts-tooltip-series-group.apexcharts-active:last-child,\n.apexcharts-tooltip-series-group:last-child {\n  padding-bottom: 8px\n}\n\n.apexcharts-tooltip-y-group {\n  padding: 6px 0 5px\n}\n\n/* `tooltip.compact`: a tight box instead of a card, for panels a normal card\n   would cover (small multiples, sparklines, tiles). Only the box shrinks, so\n   the arrow and every anchor rule still apply. Rows stay stacked when there\n   are several series (the names are what tells them apart); a one-series\n   chart collapses to a single line, see `-value-only` below. */\n.apexcharts-tooltip.apexcharts-tooltip-compact {\n  padding: 3px 8px;\n  font-size: 11px;\n  line-height: 1.35\n}\n\n.apexcharts-tooltip-compact .apexcharts-tooltip-title {\n  padding: 0;\n  font-size: 11px;\n  white-space: nowrap\n}\n\n.apexcharts-tooltip-compact .apexcharts-tooltip-series-group,\n.apexcharts-tooltip-compact .apexcharts-tooltip-series-group.apexcharts-active:last-child,\n.apexcharts-tooltip-compact .apexcharts-tooltip-series-group:last-child {\n  padding: 0;\n  gap: 5px\n}\n\n.apexcharts-tooltip-compact .apexcharts-tooltip-y-group {\n  padding: 0\n}\n\n.apexcharts-tooltip-compact .apexcharts-tooltip-marker {\n  width: 8px;\n  height: 8px\n}\n\n/* A one-series panel: the series name repeats what the panel header already\n   says, so the value stands alone and the x label becomes its prefix on one\n   line (\"Aug 2024  6.59\"). */\n.apexcharts-tooltip.apexcharts-tooltip-compact.apexcharts-tooltip-value-only {\n  /* The tooltip body is a flex COLUMN by default (title row, then series\n     rows); one series needs no column, so the same box turns into one line. */\n  flex-direction: row;\n  align-items: baseline;\n  gap: 6px\n}\n\n.apexcharts-tooltip-value-only .apexcharts-tooltip-marker {\n  display: none\n}\n\n.apexcharts-tooltip-value-only .apexcharts-tooltip-text-y-label {\n  display: none\n}\n\n.apexcharts-custom-tooltip,\n.apexcharts-tooltip-box {\n  padding: 4px 8px\n}\n\n.apexcharts-tooltip-boxPlot {\n  display: flex;\n  flex-direction: column-reverse\n}\n\n.apexcharts-tooltip-box>div {\n  margin: 4px 0\n}\n\n.apexcharts-tooltip-box span.value {\n  font-weight: 700\n}\n\n.apexcharts-tooltip-rangebar {\n  padding: 5px 8px\n}\n\n.apexcharts-tooltip-rangebar .category {\n  font-weight: 600;\n  color: #777\n}\n\n.apexcharts-tooltip-rangebar .series-name {\n  font-weight: 700;\n  display: block;\n  margin-bottom: 5px\n}\n\n/* X/Y axis tooltips \u2014 small popovers that label the crosshair on the\n * axes. Restyled to match the modern data-tooltip palette: solid white\n * body with a subtle border + soft drop-shadow, smaller font, rounded\n * corners. The arrows still use the CSS border-triangle technique\n * (cheap, crisp at small sizes); their colours flow from CSS variables\n * so light/dark themes only need one override per axis. */\n.apexcharts-xaxistooltip,\n.apexcharts-yaxistooltip {\n  --apx-axt-bg: #ffffff;\n  --apx-axt-border: rgba(15, 23, 42, 0.08);\n  --apx-axt-color: #0f172a;\n  --apx-axt-shadow: 0 4px 12px -4px rgba(15, 23, 42, 0.18), 0 1px 3px -1px rgba(15, 23, 42, 0.12);\n  opacity: 0;\n  pointer-events: none;\n  color: var(--apx-axt-color);\n  font-size: 12px;\n  font-weight: 500;\n  text-align: center;\n  border-radius: 6px;\n  position: absolute;\n  z-index: 10;\n  background: var(--apx-axt-bg);\n  border: 1px solid var(--apx-axt-border);\n  box-shadow: var(--apx-axt-shadow)\n}\n\n.apexcharts-xaxistooltip.apexcharts-theme-dark,\n.apexcharts-yaxistooltip.apexcharts-theme-dark {\n  --apx-axt-bg: #1c1c1f;\n  --apx-axt-border: rgba(255, 255, 255, 0.1);\n  --apx-axt-color: #f3f4f6;\n  --apx-axt-shadow: 0 4px 12px -4px rgba(0, 0, 0, 0.55), 0 1px 3px -1px rgba(0, 0, 0, 0.45)\n}\n\n.apexcharts-xaxistooltip {\n  padding: 4px 8px;\n  transition: .15s ease all\n}\n\n.apexcharts-xaxistooltip:after,\n.apexcharts-xaxistooltip:before {\n  left: 50%;\n  border: solid transparent;\n  content: \" \";\n  height: 0;\n  width: 0;\n  position: absolute;\n  pointer-events: none\n}\n\n/* :before paints the 1px border outline of the triangle (slightly larger\n * than :after); :after sits inside and paints the fill \u2014 leaves a 1px\n * ring of :before visible at the edges. */\n.apexcharts-xaxistooltip:after {\n  border-color: transparent;\n  border-width: 5px;\n  margin-left: -5px\n}\n\n.apexcharts-xaxistooltip:before {\n  border-color: transparent;\n  border-width: 6px;\n  margin-left: -6px\n}\n\n.apexcharts-xaxistooltip-bottom:after,\n.apexcharts-xaxistooltip-bottom:before {\n  bottom: 100%\n}\n\n.apexcharts-xaxistooltip-top:after,\n.apexcharts-xaxistooltip-top:before {\n  top: 100%\n}\n\n.apexcharts-xaxistooltip-bottom:after {\n  border-bottom-color: var(--apx-axt-bg)\n}\n\n.apexcharts-xaxistooltip-bottom:before {\n  border-bottom-color: var(--apx-axt-border)\n}\n\n.apexcharts-xaxistooltip-top:after {\n  border-top-color: var(--apx-axt-bg)\n}\n\n.apexcharts-xaxistooltip-top:before {\n  border-top-color: var(--apx-axt-border)\n}\n\n.apexcharts-xaxistooltip.apexcharts-active {\n  opacity: 1;\n  transition: .15s ease all\n}\n\n.apexcharts-yaxistooltip {\n  padding: 3px 8px\n}\n\n.apexcharts-yaxistooltip:after,\n.apexcharts-yaxistooltip:before {\n  top: 50%;\n  border: solid transparent;\n  content: \" \";\n  height: 0;\n  width: 0;\n  position: absolute;\n  pointer-events: none\n}\n\n.apexcharts-yaxistooltip:after {\n  border-color: transparent;\n  border-width: 5px;\n  margin-top: -5px\n}\n\n.apexcharts-yaxistooltip:before {\n  border-color: transparent;\n  border-width: 6px;\n  margin-top: -6px\n}\n\n.apexcharts-yaxistooltip-left:after,\n.apexcharts-yaxistooltip-left:before {\n  left: 100%\n}\n\n.apexcharts-yaxistooltip-right:after,\n.apexcharts-yaxistooltip-right:before {\n  right: 100%\n}\n\n.apexcharts-yaxistooltip-left:after {\n  border-left-color: var(--apx-axt-bg)\n}\n\n.apexcharts-yaxistooltip-left:before {\n  border-left-color: var(--apx-axt-border)\n}\n\n.apexcharts-yaxistooltip-right:after {\n  border-right-color: var(--apx-axt-bg)\n}\n\n.apexcharts-yaxistooltip-right:before {\n  border-right-color: var(--apx-axt-border)\n}\n\n.apexcharts-yaxistooltip.apexcharts-active {\n  opacity: 1\n}\n\n.apexcharts-yaxistooltip-hidden {\n  display: none\n}\n\n.apexcharts-xcrosshairs,\n.apexcharts-ycrosshairs {\n  pointer-events: none;\n  opacity: 0;\n  transition: .15s ease all\n}\n\n.apexcharts-xcrosshairs.apexcharts-active,\n.apexcharts-ycrosshairs.apexcharts-active {\n  opacity: 1;\n  transition: .15s ease all\n}\n\n.apexcharts-ycrosshairs-hidden {\n  opacity: 0\n}\n\n.apexcharts-selection-rect {\n  cursor: move\n}\n\n.svg_select_shape {\n  stroke-width: 1;\n  stroke-dasharray: 10 10;\n  stroke: black;\n  stroke-opacity: 0.1;\n  pointer-events: none;\n  fill: none;\n}\n\n.svg_select_handle {\n  stroke-width: 3;\n  stroke: black;\n  fill: none;\n}\n\n.svg_select_handle_r {\n  cursor: e-resize;\n}\n\n.svg_select_handle_l {\n  cursor: w-resize;\n}\n\n.apexcharts-svg.apexcharts-zoomable.hovering-zoom {\n  cursor: crosshair\n}\n\n.apexcharts-svg.apexcharts-zoomable.hovering-pan {\n  cursor: move\n}\n\n.apexcharts-menu-icon,\n.apexcharts-measure-icon,\n.apexcharts-pan-icon,\n.apexcharts-reset-icon,\n.apexcharts-selection-icon,\n.apexcharts-toolbar-custom-icon,\n.apexcharts-zoom-icon,\n.apexcharts-zoomin-icon,\n.apexcharts-zoomout-icon {\n  cursor: pointer;\n  /* WCAG 2.5.8 Target Size (Minimum): 24\xd724 CSS px hit target. */\n  width: 26px;\n  height: 24px;\n  line-height: 24px;\n  color: #6e8192;\n  text-align: center;\n  /* Reset native <button> chrome \u2014 these are styled via SVG icons. */\n  padding: 0;\n  margin: 0;\n  background: transparent;\n  border: 0;\n  border-radius: 5px;\n  display: inline-flex;\n  align-items: center;\n  justify-content: center;\n  transition: background-color .12s ease, color .12s ease;\n}\n\n.apexcharts-menu-icon svg,\n.apexcharts-measure-icon svg,\n.apexcharts-pan-icon svg,\n.apexcharts-reset-icon svg,\n.apexcharts-selection-icon svg,\n.apexcharts-zoom-icon svg,\n.apexcharts-zoomin-icon svg,\n.apexcharts-zoomout-icon svg {\n  width: 18px;\n  height: 18px;\n  fill: none;\n  stroke: currentColor;\n  stroke-width: 2;\n  stroke-linecap: round;\n  stroke-linejoin: round\n}\n\n.apexcharts-theme-dark .apexcharts-menu-icon,\n.apexcharts-theme-dark .apexcharts-measure-icon,\n.apexcharts-theme-dark .apexcharts-pan-icon,\n.apexcharts-theme-dark .apexcharts-reset-icon,\n.apexcharts-theme-dark .apexcharts-selection-icon,\n.apexcharts-theme-dark .apexcharts-toolbar-custom-icon,\n.apexcharts-theme-dark .apexcharts-zoom-icon,\n.apexcharts-theme-dark .apexcharts-zoomin-icon,\n.apexcharts-theme-dark .apexcharts-zoomout-icon {\n  color: #d4d6dc\n}\n\n.apexcharts-canvas .apexcharts-measure-icon.apexcharts-selected,\n.apexcharts-canvas .apexcharts-pan-icon.apexcharts-selected,\n.apexcharts-canvas .apexcharts-reset-zoom-icon.apexcharts-selected,\n.apexcharts-canvas .apexcharts-selection-icon.apexcharts-selected,\n.apexcharts-canvas .apexcharts-zoom-icon.apexcharts-selected {\n  background: rgba(0, 143, 251, 0.12);\n  color: #008ffb\n}\n\n.apexcharts-theme-light .apexcharts-menu-icon:hover,\n.apexcharts-theme-light .apexcharts-measure-icon:not(.apexcharts-selected):hover,\n.apexcharts-theme-light .apexcharts-pan-icon:not(.apexcharts-selected):hover,\n.apexcharts-theme-light .apexcharts-reset-icon:hover,\n.apexcharts-theme-light .apexcharts-selection-icon:not(.apexcharts-selected):hover,\n.apexcharts-theme-light .apexcharts-zoom-icon:not(.apexcharts-selected):hover,\n.apexcharts-theme-light .apexcharts-zoomin-icon:hover,\n.apexcharts-theme-light .apexcharts-zoomout-icon:hover {\n  background: rgba(15, 23, 42, 0.06);\n  color: #1f2937\n}\n\n.apexcharts-theme-dark .apexcharts-menu-icon:hover,\n.apexcharts-theme-dark .apexcharts-measure-icon:not(.apexcharts-selected):hover,\n.apexcharts-theme-dark .apexcharts-pan-icon:not(.apexcharts-selected):hover,\n.apexcharts-theme-dark .apexcharts-reset-icon:hover,\n.apexcharts-theme-dark .apexcharts-selection-icon:not(.apexcharts-selected):hover,\n.apexcharts-theme-dark .apexcharts-zoom-icon:not(.apexcharts-selected):hover,\n.apexcharts-theme-dark .apexcharts-zoomin-icon:hover,\n.apexcharts-theme-dark .apexcharts-zoomout-icon:hover {\n  background: rgba(255, 255, 255, 0.08);\n  color: #fff\n}\n\n.apexcharts-menu-icon,\n.apexcharts-selection-icon {\n  position: relative\n}\n\n.apexcharts-toolbar {\n  position: absolute;\n  z-index: 11;\n  display: inline-flex;\n  align-items: center;\n  gap: 1px;\n  padding: 3px;\n  border-radius: 8px;\n  background: rgba(255, 255, 255, 0.85);\n  backdrop-filter: blur(8px);\n  -webkit-backdrop-filter: blur(8px);\n}\n\n.apexcharts-theme-dark .apexcharts-toolbar {\n  background: rgba(28, 28, 31, 0.82);\n}\n\n.apexcharts-menu {\n  background: rgba(255, 255, 255, 0.95);\n  backdrop-filter: blur(8px);\n  -webkit-backdrop-filter: blur(8px);\n  position: absolute;\n  top: calc(100% + 4px);\n  border: 1px solid rgba(15, 23, 42, 0.08);\n  border-radius: 8px;\n  padding: 4px;\n  right: 0;\n  opacity: 0;\n  min-width: 120px;\n  transition: opacity .15s ease, transform .15s ease;\n  transform: translateY(-2px);\n  pointer-events: none;\n  box-shadow: 0 4px 16px -4px rgba(15, 23, 42, 0.12), 0 2px 4px -1px rgba(15, 23, 42, 0.06)\n}\n\n.apexcharts-menu.apexcharts-menu-open {\n  opacity: 1;\n  transform: translateY(0);\n  pointer-events: all\n}\n\n.apexcharts-menu-item {\n  padding: 6px 9px;\n  font-size: 12px;\n  border-radius: 5px;\n  cursor: pointer\n}\n\n.apexcharts-theme-light .apexcharts-menu-item:hover {\n  background: rgba(15, 23, 42, 0.06)\n}\n\n.apexcharts-theme-dark .apexcharts-menu {\n  background: rgba(28, 28, 31, 0.92);\n  border-color: rgba(255, 255, 255, 0.08);\n  color: #f3f4f6;\n  box-shadow: 0 4px 16px -4px rgba(0, 0, 0, 0.5), 0 2px 4px -1px rgba(0, 0, 0, 0.4)\n}\n\n.apexcharts-theme-dark .apexcharts-menu-item:hover {\n  background: rgba(255, 255, 255, 0.08)\n}\n\n@media screen and (min-width:768px) {\n  .apexcharts-canvas:hover .apexcharts-toolbar {\n    opacity: 1\n  }\n}\n\n/* Toolbar keyboard accessibility: show toolbar when any button inside it is focused */\n.apexcharts-toolbar:focus-within {\n  opacity: 1\n}\n\n/* Focus indicator for toolbar icon buttons */\n.apexcharts-menu-icon:focus-visible,\n.apexcharts-measure-icon:focus-visible,\n.apexcharts-pan-icon:focus-visible,\n.apexcharts-reset-icon:focus-visible,\n.apexcharts-selection-icon:focus-visible,\n.apexcharts-toolbar-custom-icon:focus-visible,\n.apexcharts-zoom-icon:focus-visible,\n.apexcharts-zoomin-icon:focus-visible,\n.apexcharts-zoomout-icon:focus-visible {\n  outline: 2px solid var(--apexcharts-focus-color, #008FFB);\n  outline-offset: 1px;\n  border-radius: 5px\n}\n\n/* Focus indicator for hamburger menu items */\n.apexcharts-menu-item:focus-visible {\n  outline: 2px solid var(--apexcharts-focus-color, #008FFB);\n  outline-offset: -2px;\n  background: #eee\n}\n\n.apexcharts-canvas .apexcharts-element-hidden,\n.apexcharts-datalabel.apexcharts-element-hidden,\n.apexcharts-hide .apexcharts-series-points {\n  opacity: 0;\n}\n\n.apexcharts-hidden-element-shown {\n  opacity: 1;\n  transition: 0.25s ease all;\n}\n\n.apexcharts-datalabel,\n.apexcharts-datalabel-label,\n.apexcharts-datalabel-value,\n.apexcharts-datalabels,\n.apexcharts-pie-label,\n.apexcharts-pie-name-label,\n.apexcharts-pie-name-label-group,\n.apexcharts-pie-label-connector,\n.apexcharts-unit-outer-label,\n.apexcharts-unit-outer-label-group,\n.apexcharts-unit-label-connector {\n  cursor: default;\n  pointer-events: none\n}\n\n.apexcharts-pie-label-connector,\n.apexcharts-unit-label-connector {\n  fill: none\n}\n\n.apexcharts-pie-label-delay,\n.apexcharts-unit-label-delay {\n  opacity: 0;\n  animation-name: opaque;\n  animation-duration: .3s;\n  animation-fill-mode: forwards;\n  animation-timing-function: ease\n}\n\n/* Slower than the pie's, on purpose: these come in while the dots are still\n   easing into place, so a longer fade reads as arriving WITH the crowd. */\n.apexcharts-unit-label-delay {\n  animation-duration: .5s\n}\n\n.apexcharts-radialbar-label {\n  cursor: pointer;\n}\n\n.apexcharts-annotation-rect,\n.apexcharts-area-series .apexcharts-area,\n.apexcharts-gridline,\n.apexcharts-line,\n.apexcharts-point-annotation-label,\n.apexcharts-radar-series path:not(.apexcharts-marker),\n.apexcharts-radar-series polygon,\n.apexcharts-toolbar svg,\n.apexcharts-tooltip .apexcharts-marker,\n.apexcharts-xaxis-annotation-label,\n.apexcharts-yaxis-annotation-label,\n.apexcharts-zoom-rect,\n.no-pointer-events {\n  pointer-events: none\n}\n\n.apexcharts-tooltip-active .apexcharts-marker {\n  transition: .15s ease all\n}\n\n.apexcharts-radar-series .apexcharts-yaxis {\n  pointer-events: none;\n}\n\n.resize-triggers {\n  animation: 1ms resizeanim;\n  visibility: hidden;\n  opacity: 0;\n  height: 100%;\n  width: 100%;\n  overflow: hidden\n}\n\n.contract-trigger:before,\n.resize-triggers,\n.resize-triggers>div {\n  content: \" \";\n  display: block;\n  position: absolute;\n  top: 0;\n  left: 0\n}\n\n.resize-triggers>div {\n  height: 100%;\n  width: 100%;\n  background: #eee;\n  overflow: auto\n}\n\n.contract-trigger:before {\n  overflow: hidden;\n  width: 200%;\n  height: 200%\n}\n\n.apexcharts-bar-goals-markers {\n  pointer-events: none\n}\n\n.apexcharts-bar-shadows {\n  pointer-events: none\n}\n\n.apexcharts-rangebar-goals-markers {\n  pointer-events: none\n}\n\n.apexcharts-drilldown-target {\n  cursor: pointer\n}\n\n.apexcharts-breadcrumb {\n  position: absolute;\n  z-index: 11;\n  display: inline-flex;\n  align-items: center;\n  gap: 2px;\n  font-size: 12px;\n  font-family: inherit;\n  padding: 2px 4px\n}\n\n.apexcharts-breadcrumb-item {\n  background: transparent;\n  border: none;\n  padding: 2px 6px;\n  border-radius: 3px;\n  font: inherit;\n  color: inherit;\n  cursor: pointer;\n  line-height: 1.2\n}\n\n.apexcharts-breadcrumb-item:hover:not(.apexcharts-breadcrumb-current) {\n  background: rgba(0, 0, 0, 0.08)\n}\n\n.apexcharts-breadcrumb-arrow {\n  margin-right: 4px;\n  font-weight: 600;\n  user-select: none\n}\n\n.apexcharts-breadcrumb-current {\n  cursor: default;\n  font-weight: 600;\n  opacity: 0.85\n}\n\n.apexcharts-breadcrumb-separator {\n  opacity: 0.5;\n  user-select: none\n}\n\n.apexcharts-theme-dark .apexcharts-breadcrumb-item:hover:not(.apexcharts-breadcrumb-current) {\n  background: rgba(255, 255, 255, 0.12)\n}\n\n.apexcharts-drilldown-loading {\n  position: absolute;\n  inset: 0;\n  z-index: 12;\n  display: flex;\n  align-items: center;\n  justify-content: center;\n  gap: 10px;\n  font-size: 13px;\n  font-family: inherit;\n  color: inherit;\n  background: rgba(255, 255, 255, 0.62);\n  /* The chart underneath stays interactive-looking but must not take clicks\n     while a level is resolving, or a second drill can start mid-fetch. */\n  cursor: progress\n}\n\n.apexcharts-drilldown-loading-spinner {\n  width: 26px;\n  height: 26px;\n  border-radius: 50%;\n  border: 2.5px solid rgba(0, 0, 0, 0.16);\n  border-top-color: rgba(0, 0, 0, 0.55);\n  animation: apexcharts-drilldown-spin 0.7s linear infinite\n}\n\n.apexcharts-drilldown-loading-text {\n  opacity: 0.8\n}\n\n.apexcharts-theme-dark .apexcharts-drilldown-loading {\n  background: rgba(30, 30, 30, 0.62)\n}\n\n.apexcharts-theme-dark .apexcharts-drilldown-loading-spinner {\n  border-color: rgba(255, 255, 255, 0.22);\n  border-top-color: rgba(255, 255, 255, 0.7)\n}\n\n@keyframes apexcharts-drilldown-spin {\n  to {\n    transform: rotate(360deg)\n  }\n}\n\n@media (prefers-reduced-motion: reduce) {\n  .apexcharts-drilldown-loading-spinner {\n    animation: apexcharts-drilldown-pulse 1.4s ease-in-out infinite\n  }\n\n  @keyframes apexcharts-drilldown-pulse {\n    0%, 100% {\n      opacity: 0.35\n    }\n\n    50% {\n      opacity: 1\n    }\n  }\n}\n\n.apexcharts-disable-transitions * {\n  transition: none !important;\n}\n/* \u2500\u2500 Trellis (#22): small multiples \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n.apexcharts-trellis {\n  position: relative;\n}\n.apexcharts-trellis-grid {\n  display: grid;\n}\n.apexcharts-trellis-cell {\n  min-width: 0;\n  position: relative;\n}\n.apexcharts-trellis-header {\n  font-size: 12px;\n  font-weight: 600;\n  line-height: 22px;\n  height: 22px;\n  text-align: center;\n  overflow: hidden;\n  text-overflow: ellipsis;\n  white-space: nowrap;\n  color: var(--apx-fore, #373d3f);\n}\n.apexcharts-trellis-title {\n  font-size: 14px;\n  font-weight: 700;\n  padding: 2px 0 6px;\n  color: var(--apx-fore, #373d3f);\n}\n/* Edge-label policy: a muted cell hides its axis-label INK, never the label\n   SPACE \u2014 every panel keeps the identical plot rectangle, and flipping the\n   policy on a resize is a class toggle, not a re-render. */\n.apexcharts-trellis-mute-y .apexcharts-yaxis {\n  opacity: 0;\n}\n.apexcharts-trellis-mute-x .apexcharts-xaxis {\n  opacity: 0;\n}\n/* The shared toolbar floats at the top-right, so a grid that has one starts\n   below it: from four columns on, the last cell's header (or a 2-D column\n   strip label) would otherwise run under the buttons. One band for the whole\n   grid, not per panel. */\n.apexcharts-trellis-has-toolbar {\n  padding-top: 24px;\n}\n/* 2-D faceting (P4): column labels once across the top, row labels once\n   down the left. The row strip column is auto-sized; panel columns stay\n   equal fractions, so panel alignment is independent of the strip width. */\n.apexcharts-trellis-strip {\n  font-size: 12px;\n  font-weight: 600;\n  color: var(--apx-fore, #373d3f);\n  overflow: hidden;\n  text-overflow: ellipsis;\n  white-space: nowrap;\n}\n.apexcharts-trellis-strip-column {\n  text-align: center;\n  line-height: 22px;\n  height: 22px;\n  align-self: end;\n}\n.apexcharts-trellis-strip-row {\n  align-self: center;\n  max-width: 140px;\n  padding-right: 6px;\n}\n/* Empty (row, column) combinations. 'placeholder' keeps a REAL panel with a\n   quiet label; 'skip' shows the tinted skeleton; 'hide' shows nothing while\n   keeping the grid slot. */\n.apexcharts-trellis-cell-empty {\n  position: relative;\n}\n.apexcharts-trellis-empty-label {\n  position: absolute;\n  inset: 0;\n  display: flex;\n  align-items: center;\n  justify-content: center;\n  font-size: 12px;\n  color: var(--apx-fore, #373d3f);\n  opacity: 0.45;\n  pointer-events: none;\n}\n.apexcharts-trellis-cell-hidden > * {\n  visibility: hidden;\n}\n/* P5: one shared gradient strip is a heatmap grid's legend. The slot is\n   content-sized inline (the strip svg's own box); centering is its own. */\n.apexcharts-trellis-gradient-legend {\n  margin: 10px auto 0;\n}\n/* Virtualization (P2): an unmounted panel's mount div reserves the exact\n   panel height (inline min-height) so page height and scroll position never\n   shift; the skeleton itself is a quiet tinted block. Deliberately not\n   animated: a shimmering grid of 200 placeholders is noise. */\n.apexcharts-trellis-panel.apexcharts-trellis-skeleton {\n  background: var(--apx-fore, #373d3f);\n  opacity: 0.05;\n  border-radius: 4px;\n}\n/* tooltip: 'panel' \u2014 the group still syncs every panel's crosshair, but only\n   the hovered cell shows its tooltip cards. */\n.apexcharts-trellis[data-tooltip-mode='panel'] .apexcharts-trellis-cell:not(:hover) .apexcharts-tooltip,\n.apexcharts-trellis[data-tooltip-mode='panel'] .apexcharts-trellis-cell:not(:hover) .apexcharts-xaxistooltip,\n.apexcharts-trellis[data-tooltip-mode='panel'] .apexcharts-trellis-cell:not(:hover) .apexcharts-yaxistooltip {\n  opacity: 0 !important;\n}\n/* tooltip: 'grid' (P3) \u2014 ALL per-panel tooltip ink is hidden (the group\n   still computes it; the trellis card reads it) and one trellis-owned card\n   follows the cursor with one row per panel. */\n.apexcharts-trellis[data-tooltip-mode='grid'] .apexcharts-trellis-cell .apexcharts-tooltip,\n.apexcharts-trellis[data-tooltip-mode='grid'] .apexcharts-trellis-cell .apexcharts-xaxistooltip,\n.apexcharts-trellis[data-tooltip-mode='grid'] .apexcharts-trellis-cell .apexcharts-yaxistooltip {\n  opacity: 0 !important;\n}\n.apexcharts-trellis-tooltip {\n  position: absolute;\n  top: 0;\n  left: 0;\n  z-index: 14;\n  pointer-events: none;\n  opacity: 0;\n  transition: opacity 0.1s ease;\n  background: var(--apx-bg, #fff);\n  color: var(--apx-fore, #373d3f);\n  border: 1px solid rgba(120, 120, 120, 0.25);\n  border-radius: 5px;\n  box-shadow: 2px 2px 6px -4px rgba(0, 0, 0, 0.4);\n  font-size: 12px;\n  min-width: 140px;\n  max-width: 320px;\n}\n.apexcharts-trellis-tooltip-active {\n  opacity: 1;\n}\n.apexcharts-trellis-tooltip .apexcharts-tooltip-title {\n  padding: 5px 10px;\n  font-weight: 600;\n  background: rgba(120, 120, 120, 0.08);\n  border-bottom: 1px solid rgba(120, 120, 120, 0.18);\n  margin-bottom: 2px;\n}\n.apexcharts-trellis-tooltip-row {\n  display: flex;\n  align-items: center;\n  justify-content: space-between;\n  gap: 14px;\n  padding: 2px 10px;\n  line-height: 1.6;\n}\n.apexcharts-trellis-tooltip-row-active {\n  background: rgba(120, 120, 120, 0.1);\n  font-weight: 600;\n}\n.apexcharts-trellis-tooltip-key {\n  overflow: hidden;\n  text-overflow: ellipsis;\n  white-space: nowrap;\n}\n.apexcharts-trellis-tooltip-vals {\n  display: flex;\n  gap: 10px;\n  white-space: nowrap;\n}\n.apexcharts-trellis-tooltip-val {\n  display: inline-flex;\n  align-items: center;\n  gap: 5px;\n}\n.apexcharts-trellis-tooltip-marker {\n  width: 8px;\n  height: 8px;\n  border-radius: 50%;\n  display: inline-block;\n  flex: none;\n}\n/* Panel promotion (P3): the promoted cell spans the grid; the rest park.\n   The promoted panel is the only visible one, so both its axes unmute. */\n.apexcharts-trellis-cell-promoted {\n  grid-column: 1 / -1;\n}\n.apexcharts-trellis-cell-parked {\n  display: none;\n}\n.apexcharts-trellis-cell-promoted.apexcharts-trellis-mute-y .apexcharts-yaxis,\n.apexcharts-trellis-cell-promoted.apexcharts-trellis-mute-x .apexcharts-xaxis {\n  opacity: 1;\n}\n.apexcharts-trellis-header-clickable {\n  cursor: pointer;\n}\n.apexcharts-trellis-header-clickable:hover {\n  text-decoration: underline;\n  text-underline-offset: 3px;\n}\n.apexcharts-trellis-breadcrumb {\n  display: flex;\n  align-items: center;\n  gap: 6px;\n  font-size: 12px;\n  padding: 2px 0 6px;\n  color: var(--apx-fore, #373d3f);\n}\n.apexcharts-trellis-breadcrumb-back {\n  border: none;\n  background: none;\n  padding: 0;\n  font-size: 12px;\n  cursor: pointer;\n  color: var(--apx-accent, #008ffb);\n}\n.apexcharts-trellis-breadcrumb-back:hover {\n  text-decoration: underline;\n}\n.apexcharts-trellis-breadcrumb-sep {\n  opacity: 0.5;\n}\n.apexcharts-trellis-breadcrumb-current {\n  font-weight: 600;\n}\n/* The toolbar download menu (P3). */\n.apexcharts-trellis-menu {\n  position: absolute;\n  top: 26px;\n  right: 0;\n  display: none;\n  flex-direction: column;\n  min-width: 132px;\n  background: var(--apx-bg, #fff);\n  border: 1px solid rgba(120, 120, 120, 0.25);\n  border-radius: 5px;\n  box-shadow: 2px 2px 6px -4px rgba(0, 0, 0, 0.4);\n  padding: 4px;\n  z-index: 15;\n}\n.apexcharts-trellis-menu-open {\n  display: flex;\n}\n.apexcharts-trellis-menu-item {\n  border: none;\n  background: none;\n  text-align: left;\n  font-size: 12px;\n  padding: 5px 8px;\n  border-radius: 3px;\n  cursor: pointer;\n  color: var(--apx-fore, #373d3f);\n}\n.apexcharts-trellis-menu-item:hover {\n  background: rgba(120, 120, 120, 0.12);\n}\n.apexcharts-trellis-toolbar {\n  position: absolute;\n  top: 0;\n  right: 0;\n  display: flex;\n  gap: 2px;\n  z-index: 12;\n}\n.apexcharts-trellis-tool {\n  border: 0;\n  background: transparent;\n  padding: 2px;\n  cursor: pointer;\n  border-radius: 3px;\n  color: #6e8192;\n  line-height: 0;\n}\n.apexcharts-trellis-tool:hover {\n  color: var(--apx-fore, #373d3f);\n}\n.apexcharts-trellis-tool.apexcharts-selected {\n  color: var(--apx-accent, #008ffb);\n}\n.apexcharts-trellis-legend {\n  display: flex;\n  flex-wrap: wrap;\n  justify-content: center;\n  gap: 4px 14px;\n  padding: 8px 10px 2px;\n}\n.apexcharts-trellis-legend-item {\n  display: flex;\n  align-items: center;\n  gap: 6px;\n  cursor: pointer;\n  line-height: 1;\n}\n.apexcharts-trellis-legend-item .apexcharts-legend-marker {\n  width: 12px;\n  height: 12px;\n  border-radius: 50%;\n  display: inline-block;\n}\n.apexcharts-trellis-legend-item .apexcharts-legend-text {\n  font-size: 12px;\n  color: var(--apx-fore, #373d3f);\n}\n.apexcharts-trellis-legend-item.apexcharts-inactive-legend {\n  opacity: 0.45;\n}\n";const a=(null==(f=this.opts.chart)?void 0:f.nonce)||this.w.config.chart.nonce;a&&s.setAttribute("nonce",a),e?t.prepend(s):!1!==this.w.config.chart.injectStyleSheet&&i.head.appendChild(s)}}if(w)return void this.trellis.render().then(()=>{Us(this.w,this),"function"==typeof this.w.config.chart.events.mounted&&this.w.config.chart.events.mounted(this,this.w),this.events.fireEvent("mounted",[this,this.w]),t(this)}).catch(t=>{var i,s;const a=t instanceof Error?t:new Error(String(t)),r=a;r.chartId=null==(s=null==(i=this.w)?void 0:i.globals)?void 0:s.chartID,r.el=this.el,e(a)});const A=this.create(this.w.config.series,{});if(!A)return t(this);this.mount(A).then(()=>{"function"==typeof this.w.config.chart.events.mounted&&this.w.config.chart.events.mounted(this,this.w),this.events.fireEvent("mounted",[this,this.w]),t(A)}).catch(t=>{var i,s;const a=t instanceof Error?t:new Error(String(t)),r=a;r.chartId=null==(s=null==(i=this.w)?void 0:i.globals)?void 0:s.chartID,r.el=this.el,e(a)})}else e(new Error("Element not found"))});return this._renderPromise=i,i.catch(()=>{this._renderPromise===i&&(this._renderPromise=null)}),i}create(t,e){var i,s,a,r,n,o;const l=this.w;if(!this.core){new ds(this).initModules()}const h=this.w.globals;if(h.noData=!1,h.animationEnded=!1,!v.elementExists(this.el))return h.animationEnded=!0,null;if(this.responsive.checkResponsiveConfig(e),At(l),l.config.xaxis.convertedCatToNumeric){new X(l.config).convertCatToNumericXaxis(l.config,this.ctx)}if(this.core.setupElements(),"treemap"===l.config.chart.type&&(l.config.grid.show=!1,l.config.yaxis[0].show=!1),0===h.svgWidth)return h.animationEnded=!0,null;let c=t;t.forEach((t,e)=>{t.hidden&&(c=this.legend.legendHelpers.getSeriesAfterCollapsing({realIndex:e}))});const p=H.checkComboSeries(c,l.config.chart.type);h.comboCharts=p.comboCharts,h.comboBarCount=p.comboBarCount;const u=c.every(t=>t.data&&0===t.data.length);(0===c.length||u&&h.collapsedSeries.length<1)&&this.series.handleNoData(),d.isBrowser()&&this.events.setupEventHandlers();const g=this.data.parseData(c);this._writeParsedSeriesData(g.seriesData),this._writeParsedRangeData(g.rangeData),this._writeParsedCandleData(g.candleData),this._writeParsedLabelData(g.labelData),this._writeParsedAxisFlags(g.axisFlags),null==(i=this.rendererController)||i.resolve(),null==(s=this.weave)||s.dispatch("afterParse"),this.theme.init();new Ft(this.w,this).setGlobalMarkerSize(),this.formatters.setLabelFormatters(),this.titleSubtitle.draw(),h.noData&&h.collapsedSeries.length!==l.seriesData.series.length&&!l.config.legend.showForSingleSeries||null==(a=this.legend)||a.init(),this.series.hasAllSeriesEqualX(),h.axisCharts&&(this.core.coreCalculations(),"category"!==l.config.xaxis.type&&this.formatters.setLabelFormatters(),this.ctx.toolbar&&(this.ctx.toolbar.minX=l.globals.minX,this.ctx.toolbar.maxX=l.globals.maxX)),this.formatters.heatmapLabelFormatters();new H(this.w).getLargestMarkerSize();const f=this.dimensions.plotCoords();this._writeLayoutCoords(f.layout);const x=this.core.xySettings();null==(r=this.weave)||r.dispatch("afterScales",{xyRatios:x}),this.grid.createGridMask();const m=this.core.plotChartType(c,x),b=new Xt(this.w,this);b.bringForward(),l.config.dataLabels.background.enabled&&b.dataLabelsBackground(),this.core.shiftGraphPosition(),null==(o=null==(n=this.legend)?void 0:n.heatmapGradientLegend)||o.repositionToPlot(),l.globals.dataPoints>50&&l.dom.elWrap.classList.add("apexcharts-disable-transitions");return{elGraph:m,xyRatios:x,dimensions:{plot:{left:l.layout.translateX,top:l.layout.translateY,width:l.layout.gridWidth,height:l.layout.gridHeight}}}}mount(t=null){const e=this,i=e.w;return new Promise((s,a)=>{var r,n,o,l,h,c,p,u,g,f;if(null===e.el)return a(new Error("Not enough data to display or target element not found"));i.globals.allSeriesCollapsed&&e.series.handleNoData(),e.grid=new Yt(e.w,e);const x=e.grid.drawGrid(),m=ds._featureRegistry.get("annotations");if(e.annotations=m?new m(e.w,{theme:e.theme,timeScale:e.timeScale}):null,null==(r=e.annotations)||r.drawImageAnnos(),null==(n=e.annotations)||n.drawTextAnnos(),"back"===i.config.grid.position&&(x&&i.dom.elGraphical.add(x.el),(null==(o=null==x?void 0:x.elGridBorders)?void 0:o.node)&&i.dom.elGraphical.add(x.elGridBorders)),Array.isArray(t.elGraph))for(let e=0;e<t.elGraph.length;e++)i.dom.elGraphical.add(t.elGraph[e]);else i.dom.elGraphical.add(t.elGraph);"front"===i.config.grid.position&&(x&&i.dom.elGraphical.add(x.el),(null==(l=null==x?void 0:x.elGridBorders)?void 0:l.node)&&i.dom.elGraphical.add(x.elGridBorders)),"front"===i.config.xaxis.crosshairs.position&&e.crosshairs.drawXCrosshairs(),"front"===i.config.yaxis[0].crosshairs.position&&e.crosshairs.drawYCrosshairs(),"treemap"!==i.config.chart.type&&e.axes.drawAxis(i.config.chart.type,x);const b=new Nt(this.w,this.ctx,x),y=new $t(this.w,{theme:this.theme,timeScale:this.timeScale},x);if(null!==x&&(b.xAxisLabelCorrections(),y.setYAxisTextAlignments(),i.config.yaxis.map((t,e)=>{-1===i.globals.ignoreYAxisIndexes.indexOf(e)&&y.yAxisTitleRotate(e,t.opposite)})),null==(h=e.annotations)||h.drawAxesAnnotations(),!i.globals.noData){if(d.isBrowser()&&i.config.tooltip.enabled&&!i.globals.noData&&(null==(c=e.w.globals.tooltip)||c.drawTooltip(t.xyRatios)),i.config.chart.accessibility.enabled&&i.config.chart.accessibility.keyboard.enabled&&i.config.chart.accessibility.keyboard.navigation.enabled&&(null==(p=e.keyboardNavigation)||p.init()),d.isBrowser()&&i.globals.axisCharts&&(i.axisFlags.isXNumeric||i.config.xaxis.convertedCatToNumeric||i.axisFlags.isRangeBar))(i.config.chart.zoom.enabled||i.config.chart.selection&&i.config.chart.selection.enabled||i.config.chart.pan&&i.config.chart.pan.enabled)&&(null==(u=e.zoomPanSelection)||u.init({xyRatios:t.xyRatios}));else{const t=i.config.chart.toolbar.tools;["zoom","zoomin","zoomout","selection","pan","reset"].forEach(e=>{t[e]=!1})}i.config.chart.toolbar.show&&!i.globals.allSeriesCollapsed&&(null==(g=e.toolbar)||g.createToolbar())}null==(f=e.weave)||f.dispatch("draw",{pass:"full",xyRatios:null==t?void 0:t.xyRatios}),i.globals.memory.methodsToExec.length>0&&i.globals.memory.methodsToExec.forEach(t=>{t.method(t.params,!1,t.context)}),i.globals.axisCharts||i.globals.noData||e.core.resizeNonAxisCharts(),Us(i,e),s(e)})}destroy(){var t;this.trellis&&this.trellis.teardown(),this._renderPromise=null,d.isBrowser()&&(window.removeEventListener("resize",this.windowResizeHandler),_s(this.el.parentNode,this.parentResizeHandler),clearTimeout(null!=(t=this.w.globals.resizeTimer)?t:void 0));const e=this.w.config.chart.id;var i;e&&Array.isArray(Apex._chartInstances)&&Apex._chartInstances.forEach((t,i)=>{t.id===v.escapeString(e)&&Apex._chartInstances.splice(i,1)}),this._keyboardNavigation&&this._keyboardNavigation.destroy(),Vs(this),i=this,$s.delete(i),new ps(this.ctx).clear({isUpdating:!1})}updateOptions(e,i=!1,s=!0,a=!0,r=!0){const n=this.w;if(e&&"series"in e&&!Array.isArray(e.series)&&delete(e=o({},e)).series,this.trellis&&this.trellis._mounted)return this.opts=v.extend(this.opts||{},e||{}),this.w.config=v.extend(n.config,e||{}),this.trellis.teardown(),this.render();if(n.interact.selection=void 0,this.lastUpdateOptions){if(v.shallowEqual(this.lastUpdateOptions,e))return Promise.resolve(this);if(e.series&&this.lastUpdateOptions.series&&!t._optionsTooBigToCompare(e)&&v.stringifyForCompare(this.lastUpdateOptions.series)===v.stringifyForCompare(e.series)){const t=o({},e),i=o({},this.lastUpdateOptions);if(delete t.series,delete i.series,v.shallowEqual(t,i))return Promise.resolve(this)}}return e.series&&(this.data.resetParsingFlags(),this.series.resetSeries(!1,!0,!1),e.series.length&&e.series[0].data&&(e.series=e.series.map((t,e)=>this.updateHelpers._extendSeries(t,e))),this.updateHelpers.revertDefaultAxisMinMax()),e.xaxis&&(e=this.updateHelpers.forceXAxisUpdate(e)),e.yaxis&&(e=this.updateHelpers.forceYAxisUpdate(e)),n.globals.collapsedSeriesIndices.length>0&&this.series.clearPreviousPaths(),e.theme&&(e=this.theme.updateThemeOptions(e)),this.updateHelpers._updateOptions(e,i,s,a,r)}updateSeries(t=[],e=!0,i=!0){return Array.isArray(t)?this.trellis&&this.trellis._mounted?this.trellis.updateSeries(t,e):(this.data.resetParsingFlags(),this.series.prepareDataUpdate(),this.updateHelpers.revertDefaultAxisMinMax(),this.updateHelpers._updateSeries(t,e,i)):Promise.resolve(this)}appendSeries(t,e=!0,i=!0){this.data.resetParsingFlags();const s=this.w.config.series.slice();return s.push(t),this.series.prepareDataUpdate(),this.updateHelpers.revertDefaultAxisMinMax(),this.updateHelpers._updateSeries(s,e,i)}appendData(t,e=!0){const i=this;i.data.resetParsingFlags(),i.w.globals.dataChanged=!0,i.w.config.chart.animations.enabled&&i.series.getPreviousPaths();const s=i.w.globals.histogramRawSeries;if(s){for(let e=0;e<s.length;e++){const i=t[e];if(i&&Array.isArray(i.data)&&Array.isArray(s[e].data))for(let t=0;t<i.data.length;t++)s[e].data.push(i.data[t])}return this.update()}const a=i.w.config.series.slice();for(let e=0;e<a.length;e++)if(null!==t[e]&&void 0!==t[e]){const i=t[e],s=a[e];for(let t=0;t<i.data.length;t++)s.data.push(i.data[t])}return function(t,e){const i=e.config.chart.streaming;if(!i||!i.enabled)return;const s=i.maxPoints,a=e.config.xaxis.range,r=t=>null==t?null:Array.isArray(t)?"number"==typeof t[0]?t[0]:null:"object"==typeof t&&"number"==typeof t.x?t.x:null;t.forEach(t=>{var e;const i=null==t?void 0:t.data;if(!Array.isArray(i)||i.length<2)return;if("number"==typeof s&&s>0)return void(i.length>s&&(t.data=i.slice(i.length-s)));if(!a)return;const n=r(i[i.length-1]),o=r(i[0]);if(null==n||null==o||n<=o)return;const l=(n-o)/(i.length-1),h=n-a-2*l;let c=0;for(;c<i.length&&(null!=(e=r(i[c]))?e:h)<h;)c++;c>0&&(t.data=i.slice(c))})}(a,i.w),i.w.config.series=a,e&&(i.w.globals.initialSeries=i.w.config.series),this.update()}static _optionsTooBigToCompare(t){const e=t&&t.series;if(!Array.isArray(e))return!1;let i=0;for(let t=0;t<e.length;t++){const s=e[t]&&e[t].data;if(i+=Array.isArray(s)?s.length:1,i>1e3)return!0}return!1}update(e){return new Promise((i,s)=>{if(e&&this.lastUpdateOptions&&!t._optionsTooBigToCompare(e)&&v.stringifyForCompare(this.lastUpdateOptions)===v.stringifyForCompare(e))return i(this);this.lastUpdateOptions=e&&!t._optionsTooBigToCompare(e)?v.clone(e):null,new ps(this.ctx).clear({isUpdating:!0});const a=this.create(this.w.config.series,null!=e?e:{});if(!a)return i(this);this.mount(a).then(()=>{var t;null==(t=this.morphTypeChange)||t.applyChromeFade(),De(this.w),ze(this.w),"function"==typeof this.w.config.chart.events.updated&&this.w.config.chart.events.updated(this,this.w),this.events.fireEvent("updated",[this,this.w]),this.w.globals.isDirty=!0,i(this)}).catch(t=>{s(t)})})}_fastAxisChromeRefresh(t){const e=this.w,i=e.globals;this._fastAxisBailReason="";try{if(i.isBarHorizontal)return this._fastAxisBailReason="barHorizontal",!1;if(e.config.chart.sparkline.enabled)return!0;const t=e.config.annotations;if(t&&(t.yaxis&&t.yaxis.length||t.xaxis&&t.xaxis.length||t.points&&t.points.length||t.texts&&t.texts.length||t.images&&t.images.length))return this._fastAxisBailReason="annotations",!1;if(e.config.chart.ink&&e.config.chart.ink.enabled)return this._fastAxisBailReason="ink",!1;const s=this.dimensions;if(!s||!s.dimYAxis)return this._fastAxisBailReason="noDimensions",!1;const a=e.layout.yLabelsCoords,r=e.layout.yTitleCoords,n=s.dimYAxis.getyAxisLabelsCoords(),o=s.dimYAxis.getyAxisTitleCoords();e.layout.yLabelsCoords=[],e.layout.yTitleCoords=[],e.config.yaxis.map((t,i)=>{e.layout.yLabelsCoords.push({width:n[i].width,index:i}),e.layout.yTitleCoords.push({width:o[i].width,index:i})});const l=s.dimYAxis.getTotalYAxisWidth();if(l>s.yAxisWidth+2)return e.layout.yLabelsCoords=a,e.layout.yTitleCoords=r,this._fastAxisBailReason=`labelWidth ${l} > ${s.yAxisWidth}`,!1;const h=e.dom.elGraphical.node,c=h.querySelector(".apexcharts-grid"),d=h.querySelector(".apexcharts-grid-borders");if(!c)return this._fastAxisBailReason="missingGridNode",!1;const p=c.parentNode,u=d?d.nextSibling:c.nextSibling;c.remove(),d&&d.remove(),h.querySelectorAll(".apexcharts-xaxis-tick").forEach(t=>t.remove()),this.grid=new Yt(e,this);const g=this.grid.drawGrid();g&&g.el&&(p.insertBefore(g.el.node,u),g.elGridBorders&&g.elGridBorders.node&&p.insertBefore(g.elGridBorders.node,u));const f=new Nt(this.w,this.ctx,g),x=h.querySelector(".apexcharts-xaxis");if(x){const t=x.parentNode,e=x.nextSibling;x.remove();const i=f.drawXaxis();t.insertBefore(i.node,e)}const m=new $t(this.w,{theme:this.theme,timeScale:this.timeScale},g);for(let t=0;t<e.config.yaxis.length;t++){if(-1!==i.ignoreYAxisIndexes.indexOf(t))continue;const s=e.dom.baseEl.querySelector(`.apexcharts-yaxis[rel='${t}']`);if(!s)return this._fastAxisBailReason="missingYAxisNode",!1;const a=s.parentNode;if(!a)return this._fastAxisBailReason="missingYAxisParent",!1;const r=s.nextSibling;s.remove();const n=m.drawYaxis(t);a.insertBefore(n.node,r)}return null!==g&&(f.xAxisLabelCorrections(),m.setYAxisTextAlignments(),e.config.yaxis.map((t,e)=>{-1===i.ignoreYAxisIndexes.indexOf(e)&&m.yAxisTitleRotate(e,t.opposite)})),!0}catch(t){return this._fastAxisBailReason="error: "+(t&&t.message),!1}}fastUpdate(t,e){return new Promise((i,s)=>{var a,r,n;try{const o=this.w,l=o.globals;l.shouldAnimate=t,l.dataChanged=!0,l.animationEnded=!1,zt.invalidateSelectors(o);const h=o.globals;h.maxY=-Number.MAX_VALUE,h.minY=Number.MIN_VALUE,h.minYArr=[],h.maxYArr=[],h.maxX=-Number.MAX_VALUE,h.minX=Number.MAX_VALUE,h.initialMaxX=-Number.MAX_VALUE,h.initialMinX=Number.MAX_VALUE,h.yAxisScale=[],h.xAxisScale=null,h.xAxisTicksPositions=[],h.xRange=0,h.yRange=[],h.zRange=0,h.xTickAmount=0,h.multiAxisTickAmount=0,h.pointsArray=[],h.barCanvasCoords=null,h.dataLabelsRects=[],h.lastDrawnDataLabelsIndexes=[],h.textRectsCache=new Map,h.domCache=new Map,h.cachedSelectors={},h.disableZoomIn=!1,h.disableZoomOut=!1,l.axisCharts&&(this.core.coreCalculations(),"category"!==o.config.xaxis.type&&this.formatters.setLabelFormatters()),this.formatters.heatmapLabelFormatters();const c=this.core.xySettings();this._zoomPanSelection&&(this._zoomPanSelection.xyRatios=c);const p=JSON.stringify({y:(l.yAxisScale||[]).map(t=>t?t.result:null),xMin:l.minX,xMax:l.maxX}),u=l.axisCharts&&null!=e&&p!==e;if(u&&!this._fastAxisChromeRefresh(c))return this._updateStats.full++,this.update().then(()=>i(this)).catch(s);u?this._updateStats.fastWithAxes++:this._updateStats.fast++,null==(a=this.weave)||a.dispatch("afterScales",{pass:"fast",xyRatios:c});const g=this.ctx.renderer,f=!!(g&&"canvas"===g.kind&&g.canRepaintInPlace&&g.canRepaintInPlace());f&&(g._repaintHostInPlace=!0);const x=o.dom.elGraphical.node;x.querySelectorAll((f?"":".apexcharts-canvas-series-wrap, ")+".apexcharts-plot-series, .apexcharts-series, .apexcharts-datalabels, .apexcharts-datalabels-background").forEach(t=>{var e;return null==(e=t.parentNode)?void 0:e.removeChild(t)});const m=this.core.plotChartType(o.config.series,c),b=x.querySelector(".apexcharts-grid"),y=x.querySelector(".apexcharts-xaxis"),w=Array.isArray(m)?m:[m],v=b&&"front"===o.config.grid.position?b:y;v?w.forEach(t=>{const e=t&&t.node?t.node:t;e&&x.insertBefore(e,v)}):w.forEach(t=>{o.dom.elGraphical.add(t)});const A=new Xt(o,this);A.bringForward(),o.config.dataLabels.background.enabled&&A.dataLabelsBackground(),l.streamScrolled||De(o),ze(o),d.isBrowser()&&o.config.tooltip.enabled&&!l.noData&&(null==(r=o.globals.tooltip)||r.drawTooltip(c)),null==(n=this.weave)||n.dispatch("draw",{pass:"fast",xyRatios:c}),"function"==typeof o.config.chart.events.updated&&o.config.chart.events.updated(this,o),this.events.fireEvent("updated",[this,o]),Us(o,this),l.isDirty=!0,i(this)}catch(t){s(t)}})}getSyncedCharts(){const t=this.getGroupedCharts();return t.splice(0,0,this),t}getPanels(){return this.trellis?this.trellis.getPanels():[]}getPanel(t){return this.trellis?this.trellis.getPanel(t):null}getGroupedCharts(){return Apex._chartInstances.filter(t=>this!==t.chart&&!!this.w.config.chart.group&&this.w.config.chart.group===t.group).map(t=>t.chart)}static getChartByID(t){const e=v.escapeString(t);if(!Apex._chartInstances)return;const i=Apex._chartInstances.filter(t=>t.id===e)[0];return i&&i.chart}static trellis(e,i){if(!ds._featureRegistry.get("trellis"))return null;const s=new t(e,i);return s.render(),s}static initOnLoad(){var e;const i=document.querySelectorAll("[data-apexcharts]");for(let s=0;s<i.length;s++){const a=i[s],r=JSON.parse(null!=(e=i[s].getAttribute("data-options"))?e:"");new t(a,r).render()}}static exec(t,e,...i){const s=this.getChartByID(t);if(!s)return;s.w.globals.isExecCalled=!0;let a=null;return-1!==s.publicMethods.indexOf(e)&&(a=s[e](...i)),a}static merge(t,e){return v.extend(t,e)}static getThemePalettes(){return{palette1:["#008FFB","#00A86F","#CA8501","#FF4560","#846DD5"],palette2:["#6978CB","#039DE2","#49A84D","#B39105","#D68000"],palette3:["#209FCC","#648291","#D4526E","#0FA783","#A19285"],palette4:["#2FA59D","#73A20B","#099DE1","#FD5D5D","#648291"],palette5:["#2B908F","#F56566","#2EAB16","#FA4443","#1EA2BD"],palette6:["#449DD1","#F86624","#EA3A4A","#9C63D1","#899E2A"],palette7:["#DF475B","#1B998B","#7E75B7","#F46036","#B1911B"],palette8:["#9C63D1","#F86624","#B38F04","#EA3A4A","#2FA2B3"],palette9:["#98776F","#A19285","#A8705E","#BA6560","#A0927F"],palette10:["#C91EFF","#A94BFD","#6C6AFE","#2983FF","#009ED8"],cvdDeuteranopia:["#0072B2","#E69F00","#56B4E9","#009E73","#F0E442","#D55E00","#CC79A7"],cvdProtanopia:["#0077BB","#EE7733","#009988","#EE3377","#BBBBBB","#33BBEE","#CC3311"],cvdTritanopia:["#CC3311","#009988","#EE7733","#0077BB","#EE3377","#BBBBBB","#33BBEE"],highContrast:["#005A9C","#C00000","#007A33","#6C3483","#7B3F00","#0097A7","#4A235A"]}}static use(t){bi(t)}static registerFeatures(t){ds.registerFeatures(t)}static setLicense(e){return Rs.setLicense(e),qs(),t}static registerPlugin(e){return function(t){t&&"string"==typeof t.name&&"function"==typeof t.setup&&(Ss()[t.name]=t)}(e),t}static unregisterPlugin(e){return function(t){delete Ss()[t]}(e),t}static registerRenderer(t,e){Vi.registerRenderer(t,e)}static registerSeriesType(e,i){const s=t._customSeriesFactory;return s&&i&&"function"==typeof i.renderItem?(a=e,fi()[a]&&!mi(e)||(bi({[e]:s(e,i)}),function(t){xi().add(t)}(e)),t):t;var a}static unregisterSeriesType(e){return mi(e)&&function(t){delete fi()[t],xi().delete(t)}(e),t}static registerTheme(e,i){return function(t,e){t&&"string"==typeof t&&(null==e||"object"==typeof e&&!Array.isArray(e))&&(Oe()[t]=e||{})}(e,i),t}static unregisterTheme(e){return function(t){t&&delete Oe()[t]}(e),t}static registerEasing(e,i){return function(t,e){"string"==typeof t&&t&&"function"==typeof e&&gt.set(t,e)}(e,i),t}static registerUnitLayout(e,i){return function(t,e){t&&"string"==typeof t&&"function"==typeof e&&(gs()[t]=e)}(e,i),t}static unregisterUnitLayout(e){return function(t){delete gs()[t]}(e),t}static registerUnitMark(e,i){return function(t,e){if(!t||"string"!=typeof t)return;const i=ms(e,t);i&&(xs()[t]=i)}(e,i),t}static unregisterUnitMark(e){return function(t){delete xs()[t]}(e),t}static registerRowSource(e,i){return ws(e,i),t}static unregisterRowSource(e){return function(t){delete ys()[t]}(e),t}rowSeries(t){const e=function(t){const e=t&&t.config&&t.config.chart;return e?vs(e.requestedType)||vs(e.type):null}(this.w);return e&&e(this.w,t)||null}static crossfilter(e){if(!e||"string"!=typeof e.id)throw new Error("ApexCharts.crossfilter requires an { id } string.");const i=t._crossfilterFactory;if(!i)return null;const s=i(e);return qs(),s}static getCrossfilter(e){const i=t._crossfilterGet;return i?i(e):null}clearCrossfilter(){var t;null==(t=this.linkedViews)||t.clearGroup()}startMeasure(){var t;null==(t=this.measure)||t.startMeasure()}stopMeasure(){var t;null==(t=this.measure)||t.stopMeasure()}clearMeasures(){var t;null==(t=this.measure)||t.clearMeasures()}toggleSeries(t){return this.series.toggleSeries(t)}highlightSeriesOnLegendHover(t,e){return this.series.toggleSeriesOnHover(t,e)}showSeries(t){this.series.showSeries(t)}hideSeries(t){this.series.hideSeries(t)}highlightSeries(t){this.series.highlightSeries(t)}isSeriesHidden(t){return this.series.isSeriesHidden(t)}resetSeries(t=!0,e=!0){this.series.resetSeries(t,e)}addEventListener(t,e){this.events.addEventListener(t,e)}removeEventListener(t,e){this.events.removeEventListener(t,e)}addXaxisAnnotation(t,e=!0,i=void 0){var s;let a=this;i&&(a=i),null==(s=a.annotations)||s.addXaxisAnnotationExternal(t,e,a)}addYaxisAnnotation(t,e=!0,i=void 0){var s;let a=this;i&&(a=i),null==(s=a.annotations)||s.addYaxisAnnotationExternal(t,e,a)}addPointAnnotation(t,e=!0,i=void 0){var s;let a=this;i&&(a=i),null==(s=a.annotations)||s.addPointAnnotationExternal(t,e,a)}clearAnnotations(t=void 0){var e;let i=this;t&&(i=t),i.lastUpdateOptions=null,null==(e=i.annotations)||e.clearAnnotations(i)}removeAnnotation(t,e=void 0){var i;let s=this;e&&(s=e),s.lastUpdateOptions=null,null==(i=s.annotations)||i.removeAnnotation(s,t)}getChartArea(){return this.w.dom.baseEl.querySelector(".apexcharts-inner")}getSeriesTotalXRange(t,e){return this.coreUtils.getSeriesTotalsXRange(t,e)}getHighestValueInSeries(t=0){return new Wt(this.w).getMinYMaxY(t).highestY}getLowestValueInSeries(t=0){return new Wt(this.w).getMinYMaxY(t).lowestY}getSeriesTotal(){return this.w.globals.seriesTotals}getState(){const t=this.w,e=t.globals;return{series:t.seriesData.series,seriesNames:t.seriesData.seriesNames,colors:e.colors,labels:t.labelData.labels,seriesTotals:e.seriesTotals,seriesPercent:e.seriesPercent,seriesXvalues:e.seriesXvalues,seriesYvalues:e.seriesYvalues,minX:e.minX,maxX:e.maxX,minY:e.minY,maxY:e.maxY,minYArr:e.minYArr,maxYArr:e.maxYArr,minXDiff:e.minXDiff,dataPoints:e.dataPoints,xAxisScale:e.xAxisScale,yAxisScale:e.yAxisScale,xTickAmount:e.xTickAmount,isXNumeric:t.axisFlags.isXNumeric,seriesYAxisMap:e.seriesYAxisMap,seriesYAxisReverseMap:e.seriesYAxisReverseMap,svgWidth:e.svgWidth,svgHeight:e.svgHeight,gridWidth:t.layout.gridWidth,gridHeight:t.layout.gridHeight,selectedDataPoints:t.interact.selectedDataPoints,collapsedSeriesIndices:e.collapsedSeriesIndices,zoomed:t.interact.zoomed,seriesX:t.seriesData.seriesX,seriesZ:t.seriesData.seriesZ,seriesCandleO:t.candleData.seriesCandleO,seriesCandleH:t.candleData.seriesCandleH,seriesCandleM:t.candleData.seriesCandleM,seriesCandleL:t.candleData.seriesCandleL,seriesCandleC:t.candleData.seriesCandleC,seriesRangeStart:t.rangeData.seriesRangeStart,seriesRangeEnd:t.rangeData.seriesRangeEnd,seriesGoals:t.seriesData.seriesGoals}}toggleDataPointSelection(t,e){return this.updateHelpers.toggleDataPointSelection(t,e)}zoomX(t,e){var i;null==(i=this.ctx.toolbar)||i.zoomUpdateOptions(t,e)}setLocale(t){this.localization.setCurrentLocaleValues(t)}dataURI(t){if(!this.ctx.exports)throw new Error("apexcharts: Exports feature is not registered. Import apexcharts/features/exports.");return this.trellis&&this.trellis._mounted?this.trellis.exports.dataURI(t):this.ctx.exports.dataURI(t)}getSvgString(t){if(!this.ctx.exports)throw new Error("apexcharts: Exports feature is not registered. Import apexcharts/features/exports.");return this.trellis&&this.trellis._mounted?this.trellis.exports.svgString():this.ctx.exports.getSvgString(t)}exportToCSV(t={}){if(!this.ctx.exports)throw new Error("apexcharts: Exports feature is not registered. Import apexcharts/features/exports.");return this.trellis&&this.trellis._mounted?this.trellis.exports.download("csv"):this.ctx.exports.exportToCSV(t)}promotePanel(t){return this.trellis&&this.trellis._mounted?this.trellis.promote(t):Promise.resolve()}restorePanels(){return this.trellis&&this.trellis._mounted?this.trellis.restorePromotion():Promise.resolve()}paper(){return this.w.dom.Paper}getActiveRenderer(){return this.rendererController?this.rendererController.getActiveKind():"svg"}refreshTokens(){return this.lastUpdateOptions=null,this.update()}drillDown(t){if(!this.ctx.drilldown)throw new Error("apexcharts: Drilldown feature is not registered. Import apexcharts/features/drilldown.");return this.ctx.drilldown.drillDown(t)}drillUp(){if(!this.ctx.drilldown)throw new Error("apexcharts: Drilldown feature is not registered. Import apexcharts/features/drilldown.");return this.ctx.drilldown.drillUp()}drillToRoot(){if(!this.ctx.drilldown)throw new Error("apexcharts: Drilldown feature is not registered. Import apexcharts/features/drilldown.");return this.ctx.drilldown.drillToRoot()}clearDrilldownCache(t){if(!this.ctx.drilldown)throw new Error("apexcharts: Drilldown feature is not registered. Import apexcharts/features/drilldown.");return this.ctx.drilldown.clearCache(t)}static _writeDataProps(t,e){for(const i of Object.keys(e)){const s=Object.getOwnPropertyDescriptor(e,i);s&&"value"in s&&(t[i]=s.value)}}_writeParsedSeriesData(e){t._writeDataProps(this.w.seriesData,e)}_writeParsedRangeData(e){t._writeDataProps(this.w.rangeData,e)}_writeParsedCandleData(e){t._writeDataProps(this.w.candleData,e)}_writeParsedLabelData(e){t._writeDataProps(this.w.labelData,e)}_writeParsedAxisFlags(e){t._writeDataProps(this.w.axisFlags,e)}_writeLayoutCoords(e){t._writeDataProps(this.w.layout,e)}_parentResizeCallback(){this.w.globals.animationEnded&&this.w.config.chart.redrawOnParentResize&&this._windowResize()}_windowResize(){this.w.globals.resizeTimer=window.setTimeout(()=>{const t=this.w.globals;if(this.core&&t.lastResizeSignature){const e=this.core.getResizeSignature();if(e.w===t.lastResizeSignature.w&&e.h===t.lastResizeSignature.h&&e.iw===t.lastResizeSignature.iw)return}t.resized=!0,t.dataChanged=!1,this.ctx.update()},150)}_windowResizeHandler(){var t;clearTimeout(null!=(t=this.w.globals.resizeTimer)?t:void 0);let{redrawOnWindowResize:e}=this.w.config.chart;"function"==typeof e&&(e=e()),e&&this._windowResize()}};h(Zs,"perspectives",null);let Ks=Zs;const Js=Object.freeze(Object.defineProperty({__proto__:null,__apex_Animations:Ct,__apex_Animations_applyAnimationPolicy:At,__apex_Animations_applyProgressiveReveal:vt,__apex_Animations_computeStagger:St,__apex_Animations_prefersReducedMotion:wt,__apex_Base:W,__apex_BrowserAPIs_BrowserAPIs:b,__apex_ChartFactory_getChartClass:yi,__apex_ChartFactory_isCustom:mi,__apex_ChartFactory_register:bi,__apex_Config:z,__apex_Constants_LINE_HEIGHT_RATIO:B,__apex_Constants_NICE_SCALE_ALLOWED_MAG_MSD:N,__apex_Constants_NICE_SCALE_DEFAULT_TICKS:Y,__apex_Core:wi,__apex_CoreUtils:H,__apex_Crosshairs:Ut,__apex_DOMShim_SSRClassList:u,__apex_DOMShim_SSRDOMShim:g,__apex_DOMShim_SSRElement:p,__apex_Data:Fi,__apex_DataLabels:Xt,__apex_DateTime:A,__apex_Defaults:X,__apex_Environment_Environment:d,__apex_Events:Gt,__apex_Fill:Lt,__apex_Filters:Mt,__apex_Formatters:S,__apex_Globals:O,__apex_Graphics:Dt,__apex_Markers:Ft,__apex_Options:k,__apex_PathMorphing_arrayToPath:Z,__apex_PathMorphing_morphPaths:it,__apex_PathMorphing_parsePath:U,__apex_PathMorphing_pathBbox:q,__apex_PerformanceCache:zt,__apex_Range:Wt,__apex_Resize_addResizeListener:ks,__apex_Resize_removeResizeListener:_s,__apex_Responsive:Zt,__apex_SVGAnimation_SVGAnimationRunner:ct,__apex_SVGAnimation_installAnimationMethods:dt,__apex_SVGContainer:ts,__apex_SVGDraggable_installDraggable:os,__apex_SVGElement:Ui,__apex_SVGFilter_FilterBuilder:rs,__apex_SVGFilter_SVGFilter:as,__apex_SVGFilter_installFilterMethods:ns,__apex_SVGGradient_SVGGradient:Zi,__apex_SVGPattern_SVGPattern:Qi,__apex_SVGSelectable_installSelectable:ls,__apex_Scales:Ot,__apex_Series:Be,__apex_Theme:Ge,__apex_ThemePalettes_getThemePalettes:Ht,__apex_TimeScale:pi,__apex_TitleSubtitle:je,__apex_Utils:v,__apex_axes_Axes:Vt,__apex_axes_AxesUtils:Bt,__apex_axes_Grid:Yt,__apex_axes_XAxis:Nt,__apex_axes_YAxis:$t,__apex_charts_Scatter:It,__apex_dimensions_Dimensions:ii,__apex_dimensions_Grid:Ze,__apex_dimensions_Helpers:Ve,__apex_dimensions_XAxis:Ue,__apex_dimensions_YAxis:qe,__apex_helpers_Destroy:ps,__apex_helpers_InitCtxVariables:ds,__apex_helpers_Localization:jt,__apex_helpers_UpdateHelpers:Ii,__apex_index_Box:V,__apex_index_SVG:hs,__apex_math_Box:V,__apex_math_Matrix:j,__apex_math_Point:G,__apex_math_SVGNS:$,__apex_tooltip_AxesTooltip:Wi,__apex_tooltip_Intersect:Oi,__apex_tooltip_Labels:zi,__apex_tooltip_Marker:Yi,__apex_tooltip_Position:Bi,__apex_tooltip_Tooltip:Hi,__apex_tooltip_Utils:Xi,default:Ks},Symbol.toStringTag,{value:"Module"}));class Qs{constructor(t,e){this.w=t,this.ctx=e}svgStringToNode(t){return(new DOMParser).parseFromString(t,"image/svg+xml").documentElement}scaleSvgNode(t,e){const i=parseFloat(t.getAttributeNS(null,"width")),s=parseFloat(t.getAttributeNS(null,"height"));t.setAttributeNS(null,"width",i*e),t.setAttributeNS(null,"height",s*e),t.setAttributeNS(null,"viewBox","0 0 "+i+" "+s)}inlineCanvasLayers(t){const e=this.w.dom.elWrap.querySelectorAll(".apexcharts-series-canvas");if(!e.length)return;const i=t.querySelectorAll(".apexcharts-canvas-series");for(let t=0;t<e.length&&t<i.length;t++){let s;try{s=e[t].toDataURL()}catch(t){continue}const a=i[t],r=document.createElementNS($,"image");r.setAttribute("x",a.getAttribute("x")||"0"),r.setAttribute("y",a.getAttribute("y")||"0"),r.setAttribute("width",a.getAttribute("width")||"0"),r.setAttribute("height",a.getAttribute("height")||"0"),r.setAttribute("href",s),r.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",s),a.parentNode&&a.parentNode.replaceChild(r,a)}}queryStyleable(t,e){return Array.prototype.slice.call(t.querySelectorAll(e))}setStyleDefaults(t,e){Object.keys(e).forEach(i=>{""===t.style.getPropertyValue(i)&&t.style.setProperty(i,e[i])})}applyExportStyles(t){const e=this.w;this.queryStyleable(t,"style").forEach(t=>t.remove()),this.queryStyleable(t,[".apexcharts-tooltip",".apexcharts-toolbar",".apexcharts-xaxistooltip",".apexcharts-yaxistooltip",".apexcharts-xcrosshairs",".apexcharts-ycrosshairs",".apexcharts-zoom-rect",".apexcharts-selection-rect"].join(", ")).forEach(t=>{t.style.setProperty("display","none","important")}),this.queryStyleable(t,".apexcharts-flip-y").forEach(t=>{this.setStyleDefaults(t,{transform:"scaleY(-1) translateY(-100%)","transform-origin":"top","transform-box":"fill-box"})}),this.queryStyleable(t,".apexcharts-flip-x").forEach(t=>{this.setStyleDefaults(t,{transform:"scaleX(-1)","transform-origin":"center","transform-box":"fill-box"})}),e.config.legend.show&&e.dom.elLegendWrap&&e.dom.elLegendWrap.children.length&&(this.queryStyleable(t,".apexcharts-legend").forEach(t=>{this.setStyleDefaults(t,{display:"flex",overflow:"auto",padding:"0 10px"});const e=t.classList,i=e.contains("apx-legend-position-left")||e.contains("apx-legend-position-right"),s=e.contains("apx-legend-position-top")||e.contains("apx-legend-position-bottom");e.contains("apexcharts-legend-group-horizontal")&&this.setStyleDefaults(t,{"flex-direction":"column"}),i&&this.setStyleDefaults(t,{"flex-direction":"column",bottom:"0"}),s&&this.setStyleDefaults(t,{"flex-wrap":"wrap"}),i||s&&e.contains("apexcharts-align-left")?this.setStyleDefaults(t,{"justify-content":"flex-start","align-items":"flex-start"}):s&&e.contains("apexcharts-align-center")?this.setStyleDefaults(t,{"justify-content":"center","align-items":"center"}):s&&e.contains("apexcharts-align-right")&&this.setStyleDefaults(t,{"justify-content":"flex-end","align-items":"flex-end"})}),this.queryStyleable(t,".apexcharts-legend-group").forEach(t=>{this.setStyleDefaults(t,{display:"flex"})}),this.queryStyleable(t,".apexcharts-legend-group-vertical").forEach(t=>{this.setStyleDefaults(t,{"flex-direction":"column-reverse"})}),this.queryStyleable(t,".apexcharts-legend-series").forEach(t=>{this.setStyleDefaults(t,{cursor:t.classList.contains("apexcharts-no-click")?"auto":"pointer","line-height":"normal",display:"flex","align-items":"center"})}),this.queryStyleable(t,".apexcharts-legend-text").forEach(t=>{this.setStyleDefaults(t,{position:"relative","font-size":"14px"})}),this.queryStyleable(t,".apexcharts-legend-marker").forEach(t=>{this.setStyleDefaults(t,{position:"relative",display:"flex","align-items":"center","justify-content":"center",cursor:"pointer","margin-right":"1px"})}),this.queryStyleable(t,".apexcharts-inactive-legend").forEach(t=>{this.setStyleDefaults(t,{opacity:"0.45"})}),this.queryStyleable(t,".apexcharts-legend .apexcharts-hidden-zero-series, .apexcharts-legend .apexcharts-hidden-null-series").forEach(t=>{t.style.setProperty("display","none","important")}))}resolveExportBackground(){const t=this.w,e=t.config.chart.background;return e&&"transparent"!==e?e:"dark"===t.config.theme.mode?"#343A3F":"#fff"}collectFontFamilies(){const t=new Set,e=this.w;if(!d.isBrowser()||!e.dom.elWrap)return t;const i=this.queryStyleable(e.dom.elWrap,"text, tspan, .apexcharts-legend-text, .apexcharts-title-text, .apexcharts-subtitle-text");return[e.dom.elWrap,...i].forEach(e=>{const i=b.getComputedStyle(e),s=i&&i.fontFamily;s&&s.split(",").forEach(e=>{const i=e.trim().replace(/^['"]|['"]$/g,"");i&&t.add(i.toLowerCase())})}),t}collectFontFaceRules(){if(!d.isBrowser())return Promise.resolve([]);const t=[],e=[],i=e=>{(e.match(/@font-face\s*\{[^}]*\}/gi)||[]).forEach(e=>{const i=e.match(/font-family\s*:\s*([^;}]+)/i);if(!i)return;const s=i[1].trim().replace(/^['"]|['"]$/g,"");t.push({family:s.toLowerCase(),css:e})})};return Array.from(document.styleSheets||[]).forEach(t=>{let s=null;try{s=t.cssRules}catch(t){s=null}s?Array.from(s).forEach(t=>{5===t.type&&t.cssText&&i(t.cssText)}):t.href&&e.push(fetch(t.href).then(t=>t.ok?t.text():"").then(i).catch(()=>{}))}),Promise.all(e).then(()=>t)}embedFonts(t){const e=this.w;if(!d.isBrowser()||!e.config.chart.toolbar.export.embedFonts||"function"!=typeof fetch)return Promise.resolve();const i=this.collectFontFamilies();return i.size?this.collectFontFaceRules().then(t=>{const e=t.filter(t=>i.has(t.family));return e.length?Promise.all(e.map(t=>this.inlineFontFaceUrls(t.css).catch(()=>null))):Promise.resolve([])}).then(e=>{const i=(e||[]).filter(Boolean).join("\n");if(!i)return;const s=document.createElementNS($,"style");s.textContent=i,t.insertBefore(s,t.firstChild)}).catch(()=>{}):Promise.resolve()}inlineFontFaceUrls(t){const e=[],i=/url\(\s*(['"]?)([^'")]+)\1\s*\)/gi;let s;for(;null!==(s=i.exec(t));)s[2].startsWith("data:")||e.push(s[2]);return e.length?Promise.all(e.map(t=>this.fetchAsDataUri(t).then(e=>({url:t,dataUri:e})).catch(()=>({url:t,dataUri:null})))).then(e=>{let i=t,s=0;return e.forEach(({url:t,dataUri:e})=>{e&&(i=i.split(t).join(e),s++)}),s?i:null}):Promise.resolve(t.includes("data:")?t:null)}fetchAsDataUri(t){return"function"!=typeof fetch||"function"!=typeof btoa?Promise.reject(new Error("fetch unavailable")):fetch(t).then(e=>{if(!e.ok)throw new Error(`HTTP ${e.status} for ${t}`);const i=e.headers.get("content-type")||"application/octet-stream";return e.arrayBuffer().then(t=>{const e=new Uint8Array(t);let s="";for(let t=0;t<e.length;t+=32768)s+=String.fromCharCode.apply(null,e.subarray(t,t+32768));return`data:${i};base64,${btoa(s)}`})})}getSvgString(t){return new Promise(e=>{const i=this.w;let s=t||i.config.chart.toolbar.export.scale||i.config.chart.toolbar.export.width/i.globals.svgWidth;s||(s=1);const a=i.globals.svgWidth*s,r=i.globals.svgHeight*s,n=i.dom.elWrap.cloneNode(!0);n.style.width=a+"px",n.style.height=r+"px",this.inlineCanvasLayers(n),this.applyExportStyles(n);const o=(new XMLSerializer).serializeToString(n);let l=`\n        <svg xmlns="http://www.w3.org/2000/svg"\n          version="1.1"\n          xmlns:xlink="http://www.w3.org/1999/xlink"\n          class="apexcharts-svg"\n          xmlns:data="ApexChartsNS"\n          transform="translate(0, 0)"\n          width="${i.globals.svgWidth}px" height="${i.globals.svgHeight}px">\n          <foreignObject width="100%" height="100%">\n            <div xmlns="http://www.w3.org/1999/xhtml" style="width:${a}px; height:${r}px;">\n              ${o}\n            </div>\n          </foreignObject>\n        </svg>\n      `;const h=this.svgStringToNode(l);1!==s&&this.scaleSvgNode(h,s),Promise.all([this.convertImagesToBase64(h),this.embedFonts(h)]).then(()=>{l=(new XMLSerializer).serializeToString(h),e(l.replace(/&nbsp;/g,"&#160;"))})})}convertImagesToBase64(t){const e="http://www.w3.org/1999/xlink",i=t.getElementsByTagName("image"),s=Array.from(i).map(t=>{const i=t.getAttributeNS(e,"href"),s=t.getAttribute("href"),a=i||s;if(!a||a.startsWith("data:"))return Promise.resolve();const r=a=>{i&&t.setAttributeNS(e,"href",a),!s&&i||t.setAttribute("href",a)};return this.fetchAsDataUri(a).then(r).catch(()=>this.getBase64FromUrl(a).then(r).catch(t=>{}))});return Promise.all(s)}getBase64FromUrl(t){return d.isSSR()?Promise.resolve(t):new Promise((e,i)=>{const s=new Image;s.crossOrigin="Anonymous",s.onload=()=>{const t=document.createElement("canvas");t.width=s.width,t.height=s.height;const i=t.getContext("2d");i&&i.drawImage(s,0,0),e(t.toDataURL())},s.onerror=i,s.src=t})}svgUrl(){return new Promise(t=>{this.getSvgString().then(e=>{const i=new Blob([e],{type:"image/svg+xml;charset=utf-8"});t(URL.createObjectURL(i))})})}dataURI(t){return d.isSSR()?Promise.resolve({imgURI:""}):new Promise(e=>{const i=this.w,s=t?t.scale||t.width/i.globals.svgWidth:1,a=document.createElement("canvas");a.width=i.globals.svgWidth*s,a.height=parseInt(i.dom.elWrap.style.height,10)*s;const r=this.resolveExportBackground(),n=a.getContext("2d");n&&(n.fillStyle=r,n.fillRect(0,0,a.width,a.height),this.getSvgString(s).then(t=>{const i="data:image/svg+xml,"+encodeURIComponent(t),s=new Image;s.crossOrigin="anonymous",s.onload=()=>{n.drawImage(s,0,0);const t=a;if(t.msToBlob){const i=t.msToBlob();e({blob:i})}else{const t=a.toDataURL("image/png");e({imgURI:t})}},s.src=i}))})}exportToSVG(){this.svgUrl().then(t=>{this.triggerDownload(t,this.w.config.chart.toolbar.export.svg.filename,".svg")})}exportToPng(){const t=this.w.config.chart.toolbar.export.scale,e=this.w.config.chart.toolbar.export.width,i=t?{scale:t}:e?{width:e}:void 0;this.dataURI(i).then(({imgURI:t,blob:e})=>{e?navigator.msSaveOrOpenBlob(e,this.w.globals.chartID+".png"):this.triggerDownload(t,this.w.config.chart.toolbar.export.png.filename,".png")})}exportToCSV({series:t,fileName:e,columnDelimiter:i=",",lineDelimiter:s="\n"}){const a=this.w;t||(t=a.config.series);let r=[];const n=[];let o="";const l=a.seriesData.series.map((t,e)=>-1===a.globals.collapsedSeriesIndices.indexOf(e)?t:[]),h=t=>{if(null==t||v.isNumber(t))return t;const e=String(t);return/^[=+\-@\t\r]/.test(e)?`'${e}`:e},c=t=>"function"==typeof a.config.chart.toolbar.export.csv.categoryFormatter?a.config.chart.toolbar.export.csv.categoryFormatter(t):"datetime"===a.config.xaxis.type&&String(t).length>=10?new Date(t).toDateString():v.isNumber(t)?t:h(t.split(i).join("")),d=t=>"function"==typeof a.config.chart.toolbar.export.csv.valueFormatter?a.config.chart.toolbar.export.csv.valueFormatter(t):h(t),p=Math.max(...t.map(t=>t.data?t.data.length:0)),u=new Fi(this.w),g=new Bt(this.w,{theme:this.ctx.theme,timeScale:this.ctx.timeScale}),f=t=>{let e="";if(a.globals.axisCharts){if("category"===a.config.xaxis.type||a.config.xaxis.convertedCatToNumeric)if(a.globals.isBarHorizontal){const i=a.formatters.yLabelFormatters[0],s=new Be(this.ctx.w).getActiveConfigSeriesIndex();e=i(a.labelData.labels[t],{seriesIndex:s,dataPointIndex:t,w:a})}else e=g.getLabel(a.labelData.labels,a.labelData.timescaleLabels,0,t).text;"datetime"===a.config.xaxis.type&&(a.config.xaxis.categories.length?e=a.config.xaxis.categories[t]:a.config.labels.length&&(e=a.config.labels[t]))}else e=a.config.labels[t];return null===e?"nullvalue":(Array.isArray(e)&&(e=e.join(" ")),v.isNumber(e)?e:e.split(i).join(""))},x=(e,s)=>{var o,h,g,x,m,b;if(r.length&&0===s&&n.push(r.join(i)),e.data){const y=e.data.length?e.data:[...Array(p)].map(()=>"");for(let p=0;p<y.length;p++){r=[];let y=f(p);if("nullvalue"!==y){if(y||(u.isFormatXY()?y=t[s].data[p].x:u.isFormat2DArray()&&(y=t[s].data[p]?t[s].data[p][0]:"")),0===s){r.push(c(y));for(let e=0;e<a.seriesData.series.length;e++){const i=u.isFormatXY()?null==(o=t[e].data[p])?void 0:o.y:l[e][p];r.push(d(i))}}("candlestick"===a.config.chart.type||e.type&&"candlestick"===e.type)&&(r.pop(),r.push(a.candleData.seriesCandleO[s][p]),r.push(a.candleData.seriesCandleH[s][p]),r.push(a.candleData.seriesCandleL[s][p]),r.push(a.candleData.seriesCandleC[s][p])),("boxPlot"===a.config.chart.type||e.type&&"boxPlot"===e.type)&&(r.pop(),r.push(a.candleData.seriesCandleO[s][p]),r.push(a.candleData.seriesCandleH[s][p]),r.push(a.candleData.seriesCandleM[s][p]),r.push(a.candleData.seriesCandleL[s][p]),r.push(a.candleData.seriesCandleC[s][p])),"rangeBar"===a.config.chart.type&&(r.pop(),r.push(a.rangeData.seriesRangeStart[s][p]),r.push(a.rangeData.seriesRangeEnd[s][p])),("violin"===a.config.chart.type||e.type&&"violin"===e.type)&&(r.pop(),r.push(null==(h=a.violinData.seriesViolinMin[s])?void 0:h[p]),r.push(null==(g=a.violinData.seriesViolinMax[s])?void 0:g[p]),r.push(null!=(b=null==(m=null==(x=a.violinData.seriesViolinPoints[s])?void 0:x[p])?void 0:m.length)?b:0)),r.length&&n.push(r.join(i))}}}};r.push(a.config.chart.toolbar.export.csv.headerCategory),"boxPlot"===a.config.chart.type?(r.push("minimum"),r.push("q1"),r.push("median"),r.push("q3"),r.push("maximum")):"candlestick"===a.config.chart.type?(r.push("open"),r.push("high"),r.push("low"),r.push("close")):"rangeBar"===a.config.chart.type?(r.push("minimum"),r.push("maximum")):"violin"===a.config.chart.type?(r.push("minimum"),r.push("maximum"),r.push("observations")):t.map((t,e)=>{const s=(t.name?t.name:`series-${e}`)+"";a.globals.axisCharts&&r.push(s.split(i).join("")?s.split(i).join(""):`series-${e}`)}),a.globals.axisCharts||(r.push(a.config.chart.toolbar.export.csv.headerValue),n.push(r.join(i))),a.globals.allSeriesHasEqualX||!a.globals.axisCharts||a.config.xaxis.categories.length||a.config.labels.length?t.map((t,e)=>{a.globals.axisCharts?x(t,e):(r=[],r.push(c(a.labelData.labels[e])),r.push(d(l[e])),n.push(r.join(i)))}):(()=>{const e=new Set,s={};t.forEach((i,a)=>{null==i||i.data.forEach(i=>{let r,n;if(u.isFormatXY())r=i.x,n=i.y;else{if(!u.isFormat2DArray())return;r=i[0],n=i[1]}s[r]||(s[r]=Array(t.length).fill("")),s[r][a]=d(n),e.add(r)})}),r.length&&n.push(r.join(i)),Array.from(e).sort().forEach(t=>{const e=s[t];n.push([c(t),...e].join(i))})})(),o+=n.join(s),this.triggerDownload("data:text/csv; charset=utf-8,"+encodeURIComponent("\ufeff"+o),e||a.config.chart.toolbar.export.csv.filename,".csv")}triggerDownload(t,e,i){if(d.isSSR())return;const s=document.createElement("a");s.href=t,s.download=(e||this.w.globals.chartID)+i,document.body.appendChild(s),s.click(),document.body.removeChild(s)}}Ks.registerFeatures({exports:Qs});let ta=class{constructor(t){this.w=t.w,this.lgCtx=t}getLegendStyles(){if(d.isSSR())return null;const t=document.createElement("style");t.setAttribute("type","text/css");const e=this.w.config.chart.nonce;e&&t.setAttribute("nonce",e);const i=document.createTextNode(".apexcharts-flip-y {\n  transform: scaleY(-1) translateY(-100%);\n  transform-origin: top;\n  transform-box: fill-box;\n}\n.apexcharts-flip-x {\n  transform: scaleX(-1);\n  transform-origin: center;\n  transform-box: fill-box;\n}\n.apexcharts-legend {\n  display: flex;\n  overflow: auto;\n  padding: 0 10px;\n}\n.apexcharts-legend.apexcharts-legend-group-horizontal {\n  flex-direction: column;\n}\n.apexcharts-legend-group {\n  display: flex;\n}\n.apexcharts-legend-group-vertical {\n  flex-direction: column-reverse;\n}\n.apexcharts-legend.apx-legend-position-bottom, .apexcharts-legend.apx-legend-position-top {\n  flex-wrap: wrap\n}\n.apexcharts-legend.apx-legend-position-right, .apexcharts-legend.apx-legend-position-left {\n  flex-direction: column;\n  bottom: 0;\n}\n.apexcharts-legend.apx-legend-position-bottom.apexcharts-align-left, .apexcharts-legend.apx-legend-position-top.apexcharts-align-left, .apexcharts-legend.apx-legend-position-right, .apexcharts-legend.apx-legend-position-left {\n  justify-content: flex-start;\n  align-items: flex-start;\n}\n.apexcharts-legend.apx-legend-position-bottom.apexcharts-align-center, .apexcharts-legend.apx-legend-position-top.apexcharts-align-center {\n  justify-content: center;\n  align-items: center;\n}\n.apexcharts-legend.apx-legend-position-bottom.apexcharts-align-right, .apexcharts-legend.apx-legend-position-top.apexcharts-align-right {\n  justify-content: flex-end;\n  align-items: flex-end;\n}\n.apexcharts-legend-series {\n  cursor: pointer;\n  line-height: normal;\n  display: flex;\n  align-items: center;\n}\n.apexcharts-legend-text {\n  position: relative;\n  font-size: 14px;\n}\n.apexcharts-legend-text *, .apexcharts-legend-marker * {\n  pointer-events: none;\n}\n.apexcharts-legend-marker {\n  position: relative;\n  display: flex;\n  align-items: center;\n  justify-content: center;\n  cursor: pointer;\n  margin-right: 1px;\n}\n\n.apexcharts-legend-series.apexcharts-no-click {\n  cursor: auto;\n}\n.apexcharts-legend .apexcharts-hidden-zero-series, .apexcharts-legend .apexcharts-hidden-null-series {\n  display: none !important;\n}\n.apexcharts-inactive-legend {\n  opacity: 0.45;\n} ");return t.appendChild(i),t}getLegendDimensions(){const t=this.w.dom.baseEl.querySelector(".apexcharts-legend");if(!t)return{clwh:0,clww:0};const{width:e,height:i}=t.getBoundingClientRect();return{clwh:i,clww:e}}appendToForeignObject(){var t;const e=this.getLegendStyles();!1!==this.w.config.chart.injectStyleSheet&&e&&(null==(t=this.w.dom.elLegendForeign)||t.appendChild(e))}toggleDataSeries(t,e){var i,s,a;const r=this.w;if(r.globals.axisCharts||"radialBar"===r.config.chart.type){r.globals.resized=!0;let n=null,o=null;if(r.globals.risingSeries=[],r.globals.axisCharts){if(n=null!=(i=Array.prototype.find.call(r.dom.baseEl.querySelectorAll(".apexcharts-series"),e=>e.getAttribute("data:realIndex")===String(t)))?i:null,!n)return;o=parseInt(null!=(s=n.getAttribute("data:realIndex"))?s:"",10)}else{if(n=r.dom.baseEl.querySelector(`.apexcharts-series[rel='${t+1}']`),!n)return;o=parseInt(null!=(a=n.getAttribute("rel"))?a:"",10)-1}if(e){[{cs:r.globals.collapsedSeries,csi:r.globals.collapsedSeriesIndices},{cs:r.globals.ancillaryCollapsedSeries,csi:r.globals.ancillaryCollapsedSeriesIndices}].forEach(t=>{const e=t.cs,i=t.csi;this.riseCollapsedSeries(e,i,o)})}else this.hideSeries({seriesEl:n,realIndex:o});if(r.config.chart.accessibility.enabled){const e=r.dom.baseEl.querySelector(`.apexcharts-legend-series[rel="${t+1}"]`);if(e){const i=r.globals.collapsedSeriesIndices.includes(o)||r.globals.ancillaryCollapsedSeriesIndices.includes(o);e.setAttribute("aria-pressed",i?"true":"false");const s=e.querySelector(".apexcharts-legend-text"),a=s?s.textContent:r.seriesData.seriesNames[t],n=i?"hidden":"visible";e.setAttribute("aria-label",`${a}, ${n}. Press Enter or Space to toggle.`)}}}else{if(r.globals.resized=!0,r.globals.risingSeries=[],e)this.riseCollapsedSeries(r.globals.collapsedSeries,r.globals.collapsedSeriesIndices,t);else{const e=this.getSeriesAfterCollapsing({realIndex:t});this.lgCtx.updateSeries(e,r.config.chart.animations.dynamicAnimation.enabled)}if(r.config.chart.accessibility.enabled){const e=r.dom.baseEl.querySelector(`.apexcharts-legend-series[rel="${t+1}"]`);if(e){const i=r.globals.collapsedSeriesIndices.includes(t);e.setAttribute("aria-pressed",i?"true":"false");const s=e.querySelector(".apexcharts-legend-text"),a=s?s.textContent:r.seriesData.seriesNames[t],n=i?"hidden":"visible";e.setAttribute("aria-label",`${a}, ${n}. Press Enter or Space to toggle.`)}}}}_nonAxisSliceContainer(t){const e=this.w.config.chart.type;return("pie"===e||"donut"===e||"polarArea"===e||"sunburst"===e)&&1===t.length&&t[0]&&"object"==typeof t[0]&&Array.isArray(t[0].data)?t[0].data:t}_readSliceValue(t){return"unit"===this.w.config.chart.type&&t&&Array.isArray(t.data)?t.data:t&&"object"==typeof t?t.y:t}_writeSliceValue(t,e,i){const s=t[e];"unit"===this.w.config.chart.type&&s&&Array.isArray(s.data)?s.data=Array.isArray(i)?i:[]:s&&"object"==typeof s?s.y=i:t[e]=i}getSeriesAfterCollapsing({realIndex:t}){var e,i;const s=this.w,a=s.globals,r=v.clone(s.config.series);if(a.axisCharts){const e=s.config.yaxis[a.seriesYAxisReverseMap[t]],i={index:t,data:r[t].data.slice(),type:r[t].type||s.config.chart.type,name:(a.seriesNames||[])[t]};if(e&&e.show&&e.showAlways)a.ancillaryCollapsedSeriesIndices.indexOf(t)<0&&(a.ancillaryCollapsedSeries.push(i),a.ancillaryCollapsedSeriesIndices.push(t));else if(a.collapsedSeriesIndices.indexOf(t)<0){a.collapsedSeries.push(i),a.collapsedSeriesIndices.push(t);const e=a.risingSeries.indexOf(t);a.risingSeries.splice(e,1)}}else if(a.collapsedSeriesIndices.indexOf(t)<0){const n=this._nonAxisSliceContainer(r);a.collapsedSeries.push({index:t,data:this._readSliceValue(n[t]),type:null!=(i=null==(e=s.config.series[t])?void 0:e.type)?i:"line",name:(a.seriesNames||[])[t]}),a.collapsedSeriesIndices.push(t)}const n=a.axisCharts?s.config.series.length:this._nonAxisSliceContainer(r).length;return a.allSeriesCollapsed=a.collapsedSeries.length+a.ancillaryCollapsedSeries.length===n,this._getSeriesBasedOnCollapsedState(r)}hideSeries({seriesEl:t,realIndex:e}){const i=this.w,s=this.getSeriesAfterCollapsing({realIndex:e}),a=t.childNodes;for(let t=0;t<a.length;t++)a[t].classList.contains("apexcharts-series-markers-wrap")&&(a[t].classList.contains("apexcharts-hide")?a[t].classList.remove("apexcharts-hide"):a[t].classList.add("apexcharts-hide"));const r=i.config.chart.animations.dynamicAnimation.enabled;r&&(i.globals.collapsingSeriesIndices=[e]);const n=()=>{i.globals.collapsingSeriesIndices=[]},o=this.lgCtx.updateSeries(s,r);n(),o&&"function"==typeof o.then&&o.then(n,n)}riseCollapsedSeries(t,e,i){const s=this.w;let a=v.clone(s.config.series);if(t.length>0){for(let r=0;r<t.length;r++)if(t[r].index===i){if(s.globals.axisCharts)a[i].data=t[r].data.slice(),a[i].hidden=!1;else{const e=this._nonAxisSliceContainer(a);this._writeSliceValue(e,i,t[r].data)}t.splice(r,1),e.splice(r,1),s.globals.risingSeries.push(i),r--}a=this._getSeriesBasedOnCollapsedState(a),this.lgCtx.updateSeries(a,s.config.chart.animations.dynamicAnimation.enabled)}}_getSeriesBasedOnCollapsedState(t){const e=this.w;let i=0;if(e.globals.axisCharts)t.forEach((s,a)=>{e.globals.collapsedSeriesIndices.indexOf(a)<0&&e.globals.ancillaryCollapsedSeriesIndices.indexOf(a)<0||(t[a].data=[],i++)});else{const s=this._nonAxisSliceContainer(t);s.forEach((t,a)=>{e.globals.collapsedSeriesIndices.indexOf(a)<0||(this._writeSliceValue(s,a,0),i++)})}const s=e.globals.axisCharts?t.length:this._nonAxisSliceContainer(t).length;return e.globals.allSeriesCollapsed=i===s,t}};const ea=["#cf4d3f","#8f9499","#26a75b"],ia=(t,e,i)=>t+(e-t)*i;function sa(t){return Math.max(0,Math.min(255,Math.round(t))).toString(16).padStart(2,"0")}function aa(t,e,i){const s=v.parseHex(ra(t)),a=v.parseHex(ra(e));return s&&a?"#"+sa(ia(s[0],a[0],i))+sa(ia(s[1],a[1],i))+sa(ia(s[2],a[2],i)):t}function ra(t){if("string"!=typeof t)return"#000000";if(v.isColorHex(t))return t;return v.rgb2hex(t)||"#000000"}function na(t,e,i){const s=t.config.series[e];return oa(t,s&&Array.isArray(s.data)?s.data[i]:null,e,i)}function oa(t,e,i,s){var a,r,n;if(!e||"object"!=typeof e)return null;const o=null==(n=null==(r=null==(a=t.config.plotOptions)?void 0:a.treemap)?void 0:r.colorScale)?void 0:n.colorValue;let l;if(l="function"==typeof o?o(e,{seriesIndex:i,dataPointIndex:s,w:t}):"string"==typeof o?e[o]:e.colorValue,null==l)return null;const h=Number(l);return Number.isFinite(h)?h:null}function la(t){var e,i,s;const a=null==(s=null==(i=null==(e=t.config)?void 0:e.plotOptions)?void 0:i.treemap)?void 0:s.colorScale,r=a&&a.gradient;if(!r)return null;if(!1===r.enabled)return null;const n=t.config.series||[];let o=1/0,l=-1/0,h=!1;for(let e=0;e<n.length;e++){const i=n[e]&&n[e].data;if(Array.isArray(i))for(let s=0;s<i.length;s++){const a=oa(t,i[s],e,s);null!=a&&(h=!0,a<o&&(o=a),a>l&&(l=a))}}if(!h&&!0!==r.enabled)return null;Number.isFinite(o)||(o=0,l=0);let c=Number.isFinite(Number(r.min))?Number(r.min):o,d=Number.isFinite(Number(r.max))?Number(r.max):l,p=null;if(null===r.midpoint?p=null:Number.isFinite(Number(r.midpoint))?p=Number(r.midpoint):c<0&&d>0&&(p=0),null!=p&&!1!==r.symmetric&&!Number.isFinite(Number(r.min))&&!Number.isFinite(Number(r.max))){const t=Math.max(Math.abs(c-p),Math.abs(d-p));c=p-t,d=p+t}d===c&&(c-=.5,d+=.5);const u=function(t,e,i,s){if(Array.isArray(t.stops)&&t.stops.length>=2)return t.stops.filter(t=>t&&Number.isFinite(Number(t.value))).map(t=>({value:Number(t.value),color:ra(t.color)})).sort((t,e)=>t.value-e.value);const a=(Array.isArray(t.colors)&&t.colors.length>=2?t.colors:ea).map(ra),r=a.length;if(null!=s&&r>=3){const t=Math.floor((r-1)/2),n=[];for(let i=0;i<=t;i++)n.push({value:ia(e,s,i/t),color:a[i]});for(let e=t+1;e<r;e++)n.push({value:ia(s,i,(e-t)/(r-1-t)),color:a[e]});return n}return a.map((t,s)=>({value:ia(e,i,s/(r-1)),color:t}))}(r,c,d,p);if(u.length<2)return null;const g=d-c,f=u.map(t=>({percent:0===g?0:(t.value-c)/g,color:t.color}));return{min:c,max:d,midpoint:p,stops:u,at:t=>{if(!Number.isFinite(t))return u[Math.floor(u.length/2)].color;if(t<=u[0].value)return u[0].color;const e=u[u.length-1];if(t>=e.value)return e.color;for(let e=1;e<u.length;e++){const i=u[e];if(t<=i.value){const s=u[e-1],a=i.value-s.value,r=0===a?0:(t-s.value)/a;return aa(s.color,i.color,r)}}return e.color},legendStops:f}}function ha(t){const e=ra(t);return v.getContrastRatio(e,"#ffffff")>=v.getContrastRatio(e,"#000000")?"#ffffff":"#000000"}const ca="http://www.w3.org/2000/svg";class da{constructor(t,e){this.w=t,this.ctx=e,this.svgEl=null,this.arrowEl=null,this.hoverValueEl=null,this._min=0,this._max=0,this._geom=null,this._bandHitEls=[],this._activeBandIndex=-1,this._targetEl=null,this._onCellEnter=this._onCellEnter.bind(this),this._onCellLeave=this._onCellLeave.bind(this),this._onBandEnter=this._onBandEnter.bind(this),this._onBandLeave=this._onBandLeave.bind(this)}_getFormatter(){const t=this._cfg();return"function"==typeof t.formatter?t.formatter:t=>{if(!Number.isFinite(t))return String(t);const e=Math.abs(t);return e>=1e3?t.toFixed(0):e>=10?t.toFixed(1):t.toFixed(2)}}static colorScaleOf(t){var e,i,s,a,r;const n=null==(i=null==(e=null==t?void 0:t.config)?void 0:e.chart)?void 0:i.type;return n&&(null==(r=null==(a=null==(s=null==t?void 0:t.config)?void 0:s.plotOptions)?void 0:a[n])?void 0:r.colorScale)||null}static configFor(t){const e=da.colorScaleOf(t);return e&&e.gradientLegend||null}_cfg(){return da.configFor(this.w)||{}}static isEnabled(t){if(!da.supports(t))return!1;const e=da.configFor(t);return!(!e||!e.enabled)}static supports(t){var e,i;const s=null==(i=null==(e=null==t?void 0:t.config)?void 0:e.chart)?void 0:i.type;return"heatmap"===s||"treemap"===s}draw(t=null){var e,i,s,a,r,n,o,l;const h=this.w;this._targetEl=t;const c=t||h.dom.elLegendWrap;if(!c)return;const d=this._cfg(),p=h.config.legend.position,u="left"===p||"right"===p,g=null!=(i=null==(e=d.arrow)?void 0:e.size)?i:8,f=g+4,x=d.showLabels?28:4,m=d.showLabels?20:4,y=d.showLabels?44:0,w=this._resolveStripLength(u?d.height:d.width,u),v=d.thickness,A=u?Math.max(v+f+4,y):w+2*x,S=u?w+2*m:v+f+4,C=(A-(v+f))/2,k=u?"left"===p?C:C+f:x,_=u?m:"top"===p?f:4,M=b.createElementNS(ca,"svg");M.setAttribute("class","apexcharts-heatmap-gradient-legend apexcharts-gradient-legend"),M.setAttribute("width",String(A)),M.setAttribute("height",String(S)),M.setAttribute("overflow","visible");const D=b.createElementNS(ca,"defs"),L=`apexcharts-heatmap-gradient-${h.globals.cuid}`,P=b.createElementNS(ca,"linearGradient");P.setAttribute("id",L),u?(P.setAttribute("x1","0"),P.setAttribute("y1","1"),P.setAttribute("x2","0"),P.setAttribute("y2","0")):(P.setAttribute("x1","0"),P.setAttribute("y1","0"),P.setAttribute("x2","1"),P.setAttribute("y2","0"));const{min:E,max:T,stops:F,bands:I}=this._computeStops();this._min=E,this._max=T,F.forEach(t=>{const e=b.createElementNS(ca,"stop");e.setAttribute("offset",`${(100*t.percent).toFixed(2)}%`),e.setAttribute("stop-color",t.color),P.appendChild(e)}),D.appendChild(P),M.appendChild(D);const R=b.createElementNS(ca,"rect");if(R.setAttribute("x",String(k)),R.setAttribute("y",String(_)),R.setAttribute("width",String(u?v:w)),R.setAttribute("height",String(u?w:v)),R.setAttribute("rx","2"),R.setAttribute("fill",`url(#${L})`),M.appendChild(R),d.showLabels){const t=(null==(s=d.labelStyle)?void 0:s.colors)||(Array.isArray(h.config.legend.labels.colors)?h.config.legend.labels.colors[0]:h.config.legend.labels.colors)||h.config.chart.foreColor,e=(null==(a=d.labelStyle)?void 0:a.fontSize)||"11px",i=(null==(r=d.labelStyle)?void 0:r.fontFamily)||h.config.chart.fontFamily,n=this._getFormatter(),o=(s,a,r,n)=>{const o=b.createElementNS(ca,"text");return o.setAttribute("x",String(a)),o.setAttribute("y",String(r)),o.setAttribute("text-anchor",n),o.setAttribute("dominant-baseline","middle"),o.setAttribute("fill",t),o.setAttribute("font-size",e),i&&o.setAttribute("font-family",i),o.textContent=String(s),o};if(u){const t=k+v/2;M.appendChild(o(n(E),t,_+w+10,"middle")),M.appendChild(o(n(T),t,_-10,"middle"))}else{const t=_+v/2;M.appendChild(o(n(E),k-6,t,"end")),M.appendChild(o(n(T),k+w+6,t,"start"))}}const X=(null==(n=d.arrow)?void 0:n.color)||h.config.chart.foreColor,z=this._buildArrow(g,X,p);if(M.appendChild(z),this.arrowEl=z,this._bandHitEls=[],h.config.legend.onItemHover.highlightDataSeries&&I.length>0&&I.forEach(t=>{const e=b.createElementNS(ca,"rect");if(u){const i=_+w-t.p2*w,s=_+w-t.p1*w;e.setAttribute("x",String(k)),e.setAttribute("y",String(i)),e.setAttribute("width",String(v)),e.setAttribute("height",String(Math.max(0,s-i)))}else e.setAttribute("x",String(k+t.p1*w)),e.setAttribute("y",String(_)),e.setAttribute("width",String(Math.max(0,(t.p2-t.p1)*w))),e.setAttribute("height",String(v));e.setAttribute("fill","transparent"),e.setAttribute("class","apexcharts-heatmap-gradient-band"),e.setAttribute("data:range-index",String(t.index)),e.style.cursor="pointer",M.appendChild(e),this._bandHitEls.push(e)}),this._geom={isVertical:u,position:p,stripX:k,stripY:_,stripLength:w,stripThickness:v,arrowSize:g,svgWidth:A,svgHeight:S},d.showHoverValue){const t=b.createElement("div");t.classList.add("apexcharts-heatmap-gradient-legend-value"),t.style.position="absolute",t.style.fontSize=(null==(o=d.labelStyle)?void 0:o.fontSize)||"11px",t.style.fontFamily=(null==(l=d.labelStyle)?void 0:l.fontFamily)||h.config.chart.fontFamily||"",t.style.color=h.config.chart.foreColor,t.style.background="rgba(0,0,0,0.65)",t.style.color="#fff",t.style.padding="2px 6px",t.style.borderRadius="3px",t.style.pointerEvents="none",t.style.whiteSpace="nowrap",t.style.opacity="0",t.style.transition="opacity 120ms ease",this.hoverValueEl=t}c.classList.add("apexcharts-heatmap-gradient-legend-wrap"),c.classList.add("apx-legend-position-"+p),c.appendChild(M),this.hoverValueEl&&c.appendChild(this.hoverValueEl),this.svgEl=M,t?(c.style.width=A+"px",c.style.height=S+"px",c.style.position="relative",c.style.overflow="visible"):this._applyWrapAlignment(c,p,u,A,S),this._attachHoverListeners(),this._attachBandHoverListeners()}_resolveStripLength(t,e){const i=this.w,s=e?i.globals.svgHeight||i.config.chart.height||300:i.globals.svgWidth||i.config.chart.width||600;if("string"==typeof t){const e=t.trim();if(e.endsWith("%")){const t=parseFloat(e)||0;return Math.max(20,s*t/100)}const i=parseFloat(e);return Number.isFinite(i)?i:200}return"number"==typeof t&&Number.isFinite(t)?t:200}_applyWrapAlignment(t,e,i,s,a){const r=this.w,n=this._cfg().align||"center",o=12,l=r.globals.svgWidth||r.config.chart.width||600,h=r.globals.svgHeight||r.config.chart.height||300,c=r.config.legend.offsetX||0,d=r.config.legend.offsetY||0;if(t.style.position="absolute",t.style.display="block",t.style.overflow="visible",t.style.padding="0",t.style.width=s+"px",t.style.height=a+"px",t.style.right="auto",t.style.bottom="auto",i){const i=h-a-24;let r;r="start"===n?o:"end"===n?o+Math.max(0,i):o+Math.max(0,i)/2,t.style.top=r+d+"px",t.style.left="left"===e?o+c+"px":l-s-o+c+"px"}else{const i=l-s-24;let r;r="start"===n?o:"end"===n?o+Math.max(0,i):o+Math.max(0,i)/2,t.style.left=r+c+"px",t.style.top="top"===e?o+d+"px":h-a-o+d+"px"}}repositionToPlot(){var t,e;if(!d.isBrowser())return;if(this._targetEl)return;const i=this.w,s=i.globals,a=i.dom.elLegendWrap;if(!a||!this._geom)return;if(!Number.isFinite(s.gridWidth)||!Number.isFinite(s.gridHeight))return;const{isVertical:r,position:n,svgWidth:o,svgHeight:l,stripX:h,stripY:c,stripThickness:p}=this._geom,u=this._cfg().align||"center",g=i.config.legend.offsetX||0,f=i.config.legend.offsetY||0,x=null==(e=null==(t=this.ctx)?void 0:t.dimensions)?void 0:e.dimHelpers,m=x?x.getTitleSubtitleCoords("title").height+x.getTitleSubtitleCoords("subtitle").height:0,y=i.layout.xAxisHeight||0,w=(t,e)=>{const i=Math.max(0,t-e);return"start"===u?0:"end"===u?i:i/2};if(r){a.style.top=s.translateY+w(s.gridHeight,l)+f+"px";const t=(("left"===n?0:s.translateX+s.gridWidth)+("left"===n?s.translateX:s.svgWidth))/2;a.style.left=t-h-p/2+g+"px"}else{a.style.left=s.translateX+w(s.gridWidth,o)+g+"px";const t=(("top"===n?m:s.translateY+s.gridHeight+y)+("top"===n?s.translateY:s.svgHeight))/2;a.style.top=t-c-p/2+f+"px"}b.requestAnimationFrame(()=>this._enforceMinPlotGap())}_enforceMinPlotGap(){const t=this.w,e=t.dom.elLegendWrap,i=this.svgEl&&this.svgEl.querySelector("rect"),s=t.dom.baseEl.querySelector(".apexcharts-grid");if(!(e&&i&&s&&this._geom))return;const a=i.getBoundingClientRect(),r=s.getBoundingClientRect();if(!(a.width&&a.height&&r.width&&r.height))return;const{isVertical:n,position:o}=this._geom;if(n){const t="left"===o?r.left-a.right:a.left-r.right;if(t<16){const i=parseFloat(e.style.left)||0,s=16-t;e.style.left=i+("left"===o?-s:s)+"px"}}else{const t="top"===o?r.top-a.bottom:a.top-r.bottom;if(t<16){const i=parseFloat(e.style.top)||0,s=16-t;e.style.top=i+("top"===o?-s:s)+"px"}}}destroy(){var t,e,i,s,a,r,n;for(let i=0;i<this._bandHitEls.length;i++){const s=this._bandHitEls[i];null==(t=s.removeEventListener)||t.call(s,"mousemove",this._onBandEnter),null==(e=s.removeEventListener)||e.call(s,"mouseout",this._onBandLeave)}if(this._bandHitEls=[],this._activeBandIndex=-1,null==(i=this.ctx)?void 0:i.events)try{null==(a=(s=this.ctx.events).removeEventListener)||a.call(s,"dataPointMouseEnter",this._onCellEnter),null==(n=(r=this.ctx.events).removeEventListener)||n.call(r,"dataPointMouseLeave",this._onCellLeave)}catch(t){}}_attachBandHoverListeners(){if(d.isBrowser())for(let t=0;t<this._bandHitEls.length;t++){const e=this._bandHitEls[t];e.addEventListener("mousemove",this._onBandEnter),e.addEventListener("mouseout",this._onBandLeave)}}_onBandEnter(t){var e,i,s,a;const r=this.w,n=t.currentTarget,o=parseInt(null!=(e=n.getAttribute("data:range-index"))?e:"-1",10);o<0||o===this._activeBandIndex||(this._activeBandIndex=o,null==(a=null==(s=null==(i=this.ctx)?void 0:i.events)?void 0:s.fireEvent)||a.call(s,"legendHover",[this.ctx,o,r]),new Be(r).highlightRangeInSeries(o,"highlight"))}_onBandLeave(){if(this._activeBandIndex<0)return;const t=this._activeBandIndex;this._activeBandIndex=-1,new Be(this.w).highlightRangeInSeries(t,"reset")}_attachHoverListeners(){var t,e;d.isBrowser()&&(null==(e=null==(t=this.ctx)?void 0:t.events)?void 0:e.addEventListener)&&(this.ctx.events.addEventListener("dataPointMouseEnter",this._onCellEnter),this.ctx.events.addEventListener("dataPointMouseLeave",this._onCellLeave))}_onCellEnter(...t){var e,i,s;const a=this.w;if(!this.arrowEl)return;const r=t[t.length-1];if(!r||"object"!=typeof r)return;const n=r.seriesIndex,o=r.dataPointIndex;if("number"!=typeof n||"number"!=typeof o)return;if(!da.supports(a))return;let l;l=this._continuous?na(a,n,o):null==(s=null==(i=null==(e=a.seriesData)?void 0:e.series)?void 0:i[n])?void 0:s[o],null==l||Number.isNaN(l)||this._positionArrow(l)}_onCellLeave(){this.arrowEl&&(this.arrowEl.setAttribute("opacity","0"),this.hoverValueEl&&(this.hoverValueEl.style.opacity="0"))}_positionArrow(t){if(!this.arrowEl||!this._geom)return;const{isVertical:e,position:i,stripX:s,stripY:a,stripLength:r,stripThickness:n,arrowSize:o}=this._geom,l=this._min,h=this._max-l;let c;if(c=0===h?.5:(t-l)/h,c<0&&(c=0),c>1&&(c=1),e){const t=a+r-c*r;let e,l;"left"===i?(e=s+n,l=e+o):(e=s,l=e-o);const h=[`${e},${t}`,`${l},${t-o/2}`,`${l},${t+o/2}`].join(" ");this.arrowEl.setAttribute("points",h)}else{const t=s+c*r;let e,l;"top"===i?(e=a+n,l=e+o):(e=a,l=e-o);const h=[`${t},${e}`,`${t-o/2},${l}`,`${t+o/2},${l}`].join(" ");this.arrowEl.setAttribute("points",h)}if(this.arrowEl.setAttribute("opacity","1"),this.hoverValueEl){const l=this._getFormatter();if(this.hoverValueEl.textContent=l(t),e){const t=a+r-c*r;"left"===i?this.hoverValueEl.style.left=`${s+n+o+8}px`:(this.hoverValueEl.style.left=s-o-8+"px",this.hoverValueEl.style.transform="translateX(-100%)"),this.hoverValueEl.style.top=t-9+"px"}else{const t=s+c*r;this.hoverValueEl.style.left=`${t}px`,this.hoverValueEl.style.transform="translateX(-50%)",this.hoverValueEl.style.top="top"===i?`${a+n+o+8}px`:a-o-18+"px"}this.hoverValueEl.style.opacity="1"}}_buildArrow(t,e,i){const s=b.createElementNS(ca,"polygon");return s.setAttribute("fill",e),s.setAttribute("opacity","0"),s.setAttribute("class","apexcharts-heatmap-gradient-arrow"),s.setAttribute("points","0,0 0,0 0,0"),s.setAttribute("pointer-events","none"),s}_computeStops(){var t,e;const i=this.w,s=da.colorScaleOf(i)||{},a=this._cfg(),r=la(i);if(r)return this._continuous=!0,{min:r.min,max:r.max,stops:r.legendStops,bands:[]};this._continuous=!1;let n=1/0,h=-1/0;const c=(null==(t=i.seriesData)?void 0:t.series)||[];for(let t=0;t<c.length;t++){const e=c[t];if(e)for(let t=0;t<e.length;t++){const i=e[t];null==i||Number.isNaN(i)||(i<n&&(n=i),i>h&&(h=i))}}Number.isFinite(n)||(n=0),Number.isFinite(h)||(h=0);let d=n,p=h;void 0!==s.min&&void 0!==s.max&&s.max>s.min?(d=s.min,p=s.max):(void 0!==s.min&&(d=s.min<n?s.min:n),void 0!==s.max&&(p=s.max>h?s.max:h));const u=[],g=[];if(s.ranges&&s.ranges.length>0){const t=s.ranges.map((t,e)=>l(o({},t),{_originalIndex:e})).sort((t,e)=>t.from-e.from),e=t[0].from,i=t[t.length-1].to;d=e,p=i;const a=i-e||1;t.forEach(t=>{const i=(t.from-e)/a,s=(t.to-e)/a;u.push({percent:(i+s)/2,color:t.color}),g.push({index:t._originalIndex,p1:i,p2:s})})}else{const t=i.globals.colors[0]||"#008FFB",s=new v,r=i.config.plotOptions[i.config.chart.type]||{},n=null!=(e=r.shadeIntensity)?e:.5,o=i.globals.hasNegs,l=Math.max(2,a.stops||16);for(let e=0;e<l;e++){const a=e/(l-1),h=d+a*(p-d),c=Math.abs(p)+Math.abs(d),g=0===c?0:100*h/c;let f;f=o?r.reverseNegativeShade?g<0?g/100*(1.25*n):1.25*n*(1-g/100):g<=0?1-(1+g/100)*n:(1-g/100)*n:1-g/100,f>1&&(f=1),f<-1&&(f=-1);const x=r.enableShades?s.shadeColor("dark"===i.config.theme.mode?-1*f:f,t):t;u.push({percent:a,color:x})}}return{min:d,max:p,stops:u,bands:g}}}Ks.registerFeatures({legend:class{constructor(t,e){this.w=t,this.ctx=e,this.updateSeries=(...t)=>e.updateHelpers._updateSeries(...t),this.onLegendClick=this.onLegendClick.bind(this),this.onLegendHovered=this.onLegendHovered.bind(this),this.isBarsDistributed="bar"===this.w.config.chart.type&&this.w.config.plotOptions.bar.distributed&&1===this.w.config.series.length,this.legendHelpers=new ta(this)}init(){const t=this.w,e=t.globals,i=t.config;this.isBarsDistributed="bar"===i.chart.type&&i.plotOptions.bar.distributed&&1===i.series.length;const s=i.legend.showForSingleSeries&&1===this.w.seriesData.series.length||this.isBarsDistributed||"heatmap"===i.chart.type||da.isEnabled(t)||this.w.seriesData.series.length>1;if(this.legendHelpers.appendToForeignObject(),(s||!e.axisCharts)&&i.legend.show){const e=t.dom.elLegendWrap;for(;e.firstChild;)e.removeChild(e.firstChild);this.heatmapGradientLegend&&(this.heatmapGradientLegend.destroy(),this.heatmapGradientLegend=null),da.isEnabled(t)?(this.heatmapGradientLegend=new da(t,this.ctx),this.heatmapGradientLegend.draw()):(this.drawLegends(),"bottom"===i.legend.position||"top"===i.legend.position?this.legendAlignHorizontal():"right"!==i.legend.position&&"left"!==i.legend.position||this.legendAlignVertical())}}createLegendMarker({i:t,fillcolor:e}){const i=this.w,s=b.createElement("span");s.classList.add("apexcharts-legend-marker");const a=i.config.legend.markers.shape||i.config.markers.shape;let r=a;Array.isArray(a)&&(r=a[t]);const n=Array.isArray(i.config.legend.markers.size)?parseFloat(i.config.legend.markers.size[t]):parseFloat(i.config.legend.markers.size),h=Array.isArray(i.config.legend.markers.offsetX)?parseFloat(i.config.legend.markers.offsetX[t]):parseFloat(i.config.legend.markers.offsetX),c=Array.isArray(i.config.legend.markers.offsetY)?parseFloat(i.config.legend.markers.offsetY[t]):parseFloat(i.config.legend.markers.offsetY),p=Array.isArray(i.config.legend.markers.strokeWidth)?parseFloat(i.config.legend.markers.strokeWidth[t]):parseFloat(i.config.legend.markers.strokeWidth),u=s.style;if(u.height=2*(n+p)+"px",u.width=2*(n+p)+"px",u.left=h+"px",u.top=c+"px",i.config.legend.markers.customHTML)u.background="transparent",u.color=e[t],Array.isArray(i.config.legend.markers.customHTML)?i.config.legend.markers.customHTML[t]&&(s.innerHTML=i.config.legend.markers.customHTML[t]()):s.innerHTML=i.config.legend.markers.customHTML();else{const a=new Ft(this.ctx.w,this.ctx).getMarkerConfig({cssClass:`apexcharts-legend-marker apexcharts-marker apexcharts-marker-${r}`,seriesIndex:t,strokeWidth:p,size:n}),h=(d.isBrowser()?window.SVG:global.SVG)().addTo(s).size("100%","100%"),c=new Dt(this.w).drawMarker(0,0,l(o({},a),{pointFillColor:Array.isArray(e)?e[t]:a.pointFillColor,shape:r}));i.dom.Paper.find(".apexcharts-legend-marker.apexcharts-marker").forEach(t=>{t.node.classList.contains("apexcharts-marker-triangle")?t.node.style.transform="translate(50%, 45%)":t.node.style.transform="translate(50%, 50%)"}),h.add(c)}return s}drawLegends(){var t;const e=this,i=this.w,s=i.dom.elLegendWrap,a=i.config.legend.fontFamily;let r=i.seriesData.seriesNames,n=i.config.legend.markers.fillColors?i.config.legend.markers.fillColors.slice():i.globals.colors.slice();if("heatmap"===i.config.chart.type){const t=i.config.plotOptions.heatmap.colorScale.ranges;r=t.map(t=>t.name?t.name:t.from+" - "+t.to),n=t.map(t=>t.color)}else this.isBarsDistributed&&(r=i.labelData.labels.slice());i.config.legend.customLegendItems.length&&(r=i.config.legend.customLegendItems);const o=i.formatters.legendFormatter,l=i.config.legend.inverseOrder,h=[];i.labelData.seriesGroups.length>1&&i.config.legend.clusterGroupedSeries&&i.labelData.seriesGroups.forEach((t,e)=>{h[e]=b.createElement("div"),h[e].classList.add("apexcharts-legend-group",`apexcharts-legend-group-${e}`),"horizontal"===i.config.legend.clusterGroupedSeriesOrientation?s.classList.add("apexcharts-legend-group-horizontal"):h[e].classList.add("apexcharts-legend-group-vertical")});for(let e=l?r.length-1:0;l?e>=0:e<=r.length-1;l?e--:e++){const l=o(r[e],{seriesIndex:e,w:i});let c=!1,d=!1;if(i.globals.collapsedSeries.length>0)for(let t=0;t<i.globals.collapsedSeries.length;t++)i.globals.collapsedSeries[t].index===e&&(c=!0);if(i.globals.ancillaryCollapsedSeriesIndices.length>0)for(let t=0;t<i.globals.ancillaryCollapsedSeriesIndices.length;t++)i.globals.ancillaryCollapsedSeriesIndices[t]===e&&(d=!0);const p=this.createLegendMarker({i:e,fillcolor:n});Dt.setAttrs(p,{rel:e+1,"data:collapsed":c||d}),(c||d)&&p.classList.add("apexcharts-inactive-legend");const u=b.createElement("div");if(i.config.chart.accessibility.enabled&&i.config.chart.accessibility.keyboard.enabled){u.setAttribute("role","button"),u.setAttribute("tabindex","0");const t=Array.isArray(l)?l.join(" "):l,e=c||d,i=e?"hidden":"visible";u.setAttribute("aria-label",`${t}, ${i}. Press Enter or Space to toggle.`),u.setAttribute("aria-pressed",e?"true":"false")}const g=b.createElement("span");g.classList.add("apexcharts-legend-text"),g.innerHTML=Array.isArray(l)?l.join(" "):l;let f=i.config.legend.labels.useSeriesColors?i.globals.colors[e]:Array.isArray(i.config.legend.labels.colors)?null==(t=i.config.legend.labels.colors)?void 0:t[e]:i.config.legend.labels.colors;f||(f=i.config.chart.foreColor),g.style.color=f,g.style.fontSize=i.config.legend.fontSize,g.style.fontWeight=i.config.legend.fontWeight,g.style.fontFamily=a||i.config.chart.fontFamily,Dt.setAttrs(g,{rel:e+1,i:e,"data:default-text":encodeURIComponent(l),"data:collapsed":c||d}),u.appendChild(p),u.appendChild(g);const x=new H(this.w);if(!i.config.legend.showForZeroSeries){0===x.getSeriesTotalByIndex(e)&&x.seriesHaveSameValues(e)&&!x.isSeriesNull(e)&&-1===i.globals.collapsedSeriesIndices.indexOf(e)&&-1===i.globals.ancillaryCollapsedSeriesIndices.indexOf(e)&&u.classList.add("apexcharts-hidden-zero-series")}i.config.legend.showForNullSeries||x.isSeriesNull(e)&&-1===i.globals.collapsedSeriesIndices.indexOf(e)&&-1===i.globals.ancillaryCollapsedSeriesIndices.indexOf(e)&&u.classList.add("apexcharts-hidden-null-series"),h.length?i.labelData.seriesGroups.forEach((t,a)=>{var r,n;t.includes(null!=(n=null==(r=i.config.series[e])?void 0:r.name)?n:"")&&(s.appendChild(h[a]),h[a].appendChild(u))}):s.appendChild(u),s.classList.add(`apexcharts-align-${i.config.legend.horizontalAlign}`),s.classList.add("apx-legend-position-"+i.config.legend.position),u.classList.add("apexcharts-legend-series"),u.style.margin=`${i.config.legend.itemMargin.vertical}px ${i.config.legend.itemMargin.horizontal}px`,s.style.width=i.config.legend.width?i.config.legend.width+"px":"",s.style.height=i.config.legend.height?i.config.legend.height+"px":"",Dt.setAttrs(u,{rel:e+1,seriesName:v.escapeString(r[e]),"data:collapsed":c||d}),(c||d)&&u.classList.add("apexcharts-inactive-legend"),i.config.legend.onItemClick.toggleDataSeries||u.classList.add("apexcharts-no-click")}i.dom.elWrap.addEventListener("click",e.onLegendClick,!0),i.config.legend.onItemHover.highlightDataSeries&&0===i.config.legend.customLegendItems.length&&(i.dom.elWrap.addEventListener("mousemove",e.onLegendHovered,!0),i.dom.elWrap.addEventListener("mouseout",e.onLegendHovered,!0)),i.config.chart.accessibility.enabled&&i.config.chart.accessibility.keyboard.enabled&&i.dom.elWrap.addEventListener("keydown",e.onLegendKeyDown.bind(e),!0)}setLegendWrapXY(t,e){const i=this.w,s=i.dom.elLegendWrap,a=s.clientHeight;let r=0,n=0;if("bottom"===i.config.legend.position)n=i.globals.svgHeight-Math.min(a,i.globals.svgHeight/2)-5;else if("top"===i.config.legend.position){const t=new ii(this.w,this.ctx),e=t.dimHelpers.getTitleSubtitleCoords("title").height,i=t.dimHelpers.getTitleSubtitleCoords("subtitle").height;n=(e>0?e-10:0)+(i>0?i-10:0)}s.style.position="absolute",r=r+t+i.config.legend.offsetX,n=n+e+i.config.legend.offsetY,s.style.left=r+"px",s.style.top=n+"px","right"===i.config.legend.position&&(s.style.left="auto",s.style.right=25+i.config.legend.offsetX+"px");["width","height"].forEach(t=>{s&&s.style[t]&&(s.style[t]=parseInt(String(i.config.legend[t]),10)+"px")})}legendAlignHorizontal(){const t=this.w;t.dom.elLegendWrap.style.right="0";const e=new ii(this.w,this.ctx),i=e.dimHelpers.getTitleSubtitleCoords("title"),s=e.dimHelpers.getTitleSubtitleCoords("subtitle");let a=0;"top"===t.config.legend.position&&(a=i.height+s.height+t.config.title.margin+t.config.subtitle.margin-10),this.setLegendWrapXY(20,a)}legendAlignVertical(){const t=this.w,e=this.legendHelpers.getLegendDimensions();let i=0;"left"===t.config.legend.position&&(i=20),"right"===t.config.legend.position&&(i=t.globals.svgWidth-e.clww-10),this.setLegendWrapXY(i,20)}onLegendHovered(t){var e;const i=this.w,s=t.target,a=s.classList.contains("apexcharts-legend-series")||s.classList.contains("apexcharts-legend-text")||s.classList.contains("apexcharts-legend-marker");if("heatmap"===i.config.chart.type||this.isBarsDistributed){if(a){const i=parseInt(null!=(e=s.getAttribute("rel"))?e:"0",10)-1;this.ctx.events.fireEvent("legendHover",[this.ctx,i,this.w]);const a=new Be(this.ctx.w);"mousemove"===t.type?a.highlightRangeInSeries(i,"highlight"):"mouseout"===t.type&&a.highlightRangeInSeries(i,"reset")}}else if(!s.classList.contains("apexcharts-inactive-legend")&&a){new Be(this.ctx.w).toggleSeriesOnHover(t,s)}}onLegendKeyDown(t){const e=this,i=this.w,s=t.target;if((s.classList.contains("apexcharts-legend-series")||s.classList.contains("apexcharts-legend-text")||s.classList.contains("apexcharts-legend-marker"))&&("Enter"===t.key||" "===t.key)){t.preventDefault();const a=s.getAttribute("rel");e.onLegendClick(t),null!==a&&i.config.legend.onItemClick.toggleDataSeries&&requestAnimationFrame(()=>{const t=i.dom.baseEl.querySelector(`.apexcharts-legend-series[rel="${a}"]`);t&&t.focus()})}}onLegendClick(t){var e;const i=this.w,s=t.target;if(!i.config.legend.customLegendItems.length&&(s.classList.contains("apexcharts-legend-series")||s.classList.contains("apexcharts-legend-text")||s.classList.contains("apexcharts-legend-marker"))){const t=parseInt(null!=(e=s.getAttribute("rel"))?e:"0",10)-1,a="true"===s.getAttribute("data:collapsed"),r=this.w.config.chart.events.legendClick;"function"==typeof r&&r(this.ctx,t,this.w),this.ctx.events.fireEvent("legendClick",[this.ctx,t,this.w]);const n=this.w.config.legend.markers.onClick;"function"==typeof n&&s.classList.contains("apexcharts-legend-marker")&&(n(this.ctx,t,this.w),this.ctx.events.fireEvent("legendMarkerClick",[this.ctx,t,this.w]));"treemap"!==i.config.chart.type&&"heatmap"!==i.config.chart.type&&!this.isBarsDistributed&&i.config.legend.onItemClick.toggleDataSeries&&this.legendHelpers.toggleDataSeries(t,a)}}}});class pa{constructor(t,e){this.w=t,this.ctx=e,this.ev=this.w.config.chart.events,this.selectedClass="apexcharts-selected",this.localeValues=this.w.globals.locale.toolbar,this.minX=t.globals.minX,this.maxX=t.globals.maxX,this.elZoom=null,this.elZoomIn=null,this.elZoomOut=null,this.elPan=null,this.elSelection=null,this.elMeasure=null,this.elZoomReset=null,this.elMenuIcon=null,this.elMenu=null,this.elMenuItems=[],this.t=null}createToolbar(){var t,e;const i=this.w,s=()=>b.createElementNS("http://www.w3.org/1999/xhtml","div"),a=()=>{const t=b.createElementNS("http://www.w3.org/1999/xhtml","button");return t.setAttribute("type","button"),t},r=s();if(r.setAttribute("class","apexcharts-toolbar"),r.style.top=i.config.chart.toolbar.offsetY+"px",r.style.right=3-i.config.chart.toolbar.offsetX+"px",i.dom.elWrap.appendChild(r),this.elZoom=a(),this.elZoomIn=a(),this.elZoomOut=a(),this.elPan=a(),this.elSelection=a(),this.elMeasure=a(),this.elZoomReset=a(),this.elMenuIcon=a(),this.elMenu=s(),this.elCustomIcons=[],this.t=i.config.chart.toolbar.tools,Array.isArray(this.t.customIcons))for(let t=0;t<this.t.customIcons.length;t++)this.elCustomIcons.push(a());const n=[],o=(t,e,s)=>{const a=t.toLowerCase();this.t[a]&&i.config.chart.zoom.enabled&&n.push({el:e,icon:"string"==typeof this.t[a]?this.t[a]:s,title:this.localeValues[t],class:`apexcharts-${a}-icon`})};o("zoomIn",this.elZoomIn,'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n    <path d="M12 5v14M5 12h14"/>\n</svg>\n'),o("zoomOut",this.elZoomOut,'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n    <path d="M5 12h14"/>\n</svg>\n');const l=t=>{this.t[t]&&i.config.chart[t].enabled&&n.push({el:"zoom"===t?this.elZoom:this.elSelection,icon:"string"==typeof this.t[t]?this.t[t]:"zoom"===t?'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n    <circle cx="11" cy="11" r="7"/>\n    <path d="m21 21-4.3-4.3M8 11h6M11 8v6"/>\n</svg>\n':'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n    <path d="M5 3a2 2 0 0 0-2 2"/>\n    <path d="M19 3a2 2 0 0 1 2 2"/>\n    <path d="M21 19a2 2 0 0 1-2 2"/>\n    <path d="M5 21a2 2 0 0 1-2-2"/>\n    <path d="M9 3h1M14 3h1M9 21h1M14 21h1M3 9v1M3 14v1M21 9v1M21 14v1"/>\n</svg>\n',title:this.localeValues["zoom"===t?"selectionZoom":"selection"],class:`apexcharts-${t}-icon`})};l("zoom"),l("selection"),this.t.pan&&i.config.chart.zoom.enabled&&n.push({el:this.elPan,icon:"string"==typeof this.t.pan?this.t.pan:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n    <path d="M5 9 2 12l3 3"/>\n    <path d="M9 5l3-3 3 3"/>\n    <path d="M15 19l-3 3-3-3"/>\n    <path d="M19 9l3 3-3 3"/>\n    <path d="M2 12h20"/>\n    <path d="M12 2v20"/>\n</svg>\n',title:this.localeValues.pan,class:"apexcharts-pan-icon"}),this.t.measure&&i.config.chart.measure&&i.config.chart.measure.enabled&&n.push({el:this.elMeasure,icon:"string"==typeof this.t.measure?this.t.measure:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n    <path d="M21.3 15.3a2.4 2.4 0 0 1 0 3.4l-2.6 2.6a2.4 2.4 0 0 1-3.4 0L2.7 8.7a2.4 2.4 0 0 1 0-3.4l2.6-2.6a2.4 2.4 0 0 1 3.4 0Z"/>\n    <path d="m14.5 12.5 2-2"/>\n    <path d="m11.5 9.5 2-2"/>\n    <path d="m8.5 6.5 2-2"/>\n    <path d="m17.5 15.5 2-2"/>\n</svg>\n',title:this.localeValues.measure||"Measure",class:"apexcharts-measure-icon"}),o("reset",this.elZoomReset,'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n    <path d="M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"/>\n    <path d="M3 3v5h5"/>\n</svg>\n'),this.t.download&&n.push({el:this.elMenuIcon,icon:"string"==typeof this.t.download?this.t.download:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n    <path d="M4 6h16M4 12h16M4 18h16"/>\n</svg>\n',title:this.localeValues.menu,class:"apexcharts-menu-icon"});for(let t=0;t<this.elCustomIcons.length;t++)n.push({el:this.elCustomIcons[t],icon:this.t.customIcons[t].icon,title:this.t.customIcons[t].title,index:this.t.customIcons[t].index,class:"apexcharts-toolbar-custom-icon "+this.t.customIcons[t].class});n.forEach((t,e)=>{t.index&&v.moveIndexInArray(n,e,t.index)});for(let t=0;t<n.length;t++)Dt.setAttrs(n[t].el,{class:n[t].class,title:n[t].title,"aria-label":n[t].title}),n[t].el.innerHTML=n[t].icon,r.appendChild(n[t].el);this.elZoom.parentNode&&this.elZoom.setAttribute("aria-pressed",String(!!i.interact.zoomEnabled)),this.elSelection.parentNode&&this.elSelection.setAttribute("aria-pressed",String(!!i.interact.selectionEnabled)),this.elPan.parentNode&&this.elPan.setAttribute("aria-pressed",String(!!i.interact.panEnabled)),this.elMeasure.parentNode&&this.elMeasure.setAttribute("aria-pressed",String(!!i.interact.measureEnabled)),this.elMenuIcon.parentNode&&(this.elMenuIcon.setAttribute("aria-haspopup","true"),this.elMenuIcon.setAttribute("aria-expanded","false")),this._createHamburgerMenu(r),i.interact.zoomEnabled?this.elZoom.classList.add(this.selectedClass):i.interact.panEnabled?this.elPan.classList.add(this.selectedClass):i.interact.selectionEnabled?this.elSelection.classList.add(this.selectedClass):i.interact.measureEnabled&&this.elMeasure&&(this.elMeasure.classList.add(this.selectedClass),null==(e=null==(t=this.ctx.measure)?void 0:t.startMeasure)||e.call(t)),this.addToolbarEventListeners()}_createHamburgerMenu(t){this.elMenuItems=[],t.appendChild(this.elMenu),Dt.setAttrs(this.elMenu,{class:"apexcharts-menu",role:"menu"});const e=[{name:"exportSVG",title:this.localeValues.exportToSVG},{name:"exportPNG",title:this.localeValues.exportToPNG},{name:"exportCSV",title:this.localeValues.exportToCSV}];for(let t=0;t<e.length;t++)this.elMenuItems.push(b.createElementNS("http://www.w3.org/1999/xhtml","div")),this.elMenuItems[t].innerHTML=e[t].title,Dt.setAttrs(this.elMenuItems[t],{class:`apexcharts-menu-item ${e[t].name}`,title:e[t].title,role:"menuitem",tabindex:"-1"}),this.elMenu.appendChild(this.elMenuItems[t])}addToolbarEventListeners(){var t,e,i,s,a,r,n,o,l;null==(t=this.elZoomReset)||t.addEventListener("click",this.handleZoomReset.bind(this)),null==(e=this.elSelection)||e.addEventListener("click",this.toggleZoomSelection.bind(this,"selection")),null==(i=this.elZoom)||i.addEventListener("click",this.toggleZoomSelection.bind(this,"zoom")),null==(s=this.elZoomIn)||s.addEventListener("click",this.handleZoomIn.bind(this)),null==(a=this.elZoomOut)||a.addEventListener("click",this.handleZoomOut.bind(this)),null==(r=this.elPan)||r.addEventListener("click",this.togglePanning.bind(this)),null==(n=this.elMeasure)||n.addEventListener("click",this.toggleMeasure.bind(this)),null==(o=this.elMenuIcon)||o.addEventListener("click",this.toggleMenu.bind(this)),this.elMenuItems.forEach(t=>{t.classList.contains("exportSVG")?t.addEventListener("click",this.handleDownload.bind(this,"svg")):t.classList.contains("exportPNG")?t.addEventListener("click",this.handleDownload.bind(this,"png")):t.classList.contains("exportCSV")&&t.addEventListener("click",this.handleDownload.bind(this,"csv"))});for(let t=0;t<this.t.customIcons.length;t++)this.elCustomIcons[t].addEventListener("click",this.t.customIcons[t].click.bind(this,this.ctx,this.ctx.w));[this.elZoomReset,this.elSelection,this.elZoom,this.elZoomIn,this.elZoomOut,this.elPan,this.elMeasure,this.elMenuIcon,...this.elCustomIcons].forEach(t=>{t.addEventListener("keydown",e=>{if("Enter"===e.key||" "===e.key){e.preventDefault();const i=t.className;t.click(),requestAnimationFrame(()=>{const t=this.w.dom.baseEl;if(!t)return;const e=i.split(" ").find(t=>t.startsWith("apexcharts-"));if(!e)return;const s=t.querySelector(`.${e}`);s&&s.focus()})}})}),null==(l=this.elMenuIcon)||l.addEventListener("keydown",t=>{var e;"ArrowDown"!==t.key&&"ArrowUp"!==t.key||(t.preventDefault(),(null==(e=this.elMenu)?void 0:e.classList.contains("apexcharts-menu-open"))||this.toggleMenu(),window.setTimeout(()=>{const e="ArrowDown"===t.key?0:this.elMenuItems.length-1;this.elMenuItems[e]&&this.elMenuItems[e].focus()},20))}),this.elMenuItems.forEach((t,e)=>{t.addEventListener("keydown",i=>{var s;if("ArrowDown"===i.key){i.preventDefault();(this.elMenuItems[e+1]||this.elMenuItems[0]).focus()}else if("ArrowUp"===i.key){i.preventDefault();(this.elMenuItems[e-1]||this.elMenuItems[this.elMenuItems.length-1]).focus()}else"Escape"===i.key||"Tab"===i.key?(this._closeMenu(),null==(s=this.elMenuIcon)||s.focus(),"Tab"===i.key||i.preventDefault()):"Enter"!==i.key&&" "!==i.key||(i.preventDefault(),t.click())})})}toggleZoomSelection(t){this.ctx.getSyncedCharts().forEach(e=>{const i=e.ctx.toolbar,s="selection"===t?"selectionEnabled":"zoomEnabled",a=!!e.w.globals[s];i.toggleOtherControls();const r="selection"===t?i.elSelection:i.elZoom;a||(e.w.globals[s]=!0,r.classList.add(i.selectedClass)),r.setAttribute("aria-pressed",String(!!e.w.globals[s]))})}toggleMeasure(){var t,e,i,s;const a=this.w,r=!a.interact.measureEnabled;this.toggleOtherControls(),r&&(a.interact.measureEnabled=!0,null==(t=this.elMeasure)||t.classList.add(this.selectedClass),null==(i=null==(e=this.ctx.measure)?void 0:e.startMeasure)||i.call(e)),null==(s=this.elMeasure)||s.setAttribute("aria-pressed",String(a.interact.measureEnabled))}getToolbarIconsReference(){const t=this.w;this.elZoom||(this.elZoom=t.dom.baseEl.querySelector(".apexcharts-zoom-icon")),this.elPan||(this.elPan=t.dom.baseEl.querySelector(".apexcharts-pan-icon")),this.elSelection||(this.elSelection=t.dom.baseEl.querySelector(".apexcharts-selection-icon")),this.elMeasure||(this.elMeasure=t.dom.baseEl.querySelector(".apexcharts-measure-icon"))}enableZoomPanFromToolbar(t){this.toggleOtherControls(),"pan"===t?this.w.interact.panEnabled=!0:this.w.interact.zoomEnabled=!0;const e="pan"===t?this.elPan:this.elZoom,i="pan"===t?this.elZoom:this.elPan;e&&e.classList.add(this.selectedClass),i&&i.classList.remove(this.selectedClass)}togglePanning(){this.ctx.getSyncedCharts().forEach(t=>{const e=t.ctx.toolbar,i=!!t.w.interact.panEnabled;e.toggleOtherControls(),i||(t.w.interact.panEnabled=!0,e.elPan.classList.add(e.selectedClass)),e.elPan.setAttribute("aria-pressed",String(!!t.w.interact.panEnabled))})}toggleOtherControls(){var t,e,i;const s=this.w;s.interact.panEnabled=!1,s.interact.zoomEnabled=!1,s.interact.selectionEnabled=!1,s.interact.measureEnabled&&(s.interact.measureEnabled=!1,null==(e=null==(t=this.ctx.measure)?void 0:t.stopMeasure)||e.call(t),null==(i=this.elMeasure)||i.setAttribute("aria-pressed","false")),this.getToolbarIconsReference();[this.elPan,this.elSelection,this.elZoom,this.elMeasure].forEach(t=>{t&&t.classList.remove(this.selectedClass)})}_currentXRange(){const t=this.w;return t.axisFlags.isRangeBar?{minX:t.globals.minY,maxX:t.globals.maxY}:{minX:t.globals.minX,maxX:t.globals.maxX}}handleZoomIn(){const t=this.w,{minX:e,maxX:i}=this._currentXRange();this.minX=e,this.maxX=i;const s=(e+i)/2,a=(e+s)/2,r=(i+s)/2,n=this._getNewMinXMaxX(a,r);t.interact.disableZoomIn||this.zoomUpdateOptions(n.minX,n.maxX)}handleZoomOut(){const t=this.w,{minX:e,maxX:i}=this._currentXRange();if(this.minX=e,this.maxX=i,"datetime"===t.config.xaxis.type&&new Date(e).getUTCFullYear()<1e3)return;const s=(e+i)/2,a=e-(s-e),r=i-(s-i),n=this._getNewMinXMaxX(a,r);t.interact.disableZoomOut||this.zoomUpdateOptions(n.minX,n.maxX)}_getNewMinXMaxX(t,e){const i=this.w.config.xaxis.convertedCatToNumeric;return{minX:i?Math.floor(t):t,maxX:i?Math.floor(e):e}}zoomUpdateOptions(t,e){const i=this.w;if(void 0===t&&void 0===e)return void this.handleZoomReset();if(i.config.xaxis.convertedCatToNumeric&&(t<1&&(t=1,e=i.globals.dataPoints),e-t<2))return;let s={min:t,max:e};const a=this.getBeforeZoomRange(s,void 0);a&&(s=a.xaxis);const r={xaxis:s};if(!i.globals.initialConfig)return;const n=v.clone(i.globals.initialConfig.yaxis);i.config.chart.group||(r.yaxis=n),this.w.interact.zoomed=!0,this.ctx.updateHelpers._updateOptions(r,!1,this.w.config.chart.animations.dynamicAnimation.enabled),this.zoomCallback(s,n)}zoomCallback(t,e){"function"==typeof this.ev.zoomed&&(this.ev.zoomed(this.ctx,{xaxis:t,yaxis:e}),this.ctx.events.fireEvent("zoomed",{xaxis:t,yaxis:e}))}getBeforeZoomRange(t,e){let i=null;return"function"==typeof this.ev.beforeZoom&&(i=this.ev.beforeZoom(this,{xaxis:t,yaxis:e})),i}toggleMenu(){window.setTimeout(()=>{var t,e,i;(null==(t=this.elMenu)?void 0:t.classList.contains("apexcharts-menu-open"))?this._closeMenu():(null==(e=this.elMenu)||e.classList.add("apexcharts-menu-open"),null==(i=this.elMenuIcon)||i.setAttribute("aria-expanded","true"))},0)}_closeMenu(){var t,e;null==(t=this.elMenu)||t.classList.remove("apexcharts-menu-open"),null==(e=this.elMenuIcon)||e.setAttribute("aria-expanded","false")}handleDownload(t){const e=this.w,i=new Qs(this.w,this.ctx);switch(t){case"svg":i.exportToSVG();break;case"png":i.exportToPng();break;case"csv":i.exportToCSV({series:e.config.series,columnDelimiter:e.config.chart.toolbar.export.csv.columnDelimiter})}}handleZoomReset(){this.ctx.getSyncedCharts().forEach(t=>{const e=t.w;if(!e.interact.zoomed)return;if(e.globals.lastXAxis.min=e.globals.initialConfig.xaxis.min,e.globals.lastXAxis.max=e.globals.initialConfig.xaxis.max,t.updateHelpers.revertDefaultAxisMinMax(),"function"==typeof e.config.chart.events.beforeResetZoom){const i=e.config.chart.events.beforeResetZoom(t,e);i&&t.updateHelpers.revertDefaultAxisMinMax(i)}"function"==typeof e.config.chart.events.zoomed&&t.ctx.toolbar.zoomCallback({min:e.config.xaxis.min,max:e.config.xaxis.max});const i=t.ctx.series.emptyCollapsedSeries(v.clone(e.globals.initialSeries));t.updateHelpers._updateSeries(i,e.config.chart.animations.dynamicAnimation.enabled),e.interact.zoomed=!1})}destroy(){this.elZoom=null,this.elZoomIn=null,this.elZoomOut=null,this.elPan=null,this.elSelection=null,this.elMeasure=null,this.elZoomReset=null,this.elMenuIcon=null}}Ks.registerFeatures({toolbar:pa,zoomPanSelection:class extends pa{constructor(t,e){super(t,e),this.w=t,this.ctx=e,this.dragged=!1,this.graphics=new Dt(this.w),this.eventList=["mousedown","mouseleave","mousemove","touchstart","touchmove","mouseup","touchend"],this.clientX=0,this.clientY=0,this.startX=0,this.endX=0,this.dragX=0,this.startY=0,this.endY=0,this.dragY=0,this.moveDirection="none"}init({xyRatios:t}){const e=this.w,i=this;this.xyRatios=t,this.zoomRect=this.graphics.drawRect(0,0,0,0),this.selectionRect=this.graphics.drawRect(0,0,0,0),this.constraints=new V(0,0,e.layout.gridWidth,e.layout.gridHeight),this.zoomRect.node.classList.add("apexcharts-zoom-rect"),this.selectionRect.node.classList.add("apexcharts-selection-rect"),e.dom.Paper.add(this.zoomRect),e.dom.Paper.add(this.selectionRect),"x"===e.config.chart.selection.type?this.slDraggableRect=this.selectionRect.draggable({minX:0,minY:0,maxX:e.layout.gridWidth,maxY:e.layout.gridHeight}).on("dragmove.namespace",this.selectionDragging.bind(this,"dragging")):"y"===e.config.chart.selection.type?this.slDraggableRect=this.selectionRect.draggable({minX:0,maxX:e.layout.gridWidth}).on("dragmove.namespace",this.selectionDragging.bind(this,"dragging")):this.slDraggableRect=this.selectionRect.draggable().on("dragmove.namespace",this.selectionDragging.bind(this,"dragging")),this.preselectedSelection(),this.hoverArea=e.dom.baseEl.querySelector(`${e.globals.chartClass} .apexcharts-svg`),this.hoverArea&&(this.hoverArea.classList.add("apexcharts-zoomable"),this.eventList.forEach(e=>{var s;null==(s=this.hoverArea)||s.addEventListener(e,i.svgMouseEvents.bind(i,t),{capture:!1,passive:!0})}),this._wheelZoomEnabled()&&this.hoverArea.addEventListener("wheel",i.mouseWheelEvent.bind(i),{capture:!1,passive:!1}),this._momentumEnabled()&&["touchstart","touchmove","touchend","touchcancel"].forEach(t=>{var e;null==(e=this.hoverArea)||e.addEventListener(t,i.momentumTouch.bind(i),{capture:!1,passive:!1})}))}destroy(){this.slDraggableRect&&(this.slDraggableRect.draggable(!1),this.slDraggableRect.off(),this.selectionRect.off()),this.selectionRect=null,this.zoomRect=null}svgMouseEvents(t,e){const i=this.w,s=this.ctx.toolbar;if(i.interact.momentum&&i.interact.momentum.busy)return;if(this._momentumEnabled()&&e.touches&&e.touches.length>1)return;const a=i.interact.zoomEnabled?i.config.chart.zoom.type:i.config.chart.selection.type,r=i.config.chart.toolbar.autoSelected;if("measure"!==r&&(e.shiftKey?(i.interact.shiftWasPressed=!0,s.enableZoomPanFromToolbar("pan"===r?"zoom":"pan")):i.interact.shiftWasPressed&&(s.enableZoomPanFromToolbar(r),i.interact.shiftWasPressed=!1)),!e.target)return;const n=e.target.classList;let o;e.target.parentNode&&null!==e.target.parentNode&&(o=e.target.parentNode.classList);if(!(n.contains("apexcharts-legend-marker")||n.contains("apexcharts-legend-text")||o&&o.contains("apexcharts-toolbar"))){if(this.clientX="touchmove"===e.type||"touchstart"===e.type?e.touches[0].clientX:"touchend"===e.type?e.changedTouches[0].clientX:e.clientX,this.clientY="touchmove"===e.type||"touchstart"===e.type?e.touches[0].clientY:"touchend"===e.type?e.changedTouches[0].clientY:e.clientY,"mousedown"===e.type&&1===e.which||"touchstart"===e.type){const t=this._gridRect();if(!t)return;this.startX=this._screenXToPlotPx(this.clientX),this.startY=this.clientY-t.top,this.dragged=!1,this.w.interact.mousedown=!0}("mousemove"===e.type&&1===e.which||"touchmove"===e.type)&&(this.dragged=!0,i.interact.panEnabled?(i.interact.selection=null,this.w.interact.mousedown&&this.panDragging({context:this,zoomtype:a,xyRatios:this.xyRatios})):(this.w.interact.mousedown&&i.interact.zoomEnabled||this.w.interact.mousedown&&i.interact.selectionEnabled)&&(this.selection=this.selectionDrawing({context:this,zoomtype:a}))),"mouseup"!==e.type&&"touchend"!==e.type&&"mouseleave"!==e.type||this.handleMouseUp({zoomtype:a}),this.makeSelectionRectDraggable()}}handleMouseUp({zoomtype:t,isResized:e}){const i=this.w,s=this._gridRect();s&&(this.w.interact.mousedown||e)&&(this.endX=this._screenXToPlotPx(this.clientX),this.endY=this.clientY-s.top,this.dragX=Math.abs(this.endX-this.startX),this.dragY=Math.abs(this.endY-this.startY),(i.interact.zoomEnabled||i.interact.selectionEnabled)&&this.selectionDrawn({context:this,zoomtype:t})),i.interact.zoomEnabled&&this.hideSelectionRect(this.selectionRect),this.dragged=!1,this.w.interact.mousedown=!1}_incidentalZoomEnabled(t){var e,i,s;const a=this.w.config.chart;return!(!a.zoom||!a.zoom.enabled)&&("auto"!==t?!!t:!(!(null==(e=a.toolbar)?void 0:e.show)||!(null==(s=null==(i=a.toolbar)?void 0:i.tools)?void 0:s.reset)))}_wheelZoomEnabled(){const{zoom:t}=this.w.config.chart;return this._incidentalZoomEnabled(t&&t.allowMouseWheelZoom)}_wheel(){const t=this.w.interact;return t.wheel||(t.wheel={factor:1,clientX:0,rafId:null,endTimer:null}),t.wheel}mouseWheelEvent(t){t.preventDefault();const e=this._wheel();let i=t.deltaY;1===t.deltaMode?i*=33:2===t.deltaMode&&(i*=330),e.factor*=Math.pow(2,i/240),e.clientX=t.clientX,null==e.rafId&&(e.rafId=requestAnimationFrame(()=>this._applyWheelZoom())),e.endTimer&&clearTimeout(e.endTimer),e.endTimer=setTimeout(()=>this._endWheelZoom(),150)}_applyWheelZoom(){const t=this.w,e=this._wheel();e.rafId=null;const i=e.factor;if(e.factor=1,1===i||t.globals.isDestroyed)return;const s=this._gridRect();if(!s||!s.width)return;const{min:a,max:r}=this._currentXWindow(),n=r-a,o=Math.min(Math.max((e.clientX-s.left)/s.width,0),1);let l=n*i;const h=this._clampBounds();if(h){const e=t.globals.minXDiff>0&&isFinite(t.globals.minXDiff)?t.globals.minXDiff:0,i=Math.max(2*e,1e-6*(h.max-h.min));l<i&&(l=i),l>h.max-h.min&&(l=h.max-h.min)}let c=a+o*n-o*l,d=c+l;const p=1e-9*n;if(Math.abs(c-a)<p&&Math.abs(d-r)<p)return;if(isNaN(c)||isNaN(d))return;const u=this.getBeforeZoomRange({min:c,max:d},void 0);u&&u.xaxis&&(c=u.xaxis.min,d=u.xaxis.max),this._applyXRange(c,d,!0)}_endWheelZoom(){const t=this.w;if(this._wheel().endTimer=null,t.globals.isDestroyed||!t.interact.zoomed)return;const{min:e,max:i}=this._currentXWindow(),s=t.globals.initialConfig?v.clone(t.globals.initialConfig.yaxis):[],a=this.ctx.toolbar;a&&a.zoomCallback({min:e,max:i},s)}makeSelectionRectDraggable(){const t=this.w;if(!this.selectionRect)return;const e=this.selectionRect.node.getBoundingClientRect();e.width>0&&e.height>0&&(this.selectionRect.select(!1).resize(!1),this.selectionRect.select({createRot:()=>{},updateRot:()=>{},createHandle:(t,e,i,s,a)=>"l"===a||"r"===a?t.circle(8).css({"stroke-width":1,stroke:"#333",fill:"#fff"}):t.circle(0),updateHandle:(t,e)=>t.center(e[0],e[1])}).resize().on("resize",()=>{var e;if(t.interact.selectionEnabled)t.interact.selection={x:parseFloat(this.selectionRect.node.getAttribute("x")),y:parseFloat(this.selectionRect.node.getAttribute("y")),width:parseFloat(this.selectionRect.node.getAttribute("width")),height:parseFloat(this.selectionRect.node.getAttribute("height"))},clearTimeout(null!=(e=this.w.globals.selectionResizeTimer)?e:void 0),this.w.globals.selectionResizeTimer=window.setTimeout(()=>{this._emitSelectionFromRect()},30);else{const e=t.interact.zoomEnabled?t.config.chart.zoom.type:t.config.chart.selection.type;this.handleMouseUp({zoomtype:e,isResized:!0})}}))}preselectedSelection(){const t=this.w,e=this.xyRatios;if(!t.interact.zoomEnabled)if(void 0!==t.interact.selection&&null!==t.interact.selection)this.drawSelectionRect(l(o({},t.interact.selection),{translateX:t.layout.translateX,translateY:t.layout.translateY}));else if(void 0!==t.config.chart.selection.xaxis.min&&void 0!==t.config.chart.selection.xaxis.max){let i=Ri.dataXToPx(t,t.config.chart.selection.xaxis.min),s=Ri.dataXToPx(t,t.config.chart.selection.xaxis.max)-i;t.axisFlags.isRangeBar&&(i=(t.config.chart.selection.xaxis.min-t.globals.yAxisScale[0].niceMin)/e.invertedYRatio,s=(t.config.chart.selection.xaxis.max-t.config.chart.selection.xaxis.min)/e.invertedYRatio);const a={x:i,y:0,width:s,height:t.layout.gridHeight,translateX:t.layout.translateX,translateY:t.layout.translateY,selectionEnabled:!0};this.drawSelectionRect(a),this.makeSelectionRectDraggable(),"function"==typeof t.config.chart.events.selection&&t.config.chart.events.selection(this.ctx,{xaxis:{min:t.config.chart.selection.xaxis.min,max:t.config.chart.selection.xaxis.max},yaxis:{}})}}drawSelectionRect({x:t,y:e,width:i,height:s,translateX:a=0,translateY:r=0}){const n=this.w,o=this.zoomRect,l=this.selectionRect;if(this.dragged||null!==n.interact.selection){const h={transform:"translate("+a+", "+r+")"};n.interact.zoomEnabled&&this.dragged&&(i<0&&(i=1),o.attr({x:t,y:e,width:i,height:s,fill:n.config.chart.zoom.zoomedArea.fill.color,"fill-opacity":n.config.chart.zoom.zoomedArea.fill.opacity,stroke:n.config.chart.zoom.zoomedArea.stroke.color,"stroke-width":n.config.chart.zoom.zoomedArea.stroke.width,"stroke-opacity":n.config.chart.zoom.zoomedArea.stroke.opacity}),Dt.setAttrs(o.node,h)),n.interact.selectionEnabled&&(l.attr({x:t,y:e,width:i>0?i:0,height:s>0?s:0,fill:n.config.chart.selection.fill.color,"fill-opacity":n.config.chart.selection.fill.opacity,stroke:n.config.chart.selection.stroke.color,"stroke-width":n.config.chart.selection.stroke.width,"stroke-dasharray":n.config.chart.selection.stroke.dashArray,"stroke-opacity":n.config.chart.selection.stroke.opacity}),Dt.setAttrs(l.node,h))}}hideSelectionRect(t){t&&t.attr({x:0,y:0,width:0,height:0})}selectionDrawing({context:t,zoomtype:e}){const i=this.w,s=t,a=this._gridRect();if(!a)return;const r=s.startX-1,n=s.startY;let h=!1,c=!1;const d=this._screenXToPlotPx(s.clientX),p=s.clientY-a.top;let u=d-r,g=p-n,f={translateX:i.layout.translateX,translateY:i.layout.translateY};return Math.abs(u+r)>i.layout.gridWidth?u=i.layout.gridWidth-r:d<0&&(u=r),r>d&&(h=!0,u=Math.abs(u)),n>p&&(c=!0,g=Math.abs(g)),f="x"===e?{x:h?r-u:r,y:0,width:u,height:i.layout.gridHeight}:"y"===e?{x:0,y:c?n-g:n,width:i.layout.gridWidth,height:g}:{x:h?r-u:r,y:c?n-g:n,width:u,height:g},f=l(o({},f),{translateX:i.layout.translateX,translateY:i.layout.translateY}),s.drawSelectionRect(f),s.selectionDragging("resizing"),f}selectionDragging(t,e){var i;const s=this.w;if(!e)return;e.preventDefault();const{handler:a,box:r}=e.detail,n=this.constraints;let{x:o,y:l}=r;o<n.x&&(o=n.x),l<n.y&&(l=n.y),r.x2>n.x2&&(o=n.x2-r.w),r.y2>n.y2&&(l=n.y2-r.h),a.move(o,l);const h=this.selectionRect;let c=0;"resizing"===t&&(c=30);const d=t=>parseFloat(h.node.getAttribute(t)),p={x:d("x"),y:d("y"),width:d("width"),height:d("height")};s.interact.selection=p;const u=s.config.chart.link,g=!(!u||!u.enabled&&"function"!=typeof u.dimension);("function"==typeof s.config.chart.events.selection||g)&&s.interact.selectionEnabled&&(clearTimeout(null!=(i=this.w.globals.selectionResizeTimer)?i:void 0),this.w.globals.selectionResizeTimer=window.setTimeout(()=>{this._emitSelectionFromRect()},c))}_emitSelectionFromRect(){var t;const e=this.w;if(!e.interact.selectionEnabled)return;const i=e.config.chart.link,s=!(!i||!i.enabled&&"function"!=typeof i.dimension);if("function"!=typeof e.config.chart.events.selection&&!s)return;const a=this._gridRect();if(!a)return;const r=this.selectionRect.node.getBoundingClientRect(),n=this.xyRatios;let o,l,h,c;const d=this._screenXToPlotPx(r.left),p=this._screenXToPlotPx(r.right);if(e.axisFlags.isRangeBar)o=e.globals.yAxisScale[0].niceMin+d*n.invertedYRatio,l=e.globals.yAxisScale[0].niceMin+p*n.invertedYRatio,h=0,c=1;else{if(!e.globals.xAxisScale)return;o=Ri.pxToDataX(e,d),l=Ri.pxToDataX(e,p),h=e.globals.yAxisScale[0].niceMin+(a.bottom-r.bottom)*n.yRatio[0],c=e.globals.yAxisScale[0].niceMax-(r.top-a.top)*n.yRatio[0]}const u={xaxis:{min:o,max:l},yaxis:{min:h,max:c}};"function"==typeof e.config.chart.events.selection&&e.config.chart.events.selection(this.ctx,u),e.config.chart.brush.enabled&&void 0!==e.config.chart.events.brushScrolled&&e.config.chart.events.brushScrolled(this.ctx,u),null==(t=this.ctx.linkedViews)||t.onSourceSelection(u.xaxis)}selectionDrawn({context:t,zoomtype:e}){var i;const s=this.w,a=t,r=this.xyRatios,n=this.ctx.toolbar,o=s.interact.zoomEnabled?a.zoomRect.node.getBoundingClientRect():a.selectionRect.node.getBoundingClientRect(),l=a._gridRect();if(!l)return;const h=this._screenXToPlotPx(o.left),c=this._screenXToPlotPx(o.right),d=o.top-l.top,p=o.bottom-l.top;let u,g;s.axisFlags.isRangeBar?(u=s.globals.yAxisScale[0].niceMin+h*r.invertedYRatio,g=s.globals.yAxisScale[0].niceMin+c*r.invertedYRatio):(u=Ri.pxToDataX(s,h),g=Ri.pxToDataX(s,c));const f=[],x=[];if(s.config.yaxis.forEach((t,e)=>{const i=s.globals.seriesYAxisMap[e][0],a=s.globals.yAxisScale[e].niceMax-r.yRatio[i]*d,n=s.globals.yAxisScale[e].niceMax-r.yRatio[i]*p;f.push(a),x.push(n)}),a.dragged&&(a.dragX>10||a.dragY>10)&&u!==g)if(s.interact.zoomEnabled){if(!s.globals.initialConfig)return;let t=v.clone(s.globals.initialConfig.yaxis),i=v.clone(s.globals.initialConfig.xaxis);if(s.interact.zoomed=!0,s.config.xaxis.convertedCatToNumeric&&(u=Math.floor(u),g=Math.floor(g),u<1&&(u=1,g=s.globals.dataPoints),g-u<2&&(g=u+1)),"xy"!==e&&"x"!==e||(i={min:u,max:g}),"xy"!==e&&"y"!==e||t.forEach((e,i)=>{t[i].min=x[i],t[i].max=f[i]}),n){const e=n.getBeforeZoomRange(i,t);e&&(i=e.xaxis?e.xaxis:i,t=e.yaxis?e.yaxis:t)}const r={xaxis:i};s.config.chart.group||(r.yaxis=t),a.ctx.updateHelpers._updateOptions(r,!1,a.w.config.chart.animations.dynamicAnimation.enabled),"function"==typeof s.config.chart.events.zoomed&&n.zoomCallback(i,t)}else if(s.interact.selectionEnabled){let t=null,r=null;if(r={min:u,max:g},"xy"===e||"y"===e){const e=v.clone(s.config.yaxis);t=e,e.forEach((t,i)=>{e[i].min=x[i],e[i].max=f[i]})}s.interact.selection=a.selection,"function"==typeof s.config.chart.events.selection&&s.config.chart.events.selection(a.ctx,{xaxis:r,yaxis:t}),null==(i=a.ctx.linkedViews)||i.onSourceSelection(r)}}panDragging({context:t}){var e;const i=this.w,s=t;if(void 0!==i.interact.lastClientPosition.x){const t=i.interact.lastClientPosition.x-s.clientX,a=(null!=(e=i.interact.lastClientPosition.y)?e:0)-s.clientY;Math.abs(t)>Math.abs(a)&&t>0?this.moveDirection="left":Math.abs(t)>Math.abs(a)&&t<0?this.moveDirection="right":Math.abs(a)>Math.abs(t)&&a>0?this.moveDirection="up":Math.abs(a)>Math.abs(t)&&a<0&&(this.moveDirection="down")}i.interact.lastClientPosition={x:s.clientX,y:s.clientY};const a=i.axisFlags.isRangeBar?i.globals.minY:i.globals.minX,r=i.axisFlags.isRangeBar?i.globals.maxY:i.globals.maxX;s.panScrolled(a,r)}panScrolled(t,e){var i,s;const a=this.w,r=this.xyRatios;if(!a.globals.initialConfig)return;const n=v.clone(a.globals.initialConfig.yaxis);let o=r.xRatio,l=a.globals.minX,h=a.globals.maxX;if(a.axisFlags.isRangeBar&&(o=r.invertedYRatio,l=a.globals.minY,h=a.globals.maxY),"left"===this.moveDirection?(t=l+a.layout.gridWidth/15*o,e=h+a.layout.gridWidth/15*o):"right"===this.moveDirection&&(t=l-a.layout.gridWidth/15*o,e=h-a.layout.gridWidth/15*o),!a.axisFlags.isRangeBar){const r=null!=(i=a.globals.dataReducerRawMinX)?i:a.globals.initialMinX,n=null!=(s=a.globals.dataReducerRawMaxX)?s:a.globals.initialMaxX;(t<r||e>n)&&(t=l,e=h)}const c={xaxis:{min:t,max:e}};a.config.chart.group||(c.yaxis=n),this.updateScrolledChart(c,t,e)}updateScrolledChart(t,e,i){const s=this.w;if(this.ctx.updateHelpers._updateOptions(t,!1,!1),"function"==typeof s.config.chart.events.scrolled){const t={xaxis:{min:e,max:i}};s.config.chart.events.scrolled(this.ctx,t),this.ctx.events.fireEvent("scrolled",t)}}_momentumEnabled(){return this._pinchEnabled()||this._panInertiaEnabled()}_pinchEnabled(){return this._incidentalZoomEnabled(this.w.config.chart.zoom.pinch)}_panInertiaEnabled(){const t=this.w.config.chart;return!(!t.pan||!t.pan.inertia)}_m(){const t=this.w.interact;return t.momentum||(t.momentum={busy:!1,pinch:null,panState:null,samples:[],inertiaRAF:null}),t.momentum}_currentXWindow(){const t=this.w;return t.axisFlags.isRangeBar?{min:t.globals.minY,max:t.globals.maxY}:{min:t.globals.minX,max:t.globals.maxX}}_gridRect(){const t=this.w.dom.baseEl,e=t&&t.querySelector(".apexcharts-grid");return e?e.getBoundingClientRect():null}_screenXToPlotPx(t){return Ri.screenXToPlotPx(this.w,t)}_clampBounds(){var t,e;const i=this.w;return i.axisFlags.isRangeBar?null:{min:null!=(t=i.globals.dataReducerRawMinX)?t:i.globals.initialMinX,max:null!=(e=i.globals.dataReducerRawMaxX)?e:i.globals.initialMaxX}}_applyXRange(t,e,i){const s=this.w;if(!s.globals.initialConfig)return!1;const a=this._currentXWindow(),r=i&&e-t>a.max-a.min,n=this._clampBounds();if(n){const i=e-t;t<n.min&&(e=(t=n.min)+i),e>n.max&&(t=(e=n.max)-i),t<n.min&&(t=n.min)}if(s.config.xaxis.convertedCatToNumeric&&(t=Math.floor(t),e=r?Math.ceil(e):Math.floor(e),t<1&&(t=1),n&&e>n.max&&(e=Math.floor(n.max)),e-t<2))return!1;if(!(e>t))return!1;const o={xaxis:{min:t,max:e}};return s.config.chart.group||(o.yaxis=v.clone(s.globals.initialConfig.yaxis)),i&&(s.interact.zoomed=!0),this.ctx.updateHelpers._updateOptions(o,!1,!1),{minX:t,maxX:e}}_cancelInertia(){const t=this._m();null!=t.inertiaRAF&&(cancelAnimationFrame(t.inertiaRAF),t.inertiaRAF=null)}_fireScrolled(){const t=this.w;if("function"!=typeof t.config.chart.events.scrolled)return;const{min:e,max:i}=this._currentXWindow(),s={xaxis:{min:e,max:i}};t.config.chart.events.scrolled(this.ctx,s),this.ctx.events.fireEvent("scrolled",s)}_pushSample(t,e){const i=this._m().samples;for(i.push({x:t,t:e});i.length>6;)i.shift()}momentumTouch(t){const e=this.w,i=this._m(),s=t.type;if("touchstart"===s){this._cancelInertia();const s=this._gridRect();if(!s)return;if(t.touches.length>=2&&this._pinchEnabled())t.preventDefault(),i.busy=!0,i.panState=null,this._beginPinch(t,s);else if(1===t.touches.length&&this._panInertiaEnabled()&&e.interact.panEnabled){i.busy=!0,i.pinch=null;const s=t.touches[0],a=this._currentXWindow(),r=e.layout.gridWidth||1;i.panState={startX:s.clientX,startY:s.clientY,axis:null,minX0:a.min,maxX0:a.max,ratio0:(a.max-a.min)/r},i.samples=[{x:s.clientX,t:t.timeStamp}]}return}"touchmove"!==s?(i.pinch?t.touches.length<2&&this._endPinch():i.panState&&0===t.touches.length&&this._endPan(),0===t.touches.length&&(e.interact.mousedown=!1,this.dragged=!1,null!=i.inertiaRAF||i.pinch||i.panState||(i.busy=!1))):i.pinch&&t.touches.length>=2?(t.preventDefault(),this._movePinch(t)):i.panState&&1===t.touches.length&&this._movePan(t)}_beginPinch(t,e){const i=this.w,s=t.touches[0],a=t.touches[1],r=Math.hypot(a.clientX-s.clientX,a.clientY-s.clientY)||1,n=(s.clientX+a.clientX)/2-e.left-i.globals.barPadForNumericAxis,{min:o,max:l}=this._currentXWindow();this._m().pinch={d0:r,cx0:n,minX0:o,maxX0:l,gridWidth:i.layout.gridWidth||1}}_movePinch(t){const e=this.w,i=this._m().pinch;if(!i)return;const s=this._gridRect();if(!s)return;const a=t.touches[0],r=t.touches[1],n=Math.hypot(r.clientX-a.clientX,r.clientY-a.clientY)||1,o=(a.clientX+r.clientX)/2-s.left-e.globals.barPadForNumericAxis,l=i.maxX0-i.minX0,h=l*(i.d0/n);let c=i.minX0+i.cx0/i.gridWidth*l-o/i.gridWidth*h,d=c+h;const p=this._clampBounds();if(p){const t=e.globals.minXDiff>0&&isFinite(e.globals.minXDiff)?e.globals.minXDiff:0,i=Math.max(2*t,1e-6*(p.max-p.min));if(d-c<i){const t=(c+d)/2;c=t-i/2,d=t+i/2}}this._applyXRange(c,d,!0)}_endPinch(){const t=this.w;this._m().pinch=null;const{min:e,max:i}=this._currentXWindow(),s={min:e,max:i},a=t.globals.initialConfig?v.clone(t.globals.initialConfig.yaxis):[],r=this.ctx.toolbar;r&&r.zoomCallback(s,a)}_movePan(t){const e=this._m(),i=e.panState,s=t.touches[0];if(!i.axis){const a=Math.abs(s.clientX-i.startX),r=Math.abs(s.clientY-i.startY);if(a<6&&r<6)return void this._pushSample(s.clientX,t.timeStamp);if(r>a)return e.busy=!1,void(e.panState=null);i.axis="x"}if("x"!==i.axis)return;t.preventDefault();const a=(s.clientX-i.startX)*i.ratio0;this._pushSample(s.clientX,t.timeStamp),this._applyXRange(i.minX0-a,i.maxX0-a,!1)}_endPan(){const t=this._m(),e=t.panState;t.panState=null;let i=0;const s=t.samples;if(s.length>=2){const t=s[0],e=s[s.length-1],a=e.t-t.t;a>0&&(i=(e.x-t.x)/a)}t.samples=[],e&&"x"===e.axis&&this._panInertiaEnabled()&&Math.abs(i)>.05?this._startInertia(i):(t.busy=!1,this._fireScrolled())}_startInertia(t){const e=this.w,i=this._m(),s=e.config.chart.pan&&e.config.chart.pan.friction,a="number"==typeof s?Math.min(Math.max(s,.5),.999):.92;let r=t,n=null;i.busy=!0;const o=t=>{if(e.globals.isDestroyed)return i.inertiaRAF=null,void(i.busy=!1);if(null==n)return n=t,void(i.inertiaRAF=requestAnimationFrame(o));const s=t-n;if(n=t,r*=Math.pow(a,s/16.6667),Math.abs(r)<.02)return i.inertiaRAF=null,i.busy=!1,void this._fireScrolled();const l=this._currentXWindow(),h=e.layout.gridWidth||1,c=(l.max-l.min)/h,d=r*s*c,p=this._applyXRange(l.min-d,l.max-d,!1),u=this._clampBounds();if(!p||u&&(d>0&&p.minX<=u.min+1e-6*(u.max-u.min)||d<0&&p.maxX>=u.max-1e-6*(u.max-u.min)))return i.inertiaRAF=null,i.busy=!1,void this._fireScrolled();i.inertiaRAF=requestAnimationFrame(o)};i.inertiaRAF=requestAnimationFrame(o)}}});let ua=class{constructor(t){this.w=t.w,this.annoCtx=t}setOrientations(t,e=null){var i,s;const a=this.w;if("vertical"===t.label.orientation){const r=null!==e?e:0,n=a.dom.baseEl.querySelector(`.apexcharts-xaxis-annotations .apexcharts-xaxis-annotation-label[rel='${r}']`);if(null!==n){const e=n.getBBox();n.setAttribute("x",String(parseFloat(null!=(i=n.getAttribute("x"))?i:"0")-e.height+4));const a="top"===t.label.position?e.width:-e.width;n.setAttribute("y",String(parseFloat(null!=(s=n.getAttribute("y"))?s:"0")+a));const{x:r,y:o}=this.annoCtx.graphics.rotateAroundCenter(n);n.setAttribute("transform",`rotate(-90 ${r} ${o})`)}}}addBackgroundToAnno(t,e){const i=this.w;if(!t||!e.label.text||!String(e.label.text).trim())return null;const s=i.dom.baseEl.querySelector(".apexcharts-grid");if(!s)return null;const a=s.getBoundingClientRect(),r=s.getBBox(),n=a.width/r.width||1,o=t.getBoundingClientRect();let{left:l,right:h,top:c,bottom:d}=e.label.style.padding;"vertical"===e.label.orientation&&([c,d,l,h]=[l,h,c,d]);const p=a.left-r.x*n,u=a.top-r.y*n,g=(o.left-p)/n-l,f=(o.top-u)/n-c,x=this.annoCtx.graphics.drawRect(g,f,o.width/n+l+h,o.height/n+c+d,e.label.borderRadius,e.label.style.background,1,e.label.borderWidth,e.label.borderColor,0);return e.id&&x.node.classList.add(e.id),x}annotationsBackground(){const t=this.w,e=(e,i,s)=>{const a=t.dom.baseEl.querySelector(`.apexcharts-${s}-annotations .apexcharts-${s}-annotation-label[rel='${i}']`);if(a){const i=a.parentNode,s=this.addBackgroundToAnno(a,e);if(s){null==i||i.insertBefore(s.node,a);const r=a.getAttribute("x");null!==r&&vt(s,parseFloat(r),t),e.label.mouseEnter&&s.node.addEventListener("mouseenter",e.label.mouseEnter.bind(this,e)),e.label.mouseLeave&&s.node.addEventListener("mouseleave",e.label.mouseLeave.bind(this,e)),e.label.click&&s.node.addEventListener("click",e.label.click.bind(this,e))}}};t.config.annotations.xaxis.forEach((t,i)=>e(t,i,"xaxis")),t.config.annotations.yaxis.forEach((t,i)=>e(t,i,"yaxis")),t.config.annotations.points.forEach((t,i)=>e(t,i,"point"))}usesCategoryX(){const t=this.w;return("category"===t.config.xaxis.type||t.config.xaxis.convertedCatToNumeric)&&!this.annoCtx.invertAxis&&!t.axisFlags.dataFormatXNumeric&&!t.config.chart.sparkline.enabled}hasXDomain(){const t=this.w;return this.annoCtx.invertAxis?v.isNumber(t.globals.minY)&&v.isNumber(t.globals.yRange[0]):this.usesCategoryX()?t.labelData.labels.length>0||t.labelData.categoryLabels.length>0:v.isNumber(t.globals.minX)&&v.isNumber(t.globals.xRange)}getY1Y2(t,e){var i,s,a;const r=this.w,n="y1"===t?e.y:e.y2,o="string"==typeof n&&n.includes("px");let l,h=!1;if(this.annoCtx.invertAxis){const t=r.config.xaxis.convertedCatToNumeric?r.labelData.categoryLabels:r.labelData.labels,s=t.indexOf(n);if(!o&&-1===s)return{yP:0,clipped:!0};const a=r.dom.baseEl.querySelector(`.apexcharts-yaxis-texts-g text:nth-child(${s+1})`);l=a?parseFloat(null!=(i=a.getAttribute("y"))?i:"0"):(r.layout.gridHeight/t.length-1)*(s+1)-r.globals.barHeight,void 0!==e.seriesIndex&&r.globals.barHeight&&(l-=r.globals.barHeight/2*(r.seriesData.series.length-1)-r.globals.barHeight*e.seriesIndex)}else{if(!r.config.yaxis[e.yAxisIndex])return{yP:0,clipped:!0};const t=r.globals.seriesYAxisMap[e.yAxisIndex],i=null!=(s=null==t?void 0:t[0])?s:null;if(null===i&&r.seriesData.series.length)return{yP:0,clipped:!0};const o=null===i?r.globals.minY:r.globals.minYArr[i],c=null===i?r.globals.maxY-r.globals.minY:r.globals.yRange[i],d=r.config.yaxis[e.yAxisIndex].logarithmic&&null!==i?new H(this.w).getLogVal(r.config.yaxis[e.yAxisIndex].logBase,n,i)/r.globals.yLogRatio[i]:(n-o)/(c/r.layout.gridHeight);l=r.layout.gridHeight-Math.min(Math.max(d,0),r.layout.gridHeight),h=d>r.layout.gridHeight||d<0,!e.marker||void 0!==e.y&&null!==e.y||(l=0),(null==(a=r.config.yaxis[e.yAxisIndex])?void 0:a.reversed)&&(l=d)}return o&&(l=parseFloat(n)),{yP:l,clipped:h}}getX1X2(t,e){const i=this.w,s="x1"===t?e.x:e.x2,a=this.annoCtx.invertAxis?i.globals.minY:i.globals.minX,r=this.annoCtx.invertAxis?i.globals.maxY:i.globals.maxX,n=this.annoCtx.invertAxis?i.globals.yRange[0]:i.globals.xRange;let o=!1;const l="string"==typeof s&&s.includes("px"),h=null==s&&e.marker;if(!l&&!h&&!this.hasXDomain())return{x:0,clipped:!0};let c=this.annoCtx.inversedReversedAxis?(r-s)/(n/i.layout.gridWidth):(s-a)/(n/i.layout.gridWidth);return"category"!==i.config.xaxis.type&&!i.config.xaxis.convertedCatToNumeric||this.annoCtx.invertAxis||i.axisFlags.dataFormatXNumeric||i.config.chart.sparkline.enabled||(c=this.getStringX(s)),"string"==typeof s&&s.includes("px")&&(c=parseFloat(s)),null==s&&e.marker&&(c=i.layout.gridWidth),void 0!==e.seriesIndex&&i.globals.barWidth&&!this.annoCtx.invertAxis&&(c-=i.globals.barWidth/2*(i.seriesData.series.length-1)-i.globals.barWidth*e.seriesIndex),"number"!=typeof c&&(c=0,o=!0),parseFloat(c.toFixed(10))>parseFloat(i.layout.gridWidth.toFixed(10))?(c=i.layout.gridWidth,o=!0):c<0&&(c=0,o=!0),{x:c,clipped:o}}getStringX(t){var e;const i=this.w;let s=t;if(i.config.xaxis.convertedCatToNumeric&&i.labelData.categoryLabels.length){const e=String(t);t=i.labelData.categoryLabels.findIndex(t=>String(t)===e)+1}const a=i.labelData.labels.map(t=>Array.isArray(t)?t.join(" "):t).indexOf(t),r=i.dom.baseEl.querySelector(`.apexcharts-xaxis-texts-g text:nth-child(${a+1})`);return r&&(s=parseFloat(null!=(e=r.getAttribute("x"))?e:"0")),s}};class ga{constructor(t){this.w=t.w,this.annoCtx=t,this.invertAxis=this.annoCtx.invertAxis,this.helpers=new ua(this.annoCtx)}addXaxisAnnotation(t,e,i){const s=this.w,a=this.helpers.getX1X2("x1",t);let r=a.x;const n=a.clipped;let o,l=!0;const h=t.label.text,c=t.strokeDashArray;if(v.isNumber(r)){if(null===t.x2||void 0===t.x2){if(!n){const i=this.annoCtx.graphics.drawLine(r+t.offsetX,0+t.offsetY,r+t.offsetX,s.layout.gridHeight+t.offsetY,t.borderColor,c,t.borderWidth);e.appendChild(i.node),t.id&&i.node.classList.add(t.id),vt(i,r+t.offsetX,s)}}else{const i=this.helpers.getX1X2("x2",t);if(o=i.x,l=i.clipped,o<r){const t=r;r=o,o=t}const a=this.annoCtx.graphics.drawRect(r+t.offsetX,0+t.offsetY,o-r,s.layout.gridHeight+t.offsetY,0,t.fillColor,t.opacity,1,t.borderColor,c);a.node.classList.add("apexcharts-annotation-rect"),a.attr("clip-path",`url(#gridRectMask${s.globals.cuid})`),e.appendChild(a.node),t.id&&a.node.classList.add(t.id),vt(a,r+t.offsetX,s)}if(!n||!l){const a=this.annoCtx.graphics.getTextRects(h,t.label.style.fontSize),n="top"===t.label.position?4:"center"===t.label.position?s.layout.gridHeight/2+("vertical"===t.label.orientation?a.width/2:0):s.layout.gridHeight,o=this.annoCtx.graphics.drawText({x:r+t.label.offsetX,y:n+t.label.offsetY-("vertical"===t.label.orientation?"top"===t.label.position?a.width/2-12:-a.width/2:0),text:h,textAnchor:t.label.textAnchor,fontSize:t.label.style.fontSize,fontFamily:t.label.style.fontFamily,fontWeight:t.label.style.fontWeight,foreColor:t.label.style.color,cssClass:`apexcharts-xaxis-annotation-label ${t.label.style.cssClass} ${t.id?t.id:""}`});o.attr({rel:i}),e.appendChild(o.node),vt(o,r+t.label.offsetX,s),this.annoCtx.helpers.setOrientations(t,i)}}}drawXAxisAnnotations(){const t=this.w,e=this.annoCtx.graphics.group({class:"apexcharts-xaxis-annotations"});return t.config.annotations.xaxis.map((t,i)=>{this.addXaxisAnnotation(t,e.node,i)}),e}}class fa{constructor(t){this.w=t.w,this.annoCtx=t,this.helpers=new ua(this.annoCtx),this.axesUtils=new Bt(this.annoCtx.w,{theme:this.annoCtx.theme,timeScale:this.annoCtx.timeScale})}addYaxisAnnotation(t,e,i){const s=this.w,a=t.strokeDashArray;let r=this.helpers.getY1Y2("y1",t),n=r.yP;const o=r.clipped;let l,h=!0,c=!1;const d=t.label.text;if(null===t.y2||void 0===t.y2){if(!o){c=!0;const i=this.annoCtx.graphics.drawLine(0+t.offsetX,n+t.offsetY,this._getYAxisAnnotationWidth(t),n+t.offsetY,t.borderColor,a,t.borderWidth);e.appendChild(i.node),t.id&&i.node.classList.add(t.id)}}else{if(r=this.helpers.getY1Y2("y2",t),l=r.yP,h=r.clipped,l>n){const t=n;n=l,l=t}if(!o||!h){c=!0;const i=this.annoCtx.graphics.drawRect(0+t.offsetX,l+t.offsetY,this._getYAxisAnnotationWidth(t),n-l,0,t.fillColor,t.opacity,1,t.borderColor,a);i.node.classList.add("apexcharts-annotation-rect"),i.attr("clip-path",`url(#gridRectMask${s.globals.cuid})`),e.appendChild(i.node),t.id&&i.node.classList.add(t.id)}}if(c){const a="right"===t.label.position?s.layout.gridWidth:"center"===t.label.position?s.layout.gridWidth/2:0,r=this.annoCtx.graphics.drawText({x:a+t.label.offsetX,y:(null!=l?l:n)+t.label.offsetY-3,text:d,textAnchor:t.label.textAnchor,fontSize:t.label.style.fontSize,fontFamily:t.label.style.fontFamily,fontWeight:t.label.style.fontWeight,foreColor:t.label.style.color,cssClass:`apexcharts-yaxis-annotation-label ${t.label.style.cssClass} ${t.id?t.id:""}`});r.attr({rel:i}),e.appendChild(r.node)}}_getYAxisAnnotationWidth(t){const e=this.w;let i=e.layout.gridWidth;return i=t.width.indexOf("%")>-1?e.layout.gridWidth*parseInt(t.width,10)/100:parseInt(t.width,10),i+t.offsetX}drawYAxisAnnotations(){const t=this.w,e=this.annoCtx.graphics.group({class:"apexcharts-yaxis-annotations"});return t.config.annotations.yaxis.forEach((t,i)=>{t.yAxisIndex=this.axesUtils.translateYAxisIndex(t.yAxisIndex),this.axesUtils.isYAxisHidden(t.yAxisIndex)&&this.axesUtils.yAxisAllSeriesCollapsed(t.yAxisIndex)||this.addYaxisAnnotation(t,e.node,i)}),e}}class xa{constructor(t){this.w=t.w,this.annoCtx=t,this.helpers=new ua(this.annoCtx)}addPointAnnotation(t,e,i){const s=this.w;if(s.globals.collapsedSeriesIndices.indexOf(t.seriesIndex)>-1)return;const a=this.helpers.getX1X2("x1",t),r=a.x,n=a.clipped,o=this.helpers.getY1Y2("y1",t),l=o.yP,h=o.clipped;if(v.isNumber(r)&&!h&&!n){const a={pSize:t.marker.size,pointStrokeWidth:t.marker.strokeWidth,pointFillColor:t.marker.fillColor,pointStrokeColor:t.marker.strokeColor,shape:t.marker.shape,pRadius:t.marker.radius,class:`apexcharts-point-annotation-marker ${t.marker.cssClass} ${t.id?t.id:""}`};let n=this.annoCtx.graphics.drawMarker(r+t.marker.offsetX,l+t.marker.offsetY,a);e.appendChild(n.node);const o=[n.node];vt(n,r,s);const h=t.label.text?t.label.text:"",c=this.annoCtx.graphics.drawText({x:r+t.label.offsetX,y:l+t.label.offsetY-t.marker.size-parseFloat(t.label.style.fontSize)/1.6,text:h,textAnchor:t.label.textAnchor,fontSize:t.label.style.fontSize,fontFamily:t.label.style.fontFamily,fontWeight:t.label.style.fontWeight,foreColor:t.label.style.color,cssClass:`apexcharts-point-annotation-label ${t.label.style.cssClass} ${t.id?t.id:""}`});if(c.attr({rel:i}),e.appendChild(c.node),vt(c,r,s),t.customSVG.SVG){const i=this.annoCtx.graphics.group({class:"apexcharts-point-annotations-custom-svg "+t.customSVG.cssClass});i.attr({transform:`translate(${r+t.customSVG.offsetX}, ${l+t.customSVG.offsetY})`}),i.node.innerHTML=t.customSVG.SVG,e.appendChild(i.node),o.push(i.node)}if(t.image.path){const e=t.image.width?t.image.width:20,i=t.image.height?t.image.height:20;n=this.annoCtx.addImage({x:r+t.image.offsetX-e/2,y:l+t.image.offsetY-i/2,width:e,height:i,path:t.image.path,appendTo:".apexcharts-point-annotations"}),o.push(n.node)}t.tooltip&&t.tooltip.enabled&&o.forEach(e=>{e.addEventListener("mouseenter",()=>{this.showPointTooltip(t,e)}),e.addEventListener("mouseleave",()=>{this.hidePointTooltip()})}),t.mouseEnter&&n.node.addEventListener("mouseenter",t.mouseEnter.bind(this,t)),t.mouseLeave&&n.node.addEventListener("mouseleave",t.mouseLeave.bind(this,t)),t.click&&n.node.addEventListener("click",t.click.bind(this,t))}}getPointTooltipEl(){const t=this.w;let e=t.dom.elWrap.querySelector(".apexcharts-annotation-tooltip");return e||(e=b.createElementNS("http://www.w3.org/1999/xhtml","div"),e.classList.add("apexcharts-tooltip","apexcharts-annotation-tooltip"),t.dom.elWrap.appendChild(e)),e}getPointTooltipContent(t){const e=this.w,i=t.tooltip||{};if("function"==typeof i.formatter)return i.formatter({annotation:t,seriesIndex:t.seriesIndex,id:t.id,w:e});let s=null!=i.text?i.text:t.label&&t.label.text;return Array.isArray(s)&&(s=s.join("<br/>")),null==s?"":String(s)}showPointTooltip(t,e){const i=this.w,s=this.getPointTooltipContent(t);if(!s)return;const a=this.getPointTooltipEl();a.innerHTML=s;const r=t.tooltip.theme||i.config.tooltip.theme||"light";a.classList.remove("apexcharts-theme-light","apexcharts-theme-dark"),a.classList.add(`apexcharts-theme-${r}`),a.classList.add("apexcharts-active");const n=i.dom.elWrap.getBoundingClientRect(),o=e.getBoundingClientRect(),l=a.getBoundingClientRect(),h=t.tooltip.offsetX||0,c=t.tooltip.offsetY||0;let d=o.left-n.left+o.width/2-l.width/2,p=o.top-n.top-l.height-10;d=Math.max(0,Math.min(d,n.width-l.width)),p<0&&(p=o.top-n.top+o.height+10),a.style.left=d+h+"px",a.style.top=p+c+"px"}hidePointTooltip(){const t=this.w.dom.elWrap.querySelector(".apexcharts-annotation-tooltip");t&&t.classList.remove("apexcharts-active")}drawPointAnnotations(){const t=this.w,e=this.annoCtx.graphics.group({class:"apexcharts-point-annotations"});return t.config.annotations.points.map((t,i)=>{this.addPointAnnotation(t,e.node,i)}),e}}Ks.registerFeatures({annotations:class{constructor(t,{theme:e=null,timeScale:i=null}={}){this.w=t,this.theme=e,this.timeScale=i,this.invertAxis=void 0,this.inversedReversedAxis=void 0,this.graphics=new Dt(this.w),this.w.globals.isBarHorizontal&&(this.invertAxis=!0),this.helpers=new ua(this),this.xAxisAnnotations=new ga(this),this.yAxisAnnotations=new fa(this),this.pointsAnnotations=new xa(this),this.w.globals.isBarHorizontal&&this.w.config.yaxis[0].reversed&&(this.inversedReversedAxis=!0),this.xDivision=this.w.layout.gridWidth/this.w.globals.dataPoints}drawAxesAnnotations(){const t=this.w;if(t.globals.axisCharts){const e=this.yAxisAnnotations.drawYAxisAnnotations(),i=this.xAxisAnnotations.drawXAxisAnnotations(),s=this.pointsAnnotations.drawPointAnnotations(),a=t.config.chart.animations.enabled,r=[e,i,s],n=[i.node,e.node,s.node],o="line"===t.config.chart.type||"area"===t.config.chart.type||"rangeArea"===t.config.chart.type,l=[o,!1,o];for(let e=0;e<3;e++)t.dom.elGraphical.add(r[e]),!a||t.globals.resized||t.globals.dataChanged||"scatter"!==t.config.chart.type&&"bubble"!==t.config.chart.type&&t.globals.dataPoints>1&&!l[e]&&n[e].classList.add("apexcharts-element-hidden"),t.globals.delayedElements.push({el:n[e],index:0});this.helpers.annotationsBackground()}}drawImageAnnos(){this.w.config.annotations.images.map(t=>{this.addImage(t)})}drawTextAnnos(){this.w.config.annotations.texts.map(t=>{this.addText(t)})}addXaxisAnnotation(t,e,i){this.xAxisAnnotations.addXaxisAnnotation(t,e,i)}addYaxisAnnotation(t,e,i){this.yAxisAnnotations.addYaxisAnnotation(t,e,i)}addPointAnnotation(t,e,i){this.pointsAnnotations.addPointAnnotation(t,e,i)}addText(t){const{x:e,y:i,text:s,textAnchor:a,foreColor:r,fontSize:n,fontFamily:o,fontWeight:l,cssClass:h,backgroundColor:c,borderWidth:d,strokeDashArray:p,borderRadius:u,borderColor:g,appendTo:f=".apexcharts-svg",paddingLeft:x=4,paddingRight:m=4,paddingBottom:b=2,paddingTop:y=2}=t,w=this.w,v=this.graphics.drawText({x:e,y:i,text:s,textAnchor:a||"start",fontSize:n||"12px",fontWeight:l||"regular",fontFamily:o||w.config.chart.fontFamily,foreColor:r||w.config.chart.foreColor,cssClass:h}),A=w.dom.baseEl.querySelector(f);A&&A.appendChild(v.node);const S=v.bbox();if(s){const t=this.graphics.drawRect(S.x-x,S.y-y,S.width+x+m,S.height+b+y,u,c||"transparent",1,d,g,p);A.insertBefore(t.node,v.node)}}addImage(t){const e=this.w,{path:i,x:s=0,y:a=0,width:r=20,height:n=20,appendTo:o=".apexcharts-svg"}=t,l=e.dom.Paper.image(i);l.size(r,n).move(s,a);const h=e.dom.baseEl.querySelector(o);return h&&h.appendChild(l.node),l}addXaxisAnnotationExternal(t,e,i){return this.addAnnotationExternal({params:t,pushToMemory:e,context:i,type:"xaxis",contextMethod:i.addXaxisAnnotation}),i}addYaxisAnnotationExternal(t,e,i){return this.addAnnotationExternal({params:t,pushToMemory:e,context:i,type:"yaxis",contextMethod:i.addYaxisAnnotation}),i}addPointAnnotationExternal(t,e,i){return void 0===this.invertAxis&&(this.invertAxis=i.w.globals.isBarHorizontal),this.addAnnotationExternal({params:t,pushToMemory:e,context:i,type:"point",contextMethod:i.addPointAnnotation}),i}addAnnotationExternal({params:t,pushToMemory:e,context:i,type:s,contextMethod:a}){const r=i,n=r.w,o=n.dom.baseEl.querySelector(`.apexcharts-${s}-annotations`),l=o.childNodes.length+1,h=new k,c=Object.assign({},"xaxis"===s?h.xAxisAnnotation:"yaxis"===s?h.yAxisAnnotation:h.pointAnnotation),d=v.extend(c,t);switch(s){case"xaxis":this.addXaxisAnnotation(d,o,l);break;case"yaxis":this.addYaxisAnnotation(d,o,l);break;case"point":this.addPointAnnotation(d,o,l)}const p=n.dom.baseEl.querySelector(`.apexcharts-${s}-annotations .apexcharts-${s}-annotation-label[rel='${l}']`),u=this.helpers.addBackgroundToAnno(p,d);return u&&o.insertBefore(u.node,p),e&&n.globals.memory.methodsToExec.push({context:r,id:d.id?d.id:v.randomId(),method:a,label:"addAnnotation",params:t}),i}_removeAnnotationTooltip(t){const e=t.dom.elWrap&&t.dom.elWrap.querySelector(".apexcharts-annotation-tooltip");e&&e.parentNode&&e.parentNode.removeChild(e)}clearAnnotations(t){const e=t.w;this._removeAnnotationTooltip(e);const i=e.dom.baseEl.querySelectorAll(".apexcharts-yaxis-annotations, .apexcharts-xaxis-annotations, .apexcharts-point-annotations");for(let t=e.globals.memory.methodsToExec.length-1;t>=0;t--)"addText"!==e.globals.memory.methodsToExec[t].label&&"addAnnotation"!==e.globals.memory.methodsToExec[t].label||e.globals.memory.methodsToExec.splice(t,1);Array.prototype.forEach.call(i,t=>{for(;t.firstChild;)t.removeChild(t.firstChild)})}removeAnnotation(t,e){const i=t.w;this._removeAnnotationTooltip(i);const s=i.dom.baseEl.querySelectorAll(`.${e}`);s&&(i.globals.memory.methodsToExec.map((t,s)=>{t.id===e&&i.globals.memory.methodsToExec.splice(s,1)}),Object.keys(i.config.annotations).forEach(t=>{const s=i.config.annotations[t];Array.isArray(s)&&(i.config.annotations[t]=s.filter(t=>t.id!==e))}),Array.prototype.forEach.call(s,t=>{t.parentElement.removeChild(t)}))}}});function ma(t,e){if(!(e>0))return[];if(1===e)return[o({},t)];const i=t.width>=t.height,s=i?t.width:t.height,a=i?t.height:t.width,r=a>0?s/a:e;let n=Math.max(1,Math.ceil(Math.sqrt(r*e)));n>e&&(n=e);const l=Math.floor(e/n);let h=e-l*n;const c=[],d=s/n;let p=0;for(let e=0;e<n;e++){const e=l+(h>0?1:0);h>0&&h--;const s=e>0?a/e:0;for(let a=0;a<e;a++)c.push(i?{x:t.x+p,y:t.y+a*s,width:d,height:s}:{x:t.x+a*s,y:t.y+p,width:s,height:d});p+=d}return c}function ba(t,e,i){if(!(e>0))return[];const s=t.width>=t.height,a=s?t.width:t.height,r=s?t.height:t.width,n=s?t.y:t.x,o=n+r,l=r>0?a/r:e;let h=Math.max(Math.ceil(Math.sqrt(l*e)),Math.ceil(a/16));h>=1||(h=1),h>e&&(h=e);const c=Math.floor(e/h);let d=e-c*h;const p=[],u=a/h;let g=s?t.x:t.y;for(let t=0;t<h;t++){const t=c+(d>0?1:0);d>0&&d--;const e=[],a=i(g,g+u,s);if(Array.isArray(a))for(let t=0;t<a.length;t++){const i=a[t];if(!i)continue;const s=Math.max(n,Math.min(i[0],i[1])),r=Math.min(o,Math.max(i[0],i[1]));r>s&&e.push([s,r])}e.length||e.push([n,o]);const r=e.reduce((t,e)=>t+(e[1]-e[0]),0),l=e.map(i=>r>0?(i[1]-i[0])/r*t:t/e.length),h=l.map(t=>Math.floor(t));let f=h.reduce((t,e)=>t+e,0);const x=l.map((t,e)=>({i:e,frac:t-Math.floor(t)})).sort((t,e)=>e.frac-t.frac);for(let e=0;f<t;e++,f++)h[x[e%x.length].i]++;for(let t=0;t<e.length;t++){const i=h[t];if(i<=0)continue;const a=e[t][0],r=(e[t][1]-a)/i;for(let t=0;t<i;t++)p.push(s?{x:g,y:a+t*r,width:u,height:r}:{x:a+t*r,y:g,width:r,height:u})}g+=u}return p}function ya(t,e,i,s,a,r){let n=a===i?0:Math.round((t-i)/(a-i)*32767),o=r===s?0:Math.round((e-s)/(r-s)*32767),l=0;for(let t=32768;t>=1;t/=2){const e=(n&t)>0?1:0,i=(o&t)>0?1:0;if(l+=t*t*(3*e^i),0===i){1===e&&(n=t-1-n,o=t-1-o);const i=n;n=o,o=i}}return l}function wa(t,e){let i=1/0,s=1/0,a=-1/0,r=-1/0;const n=t.map(t=>{const[n,o]=e(t);return n<i&&(i=n),n>a&&(a=n),o<s&&(s=o),o>r&&(r=o),[n,o]});return t.map((t,e)=>({item:t,d:ya(n[e][0],n[e][1],i,s,a,r)})).sort((t,e)=>t.d-e.d).map(t=>t.item)}function va(t){if(!t||"string"!=typeof t)return null;const e=t.trim();if("#"===e[0]){const t=e.slice(1);return 3===t.length?[parseInt(t[0]+t[0],16),parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),1]:6===t.length||8===t.length?[parseInt(t.slice(0,2),16),parseInt(t.slice(2,4),16),parseInt(t.slice(4,6),16),8===t.length?parseInt(t.slice(6,8),16)/255:1]:null}const i=e.match(/^rgba?\(([^)]+)\)$/i);if(i){const t=i[1].split(",").map(t=>parseFloat(t));return t.length<3||t.some(t=>!isFinite(t))?null:[t[0],t[1],t[2],t.length>3?t[3]:1]}return null}function Aa(t,e){const i=va(t),s=va(e);return i&&s?t=>{const e=Math.round(i[0]+(s[0]-i[0])*t),a=Math.round(i[1]+(s[1]-i[1])*t),r=Math.round(i[2]+(s[2]-i[2])*t),n=i[3]+(s[3]-i[3])*t;return n>=1?`rgb(${e},${a},${r})`:`rgba(${e},${a},${r},${n})`}:null}function Sa(t){return t<.5?4*t*t*t:1-Math.pow(-2*t+2,3)/2}Ks.registerFeatures({keyboardNavigation:class{constructor(t,e){this.w=t,this.ctx=e,this.seriesIndex=0,this.dataPointIndex=0,this.active=!1,this._tooltipDismissed=!1,this._focusedEl=null,this._hoveredBarEl=null,this._enlargedScatterMarker=null,this._onKeyDown=this._onKeyDown.bind(this),this._onFocus=this._onFocus.bind(this),this._onBlur=this._onBlur.bind(this),this._onLegendClick=this._onLegendClick.bind(this),this._onPointerDown=this._onPointerDown.bind(this),this._lastPointerDownAt=0}init(){const t=this.w.dom.Paper.node;t&&(t.setAttribute("tabindex","0"),t.addEventListener("focus",this._onFocus),t.addEventListener("blur",this._onBlur),t.addEventListener("mousedown",this._onPointerDown,{capture:!0}),t.addEventListener("pointerdown",this._onPointerDown,{capture:!0}),t.addEventListener("touchstart",this._onPointerDown,{capture:!0,passive:!0}),t.addEventListener("keydown",this._onKeyDown,{passive:!1}),this.ctx.events.addEventListener("legendClick",this._onLegendClick))}destroy(){const t=this.w,e=t.dom.Paper&&t.dom.Paper.node;this.ctx.events.removeEventListener("legendClick",this._onLegendClick),e&&(e.removeEventListener("focus",this._onFocus),e.removeEventListener("blur",this._onBlur),e.removeEventListener("keydown",this._onKeyDown),e.removeEventListener("mousedown",this._onPointerDown,{capture:!0}),e.removeEventListener("pointerdown",this._onPointerDown,{capture:!0}),e.removeEventListener("touchstart",this._onPointerDown,{capture:!0}))}_onPointerDown(){this._lastPointerDownAt=Date.now()}handleKey(t){}_onFocus(){this._isNavEnabled()&&(Date.now()-this._lastPointerDownAt<100||(this.active=!0,this._clampCursor(),this._snapToVisibleRange(),this._showCurrentPoint()))}_onBlur(){this.active=!1,this._tooltipDismissed=!1,this._hideFocus()}_onLegendClick(){this.active&&(this.active=!1,this._hideFocus())}_onKeyDown(t){var e,i,s;if(this._isNavEnabled()&&this.active){if(t.shiftKey&&("ArrowRight"===t.key||"ArrowLeft"===t.key)&&this._canPan())return t.preventDefault(),void this._panBy("ArrowRight"===t.key?1:-1);switch(t.key){case"ArrowRight":t.preventDefault(),this._move(0,1);break;case"ArrowLeft":t.preventDefault(),this._move(0,-1);break;case"ArrowUp":t.preventDefault(),this._move(-1,0);break;case"ArrowDown":t.preventDefault(),this._move(1,0);break;case"Home":t.preventDefault(),this.dataPointIndex=0,this._skipNullForward(),this._showCurrentPoint();break;case"End":t.preventDefault(),this.dataPointIndex=this._getDataPointCount(this.seriesIndex)-1,this._skipNullBackward(),this._showCurrentPoint();break;case"Enter":case" ":t.preventDefault(),this._fireClick();break;case"+":case"=":this._canZoom()&&(t.preventDefault(),null==(e=this.ctx.toolbar)||e.handleZoomIn(),this._announce("Zoomed in"));break;case"-":case"_":this._canZoom()&&(t.preventDefault(),null==(i=this.ctx.toolbar)||i.handleZoomOut(),this._announce("Zoomed out"));break;case"0":this._canZoom()&&this.w.interact.zoomed&&(t.preventDefault(),null==(s=this.ctx.toolbar)||s.handleZoomReset(),this._announce("Zoom reset"));break;case"Escape":t.preventDefault(),this._tooltipDismissed?(this.active=!1,this._tooltipDismissed=!1,this._hideFocus()):(this._tooltipDismissed=!0,this._hideFocus())}}}_canZoom(){const t=this.w;return Boolean(t.globals.axisCharts&&t.config.chart.zoom&&t.config.chart.zoom.enabled)}_canPan(){return this._canZoom()}_panBy(t){const e=this.w,i=this.ctx.toolbar;if(!i)return;const s=Number(e.globals.minX),a=Number(e.globals.maxX);if(!isFinite(s)||!isFinite(a)||s===a)return;const r=.1*(a-s)*t;i.zoomUpdateOptions(s+r,a+r),this._announce(t>0?"Panned right":"Panned left")}_move(t,e){const i=this.w,s=i.config.chart.accessibility.keyboard.navigation.wrapAround;if(0!==t){const e=this.w.globals.tooltip;if(e&&e.tConfig&&e.tConfig.shared){const t=this.dataPointIndex;if(e.tooltipUtil&&e.tooltipUtil.isXoverlap(t)&&e.tooltipUtil.isInitialSeriesSameLen())return}const a=this._getSeriesCount();let r=this.seriesIndex+t,n=0;for(;n<a&&(r<0&&(r=s?a-1:0),r>=a&&(r=s?0:a-1),i.globals.collapsedSeriesIndices.includes(r));)r+=t,n++;this.seriesIndex=r;const o=this._getDataPointCount(r);this.dataPointIndex>=o&&(this.dataPointIndex=o-1)}if(0!==e){const t=this._getDataPointCount(this.seriesIndex);let i=this.dataPointIndex+e;i<0&&(i=s?t-1:0),i>=t&&(i=s?0:t-1),this.dataPointIndex=i,e>0?this._skipNullForward():this._skipNullBackward(),this._isDataPointVisible(this.seriesIndex,this.dataPointIndex)||this._snapToVisibleRangeInDirection(e)}this._showCurrentPoint()}_skipNullForward(){const t=this.w,e=this.seriesIndex,i=this._getDataPointCount(e);let s=this.dataPointIndex,a=0;if(Array.isArray(t.seriesData.series[e])){for(;a<i&&null===t.seriesData.series[e][s];)s=(s+1)%i,a++;this.dataPointIndex=s}}_skipNullBackward(){const t=this.w,e=this.seriesIndex,i=this._getDataPointCount(e);let s=this.dataPointIndex,a=0;if(Array.isArray(t.seriesData.series[e])){for(;a<i&&null===t.seriesData.series[e][s];)s=(s-1+i)%i,a++;this.dataPointIndex=s}}_showCurrentPoint(){const{seriesIndex:t,dataPointIndex:e}=this,i=this.w,s=i.globals.tooltip;s&&s.ttItems&&(i.interact.capturedSeriesIndex=t,i.interact.capturedDataPointIndex=e,this._applyFocusClass(t,e),this._showTooltip(t,e,s))}_hideFocus(){const t=this.w,e=t.globals.tooltip;if(this._removeFocusClass(),this._leaveHoveredBar(),!e)return;e.marker&&e.marker.resetPointsSize(),this._enlargedScatterMarker=null;const i=e.getElTooltip();i&&(i.classList.remove("apexcharts-active"),t.config.chart.accessibility.enabled&&t.config.chart.accessibility.announcements.enabled&&i.setAttribute("aria-hidden","true")),t.dom.baseEl.classList.remove("apexcharts-tooltip-active");const s=e.getElXCrosshairs();s&&s.classList.remove("apexcharts-active")}_showTooltip(t,e,i){const s=this.w,a=s.config.chart.type,r=i.getElTooltip();if(!r)return;const n=i.getCachedDimensions();i.tooltipRect={x:0,y:0,ttWidth:n.ttWidth||0,ttHeight:n.ttHeight||0},this._setSyntheticEvent(t,e,i),s.dom.baseEl.classList.add("apexcharts-tooltip-active"),r.classList.add("apexcharts-active"),s.config.chart.accessibility.enabled&&s.config.chart.accessibility.announcements.enabled&&r.removeAttribute("aria-hidden"),"pie"===a||"donut"===a||"polarArea"===a?this._showTooltipNonAxis(t,e,i,r):"radialBar"===a?this._showTooltipRadialBar(t,e,i,r):"heatmap"===a||"treemap"===a?this._showTooltipHeatTree(t,e,i,r,a):"bar"===a||"candlestick"===a||"boxPlot"===a||"violin"===a||"rangeBar"===a?this._showTooltipBar(t,e,i):this._showTooltipAxisLine(t,e,i)}_setSyntheticEvent(t,e,i){const s=this.w,a=s.config.chart.type;let r=0,n=0;const o=this._getFocusableElement(t,e);if(o){const t=o.getBoundingClientRect();r=t.left+t.width/2,n=t.top+t.height/2}else if(s.globals.pointsArray&&s.globals.pointsArray[t]&&s.globals.pointsArray[t][e]){const a=s.globals.pointsArray[t][e],o=i.getElGrid&&i.getElGrid();if(o){const t=o.getBoundingClientRect();r=t.left+(a[0]||0),n=t.top+(a[1]||0)}}else{const t=s.dom.Paper&&s.dom.Paper.node;if(t){const e=t.getBoundingClientRect();r=e.left+e.width/2,n=e.top+e.height/2}}if(("line"===a||"area"===a||"rangeArea"===a||"scatter"===a||"bubble"===a||"radar"===a)&&s.globals.pointsArray&&s.globals.pointsArray[t]&&s.globals.pointsArray[t][e]){const a=s.globals.pointsArray[t][e],o=i.getElGrid&&i.getElGrid();if(o){const t=o.getBoundingClientRect();r=t.left+(a[0]||0),n=t.top+(a[1]||0)}}i.e={type:"mousemove",clientX:r,clientY:n}}_showTooltipBar(t,e,i){var s,a,r,n;const h=this.w,c=i.tConfig.shared&&(i.tooltipUtil.isXoverlap(e)||h.globals.isBarHorizontal)&&i.tooltipUtil.isInitialSeriesSameLen(),d=null==(n=null==(r=null==(a=null==(s=h.rangeData.seriesRange)?void 0:s[t])?void 0:a[e])?void 0:r.y)?void 0:n[0];i.tooltipLabels.drawSeriesTexts(l(o(o({ttItems:i.ttItems,i:t,j:e},void 0!==(null==d?void 0:d.y1)&&{y1:d.y1}),void 0!==(null==d?void 0:d.y2)&&{y2:d.y2}),{shared:c}));const p=`.apexcharts-series[data\\:realIndex='${t}']`,u=h.dom.Paper.findOne(`${p} path[j='${e}'], ${p} circle[j='${e}'], ${p} rect[j='${e}']`);if(u){this._leaveHoveredBar();new Dt(this.w,this.ctx).pathMouseEnter(u,null),this._hoveredBarEl=u}if(h.globals.isBarHorizontal){const t=u&&u.node;if(t){const e=h.dom.elWrap.getBoundingClientRect(),s=t.getBoundingClientRect(),a=s.left-e.left,r=s.top-e.top,n=s.height,o=s.width,l=i.tooltipRect.ttWidth||0,c=r+n/2-(i.tooltipRect.ttHeight||0)/2;let d=a+o;a<(i.xyRatios&&null!=i.xyRatios.baseLineInvertedY?i.xyRatios.baseLineInvertedY:e.width/2)&&(d=a-l);const p=i.getElTooltip();p&&(p.style.left=d+"px",p.style.top=c+"px")}}else i.tooltipPosition.moveStickyTooltipOverBars(e,t)}_showTooltipAxisLine(t,e,i){const s=this.w,a=s.config.chart.type,r=i.tConfig.shared&&i.tooltipUtil.isXoverlap(e)&&i.tooltipUtil.isInitialSeriesSameLen();i.tooltipLabels.drawSeriesTexts({ttItems:i.ttItems,i:t,j:e,shared:r});const n="scatter"===a||"bubble"===a,o=s.globals.markers.largestSize>0&&!s.globals.markers.batched;n?this._showScatterBubblePoint(t,e,i):o?r?i.marker.enlargePoints(e):i.tooltipPosition.moveDynamicPointOnHover(e,t):r?i.tooltipPosition.moveDynamicPointsOnHover(e):i.tooltipPosition.moveDynamicPointOnHover(e,t)}_showScatterBubblePoint(t,e,i){const s=this.w.dom.baseEl;this._enlargedScatterMarker&&(i.marker.oldPointSize(this._enlargedScatterMarker),this._enlargedScatterMarker=null);const a=s.querySelector(`.apexcharts-series[data\\:realIndex='${t}']`);if(!a)return;const r=a.querySelector(`.apexcharts-marker[rel='${e}']`);r&&(i.marker.enlargeCurrentPoint(e,r),this._enlargedScatterMarker=r)}_showTooltipNonAxis(t,e,i,s){const a=this.w;i.tooltipLabels.drawSeriesTexts({ttItems:i.ttItems,i:e,shared:!1});const r=s.getBoundingClientRect(),n=r.width||i.tooltipRect.ttWidth||0,o=r.height||i.tooltipRect.ttHeight||0,l=a.dom.baseEl.querySelector(`.apexcharts-pie-area[j='${e}']`),h=i.getSliceAnchor(l);h&&(s.style.left=h.x-n/2+"px",s.style.top=h.y-o-10+"px")}_showTooltipRadialBar(t,e,i,s){var a;const r=this.w;i.tooltipLabels.drawSeriesTexts({ttItems:i.ttItems,i:t,shared:!1});const{ttWidth:n=0,ttHeight:o=0}=i.getCachedDimensions(),l=r.dom.baseEl.querySelector(`.apexcharts-radialbar-series[data\\:realIndex='${t}'] path`);if(l){const e=parseFloat(null!=(a=l.getAttribute("data:angle"))?a:"")||0,i=(r.config.plotOptions.radialBar.startAngle||0)+e/2,h=r.layout.gridWidth/2,c=r.layout.gridHeight/2,d=r.globals.radialSize||Math.min(r.layout.gridWidth,r.layout.gridHeight)/2,p=r.seriesData.series.length,u=d/Math.max(p,1),g=d-t*u,f=(g+(g-u))/2,x=v.polarToCartesian(h,c,f,i),m=x.x+(r.layout.translateX||0),b=x.y+(r.layout.translateY||0);s.style.left=m-n/2+"px",s.style.top=b-o-10+"px"}}_showTooltipHeatTree(t,e,i,s,a){var r,n;const o=this.w;i.tooltipLabels.drawSeriesTexts({ttItems:i.ttItems,i:t,j:e,shared:!1});const l=s.getBoundingClientRect(),h=l.width||i.tooltipRect.ttWidth||0,c=l.height||i.tooltipRect.ttHeight||0,d="heatmap"===a?"apexcharts-heatmap-rect":"apexcharts-treemap-rect",p=o.dom.baseEl.querySelector(`.${d}[i='${t}'][j='${e}']`);if(p){const t=o.dom.elWrap.getBoundingClientRect(),e=p.getBoundingClientRect(),a=e.left-t.left,l=e.top-t.top,d=e.width,u=e.height,g=parseFloat(null!=(r=p.getAttribute("cx"))?r:""),f=parseFloat(null!=(n=p.getAttribute("width"))?n:"");i.tooltipPosition.moveXCrosshairs(g+f/2);let x=a+d+h/2;const m=l+u/2-c/2;a+d>o.layout.gridWidth/2&&(x=a-h/2),s.style.left=x+"px",s.style.top=m+"px"}}_applyFocusClass(t,e){this._removeFocusClass();const i=this._getFocusableElement(t,e)||this._getBatchedFocusEl(t);if(i){i.classList.add("apexcharts-keyboard-focused"),i.setAttribute("role","img");const s=this._buildPointLabel(t,e);s&&i.setAttribute("aria-label",s),this._focusedEl=i}}_getBatchedFocusEl(t){return this.w.globals.markers.batched?this.w.dom.baseEl.querySelector(`.apexcharts-series[data\\:realIndex='${t}'] .apexcharts-series-markers path`):null}_removeFocusClass(){this._focusedEl&&(this._focusedEl.classList.remove("apexcharts-keyboard-focused"),this._focusedEl.removeAttribute("role"),this._focusedEl.removeAttribute("aria-label"),this._focusedEl=null)}_buildPointLabel(t,e){var i,s,a,r,n,o,l,h;const c=this.w,d=c.config.chart.type,p=c.seriesData.seriesNames||[],u=c.seriesData.series||[];if("pie"===d||"donut"===d||"polarArea"===d){const t=null!=(s=(null==(i=c.labelData)?void 0:i.labels)&&c.labelData.labels[e])?s:"",a=Array.isArray(u)?u[e]:"";return t?`${t}: ${a}`:`${a}`}if("radialBar"===d){return`${p[t]||`Series ${t+1}`}: ${Array.isArray(u)?u[t]:""}`}const g=p[t]||`Series ${t+1}`,f=(Array.isArray(u[t])?u[t]:[])[e];let x=null==f?"":String(f);const m=null==(r=null==(a=c.formatters)?void 0:a.yLabelFormatters)?void 0:r[t];if("function"==typeof m)try{x=m(f,{seriesIndex:t,dataPointIndex:e,w:c})}catch(t){}let b="";const y=null==(n=c.labelData)?void 0:n.categoryLabels,w=null==(l=null==(o=c.seriesData)?void 0:o.seriesX)?void 0:l[t];if(Array.isArray(y)&&null!=y[e])b=String(y[e]);else if(Array.isArray(w)&&null!=w[e]){const i=null==(h=c.formatters)?void 0:h.xLabelFormatter;if("function"==typeof i)try{b=String(i(w[e],{seriesIndex:t,dataPointIndex:e,w:c}))}catch(t){b=String(w[e])}else b=String(w[e])}return b?`${g}: ${x}, ${b}`:`${g}: ${x}`}_leaveHoveredBar(){if(this._hoveredBarEl){new Dt(this.w,this.ctx).pathMouseLeave(this._hoveredBarEl,null),this._hoveredBarEl=null}}_getFocusableElement(t,e){const i=this.w,s=i.config.chart.type,a=i.dom.baseEl;if("pie"===s||"donut"===s||"polarArea"===s)return a.querySelector(`.apexcharts-pie-area[j='${e}']`);if("heatmap"===s)return a.querySelector(`.apexcharts-heatmap-rect[i='${t}'][j='${e}']`);if("treemap"===s)return a.querySelector(`.apexcharts-treemap-rect[i='${t}'][j='${e}']`);if("radialBar"===s)return a.querySelector(`.apexcharts-radialbar-series[data\\:realIndex='${t}'] path`);if("bar"===s||"candlestick"===s||"boxPlot"===s||"violin"===s||"rangeBar"===s)return a.querySelector(`.apexcharts-series[data\\:realIndex='${t}'] path[j='${e}']`);return a.querySelector(`.apexcharts-series[data\\:realIndex='${t}'] .apexcharts-marker[rel='${e}']`)||null}_fireClick(){const t=this.w.globals.tooltip;if(!t)return;t.markerClick({type:"mouseup",clientX:0,clientY:0},this.seriesIndex,this.dataPointIndex)}_isNavEnabled(){const t=this.w.config.chart.accessibility;return t.enabled&&t.keyboard.enabled&&t.keyboard.navigation.enabled}_getSeriesCount(){const t=this.w,e=t.config.chart.type;return"pie"===e||"donut"===e||"polarArea"===e?1:t.seriesData.series.length}_getDataPointCount(t){const e=this.w,i=e.config.chart.type;if("pie"===i||"donut"===i||"polarArea"===i)return e.seriesData.series.length;const s=e.seriesData.series;return s[t]&&Array.isArray(s[t])?s[t].length:0}_clampCursor(){const t=this._getSeriesCount();this.seriesIndex>=t&&(this.seriesIndex=t-1),this.seriesIndex<0&&(this.seriesIndex=0);const e=this._getDataPointCount(this.seriesIndex);this.dataPointIndex>=e&&(this.dataPointIndex=e-1),this.dataPointIndex<0&&(this.dataPointIndex=0)}_snapToVisibleRange(){const t=this.w,e=t.globals,i=this.seriesIndex;if(!t.interact.zoomed)return;const s=t.seriesData.seriesX&&t.seriesData.seriesX[i];if(!s||!s.length)return;const a=e.minX,r=e.maxX;if(void 0===a||void 0===r)return;const n=s[this.dataPointIndex];if(n>=a&&n<=r)return;const o=s.length;for(let t=0;t<o;t++)if(s[t]>=a&&s[t]<=r)return void(this.dataPointIndex=t)}_snapToVisibleRangeInDirection(t){const e=this.w,i=e.globals,s=this.seriesIndex,a=e.seriesData.seriesX&&e.seriesData.seriesX[s];if(!a||!a.length)return;const r=i.minX,n=i.maxX;if(void 0===r||void 0===n)return;const o=a.length;if(t>=0){for(let t=0;t<o;t++)if(a[t]>=r&&a[t]<=n)return void(this.dataPointIndex=t)}else for(let t=o-1;t>=0;t--)if(a[t]>=r&&a[t]<=n)return void(this.dataPointIndex=t)}_isDataPointVisible(t,e){const i=this.w,s=i.globals;if(!i.interact.zoomed)return!0;const a=i.seriesData.seriesX&&i.seriesData.seriesX[t];if(!a)return!0;const r=a[e];return void 0===r||r>=s.minX&&r<=s.maxX}_announce(t){const e=this.w;if(!e.config.chart.accessibility.announcements.enabled)return;const i=e.dom.baseEl;if(!i)return;const s=i.querySelector(".apexcharts-sr-status");s&&(s.textContent="",setTimeout(()=>{s.textContent=t},0))}}});const Ca=new Set(["bar","funnel","pyramid","histogram"]),ka=new Set(["pie","donut","polarArea","radialBar","gauge"]),_a=new Set(["unit","waffle"]),Ma=new Set(["treemap","sunburst"]),Da=new Set(["boxPlot","violin"]),La=1500;function Pa(t){return Ca.has(t)?"bar":ka.has(t)?"radial":_a.has(t)?"unit":Ma.has(t)?"partition":Da.has(t)?"summary":null}Ks.registerFeatures({morphTypeChange:class{constructor(t,e){this.w=t,this.ctx=e,this._snapshot=null,this._ghost=null,this._pieceLayer=null,this._pieceCancel=null}canMorphTypes(t,e){if(t===e)return!1;const i=Pa(t),s=Pa(e);return!(!i||!s)&&("partition"===i==("partition"===s)||"unit"!==i&&"unit"!==s)}isCompatibleSeriesShape(t,e,i){if(!Array.isArray(i)||0===i.length)return!1;const s=Pa(t),a=Pa(e);return"unit"===a?!!i.every(t=>"number"==typeof t)||i.every(t=>t&&"object"==typeof t&&Array.isArray(t.data)):"partition"===a||("radial"===a?!!i.every(t=>"number"==typeof t)||1===i.length&&i[0]&&"object"==typeof i[0]&&Array.isArray(i[0].data):"bar"===a||"summary"===a?i.every(t=>t&&"object"==typeof t&&Array.isArray(t.data)):null!==s&&null!==a)}captureBeforeDestroy({fromType:t,toType:e,newSeries:i}){if(this._snapshot=null,this._removeGhost(),this._cancelPieces(),!d.isBrowser())return!1;const s=this.w.config.chart.animations;if(!s||!1===s.enabled)return!1;if(s.chartTypeMorph&&!1===s.chartTypeMorph.enabled)return!1;if(s.respectReducedMotion&&wt())return!1;if(!this.canMorphTypes(t,e))return!1;if(!this.isCompatibleSeriesShape(t,e,i))return!1;const{marks:a,branches:r,unitDots:n}=this._captureFromDOM(t);if(!a.length)return!1;const o=this._buildMapping(a,t,e,i,r);if(0===o.size)return!1;this._snapshot={fromType:t,toType:e,mapping:o,oldLayout:{translateX:this.w.layout.translateX||0,translateY:this.w.layout.translateY||0}};const l=Pa(t),h=Pa(e),c=this._canProbePaths();if("unit"===h&&("bar"===l||"summary"===l||"radial"===l&&c)){const t=this._countUnitSeries(i);this._snapshot.pieceOut=t>0&&t<=La}else if("unit"===l&&("bar"===h||"summary"===h||"radial"===h&&c)){let t=0;if(n.forEach(e=>{t+=e.length}),t>0&&t<=La){this._snapshot.pieceIn=!0,this._snapshot.sourceDots=n;const t=[];"radial"===h?(Array.isArray(i)?i:[]).forEach((e,i)=>{t.push(`${i}:0`)}):(Array.isArray(i)?i:[]).forEach((e,i)=>{const s=e&&Array.isArray(e.data)?e.data:[];for(let e=0;e<s.length;e++)t.push(`${i}:${e}`)}),this._snapshot.keyOrder=t}}return!this._needsGhost(t,e)||this._snapshot.pieceOut||this._snapshot.pieceIn||this._captureGhost(),this.w.globals.previousPaths=[],!0}_needsGhost(t,e){return"unit"===Pa(t)||"unit"===Pa(e)}_captureGhost(){var t,e;const i=null==(t=this.w.dom)?void 0:t.Paper,s=i&&i.node;if(!s||"function"!=typeof s.cloneNode)return;const a=s.cloneNode(!0),r=[".apexcharts-xaxis",".apexcharts-yaxis",".apexcharts-grid",".apexcharts-gridlines-horizontal",".apexcharts-gridlines-vertical",".apexcharts-legend",".apexcharts-title-text",".apexcharts-subtitle-text",".apexcharts-annotations",".apexcharts-zoom-rect",".apexcharts-selection-rect",".apexcharts-xcrosshairs",".apexcharts-ycrosshairs"];"function"==typeof a.querySelectorAll&&r.forEach(t=>{a.querySelectorAll(t).forEach(t=>{t.parentNode&&t.parentNode.removeChild(t)})}),"function"==typeof a.querySelectorAll&&a.querySelectorAll("[id]").forEach(t=>{t.removeAttribute("id")}),null==(e=a.removeAttribute)||e.call(a,"id"),this._ghost=a}_mountGhost(){var t,e,i;const s=this._ghost;if(!s||!d.isBrowser())return;const a=null==(t=this.w.dom)?void 0:t.elWrap;if(!a||"function"!=typeof a.appendChild)return void(this._ghost=null);const r=s.style;r&&(r.position="absolute",r.left="0",r.top="0",r.background="transparent",r.pointerEvents="none",r.opacity="1"),null==(e=s.setAttribute)||e.call(s,"aria-hidden","true"),null==(i=s.setAttribute)||i.call(s,"class","apexcharts-morph-ghost"),a.appendChild(s);const n=this.getSpeed(),o=Math.max(120,Math.round(.55*n));b.requestAnimationFrame(()=>{r&&(r.transition=`opacity ${o}ms ease-in`,r.opacity="0")}),setTimeout(()=>this._removeGhost(),o+60)}_removeGhost(){const t=this._ghost;this._ghost=null,t&&t.parentNode&&t.parentNode.removeChild(t)}_countUnitSeries(t){if(!Array.isArray(t))return 0;let e=0;for(const i of t){if(!i||"object"!=typeof i||!Array.isArray(i.data))return 0;e+=i.data.length}return e}usesPieceTakeover(){return!(!this._snapshot||!this._snapshot.pieceOut)}claimsTargetMark(t,e){return!!(this._snapshot&&this._snapshot.pieceIn&&this._snapshot.mapping.has(`${t}:${e}`))}_makePieceLayer(){var t,e;const i=null==(t=this.w.dom)?void 0:t.elGraphical,s=i&&i.node;if(!s||"function"!=typeof s.appendChild)return null;const a=b.createElementNS("http://www.w3.org/2000/svg","g");if(!a)return null;a.setAttribute("class","apexcharts-morph-pieces"),a.setAttribute("pointer-events","none");const r=null==(e=this.w.globals)?void 0:e.cuid;return r&&a.setAttribute("clip-path",`url(#gridRectBarMask${r})`),s.appendChild(a),this._pieceLayer=a,a}_revealPieceHidden(){var t;const e=null==(t=this.w.globals.dom)?void 0:t.baseEl;e&&"function"==typeof e.querySelectorAll&&e.querySelectorAll("[data-piece-hidden]").forEach(t=>{t.removeAttribute("opacity"),t.removeAttribute("data-piece-hidden")})}_cancelPieces(){this._pieceCancel&&(this._pieceCancel(),this._pieceCancel=null);const t=this._pieceLayer;this._pieceLayer=null,t&&t.parentNode&&t.parentNode.removeChild(t),this._revealPieceHidden()}_canProbePaths(){if(!d.isBrowser())return!1;const t=b.createElementNS("http://www.w3.org/2000/svg","path");return!!t&&"function"==typeof t.isPointInFill}_makeExtentProber(t,e,i){const s=i.ownerDocument.createElementNS("http://www.w3.org/2000/svg","path");s.setAttribute("d",t),s.setAttribute("fill","#000"),s.setAttribute("stroke","#000"),s.setAttribute("stroke-width","3"),s.setAttribute("visibility","hidden"),i.appendChild(s);const a=s.ownerSVGElement;if("function"!=typeof s.isPointInFill||!a||"function"!=typeof a.createSVGPoint)return i.removeChild(s),null;const r=a.createSVGPoint(),n=(t,e)=>{r.x=t,r.y=e;const i=s;return i.isPointInFill(r)||"function"==typeof i.isPointInStroke&&i.isPointInStroke(r)},o=48;return{intervalsAt:(t,i,s)=>{const a=s?e.y:e.x,r=a+(s?e.height:e.width);if(!(r>a))return null;const l=(t,e)=>s?n(e,t):n(t,e),h=[t+.1*(i-t),(t+i)/2,i-.1*(i-t)],c=(t,e,i)=>{let s=e,a=t;for(let t=0;t<6;t++){const t=(s+a)/2;l(t,i)?a=t:s=t}return(s+a)/2},d=(r-a)/o,p=new Array(49).fill(null);let u=!1;for(const t of h)for(let e=0;e<=o;e++)null===p[e]&&l(a+e*d,t)&&(p[e]=t,u=!0);if(!u)return null;const g=[];let f=-1;for(let t=0;t<=49;t++){const e=t<=o&&null!==p[t];if(e&&f<0&&(f=t),!e&&f>=0){const e=t-1,i=p[f],s=0===f?a:c(a+f*d,a+(f-1)*d,i),n=e===o?r:c(a+e*d,a+(e+1)*d,p[e]);n>s&&g.push([s,n]),f=-1}}return g.length?g:null},dispose:()=>{s.parentNode&&s.parentNode.removeChild(s)}}}_separatePieces(){var t;const e=this._snapshot,i=null==(t=this.w.globals.dom)?void 0:t.baseEl;if(!e||!i)return this._revealPieceHidden();const s=new Map;let a=0;if(i.querySelectorAll(".apexcharts-unit-area").forEach(t=>{var e,i,r,n,o,l,h;const c=parseInt(null!=(e=t.getAttribute("i"))?e:"",10);if(isNaN(c))return;const d=t.getAttribute("cx");let p,u,g=3;if(null!=d)p=parseFloat(d),u=parseFloat(null!=(i=t.getAttribute("cy"))?i:""),g=parseFloat(null!=(r=t.getAttribute("r"))?r:"3")||3;else{const e=parseFloat(null!=(n=t.getAttribute("width"))?n:"0")||0,i=parseFloat(null!=(o=t.getAttribute("height"))?o:"0")||0;p=parseFloat(null!=(l=t.getAttribute("x"))?l:"")+e/2,u=parseFloat(null!=(h=t.getAttribute("y"))?h:"")+i/2,g=Math.max(e,i)/2||3}if(!isFinite(p)||!isFinite(u))return;let f=s.get(c);f||(f=[],s.set(c,f)),f.push({el:t,x:p,y:u,r:g,fill:t.getAttribute("fill")}),a++}),0===a||a>La)return this._revealPieceHidden();const r=this._makePieceLayer();if(!r)return this._revealPieceHidden();const n=[],o=r.ownerDocument,l=Pa(e.fromType),h="summary"===l||"radial"===l;if(Array.from(s.keys()).sort((t,e)=>t-e).forEach(t=>{var i;const a=s.get(t),l=this.getInitialBBoxFor(t),c=e.mapping.get(`${t}:0`);if(!l||!c)return void a.forEach(t=>{t.el.removeAttribute("opacity"),t.el.removeAttribute("data-piece-hidden")});const d=c.fill&&0!==c.fill.indexOf("url(")?c.fill:(null==(i=this.w.globals.colors)?void 0:i[t])||a[0].fill;let p=null;if(h){const e=this.getInitialPathFor(t,0);e&&(p=this._makeExtentProber(e,l,r))}const u=p?ba(l,a.length,p.intervalsAt):ma(l,a.length);p&&p.dispose();const g=wa(u,t=>[t.x+t.width/2,t.y+t.height/2]),f=wa(a,t=>[t.x,t.y]);for(let e=0;e<f.length;e++){const i=g[e],s=f[e],a=o.createElementNS("http://www.w3.org/2000/svg","rect");a.setAttribute("data-i",String(t)),a.setAttribute("x",String(i.x)),a.setAttribute("y",String(i.y)),a.setAttribute("width",String(i.width)),a.setAttribute("height",String(i.height)),a.setAttribute("rx","0"),a.setAttribute("fill",String(d)),r.appendChild(a),n.push({el:a,from:{x:i.x,y:i.y,width:i.width,height:i.height,rx:0},to:{x:s.x-s.r,y:s.y-s.r,width:2*s.r,height:2*s.r,rx:s.r},fill:Aa(d,s.fill),fillEnd:s.fill,delay:0,meta:{dotEl:s.el}})}}),!n.length)return this._cancelPieces();this._runPieces(n,t=>{const e=t.meta.dotEl;e.removeAttribute("opacity"),e.removeAttribute("data-piece-hidden"),t.el.parentNode&&t.el.parentNode.removeChild(t.el)})}_combinePieces(){var t,e;const i=this._snapshot,s=null==(t=this.w.globals.dom)?void 0:t.baseEl;if(!(i&&i.sourceDots&&i.keyOrder&&s))return this._revealPieceHidden();const a=this._collectTargetMarks(i.toType);if(!a.size)return this._revealPieceHidden();const r=i.oldLayout.translateX-(this.w.layout.translateX||0),n=i.oldLayout.translateY-(this.w.layout.translateY||0),o=Array.from(i.sourceDots.keys()).sort((t,e)=>t-e),l=this._makePieceLayer();if(!l)return this._revealPieceHidden();const h=l.ownerDocument,c=[],d=Pa(i.toType),p="summary"===d||"radial"===d;for(let t=0;t<o.length;t++){const s=i.sourceDots.get(o[t]),d=i.keyOrder[t],u=d?a.get(d):null;if(!u||!s||!s.length){u&&u.els.forEach(t=>{t.removeAttribute("opacity"),t.removeAttribute("data-piece-hidden")});continue}const g=u.fill&&0!==u.fill.indexOf("url(")?u.fill:(null==(e=this.w.globals.colors)?void 0:e[u.realIndex])||s[0].fill;let f=null;if(p){const t=u.d||u.els.map(t=>t.getAttribute("pathTo")||t.getAttribute("d")).filter(Boolean).join(" ");t&&(f=this._makeExtentProber(t,u.bbox,l))}const x=f?ba(u.bbox,s.length,f.intervalsAt):ma(u.bbox,s.length);f&&f.dispose();const m=wa(x,t=>[t.x+t.width/2,t.y+t.height/2]),b=wa(s,t=>[t.x,t.y]),y={remaining:b.length,els:u.els,tiles:[]};for(let t=0;t<b.length;t++){const e=b[t],i=m[t],s=h.createElementNS("http://www.w3.org/2000/svg","rect"),a=e.x+r-e.r,o=e.y+n-e.r;s.setAttribute("data-key",d),s.setAttribute("x",String(a)),s.setAttribute("y",String(o)),s.setAttribute("width",String(2*e.r)),s.setAttribute("height",String(2*e.r)),s.setAttribute("rx",String(e.r)),s.setAttribute("fill",String(e.fill||g)),l.appendChild(s),y.tiles.push(s),c.push({el:s,from:{x:a,y:o,width:2*e.r,height:2*e.r,rx:e.r},to:{x:i.x,y:i.y,width:i.width,height:i.height,rx:0},fill:Aa(e.fill,g),fillEnd:String(g),delay:0,meta:{markState:y}})}}if(!c.length)return this._cancelPieces();this._runPieces(c,t=>{const e=t.meta.markState;e.remaining--,0===e.remaining&&(e.els.forEach(t=>{t.removeAttribute("opacity"),t.removeAttribute("data-piece-hidden")}),e.tiles.forEach(t=>{t.parentNode&&t.parentNode.removeChild(t)}))})}_runPieces(t,e){const i=this.getSpeed(),s=Math.min(300,.35*i),a=Math.max(180,i-s);for(let e=0;e<t.length;e++)t[e].delay=t.length>1?e/(t.length-1)*s:0;this._pieceCancel=function({pieces:t,duration:e,onPieceDone:i,onAllDone:s}){let a=!1;const r=Date.now(),n=Math.max(1,e),o=(t,e)=>{const i=t.from,s=t.to,a=t.el;a.setAttribute("x",String(i.x+(s.x-i.x)*e)),a.setAttribute("y",String(i.y+(s.y-i.y)*e)),a.setAttribute("width",String(Math.max(0,i.width+(s.width-i.width)*e))),a.setAttribute("height",String(Math.max(0,i.height+(s.height-i.height)*e))),a.setAttribute("rx",String(Math.max(0,i.rx+(s.rx-i.rx)*e))),t.fill?a.setAttribute("fill",t.fill(e)):e>=1&&t.fillEnd&&a.setAttribute("fill",t.fillEnd)},l=()=>{if(a)return;const e=Date.now()-r;let h=!1;for(let s=0;s<t.length;s++){const a=t[s];if(a._done)continue;const r=(e-a.delay)/n;if(r<1&&(h=!0),r<=0)continue;const l=Math.min(1,r);o(a,Sa(l)),l>=1&&(a._done=!0,i&&i(a))}h?b.requestAnimationFrame(l):s&&s()};return b.requestAnimationFrame(l),()=>{a=!0}}({pieces:t,duration:a,onPieceDone:e,onAllDone:()=>{this._pieceCancel=null,this._cancelPieces()}})}_collectTargetMarks(t){var e;const i=null==(e=this.w.globals.dom)?void 0:e.baseEl,s=new Map;if(!i)return s;const a=Pa(t);if("radial"===a)return i.querySelectorAll(".apexcharts-pie-series .apexcharts-pie-area").forEach((t,e)=>{const i=t.getAttribute("data:pathFinal")||t.getAttribute("d");if(!i||!i.trim())return;const a=this._pathBBox(i);a&&s.set(`${e}:0`,{realIndex:e,j:0,d:i,bbox:{x:a.minX,y:a.minY,width:a.maxX-a.minX,height:a.maxY-a.minY},fill:t.getAttribute("fill"),els:[t]})}),s;const r="summary"===a?`.apexcharts-${t}-series`:".apexcharts-bar-series";return i.querySelectorAll(`${r} .apexcharts-series`).forEach(t=>{var e;const i=parseInt(null!=(e=t.getAttribute("data:realIndex"))?e:"0",10)||0;let a=0;t.querySelectorAll("path[pathTo]").forEach(t=>{var e;const r=t.getAttribute("pathTo")||t.getAttribute("d");if(!r||!r.trim())return;const n=parseInt(null!=(e=t.getAttribute("j"))?e:"",10),o=isNaN(n)?a++:n,l=this._pathBBox(r);if(!l)return;const h=`${i}:${o}`,c=s.get(h);c?(c.els.push(t),c.bbox={x:Math.min(c.bbox.x,l.minX),y:Math.min(c.bbox.y,l.minY),width:Math.max(c.bbox.x+c.bbox.width,l.maxX)-Math.min(c.bbox.x,l.minX),height:Math.max(c.bbox.y+c.bbox.height,l.maxY)-Math.min(c.bbox.y,l.minY)}):s.set(h,{realIndex:i,j:o,bbox:{x:l.minX,y:l.minY,width:l.maxX-l.minX,height:l.maxY-l.minY},fill:t.getAttribute("fill"),els:[t]})})}),s}_captureFromDOM(t){var e;const i=null==(e=this.w.globals.dom)?void 0:e.baseEl;if(!i)return{marks:[],branches:[],unitDots:new Map};const s=[],a=[],r=new Map,n=Pa(t);if("bar"===n){i.querySelectorAll(".apexcharts-bar-series .apexcharts-series").forEach(t=>{var e;const i=parseInt(null!=(e=t.getAttribute("data:realIndex"))?e:"0",10);t.querySelectorAll("path[pathTo]").forEach((t,e)=>{const a=t.getAttribute("pathTo")||t.getAttribute("d");a&&s.push({realIndex:i,j:e,d:a,fill:t.getAttribute("fill")})})})}else if("summary"===n){const e=new Map;i.querySelectorAll(`.apexcharts-${t}-area`).forEach(t=>{var i,s;const a=parseInt(null!=(i=t.getAttribute("j"))?i:"",10);if(isNaN(a))return;const r=t.getAttribute("pathTo")||t.getAttribute("d");if(!r||!r.trim())return;const n="function"==typeof t.closest?t.closest(".apexcharts-series"):null,o=parseInt(null!=(s=null==n?void 0:n.getAttribute("data:realIndex"))?s:"0",10)||0,l=`${o}:${a}`,h=e.get(l);h?h.d+=` ${r}`:e.set(l,{realIndex:o,j:a,d:r,fill:t.getAttribute("fill")})}),Array.from(e.values()).sort((t,e)=>t.realIndex-e.realIndex||t.j-e.j).forEach(t=>s.push(t))}else if("partition"===n)if("treemap"===t){const t=t=>{var e,i,s,a;const r=parseFloat(null!=(e=t.getAttribute("x"))?e:""),n=parseFloat(null!=(i=t.getAttribute("y"))?i:""),o=parseFloat(null!=(s=t.getAttribute("width"))?s:""),l=parseFloat(null!=(a=t.getAttribute("height"))?a:"");return[r,n,o,l].every(t=>isFinite(t))?`M ${r} ${n} L ${r+o} ${n} L ${r+o} ${n+l} L ${r} ${n+l} Z`:null};i.querySelectorAll(".apexcharts-treemap-rect").forEach(e=>{var i,a;const r=t(e);r&&s.push({realIndex:parseInt(null!=(i=e.getAttribute("i"))?i:"0",10)||0,j:parseInt(null!=(a=e.getAttribute("j"))?a:"0",10)||0,d:r,fill:e.getAttribute("fill"),key:e.getAttribute("data:key")||null})});i.querySelectorAll(".apexcharts-treemap-parent-rect").forEach(e=>{const i=t(e),s=e.getAttribute("data:key");i&&s&&a.push({key:s,d:i,fill:e.getAttribute("fill")})})}else{const t=i.querySelectorAll(".apexcharts-sunburst-arc"),e=[];t.forEach(t=>{"true"===t.getAttribute("data:leaf")&&e.push(t)});(e.length?e:Array.from(t)).forEach((t,e)=>{const i=t.getAttribute("d");i&&i.trim()&&s.push({realIndex:e,j:0,d:i,fill:t.getAttribute("fill"),key:t.getAttribute("data:key")||null})}),t.forEach(t=>{if("true"===t.getAttribute("data:leaf"))return;const e=t.getAttribute("d"),i=t.getAttribute("data:key");e&&e.trim()&&i&&a.push({key:i,d:e,fill:t.getAttribute("fill")})})}else if("unit"===n){const t=i.querySelectorAll(".apexcharts-unit-area"),e=new Map;t.forEach(t=>{var i,s,a,n,o,l,h;const c=parseInt(null!=(i=t.getAttribute("i"))?i:"",10);if(isNaN(c))return;const d=t.getAttribute("cx");let p,u,g=3;if(null!=d)p=parseFloat(d),u=parseFloat(null!=(s=t.getAttribute("cy"))?s:""),g=parseFloat(null!=(a=t.getAttribute("r"))?a:"3")||3;else{const e=parseFloat(null!=(n=t.getAttribute("width"))?n:"0")||0,i=parseFloat(null!=(o=t.getAttribute("height"))?o:"0")||0;p=parseFloat(null!=(l=t.getAttribute("x"))?l:"")+e/2,u=parseFloat(null!=(h=t.getAttribute("y"))?h:"")+i/2,g=Math.max(e,i)/2||3}if(!isFinite(p)||!isFinite(u))return;let f=r.get(c);f||(f=[],r.set(c,f)),f.push({x:p,y:u,r:g,fill:t.getAttribute("fill")});const x=e.get(c);x?(p<x.minX&&(x.minX=p),p>x.maxX&&(x.maxX=p),u<x.minY&&(x.minY=u),u>x.maxY&&(x.maxY=u)):e.set(c,{minX:p,minY:u,maxX:p,maxY:u,fill:t.getAttribute("fill")})}),Array.from(e.keys()).sort((t,e)=>t-e).forEach(t=>{const i=e.get(t),a=i.minX-2,r=i.minY-2,n=i.maxX+2,o=i.maxY+2;s.push({realIndex:t,j:0,d:`M ${a} ${r} L ${n} ${r} L ${n} ${o} L ${a} ${o} Z`,fill:i.fill})})}else if("radial"===n)if("radialBar"===t||"gauge"===t){const t=this.w.layout.gridWidth/2,e=Math.min(this.w.layout.gridWidth,this.w.layout.gridHeight)/2;i.querySelectorAll(".apexcharts-radial-series .apexcharts-radialbar-area").forEach(i=>{var a;const r=i.parentElement,n=parseInt(null!=(a=null==r?void 0:r.getAttribute("data:realIndex"))?a:"0",10),o=i.getAttribute("d");if(!o)return;const l=parseFloat(i.getAttribute("stroke-width")||"0"),h=l>1&&this._radialArcToFilledSegment(o,l,t,e)||o;s.push({realIndex:n,j:0,d:h,fill:i.getAttribute("stroke")})})}else{i.querySelectorAll(".apexcharts-pie-series .apexcharts-pie-area").forEach((t,e)=>{const i=t.getAttribute("d");i&&s.push({realIndex:e,j:0,d:i,fill:t.getAttribute("fill")})})}return{marks:s,branches:a,unitDots:r}}_radialArcToFilledSegment(t,e,i,s){const a=t.match(/M\s*(-?[\d.]+)\s+(-?[\d.]+)\s+A\s*(-?[\d.]+)\s+(?:-?[\d.]+)\s+(?:-?[\d.]+)\s+(\d)\s+(\d)\s+(-?[\d.]+)\s+(-?[\d.]+)/);if(!a)return null;const r=parseFloat(a[1]),n=parseFloat(a[2]),o=parseFloat(a[3]),l=parseInt(a[4],10),h=parseInt(a[5],10),c=parseFloat(a[6]),d=parseFloat(a[7]);if(!isFinite(o)||o<=0)return null;const p=e/2,u=o+p,g=Math.max(0,o-p),f=(t,e,a)=>{const r=t-i,n=e-s,o=Math.sqrt(r*r+n*n);if(0===o)return{x:i,y:s};const l=a/o;return{x:i+r*l,y:s+n*l}},x=f(r,n,u),m=f(c,d,u),b=f(r,n,g),y=f(c,d,g),w=h?0:1;return`M ${x.x} ${x.y} A ${u} ${u} 0 ${l} ${h} ${m.x} ${m.y} L ${y.x} ${y.y} A ${g} ${g} 0 ${l} ${w} ${b.x} ${b.y} Z`}buildRingSegmentPath(t,e,i,s,a,r){const n=s/2,o=i+n,l=Math.max(0,i-n),h=(a-90)*Math.PI/180,c=(r-90)*Math.PI/180,d=t+o*Math.cos(h),p=e+o*Math.sin(h),u=t+o*Math.cos(c),g=e+o*Math.sin(c),f=t+l*Math.cos(h),x=e+l*Math.sin(h),m=t+l*Math.cos(c),b=e+l*Math.sin(c),y=r>a?1:0,w=Math.abs(r-a)>180?1:0;return`M ${d} ${p} A ${o} ${o} 0 ${w} ${y} ${u} ${g} L ${m} ${b} A ${l} ${l} 0 ${w} ${1-y} ${f} ${x} Z`}getFromType(){return this._snapshot?this._snapshot.fromType:null}_buildMapping(t,e,i,s,a){const r=new Map,n=Pa(i),o=t.slice().sort((t,e)=>t.realIndex-e.realIndex||t.j-e.j);if("partition"===n&&a&&a.length){const t=o.filter(t=>t.key);t.length===o.length&&(t.forEach(t=>{r.set(`key:${t.key}`,{d:t.d,fill:t.fill})}),a.forEach(t=>{r.set(`key:${t.key}`,{d:t.d,fill:t.fill})}))}if("radial"===n||"unit"===n||"partition"===n)return o.forEach((t,e)=>{r.set(`${e}:0`,{d:t.d,fill:t.fill})}),r;if("bar"===n||"summary"===n){const t=[];return(Array.isArray(s)?s:[]).forEach((e,i)=>{const s=e&&Array.isArray(e.data)?e.data:[];for(let e=0;e<s.length;e++)t.push({realIndex:i,j:e})}),o.forEach((e,i)=>{const s=t[i];s&&r.set(`${s.realIndex}:${s.j}`,{d:e.d,fill:e.fill})}),r}return r}isActive(){return null!==this._snapshot}getInitialPathFor(t,e){if(!this._snapshot)return null;const i=this._snapshot.mapping.get(`${t}:${e}`);if(!i)return null;const s=this._snapshot.oldLayout.translateX-(this.w.layout.translateX||0),a=this._snapshot.oldLayout.translateY-(this.w.layout.translateY||0);return 0===s&&0===a?i.d:this._translatePathD(i.d,s,a)}_translatePathD(t,e,i){if(0===e&&0===i)return t;return U(t).map(t=>{const s=t[0];return"Z"===s?"Z":"M"===s||"L"===s||"T"===s?`${s} ${t[1]+e} ${t[2]+i}`:"H"===s?`${s} ${t[1]+e}`:"V"===s?`${s} ${t[1]+i}`:"C"===s?`${s} ${t[1]+e} ${t[2]+i} ${t[3]+e} ${t[4]+i} ${t[5]+e} ${t[6]+i}`:"S"===s||"Q"===s?`${s} ${t[1]+e} ${t[2]+i} ${t[3]+e} ${t[4]+i}`:"A"===s?`${s} ${t[1]} ${t[2]} ${t[3]} ${t[4]} ${t[5]} ${t[6]+e} ${t[7]+i}`:t.join(" ")}).join(" ")}getInitialCenterFor(t){const e=this.getInitialBBoxFor(t);return e?{x:e.x+e.width/2,y:e.y+e.height/2}:null}getInitialPathAt(t){return this.getInitialPathFor(t,0)}getInitialPathForKey(t){return this._snapshot&&t?this.getInitialPathFor("key",t):null}hasKeyedMarks(){if(!this._snapshot)return!1;for(const t of this._snapshot.mapping.keys())if("string"==typeof t&&t.startsWith("key:"))return!0;return!1}getInitialSlotFor(t,e,i){const s=this.getInitialBBoxFor(t);if(!s)return null;const a=s.x+s.width/2,r=s.y+s.height/2;if(!(i>1&&e>=0))return{x:a,y:r};const n=(Math.min(e,i-1)+.5)/i;return s.height>=s.width?{x:a,y:s.y+s.height*(1-n)}:{x:s.x+s.width*n,y:r}}getInitialBBoxFor(t){if(!this._snapshot)return null;const e=this._snapshot.mapping.get(`${t}:0`);if(!e)return null;const i=this._pathBBox(e.d);if(!i)return null;const s=this._snapshot.oldLayout.translateX-(this.w.layout.translateX||0),a=this._snapshot.oldLayout.translateY-(this.w.layout.translateY||0);return{x:i.minX+s,y:i.minY+a,width:i.maxX-i.minX,height:i.maxY-i.minY}}_pathBBox(t){const e=U(t);let i=1/0,s=1/0,a=-1/0,r=-1/0,n=!1;return e.forEach(t=>{const e=t[0];if("Z"===e)return;let o=[];if("H"===e)o=[[t[1],(s+r)/2||t[1]]];else if("V"===e)o=[[(i+a)/2||t[1],t[1]]];else if("A"===e)o=[[t[6],t[7]]];else for(let e=1;e+1<t.length;e+=2)o.push([t[e],t[e+1]]);o.forEach(([t,e])=>{isFinite(t)&&isFinite(e)&&(n=!0,t<i&&(i=t),t>a&&(a=t),e<s&&(s=e),e>r&&(r=e))})}),n?{minX:i,minY:s,maxX:a,maxY:r}:null}getInitialFillFor(t,e){if(!this._snapshot)return null;const i=this._snapshot.mapping.get(`${t}:${e}`);return i?i.fill:null}getSpeed(){const t=this.w.config.chart.animations;return t.chartTypeMorph&&t.chartTypeMorph.speed||t.speed||600}applyChromeFade(){var t;if(!this._snapshot||!d.isBrowser())return;const e=null==(t=this.w.globals.dom)?void 0:t.baseEl;if(!e)return;this._snapshot.pieceOut?this._separatePieces():this._snapshot.pieceIn?this._combinePieces():this._mountGhost();const i=this.getSpeed();[".apexcharts-xaxis",".apexcharts-yaxis",".apexcharts-grid",".apexcharts-gridlines-horizontal",".apexcharts-gridlines-vertical",".apexcharts-legend",".apexcharts-title-text",".apexcharts-subtitle-text"].forEach(t=>{e.querySelectorAll(t).forEach(t=>{t.style&&(t.style.opacity="0",t.style.transition=`opacity ${i}ms ease-out`,b.requestAnimationFrame(()=>{t.style.opacity="1"}),setTimeout(()=>{t.style.transition="",t.style.opacity=""},i+80))})}),setTimeout(()=>this.cleanup(),i+100)}cleanup(){this._snapshot=null,this._removeGhost(),this._cancelPieces()}}});const Ea="http://www.w3.org/1999/xhtml";class Ta{constructor(t,e,i){this.w=t,this.ctx=e,this.drilldown=i}render(t){if(!d.isBrowser())return;const e=this.w,i=e.dom.elWrap;if(!i)return;const s=i.querySelector(".apexcharts-breadcrumb");s&&s.parentNode&&s.parentNode.removeChild(s);const a=e.config.drilldown&&e.config.drilldown.breadcrumb;if(!a||!1===a.show)return;if(0===this.drilldown.depth)return;const r=b.createElementNS(Ea,"nav");r.setAttribute("class","apexcharts-breadcrumb"),r.setAttribute("aria-label","Drilldown breadcrumb"),this._position(r,a);const n=null!=a.separator?a.separator:" / ";t.forEach((e,i)=>{if(i>0){const t=b.createElementNS(Ea,"span");t.setAttribute("class","apexcharts-breadcrumb-separator"),t.setAttribute("aria-hidden","true"),t.textContent=n,r.appendChild(t)}const s=this._label(e,i);if(i===t.length-1){const t=b.createElementNS(Ea,"span");t.setAttribute("class","apexcharts-breadcrumb-item apexcharts-breadcrumb-current"),t.setAttribute("aria-current","page"),t.textContent=s,r.appendChild(t)}else{const t=b.createElementNS(Ea,"button");if(t.setAttribute("type","button"),t.setAttribute("class","apexcharts-breadcrumb-item"),0===i){const e=b.createElementNS(Ea,"span");e.setAttribute("class","apexcharts-breadcrumb-arrow"),e.setAttribute("aria-hidden","true"),e.textContent="\u2190",t.appendChild(e)}const e=b.createElementNS(Ea,"span");e.setAttribute("class","apexcharts-breadcrumb-label"),e.textContent=s,t.appendChild(e),t.addEventListener("click",()=>this.drilldown.drillToLevel(i)),r.appendChild(t)}}),i.appendChild(r),this.w.globals.axisCharts&&ti(this.w,this.ctx,r,a),this._avoidChromeOverlap(r)}_avoidChromeOverlap(t){const e=this.w,i=[".apexcharts-title-text",".apexcharts-subtitle-text"].map(t=>e.dom.baseEl.querySelector(t)).filter(t=>null!==t);if(!i.length)return;const s=e.dom.elWrap.getBoundingClientRect().top;for(let e=0;e<i.length+1;e++){const e=t.getBoundingClientRect(),a=i.find(t=>{const i=t.getBoundingClientRect();return e.left<i.right&&e.right>i.left&&e.top<i.bottom&&e.bottom>i.top});if(!a)break;t.style.top=a.getBoundingClientRect().bottom-s+4+"px"}}_label(t,e){const i=this.w.config.drilldown.breadcrumb;let s;if(0===e)s=null!=i.rootLabel?i.rootLabel:"All";else{const e=(this.w.config.drilldown.series||[]).find(e=>e&&e.id===t);s=e&&e.name||String(t)}return"function"==typeof i.formatter?i.formatter(s,{index:e,depth:this.drilldown.depth}):s}_position(t,e){const i=e.offsetX||0,s=e.offsetY||0;t.style.position="absolute",t.style.top=s+"px","top-right"===e.position?t.style.right=3-i+"px":t.style.left=i+"px"}}const Fa="http://www.w3.org/1999/xhtml",Ia="apexcharts-drilldown-loading";class Ra{constructor(t){this.w=t,this.el=null}_cfg(){const t=this.w.config.drilldown,e=t&&t.loading;return!1===e?{show:!1}:e||{}}show(){if(!d.isBrowser())return;const t=this._cfg();if(!1===t.show)return;const e=this.w.dom.elWrap;if(!e)return;this.hide();const i=b.createElementNS(Fa,"div");i.setAttribute("class",Ia),i.setAttribute("role","status"),i.setAttribute("aria-live","polite"),i.setAttribute("aria-label",t.text||"Loading");const s=b.createElementNS(Fa,"div");if(s.setAttribute("class",`${Ia}-spinner`),s.setAttribute("aria-hidden","true"),i.appendChild(s),t.text){const e=b.createElementNS(Fa,"span");e.setAttribute("class",`${Ia}-text`),e.textContent=t.text,i.appendChild(e)}e.appendChild(i),this.el=i}hide(){const t=this.w.dom.elWrap;if(t){const e=t.querySelectorAll(`.${Ia}`);for(let t=0;t<e.length;t++){const i=e[t];i.parentNode&&i.parentNode.removeChild(i)}}else this.el&&this.el.parentNode&&this.el.parentNode.removeChild(this.el);this.el=null}}const Xa="__apexDrilldownMarker";Ks.registerFeatures({drilldown:class{constructor(t,e){this.w=t,this.ctx=e,this.stack=[],this.rootSnapshot=null,this._wired=!1,this._asyncCache=new Map,this._pending=null,this._warnedUnreachable=!1,this._warnedNoSliceOffset=!1,this.breadcrumb=new Ta(t,e,this),this.loading=new Ra(t),this._onPointSelect=this._onPointSelect.bind(this),this._afterRender=this._afterRender.bind(this),this._onPlotDown=this._onPlotDown.bind(this),this._onPlotClick=this._onPlotClick.bind(this),this._downAt=null,this._plotClickWired=null,this.init()}init(){const t=this.w;t.config.drilldown&&t.config.drilldown.enabled&&(this._wired||(this._wired=!0,this.ctx.addEventListener("dataPointSelection",this._onPointSelect),this.ctx.addEventListener("mounted",this._afterRender),this.ctx.addEventListener("updated",this._afterRender),t.config.markers&&(t.config.markers.discrete=this._drillMarkers(t.config.series))))}get path(){return["root",...this.stack.map(t=>t.id)]}get depth(){return this.stack.length}drillDown(t,e,i){const s=this._resolveChild(t);return s?this._drillInto(s,e,i):"function"==typeof this.w.config.drilldown.onDrillDown?this._drillDownAsync(t,e,i):Promise.resolve(this.ctx)}drillUp(){return this.drillToLevel(this.stack.length-1)}drillToRoot(){return this.drillToLevel(0)}drillToLevel(t){const e=this.stack.length;if(t<0||t>=e)return Promise.resolve(this.ctx);const i=this.path[this.path.length-1],s=0===t?this.rootSnapshot:this.stack[t].restore;this.stack=this.stack.slice(0,t);const a=this.path[this.path.length-1];return this._apply(this._viewFromSnapshot(s),"up",{from:i,to:a})}_resolveChild(t){const e=this.w.config.drilldown&&this.w.config.drilldown.series;return Array.isArray(e)&&e.find(e=>e&&e.id===t)||null}_drillInto(t,e,i){if(this.stack.length>=32)return Promise.resolve(this.ctx);this.rootSnapshot||(this.rootSnapshot=this._snapshot());const s=this.path[this.path.length-1];return this.stack.push({id:t.id,name:t.name,restore:this._snapshot()}),this._apply(this._viewFromChild(t),"down",{from:s,to:t.id,point:e,seriesIndex:i&&i.seriesIndex,dataPointIndex:i&&i.dataPointIndex})}_drillDownAsync(t,e,i){const s=this.w.config.drilldown.onDrillDown,a=this._cacheGet(t);if(a)return this._drillInto(a,e,i);if(this._pending)return this._pending;let r;this.loading.show();try{r=s({id:t,point:e,seriesIndex:i&&i.seriesIndex,dataPointIndex:i&&i.dataPointIndex})}catch(e){return this.loading.hide(),this._fire("drillDownError",{id:t,error:e}),Promise.resolve(this.ctx)}const n=()=>{this._pending=null,this.loading.hide()},h=Promise.resolve(r).then(s=>{if(n(),this._isDead())return this.ctx;if(!s||!s.data)return this._fire("drillDownError",{id:t,error:new Error(`drilldown: onDrillDown resolved without a drillable level for id "${t}" (expected an object with a \`data\` array).`)}),this.ctx;const a=null!=s.id?s:l(o({},s),{id:t});return this._cacheSet(t,a),this._drillInto(a,e,i)},e=>(n(),this._isDead()||this._fire("drillDownError",{id:t,error:e}),this.ctx));return this._pending=h,h}_isDead(){const t=this.w;return!t||!t.globals||!0===t.globals.isDestroyed}_cacheEnabled(){const t=this.w.config.drilldown;return!(!t||!1===t.cache)}_cacheGet(t){return this._cacheEnabled()&&null!=t&&this._asyncCache.get(t)||null}_cacheSet(t,e){this._cacheEnabled()&&null!=t&&this._asyncCache.set(t,e)}clearCache(t){return null==t?this._asyncCache.clear():this._asyncCache.delete(t),this.ctx}_snapshot(){const t=this.w.config,e=this._overrideFields(),i={series:this._uncollapseSeries(v.clone(t.series))};return Array.isArray(t.labels)&&t.labels.length&&(i.labels=v.clone(t.labels)),i.chart={type:t.chart.type,stacked:t.chart.stacked},e.has("xaxis")&&(i.xaxis=v.clone(t.xaxis)),e.has("yaxis")&&(i.yaxis=v.clone(t.yaxis)),e.has("colors")&&(i.colors=t.colors?v.clone(t.colors):void 0),e.has("plotOptions")&&(i.plotOptions=v.clone(t.plotOptions)),e.has("fill")&&(i.fill=v.clone(t.fill)),e.has("legend")&&(i.legend=v.clone(t.legend)),i}_uncollapseSeries(t){const e=this.w,i=e.globals,s=[...i.collapsedSeries||[],...i.ancillaryCollapsedSeries||[]];if(!s.length)return t;const a=e.config.chart.type,r=("pie"===a||"donut"===a||"polarArea"===a)&&1===t.length&&t[0]&&"object"==typeof t[0]&&Array.isArray(t[0].data)?t[0].data:t;for(const e of s){const s=e.index;i.axisCharts?t[s]&&(t[s].data=Array.isArray(e.data)?e.data.slice():e.data):r[s]&&"object"==typeof r[s]?r[s].y=e.data:void 0!==r[s]&&(r[s]=e.data)}return t}_overrideFields(){const t=new Set,e=this.w.config.drilldown&&this.w.config.drilldown.series||[];for(const i of e)i&&(i.xaxis&&t.add("xaxis"),i.yaxis&&t.add("yaxis"),i.colors&&t.add("colors"),i.plotOptions&&t.add("plotOptions"),i.fill&&t.add("fill"),i.legend&&t.add("legend"));return t}_copyOptionalViewFields(t,e){e.xaxis&&(t.xaxis=e.xaxis),e.yaxis&&(t.yaxis=e.yaxis),e.colors&&(t.colors=e.colors),e.plotOptions&&(t.plotOptions=e.plotOptions),e.fill&&(t.fill=e.fill),e.legend&&(t.legend=e.legend)}_viewFromChild(t){const e={};Array.isArray(t.series)?e.series=t.series:e.series=[{name:t.name||"",data:t.data}];const i={};return t.chart&&t.chart.type&&(i.type=t.chart.type),t.chart&&null!=t.chart.stacked&&(i.stacked=t.chart.stacked),Object.keys(i).length&&(e.chart=i),this._copyOptionalViewFields(e,t),e}_viewFromSnapshot(t){const e={series:t.series,chart:t.chart};return t.labels&&t.labels.length&&(e.labels=t.labels),this._copyOptionalViewFields(e,t),e}_apply(t,e,i){const s=this.w;s.interact.selectedDataPoints=[],s.globals.collapsedSeries=[],s.globals.collapsedSeriesIndices=[],s.globals.ancillaryCollapsedSeries=[],s.globals.ancillaryCollapsedSeriesIndices=[],s.globals.allSeriesCollapsed=!1,s.globals.risingSeries=[],t.markers=l(o({},t.markers||{}),{discrete:this._drillMarkers(t.series)});const a=(!s.config.drilldown.animation||!1!==s.config.drilldown.animation.enabled)&&!1!==s.config.chart.animations.enabled;"down"===e&&this._fire("drillDownStart",i);const r=e=>this.ctx.updateOptions(t,!1,e,!1,!1),n=()=>(this._fire("down"===e?"drillDownEnd":"drillUp",i),this.ctx);if(a&&this._zoomEnabled()){const t=this._triggerOrigin(i);if(t)return this._zoomDrill(t,e,()=>r(!1)).then(n)}return r(a).then(n)}_zoomEnabled(){const t=this.w.config.drilldown&&this.w.config.drilldown.animation;return!(!t||!t.zoomFromPoint)}_svgNode(){const t=this.w.dom&&this.w.dom.Paper;return t&&t.node?t.node:null}_markGroup(){const t=this._svgNode();return t&&"function"==typeof t.querySelector?t.querySelector(".apexcharts-plot-series, .apexcharts-heatmap, .apexcharts-treemap"):null}_triggerOrigin(t){if(!d.isBrowser())return null;const e=this._svgNode(),i=this._markGroup();if(!e||!i||"function"!=typeof i.animate||"function"!=typeof e.getBoundingClientRect)return null;const s=e.getBoundingClientRect();let a=null;if(t&&null!=t.seriesIndex&&null!=t.dataPointIndex&&this.w.dom.baseEl&&(a=this.w.dom.baseEl.querySelector(`[index="${t.seriesIndex}"][j="${t.dataPointIndex}"]`)),a&&"function"==typeof a.getBoundingClientRect){const t=a.getBoundingClientRect();return{x:t.left+t.width/2-s.left,y:t.top+t.height/2-s.top}}const r=i.getBoundingClientRect();return{x:r.left+r.width/2-s.left,y:r.top+r.height/2-s.top}}_zoomDrill(t,e,i){return c(this,null,function*(){const s=this._zoomDuration(),a="down"===e,r=Math.round(.55*s),n=a?"scale(1.03)":"scale(0.97)",o=a?"scaleX(0.55) scaleY(0.85)":"scale(1.04)",l=e=>{e.style.transformBox="view-box",e.style.transformOrigin=`${t.x}px ${t.y}px`},h=this._markGroup();let c=null;if(h){l(h),c=h.animate([{transform:"scale(1)",opacity:1},{transform:n,opacity:0}],{duration:r,easing:"ease-in",fill:"forwards"});try{yield c.finished}catch(t){}}yield i();const d=this._markGroup();if(d){l(d),d.style.opacity="0",d.style.transform=o,c&&h===d&&c.cancel();const t=d.animate([{transform:o,opacity:0},{transform:"scale(1)",opacity:1}],{duration:s,easing:"cubic-bezier(0.16, 1, 0.3, 1)",fill:"forwards"});try{yield t.finished}catch(t){}(p=d).style.transform="",p.style.opacity="",p.style.transformOrigin="",p.style.transformBox="",t.cancel()}var p})}_zoomDuration(){const t=this.w.config.drilldown&&this.w.config.drilldown.animation,e=t&&"number"==typeof t.speed?t.speed:260;return Math.max(80,e)}_fire(t,e){const i=this.w.config.chart.events&&this.w.config.chart.events[t];"function"==typeof i&&i(e,this.ctx,this.w),this.ctx.events.fireEvent(t,[e,this.ctx,this.w])}_onPointSelect(t,e,i){if(!i)return;const s=this._pointAt(i.seriesIndex,i.dataPointIndex);return s&&"object"==typeof s&&null!=s.drilldown?this.drillDown(s.drilldown,s,i):"function"==typeof this.w.config.drilldown.onDrillDown?this._drillDownAsync(null,s,i):void 0}_pointAt(t,e){const i=this.w.config.series;if(!Array.isArray(i)||null==t||null==e)return null;const s=i[t];return s&&Array.isArray(s.data)&&null!=s.data[e]?s.data[e]:null}_afterRender(){const t=this.w;t.config.drilldown&&t.config.drilldown.enabled&&(this._markDrillableTargets(),this._wirePlotClick(),this.breadcrumb.render(this.path),t.config.markers&&(t.config.markers.discrete=this._drillMarkers(t.config.series)))}_markDrillableTargets(){if(!d.isBrowser())return;const t=this.w,e=t.dom.baseEl,i=t.config.series;if(!e||!Array.isArray(i))return;let s=0;i.forEach((t,i)=>{const a=t&&Array.isArray(t.data)?t.data:null;a&&a.forEach((t,a)=>{if(!t||"object"!=typeof t||null==t.drilldown)return;const r=e.querySelectorAll(`[index="${i}"][j="${a}"]`);r.length||s++,r.forEach(t=>{this._isClickThroughMark(t)&&t.classList.remove("no-pointer-events"),t.classList.add("apexcharts-drilldown-target")})})}),s&&!this._warnedUnreachable&&(this._warnedUnreachable=!0)}warnSliceOffsetDisabled(){this._warnedNoSliceOffset||(this._warnedNoSliceOffset=!0)}_wirePlotClick(){if(!d.isBrowser())return;const t=this.w.dom.baseEl;t&&this._plotClickWired!==t&&(this._plotClickWired&&(this._plotClickWired.removeEventListener("mousedown",this._onPlotDown),this._plotClickWired.removeEventListener("click",this._onPlotClick)),t.addEventListener("mousedown",this._onPlotDown),t.addEventListener("click",this._onPlotClick),this._plotClickWired=t)}_onPlotDown(t){this._downAt={x:t.clientX,y:t.clientY}}_onPlotClick(t){const e=this.w;if(!e.config.drilldown||!e.config.drilldown.enabled)return;const i=this._downAt;if(this._downAt=null,i&&Math.hypot(t.clientX-i.x,t.clientY-i.y)>4)return;const s=t.target;if(!s||"function"!=typeof s.closest)return;if(s.closest(".apexcharts-drilldown-target"))return;if(s.closest(".apexcharts-legend, .apexcharts-toolbar, .apexcharts-breadcrumb, .apexcharts-menu, .apexcharts-tooltip"))return;const a=e.interact.capturedSeriesIndex,r=e.interact.capturedDataPointIndex;if(null==a||null==r||a<0||r<0)return;if(!this._isPointBasedSeries(e.config.series[a]))return;const n=this._pointAt(a,r);return n&&"object"==typeof n&&null!=n.drilldown?this.drillDown(n.drilldown,n,{seriesIndex:a,dataPointIndex:r}):void 0}_isClickThroughMark(t){return!(!t.classList||!t.classList.contains("no-pointer-events"))&&(!!t.classList.contains("apexcharts-marker")&&!("function"==typeof t.closest&&t.closest(".apexcharts-tooltip")))}_drillMarkers(t){const e=this.w,i=e.config.drilldown,s=Array.isArray(e.config.markers&&e.config.markers.discrete)?e.config.markers.discrete.filter(t=>!t||!t[Xa]):[],a=i&&i.marker||{};if(!1===a.show||!Array.isArray(t))return s;const r=[];return t.forEach((t,e)=>{if(!this._seriesNeedsDrillMarker(e,t))return;const i=t&&Array.isArray(t.data)?t.data:null;i&&i.forEach((t,i)=>{if(!t||"object"!=typeof t||null==t.drilldown)return;const s={seriesIndex:e,dataPointIndex:i,[Xa]:!0};void 0!==a.size&&(s.size=a.size),void 0!==a.shape&&(s.shape=a.shape),void 0!==a.fillColor&&(s.fillColor=a.fillColor),void 0!==a.strokeColor&&(s.strokeColor=a.strokeColor),r.push(s)})}),s.concat(r)}_seriesNeedsDrillMarker(t,e){if(!this._isPointBasedSeries(e))return!1;const i=this.w.config.markers&&this.w.config.markers.size,s=Array.isArray(i)?i[t]:i;return!(Number(s)>0)}_isPointBasedSeries(t){const e=t&&t.type||this.w.config.chart.type;return"line"===e||"area"===e}}});const za=["updateOptions","updateSeries","appendData","appendSeries","toggleSeries","showSeries","hideSeries","highlightSeries","isSeriesHidden","zoomX","addXaxisAnnotation","addYaxisAnnotation","addPointAnnotation","clearAnnotations","removeAnnotation","dataURI","exportToCSV"];function Ba(t){const e={};return za.forEach(i=>{"function"==typeof t[i]&&(e[i]=t[i].bind(t))}),Object.freeze(e)}Ks.registerFeatures({weave:class{constructor(t,e){this.w=t,this.ctx=e,this.active=[],this._layers=new Map,this._currentScales=null,this._lastPluginsRef=null,this._lastData=null,this._updatedWired=!1,this._onUpdated=this._onUpdated.bind(this),this._init()}_init(){(this.w.config.plugins||[]).map((t,e)=>({entry:t,order:null!=t.order?t.order:e})).sort((t,e)=>t.order-e.order).forEach(t=>this._activate(t.entry)),this._lastPluginsRef=this.w.config.plugins,this._wireUpdated()}_wireUpdated(){this._updatedWired||(this.ctx.addEventListener("updated",this._onUpdated),this._updatedWired=!0)}_onUpdated(){this.dispatch("afterUpdate",{pass:"update"})}_activate(t){const e=(i=t.name,Ss()[i]||null);var i;if(!e)return;const s=null!=e.apiVersion?e.apiVersion:1;if(1!==Math.trunc(s))return;const a={def:e,options:Object.freeze(o({},t.options||{})),handlers:new Map,disabled:!1,failures:0,api:null};a.api=function(t,e){const i=t.ctx,s=t.w,a={name:e.def.name,version:1,get options(){return e.options},on(t,i){const s=e.handlers;return s.has(t)||s.set(t,[]),s.get(t).push(i),a},off(t,i){const s=e.handlers.get(t);if(s){const t=s.indexOf(i);t>-1&&s.splice(t,1)}return a},store:{},layer:i=>t._layer(e.def.name,i||{}),get scales(){return t._currentScales},get data(){return t._lastData||(t._lastData=t._dataSnapshot())},theme:Object.freeze({get mode(){return s.config.theme.mode},get foreColor(){return s.config.chart.foreColor},seriesColor:t=>s.globals.colors[t],token:e=>t._token(e)}),chart:Ba(i),emit(t,s){i.events.fireEvent(`plugin:${e.def.name}:${t}`,[i,s])},get el(){return s.dom.baseEl}};return Object.freeze(a)}(this,a),this.active.push(a),this._guard(a,"setup",()=>e.setup(a.api))}dispatch(t,e){if("draw"===t&&(this._reconcile(),this._resetLayers()),this._lastData=null,!this.active.length)return;"afterParse"===t?this._currentScales=null:e&&"xyRatios"in e&&this._setScales(e.xyRatios);const i=e&&e.pass||"full";let s=null;for(const e of this.active){if(e.disabled)continue;const a=e.handlers.get(t);if(!a||!a.length)continue;null===s&&(s=this._dataSnapshot(),this._lastData=s);const r={api:e.api,scales:this._currentScales,data:s,pass:i,hook:t};for(const i of a.slice())this._guard(e,t,()=>i(r))}}_guard(t,e,i){if(!t.disabled)try{i()}catch(e){t.failures=(t.failures||0)+1,t.failures>=3&&(t.disabled=!0)}}_setScales(t){const e=this.w,i=e.globals,s=e.layout;if(!t||!i.axisCharts)return void(this._currentScales=null);const a=t.xRatio,r=t.yRatio||[],n=t=>null!=i.maxYArr[t]?i.maxYArr[t]:i.maxY,o=t=>null!=i.minYArr[t]?i.minYArr[t]:i.minY;this._currentScales={x:t=>s.translateX+(t-i.minX)/a,y:(t,e=0)=>s.translateY+(n(e)-t)/(t=>null!=r[t]?r[t]:r[0])(e),domainX:[i.minX,i.maxX],domainY:(t=0)=>[o(t),n(t)],gridWidth:s.gridWidth,gridHeight:s.gridHeight,ratios:t}}_dataSnapshot(){const t=this.w,e=t.globals,i=t.seriesData.series||[],s=t.seriesData.seriesX||[];return i.map((t,i)=>{const a=s[i]||[],r=(t||[]).map((t,e)=>({x:null!=a[e]?a[e]:e,y:t}));return{name:e.seriesNames?e.seriesNames[i]:void 0,hidden:(e.collapsedSeriesIndices||[]).includes(i),color:e.colors?e.colors[i]:void 0,points:r}})}_token(t){const e=this.w,i=e.globals;switch(t){case"foreColor":return e.config.chart.foreColor;case"background":return e.config.chart.background;case"accent":case"primary":return i.colors?i.colors[0]:void 0;default:return/^series-\d+$/.test(t)&&i.colors?i.colors[Number(t.split("-")[1])]:void 0}}_layer(t,{z:e="front",className:i=""}={}){let s=this._layers.get(t);if(!s){s=this.ctx.graphics.group({class:`apexcharts-plugin-${t} ${i}`.trim()});const a=this.w.dom.elGraphical.node;"behind"===e?a.insertBefore(s.node,a.firstChild):a.appendChild(s.node),s.node.setAttribute("aria-hidden","true"),this._layers.set(t,s)}return function(t,e){const i=e=>(e&&t.add(e),e),s={get node(){return t.node},path(t={}){const{d:s="",stroke:a="#000",width:r=1,fill:n="none",opacity:o=1,dash:l=0,className:h=""}=t;return i(e.drawPath({d:s,stroke:a,strokeWidth:r,fill:n,fillOpacity:"none"===n?0:o,strokeOpacity:o,strokeDashArray:l,classes:h}))},line(t={}){const{x1:s,y1:a,x2:r,y2:n,stroke:o="#000",width:l=1,dash:h=0}=t;return i(e.drawLine(s,a,r,n,o,h,l))},rect(t={}){const{x:s=0,y:a=0,w:r=0,h:n=0,r:o=0,fill:l="#000",stroke:h=null,opacity:c=1}=t;return i(e.drawRect(s,a,r,n,o,l,c,null!=h?1:null,h))},circle(t={}){const{cx:s=0,cy:a=0,r:r=0,fill:n="#000",stroke:o=null}=t;return i(e.drawCircle(r,{cx:s,cy:a,fill:n,stroke:o||"none"}))},text(t={}){const{x:s=0,y:a=0,text:r="",color:n,size:o,anchor:l="start",weight:h}=t;return i(e.drawText({x:s,y:a,text:r,textAnchor:l,fontSize:o,foreColor:n,fontWeight:h}))},clear(){const e=t.node;for(;e.firstChild;)e.removeChild(e.firstChild);return s}};return s}(s,this.ctx.graphics)}_resetLayers(){const t=this.w.dom.elGraphical,e=t&&t.node;if(e){const t=e.querySelectorAll('g[class*="apexcharts-plugin-"]');Array.prototype.forEach.call(t,t=>t.remove())}this._layers.clear()}_reconcile(){const t=this.w.config.plugins||[];if(t===this._lastPluginsRef)return;this._lastPluginsRef=t;const e=new Map(t.map((t,e)=>[t.name,{entry:t,order:null!=t.order?t.order:e}]));for(let t=this.active.length-1;t>=0;t--){const i=this.active[t],s=e.get(i.def.name);s?i.options=Object.freeze(o({},s.entry.options||{})):(this._guard(i,"destroy",()=>i.def.destroy&&i.def.destroy(i.api)),this.active.splice(t,1))}const i=new Set(this.active.map(t=>t.def.name)),s=[];e.forEach((t,e)=>{i.has(e)||s.push(t)}),s.sort((t,e)=>t.order-e.order).forEach(t=>this._activate(t.entry))}teardown(t){if(!t){this.dispatch("destroy");for(const t of this.active)this._guard(t,"destroy",()=>t.def.destroy&&t.def.destroy(t.api));this.active=[],this._updatedWired&&(this.ctx.removeEventListener&&this.ctx.removeEventListener("updated",this._onUpdated),this._updatedWired=!1)}this._layers.clear()}}}),Ks._customSeriesFactory=function(t,e){const i=class{constructor(t,e,i){this.w=t,this.ctx=e,this.xyRatios=i,this._warned=!1}draw(t,i,s){var a,r;const n=this.w,o=new Dt(n,this.ctx),l=Et(this.ctx,o),h=o.group({class:"apexcharts-marks-series"});return t.forEach((t,i)=>{var a;const r=Array.isArray(s)?s[i]:i,c=o.group({class:"apexcharts-series",rel:r+1,seriesName:v.escapeString(n.seriesData.seriesNames[r]),"data:realIndex":r}),d=this._scales(r,(n.seriesData.series[r]||[]).length),p=n.globals.colors[r],u=(null==(a=n.config.series[r])?void 0:a.data)||[],g=n.seriesData.seriesX[r]||[],f=n.seriesData.series[r]||[];n.globals.seriesXvalues[r]=[],n.globals.seriesYvalues[r]=[],void 0===n.globals.pointsArray[r]&&(n.globals.pointsArray[r]=[]);for(let t=0;t<f.length;t++){const i=f[t];if(null==i)continue;const s=g[t],a=d.xAt(t,s),o=d.y(i),h=this._api(l,c,r,t);try{e.renderItem({datum:u[t],x:a,y:o,scales:d,api:h,seriesIndex:r,dataPointIndex:t,color:p})}catch(t){this._warned||(this._warned=!0)}n.globals.seriesXvalues[r][t]=a,n.globals.seriesYvalues[r][t]=o,n.globals.pointsArray[r][t]=[a,o]}o.setupEventDelegation(c,".apexcharts-marks-mark"),h.add(c)}),null==(r=null==(a=this.ctx.animations)?void 0:a.animationCompleted)||r.call(a,h),h}_scales(t,e){var i,s,a,r;const n=this.w.globals,o=this.w.config,l=this.xyRatios.xRatio,h=this.xyRatios.yRatio,c=null!=(s=null==(i=n.seriesYAxisReverseMap)?void 0:i[t])?s:0,d=Array.isArray(h)?null!=(a=h[c])?a:h[0]:h,p=n.maxYArr,u=Array.isArray(p)&&p.length&&null!=(r=p[c])?r:n.maxY,g=n.gridWidth,f=n.gridHeight,x=!n.isXNumeric,m=e||n.dataPoints||1,b=m>0?g/m:g,y="on"===o.xaxis.tickPlacement,w=t=>l?(t-n.minX)/l:g/2,v=n.minXDiff||1;return{x:w,xAt:(t,e)=>x?y&&m>1?t/(m-1)*g:(t+.5)*b:w(e),y:t=>(u-t)/d,gridWidth:g,gridHeight:f,band:x?b:l?v/l:g}}_api(t,e,i,s){const a=t=>{if(t){try{t.node.setAttribute("index",String(i)),t.node.setAttribute("j",String(s)),t.node.classList.add("apexcharts-marks-mark")}catch(t){}e.add(t)}return t};return{path:(e={})=>{var i,s,r,n,o,l,h,c,d;return a(t.drawPath({d:e.d||"",stroke:null!=(i=e.stroke)?i:"#000",strokeWidth:null!=(r=null!=(s=e.width)?s:e.strokeWidth)?r:1,fill:null!=(n=e.fill)?n:"none",fillOpacity:null!=(l=e.fillOpacity)?l:e.fill&&"none"!==e.fill?null!=(o=e.opacity)?o:1:0,strokeOpacity:null!=(c=null!=(h=e.strokeOpacity)?h:e.opacity)?c:1,strokeDashArray:null!=(d=e.dash)?d:0,strokeLinecap:e.lineCap}))},line:(e={})=>{var i,s,r,n;return a(t.drawLine(e.x1,e.y1,e.x2,e.y2,null!=(i=e.stroke)?i:"#000",null!=(s=e.dash)?s:0,null!=(n=null!=(r=e.width)?r:e.strokeWidth)?n:1))},rect:(e={})=>{var i,s,r,n,o,l,h,c;return a(t.drawRect(null!=(i=e.x)?i:0,null!=(s=e.y)?s:0,null!=(r=e.w)?r:0,null!=(n=e.h)?n:0,null!=(o=e.r)?o:0,null!=(l=e.fill)?l:"#000",null!=(h=e.opacity)?h:1,null!=e.stroke?null!=(c=e.strokeWidth)?c:1:null,e.stroke))},circle:(e={})=>{var i,s,r,n,o;return a(t.drawCircle(null!=(i=e.r)?i:0,{cx:null!=(s=e.cx)?s:0,cy:null!=(r=e.cy)?r:0,fill:null!=(n=e.fill)?n:"#000",stroke:e.stroke||"none","stroke-width":null!=(o=e.strokeWidth)?o:e.stroke?1:0}))},text:(e={})=>{var i,s,r,n;return a(t.drawText({x:null!=(i=e.x)?i:0,y:null!=(s=e.y)?s:0,text:null!=(r=e.text)?r:"",textAnchor:null!=(n=e.anchor)?n:"start",fontSize:e.size,foreColor:e.color,fontWeight:e.weight}))}}}};return i.dataType=e.dataType||"xy",i.yExtent="function"==typeof e.yExtent?e.yExtent:null,i};class Na{constructor(t,e){if(this.w=t,this.ctx=e,"os"!==t.config.theme.follow||!d.isBrowser())return;const i=this._ensureMedia();i&&(this._applyToConfig(i),this._ensureListeners(i))}_ensureMedia(){if(!this.ctx._osThemeMedia){const t=b.matchMedia("(prefers-color-scheme: dark)"),e=b.matchMedia("(prefers-contrast: more)");if(!t&&!e)return null;this.ctx._osThemeMedia={dark:t,contrast:e,handler:null}}return this.ctx._osThemeMedia}_applyToConfig(t){const e=this.w.config.theme;t.dark&&(e.mode=t.dark.matches?"dark":"light"),t.contrast&&t.contrast.matches&&(e.accessibility=e.accessibility||{},e.accessibility.colorBlindMode="highContrast")}_ensureListeners(t){if(t.handler)return;const e=this.ctx,i=()=>{const t=e._osThemeMedia;if(!t)return;const i={mode:t.dark&&t.dark.matches?"dark":"light"};t.contrast&&t.contrast.matches?i.accessibility={colorBlindMode:"highContrast"}:i.accessibility={colorBlindMode:""},e.updateOptions({theme:i},!1,!0,!1)};Na._add(t.dark,i),Na._add(t.contrast,i),t.handler=i}teardown(){const t=this.ctx._osThemeMedia;t&&(t.handler&&(Na._remove(t.dark,t.handler),Na._remove(t.contrast,t.handler)),this.ctx._osThemeMedia=null)}static _add(t,e){t&&("function"==typeof t.addEventListener?t.addEventListener("change",e):"function"==typeof t.addListener&&t.addListener(e))}static _remove(t,e){t&&("function"==typeof t.removeEventListener?t.removeEventListener("change",e):"function"==typeof t.removeListener&&t.removeListener(e))}}Ks.registerFeatures({osThemeWatcher:Na});function Ya(t,e){const i=t.length;if(0===i)return NaN;if(1===i)return t[0];const s=(i-1)*e,a=Math.floor(s),r=Math.ceil(s);return a===r?t[a]:t[a]+(t[r]-t[a])*(s-a)}function Oa(t){const e=t.length;if(e<2)return 0;let i=0;for(let s=0;s<e;s++)i+=t[s];const s=i/e;let a=0;for(let i=0;i<e;i++){const e=t[i]-s;a+=e*e}return Math.sqrt(a/e)}function Wa(t,e={}){if(!Array.isArray(t)||0===t.length)return null;const i=t.slice().sort((t,e)=>t-e);let s=i[0],a=i[i.length-1];const r=e.range;if(Array.isArray(r)&&2===r.length){const t=Number(r[0]),e=Number(r[1]);isFinite(t)&&isFinite(e)&&e>t&&(s=t,a=e)}if(!(a>s)){const t=Math.abs(s)>0?.05*Math.abs(s):.5;return{edges:[s-t,s+t],binWidth:2*t,rule:"single",capped:!1}}const n=a-s;let o,l;if("number"==typeof e.binWidth&&e.binWidth>0)o=e.binWidth,l="binWidth";else if("number"==typeof e.bins&&e.bins>=1)o=n/Math.floor(e.bins),l="count";else{const t=function(t,e,i){const s=t.length,a=t=>e/Math.max(1,Math.ceil(t));switch(i){case"sqrt":return{width:a(Math.sqrt(s)),rule:"sqrt"};case"rice":return{width:a(2*Math.cbrt(s)),rule:"rice"};case"scott":{const e=Oa(t);return e>0?{width:3.49*e*Math.pow(s,-1/3),rule:"scott"}:{width:a(Math.log2(s)+1),rule:"sturges"}}case"fd":{const e=Ya(t,.75)-Ya(t,.25);return e>0?{width:2*e*Math.pow(s,-1/3),rule:"fd"}:{width:a(Math.log2(s)+1),rule:"sturges"}}case"auto":{const e=a(Math.log2(s)+1),i=Ya(t,.75)-Ya(t,.25);if(i<=0)return{width:e,rule:"sturges"};const r=2*i*Math.pow(s,-1/3);return r<e?{width:r,rule:"fd"}:{width:e,rule:"sturges"}}default:return{width:a(Math.log2(s)+1),rule:"sturges"}}}(i,n,"string"==typeof e.bins?e.bins:"auto");o=t.width,l=t.rule}(!isFinite(o)||o<=0)&&(o=n);let h=Math.ceil(n/o);(!isFinite(h)||h<1)&&(h=1);let c=!1;h>1e3&&(h=1e3,o=n/h,c=!0),o=n/h;const d=new Array(h+1);for(let t=0;t<=h;t++)d[t]=s+t*o;return d[h]=Math.max(d[h],a),{edges:d,binWidth:o,rule:l,capped:c}}function Ha(t,e){const i=e.length-1;if(!(t>=e[0])||t>e[i])return-1;if(t===e[i])return i-1;const s=(e[i]-e[0])/i;if(s>0){let a=Math.floor((t-e[0])/s);return a<0&&(a=0),a>i-1&&(a=i-1),t<e[a]?a--:t>=e[a+1]&&a++,a<0||a>i-1?-1:a}let a=0,r=i-1;for(;a<=r;){const i=a+r>>1;if(t<e[i])r=i-1;else{if(!(t>=e[i+1]))return i;a=i+1}}return-1}function $a(t){const e=[];if(!Array.isArray(t))return e;for(let i=0;i<t.length;i++){const s=t[i];let a=s;Array.isArray(s)?a=1===s.length?s[0]:s[1]:s&&"object"==typeof s&&(a=void 0!==s.y?s.y:s.x);const r=v.parseNumber(a);null!==r&&isFinite(r)&&e.push(r)}return e}const Ga=new WeakSet;function ja(t,e){var i;if(!t||"object"!=typeof t||Array.isArray(t))return null;let s=null;if(Array.isArray(t.points)?s=t.points:Array.isArray(null==(i=t.y)?void 0:i.points)?s=t.y.points:e&&Array.isArray(t.y)&&"number"==typeof t.y[0]&&(s=t.y),!s)return null;const a=[];for(let t=0;t<s.length;t++){const e=v.parseNumber(s[t]);null!==e&&isFinite(e)&&a.push(e)}return a.length?a:null}function Va(t,e,i){const s=i&&null!=i.maxRows?i.maxRows:3e3,a=function(t,e){let i=0,s=0;for(const e of t)i+=e.length,e.length>s&&(s=e.length);if(i<=e)return{clusters:t,stride:1,total:i,kept:i};const a=e=>{let i=0;for(const s of t)i+=Math.ceil(s.length/e);return i};let r=Math.max(2,Math.ceil(i/e));for(;r<s&&a(r)>e;)r++;let n=0;return{clusters:t.map(t=>{const e=[];for(let i=0;i<t.length;i+=r)e.push(t[i]);return n+=e.length,e}),stride:r,total:i,kept:n}}(e.map(t=>t.rows),s);a.stride;const r=t.globals&&t.globals.colors||[];return e.map((t,e)=>{const i=r[t.realIndex]||r[0];return{name:t.name,data:a.clusters[e].map((s,a)=>o({id:`${t.realIndex}:${e}:${a}`,x:t.name,y:s},i?{fillColor:i}:{}))}})}function Ua(t){if(!isFinite(t))return String(t);const e=Math.round(t);return Math.abs(t-e)<1e-6?String(e):String(Number(t.toFixed(2)))}function qa(t){return(e,i)=>{var s;const a=t(e);if(!Array.isArray(a)||!a.length)return null;const r=e.globals&&e.globals.collapsedSeriesIndices||[],n=e.globals&&((null==(s=e.globals.categoryLabels)?void 0:s.length)?e.globals.categoryLabels:e.globals.labels)||[],o=[];return a.forEach((t,i)=>{var s;if(-1!==r.indexOf(i))return;if(!Array.isArray(t))return;const l=e.seriesData&&(null==(s=e.seriesData.seriesNames)?void 0:s[i]);t.forEach((t,e)=>{const s=null!=n[e]?String(n[e]):`#${e+1}`;o.push({name:a.length>1&&l?`${l} ${s}`:s,realIndex:i,rows:Array.isArray(t)?t.slice():[]})})}),o.length?Va(e,o,i):null}}const Za=qa(t=>{var e;return null==(e=t.candleData)?void 0:e.seriesBoxPoints}),Ka=qa(t=>{var e;return null==(e=t.violinData)?void 0:e.seriesViolinPoints});Si("histogram",function(t,e){var i;const s=e.config,a=e.globals;if(!Array.isArray(t))return t;a.histogramRawSeries||(a.histogramRawSeries=t.map(t=>l(o({},t),{data:Array.isArray(null==t?void 0:t.data)?t.data.slice():null==t?void 0:t.data})));const r=a.histogramRawSeries,n=(null==(i=s.plotOptions)?void 0:i.histogram)||{},h=r.map(t=>$a(null==t?void 0:t.data));let c=[];if(1===h.length)c=h[0];else for(const t of h)c=c.concat(t);const d=Wa(c,{bins:n.bins,binWidth:n.binWidth,range:n.range});if(!d)return e.histogramData={edges:[],binWidth:0,counts:[],rule:"",capped:!1},r;const{edges:p,binWidth:u}=d,g=h.map(t=>function(t,e){const i=new Array(Math.max(0,e.length-1)).fill(0);for(let s=0;s<t.length;s++){const a=Ha(t[s],e);a>=0&&i[a]++}return i}(t,p));e.histogramData={edges:p,binWidth:u,counts:g,rule:d.rule,capped:d.capped};const f=a.collapsedSeriesIndices||[];return r.map((t,e)=>{if(-1!==f.indexOf(e))return l(o({},t),{data:[]});const i=function(t,e={}){let i=t.slice();if(e.cumulative){let t=0;i=i.map(e=>t+=e)}const s=t.reduce((t,e)=>t+e,0);if(s<=0)return i;if("relative"===e.normalize)return i.map(t=>t/s*100);if("density"===e.normalize){const t=e.binWidth;if("number"==typeof t&&t>0)return i.map(e=>e/(s*t))}return i}(g[e],{normalize:n.normalize,cumulative:n.cumulative,binWidth:u}),s=[];for(let t=0;t<i.length;t++)s.push({x:(p[t]+p[t+1])/2,y:i[t]});return l(o({},t),{data:s})})}),Si("boxPlot",function(t,e){var i,s;if(!Array.isArray(t))return t;const a=(null==(s=null==(i=e.config.plotOptions)?void 0:i.boxPlot)?void 0:s.whiskers)||"minmax";return t.map(t=>{if(!Array.isArray(null==t?void 0:t.data))return t;let e=!1;const i=t.data.map(t=>{if(Array.isArray(null==t?void 0:t.y)&&5===t.y.length&&!Ga.has(t))return t;const i=ja(t,!1);if(!i)return t;const s=function(t,e={}){if(!Array.isArray(t)||0===t.length)return null;const i=t.slice().sort((t,e)=>t-e),s=Ya(i,.25),a=Ya(i,.5),r=Ya(i,.75),n=r-s;let o=i[0],l=i[i.length-1],h=[];if("tukey"===e.whiskers&&n>0){const t=s-1.5*n,e=r+1.5*n;let a=0;for(;a<i.length&&i[a]<t;)a++;let c=i.length-1;for(;c>=0&&i[c]>e;)c--;a<=c&&(o=i[a],l=i[c],h=i.slice(0,a).concat(i.slice(c+1)))}return{summary:[o,s,a,r,l],outliers:h,iqr:n}}(i,{whiskers:a});if(!s)return t;e=!0;const r=l(o({},t),{y:s.summary,points:i});return Ga.add(r),r});return e?l(o({},t),{data:i}):t})}),Si("violin",function(t,e){var i,s;if(!Array.isArray(t))return t;const a=(null==(s=null==(i=e.config.plotOptions)?void 0:i.violin)?void 0:s.kde)||{};return t.map(t=>{if(!Array.isArray(null==t?void 0:t.data))return t;let e=!1;const i=t.data.map(t=>{var i;if(Array.isArray(null==(i=null==t?void 0:t.y)?void 0:i.density)&&t.y.density.length&&!Ga.has(t))return t;const s=ja(t,!0);if(!s)return t;const r=function(t,e={}){if(!Array.isArray(t)||0===t.length)return null;const i=t.slice().sort((t,e)=>t-e),s=i.length;let a=e.bandwidth;if(!("number"==typeof a&&a>0)){const t=Oa(i),e=Ya(i,.75)-Ya(i,.25);a=.9*(e>0?Math.min(t,e/1.349):t)*Math.pow(s,-.2)}if(!isFinite(a)||a<=0){const t=i[0],e=Math.abs(t)>0?.001*Math.abs(t):.001;return{density:[[t-e,0],[t,1],[t+e,0]],bandwidth:e}}const r=Math.max(8,Math.floor(e.resolution||64)),n=i[0]-2*a,o=(i[s-1]+2*a-n)/(r-1),l=1/(s*a*Math.sqrt(2*Math.PI)),h=[];for(let t=0;t<r;t++){const e=n+t*o;let r=0;for(let t=0;t<s;t++){const s=(e-i[t])/a;r+=Math.exp(-.5*s*s)}h.push([e,r*l])}return{density:h,bandwidth:a}}(s,{bandwidth:a.bandwidth,resolution:a.resolution});if(!r)return t;e=!0;const n=l(o({},t),{y:{density:r.density,points:s}});return Ga.add(n),n});return e?l(o({},t),{data:i}):t})}),ws("histogram",function(t,e){const i=t.globals,s=t.histogramData,a=i&&i.histogramRawSeries;if(!s||!Array.isArray(s.edges)||s.edges.length<2)return null;if(!Array.isArray(a)||!a.length)return null;const r=i&&i.collapsedSeriesIndices||[],n=s.edges,o=[];return a.forEach((e,i)=>{var s;if(-1!==r.indexOf(i))return;const l=function(t,e){const i=Math.max(0,e.length-1),s=new Array(i);for(let t=0;t<i;t++)s[t]=[];for(let i=0;i<t.length;i++){const a=Ha(t[i],e);a>=0&&s[a].push(t[i])}return s}($a(e&&e.data),n),h=t.seriesData&&(null==(s=t.seriesData.seriesNames)?void 0:s[i])||(null==e?void 0:e.name);l.forEach((t,e)=>{const s=`${Ua(n[e])}-${Ua(n[e+1])}`;o.push({name:a.length>1&&h?`${h} ${s}`:s,realIndex:i,rows:t})})}),o.length?Va(t,o,e):null}),ws("boxPlot",Za),ws("violin",Ka);class Ja{constructor(t){this.w=t.w,this.barCtx=t,this.totalFormatter=this.w.config.plotOptions.bar.dataLabels.total.formatter,this.totalFormatter||(this.totalFormatter=this.w.config.dataLabels.formatter)}handleBarDataLabels(t){const{x:e,y:i,y1:s,y2:a,i:r,j:n,realIndex:h,columnGroupIndex:c,series:d,barHeight:p,barWidth:u,barXPosition:g,barYPosition:f,visibleSeries:x}=t,m=this.w,b=new Dt(this.barCtx.w),y=Array.isArray(this.barCtx.strokeWidth)?this.barCtx.strokeWidth[h]:this.barCtx.strokeWidth;let w,v;m.axisFlags.isXNumeric&&!m.globals.isBarHorizontal?(w=e+u*(x+1),v=i+p*(x+1)-y):(w=e+u*x,v=i+p*x);let A=null,S=null,C=e,k=i,_={};const M=m.config.dataLabels,D=this.barCtx.barOptions.dataLabels,L=this.barCtx.barOptions.dataLabels.total;void 0!==f&&(this.barCtx.isRangeBar||this.barCtx.isPyramid)&&(v=f,k=f),void 0!==g&&this.barCtx.isVerticalGroupedRangeBar&&(w=g,C=g);const P=Rt(M.offsetX,m,h,n),E=Rt(M.offsetY,m,h,n);let T={width:0,height:0};if(m.config.dataLabels.enabled){const t=m.seriesData.series[h][n];T=b.getTextRects(m.config.dataLabels.formatter?m.config.dataLabels.formatter(t,l(o({},m),{seriesIndex:h,dataPointIndex:n,w:m})):m.formatters.yLabelFormatters[0](t),parseFloat(M.style.fontSize).toString(),M.style.fontFamily,void 0,!0,M.style.fontWeight)}const F={x:e,y:i,i:r,j:n,realIndex:h,columnGroupIndex:c,bcx:w,bcy:v,barHeight:p,barWidth:u,textRects:T,strokeWidth:y,dataLabelsX:C,dataLabelsY:k,dataLabelsConfig:M,barDataLabelsConfig:D,barTotalDataLabelsConfig:L,offX:P,offY:E};return _=this.barCtx.isHorizontal?this.calculateBarsDataLabelsPosition(F):this.calculateColumnsDataLabelsPosition(F),A=this.drawCalculatedDataLabels({x:_.dataLabelsX,y:_.dataLabelsY,val:this.barCtx.isRangeBar?[s,a]:"100%"===m.config.chart.stackType?d[h][n]:m.seriesData.series[h][n],i:h,j:n,barWidth:u,barHeight:p,textRects:T,dataLabelsConfig:M}),m.config.chart.stacked&&L.enabled&&(S=this.drawTotalDataLabels({x:_.totalDataLabelsX,y:_.totalDataLabelsY,barWidth:u,barHeight:p,realIndex:h,j:n,textAnchor:_.totalDataLabelsAnchor,val:this.getStackedTotalDataLabel({realIndex:h,j:n}),rawVal:this.getStackedTotalValue({realIndex:h,j:n}),dataLabelsConfig:M,barTotalDataLabelsConfig:L})),{dataLabelsPos:_,dataLabels:A,totalDataLabels:S}}hasMultipleSeriesGroups(){return this.w.labelData.seriesGroups.length>1}getTotalGroupContext(t){if(!this.hasMultipleSeriesGroups())return null;const e=this.barCtx.barHelpers.getSeriesGroupIndex(t);return e<0?null:{groupIndex:e,group:this.w.labelData.seriesGroups[e]}}drawsStackedTotal(t){const e=this.barCtx.lastActiveBarSerieIndexByGroup,i=this.getTotalGroupContext(t);return i&&e&&e.length>i.groupIndex?e[i.groupIndex]===t:this.barCtx.lastActiveBarSerieIndex===t}getStackedTotalValue({realIndex:t,j:e}){const i=this.w,s=this.getTotalGroupContext(t),a=i.seriesData.stackedSeriesTotalsByGroups;return s&&a&&a[s.groupIndex]?a[s.groupIndex][e]:this.barCtx.stackedSeriesTotals[e]}getStackedTotalDataLabel({realIndex:t,j:e}){const i=this.w;let s=this.getStackedTotalValue({realIndex:t,j:e});return this.totalFormatter&&(s=this.totalFormatter(s,l(o({},i),{seriesIndex:t,dataPointIndex:e,w:i}))),s}calculateColumnsDataLabelsPosition(t){const e=this.w;let i,s,{i:a,j:r,realIndex:n,y:o,bcx:l,barWidth:h,barHeight:c,textRects:d,dataLabelsX:p,dataLabelsY:u,dataLabelsConfig:g,barDataLabelsConfig:f,barTotalDataLabelsConfig:x,strokeWidth:m,offX:b,offY:y}=t;const w=l;c=Math.abs(c);const v="vertical"===e.config.plotOptions.bar.dataLabels.orientation,{zeroEncounters:A}=this.barCtx.barHelpers.getZeroValueEncounters({i:a,j:r});l-=m/2;const S=e.layout.gridWidth/e.globals.dataPoints;if(this.barCtx.isVerticalGroupedRangeBar?p+=h/2:(p=e.axisFlags.isXNumeric?l-h/2+b:l-S+h/2+b,!e.config.chart.stacked&&A>0&&e.config.plotOptions.bar.hideZeroBarsWhenGrouped&&(p-=h*A)),v){const t=2;p=p+d.height/2-m/2-t}const C=e.seriesData.series[a][r]<0;let k=o;switch(this.barCtx.isReversed&&(k=o+(C?c:-c)),f.position){case"center":u=v?C?k-c/2+y:k+c/2-y:C?k-c/2+d.height/2+y:k+c/2+d.height/2-y;break;case"bottom":u=v?C?k-c+y:k+c-y:C?k-c+d.height+m+y:k+c-d.height/2+m-y;break;case"top":u=v?C?k+y:k-y:C?k-d.height/2-y:k+d.height+y}let _=k;const M=this.getTotalGroupContext(n);if((M?[M.group]:e.labelData.seriesGroups).forEach(t=>{var e;null==(e=this.barCtx[t.join(",")])||e.prevY.forEach(t=>{_=C?Math.max(t[r],_):Math.min(t[r],_)})}),this.drawsStackedTotal(n)&&x.enabled){const t=18,a=new Dt(this.barCtx.w).getTextRects(this.getStackedTotalDataLabel({realIndex:n,j:r}),g.fontSize);i=C?_-a.height/2-y-x.offsetY+t:_+a.height+y+x.offsetY-t;const o=S;s=w+(e.axisFlags.isXNumeric?-h/2:h/2-o)+x.offsetX}return e.config.chart.stacked||(u<0?u=0+m:u+d.height/3>e.layout.gridHeight&&(u=e.layout.gridHeight-m)),{bcx:l,bcy:o,dataLabelsX:p,dataLabelsY:u,totalDataLabelsX:s,totalDataLabelsY:i,totalDataLabelsAnchor:"middle"}}calculateBarsDataLabelsPosition(t){var e;const i=this.w;let{x:s,i:a,j:r,realIndex:n,bcy:o,barHeight:l,barWidth:h,textRects:c,dataLabelsX:d,strokeWidth:p,dataLabelsConfig:u,barDataLabelsConfig:g,barTotalDataLabelsConfig:f,offX:x,offY:m}=t;const b=i.layout.gridHeight/i.globals.dataPoints,{zeroEncounters:y}=this.barCtx.barHelpers.getZeroValueEncounters({i:a,j:r});let w,v,A;if(h=Math.abs(h),this.barCtx.isPyramid){w=o+l/2+m-(null!=(e=c.centerOffset)?e:0)}else w=o-(this.barCtx.isRangeBar?0:b)+l/2+c.height/2+m-3;!i.config.chart.stacked&&y>0&&i.config.plotOptions.bar.hideZeroBarsWhenGrouped&&(w-=l*y);let S="start";const C=i.seriesData.series[a][r]<0;let k=s;if(this.barCtx.isReversed&&(k=s+(C?-h:h),S=C?"start":"end"),this.barCtx.isPyramid)d=i.layout.gridWidth/2+x;else switch(g.position){case"center":d=C?k+h/2-x:Math.max(c.width/2,k-h/2)+x;break;case"bottom":d=C?k+h-p-x:k-h+p+x;break;case"top":d=C?k-p-x:k-p+x}let _=k;const M=this.getTotalGroupContext(n);if((M?[M.group]:i.labelData.seriesGroups).forEach(t=>{var e;null==(e=this.barCtx[t.join(",")])||e.prevX.forEach(t=>{_=C?Math.min(t[r],_):Math.max(t[r],_)})}),this.drawsStackedTotal(n)&&f.enabled){const t=new Dt(this.barCtx.w).getTextRects(this.getStackedTotalDataLabel({realIndex:n,j:r}),u.fontSize);C?(v=_-p-x-f.offsetX,S="end"):v=_+x+f.offsetX+(this.barCtx.isReversed?-(h+p):p),A=w-c.height/2+t.height/2+f.offsetY+p,i.globals.barGroups.length>1&&!M&&(A-=i.globals.barGroups.length/2*(l/2))}if(!i.config.chart.stacked){const t=C&&"middle"!==u.textAnchor?"start"===u.textAnchor?"end":"start":u.textAnchor;let e;e="vertical"===g.orientation?c.height/2:"end"===t?c.width:"middle"===t?c.width/2:0;const s=("vertical"===g.orientation?c.height:c.width)-e;d+s>i.layout.gridWidth-p&&(d=i.layout.gridWidth-s-p),d-e<p&&(d=e+p)}return{bcx:s,bcy:o,dataLabelsX:d,dataLabelsY:w,totalDataLabelsX:v,totalDataLabelsY:A,totalDataLabelsAnchor:S}}drawCalculatedDataLabels({x:t,y:e,val:i,i:s,j:a,textRects:r,barHeight:n,barWidth:h,dataLabelsConfig:c}){var d,p,u;const g=this.w;let f="rotate(0)";"vertical"===g.config.plotOptions.bar.dataLabels.orientation&&(f=`rotate(-90, ${t}, ${e})`);const x=new Xt(this.barCtx.w,this.barCtx.ctx),m=new Dt(this.barCtx.w),b=c.formatter;let y=null;const w=g.globals.collapsedSeriesIndices.indexOf(s)>-1,v=(g.globals.collapsingSeriesIndices||[]).indexOf(s)>-1;if(v){const t=null==(d=g.globals.prevDataLabels)?void 0:d.get(`${s}::${ne(g,s,a)}`);t&&isFinite(t.val)&&(i=t.val)}if(c.enabled&&(!w||v)){y=m.group({class:"apexcharts-data-labels",transform:f});const d=g.config.dataLabels;((null==(p=d.animate)?void 0:p.enabled)||(null==(u=d.countUp)?void 0:u.enabled))&&(y.node.setAttribute("data:dlKey",`${s}::${ne(g,s,a)}`),y.node.setAttribute("data:dlJ",String(a)),"number"==typeof i&&isFinite(i)&&y.node.setAttribute("data:dlVal",String(i)));let w="";void 0!==i&&(w=b(i,l(o({},g),{seriesIndex:s,dataPointIndex:a,w:g}))),!i&&g.config.plotOptions.bar.hideZeroBarsWhenGrouped&&(w="");const A=g.seriesData.series[s][a]<0,S=g.config.plotOptions.bar.dataLabels.position;if("vertical"===g.config.plotOptions.bar.dataLabels.orientation&&("top"===S&&(c.textAnchor=A?"end":"start"),"center"===S&&(c.textAnchor="middle"),"bottom"===S&&(c.textAnchor=A?"end":"start")),this.barCtx.isRangeBar&&this.barCtx.barOptions.dataLabels.hideOverflowingLabels){h<m.getTextRects(w,parseFloat(c.style.fontSize).toString()).width&&(w="")}g.config.chart.stacked&&this.barCtx.barOptions.dataLabels.hideOverflowingLabels&&!v&&(this.barCtx.isHorizontal?r.width/1.6>Math.abs(h)&&(w=""):r.height/1.6>Math.abs(n)&&(w=""));const C=o({},c);this.barCtx.isHorizontal&&i<0&&("start"===c.textAnchor?C.textAnchor="end":"end"===c.textAnchor&&(C.textAnchor="start")),x.plotDataLabelsText({x:t,y:e,text:w,i:s,j:a,parent:y,dataLabelsConfig:C,alwaysDrawDataLabel:!0,offsetCorrection:!0})}return y}drawTotalDataLabels({x:t,y:e,val:i,rawVal:s,realIndex:a,j:r,textAnchor:n,barTotalDataLabelsConfig:o}){var l,h;const c=new Dt(this.barCtx.w);let d;if(o.enabled&&void 0!==t&&void 0!==e&&this.drawsStackedTotal(a)){d=c.drawText({x:t,y:e,foreColor:o.style.color,text:i,textAnchor:n,fontFamily:o.style.fontFamily,fontSize:o.style.fontSize,fontWeight:o.style.fontWeight}),d.attr({class:"apexcharts-datalabel-total",cx:t,cy:e});const p=this.w.config.dataLabels;if((null==(l=p.animate)?void 0:l.enabled)||(null==(h=p.countUp)?void 0:h.enabled)){const{groupIndex:t}=this.barCtx.barHelpers.getGroupIndex(a);d.node.setAttribute("data:dlTotalKey",`${t}::${ne(this.w,a,r)}`),d.node.setAttribute("data:dlTotalSeries",String(a)),"number"==typeof s&&isFinite(s)&&d.node.setAttribute("data:dlTotalVal",String(s))}}return d}}function Qa(t){var e,i,s,a,r,n,o;return"histogram"===(null==(i=null==(e=null==t?void 0:t.config)?void 0:e.chart)?void 0:i.requestedType)&&(!1!==(null==(a=null==(s=t.config.plotOptions)?void 0:s.histogram)?void 0:a.overlap)&&(null!=(o=null==(n=null==(r=t.seriesData)?void 0:r.series)?void 0:n.length)?o:0)>1)}let tr=class{constructor(t){this.w=t.w,this.barCtx=t}initVariables(t){const e=this.w;this.barCtx.series=t,this.barCtx.totalItems=0,this.barCtx.seriesLen=0,this.barCtx.visibleI=-1,this.barCtx.visibleItems=1;for(let i=0;i<t.length;i++)if(t[i].length>0&&(this.barCtx.seriesLen=this.barCtx.seriesLen+1,this.barCtx.totalItems+=t[i].length),e.axisFlags.isXNumeric)for(let s=0;s<t[i].length;s++)e.seriesData.seriesX[i][s]>e.globals.minX&&e.seriesData.seriesX[i][s]<e.globals.maxX&&this.barCtx.visibleItems++;else this.barCtx.visibleItems=e.globals.dataPoints;this.arrBorderRadius=this.createBorderRadiusArr(e.seriesData.series),v.isSafari()&&(this.arrBorderRadius=this.arrBorderRadius.map(t=>t.map(t=>"none"))),0===this.barCtx.seriesLen&&(this.barCtx.seriesLen=1)}initialPositions(t){const e=this.w;let i,s,a,r,n,o,l,h,c=e.globals.dataPoints;this.barCtx.isRangeBar&&(c=e.labelData.labels.length);let d=this.barCtx.seriesLen;if((e.config.plotOptions.bar.rangeBarGroupRows||Qa(e))&&(d=1),this.barCtx.isHorizontal)a=e.layout.gridHeight/c,n=a/d,e.axisFlags.isXNumeric&&(a=e.layout.gridHeight/this.barCtx.totalItems,n=a/this.barCtx.seriesLen),n=n*parseInt(this.barCtx.barOptions.barHeight,10)/100,-1===String(this.barCtx.barOptions.barHeight).indexOf("%")&&(n=parseInt(this.barCtx.barOptions.barHeight,10)),h=this.barCtx.baseLineInvertedY+e.globals.padHorizontal+(this.barCtx.isReversed?e.layout.gridWidth:0)-(this.barCtx.isReversed?2*this.barCtx.baseLineInvertedY:0),this.barCtx.isFunnel&&(h=e.layout.gridWidth/2),s=(a-n*this.barCtx.seriesLen)/2;else{if(r=e.layout.gridWidth/this.barCtx.visibleItems,e.config.xaxis.convertedCatToNumeric&&(r=e.layout.gridWidth/e.globals.dataPoints),o=r/d*parseInt(this.barCtx.barOptions.columnWidth,10)/100,e.axisFlags.isXNumeric){const t=this.barCtx.xRatio;e.globals.minXDiff&&.5!==e.globals.minXDiff&&e.globals.minXDiff/t>0&&(r=e.globals.minXDiff/t),o=r/d*parseInt(this.barCtx.barOptions.columnWidth,10)/100,o<1&&(o=1)}if(-1===String(this.barCtx.barOptions.columnWidth).indexOf("%")&&(o=parseInt(this.barCtx.barOptions.columnWidth,10)),l=e.layout.gridHeight-this.barCtx.baseLineY[this.barCtx.translationsIndex]-(this.barCtx.isReversed?e.layout.gridHeight:0)+(this.barCtx.isReversed?2*this.barCtx.baseLineY[this.barCtx.translationsIndex]:0),e.axisFlags.isXNumeric){i=this.barCtx.getBarXForNumericXAxis({x:i,j:0,realIndex:t,barWidth:o}).x}else i=e.globals.padHorizontal+v.noExponents(r-o*this.barCtx.seriesLen)/2}return e.globals.barHeight=n,e.globals.barWidth=o,{x:i,y:s,yDivision:a,xDivision:r,barHeight:n,barWidth:o,zeroH:l,zeroW:h}}initializeStackedPrevVars(t){t.w.labelData.seriesGroups.forEach(e=>{t[e]||(t[e]={}),t[e].prevY=[],t[e].prevX=[],t[e].prevYF=[],t[e].prevXF=[],t[e].prevYVal=[],t[e].prevXVal=[]})}initializeStackedXYVars(t){t.w.labelData.seriesGroups.forEach(e=>{t[e]||(t[e]={}),t[e].xArrj=[],t[e].xArrjF=[],t[e].xArrjVal=[],t[e].yArrj=[],t[e].yArrjF=[],t[e].yArrjVal=[]})}getPathFillColor(t,e,i,s){var a,r,n,o;const l=this.w,h=new Lt(this.barCtx.w);let c=null;const d=this.barCtx.barOptions.distributed?i:e;let p=!1;if(this.barCtx.barOptions.colors.ranges.length>0){this.barCtx.barOptions.colors.ranges.map(s=>{t[e][i]>=s.from&&t[e][i]<=s.to&&(c=s.color,p=!0)})}return{color:h.fillPath({seriesNumber:this.barCtx.barOptions.distributed?d:s,dataPointIndex:i,color:c,value:t[e][i],fillConfig:null==(a=l.config.series[e].data[i])?void 0:a.fill,fillType:(null==(n=null==(r=l.config.series[e].data[i])?void 0:r.fill)?void 0:n.type)?null==(o=l.config.series[e].data[i])?void 0:o.fill.type:Array.isArray(l.config.fill.type)?l.config.fill.type[s]:l.config.fill.type}),useRangeColor:p}}getStrokeWidth(t,e,i){let s=0;const a=this.w;return void 0===this.barCtx.series[t][e]||null===this.barCtx.series[t][e]||"bar"===a.config.chart.type&&!this.barCtx.series[t][e]?this.barCtx.isNullValue=!0:this.barCtx.isNullValue=!1,a.config.stroke.show&&(this.barCtx.isNullValue||(s=Array.isArray(this.barCtx.strokeWidth)?this.barCtx.strokeWidth[i]:this.barCtx.strokeWidth)),s}getStackedSeriesIndices(t){const e=this.w.labelData.seriesGroups;if(!e||e.length<2)return[Array.from({length:t},(t,e)=>e)];const i=Array.from({length:e.length},()=>[]),s=[];for(let e=0;e<t;e++){const t=this.getSeriesGroupIndex(e);t>-1?i[t].push(e):s.push(e)}return s.length&&i.push(s),i.filter(t=>t.length>0)}createBorderRadiusArr(t){var e;const i=this.w,s=!this.w.config.chart.stacked||i.config.plotOptions.bar.borderRadius<=0,a=t.length,r=0|(null==(e=t[0])?void 0:e.length),n=Array.from({length:a},()=>Array(r).fill(s?"top":"none"));if(s)return n;const o="bar"===this.w.config.chart.type&&1===r,l=o?"top":"both",h=o?"top":"bottom";for(const e of this.getStackedSeriesIndices(a))for(let i=0;i<r;i++){const s=[],a=[];for(const r of e){const e=t[r][i];e>0?s.push(r):e<0&&a.push(r)}if(s.length>0&&0===a.length)if(1===s.length)n[s[0]][i]=l;else{const t=s[0],e=s[s.length-1];for(const a of s)n[a][i]=a===t?h:a===e?"top":"none"}else if(a.length>0&&0===s.length)if(1===a.length)n[a[0]][i]="both";else{const t=Math.max(...a),e=Math.min(...a);for(const s of a)n[s][i]=s===t?"bottom":s===e?"top":"none"}else if(s.length>0&&a.length>0){const t=s[s.length-1];for(const e of s)n[e][i]=e===t?"top":"none";const e=Math.max(...a);for(const t of a)n[t][i]=t===e?"bottom":"none"}}return n}barBackground({j:t,i:e,x1:i,x2:s,y1:a,y2:r,elSeries:n}){const o=this.w,l=new Dt(this.barCtx.w),h=new Be(this.barCtx.w).getActiveConfigSeriesIndex();if(this.barCtx.barOptions.colors.backgroundBarColors.length>0&&h===e){t>=this.barCtx.barOptions.colors.backgroundBarColors.length&&(t%=this.barCtx.barOptions.colors.backgroundBarColors.length);const e=this.barCtx.barOptions.colors.backgroundBarColors[t],h=l.drawRect(void 0!==i?i:0,void 0!==a?a:0,void 0!==s?s:o.layout.gridWidth,void 0!==r?r:o.layout.gridHeight,this.barCtx.barOptions.colors.backgroundBarRadius,e,this.barCtx.barOptions.colors.backgroundBarOpacity);n.add(h),h.node.classList.add("apexcharts-backgroundBar")}}getColumnPaths({barWidth:t,barXPosition:e,y1:i,y2:s,strokeWidth:a,isReversed:r,series:n,seriesGroup:o,realIndex:l,i:h,j:c,w:d}){var p,u,g;const f=new Dt(this.barCtx.w);(a=Array.isArray(a)?a[l]:a)||(a=0);let x=t,m=e;(null==(p=d.config.series[l].data[c])?void 0:p.columnWidthOffset)&&(m=e-d.config.series[l].data[c].columnWidthOffset/2,x=t+d.config.series[l].data[c].columnWidthOffset);const b=a/2,y=m+b,w=m+x-b,v=(n[h][c]>=0?1:-1)*(r?-1:1);i+=.001-b*v,s+=.001+b*v;const A=f.line(w,i),S="around"===d.config.plotOptions.bar.borderRadiusApplication||"both"===this.arrBorderRadius[l][c]?" Z":" z",C=f.move(y,i)+f.line(y,s)+f.line(w,s)+A+S;let k=C;"none"!==this.arrBorderRadius[l][c]&&(k=f.roundPathCorners(k,d.config.plotOptions.bar.borderRadius));let _=null;const M=null==(g=null==(u=this.barCtx.ctx)?void 0:u.morphTypeChange)?void 0:g.getInitialPathFor(l,c);if(M?_=M:d.globals.previousPaths.length>0&&(_=this.barCtx.getPreviousPath(l,c,k,C)),null==_&&(_=f.move(y,i)+f.line(y,i)+A+A+A+A+A+f.line(y,i)+S),d.config.chart.stacked){let t=this.barCtx;t=this.barCtx[o],t.yArrj.push(s-b*v),t.yArrjF.push(Math.abs(i-s+a*v)),t.yArrjVal.push(this.barCtx.series[h][c])}return{pathTo:k,pathFrom:_}}getFunnelTrapezoidPaths({barYPosition:t,barHeight:e,series:i,i:s,j:a,realIndex:r,strokeWidth:n,w:o}){var l,h;const c=new Dt(this.barCtx.w),d=o.layout.gridWidth/2,p=t=>Math.abs(t/this.barCtx.invertedYRatio)/2,u=p(i[s][a]),g=a===i[s].length-1,f="taper"===o.config.plotOptions.funnel.lastShape?"taper":"flat";let x;x=g?"taper"===f?0:u:p(i[s][a+1]);const m=n/2,b=t+m,y=t+e-m,w=d-u,v=d+u,A=d-x,S=d+x,C=c.move(w,b)+c.line(v,b)+c.line(S,y)+c.line(A,y)+" Z";let k=null;const _=null==(h=null==(l=this.barCtx.ctx)?void 0:l.morphTypeChange)?void 0:h.getInitialPathFor(r,a);return _?k=_:o.globals.previousPaths.length>0&&(k=this.barCtx.getPreviousPath(r,a,C)),null==k&&(k=c.move(d,b)+c.line(d,b)+c.line(d,y)+c.line(d,y)+" Z"),{pathTo:C,pathFrom:k,x:v,x1:w,barXPosition:d}}computePyramidLayout(t){const e=this.w,i=e.layout.gridHeight,s=e.layout.gridWidth,a=t.map(t=>Math.abs(Number(t)||0)),r=a.reduce((t,e)=>t+e,0);if(0===r||i<=0)return a.map(()=>({y:0,height:0,topHalf:0,bottomHalf:0}));const n=s/2;let o=0;const l=[];for(let t=0;t<a.length;t++){const e=o/r;o+=a[t];const s=o/r,h=e*i,c=s*i;l.push({y:h,height:c-h,topHalf:e*n,bottomHalf:s*n})}return l}getPyramidPaths({barYPosition:t,barHeight:e,topHalf:i,bottomHalf:s,realIndex:a,j:r,strokeWidth:n,w:o}){var l,h;const c=new Dt(this.barCtx.w),d=o.layout.gridWidth/2,p=n/2,u=t+p,g=t+e-p,f=d-i,x=d+i,m=d-s,b=d+s,y=c.move(f,u)+c.line(x,u)+c.line(b,g)+c.line(m,g)+" Z";let w=null;const v=null==(h=null==(l=this.barCtx.ctx)?void 0:l.morphTypeChange)?void 0:h.getInitialPathFor(a,r);return v?w=v:o.globals.previousPaths.length>0&&(w=this.barCtx.getPreviousPath(a,r,y)),null==w&&(w=c.move(d,u)+c.line(d,u)+c.line(d,g)+c.line(d,g)+" Z"),{pathTo:y,pathFrom:w,x:x,x1:f,barXPosition:d}}getBarpaths({barYPosition:t,barHeight:e,x1:i,x2:s,strokeWidth:a,isReversed:r,series:n,seriesGroup:o,realIndex:l,i:h,j:c,w:d}){var p,u,g;const f=new Dt(this.barCtx.w);(a=Array.isArray(a)?a[l]:a)||(a=0);let x=t,m=e;(null==(p=d.config.series[l].data[c])?void 0:p.barHeightOffset)&&(x=t-d.config.series[l].data[c].barHeightOffset/2,m=e+d.config.series[l].data[c].barHeightOffset);const b=a/2,y=x+b,w=x+m-b,v=(n[h][c]>=0?1:-1)*(r?-1:1);i+=.001+b*v,s+=.001-b*v;const A=this.barCtx.isFunnel,S=A?(i+s)/2:i,C=f.line(i,w),k="around"===d.config.plotOptions.bar.borderRadiusApplication||"both"===this.arrBorderRadius[l][c]?" Z":" z",_=f.move(i,y)+f.line(s,y)+f.line(s,w)+C+k;let M=_;"none"!==this.arrBorderRadius[l][c]&&(M=f.roundPathCorners(M,d.config.plotOptions.bar.borderRadius));let D=null;const L=null==(g=null==(u=this.barCtx.ctx)?void 0:u.morphTypeChange)?void 0:g.getInitialPathFor(l,c);if(L?D=L:d.globals.previousPaths.length>0&&(D=this.barCtx.getPreviousPath(l,c,M,_)),null==D){const t=A?f.line(S,w):C;D=f.move(S,y)+f.line(S,y)+t+t+t+t+t+f.line(S,y)+k}if(d.config.chart.stacked){let t=this.barCtx;t=this.barCtx[o],t.xArrj.push(s+b*v),t.xArrjF.push(Math.abs(i-s-a*v)),t.xArrjVal.push(this.barCtx.series[h][c])}return{pathTo:M,pathFrom:D}}getXForValue(t,e,i=!0){let s=i?e:null;return null!=t&&(s=e+t/this.barCtx.invertedYRatio-2*(this.barCtx.isReversed?t/this.barCtx.invertedYRatio:0)),s}getYForValue(t,e,i,s=!0){let a=s?e:null;return null!=t&&(a=e-t/this.barCtx.yRatio[i]+2*(this.barCtx.isReversed?t/this.barCtx.yRatio[i]:0)),a}getGoalValues(t,e,i,s,a,r){const n=this.w,h=[],c=(s,a)=>{h.push({[t]:"x"===t?this.getXForValue(s,e,!1):this.getYForValue(s,i,r,!1),attrs:a})};if(n.seriesData.seriesGoals[s]&&n.seriesData.seriesGoals[s][a]&&Array.isArray(n.seriesData.seriesGoals[s][a])&&n.seriesData.seriesGoals[s][a].forEach(t=>{c(t.value,t)}),this.barCtx.barOptions.isDumbbell&&n.rangeData.seriesRange.length){const e=this.barCtx.barOptions.dumbbellColors?this.barCtx.barOptions.dumbbellColors:n.globals.colors,i={strokeHeight:"x"===t?0:n.globals.markers.size[s],strokeWidth:"x"===t?n.globals.markers.size[s]:0,strokeDashArray:0,strokeLineCap:"round",strokeColor:Array.isArray(e[s])?e[s][0]:e[s]};c(n.rangeData.seriesRangeStart[s][a],i),c(n.rangeData.seriesRangeEnd[s][a],l(o({},i),{strokeColor:Array.isArray(e[s])?e[s][1]:e[s]}))}return h}drawGoalLine({barXPosition:t,barYPosition:e,goalX:i,goalY:s,barWidth:a,barHeight:r}){if(!(Array.isArray(i)&&i.length>0||Array.isArray(s)&&s.length>0))return null;const n=new Dt(this.barCtx.w),o=n.group({className:"apexcharts-bar-goals-groups"});o.node.classList.add("apexcharts-element-hidden"),this.barCtx.w.globals.delayedElements.push({el:o.node}),o.attr("clip-path",`url(#gridRectMarkerMask${this.barCtx.w.globals.cuid})`);let l=null;return this.barCtx.isHorizontal?Array.isArray(i)&&i.forEach(t=>{if(t.x>=-1&&t.x<=n.w.layout.gridWidth+1){const i=void 0!==t.attrs.strokeHeight?t.attrs.strokeHeight:r/2,s=e+i+r/2;l=n.drawLine(t.x,s-2*i,t.x,s,t.attrs.strokeColor?t.attrs.strokeColor:void 0,t.attrs.strokeDashArray,t.attrs.strokeWidth?t.attrs.strokeWidth:2,t.attrs.strokeLineCap),o.add(l)}}):Array.isArray(s)&&s.forEach(e=>{if(e.y>=-1&&e.y<=n.w.layout.gridHeight+1){const i=void 0!==e.attrs.strokeWidth?e.attrs.strokeWidth:a/2,s=t+i+a/2;l=n.drawLine(s-2*i,e.y,s,e.y,e.attrs.strokeColor?e.attrs.strokeColor:void 0,e.attrs.strokeDashArray,e.attrs.strokeHeight?e.attrs.strokeHeight:2,e.attrs.strokeLineCap),o.add(l)}}),o}drawBarShadow({prevPaths:t,currPaths:e,color:i,realIndex:s,j:a}){const r=this.w,{x:n,x1:o,barYPosition:l}=t,{x:h,x1:c,barYPosition:d}=e,p=l+e.barHeight,u=new Dt(this.barCtx.w),g=new v,f=u.move(o,p)+u.line(n,p)+u.line(h,d)+u.line(c,d)+u.line(o,p)+("around"===r.config.plotOptions.bar.borderRadiusApplication||"both"===this.arrBorderRadius[s][a]?" Z":" z");return u.drawPath({d:f,fill:g.shadeColor(.5,v.rgb2hex(i)),stroke:"none",strokeWidth:0,fillOpacity:1,classes:"apexcharts-bar-shadow apexcharts-decoration-element"})}getZeroValueEncounters({i:t,j:e}){var i;const s=this.w;let a=0,r=0;return(s.config.plotOptions.bar.horizontal?s.seriesData.series.map((t,e)=>e):(null==(i=s.globals.columnSeries)?void 0:i.i.map(t=>t))||[]).forEach(i=>{const n=s.globals.seriesPercent[i][e];n&&a++,i<t&&0===n&&r++}),{nonZeroColumns:a,zeroEncounters:r}}getSeriesGroupIndex(t){const e=this.w;return e.labelData.seriesGroups.findIndex(i=>i.indexOf(e.seriesData.seriesNames[t])>-1)}getGroupIndex(t){const e=this.w,i=e.labelData.seriesGroups.findIndex(i=>i.indexOf(e.seriesData.seriesNames[t])>-1),s=this.barCtx.columnGroupIndices;let a=s.indexOf(i);return a<0&&(s.push(i),a=s.length-1),{groupIndex:i,columnGroupIndex:a}}};class er{constructor(t,e,i){this.ctx=e,this.w=t,this.barOptions=t.config.plotOptions.bar,this.isHorizontal=this.barOptions.horizontal,this.strokeWidth=t.config.stroke.width,this.isNullValue=!1,this.isRangeBar=t.rangeData.seriesRange.length&&this.isHorizontal,this.isVerticalGroupedRangeBar=!t.globals.isBarHorizontal&&t.rangeData.seriesRange.length&&t.config.plotOptions.bar.rangeBarGroupRows,this.isFunnel=this.barOptions.isFunnel,this.isPyramid=this.barOptions.isPyramid,this.pyramidLayout=null,this.xyRatios=i,this.xRatio=0,this.yRatio=[],this.invertedXRatio=0,this.invertedYRatio=0,this.baseLineY=[],this.baseLineInvertedY=0,null!==this.xyRatios&&(this.xRatio=i.xRatio,this.yRatio=i.yRatio,this.invertedXRatio=i.invertedXRatio,this.invertedYRatio=i.invertedYRatio,this.baseLineY=i.baseLineY,this.baseLineInvertedY=i.baseLineInvertedY),this.yaxisIndex=0,this.translationsIndex=0,this.seriesLen=0,this.pathArr=[],this._prevKeyed=null,this._ltCache=null,this._layoutShiftCache=null,this._pathToInterp=null,this.series=[],this.elSeries=null,this.visibleI=0,this.isReversed=!1;const s=new Be(this.w);this.lastActiveBarSerieIndex=s.getActiveConfigSeriesIndex("desc",["bar","column"]),this.lastActiveBarSerieIndexByGroup=s.getActiveConfigSeriesIndexByGroup(["bar","column"]),this.columnGroupIndices=[];const a=s.getBarSeriesIndices(),r=new H(this.w);this.stackedSeriesTotals=r.getStackedSeriesTotals(this.w.config.series.map((t,e)=>-1===a.indexOf(e)?e:-1).filter(t=>-1!==t)),this.barHelpers=new tr(this)}draw(t,e){var i,s,a;const r=this.w,n=new Dt(this.w),h=new H(this.w);t=h.getLogSeries(t),this.series=t,this.yRatio=h.getLogYRatios(this.yRatio),this.barHelpers.initVariables(t);const c=n.group({class:"apexcharts-bar-series apexcharts-plot-series"});r.config.dataLabels.enabled&&(this.totalItems,this.barOptions.dataLabels.maxItems);for(let h=0,d=0;h<t.length;h++,d++){let p,u;const g=[],f=[],x=r.globals.comboCharts?e[h]:h,{columnGroupIndex:m}=this.barHelpers.getGroupIndex(x),b=n.group({class:"apexcharts-series",rel:h+1,seriesName:v.escapeString(r.seriesData.seriesNames[x]),"data:realIndex":x});Be.addCollapsedClassToSeries(this.w,b,x),t[h].length>0&&(this.visibleI=this.visibleI+1),this.yRatio.length>1&&(this.yaxisIndex=r.globals.seriesYAxisReverseMap[x],this.translationsIndex=x);const y=this.translationsIndex;this.isReversed=r.config.yaxis[this.yaxisIndex]&&r.config.yaxis[this.yaxisIndex].reversed,this.isPyramid&&(this.pyramidLayout=this.barHelpers.computePyramidLayout(t[h]));const w=this.barHelpers.initialPositions(x),{y:A,yDivision:S,zeroW:C,x:k,xDivision:_,zeroH:M}=w;let D=w.barHeight,L=w.barWidth;u=A,p=k,this.isHorizontal||f.push(p+(null!=L?L:0)/2);const P=n.group({class:"apexcharts-datalabels","data:realIndex":x});r.globals.delayedElements.push({el:P.node,holdUntilComplete:!(null==(i=r.config.dataLabels.animate)?void 0:i.enabled)&&this.isLengthTransition(x)}),P.node.classList.add("apexcharts-element-hidden");const E=n.group({class:"apexcharts-bar-goals-markers"}),T=n.group({class:"apexcharts-bar-shadows"});r.globals.delayedElements.push({el:T.node}),T.node.classList.add("apexcharts-element-hidden");for(let e=0;e<t[h].length;e++){const i=this.barHelpers.getStrokeWidth(h,e,x);let n=null;const c={indexes:{i:h,j:e,realIndex:x,translationsIndex:y,bc:d},x:p,y:u,strokeWidth:i,elSeries:b};this.isHorizontal?(n=this.drawBarPaths(l(o({},c),{barHeight:D,zeroW:C,yDivision:S})),L=this.series[h][e]/this.invertedYRatio):(n=this.drawColumnPaths(l(o({},c),{xDivision:_,barWidth:L,zeroH:M})),D=this.series[h][e]/this.yRatio[y]);const w=this.barHelpers.getPathFillColor(t,h,e,x);if(this.isFunnel&&!this.isPyramid&&this.barOptions.isFunnel3d&&"trapezoid"!==(null==(s=r.config.plotOptions.funnel)?void 0:s.shape)&&this.pathArr.length&&e>0){const t=this.barHelpers.drawBarShadow({color:"string"==typeof w.color&&-1===(null==(a=w.color)?void 0:a.indexOf("url"))?w.color:v.hexToRgba(r.globals.colors[h]),prevPaths:this.pathArr[this.pathArr.length-1],currPaths:n,realIndex:x,j:e});if(T.add(t),r.config.chart.dropShadow.enabled){new Mt(this.w).dropShadow(t,r.config.chart.dropShadow,x)}}this.pathArr.push(n);const A=this.barHelpers.drawGoalLine({barXPosition:n.barXPosition,barYPosition:n.barYPosition,goalX:n.goalX,goalY:n.goalY,barHeight:D,barWidth:L});A&&E.add(A),u=n.y,p=n.x,e>0&&f.push(p+(null!=L?L:0)/2),g.push(u),this.renderSeries(l(o({realIndex:x,pathFill:w.color},w.useRangeColor?{lineFill:w.color}:{}),{j:e,i:h,columnGroupIndex:m,pathFrom:n.pathFrom,pathTo:n.pathTo,strokeWidth:i,elSeries:b,x:p,y:u,series:t,barHeight:Math.abs(n.barHeight?n.barHeight:D),barWidth:Math.abs(n.barWidth?n.barWidth:L),elDataLabelsWrap:P,elGoalsMarkers:E,elBarShadows:T,visibleSeries:this.visibleI,type:"bar"}))}if(r.globals.seriesXvalues[x]=f,r.globals.seriesYvalues[x]=g,r.globals.previousPaths.length>0){const e=[];for(let i=0;i<t[h].length;i++)e.push(ne(r,x,i));ue({w:r,elSeries:b,record:this._prevRecord(x),newKeys:e,isHorizontal:this.isHorizontal,speed:r.config.chart.animations.dynamicAnimation.speed})}c.add(b)}return c}renderSeries({realIndex:t,pathFill:e,lineFill:i,j:s,i:a,columnGroupIndex:r,pathFrom:n,pathTo:o,strokeWidth:l,elSeries:h,x:c,y:d,y1:p,y2:u,series:g,barHeight:f,barWidth:x,barXPosition:m,barYPosition:b,elDataLabelsWrap:y,elGoalsMarkers:w,elBarShadows:v,visibleSeries:A,type:S,classes:C}){var k,_,M,D,L,P,E;const T=this.w,F=new Dt(this.w,this.ctx),I=Et(this.ctx,F);let R=!1;const X=this._pathToInterp;if(this._pathToInterp=null,h._bindingsDelegated||(h._bindingsDelegated=!0,F.setupEventDelegation(h,`.apexcharts-${S}-area`)),!i){let e=function(t){const e=T.config.stroke.colors;let i;return Array.isArray(e)&&e.length>0&&(i=e[t],i||(i=""),"function"==typeof i)?i({value:T.seriesData.series[t][s],dataPointIndex:s,w:T}):i};const a="function"==typeof T.globals.stroke.colors[t]?e(t):T.globals.stroke.colors[t];i=this.barOptions.distributed?T.globals.stroke.colors[s]:a}const z=T.config.chart.animations,B=z.animateGradually;let N=0,Y=0;if(B&&!1!==B.enabled&&!(T.globals.dataChanged&&this.isLayoutShift(t))){const t=T.globals.dataPoints||1,e=B.delay||0,i=Math.min(e,.5*z.speed/Math.max(1,t));Y=St({style:"sequential",index:s,baseDelay:i}),T.config.chart.stacked&&!T.globals.dataChanged&&(Y+=a*i*.5);N=Y/(e||1)}const O=new Ja(this).handleBarDataLabels({x:c,y:d,y1:p,y2:u,i:a,j:s,series:g,realIndex:t,columnGroupIndex:r,barHeight:f,barWidth:x,barXPosition:m,barYPosition:b,visibleSeries:A});if(Y>0){const t=T.config.dataLabels;if((null==(k=t.animate)?void 0:k.enabled)||(null==(_=t.countUp)?void 0:_.enabled)){const t=String(Math.round(Y));null==(D=null==(M=O.dataLabels)?void 0:M.node)||D.setAttribute("data:dlDelay",t),null==(P=null==(L=O.totalDataLabels)?void 0:L.node)||P.setAttribute("data:dlDelay",t)}}if(T.globals.isBarHorizontal||(O.dataLabelsPos.dataLabelsX+Math.max(x,T.globals.barPadForNumericAxis)<0||O.dataLabelsPos.dataLabelsX-Math.max(x,T.globals.barPadForNumericAxis)>T.layout.gridWidth)&&(R=!0),T.config.series[a].data[s]&&T.config.series[a].data[s].strokeColor&&(i=T.config.series[a].data[s].strokeColor),this.isNullValue&&-1===T.globals.collapsingSeriesIndices.indexOf(t)&&(e="none"),!R){const r=!0===(null==(E=this.ctx.morphTypeChange)?void 0:E.isActive()),c=r?this.ctx.morphTypeChange.getSpeed():T.config.chart.animations.dynamicAnimation.speed,d=r&&this.ctx.morphTypeChange.claimsTargetMark(t,s);d&&(n=o,N=0);const g=I.renderPaths({i:a,j:s,realIndex:t,pathFrom:n,pathTo:o,stroke:i,strokeWidth:l,strokeLineCap:T.config.stroke.lineCap,fill:e,pathToInterp:X,animationDelay:N,initialSpeed:T.config.chart.animations.speed,dataChangeSpeed:c,className:`apexcharts-${S}-area${C?` ${C}`:""}`,chartType:S,bindEventsOnPaths:!1});g.attr("clip-path",`url(#gridRectBarMask${T.globals.cuid})`),d&&(g.node.setAttribute("opacity","0"),g.node.setAttribute("data-piece-hidden","1"));const m=T.config.forecastDataPoints;m.count>0&&s>=T.globals.dataPoints-m.count&&(g.node.setAttribute("stroke-dasharray",m.dashArray),g.node.setAttribute("stroke-width",m.strokeWidth),g.node.setAttribute("fill-opacity",m.fillOpacity)),void 0!==p&&void 0!==u&&(g.attr("data-range-y1",p),g.attr("data-range-y2",u));new Mt(this.w).setSelectionFilter(g,t,s),h.add(g),g.attr({cy:O.dataLabelsPos.bcy,cx:O.dataLabelsPos.bcx,j:s,val:T.seriesData.series[a][s],barHeight:f,barWidth:x,"data:pathKey":ne(T,t,s)}),"canvas"===I.kind&&(T.globals.barCanvasCoords||(T.globals.barCanvasCoords={}),T.globals.barCanvasCoords[t]||(T.globals.barCanvasCoords[t]={}),T.globals.barCanvasCoords[t][s]={cx:O.dataLabelsPos.bcx,cy:O.dataLabelsPos.bcy,barWidth:x}),null!==O.dataLabels&&y.add(O.dataLabels),O.totalDataLabels&&y.add(O.totalDataLabels),h.add(y),w&&h.add(w),v&&h.add(v)}return h}drawBarPaths({indexes:t,barHeight:e,strokeWidth:i,zeroW:s,x:a,y:r,yDivision:n,elSeries:o}){const l=this.w,h=t.i,c=t.j;let d;if(l.axisFlags.isXNumeric)d=(r=(l.seriesData.seriesX[h][c]-l.globals.minX)/this.invertedXRatio-e)+e*this.visibleI;else if(l.config.plotOptions.bar.hideZeroBarsWhenGrouped){const{nonZeroColumns:t,zeroEncounters:i}=this.barHelpers.getZeroValueEncounters({i:h,j:c});t>0&&(e=this.seriesLen*e/t),d=r+e*this.visibleI,d-=e*i}else d=r+e*this.visibleI;const p=this.isFunnel&&"trapezoid"===l.config.plotOptions.funnel.shape,u=this.isPyramid&&this.pyramidLayout?this.pyramidLayout[c]:null,g=!!u;if(u)d=u.y,e=u.height;else if(this.isFunnel&&!p){const t=null!=s?s:0;s=t-(this.barHelpers.getXForValue(this.series[h][c],t)-t)/2}let f;return a=this.barHelpers.getXForValue(this.series[h][c],null!=s?s:0),f=u?this.barHelpers.getPyramidPaths({barYPosition:d,barHeight:e,topHalf:u.topHalf,bottomHalf:u.bottomHalf,realIndex:t.realIndex,j:c,strokeWidth:i,w:l}):p?this.barHelpers.getFunnelTrapezoidPaths({barYPosition:d,barHeight:e,series:this.series,i:h,j:c,realIndex:t.realIndex,strokeWidth:i,w:l}):this.barHelpers.getBarpaths({barYPosition:d,barHeight:e,x1:s,x2:a,strokeWidth:i,isReversed:this.isReversed,series:this.series,realIndex:t.realIndex,i:h,j:c,w:l}),(p||g)&&(s=f.x1,a=f.x),l.axisFlags.isXNumeric||g||(r+=n),g&&(r=d),this.barHelpers.barBackground({j:c,i:h,y1:d-e*this.visibleI,y2:e*this.seriesLen,elSeries:o}),{pathTo:f.pathTo,pathFrom:f.pathFrom,x1:s,x:a,y:r,goalX:this.barHelpers.getGoalValues("x",s,null,t.realIndex,c,0),barYPosition:d,barHeight:e}}drawColumnPaths({indexes:t,x:e,y:i,xDivision:s,barWidth:a,zeroH:r,strokeWidth:n,elSeries:o}){const l=this.w,h=t.realIndex,c=t.translationsIndex,d=t.i,p=t.j,u=t.bc;let g;if(l.axisFlags.isXNumeric){const t=this.getBarXForNumericXAxis({x:e,j:p,realIndex:h,barWidth:a});e=t.x,g=t.barXPosition}else if(l.config.plotOptions.bar.hideZeroBarsWhenGrouped){const{nonZeroColumns:t,zeroEncounters:i}=this.barHelpers.getZeroValueEncounters({i:d,j:p});t>0&&(a=this.seriesLen*a/t),g=e+a*this.visibleI,g-=a*i}else g=e+a*this.visibleI;i=this.barHelpers.getYForValue(this.series[d][p],r,c);const f=this.barHelpers.getColumnPaths({barXPosition:g,barWidth:a,y1:r,y2:i,strokeWidth:n,isReversed:this.isReversed,series:this.series,realIndex:h,i:d,j:p,w:l});return l.axisFlags.isXNumeric||(e+=s),this.barHelpers.barBackground({bc:u,j:p,i:d,x1:g-n/2-a*this.visibleI,x2:a*this.seriesLen+n/2,elSeries:o}),{pathTo:f.pathTo,pathFrom:f.pathFrom,x:e,y:i,goalY:this.barHelpers.getGoalValues("y",null,r,h,p,c),barXPosition:g,barWidth:a}}getBarXForNumericXAxis({x:t,barWidth:e,realIndex:i,j:s}){const a=this.w;let r=i;return a.seriesData.seriesX[i].length||(r=a.globals.maxValsInArrayIndex),v.isNumber(a.seriesData.seriesX[r][s])&&(t=Ri.dataXToPx(a,a.seriesData.seriesX[r][s])-e*this.seriesLen/2),{barXPosition:t+(Qa(a)?0:e*this.visibleI),x:t}}_prevRecord(t){const e=this.w;let i=null;for(let s=0;s<e.globals.previousPaths.length;s++){const a=e.globals.previousPaths[s];a.paths&&a.paths.length>0&&parseInt(a.realIndex,10)===parseInt(String(t),10)&&(i=a)}return i}_prevKeyedPaths(t){if(this._prevKeyed||(this._prevKeyed={}),void 0!==this._prevKeyed[t])return this._prevKeyed[t];const e=this._prevRecord(t);let i=null;if(e&&e.paths.every(t=>null!=t.key)){const t=new Map;e.paths.forEach(e=>{t.set(e.key,e)}),i=t}return this._prevKeyed[t]=i,i}isLengthTransition(t){var e,i;if(this._ltCache||(this._ltCache={}),void 0!==this._ltCache[t])return this._ltCache[t];const s=this.w;let a=!1;if(re(s)&&s.globals.previousPaths.length>0){const r=this._prevRecord(t),n=null!=(i=null==(e=s.seriesData.series[t])?void 0:e.length)?i:0;if(r)if(r.paths.length!==n)a=!0;else{const e=this._prevKeyedPaths(t);if(e)for(let i=0;i<n;i++)if(!e.has(ne(s,t,i))){a=!0;break}}else a=n>0}return this._ltCache[t]=a,a}isLayoutShift(t){if(this.isLengthTransition(t))return!0;if(this._layoutShiftCache||(this._layoutShiftCache={}),void 0!==this._layoutShiftCache[t])return this._layoutShiftCache[t];const e=le(this.w,t,!0,!0),i=!(!e||!e.join.changed);return this._layoutShiftCache[t]=i,i}getPreviousPath(t,e,i,s){const a=this.w;this._pathToInterp=null;const r=this._prevRecord(t);if(!r)return re(a)?null:i;let n=null,o=!1;const l=this._prevKeyedPaths(t);if(l){const i=l.get(ne(a,t,e));i?n=i.d:o=!0}else void 0!==r.paths[e]?n=r.paths[e].d:o=!0;if(n){const t=er.pathCommandCount(n),e=er.pathCommandCount(i);if(t===e)return n;const r=new Dt(a),o=t=>{const e=er.pathBox(t);return e?Math.min(e.maxX-e.minX,e.maxY-e.minY):0},l=t<e?o(n)>1:o(i)>1;if(t<e){const t=r.roundPathCorners(n,0);if(er.pathCommandCount(t)===e){if(l&&s){const t=r.roundPathCorners(s,0);er.pathCommandCount(t)===e&&(this._pathToInterp=t)}return t}}else{const e=r.roundPathCorners(i,0);if(er.pathCommandCount(e)===t){if(this._pathToInterp=e,l){const e=er.squareLike(n),i=e?r.roundPathCorners(e,0):null;if(i&&er.pathCommandCount(i)===t)return i}return n}}}return o&&re(a)?null:i}static pathBox(t){if(!t)return null;const e=[],i=/([MLC])([^MLCZz]*)/g;let s;for(;null!==(s=i.exec(t));){const t=s[2].trim().split(/[\s,]+/).map(Number);t.length<2||t.some(isNaN)||e.push([t[t.length-2],t[t.length-1]])}if(e.length<3)return null;const a=e.map(t=>t[0]),r=e.map(t=>t[1]);return{minX:Math.min(...a),maxX:Math.max(...a),minY:Math.min(...r),maxY:Math.max(...r),start:e[0],vertical:Math.abs(e[1][0]-e[0][0])<Math.abs(e[1][1]-e[0][1])}}static squareLike(t){const e=er.pathBox(t);if(!e)return null;const{minX:i,maxX:s,minY:a,maxY:r,start:n,vertical:o}=e,l=(t,e,i)=>Math.abs(t-e)<=Math.abs(t-i)?[e,i]:[i,e];let h,c,d,p;o?(h=Math.abs(n[0]-i)<=Math.abs(n[0]-s)?i:s,c=h===i?s:i,[d,p]=l(n[1],a,r)):(d=Math.abs(n[1]-a)<=Math.abs(n[1]-r)?a:r,p=d===a?r:a,[h,c]=l(n[0],i,s));const u=t.trim().endsWith("Z")?" Z":" z";return o?`M ${h} ${d} L ${h} ${p} L ${c} ${p} L ${c} ${d}${u}`:`M ${h} ${d} L ${c} ${d} L ${c} ${p} L ${h} ${p}${u}`}getPreviousFlip(t,e){const i=this.w,s=this._prevRecord(t);if(!s)return null;const a=this._prevKeyedPaths(t),r=a?a.get(ne(i,t,e)):s.paths[e];return r?!!r.flip:null}static pathCommandCount(t){if(!t)return 0;const e=t.match(/[A-Za-z]/g);return e?e.length:0}}function ir({w:t,points:e,seedA:i,seedB:s,center:a,halfExtent:r,alongFn:n,isHorizontal:o,options:l,clampAt:h}){const c=l;if(!c||!1===c.show)return[];if(!e||!e.length)return[];const d=c.maxPoints||3e3,p=e.length>d?Math.ceil(e.length/d):1,u=null!=c.size?c.size:2.5,g=r*(null!=c.jitter?c.jitter:.5),f=!1!==c.constrainToViolin&&"function"==typeof h,x="square"===c.shape,m=c.colorScale,b=m&&Array.isArray(m.colors)&&m.colors.length>0,y=b?Math.max(2,m.steps||24):1,w=b&&null!=m.min?m.min:t.globals.minY,v=(b&&null!=m.max?m.max:t.globals.maxY)-w||1,A=b?new Array(y).fill(""):[""];for(let t=0;t<e.length;t+=p){const r=e[t],l=n(r);let c=2*(nr(7919*i+100003*s+t)-.5)*g;if(f){const t=h(r);c>t&&(c=t),c<-t&&(c=-t)}const d=o?l:a+c,p=o?a+c:l,m=x?lr(d,p,u):or(d,p,u);if(b){let t=(r-w)/v;t<0&&(t=0),t>1&&(t=1),A[Math.round(t*(y-1))]+=m}else A[0]+=m}if(!b)return A[0]?[{fill:null,d:A[0]}]:[];const S=[];for(let t=0;t<y;t++)A[t]&&S.push({fill:rr(m.colors,t/(y-1)),d:A[t]});return S}function sr({graphics:t,w:e,elSeries:i,pointsByCat:s,options:a,distributed:r,realIndex:n,wrapClass:o,pointClass:l}){if(!a||!1===a.show||!s.length)return;const h=null!=a.opacity?a.opacity:.9,c=null!=a.strokeColor?a.strokeColor:"#fff",d=null!=a.strokeWidth?a.strokeWidth:1,p=e.config.chart.animations.enabled&&!e.globals.resized&&!e.globals.dataChanged,u=t.group({class:p?`${o} apexcharts-element-hidden`:o});p&&e.globals.delayedElements.push({el:u.node}),s.forEach(({groups:i,j:s})=>{const o=r?e.globals.colors[s]:e.globals.colors[n],p=a.fillColor,g="series"===p?o:"series-dark"===p?ar(o,.45):p||ar(o,.45);i.forEach(i=>{const a=t.drawPath({d:i.d,fill:null!=i.fill?i.fill:g,stroke:d>0?c:"none",strokeWidth:d,fillOpacity:h,classes:l});a.attr("data:realIndex",n),a.attr("j",s),a.attr("clip-path",`url(#gridRectBarMask${e.globals.cuid})`),a.node.style.pointerEvents="none",u.add(a)})}),i.add(u)}function ar(t,e){const i=v.parseHex(t);if(!i)return t;const s=Math.max(0,1-e);return`rgb(${Math.round(i[0]*s)},${Math.round(i[1]*s)},${Math.round(i[2]*s)})`}function rr(t,e){if(!t.length)return"#000";if(1===t.length)return t[0];const i=Math.max(0,Math.min(1,e))*(t.length-1),s=Math.floor(i),a=i-s,r=v.parseHex(t[s])||[0,0,0],n=v.parseHex(t[Math.min(s+1,t.length-1)])||r,o=(t,e)=>Math.round(t+(e-t)*a);return`rgb(${o(r[0],n[0])},${o(r[1],n[1])},${o(r[2],n[2])})`}function nr(t){let e=(2654435769^t)>>>0;return e=Math.imul(e^e>>>16,73244475),e=Math.imul(e^e>>>16,73244475),((e^e>>>16)>>>0)/4294967296}function or(t,e,i){return`M ${t-i} ${e} a ${i} ${i} 0 1 0 ${2*i} 0 a ${i} ${i} 0 1 0 ${-2*i} 0 `}function lr(t,e,i){return`M ${t-i} ${e-i} h ${2*i} v ${2*i} h ${-2*i} z `}class hr extends er{draw(t,e,i){var s;const a=this.w,r=new Dt(this.w),n=a.globals.comboCharts?e:a.config.chart.type,h=new Lt(this.w);this.candlestickOptions=this.w.config.plotOptions.candlestick,this.boxOptions=this.w.config.plotOptions.boxPlot,this.isHorizontal=a.config.plotOptions.bar.horizontal,this.isOHLC=this.candlestickOptions&&"ohlc"===this.candlestickOptions.type,this.coreUtils=new H(this.w),t=this.coreUtils.getLogSeries(t),this.series=t,this.yRatio=this.coreUtils.getLogYRatios(this.yRatio),this.barHelpers.initVariables(t);const c=r.group({class:`apexcharts-${n}-series apexcharts-plot-series`});for(let e=0;e<t.length;e++){let n,d;this.isBoxPlot="boxPlot"===a.config.chart.type||"boxPlot"===a.config.series[e].type;const p=[],u=[],g=a.globals.comboCharts?i[e]:e,{columnGroupIndex:f}=this.barHelpers.getGroupIndex(g),x=r.group({class:"apexcharts-series",seriesName:v.escapeString(a.seriesData.seriesNames[g]),rel:e+1,"data:realIndex":g});Be.addCollapsedClassToSeries(this.w,x,g),t[e].length>0&&(this.visibleI=this.visibleI+1);let m=0;this.yRatio.length>1&&(this.yaxisIndex=a.globals.seriesYAxisReverseMap[g][0],m=g);const b=this.barHelpers.initialPositions(g),{y:y,barHeight:w,yDivision:A,zeroW:S,x:C,barWidth:k,xDivision:_,zeroH:M}=b;d=y,n=C,u.push(n+(null!=k?k:0)/2);const D=r.group({class:"apexcharts-datalabels","data:realIndex":g}),L=r.group({class:"apexcharts-bar-goals-markers"}),P=this.isBoxPlot?this.boxOptions.points:null,E=[],T=a.layout.gridWidth,F=null!=k?k:0;for(let i=0;i<a.globals.dataPoints;i++){const r=this.barHelpers.getStrokeWidth(e,i,g);let c=null;const b={indexes:{i:e,j:i,realIndex:g,translationsIndex:m},x:n,y:d,strokeWidth:r,elSeries:x};if(c=this.isHorizontal?this.drawHorizontalBoxPaths(l(o({},b),{yDivision:A,barHeight:w,zeroW:S})):this.drawVerticalBoxPaths(l(o({},b),{xDivision:_,barWidth:k,zeroH:M,cullBounds:{lo:-F,hi:T+F}})),d=c.y,n=c.x,i>0&&u.push(n+(null!=k?k:0)/2),p.push(d),c.culled)continue;const y=this.barHelpers.drawGoalLine({barXPosition:c.barXPosition,barYPosition:c.barYPosition,goalX:c.goalX,goalY:c.goalY,barHeight:w,barWidth:k});if(y&&L.add(y),c.pathTo.forEach((s,o)=>{const l=!this.isBoxPlot&&this.candlestickOptions.wick.useFillColor?c.color[o]:a.globals.stroke.colors[e],p=h.fillPath({seriesNumber:g,dataPointIndex:i,color:c.color[o],value:t[e][i]});this.renderSeries({realIndex:g,pathFill:p,lineFill:l,j:i,i:e,pathFrom:c.pathFrom,pathTo:s,strokeWidth:r,elSeries:x,x:n,y:d,series:t,columnGroupIndex:f,barHeight:w,barWidth:k,elDataLabelsWrap:D,elGoalsMarkers:L,visibleSeries:this.visibleI,type:a.config.chart.type})}),P&&!1!==P.show){const t=null==(s=a.candleData.seriesBoxPoints[g])?void 0:s[i];if(t&&t.length){const e=t=>this.coreUtils.getLogValAtSeriesIndex(t,g);let s,r,n;if(this.isHorizontal){const t=this.invertedYRatio,i=null!=w?w:0,a=null!=S?S:0;s=c.barYPosition+i/2,r=i/2,n=i=>a+e(i)/t}else{const t=this.yRatio[m],i=null!=k?k:0,a=null!=M?M:0;s=c.barXPosition+i/2,r=i/2,n=i=>a-e(i)/t}const o=ir({w:a,points:t,seedA:g,seedB:i,center:s,halfExtent:r,alongFn:n,isHorizontal:this.isHorizontal,options:P});o.length&&E.push({groups:o,j:i})}}}P&&sr({graphics:r,w:a,elSeries:x,pointsByCat:E,options:P,distributed:a.config.plotOptions.bar.distributed,realIndex:g,wrapClass:"apexcharts-boxPlot-points-wrap",pointClass:"apexcharts-boxPlot-points"}),a.globals.seriesXvalues[g]=u,a.globals.seriesYvalues[g]=p,c.add(x)}return c}drawVerticalBoxPaths({indexes:t,x:e,xDivision:i,barWidth:s,zeroH:a,strokeWidth:r,cullBounds:n=null}){var o,l,h,c;const d=this.w,p=new Dt(this.w),u=t.i,g=t.j,{colors:f}=d.config.plotOptions.candlestick,{colors:x}=this.boxOptions,m=t.realIndex,b=t=>Array.isArray(t)?t[m]:t,y=b(f.upward),w=b(f.downward),v=this.yRatio[t.translationsIndex],A=this.getOHLCValue(m,g);let S=a,C=a,k=A.o<A.c?[y]:[w];this.isBoxPlot&&(k=[b(x.lower),b(x.upper)]);let _=Math.min(A.o,A.c),M=Math.max(A.o,A.c),D=A.m;d.axisFlags.isXNumeric&&(e=(d.seriesData.seriesX[m][g]-d.globals.minX)/this.xRatio-s/2);const L=e+s*this.visibleI;if(void 0===(null==(o=this.series[u])?void 0:o[g])||null===(null==(l=this.series[u])?void 0:l[g])?(_=a,M=a):(_=a-_/v,M=a-M/v,S=a-A.h/v,C=a-A.l/v,D=a-A.m/v),n&&(L+s<n.lo||L>n.hi))return{pathTo:null,pathFrom:null,x:d.axisFlags.isXNumeric?e:e+i,y:M,barXPosition:L,color:k,culled:!0};let P;if(this.isOHLC){const t=L+s/2,e=a-A.o/v,i=a-A.c/v;P=[p.move(t,S)+p.line(t,C)+p.move(t,e)+p.line(L,e)+p.move(t,i)+p.line(L+s,i)]}else P=this.isBoxPlot?[p.move(L,_)+p.line(L+s/2,_)+p.line(L+s/2,S)+p.line(L+s/4,S)+p.line(L+s-s/4,S)+p.line(L+s/2,S)+p.line(L+s/2,_)+p.line(L+s,_)+p.line(L+s,D)+p.line(L,D)+p.line(L,_+r/2),p.move(L,D)+p.line(L+s,D)+p.line(L+s,M)+p.line(L+s/2,M)+p.line(L+s/2,C)+p.line(L+s-s/4,C)+p.line(L+s/4,C)+p.line(L+s/2,C)+p.line(L+s/2,M)+p.line(L,M)+p.line(L,D)+"z"]:[p.move(L,M)+p.line(L+s/2,M)+p.line(L+s/2,S)+p.line(L+s/2,M)+p.line(L+s,M)+p.line(L+s,_)+p.line(L+s/2,_)+p.line(L+s/2,C)+p.line(L+s/2,_)+p.line(L,_)+p.line(L,M-r/2)];let E=null;const T=null==(c=null==(h=this.ctx)?void 0:h.morphTypeChange)?void 0:c.getInitialPathFor(m,g);return T?E=T:d.globals.previousPaths.length>0&&(E=this.getPreviousPath(m,g,P[0])),null==E&&(E=p.move(L+s/2,_)+p.move(L,_)),d.axisFlags.isXNumeric||(e+=i),{pathTo:P,pathFrom:E,x:e,y:M,goalY:this.barHelpers.getGoalValues("y",null,a,m,g,t.translationsIndex),barXPosition:L,color:k}}drawHorizontalBoxPaths({indexes:t,y:e,yDivision:i,barHeight:s,zeroW:a,strokeWidth:r}){var n,o,l,h;const c=this.w,d=new Dt(this.w),p=t.i,u=t.j,g=t.realIndex,{colors:f}=c.config.plotOptions.candlestick,{colors:x}=this.boxOptions,m=t=>Array.isArray(t)?t[g]:t,b=this.invertedYRatio,y=this.getOHLCValue(g,u);let w=y.o<y.c?[m(f.upward)]:[m(f.downward)];this.isBoxPlot&&(w=[m(x.lower),m(x.upper)]);let v=a,A=a,S=Math.min(y.o,y.c),C=Math.max(y.o,y.c),k=y.m;c.axisFlags.isXNumeric&&(e=(c.seriesData.seriesX[g][u]-c.globals.minX)/this.invertedXRatio-s/2);const _=e+s*this.visibleI;void 0===(null==(n=this.series[p])?void 0:n[u])||null===(null==(o=this.series[p])?void 0:o[u])?(S=a,C=a):(S=a+S/b,C=a+C/b,v=a+y.h/b,A=a+y.l/b,k=a+y.m/b);const M=[d.move(S,_)+d.line(S,_+s/2)+d.line(v,_+s/2)+d.line(v,_+s/2-s/4)+d.line(v,_+s/2+s/4)+d.line(v,_+s/2)+d.line(S,_+s/2)+d.line(S,_+s)+d.line(k,_+s)+d.line(k,_)+d.line(S+r/2,_),d.move(k,_)+d.line(k,_+s)+d.line(C,_+s)+d.line(C,_+s/2)+d.line(A,_+s/2)+d.line(A,_+s-s/4)+d.line(A,_+s/4)+d.line(A,_+s/2)+d.line(C,_+s/2)+d.line(C,_)+d.line(k,_)+"z"];let D=null;const L=null==(h=null==(l=this.ctx)?void 0:l.morphTypeChange)?void 0:h.getInitialPathFor(g,u);return L?D=L:c.globals.previousPaths.length>0&&(D=this.getPreviousPath(g,u,M[0])),null==D&&(D=d.move(S,_+s/2)+d.move(S,_)),c.axisFlags.isXNumeric||(e+=i),{pathTo:M,pathFrom:D,x:C,y:e,goalX:this.barHelpers.getGoalValues("x",a,null,g,u,0),barYPosition:_,color:w}}getOHLCValue(t,e){const i=this.w,s=this.coreUtils,a=i=>i[t]&&null!=i[t][e]?s.getLogValAtSeriesIndex(i[t][e],t):0,r=a(i.candleData.seriesCandleH),n=a(i.candleData.seriesCandleO),o=a(i.candleData.seriesCandleM),l=a(i.candleData.seriesCandleC),h=a(i.candleData.seriesCandleL);return{o:this.isBoxPlot?r:n,h:this.isBoxPlot?n:r,m:o,l:this.isBoxPlot?l:h,c:this.isBoxPlot?h:l}}}const cr=t=>{const e=function(t){const e=[];let i=t[0],s=t[1],a=e[0]=ur(i,s),r=1;for(let n=t.length-1;r<n;r++)i=s,s=t[r+1],e[r]=.5*(a+(a=ur(i,s)));return e[r]=a,e}(t),i=t.length-1,s=[];let a,r,n,o;for(let s=0;s<i;s++)n=ur(t[s],t[s+1]),Math.abs(n)<1e-6?e[s]=e[s+1]=0:(a=e[s]/n,r=e[s+1]/n,o=a*a+r*r,o>9&&(o=3*n/Math.sqrt(o),e[s]=o*a,e[s+1]=o*r));for(let a=0;a<=i;a++)o=(t[Math.min(i,a+1)][0]-t[Math.max(0,a-1)][0])/(6*(1+e[a]*e[a])),s.push([o||0,e[a]*o||0]);return s},dr=t=>{let e="";for(let i=0;i<t.length;i++){const s=t[i],a=s.length;a>4?(e+=`C${s[0]}, ${s[1]}`,e+=`, ${s[2]}, ${s[3]}`,e+=`, ${s[4]}, ${s[5]}`):a>2&&(e+=`S${s[0]}, ${s[1]}`,e+=`, ${s[2]}, ${s[3]}`)}return e},pr={points(t){const e=cr(t),i=t[1],s=t[0],a=[],r=e[1],n=e[0];a.push(s,[s[0]+n[0],s[1]+n[1],i[0]-r[0],i[1]-r[1],i[0],i[1]]);for(let i=2,s=e.length;i<s;i++){const s=t[i],r=e[i];a.push([s[0]-r[0],s[1]-r[1],s[0],s[1]])}return a},slice(t,e,i){const s=t.slice(e,i);if(e){if(i-e>1&&s[1].length<6){const t=s[0].length;s[1]=[2*s[0][t-2]-s[0][t-4],2*s[0][t-1]-s[0][t-3]].concat(s[1])}s[0]=s[0].slice(-2)}return s}};function ur(t,e){return(e[1]-t[1])/(e[0]-t[0])}function gr(t){const e=[];for(let i=0;i<t.length;i+=2)e.push(t[i+1],t[i]);return e}class fr{constructor(t,e){this.ctx=e,this.w=t}checkColorRange(){const t=this.w;let e=!1;const i=t.config.plotOptions[t.config.chart.type];return i.colorScale.ranges.length>0&&i.colorScale.ranges.map(t=>{t.from<=0&&(e=!0)}),e}getShadeColor(t,e,i,s){const a=this.w;let r=1;const n=a.config.plotOptions[t].shadeIntensity,o=this.determineColor(t,e,i);a.globals.hasNegs||s?r=a.config.plotOptions[t].reverseNegativeShade?o.percent<0?o.percent/100*(1.25*n):(1-o.percent/100)*(1.25*n):o.percent<=0?1-(1+o.percent/100)*n:(1-o.percent/100)*n:(r=1-o.percent/100,"treemap"===t&&(r=(1-o.percent/100)*(1.25*n)));let l=o.color;const h=new v;if(a.config.plotOptions[t].enableShades)if("dark"===this.w.config.theme.mode){const t=h.shadeColor(-1*r,o.color);l=v.hexToRgba(v.isColorHex(t)?t:v.rgb2hex(t),a.config.fill.opacity)}else{const t=h.shadeColor(r,o.color);l=v.hexToRgba(v.isColorHex(t)?t:v.rgb2hex(t),a.config.fill.opacity)}return{color:l,colorProps:o}}determineColor(t,e,i){const s=this.w,a=s.seriesData.series[e][i],r=s.config.plotOptions[t];let n=r.colorScale.inverse?i:e;r.distributed&&"treemap"===s.config.chart.type&&(n=i);let o,l,h=s.globals.colors[n],c=null;if(r.distributed||"heatmap"!==t){const t=s.seriesData.series[e];o=t.length?t[0]:0,l=o;for(let e=1;e<t.length;e++)t[e]<o&&(o=t[e]),t[e]>l&&(l=t[e])}else o=s.globals.minY,l=s.globals.maxY;const d=r.colorScale.min,p=r.colorScale.max;void 0!==d&&void 0!==p&&p>d?(o=d,l=p):void 0!==d&&(o=d<s.globals.minY?d:s.globals.minY,l=p>s.globals.maxY?p:s.globals.maxY);const u=Math.abs(l)+Math.abs(o),g=Math.min(Math.max(a,o),l);let f=0===u?0:100*g/u;if(r.colorScale.ranges.length>0){r.colorScale.ranges.map(t=>{if(a>=t.from&&a<=t.to){h=t.color,c=t.foreColor?t.foreColor:null,o=t.from,l=t.to;const e=Math.abs(l)+Math.abs(o);f=0===e?0:100*a/e}})}return{color:h,foreColor:c,percent:f}}calculateDataLabels({text:t,x:e,y:i,i:s,j:a,colorProps:r,fontSize:n}){const o=this.w,l=o.config.dataLabels,h=new Dt(this.w),c=new Xt(this.w,this.ctx);let d=null;if(l.enabled){d=h.group({class:"apexcharts-data-labels"});const p=Rt(l.offsetX,o,s,a),u=Rt(l.offsetY,o,s,a),g=e+p,f=i+parseFloat(l.style.fontSize)/3+u;c.plotDataLabelsText({x:g,y:f,text:t,i:s,j:a,color:r.foreColor,parent:d,fontSize:n,dataLabelsConfig:l})}return d}}class xr{constructor(t){this.w=t.w,this.lineCtx=t}sameValueSeriesFix(t,e){const i=this.w;if("gradient"===i.config.fill.type||"gradient"===i.config.fill.type[t]){if(new H(this.lineCtx.w).seriesHaveSameValues(t)){const i=e[t].slice();i[i.length-1]=i[i.length-1]+1e-6,e[t]=i}}return e}calculatePoints({series:t,realIndex:e,x:i,y:s,i:a,j:r,prevY:n}){const o=this.w,l=[],h=[];let c=this.lineCtx.categoryAxisCorrection+o.config.markers.offsetX;return o.axisFlags.isXNumeric&&(c=(o.seriesData.seriesX[e][0]-o.globals.minX)/this.lineCtx.xRatio+o.config.markers.offsetX),0===r&&(l.push(c),h.push(v.isNumber(t[a][0])?n+o.config.markers.offsetY:null)),l.push(i+o.config.markers.offsetX),h.push(v.isNumber(t[a][r+1])?s+o.config.markers.offsetY:null),{x:l,y:h}}checkPreviousPaths({pathFromLine:t,pathFromArea:e,realIndex:i}){const s=this.w;for(let a=0;a<s.globals.previousPaths.length;a++){const r=s.globals.previousPaths[a];("line"===r.type||"area"===r.type)&&r.paths.length>0&&parseInt(r.realIndex,10)===parseInt(i,10)&&("line"===r.type?(this.lineCtx.appendPathFrom=!1,t=s.globals.previousPaths[a].paths[0].d):"area"===r.type&&(this.lineCtx.appendPathFrom=!1,e=s.globals.previousPaths[a].paths[0].d,s.config.stroke.show&&s.globals.previousPaths[a].paths[1]&&(t=s.globals.previousPaths[a].paths[1].d)))}return{pathFromLine:t,pathFromArea:e}}determineFirstPrevY({i:t,realIndex:e,series:i,prevY:s,lineYPosition:a,translationsIndex:r}){var n,o,l;const h=this.w,c=h.config.chart.stacked&&!h.globals.comboCharts||h.config.chart.stacked&&h.globals.comboCharts&&(!this.w.config.chart.stackOnlyBar||"bar"===(null==(n=this.w.config.series[e])?void 0:n.type)||"column"===(null==(o=this.w.config.series[e])?void 0:o.type));if(void 0!==(null==(l=i[t])?void 0:l[0])){if(c)if(t>0){const t=this.lineCtx.stackTopAt(e,0);a=void 0===t?this.lineCtx.zeroY:t}else a=this.lineCtx.zeroY;else a=this.lineCtx.zeroY;s=a-i[t][0]/this.lineCtx.yRatio[r]+2*(this.lineCtx.isReversed?i[t][0]/this.lineCtx.yRatio[r]:0)}else if(c&&t>0&&void 0===i[t][0])for(let e=t-1;e>=0;e--)if(null!==i[e][0]&&void 0!==i[e][0]){s=a=this.lineCtx.prevSeriesY[e][0];break}return{prevY:s,lineYPosition:a}}}class mr{constructor(t,e,i,s){this.ctx=e,this.w=t,this.xyRatios=i,this.xRatio=0,this.yRatio=[],this.zRatio=0,this.baseLineY=[],this.pointsChart=!("bubble"!==this.w.config.chart.type&&"scatter"!==this.w.config.chart.type)||s,this.scatter=new It(this.w,this.ctx),this.noNegatives=this.w.globals.minX===Number.MAX_VALUE,this.lineHelpers=new xr(this),this.markers=new Ft(this.w,this.ctx),this.prevSeriesY=[],this.prevSeriesYByX=new Map,this.categoryAxisCorrection=0,this.yaxisIndex=0,this.xDivision=0,this.zeroY=0,this.areaBottomY=0,this.strokeWidth=0,this.isReversed=!1,this.appendPathFrom=!1,this.elSeries=null,this.elPointsMain=null,this.elDataLabelsWrap=null,this._elLastPointsWrap=null}draw(t,e,i,s){var a;const r=this.w,n=new Dt(this.w),h=r.globals.comboCharts?e:r.config.chart.type,c=n.group({class:`apexcharts-${h}-series apexcharts-plot-series`}),d=new H(this.w);this.yRatio=this.xyRatios.yRatio,this.zRatio=this.xyRatios.zRatio,this.xRatio=this.xyRatios.xRatio,this.baseLineY=this.xyRatios.baseLineY,t=d.getLogSeries(t),this.yRatio=d.getLogYRatios(this.yRatio),this.prevSeriesY=[],this.prevSeriesYByX=new Map;const p=[];for(let e=0;e<t.length;e++){t=this.lineHelpers.sameValueSeriesFix(e,t);const a=r.globals.comboCharts?i[e]:e,n=this.yRatio.length>1?a:0;this._initSerieVariables(t,e,a);const c=[],d=[],u=[];let g=r.globals.padHorizontal+this.categoryAxisCorrection;const f=1,x=[],m=[];Be.addCollapsedClassToSeries(this.w,this.elSeries,a),r.axisFlags.isXNumeric&&r.seriesData.seriesX.length>0&&(g=(r.seriesData.seriesX[a][0]-r.globals.minX)/this.xRatio),u.push(g);const b=g;let y;const w=b;let v=this.zeroY,A=this.zeroY;const S=0;v=this.lineHelpers.determineFirstPrevY({i:e,realIndex:a,series:t,prevY:v,lineYPosition:S,translationsIndex:n}).prevY,"monotoneCubic"===r.config.stroke.curve&&null===t[e][0]?c.push(null):c.push(v);const C=v;let k;"rangeArea"===h&&(k=this.lineHelpers.determineFirstPrevY({i:e,realIndex:a,series:s,prevY:A,lineYPosition:S,translationsIndex:n}),A=k.prevY,y=A,d.push(null!==c[0]?A:null));const _=this._calculatePathsFrom({type:h,series:t,i:e,realIndex:a,translationsIndex:n,prevX:w,prevY:v,prevY2:A}),M=[c[0]],D=[d[0]],L={type:h,series:t,realIndex:a,translationsIndex:n,i:e,x:g,y:f,pX:b,pY:C,pathsFrom:_,linePaths:x,areaPaths:m,seriesIndex:i,lineYPosition:S,xArrj:u,yArrj:c,y2Arrj:d,seriesRangeEnd:s},P=this._iterateOverDataPoints(l(o({},L),{iterations:"rangeArea"===h?t[e].length-1:void 0,isRangeStart:!0}));if("rangeArea"===h){const t=this._calculatePathsFrom({series:s,i:e,realIndex:a,prevX:w,prevY:A}),i=this._iterateOverDataPoints(l(o({},L),{series:s,xArrj:[g],yArrj:M,y2Arrj:D,pY:y,areaPaths:P.areaPaths,pathsFrom:t,iterations:s[e].length-1,isRangeStart:!1})),r=P.linePaths.length/2;for(let t=0;t<r;t++)P.linePaths[t]=i.linePaths[t+r]+P.linePaths[t];P.linePaths.splice(r),P.pathFromLine=i.pathFromLine+P.pathFromLine}else/z\s*$/i.test(P.pathFromArea)||(P.pathFromArea+="z");this._handlePaths({type:h,realIndex:a,i:e,paths:P}),this.markers.flushBatch(this.elPointsMain,a),this.elSeries.add(this.elPointsMain),this.elSeries.add(this.elDataLabelsWrap),p.push(this.elSeries)}if(void 0!==(null==(a=r.config.series[0])?void 0:a.zIndex)&&p.sort((t,e)=>Number(t.node.getAttribute("zIndex"))-Number(e.node.getAttribute("zIndex"))),r.config.chart.stacked)for(let t=p.length-1;t>=0;t--)c.add(p[t]);else for(let t=0;t<p.length;t++)c.add(p[t]);return c}_initSerieVariables(t,e,i){const s=this.w,a=new Dt(this.w);this.xDivision=s.layout.gridWidth/(s.globals.dataPoints-("on"===s.config.xaxis.tickPlacement?1:0)),this.strokeWidth=Array.isArray(s.config.stroke.width)?s.config.stroke.width[i]:s.config.stroke.width;let r=0;this.yRatio.length>1&&(this.yaxisIndex=s.globals.seriesYAxisReverseMap[i],r=i),this.isReversed=s.config.yaxis[this.yaxisIndex]&&s.config.yaxis[this.yaxisIndex].reversed,this.zeroY=s.layout.gridHeight-this.baseLineY[r]-(this.isReversed?s.layout.gridHeight:0)+(this.isReversed?2*this.baseLineY[r]:0),this.areaBottomY=this.zeroY,(this.zeroY>s.layout.gridHeight||"end"===s.config.plotOptions.area.fillTo)&&(this.areaBottomY=s.layout.gridHeight),this.categoryAxisCorrection=this.xDivision/2;const n=s.config.series[i];if(this.elSeries=a.group({class:"apexcharts-series",zIndex:void 0!==n.zIndex?n.zIndex:i,seriesName:v.escapeString(s.seriesData.seriesNames[i])}),this.elPointsMain=a.group({class:"apexcharts-series-markers-wrap","data:realIndex":i}),this.markers.resetSeriesWrapCache(),this._elLastPointsWrap=null,s.globals.hasNullValues){const t=this.markers.plotChartMarkers({pointsPos:{x:[0],y:[s.layout.gridHeight+s.globals.markers.largestSize]},seriesIndex:e,j:0,pSize:.1,alwaysDrawMarker:!0,isVirtualPoint:!0});null!==t&&this.elPointsMain.add(t)}this.elDataLabelsWrap=a.group({class:"apexcharts-datalabels","data:realIndex":i});const o=t[e].length===s.globals.dataPoints;this.elSeries.attr({"data:longestSeries":o,rel:e+1,"data:realIndex":i}),this.appendPathFrom=!0}_calculatePathsFrom({type:t,series:e,i:i,realIndex:s,translationsIndex:a,prevX:r,prevY:n,prevY2:o}){const l=this.w,h=new Dt(this.w);let c,d,p,u;if(null===e[i][0]){for(let t=0;t<e[i].length;t++)if(null!==e[i][t]){r=this.xDivision*t,n=this.zeroY-e[i][t]/this.yRatio[a],c=h.move(r,n),d=h.move(r,this.areaBottomY);break}}else c=h.move(r,n),"rangeArea"===t&&(c=h.move(r,o)+h.line(r,n)),d=h.move(r,this.areaBottomY)+h.line(r,n);if(p=h.move(0,this.areaBottomY)+h.line(0,this.areaBottomY),u=h.move(0,this.areaBottomY)+h.line(0,this.areaBottomY),l.globals.previousPaths.length>0){const t=this.lineHelpers.checkPreviousPaths({pathFromLine:p,pathFromArea:u,realIndex:s});p=t.pathFromLine,u=t.pathFromArea}return{prevX:r,prevY:n,linePath:c,areaPath:d,pathFromLine:p,pathFromArea:u}}_stackKey(t,e){if(!this.w.axisFlags.isXNumeric)return e;const i=this.w.seriesData.seriesX[t];return i?i[e]:void 0}stackTopAt(t,e){const i=this._stackKey(t,e);if(null!=i)return this.prevSeriesYByX.get(i)}_recordStackTops(t,e){const i=this.w;if(Array.isArray(e)&&-1===i.globals.collapsedSeriesIndices.indexOf(t)&&-1===i.globals.ancillaryCollapsedSeriesIndices.indexOf(t))for(let i=0;i<e.length;i++){const s=this._stackKey(t,i);if(null==s)continue;const a=e[i];v.isNumber(a)&&this.prevSeriesYByX.set(s,a)}}_handlePaths({type:t,realIndex:e,i:i,paths:s}){var a,r,n,h,c,d,p;const u=this.w,g=new Dt(this.w),f=Et(this.ctx,g),x=new Lt(this.w);this.prevSeriesY.push(s.yArrj),this._recordStackTops(e,s.yArrj);let m=null;"line"!==t&&"area"!==t||!u.globals.dataChanged||(m=function(t,e,i,s){var a;const r=t.globals,n=r.prevStreamFrame;if(!n||!r.dataChanged||!(null==(a=t.axisFlags)?void 0:a.isXNumeric))return null;const o=n.seriesX[e],l=n.seriesY[e],h=t.seriesData.seriesX[e],c=t.seriesData.series[e];if(!(o&&l&&h&&c))return null;if(o.length<3||h.length<3)return null;let d=-1;for(let t=0;t<o.length;t++)if(o[t]===h[0]){d=t;break}if(-1===d)return null;const p=Math.min(o.length-d,h.length);if(p<2)return null;const u=h.length-p;if(0===d&&0===u)return null;for(let t=0;t<p;t++){if(o[d+t]!==h[t])return null;const e=l[d+t],i=c[t];if(e!==i&&(null!=e||null!=i))return null}const g=n.xPixels[e],f=n.yPixels[e];if(!g||!f)return null;let x=-1,m=-1;for(let t=0;t<p;t++)null!=g[d+t]&&null!=f[d+t]&&null!=i[t]&&null!=s[t]&&(-1===x&&(x=t),m=t);if(-1===x||m<=x)return null;const b=i[x],y=i[m],w=g[d+x],v=g[d+m];if(Math.abs(y-b)<1e-6)return null;const A=(v-w)/(y-b),S=w-A*b;if(!isFinite(A)||!isFinite(S))return null;if(Math.abs(A-1)>.02)return null;if(Math.abs(S)<.5)return null;let C=x,k=x;for(let t=x;t<=m;t++){const e=s[t];null!=e&&null!=f[d+t]&&(e<s[C]&&(C=t),e>s[k]&&(k=t))}let _=1,M=0;const D=s[C],L=s[k];if(Math.abs(L-D)>1e-6?(_=(f[d+k]-f[d+C])/(L-D),M=f[d+C]-_*D):M=f[d+C]-D,!isFinite(_)||!isFinite(M)||_<.2||_>5)return null;const P=Math.floor((x+m)/2);if(P!==x&&P!==m&&null!=i[P]&&null!=g[d+P]){const t=A*i[P]+S;if(Math.abs(t-g[d+P])>1.5)return null;if(null!=s[P]&&null!=f[d+P]){const t=_*s[P]+M;if(Math.abs(t-f[d+P])>1.5)return null}}return r.streamScrolled=!0,{ax:A,bx:S,ay:_,by:M}}(u,e,s.xArrj,s.yArrj));let b=null;m||"line"!==t&&"area"!==t||(b=pe(u,{type:t,realIndex:e,pathFromLine:s.pathFromLine,pathFromArea:s.pathFromArea,linePaths:s.linePaths,areaPaths:s.areaPaths})),u.globals.seriesXvalues[e]=s.xArrj,u.globals.seriesYvalues[e]=s.yArrj;const y=u.config.forecastDataPoints;if(y.count>0&&"rangeArea"!==t){const t=u.globals.seriesXvalues[e][u.globals.seriesXvalues[e].length-y.count-1],i=g.drawRect(t,0,u.layout.gridWidth,u.layout.gridHeight,0);u.dom.elForecastMask.appendChild(i.node);const s=g.drawRect(0,0,t,u.layout.gridHeight,0);u.dom.elNonForecastMask.appendChild(s.node)}this.pointsChart?de(u,{elPointsMain:this.elPointsMain,realIndex:e,speed:u.config.chart.animations.dynamicAnimation.speed}):(u.globals.delayedElements.push({el:this.elPointsMain.node,index:e}),de(u,{elPointsMain:this.elPointsMain,realIndex:e,speed:u.config.chart.animations.dynamicAnimation.speed}),le(u,e)&&(null==(a=this.elDataLabelsWrap)?void 0:a.node)&&(this.elDataLabelsWrap.node.classList.add("apexcharts-element-hidden"),u.globals.delayedElements.push({el:this.elDataLabelsWrap.node,holdUntilComplete:!0})));const w={i:i,realIndex:e,animationDelay:i,initialSpeed:u.config.chart.animations.speed,dataChangeSpeed:u.config.chart.animations.dynamicAnimation.speed,className:`apexcharts-${t}`},v=s.numericXY,A="line"===t||"area"===t,S=A&&s.linePaths.length>1?[s.linePaths.join(" ")]:s.linePaths,C=A&&s.areaPaths.length>1?[s.areaPaths.join(" ")]:s.areaPaths;if("area"===t){const t=x.fillPath({seriesNumber:e});for(let e=0;e<C.length;e++){const i=f.renderPaths(l(o({},w),{pathFrom:m?Jt(s.areaPaths[e],m):null!=(n=null==(r=null==b?void 0:b.area)?void 0:r.from)?n:s.pathFromArea,pathTo:C[e],pathToNumeric:v?{xs:v.xs,ys:v.ys,closeY:v.areaCloseY}:void 0,pathToInterp:null==(h=null==b?void 0:b.area)?void 0:h.toInterp,scrollMorph:!!m,stroke:"none",strokeWidth:0,strokeLineCap:null,fill:t}));this.elSeries.add(i)}}if(u.config.stroke.show&&!this.pointsChart){let a=null;if("line"===t)a=x.fillPath({seriesNumber:e,i:i});else if("solid"===u.config.stroke.fill.type)a=u.globals.stroke.colors[e];else{const t=u.config.fill;u.config.fill=u.config.stroke.fill,a=x.fillPath({seriesNumber:e,i:i}),u.config.fill=t}for(let i=0;i<S.length;i++){let r=a;"rangeArea"===t&&(r=x.fillPath({seriesNumber:e}));const n=l(o({},w),{pathFrom:m?Jt(s.linePaths[i],m):null!=(d=null==(c=null==b?void 0:b.line)?void 0:c.from)?d:s.pathFromLine,pathTo:S[i],pathToNumeric:v?{xs:v.xs,ys:v.ys}:void 0,pathToInterp:null==(p=null==b?void 0:b.line)?void 0:p.toInterp,scrollMorph:!!m,stroke:a,strokeWidth:this.strokeWidth,strokeLineCap:u.config.stroke.lineCap,fill:"rangeArea"===t?r:"none"}),h=f.renderPaths(n);if(this.elSeries.add(h),h.attr("fill-rule","evenodd"),y.count>0&&"rangeArea"!==t){const t=f.renderPaths(n);t.node.setAttribute("stroke-dasharray",y.dashArray),y.strokeWidth&&t.node.setAttribute("stroke-width",y.strokeWidth),this.elSeries.add(t),t.attr("clip-path",`url(#forecastMask${u.globals.cuid})`),h.attr("clip-path",`url(#nonForecastMask${u.globals.cuid})`)}}}}_iterateOverDataPoints({type:t,series:e,iterations:i,realIndex:s,translationsIndex:a,i:r,x:n,y:o,pX:l,pY:h,pathsFrom:c,linePaths:d,areaPaths:p,seriesIndex:u,lineYPosition:g,xArrj:f,yArrj:x,y2Arrj:m,isRangeStart:b,seriesRangeEnd:y}){var w,A;const S=this.w,C=new Dt(this.w),k=this.yRatio;let{prevY:_,linePath:M,areaPath:D,pathFromLine:L,pathFromArea:P}=c;const E=v.isNumber(S.globals.minYArr[s])?S.globals.minYArr[s]:S.globals.minY;i||(i=S.globals.dataPoints>1?S.globals.dataPoints-1:S.globals.dataPoints);const T=(t,e)=>e-t/k[a]+2*(this.isReversed?t/k[a]:0);let F=o;const I=S.config.chart.stacked&&!S.globals.comboCharts||S.config.chart.stacked&&S.globals.comboCharts&&(!this.w.config.chart.stackOnlyBar||"bar"===(null==(w=this.w.config.series[s])?void 0:w.type)||"column"===(null==(A=this.w.config.series[s])?void 0:A.type));let R=S.config.stroke.curve;Array.isArray(R)&&(R=Array.isArray(u)?R[u[r]]:R[r]);let X,z=0;const B=this.pointsChart?this._scatterJitterPx(s):null;if("straight"===R&&!this.pointsChart){const u=this._fastStraightPath({type:t,series:e,i:r,realIndex:s,translationsIndex:a,iterations:i,x:n,y:o,pX:l,pY:h,pathsFrom:c,linePaths:d,areaPaths:p,xArrj:f,yArrj:x,y2Arrj:m,stackSeries:I});if(u)return u}for(let a=0;a<i&&0!==e[r].length;a++){const c=void 0===e[r][a+1]||null===e[r][a+1];if(S.axisFlags.isXNumeric){let t=S.seriesData.seriesX[s][a+1];void 0===S.seriesData.seriesX[s][a+1]&&(t=S.seriesData.seriesX[s][i-1]),n=(t-S.globals.minX)/this.xRatio}else n+=this.xDivision;if(I)if(r>0&&S.globals.collapsedSeries.length<S.config.series.length-1){if((t=>{var e;for(let i=t;i>=0;i--){const t=null!=(e=null==u?void 0:u[i])?e:i;if(-1===S.globals.collapsedSeriesIndices.indexOf(t)&&-1===S.globals.ancillaryCollapsedSeriesIndices.indexOf(t))return i}return-1})(r-1)<0)g=this.zeroY;else{const t=this.stackTopAt(s,a+1);g=void 0===t?this.zeroY:t}}else g=this.zeroY;else g=this.zeroY;c?o=T(E,g):(o=T(e[r][a+1],g),"rangeArea"===t&&(F=T(y[r][a+1],g)));let w=n,v=o;if(B){const t=100003*s+(a+1);B.x&&(w=n+2*(nr(7919*t+13)-.5)*B.x),B.y&&(v=o+2*(nr(6271*t+97)-.5)*B.y)}f.push(null===e[r][a+1]?null:w),!c||"smooth"!==S.config.stroke.curve&&"monotoneCubic"!==S.config.stroke.curve?(x.push(v),m.push(F)):(x.push(null),m.push(null));const A=this.lineHelpers.calculatePoints({series:e,x:w,y:v,realIndex:s,i:r,j:a,prevY:_}),k=this._createPaths({type:t,series:e,i:r,j:a,x:n,y:o,y2:F,xArrj:f,yArrj:x,y2Arrj:m,pX:l,pY:h,pathState:z,segmentStartX:X,linePath:M,areaPath:D,linePaths:d,areaPaths:p,curve:R,isRangeStart:b});p=k.areaPaths,d=k.linePaths,l=k.pX,h=k.pY,z=k.pathState,X=k.segmentStartX,D=k.areaPath,M=k.linePath,!this.appendPathFrom||S.globals.hasNullValues||"monotoneCubic"===R&&"rangeArea"===t||(L+=C.line(n,this.areaBottomY),P+=C.line(n,this.areaBottomY)),this.handleNullDataPoints(e,A,r,a,s),this._handleMarkersAndLabels({type:t,pointsPos:A,i:r,j:a,realIndex:s,isRangeStart:b})}return{yArrj:x,xArrj:f,pathFromArea:P,areaPaths:p,pathFromLine:L,linePaths:d,linePath:M,areaPath:D}}_handleMarkersAndLabels({type:t,pointsPos:e,isRangeStart:i,i:s,j:a,realIndex:r}){const n=this.w,o=new Xt(this.w,this.ctx);if(this.pointsChart)this.scatter.draw(this.elSeries,a,{realIndex:r,pointsPos:e,zRatio:this.zRatio,elParent:this.elPointsMain});else{!(!n.globals.dataChanged&&!n.globals.resized&&!n.globals.markers.batched)&&n.seriesData.series[s].length>1&&this.elPointsMain.node.classList.add("apexcharts-element-hidden");const t=this.markers.plotChartMarkers({pointsPos:e,seriesIndex:r,j:a+1});null!==t&&t!==this._elLastPointsWrap&&(this.elPointsMain.add(t),this._elLastPointsWrap=t)}const l=o.drawDataLabel({type:t,isRangeStart:i,pos:e,i:r,j:a+1});null!==l&&this.elDataLabelsWrap.add(l)}_scatterJitterPx(t){var e;const i=this.w,s=null==(e=i.config.plotOptions.scatter)?void 0:e.jitter;if(!s||!s.enabled||!s.x&&!s.y)return null;const a=i.axisFlags.isXNumeric&&this.xRatio?1/this.xRatio:this.xDivision,r=this.yRatio.length>1?t:0,n=this.yRatio[r]?1/this.yRatio[r]:0;return{x:(s.x||0)*a,y:(s.y||0)*n}}_fastStraightPath({type:t,series:e,i:i,realIndex:s,translationsIndex:a,iterations:r,x:n,y:o,pX:l,pY:h,pathsFrom:c,linePaths:d,areaPaths:p,xArrj:u,yArrj:g,y2Arrj:f,stackSeries:x}){const m=this.w;if("line"!==t&&"area"!==t)return null;if(m.globals.comboCharts||x)return null;if(m.config.dataLabels.enabled)return null;if(m.config.markers.discrete.length)return null;if(m.globals.markers.size[s]>0)return null;const b=e[i],y=b.length;if(!r||y<2||y-1!==r)return null;for(let t=0;t<=r;t++){const e=b[t];if(null==e)return null}const w=m.axisFlags.isXNumeric,v=w?m.seriesData.seriesX[s]:null;if(w&&(!v||v.length<y))return null;const A=this.yRatio[a],S=this.isReversed,C=this.zeroY,k=this.areaBottomY,_=this.xRatio,M=m.globals.minX,D=this.xDivision,L=m.config.markers.offsetX,P=m.config.markers.offsetY,E=this.appendPathFrom&&!m.globals.hasNullValues;let{pathFromLine:T,pathFromArea:F}=c;const I=this.ctx&&this.ctx.renderer,R=!(!I||!I.kind||"svg"===I.kind),X=!R||m.globals.dataChanged&&!!m.globals.prevStreamFrame,z=R?new Float64Array(y):null,B=R?new Float64Array(y):null;z&&B&&(z[0]=l,B[0]=h),void 0===m.globals.pointsArray[s]&&(m.globals.pointsArray[s]=[]);const N=m.globals.pointsArray[s],Y=v?(v[0]-M)/_+L:this.categoryAxisCorrection+L;N.push([Y,c.prevY+P]);const O=X?new Array(r+1):[];X&&(O[0]="M "+l+" "+h);const W=X&&E?new Array(r):null;let H=n,$=l,G=h;for(let t=0;t<r;t++){v?$=(v[t+1]-M)/_:(H+=D,$=H);const e=b[t+1];G=C-e/A+2*(S?e/A:0),u.push($),g.push(G),f.push(o),N.push([$+L,G+P]),X&&(O[t+1]=" L "+$+" "+G,W&&(W[t]=" L "+$+" "+k)),z&&B&&(z[t+1]=$,B[t+1]=G)}let j="",V="";if(X&&(j=O.join(""),V=j+" L "+$+" "+k+" L "+l+" "+k+"z"),W){const t=W.join("");T+=t,F+=t}else!X&&E&&(T+=" L "+$+" "+k,F+=" L "+$+" "+k);return d.push(j),p.push(V),{yArrj:g,xArrj:u,pathFromArea:F,areaPaths:p,pathFromLine:T,linePaths:d,linePath:j,areaPath:V,numericXY:z?{xs:z,ys:B,areaCloseY:k}:void 0}}_createPaths({type:t,series:e,i:i,j:s,x:a,y:r,xArrj:n,yArrj:o,y2:l,y2Arrj:h,pX:c,pY:d,pathState:p,segmentStartX:u,linePath:g,areaPath:f,linePaths:x,areaPaths:m,curve:b,isRangeStart:y}){const w=new Dt(this.w),v=this.areaBottomY,A="rangeArea"===t,S="rangeArea"===t&&y;switch(b){case"monotoneCubic":{const t=y?o:h,a=(t,e)=>t.map((t,i)=>[t,e[i]]).filter(t=>null!==t[1]),r=t=>{const e=[];let i=0;return t.forEach(t=>{null!==t?i++:i>0&&(e.push(i),i=0)}),i>0&&e.push(i),e},l=(t,e)=>{const i=r(t),s=[];for(let t=0,a=0;t<i.length;a+=i[t++])s[t]=pr.slice(e,a,a+i[t]);return s};switch(p){case 0:if(null===t[s+1])break;p=1;case 1:if(!(A?n.length===e[i].length:s===e[i].length-2))break;case 2:{const e=y?n:n.slice().reverse(),i=y?t:t.slice().reverse(),s=a(e,i),r=s.length>1?pr.points(s):s;let o=[];A&&(S?m=s:o=m.reverse());let h=0,c=0;if(l(i,r).forEach(t=>{h++;const e=dr(t),i=c;c+=t.length;const a=c-1;S?g=w.move(s[i][0],s[i][1])+e:A?g=w.move(o[i][0],o[i][1])+w.line(s[i][0],s[i][1])+e+w.line(o[a][0],o[a][1]):(g=w.move(s[i][0],s[i][1])+e,f=g+w.line(s[a][0],v)+w.line(s[i][0],v)+"z",m.push(f)),x.push(g)}),A&&h>1&&!S){const t=x.slice(h).reverse();x.splice(h),t.forEach(t=>x.push(t))}p=0;break}}break}case"smooth":{const t=.35*(a-c);if(null===e[i][s])p=0;else switch(p){case 0:if(u=c,g=S?w.move(c,h[s])+w.line(c,d):w.move(c,d),f=w.move(c,d),null===e[i][s+1]||void 0===e[i][s+1]){x.push(g),m.push(f);break}if(p=1,s<e[i].length-2){const e=w.curve(c+t,d,a-t,r,a,r);g+=e,f+=e;break}case 1:if(null===e[i][s+1])g+=S?w.line(c,l):w.move(c,d),f+=w.line(c,v)+w.line(u,v)+"z",x.push(g),m.push(f),p=-1;else{const n=w.curve(c+t,d,a-t,r,a,r);g+=n,f+=n,s>=e[i].length-2&&(S&&(g+=w.curve(a,r,a,r,a,l)+w.move(a,l)),f+=w.curve(a,r,a,r,a,v)+w.line(u,v)+"z",x.push(g),m.push(f),p=-1)}}c=a,d=r;break}default:{const t=(t,e,i)=>{let s="";switch(t){case"stepline":s=w.line(e,null,"H")+w.line(null,i,"V");break;case"linestep":s=w.line(null,i,"V")+w.line(e,null,"H");break;case"straight":s=w.line(e,i)}return s};if(null===e[i][s])p=0;else switch(p){case 0:if(u=c,g=S?w.move(c,h[s])+w.line(c,d):w.move(c,d),f=w.move(c,d),null===e[i][s+1]||void 0===e[i][s+1]){x.push(g),m.push(f);break}if(p=1,s<e[i].length-2){const e=t(b,a,r);g+=e,f+=e;break}case 1:if(null===e[i][s+1])g+=S?w.line(c,l):w.move(c,d),f+=w.line(c,v)+w.line(u,v)+"z",x.push(g),m.push(f),p=-1;else{const n=t(b,a,r);g+=n,f+=n,s>=e[i].length-2&&(S&&(g+=w.line(a,l)),f+=w.line(a,v)+w.line(u,v)+"z",x.push(g),m.push(f),p=-1)}}c=a,d=r;break}}return{linePaths:x,areaPaths:m,pX:c,pY:d,pathState:p,segmentStartX:u,linePath:g,areaPath:f}}handleNullDataPoints(t,e,i,s,a){const r=this.w;if(null===t[i][s]&&r.config.markers.showNullDataPoints||1===t[i].length){let t=this.strokeWidth-r.config.markers.strokeWidth/2;t>0||(t=0);const i=this.markers.plotChartMarkers({pointsPos:e,seriesIndex:a,j:s+1,pSize:t,alwaysDrawMarker:!0});null!==i&&this.elPointsMain.add(i)}}}function br(t,e){const{lines:i,lineHeight:s,anchor:a,elbow:r,labelX:n,labelY:o,side:l,connector:h,style:c,foreColor:d}=e,p=new Dt(t),u=p.group({class:e.groupClass||"apexcharts-outer-label-group"});if(h.show){const t=`M ${a.x} ${a.y} L ${r.x} ${r.y} L ${n} ${o}`,i=p.drawPath({d:t,stroke:h.color,strokeWidth:h.width,fill:"none",strokeLinecap:"round"});i.node.classList.add(e.connectorClass||"apexcharts-outer-label-connector"),u.add(i)}const g="right"===l?n+4:n-4,f=i.length,x=o-(f-1)*s/2,m=p.drawText({x:g,y:x,text:1===f?i[0]:i,textAnchor:"right"===l?"start":"end",fontSize:c.fontSize,fontFamily:c.fontFamily,fontWeight:c.fontWeight,foreColor:d,dominantBaseline:"central",cssClass:e.textClass||"apexcharts-outer-label"});if(f>1){const t=m.node.getElementsByTagName("tspan");for(let e=0;e<t.length;e++)t[e].setAttribute("x",`${g}`),t[e].setAttribute("dy",0===e?"0":`${s}`)}return u.add(m),u}function yr(t,e,i,s){const a=t.slice().sort((t,e)=>t.idealY-e.idealY);a.forEach(t=>{t.labelY=t.idealY});for(let t=1;t<a.length;t++)a[t].labelY-a[t-1].labelY<e&&(a[t].labelY=a[t-1].labelY+e);const r=a[a.length-1],n=r?r.labelY-i:0;if(n>0)for(let t=a.length-1;t>=0;t--)a[t].labelY-=n,t<a.length-1&&a[t+1].labelY-a[t].labelY<e&&(a[t].labelY=a[t+1].labelY-e);if(null!=s&&a.length&&a[0].labelY<s){const t=s-a[0].labelY;for(let e=0;e<a.length;e++)a[e].labelY+=t}}class wr{constructor(t){this.w=t}drawYAxisTexts(t,e,i,s){const a=this.w,r=a.config.yaxis[0],n=a.formatters.yLabelFormatters[0];return new Dt(this.w).drawText({x:t+r.labels.offsetX,y:e+r.labels.offsetY,text:n(s,i),textAnchor:"middle",fontSize:r.labels.style.fontSize,fontFamily:r.labels.style.fontFamily,foreColor:Array.isArray(r.labels.style.colors)?r.labels.style.colors[i]:r.labels.style.colors})}getMaxLabelWidth(t,{fontSize:e,fontFamily:i}={}){const s=new Dt(this.w);let a=0;return t.forEach(t=>{if(null==t||""===t)return;const r=s.getTextRects(`${t}`,e||"12px",i,"");a=Math.max(a,r.width)}),a}drawExternalLabel(t){return br(this.w,l(o({},t),{groupClass:"apexcharts-pie-name-label-group",textClass:"apexcharts-pie-name-label",connectorClass:"apexcharts-pie-label-connector"}))}}const vr=Math.PI/180,Ar=180/Math.PI;function Sr(t,e,i,s){return{x:t+i*Math.cos((s-90)*vr),y:e+i*Math.sin((s-90)*vr)}}const Cr=t=>`${t.x} ${t.y}`;function kr({cx:t,cy:e,rIn:i,rOut:s,a0:a,a1:r,r:n,spanDeg:o}){const l=(i,s)=>Sr(t,e,i,s),h=n/s*Ar,c=n/i*Ar,d=l(s,a+h),p=l(s,r-h),u=o-2*h>180?1:0,g=l(s,r),f=l(s-n,r),x=l(s,a),m=l(s-n,a),b=l(i,r-c),y=l(i,a+c),w=o-2*c>180?1:0,v=l(i,r),A=l(i+n,r),S=l(i,a),C=l(i+n,a);return["M",Cr(d),"A",s,s,0,u,1,Cr(p),"Q",Cr(g),Cr(f),"L",Cr(A),"Q",Cr(v),Cr(b),"A",i,i,0,w,0,Cr(y),"Q",Cr(S),Cr(C),"L",Cr(m),"Q",Cr(x),Cr(d),"Z"].join(" ")}function _r({cx:t,cy:e,rIn:i,rOut:s,a0:a,a1:r,spanDeg:n}){const o=(i,s)=>Sr(t,e,i,s),l=n>180?1:0,h=o(s,a),c=o(s,r),d=o(i,r),p=o(i,a);return["M",Cr(h),"A",s,s,0,l,1,Cr(c),"L",Cr(d),"A",i,i,0,l,0,Cr(p),"Z"].join(" ")}class Mr{constructor(t,e){this.ctx=e,this.w=t,this.chartType=this.w.config.chart.type,this.initialAnim=this.w.config.chart.animations.enabled,this.dynamicAnim=this.initialAnim&&this.w.config.chart.animations.dynamicAnimation.enabled,this.animBeginArr=[0],this.animDur=0,this.donutDataLabels=this.w.config.plotOptions.pie.donut.labels,this.lineColorArr=void 0!==t.globals.stroke.colors?t.globals.stroke.colors:t.globals.colors,this.defaultSize=Math.min(t.layout.gridWidth,t.layout.gridHeight),this.centerY=this.defaultSize/2,this.centerX=t.layout.gridWidth/2,"radialBar"===t.config.chart.type?this.fullAngle=360:this.fullAngle=Math.abs(t.config.plotOptions.pie.endAngle-t.config.plotOptions.pie.startAngle),this.initialAngle=t.config.plotOptions.pie.startAngle%this.fullAngle,t.globals.radialSize=this.defaultSize/2.05-t.config.stroke.width-(t.config.chart.sparkline.enabled?0:t.config.chart.dropShadow.blur),this.externalCfg=t.config.plotOptions.pie.dataLabels.external;const i=t.config.dataLabels.style;this.externalLabelStyle={fontSize:this.externalCfg.fontSize||i.fontSize,fontFamily:this.externalCfg.fontFamily||i.fontFamily,fontWeight:this.externalCfg.fontWeight||i.fontWeight},this.externalLabels=[],this.externalLabelMaxLines=1,this.externalLabelLineH=parseFloat(this.externalLabelStyle.fontSize)||12,t.globals.pieExternalLabelMarginY=0,this.showExternalLabels=this.externalCfg.show&&"polarArea"!==this.chartType,this.showExternalLabels&&!t.globals.noData&&this.reserveExternalLabelSpace(),this.donutSize=t.globals.radialSize*parseInt(t.config.plotOptions.pie.donut.size,10)/100;const s=t.config.plotOptions.pie.customScale,a=t.layout.gridWidth/2,r=t.layout.gridHeight/2;this.translateX=a-a*s,this.translateY=r-r*s,this.dataLabelsGroup=new Dt(this.w).group({class:"apexcharts-datalabels-group",transform:`translate(${this.translateX}, ${this.translateY}) scale(${s})`}),this.maxY=0,this.sliceLabels=[],this.sliceSizes=[],this.prevSliceSizes=[],this.sliceLabelGroups={},this.externalLabelGroups={},this.elHoverOutline=null,this.elHoverOutlinePath=null,this.hoverOutlineIndex=-1,this.prevSectorAngleArr=[]}getExternalLabelText(t){var e,i,s;const a=this.w,r=a.seriesData.seriesNames[t],n=this.externalCfg.formatter;return"function"==typeof n?n(r,{seriesIndex:t,percent:null==(i=null==(e=a.globals.seriesPercent)?void 0:e[t])?void 0:i[0],value:null==(s=a.globals.seriesTotals)?void 0:s[t],w:a}):null==r?"":`${r}`}getExternalLabelLines(t){const e=this.getExternalLabelText(t);return(Array.isArray(e)?e:`${null==e?"":e}`.split("\n")).map(t=>null==t?"":`${t}`)}reserveExternalLabelSpace(){const t=this.w,e=new wr(t),i=(t.seriesData.seriesNames||[]).map((t,e)=>this.getExternalLabelLines(e)),s=e.getMaxLabelWidth(i.flat(),{fontSize:this.externalLabelStyle.fontSize,fontFamily:this.externalLabelStyle.fontFamily});this.externalLabelMaxLines=i.reduce((t,e)=>Math.max(t,e.length),1),this.externalLabelLineH=Math.round(1.35*(parseFloat(this.externalLabelStyle.fontSize)||12));const a=this.externalCfg.connector,r=this.externalLabelMaxLines*this.externalLabelLineH,n=s+(a.length||0)+(a.gap||0)+12,o=r/2+(a.gap||0)+6,l=Math.min(t.globals.radialSize,t.layout.gridWidth/2-n,t.layout.gridHeight/2-o);t.globals.radialSize=Math.max(l,.15*this.defaultSize),t.globals.pieExternalLabelMarginY=o;const h=t.config.chart.height?String(t.config.chart.height):"",c=""!==h&&"auto"!==h;this.centerY=c?t.layout.gridHeight/2:t.globals.radialSize+o}draw(t){var e;const i=this.w,s=new Dt(this.w),a=s.group({class:"apexcharts-pie"});if(i.globals.noData)return a;let r=0;for(let e=0;e<t.length;e++)r+=v.negToZero(t[e]);const n=[],o=s.group();0===r&&(r=1e-5),t.forEach(t=>{this.maxY=Math.max(this.maxY,t)}),i.config.yaxis[0].max&&(this.maxY=i.config.yaxis[0].max),"back"===i.config.grid.position&&"polarArea"===this.chartType&&this.drawPolarElements(a);const l=i.globals.collapsedSeriesIndices||[];let h=1;if("polarArea"===this.chartType){let e=0;for(let i=0;i<t.length;i++)-1===l.indexOf(i)&&e++;h=Math.max(1,e)}for(let e=0;e<t.length;e++){const s=this.fullAngle*v.negToZero(t[e])/r;n.push(s),"polarArea"===this.chartType?(n[e]=l.indexOf(e)>-1?0:this.fullAngle/h,this.sliceSizes.push(i.globals.radialSize*t[e]/(this.maxY||1))):this.sliceSizes.push(i.globals.radialSize)}const c=!0===(null==(e=this.ctx.morphTypeChange)?void 0:e.isActive());if(i.globals.dataChanged&&!c)if("polarArea"===this.chartType){const t=i.globals.previousPaths,e=i.globals.prevPolarAngles;if(Array.isArray(e)&&e.length===t.length)this.prevSectorAngleArr=e.slice();else for(let e=0;e<t.length;e++)this.prevSectorAngleArr.push(this.fullAngle/Math.max(1,t.length));let s=0;for(let e=0;e<t.length;e++)s=Math.max(s,v.negToZero(t[e]));i.config.yaxis[0].max&&(s=i.config.yaxis[0].max),this.prevSliceSizes=t.map(t=>i.globals.radialSize*v.negToZero(t)/(s||1))}else{let t,e=0;for(let t=0;t<i.globals.previousPaths.length;t++)e+=v.negToZero(i.globals.previousPaths[t]);for(let s=0;s<i.globals.previousPaths.length;s++)t=this.fullAngle*v.negToZero(i.globals.previousPaths[s])/e,this.prevSectorAngleArr.push(t)}if("polarArea"===this.chartType&&(i.globals.prevPolarAngles=n.slice()),this.donutSize<0&&(this.donutSize=0),"donut"===this.chartType){const t=s.drawCircle(this.donutSize);t.attr({cx:this.centerX,cy:this.centerY,fill:i.config.plotOptions.pie.donut.background?i.config.plotOptions.pie.donut.background:"transparent"}),o.add(t)}const d=this.drawArcs(n,t);if(this.sliceLabels.forEach(t=>{d.add(t)}),o.attr({transform:`translate(${this.translateX}, ${this.translateY}) scale(${i.config.plotOptions.pie.customScale})`}),o.add(d),a.add(o),this.donutDataLabels.show){const t=this.initialAnim&&!i.globals.resized&&!i.globals.dataChanged&&this.animDur>0,e=this.renderInnerDataLabels(this.dataLabelsGroup,this.donutDataLabels,{hollowSize:this.donutSize,centerX:this.centerX,centerY:this.centerY,opacity:t?0:this.donutDataLabels.show});if(t){const t=this.dataLabelsGroup.node;t.style.transition="opacity 280ms ease-out",setTimeout(()=>{t.style.opacity="1"},this.animDur)}a.add(e)}return"front"===i.config.grid.position&&"polarArea"===this.chartType&&this.drawPolarElements(a),a}drawArcs(t,e){var i,s,a,r,n;const o=this.w,l=new Mt(this.w),h=new Dt(this.w),c=new Lt(this.w),p=h.group({class:"apexcharts-slices"});this.elHoverOutline=h.group({class:"apexcharts-pie-hover-outline"}),this.elHoverOutline.node.style.pointerEvents="none",this.elHoverOutline.node.style.opacity="0",o.config.chart.animations.enabled&&(this.elHoverOutline.node.style.transition="opacity 180ms ease-out"),p.add(this.elHoverOutline);let u=this.initialAngle,g=this.initialAngle,f=this.initialAngle,x=this.initialAngle;this.strokeWidth=o.config.stroke.show?o.config.stroke.width:0;const m=!0===(null==(i=this.ctx.morphTypeChange)?void 0:i.isActive());for(let i=0;i<t.length;i++){const d=h.group({class:"apexcharts-series apexcharts-pie-series",seriesName:v.escapeString(o.seriesData.seriesNames[i]),rel:i+1,"data:realIndex":i});p.add(d),u=f,g=x,f=u+t[i],x=g+this.prevSectorAngleArr[i];const b=f<u?this.fullAngle+f-u:f-u,y=c.fillPath({seriesNumber:i,size:this.sliceSizes[i],value:e[i]}),w=m?this.ctx.morphTypeChange.getInitialPathFor(i,0):null,A="polarArea"===this.chartType&&o.globals.dataChanged&&!m?this.prevSliceSizes[i]||0:void 0,S=w||this.getChangedPath(g,x,A),C=h.drawPath({d:S,stroke:Array.isArray(this.lineColorArr)?null!=(s=this.lineColorArr[i])?s:this.lineColorArr[i%this.lineColorArr.length]:this.lineColorArr,strokeWidth:0,fill:y,fillOpacity:o.config.fill.opacity,classes:`apexcharts-pie-area apexcharts-${this.chartType.toLowerCase()}-slice-${i}`});if(C.attr({index:0,j:i}),l.setSelectionFilter(C,0,i),o.config.chart.dropShadow.enabled){const t=o.config.chart.dropShadow;l.dropShadow(C,t,i)}this.addListeners(C,this.donutDataLabels,i);let k={x:0,y:0};const _=(u+b/2)%this.fullAngle;let M={x:this.centerX,y:this.centerY};"pie"===this.chartType||"polarArea"===this.chartType?(k=v.polarToCartesian(this.centerX,this.centerY,o.globals.radialSize/1.25+o.config.plotOptions.pie.dataLabels.offset,_),M=v.polarToCartesian(this.centerX,this.centerY,o.globals.radialSize/2,_)):"donut"===this.chartType&&(k=v.polarToCartesian(this.centerX,this.centerY,(o.globals.radialSize+this.donutSize)/2+o.config.plotOptions.pie.dataLabels.offset,_),M=v.polarToCartesian(this.centerX,this.centerY,(o.globals.radialSize+this.donutSize)/2,_)),Dt.setAttrs(C.node,{"data:angle":b,"data:startAngle":u,"data:strokeWidth":this.strokeWidth,"data:value":e[i],"data:cx":M.x,"data:cy":M.y}),d.add(C);let D=!1;if(m){const t=this.getPiePath({me:this,startAngle:u,angle:b,size:this.sliceSizes[i]});C.node.setAttribute("data:pathFinal",t),D=!0===(null==(r=(a=this.ctx.morphTypeChange).claimsTargetMark)?void 0:r.call(a,i,0)),D&&(C.attr({d:t}),C.node.setAttribute("data:pathOrig",t),C.node.setAttribute("opacity","0"),C.node.setAttribute("data-piece-hidden","1"))}let L=0;if(!this.initialAnim||o.globals.resized||o.globals.dataChanged?this.animBeginArr.push(0):(L=b/this.fullAngle*o.config.chart.animations.speed,0===L&&(L=1),this.animDur=L+this.animDur,this.animBeginArr.push(this.animDur)),D);else if(m&&w){const t=this.getPiePath({me:this,startAngle:u,angle:b,size:this.sliceSizes[i]}),e=this.ctx.morphTypeChange.getSpeed(),s=this.ctx.animations;C.node.setAttribute("data:pathOrig",t);const a=C.animate(e).plot(t,"polygons").attr({"stroke-width":this.strokeWidth});a&&"function"==typeof a.after?a.after(()=>s.animationCompleted(C)):s.animationCompleted(C)}else this.dynamicAnim&&o.globals.dataChanged?this.animatePaths(C,{size:this.sliceSizes[i],prevSize:A,endAngle:f,startAngle:u,prevStartAngle:g,prevEndAngle:x,animateStartingPos:!0,i:i,animBeginArr:this.animBeginArr,shouldSetPrevPaths:!0,dur:o.config.chart.animations.dynamicAnimation.speed}):this.animatePaths(C,{size:this.sliceSizes[i],endAngle:f,startAngle:u,i:i,totalItems:t.length-1,animBeginArr:this.animBeginArr,dur:L});if(this.getExpandOffset()>0?C.node.addEventListener("mouseup",this.pieClicked.bind(this,i)):0===i&&Mt.drilldownBlocksSliceOffset(o)&&(null==(n=this.ctx.drilldown)||n.warnSliceOffsetDisabled()),void 0!==o.interact.selectedDataPoints[0]&&o.interact.selectedDataPoints[0].indexOf(i)>-1)if(this.initialAnim&&!o.globals.resized&&!o.globals.dataChanged&&this.animDur>0){const t=this,e=i;setTimeout(()=>t.pieClicked(e,{animate:!1}),this.animDur)}else this.pieClicked(i,{animate:!1});if(o.config.dataLabels.enabled){const e=k.x,s=k.y;let a=100*b/this.fullAngle+"%";if(0!==b&&o.config.plotOptions.pie.dataLabels.minAngleToShowLabel<t[i]){const t=o.config.dataLabels.formatter;void 0!==t&&(a=t(o.globals.seriesPercent[i][0],{seriesIndex:i,w:o}));const r=o.globals.dataLabels.style.colors[i],n=h.group({class:"apexcharts-datalabels"}),c=h.drawText({x:e,y:s,text:a,textAnchor:"middle",fontSize:o.config.dataLabels.style.fontSize,fontFamily:o.config.dataLabels.style.fontFamily,fontWeight:o.config.dataLabels.style.fontWeight,foreColor:r});if(n.add(c),o.config.dataLabels.dropShadow.enabled){const t=o.config.dataLabels.dropShadow;l.dropShadow(c,t)}c.node.classList.add("apexcharts-pie-label"),o.config.chart.animations.animate&&!1===o.globals.resized&&(c.node.classList.add("apexcharts-pie-label-delay"),c.node.style.animationDelay=o.config.chart.animations.speed/940+"s"),this.sliceLabels.push(n),this.sliceLabelGroups[i]=n.node}}if(this.showExternalLabels&&0!==b){const t=this.getExternalLabelLines(i);if(t.some(t=>""!==t)){const e=v.polarToCartesian(this.centerX,this.centerY,o.globals.radialSize,_),s=v.polarToCartesian(this.centerX,this.centerY,o.globals.radialSize+(this.externalCfg.connector.gap||0),_),a=s.x>=this.centerX,r=a?s.x+(this.externalCfg.connector.length||0):s.x-(this.externalCfg.connector.length||0);this.externalLabels.push({i:i,lines:t,anchor:e,elbow:s,side:a?"right":"left",labelX:r+parseFloat(this.externalCfg.offsetX||0),idealY:s.y+parseFloat(this.externalCfg.offsetY||0),connectorColor:this.externalCfg.connector.color||o.globals.colors[i],foreColor:this.externalCfg.color||o.config.chart.foreColor})}}}if(this.showExternalLabels&&this.externalLabels.length){this.placeExternalLabels();const t=d.isBrowser()&&(m||this.dynamicAnim&&o.globals.dataChanged||this.initialAnim&&!o.globals.resized&&!o.globals.dataChanged);this.externalLabels.forEach(e=>{const i=new wr(o).drawExternalLabel({lines:e.lines,lineHeight:this.externalLabelLineH,anchor:e.anchor,elbow:e.elbow,labelX:e.labelX,labelY:e.labelY,side:e.side,connector:{show:this.externalCfg.connector.show,width:this.externalCfg.connector.width,color:e.connectorColor},style:this.externalLabelStyle,foreColor:e.foreColor});t&&(i.node.classList.add("apexcharts-element-hidden"),o.globals.delayedElements.push({el:i.node})),this.externalLabelGroups[e.i]=i.node,p.add(i)})}return p}placeExternalLabels(){const t=this.w,e=this.externalLabelMaxLines*this.externalLabelLineH+2,i=this.centerY+t.globals.radialSize+t.globals.pieExternalLabelMarginY;["left","right"].forEach(t=>{yr(this.externalLabels.filter(e=>e.side===t),e,i)})}addListeners(t,e,i){const s=new Dt(this.w,this.ctx);t.node.addEventListener("mouseenter",s.pathMouseEnter.bind(s,t)),t.node.addEventListener("mouseleave",s.pathMouseLeave.bind(s,t)),t.node.addEventListener("mouseleave",this.revertDataLabelsInner.bind(this)),"number"==typeof i&&(t.node.addEventListener("mouseenter",this.showHoverOutline.bind(this,i)),t.node.addEventListener("mouseleave",this.hideHoverOutline.bind(this))),t.node.addEventListener("mousedown",s.pathMouseDown.bind(s,t)),this.donutDataLabels.total.showAlways||(t.node.addEventListener("mouseenter",this.printDataLabelsInner.bind(this,t.node,e)),t.node.addEventListener("mousedown",this.printDataLabelsInner.bind(this,t.node,e)))}animatePaths(t,e){const i=this.w;let s=e.endAngle<e.startAngle?this.fullAngle+e.endAngle-e.startAngle:e.endAngle-e.startAngle,a=s,r=e.startAngle;const n=e.startAngle;void 0!==e.prevStartAngle&&void 0!==e.prevEndAngle&&(r=e.prevEndAngle,a=e.prevEndAngle<e.prevStartAngle?this.fullAngle+e.prevEndAngle-e.prevStartAngle:e.prevEndAngle-e.prevStartAngle),e.i===i.config.series.length-1&&(s+n>this.fullAngle?e.endAngle=e.endAngle-(s+n):s+n<this.fullAngle&&(e.endAngle=e.endAngle+(this.fullAngle-(s+n)))),s===this.fullAngle&&(s=this.fullAngle-.01),this.animateArc(t,r,n,s,a,e)}animateArc(t,e,i,s,a,r){const n=this,o=this.w,l=new Ct(this.w),h=r.size;let c;(isNaN(e)||isNaN(a))&&(e=i,a=s,r.dur=0);let d=s,p=i;const u=e<i?this.fullAngle+e-i:e-i,g="number"==typeof r.prevSize;o.globals.dataChanged&&r.shouldSetPrevPaths&&r.prevEndAngle&&(c=n.getPiePath({me:n,startAngle:r.prevStartAngle,angle:r.prevEndAngle<r.prevStartAngle?this.fullAngle+r.prevEndAngle-r.prevStartAngle:r.prevEndAngle-r.prevStartAngle,size:g?r.prevSize:h}),t.attr({d:c})),0!==r.dur?t.animate(r.dur,r.animBeginArr[r.i]).after(function(){"pie"!==n.chartType&&"donut"!==n.chartType&&"polarArea"!==n.chartType||this.animate(o.config.chart.animations.dynamicAnimation.speed).attr({"stroke-width":n.strokeWidth}),r.i===o.config.series.length-1&&l.animationCompleted(t)}).during(o=>{d=u+(s-u)*o,r.animateStartingPos&&(d=a+(s-a)*o,p=e-a+(i-(e-a))*o),c=n.getPiePath({me:n,startAngle:p,angle:d,size:g?r.prevSize+(h-r.prevSize)*o:h}),t.node.setAttribute("data:pathOrig",c),t.attr({d:c})}):(c=n.getPiePath({me:n,startAngle:p,angle:s,size:h}),r.isTrack||(o.globals.animationEnded=!0),t.node.setAttribute("data:pathOrig",c),t.attr({d:c,"stroke-width":n.strokeWidth}))}pieClicked(t,e){const i=this.w,s=!(e&&!1===e.animate),a=i.dom.Paper.findOne(`.apexcharts-${this.chartType.toLowerCase()}-slice-${t}`);if(!a)return;if("true"===a.attr("data:pieClicked"))return a.attr({"data:pieClicked":"false"}),this.revertDataLabelsInner(),void this.offsetSlice(t,0,s);const r=i.dom.baseEl.getElementsByClassName("apexcharts-pie-area");Array.prototype.forEach.call(r,t=>{const e="true"===t.getAttribute("data:pieClicked");t.setAttribute("data:pieClicked","false"),e&&this.offsetSlice(parseInt(t.getAttribute("j"),10),0,s)}),i.interact.capturedDataPointIndex=t,a.attr("data:pieClicked","true"),this.offsetSlice(t,this.getExpandOffset(),s)}getExpandOffset(){const t=this.w.config.plotOptions.pie;if(!t.expandOnClick||"polarArea"===this.chartType)return 0;if(Mt.drilldownBlocksSliceOffset(this.w))return 0;const e=Number(t.expandOffset);return Number.isFinite(e)&&e>0?e:0}getSliceMovers(t){const e=this.w.dom.Paper.findOne(`.apexcharts-${this.chartType.toLowerCase()}-slice-${t}`);return[e?e.node:null,this.sliceLabelGroups[t],this.externalLabelGroups[t],this.hoverOutlineIndex===t&&this.elHoverOutlinePath?this.elHoverOutlinePath.node:null].filter(Boolean)}offsetSlice(t,e,i=!0){const s=this.w;if(!s.dom.Paper.findOne(`.apexcharts-${this.chartType.toLowerCase()}-slice-${t}`))return;const{dx:a,dy:r}=this.getSliceOffsetVector(t,e),n=`translate(${a} ${r})`,o=i&&s.config.chart.animations.enabled?"transform 320ms cubic-bezier(0.25, 0.8, 0.3, 1)":"";this.getSliceMovers(t).forEach(t=>{t.style.transition=o,t.setAttribute("transform",n)})}getSliceOffsetVector(t,e){const i=this.w.dom.Paper.findOne(`.apexcharts-${this.chartType.toLowerCase()}-slice-${t}`),s=i?parseFloat(i.attr("data:angle")):NaN;if(!e||!Number.isFinite(s)||s>=this.fullAngle)return{dx:0,dy:0};const a=parseFloat(i.attr("data:startAngle")),r=Math.PI*(a+s/2-90)/180;return{dx:e*Math.cos(r),dy:e*Math.sin(r)}}showHoverOutline(t){const e=this.w;if(!Mt.hoverOutlineOwnsHoverState(e))return;if(!this.elHoverOutline)return;const i=this.getHoverOutlinePath(t);if(!i)return;const s=e.config.plotOptions.pie.hoverOutline,a=s.color||e.globals.colors[t];if(!this.elHoverOutlinePath){const t=new Dt(e);this.elHoverOutlinePath=t.drawPath({d:i,fill:a,strokeWidth:0,classes:"apexcharts-pie-hover-outline-band"}),this.elHoverOutline.add(this.elHoverOutlinePath)}this.elHoverOutlinePath.attr({d:i,fill:a,"fill-opacity":s.opacity});const{dx:r,dy:n}=this.getSliceOffsetVector(t,this.isSliceOut(t)?this.getExpandOffset():0);this.elHoverOutlinePath.node.style.transition="",this.elHoverOutlinePath.node.setAttribute("transform",`translate(${r} ${n})`),this.hoverOutlineIndex=t,this.elHoverOutline.node.style.opacity="1"}hideHoverOutline(){this.elHoverOutline&&(this.elHoverOutline.node.style.opacity="0")}isSliceOut(t){const e=this.w.dom.Paper.findOne(`.apexcharts-${this.chartType.toLowerCase()}-slice-${t}`);return!!e&&"true"===e.attr("data:pieClicked")}getHoverOutlinePath(t){const e=this.w,i=e.config.plotOptions.pie.hoverOutline,s=e.dom.Paper.findOne(`.apexcharts-${this.chartType.toLowerCase()}-slice-${t}`);if(!s)return null;const a=parseFloat(s.attr("data:angle"));if(!Number.isFinite(a)||a<=0)return null;const r=this.sliceSizes[t],n=Number(i.size);if(!Number.isFinite(r)||!Number.isFinite(n)||n<=0)return null;const{startDeg:h,spanDeg:c}=this.getSliceExtent({me:this,startAngle:parseFloat(s.attr("data:startAngle")),angle:a,size:r});if(!(c>0))return null;const d=r+(this.strokeWidth||0)/2+(Number(i.gap)||0),p=d+n,u={cx:this.centerX,cy:this.centerY,rIn:d,rOut:p,a0:h,a1:h+c,spanDeg:c},g=Math.min(n/2,c*Math.PI/180/2*d);return g>.5?kr(l(o({},u),{r:g})):_r(u)}getChangedPath(t,e,i){let s="";return this.dynamicAnim&&this.w.globals.dataChanged&&(s=this.getPiePath({me:this,startAngle:t,angle:e-t,size:"number"==typeof i?i:this.size})),s}getSliceExtent({me:t,startAngle:e,angle:i,size:s}){const a=this.w;let r=e,n=i+e;Math.ceil(n)>=this.fullAngle+this.w.config.plotOptions.pie.startAngle%this.fullAngle&&(n=this.fullAngle+this.w.config.plotOptions.pie.startAngle%this.fullAngle-.01);let o=n-r;const l="pie"===t.chartType||"donut"===t.chartType||"polarArea"===t.chartType,h=a.config.plotOptions.pie.spacing;if(l&&h>0&&o>0){const e="donut"===t.chartType?(s+t.donutSize)/2:s,i=e>0?h/e*(180/Math.PI):0,a=Math.min(i/2,Math.max(0,o/2-.5));r+=a,o-=2*a}return n=r+o,Math.ceil(n)>this.fullAngle&&(n-=this.fullAngle),{startDeg:r,spanDeg:o,endDeg:n}}getPiePath({me:t,startAngle:e,angle:i,size:s}){let a;const r=this.w,n=new Dt(this.w),{startDeg:o,spanDeg:l,endDeg:h}=this.getSliceExtent({me:t,startAngle:e,angle:i,size:s}),c="pie"===t.chartType||"donut"===t.chartType||"polarArea"===t.chartType,d=Math.PI*(o-90)/180,p=r.config.plotOptions.pie.borderRadius;if(p>0&&c){const e=this.getRoundedSlicePath({me:t,startDeg:o,spanDeg:l,size:s,borderRadius:p});if(e)return e}const u=Math.PI*(h-90)/180,g=t.centerX+s*Math.cos(d),f=t.centerY+s*Math.sin(d),x=t.centerX+s*Math.cos(u),m=t.centerY+s*Math.sin(u),b=v.polarToCartesian(t.centerX,t.centerY,t.donutSize,h),y=v.polarToCartesian(t.centerX,t.centerY,t.donutSize,o),w=l>180?1:0,A=["M",g,f,"A",s,s,0,w,1,x,m];return a="donut"===t.chartType?[...A,"L",b.x,b.y,"A",t.donutSize,t.donutSize,0,w,0,y.x,y.y,"L",g,f,"z"].join(" "):"pie"===t.chartType||"polarArea"===t.chartType?[...A,"L",t.centerX,t.centerY,"L",g,f].join(" "):[...A].join(" "),n.roundPathCorners(a,2*this.strokeWidth)}getRoundedSlicePath({me:t,startDeg:e,spanDeg:i,size:s,borderRadius:a}){if(!(i>0))return null;const r=Math.PI/180,n=t.centerX,o=t.centerY,l="donut"===t.chartType,h=s,c=l?t.donutSize:0,d=i*r;let p=a;if(p=Math.min(p,d*h/2),l?(p=Math.min(p,d*c/2),p=Math.min(p,(h-c)/2)):p=Math.min(p,h/2),!(p>.5))return null;const u=e,g=e+i;return l?kr({cx:n,cy:o,rIn:c,rOut:h,a0:u,a1:g,r:p,spanDeg:i}):function({cx:t,cy:e,rOut:i,a0:s,a1:a,r:r,spanDeg:n}){const o=(i,s)=>Sr(t,e,i,s),l=r/i*Ar,h=o(i,s+l),c=o(i,a-l),d=n-2*l>180?1:0,p=o(i,a),u=o(i-r,a),g=o(i,s),f=o(i-r,s);return["M",Cr(h),"A",i,i,0,d,1,Cr(c),"Q",Cr(p),Cr(u),"L",`${t} ${e}`,"L",Cr(f),"Q",Cr(g),Cr(h),"Z"].join(" ")}({cx:n,cy:o,rOut:h,a0:u,a1:g,r:p,spanDeg:i})}drawPolarElements(t){const e=this.w,i=new Ot(this.w),s=new Dt(this.w),a=new wr(this.w),r=s.group(),n=s.group(),o=i.niceScale(0,Math.ceil(this.maxY),0),l=o.result.reverse(),h=o.result.length;this.maxY=o.niceMax;let c=e.globals.radialSize;const d=c/(h-1);for(let t=0;t<h-1;t++){const i=s.drawCircle(c);if(i.attr({cx:this.centerX,cy:this.centerY,fill:"none","stroke-width":e.config.plotOptions.polarArea.rings.strokeWidth,stroke:e.config.plotOptions.polarArea.rings.strokeColor}),e.config.yaxis[0].show){const i=a.drawYAxisTexts(this.centerX,this.centerY-c+parseInt(e.config.yaxis[0].labels.style.fontSize,10)/2,t,l[t]);n.add(i)}r.add(i),c-=d}this.drawSpokes(t),t.add(r),t.add(n)}renderInnerDataLabels(t,e,i){const s=this.w,a=new Dt(this.w),r=e.total.show;t.node.innerHTML="",t.node.style.opacity=i.opacity;const n=i.centerX,o=this.donutDataLabels.total.label?i.centerY:i.centerY-i.centerY/6;let l,h;l=void 0===e.name.color?s.globals.colors[0]:e.name.color;let c=e.name.fontSize,d=e.name.fontFamily,p=e.name.fontWeight;h=void 0===e.value.color?s.config.chart.foreColor:e.value.color;const u=e.value.formatter;let g="",f="";if(r?(l=e.total.color,c=e.total.fontSize,d=e.total.fontFamily,p=e.total.fontWeight,f=this.donutDataLabels.total.label?e.total.label:"",g=e.total.formatter(s)):1===s.seriesData.series.length&&(g=u(s.seriesData.series[0],s),f=s.seriesData.seriesNames[0]),f&&(f=e.name.formatter(f,e.total.show,s)),e.name.show){const i=a.drawText({x:n,y:o+parseFloat(e.name.offsetY),text:f,textAnchor:"middle",foreColor:l,fontSize:c,fontWeight:p,fontFamily:d});i.node.classList.add("apexcharts-datalabel-label"),t.add(i)}if(e.value.show){const i=e.name.show?parseFloat(e.value.offsetY)+16:e.value.offsetY,s=a.drawText({x:n,y:o+i,text:g,textAnchor:"middle",foreColor:h,fontWeight:e.value.fontWeight,fontSize:e.value.fontSize,fontFamily:e.value.fontFamily});s.node.classList.add("apexcharts-datalabel-value"),t.add(s)}return t}printInnerLabels(t,e,i,s){const a=this.w;let r;s?r=void 0===t.name.color?a.globals.colors[parseInt(s.parentNode.getAttribute("rel"),10)-1]:t.name.color:a.seriesData.series.length>1&&t.total.show&&(r=t.total.color);const n=a.dom.baseEl.querySelector(".apexcharts-datalabel-label"),o=a.dom.baseEl.querySelector(".apexcharts-datalabel-value");i=(0,t.value.formatter)(i,a),s||"function"!=typeof t.total.formatter||(i=t.total.formatter(a));const l=e===t.total.label;if(e=this.donutDataLabels.total.label?t.name.formatter(e,l,a):"",null!==n&&(n.textContent=e),null!==o&&(o.textContent=i),null!==n){n.style.fill=r}}printDataLabelsInner(t,e){const i=this.w,s=t.getAttribute("data:value"),a=i.seriesData.seriesNames[parseInt(t.parentNode.getAttribute("rel"),10)-1];i.seriesData.series.length>1&&this.printInnerLabels(e,a,s,t);const r=i.dom.baseEl.querySelector(".apexcharts-datalabels-group");if(null!==r){r.style.opacity="1"}}drawSpokes(t){const e=this.w,i=new Dt(this.w),s=e.config.plotOptions.polarArea.spokes;if(0===s.strokeWidth)return;const a=[],r=360/e.seriesData.series.length;for(let t=0;t<e.seriesData.series.length;t++)a.push(v.polarToCartesian(this.centerX,this.centerY,e.globals.radialSize,e.config.plotOptions.pie.startAngle+r*t));a.forEach((e,a)=>{const r=i.drawLine(e.x,e.y,this.centerX,this.centerY,Array.isArray(s.connectorColors)?s.connectorColors[a]:s.connectorColors);t.add(r)})}revertDataLabelsInner(){const t=this.w;if(this.donutDataLabels.show){const e=t.dom.Paper.findOne(".apexcharts-datalabels-group"),i=this.renderInnerDataLabels(e,this.donutDataLabels,{hollowSize:this.donutSize,centerX:this.centerX,centerY:this.centerY,opacity:this.donutDataLabels.show});t.dom.Paper.findOne(".apexcharts-radialbar, .apexcharts-pie").add(i)}}}function Dr(t,e){let i=0;for(let e=0;e<t.length;e++)i+=t[e];const s=e/i,a=new Array(t.length);for(let e=0;e<t.length;e++)a[e]=t[e]*s;return a}function Lr(t,e,i,s){const a=s*s,r=i*i;return Math.max(a*e/r,r/(a*t))}function Pr(t,e,i,s,a,r){if(0===t)return!0;return Lr(e,i,s,r)>=Lr(Math.min(e,a),Math.max(i,a),s+a,r)}function Er(t,e,i,s,a,r,n,o){if(n>=o){const n=s/o;let l=r;for(let s=0;s<i;s++){const i=e[s]/n;t.push([a,l,a+n,l+i]),l+=i}}else{const o=s/n;let l=a;for(let s=0;s<i;s++){const i=e[s]/o;t.push([l,r,l+i,r+o]),l+=i}}}function Tr(t,e,i,s,a){const r=[],n=t.length;if(0===n)return r;const o=new Array(n);let l=0,h=0,c=1/0,d=-1/0,p=0;for(;p<n;){const n=Math.min(s,a),u=t[p];if(Pr(l,c,d,h,u,n))o[l]=u,l++,h+=u,u<c&&(c=u),u>d&&(d=u),p++;else{if(Er(r,o,l,h,e,i,s,a),s>=a){const t=h/a;e+=t,s-=t}else{const t=h/s;i+=t,a-=t}l=0,h=0,c=1/0,d=-1/0}}return l>0&&Er(r,o,l,h,e,i,s,a),r}function Fr(t){const e=t.children;if(e&&e.length){let i=0;for(let t=0;t<e.length;t++)i+=Fr(e[t]);return t._area=i,i}const i=Number(t.value),s=isNaN(i)?0:Math.abs(i);return t._area=s,s}function Ir(t,e,i,s,a,r,n,o){const l=t.length;if(0===l||s<=0||a<=0)return;const h=new Array(l);let c=0;for(let e=0;e<l;e++)h[e]=t[e]._area,c+=h[e];if(c<=0)return;const d=Tr(Dr(h,s*a),e,i,s,a);for(let e=0;e<l;e++){const i=t[e],s=d[e];if(!s)continue;i.rect=s,i.depth=r;const a=i.children;if(!a||!a.length)continue;const l=s[2]-s[0],h=s[3]-s[1];let c=Math.max(0,n(i,r,l,h)||0);(2*c>=l||2*c>=h)&&(c=0);let p=Math.max(0,o(i,r,l,h)||0);p>0&&h-2*c-p<p&&(p=0),i.headerHeight=p,Ir(a,s[0]+c,s[1]+p+c,l-2*c,h-p-2*c,r+1,n,o)}}const Rr={generate:function(t,e,i){const s=t.length,a=new Array(s);for(let e=0;e<s;e++){let i=0;const s=t[e];for(let t=0;t<s.length;t++)i+=s[t];a[e]=i}const r=Tr(Dr(a,e*i),0,0,e,i),n=new Array(s);for(let e=0;e<s;e++){const i=r[e],s=i[0],a=i[1],o=i[2]-s,l=i[3]-a;n[e]=Tr(Dr(t[e],o*l),s,a,o,l)}return n},generateNested:function(t,e,i,s={}){if(!Array.isArray(t)||0===t.length)return t||[];const a=s.padding||(()=>0),r=s.header||(()=>0);for(let e=0;e<t.length;e++)Fr(t[e]);return Ir(t,0,0,e,i,0,a,r),t}};const Xr=Math.PI*(3-Math.sqrt(5));function zr(t){return 1-Math.pow(1-t,3)}function Br(t){return t<.5?4*t*t*t:1-Math.pow(-2*t+2,3)/2}function Nr(t,e){const[i,s]=null!=(r=Hs[null!=(a=t)?a:"crisp"])?r:Hs.crisp;var a,r;const n=800/Math.max(1,e);return[i*n*n,s*n]}const Yr=Math.PI/180,Or=180/Math.PI,Wr="http://www.w3.org/2000/svg",Hr="http://www.w3.org/1999/xhtml",$r=(t,e,i)=>t+(e-t)*i;return Ks.use({line:mr,area:mr,scatter:mr,bubble:mr,rangeArea:mr,bar:er,column:er,barStacked:class extends er{draw(t,e){const i=this.w;this.graphics=new Dt(this.w),this.bar=new er(this.w,this.ctx,this.xyRatios);const s=new H(this.w);t=s.getLogSeries(t),this.yRatio=s.getLogYRatios(this.yRatio),this.barHelpers.initVariables(t),"100%"===i.config.chart.stackType&&(t=i.globals.comboCharts?e.map(t=>i.globals.seriesPercent[t]):i.globals.seriesPercent.slice()),this.series=t,this.barHelpers.initializeStackedPrevVars(this);const a=this.graphics.group({class:"apexcharts-bar-series apexcharts-plot-series"});let r=0,n=0;const h=i.config.chart.animations,c=h.enabled&&h.dynamicAnimation.enabled&&i.globals.previousPaths.length>0;let d=!1;for(let s=0,h=0;s<t.length;s++,h++){const p=i.globals.comboCharts?e[s]:s,{groupIndex:u,columnGroupIndex:g}=this.barHelpers.getGroupIndex(p);this.groupCtx=this[i.labelData.seriesGroups[u]];const f=[],x=[];let m=0;this.yRatio.length>1&&(this.yaxisIndex=i.globals.seriesYAxisReverseMap[p][0],m=p),this.isReversed=i.config.yaxis[this.yaxisIndex]&&i.config.yaxis[this.yaxisIndex].reversed;let b=this.graphics.group({class:"apexcharts-series",seriesName:v.escapeString(i.seriesData.seriesNames[p]),rel:s+1,"data:realIndex":p});Be.addCollapsedClassToSeries(this.w,b,p);const y=this.graphics.group({class:"apexcharts-datalabels","data:realIndex":p});Be.addCollapsedClassToSeries(this.w,y,p),(i.globals.collapsingSeriesIndices||[]).indexOf(p)>-1&&y.node.style.setProperty("--apexcharts-dl-exit",`${i.config.chart.animations.dynamicAnimation.speed}ms`);const w=this.graphics.group({class:"apexcharts-bar-goals-markers"}),A=this.initialPositions(r,n,void 0,void 0,void 0,void 0,m),{xDivision:S,yDivision:C,zeroH:k,zeroW:_}=A;let M=A.barHeight,D=A.barWidth;n=A.y,r=A.x,i.globals.barHeight=M,i.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(()=>k),this.groupCtx.prevYF[0]=this.groupCtx.prevYF[0].map(()=>0));for(let e=0;e<i.globals.dataPoints;e++){const a=this.barHelpers.getStrokeWidth(s,e,p),v={indexes:{i:s,j:e,realIndex:p,translationsIndex:m,bc:h},strokeWidth:a,x:r,y:n,elSeries:b,columnGroupIndex:g,seriesGroup:i.labelData.seriesGroups[u]};let A=null;this.isHorizontal?(A=this.drawStackedBarPaths(l(o({},v),{zeroW:_,barHeight:M,yDivision:C})),D=this.series[s][e]/this.invertedYRatio):(A=this.drawStackedColumnPaths(l(o({},v),{xDivision:S,barWidth:D,zeroH:k})),M=this.series[s][e]/this.yRatio[m]);const L=this.barHelpers.drawGoalLine({barXPosition:A.barXPosition,barYPosition:A.barYPosition,goalX:A.goalX,goalY:A.goalY,barHeight:M,barWidth:D});L&&w.add(L),n=A.y,r=A.x,f.push(r),x.push(n);const P=this.barHelpers.getPathFillColor(t,s,e,p);let E="";const T=i.globals.isBarHorizontal?"apexcharts-flip-x":"apexcharts-flip-y",F="bottom"===this.barHelpers.arrBorderRadius[p][e]&&i.seriesData.series[p][e]>0||"top"===this.barHelpers.arrBorderRadius[p][e]&&i.seriesData.series[p][e]<0,I=c&&!F&&this.getPreviousFlip(p,e);(F||I)&&(E=T),I&&(E+=" apexcharts-flip-held",d=!0),b=this.renderSeries(l(o({realIndex:p,pathFill:P.color},P.useRangeColor?{lineFill:P.color}:{}),{j:e,i:s,columnGroupIndex:g,pathFrom:A.pathFrom,pathTo:A.pathTo,strokeWidth:a,elSeries:b,x:r,y:n,series:t,barHeight:M,barWidth:D,elDataLabelsWrap:y,elGoalsMarkers:w,type:"bar",visibleSeries:g,classes:E}))}i.globals.seriesXvalues[p]=f,i.globals.seriesYvalues[p]=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),a.add(b)}return d&&this.settleHeldMirrors(),a}settleHeldMirrors(){const t=this.w;if(!d.isBrowser())return;const e=t.config.chart.animations,i=(e.dynamicAnimation.speed||0)+(e.speed||0)+100;setTimeout(()=>{!t.globals.isDestroyed&&v.elementExists(t.dom.baseEl)&&t.dom.baseEl.querySelectorAll(".apexcharts-flip-held").forEach(t=>{t.classList.remove("apexcharts-flip-held","apexcharts-flip-y","apexcharts-flip-x")})},i)}initialPositions(t,e,i,s,a,r,n){const o=this.w;let l,h;if(this.isHorizontal){s=o.layout.gridHeight/o.globals.dataPoints;const t=o.config.plotOptions.bar.barHeight;l=-1===String(t).indexOf("%")?parseInt(t,10):s*parseInt(t,10)/100,r=o.globals.padHorizontal+(this.isReversed?o.layout.gridWidth-this.baseLineInvertedY:this.baseLineInvertedY),e=(s-l)/2}else{h=i=o.layout.gridWidth/o.globals.dataPoints;const e=o.config.plotOptions.bar.columnWidth;o.axisFlags.isXNumeric&&o.globals.dataPoints>1?h=(i=o.globals.minXDiff/this.xRatio)*parseInt(this.barOptions.columnWidth,10)/100:-1===String(e).indexOf("%")?h=parseInt(e,10):h*=parseInt(e,10)/100,a=this.isReversed?this.baseLineY[n]:o.layout.gridHeight-this.baseLineY[n],t=o.globals.padHorizontal+(i-h)/2}const c=o.globals.barGroups.length||1;return{x:t,y:e,yDivision:s,xDivision:i,barHeight:(null!=l?l:0)/c,barWidth:(null!=h?h:0)/c,zeroH:a,zeroW:r}}drawStackedBarPaths({indexes:t,barHeight:e,strokeWidth:i,zeroW:s,x:a,y:r,columnGroupIndex:n,seriesGroup:o,yDivision:l,elSeries:h}){var c,d,p,u,g;const f=this.w,x=r+n*e;let m;const b=t.i,y=t.j,w=t.realIndex,v=t.translationsIndex;let A=0;for(let t=0;t<this.groupCtx.prevXF.length;t++)A+=this.groupCtx.prevXF[t][y];let S=b;if(f.config.series[w].name&&(S=o.indexOf(f.config.series[w].name)),S>0){let t=s;this.groupCtx.prevXVal[S-1][y]<0?t=(null==(c=this.series[b])?void 0:c[y])>=0?this.groupCtx.prevX[S-1][y]+A-2*(this.isReversed?A:0):this.groupCtx.prevX[S-1][y]:this.groupCtx.prevXVal[S-1][y]>=0&&(t=(null==(d=this.series[b])?void 0:d[y])>=0?this.groupCtx.prevX[S-1][y]:this.groupCtx.prevX[S-1][y]-A+2*(this.isReversed?A:0)),m=t}else m=s;a=null===(null==(p=this.series[b])?void 0:p[y])?m:m+(null==(u=this.series[b])?void 0:u[y])/this.invertedYRatio-2*(this.isReversed?(null==(g=this.series[b])?void 0:g[y])/this.invertedYRatio:0);const C=this.barHelpers.getBarpaths({barYPosition:x,barHeight:e,x1:m,x2:a,strokeWidth:i,isReversed:this.isReversed,series:this.series,realIndex:t.realIndex,seriesGroup:o,i:b,j:y,w:f});return this.barHelpers.barBackground({j:y,i:b,y1:x,y2:e,elSeries:h}),r+=l,{pathTo:C.pathTo,pathFrom:C.pathFrom,goalX:this.barHelpers.getGoalValues("x",s,null,w,y,v),barXPosition:m,barYPosition:x,x:a,y:r}}drawStackedColumnPaths({indexes:t,x:e,y:i,xDivision:s,barWidth:a,zeroH:r,columnGroupIndex:n,seriesGroup:o,elSeries:l}){var h,c,d,p,u,g,f,x,m;const b=this.w,y=t.i,w=t.j,v=t.bc,A=t.realIndex,S=t.translationsIndex;if(b.axisFlags.isXNumeric){let t=b.seriesData.seriesX[A][w];t||(t=0),e=(t-b.globals.minX)/this.xRatio-a/2*b.globals.barGroups.length}const C=e+n*a;let k,_=0;for(let t=0;t<this.groupCtx.prevYF.length;t++)_+=isNaN(this.groupCtx.prevYF[t][w])?0:this.groupCtx.prevYF[t][w];let M=y;if(o&&(M=o.indexOf(b.seriesData.seriesNames[A])),M>0&&!b.axisFlags.isXNumeric||M>0&&b.axisFlags.isXNumeric&&b.seriesData.seriesX[A-1][w]===b.seriesData.seriesX[A][w]){let t,e;const i=Math.min(this.yRatio.length+1,A+1);if(void 0!==this.groupCtx.prevY[M-1]&&this.groupCtx.prevY[M-1].length)for(let t=1;t<i;t++)if(!isNaN(null==(h=this.groupCtx.prevY[M-t])?void 0:h[w])){e=this.groupCtx.prevY[M-t][w];break}for(let s=1;s<i;s++){if((null==(c=this.groupCtx.prevYVal[M-s])?void 0:c[w])<0){t=(null==(d=this.series[y])?void 0:d[w])>=0?e-_+2*(this.isReversed?_:0):e;break}if((null==(p=this.groupCtx.prevYVal[M-s])?void 0:p[w])>=0){t=(null==(u=this.series[y])?void 0:u[w])>=0?e:e+_-2*(this.isReversed?_:0);break}}void 0===t&&(t=b.layout.gridHeight),k=(null==(g=this.groupCtx.prevYF[0])?void 0:g.every(t=>0===t))&&this.groupCtx.prevYF.slice(1,M).every(t=>t.every(t=>isNaN(t)))?r:t}else k=r;i=(null==(f=this.series[y])?void 0:f[w])?k-(null==(x=this.series[y])?void 0:x[w])/this.yRatio[S]+2*(this.isReversed?(null==(m=this.series[y])?void 0:m[w])/this.yRatio[S]:0):k;const D=this.barHelpers.getColumnPaths({barXPosition:C,barWidth:a,y1:k,y2:i,yRatio:this.yRatio[S],strokeWidth:this.strokeWidth,isReversed:this.isReversed,series:this.series,seriesGroup:o,realIndex:t.realIndex,i:y,j:w,w:b});return this.barHelpers.barBackground({bc:v,j:w,i:y,x1:C,x2:a,elSeries:l}),{pathTo:D.pathTo,pathFrom:D.pathFrom,goalY:this.barHelpers.getGoalValues("y",null,r,A,w,0),barXPosition:C,x:b.axisFlags.isXNumeric?e:e+s,y:i}}},rangeBar:class extends er{draw(t,e){var i,s,a,r,n,l,h,c,d;const p=this.w,u=new Dt(this.w);this.rangeBarOptions=this.w.config.plotOptions.rangeBar,this.series=t,this.seriesRangeStart=p.rangeData.seriesRangeStart,this.seriesRangeEnd=p.rangeData.seriesRangeEnd,this.barHelpers.initVariables(t);const g=u.group({class:"apexcharts-rangebar-series apexcharts-plot-series"});for(let f=0;f<t.length;f++){let x,m;const b=p.globals.comboCharts?e[f]:f,{columnGroupIndex:y}=this.barHelpers.getGroupIndex(b),w=u.group({class:"apexcharts-series",seriesName:v.escapeString(p.seriesData.seriesNames[b]),rel:f+1,"data:realIndex":b});Be.addCollapsedClassToSeries(this.w,w,b),t[f].length>0&&(this.visibleI=this.visibleI+1);let A=0;this.yRatio.length>1&&(this.yaxisIndex=p.globals.seriesYAxisReverseMap[b][0],A=b);const S=this.barHelpers.initialPositions(b),{y:C,zeroW:k,x:_,zeroH:M}=S;let D=null!=(i=S.barWidth)?i:0,L=null!=(s=S.barHeight)?s:0;const P=null!=(a=S.yDivision)?a:0,E=null!=(r=S.xDivision)?r:0;m=C,x=_;const T=u.group({class:"apexcharts-datalabels","data:realIndex":b}),F=u.group({class:"apexcharts-rangebar-goals-markers"});for(let e=0;e<p.globals.dataPoints;e++){const i=this.barHelpers.getStrokeWidth(f,e,b),s=this.seriesRangeStart[f][e],a=this.seriesRangeEnd[f][e];let r=null,u=null,g=null;const v={x:x,y:m,strokeWidth:i,elSeries:w};let C=this.seriesLen;if(p.config.plotOptions.bar.rangeBarGroupRows&&(C=1),void 0===(null==(n=p.config.series[f].data)?void 0:n[e]))break;if(this.isHorizontal){g=m+L*this.visibleI;const t=(P-L*C)/2;if(null==(h=null==(l=p.config.series[f].data)?void 0:l[e])?void 0:h.x){const i=this.detectOverlappingBars({i:f,j:e,barYPosition:g,srty:t,barHeight:L,yDivision:P,initPositions:S});L=i.barHeight,g=i.barYPosition}r=this.drawRangeBarPaths(o({indexes:{i:f,j:e,realIndex:b},barHeight:L,barYPosition:g,zeroW:k,yDivision:P,y1:s,y2:a},v)),D=r.barWidth}else{p.axisFlags.isXNumeric&&(x=(p.seriesData.seriesX[f][e]-p.globals.minX)/this.xRatio-D/2),u=x+D*this.visibleI;const t=(E-D*C)/2;if(null==(d=null==(c=p.config.series[f].data)?void 0:c[e])?void 0:d.x){const i=this.detectOverlappingBars({i:f,j:e,barXPosition:u,srtx:t,barWidth:D,xDivision:E,initPositions:S});D=i.barWidth,u=i.barXPosition}r=this.drawRangeColumnPaths(o({indexes:{i:f,j:e,realIndex:b,translationsIndex:A},barWidth:D,barXPosition:u,zeroH:M,xDivision:E},v)),L=r.barHeight}const _=this.barHelpers.drawGoalLine({barXPosition:r.barXPosition,barYPosition:g,goalX:r.goalX,goalY:r.goalY,barHeight:L,barWidth:D});_&&F.add(_),m=r.y,x=r.x;const I=this.barHelpers.getPathFillColor(t,f,e,b);this.renderSeries({realIndex:b,pathFill:I.color,lineFill:I.useRangeColor?I.color:p.globals.stroke.colors[b],j:e,i:f,x:x,y:m,y1:s,y2:a,pathFrom:r.pathFrom,pathTo:r.pathTo,strokeWidth:i,elSeries:w,series:t,barHeight:L,barWidth:D,barXPosition:u,barYPosition:g,columnGroupIndex:y,elDataLabelsWrap:T,elGoalsMarkers:F,visibleSeries:this.visibleI,type:"rangebar"})}g.add(w)}return g}detectOverlappingBars({i:t,j:e,barYPosition:i,barXPosition:s,srty:a,srtx:r,barHeight:n,barWidth:o,yDivision:l,xDivision:h,initPositions:c}){var d,p,u,g;const f=this.w;let x=[];const m=null==(p=null==(d=f.globals.seriesRangeName)?void 0:d[t])?void 0:p[e],b=null==(g=null==(u=f.config.series[t].data)?void 0:u[e])?void 0:g.x,y=Array.isArray(b)?b.join(" "):b,w=f.labelData.labels.map(t=>Array.isArray(t)?t.join(" "):t).indexOf(y),v=f.rangeData.seriesRange[t].findIndex(t=>{var e;return t.x===y&&(null==(e=t.overlaps)?void 0:e.size)>0});return this.isHorizontal?(i=f.config.plotOptions.bar.rangeBarGroupRows?a+l*w:a+n*this.visibleI+l*w,v>-1&&!f.config.plotOptions.bar.rangeBarOverlap&&(x=Array.from(f.rangeData.seriesRange[t][v].overlaps),x.indexOf(m)>-1&&(i=(n=c.barHeight/x.length)*this.visibleI+l*(100-parseInt(this.barOptions.barHeight,10))/100/2+n*(this.visibleI+x.indexOf(m))+l*w))):(w>-1&&!f.labelData.timescaleLabels.length&&(s=f.config.plotOptions.bar.rangeBarGroupRows?r+h*w:r+o*this.visibleI+h*w),v>-1&&!f.config.plotOptions.bar.rangeBarOverlap&&(x=Array.from(f.rangeData.seriesRange[t][v].overlaps),x.indexOf(m)>-1&&(s=(o=c.barWidth/x.length)*this.visibleI+h*(100-parseInt(this.barOptions.barWidth,10))/100/2+o*(this.visibleI+x.indexOf(m))+h*w))),{barYPosition:i,barXPosition:s,barHeight:n,barWidth:o}}drawRangeColumnPaths({indexes:t,x:e,xDivision:i,barWidth:s,barXPosition:a,zeroH:r}){var n,o;const l=this.w,{i:h,j:c,realIndex:d,translationsIndex:p}=t,u=this.yRatio[p],g=this.getRangeValue(d,c);let f=Math.min(g.start,g.end),x=Math.max(g.start,g.end);void 0===(null==(n=this.series[h])?void 0:n[c])||null===(null==(o=this.series[h])?void 0:o[c])?f=r:(f=r-f/u,x=r-x/u);const m=Math.abs(x-f),b=this.barHelpers.getColumnPaths({barXPosition:a,barWidth:s,y1:f,y2:x,strokeWidth:this.strokeWidth,series:this.seriesRangeEnd,realIndex:d,i:d,j:c,w:l});if(l.axisFlags.isXNumeric){const t=this.getBarXForNumericXAxis({x:e,j:c,realIndex:d,barWidth:s});e=t.x,a=t.barXPosition}else e+=i;return{pathTo:b.pathTo,pathFrom:b.pathFrom,barHeight:m,x:e,y:g.start<0&&g.end<0?f:x,goalY:this.barHelpers.getGoalValues("y",null,r,d,c,p),barXPosition:a}}preventBarOverflow(t){const e=this.w;return t<0&&(t=0),t>e.layout.gridWidth&&(t=e.layout.gridWidth),t}drawRangeBarPaths({indexes:t,y:e,y1:i,y2:s,yDivision:a,barHeight:r,barYPosition:n,zeroW:o}){const l=this.w,{realIndex:h,j:c}=t,d=this.preventBarOverflow(o+i/this.invertedYRatio),p=this.preventBarOverflow(o+s/this.invertedYRatio),u=this.getRangeValue(h,c),g=Math.abs(p-d),f=this.barHelpers.getBarpaths({barYPosition:n,barHeight:r,x1:d,x2:p,strokeWidth:this.strokeWidth,series:this.seriesRangeEnd,i:h,realIndex:h,j:c,w:l});return l.axisFlags.isXNumeric||(e+=a),{pathTo:f.pathTo,pathFrom:f.pathFrom,barWidth:g,x:u.start<0&&u.end<0?d:p,goalX:this.barHelpers.getGoalValues("x",o,null,h,c,0),y:e}}getRangeValue(t,e){const i=this.w;return{start:i.rangeData.seriesRangeStart[t][e],end:i.rangeData.seriesRangeEnd[t][e]}}},candlestick:hr,boxPlot:hr,violin:class extends er{draw(t,e,i){const s=this.w,a=new Dt(this.w),r=new Lt(this.w);this.violinOptions=s.config.plotOptions.violin,this.pointsOptions=this.violinOptions.points,this.bandwidthScale=this.violinOptions.bandwidthScale||1,this.normalize=this.violinOptions.normalize||"individual",this.distributed=s.config.plotOptions.bar.distributed,this.isHorizontal=s.config.plotOptions.bar.horizontal,this.coreUtils=new H(this.w),t=this.coreUtils.getLogSeries(t),this.series=t,this.yRatio=this.coreUtils.getLogYRatios(this.yRatio),this.barHelpers.initVariables(t);const n=a.group({class:"apexcharts-violin-series apexcharts-plot-series"});for(let e=0;e<t.length;e++){let o,l;const h=[],c=[],d=s.globals.comboCharts?i[e]:e,{columnGroupIndex:p}=this.barHelpers.getGroupIndex(d),u=a.group({class:"apexcharts-series",seriesName:v.escapeString(s.seriesData.seriesNames[d]),rel:e+1,"data:realIndex":d});Be.addCollapsedClassToSeries(this.w,u,d),t[e].length>0&&(this.visibleI=this.visibleI+1);let g=0;this.yRatio.length>1&&(this.yaxisIndex=s.globals.seriesYAxisReverseMap[d][0],g=d);const f=this.barHelpers.initialPositions(d),{y:x,barHeight:m,yDivision:b,zeroW:y,x:w,barWidth:A,xDivision:S,zeroH:C}=f;l=x,o=w,c.push(o+(null!=A?A:0)/2);const k=a.group({class:"apexcharts-datalabels","data:realIndex":d});if(this.seriesMaxWeight=0,"group"===this.normalize){(s.violinData.seriesViolinDensity[d]||[]).forEach(t=>{t&&t.maxWeight>this.seriesMaxWeight&&(this.seriesMaxWeight=t.maxWeight)})}const _=[];for(let i=0;i<s.globals.dataPoints;i++){const a=this.barHelpers.getStrokeWidth(e,i,d),n=this.isHorizontal?this.drawHorizontalViolin({indexes:{i:e,j:i,realIndex:d,translationsIndex:g},y:l,yDivision:b,barHeight:m,zeroW:y}):this.drawVerticalViolin({indexes:{i:e,j:i,realIndex:d,translationsIndex:g},x:o,xDivision:S,barWidth:A,zeroH:C});o=n.x,l=n.y,i>0&&c.push(n.center),h.push(n.alongRepresentative);const f=this.buildPointsSubPath({realIndex:d,j:i,center:n.center,halfExtent:n.halfExtent,alongFn:n.alongFn,density:n.density,maxWeight:n.maxWeight});f.length&&_.push({groups:f,j:i});const x=r.fillPath({seriesNumber:this.distributed?i:d,dataPointIndex:i,color:this.distributed?s.globals.colors[i]:void 0,value:t[e][i]});this.renderSeries({realIndex:d,pathFill:x,lineFill:s.globals.stroke.colors[d],j:i,i:e,pathFrom:n.pathFrom,pathTo:n.pathTo,strokeWidth:a,elSeries:u,x:o,y:l,series:t,columnGroupIndex:p,barHeight:m,barWidth:A,elDataLabelsWrap:k,visibleSeries:this.visibleI,type:"violin"});const w=u.node.querySelector(`path.apexcharts-violin-area[j='${i}']`);w&&isFinite(n.alongRepresentative)&&w.setAttribute(this.isHorizontal?"cx":"cy",`${n.alongRepresentative}`)}sr({graphics:a,w:s,elSeries:u,pointsByCat:_,options:this.pointsOptions,distributed:this.distributed,realIndex:d,wrapClass:"apexcharts-violin-points-wrap",pointClass:"apexcharts-violin-points"}),s.globals.seriesXvalues[d]=c,s.globals.seriesYvalues[d]=h,n.add(u)}return n}drawVerticalViolin({indexes:t,x:e,xDivision:i,barWidth:s,zeroH:a}){var r,n,o;const l=this.w,{realIndex:h,j:c,translationsIndex:d}=t,p=this.yRatio[d];l.axisFlags.isXNumeric&&(e=(l.seriesData.seriesX[h][c]-l.globals.minX)/this.xRatio-s/2);const u=e+s*this.visibleI+s/2,g=s/2,f=this.getDensity(h,c),x=this.effectiveMaxWeight(f),m=t=>a-this.logVal(t,h)/p,b=this.buildBodyPath({nodes:f.nodes,center:u,halfExtent:g,maxWeight:x,vertical:!0,alongFn:m,collapsed:!1});let y=null;const w=null==(n=null==(r=this.ctx)?void 0:r.morphTypeChange)?void 0:n.getInitialPathFor(h,c);return w?y=w:l.globals.previousPaths.length>0&&(y=this.getPreviousPath(h,c,b)),null==y&&(y=this.buildBodyPath({nodes:f.nodes,center:u,halfExtent:g,maxWeight:x,vertical:!0,alongFn:m,collapsed:!0})),l.axisFlags.isXNumeric||(e+=i),{pathTo:b,pathFrom:y,x:e,y:a,center:u,halfExtent:g,alongFn:m,density:f,maxWeight:x,alongRepresentative:m(null!=(o=this.series[t.i][c])?o:0)}}drawHorizontalViolin({indexes:t,y:e,yDivision:i,barHeight:s,zeroW:a}){var r,n,o;const l=this.w,{realIndex:h,j:c}=t,d=this.invertedYRatio;l.axisFlags.isXNumeric&&(e=(l.seriesData.seriesX[h][c]-l.globals.minX)/this.invertedXRatio-s/2);const p=e+s*this.visibleI+s/2,u=s/2,g=this.getDensity(h,c),f=this.effectiveMaxWeight(g),x=t=>a+this.logVal(t,h)/d,m=this.buildBodyPath({nodes:g.nodes,center:p,halfExtent:u,maxWeight:f,vertical:!1,alongFn:x,collapsed:!1});let b=null;const y=null==(n=null==(r=this.ctx)?void 0:r.morphTypeChange)?void 0:n.getInitialPathFor(h,c);return y?b=y:l.globals.previousPaths.length>0&&(b=this.getPreviousPath(h,c,m)),null==b&&(b=this.buildBodyPath({nodes:g.nodes,center:p,halfExtent:u,maxWeight:f,vertical:!1,alongFn:x,collapsed:!0})),l.axisFlags.isXNumeric||(e+=i),{pathTo:m,pathFrom:b,x:a,y:e,center:p,halfExtent:u,alongFn:x,maxWeight:f,density:g,alongRepresentative:x(null!=(o=this.series[t.i][c])?o:0)}}getDensity(t,e){var i;const s=null==(i=this.w.violinData.seriesViolinDensity[t])?void 0:i[e];if(!s||!s.values.length)return{nodes:[],maxWeight:0};const a=s.values.map((t,e)=>e);a.sort((t,e)=>s.values[t]-s.values[e]);const r=[];let n=null;for(const t of a){const e=s.values[t];null!==n&&e===n||(r.push({v:e,w:s.weights[t]}),n=e)}return{nodes:r,maxWeight:s.maxWeight}}effectiveMaxWeight(t){return"group"===this.normalize&&this.seriesMaxWeight>0?this.seriesMaxWeight:t.maxWeight}buildBodyPath({nodes:t,center:e,halfExtent:i,maxWeight:s,vertical:a,alongFn:r,collapsed:n}){const o=new Dt(this.w);if(0===t.length){const t=r(0);return a?o.move(e,t)+o.line(e,t):o.move(t,e)+o.line(t,e)}const l=t=>{if(n||s<=0)return 0;const e=t/s*i*this.bandwidthScale;return Math.min(i,Math.max(0,e))},h=[],c=[];for(let i=0;i<t.length;i++){const s=r(t[i].v),n=l(t[i].w);a?(h.push([e+n,s]),c.push([e-n,s])):(h.push([s,e+n]),c.push([s,e-n]))}return c.reverse(),this.smoothSegment(h,a,!1)+this.smoothSegment(c,a,!0)+"z"}smoothSegment(t,e,i){const s=new Dt(this.w),a=t[0];let r=i?s.line(a[0],a[1]):s.move(a[0],a[1]);if(t.length<3||!this.strictlyMonotonic(t,e)){for(let e=1;e<t.length;e++)r+=s.line(t[e][0],t[e][1]);return r}const n=t.map(([t,i])=>e?[i,t]:[t,i]),o=pr.points(n),l=e?o.map(gr):o;return r+=dr(l),r}strictlyMonotonic(t,e){const i=e?1:0;for(let e=1;e<t.length;e++)if(t[e][i]===t[e-1][i])return!1;return!0}buildPointsSubPath({realIndex:t,j:e,center:i,halfExtent:s,alongFn:a,density:r,maxWeight:n}){var o;return ir({w:this.w,points:null==(o=this.w.violinData.seriesViolinPoints[t])?void 0:o[e],seedA:t,seedB:e,center:i,halfExtent:s,alongFn:a,isHorizontal:this.isHorizontal,options:this.pointsOptions,clampAt:t=>this.halfWidthAtValue(t,r,s,n)})}halfWidthAtValue(t,e,i,s){const{nodes:a}=e,r=null!=s?s:e.maxWeight;if(!a.length||r<=0)return 0;const n=t=>Math.min(i,t/r*i*this.bandwidthScale);if(t<=a[0].v)return n(a[0].w);if(t>=a[a.length-1].v)return n(a[a.length-1].w);for(let e=1;e<a.length;e++)if(t<=a[e].v){const i=a[e-1],s=a[e],r=s.v===i.v?0:(t-i.v)/(s.v-i.v);return n(i.w+(s.w-i.w)*r)}return 0}logVal(t,e){return this.coreUtils.getLogValAtSeriesIndex(t,e)}},pie:Mr,donut:Mr,polarArea:Mr,radialBar:class extends Mr{constructor(t,e){super(t,e),this.ctx=e,this.w=t,this.animBeginArr=[0],this.animDur=0,this.startAngle=t.config.plotOptions.radialBar.startAngle,this.endAngle=t.config.plotOptions.radialBar.endAngle,this.totalAngle=Math.abs(t.config.plotOptions.radialBar.endAngle-t.config.plotOptions.radialBar.startAngle),this.trackStartAngle=t.config.plotOptions.radialBar.track.startAngle,this.trackEndAngle=t.config.plotOptions.radialBar.track.endAngle,this.barLabels=this.w.config.plotOptions.radialBar.barLabels,this.donutDataLabels=this.w.config.plotOptions.radialBar.dataLabels,this.radialDataLabels=this.donutDataLabels,this.trackStartAngle||(this.trackStartAngle=this.startAngle),this.trackEndAngle||(this.trackEndAngle=this.endAngle),360===this.endAngle&&(this.endAngle=359.99),this.margin=parseInt(t.config.plotOptions.radialBar.track.margin,10),this.onBarLabelClick=this.onBarLabelClick.bind(this)}draw(t){var e;const i=this.w,s=new Dt(this.w),a=s.group({class:"apexcharts-radialbar"});if(i.globals.noData)return a;const r=s.group(),n=this.defaultSize/2,o=i.layout.gridWidth/2;let l=this.defaultSize/2.05;i.config.chart.sparkline.enabled||(l=l-i.config.stroke.width-i.config.chart.dropShadow.blur);const h=i.globals.fill.colors,c=i.config.plotOptions.radialBar,p=Array.isArray(c.bands)&&c.bands.length>0,u=p&&c.bandsStyle&&c.bandsStyle.hideTrackWhenPresent,g="needle"===c.shape;if(c.track.show&&!u){const e=this.drawTracks({size:l,centerX:o,centerY:n,colorArr:h,series:t});r.add(e)}if(p){const e=this.drawBands({size:l,centerX:o,centerY:n,series:t});r.add(e)}const f=this.drawArcs({size:l,centerX:o,centerY:n,colorArr:h,series:t,skipValueArc:g&&!(null==(e=c.needle)?void 0:e.showValueArc)});if(c.ticks&&c.ticks.show){const e=this.drawTicks({size:l,centerX:o,centerY:n,series:t});if(this.initialAnim&&!i.globals.dataChanged&&!i.globals.resized&&d.isBrowser()&&i.globals.shouldAnimate){const t=e.node;t.style.opacity="0",t.style.transition="opacity 280ms ease-out";const s=i.config.chart.animations.speed||800;setTimeout(()=>{t.style.opacity="1"},s)}r.add(e)}if(g){const e=this.drawNeedle({size:l,centerX:o,centerY:n,series:t});r.add(e)}let x=360;i.config.plotOptions.radialBar.startAngle<0&&(x=this.totalAngle);const m=(360-x)/360;if(i.globals.radialSize=l-l*m,this.radialDataLabels.value.show){const t=Math.max(this.radialDataLabels.value.offsetY,this.radialDataLabels.name.offsetY);i.globals.radialSize+=t*m}return r.add(f.g),"front"===i.config.plotOptions.radialBar.hollow.position&&(f.g.add(f.elHollow),f.dataLabels&&f.g.add(f.dataLabels)),a.add(r),a}drawTracks(t){const e=this.w,i=new Dt(this.w),s=i.group({class:"apexcharts-tracks"}),a=new Mt(this.w),r=new Lt(this.w),n=this.getStrokeWidth(t);t.size=t.size-n/2;for(let o=0;o<t.series.length;o++){const l=i.group({class:"apexcharts-radialbar-track apexcharts-track"});s.add(l),l.attr({rel:o+1}),t.size=t.size-n-this.margin;const h=e.config.plotOptions.radialBar.track,c=r.fillPath({seriesNumber:0,size:t.size,fillColors:Array.isArray(h.background)?h.background[o]:h.background,solid:!0}),d=this.trackStartAngle;let p=this.trackEndAngle;Math.abs(p)+Math.abs(d)>=360&&(p=360-Math.abs(this.startAngle)-.1);const u=i.drawPath({d:"",stroke:c,strokeWidth:n*parseInt(h.strokeWidth,10)/100,fill:"none",strokeOpacity:h.opacity,classes:"apexcharts-radialbar-area"});if(h.dropShadow.enabled){const t=h.dropShadow;a.dropShadow(u,t)}l.add(u),u.attr("id","apexcharts-radialbarTrack-"+o),this.animatePaths(u,{centerX:t.centerX,centerY:t.centerY,endAngle:p,startAngle:d,size:t.size,i:o,totalItems:2,animBeginArr:0,dur:0,isTrack:!0})}return s}drawArcs(t){var e;const i=this.w,s=new Dt(this.w),a=new Lt(this.w),r=new Mt(this.w),n=s.group(),o=this.getStrokeWidth(t);t.size=t.size-o/2;let l=i.config.plotOptions.radialBar.hollow.background;const h=t.size-o*t.series.length-this.margin*t.series.length-o*parseInt(i.config.plotOptions.radialBar.track.strokeWidth,10)/100/2,c=h-i.config.plotOptions.radialBar.hollow.margin;void 0!==i.config.plotOptions.radialBar.hollow.image&&(l=this.drawHollowImage(t,n,h,l));const d=this.drawHollow({size:c,centerX:t.centerX,centerY:t.centerY,fill:l||"transparent"});if(i.config.plotOptions.radialBar.hollow.dropShadow.enabled){const t=i.config.plotOptions.radialBar.hollow.dropShadow;r.dropShadow(d,t)}let p=1;!this.radialDataLabels.total.show&&i.seriesData.series.length>1&&(p=0);let u=null;if(this.radialDataLabels.show){const e=i.dom.Paper.findOne(".apexcharts-datalabels-group");u=this.renderInnerDataLabels(e,this.radialDataLabels,{hollowSize:h,centerX:t.centerX,centerY:t.centerY,opacity:p})}"back"===i.config.plotOptions.radialBar.hollow.position&&(n.add(d),u&&n.add(u));let g=!1;i.config.plotOptions.radialBar.inverseOrder&&(g=!0);const f=!0===(null==(e=this.ctx.morphTypeChange)?void 0:e.isActive());for(let e=g?t.series.length-1:0;g?e>=0:e<t.series.length;g?e--:e++){const l=s.group({class:"apexcharts-series apexcharts-radial-series",seriesName:v.escapeString(i.seriesData.seriesNames[e])});n.add(l),l.attr({rel:e+1,"data:realIndex":e}),Be.addCollapsedClassToSeries(this.w,l,e),t.size=t.size-o-this.margin;const h=a.fillPath({seriesNumber:e,size:t.size,value:t.series[e]}),c=this.startAngle;let d;const p=i.config.plotOptions.radialBar,u="number"==typeof p.min?p.min:0,g="number"==typeof p.max?p.max:100,x=g===u?1:g-u,m=t=>{const e=Math.min(Math.max(t,u),g);return Math.max(0,(e-u)/x)},b=m(v.negToZero(t.series[e]));let y,w=Math.round(this.totalAngle*b)+this.startAngle;i.globals.dataChanged&&(d=this.startAngle,y=Math.round(this.totalAngle*m(v.negToZero(i.globals.previousPaths[e])))+d);Math.abs(w)+Math.abs(c)>360&&(w-=.01);Math.abs(y)+Math.abs(d)>360&&(y-=.01);const A=w-c,S=Array.isArray(i.config.stroke.dashArray)?i.config.stroke.dashArray[e]:i.config.stroke.dashArray,C=f?this.ctx.morphTypeChange.getInitialPathFor(e,0):null,k=f?this.ctx.morphTypeChange.getFromType():null,_=!!C&&("bar"===k||"funnel"===k||"pyramid"===k||"pie"===k||"donut"===k||"polarArea"===k),M=s.drawPath({d:C||"",stroke:_||t.skipValueArc?"transparent":h,strokeWidth:_||t.skipValueArc?0:o,fill:_?h:"none",fillOpacity:i.config.fill.opacity,classes:"apexcharts-radialbar-area apexcharts-radialbar-slice-"+e,strokeDashArray:S}),D=c+A/2,L=v.polarToCartesian(t.centerX,t.centerY,t.size,D);if(Dt.setAttrs(M.node,{"data:angle":A,"data:value":t.series[e],"data:cx":L.x,"data:cy":L.y}),i.config.chart.dropShadow.enabled){const t=i.config.chart.dropShadow;r.dropShadow(M,t,e)}if(r.setSelectionFilter(M,0,e),this.addListeners(M,this.radialDataLabels),l.add(M),M.attr({index:0,j:e}),this.barLabels.enabled){const a=v.polarToCartesian(t.centerX,t.centerY,t.size,c),r=this.barLabels.formatter(i.seriesData.seriesNames[e],{seriesIndex:e,w:i}),n=["apexcharts-radialbar-label"];this.barLabels.onClick||n.push("apexcharts-no-click");let o=this.barLabels.useSeriesColors?i.globals.colors[e]:i.config.chart.foreColor;o||(o=i.config.chart.foreColor);const h=a.x+this.barLabels.offsetX,d=a.y+this.barLabels.offsetY,p=s.drawText({x:h,y:d,text:r,textAnchor:"end",dominantBaseline:"middle",fontFamily:this.barLabels.fontFamily,fontWeight:this.barLabels.fontWeight,fontSize:this.barLabels.fontSize,foreColor:o,cssClass:n.join(" ")});p.on("click",this.onBarLabelClick),p.attr({rel:e+1}),0!==c&&p.attr({"transform-origin":`${h} ${d}`,transform:`rotate(${c} 0 0)`}),l.add(p)}let P=0;if(!this.initialAnim||i.globals.resized||i.globals.dataChanged||(P=i.config.chart.animations.speed),i.globals.dataChanged&&(P=i.config.chart.animations.dynamicAnimation.speed),this.animDur=P/(1.2*t.series.length)+this.animDur,this.animBeginArr.push(this.animDur),f&&C){const e=this.ctx.morphTypeChange.getSpeed(),i=this.getPiePath({me:this,startAngle:c,angle:A,size:t.size});if(_){const s=this.ctx.morphTypeChange.buildRingSegmentPath(t.centerX,t.centerY,t.size,o,c,c+A);M.animate(e).plot(s,"polygons").after(function(){this.attr({d:i,fill:"none",stroke:t.skipValueArc?"transparent":h,"stroke-width":t.skipValueArc?0:o})})}else M.animate(e).plot(i,"polygons").attr({"stroke-width":o})}else this.animatePaths(M,{centerX:t.centerX,centerY:t.centerY,endAngle:w,startAngle:c,prevEndAngle:y,prevStartAngle:d,size:t.size,i:e,totalItems:2,animBeginArr:this.animBeginArr,dur:P,shouldSetPrevPaths:!0})}return{g:n,elHollow:d,dataLabels:u}}_angleAtValue(t){const e=this.w.config.plotOptions.radialBar,i="number"==typeof e.min?e.min:0,s="number"==typeof e.max?e.max:100,a=s===i?i+1:s,r=(Math.max(i,Math.min(a,Number(t)))-i)/(a-i);return this.startAngle+r*(this.endAngle-this.startAngle)}_describeArc(t,e,i,s,a){const r=v.polarToCartesian(t,e,i,a),n=v.polarToCartesian(t,e,i,s),o=a-s,l=Math.abs(o)>180?1:0;return`M ${r.x} ${r.y} A ${i} ${i} 0 ${l} 0 ${n.x} ${n.y}`}drawBands(t){const e=this.w,i=new Dt(this.w),s=e.config.plotOptions.radialBar,a=s.bands||[],r=i.group({class:"apexcharts-gauge-bands"}),n=this.getStrokeWidth(t),o=t.size-n/2-n-this.margin,l=n*parseInt(s.bandsStyle.strokeWidth,10)/100,h="number"==typeof s.min?s.min:0,c="number"==typeof s.max?s.max:100,d=c===h?0:(s.bandsStyle.gap||0)*((this.endAngle-this.startAngle)/(c-h));for(let e=0;e<a.length;e++){const n=a[e];if(void 0===n.from||void 0===n.to)continue;const h=this._angleAtValue(n.from),c=this._angleAtValue(n.to),p=Math.min(h,c)+d/2,u=Math.max(h,c)-d/2;if(u-p<=0)continue;const g=i.drawPath({d:this._describeArc(t.centerX,t.centerY,o,p,u),stroke:n.color||"#ccc",strokeWidth:l,fill:"none",strokeLinecap:s.bandsStyle.linecap||"butt",classes:"apexcharts-gauge-band"});g.node.setAttribute("data-band-index",String(e)),r.add(g)}return r}drawTicks(t){var e,i,s,a;const r=this.w,n=new Dt(this.w),o=r.config.plotOptions.radialBar,l=o.ticks,h=n.group({class:"apexcharts-gauge-ticks"}),c=this.getStrokeWidth(t),d=t.size-c/2-c-this.margin,p="number"==typeof o.min?o.min:0,u="number"==typeof o.max?o.max:100,g=Math.max(2,null!=(i=null==(e=l.major)?void 0:e.count)?i:11),f=Math.max(0,null!=(a=null==(s=l.minor)?void 0:s.count)?a:0),x=(e,i,s)=>{var a,r,o;const c=this._angleAtValue(e),p=null!=(a=i.length)?a:8,u="inside"===i.placement?d-p:d,g="inside"===i.placement?d:d+p,f=v.polarToCartesian(t.centerX,t.centerY,u,c),x=v.polarToCartesian(t.centerX,t.centerY,g,c),m=n.drawLine(f.x,f.y,x.x,x.y,i.color||(s?"#666":"#999"),0,i.width||(s?2:1));if(h.add(m),s&&(null==(r=l.labels)?void 0:r.show)){const s=("inside"===i.placement?u:g)+("inside"===i.placement?-1:1)*(null!=(o=l.labels.offset)?o:6),a=v.polarToCartesian(t.centerX,t.centerY,s,c),r="function"==typeof l.labels.formatter?l.labels.formatter(e):String(e),d=n.drawText({x:a.x,y:a.y,text:r,textAnchor:"middle",dominantBaseline:"middle",fontFamily:l.labels.fontFamily,fontSize:l.labels.fontSize,fontWeight:l.labels.fontWeight,foreColor:l.labels.color,cssClass:"apexcharts-gauge-tick-label"});h.add(d)}};for(let t=0;t<g;t++){if(x(p+t/(g-1)*(u-p),l.major||{},!0),t<g-1&&f>0)for(let e=1;e<=f;e++){x(p+(t+e/(f+1))/(g-1)*(u-p),l.minor||{},!1)}}return h}drawNeedle(t){var e,i,s,a,r;const n=this.w,o=new Dt(this.w),l=n.config.plotOptions.radialBar.needle||{},h=o.group({class:"apexcharts-gauge-needle"});if(!t.series||0===t.series.length)return h;const c=this.getStrokeWidth(t),p=t.size-c/2-c-this.margin,u="string"==typeof l.length&&l.length.endsWith("%")?p*parseInt(l.length,10)/100:Number(l.length||.85*p),g=null!=(e=l.baseWidth)?e:4,f=null!=(i=l.tipWidth)?i:1,x=l.color||"#333",m=t.centerX,y=Number(null!=(s=l.offsetY)?s:0),w=t.centerY+y,v=`M ${m+g/2} ${w} A ${g/2} ${g/2} 0 0 1 ${m-g/2} ${w} L ${m-f/2} ${w-u} L ${m+f/2} ${w-u} Z`,A=o.drawPath({d:v,stroke:x,strokeWidth:0,fill:x,classes:"apexcharts-gauge-needle-shape"});h.add(A);const S=Number(t.series[0]),C=this._angleAtValue(S),k=this.initialAnim&&!n.globals.dataChanged&&!n.globals.resized,_=this.ctx,M="number"==typeof _._lastNeedleAngle?_._lastNeedleAngle:this.startAngle;_._lastNeedleAngle=C;if(d.isBrowser()&&n.globals.shouldAnimate&&(k||n.globals.dataChanged)&&M!==C){const t=h.node;t.setAttribute("transform-origin",`${m} ${w}`),t.setAttribute("transform",`rotate(${M})`);const e=(null==(a=l.animation)?void 0:a.duration)&&Number(l.animation.duration)||l.animationSpeed&&Number(l.animationSpeed)||(null==(r=n.config.chart.animations.dynamicAnimation)?void 0:r.speed)||n.config.chart.animations.speed||800,i=1.70158,s=i+1,o=k?t=>1+s*Math.pow(t-1,3)+i*Math.pow(t-1,2):t=>1-Math.pow(1-t,3);null!=n.globals.radialNeedleRAF&&(b.cancelAnimationFrame(n.globals.radialNeedleRAF),n.globals.radialNeedleRAF=null);const c=performance.now(),d=i=>{if(this.w.globals.isDestroyed)return void(n.globals.radialNeedleRAF=null);const s=Math.max(0,Math.min(1,(i-c)/e)),a=M+(C-M)*o(s);t.setAttribute("transform",`rotate(${a})`),n.globals.radialNeedleRAF=s<1?b.requestAnimationFrame(d):null};n.globals.radialNeedleRAF=b.requestAnimationFrame(d)}else h.attr({"transform-origin":`${m} ${w}`,transform:`rotate(${C})`});return h}drawHollow(t){var e;const i=new Dt(this.w),s=this.w.config.plotOptions.radialBar.hollow,a=i.drawCircle(2*t.size),r={class:"apexcharts-radialbar-hollow",cx:t.centerX,cy:t.centerY,r:t.size,fill:t.fill};return(s.stroke||s.strokeDasharray)&&(r.stroke=s.stroke||"transparent",r["stroke-width"]=null!=(e=s.strokeWidth)?e:1,s.strokeDasharray&&(r["stroke-dasharray"]=s.strokeDasharray)),a.attr(r),a}drawHollowImage(t,e,i,s){const a=this.w,r=new Lt(this.w),n=v.randomId(),o=a.config.plotOptions.radialBar.hollow.image;if(a.config.plotOptions.radialBar.hollow.imageClipped)r.clippedImgArea({width:i,height:i,image:o,patternID:`pattern${a.globals.cuid}${n}`}),s=`url(#pattern${a.globals.cuid}${n})`;else{const i=a.config.plotOptions.radialBar.hollow.imageWidth,s=a.config.plotOptions.radialBar.hollow.imageHeight;if(void 0===i&&void 0===s){const i=a.dom.Paper.image(o,function(e){this.move(t.centerX-e.width/2+a.config.plotOptions.radialBar.hollow.imageOffsetX,t.centerY-e.height/2+a.config.plotOptions.radialBar.hollow.imageOffsetY)});e.add(i)}else{const r=a.dom.Paper.image(o,function(){this.move(t.centerX-i/2+a.config.plotOptions.radialBar.hollow.imageOffsetX,t.centerY-s/2+a.config.plotOptions.radialBar.hollow.imageOffsetY),this.size(i,s)});e.add(r)}}return s}getStrokeWidth(t){const e=this.w;return t.size*(100-parseInt(e.config.plotOptions.radialBar.hollow.size,10))/100/(t.series.length+1)-this.margin}onBarLabelClick(t){var e;const i=t.target,s=parseInt(null!=(e=i.getAttribute("rel"))?e:"",10)-1,a=this.barLabels.onClick,r=this.w;a&&a(r.seriesData.seriesNames[s],{w:r,seriesIndex:s})}},radar:class{constructor(t,e){this.ctx=e,this.w=t,this.chartType=this.w.config.chart.type,this.initialAnim=this.w.config.chart.animations.enabled,this.dynamicAnim=this.initialAnim&&this.w.config.chart.animations.dynamicAnimation.enabled,this.animDur=0,this.graphics=new Dt(this.w),this.lineColorArr=void 0!==t.globals.stroke.colors?t.globals.stroke.colors:t.globals.colors,this.defaultSize=t.globals.svgHeight<t.globals.svgWidth?t.layout.gridHeight:t.layout.gridWidth,this.isLog=t.config.yaxis[0].logarithmic,this.logBase=t.config.yaxis[0].logBase,this.coreUtils=new H(this.w),this.maxValue=this.isLog?this.coreUtils.getLogVal(this.logBase,t.globals.maxY,0):t.globals.maxY,this.minValue=this.isLog?this.coreUtils.getLogVal(this.logBase,this.w.globals.minY,0):t.globals.minY,this.polygons=t.config.plotOptions.radar.polygons,this.strokeWidth=t.config.stroke.show?t.config.stroke.width:0,this.size=this.defaultSize/2.1-this.strokeWidth-t.config.chart.dropShadow.blur,t.config.xaxis.labels.show&&(this.size=this.size-t.layout.xAxisLabelsWidth/1.75),void 0!==t.config.plotOptions.radar.size&&(this.size=t.config.plotOptions.radar.size),this.dataRadiusOfPercent=[],this.dataRadius=[],this.angleArr=[],this.dataPointsLen=0,this.disAngle=0,this.yaxisLabelsTextsPos=[]}draw(t){const e=this.w,i=new Lt(this.w),s=[],a=new Xt(this.w,this.ctx);t.length&&(this.dataPointsLen=t[e.globals.maxValsInArrayIndex].length),this.disAngle=2*Math.PI/this.dataPointsLen;const r=e.layout.gridWidth/2,n=e.layout.gridHeight/2,h=r+e.config.plotOptions.radar.offsetX,c=n+e.config.plotOptions.radar.offsetY,d=this.graphics.group({class:"apexcharts-radar-series apexcharts-plot-series",transform:`translate(${h||0}, ${c||0})`});let p=[],u=null,g=null;if(this.yaxisLabels=this.graphics.group({class:"apexcharts-yaxis"}),t.forEach((t,r)=>{const n=t.length===e.globals.dataPoints,h=this.graphics.group().attr({class:"apexcharts-series","data:longestSeries":n,seriesName:v.escapeString(e.seriesData.seriesNames[r]),rel:r+1,"data:realIndex":r});this.dataRadiusOfPercent[r]=[],this.dataRadius[r]=[],this.angleArr[r]=[],t.forEach((t,e)=>{const i=Math.abs(this.maxValue-this.minValue);t-=this.minValue,this.isLog&&(t=this.coreUtils.getLogVal(this.logBase,t,0)),this.dataRadiusOfPercent[r][e]=t/i,this.dataRadius[r][e]=this.dataRadiusOfPercent[r][e]*this.size,this.angleArr[r][e]=e*this.disAngle}),p=this.getDataPointsPos(this.dataRadius[r],this.angleArr[r]);const c=this.createPaths(p,{x:0,y:0});u=this.graphics.group({class:"apexcharts-series-markers-wrap apexcharts-element-hidden"}),g=this.graphics.group({class:"apexcharts-datalabels","data:realIndex":r}),e.globals.delayedElements.push({el:u.node,index:r});const d={i:r,realIndex:r,animationDelay:r,initialSpeed:e.config.chart.animations.speed,dataChangeSpeed:e.config.chart.animations.dynamicAnimation.speed,className:"apexcharts-radar",shouldClipToGrid:!1,bindEventsOnPaths:!1,stroke:e.globals.stroke.colors[r],strokeLineCap:e.config.stroke.lineCap};let f=null;e.globals.previousPaths.length>0&&(f=this.getPreviousPath(r));for(let t=0;t<c.linePathsTo.length;t++){const s=this.graphics.renderPaths(l(o({},d),{pathFrom:null===f?c.linePathsFrom[t]:f,pathTo:c.linePathsTo[t],strokeWidth:Array.isArray(this.strokeWidth)?this.strokeWidth[r]:this.strokeWidth,fill:"none",drawShadow:!1}));h.add(s);const a=i.fillPath({seriesNumber:r}),n=this.graphics.renderPaths(l(o({},d),{pathFrom:null===f?c.areaPathsFrom[t]:f,pathTo:c.areaPathsTo[t],strokeWidth:0,fill:a,drawShadow:!1,drawMask:{type:"radial",cx:0,cy:0,r:this.size}}));if(e.config.chart.dropShadow.enabled){const t=new Mt(this.w),i=e.config.chart.dropShadow;t.dropShadow(n,Object.assign({},i,{noUserSpaceOnUse:!0}),r)}h.add(n)}t.forEach((t,i)=>{const s=new Ft(this.w,this.ctx).getMarkerConfig({cssClass:"apexcharts-marker",seriesIndex:r,dataPointIndex:i});s.pSize||(s.pSize=5,s.pointFillColor="transparent",s.pointStrokeColor="transparent",s.pointStrokeWidth=0);const n=this.graphics.drawMarker(p[i].x,p[i].y,s);n.attr("rel",i),n.attr("j",i),n.attr("index",r),n.node.setAttribute("default-marker-size",s.pSize);const l=this.graphics.group({class:"apexcharts-series-markers"});l&&l.add(n),u.add(l),h.add(u);const c=e.config.dataLabels;if(c.enabled){const t=c.formatter(e.seriesData.series[r][i],{seriesIndex:r,dataPointIndex:i,w:e});a.plotDataLabelsText({x:p[i].x,y:p[i].y,text:t,textAnchor:"middle",i:r,j:r,seriesIndex:r,dataPointIndex:i,parent:g,offsetCorrection:!1,dataLabelsConfig:o({},c)})}h.add(g)}),s.push(h)}),this.drawPolygons({parent:d}),e.config.xaxis.labels.show){const t=this.drawXAxisTexts();d.add(t)}return s.forEach(t=>{d.add(t)}),d.add(this.yaxisLabels),d}drawPolygons(t){const e=this.w,{parent:i}=t,s=new wr(this.w),a=e.globals.yAxisScale[0].result.reverse(),r=a.length,n=[],o=this.size/(r-1);for(let t=0;t<r;t++)n[t]=o*t;n.reverse();const l=[],h=[];n.forEach((t,e)=>{const i=v.getPolygonPos(t,this.dataPointsLen);let s="";i.forEach((t,i)=>{if(0===e){const e=this.graphics.drawLine(t.x,t.y,0,0,Array.isArray(this.polygons.connectorColors)?this.polygons.connectorColors[i]:this.polygons.connectorColors);h.push(e)}0===i&&this.yaxisLabelsTextsPos.push({x:t.x,y:t.y}),s+=t.x+","+t.y+" "}),l.push(s)}),l.forEach((t,s)=>{const a=this.polygons.strokeColors,r=this.polygons.strokeWidth,n=this.graphics.drawPolygon(t,Array.isArray(a)?a[s]:a,Array.isArray(r)?r[s]:r,e.globals.radarPolygons.fill.colors[s]);i.add(n)}),h.forEach(t=>{i.add(t)}),e.config.yaxis[0].show&&this.yaxisLabelsTextsPos.forEach((t,e)=>{const i=s.drawYAxisTexts(t.x,t.y,e,a[e]);this.yaxisLabels.add(i)})}drawXAxisTexts(){const t=this.w,e=t.config.xaxis.labels,i=this.graphics.group({class:"apexcharts-xaxis"}),s=v.getPolygonPos(this.size,this.dataPointsLen);return t.labelData.labels.forEach((a,r)=>{const n=t.config.xaxis.labels.formatter,l=new Xt(this.w,this.ctx);if(s[r]){const h=this.getTextPos(s[r],this.size),c=n(a,{seriesIndex:-1,dataPointIndex:r,w:t});l.plotDataLabelsText({x:h.newX,y:h.newY,text:c,textAnchor:h.textAnchor,i:r,j:r,parent:i,className:"apexcharts-xaxis-label",color:Array.isArray(e.style.colors)&&e.style.colors[r]?e.style.colors[r]:"#a8a8a8",dataLabelsConfig:o({textAnchor:h.textAnchor,dropShadow:{enabled:!1}},e),offsetCorrection:!1}).on("click",e=>{if("function"==typeof t.config.chart.events.xAxisLabelClick){const i=Object.assign({},t,{labelIndex:r});t.config.chart.events.xAxisLabelClick(e,this.ctx,i)}})}}),i}createPaths(t,e){const i=[];let s=[];const a=[];let r=[];if(t.length){s=[this.graphics.move(e.x,e.y)],r=[this.graphics.move(e.x,e.y)];let n=this.graphics.move(t[0].x,t[0].y),o=this.graphics.move(t[0].x,t[0].y);t.forEach((e,i)=>{n+=this.graphics.line(e.x,e.y),o+=this.graphics.line(e.x,e.y),i===t.length-1&&(n+="Z",o+="Z")}),i.push(n),a.push(o)}return{linePathsFrom:s,linePathsTo:i,areaPathsFrom:r,areaPathsTo:a}}getTextPos(t,e){let i="middle",s=t.x,a=t.y;return Math.abs(t.x)>=10?t.x>0?(i="start",s+=10):t.x<0&&(i="end",s-=10):i="middle",Math.abs(t.y)>=e-10&&(t.y<0?a-=10:t.y>0&&(a+=10)),{textAnchor:i,newX:s,newY:a}}getPreviousPath(t){const e=this.w;let i=null;for(let s=0;s<e.globals.previousPaths.length;s++){const a=e.globals.previousPaths[s];a.paths.length>0&&parseInt(a.realIndex,10)===parseInt(String(t),10)&&void 0!==e.globals.previousPaths[s].paths[0]&&(i=e.globals.previousPaths[s].paths[0].d)}return i}getDataPointsPos(t,e,i=this.dataPointsLen){t=t||[],e=e||[];const s=[];for(let a=0;a<i;a++){const i={};i.x=t[a]*Math.sin(e[a]),i.y=-t[a]*Math.cos(e[a]),s.push(i)}return s}},heatmap:class{constructor(t,e,i){this.ctx=e,this.w=t,this.xRatio=i.xRatio,this.yRatio=i.yRatio,this.dynamicAnim=this.w.config.chart.animations.dynamicAnimation,this.helpers=new fr(t,e),this.rectRadius=this.w.config.plotOptions.heatmap.radius,this.strokeWidth=this.w.config.stroke.show?this.w.config.stroke.width:0}draw(t){var e,i;const s=this.w,a=new Dt(this.w,this.ctx),r=Et(this.ctx,a),n=r!==a&&"function"==typeof r.drawRectCell,o=a.group({class:"apexcharts-heatmap"});o.attr("clip-path",`url(#gridRectMask${s.globals.cuid})`);const l=s.layout.gridWidth/s.globals.dataPoints,h=s.layout.gridHeight/s.seriesData.series.length,c=("numeric"===s.config.xaxis.type||"datetime"===s.config.xaxis.type)&&s.axisFlags.isXNumeric&&this.xRatio>0;let d=l;if(c){const t=s.globals.minXDiff;d=Number.isFinite(t)&&t>0?t/this.xRatio:l}const p=Array.isArray(s.config.fill.opacity)?null!=(e=s.config.fill.opacity[0])?e:1:null!=(i=s.config.fill.opacity)?i:1;let u=0,g=!1;this.negRange=this.helpers.checkColorRange();const f=t.slice();s.config.yaxis[0].reversed&&(g=!0,f.reverse());for(let e=g?0:f.length-1;g?e<f.length:e>=0;g?e++:e--){const i=a.group({class:"apexcharts-series apexcharts-heatmap-series",seriesName:v.escapeString(s.seriesData.seriesNames[e]),rel:e+1,"data:realIndex":e});if(Be.addCollapsedClassToSeries(this.w,i,e),n||a.setupEventDelegation(i,".apexcharts-heatmap-rect"),s.config.chart.dropShadow.enabled){const t=s.config.chart.dropShadow;new Mt(this.w).dropShadow(i,t,e)}let g=0;const x=s.config.plotOptions.heatmap.shadeIntensity;let m=0;for(let o=0;o<s.globals.dataPoints;o++){if(!c&&s.seriesData.seriesX.length&&!s.globals.allSeriesHasEqualX&&s.globals.minX+s.globals.minXDiff*o<s.seriesData.seriesX[e][m]){g+=l;continue}if(m>=f[e].length)break;const b=c?d:l;if(c){const t=s.seriesData.seriesX[e]?s.seriesData.seriesX[e][m]:null;if(null==t||t!=t){m++;continue}g=(t-s.globals.minX)/this.xRatio-d/2}const y=this.helpers.getShadeColor(s.config.chart.type,e,m,this.negRange);let w=y.color;const A=y.colorProps;if("image"===s.config.fill.type){w=new Lt(this.w).fillPath({seriesNumber:e,dataPointIndex:m,opacity:s.globals.hasNegs?A.percent<0?1-(1+A.percent/100):x+A.percent/100:A.percent/100,patternID:v.randomId(),width:s.config.fill.image.width?s.config.fill.image.width:b,height:s.config.fill.image.height?s.config.fill.image.height:h})}const S=this.rectRadius,C=s.config.plotOptions.heatmap.useFillColorAsStroke?w:s.globals.stroke.colors[0];if(n)r.drawRectCell(g,u,b,h,{fill:w,fillOpacity:p,stroke:C,strokeWidth:this.strokeWidth,radius:S,seriesIndex:e,dataPointIndex:m});else{const r=a.drawRect(g,u,b,h,S);if(r.attr({cx:g,cy:u}),r.node.classList.add("apexcharts-heatmap-rect"),i.add(r),r.attr({fill:w,i:e,index:e,j:m,val:t[e][m],"stroke-width":this.strokeWidth,stroke:C,color:w}),s.config.chart.animations.enabled&&!s.globals.dataChanged){let t=1;s.globals.resized||(t=s.config.chart.animations.speed),this.animateHeatMap(r,g,u,b,h,t,e,m)}if(s.globals.dataChanged){let t=1;if(this.dynamicAnim.enabled&&s.globals.shouldAnimate){t=this.dynamicAnim.speed;let i=s.globals.previousPaths[e]&&s.globals.previousPaths[e][m]&&s.globals.previousPaths[e][m].color;i||(i="rgba(255, 255, 255, 0)"),this.animateHeatColor(r,v.isColorHex(i)?i:v.rgb2hex(i),v.isColorHex(w)?w:v.rgb2hex(w),t)}}}const k=(0,s.config.dataLabels.formatter)(s.seriesData.series[e][m],{value:s.seriesData.series[e][m],seriesIndex:e,dataPointIndex:m,w:s}),_=this.helpers.calculateDataLabels({text:k,x:g+b/2,y:u+h/2,i:e,j:m,colorProps:A,series:f});null!==_&&i.add(_),c||(g+=l),m++}u+=h,o.add(i)}const x=s.globals.yAxisScale[0].result.slice();return s.config.yaxis[0].reversed?x.unshift(""):x.push(""),s.globals.yAxisScale[0].result=x,o}animateHeatMap(t,e,i,s,a,r,n=0,o=0){const l=this.w,h=new Ct(this.w),c=l.config.chart.animations.animateGradually;let d=0;if(c&&!1!==c.enabled){const t=((l.seriesData.series||[]).length||1)+(l.globals.dataPoints||1)-2;d=St({style:"diagonal",index:o,row:n,col:o,baseDelay:Math.min(c.delay||0,.5*r/Math.max(1,t))})}h.animateRect(t,{x:e+s/2,y:i+a/2,width:0,height:0},{x:e,y:i,width:s,height:a},r,()=>{h.animationCompleted(t)},d)}animateHeatColor(t,e,i,s){t.attr({fill:e}).animate(s).attr({fill:i})}},treemap:class{constructor(t,e){this.ctx=e,this.w=t,this.strokeWidth=this.w.config.stroke.width,this.helpers=new fr(t,e),this.dynamicAnim=this.w.config.chart.animations.dynamicAnimation,this.labels=[],this.roots=[],this.drawn=[],this.nested=!1,this.showParents=!1,this.scale=null,this._levelCache=null,this._total=null,this._avgLabelSize=null,this._tooltipEl=null,this._tipOwned=!1,this._morphLeafIndex=0}draw(t){var e;const i=this.w,s=new Dt(this.w,this.ctx),a=new Lt(this.w),r=s.group({class:"apexcharts-treemap"});if(i.globals.noData)return r;t.forEach(t=>{t.map(t=>Math.abs(t))}),this.negRange=this.helpers.checkColorRange(),i.config.series.forEach((t,e)=>{t.data.forEach(t=>{Array.isArray(this.labels[e])||(this.labels[e]=[]),this.labels[e].push(t.x)})});const n=function(t){const e=t.globals.treemapRoots;if(e&&e.length)return{roots:e,maxDepth:t.globals.treemapMaxDepth||1,nested:!0};const i=ki(t,t.config.series,{keepDatum:!0,expandDrilldown:!1});i.forEach(_i);const{maxDepth:s}=Pi(i);return{roots:i,maxDepth:s,nested:!1}}(i);this.nested=n.nested,this.roots=n.roots,this.scale=la(i);const o=1===n.roots.length?n.roots[0].children||[]:n.roots;this.drawn=o;const l=i.config.plotOptions.treemap.parents;this.showParents=!0===l.show||!1!==l.show&&this.nested;const h=this._resolveFocus(o),c=h?[h]:o;Rr.generateNested(c,i.layout.gridWidth,i.layout.gridHeight,{padding:(t,e,i,s)=>this.showParents?this._levelPadding(e,i,s):0,header:(t,e,i,s)=>this.showParents?this._levelHeader(t,e,i,s):0});const d=null==(e=this.ctx)?void 0:e.morphTypeChange,p=!!d&&"function"==typeof d.isActive&&d.isActive()&&"function"==typeof d.getInitialPathAt;this._morphLeafIndex=0;const u=this._leavesBySeries(c,i.config.series.length),g=this.showParents?this._parentsBySeries(c,i.config.series.length):[];return u.forEach((e,n)=>{var o;const l=s.group({class:"apexcharts-series apexcharts-treemap-series",seriesName:v.escapeString(i.seriesData.seriesNames[n]),rel:n+1,"data:realIndex":n});if(s.setupEventDelegation(l,".apexcharts-treemap-rect"),i.config.chart.dropShadow.enabled){const t=i.config.chart.dropShadow;new Mt(this.w).dropShadow(r,t,n)}const h=s.group({class:"apexcharts-data-labels"}),c={xMin:1/0,yMin:1/0,xMax:-1/0,yMax:-1/0};this.showParents&&(g[n]||[]).forEach(t=>{this._drawParent(l,t,n)});const d=i.config.chart.animations,u=d.animateGradually,f=u&&!1!==u.enabled,x=new Array(e.length).fill(0);if(f){const t=e.length||1,i=Math.min(u.delay||0,.5*d.speed/t);e.map((t,e)=>{return{j:e,area:t.rect?(i=t.rect,(i[2]-i[0])*(i[3]-i[1])):0};var i}).sort((t,e)=>e.area-t.area).forEach((t,e)=>{x[t.j]=e*i})}e.forEach((e,r)=>{const o=e.rect;if(!o)return;const h=e._di,d=o[0],u=o[1],g=o[2],f=o[3];c.xMin=Math.min(c.xMin,d),c.yMin=Math.min(c.yMin,u),c.xMax=Math.max(c.xMax,g),c.yMax=Math.max(c.yMax,f);const m=this._leafColor(n,h),b=m.color,y=a.fillPath({color:b,seriesNumber:n,dataPointIndex:h}),w=p?this._morphSourceForLeaf(e):null,v=w?s.drawPath({d:this._tilePath(d,u,g,f),fill:"#fff",stroke:i.config.plotOptions.treemap.useFillColorAsStroke?b:i.globals.stroke.colors[n],strokeWidth:this.strokeWidth,fillOpacity:1}):s.drawRect(d,u,g-d,f-u,i.config.plotOptions.treemap.borderRadius,"#fff",1,this.strokeWidth,i.config.plotOptions.treemap.useFillColorAsStroke?b:i.globals.stroke.colors[n]);v.attr({cx:d,cy:u,index:n,i:n,j:h,width:g-d,height:f-u,fill:y}),v.node.classList.add("apexcharts-treemap-rect"),v.node.setAttribute("data:key",Mi(e._key));let A={x:d+(g-d)/2,y:u+(f-u)/2,width:0,height:0};const S={x:d,y:u,width:g-d,height:f-u};if(w)this._morphTile(v,w,this._tilePath(d,u,g,f),this.ctx.morphTypeChange.getSpeed(),n,h);else if(i.config.chart.animations.enabled&&!i.globals.dataChanged){let t=1;i.globals.resized||(t=i.config.chart.animations.speed),this.animateTreemap(v,A,S,t,x[r]||0)}if(i.globals.dataChanged){let t=1;this.dynamicAnim.enabled&&i.globals.shouldAnimate&&(t=this.dynamicAnim.speed,i.globals.previousPaths[n]&&i.globals.previousPaths[n][h]&&i.globals.previousPaths[n][h].rect&&(A=i.globals.previousPaths[n][h].rect),this.animateTreemap(v,A,S,t))}let C=this.getFontSize(o);"truncate"===i.config.plotOptions.treemap.dataLabels.format&&(C=parseInt(String(i.config.dataLabels.style.fontSize),10));let k=null;if(i.config.dataLabels.enabled&&this._labelCanShow(C,g-d,f-u)){let e=i.config.dataLabels.formatter(this.labels[n][h],{value:i.seriesData.series[n][h],seriesIndex:n,dataPointIndex:h,w:i});"truncate"===i.config.plotOptions.treemap.dataLabels.format&&(e=this.truncateLabels(String(e),C,d,u,g,f)),i.seriesData.series[n][h]&&(k=this.helpers.calculateDataLabels({text:e,x:(d+g)/2,y:(u+f)/2+this.strokeWidth/2+C/3,i:n,j:h,colorProps:m,fontSize:C,series:t})),i.config.dataLabels.enabled&&k&&this.rotateToFitLabel(k,C,e,d,u,g,f)}l.add(v),null!==k&&l.add(k)});const m=i.config.plotOptions.treemap.seriesTitle;if(!this.showParents&&i.config.series.length>1&&m&&m.show){const t=i.config.series[n].name||"";if(t&&c.xMin<1/0&&c.yMin<1/0){const{offsetX:e,offsetY:a,borderColor:r,borderWidth:n,borderRadius:h,style:d}=m,p=d.color||i.config.chart.foreColor,u={left:d.padding.left,right:d.padding.right,top:d.padding.top,bottom:d.padding.bottom},g=s.getTextRects(t,d.fontSize,d.fontFamily),f=g.width+u.left+u.right,x=g.height+u.top+u.bottom,b=c.xMin+(e||0),y=c.yMin+(a||0),w=s.drawRect(b,y,f,x,h,d.background,1,n,r),v=s.drawText({x:b+u.left,y:y+u.top+.75*(null!=(o=null==g?void 0:g.height)?o:0),text:t,fontSize:d.fontSize,fontFamily:d.fontFamily,fontWeight:d.fontWeight,foreColor:p,cssClass:d.cssClass||""});l.add(w),l.add(v)}}l.add(h),r.add(l)}),this._renderBreadcrumb(),r}_levelCfg(t){if(this._levelCache||(this._levelCache=[]),this._levelCache[t])return this._levelCache[t];const e=this.w.config.plotOptions.treemap,i=e.parents||{},s=(e.levels||[])[t]||{},a=l(o(o({},i),s),{header:l(o(o({},i.header||{}),s.header||{}),{style:o(o({},(i.header||{}).style||{}),(s.header||{}).style||{})}),hover:o(o({},i.hover||{}),s.hover||{})});return this._levelCache[t]=a,a}_levelPadding(t,e,i){const s=this._levelCfg(t);return Number(s.padding)||0}_levelHeader(t,e,i,s){const a=this._levelCfg(e).header||{};if(!1===a.show)return 0;const r=Number(a.height);if(!Number.isFinite(r)||r<=0)return 0;return i<(Number(a.minWidth)||40)||s<2*r?0:r}_leavesBySeries(t,e){const i=new Array(Math.max(1,e));for(let t=0;t<i.length;t++)i[t]=[];const s=t=>{if(t.children&&t.children.length)t.children.forEach(s);else{const e=t._si||0;i[e]&&i[e].push(t)}};return t.forEach(s),i}_parentsBySeries(t,e){const i=new Array(Math.max(1,e));for(let t=0;t<i.length;t++)i[t]=[];const s=t=>{if(!t.children||!t.children.length)return;const e=t._si||0;i[e]&&i[e].push(t),t.children.forEach(s)};return t.forEach(s),i.forEach(t=>t.sort((t,e)=>(t.depth||0)-(e.depth||0))),i}_leafColor(t,e){const i=this.w;if(this.scale){const s=na(i,t,e);if(null!=s){const t=this.scale.at(s);return{color:t,foreColor:ha(t),colorProps:{color:t,foreColor:ha(t),percent:0}}}}return this.helpers.getShadeColor(i.config.chart.type,t,e,this.negRange)}_parentChrome(t){const e=this.w,i=this._levelCfg(t),s="dark"===e.config.theme.mode,a=(i.header||{}).style||{},r=Math.min(t,3),n=s?255:0,o=`${n},${n},${n}`;return{fill:i.fill||`rgba(${o},${(s?.04:.03)+.02*r})`,fillOpacity:null==i.fillOpacity?1:i.fillOpacity,borderColor:i.borderColor||`rgba(${o},${s?.18:.14})`,borderWidth:null==i.borderWidth?1:i.borderWidth,borderRadius:null==i.borderRadius?e.config.plotOptions.treemap.borderRadius:i.borderRadius,headerBg:a.background||`rgba(${o},${s?.1:.07})`,headerColor:a.color||(s?"#e8e8e8":e.config.chart.foreColor),headerFontSize:a.fontSize||"12px",headerFontFamily:a.fontFamily||e.config.chart.fontFamily,headerFontWeight:null==a.fontWeight?600:a.fontWeight,hoverColor:i.hover&&i.hover.color||(s?"rgba(255,255,255,0.85)":"rgba(0,0,0,0.7)"),hoverWidth:i.hover&&i.hover.width||2,hoverShow:!(i.hover&&!1===i.hover.show)}}_drawParent(t,e,i){var s;const a=e.rect;if(!a)return;const r=this.w,n=new Dt(this.w,this.ctx),o=e.depth||0,l=this._levelCfg(o),h=this._parentChrome(o),c=a[0],d=a[1],p=a[2]-a[0],u=a[3]-a[1];if(p<=0||u<=0)return;const g=n.group({class:"apexcharts-treemap-parent","data:depth":o,"data:name":v.escapeString(e.name)}),f=Mi(e._key),x=this._morphKeyed()?this.ctx.morphTypeChange.getInitialPathForKey(f):null,m=x?n.drawPath({d:this._tilePath(c,d,c+p,d+u),fill:h.fill,stroke:h.borderColor,strokeWidth:h.borderWidth,fillOpacity:h.fillOpacity}):n.drawRect(c,d,p,u,h.borderRadius,h.fill,h.fillOpacity,h.borderWidth,h.borderColor);m.node.classList.add("apexcharts-treemap-parent-rect"),m.node.setAttribute("data:key",f),m.node.setAttribute("data:depth",String(o)),x&&this._morphTile(m,x,this._tilePath(c,d,c+p,d+u),this.ctx.morphTypeChange.getSpeed(),i,o),g.add(m);const b=e.headerHeight||0;let y="";if(b>0){const t=l.header||{},a=n.drawRect(c,d,p,b,0,h.headerBg,1,0,"transparent");a.node.classList.add("apexcharts-treemap-parent-header"),g.add(a);let u=String(null!=(s=e.name)?s:"");"function"==typeof t.formatter?u=String(t.formatter(e.name,{value:e.value,depth:o,seriesIndex:i,node:e,w:r})):t.showValue&&(u=`${u}  ${this._formatValue(e.value)}`),y=u;const f=Number(t.offsetX)||0,x=t.align||"left",w=6,v=Math.max(0,p-2*w-Math.abs(f)),A=parseFloat(String(h.headerFontSize))||12,S=n.getTextBasedOnMaxWidth({text:u,maxWidth:v,fontSize:A});if(S){let e=c+w+f,i="start";"center"===x?(e=c+p/2+f,i="middle"):"right"===x&&(e=c+p-w+f,i="end");const s=n.drawText({x:e,y:d+b/2+A/3+(Number(t.offsetY)||0),text:S,textAnchor:i,fontSize:h.headerFontSize,fontFamily:h.headerFontFamily,fontWeight:h.headerFontWeight,foreColor:h.headerColor,cssClass:`apexcharts-treemap-parent-label ${t.style&&t.style.cssClass||""}`});s.node.setAttribute("pointer-events","none"),g.add(s)}this._attachParentEvents(a.node,e,h,m),this._makeParentAccessible(a.node,e,h,m,y)}this._attachParentEvents(m.node,e,h,m),g.node.setAttribute("role","group"),g.node.setAttribute("aria-label",this._parentLabel(e,y)),t.add(g)}_parentLabel(t,e){const i=this._drawnTotal(),s=i>0?(t._area/i*100).toFixed(1):"0",a=this._countLeaves(t);return`${e&&String(e).trim()?String(e).replace(/\s+/g," ").trim():`${t.name}, ${this._formatValue(t._area)}`}, ${a} ${1===a?"item":"items"}, ${s}% of total`}_makeParentAccessible(t,e,i,s,a){t&&t.setAttribute&&this._zoomEnabled()&&(t.setAttribute("role","button"),t.setAttribute("tabindex","0"),t.setAttribute("aria-label",`${this._parentLabel(e,a)}. Zoom in`),t.setAttribute("aria-expanded","false"),d.isBrowser()&&t.addEventListener&&(t.addEventListener("focus",()=>{s.node.setAttribute("stroke",i.hoverColor),s.node.setAttribute("stroke-width",String(i.hoverWidth+1))}),t.addEventListener("blur",()=>{s.node.setAttribute("stroke",i.borderColor),s.node.setAttribute("stroke-width",String(i.borderWidth))}),t.addEventListener("keydown",t=>{"Enter"!==t.key&&" "!==t.key&&"Spacebar"!==t.key||(t.preventDefault(),this._zoomTo(e,!0))})))}_attachParentEvents(t,e,i,s){if(!d.isBrowser()||!t||!t.addEventListener)return;const a=this.w;i.hoverShow&&(t.addEventListener("mouseenter",()=>{s.node.setAttribute("stroke",i.hoverColor),s.node.setAttribute("stroke-width",String(i.hoverWidth))}),t.addEventListener("mouseleave",()=>{s.node.setAttribute("stroke",i.borderColor),s.node.setAttribute("stroke-width",String(i.borderWidth))})),a.config.tooltip.enabled&&(t.addEventListener("mouseenter",t=>this._showParentTooltip(t,e)),t.addEventListener("mousemove",t=>this._positionTooltip(t)),t.addEventListener("mouseleave",()=>this._hideParentTooltip())),this._zoomEnabled()&&(t.style.cursor="pointer",t.addEventListener("click",()=>this._zoomTo(e)))}_zoomEnabled(){const t=this.w,e=t.config.plotOptions.treemap.zoom;if(!e||!e.enabled||!this.showParents)return!1;const i=t.config.drilldown;return!(i&&i.enabled&&Array.isArray(i.series)&&i.series.length)||(this._warnedZoomConflict||(this._warnedZoomConflict=!0),!1)}_resolveFocus(t){const e=this.w.globals.treemapFocusKey;if(!e||!this._zoomEnabled())return null;let i=null;const s=t=>{i||(t._key!==e?t.children&&t.children.forEach(s):i=t)};return t.forEach(s),i&&i.children&&i.children.length?i:null}_zoomTo(t,e=!1){const i=this.w;if(!t||!t.children||!t.children.length)return;const s=i.globals.treemapFocusKey===t._key?null:t._key;i.globals.treemapFocusKey=s,this._hideParentTooltip();const a=this.ctx.update();e&&a&&"function"==typeof a.then&&a.then(()=>{if(!d.isBrowser())return;const t=i.dom.baseEl.querySelector(".apexcharts-breadcrumb .apexcharts-breadcrumb-item");if(t&&t.focus)return void t.focus();const e=i.dom.baseEl.querySelector(".apexcharts-treemap-parent-header[tabindex]");e&&e.focus&&e.focus()})}_focusChain(){const t=[],e=new Set(this.drawn||[]);let i=this._resolveFocus(this.drawn||[]);for(;i&&(t.unshift(i),!e.has(i));)i=i._parent;return t}_breadcrumbCfg(){const t=this.w.config.plotOptions.treemap.zoom;return Je(this.w,t&&t.breadcrumb)}_renderBreadcrumb(){if(!d.isBrowser())return;const t=this.w;if(!t.dom.elWrap)return;if(ei(t),!this._zoomEnabled())return;const e=this._focusChain();if(!e.length)return;const i=function(t,e){if(!d.isBrowser())return null;const i=t.dom.elWrap;if(!i)return null;ei(t);const s=e.config||Je(t);if(!1===s.show)return null;const a=e.crumbs||[];if(a.length<2)return null;const r=b.createElementNS(Ke,"nav");r.setAttribute("class","apexcharts-breadcrumb"),r.setAttribute("aria-label",e.ariaLabel||"Breadcrumb"),function(t,e){const i=e.offsetX||0,s=e.offsetY||0;t.style.position="absolute",t.style.top=s+"px","top-right"===e.position?t.style.right=3-i+"px":t.style.left=i+"px"}(r,s),e.compact&&(r.style.fontSize="11px",r.style.padding="0 2px");const n=null!=s.separator?s.separator:" / ";return a.forEach((t,i)=>{var o;if(i>0){const t=b.createElementNS(Ke,"span");t.setAttribute("class","apexcharts-breadcrumb-separator"),t.setAttribute("aria-hidden","true"),t.textContent=n,r.appendChild(t)}let l=0===i?null!=(o=s.rootLabel)?o:"All":t.label;if("function"==typeof s.formatter&&(l=s.formatter(l,{index:i,depth:a.length-1,data:t.data})),i===a.length-1){const t=b.createElementNS(Ke,"span");return t.setAttribute("class","apexcharts-breadcrumb-item apexcharts-breadcrumb-current"),t.setAttribute("aria-current","page"),t.textContent=String(l),void r.appendChild(t)}const h=b.createElementNS(Ke,"button");if(h.setAttribute("type","button"),h.setAttribute("class","apexcharts-breadcrumb-item"),0===i){const t=b.createElementNS(Ke,"span");t.setAttribute("class","apexcharts-breadcrumb-arrow"),t.setAttribute("aria-hidden","true"),t.textContent="\u2190",h.appendChild(t)}const c=b.createElementNS(Ke,"span");c.setAttribute("class","apexcharts-breadcrumb-label"),c.textContent=String(l),h.appendChild(c),h.addEventListener("click",()=>e.onNavigate(i,t)),r.appendChild(h)}),i.appendChild(r),r}(t,{ariaLabel:"Treemap breadcrumb",config:this._breadcrumbCfg(),compact:!0,crumbs:[{label:"All",data:null}].concat(e.map(t=>({label:t.name,data:t}))),onNavigate:(e,i)=>{t.globals.treemapFocusKey=i.data?i.data._key:null,this._hideParentTooltip(),this.ctx.update()}});i&&(this._placeBreadcrumb(i),Qe(t,i))}_placeBreadcrumb(t){var e,i;const s=this.w,a=s.layout.translateY||0,r=null==(i=null==(e=this.ctx)?void 0:e.dimensions)?void 0:i.dimHelpers,n=r?r.getTitleSubtitleCoords("title").height+r.getTitleSubtitleCoords("subtitle").height:0,o=t.getBoundingClientRect().height||18;if(a-n>=o+1)return void(t.style.top=a-o-1+"px");t.style.top=`${n}px`;const l="dark"===s.config.theme.mode;t.style.background=l?"rgba(20,24,30,0.82)":"rgba(255,255,255,0.86)",t.style.borderRadius="4px"}_showParentTooltip(t,e){const i=this.w,s=this._tip();if(!s)return;const a=this._drawnTotal(),r=e._parent?e._parent._area:a,n=a>0?(e._area/a*100).toFixed(1):"0.0",o=r>0?(e._area/r*100).toFixed(1):n,l=this.w.config.plotOptions.treemap.parents,h=l&&l.tooltip&&l.tooltip.formatter,c=this._countLeaves(e);let d;if("function"==typeof h)d=h({name:e.name,value:e._area,depth:e.depth||0,leafCount:c,percentOfParent:Number(o),percentOfTotal:Number(n),node:e,w:i});else{const t=this._parentChrome(e.depth||0).headerBg;d=`<div class="apexcharts-tooltip-series-group apexcharts-active" style="display:flex;${i.config.tooltip.fillSeriesColor?`background-color:${t};`:""}"><div class="apexcharts-tooltip-text"><div class="apexcharts-tooltip-y-group"><span class="apexcharts-tooltip-text-y-label">${v.escapeString(e.name)}: </span><span class="apexcharts-tooltip-text-y-value">${this._formatValue(e._area)}</span></div><div class="apexcharts-tooltip-y-group"><span class="apexcharts-tooltip-text-y-label">${c} items, </span><span class="apexcharts-tooltip-text-y-value">${o}% of parent, ${n}% of total</span></div></div></div>`}s.innerHTML=d,s.classList.add("apexcharts-active"),s.style.opacity="1",this._tipOwned=!0,this._positionTooltip(t)}_tip(){return this._tooltipEl||(this._tooltipEl=this.w.dom.baseEl.querySelector(".apexcharts-tooltip")),this._tooltipEl}_positionTooltip(t){const e=this._tip();if(!e||!this._tipOwned)return;const i=this.w.dom.elWrap.getBoundingClientRect(),s=e.offsetWidth,a=e.offsetHeight;let r=t.clientX-i.left+12;r+s>i.width&&(r=t.clientX-i.left-s-12),r=Math.max(0,Math.min(r,i.width-s));let n=t.clientY-i.top+12;n+a>i.height&&(n=t.clientY-i.top-a-12),n=Math.max(0,Math.min(n,i.height-a)),e.style.left=r+"px",e.style.top=n+"px"}_hideParentTooltip(){const t=this._tip();t&&this._tipOwned&&(this._tipOwned=!1,t.classList.remove("apexcharts-active"),t.style.opacity="0")}_drawnTotal(){return null==this._total&&(this._total=(this.drawn||[]).reduce((t,e)=>t+this._subtreeArea(e),0)),this._total||0}_subtreeArea(t){if(null!=t._area)return t._area;const e=t.children;if(e&&e.length){let t=0;for(let i=0;i<e.length;i++)t+=this._subtreeArea(e[i]);return t}const i=Number(t.value);return isNaN(i)?0:Math.abs(i)}_countLeaves(t){return t.children&&t.children.length?t.children.reduce((t,e)=>t+this._countLeaves(e),0):1}_formatValue(t){var e,i,s,a,r;const n=this.w,o=(null==(i=null==(e=n.config.tooltip)?void 0:e.y)?void 0:i.formatter)||(null==(r=null==(a=null==(s=n.config.yaxis)?void 0:s[0])?void 0:a.labels)?void 0:r.formatter);if("function"==typeof o)try{return String(o(t,{seriesIndex:0,dataPointIndex:0,w:n}))}catch(t){}return String(t)}_labelCanShow(t,e,i){if(!Number.isFinite(t)||t<=0)return!1;const s=this.w.config.plotOptions.treemap.dataLabels;return!(t<(s&&null!=s.minFontSize?Number(s.minFontSize):0))&&Math.max(e,i)>=t}_averageLabelSize(){if(null!=this._avgLabelSize)return this._avgLabelSize;return this._avgLabelSize=function t(e){let i,s=0;if(Array.isArray(e[0]))for(i=0;i<e.length;i++)s+=t(e[i]);else for(i=0;i<e.length;i++)s+=e[i].length;return s}(this.labels)/function t(e){let i,s=0;if(Array.isArray(e[0]))for(i=0;i<e.length;i++)s+=t(e[i]);else for(i=0;i<e.length;i++)s+=1;return s}(this.labels),this._avgLabelSize}getFontSize(t){const e=this.w,i=this._averageLabelSize();return function(t,s){const a=t*s,r=Math.pow(a,.5);return Math.min(r/i,parseInt(e.config.dataLabels.style.fontSize,10))}(t[2]-t[0],t[3]-t[1])}rotateToFitLabel(t,e,i,s,a,r,n){const o=new Dt(this.w),l=o.getTextRects(i,String(e));if(l.width+this.w.config.stroke.width+5>r-s&&l.width<=n-a){const e=o.rotateAroundCenter(t.node);t.node.setAttribute("transform",`rotate(-90 ${e.x} ${e.y}) translate(${l.height/3})`)}}truncateLabels(t,e,i,s,a,r){const n=new Dt(this.w),o=n.getTextRects(t,String(e)).width+this.w.config.stroke.width+5>a-i&&r-s>a-i?r-s:a-i,l=n.getTextBasedOnMaxWidth({text:t,maxWidth:o,fontSize:e});return t.length!==l.length&&o/e<5?"":l}_morphKeyed(){var t;const e=null==(t=this.ctx)?void 0:t.morphTypeChange;return!(!e||"function"!=typeof e.hasKeyedMarks||!e.hasKeyedMarks()||"function"!=typeof e.getInitialPathForKey)}_morphSourceForLeaf(t){var e;const i=null==(e=this.ctx)?void 0:e.morphTypeChange;if(!i||"function"!=typeof i.getInitialPathAt)return null;if(this._morphKeyed()){const e=i.getInitialPathForKey(Mi(t._key));if(e)return e}return i.getInitialPathAt(this._morphLeafIndex++)}_tilePath(t,e,i,s){return`M ${t} ${e} L ${i} ${e} L ${i} ${s} L ${t} ${s} Z`}_morphTile(t,e,i,s,a,r){new Ct(this.w,this.ctx).morphSVG(t,a,r,"none",e,i,s,0)}animateTreemap(t,e,i,s,a=0){const r=new Ct(this.w);r.animateRect(t,e,i,s,()=>{r.animationCompleted(t)},a)}},unit:class{constructor(t,e){this.ctx=e,this.w=t,this._lastDotR=1,this._gridTrack=null,this._gridDenom=1,this._scatterAxis=null,this._specCache=new Map,this._markWarned=null}draw(t){const e=this.w,i=new Dt(e,this.ctx),s=i.group({class:"apexcharts-unit"});if(e.globals.noData||!Array.isArray(t)||0===t.length)return s;const a=e.config.plotOptions.unit,r="packed"===a.layout?"packed":"columns"===a.layout?"columns":"grid"===a.layout?"grid":"scatter"===a.layout?"scatter":"arc"===a.layout?"arc":"custom"===a.layout?"custom":"grouped",n=a.transition,o="flow"===n,l="identity"===n,h=a.unitValue>0?a.unitValue:1;let c=t.map(t=>{const e=Math.abs(v.parseNumber(t))/h;return e>0?Math.max(1,Math.round(e)):0});c=this._applyMaxUnits(c,a.maxUnits);const d=c.reduce((t,e)=>t+e,0),p="packed"===r?this._layoutPacked(c,a):"columns"===r?this._layoutColumns(c,a):"grid"===r?this._layoutGrid(c,a):"scatter"===r?this._layoutScatter(a):"arc"===r?this._layoutArc(c,a):"custom"===r?this._layoutCustom(c,a):this._layoutGrouped(c,a),u="grid"===r&&!(!a.grid||!a.grid.split);u&&this._drawGridTrack(s,i,a),"scatter"===r&&this._drawScatterAxes(s,i);const g=this._lastDotR,f=this._shouldAnimate(),x=this.ctx&&this.ctx.morphTypeChange,m=f&&!!x&&"function"==typeof x.isActive&&x.isActive()&&"function"==typeof x.getInitialCenterFor,b=m&&"function"==typeof x.getInitialSlotFor,y=m&&"function"==typeof x.usesPieceTakeover&&x.usesPieceTakeover(),w=f&&!m&&this.ctx?this.ctx._unitPrevDots:null,A=new Map,S=[],C=e.seriesData.unitData||[],k=this._bubbleStats(C,a,g);let _=0;if(p.forEach(t=>{const n=e.globals.colors[t.i]||e.globals.colors[0]||"#008FFB",h=i.group({class:"apexcharts-series",seriesName:v.escapeString(e.seriesData.seriesNames[t.i]||`series-${t.i+1}`),rel:t.i+1,"data:realIndex":t.i}),p=m&&!b?x.getInitialCenterFor(t.i):null,M=t.dots.length,D=C[t.i];if(t.dots.forEach((e,s)=>{const r=null!=e.j?e.j:s,c=D?D[r]:void 0,d=c&&"object"==typeof c&&c.fillColor?c.fillColor:n,m=null!=e.r?e.r:k?this._radiusForValue(this._unitValueOf(c),k):g,v=this._markSpecFor(a,c,t.i,m),C=this._drawDot(i,a,m,d,t.i,r,v);let L;if(h.add(C),l){const t=c&&"object"==typeof c?null!=c.id?c.id:c.name:void 0;L=null!=t?`id:${t}`:`g:${_}`}else L=o?String(_):null!=e.slot?`slot:${e.slot}`:`${t.i}:${r}`;if(_++,A.set(L,{x:e.x,y:e.y,fill:d,r:m,spec:v}),y)this._place(C.node,v,e.x,e.y),C.node.setAttribute("opacity","0"),C.node.setAttribute("data-piece-hidden","1");else if(f){const i=w&&w.get(L),s=i||(b?x.getInitialSlotFor(t.i,r,M):p),n=a.gather&&a.gather.enter||"burst",o=u||"fade"===n||"rise"===n,l=s?s.x:o?e.x:t.cx,h=s?s.y:"rise"!==n||u?o?e.y:t.cy:e.y+14;C.node.style.opacity=s?"1":"0",this._place(C.node,v,l,h),S.push({node:C.node,spec:v,x:e.x,y:e.y,cx0:l,cy0:h,key:L,r0:i&&null!=i.r?i.r:m,r1:m,fill0:i?i.fill:d,fill1:d,delay:0,isEnter:!s})}else this._place(C.node,v,e.x,e.y)}),("grouped"===r||"columns"===r||u)&&a.clusterLabels&&a.clusterLabels.show&&c[t.i]>0){const e=u?this._gridDenom:d;this._drawClusterLabel(h,t,c[t.i],e,a,n)}s.add(h)}),this._outerLabelsOn(a)&&this._drawOuterLabels(s,p,c,d,a,f&&!w),w){const t=this._collectExits(w,A,a);if(t.length){const e=i.group({class:"apexcharts-unit-exits"});s.add(e),this._runExits(e,t,a)}}return this.ctx&&(this.ctx._unitPrevDots=A),!this.ctx||f&&!m||(this.ctx._unitSprings=null),f&&S.length?this._runGather(S):e.globals.animationEnded=!0,s}_applyMaxUnits(t,e){const i=t.reduce((t,e)=>t+e,0);if(!e||e<=0||i<=e)return t;const s=e/i;return t.map(t=>t>0?Math.max(1,Math.round(t*s)):0)}_layoutCustom(t,e){const i=this.w,s=i.layout.gridWidth,a=i.layout.gridHeight,r=t.reduce((t,e)=>t+e,0),n=this._resolveLayoutProvider(e);if(!n)return this._layoutGrouped(t,e);const o=this._outerLabelsOn(e)?this._outerLabelGutter(t,e):0;this._lastOuterGutter=o;const l={x:o,y:0,width:Math.max(1,s-2*o),height:a},h=Math.sqrt(l.width*l.height/Math.PI),c=this._resolveStep(e,h,r);this._lastDotR=this._dotRadiusFromStep(c,e);const d=this._lastDotR,p=this._layoutObjects(t,d);let u;try{u=n(p,l)}catch(i){return this._layoutGrouped(t,e)}if(!Array.isArray(u))return this._layoutGrouped(t,e);const g=new Map;u.forEach(t=>{t&&isFinite(t.x)&&isFinite(t.y)&&g.set(String(t.id),{x:t.x,y:t.y,r:"number"==typeof t.r&&t.r>0?t.r:void 0})});const f=t.map((t,e)=>({i:e,cx:s/2,cy:a/2,outerR:d,dots:[]}));return p.forEach(t=>{const e=g.get(t.id);e&&f[t.seriesIndex].dots.push({x:e.x,y:e.y,r:e.r,j:t.dataPointIndex})}),f.forEach(t=>{if(!t.dots.length)return;let e=0,i=0;t.dots.forEach(t=>{e+=t.x,i+=t.y}),t.cx=e/t.dots.length,t.cy=i/t.dots.length;let s=0;t.dots.forEach(e=>{s=Math.max(s,Math.hypot(e.x-t.cx,e.y-t.cy))}),t.outerR=s+d}),f}_layoutObjects(t,e){const i=this.w,s=i.seriesData.unitData||[],a=i.seriesData.seriesNames||[],r=[];let n=0;return t.forEach((t,i)=>{var o;const l=s[i];for(let s=0;s<t;s++){const t=l?l[s]:void 0,h=!t||"object"!=typeof t||null==t.id&&null==t.name?`${i}:${s}`:String(null!=t.id?t.id:t.name);r.push({id:h,index:n,seriesIndex:i,dataPointIndex:s,label:a[i],value:null!=(o=this._unitValueOf(t))?o:void 0,datum:t,r:e}),n++}}),r}_resolveLayoutProvider(t){const e=t.positions;if("function"==typeof e)return e;if("string"==typeof e&&e){const t=(i=e)&&gs()[i]||null;if(t)return t}var i;return null}_layoutGrouped(t,e){const i=this.w,s=i.layout.gridWidth,a=i.layout.gridHeight,r=e.clusterLabels&&e.clusterLabels.show?30:6,n=t.map((t,e)=>e).filter(e=>t[e]>0),o=Math.max(1,n.length),l=new Array(t.length).fill(-1);n.forEach((t,e)=>l[t]=e);const h=s/o,c=a-r,d=Math.max(1,...t),p=.08*Math.min(h,c),u=Math.max(4,Math.min(h,c)/2-p),g=this._resolveStep(e,u,d);this._lastDotR=this._dotRadiusFromStep(g,e);const f=this._lastDotR,x=r+c/2,m=t.map(t=>g*Math.sqrt(Math.max(1,t))+f);let b=t.map((t,e)=>(t=>l[t]>=0?h*(l[t]+.5):s/2)(e));const y=n.map(t=>m[t]);let w=!1;for(let t=1;t<o;t++)if(b[n[t]]-b[n[t-1]]<y[t]+y[t-1]){w=!0;break}if(w){const e=Math.max(2*f,8),i=y.reduce((t,e)=>t+2*e,0)+e*(o-1);let a;if(i<=s){let t=(s-i)/2;a=y.map(i=>{const s=t+i;return t+=2*i+e,s})}else if(1===o)a=[s/2];else{const t=y[0],e=s-y[o-1];a=y.map((i,s)=>t+(e-t)*s/(o-1))}b=t.map((t,e)=>l[e]>=0?a[l[e]]:s/2)}return t.map((t,e)=>({i:e,cx:b[e],cy:x,outerR:m[e],dots:this._spiral(b[e],x,t,g,0)}))}_layoutPacked(t,e){const i=this.w,s=i.layout.gridWidth,a=i.layout.gridHeight,r=Math.max(1,t.reduce((t,e)=>t+e,0)),n=Math.max(4,Math.min(s,a-6)/2-.06*Math.min(s,a)),o=this._resolveStep(e,n,r);this._lastDotR=this._dotRadiusFromStep(o,e);const l=s/2,h=6+(a-6)/2,c=t.map((t,e)=>e);!1!==e.sortByGroup&&c.sort((e,i)=>t[e]-t[i]);const d=t.map((t,e)=>({i:e,cx:l,cy:h,outerR:o*Math.sqrt(r)+this._lastDotR,dots:[]}));let p=0;return c.forEach(e=>{for(let i=0;i<t[e];i++){const t=o*Math.sqrt(p+.5),i=p*Xr;d[e].dots.push({x:l+t*Math.cos(i),y:h+t*Math.sin(i),slot:p}),p++}}),d}_layoutArc(t,e){const i=this.w,s=i.layout.gridWidth,a=i.layout.gridHeight,r=Math.max(1,t.reduce((t,e)=>t+e,0)),n=e.arc||{},o="number"==typeof n.startAngle?n.startAngle:-90,l="number"==typeof n.endAngle?n.endAngle:90,h=o*Math.PI/180,c=l*Math.PI/180,d=c-h||Math.PI,p=Math.max(0,Math.min(.95,"number"==typeof n.innerRadiusRatio?n.innerRadiusRatio:.4)),u=t=>Math.sin(t),g=t=>-Math.cos(t),f=this._arcBounds(h,c),x=.04*Math.min(s,a),m=Math.max(1e-6,f.maxX-f.minX),b=Math.max(1e-6,f.maxY-f.minY),y=Math.max(4,Math.min((s-2*x)/m,(a-2*x)/b)),w=y*p,v=s/2-(f.minX+f.maxX)/2*y,A=a/2-(f.minY+f.maxY)/2*y,S=this._arcAllocate(r,w,y,d,e);this._lastDotR=S.dotR;const C=[];for(let t=0;t<S.R;t++){const e=S.radii[t],i=S.seatsPerRow[t];for(let t=0;t<i;t++){const s=1===i?(h+c)/2:h+d*(t+.5)/i;C.push({a:s,x:v+e*u(s),y:A+e*g(s)})}}C.sort((t,e)=>t.a-e.a);const k=t.map((t,e)=>({i:e,cx:v,cy:A,outerR:y,dots:[]}));let _=0,M=0;return C.forEach((e,i)=>{for(;_<t.length&&M>=t[_];)_++,M=0;_>=t.length||(k[_].dots.push({x:e.x,y:e.y,slot:i}),M++)}),k}_arcBounds(t,e){const i=t=>Math.sin(t),s=t=>-Math.cos(t),a=Math.min(t,e),r=Math.max(t,e),n=[0,i(t),i(e)],o=[0,s(t),s(e)],l=Math.PI/2;for(let t=Math.ceil(a/l);t*l<=r;t++)n.push(i(t*l)),o.push(s(t*l));return{minX:Math.min(...n),maxX:Math.max(...n),minY:Math.min(...o),maxY:Math.max(...o)}}_arcAllocate(t,e,i,s,a){const r=a.spacing>0?a.spacing:1.05,n=Math.abs(s)||Math.PI,o=this._fixedRadius(a),l=s=>{s=Math.max(1,Math.round(s));const a=[];for(let t=0;t<s;t++)a.push(1===s?(e+i)/2:e+t/(s-1)*(i-e));const o=a.reduce((t,e)=>t+e,0)||1,l=a.map(e=>t*e/o),h=l.map(t=>Math.floor(t));let c=t-h.reduce((t,e)=>t+e,0);for(l.map((t,e)=>({idx:e,frac:t-Math.floor(t)})).sort((t,e)=>e.frac-t.frac).forEach(t=>{c>0&&(h[t.idx]++,c--)});c>0;)h[s-1]++,c--;const d=1===s?i-e||i:(i-e)/(s-1);let p=1/0;for(let t=0;t<s;t++){const e=h[t];if(e<=0)continue;const i=a[t]*n/e;i<p&&(p=i)}const u=Math.min(d,p);return{R:s,radii:a,seatsPerRow:h,dotR:Math.max(1,u/(2*r))}},h=a.arc&&a.arc.rows;let c;if("number"==typeof h&&h>=1)c=l(h);else if(o){c=l((i-e)/(2*o*r)+1)}else{const e=Math.max(1,Math.min(40,Math.ceil(Math.sqrt(t))+6));c=l(1);for(let t=2;t<=e;t++){const e=l(t);e.dotR>c.dotR&&(c=e)}}return o&&(c.dotR=o),c}_layoutColumns(t,e){const i=this.w,s=i.layout.gridWidth,a=i.layout.gridHeight,r=!(!e.clusterLabels||!e.clusterLabels.show),n=r&&"bottom"===e.clusterLabels.position,o=r&&!n?30:6,l=t.map((t,e)=>e).filter(e=>t[e]>0),h=Math.max(1,l.length),c=new Array(t.length).fill(-1);l.forEach((t,e)=>c[t]=e);const d=s/h,p=.62*d,u=Math.max(8,.04*a)+(n?30:0),g=Math.max(4,a-o-u),f=Math.max(1,...t),x=e.spacing>0?e.spacing:1,m=e.columns?e.columns.size:void 0;let b;b="image"!==e.shape&&"auto"===m?null:"image"!==e.shape&&"number"==typeof m&&m>0?m:this._fixedRadius(e);let y=1,w=0;if(b){w=2*b*x,this._lastDotR=b;const t=Math.max(1,Math.floor(g/w)),e=Math.max(1,Math.floor(p/w));y=Math.max(1,Math.min(e,Math.ceil(f/t)))}else{let t=0;const e=Math.max(1,Math.min(40,Math.round(p/4)));for(let i=1;i<=e;i++){const e=Math.ceil(f/i),s=Math.min(p/i,g/e);s>t&&(t=s,y=i)}w=t,this._lastDotR=Math.max(1,w/(2*x))}const v=this._lastDotR,A=Math.ceil(f/y),S=o+(g+Math.min(g,A*w))/2;return t.map((t,e)=>{const i=c[e]>=0?d*(c[e]+.5):s/2,a=Math.ceil(Math.max(1,t)/y)*w,r=i-y*w/2+w/2,n=[];for(let e=0;e<t;e++){const t=Math.floor(e/y),i=e%y;n.push({x:r+i*w,y:S-v-t*w})}return{i:e,cx:i,cy:S-a/2,outerR:a/2,flat:!0,dots:n}})}_layoutGrid(t,e){if(e.grid&&e.grid.split)return this._layoutGridSplit(t,e);this._gridTrack=null;const i=this.w,s=i.layout.gridWidth,a=i.layout.gridHeight,r=e.grid||{},n=Math.max(1,Math.round(r.columns>0?r.columns:10)),o="top"===r.fillFrom?"top":"bottom",l=r.total>0?this._largestRemainder(t,Math.round(r.total)):t.slice(),h=l.reduce((t,e)=>t+e,0),c=Math.max(1,Math.ceil(Math.max(1,h)/n)),d=e.spacing>0?e.spacing:1,p=Math.max(4,s),u=Math.max(4,a-6),g=this._fixedRadius(e);let f=0;g?(f=2*g*d,this._lastDotR=g):(f=Math.min(p/n,u/c),this._lastDotR=Math.max(1,f/(2*d)));const x=n*f,m=c*f,b=(s-x)/2+f/2,y=6+(u-m)/2,w=t=>"bottom"===o?y+m-f/2-t*f:y+f/2+t*f,v=t.map((t,e)=>({i:e,cx:s/2,cy:6+u/2,outerR:Math.max(x,m)/2,dots:[]}));let A=0;for(let t=0;t<l.length;t++)for(let e=0;e<l[t];e++){const e=A%n,i=Math.floor(A/n);v[t].dots.push({x:b+e*f,y:w(i),slot:A}),A++}return v}_layoutGridSplit(t,e){const i=this.w,s=i.layout.gridWidth,a=i.layout.gridHeight,r=e.grid||{},n=Math.max(1,Math.round(r.columns>0?r.columns:10)),o="top"===r.fillFrom?"top":"bottom",l=Math.max(1,Math.round(r.total>0?r.total:100)),h=Math.max(1,Math.ceil(l/n)),c=t.map((t,e)=>e).filter(e=>t[e]>0),d=Math.max(1,c.length),p=r.max>0?r.max:Math.max(1,...t),u=Math.max(1,Math.round(r.tileColumns>0?r.tileColumns:Math.ceil(Math.sqrt(d)))),g=Math.max(1,Math.ceil(d/u)),f=!(e.clusterLabels&&!1===e.clusterLabels.show),x=f&&e.clusterLabels&&"bottom"===e.clusterLabels.position,m=f&&!x?22:4,b=f&&x?22:4,y=s/u,w=a/g,v=Math.max(4,.86*y),A=Math.max(4,w-m-b),S=e.spacing>0?e.spacing:1,C=this._fixedRadius(e);let k=0;C?(k=2*C*S,this._lastDotR=C):(k=Math.min(v/n,A/h),this._lastDotR=Math.max(1,k/(2*S)));const _=n*k,M=h*k,D=(t,e)=>"bottom"===o?t+M-k/2-e*k:t+k/2+e*k,L=[],P=[];return c.forEach((e,i)=>{const s=i%u,a=Math.floor(i/u),r=s*y,o=r+(y-_)/2+k/2,h=a*w+m+(A-M)/2,c=t=>({x:o+t%n*k,y:D(h,Math.floor(t/n))});for(let t=0;t<l;t++)L.push(c(t));const d=Math.max(0,Math.min(l,Math.round(t[e]/p*l))),g=[];for(let t=0;t<d;t++){const e=c(t);g.push({x:e.x,y:e.y,slot:i*l+t})}P.push({i:e,cx:r+y/2,cy:h+M/2,outerR:M/2,flat:!0,split:!0,dots:g})}),this._gridDenom=p,this._gridTrack={cells:L},P}_drawGridTrack(t,e,i){const s=this._gridTrack;if(!s||!s.cells||!s.cells.length)return;const a=this._lastDotR,r=(i.grid||{}).trackColor||"rgba(128,128,128,0.14)",n=e.group({class:"apexcharts-unit-track"});s.cells.forEach(t=>{let s;if("square"===i.shape){const n=2*a;s=e.drawRect(0,0,n,n,i.borderRadius||0,r,1,0,"none"),s.node.setAttribute("fill",r),s.node.setAttribute("x",String(t.x-a)),s.node.setAttribute("y",String(t.y-a))}else s=e.drawCircle(a,{fill:r,"stroke-width":0,stroke:"none"}),s.node.setAttribute("fill",r),s.node.setAttribute("cx",String(t.x)),s.node.setAttribute("cy",String(t.y));s.node.classList.add("apexcharts-unit-track-cell"),n.add(s)}),t.add(n)}_layoutScatter(t){const e=this.w,i=t.scatter||{};if("value"===i.y)return this._layoutScatter2D(t);if("vertical"===i.orientation)return this._layoutScatterVertical(t);const s=e.layout.gridWidth,a=e.layout.gridHeight,r=e.seriesData.unitData||[],n=e.seriesData.seriesNames||[],o=t=>this._unitValueOf(t),l=this._scatterSizeStats(i,r),h=r.map(t=>Array.isArray(t)?t.map(o):[]),c=t=>null!=t&&isFinite(t),d=h.map((t,e)=>e).filter(t=>h[t].some(c)),p=Math.max(1,d.length);let u=1/0,g=-1/0;h.forEach(t=>t.forEach(t=>{null!=t&&isFinite(t)&&(t<u&&(u=t),t>g&&(g=t))})),u===1/0&&(u=0,g=1);const f=Math.max(2,Math.round(i.tickAmount>0?i.tickAmount:5)),x=this._scatterValueDomain(i,u,g,f),m=x.min,b=x.max,y=b-m||1,w=null!=i.laneLabelWidth?Math.max(0,i.laneLabelWidth):p>1?92:8,v=30+(i.xTitle?20:0),A=w,S=s-8,C=a-v,k=Math.max(4,S-A),_=Math.max(4,C-10),M=t=>A+(t-m)/y*k,D=_/p;let L=0;const P=this._fixedRadius(t);if(P)L=P;else{const t=Math.max(1,...d.map(t=>h[t].filter(c).length));L=Math.max(2,Math.min(6,.12*D,k/(2.5*Math.sqrt(t))))}this._lastDotR=L;const E=t.spacing>0?t.spacing:1,T=Math.max(.5,L*E),F="jitter"===i.spread,I=[],R=[],X=l?l.rMax:L;d.forEach((t,e)=>{const i=(t=>10+D*(t+.5))(e);R.push({i:t,cy:i,name:n[t]||`series-${t+1}`});const s=(r[t]||[]).map((t,e)=>{const s=o(t),a={j:e,px:M(c(s)?s:m),y:i};return l&&(a.r=this._scatterRadius(t,l,L)),a});if(F){const t=Math.max(X,D/2-X);s.forEach((e,s)=>{const a=(9301*s+49297)%233280/233280;e.y=i+(2*a-1)*t})}else this._beeswarm(s,i,L,T,X);I.push({i:t,cx:(A+S)/2,cy:i,outerR:D/2,dots:s.map(t=>({x:t.px,y:t.y,r:t.r}))})});const z=x.ticks;return this._scatterAxis={mode:"1d",plotL:A,plotR:S,plotT:10,plotB:C,xMin:m,xMax:b,plotX:M,ticks:z,lanes:R,xTitle:i.xTitle,formatter:"function"==typeof i.xFormatter?i.xFormatter:null,gridlines:!1!==i.gridlines},I}_layoutScatterVertical(t){const e=this.w,i=t.scatter||{},s=e.layout.gridWidth,a=e.layout.gridHeight,r=e.seriesData.unitData||[],n=e.seriesData.seriesNames||[],o=t=>this._unitValueOf(t),l=this._scatterSizeStats(i,r),h=r.map(t=>Array.isArray(t)?t.map(o):[]),c=t=>null!=t&&isFinite(t),d=h.map((t,e)=>e).filter(t=>h[t].some(c)),p=Math.max(1,d.length);let u=1/0,g=-1/0;h.forEach(t=>t.forEach(t=>{null!=t&&isFinite(t)&&(t<u&&(u=t),t>g&&(g=t))})),u===1/0&&(u=0,g=1);const f=Math.max(2,Math.round(i.tickAmount>0?i.tickAmount:5)),x=this._scatterValueDomain(i,u,g,f),m=x.min,b=x.max,y=b-m||1,w=46+(i.xTitle?18:0),v=s-10,A=a-(p>1?26:10),S=Math.max(4,v-w),C=Math.max(4,A-10),k=t=>A-(t-m)/y*C,_=S/p;let M=0;const D=this._fixedRadius(t);if(D)M=D;else{const t=Math.max(1,...d.map(t=>h[t].filter(c).length));M=Math.max(2,Math.min(6,.12*_,C/(2.5*Math.sqrt(t))))}this._lastDotR=M;const L=t.spacing>0?t.spacing:1,P=Math.max(.5,M*L),E="jitter"===i.spread,T=[],F=[],I=l?l.rMax:M;d.forEach((t,e)=>{const i=(t=>w+_*(t+.5))(e);F.push({i:t,cx:i,name:n[t]||`series-${t+1}`});const s=(r[t]||[]).map((t,e)=>{const s=o(t),a={j:e,py:k(c(s)?s:m),x:i};return l&&(a.r=this._scatterRadius(t,l,M)),a});if(E){const t=Math.max(I,_/2-I);s.forEach((e,s)=>{const a=(9301*s+49297)%233280/233280;e.x=i+(2*a-1)*t})}else this._beeswarm(s,i,M,P,I,!0);T.push({i:t,cx:i,cy:(10+A)/2,outerR:_/2,dots:s.map(t=>({x:t.x,y:t.py,r:t.r}))})});const R=x.ticks;return this._scatterAxis={mode:"1d",orientation:"vertical",plotL:w,plotR:v,plotT:10,plotB:A,vMin:m,vMax:b,plotY:k,ticks:R,lanes:F,valueTitle:i.xTitle,formatter:"function"==typeof i.xFormatter?i.xFormatter:null,gridlines:!1!==i.gridlines},T}_layoutScatter2D(t){const e=this.w,i=e.layout.gridWidth,s=e.layout.gridHeight,a=t.scatter||{},r=e.seriesData.unitData||[],n=t=>"number"==typeof t&&isFinite(t),o=t=>t&&"object"==typeof t?t.x:null,l=t=>t&&"object"==typeof t?null!=t.y?t.y:t.value:null,h=r.map((t,e)=>e).filter(t=>(r[t]||[]).some(t=>n(o(t))&&n(l(t))));let c=1/0,d=-1/0,p=1/0,u=-1/0;r.forEach(t=>(t||[]).forEach(t=>{const e=o(t),i=l(t);n(e)&&n(i)&&(e<c&&(c=e),e>d&&(d=e),i<p&&(p=i),i>u&&(u=i))})),c===1/0&&(c=0,d=1,p=0,u=1);const g=Math.max(2,Math.round(a.tickAmount>0?a.tickAmount:5)),f=Math.max(2,Math.round(a.yTickAmount>0?a.yTickAmount:5)),x=this._niceScale(null!=a.xMin?a.xMin:c,null!=a.xMax?a.xMax:d,g),m=this._niceScale(null!=a.yMin?a.yMin:p,null!=a.yMax?a.yMax:u,f),b=null!=a.xMin?a.xMin:x.min,y=null!=a.xMax?a.xMax:x.max,w=null!=a.yMin?a.yMin:m.min,v=null!=a.yMax?a.yMax:m.max,A=y-b||1,S=v-w||1,C=46+(a.yTitle?18:0),k=30+(a.xTitle?20:0),_=C,M=i-12,D=s-k,L=Math.max(4,M-_),P=Math.max(4,D-10),E=t=>_+(t-b)/A*L,T=t=>D-(t-w)/S*P,F=this._scatterSizeStats(a,r),I=this._fixedRadius(t)||5;this._lastDotR=I;const R=[];h.forEach(t=>{const e=(r[t]||[]).map(t=>{const e=o(t),i=l(t);return{x:E(n(e)?e:b),y:T(n(i)?i:w),r:F?this._scatterRadius(t,F,I):void 0}});R.push({i:t,cx:(_+M)/2,cy:(10+D)/2,outerR:P/2,dots:e})});const X=(t,e,i,s,a,r)=>{const n=[];if(a)for(let e=0;e<r;e++)n.push(t+i*e/(r-1));else{const a=s||i/Math.max(1,r-1);for(let i=t;i<=e+.5*a;i+=a)n.push(Math.abs(i)<1e-9*a?0:i)}return n};return this._scatterAxis={mode:"2d",plotL:_,plotR:M,plotT:10,plotB:D,plotX:E,plotY:T,xTicks:X(b,y,A,x.spacing,null!=a.xMin||null!=a.xMax,g),yTicks:X(w,v,S,m.spacing,null!=a.yMin||null!=a.yMax,f),xTitle:a.xTitle,yTitle:a.yTitle,xFormatter:"function"==typeof a.xFormatter?a.xFormatter:null,yFormatter:"function"==typeof a.yFormatter?a.yFormatter:null,gridlines:!1!==a.gridlines},R}_scatterSizeStats(t,e){const i=t&&t.sizeRange;if(!Array.isArray(i)||i.length<2)return null;const s=Math.max(.5,+i[0]),a=Math.max(s,+i[1]),r=t.sizeField||"z";let n=1/0,o=-1/0;return e.forEach(t=>(t||[]).forEach(t=>{const e=t&&"object"==typeof t?t[r]:null;"number"==typeof e&&isFinite(e)&&(e<n&&(n=e),e>o&&(o=e))})),n===1/0?null:{zmin:n,zmax:o,rMin:s,rMax:a,field:r}}_scatterRadius(t,e,i){if(!e)return i;const s=t&&"object"==typeof t?t[e.field]:null;if("number"!=typeof s||!isFinite(s))return e.rMin;const a=e.zmax>e.zmin?(s-e.zmin)/(e.zmax-e.zmin):1,r=Math.max(0,Math.min(1,a)),n=e.rMin*e.rMin,o=e.rMax*e.rMax;return Math.sqrt(n+r*(o-n))}_beeswarm(t,e,i,s,a,r=!1){const n=r?"py":"px",o=r?"x":"y",l=t.slice().sort((t,e)=>t[n]-e[n]),h=[],c=null!=a?a:i;l.forEach(t=>{const a=null!=t.r?t.r:i;let r=0;for(let i=0;i<2e3;i++){const o=0===i?0:Math.ceil(i/2)*s*(i%2?1:-1),l=e+o;let d=!0;for(let e=h.length-1;e>=0;e--){const i=h[e],s=t[n]-i.f;if(s>a+c)break;const r=a+i.r,o=l-i.s;if(s*s+o*o<r*r){d=!1;break}}if(d){r=o;break}}t[o]=e+r,h.push({f:t[n],s:t[o],r:a})})}_scatterValueDomain(t,e,i,s){const a=(t,e,i)=>{const s=[];for(let a=t;a<=e+.5*i;a+=i)s.push(Math.abs(a)<1e-9*i?0:a);return s};if(null!=t.xMin||null!=t.xMax){let r=null!=t.xMin?t.xMin:e,n=null!=t.xMax?t.xMax:i;n>r||(n=r+1);const o=(n-r)/Math.max(1,s-1);return e<r&&(r-=Math.ceil((r-e)/o)*o),i>n&&(n+=Math.ceil((i-n)/o)*o),{min:r,max:n,ticks:a(r,n,o)}}const r=this._niceScale(e,i,s),n=r.spacing||(r.max-r.min)/Math.max(1,s-1);return{min:r.min,max:r.max,ticks:a(r.min,r.max,n)}}_niceScale(t,e,i){const s=t;let a=e;a>s||(a=s+1);const r=this._niceNum(a-s,!1),n=this._niceNum(r/Math.max(1,i-1),!0);return{min:Math.floor(s/n)*n,max:Math.ceil(a/n)*n,spacing:n}}_niceNum(t,e){const i=t>0?t:1,s=Math.floor(Math.log(i)/Math.LN10),a=i/Math.pow(10,s);let r;return r=e?a<1.5?1:a<3?2:a<7?5:10:a<=1?1:a<=2?2:a<=5?5:10,r*Math.pow(10,s)}_drawScatterAxes(t,e){const i=this.w;if(!d.isBrowser())return;const s=this._scatterAxis;if(!s)return;const a="http://www.w3.org/2000/svg",r=e.group({class:"apexcharts-unit-axis"}),n=i.config.grid&&i.config.grid.borderColor||"rgba(128,128,128,0.18)",o="rgba(128,128,128,0.5)",l=i.config.xaxis&&i.config.xaxis.labels&&i.config.xaxis.labels.style&&i.config.xaxis.labels.style.colors,h=Array.isArray(l)?l[0]:l,c=h||"rgba(120,130,140,0.9)",p=(t,e,i,s,n)=>{const o=b.createElementNS(a,"line");o.setAttribute("x1",String(t)),o.setAttribute("y1",String(e)),o.setAttribute("x2",String(i)),o.setAttribute("y2",String(s)),o.setAttribute("stroke",n),o.setAttribute("shape-rendering","crispEdges"),r.node.appendChild(o)},u=(t,e,s,n,o,l,h,c)=>{const d=b.createElementNS(a,"text");d.setAttribute("class",c),d.setAttribute("x",String(e)),d.setAttribute("y",String(s)),d.setAttribute("text-anchor",n),d.setAttribute("dominant-baseline","middle"),d.setAttribute("font-size",`${l}px`),d.setAttribute("font-family",i.config.chart.fontFamily||"inherit"),d.setAttribute("font-weight",String(h)),d.setAttribute("fill",o),d.textContent=t,r.node.appendChild(d)};if("2d"!==s.mode){if("vertical"===s.orientation){if(s.ticks.forEach(t=>{const e=s.plotY(t);s.gridlines&&p(s.plotL,e,s.plotR,e,n);const i=s.formatter?String(s.formatter(t)):this._formatTick(t);u(i,s.plotL-8,e,"end",c,11,400,"apexcharts-unit-tick")}),p(s.plotL,s.plotT,s.plotL,s.plotB,o),s.valueTitle){const t=b.createElementNS(a,"text");t.setAttribute("class","apexcharts-unit-axis-title");const e=14,n=(s.plotT+s.plotB)/2;t.setAttribute("x",String(e)),t.setAttribute("y",String(n)),t.setAttribute("text-anchor","middle"),t.setAttribute("font-size","12px"),t.setAttribute("font-family",i.config.chart.fontFamily||"inherit"),t.setAttribute("font-weight","600"),t.setAttribute("fill",c),t.setAttribute("transform",`rotate(-90 ${e} ${n})`),t.textContent=String(s.valueTitle),r.node.appendChild(t)}return s.lanes.forEach(t=>{const e=h||i.globals.colors[t.i]||i.globals.colors[0]||"#008FFB";u(t.name,t.cx,s.plotB+16,"middle",e,12,600,"apexcharts-unit-lane-label")}),void t.add(r)}s.ticks.forEach((t,e)=>{const i=s.plotX(t);s.gridlines&&p(i,s.plotT,i,s.plotB,n);const a=s.formatter?String(s.formatter(t)):this._formatTick(t),r=0===e?"start":e===s.ticks.length-1?"end":"middle";u(a,i,s.plotB+14,r,c,11,400,"apexcharts-unit-tick")}),p(s.plotL,s.plotB,s.plotR,s.plotB,o),s.xTitle&&u(String(s.xTitle),(s.plotL+s.plotR)/2,s.plotB+32,"middle",c,12,600,"apexcharts-unit-axis-title"),s.plotL>12&&s.lanes.forEach(t=>{const e=h||i.globals.colors[t.i]||i.globals.colors[0]||"#008FFB";u(t.name,s.plotL-8,t.cy,"end",e,12,600,"apexcharts-unit-lane-label")}),t.add(r)}else{if(s.yTicks.forEach(t=>{const e=s.plotY(t);s.gridlines&&p(s.plotL,e,s.plotR,e,n);const i=s.yFormatter?String(s.yFormatter(t)):this._formatTick(t);u(i,s.plotL-8,e,"end",c,11,400,"apexcharts-unit-tick")}),s.xTicks.forEach(t=>{const e=s.plotX(t);s.gridlines&&p(e,s.plotT,e,s.plotB,n);const i=s.xFormatter?String(s.xFormatter(t)):this._formatTick(t);u(i,e,s.plotB+14,"middle",c,11,400,"apexcharts-unit-tick")}),p(s.plotL,s.plotB,s.plotR,s.plotB,o),p(s.plotL,s.plotT,s.plotL,s.plotB,o),s.xTitle&&u(String(s.xTitle),(s.plotL+s.plotR)/2,s.plotB+32,"middle",c,12,600,"apexcharts-unit-axis-title"),s.yTitle){const t=b.createElementNS(a,"text");t.setAttribute("class","apexcharts-unit-axis-title");const e=14,n=(s.plotT+s.plotB)/2;t.setAttribute("x",String(e)),t.setAttribute("y",String(n)),t.setAttribute("text-anchor","middle"),t.setAttribute("font-size","12px"),t.setAttribute("font-family",i.config.chart.fontFamily||"inherit"),t.setAttribute("font-weight","600"),t.setAttribute("fill",c),t.setAttribute("transform",`rotate(-90 ${e} ${n})`),t.textContent=String(s.yTitle),r.node.appendChild(t)}t.add(r)}}_formatTick(t){if(!isFinite(t))return"";const e=Math.abs(t);return e>=1e6?+(t/1e6).toFixed(1)+"M":e>=1e4?+(t/1e3).toFixed(1)+"k":Number.isInteger(t)?String(t):String(+t.toFixed(2))}_largestRemainder(t,e){const i=t.reduce((t,e)=>t+e,0);if(i<=0||e<=0)return t.map(()=>0);const s=t.map(t=>t/i*e),a=s.map(t=>Math.floor(t)),r=a.reduce((t,e)=>t+e,0),n=Math.max(0,e-r),o=s.map((t,e)=>({i:e,frac:t-Math.floor(t)})).sort((t,e)=>e.frac-t.frac),l=a.slice();for(let t=0;t<n&&t<o.length;t++)l[o[t].i]++;return l}_spiral(t,e,i,s,a){const r=[];for(let n=0;n<i;n++){const i=a+n,o=s*Math.sqrt(i+.5),l=i*Xr;r.push({x:t+o*Math.cos(l),y:e+o*Math.sin(l)})}return r}_fixedRadius(t){return"image"===t.shape&&t.image?Math.max(t.image.width||20,t.image.height||20)/2:this._bubbleActive(t)&&"number"==typeof t.sizeByValue.maxRadius?t.sizeByValue.maxRadius>0?t.sizeByValue.maxRadius:null:"number"==typeof t.size&&t.size>0?t.size:null}_bubbleActive(t){const e=t.sizeByValue;return!(!e||!e.enabled||"image"===t.shape||"square"===t.shape)}_unitValueOf(t){if("number"==typeof t)return t;if(t&&"object"==typeof t){const e=null!=t.value?t.value:t.y;return"number"==typeof e?e:null}return null}_radiusForValue(t,e){if(null==t||!isFinite(t))return e.minR;const i=e.max>e.min?(t-e.min)/(e.max-e.min):1,s=Math.max(0,Math.min(1,i));if("linear"===e.scale)return e.minR+s*(e.maxR-e.minR);const a=e.minR*e.minR,r=e.maxR*e.maxR;return Math.sqrt(a+s*(r-a))}_bubbleStats(t,e,i){if(!this._bubbleActive(e))return null;let s=1/0,a=-1/0;if(t.forEach(t=>{t&&t.forEach(t=>{const e=this._unitValueOf(t);null!=e&&isFinite(e)&&(e<s&&(s=e),e>a&&(a=e))})}),s===1/0||a<s)return null;const r=e.sizeByValue,n=i,o=Math.max(1,Math.min(n,"number"==typeof r.minRadius?r.minRadius:.35*n));return{min:s,max:a,minR:o,maxR:n,scale:"linear"===r.scale?"linear":"area"}}_resolveStep(t,e,i){const s=t.spacing>0?t.spacing:1,a=this._fixedRadius(t);return a?2*a*s:e/(Math.sqrt(Math.max(1,i))+.5)}_dotRadiusFromStep(t,e){const i=e.spacing>0?e.spacing:1,s=this._fixedRadius(e);return s||Math.max(1,t/(2*i))}_isCorner(t){return"square"===t.shape||"image"===t.shape}_halfExtent(t,e){if("image"===t.shape&&t.image)return{hx:(t.image.width||20)/2,hy:(t.image.height||20)/2};const i=null!=e?e:this._lastDotR;return{hx:i,hy:i}}_place(t,e,i,s){const a=e;2===a.pk?t.setAttribute("transform","translate("+(i-a.ox)+","+(s-a.oy)+a.tail):1===a.pk?(t.setAttribute("x",String(i-a.hx)),t.setAttribute("y",String(s-a.hy))):(t.setAttribute("cx",String(i)),t.setAttribute("cy",String(s)))}_baseSpec(t,e){const i=null!=e?e:this._lastDotR;if(!this._isCorner(t))return{pk:0,r:i};const{hx:s,hy:a}=this._halfExtent(t,i);return{pk:1,hx:s,hy:a,r:i}}_resolveMark(t){if(null==t)return null;if("object"==typeof t)return ms(t);if("string"!=typeof t||!t)return null;const e=t.trim();if("M"===e[0]||"m"===e[0])return ms(e);const i=(s=e)&&xs()[s]||null;var s;return i||(this._markWarned||(this._markWarned=new Set),this._markWarned.has(e)||this._markWarned.add(e),null)}_glyphSpec(t,e,i){const s=Math.round(10*e)/10,a=t.name+"|"+t.path.length+"|"+s,r=this._specCache.get(a);if(r)return r;const n=t.viewBox||[0,0,100,100],o=2*s*(1-Math.max(0,Math.min(.9,i.padding||0)))*("number"==typeof i.scale&&i.scale>0?i.scale:1),l="width"===i.fit?o/n[2]:"height"===i.fit?o/n[3]:o/Math.max(n[2],n[3]),h=Object.freeze({pk:2,mark:t,d:t.path,fillRule:t.fillRule,s:l,ox:(n[0]+n[2]/2)*l,oy:(n[1]+n[3]/2)*l,tail:") scale("+l+")",r:s});return this._specCache.set(a,h),h}_markSpecFor(t,e,i,s){if("pictogram"!==t.shape)return this._baseSpec(t,s);const a=t.pictogram||{},r=e&&"object"==typeof e?e.mark:void 0,n=Array.isArray(a.mark)?a.mark[i%a.mark.length]:a.mark,h=this._resolveMark(null!=r?r:n);return h?this._glyphSpec(h,s,a):this._baseSpec(l(o({},t),{shape:"square"===a.fallback?"square":"circle"}),s)}_drawDot(t,e,i,s,a,r,n){const o=this.w,l=o.config.stroke.show?o.config.stroke.width:0,h=Array.isArray(o.globals.stroke.colors)&&o.globals.stroke.colors[a]||"none",c="number"==typeof o.config.fill.opacity?o.config.fill.opacity:1;let d;if(n&&2===n.pk)d=o.dom.Paper.path(n.d),d.node.setAttribute("fill",s),"evenodd"===n.fillRule&&d.node.setAttribute("fill-rule","evenodd"),c<1&&d.node.setAttribute("fill-opacity",String(c)),d.node.setAttribute("data:r",String(n.r));else if("image"===e.shape&&e.image&&e.image.src){const t=e.image.width||20,i=e.image.height||20;d=o.dom.Paper.image(e.image.src),d.node.setAttribute("width",String(t)),d.node.setAttribute("height",String(i)),d.node.setAttribute("preserveAspectRatio","xMidYMid meet"),e.image.tint&&d.node.setAttribute("filter",`url(#${this._tintFilter(s)})`)}else if("square"===e.shape){const a=2*i;d=t.drawRect(0,0,a,a,e.borderRadius||0,s,1,l,h),d.node.setAttribute("fill",s),c<1&&d.node.setAttribute("fill-opacity",String(c))}else d=t.drawCircle(i,{fill:s,"stroke-width":l,stroke:h}),d.node.setAttribute("fill",s),c<1&&d.node.setAttribute("fill-opacity",String(c));return d.node.classList.add("apexcharts-unit-area"),d.node.setAttribute("i",String(a)),d.node.setAttribute("j",String(r)),d}_tintFilter(t){const e=this.w,i="http://www.w3.org/2000/svg",s=String(t).replace(/[^a-zA-Z0-9]/g,""),a=`apexcharts-unit-tint-${e.globals.chartID}-${s}`,r=e.dom.Paper.node;if(r.querySelector(`#${a}`))return a;let n=r.querySelector("defs");n||(n=b.createElementNS(i,"defs"),r.insertBefore(n,r.firstChild));const o=b.createElementNS(i,"filter");o.setAttribute("id",a),o.setAttribute("x","0%"),o.setAttribute("y","0%"),o.setAttribute("width","100%"),o.setAttribute("height","100%");const l=b.createElementNS(i,"feFlood");l.setAttribute("flood-color",t),l.setAttribute("result","flood");const h=b.createElementNS(i,"feComposite");return h.setAttribute("in","flood"),h.setAttribute("in2","SourceAlpha"),h.setAttribute("operator","in"),o.appendChild(l),o.appendChild(h),n.appendChild(o),a}_placeDot(t,e,i,s,a){this._place(t,a||this._baseSpec(e),i,s)}_rgb(t){if("string"!=typeof t)return null;let e=t.trim();if("#"===e[0]){4===e.length&&(e="#"+e[1]+e[1]+e[2]+e[2]+e[3]+e[3]);const t=parseInt(e.slice(1,7),16);return isNaN(t)?null:[t>>16&255,t>>8&255,255&t]}const i=e.match(/rgba?\(([^)]+)\)/);if(i){const t=i[1].split(",").map(t=>parseFloat(t));if(t.length>=3&&t.every(t=>!isNaN(t)))return[t[0],t[1],t[2]]}return null}_shouldAnimate(){const t=this.w,e=t.config.chart.animations;return!!d.isBrowser()&&(!(!e||!1===e.enabled)&&(!1!==t.globals.shouldAnimate&&(!(t.globals.resized&&!t.globals.dataChanged)&&(!e.respectReducedMotion||!wt()))))}_seedSprings(t,e,i){const[s,a]=Nr(e.spring,i),r=this.ctx?this.ctx._unitSprings:null,n=new Map;for(let e=0;e<t.length;e++){const i=t[e],o=r&&!i.isEnter&&null!=i.key?r.get(i.key):null,l=o?o.x:Ns(i.cx0,s,a),h=o?o.y:Ns(i.cy0,s,a);o&&(l.stiffness=s,h.stiffness=s,l.damping=a,h.damping=a,i.cx0=l.value,i.cy0=h.value,this._place(i.node,i.spec,i.cx0,i.cy0),0===l.velocity&&0===h.velocity||(i.delay=0)),i.sx=l,i.sy=h,null!=i.key&&n.set(i.key,{x:l,y:h})}this.ctx&&(this.ctx._unitSprings=n)}_runGather(t){const e=this.w,i=e.config.plotOptions.unit,s=Math.max(1,e.config.chart.animations.speed||800),a=Math.min(.6*s,450),r=t.length;for(let e=0;e<r;e++)t[e].delay=r>1?e/(r-1)*a:0;const n=i.gather||{},o=n.motion||"auto";"spring"===o||"auto"===o&&(!n.easing||"outCubic"===n.easing)?this._seedSprings(t,n,s):this.ctx&&(this.ctx._unitSprings=null);for(let e=0;e<r;e++){const i=t[e];0===i.spec.pk&&null!=i.r0&&null!=i.r1&&i.r0!==i.r1&&i.node.setAttribute("r",String(i.r0))}for(let e=0;e<r;e++){const i=t[e];i.fill0&&i.fill1&&i.fill0!==i.fill1&&(i._c0=this._rgb(i.fill0),i._c1=this._rgb(i.fill1))}const l="outBack"===n.easing?(h="number"==typeof n.overshoot?n.overshoot:1.70158,t=>1+(h+1)*Math.pow(t-1,3)+h*Math.pow(t-1,2)):"inOutCubic"===n.easing?Br:zr;var h;null!=this.w.globals.unitGatherRAF&&(b.cancelAnimationFrame(this.w.globals.unitGatherRAF),this.w.globals.unitGatherRAF=null);const c=performance.now();let d=c;const p=e=>{if(this.w.globals.isDestroyed)return this.w.globals.unitGatherRAF=null,void(this.w.globals.animationEnded=!0);const i=Math.min(.25,Math.max(0,(e-d)/1e3));d=e;let a=!0;for(let n=0;n<r;n++){const r=t[n],o=e-c-r.delay,h=Math.max(0,Math.min(1,o/s)),d=zr(h);let p,u;if(r.sx&&r.sy){o>=0&&!r.released&&(Os(r.sx,r.x),Os(r.sy,r.y),r.released=!0);const t=Ys(r.sx,i),e=Ys(r.sy,i);r.released&&t&&e||(a=!1),p=r.sx.value,u=r.sy.value}else{const t=l(h);p=r.cx0+(r.x-r.cx0)*t,u=r.cy0+(r.y-r.cy0)*t}if(this._place(r.node,r.spec,p,u),r.isEnter&&(r.node.style.opacity=String(Math.min(1,2.5*h))),r._c0&&r._c1){const t=Math.round(r._c0[0]+(r._c1[0]-r._c0[0])*d),e=Math.round(r._c0[1]+(r._c1[1]-r._c0[1])*d),i=Math.round(r._c0[2]+(r._c1[2]-r._c0[2])*d);r.node.setAttribute("fill",`rgb(${t},${e},${i})`)}0===r.spec.pk&&null!=r.r0&&null!=r.r1&&r.r0!==r.r1&&r.node.setAttribute("r",String(r.r0+(r.r1-r.r0)*d)),h<1&&(a=!1)}if(a){for(let e=0;e<r;e++){const i=t[e];i.node.style.opacity="",i._c1&&i.fill1&&i.node.setAttribute("fill",i.fill1),0===i.spec.pk&&null!=i.r0&&null!=i.r1&&i.r0!==i.r1&&i.node.setAttribute("r",String(i.r1))}this.w.globals.unitGatherRAF=null,this.w.globals.animationEnded=!0}else this.w.globals.unitGatherRAF=b.requestAnimationFrame(p)};this.w.globals.unitGatherRAF=b.requestAnimationFrame(p)}_collectExits(t,e,i){const s=Math.max(0,i.maxUnits||5e3),a=[];for(const[i,r]of t)if(!e.has(i)&&(a.push(r),a.length>=s))break;return a}_runExits(t,e,i){const s=this.w,a=new Dt(s,this.ctx),r=this._lastDotR,n=s.layout.gridWidth/2,o=s.layout.gridHeight/2,l="grid"===i.layout||"scatter"===i.layout||"arc"===i.layout||"custom"===i.layout?0:.35,h=[];if(e.forEach(e=>{const s=null!=e.r?e.r:r,n=e.spec||this._baseSpec(i,s),o=this._drawDot(a,i,s,e.fill,0,0,n);o.node.classList.add("apexcharts-unit-exit"),this._place(o.node,n,e.x,e.y),t.add(o),h.push({node:o.node,x0:e.x,y0:e.y,spec:n})}),!this._shouldAnimate())return void h.forEach(t=>t.node.remove());const c=Math.max(1,s.config.chart.animations.speed||800);null!=this.w.globals.unitExitRAF&&(b.cancelAnimationFrame(this.w.globals.unitExitRAF),this.w.globals.unitExitRAF=null);const d=performance.now(),p=e=>{if(this.w.globals.isDestroyed)return void(this.w.globals.unitExitRAF=null);const i=Math.max(0,Math.min(1,(e-d)/c)),s=zr(i);for(let t=0;t<h.length;t++){const e=h[t];if(l){const t=e.x0+(n-e.x0)*s*l,i=e.y0+(o-e.y0)*s*l;this._place(e.node,e.spec,t,i)}e.node.style.opacity=String(1-s)}i<1?this.w.globals.unitExitRAF=b.requestAnimationFrame(p):(this.w.globals.unitExitRAF=null,t.node&&t.node.remove())};this.w.globals.unitExitRAF=b.requestAnimationFrame(p)}_outerLabelsOn(t){const e=t.clusterLabels;return!!("custom"===t.layout&&e&&!1!==e.show&&e.external&&e.external.show)}_outerLabelLines(t,e,i,s){const a=this.w,r=a.seriesData.seriesNames[t]||`series-${t+1}`,n=i>0?e/i*100:0,o=s.clusterLabels,l="function"==typeof o.formatter?o.formatter(r,{seriesIndex:t,value:e,percent:n,w:a}):`${r}\n${n.toFixed(1)}%`;return String(l).split("\n")}_outerLabelGutter(t,e){const i=this.w,s=e.clusterLabels,a=s.external.connector||{},r=t.reduce((t,e)=>t+e,0),n=[];if(t.forEach((t,i)=>{t>0&&n.push(...this._outerLabelLines(i,t,r,e))}),!n.length)return 0;const o=function(t,e,i={}){const s=new Dt(t),a=i.fontSize||"12px",r=parseFloat(a)||12;let n=0;return e.forEach(t=>{if(null==t||""===t)return;const e=`${t}`,o=s.getTextRects(e,a,i.fontFamily,"").width;n=Math.max(n,o>0?o:e.length*r*.58)}),n}(i,n,{fontSize:s.fontSize,fontFamily:s.fontFamily||i.config.chart.fontFamily}),l=o+(null!=a.gap?a.gap:8)+(null!=a.length?a.length:22)+8+Math.abs(parseFloat(s.external.offsetX)||0);return Math.min(l,.25*i.layout.gridWidth)}_drawOuterLabels(t,e,i,s,a,r){const n=this.w;if(!d.isBrowser())return;const o=a.clusterLabels,l=o.external,h=l.connector||{},c=null!=h.gap?h.gap:8,p=null!=h.length?h.length:22,u=parseFloat(l.offsetX)||0,g=parseFloat(l.offsetY)||0,f=n.layout.gridWidth,x=n.layout.gridHeight,m=this._lastDotR,b=e.filter(t=>t.dots.length>0);if(!b.length)return;let y=0,w=0;if(b.length>1){const t=b.map(t=>t.cx),e=b.map(t=>t.cy);y=Math.max(...t)-Math.min(...t),w=Math.max(...e)-Math.min(...e)}const v=y>w,A=parseFloat(o.fontSize)||13,S=Math.round(1.35*A),C=[];if(b.slice().sort((t,e)=>t.cy-e.cy).forEach((t,e)=>{const r=this._outerLabelLines(t.i,i[t.i],s,a);if(!r.some(t=>""!==t))return;const n=v?t.cx>=f/2?"right":"left":e%2==0?"right":"left",o="right"===n?1:-1;let l=t.dots[0],h=-1/0;t.dots.forEach(e=>{const i=o*e.x-.75*Math.abs(e.y-t.cy);i>h&&(h=i,l=e)});const d={x:l.x+o*(l.r||m),y:l.y},x={x:d.x+o*c,y:d.y};C.push({i:t.i,lines:r,anchor:d,elbow:x,labelX:x.x+o*p+u,idealY:d.y+g,labelY:d.y+g,side:n})}),!C.length)return;const k=C.reduce((t,e)=>Math.max(t,e.lines.length),1)*S,_=k/2;["left","right"].forEach(t=>{yr(C.filter(e=>e.side===t),k+2,x-_,_)});const M=new Dt(n,this.ctx).group({class:"apexcharts-unit-outer-labels"});if(r){const t=Math.max(1,n.config.chart.animations.speed||800);M.node.classList.add("apexcharts-unit-label-delay"),M.node.style.animationDelay=Math.min(.45*t,600)/1e3+"s"}C.forEach(t=>{const e=n.globals.colors[t.i]||n.globals.colors[0]||"#008FFB";M.add(br(n,{lines:t.lines,lineHeight:S,anchor:t.anchor,elbow:t.elbow,labelX:t.labelX,labelY:t.labelY,side:t.side,connector:{show:!1!==h.show,width:null!=h.width?h.width:1.5,color:h.color||e},style:{fontSize:o.fontSize,fontFamily:o.fontFamily||n.config.chart.fontFamily,fontWeight:o.fontWeight},foreColor:o.color||n.config.chart.foreColor,groupClass:"apexcharts-unit-outer-label-group",textClass:"apexcharts-unit-outer-label",connectorClass:"apexcharts-unit-label-connector"}))}),t.add(M)}_drawClusterLabel(t,e,i,s,a,r){const n=this.w;if(!d.isBrowser())return;const o="http://www.w3.org/2000/svg",l=n.seriesData.seriesNames[e.i]||`series-${e.i+1}`,h=s>0?i/s*100:0,c=a.clusterLabels,p=parseFloat(c.fontSize)||13;let u;u="function"==typeof c.formatter?c.formatter(l,{seriesIndex:e.i,value:i,percent:h,w:n}):`${l} (${h.toFixed(1)}%)`;const g="string"==typeof u?u:String(u),f=b.createElementNS(o,"text");f.setAttribute("class","apexcharts-unit-label"),f.setAttribute("text-anchor","middle"),f.setAttribute("font-size",`${p}px`),f.setAttribute("font-family",c.fontFamily||n.config.chart.fontFamily||"inherit"),f.setAttribute("font-weight",String(c.fontWeight||600)),f.setAttribute("fill",c.color||r);const x="bottom"===c.position,m=e.outerR+.6*p+3+(c.offsetY||0),y=g.length*p*.55;if(!x&&!e.flat&&!1!==c.curved&&y<=Math.PI*m*.95){const i=e.cy,s=`M ${e.cx-m} ${i} A ${m} ${m} 0 0 1 ${e.cx+m} ${i}`,a=`apexcharts-unit-label-${n.globals.chartID}-${e.i}`,r=b.createElementNS(o,"path");r.setAttribute("id",a),r.setAttribute("d",s),r.setAttribute("fill","none"),r.setAttribute("stroke","none");const l=b.createElementNS(o,"textPath");l.setAttribute("href",`#${a}`),l.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",`#${a}`),l.setAttribute("startOffset","50%"),l.textContent=g,f.appendChild(l),t.node.appendChild(r)}else{f.setAttribute("x",String(e.cx));const t=x?e.cy+e.outerR+p+6+(c.offsetY||0):e.cy-e.outerR-6-(c.offsetY||0);f.setAttribute("y",String(t)),f.textContent=g}t.node.appendChild(f)}},sunburst:class{constructor(t,e){this.ctx=e,this.w=t;const i=t.config;this.cfg=i.plotOptions.sunburst,this.strokeWidth=i.stroke.show?i.stroke.width:0,this.strokeColor=Array.isArray(i.stroke.colors)?i.stroke.colors[0]:i.stroke.colors||"#fff",this.startAngle=this.cfg.startAngle,this.endAngle=this.cfg.endAngle,this.maxDepth=0,this.centerX=0,this.centerY=0,this.maxRadius=0,this.total=1,this._focusMaxDepth=0,this._focus=null,this._zoomGen=0,this._roots=[],this._nodesAll=[],this._innerR=()=>0,this._outerR=()=>0,this._tooltipEl=null,this._lblSeq=0,this._morphLeafIndex=0,this._graphics=null,this._ringsG=null,this._labelsG=null}draw(t){const e=this.w,i=new Dt(this.w);this._graphics=i;const s=i.group({class:"apexcharts-sunburst"});if(e.globals.noData||!t||!t.length)return s;const a=e.layout.gridWidth,r=e.layout.gridHeight;if(this.centerX=a/2+(this.cfg.offsetX||0),this.centerY=r/2+(this.cfg.offsetY||0),this.maxRadius=Math.min(a,r)/2.05-this.strokeWidth-(e.config.chart.sparkline.enabled?0:e.config.chart.dropShadow.blur),this.maxRadius<5)return s;if(this._roots=this._buildHierarchy(),!this._roots.length)return s;this._roots.forEach(t=>this._fillValues(t)),this._validateStrict(),this._nodesAll=[];const n=e.globals.colors||[];this._roots.forEach((t,e)=>{this._colorPass(t,t.color||n[e%n.length]||"#008FFB")}),this.total=this._roots.reduce((t,e)=>t+Math.max(0,e.value),0)||1,this._ringsG=i.group({class:"apexcharts-sunburst-rings"}),this._labelsG=i.group({class:"apexcharts-sunburst-labels"}),s.add(this._ringsG),s.add(this._labelsG),this._focus=null,this._relayout(this._focus);const o=e.config.chart.animations;let l="none";return o.enabled&&(e.globals.dataChanged?o.dynamicAnimation.enabled&&(l="update"):e.globals.resized||(l="intro")),this._applyLayout(l),this._renderBreadcrumb(),s}_buildHierarchy(){return function(t,e={}){const i=t.config.series,s=i&&i[0],a=s&&Array.isArray(s.data)?s.data:i;return Array.isArray(a)?a.map((i,s)=>Ci(t,i,s,null,"",null,e)):[]}(this.w)}_fillValues(t){_i(t)}_validateStrict(){if("strict"!==this.cfg.partition)return;let t=!1;const e=i=>{if(i.children&&i.children.length){const s=i.children.reduce((t,e)=>t+Math.max(0,e.value||0),0);!t&&null!=i.value&&Math.abs(s-i.value)>.5&&(t=!0),i.children.forEach(e)}};this._roots.forEach(e)}_colorPass(t,e){t._color=t.color||e,this._nodesAll.push(t),t.children&&t.children.forEach(e=>this._colorPass(e,e.color||this._lighten(t._color,this.cfg.tint)))}_relayout(t){if(this._nodesAll.forEach(t=>{t._show=!1}),this._focusMaxDepth=0,t)this._placeVis(t,0,this.startAngle,this.endAngle,t._parent);else{const t=this._roots.reduce((t,e)=>t+Math.max(0,e.value),0)||1;let e=this.startAngle;this._roots.forEach(i=>{const s=(this.endAngle-this.startAngle)*Math.max(0,i.value)/t;this._placeVis(i,0,e,e+s,null),e+=s})}const e=this._parseSize(this.cfg.innerSize,this.maxRadius),i=this._focusMaxDepth+1,s=(this.maxRadius-e)/i,a=i>1?1:0;this._innerR=t=>e+t*s+(t>0?a/2:0),this._outerR=t=>e+(t+1)*s-a/2,this._nodesAll.forEach(t=>{t._show&&(t._iR=this._innerR(t._vDepth),t._oR=t._leaf&&"extend"===this.cfg.leaf&&t._vDepth<this._focusMaxDepth?this.maxRadius:this._outerR(t._vDepth))})}_placeVis(t,e,i,s,a){if(t._show=!0,t._vDepth=e,t._a0=i,t._a1=s,t._parent=a,t._leaf=!(t.children&&t.children.length),e>this._focusMaxDepth&&(this._focusMaxDepth=e),!t._leaf){const a=t.children.reduce((t,e)=>t+Math.max(0,e.value),0)||1;let r=i;t.children.forEach(n=>{const o=(s-i)*Math.max(0,n.value)/a;this._placeVis(n,e+1,r,r+o,t),r+=o})}}_applyLayout(t){var e;const i=this.w.config.chart.animations,s=i.enabled?"none"===t?0:"update"===t?i.dynamicAnimation.speed||350:i.speed||500:0,a=++this._zoomGen,r=null==(e=this.ctx)?void 0:e.morphTypeChange,n=!!r&&"function"==typeof r.isActive&&r.isActive()&&"function"==typeof r.getInitialPathAt,o=n?r.getSpeed():0;this._morphLeafIndex=0;const l="update"===t?this.ctx._sunburstPrevGeoms:null;this._nodesAll.forEach(e=>{if(e._show){const i={a0:e._a0,a1:e._a1,iR:e._iR,oR:e._oR};e._el||(e._el=this._createArcEl(e));const r=n?this._morphSourceFor(e):null;if(r&&o>0)this._morphArcFrom(e,r,i,o,a);else if(("intro"===t||n)&&s>0)this._sweepArc(e,i,n?o:s,a);else{let t,r=!1;if(e._cur)t=e._cur;else if(l&&l.get(e._key))t=l.get(e._key);else{const e=(i.a0+i.a1)/2;t={a0:e,a1:e,iR:i.iR,oR:i.iR},r=!0}this._animateArc(e,t,i,s,!1,r,a)}}else if(e._el&&e._cur){const t=(e._cur.a0+e._cur.a1)/2,i={a0:t,a1:t,iR:e._cur.iR,oR:e._cur.iR};this._animateArc(e,e._cur,i,s,!0,!1,a)}});const h=new Map;this._nodesAll.forEach(t=>{t._show&&h.set(t._key,{a0:t._a0,a1:t._a1,iR:t._iR,oR:t._oR})}),this.ctx._sunburstPrevGeoms=h,this._renderLabels(s)}_morphSourceFor(t){const e=this.ctx,i=e&&e.morphTypeChange;return i?"function"==typeof i.hasKeyedMarks&&i.hasKeyedMarks()&&"function"==typeof i.getInitialPathForKey?i.getInitialPathForKey(Mi(t._key)):t.children&&t.children.length?null:i.getInitialPathAt(this._morphLeafIndex++):null}_morphArcFrom(t,e,i,s,a){const r=t._el,n=this._arcPath(i.iR,i.oR,i.a0,i.a1,this.cfg.borderRadius);r.node.style.display="",r.attr({d:e,opacity:1}),t._cur=i,this._zoomGen===a&&new Ct(this.w,this.ctx).morphSVG(r,0,null,t._color,e,n,s,0)}_sweepArc(t,e,i,s){const a=t._el,r=this.cfg.borderRadius,n=this.startAngle,o=this.endAngle;a.node.style.display="",a.attr({d:"",opacity:1}),a.animate(i).during(i=>{if(this._zoomGen!==s)return;const l=n+(o-n)*i;if(l<=e.a0+.01)return void a.attr({d:""});const h=Math.min(e.a1,l);a.attr({d:this._arcPath(e.iR,e.oR,e.a0,h,r)}),t._cur={a0:e.a0,a1:h,iR:e.iR,oR:e.oR}}).after(()=>{this._zoomGen===s&&(t._cur=e)})}_createArcEl(t){const e=this._graphics.drawPath({d:"",fill:t._color,stroke:this.strokeColor,strokeWidth:this.strokeWidth,fillOpacity:1,classes:"apexcharts-sunburst-arc"}),i=e.node;return i.setAttribute("data:name",t.name),i.setAttribute("data:value",String(t.value)),i.setAttribute("data:key",Mi(t._key)),i.setAttribute("data:leaf",String(!(t.children&&t.children.length))),this._attachTooltip(i,t),d.isBrowser()&&(i.addEventListener("click",()=>this._zoomTo(t)),i.style.cursor="pointer"),this._ringsG.add(e),e}_animateArc(t,e,i,s,a,r,n){const o=t._el,l=this.cfg.borderRadius;if(o.attr({fill:t._color}),0===s)return o.attr({d:this._arcPath(i.iR,i.oR,i.a0,i.a1,l),opacity:a?0:1}),o.node.style.display=a?"none":"",void(t._cur=a?null:i);o.node.style.display="";const h=a?Number(o.attr("opacity"))||1:r?0:1,c=a?0:1;o.attr({opacity:h}),o.animate(s).during(s=>{if(this._zoomGen!==n)return;const a=$r(e.a0,i.a0,s),r=$r(e.a1,i.a1,s),d=$r(e.iR,i.iR,s),p=$r(e.oR,i.oR,s);o.attr({d:this._arcPath(d,p,a,r,l),opacity:$r(h,c,s)}),t._cur={a0:a,a1:r,iR:d,oR:p}}).after(()=>{this._zoomGen===n&&(a?(o.node.style.display="none",t._cur=null):t._cur=i)})}_renderLabels(t){const e=this._labelsG;for(;e.node.firstChild;)e.node.removeChild(e.node.firstChild);this.cfg.dataLabels.show&&(this._nodesAll.forEach(t=>{t._show&&(t._a1-t._a0<this.cfg.dataLabels.minAngleToShow||this._renderCurvedLabel(t))}),t>0?(e.attr({opacity:0}),e.animate(250,t).attr({opacity:1})):e.attr({opacity:1}))}_renderCurvedLabel(t){if(!d.isBrowser())return;const e=this.cfg.dataLabels.style,i=this.w,s=(t._iR+t._oR)/2,a=(t._a0+t._a1)/2,r=a>90&&a<270,n=Math.min(s>0?4/s*Or:0,(t._a1-t._a0)/2),o=r?t._a1-n:t._a0+n,l=r?t._a0+n:t._a1-n,h=this._ptAt(s,o),c=this._ptAt(s,l),p=Math.abs(l-o)>180?1:0,u=r?0:1,g=`apx-sb-lbl-${i.globals.cuid}-${this._lblSeq++}`,f=b.createElementNS(Wr,"path");f.setAttribute("id",g),f.setAttribute("d",`M ${h.x} ${h.y} A ${s} ${s} 0 ${p} ${u} ${c.x} ${c.y}`),f.setAttribute("fill","none"),f.setAttribute("stroke","none");const x=e.colors,m=(Array.isArray(x)?x[0]:x)||"#fff",y=b.createElementNS(Wr,"text");y.setAttribute("font-size",e.fontSize||"12px"),e.fontFamily&&y.setAttribute("font-family",e.fontFamily),y.setAttribute("font-weight",String(e.fontWeight||400)),y.setAttribute("fill",m),y.setAttribute("dominant-baseline","central"),y.style.pointerEvents="none";const w=b.createElementNS(Wr,"textPath");w.setAttribute("href","#"+g),w.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href","#"+g),w.setAttribute("startOffset","50%"),w.setAttribute("text-anchor","middle"),w.textContent=this._truncate(t.name,s,t._a1-t._a0,e.fontSize),y.appendChild(w),this._labelsG.node.appendChild(f),this._labelsG.node.appendChild(y)}_truncate(t,e,i,s){const a=e*i*Yr-8,r=.58*(parseFloat(s)||12),n=Math.floor(a/r);return n>=t.length?t:n<=1?"":t.slice(0,Math.max(1,n-1))+"\u2026"}_zoomTo(t){if(!1===this.cfg.zoomOnClick)return;const e=t===this._focus?t._parent||null:t;e!==this._focus&&(this._focus=!e||e.children&&e.children.length?e:e._parent||null,this._relayout(this._focus),this._applyLayout("zoom"),this._renderBreadcrumb())}_focusChain(){const t=[];let e=this._focus;for(;e;)t.unshift(e),e=e._parent;return t}_renderBreadcrumb(){if(!d.isBrowser())return;const t=this.w.dom.elWrap;if(!t)return;const e=t.querySelector(".apexcharts-breadcrumb");if(e&&e.parentNode&&e.parentNode.removeChild(e),!this._focus)return;const i=b.createElementNS(Hr,"nav");i.setAttribute("class","apexcharts-breadcrumb"),i.setAttribute("aria-label","Sunburst breadcrumb"),i.style.position="absolute",i.style.top="0px",i.style.left="0px";const s=[{name:"All",node:null}].concat(this._focusChain().map(t=>({name:t.name,node:t})));s.forEach((t,e)=>{if(e>0){const t=b.createElementNS(Hr,"span");t.setAttribute("class","apexcharts-breadcrumb-separator"),t.textContent=" / ",i.appendChild(t)}if(e===s.length-1){const e=b.createElementNS(Hr,"span");e.setAttribute("class","apexcharts-breadcrumb-item apexcharts-breadcrumb-current"),e.textContent=t.name,i.appendChild(e)}else{const s=b.createElementNS(Hr,"button");if(s.setAttribute("type","button"),s.setAttribute("class","apexcharts-breadcrumb-item"),0===e){const t=b.createElementNS(Hr,"span");t.setAttribute("class","apexcharts-breadcrumb-arrow"),t.textContent="\u2190",s.appendChild(t)}const a=b.createElementNS(Hr,"span");a.setAttribute("class","apexcharts-breadcrumb-label"),a.textContent=t.name,s.appendChild(a),s.addEventListener("click",()=>{this._focus=t.node,this._relayout(this._focus),this._applyLayout("zoom"),this._renderBreadcrumb()}),i.appendChild(s)}}),t.appendChild(i),this._avoidChromeOverlap(i)}_avoidChromeOverlap(t){Qe(this.w,t)}_ptAt(t,e){return{x:this.centerX+t*Math.cos((e-90)*Yr),y:this.centerY+t*Math.sin((e-90)*Yr)}}_arcPath(t,e,i,s,a){if(e<=t+.01)return"";let r=s-i;const n=this.cfg.spacing;if(n>0&&r>0&&e>0){const t=n/e*Or,a=Math.min(t/2,Math.max(0,r/2-.25));r=(s-=a)-(i+=a)}if(r<=0)return"";const o=r*Yr,l=this.centerX,h=this.centerY;let c=a;return c=Math.min(c,o*t/2,o*e/2,(e-t)/2),c>.5?kr({cx:l,cy:h,rIn:t,rOut:e,a0:i,a1:s,r:c,spanDeg:r}):_r({cx:l,cy:h,rIn:t,rOut:e,a0:i,a1:s,spanDeg:r})}_tip(){return this._tooltipEl||(this._tooltipEl=this.w.dom.baseEl.querySelector(".apexcharts-tooltip")),this._tooltipEl}_attachTooltip(t,e){this.w.config.tooltip.enabled&&d.isBrowser()&&(t.addEventListener("mouseenter",t=>this._showTooltip(t,e)),t.addEventListener("mousemove",t=>this._positionTooltip(t)),t.addEventListener("mouseleave",()=>this._hideTooltip()))}_showTooltip(t,e){const i=this._tip();if(!i)return;const s=this.w,a=(e.value/this.total*100).toFixed(1),r=e._parent?e._parent.value:this.total,n=r>0?(e.value/r*100).toFixed(1):a,o=s.config.tooltip.fillSeriesColor?`background-color:${e._color};`:"";i.innerHTML=`<div class="apexcharts-tooltip-series-group apexcharts-active" style="display:flex;${o}"><span class="apexcharts-tooltip-marker" style="background-color:${e._color}"></span><div class="apexcharts-tooltip-text"><div class="apexcharts-tooltip-y-group"><span class="apexcharts-tooltip-text-y-label">${e.name}: </span><span class="apexcharts-tooltip-text-y-value">${e.value} (${n}% of parent, ${a}% of total)</span></div></div></div>`,i.classList.add("apexcharts-active"),i.style.opacity="1",this._positionTooltip(t)}_positionTooltip(t){const e=this._tip();if(!e)return;const i=this.w.dom.elWrap.getBoundingClientRect(),s=e.offsetWidth,a=e.offsetHeight;let r=t.clientX-i.left+12;r+s>i.width&&(r=t.clientX-i.left-s-12),r=Math.max(0,Math.min(r,i.width-s));let n=t.clientY-i.top+12;n+a>i.height&&(n=t.clientY-i.top-a-12),n=Math.max(0,Math.min(n,i.height-a)),e.style.left=r+"px",e.style.top=n+"px"}_hideTooltip(){const t=this._tip();t&&(t.classList.remove("apexcharts-active"),t.style.opacity="0")}_parseSize(t,e){if("number"==typeof t)return t;const i=String(t).trim();if(i.endsWith("%"))return parseFloat(i)/100*e;const s=parseFloat(i);return isNaN(s)?.15*e:s}_lighten(t,e){if("string"!=typeof t||"#"!==t[0])return t;let i=t.slice(1);if(3===i.length&&(i=i.split("").map(t=>t+t).join("")),6!==i.length)return t;const s=parseInt(i,16);if(isNaN(s))return t;let a=s>>16&255,r=s>>8&255,n=255&s;return a=Math.round(a+(255-a)*e),r=Math.round(r+(255-r)*e),n=Math.round(n+(255-n)*e),"#"+((1<<24)+(a<<16)+(r<<8)+n).toString(16).slice(1)}}}),Object.defineProperty(Ks,"__internals",{value:Js,enumerable:!1,writable:!1,configurable:!1}),Ks});