"use client";
'use strict';

// src/platform/utils/lambda-endpoint.ts
var trimTrailingSlash = (value) => value.replace(/\/$/, "");
function getLambdaApiBase() {
  const directBase = undefined.VITE_LAMBDA_CLIENT_BASE;
  if (directBase && directBase.trim().length > 0) return trimTrailingSlash(directBase);
  const gatewayBase = undefined.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}`;
}

exports.buildLambdaApiUrl = buildLambdaApiUrl;
exports.getLambdaApiBase = getLambdaApiBase;
//# sourceMappingURL=chunk-2OZZH2IO.js.map
//# sourceMappingURL=chunk-2OZZH2IO.js.map