Convert javascript state machine to UML diagram