It sounds as though your wife and friend were not unfaithful, but whether or not they were the decision to fogive is yours. You will undoubtedly need time to get through this. Time is really the only healer. It also tells you whether or not you will make it. If you truly love eachother, both of you, you can get through anything. Love is an amazing thing. Children are even more amazing at times. It sounds as though the love you both have for your little girl is common ground enough for you to survive.
If you haven't already, talk to your wife about the reasons for her indiscretions. From there, find out what you both can do to make the future brighter in your marriage. Your plea for advice shows that you care enough to do everything in your power to fix your relationship and if she feels the same then you have already succeeded. Be open, honest, communicative and sensitive to one another and you will pass this point in your lives with ease and a sense of achievement. That will ultimately bring you closer together and strengthen you as a couple as long as no one dwells on past negativity.
Best wishes.