import { getTranslatableFieldsRegistry } from "@open-mercato/shared/lib/localization/translatable-fields";
const WIDGET_ID = "translations.injection.translation-manager";
function addEntitySpots(table, entityType) {
  const [module, entitySlug] = entityType.split(":");
  if (!module || !entitySlug) return;
  const fullSpot = `crud-form:${module}.${entitySlug}:header`;
  table[fullSpot] = WIDGET_ID;
  const prefix = `${module}_`;
  if (!entitySlug.startsWith(prefix)) return;
  const shortSpot = `crud-form:${module}.${entitySlug.slice(prefix.length)}:header`;
  if (shortSpot !== fullSpot) {
    table[shortSpot] = WIDGET_ID;
  }
}
function buildInjectionTable(allFields = getTranslatableFieldsRegistry()) {
  const table = {};
  for (const entityType of Object.keys(allFields)) {
    addEntitySpots(table, entityType);
  }
  return table;
}
const injectionTable = buildInjectionTable();
var injection_table_default = injectionTable;
export {
  buildInjectionTable,
  injection_table_default as default,
  injectionTable
};
//# sourceMappingURL=injection-table.js.map
