import { toRefs as J, defineAsyncComponent as e, computed as c, ref as o, onMounted as Y, watch as O, shallowReactive as Z, openBlock as F, createElementBlock as R, createElementVNode as w, createVNode as tt, createTextVNode as et, toDisplayString as ot, unref as it, createBlock as at, resolveDynamicComponent as nt, mergeProps as rt, toHandlers as lt, createSlots as ut, renderList as st, withCtx as ct, renderSlot as gt, normalizeProps as pt, guardReactiveProps as mt } from "vue";
import dt from "./BaseIcon-DpLJi6ci.js";
const Vt = {
  key: 0,
  style: { width: "100%", display: "flex", gap: "6px", "align-items": "center", color: "#FF0000" }
}, Ut = { style: { width: "36px" } }, ht = {
  __name: "vue-data-ui",
  props: {
    component: { type: String },
    dataset: { type: [Object, Array, Number, String] },
    config: { type: Object }
  },
  emits: [
    "selectLegend",
    "selectDatapoint",
    "toggleOpenState",
    "saveAnnotations",
    "selectRoot",
    "selectBranch",
    "selectNut",
    "change",
    "selectPlot",
    "selectSide",
    "rate",
    "postImage",
    "hoverIndex",
    "selectX",
    "toggleLock",
    "toggleTooltip",
    "start",
    "play",
    "pause",
    "reset",
    "restart",
    "lap",
    "toggleAnnotator"
  ],
  setup(N, { expose: G, emit: M }) {
    const n = N, { component: W, dataset: X, config: Q } = J(n), u = {
      VueUi3dBar: e(() => import("./vue-ui-3d-bar-DvitE1K_.js")),
      VueUiAgePyramid: e(() => import("./vue-ui-age-pyramid-Ti2L5N92.js")),
      VueUiAnnotator: e(() => import("./vue-ui-annotator-HNK_5tWo.js")),
      VueUiCandlestick: e(() => import("./vue-ui-candlestick-B5okP_Jf.js")),
      VueUiChestnut: e(() => import("./vue-ui-chestnut-DDsFxoUr.js")),
      VueUiDashboard: e(() => import("./vue-ui-dashboard-u-Gt08KE.js")),
      VueUiDigits: e(() => import("./vue-ui-digits-DCXyjW_e.js")),
      VueUiDonut: e(() => import("./vue-ui-donut-BvASz63R.js")),
      VueUiDonutEvolution: e(() => import("./vue-ui-donut-evolution-DcPk33e8.js")),
      VueUiGalaxy: e(() => import("./vue-ui-galaxy-COSx0c89.js")),
      VueUiGauge: e(() => import("./vue-ui-gauge-CWnGYcFD.js")),
      VueUiHeatmap: e(() => import("./vue-ui-heatmap-UoKourVZ.js")),
      VueUiKpi: e(() => import("./vue-ui-kpi-BRwkUBxs.js")),
      VueUiMiniLoader: e(() => import("./vue-ui-mini-loader-Cbl4ydLu.js")),
      VueUiMolecule: e(() => import("./vue-ui-molecule-DM_mX72q.js")),
      VueUiMoodRadar: e(() => import("./vue-ui-mood-radar-Bzsba8qo.js")),
      VueUiNestedDonuts: e(() => import("./vue-ui-nested-donuts-BG84mskb.js")),
      VueUiOnion: e(() => import("./vue-ui-onion-DpFx1Oy9.js")),
      VueUiQuadrant: e(() => import("./vue-ui-quadrant-Cddob9c3.js")),
      VueUiRadar: e(() => import("./vue-ui-radar--uexaa6p.js")),
      VueUiRating: e(() => import("./vue-ui-rating-BQuZA9UU.js")),
      VueUiRelationCircle: e(() => import("./vue-ui-relation-circle-C8NYrTHA.js")),
      VueUiRings: e(() => import("./vue-ui-rings-FEIPR_dS.js")),
      VueUiScatter: e(() => import("./vue-ui-scatter-CzbgC6ep.js")),
      VueUiScreenshot: e(() => import("./vue-ui-screenshot-IaxgY5qE.js")),
      VueUiSkeleton: e(() => import("./vue-ui-skeleton-BUS6A44x.js")),
      VueUiSmiley: e(() => import("./vue-ui-smiley-5CVa-rQU.js")),
      VueUiSparkbar: e(() => import("./vue-ui-sparkbar-DKeLvkHa.js")),
      VueUiSparkgauge: e(() => import("./vue-ui-sparkgauge-DLpPuJdG.js")),
      VueUiSparkHistogram: e(() => import("./vue-ui-sparkhistogram-BA8QV7Cu.js")),
      VueUiSparkline: e(() => import("./vue-ui-sparkline-BwOtPPij.js")),
      VueUiSparkStackbar: e(() => import("./vue-ui-sparkstackbar-DCS6RRgN.js")),
      VueUiTable: e(() => import("./vue-ui-table-DhRjI7oG.js")),
      VueUiTableSparkline: e(() => import("./vue-ui-table-sparkline-Ba_Ucvgb.js")),
      VueUiThermometer: e(() => import("./vue-ui-thermometer-C11VSZfb.js")),
      VueUiTiremarks: e(() => import("./vue-ui-tiremarks-Jz80HKpg.js")),
      VueUiTreemap: e(() => import("./vue-ui-treemap-B_qVGTnP.js")),
      VueUiVerticalBar: e(() => import("./vue-ui-vertical-bar-5MwcqOTN.js")),
      VueUiWaffle: e(() => import("./vue-ui-waffle-B0JbRRUv.js")),
      VueUiWheel: e(() => import("./vue-ui-wheel-pQBqSI5z.js")),
      VueUiXy: e(() => import("./vue-ui-xy-DRYbR_nu.js")),
      VueUiTableHeatmap: e(() => import("./vue-ui-table-heatmap-CT5nGoW-.js")),
      VueUiAccordion: e(() => import("./vue-ui-accordion-CxrNF8BI.js")),
      VueUiQuickChart: e(() => import("./vue-ui-quick-chart-DTEubspa.js")),
      VueUiCursor: e(() => import("./vue-ui-cursor-B2NOd5i-.js")),
      VueUiSparkTrend: e(() => import("./vue-ui-spark-trend-D9ww-Cv5.js")),
      VueUiStripPlot: e(() => import("./vue-ui-strip-plot-NykStkP9.js")),
      VueUiDumbbell: e(() => import("./vue-ui-dumbbell-D918XYc8.js")),
      VueUiWordCloud: e(() => import("./vue-ui-word-cloud-D39_9P7v.js")),
      VueUiXyCanvas: e(() => import("./vue-ui-xy-canvas-DZib_307.js")),
      VueUiFlow: e(() => import("./vue-ui-flow-DQ5q2b1Y.js")),
      VueUiParallelCoordinatePlot: e(() => import("./vue-ui-parallel-coordinate-plot-CQG_anr7.js")),
      VueUiTimer: e(() => import("./vue-ui-timer-lwjayVn0.js")),
      VueUiCarouselTable: e(() => import("./vue-ui-carousel-table-BgKL0rnF.js")),
      VueUiGizmo: e(() => import("./vue-ui-gizmo-ByuFn-0N.js")),
      VueUiStackbar: e(() => import("./vue-ui-stackbar-zcfxba5s.js")),
      VueUiBullet: e(() => import("./vue-ui-bullet-D3WmBrm4.js")),
      VueUiFunnel: e(() => import("./vue-ui-funnel-v5WCHaw6.js")),
      VueUiHistoryPlot: e(() => import("./vue-ui-history-plot-CkxvdQeV.js"))
    }, $ = {
      VueUi3dBar: ["config", "dataset"],
      VueUiAgePyramid: ["config", "dataset"],
      VueUiAnnotator: ["config", "dataset"],
      VueUiCandlestick: ["config", "dataset"],
      VueUiChestnut: ["config", "dataset"],
      VueUiDashboard: ["config", "dataset"],
      VueUiDigits: ["config", "dataset"],
      VueUiDonut: ["config", "dataset"],
      VueUiDonutEvolution: ["config", "dataset"],
      VueUiGalaxy: ["config", "dataset"],
      VueUiGauge: ["config", "dataset"],
      VueUiHeatmap: ["config", "dataset"],
      VueUiKpi: ["config", "dataset"],
      VueUiMiniLoader: ["config"],
      VueUiMolecule: ["config", "dataset"],
      VueUiMoodRadar: ["config", "dataset"],
      VueUiNestedDonuts: ["config", "dataset"],
      VueUiOnion: ["config", "dataset"],
      VueUiQuadrant: ["config", "dataset"],
      VueUiRadar: ["config", "dataset"],
      VueUiRating: ["config", "dataset"],
      VueUiRelationCircle: ["config", "dataset"],
      VueUiRings: ["config", "dataset"],
      VueUiScatter: ["config", "dataset"],
      VueUiScreenshot: ["config"],
      VueUiSkeleton: ["config"],
      VueUiSmiley: ["config", "dataset"],
      VueUiSparkbar: ["config", "dataset"],
      VueUiSparkgauge: ["config", "dataset"],
      VueUiSparkHistogram: ["config", "dataset"],
      VueUiSparkline: ["config", "dataset"],
      VueUiSparkStackbar: ["config", "dataset"],
      VueUiTable: ["config", "dataset"],
      VueUiTableSparkline: ["config", "dataset"],
      VueUiThermometer: ["config", "dataset"],
      VueUiTiremarks: ["config", "dataset"],
      VueUiTreemap: ["config", "dataset"],
      VueUiVerticalBar: ["config", "dataset"],
      VueUiWaffle: ["config", "dataset"],
      VueUiWheel: ["config", "dataset"],
      VueUiXy: ["config", "dataset"],
      VueUiTableHeatmap: ["config", "dataset"],
      VueUiAccordion: ["config"],
      VueUiQuickChart: ["config", "dataset"],
      VueUiCursor: ["config"],
      VueUiSparkTrend: ["config", "dataset"],
      VueUiStripPlot: ["config", "dataset"],
      VueUiDumbbell: ["config", "dataset"],
      VueUiWordCloud: ["config", "dataset"],
      VueUiXyCanvas: ["config", "dataset"],
      VueUiFlow: ["config", "dataset"],
      VueUiParallelCoordinatePlot: ["config", "dataset"],
      VueUiTimer: ["config"],
      VueUiCarouselTable: ["config", "dataset"],
      VueUiGizmo: ["config", "dataset"],
      VueUiStackbar: ["config", "dataset"],
      VueUiBullet: ["config", "dataset"],
      VueUiFunnel: ["config", "dataset"],
      VueUiHistoryPlot: ["config", "dataset"]
    }, g = c(() => !u[n.component]), j = c(() => u[n.component] || null), i = o(null), z = c(() => {
      const t = $[n.component] || [], a = {};
      return t.includes("config") && (a.config = Q.value), t.includes("dataset") && (a.dataset = X.value), a;
    }), p = o(() => null), m = o(() => null), d = o(() => null), V = o(() => null), U = o(() => null), f = o(() => null), v = o(() => null), h = o(() => null), k = o(() => null), S = o(() => null), y = o(() => null), b = o(() => null), T = o(() => null), A = o(() => null), C = o(() => null), P = o(() => null), D = o(() => null), x = o(() => null), H = o(() => null), L = o(() => null), _ = o(() => null), B = o(() => null), I = o(() => null), E = o(() => null);
    Y(() => {
      if (g.value)
        throw new Error(`

Vue Data UI exception:
The provided component "${n.component}" does not exist. Check the spelling.

Available components:

${Object.keys(u).map((t) => `. ${t}
`).join("")}`);
    }), O(i, async (t) => {
      t && (t.generatePdf && (p.value = t.generatePdf), t.generateImage && (d.value = t.generateImage), t.generateCsv && (m.value = t.generateCsv), t.getItemsPositions && (V.value = t.getItemsPositions), t.toggleReadonly && (U.value = t.toggleReadonly), t.shoot && (f.value = t.shoot), t.close && (v.value = t.close), t.restoreOrder && (h.value = t.restoreOrder), t.recalculateHeight && (k.value = t.recalculateHeight), t.toggleLock && (S.value = t.toggleLock), t.toggleTable && (y.value = t.toggleTable), t.toggleLabels && (b.value = t.toggleLabels), t.toggleSort && (T.value = t.toggleSort), t.toggleStack && (A.value = t.toggleStack), t.toggleTooltip && (C.value = t.toggleTooltip), t.start && (P.value = t.start), t.pause && (D.value = t.pause), t.reset && (x.value = t.reset), t.restart && (H.value = t.restart), t.lap && (L.value = t.lap), t.toggleAnimation && (_.value = t.toggleAnimation), t.pauseAnimation && (B.value = t.pauseAnimation), t.resumeAnimation && (I.value = t.resumeAnimation), t.toggleAnnotator && (E.value = t.toggleAnnotator));
    });
    const K = () => {
      const t = [
        "selectLegend",
        "selectDatapoint",
        "toggleOpenState",
        "saveAnnotations",
        "selectRoot",
        "selectBranch",
        "selectNut",
        "change",
        "selectPlot",
        "selectSide",
        "rate",
        "postImage",
        "hoverIndex",
        "selectX",
        "toggleLock",
        "toggleTooltip",
        "start",
        "pause",
        "reset",
        "restart",
        "lap",
        "toggleAnimation",
        "pauseAnimation",
        "resumeAnimation",
        "toggleAnnotator"
      ], a = {};
      return t.forEach((s) => {
        a[s] = (...l) => M(s, ...l);
      }), a;
    }, r = Z([]);
    return O([r, i], () => {
      if (i.value)
        for (; r.length; ) {
          const [t, ...a] = r.shift();
          typeof i.value[t] == "function" && i.value[t](...a);
        }
    }), G({
      getData: (...t) => i.value && typeof i.value.getData == "function" ? i.value.getData() : r.push(["getData", ...t]),
      generatePdf: p,
      generateCsv: m,
      generateImage: d,
      getItemsPositions: V,
      toggleReadonly: U,
      shoot: f,
      close: v,
      restoreOrder: h,
      recalculateHeight: k,
      toggleLock: S,
      toggleTable: y,
      toggleLabels: b,
      toggleSort: T,
      toggleStack: A,
      toggleTooltip: C,
      start: P,
      pause: D,
      reset: x,
      restart: H,
      lap: L,
      pauseAnimation: B,
      resumeAnimation: I,
      toggleAnimation: _,
      toggleAnnotator: E
    }), (t, a) => g.value ? (F(), R("div", Vt, [
      w("div", Ut, [
        tt(dt, {
          name: "moodFlat",
          stroke: "#FF0000"
        })
      ]),
      et(' The provided component "' + ot(it(W)) + '" does not exist ', 1)
    ])) : (F(), at(nt(j.value), rt({
      key: 1,
      ref_key: "currentComponentRef",
      ref: i
    }, z.value, lt(K())), ut({ _: 2 }, [
      st(t.$slots, (s, l) => ({
        name: l,
        fn: ct((q) => [
          gt(t.$slots, l, pt(mt(q)))
        ])
      }))
    ]), 1040));
  }
};
export {
  ht as default
};
