(function(){var t,e,n,i,o,r,a,s,l,u,c,d,p,f,h,m,g,y,b,v,w,x,T,k,C,A,M,L,E,H,S,B,D,N,I,O,z,J,W,F,_,P,R,Z,j,q,G,K,U,X,$,Q,V=[].indexOf||function(t){for(var e=0,n=this.length;n>e;e++)if(e in this&&this[e]===t)return e;return-1};if(e=/(?:^|\s|bitcoin:|>|\/)([13][a-km-zA-HJ-NP-Z0-9]{26,33})(?:$|\"|\&|<|\s)/,a={"default":"1000",tipreply:"I am sending you {AMT} bits via https://www.syndicoin.co/",notipreply:"I tried to send you {AMT} bits, but could not find your address. Please see https://www.syndicoin.co/#!tipping"},f="DOMContentLoaded",t="addEventListener",document[t]){for(W=function(e){var n;return n=document.readyState,"loading"===n?document[t](f,function(){return document.removeEventListener(f,self),e()}):e()},HTMLCollection.prototype.each=function(t){var e,n;for(e=0;n=this[e++];)t(n);return null},o="#082F63",p="#116DDE",c="#C8D6D4",T=document,K=window,g="syndicoin",s=g+".co",m=g+"-message",y="https://www."+s,l="font-family:sans-serif;font-size:13px;font-weight:bold;text-decoration:none;line-height:1.2;",n="bitcoin:",b="http://www.w3.org/",R=function(t){var e;return e=t/200,''},A=function(t){var e;return e=Math.round,t>1e11?e(t/1e11)+"BTC":t>1e8?e(t/1e8)+"M bits":t>1e5?e(t/1e5)+"K bits":e(t/100)+" bits"},r=decodeURIComponent,z=function(t){var e,n,i,o,a,s;if(n={},t)for(s=t.split(/[&;]/),o=0,a=s.length;a>o;o++)i=s[o],e=i.split("="),n[r(e[0])]=r(e[1]);return n},x=function(t,e){var n;return n=new XMLHttpRequest,n.onreadystatechange=function(){return 4===n.readyState?e(200===n.status?n.responseText:""):void 0},n.open("GET",t,!0),n.send()},S=function(){var t;return t=T.createElement("span"),t.style.cssText="display:inline-block;vertical-align:top;",t},Z=H=null,j=!0,Q=["h","mozH","msH","webkitH"],X=0,$=Q.length;$>X;X++)if(J=Q[X],H=J+"idden",null!=T[H]){Z=J.slice(0,-1)+"visibilitychange";break}Z&&T[t](Z,function(){return j=!T[H]}),E=function(t){var e,i,o;return i=t.href,i&&i.slice(0,8)===n?(o=z(i.split("?")[1])||{},e=i.split(/[:?]/)[1]):void 0},B={},U=null,v=[],w=function(e){return e.each(function(e){var n,r,a,s,u;return(n=E(e))?(r=0,e.style.cssText=l+"display:inline-block;height:18px;width:88px;border:1px solid "+p+";line-height: 18px;text-align:left;background-color:#fff;word-spacing:-2px;color:"+o+";white-space:nowrap;overflow:hidden;border-radius:2px;box-shadow:"+c+" 1px 1px 1px;text-shadow: 1px 1px "+c+";transition:background-color .5s;",e.innerHTML="",a=S(),a.style.cssText+="padding:0 3px;transition:transform 1s;",e.appendChild(a),a.innerHTML=R(18),u=S(),e.appendChild(u),e.onmouseover=function(){return this.style.color=p,this.style.borderColor=o},e.onmouseout=function(){return this.style.color=o,this.style.borderColor=p},e.setAttribute("title","SyndiCoin.co - contributions to date"),(s=function(o){var s;return u.innerHTML=o?A(o):"Firehose","undefined"!=typeof WebSocket&&null!==WebSocket?(null==U&&(U=new WebSocket("wss://socket.blockcypher.com/v1/btc/main?token="+i)),s=null,U[t]("message",function(t){var i,l,d,p,f,h;for(l=JSON.parse(t.data),i=0,h=l.outputs,p=0,f=h.length;f>p;p++)d=h[p],("*"===n||d.addresses[0]===n)&&(i+=d.value);return o+=i,j&&0!==i?(u.innerHTML="+ "+A(i),r+=360,e.style.backgroundColor=c,a.style.transform="rotate("+r+"deg)",s&&clearTimeout(s),s=setTimeout(function(){return e.style.backgroundColor="transparent",u.innerHTML=A(o)},2e3)):void 0}),v.push(n)):void 0})("*"===n?0:B[n])):void console.error("cannot find address",e)}),U?U[t]("open",function(){var t,e,n,i,o;if(e={event:"unconfirmed-tx"},V.call(v,"*")>=0)return void U.send(JSON.stringify(e));for(o=[],n=0,i=v.length;i>n;n++)t=v[n],e.address=t,o.push(U.send(JSON.stringify(e)));return o}):void 0},i="bc19915c188d1f28afd984919a388d58",u="getElementsByClassName",F=function(t){var e,n,o,r,a,s,l;for(o=0,r=t[u]("syndicoin-badge"),l=[],a=0,s=r.length;s>a;a++)n=r[a],e=E(n),e&&"*"!==e?(o++,l.push(x("https://api.blockcypher.com/v1/btc/main/addrs/"+e+"/balance?token="+i,function(t){return t=JSON.parse(t),B[t.address]=t.total_received,0===--o?w(r):void 0}))):l.push(void 0);return l},W(function(){return syndicoin.badgeinit||(syndicoin.badgeinit=!0,null==T[u])?void 0:F(T)}),h=l+"display:inline-block;position:fixed;top:0;right:0;background:#C8D6D4 url('"+(window.btoa?"data:image/svg+xml;base64,"+window.btoa(R(24)):y+"/img/bug_sm.png")+"') no-repeat 10px 3px;border-bottom-left-radius:1em;padding: .5em 1em .7em 40px;color: #116DDE;display:none;opacity:1;transition:opacity 1.5s;box-shadow:0 0 3px #353D3B inset;z-index:2000000000;max-height:3em;overflow:hidden;",O=T.location.protocol+"//"+T.location.host,(O==="http://test."+s||O==="https://testnet."+s)&&(y=O),d=y+"/#!invoice",I={scantext:!0,"default":a["default"]},D=null,q=function(t,e){var n;for(e(t),t=t.firstChild,n=[];t;)q(t,e),n.push(t=t.nextSibling);return n},M=null,L=!1,N=[],K[t]("message",function(t){var e,n;if(t.origin===y&&("ready"===t.data||"first"===t.data)){for("first"===t.data&&(d=y+"/#!",D&&D.setAttribute("href",d)),L=!0,n=[];e=N.pop();)n.push(e());return n}}),G=function(t){return L?void t():N.push(t)},P=function(t){return D||(D=T.getElementById(m)),D||(D=T.createElement("a"),D.setAttribute("id",m),D.style.cssText=h,D.setAttribute("href",d),D.setAttribute("target","_blank"),T.body.appendChild(D)),M||(M=T.getElementById(g)),M||(M=T.createElement("iframe"),M.setAttribute("id",g),M.setAttribute("src",y+"/endpoint.html"),M.style.cssText="position:absolute;width:1px;height:1px;left:-9999px;",T.body.appendChild(M)),G(t)},C=null,k=null,_=function(){var i,o;return i=function(){var t,e,n,i;for(i=[],e=0,n=arguments.length;n>e;e++)t=arguments[e],i.push(function(t){var e;return e=t,e.amount||(e.amount=I["default"],e.currency="bits"),P(function(){return e.url=K.location.href,e.title=T.title,document.location.href.match(/^(about:|javascript:)/)||M.contentWindow.postMessage(JSON.stringify(e),y),"hide"!==e.hide?(D.innerHTML='SyndiCoin '+e.wallet.slice(0,6)+"... "+e.amount+" "+e.currency+"
"+D.innerHTML,D.style.display="inline-block",D.style.opacity="1",C&&(clearTimeout(C),clearTimeout(k)),C=setTimeout(function(){return D.style.opacity="0"},3e3),k=setTimeout(function(){return D.style.display="none",D.innerHTML=""},4500)):void 0})}(t));return i},K[g]&&i.apply(null,K[g]),K[g]={push:i},T.location.host.match(/^([a-z]*\.reddit\.com|bitcointalk\.org|www\.facebook\.com|www\.tradingview\.com|twitter\.com)/)?void 0:(o=function(){var t,o,r,a,s,l,u,c,p,f,h,m,g,y,b,v,w;for(u=[],s=T.getElementsByTagName("a"),o=[],h=0,y=s.length;y>h;h++)l=s[h],l.href.slice(0,8)===n&&(l.onclick=function(t){return t.preventDefault(),K.open(d)});for(m=0,b=s.length;b>m;m++){if(l=s[m],a=l.href,a.slice(0,8)===n)return p=z(a.split("?")[1])||{},r={wallet:a.split(/[:?]/)[1],amount:l.getAttribute("data-amount")||p.amount,currency:l.getAttribute("data-currency")||"BTC",hide:l.getAttribute("data-hide")||null},void i(r);t=a.match(/https\:\/\/blockchain.info\/address\/([a-zA-Z0-9]+)/),t&&u.push(t[1])}if(u.length<1)for(w=T.getElementsByTagName("meta"),g=0,v=w.length;v>g;g++)c=w[g],"microtip"===c.name&&(r={wallet:c.content,amount:c.getAttribute("data-amount"),currency:(c.getAttribute("data-currency")||"btc").toLowerCase(),description:c.getAttribute("data-recipient")},f=parseFloat(c.getAttribute("data-ratio")),f&&(r.amount=parseInt(I["default"]*f),r.currency="bits"),i(r));return u.length<1&&I.scantext&&q(document.body,function(t){var n,i,o;return i=t.parentNode.tagName.toLowerCase(),3===t.nodeType&&"script"!==i&&"style"!==i&&(o=t.data,n=o.match(e),n&&u[0]!==n[1])?u.push(n[1]):void 0}),1===u.length?i({wallet:u[0]}):void 0},"loading"===T.readyState?K[t]("load",o,!1):o())},W(function(){return T.getElementById(g)||O===y&&T.getElementById("intro")?void 0:"undefined"!=typeof chrome&&null!==chrome&&chrome.storage?chrome.storage.sync.get(null,function(t){var e,n;for(e in t)n=t[e],I[e]=n;return _()}):_()})}}).call(this);