import { getImageTag } from './J2675KOZ.js';
import { getImageName } from './KWRJPB5T.js';
import { init_esm_shims, __name } from './6AHA7PAZ.js';
import { constantCase } from 'es-toolkit';
import { join } from 'path';

// src/github/matrix.ts
init_esm_shims();
var TAG_SEPARATORS = [
  "-",
  "_"
];
var generateGithubMatrix = /* @__PURE__ */ __name((images, directory) => {
  const createImageEntry = /* @__PURE__ */ __name((image) => {
    const imageName = getImageName(image.name);
    const tags = TAG_SEPARATORS.map((separator) => getImageTag(image, separator));
    return {
      entry: {
        name: image.name,
        build_args: Object.entries({
          ...image.versions,
          ...image.dependencies
        }).sort().map(([key, value]) => `${constantCase(key)}_VERSION=${value}`),
        directory: join(directory, "docker", image.name),
        image_name: imageName,
        tags
      },
      image
    };
  }, "createImageEntry");
  const results = Object.values(images).map(createImageEntry);
  const imageEntries = results.map((r) => r.entry);
  const mirroredImages = results.filter((result) => result.image.mirrorRegistries?.length).flatMap((result) => result.image.mirrorRegistries.map((mirror) => ({
    name: result.entry.name,
    image_name: result.entry.image_name,
    tags: result.entry.tags,
    mirror
  })));
  return {
    images: imageEntries,
    mirroredImages
  };
}, "generateGithubMatrix");

export { generateGithubMatrix };
//# sourceMappingURL=4JD7YXQE.js.map
//# sourceMappingURL=4JD7YXQE.js.map