window._roost||(window._roost=[]),_roost.init||!function(e){function c(e){if(!e||!e.origin)return;if(l.indexOf(e.origin)==-1)return;var t=JSON.parse(e.data);if(t.type&&t.type=="registered"){_roost._fireRoostCallback({firstTime:t.firstTime,deviceToken:t.deviceToken,registered:t.enabled,enabled:!0,tags:t.tags,alias:t.alias});return}u.enabled=t.enabled,u.tags=t.tags,u.alias=t.alias;for(var n=0;n<_roost.length;n++)f.push(_roost[n]);_roost=f,_roost._o=u;var r=u.onload;r&&typeof r=="function"&&r({promptable:_roost.promptable()}),u.initFunction&&u.initFunction(!0)}function h(){u.appkey="8549cc75c65d43158d07cec119eff890",d(),w("experimental"),u.appkey!="DEMO"&&(window&&typeof window.safari!="undefined"?(u.initFunction=O,u.idFunction=A):u.experimental&&o&&(u.initFunction=M)),u.initFunction&&(f.prompt=function(){u.initFunction(!1)}),u.idFunction&&(u.rdt=u.idFunction()),u.rdt||(u.rdt=k("_rdt")),u.rid=k("_rid"),(!u.rid||u.rid=="")&&E()&&(u.rid=m(),C("_rid",u.rid)),w("host");if(u.initFunction){var e=u.host+"/api/pageview?rdt="+encodeURIComponent(u.rdt)+"&rid="+encodeURIComponent(u.rid)+"&appKey="+encodeURIComponent(u.appkey)+"&url="+encodeURIComponent(document.URL)+"&referrer="+encodeURIComponent(document.referrer);p(e)}}function p(e){var t=document.createElement("iframe");t.style.display="none",t.src=e,document.body.appendChild(t)}function d(){typeof twttr!="undefined"&&typeof twttr.events!="undefined"&&typeof twttr.events.bind!="undefined"&&twttr.events.bind("tweet",function(e){f.push(["social_action","TWEET"])}),typeof FB!="undefined"&&typeof FB.Event!="undefined"&&typeof FB.Event.subscribe!="undefined"&&(FB.Event.subscribe("edge.create",function(e){f.push(["social_action","FB_LIKE"])}),FB.Event.subscribe("edge.remove",function(e){f.push(["social_action","FB_UNLIKE"])}),FB.Event.subscribe("comment.create",function(e){f.push(["social_action","FB_COMMENT"])}),FB.Event.subscribe("comment.remove",function(e){f.push(["social_action","FB_UNCOMMENT"])}),FB.Event.subscribe("message.send",function(e){f.push(["social_action","FB_SHARE"])}))}function v(){return location.protocol=="https:"}function m(){function e(){return Math.floor((1+Math.random())*65536).toString(16).substring(1)}return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}function w(e){var t=[];for(var n=0;n<_roost.length;n++)_roost[n].length&&_roost[n][0]==e?f.push(_roost[n]):t.push(_roost[n]);_roost=t}function E(){var e="cc"+Math.random(),t=!1;return C(e,"true"),k(e)&&(t=!0),C(e,"",-1),t}function S(t){x({url:u.host+"/Ping",vars:{appKey:u.appkey,referrer:encodeURIComponent((document.referrer+"").split("'").join("%27")),page:encodeURIComponent((e.location+"").split("'").join("%27")),action:"log",details:t?JSON.stringify(t):"",rdt:k("_rdt")}})}function x(e){e=e||{},e.url=e.url||null,e.vars=e.vars||{},e.error=e.error||function(){},e.success=e.success||function(){};var t=[];for(var n in e.vars)t.push(n+"="+encodeURIComponent(e.vars[n]));var r=t.join("&");if(e.url){var i=e.url+"?"+r,s=new Image;e.error&&(s.onerror=e.error),e.success&&(s.onload=e.success),s.src=i}}function T(e){u[e[0]]=typeof e[1]=="undefined"?u[e[0]]:e[1]}function N(e){return function(t){if(!u.appkey)return!1;e(t)}}function C(e,t,n,r){n||(n=0);var i=new Date;i.setTime(i.getTime()+n*24*60*60*1e3);var s=escape(t)+(n==null||n==0?"":"; expires="+i.toGMTString())+"; "+(r?" domain=."+r+"; ":"")+" path=/";document.cookie=e+"="+s}function k(e){if(document.cookie.length>0){c_start=document.cookie.indexOf(e+"=");if(c_start!=-1)return c_start=c_start+e.length+1,c_end=document.cookie.indexOf(";",c_start),c_end==-1&&(c_end=document.cookie.length),unescape(document.cookie.substring(c_start,c_end))}return""}function A(){var e="web.web.me.roost.autoef18f3d6b13442a4ab530e8bea4855e0",t=window.safari.pushNotification.permission(e);if(t.permission=="granted")return t.deviceToken}function O(e){typeof e=="undefined"&&(e=!1);var t="web.web.me.roost.autoef18f3d6b13442a4ab530e8bea4855e0",n=!1,r=location.host,i=location.host.split(".").reverse();i.length>1&&r.indexOf("blogger.com")==-1&&(r=i[1]+"."+i[0]),r=r.split(":")[0];var s=function(){n=!0;var e=_roost._getTags(),r=_roost._getAlias();window.safari.pushNotification.requestPermission("https://go.goroost.com/register/native/safari/8549cc75c65d43158d07cec119eff890",t,{website:encodeURIComponent(location.href),data:"{'tags':'"+e+"','alias':'"+r+"'}"},L)},o=window.safari.pushNotification.permission(t);if(o.permission=="default"){var u=_roost._isAutoPrompt(),a=_roost._promptMinVisits();(!e||u||a)&&s()}else o.permission=="granted"?(_roost._fireRoostCallback({firstTime:!1,deviceToken:o.deviceToken,registered:!0,enabled:_roost._isEnabled(),tags:_roost._getTags(),alias:_roost._getAlias()}),o.deviceToken&&_roost.setCookie("_rdt",o.deviceToken,1825,r)):_roost._fireRoostCallback({firstTime:!1,deviceToken:o.deviceToken,registered:!1,enabled:_roost._isEnabled(),tags:_roost._getTags(),alias:_roost._getAlias()})}function M(e){typeof e=="undefined"&&(e=!1);var t="",n="",r=_roost._getTags(),i=_roost._getAlias(),s="?appKey="+u.appkey+"&host="+encodeURIComponent(u.host);i&&(s+="&alias="+encodeURIComponent(i));for(var o=0;o0?f+=n:f+="/roost.html"):f="/roost.html",f+=s,p(f)}function _(){document.readyState==="interactive"||document.readyState==="complete"?h():document.addEventListener?window.addEventListener("load",h):document.attachEvent("onload",h)}var t=!!window.PushManager||!!navigator.push,n=!!window.Notification,r=!!navigator.serviceWorker,i=window.chrome,s=window.navigator.vendor;i!==null&&i!==undefined&&s==="Google Inc."?i=!0:i=!1;var o=i&&t&&n&&r,u={autoprompt:!0,appkey:null,experimental:!1,host:"https://go.goroost.com",rdt:"none",rid:null,tags:null,alias:null,enabled:!1,initFunction:null,idFunction:null},a=[],f={init:!0,push:function(){for(var t=0;t1&&e.indexOf("blogger.com")==-1&&(e=t[1]+"."+t[0]),e=e.split(":")[0],e},_cookiesEnabled:function(){var e="cc"+Math.random(),t=!1;return _roost.setCookie(e,"true"),_roost.getCookie(e)&&(t=!0),_roost.setCookie(e,"",-1),t},_promptMinVisits:function(){if(u.minvisits>-1){if(!_roost._cookiesEnabled())return!1;var e="_r_visits",t=_roost.getCookie(e);return t?t++:t=1,_roost.setCookie(e,t,30,_roost._domain()),u.minvisits<=t}return!1},_enqueue:function(e){a.push(e),a.length==1&&f._processQueue()},_processQueue:function(){if(a.length){var e=a[0];e()}},_workFinished:function(){a.length&&(a.shift(),f._processQueue())}};window&&window.addEventListener&&window.addEventListener("message",c,!1);var l=["http://localhost:8081","http://go.goroost.com","https://go.goroost.com","http://cdn.goroost.com","https://cdn.goroost.com"],g=N(function(e){var t=[];for(var n=1;n-1&&u.tags.splice(o,1)}u.tags=u.tags.concat(t)}f._enqueue(function(){u.rdt?x({url:u.host+"/Ping",vars:{action:r,appKey:u.appkey,tags:JSON.stringify(t),rdt:u.rdt},success:f._workFinished}):f._workFinished()})}),y=N(function(e){var t=null;e&&e.length==2&&(t=e[1]);var n=e[0];n=="alias"?u.alias=t:n=="alias_clear"&&(u.alias=null),f._enqueue(function(){u.rdt?x({url:u.host+"/Ping",vars:{action:e[0],appKey:u.appkey,alias:t,rdt:u.rdt},success:f._workFinished}):f._workFinished()})}),b={appkey:function(){},onload:T,onresult:T,host:T,experimental:T,minvisits:T,tags:g,segments:g,segments_add:g,segments_remove:g,segments_clear:g,alias:y,alias_clear:y,autoprompt:T,prompt:function(){_roost.prompt&&_roost.prompt()},log:function(e){S(e[1])},social_action:N(function(e){x({url:u.host+"/Ping",vars:{action:"socialAction",appKey:u.appkey,useraction:e[1],rdt:k("_rdt")}})}),enable:N(function(e){f._enqueue(function(){x({url:u.host+"/Ping",vars:{action:"enable",appKey:u.appkey,enable:e[1],rdt:u.rdt},success:f._workFinished})})})},L=function(e){u.rdt=e.deviceToken,_roost._fireRoostCallback({firstTime:!0,deviceToken:e.deviceToken,registered:e.permission!="denied",enabled:!0,tags:_roost._getTags(),alias:_roost._getAlias()}),e.permission=="granted"&&_roost.setCookie("_rdt",e.deviceToken,1825,domain)};_()}(window)