import { computed as _, ref as d, onMounted as tt, onBeforeUnmount as lt, watch as Be, openBlock as o, createElementBlock as s, normalizeClass as ce, normalizeStyle as Y, createBlock as V, createCommentVNode as i, renderSlot as m, unref as n, createSlots as at, withCtx as P, normalizeProps as U, guardReactiveProps as E, createVNode as Me, createElementVNode as h, Fragment as w, renderList as X, toDisplayString as x, createTextVNode as Ge, nextTick as ot, pushScopeId as ut, popScopeId as st } from "vue";
import { u as nt, o as rt, e as Ve, g as it, c as vt, b as ct, d as je, p as j, m as dt, G as ht, f as L, X as yt, s as ee, w as ft, j as pt, H as F, i as A, k as b, n as te, t as gt, a as bt, x as mt, q as wt, r as kt } from "./index-hQvps1ng.js";
import { t as _t, u as xt } from "./useResponsive-CoxXLe23.js";
import { _ as Ct } from "./Title-DU9SuVY-.js";
import { u as $t, U as Pt } from "./usePrinter-c5Pf5Hrk.js";
import { D as St } from "./DataTable-D7EHk98Z.js";
import { _ as Lt } from "./Tooltip-Chiu53IG.js";
import { L as Ft } from "./Legend-C8xQE9Da.js";
import Tt from "./vue-ui-skeleton-Dmee5Xfg.js";
import zt from "./vue-ui-accordion-CbATWtZa.js";
import { u as He } from "./useNestedProp-CxQ2hIfU.js";
import { _ as Yt } from "./PackageVersion-CiIsJuZg.js";
import { P as At } from "./PenAndPaper-BBXIRAdA.js";
import { _ as Nt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
const Ot = (W) => (ut("data-v-897a9187"), W = W(), st(), W), Xt = ["id"], It = ["xmlns", "viewBox"], Dt = { key: 0 }, Bt = ["id"], Mt = ["stop-color"], Gt = ["offset", "stop-color"], Vt = ["offset", "stop-color"], jt = ["stop-color"], Ht = { key: 1 }, Rt = ["id", "cx", "cy"], Ut = ["stop-color", "stop-opacity"], Et = ["stop-color"], Wt = ["id"], qt = ["id"], Jt = /* @__PURE__ */ Ot(() => /* @__PURE__ */ h("feColorMatrix", {
  type: "saturate",
  values: "0"
}, null, -1)), Kt = ["id"], Qt = ["flood-color"], Zt = ["id"], el = ["flood-color"], tl = ["d", "stroke", "filter"], ll = ["x1", "y1", "x2", "y2", "stroke", "filter"], al = ["cx", "cy", "r", "fill", "filter"], ol = ["stroke", "d"], ul = ["d", "fill", "stroke", "stroke-width", "filter"], sl = { key: 0 }, nl = ["stroke", "d"], rl = { key: 0 }, il = ["d", "stroke", "stroke-width", "filter"], vl = ["d", "fill", "stroke", "stroke-width", "filter"], cl = { key: 1 }, dl = ["cx", "cy", "r", "fill", "stroke", "stroke-width"], hl = ["cx", "cy", "r", "stroke"], yl = ["cx", "cy", "r", "fill"], fl = { key: 0 }, pl = ["d", "fill", "onMouseenter", "onClick"], gl = { key: 1 }, bl = ["cx", "cy", "r", "fill"], ml = ["x", "y", "fill", "font-size"], wl = ["x", "y", "fill", "font-size"], kl = ["x", "y", "fill", "font-size"], _l = ["x", "y", "fill", "font-size"], xl = ["filter"], Cl = { key: 0 }, $l = ["x", "y"], Pl = { key: 1 }, Sl = ["cx", "cy", "fill", "stroke", "filter", "onClick"], Ll = ["cx", "cy", "fill", "stroke", "filter", "onClick"], Fl = ["text-anchor", "x", "y", "fill", "font-size", "onClick"], Tl = ["text-anchor", "x", "y", "fill", "font-size", "onClick"], zl = ["text-anchor", "x", "y", "fill", "font-size", "onClick"], Yl = ["text-anchor", "x", "y", "fill", "font-size", "onClick"], Al = { key: 2 }, Nl = ["x", "y", "width"], Ol = ["x", "y", "width"], Xl = {
  key: 5,
  class: "vue-data-ui-watermark"
}, Il = ["onClick"], Dl = {
  key: 0,
  style: { "font-variant-numeric": "tabular-nums" }
}, Bl = { key: 1 }, Ml = ["innerHTML"], Gl = {
  __name: "vue-ui-donut",
  props: {
    config: {
      type: Object,
      default() {
        return {};
      }
    },
    dataset: {
      type: Array,
      default() {
        return [];
      }
    }
  },
  emits: ["selectLegend", "selectDatapoint"],
  setup(W, { expose: Re, emit: de }) {
    const N = W, { vue_ui_donut: Ue } = nt(), q = _({
      get() {
        return !!N.dataset && N.dataset.length;
      },
      set(l) {
        return l;
      }
    }), H = d(null), he = d(null), ye = d(null), le = d(null), fe = d(null), pe = d(null), ge = d(0), be = d(0), me = d(0);
    tt(() => {
      we();
    }), lt(() => {
      le.value && le.value.disconnect();
    });
    function we() {
      if (rt(N.dataset) ? Ve({
        componentName: "VueUiDonut",
        type: "dataset"
      }) : N.dataset.forEach((l, r) => {
        it({
          datasetObject: l,
          requiredAttributes: ["name", "values"]
        }).forEach((t) => {
          q.value = !1, Ve({
            componentName: "VueUiDonut",
            type: "datasetSerieAttribute",
            property: t,
            index: r
          });
        });
      }), e.value.responsive) {
        const l = _t(() => {
          const { width: r, height: t } = xt({
            chart: H.value,
            title: e.value.style.chart.title.text ? he.value : null,
            legend: e.value.style.chart.legend.show ? ye.value : null,
            source: fe.value,
            noTitle: pe.value
          });
          u.value.width = r, u.value.height = t;
        });
        le.value = new ResizeObserver(l), le.value.observe(H.value.parentNode);
      }
    }
    const k = d(vt()), Ee = d(null), ae = d(!1), se = d(""), S = d(null), ke = d(0);
    function _e() {
      const l = He({
        userConfig: N.config,
        defaultConfig: Ue
      });
      return l.theme ? {
        ...He({
          userConfig: gt.vue_ui_donut[l.theme] || N.config,
          defaultConfig: l
        }),
        customPalette: bt[l.theme] || j
      } : l;
    }
    const e = _({
      get: () => _e(),
      set: (l) => l
    });
    Be(() => N.config, (l) => {
      e.value = _e(), we(), ge.value += 1, be.value += 1, me.value += 1;
    }, { deep: !0 });
    const { isPrinting: xe, isImaging: Ce, generatePdf: $e, generateImage: Pe } = $t({
      elementId: `donut__${k.value}`,
      fileName: e.value.style.chart.title.text || "vue-ui-donut"
    }), We = _(() => e.value.userOptions.show && !e.value.style.chart.title.text), Se = _(() => ct(e.value.customPalette)), y = d({
      dataLabels: {
        show: e.value.style.chart.layout.labels.dataLabels.show
      },
      showTable: e.value.table.show,
      showTooltip: e.value.style.chart.tooltip.show
    }), u = d({
      height: 360,
      width: 512
    }), J = _(() => {
      const l = e.value.style.chart.layout.donut.strokeWidth / 512, r = u.value.width * l, t = r > C.value ? C.value : r;
      return t < 24 ? 24 : t;
    }), M = _(() => N.dataset.map((l, r) => ({
      name: l.name,
      color: je(l.color) || Se.value[r] || j[r] || j[r % j.length],
      value: l.values.reduce((t, a) => t + a, 0),
      absoluteValues: l.values,
      comment: l.comment || ""
    }))), T = d(M.value);
    Be(() => M.value, (l) => T.value = l);
    function qe() {
      return M.value.map((l) => ({
        name: l.name,
        color: l.color,
        value: l.value
      }));
    }
    const O = d([]), Le = d(null), Fe = d(null), G = d(!1);
    function Te(l) {
      const r = M.value.find((v, g) => g === l);
      let a = T.value.find((v, g) => g === l).value;
      if (O.value.includes(l)) {
        let g = function() {
          a > v ? (cancelAnimationFrame(Le.value), T.value = T.value.map((p, ve) => l === ve ? {
            ...p,
            value: v
          } : p), G.value = !1) : (G.value = !0, a += v * 0.025, T.value = T.value.map((p, ve) => l === ve ? {
            ...p,
            value: a
          } : p), Le.value = requestAnimationFrame(g));
        };
        O.value = O.value.filter((p) => p !== l);
        const v = r.value;
        g();
      } else if (O.value.length < M.value.length - 1) {
        let v = function() {
          a < 0.1 ? (cancelAnimationFrame(Fe.value), O.value.push(l), T.value = T.value.map((g, p) => l === p ? {
            ...g,
            value: 0
          } : g), G.value = !1) : (G.value = !0, a /= 1.1, T.value = T.value.map((g, p) => l === p ? {
            ...g,
            value: a
          } : g), Fe.value = requestAnimationFrame(v));
        };
        v();
      }
      de("selectLegend", I.value.map((v) => ({
        name: v.name,
        color: v.color,
        value: v.value
      })));
    }
    const I = _(() => (T.value.forEach((l, r) => {
      if ([null, void 0].includes(l.values))
        return {
          ...l,
          values: []
        };
    }), T.value.map((l, r) => ({
      ...l,
      seriesIndex: r
    })).filter((l, r) => !O.value.includes(r)))), ze = _(() => N.dataset.map((l, r) => ({
      name: l.name,
      color: je(l.color) || Se.value[r] || j[r] || j[r % j.length],
      value: (l.values || []).reduce((t, a) => t + a, 0),
      shape: "circle"
    })).map((l, r) => ({
      ...l,
      proportion: l.value / N.dataset.map((t) => (t.values || []).reduce((a, v) => a + v, 0)).reduce((t, a) => t + a, 0),
      opacity: O.value.includes(r) ? 0.5 : 1,
      segregate: () => Te(r),
      isSegregated: O.value.includes(r)
    }))), Je = _(() => ({
      cy: "donut-div-legend",
      backgroundColor: e.value.style.chart.legend.backgroundColor,
      color: e.value.style.chart.legend.color,
      fontSize: e.value.style.chart.legend.fontSize,
      paddingBottom: 12,
      fontWeight: e.value.style.chart.legend.bold ? "bold" : ""
    })), C = _(() => {
      const l = Math.min(u.value.width / 3, u.value.height / 3);
      return l < 55 ? 55 : l;
    }), f = _(() => dt({ series: I.value }, u.value.width / 2, u.value.height / 2, C.value, C.value, 1.99999, 2, 1, 360, 105.25, J.value)), c = _(() => {
      const l = Math.max(...I.value.map((t) => t.value)), r = I.value.map((t) => t.value / l);
      return ht({
        series: r,
        center: {
          x: u.value.width / 2,
          y: u.value.height / 2
        },
        maxRadius: Math.min(u.value.width, u.value.height) / 3
      });
    });
    function R(l) {
      return l.x > u.value.width / 2 + 6 ? "start" : l.x < u.value.width / 2 - 6 ? "end" : "middle";
    }
    function Ke(l) {
      return l.middlePoint.y > u.value.height / 2 ? F({ initX: l.middlePoint.x, initY: l.middlePoint.y, offset: 100, centerX: u.value.width / 2, centerY: u.value.height / 2 }).y : F({ initX: l.middlePoint.x, initY: l.middlePoint.y, offset: 0, centerX: u.value.width / 2, centerY: u.value.height / 2 }).y - 100;
    }
    function z(l) {
      return l.proportion * 100 > e.value.style.chart.layout.labels.dataLabels.hideUnderValue;
    }
    function ne(l, r) {
      const t = l.value / Qe(r);
      return isNaN(t) ? 0 : A(
        e.value.style.chart.layout.labels.percentage.formatter,
        t * 100,
        L({
          v: t * 100,
          s: "%",
          r: e.value.style.chart.layout.labels.percentage.rounding
        }),
        { datapoint: l }
      );
    }
    function Qe(l) {
      return [...l].map((r) => r.value).reduce((r, t) => r + t, 0);
    }
    const $ = _(() => I.value.map((l) => l.value).reduce((l, r) => l + r, 0)), Ye = _(() => $.value / I.value.length), re = d(null), K = d(!1);
    function Ae({ datapoint: l, relativeIndex: r, seriesIndex: t, show: a = !1 }) {
      re.value = { datapoint: l, seriesIndex: t, config: e.value, series: M.value }, ae.value = a, S.value = r;
      let v = "";
      const g = e.value.style.chart.tooltip.customFormat;
      if (K.value = !1, mt(g))
        try {
          const p = g({
            seriesIndex: t,
            datapoint: l,
            series: M.value,
            config: e.value
          });
          typeof p == "string" && (se.value = p, K.value = !0);
        } catch {
          console.warn("Custom format cannot be applied."), K.value = !1;
        }
      if (!K.value) {
        if (v += `<div style="width:100%;text-align:center;border-bottom:1px solid ${e.value.style.chart.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;">${l.name}</div>`, v += `<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="${l.color}"/></svg>`, e.value.style.chart.tooltip.showValue && (v += `<b>${A(
          e.value.style.chart.layout.labels.value.formatter,
          l.value,
          L({
            p: e.value.style.chart.layout.labels.dataLabels.prefix,
            v: l.value,
            s: e.value.style.chart.layout.labels.dataLabels.suffix,
            r: e.value.style.chart.tooltip.roundingValue
          }),
          {
            datapoint: l,
            relativeIndex: r,
            seriesIndex: t
          }
        )}</b>`), e.value.style.chart.tooltip.showPercentage) {
          const p = A(
            e.value.style.chart.layout.labels.percentage.formatter,
            l.proportion * 100,
            L({
              v: l.proportion * 100,
              s: "%",
              r: e.value.style.chart.tooltip.roundingPercentage
            }),
            {
              datapoint: l,
              relativeIndex: r,
              seriesIndex: t
            }
          );
          e.value.style.chart.tooltip.showValue ? v += `<span>(${p})</span></div>` : v += `<b>${p}</b></div>`;
        }
        e.value.style.chart.comments.showInTooltip && l.comment && (v += `<div class="vue-data-ui-tooltip-comment" style="background:${l.color}20; padding: 6px; margin-bottom: 6px; margin-top:6px; border-left: 1px solid ${l.color}">${l.comment}</div>`), se.value = `<div>${v}</div>`;
      }
    }
    function Q(l) {
      return e.value.useBlurOnHover && ![null, void 0].includes(S.value) && S.value !== l ? `url(#blur_${k.value})` : "";
    }
    const D = _(() => {
      const l = I.value.map((t) => ({
        name: t.name,
        color: t.color
      })), r = I.value.map((t) => t.value);
      return { head: l, body: r };
    });
    function Ne() {
      ot(() => {
        const l = D.value.head.map((a, v) => [[
          a.name
        ], [D.value.body[v]], [isNaN(D.value.body[v] / $.value) ? "-" : D.value.body[v] / $.value * 100]]), r = [[e.value.style.chart.title.text], [e.value.style.chart.title.subtitle.text], [[""], ["val"], ["%"]]].concat(l), t = wt(r);
        kt({ csvContent: t, title: e.value.style.chart.title.text || "vue-ui-donut" });
      });
    }
    const oe = _(() => {
      const l = [
        ' <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M18 16v2a1 1 0 0 1 -1 1h-11l6 -7l-6 -7h11a1 1 0 0 1 1 1v2" /></svg>',
        L({ p: e.value.style.chart.layout.labels.dataLabels.prefix, v: $.value, s: e.value.style.chart.layout.labels.dataLabels.suffix, r: e.value.table.td.roundingValue }),
        "100%"
      ], r = D.value.head.map((v, g) => {
        const p = L({ p: e.value.style.chart.layout.labels.dataLabels.prefix, v: D.value.body[g], s: e.value.style.chart.layout.labels.dataLabels.suffix, r: e.value.table.td.roundingValue });
        return [
          {
            color: v.color,
            name: v.name
          },
          p,
          isNaN(D.value.body[g] / $.value) ? "-" : (D.value.body[g] / $.value * 100).toFixed(e.value.table.td.roundingPercentage) + "%"
        ];
      }), t = {
        th: {
          backgroundColor: e.value.table.th.backgroundColor,
          color: e.value.table.th.color,
          outline: e.value.table.th.outline
        },
        td: {
          backgroundColor: e.value.table.td.backgroundColor,
          color: e.value.table.td.color,
          outline: e.value.table.td.outline
        },
        breakpoint: e.value.table.responsiveBreakpoint
      };
      return {
        colNames: [
          e.value.table.columnNames.series,
          e.value.table.columnNames.value,
          e.value.table.columnNames.percentage
        ],
        head: l,
        body: r,
        config: t
      };
    }), Z = d(!1);
    function Ze(l) {
      Z.value = l, ke.value += 1;
    }
    const Oe = _(() => /^((?!chrome|android).)*safari/i.test(navigator.userAgent));
    function et(l) {
      return l.toFixed(e.value.style.chart.legend.roundingPercentage).split("").map((r) => "-").join("");
    }
    function B(l, r) {
      de("selectDatapoint", { datapoint: l, index: r });
    }
    function Xe() {
      y.value.showTable = !y.value.showTable;
    }
    function Ie() {
      y.value.dataLabels.show = !y.value.dataLabels.show;
    }
    function De() {
      y.value.showTooltip = !y.value.showTooltip;
    }
    const ue = d(!1);
    function ie() {
      ue.value = !ue.value;
    }
    return Re({
      getData: qe,
      generatePdf: $e,
      generateCsv: Ne,
      generateImage: Pe,
      toggleTable: Xe,
      toggleLabels: Ie,
      toggleTooltip: De,
      toggleAnnotator: ie
    }), (l, r) => (o(), s("div", {
      ref_key: "donutChart",
      ref: H,
      class: ce(`vue-ui-donut ${Z.value ? "vue-data-ui-wrapper-fullscreen" : ""} ${e.value.useCssAnimation ? "" : "vue-ui-dna"}`),
      style: Y(`font-family:${e.value.style.fontFamily};width:100%; ${e.value.responsive ? "height:100%;" : ""} text-align:center;background:${e.value.style.chart.backgroundColor}`),
      id: `donut__${k.value}`
    }, [
      e.value.userOptions.buttons.annotator ? (o(), V(At, {
        key: 0,
        parent: H.value,
        backgroundColor: e.value.style.chart.backgroundColor,
        color: e.value.style.chart.color,
        active: ue.value,
        onClose: ie
      }, null, 8, ["parent", "backgroundColor", "color", "active"])) : i("", !0),
      m(l.$slots, "userConfig", {}, void 0, !0),
      We.value ? (o(), s("div", {
        key: 1,
        ref_key: "noTitle",
        ref: pe,
        class: "vue-data-ui-no-title-space",
        style: "height:36px; width: 100%;background:transparent"
      }, null, 512)) : i("", !0),
      e.value.style.chart.title.text ? (o(), s("div", {
        key: 2,
        ref_key: "chartTitle",
        ref: he,
        style: "width:100%;background:transparent;padding-bottom:24px"
      }, [
        (o(), V(Ct, {
          key: `title_${ge.value}`,
          config: {
            title: {
              cy: "donut-div-title",
              ...e.value.style.chart.title
            },
            subtitle: {
              cy: "donut-div-subtitle",
              ...e.value.style.chart.title.subtitle
            }
          }
        }, null, 8, ["config"]))
      ], 512)) : i("", !0),
      e.value.userOptions.show && q.value ? (o(), V(Pt, {
        ref_key: "details",
        ref: Ee,
        key: `user_option_${ke.value}`,
        backgroundColor: e.value.style.chart.backgroundColor,
        color: e.value.style.chart.color,
        isPrinting: n(xe),
        isImaging: n(Ce),
        uid: k.value,
        hasTooltip: e.value.style.chart.tooltip.show && e.value.userOptions.buttons.tooltip,
        hasPdf: e.value.userOptions.buttons.pdf,
        hasImg: e.value.userOptions.buttons.img,
        hasXls: e.value.userOptions.buttons.csv,
        hasTable: e.value.userOptions.buttons.table,
        hasLabel: e.value.userOptions.buttons.labels,
        hasFullscreen: e.value.userOptions.buttons.fullscreen,
        isFullscreen: Z.value,
        chartElement: H.value,
        position: e.value.userOptions.position,
        isTooltip: y.value.showTooltip,
        titles: { ...e.value.userOptions.buttonTitles },
        hasAnnotator: e.value.userOptions.buttons.annotator,
        isAnnotation: ue.value,
        onToggleFullscreen: Ze,
        onGeneratePdf: n($e),
        onGenerateCsv: Ne,
        onGenerateImage: n(Pe),
        onToggleTable: Xe,
        onToggleLabels: Ie,
        onToggleTooltip: De,
        onToggleAnnotator: ie
      }, at({ _: 2 }, [
        l.$slots.optionTooltip ? {
          name: "optionTooltip",
          fn: P(() => [
            m(l.$slots, "optionTooltip", {}, void 0, !0)
          ]),
          key: "0"
        } : void 0,
        l.$slots.optionPdf ? {
          name: "optionPdf",
          fn: P(() => [
            m(l.$slots, "optionPdf", {}, void 0, !0)
          ]),
          key: "1"
        } : void 0,
        l.$slots.optionCsv ? {
          name: "optionCsv",
          fn: P(() => [
            m(l.$slots, "optionCsv", {}, void 0, !0)
          ]),
          key: "2"
        } : void 0,
        l.$slots.optionImg ? {
          name: "optionImg",
          fn: P(() => [
            m(l.$slots, "optionImg", {}, void 0, !0)
          ]),
          key: "3"
        } : void 0,
        l.$slots.optionTable ? {
          name: "optionTable",
          fn: P(() => [
            m(l.$slots, "optionTable", {}, void 0, !0)
          ]),
          key: "4"
        } : void 0,
        l.$slots.optionLabels ? {
          name: "optionLabels",
          fn: P(() => [
            m(l.$slots, "optionLabels", {}, void 0, !0)
          ]),
          key: "5"
        } : void 0,
        l.$slots.optionFullscreen ? {
          name: "optionFullscreen",
          fn: P(({ toggleFullscreen: t, isFullscreen: a }) => [
            m(l.$slots, "optionFullscreen", U(E({ toggleFullscreen: t, isFullscreen: a })), void 0, !0)
          ]),
          key: "6"
        } : void 0,
        l.$slots.optionAnnotator ? {
          name: "optionAnnotator",
          fn: P(({ toggleAnnotator: t, isAnnotator: a }) => [
            m(l.$slots, "optionAnnotator", U(E({ toggleAnnotator: t, isAnnotator: a })), void 0, !0)
          ]),
          key: "7"
        } : void 0
      ]), 1032, ["backgroundColor", "color", "isPrinting", "isImaging", "uid", "hasTooltip", "hasPdf", "hasImg", "hasXls", "hasTable", "hasLabel", "hasFullscreen", "isFullscreen", "chartElement", "position", "isTooltip", "titles", "hasAnnotator", "isAnnotation", "onGeneratePdf", "onGenerateImage"])) : i("", !0),
      q.value ? (o(), s("svg", {
        key: 4,
        xmlns: n(yt),
        class: ce({ "vue-data-ui-fullscreen--on": Z.value, "vue-data-ui-fulscreen--off": !Z.value }),
        viewBox: `0 0 ${u.value.width <= 0 ? 10 : u.value.width} ${u.value.height <= 0 ? 10 : u.value.height}`,
        style: Y(`max-width:100%; overflow: visible; background:transparent;color:${e.value.style.chart.color}`)
      }, [
        Me(Yt),
        e.value.type === "classic" ? (o(), s("defs", Dt, [
          e.value.style.chart.useGradient ? (o(), s("radialGradient", {
            key: 0,
            id: `gradient_${k.value}`
          }, [
            h("stop", {
              offset: "0%",
              "stop-color": n(ee)(e.value.style.chart.backgroundColor, 0),
              "stop-opacity": "0"
            }, null, 8, Mt),
            h("stop", {
              offset: `${(1 - J.value / C.value) * 100}%`,
              "stop-color": n(ee)("#FFFFFF", 0),
              "stop-opacity": "0"
            }, null, 8, Gt),
            h("stop", {
              offset: `${(1 - J.value / C.value / 2) * 100}%`,
              "stop-color": n(ee)("#FFFFFF", e.value.style.chart.gradientIntensity)
            }, null, 8, Vt),
            h("stop", {
              offset: "100%",
              "stop-color": n(ee)(e.value.style.chart.backgroundColor, 0),
              "stop-opacity": "0"
            }, null, 8, jt)
          ], 8, Bt)) : i("", !0)
        ])) : i("", !0),
        e.value.type === "polar" ? (o(), s("defs", Ht, [
          (o(!0), s(w, null, X(c.value, (t, a) => (o(), s("radialGradient", {
            id: `polar_gradient_${a}_${k.value}`,
            cx: t.middlePoint.x / u.value.width * 100 + "%",
            cy: t.middlePoint.y / u.value.height * 100 + "%",
            r: "62%"
          }, [
            h("stop", {
              offset: "0%",
              "stop-color": n(ft)(f.value[a].color, 0.05),
              "stop-opacity": e.value.style.chart.gradientIntensity / 100
            }, null, 8, Ut),
            h("stop", {
              offset: "100%",
              "stop-color": f.value[a].color
            }, null, 8, Et)
          ], 8, Rt))), 256))
        ])) : i("", !0),
        h("defs", null, [
          h("filter", {
            id: `blur_${k.value}`,
            x: "-50%",
            y: "-50%",
            width: "200%",
            height: "200%"
          }, [
            h("feGaussianBlur", {
              in: "SourceGraphic",
              stdDeviation: 2,
              id: `blur_std_${k.value}`
            }, null, 8, qt),
            Jt
          ], 8, Wt),
          h("filter", {
            id: `shadow_${k.value}`,
            "color-interpolation-filters": "sRGB"
          }, [
            h("feDropShadow", {
              dx: "0",
              dy: "0",
              stdDeviation: "10",
              "flood-opacity": "0.5",
              "flood-color": e.value.style.chart.layout.donut.shadowColor
            }, null, 8, Qt)
          ], 8, Kt),
          h("filter", {
            id: `drop_shadow_${k.value}`,
            "color-interpolation-filters": "sRGB",
            x: "-50%",
            y: "-50%",
            width: "200%",
            height: "200%"
          }, [
            h("feDropShadow", {
              dx: "0",
              dy: "0",
              stdDeviation: "3",
              "flood-opacity": "1",
              "flood-color": e.value.style.chart.layout.donut.shadowColor
            }, null, 8, el)
          ], 8, Zt)
        ]),
        e.value.type === "classic" ? (o(!0), s(w, { key: 2 }, X(f.value, (t, a) => (o(), s("g", null, [
          z(t) && y.value.dataLabels.show ? (o(), s("path", {
            key: 0,
            d: n(pt)(t, { x: u.value.width / 2, y: u.value.height / 2 }, 16, 16, !1, !1, J.value),
            stroke: t.color,
            "stroke-width": "1",
            "stroke-linecap": "round",
            "stroke-linejoin": "round",
            fill: "none",
            filter: Q(a)
          }, null, 8, tl)) : i("", !0)
        ]))), 256)) : i("", !0),
        e.value.type === "polar" ? (o(!0), s(w, { key: 3 }, X(f.value, (t, a) => (o(), s("g", null, [
          z(t) && y.value.dataLabels.show ? (o(), s("line", {
            key: 0,
            x1: n(F)({ initX: c.value[a].middlePoint.x, initY: c.value[a].middlePoint.y, offset: 24, centerX: u.value.width / 2, centerY: u.value.height / 2 }).x,
            y1: n(F)({ initX: c.value[a].middlePoint.x, initY: c.value[a].middlePoint.y, offset: 24, centerX: u.value.width / 2, centerY: u.value.height / 2 }).y,
            x2: c.value[a].middlePoint.x,
            y2: c.value[a].middlePoint.y,
            stroke: t.color,
            "stroke-width": "1",
            "stroke-linecap": "round",
            "stroke-linejoin": "round",
            fill: "none",
            filter: Q(a)
          }, null, 8, ll)) : i("", !0)
        ]))), 256)) : i("", !0),
        e.value.type === "classic" ? (o(), s("circle", {
          key: 4,
          cx: u.value.width / 2,
          cy: u.value.height / 2,
          r: C.value <= 0 ? 10 : C.value,
          fill: e.value.style.chart.backgroundColor,
          filter: e.value.style.chart.layout.donut.useShadow ? `url(#shadow_${k.value})` : ""
        }, null, 8, al)) : i("", !0),
        $.value && e.value.type === "classic" ? (o(), s(w, { key: 5 }, [
          (o(!0), s(w, null, X(f.value, (t, a) => (o(), s("path", {
            stroke: e.value.style.chart.backgroundColor,
            d: t.arcSlice,
            fill: "#FFFFFF"
          }, null, 8, ol))), 256)),
          (o(!0), s(w, null, X(f.value, (t, a) => (o(), s("path", {
            class: "vue-ui-donut-arc-path",
            d: t.arcSlice,
            fill: n(ee)(t.color, 80),
            stroke: e.value.style.chart.backgroundColor,
            "stroke-width": e.value.style.chart.layout.donut.borderWidth,
            filter: Q(a)
          }, null, 8, ul))), 256))
        ], 64)) : i("", !0),
        $.value && e.value.type === "polar" ? (o(), s(w, { key: 6 }, [
          f.value.length > 1 ? (o(), s("g", sl, [
            (o(!0), s(w, null, X(f.value, (t, a) => (o(), s("path", {
              stroke: e.value.style.chart.backgroundColor,
              d: c.value[a].path,
              fill: "#FFFFFF"
            }, null, 8, nl))), 256)),
            e.value.style.chart.layout.donut.useShadow ? (o(), s("g", rl, [
              (o(!0), s(w, null, X(f.value, (t, a) => (o(), s("path", {
                class: "vue-ui-donut-arc-path",
                d: c.value[a].path,
                fill: "transparent",
                stroke: e.value.style.chart.backgroundColor,
                "stroke-width": e.value.style.chart.layout.donut.borderWidth,
                filter: `url(#drop_shadow_${k.value})`
              }, null, 8, il))), 256))
            ])) : i("", !0),
            (o(!0), s(w, null, X(f.value, (t, a) => (o(), s("path", {
              class: "vue-ui-donut-arc-path",
              d: c.value[a].path,
              fill: e.value.style.chart.useGradient ? `url(#polar_gradient_${a}_${k.value})` : t.color,
              stroke: e.value.style.chart.backgroundColor,
              "stroke-width": e.value.style.chart.layout.donut.borderWidth,
              filter: Q(a)
            }, null, 8, vl))), 256))
          ])) : (o(), s("g", cl, [
            h("circle", {
              cx: u.value.width / 2,
              cy: u.value.height / 2,
              r: C.value,
              fill: e.value.style.chart.useGradient ? `url(#polar_gradient_0_${k.value})` : f.value[0].color,
              stroke: e.value.style.chart.backgroundColor,
              "stroke-width": e.value.style.chart.layout.donut.borderWidth
            }, null, 8, dl)
          ]))
        ], 64)) : (o(), s("circle", {
          key: 7,
          cx: u.value.width / 2,
          cy: u.value.height / 2,
          r: C.value <= 0 ? 10 : C.value,
          fill: "transparent",
          stroke: e.value.style.chart.backgroundColor
        }, null, 8, hl)),
        e.value.style.chart.useGradient && e.value.type === "classic" ? (o(), s("circle", {
          key: 8,
          cx: u.value.width / 2,
          cy: u.value.height / 2,
          r: (
            /* This might require adjustments */
            C.value <= 0 ? 10 : C.value
          ),
          fill: `url(#gradient_${k.value})`
        }, null, 8, yl)) : i("", !0),
        $.value ? (o(), s(w, { key: 9 }, [
          f.value.length > 1 || e.value.type === "classic" ? (o(), s("g", fl, [
            (o(!0), s(w, null, X(f.value, (t, a) => (o(), s("path", {
              "data-cy-donut-trap": "",
              d: e.value.type === "classic" ? t.arcSlice : c.value[a].path,
              fill: S.value === a ? "rgba(0,0,0,0.1)" : "transparent",
              onMouseenter: (v) => Ae({
                datapoint: t,
                relativeIndex: a,
                seriesIndex: t.seriesIndex,
                show: !0
              }),
              onMouseleave: r[0] || (r[0] = (v) => {
                ae.value = !1, S.value = null;
              }),
              onClick: (v) => B(t, a)
            }, null, 40, pl))), 256))
          ])) : (o(), s("g", gl, [
            h("circle", {
              cx: u.value.width / 2,
              cy: u.value.height / 2,
              r: C.value,
              fill: S.value === l.i ? "rgba(0,0,0,0.1)" : "transparent",
              "data-cy-donut-trap": "",
              onMouseenter: r[1] || (r[1] = (t) => Ae({
                datapoint: f.value[0],
                relativeIndex: 0,
                seriesIndex: f.value[0].seriesIndex,
                show: !0
              })),
              onMouseleave: r[2] || (r[2] = (t) => {
                ae.value = !1, S.value = null;
              }),
              onClick: r[3] || (r[3] = (t) => B(f.value[0], l.i))
            }, null, 40, bl)
          ]))
        ], 64)) : i("", !0),
        e.value.type === "classic" ? (o(), s(w, { key: 10 }, [
          e.value.style.chart.layout.labels.hollow.total.show ? (o(), s("text", {
            key: 0,
            "text-anchor": "middle",
            x: u.value.width / 2,
            y: u.value.height / 2 - (e.value.style.chart.layout.labels.hollow.average.show ? e.value.style.chart.layout.labels.hollow.total.fontSize : 0) + e.value.style.chart.layout.labels.hollow.total.offsetY,
            fill: e.value.style.chart.layout.labels.hollow.total.color,
            "font-size": e.value.style.chart.layout.labels.hollow.total.fontSize,
            style: Y(`font-weight:${e.value.style.chart.layout.labels.hollow.total.bold ? "bold" : ""}`)
          }, x(e.value.style.chart.layout.labels.hollow.total.text), 13, ml)) : i("", !0),
          e.value.style.chart.layout.labels.hollow.total.show ? (o(), s("text", {
            key: 1,
            "text-anchor": "middle",
            x: u.value.width / 2,
            y: u.value.height / 2 + e.value.style.chart.layout.labels.hollow.total.fontSize - (e.value.style.chart.layout.labels.hollow.average.show ? e.value.style.chart.layout.labels.hollow.total.fontSize : 0) + e.value.style.chart.layout.labels.hollow.total.value.offsetY,
            fill: e.value.style.chart.layout.labels.hollow.total.value.color,
            "font-size": e.value.style.chart.layout.labels.hollow.total.value.fontSize,
            style: Y(`font-weight:${e.value.style.chart.layout.labels.hollow.total.value.bold ? "bold" : ""}`)
          }, x(n(A)(
            e.value.style.chart.layout.labels.hollow.total.value.formatter,
            $.value,
            n(L)({
              p: e.value.style.chart.layout.labels.hollow.total.value.prefix,
              v: $.value,
              s: e.value.style.chart.layout.labels.hollow.total.value.suffix
            })
          )), 13, wl)) : i("", !0),
          e.value.style.chart.layout.labels.hollow.average.show ? (o(), s("text", {
            key: 2,
            "text-anchor": "middle",
            x: u.value.width / 2,
            y: u.value.height / 2 + (e.value.style.chart.layout.labels.hollow.total.show ? e.value.style.chart.layout.labels.hollow.average.fontSize : 0) + e.value.style.chart.layout.labels.hollow.average.offsetY,
            fill: e.value.style.chart.layout.labels.hollow.average.color,
            "font-size": e.value.style.chart.layout.labels.hollow.average.fontSize,
            style: Y(`font-weight:${e.value.style.chart.layout.labels.hollow.average.bold ? "bold" : ""}`)
          }, x(e.value.style.chart.layout.labels.hollow.average.text), 13, kl)) : i("", !0),
          e.value.style.chart.layout.labels.hollow.average.show ? (o(), s("text", {
            key: 3,
            "text-anchor": "middle",
            x: u.value.width / 2,
            y: u.value.height / 2 + (e.value.style.chart.layout.labels.hollow.total.show ? e.value.style.chart.layout.labels.hollow.average.fontSize : 0) + e.value.style.chart.layout.labels.hollow.average.fontSize + e.value.style.chart.layout.labels.hollow.average.value.offsetY,
            fill: e.value.style.chart.layout.labels.hollow.average.value.color,
            "font-size": e.value.style.chart.layout.labels.hollow.average.value.fontSize,
            style: Y(`font-weight:${e.value.style.chart.layout.labels.hollow.average.value.bold ? "bold" : ""}`)
          }, x(G.value ? "--" : n(A)(
            e.value.style.chart.layout.labels.hollow.average.value.formatter,
            Ye.value,
            n(L)({
              p: e.value.style.chart.layout.labels.hollow.average.value.prefix,
              v: Ye.value,
              s: e.value.style.chart.layout.labels.hollow.average.value.suffix,
              r: e.value.style.chart.layout.labels.hollow.average.value.rounding
            })
          )), 13, _l)) : i("", !0)
        ], 64)) : i("", !0),
        (o(!0), s(w, null, X(f.value, (t, a) => (o(), s("g", {
          filter: Q(a),
          class: ce({ animated: e.value.useCssAnimation })
        }, [
          e.value.style.chart.layout.labels.dataLabels.useLabelSlots ? (o(), s("g", Cl, [
            (o(), s("foreignObject", {
              x: n(b)(t, !0).anchor === "end" ? n(b)(t).x - 120 : n(b)(t, !0).anchor === "middle" ? n(b)(t).x - 60 : n(b)(t).x,
              y: n(te)(t) - (Oe.value ? 20 : 0),
              width: "120",
              height: "60",
              style: { overflow: "visible" }
            }, [
              h("div", null, [
                m(l.$slots, "dataLabel", U(E({
                  datapoint: t,
                  isBlur: !e.value.useBlurOnHover || [null, void 0].includes(S.value) || S.value === a,
                  isSafari: Oe.value,
                  isVisible: z(t) && y.value.dataLabels.show,
                  textAlign: n(b)(t, !0, 16, !0).anchor,
                  flexAlign: n(b)(t, !0, 16).anchor,
                  percentage: ne(t, f.value)
                })), void 0, !0)
              ])
            ], 8, $l))
          ])) : (o(), s("g", Pl, [
            e.value.type === "classic" ? (o(), s(w, { key: 0 }, [
              z(t) && y.value.dataLabels.show ? (o(), s("circle", {
                key: 0,
                cx: n(b)(t).x,
                cy: n(te)(t) - 3.5,
                fill: t.color,
                stroke: e.value.style.chart.backgroundColor,
                "stroke-width": 1,
                r: 3,
                filter: !e.value.useBlurOnHover || [null, void 0].includes(S.value) || S.value === a ? "" : `url(#blur_${k.value})`,
                onClick: (v) => B(t, a)
              }, null, 8, Sl)) : i("", !0)
            ], 64)) : i("", !0),
            e.value.type === "polar" ? (o(), s(w, { key: 1 }, [
              z(t) && y.value.dataLabels.show ? (o(), s("circle", {
                key: 0,
                cx: n(F)({ initX: c.value[a].middlePoint.x, initY: c.value[a].middlePoint.y, offset: 24, centerX: u.value.width / 2, centerY: u.value.height / 2 }).x,
                cy: n(F)({ initX: c.value[a].middlePoint.x, initY: c.value[a].middlePoint.y, offset: 24, centerX: u.value.width / 2, centerY: u.value.height / 2 }).y,
                fill: t.color,
                stroke: e.value.style.chart.backgroundColor,
                "stroke-width": 1,
                r: 3,
                filter: !e.value.useBlurOnHover || [null, void 0].includes(S.value) || S.value === a ? "" : `url(#blur_${k.value})`,
                onClick: (v) => B(t, a)
              }, null, 8, Ll)) : i("", !0)
            ], 64)) : i("", !0),
            e.value.type === "classic" ? (o(), s(w, { key: 2 }, [
              z(t) && y.value.dataLabels.show ? (o(), s("text", {
                key: 0,
                "text-anchor": n(b)(t, !0, 12).anchor,
                x: n(b)(t, !0, 12).x,
                y: n(te)(t),
                fill: e.value.style.chart.layout.labels.percentage.color,
                "font-size": e.value.style.chart.layout.labels.percentage.fontSize,
                style: Y(`font-weight:${e.value.style.chart.layout.labels.percentage.bold ? "bold" : ""}`),
                onClick: (v) => B(t, a)
              }, x(ne(t, f.value)) + " " + x(e.value.style.chart.layout.labels.value.show ? `(${n(A)(
                e.value.style.chart.layout.labels.value.formatter,
                t.value,
                n(L)({
                  p: e.value.style.chart.layout.labels.dataLabels.prefix,
                  v: t.value,
                  s: e.value.style.chart.layout.labels.dataLabels.suffix,
                  r: e.value.style.chart.layout.labels.value.rounding
                }),
                { datapoint: t }
              )})` : ""), 13, Fl)) : i("", !0),
              z(t) && y.value.dataLabels.show ? (o(), s("text", {
                key: 1,
                "text-anchor": n(b)(t).anchor,
                x: n(b)(t, !0, 12).x,
                y: n(te)(t) + e.value.style.chart.layout.labels.percentage.fontSize,
                fill: e.value.style.chart.layout.labels.name.color,
                "font-size": e.value.style.chart.layout.labels.name.fontSize,
                style: Y(`font-weight:${e.value.style.chart.layout.labels.name.bold ? "bold" : ""}`),
                onClick: (v) => B(t, a)
              }, x(t.name), 13, Tl)) : i("", !0)
            ], 64)) : i("", !0),
            e.value.type === "polar" ? (o(), s(w, { key: 3 }, [
              z(t) && y.value.dataLabels.show ? (o(), s("text", {
                key: 0,
                "text-anchor": R(c.value[a].middlePoint),
                x: n(F)({ initX: c.value[a].middlePoint.x, initY: c.value[a].middlePoint.y, offset: 42, centerX: u.value.width / 2, centerY: u.value.height / 2 }).x,
                y: n(F)({ initX: c.value[a].middlePoint.x, initY: c.value[a].middlePoint.y, offset: 42, centerX: u.value.width / 2, centerY: u.value.height / 2 }).y,
                fill: e.value.style.chart.layout.labels.percentage.color,
                "font-size": e.value.style.chart.layout.labels.percentage.fontSize,
                style: Y(`font-weight:${e.value.style.chart.layout.labels.percentage.bold ? "bold" : ""}`),
                onClick: (v) => B(t, a)
              }, x(ne(t, f.value)) + " " + x(e.value.style.chart.layout.labels.value.show ? `(${n(A)(
                e.value.style.chart.layout.labels.value.formatter,
                t.value,
                n(L)({
                  p: e.value.style.chart.layout.labels.dataLabels.prefix,
                  v: t.value,
                  s: e.value.style.chart.layout.labels.dataLabels.suffix,
                  r: e.value.style.chart.layout.labels.value.rounding
                }),
                { datapoint: t }
              )})` : ""), 13, zl)) : i("", !0),
              z(t) && y.value.dataLabels.show ? (o(), s("text", {
                key: 1,
                "text-anchor": R(c.value[a].middlePoint),
                x: n(F)({ initX: c.value[a].middlePoint.x, initY: c.value[a].middlePoint.y, offset: 42, centerX: u.value.width / 2, centerY: u.value.height / 2 }).x,
                y: n(F)({ initX: c.value[a].middlePoint.x, initY: c.value[a].middlePoint.y, offset: 42, centerX: u.value.width / 2, centerY: u.value.height / 2 }).y + e.value.style.chart.layout.labels.percentage.fontSize,
                fill: e.value.style.chart.layout.labels.name.color,
                "font-size": e.value.style.chart.layout.labels.name.fontSize,
                style: Y(`font-weight:${e.value.style.chart.layout.labels.name.bold ? "bold" : ""}`),
                onClick: (v) => B(t, a)
              }, x(t.name), 13, Yl)) : i("", !0)
            ], 64)) : i("", !0)
          ])),
          y.value.dataLabels.show && e.value.style.chart.comments.show && t.comment ? (o(), s("g", Al, [
            z(t) && e.value.type === "classic" ? (o(), s("foreignObject", {
              key: 0,
              x: e.value.style.chart.comments.offsetX + (n(b)(t, !0).anchor === "end" ? n(b)(t).x - e.value.style.chart.comments.width : n(b)(t, !0).anchor === "middle" ? n(b)(t).x - e.value.style.chart.comments.width / 2 : n(b)(t).x),
              y: n(te)(t) + 24 + e.value.style.chart.comments.offsetY,
              width: e.value.style.chart.comments.width,
              height: "200",
              style: { overflow: "visible", "pointer-events": "none" }
            }, [
              h("div", null, [
                m(l.$slots, "plot-comment", {
                  plot: { ...t, textAlign: n(b)(t, !0, 16, !0).anchor, flexAlign: n(b)(t, !0, 16).anchor }
                }, void 0, !0)
              ])
            ], 8, Nl)) : i("", !0),
            z(t) && e.value.type === "polar" ? (o(), s("foreignObject", {
              key: 1,
              x: e.value.style.chart.comments.offsetX + (R(c.value[a].middlePoint) === "end" ? n(F)({ initX: c.value[a].middlePoint.x, initY: c.value[a].middlePoint.y, offset: 42, centerX: u.value.width / 2, centerY: u.value.height / 2 }).x - e.value.style.chart.comments.width : R(c.value[a].middlePoint) === "middle" ? n(F)({ initX: c.value[a].middlePoint.x, initY: c.value[a].middlePoint.y, offset: 42, centerX: u.value.width / 2, centerY: u.value.height / 2 }).x - e.value.style.chart.comments.width / 2 : n(F)({ initX: c.value[a].middlePoint.x, initY: c.value[a].middlePoint.y, offset: 42, centerX: u.value.width / 2, centerY: u.value.height / 2 }).x),
              y: Ke(c.value[a]) + e.value.style.chart.comments.offsetY,
              width: e.value.style.chart.comments.width,
              height: "200",
              style: { overflow: "visible", "pointer-events": "none" }
            }, [
              h("div", null, [
                m(l.$slots, "plot-comment", {
                  plot: { ...t, textAlign: R(c.value[a].middlePoint), flexAlign: R(c.value[a].middlePoint) }
                }, void 0, !0)
              ])
            ], 8, Ol)) : i("", !0)
          ])) : i("", !0)
        ], 10, xl))), 256)),
        m(l.$slots, "svg", { svg: u.value }, void 0, !0)
      ], 14, It)) : i("", !0),
      l.$slots.watermark ? (o(), s("div", Xl, [
        m(l.$slots, "watermark", U(E({ isPrinting: n(xe) || n(Ce) })), void 0, !0)
      ])) : i("", !0),
      q.value ? i("", !0) : (o(), V(Tt, {
        key: 6,
        config: {
          type: "donut",
          style: {
            backgroundColor: e.value.style.chart.backgroundColor,
            donut: {
              color: "#CCCCCC",
              strokeWidth: J.value * 0.8
            }
          }
        }
      }, null, 8, ["config"])),
      h("div", {
        ref_key: "chartLegend",
        ref: ye
      }, [
        e.value.style.chart.legend.show ? (o(), V(Ft, {
          key: `legend_${me.value}`,
          legendSet: ze.value,
          config: Je.value,
          onClickMarker: r[4] || (r[4] = ({ i: t }) => Te(t))
        }, {
          item: P(({ legend: t, index: a }) => [
            h("div", {
              onClick: (v) => t.segregate(),
              style: Y(`opacity:${O.value.includes(a) ? 0.5 : 1}`)
            }, [
              Ge(x(t.name) + ": " + x(n(A)(
                e.value.style.chart.layout.labels.value.formatter,
                t.value,
                n(L)({
                  p: e.value.style.chart.layout.labels.dataLabels.prefix,
                  v: t.value,
                  s: e.value.style.chart.layout.labels.dataLabels.suffix,
                  r: e.value.style.chart.legend.roundingValue
                }),
                {
                  datapoint: t,
                  index: a
                }
              )) + " ", 1),
              O.value.includes(a) ? (o(), s("span", Bl, " ( " + x(et(t.proportion * 100)) + " % ) ", 1)) : (o(), s("span", Dl, " (" + x(isNaN(t.value / $.value) ? "-" : n(A)(
                e.value.style.chart.layout.labels.percentage.formatter,
                G.value ? t.proportion * 100 : t.value / $.value * 100,
                n(L)({
                  v: G.value ? t.proportion * 100 : t.value / $.value * 100,
                  s: "%",
                  r: e.value.style.chart.legend.roundingPercentage
                })
              )) + ") ", 1))
            ], 12, Il)
          ]),
          _: 1
        }, 8, ["legendSet", "config"])) : i("", !0),
        m(l.$slots, "legend", { legend: ze.value }, void 0, !0)
      ], 512),
      l.$slots.source ? (o(), s("div", {
        key: 7,
        ref_key: "source",
        ref: fe,
        dir: "auto"
      }, [
        m(l.$slots, "source", {}, void 0, !0)
      ], 512)) : i("", !0),
      Me(Lt, {
        show: y.value.showTooltip && ae.value,
        backgroundColor: e.value.style.chart.tooltip.backgroundColor,
        color: e.value.style.chart.tooltip.color,
        fontSize: e.value.style.chart.tooltip.fontSize,
        borderRadius: e.value.style.chart.tooltip.borderRadius,
        borderColor: e.value.style.chart.tooltip.borderColor,
        borderWidth: e.value.style.chart.tooltip.borderWidth,
        backgroundOpacity: e.value.style.chart.tooltip.backgroundOpacity,
        position: e.value.style.chart.tooltip.position,
        offsetY: e.value.style.chart.tooltip.offsetY,
        parent: H.value,
        content: se.value,
        isCustom: K.value
      }, {
        "tooltip-before": P(() => [
          m(l.$slots, "tooltip-before", U(E({ ...re.value })), void 0, !0)
        ]),
        "tooltip-after": P(() => [
          m(l.$slots, "tooltip-after", U(E({ ...re.value })), void 0, !0)
        ]),
        _: 3
      }, 8, ["show", "backgroundColor", "color", "fontSize", "borderRadius", "borderColor", "borderWidth", "backgroundOpacity", "position", "offsetY", "parent", "content", "isCustom"]),
      q.value ? (o(), V(zt, {
        key: 8,
        hideDetails: "",
        config: {
          open: y.value.showTable,
          maxHeight: 1e4,
          body: {
            backgroundColor: e.value.style.chart.backgroundColor,
            color: e.value.style.chart.color
          },
          head: {
            backgroundColor: e.value.style.chart.backgroundColor,
            color: e.value.style.chart.color
          }
        }
      }, {
        content: P(() => [
          (o(), V(St, {
            key: `table_${be.value}`,
            colNames: oe.value.colNames,
            head: oe.value.head,
            body: oe.value.body,
            config: oe.value.config,
            title: `${e.value.style.chart.title.text}${e.value.style.chart.title.subtitle.text ? ` : ${e.value.style.chart.title.subtitle.text}` : ""}`,
            onClose: r[5] || (r[5] = (t) => y.value.showTable = !1)
          }, {
            th: P(({ th: t }) => [
              h("div", {
                innerHTML: t,
                style: { display: "flex", "align-items": "center" }
              }, null, 8, Ml)
            ]),
            td: P(({ td: t }) => [
              Ge(x(t.name ? t.name : isNaN(Number(t)) ? t.includes("%") ? t : n(A)(
                e.value.style.chart.layout.labels.percentage.formatter,
                t,
                n(L)({
                  v: t,
                  s: "%",
                  r: e.value.style.chart.layout.labels.percentage.rounding
                })
              ) : n(A)(
                e.value.style.chart.layout.labels.value.formatter,
                t,
                n(L)({
                  p: e.value.style.chart.layout.labels.dataLabels.prefix,
                  v: t,
                  s: e.value.style.chart.layout.labels.dataLabels.suffix,
                  r: e.value.style.chart.layout.labels.value.rounding
                })
              )), 1)
            ]),
            _: 1
          }, 8, ["colNames", "head", "body", "config", "title"]))
        ]),
        _: 1
      }, 8, ["config"])) : i("", !0)
    ], 14, Xt));
  }
}, la = /* @__PURE__ */ Nt(Gl, [["__scopeId", "data-v-897a9187"]]);
export {
  la as default
};
