The U.K. is set to formally quit the European Union late Friday, closing the chapter on nearly half a century of integration with its European neighbors as it looks to chart a new but uncertain course in the world. The day, which follows four years of nearly unprecedented political chaos triggered by the 2016 Brexit referendum, marks a watershed moment for both the U.K. and the EU. The…