"""PyInstaller hook for Streamlit.

The runtime needs three things PyInstaller's static analyser misses:

1. Every submodule of ``streamlit`` (the framework reaches into
   ``streamlit.runtime`` / ``streamlit.web`` / ``streamlit.elements``
   via dynamic import).
2. The static front-end assets (JS / CSS / fonts) under
   ``streamlit/static/``.
3. The vendored config / proto schemas under
   ``streamlit/runtime/scriptrunner/`` etc.

The main spec already calls ``collect_all('streamlit')`` so this
hook is mostly belt-and-braces — but PyInstaller picks hooks up by
name, and a missing hook can produce confusing runtime errors when
Streamlit upgrades. Keeping it explicit here documents the
dependency.
"""

from PyInstaller.utils.hooks import collect_all, collect_data_files, collect_submodules

datas, binaries, hiddenimports = collect_all("streamlit")

# Belt-and-braces: explicitly include the static directory.
datas += collect_data_files("streamlit", subdir="static", include_py_files=False)

# Some Streamlit components are loaded by name from the registry.
hiddenimports += collect_submodules("streamlit.elements")
hiddenimports += collect_submodules("streamlit.runtime")
hiddenimports += collect_submodules("streamlit.web")
