@nethesis/phone-island 0.2.7 → 0.2.8

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.
Files changed (99) hide show
  1. package/README.md +64 -0
  2. package/{App.d.ts → dist/App.d.ts} +0 -0
  3. package/{App.js → dist/App.js} +0 -0
  4. package/{App.js.map → dist/App.js.map} +0 -0
  5. package/{_virtual → dist/_virtual}/_rollupPluginBabelHelpers.js +0 -0
  6. package/{_virtual → dist/_virtual}/_rollupPluginBabelHelpers.js.map +0 -0
  7. package/{_virtual → dist/_virtual}/sdp.js +0 -0
  8. package/{_virtual → dist/_virtual}/sdp.js.map +0 -0
  9. package/{index.css → dist/index.css} +0 -0
  10. package/{index.d.ts → dist/index.d.ts} +0 -0
  11. package/{index.js → dist/index.js} +0 -0
  12. package/{index.js.map → dist/index.js.map} +0 -0
  13. package/{lib → dist/lib}/janus.js +0 -0
  14. package/{lib → dist/lib}/janus.js.map +0 -0
  15. package/dist/node_modules/@socket.io/component-emitter/index.mjs.js +2 -0
  16. package/dist/node_modules/@socket.io/component-emitter/index.mjs.js.map +1 -0
  17. package/dist/node_modules/engine.io-client/build/esm/contrib/has-cors.js +2 -0
  18. package/dist/node_modules/engine.io-client/build/esm/contrib/has-cors.js.map +1 -0
  19. package/dist/node_modules/engine.io-client/build/esm/contrib/parseqs.js +2 -0
  20. package/dist/node_modules/engine.io-client/build/esm/contrib/parseqs.js.map +1 -0
  21. package/dist/node_modules/engine.io-client/build/esm/contrib/parseuri.js +2 -0
  22. package/dist/node_modules/engine.io-client/build/esm/contrib/parseuri.js.map +1 -0
  23. package/dist/node_modules/engine.io-client/build/esm/contrib/yeast.js +2 -0
  24. package/dist/node_modules/engine.io-client/build/esm/contrib/yeast.js.map +1 -0
  25. package/dist/node_modules/engine.io-client/build/esm/globalThis.browser.js +2 -0
  26. package/dist/node_modules/engine.io-client/build/esm/globalThis.browser.js.map +1 -0
  27. package/dist/node_modules/engine.io-client/build/esm/index.js +2 -0
  28. package/dist/node_modules/engine.io-client/build/esm/index.js.map +1 -0
  29. package/dist/node_modules/engine.io-client/build/esm/socket.js +2 -0
  30. package/dist/node_modules/engine.io-client/build/esm/socket.js.map +1 -0
  31. package/dist/node_modules/engine.io-client/build/esm/transport.js +2 -0
  32. package/dist/node_modules/engine.io-client/build/esm/transport.js.map +1 -0
  33. package/dist/node_modules/engine.io-client/build/esm/transports/index.js +2 -0
  34. package/dist/node_modules/engine.io-client/build/esm/transports/index.js.map +1 -0
  35. package/dist/node_modules/engine.io-client/build/esm/transports/polling.js +2 -0
  36. package/dist/node_modules/engine.io-client/build/esm/transports/polling.js.map +1 -0
  37. package/dist/node_modules/engine.io-client/build/esm/transports/websocket-constructor.browser.js +2 -0
  38. package/dist/node_modules/engine.io-client/build/esm/transports/websocket-constructor.browser.js.map +1 -0
  39. package/dist/node_modules/engine.io-client/build/esm/transports/websocket.js +2 -0
  40. package/dist/node_modules/engine.io-client/build/esm/transports/websocket.js.map +1 -0
  41. package/dist/node_modules/engine.io-client/build/esm/transports/xmlhttprequest.browser.js +2 -0
  42. package/dist/node_modules/engine.io-client/build/esm/transports/xmlhttprequest.browser.js.map +1 -0
  43. package/dist/node_modules/engine.io-client/build/esm/util.js +2 -0
  44. package/dist/node_modules/engine.io-client/build/esm/util.js.map +1 -0
  45. package/dist/node_modules/engine.io-parser/build/esm/commons.js +2 -0
  46. package/dist/node_modules/engine.io-parser/build/esm/commons.js.map +1 -0
  47. package/dist/node_modules/engine.io-parser/build/esm/contrib/base64-arraybuffer.js +2 -0
  48. package/dist/node_modules/engine.io-parser/build/esm/contrib/base64-arraybuffer.js.map +1 -0
  49. package/dist/node_modules/engine.io-parser/build/esm/decodePacket.browser.js +2 -0
  50. package/dist/node_modules/engine.io-parser/build/esm/decodePacket.browser.js.map +1 -0
  51. package/dist/node_modules/engine.io-parser/build/esm/encodePacket.browser.js +2 -0
  52. package/dist/node_modules/engine.io-parser/build/esm/encodePacket.browser.js.map +1 -0
  53. package/dist/node_modules/engine.io-parser/build/esm/index.js +2 -0
  54. package/dist/node_modules/engine.io-parser/build/esm/index.js.map +1 -0
  55. package/dist/node_modules/sdp/sdp.js +2 -0
  56. package/dist/node_modules/sdp/sdp.js.map +1 -0
  57. package/dist/node_modules/socket.io-client/build/esm/contrib/backo2.js +2 -0
  58. package/dist/node_modules/socket.io-client/build/esm/contrib/backo2.js.map +1 -0
  59. package/dist/node_modules/socket.io-client/build/esm/index.js +2 -0
  60. package/dist/node_modules/socket.io-client/build/esm/index.js.map +1 -0
  61. package/dist/node_modules/socket.io-client/build/esm/manager.js +2 -0
  62. package/dist/node_modules/socket.io-client/build/esm/manager.js.map +1 -0
  63. package/dist/node_modules/socket.io-client/build/esm/on.js +2 -0
  64. package/dist/node_modules/socket.io-client/build/esm/on.js.map +1 -0
  65. package/dist/node_modules/socket.io-client/build/esm/socket.js +2 -0
  66. package/dist/node_modules/socket.io-client/build/esm/socket.js.map +1 -0
  67. package/dist/node_modules/socket.io-client/build/esm/url.js +2 -0
  68. package/dist/node_modules/socket.io-client/build/esm/url.js.map +1 -0
  69. package/dist/node_modules/socket.io-parser/build/esm/binary.js +2 -0
  70. package/dist/node_modules/socket.io-parser/build/esm/binary.js.map +1 -0
  71. package/dist/node_modules/socket.io-parser/build/esm/index.js +2 -0
  72. package/dist/node_modules/socket.io-parser/build/esm/index.js.map +1 -0
  73. package/dist/node_modules/socket.io-parser/build/esm/is-binary.js +2 -0
  74. package/dist/node_modules/socket.io-parser/build/esm/is-binary.js.map +1 -0
  75. package/dist/node_modules/tslib/tslib.es6.js +2 -0
  76. package/dist/node_modules/tslib/tslib.es6.js.map +1 -0
  77. package/dist/node_modules/webrtc-adapter/src/js/adapter_core.js +2 -0
  78. package/dist/node_modules/webrtc-adapter/src/js/adapter_core.js.map +1 -0
  79. package/dist/node_modules/webrtc-adapter/src/js/adapter_factory.js +2 -0
  80. package/dist/node_modules/webrtc-adapter/src/js/adapter_factory.js.map +1 -0
  81. package/dist/node_modules/webrtc-adapter/src/js/chrome/chrome_shim.js +2 -0
  82. package/dist/node_modules/webrtc-adapter/src/js/chrome/chrome_shim.js.map +1 -0
  83. package/dist/node_modules/webrtc-adapter/src/js/chrome/getdisplaymedia.js +2 -0
  84. package/dist/node_modules/webrtc-adapter/src/js/chrome/getdisplaymedia.js.map +1 -0
  85. package/dist/node_modules/webrtc-adapter/src/js/chrome/getusermedia.js +2 -0
  86. package/dist/node_modules/webrtc-adapter/src/js/chrome/getusermedia.js.map +1 -0
  87. package/dist/node_modules/webrtc-adapter/src/js/common_shim.js +2 -0
  88. package/dist/node_modules/webrtc-adapter/src/js/common_shim.js.map +1 -0
  89. package/dist/node_modules/webrtc-adapter/src/js/firefox/firefox_shim.js +2 -0
  90. package/dist/node_modules/webrtc-adapter/src/js/firefox/firefox_shim.js.map +1 -0
  91. package/dist/node_modules/webrtc-adapter/src/js/firefox/getdisplaymedia.js +2 -0
  92. package/dist/node_modules/webrtc-adapter/src/js/firefox/getdisplaymedia.js.map +1 -0
  93. package/dist/node_modules/webrtc-adapter/src/js/firefox/getusermedia.js +2 -0
  94. package/dist/node_modules/webrtc-adapter/src/js/firefox/getusermedia.js.map +1 -0
  95. package/dist/node_modules/webrtc-adapter/src/js/safari/safari_shim.js +2 -0
  96. package/dist/node_modules/webrtc-adapter/src/js/safari/safari_shim.js.map +1 -0
  97. package/dist/node_modules/webrtc-adapter/src/js/utils.js +2 -0
  98. package/dist/node_modules/webrtc-adapter/src/js/utils.js.map +1 -0
  99. package/package.json +79 -7
