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