!function(t,n){"object"==typeofexports&&"undefined"!=typeofmodule?module.exports=n():"function"==typeofdefine&&define.amd?define(n):(t="undefined"!=typeofglobalThis?globalThis:t||self).io=n()}(this,(function(){"use strict";functiont(t,n){(null==n||n>t.length)&&(n=t.length);for(vari=0,r=Array(n);i<n;i++)r[i]=t[i];returnr}functionn(t,n){for(vari=0;i<n.length;i++){varr=n[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"inr&&(r.writable=!0),Object.defineProperty(t,f(r.key),r)}}functioni(t,i,r){returni&&n(t.prototype,i),r&&n(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}functionr(n,i){varr="undefined"!=typeofSymbol&&n[Symbol.iterator]||n["@@iterator"];if(!r){if(Array.isArray(n)||(r=function(n,i){if(n){if("string"==typeofn)returnt(n,i);varr={}.toString.call(n).slice(8,-1);return"Object"===r&&n.constructor&&(r=n.constructor.name),"Map"===r||"Set"===r?Array.from(n):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?t(n,i):void0}}(n))||i&&n&&"number"==typeofn.length){r&&(n=r);vare=0,o=function(){};return{s:o,n:function(){returne>=n.length?{done:!0}:{done:!1,value:n[e++]}},e:function(t){throwt},f:o}}thrownewTypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}vars,u=!0,h=!1;return{s:function(){r=r.call(n)},n:function(){vart=r.next();returnu=t.done,t},e:function(t){h=!0,s=t},f:function(){try{u||null==r.return||r.return()}finally{if(h)throws}}}}functione(){returne=Object.assign?Object.assign.bind():function(t){for(varn=1;n<arguments.length;n++){vari=arguments[n];for(varrini)({}).hasOwnProperty.call(i,r)&&(t[r]=i[r])}returnt},e.apply(null,arguments)}functiono(t){returno=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){returnt.__proto__||Object.getPrototypeOf(t)},o(t)}functions(t,n){t.prototype=Object.create(n.prototype),t.prototype.constructor=t,h(t,n)}functionu(){try{vart=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(u=function(){return!!t})()}functionh(t,n){returnh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){returnt.__proto__=n,t},h(t,n)}functionf(t){varn=function(t,n){if("object"!=typeoft||!t)returnt;vari=t[Symbol.toPrimitive];if(void0!==i){varr=i.call(t,n||"default");if("object"!=typeofr)returnr;thrownewTypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(t)}(t,"string");return"symbol"==typeofn?n:n+""}functionc(t){returnc="function"==typeofSymbol&&"symbol"==typeofSymbol.iterator?function(t){returntypeoft}:function(t){returnt&&"function"==typeofSymbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeoft},c(t)}functiona(t){varn="function"==typeofMap?newMap:void0;returna=function(t){if(null===t||!function(t){try{return-1!==Function.toString.call(t).indexOf("[native code]")}catch(n){return"function"==typeoft}}(t))returnt;if("function"!=typeoft)thrownewTypeError("Super expression must either be null or a function");if(void0!==n){if(n.has(t))returnn.get(t);n.set(t,i)}functioni(){returnfunction(t,n,i){if(u())returnReflect.construct.apply(null,arguments);varr=[null];r.push.apply(r,n);vare=new(t.bind.apply(t,r));returni&&h(e,i.prototype),e}(t,arguments,o(this).constructor)}returni.prototype=Object.create(t.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),h(i,t)},a(t)}varv=Object.create(null);v.open="0",v.close="1",v.ping="2",v.pong="3",v.message="4",v.upgrade="5",v.noop="6";varl=Object.create(null);Object.keys(v).forEach((function(t){l[v[t]]=t}));varp,d={type:"error",data:"parser error"},y="function"==typeofBlob||"undefined"!=typeofBlob&&"[object BlobConstructor]"===Object.prototype.toString.call(Blob),b="function"==typeofArrayBuffer,w=function(t){return"function"==typeofArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.bufferinstanceofArrayBuffer},g=function(t,n,i){varr=t.type,e=t.data;returny&&einstanceofBlob?n?i(e):m(e,i):b&&(einstanceofArrayBuffer|