package/README.md ADDED
@@ -0,0 +1,64 @@
1
+ # Scaffolding
2
+
3
+ - **widget-build** - contains the build of the widget version
4
+ - **widget-example** - contains the usage example of the built widget
5
+ - **dist** - contains the component lib build
6
+ - **src/index.ts** - is the entry point for the component lib and exports the React component
7
+ - **src/index.widget.tsx** - is the entry point for the widget that is built as a single js and css file
8
+
9
+ # Development
10
+
11
+ Install deps
12
+ ```
13
+ npm install
14
+ ```
15
+
16
+ Run Storybook
17
+ ```
18
+ npm run dev
19
+ ```
20
+ The main component can be developed using Storybook. Inside the story is rendered the component exported by the final component library.
21
+
22
+ Tailwind CSS is enable by default.
23
+
24
+ # Import locally
25
+
26
+ Run build and start watch
27
+
28
+ ```
29
+ npm run watch
30
+ ```
31
+
32
+ Go to the project directory
33
+
34
+ ```
35
+ cd <local-project>
36
+ ```
37
+
38
+ Link the ```./dist``` directory
39
+
40
+ ```
41
+ npm link <path-to-phone-island/dist>
42
+ ```
43
+
44
+ # Build
45
+
46
+ Build component library
47
+
48
+ ```
49
+ npm run build
50
+ ```
51
+ Build widget
52
+ ```
53
+ npm run build:widget
54
+ ```
55
+ Serve the widget
56
+ ```
57
+ npm run serve:widget
58
+ ```
59
+
60
+ As you can see the app/component can be built in two ways.
61
+
62
+ - The component library built with Rollup
63
+ - The widget files built with Parcel
64
+
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -0,0 +1,2 @@
1
+ "use strict";function t(e){if(e)return function(e){for(var r in t.prototype)e[r]=t.prototype[r];return e}(e)}Object.defineProperty(exports,"__esModule",{value:!0}),t.prototype.on=t.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this},t.prototype.once=function(t,e){function r(){this.off(t,r),e.apply(this,arguments)}return r.fn=e,this.on(t,r),this},t.prototype.off=t.prototype.removeListener=t.prototype.removeAllListeners=t.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var r,s=this._callbacks["$"+t];if(!s)return this;if(1==arguments.length)return delete this._callbacks["$"+t],this;for(var i=0;i<s.length;i++)if((r=s[i])===e||r.fn===e){s.splice(i,1);break}return 0===s.length&&delete this._callbacks["$"+t],this},t.prototype.emit=function(t){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),r=this._callbacks["$"+t],s=1;s<arguments.length;s++)e[s-1]=arguments[s];if(r){s=0;for(var i=(r=r.slice(0)).length;s<i;++s)r[s].apply(this,e)}return this},t.prototype.emitReserved=t.prototype.emit,t.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks["$"+t]||[]},t.prototype.hasListeners=function(t){return!!this.listeners(t).length},exports.Emitter=t;
2
+ //# sourceMappingURL=index.mjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs.js","sources":["../../../../node_modules/@socket.io/component-emitter/index.mjs"],"sourcesContent":["/**\n * Initialize a new `Emitter`.\n *\n * @api public\n */\n\nexport function Emitter(obj) {\n if (obj) return mixin(obj);\n}\n\n/**\n * Mixin the emitter properties.\n *\n * @param {Object} obj\n * @return {Object}\n * @api private\n */\n\nfunction mixin(obj) {\n for (var key in Emitter.prototype) {\n obj[key] = Emitter.prototype[key];\n }\n return obj;\n}\n\n/**\n * Listen on the given `event` with `fn`.\n *\n * @param {String} event\n * @param {Function} fn\n * @return {Emitter}\n * @api public\n */\n\nEmitter.prototype.on =\nEmitter.prototype.addEventListener = function(event, fn){\n this._callbacks = this._callbacks || {};\n (this._callbacks['$' + event] = this._callbacks['$' + event] || [])\n .push(fn);\n return this;\n};\n\n/**\n * Adds an `event` listener that will be invoked a single\n * time then automatically removed.\n *\n * @param {String} event\n * @param {Function} fn\n * @return {Emitter}\n * @api public\n */\n\nEmitter.prototype.once = function(event, fn){\n function on() {\n this.off(event, on);\n fn.apply(this, arguments);\n }\n\n on.fn = fn;\n this.on(event, on);\n return this;\n};\n\n/**\n * Remove the given callback for `event` or all\n * registered callbacks.\n *\n * @param {String} event\n * @param {Function} fn\n * @return {Emitter}\n * @api public\n */\n\nEmitter.prototype.off =\nEmitter.prototype.removeListener =\nEmitter.prototype.removeAllListeners =\nEmitter.prototype.removeEventListener = function(event, fn){\n this._callbacks = this._callbacks || {};\n\n // all\n if (0 == arguments.length) {\n this._callbacks = {};\n return this;\n }\n\n // specific event\n var callbacks = this._callbacks['$' + event];\n if (!callbacks) return this;\n\n // remove all handlers\n if (1 == arguments.length) {\n delete this._callbacks['$' + event];\n return this;\n }\n\n // remove specific handler\n var cb;\n for (var i = 0; i < callbacks.length; i++) {\n cb = callbacks[i];\n if (cb === fn || cb.fn === fn) {\n callbacks.splice(i, 1);\n break;\n }\n }\n\n // Remove event specific arrays for event types that no\n // one is subscribed for to avoid memory leak.\n if (callbacks.length === 0) {\n delete this._callbacks['$' + event];\n }\n\n return this;\n};\n\n/**\n * Emit `event` with the given args.\n *\n * @param {String} event\n * @param {Mixed} ...\n * @return {Emitter}\n */\n\nEmitter.prototype.emit = function(event){\n this._callbacks = this._callbacks || {};\n\n var args = new Array(arguments.length - 1)\n , callbacks = this._callbacks['$' + event];\n\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n\n if (callbacks) {\n callbacks = callbacks.slice(0);\n for (var i = 0, len = callbacks.length; i < len; ++i) {\n callbacks[i].apply(this, args);\n }\n }\n\n return this;\n};\n\n// alias used for reserved events (protected method)\nEmitter.prototype.emitReserved = Emitter.prototype.emit;\n\n/**\n * Return array of callbacks for `event`.\n *\n * @param {String} event\n * @return {Array}\n * @api public\n */\n\nEmitter.prototype.listeners = function(event){\n this._callbacks = this._callbacks || {};\n return this._callbacks['$' + event] || [];\n};\n\n/**\n * Check if this emitter has `event` handlers.\n *\n * @param {String} event\n * @return {Boolean}\n * @api public\n */\n\nEmitter.prototype.hasListeners = function(event){\n return !! this.listeners(event).length;\n};\n"],"names":["Emitter","obj","key","prototype","mixin","on","addEventListener","event","fn","this","_callbacks","push","once","off","apply","arguments","removeListener","removeAllListeners","removeEventListener","length","cb","callbacks","i","splice","emit","args","Array","len","slice","emitReserved","listeners","hasListeners"],"mappings":"aAMO,SAASA,EAAQC,GACtB,GAAIA,EAAK,OAWX,SAAeA,GACb,IAAK,IAAIC,KAAOF,EAAQG,UACtBF,EAAIC,GAAOF,EAAQG,UAAUD,GAE/B,OAAOD,CACT,CAhBkBG,CAAMH,EACxB,wDA0BAD,EA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Ab,IAAK,IAAWK,GADhBN,EAAYA,EAAUO,MAAM,IACIT,OAAQG,EAAIK,IAAOL,EACjDD,EAAUC,GAAGR,MAAML,KAAMgB,EADKN,CAKlC,OAAOV,IACT,EAGAT,EAAQG,UAAU0B,aAAe7B,EAAQG,UAAUqB,KAUnDxB,EAAQG,UAAU2B,UAAY,SAASvB,GAErC,OADAE,KAAKC,WAAaD,KAAKC,YAAc,CAAA,EAC9BD,KAAKC,WAAW,IAAMH,IAAU,EACzC,EAUAP,EAAQG,UAAU4B,aAAe,SAASxB,GACxC,QAAUE,KAAKqB,UAAUvB,GAAOY,MAClC"}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=!1;try{e="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}catch(e){}var t=e;exports.hasCORS=t;
2
+ //# sourceMappingURL=has-cors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"has-cors.js","sources":["../../../../../../node_modules/engine.io-client/build/esm/contrib/has-cors.js"],"sourcesContent":["// imported from https://github.com/component/has-cors\nlet value = false;\ntry {\n value = typeof XMLHttpRequest !== 'undefined' &&\n 'withCredentials' in new XMLHttpRequest();\n}\ncatch (err) {\n // if XMLHttp support is disabled in IE then it will throw\n // when trying to create\n}\nexport const hasCORS = value;\n"],"names":["value","XMLHttpRequest","err","hasCORS"],"mappings":"oEACA,IAAIA,GAAQ,EACZ,IACIA,EAAkC,oBAAnBC,gBACX,oBAAqB,IAAIA,cAI7B,CAFJ,MAAOC,GAEH,CAEG,IAAMC,EAAUH"}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.decode=function(e){for(var o={},n=e.split("&"),t=0,r=n.length;t<r;t++){var d=n[t].split("=");o[decodeURIComponent(d[0])]=decodeURIComponent(d[1])}return o},exports.encode=function(e){var o="";for(var n in e)e.hasOwnProperty(n)&&(o.length&&(o+="&"),o+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return o};
2
+ //# sourceMappingURL=parseqs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parseqs.js","sources":["../../../../../../node_modules/engine.io-client/build/esm/contrib/parseqs.js"],"sourcesContent":["// imported from https://github.com/galkn/querystring\n/**\n * Compiles a querystring\n * Returns string representation of the object\n *\n * @param {Object}\n * @api private\n */\nexport function encode(obj) {\n let str = '';\n for (let i in obj) {\n if (obj.hasOwnProperty(i)) {\n if (str.length)\n str += '&';\n str += encodeURIComponent(i) + '=' + encodeURIComponent(obj[i]);\n }\n }\n return str;\n}\n/**\n * Parses a simple querystring into an object\n *\n * @param {String} qs\n * @api private\n */\nexport function decode(qs) {\n let qry = {};\n let pairs = qs.split('&');\n for (let i = 0, l = pairs.length; i < l; i++) {\n let pair = pairs[i].split('=');\n qry[decodeURIComponent(pair[0])] = decodeURIComponent(pair[1]);\n }\n return qry;\n}\n"],"names":["qs","qry","pairs","split","i","l","length","pair","decodeURIComponent","obj","str","hasOwnProperty","encodeURIComponent"],"mappings":"mFAyBO,SAAgBA,GAGnB,IAFA,IAAIC,EAAM,CAAA,EACNC,EAAQF,EAAGG,MAAM,KACZC,EAAI,EAAGC,EAAIH,EAAMI,OAAQF,EAAIC,EAAGD,IAAK,CAC1C,IAAIG,EAAOL,EAAME,GAAGD,MAAM,KAC1BF,EAAIO,mBAAmBD,EAAK,KAAOC,mBAAmBD,EAAK,GAC/D,CACA,OAAON,CACX,iBAzBO,SAAgBQ,GACnB,IAAIC,EAAM,GACV,IAAK,IAAIN,KAAKK,EACNA,EAAIE,eAAeP,KACfM,EAAIJ,SACJI,GAAO,KACXA,GAAOE,mBAAmBR,GAAK,IAAMQ,mBAAmBH,EAAIL,KAGpE,OAAOM,CACX"}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,r=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];exports.parse=function(t){var s=t,a=t.indexOf("["),o=t.indexOf("]");-1!=a&&-1!=o&&(t=t.substring(0,a)+t.substring(a,o).replace(/:/g,";")+t.substring(o,t.length));for(var i,p,u=e.exec(t||""),c={},l=14;l--;)c[r[l]]=u[l]||"";return-1!=a&&-1!=o&&(c.source=s,c.host=c.host.substring(1,c.host.length-1).replace(/;/g,":"),c.authority=c.authority.replace("[","").replace("]","").replace(/;/g,":"),c.ipv6uri=!0),c.pathNames=function(e,r){var t=/\/{2,9}/g,s=r.replace(t,"/").split("/");"/"!=r.slice(0,1)&&0!==r.length||s.splice(0,1);"/"==r.slice(-1)&&s.splice(s.length-1,1);return s}(0,c.path),c.queryKey=(i=c.query,p={},i.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,(function(e,r,t){r&&(p[r]=t)})),p),c};
2
+ //# sourceMappingURL=parseuri.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parseuri.js","sources":["../../../../../../node_modules/engine.io-client/build/esm/contrib/parseuri.js"],"sourcesContent":["// imported from https://github.com/galkn/parseuri\n/**\n * Parses an URI\n *\n * @author Steven Levithan <stevenlevithan.com> (MIT license)\n * @api private\n */\nconst re = /^(?:(?![^:@]+:[^:@\\/]*@)(http|https|ws|wss):\\/\\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\\/?#]*)(?::(\\d*))?)(((\\/(?:[^?#](?![^?#\\/]*\\.[^?#\\/.]+(?:[?#]|$)))*\\/?)?([^?#\\/]*))(?:\\?([^#]*))?(?:#(.*))?)/;\nconst parts = [\n 'source', 'protocol', 'authority', 'userInfo', 'user', 'password', 'host', 'port', 'relative', 'path', 'directory', 'file', 'query', 'anchor'\n];\nexport function parse(str) {\n const src = str, b = str.indexOf('['), e = str.indexOf(']');\n if (b != -1 && e != -1) {\n str = str.substring(0, b) + str.substring(b, e).replace(/:/g, ';') + str.substring(e, str.length);\n }\n let m = re.exec(str || ''), uri = {}, i = 14;\n while (i--) {\n uri[parts[i]] = m[i] || '';\n }\n if (b != -1 && e != -1) {\n uri.source = src;\n uri.host = uri.host.substring(1, uri.host.length - 1).replace(/;/g, ':');\n uri.authority = uri.authority.replace('[', '').replace(']', '').replace(/;/g, ':');\n uri.ipv6uri = true;\n }\n uri.pathNames = pathNames(uri, uri['path']);\n uri.queryKey = queryKey(uri, uri['query']);\n return uri;\n}\nfunction pathNames(obj, path) {\n const regx = /\\/{2,9}/g, names = path.replace(regx, \"/\").split(\"/\");\n if (path.slice(0, 1) == '/' || path.length === 0) {\n names.splice(0, 1);\n }\n if (path.slice(-1) == '/') {\n names.splice(names.length - 1, 1);\n }\n return names;\n}\nfunction queryKey(uri, query) {\n const data = {};\n query.replace(/(?:^|&)([^&=]*)=?([^&]*)/g, function ($0, $1, $2) {\n if ($1) {\n data[$1] = $2;\n }\n });\n return data;\n}\n"],"names":["re","parts","str","src","b","indexOf","e","substring","replace","length","query","data","m","exec","uri","i","source","host","authority","ipv6uri","pathNames","obj","path","regx","names","split","slice","splice","queryKey","$0","$1","$2"],"mappings":"oEAOA,IAAMA,EAAK,0OACLC,EAAQ,CACV,SAAU,WAAY,YAAa,WAAY,OAAQ,WAAY,OAAQ,OAAQ,WAAY,OAAQ,YAAa,OAAQ,QAAS,wBAElI,SAAeC,GAClB,IAAMC,EAAMD,EAAKE,EAAIF,EAAIG,QAAQ,KAAMC,EAAIJ,EAAIG,QAAQ,MAC7C,GAAND,IAAiB,GAANE,IACXJ,EAAMA,EAAIK,UAAU,EAAGH,GAAKF,EAAIK,UAAUH,EAAGE,GAAGE,QAAQ,KAAM,KAAON,EAAIK,UAAUD,EAAGJ,EAAIO,SAG9F,IADA,IAwBmBC,EACbC,EAzBFC,EAAIZ,EAAGa,KAAKX,GAAO,IAAKY,EAAM,CAAE,EAAEC,EAAI,GACnCA,KACHD,EAAIb,EAAMc,IAAMH,EAAEG,IAAM,GAU5B,OARU,GAANX,IAAiB,GAANE,IACXQ,EAAIE,OAASb,EACbW,EAAIG,KAAOH,EAAIG,KAAKV,UAAU,EAAGO,EAAIG,KAAKR,OAAS,GAAGD,QAAQ,KAAM,KACpEM,EAAII,UAAYJ,EAAII,UAAUV,QAAQ,IAAK,IAAIA,QAAQ,IAAK,IAAIA,QAAQ,KAAM,KAC9EM,EAAIK,SAAU,GAElBL,EAAIM,UAIR,SAAmBC,EAAKC,GACpB,IAAMC,EAAO,WAAYC,EAAQF,EAAKd,QAAQe,EAAM,KAAKE,MAAM,KACvC,KAApBH,EAAKI,MAAM,EAAG,IAA6B,IAAhBJ,EAAKb,QAChCe,EAAMG,OAAO,EAAG,GAEE,KAAlBL,EAAKI,OAAO,IACZF,EAAMG,OAAOH,EAAMf,OAAS,EAAG,GAEnC,OAAOe,CACX,CAboBJ,CAAUN,EAAKA,EAAU,MACzCA,EAAIc,UAaelB,EAbUI,EAAW,MAclCH,EAAO,CAAA,EACbD,EAAMF,QAAQ,6BAA6B,SAAUqB,EAAIC,EAAIC,GACrDD,IACAnB,EAAKmB,GAAMC,EAEnB,IACOpB,GAnBAG,CACX"}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,r="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),t={},o=0,n=0;function s(e){var t="";do{t=r[e%64]+t,e=Math.floor(e/64)}while(e>0);return t}for(;n<64;n++)t[r[n]]=n;exports.encode=s,exports.yeast=function(){var r=s(+new Date);return r!==e?(o=0,e=r):r+"."+s(o++)};
2
+ //# sourceMappingURL=yeast.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"yeast.js","sources":["../../../../../../node_modules/engine.io-client/build/esm/contrib/yeast.js"],"sourcesContent":["// imported from https://github.com/unshiftio/yeast\n'use strict';\nconst alphabet = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_'.split(''), length = 64, map = {};\nlet seed = 0, i = 0, prev;\n/**\n * Return a string representing the specified number.\n *\n * @param {Number} num The number to convert.\n * @returns {String} The string representation of the number.\n * @api public\n */\nexport function encode(num) {\n let encoded = '';\n do {\n encoded = alphabet[num % length] + encoded;\n num = Math.floor(num / length);\n } while (num > 0);\n return encoded;\n}\n/**\n * Return the integer value specified by the given string.\n *\n * @param {String} str The string to convert.\n * @returns {Number} The integer value represented by the string.\n * @api public\n */\nexport function decode(str) {\n let decoded = 0;\n for (i = 0; i < str.length; i++) {\n decoded = decoded * length + map[str.charAt(i)];\n }\n return decoded;\n}\n/**\n * Yeast: A tiny growing id generator.\n *\n * @returns {String} A unique id.\n * @api public\n */\nexport function yeast() {\n const now = encode(+new Date());\n if (now !== prev)\n return seed = 0, prev = now;\n return now + '.' + encode(seed++);\n}\n//\n// Map each character to its index.\n//\nfor (; i < length; i++)\n map[alphabet[i]] = i;\n"],"names":["prev","alphabet","split","map","seed","i","encode","num","encoded","Math","floor","now","Date"],"mappings":"oEAEA,IACqBA,EADfC,EAAW,mEAAmEC,MAAM,IAAkBC,EAAM,CAAA,EAC9GC,EAAO,EAAGC,EAAI,EAQX,SAASC,EAAOC,GACnB,IAAIC,EAAU,GACd,GACIA,EAAUP,EAASM,EAZ6E,IAY7DC,EACnCD,EAAME,KAAKC,MAAMH,EAb+E,UAc3FA,EAAM,GACf,OAAOC,CACX,CA8BA,KAAOH,EA9CiG,GA8CrFA,IACfF,EAAIF,EAASI,IAAMA,iCAVhB,WACH,IAAMM,EAAML,GAAQ,IAAIM,MACxB,OAAID,IAAQX,GACDI,EAAO,EAAGJ,EAAOW,GACrBA,EAAM,IAAML,EAAOF,IAC9B"}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e="undefined"!=typeof self?self:"undefined"!=typeof window?window:Function("return this")();exports.globalThisShim=e;
2
+ //# sourceMappingURL=globalThis.browser.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"globalThis.browser.js","sources":["../../../../../node_modules/engine.io-client/build/esm/globalThis.browser.js"],"sourcesContent":["export const globalThisShim = (() => {\n if (typeof self !== \"undefined\") {\n return self;\n }\n else if (typeof window !== \"undefined\") {\n return window;\n }\n else {\n return Function(\"return this\")();\n }\n})();\n"],"names":["globalThisShim","self","window","Function"],"mappings":"oEAAO,IAAMA,EACW,oBAATC,KACAA,KAEgB,oBAAXC,OACLA,OAGAC,SAAS,cAATA"}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./socket.js");require("../../../engine.io-parser/build/esm/encodePacket.browser.js"),require("../../../engine.io-parser/build/esm/commons.js"),require("../../../engine.io-parser/build/esm/contrib/base64-arraybuffer.js"),require("../../../@socket.io/component-emitter/index.mjs.js"),require("./globalThis.browser.js"),require("./transports/polling.js"),require("./transports/websocket.js");var r=require("./transports/websocket-constructor.browser.js");e.Socket.protocol,exports.Socket=e.Socket,exports.nextTick=r.nextTick;
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../../../node_modules/engine.io-client/build/esm/index.js"],"sourcesContent":["import { Socket } from \"./socket.js\";\nexport { Socket };\nexport const protocol = Socket.protocol;\nexport { Transport } from \"./transport.js\";\nexport { transports } from \"./transports/index.js\";\nexport { installTimerFunctions } from \"./util.js\";\nexport { parse } from \"./contrib/parseuri.js\";\nexport { nextTick } from \"./transports/websocket-constructor.js\";\n"],"names":["Socket","protocol"],"mappings":"uhBAEwBA,EAAAA,OAAOC"}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../../_virtual/_rollupPluginBabelHelpers.js"),t=require("./transports/index.js"),r=require("./util.js"),s=require("./contrib/parseqs.js"),i=require("./contrib/parseuri.js"),n=require("../../../@socket.io/component-emitter/index.mjs.js"),o=require("../../../engine.io-parser/build/esm/index.js"),a=function(n){e.inherits(u,n);var a=e.createSuper(u);function u(t){var n,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.classCallCheck(this,u),n=a.call(this),t&&"object"===e.typeof(t)&&(o=t,t=null),t?(t=i.parse(t),o.hostname=t.host,o.secure="https"===t.protocol||"wss"===t.protocol,o.port=t.port,t.query&&(o.query=t.query)):o.host&&(o.hostname=i.parse(o.host).host),r.installTimerFunctions(e.assertThisInitialized(n),o),n.secure=null!=o.secure?o.secure:"undefined"!=typeof location&&"https:"===location.protocol,o.hostname&&!o.port&&(o.port=n.secure?"443":"80"),n.hostname=o.hostname||("undefined"!=typeof location?location.hostname:"localhost"),n.port=o.port||("undefined"!=typeof location&&location.port?location.port:n.secure?"443":"80"),n.transports=o.transports||["polling","websocket"],n.readyState="",n.writeBuffer=[],n.prevBufferLen=0,n.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!0},o),n.opts.path=n.opts.path.replace(/\/$/,"")+"/","string"==typeof n.opts.query&&(n.opts.query=s.decode(n.opts.query)),n.id=null,n.upgrades=null,n.pingInterval=null,n.pingTimeout=null,n.pingTimeoutTimer=null,"function"==typeof addEventListener&&(n.opts.closeOnBeforeunload&&(n.beforeunloadEventListener=function(){n.transport&&(n.transport.removeAllListeners(),n.transport.close())},addEventListener("beforeunload",n.beforeunloadEventListener,!1)),"localhost"!==n.hostname&&(n.offlineEventListener=function(){n.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",n.offlineEventListener,!1))),n.open(),n}return e.createClass(u,[{key:"createTransport",value:function(e){var r=Object.assign({},this.opts.query);r.EIO=o.protocol,r.transport=e,this.id&&(r.sid=this.id);var s=Object.assign({},this.opts.transportOptions[e],this.opts,{query:r,socket:this,hostname:this.hostname,secure:this.secure,port:this.port});return new t.transports[e](s)}},{key:"open",value:function(){var e,t=this;if(this.opts.rememberUpgrade&&u.priorWebsocketSuccess&&-1!==this.transports.indexOf("websocket"))e="websocket";else{if(0===this.transports.length)return void this.setTimeoutFn((function(){t.emitReserved("error","No transports available")}),0);e=this.transports[0]}this.readyState="opening";try{e=this.createTransport(e)}catch(e){return this.transports.shift(),void this.open()}e.open(),this.setTransport(e)}},{key:"setTransport",value:function(e){var t=this;this.transport&&this.transport.removeAllListeners(),this.transport=e,e.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",(function(e){return t.onClose("transport close",e)}))}},{key:"probe",value:function(e){var t=this,r=this.createTransport(e),s=!1;u.priorWebsocketSuccess=!1;var i=function(){s||(r.send([{type:"ping",data:"probe"}]),r.once("packet",(function(e){if(!s)if("pong"===e.type&&"probe"===e.data){if(t.upgrading=!0,t.emitReserved("upgrading",r),!r)return;u.priorWebsocketSuccess="websocket"===r.name,t.transport.pause((function(){s||"closed"!==t.readyState&&(c(),t.setTransport(r),r.send([{type:"upgrade"}]),t.emitReserved("upgrade",r),r=null,t.upgrading=!1,t.flush())}))}else{var i=new Error("probe error");i.transport=r.name,t.emitReserved("upgradeError",i)}})))};function n(){s||(s=!0,c(),r.close(),r=null)}var o=function(e){var s=new Error("probe error: "+e);s.transport=r.name,n(),t.emitReserved("upgradeError",s)};function a(){o("transport closed")}function p(){o("socket closed")}function h(e){r&&e.name!==r.name&&n()}var c=function(){r.removeListener("open",i),r.removeListener("error",o),r.removeListener("close",a),t.off("close",p),t.off("upgrading",h)};r.once("open",i),r.once("error",o),r.once("close",a),this.once("close",p),this.once("upgrading",h),r.open()}},{key:"onOpen",value:function(){if(this.readyState="open",u.priorWebsocketSuccess="websocket"===this.transport.name,this.emitReserved("open"),this.flush(),"open"===this.readyState&&this.opts.upgrade&&this.transport.pause)for(var e=0,t=this.upgrades.length;e<t;e++)this.probe(this.upgrades[e])}},{key:"onPacket",value:function(e){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState)switch(this.emitReserved("packet",e),this.emitReserved("heartbeat"),e.type){case"open":this.onHandshake(JSON.parse(e.data));break;case"ping":this.resetPingTimeout(),this.sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong");break;case"error":var t=new Error("server error");t.code=e.data,this.onError(t);break;case"message":this.emitReserved("data",e.data),this.emitReserved("message",e.data)}}},{key:"onHandshake",value:function(e){this.emitReserved("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this.upgrades=this.filterUpgrades(e.upgrades),this.pingInterval=e.pingInterval,this.pingTimeout=e.pingTimeout,this.maxPayload=e.maxPayload,this.onOpen(),"closed"!==this.readyState&&this.resetPingTimeout()}},{key:"resetPingTimeout",value:function(){var e=this;this.clearTimeoutFn(this.pingTimeoutTimer),this.pingTimeoutTimer=this.setTimeoutFn((function(){e.onClose("ping timeout")}),this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}},{key:"onDrain",value:function(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,0===this.writeBuffer.length?this.emitReserved("drain"):this.flush()}},{key:"flush",value:function(){if("closed"!==this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){var e=this.getWritablePackets();this.transport.send(e),this.prevBufferLen=e.length,this.emitReserved("flush")}}},{key:"getWritablePackets",value:function(){if(!(this.maxPayload&&"polling"===this.transport.name&&this.writeBuffer.length>1))return this.writeBuffer;for(var e=1,t=0;t<this.writeBuffer.length;t++){var s=this.writeBuffer[t].data;if(s&&(e+=r.byteLength(s)),t>0&&e>this.maxPayload)return this.writeBuffer.slice(0,t);e+=2}return this.writeBuffer}},{key:"write",value:function(e,t,r){return this.sendPacket("message",e,t,r),this}},{key:"send",value:function(e,t,r){return this.sendPacket("message",e,t,r),this}},{key:"sendPacket",value:function(e,t,r,s){if("function"==typeof t&&(s=t,t=void 0),"function"==typeof r&&(s=r,r=null),"closing"!==this.readyState&&"closed"!==this.readyState){(r=r||{}).compress=!1!==r.compress;var i={type:e,data:t,options:r};this.emitReserved("packetCreate",i),this.writeBuffer.push(i),s&&this.once("flush",s),this.flush()}}},{key:"close",value:function(){var e=this,t=function(){e.onClose("forced close"),e.transport.close()},r=function r(){e.off("upgrade",r),e.off("upgradeError",r),t()},s=function(){e.once("upgrade",r),e.once("upgradeError",r)};return"opening"!==this.readyState&&"open"!==this.readyState||(this.readyState="closing",this.writeBuffer.length?this.once("drain",(function(){e.upgrading?s():t()})):this.upgrading?s():t()),this}},{key:"onError",value:function(e){u.priorWebsocketSuccess=!1,this.emitReserved("error",e),this.onClose("transport error",e)}},{key:"onClose",value:function(e,t){"opening"!==this.readyState&&"open"!==this.readyState&&"closing"!==this.readyState||(this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),"function"==typeof removeEventListener&&(removeEventListener("beforeunload",this.beforeunloadEventListener,!1),removeEventListener("offline",this.offlineEventListener,!1)),this.readyState="closed",this.id=null,this.emitReserved("close",e,t),this.writeBuffer=[],this.prevBufferLen=0)}},{key:"filterUpgrades",value:function(e){for(var t=[],r=0,s=e.length;r<s;r++)~this.transports.indexOf(e[r])&&t.push(e[r]);return t}}]),u}(n.Emitter);a.protocol=o.protocol,exports.Socket=a;
2
+ //# sourceMappingURL=socket.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"socket.js","sources":["../../../../../node_modules/engine.io-client/build/esm/socket.js"],"sourcesContent":["import { transports } from \"./transports/index.js\";\nimport { installTimerFunctions, byteLength } from \"./util.js\";\nimport { decode } from \"./contrib/parseqs.js\";\nimport { parse } from \"./contrib/parseuri.js\";\nimport { Emitter } from \"@socket.io/component-emitter\";\nimport { protocol } from \"engine.io-parser\";\nexport class Socket extends Emitter {\n /**\n * Socket constructor.\n *\n * @param {String|Object} uri or options\n * @param {Object} opts - options\n * @api public\n */\n constructor(uri, opts = {}) {\n super();\n if (uri && \"object\" === typeof uri) {\n opts = uri;\n uri = null;\n }\n if (uri) {\n uri = parse(uri);\n opts.hostname = uri.host;\n opts.secure = uri.protocol === \"https\" || uri.protocol === \"wss\";\n opts.port = uri.port;\n if (uri.query)\n opts.query = uri.query;\n }\n else if (opts.host) {\n opts.hostname = parse(opts.host).host;\n }\n installTimerFunctions(this, opts);\n this.secure =\n null != opts.secure\n ? opts.secure\n : typeof location !== \"undefined\" && \"https:\" === location.protocol;\n if (opts.hostname && !opts.port) {\n // if no port is specified manually, use the protocol default\n opts.port = this.secure ? \"443\" : \"80\";\n }\n this.hostname =\n opts.hostname ||\n (typeof location !== \"undefined\" ? location.hostname : \"localhost\");\n this.port =\n opts.port ||\n (typeof location !== \"undefined\" && location.port\n ? location.port\n : this.secure\n ? \"443\"\n : \"80\");\n this.transports = opts.transports || [\"polling\", \"websocket\"];\n this.readyState = \"\";\n this.writeBuffer = [];\n this.prevBufferLen = 0;\n this.opts = Object.assign({\n path: \"/engine.io\",\n agent: false,\n withCredentials: false,\n upgrade: true,\n timestampParam: \"t\",\n rememberUpgrade: false,\n rejectUnauthorized: true,\n perMessageDeflate: {\n threshold: 1024\n },\n transportOptions: {},\n closeOnBeforeunload: true\n }, opts);\n this.opts.path = this.opts.path.replace(/\\/$/, \"\") + \"/\";\n if (typeof this.opts.query === \"string\") {\n this.opts.query = decode(this.opts.query);\n }\n // set on handshake\n this.id = null;\n this.upgrades = null;\n this.pingInterval = null;\n this.pingTimeout = null;\n // set on heartbeat\n this.pingTimeoutTimer = null;\n if (typeof addEventListener === \"function\") {\n if (this.opts.closeOnBeforeunload) {\n // Firefox closes the connection when the \"beforeunload\" event is emitted but not Chrome. This event listener\n // ensures every browser behaves the same (no \"disconnect\" event at the Socket.IO level when the page is\n // closed/reloaded)\n this.beforeunloadEventListener = () => {\n if (this.transport) {\n // silently close the transport\n this.transport.removeAllListeners();\n this.transport.close();\n }\n };\n addEventListener(\"beforeunload\", this.beforeunloadEventListener, false);\n }\n if (this.hostname !== \"localhost\") {\n this.offlineEventListener = () => {\n this.onClose(\"transport close\", {\n description: \"network connection lost\"\n });\n };\n addEventListener(\"offline\", this.offlineEventListener, false);\n }\n }\n this.open();\n }\n /**\n * Creates transport of the given type.\n *\n * @param {String} transport name\n * @return {Transport}\n * @api private\n */\n createTransport(name) {\n const query = Object.assign({}, this.opts.query);\n // append engine.io protocol identifier\n query.EIO = protocol;\n // transport name\n query.transport = name;\n // session id if we already have one\n if (this.id)\n query.sid = this.id;\n const opts = Object.assign({}, this.opts.transportOptions[name], this.opts, {\n query,\n socket: this,\n hostname: this.hostname,\n secure: this.secure,\n port: this.port\n });\n return new transports[name](opts);\n }\n /**\n * Initializes transport to use and starts probe.\n *\n * @api private\n */\n open() {\n let transport;\n if (this.opts.rememberUpgrade &&\n Socket.priorWebsocketSuccess &&\n this.transports.indexOf(\"websocket\") !== -1) {\n transport = \"websocket\";\n }\n else if (0 === this.transports.length) {\n // Emit error on next tick so it can be listened to\n this.setTimeoutFn(() => {\n this.emitReserved(\"error\", \"No transports available\");\n }, 0);\n return;\n }\n else {\n transport = this.transports[0];\n }\n this.readyState = \"opening\";\n // Retry with the next transport if the transport is disabled (jsonp: false)\n try {\n transport = this.createTransport(transport);\n }\n catch (e) {\n this.transports.shift();\n this.open();\n return;\n }\n transport.open();\n this.setTransport(transport);\n }\n /**\n * Sets the current transport. Disables the existing one (if any).\n *\n * @api private\n */\n setTransport(transport) {\n if (this.transport) {\n this.transport.removeAllListeners();\n }\n // set up transport\n this.transport = transport;\n // set up transport listeners\n transport\n .on(\"drain\", this.onDrain.bind(this))\n .on(\"packet\", this.onPacket.bind(this))\n .on(\"error\", this.onError.bind(this))\n .on(\"close\", reason => this.onClose(\"transport close\", reason));\n }\n /**\n * Probes a transport.\n *\n * @param {String} transport name\n * @api private\n */\n probe(name) {\n let transport = this.createTransport(name);\n let failed = false;\n Socket.priorWebsocketSuccess = false;\n const onTransportOpen = () => {\n if (failed)\n return;\n transport.send([{ type: \"ping\", data: \"probe\" }]);\n transport.once(\"packet\", msg => {\n if (failed)\n return;\n if (\"pong\" === msg.type && \"probe\" === msg.data) {\n this.upgrading = true;\n this.emitReserved(\"upgrading\", transport);\n if (!transport)\n return;\n Socket.priorWebsocketSuccess = \"websocket\" === transport.name;\n this.transport.pause(() => {\n if (failed)\n return;\n if (\"closed\" === this.readyState)\n return;\n cleanup();\n this.setTransport(transport);\n transport.send([{ type: \"upgrade\" }]);\n this.emitReserved(\"upgrade\", transport);\n transport = null;\n this.upgrading = false;\n this.flush();\n });\n }\n else {\n const err = new Error(\"probe error\");\n // @ts-ignore\n err.transport = transport.name;\n this.emitReserved(\"upgradeError\", err);\n }\n });\n };\n function freezeTransport() {\n if (failed)\n return;\n // Any callback called by transport should be ignored since now\n failed = true;\n cleanup();\n transport.close();\n transport = null;\n }\n // Handle any error that happens while probing\n const onerror = err => {\n const error = new Error(\"probe error: \" + err);\n // @ts-ignore\n error.transport = transport.name;\n freezeTransport();\n this.emitReserved(\"upgradeError\", error);\n };\n function onTransportClose() {\n onerror(\"transport closed\");\n }\n // When the socket is closed while we're probing\n function onclose() {\n onerror(\"socket closed\");\n }\n // When the socket is upgraded while we're probing\n function onupgrade(to) {\n if (transport && to.name !== transport.name) {\n freezeTransport();\n }\n }\n // Remove all listeners on the transport and on self\n const cleanup = () => {\n transport.removeListener(\"open\", onTransportOpen);\n transport.removeListener(\"error\", onerror);\n transport.removeListener(\"close\", onTransportClose);\n this.off(\"close\", onclose);\n this.off(\"upgrading\", onupgrade);\n };\n transport.once(\"open\", onTransportOpen);\n transport.once(\"error\", onerror);\n transport.once(\"close\", onTransportClose);\n this.once(\"close\", onclose);\n this.once(\"upgrading\", onupgrade);\n transport.open();\n }\n /**\n * Called when connection is deemed open.\n *\n * @api private\n */\n onOpen() {\n this.readyState = \"open\";\n Socket.priorWebsocketSuccess = \"websocket\" === this.transport.name;\n this.emitReserved(\"open\");\n this.flush();\n // we check for `readyState` in case an `open`\n // listener already closed the socket\n if (\"open\" === this.readyState &&\n this.opts.upgrade &&\n this.transport.pause) {\n let i = 0;\n const l = this.upgrades.length;\n for (; i < l; i++) {\n this.probe(this.upgrades[i]);\n }\n }\n }\n /**\n * Handles a packet.\n *\n * @api private\n */\n onPacket(packet) {\n if (\"opening\" === this.readyState ||\n \"open\" === this.readyState ||\n \"closing\" === this.readyState) {\n this.emitReserved(\"packet\", packet);\n // Socket is live - any packet counts\n this.emitReserved(\"heartbeat\");\n switch (packet.type) {\n case \"open\":\n this.onHandshake(JSON.parse(packet.data));\n break;\n case \"ping\":\n this.resetPingTimeout();\n this.sendPacket(\"pong\");\n this.emitReserved(\"ping\");\n this.emitReserved(\"pong\");\n break;\n case \"error\":\n const err = new Error(\"server error\");\n // @ts-ignore\n err.code = packet.data;\n this.onError(err);\n break;\n case \"message\":\n this.emitReserved(\"data\", packet.data);\n this.emitReserved(\"message\", packet.data);\n break;\n }\n }\n else {\n }\n }\n /**\n * Called upon handshake completion.\n *\n * @param {Object} data - handshake obj\n * @api private\n */\n onHandshake(data) {\n this.emitReserved(\"handshake\", data);\n this.id = data.sid;\n this.transport.query.sid = data.sid;\n this.upgrades = this.filterUpgrades(data.upgrades);\n this.pingInterval = data.pingInterval;\n this.pingTimeout = data.pingTimeout;\n this.maxPayload = data.maxPayload;\n this.onOpen();\n // In case open handler closes socket\n if (\"closed\" === this.readyState)\n return;\n this.resetPingTimeout();\n }\n /**\n * Sets and resets ping timeout timer based on server pings.\n *\n * @api private\n */\n resetPingTimeout() {\n this.clearTimeoutFn(this.pingTimeoutTimer);\n this.pingTimeoutTimer = this.setTimeoutFn(() => {\n this.onClose(\"ping timeout\");\n }, this.pingInterval + this.pingTimeout);\n if (this.opts.autoUnref) {\n this.pingTimeoutTimer.unref();\n }\n }\n /**\n * Called on `drain` event\n *\n * @api private\n */\n onDrain() {\n this.writeBuffer.splice(0, this.prevBufferLen);\n // setting prevBufferLen = 0 is very important\n // for example, when upgrading, upgrade packet is sent over,\n // and a nonzero prevBufferLen could cause problems on `drain`\n this.prevBufferLen = 0;\n if (0 === this.writeBuffer.length) {\n this.emitReserved(\"drain\");\n }\n else {\n this.flush();\n }\n }\n /**\n * Flush write buffers.\n *\n * @api private\n */\n flush() {\n if (\"closed\" !== this.readyState &&\n this.transport.writable &&\n !this.upgrading &&\n this.writeBuffer.length) {\n const packets = this.getWritablePackets();\n this.transport.send(packets);\n // keep track of current length of writeBuffer\n // splice writeBuffer and callbackBuffer on `drain`\n this.prevBufferLen = packets.length;\n this.emitReserved(\"flush\");\n }\n }\n /**\n * Ensure the encoded size of the writeBuffer is below the maxPayload value sent by the server (only for HTTP\n * long-polling)\n *\n * @private\n */\n getWritablePackets() {\n const shouldCheckPayloadSize = this.maxPayload &&\n this.transport.name === \"polling\" &&\n this.writeBuffer.length > 1;\n if (!shouldCheckPayloadSize) {\n return this.writeBuffer;\n }\n let payloadSize = 1; // first packet type\n for (let i = 0; i < this.writeBuffer.length; i++) {\n const data = this.writeBuffer[i].data;\n if (data) {\n payloadSize += byteLength(data);\n }\n if (i > 0 && payloadSize > this.maxPayload) {\n return this.writeBuffer.slice(0, i);\n }\n payloadSize += 2; // separator + packet type\n }\n return this.writeBuffer;\n }\n /**\n * Sends a message.\n *\n * @param {String} message.\n * @param {Function} callback function.\n * @param {Object} options.\n * @return {Socket} for chaining.\n * @api public\n */\n write(msg, options, fn) {\n this.sendPacket(\"message\", msg, options, fn);\n return this;\n }\n send(msg, options, fn) {\n this.sendPacket(\"message\", msg, options, fn);\n return this;\n }\n /**\n * Sends a packet.\n *\n * @param {String} packet type.\n * @param {String} data.\n * @param {Object} options.\n * @param {Function} callback function.\n * @api private\n */\n sendPacket(type, data, options, fn) {\n if (\"function\" === typeof data) {\n fn = data;\n data = undefined;\n }\n if (\"function\" === typeof options) {\n fn = options;\n options = null;\n }\n if (\"closing\" === this.readyState || \"closed\" === this.readyState) {\n return;\n }\n options = options || {};\n options.compress = false !== options.compress;\n const packet = {\n type: type,\n data: data,\n options: options\n };\n this.emitReserved(\"packetCreate\", packet);\n this.writeBuffer.push(packet);\n if (fn)\n this.once(\"flush\", fn);\n this.flush();\n }\n /**\n * Closes the connection.\n *\n * @api public\n */\n close() {\n const close = () => {\n this.onClose(\"forced close\");\n this.transport.close();\n };\n const cleanupAndClose = () => {\n this.off(\"upgrade\", cleanupAndClose);\n this.off(\"upgradeError\", cleanupAndClose);\n close();\n };\n const waitForUpgrade = () => {\n // wait for upgrade to finish since we can't send packets while pausing a transport\n this.once(\"upgrade\", cleanupAndClose);\n this.once(\"upgradeError\", cleanupAndClose);\n };\n if (\"opening\" === this.readyState || \"open\" === this.readyState) {\n this.readyState = \"closing\";\n if (this.writeBuffer.length) {\n this.once(\"drain\", () => {\n if (this.upgrading) {\n waitForUpgrade();\n }\n else {\n close();\n }\n });\n }\n else if (this.upgrading) {\n waitForUpgrade();\n }\n else {\n close();\n }\n }\n return this;\n }\n /**\n * Called upon transport error\n *\n * @api private\n */\n onError(err) {\n Socket.priorWebsocketSuccess = false;\n this.emitReserved(\"error\", err);\n this.onClose(\"transport error\", err);\n }\n /**\n * Called upon transport close.\n *\n * @api private\n */\n onClose(reason, description) {\n if (\"opening\" === this.readyState ||\n \"open\" === this.readyState ||\n \"closing\" === this.readyState) {\n // clear timers\n this.clearTimeoutFn(this.pingTimeoutTimer);\n // stop event from firing again for transport\n this.transport.removeAllListeners(\"close\");\n // ensure transport won't stay open\n this.transport.close();\n // ignore further transport communication\n this.transport.removeAllListeners();\n if (typeof removeEventListener === \"function\") {\n removeEventListener(\"beforeunload\", this.beforeunloadEventListener, false);\n removeEventListener(\"offline\", this.offlineEventListener, false);\n }\n // set ready state\n this.readyState = \"closed\";\n // clear session id\n this.id = null;\n // emit close event\n this.emitReserved(\"close\", reason, description);\n // clean buffers after, so users can still\n // grab the buffers on `close` event\n this.writeBuffer = [];\n this.prevBufferLen = 0;\n }\n }\n /**\n * Filters upgrades, returning only those matching client transports.\n *\n * @param {Array} server upgrades\n * @api private\n *\n */\n filterUpgrades(upgrades) {\n const filteredUpgrades = [];\n let i = 0;\n const j = upgrades.length;\n for (; i < j; i++) {\n if (~this.transports.indexOf(upgrades[i]))\n filteredUpgrades.push(upgrades[i]);\n }\n return filteredUpgrades;\n }\n}\nSocket.protocol = protocol;\n"],"names":["Socket","_Emitter","_inherits","_super","_createSuper","uri","_this","opts","arguments","length","undefined","_classCallCheck","this","call","_typeof","parse","hostname","host","secure","protocol","port","query","installTimerFunctions","_assertThisInitialized","assertThisInitialized","location","transports","readyState","writeBuffer","prevBufferLen","Object","assign","path","agent","withCredentials","upgrade","timestampParam","rememberUpgrade","rejectUnauthorized","perMessageDeflate","threshold","transportOptions","closeOnBeforeunload","replace","decode","id","upgrades","pingInterval","pingTimeout","pingTimeoutTimer","addEventListener","beforeunloadEventListener","transport","removeAllListeners","close","offlineEventListener","onClose","description","open","_createClass","createClass","key","value","name","EIO","sid","socket","_this2","priorWebsocketSuccess","indexOf","setTimeoutFn","emitReserved","createTransport","e","shift","setTransport","_this3","on","onDrain","bind","onPacket","onError","reason","_this4","failed","onTransportOpen","send","type","data","once","msg","upgrading","pause","cleanup","flush","err","Error","freezeTransport","onerror","error","onTransportClose","onclose","onupgrade","to","removeListener","off","i","l","probe","packet","onHandshake","JSON","resetPingTimeout","sendPacket","code","filterUpgrades","maxPayload","onOpen","_this5","clearTimeoutFn","autoUnref","unref","splice","writable","packets","getWritablePackets","payloadSize","byteLength","slice","options","fn","compress","push","_this6","cleanupAndClose","waitForUpgrade","removeEventListener","filteredUpgrades","j","Emitter"],"mappings":"gYAMaA,EAAM,SAAAC,GAAAC,WAAAF,EAAAC,GAAA,IAAAE,EAAAC,cAAAJ,GAQf,SAAAA,EAAYK,GAAgB,IAAAC,EAAXC,EAAOC,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,GAAA,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KAAKgB,YAAc,GACnBhB,KAAKiB,cAAgB,EAE7B,GACA,CAAAgC,IAAA,iBAAAC,MAOA,SAAehB,GAIX,IAHA,IAAM2F,EAAmB,GACrB/B,EAAI,EACFgC,EAAI5F,EAASrC,OACZiG,EAAIgC,EAAGhC,KACL9F,KAAKc,WAAW2C,QAAQvB,EAAS4D,KAClC+B,EAAiBL,KAAKtF,EAAS4D,IAEvC,OAAO+B,CACX,KAACzI,CAAA,CA5jBc,CAAS2I,WA8jB5B3I,EAAOmB,SAAWA,EAAQA"}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../../_virtual/_rollupPluginBabelHelpers.js");require("../../../engine.io-parser/build/esm/encodePacket.browser.js");var t=require("../../../engine.io-parser/build/esm/decodePacket.browser.js"),r=require("../../../@socket.io/component-emitter/index.mjs.js"),i=require("./util.js"),s=function(t){e.inherits(i,t);var r=e.createSuper(i);function i(t,s,o){var a;return e.classCallCheck(this,i),(a=r.call(this,t)).description=s,a.context=o,a.type="TransportError",a}return e.createClass(i)}(e.wrapNativeSuper(Error)),o=function(r){e.inherits(a,r);var o=e.createSuper(a);function a(t){var r;return e.classCallCheck(this,a),(r=o.call(this)).writable=!1,i.installTimerFunctions(e.assertThisInitialized(r),t),r.opts=t,r.query=t.query,r.readyState="",r.socket=t.socket,r}return e.createClass(a,[{key:"onError",value:function(t,r,i){return e.get(e.getPrototypeOf(a.prototype),"emitReserved",this).call(this,"error",new s(t,r,i)),this}},{key:"open",value:function(){return"closed"!==this.readyState&&""!==this.readyState||(this.readyState="opening",this.doOpen()),this}},{key:"close",value:function(){return"opening"!==this.readyState&&"open"!==this.readyState||(this.doClose(),this.onClose()),this}},{key:"send",value:function(e){"open"===this.readyState&&this.write(e)}},{key:"onOpen",value:function(){this.readyState="open",this.writable=!0,e.get(e.getPrototypeOf(a.prototype),"emitReserved",this).call(this,"open")}},{key:"onData",value:function(e){var r=t.default(e,this.socket.binaryType);this.onPacket(r)}},{key:"onPacket",value:function(t){e.get(e.getPrototypeOf(a.prototype),"emitReserved",this).call(this,"packet",t)}},{key:"onClose",value:function(t){this.readyState="closed",e.get(e.getPrototypeOf(a.prototype),"emitReserved",this).call(this,"close",t)}}]),a}(r.Emitter);exports.Transport=o;
2
+ //# sourceMappingURL=transport.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transport.js","sources":["../../../../../node_modules/engine.io-client/build/esm/transport.js"],"sourcesContent":["import { decodePacket } from \"engine.io-parser\";\nimport { Emitter } from \"@socket.io/component-emitter\";\nimport { installTimerFunctions } from \"./util.js\";\nclass TransportError extends Error {\n constructor(reason, description, context) {\n super(reason);\n this.description = description;\n this.context = context;\n this.type = \"TransportError\";\n }\n}\nexport class Transport extends Emitter {\n /**\n * Transport abstract constructor.\n *\n * @param {Object} options.\n * @api private\n */\n constructor(opts) {\n super();\n this.writable = false;\n installTimerFunctions(this, opts);\n this.opts = opts;\n this.query = opts.query;\n this.readyState = \"\";\n this.socket = opts.socket;\n }\n /**\n * Emits an error.\n *\n * @param {String} reason\n * @param description\n * @param context - the error context\n * @return {Transport} for chaining\n * @api protected\n */\n onError(reason, description, context) {\n super.emitReserved(\"error\", new TransportError(reason, description, context));\n return this;\n }\n /**\n * Opens the transport.\n *\n * @api public\n */\n open() {\n if (\"closed\" === this.readyState || \"\" === this.readyState) {\n this.readyState = \"opening\";\n this.doOpen();\n }\n return this;\n }\n /**\n * Closes the transport.\n *\n * @api public\n */\n close() {\n if (\"opening\" === this.readyState || \"open\" === this.readyState) {\n this.doClose();\n this.onClose();\n }\n return this;\n }\n /**\n * Sends multiple packets.\n *\n * @param {Array} packets\n * @api public\n */\n send(packets) {\n if (\"open\" === this.readyState) {\n this.write(packets);\n }\n else {\n // this might happen if the transport was silently closed in the beforeunload event handler\n }\n }\n /**\n * Called upon open\n *\n * @api protected\n */\n onOpen() {\n this.readyState = \"open\";\n this.writable = true;\n super.emitReserved(\"open\");\n }\n /**\n * Called with data.\n *\n * @param {String} data\n * @api protected\n */\n onData(data) {\n const packet = decodePacket(data, this.socket.binaryType);\n this.onPacket(packet);\n }\n /**\n * Called with a decoded packet.\n *\n * @api protected\n */\n onPacket(packet) {\n super.emitReserved(\"packet\", packet);\n }\n /**\n * Called upon close.\n *\n * @api protected\n */\n onClose(details) {\n this.readyState = \"closed\";\n super.emitReserved(\"close\", details);\n }\n}\n"],"names":["TransportError","_Error","_inherits","_super","_createSuper","reason","description","context","_this","_classCallCheck","this","call","type","_createClass","_wrapNativeSuper","wrapNativeSuper","Error","Transport","_Emitter","_super2","opts","_this2","writable","installTimerFunctions","_assertThisInitialized","assertThisInitialized","query","readyState","socket","createClass","key","value","_get","get","_getPrototypeOf","getPrototypeOf","prototype","doOpen","doClose","onClose","packets","write","data","packet","decodePacket","binaryType","onPacket","details","Emitter"],"mappings":"kXAGMA,EAAc,SAAAC,GAAAC,WAAAF,EAAAC,GAAA,IAAAE,EAAAC,cAAAJ,GAChB,SAAAA,EAAYK,EAAQC,EAAaC,GAAS,IAAAC,EAIT,OAJSC,iBAAAC,KAAAV,IACtCQ,EAAAL,EAAAQ,KAAAD,KAAML,IACDC,YAAcA,EACnBE,EAAKD,QAAUA,EACfC,EAAKI,KAAO,iBAAiBJ,CACjC,CAAC,OAAAK,EAAAA,YAAAb,EAAA,CANe,CAMfc,EAAAC,gBANwBC,QAQhBC,EAAS,SAAAC,GAAAhB,WAAAe,EAAAC,GAAA,IAAAC,EAAAf,cAAAa,GAOlB,SAAAA,EAAYG,GAAM,IAAAC,EAOY,OAPZZ,iBAAAC,KAAAO,IACdI,EAAAF,EAAAR,KAAAD,OACKY,UAAW,EAChBC,EAAAA,sBAAqBC,EAAAC,sBAAAJ,GAAOD,GAC5BC,EAAKD,KAAOA,EACZC,EAAKK,MAAQN,EAAKM,MAClBL,EAAKM,WAAa,GAClBN,EAAKO,OAASR,EAAKQ,OAAOP,CAC9B,CAwFC,OAvFDR,EAAAgB,YAAAZ,EAAA,CAAA,CAAAa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),r={websocket:require("./websocket.js").WS,polling:e.Polling};exports.transports=r;
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../../../../node_modules/engine.io-client/build/esm/transports/index.js"],"sourcesContent":["import { Polling } from \"./polling.js\";\nimport { WS } from \"./websocket.js\";\nexport const transports = {\n websocket: WS,\n polling: Polling\n};\n"],"names":["transports","websocket","WS","polling","Polling"],"mappings":"kGAEaA,EAAa,CACtBC,oCAAaC,GACbC,QAASC,EAAAA"}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../../../_virtual/_rollupPluginBabelHelpers.js"),t=require("../transport.js"),s=require("../contrib/yeast.js"),i=require("../contrib/parseqs.js"),r=require("../../../../engine.io-parser/build/esm/index.js"),o=require("./xmlhttprequest.browser.js"),n=require("../../../../@socket.io/component-emitter/index.mjs.js"),a=require("../util.js"),h=require("../globalThis.browser.js");function u(){}var l=null!=new o.XHR({xdomain:!1}).responseType,c=function(t){e.inherits(n,t);var o=e.createSuper(n);function n(t){var s;if(e.classCallCheck(this,n),(s=o.call(this,t)).polling=!1,"undefined"!=typeof location){var i="https:"===location.protocol,r=location.port;r||(r=i?"443":"80"),s.xd="undefined"!=typeof location&&t.hostname!==location.hostname||r!==t.port,s.xs=t.secure!==i}var a=t&&t.forceBase64;return s.supportsBinary=l&&!a,s}return e.createClass(n,[{key:"name",get:function(){return"polling"}},{key:"doOpen",value:function(){this.poll()}},{key:"pause",value:function(e){var t=this;this.readyState="pausing";var s=function(){t.readyState="paused",e()};if(this.polling||!this.writable){var i=0;this.polling&&(i++,this.once("pollComplete",(function(){--i||s()}))),this.writable||(i++,this.once("drain",(function(){--i||s()})))}else s()}},{key:"poll",value:function(){this.polling=!0,this.doPoll(),this.emitReserved("poll")}},{key:"onData",value:function(e){var t=this;r.decodePayload(e,this.socket.binaryType).forEach((function(e){if("opening"===t.readyState&&"open"===e.type&&t.onOpen(),"close"===e.type)return t.onClose({description:"transport closed by the server"}),!1;t.onPacket(e)})),"closed"!==this.readyState&&(this.polling=!1,this.emitReserved("pollComplete"),"open"===this.readyState&&this.poll())}},{key:"doClose",value:function(){var e=this,t=function(){e.write([{type:"close"}])};"open"===this.readyState?t():this.once("open",t)}},{key:"write",value:function(e){var t=this;this.writable=!1,r.encodePayload(e,(function(e){t.doWrite(e,(function(){t.writable=!0,t.emitReserved("drain")}))}))}},{key:"uri",value:function(){var e=this.query||{},t=this.opts.secure?"https":"http",r="";!1!==this.opts.timestampRequests&&(e[this.opts.timestampParam]=s.yeast()),this.supportsBinary||e.sid||(e.b64=1),this.opts.port&&("https"===t&&443!==Number(this.opts.port)||"http"===t&&80!==Number(this.opts.port))&&(r=":"+this.opts.port);var o=i.encode(e);return t+"://"+(-1!==this.opts.hostname.indexOf(":")?"["+this.opts.hostname+"]":this.opts.hostname)+r+this.opts.path+(o.length?"?"+o:"")}},{key:"request",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object.assign(e,{xd:this.xd,xs:this.xs},this.opts),new p(this.uri(),e)}},{key:"doWrite",value:function(e,t){var s=this,i=this.request({method:"POST",data:e});i.on("success",t),i.on("error",(function(e,t){s.onError("xhr post error",e,t)}))}},{key:"doPoll",value:function(){var e=this,t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(function(t,s){e.onError("xhr poll error",t,s)})),this.pollXhr=t}}]),n}(t.Transport),p=function(t){e.inherits(i,t);var s=e.createSuper(i);function i(t,r){var o;return e.classCallCheck(this,i),o=s.call(this),a.installTimerFunctions(e.assertThisInitialized(o),r),o.opts=r,o.method=r.method||"GET",o.uri=t,o.async=!1!==r.async,o.data=void 0!==r.data?r.data:null,o.create(),o}return e.createClass(i,[{key:"create",value:function(){var e=this,t=a.pick(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");t.xdomain=!!this.opts.xd,t.xscheme=!!this.opts.xs;var s=this.xhr=new o.XHR(t);try{s.open(this.method,this.uri,this.async);try{if(this.opts.extraHeaders)for(var r in s.setDisableHeaderCheck&&s.setDisableHeaderCheck(!0),this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(r)&&s.setRequestHeader(r,this.opts.extraHeaders[r])}catch(e){}if("POST"===this.method)try{s.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(e){}try{s.setRequestHeader("Accept","*/*")}catch(e){}"withCredentials"in s&&(s.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(s.timeout=this.opts.requestTimeout),s.onreadystatechange=function(){4===s.readyState&&(200===s.status||1223===s.status?e.onLoad():e.setTimeoutFn((function(){e.onError("number"==typeof s.status?s.status:0)}),0))},s.send(this.data)}catch(t){return void this.setTimeoutFn((function(){e.onError(t)}),0)}"undefined"!=typeof document&&(this.index=i.requestsCount++,i.requests[this.index]=this)}},{key:"onError",value:function(e){this.emitReserved("error",e,this.xhr),this.cleanup(!0)}},{key:"cleanup",value:function(e){if(void 0!==this.xhr&&null!==this.xhr){if(this.xhr.onreadystatechange=u,e)try{this.xhr.abort()}catch(e){}"undefined"!=typeof document&&delete i.requests[this.index],this.xhr=null}}},{key:"onLoad",value:function(){var e=this.xhr.responseText;null!==e&&(this.emitReserved("data",e),this.emitReserved("success"),this.cleanup())}},{key:"abort",value:function(){this.cleanup()}}]),i}(n.Emitter);if(p.requestsCount=0,p.requests={},"undefined"!=typeof document)if("function"==typeof attachEvent)attachEvent("onunload",f);else if("function"==typeof addEventListener){var d="onpagehide"in h.globalThisShim?"pagehide":"unload";addEventListener(d,f,!1)}function f(){for(var e in p.requests)p.requests.hasOwnProperty(e)&&p.requests[e].abort()}exports.Polling=c,exports.Request=p;
2
+ //# sourceMappingURL=polling.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"polling.js","sources":["../../../../../../node_modules/engine.io-client/build/esm/transports/polling.js"],"sourcesContent":["import { Transport } from \"../transport.js\";\nimport { yeast } from \"../contrib/yeast.js\";\nimport { encode } from \"../contrib/parseqs.js\";\nimport { encodePayload, decodePayload } from \"engine.io-parser\";\nimport { XHR as XMLHttpRequest } from \"./xmlhttprequest.js\";\nimport { Emitter } from \"@socket.io/component-emitter\";\nimport { installTimerFunctions, pick } from \"../util.js\";\nimport { globalThisShim as globalThis } from \"../globalThis.js\";\nfunction empty() { }\nconst hasXHR2 = (function () {\n const xhr = new XMLHttpRequest({\n xdomain: false\n });\n return null != xhr.responseType;\n})();\nexport class Polling extends Transport {\n /**\n * XHR Polling constructor.\n *\n * @param {Object} opts\n * @api public\n */\n constructor(opts) {\n super(opts);\n this.polling = false;\n if (typeof location !== \"undefined\") {\n const isSSL = \"https:\" === location.protocol;\n let port = location.port;\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? \"443\" : \"80\";\n }\n this.xd =\n (typeof location !== \"undefined\" &&\n opts.hostname !== location.hostname) ||\n port !== opts.port;\n this.xs = opts.secure !== isSSL;\n }\n /**\n * XHR supports binary\n */\n const forceBase64 = opts && opts.forceBase64;\n this.supportsBinary = hasXHR2 && !forceBase64;\n }\n /**\n * Transport name.\n */\n get name() {\n return \"polling\";\n }\n /**\n * Opens the socket (triggers polling). We write a PING message to determine\n * when the transport is open.\n *\n * @api private\n */\n doOpen() {\n this.poll();\n }\n /**\n * Pauses polling.\n *\n * @param {Function} callback upon buffers are flushed and transport is paused\n * @api private\n */\n pause(onPause) {\n this.readyState = \"pausing\";\n const pause = () => {\n this.readyState = \"paused\";\n onPause();\n };\n if (this.polling || !this.writable) {\n let total = 0;\n if (this.polling) {\n total++;\n this.once(\"pollComplete\", function () {\n --total || pause();\n });\n }\n if (!this.writable) {\n total++;\n this.once(\"drain\", function () {\n --total || pause();\n });\n }\n }\n else {\n pause();\n }\n }\n /**\n * Starts polling cycle.\n *\n * @api public\n */\n poll() {\n this.polling = true;\n this.doPoll();\n this.emitReserved(\"poll\");\n }\n /**\n * Overloads onData to detect payloads.\n *\n * @api private\n */\n onData(data) {\n const callback = packet => {\n // if its the first message we consider the transport open\n if (\"opening\" === this.readyState && packet.type === \"open\") {\n this.onOpen();\n }\n // if its a close packet, we close the ongoing requests\n if (\"close\" === packet.type) {\n this.onClose({ description: \"transport closed by the server\" });\n return false;\n }\n // otherwise bypass onData and handle the message\n this.onPacket(packet);\n };\n // decode payload\n decodePayload(data, this.socket.binaryType).forEach(callback);\n // if an event did not trigger closing\n if (\"closed\" !== this.readyState) {\n // if we got data we're not polling\n this.polling = false;\n this.emitReserved(\"pollComplete\");\n if (\"open\" === this.readyState) {\n this.poll();\n }\n else {\n }\n }\n }\n /**\n * For polling, send a close packet.\n *\n * @api private\n */\n doClose() {\n const close = () => {\n this.write([{ type: \"close\" }]);\n };\n if (\"open\" === this.readyState) {\n close();\n }\n else {\n // in case we're trying to close while\n // handshaking is in progress (GH-164)\n this.once(\"open\", close);\n }\n }\n /**\n * Writes a packets payload.\n *\n * @param {Array} data packets\n * @param {Function} drain callback\n * @api private\n */\n write(packets) {\n this.writable = false;\n encodePayload(packets, data => {\n this.doWrite(data, () => {\n this.writable = true;\n this.emitReserved(\"drain\");\n });\n });\n }\n /**\n * Generates uri for connection.\n *\n * @api private\n */\n uri() {\n let query = this.query || {};\n const schema = this.opts.secure ? \"https\" : \"http\";\n let port = \"\";\n // cache busting is forced\n if (false !== this.opts.timestampRequests) {\n query[this.opts.timestampParam] = yeast();\n }\n if (!this.supportsBinary && !query.sid) {\n query.b64 = 1;\n }\n // avoid port if default for schema\n if (this.opts.port &&\n ((\"https\" === schema && Number(this.opts.port) !== 443) ||\n (\"http\" === schema && Number(this.opts.port) !== 80))) {\n port = \":\" + this.opts.port;\n }\n const encodedQuery = encode(query);\n const ipv6 = this.opts.hostname.indexOf(\":\") !== -1;\n return (schema +\n \"://\" +\n (ipv6 ? \"[\" + this.opts.hostname + \"]\" : this.opts.hostname) +\n port +\n this.opts.path +\n (encodedQuery.length ? \"?\" + encodedQuery : \"\"));\n }\n /**\n * Creates a request.\n *\n * @param {String} method\n * @api private\n */\n request(opts = {}) {\n Object.assign(opts, { xd: this.xd, xs: this.xs }, this.opts);\n return new Request(this.uri(), opts);\n }\n /**\n * Sends data.\n *\n * @param {String} data to send.\n * @param {Function} called upon flush.\n * @api private\n */\n doWrite(data, fn) {\n const req = this.request({\n method: \"POST\",\n data: data\n });\n req.on(\"success\", fn);\n req.on(\"error\", (xhrStatus, context) => {\n this.onError(\"xhr post error\", xhrStatus, context);\n });\n }\n /**\n * Starts a poll cycle.\n *\n * @api private\n */\n doPoll() {\n const req = this.request();\n req.on(\"data\", this.onData.bind(this));\n req.on(\"error\", (xhrStatus, context) => {\n this.onError(\"xhr poll error\", xhrStatus, context);\n });\n this.pollXhr = req;\n }\n}\nexport class Request extends Emitter {\n /**\n * Request constructor\n *\n * @param {Object} options\n * @api public\n */\n constructor(uri, opts) {\n super();\n installTimerFunctions(this, opts);\n this.opts = opts;\n this.method = opts.method || \"GET\";\n this.uri = uri;\n this.async = false !== opts.async;\n this.data = undefined !== opts.data ? opts.data : null;\n this.create();\n }\n /**\n * Creates the XHR object and sends the request.\n *\n * @api private\n */\n create() {\n const opts = pick(this.opts, \"agent\", \"pfx\", \"key\", \"passphrase\", \"cert\", \"ca\", \"ciphers\", \"rejectUnauthorized\", \"autoUnref\");\n opts.xdomain = !!this.opts.xd;\n opts.xscheme = !!this.opts.xs;\n const xhr = (this.xhr = new XMLHttpRequest(opts));\n try {\n xhr.open(this.method, this.uri, this.async);\n try {\n if (this.opts.extraHeaders) {\n xhr.setDisableHeaderCheck && xhr.setDisableHeaderCheck(true);\n for (let i in this.opts.extraHeaders) {\n if (this.opts.extraHeaders.hasOwnProperty(i)) {\n xhr.setRequestHeader(i, this.opts.extraHeaders[i]);\n }\n }\n }\n }\n catch (e) { }\n if (\"POST\" === this.method) {\n try {\n xhr.setRequestHeader(\"Content-type\", \"text/plain;charset=UTF-8\");\n }\n catch (e) { }\n }\n try {\n xhr.setRequestHeader(\"Accept\", \"*/*\");\n }\n catch (e) { }\n // ie6 check\n if (\"withCredentials\" in xhr) {\n xhr.withCredentials = this.opts.withCredentials;\n }\n if (this.opts.requestTimeout) {\n xhr.timeout = this.opts.requestTimeout;\n }\n xhr.onreadystatechange = () => {\n if (4 !== xhr.readyState)\n return;\n if (200 === xhr.status || 1223 === xhr.status) {\n this.onLoad();\n }\n else {\n // make sure the `error` event handler that's user-set\n // does not throw in the same tick and gets caught here\n this.setTimeoutFn(() => {\n this.onError(typeof xhr.status === \"number\" ? xhr.status : 0);\n }, 0);\n }\n };\n xhr.send(this.data);\n }\n catch (e) {\n // Need to defer since .create() is called directly from the constructor\n // and thus the 'error' event can only be only bound *after* this exception\n // occurs. Therefore, also, we cannot throw here at all.\n this.setTimeoutFn(() => {\n this.onError(e);\n }, 0);\n return;\n }\n if (typeof document !== \"undefined\") {\n this.index = Request.requestsCount++;\n Request.requests[this.index] = this;\n }\n }\n /**\n * Called upon error.\n *\n * @api private\n */\n onError(err) {\n this.emitReserved(\"error\", err, this.xhr);\n this.cleanup(true);\n }\n /**\n * Cleans up house.\n *\n * @api private\n */\n cleanup(fromError) {\n if (\"undefined\" === typeof this.xhr || null === this.xhr) {\n return;\n }\n this.xhr.onreadystatechange = empty;\n if (fromError) {\n try {\n this.xhr.abort();\n }\n catch (e) { }\n }\n if (typeof document !== \"undefined\") {\n delete Request.requests[this.index];\n }\n this.xhr = null;\n }\n /**\n * Called upon load.\n *\n * @api private\n */\n onLoad() {\n const data = this.xhr.responseText;\n if (data !== null) {\n this.emitReserved(\"data\", data);\n this.emitReserved(\"success\");\n this.cleanup();\n }\n }\n /**\n * Aborts the request.\n *\n * @api public\n */\n abort() {\n this.cleanup();\n }\n}\nRequest.requestsCount = 0;\nRequest.requests = {};\n/**\n * Aborts pending requests when unloading the window. This is needed to prevent\n * memory leaks (e.g. when using IE) and to ensure that no spurious error is\n * emitted.\n */\nif (typeof document !== \"undefined\") {\n // @ts-ignore\n if (typeof attachEvent === \"function\") {\n // @ts-ignore\n attachEvent(\"onunload\", unloadHandler);\n }\n else if (typeof addEventListener === \"function\") {\n const terminationEvent = \"onpagehide\" in globalThis ? \"pagehide\" : \"unload\";\n addEventListener(terminationEvent, unloadHandler, false);\n }\n}\nfunction unloadHandler() {\n for (let i in Request.requests) {\n if (Request.requests.hasOwnProperty(i)) {\n Request.requests[i].abort();\n }\n }\n}\n"],"names":["empty","hasXHR2","XMLHttpRequest","xdomain","responseType","Polling","_Transport","_inherits","_super","_createSuper","opts","_this","_classCallCheck","this","call","polling","location","isSSL","protocol","port","xd","hostname","xs","secure","forceBase64","supportsBinary","_createClass","createClass","key","get","value","poll","onPause","_this2","readyState","pause","writable","total","once","doPoll","emitReserved","data","_this3","decodePayload","socket","binaryType","forEach","packet","type","onOpen","onClose","description","onPacket","_this4","close","write","packets","_this5","encodePayload","doWrite","query","schema","timestampRequests","timestampParam","yeast","sid","b64","Number","encodedQuery","encode","indexOf","path","length","arguments","undefined","Object","assign","Request","uri","fn","_this6","req","request","method","on","xhrStatus","context","onError","_this7","onData","bind","pollXhr","Transport","_Emitter","_super2","_this8","installTimerFunctions","_assertThisInitialized","assertThisInitialized","async","create","_this9","pick","xscheme","xhr","XHR","open","extraHeaders","i","setDisableHeaderCheck","hasOwnProperty","setRequestHeader","e","withCredentials","requestTimeout","timeout","onreadystatechange","status","onLoad","setTimeoutFn","send","document","index","requestsCount","requests","err","cleanup","fromError","abort","responseText","Emitter","attachEvent","unloadHandler","addEventListener","terminationEvent","globalThis"],"mappings":"kdAQA,SAASA,IAAU,CACnB,IAAMC,EAIK,MAHK,IAAIC,MAAe,CAC3BC,SAAS,IAEMC,aAEVC,EAAO,SAAAC,GAAAC,WAAAF,EAAAC,GAAA,IAAAE,EAAAC,cAAAJ,GAOhB,SAAAA,EAAYK,GAAM,IAAAC,EAGd,GAHcC,iBAAAC,KAAAR,IACdM,EAAAH,EAAAM,KAAAD,KAAMH,IACDK,SAAU,EACS,oBAAbC,SAA0B,CACjC,IAAMC,EAAQ,WAAaD,SAASE,SAChCC,EAAOH,SAASG,K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,CAAAlG,IAAA,UAAAE,MAKA,SAAQiG,GACJ,QAAI,IAAuBlH,KAAK2F,KAAO,OAAS3F,KAAK2F,IAArD,CAIA,GADA3F,KAAK2F,IAAIY,mBAAqBpH,EAC1B+H,EACA,IACIlH,KAAK2F,IAAIwB,OAED,CAAZ,MAAOhB,GAAK,CAEQ,oBAAbS,iBACA5C,EAAQ+C,SAAS/G,KAAK6G,OAEjC7G,KAAK2F,IAAM,IAXX,CAYJ,GACA,CAAA5E,IAAA,SAAAE,MAKA,WACI,IAAMW,EAAO5B,KAAK2F,IAAIyB,aACT,OAATxF,IACA5B,KAAK2B,aAAa,OAAQC,GAC1B5B,KAAK2B,aAAa,WAClB3B,KAAKiH,UAEb,GACA,CAAAlG,IAAA,QAAAE,MAKA,WACIjB,KAAKiH,SACT,KAACjD,CAAA,CAzIe,CAASqD,WAkJ7B,GAPArD,EAAQ8C,cAAgB,EACxB9C,EAAQ+C,SAAW,CAAA,EAMK,oBAAbH,SAEP,GAA2B,mBAAhBU,YAEPA,YAAY,WAAYC,QAEvB,GAAgC,mBAArBC,iBAAiC,CAC7C,IAAMC,EAAmB,eAAgBC,iBAAa,WAAa,SACnEF,iBAAiBC,EAAkBF,GAAe,EACtD,CAEJ,SAASA,IACL,IAAK,IAAIxB,KAAK/B,EAAQ+C,SACd/C,EAAQ+C,SAASd,eAAeF,IAChC/B,EAAQ+C,SAAShB,GAAGoB,OAGhC"}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../globalThis.browser.js"),o="function"==typeof Promise&&"function"==typeof Promise.resolve?function(e){return Promise.resolve().then(e)}:function(e,o){return o(e,0)},r=e.globalThisShim.WebSocket||e.globalThisShim.MozWebSocket;exports.WebSocket=r,exports.defaultBinaryType="arraybuffer",exports.nextTick=o,exports.usingBrowserWebSocket=!0;
2
+ //# sourceMappingURL=websocket-constructor.browser.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"websocket-constructor.browser.js","sources":["../../../../../../node_modules/engine.io-client/build/esm/transports/websocket-constructor.browser.js"],"sourcesContent":["import { globalThisShim as globalThis } from \"../globalThis.js\";\nexport const nextTick = (() => {\n const isPromiseAvailable = typeof Promise === \"function\" && typeof Promise.resolve === \"function\";\n if (isPromiseAvailable) {\n return cb => Promise.resolve().then(cb);\n }\n else {\n return (cb, setTimeoutFn) => setTimeoutFn(cb, 0);\n }\n})();\nexport const WebSocket = globalThis.WebSocket || globalThis.MozWebSocket;\nexport const usingBrowserWebSocket = true;\nexport const defaultBinaryType = \"arraybuffer\";\n"],"names":["nextTick","Promise","resolve","cb","then","setTimeoutFn","WebSocket","globalThis","globalThisShim","MozWebSocket"],"mappings":"8GACaA,EACqC,mBAAZC,SAAqD,mBAApBA,QAAQC,QAEhE,SAAAC,GAAE,OAAIF,QAAQC,UAAUE,KAAKD,EAAG,EAGhC,SAACA,EAAIE,GAAY,OAAKA,EAAaF,EAAI,EAAE,EAG3CG,EAAYC,EAAUC,eAACF,WAAaC,EAAAA,eAAWE,2DAE3B,gEADI"}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../../../_virtual/_rollupPluginBabelHelpers.js"),t=require("../transport.js"),s=require("../contrib/parseqs.js"),r=require("../contrib/yeast.js"),o=require("../util.js"),i=require("./websocket-constructor.browser.js"),n=require("../../../../engine.io-parser/build/esm/encodePacket.browser.js");require("../../../../engine.io-parser/build/esm/commons.js"),require("../../../../engine.io-parser/build/esm/contrib/base64-arraybuffer.js");var a="undefined"!=typeof navigator&&"string"==typeof navigator.product&&"reactnative"===navigator.product.toLowerCase(),c=function(t){e.inherits(u,t);var c=e.createSuper(u);function u(t){var s;return e.classCallCheck(this,u),(s=c.call(this,t)).supportsBinary=!t.forceBase64,s}return e.createClass(u,[{key:"name",get:function(){return"websocket"}},{key:"doOpen",value:function(){if(this.check()){var e=this.uri(),t=this.opts.protocols,s=a?{}:o.pick(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(s.headers=this.opts.extraHeaders);try{this.ws=i.usingBrowserWebSocket&&!a?t?new i.WebSocket(e,t):new i.WebSocket(e):new i.WebSocket(e,t,s)}catch(e){return this.emitReserved("error",e)}this.ws.binaryType=this.socket.binaryType||i.defaultBinaryType,this.addEventListeners()}}},{key:"addEventListeners",value:function(){var e=this;this.ws.onopen=function(){e.opts.autoUnref&&e.ws._socket.unref(),e.onOpen()},this.ws.onclose=function(t){return e.onClose({description:"websocket connection closed",context:t})},this.ws.onmessage=function(t){return e.onData(t.data)},this.ws.onerror=function(t){return e.onError("websocket error",t)}}},{key:"write",value:function(e){var t=this;this.writable=!1;for(var s=function(s){var r=e[s],o=s===e.length-1;n.default(r,t.supportsBinary,(function(e){try{i.usingBrowserWebSocket&&t.ws.send(e)}catch(e){}o&&i.nextTick((function(){t.writable=!0,t.emitReserved("drain")}),t.setTimeoutFn)}))},r=0;r<e.length;r++)s(r)}},{key:"doClose",value:function(){void 0!==this.ws&&(this.ws.close(),this.ws=null)}},{key:"uri",value:function(){var e=this.query||{},t=this.opts.secure?"wss":"ws",o="";this.opts.port&&("wss"===t&&443!==Number(this.opts.port)||"ws"===t&&80!==Number(this.opts.port))&&(o=":"+this.opts.port),this.opts.timestampRequests&&(e[this.opts.timestampParam]=r.yeast()),this.supportsBinary||(e.b64=1);var i=s.encode(e);return t+"://"+(-1!==this.opts.hostname.indexOf(":")?"["+this.opts.hostname+"]":this.opts.hostname)+o+this.opts.path+(i.length?"?"+i:"")}},{key:"check",value:function(){return!!i.WebSocket}}]),u}(t.Transport);exports.WS=c;
2
+ //# sourceMappingURL=websocket.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"websocket.js","sources":["../../../../../../node_modules/engine.io-client/build/esm/transports/websocket.js"],"sourcesContent":["import { Transport } from \"../transport.js\";\nimport { encode } from \"../contrib/parseqs.js\";\nimport { yeast } from \"../contrib/yeast.js\";\nimport { pick } from \"../util.js\";\nimport { defaultBinaryType, nextTick, usingBrowserWebSocket, WebSocket } from \"./websocket-constructor.js\";\nimport { encodePacket } from \"engine.io-parser\";\n// detect ReactNative environment\nconst isReactNative = typeof navigator !== \"undefined\" &&\n typeof navigator.product === \"string\" &&\n navigator.product.toLowerCase() === \"reactnative\";\nexport class WS extends Transport {\n /**\n * WebSocket transport constructor.\n *\n * @api {Object} connection options\n * @api public\n */\n constructor(opts) {\n super(opts);\n this.supportsBinary = !opts.forceBase64;\n }\n /**\n * Transport name.\n *\n * @api public\n */\n get name() {\n return \"websocket\";\n }\n /**\n * Opens socket.\n *\n * @api private\n */\n doOpen() {\n if (!this.check()) {\n // let probe timeout\n return;\n }\n const uri = this.uri();\n const protocols = this.opts.protocols;\n // React Native only supports the 'headers' option, and will print a warning if anything else is passed\n const opts = isReactNative\n ? {}\n : pick(this.opts, \"agent\", \"perMessageDeflate\", \"pfx\", \"key\", \"passphrase\", \"cert\", \"ca\", \"ciphers\", \"rejectUnauthorized\", \"localAddress\", \"protocolVersion\", \"origin\", \"maxPayload\", \"family\", \"checkServerIdentity\");\n if (this.opts.extraHeaders) {\n opts.headers = this.opts.extraHeaders;\n }\n try {\n this.ws =\n usingBrowserWebSocket && !isReactNative\n ? protocols\n ? new WebSocket(uri, protocols)\n : new WebSocket(uri)\n : new WebSocket(uri, protocols, opts);\n }\n catch (err) {\n return this.emitReserved(\"error\", err);\n }\n this.ws.binaryType = this.socket.binaryType || defaultBinaryType;\n this.addEventListeners();\n }\n /**\n * Adds event listeners to the socket\n *\n * @api private\n */\n addEventListeners() {\n this.ws.onopen = () => {\n if (this.opts.autoUnref) {\n this.ws._socket.unref();\n }\n this.onOpen();\n };\n this.ws.onclose = closeEvent => this.onClose({\n description: \"websocket connection closed\",\n context: closeEvent\n });\n this.ws.onmessage = ev => this.onData(ev.data);\n this.ws.onerror = e => this.onError(\"websocket error\", e);\n }\n /**\n * Writes data to socket.\n *\n * @param {Array} array of packets.\n * @api private\n */\n write(packets) {\n this.writable = false;\n // encodePacket efficient as it uses WS framing\n // no need for encodePayload\n for (let i = 0; i < packets.length; i++) {\n const packet = packets[i];\n const lastPacket = i === packets.length - 1;\n encodePacket(packet, this.supportsBinary, data => {\n // always create a new object (GH-437)\n const opts = {};\n if (!usingBrowserWebSocket) {\n if (packet.options) {\n opts.compress = packet.options.compress;\n }\n if (this.opts.perMessageDeflate) {\n const len = \n // @ts-ignore\n \"string\" === typeof data ? Buffer.byteLength(data) : data.length;\n if (len < this.opts.perMessageDeflate.threshold) {\n opts.compress = false;\n }\n }\n }\n // Sometimes the websocket has already been closed but the browser didn't\n // have a chance of informing us about it yet, in that case send will\n // throw an error\n try {\n if (usingBrowserWebSocket) {\n // TypeError is thrown when passing the second argument on Safari\n this.ws.send(data);\n }\n else {\n this.ws.send(data, opts);\n }\n }\n catch (e) {\n }\n if (lastPacket) {\n // fake drain\n // defer to next tick to allow Socket to clear writeBuffer\n nextTick(() => {\n this.writable = true;\n this.emitReserved(\"drain\");\n }, this.setTimeoutFn);\n }\n });\n }\n }\n /**\n * Closes socket.\n *\n * @api private\n */\n doClose() {\n if (typeof this.ws !== \"undefined\") {\n this.ws.close();\n this.ws = null;\n }\n }\n /**\n * Generates uri for connection.\n *\n * @api private\n */\n uri() {\n let query = this.query || {};\n const schema = this.opts.secure ? \"wss\" : \"ws\";\n let port = \"\";\n // avoid port if default for schema\n if (this.opts.port &&\n ((\"wss\" === schema && Number(this.opts.port) !== 443) ||\n (\"ws\" === schema && Number(this.opts.port) !== 80))) {\n port = \":\" + this.opts.port;\n }\n // append timestamp to URI\n if (this.opts.timestampRequests) {\n query[this.opts.timestampParam] = yeast();\n }\n // communicate binary support capabilities\n if (!this.supportsBinary) {\n query.b64 = 1;\n }\n const encodedQuery = encode(query);\n const ipv6 = this.opts.hostname.indexOf(\":\") !== -1;\n return (schema +\n \"://\" +\n (ipv6 ? \"[\" + this.opts.hostname + \"]\" : this.opts.hostname) +\n port +\n this.opts.path +\n (encodedQuery.length ? \"?\" + encodedQuery : \"\"));\n }\n /**\n * Feature detection for WebSocket.\n *\n * @return {Boolean} whether this transport is available.\n * @api public\n */\n check() {\n return !!WebSocket;\n }\n}\n"],"names":["isReactNative","navigator","product","toLowerCase","WS","_Transport","_inherits","_super","_createSuper","opts","_this","_classCallCheck","this","call","supportsBinary","forceBase64","_createClass","createClass","key","get","value","check","uri","protocols","pick","extraHeaders","headers","ws","usingBrowserWebSocket","WebSocket","err","emitReserved","binaryType","socket","defaultBinaryType","addEventListeners","_this2","onopen","autoUnref","_socket","unref","onOpen","onclose","closeEvent","onClose","description","context","onmessage","ev","onData","data","onerror","e","onError","packets","_this3","writable","_loop","i","packet","lastPacket","length","encodePacket","send","nextTick","setTimeoutFn","close","query","schema","secure","port","Number","timestampRequests","timestampParam","yeast","b64","encodedQuery","encode","hostname","indexOf","path","Transport"],"mappings":"4gBAOA,IAAMA,EAAqC,oBAAdC,WACI,iBAAtBA,UAAUC,SACmB,gBAApCD,UAAUC,QAAQC,cACTC,EAAE,SAAAC,GAAAC,WAAAF,EAAAC,GAAA,IAAAE,EAAAC,cAAAJ,GAOX,SAAAA,EAAYK,GAAM,IAAAC,EAE0B,OAF1BC,iBAAAC,KAAAR,IACdM,EAAAH,EAAAM,KAAAD,KAAMH,IACDK,gBAAkBL,EAAKM,YAAYL,CAC5C,CAsKC,OArKDM,EAAAC,YAAAb,EAAA,CAAA,CAAAc,IAAA,OAAAC,IAKA,WACI,MAAO,WACX,GACA,CAAAD,IAAA,SAAAE,MAKA,WACI,GAAKR,KAAKS,QAAV,CAIA,IAAMC,EAAMV,KAAKU,MACXC,EAAYX,KAAKH,KAAKc,UAEtBd,EAAOT,EACP,CAAA,EACAwB,EAAIA,KAACZ,KAAKH,KAAM,QAAS,oBAAqB,MAAO,MAAO,aAAc,OAAQ,KAAM,UAAW,qBAAsB,eAAgB,kBAAmB,SAAU,aAAc,SAAU,uBAChMG,K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,EA2Cb,GACA,CAAAxC,IAAA,UAAAE,MAKA,gBAC2B,IAAZR,KAAKe,KACZf,KAAKe,GAAGuC,QACRtD,KAAKe,GAAK,KAElB,GACA,CAAAT,IAAA,MAAAE,MAKA,WACI,IAAI+C,EAAQvD,KAAKuD,OAAS,GACpBC,EAASxD,KAAKH,KAAK4D,OAAS,MAAQ,KACtCC,EAAO,GAEP1D,KAAKH,KAAK6D,OACR,QAAUF,GAAqC,MAA3BG,OAAO3D,KAAKH,KAAK6D,OAClC,OAASF,GAAqC,KAA3BG,OAAO3D,KAAKH,KAAK6D,SACzCA,EAAO,IAAM1D,KAAKH,KAAK6D,MAGvB1D,KAAKH,KAAK+D,oBACVL,EAAMvD,KAAKH,KAAKgE,gBAAkBC,EAAKA,SAGtC9D,KAAKE,iBACNqD,EAAMQ,IAAM,GAEhB,IAAMC,EAAeC,SAAOV,GAE5B,OAAQC,EACJ,QAF8C,IAArCxD,KAAKH,KAAKqE,SAASC,QAAQ,KAG5B,IAAMnE,KAAKH,KAAKqE,SAAW,IAAMlE,KAAKH,KAAKqE,UACnDR,EACA1D,KAAKH,KAAKuE,MACTJ,EAAaf,OAAS,IAAMe,EAAe,GACpD,GACA,CAAA1D,IAAA,QAAAE,MAMA,WACI,QAASS,EAAAA,SACb,KAACzB,CAAA,CAhLU,CAAS6E,EAASA"}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../contrib/has-cors.js"),t=require("../globalThis.browser.js");exports.XHR=function(r){var i=r.xdomain;try{if("undefined"!=typeof XMLHttpRequest&&(!i||e.hasCORS))return new XMLHttpRequest}catch(e){}if(!i)try{return new(t.globalThisShim[["Active"].concat("Object").join("X")])("Microsoft.XMLHTTP")}catch(e){}};
2
+ //# sourceMappingURL=xmlhttprequest.browser.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"xmlhttprequest.browser.js","sources":["../../../../../../node_modules/engine.io-client/build/esm/transports/xmlhttprequest.browser.js"],"sourcesContent":["// browser shim for xmlhttprequest module\nimport { hasCORS } from \"../contrib/has-cors.js\";\nimport { globalThisShim as globalThis } from \"../globalThis.js\";\nexport function XHR(opts) {\n const xdomain = opts.xdomain;\n // XMLHttpRequest can be disabled on IE\n try {\n if (\"undefined\" !== typeof XMLHttpRequest && (!xdomain || hasCORS)) {\n return new XMLHttpRequest();\n }\n }\n catch (e) { }\n if (!xdomain) {\n try {\n return new globalThis[[\"Active\"].concat(\"Object\").join(\"X\")](\"Microsoft.XMLHTTP\");\n }\n catch (e) { }\n }\n}\n"],"names":["opts","xdomain","XMLHttpRequest","hasCORS","e","globalThis","globalThisShim","concat","join"],"mappings":"8JAGO,SAAaA,GAChB,IAAMC,EAAUD,EAAKC,QAErB,IACI,GAAI,oBAAuBC,kBAAoBD,GAAWE,EAAOA,SAC7D,OAAO,IAAID,cAGP,CAAZ,MAAOE,GAAK,CACZ,IAAKH,EACD,IACI,OAAO,IAAII,EAAUC,eAAC,CAAC,UAAUC,OAAO,UAAUC,KAAK,OAAM,oBAErD,CAAZ,MAAOJ,GAAK,CAEpB"}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./globalThis.browser.js");var t=setTimeout,i=clearTimeout;exports.byteLength=function(e){return"string"==typeof e?function(e){for(var t=0,i=0,r=0,n=e.length;r<n;r++)(t=e.charCodeAt(r))<128?i+=1:t<2048?i+=2:t<55296||t>=57344?i+=3:(r++,i+=4);return i}(e):Math.ceil(1.33*(e.byteLength||e.size))},exports.installTimerFunctions=function(r,n){n.useNativeTimers?(r.setTimeoutFn=t.bind(e.globalThisShim),r.clearTimeoutFn=i.bind(e.globalThisShim)):(r.setTimeoutFn=setTimeout.bind(e.globalThisShim),r.clearTimeoutFn=clearTimeout.bind(e.globalThisShim))},exports.pick=function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),r=1;r<t;r++)i[r-1]=arguments[r];return i.reduce((function(t,i){return e.hasOwnProperty(i)&&(t[i]=e[i]),t}),{})};
2
+ //# sourceMappingURL=util.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"util.js","sources":["../../../../../node_modules/engine.io-client/build/esm/util.js"],"sourcesContent":["import { globalThisShim as globalThis } from \"./globalThis.js\";\nexport function pick(obj, ...attr) {\n return attr.reduce((acc, k) => {\n if (obj.hasOwnProperty(k)) {\n acc[k] = obj[k];\n }\n return acc;\n }, {});\n}\n// Keep a reference to the real timeout functions so they can be used when overridden\nconst NATIVE_SET_TIMEOUT = setTimeout;\nconst NATIVE_CLEAR_TIMEOUT = clearTimeout;\nexport function installTimerFunctions(obj, opts) {\n if (opts.useNativeTimers) {\n obj.setTimeoutFn = NATIVE_SET_TIMEOUT.bind(globalThis);\n obj.clearTimeoutFn = NATIVE_CLEAR_TIMEOUT.bind(globalThis);\n }\n else {\n obj.setTimeoutFn = setTimeout.bind(globalThis);\n obj.clearTimeoutFn = clearTimeout.bind(globalThis);\n }\n}\n// base64 encoded buffers are about 33% bigger (https://en.wikipedia.org/wiki/Base64)\nconst BASE64_OVERHEAD = 1.33;\n// we could also have used `new Blob([obj]).size`, but it isn't supported in IE9\nexport function byteLength(obj) {\n if (typeof obj === \"string\") {\n return utf8Length(obj);\n }\n // arraybuffer or blob\n return Math.ceil((obj.byteLength || obj.size) * BASE64_OVERHEAD);\n}\nfunction utf8Length(str) {\n let c = 0, length = 0;\n for (let i = 0, l = str.length; i < l; i++) {\n c = str.charCodeAt(i);\n if (c < 0x80) {\n length += 1;\n }\n else if (c < 0x800) {\n length += 2;\n }\n else if (c < 0xd800 || c >= 0xe000) {\n length += 3;\n }\n else {\n i++;\n length += 4;\n }\n }\n return length;\n}\n"],"names":["NATIVE_SET_TIMEOUT","setTimeout","NATIVE_CLEAR_TIMEOUT","clearTimeout","obj","str","c","length","i","l","charCodeAt","utf8Length","Math","ceil","byteLength","size","opts","useNativeTimers","setTimeoutFn","bind","globalThis","globalThisShim","clearTimeoutFn","_len","arguments","attr","Array","_key","reduce","acc","k","hasOwnProperty"],"mappings":"6GAUA,IAAMA,EAAqBC,WACrBC,EAAuBC,gCActB,SAAoBC,GACvB,MAAmB,iBAARA,EAMf,SAAoBC,GAEhB,IADA,IAAIC,EAAI,EAAGC,EAAS,EACXC,EAAI,EAAGC,EAAIJ,EAAIE,OAAQC,EAAIC,EAAGD,KACnCF,EAAID,EAAIK,WAAWF,IACX,IACJD,GAAU,EAELD,EAAI,KACTC,GAAU,EAELD,EAAI,OAAUA,GAAK,MACxBC,GAAU,GAGVC,IACAD,GAAU,GAGlB,OAAOA,CACX,CAxBeI,CAAWP,GAGfQ,KAAKC,KAPQ,MAOFT,EAAIU,YAAcV,EAAIW,MAC5C,gCAnBO,SAA+BX,EAAKY,GACnCA,EAAKC,iBACLb,EAAIc,aAAelB,EAAmBmB,KAAKC,EAAUC,gBACrDjB,EAAIkB,eAAiBpB,EAAqBiB,KAAKC,EAAUC,kBAGzDjB,EAAIc,aAAejB,WAAWkB,KAAKC,EAAUC,gBAC7CjB,EAAIkB,eAAiBnB,aAAagB,KAAKC,EAAUC,gBAEzD,eApBO,SAAcjB,GAAc,IAAA,IAAAmB,EAAAC,UAAAjB,OAANkB,EAAI,IAAAC,MAAAH,EAAA,EAAAA,EAAA,EAAA,GAAAI,EAAA,EAAAA,EAAAJ,EAAAI,IAAJF,EAAIE,EAAA,GAAAH,UAAAG,GAC7B,OAAOF,EAAKG,QAAO,SAACC,EAAKC,GAIrB,OAHI1B,EAAI2B,eAAeD,KACnBD,EAAIC,GAAK1B,EAAI0B,IAEVD,CACV,GAAE,CAAE,EACT"}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=Object.create(null);e.open="0",e.close="1",e.ping="2",e.pong="3",e.message="4",e.upgrade="5",e.noop="6";var r=Object.create(null);Object.keys(e).forEach((function(t){r[e[t]]=t}));exports.ERROR_PACKET={type:"error",data:"parser error"},exports.PACKET_TYPES=e,exports.PACKET_TYPES_REVERSE=r;
2
+ //# sourceMappingURL=commons.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"commons.js","sources":["../../../../../node_modules/engine.io-parser/build/esm/commons.js"],"sourcesContent":["const PACKET_TYPES = Object.create(null); // no Map = no polyfill\nPACKET_TYPES[\"open\"] = \"0\";\nPACKET_TYPES[\"close\"] = \"1\";\nPACKET_TYPES[\"ping\"] = \"2\";\nPACKET_TYPES[\"pong\"] = \"3\";\nPACKET_TYPES[\"message\"] = \"4\";\nPACKET_TYPES[\"upgrade\"] = \"5\";\nPACKET_TYPES[\"noop\"] = \"6\";\nconst PACKET_TYPES_REVERSE = Object.create(null);\nObject.keys(PACKET_TYPES).forEach(key => {\n PACKET_TYPES_REVERSE[PACKET_TYPES[key]] = key;\n});\nconst ERROR_PACKET = { type: \"error\", data: \"parser error\" };\nexport { PACKET_TYPES, PACKET_TYPES_REVERSE, ERROR_PACKET };\n"],"names":["PACKET_TYPES","Object","create","PACKET_TYPES_REVERSE","keys","forEach","key","type","data"],"mappings":"oEAAMA,IAAAA,EAAeC,OAAOC,OAAO,MACnCF,EAAmB,KAAI,IACvBA,EAAoB,MAAI,IACxBA,EAAmB,KAAI,IACvBA,EAAmB,KAAI,IACvBA,EAAsB,QAAI,IAC1BA,EAAsB,QAAI,IAC1BA,EAAmB,KAAI,IACvB,IAAMG,EAAuBF,OAAOC,OAAO,MAC3CD,OAAOG,KAAKJ,GAAcK,SAAQ,SAAAC,GAC9BH,EAAqBH,EAAaM,IAAQA,CAC9C,yBACqB,CAAEC,KAAM,QAASC,KAAM"}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r="undefined"==typeof Uint8Array?[]:new Uint8Array(256),t=0;t<e.length;t++)r[e.charCodeAt(t)]=t;exports.decode=function(e){var t,n,o,a,d,h=.75*e.length,c=e.length,A=0;"="===e[e.length-1]&&(h--,"="===e[e.length-2]&&h--);var f=new ArrayBuffer(h),i=new Uint8Array(f);for(t=0;t<c;t+=4)n=r[e.charCodeAt(t)],o=r[e.charCodeAt(t+1)],a=r[e.charCodeAt(t+2)],d=r[e.charCodeAt(t+3)],i[A++]=n<<2|o>>4,i[A++]=(15&o)<<4|a>>2,i[A++]=(3&a)<<6|63&d;return f};
2
+ //# sourceMappingURL=base64-arraybuffer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base64-arraybuffer.js","sources":["../../../../../../node_modules/engine.io-parser/build/esm/contrib/base64-arraybuffer.js"],"sourcesContent":["const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\n// Use a lookup table to find the index.\nconst lookup = typeof Uint8Array === 'undefined' ? [] : new Uint8Array(256);\nfor (let i = 0; i < chars.length; i++) {\n lookup[chars.charCodeAt(i)] = i;\n}\nexport const encode = (arraybuffer) => {\n let bytes = new Uint8Array(arraybuffer), i, len = bytes.length, base64 = '';\n for (i = 0; i < len; i += 3) {\n base64 += chars[bytes[i] >> 2];\n base64 += chars[((bytes[i] & 3) << 4) | (bytes[i + 1] >> 4)];\n base64 += chars[((bytes[i + 1] & 15) << 2) | (bytes[i + 2] >> 6)];\n base64 += chars[bytes[i + 2] & 63];\n }\n if (len % 3 === 2) {\n base64 = base64.substring(0, base64.length - 1) + '=';\n }\n else if (len % 3 === 1) {\n base64 = base64.substring(0, base64.length - 2) + '==';\n }\n return base64;\n};\nexport const decode = (base64) => {\n let bufferLength = base64.length * 0.75, len = base64.length, i, p = 0, encoded1, encoded2, encoded3, encoded4;\n if (base64[base64.length - 1] === '=') {\n bufferLength--;\n if (base64[base64.length - 2] === '=') {\n bufferLength--;\n }\n }\n const arraybuffer = new ArrayBuffer(bufferLength), bytes = new Uint8Array(arraybuffer);\n for (i = 0; i < len; i += 4) {\n encoded1 = lookup[base64.charCodeAt(i)];\n encoded2 = lookup[base64.charCodeAt(i + 1)];\n encoded3 = lookup[base64.charCodeAt(i + 2)];\n encoded4 = lookup[base64.charCodeAt(i + 3)];\n bytes[p++] = (encoded1 << 2) | (encoded2 >> 4);\n bytes[p++] = ((encoded2 & 15) << 4) | (encoded3 >> 2);\n bytes[p++] = ((encoded3 & 3) << 6) | (encoded4 & 63);\n }\n return arraybuffer;\n};\n"],"names":["chars","lookup","Uint8Array","i","length","charCodeAt","base64","encoded1","encoded2","encoded3","encoded4","bufferLength","len","p","arraybuffer","ArrayBuffer","bytes"],"mappings":"oEAGA,IAHA,IAAMA,EAAQ,mEAERC,EAA+B,oBAAfC,WAA6B,GAAK,IAAIA,WAAW,KAC9DC,EAAI,EAAGA,EAAIH,EAAMI,OAAQD,IAC9BF,EAAOD,EAAMK,WAAWF,IAAMA,iBAkBZ,SAACG,GACnB,IAA8DH,EAAUI,EAAUC,EAAUC,EAAUC,EAAlGC,EAA+B,IAAhBL,EAAOF,OAAeQ,EAAMN,EAAOF,OAAWS,EAAI,EACnC,MAA9BP,EAAOA,EAAOF,OAAS,KACvBO,IACkC,MAA9BL,EAAOA,EAAOF,OAAS,IACvBO,KAGR,IAAMG,EAAc,IAAIC,YAAYJ,GAAeK,EAAQ,IAAId,WAAWY,GAC1E,IAAKX,EAAI,EAAGA,EAAIS,EAAKT,GAAK,EACtBI,EAAWN,EAAOK,EAAOD,WAAWF,IACpCK,EAAWP,EAAOK,EAAOD,WAAWF,EAAI,IACxCM,EAAWR,EAAOK,EAAOD,WAAWF,EAAI,IACxCO,EAAWT,EAAOK,EAAOD,WAAWF,EAAI,IACxCa,EAAMH,KAAQN,GAAY,EAAMC,GAAY,EAC5CQ,EAAMH,MAAoB,GAAXL,IAAkB,EAAMC,GAAY,EACnDO,EAAMH,MAAoB,EAAXJ,IAAiB,EAAiB,GAAXC,EAE1C,OAAOI,CACX"}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./commons.js"),r=require("./contrib/base64-arraybuffer.js"),t="function"==typeof ArrayBuffer,a=function(e,a){if(t){var s=r.decode(e);return n(s,a)}return{base64:!0,data:e}},n=function(e,r){return"blob"===r&&e instanceof ArrayBuffer?new Blob([e]):e};exports.default=function(r,t){if("string"!=typeof r)return{type:"message",data:n(r,t)};var s=r.charAt(0);return"b"===s?{type:"message",data:a(r.substring(1),t)}:e.PACKET_TYPES_REVERSE[s]?r.length>1?{type:e.PACKET_TYPES_REVERSE[s],data:r.substring(1)}:{type:e.PACKET_TYPES_REVERSE[s]}:e.ERROR_PACKET};
2
+ //# sourceMappingURL=decodePacket.browser.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"decodePacket.browser.js","sources":["../../../../../node_modules/engine.io-parser/build/esm/decodePacket.browser.js"],"sourcesContent":["import { ERROR_PACKET, PACKET_TYPES_REVERSE } from \"./commons.js\";\nimport { decode } from \"./contrib/base64-arraybuffer.js\";\nconst withNativeArrayBuffer = typeof ArrayBuffer === \"function\";\nconst decodePacket = (encodedPacket, binaryType) => {\n if (typeof encodedPacket !== \"string\") {\n return {\n type: \"message\",\n data: mapBinary(encodedPacket, binaryType)\n };\n }\n const type = encodedPacket.charAt(0);\n if (type === \"b\") {\n return {\n type: \"message\",\n data: decodeBase64Packet(encodedPacket.substring(1), binaryType)\n };\n }\n const packetType = PACKET_TYPES_REVERSE[type];\n if (!packetType) {\n return ERROR_PACKET;\n }\n return encodedPacket.length > 1\n ? {\n type: PACKET_TYPES_REVERSE[type],\n data: encodedPacket.substring(1)\n }\n : {\n type: PACKET_TYPES_REVERSE[type]\n };\n};\nconst decodeBase64Packet = (data, binaryType) => {\n if (withNativeArrayBuffer) {\n const decoded = decode(data);\n return mapBinary(decoded, binaryType);\n }\n else {\n return { base64: true, data }; // fallback for old browsers\n }\n};\nconst mapBinary = (data, binaryType) => {\n switch (binaryType) {\n case \"blob\":\n return data instanceof ArrayBuffer ? new Blob([data]) : data;\n case \"arraybuffer\":\n default:\n return data; // assuming the data is already an ArrayBuffer\n }\n};\nexport default decodePacket;\n"],"names":["withNativeArrayBuffer","ArrayBuffer","decodeBase64Packet","data","binaryType","decoded","decode","mapBinary","base64","Blob","encodedPacket","type","charAt","substring","PACKET_TYPES_REVERSE","length","ERROR_PACKET"],"mappings":"+IAEMA,EAA+C,mBAAhBC,YA4B/BC,EAAqB,SAACC,EAAMC,GAC9B,GAAIJ,EAAuB,CACvB,IAAMK,EAAUC,SAAOH,GACvB,OAAOI,EAAUF,EAASD,EAC9B,CAEI,MAAO,CAAEI,QAAQ,EAAML,KAAAA,EAE/B,EACMI,EAAY,SAACJ,EAAMC,GACrB,MACS,SADDA,GAEOD,aAAgBF,YAAc,IAAIQ,KAAK,CAACN,IAGxCA,CAEnB,kBA5CqB,SAACO,EAAeN,GACjC,GAA6B,iBAAlBM,EACP,MAAO,CACHC,KAAM,UACNR,KAAMI,EAAUG,EAAeN,IAGvC,IAAMO,EAAOD,EAAcE,OAAO,GAClC,MAAa,MAATD,EACO,CACHA,KAAM,UACNR,KAAMD,EAAmBQ,EAAcG,UAAU,GAAIT,IAG1CU,uBAAqBH,GAIjCD,EAAcK,OAAS,EACxB,CACEJ,KAAMG,EAAoBA,qBAACH,GAC3BR,KAAMO,EAAcG,UAAU,IAEhC,CACEF,KAAMG,EAAoBA,qBAACH,IARxBK,cAUf"}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./commons.js"),r="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===Object.prototype.toString.call(Blob),t="function"==typeof ArrayBuffer,o=function(e,r){var t=new FileReader;return t.onload=function(){var e=t.result.split(",")[1];r("b"+e)},t.readAsDataURL(e)};exports.default=function(n,f,a){var u,i=n.type,c=n.data;return r&&c instanceof Blob?f?a(c):o(c,a):t&&(c instanceof ArrayBuffer||(u=c,"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(u):u&&u.buffer instanceof ArrayBuffer))?f?a(c):o(new Blob([c]),a):a(e.PACKET_TYPES[i]+(c||""))};
2
+ //# sourceMappingURL=encodePacket.browser.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"encodePacket.browser.js","sources":["../../../../../node_modules/engine.io-parser/build/esm/encodePacket.browser.js"],"sourcesContent":["import { PACKET_TYPES } from \"./commons.js\";\nconst withNativeBlob = typeof Blob === \"function\" ||\n (typeof Blob !== \"undefined\" &&\n Object.prototype.toString.call(Blob) === \"[object BlobConstructor]\");\nconst withNativeArrayBuffer = typeof ArrayBuffer === \"function\";\n// ArrayBuffer.isView method is not defined in IE10\nconst isView = obj => {\n return typeof ArrayBuffer.isView === \"function\"\n ? ArrayBuffer.isView(obj)\n : obj && obj.buffer instanceof ArrayBuffer;\n};\nconst encodePacket = ({ type, data }, supportsBinary, callback) => {\n if (withNativeBlob && data instanceof Blob) {\n if (supportsBinary) {\n return callback(data);\n }\n else {\n return encodeBlobAsBase64(data, callback);\n }\n }\n else if (withNativeArrayBuffer &&\n (data instanceof ArrayBuffer || isView(data))) {\n if (supportsBinary) {\n return callback(data);\n }\n else {\n return encodeBlobAsBase64(new Blob([data]), callback);\n }\n }\n // plain string\n return callback(PACKET_TYPES[type] + (data || \"\"));\n};\nconst encodeBlobAsBase64 = (data, callback) => {\n const fileReader = new FileReader();\n fileReader.onload = function () {\n const content = fileReader.result.split(\",\")[1];\n callback(\"b\" + content);\n };\n return fileReader.readAsDataURL(data);\n};\nexport default encodePacket;\n"],"names":["withNativeBlob","Blob","Object","prototype","toString","call","withNativeArrayBuffer","ArrayBuffer","encodeBlobAsBase64","data","callback","fileReader","FileReader","onload","content","result","split","readAsDataURL","supportsBinary","obj","type","isView","buffer","PACKET_TYPES"],"mappings":"kGACMA,EAAiC,mBAATC,MACT,oBAATA,MACqC,6BAAzCC,OAAOC,UAAUC,SAASC,KAAKJ,MACjCK,EAA+C,mBAAhBC,YA4B/BC,EAAqB,SAACC,EAAMC,GAC9B,IAAMC,EAAa,IAAIC,WAKvB,OAJAD,EAAWE,OAAS,WAChB,IAAMC,EAAUH,EAAWI,OAAOC,MAAM,KAAK,GAC7CN,EAAS,IAAMI,IAEZH,EAAWM,cAAcR,EACpC,kBA5BqB,WAAiBS,EAAgBR,GAAa,IALpDS,EAKSC,IAAAA,KAAMX,IAAAA,KAC1B,OAAIT,GAAkBS,aAAgBR,KAC9BiB,EACOR,EAASD,GAGTD,EAAmBC,EAAMC,GAG/BJ,IACJG,aAAgBF,cAfVY,EAegCV,EAdN,mBAAvBF,YAAYc,OACpBd,YAAYc,OAAOF,GACnBA,GAAOA,EAAIG,kBAAkBf,cAa3BW,EACOR,EAASD,GAGTD,EAAmB,IAAIP,KAAK,CAACQ,IAAQC,GAI7CA,EAASa,EAAAA,aAAaH,IAASX,GAAQ,IAClD"}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./encodePacket.browser.js"),r=require("./decodePacket.browser.js"),o=String.fromCharCode(30);exports.encodePacket=e.default,exports.decodePacket=r.default,exports.decodePayload=function(e,t){for(var a=e.split(o),c=[],d=0;d<a.length;d++){var n=r.default(a[d],t);if(c.push(n),"error"===n.type)break}return c},exports.encodePayload=function(r,t){var a=r.length,c=new Array(a),d=0;r.forEach((function(r,n){e.default(r,!1,(function(e){c[n]=e,++d===a&&t(c.join(o))}))}))},exports.protocol=4;
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../../../node_modules/engine.io-parser/build/esm/index.js"],"sourcesContent":["import encodePacket from \"./encodePacket.js\";\nimport decodePacket from \"./decodePacket.js\";\nconst SEPARATOR = String.fromCharCode(30); // see https://en.wikipedia.org/wiki/Delimiter#ASCII_delimited_text\nconst encodePayload = (packets, callback) => {\n // some packets may be added to the array while encoding, so the initial length must be saved\n const length = packets.length;\n const encodedPackets = new Array(length);\n let count = 0;\n packets.forEach((packet, i) => {\n // force base64 encoding for binary packets\n encodePacket(packet, false, encodedPacket => {\n encodedPackets[i] = encodedPacket;\n if (++count === length) {\n callback(encodedPackets.join(SEPARATOR));\n }\n });\n });\n};\nconst decodePayload = (encodedPayload, binaryType) => {\n const encodedPackets = encodedPayload.split(SEPARATOR);\n const packets = [];\n for (let i = 0; i < encodedPackets.length; i++) {\n const decodedPacket = decodePacket(encodedPackets[i], binaryType);\n packets.push(decodedPacket);\n if (decodedPacket.type === \"error\") {\n break;\n }\n }\n return packets;\n};\nexport const protocol = 4;\nexport { encodePacket, encodePayload, decodePacket, decodePayload };\n"],"names":["SEPARATOR","String","fromCharCode","encodedPayload","binaryType","encodedPackets","split","packets","i","length","decodedPacket","decodePacket","push","type","callback","Array","count","forEach","packet","encodePacket","encodedPacket","join"],"mappings":"sJAEMA,EAAYC,OAAOC,aAAa,wFAgBhB,SAACC,EAAgBC,GAGnC,IAFA,IAAMC,EAAiBF,EAAeG,MAAMN,GACtCO,EAAU,GACPC,EAAI,EAAGA,EAAIH,EAAeI,OAAQD,IAAK,CAC5C,IAAME,EAAgBC,EAAAA,QAAaN,EAAeG,GAAIJ,GAEtD,GADAG,EAAQK,KAAKF,GACc,UAAvBA,EAAcG,KACd,KAER,CACA,OAAON,CACX,wBA1BsB,SAACA,EAASO,GAE5B,IAAML,EAASF,EAAQE,OACjBJ,EAAiB,IAAIU,MAAMN,GAC7BO,EAAQ,EACZT,EAAQU,SAAQ,SAACC,EAAQV,GAErBW,EAAAA,QAAaD,GAAQ,GAAO,SAAAE,GACxBf,EAAeG,GAAKY,IACdJ,IAAUP,GACZK,EAAST,EAAegB,KAAKrB,GAErC,GACJ,GACJ,mBAawB"}