import { computed as m, ref as g, onMounted as Q, onBeforeUnmount as _e, openBlock as o, createElementBlock as r, normalizeClass as ee, normalizeStyle as D, createVNode as te, createCommentVNode as f, createBlock as F, unref as d, createSlots as xe, withCtx as _, renderSlot as C, normalizeProps as le, guardReactiveProps as ae, Fragment as w, renderList as $, createElementVNode as n, toDisplayString as L, createTextVNode as se, nextTick as ke } from "vue";
import { u as Ce, c as oe, t as we, o as $e, e as re, g as Le, s as ne, B as ze, f as z, X as ue, i as E, l as ie, h as ce, q as Xe, r as Ne } from "./index-CguVaFlt.js";
import { t as Ae, u as Se } from "./useResponsive-NZB-WLRF.js";
import { _ as Te } from "./Title-DbTGPg4G.js";
import { u as Pe, U as Ge } from "./usePrinter-ClsMRVJG.js";
import { D as Ie } from "./DataTable-BwHWRlRZ.js";
import Me from "./vue-ui-skeleton-ChHLL5Hw.js";
import { L as De } from "./Legend-CsVEDSh6.js";
import Fe from "./vue-ui-accordion-w15FGKRN.js";
import { u as de } from "./useNestedProp-BbEbJmgv.js";
import { _ as Oe } from "./_plugin-vue_export-helper-CHgC5LLL.js";
const Ve = ["id"], Ee = ["xmlns", "viewBox"], We = { key: 0 }, He = ["x1", "x2", "y1", "y2", "stroke", "stroke-width", "stroke-dasharray"], Be = { key: 1 }, Re = ["x1", "x2", "y1", "y2", "stroke", "stroke-width", "stroke-dasharray"], Ue = ["x1", "x2", "y1", "y2", "stroke", "stroke-width", "stroke-dasharray"], je = { key: 2 }, qe = ["x", "y", "font-size", "fill", "font-weight"], Ye = ["x", "y", "font-size", "fill"], Ze = { key: 3 }, Je = ["x", "y", "font-size", "fill", "font-weight"], Ke = ["id"], Qe = ["stop-color"], et = ["stop-color"], tt = ["stop-color"], lt = ["id"], at = ["stop-color"], st = ["stop-color"], ot = ["stop-color"], rt = ["id"], nt = ["stop-color"], ut = ["stop-color"], it = ["id"], ct = ["stop-color"], dt = ["stop-color"], vt = { key: 0 }, ht = ["d", "fill"], yt = { key: 1 }, bt = ["x", "y", "height", "width", "fill"], ft = ["cx", "cy", "r", "fill", "stroke", "stroke-width"], gt = ["cx", "cy", "r", "fill", "stroke", "stroke-width"], mt = { key: 2 }, pt = ["x", "y", "fill", "font-size"], _t = { key: 3 }, xt = ["x", "y", "fill", "font-size"], kt = {
  key: 3,
  class: "vue-data-ui-watermark"
}, Ct = ["xmlns", "height", "width"], wt = ["fill"], $t = ["innerHTML"], Lt = {
  __name: "vue-ui-dumbbell",
  props: {
    config: {
      type: Object,
      default() {
        return {};
      }
    },
    dataset: {
      type: Array,
      default() {
        return [];
      }
    }
  },
  emits: ["selectDatapoint"],
  setup(ve, { expose: he, emit: zt }) {
    const p = ve, { vue_ui_dumbbell: ye } = Ce(), X = m({
      get() {
        return !!p.dataset && p.dataset.length;
      },
      set(l) {
        return l;
      }
    }), v = g(oe()), W = g(0), A = g(null), H = g(null), B = g(null), e = m(() => {
      const l = de({
        userConfig: p.config,
        defaultConfig: ye
      });
      return l.theme ? {
        ...de({
          userConfig: we.vue_ui_dumbbell[l.theme] || p.config,
          defaultConfig: l
        })
      } : l;
    }), S = g(null);
    Q(() => {
      if ($e(p.dataset) ? re({
        componentName: "VueUiDumbbell",
        type: "dataset"
      }) : p.dataset.forEach((l, u) => {
        Le({
          datasetObject: l,
          requiredAttributes: ["name", "start", "end"]
        }).forEach((t) => {
          X.value = !1, re({
            componentName: "VueUiDumbbell",
            type: "datasetSerieAttribute",
            property: t,
            index: u
          });
        });
      }), e.value.responsive) {
        const l = Ae(() => {
          const { width: u, height: t } = Se({
            chart: A.value,
            title: e.value.style.chart.title.text ? H.value : null,
            legend: e.value.style.chart.legend.show ? B.value : null
          });
          P.value = u, h.value = t / p.dataset.length, y.value = G();
        });
        S.value = new ResizeObserver(l), S.value.observe(A.value.parentNode);
      }
    }), _e(() => {
      S.value && S.value.disconnect();
    });
    const { isPrinting: R, isImaging: U, generatePdf: j, generateImage: q } = Pe({
      elementId: `dumbbell_${v.value}`,
      fileName: e.value.style.chart.title.text || "vue-ui-dumbbell"
    }), T = g({
      showTable: e.value.table.show
    }), x = m(() => p.dataset.map((l, u) => ({
      ...l,
      start: ne(l.start),
      end: ne(l.end),
      id: oe()
    }))), O = m(() => ({
      max: Math.max(...x.value.flatMap((l) => [l.start, l.end])),
      min: Math.min(...x.value.flatMap((l) => [l.start, l.end]))
    })), c = m(() => ze(O.value.min < 0 ? O.value.min : 0, O.value.max, e.value.style.chart.grid.scaleSteps)), h = g(e.value.style.chart.rowHeight), P = g(e.value.style.chart.width), a = m(() => {
      const l = h.value, u = e.value.style.chart.padding.left + e.value.style.chart.padding.right + P.value, t = e.value.style.chart.padding.top + e.value.style.chart.padding.bottom + l * p.dataset.length, s = c.value.ticks.length * (P.value / c.value.ticks.length);
      return {
        left: e.value.style.chart.padding.left,
        right: u - e.value.style.chart.padding.right,
        top: e.value.style.chart.padding.top,
        bottom: t - e.value.style.chart.padding.bottom,
        width: P.value,
        height: l * p.dataset.length,
        rowHeight: l,
        absoluteHeight: t,
        absoluteWidth: u,
        widthPlotReference: s
      };
    });
    function G() {
      return x.value.map((l, u) => {
        const t = a.value.left + (l.start + Math.abs(c.value.min)) / (c.value.max + Math.abs(c.value.min)) * a.value.widthPlotReference, s = a.value.left + (l.end + Math.abs(c.value.min)) / (c.value.max + Math.abs(c.value.min)) * a.value.widthPlotReference, i = t + (s - t) / 2;
        return {
          ...l,
          startX: t,
          endX: s,
          centerX: i,
          y: a.value.top + u * h.value + h.value / 2,
          endVal: l.start
        };
      });
    }
    const y = g([]), Y = g(null), be = m(() => x.value.map((l) => l.end).reduce((l, u) => l + u, 0));
    Q(() => {
      y.value = G();
      let l = y.value.map((t) => t.start).reduce((t, s) => t + s, 0);
      function u() {
        const t = x.value.map((s) => s.end - s.start);
        l >= be.value ? (cancelAnimationFrame(Y.value), y.value = G()) : (y.value = y.value.map((s, i) => {
          s.endVal += t[i] * (e.value.animationSpeed / 100);
          const b = a.value.left + (s.start + Math.abs(c.value.min)) / (c.value.max + Math.abs(c.value.min)) * a.value.widthPlotReference, M = a.value.left + (s.endVal + Math.abs(c.value.min)) / (c.value.max + Math.abs(c.value.min)) * a.value.widthPlotReference, V = b + (M - b) / 2;
          return {
            ...s,
            startX: b,
            endX: M,
            centerX: V,
            y: a.value.top + i * h.value + h.value / 2,
            endVal: s.endVal
          };
        }), l = y.value.map((s) => s.endVal).reduce((s, i) => s + i, 0), Y.value = requestAnimationFrame(u));
      }
      e.value.useAnimation ? u() : y.value = G();
    });
    const Z = m(() => [
      { name: e.value.style.chart.legend.labelStart, color: e.value.style.chart.plots.gradient.show ? `url(#start_grad_${v.value})` : e.value.style.chart.plots.startColor },
      { name: e.value.style.chart.legend.labelEnd, color: e.value.style.chart.plots.gradient.show ? `url(#end_grad_${v.value})` : e.value.style.chart.plots.endColor }
    ]), fe = m(() => ({
      cy: "donut-div-legend",
      backgroundColor: e.value.style.chart.legend.backgroundColor,
      color: e.value.style.chart.legend.color,
      fontSize: e.value.style.chart.legend.fontSize,
      paddingBottom: 12,
      paddingTop: 12,
      fontWeight: e.value.style.chart.legend.bold ? "bold" : ""
    })), k = m(() => {
      const l = y.value.map((t) => ({
        name: t.name
      })), u = y.value.map((t) => ({
        start: t.start,
        end: t.end
      }));
      return { head: l, body: u };
    }), I = m(() => {
      const l = [
        e.value.table.columnNames.series,
        e.value.table.columnNames.start,
        e.value.table.columnNames.end,
        e.value.table.columnNames.progression
      ], u = k.value.head.map((i, b) => {
        const M = z({
          p: e.value.style.chart.labels.prefix,
          v: k.value.body[b].start,
          s: e.value.style.chart.labels.suffix,
          r: e.value.table.td.roundingValue
        }), V = z({
          p: e.value.style.chart.labels.prefix,
          v: k.value.body[b].end,
          s: e.value.style.chart.labels.suffix,
          r: e.value.table.td.roundingValue
        }), pe = z({
          v: 100 * (k.value.body[b].end / k.value.body[b].start - 1),
          s: "%",
          r: e.value.table.td.roundingPercentage
        });
        return [
          { name: i.name },
          M,
          V,
          pe
        ];
      }), t = {
        th: {
          backgroundColor: e.value.table.th.backgroundColor,
          color: e.value.table.th.color,
          outline: e.value.table.th.outline
        },
        td: {
          backgroundColor: e.value.table.td.backgroundColor,
          color: e.value.table.td.color,
          outline: e.value.table.td.outline
        },
        breakpoint: e.value.table.responsiveBreakpoint
      };
      return {
        colNames: [
          e.value.table.columnNames.series,
          e.value.table.columnNames.start,
          e.value.table.columnNames.end,
          e.value.table.columnNames.progression
        ],
        head: l,
        body: u,
        config: t
      };
    });
    function J() {
      ke(() => {
        const l = k.value.head.map((s, i) => [[
          s.name
        ], [k.value.body[i].start], [k.value.body[i].end]]), u = [[e.value.style.chart.title.text], [e.value.style.chart.title.subtitle.text], [[e.value.table.columnNames.series], [e.value.table.columnNames.start], [e.value.table.columnNames.end]]].concat(l), t = Xe(u);
        Ne({ csvContent: t, title: e.value.style.chart.title.text || "vue-ui-dumbbell" });
      });
    }
    const N = g(!1);
    function ge(l) {
      N.value = l, W.value += 1;
    }
    function me() {
      return y.value;
    }
    function K() {
      T.value.showTable = !T.value.showTable;
    }
    return he({
      getData: me,
      generatePdf: j,
      generateCsv: J,
      generateImage: q,
      toggleTable: K
    }), (l, u) => (o(), r("div", {
      ref_key: "dumbbellChart",
      ref: A,
      class: ee(`vue-ui-dumbbell ${N.value ? "vue-data-ui-wrapper-fullscreen" : ""}`),
      style: D(`font-family:${e.value.style.fontFamily};width:100%; text-align:center;${e.value.style.chart.title.text ? "" : "padding-top:36px"};background:${e.value.style.chart.backgroundColor};${e.value.responsive ? "height:100%" : ""}`),
      id: `dumbbell_${v.value}`
    }, [
      e.value.style.chart.title.text ? (o(), r("div", {
        key: 0,
        ref_key: "chartTitle",
        ref: H,
        style: D(`width:100%;background:${e.value.style.chart.backgroundColor};padding-bottom:24px`)
      }, [
        te(Te, {
          config: {
            title: {
              cy: "donut-div-title",
              ...e.value.style.chart.title
            },
            subtitle: {
              cy: "donut-div-subtitle",
              ...e.value.style.chart.title.subtitle
            }
          }
        }, null, 8, ["config"])
      ], 4)) : f("", !0),
      e.value.userOptions.show && X.value ? (o(), F(Ge, {
        ref: "details",
        key: `user_option_${W.value}`,
        backgroundColor: e.value.style.chart.backgroundColor,
        color: e.value.style.chart.color,
        isPrinting: d(R),
        isImaging: d(U),
        uid: v.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: N.value,
        titles: { ...e.value.userOptions.buttonTitles },
        chartElement: A.value,
        onToggleFullscreen: ge,
        onGeneratePdf: d(j),
        onGenerateCsv: J,
        onGenerateImage: d(q),
        onToggleTable: K
      }, xe({ _: 2 }, [
        l.$slots.optionPdf ? {
          name: "optionPdf",
          fn: _(() => [
            C(l.$slots, "optionPdf", {}, void 0, !0)
          ]),
          key: "0"
        } : void 0,
        l.$slots.optionCsv ? {
          name: "optionCsv",
          fn: _(() => [
            C(l.$slots, "optionCsv", {}, void 0, !0)
          ]),
          key: "1"
        } : void 0,
        l.$slots.optionImg ? {
          name: "optionImg",
          fn: _(() => [
            C(l.$slots, "optionImg", {}, void 0, !0)
          ]),
          key: "2"
        } : void 0,
        l.$slots.optionTable ? {
          name: "optionTable",
          fn: _(() => [
            C(l.$slots, "optionTable", {}, void 0, !0)
          ]),
          key: "3"
        } : void 0,
        l.$slots.optionFullscreen ? {
          name: "optionFullscreen",
          fn: _(({ toggleFullscreen: t, isFullscreen: s }) => [
            C(l.$slots, "optionFullscreen", le(ae({ toggleFullscreen: t, isFullscreen: s })), void 0, !0)
          ]),
          key: "4"
        } : void 0
      ]), 1032, ["backgroundColor", "color", "isPrinting", "isImaging", "uid", "hasPdf", "hasXls", "hasImg", "hasTable", "hasFullscreen", "isFullscreen", "titles", "chartElement", "onGeneratePdf", "onGenerateImage"])) : f("", !0),
      X.value ? (o(), r("svg", {
        key: 2,
        xmlns: d(ue),
        class: ee({ "vue-data-ui-fullscreen--on": N.value, "vue-data-ui-fulscreen--off": !N.value }),
        viewBox: `0 0 ${a.value.absoluteWidth <= 0 ? 10 : a.value.absoluteWidth} ${a.value.absoluteHeight <= 0 ? 10 : a.value.absoluteHeight}`,
        style: D(`max-width:100%; overflow: visible; background:${e.value.style.chart.backgroundColor};color:${e.value.style.chart.color}`)
      }, [
        e.value.style.chart.grid.verticalGrid.show ? (o(), r("g", We, [
          (o(!0), r(w, null, $(c.value.ticks, (t, s) => (o(), r("line", {
            x1: a.value.left + s * a.value.width / (c.value.ticks.length - 1),
            x2: a.value.left + s * a.value.width / (c.value.ticks.length - 1),
            y1: a.value.top,
            y2: a.value.bottom,
            stroke: e.value.style.chart.grid.verticalGrid.stroke,
            "stroke-width": e.value.style.chart.grid.verticalGrid.strokeWidth,
            "stroke-dasharray": e.value.style.chart.grid.verticalGrid.strokeDasharray
          }, null, 8, He))), 256))
        ])) : f("", !0),
        e.value.style.chart.grid.horizontalGrid.show ? (o(), r("g", Be, [
          (o(!0), r(w, null, $(x.value, (t, s) => (o(), r("line", {
            x1: a.value.left,
            x2: a.value.right,
            y1: a.value.top + s * h.value,
            y2: a.value.top + s * h.value,
            stroke: e.value.style.chart.grid.horizontalGrid.stroke,
            "stroke-width": e.value.style.chart.grid.horizontalGrid.strokeWidth,
            "stroke-dasharray": e.value.style.chart.grid.horizontalGrid.strokeDasharray
          }, null, 8, Re))), 256)),
          n("line", {
            x1: a.value.left,
            x2: a.value.right,
            y1: a.value.bottom,
            y2: a.value.bottom,
            stroke: e.value.style.chart.grid.horizontalGrid.stroke,
            "stroke-width": e.value.style.chart.grid.horizontalGrid.strokeWidth,
            "stroke-dasharray": e.value.style.chart.grid.horizontalGrid.strokeDasharray
          }, null, 8, Ue)
        ])) : f("", !0),
        e.value.style.chart.labels.yAxisLabels.show ? (o(), r("g", je, [
          (o(!0), r(w, null, $(x.value, (t, s) => (o(), r("text", {
            x: a.value.left - 6 + e.value.style.chart.labels.yAxisLabels.offsetX,
            y: a.value.top + s * h.value + (e.value.style.chart.labels.yAxisLabels.showProgression ? h.value / 3 : h.value / 2) + e.value.style.chart.labels.yAxisLabels.fontSize / 3,
            "font-size": e.value.style.chart.labels.yAxisLabels.fontSize,
            fill: e.value.style.chart.labels.yAxisLabels.color,
            "font-weight": e.value.style.chart.labels.yAxisLabels.bold ? "bold" : "normal",
            "text-anchor": "end"
          }, L(t.name), 9, qe))), 256)),
          e.value.style.chart.labels.yAxisLabels.showProgression ? (o(!0), r(w, { key: 0 }, $(x.value, (t, s) => (o(), r("text", {
            x: a.value.left - 6 + e.value.style.chart.labels.yAxisLabels.offsetX,
            y: a.value.top + s * h.value + h.value / 1.3 + e.value.style.chart.labels.yAxisLabels.fontSize / 3,
            "font-size": e.value.style.chart.labels.yAxisLabels.fontSize,
            fill: e.value.style.chart.labels.yAxisLabels.color,
            "text-anchor": "end"
          }, L(d(z)({
            v: 100 * (t.end / t.start - 1),
            s: "%",
            r: e.value.style.chart.labels.yAxisLabels.rounding
          })), 9, Ye))), 256)) : f("", !0)
        ])) : f("", !0),
        e.value.style.chart.labels.xAxisLabels.show ? (o(), r("g", Ze, [
          (o(!0), r(w, null, $(c.value.ticks, (t, s) => (o(), r("text", {
            x: a.value.left + s * (a.value.width / (c.value.ticks.length - 1)),
            y: a.value.bottom + e.value.style.chart.labels.xAxisLabels.fontSize + e.value.style.chart.labels.xAxisLabels.offsetY,
            "font-size": e.value.style.chart.labels.xAxisLabels.fontSize,
            fill: e.value.style.chart.labels.xAxisLabels.color,
            "font-weight": e.value.style.chart.labels.xAxisLabels.bold ? "bold" : "normal",
            "text-anchor": "middle"
          }, L(d(E)(
            e.value.style.chart.labels.formatter,
            t,
            d(z)({
              p: e.value.style.chart.labels.prefix,
              v: t,
              s: e.value.style.chart.labels.suffix,
              r: e.value.style.chart.labels.xAxisLabels.rounding
            }),
            { datapoint: t, seriesIndex: s }
          )), 9, Je))), 256))
        ])) : f("", !0),
        n("defs", null, [
          n("radialGradient", {
            id: `start_grad_${v.value}`,
            fy: "30%"
          }, [
            n("stop", {
              offset: "10%",
              "stop-color": d(ie)(e.value.style.chart.plots.startColor, e.value.style.chart.plots.gradient.intensity / 100)
            }, null, 8, Qe),
            n("stop", {
              offset: "90%",
              "stop-color": d(ce)(e.value.style.chart.plots.startColor, 0.1)
            }, null, 8, et),
            n("stop", {
              offset: "100%",
              "stop-color": e.value.style.chart.plots.startColor
            }, null, 8, tt)
          ], 8, Ke),
          n("radialGradient", {
            id: `end_grad_${v.value}`,
            fy: "30%"
          }, [
            n("stop", {
              offset: "10%",
              "stop-color": d(ie)(e.value.style.chart.plots.endColor, e.value.style.chart.plots.gradient.intensity / 100)
            }, null, 8, at),
            n("stop", {
              offset: "90%",
              "stop-color": d(ce)(e.value.style.chart.plots.endColor, 0.1)
            }, null, 8, st),
            n("stop", {
              offset: "100%",
              "stop-color": e.value.style.chart.plots.endColor
            }, null, 8, ot)
          ], 8, lt)
        ]),
        (o(!0), r(w, null, $(y.value, (t, s) => (o(), r("g", null, [
          n("defs", null, [
            n("linearGradient", {
              id: `grad_positive_${v.value}`,
              x1: "0%",
              x2: "100%",
              y1: "0%",
              y2: "0%"
            }, [
              n("stop", {
                offset: "0%",
                "stop-color": e.value.style.chart.plots.startColor
              }, null, 8, nt),
              n("stop", {
                offset: "100%",
                "stop-color": e.value.style.chart.plots.endColor
              }, null, 8, ut)
            ], 8, rt),
            n("linearGradient", {
              id: `grad_negative_${v.value}`,
              x1: "0%",
              x2: "100%",
              y1: "0%",
              y2: "0%"
            }, [
              n("stop", {
                offset: "0%",
                "stop-color": e.value.style.chart.plots.endColor
              }, null, 8, ct),
              n("stop", {
                offset: "100%",
                "stop-color": e.value.style.chart.plots.startColor
              }, null, 8, dt)
            ], 8, it)
          ]),
          e.value.style.chart.plots.link.type === "curved" ? (o(), r("g", vt, [
            n("path", {
              d: `M 
                            ${t.startX},${t.y + e.value.style.chart.plots.radius / 2} 
                            C ${t.centerX},${t.y} ${t.centerX},${t.y} 
                            ${t.endX},${t.y + e.value.style.chart.plots.radius / 2}
                            L ${t.endX},${t.y - e.value.style.chart.plots.radius / 2}
                            C ${t.centerX},${t.y} ${t.centerX},${t.y}
                            ${t.startX},${t.y - e.value.style.chart.plots.radius / 2}
                            Z
                        `,
              fill: t.endX > t.startX ? `url(#grad_positive_${v.value})` : `url(#grad_negative_${v.value})`
            }, null, 8, ht)
          ])) : (o(), r("g", yt, [
            n("rect", {
              x: t.endX > t.startX ? t.startX : t.endX,
              y: t.y - e.value.style.chart.plots.link.strokeWidth / 2,
              height: e.value.style.chart.plots.link.strokeWidth,
              width: Math.abs(t.endX - t.startX),
              fill: t.endX > t.startX ? `url(#grad_positive_${v.value})` : `url(#grad_negative_${v.value})`
            }, null, 8, bt)
          ])),
          n("circle", {
            cx: t.startX,
            cy: t.y,
            r: e.value.style.chart.plots.radius,
            fill: e.value.style.chart.plots.gradient.show ? `url(#start_grad_${v.value})` : e.value.style.chart.plots.startColor,
            stroke: e.value.style.chart.plots.stroke,
            "stroke-width": e.value.style.chart.plots.strokeWidth
          }, null, 8, ft),
          n("circle", {
            cx: t.endX,
            cy: t.y,
            r: e.value.style.chart.plots.radius,
            fill: e.value.style.chart.plots.gradient.show ? `url(#end_grad_${v.value})` : e.value.style.chart.plots.endColor,
            stroke: e.value.style.chart.plots.stroke,
            "stroke-width": e.value.style.chart.plots.strokeWidth
          }, null, 8, gt),
          e.value.style.chart.labels.startLabels.show ? (o(), r("g", mt, [
            (o(!0), r(w, null, $(y.value, (i, b) => (o(), r("text", {
              x: i.startX,
              y: a.value.top + (b + 1) * h.value - e.value.style.chart.labels.startLabels.fontSize / 3 + e.value.style.chart.labels.startLabels.offsetY,
              fill: e.value.style.chart.labels.startLabels.useStartColor ? e.value.style.chart.plots.startColor : e.value.style.chart.labels.startLabels.color,
              "font-size": e.value.style.chart.labels.startLabels.fontSize,
              "text-anchor": "middle"
            }, L(d(E)(
              e.value.style.chart.labels.formatter,
              i.start,
              d(z)({
                p: e.value.style.chart.labels.prefix,
                v: i.start,
                s: e.value.style.chart.labels.suffix,
                r: e.value.style.chart.labels.startLabels.rounding
              }),
              { datapoint: i, seriesIndex: b }
            )), 9, pt))), 256))
          ])) : f("", !0),
          e.value.style.chart.labels.endLabels.show ? (o(), r("g", _t, [
            (o(!0), r(w, null, $(y.value, (i, b) => (o(), r("text", {
              x: i.endX,
              y: a.value.top + b * h.value + e.value.style.chart.labels.endLabels.fontSize + e.value.style.chart.labels.endLabels.offsetY,
              fill: e.value.style.chart.labels.endLabels.useEndColor ? e.value.style.chart.plots.endColor : e.value.style.chart.labels.endLabels.color,
              "font-size": e.value.style.chart.labels.endLabels.fontSize,
              "text-anchor": "middle"
            }, L(d(E)(
              e.value.style.chart.labels.formatter,
              i.end,
              d(z)({
                p: e.value.style.chart.labels.prefix,
                v: i.end,
                s: e.value.style.chart.labels.suffix,
                r: e.value.style.chart.labels.endLabels.rounding
              }),
              { datapoint: i, seriesIndex: b }
            )), 9, xt))), 256))
          ])) : f("", !0)
        ]))), 256)),
        C(l.$slots, "svg", { svg: a.value }, void 0, !0)
      ], 14, Ee)) : f("", !0),
      l.$slots.watermark ? (o(), r("div", kt, [
        C(l.$slots, "watermark", le(ae({ isPrinting: d(R) || d(U) })), void 0, !0)
      ])) : f("", !0),
      X.value ? f("", !0) : (o(), F(Me, {
        key: 4,
        config: {
          type: "dumbbell",
          style: {
            backgroundColor: e.value.style.chart.backgroundColor,
            dumbbell: {
              color: "#CCCCCC"
            }
          }
        }
      }, null, 8, ["config"])),
      n("div", {
        ref_key: "chartLegend",
        ref: B
      }, [
        e.value.style.chart.legend.show && X.value ? (o(), F(De, {
          key: 0,
          legendSet: Z.value,
          config: fe.value
        }, {
          item: _(({ legend: t }) => [
            n("div", {
              style: D(`display:flex;align-items:center;gap:4px;font-size:${e.value.style.chart.legend.fontSize}px`)
            }, [
              (o(), r("svg", {
                xmlns: d(ue),
                viewBox: "0 0 20 20",
                height: e.value.style.chart.legend.fontSize,
                width: e.value.style.chart.legend.fontSize
              }, [
                n("circle", {
                  cx: 10,
                  cy: 10,
                  r: 9,
                  fill: t.color
                }, null, 8, wt)
              ], 8, Ct)),
              se(" " + L(t.name), 1)
            ], 4)
          ]),
          _: 1
        }, 8, ["legendSet", "config"])) : C(l.$slots, "legend", {
          key: 1,
          legend: Z.value
        }, void 0, !0)
      ], 512),
      X.value ? (o(), F(Fe, {
        key: 5,
        hideDetails: "",
        config: {
          open: T.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: _(() => [
          te(Ie, {
            colNames: I.value.colNames,
            head: I.value.head,
            body: I.value.body,
            config: I.value.config,
            title: `${e.value.style.chart.title.text}${e.value.style.chart.title.subtitle.text ? ` : ${e.value.style.chart.title.subtitle.text}` : ""}`,
            onClose: u[0] || (u[0] = (t) => T.value.showTable = !1)
          }, {
            th: _(({ th: t }) => [
              n("div", {
                innerHTML: t,
                style: { display: "flex", "align-items": "center" }
              }, null, 8, $t)
            ]),
            td: _(({ td: t }) => [
              se(L(t.name || t), 1)
            ]),
            _: 1
          }, 8, ["colNames", "head", "body", "config", "title"])
        ]),
        _: 1
      }, 8, ["config"])) : f("", !0)
    ], 14, Ve));
  }
}, Ot = /* @__PURE__ */ Oe(Lt, [["__scopeId", "data-v-b32c06a0"]]);
export {
  Ot as default
};
