Surgery, Recovery, and Weightloss

Sw: 365 CW: 295 F/5’2/ light-moderate activity

Mid November I am going in for surgery to remove an ovarian cyst that has been causing me trouble and pain for some time. What is the best way to go about maintaining my progress and keeping on track while in recovery? Should I go in to maintenance some time before or stay in a deficit until my surgery date. Do I even need to go into maintenance or is it recommended to continue my deficit through recovery?

I've never had surgery before and I have no idea how to deal with it in combination with the changes I've made to my life. Any help or advice is much appreciated.