1const sourcesWaitTimeout=1e3;let messagesById={};function checkSourcesAndSendNotification(s){if(void 0!==messagesById[s]){let e=messagesById[s].sources,o=0;for(let s=1;s<e.length;s++)e[s].isInbox&&e[o].isInbox?!e[s].hasFocus&&e[o].hasFocus||(o=s):!e[s].isInbox&&e[o].isInbox||(o=s);e[o].hasFocus||e[o].source.postMessage(messagesById[s].message),delete messagesById[s]}}self.addEventListener("connect",(s=>{s.source.addEventListener("message",(e=>{let o=e.data.message.envelope.message.id;void 0===messagesById[o]&&(messagesById[o]={message:e.data.message,sources:[]},setTimeout((()=>{checkSourcesAndSendNotification(o)}),1e3)),messagesById[o].sources.push({source:s.source,hasFocus:e.data.hasFocus,isInbox:e.data.isInbox})})),s.source.start()}));
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.