In class, we learned this sentence:
她睡觉的时候,她的朋友正在上网。
Tā shuìjiào de shíhòu. Tāde péngyǒu zhèngzài shàngwǎng.
My question is about the following three variants. For the first, we add in a 在 (zài):
她在睡觉的时候,她的朋友正在上网。
For the second we omit the 的 (de):
她睡觉时候,她的朋友正在上网。
And for the third we add in a 在 (zài) and omit the 的 (de):
她在睡觉时候,她的朋友正在上网。
Question: Which of these are grammatically correct and do they all have the same meaning?
I feel the first variant is correct, YouDao.com gives an example "当她在睡觉的时候笑了..." which seems similar (but the 在 might be part of a different grammar construct here: 在[x]笑了). The latter two examples might be wrong as most examples I've found include the 的, but I'm not sure, as I found "...但在睡觉时候..." on YouDao.com.