Did my water break?

Nikita
Pregnant with 1st baby and I'm 39 weeks. I went swimming this afternoon and after coming out of the pool and sitting for like an hour I felt a gush of fluid come out all of a sudden. Went to the bathroom to check and saw that the fluid had some discharge in it. As I kept walking more would come out lil at a time with some white mucus in it. Everytime I'd sit and then get up more would come out. When I went home I had some period like contractions but they seem to have stopped now. Sorry if it's TMI. not sure if that's normal to happen after swimming or if my water is slowly leaking out. Help!!