function getDocLinks(a){if(!a.links)return[];var b=[];return a.links.forEach(function(a){b.push(Utils.getDocLink(a))}),b}function insertMessage(a,b,c){var d=/^(.*?)<(a|strong)>(.*?)<\/\2>(.*)$/.exec(b);if(!d)return a.appendChild(document.createTextNode(b)),void 0;var e=d[1],f=d[2],g=d[3],h=d[4];insertMessage(a,e,c);var i=document.createElement(f);"a"===f&&c&&c.length&&(i.href=c.shift()),insertMessage(i,g,c),a.appendChild(i),insertMessage(a,h,c)}var backgroundPage=chrome.extension.getBackgroundPage(),require=backgroundPage.require,Utils=require("utils").Utils,Notification=require("notification").Notification;window.addEventListener("load",function(){var a=backgroundPage.activeNotification;if(a){a.onClicked&&a.onClicked();var b=Notification.getLocalizedTexts(a),c=document.getElementById("title");c.textContent=b.title;var d=getDocLinks(a),e=document.getElementById("message");insertMessage(e,b.message,d),e.addEventListener("click",function(a){for(var b=a.target;b&&b!==e&&"a"!==b.localName;)b=b.parentNode;b&&(a.preventDefault(),a.stopPropagation(),chrome.tabs.create({url:b.href}))});var f=document.getElementById("notification");f.className=a.severity,f.style.display="block"}});