import { _ as sortUniqueStrings } from "./string-normalization-e_fvmxMf.js";
import { i as loadPluginMetadataSnapshot } from "./plugin-metadata-snapshot-Bkwllh-7.js";
import { i as listAvailableManifestContractPlugins, t as hasManifestContractValue } from "./manifest-contract-eligibility-B5yM4KNC.js";
//#region src/plugins/manifest-contract-runtime.ts
function resolveManifestContractRuntimePluginResolution(params) {
	const snapshot = loadPluginMetadataSnapshot({
		config: params.cfg ?? {},
		env: process.env
	});
	const allContractPlugins = snapshot.plugins.filter((plugin) => hasManifestContractValue({
		plugin,
		contract: params.contract,
		value: params.value
	}));
	const bundledCompatPluginIds = allContractPlugins.filter((plugin) => plugin.origin === "bundled").map((plugin) => plugin.id);
	return {
		pluginIds: sortUniqueStrings(listAvailableManifestContractPlugins({
			snapshot: {
				index: snapshot.index,
				plugins: allContractPlugins
			},
			contract: params.contract,
			value: params.value,
			config: params.cfg
		}).map((plugin) => plugin.id)),
		bundledCompatPluginIds: sortUniqueStrings(bundledCompatPluginIds)
	};
}
//#endregion
export { resolveManifestContractRuntimePluginResolution as t };
