import { ref as L, computed as D, watch as Oe, onMounted as xt, onBeforeUnmount as yt, nextTick as $e, openBlock as a, createElementBlock as l, normalizeClass as re, normalizeStyle as N, createBlock as Ce, createCommentVNode as f, unref as g, createSlots as kt, withCtx as Q, renderSlot as M, normalizeProps as H, guardReactiveProps as se, toDisplayString as R, createVNode as ve, createElementVNode as A, Fragment as p, renderList as z, mergeProps as Ne, pushScopeId as St, popScopeId as bt } from "vue";
import { u as wt, c as At, t as _t, a as zt, p as V, C as et, b as Lt, J as $t, e as Ct, d as Fe, m as It, D as tt, X as Et, j as Pt, k as xe, n as Me, i as X, f as B, R as at, v as Z, x as Ie, y as Be } from "./index-Cm2_6s9o.js";
import { t as Tt, u as Rt } from "./useResponsive-CoxXLe23.js";
import Ee from "./BaseIcon-DpLJi6ci.js";
import { _ as Ot } from "./Tooltip-BBgfUr4a.js";
import { u as Nt, U as Ft } from "./usePrinter-Cx8U1e30.js";
import { S as Mt } from "./Slicer-D4SO7odF.js";
import Bt from "./vue-ui-skeleton-BUS6A44x.js";
import { u as lt } from "./useNestedProp-BYPZJNhi.js";
import { _ as Ut } from "./PackageVersion-CTMY4zeY.js";
import { P as Dt } from "./PenAndPaper-DJ_d10S-.js";
import { _ as Vt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
const _ = {
  LINE: "LINE",
  BAR: "BAR",
  DONUT: "DONUT"
}, qt = ["SERIE", "SERIES", "DATA", "VALUE", "VALUES", "NUM"];
function Wt({ dataset: v, barLineSwitch: I = 6 }) {
  let m = null, $ = null, q = 0;
  if ((typeof v == "number" || typeof v == "string") && console.warn(`The provided dataset (${v}) is not sufficient to build a chart`), ye(v) && (Y(v) && (v.length < I ? m = _.BAR : m = _.LINE, $ = v, q = v.length), Pe(v))) {
    if (!Gt(v))
      return console.warn("The objects in the dataset array have a different data structure. Either keys or value types are different."), !1;
    const oe = Object.keys(v[0]), de = Object.values(v[0]);
    if (!oe.some((P) => Ht(P)))
      return console.warn("The data type of the dataset objects in the array must contain one of the following keys: DATA, SERIES, VALUE, VALUES, NUM. Casing is not important."), !1;
    ot(de, (P) => typeof P == "number") && (m = _.DONUT, $ = v), ot(de, (P) => Array.isArray(P) && Y(P)) && (ut(v) > I ? m = _.LINE : m = _.BAR, q = ut(v), $ = v.map((P) => ({
      ...P,
      data: Xt(P, (G) => Y(G))
    }))), v = v.map((P) => it(P)), $ = $.map((P) => it(P));
  }
  return ye(v) && [...new Set(v.flatMap((oe) => Array.isArray(oe)))][0], {
    dataset: v,
    type: m,
    usableDataset: $,
    maxSeriesLength: q
  };
}
function nt(v) {
  return !v || ye(v) && !v.length;
}
function ye(v) {
  return Array.isArray(v);
}
function Y(v) {
  if (!ye(v) || nt(v)) return !1;
  const I = v.map((m) => Number(m));
  return ![...new Set(I.flatMap((m) => typeof m == "number" && !isNaN(m)))].includes(!1);
}
function Pe(v) {
  return !ye(v) || nt(v) || !![...new Set(v.flatMap((m) => typeof m == "object" && !Array.isArray(m)))].includes(!1) ? !1 : !v.map((m) => Object.keys(m).length > 0).includes(!1);
}
function jt(v, I) {
  const m = Object.keys(v).sort(), $ = Object.keys(I).sort();
  if (m.length !== $.length)
    return !1;
  for (let q = 0; q < m.length; q += 1) {
    const W = m[q], le = $[q];
    if (W !== le || typeof v[W] != typeof I[le])
      return !1;
  }
  return !0;
}
function Gt(v) {
  if (v.length <= 1) return !0;
  for (let I = 0; I < v.length; I += 1)
    for (let m = I + 1; m < v.length; m += 1)
      if (!jt(v[I], v[m]))
        return !1;
  return !0;
}
function Ht(v) {
  return qt.includes(v.toUpperCase());
}
function ot(v, I) {
  let m = [];
  for (let $ = 0; $ < v.length; $ += 1)
    m.push(I(v[$]));
  return m.includes(!0);
}
function ut(v) {
  return Math.max(...[...v].flatMap((I) => Object.values(I).filter((m) => Y(m)).map((m) => m.length)));
}
function Xt(v, I) {
  return Object.values(v).filter((m) => I(m))[0];
}
function it(v) {
  const I = {};
  for (let m in v)
    v.hasOwnProperty(m) && (I[m.toUpperCase()] = v[m]);
  return I;
}
const rt = (v) => (St("data-v-7c8df607"), v = v(), bt(), v), Zt = ["id"], Yt = ["xmlns", "viewBox"], Jt = ["id"], Qt = ["id"], Kt = /* @__PURE__ */ rt(() => /* @__PURE__ */ A("feColorMatrix", {
  type: "saturate",
  values: "0"
}, null, -1)), ea = ["id"], ta = ["flood-color"], aa = {
  key: 0,
  class: "donut-label-connectors"
}, la = ["d", "stroke", "stroke-width", "filter"], oa = ["cx", "cy", "r", "fill", "filter"], ua = { class: "donut" }, ia = ["d", "fill", "stroke", "stroke-width", "filter"], na = ["d", "onMouseenter", "onClick"], ra = {
  key: 1,
  class: "donut-labels quick-animation"
}, sa = ["cx", "cy", "fill", "stroke", "filter"], va = ["text-anchor", "x", "y", "fill", "font-size", "filter"], da = ["text-anchor", "x", "y", "fill", "font-size", "filter"], ca = {
  key: 2,
  class: "donut-hollow quick-animation"
}, ha = ["x", "y", "font-size", "fill"], fa = ["x", "y", "font-size", "fill"], ga = {
  key: 0,
  class: "line-grid"
}, ma = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], pa = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], xa = {
  key: 1,
  class: "line-axis"
}, ya = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], ka = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], Sa = {
  key: 2,
  class: "yLabels"
}, ba = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], wa = ["x", "y", "font-size", "fill"], Aa = {
  key: 3,
  class: "periodLabels"
}, _a = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], za = ["font-size", "text-anchor", "fill", "transform"], La = { class: "plots" }, $a = { class: "line-plot-series" }, Ca = ["d", "stroke", "stroke-width"], Ia = ["d", "stroke", "stroke-width"], Ea = ["d", "stroke", "stroke-width"], Pa = ["d", "stroke", "stroke-width"], Ta = ["cx", "cy", "fill", "stroke"], Ra = {
  key: 4,
  class: "dataLabels"
}, Oa = ["font-size", "fill", "x", "y"], Na = { class: "tooltip-traps" }, Fa = ["x", "y", "height", "width", "fill", "onMouseenter", "onClick"], Ma = {
  key: 0,
  class: "line-grid"
}, Ba = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], Ua = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], Da = {
  key: 1,
  class: "line-axis"
}, Va = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], qa = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], Wa = {
  key: 2,
  class: "yLabels"
}, ja = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], Ga = ["x", "y", "font-size", "fill"], Ha = {
  key: 3,
  class: "periodLabels"
}, Xa = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], Za = ["font-size", "text-anchor", "transform", "fill"], Ya = { class: "plots" }, Ja = ["x", "width", "height", "y", "fill", "stroke", "stroke-width"], Qa = ["to"], Ka = ["from", "to"], el = {
  key: 4,
  class: "dataLabels"
}, tl = ["x", "y", "font-size", "fill"], al = { class: "tooltip-traps" }, ll = ["x", "y", "height", "width", "fill", "onMouseenter", "onClick"], ol = {
  key: 3,
  class: "axis-labels"
}, ul = { key: 0 }, il = ["font-size", "fill", "x", "y"], nl = { key: 1 }, rl = ["font-size", "fill", "x", "y"], sl = { key: 2 }, vl = ["font-size", "fill", "transform"], dl = { key: 3 }, cl = ["font-size", "fill", "transform"], hl = {
  key: 6,
  class: "vue-data-ui-watermark"
}, fl = ["onClick"], gl = ["onClick"], ml = ["onClick"], pl = {
  key: 1,
  class: "vue-ui-quick-chart-not-processable"
}, xl = /* @__PURE__ */ rt(() => /* @__PURE__ */ A("span", null, "Dataset is not processable", -1)), yl = {
  __name: "vue-ui-quick-chart",
  props: {
    config: {
      type: Object,
      default() {
        return {};
      }
    },
    dataset: {
      type: [Array, Object, String, Number],
      default() {
        return null;
      }
    }
  },
  emits: ["selectDatapoint", "selectLegend"],
  setup(v, { expose: I, emit: m }) {
    const $ = v, { vue_ui_quick_chart: q } = wt(), W = L(null), le = L(null), oe = L(null), de = L(null), P = L(At()), G = L(!1), ce = L(null), K = L(""), j = L(null), Ue = L(null), De = L(null), w = L([]), Ve = L(0), ke = L(0), e = D({
      get: () => qe(),
      set: (i) => i
    });
    function qe() {
      const i = lt({
        userConfig: $.config,
        defaultConfig: q
      });
      let s = {};
      return i.theme ? s = {
        ...lt({
          userConfig: _t.vue_ui_quick_chart[i.theme] || $.config,
          defaultConfig: i
        }),
        customPalette: zt[i.theme] || V
      } : s = i, $.config && et($.config, "zoomStartIndex") ? s.zoomStartIndex = $.config.zoomStartIndex : s.zoomStartIndex = null, $.config && et($.config, "zoomEndIndex") ? s.zoomEndIndex = $.config.zoomEndIndex : s.zoomEndIndex = null, s;
    }
    Oe(() => $.config, (i) => {
      e.value = qe(), b.value.width = e.value.width, b.value.height = e.value.height, Ge();
    }, { deep: !0 }), Oe(() => $.dataset, (i) => {
      x.value = fe.value, k.value.start = 0, k.value.end = x.value.maxSeriesLength, ke.value += 1;
    }, { deep: !0 });
    const he = D(() => Lt(e.value.customPalette)), fe = D(() => {
      const i = Wt({ dataset: $t($.dataset, [
        "serie",
        "series",
        "data",
        "value",
        "values",
        "num"
      ]), barLineSwitch: e.value.chartIsBarUnderDatasetLength });
      return i || console.error("VueUiQuickChart : Dataset is not processable"), i;
    }), x = L(fe.value), st = D(() => !!x.value), C = D(() => x.value ? x.value.type : null);
    Oe(() => C.value, (i) => {
      i || Ct({
        componentName: "VueUiQuickChart",
        type: "dataset"
      });
    }, { immediate: !0 });
    const { isPrinting: Se, isImaging: be, generatePdf: We, generateImage: je } = Nt({
      elementId: `${C.value}_${P.value}`,
      fileName: e.value.title || C.value
    }), vt = D(() => e.value.showUserOptions && !e.value.title), b = L({
      width: e.value.width,
      height: e.value.height
    }), we = L({
      showTooltip: e.value.showTooltip
    }), Ae = L(null);
    xt(() => {
      Ge();
    });
    function Ge() {
      if (e.value.responsive) {
        const i = Tt(() => {
          const { width: s, height: t } = Rt({
            chart: W.value,
            title: e.value.title ? le.value : null,
            legend: e.value.showLegend ? oe.value : null,
            slicer: [_.BAR, _.LINE].includes(C.value) && e.value.zoomXy && x.value.maxSeriesLength > 1 ? de.value : null,
            source: Ue.value,
            noTitle: De.value
          });
          b.value.width = s, b.value.height = t;
        });
        Ae.value = new ResizeObserver(i), Ae.value.observe(W.value.parentNode);
      }
      Qe();
    }
    yt(() => {
      Ae.value && Ae.value.disconnect();
    });
    const dt = D(() => {
      switch (C.value) {
        case _.LINE:
          return `0 0 ${b.value.width <= 0 ? 10 : b.value.width} ${b.value.height <= 0 ? 10 : b.value.height}`;
        case _.BAR:
          return `0 0 ${b.value.width <= 0 ? 10 : b.value.width} ${b.value.height <= 0 ? 10 : b.value.height}`;
        case _.DONUT:
          return `0 0 ${b.value.width <= 0 ? 10 : b.value.width} ${b.value.height <= 0 ? 10 : b.value.height}`;
        default:
          return `0 0 ${b.value.width <= 0 ? 10 : b.value.width} ${b.value.height <= 0 ? 10 : b.value.height}`;
      }
    });
    function He(i) {
      return [...i].map((s) => s.value).reduce((s, t) => s + t, 0);
    }
    function ge(i) {
      return e.value.blurOnHover && ![null, void 0].includes(j.value) && j.value !== i ? `url(#blur_${P.value})` : "";
    }
    function Xe(i, s) {
      w.value.includes(i) ? w.value = w.value.filter((t) => t !== i) : w.value.length < s && w.value.push(i);
    }
    const Ze = L(null), Ye = L(null), _e = L(!1);
    function ct(i, s) {
      _e.value = !0;
      let t = i.value;
      if (w.value.includes(i.id)) {
        let r = function() {
          t > n ? (_e.value = !1, cancelAnimationFrame(Ye.value), x.value = {
            ...x.value,
            dataset: x.value.dataset.map((h, O) => i.id === `donut_${O}` ? {
              ...h,
              value: n,
              VALUE: n
            } : h)
          }) : (t += n * 0.025, x.value = {
            ...x.value,
            dataset: x.value.dataset.map((h, O) => i.id === `donut_${O}` ? {
              ...h,
              value: t,
              VALUE: t
            } : h)
          }, Ye.value = requestAnimationFrame(r));
        };
        w.value = w.value.filter((h) => h !== i.id);
        const n = fe.value.dataset.find((h, O) => i.id === `donut_${O}`).VALUE;
        r();
      } else if (s.length > 1) {
        let n = function() {
          t < 0.1 ? (_e.value = !1, cancelAnimationFrame(Ze.value), w.value.push(i.id), x.value = {
            ...x.value,
            dataset: x.value.dataset.map((r, h) => i.id === `donut_${h}` ? {
              ...r,
              value: 0,
              VALUE: 0
            } : r)
          }) : (t /= 1.1, x.value = {
            ...x.value,
            dataset: x.value.dataset.map((r, h) => i.id === `donut_${h}` ? {
              ...r,
              value: t,
              VALUE: t
            } : r)
          }, Ze.value = requestAnimationFrame(n));
        };
        n();
      }
    }
    const J = L(null);
    function ht(i) {
      J.value = i;
    }
    const Je = D(() => e.value.donutThicknessRatio < 0.15 ? 0.15 : e.value.donutThicknessRatio > 0.4 ? 0.4 : e.value.donutThicknessRatio), E = D(() => {
      if (C.value !== _.DONUT) return null;
      const i = x.value.dataset.map((o, u) => ({
        ...o,
        value: o.VALUE || o.DATA || o.SERIE || o.VALUES || o.NUM || 0,
        name: o.NAME || o.DESCRIPTION || o.TITLE || o.LABEL || `Serie ${u}`,
        id: `donut_${u}`
      })).map((o, u) => ({
        ...o,
        color: o.COLOR ? Fe(o.COLOR) : he.value[u + e.value.paletteStartIndex] || V[u + e.value.paletteStartIndex] || V[(u + e.value.paletteStartIndex) % V.length],
        immutableValue: o.value
      }));
      function s(o, u) {
        return B({
          v: isNaN(o.value / He(u)) ? 0 : o.value / He(u) * 100,
          s: "%",
          r: e.value.dataLabelRoundingPercentage
        });
      }
      function t(o) {
        return o.proportion * 100 > e.value.donutHideLabelUnderPercentage;
      }
      function n(o, u) {
        const S = fe.value.dataset.find((T, F) => `donut_${F}` === o).VALUE;
        return Math.abs(String(Number(S.toFixed(0))).length - String(Number(u.toFixed(0))).length);
      }
      function r({ datapoint: o, seriesIndex: u }) {
        ce.value = { datapoint: o, seriesIndex: u, config: e.value, dataset: i }, j.value = o.id;
        const S = e.value.tooltipCustomFormat;
        if (Ie(S) && Be(() => S({
          datapoint: o,
          seriesIndex: u,
          series: i,
          config: e.value
        })))
          K.value = S({
            datapoint: o,
            seriesIndex: u,
            series: i,
            config: e.value
          });
        else {
          let y = "";
          y += `<div style="width:100%;text-align:center;border-bottom:1px solid ${e.value.tooltipBorderColor};padding-bottom:6px;margin-bottom:3px;">${o.name}</div>`, y += `<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 12 12" height="14" width="14"><circle cx="6" cy="6" r="6" stroke="none" fill="${o.color}"/></svg>`, y += `<b>${X(
            e.value.formatter,
            o.value,
            B({
              p: e.value.valuePrefix,
              v: o.value,
              s: e.value.valueSuffix,
              r: e.value.dataLabelRoundingValue
            }),
            { datapoint: o, seriesIndex: u }
          )}</b>`, y += `<span>(${B({ v: o.proportion * 100, s: "%", r: e.value.dataLabelRoundingPercentage })})</span></div>`, K.value = `<div>${y}</div>`;
        }
        G.value = !0;
      }
      function h() {
        G.value = !1, j.value = null, J.value = null;
      }
      const O = {
        centerX: b.value.width / 2,
        centerY: b.value.height / 2
      }, U = i.filter((o) => !w.value.includes(o.id)).map((o) => o.value || 0).reduce((o, u) => o + u, 0), ie = i.map((o, u) => ({
        ...o,
        proportion: (o.value || 0) / U,
        value: o.value || 0,
        absoluteValue: fe.value.dataset.find((S, y) => `donut_${y}` === o.id).VALUE
      })), ee = b.value.width / 2, ne = b.value.height / 2, te = b.value.height * e.value.donutRadiusRatio;
      return {
        dataset: ie.filter((o) => !w.value.includes(o.id)),
        legend: ie,
        drawingArea: O,
        displayArcPercentage: s,
        isArcBigEnough: t,
        useTooltip: r,
        killTooltip: h,
        getSpaces: n,
        total: U,
        cx: ee,
        cy: ne,
        radius: te,
        chart: It(
          { series: i.filter((o) => !w.value.includes(o.id)) },
          ee,
          ne,
          te,
          te,
          1.99999,
          2,
          1,
          360,
          105.25,
          b.value.height * Je.value
        )
      };
    }), k = L({
      start: 0,
      end: x.value.maxSeriesLength
    });
    function ft() {
      Qe();
    }
    const ue = L(null);
    async function Qe() {
      (e.value.zoomStartIndex !== null || e.value.zoomEndIndex !== null) && ue.value ? (e.value.zoomStartIndex !== null && (await $e(), await $e(), ue.value && ue.value.setStartValue(e.value.zoomStartIndex)), e.value.zoomEndIndex !== null && (await $e(), await $e(), ue.value && ue.value.setEndValue(gt(e.value.zoomEndIndex + 1)))) : (k.value = {
        start: 0,
        end: x.value.maxSeriesLength
      }, ke.value += 1);
    }
    function gt(i) {
      const s = x.value.maxSeriesLength;
      return i > s ? s : i < 0 || e.value.zoomStartIndex !== null && i < e.value.zoomStartIndex ? e.value.zoomStartIndex !== null ? e.value.zoomStartIndex + 1 : 1 : i;
    }
    const mt = D(() => {
      if (!e.value.zoomMinimap.show || C.value === _.DONUT) return [];
      let i = [];
      Y(x.value.dataset) && (i = x.value.dataset), Pe(x.value.dataset) && (i = x.value.dataset.map((r, h) => ({
        values: r.VALUE || r.DATA || r.SERIE || r.SERIES || r.VALUES || r.NUM || 0,
        id: C.value === _.LINE ? `line_${h}` : `bar_${h}`
      })).filter((r) => !w.value.includes(r.id)));
      const s = Y(i) ? i.length : Math.max(...i.map((r) => r.values.length));
      let t = [];
      if (Y(i))
        t = i;
      else
        for (let r = 0; r < s; r += 1)
          t.push(i.map((h) => h.values[r] || 0).reduce((h, O) => (h || 0) + (O || 0), 0));
      const n = Math.min(...t);
      return t.map((r) => r + (n < 0 ? Math.abs(n) : 0));
    }), c = D(() => {
      if (C.value !== _.LINE) return null;
      const i = {
        height: b.value.height,
        width: b.value.width
      }, s = {
        left: e.value.xyPaddingLeft,
        top: e.value.xyPaddingTop,
        right: i.width - e.value.xyPaddingRight,
        bottom: i.height - e.value.xyPaddingBottom,
        width: i.width - e.value.xyPaddingLeft - e.value.xyPaddingRight,
        height: i.height - e.value.xyPaddingTop - e.value.xyPaddingBottom
      };
      let t = [];
      Y(x.value.dataset) && (t = [
        {
          values: x.value.dataset.slice(k.value.start, k.value.end),
          absoluteIndices: x.value.dataset.map((o, u) => u).slice(k.value.start, k.value.end),
          name: e.value.title,
          color: he.value[e.value.paletteStartIndex] || V[e.value.paletteStartIndex],
          id: "line_0"
        }
      ]), Pe(x.value.dataset) && (t = x.value.dataset.map((o, u) => ({
        ...o,
        values: o.VALUE || o.DATA || o.SERIE || o.SERIES || o.VALUES || o.NUM || 0,
        name: o.NAME || o.DESCRIPTION || o.TITLE || o.LABEL || `Serie ${u}`,
        id: `line_${u}`
      })).map((o, u) => ({
        ...o,
        color: o.COLOR ? Fe(o.COLOR) : he.value[u + e.value.paletteStartIndex] || V[u + e.value.paletteStartIndex] || V[(u + e.value.paletteStartIndex) % V.length],
        values: o.values.slice(k.value.start, k.value.end),
        absoluteIndices: o.values.map((S, y) => y).slice(k.value.start, k.value.end)
      })));
      const n = {
        max: Math.max(...t.filter((o) => !w.value.includes(o.id)).flatMap((o) => o.values)),
        min: Math.min(...t.filter((o) => !w.value.includes(o.id)).flatMap((o) => o.values)),
        maxSeries: Math.max(...t.map((o) => o.values.length))
      }, r = tt(n.min < 0 ? n.min : 0, n.max < 0 ? 0 : n.max, e.value.xyScaleSegments), h = n.min < 0 ? Math.abs(n.min) : 0, O = n.max < 0 ? s.top : s.bottom - h / (r.max + h) * s.height, U = s.width / n.maxSeries, ie = r.ticks.map((o) => ({
        y: s.bottom - s.height * ((o + h) / (r.max + h)),
        x: s.left - 8,
        value: o
      })), ee = t.map((o, u) => ({
        ...o,
        coordinates: o.values.map((S, y) => ({
          x: s.left + U * (y + 1) - U / 2,
          y: s.bottom - (S + h) / (r.max + h) * s.height,
          value: S
        }))
      })).map((o) => {
        let u = [];
        return o.coordinates.forEach((S) => {
          u.push(`${S.x},${S.y} `);
        }), {
          ...o,
          linePath: u.join(" ")
        };
      });
      function ne(o) {
        j.value = o, J.value = o;
        const u = t.map((y) => ({
          ...y,
          value: y.values[o],
          absoluteIndex: y.absoluteIndices[o]
        })).filter((y) => !w.value.includes(y.id));
        ce.value = { datapoint: u, seriesIndex: o, config: e.value, dataset: t };
        const S = e.value.tooltipCustomFormat;
        if (Ie(S) && Be(() => S({
          datapoint: u,
          seriesIndex: o,
          series: t,
          config: e.value
        })))
          K.value = S({
            datapoint: u,
            seriesIndex: o,
            series: t,
            config: e.value
          });
        else {
          let y = "";
          e.value.xyPeriods[u[0].absoluteIndex] && (y += `<div style="border-bottom:1px solid ${e.value.tooltipBorderColor};padding-bottom:6px;margin-bottom:3px;">${e.value.xyPeriods[u[0].absoluteIndex]}</div>`), u.forEach((T, F) => {
            y += `
                    <div style="display:flex; flex-wrap: wrap; align-items:center; gap:3px;">
                        <svg viewBox="0 0 12 12" height="14" width="12"><circle cx="6" cy="6" r="6" stroke="none" fill="${T.color}"/></svg>
                        <span>${T.name}:</span>
                        <b>${X(
              e.value.formatter,
              T.value,
              B({
                p: e.value.valuePrefix,
                v: T.value,
                s: e.value.valueSuffix,
                r: e.value.dataLabelRoundingValue
              }),
              { datapoint: T, seriesIndex: F }
            )}
                        </b>
                    </div>
                `;
          }), K.value = y;
        }
        G.value = !0;
      }
      function te() {
        j.value = null, G.value = !1;
      }
      return {
        absoluteZero: O,
        dataset: ee.filter((o) => !w.value.includes(o.id)),
        legend: ee,
        drawingArea: s,
        extremes: n,
        slotSize: U,
        yLabels: ie,
        useTooltip: ne,
        killTooltip: te
      };
    }), d = D(() => {
      if (C.value !== _.BAR) return null;
      const i = {
        height: b.value.height,
        width: b.value.width
      }, s = {
        left: e.value.xyPaddingLeft,
        top: e.value.xyPaddingTop,
        right: i.width - e.value.xyPaddingRight,
        bottom: i.height - e.value.xyPaddingBottom,
        width: i.width - e.value.xyPaddingLeft - e.value.xyPaddingRight,
        height: i.height - e.value.xyPaddingTop - e.value.xyPaddingBottom
      };
      let t = [];
      Y(x.value.dataset) && (t = [
        {
          values: x.value.dataset.slice(k.value.start, k.value.end),
          absoluteIndices: x.value.dataset.map((u, S) => S).slice(k.value.start, k.value.end),
          name: e.value.title,
          color: he.value[e.value.paletteStartIndex] || V[e.value.paletteStartIndex],
          id: "bar_0"
        }
      ]), Pe(x.value.dataset) && (t = x.value.dataset.map((u, S) => ({
        ...u,
        values: u.VALUE || u.DATA || u.SERIE || u.SERIES || u.VALUES || u.NUM || 0,
        name: u.NAME || u.DESCRIPTION || u.TITLE || u.LABEL || `Serie ${S}`,
        id: `bar_${S}`
      })).map((u, S) => ({
        ...u,
        color: u.COLOR ? Fe(u.COLOR) : he.value[S + e.value.paletteStartIndex] || V[S + e.value.paletteStartIndex] || V[(S + e.value.paletteStartIndex) % V.length],
        values: u.values.slice(k.value.start, k.value.end),
        absoluteIndices: u.values.map((y, T) => T).slice(k.value.start, k.value.end)
      })));
      const n = {
        max: Math.max(...t.filter((u) => !w.value.includes(u.id)).flatMap((u) => u.values)) < 0 ? 0 : Math.max(...t.filter((u) => !w.value.includes(u.id)).flatMap((u) => u.values)),
        min: Math.min(...t.filter((u) => !w.value.includes(u.id)).flatMap((u) => u.values)),
        maxSeries: Math.max(...t.filter((u) => !w.value.includes(u.id)).map((u) => u.values.length))
      }, r = tt(n.min < 0 ? n.min : 0, n.max, e.value.xyScaleSegments), h = r.min < 0 ? Math.abs(r.min) : 0, O = s.bottom - h / (r.max + h) * s.height, U = s.width / n.maxSeries, ie = r.ticks.map((u) => ({
        y: s.bottom - s.height * ((u + h) / (r.max + h)),
        x: s.left - 8,
        value: u
      })), ee = t.map((u, S) => ({
        ...u,
        coordinates: u.values.map((y, T) => {
          const F = (y + h) / (n.max + h) * s.height, me = Math.abs(y) / Math.abs(n.min) * (s.height - O), Re = h / (n.max + h) * s.height, pe = U / t.filter((ae) => !w.value.includes(ae.id)).length - e.value.barGap / t.filter((ae) => !w.value.includes(ae.id)).length;
          return {
            x: s.left + U * T + pe * S + e.value.barGap / 2,
            y: y > 0 ? s.bottom - F : O,
            height: y > 0 ? F - Re : me,
            value: y,
            width: pe
          };
        })
      })), ne = t.filter((u) => !w.value.includes(u.id)).map((u, S) => ({
        ...u,
        coordinates: u.values.map((y, T) => {
          const F = (y + h) / (n.max + h) * s.height, me = Math.abs(y) / (n.max + h) * s.height, Re = h / (n.max + h) * s.height, pe = U / t.filter((ae) => !w.value.includes(ae.id)).length - e.value.barGap / t.filter((ae) => !w.value.includes(ae.id)).length;
          return {
            x: s.left + U * T + pe * S + e.value.barGap / 2,
            y: y > 0 ? s.bottom - F : O,
            height: y > 0 ? F - Re : me,
            value: y,
            width: pe
          };
        })
      }));
      function te(u) {
        j.value = u, J.value = u;
        const S = t.map((T) => ({
          ...T,
          value: T.values[u],
          absoluteIndex: T.absoluteIndices[u]
        })).filter((T) => !w.value.includes(T.id));
        ce.value = { datapoint: S, seriesIndex: u, config: e.value, dataset: t };
        const y = e.value.tooltipCustomFormat;
        if (Ie(y) && Be(() => y({
          datapoint: S,
          seriesIndex: u,
          series: t,
          config: e.value
        })))
          K.value = y({
            point: S,
            seriesIndex: u,
            series: t,
            config: e.value
          });
        else {
          let T = "";
          e.value.xyPeriods[S[0].absoluteIndex] && (T += `<div style="border-bottom:1px solid ${e.value.tooltipBorderColor};padding-bottom:6px;margin-bottom:3px;">${e.value.xyPeriods[S[0].absoluteIndex]}</div>`), S.forEach((F, me) => {
            T += `
                    <div style="display:flex; flex-wrap: wrap; align-items:center; gap:3px;">
                        <svg viewBox="0 0 12 12" height="14" width="12"><rect x=0 y="0" width="12" height="12" rx="1" stroke="none" fill="${F.color}"/></svg>
                        <span>${F.name}:</span>
                        <b>${X(
              e.value.formatter,
              F.value,
              B({
                p: e.value.valuePrefix,
                v: F.value,
                s: e.value.valueSuffix,
                r: e.value.dataLabelRoundingValue
              }),
              { datapoint: F, seriesIndex: me }
            )}
                        </b>
                    </div>
                `;
          }), K.value = T;
        }
        G.value = !0;
      }
      function o() {
        G.value = !1, j.value = null, J.value = null;
      }
      return {
        absoluteZero: O,
        dataset: ne.filter((u) => !w.value.includes(u.id)),
        legend: ee,
        drawingArea: s,
        extremes: n,
        slotSize: U,
        yLabels: ie,
        useTooltip: te,
        killTooltip: o
      };
    }), ze = L(!1);
    function pt(i) {
      ze.value = i, Ve.value += 1;
    }
    function Ke() {
      we.value.showTooltip = !we.value.showTooltip;
    }
    const Le = L(!1);
    function Te() {
      Le.value = !Le.value;
    }
    return I({
      generatePdf: We,
      generateImage: je,
      toggleTooltip: Ke,
      toggleAnnotator: Te
    }), (i, s) => st.value ? (a(), l("div", {
      key: 0,
      id: `${C.value}_${P.value}`,
      ref_key: "quickChart",
      ref: W,
      class: re({ "vue-ui-quick-chart": !0, "vue-data-ui-wrapper-fullscreen": ze.value }),
      style: N(`background:${e.value.backgroundColor};color:${e.value.color};font-family:${e.value.fontFamily}; position: relative; ${e.value.responsive ? "height: 100%" : ""}`)
    }, [
      e.value.userOptionsButtons.annotator ? (a(), Ce(Dt, {
        key: 0,
        parent: W.value,
        backgroundColor: e.value.backgroundColor,
        color: e.value.color,
        active: Le.value,
        onClose: Te
      }, null, 8, ["parent", "backgroundColor", "color", "active"])) : f("", !0),
      vt.value ? (a(), l("div", {
        key: 1,
        ref_key: "noTitle",
        ref: De,
        class: "vue-data-ui-no-title-space",
        style: "height:36px; width: 100%;background:transparent"
      }, null, 512)) : f("", !0),
      e.value.showUserOptions ? (a(), Ce(Ft, {
        ref: "details",
        key: `user_option_${Ve.value}`,
        backgroundColor: e.value.backgroundColor,
        color: e.value.color,
        isPrinting: g(Se),
        isImaging: g(be),
        uid: P.value,
        hasTooltip: e.value.userOptionsButtons.tooltip && e.value.showTooltip,
        hasPdf: e.value.userOptionsButtons.pdf,
        hasImg: e.value.userOptionsButtons.img,
        hasFullscreen: e.value.userOptionsButtons.fullscreen,
        hasXls: !1,
        isTooltip: we.value.showTooltip,
        isFullscreen: ze.value,
        titles: { ...e.value.userOptionsButtonTitles },
        chartElement: W.value,
        position: e.value.userOptionsPosition,
        hasAnnotator: e.value.userOptionsButtons.annotator,
        isAnnotation: Le.value,
        onToggleFullscreen: pt,
        onGeneratePdf: g(We),
        onGenerateImage: g(je),
        onToggleTooltip: Ke,
        onToggleAnnotator: Te
      }, kt({ _: 2 }, [
        i.$slots.optionTooltip ? {
          name: "optionTooltip",
          fn: Q(() => [
            M(i.$slots, "optionTooltip", {}, void 0, !0)
          ]),
          key: "0"
        } : void 0,
        i.$slots.optionPdf ? {
          name: "optionPdf",
          fn: Q(() => [
            M(i.$slots, "optionPdf", {}, void 0, !0)
          ]),
          key: "1"
        } : void 0,
        i.$slots.optionImg ? {
          name: "optionImg",
          fn: Q(() => [
            M(i.$slots, "optionImg", {}, void 0, !0)
          ]),
          key: "2"
        } : void 0,
        i.$slots.optionFullscreen ? {
          name: "optionFullscreen",
          fn: Q(({ toggleFullscreen: t, isFullscreen: n }) => [
            M(i.$slots, "optionFullscreen", H(se({ toggleFullscreen: t, isFullscreen: n })), void 0, !0)
          ]),
          key: "3"
        } : void 0,
        i.$slots.optionAnnotator ? {
          name: "optionAnnotator",
          fn: Q(({ toggleAnnotator: t, isAnnotator: n }) => [
            M(i.$slots, "optionAnnotator", H(se({ toggleAnnotator: t, isAnnotator: n })), void 0, !0)
          ]),
          key: "4"
        } : void 0
      ]), 1032, ["backgroundColor", "color", "isPrinting", "isImaging", "uid", "hasTooltip", "hasPdf", "hasImg", "hasFullscreen", "isTooltip", "isFullscreen", "titles", "chartElement", "position", "hasAnnotator", "isAnnotation", "onGeneratePdf", "onGenerateImage"])) : f("", !0),
      e.value.title ? (a(), l("div", {
        key: 3,
        ref_key: "quickChartTitle",
        ref: le,
        class: "vue-ui-quick-chart-title",
        style: N(`background:transparent;color:${e.value.color};font-size:${e.value.titleFontSize}px;font-weight:${e.value.titleBold ? "bold" : "normal"};text-align:${e.value.titleTextAlign}`)
      }, R(e.value.title), 5)) : f("", !0),
      C.value ? (a(), l("svg", {
        key: 4,
        xmlns: g(Et),
        viewBox: dt.value,
        style: N(`max-width:100%;overflow:visible;background:transparent;color:${e.value.color}`)
      }, [
        ve(Ut),
        A("defs", null, [
          A("filter", {
            id: `blur_${P.value}`,
            x: "-50%",
            y: "-50%",
            width: "200%",
            height: "200%"
          }, [
            A("feGaussianBlur", {
              in: "SourceGraphic",
              stdDeviation: 2,
              id: `blur_std_${P.value}`
            }, null, 8, Qt),
            Kt
          ], 8, Jt),
          A("filter", {
            id: `shadow_${P.value}`,
            "color-interpolation-filters": "sRGB"
          }, [
            A("feDropShadow", {
              dx: "0",
              dy: "0",
              stdDeviation: "10",
              "flood-opacity": "0.5",
              "flood-color": e.value.donutShadowColor
            }, null, 8, ta)
          ], 8, ea)
        ]),
        C.value === _.DONUT ? (a(), l(p, { key: 0 }, [
          e.value.showDataLabels ? (a(), l("g", aa, [
            (a(!0), l(p, null, z(E.value.chart, (t, n) => (a(), l(p, null, [
              E.value.isArcBigEnough(t) ? (a(), l("path", {
                key: 0,
                d: g(Pt)(t, { x: b.value.width / 2, y: b.value.height / 2 }, 16, 16, !1, !1, b.value.height * Je.value),
                stroke: t.color,
                "stroke-width": e.value.donutLabelMarkerStrokeWidth,
                "stroke-linecap": "round",
                "stroke-linejoin": "round",
                fill: "none",
                filter: ge(t.id)
              }, null, 8, la)) : f("", !0)
            ], 64))), 256))
          ])) : f("", !0),
          A("circle", {
            cx: E.value.cx,
            cy: E.value.cy,
            r: E.value.radius,
            fill: e.value.backgroundColor,
            filter: e.value.donutUseShadow ? `url(#shadow_${P.value})` : ""
          }, null, 8, oa),
          A("g", ua, [
            (a(!0), l(p, null, z(E.value.chart, (t, n) => (a(), l("path", {
              d: t.arcSlice,
              fill: t.color,
              stroke: e.value.backgroundColor,
              "stroke-width": e.value.donutStrokeWidth,
              filter: ge(t.id)
            }, null, 8, ia))), 256)),
            (a(!0), l(p, null, z(E.value.chart, (t, n) => (a(), l("path", {
              d: t.arcSlice,
              fill: "transparent",
              onMouseenter: (r) => E.value.useTooltip({ datapoint: t, seriesIndex: n }),
              onMouseout: s[0] || (s[0] = (r) => E.value.killTooltip()),
              onClick: (r) => m("selectDatapoint", t)
            }, null, 40, na))), 256))
          ]),
          e.value.showDataLabels ? (a(), l("g", ra, [
            (a(!0), l(p, null, z(E.value.chart, (t, n) => (a(), l(p, null, [
              E.value.isArcBigEnough(t) ? (a(), l("circle", {
                key: 0,
                cx: g(xe)(t).x,
                cy: g(Me)(t) - 3.7,
                fill: t.color,
                stroke: e.value.backgroundColor,
                "stroke-width": 1,
                r: 3,
                filter: ge(t.id)
              }, null, 8, sa)) : f("", !0),
              E.value.isArcBigEnough(t) ? (a(), l("text", {
                key: 1,
                "text-anchor": g(xe)(t, !0, 20).anchor,
                x: g(xe)(t, !0).x,
                y: g(Me)(t),
                fill: e.value.color,
                "font-size": e.value.dataLabelFontSize,
                filter: ge(t.id)
              }, R(E.value.displayArcPercentage(t, E.value.chart)) + " (" + R(g(X)(
                e.value.formatter,
                t.value,
                g(B)({
                  p: e.value.valuePrefix,
                  v: t.value,
                  s: e.value.valueSuffix,
                  r: e.value.dataLabelRoundingValue
                }),
                { datapoint: t, seriesIndex: n }
              )) + ") ", 9, va)) : f("", !0),
              E.value.isArcBigEnough(t, !0, 20) ? (a(), l("text", {
                key: 2,
                "text-anchor": g(xe)(t).anchor,
                x: g(xe)(t, !0).x,
                y: g(Me)(t) + e.value.dataLabelFontSize,
                fill: e.value.color,
                "font-size": e.value.dataLabelFontSize,
                filter: ge(t.id)
              }, R(t.name), 9, da)) : f("", !0)
            ], 64))), 256))
          ])) : f("", !0),
          e.value.donutShowTotal ? (a(), l("g", ca, [
            A("text", {
              "text-anchor": "middle",
              x: E.value.drawingArea.centerX,
              y: E.value.drawingArea.centerY - e.value.donutTotalLabelFontSize / 2,
              "font-size": e.value.donutTotalLabelFontSize,
              fill: e.value.color
            }, R(e.value.donutTotalLabelText), 9, ha),
            A("text", {
              "text-anchor": "middle",
              x: E.value.drawingArea.centerX,
              y: E.value.drawingArea.centerY + e.value.donutTotalLabelFontSize,
              "font-size": e.value.donutTotalLabelFontSize,
              fill: e.value.color
            }, R(g(B)({
              p: e.value.valuePrefix,
              v: E.value.total,
              s: e.value.valueSuffix,
              r: e.value.dataLabelRoundingValue
            })), 9, fa)
          ])) : f("", !0)
        ], 64)) : f("", !0),
        C.value === _.LINE ? (a(), l(p, { key: 1 }, [
          e.value.xyShowGrid ? (a(), l("g", ga, [
            (a(!0), l(p, null, z(c.value.yLabels, (t) => (a(), l(p, null, [
              t.y <= c.value.drawingArea.bottom ? (a(), l("line", {
                key: 0,
                x1: c.value.drawingArea.left,
                x2: c.value.drawingArea.right,
                y1: t.y,
                y2: t.y,
                stroke: e.value.xyGridStroke,
                "stroke-width": e.value.xyGridStrokeWidth,
                "stroke-linecap": "round"
              }, null, 8, ma)) : f("", !0)
            ], 64))), 256)),
            (a(!0), l(p, null, z(c.value.extremes.maxSeries + 1, (t, n) => (a(), l("line", {
              x1: c.value.drawingArea.left + c.value.slotSize * n,
              x2: c.value.drawingArea.left + c.value.slotSize * n,
              y1: c.value.drawingArea.top,
              y2: c.value.drawingArea.bottom,
              stroke: e.value.xyGridStroke,
              "stroke-width": e.value.xyGridStrokeWidth,
              "stroke-linecap": "round"
            }, null, 8, pa))), 256))
          ])) : f("", !0),
          e.value.xyShowAxis ? (a(), l("g", xa, [
            A("line", {
              x1: c.value.drawingArea.left,
              x2: c.value.drawingArea.left,
              y1: c.value.drawingArea.top,
              y2: c.value.drawingArea.bottom,
              stroke: e.value.xyAxisStroke,
              "stroke-width": e.value.xyAxisStrokeWidth,
              "stroke-linecap": "round"
            }, null, 8, ya),
            A("line", {
              x1: c.value.drawingArea.left,
              x2: c.value.drawingArea.right,
              y1: isNaN(c.value.absoluteZero) ? c.value.drawingArea.bottom : c.value.absoluteZero,
              y2: isNaN(c.value.absoluteZero) ? c.value.drawingArea.bottom : c.value.absoluteZero,
              stroke: e.value.xyAxisStroke,
              "stroke-width": e.value.xyAxisStrokeWidth,
              "stroke-linecap": "round"
            }, null, 8, ka)
          ])) : f("", !0),
          e.value.xyShowScale ? (a(), l("g", Sa, [
            (a(!0), l(p, null, z(c.value.yLabels, (t, n) => (a(), l(p, null, [
              t.y <= c.value.drawingArea.bottom ? (a(), l("line", {
                key: 0,
                x1: t.x + 4,
                x2: c.value.drawingArea.left,
                y1: t.y,
                y2: t.y,
                stroke: e.value.xyAxisStroke,
                "stroke-width": e.value.xyAxisStrokeWidth,
                "stroke-linecap": "round"
              }, null, 8, ba)) : f("", !0),
              t.y <= c.value.drawingArea.bottom ? (a(), l("text", {
                key: 1,
                x: t.x,
                y: t.y + e.value.xyLabelsYFontSize / 3,
                "text-anchor": "end",
                "font-size": e.value.xyLabelsYFontSize,
                fill: e.value.color
              }, R(g(X)(
                e.value.formatter,
                t.value,
                g(B)({
                  p: e.value.valuePrefix,
                  v: t.value,
                  s: e.value.valueSuffix,
                  r: e.value.dataLabelRoundingValue
                }),
                { datapoint: t, seriesIndex: n }
              )), 9, wa)) : f("", !0)
            ], 64))), 256))
          ])) : f("", !0),
          e.value.xyShowScale && e.value.xyPeriods.length ? (a(), l("g", Aa, [
            (a(!0), l(p, null, z(e.value.xyPeriods.slice(k.value.start, k.value.end), (t, n) => (a(), l("line", {
              x1: c.value.drawingArea.left + c.value.slotSize * (n + 1) - c.value.slotSize / 2,
              x2: c.value.drawingArea.left + c.value.slotSize * (n + 1) - c.value.slotSize / 2,
              y1: c.value.drawingArea.bottom,
              y2: c.value.drawingArea.bottom + 4,
              stroke: e.value.xyAxisStroke,
              "stroke-width": e.value.xyAxisStrokeWidth,
              "stroke-linecap": "round"
            }, null, 8, _a))), 256)),
            (a(!0), l(p, null, z(e.value.xyPeriods.slice(k.value.start, k.value.end), (t, n) => (a(), l("text", {
              "font-size": e.value.xyLabelsXFontSize,
              "text-anchor": e.value.xyPeriodLabelsRotation > 0 ? "start" : e.value.xyPeriodLabelsRotation < 0 ? "end" : "middle",
              fill: e.value.color,
              transform: `translate(${c.value.drawingArea.left + c.value.slotSize * (n + 1) - c.value.slotSize / 2}, ${c.value.drawingArea.bottom + e.value.xyLabelsXFontSize + 6}), rotate(${e.value.xyPeriodLabelsRotation})`
            }, R(t), 9, za))), 256))
          ])) : f("", !0),
          A("g", La, [
            (a(!0), l(p, null, z(c.value.dataset, (t, n) => (a(), l("g", $a, [
              e.value.lineSmooth ? (a(), l(p, { key: 0 }, [
                A("path", {
                  d: `M ${g(at)(t.coordinates)}`,
                  stroke: e.value.backgroundColor,
                  "stroke-width": e.value.lineStrokeWidth + 1,
                  "stroke-linecap": "round",
                  fill: "none",
                  class: re({ "quick-animation": !0, "vue-data-ui-line-animated": e.value.lineAnimated }),
                  style: { transition: "all 0.3s ease-in-out" }
                }, null, 10, Ca),
                A("path", {
                  d: `M ${g(at)(t.coordinates)}`,
                  stroke: t.color,
                  "stroke-width": e.value.lineStrokeWidth,
                  "stroke-linecap": "round",
                  fill: "none",
                  class: re({ "quick-animation": !0, "vue-data-ui-line-animated": e.value.lineAnimated }),
                  style: { transition: "all 0.3s ease-in-out" }
                }, null, 10, Ia)
              ], 64)) : (a(), l(p, { key: 1 }, [
                A("path", {
                  d: `M ${t.linePath}`,
                  stroke: e.value.backgroundColor,
                  "stroke-width": e.value.lineStrokeWidth + 1,
                  "stroke-linecap": "round",
                  fill: "none",
                  class: re({ "quick-animation": !0, "vue-data-ui-line-animated": e.value.lineAnimated }),
                  style: { transition: "all 0.3s ease-in-out" }
                }, null, 10, Ea),
                A("path", {
                  d: `M ${t.linePath}`,
                  stroke: t.color,
                  "stroke-width": e.value.lineStrokeWidth,
                  "stroke-linecap": "round",
                  fill: "none",
                  class: re({ "quick-animation": !0, "vue-data-ui-line-animated": e.value.lineAnimated }),
                  style: { transition: "all 0.3s ease-in-out" }
                }, null, 10, Pa)
              ], 64)),
              (a(!0), l(p, null, z(t.coordinates, (r, h) => (a(), l("circle", {
                cx: r.x,
                cy: g(Z)(r.y),
                r: 3,
                fill: t.color,
                stroke: e.value.backgroundColor,
                "stroke-width": "0.5",
                class: "quick-animation",
                style: { transition: "all 0.3s ease-in-out" }
              }, null, 8, Ta))), 256))
            ]))), 256))
          ]),
          e.value.showDataLabels ? (a(), l("g", Ra, [
            (a(!0), l(p, null, z(c.value.dataset, (t, n) => (a(), l(p, null, [
              (a(!0), l(p, null, z(t.coordinates, (r, h) => (a(), l("text", {
                "text-anchor": "middle",
                "font-size": e.value.dataLabelFontSize,
                fill: t.color,
                x: r.x,
                y: g(Z)(r.y) - e.value.dataLabelFontSize / 2,
                class: "quick-animation",
                style: { transition: "all 0.3s ease-in-out" }
              }, R(g(X)(
                e.value.formatter,
                g(Z)(r.value),
                g(B)({
                  p: e.value.valuePrefix,
                  v: g(Z)(r.value),
                  s: e.value.valueSuffix,
                  r: e.value.dataLabelRoundingValue
                }),
                { datapoint: r, seriesIndex: h }
              )), 9, Oa))), 256))
            ], 64))), 256))
          ])) : f("", !0),
          A("g", Na, [
            (a(!0), l(p, null, z(c.value.extremes.maxSeries, (t, n) => (a(), l("rect", {
              x: c.value.drawingArea.left + n * c.value.slotSize,
              y: c.value.drawingArea.top,
              height: c.value.drawingArea.height <= 0 ? 1e-5 : c.value.drawingArea.height,
              width: c.value.slotSize <= 0 ? 1e-5 : c.value.slotSize,
              fill: [j.value, J.value].includes(n) ? e.value.xyHighlighterColor : "transparent",
              style: N(`opacity:${e.value.xyHighlighterOpacity}`),
              onMouseenter: (r) => c.value.useTooltip(n),
              onMouseleave: s[1] || (s[1] = (r) => c.value.killTooltip()),
              onClick: (r) => m("selectDatapoint", c.value.dataset.map((h) => ({
                ...h,
                value: h.values[n]
              })))
            }, null, 44, Fa))), 256))
          ])
        ], 64)) : f("", !0),
        C.value === _.BAR ? (a(), l(p, { key: 2 }, [
          e.value.xyShowGrid ? (a(), l("g", Ma, [
            (a(!0), l(p, null, z(d.value.yLabels, (t) => (a(), l(p, null, [
              t.y <= d.value.drawingArea.bottom ? (a(), l("line", {
                key: 0,
                x1: d.value.drawingArea.left,
                x2: d.value.drawingArea.right,
                y1: t.y,
                y2: t.y,
                stroke: e.value.xyGridStroke,
                "stroke-width": e.value.xyGridStrokeWidth,
                "stroke-linecap": "round"
              }, null, 8, Ba)) : f("", !0)
            ], 64))), 256)),
            (a(!0), l(p, null, z(d.value.extremes.maxSeries + 1, (t, n) => (a(), l("line", {
              x1: d.value.drawingArea.left + d.value.slotSize * n,
              x2: d.value.drawingArea.left + d.value.slotSize * n,
              y1: d.value.drawingArea.top,
              y2: d.value.drawingArea.bottom,
              stroke: e.value.xyGridStroke,
              "stroke-width": e.value.xyGridStrokeWidth,
              "stroke-linecap": "round"
            }, null, 8, Ua))), 256))
          ])) : f("", !0),
          e.value.xyShowAxis ? (a(), l("g", Da, [
            A("line", {
              x1: d.value.drawingArea.left,
              x2: d.value.drawingArea.left,
              y1: d.value.drawingArea.top,
              y2: d.value.drawingArea.bottom,
              stroke: e.value.xyAxisStroke,
              "stroke-width": e.value.xyAxisStrokeWidth,
              "stroke-linecap": "round"
            }, null, 8, Va),
            A("line", {
              x1: d.value.drawingArea.left,
              x2: d.value.drawingArea.right,
              y1: isNaN(d.value.absoluteZero) ? d.value.drawingArea.bottom : d.value.absoluteZero,
              y2: isNaN(d.value.absoluteZero) ? d.value.drawingArea.bottom : d.value.absoluteZero,
              stroke: e.value.xyAxisStroke,
              "stroke-width": e.value.xyAxisStrokeWidth,
              "stroke-linecap": "round"
            }, null, 8, qa)
          ])) : f("", !0),
          e.value.xyShowScale ? (a(), l("g", Wa, [
            (a(!0), l(p, null, z(d.value.yLabels, (t, n) => (a(), l(p, null, [
              t.y <= d.value.drawingArea.bottom ? (a(), l("line", {
                key: 0,
                x1: t.x + 4,
                x2: d.value.drawingArea.left,
                y1: t.y,
                y2: t.y,
                stroke: e.value.xyAxisStroke,
                "stroke-width": e.value.xyAxisStrokeWidth,
                "stroke-linecap": "round"
              }, null, 8, ja)) : f("", !0),
              t.y <= d.value.drawingArea.bottom ? (a(), l("text", {
                key: 1,
                x: t.x,
                y: t.y + e.value.xyLabelsYFontSize / 3,
                "text-anchor": "end",
                "font-size": e.value.xyLabelsYFontSize,
                fill: e.value.color
              }, R(g(X)(
                e.value.formatter,
                t.value,
                g(B)({
                  p: e.value.valuePrefix,
                  v: t.value,
                  s: e.value.valueSuffix,
                  r: e.value.dataLabelRoundingValue
                }),
                { datapoint: t, seriesIndex: n }
              )), 9, Ga)) : f("", !0)
            ], 64))), 256))
          ])) : f("", !0),
          e.value.xyShowScale && e.value.xyPeriods.length ? (a(), l("g", Ha, [
            (a(!0), l(p, null, z(e.value.xyPeriods.slice(k.value.start, k.value.end), (t, n) => (a(), l("line", {
              x1: d.value.drawingArea.left + d.value.slotSize * (n + 1) - d.value.slotSize / 2,
              x2: d.value.drawingArea.left + d.value.slotSize * (n + 1) - d.value.slotSize / 2,
              y1: d.value.drawingArea.bottom,
              y2: d.value.drawingArea.bottom + 4,
              stroke: e.value.xyAxisStroke,
              "stroke-width": e.value.xyAxisStrokeWidth,
              "stroke-linecap": "round"
            }, null, 8, Xa))), 256)),
            (a(!0), l(p, null, z(e.value.xyPeriods.slice(k.value.start, k.value.end), (t, n) => (a(), l("text", {
              "font-size": e.value.xyLabelsXFontSize,
              "text-anchor": e.value.xyPeriodLabelsRotation > 0 ? "start" : e.value.xyPeriodLabelsRotation < 0 ? "end" : "middle",
              transform: `translate(${d.value.drawingArea.left + d.value.slotSize * (n + 1) - d.value.slotSize / 2}, ${d.value.drawingArea.bottom + e.value.xyLabelsXFontSize + 6}) rotate(${e.value.xyPeriodLabelsRotation})`,
              fill: e.value.color
            }, R(t), 9, Za))), 256))
          ])) : f("", !0),
          A("g", Ya, [
            (a(!0), l(p, null, z(d.value.dataset, (t, n) => (a(), l(p, null, [
              (a(!0), l(p, null, z(t.coordinates, (r, h) => (a(), l("rect", {
                x: r.x,
                width: r.width <= 0 ? 1e-5 : r.width,
                height: g(Z)(r.height <= 0 ? 1e-5 : r.height),
                y: g(Z)(r.y),
                fill: t.color,
                stroke: e.value.backgroundColor,
                "stroke-width": e.value.barStrokeWidth,
                "stroke-linecap": "round",
                class: re({ "vue-data-ui-bar-animated": e.value.barAnimated && r.value < 0 })
              }, [
                e.value.barAnimated && r.value > 0 && !g(Se) && !g(be) ? (a(), l("animate", {
                  key: 0,
                  attributeName: "height",
                  from: 0,
                  to: r.height,
                  dur: "0.5s"
                }, null, 8, Qa)) : f("", !0),
                e.value.barAnimated && r.value > 0 && !g(Se) && !g(be) ? (a(), l("animate", {
                  key: 1,
                  attributeName: "y",
                  from: d.value.absoluteZero,
                  to: d.value.absoluteZero - r.height,
                  dur: "0.5s"
                }, null, 8, Ka)) : f("", !0)
              ], 10, Ja))), 256))
            ], 64))), 256))
          ]),
          e.value.showDataLabels ? (a(), l("g", el, [
            (a(!0), l(p, null, z(d.value.dataset, (t, n) => (a(), l(p, null, [
              (a(!0), l(p, null, z(t.coordinates, (r, h) => (a(), l("text", {
                x: r.x + r.width / 2,
                y: g(Z)(r.y) - e.value.dataLabelFontSize / 2,
                "text-anchor": "middle",
                "font-size": e.value.dataLabelFontSize,
                fill: t.color,
                class: "quick-animation"
              }, R(g(X)(
                e.value.formatter,
                g(Z)(r.value),
                g(B)({
                  p: e.value.valuePrefix,
                  v: g(Z)(r.value),
                  s: e.value.valueSuffix,
                  r: e.value.dataLabelRoundingValue
                }),
                { datapoint: r, seriesIndex: h }
              )), 9, tl))), 256))
            ], 64))), 256))
          ])) : f("", !0),
          A("g", al, [
            (a(!0), l(p, null, z(d.value.extremes.maxSeries, (t, n) => (a(), l("rect", {
              x: d.value.drawingArea.left + n * d.value.slotSize,
              y: d.value.drawingArea.top,
              height: d.value.drawingArea.height <= 0 ? 1e-5 : d.value.drawingArea.height,
              width: d.value.slotSize <= 0 ? 1e-5 : d.value.slotSize,
              fill: [j.value, J.value].includes(n) ? e.value.xyHighlighterColor : "transparent",
              style: N(`opacity:${e.value.xyHighlighterOpacity}`),
              onMouseenter: (r) => d.value.useTooltip(n),
              onMouseleave: s[2] || (s[2] = (r) => d.value.killTooltip()),
              onClick: (r) => m("selectDatapoint", d.value.dataset.map((h) => ({
                ...h,
                value: h.values[n]
              })))
            }, null, 44, ll))), 256))
          ])
        ], 64)) : f("", !0),
        [_.LINE, _.BAR].includes(C.value) ? (a(), l("g", ol, [
          e.value.xAxisLabel && C.value === _.LINE ? (a(), l("g", ul, [
            A("text", {
              "font-size": e.value.axisLabelsFontSize,
              fill: e.value.color,
              "text-anchor": "middle",
              x: c.value.drawingArea.left + c.value.drawingArea.width / 2,
              y: b.value.height - e.value.axisLabelsFontSize / 3
            }, R(e.value.xAxisLabel), 9, il)
          ])) : f("", !0),
          e.value.xAxisLabel && C.value === _.BAR ? (a(), l("g", nl, [
            A("text", {
              "font-size": e.value.axisLabelsFontSize,
              fill: e.value.color,
              "text-anchor": "middle",
              x: d.value.drawingArea.left + d.value.drawingArea.width / 2,
              y: b.value.height - e.value.axisLabelsFontSize / 3
            }, R(e.value.xAxisLabel), 9, rl)
          ])) : f("", !0),
          e.value.yAxisLabel && C.value === _.LINE ? (a(), l("g", sl, [
            A("text", {
              "font-size": e.value.axisLabelsFontSize,
              fill: e.value.color,
              transform: `translate(${e.value.axisLabelsFontSize}, ${c.value.drawingArea.top + c.value.drawingArea.height / 2}) rotate(-90)`,
              "text-anchor": "middle"
            }, R(e.value.yAxisLabel), 9, vl)
          ])) : f("", !0),
          e.value.yAxisLabel && C.value === _.BAR ? (a(), l("g", dl, [
            A("text", {
              "font-size": e.value.axisLabelsFontSize,
              fill: e.value.color,
              transform: `translate(${e.value.axisLabelsFontSize}, ${d.value.drawingArea.top + d.value.drawingArea.height / 2}) rotate(-90)`,
              "text-anchor": "middle"
            }, R(e.value.yAxisLabel), 9, cl)
          ])) : f("", !0)
        ])) : f("", !0)
      ], 12, Yt)) : f("", !0),
      C.value ? f("", !0) : (a(), Ce(Bt, {
        key: 5,
        config: {
          type: "line",
          style: {
            backgroundColor: e.value.backgroundColor,
            line: {
              axis: {
                color: e.value.xyAxisStroke
              },
              path: {
                color: e.value.xyAxisStroke,
                strokeWidth: 0.5
              }
            }
          }
        }
      }, null, 8, ["config"])),
      i.$slots.watermark ? (a(), l("div", hl, [
        M(i.$slots, "watermark", H(se({ isPrinting: g(Se) || g(be) })), void 0, !0)
      ])) : f("", !0),
      [_.BAR, _.LINE].includes(C.value) && e.value.zoomXy && x.value.maxSeriesLength > 1 ? (a(), l("div", {
        key: `slicer_${ke.value}`,
        ref_key: "quickChartSlicer",
        ref: de
      }, [
        (a(), Ce(Mt, {
          ref_key: "slicerComponent",
          ref: ue,
          key: `slicer_${ke.value}`,
          background: e.value.zoomColor,
          borderColor: e.value.backgroundColor,
          fontSize: e.value.zoomFontSize,
          useResetSlot: e.value.zoomUseResetSlot,
          labelLeft: e.value.xyPeriods[k.value.start] ? e.value.xyPeriods[k.value.start] : "",
          labelRight: e.value.xyPeriods[k.value.end - 1] ? e.value.xyPeriods[k.value.end - 1] : "",
          textColor: e.value.color,
          inputColor: e.value.zoomColor,
          selectColor: e.value.zoomHighlightColor,
          max: x.value.maxSeriesLength,
          min: 0,
          valueStart: k.value.start,
          valueEnd: k.value.end,
          smoothMinimap: e.value.zoomMinimap.smooth,
          minimapSelectedColor: e.value.zoomMinimap.selectedColor,
          minimapSelectedColorOpacity: e.value.zoomMinimap.selectedColorOpacity,
          minimapSelectionRadius: e.value.zoomMinimap.selectionRadius,
          minimapLineColor: e.value.zoomMinimap.lineColor,
          minimap: mt.value,
          minimapIndicatorColor: e.value.zoomMinimap.indicatorColor,
          minimapSelectedIndex: J.value,
          start: k.value.start,
          "onUpdate:start": s[3] || (s[3] = (t) => k.value.start = t),
          end: k.value.end,
          "onUpdate:end": s[4] || (s[4] = (t) => k.value.end = t),
          refreshStartPoint: e.value.zoomStartIndex !== null ? e.value.zoomStartIndex : 0,
          refreshEndPoint: e.value.zoomEndIndex !== null ? e.value.zoomEndIndex + 1 : x.value.maxSeriesLength,
          onReset: ft,
          onTrapMouse: ht
        }, {
          "reset-action": Q(({ reset: t }) => [
            M(i.$slots, "reset-action", H(se({ reset: t })), void 0, !0)
          ]),
          _: 3
        }, 8, ["background", "borderColor", "fontSize", "useResetSlot", "labelLeft", "labelRight", "textColor", "inputColor", "selectColor", "max", "valueStart", "valueEnd", "smoothMinimap", "minimapSelectedColor", "minimapSelectedColorOpacity", "minimapSelectionRadius", "minimapLineColor", "minimap", "minimapIndicatorColor", "minimapSelectedIndex", "start", "end", "refreshStartPoint", "refreshEndPoint"]))
      ])) : f("", !0),
      e.value.showLegend ? (a(), l("div", {
        key: 8,
        ref_key: "quickChartLegend",
        ref: oe,
        class: "vue-ui-quick-chart-legend",
        style: N(`background:transparent;color:${e.value.color}`)
      }, [
        C.value === _.DONUT ? (a(!0), l(p, { key: 0 }, z(E.value.legend, (t, n) => (a(), l("div", {
          class: "vue-ui-quick-chart-legend-item",
          onClick: (r) => {
            ct(t, E.value.dataset), m("selectLegend", t);
          },
          style: N(`cursor: ${E.value.legend.length > 1 ? "pointer" : "default"}; opacity:${w.value.includes(t.id) ? "0.5" : "1"}`)
        }, [
          e.value.useCustomLegend ? M(i.$slots, "legend", H(Ne({ key: 0 }, { legend: t })), void 0, !0) : (a(), l(p, { key: 1 }, [
            ve(Ee, {
              name: e.value.legendIcon,
              stroke: t.color,
              size: e.value.legendIconSize
            }, null, 8, ["name", "stroke", "size"]),
            A("span", {
              style: N(`font-size:${e.value.legendFontSize}px`)
            }, R(t.name), 5),
            A("span", {
              style: N(`font-size:${e.value.legendFontSize}px;font-variant-numeric:tabular-nums`)
            }, R(w.value.includes(t.id) ? "-" : g(X)(
              e.value.formatter,
              t.absoluteValue,
              g(B)({
                p: e.value.valuePrefix,
                v: t.absoluteValue,
                s: e.value.valueSuffix,
                r: e.value.dataLabelRoundingValue
              }),
              { datapoint: t, seriesIndex: n }
            )), 5),
            w.value.includes(t.id) ? (a(), l("span", {
              key: 0,
              style: N(`font-size:${e.value.legendFontSize}px`)
            }, " ( - % ) ", 4)) : _e.value ? (a(), l("span", {
              key: 1,
              style: N(`font-size:${e.value.legendFontSize}px; font-variant-numeric: tabular-nums;`)
            }, " ( - % ) ", 4)) : (a(), l("span", {
              key: 2,
              style: N(`font-size:${e.value.legendFontSize}px; font-variant-numeric: tabular-nums;`)
            }, " (" + R(g(B)({
              v: t.value / E.value.total * 100,
              s: "%",
              r: e.value.dataLabelRoundingPercentage
            })) + ") ", 5))
          ], 64))
        ], 12, fl))), 256)) : f("", !0),
        C.value === _.LINE ? (a(!0), l(p, { key: 1 }, z(c.value.legend, (t, n) => (a(), l("div", {
          class: "vue-ui-quick-chart-legend-item",
          onClick: (r) => {
            Xe(t.id, c.value.legend.length - 1), m("selectLegend", t);
          },
          style: N(`cursor: ${c.value.legend.length > 1 ? "pointer" : "default"}; opacity:${w.value.includes(t.id) ? "0.5" : "1"}`)
        }, [
          e.value.useCustomLegend ? M(i.$slots, "legend", H(Ne({ key: 0 }, { legend: t })), void 0, !0) : (a(), l(p, { key: 1 }, [
            ve(Ee, {
              name: e.value.legendIcon,
              stroke: t.color,
              size: e.value.legendIconSize
            }, null, 8, ["name", "stroke", "size"]),
            A("span", {
              style: N(`font-size:${e.value.legendFontSize}px`)
            }, R(t.name), 5)
          ], 64))
        ], 12, gl))), 256)) : f("", !0),
        C.value === _.BAR ? (a(!0), l(p, { key: 2 }, z(d.value.legend, (t, n) => (a(), l("div", {
          class: "vue-ui-quick-chart-legend-item",
          onClick: (r) => {
            Xe(t.id, d.value.legend.length - 1), m("selectLegend", t);
          },
          style: N(`cursor: ${d.value.legend.length > 1 ? "pointer" : "default"}; opacity:${w.value.includes(t.id) ? "0.5" : "1"}`)
        }, [
          e.value.useCustomLegend ? M(i.$slots, "legend", H(Ne({ key: 0 }, { legend: t })), void 0, !0) : (a(), l(p, { key: 1 }, [
            ve(Ee, {
              name: e.value.legendIcon,
              stroke: t.color,
              size: e.value.legendIconSize
            }, null, 8, ["name", "stroke", "size"]),
            A("span", {
              style: N(`font-size:${e.value.legendFontSize}px`)
            }, R(t.name), 5)
          ], 64))
        ], 12, ml))), 256)) : f("", !0)
      ], 4)) : f("", !0),
      i.$slots.source ? (a(), l("div", {
        key: 9,
        ref_key: "source",
        ref: Ue,
        dir: "auto"
      }, [
        M(i.$slots, "source", {}, void 0, !0)
      ], 512)) : f("", !0),
      ve(Ot, {
        show: we.value.showTooltip && G.value,
        backgroundColor: e.value.backgroundColor,
        color: e.value.color,
        borderRadius: e.value.tooltipBorderRadius,
        borderColor: e.value.tooltipBorderColor,
        borderWidth: e.value.tooltipBorderWidth,
        fontSize: e.value.tooltipFontSize,
        backgroundOpacity: e.value.tooltipBackgroundOpacity,
        position: e.value.tooltipPosition,
        offsetY: e.value.tooltipOffsetY,
        parent: W.value,
        content: K.value,
        isFullscreen: ze.value,
        isCustom: g(Ie)(e.value.tooltipCustomFormat)
      }, {
        "tooltip-before": Q(() => [
          M(i.$slots, "tooltip-before", H(se({ ...ce.value })), void 0, !0)
        ]),
        "tooltip-after": Q(() => [
          M(i.$slots, "tooltip-after", H(se({ ...ce.value })), void 0, !0)
        ]),
        _: 3
      }, 8, ["show", "backgroundColor", "color", "borderRadius", "borderColor", "borderWidth", "fontSize", "backgroundOpacity", "position", "offsetY", "parent", "content", "isFullscreen", "isCustom"])
    ], 14, Zt)) : (a(), l("div", pl, [
      ve(Ee, {
        name: "circleCancel",
        stroke: "red"
      }),
      xl
    ]));
  }
}, Pl = /* @__PURE__ */ Vt(yl, [["__scopeId", "data-v-7c8df607"]]);
export {
  Pl as default
};
