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