"use client";
// src/platform/utils/lambda-endpoint.ts
var trimTrailingSlash = (value) => value.replace(/\/$/, "");
function getLambdaApiBase() {
  const directBase = import.meta.env.VITE_LAMBDA_CLIENT_BASE;
  if (directBase && directBase.trim().length > 0) return trimTrailingSlash(directBase);
  const gatewayBase = import.meta.env.VITE_API_GATEWAY_URL;
  if (gatewayBase && gatewayBase.trim().length > 0) return trimTrailingSlash(gatewayBase);
  throw new Error(
    "Missing workflow API base URL. Set VITE_LAMBDA_CLIENT_BASE or VITE_API_GATEWAY_URL."
  );
}
function buildLambdaApiUrl(path) {
  const normalizedPath = path.startsWith("/") ? path : `/${path}`;
  return `${getLambdaApiBase()}${normalizedPath}`;
}

export { buildLambdaApiUrl, getLambdaApiBase };
//# sourceMappingURL=chunk-3AY5HIQ6.mjs.map
//# sourceMappingURL=chunk-3AY5HIQ6.mjs.map