Quantum theory of polaritons with spatial dispersion: Exact solutions