aboutsummaryrefslogtreecommitdiff
path: root/dist/client.b.js
diff options
context:
space:
mode:
authoroldmud0 <oldmud0@users.noreply.github.com>2019-07-01 22:58:47 -0500
committeroldmud0 <oldmud0@users.noreply.github.com>2019-07-01 22:58:47 -0500
commit1ff53d9aed85aa31aafcbb72a00fc5f7eb761374 (patch)
treeefe66c3055abdef75376e0bde3aaeb55cc850bcd /dist/client.b.js
parent393142f7001269140897a8ca191884e8c29bb699 (diff)
Ugh! It lives!
Diffstat (limited to 'dist/client.b.js')
-rw-r--r--dist/client.b.js2
1 files changed, 0 insertions, 2 deletions
diff --git a/dist/client.b.js b/dist/client.b.js
deleted file mode 100644
index 2e4b151..0000000
--- a/dist/client.b.js
+++ /dev/null
@@ -1,2 +0,0 @@
-!function(e){var t={};function n(i){if(t[i])return t[i].exports;var o=t[i]={i:i,l:!1,exports:{}};return e[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(i,o,function(t){return e[t]}.bind(null,o));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=3)}({3:function(e,t,n){"use strict";n.r(t);var i=["Anime","birthday","Christmas","CountyCourt","CruiseCourt","default","DGDEnglishCourt","DGSJapanCourt","DualDestinies","EnglishCourt","gs4","GS4Night","HD","Khura'in","mlp","NewCourt","RuinedCourt","Sky","SpaceCourt","Themis","TouhouCourt","WitchTrialCourt","Zetta"],o=["1.png","2.png","3.png","4.png","5.png","6.png","empty.png","lawyerbadge.png"];function c(e){return(c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var a=function e(t){var n,i;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),n=Array.prototype.forEach,i=Array.prototype.map,this.each=function(e,t,i){if(null!==e)if(n&&e.forEach===n)e.forEach(t,i);else if(e.length===+e.length){for(var o=0,c=e.length;o<c;o++)if(t.call(i,e[o],o,e)==={})return}else for(var a in e)if(e.hasOwnProperty(a)&&t.call(i,e[a],a,e)==={})return},this.map=function(e,t,n){var o=[];return null==e?o:i&&e.map===i?e.map(t,n):(this.each(e,function(e,i,c){o[o.length]=t.call(n,e,i,c)}),o)},"object"==c(t)?(this.hasher=t.hasher,this.screen_resolution=t.screen_resolution,this.screen_orientation=t.screen_orientation,this.canvas=t.canvas,this.ie_activex=t.ie_activex):"function"==typeof t&&(this.hasher=t)};a.prototype={get:function(){var e=[];(e.push(navigator.userAgent),e.push(navigator.language),e.push(screen.colorDepth),this.screen_resolution)&&(void 0!==this.getScreenResolution()&&e.push(this.getScreenResolution().join("x")));return e.push((new Date).getTimezoneOffset()),e.push(this.hasSessionStorage()),e.push(this.hasLocalStorage()),e.push(!!window.indexedDB),document.body?e.push(c(document.body.addBehavior)):e.push("undefined"),e.push(c(window.openDatabase)),e.push(navigator.cpuClass),e.push(navigator.platform),e.push(navigator.doNotTrack),e.push(this.getPluginsString()),this.canvas&&this.isCanvasSupported()&&e.push(this.getCanvasFingerprint()),this.hasher?this.hasher(e.join("###"),31):this.murmurhash3_32_gc(e.join("###"),31)},murmurhash3_32_gc:function(e,t){var n,i,o,c,a,s,r,l;for(n=3&e.length,i=e.length-n,o=t,a=3432918353,s=461845907,l=0;l<i;)r=255&e.charCodeAt(l)|(255&e.charCodeAt(++l))<<8|(255&e.charCodeAt(++l))<<16|(255&e.charCodeAt(++l))<<24,++l,o=27492+(65535&(c=5*(65535&(o=(o^=r=(65535&(r=(r=(65535&r)*a+(((r>>>16)*a&65535)<<16)&4294967295)<<15|r>>>17))*s+(((r>>>16)*s&65535)<<16)&4294967295)<<13|o>>>19))+((5*(o>>>16)&65535)<<16)&4294967295))+((58964+(c>>>16)&65535)<<16);switch(r=0,n){case 3:r^=(255&e.charCodeAt(l+2))<<16;case 2:r^=(255&e.charCodeAt(l+1))<<8;case 1:o^=r=(65535&(r=(r=(65535&(r^=255&e.charCodeAt(l)))*a+(((r>>>16)*a&65535)<<16)&4294967295)<<15|r>>>17))*s+(((r>>>16)*s&65535)<<16)&4294967295}return o^=e.length,o=2246822507*(65535&(o^=o>>>16))+((2246822507*(o>>>16)&65535)<<16)&4294967295,o=3266489909*(65535&(o^=o>>>13))+((3266489909*(o>>>16)&65535)<<16)&4294967295,(o^=o>>>16)>>>0},hasLocalStorage:function(){try{return!!window.localStorage}catch(e){return!0}},hasSessionStorage:function(){try{return!!window.sessionStorage}catch(e){return!0}},isCanvasSupported:function(){var e=document.createElement("canvas");return!(!e.getContext||!e.getContext("2d"))},isIE:function(){return"Microsoft Internet Explorer"===navigator.appName||!("Netscape"!==navigator.appName||!/Trident/.test(navigator.userAgent))},getPluginsString:function(){return this.isIE()&&this.ie_activex?this.getIEPluginsString():this.getRegularPluginsString()},getRegularPluginsString:function(){return this.map(navigator.plugins,function(e){var t=this.map(e,function(e){return[e.type,e.suffixes].join("~")}).join(",");return[e.name,e.description,t].join("::")},this).join(";")},getIEPluginsString:function(){if(window.ActiveXObject){return this.map(["ShockwaveFlash.ShockwaveFlash","AcroPDF.PDF","PDF.PdfCtrl","QuickTime.QuickTime","rmocx.RealPlayer G2 Control","rmocx.RealPlayer G2 Control.1","RealPlayer.RealPlayer(tm) ActiveX Control (32-bit)","RealVideo.RealVideo(tm) ActiveX Control (32-bit)","RealPlayer","SWCtl.SWCtl","WMPlayer.OCX","AgControl.AgControl","Skype.Detection"],function(e){try{return new ActiveXObject(e),e}catch(e){return null}}).join(";")}return""},getScreenResolution:function(){return this.screen_orientation?screen.height>screen.width?[screen.height,screen.width]:[screen.width,screen.height]:[screen.height,screen.width]},getCanvasFingerprint:function(){var e=document.createElement("canvas"),t=e.getContext("2d"),n='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz!@#$%^&*()_+-={}|[]:"<>?;,.';return t.textBaseline="top",t.font="14px 'Arial'",t.textBaseline="alphabetic",t.fillStyle="#f60",t.fillRect(125,1,62,20),t.fillStyle="#069",t.fillText(n,2,15),t.fillStyle="rgba(102, 204, 0, 0.7)",t.fillText(n,4,17),e.toDataURL()}};function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function l(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}n.d(t,"onOOCEnter",function(){return C}),n.d(t,"onEnter",function(){return B}),n.d(t,"musiclist_click",function(){return k}),n.d(t,"area_click",function(){return x}),n.d(t,"changeMusicVolume",function(){return T}),n.d(t,"changeSFXVolume",function(){return S}),n.d(t,"changeBlipVolume",function(){return L}),n.d(t,"changeCharacter",function(){return O}),n.d(t,"imgError",function(){return P}),n.d(t,"demoError",function(){return M}),n.d(t,"ReconnectButton",function(){return R}),n.d(t,"RetryButton",function(){return H}),n.d(t,"pickChar",function(){return F}),n.d(t,"pickEmotion",function(){return U}),n.d(t,"pickEvidence",function(){return Z}),n.d(t,"addEvidence",function(){return X}),n.d(t,"editEvidence",function(){return G}),n.d(t,"deleteEvidence",function(){return V}),n.d(t,"cancelEvidence",function(){return z}),n.d(t,"getIndexFromSelect",function(){return W}),n.d(t,"updateEvidenceIcon",function(){return q}),n.d(t,"updateActionCommands",function(){return K}),n.d(t,"changeBackgroundOOC",function(){return Q}),n.d(t,"changeRoleOOC",function(){return J}),n.d(t,"randomCharacterOOC",function(){return Y}),n.d(t,"callMod",function(){return ee}),n.d(t,"initWT",function(){return te}),n.d(t,"initCE",function(){return ne}),n.d(t,"addHPD",function(){return ie}),n.d(t,"redHPD",function(){return oe}),n.d(t,"addHPP",function(){return ce}),n.d(t,"redHPP",function(){return ae}),n.d(t,"updateBackgroundPreview",function(){return se}),n.d(t,"toggleEffect",function(){return re}),n.d(t,"toggleFlip",function(){return le}),n.d(t,"togglePresent",function(){return de}),n.d(t,"toggleMenu",function(){return ue}),n.d(t,"toggleShout",function(){return me});var d={};location.search.substr(1).split("&").forEach(function(e){d[e.split("=")[0]]=e.split("=")[1]});var u=d.ip,m=d.mode,h=d.asset||"http://s3.wasabisys.com/webao/base/",g=h+"sounds/music/",f=!1;/Android|webOS|iPhone|iPad|iPod|BlackBerry|BB|PlayBook|IEMobile|Windows Phone|Kindle|Silk|Opera Mini/i.test(navigator.userAgent)&&(f=!0);var p=0,y=1,v=0,E=new a({canvas:!0,ie_activex:!0,screen_resolution:!0}).get();console.log(E);var _=new Date(0),w=function(){function e(t){var n=this;s(this,e),this.serv=new WebSocket("ws://"+t),this.serv.onopen=function(e){return n.onOpen(e)},this.serv.onclose=function(e){return n.onClose(e)},this.serv.onmessage=function(e){return n.onMessage(e)},this.serv.onerror=function(e){return n.onError(e)},this.flip=!1,this.presentable=!1,this.hp=[0,0],this.playerID=1,this.charID=-1,this.testimonyID=0,this.chars=[],this.emotes=[],this.evidences=[],this.resources={holdit:{src:"misc/holdit.gif",duration:720},objection:{src:"misc/objection.gif",duration:720},takethat:{src:"misc/takethat.gif",duration:840},witnesstestimony:{src:"misc/witnesstestimony.gif",duration:1560,sfx:"sounds/general/sfx-testimony.wav"},crossexamination:{src:"misc/crossexamination.gif",duration:1600,sfx:"sounds/general/sfx-testimony2.wav"}},this.selectedEmote=-1,this.selectedEvidence=0,this.checkUpdater=null,this.musicList=Object(),this.handlers={MS:function(e){return n.handleMS(e)},CT:function(e){return n.handleCT(e)},MC:function(e){return n.handleMC(e)},RMC:function(e){return n.handleRMC(e)},CI:function(e){return n.handleCI(e)},SC:function(e){return n.handleSC(e)},EI:function(e){return n.handleEI(e)},LE:function(e){return n.handleLE(e)},EM:function(e){return n.handleEM(e)},SM:function(e){return n.handleSM(e)},BD:function(e){return n.handleBD(e)},music:function(e){return n.handlemusic(e)},DONE:function(e){return n.handleDONE(e)},BN:function(e){return n.handleBN(e)},NBG:function(e){return n.handleNBG(e)},HP:function(e){return n.handleHP(e)},RT:function(e){return n.handleRT(e)},ZZ:function(e){return n.handleZZ(e)},ID:function(e){return n.handleID(e)},PN:function(e){return n.handlePN(e)},SI:function(e){return n.handleSI(e)},CharsCheck:function(e){return n.handleCharsCheck(e)},PV:function(e){return n.handlePV(e)},CHECK:function(e){}},this._lastTimeICReceived=new Date(0)}return l(e,[{key:"me",value:function(){return this.chars[this.charID]}},{key:"myEmote",value:function(){return this.emotes[this.selectedEmote]}},{key:"myEvidence",value:function(){return this.presentable?this.selectedEvidence:0}},{key:"sendOOC",value:function(e){this.serv.send("CT#".concat(he(fe(document.getElementById("OOC_name").value)),"#").concat(he(fe(e)),"#%"))}},{key:"sendIC",value:function(e,t,n,i,o,c,a,s,r,l,d,u,m){this.serv.send("MS#chat#".concat(e,"#").concat(t,"#").concat(n)+"#".concat(he(fe(i)),"#").concat(o,"#").concat(c,"#").concat(a)+"#".concat(this.charID,"#").concat(s,"#").concat(v,"#").concat(l,"#").concat(d,"#").concat(u,"#").concat(m,"#%"))}},{key:"sendPE",value:function(e,t,n){this.serv.send("PE#".concat(he(fe(e)),"#").concat(he(fe(t)),"#").concat(n,"#%"))}},{key:"sendEE",value:function(e,t,n,i){this.serv.send("EE#".concat(e,"#").concat(he(fe(t)),"#").concat(he(fe(n)),"#").concat(i,"#%"))}},{key:"sendDE",value:function(e){this.serv.send("DE#".concat(e,"#%"))}},{key:"sendHP",value:function(e,t){this.serv.send("HP#".concat(e,"#").concat(t,"#%"))}},{key:"sendZZ",value:function(e){this.serv.send("ZZ#".concat(e,"#%"))}},{key:"sendRT",value:function(e){"jud"==this.chars[this.charID].side&&this.serv.send("RT#".concat(e,"#%"))}},{key:"sendMusicChange",value:function(e){this.serv.send("MC#".concat(e,"#").concat(this.charID,"#%"))}},{key:"sendLeaveRoom",value:function(){this.serv.send("FC#%")}},{key:"joinServer",value:function(){var e=this;this.serv.send("HI#".concat(E,"#%")),this.serv.send("ID#webAO#2.3#%"),this.checkUpdater=setInterval(function(){return e.sendCheck()},5e3)}},{key:"loadResources",value:function(){document.getElementById("OOC_name").value="web"+this.playerID;var e=document.getElementById("evi_select");e.add(new Option("Custom",0)),o.forEach(function(t){e.add(new Option(t))});var t=document.getElementById("bg_select");t.add(new Option("Custom",0)),i.forEach(function(e){t.add(new Option(e))});for(var n=["holdit","objection","takethat"],c=0;c<n.length;c++){D(h+this.resources[n[c]].src.toLowerCase(),this.callbackLoadImageResources,n[c])}for(var a=["witnesstestimony","crossexamination"],s=0;s<a.length;s++){D("".concat(h,"themes/default/").concat(a[s],".gif"),this.callbackLoadImageResources,a[s]),D(h+this.resources[a[s]].sfx.toLowerCase(),this.callbackLoadSFXResources,a[s])}}},{key:"callbackLoadImageResources",value:function(e,t,n){e&&(ye.resources[t].src=n,ve.getAnimLength(n,ye.callbackGetResourceLength,t))}},{key:"callbackGetResourceLength",value:function(e,t){ye.resources[t].duration=e}},{key:"callbackLoadSFXResources",value:function(e,t,n){e&&(ye.resources[t].sfx=n)}},{key:"initialObservBBCode",value:function(){var e=document.getElementById("client_inner_chat");new MutationObserver(function(e){e.forEach(function(e){var t=e.addedNodes;null!==t&&t.forEach(function(e){"C"==e.tagName?e.style.color=e.getAttribute("a"):"M"==e.tagName&&(e.hasAttribute("a")?e.style.backgroundColor=e.getAttribute("a"):(e.style.backgroundColor="yellow",e.style.color="black"))})})}).observe(e,{attributes:!0,childList:!0})}},{key:"sendCharacter",value:function(e){this.serv.send("CC#".concat(this.playerID,"#").concat(e,"#web#%"))}},{key:"sendMusic",value:function(e){this.serv.send("MC#".concat(e))}},{key:"sendCheck",value:function(){this.serv.send("CH#".concat(this.charID,"#%"))}},{key:"onOpen",value:function(e){"watch"===m?(document.getElementById("client_loading").style.display="none",document.getElementById("client_charselect").style.display="none"):ye.joinServer()}},{key:"onClose",value:function(e){console.error("The connection was closed: ".concat(e.reason," (").concat(e.code,")")),1001!==e.code&&(document.getElementById("client_error").style.display="block",document.getElementById("error_id").textContent=e.code,this.cleanup())}},{key:"onMessage",value:function(e){var t=e.data;console.debug(t);var n=t.split("%")[0].split("#"),i=n[0],o=this.handlers[i];void 0!==o?o(n):console.warn("Invalid packet header ".concat(i))}},{key:"onError",value:function(e){console.error("A network error occurred: ".concat(e.reason," (").concat(e.code,")")),document.getElementById("client_error").style.display="block",document.getElementById("error_id").textContent=e.code,this.cleanup()}},{key:"cleanup",value:function(){try{this.serv.close(1001)}catch(e){}clearInterval(this.checkUpdater)}},{key:"prepChat",value:function(e){return ge(pe(e)).replace(/\\n/g,"<br>").replace(/\[(\/?)b\]/g,"<$1b>").replace(/\[(\/?)i\]/g,"<$1i>").replace(/\[(\/?)s\]/g,"<$1del>").replace(/\[(\/?)u\]/g,"<$1u>").replace(/\[(\/?)sub\]/g,"<$1sub>").replace(/\[(\/?)sup\]/g,"<$1sup>").replace(/\[m=([#a-zA-Z0-9]+)\]/g,'<m a="$1">').replace(/\[(\/?)m\]/g,"<$1m>").replace(/\[c=?([#a-zA-Z0-9]+)\]/g,'<c a="$1">').replace(/\[\/c\]/g,"</c>")}},{key:"handleMS",value:function(e){if(e[4]!=ve.chatmsg.content){document.getElementById("client_inner_chat").innerHTML="";for(var t={character:-1,preanim:escape(e[2]),nameplate:e[3],name:e[3],speaking:"(b)"+escape(e[4]),silent:"(a)"+escape(e[4]),content:this.prepChat(e[5]),side:e[6],sound:escape(e[7]),type:e[8],snddelay:e[10],objection:e[11],evidence:e[12],flip:e[13],flash:e[14],color:e[15],isnew:!0},n=0;n<this.chars.length;n++)if(this.chars[n].name==e[3]){t.character=n;break}t.character==this.charID&&function(){document.getElementById("client_inputbox").value="",p&&(document.getElementById("button_effect_"+p).className="client_button",p=0);v&&(document.getElementById("button_"+v).className="client_button",v=0)}(),ve.say(t)}}},{key:"handleCT",value:function(e){var t=document.getElementById("client_ooclog");t.innerHTML+="".concat(pe(ge(e[1])),": ").concat(pe(ge(e[2])),"\r\n"),t.scrollTop>t.scrollHeight-600&&(t.scrollTop=t.scrollHeight)}},{key:"handleMC",value:function(e){var t=ve.music;if(t.pause(),t.src=g+e[1].toLowerCase(),t.play(),e[2]>=0){var n=this.chars[e[2]].name;j("".concat(n," changed music to ").concat(e[1]))}else j("The music was changed to ".concat(e[1]))}},{key:"handleRMC",value:function(e){ve.music.pause(),ve.music=new Audio(this.musicList[e[1]]);var t=ve.music;t.totime=e[1],t.offset=(new Date).getTime()/1e3,t.addEventListener("loadedmetadata",function(){t.currentTime+=parseFloat(t.totime+((new Date).getTime()/1e3-t.offset)).toFixed(3),t.play()},!1)}},{key:"handleCI",value:function(e){document.getElementById("client_loadingtext").innerHTML="Loading Character "+e[1],this.serv.send("AN#"+(e[1]/10+1)+"#%");for(var t=2;t<e.length-1;t++)if(t%2==0){var n=e[t].split("&");this.chars[e[t-1]]={name:n[0],desc:n[1],evidence:n[3],icon:h+"characters/"+escape(n[0].toLowerCase())+"/char_icon.png"}}}},{key:"handleSC",value:function(e){document.getElementById("client_loadingtext").innerHTML="Loading Characters";for(var t=1;t<e.length-1;t++){var n=e[t].split("&");this.chars[t-1]={name:n[0],desc:n[1],evidence:n[3],icon:h+"characters/"+escape(n[0].toLowerCase())+"/char_icon.png"}}this.serv.send("RM#%")}},{key:"handleEI",value:function(e){document.getElementById("client_loadingtext").innerHTML="Loading Evidence "+e[1],this.serv.send("RM#%")}},{key:"handleLE",value:function(e){this.evidences=[];for(var t=1;t<e.length-1;t++){var n=e[t].split("&");this.evidences[t-1]={name:pe(ge(n[0])),desc:pe(ge(n[1])),filename:escape(n[2]),icon:h+"evidence/"+escape(n[2].toLowerCase())}}var i=document.getElementById("evidences");i.innerHTML="";for(var o=1;o<=this.evidences.length;o++)i.innerHTML+='<img src="'.concat(this.evidences[o-1].icon,'" \n\t\t\t\tid="evi_').concat(o,'" \n\t\t\t\talt="').concat(this.evidences[o-1].name,'"\n\t\t\t\tclass="client_button"\n\t\t\t\tonclick="pickEvidence(').concat(o,')">')}},{key:"handleEM",value:function(e){document.getElementById("client_loadingtext").innerHTML="Loading Music "+e[1],this.serv.send("AM#"+(e[1]/10+1)+"#%");for(var t=document.getElementById("client_musiclist"),n=2;n<e.length-1;n++)if(n%2==0){var i=document.createElement("OPTION");i.text=e[n],t.options.add(i)}}},{key:"handleSM",value:function(e){document.getElementById("client_loadingtext").innerHTML="Loading Music ";for(var t=document.getElementById("client_musiclist"),n=!1,i=1;i<e.length-1;i++)if(/\.(?:wav|mp3|mp4|ogg|opus)$/i.test(e[i])&&!n&&(n=!0),n){var o=document.createElement("OPTION");o.text=e[i],t.options.add(o)}else{var c=document.createElement("SPAN");c.className="location-box",c.textContent=e[i],c.onclick=function(){x(this)},document.getElementById("areas").appendChild(c)}var a=document.getElementById("areas");if(a.lastChild.textContent.startsWith("=")){var s=document.createElement("OPTION");s.text=a.lastChild.textContent,t.insertBefore(s,t.firstChild),a.removeChild(a.lastChild)}this.serv.send("RD#%")}},{key:"handleBD",value:function(e){document.getElementById("client_loadingtext").innerHTML="Banned: "+e[1]}},{key:"handlemusic",value:function(e){for(var t=0;t<e.length/2;t++)this.musicList[e[2*t]]=e[2*t+1]}},{key:"handleDONE",value:function(e){document.getElementById("client_loading").style.display="none",document.getElementById("client_charselect").style.display="block"}},{key:"handleBN",value:function(e){ve.bgname=escape(e[1]);var t=W("bg_select",escape(e[1]));document.getElementById("bg_select").selectedIndex=t,se(),0==t&&(document.getElementById("bg_filename").value=e[1]),document.getElementById("bg_preview").src=h+"background/"+escape(e[1].toLowerCase())+"/defenseempty.png",-1==this.charID?N("jud"):N(this.chars[this.charID].side)}},{key:"handleNBG",value:function(e){}},{key:"handleHP",value:function(e){var t=10*e[2];1==e[1]?(this.hp[0]=e[2],$("#client_defense_hp > .health-bar").animate({width:t+"%"},500)):(this.hp[1]=e[2],$("#client_prosecutor_hp > .health-bar").animate({width:t+"%"},500))}},{key:"handleRT",value:function(e){"testimony1"==e[1]?this.testimonyID=1:this.testimonyID=2,ve.initTestimonyUpdater()}},{key:"handleZZ",value:function(e){var t=document.getElementById("client_ooclog");t.innerHTML+="$Alert: ".concat(pe(ge(e[1])),"\r\n"),t.scrollTop>t.scrollHeight-60&&(t.scrollTop=t.scrollHeight)}},{key:"handleID",value:function(e){this.playerID=e[1]}},{key:"handlePN",value:function(e){this.serv.send("askchaa#%")}},{key:"handleSI",value:function(e){f?this.serv.send("askchar2#%"):this.serv.send("RC#%")}},{key:"handleCharsCheck",value:function(e){var t;document.getElementById("client_chartable").innerHTML="";for(var n=0;n<this.chars.length;n++){n%8==0&&(t=document.createElement("TR"));var i=document.createElement("TD"),o="",c=this.chars[n].icon;"-1"==e[n+1]&&(o=" dark"),i.innerHTML="<img class='demothing".concat(o,"' id='demo_").concat(n,"' ")+"src='".concat(c,"' alt='").concat(this.chars[n].name,"' onclick='pickChar(").concat(n,")' ")+"onerror='demoError(this);'>",t.appendChild(i),n%8==0&&document.getElementById("client_chartable").appendChild(t)}}},{key:"handlePV",value:function(e){this.charID=e[3],document.getElementById("client_charselect").style.display="none",document.getElementById("client_inputbox").style.display="";var t=this.me(),n=this.emotes,i=document.getElementById("client_emo");i.innerHTML="",i.style.display="";var o=new XMLHttpRequest;o.withCredentials=!1,o.open("GET",h+"characters/"+escape(this.me().name.toLowerCase())+"/char.ini",!0),o.responseType="text",o.onload=function(e){if(200==this.status){var o=this.responseText,c=b.parse(o);t.side=c.Options.side,K(t.side);for(var a=1;a<=c.Emotions.number;a++){var s=c.Emotions[a].split("#"),r="0",l="0";void 0!==c.SoundN&&(r=c.SoundN[a]),void 0!==c.SoundT&&(l=c.SoundT[a]),n[a]={desc:s[0].toLowerCase(),speaking:s[1].toLowerCase(),silent:s[2].toLowerCase(),zoom:s[3],sfx:r.toLowerCase(),sfxdelay:l,button_off:h+"characters/".concat(escape(t.name).toLowerCase(),"/emotions/button").concat(a,"_off.png"),button_on:h+"characters/".concat(escape(t.name).toLowerCase(),"/emotions/button").concat(a,"_on.png")},i.innerHTML+="<img src=".concat(n[a].button_off,'\n\t\t\t\t\t\t id="emo_').concat(a,'"\n\t\t\t\t\t\t alt="').concat(n[a].desc,'"\n\t\t\t\t\t\t class="client_button"\n\t\t\t\t\t\t onclick="pickEmotion(').concat(a,')">')}U(1)}},o.send()}}]),e}(),I=function(){function e(){s(this,e),this.textnow="",this.chatmsg={isnew:!1,content:"",objection:"0",sound:"",startpreanim:!1,startspeaking:!1,side:null,color:"0",snddelay:0,preanimdelay:0},this.blip=new Audio(h+"sounds/general/sfx-blipmale.wav"),this.blip.volume=.5,this.blipChannels=new Array(6);for(var t=0;t<this.blipChannels.length;t++)this.blipChannels[t]=new Audio(h+"sounds/general/sfx-blipmale.wav"),this.blipChannels[t].volume=.5;this.currentBlipChannel=0,this.sfxaudio=new Audio(h+"sounds/general/sfx-blipmale.wav"),this.sfxplayed=0,this.music=new Audio,this.music.play(),this.updater=null,this.testimonyUpdater=null,this.bgname="gs4",this.testimonyTimer=0,this.shoutTimer=0,this.textTimer=0,this._animating=!1}return l(e,[{key:"isAnimating",value:function(){return this._animating}},{key:"setBlipVolume",value:function(e){for(var t=0;t<this.blipChannels.length;t++)this.blipChannels[t].volume=e}},{key:"bgFolder",value:function(){return"".concat(h,"background/").concat(this.bgname.toLowerCase(),"/")}},{key:"say",value:function(e){this.chatmsg=e,j(e.content,e.nameplate),N(e.side),this.textnow="",this.sfxplayed=0,this.textTimer=0,this._animating=!0,clearTimeout(this.updater),"-"!=e.preanim?e.preanimdelay=this.getAnimLength("".concat(h,"characters/").concat(escape(e.name.toLowerCase()),"/").concat(e.preanim.toLowerCase(),".gif"),this.initUpdater):this.initUpdater(0)}},{key:"initUpdater",value:function(e){ve.chatmsg.preanimdelay=parseInt(e),ve.updater=setTimeout(function(){return ve.updateText()},60)}},{key:"initTestimonyUpdater",value:function(){var e=this;if(ye.testimonyID>0){var t="";1==ye.testimonyID?t="witnesstestimony":2==ye.testimonyID&&(t="crossexamination"),new Audio(ye.resources[t].sfx).play(),this.testimonyTimer=0;var n=document.getElementById("client_testimony");n.src=ye.resources[t].src,n.style.display="",this.testimonyUpdater=setTimeout(function(){return e.updateTestimony()},60)}}},{key:"getAnimLength",value:function(e,t,n){var i=new XMLHttpRequest;i.open("GET",e,!0),i.responseType="arraybuffer",i.addEventListener("load",function(){var e=gify.getInfo(i.response);console.log(e.duration),t(e.duration,n)}),i.send()}},{key:"updateTestimony",value:function(){var e=this;this.testimonyTimer=this.testimonyTimer+60,1==ye.testimonyID?this.testimonyTimer>=ye.resources.witnesstestimony.duration?this.disposeTestimony():this.testimonyUpdater=setTimeout(function(){return e.updateTestimony()},60):2==ye.testimonyID?this.testimonyTimer>=ye.resources.crossexamination.duration?this.disposeTestimony():this.testimonyUpdater=setTimeout(function(){return e.updateTestimony()},60):this.disposeTestimony()}},{key:"disposeTestimony",value:function(){ye.testimonyID=0,this.testimonyTimer=0,document.getElementById("client_testimony").style.display="none",clearTimeout(this.testimonyUpdater)}},{key:"updateText",value:function(){var e=this,t=document.getElementById("client_name"),n=document.getElementById("client_chat"),i=document.getElementById("client_char"),o=document.getElementById("client_evi"),c=document.getElementById("client_background"),a=document.getElementById("client_shout"),s=document.getElementById("client_inner_chat");if(1==this.chatmsg.flip?i.style.transform="scaleX(-1)":i.style.transform="scaleX(1)",this._animating&&(this.updater=setTimeout(function(){return e.updateText()},60)),this.chatmsg.isnew){c.style.backgroundColor="transparent",t.style.display="none",n.style.display="none",o.style.opacity="0",o.style.height="0%";var r={1:"holdit",2:"objection",3:"takethat"}[this.chatmsg.objection];void 0!==r?(a.src=ye.resources[r].src,new Audio("".concat(h,"characters/").concat(this.chatmsg.name.toLowerCase(),"/").concat(r,".wav")).play(),this.shoutTimer=850):this.shoutTimer=0,this.chatmsg.isnew=!1,this.chatmsg.startpreanim=!0}if(this.textTimer>=this.shoutTimer&&this.chatmsg.startpreanim)2==this.chatmsg.flash?(this.sfxaudio.pause(),this.sfxplayed=1,this.sfxaudio.src=h+"sounds/general/sfx-stab.wav",this.sfxaudio.play(),$("#client_gamewindow").effect("shake",{direction:"up"})):1==this.chatmsg.flash&&(c.style.backgroundColor="white",this.sfxaudio.pause(),this.sfxplayed=1,this.sfxaudio.src=h+"sounds/general/sfx-realization.wav",this.sfxaudio.play(),$("#client_gamewindow").effect("pulsate")),this.chatmsg.preanimdelay>0&&(a.src="misc/placeholder.gif",N(this.chatmsg.side),i.src=h+"characters/"+escape(this.chatmsg.name.toLowerCase())+"/"+this.chatmsg.preanim.toLowerCase()+".gif"),this.chatmsg.startpreanim=!1,this.chatmsg.startspeaking=!0;else if(this.textTimer>=this.shoutTimer+this.chatmsg.preanimdelay&&!this.chatmsg.startpreanim)if(this.chatmsg.startspeaking){for(this.chatmsg.evidence>0&&(o.style.backgroundImage="url('"+ye.evidences[this.chatmsg.evidence-1].icon+"')","def"==this.chatmsg.side?(o.style.right="1.5em",o.style.left="initial",$("#client_evi").animate({height:"30%",opacity:1},250)):(o.style.right="initial",o.style.left="1.5em",$("#client_evi").animate({height:"30%",opacity:1},250))),t.style.display="block",t.style.fontSize=.7*t.offsetHeight+"px";t.hasChildNodes();)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(this.chatmsg.nameplate)),n.style.display="block",n.style.fontSize=.25*n.offsetHeight+"px";s.style.color={0:"#ffffff",1:"#00ff00",2:"#ff0000",3:"#ffaa00",4:"#0000ff",5:"#ffff00",6:"#aa00aa"}[this.chatmsg.color]||"#ffffff",this.chatmsg.startspeaking=!1,0==this.chatmsg.preanimdelay&&(a.src="misc/placeholder.gif",N(this.chatmsg.side)),i.src=h+"characters/"+escape(this.chatmsg.name.toLowerCase())+"/"+this.chatmsg.speaking.toLowerCase()+".gif",this.textnow==this.chatmsg.content&&(i.src=h+"characters/"+escape(this.chatmsg.name.toLowerCase())+"/"+this.chatmsg.silent.toLowerCase()+".gif",this._animating=!1,clearTimeout(this.updater))}else if(this.textnow!=this.chatmsg.content){for(" "!=this.chatmsg.content.charAt(this.textnow.length)&&(this.blipChannels[this.currentBlipChannel].play(),this.currentBlipChannel++,this.currentBlipChannel%=this.blipChannels.length),this.textnow=this.chatmsg.content.substring(0,this.textnow.length+1);s.hasChildNodes();)s.removeChild(s.firstChild);s.appendChild(document.createTextNode(this.textnow)),this.textnow==this.chatmsg.content&&(this.textTimer=0,this._animating=!1,i.src=h+"characters/"+escape(this.chatmsg.name.toLowerCase())+"/"+this.chatmsg.silent.toLowerCase()+".gif",clearTimeout(this.updater))}!this.sfxplayed&&this.chatmsg.snddelay+this.shoutTimer>=this.textTimer&&(this.sfxaudio.pause(),this.sfxplayed=1,"0"!=this.chatmsg.sound&&"1"!=this.chatmsg.sound&&(this.sfxaudio.src=h+"sounds/general/"+escape(this.chatmsg.sound.toLowerCase())+".wav",this.sfxaudio.play())),this.textTimer=this.textTimer+60}}]),e}(),b=function(){function e(){s(this,e)}return l(e,null,[{key:"parse",value:function(e){var t={section:/^\s*\[\s*([^\]]*)\s*\]\s*$/,param:/^\s*([\w.\-_]+)\s*=\s*(.*?)\s*$/,comment:/^\s*;.*$/},n={},i=e.split(/\r\n|\r|\n/),o=null;return i.forEach(function(e){if(!t.comment.test(e)&&0!=e.length)if(t.param.test(e)){var i=e.match(t.param);o?n[o][i[1]]=i[2]:n[i[1]]=i[2]}else if(t.section.test(e)){var c=e.match(t.section);n[c[1]]={},o=c[1]}}),n}}]),e}();function C(e){13==e.keyCode&&(ye.sendOOC(document.getElementById("client_oocinputbox").value),document.getElementById("client_oocinputbox").value="")}function B(e){if(13==e.keyCode){var t=ye.me(),n=ye.myEmote(),i=ye.myEvidence(),o=ye.flip?1:0,c=document.getElementById("textcolor").value,a="0",s="0";document.getElementById("sendsfx").checked&&(a=n.sfx,s=n.sfxdelay),ye.sendIC(n.speaking,t.name,n.silent,document.getElementById("client_inputbox").value,t.side,a,n.zoom,s,v,i,o,p,c)}}function k(e){var t=document.getElementById("client_musiclist").value;ye.sendMusicChange(t)}function x(e){var t=e.textContent;ye.sendMusicChange(t);var n=document.createElement("div");n.className="hrtext",n.textContent="switched to ".concat(e.textContent),document.getElementById("client_log").appendChild(n)}function T(){ve.music.volume=document.getElementById("client_mvolume").value/100}function S(){ve.sfxaudio.volume=document.getElementById("client_svolume").value/100}function L(){ve.setBlipVolume(document.getElementById("client_bvolume").value/100)}function O(e){ye.sendLeaveRoom(),document.getElementById("client_charselect").style.display="block",document.getElementById("client_emo").innerHTML=""}function P(e){return e.onerror="",e.src="misc/placeholder.gif",!0}function M(e){return e.onerror="",e.src="/misc/placeholder.png",!0}function D(e,t,n){var i=new XMLHttpRequest;i.onreadystatechange=function(){4==this.readyState&&200==this.status?t(!0,n,e):t(!1,n,e)},i.open("GET",e,!0),i.send()}function N(e){var t,n=ve.bgFolder();switch(document.getElementById("client_fg").style.display="none",document.getElementById("client_bench").style.display="none",e){case"def":document.getElementById("client_court").src=n+"defenseempty.png",document.getElementById("client_bench").style.display="block",D(n+"defensedesk.png",A,e),t="defense";break;case"pro":document.getElementById("client_court").src=n+"prosecutorempty.png",document.getElementById("client_bench").style.display="block",D(n+"prosecutiondesk.png",A,e),t="prosecution";break;case"hld":document.getElementById("client_court").src=n+"helperstand.png",t="defense";break;case"hlp":document.getElementById("client_court").src=n+"prohelperstand.png",t="prosecution";break;case"wit":document.getElementById("client_court").src=n+"witnessempty.png",document.getElementById("client_bench").style.display="block",D(n+"stand.png",A,e),t="prosecution";break;case"jud":document.getElementById("client_court").src=n+"judgestand.png",t="prosecution"}5==ve.chatmsg.type&&(document.getElementById("client_bench").style.display="none",document.getElementById("client_court").src=h+"themes/default/"+t+"_speedlines.gif")}function A(e,t){var n=ve.bgFolder();"def"==t?document.getElementById("client_bench").src=e?n+"defensedesk.png":n+"bancodefensa.png":"pro"==t?document.getElementById("client_bench").src=e?n+"prosecutiondesk.png":n+"bancoacusacion.png":"wit"==t&&(document.getElementById("client_bench").src=e?n+"stand.png":n+"estrado.png")}function R(){ye.cleanup(),(ye=new w(u))&&(m="join",document.getElementById("client_error").style.display="none")}function H(){ye.joinServer()}function j(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Date,i=document.createElement("p"),o=document.createElement("span");if(o.id="iclog_name",o.appendChild(document.createTextNode(t)),i.appendChild(o),i.appendChild(document.createTextNode(e)),_.getMinutes()!==n.getMinutes()){var c=document.createElement("span");c.id="iclog_time",c.innerText=n.toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"}),i.appendChild(c)}var a=document.getElementById("client_log");a.appendChild(i),a.scrollTop>a.scrollHeight-800&&(a.scrollTop=a.scrollHeight),_=new Date}function F(e){e<1e3?ye.sendCharacter(e):(document.getElementById("client_charselect").style.display="none",document.getElementById("client_inputbox").style.display="none",document.getElementById("client_emo").style.display="none")}function U(e){-1!=ye.selectedEmote&&(document.getElementById("emo_"+ye.selectedEmote).src=ye.myEmote().button_off),ye.selectedEmote=e,document.getElementById("emo_"+e).src=ye.myEmote().button_on}function Z(e){if(ye.selectedEvidence!==e){ye.selectedEvidence>0&&(document.getElementById("evi_"+ye.selectedEvidence).className="client_button"),document.getElementById("evi_"+e).className="client_button dark",ye.selectedEvidence=e,document.getElementById("evi_name").value=ye.evidences[e-1].name,document.getElementById("evi_desc").value=ye.evidences[e-1].desc;var t=W("evi_select",ye.evidences[e-1].filename);document.getElementById("evi_select").selectedIndex=t,0==t&&(document.getElementById("evi_filename").value=ye.evidences[e-1].filename),q(),document.getElementById("evi_add").className="client_button hover_button inactive",document.getElementById("evi_edit").className="client_button hover_button",document.getElementById("evi_cancel").className="client_button hover_button",document.getElementById("evi_del").className="client_button hover_button"}else z()}function X(){var e=document.getElementById("evi_select");ye.sendPE(document.getElementById("evi_name").value,document.getElementById("evi_desc").value,0==e.selectedIndex?document.getElementById("evi_filename").value:e.options[e.selectedIndex].text),z()}function G(){var e=document.getElementById("evi_select"),t=parseInt(ye.selectedEvidence)-1;ye.sendEE(t,document.getElementById("evi_name").value,document.getElementById("evi_desc").value,0==e.selectedIndex?document.getElementById("evi_filename").value:e.options[e.selectedIndex].text),z()}function V(){var e=parseInt(ye.selectedEvidence)-1;ye.sendDE(e),z()}function z(){ye.selectedEvidence>0&&(document.getElementById("evi_"+ye.selectedEvidence).className="client_button"),ye.selectedEvidence=0,document.getElementById("evi_select").selectedIndex=0,q(),document.getElementById("evi_filename").value="",document.getElementById("evi_name").value="",document.getElementById("evi_desc").value="",document.getElementById("evi_icon").style.backgroundImage="url('misc/empty.png')",document.getElementById("evi_add").className="client_button hover_button",document.getElementById("evi_edit").className="client_button hover_button inactive",document.getElementById("evi_cancel").className="client_button hover_button inactive",document.getElementById("evi_del").className="client_button hover_button inactive"}function W(e,t){for(var n=document.getElementById(e),i=1;i<n.length;++i)if(n.options[i].value==t)return i;return 0}function q(){var e=document.getElementById("evi_select"),t=document.getElementById("evi_filename"),n=document.getElementById("evi_icon");0===e.selectedIndex?(t.style.display="initial",n.style.backgroundImage="url(".concat(h,"evidence/").concat(t.value.toLowerCase(),")")):(t.style.display="none",n.style.backgroundImage="url(".concat(h,"evidence/").concat(e.value.toLowerCase(),")"))}function K(e){"jud"==e?(document.getElementById("judge_action").style.display="inline-table",document.getElementById("no_action").style.display="none"):(document.getElementById("no_action").style.display="inline-table",document.getElementById("judge_action").style.display="none");for(var t=0,n=document.getElementById("role_select").options;t<n.length;t++)if(e==n[t].value)return void(n.selectedIndex=t)}function Q(){var e="",t=document.getElementById("bg_select"),n=document.getElementById("bg_command").value;e=0==t.selectedIndex?document.getElementById("bg_filename").value:t.value,ye.sendOOC("/"+n.replace("$1",e))}function J(){var e=document.getElementById("role_select"),t=document.getElementById("role_command").value;ye.sendOOC("/"+t.replace("$1",e.value)),K(e.value)}function Y(){ye.sendOOC("/"+document.getElementById("randomchar_command").value)}function ee(){$("#callmod_dialog").dialog("open")}function te(){ye.sendRT("testimony1")}function ne(){ye.sendRT("testimony2")}function ie(){ye.sendHP(1,String(parseInt(ye.hp[0])+1))}function oe(){ye.sendHP(1,String(parseInt(ye.hp[0])-1))}function ce(){ye.sendHP(2,String(parseInt(ye.hp[1])+1))}function ae(){ye.sendHP(2,String(parseInt(ye.hp[1])-1))}function se(){var e=document.getElementById("bg_select"),t=document.getElementById("bg_filename"),n=document.getElementById("bg_preview");0==e.selectedIndex?(t.style.display="initial",n.src=h+"background/"+t.value.toLowerCase()+"/defenseempty.png"):(t.style.display="none",n.src=h+"background/"+e.value.toLowerCase()+"/defenseempty.png")}function re(e){e==p?(document.getElementById("button_effect_"+e).className="client_button",p=0):(document.getElementById("button_effect_"+e).className="client_button dark",p&&(document.getElementById("button_effect_"+p).className="client_button"),p=e)}function le(){ye.flip?document.getElementById("button_flip").className="client_button":document.getElementById("button_flip").className="client_button dark",ye.flip=!ye.flip}function de(){ye.presentable?document.getElementById("button_present").className="client_button":document.getElementById("button_present").className="client_button dark",ye.presentable=!ye.presentable}function ue(e){e!=y&&(document.getElementById("menu_"+e).className="menu_icon active",document.getElementById("content_"+e).className="menu_content active",document.getElementById("menu_"+y).className="menu_icon",document.getElementById("content_"+y).className="menu_content",y=e)}function me(e){e==v?(document.getElementById("button_"+e).className="client_button",v=0):(document.getElementById("button_"+e).className="client_button dark",v&&(document.getElementById("button_"+v).className="client_button"),v=e)}function he(e){return e.replace(/#/g,"<pound>").replace(/&/g,"<and>").replace(/%/g,"<percent>").replace(/\$/g,"<dollar>")}function ge(e){return e.replace(/<pound>/g,"#").replace(/<and>/g,"&").replace(/<percent>/g,"%").replace(/<dollar>/g,"$")}function fe(e){var t=document.getElementById("client_encoding").value;if("unicode"==t)return e.replace(/[^\0-~]/g,function(e){return"\\u"+("000"+e.charCodeAt().toString(16)).slice(-4)});if("utf16"==t){for(var n=new ArrayBuffer(2*e.length),i=new Uint16Array(n),o=0,c=e.length;o<c;o++)i[o]=e.charCodeAt(o);return String(i)}return e}function pe(e){var t=document.getElementById("client_decoding").value;return"unicode"==t?e.replace(/\\u([\d\w]{1,})/gi,function(e,t){return String.fromCharCode(parseInt(t,16))}):"utf16"==t?String.fromCharCode.apply(null,new Uint16Array(e.split(","))):e}window.onOOCEnter=C,window.onEnter=B,window.musiclist_click=k,window.area_click=x,window.changeMusicVolume=T,window.changeSFXVolume=S,window.changeBlipVolume=L,window.changeCharacter=O,window.imgError=P,window.demoError=M,window.ReconnectButton=R,window.RetryButton=H,window.pickChar=F,window.pickEmotion=U,window.pickEvidence=Z,window.addEvidence=X,window.editEvidence=G,window.deleteEvidence=V,window.cancelEvidence=z,window.getIndexFromSelect=W,window.updateEvidenceIcon=q,window.updateActionCommands=K,window.changeBackgroundOOC=Q,window.changeRoleOOC=J,window.randomCharacterOOC=Y,window.callMod=ee,window.initWT=te,window.initCE=ne,window.addHPD=ie,window.redHPD=oe,window.addHPP=ce,window.redHPP=ae,window.updateBackgroundPreview=se,window.toggleEffect=re,window.toggleFlip=le,window.togglePresent=de,window.toggleMenu=ue,window.toggleShout=me,void 0===String.prototype.trim&&(String.prototype.trim=function(){return String(this).replace(/^\s+|\s+$/g,"")});var ye=new w(u),ve=new I;$(document).ready(function(){ye.initialObservBBCode(),ye.loadResources()}),$(function(){$("#callmod_dialog").dialog({autoOpen:!1,resizable:!1,show:{effect:"drop",direction:"down",duration:500},hide:{effect:"drop",direction:"down",duration:500},height:"auto",width:400,modal:!0,buttons:{Sure:function(){var e=prompt("Please enter the reason","");ye.sendZZ(e),$(this).dialog("close")},Cancel:function(){$(this).dialog("close")}}})})}});
-//# sourceMappingURL=client.b.js.map \ No newline at end of file