Distributionally robust optimization under endogenous uncertainty with an application in retrofitting planning