import { defineComponent as w, computed as c, resolveComponent as $, createBlock as l, openBlock as r, withCtx as y, createVNode as u, createElementVNode as h, unref as e, normalizeStyle as C, normalizeClass as d, createElementBlock as _, Fragment as b, renderList as B } from "vue";
import { _ as F } from "./FilterSelector.vue_vue_type_script_setup_true_lang-jDZZAdUQ.js";
import { _ as L } from "./Default.vue_vue_type_script_setup_true_lang-BUIcdcLn.js";
import { u as P } from "./BaseDialog.vue_vue_type_script_setup_true_lang-B2CdeeFj.js";
import { storeToRefs as R } from "pinia";
import { _ as S } from "./NoData.vue_vue_type_script_setup_true_lang-CDKHIlF2.js";
import { useBreakpoints as V } from "@feedmepos/ui-library";
import { _ as z } from "./MenuTab.vue_vue_type_script_setup_true_lang-Dtv5xe0O.js";
import { useI18n as D } from "@feedmepos/mf-common";
import { r as E } from "./i18n-CI_sQ5d_.js";
const M = /* @__PURE__ */ w({
  __name: "OverviewView",
  setup(H) {
    const { t: n, te: f } = D(), v = P(), { breakpoints: o } = V(), { isOpenDownloadDialog: g, overviewReport: a } = R(v), s = c(() => {
      var t;
      return ((t = a.value) == null ? void 0 : t.tiles) || [];
    }), x = c(() => {
      var t;
      return E(n, f, (t = a.value) == null ? void 0 : t.name, "other");
    });
    return (t, i) => {
      const k = $("FmPageHead");
      return r(), l(L, null, {
        default: y(() => [
          u(k, {
            title: x.value,
            class: "h-[68px]",
            actions: [
              {
                label: e(n)("report.common.download"),
                value: "download",
                isPrimary: !0,
                prependIcon: "download"
              }
            ],
            "onClick:action": i[0] || (i[0] = (m) => g.value = !0)
          }, null, 8, ["title", "actions"]),
          u(z),
          h("div", {
            class: d(`flex flex-col gap-2 ${e(o).sm || e(o).xs ? "mb-20" : ""}`),
            style: C({ height: `calc(100% - ${e(o).lg || e(o).md ? 72 : 64}px)` })
          }, [
            s.value.length > 0 && e(a) ? (r(), _("div", {
              key: 0,
              class: d(["grid grid-cols-12", e(o).sm || e(o).xs ? "px-3 gap-[16px]" : "px-24 gap-[24px]"])
            }, [
              (r(!0), _(b, null, B(s.value, (m, p) => (r(), l(F, {
                key: `widget_${e(a).id}_${p}`,
                "model-value": m,
                index: p
              }, null, 8, ["model-value", "index"]))), 128))
            ], 2)) : (r(), l(S, { key: 1 }))
          ], 6)
        ]),
        _: 1
      });
    };
  }
});
export {
  M as default
};
