"""Pure goalkeeper distribution vocabulary for FTG Match Engine v3.10+.

No Django imports. The current engine, immutable projection and API all share
this vocabulary so a goalkeeper restart has one authoritative meaning.
"""
from __future__ import annotations

DISTRIBUTION_TYPES = (
    "ROLL",
    "THROW",
    "SHORT_BUILDUP",
    "CLIPPED_PASS",
    "LONG_KICK",
)

DISTRIBUTION_SOURCES = (
    "SAVE_HELD",
    "CROSS_CLAIM",
    "GOAL_KICK",
)

DISTRIBUTION_OUTCOMES = (
    "COMPLETED",
    "CONTESTED_WON",
    "CONTESTED_LOST",
    "INTERCEPTED",
    "OUT_OF_PLAY",
)

SHORT_DISTRIBUTIONS = frozenset({"ROLL", "THROW", "SHORT_BUILDUP"})
LONG_DISTRIBUTIONS = frozenset({"CLIPPED_PASS", "LONG_KICK"})


def distribution_pass_type(distribution_type: str) -> str:
    """Map distribution vocabulary onto the existing passing-network contract."""
    if distribution_type in {"ROLL", "SHORT_BUILDUP"}:
        return "SHORT"
    if distribution_type == "THROW":
        return "PROGRESSIVE"
    return "PROGRESSIVE"
