define(["template7","notificationsCenter","helper"],(function(e,t,n){var i=4,o=1e4,r={interval:1,notifications:[],showed:[],add:function(e,t,n,i,o){if(!e||!t)return!1;var r={text:e,link:t,image:n,type:i,uid:o};this.showedBefore(r)||(Z.post("/notify",{action:"show",type:i,s:o,r:App.context.me.id}),this.notifications.push(r),this.showed.push(r),this.show())},show:function(){if(!App.context.disableNotify){var e,n,o=document.querySelectorAll("#notify-container .notif").length;if(o=0?t:t.querySelector(".notif"),clearTimeout(t.timeout),t.timeout=null},mouseleave:function(e){var t=e.target;t=t.className.indexOf("notif")>=0?t:t.querySelector(".notif"),this.hideTimeout(t)},notifyClick:function(e){var t=e.target,i=t.className.indexOf("notif")>=0?t:n.parent(t,".notif");if(i){var o=i.dataset.type,r=i.dataset.uid,a=i.querySelector("a.link"),s=a.href;if(t.className.indexOf("close")>=0){var c=n.parent(t,".notif");return c&&c.parentNode&&c.parentNode.removeChild(c),void Z.post("/notify",{action:"close",type:o,s:r,r:App.context.me.id})}require(["asyncPageLoad"],(function(e){e.noAdsReloading(s,!0)})),o&&Z.post("/notify",{action:"click",type:o,s:r,r:App.context.me.id},(function(){return 5===+o?window.open(s,"_blank"):"undefined"==typeof s?App.track("Notif","undefined",o):(s.indexOf("javascript:")>=0?App.executeJsCallback(s.replace("javascript:","").trim()):require(["asyncPageLoad"],(function(e){e.goTo(s)})),void(i&&i.parentNode&&i.parentNode.removeChild(i)))}))}},init:function(){var e=document.querySelector("#notify-container");e&&(e.removeEventListener("click",this,!1),e.addEventListener("click",this,!1))},clear:function(e){if(e){var t=document.querySelectorAll("#notify-container .notif");[].forEach.call(t,(function(t){+t.getAttribute("data-uid")===+e&&t.parentNode&&t.parentNode.removeChild(t)}))}},decodeHTML:function(e){var t=document.createElement("textarea");return t.innerHTML=e,t.value},getHTML:function(t){t.text=this.decodeHTML(t.text.replace("[[br]]","
")),t.linkTxt=App.context.notifyLinkTitle,t.sticker=51===+t.type&&t.text.indexOf("https://")>=0,t.fastespeak=20===+t.type||53===+t.type;var n=document.querySelector("#notify-handlebars-template").innerHTML,i=e.compile(n);return i(t)},showedBefore:function(e){return!1}};return r})); //# sourceMappingURL=Notify-ee072f6f5c.min.js.map