{# P2-T14 / P3-T24: shared browser-notification helper. Single shared helper that fires either a native Browser Notification (preferred) or an in-page toast (fallback) when an async admin action finishes. Designed to be reused across the LLM re-run flow (P2-T14) and the replay-completion flow (P3-T24). Design contract --------------- * Vanilla JS only -- ``Notification``, ``localStorage``, ``URLSearchParams``, ``document.querySelector``. No framework, no dependency on jQuery / fetch helpers. * Permission is NEVER requested on page load. The page that wires this helper in is responsible for calling ``window.reconNotify.requestPermission()`` from inside a user gesture (e.g. the first click on the ``run`` button) -- otherwise browsers either ignore the prompt or count it toward a permanent ``denied`` decision. * ``fire(...)`` is idempotent per ``tag`` within a 30 s window: the same tag never produces two notifications back-to-back (so a Back / Forward navigation that re-renders the page with the same ``?just_ran=`` query param doesn't double-fire). * Native notifications carry the ``tag`` so the browser collapses duplicates server-side too. * Toast fallback: bottom-right, ~320px wide, ``--bg-2`` background, ``--accent`` left border, ``--ink`` text. Click anywhere on the toast body navigates to ``url``; the ``×`` button dismisses it without navigating. Auto-dismisses after 6 s. * Accessibility: toast is ``role="status"`` + ``aria-live="polite"`` so screen readers announce the message. The close button is a real ``