(function(o,u){typeof exports=="object"&&typeof module<"u"?module.exports=u(require("vue"),require("apexcharts")):typeof define=="function"&&define.amd?define(["vue","apexcharts"],u):(o=typeof globalThis<"u"?globalThis:o||self,o.VueApexCharts=u(o.Vue,o.ApexCharts))})(this,function(o,u){"use strict";const x=["animationEnd","beforeMount","mounted","updated","click","mouseMove","mouseLeave","legendClick","markerClick","selection","dataPointSelection","dataPointMouseEnter","dataPointMouseLeave","beforeZoom","beforeResetZoom","zoomed","scrolled","brushScrolled"],f=o.defineComponent({name:"apexchart",props:{options:{type:Object},type:{type:String},series:{type:Array,required:!0},width:{default:"100%"},height:{default:"auto"}},emits:x,setup(i,{emit:A}){const S=o.ref(null),t=o.ref(null),v=e=>e&&typeof e=="object"&&!Array.isArray(e)&&e!=null,g=(e,n)=>{typeof Object.assign!="function"&&function(){Object.assign=function(a){if(a==null)throw new TypeError("Cannot convert undefined or null to object");let p=Object(a);for(let r=1;r{v(n[a])?a in e?s[a]=g(e[a],n[a]):Object.assign(s,{[a]:n[a]}):Object.assign(s,{[a]:n[a]})}),s},l=async()=>{if(await o.nextTick(),t.value)return;const e={chart:{type:i.type||i.options.chart.type||"line",height:i.height,width:i.width,events:{}},series:i.series},n=i.options.chart?i.options.chart.events:null;x.forEach(a=>{let p=(...r)=>A(a,...r);e.chart.events[a]=(...r)=>{p(...r),n&&n.hasOwnProperty(a)&&n[a](...r)}});const s=g(i.options,e);return t.value=new u(S.value,s),t.value.render()},h=()=>(m(),l()),m=()=>{t.value.destroy(),t.value=null},b=(e,n)=>t.value.updateSeries(e,n),O=(e,n,s,a)=>t.value.updateOptions(e,n,s,a),j=e=>t.value.toggleSeries(e),P=e=>{t.value.showSeries(e)},C=e=>{t.value.hideSeries(e)},E=(e,n)=>t.value.appendSeries(e,n),M=()=>{t.value.resetSeries()},D=(e,n)=>{t.value.toggleDataPointSelection(e,n)},L=e=>t.value.appendData(e),R=(e,n)=>t.value.zoomX(e,n),T=e=>t.value.dataURI(e),X=e=>t.value.setLocale(e),q=(e,n)=>{t.value.addXaxisAnnotation(e,n)},z=(e,n)=>{t.value.addYaxisAnnotation(e,n)},I=(e,n)=>{t.value.addPointAnnotation(e,n)},U=(e,n)=>{t.value.removeAnnotation(e,n)},B=()=>{t.value.clearAnnotations()};o.onBeforeMount(()=>{window.ApexCharts=u}),o.onMounted(()=>{S.value=o.getCurrentInstance().proxy.$el,l()}),o.onBeforeUnmount(()=>{t.value&&m()});const c=o.toRefs(i);return o.watch(c.options,()=>{!t.value&&i.options?l():t.value.updateOptions(i.options)}),o.watch(c.series,()=>{!t.value&&i.series?l():t.value.updateSeries(i.series)},{deep:!0}),o.watch(c.type,()=>{h()}),o.watch(c.width,()=>{h()}),o.watch(c.height,()=>{h()}),{chart:t,init:l,refresh:h,destroy:m,updateOptions:O,updateSeries:b,toggleSeries:j,showSeries:P,hideSeries:C,resetSeries:M,zoomX:R,toggleDataPointSelection:D,appendData:L,appendSeries:E,addXaxisAnnotation:q,addYaxisAnnotation:z,addPointAnnotation:I,removeAnnotation:U,clearAnnotations:B,setLocale:X,dataURI:T}},render(){return o.h("div",{class:"vue-apexcharts"})}}),y=i=>{i.component(f.name,f)};return f.install=y,f});