window.RTS=(()=>{function e(e){e=e||{},this.clientVersion=20,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.disableCookieCheck=!0,this.stableConnectionTimer,this.stableConnectionTimeout=2e4,this.resubscriptionTimeout=3e3,this.resubscriptionMaxAttempts=3,this.webhookSendCustomDataLimit=200,this.ping_worker,this.workerURL,this.selfAckOpt=2,this.reconnectionAttempts=e.reconnectionAttempts||3,this.sioReconnectionAttempts=e.sioReconnectionAttempts||1/0,this.reconnectionDelay=this._isNumberAndGreaterThanZero(e.reconnectionDelay)?e.reconnectionDelay:1e3,this.reconnectionDelayMax=e.reconnectionDelayMax||6e4,this.debug=e.debug||!1,this.logger=e.logger||window.console,this.origin=e.origin,this.onConnect=e.onConnect||function(){},this.onConnectError=e.onConnectError||function(){},this.onReconnect=e.onReconnect||function(){},this.onReconnecting=e.onReconnecting||function(){},this.onDisconnect=e.onDisconnect||function(){},this.onFallback=e.onFallback||function(){},this.onMessage=e.onMessage||function(){},this.onAppMessage=e.onAppMessage,this.isHealthCheckEnabled=e.isHealthCheckEnabled||!1,this.disconnectCount=0,this.connected=!1,this.serviceId=e.serviceId||"rts",this.traceId=e.ti||this._generateUid(),e.accId?this.accId=e.accId:this._throw("accId not provided"),e.userId?this.userId=e.userId:this._throw("userId not provided"),e.token?this.token=encodeURIComponent(e.token):this.token="",e.webURL&&(this.webURL=e.webURL),e.leaveOnUnload&&this.leaveOnUnload(),e.hookId?this.hookId=e.hookId:this.hookId="","function"==typeof e.fetchToken&&(this.fetchToken=e.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 e.prototype={constructor:e,generateWsUrl:function(e,t){var n="wss";return 0==e.indexOf("http://localhost")&&(n="ws"),e.replace(/[^:]*/,n)+"/ws?"+t},generateSioUrl:function(){return this.origin+"?"+this._getQueryParams()},errorHandler:function(e){var t=this;if(t.log("attempts: ",t.attempts),t.websocket.readyState<2)try{t.websocket.close()}catch(e){t.log(e)}t.attempts>=t.reconnectionAttempts-1?(t.log("failed to connect via websocket, falling back to sio"),t.timerID&&(window.clearTimeout(t.timerID),t.timerID=0,t.attempts=0),delete t.websocket,this.fallbackWsFailureFlag=!0,t.initializeSocketIO(),null!=window.WebSocket&&t.sioUpgradationAllowedServices.includes(t.serviceId)&&window.Worker&&t.socketioUpgradationWithWorker()):(this.firstConnectionSuccess&&(this.reconnectionFlag=!0),t.timerID||(t.log("setting timerID"),t.timerID=setTimeout(function(){clearTimeout(t.timerID),t.timerID=0,t.connected||t.errorHandler()},t.reconnectionDelay*(t._isNumberAndGreaterThanZero(t.attempts)?t.attempts:1)*10),t._onReconnecting(),null!=navigator&&0==navigator.onLine||(t.log("incrementing retry attempts"),t.attempts++),t.initializeSocket()))},initializeSocket:function(){var n,o=this;this.checkCookieSupport(function(e){var t;o.nocookie=e,1!=o.clientClose&&(n=o._getQueryParams(e),e=o.generateWsUrl(o.origin,n),null!=window.WebSocket?(o.log("creating new socket,",new Date),t=new WebSocket(e),o.websocket=t,o.websocket.onopen=function(){o.websocket==t&&(o.stableConnectionTimer=setTimeout(function(){o.attempts=0},o.stableConnectionTimeout),o.reconnectionFlag&&o._onReconnect(),o.initializeWebSocket(t))},o.websocket.onerror=function(e){o.clientClose||o.websocket==t&&(window.clearTimeout(o.stableConnectionTimer),o.connected=!1,o.errorHandler(e))}):(o.reconnectionFlag&&(o.fallbackWsNullFlag=!0),o.initializeSocketIO()))})},initializeWebSocket:function(t){this.log("Initializing websocket connnection..."),this.connection_startTime=(new Date).getTime();let n=this;var e,o=null;this.websocket.onmessage=function(e){n.websocket==t&&("PONG"!=(e=n._safelyParseJSON(e.data)).event&&n.log("Received Data.",e),n._onEvent(e))},this.websocket.onclose=function(e){n.websocket==t&&(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(e)),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?(e=(e=function(){this.onmessage=function(t){if(t.data.type!=this.undefined)switch(t.data.type){case"start_interval":let 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(e.indexOf("{")+1,e.lastIndexOf("}")),e=new Blob([e],{type:"application/javascript"}),this.workerURL=URL.createObjectURL(e),this.ping_worker=new Worker(this.workerURL),this.ping_worker.onmessage=function(e){"trigger_callback"==e.data.type?n.websocket==t?1==t.readyState&&t.send("9"):(n.ping_worker.postMessage({type:"stop_interval",intervalReference:o}),URL.revokeObjectURL(n.workerURL)):"initiated"==e.data.type&&(o=e.data.intervalReference)},this.ping_worker.postMessage({type:"start_interval",Interval:n.pingTimerInterval})):o=setInterval(function(){n.websocket!=t?clearInterval(o):1==t.readyState&&t.send("9")},n.pingTimerInterval)},initializeSocketIO:function(){1!=this.clientClose&&(this.log("Initializing socket connection..."),this.connection_startTime=(new Date).getTime(),this.checkCookieSupport(function(e){this.nocookie=e;e=this.io.Manager(this.generateSioUrl(),{forceBase64:!0,reconnectionAttempts:this.sioReconnectionAttempts,reconnectionDelay:this.reconnectionDelay,reconnectionDelayMax:this.reconnectionDelayMax});this.socket=e.socket("/"),this.initializeSocketListeners()}.bind(this)))},socketioUpgradationWithWorker:function(){var c=this,e=(e=function(){this.onmessage=function(e){var{command:e,retries:t,maxRetries:n,baseDelay:o,maxDelay:i,delay:r}=e.data;"start"===e?this.postMessage({command:"initiated",retries:t,maxRetries:n,baseDelay:o,maxDelay:i}):"retry"===e?this.postMessage({command:"retry",retries:t,maxRetries:n,baseDelay:o,maxDelay:i,delay:r}):"complete"===e&&this.postMessage({command:"completed"})}}.toString()).substring(e.indexOf("{")+1,e.lastIndexOf("}")),e=new Blob([e],{type:"application/javascript"});this.workerURL=URL.createObjectURL(e);let a=new Worker(this.workerURL);a.onmessage=function(e){let{command:t,retries:n,maxRetries:o,baseDelay:i,maxDelay:r,delay:s}=e.data;"initiated"===t?(async(e,t,n,o)=>{if(e<=t){var i=Math.min(n*2**e,o);if(!1!==await c.socketioUpgradation(e,t))return console.error("Socket.io upgradation failed"),void a.postMessage({command:"retry",retries:e,maxRetries:t,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"===t?++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"===t&&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);let a=JSON.stringify({event:"ping",serviceId:i.sioUpgradeServiceId,userId:i.sioUpgradeUserId,accId:i.sioUpgradeAccId});return new Promise(t=>{function e(e){for(var t=new Date;new Date-t{i.upgradedWebsocket.send("9")},1e4),e(1e3))},i.upgradedWebsocket.onerror=function(){r=!0,i.upgradedWebsocket=null,t(r)}):i.upgradedWebsocket.readyState===WebSocket.OPEN?s.includes(i.sioUpgradeAccId)&&(i.upgradedWebsocket.send(a),e(1e3)):(r=!0,i.upgradedWebsocket=null,t(r)),i.upgradedWebsocket.onmessage=function(e){i.logger.log(e.data);e=JSON.parse(e.data);"PONG"===e.event&&e.userId===i.sioUpgradeUserId&&e.accId===i.sioUpgradeAccId&&e.serviceId===i.sioUpgradeServiceId&&(e.isSioUpgradeClose?(clearInterval(i.sioIntervalId),i.upgradedWebsocket.close(),i.logger.log("Test websocket closed"),i.upgradedWebsocket=null,t(r=!1)):(r=!0,n===o&&clearInterval(i.sioIntervalId),t(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 t,e;null!=this.token&&""!=this.token&&"function"==typeof this.fetchToken&&(e=this.getTokenExpiry(decodeURIComponent(this.token)))!=1/0&&(t=this,(e=e-(new Date).getTime()-this.tokenExpiryBufferPeriod)<=0&&(e+=this.tokenExpiryBufferPeriod),setTimeout(function(){1!=t.clientClose&&t.fetchToken(function(e){null!=e&&""!=e&&(t.token=encodeURIComponent(e),t.socket&&t.socket.io&&t.socket.io.uri&&(t.socket.io.uri=t.generateSioUrl()),t.connected)&&t.grant(e),setTimeout(function(){t.initializeTokenRefresh()},t.tokenFetchTimeout)})},e))},getTokenExpiry:function(e){for(var e=JSON.parse(atob(e.split(".")[1])),t=1/0,n=(isNaN(e.exp)||(t=Math.min(t,1e3*parseInt(e.exp))),e.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:t,hookId:n,event:"webhooksend",channel:e,token:i.token,traceId:i.traceId,serviceId:this.serviceId,opt:i.opt||0},function(e,t){return e&&this.log("Could not send webhook: ",e),null!=o?o(e,t):e}):(r="Hook id missing in webhook send",null!=o?o(r,null):r)},disconnect:function(){this.socket&&this.socket.io.disconnect()},reconnect:function(e){this.socket.io.connect()},_fireCallback:function(e){var t;"function"==typeof e&&(t=Array.prototype.slice.call(arguments,1,arguments.length),setTimeout(function(){e.apply(null,t)},0))},_connectionCheck:function(e){var t="Not performing action as client is not connected.";return this.websocket?1==this.websocket.readyState||(this.log(t),e&&e(t),!1):(!1===this.connected&&(this.log(t),e)&&e(t),this.connected)},_sendMessage:function(e,t){var n;t&&(n=this._generateUid(),this.callbacks[n]=t,e.clientId=n,this._startTimeoutErrorTimer(n)),e.accId=this.accId,this.websocket?(9!=e&&this.log("Sending data",e),this.websocket.send(JSON.stringify(e))):this.socket.emit("message",JSON.stringify(e))},_startTimeoutErrorTimer:function(e){let t=this;t.timeouts[e]=setTimeout(function(){t.callbacks[e]&&t.callbacks[e]("Timeout Error"),delete t.timeouts[e]},this.timeoutPeriod)},_generateUid:function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)})},_isNumberAndGreaterThanZero:function(e){return"number"==typeof e&&0=this._reconnectionAttempts?(h("reconnect failed"),this.backoff.reset(),this.emitAll("reconnect_failed"),this.reconnecting=!1):(e=this.backoff.duration(),h("will wait %dms before reconnect attempt",e),this.reconnecting=!0,t=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(e){e?(h("reconnect attempt error"),n.reconnecting=!1,n.reconnect(),n.emitAll("reconnect_error",e.data)):(h("reconnect success"),n.onreconnect())})},e),this.subs.push({destroy:function(){clearTimeout(t)}}))},p.prototype.onreconnect=function(){var e=this.backoff.attempts;this.reconnecting=!1,this.backoff.reset(),this.updateSocketIds(),this.emitAll("reconnect",e)}},{"./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(e,t,n){t.exports=function(e,t,n){return e.on(t,n),{destroy:function(){e.removeListener(t,n)}}}},{}],5:[function(e,t,n){var r=e("socket.io-parser"),o=e("component-emitter"),s=e("to-array"),i=e("./on"),c=e("component-bind"),a=e("debug")("socket.io-client:socket"),h=e("has-binary"),l=(t.exports=p,{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}),u=o.prototype.emit;function p(e,t){this.io=e,this.nsp=t,(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 e;this.subs||(e=this.io,this.subs=[i(e,"open",c(this,"onopen")),i(e,"packet",c(this,"onpacket")),i(e,"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 e=s(arguments);return e.unshift("message"),this.emit.apply(this,e),this},p.prototype.emit=function(e){var t;return l.hasOwnProperty(e)?u.apply(this,arguments):(e=s(arguments),t=r.EVENT,t={type:t=h(e)?r.BINARY_EVENT:t,data:e},"function"==typeof e[e.length-1]&&(a("emitting packet with ack id %d",this.ids),this.acks[this.ids]=e.pop(),t.id=this.ids++),this.connected?this.packet(t):this.sendBuffer.push(t)),this},p.prototype.packet=function(e){e.nsp=this.nsp,this.io.packet(e)},p.prototype.onopen=function(){a("transport is open - connecting"),"/"!=this.nsp&&this.packet({type:r.CONNECT})},p.prototype.onclose=function(e){a("close (%s)",e),this.connected=!1,this.disconnected=!0,delete this.id,this.emit("disconnect",e)},p.prototype.onpacket=function(e){if(e.nsp==this.nsp)switch(e.type){case r.CONNECT:this.onconnect();break;case r.EVENT:case r.BINARY_EVENT:this.onevent(e);break;case r.ACK:case r.BINARY_ACK:this.onack(e);break;case r.DISCONNECT:this.ondisconnect();break;case r.ERROR:this.emit("error",e.data)}},p.prototype.onevent=function(e){var t=e.data||[];a("emitting event %j",t),null!=e.id&&(a("attaching ack callback to event"),t.push(this.ack(e.id))),this.connected?u.apply(this,t):this.receiveBuffer.push(t)},p.prototype.ack=function(n){var o=this,i=!1;return function(){var e,t;i||(i=!0,e=s(arguments),a("sending ack %j",e),t=h(e)?r.BINARY_ACK:r.ACK,o.packet({type:t,id:n,data:e}))}},p.prototype.onack=function(e){a("calling ack %s with %j",e.id,e.data),this.acks[e.id].apply(this,e.data),delete this.acks[e.id]},p.prototype.onconnect=function(){this.connected=!0,this.disconnected=!1,this.emit("connect"),this.emitBuffered()},p.prototype.emitBuffered=function(){for(var e=0;e{var t,n={};for(t in e)e.hasOwnProperty(t)&&(n[t]=e[t]);return n})(this.query);return t.EIO=r.protocol,t.transport=e,this.id&&(t.sid=this.id),new o[e]({agent:this.agent,hostname:this.hostname,port:this.port,secure:this.secure,path:this.path,query:t,forceJSONP:this.forceJSONP,jsonp:this.jsonp,forceBase64:this.forceBase64,enablesXDR:this.enablesXDR,timestampRequests:this.timestampRequests,timestampParam:this.timestampParam,policyPort:this.policyPort,socket:this,pfx:this.pfx,key:this.key,passphrase:this.passphrase,cert:this.cert,ca:this.ca,ciphers:this.ciphers,rejectUnauthorized:this.rejectUnauthorized})},p.prototype.open=function(){var e,t;if(this.rememberUpgrade&&p.priorWebsocketSuccess&&-1!=this.transports.indexOf("websocket"))t="websocket";else{if(0==this.transports.length)return e=this,void setTimeout(function(){e.emit("error","No transports available")},0);t=this.transports[0]}this.readyState="opening";try{t=this.createTransport(t)}catch(e){return this.transports.shift(),void this.open()}t.open(),this.setTransport(t)},p.prototype.setTransport=function(e){u("setting transport %s",e.name);var t=this;this.transport&&(u("clearing existing transport %s",this.transport.name),this.transport.removeAllListeners()),(this.transport=e).on("drain",function(){t.onDrain()}).on("packet",function(e){t.onPacket(e)}).on("error",function(e){t.onError(e)}).on("close",function(){t.onClose("transport close")})},p.prototype.probe=function(n){u('probing transport "%s"',n);var o=this.createTransport(n,{probe:1}),t=!1,i=this;function e(){var e;i.onlyBinaryUpgrades&&(e=!this.supportsBinary&&i.transport.supportsBinary,t=t||e),t||(u('probe transport "%s" opened',n),o.send([{type:"ping",data:"probe"}]),o.once("packet",function(e){t||("pong"==e.type&&"probe"==e.data?(u('probe transport "%s" pong',n),i.upgrading=!0,i.emit("upgrading",o),o&&(p.priorWebsocketSuccess="websocket"==o.name,u('pausing current transport "%s"',i.transport.name),i.transport.pause(function(){t||"closed"!=i.readyState&&(u("changing transport and sending upgrade packet"),l(),i.setTransport(o),o.send([{type:"upgrade"}]),i.emit("upgrade",o),o=null,i.upgrading=!1,i.flush())}))):(u('probe transport "%s" failed',n),(e=new Error("probe error")).transport=o.name,i.emit("upgradeError",e)))}))}function r(){t||(t=!0,l(),o.close(),o=null)}function s(e){var t=new Error("probe error: "+e);t.transport=o.name,r(),u('probe transport "%s" failed because of error: %s',n,e),i.emit("upgradeError",t)}function c(){s("transport closed")}function a(){s("socket closed")}function h(e){o&&e.name!=o.name&&(u('"%s" works - aborting "%s"',e.name,o.name),r())}function l(){o.removeListener("open",e),o.removeListener("error",s),o.removeListener("close",c),i.removeListener("close",a),i.removeListener("upgrading",h)}p.priorWebsocketSuccess=!1,o.once("open",e),o.once("error",s),o.once("close",c),this.once("close",a),this.once("upgrading",h),o.open()},p.prototype.onOpen=function(){if(u("socket open"),this.readyState="open",p.priorWebsocketSuccess="websocket"==this.transport.name,this.emit("open"),this.flush(),"open"==this.readyState&&this.upgrade&&this.transport.pause){u("starting upgrade probes");for(var e=0,t=this.upgrades.length;e';r=document.createElement(e)}catch(e){(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(),e=e.replace(l,"\\\n"),this.area.value=e.replace(h,"\\n");try{this.form.submit()}catch(e){}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(l,u,e){!function(o){var i=l("xmlhttprequest"),r=l("./polling"),e=l("component-emitter"),t=l("component-inherit"),s=l("debug")("engine.io-client:polling-xhr");function n(){}function c(e){var t,n;r.call(this,e),o.location&&(t="https:"==location.protocol,n=(n=location.port)||(t?443:80),this.xd=e.hostname!=o.location.hostname||n!=e.port,this.xs=e.secure!=t)}function a(e){this.method=e.method||"GET",this.uri=e.uri,this.xd=!!e.xd,this.xs=!!e.xs,this.async=!1!==e.async,this.data=null!=e.data?e.data:null,this.agent=e.agent,this.isBinary=e.isBinary,this.supportsBinary=e.supportsBinary,this.enablesXDR=e.enablesXDR,this.pfx=e.pfx,this.key=e.key,this.passphrase=e.passphrase,this.cert=e.cert,this.ca=e.ca,this.ciphers=e.ciphers,this.rejectUnauthorized=e.rejectUnauthorized,this.create()}function h(){for(var e in a.requests)a.requests.hasOwnProperty(e)&&a.requests[e].abort()}u.exports=c,u.exports.Request=a,t(c,r),c.prototype.supportsBinary=!0,c.prototype.request=function(e){return(e=e||{}).uri=this.uri(),e.xd=this.xd,e.xs=this.xs,e.agent=this.agent||!1,e.supportsBinary=this.supportsBinary,e.enablesXDR=this.enablesXDR,e.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,new a(e)},c.prototype.doWrite=function(e,t){var e=this.request({method:"POST",data:e,isBinary:"string"!=typeof e&&void 0!==e}),n=this;e.on("success",t),e.on("error",function(e){n.onError("xhr post error",e)}),this.sendXhr=e},c.prototype.doPoll=function(){s("xhr poll");var e=this.request(),t=this;e.on("data",function(e){t.onData(e)}),e.on("error",function(e){t.onError("xhr poll error",e)}),this.pollXhr=e},e(a.prototype),a.prototype.create=function(){var e={agent:this.agent,xdomain:this.xd,xscheme:this.xs,enablesXDR:this.enablesXDR},t=(e.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.xhr=new i(e)),n=this;try{if(s("xhr open %s: %s",this.method,this.uri),t.open(this.method,this.uri,this.async),this.supportsBinary&&(t.responseType="arraybuffer"),"POST"==this.method)try{this.isBinary?t.setRequestHeader("Content-type","application/octet-stream"):t.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(e){}"withCredentials"in t&&(t.withCredentials=!0),this.hasXDR()?(t.onload=function(){n.onLoad()},t.onerror=function(){n.onError(t.responseText)}):t.onreadystatechange=function(){4==t.readyState&&(200==t.status||1223==t.status?n.onLoad():setTimeout(function(){n.onError(t.status)},0))},s("xhr data %s",this.data),t.send(this.data)}catch(e){return void setTimeout(function(){n.onError(e)},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(e){this.emit("data",e),this.onSuccess()},a.prototype.onError=function(e){this.emit("error",e),this.cleanup(!0)},a.prototype.cleanup=function(e){if(null!=this.xhr){if(this.hasXDR()?this.xhr.onload=this.xhr.onerror=n:this.xhr.onreadystatechange=n,e)try{this.xhr.abort()}catch(e){}o.document&&delete a.requests[this.index],this.xhr=null}},a.prototype.onLoad=function(){var e,t;try{try{t=this.xhr.getResponseHeader("Content-Type").split(";")[0]}catch(e){}e="application/octet-stream"===t?this.xhr.response:this.supportsBinary?"ok":this.xhr.responseText}catch(e){this.onError(e)}null!=e&&this.onData(e)},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(e,t,n){var o=e("../transport"),i=e("parseqs"),r=e("engine.io-parser"),s=e("component-inherit"),c=e("debug")("engine.io-client:polling"),a=(t.exports=h,null!=new(e("xmlhttprequest"))({xdomain:!1}).responseType);function h(e){var t=e&&e.forceBase64;a&&!t||(this.supportsBinary=!1),o.call(this,e)}s(h,o),h.prototype.name="polling",h.prototype.doOpen=function(){this.poll()},h.prototype.pause=function(e){var t,n=this;function o(){c("paused"),n.readyState="paused",e()}this.readyState="pausing",this.polling||!this.writable?(t=0,this.polling&&(c("we are currently polling - waiting to pause"),t++,this.once("pollComplete",function(){c("pre-pause polling complete"),--t||o()})),this.writable||(c("we are currently writing - waiting to pause"),t++,this.once("drain",function(){c("pre-pause writing complete"),--t||o()}))):o()},h.prototype.poll=function(){c("polling"),this.polling=!0,this.doPoll(),this.emit("poll")},h.prototype.onData=function(e){var o=this;c("polling got data %s",e);r.decodePayload(e,this.socket.binaryType,function(e,t,n){if("opening"==o.readyState&&o.onOpen(),"close"==e.type)return o.onClose(),!1;o.onPacket(e)}),"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 e=this;function t(){c("writing close packet"),e.write([{type:"close"}])}"open"==this.readyState?(c("transport open - closing"),t()):(c("transport not open - deferring close"),this.once("open",t))},h.prototype.write=function(e){function t(){n.writable=!0,n.emit("drain")}this.writable=!1;var n=this;r.encodePayload(e,this.supportsBinary,function(e){n.doWrite(e,t)})},h.prototype.uri=function(){var e=this.query||{},t=this.secure?"https":"http",n="";return!1!==this.timestampRequests&&(e[this.timestampParam]=+new Date+"-"+o.timestamps++),this.supportsBinary||e.sid||(e.b64=1),e=i.encode(e),this.port&&("https"==t&&443!=this.port||"http"==t&&80!=this.port)&&(n=":"+this.port),e.length&&(e="?"+e),t+"://"+this.hostname+n+this.path+e}},{"../transport":14,"component-inherit":21,debug:22,"engine.io-parser":25,parseqs:33,xmlhttprequest:20}],19:[function(e,t,n){var o=e("../transport"),i=e("engine.io-parser"),r=e("parseqs"),s=e("component-inherit"),c=e("debug")("engine.io-client:websocket"),a=e("ws");function h(e){e&&e.forceBase64&&(this.supportsBinary=!1),o.call(this,e)}s(t.exports=h,o),h.prototype.name="websocket",h.prototype.supportsBinary=!0,h.prototype.doOpen=function(){var e,t;this.check()&&(e=this.uri(),(t={agent:this.agent}).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,this.ws=new a(e,void 0,t),void 0===this.ws.binaryType&&(this.supportsBinary=!1),this.ws.binaryType="arraybuffer",this.addEventListeners())},h.prototype.addEventListeners=function(){var t=this;this.ws.onopen=function(){t.onOpen()},this.ws.onclose=function(){t.onClose()},this.ws.onmessage=function(e){t.onData(e.data)},this.ws.onerror=function(e){t.onError("websocket error",e)}},"undefined"!=typeof navigator&&/iPad|iPhone|iPod/i.test(navigator.userAgent)&&(h.prototype.onData=function(e){var t=this;setTimeout(function(){o.prototype.onData.call(t,e)},0)}),h.prototype.write=function(e){var t=this;this.writable=!1;for(var n=0,o=e.length;n{t(e,function(e,t){i[n]=t,o(e,i)})})(r,e[r],o)}v.encodePacket=function(e,t,n,o){"function"==typeof t&&(o=t,t=!1),"function"==typeof n&&(o=n,n=null);var i,r,s,c,a=void 0===e.data?void 0:e.data.buffer||e.data;if(g.ArrayBuffer&&a instanceof ArrayBuffer){var h=e,l=o;if(!(u=t))return v.encodeBase64Packet(h,l);var u=h.data,p=new Uint8Array(u),f=new Uint8Array(1+u.byteLength);f[0]=b[h.type];for(var d=0;d>2])+l[(3&t[i])<<4|t[i+1]>>4])+l[(15&t[i+1])<<2|t[i+2]>>6])+l[63&t[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(e){for(var t,n,o,i,r=.75*e.length,s=e.length,c=0,r=("="===e[e.length-1]&&(r--,"="===e[e.length-2])&&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}},{}],30:[function(e,a,t){!function(e){var i=e.BlobBuilder||e.WebKitBlobBuilder||e.MSBlobBuilder||e.MozBlobBuilder,t=(()=>{try{return 2===new Blob(["hi"]).size}catch(e){return!1}})(),n=t&&(()=>{try{return 2===new Blob([new Uint8Array([1,2])]).size}catch(e){return!1}})(),o=i&&i.prototype.append&&i.prototype.getBlob;function r(e){for(var t=0;t>t&63|128)}function d(){if(h<=l)throw Error("Invalid byte index");var e=255&a[l];if(l++,128==(192&e))return 63&e;throw Error("Invalid continuation byte")}var i={version:"2.0.0",encode:function(e){for(var t,n,o=p(e),i=o.length,r=-1,s="";++r>6&31|192):0==(4294901760&t)?(f(t),n=u(t>>12&15|224),n+=c(t,6)):0==(4292870144&t)&&(n=u(t>>18&7|240),n=(n+=c(t,12))+c(t,6)),n+u(63&t|128)));return s},decode:function(e){a=p(e),h=a.length,l=0;for(var t,n=[];!1!==(t=(()=>{var e,t;if(h>>10&1023|55296),o=56320|1023&o),c+=u(o);return c}};if(n&&!n.nodeType)if(o)o.exports=i;else{var r,s={}.hasOwnProperty;for(r in i)s.call(i,r)&&(n[r]=i[r])}else t.utf8=i}.call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],32:[function(e,a,t){!function(t){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(e){return"string"==typeof e&&e?(e=e.replace(s,"").replace(c,""),t.JSON&&JSON.parse?JSON.parse(e):n.test(e.replace(o,"@").replace(i,"]").replace(r,""))?new Function("return "+e)():void 0):null}}.call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],33:[function(e,t,n){n.encode=function(e){var t,n="";for(t in e)e.hasOwnProperty(t)&&(n.length&&(n+="&"),n+=encodeURIComponent(t)+"="+encodeURIComponent(e[t]));return n},n.decode=function(e){for(var t={},n=e.split("&"),o=0,i=n.length;o{var t={},n=0;if(t.type=Number(e.charAt(0)),null==s.types[t.type])return p();if(s.BINARY_EVENT==t.type||s.BINARY_ACK==t.type){for(var o="";"-"!=e.charAt(++n)&&(o+=e.charAt(n),n!=e.length););if(o!=Number(o)||"-"!=e.charAt(n))throw new Error("Illegal attachments");t.attachments=Number(o)}if("/"==e.charAt(n+1))for(t.nsp="";++n;){if(","==(i=e.charAt(n)))break;if(t.nsp+=i,n==e.length)break}else t.nsp="/";var i,r=e.charAt(n+1);if(""!==r&&Number(r)==r){for(t.id="";++n;){if(null==(i=e.charAt(n))||Number(i)!=i){--n;break}if(t.id+=e.charAt(n),n==e.length)break}t.id=Number(t.id)}if(e.charAt(++n))try{t.data=a.parse(e.substr(n))}catch(e){return p()}return c("decoded %s as %j",e,t),t})(e),(s.BINARY_EVENT!=t.type&&s.BINARY_ACK!=t.type||(this.reconstructor=new u(t),0===this.reconstructor.reconPack.attachments))&&this.emit("decoded",t);else{if(!i(e)&&!e.base64)throw new Error("Unknown type: "+e);if(!this.reconstructor)throw new Error("got binary data when not reconstructing a packet");(t=this.reconstructor.takeBinaryData(e))&&(this.reconstructor=null,this.emit("decoded",t))}},l.prototype.destroy=function(){this.reconstructor&&this.reconstructor.finishedReconstruction()},u.prototype.takeBinaryData=function(e){return this.buffers.push(e),this.buffers.length==this.reconPack.attachments?(e=o.reconstructPacket(this.reconPack,this.buffers),this.finishedReconstruction(),e):null},u.prototype.finishedReconstruction=function(){this.reconPack=null,this.buffers=[]}},{"./binary":43,"./is-buffer":45,"component-emitter":9,debug:10,isarray:46,json3:47}],45:[function(e,n,t){!function(t){n.exports=function(e){return t.Buffer&&t.Buffer.isBuffer(e)||t.ArrayBuffer&&e instanceof ArrayBuffer}}.call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],46:[function(e,t,n){t.exports=e(37)},{}],47:[function(e,D,t){var w,I,l,x,C,_,c,S,n,A,u,a,o,T,h,R,B,p,f,d,g,y,i,r,s,m,E,b=this,U={}.toString,k="object"==typeof JSON&&JSON,v="object"==typeof t&&t&&!t.nodeType&&t,O=(v&&k?(v.stringify=k.stringify,v.parse=k.parse):v=b.JSON=k||{},new Date(-0xc782b5b800cec));try{O=-109252==O.getUTCFullYear()&&0===O.getUTCMonth()&&1===O.getUTCDate()&&10==O.getUTCHours()&&37==O.getUTCMinutes()&&6==O.getUTCSeconds()&&708==O.getUTCMilliseconds()}catch(e){}function N(e){if(N[e]!==I)return N[e];var t;if("bug-string-char-index"==e)t="a"!="a"[0];else if("json"==e)t=N("json-stringify")&&N("json-parse");else{var n='{"a":[1,true,false,null,"\\u0000\\b\\n\\f\\r\\t"]}';if("json-stringify"==e){var o=v.stringify,i="function"==typeof o&&O;if(i){(r=function(){return 1}).toJSON=r;try{i="0"===o(0)&&"0"===o(new Number)&&'""'==o(new String)&&o(U)===I&&o(I)===I&&o()===I&&"1"===o(r)&&"[1]"==o([r])&&"[null]"==o([I])&&"null"==o(null)&&"[null,null,null]"==o([I,U,null])&&o({a:[r,!0,!1,null,"\0\b\n\f\r\t"]})==n&&"1"===o(null,r)&&"[\n 1,\n 2\n]"==o([1,2],null,1)&&'"-271821-04-20T00:00:00.000Z"'==o(new Date(-864e13))&&'"+275760-09-13T00:00:00.000Z"'==o(new Date(864e13))&&'"-000001-01-01T00:00:00.000Z"'==o(new Date(-621987552e5))&&'"1969-12-31T23:59:59.999Z"'==o(new Date(-1))}catch(e){i=!1}}t=i}if("json-parse"==e){o=v.parse;if("function"==typeof o)try{if(0===o("0")&&!o(!1)){var r,s=5==(r=o(n)).a.length&&1===r.a[0];if(s){try{s=!o('"\t"')}catch(e){}if(s)try{s=1!==o("01")}catch(e){}if(s)try{s=1!==o("1.")}catch(e){}}}}catch(e){s=!1}t=s}}return N[e]=!!t}N("json")||(l="[object Function]",x="[object Number]",C="[object String]",_="[object Array]",c=N("bug-string-char-index"),O||(S=Math.floor,n=[0,31,59,90,120,151,181,212,243,273,304,334],A=function(e,t){return n[t]+365*(e-1970)+S((e-1969+(t=+(1