Arcana Coelestia #4590
4590. 'And it happened as her soul was departing, when she was about to die' means a state of temptations. This is clear from the meaning of 'the soul departing, and dying' as the final phase of temptation, which is reached when the old man dies and the new receives life. This meaning is evident from what comes before this, where it is stated that 'she suffered severely in giving birth', meaning the temptation endured by interior truth, 4586, 4587, and from what follows at verse 19, stating that 'Rachel died'.
Arcana Coelestia #4587
4587. 'And it happened in her suffering severely, in giving birth' means following temptations. This is clear from what has been stated immediately above in 4586, and so is clear without any further explanation.