What generates the heat and light emitted by a protostar before nuclear fusion begins?

Answer

Gravitational energy released as surrounding matter falls onto it

The energy emitted by a protostar is purely generated from the gravitational energy released as surrounding matter continues to fall onto it, causing intense compression and heating.

What generates the heat and light emitted by a protostar before nuclear fusion begins?
astronomybirthstarsstellar evolution