import { computed as p, toValue as o } from "vue";
import { a2 as n } from "./app-Bpb4394e.js";
import { useCoreStore as c } from "@feedmepos/mf-common";
function g(t, i = "all") {
  const m = c();
  return { hasPermission: p(() => {
    var e;
    const r = o(t), u = o(i);
    if (r.length === 0) return !0;
    const s = ((e = m.sessionUser.value) == null ? void 0 : e.permissions) ?? [];
    return u === "any" ? r.some((a) => n([a], s).granted) : n(r, s).granted;
  }) };
}
export {
  g as u
};
