  (abridged) Spectroscopic observations of high-redshift galaxies slowly reveal
the same complexity of the interstellar medium (ISM) as expected from resolved
observations in nearby galaxies. While providing a wealth of diagnostics, such
high-z spectra are often unresolved, and inferring reliable diagnostics
represents a major obstacle. Bright, nearby, unresolved galaxies provide many
constraints to design methods to infer ISM properties, but they have so far
been limited to deterministic methods and/or with simple topological
assumptions.
  Multicomponent ISM models associate a complex enough distribution of matter
and phases with a simple enough topological description to be constrained with
probabilistic frameworks. Our goal is to provide a flexible statistical
framework that is agnostic to the model grid and that considers either a few
discrete components defined by their parameter values and/or statistical
distributions of parameters.
  In this study we present a the MULTIGRIS framework and use it to model a
suite of spectral lines in the star-forming regions of the metal-poor dwarf
galaxy IZw18. We are able to calculate accurate values for the metallicity,
number of ionizing photons, masses of ionized and neutral hydrogen, as well as
the dust mass and the dust-to-gas mass ratio. We find a relatively modest
amount of H$_2$ which is predominantly CO-dark and traced by C$^+$ rather than
C$^0$. Nevertheless, more than $90$% of the [CII] emission is associated with
the neutral atomic gas. Our models confirm the necessity to consider an X-ray
source. Finally, we investigate the escape fraction of ionizing photons for
different energy ranges. While the escape fraction for the main HII region lies
around $50-65$%, we show that most of the soft X-ray photons are able to escape
and may play a role in the ionization and heating of the circumgalactic or
intergalactic medium.
