  The transverse momentum ($p_{\rm T}$) and centrality dependence of the
nuclear modification factor $R_{\rm AA}$ of prompt and non-prompt J$/\psi$, the
latter originating from the weak decays of beauty hadrons, have been measured
by the ALICE collaboration in Pb$-$Pb collisions at $\sqrt{s_{\mathrm{NN}}}$ =
5.02 TeV. The measurements are carried out through the ${\rm e}^{+}{\rm e}^{-}$
decay channel at midrapidity ($|y| < 0.9$) in the transverse momentum region
$1.5 < p_{\rm T} < 10$ GeV/$c$. Both prompt and non-prompt J$/\psi$
measurements indicate a significant suppression for $p_{\rm T} >$ 5 GeV/$c$,
which becomes stronger with increasing collision centrality. The results are
consistent with similar LHC measurements in the overlapping $p_{\rm T}$
intervals, and cover the kinematic region down to $p_{\rm T}$ = 1.5 GeV/$c$ at
midrapidity, not accessible by other LHC experiments. The suppression of prompt
J$/\psi$ in central and semicentral collisions exhibits a decreasing trend
towards lower transverse momentum, described within uncertainties by models
implementing J$/\psi$ production from recombination of c and $\overline{\rm c}$
quarks produced independently in different partonic scatterings. At high
transverse momentum, transport models including quarkonium dissociation are
able to describe the suppression for prompt J$/\psi$. For non-prompt J$/\psi$,
the suppression predicted by models including both collisional and radiative
processes for the computation of the beauty-quark energy loss inside the
quark$-$gluon plasma is consistent with measurements within uncertainties.
