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