var $={};$.id=function(e){return document.getElementById(e)},$.cls=function(e,t){return(t||document).getElementsByClassName(e)},$.byName=function(e){return document.getElementsByName(e)},$.tag=function(e,t){return(t||document).getElementsByTagName(e)},$.el=function(e){return document.createElement(e)},$.qs=function(e,t){return(t||document).querySelector(e)},$.qsa=function(e,t){return(t||document).querySelectorAll(e)},$.extend=function(e,t){for(var a in t)e[a]=t[a]},$.on=function(e,t,a){e.addEventListener(t,a,!1)},$.off=function(e,t,a){e.removeEventListener(t,a,!1)},document.documentElement.classList?($.hasClass=function(e,t){return e.classList.contains(t)},$.addClass=function(e,t){e.classList.add(t)},$.removeClass=function(e,t){e.classList.remove(t)}):($.hasClass=function(e,t){return-1!=(" "+e.className+" ").indexOf(" "+t+" ")},$.addClass=function(e,t){e.className=""===e.className?t:e.className+" "+t},$.removeClass=function(e,t){e.className=(" "+e.className+" ").replace(" "+t+" ","")}),$.get=function(e,t,a){var i,n;if((n=new XMLHttpRequest).open("GET",e,!0),t)for(i in t)n[i]=t[i];if(a)for(i in a)n.setRequestHeader(i,a[i]);return n.send(null),n},$.xhr=function(e,t,a,i){var n,o,r;if((o=new XMLHttpRequest).open(e,t,!0),a)for(n in a)o[n]=a[n];if(i){r=new FormData;for(n in i)r.append(n,i[n]);i=r}else i=null;return o.send(i),o},$.fit=function(e,t,a,i){var n,o,r;return n=e/t,e>a?(o=a,(r=Math.round(o/n))>i&&(r=i,o=Math.round(r*n))):t>i?(r=i,(o=Math.round(r*n))>a&&(o=a,r=Math.round(o/n))):(o=e,r=t),[o,r]},$.ago=function(e){var t,a,i,n;return(t=Date.now()/1e3-e)<1?"moments ago":t<60?(0|t)+" seconds ago":t<3600?(a=0|t/60)>1?a+" minutes ago":"one minute ago":t<86400?(i=(a=0|t/3600)>1?a+" hours":"one hour",(n=0|t/60-60*a)>1&&(i+=" and "+n+" minutes"),i+" ago"):(i=(a=0|t/86400)>1?a+" days":"one day",(n=0|t/3600-24*a)>1&&(i+=" and "+n+" hours"),i+" ago")},$.hash=function(e){var t,a,i=0;for(t=0,a=e.length;t=2?"@2x.gif":".gif",this.icons={admin:o+"adminicon"+n,founder:o+"foundericon"+n,mod:o+"modicon"+n,dev:o+"developericon"+n,manager:o+"managericon"+n,del:o+"filedeleted-res"+n},this.prettify="function"==typeof prettyPrint,this.customSpoiler={},Config.localTime&&((e=(new Date).getTimezoneOffset())?(a=0|(t=Math.abs(e))/60,this.utcOffset="Timezone: UTC"+(e<0?"+":"-")+a+((i=t-60*a)?":"+i:"")):this.utcOffset="Timezone: UTC",this.weekdays=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]),Main.tid&&(this.trackedReplies=this.getTrackedReplies(Main.board,Main.tid),this.trackedReplies?this.touchTrackedReplies(Main.tid):this.trackedReplies={},this.pruneTrackedReplies()),this.postMenuIcon=Main.hasMobileLayout?"...":"\u25b6"},Parser.getTrackedReplies=function(e,t){var a=null;return(a=localStorage.getItem("4chan-track-"+e+"-"+t))&&(a=JSON.parse(a)),a},Parser.saveTrackedReplies=function(e,t){var a="4chan-track-"+Main.board+"-"+e;localStorage.setItem(a,JSON.stringify(t))},Parser.touchTrackedReplies=function(e){var t,a;a="4chan-track-"+Main.board+"-ts",(t=(t=localStorage.getItem(a))?JSON.parse(t):{})[e]=0|Date.now()/1e3,localStorage.setItem(a,JSON.stringify(t))},Parser.pruneTrackedReplies=function(){var e,t,a,i,n,o,r;if(o="4chan-track-"+Main.board+"-",t=localStorage.getItem(o+"ts")){n=259200,i=(a=0|Date.now()/1e3)-n,r=!1,t=JSON.parse(t),Main.tid&&t[Main.tid]&&(t[Main.tid]=a,r=!0);for(e in t)t[e]<=i&&(r=!0,delete t[e],localStorage.removeItem(o+e));if(r){localStorage.removeItem(o+"ts");for(e in t){localStorage.setItem(o+"ts",JSON.stringify(t));break}}}},Parser.parseThreadJSON=function(e){var t;try{t=JSON.parse(e).posts}catch(a){console.log(a),t=[]}return t},Parser.parseCatalogJSON=function(e){var t;try{t=JSON.parse(e)}catch(a){console.log(a),t=[]}return t},Parser.setCustomSpoiler=function(e,t){var a;!this.customSpoiler[e]&&(t=parseInt(t))&&(e==Main.board&&(a=$.cls("imgspoiler")[0])?this.customSpoiler[e]=a.firstChild.src.match(/spoiler(-[a-z0-9]+)\.png$/)[1]:this.customSpoiler[e]="-"+e+(Math.floor(Math.random()*t)+1))},Parser.buildPost=function(e,t,a){var i,n,o,r=null;for(i=0;n=e[i];++i)n.no==a&&(!Config.revealSpoilers&&e[0].custom_spoiler&&Parser.setCustomSpoiler(t,e[0].custom_spoiler),r=Parser.buildHTMLFromJSON(n,t,!1,!0).lastElementChild,Config.IDColor&&(o=$.cls("posteruid",r)[Main.hasMobileLayout?0:1])&&IDColor.applyRemote(o.firstElementChild));return r},Parser.decodeSpecialChars=function(e){return e.replace(/&/g,"&").replace(/"/g,'"').replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")},Parser.encodeSpecialChars=function(e){return e.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(//g,">")},Parser.onDateMouseOver=function(e){Parser.tipTimeout&&(clearTimeout(Parser.tipTimeout),Parser.tipTimeout=null),Parser.tipTimeout=setTimeout(Tip.show,500,e,$.ago(+e.getAttribute("data-utc")))},Parser.onTipMouseOut=function(){Parser.tipTimeout&&(clearTimeout(Parser.tipTimeout),Parser.tipTimeout=null)},Parser.onUIDMouseOver=function(e){var t;$.hasClass(e.parentNode,"posteruid")&&(Main.tid||(t=e.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode,$.hasClass(t,"tExpanded")))&&(Parser.tipTimeout&&(clearTimeout(Parser.tipTimeout),Parser.tipTimeout=null),Parser.tipTimeout=setTimeout(Parser.showUIDCount,500,e,e.textContent))},Parser.showUIDCount=function(e,t){var a,i,n,o,r;for(o=0,n=$.qsa(".postInfo .hand"),a=0;i=n[a];++a)i.textContent===t&&++o;r=o+" post"+(1!=o?"s":"")+" by this ID",Tip.show(e,r)},Parser.buildHTMLFromJSON=function(e,t,a,i){var n,o,r,s,d,l,c,p,h,u,g,m,f,b,v,C,w,y,x,k=document.createElement("div"),M=!1,T="",S="",R="",E="",N='"',$="",P="",L="",Q="",H="",D="",A="",I="",F="",q="",B="",_="",W="",O="reply",U="",z="",j="",J="",Y=!1;switch(x="//i.4cdn.org/"+t,e.resto?f=e.resto:(M=!0,a&&(e.replies>0?(y=e.replies+" Repl"+(e.replies>1?"ies":"y"),e.images>0&&(y+=" / "+e.images+" Image"+(e.images>1?"s":""))):y="",W='',O="op",_='  [Reply]'),t!=Main.board&&(J='/'+t+"/ "),f=e.no),Main.tid&&t==Main.board?(h="#p"+e.no,u="javascript:quote('"+e.no+"')"):(h="//boards."+$L.d(t)+"/"+t+"/thread/"+f+"#p"+e.no,u="//boards."+$L.d(t)+"/"+t+"/thread/"+f+"#q"+e.no),n=!e.capcode&&e.id?' (ID: '+e.id+") ":"",e.capcode){case"admin_highlight":F=" highlightPost";case"admin":D=' ## Admin',A=" capcodeAdmin",I=' This user is a 4chan Administrator.';break;case"mod":D=' ## Mod',A=" capcodeMod",I=' This user is a 4chan Moderator.';break;case"developer":D=' ## Developer',A=" capcodeDeveloper",I=' This user is a 4chan Developer.';break;case"manager":D=' ## Manager',A=" capcodeManager",I=' This user is a 4chan Manager.';break;case"founder":D=' ## Founder',A=" capcodeAdmin",I=' This user is 4chan\'s Founder.';break;case"verified":D=' ## Verified',A=" capcodeVerified",I=""}if(e.email&&(q='',B=""),d=e.flag_name?' ':e.country_name?' ':"",e.filedeleted?E='
File deleted.
':e.ext&&(g=Parser.decodeSpecialChars(e.filename),L=Q=e.filename+e.ext,g.length>(M?40:30)&&(L=Parser.encodeSpecialChars(g.slice(0,M?35:25))+"(...)"+e.ext,Y=!0),e.tn_w||e.tn_h||".gif"!=e.ext||(e.tn_w=e.w,e.tn_h=e.h),$=e.fsize>=1048576?(0|e.fsize/1048576*100+.5)/100+" M":e.fsize>1024?(0|e.fsize/1024+.5)+" K":e.fsize+" ",e.spoiler?Config.revealSpoilers?s=L:(s="Spoiler Image",N='" title="'+Q+'"',P=" imgspoiler",o="//s.4cdn.org/image/spoiler"+(Parser.customSpoiler[t]||"")+".png",e.tn_w=100,e.tn_h=100,!0):s=L,o||(o="//i.4cdn.org/"+t+"/"+e.tim+"s.jpg"),T=".pdf"==e.ext?"PDF":e.w+"x"+e.h,"f"!=t?(S=''+$+'B
'+$+"B "+e.ext.slice(1).toUpperCase()+"
",R='
File: '+s+" ("+$+"B, "+T+")
"):(r=x+"/"+e.filename+e.ext,T+=", "+e.tag,R='
File: '+e.filename+".swf ("+$+"B, "+T+")
"),E='
'+R+S+"
"),e.trip&&(H=' '+e.trip+""),l=e.name||"",c=Main.hasMobileLayout&&l.length>30?''+Parser.truncate(l,30)+"(...) ":''+l+" ",M?(e.capcode_replies&&(z=Parser.buildCapcodeReplies(e.capcode_replies,t,e.no)),i&&e.replies&&(m=e.replies+" repl"+(e.replies>1?"ies":"y"),e.images&&(m+=" and "+e.images+" image"+(e.images>1?"s":"")),U=''+m+"."),e.sticky&&(j+='Sticky '),e.closed&&(e.archived?j+='Archived ':j+='Closed '),p=e.sub===undefined?' ':Main.hasMobileLayout&&e.sub.length>30?''+Parser.truncate(e.sub,30)+"(...) ":''+e.sub+" "):p="",k.className="postContainer "+O+"Container",k.id="pc"+e.no,e.xa24&&(k.className+=" p-xa24-"+e.xa24),k.innerHTML=(M?"":'
>>
')+'
"+(M?E:"")+'"+(M?"":E)+'
'+(e.com||"")+z+U+"
"+W,!Main.tid||t!=Main.board)for(w=k.getElementsByClassName("quotelink"),b=0;v=w[b];++b)"/"!=(C=v.getAttribute("href")).charAt(0)&&(v.href="//boards."+$L.d(t)+"/"+t+"/thread/"+f+C);return k},Parser.truncate=function(e,t){return e=e.replace(",",","),e=(e=Parser.decodeSpecialChars(e)).slice(0,t),e=Parser.encodeSpecialChars(e)},Parser.buildCapcodeReplies=function(e,t,a){var i,n,o,r,s,d,l,c;s={admin:"Administrator",mod:"Moderator",developer:"Developer",manager:"Manager"},t!=Main.board?(l="/"+t+"/thread/",c=">>>/"+t+"/"):(l="",c=">>"),r='

';for(n in e)for(r+=''+s[n]+" Replies: ",d=e[n],i=0;o=d[i];++i)r+=''+c+o+" ";return r+""},Parser.parseBoard=function(){var e,t=document.getElementsByClassName("thread");for(e=0;t[e];++e)Parser.parseThread(t[e].id.slice(1))},Parser.parseThread=function(e,t,a){var i,n,o,r,s,d,l,c,p,h,u,g;if(r=(o=$.id("t"+e)).getElementsByClassName("post"),!t&&(s=document.getElementById("pi"+e),Main.tid||(Config.filter&&(u=Filter.exec(o,s,document.getElementById("m"+e),e)),Config.threadHiding&&!u&&(Main.hasMobileLayout||((d=document.createElement("span")).innerHTML='H',r[0].insertBefore(d,r[0].firstChild),d.id="sa"+e),ThreadHiding.hidden[e]&&(ThreadHiding.hidden[e]=Main.now,ThreadHiding.hide(e))),ThreadExpansion.enabled&&(c=$.cls("summary",o)[0])&&(l=document.createDocumentFragment(),(p=c.cloneNode(!0)).className="",c.textContent="",(d=document.createElement("img")).className="extButton expbtn",d.title="Expand thread",d.alt="+",d.setAttribute("data-cmd","expand"),d.setAttribute("data-id",e),d.src=Main.icons.plus,l.appendChild(d),l.appendChild(p),(d=document.createElement("span")).style.display="none",d.textContent="Showing all replies.",l.appendChild(d),c.appendChild(l))),Main.tid&&Config.threadWatcher))for(d=document.createElement("img"),ThreadWatcher.watched[h=e+"-"+Main.board]?(d.src=Main.icons.watched,d.setAttribute("data-active","1")):d.src=Main.icons.notwatched,d.className="extButton wbtn wbtn-"+h,d.setAttribute("data-cmd","watch"),d.setAttribute("data-id",e),d.alt="W",d.title="Add to watch list",g=$.cls("navLinks"),i=1;i<3&&(n=g[i]);++i)(l=document.createDocumentFragment()).appendChild(document.createTextNode("[")),l.appendChild(d.cloneNode(!0)),l.appendChild(document.createTextNode("] ")),n.insertBefore(l,n.firstChild);if(n=t?t<0?r.length+t:t:0,a=a?n+a:r.length,Main.isMobileDevice&&Config.quotePreview)for(i=n;i(a?40:30)?o=n[0].slice(0,a?35:25)+"(...)"+n[1]:(o=i.title,i.removeAttribute("title")),i.firstElementChild.innerHTML=o,e.insertBefore(t,e.firstElementChild)},Parser.parsePost=function(e,t){var a,i,n,o,r,s,d,l;a=Main.hasMobileLayout,t?o=document.getElementById("pi"+e):e=(o=e.getElementsByClassName("postInfo")[0]).id.slice(2),Parser.needMsg&&(s=document.getElementById("m"+e)),(n=document.createElement("a")).href="#",n.className="postMenuBtn",n.title="Post menu",n.setAttribute("data-cmd","post-menu"),n.textContent=Parser.postMenuIcon,a?(i=document.getElementById("pim"+e)).insertBefore(n,i.firstElementChild):o.appendChild(n),t&&(e!=t&&(Config.filter&&(d=Filter.exec(o.parentNode,o,s)),!d&&ReplyHiding.hidden[e]&&(ReplyHiding.hidden[e]=Main.now,ReplyHiding.hide(e))),Config.backlinks&&Parser.parseBacklinks(e,t),Main.isOekakiBoard&&Main.tid&&Parser.addOekakiEditLink(e,t)),IDColor.enabled&&(l=$.cls("posteruid",o.parentNode)[a?0:1])&&IDColor.apply(l.firstElementChild),Config.linkify&&Linkify.exec(s),Config.embedSoundCloud&&Media.parseSoundCloud(s),(Config.embedYouTube||a)&&Media.parseYouTube(s),Config.revealSpoilers&&(r=document.getElementById("f"+e))&&(r=r.children[1])&&$.hasClass(r,"imgspoiler")&&Parser.revealImageSpoiler(r),Config.localTime&&(a?(n=o.parentNode.getElementsByClassName("dateTime")[0]).firstChild.nodeValue=Parser.getLocaleDate(new Date(1e3*n.getAttribute("data-utc")))+" ":(n=o.getElementsByClassName("dateTime")[0]).textContent=Parser.getLocaleDate(new Date(1e3*n.getAttribute("data-utc"))))},Parser.addOekakiEditLink=function(e,t){var a,i,n;(a=$.id("fT"+e))&&(n=a.firstElementChild).href&&/\.(png|jpg)$/.test(n.href)&&((i=$.el("small")).innerHTML=' Edit',a.appendChild(i))},Parser.getLocaleDate=function(e){return("0"+(1+e.getMonth())).slice(-2)+"/"+("0"+e.getDate()).slice(-2)+"/"+("0"+e.getFullYear()).slice(-2)+"("+this.weekdays[e.getDay()]+")"+("0"+e.getHours()).slice(-2)+":"+("0"+e.getMinutes()).slice(-2)+":"+("0"+e.getSeconds()).slice(-2)},Parser.parseBacklinks=function(e,t){var a,i,n,o,r,s,d,l,c;if(n=document.getElementById("m"+e).getElementsByClassName("quotelink"))for(o={},a=0;i=n[a];++a)(r=i.getAttribute("href").split("#p"))[1]&&(r[1]==t&&(i.textContent+=" (OP)"),(s=document.getElementById("pi"+r[1]))?o[r[1]]||(o[r[1]]=!0,d=document.createElement("span"),c=Main.tid?"#p"+e:"thread/"+t+"#p"+e,Main.hasMobileLayout?d.innerHTML='>>'+e+' # ':d.innerHTML='>>'+e+" ",(l=document.getElementById("bl_"+r[1]))||((l=document.createElement("div")).id="bl_"+r[1],l.className="backlink",Main.hasMobileLayout&&(l.className="backlink mobile",s=document.getElementById("p"+r[1])),s.appendChild(l)),l.appendChild(d)):Main.tid&&">"!=i.textContent.charAt(2)&&(i.textContent+=" \u2192"))},Parser.buildSummary=function(e,t,a){var i;return t?(t=t+" repl"+(t>1?"ies":"y"),a=a?" and "+a+" image"+(a>1?"s":""):"",(i=document.createElement("span")).className="summary desktop",i.innerHTML=t+a+' omitted. Click here to view.',i):null};var OgvCtrl={ogv:null,cnt:null,ctrl:{},seeking:!1,visible:!1,tick:null,attach:function(e){this.detach(),e.parentNode.appendChild(this.cnt),$.on(e,"mouseup",this.toggleCtrl),this.ogv=e},detach:function(){this.ogv&&(this.ogv.stop(),$.off(this.ogv,"mouseup",this.toggleCtrl),this.ctrl.play.classList.remove("ogv-toggled"),this.ctrl.mute.classList.remove("ogv-toggled"),this.hideCtrl(),this.ogv=null,this.seeking=!1,this.cnt.remove())},init:function(){if(this.cnt)return;let e=$.el("div");e.className="ogv-ctrl";let t=$.el("div");t.className="ogv-btn",t.innerHTML='',$.on(t,"click",this.togglePlay,!1),this.ctrl.play=t,e.appendChild(t),(t=$.el("input")).className="ogv-seek",t.type="range",t.min=0,t.value=0,t.max=100,t.step=.1,$.on(t,"change",this.onSeek,!1),$.on(t,"mousedown",this.toggleSeek,!1),$.on(t,"mouseup",this.toggleSeek,!1),this.ctrl.seek=t,e.appendChild(t),(t=$.el("div")).className="ogv-ts",t.textContent="0:00 / 0:00",this.ctrl.ts=t,e.appendChild(t),(t=$.el("div")).className="ogv-btn",t.innerHTML='',$.on(t,"click",this.toggleMute,!1),this.ctrl.mute=t,e.appendChild(t),(t=$.el("input")).className="ogv-vol",t.type="range",t.min=0,t.value=50,t.step=.1,t.max=100,$.on(t,"input",this.onVolInput,!1),this.ctrl.vol=t,e.appendChild(t),(t=$.el("div")).className="ogv-btn",t.innerHTML='',$.on(t,"click",this.toggleFullscreen,!1),this.ctrl.fs=t,e.appendChild(t),this.cnt=e},onPlayEnd:function(){OgvCtrl.ogv.seekable.length?OgvCtrl.ogv.currentTime=0:OgvCtrl.ogv.stop(),OgvCtrl.ogv.play()},toggleCtrl:function(){OgvCtrl.visible?OgvCtrl.hideCtrl():(OgvCtrl.cnt.style.display="flex",OgvCtrl.setTickTimeout(),OgvCtrl.updateTimes(),OgvCtrl.visible=!0)},hideCtrl:function(){OgvCtrl.cnt.style.display="none",OgvCtrl.clearTickTimeout(),OgvCtrl.visible=!1},toggleSeek:function(){OgvCtrl.seeking=!OgvCtrl.seeking},seekTick:function(){OgvCtrl.setTickTimeout(),OgvCtrl.updateTimes()},setTickTimeout:function(){OgvCtrl.tick=setTimeout(OgvCtrl.seekTick,500)},clearTickTimeout:function(){clearTimeout(OgvCtrl.tick),OgvCtrl.tick=null},updateTimes:function(){if(!OgvCtrl.ogv.duration)return;OgvCtrl.seeking||(OgvCtrl.ctrl.seek.value=(OgvCtrl.ogv.currentTime/OgvCtrl.ogv.duration*100).toFixed(2));let e=Math.floor(OgvCtrl.ogv.duration/60),t=Math.floor(OgvCtrl.ogv.duration-60*e),a=Math.floor(OgvCtrl.ogv.currentTime/60),i=Math.floor(OgvCtrl.ogv.currentTime-60*a);OgvCtrl.ctrl.ts.textContent=`${a}:${i.toString().padStart(2,"0")} / ${e}:${t.toString().padStart(2,"0")}`},togglePlay:function(){OgvCtrl.ogv.paused?OgvCtrl.ogv.play():OgvCtrl.ogv.pause(),OgvCtrl.ctrl.play.classList.toggle("ogv-toggled")},onSeek:function(){OgvCtrl.ogv.currentTime=this.value/100*OgvCtrl.ogv.duration},toggleMute:function(){OgvCtrl.ogv.muted=!OgvCtrl.ogv.muted,OgvCtrl.ctrl.mute.classList.toggle("ogv-toggled")},onVolInput:function(){OgvCtrl.ogv.volume=this.value/100},toggleFullscreen:function(){document.fullscreenElement?document.exitFullscreen():OgvCtrl.ogv.parentNode.requestFullscreen(),OgvCtrl.ctrl.fs.classList.toggle("ogv-toggled")}},PostMenu={activeBtn:null};PostMenu.open=function(e){var t,a,i,n,o,r,s,d,l,c,p;PostMenu.activeBtn!=e?(PostMenu.close(),i=e.parentNode.id.replace(/^[0-9]*[^0-9]+/,""),c=!(n=e.parentNode.getAttribute("data-board"))&&!!$.id("t"+i),a='",o=e.getBoundingClientRect(),t.style.top=o.bottom+3+window.pageYOffset+"px",document.addEventListener("click",PostMenu.close,!1),$.addClass(e,"menuOpen"),PostMenu.activeBtn=e,UA.dispatchEvent("4chanPostMenuReady",{postId:i,isOP:c,node:t.firstElementChild}),document.body.appendChild(t),(d=o.left+window.pageXOffset)>(l=$.docEl.clientWidth-t.offsetWidth)-75&&(t.className+=" dd-menu-left"),d>l&&(d=l),t.style.left=d+"px"):PostMenu.close()},PostMenu.close=function(){var e;(e=$.id("post-menu"))&&(e.parentNode.removeChild(e),document.removeEventListener("click",PostMenu.close,!1),$.removeClass(PostMenu.activeBtn,"menuOpen"),PostMenu.activeBtn=null)};var Search={xhr:null,pageSize:10,maxPages:10,init:function(){var e;(e=$.id("g-search-form"))&&($.on(e,"submit",Search.onSearch),$.on(window,"hashchange",Search.onHashChanged),"boards.4channel.org"==location.host&&Search.initSelector(),Search.initFromURL(!0))},initSelector:function(){var e,t,a,i;for(e=(a=(i=$.id("js-sf-bf")).options).length-1;e>=0;e--)""!==(t=a[e]).value&&"4chan.org"!==$L.d(t.value)||i.removeChild(t)},initFromURL:function(e){var t,a,i,n,o,r;if((t=Search).query="",t.board="",t.offset=0,""!==(a=window.location.hash)&&a.length<=512&&((a=a.split("/").slice(1))[0]?t.query=decodeURIComponent(a[0]):t.query="",t.board=a[1]||"",a[1]&&("all"===a[1]?t.board="":t.board=a[1]),t.offset=t.pageToOffset(0|a[2])),!e||""!==t.query){for($.id("js-sf-qf").value=t.query,(n=$.id("js-sf-bf")).selectedIndex=0,i=0,o=n.options;r=o[i];++i)if(r.value===t.board){n.selectedIndex=i;break}0===n.selectedIndex&&""!==t.board&&(t.board=""),Search.exec(t.query,t.board,t.offset)}},onHashChanged:function(){Search.initFromURL()},pageToOffset:function(e){return(e<1||e>Search.maxPages)&&(e=1),(e-1)*Search.pageSize},offsetToPage:function(e){var t=e/Search.pageSize+1;return(t<1||t>Search.maxPages)&&(t=1),t},updateURL:function(){var e,t=[];""!==(e=Search).query&&(t.push(encodeURIComponent(e.query)),e.offset>0?(e.board&&""!==e.board?t.push(e.board):t.push("all"),t.push(Search.offsetToPage(e.offset))):e.board&&t.push(e.board)),t.length?window.history.replaceState(null,"","#/"+t.join("/")):window.history.replaceState(null,"",window.location.href.replace(/#.*$/,""))},onSearch:function(e){var t,a;e&&e.preventDefault(),Search.query=t=$.id("js-sf-qf").value,Search.board=a=$.id("js-sf-bf").value,Search.exec(t,a,0)},exec:function(e,t,a){var i,n=[];(i=Search).toggleSpinner(!1),i.updateCtrl(!1),i.xhr&&(i.xhr.abort(),i.xhr=null),""!==e&&(n.push("q="+encodeURIComponent(e)),""!==t&&n.push("b="+t),a&&n.push("o="+(0|a)),n=n.join("&"),i.query=e,i.board=t,i.offset=a,i.updateURL(),i.toggleSpinner(!0),i.xhr=$.get("https://find."+location.host.replace(/^boards\./,"")+"/api?"+n,{onload:i.onLoad,onerror:i.onError,withCredentials:!0}))},onPageClick:function(){var e;e=+this.getAttribute("data-o"),Search.exec(Search.query,Search.board,e)},onLoad:function(){var e;Search.toggleSpinner(!1);try{e=JSON.parse(this.responseText)}catch(t){return Search.showError("Something went wrong."),void console.log(t)}Search.buildResults(e)},onError:function(){Search.toggleSpinner(!1),Search.showError("Connection error.")},updateCtrl:function(e,t){var a,i,n,o,r;!1!==e?((a=$.id("js-sf-pl"))&&a.parentNode.removeChild(a),(a=$.el("div")).id="js-sf-pl",Main.hasMobileLayout?a.className="mPagelist mobile":a.className="pagelist desktop",t=+t,e=+e,(o=Math.ceil(t/Search.pageSize))>Search.maxPages&&(o=Search.maxPages),(r=e/Search.pageSize+1)>1&&((i=$.el("div")).className="prev",Main.hasMobileLayout?((n=$.el("a")).className="button",n.textContent="Previous"):((n=$.el("input")).type="button",n.value="Previous"),n.setAttribute("data-o",e-Search.pageSize),$.on(n,"click",Search.onPageClick),i.appendChild(n),a.appendChild(i)),(i=$.el("div")).className="pages",i.textContent="Page "+r+" / "+o,a.appendChild(i),r'+e+"":""},showError:function(e){Search.showStatus(e,"error")},toggleSpinner:function(e){var t=$.id("js-sf-btn");e?(t.disabled=!0,Search.showStatus("Searching\u2026","spnr")):(t.disabled=!1,Search.showStatus(!1))},buildResults:function(e){var t,a,i,n,o,r,s,d;if((o=e.threads).length<1)return Search.showError("Nothing found."),void Search.updateCtrl(!1);for((s=$.cls("board")[0]).textContent="",t=0;r=o[t];++t){for(i=r.posts[0], (n=$.el("div")).id="t"+i.no,n.className="thread",n.appendChild(Parser.buildHTMLFromJSON(i,r.board,!0)),a=1;d=r.posts[a];++a)n.appendChild(Parser.buildHTMLFromJSON(d,r.board));s.appendChild(n),s.appendChild($.el("hr"))}Search.updateCtrl(e.offset,e.nhits)}},Depager={};Depager.init=function(){var e,t,a;if(this.isLoading=!1,this.isEnabled=!1,this.isComplete=!1,this.threadsLoaded=!1,this.threadQueue=[],this.debounce=100,this.threshold=350,this.adId="azk53379",this.adZones=[16258,16260],this.boardHasAds=!!$.id(this.adId),this.boardHasAds&&(e=$.cls("ad-plea"),this.adPlea=e[e.length-1]),Main.hasMobileLayout){if(!(e=$.cls("next")[1]))return;(e=e.firstElementChild).textContent="Load More",e.className+=" m-depagelink",e.setAttribute("data-cmd","depage")}else{if(!(e=$.cls("prev")[0]))return;e.innerHTML='[All]',e=e.firstElementChild}Config.alwaysDepage?(this.isEnabled=!0,e.parentNode.parentNode.className+=" depagerEnabled",Depager.bindHandlers(),!Main.hasMobileLayout&&(a=$.cls("board")[0])&&((t=document.createElement("span")).className="depageNumber",t.textContent="Page 1",a.insertBefore(t,a.firstElementChild))):e.setAttribute("data-cmd","depage")},Depager.onScroll=function(){document.documentElement.scrollHeight<=Math.ceil(window.innerHeight+window.pageYOffset)+Depager.threshold&&(Depager.threadsLoaded?Depager.renderNext():Depager.depage())},Depager.trackPageview=function(e){var t;try{window._gat&&(t="/"+Main.board+"/"+e,window._gat._getTrackerByName()._trackPageview(t)),window.__qc&&(window.__qc.qpixelsent=[],window._qevents.push({qacct:window.__qc.qopts.qacct}),window.__qc.firepixels())}catch(a){console.log(a)}},Depager.insertAd=function(e,t,a,i){var n,o,r;Depager.boardHasAds&&window.ados_add_placement&&(i&&(n=(r=$.cls("bottomad"))[r.length-1],(o=document.createElement("div")).id="azkDepage"+(e+1),n.appendChild(o),window.ados_add_placement(3536,18130,o.id,4).setZone(a)),(n=document.createElement("div")).className="bottomad center depaged-ad",2==e?o=$.id(Depager.adId):(o=document.createElement("div")).id="azkDepage"+e,n.appendChild(o),t.appendChild(n),Depager.adPlea&&t.appendChild(Depager.adPlea.cloneNode(!0)),t.appendChild(document.createElement("hr")),2!=e&&window.ados_add_placement(3536,18130,o.id,4).setZone(a))},Depager.loadAds=function(){Depager.boardHasAds&&window.ados_load&&window.ados_load()},Depager.renderNext=function(){var e,t,a,i,n,o,r,s,d,l,c,p,h,u,g,m,f;if(c=[],p=window.pageYOffset,t=document.createDocumentFragment(),m=Depager.threadQueue.shift()){for(o=m.threads,g=m.page,f=!Depager.threadQueue.length,Depager.insertAd(g,t,m.adZone,f),(e=document.createElement("span")).className="depageNumber",e.textContent="Page "+g,t.appendChild(e),i=0;r=o[i];++i)if(!$.id("t"+r.no)){if((d=document.createElement("div")).id="t"+r.no,d.className="thread",d.appendChild(Parser.buildHTMLFromJSON(r,Main.board,!0)),(s=Parser.buildSummary(r.no,r.omitted_posts,r.omitted_images))&&d.appendChild(s),r.replies)for(h=r.last_replies,n=0;l=h[n];++n)d.appendChild(Parser.buildHTMLFromJSON(l,Main.board));t.appendChild(d),t.appendChild(document.createElement("hr")),c.push(r.no)}for(f&&(Depager.unbindHandlers(),Depager.isComplete=!0,Depager.setStatus("disabled")),(u=$.cls("board")[0]).insertBefore(t,u.lastElementChild),Depager.trackPageview(g),Depager.loadAds(),a=0;r=c[a];++a)Parser.parseThread(r);window.scrollTo(0,p)}},Depager.bindHandlers=function(){window.addEventListener("scroll",Depager.onScroll,!1),window.addEventListener("resize",Depager.onScroll,!1)},Depager.unbindHandlers=function(){window.removeEventListener("scroll",Depager.onScroll,!1),window.removeEventListener("resize",Depager.onScroll,!1)},Depager.setStatus=function(e){var t,a,i,n,o;if(Main.hasMobileLayout?(i=$.cls("m-depagelink"),o="Load More"):(i=$.cls("depagelink"),o="All"),i.length)if("enabled"==e)for(t=0;a=i[t];++t)a.textContent=o,n=a.parentNode.parentNode,$.hasClass(n,"depagerEnabled")||$.addClass(n,"depagerEnabled");else if("loading"==e)for(t=0;a=i[t];++t)a.textContent="Loading\u2026";else if("disabled"==e)for(t=0;a=i[t];++t)Main.hasMobileLayout?a.parentNode.parentNode.removeChild(a.parentNode):(a.textContent=o,$.removeClass(a.parentNode.parentNode,"depagerEnabled"));else if("error"==e)for(t=0;a=i[t];++t)a.textContent="Error",a.removeAttribute("title"),a.removeAttribute("data-cmd"),$.removeClass(a.parentNode.parentNode,"depagerEnabled")},Depager.toggle=function(){Depager.isLoading||Depager.isComplete||(Depager.isEnabled?Depager.disable():Depager.enable(),Depager.isEnabled=!Depager.isEnabled)},Depager.enable=function(){Depager.bindHandlers(),Depager.setStatus("enabled"),Depager.onScroll()},Depager.disable=function(){Depager.unbindHandlers(),Depager.setStatus("disabled")},Depager.depage=function(){Depager.isLoading||(Depager.isLoading=!0,$.get("//a.4cdn.org/"+Main.board+"/catalog.json",{onload:Depager.onLoad,onerror:Depager.onError}),Depager.setStatus("loading"))},Depager.onLoad=function(){var e,t,a,i,n;if(Depager.isLoading=!1,Depager.threadsLoaded=!0,200==this.status){for(Depager.setStatus("enabled"),Config.alwaysDepage||Depager.bindHandlers(),e=Parser.parseCatalogJSON(this.responseText),i=Depager.threadQueue,n=0,t=1;a=e[t];++t)a.adZone=Depager.adZones[n],i.push(a),n=n?0:1;Depager.renderNext()}else 404==this.status?(Depager.unbindHandlers(),Depager.setStatus("error")):(Depager.unbindHandlers(),console.log("Error: "+this.status),Depager.setStatus("error"))},Depager.onError=function(){Depager.isLoading=!1,Depager.unbindHandlers(),console.log("Error: "+this.status),Depager.setStatus("error")};var QuoteInline={};QuoteInline.isSelfQuote=function(e,t,a){return(!a||a==Main.board)&&("BLOCKQUOTE"==(e=e.parentNode).nodeName&&e.id.split("m")[1]==t||e.parentNode.id.split("_")[1]==t)},QuoteInline.toggle=function(e,t){var a,i,n,o,r,s,d,l;if((n=e.getAttribute("href").match(/(?:\/([a-z0-9]+)\/thread\/)?([0-9]+)?#p([0-9]+)$/))&&!QuoteInline.isSelfQuote(e,n[3],n[1])){if(t&&t.preventDefault(),o=e.getAttribute("data-pfx")){for(e.removeAttribute("data-pfx"),$.removeClass(e,"linkfade"),s=$.id(o+"p"+n[3]),l=$.cls("expandedWebm",s),a=0;i=l[a];++a)i.pause();return s.parentNode.removeChild(s),void("backlink"==e.parentNode.parentNode.className&&(0===(d=+(s=$.id("pc"+n[3])).getAttribute("data-inline-count")-1)?(s.style.display="",s.removeAttribute("data-inline-count")):s.setAttribute("data-inline-count",d)))}(r=$.id("p"+n[3]))?QuoteInline.inline(e,r,n[3]):QuoteInline.inlineRemote(e,n[1]||Main.board,n[2],n[3])}},QuoteInline.inlineRemote=function(e,t,a,i){var n,o,r,s,d,l;if(!e.hasAttribute("data-loading")){if(s=t+"-"+a,(r=$.cache[s])&&(d=Parser.buildPost(r,t,i)))return Parser.parsePost(d),void QuoteInline.inline(e,d);(l=e.nextElementSibling)&&$.hasClass(l,"spinner")?l.parentNode.removeChild(l):((l=document.createElement("div")).className="preview spinner inlined",l.textContent="Loading...",e.parentNode.insertBefore(l,e.nextSibling),n=function(){var a,n;e.removeAttribute("data-loading"),200===this.status||304===this.status||0===this.status?(n=Parser.parseThreadJSON(this.responseText),$.cache[s]=n,(a=Parser.buildPost(n,t,i))?(l.parentNode&&l.parentNode.removeChild(l),Parser.parsePost(a),QuoteInline.inline(e,a)):($.addClass(e,"deadlink"),l.textContent="This post doesn't exist anymore")):404===this.status?($.addClass(e,"deadlink"),l.textContent="This thread doesn't exist anymore"):this.onerror()},o=function(){l.textContent="Error: "+this.statusText+" ("+this.status+")",e.removeAttribute("data-loading")},e.setAttribute("data-loading","1"),$.get("//a.4cdn.org/"+t+"/thread/"+a+".json",{onload:n,onerror:o}))}},QuoteInline.inline=function(e,t,a){var i,n,o,r,s,d,l,c,p,h,u,g;if(o=Date.now(),a)for("backlink"==(s=e.parentNode.parentNode).className?(r=s.parentNode.parentNode.parentNode,d=!0):r=s.parentNode;r.parentNode!==document;){if(r.id.split("m")[1]==a)return;r=r.parentNode}if(e.className+=" linkfade",e.setAttribute("data-pfx",o),QuotePreview.stopMedia(t),(r=t.cloneNode(!0)).id=o+r.id,r.setAttribute("data-pfx",o),r.className+=" preview inlined",$.removeClass(r,"highlight"),$.removeClass(r,"highlight-anti"),(l=$.cls("inlined",r))[0]){for(;n=l[0];)n.parentNode.removeChild(n);for(l=$.cls("quotelink",r),i=0;n=l[i];++i)n.removeAttribute("data-pfx"),$.removeClass(n,"linkfade")}for(i=0;n=r.children[i];++i)n.id=o+n.id;if((c=$.cls("backlink",r)[0])&&(c.id=o+c.id),d)p=s.parentNode.parentNode.getAttribute("data-pfx")||"",(h=$.id(p+"m"+s.id.split("_")[1])).insertBefore(r,h.firstChild),(u=t.parentNode.getAttribute("data-inline-count"))?u=+u+1:(u=1,t.parentNode.style.display="none"),t.parentNode.setAttribute("data-inline-count",u);else{for(g=$.hasClass(e.parentNode,"quote")?(e=e.parentNode).parentNode:e.parentNode;"S"===g.nodeName;)e=g,g=g.parentNode;g.insertBefore(r,e.nextSibling)}};var QuotePreview={};QuotePreview.init=function(){this.regex=/(?:\/([a-z0-9]+)\/thread\/)?([0-9]+)?#p([0-9]+)$/,this.highlight=null,this.highlightAnti=null,this.cur=null},QuotePreview.resolve=function(e){var t,a,i,n,o;if((t=QuotePreview).cur=null,a=e.getAttribute("href").match(t.regex))if(o=e.getAttribute("data-pfx")||"",i=document.getElementById(o+"p"+a[3])){if((n=i.getBoundingClientRect()).top>0&&n.bottom .quotelink",t))[1])for(h=">>"+e.parentNode.parentNode.id.split("_")[1],c=0;p=l[c];++c)if(p.textContent==h){$.addClass(p,"dotted");break}i=e.getBoundingClientRect(),r=(o=document.documentElement).offsetWidth,s=t.style,document.body.appendChild(t),Main.isMobileDevice?(s.top=i.top+e.offsetHeight+window.pageYOffset+"px",r-i.right<(0|.3*r)?s.right=r-i.right+"px":s.left=i.left+"px"):(r-i.right<(0|.3*r)?(d=r-i.left,s.right=d+5+"px"):(d=i.left+i.width,s.left=d+5+"px"),u=i.top+e.offsetHeight+window.pageYOffset-t.offsetHeight/2-i.height/2,n=t.getBoundingClientRect().height,u<(g=o.scrollTop!=document.body.scrollTop?o.scrollTop+document.body.scrollTop:document.body.scrollTop)?s.top=g+"px":u+n>g+o.clientHeight?s.top=g+o.clientHeight-n+"px":s.top=u+"px")},QuotePreview.remove=function(e){var t,a;(t=QuotePreview).cur=null,t.highlight?($.removeClass(t.highlight,"highlight"),t.highlight=null):t.highlightAnti&&($.removeClass(t.highlightAnti,"highlight-anti"),t.highlightAnti=null),e&&(e.style.cursor=""),(a=$.id("quote-preview"))&&document.body.removeChild(a)},QuotePreview.stopMedia=function(e){var t,a;if((a=$.tag("VIDEO",e))[0])for(t=0;e=a[t];++t)e.autoplay=!1;if((a=$.tag("AUDIO",e))[0])for(t=0;e=a[t];++t)e.autoplay=!1};var ImageExpansion={activeVideos:[],timeout:null,pendingTarget:null};ImageExpansion.loadOgv=function(e){if(ImageExpansion.pendingTarget=e,$.id("js-ogv-scr"))return;let t=$.el("script");t.id="js-ogv-scr",t.onload=ImageExpansion.onOgvLoaded,t.src="https://s.4cdn.org/js/ogv/ogv.js",document.body.appendChild(t)},ImageExpansion.onOgvLoaded=function(){let e=ImageExpansion;e.pendingTarget&&e.expandWebm(e.pendingTarget)},ImageExpansion.expand=function(e){var t,a,i,n;return Config.imageHover&&ImageHover.hide(),(i=(a=(n=e.parentNode).getAttribute("href")).match(/\.(?:webm|mp4|pdf)$/))?(".webm"==i[0]||".mp4"==i[0])&&ImageExpansion.expandWebm(e):(Main.hasMobileLayout&&n.hasAttribute("data-m")&&(a=ImageExpansion.setMobileSrc(n)),e.setAttribute("data-expanding","1"),(t=document.createElement("img")).alt="Image",t.setAttribute("src",a),t.className="expanded-thumb",t.style.display="none",t.onerror=this.onError,e.parentNode.insertBefore(t,e.nextElementSibling),UA.hasCORS?(e.style.opacity="0.75",this.timeout=this.checkLoadStart(t,e)):this.onLoadStart(t,e),!0)},ImageExpansion.contract=function(e){var t,a;clearTimeout(this.timeout),t=(a=e.parentNode).parentNode.parentNode,$.removeClass(a.parentNode,"image-expanded"),Config.centeredThreads&&($.removeClass(t.parentNode,"centre-exp"),t.parentNode.style.marginLeft=""),!Main.tid&&Config.threadHiding&&$.removeClass(a,"image-expanded-anti"),a.firstChild.style.display="",a.removeChild(e),t.offsetTopClose',a.parentNode.appendChild(t)):(i=e.parentNode.previousElementSibling,(t=document.createElement("span")).className="collapseWebm",t.innerHTML='-[Close]',i.appendChild(t)),$.addClass(a.parentNode,"image-expanded"),t.firstElementChild.addEventListener("click",r.collapseWebm,!1),!0},ImageExpansion.fitWebm=function(){var e,t,a,i,n,o,r,s,d,l,c;l=this,OgvCtrl.ogv?(c=l.parentNode,$.addClass(c,"ogv-loaded")):c=l,Config.centeredThreads&&(s=$.cls("opContainer")[0].offsetWidth,r=c.parentNode.parentNode.parentNode,$.addClass(r,"centre-exp")),o=l.getBoundingClientRect().left,a=document.documentElement.clientWidth-o,i=document.documentElement.clientHeight,Main.hasMobileLayout||(a-=25),e=l.videoWidth,t=l.videoHeight,e>a&&(n=a/e,e=a,t*=n),Config.fitToScreenExpansion&&t>i&&(n=i/t,t=i,e*=n),c.style.width=(0|e)+"px",c.style.height=(0|t)+"px",l!==c&&(l.style.width=c.style.width,l.style.height=c.style.height),Config.centeredThreads&&(o=c.getBoundingClientRect().left,(d=c.offsetWidth+2*o)>s?(o=Math.floor(($.docEl.clientWidth-d)/2))>0&&(r.style.marginLeft=o+"px"):$.removeClass(r,"centre-exp"))},ImageExpansion.onWebmPlay=function(){var e=ImageExpansion;e.activeVideos.length||document.addEventListener("scroll",e.onScroll,!1),e.activeVideos.push(this)},ImageExpansion.collapseWebm=function(e){var t,a,i;e.preventDefault(),this.removeEventListener("click",ImageExpansion.collapseWebm,!1),t=this.parentNode,$.removeClass(t.parentNode,"image-expanded"),(a=Main.hasMobileLayout?t.previousElementSibling:t.parentNode.parentNode.getElementsByClassName("expandedWebm")[0]).classList.contains("ogv-cnt")?a.classList.contains("ogv-detached")||(a.firstElementChild.stop(),OgvCtrl.detach()):a.pause(),Config.centeredThreads&&(i=a.parentNode.parentNode.parentNode,$.removeClass(i,"centre-exp"),i.style.marginLeft=""),a.previousElementSibling.style.display="",a.parentNode.removeChild(a),t.parentNode.removeChild(t)},ImageExpansion.detachOgv=function(e){let t=e.parentNode;t.style.width=e.style.width,t.style.height=e.style.height,t.classList.add("ogv-detached"),e.remove()},ImageExpansion.onScroll=function(){clearTimeout(ImageExpansion.timeout),ImageExpansion.timeout=setTimeout(ImageExpansion.pauseVideos,500)},ImageExpansion.pauseVideos=function(){var e,t,a,i,n,o,r;for(e=ImageExpansion,r=[],n=window.pageYOffset,o=window.pageYOffset+$.docEl.clientHeight,t=0;a=e.activeVideos[t];++t)(i=a.getBoundingClientRect()).top+window.pageYOffset>o||i.bottom+window.pageYOffsetn&&(r=n/a,a=n,i*=r),Config.fitToScreenExpansion&&i>o&&(r=o/i,i=o,a*=r),e.style.maxWidth=a+"px",e.style.maxHeight=i+"px",$.addClass(d,"image-expanded"),!Main.tid&&Config.threadHiding&&$.addClass(t.parentNode,"image-expanded-anti"),e.style.display="",t.style.display="none",Config.centeredThreads?(s=e.getBoundingClientRect().left,(p=e.offsetWidth+2*s)>c?(s=Math.floor(($.docEl.clientWidth-p)/2))>0&&(l.style.marginLeft=s+"px"):$.removeClass(l,"centre-exp")):Main.hasMobileLayout&&((l=t.parentNode.lastElementChild).firstElementChild||((d=document.createElement("div")).className="mFileName",(h=t.parentNode.parentNode.getElementsByClassName("fileText")[0])&&(h=h.firstElementChild,d.innerHTML=h.getAttribute("title")||h.innerHTML),l.insertBefore(d,l.firstChild)))},ImageExpansion.checkLoadStart=function(e,t){if(!e.naturalWidth)return setTimeout(ImageExpansion.checkLoadStart,15,e,t);ImageExpansion.onLoadStart(e,t),t.style.opacity=""};var ImageHover={};ImageHover.show=function(e){var t,a,i;(i=(a="A"!==e.nodeName?e.parentNode.getAttribute("href"):e.getAttribute("href")).match(/\.(?:webm|mp4|pdf)$/))?".webm"!=i[0]&&".mp4"!=i[0]||ImageHover.showWebm(e):((t=document.createElement("img")).id="image-hover",t.alt="Image",t.onerror=ImageHover.onLoadError,t.src=a,Config.imageHoverBg&&(t.style.backgroundColor="inherit"),document.body.appendChild(t),UA.hasCORS?(t.style.display="none",this.timeout=ImageHover.checkLoadStart(t,e)):t.style.left=e.getBoundingClientRect().right+10+"px")},ImageHover.hide=function(){var e;clearTimeout(this.timeout),(e=$.id("image-hover"))&&(e.play&&(e.pause(),Tip.hide()),document.body.removeChild(e))},ImageHover.showWebm=function(e){var t;(t=document.createElement("video")).id="image-hover",Config.imageHoverBg&&(t.style.backgroundColor="inherit"),"A"!==e.nodeName?t.src=e.parentNode.getAttribute("href"):t.src=e.getAttribute("href"),t.loop=!0,t.muted=!Config.unmuteWebm,t.autoplay=!0,t.onerror=ImageHover.onLoadError,t.onloadedmetadata=function(){ImageHover.showWebMDuration(this,e)},t.onvolumechange=Main.getWebmVolumeChangeCb(),document.body.appendChild(t),Config.unmuteWebm&&(t.volume=Main.getWebmVolume())},ImageHover.showWebMDuration=function(e,t){var a,i,n;if(e.parentNode){var o,r=$.prettySeconds(e.duration);o=!0===e.mozHasAudio||e.webkitAudioDecodedByteCount>0||e.audioTracks&&e.audioTracks.length?" (audio)":"",n=t.getBoundingClientRect(),[a,i]=$.fit(e.videoWidth,e.videoHeight,window.innerWidth-n.right-20,window.innerHeight),e.style.width=a+"px",e.style.height=i+"px",Tip.show(t,r[0]+":"+("0"+r[1]).slice(-2)+o)}},ImageHover.onLoadError=function(){Feedback.error("File no longer exists (404).",2e3)},ImageHover.onLoadStart=function(e,t){var a,i;a=t.getBoundingClientRect(),i=window.innerWidth-a.right-20,e.naturalWidth>i&&(e.style.maxWidth=i+"px"),e.style.display=""},ImageHover.checkLoadStart=function(e,t){if(!e.naturalWidth)return setTimeout(ImageHover.checkLoadStart,15,e,t);ImageHover.onLoadStart(e,t)};var QR={};QR.init=function(){var e;if(UA.hasFormData){this.enabled=!!document.forms.post,this.currentTid=null,this.cooldown=null,this.timestamp=null,this.auto=!1,this.btn=null,this.comField=null,this.comLength=window.comlen,this.comCheckTimeout=null,this.cdElapsed=0,this.activeDelay=0,this.ctTTL=290,this.ctTimeout=null,this.cooldowns={};for(e in window.cooldowns)this.cooldowns[e]=1e3*window.cooldowns[e];if(this.noCaptcha)for(e in this.cooldowns)this.cooldowns[e]=Math.ceil(this.cooldowns[e]/2);this.painterTime=0,this.painterData=null,this.painterSrc=null,this.replayBlob=null,this.canvasLoading=!1,this.captchaWidgetCnt=null,this.captchaWidgetId=null,this.pulse=null,this.xhr=null,this.fileDisabled=!!window.imagelimit,this.tracked={},!Main.tid||Main.hasMobileLayout||Main.threadClosed||QR.addReplyLink(),window.addEventListener("storage",this.syncStorage,!1)}},QR.openTeXPreview=function(){var e;QR.closeTeXPreview(),window.MathJax||window.loadMathJax(),(e=document.createElement("div")).id="tex-preview-cnt",e.className="UIPanel",e.setAttribute("data-cmd","close-tex-preview"),e.innerHTML='
PreviewClose
Use [math][/math] tags for inline, and [eqn][/eqn] tags for block equations.
',document.body.appendChild(e),e=$.id("input-tex-preview"),$.on(e,"keyup",QR.onTeXChanged)},QR.closeTeXPreview=function(){var e;(e=$.id("input-tex-preview"))&&($.off(e,"keyup",QR.onTeXChanged),(e=$.id("tex-preview-cnt")).parentNode.removeChild(e))},QR.onTeXChanged=function(){clearTimeout(QR.timeoutTeX),QR.timeoutTeX=setTimeout(QR.processTeX,50)},QR.processTeX=function(){var e,t;!QR.processingTeX&&window.MathJax&&(e=$.id("input-tex-preview"))&&((t=$.id("output-tex-preview")).textContent=e.value,QR.processingTeX=!0,MathJax.Hub.Queue(["Typeset",MathJax.Hub,t],["onTeXReady",QR]))},QR.onTeXReady=function(){QR.processingTeX=!1},QR.validateCT=function(){var e,t;QR.captchaWidgetCnt&&((e=Main.getCookie("_ct"))?QR.ctTimeout||(e=e.split(".")[1],(t=(0|Date.now()/1e3)-e)>=QR.ctTTL?QR.setCTTag():QR.setCTTag(QR.ctTTL-t)):QR.ctTimeout&&QR.setCTTag())},QR.setCTTag=function(e){if(!window.t_captcha){var t=QR.captchaWidgetCnt;QR.clearCTTimeout(),e&&e>0?(QR.ctTimeout=setTimeout(QR.setCTTag,1e3*e),t.style.opacity="0.25",$.on(t,"mouseover",QR.onCTMouseOver),$.on(t,"mouseout",QR.onCTMouseOut)):(t.style.opacity="",$.off(t,"mouseover",QR.onCTMouseOver),$.off(t,"mouseout",QR.onCTMouseOut))}},QR.onCTMouseOver=function(){QR.onCTMouseOut(),QR.ctTipTimeout=setTimeout(Tip.show,Tip.delay,QR.captchaWidgetCnt,"Verification not required for your next post.")},QR.onCTMouseOut=function(){clearTimeout(QR.ctTipTimeout),Tip.hide()},QR.clearCTTimeout=function(){clearTimeout(QR.ctTimeout),QR.ctTimeout=null},QR.addReplyLink=function(){var e,t;e=$.cls("navLinks")[2],(t=document.createElement("div")).className="open-qr-wrap",t.innerHTML='[Post a Reply]',e.insertBefore(t,e.firstChild)},QR.lock=function(){QR.showPostError("This thread is closed.","closed",!0)},QR.unlock=function(){QR.hidePostError("closed")},QR.syncStorage=function(e){var t;e.key&&"4chan"==(t=e.key.split("-"))[0]&&"cd"==t[1]&&e.newValue&&Main.board==t[2]&&QR.startCooldown()},QR.onOpenInPainterClick=function(e){var t,a,i,n;if(QR.canvasLoading)Feedback.error("An image is already being loaded.");else{if(n=+e.getAttribute("data-pid"),i=+e.getAttribute("data-tid"),!n||!i)return!1;if(!(a=$.qs("#f"+n+' a[class="fileThumb"]')))return!1;if(!1===/\.(png|jpg)$/.test(a.href))return!1;QR.canvasLoading=!0,(t=new Image).crossOrigin="Anonymous",t.onload=QR.onPainterCanvasLoaded,t.onerror=QR.onPainterCanvasError,t._pid=n,Feedback.notify("Loading\u2026",0),t.src=a.href.replace("is2.4chan.org","i.4cdn.org"),QR.show(i)}},QR.onPainterCanvasError=function(){QR.canvasLoading=!1,Feedback.error("Couldn't load the image.",5e3)},QR.onPainterCanvasLoaded=function(){Feedback.hideMessage(),QR.canvasLoading=!1,QR.currentTid&&(this.naturalWidth<1||this.naturalHeight<1||(Tegaki.startTimeStamp&&Tegaki.destroy(),Keybinds.enabled=!1,QR.painterSrc=this._pid,Tegaki.open({onDone:QR.onPainterDone,onCancel:QR.onPainterCancel,saveReplay:!1,width:1,height:1}),Tegaki.onOpenImageLoaded.call(this)))},QR.openPainter=function(){var e,t,a,i;e=+(a=$.tag("input",$.id("qr-painter-ctrl")))[0].value,t=+a[1].value,e<1||t<1||(i=$.cls("oe-r-cb",$.id("qr-painter-ctrl"))[0],Keybinds.enabled=!1,window.Tegaki.open({onDone:QR.onPainterDone,onCancel:QR.onPainterCancel,saveReplay:i&&i.checked,width:e,height:t}))},QR.onPainterDone=function(){var e,t;Keybinds.enabled=!0,QR.painterData=Tegaki.flatten().toDataURL("image/png"),Tegaki.saveReplay&&(QR.replayBlob=Tegaki.replayRecorder.toBlob()),QR.painterTime=0,Tegaki.startTimeStamp&&(Tegaki.hasCustomCanvas&&!QR.painterSrc||(QR.painterTime=Math.round((Date.now()-Tegaki.startTimeStamp)/1e3))),(e=$.id("qrFile"))&&(e.style.visibility="hidden"),t=$.id("qr-painter-ctrl"),(e=$.tag("button",t)[0])&&(e.textContent="Edit"),(e=$.tag("button",t)[1])&&(e.disabled=!1);for(e of $.tag("input",t))e.disabled=!0},QR.onPainterCancel=function(){var e,t;Keybinds.enabled=!0,QR.painterData=null,QR.painterSrc=null,QR.replayBlob=null,QR.painterTime=0,(e=$.id("qrFile"))&&(e.style.visibility=""),t=$.id("qr-painter-ctrl"),(e=$.tag("button",t)[0])&&(e.textContent="Draw"),(e=$.tag("button",t)[1])&&(e.disabled=!0);for(e of $.tag("input",t))e.disabled=!1},QR.quotePost=function(e,t){QR.noCooldown||!(Main.threadClosed||!Main.tid&&Main.isThreadClosed(e))?(QR.show(e),QR.addQuote(t)):alert("This thread is closed")},QR.addQuote=function(e){var t,a,i,n;a=(n=$.tag("textarea",document.forms.qrPost)[0]).selectionStart,i=UA.getSelection(),t=e?">>"+e+"\n":"",i&&(t+=">"+i.trim().replace(/[\r\n]+/g,"\n>")+"\n"),n.value?n.value=n.value.slice(0,a)+t+n.value.slice(n.selectionEnd):n.value=t,UA.isOpera&&(a+=t.split("\n").length),n.selectionStart=n.selectionEnd=a+t.length,n.selectionStart==n.value.length&&(n.scrollTop=n.scrollHeight),n.focus()},QR.show=function(e){var t,a,i,n,o,r,s,d,l,c,p,h,u,g,m,f;if(window.checkIncognito&&window.checkIncognito(),QR.currentTid)return Main.tid||QR.currentTid==e||($.id("qrTid").textContent=$.id("qrResto").value=QR.currentTid=e,$.byName("com")[1].value="",QR.startCooldown()),void(Main.hasMobileLayout&&($.id("quickReply").style.top=window.pageYOffset+25+"px"));for(QR.currentTid=e,n=$.id("postForm"),(i=document.createElement("div")).id="quickReply",i.className="extPanel reply",i.setAttribute("data-trackpos","QR-position"),Main.hasMobileLayout?i.style.top=window.pageYOffset+28+"px":Config["QR-position"]?i.style.cssText=Config["QR-position"]:(i.style.right="0px",i.style.top="10%"),i.innerHTML='
'+(window.math_tags?'':"")+'Reply to Thread No.'+e+'X
',(o=n.parentNode.cloneNode(!1)).setAttribute("name","qrPost"),o.innerHTML=((f=$.byName("MAX_FILE_SIZE")[0])?'':"")+'',(r=document.createElement("div")).id="qrForm",this.btn=null,t=0,a=(s=n.firstElementChild.children).length-1;t label > input[name="spoiler"]',n))&&((l=document.createElement("span")).id="qrSpoiler",l.innerHTML='',c.parentNode.insertBefore(l,c.nextSibling)),o.appendChild(r),i.appendChild(o),(g=document.createElement("div")).id="qrError",i.appendChild(g),i.addEventListener("click",QR.onClick,!1),document.body.appendChild(i),QR.startCooldown(),Main.threadClosed&&QR.lock(),window.passEnabled||QR.renderCaptcha(),Main.hasMobileLayout||Draggable.set($.id("qrHeader"))},QR.renderCaptcha=function(){if(window.grecaptcha)return QR.captchaWidgetId=grecaptcha.render(QR.captchaWidgetCnt,{sitekey:window.recaptchaKey,theme:"tomorrow"===Main.stylesheet||window.dark_captcha?"dark":"light"}),void QR.validateCT();window.t_captcha&&(TCaptcha.init(QR.captchaWidgetCnt,Main.board,QR.currentTid),TCaptcha.setErrorCb(QR.showPostError))},QR.resetCaptcha=function(){window.grecaptcha?null!==QR.captchaWidgetId&&(grecaptcha.reset(QR.captchaWidgetId),QR.validateCT()):window.t_captcha&&TCaptcha.clearChallenge()},QR.onPassError=function(){var e,t;QR.captchaWidgetCnt||(window.passEnabled=QR.noCaptcha=!1,(e=document.createElement("div")).id="qrCaptchaContainer",(t=$.id("qrForm")).insertBefore(e,t.lastElementChild),QR.captchaWidgetCnt=e,QR.renderCaptcha())},QR.onFileChange=function(){var e,t;this.value?(t=window.maxFilesize,this.files?(e=this.files[0].size,"video/webm"==this.files[0].type&&window.maxWebmFilesize&&(t=window.maxWebmFilesize)):e=0,QR.fileDisabled?QR.showPostError("Image limit reached.","imagelimit",!0):e>t?QR.showPostError("Error: Maximum file size allowed is "+Math.floor(t/1048576)+" MB","filesize",!0):QR.hidePostError()):QR.hidePostError(),QR.painterData=null,QR.replayBlob=null,QR.startCooldown()},QR.onKeyDown=function(e){var t,a,i,n ;if(e.ctrlKey&&83==e.keyCode)e.stopPropagation(),e.preventDefault(),a=(t=e.target).selectionStart,i=t.selectionEnd,t.value?(n="[spoiler]"+t.value.slice(a,i)+"[/spoiler]",t.value=t.value.slice(0,a)+n+t.value.slice(i),t.setSelectionRange(i+19,i+19)):(t.value="[spoiler][/spoiler]",t.setSelectionRange(9,9));else if(!(27!=e.keyCode||e.ctrlKey||e.altKey||e.shiftKey||e.metaKey))return void QR.close();clearTimeout(QR.comCheckTimeout),QR.comCheckTimeout=setTimeout(QR.checkCommentField,500)},QR.checkCommentField=function(){var e;QR.comLength&&((e=encodeURIComponent(QR.comField.value).split(/%..|./).length-1)>QR.comLength?QR.showPostError("Error: Comment too long ("+e+"/"+QR.comLength+").","length",!0):QR.hidePostError("length")),window.sjis_tags&&(/\[sjis\]/.test(QR.comField.value)?$.hasClass(QR.comField,"sjis")||$.addClass(QR.comField,"sjis"):$.hasClass(QR.comField,"sjis")&&$.removeClass(QR.comField,"sjis"))},QR.close=function(){var e,t=$.id("quickReply");QR.comField=null,QR.currentTid=null,QR.painterTime=0,QR.painterData=null,QR.painterSrc=null,QR.replayBlob=null,QR.canvasLoading=!1,clearInterval(QR.pulse),QR.xhr&&(QR.xhr.abort(),QR.xhr=null),t.removeEventListener("click",QR.onClick,!1),(e=$.id("qrFile"))&&e.removeEventListener("change",QR.startCooldown,!1),(e=$.id("qrEmail"))&&e.removeEventListener("change",QR.startCooldown,!1),$.tag("textarea",t)[0].removeEventListener("keydown",QR.onKeyDown,!1),Draggable.unset($.id("qrHeader")),QR.noCaptcha||QR.setCTTag(),window.t_captcha&&TCaptcha.node===QR.captchaWidgetCnt&&TCaptcha.destroy(),document.body.removeChild(t)},QR.onClick=function(e){var t=e.target;if("submit"==t.type)e.preventDefault(),QR.submit(e.shiftKey);else switch(t.id){case"qrFile":e.shiftKey&&(e.preventDefault(),QR.resetFile());break;case"qrDummyFile":case"qrDummyFileButton":case"qrDummyFileLabel":e.preventDefault(),e.shiftKey?QR.resetFile():$.id("qrFile").click();break;case"qrClose":QR.close()}},QR.showPostError=function(e,t,a){var i;(i=$.id("qrError"))&&(e?(i.innerHTML=e,i.style.display="block",i.setAttribute("data-type",t||""),!a&&(document.hidden||document.mozHidden||document.webkitHidden||document.msHidden)&&alert("Posting Error")):QR.hidePostError())},QR.hidePostError=function(e){var t=$.id("qrError");t.hasAttribute("style")&&(e&&t.getAttribute("data-type")!=e||t.removeAttribute("style"))},QR.resetFile=function(){var e,t;QR.painterData=null,QR.replayBlob=null,(t=document.createElement("input")).id="qrFile",t.type="file",t.size="19",t.name="upfile",t.addEventListener("change",QR.onFileChange,!1),(e=$.id("qrFile")).removeEventListener("change",QR.onFileChange,!1),e.parentNode.replaceChild(t,e),QR.hidePostError("imagelimit"),QR.needPreuploadCaptcha=!1,QR.startCooldown()},QR.submit=function(e){var t;QR.hidePostError(),QR.presubmitChecks(e)&&(QR.auto=!1,QR.xhr=new XMLHttpRequest,QR.xhr.open("POST",document.forms.qrPost.action,!0),QR.xhr.withCredentials=!0,QR.xhr.setRequestHeader("Accept","application/json"),QR.xhr.upload.onprogress=function(e){e.loaded>=e.total?QR.btn.value="100%":QR.btn.value=(0|e.loaded/e.total*100)+"%"},QR.xhr.onerror=function(){QR.xhr=null,QR.showPostError("Connection error.")},QR.xhr.onload=function(){var e,t,a,i,n,o,r;if(QR.xhr=null,QR.btn.value="Post",200==this.status){if("application/json"==this.getResponseHeader("Content-Type")){try{e=JSON.parse(this.responseText)}catch(s){console.log("QR resp",s),e={error:"Something went wrong."}}if(e.error)return window.passEnabled&&/4chan Pass/.test(e.error)?QR.onPassError():QR.resetCaptcha(),void QR.showPostError(e.error);e.pid&&(n=e.tid,o=e.pid)}else{if(e=this.responseText.match(/"errmsg"[^>]*>(.*?)<\/span/))return window.passEnabled&&/4chan Pass/.test(e)?QR.onPassError():QR.resetCaptcha(),void QR.showPostError(e[1]);(i=this.responseText.match(//))&&(n=i[1],o=i[2])}o&&(a=(t=$.id("qrFile"))&&t.value,QR.setPostTime(),Config.persistentQR?($.byName("com")[1].value="",(t=$.byName("spoiler")[2])&&(t.checked=!1),QR.resetCaptcha(),(a||QR.painterData)&&QR.resetFile(),QR.startCooldown()):QR.close(),Main.tid?(Config.threadWatcher&&ThreadWatcher.setLastRead(o,n),QR.lastReplyId=+o,Parser.trackedReplies[">>"+o]=1,Parser.saveTrackedReplies(n,Parser.trackedReplies)):((r=Parser.getTrackedReplies(Main.board,n)||{})[">>"+o]=1,Parser.saveTrackedReplies(n,r)),Parser.touchTrackedReplies(n),UA.dispatchEvent("4chanQRPostSuccess",{threadId:n,postId:o})),ThreadUpdater.enabled&&setTimeout(ThreadUpdater.forceUpdate,500)}else QR.showPostError("Error: "+this.status+" "+this.statusText)},!(t=new FormData(document.forms.qrPost)).entries||!t["delete"]||t.get("upfile")&&t.get("upfile").size||t["delete"]("upfile"),QR.painterData&&(QR.appendPainter(t),QR.replayBlob&&t.append("oe_replay",QR.replayBlob,"tegaki.tgkr"),t.append("oe_time",QR.painterTime),QR.painterSrc&&t.append("oe_src",QR.painterSrc)),clearInterval(QR.pulse),QR.btn.value="Sending",QR.xhr.send(t))},QR.appendPainter=function(e){var t;if(t=QR.b64toBlob(QR.painterData.slice(QR.painterData.indexOf(",")+1))){if(t.size>window.maxFilesize)return void QR.showPostError("Error: Maximum file size allowed is "+Math.floor(window.maxFilesize/1048576)+" MB","filesize",!0);e.append("upfile",t,"tegaki.png")}},QR.b64toBlob=function(e){var t,a,i,n,o;for(o=(a=atob(e)).length,i=new Array(o),t=0;tThe File field has been cleared."),QR.resetFile(),!1}return!0},QR.getCooldown=function(e){return QR.cooldowns[e]},QR.setPostTime=function(){return localStorage.setItem("4chan-cd-"+Main.board,Date.now())},QR.getPostTime=function(){return localStorage.getItem("4chan-cd-"+Main.board)},QR.removePostTime=function(){return localStorage.removeItem("4chan-cd-"+Main.board)},QR.startCooldown=function(){var e,t,a;if(!QR.noCooldown&&$.id("quickReply")&&!QR.xhr)if(clearInterval(QR.pulse),e=(t=$.id("qrFile"))&&t.value?"image":"reply",a=QR.getPostTime(e)){if(QR.timestamp=parseInt(a,10),QR.activeDelay=QR.getCooldown(e),QR.cdElapsed=Date.now()-QR.timestamp,QR.cooldown=Math.ceil((QR.activeDelay-QR.cdElapsed)/1e3),QR.cooldown<=0||QR.cdElapsed<0)return QR.cooldown=!1,void(QR.btn.value="Post");QR.btn.value=QR.cooldown+"s",QR.pulse=setInterval(QR.onPulse,1e3)}else QR.btn.value="Post"},QR.onPulse=function(){QR.cdElapsed=Date.now()-QR.timestamp,QR.cooldown=Math.ceil((QR.activeDelay-QR.cdElapsed)/1e3),QR.cooldown<=0?(clearInterval(QR.pulse),QR.btn.value="Post",QR.cooldown=!1,QR.auto&&QR.submit()):QR.btn.value=QR.cooldown+(QR.auto?"s (auto)":"s")};var ThreadHiding={};ThreadHiding.init=function(){this.threshold=432e5,this.hidden={},this.load(),this.purge()},ThreadHiding.clear=function(e){var t,a,i,n;this.load(),t=0;for(a in this.hidden)++t;if(i="4chan-hide-t-"+Main.board,e)localStorage.removeItem(i);else{if(!t)return void alert("You don't have any hidden threads on /"+Main.board+"/");if(n="This will unhide "+t+" thread"+(t>1?"s":"")+" on /"+Main.board+"/",!confirm(n))return;localStorage.removeItem(i)}},ThreadHiding.isHidden=function(e){return!!ThreadHiding.hidden[e]},ThreadHiding.toggle=function(e){this.isHidden(e)?this.show(e):this.hide(e),this.save()},ThreadHiding.show=function(e){var t,a;a=$.id("t"+e),t=$.id("sa"+e),Main.hasMobileLayout?(t.parentNode.removeChild(t),a.style.display=null,$.removeClass(a.nextElementSibling,"mobile-hr-hidden")):(t.removeAttribute("data-hidden"),t.firstChild.src=Main.icons.minus,$.removeClass(a,"post-hidden")),delete this.hidden[e]},ThreadHiding.hide=function(e){var t,a;a=$.id("t"+e),Main.hasMobileLayout?(a.style.display="none",$.addClass(a.nextElementSibling,"mobile-hr-hidden"),(t=document.createElement("span")).id="sa"+e,t.setAttribute("data-cmd","hide"),t.setAttribute("data-id",e),t.textContent="Show Hidden Thread",t.className="mobileHideButton button mobile-tu-show",a.parentNode.insertBefore(t,a)):Config.hideStubs&&!$.cls("stickyIcon",a)[0]?a.style.display=a.nextElementSibling.style.display="none":((t=$.id("sa"+e)).setAttribute("data-hidden",e),t.firstChild.src=Main.icons.plus,a.className+=" post-hidden"),this.hidden[e]=Date.now()},ThreadHiding.load=function(){var e;(e=localStorage.getItem("4chan-hide-t-"+Main.board))&&(this.hidden=JSON.parse(e))},ThreadHiding.purge=function(){var e,t,a,i;i="4chan-purge-t-"+Main.board,a=localStorage.getItem(i);for(e in this.hidden){t=!0;break}t&&(!a||a