import { toRefs as ot, defineAsyncComponent as e, computed as s, ref as o, onMounted as it, watch as $, shallowReactive as at, createElementBlock as nt, createBlock as m, openBlock as c, normalizeStyle as lt, createElementVNode as rt, createTextVNode as ut, createCommentVNode as X, toDisplayString as st, resolveDynamicComponent as ct, mergeProps as gt, toHandlers as pt, createSlots as mt, renderList as dt, withCtx as Vt, renderSlot as Ut, normalizeProps as ft, guardReactiveProps as vt } from "vue";
import Q from "./BaseIcon-Cxzy5vMD.js";
const kt = { style: { width: "36px" } }, yt = {
  __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",
    "selectGroup",
    "selectRibbon"
  ],
  setup(j, { expose: z, emit: K }) {
    const n = j, { component: St, dataset: q, config: Y } = ot(n), g = {
      VueUi3dBar: e(() => import("./vue-ui-3d-bar-Bw5eaxc9.js")),
      VueUiAgePyramid: e(() => import("./vue-ui-age-pyramid-D0gBQw8X.js")),
      VueUiAnnotator: e(() => import("./vue-ui-annotator-DlcWoI3N.js")),
      VueUiCandlestick: e(() => import("./vue-ui-candlestick-85YmMYyP.js")),
      VueUiChestnut: e(() => import("./vue-ui-chestnut-B87se5P9.js")),
      VueUiDashboard: e(() => import("./vue-ui-dashboard-koc4m8YD.js")),
      VueUiDigits: e(() => import("./vue-ui-digits-a85ERBus.js")),
      VueUiDonut: e(() => import("./vue-ui-donut-Dgq-t23H.js")),
      VueUiDonutEvolution: e(() => import("./vue-ui-donut-evolution-BplxUn27.js")),
      VueUiGalaxy: e(() => import("./vue-ui-galaxy-CEnVeZAi.js")),
      VueUiGauge: e(() => import("./vue-ui-gauge-C7b6k24U.js")),
      VueUiHeatmap: e(() => import("./vue-ui-heatmap-BLoaEofW.js")),
      VueUiKpi: e(() => import("./vue-ui-kpi-D4pZ3CJ2.js")),
      VueUiMiniLoader: e(() => import("./vue-ui-mini-loader-D2QcTAa8.js")),
      VueUiMolecule: e(() => import("./vue-ui-molecule-BYVCvz1r.js")),
      VueUiMoodRadar: e(() => import("./vue-ui-mood-radar-B9zgFFlO.js")),
      VueUiNestedDonuts: e(() => import("./vue-ui-nested-donuts-n6rFlsNU.js")),
      VueUiOnion: e(() => import("./vue-ui-onion-B9fUzbb6.js")),
      VueUiQuadrant: e(() => import("./vue-ui-quadrant-DwdrLzcC.js")),
      VueUiRadar: e(() => import("./vue-ui-radar-B1OXJn1d.js")),
      VueUiRating: e(() => import("./vue-ui-rating-_WB5qAQ6.js")),
      VueUiRelationCircle: e(() => import("./vue-ui-relation-circle-CW73Nbxq.js")),
      VueUiRings: e(() => import("./vue-ui-rings-B8rqh0-_.js")),
      VueUiScatter: e(() => import("./vue-ui-scatter-01DXyF2q.js")),
      VueUiSkeleton: e(() => import("./vue-ui-skeleton-BufuSja5.js")),
      VueUiSmiley: e(() => import("./vue-ui-smiley-DfLMSjyl.js")),
      VueUiSparkbar: e(() => import("./vue-ui-sparkbar-CSJkcisH.js")),
      VueUiSparkgauge: e(() => import("./vue-ui-sparkgauge-CV7lhSGE.js")),
      VueUiSparkHistogram: e(() => import("./vue-ui-sparkhistogram-ClDu95-3.js")),
      VueUiSparkline: e(() => import("./vue-ui-sparkline-DT7wW1fR.js")),
      VueUiSparkStackbar: e(() => import("./vue-ui-sparkstackbar-YVKlhkKi.js")),
      VueUiTable: e(() => import("./vue-ui-table-DHaMznpt.js")),
      VueUiTableSparkline: e(() => import("./vue-ui-table-sparkline-BFgLj1Ik.js")),
      VueUiThermometer: e(() => import("./vue-ui-thermometer-pUxYKQhF.js")),
      VueUiTiremarks: e(() => import("./vue-ui-tiremarks-DdNVrSbT.js")),
      VueUiTreemap: e(() => import("./vue-ui-treemap-BDpXhqzI.js")),
      VueUiVerticalBar: e(() => import("./vue-ui-vertical-bar-ByJLpT85.js")),
      VueUiWaffle: e(() => import("./vue-ui-waffle-Dp3DOosi.js")),
      VueUiWheel: e(() => import("./vue-ui-wheel-DBz7onD-.js")),
      VueUiXy: e(() => import("./vue-ui-xy-CFm5IDQP.js")),
      VueUiTableHeatmap: e(() => import("./vue-ui-table-heatmap-Ci2H0bXz.js")),
      VueUiAccordion: e(() => import("./vue-ui-accordion-CJnR6fHi.js")),
      VueUiQuickChart: e(() => import("./vue-ui-quick-chart-Dad-wlg0.js")),
      VueUiCursor: e(() => import("./vue-ui-cursor-3XMz_kBQ.js")),
      VueUiSparkTrend: e(() => import("./vue-ui-spark-trend-d0lcXznw.js")),
      VueUiStripPlot: e(() => import("./vue-ui-strip-plot-BiYJlrH3.js")),
      VueUiDumbbell: e(() => import("./vue-ui-dumbbell-2ipG57aA.js")),
      VueUiWordCloud: e(() => import("./vue-ui-word-cloud-CG84NZet.js")),
      VueUiXyCanvas: e(() => import("./vue-ui-xy-canvas-BVeP6Xmm.js")),
      VueUiFlow: e(() => import("./vue-ui-flow-DFlHSj8M.js")),
      VueUiParallelCoordinatePlot: e(() => import("./vue-ui-parallel-coordinate-plot-QokZ1gwW.js")),
      VueUiTimer: e(() => import("./vue-ui-timer-DfQM6a6k.js")),
      VueUiCarouselTable: e(() => import("./vue-ui-carousel-table-DbY5LTHJ.js")),
      VueUiGizmo: e(() => import("./vue-ui-gizmo-eJFYYvWM.js")),
      VueUiStackbar: e(() => import("./vue-ui-stackbar-CRjmJOju.js")),
      VueUiBullet: e(() => import("./vue-ui-bullet-C6FMBrAT.js")),
      VueUiFunnel: e(() => import("./vue-ui-funnel-Bk0Fg5Fd.js")),
      VueUiHistoryPlot: e(() => import("./vue-ui-history-plot-QjiUbA7Y.js")),
      VueUiCirclePack: e(() => import("./vue-ui-circle-pack-Cd20ryi8.js")),
      VueUiWorld: e(() => import("./vue-ui-world-Dc8U0Mmg.js")),
      VueUiRidgeline: e(() => import("./vue-ui-ridgeline-DW_YX94e.js")),
      VueUiChord: e(() => import("./vue-ui-chord-mQl3OTYa.js"))
    }, J = {
      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"],
      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"],
      VueUiCirclePack: ["config", "dataset"],
      VueUiWorld: ["config", "dataset"],
      VueUiRidgeline: ["config", "dataset"],
      VueUiChord: ["config", "dataset"]
    }, Z = K, d = s(() => !g[n.component]), R = s(() => g[n.component] || null), i = o(null), w = s(() => {
      const t = J[n.component] || [], a = {};
      return t.includes("config") && (a.config = Y.value), t.includes("dataset") && (a.dataset = q.value), a;
    }), V = o(() => null), U = o(() => null), f = o(() => null), v = o(() => null), k = o(() => null), S = o(() => null), h = o(() => null), b = o(() => null), y = o(() => null), C = o(() => null), A = o(() => null), T = o(() => null), P = o(() => null), D = o(() => null), x = o(() => null), I = o(() => null), F = o(() => null), H = o(() => null), L = o(() => null), N = o(() => null), B = o(() => null), G = o(() => null), E = o(() => null), _ = o(() => null), O = o(() => null), W = o(() => null), M = o(() => null);
    it(() => {
      d.value && console.error(`

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

Available components:

${Object.keys(g).map((t) => `. ${t}
`).join("")}`);
    }), $(i, async (t) => {
      t && (t.generatePdf && (V.value = t.generatePdf), t.generateImage && (f.value = t.generateImage), t.generateCsv && (U.value = t.generateCsv), t.getItemsPositions && (v.value = t.getItemsPositions), t.toggleReadonly && (k.value = t.toggleReadonly), t.shoot && (S.value = t.shoot), t.close && (h.value = t.close), t.restoreOrder && (b.value = t.restoreOrder), t.recalculateHeight && (y.value = t.recalculateHeight), t.toggleLock && (C.value = t.toggleLock), t.toggleTable && (A.value = t.toggleTable), t.toggleLabels && (T.value = t.toggleLabels), t.toggleSort && (P.value = t.toggleSort), t.toggleStack && (D.value = t.toggleStack), t.toggleTooltip && (x.value = t.toggleTooltip), t.start && (I.value = t.start), t.pause && (F.value = t.pause), t.reset && (H.value = t.reset), t.restart && (L.value = t.restart), t.lap && (N.value = t.lap), t.toggleAnimation && (B.value = t.toggleAnimation), t.pauseAnimation && (G.value = t.pauseAnimation), t.resumeAnimation && (E.value = t.resumeAnimation), t.toggleAnnotator && (_.value = t.toggleAnnotator), t.selectNode && (O.value = t.selectNode), t.selectGroup && (W.value = t.selectGroup), t.selectRibbon && (M.value = t.selectRibbon));
    });
    const tt = () => {
      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",
        "selectNode",
        "selectGroup",
        "selectRibbon"
      ], a = {};
      return t.forEach((p) => {
        a[p] = (...u) => Z(p, ...u);
      }), a;
    }, l = at([]);
    $([l, i], () => {
      if (i.value)
        for (; l.length; ) {
          const [t, ...a] = l.shift();
          typeof i.value[t] == "function" && i.value[t](...a);
        }
    }), z({
      getData: (...t) => i.value && typeof i.value.getData == "function" ? i.value.getData() : l.push(["getData", ...t]),
      generatePdf: V,
      generateCsv: U,
      generateImage: f,
      getItemsPositions: v,
      toggleReadonly: k,
      shoot: S,
      close: h,
      restoreOrder: b,
      recalculateHeight: y,
      toggleLock: C,
      toggleTable: A,
      toggleLabels: T,
      toggleSort: P,
      toggleStack: D,
      toggleTooltip: x,
      start: I,
      pause: F,
      reset: H,
      restart: L,
      lap: N,
      pauseAnimation: G,
      resumeAnimation: E,
      toggleAnimation: B,
      toggleAnnotator: _,
      selectNode: O,
      selectGroup: W,
      selectRibbon: M
    });
    const r = s(() => {
      let t = `The provided component ${n.component} does not exist.`;
      return ["VueUiIcon", "VueUiPattern", "Arrow"].includes(n.component) ? (t = `${n.component} is not supported by the VueDataUi universal component. You must import it individually.`, console.warn(t), {
        status: "notSupported",
        message: t
      }) : (console.warn(t), {
        status: "unknown",
        message: t
      });
    });
    return (t, a) => d.value ? (c(), nt("div", {
      key: 0,
      style: lt({
        width: "100%",
        display: "flex",
        gap: "6px",
        alignItems: "center",
        color: r.value.status === "notSupported" ? "#FF9000" : "#FF0000"
      })
    }, [
      rt("div", kt, [
        r.value.status === "unknown" ? (c(), m(Q, {
          key: 0,
          name: "moodFlat",
          stroke: "#FF0000"
        })) : X("", !0),
        r.value.status === "notSupported" ? (c(), m(Q, {
          key: 1,
          name: "circleExclamation",
          stroke: "#FF9000"
        })) : X("", !0)
      ]),
      ut(" " + st(r.value.message), 1)
    ], 4)) : (c(), m(ct(R.value), gt({
      key: 1,
      ref_key: "currentComponentRef",
      ref: i
    }, w.value, pt(tt())), mt({ _: 2 }, [
      dt(t.$slots, (p, u) => ({
        name: u,
        fn: Vt((et) => [
          Ut(t.$slots, u, ft(vt(et)))
        ])
      }))
    ]), 1040));
  }
};
export {
  yt as default
};
