import { formatVersionCombination } from './5OKX3IYN.js';
import { findToolsByType, findDefaultCombination, findToolByName, findMatrixByType, getToolDefaultVersion, getToolSupportedVersions } from './W2CW3JVG.js';
import { versionMatrices } from './MWXKZUMG.js';
import { init_esm_shims, __name } from './4RNWLMHM.js';

// src/display/version-display.ts
init_esm_shims();
function displayVersionCombinations() {
  console.log("\n\u{1F680} LayerZero VM Tool - Supported Version Combinations\n");
  for (const matrix of versionMatrices) {
    const typeTools = findToolsByType(matrix.toolType);
    if (typeTools.length === 0) continue;
    const toolNames = typeTools.map((tool) => tool.name).join(", ");
    console.log(`\u{1F4E6} ${matrix.toolType.toUpperCase()} Type (tools: ${toolNames})`);
    console.log("\u2500".repeat(50));
    const defaultCombination = findDefaultCombination(matrix);
    console.log("\u{1F3AF} Default:");
    console.log(formatVersionCombination(defaultCombination, true));
    console.log();
    console.log("\u{1F4CB} All supported combinations:");
    matrix.combinations.forEach((combo) => {
      const isDefault = combo.id === defaultCombination.id;
      console.log(formatVersionCombination(combo, isDefault));
    });
    console.log();
  }
  console.log("\u{1F4A1} Usage examples:");
  console.log("  lz-tool anchor --anchor-version 0.29.0 --solana-version 1.17.31 build");
  console.log("  lz-tool anchor --anchor-version 0.30.0 build  # Auto-selects compatible solana version");
  console.log("  ANCHOR_VERSION=0.29.0 lz-tool anchor build    # Using environment variables");
  console.log();
}
__name(displayVersionCombinations, "displayVersionCombinations");
function displayToolVersionInfo(toolName) {
  const tool = findToolByName(toolName);
  if (!tool) {
    console.error(`\u274C Tool '${toolName}' not found`);
    return;
  }
  const typeTools = findToolsByType(tool.toolType);
  const matrix = findMatrixByType(tool.toolType);
  const defaultVersion = getToolDefaultVersion(tool.name);
  const supportedVersions = getToolSupportedVersions(tool.name);
  console.log(`
\u{1F527} ${tool.name.toUpperCase()} Version Information`);
  console.log("\u2500".repeat(40));
  console.log(`Type: ${tool.toolType}`);
  console.log(`Default version: ${defaultVersion}`);
  console.log(`Supported versions: ${supportedVersions.join(", ")}`);
  console.log();
  if (tool.defaultVolumes && tool.defaultVolumes.length > 0) {
    console.log("\u{1F4E6} Default cache volumes:");
    tool.defaultVolumes.forEach((volume) => {
      const volumeDesc = volume.type === "isolate" ? `${volume.name} \u2192 ${volume.containerPath}` : `${volume.hostPath} \u2192 ${volume.containerPath}`;
      console.log(`  \u2022 ${volumeDesc}`);
    });
    console.log("  \u{1F4A1} Use -v to override or add additional volumes");
    console.log();
  }
  if (matrix && typeTools.length > 1) {
    const defaultCombination = findDefaultCombination(matrix);
    console.log("\u{1F517} Compatible combinations with other tools:");
    matrix.combinations.forEach((combo) => {
      const toolVersion = combo.versions[tool.name];
      if (toolVersion != null && toolVersion.length > 0) {
        const isDefault = combo.id === defaultCombination.id;
        console.log(formatVersionCombination(combo, isDefault));
      }
    });
    console.log();
  }
  console.log("\u{1F4DD} Version resolution priority:");
  console.log("  1. Command line options (--{tool}-version)");
  console.log(`  2. Environment variables (${tool.name.toUpperCase()}_VERSION)`);
  console.log("  3. .versions file");
  console.log("  4. Default version");
  console.log();
}
__name(displayToolVersionInfo, "displayToolVersionInfo");

export { displayToolVersionInfo, displayVersionCombinations };
//# sourceMappingURL=BA5XKPUD.js.map
//# sourceMappingURL=BA5XKPUD.js.map