function registerGlob(modules, into) {
  for (const [file, mod] of Object.entries(modules)) {
    const base = file.split("/").pop()?.replace(/\.vue$/, "");
    if (!base?.startsWith("vm-") || !mod?.default)
      continue;
    into[base] = mod.default;
  }
}
const map = {};
registerGlob(import.meta.glob("./components/vm-*.vue", { eager: true }), map);
registerGlob(import.meta.glob("../components/vm-*.vue", { eager: true }), map);
export function registerCrudComponent(name, comp) {
  map[name] = comp;
}
export function resolveCrudComponent(name) {
  if (!name)
    return;
  if (typeof name !== "string")
    return name;
  return map[name];
}
