A major earthquake with a preliminary magnitude of 7.7 has struck Panama, according to the US Geological Survey.