How the Wrapper Works: InView, Refresh & CSS Injection

One script tag. Everything else is in the wrapper.
The publisher adds <script async src="wrapper.js"></script>
and places ad <div> elements wherever ads should appear.
The wrapper resolves the current URL to a view, reads the slot config for that
view, and manages the full ad lifecycle.
Wrapper div injection
Before requesting any bids, the wrapper inserts a
.hb-slot-wrap div inside each publisher div. This gives
a stable CSS target that survives GPT refreshes. The publisher div
remains untouched. Global and per-slot CSS for both the wrapper div
and the GPT iframe is declared in wrapper.js and applied
automatically — including via a MutationObserver that
catches the iframe the moment GPT renders it.
InView loading
Slots below the fold use IntersectionObserver to delay
the bid request and GPT slot definition until the slot approaches the
viewport. The rootMargin (default 200px) controls how
early the load triggers. The top slot on this page has
inView: false so it loads immediately. The MRect and
video slots below use the network defaults.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip.