def find_new_citation_spans(
    text: str, tracker: CitationTracker
) -> dict[str, list[Tuple[int, int]]]:
    """
    Extract citation spans that haven't been processed yet.

    Args:
        text: Text to search. If None, returns an empty dict.
        tracker: The CitationTracker instance to check against for new spans

    Returns:
        Dictionary of citation IDs to lists of new (start, end) spans
        that haven't been processed by the tracker yet.
    """
    # Handle None or empty input
    if text is None or text == "":
        return {}

    # Get all citation spans in the text
    all_spans = extract_citation_spans(text)

    # Filter to only spans we haven't processed yet
    new_spans: dict = {}

    for cid, spans in all_spans.items():
        for span in spans:
            if tracker.is_new_span(cid, span):
                if cid not in new_spans:
                    new_spans[cid] = []
                new_spans[cid].append(span)

    return new_spans

    Extract citation spans that haven't been processed yet.

    Args:
        text: Text to search. If None, returns an empty dict.
        tracker: The CitationTracker instance to check against for new spans

    Returns:
        Dictionary of citation IDs to lists of new (start, end) spans
        that haven't been processed by the tracker yet.
    
py/core/utils/__init__.py