import { computed as m, ref as d, onMounted as lt, onBeforeUnmount as at, watch as Me, openBlock as o, createElementBlock as s, normalizeClass as ce, normalizeStyle as Y, createBlock as G, createCommentVNode as i, renderSlot as w, unref as n, createSlots as ot, withCtx as $, normalizeProps as E, guardReactiveProps as W, createVNode as Ve, createElementVNode as h, Fragment as k, renderList as X, toDisplayString as x, createTextVNode as Ge, nextTick as ut, pushScopeId as st, popScopeId as nt } from "vue";
import { u as rt, o as it, e as je, g as vt, c as ct, b as dt, d as He, p as j, m as ht, H as yt, f as F, X as ft, s as ee, w as pt, j as gt, I as L, i as A, k as b, n as te, t as bt, a as mt, x as wt, q as kt, r as _t } from "./index-Cm2_6s9o.js";
import { t as xt, u as Ct } from "./useResponsive-CoxXLe23.js";
import { _ as $t } from "./Title-Coit3NcT.js";
import { u as Pt, U as St } from "./usePrinter-Cx8U1e30.js";
import { D as Ft } from "./DataTable-NGi-FgLM.js";
import { _ as Lt } from "./Tooltip-BBgfUr4a.js";
import { L as Tt } from "./Legend-DRozxv9L.js";
import zt from "./vue-ui-skeleton-BUS6A44x.js";
import Yt from "./vue-ui-accordion-CxrNF8BI.js";
import { u as Re } from "./useNestedProp-BYPZJNhi.js";
import { _ as At } from "./PackageVersion-CTMY4zeY.js";
import { P as Nt } from "./PenAndPaper-DJ_d10S-.js";
import { _ as Ot } from "./_plugin-vue_export-helper-CHgC5LLL.js";
const Xt = (q) => (st("data-v-e317c02f"), q = q(), nt(), q), It = ["id"], Dt = ["xmlns", "viewBox"], Bt = { key: 0 }, Mt = ["id"], Vt = ["stop-color"], Gt = ["offset", "stop-color"], jt = ["offset", "stop-color"], Ht = ["stop-color"], Rt = { key: 1 }, Ut = ["id", "cx", "cy"], Et = ["stop-color", "stop-opacity"], Wt = ["stop-color"], qt = ["id"], Jt = ["id"], Kt = /* @__PURE__ */ Xt(() => /* @__PURE__ */ h("feColorMatrix", {
  type: "saturate",
  values: "0"
}, null, -1)), Qt = ["id"], Zt = ["flood-color"], el = ["id"], tl = ["flood-color"], ll = ["d", "stroke", "filter"], al = ["x1", "y1", "x2", "y2", "stroke", "filter"], ol = ["cx", "cy", "r", "fill", "filter"], ul = ["stroke", "d"], sl = ["d", "fill", "stroke", "stroke-width", "filter"], nl = { key: 0 }, rl = ["stroke", "d"], il = { key: 0 }, vl = ["d", "stroke", "stroke-width", "filter"], cl = ["d", "fill", "stroke", "stroke-width", "filter"], dl = { key: 1 }, hl = ["cx", "cy", "r", "fill", "stroke", "stroke-width"], yl = ["cx", "cy", "r", "stroke"], fl = ["cx", "cy", "r", "fill"], pl = { key: 0 }, gl = ["d", "fill", "onMouseenter", "onClick"], bl = { key: 1 }, ml = ["cx", "cy", "r", "fill"], wl = ["x", "y", "fill", "font-size"], kl = ["x", "y", "fill", "font-size"], _l = ["x", "y", "fill", "font-size"], xl = ["x", "y", "fill", "font-size"], Cl = ["filter"], $l = { key: 0 }, Pl = ["x", "y"], Sl = { key: 1 }, Fl = ["cx", "cy", "fill", "stroke", "filter", "onClick"], Ll = ["cx", "cy", "fill", "stroke", "filter", "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 = ["text-anchor", "x", "y", "fill", "font-size", "onClick"], Nl = { key: 2 }, Ol = ["x", "y", "width"], Xl = ["x", "y", "width"], Il = {
  key: 5,
  class: "vue-data-ui-watermark"
}, Dl = ["onClick"], Bl = {
  key: 0,
  style: { "font-variant-numeric": "tabular-nums" }
}, Ml = { key: 1 }, Vl = ["innerHTML"], Gl = {
  __name: "vue-ui-donut",
  props: {
    config: {
      type: Object,
      default() {
        return {};
      }
    },
    dataset: {
      type: Array,
      default() {
        return [];
      }
    }
  },
  emits: ["selectLegend", "selectDatapoint"],
  setup(q, { expose: Ue, emit: de }) {
    const N = q, { vue_ui_donut: Ee } = rt(), J = m({
      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);
    lt(() => {
      we();
    }), at(() => {
      le.value && le.value.disconnect();
    });
    function we() {
      if (it(N.dataset) ? je({
        componentName: "VueUiDonut",
        type: "dataset"
      }) : N.dataset.forEach((l, r) => {
        vt({
          datasetObject: l,
          requiredAttributes: ["name", "values"]
        }).forEach((t) => {
          J.value = !1, je({
            componentName: "VueUiDonut",
            type: "datasetSerieAttribute",
            property: t,
            index: r
          });
        });
      }), e.value.responsive) {
        const l = xt(() => {
          const { width: r, height: t } = Ct({
            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 _ = d(ct()), We = d(null), ae = d(!1), se = d(""), P = d(null), ke = d(0);
    function _e() {
      const l = Re({
        userConfig: N.config,
        defaultConfig: Ee
      });
      return l.theme ? {
        ...Re({
          userConfig: bt.vue_ui_donut[l.theme] || N.config,
          defaultConfig: l
        }),
        customPalette: mt[l.theme] || j
      } : l;
    }
    const e = m({
      get: () => _e(),
      set: (l) => l
    });
    Me(() => 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 } = Pt({
      elementId: `donut__${_.value}`,
      fileName: e.value.style.chart.title.text || "vue-ui-donut"
    }), qe = m(() => e.value.userOptions.show && !e.value.style.chart.title.text), Se = m(() => dt(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
    }), K = m(() => {
      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 = m(() => N.dataset.map((l, r) => ({
      name: l.name,
      color: He(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);
    Me(() => M.value, (l) => T.value = l);
    function Je() {
      return M.value.map((l) => ({
        name: l.name,
        color: l.color,
        value: l.value
      }));
    }
    const O = d([]), Fe = d(null), Le = d(null), V = 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(Fe.value), T.value = T.value.map((p, ve) => l === ve ? {
            ...p,
            value: v
          } : p), V.value = !1) : (V.value = !0, a += v * 0.025, T.value = T.value.map((p, ve) => l === ve ? {
            ...p,
            value: a
          } : p), Fe.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(Le.value), O.value.push(l), T.value = T.value.map((g, p) => l === p ? {
            ...g,
            value: 0
          } : g), V.value = !1) : (V.value = !0, a /= 1.1, T.value = T.value.map((g, p) => l === p ? {
            ...g,
            value: a
          } : g), Le.value = requestAnimationFrame(v));
        };
        v();
      }
      de("selectLegend", I.value.map((v) => ({
        name: v.name,
        color: v.color,
        value: v.value
      })));
    }
    const I = m(() => (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 = m(() => N.dataset.map((l, r) => ({
      name: l.name,
      color: He(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: () => !V.value && Te(r),
      isSegregated: O.value.includes(r)
    }))), Ke = m(() => ({
      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 = m(() => {
      const l = Math.min(u.value.width / 3, u.value.height / 3);
      return l < 55 ? 55 : l;
    }), f = m(() => ht({ series: I.value }, u.value.width / 2, u.value.height / 2, C.value, C.value, 1.99999, 2, 1, 360, 105.25, K.value)), c = m(() => {
      const l = Math.max(...I.value.map((t) => t.value)), r = I.value.map((t) => t.value / l);
      return yt({
        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 Qe(l) {
      return l.middlePoint.y > u.value.height / 2 ? L({ initX: l.middlePoint.x, initY: l.middlePoint.y, offset: 100, centerX: u.value.width / 2, centerY: u.value.height / 2 }).y : L({ 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 / Ze(r);
      return isNaN(t) ? 0 : A(
        e.value.style.chart.layout.labels.percentage.formatter,
        t * 100,
        F({
          v: t * 100,
          s: "%",
          r: e.value.style.chart.layout.labels.percentage.rounding
        }),
        { datapoint: l }
      );
    }
    function Ze(l) {
      return [...l].map((r) => r.value).reduce((r, t) => r + t, 0);
    }
    const S = m(() => I.value.map((l) => l.value).reduce((l, r) => l + r, 0)), Ye = m(() => S.value / I.value.length), Ae = m(() => (l) => V.value ? l.proportion * 100 : l.value / S.value * 100), re = d(null), Q = d(!1);
    function Ne({ datapoint: l, relativeIndex: r, seriesIndex: t, show: a = !1 }) {
      re.value = { datapoint: l, seriesIndex: t, config: e.value, series: M.value }, ae.value = a, P.value = r;
      let v = "";
      const g = e.value.style.chart.tooltip.customFormat;
      if (Q.value = !1, wt(g))
        try {
          const p = g({
            seriesIndex: t,
            datapoint: l,
            series: M.value,
            config: e.value
          });
          typeof p == "string" && (se.value = p, Q.value = !0);
        } catch {
          console.warn("Custom format cannot be applied."), Q.value = !1;
        }
      if (!Q.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,
          F({
            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,
            F({
              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 Z(l) {
      return e.value.useBlurOnHover && ![null, void 0].includes(P.value) && P.value !== l ? `url(#blur_${_.value})` : "";
    }
    const D = m(() => {
      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 Oe() {
      ut(() => {
        const l = D.value.head.map((a, v) => [[
          a.name
        ], [D.value.body[v]], [isNaN(D.value.body[v] / S.value) ? "-" : D.value.body[v] / S.value * 100]]), r = [[e.value.style.chart.title.text], [e.value.style.chart.title.subtitle.text], [[""], ["val"], ["%"]]].concat(l), t = kt(r);
        _t({ csvContent: t, title: e.value.style.chart.title.text || "vue-ui-donut" });
      });
    }
    const oe = m(() => {
      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>',
        F({ p: e.value.style.chart.layout.labels.dataLabels.prefix, v: S.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 = F({ 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] / S.value) ? "-" : (D.value.body[g] / S.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
      };
    }), U = d(!1);
    function et(l) {
      U.value = l, ke.value += 1;
    }
    const Xe = m(() => /^((?!chrome|android).)*safari/i.test(navigator.userAgent));
    function tt(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 Ie() {
      y.value.showTable = !y.value.showTable;
    }
    function De() {
      y.value.dataLabels.show = !y.value.dataLabels.show;
    }
    function Be() {
      y.value.showTooltip = !y.value.showTooltip;
    }
    const ue = d(!1);
    function ie() {
      ue.value = !ue.value;
    }
    return Ue({
      getData: Je,
      generatePdf: $e,
      generateCsv: Oe,
      generateImage: Pe,
      toggleTable: Ie,
      toggleLabels: De,
      toggleTooltip: Be,
      toggleAnnotator: ie
    }), (l, r) => (o(), s("div", {
      ref_key: "donutChart",
      ref: H,
      class: ce(`vue-ui-donut ${U.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__${_.value}`
    }, [
      e.value.userOptions.buttons.annotator ? (o(), G(Nt, {
        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),
      w(l.$slots, "userConfig", {}, void 0, !0),
      qe.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(), G($t, {
          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 && J.value ? (o(), G(St, {
        ref_key: "details",
        ref: We,
        key: `user_option_${ke.value}`,
        backgroundColor: e.value.style.chart.backgroundColor,
        color: e.value.style.chart.color,
        isPrinting: n(xe),
        isImaging: n(Ce),
        uid: _.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: U.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: et,
        onGeneratePdf: n($e),
        onGenerateCsv: Oe,
        onGenerateImage: n(Pe),
        onToggleTable: Ie,
        onToggleLabels: De,
        onToggleTooltip: Be,
        onToggleAnnotator: ie
      }, ot({ _: 2 }, [
        l.$slots.optionTooltip ? {
          name: "optionTooltip",
          fn: $(() => [
            w(l.$slots, "optionTooltip", {}, void 0, !0)
          ]),
          key: "0"
        } : void 0,
        l.$slots.optionPdf ? {
          name: "optionPdf",
          fn: $(() => [
            w(l.$slots, "optionPdf", {}, void 0, !0)
          ]),
          key: "1"
        } : void 0,
        l.$slots.optionCsv ? {
          name: "optionCsv",
          fn: $(() => [
            w(l.$slots, "optionCsv", {}, void 0, !0)
          ]),
          key: "2"
        } : void 0,
        l.$slots.optionImg ? {
          name: "optionImg",
          fn: $(() => [
            w(l.$slots, "optionImg", {}, void 0, !0)
          ]),
          key: "3"
        } : void 0,
        l.$slots.optionTable ? {
          name: "optionTable",
          fn: $(() => [
            w(l.$slots, "optionTable", {}, void 0, !0)
          ]),
          key: "4"
        } : void 0,
        l.$slots.optionLabels ? {
          name: "optionLabels",
          fn: $(() => [
            w(l.$slots, "optionLabels", {}, void 0, !0)
          ]),
          key: "5"
        } : void 0,
        l.$slots.optionFullscreen ? {
          name: "optionFullscreen",
          fn: $(({ toggleFullscreen: t, isFullscreen: a }) => [
            w(l.$slots, "optionFullscreen", E(W({ toggleFullscreen: t, isFullscreen: a })), void 0, !0)
          ]),
          key: "6"
        } : void 0,
        l.$slots.optionAnnotator ? {
          name: "optionAnnotator",
          fn: $(({ toggleAnnotator: t, isAnnotator: a }) => [
            w(l.$slots, "optionAnnotator", E(W({ 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),
      J.value ? (o(), s("svg", {
        key: 4,
        xmlns: n(ft),
        class: ce({ "vue-data-ui-fullscreen--on": U.value, "vue-data-ui-fulscreen--off": !U.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}`)
      }, [
        Ve(At),
        e.value.type === "classic" ? (o(), s("defs", Bt, [
          e.value.style.chart.useGradient ? (o(), s("radialGradient", {
            key: 0,
            id: `gradient_${_.value}`
          }, [
            h("stop", {
              offset: "0%",
              "stop-color": n(ee)(e.value.style.chart.backgroundColor, 0),
              "stop-opacity": "0"
            }, null, 8, Vt),
            h("stop", {
              offset: `${(1 - K.value / C.value) * 100}%`,
              "stop-color": n(ee)("#FFFFFF", 0),
              "stop-opacity": "0"
            }, null, 8, Gt),
            h("stop", {
              offset: `${(1 - K.value / C.value / 2) * 100}%`,
              "stop-color": n(ee)("#FFFFFF", e.value.style.chart.gradientIntensity)
            }, null, 8, jt),
            h("stop", {
              offset: "100%",
              "stop-color": n(ee)(e.value.style.chart.backgroundColor, 0),
              "stop-opacity": "0"
            }, null, 8, Ht)
          ], 8, Mt)) : i("", !0)
        ])) : i("", !0),
        e.value.type === "polar" ? (o(), s("defs", Rt, [
          (o(!0), s(k, null, X(c.value, (t, a) => (o(), s("radialGradient", {
            id: `polar_gradient_${a}_${_.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(pt)(f.value[a].color, 0.05),
              "stop-opacity": e.value.style.chart.gradientIntensity / 100
            }, null, 8, Et),
            h("stop", {
              offset: "100%",
              "stop-color": f.value[a].color
            }, null, 8, Wt)
          ], 8, Ut))), 256))
        ])) : i("", !0),
        h("defs", null, [
          h("filter", {
            id: `blur_${_.value}`,
            x: "-50%",
            y: "-50%",
            width: "200%",
            height: "200%"
          }, [
            h("feGaussianBlur", {
              in: "SourceGraphic",
              stdDeviation: 2,
              id: `blur_std_${_.value}`
            }, null, 8, Jt),
            Kt
          ], 8, qt),
          h("filter", {
            id: `shadow_${_.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, Zt)
          ], 8, Qt),
          h("filter", {
            id: `drop_shadow_${_.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, tl)
          ], 8, el)
        ]),
        e.value.type === "classic" ? (o(!0), s(k, { key: 2 }, X(f.value, (t, a) => (o(), s("g", null, [
          z(t) && y.value.dataLabels.show ? (o(), s("path", {
            key: 0,
            d: n(gt)(t, { x: u.value.width / 2, y: u.value.height / 2 }, 16, 16, !1, !1, K.value),
            stroke: t.color,
            "stroke-width": "1",
            "stroke-linecap": "round",
            "stroke-linejoin": "round",
            fill: "none",
            filter: Z(a)
          }, null, 8, ll)) : i("", !0)
        ]))), 256)) : i("", !0),
        e.value.type === "polar" ? (o(!0), s(k, { key: 3 }, X(f.value, (t, a) => (o(), s("g", null, [
          z(t) && y.value.dataLabels.show ? (o(), s("line", {
            key: 0,
            x1: n(L)({ 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(L)({ 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: Z(a)
          }, null, 8, al)) : 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_${_.value})` : ""
        }, null, 8, ol)) : i("", !0),
        S.value && e.value.type === "classic" ? (o(), s(k, { key: 5 }, [
          (o(!0), s(k, null, X(f.value, (t, a) => (o(), s("path", {
            stroke: e.value.style.chart.backgroundColor,
            d: t.arcSlice,
            fill: "#FFFFFF"
          }, null, 8, ul))), 256)),
          (o(!0), s(k, 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: Z(a)
          }, null, 8, sl))), 256))
        ], 64)) : i("", !0),
        S.value && e.value.type === "polar" ? (o(), s(k, { key: 6 }, [
          f.value.length > 1 ? (o(), s("g", nl, [
            (o(!0), s(k, null, X(f.value, (t, a) => (o(), s("path", {
              stroke: e.value.style.chart.backgroundColor,
              d: c.value[a].path,
              fill: "#FFFFFF"
            }, null, 8, rl))), 256)),
            e.value.style.chart.layout.donut.useShadow ? (o(), s("g", il, [
              (o(!0), s(k, 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_${_.value})`
              }, null, 8, vl))), 256))
            ])) : i("", !0),
            (o(!0), s(k, 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}_${_.value})` : t.color,
              stroke: e.value.style.chart.backgroundColor,
              "stroke-width": e.value.style.chart.layout.donut.borderWidth,
              filter: Z(a)
            }, null, 8, cl))), 256))
          ])) : (o(), s("g", dl, [
            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_${_.value})` : f.value[0].color,
              stroke: e.value.style.chart.backgroundColor,
              "stroke-width": e.value.style.chart.layout.donut.borderWidth
            }, null, 8, hl)
          ]))
        ], 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, yl)),
        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_${_.value})`
        }, null, 8, fl)) : i("", !0),
        S.value ? (o(), s(k, { key: 9 }, [
          f.value.length > 1 || e.value.type === "classic" ? (o(), s("g", pl, [
            (o(!0), s(k, 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: P.value === a ? "rgba(0,0,0,0.1)" : "transparent",
              onMouseenter: (v) => Ne({
                datapoint: t,
                relativeIndex: a,
                seriesIndex: t.seriesIndex,
                show: !0
              }),
              onMouseleave: r[0] || (r[0] = (v) => {
                ae.value = !1, P.value = null;
              }),
              onClick: (v) => B(t, a)
            }, null, 40, gl))), 256))
          ])) : (o(), s("g", bl, [
            h("circle", {
              cx: u.value.width / 2,
              cy: u.value.height / 2,
              r: C.value,
              fill: P.value === l.i ? "rgba(0,0,0,0.1)" : "transparent",
              "data-cy-donut-trap": "",
              onMouseenter: r[1] || (r[1] = (t) => Ne({
                datapoint: f.value[0],
                relativeIndex: 0,
                seriesIndex: f.value[0].seriesIndex,
                show: !0
              })),
              onMouseleave: r[2] || (r[2] = (t) => {
                ae.value = !1, P.value = null;
              }),
              onClick: r[3] || (r[3] = (t) => B(f.value[0], l.i))
            }, null, 40, ml)
          ]))
        ], 64)) : i("", !0),
        e.value.type === "classic" ? (o(), s(k, { 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, wl)) : 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,
            S.value,
            n(F)({
              p: e.value.style.chart.layout.labels.hollow.total.value.prefix,
              v: S.value,
              s: e.value.style.chart.layout.labels.hollow.total.value.suffix
            })
          )), 13, kl)) : 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, _l)) : 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(V.value ? "--" : n(A)(
            e.value.style.chart.layout.labels.hollow.average.value.formatter,
            Ye.value,
            n(F)({
              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, xl)) : i("", !0)
        ], 64)) : i("", !0),
        (o(!0), s(k, null, X(f.value, (t, a) => (o(), s("g", {
          filter: Z(a),
          class: ce({ animated: e.value.useCssAnimation })
        }, [
          e.value.style.chart.layout.labels.dataLabels.useLabelSlots ? (o(), s("g", $l, [
            (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) - (Xe.value ? 20 : 0),
              width: "120",
              height: "60",
              style: { overflow: "visible" }
            }, [
              h("div", null, [
                w(l.$slots, "dataLabel", E(W({
                  datapoint: t,
                  isBlur: !e.value.useBlurOnHover || [null, void 0].includes(P.value) || P.value === a,
                  isSafari: Xe.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, Pl))
          ])) : (o(), s("g", Sl, [
            e.value.type === "classic" ? (o(), s(k, { 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(P.value) || P.value === a ? "" : `url(#blur_${_.value})`,
                onClick: (v) => B(t, a)
              }, null, 8, Fl)) : i("", !0)
            ], 64)) : i("", !0),
            e.value.type === "polar" ? (o(), s(k, { key: 1 }, [
              z(t) && y.value.dataLabels.show ? (o(), s("circle", {
                key: 0,
                cx: n(L)({ 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(L)({ 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(P.value) || P.value === a ? "" : `url(#blur_${_.value})`,
                onClick: (v) => B(t, a)
              }, null, 8, Ll)) : i("", !0)
            ], 64)) : i("", !0),
            e.value.type === "classic" ? (o(), s(k, { 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(F)({
                  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, Tl)) : 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, zl)) : i("", !0)
            ], 64)) : i("", !0),
            e.value.type === "polar" ? (o(), s(k, { key: 3 }, [
              z(t) && y.value.dataLabels.show ? (o(), s("text", {
                key: 0,
                "text-anchor": R(c.value[a].middlePoint),
                x: n(L)({ 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(L)({ 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(F)({
                  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, Yl)) : i("", !0),
              z(t) && y.value.dataLabels.show ? (o(), s("text", {
                key: 1,
                "text-anchor": R(c.value[a].middlePoint),
                x: n(L)({ 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(L)({ 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, Al)) : i("", !0)
            ], 64)) : i("", !0)
          ])),
          y.value.dataLabels.show && e.value.style.chart.comments.show && t.comment ? (o(), s("g", Nl, [
            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, [
                w(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, Ol)) : 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(L)({ 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(L)({ 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(L)({ 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: Qe(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, [
                w(l.$slots, "plot-comment", {
                  plot: { ...t, textAlign: R(c.value[a].middlePoint), flexAlign: R(c.value[a].middlePoint) }
                }, void 0, !0)
              ])
            ], 8, Xl)) : i("", !0)
          ])) : i("", !0)
        ], 10, Cl))), 256)),
        w(l.$slots, "svg", { svg: u.value }, void 0, !0)
      ], 14, Dt)) : i("", !0),
      l.$slots.watermark ? (o(), s("div", Il, [
        w(l.$slots, "watermark", E(W({ isPrinting: n(xe) || n(Ce) })), void 0, !0)
      ])) : i("", !0),
      J.value ? i("", !0) : (o(), G(zt, {
        key: 6,
        config: {
          type: "donut",
          style: {
            backgroundColor: e.value.style.chart.backgroundColor,
            donut: {
              color: "#CCCCCC",
              strokeWidth: K.value * 0.8
            }
          }
        }
      }, null, 8, ["config"])),
      h("div", {
        ref_key: "chartLegend",
        ref: ye
      }, [
        e.value.style.chart.legend.show ? (o(), G(Tt, {
          key: `legend_${me.value}`,
          legendSet: ze.value,
          config: Ke.value,
          onClickMarker: r[4] || (r[4] = ({ i: t }) => Te(t))
        }, {
          item: $(({ legend: t, index: a }) => [
            h("div", {
              style: Y(`opacity:${O.value.includes(a) ? 0.5 : 1}`),
              onClick: (v) => t.segregate()
            }, [
              Ge(x(t.name) + ": " + x(n(A)(
                e.value.style.chart.layout.labels.value.formatter,
                t.value,
                n(F)({
                  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", Ml, " ( " + x(tt(t.proportion * 100)) + " % ) ", 1)) : (o(), s("span", Bl, " (" + x(isNaN(t.value / S.value) ? "-" : n(A)(
                e.value.style.chart.layout.labels.percentage.formatter,
                Ae.value(t),
                n(F)({
                  v: Ae.value(t),
                  s: "%",
                  r: e.value.style.chart.legend.roundingPercentage
                })
              )) + ") ", 1))
            ], 12, Dl)
          ]),
          _: 1
        }, 8, ["legendSet", "config"])) : i("", !0),
        w(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"
      }, [
        w(l.$slots, "source", {}, void 0, !0)
      ], 512)) : i("", !0),
      Ve(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: Q.value,
        isFullscreen: U.value
      }, {
        "tooltip-before": $(() => [
          w(l.$slots, "tooltip-before", E(W({ ...re.value })), void 0, !0)
        ]),
        "tooltip-after": $(() => [
          w(l.$slots, "tooltip-after", E(W({ ...re.value })), void 0, !0)
        ]),
        _: 3
      }, 8, ["show", "backgroundColor", "color", "fontSize", "borderRadius", "borderColor", "borderWidth", "backgroundOpacity", "position", "offsetY", "parent", "content", "isCustom", "isFullscreen"]),
      J.value ? (o(), G(Yt, {
        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: $(() => [
          (o(), G(Ft, {
            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: $(({ th: t }) => [
              h("div", {
                innerHTML: t,
                style: { display: "flex", "align-items": "center" }
              }, null, 8, Vl)
            ]),
            td: $(({ 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(F)({
                  v: t,
                  s: "%",
                  r: e.value.style.chart.layout.labels.percentage.rounding
                })
              ) : n(A)(
                e.value.style.chart.layout.labels.value.formatter,
                t,
                n(F)({
                  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, It));
  }
}, aa = /* @__PURE__ */ Ot(Gl, [["__scopeId", "data-v-e317c02f"]]);
export {
  aa as default
};
