Sefer Chasidim Siman 779
Can copy this into an AI, or connect the whole library to your assistant. For deeper learning, you can directly use the original seforim, sites, and apps.
לא יצא אדם מבית הכנסת עד שיסיימו כל התפלה אלא אם כן צריך לנקביו או להקיא:
Medieval Jewish mysticism, translated by Sholom Alchanan Singer. Northbrook, Ill. Whitehall Co., 1971
A person should not go outside the synagogue untill all prayers are finished unless he needs to relieve himself or feels like he is going to throw up.