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