Theory of a planar free-electron maser with transverse electromagnetic flux circulation in a 2D Bragg mirror