import { useCssVars as Ie, computed as h, ref as p, watch as $e, onMounted as Be, openBlock as o, createElementBlock as n, normalizeClass as K, normalizeStyle as x, unref as u, createBlock as U, createCommentVNode as c, createSlots as Re, withCtx as w, renderSlot as f, normalizeProps as E, guardReactiveProps as X, createVNode as oe, Fragment as A, renderList as S, createElementVNode as i, toDisplayString as b, withKeys as Ge, createTextVNode as Ue, nextTick as Ee } from "vue";
import { u as Xe, o as He, e as Ce, c as se, t as De, C as Ye, g as je, N as ue, X as We, G as ne, i as V, f as O, v as T, x as qe, y as Ke, q as Je, r as Qe } from "./index-BbPeL8Gp.js";
import { _ as Ze } from "./Title-aSAft5dl.js";
import { u as et, U as tt } from "./usePrinter-DaybDVqP.js";
import { _ as lt } from "./Tooltip-smutPF--.js";
import at from "./vue-ui-skeleton-Bniq21d9.js";
import ot from "./BaseIcon-CmiukQBl.js";
import st from "./vue-ui-accordion-5d5iVpr7.js";
import { u as Le } from "./useNestedProp-BN8claGG.js";
import { _ as ut } from "./PackageVersion-CxJghxYD.js";
import { P as nt } from "./PenAndPaper-ZdZEumki.js";
import { u as it } from "./useUserOptionState-BIvW1Kz7.js";
import { _ as rt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
const vt = ["id"], dt = {
  key: 2,
  style: "width:100%;background:transparent"
}, yt = ["xmlns", "viewBox"], ct = ["x", "y", "width", "height", "fill", "stroke", "stroke-width"], ht = ["x", "y", "width", "height", "fill", "stroke", "stroke-width"], pt = ["font-size", "font-weight", "fill", "x", "y"], gt = ["x", "y", "width", "height", "onMouseover"], ft = { key: 0 }, bt = ["font-size", "fill", "x", "y", "font-weight"], mt = { key: 0 }, xt = ["text-anchor", "font-size", "fill", "font-weight", "transform"], wt = { key: 1 }, _t = ["x", "y", "width", "height", "stroke", "stroke-width"], kt = { key: 2 }, $t = ["id"], Ct = ["stop-color"], Lt = ["stop-color"], At = ["x", "y", "font-size", "fill"], Tt = ["x", "y", "height", "rx", "fill"], zt = ["x", "y", "font-size", "fill"], Mt = ["stroke", "x1", "x2", "y1", "y2"], St = ["fill", "d"], Ot = { key: 3 }, Nt = {
  id: "colorScaleHorizontal",
  x1: "0%",
  x2: "100%",
  y1: "0%",
  y2: "0%"
}, Ft = ["stop-color"], Vt = ["stop-color"], Pt = ["x", "y", "width", "height", "rx"], It = ["x", "y", "font-size", "fill"], Bt = ["x", "y", "font-size", "fill"], Rt = ["stroke", "x1", "x2", "y1", "y2"], Gt = ["fill", "d"], Ut = {
  key: 5,
  class: "vue-data-ui-watermark"
}, Et = {
  key: 6,
  ref: "source",
  dir: "auto"
}, Xt = { class: "vue-ui-data-table" }, Ht = { key: 0 }, Dt = ["data-cell"], Yt = { style: { display: "flex", "align-items": "center", gap: "5px", "justify-content": "flex-end", width: "100%", "padding-right": "3px" } }, jt = ["data-cell"], Wt = { style: { display: "flex", "align-items": "center", gap: "5px", "justify-content": "flex-end", width: "100%", "padding-right": "3px" } }, qt = {
  __name: "vue-ui-heatmap",
  props: {
    config: {
      type: Object,
      default() {
        return {};
      }
    },
    dataset: {
      type: Array,
      default() {
        return [];
      }
    }
  },
  setup(H, { expose: Ae }) {
    const r = H;
    Ie((t) => ({
      "035c69dc": t.tdo
    }));
    const { vue_ui_heatmap: Te } = Xe(), D = h(() => !!r.dataset && r.dataset.length);
    He(r.dataset) && Ce({
      componentName: "VueUiHeatmap",
      type: "dataset"
    });
    const P = p(se()), Y = p(null), ze = p(null), J = p(!1), Q = p(""), ie = p(void 0), I = p(null), re = p(0), ve = p(null), Me = p(null), de = p(!1), ye = p(0), e = h({
      get: () => ge(),
      set: (t) => t
    }), { userOptionsVisible: ce, setUserOptionsVisibility: he, keepUserOptionState: pe } = it({ config: e.value });
    function ge() {
      const t = Le({
        userConfig: r.config,
        defaultConfig: Te
      });
      let l = {};
      return t.theme ? l = {
        ...Le({
          userConfig: De.vue_ui_heatmap[t.theme] || r.config,
          defaultConfig: t
        })
      } : l = t, r.config && Ye(r.config, "style.layout.dataLabels.xAxis.showOnlyAtModulo") ? l.style.layout.dataLabels.xAxis.showOnlyAtModulo = r.config.style.layout.dataLabels.xAxis.showOnlyAtModulo : l.style.layout.dataLabels.xAxis.showOnlyAtModulo = null, l;
    }
    $e(() => r.config, (t) => {
      e.value = ge(), Z(), ye.value += 1;
    }, { deep: !0 }), $e(() => r.dataset, () => {
      Z();
    }, { deep: !0 });
    const { isPrinting: fe, isImaging: be, generatePdf: me, generateImage: xe } = et({
      elementId: `heatmap__${P.value}`,
      fileName: e.value.style.title.text || "vue-ui-heatmap"
    }), Se = h(() => e.value.userOptions.show && !e.value.style.title.text), _ = p({
      showTable: e.value.table.show,
      showTooltip: e.value.style.tooltip.show
    }), Oe = h(() => e.value.table.responsiveBreakpoint);
    function Ne() {
      new ResizeObserver((l) => {
        l.forEach((s) => {
          de.value = s.contentRect.width < Oe.value;
        });
      }).observe(ve.value);
    }
    Be(Z);
    function Z() {
      Ne();
    }
    const N = h(() => Math.max(...r.dataset.flatMap((t) => (t.values || []).length))), k = h(() => {
      const t = e.value.style.layout.padding.top + e.value.style.layout.padding.bottom + r.dataset.length * e.value.style.layout.cells.height, l = e.value.style.layout.padding.left + e.value.style.layout.padding.right + (N.value < r.dataset.length ? r.dataset.length : N.value) * e.value.style.layout.cells.height, s = t + (e.value.style.legend.show ? e.value.style.legend.position === "right" ? 0 : e.value.style.layout.cells.height * 2 : 0);
      return {
        height: t,
        heightWithLegend: s,
        width: l
      };
    }), j = h(() => e.value.style.legend.position), a = h(() => ({
      top: e.value.style.layout.padding.top,
      left: e.value.style.layout.padding.left,
      right: k.value.width - e.value.style.layout.padding.right - (j.value === "right" && e.value.style.legend.show ? 92 : 0),
      bottom: k.value.height - e.value.style.layout.padding.bottom,
      height: k.value.height - e.value.style.layout.padding.top - e.value.style.layout.padding.bottom,
      width: k.value.width - e.value.style.layout.padding.right - e.value.style.layout.padding.left - (j.value === "right" && e.value.style.legend.show ? 92 : 0)
    })), ee = h(() => d.value.height * r.dataset.length), m = h(() => Math.max(...r.dataset.flatMap((t) => t.values))), z = h(() => Math.min(...r.dataset.flatMap((t) => t.values))), M = h(() => {
      const t = r.dataset.flatMap((s) => s.values);
      return t.reduce((s, v) => s + v, 0) / t.length;
    }), d = h(() => ({
      width: a.value.width / N.value,
      height: a.value.width / (N.value < r.dataset.length ? r.dataset.length : N.value)
    })), $ = h(() => {
      const t = e.value.style.layout.dataLabels.yAxis.values.length ? e.value.style.layout.dataLabels.yAxis.values : r.dataset.map((s) => s.name), l = e.value.style.layout.dataLabels.xAxis.values;
      return {
        yLabels: t,
        xLabels: l.slice(0, N.value)
      };
    }), W = h(() => (r.dataset.forEach((t, l) => {
      je({
        datasetObject: t,
        requiredAttributes: ["values"]
      }).forEach((s) => {
        Ce({
          componentName: "VueUiHeatmap",
          type: "datasetSerieAttribute",
          property: "values",
          index: l
        });
      });
    }), r.dataset.map((t) => ({
      ...t,
      temperatures: (t.values || []).map((l, s) => l >= M.value ? {
        side: "up",
        color: ue(e.value.style.layout.cells.colors.cold, e.value.style.layout.cells.colors.hot, z.value, m.value, l),
        ratio: Math.abs(Math.abs(l - M.value) / Math.abs(m.value - M.value)) > 1 ? 1 : Math.abs(Math.abs(l - M.value) / Math.abs(m.value - M.value)),
        value: l,
        yAxisName: t.name,
        xAxisName: $.value.xLabels[s],
        id: `vue-data-ui-heatmap-cell-${se()}`
      } : {
        side: "down",
        ratio: Math.abs(1 - Math.abs(l) / Math.abs(M.value)) > 1 ? 1 : Math.abs(1 - Math.abs(l) / Math.abs(M.value)),
        color: ue(e.value.style.layout.cells.colors.cold, e.value.style.layout.cells.colors.hot, z.value, m.value, l),
        value: l,
        yAxisName: t.name,
        xAxisName: $.value.xLabels[s],
        id: `vue-data-ui-heatmap-cell-${se()}`
      })
    })))), C = p(null), B = p(null);
    function Fe(t, l, s, v) {
      I.value = { x: s, y: v };
      const { value: y, yAxisName: g, xAxisName: L, id: Pe } = t;
      ie.value = Pe, C.value = y, B.value = {
        datapoint: t,
        seriesIndex: l,
        series: W.value,
        config: e.value
      }, J.value = !0;
      let le = "";
      const ae = e.value.style.tooltip.customFormat;
      qe(ae) && Ke(() => ae({
        datapoint: t,
        seriesIndex: l,
        series: W.value,
        config: e.value
      })) ? Q.value = ae({
        datapoint: t,
        seriesIndex: l,
        series: W.value,
        config: e.value
      }) : (le += `<div>${g} ${L ? `${L}` : ""}</div>`, le += `<div style="margin-top:6px;padding-top:6px;border-top:1px solid ${e.value.style.tooltip.borderColor};font-weight:bold;display:flex;flex-direction:row;gap:12px;align-items:center;justify-content:center"><span style="color:${ue(e.value.style.layout.cells.colors.cold, e.value.style.layout.cells.colors.hot, z.value, m.value, y)}">⬤</span><span>${isNaN(y) ? "-" : V(
        e.value.style.layout.cells.value.formatter,
        y,
        O({
          p: e.value.style.layout.dataLabels.prefix,
          v: y,
          s: e.value.style.layout.dataLabels.suffix,
          r: e.value.style.tooltip.roundingValue
        }),
        { datapoint: t, seriesIndex: l }
      )}</span></div>`, Q.value = `<div style="font-size:${e.value.style.tooltip.fontSize}px">${le}</div>`);
    }
    const R = h(() => a.value.top + ee.value * (1 - C.value / m.value)), G = h(() => a.value.left + (k.value.width - a.value.left - e.value.style.layout.padding.right) * (C.value / m.value));
    h(() => {
      const t = r.dataset.map((s) => ({
        name: s.name
      })), l = r.dataset.map((s) => s.values);
      return { head: t, body: l };
    });
    function we() {
      Ee(() => {
        const t = ["", ...r.dataset.map((y, g) => y.name)], l = [];
        for (let y = 0; y < $.value.xLabels.length; y += 1) {
          const g = [$.value.xLabels[y]];
          for (let L = 0; L < r.dataset.length; L += 1)
            g.push([r.dataset[L].values[y]]);
          l.push(g);
        }
        const s = [[e.value.style.title.text], [e.value.style.title.subtitle.text], [[""], [""], [""]]].concat([t]).concat(l), v = Je(s);
        Qe({ csvContent: v, title: e.value.style.title.text || "vue-ui-heatmap" });
      });
    }
    const F = p(!1);
    function Ve(t) {
      F.value = t, re.value += 1;
    }
    function _e() {
      _.value.showTable = !_.value.showTable;
    }
    function ke() {
      _.value.showTooltip = !_.value.showTooltip;
    }
    const q = p(!1);
    function te() {
      q.value = !q.value;
    }
    return Ae({
      generatePdf: me,
      generateCsv: we,
      generateImage: xe,
      toggleTable: _e,
      toggleTooltip: ke,
      toggleAnnotator: te
    }), (t, l) => (o(), n("div", {
      ref_key: "heatmapChart",
      ref: Y,
      class: K(`vue-ui-heatmap ${F.value ? "vue-data-ui-wrapper-fullscreen" : ""}`),
      style: x(`font-family:${e.value.style.fontFamily};width:100%; text-align:center;background:${e.value.style.backgroundColor}`),
      id: `heatmap__${P.value}`,
      onMouseenter: l[3] || (l[3] = () => u(he)(!0)),
      onMouseleave: l[4] || (l[4] = () => u(he)(!1))
    }, [
      e.value.userOptions.buttons.annotator ? (o(), U(nt, {
        key: 0,
        parent: Y.value,
        backgroundColor: e.value.style.backgroundColor,
        color: e.value.style.color,
        active: q.value,
        onClose: te
      }, null, 8, ["parent", "backgroundColor", "color", "active"])) : c("", !0),
      Se.value ? (o(), n("div", {
        key: 1,
        ref_key: "noTitle",
        ref: Me,
        class: "vue-data-ui-no-title-space",
        style: "height:36px; width: 100%;background:transparent"
      }, null, 512)) : c("", !0),
      e.value.style.title.text ? (o(), n("div", dt, [
        (o(), U(Ze, {
          key: `title_${ye.value}`,
          config: {
            title: {
              cy: "heatmap-div-title",
              ...e.value.style.title
            },
            subtitle: {
              cy: "heatmap-div-subtitle",
              ...e.value.style.title.subtitle
            }
          }
        }, null, 8, ["config"]))
      ])) : c("", !0),
      e.value.userOptions.show && D.value && (u(pe) || u(ce)) ? (o(), U(tt, {
        ref_key: "details",
        ref: ze,
        key: `user_options_${re.value}`,
        backgroundColor: e.value.style.backgroundColor,
        color: e.value.style.color,
        isImaging: u(be),
        isPrinting: u(fe),
        uid: P.value,
        hasTooltip: e.value.userOptions.buttons.tooltip && e.value.style.tooltip.show,
        hasPdf: e.value.userOptions.buttons.pdf,
        hasImg: e.value.userOptions.buttons.img,
        hasXls: e.value.userOptions.buttons.csv,
        hasTable: e.value.userOptions.buttons.table,
        hasFullscreen: e.value.userOptions.buttons.fullscreen,
        isFullscreen: F.value,
        isTooltip: _.value.showTooltip,
        titles: { ...e.value.userOptions.buttonTitles },
        chartElement: Y.value,
        position: e.value.userOptions.position,
        hasAnnotator: e.value.userOptions.buttons.annotator,
        isAnnotation: q.value,
        onToggleFullscreen: Ve,
        onGeneratePdf: u(me),
        onGenerateCsv: we,
        onGenerateImage: u(xe),
        onToggleTable: _e,
        onToggleTooltip: ke,
        onToggleAnnotator: te,
        style: x({
          visibility: u(pe) ? u(ce) ? "visible" : "hidden" : "visible"
        })
      }, Re({ _: 2 }, [
        t.$slots.optionTooltip ? {
          name: "optionTooltip",
          fn: w(() => [
            f(t.$slots, "optionTooltip", {}, void 0, !0)
          ]),
          key: "0"
        } : void 0,
        t.$slots.optionPdf ? {
          name: "optionPdf",
          fn: w(() => [
            f(t.$slots, "optionPdf", {}, void 0, !0)
          ]),
          key: "1"
        } : void 0,
        t.$slots.optionCsv ? {
          name: "optionCsv",
          fn: w(() => [
            f(t.$slots, "optionCsv", {}, void 0, !0)
          ]),
          key: "2"
        } : void 0,
        t.$slots.optionImg ? {
          name: "optionImg",
          fn: w(() => [
            f(t.$slots, "optionImg", {}, void 0, !0)
          ]),
          key: "3"
        } : void 0,
        t.$slots.optionTable ? {
          name: "optionTable",
          fn: w(() => [
            f(t.$slots, "optionTable", {}, void 0, !0)
          ]),
          key: "4"
        } : void 0,
        t.$slots.optionFullscreen ? {
          name: "optionFullscreen",
          fn: w(({ toggleFullscreen: s, isFullscreen: v }) => [
            f(t.$slots, "optionFullscreen", E(X({ toggleFullscreen: s, isFullscreen: v })), void 0, !0)
          ]),
          key: "5"
        } : void 0,
        t.$slots.optionAnnotator ? {
          name: "optionAnnotator",
          fn: w(({ toggleAnnotator: s, isAnnotator: v }) => [
            f(t.$slots, "optionAnnotator", E(X({ toggleAnnotator: s, isAnnotator: v })), void 0, !0)
          ]),
          key: "6"
        } : void 0
      ]), 1032, ["backgroundColor", "color", "isImaging", "isPrinting", "uid", "hasTooltip", "hasPdf", "hasImg", "hasXls", "hasTable", "hasFullscreen", "isFullscreen", "isTooltip", "titles", "chartElement", "position", "hasAnnotator", "isAnnotation", "onGeneratePdf", "onGenerateImage", "style"])) : c("", !0),
      D.value ? (o(), n("svg", {
        key: 4,
        xmlns: u(We),
        class: K({ "vue-data-ui-fullscreen--on": F.value, "vue-data-ui-fulscreen--off": !F.value }),
        viewBox: `0 0 ${k.value.width} ${k.value.heightWithLegend}`,
        style: x(`max-width:100%;overflow:visible;background:transparent;color:${e.value.style.color}`)
      }, [
        oe(ut),
        (o(!0), n(A, null, S(W.value, (s, v) => (o(), n("g", null, [
          (o(!0), n(A, null, S(s.temperatures, (y, g) => (o(), n("g", null, [
            i("rect", {
              x: a.value.left + d.value.width * g + e.value.style.layout.cells.spacing / 2,
              y: a.value.top + d.value.height * v + e.value.style.layout.cells.spacing / 2,
              width: d.value.width - e.value.style.layout.cells.spacing,
              height: d.value.height - e.value.style.layout.cells.spacing,
              fill: e.value.style.layout.cells.colors.underlayer,
              stroke: e.value.style.backgroundColor,
              "stroke-width": e.value.style.layout.cells.spacing
            }, null, 8, ct),
            i("rect", {
              x: a.value.left + d.value.width * g + e.value.style.layout.cells.spacing / 2,
              y: a.value.top + d.value.height * v + e.value.style.layout.cells.spacing / 2,
              width: d.value.width - e.value.style.layout.cells.spacing,
              height: d.value.height - e.value.style.layout.cells.spacing,
              fill: y.color,
              stroke: e.value.style.backgroundColor,
              "stroke-width": e.value.style.layout.cells.spacing
            }, null, 8, ht),
            e.value.style.layout.cells.value.show ? (o(), n("text", {
              key: 0,
              "text-anchor": "middle",
              "font-size": e.value.style.layout.cells.value.fontSize,
              "font-weight": e.value.style.layout.cells.value.bold ? "bold" : "normal",
              fill: u(ne)(y.color),
              x: a.value.left + d.value.width * g + d.value.width / 2,
              y: a.value.top + d.value.height * v + d.value.height / 2 + e.value.style.layout.cells.value.fontSize / 3
            }, b(u(V)(
              e.value.style.layout.cells.value.formatter,
              y.value,
              u(O)({
                p: e.value.style.layout.dataLabels.prefix,
                v: y.value,
                s: e.value.style.layout.dataLabels.suffix,
                r: e.value.style.layout.cells.value.roundingValue
              }),
              { datapoint: y }
            )), 9, pt)) : c("", !0)
          ]))), 256)),
          (o(!0), n(A, null, S(s.temperatures, (y, g) => (o(), n("g", null, [
            i("rect", {
              x: a.value.left + d.value.width * g,
              y: a.value.top + d.value.height * v,
              width: d.value.width,
              height: d.value.height,
              fill: "transparent",
              stroke: "none",
              onMouseover: (L) => Fe(y, v, a.value.left + d.value.width * g, a.value.top + d.value.height * v),
              onMouseout: l[0] || (l[0] = (L) => {
                J.value = !1, ie.value = void 0, C.value = null, I.value = null;
              })
            }, null, 40, gt)
          ]))), 256)),
          e.value.style.layout.dataLabels.yAxis.show ? (o(), n("g", ft, [
            i("text", {
              "font-size": e.value.style.layout.dataLabels.yAxis.fontSize,
              fill: e.value.style.layout.dataLabels.yAxis.color,
              x: a.value.left + e.value.style.layout.dataLabels.yAxis.offsetX - 6,
              y: a.value.top + d.value.height * v + d.value.height / 2 + e.value.style.layout.dataLabels.yAxis.fontSize / 3 + e.value.style.layout.dataLabels.yAxis.offsetY,
              "text-anchor": "end",
              "font-weight": e.value.style.layout.dataLabels.yAxis.bold ? "bold" : "normal"
            }, b($.value.yLabels[v]), 9, bt)
          ])) : c("", !0)
        ]))), 256)),
        e.value.style.layout.dataLabels.xAxis.show ? (o(), n("g", mt, [
          (o(!0), n(A, null, S($.value.xLabels, (s, v) => (o(), n(A, null, [
            !e.value.style.layout.dataLabels.xAxis.showOnlyAtModulo || e.value.style.layout.dataLabels.xAxis.showOnlyAtModulo && v % e.value.style.layout.dataLabels.xAxis.showOnlyAtModulo === 0 ? (o(), n("text", {
              key: 0,
              "text-anchor": e.value.style.layout.dataLabels.xAxis.rotation === 0 ? "middle" : e.value.style.layout.dataLabels.xAxis.rotation < 0 ? "start" : "end",
              "font-size": e.value.style.layout.dataLabels.xAxis.fontSize,
              fill: e.value.style.layout.dataLabels.xAxis.color,
              "font-weight": e.value.style.layout.dataLabels.xAxis.bold ? "bold" : "normal",
              transform: `translate(${a.value.left + d.value.width / 2 + a.value.width / $.value.xLabels.length * v + e.value.style.layout.dataLabels.xAxis.offsetX}, ${a.value.top + e.value.style.layout.dataLabels.xAxis.offsetY - 6}), rotate(${e.value.style.layout.dataLabels.xAxis.rotation})`
            }, b(s), 9, xt)) : c("", !0)
          ], 64))), 256))
        ])) : c("", !0),
        I.value ? (o(), n("g", wt, [
          i("rect", {
            style: { "pointer-events": "none" },
            x: I.value.x - e.value.style.layout.cells.selected.border / 2 + e.value.style.layout.cells.spacing,
            y: I.value.y - e.value.style.layout.cells.selected.border / 2 + e.value.style.layout.cells.spacing,
            width: d.value.width - e.value.style.layout.cells.spacing + e.value.style.layout.cells.selected.border - e.value.style.layout.cells.spacing,
            height: d.value.height - e.value.style.layout.cells.spacing + e.value.style.layout.cells.selected.border - e.value.style.layout.cells.spacing,
            fill: "transparent",
            stroke: e.value.style.layout.cells.selected.color,
            "stroke-width": e.value.style.layout.cells.selected.border,
            rx: 1
          }, null, 8, _t)
        ])) : c("", !0),
        e.value.style.legend.show && j.value === "right" ? (o(), n("g", kt, [
          i("defs", null, [
            i("linearGradient", {
              id: `colorScaleVertical_${P.value}`,
              x2: "0%",
              y2: "100%"
            }, [
              i("stop", {
                offset: "0%",
                "stop-color": e.value.style.layout.cells.colors.hot
              }, null, 8, Ct),
              i("stop", {
                offset: "100%",
                "stop-color": e.value.style.layout.cells.colors.cold
              }, null, 8, Lt)
            ], 8, $t)
          ]),
          i("text", {
            x: a.value.right + 36 + 18,
            y: a.value.top - e.value.style.legend.fontSize * 1.5,
            "text-anchor": "middle",
            "font-size": e.value.style.legend.fontSize * 2,
            fill: e.value.style.legend.color
          }, b(u(V)(
            e.value.style.layout.cells.value.formatter,
            u(T)(m.value),
            u(O)({
              p: e.value.style.layout.dataLabels.prefix,
              v: u(T)(m.value),
              s: e.value.style.layout.dataLabels.suffix,
              r: e.value.style.legend.roundingValue
            })
          )), 9, At),
          i("rect", {
            x: a.value.right + 36,
            y: a.value.top,
            width: 36,
            height: ee.value,
            rx: e.value.style.legend.scaleBorderRadius,
            fill: `url(#colorScaleVertical_${P.value})`
          }, null, 8, Tt),
          i("text", {
            x: a.value.right + 36 + 18,
            y: a.value.top + ee.value + e.value.style.legend.fontSize * 2.5,
            "text-anchor": "middle",
            "font-size": e.value.style.legend.fontSize * 2,
            fill: e.value.style.legend.color
          }, b(u(V)(
            e.value.style.layout.cells.value.formatter,
            u(T)(z.value),
            u(O)({
              p: e.value.style.layout.dataLabels.prefix,
              v: u(T)(z.value),
              s: e.value.style.layout.dataLabels.suffix,
              r: e.value.style.legend.roundingValue
            })
          )), 9, zt),
          C.value !== null ? (o(), n("line", {
            key: 0,
            stroke: u(ne)(B.value.datapoint.color),
            "stroke-width": "2",
            x1: a.value.right + 36,
            x2: a.value.right + 72,
            y1: R.value,
            y2: R.value
          }, null, 8, Mt)) : c("", !0),
          C.value !== null ? (o(), n("path", {
            key: 1,
            fill: e.value.style.color,
            stroke: "none",
            d: `M ${a.value.right + 36},${R.value} ${a.value.right + 26},${R.value - 8} ${a.value.right + 26},${R.value + 8}z`
          }, null, 8, St)) : c("", !0)
        ])) : c("", !0),
        e.value.style.legend.show && j.value === "bottom" ? (o(), n("g", Ot, [
          i("defs", null, [
            i("linearGradient", Nt, [
              i("stop", {
                offset: "0%",
                "stop-color": e.value.style.layout.cells.colors.cold
              }, null, 8, Ft),
              i("stop", {
                offset: "100%",
                "stop-color": e.value.style.layout.cells.colors.hot
              }, null, 8, Vt)
            ])
          ]),
          i("rect", {
            x: a.value.left,
            y: a.value.bottom + e.value.style.layout.cells.height,
            width: k.value.width - a.value.left - e.value.style.layout.padding.right,
            height: e.value.style.layout.cells.height,
            rx: e.value.style.legend.scaleBorderRadius > e.value.style.layout.cells.height / 2 ? e.value.style.layout.cells.height / 2 : e.value.style.legend.scaleBorderRadius,
            fill: "url(#colorScaleHorizontal)"
          }, null, 8, Pt),
          i("text", {
            x: a.value.left,
            y: a.value.bottom + e.value.style.layout.cells.height * 2 + e.value.style.legend.fontSize * 2,
            "text-anchor": "start",
            "font-size": e.value.style.legend.fontSize * 2,
            fill: e.value.style.legend.color
          }, b(u(V)(
            e.value.style.layout.cells.value.formatter,
            u(T)(z.value),
            u(O)({
              p: e.value.style.layout.dataLabels.prefix,
              v: u(T)(z.value),
              s: e.value.style.layout.dataLabels.suffix,
              r: e.value.style.legend.roundingValue
            })
          )), 9, It),
          i("text", {
            x: a.value.right,
            y: a.value.bottom + e.value.style.layout.cells.height * 2 + e.value.style.legend.fontSize * 2,
            "text-anchor": "end",
            "font-size": e.value.style.legend.fontSize * 2,
            fill: e.value.style.legend.color
          }, b(u(V)(
            e.value.style.layout.cells.value.formatter,
            u(T)(m.value),
            u(O)({
              p: e.value.style.layout.dataLabels.prefix,
              v: u(T)(m.value),
              s: e.value.style.layout.dataLabels.suffix,
              r: e.value.style.legend.roundingValue
            })
          )), 9, Bt),
          C.value !== null ? (o(), n("line", {
            key: 0,
            stroke: u(ne)(B.value.datapoint.color),
            "stroke-width": "2",
            x1: G.value,
            x2: G.value,
            y1: a.value.bottom + e.value.style.layout.cells.height,
            y2: a.value.bottom + e.value.style.layout.cells.height * 2
          }, null, 8, Rt)) : c("", !0),
          C.value !== null ? (o(), n("path", {
            key: 1,
            fill: e.value.style.color,
            stroke: "none",
            d: `M ${G.value},${a.value.bottom + e.value.style.layout.cells.height} ${G.value - 12},${a.value.bottom + e.value.style.layout.cells.height - 20} ${G.value + 12},${a.value.bottom + e.value.style.layout.cells.height - 20}z`
          }, null, 8, Gt)) : c("", !0)
        ])) : c("", !0),
        f(t.$slots, "svg", { svg: k.value }, void 0, !0)
      ], 14, yt)) : c("", !0),
      t.$slots.watermark ? (o(), n("div", Ut, [
        f(t.$slots, "watermark", E(X({ isPrinting: u(fe) || u(be) })), void 0, !0)
      ])) : c("", !0),
      t.$slots.source ? (o(), n("div", Et, [
        f(t.$slots, "source", {}, void 0, !0)
      ], 512)) : c("", !0),
      D.value ? c("", !0) : (o(), U(at, {
        key: 7,
        config: {
          type: "heatmap",
          style: {
            backgroundColor: e.value.style.backgroundColor,
            heatmap: {
              color: "#CCCCCC"
            }
          }
        }
      }, null, 8, ["config"])),
      oe(lt, {
        show: _.value.showTooltip && J.value,
        backgroundColor: e.value.style.tooltip.backgroundColor,
        color: e.value.style.tooltip.color,
        borderRadius: e.value.style.tooltip.borderRadius,
        borderColor: e.value.style.tooltip.borderColor,
        borderWidth: e.value.style.tooltip.borderWidth,
        fontSize: e.value.style.tooltip.fontSize,
        backgroundOpacity: e.value.style.tooltip.backgroundOpacity,
        position: e.value.style.tooltip.position,
        offsetY: e.value.style.tooltip.offsetY,
        parent: Y.value,
        content: Q.value,
        isFullscreen: F.value,
        isCustom: e.value.style.tooltip.customFormat && typeof e.value.style.tooltip.customFormat == "function"
      }, {
        "tooltip-before": w(() => [
          f(t.$slots, "tooltip-before", E(X({ ...B.value })), void 0, !0)
        ]),
        "tooltip-after": w(() => [
          f(t.$slots, "tooltip-after", E(X({ ...B.value })), void 0, !0)
        ]),
        _: 3
      }, 8, ["show", "backgroundColor", "color", "borderRadius", "borderColor", "borderWidth", "fontSize", "backgroundOpacity", "position", "offsetY", "parent", "content", "isFullscreen", "isCustom"]),
      D.value ? (o(), U(st, {
        key: 8,
        hideDetails: "",
        config: {
          open: _.value.showTable,
          maxHeight: 1e4,
          body: {
            backgroundColor: e.value.style.backgroundColor,
            color: e.value.style.color
          },
          head: {
            backgroundColor: e.value.style.backgroundColor,
            color: e.value.style.color
          }
        }
      }, {
        content: w(() => [
          i("div", {
            ref_key: "tableContainer",
            ref: ve,
            class: "vue-ui-heatmap-table"
          }, [
            i("div", {
              style: "width:100%;overflow-x:auto;padding-top:36px;position:relative",
              class: K({ "vue-ui-responsive": de.value })
            }, [
              i("div", {
                role: "button",
                tabindex: "0",
                style: x(`width:32px; position: absolute; top: 0; left:4px; padding: 0 0px; display: flex; align-items:center;justify-content:center;height: 36px; width: 32px; cursor:pointer; background:${e.value.table.th.backgroundColor};`),
                onClick: l[1] || (l[1] = (s) => _.value.showTable = !1),
                onKeypress: l[2] || (l[2] = Ge((s) => _.value.showTable = !1, ["enter"]))
              }, [
                oe(ot, {
                  name: "close",
                  stroke: e.value.table.th.color,
                  "stroke-width": 2
                }, null, 8, ["stroke"])
              ], 36),
              i("table", Xt, [
                i("caption", {
                  style: x(`backgroundColor:${e.value.table.th.backgroundColor};color:${e.value.table.th.color};outline:${e.value.table.th.outline}`)
                }, [
                  Ue(b(e.value.style.title.text) + " ", 1),
                  e.value.style.title.subtitle.text ? (o(), n("span", Ht, b(e.value.style.title.subtitle.text), 1)) : c("", !0)
                ], 4),
                i("thead", null, [
                  i("tr", {
                    role: "row",
                    style: x(`background:${e.value.table.th.backgroundColor};color:${e.value.table.th.color}`)
                  }, [
                    i("th", {
                      style: x(`outline:${e.value.table.th.outline};padding-right:6px`)
                    }, null, 4),
                    (o(!0), n(A, null, S(H.dataset, (s, v) => (o(), n("th", {
                      align: "right",
                      style: x(`outline:${e.value.table.th.outline};padding-right:6px`)
                    }, b(s.name), 5))), 256))
                  ], 4)
                ]),
                i("tbody", null, [
                  (o(!0), n(A, null, S($.value.xLabels, (s, v) => (o(), n("tr", {
                    role: "row",
                    class: K({ "vue-ui-data-table__tbody__row": !0, "vue-ui-data-table__tbody__row-even": v % 2 === 0, "vue-ui-data-table__tbody__row-odd": v % 2 !== 0 }),
                    style: x(`background:${e.value.table.td.backgroundColor};color:${e.value.table.td.color}`)
                  }, [
                    i("td", {
                      "data-cell": e.value.table.colNames.xAxis,
                      class: "vue-ui-data-table__tbody__td",
                      style: x(`outline:${e.value.table.td.outline}`)
                    }, [
                      i("div", Yt, b(s), 1)
                    ], 12, Dt),
                    (o(!0), n(A, null, S(H.dataset, (y, g) => (o(), n("td", {
                      class: "vue-ui-data-table__tbody__td",
                      "data-cell": H.dataset[g].name,
                      style: x(`outline:${e.value.table.td.outline}`)
                    }, [
                      i("div", Wt, b(isNaN(y.values[v]) ? "-" : u(O)({ p: e.value.style.layout.dataLabels.prefix, v: y.values[v], s: e.value.style.layout.dataLabels.suffix, r: e.value.table.td.roundingValue })), 1)
                    ], 12, jt))), 256))
                  ], 6))), 256))
                ])
              ])
            ], 2)
          ], 512)
        ]),
        _: 1
      }, 8, ["config"])) : c("", !0)
    ], 46, vt));
  }
}, rl = /* @__PURE__ */ rt(qt, [["__scopeId", "data-v-776c5b2e"]]);
export {
  rl as default
};
