import { useCssVars as Ae, computed as K, ref as h, watch as de, onMounted as Ne, onBeforeUnmount as Ie, createElementBlock as V, openBlock as b, unref as v, normalizeStyle as ne, createBlock as Q, createCommentVNode as U, createVNode as ve, createSlots as _e, withCtx as S, renderSlot as $, normalizeProps as G, guardReactiveProps as L, normalizeClass as ye, createElementVNode as he, Fragment as Re, renderList as We, toDisplayString as be, createTextVNode as Ve, nextTick as we } from "vue";
import { u as Ue, c as Ce, a6 as Be, v as De, t as Ee, p as se, a as Ge, o as Le, e as ke, g as He, f as je, X as Xe, q as qe, r as Ye, x as Ze } from "./index-gC66Se26.js";
import { _ as Je } from "./Title-Co3F59jq.js";
import { u as Ke, U as Qe } from "./usePrinter-KMFl0n0s.js";
import { t as et, u as tt, d as ot } from "./useResponsive-Cw4oZ8sQ.js";
import at from "./vue-ui-accordion-j2beIma_.js";
import { D as lt } from "./DataTable-C_28ZqiP.js";
import { u as $e } from "./useNestedProp-BusTOV-6.js";
import { _ as nt } from "./PackageVersion-39l3KkzC.js";
import { _ as st } from "./Tooltip-Cr89wMKa.js";
import { P as rt } from "./PenAndPaper-CmcfpltX.js";
import { u as it } from "./useUserOptionState-BIvW1Kz7.js";
import { u as ut } from "./useChartAccessibility-BWojgys7.js";
import { u as ct } from "./usePanZoom-CUkkqW81.js";
import dt from "./BaseIcon-DqYzMisq.js";
import { _ as vt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
function xe({
  word: w,
  fontSize: m,
  pad: f,
  canvas: i,
  ctx: u,
  svg: l
}) {
  u.save(), u.font = `${l.style && l.style.bold ? "bold " : ""}${m}px Arial`;
  const a = u.measureText(w.name), n = Math.ceil(a.width) + 2 + (f ? f * 2 : 0), r = Math.ceil(m) + 2 + (f ? f * 2 : 0);
  i.width = n, i.height = r, u.clearRect(0, 0, n, r), u.font = `${l.style && l.style.bold ? "bold " : ""}${m}px Arial`, u.textAlign = "center", u.textBaseline = "middle", u.fillStyle = "black", u.fillText(w.name, n / 2, r / 2);
  const M = u.getImageData(0, 0, n, r).data, x = [];
  for (let P = 0; P < r; P += 1)
    for (let e = 0; e < n; e += 1)
      M[(P * n + e) * 4 + 3] > 1 && x.push([e, P]);
  return u.restore(), { w: n, h: r, wordMask: x };
}
function Te({ mask: w, maskW: m, maskH: f, wx: i, wy: u, wordMask: l }) {
  for (let a = 0; a < l.length; a += 1) {
    const n = i + l[a][0], r = u + l[a][1];
    if (n < 0 || r < 0 || n >= m || r >= f || w[r * m + n]) return !1;
  }
  return !0;
}
function Se({ mask: w, maskW: m, maskH: f, wx: i, wy: u, wordMask: l }) {
  for (let a = 0; a < l.length; a += 1) {
    const n = i + l[a][0], r = u + l[a][1];
    n >= 0 && r >= 0 && n < m && r < f && (w[r * m + n] = 1);
  }
}
function ht({ wordMask: w, w: m, h: f, dilation: i }) {
  const u = new Set(w.map(([a, n]) => `${a},${n}`)), l = new Set(u);
  for (let [a, n] of w)
    for (let r = -i; r <= i; r += 1)
      for (let F = -i; F <= i; F += 1) {
        if (r === 0 && F === 0) continue;
        const M = a + r, x = n + F;
        M >= 0 && M < m && x >= 0 && x < f && l.add(`${M},${x}`);
      }
  return Array.from(l).map((a) => a.split(",").map(Number));
}
function ft({
  words: w,
  proximity: m = 0,
  svg: f
}) {
  const { width: i, height: u } = f, l = Math.round(i), a = Math.round(u), n = 1, r = f.minFontSize, F = f.maxFontSize, M = w.map((p) => p.value), x = Math.min(...M), P = Math.max(...M), e = new Uint8Array(l * a), R = document.createElement("canvas"), H = R.getContext("2d", { willReadFrequently: !0 });
  R.width = l, R.height = a;
  const j = 6, ee = 2, te = 2, X = 1, q = Math.floor(l / 2), c = Math.floor(a / 2), re = [...w].sort((p, z) => z.value - p.value), Y = [];
  for (const p of re) {
    let z = r;
    P !== x && (z = (p.value - x) / (P - x) * (F - r) + r), z = Math.max(r, Math.min(F, z));
    let W = !1, O = z;
    for (; !W && O >= n; ) {
      let { w: A, h: N, wordMask: d } = xe({
        word: p,
        fontSize: O,
        pad: m,
        canvas: R,
        ctx: H,
        svg: f
      });
      d = ht({ wordMask: d, w: A, h: N, dilation: 2 });
      let I = 0, _ = 0;
      for (; I < Math.max(l, a) && !W && _ < 1e4; ) {
        for (let T = 0; T < 360; T += j) {
          _ += 1;
          const g = Math.round(q + I * Math.cos(T * Math.PI / 180) - A / 2), C = Math.round(c + I * Math.sin(T * Math.PI / 180) - N / 2);
          if (!(g < 0 || C < 0 || g + A > l || C + N > a) && Te({ mask: e, maskW: l, maskH: a, wx: g, wy: C, wordMask: d })) {
            Y.push({ ...p, x: g - l / 2, y: C - a / 2, fontSize: O, width: A, height: N, angle: 0 }), Se({ mask: e, maskW: l, maskH: a, wx: g, wy: C, wordMask: d }), W = !0;
            break;
          }
        }
        I += ee;
      }
      W || (O -= 1);
    }
    if (!W && O < n) {
      O = n;
      const { w: A, h: N, wordMask: d } = xe({
        word: p,
        fontSize: O,
        pad: m,
        canvas: R,
        ctx: H,
        svg: f
      });
      let I = 0, _ = 0;
      for (; I < Math.max(l, a) && !W && _ < 25e3; ) {
        for (let T = 0; T < 360; T += te) {
          _ += 1;
          const g = Math.round(q + I * Math.cos(T * Math.PI / 180) - A / 2), C = Math.round(c + I * Math.sin(T * Math.PI / 180) - N / 2);
          if (!(g < 0 || C < 0 || g + A > l || C + N > a) && Te({ mask: e, maskW: l, maskH: a, wx: g, wy: C, wordMask: d })) {
            Y.push({ ...p, x: g - l / 2, y: C - a / 2, fontSize: O, width: A, height: N, angle: 0 }), Se({ mask: e, maskW: l, maskH: a, wx: g, wy: C, wordMask: d }), W = !0;
            break;
          }
        }
        I += X;
      }
    }
  }
  return Y.sort((p, z) => z.fontSize - p.fontSize);
}
const mt = ["id"], pt = ["xmlns", "viewBox"], gt = ["width", "height"], yt = ["transform"], bt = ["fill", "font-weight", "x", "y", "font-size", "transform", "onMouseover"], wt = {
  key: 4,
  class: "vue-data-ui-watermark"
}, Ct = {
  key: 5,
  "data-dom-to-png-ignore": "",
  class: "reset-wrapper"
}, kt = ["innerHTML"], $t = {
  __name: "vue-ui-word-cloud",
  props: {
    config: {
      type: Object,
      default() {
        return {};
      }
    },
    dataset: {
      type: [Array, String],
      default() {
        return [];
      }
    }
  },
  setup(w, { expose: m }) {
    Ae((t) => ({
      "1461b4f2": t.slicerColor
    }));
    const { vue_ui_word_cloud: f } = Ue(), i = w, u = K({
      get() {
        return !!i.dataset && i.dataset.length;
      },
      set(t) {
        return t;
      }
    }), l = h(Ce()), a = h(0), n = h(null), r = h(null), F = h(null), M = h(0), x = h(0), P = h(!1), e = K({
      get: () => q(),
      set: (t) => t
    }), R = h(H());
    function H() {
      return typeof i.dataset == "string" ? Be(i.dataset) : i.dataset.map((t, s) => ({
        ...t,
        value: De(t.value)
      }));
    }
    de(() => i.dataset, () => {
      R.value = H(), T();
    });
    const { userOptionsVisible: j, setUserOptionsVisibility: ee, keepUserOptionState: te } = it({ config: e.value }), { svgRef: X } = ut({ config: e.value.style.chart.title });
    function q() {
      const t = $e({
        userConfig: i.config,
        defaultConfig: f
      });
      return t.theme ? {
        ...$e({
          userConfig: Ge.vue_ui_word_cloud[t.theme] || i.config,
          defaultConfig: t
        }),
        customPalette: Ee[t.theme] || se
      } : t;
    }
    de(() => i.config, (t) => {
      e.value = q(), j.value = !e.value.userOptions.showOnChartHover, z(), M.value += 1, x.value += 1, d.value.showTable = e.value.table.show, d.value.showTooltip = e.value.style.chart.tooltip.show;
    }, { deep: !0 });
    const c = h({
      width: e.value.style.chart.width,
      height: e.value.style.chart.height,
      maxFontSize: e.value.style.chart.words.maxFontSize,
      minFontSize: e.value.style.chart.words.minFontSize,
      bold: e.value.style.chart.words.bold
    }), re = ot(() => {
      T();
    }, 10), Y = et(() => {
      const { width: t, height: s } = tt({
        chart: n.value,
        title: e.value.style.chart.title.text ? r.value : null,
        source: F.value
      });
      requestAnimationFrame(() => {
        c.value.width = t, c.value.height = s, we(re);
      });
    }), p = h(null);
    Ne(z);
    function z() {
      Le(i.dataset) ? ke({
        componentName: "VueUiWordCloud",
        type: "dataset"
      }) : R.value.forEach((t, s) => {
        He({
          datasetObject: t,
          requiredAttributes: ["name", "value"]
        }).forEach((o) => {
          u.value = !1, ke({
            componentName: "VueUiWordCloud",
            type: "datasetSerieAttribute",
            property: o,
            index: s
          });
        });
      }), e.value.responsive && (p.value = new ResizeObserver(Y), p.value.observe(n.value.parentNode));
    }
    Ie(() => {
      p.value && p.value.disconnect();
    });
    const { isPrinting: W, isImaging: O, generatePdf: A, generateImage: N } = Ke({
      elementId: `wordCloud_${l.value}`,
      fileName: e.value.style.chart.title.text || "vue-ui-word-cloud",
      options: e.value.userOptions.print
    }), d = h({
      showTable: e.value.table.show,
      showTooltip: e.value.style.chart.tooltip.show
    });
    function I(t, s, o = "Arial") {
      const y = document.createElement("canvas").getContext("2d");
      return y.font = `${s}px ${e.value.style.chart.words.bold ? "bold" : "normal"} ${o}`, {
        width: y.measureText(t).width + e.value.style.chart.words.proximity,
        height: s
      };
    }
    const _ = h([]);
    de(() => i.dataset, T, { immediate: !0 });
    function T() {
      const t = [...R.value].map((y) => y.value), s = Math.max(...t), o = Math.min(...t), k = [...R.value].map((y, B) => {
        let D = (y.value - o) / (s - o) * (c.value.maxFontSize - c.value.minFontSize) + c.value.minFontSize;
        D = isNaN(D) ? c.value.minFontSize : D;
        const ge = I(y.name, D);
        return {
          ...y,
          id: Ce(),
          fontSize: D,
          width: ge.width,
          height: ge.height,
          color: e.value.style.chart.words.usePalette ? e.value.customPalette[B] || e.value.customPalette[B % e.value.customPalette.length] || se[B] || se[B % se.length] : e.value.style.chart.words.color
        };
      });
      _.value = ft({
        words: k,
        svg: c.value,
        proximity: e.value.style.chart.words.proximity
      });
    }
    const g = K(() => {
      const t = _.value.map((o) => ({
        name: o.name,
        color: o.color
      })), s = _.value.map((o) => o.value);
      return { head: t, body: s };
    });
    function C() {
      we(() => {
        const t = g.value.head.map((k, y) => [[
          k.name
        ], [g.value.body[y]]]), s = [[e.value.style.chart.title.text], [e.value.style.chart.title.subtitle.text], [[""], [e.value.table.columnNames.value]]].concat(t), o = qe(s);
        Ye({ csvContent: o, title: e.value.style.chart.title.text || "vue-ui-word-cloud" });
      });
    }
    const oe = K(() => {
      const t = [
        e.value.table.columnNames.series,
        e.value.table.columnNames.value
      ], s = g.value.head.map((y, B) => {
        const D = je({ p: e.value.table.td.prefix, v: g.value.body[B], s: e.value.table.td.suffix, r: e.value.table.td.roundingValue });
        return [
          {
            color: y.color,
            name: y.name
          },
          D
        ];
      }), o = {
        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
        ],
        head: t,
        body: s,
        config: o
      };
    }), ae = h(!1);
    function Fe(t) {
      ae.value = t, a.value += 1;
    }
    function Me() {
      return _.value;
    }
    function fe() {
      d.value.showTable = !d.value.showTable;
    }
    function me() {
      d.value.showTooltip = !d.value.showTooltip;
    }
    const Z = h(!1);
    function ie() {
      Z.value = !Z.value;
    }
    const Pe = K(() => !Z.value && e.value.style.chart.zoom.show), { viewBox: le, resetZoom: pe, isZoom: ze } = ct(X, {
      x: 0,
      y: 0,
      width: c.value.width <= 0 ? 10 : c.value.width,
      height: c.value.height <= 0 ? 10 : c.value.height
    }, 1, Pe);
    m({
      getData: Me,
      generateCsv: C,
      generatePdf: A,
      generateImage: N,
      toggleTable: fe,
      toggleTooltip: me,
      toggleAnnotator: ie
    });
    const E = h(null), J = h(!1), ue = h(""), ce = h(null);
    function Oe(t) {
      if (!d.value.showTooltip) return;
      E.value = t.id, ce.value = { datapoint: t, config: e.value };
      const s = e.value.style.chart.tooltip.customFormat;
      if (J.value = !1, Ze(s))
        try {
          const o = s({
            datapoint: t,
            config: e.value
          });
          typeof o == "string" && (ue.value = o, J.value = !0);
        } catch {
          console.warn("Custom format cannot be applied."), J.value = !1;
        }
      if (!J.value) {
        let o = `<svg viewBox="0 0 10 10" height="${e.value.style.chart.tooltip.fontSize}"><circle cx="5" cy="5" r="5" fill="${t.color}"/></svg><span>${t.name}:</span><b>${(t.value || 0).toFixed(e.value.style.chart.tooltip.roundingValue)}</b>`;
        ue.value = `<div dir="auto" style="display:flex; gap:4px; align-items:center; jsutify-content:center;">${o}</div>`;
      }
      P.value = !0;
    }
    return (t, s) => (b(), V("div", {
      class: "vue-ui-word-cloud",
      ref_key: "wordCloudChart",
      ref: n,
      id: `wordCloud_${l.value}`,
      style: ne(`width: 100%; font-family:${e.value.style.fontFamily};background:${e.value.style.chart.backgroundColor};${e.value.responsive ? "height:100%" : ""}`),
      onMouseenter: s[3] || (s[3] = () => v(ee)(!0)),
      onMouseleave: s[4] || (s[4] = () => v(ee)(!1))
    }, [
      e.value.userOptions.buttons.annotator ? (b(), Q(rt, {
        key: 0,
        svgRef: v(X),
        backgroundColor: e.value.style.chart.backgroundColor,
        color: e.value.style.chart.color,
        active: Z.value,
        onClose: ie
      }, null, 8, ["svgRef", "backgroundColor", "color", "active"])) : U("", !0),
      e.value.style.chart.title.text ? (b(), V("div", {
        key: 1,
        ref_key: "chartTitle",
        ref: r,
        style: "width:100%;background:transparent;padding-bottom:24px"
      }, [
        (b(), Q(Je, {
          key: `title_${M.value}`,
          config: {
            title: {
              ...e.value.style.chart.title
            },
            subtitle: {
              ...e.value.style.chart.title.subtitle
            }
          }
        }, null, 8, ["config"]))
      ], 512)) : U("", !0),
      e.value.userOptions.show && u.value && (v(te) || v(j)) ? (b(), Q(Qe, {
        ref: "details",
        key: `user_option_${a.value}`,
        backgroundColor: e.value.style.chart.backgroundColor,
        color: e.value.style.chart.color,
        isPrinting: v(W),
        isImaging: v(O),
        uid: l.value,
        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,
        isFullscreen: ae.value,
        titles: { ...e.value.userOptions.buttonTitles },
        chartElement: n.value,
        position: e.value.userOptions.position,
        hasTooltip: e.value.style.chart.tooltip.show && e.value.userOptions.buttons.tooltip,
        isTooltip: d.value.showTooltip,
        hasAnnotator: e.value.userOptions.buttons.annotator,
        isAnnotation: Z.value,
        onToggleFullscreen: Fe,
        onGeneratePdf: v(A),
        onGenerateCsv: C,
        onGenerateImage: v(N),
        onToggleTable: fe,
        onToggleTooltip: me,
        onToggleAnnotator: ie,
        style: ne({
          visibility: v(te) ? v(j) ? "visible" : "hidden" : "visible"
        })
      }, _e({ _: 2 }, [
        t.$slots.menuIcon ? {
          name: "menuIcon",
          fn: S(({ isOpen: o, color: k }) => [
            $(t.$slots, "menuIcon", G(L({ isOpen: o, color: k })), void 0, !0)
          ]),
          key: "0"
        } : void 0,
        t.$slots.optionPdf ? {
          name: "optionPdf",
          fn: S(() => [
            $(t.$slots, "optionPdf", {}, void 0, !0)
          ]),
          key: "1"
        } : void 0,
        t.$slots.optionCsv ? {
          name: "optionCsv",
          fn: S(() => [
            $(t.$slots, "optionCsv", {}, void 0, !0)
          ]),
          key: "2"
        } : void 0,
        t.$slots.optionImg ? {
          name: "optionImg",
          fn: S(() => [
            $(t.$slots, "optionImg", {}, void 0, !0)
          ]),
          key: "3"
        } : void 0,
        t.$slots.optionTable ? {
          name: "optionTable",
          fn: S(() => [
            $(t.$slots, "optionTable", {}, void 0, !0)
          ]),
          key: "4"
        } : void 0,
        t.$slots.optionFullscreen ? {
          name: "optionFullscreen",
          fn: S(({ toggleFullscreen: o, isFullscreen: k }) => [
            $(t.$slots, "optionFullscreen", G(L({ toggleFullscreen: o, isFullscreen: k })), void 0, !0)
          ]),
          key: "5"
        } : void 0,
        t.$slots.optionAnnotator ? {
          name: "optionAnnotator",
          fn: S(({ toggleAnnotator: o, isAnnotator: k }) => [
            $(t.$slots, "optionAnnotator", G(L({ toggleAnnotator: o, isAnnotator: k })), void 0, !0)
          ]),
          key: "6"
        } : void 0
      ]), 1032, ["backgroundColor", "color", "isPrinting", "isImaging", "uid", "hasPdf", "hasXls", "hasImg", "hasTable", "hasFullscreen", "isFullscreen", "titles", "chartElement", "position", "hasTooltip", "isTooltip", "hasAnnotator", "isAnnotation", "onGeneratePdf", "onGenerateImage", "style"])) : U("", !0),
      u.value ? (b(), V("svg", {
        key: 3,
        ref_key: "svgRef",
        ref: X,
        class: ye({ "vue-data-ui-fullscreen--on": ae.value, "vue-data-ui-fulscreen--off": !ae.value }),
        xmlns: v(Xe),
        viewBox: `${v(le).x} ${v(le).y} ${v(le).width} ${v(le).height}`,
        style: "overflow:hidden;background:transparent;"
      }, [
        ve(nt),
        t.$slots["chart-background"] ? (b(), V("foreignObject", {
          key: 0,
          x: 0,
          y: 0,
          width: c.value.width <= 0 ? 10 : c.value.width,
          height: c.value.height <= 0 ? 10 : c.value.height,
          style: {
            pointerEvents: "none"
          }
        }, [
          $(t.$slots, "chart-background", {}, void 0, !0)
        ], 8, gt)) : U("", !0),
        he("g", {
          transform: `translate(${(c.value.width <= 0 ? 10 : c.value.width) / 2}, ${(c.value.height <= 0 ? 10 : c.value.height) / 2})`
        }, [
          (b(!0), V(Re, null, We(_.value, (o, k) => (b(), V("g", null, [
            (b(), V("text", {
              fill: o.color,
              "font-weight": e.value.style.chart.words.bold ? "bold" : "normal",
              key: k,
              x: o.x,
              y: o.y,
              "font-size": o.fontSize,
              transform: `translate(${o.width / 2}, ${o.height / 2})`,
              class: ye({ animated: e.value.useCssAnimation, "word-selected": E.value && E.value === o.id && d.value.showTooltip, "word-not-selected": E.value && E.value !== o.id && d.value.showTooltip }),
              "text-anchor": "middle",
              "dominant-baseline": "central",
              onMouseover: (y) => Oe(o),
              onMouseleave: s[0] || (s[0] = (y) => {
                E.value = null, P.value = !1;
              }),
              style: ne(`animation-delay:${k * e.value.animationDelayMs}ms !important;`)
            }, be(o.name), 47, bt))
          ]))), 256))
        ], 8, yt),
        $(t.$slots, "svg", {
          svg: { height: c.value.height, width: c.value.width }
        }, void 0, !0)
      ], 10, pt)) : U("", !0),
      t.$slots.watermark ? (b(), V("div", wt, [
        $(t.$slots, "watermark", G(L({ isPrinting: v(W) || v(O) })), void 0, !0)
      ])) : U("", !0),
      v(ze) ? (b(), V("div", Ct, [
        $(t.$slots, "reset-action", { reset: v(pe) }, () => [
          he("button", {
            "data-cy-reset": "",
            tabindex: "0",
            role: "button",
            class: "vue-data-ui-refresh-button",
            style: ne({
              background: e.value.style.chart.backgroundColor
            }),
            onClick: s[1] || (s[1] = (o) => v(pe)(!0))
          }, [
            ve(dt, {
              name: "refresh",
              stroke: e.value.style.chart.color
            }, null, 8, ["stroke"])
          ], 4)
        ], !0)
      ])) : U("", !0),
      ve(st, {
        show: d.value.showTooltip && P.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: n.value,
        content: ue.value,
        isCustom: J.value
      }, {
        "tooltip-before": S(() => [
          $(t.$slots, "tooltip-before", G(L({ ...ce.value })), void 0, !0)
        ]),
        "tooltip-after": S(() => [
          $(t.$slots, "tooltip-after", G(L({ ...ce.value })), void 0, !0)
        ]),
        _: 3
      }, 8, ["show", "backgroundColor", "color", "fontSize", "borderRadius", "borderColor", "borderWidth", "backgroundOpacity", "position", "offsetY", "parent", "content", "isCustom"]),
      t.$slots.source ? (b(), V("div", {
        key: 6,
        ref_key: "source",
        ref: F,
        dir: "auto"
      }, [
        $(t.$slots, "source", {}, void 0, !0)
      ], 512)) : U("", !0),
      u.value ? (b(), Q(at, {
        key: 7,
        hideDetails: "",
        config: {
          open: d.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: S(() => [
          (b(), Q(lt, {
            key: `table_${x.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: s[2] || (s[2] = (o) => d.value.showTable = !1)
          }, {
            th: S(({ th: o }) => [
              he("div", {
                innerHTML: o,
                style: { display: "flex", "align-items": "center" }
              }, null, 8, kt)
            ]),
            td: S(({ td: o }) => [
              Ve(be(o.name || o), 1)
            ]),
            _: 1
          }, 8, ["colNames", "head", "body", "config", "title"]))
        ]),
        _: 1
      }, 8, ["config"])) : U("", !0)
    ], 44, mt));
  }
}, Bt = /* @__PURE__ */ vt($t, [["__scopeId", "data-v-d3519257"]]);
export {
  Bt as default
};
