!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).GoEasy=t()}(this,(function(){"use strict";var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function t(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function n(e){if(e.__esModule)return e;var t=Object.defineProperty({},"__esModule",{value:!0});return Object.keys(e).forEach((function(n){var o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,o.get?o:{enumerable:!0,get:function(){return e[n]}})})),t}var o={};function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}var i=function(e,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},i(e,t)};var r=function(){return r=Object.assign||function(e){for(var t,n=1,o=arguments.length;n=e.length&&(e=void 0),{value:e&&e[o++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function u(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var o,s,i=n.call(e),r=[];try{for(;(void 0===t||t-- >0)&&!(o=i.next()).done;)r.push(o.value)}catch(e){s={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(s)throw s.error}}return r}function l(e){return this instanceof l?(this.v=e,this):new l(e)}var p=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t};var d=Object.freeze({__proto__:null,__extends:function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)},get __assign(){return r},__rest:function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(o=Object.getOwnPropertySymbols(e);s=0;c--)(i=e[c])&&(a=(r<3?i(a):r>3?i(t,n,a):i(t,n))||a);return r>3&&a&&Object.defineProperty(t,n,a),a},__param:function(e,t){return function(n,o){t(n,o,e)}},__metadata:function(e,t){if("object"===("undefined"==typeof Reflect?"undefined":s(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},__awaiter:function(e,t,n,o){return new(n||(n=Promise))((function(s,i){function r(e){try{c(o.next(e))}catch(e){i(e)}}function a(e){try{c(o.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?s(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(r,a)}c((o=o.apply(e,t||[])).next())}))},__generator:function(e,t){var n,o,s,i,r={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,o&&(s=2&i[0]?o.return:i[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,i[1])).done)return s;switch(o=0,s&&(i=[2&i[0],s.value]),i[0]){case 0:case 1:s=i;break;case 4:return r.label++,{value:i[1],done:!1};case 5:r.label++,o=i[1],i=[0];continue;case 7:i=r.ops.pop(),r.trys.pop();continue;default:if(!(s=r.trys,(s=s.length>0&&s[s.length-1])||6!==i[0]&&2!==i[0])){r=0;continue}if(3===i[0]&&(!s||i[1]>s[0]&&i[1]1||a(e,t)}))})}function a(e,t){try{(n=s[e](t)).value instanceof l?Promise.resolve(n.value.v).then(c,u):p(i[0][2],n)}catch(e){p(i[0][3],e)}var n}function c(e){a("next",e)}function u(e){a("throw",e)}function p(e,t){e(t),i.shift(),i.length&&a(i[0][0],i[0][1])}},__asyncDelegator:function(e){var t,n;return t={},o("next"),o("throw",(function(e){throw e})),o("return"),t[Symbol.iterator]=function(){return this},t;function o(o,s){t[o]=e[o]?function(t){return(n=!n)?{value:l(e[o](t)),done:"return"===o}:s?s(t):t}:s}},__asyncValues:function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=c(e),t={},o("next"),o("throw"),o("return"),t[Symbol.asyncIterator]=function(){return this},t);function o(n){t[n]=e[n]&&function(t){return new Promise((function(o,s){(function(e,t,n,o){Promise.resolve(o).then((function(t){e({value:t,done:n})}),t)})(o,s,(t=e[n](t)).done,t.value)}))}}},__makeTemplateObject:function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},__importStar:function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&a(t,e,n);return p(t,e),t},__importDefault:function(e){return e&&e.__esModule?e:{default:e}},__classPrivateFieldGet:function(e,t,n,o){if("a"===n&&!o)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?o:"a"===n?o.call(e):o?o.value:t.get(e)},__classPrivateFieldSet:function(e,t,n,o,s){if("m"===o)throw new TypeError("Private method is not writable");if("a"===o&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===o?s.call(e,n):s?s.value=n:t.set(e,n),n},__classPrivateFieldIn:function(e,t){if(null===t||"object"!==s(t)&&"function"!=typeof t)throw new TypeError("Cannot use 'in' operator on non-object");return"function"==typeof e?t===e:e.has(t)}}),f=n(d),h={};!function(e){e.__esModule=!0,e.NetworkStatus=void 0,function(e){e.DISCONNECTED="disconnected",e.DISCONNECTING="disconnecting",e.CONNECTING="connecting",e.CONNECTED="connected",e.RECONNECTING="reconnecting",e.RECONNECTED="reconnected",e.EXPIRED_RECONNECTED="reconnected",e.CONNECT_FAILED="connect_failed"}(e.NetworkStatus||(e.NetworkStatus={}))}(h);var m={},y={},g={};!function(e){e.__esModule=!0,e.Permission=void 0,function(e){e.WRITE="WRITE",e.READ="READ",e.NONE="NONE"}(e.Permission||(e.Permission={}))}(g);var v={__esModule:!0,Emitter:void 0},S=h,E=function(){function e(e){this.socket=e}return e.prototype.emit=function(e){this.socket.status!==S.NetworkStatus.CONNECT_FAILED&&this.socket.status!==S.NetworkStatus.DISCONNECTED?(e.start(),this.doEmit(e)):e.fail({resultCode:"409",content:"Please connect first"})},e.prototype.doEmit=function(e){var t=this;if(e.isTimeout())e.fail({resultCode:408,content:"Host unreachable or timeout"});else if(this.socket.status!==S.NetworkStatus.CONNECT_FAILED)if(this.authenticated())if(this.hasPermission(e))if([S.NetworkStatus.CONNECTED,S.NetworkStatus.RECONNECTED,S.NetworkStatus.EXPIRED_RECONNECTED].includes(this.socket.status)){if(!e.complete){var n=setTimeout((function(){t.doEmit(e)}),e.singleTimeout);e.unique&&(e.params.retried=e.retried),this.socket.doEmit(e.name,e.params,(function(t){clearTimeout(n),200===t.resultCode||200==t.code?e.success(t):e.fail(t)})),e.retried++}}else this.socket.connectedPromise.then((function(){t.doEmit(e)}));else e.fail({resultCode:401,content:"No permission"});else this.socket.connectedPromise.then((function(){t.doEmit(e)}));else e.fail({resultCode:408,content:"Failed to connect GoEasy."})},e.prototype.hasPermission=function(e){return!!this.socket.permissions.find((function(t){return t===e.permission}))},e.prototype.authenticated=function(){return[S.NetworkStatus.CONNECTED,S.NetworkStatus.RECONNECTING,S.NetworkStatus.RECONNECTED,S.NetworkStatus.EXPIRED_RECONNECTED].includes(this.socket.status)},e}();v.Emitter=E;var C={exports:{}},_=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,b=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],M=function(e){var t=e,n=e.indexOf("["),o=e.indexOf("]");-1!=n&&-1!=o&&(e=e.substring(0,n)+e.substring(n,o).replace(/:/g,";")+e.substring(o,e.length));for(var s=_.exec(e||""),i={},r=14;r--;)i[b[r]]=s[r]||"";return-1!=n&&-1!=o&&(i.source=t,i.host=i.host.substring(1,i.host.length-1).replace(/;/g,":"),i.authority=i.authority.replace("[","").replace("]","").replace(/;/g,":"),i.ipv6uri=!0),i},w={exports:{}},T={exports:{}},I=1e3,N=6e4,A=60*N,R=24*A,k=365.25*R,P=function(e,t){t=t||{};var n=s(e);if("string"===n&&e.length>0)return function(e){if((e=String(e)).length>100)return;var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(!t)return;var n=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return n*k;case"days":case"day":case"d":return n*R;case"hours":case"hour":case"hrs":case"hr":case"h":return n*A;case"minutes":case"minute":case"mins":case"min":case"m":return n*N;case"seconds":case"second":case"secs":case"sec":case"s":return n*I;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}(e);if("number"===n&&!1===isNaN(e))return t.long?function(e){return O(e,R,"day")||O(e,A,"hour")||O(e,N,"minute")||O(e,I,"second")||e+" ms"}(e):function(e){if(e>=R)return Math.round(e/R)+"d";if(e>=A)return Math.round(e/A)+"h";if(e>=N)return Math.round(e/N)+"m";if(e>=I)return Math.round(e/I)+"s";return e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function O(e,t,n){if(!(e=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}},t.enable(n())}(w,w.exports);var D=M,x=w.exports("socket.io-client:url"),F=function(e,t){var n=e;t=t||"undefined"!=typeof location&&location,null==e&&(e=t.protocol+"//"+t.host);"string"==typeof e&&("/"===e.charAt(0)&&(e="/"===e.charAt(1)?t.protocol+e:t.host+e),/^(https?|wss?):\/\//.test(e)||(x("protocol-less url %s",e),e=void 0!==t?t.protocol+"//"+e:"https://"+e),x("parse %s",e),n=D(e));n.port||(/^(http|ws)$/.test(n.protocol)?n.port="80":/^(http|ws)s$/.test(n.protocol)&&(n.port="443"));n.path=n.path||"/";var o=-1!==n.host.indexOf(":")?"["+n.host+"]":n.host;return n.id=n.protocol+"://"+o+":"+n.port,n.href=n.protocol+"://"+o+(t&&t.port===n.port?"":":"+n.port),n};var G={},U={exports:{}};!function(e){function t(e){if(e)return function(e){for(var n in t.prototype)e[n]=t.prototype[n];return e}(e)}e.exports=t,t.prototype.on=t.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},t.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},t.prototype.off=t.prototype.removeListener=t.prototype.removeAllListeners=t.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n,o=this._callbacks["$"+e];if(!o)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var s=0;s=55296&&t<=56319&&s=55296&&e<=57343){if(t)throw Error("Lone surrogate U+"+e.toString(16).toUpperCase()+" is not a scalar value");return!1}return!0}function se(e,t){return te(e>>t&63|128)}function ie(e,t){if(0==(4294967168&e))return te(e);var n="";return 0==(4294965248&e)?n=te(e>>6&31|192):0==(4294901760&e)?(oe(e,t)||(e=65533),n=te(e>>12&15|224),n+=se(e,6)):0==(4292870144&e)&&(n=te(e>>18&7|240),n+=se(e,12),n+=se(e,6)),n+=te(63&e|128)}function re(){if(ee>=Z)throw Error("Invalid byte index");var e=255&$[ee];if(ee++,128==(192&e))return 63&e;throw Error("Invalid continuation byte")}function ae(e){var t,n;if(ee>Z)throw Error("Invalid byte index");if(ee==Z)return!1;if(t=255&$[ee],ee++,0==(128&t))return t;if(192==(224&t)){if((n=(31&t)<<6|re())>=128)return n;throw Error("Invalid continuation byte")}if(224==(240&t)){if((n=(15&t)<<12|re()<<6|re())>=2048)return oe(n,e)?n:65533;throw Error("Invalid continuation byte")}if(240==(248&t)&&(n=(7&t)<<18|re()<<12|re()<<6|re())>=65536&&n<=1114111)return n;throw Error("Invalid UTF-8 detected")}var ce={version:"2.1.2",encode:function(e,t){for(var n=!1!==(t=t||{}).strict,o=ne(e),s=o.length,i=-1,r="";++i65535&&(s+=te((t-=65536)>>>10&1023|55296),t=56320|1023&t),s+=te(t);return s}(s)}},ue=void 0!==ue?ue:"undefined"!=typeof WebKitBlobBuilder?WebKitBlobBuilder:"undefined"!=typeof MSBlobBuilder?MSBlobBuilder:"undefined"!=typeof MozBlobBuilder&&MozBlobBuilder,le=function(){try{return 2===new Blob(["hi"]).size}catch(e){return!1}}(),pe=le&&function(){try{return 2===new Blob([new Uint8Array([1,2])]).size}catch(e){return!1}}(),de=ue&&ue.prototype.append&&ue.prototype.getBlob;function fe(e){return e.map((function(e){if(e.buffer instanceof ArrayBuffer){var t=e.buffer;if(e.byteLength!==t.byteLength){var n=new Uint8Array(e.byteLength);n.set(new Uint8Array(t,e.byteOffset,e.byteLength)),t=n.buffer}return t}return e}))}function he(e,t){t=t||{};var n=new ue;return fe(e).forEach((function(e){n.append(e)})),t.type?n.getBlob(t.type):n.getBlob()}function me(e,t){return new Blob(fe(e),t||{})}"undefined"!=typeof Blob&&(he.prototype=Blob.prototype,me.prototype=Blob.prototype);var ye=le?pe?Blob:me:de?he:void 0;!function(e){var t=H,n=Y,o=Q,s=ce;"undefined"!=typeof navigator&&/Android/i.test(navigator.userAgent),"undefined"!=typeof navigator&&/PhantomJS/i.test(navigator.userAgent),e.protocol=3;var i=e.packets={open:0,close:1,ping:2,pong:3,message:4,upgrade:5,noop:6},r=t(i),a={type:"error",data:"parser error"},c=ye;e.encodePacket=function(e,t,n,o){"function"==typeof t&&(o=t,t=!1),"function"==typeof n&&(o=n,n=null),void 0===e.data||e.data.buffer||e.data;var r=i[e.type];return void 0!==e.data&&(r+=n?s.encode(String(e.data),{strict:!1}):String(e.data)),o(""+r)},e.decodePacket=function(e,t,n){if(void 0===e)return a;if("string"==typeof e){if(n&&!1===(e=function(e){try{e=s.decode(e,{strict:!1})}catch(e){return!1}return e}(e)))return a;var o=e.charAt(0);return Number(o)==o&&r[o]?e.length>1?{type:r[o],data:e.substring(1)}:{type:r[o]}:a}o=new Uint8Array(e)[0];var i=sliceBuffer(e,1);return c&&"blob"===t&&(i=new c([i])),{type:r[o],data:i}},e.encodePayload=function(t,s,i){"function"==typeof s&&(i=s,s=null);var r=n(t);if(!t.length)return i("0:");!function(e,t,n){for(var s=new Array(e.length),i=o(e.length,n),r=function(e,n,o){t(n,(function(t,n){s[e]=n,o(t,s)}))},a=0;a0);return t}function Ne(){var e=Ie(+new Date);return e!==Ee?(we=0,Ee=e):e+"."+Ie(we++)}for(;Te<64;Te++)Me[be[Te]]=Te;Ne.encode=Ie,Ne.decode=function(e){var t=0;for(Te=0;Te0)return function(e){if((e=String(e)).length>100)return;var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(!t)return;var n=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return n*Fe;case"days":case"day":case"d":return n*xe;case"hours":case"hour":case"hrs":case"hr":case"h":return n*De;case"minutes":case"minute":case"mins":case"min":case"m":return n*Oe;case"seconds":case"second":case"secs":case"sec":case"s":return n*Pe;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}(e);if("number"===n&&!1===isNaN(e))return t.long?function(e){return Ue(e,xe,"day")||Ue(e,De,"hour")||Ue(e,Oe,"minute")||Ue(e,Pe,"second")||e+" ms"}(e):function(e){if(e>=xe)return Math.round(e/xe)+"d";if(e>=De)return Math.round(e/De)+"h";if(e>=Oe)return Math.round(e/Oe)+"m";if(e>=Pe)return Math.round(e/Pe)+"s";return e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function Ue(e,t,n){if(!(e=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}},t.enable(n())}(Re,Re.exports);var Le={exports:{}};try{Le.exports="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}catch(e){Le.exports=!1}var qe=Le.exports,Be=function(e){var t=e.xdomain,n=e.xscheme,o=e.enablesXDR;try{if("undefined"!=typeof XMLHttpRequest&&(!t||qe))return new XMLHttpRequest}catch(e){}try{if("undefined"!=typeof XDomainRequest&&!n&&o)return new XDomainRequest}catch(e){}if(!t)try{return new(self[["Active"].concat("Object").join("X")])("Microsoft.XMLHTTP")}catch(e){}},je=ve,Ve=Ce,He=V,We=_e,ze=Ae,Xe=Re.exports("engine.io-client:polling"),Je=Qe,Ye=null!=new Be({xdomain:!1}).responseType;function Qe(e){var t=e&&e.forceBase64;Ye&&!t||(this.supportsBinary=!1),je.call(this,e)}We(Qe,je),Qe.prototype.name="polling",Qe.prototype.doOpen=function(){this.poll()},Qe.prototype.pause=function(e){var t=this;function n(){Xe("paused"),t.readyState="paused",e()}if(this.readyState="pausing",this.polling||!this.writable){var o=0;this.polling&&(Xe("we are currently polling - waiting to pause"),o++,this.once("pollComplete",(function(){Xe("pre-pause polling complete"),--o||n()}))),this.writable||(Xe("we are currently writing - waiting to pause"),o++,this.once("drain",(function(){Xe("pre-pause writing complete"),--o||n()})))}else n()},Qe.prototype.poll=function(){Xe("polling"),this.polling=!0,this.doPoll(),this.emit("poll")},Qe.prototype.onData=function(e){var t=this;Xe("polling got data %s",e);He.decodePayload(e,this.socket.binaryType,(function(e,n,o){if("opening"===t.readyState&&t.onOpen(),"close"===e.type)return t.onClose(),!1;t.onPacket(e)})),"closed"!==this.readyState&&(this.polling=!1,this.emit("pollComplete"),"open"===this.readyState?this.poll():Xe('ignoring poll - transport state "%s"',this.readyState))},Qe.prototype.doClose=function(){var e=this;function t(){Xe("writing close packet"),e.write([{type:"close"}])}"open"===this.readyState?(Xe("transport open - closing"),t()):(Xe("transport not open - deferring close"),this.once("open",t))},Qe.prototype.write=function(e){var t=this;this.writable=!1;var n=function(){t.writable=!0,t.emit("drain")};He.encodePayload(e,this.supportsBinary,(function(e){t.doWrite(e,n)}))},Qe.prototype.uri=function(){var e=this.query||{},t=this.secure?"https":"http",n="";return!1!==this.timestampRequests&&(e[this.timestampParam]=ze()),this.supportsBinary||e.sid||(e.b64=1),e=Ve.encode(e),this.port&&("https"===t&&443!==Number(this.port)||"http"===t&&80!==Number(this.port))&&(n=":"+this.port),e.length&&(e="?"+e),t+"://"+(-1!==this.hostname.indexOf(":")?"["+this.hostname+"]":this.hostname)+n+this.path+e};var Ke,$e=Je,Ze=it,et=/\n/g,nt=/\\n/g;function ot(){}function st(){return"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==e?e:{}}function it(e){if($e.call(this,e),this.query=this.query||{},!Ke){var t=st();Ke=t.___eio=t.___eio||[]}this.index=Ke.length;var n=this;Ke.push((function(e){n.onData(e)})),this.query.j=this.index,"function"==typeof addEventListener&&addEventListener("beforeunload",(function(){n.script&&(n.script.onerror=ot)}),!1)}_e(it,$e),it.prototype.supportsBinary=!1,it.prototype.doClose=function(){this.script&&(this.script.parentNode.removeChild(this.script),this.script=null),this.form&&(this.form.parentNode.removeChild(this.form),this.form=null,this.iframe=null),$e.prototype.doClose.call(this)},it.prototype.doPoll=function(){var e=this,t=document.createElement("script");this.script&&(this.script.parentNode.removeChild(this.script),this.script=null),t.async=!0,t.src=this.uri(),t.onerror=function(t){e.onError("jsonp poll error",t)};var n=document.getElementsByTagName("script")[0];n?n.parentNode.insertBefore(t,n):(document.head||document.body).appendChild(t),this.script=t,"undefined"!=typeof navigator&&/gecko/i.test(navigator.userAgent)&&setTimeout((function(){var e=document.createElement("iframe");document.body.appendChild(e),document.body.removeChild(e)}),100)},it.prototype.doWrite=function(e,t){var n=this;if(!this.form){var o,s=document.createElement("form"),i=document.createElement("textarea"),r=this.iframeId="eio_iframe_"+this.index;s.className="socketio",s.style.position="absolute",s.style.top="-1000px",s.style.left="-1000px",s.target=r,s.method="POST",s.setAttribute("accept-charset","utf-8"),i.name="d",s.appendChild(i),document.body.appendChild(s),this.form=s,this.area=i}function a(){c(),t()}function c(){if(n.iframe)try{n.form.removeChild(n.iframe)}catch(e){n.onError("jsonp polling iframe removal error",e)}try{var e='