def _validator(
    rotpos: RotorPositionT, rotsel: RotorSelectionT, pb: str
) -> tuple[RotorPositionT, RotorSelectionT, dict[str, str]]:
    # Checks if there are 3 unique rotors

    if (unique_rotsel := len(set(rotsel))) < 3:
        raise Exception(f"Please use 3 unique rotors (not {unique_rotsel})")

    # Checks if rotor positions are valid
    rotorpos1, rotorpos2, rotorpos3 = rotpos
    if not 0 < rotorpos1 <= len(abc):
        raise ValueError(
            "First rotor position is not within range of 1..26 (" f"{rotorpos1}"
        )
    if not 0 < rotorpos2 <= len(abc):
        raise ValueError(
            "Second rotor position is not within range of 1..26 (" f"{rotorpos2})"
        )
    if not 0 < rotorpos3 <= len(abc):
        raise ValueError(
            "Third rotor position is not within range of 1..26 (" f"{rotorpos3})"
        )

    # Validates string and returns dict
    pbdict = _plugboard(pb)

    return rotpos, rotsel, pbdict