const configuredReservationHotelId = import.meta.env.VITE_RESERVATION_HOTEL_ID?.trim()

export const reservationHotelId = configuredReservationHotelId || null

let reservationHotelIdProvider: (() => string | null | undefined) | null = null

export function setReservationHotelIdProvider(provider: (() => string | null | undefined) | null): void {
  reservationHotelIdProvider = provider
}

export function getReservationHotelId(): string | null {
  const providedHotelId = reservationHotelIdProvider?.()?.trim()
  return providedHotelId || reservationHotelId
}
