# =============================================================================
# FILE: ~/.sourcerc
# Description: Initializes third-party package managers and Oh My Zsh.
# =============================================================================

# Source the custom environment setup file if it exists and is not empty
if [[ -f "$HOME/.local/bin/env" && -r "$HOME/.local/bin/env" ]]; then
  source "$HOME/.local/bin/env"
fi

# Source the SDKMAN initialization script if it exists and is not empty
if [[ -f "$HOME/.sdkman/bin/sdkman-init.sh" && -r "$HOME/.sdkman/bin/sdkman-init.sh" ]]; then
  source "$HOME/.sdkman/bin/sdkman-init.sh"
fi

# Source the NVM initialization script if it exists and is not empty
if [[ -f "$HOME/.nvm/nvm.sh" && -r "$HOME/.nvm/nvm.sh" ]]; then
  source "$HOME/.nvm/nvm.sh"
fi

# =============================================================================
# CLAUDE CODE / AI GATEWAY
# =============================================================================
export ANTHROPIC_BASE_URL="https://gateway.ai.cloudflare.com/v1/9a71825e3842e918e0dff9ad84f50484/claude-code-gateway/anthropic"

# =============================================================================
# OH MY ZSH
# =============================================================================
if [[ -f "$HOME/.oh-my-zsh/oh-my-zsh.sh" && -r "$HOME/.oh-my-zsh/oh-my-zsh.sh" ]]; then
  source "$HOME/.oh-my-zsh/oh-my-zsh.sh"
else
  echo "Warning: Oh My Zsh not found or is empty."
fi

# =============================================================================
# GOOGLE CLOUD SDK
# =============================================================================
if [[ -f "$HOME/google-cloud-sdk/path.zsh.inc" ]]; then
  source "$HOME/google-cloud-sdk/path.zsh.inc"
fi

if [[ -f "$HOME/google-cloud-sdk/completion.zsh.inc" ]]; then
  source "$HOME/google-cloud-sdk/completion.zsh.inc"
fi

# =============================================================================
# NVM (Node Version Manager)
# =============================================================================
export NVM_DIR="$HOME/.nvm"

[[ -f "$NVM_DIR/nvm.sh" && -r "$NVM_DIR/nvm.sh" ]] && \. "$NVM_DIR/nvm.sh"
[[ -f "$NVM_DIR/bash_completion" && -r "$NVM_DIR/bash_completion" ]] && \. "$NVM_DIR/bash_completion"