import { defineComponent as S, computed as d, resolveComponent as s, createElementBlock as y, openBlock as i, renderSlot as N, createVNode as m, withCtx as c, createCommentVNode as j, createElementVNode as r, toDisplayString as v, mergeModels as A, useModel as B, ref as F, createBlock as x, normalizeStyle as O, withDirectives as P, unref as z, vShow as L, Fragment as R, renderList as U, normalizeClass as E } from "vue";
import { u as w } from "./_plugin-vue_export-helper-onplcgja.js";
const H = { class: "flex flex-col h-full" }, q = ["src"], G = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, J = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary text-center" }, Z = /* @__PURE__ */ S({
  __name: "NoData",
  props: {
    title: { default: "report.messages.noData" },
    subTitle: { default: "report.messages.adjustFiltersOrSelectADifferentTimeRange" },
    svgPath: { default: "" }
  },
  setup(p) {
    const { t: u } = w(), l = p, a = d(() => l.title === "report.messages.noData" ? u("report.messages.noData") : l.title), _ = d(() => l.subTitle === "report.messages.adjustFiltersOrSelectADifferentTimeRange" ? u("report.messages.adjustFiltersOrSelectADifferentTimeRange") : l.subTitle);
    return (e, f) => {
      const h = s("FmCard");
      return i(), y("div", H, [
        N(e.$slots, "menu"),
        m(h, {
          class: "p-24 h-full flex flex-col gap-2 items-center justify-center",
          variant: "flat"
        }, {
          default: c(() => [
            e.svgPath ? (i(), y("img", {
              key: 0,
              src: e.svgPath,
              alt: "No data illustration",
              class: "mb-4 w-80 h-80"
            }, null, 8, q)) : j("", !0),
            r("p", G, v(a.value), 1),
            r("p", J, v(_.value), 1)
          ]),
          _: 1
        })
      ]);
    };
  }
}), K = { class: "fm-typo-en-body-lg-400 flex gap-4 text-fm-color-typo-primary" }, Q = { class: "fm-typo-en-body-lg-400 line-clamp-1" }, W = { class: "sticky top-0" }, ee = /* @__PURE__ */ S({
  __name: "SelectComponent",
  props: /* @__PURE__ */ A({
    items: {
      type: Array,
      default: () => []
    },
    placeHolder: {
      type: String,
      default: ""
    },
    label: {
      type: String,
      default: ""
    },
    disableSearch: {
      type: Boolean,
      default: !1
    }
  }, {
    modelValue: { required: !0 },
    modelModifiers: {}
  }),
  emits: ["update:modelValue"],
  setup(p) {
    const { t: u } = w(), l = B(p, "modelValue"), a = p, _ = (t) => {
      l.value = t.value, setTimeout(() => {
        e.value = !1;
      }, 0);
    }, e = F(!1), f = F(""), h = d(
      () => a.items.filter(
        (t) => t.label.toLowerCase().indexOf(f.value.toLowerCase()) !== -1
      )
    ), C = d(
      () => {
        var t;
        return ((t = a.items.find((n) => n.value === l.value)) == null ? void 0 : t.label) ?? u("report.common.select");
      }
    ), V = d(() => a.items.filter((t) => t.value === l.value));
    return (t, n) => {
      const D = s("FmIcon"), M = s("FmField"), T = s("FmSearch"), k = s("FmMenuDivider"), I = s("FmMenuItem"), $ = s("FmMenu");
      return i(), x($, {
        trigger: "click",
        shift: !0,
        "max-height": 300,
        width: 200,
        onMenuChanged: n[1] || (n[1] = (g) => {
          e.value = g;
        })
      }, {
        "menu-button": c(() => [
          r("p", K, v(a.label), 1),
          m(M, {
            class: E(["cursor-pointer", `${e.value ? "border-fm-color-primary" : ""}`]),
            focused: e.value
          }, {
            append: c(() => [
              m(D, {
                color: "black",
                name: e.value ? "expand_less" : "expand_more",
                size: "md"
              }, null, 8, ["name"])
            ]),
            default: c(() => [
              r("div", Q, v(C.value), 1)
            ]),
            _: 1
          }, 8, ["class", "focused"])
        ]),
        "menu-wrapper": c(({ maxHeight: g }) => [
          r("div", {
            style: O({ maxHeight: `${g}px` }),
            class: "bg-fm-color-neutral-white overflow-y-auto overflow-x-hidden rounded-md shadow-light-300 w-[250px]"
          }, [
            P(r("div", W, [
              m(T, {
                modelValue: f.value,
                "onUpdate:modelValue": n[0] || (n[0] = (o) => f.value = o),
                placeholder: z(u)("report.select.filterPlaceholder")
              }, null, 8, ["modelValue", "placeholder"]),
              m(k)
            ], 512), [
              [L, !a.disableSearch]
            ]),
            (i(!0), y(R, null, U(h.value, (o) => (i(), x(I, {
              key: o.value,
              label: o.label,
              sublabel: o.sublabel,
              "model-value": V.value.some((b) => b.value === o.value),
              value: o.value,
              "onUpdate:modelValue": (b) => _(o)
            }, null, 8, ["label", "sublabel", "model-value", "value", "onUpdate:modelValue"]))), 128))
          ], 4)
        ]),
        _: 1
      });
    };
  }
});
export {
  Z as _,
  ee as a
};
