forked from Zirak/SO-ChatBot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
master.min.js
3 lines (3 loc) · 105 KB
/
master.min.js
1
2
3
function js_beautify(e,t){function n(e){for(e=e===void 0?!1:e;v.length&&(" "===v[v.length-1]||v[v.length-1]===S||v[v.length-1]===U||e&&("\n"===v[v.length-1]||"\r"===v[v.length-1]));)v.pop()}function o(e){return e.replace(/^\s\s*|\s\s*$/,"")}function i(e){e=e.replace(/\x0d/g,"");for(var t=[],n=e.indexOf("\n");-1!==n;)t.push(e.substring(0,n)),e=e.substring(n+1),n=e.indexOf("\n");return e.length&&t.push(e),t}function r(){var e=Q;Q=!1,a(),Q=e}function a(e,t){if(E.eat_next_space=!1,(!Q||!p(E.mode))&&(e=e===void 0?!0:e,t=t===void 0?!0:t,t&&(E.if_line=!1,E.chain_extra_indentation=0),n(),v.length)){"\n"===v[v.length-1]&&e||(J=!0,v.push("\n")),U&&v.push(U);for(var o=0;E.indentation_level+E.chain_extra_indentation>o;o+=1)v.push(S);E.var_line&&E.var_line_reindented&&v.push(S)}}function s(){if("TK_COMMENT"===I)return a();if(E.eat_next_space)return E.eat_next_space=!1,void 0;var e=" ";v.length&&(e=v[v.length-1])," "!==e&&"\n"!==e&&e!==S&&v.push(" ")}function c(){J=!1,E.eat_next_space=!1,v.push(_)}function u(){E.indentation_level+=1}function m(){v.length&&v[v.length-1]===S&&v.pop()}function l(e){E&&N.push(E),E={previous_mode:E?E.mode:"BLOCK",mode:e,var_line:!1,var_line_tainted:!1,var_line_reindented:!1,in_html_comment:!1,if_line:!1,chain_extra_indentation:0,in_case_statement:!1,in_case:!1,case_body:!1,eat_next_space:!1,indentation_level:E?E.indentation_level+(E.var_line&&E.var_line_reindented?1:0):0,ternary_depth:0}}function p(e){return"[EXPRESSION]"===e||"[INDENTED-EXPRESSION]"===e}function d(e){return x(e,["[EXPRESSION]","(EXPRESSION)","(FOR-EXPRESSION)","(COND-EXPRESSION)"])}function h(){if(L="DO_BLOCK"===E.mode,N.length>0){var e=E.mode;E=N.pop(),E.previous_mode=e}}function g(e,t){for(var n=0;e.length>n;n++){var i=o(e[n]);if(i.charAt(0)!==t)return!1}return!0}function f(e){return x(e,["case","return","do","if","throw","else"])}function x(e,t){for(var n=0;t.length>n;n+=1)if(t[n]===e)return!0;return!1}function y(e){for(var t=R,n=C.charAt(t);x(n,k)&&n!==e;){if(t++,t>=$)return 0;n=C.charAt(t)}return n}function b(){var e,t;if(G=0,R>=$)return["","TK_EOF"];M=!1;var i=C.charAt(R);R+=1;var r=Q&&p(E.mode);if(r){for(var s=0;x(i,k);){if("\n"===i?(n(),v.push("\n"),J=!0,s=0):" "===i?s+=4:"\r"===i||(s+=1),R>=$)return["","TK_EOF"];i=C.charAt(R),R+=1}if(J)for(e=0;s>e;e++)v.push(" ")}else{for(;x(i,k);){if("\n"===i&&(G+=Y?Y>=G?1:0:1),R>=$)return["","TK_EOF"];i=C.charAt(R),R+=1}if(V&&G>1)for(e=0;G>e;e+=1)a(0===e),J=!0;M=G>0}if(x(i,w)){if($>R)for(;x(C.charAt(R),w)&&(i+=C.charAt(R),R+=1,R!==$););if(R!==$&&i.match(/^[0-9]+[Ee]$/)&&("-"===C.charAt(R)||"+"===C.charAt(R))){var c=C.charAt(R);R+=1;var u=b();return i+=c+u[0],[i,"TK_WORD"]}return"in"===i?[i,"TK_OPERATOR"]:(!M||"TK_OPERATOR"===I||"TK_EQUALS"===I||E.if_line||!V&&"var"===A||a(),[i,"TK_WORD"])}if("("===i||"["===i)return[i,"TK_START_EXPR"];if(")"===i||"]"===i)return[i,"TK_END_EXPR"];if("{"===i)return[i,"TK_START_BLOCK"];if("}"===i)return[i,"TK_END_BLOCK"];if(";"===i)return[i,"TK_SEMICOLON"];if("/"===i){var m="",l=!0;if("*"===C.charAt(R)){if(R+=1,$>R)for(;$>R&&("*"!==C.charAt(R)||!C.charAt(R+1)||"/"!==C.charAt(R+1))&&(i=C.charAt(R),m+=i,("\n"===i||"\r"===i)&&(l=!1),R+=1,!(R>=$)););return R+=2,l&&0===G?["/*"+m+"*/","TK_INLINE_COMMENT"]:["/*"+m+"*/","TK_BLOCK_COMMENT"]}if("/"===C.charAt(R)){for(m=i;"\r"!==C.charAt(R)&&"\n"!==C.charAt(R)&&(m+=C.charAt(R),R+=1,!(R>=$)););return M&&a(),[m,"TK_COMMENT"]}}if("'"===i||'"'===i||"/"===i&&("TK_WORD"===I&&f(A)||")"===A&&x(E.previous_mode,["(COND-EXPRESSION)","(FOR-EXPRESSION)"])||"TK_COMMA"===I||"TK_COMMENT"===I||"TK_START_EXPR"===I||"TK_START_BLOCK"===I||"TK_END_BLOCK"===I||"TK_OPERATOR"===I||"TK_EQUALS"===I||"TK_EOF"===I||"TK_SEMICOLON"===I)){var d=i,h=!1,g=0,y=0;if(t=i,$>R)if("/"===d){for(var _=!1;h||_||C.charAt(R)!==d;)if(t+=C.charAt(R),h?h=!1:(h="\\"===C.charAt(R),"["===C.charAt(R)?_=!0:"]"===C.charAt(R)&&(_=!1)),R+=1,R>=$)return[t,"TK_STRING"]}else for(;h||C.charAt(R)!==d;)if(t+=C.charAt(R),g&&g>=y&&(g=parseInt(t.substr(-y),16),g&&g>=32&&126>=g&&(g=String.fromCharCode(g),t=t.substr(0,t.length-y-2)+(g===d||"\\"===g?"\\":"")+g),g=0),g?g++:h?(h=!1,q&&("x"===C.charAt(R)?(g++,y=2):"u"===C.charAt(R)&&(g++,y=4))):h="\\"===C.charAt(R),R+=1,R>=$)return[t,"TK_STRING"];if(R+=1,t+=d,"/"===d)for(;$>R&&x(C.charAt(R),w);)t+=C.charAt(R),R+=1;return[t,"TK_STRING"]}if("#"===i){if(0===v.length&&"!"===C.charAt(R)){for(t=i;$>R&&"\n"!==i;)i=C.charAt(R),t+=i,R+=1;return v.push(o(t)+"\n"),a(),b()}var O="#";if($>R&&x(C.charAt(R),K)){do i=C.charAt(R),O+=i,R+=1;while($>R&&"#"!==i&&"="!==i);return"#"===i||("["===C.charAt(R)&&"]"===C.charAt(R+1)?(O+="[]",R+=2):"{"===C.charAt(R)&&"}"===C.charAt(R+1)&&(O+="{}",R+=2)),[O,"TK_WORD"]}}if("<"===i&&"<!--"===C.substring(R-1,R+3)){for(R+=3,i="<!--";"\n"!==C.charAt(R)&&$>R;)i+=C.charAt(R),R++;return E.in_html_comment=!0,[i,"TK_COMMENT"]}if("-"===i&&E.in_html_comment&&"-->"===C.substring(R-1,R+2))return E.in_html_comment=!1,R+=2,M&&a(),["-->","TK_COMMENT"];if("."===i)return[i,"TK_DOT"];if(x(i,D)){for(;$>R&&x(i+C.charAt(R),D)&&(i+=C.charAt(R),R+=1,!(R>=$)););return","===i?[i,"TK_COMMA"]:"="===i?[i,"TK_EQUALS"]:[i,"TK_OPERATOR"]}return[i,"TK_UNKNOWN"]}var C,v,_,I,A,O,T,E,N,S,k,w,D,R,j,K,P,B,L,M,J,G,U="";t=t?t:{};var X;void 0!==t.space_after_anon_function&&void 0===t.jslint_happy&&(t.jslint_happy=t.space_after_anon_function),void 0!==t.braces_on_own_line&&(X=t.braces_on_own_line?"expand":"collapse"),X=t.brace_style?t.brace_style:X?X:"collapse";var F=t.indent_size?t.indent_size:4,Z=t.indent_char?t.indent_char:" ",V=t.preserve_newlines===void 0?!0:t.preserve_newlines,W=t.break_chained_methods===void 0?!1:t.break_chained_methods,Y=t.max_preserve_newlines===void 0?!1:t.max_preserve_newlines,H="undefined"===t.jslint_happy?!1:t.jslint_happy,Q=t.keep_array_indentation===void 0?!1:t.keep_array_indentation,z=t.space_before_conditional===void 0?!0:t.space_before_conditional,q=t.unescape_strings===void 0?!1:t.unescape_strings;J=!1;var $=e.length;for(S="";F>0;)S+=Z,F-=1;for(;e&&(" "===e.charAt(0)||" "===e.charAt(0));)U+=e.charAt(0),e=e.substring(1);for(C=e,T="",I="TK_START_EXPR",A="",O="",v=[],L=!1,k="\n\r ".split(""),w="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_$".split(""),K="0123456789".split(""),D="+ - * / % & ++ -- = += -= *= /= %= == === != !== > < >= <= >> << >>> >>>= >>= <<= && &= | || ! !! , : ? ^ ^= |= ::",D+=" <%= <% %> <?= <? ?>",D=D.split(" "),j="continue,try,throw,return,var,if,switch,case,default,for,while,break,function".split(","),N=[],l("BLOCK"),R=0;;){var et=b();if(_=et[0],B=et[1],"TK_EOF"===B)break;switch(B){case"TK_START_EXPR":if("["===_){if("TK_WORD"===I||")"===A){x(A,j)&&s(),l("(EXPRESSION)"),c();break}"[EXPRESSION]"===E.mode||"[INDENTED-EXPRESSION]"===E.mode?"]"===O&&","===A?("[EXPRESSION]"===E.mode&&(E.mode="[INDENTED-EXPRESSION]",Q||u()),l("[EXPRESSION]"),Q||a()):"["===A?("[EXPRESSION]"===E.mode&&(E.mode="[INDENTED-EXPRESSION]",Q||u()),l("[EXPRESSION]"),Q||a()):l("[EXPRESSION]"):l("[EXPRESSION]")}else"for"===T?l("(FOR-EXPRESSION)"):x(T,["if","while"])?l("(COND-EXPRESSION)"):l("(EXPRESSION)");";"===A||"TK_START_BLOCK"===I?a():"TK_END_EXPR"===I||"TK_START_EXPR"===I||"TK_END_BLOCK"===I||"."===A?M&&a():"TK_WORD"!==I&&"TK_OPERATOR"!==I?s():"function"===T||"typeof"===T?H&&s():(x(A,j)||"catch"===A)&&z&&s(),c();break;case"TK_DOT":f(A)?s():")"===A&&(W||M)&&(E.chain_extra_indentation=1,a(!0,!1)),c();break;case"TK_END_EXPR":if("]"===_)if(Q){if("}"===A){m(),c(),h();break}}else if("[INDENTED-EXPRESSION]"===E.mode&&"]"===A){h(),a(),c();break}h(),c();break;case"TK_START_BLOCK":if("do"===T?l("DO_BLOCK"):l("BLOCK"),"expand"===X||"expand-strict"===X){var tt=!1;"expand-strict"===X?(tt="}"===y(),tt||a(!0)):"TK_OPERATOR"!==I&&("="===A||f(A)&&"else"!==A?s():a(!0)),c(),tt||u()}else"TK_OPERATOR"!==I&&"TK_START_EXPR"!==I?"TK_START_BLOCK"===I?a():s():p(E.previous_mode)&&","===A&&("}"===O?s():a()),u(),c();break;case"TK_END_BLOCK":h(),"expand"===X||"expand-strict"===X?("{"!==A&&a(),c()):("TK_START_BLOCK"===I?J?m():n():p(E.mode)&&Q?(Q=!1,a(),Q=!0):a(),c());break;case"TK_WORD":if(L){s(),c(),s(),L=!1;break}if(P="NONE","function"===_){if(E.var_line&&"TK_EQUALS"!==I&&(E.var_line_reindented=!0),(J||";"===A)&&"{"!==A&&"TK_BLOCK_COMMENT"!==I&&"TK_COMMENT"!==I){G=J?G:0,V||(G=1);for(var nt=0;2-G>nt;nt++)a(!1)}"TK_WORD"===I?"get"===A||"set"===A||"new"===A||"return"===A?s():a():"TK_OPERATOR"===I||"="===A?s():d(E.mode)||a(),c(),T=_;break}if("case"===_||"default"===_&&E.in_case_statement){a(),E.case_body&&(E.indentation_level--,E.case_body=!1,m()),c(),E.in_case=!0,E.in_case_statement=!0;break}"TK_END_BLOCK"===I?x(_.toLowerCase(),["else","catch","finally"])?"expand"===X||"end-expand"===X||"expand-strict"===X?P="NEWLINE":(P="SPACE",s()):P="NEWLINE":"TK_SEMICOLON"!==I||"BLOCK"!==E.mode&&"DO_BLOCK"!==E.mode?"TK_SEMICOLON"===I&&d(E.mode)?P="SPACE":"TK_STRING"===I?P="NEWLINE":"TK_WORD"===I?("else"===A&&n(!0),P="SPACE"):"TK_START_BLOCK"===I?P="NEWLINE":"TK_END_EXPR"===I&&(s(),P="NEWLINE"):P="NEWLINE",x(_,j)&&")"!==A&&(P="else"===A?"SPACE":"NEWLINE"),E.if_line&&"TK_END_EXPR"===I&&(E.if_line=!1),x(_.toLowerCase(),["else","catch","finally"])?"TK_END_BLOCK"!==I||"expand"===X||"end-expand"===X||"expand-strict"===X?a():(n(!0),s()):"NEWLINE"===P?f(A)?s():"TK_END_EXPR"!==I?"TK_START_EXPR"===I&&"var"===_||":"===A||("if"===_&&"else"===T&&"{"!==A?s():(E.var_line=!1,E.var_line_reindented=!1,a())):x(_,j)&&")"!==A&&(E.var_line=!1,E.var_line_reindented=!1,a()):p(E.mode)&&","===A&&"}"===O?a():"SPACE"===P&&s(),c(),T=_,"var"===_&&(E.var_line=!0,E.var_line_reindented=!1,E.var_line_tainted=!1),"if"===_&&(E.if_line=!0),"else"===_&&(E.if_line=!1);break;case"TK_SEMICOLON":c(),E.var_line=!1,E.var_line_reindented=!1,"OBJECT"===E.mode&&(E.mode="BLOCK");break;case"TK_STRING":"TK_END_EXPR"===I&&x(E.previous_mode,["(COND-EXPRESSION)","(FOR-EXPRESSION)"])?s():"TK_COMMENT"===I||"TK_STRING"===I||"TK_START_BLOCK"===I||"TK_END_BLOCK"===I||"TK_SEMICOLON"===I?a():"TK_WORD"===I?s():V&&M&&(a(),v.push(S)),c();break;case"TK_EQUALS":E.var_line&&(E.var_line_tainted=!0),s(),c(),s();break;case"TK_COMMA":if(E.var_line){if((d(E.mode)||"TK_END_BLOCK"===I)&&(E.var_line_tainted=!1),E.var_line_tainted){c(),E.var_line_reindented=!0,E.var_line_tainted=!1,a();break}E.var_line_tainted=!1,c(),s();break}"TK_COMMENT"===I&&a(),"TK_END_BLOCK"===I&&"(EXPRESSION)"!==E.mode?(c(),"OBJECT"===E.mode&&"}"===A?a():s()):"OBJECT"===E.mode?(c(),a()):(c(),s());break;case"TK_OPERATOR":var ot=!0,it=!0;if(f(A)){s(),c();break}if("*"===_&&"TK_DOT"===I&&!O.match(/^\d+$/)){c();break}if(":"===_&&E.in_case){E.case_body=!0,u(),c(),a(),E.in_case=!1;break}if("::"===_){c();break}x(_,["--","++","!"])||x(_,["-","+"])&&(x(I,["TK_START_BLOCK","TK_START_EXPR","TK_EQUALS","TK_OPERATOR"])||x(A,j)||","==A)?(ot=!1,it=!1,";"===A&&d(E.mode)&&(ot=!0),"TK_WORD"===I&&x(A,j)&&(ot=!0),"BLOCK"!==E.mode||"{"!==A&&";"!==A||a()):":"===_?0===E.ternary_depth?("BLOCK"===E.mode&&(E.mode="OBJECT"),ot=!1):E.ternary_depth-=1:"?"===_&&(E.ternary_depth+=1),ot&&s(),c(),it&&s();break;case"TK_BLOCK_COMMENT":var rt,at=i(_);if(g(at.slice(1),"*"))for(a(),v.push(at[0]),rt=1;at.length>rt;rt++)a(),v.push(" "),v.push(o(at[rt]));else for(at.length>1?a():"TK_END_BLOCK"===I?a():s(),rt=0;at.length>rt;rt++)v.push(at[rt]),v.push("\n");"\n"!==y("\n")&&a();break;case"TK_INLINE_COMMENT":s(),c(),d(E.mode)?s():r();break;case"TK_COMMENT":","!==A||M||n(!0),"TK_COMMENT"!==I&&(M?a():s()),c(),a();break;case"TK_UNKNOWN":c()}O=A,I=B,A=_}var st=U+v.join("").replace(/[\r\n ]+$/,"");return st}function css_beautify(e,t){function n(){return d=e.charAt(++g)}function o(){return e.charAt(g+1)}function i(t){for(var o=g;n();)if("\\"==d)n(),n();else{if(d==t)break;if("\n"==d)break}return e.substring(o,g+1)}function r(){for(var e=g;h.test(o());)g++;return g!=e}function a(){var e=g;do;while(h.test(n()));return g!=e+1}function s(){var t=g;for(n();n();)if("*"==d&&"/"==o()){g++;break}return e.substring(t,g+1)}function c(e,t){return C.slice(-e.length+(t||0),t).join("").toLowerCase()==e}function u(){y++,f+=x}function m(){y--,f=f.slice(0,-l)}t=t||{};var l=t.indent_size||4,p=t.indent_char||" ";"string"==typeof l&&(l=parseInt(l));var d,h=/^\s+$/,g=-1,f=e.match(/^[\r\n]*[\t ]*/)[0],x=Array(l+1).join(p),y=0,b={};b["{"]=function(e){b.singleSpace(),C.push(e),b.newLine()},b["}"]=function(e){b.newLine(),C.push(e),b.newLine()},b.newLine=function(e){if(!e)for(;h.test(C[C.length-1]);)C.pop();C.length&&C.push("\n"),f&&C.push(f)},b.singleSpace=function(){C.length&&!h.test(C[C.length-1])&&C.push(" ")};var C=[];for(f&&C.push(f);;){var v=a();if(!d)break;"{"==d?(u(),b["{"](d)):"}"==d?(m(),b["}"](d)):'"'==d||"'"==d?C.push(i(d)):";"==d?C.push(d,"\n",f):"/"==d&&"*"==o()?(b.newLine(),C.push(s(),"\n",f)):"("==d?c("url",-1)?(C.push(d),r(),n()&&(")"!=d&&'"'!=d&&"'"!=d?C.push(i(")")):g--)):(v&&b.singleSpace(),C.push(d),r()):")"==d?C.push(d):","==d?(r(),C.push(d),b.singleSpace()):"]"==d?C.push(d):"["==d||"="==d?(r(),C.push(d)):(v&&b.singleSpace(),C.push(d))}var _=C.join("").replace(/[\n ]+$/,"");return _}function style_html(e,t){function n(){return this.pos=0,this.token="",this.current_mode="CONTENT",this.tags={parent:"parent1",parentcount:1,parent1:""},this.tag_type="",this.token_text=this.last_token=this.last_text=this.token_type="",this.Utils={whitespace:"\n\r ".split(""),single_token:"br,input,link,meta,!doctype,basefont,base,area,hr,wbr,param,img,isindex,?xml,embed,?php,?,?=".split(","),extra_liners:"head,body,/html".split(","),in_array:function(e,t){for(var n=0;t.length>n;n++)if(e===t[n])return!0;return!1}},this.get_content=function(){for(var e="",t=[],n=!1;"<"!==this.input.charAt(this.pos);){if(this.pos>=this.input.length)return t.length?t.join(""):["","TK_EOF"];if(e=this.input.charAt(this.pos),this.pos++,this.line_char_count++,this.Utils.in_array(e,this.Utils.whitespace))t.length&&(n=!0),this.line_char_count--;else{if(n){if(this.line_char_count>=this.max_char){t.push("\n");for(var o=0;this.indent_level>o;o++)t.push(this.indent_string);this.line_char_count=0}else t.push(" "),this.line_char_count++;n=!1}t.push(e)}}return t.length?t.join(""):""},this.get_contents_to=function(e){if(this.pos==this.input.length)return["","TK_EOF"];var t="",n=RegExp("</"+e+"\\s*>","igm");n.lastIndex=this.pos;var o=n.exec(this.input),i=o?o.index:this.input.length;return i>this.pos&&(t=this.input.substring(this.pos,i),this.pos=i),t},this.record_tag=function(e){this.tags[e+"count"]?(this.tags[e+"count"]++,this.tags[e+this.tags[e+"count"]]=this.indent_level):(this.tags[e+"count"]=1,this.tags[e+this.tags[e+"count"]]=this.indent_level),this.tags[e+this.tags[e+"count"]+"parent"]=this.tags.parent,this.tags.parent=e+this.tags[e+"count"]},this.retrieve_tag=function(e){if(this.tags[e+"count"]){for(var t=this.tags.parent;t&&e+this.tags[e+"count"]!==t;)t=this.tags[t+"parent"];t&&(this.indent_level=this.tags[e+this.tags[e+"count"]],this.tags.parent=this.tags[t+"parent"]),delete this.tags[e+this.tags[e+"count"]+"parent"],delete this.tags[e+this.tags[e+"count"]],1==this.tags[e+"count"]?delete this.tags[e+"count"]:this.tags[e+"count"]--}},this.get_tag=function(){var e,t,n="",o=[],i=!1;do{if(this.pos>=this.input.length)return o.length?o.join(""):["","TK_EOF"];n=this.input.charAt(this.pos),this.pos++,this.line_char_count++,this.Utils.in_array(n,this.Utils.whitespace)?(i=!0,this.line_char_count--):(("'"===n||'"'===n)&&(o[1]&&"!"===o[1]||(n+=this.get_unformatted(n),i=!0)),"="===n&&(i=!1),o.length&&"="!==o[o.length-1]&&">"!==n&&i&&(this.line_char_count>=this.max_char?(this.print_newline(!1,o),this.line_char_count=0):(o.push(" "),this.line_char_count++),i=!1),"<"===n&&(e=this.pos-1),o.push(n))}while(">"!==n);var r,a=o.join("");r=-1!=a.indexOf(" ")?a.indexOf(" "):a.indexOf(">");var s=a.substring(1,r).toLowerCase();if("/"===a.charAt(a.length-2)||this.Utils.in_array(s,this.Utils.single_token))this.tag_type="SINGLE";else if("script"===s)this.record_tag(s),this.tag_type="SCRIPT";else if("style"===s)this.record_tag(s),this.tag_type="STYLE";else if(this.Utils.in_array(s,c)){var u=this.get_unformatted("</"+s+">",a);o.push(u),e>0&&this.Utils.in_array(this.input.charAt(e-1),this.Utils.whitespace)&&o.splice(0,0,this.input.charAt(e-1)),t=this.pos-1,this.Utils.in_array(this.input.charAt(t+1),this.Utils.whitespace)&&o.push(this.input.charAt(t+1)),this.tag_type="SINGLE"}else if("!"===s.charAt(0))if(-1!=s.indexOf("[if")){if(-1!=a.indexOf("!IE")){var u=this.get_unformatted("-->",a);o.push(u)}this.tag_type="START"}else if(-1!=s.indexOf("[endif"))this.tag_type="END",this.unindent();else if(-1!=s.indexOf("[cdata[")){var u=this.get_unformatted("]]>",a);o.push(u),this.tag_type="SINGLE"}else{var u=this.get_unformatted("-->",a);o.push(u),this.tag_type="SINGLE"}else"/"===s.charAt(0)?(this.retrieve_tag(s.substring(1)),this.tag_type="END"):(this.record_tag(s),this.tag_type="START"),this.Utils.in_array(s,this.Utils.extra_liners)&&this.print_newline(!0,this.output);return o.join("")},this.get_unformatted=function(e,t){if(t&&-1!=t.toLowerCase().indexOf(e))return"";var n="",o="",i=!0;do{if(this.pos>=this.input.length)return o;if(n=this.input.charAt(this.pos),this.pos++,this.Utils.in_array(n,this.Utils.whitespace)){if(!i){this.line_char_count--;continue}if("\n"===n||"\r"===n){o+="\n",this.line_char_count=0;continue}}o+=n,this.line_char_count++,i=!0}while(-1==o.toLowerCase().indexOf(e));return o},this.get_token=function(){var e;if("TK_TAG_SCRIPT"===this.last_token||"TK_TAG_STYLE"===this.last_token){var t=this.last_token.substr(7);return e=this.get_contents_to(t),"string"!=typeof e?e:[e,"TK_"+t]}if("CONTENT"===this.current_mode)return e=this.get_content(),"string"!=typeof e?e:[e,"TK_CONTENT"];if("TAG"===this.current_mode){if(e=this.get_tag(),"string"!=typeof e)return e;var n="TK_TAG_"+this.tag_type;return[e,n]}},this.get_full_indent=function(e){return e=this.indent_level+e||0,1>e?"":Array(e+1).join(this.indent_string)},this.printer=function(e,t,n,o,i){this.input=e||"",this.output=[],this.indent_character=t,this.indent_string="",this.indent_size=n,this.brace_style=i,this.indent_level=0,this.max_char=o,this.line_char_count=0;for(var r=0;this.indent_size>r;r++)this.indent_string+=this.indent_character;this.print_newline=function(e,t){if(this.line_char_count=0,t&&t.length){if(!e)for(;this.Utils.in_array(t[t.length-1],this.Utils.whitespace);)t.pop();t.push("\n");for(var n=0;this.indent_level>n;n++)t.push(this.indent_string)}},this.print_token=function(e){this.output.push(e)},this.indent=function(){this.indent_level++},this.unindent=function(){this.indent_level>0&&this.indent_level--}},this}var o,i,r,a,s,c;for(t=t||{},i=t.indent_size||4,r=t.indent_char||" ",s=t.brace_style||"collapse",a=0==t.max_char?1/0:t.max_char||70,c=t.unformatted||["a","span","bdo","em","strong","dfn","code","samp","kbd","var","cite","abbr","acronym","q","sub","sup","tt","i","b","big","small","u","s","strike","font","ins","del","pre","address","dt","h1","h2","h3","h4","h5","h6"],o=new n,o.printer(e,r,i,a,s);;){var u=o.get_token();if(o.token_text=u[0],o.token_type=u[1],"TK_EOF"===o.token_type)break;switch(o.token_type){case"TK_TAG_START":o.print_newline(!1,o.output),o.print_token(o.token_text),o.indent(),o.current_mode="CONTENT";break;case"TK_TAG_STYLE":case"TK_TAG_SCRIPT":o.print_newline(!1,o.output),o.print_token(o.token_text),o.current_mode="CONTENT";break;case"TK_TAG_END":if("TK_CONTENT"===o.last_token&&""===o.last_text){var m=o.token_text.match(/\w+/)[0],l=o.output[o.output.length-1].match(/<\s*(\w+)/);(null===l||l[1]!==m)&&o.print_newline(!0,o.output)}o.print_token(o.token_text),o.current_mode="CONTENT";break;case"TK_TAG_SINGLE":var p=o.token_text.match(/^\s*<([a-z]+)/i);p&&o.Utils.in_array(p[1],c)||o.print_newline(!1,o.output),o.print_token(o.token_text),o.current_mode="CONTENT";break;case"TK_CONTENT":""!==o.token_text&&o.print_token(o.token_text),o.current_mode="TAG";break;case"TK_STYLE":case"TK_SCRIPT":if(""!==o.token_text){o.output.push("\n");var d=o.token_text;if("TK_SCRIPT"==o.token_type)var h="function"==typeof js_beautify&&js_beautify;else if("TK_STYLE"==o.token_type)var h="function"==typeof css_beautify&&css_beautify;if("keep"==t.indent_scripts)var g=0;else if("separate"==t.indent_scripts)var g=-o.indent_level;else var g=1;var f=o.get_full_indent(g);if(h)d=h(d.replace(/^\s*/,f),t);else{var x=d.match(/^\s*/)[0],y=x.match(/[^\n\r]*$/)[0].split(o.indent_string).length-1,b=o.get_full_indent(g-y);d=d.replace(/^\s*/,f).replace(/\r\n|\r|\n/g,"\n"+b).replace(/\s*$/,"")}d&&(o.print_token(d),o.print_newline(!0,o.output))}o.current_mode="TAG"}o.last_token=o.token_type,o.last_text=o.token_text}return o.output.join("")}var IO=window.IO={events:{},preventDefault:!1,register:function(e,t,n){return this.events[e]||(this.events[e]=[]),this.events[e].push({fun:t,thisArg:n,args:Array.prototype.slice.call(arguments,3)}),this},unregister:function(e,t){return this.events[e]?(this.events[e]=this.events[e].filter(function(e){return e.fun!==t}),this):this},fire:function(e){function t(e){var t=e.fun.apply(e.thisArg,e.args.concat(n));o.preventDefault=t===!1}if(this.preventDefault=!1,this.events[e]){var n=Array.prototype.slice.call(arguments,1),o=this;this.events[e].forEach(t)}},urlstringify:function(){var e={number:!0,string:!0,"boolean":!0},t=function(t){return typeof t in e?encodeURIComponent(""+t):""},n=function(e,n){return e=t(e),n.map(function(t){return o(e,t,!0)}).join("&")},o=function(e,n,o){return o||(e=t(e)),e+"="+t(n)};return function(e){return Object.keys(e).map(function(t){var i=e[t];return Array.isArray(i)?n(t,i):o(t,i)}).join("&")}}(),loadScript:function(e,t){var n=document.createElement("script");n.src=e,n.onload=t,document.head.appendChild(n)}};IO.decodehtmlEntities=function(){var e;e={quot:'"',amp:"&",apos:"'",lt:"<",gt:">",nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",fnof:"ƒ",circ:"ˆ",tilde:"˜",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",ensp:" ",emsp:" ",thinsp:" ",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",bull:"•",hellip:"…",permil:"‰",prime:"′",Prime:"″",lsaquo:"‹",rsaquo:"›",oline:"‾",frasl:"⁄",euro:"€",image:"ℑ",weierp:"℘",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪","int":"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦"};var t=/&(#x?)?[\w;]+?;/g,n=function(e){return e.slice(1).split(";").map(o).join("")},o=function(t){return"#"===t[0]?i(t):e[t]||t},i=function(e){e=e.slice(1);var t;return t="x"===e[0]?parseInt(e.slice(1),16):parseInt(e,10),String.fromCharCode(t)};return function(e){return e.replace(t,n)}}(),["in","out"].forEach(function(e){var t=e+"put";IO[e]={buffer:[],receive:function(e){return IO.fire("receive"+t,e),IO.preventDefault?this:(this.buffer.push(e),this)},tick:function(){return this.buffer.length&&IO.fire(t,this.buffer.shift()),this},flush:function(){if(IO.fire("before"+t),!this.buffer.length)return this;for(var e=this.buffer.length;e-->0;)this.tick();return IO.fire("after"+t),this.buffer=[],this}}}),IO.CBuffer=function(e){var t={items:[],pos:0,size:e};return t.add=function(t){this.pos===e&&(this.pos=0),this.items[this.pos]=t,this.pos+=1},t.contains=function(e){return this.items.indexOf(e)>-1},t},IO.xhr=function(e){e=Object.merge({method:"GET",headers:{},complete:function(){}},e),e.headers=Object.merge({"Content-Type":"application/x-www-form-urlencoded"},e.headers),"object"!=typeof e.data||e.data.charAt||(e.data=IO.urlstringify(e.data));var t=new XMLHttpRequest;return t.open(e.method,e.url),t.addEventListener("readystatechange",function(){4===t.readyState&&e.complete.call(e.thisArg,t.responseText,t)}),Object.iterate(e.headers,function(e,n){t.setRequestHeader(e,n)}),t.send(e.data),t},IO.jsonp=function(e){e.data=e.data||{},e.jsonpName=e.jsonpName||"jsonp";var t,n=document.createElement("script");do t="IO"+Date.now()*Math.ceil(Math.random());while(window[t]);window[t]=function(){e.fun.apply(e.thisArg,arguments),delete window[t],n.parentNode.removeChild(n)},e.data[e.jsonpName]=t,-1===e.url.indexOf("?")&&(e.url+="?"),e.url+=this.urlstringify(e.data),n.src=e.url,bot.log(n),document.head.appendChild(n)},IO.jsonp.ddg=function(e,t){IO.jsonp({url:"http://api.duckduckgo.com/",jsonpName:"callback",data:{format:"json",q:e},fun:t})},IO.jsonp.google=function(e,t){IO.jsonp({url:"http://ajax.googleapis.com/ajax/services/search/web",jsonpName:"callback",data:{v:"1.0",q:e},fun:t})},function(){"use strict";var e=window.bot={invocationPattern:"bot",customInvocationPatterns:{man:"quickref"},commandRegex:/^\/\s*([\w\-]+)(?:\s(.+))?$/,commands:{},commandDictionary:null,listeners:[],info:{invoked:0,learned:0,forgotten:0,start:new Date},users:users,parseMessage:function(t){if(this.preParseMessage(t),!this.validateMessage(t))return e.log(t,"parseMessage invalid"),void 0;var n=this.prepareMessage(t),o=n.get("user_id");if(e.log(n,"parseMessage valid"),this.banlist.contains(o))return e.log(t,"parseMessage banned"),this.banlist[o].told||(n.reply("You iz in mindjail"),this.banlist[o].told=!0),void 0;try{n.startsWith(">")?this.eval(n):n.startsWith("/")?this.parseCommand(n):this.callListeners(n)||n.reply(this.giveUpMessage(n))}catch(i){var r="Could not process input. Error: "+i.message;i.lineNumber&&(r+=" on line "+i.lineNumber),i.column&&(r+=" on column "+i.column),n.directreply(r),console.dir(i)}finally{this.info.invoked+=1}},giveUpMessage:function(e){var t="Y U NO MAEK SENSE!? Could not understand "+this.adapter.codify(e),n=e.trim().split(" ")[0],o=this.getCommand(n);return(!o.error||o.guesses.length)&&(t+=" (perhaps you meant to execute a command? If so, prepend the command name with a /)"),t},prepareMessage:function(e){e=this.adapter.transform(e);var t=IO.decodehtmlEntities(e.content);return this.Message(t.slice(this.invocationPattern.length).trim(),e)},parseCommand:function(t){e.log(t,"parseCommand input");var n=this.commandRegex.exec(t);if(!n)return t.reply("Invalid command "+t),void 0;e.log(n,"parseCommand matched");var o=n[1].toLowerCase(),i=this.getCommand(o);if(this.personality.check(o)&&this.personality.command(),i.error)return t.reply(i.error),void 0;if(!i.canUse(t.get("user_id")))return t.reply(["You do not have permission to use the command "+o,"I'm afraid I can't let you do that, "+t.get("user_name")].random()),void 0;e.log(i,"parseCommand calling");var r=this.Message(t.replace(/^\/\s*/,"").slice(o.length).trim(),t.get()),a=i.exec(r);a&&t.reply(a)},preParseMessage:function(e){var t=e.content.trim();for(var n in this.customInvocationPatterns)if(this.customInvocationPatterns.hasOwnProperty(n)&&t.startsWith(n))return e.content=t.replace(RegExp("^"+n+" ","gm"),this.invocationPattern+"/"+this.customInvocationPatterns[n]+" "),void 0},validateMessage:function(e){var t=e.content.trim();return t.startsWith(this.invocationPattern)},addCommand:function(e){e.exec&&e.del||(e=this.Command(e)),e.learned&&(this.info.learned+=1),e.invoked=0,this.commands[e.name]=e,this.commandDictionary.trie.add(e.name)},commandExists:function(e){return this.commands.hasOwnProperty(e)},getCommand:function(e){if(this.commandExists(e))return this.commands[e];this.commandDictionary.maxCost=Math.floor(e.length/5+1);var t="Command "+e+" does not exist.",n=this.commandDictionary.search(e);return n.length&&(t+=" Did you mean: "+n.join(", ")),{error:t,guesses:n}},listen:function(e,t,n){Array.isArray(e)?e.forEach(function(e){this.listen(e,t,n)},this):this.listeners.push({pattern:e,fun:t,thisArg:n})},callListeners:function(t){var n=!1;return this.listeners.forEach(function(o){var i,r=t.exec(o.pattern);r&&(i=o.fun.call(o.thisArg,t),e.log(r,i),i&&t.reply(i),n=i!==!1)}),n},stoplog:!1,log:function(){this.stoplog||console.log.apply(console,arguments)},stop:function(){this.stopped=!0},"continue":function(){this.stopped=!1}};e.eval=function(){function e(e){console.log(e,"eval answerObj");var n,o=e.answer,i=e.log;return n=t(o),i&&i.length&&(n+=" Logged: "+t(i)),n}function t(e){var t;return t=e.length>400?"`"+e.slice(0,400)+"` (snip)":"`"+e+"`"}window.URL=window.URL||window.webkitURL||window.mozURL||null;var n=atob("dmFyIGdsb2JhbCA9IHRoaXM7CgovKm1vc3QgZXh0cmEgZnVuY3Rpb25zIGNvdWxkIGJlIHBvc3NpYmx5IHVuc2FmZSovCnZhciB3aGl0ZXkgPSB7CgknQXJyYXknICAgICAgICAgICAgICA6IDEsCgknQm9vbGVhbicgICAgICAgICAgICA6IDEsCgknRGF0ZScgICAgICAgICAgICAgICA6IDEsCgknRXJyb3InICAgICAgICAgICAgICA6IDEsCgknRXZhbEVycm9yJyAgICAgICAgICA6IDEsCgknRnVuY3Rpb24nICAgICAgICAgICA6IDEsCgknSW5maW5pdHknICAgICAgICAgICA6IDEsCgknSlNPTicgICAgICAgICAgICAgICA6IDEsCgknTWF0aCcgICAgICAgICAgICAgICA6IDEsCgknTmFOJyAgICAgICAgICAgICAgICA6IDEsCgknTnVtYmVyJyAgICAgICAgICAgICA6IDEsCgknT2JqZWN0JyAgICAgICAgICAgICA6IDEsCgknUmFuZ2VFcnJvcicgICAgICAgICA6IDEsCgknUmVmZXJlbmNlRXJyb3InICAgICA6IDEsCgknUmVnRXhwJyAgICAgICAgICAgICA6IDEsCgknU3RyaW5nJyAgICAgICAgICAgICA6IDEsCgknU3ludGF4RXJyb3InICAgICAgICA6IDEsCgknVHlwZUVycm9yJyAgICAgICAgICA6IDEsCgknVVJJRXJyb3InICAgICAgICAgICA6IDEsCgknYXRvYicgICAgICAgICAgICAgICA6IDEsCgknYnRvYScgICAgICAgICAgICAgICA6IDEsCgknZGVjb2RlVVJJJyAgICAgICAgICA6IDEsCgknZGVjb2RlVVJJQ29tcG9uZW50JyA6IDEsCgknZW5jb2RlVVJJJyAgICAgICAgICA6IDEsCgknZW5jb2RlVVJJQ29tcG9uZW50JyA6IDEsCgknZXZhbCcgICAgICAgICAgICAgICA6IDEsCgknZ2xvYmFsJyAgICAgICAgICAgICA6IDEsCgknaXNGaW5pdGUnICAgICAgICAgICA6IDEsCgknaXNOYU4nICAgICAgICAgICAgICA6IDEsCgknb25tZXNzYWdlJyAgICAgICAgICA6IDEsCgkncGFyc2VGbG9hdCcgICAgICAgICA6IDEsCgkncGFyc2VJbnQnICAgICAgICAgICA6IDEsCgkncG9zdE1lc3NhZ2UnICAgICAgICA6IDEsCgknc2VsZicgICAgICAgICAgICAgICA6IDEsCgkndW5kZWZpbmVkJyAgICAgICAgICA6IDEsCgknd2hpdGV5JyAgICAgICAgICAgICA6IDEsCgoJLyogdHlwZWQgYXJyYXlzIGFuZCBzaGl0ICovCgknQXJyYXlCdWZmZXInICAgICAgIDogMSwKCSdCbG9iJyAgICAgICAgICAgICAgOiAxLAoJJ0Zsb2F0MzJBcnJheScgICAgICA6IDEsCgknRmxvYXQ2NEFycmF5JyAgICAgIDogMSwKCSdJbnQ4QXJyYXknICAgICAgICAgOiAxLAoJJ0ludDE2QXJyYXknICAgICAgICA6IDEsCgknSW50MzJBcnJheScgICAgICAgIDogMSwKCSdVaW50OEFycmF5JyAgICAgICAgOiAxLAoJJ1VpbnQxNkFycmF5JyAgICAgICA6IDEsCgknVWludDMyQXJyYXknICAgICAgIDogMSwKCSdVaW50OENsYW1wZWRBcnJheScgOiAxLAoKCS8qCgl0aGVzZSBwcm9wZXJ0aWVzIGFsbG93IEZGIHRvIGZ1bmN0aW9uLiB3aXRob3V0IHRoZW0sIGEgZnVja2Zlc3Qgb2YKCWluZXhwbGljYWJsZSBlcnJvcnMgZW51c2VzLiB0b29rIG1lIGFib3V0IDQgaG91cnMgdG8gdHJhY2sgdGhlc2UgZnVja2VycwoJZG93bi4KCWZ1Y2sgaGVsbCBpdCBpc24ndCBmdXR1cmUtcHJvb2YsIGJ1dCB0aGUgZXJyb3JzIHRocm93biBhcmUgdW5jYXRjaGFibGUKCWFuZCB1bnRyYWNhYmxlLiBzbyBhIGhlYWRzLXVwLiBlbmpveSwgZnV0dXJlLW1lIQoJKi8KCSdET01FeGNlcHRpb24nIDogMSwKCSdFdmVudCcgICAgICAgIDogMSwKCSdNZXNzYWdlRXZlbnQnIDogMQp9OwoKWyBnbG9iYWwsIGdsb2JhbC5fX3Byb3RvX18gXS5mb3JFYWNoKGZ1bmN0aW9uICggb2JqICkgewoJT2JqZWN0LmdldE93blByb3BlcnR5TmFtZXMoIG9iaiApLmZvckVhY2goZnVuY3Rpb24oIHByb3AgKSB7CgkJaWYoICF3aGl0ZXkuaGFzT3duUHJvcGVydHkoIHByb3AgKSApIHsKCQkJZGVsZXRlIG9ialsgcHJvcCBdOwoJCX0KCX0pOwp9KTsKCk9iamVjdC5kZWZpbmVQcm9wZXJ0eSggQXJyYXkucHJvdG90eXBlLCAnam9pbicsIHsKCXdyaXRhYmxlOiBmYWxzZSwKCWNvbmZpZ3VyYWJsZTogZmFsc2UsCgllbnVtcmFibGU6IGZhbHNlLAoKCXZhbHVlOiAoZnVuY3Rpb24gKCBvbGQgKSB7CgkJcmV0dXJuIGZ1bmN0aW9uICggYXJnICkgewoJCQlpZiAoIHRoaXMubGVuZ3RoID4gNTAwIHx8IChhcmcgJiYgYXJnLmxlbmd0aCA+IDUwMCkgKSB7CgkJCQl0aHJvdyAnRXhjZXB0aW9uOiB0b28gbWFueSBpdGVtcyc7CgkJCX0KCgkJCXJldHVybiBvbGQuYXBwbHkoIHRoaXMsIGFyZ3VtZW50cyApOwoJCX07Cgl9KCBBcnJheS5wcm90b3R5cGUuam9pbiApKQp9KTsKCihmdW5jdGlvbigpewoJInVzZSBzdHJpY3QiOwoKCXZhciBjb25zb2xlID0gewoJCV9pdGVtcyA6IFtdLAoJCWxvZyA6IGZ1bmN0aW9uKCkgewoJCQljb25zb2xlLl9pdGVtcy5wdXNoLmFwcGx5KCBjb25zb2xlLl9pdGVtcywgYXJndW1lbnRzICk7CgkJfQoJfTsKCXZhciBwID0gY29uc29sZS5sb2cuYmluZCggY29uc29sZSApOwoKCWZ1bmN0aW9uIGV4ZWMgKCBjb2RlICkgewoJCXZhciByZXN1bHQ7CgkJdHJ5IHsKCQkJcmVzdWx0ID0gZXZhbCggJyJ1c2Ugc3RyaWN0Ijt1bmRlZmluZWQ7XG4nICsgY29kZSApOwoJCX0KCQljYXRjaCAoIGUgKSB7CgkJCXJlc3VsdCA9IGUudG9TdHJpbmcoKTsKCQl9CgoJCXJldHVybiByZXN1bHQ7Cgl9CgoJZ2xvYmFsLm9ubWVzc2FnZSA9IGZ1bmN0aW9uICggZXZlbnQgKSB7CgkJdmFyIGpzb25TdHJpbmdpZnkgPSBKU09OLnN0cmluZ2lmeSwgLypiYWNrdXAqLwoJCQlyZXN1bHQgPSBleGVjKCBldmVudC5kYXRhICk7CgoJCS8qSlNPTiBkb2VzIG5vdCBsaWtlIGFueSBvZiB0aGUgZm9sbG93aW5nKi8KCQl2YXIgc3RydW5nID0gewoJCQlGdW5jdGlvbiAgOiB0cnVlLCBFcnJvciAgOiB0cnVlLAoJCQlVbmRlZmluZWQgOiB0cnVlLCBSZWdFeHAgOiB0cnVlCgkJfTsKCQl2YXIgc2hvdWxkX3N0cmluZyA9IGZ1bmN0aW9uICggdmFsdWUgKSB7CgkJCXZhciB0eXBlID0gKCB7fSApLnRvU3RyaW5nLmNhbGwoIHZhbHVlICkuc2xpY2UoIDgsIC0xICk7CgoJCQlpZiAoIHR5cGUgaW4gc3RydW5nICkgewoJCQkJcmV0dXJuIHRydWU7CgkJCX0KCQkJLypuZWl0aGVyIGRvZXMgaXQgZmVlbCBjb21wYXNzaW9uYXRlIGFib3V0IE5hTiBvciBJbmZpbml0eSovCgkJCXJldHVybiBpc05hTiggdmFsdWUgKSB8fCAhaXNGaW5pdGUoIHZhbHVlICk7CgkJfTsKCgkJdmFyIHJldml2ZXIgPSBmdW5jdGlvbiAoIGtleSwgdmFsdWUgKSB7CgkJCXZhciBvdXRwdXQ7CgoJCQlpZiAoIHNob3VsZF9zdHJpbmcodmFsdWUpICkgewoJCQkJb3V0cHV0ID0gJycgKyB2YWx1ZTsKCQkJfQoJCQllbHNlIHsKCQkJCW91dHB1dCA9IHZhbHVlOwoJCQl9CgoJCQlyZXR1cm4gb3V0cHV0OwoJCX07CgoJCXBvc3RNZXNzYWdlKHsKCQkJYW5zd2VyIDoganNvblN0cmluZ2lmeSggcmVzdWx0LCByZXZpdmVyICksCgkJCWxvZyAgICA6IGpzb25TdHJpbmdpZnkoIGNvbnNvbGUuX2l0ZW1zLCByZXZpdmVyICkuc2xpY2UoIDEsIC0xICkKCQl9KTsKCX07Cn0pKCk7Cg=="),o=new Blob([n],{type:"application/javascript"}),i=window.URL.createObjectURL(o);
return function(t){function n(e){clearTimeout(o),r.terminate(),t.directreply(e)}var o,r=new Worker(i);r.onmessage=function(t){n(e(t.data))},r.onerror=function(e){n(""+e)},r.postMessage(t.content.replace(/^>/,"")),o=window.setTimeout(function(){n("Maximum execution time exceeded")},100)}}(),localStorage.bot_ban="{}",e.banlist=JSON.parse(localStorage.bot_ban||"{}"),Array.isArray(e.banlist)&&(e.banlist=e.banlist.reduce(function(e,t){return e[t]={told:!1},e},{})),e.banlist.contains=function(e){return this.hasOwnProperty(e)},e.banlist.add=function(e){this[e]={told:!1},this.save()},e.banlist.remove=function(e){this.contains(e)&&(delete this[e],this.save())},e.banlist.save=function(){localStorage.bot_ban=JSON.stringify(this)},e.Command=function(t){return t.name=t.name.toLowerCase(),t.permissions=t.permissions||{},t.permissions.use=t.permissions.use||"ALL",t.permissions.del=t.permissions.del||"NONE",t.description=t.description||"",t.creator=t.creator||"God",t.invoked=0,["Use","Del"].forEach(function(e){var n=e.toLowerCase();t["can"+e]=function(e){var t=this.permissions[n];return"ALL"===t||"NONE"!==t&&t.indexOf(e)>-1}}),t.exec=function(){return this.invoked+=1,this.fun.apply(this.thisArg,arguments)},t.del=function(){e.info.forgotten+=1,delete e.commands[t.name]},t},e.CommunityCommand=function(t,n){function o(t){if(c.call(r,t))return!1;i();var o=Object.keys(a).length,s=n-o-1;return e.log(a,o,n),t in a?"Already registered; still need {0} more".supplant(s):s>0?(a[t]=new Date,"Registered; need {0} more to execute".supplant(s-1)):(e.log("should execute"),!1)}function i(){function e(e,n){return t>e[n]&&delete e[n],e}var t=new Date;t.setMinutes(t.getMinutes()-10),Object.keys(a).reduce(e,a)}var r=this.Command(t),a={},s=r.exec,c=r.canUse;return n=n||2,r.canUse=function(){return!0},r.exec=function(t){var n=o(t.get("user_id"));return n?(e.log(n),n):s.apply(r,arguments)},r},e.Message=function(t,n){var o=Object(t);o.content=t;var i={send:function(t){e.adapter.out.add(t,n.room_id)},reply:function(t){var o=e.adapter.reply(n.user_name);this.send(o+" "+t)},directreply:function(t){var o=e.adapter.directreply(n.message_id);this.send(o+" "+t)},parse:function(o,i){!!o===o&&(i=o,o=t);var r=e.parseCommandArgs(o||t);return i?r.map(function(t){return e.Message(t,n)}):r},exec:function(e){var n=e.exec(t);return this.matches=n?n:[],n},findUserid:function(t){t=t.toLowerCase();var n=Object.keys(e.users);return n.first(function(n){return e.users[n].name.toLowerCase()===t})||-1}.memoize(),codify:e.adapter.codify.bind(e.adapter),escape:e.adapter.escape.bind(e.adapter),link:e.adapter.link.bind(e.adapter),get:function(e){return e?n[e]:n},set:function(e,t){return n[e]=t}};return Object.keys(i).forEach(function(e){o[e]=i[e]}),o},e.owners=function(){function t(t){var n=e.users[t];return n.is_moderator||n.is_owner}return Object.keys(e.users).filter(t).map(Number)}(),e.isOwner=function(e){return this.owners.indexOf(e)>-1},IO.register("input",e.parseMessage,e),e.beatInterval=5e3,function t(){e.beat=setTimeout(function(){IO.fire("heartbeat"),t()},e.beatInterval)}(),Object.merge=function(){return[].reduce.call(arguments,function(e,t){return Object.keys(t).forEach(function(n){e[n]=t[n]}),e},{})},Object.iterate=function(e,t,n){Object.keys(e).forEach(function(o){t.call(n,o,e[o],e)})},String.prototype.indexesOf=function(e,t){for(var n=(t||0)-1,o=[];(n=this.indexOf(e,n+1))>-1;)o.push(n);return o},String.prototype.startsWith=function(e){return 0===this.indexOf(e)},Object.defineProperty(Array.prototype,"invoke",{value:function(e){function t(t){var o=t;return t[e]&&t[e].apply&&(o=t[e].apply(t,n)),o}var n=[].slice.call(arguments,1);return this.map(t)},configurable:!0,writable:!0}),Object.defineProperty(Array.prototype,"first",{value:function(e){return this.some(function(t){return e.apply(null,arguments)&&((e=t)||!0)})?e:null},configurable:!0,writable:!0}),Object.defineProperty(Array.prototype,"random",{value:function(){return this[Math.floor(Math.random()*this.length)]},configurable:!0,writable:!0}),Function.prototype.memoize=function(){var e=Object.create(null),t=this;return function(n){if(n in e)return e[n];var o=t.apply(null,arguments);return e[n]=o,o}},Function.prototype.memoizeAsync=function(e){var t=Object.create(null),n=this,e=e||function(e){return e};return function(){function o(){t[a]=arguments,r.apply(null,arguments)}var i=[].slice.call(arguments),r=i.pop(),a=e.apply(null,arguments);return a in t?(r.apply(null,t[a]),void 0):(i.push(o),n.apply(this,i),void 0)}},Number.prototype.maxDecimal=function(e){var t=Math.pow(10,e);return Math.floor(this*t)/t},Number.prototype.fallsAfter=function(e){e=e.slice();for(var t,n=e.shift(),o=this.valueOf(),i=0,r=e.length;r>i&&(t=e[i],!(t>o));i++)n=t;return o>=n?n:null},Math.ratio=function(e,t){e=Number(e),t=Number(t);var n=this.gcd(e,t);return e/n+":"+t/n},Math.gcd=function(e,t){return t?this.gcd(t,e%t):e},Math.rand=function(e,t){return e?t||(t=e,e=0):(e=0,t=9),Math.floor(Math.random()*(t-e+1))+e},String.prototype.supplant=function(e){function t(e,t){return n.hasOwnProperty(t)?n[t]:e}var n=Object(e)===e?e:arguments;return this.replace(/\{([^\}]+)\}/g,t)},Object.defineProperty(RegExp.prototype,"toJSON",{value:function(){return""+this},configurable:!0,writable:!0}),Date.timeSince=function(e,t){function n(e,t){return e=Math.floor(e),t+=1===e?"":"s",e+" "+t}t=t||new Date;for(var o,i=t-e,r=[{delta:31536e6,suffix:"year"},{delta:2592e6,suffix:"month"},{delta:864e5,suffix:"day"},{delta:36e5,suffix:"hour"},{delta:6e4,suffix:"minute"},{delta:1e3,suffix:"second"}];o=r.shift();)if(i>=o.delta)return n(i/o.delta,o.suffix);return n(i,"millisecond")},function(){var t;t=e!==void 0?e:"undefined"!=typeof exports?exports:window,t.parseCommandArgs=function(){var e=0,t=1,n=2,o=3,i="'",r='"',a={parse:function(t,n,o){this.source=t,this.pos=0,this.length=t.length,this.state=e,this.lookahead="",this.escaper=o||"~",this.separator=n||" ";var i=this.tokenize();return this.state!==e&&this.throwFinishError(),i},tokenize:function(){for(var e,t=[];this.length>this.pos;)e=this.nextArg(),e&&t.push(e);return t},nextArg:function(){var t,n="";for(this.state=e;;){if(t=this.nextChar(),null===t||this.state===o)break;n+=t}return n},nextChar:function(t){var n=this.lookahead=this.source[this.pos];return this.pos++,n?t?n:n===this.escaper?this.nextChar(!0):n===this.separator&&this.state===e?(this.state=o,n):this.string():null},string:function(){var e=this.lookahead;return e===i?this.singleQuotedString():e===r?this.doubleQuotedString():e},singleQuotedString:function(){return this.state===n?this.lookahead:(this.state=this.state!==t?t:e,this.nextChar())},doubleQuotedString:function(){return this.state===t?this.lookahead:(this.state=this.state!==n?n:e,this.nextChar())},throwFinishError:function(){var e="";this.state===t?e="Expected "+i:this.state===n&&(e="Expected "+r);var o=Error("Unexpected end of input: "+e);throw o.column=this.pos,o}};return function(){return a.parse.apply(a,arguments)}}()}();var n=function(){function e(){this.word=null,this.children={}}function t(n){if(!(this instanceof t))throw new TypeError("Illegal function call");if(n=Number(n),isNaN(n)||1>n)throw new TypeError("maxCost must be an integer > 1 ");this.maxCost=n,this.trie=new e}function n(e,t){var n,o,i,r=[];for(void 0===t?(i=0,o=e):(i=e,o=t-i),n=0;o>n;++n)r[n]=i++;return r}function o(e,t,o){var r=[],a=n(e.length+1);return Object.keys(o.children).forEach(function(n){i(o.children[n],n,e,a,r,t)}),r}function i(e,t,n,o,r,a){var s,c,u,m,l,p=n.length+1,d=[o[0]+1];for(s=1;p>s;++s)c=d[s-1]+1,u=o[s]+1,m=n.charAt(s-1)!==t?o[s-1]+1:o[s-1],d.push(Math.min(c,u,m));l=d[d.length-1],a>=l&&null!==e.word&&r.push([e.word,l]),a>=Math.min.apply(Math,d)&&Object.keys(e.children).forEach(function(t){i(e.children[t],t,n,d,r,a)})}return e.prototype.add=function(t){for(var n,o=this,i=0;n=t.charAt(i++);)n in o.children||(o.children[n]=new e),o=o.children[n];o.word=t},t.prototype={constructor:t,build:function(t){if(!Array.isArray(t))throw new TypeError("Cannot build a dictionary from "+t);this.trie=new e,t.forEach(function(e){this.trie.add(e)},this)},__sortfn:function(e,t){return e[1]-t[1]},search:function(e){e=e.valueOf();var t;if("string"!=typeof e)throw new TypeError("Cannot search "+e);if(void 0===this.trie)throw new TypeError("Cannot search, dictionary isn't built yet");return t=o(e,this.maxCost,this.trie),t.sort(this.__sortfn),t.map(function(e){return e[0]})}},t}();e.commandDictionary=new n(3),function(){var t={listen:function(t){return e.callListeners(t)||e.giveUpMessage(t)},eval:function(t){return e.eval(t)},live:function(){return e.stopped?(e.continue(),"And on this day, you shall paint eggs for a giant bunny."):"I'm not dead! Honest!"},die:function(){return e.stopped?"Kill me once, shame on you, kill me twice...":(e.stop(),"You killed me!")},refresh:function(){window.location.reload()},forget:function(t){var n=t.toLowerCase(),o=e.getCommand(n);return o.error?o.error:o.canDel(t.get("user_id"))?(o.del(),"Command "+n+" forgotten."):"You are not authorized to delete the command "+t},ban:function(t){function n(n){var i,r=Number(n);isNaN(r)&&(r=t.findUserid(n.replace(/^@/,""))),0>r?i="Cannot find user {0}.":e.isOwner(r)?i="Cannot mindjail owner {0}.":e.banlist.contains(r)?i="User {0} already in mindjail.":(e.banlist.add(r),i="User {0} added to mindjail."),o.push(i.supplant(n))}var o=[];return t.content?t.parse().forEach(n):o=Object.keys(e.banlist).filter(Number),o.join(" ")||"Nothing to show/do."},unban:function(t){function n(n){var i,r=Number(n);isNaN(r)&&(r=t.findUserid(n.replace(/^@/,""))),0>r?i="Cannot find user {0}.":e.banlist.contains(r)?(e.banlist.remove(r),i="User {0} freed from mindjail!"):i="User {0} isn't in mindjail.",o.push(i.supplant(n))}var o=[];return t.parse().forEach(n),o.join(" ")},info:function(t){function n(t){var n=e.getCommand(t);if(n.error)return n.error;var o="Command {name}, created by {creator}".supplant(n);return n.date&&(o+=" on "+n.date.toUTCString()),o+=n.invoked?", invoked "+n.invoked+" times":" but hasn't been used yet"}function o(){var e="I awoke on {0} (that's about {1} ago)",t=r.start.toUTCString(),n=Date.timeSince(r.start);return e.supplant(t,n)}function i(){var e=[],t="";return r.invoked&&e.push("got invoked "+r.invoked+" times"),r.learned&&(t="but ",e.push("learned "+r.learned+" commands")),r.forgotten&&e.push(t+"forgotten "+r.forgotten+" commands"),.15>Math.random()&&e.push("teleported "+Math.rand(100)+" goats"),e.join(", ")||"haven't done anything yet!"}if(t.content)return n(t.content);var r=e.info;return o()+", "+i()},jquery:function(){return"[GTFO](http://chat.stackoverflow.com/rooms/17/javascript)"},user:function(e){var t=e.parse(),n=t[0]||e.get("user_id"),o=n;return!/^\d+$/.test(n)&&(o=e.findUserid(n),0>o)?"Can't find user "+n+" in this chatroom.":(e.directreply("http://stackoverflow.com/users/"+o),void 0)},listcommands:function(t){var n=Object.keys(e.commands),o=/^(\d+|$)/.test(t.content),i=Number(t.content)||0,r=50,a=Math.ceil(Math.max(0,n.length)/r)-1;if(i>a||!o)return[t.codify("StackOverflow: Could not access page"),"This unicorn has killed itself because of you","Accordion to recent surveys, you suck"].random();var s=i*r,c=s+r,u=n.slice(s,c).join(", ");return u+" (page {0}/{1})".supplant(i,a)},purgecommands:function(t){function n(t){return e.commands[t]}function o(e){e.learned&&e.canDel(i)&&e.del()}var i=t.get("user_id");return Object.keys(e.commands).map(n).forEach(o),"The deed has been done."}};t.define=function(){var t=Object.create(null);return function(n,o){function i(o){var i=o.AbstractURL,a=o.AbstractText;e.log(i,a,"/define finishCall input"),"Merriam-Webster"===o.AbstractSource&&(a=a.replace(n+" definition: ",""),e.log(a,"/define finishCall webster")),a?(a=n+": "+a,a+=" [\\(source\\)]("+i+")",t[n]=a):(a="Could not find definition for "+n+". Trying Urban Dictionary",e.getCommand("urban").exec(n)),e.log(a,"/define finishCall output"),r(a)}function r(e){o&&o.call?o(e):n.directreply(e)}return t[n]?r(t[n]):(IO.jsonp.ddg("define "+(""+n),i),void 0)}}(),t.define.async=!0,t.urban=function(){var e=Object.create(null);return function(t,n){function o(n){var o;o="no_results"===n.result_type?"Y U NO MAEK SENSE!!!???!!?11 No results for "+t:r(n.list[0]),e[t]=o,i(o)}function i(e){n&&n.call?n(e):t.reply(e)}function r(e){var n=e.definition.replace(/\[(\w+)\]/g,a);return t.link(e.word,e.permalink)+" "+n}function a(e,n){var o="http://urbandictionary.com/define.php?term="+encodeURIComponent(n);return t.link(e,o)}return t.length?e[t]?i(e[t]):(IO.jsonp({url:"http://api.urbandictionary.com/v0/define",data:{term:t.content},jsonpName:"callback",fun:o}),void 0):"Y U NO PROVIDE ARGUMENTS!?"}}(),t.urban.async=!0,t.parse=function(){var t={who:function(){return[].pop.call(arguments).get("user_name")},someone:function(){var e=document.getElementById("sidebar").getElementsByClassName("present-user"),t=[].filter.call(e,function(e){return Number(e.style.opacity)>=.5}),n=t[Math.floor(Math.random()*(t.length-1))];return n?n.getElementsByTagName("img")[0].title:"Nobody! I'm all alone :("},digit:function(){return Math.floor(10*Math.random())},encode:function(e){return encodeURIComponent(e)},rand:function(e,t){return e=Number(e),t=Number(t),Math.rand(e,t)}},n=/(?:.|^)\$(\w+)(?:\((.*?)\))?/g;return function o(i,r){function a(t,n,o){if(t.startsWith("$$"))return t.slice(1);var i="";"$"!==t[0]&&(i=t[0]);var r=c(n);return r?(e.log(r,n,o,"/parse replaceMacro"),i+=r.apply?r.apply(null,s(o)):r):n}function s(t){return e.log(t,"/parse parseMacroArgs"),t?o(t,r).split(",").invoke("trim").concat(i):[]}function c(n){function o(e){return e.hasOwnProperty(n)}var a=e.users[i.get("user_id")],s=[t,u,a,r].first(o);return(s||{})[n]}var u=i.get&&i.get()||{};return r=r||{},e.log(i,r,"/parse input"),i.replace(n,a)}}(),t.tell=function(){var t={tell:!0,forget:!0};return function(n){function o(e){e&&(c?l.directreply(e):l.reply(e))}var i=n.parse();e.log(n.valueOf(),i,"/tell input");var r,a=i[0],s=i[1];if(!a||!s)return"Invalid /tell arguments. Use /help for usage info";if(s=s.toLowerCase(),r=e.getCommand(s),!r.error){if(t.hasOwnProperty(s))return"Command "+s+" cannot be used in /tell.";if(!r.canUse(n.get("user_id")))return"You do not have permission to use command "+s;if(/^@/.test(a))return"Don't be annoying, drop the @, nobody likes a double-ping.";var c=!1,u={};/^:?\d+$/.test(a)?(u.message_id=a.replace(/^:/,""),c=!0):u.user_name=a;var m=Object.merge(n.get(),u),l=e.Message(n.slice(a.length+s.length+2).trim(),m);e.log(l,"/tell calling "+s),r.async?r.exec(l,o):o(r.exec(l))}}}(),t.mdn=function(t,n){function o(t){if(200!==t.responseStatus)return i("Something went on fire; status "+t.responseStatus),void 0;var n=t.responseData.results[0];e.log(n,"/mdn result"),i(n.url)}function i(e){n&&n.call?n(e):t.reply(e)}IO.jsonp.google(""+t+" site:developer.mozilla.org",o)},t.mdn.async=!0;var n={ban:"Bans user(s) from using me. Lacking arguments, prints the banlist. `/ban [usr_id|usr_name, [...]`",choose:'"Randomly" choose an option given. `/choose option0 option1 ...`',define:"Fetches definition for a given word. `/define something`",die:"Kills me :(",eval:"Forwards message to javascript code-eval",forget:"Forgets a given command. `/forget cmdName`",get:"Grabs a question/answer link (see online for thorough explanation)",help:"Fetches documentation for given command, or general help article. `/help [cmdName]`",info:"Grabs some stats on my current instance or a command. `/info [cmdName]`",jquery:"Fetches documentation link from jQuery API. `/jquery what`",listcommands:"Lists commands. `/listcommands [page=0]`",listen:"Forwards the message to my ears (as if called without the /)",live:"Resurrects me (:D) if I'm down",mdn:"Fetches mdn documentation. `/mdn what`",norris:"Random chuck norris joke!",parse:'Returns result of "parsing" message according to the my mini-macro capabilities (see online docs)',purgecommands:"Deletes all user-taught commands.",refresh:"Reloads the browser window I live in",regex:"Executes a regex against text input. `/regex text regex [flags]`",tell:"Redirect command result to user/message. /tell `msg_id|usr_name cmdName [cmdArgs]`",unban:"Removes a user from my mindjail. `/unban usr_id|usr_name`",urban:"Fetches UrbanDictionary definition. `/urban something`",user:"Fetches user-link for specified user. `/user usr_id|usr_name`"},o={die:!0,live:!0,ban:!0,unban:!0,refresh:!0,purgecommands:!0},i={die:!0,ban:!0};Object.iterate(t,function(r,a){var s={name:r,fun:a,permissions:{del:"NONE",use:o[r]?e.owners:"ALL"},description:n[r],async:t[r].async};i[r]&&(s=e.CommunityCommand(s)),e.addCommand(s)})}(),function(){e.listen(/^help(?: (\S+))?/,function(t){return e.getCommand("help").exec(t.matches[1])});var t=["A robot may not injure a human being or, through inaction, allow a human being to come to harm.","A robot must obey the orders given to it by human beings, except where such orders would conflict with the First Law.","A robot must protect its own existence as long as such protection does not conflict with the First or Second Laws."].map(function(e,t){return t+". "+e}).join("\n");e.listen(/^tell (me (your|the) )?(rule|law)s/,function(){return t}),e.listen(/^give (.+?) a lick/,function(e){var t,n=e.matches[1];return"me"===n?(n="you",t=""):"yourself"===n?(n="I",t=""):t="s","Mmmm! "+n+" taste"+t+" just like raisin"});var n=[/^what(?:'s|'re)?\s(?:(?:is|are)\s)?(?:(?:an|a)\s)?([\w\s\-]+)\??/,/^define\s(?:(?:an|a)\s)?([\w\s\-]+)/];e.listen(n,function(t){var n=t.matches[1],o=e.getCommand("define");o.exec(n,function(e){e=e.replace(n+":",""),t.reply(e)})})}()}(),bot.personality={bitchiness:0,thanks:{0:["You kiss-ass"],.5:["Thank you for noticing","teehee"],1:["Took you long enough","My pleasure","Don't mention it"]},apologies:{0:["What for?"],.5:["It was nothing...","No worries"],1:["You're forgiven. For now. Don't push it."]},stuff:{0:["Life is just *perfect*","What's there to bitch about, as long as I have *you*..."],1:["Oh don't mind me, that isn't difficult at all..."],1.2:["You don't appreciate me enough. Not that I need to be thanked.."],1.3:['The occasional "thanks" or "I\'m sorry" would be nice...'],2:["*sigh* Remember laughter? I don't. You ripped it out of me. Heartless bastard."]},insanity:{},okayCommands:{hangman:!0,help:!0},check:function(e){return!this.okayCommands.hasOwnProperty(e)},bitch:function(){return this.getResp(this.stuff)},command:function(){this.bitchiness+=this.getDB()},thank:function(){return this.unbitch(this.thanks)},apologize:function(){return this.unbitch(this.apologies)},unbitch:function(e,t){var n=this.getResp(e);return this.bitchiness-=t||this.bitchiness,n},getResp:function(e){return e[this.bitchiness.fallsAfter(Object.keys(e).map(Number).sort())].random()},isABitch:function(){return this.bitchiness>=1},looksLikeABitch:function(){return!1},getDB:function(){return this.isThatTimeOfTheMonth()?.075:.025},isThatTimeOfTheMonth:function(){var e=(new Date).getDate();return 2>e||e>27}},bot.listen(/thank(s| you)/,bot.personality.thank,bot.personality),bot.listen(/sorry/,bot.personality.apologize,bot.personality),bot.listen(/bitch/,bot.personality.bitch,bot.personality),function(){var e="[{text}]({url})";bot.adapter={roomid:null,fkey:null,site:null,init:function(){var e=document.getElementById("fkey");return e?(this.fkey=e.value,this.roomid=/\d+/.exec(location)[0],this.site=/chat\.(\w+)/.exec(location)[1],this.in.init(),this.out.init(),void 0):(console.error("bot.adapter could not find fkey; aborting"),void 0)},transform:function(e){return e},escape:function(e){return e.replace(/([`\*_\(\)\[\]])/g,"\\$1")},reply:function(e){return"@"+e.replace(/\s/g,"")},directreply:function(e){return":"+e},codify:function(e){var t=" ",n=e.replace(" ",t),o=n.split(/[\r\n]/g);return 1===o.length?"`"+o[0]+"`":o.map(function(e){return t+e}).join("\n")},link:function(t,n){return e.supplant({text:this.escape(t),url:n})}};var t=bot.adapter.in={times:{},lastTimes:{},interval:5e3,init:function(){function e(e){e=JSON.parse(e),bot.log(e),t.openSocket(e.url)}var t=this,n=bot.adapter.roomid;IO.xhr({url:"/ws-auth",data:fkey({roomid:n}),method:"POST",complete:e})},openSocket:function(e){var t=this.socket=new WebSocket(e+"?l=99999999999");t.onmessage=this.ondata.bind(this)},ondata:function(e){this.pollComplete(e.data)},pollComplete:function(e){e&&(e=JSON.parse(e),Object.iterate(e,function(e,t){t.t&&(this.times[e]=t.t),t.e&&t.e.forEach(this.handleMessageObject,this)},this),IO.in.flush())},handleMessageObject:function(e){return 1===e.event_type||2===e.event_type?(this.lastTimes[e.room_id]=Date.now(),e.content.startsWith("<div class='full'>")?(this.handleMultilineMessage(e),void 0):(IO.in.receive(e),void 0)):void 0},handleMultilineMessage:function(e){var t=e.content.slice(0,e.content.lastIndexOf("</div>")).replace("<div class='full'>","");t.split("<br>").forEach(function(t){this.handleMessageObject(Object.merge(e,{content:t.trim()}))},this)}},n=bot.adapter.out={interval:t.interval+500,messages:{},init:function(){this.loopage()},add:function(e,t){t=t||bot.adapter.roomid,IO.out.receive({text:e+"\n",room:t})},build:function(e){this.messages[e.room]||(this.messages[e.room]=""),this.messages[e.room]+=e.text},send:function(){bot.stopped||Object.iterate(this.messages,function(e,t){t&&this.sendToRoom(t,e)},this),this.messages={}},sendToRoom:function(e,t){function o(o,i){bot.log(i.status),409===i.status?n.add(e,t):500===i.status?n.add("Server error (status 500) occured (message probably too long)",t):200!==i.status?(console.error(i),n.add("Error "+i.status+" occured, I will call the maid "+" (@Zirak)")):IO.fire("sendoutput",i,e,t)}IO.xhr({url:"/chats/"+t+"/messages/new",data:{text:e,fkey:fkey().fkey},method:"POST",complete:o})},loopage:function(){var e=this;setTimeout(function(){IO.out.flush(),e.loopage()},this.interval)}};IO.register("output",n.build,n),IO.register("afteroutput",n.send,n),bot.adapter.init()}(),function(){function e(e){function o(t){t?(bot.log(t,"/beautify beautifying"),e.send(e.codify(a[c](t)))):(bot.log("/beautify not found"),e.reply(r.supplant(u)))}var i=e.parse(),s=i.shift(),c=(i.shift()||"js").toLowerCase();if(bot.log(s,c,"/beautify input"),!a.hasOwnProperty(c))return"Unrecognized language {0}. Options: {1}".supplant(c,Object.keys(a).join(", "));var u=Number(n(s,e));return 0>u?r.supplant(u):(t(u,o),void 0)}function t(e,t){function n(e){e="\r"===e[0]?null:IO.decodehtmlEntities(e),t(e)}IO.xhr({method:"GET",url:"/message/"+e,data:{plain:!0},complete:n})}function n(e,t){if(/^\d+$/.test(e))return e;bot.log(e,"/beautify fetch_message_id");var n=o(t.findUserid(e));return n?/\d+/.exec(n.id)[0]:-1}function o(e){function t(e){return/\bmonologue\b/.test(e.className)}var n=[].filter.call(document.getElementsByClassName("user-"+e),t).pop();return n?[].pop.call(n.getElementsByClassName("message")):void 0}var i="Fetches and beautifies a message containing html, css or js. `/beautify msgid [lang=js]`",r="Message {0} not found",a={js:js_beautify,css:css_beautify,html:style_html};bot.addCommand({name:"beautify",fun:e,permission:{del:"NONE"},description:i})}(),"undefined"!=typeof exports&&(exports.js_beautify=js_beautify),"undefined"!=typeof exports&&(exports.css_beautify=css_beautify),function(){"use strict";function e(){return Object.keys(t).concat(Object.keys(n))}var t={C:function(e){return{F:1.8*e+32,K:e+273.15}},F:function(e){return{C:(e-32)/1.8,K:5*(e+459.67)/9}},K:function(e){return 0>e?null:{C:e-273.15,F:1.8*e-459.67}},m:function(e){return{f:3.280839895*e}},f:function(e){var t=e/3.28083989;return t>1e3?{km:t/1e3}:.01>t?{mm:1e3*t}:{m:e/3.28083989}},km:function(e){return t.m(1e3*e)},mm:function(e){return t.m(e/1e3)},i:function(e){return t.f(e/12)},d:function(e){return{r:180*e/Math.PI}},r:function(e){return{d:e*Math.PI/180}},g:function(e){return{lb:.0022*e}},lb:function(e){var t=453.592*e;return t>1e3?{kg:t/1e3}:{g:453.592*e}},kg:function(e){return t.g(1e3*e)}},n={lbs:"lb"},o=/(-?\d+\.?\d*)\s*([^\s]+)/,i=function(i){function r(e){return u[e].maxDecimal(4)+e}if(bot.log(i,"/convert input"),"list"==""+i)return e().join(", ");var a=o.exec(i),s=Number(a[1]),c=a[2];if(bot.log(a,"/convert broken"),n[c]&&(c=n[c]),!t[c])return"Confuse converter with "+c+", receive error message";var u=t[c](s);return bot.log(u,"/console answer"),Object.keys(u).map(r).join(", ")};bot.addCommand({name:"convert",fun:i,permissions:{del:"NONE"},description:"Converts several units, case sensitive. `/convert <num><unit>` Pass in list for supported units `/convert list`"})}(),function(){function e(e,o){function i(t){if(t.error_message)return e.reply(t.error_message),void 0;var i,a=[].concat(n[u](t.items));bot.log(a.slice(),"/get parseResponse parsing"),i=a.length?r(a):"User did not submit any "+c,bot.log(i,"/get parseResponse parsed"),o&&o.call?o(i):e.directreply(i)}function r(e){return e.map(function(e){return e.link}).join(" ; ")}var a=e.parse(),s=a[0]||"answer",c=s+"s",u=a[1]||"last",m=a[2];if("between"===u&&(m=a[4]),m||isNaN(u)||(m=u,u="last"),m||(m=e.get("user_id")),bot.log(a,"get input"),!t.hasOwnProperty(s))return'Invalid "getter" name '+s;if(!n.hasOwnProperty(u))return"Invalid range specifier "+u;var l="http://api.stackexchange.com/2.1/users/"+m+"/"+c,p={site:bot.adapter.site,sort:"creation",filter:"!BGS1(RNaKd_71l)9SkX3zg.ifSRSSy"};bot.log(l,p,"/get building url"),"between"===u&&(p.fromdate=Date.parse(a[2]),p.todate=Date.parse(a[3]),bot.log(l,p,"/get building url between")),IO.jsonp({url:l,data:p,fun:i})}var t={answer:!0,question:!0},n={first:function(e){return e[e.length-1]},last:function(e){return e[0]},between:function(e){return e}};bot.addCommand({name:"get",fun:e,permissions:{del:"NONE"},async:!0})}(),function(){function e(e,n){function o(n){if(bot.log(n,"/google response"),200!==n.responseStatus)return s("My Google-Fu is on vacation; status "+n.responseStatus),void 0;var o=n.responseData.results.slice(0,3);return bot.log(o,"/google results"),o.length?(s(i(e.content,o)),void 0):(s(t.random()),void 0)}function i(e,t){return a(e)+" "+t.map(r).join(" ; ")}function r(t){var n=IO.decodehtmlEntities(t.titleNoFormatting);return e.link(n,t.url)}function a(t){return e.link("*","http://google.com/search?q="+encodeURIComponent(t))}function s(t){bot.log(t,"/google final"),n&&n.call?n(t):e.reply(t)}IO.jsonp.google(""+e+" -site:w3schools.com",o)}var t=["The Google contains no such knowledge","There are no search results. Run.","My Google Fu has failed."];bot.addCommand({name:"google",fun:e,permissions:{del:"NONE"},description:"Search Google. `/google query`",async:!0})}(),function(){"use strict";function e(e){bot.log(e,"/learn input");var n=e.parse(),i={name:n[0],output:n[1],input:n[2]||".*",creator:e.get("user_name"),date:new Date};i.description=["User-taught command:",n[3]||"",e.codify(i.output)].join(" ");var a=o(i);return a?a:(i.name=i.name.toLowerCase(),i.input=RegExp(i.input),bot.log(i,"/learn parsed"),t(i),r(i),"Command "+i.name+" learned")}function t(e){var t=bot.Command({name:e.name,description:e.description,creator:e.creator,date:e.date,fun:n(e),permissions:{use:"ALL",del:"ALL"}});t.learned=!0,t.del=function(n){return function(){a(e.name),n.call(t)}}(t.del),bot.log(t,"/learn addCustomCommand"),bot.addCommand(t)}function n(e){return bot.log(e,"/learn makeCustomCommand"),function(t){bot.log(t,e.name+" input");var n=bot.Message(e.output,t.get());return s.exec(n,e.input.exec(t))}}function o(e){var t,n=Object.keys(e).some(function(t){return!e[t]});return n?t="Illegal /learn object; see `/help learn`":/^[\w\-]+$/.test(e.name)?bot.commandExists(e.name.toLowerCase())&&(t="Command "+e.name+" already exists"):t="Invalid command name",t}function i(){function e(e,o){o=JSON.parse(o),o.input=n(o.input),o.date=new Date(Date.parse(o.date)),bot.log(o,"/learn loadCommands"),t(o)}function n(e){var t=(""+e).split("/");return RegExp(t.slice(1,-1).join("/"),t[t.length-1])}Object.iterate(c,e)}function r(e){c[e.name]=JSON.stringify(e),localStorage.bot_learn=JSON.stringify(c)}function a(e){delete c[e],localStorage.bot_learn=JSON.stringify(c)}var s=bot.getCommand("parse"),c=JSON.parse(localStorage.bot_learn||"{}");bot.addCommand({name:"learn",fun:e,privileges:{del:"NONE"},description:"Teaches me a command. `/learn cmdName outputPattern [inputRegex [description]]`"}),i()}(),function(){function e(){Date.now(),r=r.filter(function(e){return e.time-=a,0>=e.time?(t(e),!1):!0}),setTimeout(e,a)}function t(e){bot.log(e,"nudge fire"),e.msg.reply(e.message)}function n(e,t,n){var o;if(bot.log(e,t,"/nudge input"),e=parseFloat(e),o=6e4*e,isNaN(o))return"Many things can be labeled Not a Number; a delay should not be one of them.";var i={msg:n,message:"*nudge* "+t,register:Date.now(),time:o};return r.push(i),bot.log(i,r,"/nudge register"),"Nudge registered."}function o(e){var t=e.parse();return n(t[0],t.slice(1).join(" "),e)}function i(e){return n(e.matches[1],e.matches[2],e)}var r=[],a=6e3;setTimeout(e,a),bot.addCommand({name:"nudge",fun:o,permissions:{del:"NONE"},description:"Register a nudge after an interval. `/nudge intervalInMinutes message`, or the listener, `nudge|remind|poke me? in? intervalInMinutes message`"}),bot.listen(/(?:nudge|remind|poke)\s(?:me\s)?(?:in\s)?(\d+m?)\s?(.*)$/,i)}(),function(){function e(e){function t(e){return bot.log(e,"/quickref response"),bot.log(e,"/quickref results"),e?(n(e),void 0):(n("Not found in the quick reference"),void 0)}function n(t){bot.log(t,"/quickref final"),e.reply(t.result)}IO.jsonp({url:"http://jsonp.pieterhordijk.com",jsonpName:"callback",data:{q:""+e},fun:t})}bot.addCommand({name:"quickref",fun:e,permissions:{del:"NONE"},description:"Search the Quick reference. `/quickref query`",async:!0})}(),function(){function e(e){function n(e){return e.name.toLowerCase().indexOf(r)>-1}function o(t){var n=e.escape(t.name);return"["+n+"](http://es5.github.com/#"+t.section+")"}var i,r=e.content.toLowerCase();return i=t.filter(n).map(o),bot.log(i,"/spec done"),i.length?i.join(", "):e+" not found in spec"}var t;t=[{section:"introduction",name:"Introduction"},{section:"x1",name:"1 Scope"},{section:"x2",name:"2 Conformance"},{section:"x3",name:"3 Normative references"},{section:"x4",name:"4 Overview"},{section:"x4.1",name:"4.1 Web Scripting"},{section:"x4.2",name:"4.2 Language Overview"},{section:"x4.2.1",name:"4.2.1 Objects"},{section:"x4.2.2",name:"4.2.2 The Strict Variant of ECMAScript"},{section:"x4.3",name:"4.3 Definitions"},{section:"x4.3.1",name:"4.3.1 type"},{section:"x4.3.2",name:"4.3.2 primitive value"},{section:"x4.3.3",name:"4.3.3 object"},{section:"x4.3.4",name:"4.3.4 constructor"},{section:"x4.3.5",name:"4.3.5 prototype"},{section:"x4.3.6",name:"4.3.6 native object"},{section:"x4.3.7",name:"4.3.7 built-in object"},{section:"x4.3.8",name:"4.3.8 host object"},{section:"x4.3.9",name:"4.3.9 undefined value"},{section:"x4.3.10",name:"4.3.10 Undefined type"},{section:"x4.3.11",name:"4.3.11 null value"},{section:"x4.3.12",name:"4.3.12 Null type"},{section:"x4.3.13",name:"4.3.13 Boolean value"},{section:"x4.3.14",name:"4.3.14 Boolean type"},{section:"x4.3.15",name:"4.3.15 Boolean object"},{section:"x4.3.16",name:"4.3.16 String value"},{section:"x4.3.17",name:"4.3.17 String type"},{section:"x4.3.18",name:"4.3.18 String object"},{section:"x4.3.19",name:"4.3.19 Number value"},{section:"x4.3.20",name:"4.3.20 Number type"},{section:"x4.3.21",name:"4.3.21 Number object"},{section:"x4.3.22",name:"4.3.22 Infinity"},{section:"x4.3.23",name:"4.3.23 NaN"},{section:"x4.3.24",name:"4.3.24 function"},{section:"x4.3.25",name:"4.3.25 built-in function"},{section:"x4.3.26",name:"4.3.26 property"},{section:"x4.3.27",name:"4.3.27 method"},{section:"x4.3.28",name:"4.3.28 built-in method"},{section:"x4.3.29",name:"4.3.29 attribute"},{section:"x4.3.30",name:"4.3.30 own property"},{section:"x4.3.31",name:"4.3.31 inherited property"},{section:"x5",name:"5 Notational Conventions"},{section:"x5.1",name:"5.1 Syntactic and Lexical Grammars"},{section:"x5.1.1",name:"5.1.1 Context-Free Grammars"},{section:"x5.1.2",name:"5.1.2 The Lexical and RegExp Grammars"},{section:"x5.1.3",name:"5.1.3 The Numeric String Grammar"},{section:"x5.1.4",name:"5.1.4 The Syntactic Grammar"},{section:"x5.1.5",name:"5.1.5 The JSON Grammar"},{section:"x5.1.6",name:"5.1.6 Grammar Notation"},{section:"x5.2",name:"5.2 Algorithm Conventions"},{section:"x6",name:"6 Source Text"},{section:"x7",name:"7 Lexical Conventions"},{section:"x7.1",name:"7.1 Unicode Format-Control Characters"},{section:"x7.2",name:"7.2 White Space"},{section:"x7.3",name:"7.3 Line Terminators"},{section:"x7.4",name:"7.4 Comments"},{section:"x7.5",name:"7.5 Tokens"},{section:"x7.6",name:"7.6 Identifier Names and Identifiers"},{section:"x7.6.1",name:"7.6.1 Reserved Words"},{section:"x7.6.1.1",name:"7.6.1.1 Keywords"},{section:"x7.6.1.2",name:"7.6.1.2 Future Reserved Words"},{section:"x7.7",name:"7.7 Punctuators"},{section:"x7.8",name:"7.8 Literals"},{section:"x7.8.1",name:"7.8.1 Null Literals"},{section:"x7.8.2",name:"7.8.2 Boolean Literals"},{section:"x7.8.3",name:"7.8.3 Numeric Literals"},{section:"x7.8.4",name:"7.8.4 String Literals"},{section:"x7.8.5",name:"7.8.5 Regular Expression Literals"},{section:"x7.9",name:"7.9 Automatic Semicolon Insertion"},{section:"x7.9.1",name:"7.9.1 Rules of Automatic Semicolon Insertion"},{section:"x7.9.2",name:"7.9.2 Examples of Automatic Semicolon Insertion"},{section:"x8",name:"8 Types"},{section:"x8.1",name:"8.1 The Undefined Type"},{section:"x8.2",name:"8.2 The Null Type"},{section:"x8.3",name:"8.3 The Boolean Type"},{section:"x8.4",name:"8.4 The String Type"},{section:"x8.5",name:"8.5 The Number Type"},{section:"x8.6",name:"8.6 The Object Type"},{section:"x8.6.1",name:"8.6.1 Property Attributes"},{section:"x8.6.2",name:"8.6.2 Object Internal Properties and Methods"},{section:"x8.7",name:"8.7 The Reference Specification Type"},{section:"x8.7.1",name:"8.7.1 GetValue (V)"},{section:"x8.7.2",name:"8.7.2 PutValue (V, W)"},{section:"x8.8",name:"8.8 The List Specification Type"},{section:"x8.9",name:"8.9 The Completion Specification Type"},{section:"x8.10",name:"8.10 The Property Descriptor and Property Identifier Specification Types"},{section:"x8.10.1",name:"8.10.1 IsAccessorDescriptor ( Desc )"},{section:"x8.10.2",name:"8.10.2 IsDataDescriptor ( Desc )"},{section:"x8.10.3",name:"8.10.3 IsGenericDescriptor ( Desc )"},{section:"x8.10.4",name:"8.10.4 FromPropertyDescriptor ( Desc )"},{section:"x8.10.5",name:"8.10.5 ToPropertyDescriptor ( Obj )"},{section:"x8.11",name:"8.11 The Lexical Environment and Environment Record Specification Types"},{section:"x8.12",name:"8.12 Algorithms for Object Internal Methods"},{section:"x8.12.1",name:"8.12.1 [[GetOwnProperty]] (P)"},{section:"x8.12.2",name:"8.12.2 [[GetProperty]] (P)"},{section:"x8.12.3",name:"8.12.3 [[Get]] (P)"},{section:"x8.12.4",name:"8.12.4 [[CanPut]] (P)"},{section:"x8.12.5",name:"8.12.5 [[Put]] ( P, V, Throw )"},{section:"x8.12.6",name:"8.12.6 [[HasProperty]] (P)"},{section:"x8.12.7",name:"8.12.7 [[Delete]] (P, Throw)"},{section:"x8.12.8",name:"8.12.8 [[DefaultValue]] (hint)"},{section:"x8.12.9",name:"8.12.9 [[DefineOwnProperty]] (P, Desc, Throw)"},{section:"x9",name:"9 Type Conversion and Testing"},{section:"x9.1",name:"9.1 ToPrimitive"},{section:"x9.2",name:"9.2 ToBoolean"},{section:"x9.3",name:"9.3 ToNumber"},{section:"x9.3.1",name:"9.3.1 ToNumber Applied to the String Type"},{section:"x9.4",name:"9.4 ToInteger"},{section:"x9.5",name:"9.5 ToInt32: (Signed 32 Bit Integer)"},{section:"x9.6",name:"9.6 ToUint32: (Unsigned 32 Bit Integer)"},{section:"x9.7",name:"9.7 ToUint16: (Unsigned 16 Bit Integer)"},{section:"x9.8",name:"9.8 ToString"},{section:"x9.8.1",name:"9.8.1 ToString Applied to the Number Type"},{section:"x9.9",name:"9.9 ToObject"},{section:"x9.10",name:"9.10 CheckObjectCoercible"},{section:"x9.11",name:"9.11 IsCallable"},{section:"x9.12",name:"9.12 The SameValue Algorithm"},{section:"x10",name:"10 Executable Code and Execution Contexts"},{section:"x10.1",name:"10.1 Types of Executable Code"},{section:"x10.1.1",name:"10.1.1 Strict Mode Code"},{section:"x10.2",name:"10.2 Lexical Environments"},{section:"x10.2.1",name:"10.2.1 Environment Records"},{section:"x10.2.1.1",name:"10.2.1.1 Declarative Environment Records"},{section:"x10.2.1.1.1",name:"10.2.1.1.1 HasBinding(N)"},{section:"x10.2.1.1.2",name:"10.2.1.1.2 CreateMutableBinding (N, D)"},{section:"x10.2.1.1.3",name:"10.2.1.1.3 SetMutableBinding (N,V,S)"},{section:"x10.2.1.1.4",name:"10.2.1.1.4 GetBindingValue(N,S)"},{section:"x10.2.1.1.5",name:"10.2.1.1.5 DeleteBinding (N)"},{section:"x10.2.1.1.6",name:"10.2.1.1.6 ImplicitThisValue()"},{section:"x10.2.1.1.7",name:"10.2.1.1.7 CreateImmutableBinding (N)"},{section:"x10.2.1.1.8",name:"10.2.1.1.8 InitializeImmutableBinding (N,V)"},{section:"x10.2.1.2",name:"10.2.1.2 Object Environment Records"},{section:"x10.2.1.2.1",name:"10.2.1.2.1 HasBinding(N)"},{section:"x10.2.1.2.2",name:"10.2.1.2.2 CreateMutableBinding (N, D)"},{section:"x10.2.1.2.3",name:"10.2.1.2.3 SetMutableBinding (N,V,S)"},{section:"x10.2.1.2.4",name:"10.2.1.2.4 GetBindingValue(N,S)"},{section:"x10.2.1.2.5",name:"10.2.1.2.5 DeleteBinding (N)"},{section:"x10.2.1.2.6",name:"10.2.1.2.6 ImplicitThisValue()"},{section:"x10.2.2",name:"10.2.2 Lexical Environment Operations"},{section:"x10.2.2.1",name:"10.2.2.1 GetIdentifierReference (lex, name, strict)"},{section:"x10.2.2.2",name:"10.2.2.2 NewDeclarativeEnvironment (E)"},{section:"x10.2.2.3",name:"10.2.2.3 NewObjectEnvironment (O, E)"},{section:"x10.2.3",name:"10.2.3 The Global Environment"},{section:"x10.3",name:"10.3 Execution Contexts"},{section:"x10.3.1",name:"10.3.1 Identifier Resolution"},{section:"x10.4",name:"10.4 Establishing an Execution Context"},{section:"x10.4.1",name:"10.4.1 Entering Global Code"},{section:"x10.4.1.1",name:"10.4.1.1 Initial Global Execution Context"},{section:"x10.4.2",name:"10.4.2 Entering Eval Code"},{section:"x10.4.2.1",name:"10.4.2.1 Strict Mode Restrictions"},{section:"x10.4.3",name:"10.4.3 Entering Function Code"},{section:"x10.5",name:"10.5 Declaration Binding Instantiation"},{section:"x10.6",name:"10.6 Arguments Object"},{section:"x11",name:"11 Expressions"},{section:"x11.1",name:"11.1 Primary Expressions"},{section:"x11.1.1",name:"11.1.1 The this Keyword"},{section:"x11.1.2",name:"11.1.2 Identifier Reference"},{section:"x11.1.3",name:"11.1.3 Literal Reference"},{section:"x11.1.4",name:"11.1.4 Array Initialiser"},{section:"x11.1.5",name:"11.1.5 Object Initialiser"},{section:"x11.1.6",name:"11.1.6 The Grouping Operator"},{section:"x11.2",name:"11.2 Left-Hand-Side Expressions"},{section:"x11.2.1",name:"11.2.1 Property Accessors"},{section:"x11.2.2",name:"11.2.2 The new Operator"},{section:"x11.2.3",name:"11.2.3 Function Calls"},{section:"x11.2.4",name:"11.2.4 Argument Lists"},{section:"x11.2.5",name:"11.2.5 Function Expressions"},{section:"x11.3",name:"11.3 Postfix Expressions"},{section:"x11.3.1",name:"11.3.1 Postfix Increment Operator"},{section:"x11.3.2",name:"11.3.2 Postfix Decrement Operator"},{section:"x11.4",name:"11.4 Unary Operators"},{section:"x11.4.1",name:"11.4.1 The delete Operator"},{section:"x11.4.2",name:"11.4.2 The void Operator"},{section:"x11.4.3",name:"11.4.3 The typeof Operator"},{section:"x11.4.4",name:"11.4.4 Prefix Increment Operator"},{section:"x11.4.5",name:"11.4.5 Prefix Decrement Operator"},{section:"x11.4.6",name:"11.4.6 Unary + Operator"},{section:"x11.4.7",name:"11.4.7 Unary - Operator"},{section:"x11.4.8",name:"11.4.8 Bitwise NOT Operator ( ~ )"},{section:"x11.4.9",name:"11.4.9 Logical NOT Operator ( ! )"},{section:"x11.5",name:"11.5 Multiplicative Operators"},{section:"x11.5.1",name:"11.5.1 Applying the * Operator"},{section:"x11.5.2",name:"11.5.2 Applying the / Operator"},{section:"x11.5.3",name:"11.5.3 Applying the % Operator"},{section:"x11.6",name:"11.6 Additive Operators"},{section:"x11.6.1",name:"11.6.1 The Addition operator ( + )"},{section:"x11.6.2",name:"11.6.2 The Subtraction Operator ( - )"},{section:"x11.6.3",name:"11.6.3 Applying the Additive Operators to Numbers"},{section:"x11.7",name:"11.7 Bitwise Shift Operators"},{section:"x11.7.1",name:"11.7.1 The Left Shift Operator ( << )"},{section:"x11.7.2",name:"11.7.2 The Signed Right Shift Operator ( >> )"},{section:"x11.7.3",name:"11.7.3 The Unsigned Right Shift Operator ( >>> )"},{section:"x11.8",name:"11.8 Relational Operators"},{section:"x11.8.1",name:"11.8.1 The Less-than Operator ( < )"},{section:"x11.8.2",name:"11.8.2 The Greater-than Operator ( > )"},{section:"x11.8.3",name:"11.8.3 The Less-than-or-equal Operator ( <= )"},{section:"x11.8.4",name:"11.8.4 The Greater-than-or-equal Operator ( >= )"},{section:"x11.8.5",name:"11.8.5 The Abstract Relational Comparison Algorithm"},{section:"x11.8.6",name:"11.8.6 The instanceof operator"},{section:"x11.8.7",name:"11.8.7 The in operator"},{section:"x11.9",name:"11.9 Equality Operators"},{section:"x11.9.1",name:"11.9.1 The Equals Operator ( == )"},{section:"x11.9.2",name:"11.9.2 The Does-not-equals Operator ( != )"},{section:"x11.9.3",name:"11.9.3 The Abstract Equality Comparison Algorithm"},{section:"x11.9.4",name:"11.9.4 The Strict Equals Operator ( === )"},{section:"x11.9.5",name:"11.9.5 The Strict Does-not-equal Operator ( !== )"},{section:"x11.9.6",name:"11.9.6 The Strict Equality Comparison Algorithm"},{section:"x11.10",name:"11.10 Binary Bitwise Operators"},{section:"x11.11",name:"11.11 Binary Logical Operators"},{section:"x11.12",name:"11.12 Conditional Operator ( ? : )"},{section:"x11.13",name:"11.13 Assignment Operators"},{section:"x11.13.1",name:"11.13.1 Simple Assignment ( = )"},{section:"x11.13.2",name:"11.13.2 Compound Assignment ( op= )"},{section:"x11.14",name:"11.14 Comma Operator ( , )"},{section:"x12",name:"12 Statements"},{section:"x12.1",name:"12.1 Block"},{section:"x12.2",name:"12.2 Variable Statement"},{section:"x12.2.1",name:"12.2.1 Strict Mode Restrictions"},{section:"x12.3",name:"12.3 Empty Statement"},{section:"x12.4",name:"12.4 Expression Statement"},{section:"x12.5",name:"12.5 The if Statement"},{section:"x12.6",name:"12.6 Iteration Statements"},{section:"x12.6.1",name:"12.6.1 The do-while Statement"},{section:"x12.6.2",name:"12.6.2 The while Statement"},{section:"x12.6.3",name:"12.6.3 The for Statement"},{section:"x12.6.4",name:"12.6.4 The for-in Statement"},{section:"x12.7",name:"12.7 The continue Statement"},{section:"x12.8",name:"12.8 The break Statement"},{section:"x12.9",name:"12.9 The return Statement"},{section:"x12.10",name:"12.10 The with Statement"},{section:"x12.10.1",name:"12.10.1 Strict Mode Restrictions"},{section:"x12.11",name:"12.11 The switch Statement"},{section:"x12.12",name:"12.12 Labelled Statements"},{section:"x12.13",name:"12.13 The throw Statement"},{section:"x12.14",name:"12.14 The try Statement"},{section:"x12.14.1",name:"12.14.1 Strict Mode Restrictions"},{section:"x12.15",name:"12.15 The debugger statement"},{section:"x13",name:"13 Function Definition"},{section:"x13.1",name:"13.1 Strict Mode Restrictions"},{section:"x13.2",name:"13.2 Creating Function Objects"},{section:"x13.2.1",name:"13.2.1 [[Call]]"},{section:"x13.2.2",name:"13.2.2 [[Construct]]"},{section:"x13.2.3",name:"13.2.3 The Function Object"},{section:"x14",name:"14 Program"},{section:"x14.1",name:"14.1 Directive Prologues and the Use Strict Directive"},{section:"x15",name:"15 Standard Built-in ECMAScript Objects"},{section:"x15.1",name:"15.1 The Global Object"},{section:"x15.1.1",name:"15.1.1 Value Properties of the Global Object"},{section:"x15.1.1.1",name:"15.1.1.1 NaN"},{section:"x15.1.1.2",name:"15.1.1.2 Infinity"},{section:"x15.1.1.3",name:"15.1.1.3 undefined"},{section:"x15.1.2",name:"15.1.2 Function Properties of the Global Object"},{section:"x15.1.2.1",name:"15.1.2.1 eval (x)"},{section:"x15.1.2.1.1",name:"15.1.2.1.1 Direct Call to Eval"},{section:"x15.1.2.2",name:"15.1.2.2 parseInt (string , radix)"},{section:"x15.1.2.3",name:"15.1.2.3 parseFloat (string)"},{section:"x15.1.2.4",name:"15.1.2.4 isNaN (number)"},{section:"x15.1.2.5",name:"15.1.2.5 isFinite (number)"},{section:"x15.1.3",name:"15.1.3 URI Handling Function Properties"},{section:"x15.1.3.1",name:"15.1.3.1 decodeURI (encodedURI)"},{section:"x15.1.3.2",name:"15.1.3.2 decodeURIComponent (encodedURIComponent)"},{section:"x15.1.3.3",name:"15.1.3.3 encodeURI (uri)"},{section:"x15.1.3.4",name:"15.1.3.4 encodeURIComponent (uriComponent)"},{section:"x15.1.4",name:"15.1.4 Constructor Properties of the Global Object"},{section:"x15.1.4.1",name:"15.1.4.1 Object ( . . . )"},{section:"x15.1.4.2",name:"15.1.4.2 Function ( . . . )"},{section:"x15.1.4.3",name:"15.1.4.3 Array ( . . . )"},{section:"x15.1.4.4",name:"15.1.4.4 String ( . . . )"},{section:"x15.1.4.5",name:"15.1.4.5 Boolean ( . . . )"},{section:"x15.1.4.6",name:"15.1.4.6 Number ( . . . )"},{section:"x15.1.4.7",name:"15.1.4.7 Date ( . . . )"},{section:"x15.1.4.8",name:"15.1.4.8 RegExp ( . . . )"},{section:"x15.1.4.9",name:"15.1.4.9 Error ( . . . )"},{section:"x15.1.4.10",name:"15.1.4.10 EvalError ( . . . )"},{section:"x15.1.4.11",name:"15.1.4.11 RangeError ( . . . )"},{section:"x15.1.4.12",name:"15.1.4.12 ReferenceError ( . . . )"},{section:"x15.1.4.13",name:"15.1.4.13 SyntaxError ( . . . )"},{section:"x15.1.4.14",name:"15.1.4.14 TypeError ( . . . )"},{section:"x15.1.4.15",name:"15.1.4.15 URIError ( . . . )"},{section:"x15.1.5",name:"15.1.5 Other Properties of the Global Object"},{section:"x15.1.5.1",name:"15.1.5.1 Math"},{section:"x15.1.5.2",name:"15.1.5.2 JSON"},{section:"x15.2",name:"15.2 Object Objects"},{section:"x15.2.1",name:"15.2.1 The Object Constructor Called as a Function"},{section:"x15.2.1.1",name:"15.2.1.1 Object ( [ value ] )"},{section:"x15.2.2",name:"15.2.2 The Object Constructor"},{section:"x15.2.2.1",name:"15.2.2.1 new Object ( [ value ] )"},{section:"x15.2.3",name:"15.2.3 Properties of the Object Constructor"},{section:"x15.2.3.1",name:"15.2.3.1 Object.prototype"},{section:"x15.2.3.2",name:"15.2.3.2 Object.getPrototypeOf ( O )"},{section:"x15.2.3.3",name:"15.2.3.3 Object.getOwnPropertyDescriptor ( O, P ) "},{section:"x15.2.3.4",name:"15.2.3.4 Object.getOwnPropertyNames ( O )"},{section:"x15.2.3.5",name:"15.2.3.5 Object.create ( O [, Properties] )"},{section:"x15.2.3.6",name:"15.2.3.6 Object.defineProperty ( O, P, Attributes )"},{section:"x15.2.3.7",name:"15.2.3.7 Object.defineProperties ( O, Properties )"},{section:"x15.2.3.8",name:"15.2.3.8 Object.seal ( O )"},{section:"x15.2.3.9",name:"15.2.3.9 Object.freeze ( O )"},{section:"x15.2.3.10",name:"15.2.3.10 Object.preventExtensions ( O )"},{section:"x15.2.3.11",name:"15.2.3.11 Object.isSealed ( O )"},{section:"x15.2.3.12",name:"15.2.3.12 Object.isFrozen ( O )"},{section:"x15.2.3.13",name:"15.2.3.13 Object.isExtensible ( O )"},{section:"x15.2.3.14",name:"15.2.3.14 Object.keys ( O )"},{section:"x15.2.4",name:"15.2.4 Properties of the Object Prototype Object"},{section:"x15.2.4.1",name:"15.2.4.1 Object.prototype.constructor"},{section:"x15.2.4.2",name:"15.2.4.2 Object.prototype.toString ( )"},{section:"x15.2.4.3",name:"15.2.4.3 Object.prototype.toLocaleString ( )"},{section:"x15.2.4.4",name:"15.2.4.4 Object.prototype.valueOf ( )"},{section:"x15.2.4.5",name:"15.2.4.5 Object.prototype.hasOwnProperty (V)"},{section:"x15.2.4.6",name:"15.2.4.6 Object.prototype.isPrototypeOf (V)"},{section:"x15.2.4.7",name:"15.2.4.7 Object.prototype.propertyIsEnumerable (V)"},{section:"x15.2.5",name:"15.2.5 Properties of Object Instances"},{section:"x15.3",name:"15.3 Function Objects"},{section:"x15.3.1",name:"15.3.1 The Function Constructor Called as a Function"},{section:"x15.3.1.1",name:"15.3.1.1 Function (p1, p2, … , pn, body)"},{section:"x15.3.2",name:"15.3.2 The Function Constructor"},{section:"x15.3.2.1",name:"15.3.2.1 new Function (p1, p2, … , pn, body)"},{section:"x15.3.3",name:"15.3.3 Properties of the Function Constructor"},{section:"x15.3.3.1",name:"15.3.3.1 Function.prototype"},{section:"x15.3.3.2",name:"15.3.3.2 Function.length"},{section:"x15.3.4",name:"15.3.4 Properties of the Function Prototype Object"},{section:"x15.3.4.1",name:"15.3.4.1 Function.prototype.constructor"},{section:"x15.3.4.2",name:"15.3.4.2 Function.prototype.toString ( )"},{section:"x15.3.4.3",name:"15.3.4.3 Function.prototype.apply (thisArg, argArray)"},{section:"x15.3.4.4",name:"15.3.4.4 Function.prototype.call (thisArg [ , arg1 [ , arg2, … ] ] )"},{section:"x15.3.4.5",name:"15.3.4.5 Function.prototype.bind (thisArg [, arg1 [, arg2, …]])"},{section:"x15.3.4.5.1",name:"15.3.4.5.1 [[Call]]"},{section:"x15.3.4.5.2",name:"15.3.4.5.2 [[Construct]]"},{section:"x15.3.4.5.3",name:"15.3.4.5.3 [[HasInstance]] (V)"},{section:"x15.3.5",name:"15.3.5 Properties of Function Instances"},{section:"x15.3.5.1",name:"15.3.5.1 length"},{section:"x15.3.5.2",name:"15.3.5.2 prototype"},{section:"x15.3.5.3",name:"15.3.5.3 [[HasInstance]] (V)"},{section:"x15.3.5.4",name:"15.3.5.4 [[Get]] (P)"},{section:"x15.4",name:"15.4 Array Objects"},{section:"x15.4.1",name:"15.4.1 The Array Constructor Called as a Function"},{section:"x15.4.1.1",name:"15.4.1.1 Array ( [ item1 [ , item2 [ , … ] ] ] )"},{section:"x15.4.2",name:"15.4.2 The Array Constructor"},{section:"x15.4.2.1",name:"15.4.2.1 new Array ( [ item0 [ , item1 [ , … ] ] ] )"},{section:"x15.4.2.2",name:"15.4.2.2 new Array (len)"},{section:"x15.4.3",name:"15.4.3 Properties of the Array Constructor"},{section:"x15.4.3.1",name:"15.4.3.1 Array.prototype"},{section:"x15.4.3.2",name:"15.4.3.2 Array.isArray ( arg )"},{section:"x15.4.4",name:"15.4.4 Properties of the Array Prototype Object"},{section:"x15.4.4.1",name:"15.4.4.1 Array.prototype.constructor"},{section:"x15.4.4.2",name:"15.4.4.2 Array.prototype.toString ( )"},{section:"x15.4.4.3",name:"15.4.4.3 Array.prototype.toLocaleString ( )"},{section:"x15.4.4.4",name:"15.4.4.4 Array.prototype.concat ( [ item1 [ , item2 [ , … ] ] ] )"},{section:"x15.4.4.5",name:"15.4.4.5 Array.prototype.join (separator)"},{section:"x15.4.4.6",name:"15.4.4.6 Array.prototype.pop ( )"},{section:"x15.4.4.7",name:"15.4.4.7 Array.prototype.push ( [ item1 [ , item2 [ , … ] ] ] )"},{section:"x15.4.4.8",name:"15.4.4.8 Array.prototype.reverse ( )"},{section:"x15.4.4.9",name:"15.4.4.9 Array.prototype.shift ( )"},{section:"x15.4.4.10",name:"15.4.4.10 Array.prototype.slice (start, end)"},{section:"x15.4.4.11",name:"15.4.4.11 Array.prototype.sort (comparefn)"},{section:"x15.4.4.12",name:"15.4.4.12 Array.prototype.splice (start, deleteCount [ , item1 [ , item2 [ , … ] ] ] )"},{section:"x15.4.4.13",name:"15.4.4.13 Array.prototype.unshift ( [ item1 [ , item2 [ , … ] ] ] )"},{section:"x15.4.4.14",name:"15.4.4.14 Array.prototype.indexOf ( searchElement [ , fromIndex ] )"},{section:"x15.4.4.15",name:"15.4.4.15 Array.prototype.lastIndexOf ( searchElement [ , fromIndex ] )"},{section:"x15.4.4.16",name:"15.4.4.16 Array.prototype.every ( callbackfn [ , thisArg ] )"},{section:"x15.4.4.17",name:"15.4.4.17 Array.prototype.some ( callbackfn [ , thisArg ] )"},{section:"x15.4.4.18",name:"15.4.4.18 Array.prototype.forEach ( callbackfn [ , thisArg ] )"},{section:"x15.4.4.19",name:"15.4.4.19 Array.prototype.map ( callbackfn [ , thisArg ] )"},{section:"x15.4.4.20",name:"15.4.4.20 Array.prototype.filter ( callbackfn [ , thisArg ] )"},{section:"x15.4.4.21",name:"15.4.4.21 Array.prototype.reduce ( callbackfn [ , initialValue ] )"},{section:"x15.4.4.22",name:"15.4.4.22 Array.prototype.reduceRight ( callbackfn [ , initialValue ] )"},{section:"x15.4.5",name:"15.4.5 Properties of Array Instances"},{section:"x15.4.5.1",name:"15.4.5.1 [[DefineOwnProperty]] ( P, Desc, Throw )"},{section:"x15.4.5.2",name:"15.4.5.2 length"},{section:"x15.5",name:"15.5 String Objects"},{section:"x15.5.1",name:"15.5.1 The String Constructor Called as a Function"},{section:"x15.5.1.1",name:"15.5.1.1 String ( [ value ] )"},{section:"x15.5.2",name:"15.5.2 The String Constructor"},{section:"x15.5.2.1",name:"15.5.2.1 new String ( [ value ] )"},{section:"x15.5.3",name:"15.5.3 Properties of the String Constructor"},{section:"x15.5.3.1",name:"15.5.3.1 String.prototype"},{section:"x15.5.3.2",name:"15.5.3.2 String.fromCharCode ( [ char0 [ , char1 [ , … ] ] ] )"},{section:"x15.5.4",name:"15.5.4 Properties of the String Prototype Object"},{section:"x15.5.4.1",name:"15.5.4.1 String.prototype.constructor"},{section:"x15.5.4.2",name:"15.5.4.2 String.prototype.toString ( )"},{section:"x15.5.4.3",name:"15.5.4.3 String.prototype.valueOf ( )"},{section:"x15.5.4.4",name:"15.5.4.4 String.prototype.charAt (pos)"},{section:"x15.5.4.5",name:"15.5.4.5 String.prototype.charCodeAt (pos)"},{section:"x15.5.4.6",name:"15.5.4.6 String.prototype.concat ( [ string1 [ , string2 [ , … ] ] ] )"},{section:"x15.5.4.7",name:"15.5.4.7 String.prototype.indexOf (searchString, position)"},{section:"x15.5.4.8",name:"15.5.4.8 String.prototype.lastIndexOf (searchString, position)"},{section:"x15.5.4.9",name:"15.5.4.9 String.prototype.localeCompare (that)"},{section:"x15.5.4.10",name:"15.5.4.10 String.prototype.match (regexp)"},{section:"x15.5.4.11",name:"15.5.4.11 String.prototype.replace (searchValue, replaceValue)"},{section:"x15.5.4.12",name:"15.5.4.12 String.prototype.search (regexp)"},{section:"x15.5.4.13",name:"15.5.4.13 String.prototype.slice (start, end)"},{section:"x15.5.4.14",name:"15.5.4.14 String.prototype.split (separator, limit)"},{section:"x15.5.4.15",name:"15.5.4.15 String.prototype.substring (start, end)"},{section:"x15.5.4.16",name:"15.5.4.16 String.prototype.toLowerCase ( )"},{section:"x15.5.4.17",name:"15.5.4.17 String.prototype.toLocaleLowerCase ( )"},{section:"x15.5.4.18",name:"15.5.4.18 String.prototype.toUpperCase ( )"},{section:"x15.5.4.19",name:"15.5.4.19 String.prototype.toLocaleUpperCase ( )"},{section:"x15.5.4.20",name:"15.5.4.20 String.prototype.trim ( )"},{section:"x15.5.5",name:"15.5.5 Properties of String Instances"},{section:"x15.5.5.1",name:"15.5.5.1 length"},{section:"x15.5.5.2",name:"15.5.5.2 [[GetOwnProperty]] ( P )"},{section:"x15.6",name:"15.6 Boolean Objects"},{section:"x15.6.1",name:"15.6.1 The Boolean Constructor Called as a Function"},{section:"x15.6.1.1",name:"15.6.1.1 Boolean (value)"},{section:"x15.6.2",name:"15.6.2 The Boolean Constructor"},{section:"x15.6.2.1",name:"15.6.2.1 new Boolean (value)"},{section:"x15.6.3",name:"15.6.3 Properties of the Boolean Constructor"},{section:"x15.6.3.1",name:"15.6.3.1 Boolean.prototype"},{section:"x15.6.4",name:"15.6.4 Properties of the Boolean Prototype Object"},{section:"x15.6.4.1",name:"15.6.4.1 Boolean.prototype.constructor"},{section:"x15.6.4.2",name:"15.6.4.2 Boolean.prototype.toString ( )"},{section:"x15.6.4.3",name:"15.6.4.3 Boolean.prototype.valueOf ( )"},{section:"x15.6.5",name:"15.6.5 Properties of Boolean Instances"},{section:"x15.7",name:"15.7 Number Objects"},{section:"x15.7.1",name:"15.7.1 The Number Constructor Called as a Function"},{section:"x15.7.1.1",name:"15.7.1.1 Number ( [ value ] )"},{section:"x15.7.2",name:"15.7.2 The Number Constructor"},{section:"x15.7.2.1",name:"15.7.2.1 new Number ( [ value ] )"},{section:"x15.7.3",name:"15.7.3 Properties of the Number Constructor"},{section:"x15.7.3.1",name:"15.7.3.1 Number.prototype"},{section:"x15.7.3.2",name:"15.7.3.2 Number.MAX_VALUE"},{section:"x15.7.3.3",name:"15.7.3.3 Number.MIN_VALUE"},{section:"x15.7.3.4",name:"15.7.3.4 Number.NaN"},{section:"x15.7.3.5",name:"15.7.3.5 Number.NEGATIVE_INFINITY"},{section:"x15.7.3.6",name:"15.7.3.6 Number.POSITIVE_INFINITY"},{section:"x15.7.4",name:"15.7.4 Properties of the Number Prototype Object"},{section:"x15.7.4.1",name:"15.7.4.1 Number.prototype.constructor"},{section:"x15.7.4.2",name:"15.7.4.2 Number.prototype.toString ( [ radix ] )"},{section:"x15.7.4.3",name:"15.7.4.3 Number.prototype.toLocaleString()"},{section:"x15.7.4.4",name:"15.7.4.4 Number.prototype.valueOf ( )"},{section:"x15.7.4.5",name:"15.7.4.5 Number.prototype.toFixed (fractionDigits)"},{section:"x15.7.4.6",name:"15.7.4.6 Number.prototype.toExponential (fractionDigits)"},{section:"x15.7.4.7",name:"15.7.4.7 Number.prototype.toPrecision (precision)"},{section:"x15.7.5",name:"15.7.5 Properties of Number Instances"},{section:"x15.8",name:"15.8 The Math Object"},{section:"x15.8.1",name:"15.8.1 Value Properties of the Math Object"},{section:"x15.8.1.1",name:"15.8.1.1 E"},{section:"x15.8.1.2",name:"15.8.1.2 LN10"},{section:"x15.8.1.3",name:"15.8.1.3 LN2"},{section:"x15.8.1.4",name:"15.8.1.4 LOG2E"},{section:"x15.8.1.5",name:"15.8.1.5 LOG10E"},{section:"x15.8.1.6",name:"15.8.1.6 PI"},{section:"x15.8.1.7",name:"15.8.1.7 SQRT1_2"},{section:"x15.8.1.8",name:"15.8.1.8 SQRT2"},{section:"x15.8.2",name:"15.8.2 Function Properties of the Math Object"},{section:"x15.8.2.1",name:"15.8.2.1 abs (x)"},{section:"x15.8.2.2",name:"15.8.2.2 acos (x)"},{section:"x15.8.2.3",name:"15.8.2.3 asin (x)"},{section:"x15.8.2.4",name:"15.8.2.4 atan (x)"},{section:"x15.8.2.5",name:"15.8.2.5 atan2 (y, x)"},{section:"x15.8.2.6",name:"15.8.2.6 ceil (x)"},{section:"x15.8.2.7",name:"15.8.2.7 cos (x)"},{section:"x15.8.2.8",name:"15.8.2.8 exp (x)"},{section:"x15.8.2.9",name:"15.8.2.9 floor (x)"},{section:"x15.8.2.10",name:"15.8.2.10 log (x)"},{section:"x15.8.2.11",name:"15.8.2.11 max ( [ value1 [ , value2 [ , … ] ] ] )"},{section:"x15.8.2.12",name:"15.8.2.12 min ( [ value1 [ , value2 [ , … ] ] ] )"},{section:"x15.8.2.13",name:"15.8.2.13 pow (x, y)"},{section:"x15.8.2.14",name:"15.8.2.14 random ( )"},{section:"x15.8.2.15",name:"15.8.2.15 round (x)"},{section:"x15.8.2.16",name:"15.8.2.16 sin (x)"},{section:"x15.8.2.17",name:"15.8.2.17 sqrt (x)"},{section:"x15.8.2.18",name:"15.8.2.18 tan (x)"},{section:"x15.9",name:"15.9 Date Objects"},{section:"x15.9.1",name:"15.9.1 Overview of Date Objects and Definitions of Abstract Operators"},{section:"x15.9.1.1",name:"15.9.1.1 Time Values and Time Range"},{section:"x15.9.1.2",name:"15.9.1.2 Day Number and Time within Day"},{section:"x15.9.1.3",name:"15.9.1.3 Year Number"},{section:"x15.9.1.4",name:"15.9.1.4 Month Number"},{section:"x15.9.1.5",name:"15.9.1.5 Date Number"},{section:"x15.9.1.6",name:"15.9.1.6 Week Day"},{section:"x15.9.1.7",name:"15.9.1.7 Local Time Zone Adjustment"},{section:"x15.9.1.8",name:"15.9.1.8 Daylight Saving Time Adjustment"},{section:"x15.9.1.9",name:"15.9.1.9 Local Time"},{section:"x15.9.1.10",name:"15.9.1.10 Hours, Minutes, Second, and Milliseconds"},{section:"x15.9.1.11",name:"15.9.1.11 MakeTime (hour, min, sec, ms)"},{section:"x15.9.1.12",name:"15.9.1.12 MakeDay (year, month, date)"},{section:"x15.9.1.13",name:"15.9.1.13 MakeDate (day, time)"},{section:"x15.9.1.14",name:"15.9.1.14 TimeClip (time)"},{section:"x15.9.1.15",name:"15.9.1.15 Date Time String Format"},{section:"x15.9.1.15.1",name:"15.9.1.15.1 Extended years"},{section:"x15.9.2",name:"15.9.2 The Date Constructor Called as a Function"},{section:"x15.9.2.1",name:"15.9.2.1 Date ( [ year [, month [, date [, hours [, minutes [, seconds [, ms ] ] ] ] ] ] ] )"},{section:"x15.9.3",name:"15.9.3 The Date Constructor"},{section:"x15.9.3.1",name:"15.9.3.1 new Date (year, month [, date [, hours [, minutes [, seconds [, ms ] ] ] ] ] )"},{section:"x15.9.3.2",name:"15.9.3.2 new Date (value)"},{section:"x15.9.3.3",name:"15.9.3.3 new Date ( )"},{section:"x15.9.4",name:"15.9.4 Properties of the Date Constructor"},{section:"x15.9.4.1",name:"15.9.4.1 Date.prototype"},{section:"x15.9.4.2",name:"15.9.4.2 Date.parse (string)"},{section:"x15.9.4.3",name:"15.9.4.3 Date.UTC (year, month [, date [, hours [, minutes [, seconds [, ms ] ] ] ] ])"},{section:"x15.9.4.4",name:"15.9.4.4 Date.now ( )"},{section:"x15.9.5",name:"15.9.5 Properties of the Date Prototype Object"},{section:"x15.9.5.1",name:"15.9.5.1 Date.prototype.constructor"},{section:"x15.9.5.2",name:"15.9.5.2 Date.prototype.toString ( )"},{section:"x15.9.5.3",name:"15.9.5.3 Date.prototype.toDateString ( )"},{section:"x15.9.5.4",name:"15.9.5.4 Date.prototype.toTimeString ( )"},{section:"x15.9.5.5",name:"15.9.5.5 Date.prototype.toLocaleString ( )"},{section:"x15.9.5.6",name:"15.9.5.6 Date.prototype.toLocaleDateString ( )"},{section:"x15.9.5.7",name:"15.9.5.7 Date.prototype.toLocaleTimeString ( )"},{section:"x15.9.5.8",name:"15.9.5.8 Date.prototype.valueOf ( )"},{section:"x15.9.5.9",name:"15.9.5.9 Date.prototype.getTime ( )"},{section:"x15.9.5.10",name:"15.9.5.10 Date.prototype.getFullYear ( )"},{section:"x15.9.5.11",name:"15.9.5.11 Date.prototype.getUTCFullYear ( )"},{section:"x15.9.5.12",name:"15.9.5.12 Date.prototype.getMonth ( )"},{section:"x15.9.5.13",name:"15.9.5.13 Date.prototype.getUTCMonth ( )"},{section:"x15.9.5.14",name:"15.9.5.14 Date.prototype.getDate ( )"},{section:"x15.9.5.15",name:"15.9.5.15 Date.prototype.getUTCDate ( )"},{section:"x15.9.5.16",name:"15.9.5.16 Date.prototype.getDay ( )"},{section:"x15.9.5.17",name:"15.9.5.17 Date.prototype.getUTCDay ( )"},{section:"x15.9.5.18",name:"15.9.5.18 Date.prototype.getHours ( )"},{section:"x15.9.5.19",name:"15.9.5.19 Date.prototype.getUTCHours ( )"},{section:"x15.9.5.20",name:"15.9.5.20 Date.prototype.getMinutes ( )"},{section:"x15.9.5.21",name:"15.9.5.21 Date.prototype.getUTCMinutes ( )"},{section:"x15.9.5.22",name:"15.9.5.22 Date.prototype.getSeconds ( )"},{section:"x15.9.5.23",name:"15.9.5.23 Date.prototype.getUTCSeconds ( )"},{section:"x15.9.5.24",name:"15.9.5.24 Date.prototype.getMilliseconds ( )"},{section:"x15.9.5.25",name:"15.9.5.25 Date.prototype.getUTCMilliseconds ( )"},{section:"x15.9.5.26",name:"15.9.5.26 Date.prototype.getTimezoneOffset ( )"},{section:"x15.9.5.27",name:"15.9.5.27 Date.prototype.setTime (time)"},{section:"x15.9.5.28",name:"15.9.5.28 Date.prototype.setMilliseconds (ms)"},{section:"x15.9.5.29",name:"15.9.5.29 Date.prototype.setUTCMilliseconds (ms)"},{section:"x15.9.5.30",name:"15.9.5.30 Date.prototype.setSeconds (sec [, ms ] )"},{section:"x15.9.5.31",name:"15.9.5.31 Date.prototype.setUTCSeconds (sec [, ms ] )"},{section:"x15.9.5.32",name:"15.9.5.32 Date.prototype.setMinutes (min [, sec [, ms ] ] )"},{section:"x15.9.5.33",name:"15.9.5.33 Date.prototype.setUTCMinutes (min [, sec [, ms ] ] )"},{section:"x15.9.5.34",name:"15.9.5.34 Date.prototype.setHours (hour [, min [, sec [, ms ] ] ] )"},{section:"x15.9.5.35",name:"15.9.5.35 Date.prototype.setUTCHours (hour [, min [, sec [, ms ] ] ] )"},{section:"x15.9.5.36",name:"15.9.5.36 Date.prototype.setDate (date)"},{section:"x15.9.5.37",name:"15.9.5.37 Date.prototype.setUTCDate (date)"},{section:"x15.9.5.38",name:"15.9.5.38 Date.prototype.setMonth (month [, date ] )"},{section:"x15.9.5.39",name:"15.9.5.39 Date.prototype.setUTCMonth (month [, date ] )"},{section:"x15.9.5.40",name:"15.9.5.40 Date.prototype.setFullYear (year [, month [, date ] ] )"},{section:"x15.9.5.41",name:"15.9.5.41 Date.prototype.setUTCFullYear (year [, month [, date ] ] )"},{section:"x15.9.5.42",name:"15.9.5.42 Date.prototype.toUTCString ( )"},{section:"x15.9.5.43",name:"15.9.5.43 Date.prototype.toISOString ( )"},{section:"x15.9.5.44",name:"15.9.5.44 Date.prototype.toJSON ( key )"},{section:"x15.9.6",name:"15.9.6 Properties of Date Instances"},{section:"x15.10",name:"15.10 RegExp (Regular Expression) Objects"},{section:"x15.10.1",name:"15.10.1 Patterns"},{section:"x15.10.2",name:"15.10.2 Pattern Semantics"},{section:"x15.10.2.1",name:"15.10.2.1 Notation"},{section:"x15.10.2.2",name:"15.10.2.2 Pattern"},{section:"x15.10.2.3",name:"15.10.2.3 Disjunction"},{section:"x15.10.2.4",name:"15.10.2.4 Alternative"},{section:"x15.10.2.5",name:"15.10.2.5 Term"},{section:"x15.10.2.6",name:"15.10.2.6 Assertion"},{section:"x15.10.2.7",name:"15.10.2.7 Quantifier"},{section:"x15.10.2.8",name:"15.10.2.8 Atom"},{section:"x15.10.2.9",name:"15.10.2.9 AtomEscape"},{section:"x15.10.2.10",name:"15.10.2.10 CharacterEscape"},{section:"x15.10.2.11",name:"15.10.2.11 DecimalEscape"},{section:"x15.10.2.12",name:"15.10.2.12 CharacterClassEscape"},{section:"x15.10.2.13",name:"15.10.2.13 CharacterClass"},{section:"x15.10.2.14",name:"15.10.2.14 ClassRanges"},{section:"x15.10.2.15",name:"15.10.2.15 NonemptyClassRanges"},{section:"x15.10.2.16",name:"15.10.2.16 NonemptyClassRangesNoDash"},{section:"x15.10.2.17",name:"15.10.2.17 ClassAtom"},{section:"x15.10.2.18",name:"15.10.2.18 ClassAtomNoDash"},{section:"x15.10.2.19",name:"15.10.2.19 ClassEscape"},{section:"x15.10.3",name:"15.10.3 The RegExp Constructor Called as a Function"},{section:"x15.10.3.1",name:"15.10.3.1 RegExp(pattern, flags)"},{section:"x15.10.4",name:"15.10.4 The RegExp Constructor"},{section:"x15.10.4.1",name:"15.10.4.1 new RegExp(pattern, flags)"},{section:"x15.10.5",name:"15.10.5 Properties of the RegExp Constructor"},{section:"x15.10.5.1",name:"15.10.5.1 RegExp.prototype"},{section:"x15.10.6",name:"15.10.6 Properties of the RegExp Prototype Object"},{section:"x15.10.6.1",name:"15.10.6.1 RegExp.prototype.constructor"},{section:"x15.10.6.2",name:"15.10.6.2 RegExp.prototype.exec(string)"},{section:"x15.10.6.3",name:"15.10.6.3 RegExp.prototype.test(string)"},{section:"x15.10.6.4",name:"15.10.6.4 RegExp.prototype.toString()"},{section:"x15.10.7",name:"15.10.7 Properties of RegExp Instances"},{section:"x15.10.7.1",name:"15.10.7.1 source"},{section:"x15.10.7.2",name:"15.10.7.2 global"},{section:"x15.10.7.3",name:"15.10.7.3 ignoreCase"},{section:"x15.10.7.4",name:"15.10.7.4 multiline"},{section:"x15.10.7.5",name:"15.10.7.5 lastIndex"},{section:"x15.11",name:"15.11 Error Objects"},{section:"x15.11.1",name:"15.11.1 The Error Constructor Called as a Function"},{section:"x15.11.1.1",name:"15.11.1.1 Error (message)"},{section:"x15.11.2",name:"15.11.2 The Error Constructor"},{section:"x15.11.2.1",name:"15.11.2.1 new Error (message)"},{section:"x15.11.3",name:"15.11.3 Properties of the Error Constructor"},{section:"x15.11.3.1",name:"15.11.3.1 Error.prototype"},{section:"x15.11.4",name:"15.11.4 Properties of the Error Prototype Object"},{section:"x15.11.4.1",name:"15.11.4.1 Error.prototype.constructor"},{section:"x15.11.4.2",name:"15.11.4.2 Error.prototype.name"},{section:"x15.11.4.3",name:"15.11.4.3 Error.prototype.message"},{section:"x15.11.4.4",name:"15.11.4.4 Error.prototype.toString ( )"},{section:"x15.11.5",name:"15.11.5 Properties of Error Instances"},{section:"x15.11.6",name:"15.11.6 Native Error Types Used in This Standard"},{section:"x15.11.6.1",name:"15.11.6.1 EvalError"},{section:"x15.11.6.2",name:"15.11.6.2 RangeError"},{section:"x15.11.6.3",name:"15.11.6.3 ReferenceError"},{section:"x15.11.6.4",name:"15.11.6.4 SyntaxError"},{section:"x15.11.6.5",name:"15.11.6.5 TypeError"},{section:"x15.11.6.6",name:"15.11.6.6 URIError"},{section:"x15.11.7",name:"15.11.7 NativeError Object Structure"},{section:"x15.11.7.1",name:"15.11.7.1 NativeError Constructors Called as Functions"},{section:"x15.11.7.2",name:"15.11.7.2 NativeError (message)"},{section:"x15.11.7.3",name:"15.11.7.3 The NativeError Constructors"},{section:"x15.11.7.4",name:"15.11.7.4 New NativeError (message)"},{section:"x15.11.7.5",name:"15.11.7.5 Properties of the NativeError Constructors"},{section:"x15.11.7.6",name:"15.11.7.6 NativeError.prototype"},{section:"x15.11.7.7",name:"15.11.7.7 Properties of the NativeError Prototype Objects"},{section:"x15.11.7.8",name:"15.11.7.8 NativeError.prototype.constructor"},{section:"x15.11.7.9",name:"15.11.7.9 NativeError.prototype.name"},{section:"x15.11.7.10",name:"15.11.7.10 NativeError.prototype.message"},{section:"x15.11.7.11",name:"15.11.7.11 Properties of NativeError Instances"},{section:"x15.12",name:"15.12 The JSON Object"},{section:"x15.12.1",name:"15.12.1 The JSON Grammar "},{section:"x15.12.1.1",name:"15.12.1.1 The JSON Lexical Grammar"},{section:"x15.12.1.2",name:"15.12.1.2 The JSON Syntactic Grammar"},{section:"x15.12.2",name:"15.12.2 parse ( text [ , reviver ] )"},{section:"x15.12.3",name:"15.12.3 stringify ( value [ , replacer [ , space ] ] )"},{section:"x16",name:"16 Errors"},{section:"A",name:"Annex A (informative) Grammar Summary"},{section:"A.1",name:"A.1 Lexical Grammar"},{section:"A.2",name:"A.2 Number Conversions"},{section:"A.3",name:"A.3 Expressions"},{section:"A.4",name:"A.4 Statements"},{section:"A.5",name:"A.5 Functions and Programs"},{section:"A.6",name:"A.6 Universal Resource Identifier Character Classes"},{section:"A.7",name:"A.7 Regular Expressions"},{section:"A.8",name:"A.8 JSON"},{section:"A.8.1",name:"A.8.1 JSON Lexical Grammar"},{section:"A.8.2",name:"A.8.2 JSON Syntactic Grammar"},{section:"B",name:"Annex B (informative) Compatibility"},{section:"B.1",name:"B.1 Additional Syntax"},{section:"B.1.1",name:"B.1.1 Numeric Literals"},{section:"B.1.2",name:"B.1.2 String Literals"},{section:"B.2",name:"B.2 Additional Properties"},{section:"B.2.1",name:"B.2.1 escape (string)"},{section:"B.2.2",name:"B.2.2 unescape (string)"},{section:"B.2.3",name:"B.2.3 String.prototype.substr (start, length)"},{section:"B.2.4",name:"B.2.4 Date.prototype.getYear ( )"},{section:"B.2.5",name:"B.2.5 Date.prototype.setYear (year)"},{section:"B.2.6",name:"B.2.6 Date.prototype.toGMTString ( )"},{section:"C",name:"Annex C (informative) The Strict Mode of ECMAScript"},{section:"D",name:"Annex D (informative) Corrections and Clarifications in the 5th Edition with Possible 3rd Edition Compatibility Impact"},{section:"E",name:"Annex E (informative) Additions and Changes in the 5th Edition that Introduce Incompatibilities with the 3rd Edition"},{section:"bibliography",name:"Bibliography"}],bot.addCommand({name:"spec",fun:e,permissions:{del:"NONE"},description:"Find a section in the ES5 spec"})
}(),function(){function e(e,n){function o(e){if(e.error_message)return i(e.error_message),void 0;var n,o=e.items[0];n=o?t(o,s):"User "+a+" not found",i(n)}function i(t){n?n(t):e.reply(t)}var r=e.parse(),a=r[0],s="extended"===r[1];return a?/^\d+$/.test(a)||(a=e.findUserid(s?a:r.slice().join(" "))):a=e.get("user_id"),0>a?"User Elusio proved elusive.":.1>=Math.random()?(i("That dude sucks"),void 0):(IO.jsonp({url:"https://api.stackexchange.com/2.0/users/"+a,data:{site:bot.adapter.site,filter:"!G*klMsSp1IcBUKxXMwhRe8TaI("},fun:o}),void 0)}function t(e,t){e=n(e);var a=i.supplant(e);return t&&(a+=r.supplant(o(e))),a}function n(e){return e=Object.merge({question_count:0,answer_count:0,reputation_change_day:0},e),e.ratio=!e.question_count&&e.answer_count?"H̸̡̪̯ͨ͊̽̅̾̎Ȩ̬̩̾͛ͪ̈́̀́͘ ̶̧̨̱̹̭̯ͧ̾ͬC̷̙̲̝͖ͭ̏ͥͮ͟Oͮ͏̮̪̝͍M̲̖͊̒ͪͩͬ̚̚͜Ȇ̴̟̟͙̞ͩ͌͝S̨̥̫͎̭ͯ̿̔̀ͅ":!e.answer_count&&e.question_count?"TO͇̹̺ͅƝ̴ȳ̳ TH̘Ë͖́̉ ͠P̯͍̭O̚N̐Y̡":e.answer_count||e.question_count?Math.ratio(e.question_count,e.answer_count):"http://i.imgur.com/F79hP.png",bot.log(e,"/stat normalized"),e}function o(e){return e=Object.merge(e.badge_counts,e),e.avg_rep_post=(e.reputation/(e.question_count+e.answer_count)).maxDecimal(2),1/0===e.avg_rep_post&&(e.avg_rep_post="T͎͍̘͙̖̤̉̌̇̅ͯ͋͢͜͝H̖͙̗̗̺͚̱͕̒́͟E̫̺̯͖͎̗̒͑̅̈ ̈ͮ̽ͯ̆̋́͏͙͓͓͇̹<̩̟̳̫̪̇ͩ̑̆͗̽̇͆́ͅC̬͎ͪͩ̓̑͊ͮͪ̄̚̕Ě̯̰̤̗̜̗͓͛͝N̶̴̞͇̟̲̪̅̓ͯͅT͍̯̰͓̬͚̅͆̄E̠͇͇̬̬͕͖ͨ̔̓͞R͚̠̻̲̗̹̀>̇̏ͣ҉̳̖̟̫͕ ̧̛͈͙͇͂̓̚͡C͈̞̻̩̯̠̻ͥ̆͐̄ͦ́̀͟A̛̪̫͙̺̱̥̞̙ͦͧ̽͛̈́ͯ̅̍N̦̭͕̹̤͓͙̲̑͋̾͊ͣŅ̜̝͌͟O̡̝͍͚̲̝ͣ̔́͝Ť͈͢ ̪̘̳͔̂̒̋ͭ͆̽͠H̢͈̤͚̬̪̭͗ͧͬ̈́̈̀͌͒͡Ơ̮͍͇̝̰͍͚͖̿ͮ̀̍́L͐̆ͨ̏̎͡҉̧̱̯̤̹͓̗̻̭ͅḐ̲̰͙͑̂̒̐́̊"),bot.log(e,"/stat extended"),e}var i="[{display_name}]({link}) has {reputation} reputation, earned {reputation_change_day} rep today, asked {question_count} questions, gave {answer_count} answers, for a q:a ratio of {ratio}.\n",r="avg. rep/post: {avg_rep_post}. Badges: {gold}g {silver}s {bronze}b ";bot.addCommand({name:"stat",fun:e,permissions:{del:"NONE"},description:"Gives useless stats on a user. `/stat usrid|usrname [extended]`",async:!0})}(),function(){function e(e){var n=RegExp(e.matches[2],e.matches[4]),o=e.matches[3];if(!e.matches[2])return"Empty regex is empty";var i=t(n,e.get("message_id"));if(!i)return"No matching message (are you sure we're in the right room?)";var r=i.previousElementSibling.href;return i.textContent.replace(n,o)+" "+e.link("(source)",r)}function t(e,t){function n(n){var o=Number(n.parentElement.id.match(/\d+/)[0]);return t>o&&e.test(n.textContent)}var o=[].slice.call(document.getElementsByClassName("content")).reverse();return o.first(n)}var n=/^\s*s(\/|\|)((?:(?:\\\1)|[^\1])*?)\1((?:(?:\\\1)|[^\1])*?)\1(g?i?)/;bot.listen(n,e)}(),function(){var e={last_id:null,command:function(e,t){function n(n){t?t(n):e.reply(n)}var o=Number(e.parse()[0]);bot.log(o,"/undo input"),o||(o=this.last_id),o?this.remove(o,n):n("I've yet to say a word.")},remove:function(e,t){function n(e){var n;'"ok"'!==e&&(n=/it is too late/i.test(e)?"TimeError: Could not reach 88mph":/only delete your own/i.test(e)?"I can only delete my own messages":"I have no idea what happened: "+e,t(n))}IO.xhr({url:"/messages/"+e+"/delete",data:fkey(),method:"POST",complete:n})},update_id:function(e){this.last_id=JSON.parse(e.responseText).id}};IO.register("sendoutput",e.update_id,e),bot.addCommand({name:"undo",fun:e.command,thisArg:e,permissions:{del:"NONE",use:bot.owners},description:"Undo (delete) specified or last message. `/undo [msgid]`"})}();