The embedded Calabi–Yau conjecture for finite genus