!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=4)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i="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};var o=function e(t){var n,o;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),n=Array.prototype.forEach,o=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,s=e.length;o>>16)*a&65535)<<16)&4294967295)<<15|r>>>17))*c+(((r>>>16)*c&65535)<<16)&4294967295)<<13|o>>>19))+((5*(o>>>16)&65535)<<16)&4294967295))+((58964+(s>>>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))*c+(((r>>>16)*c&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(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n").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,'').replace(/\[(\/?)m\]/g,"<$1m>").replace(/\[c=?([#a-zA-Z0-9]+)\]/g,'').replace(/\[\/c\]/g,"")}},{key:"handleMS",value:function(e){if(e[4]!=ye.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;nt.scrollHeight-600&&(t.scrollTop=t.scrollHeight)}},{key:"handleMC",value:function(e){var t=ye.music;(t.pause(),t.src=h+e[1].toLowerCase(),t.play(),e[2]>=0)?H(this.chars[e[2]].name+" changed music to "+e[1]):H("The music was changed to "+e[1])}},{key:"handleRMC",value:function(e){ye.music.pause(),ye.music=new Audio(this.musicList[e[1]]);var t=ye.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'}},{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 .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,ye.initTestimonyUpdater()}},{key:"handleZZ",value:function(e){var t=document.getElementById("client_ooclog");t.innerHTML+="$Alert: "+fe(he(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){g?this.serv.send("askchar2#%"):this.serv.send("RC#%")}},{key:"handleCharsCheck",value:function(e){document.getElementById("client_chartable").innerHTML="";for(var t=void 0,n=0;n",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",m+"characters/"+escape(this.me().name.toLowerCase())+"/char.ini",!0),o.responseType="text",o.onload=function(e){if(200==this.status){var o=this.responseText,s=b.parse(o);t.side=s.Options.side,q(t.side);for(var a=1;a<=s.Emotions.number;a++){var c=s.Emotions[a].split("#"),r="0",l="0";void 0!==s.SoundN&&(r=s.SoundN[a]),void 0!==s.SoundT&&(l=s.SoundT[a]),n[a]={desc:c[0].toLowerCase(),speaking:c[1].toLowerCase(),silent:c[2].toLowerCase(),zoom:c[3],sfx:r.toLowerCase(),sfxdelay:l,button_off:m+"characters/"+escape(t.name).toLowerCase()+"/emotions/button"+a+"_off.png",button_on:m+"characters/"+escape(t.name).toLowerCase()+"/emotions/button"+a+"_on.png"},i.innerHTML+="'+n[a].desc+''}F(1)}},o.send()}}]),e}(),w=function(){function e(){r(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(m+"sounds/general/sfx-blipmale.wav"),this.blip.volume=.5,this.blipChannels=new Array(6);for(var t=0;t0){var t="";1==pe.testimonyID?t="witnesstestimony":2==pe.testimonyID&&(t="crossexamination"),new Audio(pe.resources[t].sfx).play(),this.testimonyTimer=0;var n=document.getElementById("client_testimony");n.src=pe.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==pe.testimonyID?this.testimonyTimer>=pe.resources.witnesstestimony.duration?this.disposeTestimony():this.testimonyUpdater=setTimeout(function(){return e.updateTestimony()},60):2==pe.testimonyID?this.testimonyTimer>=pe.resources.crossexamination.duration?this.disposeTestimony():this.testimonyUpdater=setTimeout(function(){return e.updateTestimony()},60):this.disposeTestimony()}},{key:"disposeTestimony",value:function(){pe.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"),s=document.getElementById("client_background"),a=document.getElementById("client_shout"),c=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){s.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=pe.resources[r].src,new Audio(m+"characters/"+this.chatmsg.name.toLowerCase()+"/"+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=m+"sounds/general/sfx-stab.wav",this.sfxaudio.play(),$("#client_gamewindow").effect("shake",{direction:"up"})):1==this.chatmsg.flash&&(s.style.backgroundColor="white",this.sfxaudio.pause(),this.sfxplayed=1,this.sfxaudio.src=m+"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=m+"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('"+pe.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";c.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=m+"characters/"+escape(this.chatmsg.name.toLowerCase())+"/"+this.chatmsg.speaking.toLowerCase()+".gif",this.textnow==this.chatmsg.content&&(i.src=m+"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);c.hasChildNodes();)c.removeChild(c.firstChild);c.appendChild(document.createTextNode(this.textnow)),this.textnow==this.chatmsg.content&&(this.textTimer=0,this._animating=!1,i.src=m+"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=m+"sounds/general/"+escape(this.chatmsg.sound.toLowerCase())+".wav",this.sfxaudio.play())),this.textTimer=this.textTimer+60}}]),e}(),b=function(){function e(){r(this,e)}return i(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 s=e.match(t.section);n[s[1]]={},o=s[1]}}),n}}]),e}();function I(e){13==e.keyCode&&(pe.sendOOC(document.getElementById("client_oocinputbox").value),document.getElementById("client_oocinputbox").value="")}function C(e){if(13==e.keyCode){var t=pe.me(),n=pe.myEmote(),i=pe.myEvidence(),o=pe.flip?1:0,s=document.getElementById("textcolor").value,a="0",c="0";document.getElementById("sendsfx").checked&&(a=n.sfx,c=n.sfxdelay),pe.sendIC(n.speaking,t.name,n.silent,document.getElementById("client_inputbox").value,t.side,a,n.zoom,c,y,i,o,f,s)}}function B(e){var t=document.getElementById("client_musiclist").value;pe.sendMusicChange(t)}function k(e){var t=e.textContent;pe.sendMusicChange(t);var n=document.createElement("div");n.className="hrtext",n.textContent="switched to "+e.textContent,document.getElementById("client_log").appendChild(n)}function x(){ye.music.volume=document.getElementById("client_mvolume").value/100}function T(){ye.sfxaudio.volume=document.getElementById("client_svolume").value/100}function S(){ye.setBlipVolume(document.getElementById("client_bvolume").value/100)}function L(e){pe.sendLeaveRoom(),document.getElementById("client_charselect").style.display="block",document.getElementById("client_emo").innerHTML=""}function O(e){return e.onerror="",e.src="misc/placeholder.gif",!0}function M(e){return e.onerror="",e.src="/misc/placeholder.png",!0}function P(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=void 0,n=ye.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",P(n+"defensedesk.png",D,e),t="defense";break;case"pro":document.getElementById("client_court").src=n+"prosecutorempty.png",document.getElementById("client_bench").style.display="block",P(n+"defensedesk.png",D,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",document.getElementById("client_bench").src=n+"estrado.png",t="prosecution";break;case"jud":document.getElementById("client_court").src=n+"judgestand.png",t="prosecution"}5==ye.chatmsg.type&&(document.getElementById("client_bench").style.display="none",document.getElementById("client_court").src=m+"themes/default/"+t+"_speedlines.gif")}function D(e,t){var n=ye.bgFolder();document.getElementById("client_bench").src="def"==t?e?n+"defensedesk.png":n+"bancodefensa.png":e?n+"prosecutiondesk.png":n+"bancoacusacion.png"}function A(){pe.cleanup(),(pe=new _(d))&&(u="join",document.getElementById("client_error").style.display="none")}function R(){pe.joinServer()}function H(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)),E.getMinutes()!==n.getMinutes()){var s=document.createElement("span");s.id="iclog_time",s.innerText=n.toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"}),i.appendChild(s)}var a=document.getElementById("client_log");a.appendChild(i),a.scrollTop>a.scrollHeight-800&&(a.scrollTop=a.scrollHeight),E=new Date}function j(e){e<1e3?pe.sendCharacter(e):(document.getElementById("client_charselect").style.display="none",document.getElementById("client_inputbox").style.display="none",document.getElementById("client_emo").style.display="none")}function F(e){-1!=pe.selectedEmote&&(document.getElementById("emo_"+pe.selectedEmote).src=pe.myEmote().button_off),pe.selectedEmote=e,document.getElementById("emo_"+e).src=pe.myEmote().button_on}function U(e){if(pe.selectedEvidence!==e){pe.selectedEvidence>0&&(document.getElementById("evi_"+pe.selectedEvidence).className="client_button"),document.getElementById("evi_"+e).className="client_button dark",pe.selectedEvidence=e,document.getElementById("evi_name").value=pe.evidences[e-1].name,document.getElementById("evi_desc").value=pe.evidences[e-1].desc;var t=z("evi_select",pe.evidences[e-1].filename);document.getElementById("evi_select").selectedIndex=t,0==t&&(document.getElementById("evi_filename").value=pe.evidences[e-1].filename),W(),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 V()}function Z(){var e=document.getElementById("evi_select");pe.sendPE(document.getElementById("evi_name").value,document.getElementById("evi_desc").value,0==e.selectedIndex?document.getElementById("evi_filename").value:e.options[e.selectedIndex].text),V()}function X(){var e=document.getElementById("evi_select"),t=parseInt(pe.selectedEvidence)-1;pe.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),V()}function G(){var e=parseInt(pe.selectedEvidence)-1;pe.sendDE(e),V()}function V(){pe.selectedEvidence>0&&(document.getElementById("evi_"+pe.selectedEvidence).className="client_button"),pe.selectedEvidence=0,document.getElementById("evi_select").selectedIndex=0,W(),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 z(e,t){for(var n=document.getElementById(e),i=1;i").replace(/&/g,"").replace(/%/g,"").replace(/\$/g,"")}function he(e){return e.replace(//g,"#").replace(//g,"&").replace(//g,"%").replace(//g,"$")}function ge(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,s=e.length;o