import { defineComponent as _, resolveComponent as g, openBlock as r, createElementBlock as o, createVNode as v, withCtx as b, createElementVNode as c, toDisplayString as i, Fragment as n, renderList as d, createTextVNode as a, createCommentVNode as x, unref as h } from "vue";
import { useI18n as k } from "@feedmepos/mf-common";
const C = { class: "w-[500px] max-h-[60vh] overflow-y-auto" }, N = { class: "font-bold text-neutral-500 mx-1" }, A = { class: "mt-3" }, I = /* @__PURE__ */ _({
  __name: "CannotDelete",
  props: {
    subject: {
      type: String
    },
    items: {
      type: Array,
      default: () => []
    }
  },
  setup(e) {
    const { t } = k();
    return (s, u) => {
      const y = g("i18n-t");
      return r(), o("div", C, [
        v(y, {
          keypath: "inventory.common.usage.body",
          tag: "div"
        }, {
          subject: b(() => [
            c("span", N, i(e.subject), 1)
          ]),
          _: 1
        }),
        c("ol", A, [
          (r(!0), o(n, null, d(e.items, (f, p) => (r(), o("li", {
            class: "pl-5 font-bold text-neutral-500",
            key: p
          }, [
            u[0] || (u[0] = a(" • ")),
            (r(!0), o(n, null, d(f.chain, (m, l) => (r(), o(n, { key: l }, [
              l > 0 ? (r(), o(n, { key: 0 }, [
                a(" > ")
              ], 64)) : x("", !0),
              a(i(m.itemName) + " (" + i(h(t)(`inventory.common.usage.module.${m.moduleKey}`)) + ")", 1)
            ], 64))), 128))
          ]))), 128))
        ])
      ]);
    };
  }
});
function R(e) {
  const t = e.errorResponse;
  return !!t && typeof t == "object" && t.error === "VALIDATION_ERROR" && Array.isArray(t.errors) && t.errors.every((s) => typeof s.module == "string" && typeof s.name == "string");
}
function j(e) {
  return e.includes("variantCombinations") ? "variant" : e.startsWith("modules.catalog") ? "catalog" : e.startsWith("modules.item") ? "item" : e.startsWith("modules.group") ? "group" : "menu";
}
export {
  I as _,
  R as i,
  j as m
};
