Mechanism and energy diagram for O–O bond formation in the oxygen-evolving complex in photosystem II