Magnetic Flaring in the Pre-Main-Sequence Sun and Implications for the Early Solar System