import Constants from 'expo-constants';

const { extra } = Constants.manifest2 || Constants.manifest;

export const API_HOST = extra?.API_HOST || Constants?.expoConfig?.extra?.API_HOST;
export const MAP_HOST = extra?.MAP_HOST || Constants?.expoConfig?.extra?.MAP_HOST;
export const VECTOR_MAP_HOST = extra?.VECTOR_MAP_HOST || Constants?.expoConfig?.extra?.VECTOR_MAP_HOST;

export const API_URL = `${API_HOST}/webapi`;

export let FASTEST_MAP_HOST: string = MAP_HOST;

export const APP_VERSION = Constants?.expoConfig?.version ?? Constants?.manifest?.version;

export const GOOGLE_MAP_PLACES_APIKEY =
  extra?.GOOGLE_MAP_PLACES_APIKEY || Constants?.expoConfig?.extra?.GOOGLE_MAP_PLACES_APIKEY;

export const WEBSOCKET_URL = extra?.WEBSOCKET_URL || Constants?.expoConfig?.extra?.WEBSOCKET_URL;
