Source and decoding - Bava Batra 12a
וְחָכָם עָדִיף מִנָּבִיא, שֶׁנֶּאֱמַר: ״וְנָבִא לְבַב חׇכְמָה״ – מִי נִתְלֶה בְּמִי? הֱוֵי אוֹמֵר: קָטָן נִתְלֶה בַּגָּדוֹל.
Ameimar said: a sage is greater than a prophet, as it says "a prophet has a heart of wisdom" - who is measured by whom? The lesser is measured by the greater.
Ameimar said: a sage is greater than a prophet, as it says "a prophet has a heart of wisdom" - who is measured by whom? The lesser is measured by the greater. The prophet is described by wisdom, so wisdom is primary.