text: var timeout,counter=0,startms=0,mssofar=0,delaysofar=0,timeOfNextTweet=0,firstTweetLoaded=!1,darkMode=0,paused=!1,pausedTime=0,pauseText="Paused";const urlpath=window.location.pathname,urlpage=urlpath.split("/").pop();
  function playPause(){if(firstTweetLoaded)if(paused){var a=(new Date).getTime();paused=!1;document.getElementById("play-pause-btn").className="fas fa-pause";document.getElementById("playpause").style.display="block";document.getElementById("advance").style.display="block";var b=a-pausedTime;startms+=b;timeOfNextTweet+=b;timeout=setTimeout("showIt()",timeOfNextTweet-a);document.getElementById("timer").classList.remove("blinking");document.getElementById("timer").classList.remove("blinking-dark");document.getElementById("timer").classList.add("not-blinking");
  document.getElementById("stand-by-arrow").style.display="none";document.getElementById("darkMode").style.display="none";pauseText="Paused"}else paused=!0,document.getElementById("play-pause-btn").className="fas fa-play",document.getElementById("playpause").style.display="block",document.getElementById("advance").style.display="none",pausedTime=(new Date).getTime(),clearTimeout(timeout),ga("send",{hitType:"event",eventCategory:"feed",eventAction:"paused",eventLabel:urlpage+" - tweet-feed-"+counter})}
  function advance(){clearTimeout(timeout);var a=(new Date).getTime();startms-=timeOfNextTweet-a;timeOfNextTweet=a;showIt()}function hideUserPanel(){if(4<=counter){var a=document.getElementById("users-panel");$(a).slideUp("slow")}}
  function loadTweet(a){var b=document.getElementById("tweet-feed-"+a);null!==b&&(b=$(b).attr("data-url"),null!==b&&void 0!==b&&$.ajax({type:"GET",url:"https://publish.twitter.com/oembed?url="+b+"&omit_script=true&dnt=true&theme="+(1===darkMode?"dark":"light"),dataType:"jsonp",success:function(c){$("#tweet-feed-"+a).html(c.html);4>a&&(loadTweet(a+1),0===a&&(timeout=setTimeout("showIt()",250)));twttr.widgets.load(document.getElementById("#tweet-feed-"+a))},error:function(c,b,e){if(404!==c.status)alert("Unable to load feed - please check that you are able to access Twitter on this device. If the problem persists, please try reloading the page. ["+
  c.status+" - "+b+"]");else{console.log("404 - tweet deleted");c=document.getElementById("tweet-feed-"+a);b=c.style.display;c.style="border-radius:15px;border:1px solid #ccc;padding:5px;width:100%;max-width:550px;margin-top:5px;";c.style.display=b;b=c.innerHTML.trim();e=c.getAttribute("data-datetime");var f=c.getAttribute("data-text");if(null===f||3>f.length)f="This tweet has been deleted";var d="main-colour";1===darkMode&&(d="dark-main-colour");c.innerHTML='<table style="width:98%;max-width:550px;"><tr><td style="text-align:left;width:1%;padding-right:7px;vertical-align:top;"><img src="../../img/profile/'+
  b+'.jpg" alt="CD" style="border-radius:50%;width:45px;height:45px" onerror="this.onerror=null; this.src=\'../../img/twitter.png\'"></td><td class="'+d+'" style="text-align:left;width:100%;"><b>@'+b+'</b><div class="'+d+'" style="line-height:1.1em;">'+f+'</div><div style="font-size:0.8em;padding-top:2px;line-height:1.1em;color:#777777;">'+e+"</div></td></tr></table>";4>a&&(loadTweet(a+1),0===a&&(timeout=setTimeout("showIt()",250)))}}}))}
  function showIt(){0===counter?startms=(new Date).getTime():1===counter&&ga("send",{hitType:"event",eventCategory:"mode",eventAction:1===darkMode?"dark":"light"});mssofar=(new Date).getTime()-startms;var a=document.getElementById("tweet-feed-"+counter);hideUserPanel();if(null!==a){for(var b=Number($(a).attr("data-delay"));delaysofar+b<=mssofar&&null!==a;)if(delaysofar+=b,$(a).slideDown("slow"),ga("send",{hitType:"event",eventCategory:"tweet",eventAction:"show",eventLabel:urlpage+" - tweet-feed-"+counter}),
  counter++,a=document.getElementById("tweet-feed-"+counter),null!==a)b=Number($(a).attr("data-delay")),loadTweet(counter+4);else{var c=document.getElementById("tweet-feed-"+(counter-1));$(c).slideDown("slow");c=document.getElementById("timer-div");$(c).slideUp("slow");ga("send",{hitType:"event",eventCategory:"feed",eventAction:"ended",eventLabel:urlpage})}if(null!==a){mssofar=(new Date).getTime()-startms;a=delaysofar+b-mssofar;0>a&&(a=1);timeOfNextTweet=(new Date).getTime()+a;timeout=setTimeout("showIt()",
  a);firstTweetLoaded?(document.getElementById("timer").classList.remove("blinking"),document.getElementById("timer").classList.remove("blinking-dark"),document.getElementById("timer").classList.add("not-blinking")):(firstTweetLoaded=!0,pauseText="Press here to continue when you have started the music/video ",document.getElementById("stand-by-arrow").style.display="block",document.getElementById("darkMode").style.display="block",playPause());var d=setInterval(function(){if(paused)document.getElementById("timer").innerHTML=
  pauseText;else{var a=(new Date).getTime(),b=Math.floor((timeOfNextTweet-a)/1E3);1>b?(clearInterval(d),document.getElementById("timer").innerHTML="Next tweet coming up..."):document.getElementById("timer").innerHTML="Next tweet in "+b+(1!==b?" seconds":" second");updateNowPlaying(a-startms)}},1E3)}}}
  function updateNowPlaying(a){var b=document.getElementById("now-playing"),c="none"!==document.getElementById("darkMode").style.display;if(null!==b&&!c){b.style.display="block";b=document.getElementsByClassName("track-list");var d=a/1E3;a=-1;for(c=1;c<b.length;c++)if(b[c].getAttribute("data-start")>d){a=c-1;break}-1===a&&(a=b.length-1);c=b[a];var e=c.getAttribute("data-start"),f=document.getElementById("track-time"),g=document.getElementById("track-title");e=d-e;d=Math.floor(e/60);e="0"+Math.floor(e%
  60);g.innerHTML=c.getAttribute("data-name");f.innerHTML=a<b.length-1?d+":"+e.substr(e.length-2):""}}
  function switchMode(){"1"===document.getElementById("darkMode").value?(darkMode=1,$(".blinking").addClass("blinking-dark"),$(".blinking-dark").removeClass("blinking"),$(".main-colour").addClass("dark-main-colour"),$(".dark-main-colour").removeClass("main-colour"),$(".sub-colour").addClass("dark-sub-colour"),$(".dark-sub-colour").removeClass("sub-colour"),$("body").addClass("dark-mode")):(darkMode=0,$(".blinking-dark").addClass("blinking"),$(".blinking").removeClass("blinking-dark"),$(".dark-main-colour").addClass("main-colour"),
  $(".main-colour").removeClass("dark-main-colour"),$(".dark-sub-colour").addClass("sub-colour"),$(".sub-colour").removeClass("dark-sub-colour"),$("body").removeClass("dark-mode"));clearTimeout(timeout);counter=0;firstTweetLoaded=paused=!1;loadTweet(0)};