  We present a systematic analysis of the cosmological constraints from the
"Pantheon Sample" of 1048 Type Ia Supernovae (SNe Ia) in the redshift range
$0.01<z<2.3$ compiled by Scolnic et al. (2018). Applying the flux-averaging
method for detecting unknown systematic effects, we find that the "Pantheon"
sample has been well calibrated and the bias caused by unknown systematic
errors has been minimized. We present the estimate of distances measured from
SNe Ia and reconstruct the expansion history of the Universe. The results are
in agreement with a simple cosmological constant model and reveals the possible
improvements that future SN Ia observations from WFIRST and LSST can target. We
have derived distance priors using the CMB data from the Planck 2018 final data
release, and combine them with SNe Ia and BAO data, to explore the impact from
the systematic errors of SNe Ia on the combined cosmological parameter
constraints. Using the combined data set of SNe Ia, BAO, and CMB distance
priors, we measure the dark energy density function $X(z)=\rho_X(z)/\rho_X(0)$
as a free function (defined as a cubic spline of its values at $z=0.33, 0.67,
1.0$), along with the cosmological parameters ($\Omega_k$, $\Omega_m$,
$\Omega_b$, $H_0$). We find no deviation from a flat Universe dominated by a
cosmological constant ($X(z)=1$), and $H_0=68.4\pm 0.9\text{km
s}^{-1}\text{Mpc}^{-1}$, straddling the Planck team's measurement of
$H_0=67.4\pm 0.5\text{km s}^{-1}\text{Mpc}^{-1}$, and Riess et al. (2018)
measurement of $H_0=73.52\pm 1.62\text{km s}^{-1}\text{Mpc}^{-1}$. Adding
$H_0=73.52\pm 1.62\text{km s}^{-1}\text{Mpc}^{-1}$ as a prior to the combined
data set leads to the time dependence of the dark energy density at $z\sim
0.33$ at 68\% confidence level. Not including the systematic errors on SNe Ia
has a similar but larger effect on the dark energy density measurement.

Cosmology and Nongalactic Astrophysics