// This function will execute at runtime in the browser
function computeApiBaseUrl() {
    // Check Vite env var first (for dev mode)
    const envUrl = import.meta.env?.VITE_API_BASE_URL;
    if (envUrl) {
        return envUrl;
    }
    // Check window object for injected values (for production)
    if (typeof window !== 'undefined') {
        const win = window;
        if (win.AGI_SERVER_URL) {
            return win.AGI_SERVER_URL;
        }
        if (win.__AGI_API_URL__) {
            return win.__AGI_API_URL__;
        }
    }
    // Fallback for standalone dev
    return 'http://localhost:9100';
}
export function getRuntimeApiBaseUrl() {
    return computeApiBaseUrl();
}
export const API_BASE_URL = computeApiBaseUrl();
export const config = {
    apiBaseUrl: API_BASE_URL,
};
//# sourceMappingURL=config.js.map