(function(){var a=window,n=document,u=navigator,p=n.currentScript;if(p){var o=function(e){return p.getAttribute("data-"+e)},R=p.src.replace(/s\.js(\?.*)?$/,"e"),k=o("site"),U=o("hash")!==null,I=o("manual")!==null,T=o("before-send"),$=function(e){return new RegExp("^"+e.replace(/[.+?^${}()|[\]\\]/g,"\\$&").replace(/\*/g,".*")+"$")},J=(o("exclude")||"").split(",").filter(Boolean).map(function(e){return $(e.trim())}),A=!1,H=a.runlight&&a.runlight.q||[],m="__RUNLIGHT_RULES__",O=typeof m=="object"&&(m[k]||m[location.hostname.replace(/^www\./,"")]||m["*"])||[],M=/[?&]runlight=pick\b/.test(location.search)&&/[?&]runlight_ticket=/.test(location.search);if(M){var N=n.createElement("script");N.src=p.src.replace(/s\.js(\?.*)?$/,"pick.js")+location.search,n.head.appendChild(N)}var z=!1;try{var B=/[?&]runlight=(ignore|track)\b/.exec(location.search);B&&(B[1]==="ignore"?localStorage.setItem("runlight_ignore","1"):localStorage.removeItem("runlight_ignore")),z=localStorage.getItem("runlight_ignore")==="1"}catch(e){}var P=M||u.webdriver||z||o("dnt")!==null&&(u.doNotTrack==="1"||a.doNotTrack==="1"),E=function(e,t){if(!(A||P)){var r={k:e,u:b};k&&(r.s=k);for(var i in t)r[i]=t[i];if(T!==null)try{if(r=a[T](r),!r||r.constructor!==Object)return}catch(y){return}var s=JSON.stringify(r);u.sendBeacon&&u.sendBeacon(R,s)||a.fetch&&fetch(R,{method:"POST",body:s,keepalive:!0}).catch(function(){})}},Y=function(){var e=new Uint8Array(6);return(a.crypto||{}).getRandomValues?crypto.getRandomValues(e):e.forEach(function(t,r){e[r]=Math.random()*256}),Array.from(e,function(t){return(t+256).toString(36).slice(-2)}).join("")},F=o("404")!==null,b="",v="",f=0,d=0,w=0,q=function(){return n.visibilityState==="visible"&&n.hasFocus()},D=function(){d&&(f+=Date.now()-d),d=0},c=function(){!d&&q()&&(d=Date.now())},S=function(){D(),v&&f>=1e3&&(E("engagement",{i:v,e:f,d:w}),f=0)},V=function(){var e=n.documentElement,t=Math.max(e.scrollHeight,n.body?n.body.scrollHeight:0),r=(a.scrollY||e.scrollTop)+a.innerHeight,i=t>0?Math.min(100,Math.round(r/t*100)):100;i>w&&(w=i)},K=function(){var e=location;return e.protocol+"//"+e.host+e.pathname+e.search+(U?e.hash:"")},h=function(e){var t=typeof e=="string"?new URL(e,location.href).href:K();if(t!==b){var r=b||n.referrer;S(),b=t;var i=new URL(t).pathname;A=J.some(function(s){return s.test(i)}),v=Y(),f=0,w=0,V(),c(),E("pageview",{i:v,r,t:n.title,w:screen.width,h:screen.height,l:u.language}),F&&l("404",{path:location.pathname}),F=!1}},l=function(e,t){typeof e!="string"||!e||E("event",{i:v,n:e,p:t&&typeof t=="object"?t:void 0})},C=function(e){var t=history[e];history[e]=function(){var r=t.apply(this,arguments);return setTimeout(h),r}};I||(C("pushState"),C("replaceState"),a.addEventListener("popstate",h),U&&a.addEventListener("hashchange",h)),n.addEventListener("visibilitychange",function(){n.visibilityState==="hidden"?S():c()}),a.addEventListener("pagehide",S),a.addEventListener("blur",D),a.addEventListener("focus",c),a.addEventListener("scroll",function(){V(),c()},{passive:!0}),n.addEventListener("pointerdown",c,!0),n.addEventListener("keydown",c,!0);var Q=/\.(pdf|zip|gz|tgz|dmg|pkg|exe|msi|apk|docx?|xlsx?|pptx?|csv|txt|rtf|epub|mp3|wav|mp4|mov|avi|mkv|psd|ai|svg|key|numbers|pages)$/i;n.addEventListener("click",function(e){var t=e.target;if(!(!t||!t.closest)){for(var r=t.closest("a[href]"),i=0;i<O.length;i++)try{var s=O[i],y=s[1];(s[0]==="s"?t.closest(y):r&&$(y).test(y.charAt(0)==="/"?r.pathname:r.href))&&l(s[2])}catch(W){}var g=t.closest("[data-runlight]");if(g){for(var G={},x=0;x<g.attributes.length;x++){var _=g.attributes[x];_.name.indexOf("data-runlight-")===0&&(G[_.name.slice(14)]=_.value)}l(g.getAttribute("data-runlight"),G)}if(!(!r||g)){var j=r.href;/^https?:/.test(j)&&(o("downloads")!=="false"&&Q.test(r.pathname)?l("File download",{url:j}):o("outbound")!=="false"&&r.host!==location.host&&l("Outbound link",{url:j}))}}},!0),a.runlight=l,l.pageview=h,I||h();for(var L=0;L<H.length;L++)l.apply(null,H[L])}})();