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