"""Firebase client + Admin SDK path helpers."""

from __future__ import annotations

from pathlib import Path


def resolve_firebase_credentials_path(path: str, base_dir: Path) -> str:
    """Return an absolute path for the Firebase Admin service account JSON."""
    path = (path or '').strip()
    if not path:
        return ''
    candidate = Path(path)
    if not candidate.is_absolute():
        candidate = base_dir / candidate
    return str(candidate.resolve())


def get_firebase_client_config() -> dict:
    from django.conf import settings

    return dict(getattr(settings, 'FIREBASE_CLIENT_CONFIG', {}) or {})
