import { defineComponent as R, computed as V, createElementBlock as x, openBlock as a, createElementVNode as y, createVNode as u, unref as e, isRef as p, withCtx as _, createBlock as g, createCommentVNode as k, useModel as $, resolveComponent as f, normalizeClass as C, Fragment as w, renderList as M, toDisplayString as T } from "vue";
import { b as B } from "./vue-i18n-C1hP_yGq.js";
import { storeToRefs as D } from "pinia";
import { a as I } from "./NavigationTab.vue_vue_type_script_setup_true_lang-Dbo0pwH4.js";
import { _ as U } from "./DateRangeSelect.vue_vue_type_script_setup_true_lang-BZUipGZh.js";
import { _ as N } from "./BaseDialog.vue_vue_type_script_setup_true_lang-Dmpc24i4.js";
import { a as S } from "./FilterSelector.vue_vue_type_script_setup_true_lang-CIh5MO0J.js";
import { useRoute as z } from "vue-router";
import { useBreakpoints as E } from "@feedmepos/ui-library";
const L = { class: "flex flex-col gap-2 overflow-x-auto overflow-y-hidden scrollbar-hide" }, O = { class: "flex flex-col gap-2 py-2" }, q = /* @__PURE__ */ R({
  __name: "Filter",
  setup(F) {
    const {
      locations: d,
      selectedLocationIds: n,
      dateRange: c,
      compareDateRange: l,
      timeRange: m,
      defaultDateSetting: s,
      selectTimeDefault: i
    } = D(B()), v = z(), r = V(() => v.name === "overview");
    return (b, t) => (a(), x("div", L, [
      y("div", O, [
        u(I, {
          modelValue: e(n),
          "onUpdate:modelValue": t[5] || (t[5] = (o) => p(n) ? n.value = o : null),
          options: e(d)
        }, {
          default: _(() => [
            u(U, {
              "date-range": e(c),
              "onUpdate:dateRange": t[0] || (t[0] = (o) => p(c) ? c.value = o : null),
              "compare-date-range": e(l),
              "onUpdate:compareDateRange": t[1] || (t[1] = (o) => p(l) ? l.value = o : null),
              "compare-type": e(s).defaultCompareType,
              "onUpdate:compareType": t[2] || (t[2] = (o) => e(s).defaultCompareType = o),
              compare: ""
            }, null, 8, ["date-range", "compare-date-range", "compare-type"]),
            u(N, {
              "time-range": e(m),
              "onUpdate:timeRange": t[3] || (t[3] = (o) => p(m) ? m.value = o : null),
              "select-time-default": e(i),
              "onUpdate:selectTimeDefault": t[4] || (t[4] = (o) => p(i) ? i.value = o : null),
              "default-date-range": e(s).timeOptions
            }, null, 8, ["time-range", "select-time-default", "default-date-range"]),
            r.value ? k("", !0) : (a(), g(S, { key: 0 }))
          ]),
          _: 1
        }, 8, ["modelValue", "options"])
      ])
    ]));
  }
}), j = { class: "fm-typo-en-body-md-400" }, Y = /* @__PURE__ */ R({
  __name: "MenuTab",
  props: {
    modelValue: { required: !1, default: [] },
    modelModifiers: {}
  },
  emits: ["update:modelValue"],
  setup(F) {
    const d = $(F, "modelValue"), { breakpoints: n } = E();
    return (c, l) => {
      const m = f("FmButton"), s = f("FmIcon"), i = f("FmMenuItem"), v = f("FmMenu");
      return a(), x("div", {
        "data-menu-tab": "true",
        class: C(["flex items-start pb-2 px-24", `${e(n).lg || e(n).md ? "px-24" : "pl-3"}`])
      }, [
        u(q),
        l[0] || (l[0] = y("div", { class: "flex grow" }, null, -1)),
        d.value.length > 0 ? (a(), g(v, {
          key: 0,
          trigger: "click",
          placement: "left",
          shift: !0,
          class: C(e(n).sm || e(n).xs ? "pr-3" : "")
        }, {
          "menu-button": _(() => [
            u(m, {
              "append-icon": "more_vert",
              variant: "tertiary",
              size: "md",
              class: "w-[36px] bg-none"
            })
          ]),
          default: _(() => [
            (a(!0), x(w, null, M(d.value, (r, b) => (a(), g(i, {
              key: `button-${b}`,
              onClick: r.onClick
            }, {
              label: _(() => [
                r.prependIcon ?? !1 ? (a(), g(s, {
                  key: 0,
                  name: r.icon
                }, null, 8, ["name"])) : k("", !0),
                y("p", j, T(r.label), 1)
              ]),
              _: 2
            }, 1032, ["onClick"]))), 128))
          ]),
          _: 1
        }, 8, ["class"])) : k("", !0)
      ], 2);
    };
  }
});
export {
  Y as _
};
