import { createRequire as _createRequire } from 'node:module';
const require = _createRequire(import.meta.url);
import {
  readAppManifestFile
} from "./chunk-KUGUNAKD.js";
import {
  updateAppManifestWithBaseUrl,
  updateBlocksComponents,
  updateMonitoring,
  updateTopology
} from "./chunk-HWET32VV.js";
import {
  init_esm_shims
} from "./chunk-PYIAC2GK.js";

// src/preview/create-preview-tag.ts
init_esm_shims();
var createPreviewTag = async ({
  model,
  arm,
  serveUrl,
  backendServerUrl,
  blocksComponents,
  topologyComponentId,
  monitoringData,
  monitoringComponentId
}) => {
  const manifest = await readAppManifestFile(model.projectFolder);
  const updatedManifest = updateMonitoring(
    updateTopology(
      updateAppManifestWithBaseUrl(
        updateBlocksComponents(manifest, blocksComponents),
        serveUrl,
        backendServerUrl
      ),
      {
        id: topologyComponentId,
        baseApiUrl: backendServerUrl
      }
    ),
    {
      id: monitoringComponentId,
      monitoring: monitoringData
    }
  );
  return arm.createAppRelease(updatedManifest, model.config.projectId);
};

export {
  createPreviewTag
};
//# sourceMappingURL=chunk-BBL4SXGY.js.map