declare const __APP_VERSION__: string;
declare const __APP_BUILD_INFO__: string;

export const FRONTEND_VERSION = __APP_VERSION__;
export const FRONTEND_BUILD_INFO = __APP_BUILD_INFO__;

export function formatVersionLabel(version: string, buildInfo: string): string {
	const trimmedVersion = version.trim() || "0.1.0";
	const trimmedBuild = buildInfo.trim();
	if (trimmedBuild && trimmedBuild !== "dev") {
		return `${trimmedVersion}+${trimmedBuild}`;
	}
	return trimmedVersion;
}

export const FRONTEND_VERSION_LABEL = formatVersionLabel(
	FRONTEND_VERSION,
	FRONTEND_BUILD_INFO,
);
