  A search is performed for charged-lepton flavor violating processes in top
quark (t) production and decay. The data were collected by the CMS experiment
from proton-proton collisions at a center-of-mass energy of 13 TeV and
correspond to an integrated luminosity of 138 fb$^{-1}$. The selected events
are required to contain one opposite-sign electron-muon pair, a third charged
lepton (electron or muon), and at least one jet of which no more than one is
associated with a bottom quark. Boosted decision trees are used to distinguish
signal from background, exploiting differences in the kinematics of the final
states particles. The data are consistent with the standard model expectation.
Upper limits at 95% confidence level are placed in the context of effective
field theory on the Wilson coefficients, which range between 0.024-0.424
TeV$^{-2}$ depending on the flavor of the associated light quark and the
Lorentz structure of the interaction. These limits are converted to upper
limits on branching fractions involving up (charm) quarks, t$\to$e$\mu$u
(t$\to$e$\mu$c), of 0.032 (0.498)$\times$10$^{-6}$, 0.022
(0.369)$\times$10$^{-6}$, and 0.012 (0.216)$\times$10$^{-6}$ for tensor-like,
vector-like, and scalar-like interactions, respectively.
