/* SockJS client, http://sockjs.org, MIT License
*
* Copyright (c) 2011-2012 VMware, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
var JSON;JSON||(JSON={});
(function(){function m(d,l){var t,q,o,p,x=k,i,j=l[d];j&&typeof j=="object"&&typeof j.toJSON=="function"&&(j=j.toJSON(d));typeof s=="function"&&(j=s.call(l,d,j));switch(typeof j){case "string":return g(j);case "number":return isFinite(j)?String(j):"null";case "boolean":case "null":return String(j);case "object":if(!j)return"null";k+=w;i=[];if(Object.prototype.toString.apply(j)==="[object Array]"){p=j.length;for(t=0;t
1?this._listeners[a]=c.slice(0,e).concat(c.slice(e+1)):delete this._listeners[a])}};p.prototype.dispatchEvent=
function(a){var b=a.type,c=Array.prototype.slice.call(arguments,0);this["on"+b]&&this["on"+b].apply(this,c);if(this._listeners&&b in this._listeners)for(var e=0;e=3E3&&a<=4999};d.countRTO=function(a){return a>100?3*a:a+200};d.log=function(){g.console&&console.log&&console.log.apply&&console.log.apply(console,arguments)};d.bind=function(a,b){return a.bind?a.bind(b):function(){return a.apply(b,arguments)}};d.flatUrl=function(a){return a.indexOf("?")===
-1&&a.indexOf("#")===-1};d.amendUrl=function(a){var b=m.location;if(!a)throw Error("Wrong url for SockJS");if(!d.flatUrl(a))throw Error("Only basic urls are supported in SockJS");a.indexOf("//")===0&&(a=b.protocol+a);a.indexOf("/")===0&&(a=b.protocol+"//"+b.host+a);return a=a.replace(/[/]+$/,"")};d.arrIndexOf=function(a,b){for(var c=0;c=0};d.delay=function(a,b){typeof a==="function"&&(b=a,a=0);return setTimeout(b,a)};var w=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,G={"\x00":"\\u0000","\u0001":"\\u0001","\u0002":"\\u0002","\u0003":"\\u0003","\u0004":"\\u0004","\u0005":"\\u0005","\u0006":"\\u0006","\u0007":"\\u0007","\u0008":"\\b","\t":"\\t","\n":"\\n","\u000b":"\\u000b","\u000c":"\\f","\r":"\\r",
"\u000e":"\\u000e","\u000f":"\\u000f","\u0010":"\\u0010","\u0011":"\\u0011","\u0012":"\\u0012","\u0013":"\\u0013","\u0014":"\\u0014","\u0015":"\\u0015","\u0016":"\\u0016","\u0017":"\\u0017","\u0018":"\\u0018","\u0019":"\\u0019","\u001a":"\\u001a","\u001b":"\\u001b","\u001c":"\\u001c","\u001d":"\\u001d","\u001e":"\\u001e","\u001f":"\\u001f",'"':'\\"',"\\":"\\\\","\u007f":"\\u007f","\u0080":"\\u0080","\u0081":"\\u0081","\u0082":"\\u0082","\u0083":"\\u0083","\u0084":"\\u0084","\u0085":"\\u0085","\u0086":"\\u0086",
"\u0087":"\\u0087","\u0088":"\\u0088","\u0089":"\\u0089","\u008a":"\\u008a","\u008b":"\\u008b","\u008c":"\\u008c","\u008d":"\\u008d","\u008e":"\\u008e","\u008f":"\\u008f","\u0090":"\\u0090","\u0091":"\\u0091","\u0092":"\\u0092","\u0093":"\\u0093","\u0094":"\\u0094","\u0095":"\\u0095","\u0096":"\\u0096","\u0097":"\\u0097","\u0098":"\\u0098","\u0099":"\\u0099","\u009a":"\\u009a","\u009b":"\\u009b","\u009c":"\\u009c","\u009d":"\\u009d","\u009e":"\\u009e","\u009f":"\\u009f","\u00ad":"\\u00ad","\u0600":"\\u0600",
"\u0601":"\\u0601","\u0602":"\\u0602","\u0603":"\\u0603","\u0604":"\\u0604","\u070f":"\\u070f","\u17b4":"\\u17b4","\u17b5":"\\u17b5","\u200c":"\\u200c","\u200d":"\\u200d","\u200e":"\\u200e","\u200f":"\\u200f","\u2028":"\\u2028","\u2029":"\\u2029","\u202a":"\\u202a","\u202b":"\\u202b","\u202c":"\\u202c","\u202d":"\\u202d","\u202e":"\\u202e","\u202f":"\\u202f","\u2060":"\\u2060","\u2061":"\\u2061","\u2062":"\\u2062","\u2063":"\\u2063","\u2064":"\\u2064","\u2065":"\\u2065","\u2066":"\\u2066","\u2067":"\\u2067",
"\u2068":"\\u2068","\u2069":"\\u2069","\u206a":"\\u206a","\u206b":"\\u206b","\u206c":"\\u206c","\u206d":"\\u206d","\u206e":"\\u206e","\u206f":"\\u206f","\ufeff":"\\ufeff","\ufff0":"\\ufff0","\ufff1":"\\ufff1","\ufff2":"\\ufff2","\ufff3":"\\ufff3","\ufff4":"\\ufff4","\ufff5":"\\ufff5","\ufff6":"\\ufff6","\ufff7":"\\ufff7","\ufff8":"\\ufff8","\ufff9":"\\ufff9","\ufffa":"\\ufffa","\ufffb":"\\ufffb","\ufffc":"\\ufffc","\ufffd":"\\ufffd","\ufffe":"\\ufffe","\uffff":"\\uffff"},s=/[\x00-\x1f\ud800-\udfff\ufffe\uffff\u0300-\u0333\u033d-\u0346\u034a-\u034c\u0350-\u0352\u0357-\u0358\u035c-\u0362\u0374\u037e\u0387\u0591-\u05af\u05c4\u0610-\u0617\u0653-\u0654\u0657-\u065b\u065d-\u065e\u06df-\u06e2\u06eb-\u06ec\u0730\u0732-\u0733\u0735-\u0736\u073a\u073d\u073f-\u0741\u0743\u0745\u0747\u07eb-\u07f1\u0951\u0958-\u095f\u09dc-\u09dd\u09df\u0a33\u0a36\u0a59-\u0a5b\u0a5e\u0b5c-\u0b5d\u0e38-\u0e39\u0f43\u0f4d\u0f52\u0f57\u0f5c\u0f69\u0f72-\u0f76\u0f78\u0f80-\u0f83\u0f93\u0f9d\u0fa2\u0fa7\u0fac\u0fb9\u1939-\u193a\u1a17\u1b6b\u1cda-\u1cdb\u1dc0-\u1dcf\u1dfc\u1dfe\u1f71\u1f73\u1f75\u1f77\u1f79\u1f7b\u1f7d\u1fbb\u1fbe\u1fc9\u1fcb\u1fd3\u1fdb\u1fe3\u1feb\u1fee-\u1fef\u1ff9\u1ffb\u1ffd\u2000-\u2001\u20d0-\u20d1\u20d4-\u20d7\u20e7-\u20e9\u2126\u212a-\u212b\u2329-\u232a\u2adc\u302b-\u302c\uaab2-\uaab3\uf900-\ufa0d\ufa10\ufa12\ufa15-\ufa1e\ufa20\ufa22\ufa25-\ufa26\ufa2a-\ufa2d\ufa30-\ufa6d\ufa70-\ufad9\ufb1d\ufb1f\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufb4e\ufff0-\uffff]/g,
E,O=JSON&&JSON.stringify||function(a){w.lastIndex=0;w.test(a)&&(a=a.replace(w,function(a){return G[a]}));return'"'+a+'"'},t=function(a){var b,c={},e=[];for(b=0;b<65536;b++)e.push(String.fromCharCode(b));a.lastIndex=0;e.join("").replace(a,function(a){c[a]="\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4);return""});a.lastIndex=0;return c};d.quote=function(a){a=O(a);s.lastIndex=0;if(!s.test(a))return a;E||(E=t(s));return a.replace(s,function(a){return E[a]})};var q="websocket,xdr-streaming,xhr-streaming,iframe-eventsource,iframe-htmlfile,xdr-polling,xhr-polling,iframe-xhr-polling,jsonp-polling".split(",");
d.probeProtocols=function(a){for(var b={},c=0;c0&&g(a)};c.websocket!==!1&&g(["websocket"]);e["xhr-streaming"]&&!c.null_origin?d.push("xhr-streaming"):e["xdr-streaming"]&&!c.cookie_needed&&!c.null_origin?d.push("xdr-streaming"):g(["iframe-eventsource","iframe-htmlfile"]);e["xhr-polling"]&&
!c.null_origin?d.push("xhr-polling"):e["xdr-polling"]&&!c.cookie_needed&&!c.null_origin?d.push("xdr-polling"):g(["iframe-xhr-polling","jsonp-polling"]);return d};d.defaultOptions=function(){return{devel:!1,debug:!1,protocols_whitelist:[],info:void 0,rtt:void 0,max_window_time:4E3,init_window_size:4096}};d.createHook=function(){var a="a"+d.random_string(8);if(!("_sockjs_global"in g)){var b={};g._sockjs_global=function(a){a in b||(b[a]={id:a,del:function(){delete b[a]}});return b[a]}}return g._sockjs_global(a)};
d.attachMessage=function(a){d.attachEvent("message",a)};d.attachEvent=function(a,b){typeof g.addEventListener!=="undefined"?g.addEventListener(a,b,!1):(m.attachEvent("on"+a,b),g.attachEvent("on"+a,b))};d.detachMessage=function(a){d.detachEvent("message",a)};d.detachEvent=function(a,b){typeof g.addEventListener!=="undefined"?g.removeEventListener(a,b,!1):(m.detachEvent("on"+a,b),g.detachEvent("on"+a,b))};var o={},F=!1,x=function(){for(var a in o)o[a](),delete o[a]};d.attachEvent("unload",function(){F||
(F=!0,x())});d.unload_add=function(a){var b=d.random_string(8);o[b]=a;F&&d.delay(x);return b};d.unload_del=function(a){a in o&&delete o[a]};d.createIframe=function(a,b){var c=m.createElement("iframe"),e,h,z=function(){clearTimeout(e);try{c.onload=null}catch(a){}c.onerror=null},f=function(){c&&(z(),setTimeout(function(){c&&c.parentNode.removeChild(c);c=null},0),d.unload_del(h))},g=function(a){c&&(f(),b(a))};c.src=a;c.style.display="none";c.style.position="absolute";c.onerror=function(){g("onerror")};
c.onload=function(){clearTimeout(e);e=setTimeout(function(){g("onload timeout")},2E3)};m.body.appendChild(c);e=setTimeout(function(){g("timeout")},15E3);h=d.unload_add(f);return{post:function(a,b){try{c&&c.contentWindow&&c.contentWindow.postMessage(a,b)}catch(e){}},cleanup:f,loaded:z}};d.createHtmlfile=function(a,b){var c=new ActiveXObject("htmlfile"),e,h,f,i=function(){clearTimeout(e)},j=function(){c&&(i(),d.unload_del(h),f.parentNode.removeChild(f),f=c=null,CollectGarbage())};c.open();c.write('