window.RTS=function(){function t(t){t=t||{},this.clientVersion=16,this.connectionId="",this.connection_startTime,this.socket_connection_time,this.timeoutPeriod=3e4,this.pingTimerInterval=15e3,this.tokenExpiryBufferPeriod=36e5,this.tokenFetchTimeout=2e4,this.channels={},this.timeouts={},this.callbacks={},this.timerID=0,this.attempts=0,this.clientClose,this.traceIdIncreamenter=0,this.reconnectionFlag=!1,this.fallbackWsFailureFlag=!1,this.fallbackWsNullFlag=!1,this.firstConnectionSuccess=!1,this.stableConnectionTimer,this.stableConnectionTimeout=2e4,this.resubscriptionTimeout=3e3,this.resubscriptionMaxAttempts=3,this.webhookSendCustomDataLimit=200,this.ping_worker,this.workerURL,this.selfAckOpt=2,this.reconnectionAttempts=t.reconnectionAttempts||3,this.sioReconnectionAttempts=t.sioReconnectionAttempts||1/0,this.reconnectionDelay=this._isNumberAndGreaterThanZero(t.reconnectionDelay)?t.reconnectionDelay:1e3,this.reconnectionDelayMax=t.reconnectionDelayMax||6e4,this.debug=t.debug||!1,this.logger=t.logger||window.console,this.origin=t.origin,this.onConnect=t.onConnect||function(){},this.onConnectError=t.onConnectError||function(){},this.onReconnect=t.onReconnect||function(){},this.onReconnecting=t.onReconnecting||function(){},this.onDisconnect=t.onDisconnect||function(){},this.onFallback=t.onFallback||function(){},this.onMessage=t.onMessage||function(){},this.onAppMessage=t.onAppMessage,this.isHealthCheckEnabled=t.isHealthCheckEnabled||!1,this.disconnectCount=0,this.connected=!1,this.serviceId=t.serviceId||"rts",this.traceId=t.ti||this._generateUid(),t.accId?this.accId=t.accId:this._throw("accId not provided"),t.userId?this.userId=t.userId:this._throw("userId not provided"),t.token?this.token=encodeURIComponent(t.token):this.token="",t.webURL&&(this.webURL=t.webURL),t.leaveOnUnload&&this.leaveOnUnload(),t.hookId?this.hookId=t.hookId:this.hookId="","function"==typeof t.fetchToken&&(this.fetchToken=t.fetchToken),this.socket=null,this.nocookie=null,this.sioUpgradationAllowedServices=[],this.sioUpgradeConnectionId="",this.sioUpgradeServiceId="serviceIdSioUpgradation",this.sioUpgradeAccId="ACCIDSOCIO",this.sioUpgradeUserId="userIdSioUpgradation",this.sioUpgradeTraceId=this._generateUid(),this.isSioUpgradeClose=null,this.upgradedWebsocket=null,this.sioIntervalId,this.initializeSocket(),this.initializeTokenRefresh()}return t.prototype={constructor:t,generateWsUrl:function(t,e){var n="wss";return 0==t.indexOf("http://localhost")&&(n="ws"),t.replace(/[^:]*/,n)+"/ws?"+e},generateSioUrl:function(){return this.origin+"?"+this._getQueryParams()},errorHandler:function(t){var e=this;if(e.log("attempts: ",e.attempts),e.websocket.readyState<2)try{e.websocket.close()}catch(t){e.log(t)}e.attempts>=e.reconnectionAttempts-1?(e.log("failed to connect via websocket, falling back to sio"),e.timerID&&(window.clearTimeout(e.timerID),e.timerID=0,e.attempts=0),delete e.websocket,this.fallbackWsFailureFlag=!0,e.initializeSocketIO(),null!=window.WebSocket&&e.sioUpgradationAllowedServices.includes(e.serviceId)&&window.Worker&&e.socketioUpgradationWithWorker()):(this.firstConnectionSuccess&&(this.reconnectionFlag=!0),e.timerID||(e.log("setting timerID"),e.timerID=setTimeout(function(){clearTimeout(e.timerID),e.timerID=0,e.connected||e.errorHandler()},e.reconnectionDelay*(e._isNumberAndGreaterThanZero(e.attempts)?e.attempts:1)*10),e._onReconnecting(),null!=navigator&&0==navigator.onLine||(e.log("incrementing retry attempts"),e.attempts++),e.initializeSocket()))},initializeSocket:function(){var n,o=this;this.checkCookieSupport(function(t){var e;o.nocookie=t,1!=o.clientClose&&(n=o._getQueryParams(t),t=o.generateWsUrl(o.origin,n),null!=window.WebSocket?(o.log("creating new socket,",new Date),e=new WebSocket(t),o.websocket=e,o.websocket.onopen=function(){o.websocket==e&&(o.stableConnectionTimer=setTimeout(function(){o.attempts=0},o.stableConnectionTimeout),o.reconnectionFlag&&o._onReconnect(),o.initializeWebSocket(e))},o.websocket.onerror=function(t){o.websocket==e&&(window.clearTimeout(o.stableConnectionTimer),o.connected=!1,o.errorHandler(t))}):(o.reconnectionFlag&&(o.fallbackWsNullFlag=!0),o.initializeSocketIO()))})},initializeWebSocket:function(e){this.log("Initializing websocket connnection..."),this.connection_startTime=(new Date).getTime();const n=this;var t,o=null;this.websocket.onmessage=function(t){n.websocket==e&&("PONG"!=(t=n._safelyParseJSON(t.data)).event&&n.log("Received Data.",t),n._onEvent(t))},this.websocket.onclose=function(t){n.websocket==e&&(window.clearTimeout(n.stableConnectionTimer),n.clientClose?(n.log("websocket closed"),n.websocket.close()):(n.connected&&n._onDisconnect("ping timeout",n),n.log("attempting to reconnect"),n.errorHandler(t)),window.Worker&&n.ping_worker?(n.ping_worker.postMessage({type:"stop_interval",intervalReference:null}),URL.revokeObjectURL(n.workerURL)):clearInterval(o))},this.reconnectionFlag||(this._onConnect(),this.reconnectionFlag=!0),window.Worker?(t=(t=function(){this.onmessage=function(t){if(t.data.type!=this.undefined)switch(t.data.type){case"start_interval":const e=this.setInterval(function(){this.postMessage({type:"trigger_callback",intervalReference:e})},t.data.Interval);this.postMessage({type:"initiated",intervalReference:e});break;case"stop_interval":clearInterval(t.data.intervalReference),close()}}}.toString()).substring(t.indexOf("{")+1,t.lastIndexOf("}")),t=new Blob([t],{type:"application/javascript"}),this.workerURL=URL.createObjectURL(t),this.ping_worker=new Worker(this.workerURL),this.ping_worker.onmessage=function(t){"trigger_callback"==t.data.type?n.websocket==e?1==e.readyState&&e.send("9"):(n.ping_worker.postMessage({type:"stop_interval",intervalReference:o}),URL.revokeObjectURL(n.workerURL)):"initiated"==t.data.type&&(o=t.data.intervalReference)},this.ping_worker.postMessage({type:"start_interval",Interval:n.pingTimerInterval})):o=setInterval(function(){n.websocket==e?1==e.readyState&&e.send("9"):clearInterval(o)},n.pingTimerInterval)},initializeSocketIO:function(){1!=this.clientClose&&(this.log("Initializing socket connection..."),this.connection_startTime=(new Date).getTime(),this.checkCookieSupport(function(t){this.nocookie=t;t=this.io.Manager(this.generateSioUrl(),{forceBase64:!0,reconnectionAttempts:this.sioReconnectionAttempts,reconnectionDelay:this.reconnectionDelay,reconnectionDelayMax:this.reconnectionDelayMax});this.socket=t.socket("/"),this.initializeSocketListeners()}.bind(this)))},socketioUpgradationWithWorker:function(){var c=this,t=(t=function(){this.onmessage=function(t){var{command:e,retries:n,maxRetries:o,baseDelay:i,maxDelay:r,delay:t}=t.data;"start"===e?this.postMessage({command:"initiated",retries:n,maxRetries:o,baseDelay:i,maxDelay:r}):"retry"===e?this.postMessage({command:"retry",retries:n,maxRetries:o,baseDelay:i,maxDelay:r,delay:t}):"complete"===e&&this.postMessage({command:"completed"})}}.toString()).substring(t.indexOf("{")+1,t.lastIndexOf("}")),t=new Blob([t],{type:"application/javascript"});this.workerURL=URL.createObjectURL(t);const a=new Worker(this.workerURL);a.onmessage=function(t){let{command:e,retries:n,maxRetries:o,baseDelay:i,maxDelay:r,delay:s}=t.data;"initiated"===e?async function(t,e,n,o){if(t<=e){var i=Math.min(n*2**t,o);if(!1!==await c.socketioUpgradation(t,e))return console.error("Socket.io upgradation failed"),void a.postMessage({command:"retry",retries:t,maxRetries:e,baseDelay:n,maxDelay:o,delay:i});console.log("Socket.io upgradation completed successfully")}else console.log("Max retries reached. Socket.io upgradation failed.");a.postMessage({command:"complete"})}(n,o,i,r).then():"retry"===e?(n++,n>o?a.postMessage({command:"start",retries:n,maxRetries:o,baseDelay:i,maxDelay:r}):(console.log(`Retry ${n}. Waiting for ${s}ms...`),setTimeout(()=>{a.postMessage({command:"start",retries:n,maxRetries:o,baseDelay:i,maxDelay:r})},s))):"completed"===e&&a.terminate()},a.postMessage({command:"start",retries:0,maxRetries:5,baseDelay:1e3,maxDelay:2e4})},socketioUpgradation:function(n,o){var i=this,r=null,s=i._getQueryParamsForSioUpgrade(i.nocookie),c=i.generateWsUrl(i.origin,s);const a=JSON.stringify({event:"ping",serviceId:i.sioUpgradeServiceId,userId:i.sioUpgradeUserId,accId:i.sioUpgradeAccId});return new Promise(e=>{function t(t){for(var e=new Date;new Date-e{i.upgradedWebsocket.send("9")},1e4),t(1e3))},i.upgradedWebsocket.onerror=function(){r=!0,i.upgradedWebsocket=null,e(r)}):i.upgradedWebsocket.readyState===WebSocket.OPEN?s.includes(i.sioUpgradeAccId)&&(i.upgradedWebsocket.send(a),t(1e3)):(r=!0,i.upgradedWebsocket=null,e(r)),i.upgradedWebsocket.onmessage=function(t){i.logger.log(t.data);t=JSON.parse(t.data);"PONG"===t.event&&t.userId===i.sioUpgradeUserId&&t.accId===i.sioUpgradeAccId&&t.serviceId===i.sioUpgradeServiceId&&(t.isSioUpgradeClose?(clearInterval(i.sioIntervalId),i.upgradedWebsocket.close(),i.logger.log("Test websocket closed"),i.upgradedWebsocket=null,e(r=!1)):(r=!0,n===o&&clearInterval(i.sioIntervalId),e(r)))}})},initializeSocketListeners:function(){this.log("Binding the socket listeners..."),this.socket.on("connect",this._onConnect.bind(this)),this.socket.on("connect_error",this._onConnectError.bind(this)),this.socket.on("reconnecting",this._onReconnecting.bind(this)),this.socket.on("reconnect",this._onReconnect.bind(this)),this.socket.on("disconnect",this._onDisconnect.bind(this)),this.socket.on("message",this._onMessage.bind(this))},initializeTokenRefresh:function(){var e,t;null==this.token||""==this.token||"function"!=typeof this.fetchToken||(t=this.getTokenExpiry(decodeURIComponent(this.token)))!=1/0&&(e=this,(t=t-(new Date).getTime()-this.tokenExpiryBufferPeriod)<=0&&(t+=this.tokenExpiryBufferPeriod),setTimeout(function(){1!=e.clientClose&&e.fetchToken(function(t){null!=t&&""!=t&&(e.token=encodeURIComponent(t),e.socket&&e.socket.io&&e.socket.io.uri&&(e.socket.io.uri=e.generateSioUrl()),e.connected&&e.grant(t)),setTimeout(function(){e.initializeTokenRefresh()},e.tokenFetchTimeout)})},t))},getTokenExpiry:function(t){var t=JSON.parse(atob(t.split(".")[1])),e=1/0;isNaN(t.exp)||(e=Math.min(e,1e3*parseInt(t.exp)));for(var n=t.credentials,o=0;othis.webhookSendCustomDataLimit?(r="Data limit exceeded. Failed to send webhook",null!=o?o(r,null):r):n&&0!==n.length?void this._sendMessage({data:e,hookId:n,event:"webhooksend",channel:t,token:i.token,traceId:i.traceId,serviceId:this.serviceId,opt:i.opt||0},function(t,e){return t&&this.log("Could not send webhook: ",t),null!=o?o(t,e):t}):(r="Hook id missing in webhook send",null!=o?o(r,null):r)},disconnect:function(){this.socket&&this.socket.io.disconnect()},reconnect:function(t){this.socket.io.connect()},_fireCallback:function(t){var e;"function"==typeof t&&(e=Array.prototype.slice.call(arguments,1,arguments.length),setTimeout(function(){t.apply(null,e)},0))},_connectionCheck:function(t){var e="Not performing action as client is not connected.";return this.websocket?1==this.websocket.readyState||(this.log(e),t&&t(e),!1):(!1===this.connected&&(this.log(e),t&&t(e)),this.connected)},_sendMessage:function(t,e){const n=t;e&&(t=this._generateUid(),this.callbacks[t]=e,n.clientId=t,this._startTimeoutErrorTimer(t)),n.accId=this.accId,this.websocket?(9!=n&&this.log("Sending data",n),this.websocket.send(JSON.stringify(n))):this.socket.emit("message",JSON.stringify(n))},_startTimeoutErrorTimer:function(t){const e=this;e.timeouts[t]=setTimeout(function(){e.callbacks[t]&&e.callbacks[t]("Timeout Error"),delete e.timeouts[t]},this.timeoutPeriod)},_generateUid:function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var e=16*Math.random()|0;return("x"==t?e:3&e|8).toString(16)})},_isNumberAndGreaterThanZero:function(t){return"number"==typeof t&&0=this._reconnectionAttempts?(h("reconnect failed"),this.backoff.reset(),this.emitAll("reconnect_failed"),this.reconnecting=!1):(t=this.backoff.duration(),h("will wait %dms before reconnect attempt",t),this.reconnecting=!0,e=setTimeout(function(){n.skipReconnect||(h("attempting reconnect"),n.emitAll("reconnect_attempt",n.backoff.attempts),n.emitAll("reconnecting",n.backoff.attempts),n.skipReconnect||n.open(function(t){t?(h("reconnect attempt error"),n.reconnecting=!1,n.reconnect(),n.emitAll("reconnect_error",t.data)):(h("reconnect success"),n.onreconnect())}))},t),this.subs.push({destroy:function(){clearTimeout(e)}}))},p.prototype.onreconnect=function(){var t=this.backoff.attempts;this.reconnecting=!1,this.backoff.reset(),this.updateSocketIds(),this.emitAll("reconnect",t)}},{"./on":4,"./socket":5,"./url":6,backo2:7,"component-bind":8,"component-emitter":9,debug:10,"engine.io-client":11,indexof:40,"object-component":41,"socket.io-parser":44}],4:[function(t,e,n){e.exports=function(t,e,n){return t.on(e,n),{destroy:function(){t.removeListener(e,n)}}}},{}],5:[function(t,e,n){var r=t("socket.io-parser"),o=t("component-emitter"),s=t("to-array"),i=t("./on"),c=t("component-bind"),a=t("debug")("socket.io-client:socket"),h=t("has-binary");e.exports=p;var u={connect:1,connect_error:1,connect_timeout:1,disconnect:1,error:1,reconnect:1,reconnect_attempt:1,reconnect_failed:1,reconnect_error:1,reconnecting:1},l=o.prototype.emit;function p(t,e){this.io=t,this.nsp=e,(this.json=this).ids=0,this.acks={},this.io.autoConnect&&this.open(),this.receiveBuffer=[],this.sendBuffer=[],this.connected=!1,this.disconnected=!0}o(p.prototype),p.prototype.subEvents=function(){var t;this.subs||(t=this.io,this.subs=[i(t,"open",c(this,"onopen")),i(t,"packet",c(this,"onpacket")),i(t,"close",c(this,"onclose"))])},p.prototype.open=p.prototype.connect=function(){return this.connected||(this.subEvents(),this.io.open(),"open"==this.io.readyState&&this.onopen()),this},p.prototype.send=function(){var t=s(arguments);return t.unshift("message"),this.emit.apply(this,t),this},p.prototype.emit=function(t){if(u.hasOwnProperty(t))return l.apply(this,arguments),this;var e=s(arguments),n=r.EVENT,n={type:n=h(e)?r.BINARY_EVENT:n,data:e};return"function"==typeof e[e.length-1]&&(a("emitting packet with ack id %d",this.ids),this.acks[this.ids]=e.pop(),n.id=this.ids++),this.connected?this.packet(n):this.sendBuffer.push(n),this},p.prototype.packet=function(t){t.nsp=this.nsp,this.io.packet(t)},p.prototype.onopen=function(){a("transport is open - connecting"),"/"!=this.nsp&&this.packet({type:r.CONNECT})},p.prototype.onclose=function(t){a("close (%s)",t),this.connected=!1,this.disconnected=!0,delete this.id,this.emit("disconnect",t)},p.prototype.onpacket=function(t){if(t.nsp==this.nsp)switch(t.type){case r.CONNECT:this.onconnect();break;case r.EVENT:case r.BINARY_EVENT:this.onevent(t);break;case r.ACK:case r.BINARY_ACK:this.onack(t);break;case r.DISCONNECT:this.ondisconnect();break;case r.ERROR:this.emit("error",t.data)}},p.prototype.onevent=function(t){var e=t.data||[];a("emitting event %j",e),null!=t.id&&(a("attaching ack callback to event"),e.push(this.ack(t.id))),this.connected?l.apply(this,e):this.receiveBuffer.push(e)},p.prototype.ack=function(n){var o=this,i=!1;return function(){var t,e;i||(i=!0,t=s(arguments),a("sending ack %j",t),e=h(t)?r.BINARY_ACK:r.ACK,o.packet({type:e,id:n,data:t}))}},p.prototype.onack=function(t){a("calling ack %s with %j",t.id,t.data),this.acks[t.id].apply(this,t.data),delete this.acks[t.id]},p.prototype.onconnect=function(){this.connected=!0,this.disconnected=!1,this.emit("connect"),this.emitBuffered()},p.prototype.emitBuffered=function(){for(var t=0;t';r=document.createElement(t)}catch(t){(r=document.createElement("iframe")).name=s.iframeId,r.src="javascript:0"}r.id=s.iframeId,s.form.appendChild(r),s.iframe=r}this.form||(n=document.createElement("form"),o=document.createElement("textarea"),i=this.iframeId="eio_iframe_"+this.index,n.className="socketio",n.style.position="absolute",n.style.top="-1000px",n.style.left="-1000px",n.target=i,n.method="POST",n.setAttribute("accept-charset","utf-8"),o.name="d",n.appendChild(o),document.body.appendChild(n),this.form=n,this.area=o),this.form.action=this.uri(),a(),t=t.replace(u,"\\\n"),this.area.value=t.replace(h,"\\n");try{this.form.submit()}catch(t){}this.iframe.attachEvent?this.iframe.onreadystatechange=function(){"complete"==s.iframe.readyState&&c()}:this.iframe.onload=c}}.call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./polling":18,"component-inherit":21}],17:[function(u,l,t){!function(o){var i=u("xmlhttprequest"),r=u("./polling"),t=u("component-emitter"),e=u("component-inherit"),s=u("debug")("engine.io-client:polling-xhr");function n(){}function c(t){var e,n;r.call(this,t),o.location&&(e="https:"==location.protocol,n=(n=location.port)||(e?443:80),this.xd=t.hostname!=o.location.hostname||n!=t.port,this.xs=t.secure!=e)}function a(t){this.method=t.method||"GET",this.uri=t.uri,this.xd=!!t.xd,this.xs=!!t.xs,this.async=!1!==t.async,this.data=null!=t.data?t.data:null,this.agent=t.agent,this.isBinary=t.isBinary,this.supportsBinary=t.supportsBinary,this.enablesXDR=t.enablesXDR,this.pfx=t.pfx,this.key=t.key,this.passphrase=t.passphrase,this.cert=t.cert,this.ca=t.ca,this.ciphers=t.ciphers,this.rejectUnauthorized=t.rejectUnauthorized,this.create()}function h(){for(var t in a.requests)a.requests.hasOwnProperty(t)&&a.requests[t].abort()}l.exports=c,l.exports.Request=a,e(c,r),c.prototype.supportsBinary=!0,c.prototype.request=function(t){return(t=t||{}).uri=this.uri(),t.xd=this.xd,t.xs=this.xs,t.agent=this.agent||!1,t.supportsBinary=this.supportsBinary,t.enablesXDR=this.enablesXDR,t.pfx=this.pfx,t.key=this.key,t.passphrase=this.passphrase,t.cert=this.cert,t.ca=this.ca,t.ciphers=this.ciphers,t.rejectUnauthorized=this.rejectUnauthorized,new a(t)},c.prototype.doWrite=function(t,e){var t=this.request({method:"POST",data:t,isBinary:"string"!=typeof t&&void 0!==t}),n=this;t.on("success",e),t.on("error",function(t){n.onError("xhr post error",t)}),this.sendXhr=t},c.prototype.doPoll=function(){s("xhr poll");var t=this.request(),e=this;t.on("data",function(t){e.onData(t)}),t.on("error",function(t){e.onError("xhr poll error",t)}),this.pollXhr=t},t(a.prototype),a.prototype.create=function(){var t={agent:this.agent,xdomain:this.xd,xscheme:this.xs,enablesXDR:this.enablesXDR};t.pfx=this.pfx,t.key=this.key,t.passphrase=this.passphrase,t.cert=this.cert,t.ca=this.ca,t.ciphers=this.ciphers,t.rejectUnauthorized=this.rejectUnauthorized;var e=this.xhr=new i(t),n=this;try{if(s("xhr open %s: %s",this.method,this.uri),e.open(this.method,this.uri,this.async),this.supportsBinary&&(e.responseType="arraybuffer"),"POST"==this.method)try{this.isBinary?e.setRequestHeader("Content-type","application/octet-stream"):e.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(t){}"withCredentials"in e&&(e.withCredentials=!0),this.hasXDR()?(e.onload=function(){n.onLoad()},e.onerror=function(){n.onError(e.responseText)}):e.onreadystatechange=function(){4==e.readyState&&(200==e.status||1223==e.status?n.onLoad():setTimeout(function(){n.onError(e.status)},0))},s("xhr data %s",this.data),e.send(this.data)}catch(t){return void setTimeout(function(){n.onError(t)},0)}o.document&&(this.index=a.requestsCount++,a.requests[this.index]=this)},a.prototype.onSuccess=function(){this.emit("success"),this.cleanup()},a.prototype.onData=function(t){this.emit("data",t),this.onSuccess()},a.prototype.onError=function(t){this.emit("error",t),this.cleanup(!0)},a.prototype.cleanup=function(t){if(void 0!==this.xhr&&null!==this.xhr){if(this.hasXDR()?this.xhr.onload=this.xhr.onerror=n:this.xhr.onreadystatechange=n,t)try{this.xhr.abort()}catch(t){}o.document&&delete a.requests[this.index],this.xhr=null}},a.prototype.onLoad=function(){var t,e;try{try{e=this.xhr.getResponseHeader("Content-Type").split(";")[0]}catch(t){}t="application/octet-stream"===e?this.xhr.response:this.supportsBinary?"ok":this.xhr.responseText}catch(t){this.onError(t)}null!=t&&this.onData(t)},a.prototype.hasXDR=function(){return void 0!==o.XDomainRequest&&!this.xs&&this.enablesXDR},a.prototype.abort=function(){this.cleanup()},o.document&&(a.requestsCount=0,a.requests={},o.attachEvent?o.attachEvent("onunload",h):o.addEventListener&&o.addEventListener("beforeunload",h,!1))}.call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./polling":18,"component-emitter":9,"component-inherit":21,debug:22,xmlhttprequest:20}],18:[function(t,e,n){var o=t("../transport"),i=t("parseqs"),r=t("engine.io-parser"),s=t("component-inherit"),c=t("debug")("engine.io-client:polling");e.exports=h;var a=null!=new(t("xmlhttprequest"))({xdomain:!1}).responseType;function h(t){var e=t&&t.forceBase64;a&&!e||(this.supportsBinary=!1),o.call(this,t)}s(h,o),h.prototype.name="polling",h.prototype.doOpen=function(){this.poll()},h.prototype.pause=function(t){var e,n=this;function o(){c("paused"),n.readyState="paused",t()}this.readyState="pausing",this.polling||!this.writable?(e=0,this.polling&&(c("we are currently polling - waiting to pause"),e++,this.once("pollComplete",function(){c("pre-pause polling complete"),--e||o()})),this.writable||(c("we are currently writing - waiting to pause"),e++,this.once("drain",function(){c("pre-pause writing complete"),--e||o()}))):o()},h.prototype.poll=function(){c("polling"),this.polling=!0,this.doPoll(),this.emit("poll")},h.prototype.onData=function(t){var o=this;c("polling got data %s",t);r.decodePayload(t,this.socket.binaryType,function(t,e,n){if("opening"==o.readyState&&o.onOpen(),"close"==t.type)return o.onClose(),!1;o.onPacket(t)}),"closed"!=this.readyState&&(this.polling=!1,this.emit("pollComplete"),"open"==this.readyState?this.poll():c('ignoring poll - transport state "%s"',this.readyState))},h.prototype.doClose=function(){var t=this;function e(){c("writing close packet"),t.write([{type:"close"}])}"open"==this.readyState?(c("transport open - closing"),e()):(c("transport not open - deferring close"),this.once("open",e))},h.prototype.write=function(t){this.writable=!1;function e(){n.writable=!0,n.emit("drain")}var n=this;r.encodePayload(t,this.supportsBinary,function(t){n.doWrite(t,e)})},h.prototype.uri=function(){var t=this.query||{},e=this.secure?"https":"http",n="";return!1!==this.timestampRequests&&(t[this.timestampParam]=+new Date+"-"+o.timestamps++),this.supportsBinary||t.sid||(t.b64=1),t=i.encode(t),this.port&&("https"==e&&443!=this.port||"http"==e&&80!=this.port)&&(n=":"+this.port),t.length&&(t="?"+t),e+"://"+this.hostname+n+this.path+t}},{"../transport":14,"component-inherit":21,debug:22,"engine.io-parser":25,parseqs:33,xmlhttprequest:20}],19:[function(t,e,n){var o=t("../transport"),i=t("engine.io-parser"),r=t("parseqs"),s=t("component-inherit"),c=t("debug")("engine.io-client:websocket"),a=t("ws");function h(t){t&&t.forceBase64&&(this.supportsBinary=!1),o.call(this,t)}s(e.exports=h,o),h.prototype.name="websocket",h.prototype.supportsBinary=!0,h.prototype.doOpen=function(){var t,e;this.check()&&(t=this.uri(),(e={agent:this.agent}).pfx=this.pfx,e.key=this.key,e.passphrase=this.passphrase,e.cert=this.cert,e.ca=this.ca,e.ciphers=this.ciphers,e.rejectUnauthorized=this.rejectUnauthorized,this.ws=new a(t,void 0,e),void 0===this.ws.binaryType&&(this.supportsBinary=!1),this.ws.binaryType="arraybuffer",this.addEventListeners())},h.prototype.addEventListeners=function(){var e=this;this.ws.onopen=function(){e.onOpen()},this.ws.onclose=function(){e.onClose()},this.ws.onmessage=function(t){e.onData(t.data)},this.ws.onerror=function(t){e.onError("websocket error",t)}},"undefined"!=typeof navigator&&/iPad|iPhone|iPod/i.test(navigator.userAgent)&&(h.prototype.onData=function(t){var e=this;setTimeout(function(){o.prototype.onData.call(e,t)},0)}),h.prototype.write=function(t){var e=this;this.writable=!1;for(var n=0,o=t.length;n>2],o+=u[(3&e[i])<<4|e[i+1]>>4],o+=u[(15&e[i+1])<<2|e[i+2]>>6],o+=u[63&e[i+2]];return n%3==2?o=o.substring(0,o.length-1)+"=":n%3==1&&(o=o.substring(0,o.length-2)+"=="),o},n.decode=function(t){var e,n,o,i,r=.75*t.length,s=t.length,c=0;"="===t[t.length-1]&&(r--,"="===t[t.length-2]&&r--);for(var r=new ArrayBuffer(r),a=new Uint8Array(r),h=0;h>4,a[c++]=(15&n)<<4|o>>2,a[c++]=(3&o)<<6|63&i;return r}}("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/")},{}],30:[function(t,a,e){!function(t){var i=t.BlobBuilder||t.WebKitBlobBuilder||t.MSBlobBuilder||t.MozBlobBuilder,e=function(){try{return 2===new Blob(["hi"]).size}catch(t){return!1}}(),n=e&&function(){try{return 2===new Blob([new Uint8Array([1,2])]).size}catch(t){return!1}}(),o=i&&i.prototype.append&&i.prototype.getBlob;function r(t){for(var e=0;e>e&63|128)}function l(){if(r<=s)throw Error("Invalid byte index");var t=255&i[s];if(s++,128==(192&t))return 63&t;throw Error("Invalid continuation byte")}var p={version:"2.0.0",encode:function(t){for(var e=a(t),n=e.length,o=-1,i="";++o>6&31|192):0==(4294901760&t)?(h(t),e=c(t>>12&15|224),e+=u(t,6)):0==(4292870144&t)&&(e=c(t>>18&7|240),e+=u(t,12),e+=u(t,6)),e+=c(63&t|128)}(e[o]);return i},decode:function(t){i=a(t),r=i.length,s=0;for(var e,n=[];!1!==(e=function(){var t,e;if(r>>10&1023|55296),e=56320|1023&e),i+=c(e);return i}(n)}};if(0,e&&!e.nodeType)if(n)n.exports=p;else{var f,d={}.hasOwnProperty;for(f in p)d.call(p,f)&&(e[f]=p[f])}else t.utf8=p}(this)}.call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],32:[function(t,a,e){!function(e){var n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,i=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,r=/(?:^|:|,)(?:\s*\[)+/g,s=/^\s+/,c=/\s+$/;a.exports=function(t){return"string"==typeof t&&t?(t=t.replace(s,"").replace(c,""),e.JSON&&JSON.parse?JSON.parse(t):n.test(t.replace(o,"@").replace(i,"]").replace(r,""))?new Function("return "+t)():void 0):null}}.call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],33:[function(t,e,n){n.encode=function(t){var e,n="";for(e in t)t.hasOwnProperty(e)&&(n.length&&(n+="&"),n+=encodeURIComponent(e)+"="+encodeURIComponent(t[e]));return n},n.decode=function(t){for(var e={},n=t.split("&"),o=0,i=n.length;o