// The signed-in reader, for controls outside the account rail. The account // module announces every change; the finder reads the latest value when it // opens, so it does not matter which module loaded first. let viewer; /** The current account, or undefined when signed out. */ export function currentViewer() { return viewer; } /** Publish a new account value and tell anyone already listening. */ export function announceViewer(next) { viewer = next; document.dispatchEvent(new CustomEvent("panoptiblog:viewer", { detail: next })); }