What was the first country to guarantee freedom of worship

Transylvania