Does this exist?

Bidirectional CMOS switches can be wired up with additional selection logic to perform as you wish. OF course signal voltage range and current capacity has to kept within device specifications.

Lefty