const require_rolldown_runtime = require('../../../../_virtual/rolldown_runtime.cjs');
const require_logger = require('../../../config/dist/esm/logger.cjs');
const require_getConfiguration = require('../../../config/dist/esm/configFile/getConfiguration.cjs');
const require_formatter = require('./chokidar/dist/esm/utils/formatter.cjs');
const require_index = require('./unmerged-dictionaries-entry/dist/esm/index.cjs');
let node_path = require("node:path");

//#region ../@intlayer/cli/dist/esm/listContentDeclaration.mjs
const listContentDeclarationRows = (options) => {
	const config = require_getConfiguration.getConfiguration(options?.configOptions);
	const unmergedDictionariesRecord = require_index.getUnmergedDictionaries(config);
	return Object.values(unmergedDictionariesRecord).flat().map((dictionary) => ({
		key: dictionary.key ?? "",
		path: (0, node_path.relative)(config.content.baseDir, dictionary.filePath ?? "Remote")
	}));
};
const listContentDeclaration = (options) => {
	const appLogger = require_logger.getAppLogger(require_getConfiguration.getConfiguration(options?.configOptions), { config: { prefix: "" } });
	const rows = listContentDeclarationRows(options);
	const lines = rows.map((r) => [
		require_logger.colon(` - ${require_logger.colorizeKey(r.key)}`, {
			colSize: rows.map((r$1) => r$1.key.length),
			maxSize: 60
		}),
		" - ",
		require_formatter.formatPath(r.path)
	].join(""));
	appLogger(`Content declaration files:`);
	lines.forEach((l) => {
		appLogger(l, { level: "info" });
	});
	appLogger(`Total content declaration files: ${require_logger.colorizeNumber(rows.length)}`);
};

//#endregion
exports.listContentDeclaration = listContentDeclaration;
//# sourceMappingURL=listContentDeclaration.cjs.map