@vyr/cli 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.bin/default/index.js +74 -0
- package/.bin/index.js +17 -0
- package/.entry/app.js +78575 -0
- package/README.md +168 -0
- package/README.zh-CN.md +169 -0
- package/build/css/1060.a79f9d80.css +1 -0
- package/build/css/1111.7f5086f2.css +1 -0
- package/build/css/1124.b91daf98.css +1 -0
- package/build/css/1583.69c975fc.css +1 -0
- package/build/css/2505.39376622.css +1 -0
- package/build/css/4296.963f15af.css +1 -0
- package/build/css/530.e132216c.css +1 -0
- package/build/css/6357.7bd0168e.css +1 -0
- package/build/css/6827.7d5b54a4.css +1 -0
- package/build/css/6881.972ad8f8.css +1 -0
- package/build/css/8093.21e188eb.css +3 -0
- package/build/css/8743.b91daf98.css +1 -0
- package/build/css/9157.971090af.css +1 -0
- package/build/css/9339.e14b8c45.css +1 -0
- package/build/css/login.de13ff0c.css +1 -0
- package/build/css.worker.js +1 -0
- package/build/deps/locale.js +1 -0
- package/build/deps/socket.js +6 -0
- package/build/editor.worker.js +1 -0
- package/build/favicon.ico +0 -0
- package/build/fonts/codicon.5b7d6fac.ttf +0 -0
- package/build/fonts/iconfont.01dfbc15.ttf +0 -0
- package/build/fonts/iconfont.2e5056cd.woff +0 -0
- package/build/html.worker.js +1 -0
- package/build/index.html +1 -0
- package/build/js/1008.1212a92b.js +1 -0
- package/build/js/1018.094a4eaf.js +1 -0
- package/build/js/1048.959d2b15.js +1 -0
- package/build/js/1060.331f9a15.js +1 -0
- package/build/js/1111.8555bd5c.js +1 -0
- package/build/js/112.43f83ad0.js +1 -0
- package/build/js/1124.4cf01e6d.js +1 -0
- package/build/js/1176.03ce189a.js +1 -0
- package/build/js/1320.11b1f843.js +1 -0
- package/build/js/1346.07f056a0.js +1 -0
- package/build/js/1349.8c9198a0.js +1 -0
- package/build/js/1376.c78b811b.js +1 -0
- package/build/js/1384.330a9809.js +1 -0
- package/build/js/1402.4e06e186.js +1 -0
- package/build/js/150.0eb50ff3.js +1 -0
- package/build/js/1583.e8f36a93.js +1 -0
- package/build/js/1592.2007c851.js +1 -0
- package/build/js/1696.67999338.js +7 -0
- package/build/js/1704.a712bcfe.js +1 -0
- package/build/js/1877.41a30a46.js +1 -0
- package/build/js/1978.d78b7ff2.js +1 -0
- package/build/js/2024.61ad4ff8.js +1 -0
- package/build/js/2132.0f13c789.js +1 -0
- package/build/js/220.332f13be.js +1 -0
- package/build/js/2264.74826096.js +1 -0
- package/build/js/2320.01b45f7e.js +1 -0
- package/build/js/2328.91f4fab2.js +1 -0
- package/build/js/2424.1b901127.js +1 -0
- package/build/js/2472.fd550726.js +1 -0
- package/build/js/250.369da5c4.js +1 -0
- package/build/js/2505.b43421df.js +1 -0
- package/build/js/2521.64e8a1c3.js +1 -0
- package/build/js/2576.af7b57dd.js +1 -0
- package/build/js/2674.a0fefa3b.js +1 -0
- package/build/js/2808.2a6f1a99.js +1 -0
- package/build/js/2868.2c921d66.js +1 -0
- package/build/js/2958.148f2f28.js +1 -0
- package/build/js/3084.f01b8161.js +1 -0
- package/build/js/3124.865bbeea.js +1 -0
- package/build/js/3160.ad6a00b2.js +1 -0
- package/build/js/3328.0e752372.js +1 -0
- package/build/js/3416.59bed435.js +1 -0
- package/build/js/3454.fc17644a.js +1 -0
- package/build/js/3507.aafa886d.js +1 -0
- package/build/js/3785.151db669.js +1 -0
- package/build/js/3792.c95b5a4d.js +1 -0
- package/build/js/3944.0eafa506.js +1 -0
- package/build/js/4040.bd29cbd3.js +1 -0
- package/build/js/4124.1c353188.js +1 -0
- package/build/js/4171.ecaed70c.js +1 -0
- package/build/js/4196.1ecc5bb3.js +1 -0
- package/build/js/4230.d1f2577c.js +1 -0
- package/build/js/4263.870a448a.js +1 -0
- package/build/js/4288.cfaa98a7.js +1 -0
- package/build/js/4291.cea6a8d5.js +12 -0
- package/build/js/4296.634b3fe2.js +1 -0
- package/build/js/4416.8faeee6a.js +1 -0
- package/build/js/4490.afacfe53.js +1 -0
- package/build/js/4530.60b7c78d.js +1 -0
- package/build/js/4570.312d27c5.js +1 -0
- package/build/js/4582.a686fadd.js +1 -0
- package/build/js/4587.9701b203.js +1 -0
- package/build/js/4744.fb66347f.js +1 -0
- package/build/js/4764.df45c000.js +1 -0
- package/build/js/4786.89599e34.js +1 -0
- package/build/js/4816.cd55469f.js +1 -0
- package/build/js/4872.0bafb3d5.js +1 -0
- package/build/js/4900.cdee80ca.js +1 -0
- package/build/js/530.b4e0e136.js +1 -0
- package/build/js/5354.9e7d2a59.js +1 -0
- package/build/js/5388.ba7b29bd.js +1 -0
- package/build/js/5620.4ebcd1ef.js +1 -0
- package/build/js/5639.7661231d.js +1 -0
- package/build/js/5694.4e720480.js +1 -0
- package/build/js/5696.1ec004f6.js +5 -0
- package/build/js/5768.ff6d1da1.js +1 -0
- package/build/js/5788.fb009553.js +1 -0
- package/build/js/5804.a7530102.js +1 -0
- package/build/js/5888.e88a2170.js +1 -0
- package/build/js/5918.fd8226fe.js +1 -0
- package/build/js/6136.a7604e8a.js +1 -0
- package/build/js/6166.c3ca51e8.js +1 -0
- package/build/js/6234.8760a038.js +1 -0
- package/build/js/6248.d7c77c1a.js +1 -0
- package/build/js/6308.358e0a94.js +1 -0
- package/build/js/6315.81f5e202.js +7 -0
- package/build/js/6357.1354eb2c.js +1 -0
- package/build/js/6476.133083f0.js +1 -0
- package/build/js/6488.a1bb6380.js +1 -0
- package/build/js/6552.af7ecaa3.js +1 -0
- package/build/js/6600.66570635.js +1 -0
- package/build/js/6720.7e4d97d6.js +1 -0
- package/build/js/677.618fc137.js +1 -0
- package/build/js/6827.62f794a0.js +1 -0
- package/build/js/6881.e7455ee6.js +1 -0
- package/build/js/6937.53af487b.js +1 -0
- package/build/js/6968.07bbc3cd.js +1 -0
- package/build/js/7128.bddbefa5.js +1 -0
- package/build/js/7132.784f034a.js +1 -0
- package/build/js/7167.ba37f9e6.js +1 -0
- package/build/js/7195.7a9c1589.js +1 -0
- package/build/js/7227.9320ac5b.js +7 -0
- package/build/js/7380.378a750c.js +1 -0
- package/build/js/7390.cb73108e.js +6 -0
- package/build/js/7409.871dc004.js +7 -0
- package/build/js/7494.0fecaf55.js +1 -0
- package/build/js/7692.217959b6.js +1 -0
- package/build/js/7713.e38c75be.js +1 -0
- package/build/js/7769.15f4d355.js +1 -0
- package/build/js/7820.84cbe06d.js +1 -0
- package/build/js/7960.6e25b569.js +1 -0
- package/build/js/7980.816096c5.js +1 -0
- package/build/js/800.7696b6c7.js +1 -0
- package/build/js/8004.80b538a1.js +1 -0
- package/build/js/8030.70f27b26.js +1 -0
- package/build/js/8093.b4466960.js +3 -0
- package/build/js/8328.d2170039.js +1 -0
- package/build/js/8344.e4b1e024.js +1 -0
- package/build/js/8366.2854dcb7.js +1 -0
- package/build/js/8438.72c0fcbf.js +1 -0
- package/build/js/8550.69a717cc.js +1 -0
- package/build/js/8554.1dbe7424.js +1 -0
- package/build/js/8632.da334e90.js +1 -0
- package/build/js/8637.20577619.js +1 -0
- package/build/js/8657.d3a8799b.js +1 -0
- package/build/js/8743.2cffd0be.js +1 -0
- package/build/js/88.4db81116.js +1 -0
- package/build/js/8856.9f70af00.js +1 -0
- package/build/js/9020.b3a4d09b.js +1 -0
- package/build/js/9044.73639ece.js +1 -0
- package/build/js/9157.58a8fa2d.js +1 -0
- package/build/js/9256.85fca918.js +1 -0
- package/build/js/931.88800e05.js +1 -0
- package/build/js/9339.d75f7c2e.js +1 -0
- package/build/js/9384.adddd8c7.js +1 -0
- package/build/js/94.59ed492b.js +1 -0
- package/build/js/9620.e7e75a12.js +1 -0
- package/build/js/9751.8b76fab5.js +1 -0
- package/build/js/9842.d1ed9070.js +1 -0
- package/build/js/9947.e172d61d.js +1 -0
- package/build/js/chunk-vendors.fea3dfe0.js +24 -0
- package/build/js/index.b935de87.js +1 -0
- package/build/js/login.1488a09a.js +1 -0
- package/build/js/preview.6c550af7.js +1 -0
- package/build/json.worker.js +1 -0
- package/build/login.html +1 -0
- package/build/logo//344/270/273LOGO.png +0 -0
- package/build/logo//344/270/273/345/233/276/346/240/207.png +0 -0
- package/build/logo//344/270/273/346/226/271/345/275/242.png +0 -0
- package/build/logo//347/201/260/345/272/246LOGO.png +0 -0
- package/build/logo//351/200/217/346/230/216/345/233/276/346/240/207.png +0 -0
- package/build/logo//351/200/217/346/230/216/350/203/214/346/231/257LOGO.png +0 -0
- package/build/preview.html +1 -0
- package/build/ts.worker.js +6 -0
- package/pack/auto-provider-plugin/index.js +38 -0
- package/pack/auto-provider-plugin/loader.js +53 -0
- package/pack/auto-provider-plugin/package.json +8 -0
- package/pack/class-wrapper-plugin/index.js +42 -0
- package/pack/class-wrapper-plugin/loaders/descriptor.js +89 -0
- package/pack/class-wrapper-plugin/loaders/dynamic-interpreter.js +54 -0
- package/pack/class-wrapper-plugin/loaders/index.js +30 -0
- package/pack/class-wrapper-plugin/loaders/input-system.js +31 -0
- package/pack/class-wrapper-plugin/loaders/object-pool.js +79 -0
- package/pack/class-wrapper-plugin/package.json +8 -0
- package/pack/class-wrapper-plugin/utils.js +79 -0
- package/pack/rollup-config-plugin/build/index.d.ts +3 -0
- package/pack/rollup-config-plugin/build/index.js +34 -0
- package/pack/rollup-config-plugin/package.json +8 -0
- package/pack/rollup-config-plugin/src/index.ts +47 -0
- package/pack/rollup-config-plugin/tsconfig.json +31 -0
- package/pack/var-rename-plugin/index.js +74 -0
- package/pack/var-rename-plugin/package.json +8 -0
- package/package.json +83 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(e,t){"object"===typeof exports&&"undefined"!==typeof module?t(exports):"function"===typeof define&&define.amd?define(["exports"],t):(e="undefined"!==typeof globalThis?globalThis:e||self,t(e["__VYR_RUNTIME_@vyr/locale"]={}))})(this,function(e){"use strict";var t=Object.defineProperty,n=(e,n,o)=>n in e?t(e,n,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[n]=o,o=(e,t,o)=>n(e,"symbol"!==typeof t?t+"":t,o);class r{constructor(e){o(this,"_provider"),o(this,"name"),this.name=e.name,this._provider=e}_replaceParams(e,t){return e&&e.includes("{{")&&void 0!==t?e.replace(/\{\{\s*([^{}]+?)\s*\}\}/g,(e,n)=>{const o=n.trim();return t.hasOwnProperty(o)?String(t[o]):e}):e}get(e,t){const n=this._provider[e]??"";return this._replaceParams(n,t)}setProvider(e){this._provider=e}}const a={languageProviderCollection:new Map,languageCollection:new Map,currentLanguageId:"zh_CN"};class i{static register(e){a.languageProviderCollection.set(e.id+e.name,e)}static use(e){if(a.currentLanguageId===e)return;a.currentLanguageId=e;const t=a.languageCollection.values();for(const n of t){const t=a.languageProviderCollection.get(e+n.name);void 0!==t&&n.setProvider(t)}}static getLanguage(e){let t=a.languageCollection.get(e);if(void 0===t){let n=a.languageProviderCollection.get(a.currentLanguageId+e);void 0===n&&(n=a.languageProviderCollection.get("zh_CN"+e),void 0===n&&(n={id:"zh_CN",name:e})),t=new r(n),a.languageCollection.set(e,t)}return t}}e.Language=r,e.Locale=i});
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Socket.IO v4.8.1
|
|
3
|
+
* (c) 2014-2024 Guillermo Rauch
|
|
4
|
+
* Released under the MIT License.
|
|
5
|
+
*/
|
|
6
|
+
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).io=e()}(this,function(){"use strict";function t(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function e(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,u(r.key),r)}}function n(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function r(e,n){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,n){if(e){if("string"==typeof e)return t(e,n);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?t(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){r&&(e=r);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,c=!1;return{s:function(){r=r.call(e)},n:function(){var t=r.next();return a=t.done,t},e:function(t){c=!0,s=t},f:function(){try{a||null==r.return||r.return()}finally{if(c)throw s}}}}function i(){return i=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)({}).hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},i.apply(null,arguments)}function o(t){return o=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},o(t)}function s(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,c(t,e)}function a(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(a=function(){return!!t})()}function c(t,e){return c=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},c(t,e)}function u(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:e+""}function h(t){return h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},h(t)}function f(t){var e="function"==typeof Map?new Map:void 0;return f=function(t){if(null===t||!function(t){try{return-1!==Function.toString.call(t).indexOf("[native code]")}catch(e){return"function"==typeof t}}(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return function(t,e,n){if(a())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,e);var i=new(t.bind.apply(t,r));return n&&c(i,n.prototype),i}(t,arguments,o(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),c(n,t)},f(t)}var p=Object.create(null);p.open="0",p.close="1",p.ping="2",p.pong="3",p.message="4",p.upgrade="5",p.noop="6";var l=Object.create(null);Object.keys(p).forEach(function(t){l[p[t]]=t});var d,y={type:"error",data:"parser error"},v="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===Object.prototype.toString.call(Blob),g="function"==typeof ArrayBuffer,m=function(t){return"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer instanceof ArrayBuffer},b=function(t,e,n){var r=t.type,i=t.data;return v&&i instanceof Blob?e?n(i):w(i,n):g&&(i instanceof ArrayBuffer||m(i))?e?n(i):w(new Blob([i]),n):n(p[r]+(i||""))},w=function(t,e){var n=new FileReader;return n.onload=function(){var t=n.result.split(",")[1];e("b"+(t||""))},n.readAsDataURL(t)};function k(t){return t instanceof Uint8Array?t:t instanceof ArrayBuffer?new Uint8Array(t):new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}for(var A="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",E="undefined"==typeof Uint8Array?[]:new Uint8Array(256),O=0;O<64;O++)E[A.charCodeAt(O)]=O;var R,T="function"==typeof ArrayBuffer,B=function(t,e){if("string"!=typeof t)return{type:"message",data:C(t,e)};var n=t.charAt(0);return"b"===n?{type:"message",data:S(t.substring(1),e)}:l[n]?t.length>1?{type:l[n],data:t.substring(1)}:{type:l[n]}:y},S=function(t,e){if(T){var n=function(t){var e,n,r,i,o,s=.75*t.length,a=t.length,c=0;"="===t[t.length-1]&&(s--,"="===t[t.length-2]&&s--);var u=new ArrayBuffer(s),h=new Uint8Array(u);for(e=0;e<a;e+=4)n=E[t.charCodeAt(e)],r=E[t.charCodeAt(e+1)],i=E[t.charCodeAt(e+2)],o=E[t.charCodeAt(e+3)],h[c++]=n<<2|r>>4,h[c++]=(15&r)<<4|i>>2,h[c++]=(3&i)<<6|63&o;return u}(t);return C(n,e)}return{base64:!0,data:t}},C=function(t,e){return"blob"===e?t instanceof Blob?t:new Blob([t]):t instanceof ArrayBuffer?t:t.buffer},N=String.fromCharCode(30);function j(){return new TransformStream({transform:function(t,e){!function(t,e){v&&t.data instanceof Blob?t.data.arrayBuffer().then(k).then(e):g&&(t.data instanceof ArrayBuffer||m(t.data))?e(k(t.data)):b(t,!1,function(t){d||(d=new TextEncoder),e(d.encode(t))})}(t,function(n){var r,i=n.length;if(i<126)r=new Uint8Array(1),new DataView(r.buffer).setUint8(0,i);else if(i<65536){r=new Uint8Array(3);var o=new DataView(r.buffer);o.setUint8(0,126),o.setUint16(1,i)}else{r=new Uint8Array(9);var s=new DataView(r.buffer);s.setUint8(0,127),s.setBigUint64(1,BigInt(i))}t.data&&"string"!=typeof t.data&&(r[0]|=128),e.enqueue(r),e.enqueue(n)})}})}function x(t){return t.reduce(function(t,e){return t+e.length},0)}function q(t,e){if(t[0].length===e)return t.shift();for(var n=new Uint8Array(e),r=0,i=0;i<e;i++)n[i]=t[0][r++],r===t[0].length&&(t.shift(),r=0);return t.length&&r<t[0].length&&(t[0]=t[0].slice(r)),n}function P(t){if(t)return function(t){for(var e in P.prototype)t[e]=P.prototype[e];return t}(t)}P.prototype.on=P.prototype.addEventListener=function(t,e){return this.t=this.t||{},(this.t["$"+t]=this.t["$"+t]||[]).push(e),this},P.prototype.once=function(t,e){function n(){this.off(t,n),e.apply(this,arguments)}return n.fn=e,this.on(t,n),this},P.prototype.off=P.prototype.removeListener=P.prototype.removeAllListeners=P.prototype.removeEventListener=function(t,e){if(this.t=this.t||{},0==arguments.length)return this.t={},this;var n,r=this.t["$"+t];if(!r)return this;if(1==arguments.length)return delete this.t["$"+t],this;for(var i=0;i<r.length;i++)if((n=r[i])===e||n.fn===e){r.splice(i,1);break}return 0===r.length&&delete this.t["$"+t],this},P.prototype.emit=function(t){this.t=this.t||{};for(var e=new Array(arguments.length-1),n=this.t["$"+t],r=1;r<arguments.length;r++)e[r-1]=arguments[r];if(n){r=0;for(var i=(n=n.slice(0)).length;r<i;++r)n[r].apply(this,e)}return this},P.prototype.emitReserved=P.prototype.emit,P.prototype.listeners=function(t){return this.t=this.t||{},this.t["$"+t]||[]},P.prototype.hasListeners=function(t){return!!this.listeners(t).length};var _="function"==typeof Promise&&"function"==typeof Promise.resolve?function(t){return Promise.resolve().then(t)}:function(t,e){return e(t,0)},U="undefined"!=typeof self?self:"undefined"!=typeof window?window:Function("return this")();function F(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return n.reduce(function(e,n){return t.hasOwnProperty(n)&&(e[n]=t[n]),e},{})}var I=U.setTimeout,L=U.clearTimeout;function D(t,e){e.useNativeTimers?(t.setTimeoutFn=I.bind(U),t.clearTimeoutFn=L.bind(U)):(t.setTimeoutFn=U.setTimeout.bind(U),t.clearTimeoutFn=U.clearTimeout.bind(U))}function M(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}var V=function(t){function e(e,n,r){var i;return(i=t.call(this,e)||this).description=n,i.context=r,i.type="TransportError",i}return s(e,t),e}(f(Error)),H=function(t){function e(e){var n;return(n=t.call(this)||this).writable=!1,D(n,e),n.opts=e,n.query=e.query,n.socket=e.socket,n.supportsBinary=!e.forceBase64,n}s(e,t);var n=e.prototype;return n.onError=function(e,n,r){return t.prototype.emitReserved.call(this,"error",new V(e,n,r)),this},n.open=function(){return this.readyState="opening",this.doOpen(),this},n.close=function(){return"opening"!==this.readyState&&"open"!==this.readyState||(this.doClose(),this.onClose()),this},n.send=function(t){"open"===this.readyState&&this.write(t)},n.onOpen=function(){this.readyState="open",this.writable=!0,t.prototype.emitReserved.call(this,"open")},n.onData=function(t){var e=B(t,this.socket.binaryType);this.onPacket(e)},n.onPacket=function(e){t.prototype.emitReserved.call(this,"packet",e)},n.onClose=function(e){this.readyState="closed",t.prototype.emitReserved.call(this,"close",e)},n.pause=function(t){},n.createUri=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t+"://"+this.i()+this.o()+this.opts.path+this.u(e)},n.i=function(){var t=this.opts.hostname;return-1===t.indexOf(":")?t:"["+t+"]"},n.o=function(){return this.opts.port&&(this.opts.secure&&Number(443!==this.opts.port)||!this.opts.secure&&80!==Number(this.opts.port))?":"+this.opts.port:""},n.u=function(t){var e=function(t){var e="";for(var n in t)t.hasOwnProperty(n)&&(e.length&&(e+="&"),e+=encodeURIComponent(n)+"="+encodeURIComponent(t[n]));return e}(t);return e.length?"?"+e:""},e}(P),K=function(t){function e(){var e;return(e=t.apply(this,arguments)||this).h=!1,e}s(e,t);var r=e.prototype;return r.doOpen=function(){this.v()},r.pause=function(t){var e=this;this.readyState="pausing";var n=function(){e.readyState="paused",t()};if(this.h||!this.writable){var r=0;this.h&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()},r.v=function(){this.h=!0,this.doPoll(),this.emitReserved("poll")},r.onData=function(t){var e=this;(function(t,e){for(var n=t.split(N),r=[],i=0;i<n.length;i++){var o=B(n[i],e);if(r.push(o),"error"===o.type)break}return r})(t,this.socket.binaryType).forEach(function(t){if("opening"===e.readyState&&"open"===t.type&&e.onOpen(),"close"===t.type)return e.onClose({description:"transport closed by the server"}),!1;e.onPacket(t)}),"closed"!==this.readyState&&(this.h=!1,this.emitReserved("pollComplete"),"open"===this.readyState&&this.v())},r.doClose=function(){var t=this,e=function(){t.write([{type:"close"}])};"open"===this.readyState?e():this.once("open",e)},r.write=function(t){var e=this;this.writable=!1,function(t,e){var n=t.length,r=new Array(n),i=0;t.forEach(function(t,o){b(t,!1,function(t){r[o]=t,++i===n&&e(r.join(N))})})}(t,function(t){e.doWrite(t,function(){e.writable=!0,e.emitReserved("drain")})})},r.uri=function(){var t=this.opts.secure?"https":"http",e=this.query||{};return!1!==this.opts.timestampRequests&&(e[this.opts.timestampParam]=M()),this.supportsBinary||e.sid||(e.b64=1),this.createUri(t,e)},n(e,[{key:"name",get:function(){return"polling"}}])}(H),Y=!1;try{Y="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}catch(t){}var W=Y;function $(){}var J=function(t){function e(e){var n;if(n=t.call(this,e)||this,"undefined"!=typeof location){var r="https:"===location.protocol,i=location.port;i||(i=r?"443":"80"),n.xd="undefined"!=typeof location&&e.hostname!==location.hostname||i!==e.port}return n}s(e,t);var n=e.prototype;return n.doWrite=function(t,e){var n=this,r=this.request({method:"POST",data:t});r.on("success",e),r.on("error",function(t,e){n.onError("xhr post error",t,e)})},n.doPoll=function(){var t=this,e=this.request();e.on("data",this.onData.bind(this)),e.on("error",function(e,n){t.onError("xhr poll error",e,n)}),this.pollXhr=e},e}(K),z=function(t){function e(e,n,r){var i;return(i=t.call(this)||this).createRequest=e,D(i,r),i.l=r,i.p=r.method||"GET",i.m=n,i.k=void 0!==r.data?r.data:null,i.A(),i}s(e,t);var n=e.prototype;return n.A=function(){var t,n=this,r=F(this.l,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");r.xdomain=!!this.l.xd;var i=this.j=this.createRequest(r);try{i.open(this.p,this.m,!0);try{if(this.l.extraHeaders)for(var o in i.setDisableHeaderCheck&&i.setDisableHeaderCheck(!0),this.l.extraHeaders)this.l.extraHeaders.hasOwnProperty(o)&&i.setRequestHeader(o,this.l.extraHeaders[o])}catch(t){}if("POST"===this.p)try{i.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(t){}try{i.setRequestHeader("Accept","*/*")}catch(t){}null===(t=this.l.cookieJar)||void 0===t||t.addCookies(i),"withCredentials"in i&&(i.withCredentials=this.l.withCredentials),this.l.requestTimeout&&(i.timeout=this.l.requestTimeout),i.onreadystatechange=function(){var t;3===i.readyState&&(null===(t=n.l.cookieJar)||void 0===t||t.parseCookies(i.getResponseHeader("set-cookie"))),4===i.readyState&&(200===i.status||1223===i.status?n.O():n.setTimeoutFn(function(){n.B("number"==typeof i.status?i.status:0)},0))},i.send(this.k)}catch(t){return void this.setTimeoutFn(function(){n.B(t)},0)}"undefined"!=typeof document&&(this.S=e.requestsCount++,e.requests[this.S]=this)},n.B=function(t){this.emitReserved("error",t,this.j),this.N(!0)},n.N=function(t){if(void 0!==this.j&&null!==this.j){if(this.j.onreadystatechange=$,t)try{this.j.abort()}catch(t){}"undefined"!=typeof document&&delete e.requests[this.S],this.j=null}},n.O=function(){var t=this.j.responseText;null!==t&&(this.emitReserved("data",t),this.emitReserved("success"),this.N())},n.abort=function(){this.N()},e}(P);function X(){for(var t in z.requests)z.requests.hasOwnProperty(t)&&z.requests[t].abort()}z.requestsCount=0,z.requests={},"undefined"!=typeof document&&("function"==typeof attachEvent?attachEvent("onunload",X):"function"==typeof addEventListener&&addEventListener("onpagehide"in U?"pagehide":"unload",X,!1));var Z,G=(Z=tt({xdomain:!1}))&&null!==Z.responseType,Q=function(t){function e(e){var n;n=t.call(this,e)||this;var r=e&&e.forceBase64;return n.supportsBinary=G&&!r,n}return s(e,t),e.prototype.request=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return i(t,{xd:this.xd},this.opts),new z(tt,this.uri(),t)},e}(J);function tt(t){var e=t.xdomain;try{if("undefined"!=typeof XMLHttpRequest&&(!e||W))return new XMLHttpRequest}catch(t){}if(!e)try{return new(U[["Active"].concat("Object").join("X")])("Microsoft.XMLHTTP")}catch(t){}}var et="undefined"!=typeof navigator&&"string"==typeof navigator.product&&"reactnative"===navigator.product.toLowerCase(),nt=function(t){function e(){return t.apply(this,arguments)||this}s(e,t);var r=e.prototype;return r.doOpen=function(){var t=this.uri(),e=this.opts.protocols,n=et?{}:F(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(n.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(t,e,n)}catch(t){return this.emitReserved("error",t)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()},r.addEventListeners=function(){var t=this;this.ws.onopen=function(){t.opts.autoUnref&&t.ws.C.unref(),t.onOpen()},this.ws.onclose=function(e){return t.onClose({description:"websocket connection closed",context:e})},this.ws.onmessage=function(e){return t.onData(e.data)},this.ws.onerror=function(e){return t.onError("websocket error",e)}},r.write=function(t){var e=this;this.writable=!1;for(var n=function(){var n=t[r],i=r===t.length-1;b(n,e.supportsBinary,function(t){try{e.doWrite(n,t)}catch(t){}i&&_(function(){e.writable=!0,e.emitReserved("drain")},e.setTimeoutFn)})},r=0;r<t.length;r++)n()},r.doClose=function(){void 0!==this.ws&&(this.ws.onerror=function(){},this.ws.close(),this.ws=null)},r.uri=function(){var t=this.opts.secure?"wss":"ws",e=this.query||{};return this.opts.timestampRequests&&(e[this.opts.timestampParam]=M()),this.supportsBinary||(e.b64=1),this.createUri(t,e)},n(e,[{key:"name",get:function(){return"websocket"}}])}(H),rt=U.WebSocket||U.MozWebSocket,it=function(t){function e(){return t.apply(this,arguments)||this}s(e,t);var n=e.prototype;return n.createSocket=function(t,e,n){return et?new rt(t,e,n):e?new rt(t,e):new rt(t)},n.doWrite=function(t,e){this.ws.send(e)},e}(nt),ot=function(t){function e(){return t.apply(this,arguments)||this}s(e,t);var r=e.prototype;return r.doOpen=function(){var t=this;try{this.T=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(t){return this.emitReserved("error",t)}this.T.closed.then(function(){t.onClose()}).catch(function(e){t.onError("webtransport error",e)}),this.T.ready.then(function(){t.T.createBidirectionalStream().then(function(e){var n=function(t,e){R||(R=new TextDecoder);var n=[],r=0,i=-1,o=!1;return new TransformStream({transform:function(s,a){for(n.push(s);;){if(0===r){if(x(n)<1)break;var c=q(n,1);o=!(128&~c[0]),i=127&c[0],r=i<126?3:126===i?1:2}else if(1===r){if(x(n)<2)break;var u=q(n,2);i=new DataView(u.buffer,u.byteOffset,u.length).getUint16(0),r=3}else if(2===r){if(x(n)<8)break;var h=q(n,8),f=new DataView(h.buffer,h.byteOffset,h.length),p=f.getUint32(0);if(p>Math.pow(2,21)-1){a.enqueue(y);break}i=p*Math.pow(2,32)+f.getUint32(4),r=3}else{if(x(n)<i)break;var l=q(n,i);a.enqueue(B(o?l:R.decode(l),e)),r=0}if(0===i||i>t){a.enqueue(y);break}}}})}(Number.MAX_SAFE_INTEGER,t.socket.binaryType),r=e.readable.pipeThrough(n).getReader(),i=j();i.readable.pipeTo(e.writable),t.U=i.writable.getWriter(),function e(){r.read().then(function(n){var r=n.done,i=n.value;r||(t.onPacket(i),e())}).catch(function(t){})}();var o={type:"open"};t.query.sid&&(o.data='{"sid":"'.concat(t.query.sid,'"}')),t.U.write(o).then(function(){return t.onOpen()})})})},r.write=function(t){var e=this;this.writable=!1;for(var n=function(){var n=t[r],i=r===t.length-1;e.U.write(n).then(function(){i&&_(function(){e.writable=!0,e.emitReserved("drain")},e.setTimeoutFn)})},r=0;r<t.length;r++)n()},r.doClose=function(){var t;null===(t=this.T)||void 0===t||t.close()},n(e,[{key:"name",get:function(){return"webtransport"}}])}(H),st={websocket:it,webtransport:ot,polling:Q},at=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,ct=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function ut(t){if(t.length>8e3)throw"URI too long";var e=t,n=t.indexOf("["),r=t.indexOf("]");-1!=n&&-1!=r&&(t=t.substring(0,n)+t.substring(n,r).replace(/:/g,";")+t.substring(r,t.length));for(var i,o,s=at.exec(t||""),a={},c=14;c--;)a[ct[c]]=s[c]||"";return-1!=n&&-1!=r&&(a.source=e,a.host=a.host.substring(1,a.host.length-1).replace(/;/g,":"),a.authority=a.authority.replace("[","").replace("]","").replace(/;/g,":"),a.ipv6uri=!0),a.pathNames=function(t,e){var n=/\/{2,9}/g,r=e.replace(n,"/").split("/");return"/"!=e.slice(0,1)&&0!==e.length||r.splice(0,1),"/"==e.slice(-1)&&r.splice(r.length-1,1),r}(0,a.path),a.queryKey=(i=a.query,o={},i.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(t,e,n){e&&(o[e]=n)}),o),a}var ht="function"==typeof addEventListener&&"function"==typeof removeEventListener,ft=[];ht&&addEventListener("offline",function(){ft.forEach(function(t){return t()})},!1);var pt=function(t){function e(e,n){var r;if((r=t.call(this)||this).binaryType="arraybuffer",r.writeBuffer=[],r.M=0,r.I=-1,r.R=-1,r.L=-1,r._=1/0,e&&"object"===h(e)&&(n=e,e=null),e){var o=ut(e);n.hostname=o.host,n.secure="https"===o.protocol||"wss"===o.protocol,n.port=o.port,o.query&&(n.query=o.query)}else n.host&&(n.hostname=ut(n.host).host);return D(r,n),r.secure=null!=n.secure?n.secure:"undefined"!=typeof location&&"https:"===location.protocol,n.hostname&&!n.port&&(n.port=r.secure?"443":"80"),r.hostname=n.hostname||("undefined"!=typeof location?location.hostname:"localhost"),r.port=n.port||("undefined"!=typeof location&&location.port?location.port:r.secure?"443":"80"),r.transports=[],r.D={},n.transports.forEach(function(t){var e=t.prototype.name;r.transports.push(e),r.D[e]=t}),r.opts=i({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},n),r.opts.path=r.opts.path.replace(/\/$/,"")+(r.opts.addTrailingSlash?"/":""),"string"==typeof r.opts.query&&(r.opts.query=function(t){for(var e={},n=t.split("&"),r=0,i=n.length;r<i;r++){var o=n[r].split("=");e[decodeURIComponent(o[0])]=decodeURIComponent(o[1])}return e}(r.opts.query)),ht&&(r.opts.closeOnBeforeunload&&(r.P=function(){r.transport&&(r.transport.removeAllListeners(),r.transport.close())},addEventListener("beforeunload",r.P,!1)),"localhost"!==r.hostname&&(r.$=function(){r.F("transport close",{description:"network connection lost"})},ft.push(r.$))),r.opts.withCredentials&&(r.V=void 0),r.q(),r}s(e,t);var n=e.prototype;return n.createTransport=function(t){var e=i({},this.opts.query);e.EIO=4,e.transport=t,this.id&&(e.sid=this.id);var n=i({},this.opts,{query:e,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new this.D[t](n)},n.q=function(){var t=this;if(0!==this.transports.length){var n=this.opts.rememberUpgrade&&e.priorWebsocketSuccess&&-1!==this.transports.indexOf("websocket")?"websocket":this.transports[0];this.readyState="opening";var r=this.createTransport(n);r.open(),this.setTransport(r)}else this.setTimeoutFn(function(){t.emitReserved("error","No transports available")},0)},n.setTransport=function(t){var e=this;this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this.X.bind(this)).on("packet",this.H.bind(this)).on("error",this.B.bind(this)).on("close",function(t){return e.F("transport close",t)})},n.onOpen=function(){this.readyState="open",e.priorWebsocketSuccess="websocket"===this.transport.name,this.emitReserved("open"),this.flush()},n.H=function(t){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState)switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this.J("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this.K();break;case"error":var e=new Error("server error");e.code=t.data,this.B(e);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data)}},n.onHandshake=function(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this.I=t.pingInterval,this.R=t.pingTimeout,this.L=t.maxPayload,this.onOpen(),"closed"!==this.readyState&&this.K()},n.K=function(){var t=this;this.clearTimeoutFn(this.Y);var e=this.I+this.R;this._=Date.now()+e,this.Y=this.setTimeoutFn(function(){t.F("ping timeout")},e),this.opts.autoUnref&&this.Y.unref()},n.X=function(){this.writeBuffer.splice(0,this.M),this.M=0,0===this.writeBuffer.length?this.emitReserved("drain"):this.flush()},n.flush=function(){if("closed"!==this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){var t=this.G();this.transport.send(t),this.M=t.length,this.emitReserved("flush")}},n.G=function(){if(!(this.L&&"polling"===this.transport.name&&this.writeBuffer.length>1))return this.writeBuffer;for(var t,e=1,n=0;n<this.writeBuffer.length;n++){var r=this.writeBuffer[n].data;if(r&&(e+="string"==typeof(t=r)?function(t){for(var e=0,n=0,r=0,i=t.length;r<i;r++)(e=t.charCodeAt(r))<128?n+=1:e<2048?n+=2:e<55296||e>=57344?n+=3:(r++,n+=4);return n}(t):Math.ceil(1.33*(t.byteLength||t.size))),n>0&&e>this.L)return this.writeBuffer.slice(0,n);e+=2}return this.writeBuffer},n.W=function(){var t=this;if(!this._)return!0;var e=Date.now()>this._;return e&&(this._=0,_(function(){t.F("ping timeout")},this.setTimeoutFn)),e},n.write=function(t,e,n){return this.J("message",t,e,n),this},n.send=function(t,e,n){return this.J("message",t,e,n),this},n.J=function(t,e,n,r){if("function"==typeof e&&(r=e,e=void 0),"function"==typeof n&&(r=n,n=null),"closing"!==this.readyState&&"closed"!==this.readyState){(n=n||{}).compress=!1!==n.compress;var i={type:t,data:e,options:n};this.emitReserved("packetCreate",i),this.writeBuffer.push(i),r&&this.once("flush",r),this.flush()}},n.close=function(){var t=this,e=function(){t.F("forced close"),t.transport.close()},n=function n(){t.off("upgrade",n),t.off("upgradeError",n),e()},r=function(){t.once("upgrade",n),t.once("upgradeError",n)};return"opening"!==this.readyState&&"open"!==this.readyState||(this.readyState="closing",this.writeBuffer.length?this.once("drain",function(){t.upgrading?r():e()}):this.upgrading?r():e()),this},n.B=function(t){if(e.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&"opening"===this.readyState)return this.transports.shift(),this.q();this.emitReserved("error",t),this.F("transport error",t)},n.F=function(t,e){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState){if(this.clearTimeoutFn(this.Y),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),ht&&(this.P&&removeEventListener("beforeunload",this.P,!1),this.$)){var n=ft.indexOf(this.$);-1!==n&&ft.splice(n,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,e),this.writeBuffer=[],this.M=0}},e}(P);pt.protocol=4;var lt=function(t){function e(){var e;return(e=t.apply(this,arguments)||this).Z=[],e}s(e,t);var n=e.prototype;return n.onOpen=function(){if(t.prototype.onOpen.call(this),"open"===this.readyState&&this.opts.upgrade)for(var e=0;e<this.Z.length;e++)this.tt(this.Z[e])},n.tt=function(t){var e=this,n=this.createTransport(t),r=!1;pt.priorWebsocketSuccess=!1;var i=function(){r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",function(t){if(!r)if("pong"===t.type&&"probe"===t.data){if(e.upgrading=!0,e.emitReserved("upgrading",n),!n)return;pt.priorWebsocketSuccess="websocket"===n.name,e.transport.pause(function(){r||"closed"!==e.readyState&&(h(),e.setTransport(n),n.send([{type:"upgrade"}]),e.emitReserved("upgrade",n),n=null,e.upgrading=!1,e.flush())})}else{var i=new Error("probe error");i.transport=n.name,e.emitReserved("upgradeError",i)}}))};function o(){r||(r=!0,h(),n.close(),n=null)}var s=function(t){var r=new Error("probe error: "+t);r.transport=n.name,o(),e.emitReserved("upgradeError",r)};function a(){s("transport closed")}function c(){s("socket closed")}function u(t){n&&t.name!==n.name&&o()}var h=function(){n.removeListener("open",i),n.removeListener("error",s),n.removeListener("close",a),e.off("close",c),e.off("upgrading",u)};n.once("open",i),n.once("error",s),n.once("close",a),this.once("close",c),this.once("upgrading",u),-1!==this.Z.indexOf("webtransport")&&"webtransport"!==t?this.setTimeoutFn(function(){r||n.open()},200):n.open()},n.onHandshake=function(e){this.Z=this.nt(e.upgrades),t.prototype.onHandshake.call(this,e)},n.nt=function(t){for(var e=[],n=0;n<t.length;n++)~this.transports.indexOf(t[n])&&e.push(t[n]);return e},e}(pt),dt=function(t){function e(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r="object"===h(e)?e:n;return(!r.transports||r.transports&&"string"==typeof r.transports[0])&&(r.transports=(r.transports||["polling","websocket","webtransport"]).map(function(t){return st[t]}).filter(function(t){return!!t})),t.call(this,e,r)||this}return s(e,t),e}(lt);dt.protocol;var yt="function"==typeof ArrayBuffer,vt=function(t){return"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(t):t.buffer instanceof ArrayBuffer},gt=Object.prototype.toString,mt="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===gt.call(Blob),bt="function"==typeof File||"undefined"!=typeof File&&"[object FileConstructor]"===gt.call(File);function wt(t){return yt&&(t instanceof ArrayBuffer||vt(t))||mt&&t instanceof Blob||bt&&t instanceof File}function kt(t,e){if(!t||"object"!==h(t))return!1;if(Array.isArray(t)){for(var n=0,r=t.length;n<r;n++)if(kt(t[n]))return!0;return!1}if(wt(t))return!0;if(t.toJSON&&"function"==typeof t.toJSON&&1===arguments.length)return kt(t.toJSON(),!0);for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)&&kt(t[i]))return!0;return!1}function At(t){var e=[],n=t.data,r=t;return r.data=Et(n,e),r.attachments=e.length,{packet:r,buffers:e}}function Et(t,e){if(!t)return t;if(wt(t)){var n={_placeholder:!0,num:e.length};return e.push(t),n}if(Array.isArray(t)){for(var r=new Array(t.length),i=0;i<t.length;i++)r[i]=Et(t[i],e);return r}if("object"===h(t)&&!(t instanceof Date)){var o={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(o[s]=Et(t[s],e));return o}return t}function Ot(t,e){return t.data=Rt(t.data,e),delete t.attachments,t}function Rt(t,e){if(!t)return t;if(t&&!0===t._placeholder){if("number"==typeof t.num&&t.num>=0&&t.num<e.length)return e[t.num];throw new Error("illegal attachments")}if(Array.isArray(t))for(var n=0;n<t.length;n++)t[n]=Rt(t[n],e);else if("object"===h(t))for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(t[r]=Rt(t[r],e));return t}var Tt,Bt=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];!function(t){t[t.CONNECT=0]="CONNECT",t[t.DISCONNECT=1]="DISCONNECT",t[t.EVENT=2]="EVENT",t[t.ACK=3]="ACK",t[t.CONNECT_ERROR=4]="CONNECT_ERROR",t[t.BINARY_EVENT=5]="BINARY_EVENT",t[t.BINARY_ACK=6]="BINARY_ACK"}(Tt||(Tt={}));var St=function(){function t(t){this.replacer=t}var e=t.prototype;return e.encode=function(t){return t.type!==Tt.EVENT&&t.type!==Tt.ACK||!kt(t)?[this.encodeAsString(t)]:this.encodeAsBinary({type:t.type===Tt.EVENT?Tt.BINARY_EVENT:Tt.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id})},e.encodeAsString=function(t){var e=""+t.type;return t.type!==Tt.BINARY_EVENT&&t.type!==Tt.BINARY_ACK||(e+=t.attachments+"-"),t.nsp&&"/"!==t.nsp&&(e+=t.nsp+","),null!=t.id&&(e+=t.id),null!=t.data&&(e+=JSON.stringify(t.data,this.replacer)),e},e.encodeAsBinary=function(t){var e=At(t),n=this.encodeAsString(e.packet),r=e.buffers;return r.unshift(n),r},t}(),Ct=function(t){function e(e){var n;return(n=t.call(this)||this).reviver=e,n}s(e,t);var n=e.prototype;return n.add=function(e){var n;if("string"==typeof e){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");var r=(n=this.decodeString(e)).type===Tt.BINARY_EVENT;r||n.type===Tt.BINARY_ACK?(n.type=r?Tt.EVENT:Tt.ACK,this.reconstructor=new Nt(n),0===n.attachments&&t.prototype.emitReserved.call(this,"decoded",n)):t.prototype.emitReserved.call(this,"decoded",n)}else{if(!wt(e)&&!e.base64)throw new Error("Unknown type: "+e);if(!this.reconstructor)throw new Error("got binary data when not reconstructing a packet");(n=this.reconstructor.takeBinaryData(e))&&(this.reconstructor=null,t.prototype.emitReserved.call(this,"decoded",n))}},n.decodeString=function(t){var n=0,r={type:Number(t.charAt(0))};if(void 0===Tt[r.type])throw new Error("unknown packet type "+r.type);if(r.type===Tt.BINARY_EVENT||r.type===Tt.BINARY_ACK){for(var i=n+1;"-"!==t.charAt(++n)&&n!=t.length;);var o=t.substring(i,n);if(o!=Number(o)||"-"!==t.charAt(n))throw new Error("Illegal attachments");r.attachments=Number(o)}if("/"===t.charAt(n+1)){for(var s=n+1;++n;){if(","===t.charAt(n))break;if(n===t.length)break}r.nsp=t.substring(s,n)}else r.nsp="/";var a=t.charAt(n+1);if(""!==a&&Number(a)==a){for(var c=n+1;++n;){var u=t.charAt(n);if(null==u||Number(u)!=u){--n;break}if(n===t.length)break}r.id=Number(t.substring(c,n+1))}if(t.charAt(++n)){var h=this.tryParse(t.substr(n));if(!e.isPayloadValid(r.type,h))throw new Error("invalid payload");r.data=h}return r},n.tryParse=function(t){try{return JSON.parse(t,this.reviver)}catch(t){return!1}},e.isPayloadValid=function(t,e){switch(t){case Tt.CONNECT:return xt(e);case Tt.DISCONNECT:return void 0===e;case Tt.CONNECT_ERROR:return"string"==typeof e||xt(e);case Tt.EVENT:case Tt.BINARY_EVENT:return Array.isArray(e)&&("number"==typeof e[0]||"string"==typeof e[0]&&-1===Bt.indexOf(e[0]));case Tt.ACK:case Tt.BINARY_ACK:return Array.isArray(e)}},n.destroy=function(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)},e}(P),Nt=function(){function t(t){this.packet=t,this.buffers=[],this.reconPack=t}var e=t.prototype;return e.takeBinaryData=function(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){var e=Ot(this.reconPack,this.buffers);return this.finishedReconstruction(),e}return null},e.finishedReconstruction=function(){this.reconPack=null,this.buffers=[]},t}(),jt=Number.isInteger||function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t};function xt(t){return"[object Object]"===Object.prototype.toString.call(t)}var qt=Object.freeze({__proto__:null,protocol:5,get PacketType(){return Tt},Encoder:St,Decoder:Ct,isPacketValid:function(t){return"string"==typeof t.nsp&&(void 0===(e=t.id)||jt(e))&&function(t,e){switch(t){case Tt.CONNECT:return void 0===e||xt(e);case Tt.DISCONNECT:return void 0===e;case Tt.EVENT:return Array.isArray(e)&&("number"==typeof e[0]||"string"==typeof e[0]&&-1===Bt.indexOf(e[0]));case Tt.ACK:return Array.isArray(e);case Tt.CONNECT_ERROR:return"string"==typeof e||xt(e);default:return!1}}(t.type,t.data);var e}});function Pt(t,e,n){return t.on(e,n),function(){t.off(e,n)}}var _t=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1}),Ut=function(t){function e(e,n,r){var o;return(o=t.call(this)||this).connected=!1,o.recovered=!1,o.receiveBuffer=[],o.sendBuffer=[],o.it=[],o.rt=0,o.ids=0,o.acks={},o.flags={},o.io=e,o.nsp=n,r&&r.auth&&(o.auth=r.auth),o.l=i({},r),o.io.et&&o.open(),o}s(e,t);var o=e.prototype;return o.subEvents=function(){if(!this.subs){var t=this.io;this.subs=[Pt(t,"open",this.onopen.bind(this)),Pt(t,"packet",this.onpacket.bind(this)),Pt(t,"error",this.onerror.bind(this)),Pt(t,"close",this.onclose.bind(this))]}},o.connect=function(){return this.connected||(this.subEvents(),this.io.ot||this.io.open(),"open"===this.io.st&&this.onopen()),this},o.open=function(){return this.connect()},o.send=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return e.unshift("message"),this.emit.apply(this,e),this},o.emit=function(t){var e,n,r;if(_t.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');for(var i=arguments.length,o=new Array(i>1?i-1:0),s=1;s<i;s++)o[s-1]=arguments[s];if(o.unshift(t),this.l.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this.ut(o),this;var a={type:Tt.EVENT,data:o,options:{}};if(a.options.compress=!1!==this.flags.compress,"function"==typeof o[o.length-1]){var c=this.ids++,u=o.pop();this.ht(c,u),a.id=c}var h=null===(n=null===(e=this.io.engine)||void 0===e?void 0:e.transport)||void 0===n?void 0:n.writable,f=this.connected&&!(null===(r=this.io.engine)||void 0===r?void 0:r.W());return this.flags.volatile&&!h||(f?(this.notifyOutgoingListeners(a),this.packet(a)):this.sendBuffer.push(a)),this.flags={},this},o.ht=function(t,e){var n,r=this,i=null!==(n=this.flags.timeout)&&void 0!==n?n:this.l.ackTimeout;if(void 0!==i){var o=this.io.setTimeoutFn(function(){delete r.acks[t];for(var n=0;n<r.sendBuffer.length;n++)r.sendBuffer[n].id===t&&r.sendBuffer.splice(n,1);e.call(r,new Error("operation has timed out"))},i),s=function(){r.io.clearTimeoutFn(o);for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];e.apply(r,n)};s.withError=!0,this.acks[t]=s}else this.acks[t]=e},o.emitWithAck=function(t){for(var e=this,n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return new Promise(function(n,i){var o=function(t,e){return t?i(t):n(e)};o.withError=!0,r.push(o),e.emit.apply(e,[t].concat(r))})},o.ut=function(t){var e,n=this;"function"==typeof t[t.length-1]&&(e=t.pop());var r={id:this.rt++,tryCount:0,pending:!1,args:t,flags:i({fromQueue:!0},this.flags)};t.push(function(t){if(r===n.it[0]){if(null!==t)r.tryCount>n.l.retries&&(n.it.shift(),e&&e(t));else if(n.it.shift(),e){for(var i=arguments.length,o=new Array(i>1?i-1:0),s=1;s<i;s++)o[s-1]=arguments[s];e.apply(void 0,[null].concat(o))}return r.pending=!1,n.ft()}}),this.it.push(r),this.ft()},o.ft=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.connected&&0!==this.it.length){var e=this.it[0];e.pending&&!t||(e.pending=!0,e.tryCount++,this.flags=e.flags,this.emit.apply(this,e.args))}},o.packet=function(t){t.nsp=this.nsp,this.io.ct(t)},o.onopen=function(){var t=this;"function"==typeof this.auth?this.auth(function(e){t.vt(e)}):this.vt(this.auth)},o.vt=function(t){this.packet({type:Tt.CONNECT,data:this.lt?i({pid:this.lt,offset:this.dt},t):t})},o.onerror=function(t){this.connected||this.emitReserved("connect_error",t)},o.onclose=function(t,e){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,e),this.yt()},o.yt=function(){var t=this;Object.keys(this.acks).forEach(function(e){if(!t.sendBuffer.some(function(t){return String(t.id)===e})){var n=t.acks[e];delete t.acks[e],n.withError&&n.call(t,new Error("socket has been disconnected"))}})},o.onpacket=function(t){if(t.nsp===this.nsp)switch(t.type){case Tt.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case Tt.EVENT:case Tt.BINARY_EVENT:this.onevent(t);break;case Tt.ACK:case Tt.BINARY_ACK:this.onack(t);break;case Tt.DISCONNECT:this.ondisconnect();break;case Tt.CONNECT_ERROR:this.destroy();var e=new Error(t.data.message);e.data=t.data.data,this.emitReserved("connect_error",e)}},o.onevent=function(t){var e=t.data||[];null!=t.id&&e.push(this.ack(t.id)),this.connected?this.emitEvent(e):this.receiveBuffer.push(Object.freeze(e))},o.emitEvent=function(e){if(this.bt&&this.bt.length){var n,i=r(this.bt.slice());try{for(i.s();!(n=i.n()).done;)n.value.apply(this,e)}catch(t){i.e(t)}finally{i.f()}}t.prototype.emit.apply(this,e),this.lt&&e.length&&"string"==typeof e[e.length-1]&&(this.dt=e[e.length-1])},o.ack=function(t){var e=this,n=!1;return function(){if(!n){n=!0;for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];e.packet({type:Tt.ACK,id:t,data:i})}}},o.onack=function(t){var e=this.acks[t.id];"function"==typeof e&&(delete this.acks[t.id],e.withError&&t.data.unshift(null),e.apply(this,t.data))},o.onconnect=function(t,e){this.id=t,this.recovered=e&&this.lt===e,this.lt=e,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this.ft(!0)},o.emitBuffered=function(){var t=this;this.receiveBuffer.forEach(function(e){return t.emitEvent(e)}),this.receiveBuffer=[],this.sendBuffer.forEach(function(e){t.notifyOutgoingListeners(e),t.packet(e)}),this.sendBuffer=[]},o.ondisconnect=function(){this.destroy(),this.onclose("io server disconnect")},o.destroy=function(){this.subs&&(this.subs.forEach(function(t){return t()}),this.subs=void 0),this.io.wt(this)},o.disconnect=function(){return this.connected&&this.packet({type:Tt.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this},o.close=function(){return this.disconnect()},o.compress=function(t){return this.flags.compress=t,this},o.timeout=function(t){return this.flags.timeout=t,this},o.onAny=function(t){return this.bt=this.bt||[],this.bt.push(t),this},o.prependAny=function(t){return this.bt=this.bt||[],this.bt.unshift(t),this},o.offAny=function(t){if(!this.bt)return this;if(t){for(var e=this.bt,n=0;n<e.length;n++)if(t===e[n])return e.splice(n,1),this}else this.bt=[];return this},o.listenersAny=function(){return this.bt||[]},o.onAnyOutgoing=function(t){return this.gt=this.gt||[],this.gt.push(t),this},o.prependAnyOutgoing=function(t){return this.gt=this.gt||[],this.gt.unshift(t),this},o.offAnyOutgoing=function(t){if(!this.gt)return this;if(t){for(var e=this.gt,n=0;n<e.length;n++)if(t===e[n])return e.splice(n,1),this}else this.gt=[];return this},o.listenersAnyOutgoing=function(){return this.gt||[]},o.notifyOutgoingListeners=function(t){if(this.gt&&this.gt.length){var e,n=r(this.gt.slice());try{for(n.s();!(e=n.n()).done;)e.value.apply(this,t.data)}catch(t){n.e(t)}finally{n.f()}}},n(e,[{key:"disconnected",get:function(){return!this.connected}},{key:"active",get:function(){return!!this.subs}},{key:"volatile",get:function(){return this.flags.volatile=!0,this}}])}(P);function Ft(t){t=t||{},this.ms=t.min||100,this.max=t.max||1e4,this.factor=t.factor||2,this.jitter=t.jitter>0&&t.jitter<=1?t.jitter:0,this.attempts=0}Ft.prototype.duration=function(){var t=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),n=Math.floor(e*this.jitter*t);t=1&Math.floor(10*e)?t+n:t-n}return 0|Math.min(t,this.max)},Ft.prototype.reset=function(){this.attempts=0},Ft.prototype.setMin=function(t){this.ms=t},Ft.prototype.setMax=function(t){this.max=t},Ft.prototype.setJitter=function(t){this.jitter=t};var It=function(t){function e(e,n){var r,i;(r=t.call(this)||this).nsps={},r.subs=[],e&&"object"===h(e)&&(n=e,e=void 0),(n=n||{}).path=n.path||"/socket.io",r.opts=n,D(r,n),r.reconnection(!1!==n.reconnection),r.reconnectionAttempts(n.reconnectionAttempts||1/0),r.reconnectionDelay(n.reconnectionDelay||1e3),r.reconnectionDelayMax(n.reconnectionDelayMax||5e3),r.randomizationFactor(null!==(i=n.randomizationFactor)&&void 0!==i?i:.5),r.backoff=new Ft({min:r.reconnectionDelay(),max:r.reconnectionDelayMax(),jitter:r.randomizationFactor()}),r.timeout(null==n.timeout?2e4:n.timeout),r.st="closed",r.uri=e;var o=n.parser||qt;return r.encoder=new o.Encoder,r.decoder=new o.Decoder,r.et=!1!==n.autoConnect,r.et&&r.open(),r}s(e,t);var n=e.prototype;return n.reconnection=function(t){return arguments.length?(this.kt=!!t,t||(this.skipReconnect=!0),this):this.kt},n.reconnectionAttempts=function(t){return void 0===t?this.At:(this.At=t,this)},n.reconnectionDelay=function(t){var e;return void 0===t?this.jt:(this.jt=t,null===(e=this.backoff)||void 0===e||e.setMin(t),this)},n.randomizationFactor=function(t){var e;return void 0===t?this.Et:(this.Et=t,null===(e=this.backoff)||void 0===e||e.setJitter(t),this)},n.reconnectionDelayMax=function(t){var e;return void 0===t?this.Ot:(this.Ot=t,null===(e=this.backoff)||void 0===e||e.setMax(t),this)},n.timeout=function(t){return arguments.length?(this.Bt=t,this):this.Bt},n.maybeReconnectOnOpen=function(){!this.ot&&this.kt&&0===this.backoff.attempts&&this.reconnect()},n.open=function(t){var e=this;if(~this.st.indexOf("open"))return this;this.engine=new dt(this.uri,this.opts);var n=this.engine,r=this;this.st="opening",this.skipReconnect=!1;var i=Pt(n,"open",function(){r.onopen(),t&&t()}),o=function(n){e.cleanup(),e.st="closed",e.emitReserved("error",n),t?t(n):e.maybeReconnectOnOpen()},s=Pt(n,"error",o);if(!1!==this.Bt){var a=this.Bt,c=this.setTimeoutFn(function(){i(),o(new Error("timeout")),n.close()},a);this.opts.autoUnref&&c.unref(),this.subs.push(function(){e.clearTimeoutFn(c)})}return this.subs.push(i),this.subs.push(s),this},n.connect=function(t){return this.open(t)},n.onopen=function(){this.cleanup(),this.st="open",this.emitReserved("open");var t=this.engine;this.subs.push(Pt(t,"ping",this.onping.bind(this)),Pt(t,"data",this.ondata.bind(this)),Pt(t,"error",this.onerror.bind(this)),Pt(t,"close",this.onclose.bind(this)),Pt(this.decoder,"decoded",this.ondecoded.bind(this)))},n.onping=function(){this.emitReserved("ping")},n.ondata=function(t){try{this.decoder.add(t)}catch(t){this.onclose("parse error",t)}},n.ondecoded=function(t){var e=this;_(function(){e.emitReserved("packet",t)},this.setTimeoutFn)},n.onerror=function(t){this.emitReserved("error",t)},n.socket=function(t,e){var n=this.nsps[t];return n?this.et&&!n.active&&n.connect():(n=new Ut(this,t,e),this.nsps[t]=n),n},n.wt=function(t){for(var e=0,n=Object.keys(this.nsps);e<n.length;e++){var r=n[e];if(this.nsps[r].active)return}this.St()},n.ct=function(t){for(var e=this.encoder.encode(t),n=0;n<e.length;n++)this.engine.write(e[n],t.options)},n.cleanup=function(){this.subs.forEach(function(t){return t()}),this.subs.length=0,this.decoder.destroy()},n.St=function(){this.skipReconnect=!0,this.ot=!1,this.onclose("forced close")},n.disconnect=function(){return this.St()},n.onclose=function(t,e){var n;this.cleanup(),null===(n=this.engine)||void 0===n||n.close(),this.backoff.reset(),this.st="closed",this.emitReserved("close",t,e),this.kt&&!this.skipReconnect&&this.reconnect()},n.reconnect=function(){var t=this;if(this.ot||this.skipReconnect)return this;var e=this;if(this.backoff.attempts>=this.At)this.backoff.reset(),this.emitReserved("reconnect_failed"),this.ot=!1;else{var n=this.backoff.duration();this.ot=!0;var r=this.setTimeoutFn(function(){e.skipReconnect||(t.emitReserved("reconnect_attempt",e.backoff.attempts),e.skipReconnect||e.open(function(n){n?(e.ot=!1,e.reconnect(),t.emitReserved("reconnect_error",n)):e.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(function(){t.clearTimeoutFn(r)})}},n.onreconnect=function(){var t=this.backoff.attempts;this.ot=!1,this.backoff.reset(),this.emitReserved("reconnect",t)},e}(P),Lt={};function Dt(t,e){"object"===h(t)&&(e=t,t=void 0);var n,r=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2?arguments[2]:void 0,r=t;n=n||"undefined"!=typeof location&&location,null==t&&(t=n.protocol+"//"+n.host),"string"==typeof t&&("/"===t.charAt(0)&&(t="/"===t.charAt(1)?n.protocol+t:n.host+t),/^(https?|wss?):\/\//.test(t)||(t=void 0!==n?n.protocol+"//"+t:"https://"+t),r=ut(t)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";var i=-1!==r.host.indexOf(":")?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+i+":"+r.port+e,r.href=r.protocol+"://"+i+(n&&n.port===r.port?"":":"+r.port),r}(t,(e=e||{}).path||"/socket.io"),i=r.source,o=r.id,s=r.path,a=Lt[o]&&s in Lt[o].nsps;return e.forceNew||e["force new connection"]||!1===e.multiplex||a?n=new It(i,e):(Lt[o]||(Lt[o]=new It(i,e)),n=Lt[o]),r.query&&!e.query&&(e.query=r.queryKey),n.socket(r.path,e)}return i(Dt,{Manager:It,Socket:Ut,io:Dt,connect:Dt}),Dt});
|