Bereavement during pregnancy

Kim • Pregnant with #1 after about a year of trying. Due end of October and very excited!
I'm completely heartbroken. Yesterday, I lost my oldest and dearest best friend. We were friends for more than 16 years. We grew up together and were like family. She passed away in her sleep at only 27 years old.  This was such an unexpected loss.  I'm a complete wreck.  I spent the whole day hysterically crying and throwing up.  I'm trying to stay as calm as I can to keep the stress on my baby as low as possible.  I'm worried about the impact this kind of grief can have on the baby.  I'm a FTM and almost 12 weeks. Has anyone experienced this type of grief during pregnancy before? Any tips?