import { ref as n, computed as v, watch as Be, onMounted as De, onBeforeUnmount as We, openBlock as u, createElementBlock as f, normalizeClass as W, normalizeStyle as S, unref as r, createBlock as _, createCommentVNode as k, createSlots as Ee, withCtx as p, renderSlot as h, normalizeProps as I, guardReactiveProps as M, createVNode as be, createElementVNode as C, Fragment as ke, renderList as Ce, createTextVNode as we, toDisplayString as E, nextTick as Ge } from "vue";
import { u as He, c as $e, t as Xe, a as je, p as x, o as Ye, e as Y, g as qe, b as Je, J as Ke, d as Te, f as N, X as Qe, s as Ze, w as et, v as q, i as _e, x as tt, y as lt, q as ot, r as at } from "./index-BbPeL8Gp.js";
import { t as st, u as nt } from "./useResponsive-CoxXLe23.js";
import { _ as rt } from "./Title-aSAft5dl.js";
import { u as ut, U as it } from "./usePrinter-DaybDVqP.js";
import { _ as vt } from "./Tooltip-smutPF--.js";
import { D as ct } from "./DataTable-DGf6RrOJ.js";
import { L as dt } from "./Legend-BLaZxMge.js";
import pt from "./vue-ui-skeleton-Bniq21d9.js";
import ht from "./vue-ui-accordion-5d5iVpr7.js";
import { u as xe } from "./useNestedProp-BN8claGG.js";
import { _ as gt } from "./PackageVersion-CxJghxYD.js";
import { P as ft } from "./PenAndPaper-ZdZEumki.js";
import { u as yt } from "./useUserOptionState-BIvW1Kz7.js";
import { _ as mt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
const bt = ["id"], kt = ["xmlns", "viewBox"], Ct = ["id"], wt = ["stop-color"], $t = ["stop-color"], Tt = ["stroke", "cx", "cy", "r", "fill"], _t = ["stroke", "stroke-width", "cx", "cy", "r", "fill"], xt = ["cx", "cy", "r", "onMouseenter"], Nt = {
  key: 5,
  class: "vue-data-ui-watermark"
}, Pt = ["onClick"], Ot = { key: 0 }, St = { key: 1 }, Lt = ["innerHTML"], At = {
  __name: "vue-ui-rings",
  props: {
    config: {
      type: Object,
      default() {
        return {};
      }
    },
    dataset: {
      type: Array,
      default() {
        return [];
      }
    }
  },
  emits: ["selectLegend"],
  setup(Ne, { expose: Pe, emit: Oe }) {
    const y = Ne, { vue_ui_rings: Se } = He(), L = n(!1), V = v(() => !!y.dataset && y.dataset.length), A = n($e()), Le = n(null), z = n(!1), G = n(""), T = n(null), J = n(0), P = n(null), K = n(null), Q = n(null), Z = n(null), ee = n(null), te = n(0), le = n(0), oe = n(0), e = v({
      get: () => re(),
      set: (t) => t
    }), { userOptionsVisible: ae, setUserOptionsVisibility: se, keepUserOptionState: ne } = yt({ config: e.value });
    function re() {
      const t = xe({
        userConfig: y.config,
        defaultConfig: Se
      });
      return t.theme ? {
        ...xe({
          userConfig: Xe.vue_ui_rings[t.theme] || y.config,
          defaultConfig: t
        }),
        customPalette: je[t.theme] || x
      } : t;
    }
    Be(() => y.config, (t) => {
      e.value = re(), ue(), te.value += 1, le.value += 1, oe.value += 1;
    }, { deep: !0 });
    const R = n(null);
    De(() => {
      ue();
    });
    function ue() {
      if (Ye(y.dataset) ? Y({
        componentName: "VueUiRings",
        type: "dataset"
      }) : y.dataset.forEach((t, o) => {
        t.values.length || Y({
          componentName: "VueUiRings",
          type: "dataset"
        }), qe({
          datasetObject: t,
          requiredAttributes: ["name", "values"]
        }).forEach((l) => {
          Y({
            componentName: "VueUiRings",
            type: "datasetSerieAttribute",
            property: l,
            index: o
          });
        });
      }), e.value.responsive) {
        const t = st(() => {
          const { width: o, height: l } = nt({
            chart: P.value,
            title: e.value.style.chart.title.text ? K.value : null,
            legend: e.value.style.chart.legend.show ? Q.value : null,
            source: Z.value,
            noTitle: ee.value
          });
          i.value.width = o, i.value.height = l;
        });
        R.value = new ResizeObserver(t), R.value.observe(P.value.parentNode);
      }
      setTimeout(() => {
        L.value = !0;
      }, 600);
    }
    We(() => {
      R.value && R.value.disconnect();
    });
    const { isPrinting: ie, isImaging: ve, generatePdf: ce, generateImage: de } = ut({
      elementId: `rings_${A.value}`,
      fileName: e.value.style.chart.title.text || "vue-ui-rings"
    }), Ae = v(() => e.value.userOptions.show && !e.value.style.chart.title.text), pe = v(() => Je(e.value.customPalette)), w = n({
      showTable: e.value.table.show,
      showTooltip: e.value.style.chart.tooltip.show
    }), i = n({
      height: 360,
      width: 360
    }), Fe = v(() => Math.min(i.value.height, i.value.width)), c = n([]);
    function H(t) {
      c.value.includes(t) ? c.value = c.value.filter((o) => o !== t) : c.value.push(t), Oe("selectLegend", d.value.map((o) => ({
        name: o.name,
        color: o.color,
        value: o.value
      })));
    }
    const Ie = v(() => Math.max(
      ...U.value.filter((t) => !c.value.includes(t.uid)).map(({ value: t }) => t)
    ));
    function he(t) {
      return t / Ie.value;
    }
    const U = v(() => y.dataset.map(({ values: t, name: o, color: l = null }, a) => {
      const s = Ke(t).reduce((b, F) => b + F, 0);
      return {
        name: o,
        color: l || Te(l) || pe.value[a] || x[a] || x[a % x.length],
        value: s,
        proportion: s / y.dataset.map((b) => (b.values || []).reduce((F, Ue) => F + Ue, 0)).reduce((b, F) => b + F, 0),
        uid: $e()
      };
    })), ge = v(() => U.value.map((t) => ({
      ...t,
      shape: "circle",
      opacity: c.value.includes(t.uid) ? 0.5 : 1,
      segregate: () => H(t.uid),
      isSegregated: c.value.includes(t.uid)
    })).toSorted((t, o) => o.value - t.value)), Me = v(() => ({
      cy: "rings-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" : ""
    })), m = v(() => U.value.filter((t) => !c.value.includes(t.uid)).map(({ value: t }) => t).reduce((t, o) => t + o, 0)), d = v(() => U.value.filter((t) => !c.value.includes(t.uid)).map(({ name: t, value: o, color: l = null, uid: a }, s) => ({
      uid: a,
      name: t,
      color: l || Te(l) || pe.value[s] || x[s] || x[s % x.length],
      value: o,
      proportion: he(o),
      percentage: o / m.value * 100,
      strokeWidth: e.value.style.chart.layout.rings.strokeWidth * he(o)
    })).toSorted((t, o) => o.value - t.value));
    function Ve() {
      return d.value.map(
        ({ name: t, color: o, value: l, absoluteValues: a, percentage: s }) => ({
          name: t,
          color: o,
          value: l,
          absoluteValues: a,
          percentage: s
        })
      );
    }
    const g = v(() => Fe.value - e.value.style.chart.layout.rings.strokeWidth * 2), X = n(null);
    function ze(t, o) {
      if (c.value.length === y.dataset.length) return;
      X.value = {
        datapoint: o,
        seriesIndex: t,
        series: d.value,
        config: e.value
      }, T.value = t;
      const l = d.value[t], a = e.value.style.chart.tooltip.customFormat;
      if (tt(a) && lt(() => a({
        seriesIndex: t,
        datapoint: o,
        series: d.value,
        config: e.value
      })))
        G.value = a({
          seriesIndex: t,
          datapoint: o,
          series: d.value,
          config: e.value
        });
      else {
        let s = "";
        s += `<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>`, s += `<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 && (s += `<b>${_e(
          e.value.style.chart.layout.labels.dataLabels.formatter,
          l.value,
          N({
            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: o, seriesIndex: t }
        )}
      </b>`), e.value.style.chart.tooltip.showPercentage && (e.value.style.chart.tooltip.showValue ? s += `<span>(${N({
          v: l.value / m.value * 100,
          s: "%",
          r: e.value.style.chart.tooltip.roundingPercentage
        })})</span></div>` : s += `<b>${N({
          v: l.value / m.value * 100,
          s: "%",
          r: e.value.style.chart.tooltip.roundingPercentage
        })}</b></div>`), G.value = s;
      }
      z.value = !0;
    }
    const $ = v(() => {
      const t = d.value.map((l) => ({
        name: l.name,
        color: l.color
      })), o = d.value.map((l) => l.value);
      return { head: t, body: o };
    }), B = v(() => {
      const t = [
        ' <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>',
        N({ p: e.value.style.chart.layout.labels.dataLabels.prefix, v: m.value, s: e.value.style.chart.layout.labels.dataLabels.suffix, r: e.value.table.td.roundingValue }),
        "100%"
      ], o = $.value.head.map((s, b) => [
        {
          color: s.color,
          name: s.name
        },
        N({ p: e.value.style.chart.layout.labels.dataLabels.prefix, v: $.value.body[b], s: e.value.style.chart.layout.labels.dataLabels.suffix, r: e.value.table.td.roundingValue }),
        isNaN($.value.body[b] / m.value) ? "-" : ($.value.body[b] / m.value * 100).toFixed(e.value.table.td.roundingPercentage) + "%"
      ]), l = {
        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
      }, a = [
        e.value.table.columnNames.series,
        e.value.table.columnNames.value,
        e.value.table.columnNames.percentage
      ];
      return {
        head: t,
        body: o,
        config: l,
        colNames: a
      };
    });
    function fe() {
      Ge(() => {
        const t = $.value.head.map((a, s) => [[
          a.name
        ], [$.value.body[s]], [isNaN($.value.body[s] / m.value) ? "-" : $.value.body[s] / m.value * 100]]), o = [[e.value.style.chart.title.text], [e.value.style.chart.title.subtitle.text], [[""], ["val"], ["%"]]].concat(t), l = ot(o);
        at({ csvContent: l, title: e.value.style.chart.title.text || "vue-ui-rings" });
      });
    }
    const O = n(!1);
    function Re(t) {
      O.value = t, J.value += 1;
    }
    function ye() {
      w.value.showTable = !w.value.showTable;
    }
    function me() {
      w.value.showTooltip = !w.value.showTooltip;
    }
    const D = n(!1);
    function j() {
      D.value = !D.value;
    }
    return Pe({
      getData: Ve,
      generatePdf: ce,
      generateCsv: fe,
      generateImage: de,
      toggleTable: ye,
      toggleTooltip: me,
      toggleAnnotator: j
    }), (t, o) => (u(), f("div", {
      ref_key: "ringsChart",
      ref: P,
      class: W(`vue-ui-rings ${O.value ? "vue-data-ui-wrapper-fullscreen" : ""} ${e.value.useCssAnimation ? "" : "vue-ui-dna"}`),
      style: S(`font-family:${e.value.style.fontFamily};text-align:center;width:100%;background:${e.value.style.chart.backgroundColor};${e.value.responsive ? "height: 100%" : ""}`),
      id: `rings_${A.value}`,
      onMouseleave: o[3] || (o[3] = (l) => {
        T.value = null, z.value = !1, r(se)(!1);
      }),
      onMouseenter: o[4] || (o[4] = () => r(se)(!0))
    }, [
      e.value.userOptions.buttons.annotator ? (u(), _(ft, {
        key: 0,
        parent: P.value,
        backgroundColor: e.value.style.chart.backgroundColor,
        color: e.value.style.chart.color,
        active: D.value,
        onClose: j
      }, null, 8, ["parent", "backgroundColor", "color", "active"])) : k("", !0),
      Ae.value ? (u(), f("div", {
        key: 1,
        ref_key: "noTitle",
        ref: ee,
        class: "vue-data-ui-no-title-space",
        style: "height:36px; width: 100%;background:transparent"
      }, null, 512)) : k("", !0),
      e.value.style.chart.title.text ? (u(), f("div", {
        key: 2,
        ref_key: "chartTitle",
        ref: K,
        style: "width:100%;background:transparent"
      }, [
        (u(), _(rt, {
          key: `title_${te.value}`,
          config: {
            title: {
              cy: "rings-div-title",
              ...e.value.style.chart.title
            },
            subtitle: {
              cy: "rings-div-subtitle",
              ...e.value.style.chart.title.subtitle
            }
          }
        }, null, 8, ["config"]))
      ], 512)) : k("", !0),
      e.value.userOptions.show && V.value && (r(ne) || r(ae)) ? (u(), _(it, {
        ref_key: "details",
        ref: Le,
        key: `user_options_${J.value}`,
        backgroundColor: e.value.style.chart.backgroundColor,
        color: e.value.style.chart.color,
        isPrinting: r(ie),
        isImaging: r(ve),
        uid: A.value,
        hasTooltip: e.value.userOptions.buttons.tooltip && e.value.style.chart.tooltip.show,
        hasPdf: e.value.userOptions.buttons.pdf,
        hasXls: e.value.userOptions.buttons.csv,
        hasImg: e.value.userOptions.buttons.img,
        hasTable: e.value.userOptions.buttons.table,
        hasFullscreen: e.value.userOptions.buttons.fullscreen,
        isTooltip: w.value.showTooltip,
        isFullscreen: O.value,
        titles: { ...e.value.userOptions.buttonTitles },
        chartElement: P.value,
        position: e.value.userOptions.position,
        hasAnnotator: e.value.userOptions.buttons.annotator,
        isAnnotation: D.value,
        onToggleFullscreen: Re,
        onGeneratePdf: r(ce),
        onGenerateCsv: fe,
        onGenerateImage: r(de),
        onToggleTable: ye,
        onToggleTooltip: me,
        onToggleAnnotator: j,
        style: S({
          visibility: r(ne) ? r(ae) ? "visible" : "hidden" : "visible"
        })
      }, Ee({ _: 2 }, [
        t.$slots.optionTooltip ? {
          name: "optionTooltip",
          fn: p(() => [
            h(t.$slots, "optionTooltip", {}, void 0, !0)
          ]),
          key: "0"
        } : void 0,
        t.$slots.optionPdf ? {
          name: "optionPdf",
          fn: p(() => [
            h(t.$slots, "optionPdf", {}, void 0, !0)
          ]),
          key: "1"
        } : void 0,
        t.$slots.optionCsv ? {
          name: "optionCsv",
          fn: p(() => [
            h(t.$slots, "optionCsv", {}, void 0, !0)
          ]),
          key: "2"
        } : void 0,
        t.$slots.optionImg ? {
          name: "optionImg",
          fn: p(() => [
            h(t.$slots, "optionImg", {}, void 0, !0)
          ]),
          key: "3"
        } : void 0,
        t.$slots.optionTable ? {
          name: "optionTable",
          fn: p(() => [
            h(t.$slots, "optionTable", {}, void 0, !0)
          ]),
          key: "4"
        } : void 0,
        t.$slots.optionFullscreen ? {
          name: "optionFullscreen",
          fn: p(({ toggleFullscreen: l, isFullscreen: a }) => [
            h(t.$slots, "optionFullscreen", I(M({ toggleFullscreen: l, isFullscreen: a })), void 0, !0)
          ]),
          key: "5"
        } : void 0,
        t.$slots.optionAnnotator ? {
          name: "optionAnnotator",
          fn: p(({ toggleAnnotator: l, isAnnotator: a }) => [
            h(t.$slots, "optionAnnotator", I(M({ toggleAnnotator: l, isAnnotator: a })), void 0, !0)
          ]),
          key: "6"
        } : void 0
      ]), 1032, ["backgroundColor", "color", "isPrinting", "isImaging", "uid", "hasTooltip", "hasPdf", "hasXls", "hasImg", "hasTable", "hasFullscreen", "isTooltip", "isFullscreen", "titles", "chartElement", "position", "hasAnnotator", "isAnnotation", "onGeneratePdf", "onGenerateImage", "style"])) : k("", !0),
      V.value ? (u(), f("svg", {
        key: 4,
        xmlns: r(Qe),
        class: W({ "vue-data-ui-fullscreen--on": O.value, "vue-data-ui-fulscreen--off": !O.value }),
        viewBox: `0 0 ${i.value.width <= 0 ? 10 : i.value.width} ${i.value.height <= 0 ? 10 : i.value.height}`,
        style: S(`max-width:100%;overflow:visible;background:transparent;color:${e.value.style.chart.color}`)
      }, [
        be(gt),
        C("defs", null, [
          (u(!0), f(ke, null, Ce(d.value, (l, a) => (u(), f("radialGradient", {
            cx: "50%",
            cy: "30%",
            r: "50%",
            fx: "50%",
            fy: "50%",
            id: `gradient_${A.value}_${a}`
          }, [
            C("stop", {
              offset: "0%",
              "stop-color": r(Ze)(r(et)(l.color, 0.05), 100 - e.value.style.chart.layout.rings.gradient.intensity)
            }, null, 8, wt),
            C("stop", {
              offset: "100%",
              "stop-color": l.color
            }, null, 8, $t)
          ], 8, Ct))), 256))
        ]),
        (u(!0), f(ke, null, Ce(d.value, (l, a) => (u(), f("g", null, [
          C("circle", {
            class: W({
              "vue-ui-rings-item": L.value && e.value.useCssAnimation,
              "vue-rings-item-onload": !L.value && e.value.useCssAnimation,
              "vue-ui-rings-opacity": T.value !== null && T.value !== a
            }),
            style: S(`animation-delay:${a * 100}ms`),
            stroke: e.value.style.chart.layout.rings.stroke,
            cx: i.value.width / 2,
            cy: a === 0 ? i.value.height / 2 : i.value.height / 2 + g.value * d.value[0].proportion / 2 - g.value * l.proportion / 2 - 2 * (a + 1),
            r: r(q)(g.value * l.proportion / 2 * 0.9 <= 0 ? 1e-4 : g.value * l.proportion / 2 * 0.9),
            fill: e.value.style.chart.layout.rings.gradient.underlayerColor
          }, null, 14, Tt),
          C("circle", {
            class: W({
              "vue-ui-rings-item": L.value && e.value.useCssAnimation,
              "vue-rings-item-onload": !L.value && e.value.useCssAnimation,
              "vue-ui-rings-shadow": e.value.style.chart.layout.rings.useShadow,
              "vue-ui-rings-blur": T.value !== null && T.value !== a
            }),
            style: S(`animation-delay:${a * 100}ms`),
            stroke: e.value.style.chart.layout.rings.stroke,
            "stroke-width": l.strokeWidth < 0.5 ? 0.5 : l.strokeWidth,
            cx: i.value.width / 2,
            cy: a === 0 ? i.value.height / 2 : i.value.height / 2 + g.value * d.value[0].proportion / 2 - g.value * l.proportion / 2 - 2 * (a + 1),
            r: r(q)(g.value * l.proportion / 2 * 0.9 <= 0 ? 1e-4 : g.value * l.proportion / 2 * 0.9),
            fill: e.value.style.chart.layout.rings.gradient.show ? `url(#gradient_${A.value}_${a})` : l.color
          }, null, 14, _t),
          C("circle", {
            "data-cy-trap": "",
            stroke: "none",
            cx: i.value.width / 2,
            cy: a === 0 ? i.value.height / 2 : i.value.height / 2 + g.value * d.value[0].proportion / 2 - g.value * l.proportion / 2 - 2 * (a + 1),
            r: r(q)(g.value * l.proportion / 2 * 0.9 <= 0 ? 1e-4 : g.value * l.proportion / 2 * 0.9),
            fill: "transparent",
            onMouseenter: (s) => ze(a, l),
            onMouseleave: o[0] || (o[0] = (s) => {
              T.value = null, z.value = !1;
            })
          }, null, 40, xt)
        ]))), 256)),
        h(t.$slots, "svg", { svg: i.value }, void 0, !0)
      ], 14, kt)) : k("", !0),
      t.$slots.watermark ? (u(), f("div", Nt, [
        h(t.$slots, "watermark", I(M({ isPrinting: r(ie) || r(ve) })), void 0, !0)
      ])) : k("", !0),
      V.value ? k("", !0) : (u(), _(pt, {
        key: 6,
        config: {
          type: "rings",
          style: {
            backgroundColor: e.value.style.chart.backgroundColor,
            rings: {
              color: "#CCCCCC"
            }
          }
        }
      }, null, 8, ["config"])),
      C("div", {
        ref_key: "chartLegend",
        ref: Q
      }, [
        e.value.style.chart.legend.show ? (u(), _(dt, {
          key: `legend_${oe.value}`,
          legendSet: ge.value,
          config: Me.value,
          onClickMarker: o[1] || (o[1] = ({ legend: l }) => H(l.uid))
        }, {
          item: p(({ legend: l, index: a }) => [
            C("div", {
              "data-cy-legend-item": "",
              onClick: (s) => H(l.uid),
              style: S(`opacity:${c.value.includes(l.uid) ? 0.5 : 1}`)
            }, [
              we(E(l.name) + ": " + E(r(_e)(
                e.value.style.chart.layout.labels.dataLabels.formatter,
                l.value,
                r(N)({
                  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.legend.roundingValue
                }),
                { datapoint: l, seriesIndex: a }
              )) + " ", 1),
              c.value.includes(l.uid) ? (u(), f("span", St, " ( - % ) ")) : (u(), f("span", Ot, " (" + E(isNaN(l.value / m.value) ? "-" : r(N)({
                v: l.value / m.value * 100,
                s: "%",
                r: e.value.style.chart.legend.roundingPercentage
              })) + ") ", 1))
            ], 12, Pt)
          ]),
          _: 1
        }, 8, ["legendSet", "config"])) : h(t.$slots, "legend", {
          key: 1,
          legend: ge.value
        }, void 0, !0)
      ], 512),
      t.$slots.source ? (u(), f("div", {
        key: 7,
        ref_key: "source",
        ref: Z,
        dir: "auto"
      }, [
        h(t.$slots, "source", {}, void 0, !0)
      ], 512)) : k("", !0),
      be(vt, {
        show: w.value.showTooltip && z.value && c.value.length < y.dataset.length,
        backgroundColor: e.value.style.chart.tooltip.backgroundColor,
        color: e.value.style.chart.tooltip.color,
        borderRadius: e.value.style.chart.tooltip.borderRadius,
        borderColor: e.value.style.chart.tooltip.borderColor,
        borderWidth: e.value.style.chart.tooltip.borderWidth,
        fontSize: e.value.style.chart.tooltip.fontSize,
        backgroundOpacity: e.value.style.chart.tooltip.backgroundOpacity,
        position: e.value.style.chart.tooltip.position,
        offsetY: e.value.style.chart.tooltip.offsetY,
        parent: P.value,
        content: G.value,
        isFullscreen: O.value,
        isCustom: e.value.style.chart.tooltip.customFormat && typeof e.value.style.chart.tooltip.customFormat == "function"
      }, {
        "tooltip-before": p(() => [
          h(t.$slots, "tooltip-before", I(M({ ...X.value })), void 0, !0)
        ]),
        "tooltip-after": p(() => [
          h(t.$slots, "tooltip-after", I(M({ ...X.value })), void 0, !0)
        ]),
        _: 3
      }, 8, ["show", "backgroundColor", "color", "borderRadius", "borderColor", "borderWidth", "fontSize", "backgroundOpacity", "position", "offsetY", "parent", "content", "isFullscreen", "isCustom"]),
      V.value ? (u(), _(ht, {
        key: 8,
        hideDetails: "",
        config: {
          open: w.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(() => [
          (u(), _(ct, {
            key: `table_${le.value}`,
            colNames: B.value.colNames,
            head: B.value.head,
            body: B.value.body,
            config: B.value.config,
            title: `${e.value.style.chart.title.text}${e.value.style.chart.title.subtitle.text ? ` : ${e.value.style.chart.title.subtitle.text}` : ""}`,
            onClose: o[2] || (o[2] = (l) => w.value.showTable = !1)
          }, {
            th: p(({ th: l }) => [
              C("div", {
                innerHTML: l,
                style: { display: "flex", "align-items": "center" }
              }, null, 8, Lt)
            ]),
            td: p(({ td: l }) => [
              we(E(l.name || l), 1)
            ]),
            _: 1
          }, 8, ["colNames", "head", "body", "config", "title"]))
        ]),
        _: 1
      }, 8, ["config"])) : k("", !0)
    ], 46, bt));
  }
}, Yt = /* @__PURE__ */ mt(At, [["__scopeId", "data-v-fd609855"]]);
export {
  Yt as default
};
