27 lines
820 B
TypeScript
27 lines
820 B
TypeScript
/** Participant SPA host — never marketing apex (eventbuzz.live). */
|
|
function eventbuzzPublicBase(): string {
|
|
const fromEnv =
|
|
(typeof import.meta.env.VITE_EVENTBUZZ_PUBLIC_URL === "string" &&
|
|
import.meta.env.VITE_EVENTBUZZ_PUBLIC_URL.trim()) ||
|
|
"";
|
|
const raw = (fromEnv || (import.meta.env.DEV ? "http://localhost:5174" : "https://join.eventbuzz.live")).replace(
|
|
/\/+$/,
|
|
"",
|
|
);
|
|
try {
|
|
const u = new URL(raw);
|
|
if (u.hostname === "eventbuzz.live" || u.hostname === "www.eventbuzz.live") {
|
|
u.hostname = "join.eventbuzz.live";
|
|
return u.origin;
|
|
}
|
|
} catch {
|
|
/* keep raw */
|
|
}
|
|
return raw;
|
|
}
|
|
|
|
export function aiAvatarVisitorUrl(uploadToken: string): string {
|
|
const base = eventbuzzPublicBase();
|
|
return `${base}/ai-avatar/${encodeURIComponent(uploadToken)}`;
|
|
}
|