hsync 0.10.0 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli.js +14 -4
- package/config.js +2 -0
- package/connection.js +1 -0
- package/dist/hsync.js +383 -0
- package/dist/hsync.min.js +2 -0
- package/dist/hsync.min.js.LICENSE.txt +10 -0
- package/hsync-web.js +5 -1
- package/package.json +6 -3
- package/webpack.config.js +19 -0
package/dist/hsync.js
ADDED
|
@@ -0,0 +1,383 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
|
|
3
|
+
* This devtool is neither made for production nor for readable output files.
|
|
4
|
+
* It uses "eval()" calls to create a separate source file in the browser devtools.
|
|
5
|
+
* If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
|
|
6
|
+
* or disable the default devtool with "devtool: false".
|
|
7
|
+
* If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
|
|
8
|
+
*/
|
|
9
|
+
/******/ (() => { // webpackBootstrap
|
|
10
|
+
/******/ var __webpack_modules__ = ({
|
|
11
|
+
|
|
12
|
+
/***/ "./config.js":
|
|
13
|
+
/*!*******************!*\
|
|
14
|
+
!*** ./config.js ***!
|
|
15
|
+
\*******************/
|
|
16
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
17
|
+
|
|
18
|
+
eval("let process = __webpack_require__.g.process || {env: {}};\n\nconst baseConfig = {\n hsyncServer: process.env.HSYNC_SERVER, // something like 'wss://mydevice.mydomain.com'\n hsyncSecret: process.env.HSYNC_SECRET, // keep it secret, keep it safe!\n localHost: process.env.LOCAL_HOST || 'localhost', // host of local server\n port: process.env.PORT || 3000, // port of local server\n hsyncBase: process.env.HSYNC_BASE || '_hs',\n keepalive: parseInt(process.env.HSYNC_KEEP_ALIVE) || 300,\n dynamicHost: process.env.HSYNC_DYNAMIC_HOST,\n defaultDynamicHost: 'https://demo.hsync.tech',\n};\n\n\nconst connections = [baseConfig];\nconst keys = Object.keys(process.env);\nkeys.forEach((k) => {\n if(k.startsWith('HSYNC_SERVER_')) {\n const name = k.substring(13);\n const value = process.env[k];\n if (name && value) {\n connections.push({\n name,\n hsyncServer: value,\n hsyncSecret: process.env['HSYNC_SECRET_' + name] || baseConfig.hsyncSecret,\n localHost: process.env['LOCAL_HOST_' + name] || baseConfig.localHost,\n port: process.env['PORT_' + name] || baseConfig.port,\n hsyncBase: process.env['HSYNC_BASE_' + name] || baseConfig.hsyncBase,\n keepalive: parseInt(process.env['HSYNC_KEEP_ALIVE_' + name]) || baseConfig.keepalive,\n dynamicHost: process.env['HSYNC_DYNAMIC_HOST_' + name],\n });\n }\n }\n})\n\nconst config = Object.assign({}, baseConfig, {connections});\n\nmodule.exports = config;\n\n//# sourceURL=webpack://hsync/./config.js?");
|
|
19
|
+
|
|
20
|
+
/***/ }),
|
|
21
|
+
|
|
22
|
+
/***/ "./connection.js":
|
|
23
|
+
/*!***********************!*\
|
|
24
|
+
!*** ./connection.js ***!
|
|
25
|
+
\***********************/
|
|
26
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
27
|
+
|
|
28
|
+
eval("const fetch = __webpack_require__(/*! isomorphic-fetch */ \"./node_modules/isomorphic-fetch/fetch-npm-browserify.js\");\nconst EventEmitter = (__webpack_require__(/*! events */ \"./node_modules/events/events.js\").EventEmitter);\nconst b64id = __webpack_require__(/*! b64id */ \"./node_modules/b64id/index.js\");\nconst debug = __webpack_require__(/*! debug */ \"./node_modules/debug/src/browser.js\")('hsync:info');\nconst debugVerbose = __webpack_require__(/*! debug */ \"./node_modules/debug/src/browser.js\")('hsync:verbose');\nconst debugError = __webpack_require__(/*! debug */ \"./node_modules/debug/src/browser.js\")('hsync:error');\nconst { createRPCPeer, createServerReplyPeer } = __webpack_require__(/*! ./lib/rpc */ \"./lib/rpc.js\");\nconst { createWebHandler, setNet: webSetNet } = __webpack_require__(/*! ./lib/web-handler */ \"./lib/web-handler.js\");\nconst { createSocketListenHandler, setNet: listenSetNet } = __webpack_require__(/*! ./lib/socket-listen-handler */ \"./lib/socket-listen-handler.js\");\n\ndebug.color = 3;\ndebugVerbose.color = 2;\ndebugError.color = 1;\n\nlet mqtt;\n\nfunction setNet(netImpl) {\n webSetNet(netImpl);\n listenSetNet(netImpl);\n}\n\nfunction setMqtt(mqttImpl) {\n mqtt = mqttImpl;\n}\n\nasync function createHsync(config) {\n let {\n hsyncServer,\n hsyncSecret,\n localHost,\n port,\n hsyncBase,\n keepalive,\n dynamicHost,\n } = config;\n\n let dynamicTimeout;\n\n if (dynamicHost) {\n const options = {\n headers: {\n 'Content-Type': 'application/json',\n },\n method: 'POST',\n body: '{}',\n };\n const resp = await fetch(`${dynamicHost}/${hsyncBase}/dyn`, options);\n const result = await resp.json();\n // console.log('resutl', result);\n if (dynamicHost.toLowerCase().startsWith('https')) {\n hsyncServer = `wss://${result.url}`;\n } else {\n hsyncServer = `ws://${result.url}`;\n }\n hsyncSecret = result.secret;\n dynamicTimeout = result.timeout;\n }\n\n const hsyncClient = {};\n hsyncClient.config = config;\n const peers = {};\n const socketListeners = {};\n const events = new EventEmitter();\n \n hsyncClient.on = events.on;\n hsyncClient.emit = events.emit;\n hsyncClient.peers = peers;\n \n let lastConnect;\n const connectURL = `${hsyncServer}${hsyncServer.endsWith('/') ? '' : '/'}${hsyncBase}`;\n const myHostName = (new URL(connectURL)).hostname;\n hsyncClient.myHostName = myHostName;\n \n debug('connecting to', connectURL, '…' );\n const mqConn = mqtt.connect(connectURL, { password: hsyncSecret, username: myHostName, keepalive });\n mqConn.myHostName = myHostName;\n hsyncClient.mqConn = mqConn;\n\n const webHandler = config.webHandler || createWebHandler({myHostName, localHost, port, mqConn});\n hsyncClient.webHandler = webHandler;\n\n mqConn.on('connect', () => {\n const now = Date.now();\n debug('connected to', myHostName, lastConnect ? (now - lastConnect) : '', lastConnect ? 'since last connect' : '');\n lastConnect = now;\n hsyncClient.emit('connected', config);\n });\n\n mqConn.on('error', (error) => {\n debugError('error on mqConn', myHostName, error.code, error);\n if ((error.code === 4) || (error.code === 5)) {\n debug('ending');\n mqConn.end();\n }\n });\n\n mqConn.on('message', (topic, message) => {\n if (!topic) {\n return;\n }\n // message is Buffer\n const [name, hostName, segment3, action, segment5] = topic.split('/');\n debugVerbose('\\n↓ MQTT' , topic);\n if (name === 'web') {\n webHandler.handleWebRequest(hostName, segment3, action, message);\n return;\n } else if (name === 'msg') {\n const from = segment3;\n if (action === 'json') {\n try {\n const msg = JSON.parse(message.toString());\n msg.from = from;\n hsyncClient.emit('json', msg);\n } catch (e) {\n debugError('error parsing json message');\n }\n } else if (action === 'ssrpc') {\n const peer = createServerReplyPeer({requestId: from, hsyncClient, methods: serverReplyMethods});\n peer.transport.receiveData(message.toString());\n }\n else if (action === 'rpc') {\n const peer = getPeer({hostName: from, temporary: true});\n peer.transport.receiveData(message.toString());\n }\n else if (action === 'socketData') {\n events.emit('socketData', from, segment5, message);\n }\n else if (action === 'socketClose') {\n events.emit('socketClose', from, segment5);\n }\n }\n\n });\n\n function getPeer({hostName, temporary, timeout = 10000}) {\n let peer = peers[host];\n if (!peer) {\n peer = createRPCPeer({hostName, hsyncClient, timeout, methods: peerMethods});\n if (temporary) {\n peer.rpcTemporary = true;\n }\n peers[host] = peer;\n }\n return peer;\n }\n\n function sendJson(host, json) {\n if (!host || !json) {\n return;\n }\n\n if (host === myHostName) {\n debugError('cannot send message to self', host);\n }\n\n if (typeof json === 'object') {\n json = JSON.stringify(json);\n } else if (typeof json === 'string') {\n try {\n json = JSON.stringify(JSON.parse(json));\n } catch(e) {\n debugError('not well formed json or object', e);\n return;\n }\n } else {\n return;\n }\n mqConn.publish(`msg/${host}/${myHostName}/json`, json);\n }\n\n function endClient(force, callback) {\n if (force) {\n mqConn.end(force);\n if (webHandler.end) {\n webHandler.end();\n }\n return;\n }\n mqConn.end(force, (a, b) => {\n if (webHandler.end) {\n webHandler.end();\n }\n if (callback) {\n callback(a, b);\n }\n })\n }\n\n function getSocketListeners () {\n return Object.keys(socketListeners).map((id) => {\n return { info: socketListeners[id].info, id };\n });\n }\n\n function addSocketListener (port, hostName, targetPort, targetHost = 'localhost') {\n const handler = createSocketListenHandler({port, hostName, targetPort, targetHost, hsyncClient});\n const id = b64id.generateId();\n socketListeners[id] = {handler, info: {port, hostName, targetPort, targetHost}, id};\n return getSocketListeners();\n }\n\n const serverReplyMethods = {\n ping: (greeting) => {\n return `${greeting} back atcha from client. ${Date.now()}`;\n },\n addSocketListener,\n getSocketListeners,\n };\n\n const peerMethods = {\n ping: (host, greeting) => {\n return `${greeting} back atcha, ${host}.`;\n },\n };\n\n hsyncClient.sendJson = sendJson;\n hsyncClient.endClient = endClient;\n hsyncClient.serverReplyMethods = serverReplyMethods;\n hsyncClient.getPeer = getPeer;\n hsyncClient.peerMethods = peerMethods;\n hsyncClient.hsyncSecret = hsyncSecret;\n hsyncClient.hsyncServer = hsyncServer;\n hsyncClient.dynamicTimeout = dynamicTimeout;\n if (hsyncServer.toLowerCase().startsWith('wss://')) {\n hsyncClient.webUrl = `https://${myHostName}`;\n } else {\n hsyncClient.webUrl = `https://${myHostName}`;\n }\n hsyncClient.webAdmin = `${hsyncClient.webUrl}/${hsyncBase}/admin`;\n hsyncClient.port = port;\n\n return hsyncClient;\n}\n\nmodule.exports = {\n createHsync,\n setNet,\n setMqtt,\n};\n\n\n//# sourceURL=webpack://hsync/./connection.js?");
|
|
29
|
+
|
|
30
|
+
/***/ }),
|
|
31
|
+
|
|
32
|
+
/***/ "./hsync-web.js":
|
|
33
|
+
/*!**********************!*\
|
|
34
|
+
!*** ./hsync-web.js ***!
|
|
35
|
+
\**********************/
|
|
36
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
37
|
+
|
|
38
|
+
eval("const mqtt = __webpack_require__(/*! precompiled-mqtt */ \"./node_modules/precompiled-mqtt/dist/mqtt.browser.js\");\nconst buffer = __webpack_require__(/*! buffer */ \"./node_modules/buffer/index.js\");\nconst net = __webpack_require__(/*! net-web */ \"./node_modules/net-web/net-web.js\");\nconst { createHsync, setNet, setMqtt } = __webpack_require__(/*! ./connection */ \"./connection.js\");\nconst config = __webpack_require__(/*! ./config */ \"./config.js\");\n\n// TODO need to make this work with web/service workers\nwindow.Buffer = buffer.Buffer;\n\nsetNet(net);\nsetMqtt(mqtt);\n\nasync function dynamicConnect(dynamicHost, useLocalStorage) {\n let con;\n if (useLocalStorage) {\n const localConfigStr = localStorage.getItem('hsyncConfig');\n if (localConfigStr) {\n const localConfig = JSON.parse(localConfigStr);\n if ((Date.now() - localConfig.created) < (localConfig.timeout * 0.66)) {\n config.hsyncSecret = localConfig.hsyncSecret;\n config.hsyncServer = localConfig.hsyncServer;\n }\n }\n \n if (!config.hsyncSecret) {\n config.dynamicHost = dynamicHost || config.defaultDynamicHost;\n }\n \n con = await createHsync(config);\n \n if (config.dynamicHost) {\n const storeConfig = {\n hsyncSecret: con.hsyncSecret,\n hsyncServer: con.hsyncServer,\n timeout: con.dynamicTimeout,\n created: Date.now(),\n };\n localStorage.setItem('hsyncConfig', JSON.stringify(storeConfig));\n }\n\n return con;\n }\n\n config.dynamicHost = dynamicHost || config.defaultDynamicHost;\n con = await createHsync(config);\n\n return con;\n \n}\n\n\nconst hsync = globalThis.hsync || {\n createConnection: createHsync,\n dynamicConnect,\n net,\n config,\n};\nglobalThis.hsync = hsync;\n\nmodule.exports = hsync;\n\n\n//# sourceURL=webpack://hsync/./hsync-web.js?");
|
|
39
|
+
|
|
40
|
+
/***/ }),
|
|
41
|
+
|
|
42
|
+
/***/ "./lib/rpc.js":
|
|
43
|
+
/*!********************!*\
|
|
44
|
+
!*** ./lib/rpc.js ***!
|
|
45
|
+
\********************/
|
|
46
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
47
|
+
|
|
48
|
+
eval("const rawr = __webpack_require__(/*! rawr */ \"./node_modules/rawr/index.js\");\nconst b64id = __webpack_require__(/*! b64id */ \"./node_modules/b64id/index.js\");\nconst debug = __webpack_require__(/*! debug */ \"./node_modules/debug/src/browser.js\")('hsync:rpc');\nconst EventEmitter = (__webpack_require__(/*! events */ \"./node_modules/events/events.js\").EventEmitter);\n\nfunction createRPCPeer({ hostName, hsyncClient, timeout = 10000, methods = {} }) {\n if (!hostName) {\n throw new Error('No hostname specified');\n }\n if (hostName === hsyncClient.username) {\n throw new Error('Peer must be a different host');\n }\n const transport = new EventEmitter();\n transport.send = (msg) => {\n if(typeof msg === 'object') {\n msg = JSON.stringify(msg);\n }\n const topic = `msg/${hostName}/${hsyncClient.username}/rpc`;\n debug('↑ peer rpc reply', msg);\n hsyncClient.mqConn.publish(topic, Buffer.from(msg));\n };\n transport.receiveData = (msg) => {\n debug('↓ peer rpc', msg);\n if(msg) {\n msg = JSON.parse(msg);\n }\n if (Array.isArray(msg.params)) {\n msg.params.unshift(hostName);\n }\n transport.emit('rpc', msg);\n };\n\n const peer = rawr({transport, methods: Object.assign({}, methods), timeout});\n return peer;\n \n}\n\nfunction createServerReplyPeer({ requestId, hsyncClient, methods = {}}) {\n\n const transport = new EventEmitter();\n transport.send = (msg) => {\n if(typeof msg === 'object') {\n msg = JSON.stringify(msg);\n }\n const topic = `ssrpc/${hsyncClient.myHostName}/${requestId}`;\n debug('↑ server rpc reply', msg);\n hsyncClient.mqConn.publish(topic, Buffer.from(msg));\n };\n transport.receiveData = (msg) => {\n debug('↓ server rpc', msg);\n if(msg) {\n msg = JSON.parse(msg);\n }\n transport.emit('rpc', msg);\n };\n\n const peer = rawr({transport, methods});\n return peer;\n}\n\nmodule.exports = {\n createRPCPeer,\n createServerReplyPeer,\n};\n\n//# sourceURL=webpack://hsync/./lib/rpc.js?");
|
|
49
|
+
|
|
50
|
+
/***/ }),
|
|
51
|
+
|
|
52
|
+
/***/ "./lib/socket-listen-handler.js":
|
|
53
|
+
/*!**************************************!*\
|
|
54
|
+
!*** ./lib/socket-listen-handler.js ***!
|
|
55
|
+
\**************************************/
|
|
56
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
57
|
+
|
|
58
|
+
eval("const debug = __webpack_require__(/*! debug */ \"./node_modules/debug/src/browser.js\")('hsync:listener');\nconst debugError = __webpack_require__(/*! debug */ \"./node_modules/debug/src/browser.js\")('hsync:error');\n\nconst { createRPCPeer } = __webpack_require__(/*! ./rpc */ \"./lib/rpc.js\");\n\ndebugError.color = 1;\nlet net;\n\nfunction setNet(netImpl) {\n net = netImpl;\n}\n\nfunction createSocketListenHandler({hostName, port, targetPort, targetHost, hsyncClient}) {\n debug('creating handler', hostName, port, targetPort, targetHost);\n\n const sockets = {};\n \n const peer = createRPCPeer({hostName, hsyncClient});\n\n debug('peer crated');\n \n const socketServer = net.createServer(async (socket) => {\n\n socket.socketId = b64id.generateId();\n sockets[socket.socketId] = socket;\n socket.peerConnected = false;\n const pubTopic = `msg/${hostName}/${hsyncClient.username}/socketData/${socket.socketId}`;\n const closeTopic = `msg/${hostName}/${hsyncClient.username}/socketClose/${socket.socketId}`;\n const dataQueue = [];\n\n function sendData(data) {\n hsyncClient.mqConn.publish(pubTopic, data);\n }\n\n socket.on('data', async (data) => {\n if (!socket.peerConnected) {\n dataQueue.push(data);\n return;\n }\n sendData(data);\n });\n \n socket.on('close', () => {\n\n if (sockets[socket.socketId]) {\n delete sockets[socket.socketId];\n }\n hsyncClient.mqConn.publish(closeTopic, '');\n });\n \n socket.on('error', (error) => {\n debug('socket error', hostName, socket.socketId, error);\n if (sockets[socket.socketId]) {\n delete sockets[socket.socketId];\n }\n hsyncClient.mqConn.publish(closeTopic, '');\n });\n \n try {\n await peer.methods.connectSocket(targetPort, targetHost);\n dataQueue.forEach(sendData);\n } catch (e) {\n debugError('cant connect remotely', hostName, targetPort, e);\n if (sockets[socket.socketId]) {\n delete sockets[socket.socketId];\n }\n socket.end();\n }\n \n });\n\n socketServer.listen(port);\n\n\n function end() {\n const sockKeys = Object.keys(sockets);\n sockKeys.forEach((sk) => {\n try {\n sockets[sk].end();\n delete sockets[sk];\n }\n catch(e) {\n debug('error closing socket', e);\n }\n });\n }\n\n return {\n socketServer,\n sockets,\n end,\n };\n}\n\nmodule.exports = {\n createSocketListenHandler,\n setNet,\n};\n\n//# sourceURL=webpack://hsync/./lib/socket-listen-handler.js?");
|
|
59
|
+
|
|
60
|
+
/***/ }),
|
|
61
|
+
|
|
62
|
+
/***/ "./lib/web-handler.js":
|
|
63
|
+
/*!****************************!*\
|
|
64
|
+
!*** ./lib/web-handler.js ***!
|
|
65
|
+
\****************************/
|
|
66
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
67
|
+
|
|
68
|
+
eval("const debug = __webpack_require__(/*! debug */ \"./node_modules/debug/src/browser.js\")('hsync:web');\nconst debugError = __webpack_require__(/*! debug */ \"./node_modules/debug/src/browser.js\")('hsync:error');\n\ndebugError.color = 1;\n\nlet net;\n\nfunction setNet(netImpl) {\n net = netImpl;\n}\n\nfunction createWebHandler({myHostName, localHost, port, mqConn}) {\n\n const sockets = {};\n\n function handleWebRequest(hostName, socketId, action, message) {\n if (hostName !== myHostName) {\n return; // why did this get sent to me?\n }\n\n if (socketId) {\n let socket = sockets[socketId];\n if (action === 'close') {\n if (socket) {\n socket.end();\n delete sockets[socket.socketId];\n return;\n }\n return;\n } else if (!socket) {\n socket = new net.Socket();\n socket.socketId = socketId;\n sockets[socketId] = socket;\n socket.on('data', (data) => {\n if (!socket.dataRecieved) {\n const logData = data.slice(0, 200).toString().split('\\r\\n')[0];\n debug(`↑ ${logData}${logData.length > 60 ? '…' : ''}`);\n socket.dataRecieved = true;\n } else {\n debug(`→ ${socket.socketId}`, data.length, '↑');\n }\n \n mqConn.publish(`reply/${myHostName}/${socketId}`, data);\n });\n socket.on('close', () => {\n debug('close', myHostName, socket.socketId);\n mqConn.publish(`close/${myHostName}/${socketId}`, '');\n delete sockets[socket.socketId];\n });\n socket.on('error', (err) => {\n delete sockets[socket.socketId];\n debugError('error connecting', localHost, port, err);\n });\n socket.connect(port, localHost, () => {\n debug(`\\nCONNECTED TO ${localHost}:${port}`, socket.socketId);\n debug('← ' + message.slice(0, 200).toString().split('\\r\\n')[0], message.length);\n socket.write(message);\n });\n return;\n }\n\n debug('←', socketId, message.length);\n socket.write(message);\n }\n\n }\n\n function end() {\n const sockKeys = Object.keys(sockets);\n sockKeys.forEach((sk) => {\n try {\n sockets[sk].end();\n delete sockets[sk];\n }\n catch(e) {\n debug('error closing socket', e);\n }\n });\n }\n\n return {\n handleWebRequest,\n sockets,\n end,\n };\n}\n\nmodule.exports = { \n createWebHandler,\n setNet,\n};\n\n//# sourceURL=webpack://hsync/./lib/web-handler.js?");
|
|
69
|
+
|
|
70
|
+
/***/ }),
|
|
71
|
+
|
|
72
|
+
/***/ "./node_modules/b64id/index.js":
|
|
73
|
+
/*!*************************************!*\
|
|
74
|
+
!*** ./node_modules/b64id/index.js ***!
|
|
75
|
+
\*************************************/
|
|
76
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
77
|
+
|
|
78
|
+
eval("const base64 = __webpack_require__(/*! base64-url */ \"./node_modules/base64-url/index.js\");\nconst uuidv4 = __webpack_require__(/*! uuid/v4 */ \"./node_modules/uuid/v4.js\");\n\nfunction uuidToB64(uuidStr) {\n const buf = Buffer.from(uuidStr.replace(/\\-/g, ''), 'hex');\n return base64.encode(buf);\n}\n\nfunction b64ToUuid(b64Str) {\n const uuid = Buffer.from(base64.unescape(b64Str), 'base64').toString('hex');\n return `${uuid.substring(0, 8)}-${uuid.substring(8, 12)}-${uuid.substring(12, 16)}-${uuid.substring(16, 20)}-${uuid.substring(20)}`;\n}\n\nfunction generateId() {\n return uuidToB64(uuidv4());\n}\n\nmodule.exports = {\n b64ToUuid,\n uuidToB64,\n generateId\n};\n\n//# sourceURL=webpack://hsync/./node_modules/b64id/index.js?");
|
|
79
|
+
|
|
80
|
+
/***/ }),
|
|
81
|
+
|
|
82
|
+
/***/ "./node_modules/base64-js/index.js":
|
|
83
|
+
/*!*****************************************!*\
|
|
84
|
+
!*** ./node_modules/base64-js/index.js ***!
|
|
85
|
+
\*****************************************/
|
|
86
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
87
|
+
|
|
88
|
+
"use strict";
|
|
89
|
+
eval("\n\nexports.byteLength = byteLength\nexports.toByteArray = toByteArray\nexports.fromByteArray = fromByteArray\n\nvar lookup = []\nvar revLookup = []\nvar Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array\n\nvar code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'\nfor (var i = 0, len = code.length; i < len; ++i) {\n lookup[i] = code[i]\n revLookup[code.charCodeAt(i)] = i\n}\n\n// Support decoding URL-safe base64 strings, as Node.js does.\n// See: https://en.wikipedia.org/wiki/Base64#URL_applications\nrevLookup['-'.charCodeAt(0)] = 62\nrevLookup['_'.charCodeAt(0)] = 63\n\nfunction getLens (b64) {\n var len = b64.length\n\n if (len % 4 > 0) {\n throw new Error('Invalid string. Length must be a multiple of 4')\n }\n\n // Trim off extra bytes after placeholder bytes are found\n // See: https://github.com/beatgammit/base64-js/issues/42\n var validLen = b64.indexOf('=')\n if (validLen === -1) validLen = len\n\n var placeHoldersLen = validLen === len\n ? 0\n : 4 - (validLen % 4)\n\n return [validLen, placeHoldersLen]\n}\n\n// base64 is 4/3 + up to two characters of the original data\nfunction byteLength (b64) {\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction _byteLength (b64, validLen, placeHoldersLen) {\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction toByteArray (b64) {\n var tmp\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n\n var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))\n\n var curByte = 0\n\n // if there are placeholders, only get up to the last complete 4 chars\n var len = placeHoldersLen > 0\n ? validLen - 4\n : validLen\n\n var i\n for (i = 0; i < len; i += 4) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 18) |\n (revLookup[b64.charCodeAt(i + 1)] << 12) |\n (revLookup[b64.charCodeAt(i + 2)] << 6) |\n revLookup[b64.charCodeAt(i + 3)]\n arr[curByte++] = (tmp >> 16) & 0xFF\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 2) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 2) |\n (revLookup[b64.charCodeAt(i + 1)] >> 4)\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 1) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 10) |\n (revLookup[b64.charCodeAt(i + 1)] << 4) |\n (revLookup[b64.charCodeAt(i + 2)] >> 2)\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n return arr\n}\n\nfunction tripletToBase64 (num) {\n return lookup[num >> 18 & 0x3F] +\n lookup[num >> 12 & 0x3F] +\n lookup[num >> 6 & 0x3F] +\n lookup[num & 0x3F]\n}\n\nfunction encodeChunk (uint8, start, end) {\n var tmp\n var output = []\n for (var i = start; i < end; i += 3) {\n tmp =\n ((uint8[i] << 16) & 0xFF0000) +\n ((uint8[i + 1] << 8) & 0xFF00) +\n (uint8[i + 2] & 0xFF)\n output.push(tripletToBase64(tmp))\n }\n return output.join('')\n}\n\nfunction fromByteArray (uint8) {\n var tmp\n var len = uint8.length\n var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes\n var parts = []\n var maxChunkLength = 16383 // must be multiple of 3\n\n // go through the array every three bytes, we'll deal with trailing stuff later\n for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {\n parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)))\n }\n\n // pad the end with zeros, but make sure to not forget the extra bytes\n if (extraBytes === 1) {\n tmp = uint8[len - 1]\n parts.push(\n lookup[tmp >> 2] +\n lookup[(tmp << 4) & 0x3F] +\n '=='\n )\n } else if (extraBytes === 2) {\n tmp = (uint8[len - 2] << 8) + uint8[len - 1]\n parts.push(\n lookup[tmp >> 10] +\n lookup[(tmp >> 4) & 0x3F] +\n lookup[(tmp << 2) & 0x3F] +\n '='\n )\n }\n\n return parts.join('')\n}\n\n\n//# sourceURL=webpack://hsync/./node_modules/base64-js/index.js?");
|
|
90
|
+
|
|
91
|
+
/***/ }),
|
|
92
|
+
|
|
93
|
+
/***/ "./node_modules/base64-url/index.js":
|
|
94
|
+
/*!******************************************!*\
|
|
95
|
+
!*** ./node_modules/base64-url/index.js ***!
|
|
96
|
+
\******************************************/
|
|
97
|
+
/***/ ((module) => {
|
|
98
|
+
|
|
99
|
+
"use strict";
|
|
100
|
+
eval("\n\nmodule.exports = {\n unescape: unescape,\n escape: escape,\n encode: encode,\n decode: decode\n}\n\nfunction unescape (str) {\n return (str + '==='.slice((str.length + 3) % 4))\n .replace(/-/g, '+')\n .replace(/_/g, '/')\n}\n\nfunction escape (str) {\n return str.replace(/\\+/g, '-')\n .replace(/\\//g, '_')\n .replace(/=/g, '')\n}\n\nfunction encode (str, encoding) {\n return escape(Buffer.from(str, encoding || 'utf8').toString('base64'))\n}\n\nfunction decode (str, encoding) {\n return Buffer.from(unescape(str), 'base64').toString(encoding || 'utf8')\n}\n\n\n//# sourceURL=webpack://hsync/./node_modules/base64-url/index.js?");
|
|
101
|
+
|
|
102
|
+
/***/ }),
|
|
103
|
+
|
|
104
|
+
/***/ "./node_modules/buffer/index.js":
|
|
105
|
+
/*!**************************************!*\
|
|
106
|
+
!*** ./node_modules/buffer/index.js ***!
|
|
107
|
+
\**************************************/
|
|
108
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
109
|
+
|
|
110
|
+
"use strict";
|
|
111
|
+
eval("/*!\n * The buffer module from node.js, for the browser.\n *\n * @author Feross Aboukhadijeh <https://feross.org>\n * @license MIT\n */\n/* eslint-disable no-proto */\n\n\n\nconst base64 = __webpack_require__(/*! base64-js */ \"./node_modules/base64-js/index.js\")\nconst ieee754 = __webpack_require__(/*! ieee754 */ \"./node_modules/ieee754/index.js\")\nconst customInspectSymbol =\n (typeof Symbol === 'function' && typeof Symbol['for'] === 'function') // eslint-disable-line dot-notation\n ? Symbol['for']('nodejs.util.inspect.custom') // eslint-disable-line dot-notation\n : null\n\nexports.Buffer = Buffer\nexports.SlowBuffer = SlowBuffer\nexports.INSPECT_MAX_BYTES = 50\n\nconst K_MAX_LENGTH = 0x7fffffff\nexports.kMaxLength = K_MAX_LENGTH\n\n/**\n * If `Buffer.TYPED_ARRAY_SUPPORT`:\n * === true Use Uint8Array implementation (fastest)\n * === false Print warning and recommend using `buffer` v4.x which has an Object\n * implementation (most compatible, even IE6)\n *\n * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,\n * Opera 11.6+, iOS 4.2+.\n *\n * We report that the browser does not support typed arrays if the are not subclassable\n * using __proto__. Firefox 4-29 lacks support for adding new properties to `Uint8Array`\n * (See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438). IE 10 lacks support\n * for __proto__ and has a buggy typed array implementation.\n */\nBuffer.TYPED_ARRAY_SUPPORT = typedArraySupport()\n\nif (!Buffer.TYPED_ARRAY_SUPPORT && typeof console !== 'undefined' &&\n typeof console.error === 'function') {\n console.error(\n 'This browser lacks typed array (Uint8Array) support which is required by ' +\n '`buffer` v5.x. Use `buffer` v4.x if you require old browser support.'\n )\n}\n\nfunction typedArraySupport () {\n // Can typed array instances can be augmented?\n try {\n const arr = new Uint8Array(1)\n const proto = { foo: function () { return 42 } }\n Object.setPrototypeOf(proto, Uint8Array.prototype)\n Object.setPrototypeOf(arr, proto)\n return arr.foo() === 42\n } catch (e) {\n return false\n }\n}\n\nObject.defineProperty(Buffer.prototype, 'parent', {\n enumerable: true,\n get: function () {\n if (!Buffer.isBuffer(this)) return undefined\n return this.buffer\n }\n})\n\nObject.defineProperty(Buffer.prototype, 'offset', {\n enumerable: true,\n get: function () {\n if (!Buffer.isBuffer(this)) return undefined\n return this.byteOffset\n }\n})\n\nfunction createBuffer (length) {\n if (length > K_MAX_LENGTH) {\n throw new RangeError('The value \"' + length + '\" is invalid for option \"size\"')\n }\n // Return an augmented `Uint8Array` instance\n const buf = new Uint8Array(length)\n Object.setPrototypeOf(buf, Buffer.prototype)\n return buf\n}\n\n/**\n * The Buffer constructor returns instances of `Uint8Array` that have their\n * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of\n * `Uint8Array`, so the returned instances will have all the node `Buffer` methods\n * and the `Uint8Array` methods. Square bracket notation works as expected -- it\n * returns a single octet.\n *\n * The `Uint8Array` prototype remains unmodified.\n */\n\nfunction Buffer (arg, encodingOrOffset, length) {\n // Common case.\n if (typeof arg === 'number') {\n if (typeof encodingOrOffset === 'string') {\n throw new TypeError(\n 'The \"string\" argument must be of type string. Received type number'\n )\n }\n return allocUnsafe(arg)\n }\n return from(arg, encodingOrOffset, length)\n}\n\nBuffer.poolSize = 8192 // not used by this implementation\n\nfunction from (value, encodingOrOffset, length) {\n if (typeof value === 'string') {\n return fromString(value, encodingOrOffset)\n }\n\n if (ArrayBuffer.isView(value)) {\n return fromArrayView(value)\n }\n\n if (value == null) {\n throw new TypeError(\n 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' +\n 'or Array-like Object. Received type ' + (typeof value)\n )\n }\n\n if (isInstance(value, ArrayBuffer) ||\n (value && isInstance(value.buffer, ArrayBuffer))) {\n return fromArrayBuffer(value, encodingOrOffset, length)\n }\n\n if (typeof SharedArrayBuffer !== 'undefined' &&\n (isInstance(value, SharedArrayBuffer) ||\n (value && isInstance(value.buffer, SharedArrayBuffer)))) {\n return fromArrayBuffer(value, encodingOrOffset, length)\n }\n\n if (typeof value === 'number') {\n throw new TypeError(\n 'The \"value\" argument must not be of type number. Received type number'\n )\n }\n\n const valueOf = value.valueOf && value.valueOf()\n if (valueOf != null && valueOf !== value) {\n return Buffer.from(valueOf, encodingOrOffset, length)\n }\n\n const b = fromObject(value)\n if (b) return b\n\n if (typeof Symbol !== 'undefined' && Symbol.toPrimitive != null &&\n typeof value[Symbol.toPrimitive] === 'function') {\n return Buffer.from(value[Symbol.toPrimitive]('string'), encodingOrOffset, length)\n }\n\n throw new TypeError(\n 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' +\n 'or Array-like Object. Received type ' + (typeof value)\n )\n}\n\n/**\n * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError\n * if value is a number.\n * Buffer.from(str[, encoding])\n * Buffer.from(array)\n * Buffer.from(buffer)\n * Buffer.from(arrayBuffer[, byteOffset[, length]])\n **/\nBuffer.from = function (value, encodingOrOffset, length) {\n return from(value, encodingOrOffset, length)\n}\n\n// Note: Change prototype *after* Buffer.from is defined to workaround Chrome bug:\n// https://github.com/feross/buffer/pull/148\nObject.setPrototypeOf(Buffer.prototype, Uint8Array.prototype)\nObject.setPrototypeOf(Buffer, Uint8Array)\n\nfunction assertSize (size) {\n if (typeof size !== 'number') {\n throw new TypeError('\"size\" argument must be of type number')\n } else if (size < 0) {\n throw new RangeError('The value \"' + size + '\" is invalid for option \"size\"')\n }\n}\n\nfunction alloc (size, fill, encoding) {\n assertSize(size)\n if (size <= 0) {\n return createBuffer(size)\n }\n if (fill !== undefined) {\n // Only pay attention to encoding if it's a string. This\n // prevents accidentally sending in a number that would\n // be interpreted as a start offset.\n return typeof encoding === 'string'\n ? createBuffer(size).fill(fill, encoding)\n : createBuffer(size).fill(fill)\n }\n return createBuffer(size)\n}\n\n/**\n * Creates a new filled Buffer instance.\n * alloc(size[, fill[, encoding]])\n **/\nBuffer.alloc = function (size, fill, encoding) {\n return alloc(size, fill, encoding)\n}\n\nfunction allocUnsafe (size) {\n assertSize(size)\n return createBuffer(size < 0 ? 0 : checked(size) | 0)\n}\n\n/**\n * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.\n * */\nBuffer.allocUnsafe = function (size) {\n return allocUnsafe(size)\n}\n/**\n * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.\n */\nBuffer.allocUnsafeSlow = function (size) {\n return allocUnsafe(size)\n}\n\nfunction fromString (string, encoding) {\n if (typeof encoding !== 'string' || encoding === '') {\n encoding = 'utf8'\n }\n\n if (!Buffer.isEncoding(encoding)) {\n throw new TypeError('Unknown encoding: ' + encoding)\n }\n\n const length = byteLength(string, encoding) | 0\n let buf = createBuffer(length)\n\n const actual = buf.write(string, encoding)\n\n if (actual !== length) {\n // Writing a hex string, for example, that contains invalid characters will\n // cause everything after the first invalid character to be ignored. (e.g.\n // 'abxxcd' will be treated as 'ab')\n buf = buf.slice(0, actual)\n }\n\n return buf\n}\n\nfunction fromArrayLike (array) {\n const length = array.length < 0 ? 0 : checked(array.length) | 0\n const buf = createBuffer(length)\n for (let i = 0; i < length; i += 1) {\n buf[i] = array[i] & 255\n }\n return buf\n}\n\nfunction fromArrayView (arrayView) {\n if (isInstance(arrayView, Uint8Array)) {\n const copy = new Uint8Array(arrayView)\n return fromArrayBuffer(copy.buffer, copy.byteOffset, copy.byteLength)\n }\n return fromArrayLike(arrayView)\n}\n\nfunction fromArrayBuffer (array, byteOffset, length) {\n if (byteOffset < 0 || array.byteLength < byteOffset) {\n throw new RangeError('\"offset\" is outside of buffer bounds')\n }\n\n if (array.byteLength < byteOffset + (length || 0)) {\n throw new RangeError('\"length\" is outside of buffer bounds')\n }\n\n let buf\n if (byteOffset === undefined && length === undefined) {\n buf = new Uint8Array(array)\n } else if (length === undefined) {\n buf = new Uint8Array(array, byteOffset)\n } else {\n buf = new Uint8Array(array, byteOffset, length)\n }\n\n // Return an augmented `Uint8Array` instance\n Object.setPrototypeOf(buf, Buffer.prototype)\n\n return buf\n}\n\nfunction fromObject (obj) {\n if (Buffer.isBuffer(obj)) {\n const len = checked(obj.length) | 0\n const buf = createBuffer(len)\n\n if (buf.length === 0) {\n return buf\n }\n\n obj.copy(buf, 0, 0, len)\n return buf\n }\n\n if (obj.length !== undefined) {\n if (typeof obj.length !== 'number' || numberIsNaN(obj.length)) {\n return createBuffer(0)\n }\n return fromArrayLike(obj)\n }\n\n if (obj.type === 'Buffer' && Array.isArray(obj.data)) {\n return fromArrayLike(obj.data)\n }\n}\n\nfunction checked (length) {\n // Note: cannot use `length < K_MAX_LENGTH` here because that fails when\n // length is NaN (which is otherwise coerced to zero.)\n if (length >= K_MAX_LENGTH) {\n throw new RangeError('Attempt to allocate Buffer larger than maximum ' +\n 'size: 0x' + K_MAX_LENGTH.toString(16) + ' bytes')\n }\n return length | 0\n}\n\nfunction SlowBuffer (length) {\n if (+length != length) { // eslint-disable-line eqeqeq\n length = 0\n }\n return Buffer.alloc(+length)\n}\n\nBuffer.isBuffer = function isBuffer (b) {\n return b != null && b._isBuffer === true &&\n b !== Buffer.prototype // so Buffer.isBuffer(Buffer.prototype) will be false\n}\n\nBuffer.compare = function compare (a, b) {\n if (isInstance(a, Uint8Array)) a = Buffer.from(a, a.offset, a.byteLength)\n if (isInstance(b, Uint8Array)) b = Buffer.from(b, b.offset, b.byteLength)\n if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {\n throw new TypeError(\n 'The \"buf1\", \"buf2\" arguments must be one of type Buffer or Uint8Array'\n )\n }\n\n if (a === b) return 0\n\n let x = a.length\n let y = b.length\n\n for (let i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i]\n y = b[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\nBuffer.isEncoding = function isEncoding (encoding) {\n switch (String(encoding).toLowerCase()) {\n case 'hex':\n case 'utf8':\n case 'utf-8':\n case 'ascii':\n case 'latin1':\n case 'binary':\n case 'base64':\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return true\n default:\n return false\n }\n}\n\nBuffer.concat = function concat (list, length) {\n if (!Array.isArray(list)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n\n if (list.length === 0) {\n return Buffer.alloc(0)\n }\n\n let i\n if (length === undefined) {\n length = 0\n for (i = 0; i < list.length; ++i) {\n length += list[i].length\n }\n }\n\n const buffer = Buffer.allocUnsafe(length)\n let pos = 0\n for (i = 0; i < list.length; ++i) {\n let buf = list[i]\n if (isInstance(buf, Uint8Array)) {\n if (pos + buf.length > buffer.length) {\n if (!Buffer.isBuffer(buf)) buf = Buffer.from(buf)\n buf.copy(buffer, pos)\n } else {\n Uint8Array.prototype.set.call(\n buffer,\n buf,\n pos\n )\n }\n } else if (!Buffer.isBuffer(buf)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n } else {\n buf.copy(buffer, pos)\n }\n pos += buf.length\n }\n return buffer\n}\n\nfunction byteLength (string, encoding) {\n if (Buffer.isBuffer(string)) {\n return string.length\n }\n if (ArrayBuffer.isView(string) || isInstance(string, ArrayBuffer)) {\n return string.byteLength\n }\n if (typeof string !== 'string') {\n throw new TypeError(\n 'The \"string\" argument must be one of type string, Buffer, or ArrayBuffer. ' +\n 'Received type ' + typeof string\n )\n }\n\n const len = string.length\n const mustMatch = (arguments.length > 2 && arguments[2] === true)\n if (!mustMatch && len === 0) return 0\n\n // Use a for loop to avoid recursion\n let loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'ascii':\n case 'latin1':\n case 'binary':\n return len\n case 'utf8':\n case 'utf-8':\n return utf8ToBytes(string).length\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return len * 2\n case 'hex':\n return len >>> 1\n case 'base64':\n return base64ToBytes(string).length\n default:\n if (loweredCase) {\n return mustMatch ? -1 : utf8ToBytes(string).length // assume utf8\n }\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\nBuffer.byteLength = byteLength\n\nfunction slowToString (encoding, start, end) {\n let loweredCase = false\n\n // No need to verify that \"this.length <= MAX_UINT32\" since it's a read-only\n // property of a typed array.\n\n // This behaves neither like String nor Uint8Array in that we set start/end\n // to their upper/lower bounds if the value passed is out of range.\n // undefined is handled specially as per ECMA-262 6th Edition,\n // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.\n if (start === undefined || start < 0) {\n start = 0\n }\n // Return early if start > this.length. Done here to prevent potential uint32\n // coercion fail below.\n if (start > this.length) {\n return ''\n }\n\n if (end === undefined || end > this.length) {\n end = this.length\n }\n\n if (end <= 0) {\n return ''\n }\n\n // Force coercion to uint32. This will also coerce falsey/NaN values to 0.\n end >>>= 0\n start >>>= 0\n\n if (end <= start) {\n return ''\n }\n\n if (!encoding) encoding = 'utf8'\n\n while (true) {\n switch (encoding) {\n case 'hex':\n return hexSlice(this, start, end)\n\n case 'utf8':\n case 'utf-8':\n return utf8Slice(this, start, end)\n\n case 'ascii':\n return asciiSlice(this, start, end)\n\n case 'latin1':\n case 'binary':\n return latin1Slice(this, start, end)\n\n case 'base64':\n return base64Slice(this, start, end)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return utf16leSlice(this, start, end)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = (encoding + '').toLowerCase()\n loweredCase = true\n }\n }\n}\n\n// This property is used by `Buffer.isBuffer` (and the `is-buffer` npm package)\n// to detect a Buffer instance. It's not possible to use `instanceof Buffer`\n// reliably in a browserify context because there could be multiple different\n// copies of the 'buffer' package in use. This method works even for Buffer\n// instances that were created from another copy of the `buffer` package.\n// See: https://github.com/feross/buffer/issues/154\nBuffer.prototype._isBuffer = true\n\nfunction swap (b, n, m) {\n const i = b[n]\n b[n] = b[m]\n b[m] = i\n}\n\nBuffer.prototype.swap16 = function swap16 () {\n const len = this.length\n if (len % 2 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 16-bits')\n }\n for (let i = 0; i < len; i += 2) {\n swap(this, i, i + 1)\n }\n return this\n}\n\nBuffer.prototype.swap32 = function swap32 () {\n const len = this.length\n if (len % 4 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 32-bits')\n }\n for (let i = 0; i < len; i += 4) {\n swap(this, i, i + 3)\n swap(this, i + 1, i + 2)\n }\n return this\n}\n\nBuffer.prototype.swap64 = function swap64 () {\n const len = this.length\n if (len % 8 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 64-bits')\n }\n for (let i = 0; i < len; i += 8) {\n swap(this, i, i + 7)\n swap(this, i + 1, i + 6)\n swap(this, i + 2, i + 5)\n swap(this, i + 3, i + 4)\n }\n return this\n}\n\nBuffer.prototype.toString = function toString () {\n const length = this.length\n if (length === 0) return ''\n if (arguments.length === 0) return utf8Slice(this, 0, length)\n return slowToString.apply(this, arguments)\n}\n\nBuffer.prototype.toLocaleString = Buffer.prototype.toString\n\nBuffer.prototype.equals = function equals (b) {\n if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')\n if (this === b) return true\n return Buffer.compare(this, b) === 0\n}\n\nBuffer.prototype.inspect = function inspect () {\n let str = ''\n const max = exports.INSPECT_MAX_BYTES\n str = this.toString('hex', 0, max).replace(/(.{2})/g, '$1 ').trim()\n if (this.length > max) str += ' ... '\n return '<Buffer ' + str + '>'\n}\nif (customInspectSymbol) {\n Buffer.prototype[customInspectSymbol] = Buffer.prototype.inspect\n}\n\nBuffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {\n if (isInstance(target, Uint8Array)) {\n target = Buffer.from(target, target.offset, target.byteLength)\n }\n if (!Buffer.isBuffer(target)) {\n throw new TypeError(\n 'The \"target\" argument must be one of type Buffer or Uint8Array. ' +\n 'Received type ' + (typeof target)\n )\n }\n\n if (start === undefined) {\n start = 0\n }\n if (end === undefined) {\n end = target ? target.length : 0\n }\n if (thisStart === undefined) {\n thisStart = 0\n }\n if (thisEnd === undefined) {\n thisEnd = this.length\n }\n\n if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {\n throw new RangeError('out of range index')\n }\n\n if (thisStart >= thisEnd && start >= end) {\n return 0\n }\n if (thisStart >= thisEnd) {\n return -1\n }\n if (start >= end) {\n return 1\n }\n\n start >>>= 0\n end >>>= 0\n thisStart >>>= 0\n thisEnd >>>= 0\n\n if (this === target) return 0\n\n let x = thisEnd - thisStart\n let y = end - start\n const len = Math.min(x, y)\n\n const thisCopy = this.slice(thisStart, thisEnd)\n const targetCopy = target.slice(start, end)\n\n for (let i = 0; i < len; ++i) {\n if (thisCopy[i] !== targetCopy[i]) {\n x = thisCopy[i]\n y = targetCopy[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\n// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,\n// OR the last index of `val` in `buffer` at offset <= `byteOffset`.\n//\n// Arguments:\n// - buffer - a Buffer to search\n// - val - a string, Buffer, or number\n// - byteOffset - an index into `buffer`; will be clamped to an int32\n// - encoding - an optional encoding, relevant is val is a string\n// - dir - true for indexOf, false for lastIndexOf\nfunction bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (numberIsNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [val], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}\n\nfunction arrayIndexOf (arr, val, byteOffset, encoding, dir) {\n let indexSize = 1\n let arrLength = arr.length\n let valLength = val.length\n\n if (encoding !== undefined) {\n encoding = String(encoding).toLowerCase()\n if (encoding === 'ucs2' || encoding === 'ucs-2' ||\n encoding === 'utf16le' || encoding === 'utf-16le') {\n if (arr.length < 2 || val.length < 2) {\n return -1\n }\n indexSize = 2\n arrLength /= 2\n valLength /= 2\n byteOffset /= 2\n }\n }\n\n function read (buf, i) {\n if (indexSize === 1) {\n return buf[i]\n } else {\n return buf.readUInt16BE(i * indexSize)\n }\n }\n\n let i\n if (dir) {\n let foundIndex = -1\n for (i = byteOffset; i < arrLength; i++) {\n if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {\n if (foundIndex === -1) foundIndex = i\n if (i - foundIndex + 1 === valLength) return foundIndex * indexSize\n } else {\n if (foundIndex !== -1) i -= i - foundIndex\n foundIndex = -1\n }\n }\n } else {\n if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength\n for (i = byteOffset; i >= 0; i--) {\n let found = true\n for (let j = 0; j < valLength; j++) {\n if (read(arr, i + j) !== read(val, j)) {\n found = false\n break\n }\n }\n if (found) return i\n }\n }\n\n return -1\n}\n\nBuffer.prototype.includes = function includes (val, byteOffset, encoding) {\n return this.indexOf(val, byteOffset, encoding) !== -1\n}\n\nBuffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, true)\n}\n\nBuffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, false)\n}\n\nfunction hexWrite (buf, string, offset, length) {\n offset = Number(offset) || 0\n const remaining = buf.length - offset\n if (!length) {\n length = remaining\n } else {\n length = Number(length)\n if (length > remaining) {\n length = remaining\n }\n }\n\n const strLen = string.length\n\n if (length > strLen / 2) {\n length = strLen / 2\n }\n let i\n for (i = 0; i < length; ++i) {\n const parsed = parseInt(string.substr(i * 2, 2), 16)\n if (numberIsNaN(parsed)) return i\n buf[offset + i] = parsed\n }\n return i\n}\n\nfunction utf8Write (buf, string, offset, length) {\n return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nfunction asciiWrite (buf, string, offset, length) {\n return blitBuffer(asciiToBytes(string), buf, offset, length)\n}\n\nfunction base64Write (buf, string, offset, length) {\n return blitBuffer(base64ToBytes(string), buf, offset, length)\n}\n\nfunction ucs2Write (buf, string, offset, length) {\n return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nBuffer.prototype.write = function write (string, offset, length, encoding) {\n // Buffer#write(string)\n if (offset === undefined) {\n encoding = 'utf8'\n length = this.length\n offset = 0\n // Buffer#write(string, encoding)\n } else if (length === undefined && typeof offset === 'string') {\n encoding = offset\n length = this.length\n offset = 0\n // Buffer#write(string, offset[, length][, encoding])\n } else if (isFinite(offset)) {\n offset = offset >>> 0\n if (isFinite(length)) {\n length = length >>> 0\n if (encoding === undefined) encoding = 'utf8'\n } else {\n encoding = length\n length = undefined\n }\n } else {\n throw new Error(\n 'Buffer.write(string, encoding, offset[, length]) is no longer supported'\n )\n }\n\n const remaining = this.length - offset\n if (length === undefined || length > remaining) length = remaining\n\n if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {\n throw new RangeError('Attempt to write outside buffer bounds')\n }\n\n if (!encoding) encoding = 'utf8'\n\n let loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'hex':\n return hexWrite(this, string, offset, length)\n\n case 'utf8':\n case 'utf-8':\n return utf8Write(this, string, offset, length)\n\n case 'ascii':\n case 'latin1':\n case 'binary':\n return asciiWrite(this, string, offset, length)\n\n case 'base64':\n // Warning: maxLength not taken into account in base64Write\n return base64Write(this, string, offset, length)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return ucs2Write(this, string, offset, length)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\n\nBuffer.prototype.toJSON = function toJSON () {\n return {\n type: 'Buffer',\n data: Array.prototype.slice.call(this._arr || this, 0)\n }\n}\n\nfunction base64Slice (buf, start, end) {\n if (start === 0 && end === buf.length) {\n return base64.fromByteArray(buf)\n } else {\n return base64.fromByteArray(buf.slice(start, end))\n }\n}\n\nfunction utf8Slice (buf, start, end) {\n end = Math.min(buf.length, end)\n const res = []\n\n let i = start\n while (i < end) {\n const firstByte = buf[i]\n let codePoint = null\n let bytesPerSequence = (firstByte > 0xEF)\n ? 4\n : (firstByte > 0xDF)\n ? 3\n : (firstByte > 0xBF)\n ? 2\n : 1\n\n if (i + bytesPerSequence <= end) {\n let secondByte, thirdByte, fourthByte, tempCodePoint\n\n switch (bytesPerSequence) {\n case 1:\n if (firstByte < 0x80) {\n codePoint = firstByte\n }\n break\n case 2:\n secondByte = buf[i + 1]\n if ((secondByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)\n if (tempCodePoint > 0x7F) {\n codePoint = tempCodePoint\n }\n }\n break\n case 3:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)\n if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {\n codePoint = tempCodePoint\n }\n }\n break\n case 4:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n fourthByte = buf[i + 3]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)\n if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {\n codePoint = tempCodePoint\n }\n }\n }\n }\n\n if (codePoint === null) {\n // we did not generate a valid codePoint so insert a\n // replacement char (U+FFFD) and advance only 1 byte\n codePoint = 0xFFFD\n bytesPerSequence = 1\n } else if (codePoint > 0xFFFF) {\n // encode to utf16 (surrogate pair dance)\n codePoint -= 0x10000\n res.push(codePoint >>> 10 & 0x3FF | 0xD800)\n codePoint = 0xDC00 | codePoint & 0x3FF\n }\n\n res.push(codePoint)\n i += bytesPerSequence\n }\n\n return decodeCodePointsArray(res)\n}\n\n// Based on http://stackoverflow.com/a/22747272/680742, the browser with\n// the lowest limit is Chrome, with 0x10000 args.\n// We go 1 magnitude less, for safety\nconst MAX_ARGUMENTS_LENGTH = 0x1000\n\nfunction decodeCodePointsArray (codePoints) {\n const len = codePoints.length\n if (len <= MAX_ARGUMENTS_LENGTH) {\n return String.fromCharCode.apply(String, codePoints) // avoid extra slice()\n }\n\n // Decode in chunks to avoid \"call stack size exceeded\".\n let res = ''\n let i = 0\n while (i < len) {\n res += String.fromCharCode.apply(\n String,\n codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)\n )\n }\n return res\n}\n\nfunction asciiSlice (buf, start, end) {\n let ret = ''\n end = Math.min(buf.length, end)\n\n for (let i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i] & 0x7F)\n }\n return ret\n}\n\nfunction latin1Slice (buf, start, end) {\n let ret = ''\n end = Math.min(buf.length, end)\n\n for (let i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i])\n }\n return ret\n}\n\nfunction hexSlice (buf, start, end) {\n const len = buf.length\n\n if (!start || start < 0) start = 0\n if (!end || end < 0 || end > len) end = len\n\n let out = ''\n for (let i = start; i < end; ++i) {\n out += hexSliceLookupTable[buf[i]]\n }\n return out\n}\n\nfunction utf16leSlice (buf, start, end) {\n const bytes = buf.slice(start, end)\n let res = ''\n // If bytes.length is odd, the last 8 bits must be ignored (same as node.js)\n for (let i = 0; i < bytes.length - 1; i += 2) {\n res += String.fromCharCode(bytes[i] + (bytes[i + 1] * 256))\n }\n return res\n}\n\nBuffer.prototype.slice = function slice (start, end) {\n const len = this.length\n start = ~~start\n end = end === undefined ? len : ~~end\n\n if (start < 0) {\n start += len\n if (start < 0) start = 0\n } else if (start > len) {\n start = len\n }\n\n if (end < 0) {\n end += len\n if (end < 0) end = 0\n } else if (end > len) {\n end = len\n }\n\n if (end < start) end = start\n\n const newBuf = this.subarray(start, end)\n // Return an augmented `Uint8Array` instance\n Object.setPrototypeOf(newBuf, Buffer.prototype)\n\n return newBuf\n}\n\n/*\n * Need to make sure that buffer isn't trying to write out of bounds.\n */\nfunction checkOffset (offset, ext, length) {\n if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n}\n\nBuffer.prototype.readUintLE =\nBuffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n let val = this[offset]\n let mul = 1\n let i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUintBE =\nBuffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) {\n checkOffset(offset, byteLength, this.length)\n }\n\n let val = this[offset + --byteLength]\n let mul = 1\n while (byteLength > 0 && (mul *= 0x100)) {\n val += this[offset + --byteLength] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUint8 =\nBuffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 1, this.length)\n return this[offset]\n}\n\nBuffer.prototype.readUint16LE =\nBuffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 2, this.length)\n return this[offset] | (this[offset + 1] << 8)\n}\n\nBuffer.prototype.readUint16BE =\nBuffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 2, this.length)\n return (this[offset] << 8) | this[offset + 1]\n}\n\nBuffer.prototype.readUint32LE =\nBuffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return ((this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16)) +\n (this[offset + 3] * 0x1000000)\n}\n\nBuffer.prototype.readUint32BE =\nBuffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] * 0x1000000) +\n ((this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n this[offset + 3])\n}\n\nBuffer.prototype.readBigUInt64LE = defineBigIntMethod(function readBigUInt64LE (offset) {\n offset = offset >>> 0\n validateNumber(offset, 'offset')\n const first = this[offset]\n const last = this[offset + 7]\n if (first === undefined || last === undefined) {\n boundsError(offset, this.length - 8)\n }\n\n const lo = first +\n this[++offset] * 2 ** 8 +\n this[++offset] * 2 ** 16 +\n this[++offset] * 2 ** 24\n\n const hi = this[++offset] +\n this[++offset] * 2 ** 8 +\n this[++offset] * 2 ** 16 +\n last * 2 ** 24\n\n return BigInt(lo) + (BigInt(hi) << BigInt(32))\n})\n\nBuffer.prototype.readBigUInt64BE = defineBigIntMethod(function readBigUInt64BE (offset) {\n offset = offset >>> 0\n validateNumber(offset, 'offset')\n const first = this[offset]\n const last = this[offset + 7]\n if (first === undefined || last === undefined) {\n boundsError(offset, this.length - 8)\n }\n\n const hi = first * 2 ** 24 +\n this[++offset] * 2 ** 16 +\n this[++offset] * 2 ** 8 +\n this[++offset]\n\n const lo = this[++offset] * 2 ** 24 +\n this[++offset] * 2 ** 16 +\n this[++offset] * 2 ** 8 +\n last\n\n return (BigInt(hi) << BigInt(32)) + BigInt(lo)\n})\n\nBuffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n let val = this[offset]\n let mul = 1\n let i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n let i = byteLength\n let mul = 1\n let val = this[offset + --i]\n while (i > 0 && (mul *= 0x100)) {\n val += this[offset + --i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readInt8 = function readInt8 (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 1, this.length)\n if (!(this[offset] & 0x80)) return (this[offset])\n return ((0xff - this[offset] + 1) * -1)\n}\n\nBuffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 2, this.length)\n const val = this[offset] | (this[offset + 1] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 2, this.length)\n const val = this[offset + 1] | (this[offset] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16) |\n (this[offset + 3] << 24)\n}\n\nBuffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] << 24) |\n (this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n (this[offset + 3])\n}\n\nBuffer.prototype.readBigInt64LE = defineBigIntMethod(function readBigInt64LE (offset) {\n offset = offset >>> 0\n validateNumber(offset, 'offset')\n const first = this[offset]\n const last = this[offset + 7]\n if (first === undefined || last === undefined) {\n boundsError(offset, this.length - 8)\n }\n\n const val = this[offset + 4] +\n this[offset + 5] * 2 ** 8 +\n this[offset + 6] * 2 ** 16 +\n (last << 24) // Overflow\n\n return (BigInt(val) << BigInt(32)) +\n BigInt(first +\n this[++offset] * 2 ** 8 +\n this[++offset] * 2 ** 16 +\n this[++offset] * 2 ** 24)\n})\n\nBuffer.prototype.readBigInt64BE = defineBigIntMethod(function readBigInt64BE (offset) {\n offset = offset >>> 0\n validateNumber(offset, 'offset')\n const first = this[offset]\n const last = this[offset + 7]\n if (first === undefined || last === undefined) {\n boundsError(offset, this.length - 8)\n }\n\n const val = (first << 24) + // Overflow\n this[++offset] * 2 ** 16 +\n this[++offset] * 2 ** 8 +\n this[++offset]\n\n return (BigInt(val) << BigInt(32)) +\n BigInt(this[++offset] * 2 ** 24 +\n this[++offset] * 2 ** 16 +\n this[++offset] * 2 ** 8 +\n last)\n})\n\nBuffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, true, 23, 4)\n}\n\nBuffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, false, 23, 4)\n}\n\nBuffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, true, 52, 8)\n}\n\nBuffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, false, 52, 8)\n}\n\nfunction checkInt (buf, value, offset, ext, max, min) {\n if (!Buffer.isBuffer(buf)) throw new TypeError('\"buffer\" argument must be a Buffer instance')\n if (value > max || value < min) throw new RangeError('\"value\" argument is out of bounds')\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n}\n\nBuffer.prototype.writeUintLE =\nBuffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) {\n const maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n let mul = 1\n let i = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUintBE =\nBuffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) {\n const maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n let i = byteLength - 1\n let mul = 1\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUint8 =\nBuffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nBuffer.prototype.writeUint16LE =\nBuffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n return offset + 2\n}\n\nBuffer.prototype.writeUint16BE =\nBuffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n return offset + 2\n}\n\nBuffer.prototype.writeUint32LE =\nBuffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n this[offset + 3] = (value >>> 24)\n this[offset + 2] = (value >>> 16)\n this[offset + 1] = (value >>> 8)\n this[offset] = (value & 0xff)\n return offset + 4\n}\n\nBuffer.prototype.writeUint32BE =\nBuffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n return offset + 4\n}\n\nfunction wrtBigUInt64LE (buf, value, offset, min, max) {\n checkIntBI(value, min, max, buf, offset, 7)\n\n let lo = Number(value & BigInt(0xffffffff))\n buf[offset++] = lo\n lo = lo >> 8\n buf[offset++] = lo\n lo = lo >> 8\n buf[offset++] = lo\n lo = lo >> 8\n buf[offset++] = lo\n let hi = Number(value >> BigInt(32) & BigInt(0xffffffff))\n buf[offset++] = hi\n hi = hi >> 8\n buf[offset++] = hi\n hi = hi >> 8\n buf[offset++] = hi\n hi = hi >> 8\n buf[offset++] = hi\n return offset\n}\n\nfunction wrtBigUInt64BE (buf, value, offset, min, max) {\n checkIntBI(value, min, max, buf, offset, 7)\n\n let lo = Number(value & BigInt(0xffffffff))\n buf[offset + 7] = lo\n lo = lo >> 8\n buf[offset + 6] = lo\n lo = lo >> 8\n buf[offset + 5] = lo\n lo = lo >> 8\n buf[offset + 4] = lo\n let hi = Number(value >> BigInt(32) & BigInt(0xffffffff))\n buf[offset + 3] = hi\n hi = hi >> 8\n buf[offset + 2] = hi\n hi = hi >> 8\n buf[offset + 1] = hi\n hi = hi >> 8\n buf[offset] = hi\n return offset + 8\n}\n\nBuffer.prototype.writeBigUInt64LE = defineBigIntMethod(function writeBigUInt64LE (value, offset = 0) {\n return wrtBigUInt64LE(this, value, offset, BigInt(0), BigInt('0xffffffffffffffff'))\n})\n\nBuffer.prototype.writeBigUInt64BE = defineBigIntMethod(function writeBigUInt64BE (value, offset = 0) {\n return wrtBigUInt64BE(this, value, offset, BigInt(0), BigInt('0xffffffffffffffff'))\n})\n\nBuffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) {\n const limit = Math.pow(2, (8 * byteLength) - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n let i = 0\n let mul = 1\n let sub = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) {\n const limit = Math.pow(2, (8 * byteLength) - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n let i = byteLength - 1\n let mul = 1\n let sub = 0\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)\n if (value < 0) value = 0xff + value + 1\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nBuffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n return offset + 2\n}\n\nBuffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n return offset + 2\n}\n\nBuffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n this[offset + 2] = (value >>> 16)\n this[offset + 3] = (value >>> 24)\n return offset + 4\n}\n\nBuffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (value < 0) value = 0xffffffff + value + 1\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n return offset + 4\n}\n\nBuffer.prototype.writeBigInt64LE = defineBigIntMethod(function writeBigInt64LE (value, offset = 0) {\n return wrtBigUInt64LE(this, value, offset, -BigInt('0x8000000000000000'), BigInt('0x7fffffffffffffff'))\n})\n\nBuffer.prototype.writeBigInt64BE = defineBigIntMethod(function writeBigInt64BE (value, offset = 0) {\n return wrtBigUInt64BE(this, value, offset, -BigInt('0x8000000000000000'), BigInt('0x7fffffffffffffff'))\n})\n\nfunction checkIEEE754 (buf, value, offset, ext, max, min) {\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n if (offset < 0) throw new RangeError('Index out of range')\n}\n\nfunction writeFloat (buf, value, offset, littleEndian, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)\n }\n ieee754.write(buf, value, offset, littleEndian, 23, 4)\n return offset + 4\n}\n\nBuffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {\n return writeFloat(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {\n return writeFloat(this, value, offset, false, noAssert)\n}\n\nfunction writeDouble (buf, value, offset, littleEndian, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)\n }\n ieee754.write(buf, value, offset, littleEndian, 52, 8)\n return offset + 8\n}\n\nBuffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {\n return writeDouble(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {\n return writeDouble(this, value, offset, false, noAssert)\n}\n\n// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)\nBuffer.prototype.copy = function copy (target, targetStart, start, end) {\n if (!Buffer.isBuffer(target)) throw new TypeError('argument should be a Buffer')\n if (!start) start = 0\n if (!end && end !== 0) end = this.length\n if (targetStart >= target.length) targetStart = target.length\n if (!targetStart) targetStart = 0\n if (end > 0 && end < start) end = start\n\n // Copy 0 bytes; we're done\n if (end === start) return 0\n if (target.length === 0 || this.length === 0) return 0\n\n // Fatal error conditions\n if (targetStart < 0) {\n throw new RangeError('targetStart out of bounds')\n }\n if (start < 0 || start >= this.length) throw new RangeError('Index out of range')\n if (end < 0) throw new RangeError('sourceEnd out of bounds')\n\n // Are we oob?\n if (end > this.length) end = this.length\n if (target.length - targetStart < end - start) {\n end = target.length - targetStart + start\n }\n\n const len = end - start\n\n if (this === target && typeof Uint8Array.prototype.copyWithin === 'function') {\n // Use built-in when available, missing from IE11\n this.copyWithin(targetStart, start, end)\n } else {\n Uint8Array.prototype.set.call(\n target,\n this.subarray(start, end),\n targetStart\n )\n }\n\n return len\n}\n\n// Usage:\n// buffer.fill(number[, offset[, end]])\n// buffer.fill(buffer[, offset[, end]])\n// buffer.fill(string[, offset[, end]][, encoding])\nBuffer.prototype.fill = function fill (val, start, end, encoding) {\n // Handle string cases:\n if (typeof val === 'string') {\n if (typeof start === 'string') {\n encoding = start\n start = 0\n end = this.length\n } else if (typeof end === 'string') {\n encoding = end\n end = this.length\n }\n if (encoding !== undefined && typeof encoding !== 'string') {\n throw new TypeError('encoding must be a string')\n }\n if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {\n throw new TypeError('Unknown encoding: ' + encoding)\n }\n if (val.length === 1) {\n const code = val.charCodeAt(0)\n if ((encoding === 'utf8' && code < 128) ||\n encoding === 'latin1') {\n // Fast path: If `val` fits into a single byte, use that numeric value.\n val = code\n }\n }\n } else if (typeof val === 'number') {\n val = val & 255\n } else if (typeof val === 'boolean') {\n val = Number(val)\n }\n\n // Invalid ranges are not set to a default, so can range check early.\n if (start < 0 || this.length < start || this.length < end) {\n throw new RangeError('Out of range index')\n }\n\n if (end <= start) {\n return this\n }\n\n start = start >>> 0\n end = end === undefined ? this.length : end >>> 0\n\n if (!val) val = 0\n\n let i\n if (typeof val === 'number') {\n for (i = start; i < end; ++i) {\n this[i] = val\n }\n } else {\n const bytes = Buffer.isBuffer(val)\n ? val\n : Buffer.from(val, encoding)\n const len = bytes.length\n if (len === 0) {\n throw new TypeError('The value \"' + val +\n '\" is invalid for argument \"value\"')\n }\n for (i = 0; i < end - start; ++i) {\n this[i + start] = bytes[i % len]\n }\n }\n\n return this\n}\n\n// CUSTOM ERRORS\n// =============\n\n// Simplified versions from Node, changed for Buffer-only usage\nconst errors = {}\nfunction E (sym, getMessage, Base) {\n errors[sym] = class NodeError extends Base {\n constructor () {\n super()\n\n Object.defineProperty(this, 'message', {\n value: getMessage.apply(this, arguments),\n writable: true,\n configurable: true\n })\n\n // Add the error code to the name to include it in the stack trace.\n this.name = `${this.name} [${sym}]`\n // Access the stack to generate the error message including the error code\n // from the name.\n this.stack // eslint-disable-line no-unused-expressions\n // Reset the name to the actual name.\n delete this.name\n }\n\n get code () {\n return sym\n }\n\n set code (value) {\n Object.defineProperty(this, 'code', {\n configurable: true,\n enumerable: true,\n value,\n writable: true\n })\n }\n\n toString () {\n return `${this.name} [${sym}]: ${this.message}`\n }\n }\n}\n\nE('ERR_BUFFER_OUT_OF_BOUNDS',\n function (name) {\n if (name) {\n return `${name} is outside of buffer bounds`\n }\n\n return 'Attempt to access memory outside buffer bounds'\n }, RangeError)\nE('ERR_INVALID_ARG_TYPE',\n function (name, actual) {\n return `The \"${name}\" argument must be of type number. Received type ${typeof actual}`\n }, TypeError)\nE('ERR_OUT_OF_RANGE',\n function (str, range, input) {\n let msg = `The value of \"${str}\" is out of range.`\n let received = input\n if (Number.isInteger(input) && Math.abs(input) > 2 ** 32) {\n received = addNumericalSeparator(String(input))\n } else if (typeof input === 'bigint') {\n received = String(input)\n if (input > BigInt(2) ** BigInt(32) || input < -(BigInt(2) ** BigInt(32))) {\n received = addNumericalSeparator(received)\n }\n received += 'n'\n }\n msg += ` It must be ${range}. Received ${received}`\n return msg\n }, RangeError)\n\nfunction addNumericalSeparator (val) {\n let res = ''\n let i = val.length\n const start = val[0] === '-' ? 1 : 0\n for (; i >= start + 4; i -= 3) {\n res = `_${val.slice(i - 3, i)}${res}`\n }\n return `${val.slice(0, i)}${res}`\n}\n\n// CHECK FUNCTIONS\n// ===============\n\nfunction checkBounds (buf, offset, byteLength) {\n validateNumber(offset, 'offset')\n if (buf[offset] === undefined || buf[offset + byteLength] === undefined) {\n boundsError(offset, buf.length - (byteLength + 1))\n }\n}\n\nfunction checkIntBI (value, min, max, buf, offset, byteLength) {\n if (value > max || value < min) {\n const n = typeof min === 'bigint' ? 'n' : ''\n let range\n if (byteLength > 3) {\n if (min === 0 || min === BigInt(0)) {\n range = `>= 0${n} and < 2${n} ** ${(byteLength + 1) * 8}${n}`\n } else {\n range = `>= -(2${n} ** ${(byteLength + 1) * 8 - 1}${n}) and < 2 ** ` +\n `${(byteLength + 1) * 8 - 1}${n}`\n }\n } else {\n range = `>= ${min}${n} and <= ${max}${n}`\n }\n throw new errors.ERR_OUT_OF_RANGE('value', range, value)\n }\n checkBounds(buf, offset, byteLength)\n}\n\nfunction validateNumber (value, name) {\n if (typeof value !== 'number') {\n throw new errors.ERR_INVALID_ARG_TYPE(name, 'number', value)\n }\n}\n\nfunction boundsError (value, length, type) {\n if (Math.floor(value) !== value) {\n validateNumber(value, type)\n throw new errors.ERR_OUT_OF_RANGE(type || 'offset', 'an integer', value)\n }\n\n if (length < 0) {\n throw new errors.ERR_BUFFER_OUT_OF_BOUNDS()\n }\n\n throw new errors.ERR_OUT_OF_RANGE(type || 'offset',\n `>= ${type ? 1 : 0} and <= ${length}`,\n value)\n}\n\n// HELPER FUNCTIONS\n// ================\n\nconst INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g\n\nfunction base64clean (str) {\n // Node takes equal signs as end of the Base64 encoding\n str = str.split('=')[0]\n // Node strips out invalid characters like \\n and \\t from the string, base64-js does not\n str = str.trim().replace(INVALID_BASE64_RE, '')\n // Node converts strings with length < 2 to ''\n if (str.length < 2) return ''\n // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not\n while (str.length % 4 !== 0) {\n str = str + '='\n }\n return str\n}\n\nfunction utf8ToBytes (string, units) {\n units = units || Infinity\n let codePoint\n const length = string.length\n let leadSurrogate = null\n const bytes = []\n\n for (let i = 0; i < length; ++i) {\n codePoint = string.charCodeAt(i)\n\n // is surrogate component\n if (codePoint > 0xD7FF && codePoint < 0xE000) {\n // last char was a lead\n if (!leadSurrogate) {\n // no lead yet\n if (codePoint > 0xDBFF) {\n // unexpected trail\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n } else if (i + 1 === length) {\n // unpaired lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n }\n\n // valid lead\n leadSurrogate = codePoint\n\n continue\n }\n\n // 2 leads in a row\n if (codePoint < 0xDC00) {\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n leadSurrogate = codePoint\n continue\n }\n\n // valid surrogate pair\n codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000\n } else if (leadSurrogate) {\n // valid bmp char, but last char was a lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n }\n\n leadSurrogate = null\n\n // encode utf8\n if (codePoint < 0x80) {\n if ((units -= 1) < 0) break\n bytes.push(codePoint)\n } else if (codePoint < 0x800) {\n if ((units -= 2) < 0) break\n bytes.push(\n codePoint >> 0x6 | 0xC0,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x10000) {\n if ((units -= 3) < 0) break\n bytes.push(\n codePoint >> 0xC | 0xE0,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x110000) {\n if ((units -= 4) < 0) break\n bytes.push(\n codePoint >> 0x12 | 0xF0,\n codePoint >> 0xC & 0x3F | 0x80,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else {\n throw new Error('Invalid code point')\n }\n }\n\n return bytes\n}\n\nfunction asciiToBytes (str) {\n const byteArray = []\n for (let i = 0; i < str.length; ++i) {\n // Node's code seems to be doing this and not & 0x7F..\n byteArray.push(str.charCodeAt(i) & 0xFF)\n }\n return byteArray\n}\n\nfunction utf16leToBytes (str, units) {\n let c, hi, lo\n const byteArray = []\n for (let i = 0; i < str.length; ++i) {\n if ((units -= 2) < 0) break\n\n c = str.charCodeAt(i)\n hi = c >> 8\n lo = c % 256\n byteArray.push(lo)\n byteArray.push(hi)\n }\n\n return byteArray\n}\n\nfunction base64ToBytes (str) {\n return base64.toByteArray(base64clean(str))\n}\n\nfunction blitBuffer (src, dst, offset, length) {\n let i\n for (i = 0; i < length; ++i) {\n if ((i + offset >= dst.length) || (i >= src.length)) break\n dst[i + offset] = src[i]\n }\n return i\n}\n\n// ArrayBuffer or Uint8Array objects from other contexts (i.e. iframes) do not pass\n// the `instanceof` check but they should be treated as of that type.\n// See: https://github.com/feross/buffer/issues/166\nfunction isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}\nfunction numberIsNaN (obj) {\n // For IE11 support\n return obj !== obj // eslint-disable-line no-self-compare\n}\n\n// Create lookup table for `toString('hex')`\n// See: https://github.com/feross/buffer/issues/219\nconst hexSliceLookupTable = (function () {\n const alphabet = '0123456789abcdef'\n const table = new Array(256)\n for (let i = 0; i < 16; ++i) {\n const i16 = i * 16\n for (let j = 0; j < 16; ++j) {\n table[i16 + j] = alphabet[i] + alphabet[j]\n }\n }\n return table\n})()\n\n// Return not function with Error if BigInt not supported\nfunction defineBigIntMethod (fn) {\n return typeof BigInt === 'undefined' ? BufferBigIntNotDefined : fn\n}\n\nfunction BufferBigIntNotDefined () {\n throw new Error('BigInt not supported')\n}\n\n\n//# sourceURL=webpack://hsync/./node_modules/buffer/index.js?");
|
|
112
|
+
|
|
113
|
+
/***/ }),
|
|
114
|
+
|
|
115
|
+
/***/ "./node_modules/debug/src/browser.js":
|
|
116
|
+
/*!*******************************************!*\
|
|
117
|
+
!*** ./node_modules/debug/src/browser.js ***!
|
|
118
|
+
\*******************************************/
|
|
119
|
+
/***/ ((module, exports, __webpack_require__) => {
|
|
120
|
+
|
|
121
|
+
eval("/* eslint-env browser */\n\n/**\n * This is the web browser implementation of `debug()`.\n */\n\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.storage = localstorage();\nexports.destroy = (() => {\n\tlet warned = false;\n\n\treturn () => {\n\t\tif (!warned) {\n\t\t\twarned = true;\n\t\t\tconsole.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');\n\t\t}\n\t};\n})();\n\n/**\n * Colors.\n */\n\nexports.colors = [\n\t'#0000CC',\n\t'#0000FF',\n\t'#0033CC',\n\t'#0033FF',\n\t'#0066CC',\n\t'#0066FF',\n\t'#0099CC',\n\t'#0099FF',\n\t'#00CC00',\n\t'#00CC33',\n\t'#00CC66',\n\t'#00CC99',\n\t'#00CCCC',\n\t'#00CCFF',\n\t'#3300CC',\n\t'#3300FF',\n\t'#3333CC',\n\t'#3333FF',\n\t'#3366CC',\n\t'#3366FF',\n\t'#3399CC',\n\t'#3399FF',\n\t'#33CC00',\n\t'#33CC33',\n\t'#33CC66',\n\t'#33CC99',\n\t'#33CCCC',\n\t'#33CCFF',\n\t'#6600CC',\n\t'#6600FF',\n\t'#6633CC',\n\t'#6633FF',\n\t'#66CC00',\n\t'#66CC33',\n\t'#9900CC',\n\t'#9900FF',\n\t'#9933CC',\n\t'#9933FF',\n\t'#99CC00',\n\t'#99CC33',\n\t'#CC0000',\n\t'#CC0033',\n\t'#CC0066',\n\t'#CC0099',\n\t'#CC00CC',\n\t'#CC00FF',\n\t'#CC3300',\n\t'#CC3333',\n\t'#CC3366',\n\t'#CC3399',\n\t'#CC33CC',\n\t'#CC33FF',\n\t'#CC6600',\n\t'#CC6633',\n\t'#CC9900',\n\t'#CC9933',\n\t'#CCCC00',\n\t'#CCCC33',\n\t'#FF0000',\n\t'#FF0033',\n\t'#FF0066',\n\t'#FF0099',\n\t'#FF00CC',\n\t'#FF00FF',\n\t'#FF3300',\n\t'#FF3333',\n\t'#FF3366',\n\t'#FF3399',\n\t'#FF33CC',\n\t'#FF33FF',\n\t'#FF6600',\n\t'#FF6633',\n\t'#FF9900',\n\t'#FF9933',\n\t'#FFCC00',\n\t'#FFCC33'\n];\n\n/**\n * Currently only WebKit-based Web Inspectors, Firefox >= v31,\n * and the Firebug extension (any Firefox version) are known\n * to support \"%c\" CSS customizations.\n *\n * TODO: add a `localStorage` variable to explicitly enable/disable colors\n */\n\n// eslint-disable-next-line complexity\nfunction useColors() {\n\t// NB: In an Electron preload script, document will be defined but not fully\n\t// initialized. Since we know we're in Chrome, we'll just detect this case\n\t// explicitly\n\tif (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {\n\t\treturn true;\n\t}\n\n\t// Internet Explorer and Edge do not support colors.\n\tif (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\\/(\\d+)/)) {\n\t\treturn false;\n\t}\n\n\t// Is webkit? http://stackoverflow.com/a/16459606/376773\n\t// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\n\treturn (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||\n\t\t// Is firebug? http://stackoverflow.com/a/398120/376773\n\t\t(typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||\n\t\t// Is firefox >= v31?\n\t\t// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||\n\t\t// Double check webkit in userAgent just in case we are in a worker\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/));\n}\n\n/**\n * Colorize log arguments if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n\targs[0] = (this.useColors ? '%c' : '') +\n\t\tthis.namespace +\n\t\t(this.useColors ? ' %c' : ' ') +\n\t\targs[0] +\n\t\t(this.useColors ? '%c ' : ' ') +\n\t\t'+' + module.exports.humanize(this.diff);\n\n\tif (!this.useColors) {\n\t\treturn;\n\t}\n\n\tconst c = 'color: ' + this.color;\n\targs.splice(1, 0, c, 'color: inherit');\n\n\t// The final \"%c\" is somewhat tricky, because there could be other\n\t// arguments passed either before or after the %c, so we need to\n\t// figure out the correct index to insert the CSS into\n\tlet index = 0;\n\tlet lastC = 0;\n\targs[0].replace(/%[a-zA-Z%]/g, match => {\n\t\tif (match === '%%') {\n\t\t\treturn;\n\t\t}\n\t\tindex++;\n\t\tif (match === '%c') {\n\t\t\t// We only are interested in the *last* %c\n\t\t\t// (the user may have provided their own)\n\t\t\tlastC = index;\n\t\t}\n\t});\n\n\targs.splice(lastC, 0, c);\n}\n\n/**\n * Invokes `console.debug()` when available.\n * No-op when `console.debug` is not a \"function\".\n * If `console.debug` is not available, falls back\n * to `console.log`.\n *\n * @api public\n */\nexports.log = console.debug || console.log || (() => {});\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\nfunction save(namespaces) {\n\ttry {\n\t\tif (namespaces) {\n\t\t\texports.storage.setItem('debug', namespaces);\n\t\t} else {\n\t\t\texports.storage.removeItem('debug');\n\t\t}\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\nfunction load() {\n\tlet r;\n\ttry {\n\t\tr = exports.storage.getItem('debug');\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n\n\t// If debug isn't set in LS, and we're in Electron, try to load $DEBUG\n\tif (!r && typeof process !== 'undefined' && 'env' in process) {\n\t\tr = process.env.DEBUG;\n\t}\n\n\treturn r;\n}\n\n/**\n * Localstorage attempts to return the localstorage.\n *\n * This is necessary because safari throws\n * when a user disables cookies/localstorage\n * and you attempt to access it.\n *\n * @return {LocalStorage}\n * @api private\n */\n\nfunction localstorage() {\n\ttry {\n\t\t// TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context\n\t\t// The Browser also has localStorage in the global context.\n\t\treturn localStorage;\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\nmodule.exports = __webpack_require__(/*! ./common */ \"./node_modules/debug/src/common.js\")(exports);\n\nconst {formatters} = module.exports;\n\n/**\n * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\n */\n\nformatters.j = function (v) {\n\ttry {\n\t\treturn JSON.stringify(v);\n\t} catch (error) {\n\t\treturn '[UnexpectedJSONParseError]: ' + error.message;\n\t}\n};\n\n\n//# sourceURL=webpack://hsync/./node_modules/debug/src/browser.js?");
|
|
122
|
+
|
|
123
|
+
/***/ }),
|
|
124
|
+
|
|
125
|
+
/***/ "./node_modules/debug/src/common.js":
|
|
126
|
+
/*!******************************************!*\
|
|
127
|
+
!*** ./node_modules/debug/src/common.js ***!
|
|
128
|
+
\******************************************/
|
|
129
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
130
|
+
|
|
131
|
+
eval("\n/**\n * This is the common logic for both the Node.js and web browser\n * implementations of `debug()`.\n */\n\nfunction setup(env) {\n\tcreateDebug.debug = createDebug;\n\tcreateDebug.default = createDebug;\n\tcreateDebug.coerce = coerce;\n\tcreateDebug.disable = disable;\n\tcreateDebug.enable = enable;\n\tcreateDebug.enabled = enabled;\n\tcreateDebug.humanize = __webpack_require__(/*! ms */ \"./node_modules/ms/index.js\");\n\tcreateDebug.destroy = destroy;\n\n\tObject.keys(env).forEach(key => {\n\t\tcreateDebug[key] = env[key];\n\t});\n\n\t/**\n\t* The currently active debug mode names, and names to skip.\n\t*/\n\n\tcreateDebug.names = [];\n\tcreateDebug.skips = [];\n\n\t/**\n\t* Map of special \"%n\" handling functions, for the debug \"format\" argument.\n\t*\n\t* Valid key names are a single, lower or upper-case letter, i.e. \"n\" and \"N\".\n\t*/\n\tcreateDebug.formatters = {};\n\n\t/**\n\t* Selects a color for a debug namespace\n\t* @param {String} namespace The namespace string for the debug instance to be colored\n\t* @return {Number|String} An ANSI color code for the given namespace\n\t* @api private\n\t*/\n\tfunction selectColor(namespace) {\n\t\tlet hash = 0;\n\n\t\tfor (let i = 0; i < namespace.length; i++) {\n\t\t\thash = ((hash << 5) - hash) + namespace.charCodeAt(i);\n\t\t\thash |= 0; // Convert to 32bit integer\n\t\t}\n\n\t\treturn createDebug.colors[Math.abs(hash) % createDebug.colors.length];\n\t}\n\tcreateDebug.selectColor = selectColor;\n\n\t/**\n\t* Create a debugger with the given `namespace`.\n\t*\n\t* @param {String} namespace\n\t* @return {Function}\n\t* @api public\n\t*/\n\tfunction createDebug(namespace) {\n\t\tlet prevTime;\n\t\tlet enableOverride = null;\n\t\tlet namespacesCache;\n\t\tlet enabledCache;\n\n\t\tfunction debug(...args) {\n\t\t\t// Disabled?\n\t\t\tif (!debug.enabled) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst self = debug;\n\n\t\t\t// Set `diff` timestamp\n\t\t\tconst curr = Number(new Date());\n\t\t\tconst ms = curr - (prevTime || curr);\n\t\t\tself.diff = ms;\n\t\t\tself.prev = prevTime;\n\t\t\tself.curr = curr;\n\t\t\tprevTime = curr;\n\n\t\t\targs[0] = createDebug.coerce(args[0]);\n\n\t\t\tif (typeof args[0] !== 'string') {\n\t\t\t\t// Anything else let's inspect with %O\n\t\t\t\targs.unshift('%O');\n\t\t\t}\n\n\t\t\t// Apply any `formatters` transformations\n\t\t\tlet index = 0;\n\t\t\targs[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {\n\t\t\t\t// If we encounter an escaped % then don't increase the array index\n\t\t\t\tif (match === '%%') {\n\t\t\t\t\treturn '%';\n\t\t\t\t}\n\t\t\t\tindex++;\n\t\t\t\tconst formatter = createDebug.formatters[format];\n\t\t\t\tif (typeof formatter === 'function') {\n\t\t\t\t\tconst val = args[index];\n\t\t\t\t\tmatch = formatter.call(self, val);\n\n\t\t\t\t\t// Now we need to remove `args[index]` since it's inlined in the `format`\n\t\t\t\t\targs.splice(index, 1);\n\t\t\t\t\tindex--;\n\t\t\t\t}\n\t\t\t\treturn match;\n\t\t\t});\n\n\t\t\t// Apply env-specific formatting (colors, etc.)\n\t\t\tcreateDebug.formatArgs.call(self, args);\n\n\t\t\tconst logFn = self.log || createDebug.log;\n\t\t\tlogFn.apply(self, args);\n\t\t}\n\n\t\tdebug.namespace = namespace;\n\t\tdebug.useColors = createDebug.useColors();\n\t\tdebug.color = createDebug.selectColor(namespace);\n\t\tdebug.extend = extend;\n\t\tdebug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release.\n\n\t\tObject.defineProperty(debug, 'enabled', {\n\t\t\tenumerable: true,\n\t\t\tconfigurable: false,\n\t\t\tget: () => {\n\t\t\t\tif (enableOverride !== null) {\n\t\t\t\t\treturn enableOverride;\n\t\t\t\t}\n\t\t\t\tif (namespacesCache !== createDebug.namespaces) {\n\t\t\t\t\tnamespacesCache = createDebug.namespaces;\n\t\t\t\t\tenabledCache = createDebug.enabled(namespace);\n\t\t\t\t}\n\n\t\t\t\treturn enabledCache;\n\t\t\t},\n\t\t\tset: v => {\n\t\t\t\tenableOverride = v;\n\t\t\t}\n\t\t});\n\n\t\t// Env-specific initialization logic for debug instances\n\t\tif (typeof createDebug.init === 'function') {\n\t\t\tcreateDebug.init(debug);\n\t\t}\n\n\t\treturn debug;\n\t}\n\n\tfunction extend(namespace, delimiter) {\n\t\tconst newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);\n\t\tnewDebug.log = this.log;\n\t\treturn newDebug;\n\t}\n\n\t/**\n\t* Enables a debug mode by namespaces. This can include modes\n\t* separated by a colon and wildcards.\n\t*\n\t* @param {String} namespaces\n\t* @api public\n\t*/\n\tfunction enable(namespaces) {\n\t\tcreateDebug.save(namespaces);\n\t\tcreateDebug.namespaces = namespaces;\n\n\t\tcreateDebug.names = [];\n\t\tcreateDebug.skips = [];\n\n\t\tlet i;\n\t\tconst split = (typeof namespaces === 'string' ? namespaces : '').split(/[\\s,]+/);\n\t\tconst len = split.length;\n\n\t\tfor (i = 0; i < len; i++) {\n\t\t\tif (!split[i]) {\n\t\t\t\t// ignore empty strings\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tnamespaces = split[i].replace(/\\*/g, '.*?');\n\n\t\t\tif (namespaces[0] === '-') {\n\t\t\t\tcreateDebug.skips.push(new RegExp('^' + namespaces.slice(1) + '$'));\n\t\t\t} else {\n\t\t\t\tcreateDebug.names.push(new RegExp('^' + namespaces + '$'));\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t* Disable debug output.\n\t*\n\t* @return {String} namespaces\n\t* @api public\n\t*/\n\tfunction disable() {\n\t\tconst namespaces = [\n\t\t\t...createDebug.names.map(toNamespace),\n\t\t\t...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace)\n\t\t].join(',');\n\t\tcreateDebug.enable('');\n\t\treturn namespaces;\n\t}\n\n\t/**\n\t* Returns true if the given mode name is enabled, false otherwise.\n\t*\n\t* @param {String} name\n\t* @return {Boolean}\n\t* @api public\n\t*/\n\tfunction enabled(name) {\n\t\tif (name[name.length - 1] === '*') {\n\t\t\treturn true;\n\t\t}\n\n\t\tlet i;\n\t\tlet len;\n\n\t\tfor (i = 0, len = createDebug.skips.length; i < len; i++) {\n\t\t\tif (createDebug.skips[i].test(name)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tfor (i = 0, len = createDebug.names.length; i < len; i++) {\n\t\t\tif (createDebug.names[i].test(name)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t* Convert regexp to namespace\n\t*\n\t* @param {RegExp} regxep\n\t* @return {String} namespace\n\t* @api private\n\t*/\n\tfunction toNamespace(regexp) {\n\t\treturn regexp.toString()\n\t\t\t.substring(2, regexp.toString().length - 2)\n\t\t\t.replace(/\\.\\*\\?$/, '*');\n\t}\n\n\t/**\n\t* Coerce `val`.\n\t*\n\t* @param {Mixed} val\n\t* @return {Mixed}\n\t* @api private\n\t*/\n\tfunction coerce(val) {\n\t\tif (val instanceof Error) {\n\t\t\treturn val.stack || val.message;\n\t\t}\n\t\treturn val;\n\t}\n\n\t/**\n\t* XXX DO NOT USE. This is a temporary stub function.\n\t* XXX It WILL be removed in the next major release.\n\t*/\n\tfunction destroy() {\n\t\tconsole.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');\n\t}\n\n\tcreateDebug.enable(createDebug.load());\n\n\treturn createDebug;\n}\n\nmodule.exports = setup;\n\n\n//# sourceURL=webpack://hsync/./node_modules/debug/src/common.js?");
|
|
132
|
+
|
|
133
|
+
/***/ }),
|
|
134
|
+
|
|
135
|
+
/***/ "./node_modules/events/events.js":
|
|
136
|
+
/*!***************************************!*\
|
|
137
|
+
!*** ./node_modules/events/events.js ***!
|
|
138
|
+
\***************************************/
|
|
139
|
+
/***/ ((module) => {
|
|
140
|
+
|
|
141
|
+
"use strict";
|
|
142
|
+
eval("// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\n\nvar R = typeof Reflect === 'object' ? Reflect : null\nvar ReflectApply = R && typeof R.apply === 'function'\n ? R.apply\n : function ReflectApply(target, receiver, args) {\n return Function.prototype.apply.call(target, receiver, args);\n }\n\nvar ReflectOwnKeys\nif (R && typeof R.ownKeys === 'function') {\n ReflectOwnKeys = R.ownKeys\n} else if (Object.getOwnPropertySymbols) {\n ReflectOwnKeys = function ReflectOwnKeys(target) {\n return Object.getOwnPropertyNames(target)\n .concat(Object.getOwnPropertySymbols(target));\n };\n} else {\n ReflectOwnKeys = function ReflectOwnKeys(target) {\n return Object.getOwnPropertyNames(target);\n };\n}\n\nfunction ProcessEmitWarning(warning) {\n if (console && console.warn) console.warn(warning);\n}\n\nvar NumberIsNaN = Number.isNaN || function NumberIsNaN(value) {\n return value !== value;\n}\n\nfunction EventEmitter() {\n EventEmitter.init.call(this);\n}\nmodule.exports = EventEmitter;\nmodule.exports.once = once;\n\n// Backwards-compat with node 0.10.x\nEventEmitter.EventEmitter = EventEmitter;\n\nEventEmitter.prototype._events = undefined;\nEventEmitter.prototype._eventsCount = 0;\nEventEmitter.prototype._maxListeners = undefined;\n\n// By default EventEmitters will print a warning if more than 10 listeners are\n// added to it. This is a useful default which helps finding memory leaks.\nvar defaultMaxListeners = 10;\n\nfunction checkListener(listener) {\n if (typeof listener !== 'function') {\n throw new TypeError('The \"listener\" argument must be of type Function. Received type ' + typeof listener);\n }\n}\n\nObject.defineProperty(EventEmitter, 'defaultMaxListeners', {\n enumerable: true,\n get: function() {\n return defaultMaxListeners;\n },\n set: function(arg) {\n if (typeof arg !== 'number' || arg < 0 || NumberIsNaN(arg)) {\n throw new RangeError('The value of \"defaultMaxListeners\" is out of range. It must be a non-negative number. Received ' + arg + '.');\n }\n defaultMaxListeners = arg;\n }\n});\n\nEventEmitter.init = function() {\n\n if (this._events === undefined ||\n this._events === Object.getPrototypeOf(this)._events) {\n this._events = Object.create(null);\n this._eventsCount = 0;\n }\n\n this._maxListeners = this._maxListeners || undefined;\n};\n\n// Obviously not all Emitters should be limited to 10. This function allows\n// that to be increased. Set to zero for unlimited.\nEventEmitter.prototype.setMaxListeners = function setMaxListeners(n) {\n if (typeof n !== 'number' || n < 0 || NumberIsNaN(n)) {\n throw new RangeError('The value of \"n\" is out of range. It must be a non-negative number. Received ' + n + '.');\n }\n this._maxListeners = n;\n return this;\n};\n\nfunction _getMaxListeners(that) {\n if (that._maxListeners === undefined)\n return EventEmitter.defaultMaxListeners;\n return that._maxListeners;\n}\n\nEventEmitter.prototype.getMaxListeners = function getMaxListeners() {\n return _getMaxListeners(this);\n};\n\nEventEmitter.prototype.emit = function emit(type) {\n var args = [];\n for (var i = 1; i < arguments.length; i++) args.push(arguments[i]);\n var doError = (type === 'error');\n\n var events = this._events;\n if (events !== undefined)\n doError = (doError && events.error === undefined);\n else if (!doError)\n return false;\n\n // If there is no 'error' event listener then throw.\n if (doError) {\n var er;\n if (args.length > 0)\n er = args[0];\n if (er instanceof Error) {\n // Note: The comments on the `throw` lines are intentional, they show\n // up in Node's output if this results in an unhandled exception.\n throw er; // Unhandled 'error' event\n }\n // At least give some kind of context to the user\n var err = new Error('Unhandled error.' + (er ? ' (' + er.message + ')' : ''));\n err.context = er;\n throw err; // Unhandled 'error' event\n }\n\n var handler = events[type];\n\n if (handler === undefined)\n return false;\n\n if (typeof handler === 'function') {\n ReflectApply(handler, this, args);\n } else {\n var len = handler.length;\n var listeners = arrayClone(handler, len);\n for (var i = 0; i < len; ++i)\n ReflectApply(listeners[i], this, args);\n }\n\n return true;\n};\n\nfunction _addListener(target, type, listener, prepend) {\n var m;\n var events;\n var existing;\n\n checkListener(listener);\n\n events = target._events;\n if (events === undefined) {\n events = target._events = Object.create(null);\n target._eventsCount = 0;\n } else {\n // To avoid recursion in the case that type === \"newListener\"! Before\n // adding it to the listeners, first emit \"newListener\".\n if (events.newListener !== undefined) {\n target.emit('newListener', type,\n listener.listener ? listener.listener : listener);\n\n // Re-assign `events` because a newListener handler could have caused the\n // this._events to be assigned to a new object\n events = target._events;\n }\n existing = events[type];\n }\n\n if (existing === undefined) {\n // Optimize the case of one listener. Don't need the extra array object.\n existing = events[type] = listener;\n ++target._eventsCount;\n } else {\n if (typeof existing === 'function') {\n // Adding the second element, need to change to array.\n existing = events[type] =\n prepend ? [listener, existing] : [existing, listener];\n // If we've already got an array, just append.\n } else if (prepend) {\n existing.unshift(listener);\n } else {\n existing.push(listener);\n }\n\n // Check for listener leak\n m = _getMaxListeners(target);\n if (m > 0 && existing.length > m && !existing.warned) {\n existing.warned = true;\n // No error code for this since it is a Warning\n // eslint-disable-next-line no-restricted-syntax\n var w = new Error('Possible EventEmitter memory leak detected. ' +\n existing.length + ' ' + String(type) + ' listeners ' +\n 'added. Use emitter.setMaxListeners() to ' +\n 'increase limit');\n w.name = 'MaxListenersExceededWarning';\n w.emitter = target;\n w.type = type;\n w.count = existing.length;\n ProcessEmitWarning(w);\n }\n }\n\n return target;\n}\n\nEventEmitter.prototype.addListener = function addListener(type, listener) {\n return _addListener(this, type, listener, false);\n};\n\nEventEmitter.prototype.on = EventEmitter.prototype.addListener;\n\nEventEmitter.prototype.prependListener =\n function prependListener(type, listener) {\n return _addListener(this, type, listener, true);\n };\n\nfunction onceWrapper() {\n if (!this.fired) {\n this.target.removeListener(this.type, this.wrapFn);\n this.fired = true;\n if (arguments.length === 0)\n return this.listener.call(this.target);\n return this.listener.apply(this.target, arguments);\n }\n}\n\nfunction _onceWrap(target, type, listener) {\n var state = { fired: false, wrapFn: undefined, target: target, type: type, listener: listener };\n var wrapped = onceWrapper.bind(state);\n wrapped.listener = listener;\n state.wrapFn = wrapped;\n return wrapped;\n}\n\nEventEmitter.prototype.once = function once(type, listener) {\n checkListener(listener);\n this.on(type, _onceWrap(this, type, listener));\n return this;\n};\n\nEventEmitter.prototype.prependOnceListener =\n function prependOnceListener(type, listener) {\n checkListener(listener);\n this.prependListener(type, _onceWrap(this, type, listener));\n return this;\n };\n\n// Emits a 'removeListener' event if and only if the listener was removed.\nEventEmitter.prototype.removeListener =\n function removeListener(type, listener) {\n var list, events, position, i, originalListener;\n\n checkListener(listener);\n\n events = this._events;\n if (events === undefined)\n return this;\n\n list = events[type];\n if (list === undefined)\n return this;\n\n if (list === listener || list.listener === listener) {\n if (--this._eventsCount === 0)\n this._events = Object.create(null);\n else {\n delete events[type];\n if (events.removeListener)\n this.emit('removeListener', type, list.listener || listener);\n }\n } else if (typeof list !== 'function') {\n position = -1;\n\n for (i = list.length - 1; i >= 0; i--) {\n if (list[i] === listener || list[i].listener === listener) {\n originalListener = list[i].listener;\n position = i;\n break;\n }\n }\n\n if (position < 0)\n return this;\n\n if (position === 0)\n list.shift();\n else {\n spliceOne(list, position);\n }\n\n if (list.length === 1)\n events[type] = list[0];\n\n if (events.removeListener !== undefined)\n this.emit('removeListener', type, originalListener || listener);\n }\n\n return this;\n };\n\nEventEmitter.prototype.off = EventEmitter.prototype.removeListener;\n\nEventEmitter.prototype.removeAllListeners =\n function removeAllListeners(type) {\n var listeners, events, i;\n\n events = this._events;\n if (events === undefined)\n return this;\n\n // not listening for removeListener, no need to emit\n if (events.removeListener === undefined) {\n if (arguments.length === 0) {\n this._events = Object.create(null);\n this._eventsCount = 0;\n } else if (events[type] !== undefined) {\n if (--this._eventsCount === 0)\n this._events = Object.create(null);\n else\n delete events[type];\n }\n return this;\n }\n\n // emit removeListener for all listeners on all events\n if (arguments.length === 0) {\n var keys = Object.keys(events);\n var key;\n for (i = 0; i < keys.length; ++i) {\n key = keys[i];\n if (key === 'removeListener') continue;\n this.removeAllListeners(key);\n }\n this.removeAllListeners('removeListener');\n this._events = Object.create(null);\n this._eventsCount = 0;\n return this;\n }\n\n listeners = events[type];\n\n if (typeof listeners === 'function') {\n this.removeListener(type, listeners);\n } else if (listeners !== undefined) {\n // LIFO order\n for (i = listeners.length - 1; i >= 0; i--) {\n this.removeListener(type, listeners[i]);\n }\n }\n\n return this;\n };\n\nfunction _listeners(target, type, unwrap) {\n var events = target._events;\n\n if (events === undefined)\n return [];\n\n var evlistener = events[type];\n if (evlistener === undefined)\n return [];\n\n if (typeof evlistener === 'function')\n return unwrap ? [evlistener.listener || evlistener] : [evlistener];\n\n return unwrap ?\n unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length);\n}\n\nEventEmitter.prototype.listeners = function listeners(type) {\n return _listeners(this, type, true);\n};\n\nEventEmitter.prototype.rawListeners = function rawListeners(type) {\n return _listeners(this, type, false);\n};\n\nEventEmitter.listenerCount = function(emitter, type) {\n if (typeof emitter.listenerCount === 'function') {\n return emitter.listenerCount(type);\n } else {\n return listenerCount.call(emitter, type);\n }\n};\n\nEventEmitter.prototype.listenerCount = listenerCount;\nfunction listenerCount(type) {\n var events = this._events;\n\n if (events !== undefined) {\n var evlistener = events[type];\n\n if (typeof evlistener === 'function') {\n return 1;\n } else if (evlistener !== undefined) {\n return evlistener.length;\n }\n }\n\n return 0;\n}\n\nEventEmitter.prototype.eventNames = function eventNames() {\n return this._eventsCount > 0 ? ReflectOwnKeys(this._events) : [];\n};\n\nfunction arrayClone(arr, n) {\n var copy = new Array(n);\n for (var i = 0; i < n; ++i)\n copy[i] = arr[i];\n return copy;\n}\n\nfunction spliceOne(list, index) {\n for (; index + 1 < list.length; index++)\n list[index] = list[index + 1];\n list.pop();\n}\n\nfunction unwrapListeners(arr) {\n var ret = new Array(arr.length);\n for (var i = 0; i < ret.length; ++i) {\n ret[i] = arr[i].listener || arr[i];\n }\n return ret;\n}\n\nfunction once(emitter, name) {\n return new Promise(function (resolve, reject) {\n function errorListener(err) {\n emitter.removeListener(name, resolver);\n reject(err);\n }\n\n function resolver() {\n if (typeof emitter.removeListener === 'function') {\n emitter.removeListener('error', errorListener);\n }\n resolve([].slice.call(arguments));\n };\n\n eventTargetAgnosticAddListener(emitter, name, resolver, { once: true });\n if (name !== 'error') {\n addErrorHandlerIfEventEmitter(emitter, errorListener, { once: true });\n }\n });\n}\n\nfunction addErrorHandlerIfEventEmitter(emitter, handler, flags) {\n if (typeof emitter.on === 'function') {\n eventTargetAgnosticAddListener(emitter, 'error', handler, flags);\n }\n}\n\nfunction eventTargetAgnosticAddListener(emitter, name, listener, flags) {\n if (typeof emitter.on === 'function') {\n if (flags.once) {\n emitter.once(name, listener);\n } else {\n emitter.on(name, listener);\n }\n } else if (typeof emitter.addEventListener === 'function') {\n // EventTarget does not have `error` event semantics like Node\n // EventEmitters, we do not listen for `error` events here.\n emitter.addEventListener(name, function wrapListener(arg) {\n // IE does not have builtin `{ once: true }` support so we\n // have to do it manually.\n if (flags.once) {\n emitter.removeEventListener(name, wrapListener);\n }\n listener(arg);\n });\n } else {\n throw new TypeError('The \"emitter\" argument must be of type EventEmitter. Received type ' + typeof emitter);\n }\n}\n\n\n//# sourceURL=webpack://hsync/./node_modules/events/events.js?");
|
|
143
|
+
|
|
144
|
+
/***/ }),
|
|
145
|
+
|
|
146
|
+
/***/ "./node_modules/ieee754/index.js":
|
|
147
|
+
/*!***************************************!*\
|
|
148
|
+
!*** ./node_modules/ieee754/index.js ***!
|
|
149
|
+
\***************************************/
|
|
150
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
151
|
+
|
|
152
|
+
eval("/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */\nexports.read = function (buffer, offset, isLE, mLen, nBytes) {\n var e, m\n var eLen = (nBytes * 8) - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var nBits = -7\n var i = isLE ? (nBytes - 1) : 0\n var d = isLE ? -1 : 1\n var s = buffer[offset + i]\n\n i += d\n\n e = s & ((1 << (-nBits)) - 1)\n s >>= (-nBits)\n nBits += eLen\n for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n m = e & ((1 << (-nBits)) - 1)\n e >>= (-nBits)\n nBits += mLen\n for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n if (e === 0) {\n e = 1 - eBias\n } else if (e === eMax) {\n return m ? NaN : ((s ? -1 : 1) * Infinity)\n } else {\n m = m + Math.pow(2, mLen)\n e = e - eBias\n }\n return (s ? -1 : 1) * m * Math.pow(2, e - mLen)\n}\n\nexports.write = function (buffer, value, offset, isLE, mLen, nBytes) {\n var e, m, c\n var eLen = (nBytes * 8) - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)\n var i = isLE ? 0 : (nBytes - 1)\n var d = isLE ? 1 : -1\n var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0\n\n value = Math.abs(value)\n\n if (isNaN(value) || value === Infinity) {\n m = isNaN(value) ? 1 : 0\n e = eMax\n } else {\n e = Math.floor(Math.log(value) / Math.LN2)\n if (value * (c = Math.pow(2, -e)) < 1) {\n e--\n c *= 2\n }\n if (e + eBias >= 1) {\n value += rt / c\n } else {\n value += rt * Math.pow(2, 1 - eBias)\n }\n if (value * c >= 2) {\n e++\n c /= 2\n }\n\n if (e + eBias >= eMax) {\n m = 0\n e = eMax\n } else if (e + eBias >= 1) {\n m = ((value * c) - 1) * Math.pow(2, mLen)\n e = e + eBias\n } else {\n m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)\n e = 0\n }\n }\n\n for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}\n\n e = (e << mLen) | m\n eLen += mLen\n for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}\n\n buffer[offset + i - d] |= s * 128\n}\n\n\n//# sourceURL=webpack://hsync/./node_modules/ieee754/index.js?");
|
|
153
|
+
|
|
154
|
+
/***/ }),
|
|
155
|
+
|
|
156
|
+
/***/ "./node_modules/isomorphic-fetch/fetch-npm-browserify.js":
|
|
157
|
+
/*!***************************************************************!*\
|
|
158
|
+
!*** ./node_modules/isomorphic-fetch/fetch-npm-browserify.js ***!
|
|
159
|
+
\***************************************************************/
|
|
160
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
161
|
+
|
|
162
|
+
eval("// the whatwg-fetch polyfill installs the fetch() function\n// on the global object (window or self)\n//\n// Return that as the export for use in Webpack, Browserify etc.\n__webpack_require__(/*! whatwg-fetch */ \"./node_modules/whatwg-fetch/fetch.js\");\nmodule.exports = self.fetch.bind(self);\n\n\n//# sourceURL=webpack://hsync/./node_modules/isomorphic-fetch/fetch-npm-browserify.js?");
|
|
163
|
+
|
|
164
|
+
/***/ }),
|
|
165
|
+
|
|
166
|
+
/***/ "./node_modules/ms/index.js":
|
|
167
|
+
/*!**********************************!*\
|
|
168
|
+
!*** ./node_modules/ms/index.js ***!
|
|
169
|
+
\**********************************/
|
|
170
|
+
/***/ ((module) => {
|
|
171
|
+
|
|
172
|
+
eval("/**\n * Helpers.\n */\n\nvar s = 1000;\nvar m = s * 60;\nvar h = m * 60;\nvar d = h * 24;\nvar w = d * 7;\nvar y = d * 365.25;\n\n/**\n * Parse or format the given `val`.\n *\n * Options:\n *\n * - `long` verbose formatting [false]\n *\n * @param {String|Number} val\n * @param {Object} [options]\n * @throws {Error} throw an error if val is not a non-empty string or a number\n * @return {String|Number}\n * @api public\n */\n\nmodule.exports = function(val, options) {\n options = options || {};\n var type = typeof val;\n if (type === 'string' && val.length > 0) {\n return parse(val);\n } else if (type === 'number' && isFinite(val)) {\n return options.long ? fmtLong(val) : fmtShort(val);\n }\n throw new Error(\n 'val is not a non-empty string or a valid number. val=' +\n JSON.stringify(val)\n );\n};\n\n/**\n * Parse the given `str` and return milliseconds.\n *\n * @param {String} str\n * @return {Number}\n * @api private\n */\n\nfunction parse(str) {\n str = String(str);\n if (str.length > 100) {\n return;\n }\n var match = /^(-?(?:\\d+)?\\.?\\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(\n str\n );\n if (!match) {\n return;\n }\n var n = parseFloat(match[1]);\n var type = (match[2] || 'ms').toLowerCase();\n switch (type) {\n case 'years':\n case 'year':\n case 'yrs':\n case 'yr':\n case 'y':\n return n * y;\n case 'weeks':\n case 'week':\n case 'w':\n return n * w;\n case 'days':\n case 'day':\n case 'd':\n return n * d;\n case 'hours':\n case 'hour':\n case 'hrs':\n case 'hr':\n case 'h':\n return n * h;\n case 'minutes':\n case 'minute':\n case 'mins':\n case 'min':\n case 'm':\n return n * m;\n case 'seconds':\n case 'second':\n case 'secs':\n case 'sec':\n case 's':\n return n * s;\n case 'milliseconds':\n case 'millisecond':\n case 'msecs':\n case 'msec':\n case 'ms':\n return n;\n default:\n return undefined;\n }\n}\n\n/**\n * Short format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtShort(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return Math.round(ms / d) + 'd';\n }\n if (msAbs >= h) {\n return Math.round(ms / h) + 'h';\n }\n if (msAbs >= m) {\n return Math.round(ms / m) + 'm';\n }\n if (msAbs >= s) {\n return Math.round(ms / s) + 's';\n }\n return ms + 'ms';\n}\n\n/**\n * Long format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtLong(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return plural(ms, msAbs, d, 'day');\n }\n if (msAbs >= h) {\n return plural(ms, msAbs, h, 'hour');\n }\n if (msAbs >= m) {\n return plural(ms, msAbs, m, 'minute');\n }\n if (msAbs >= s) {\n return plural(ms, msAbs, s, 'second');\n }\n return ms + ' ms';\n}\n\n/**\n * Pluralization helper.\n */\n\nfunction plural(ms, msAbs, n, name) {\n var isPlural = msAbs >= n * 1.5;\n return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');\n}\n\n\n//# sourceURL=webpack://hsync/./node_modules/ms/index.js?");
|
|
173
|
+
|
|
174
|
+
/***/ }),
|
|
175
|
+
|
|
176
|
+
/***/ "./node_modules/net-web/net-web.js":
|
|
177
|
+
/*!*****************************************!*\
|
|
178
|
+
!*** ./node_modules/net-web/net-web.js ***!
|
|
179
|
+
\*****************************************/
|
|
180
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
181
|
+
|
|
182
|
+
eval("const EventEmitter = (__webpack_require__(/*! events */ \"./node_modules/events/events.js\").EventEmitter);\nconst pack = __webpack_require__(/*! ./package.json */ \"./node_modules/net-web/package.json\");\n\nconst events = new EventEmitter();\n\nconst servers = {};\n\nfunction Socket() {\n const socket = new EventEmitter();\n \n socket.connect = function(port, host, clientCallback) {\n events.emit(('socket_connect_' + port), {\n port,\n host,\n clientSocket: socket,\n clientCallback,\n }); \n }\n\n socket.write = function(message) {\n if (socket.serverSocket) {\n socket.serverSocket.emit('data', message);\n }\n };\n\n socket.end = function() {\n if (socket.serverSocket) {\n socket.serverSocket.emit('close');\n }\n \n }\n\n return socket;\n}\n\nfunction createServer(cb) {\n const server = new EventEmitter();\n server.listen = (port) => {\n console.log('server.listen', port);\n servers['l' + port] = server;\n events.on('socket_connect_' + port, ({ clientSocket, clientCallback }) => {\n console.log('socket_connect_' + port, clientSocket);\n const serverSocket = new EventEmitter();\n clientSocket.serverSocket = serverSocket;\n if (server.cb) {\n server.cb(serverSocket);\n }\n serverSocket.write = (data) => {\n clientSocket.emit('data', data);\n }\n serverSocket.end = () => {\n clientSocket.emit('close');\n }\n \n if (clientCallback) {\n clientCallback();\n }\n });\n };\n server.cb = cb;\n return server;\n}\n\n// hacky, but I need all things using 'net' to have the same listeners\nconst net = globalThis.nodeNetWeb || {\n Socket,\n createServer,\n events,\n EventEmitter,\n servers,\n version: pack.version,\n};\nglobalThis.nodeNetWeb = net;\n\nmodule.exports = net;\n\n\n//# sourceURL=webpack://hsync/./node_modules/net-web/net-web.js?");
|
|
183
|
+
|
|
184
|
+
/***/ }),
|
|
185
|
+
|
|
186
|
+
/***/ "./node_modules/rawr/index.js":
|
|
187
|
+
/*!************************************!*\
|
|
188
|
+
!*** ./node_modules/rawr/index.js ***!
|
|
189
|
+
\************************************/
|
|
190
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
191
|
+
|
|
192
|
+
eval("const { EventEmitter } = __webpack_require__(/*! events */ \"./node_modules/events/events.js\");\nconst transports = __webpack_require__(/*! ./transports */ \"./node_modules/rawr/transports/index.js\");\n\nfunction rawr({ transport, timeout = 0, handlers = {}, methods }) {\n let callId = 0;\n // eslint-disable-next-line no-param-reassign\n methods = methods || handlers; // backwards compat\n const pendingCalls = {};\n const methodHandlers = {};\n const notificationEvents = new EventEmitter();\n notificationEvents.on = notificationEvents.on.bind(notificationEvents);\n\n transport.on('rpc', (msg) => {\n if (msg.id) {\n // handle an RPC request\n if (msg.params && methodHandlers[msg.method]) {\n methodHandlers[msg.method](msg);\n return;\n }\n // handle an RPC result\n const promise = pendingCalls[msg.id];\n if (promise) {\n if (promise.timeoutId) {\n clearTimeout(promise.timeoutId);\n }\n delete pendingCalls[msg.id];\n if (msg.error) {\n promise.reject(msg.error);\n }\n return promise.resolve(msg.result);\n }\n return;\n }\n // handle a notification\n msg.params.unshift(msg.method);\n notificationEvents.emit(...msg.params);\n });\n\n function addHandler(methodName, handler) {\n methodHandlers[methodName] = (msg) => {\n Promise.resolve()\n .then(() => {\n return handler.apply(this, msg.params);\n })\n .then((result) => {\n transport.send({\n id: msg.id,\n result\n });\n })\n .catch((error) => {\n const serializedError = { message: error.message };\n if (error.code) {\n serializedError.code = error.code;\n }\n transport.send({\n id: msg.id,\n error: serializedError\n });\n });\n };\n }\n\n Object.keys(methods).forEach((m) => {\n addHandler(m, methods[m]);\n });\n\n const methodsProxy = new Proxy({}, {\n get: (target, name) => {\n return (...args) => {\n const id = ++callId;\n const msg = {\n jsonrpc: '2.0',\n method: name,\n params: args,\n id\n };\n\n let timeoutId;\n if (timeout) {\n timeoutId = setTimeout(() => {\n if (pendingCalls[id]) {\n const err = new Error('RPC timeout');\n err.code = 504;\n pendingCalls[id].reject(err);\n delete pendingCalls[id];\n }\n }, timeout);\n }\n\n const response = new Promise((resolve, reject) => {\n pendingCalls[id] = { resolve, reject, timeoutId };\n });\n\n transport.send(msg);\n\n return response;\n };\n }\n });\n\n const notifiers = new Proxy({}, {\n get: (target, name) => {\n return (...args) => {\n const msg = {\n jsonrpc: '2.0',\n method: name,\n params: args\n };\n transport.send(msg);\n };\n }\n });\n\n const notifications = new Proxy({}, {\n get: (target, name) => {\n return (callback) => {\n notificationEvents.on(name.substring(2), (...args) => {\n return callback.apply(callback, args);\n });\n };\n }\n });\n\n return {\n methods: methodsProxy,\n addHandler,\n notifications,\n notifiers,\n transport,\n };\n}\n\nrawr.transports = transports;\n\nmodule.exports = rawr;\n\n\n//# sourceURL=webpack://hsync/./node_modules/rawr/index.js?");
|
|
193
|
+
|
|
194
|
+
/***/ }),
|
|
195
|
+
|
|
196
|
+
/***/ "./node_modules/rawr/transports/index.js":
|
|
197
|
+
/*!***********************************************!*\
|
|
198
|
+
!*** ./node_modules/rawr/transports/index.js ***!
|
|
199
|
+
\***********************************************/
|
|
200
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
201
|
+
|
|
202
|
+
eval("const mqtt = __webpack_require__(/*! ./mqtt */ \"./node_modules/rawr/transports/mqtt/index.js\");\nconst socketio = __webpack_require__(/*! ./socketio */ \"./node_modules/rawr/transports/socketio/index.js\");\nconst websocket = __webpack_require__(/*! ./websocket */ \"./node_modules/rawr/transports/websocket/index.js\");\nconst worker = __webpack_require__(/*! ./worker */ \"./node_modules/rawr/transports/worker/index.js\");\n\nmodule.exports = {\n mqtt,\n socketio,\n websocket,\n worker\n};\n\n//# sourceURL=webpack://hsync/./node_modules/rawr/transports/index.js?");
|
|
203
|
+
|
|
204
|
+
/***/ }),
|
|
205
|
+
|
|
206
|
+
/***/ "./node_modules/rawr/transports/mqtt/index.js":
|
|
207
|
+
/*!****************************************************!*\
|
|
208
|
+
!*** ./node_modules/rawr/transports/mqtt/index.js ***!
|
|
209
|
+
\****************************************************/
|
|
210
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
211
|
+
|
|
212
|
+
eval("const { EventEmitter } = __webpack_require__(/*! events */ \"./node_modules/events/events.js\");\n\nfunction transport({ connection, subTopic, pubTopic, subscribe = true }) {\n const emitter = new EventEmitter();\n if (subscribe) {\n connection.subscribe(subTopic);\n }\n connection.on('message', (topic, message) => {\n if (topic === subTopic) {\n try {\n const msg = JSON.parse(message.toString());\n if (msg.method || (msg.id && ('result' in msg || 'error' in msg))) {\n emitter.emit('rpc', msg);\n }\n } catch (err) {\n console.error(err);\n }\n }\n });\n emitter.send = (msg) => {\n connection.publish(pubTopic, JSON.stringify(msg));\n };\n return emitter;\n}\n\nmodule.exports = transport;\n\n\n//# sourceURL=webpack://hsync/./node_modules/rawr/transports/mqtt/index.js?");
|
|
213
|
+
|
|
214
|
+
/***/ }),
|
|
215
|
+
|
|
216
|
+
/***/ "./node_modules/rawr/transports/socketio/index.js":
|
|
217
|
+
/*!********************************************************!*\
|
|
218
|
+
!*** ./node_modules/rawr/transports/socketio/index.js ***!
|
|
219
|
+
\********************************************************/
|
|
220
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
221
|
+
|
|
222
|
+
eval("const { EventEmitter } = __webpack_require__(/*! events */ \"./node_modules/events/events.js\");\n\nfunction transport({ connection, subTopic, pubTopic }) {\n const emitter = new EventEmitter();\n connection.on(subTopic, (msg) => {\n if (msg.method || (msg.id && ('result' in msg || 'error' in msg))) {\n emitter.emit('rpc', msg);\n }\n });\n emitter.send = (msg) => {\n connection.emit(pubTopic, msg);\n };\n return emitter;\n}\n\nmodule.exports = transport;\n\n\n//# sourceURL=webpack://hsync/./node_modules/rawr/transports/socketio/index.js?");
|
|
223
|
+
|
|
224
|
+
/***/ }),
|
|
225
|
+
|
|
226
|
+
/***/ "./node_modules/rawr/transports/websocket/index.js":
|
|
227
|
+
/*!*********************************************************!*\
|
|
228
|
+
!*** ./node_modules/rawr/transports/websocket/index.js ***!
|
|
229
|
+
\*********************************************************/
|
|
230
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
231
|
+
|
|
232
|
+
eval("const { EventEmitter } = __webpack_require__(/*! events */ \"./node_modules/events/events.js\");\n\nfunction transport(socket, allowBinary = false) {\n const emitter = new EventEmitter();\n socket.addEventListener('message', async (evt) => {\n let { data } = evt;\n if (allowBinary && data instanceof Blob) {\n data = await (new Response(data)).text().catch(() => null);\n }\n if (typeof evt.data === 'string') {\n try {\n const msg = JSON.parse(evt.data);\n if (msg.method || (msg.id && ('result' in msg || 'error' in msg))) {\n emitter.emit('rpc', msg);\n }\n } catch (err) {\n // wasn't a JSON message\n }\n }\n });\n emitter.send = (msg) => {\n socket.send(JSON.stringify(msg));\n };\n return emitter;\n}\n\nmodule.exports = transport;\n\n\n//# sourceURL=webpack://hsync/./node_modules/rawr/transports/websocket/index.js?");
|
|
233
|
+
|
|
234
|
+
/***/ }),
|
|
235
|
+
|
|
236
|
+
/***/ "./node_modules/rawr/transports/worker/index.js":
|
|
237
|
+
/*!******************************************************!*\
|
|
238
|
+
!*** ./node_modules/rawr/transports/worker/index.js ***!
|
|
239
|
+
\******************************************************/
|
|
240
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
241
|
+
|
|
242
|
+
eval("const { EventEmitter } = __webpack_require__(/*! events */ \"./node_modules/events/events.js\");\n\nfunction dom(webWorker) {\n const emitter = new EventEmitter();\n webWorker.addEventListener('message', (msg) => {\n const { data } = msg;\n if (data && (data.method || (data.id && ('result' in data || 'error' in data)))) {\n emitter.emit('rpc', data);\n }\n });\n emitter.send = (msg) => {\n webWorker.postMessage(msg);\n };\n return emitter;\n}\n\nfunction worker() {\n const emitter = new EventEmitter();\n self.onmessage = (msg) => {\n const { data } = msg;\n if (data && (data.method || (data.id && ('result' in data || 'error' in data)))) {\n emitter.emit('rpc', data);\n }\n };\n emitter.send = (msg) => {\n self.postMessage(msg);\n };\n return emitter;\n}\n\nfunction transport(webWorker) {\n if (webWorker) {\n return dom(webWorker);\n }\n return worker();\n}\n\n// backwards compat\ntransport.dom = dom;\ntransport.worker = worker;\n\nmodule.exports = transport;\n\n\n//# sourceURL=webpack://hsync/./node_modules/rawr/transports/worker/index.js?");
|
|
243
|
+
|
|
244
|
+
/***/ }),
|
|
245
|
+
|
|
246
|
+
/***/ "./node_modules/uuid/lib/bytesToUuid.js":
|
|
247
|
+
/*!**********************************************!*\
|
|
248
|
+
!*** ./node_modules/uuid/lib/bytesToUuid.js ***!
|
|
249
|
+
\**********************************************/
|
|
250
|
+
/***/ ((module) => {
|
|
251
|
+
|
|
252
|
+
eval("/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\nvar byteToHex = [];\nfor (var i = 0; i < 256; ++i) {\n byteToHex[i] = (i + 0x100).toString(16).substr(1);\n}\n\nfunction bytesToUuid(buf, offset) {\n var i = offset || 0;\n var bth = byteToHex;\n // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4\n return ([\n bth[buf[i++]], bth[buf[i++]],\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]],\n bth[buf[i++]], bth[buf[i++]],\n bth[buf[i++]], bth[buf[i++]]\n ]).join('');\n}\n\nmodule.exports = bytesToUuid;\n\n\n//# sourceURL=webpack://hsync/./node_modules/uuid/lib/bytesToUuid.js?");
|
|
253
|
+
|
|
254
|
+
/***/ }),
|
|
255
|
+
|
|
256
|
+
/***/ "./node_modules/uuid/lib/rng-browser.js":
|
|
257
|
+
/*!**********************************************!*\
|
|
258
|
+
!*** ./node_modules/uuid/lib/rng-browser.js ***!
|
|
259
|
+
\**********************************************/
|
|
260
|
+
/***/ ((module) => {
|
|
261
|
+
|
|
262
|
+
eval("// Unique ID creation requires a high quality random # generator. In the\n// browser this is a little complicated due to unknown quality of Math.random()\n// and inconsistent support for the `crypto` API. We do the best we can via\n// feature-detection\n\n// getRandomValues needs to be invoked in a context where \"this\" is a Crypto\n// implementation. Also, find the complete implementation of crypto on IE11.\nvar getRandomValues = (typeof(crypto) != 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto)) ||\n (typeof(msCrypto) != 'undefined' && typeof window.msCrypto.getRandomValues == 'function' && msCrypto.getRandomValues.bind(msCrypto));\n\nif (getRandomValues) {\n // WHATWG crypto RNG - http://wiki.whatwg.org/wiki/Crypto\n var rnds8 = new Uint8Array(16); // eslint-disable-line no-undef\n\n module.exports = function whatwgRNG() {\n getRandomValues(rnds8);\n return rnds8;\n };\n} else {\n // Math.random()-based (RNG)\n //\n // If all else fails, use Math.random(). It's fast, but is of unspecified\n // quality.\n var rnds = new Array(16);\n\n module.exports = function mathRNG() {\n for (var i = 0, r; i < 16; i++) {\n if ((i & 0x03) === 0) r = Math.random() * 0x100000000;\n rnds[i] = r >>> ((i & 0x03) << 3) & 0xff;\n }\n\n return rnds;\n };\n}\n\n\n//# sourceURL=webpack://hsync/./node_modules/uuid/lib/rng-browser.js?");
|
|
263
|
+
|
|
264
|
+
/***/ }),
|
|
265
|
+
|
|
266
|
+
/***/ "./node_modules/uuid/v4.js":
|
|
267
|
+
/*!*********************************!*\
|
|
268
|
+
!*** ./node_modules/uuid/v4.js ***!
|
|
269
|
+
\*********************************/
|
|
270
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
271
|
+
|
|
272
|
+
eval("var rng = __webpack_require__(/*! ./lib/rng */ \"./node_modules/uuid/lib/rng-browser.js\");\nvar bytesToUuid = __webpack_require__(/*! ./lib/bytesToUuid */ \"./node_modules/uuid/lib/bytesToUuid.js\");\n\nfunction v4(options, buf, offset) {\n var i = buf && offset || 0;\n\n if (typeof(options) == 'string') {\n buf = options === 'binary' ? new Array(16) : null;\n options = null;\n }\n options = options || {};\n\n var rnds = options.random || (options.rng || rng)();\n\n // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n rnds[6] = (rnds[6] & 0x0f) | 0x40;\n rnds[8] = (rnds[8] & 0x3f) | 0x80;\n\n // Copy bytes to buffer, if provided\n if (buf) {\n for (var ii = 0; ii < 16; ++ii) {\n buf[i + ii] = rnds[ii];\n }\n }\n\n return buf || bytesToUuid(rnds);\n}\n\nmodule.exports = v4;\n\n\n//# sourceURL=webpack://hsync/./node_modules/uuid/v4.js?");
|
|
273
|
+
|
|
274
|
+
/***/ }),
|
|
275
|
+
|
|
276
|
+
/***/ "./node_modules/whatwg-fetch/fetch.js":
|
|
277
|
+
/*!********************************************!*\
|
|
278
|
+
!*** ./node_modules/whatwg-fetch/fetch.js ***!
|
|
279
|
+
\********************************************/
|
|
280
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
281
|
+
|
|
282
|
+
"use strict";
|
|
283
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"DOMException\": () => (/* binding */ DOMException),\n/* harmony export */ \"Headers\": () => (/* binding */ Headers),\n/* harmony export */ \"Request\": () => (/* binding */ Request),\n/* harmony export */ \"Response\": () => (/* binding */ Response),\n/* harmony export */ \"fetch\": () => (/* binding */ fetch)\n/* harmony export */ });\nvar global =\n (typeof globalThis !== 'undefined' && globalThis) ||\n (typeof self !== 'undefined' && self) ||\n (typeof global !== 'undefined' && global)\n\nvar support = {\n searchParams: 'URLSearchParams' in global,\n iterable: 'Symbol' in global && 'iterator' in Symbol,\n blob:\n 'FileReader' in global &&\n 'Blob' in global &&\n (function() {\n try {\n new Blob()\n return true\n } catch (e) {\n return false\n }\n })(),\n formData: 'FormData' in global,\n arrayBuffer: 'ArrayBuffer' in global\n}\n\nfunction isDataView(obj) {\n return obj && DataView.prototype.isPrototypeOf(obj)\n}\n\nif (support.arrayBuffer) {\n var viewClasses = [\n '[object Int8Array]',\n '[object Uint8Array]',\n '[object Uint8ClampedArray]',\n '[object Int16Array]',\n '[object Uint16Array]',\n '[object Int32Array]',\n '[object Uint32Array]',\n '[object Float32Array]',\n '[object Float64Array]'\n ]\n\n var isArrayBufferView =\n ArrayBuffer.isView ||\n function(obj) {\n return obj && viewClasses.indexOf(Object.prototype.toString.call(obj)) > -1\n }\n}\n\nfunction normalizeName(name) {\n if (typeof name !== 'string') {\n name = String(name)\n }\n if (/[^a-z0-9\\-#$%&'*+.^_`|~!]/i.test(name) || name === '') {\n throw new TypeError('Invalid character in header field name: \"' + name + '\"')\n }\n return name.toLowerCase()\n}\n\nfunction normalizeValue(value) {\n if (typeof value !== 'string') {\n value = String(value)\n }\n return value\n}\n\n// Build a destructive iterator for the value list\nfunction iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n}\n\nfunction Headers(headers) {\n this.map = {}\n\n if (headers instanceof Headers) {\n headers.forEach(function(value, name) {\n this.append(name, value)\n }, this)\n } else if (Array.isArray(headers)) {\n headers.forEach(function(header) {\n this.append(header[0], header[1])\n }, this)\n } else if (headers) {\n Object.getOwnPropertyNames(headers).forEach(function(name) {\n this.append(name, headers[name])\n }, this)\n }\n}\n\nHeaders.prototype.append = function(name, value) {\n name = normalizeName(name)\n value = normalizeValue(value)\n var oldValue = this.map[name]\n this.map[name] = oldValue ? oldValue + ', ' + value : value\n}\n\nHeaders.prototype['delete'] = function(name) {\n delete this.map[normalizeName(name)]\n}\n\nHeaders.prototype.get = function(name) {\n name = normalizeName(name)\n return this.has(name) ? this.map[name] : null\n}\n\nHeaders.prototype.has = function(name) {\n return this.map.hasOwnProperty(normalizeName(name))\n}\n\nHeaders.prototype.set = function(name, value) {\n this.map[normalizeName(name)] = normalizeValue(value)\n}\n\nHeaders.prototype.forEach = function(callback, thisArg) {\n for (var name in this.map) {\n if (this.map.hasOwnProperty(name)) {\n callback.call(thisArg, this.map[name], name, this)\n }\n }\n}\n\nHeaders.prototype.keys = function() {\n var items = []\n this.forEach(function(value, name) {\n items.push(name)\n })\n return iteratorFor(items)\n}\n\nHeaders.prototype.values = function() {\n var items = []\n this.forEach(function(value) {\n items.push(value)\n })\n return iteratorFor(items)\n}\n\nHeaders.prototype.entries = function() {\n var items = []\n this.forEach(function(value, name) {\n items.push([name, value])\n })\n return iteratorFor(items)\n}\n\nif (support.iterable) {\n Headers.prototype[Symbol.iterator] = Headers.prototype.entries\n}\n\nfunction consumed(body) {\n if (body.bodyUsed) {\n return Promise.reject(new TypeError('Already read'))\n }\n body.bodyUsed = true\n}\n\nfunction fileReaderReady(reader) {\n return new Promise(function(resolve, reject) {\n reader.onload = function() {\n resolve(reader.result)\n }\n reader.onerror = function() {\n reject(reader.error)\n }\n })\n}\n\nfunction readBlobAsArrayBuffer(blob) {\n var reader = new FileReader()\n var promise = fileReaderReady(reader)\n reader.readAsArrayBuffer(blob)\n return promise\n}\n\nfunction readBlobAsText(blob) {\n var reader = new FileReader()\n var promise = fileReaderReady(reader)\n reader.readAsText(blob)\n return promise\n}\n\nfunction readArrayBufferAsText(buf) {\n var view = new Uint8Array(buf)\n var chars = new Array(view.length)\n\n for (var i = 0; i < view.length; i++) {\n chars[i] = String.fromCharCode(view[i])\n }\n return chars.join('')\n}\n\nfunction bufferClone(buf) {\n if (buf.slice) {\n return buf.slice(0)\n } else {\n var view = new Uint8Array(buf.byteLength)\n view.set(new Uint8Array(buf))\n return view.buffer\n }\n}\n\nfunction Body() {\n this.bodyUsed = false\n\n this._initBody = function(body) {\n /*\n fetch-mock wraps the Response object in an ES6 Proxy to\n provide useful test harness features such as flush. However, on\n ES5 browsers without fetch or Proxy support pollyfills must be used;\n the proxy-pollyfill is unable to proxy an attribute unless it exists\n on the object before the Proxy is created. This change ensures\n Response.bodyUsed exists on the instance, while maintaining the\n semantic of setting Request.bodyUsed in the constructor before\n _initBody is called.\n */\n this.bodyUsed = this.bodyUsed\n this._bodyInit = body\n if (!body) {\n this._bodyText = ''\n } else if (typeof body === 'string') {\n this._bodyText = body\n } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {\n this._bodyBlob = body\n } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {\n this._bodyFormData = body\n } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {\n this._bodyText = body.toString()\n } else if (support.arrayBuffer && support.blob && isDataView(body)) {\n this._bodyArrayBuffer = bufferClone(body.buffer)\n // IE 10-11 can't handle a DataView body.\n this._bodyInit = new Blob([this._bodyArrayBuffer])\n } else if (support.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(body) || isArrayBufferView(body))) {\n this._bodyArrayBuffer = bufferClone(body)\n } else {\n this._bodyText = body = Object.prototype.toString.call(body)\n }\n\n if (!this.headers.get('content-type')) {\n if (typeof body === 'string') {\n this.headers.set('content-type', 'text/plain;charset=UTF-8')\n } else if (this._bodyBlob && this._bodyBlob.type) {\n this.headers.set('content-type', this._bodyBlob.type)\n } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {\n this.headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8')\n }\n }\n }\n\n if (support.blob) {\n this.blob = function() {\n var rejected = consumed(this)\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return Promise.resolve(this._bodyBlob)\n } else if (this._bodyArrayBuffer) {\n return Promise.resolve(new Blob([this._bodyArrayBuffer]))\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as blob')\n } else {\n return Promise.resolve(new Blob([this._bodyText]))\n }\n }\n\n this.arrayBuffer = function() {\n if (this._bodyArrayBuffer) {\n var isConsumed = consumed(this)\n if (isConsumed) {\n return isConsumed\n }\n if (ArrayBuffer.isView(this._bodyArrayBuffer)) {\n return Promise.resolve(\n this._bodyArrayBuffer.buffer.slice(\n this._bodyArrayBuffer.byteOffset,\n this._bodyArrayBuffer.byteOffset + this._bodyArrayBuffer.byteLength\n )\n )\n } else {\n return Promise.resolve(this._bodyArrayBuffer)\n }\n } else {\n return this.blob().then(readBlobAsArrayBuffer)\n }\n }\n }\n\n this.text = function() {\n var rejected = consumed(this)\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return readBlobAsText(this._bodyBlob)\n } else if (this._bodyArrayBuffer) {\n return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer))\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as text')\n } else {\n return Promise.resolve(this._bodyText)\n }\n }\n\n if (support.formData) {\n this.formData = function() {\n return this.text().then(decode)\n }\n }\n\n this.json = function() {\n return this.text().then(JSON.parse)\n }\n\n return this\n}\n\n// HTTP methods whose capitalization should be normalized\nvar methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT']\n\nfunction normalizeMethod(method) {\n var upcased = method.toUpperCase()\n return methods.indexOf(upcased) > -1 ? upcased : method\n}\n\nfunction Request(input, options) {\n if (!(this instanceof Request)) {\n throw new TypeError('Please use the \"new\" operator, this DOM object constructor cannot be called as a function.')\n }\n\n options = options || {}\n var body = options.body\n\n if (input instanceof Request) {\n if (input.bodyUsed) {\n throw new TypeError('Already read')\n }\n this.url = input.url\n this.credentials = input.credentials\n if (!options.headers) {\n this.headers = new Headers(input.headers)\n }\n this.method = input.method\n this.mode = input.mode\n this.signal = input.signal\n if (!body && input._bodyInit != null) {\n body = input._bodyInit\n input.bodyUsed = true\n }\n } else {\n this.url = String(input)\n }\n\n this.credentials = options.credentials || this.credentials || 'same-origin'\n if (options.headers || !this.headers) {\n this.headers = new Headers(options.headers)\n }\n this.method = normalizeMethod(options.method || this.method || 'GET')\n this.mode = options.mode || this.mode || null\n this.signal = options.signal || this.signal\n this.referrer = null\n\n if ((this.method === 'GET' || this.method === 'HEAD') && body) {\n throw new TypeError('Body not allowed for GET or HEAD requests')\n }\n this._initBody(body)\n\n if (this.method === 'GET' || this.method === 'HEAD') {\n if (options.cache === 'no-store' || options.cache === 'no-cache') {\n // Search for a '_' parameter in the query string\n var reParamSearch = /([?&])_=[^&]*/\n if (reParamSearch.test(this.url)) {\n // If it already exists then set the value with the current time\n this.url = this.url.replace(reParamSearch, '$1_=' + new Date().getTime())\n } else {\n // Otherwise add a new '_' parameter to the end with the current time\n var reQueryString = /\\?/\n this.url += (reQueryString.test(this.url) ? '&' : '?') + '_=' + new Date().getTime()\n }\n }\n }\n}\n\nRequest.prototype.clone = function() {\n return new Request(this, {body: this._bodyInit})\n}\n\nfunction decode(body) {\n var form = new FormData()\n body\n .trim()\n .split('&')\n .forEach(function(bytes) {\n if (bytes) {\n var split = bytes.split('=')\n var name = split.shift().replace(/\\+/g, ' ')\n var value = split.join('=').replace(/\\+/g, ' ')\n form.append(decodeURIComponent(name), decodeURIComponent(value))\n }\n })\n return form\n}\n\nfunction parseHeaders(rawHeaders) {\n var headers = new Headers()\n // Replace instances of \\r\\n and \\n followed by at least one space or horizontal tab with a space\n // https://tools.ietf.org/html/rfc7230#section-3.2\n var preProcessedHeaders = rawHeaders.replace(/\\r?\\n[\\t ]+/g, ' ')\n // Avoiding split via regex to work around a common IE11 bug with the core-js 3.6.0 regex polyfill\n // https://github.com/github/fetch/issues/748\n // https://github.com/zloirock/core-js/issues/751\n preProcessedHeaders\n .split('\\r')\n .map(function(header) {\n return header.indexOf('\\n') === 0 ? header.substr(1, header.length) : header\n })\n .forEach(function(line) {\n var parts = line.split(':')\n var key = parts.shift().trim()\n if (key) {\n var value = parts.join(':').trim()\n headers.append(key, value)\n }\n })\n return headers\n}\n\nBody.call(Request.prototype)\n\nfunction Response(bodyInit, options) {\n if (!(this instanceof Response)) {\n throw new TypeError('Please use the \"new\" operator, this DOM object constructor cannot be called as a function.')\n }\n if (!options) {\n options = {}\n }\n\n this.type = 'default'\n this.status = options.status === undefined ? 200 : options.status\n this.ok = this.status >= 200 && this.status < 300\n this.statusText = options.statusText === undefined ? '' : '' + options.statusText\n this.headers = new Headers(options.headers)\n this.url = options.url || ''\n this._initBody(bodyInit)\n}\n\nBody.call(Response.prototype)\n\nResponse.prototype.clone = function() {\n return new Response(this._bodyInit, {\n status: this.status,\n statusText: this.statusText,\n headers: new Headers(this.headers),\n url: this.url\n })\n}\n\nResponse.error = function() {\n var response = new Response(null, {status: 0, statusText: ''})\n response.type = 'error'\n return response\n}\n\nvar redirectStatuses = [301, 302, 303, 307, 308]\n\nResponse.redirect = function(url, status) {\n if (redirectStatuses.indexOf(status) === -1) {\n throw new RangeError('Invalid status code')\n }\n\n return new Response(null, {status: status, headers: {location: url}})\n}\n\nvar DOMException = global.DOMException\ntry {\n new DOMException()\n} catch (err) {\n DOMException = function(message, name) {\n this.message = message\n this.name = name\n var error = Error(message)\n this.stack = error.stack\n }\n DOMException.prototype = Object.create(Error.prototype)\n DOMException.prototype.constructor = DOMException\n}\n\nfunction fetch(input, init) {\n return new Promise(function(resolve, reject) {\n var request = new Request(input, init)\n\n if (request.signal && request.signal.aborted) {\n return reject(new DOMException('Aborted', 'AbortError'))\n }\n\n var xhr = new XMLHttpRequest()\n\n function abortXhr() {\n xhr.abort()\n }\n\n xhr.onload = function() {\n var options = {\n status: xhr.status,\n statusText: xhr.statusText,\n headers: parseHeaders(xhr.getAllResponseHeaders() || '')\n }\n options.url = 'responseURL' in xhr ? xhr.responseURL : options.headers.get('X-Request-URL')\n var body = 'response' in xhr ? xhr.response : xhr.responseText\n setTimeout(function() {\n resolve(new Response(body, options))\n }, 0)\n }\n\n xhr.onerror = function() {\n setTimeout(function() {\n reject(new TypeError('Network request failed'))\n }, 0)\n }\n\n xhr.ontimeout = function() {\n setTimeout(function() {\n reject(new TypeError('Network request failed'))\n }, 0)\n }\n\n xhr.onabort = function() {\n setTimeout(function() {\n reject(new DOMException('Aborted', 'AbortError'))\n }, 0)\n }\n\n function fixUrl(url) {\n try {\n return url === '' && global.location.href ? global.location.href : url\n } catch (e) {\n return url\n }\n }\n\n xhr.open(request.method, fixUrl(request.url), true)\n\n if (request.credentials === 'include') {\n xhr.withCredentials = true\n } else if (request.credentials === 'omit') {\n xhr.withCredentials = false\n }\n\n if ('responseType' in xhr) {\n if (support.blob) {\n xhr.responseType = 'blob'\n } else if (\n support.arrayBuffer &&\n request.headers.get('Content-Type') &&\n request.headers.get('Content-Type').indexOf('application/octet-stream') !== -1\n ) {\n xhr.responseType = 'arraybuffer'\n }\n }\n\n if (init && typeof init.headers === 'object' && !(init.headers instanceof Headers)) {\n Object.getOwnPropertyNames(init.headers).forEach(function(name) {\n xhr.setRequestHeader(name, normalizeValue(init.headers[name]))\n })\n } else {\n request.headers.forEach(function(value, name) {\n xhr.setRequestHeader(name, value)\n })\n }\n\n if (request.signal) {\n request.signal.addEventListener('abort', abortXhr)\n\n xhr.onreadystatechange = function() {\n // DONE (success or failure)\n if (xhr.readyState === 4) {\n request.signal.removeEventListener('abort', abortXhr)\n }\n }\n }\n\n xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit)\n })\n}\n\nfetch.polyfill = true\n\nif (!global.fetch) {\n global.fetch = fetch\n global.Headers = Headers\n global.Request = Request\n global.Response = Response\n}\n\n\n//# sourceURL=webpack://hsync/./node_modules/whatwg-fetch/fetch.js?");
|
|
284
|
+
|
|
285
|
+
/***/ }),
|
|
286
|
+
|
|
287
|
+
/***/ "./node_modules/precompiled-mqtt/dist/mqtt.browser.js":
|
|
288
|
+
/*!************************************************************!*\
|
|
289
|
+
!*** ./node_modules/precompiled-mqtt/dist/mqtt.browser.js ***!
|
|
290
|
+
\************************************************************/
|
|
291
|
+
/***/ ((module) => {
|
|
292
|
+
|
|
293
|
+
eval("/*! For license information please see mqtt.browser.js.LICENSE.txt */\n!function(){var e={9742:function(e,t){\"use strict\";t.byteLength=function(e){var t=u(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,o=u(e),s=o[0],a=o[1],l=new i(function(e,t,r){return 3*(t+r)/4-r}(0,s,a)),c=0,h=a>0?s-4:s;for(r=0;r<h;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],l[c++]=t>>16&255,l[c++]=t>>8&255,l[c++]=255&t;return 2===a&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,l[c++]=255&t),1===a&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,l[c++]=t>>8&255,l[c++]=255&t),l},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,o=[],s=16383,a=0,u=n-i;a<u;a+=s)o.push(l(e,a,a+s>u?u:a+s));return 1===i?(t=e[n-1],o.push(r[t>>2]+r[t<<4&63]+\"==\")):2===i&&(t=(e[n-2]<<8)+e[n-1],o.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+\"=\")),o.join(\"\")};for(var r=[],n=[],i=\"undefined\"!=typeof Uint8Array?Uint8Array:Array,o=\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\",s=0,a=o.length;s<a;++s)r[s]=o[s],n[o.charCodeAt(s)]=s;function u(e){var t=e.length;if(t%4>0)throw new Error(\"Invalid string. Length must be a multiple of 4\");var r=e.indexOf(\"=\");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function l(e,t,n){for(var i,o,s=[],a=t;a<n;a+=3)i=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(255&e[a+2]),s.push(r[(o=i)>>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return s.join(\"\")}n[\"-\".charCodeAt(0)]=62,n[\"_\".charCodeAt(0)]=63},9668:function(e,t,r){\"use strict\";const{Buffer:n}=r(8478),i=Symbol.for(\"BufferList\");function o(e){if(!(this instanceof o))return new o(e);o._init.call(this,e)}o._init=function(e){Object.defineProperty(this,i,{value:!0}),this._bufs=[],this.length=0,e&&this.append(e)},o.prototype._new=function(e){return new o(e)},o.prototype._offset=function(e){if(0===e)return[0,0];let t=0;for(let r=0;r<this._bufs.length;r++){const n=t+this._bufs[r].length;if(e<n||r===this._bufs.length-1)return[r,e-t];t=n}},o.prototype._reverseOffset=function(e){const t=e[0];let r=e[1];for(let e=0;e<t;e++)r+=this._bufs[e].length;return r},o.prototype.get=function(e){if(e>this.length||e<0)return;const t=this._offset(e);return this._bufs[t[0]][t[1]]},o.prototype.slice=function(e,t){return\"number\"==typeof e&&e<0&&(e+=this.length),\"number\"==typeof t&&t<0&&(t+=this.length),this.copy(null,0,e,t)},o.prototype.copy=function(e,t,r,i){if((\"number\"!=typeof r||r<0)&&(r=0),(\"number\"!=typeof i||i>this.length)&&(i=this.length),r>=this.length)return e||n.alloc(0);if(i<=0)return e||n.alloc(0);const o=!!e,s=this._offset(r),a=i-r;let u=a,l=o&&t||0,c=s[1];if(0===r&&i===this.length){if(!o)return 1===this._bufs.length?this._bufs[0]:n.concat(this._bufs,this.length);for(let t=0;t<this._bufs.length;t++)this._bufs[t].copy(e,l),l+=this._bufs[t].length;return e}if(u<=this._bufs[s[0]].length-c)return o?this._bufs[s[0]].copy(e,t,c,c+u):this._bufs[s[0]].slice(c,c+u);o||(e=n.allocUnsafe(a));for(let t=s[0];t<this._bufs.length;t++){const r=this._bufs[t].length-c;if(!(u>r)){this._bufs[t].copy(e,l,c,c+u),l+=r;break}this._bufs[t].copy(e,l,c),l+=r,u-=r,c&&(c=0)}return e.length>l?e.slice(0,l):e},o.prototype.shallowSlice=function(e,t){if(e=e||0,t=\"number\"!=typeof t?this.length:t,e<0&&(e+=this.length),t<0&&(t+=this.length),e===t)return this._new();const r=this._offset(e),n=this._offset(t),i=this._bufs.slice(r[0],n[0]+1);return 0===n[1]?i.pop():i[i.length-1]=i[i.length-1].slice(0,n[1]),0!==r[1]&&(i[0]=i[0].slice(r[1])),this._new(i)},o.prototype.toString=function(e,t,r){return this.slice(t,r).toString(e)},o.prototype.consume=function(e){if(e=Math.trunc(e),Number.isNaN(e)||e<=0)return this;for(;this._bufs.length;){if(!(e>=this._bufs[0].length)){this._bufs[0]=this._bufs[0].slice(e),this.length-=e;break}e-=this._bufs[0].length,this.length-=this._bufs[0].length,this._bufs.shift()}return this},o.prototype.duplicate=function(){const e=this._new();for(let t=0;t<this._bufs.length;t++)e.append(this._bufs[t]);return e},o.prototype.append=function(e){if(null==e)return this;if(e.buffer)this._appendBuffer(n.from(e.buffer,e.byteOffset,e.byteLength));else if(Array.isArray(e))for(let t=0;t<e.length;t++)this.append(e[t]);else if(this._isBufferList(e))for(let t=0;t<e._bufs.length;t++)this.append(e._bufs[t]);else\"number\"==typeof e&&(e=e.toString()),this._appendBuffer(n.from(e));return this},o.prototype._appendBuffer=function(e){this._bufs.push(e),this.length+=e.length},o.prototype.indexOf=function(e,t,r){if(void 0===r&&\"string\"==typeof t&&(r=t,t=void 0),\"function\"==typeof e||Array.isArray(e))throw new TypeError('The \"value\" argument must be one of type string, Buffer, BufferList, or Uint8Array.');if(\"number\"==typeof e?e=n.from([e]):\"string\"==typeof e?e=n.from(e,r):this._isBufferList(e)?e=e.slice():Array.isArray(e.buffer)?e=n.from(e.buffer,e.byteOffset,e.byteLength):n.isBuffer(e)||(e=n.from(e)),t=Number(t||0),isNaN(t)&&(t=0),t<0&&(t=this.length+t),t<0&&(t=0),0===e.length)return t>this.length?this.length:t;const i=this._offset(t);let o=i[0],s=i[1];for(;o<this._bufs.length;o++){const t=this._bufs[o];for(;s<t.length;)if(t.length-s>=e.length){const r=t.indexOf(e,s);if(-1!==r)return this._reverseOffset([o,r]);s=t.length-e.length+1}else{const t=this._reverseOffset([o,s]);if(this._match(t,e))return t;s++}s=0}return-1},o.prototype._match=function(e,t){if(this.length-e<t.length)return!1;for(let r=0;r<t.length;r++)if(this.get(e+r)!==t[r])return!1;return!0},function(){const e={readDoubleBE:8,readDoubleLE:8,readFloatBE:4,readFloatLE:4,readInt32BE:4,readInt32LE:4,readUInt32BE:4,readUInt32LE:4,readInt16BE:2,readInt16LE:2,readUInt16BE:2,readUInt16LE:2,readInt8:1,readUInt8:1,readIntBE:null,readIntLE:null,readUIntBE:null,readUIntLE:null};for(const t in e)!function(t){o.prototype[t]=null===e[t]?function(e,r){return this.slice(e,e+r)[t](0,r)}:function(r=0){return this.slice(r,r+e[t])[t](0)}}(t)}(),o.prototype._isBufferList=function(e){return e instanceof o||o.isBufferList(e)},o.isBufferList=function(e){return null!=e&&e[i]},e.exports=o},22:function(e,t,r){\"use strict\";const n=r(8473).Duplex,i=r(5717),o=r(9668);function s(e){if(!(this instanceof s))return new s(e);if(\"function\"==typeof e){this._callback=e;const t=function(e){this._callback&&(this._callback(e),this._callback=null)}.bind(this);this.on(\"pipe\",(function(e){e.on(\"error\",t)})),this.on(\"unpipe\",(function(e){e.removeListener(\"error\",t)})),e=null}o._init.call(this,e),n.call(this)}i(s,n),Object.assign(s.prototype,o.prototype),s.prototype._new=function(e){return new s(e)},s.prototype._write=function(e,t,r){this._appendBuffer(e),\"function\"==typeof r&&r()},s.prototype._read=function(e){if(!this.length)return this.push(null);e=Math.min(e,this.length),this.push(this.slice(0,e)),this.consume(e)},s.prototype.end=function(e){n.prototype.end.call(this,e),this._callback&&(this._callback(null,this.slice()),this._callback=null)},s.prototype._destroy=function(e,t){this._bufs.length=0,this.length=0,t(e)},s.prototype._isBufferList=function(e){return e instanceof s||e instanceof o||s.isBufferList(e)},s.isBufferList=o.isBufferList,e.exports=s,e.exports.BufferListStream=s,e.exports.BufferList=o},8478:function(e,t,r){\"use strict\";var n=r(9742),i=r(645),o=\"function\"==typeof Symbol&&\"function\"==typeof Symbol.for?Symbol.for(\"nodejs.util.inspect.custom\"):null;t.Buffer=u,t.SlowBuffer=function(e){return+e!=e&&(e=0),u.alloc(+e)},t.INSPECT_MAX_BYTES=50;var s=2147483647;function a(e){if(e>s)throw new RangeError('The value \"'+e+'\" is invalid for option \"size\"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,u.prototype),t}function u(e,t,r){if(\"number\"==typeof e){if(\"string\"==typeof t)throw new TypeError('The \"string\" argument must be of type string. Received type number');return h(e)}return l(e,t,r)}function l(e,t,r){if(\"string\"==typeof e)return function(e,t){if(\"string\"==typeof t&&\"\"!==t||(t=\"utf8\"),!u.isEncoding(t))throw new TypeError(\"Unknown encoding: \"+t);var r=0|y(e,t),n=a(r),i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(D(e,Uint8Array)){var t=new Uint8Array(e);return p(t.buffer,t.byteOffset,t.byteLength)}return f(e)}(e);if(null==e)throw new TypeError(\"The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type \"+typeof e);if(D(e,ArrayBuffer)||e&&D(e.buffer,ArrayBuffer))return p(e,t,r);if(\"undefined\"!=typeof SharedArrayBuffer&&(D(e,SharedArrayBuffer)||e&&D(e.buffer,SharedArrayBuffer)))return p(e,t,r);if(\"number\"==typeof e)throw new TypeError('The \"value\" argument must not be of type number. Received type number');var n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return u.from(n,t,r);var i=function(e){if(u.isBuffer(e)){var t=0|d(e.length),r=a(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?\"number\"!=typeof e.length||F(e.length)?a(0):f(e):\"Buffer\"===e.type&&Array.isArray(e.data)?f(e.data):void 0}(e);if(i)return i;if(\"undefined\"!=typeof Symbol&&null!=Symbol.toPrimitive&&\"function\"==typeof e[Symbol.toPrimitive])return u.from(e[Symbol.toPrimitive](\"string\"),t,r);throw new TypeError(\"The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type \"+typeof e)}function c(e){if(\"number\"!=typeof e)throw new TypeError('\"size\" argument must be of type number');if(e<0)throw new RangeError('The value \"'+e+'\" is invalid for option \"size\"')}function h(e){return c(e),a(e<0?0:0|d(e))}function f(e){for(var t=e.length<0?0:0|d(e.length),r=a(t),n=0;n<t;n+=1)r[n]=255&e[n];return r}function p(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('\"offset\" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('\"length\" is outside of buffer bounds');var n;return n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(n,u.prototype),n}function d(e){if(e>=s)throw new RangeError(\"Attempt to allocate Buffer larger than maximum size: 0x\"+s.toString(16)+\" bytes\");return 0|e}function y(e,t){if(u.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||D(e,ArrayBuffer))return e.byteLength;if(\"string\"!=typeof e)throw new TypeError('The \"string\" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var i=!1;;)switch(t){case\"ascii\":case\"latin1\":case\"binary\":return r;case\"utf8\":case\"utf-8\":return j(e).length;case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return 2*r;case\"hex\":return r>>>1;case\"base64\":return q(e).length;default:if(i)return n?-1:j(e).length;t=(\"\"+t).toLowerCase(),i=!0}}function g(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return\"\";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return\"\";if((r>>>=0)<=(t>>>=0))return\"\";for(e||(e=\"utf8\");;)switch(e){case\"hex\":return B(this,t,r);case\"utf8\":case\"utf-8\":return T(this,t,r);case\"ascii\":return I(this,t,r);case\"latin1\":case\"binary\":return x(this,t,r);case\"base64\":return C(this,t,r);case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return R(this,t,r);default:if(n)throw new TypeError(\"Unknown encoding: \"+e);e=(e+\"\").toLowerCase(),n=!0}}function b(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function m(e,t,r,n,i){if(0===e.length)return-1;if(\"string\"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),F(r=+r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if(\"string\"==typeof t&&(t=u.from(t,n)),u.isBuffer(t))return 0===t.length?-1:v(e,t,r,n,i);if(\"number\"==typeof t)return t&=255,\"function\"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):v(e,[t],r,n,i);throw new TypeError(\"val must be string, number or Buffer\")}function v(e,t,r,n,i){var o,s=1,a=e.length,u=t.length;if(void 0!==n&&(\"ucs2\"===(n=String(n).toLowerCase())||\"ucs-2\"===n||\"utf16le\"===n||\"utf-16le\"===n)){if(e.length<2||t.length<2)return-1;s=2,a/=2,u/=2,r/=2}function l(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){var c=-1;for(o=r;o<a;o++)if(l(e,o)===l(t,-1===c?0:o-c)){if(-1===c&&(c=o),o-c+1===u)return c*s}else-1!==c&&(o-=o-c),c=-1}else for(r+u>a&&(r=a-u),o=r;o>=0;o--){for(var h=!0,f=0;f<u;f++)if(l(e,o+f)!==l(t,f)){h=!1;break}if(h)return o}return-1}function w(e,t,r,n){r=Number(r)||0;var i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;var o=t.length;n>o/2&&(n=o/2);for(var s=0;s<n;++s){var a=parseInt(t.substr(2*s,2),16);if(F(a))return s;e[r+s]=a}return s}function _(e,t,r,n){return z(j(t,e.length-r),e,r,n)}function E(e,t,r,n){return z(function(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function k(e,t,r,n){return z(q(t),e,r,n)}function S(e,t,r,n){return z(function(e,t){for(var r,n,i,o=[],s=0;s<e.length&&!((t-=2)<0);++s)n=(r=e.charCodeAt(s))>>8,i=r%256,o.push(i),o.push(n);return o}(t,e.length-r),e,r,n)}function C(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function T(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i<r;){var o,s,a,u,l=e[i],c=null,h=l>239?4:l>223?3:l>191?2:1;if(i+h<=r)switch(h){case 1:l<128&&(c=l);break;case 2:128==(192&(o=e[i+1]))&&(u=(31&l)<<6|63&o)>127&&(c=u);break;case 3:o=e[i+1],s=e[i+2],128==(192&o)&&128==(192&s)&&(u=(15&l)<<12|(63&o)<<6|63&s)>2047&&(u<55296||u>57343)&&(c=u);break;case 4:o=e[i+1],s=e[i+2],a=e[i+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&(u=(15&l)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&u<1114112&&(c=u)}null===c?(c=65533,h=1):c>65535&&(c-=65536,n.push(c>>>10&1023|55296),c=56320|1023&c),n.push(c),i+=h}return function(e){var t=e.length;if(t<=A)return String.fromCharCode.apply(String,e);for(var r=\"\",n=0;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=A));return r}(n)}t.kMaxLength=s,u.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),u.TYPED_ARRAY_SUPPORT||\"undefined\"==typeof console||\"function\"!=typeof console.error||console.error(\"This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.\"),Object.defineProperty(u.prototype,\"parent\",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.buffer}}),Object.defineProperty(u.prototype,\"offset\",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.byteOffset}}),u.poolSize=8192,u.from=function(e,t,r){return l(e,t,r)},Object.setPrototypeOf(u.prototype,Uint8Array.prototype),Object.setPrototypeOf(u,Uint8Array),u.alloc=function(e,t,r){return function(e,t,r){return c(e),e<=0?a(e):void 0!==t?\"string\"==typeof r?a(e).fill(t,r):a(e).fill(t):a(e)}(e,t,r)},u.allocUnsafe=function(e){return h(e)},u.allocUnsafeSlow=function(e){return h(e)},u.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==u.prototype},u.compare=function(e,t){if(D(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),D(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),!u.isBuffer(e)||!u.isBuffer(t))throw new TypeError('The \"buf1\", \"buf2\" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var r=e.length,n=t.length,i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},u.isEncoding=function(e){switch(String(e).toLowerCase()){case\"hex\":case\"utf8\":case\"utf-8\":case\"ascii\":case\"latin1\":case\"binary\":case\"base64\":case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return!0;default:return!1}},u.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('\"list\" argument must be an Array of Buffers');if(0===e.length)return u.alloc(0);var r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;var n=u.allocUnsafe(t),i=0;for(r=0;r<e.length;++r){var o=e[r];if(D(o,Uint8Array))i+o.length>n.length?u.from(o).copy(n,i):Uint8Array.prototype.set.call(n,o,i);else{if(!u.isBuffer(o))throw new TypeError('\"list\" argument must be an Array of Buffers');o.copy(n,i)}i+=o.length}return n},u.byteLength=y,u.prototype._isBuffer=!0,u.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError(\"Buffer size must be a multiple of 16-bits\");for(var t=0;t<e;t+=2)b(this,t,t+1);return this},u.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError(\"Buffer size must be a multiple of 32-bits\");for(var t=0;t<e;t+=4)b(this,t,t+3),b(this,t+1,t+2);return this},u.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError(\"Buffer size must be a multiple of 64-bits\");for(var t=0;t<e;t+=8)b(this,t,t+7),b(this,t+1,t+6),b(this,t+2,t+5),b(this,t+3,t+4);return this},u.prototype.toString=function(){var e=this.length;return 0===e?\"\":0===arguments.length?T(this,0,e):g.apply(this,arguments)},u.prototype.toLocaleString=u.prototype.toString,u.prototype.equals=function(e){if(!u.isBuffer(e))throw new TypeError(\"Argument must be a Buffer\");return this===e||0===u.compare(this,e)},u.prototype.inspect=function(){var e=\"\",r=t.INSPECT_MAX_BYTES;return e=this.toString(\"hex\",0,r).replace(/(.{2})/g,\"$1 \").trim(),this.length>r&&(e+=\" ... \"),\"<Buffer \"+e+\">\"},o&&(u.prototype[o]=u.prototype.inspect),u.prototype.compare=function(e,t,r,n,i){if(D(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),!u.isBuffer(e))throw new TypeError('The \"target\" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError(\"out of range index\");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(t>>>=0),a=Math.min(o,s),l=this.slice(n,i),c=e.slice(t,r),h=0;h<a;++h)if(l[h]!==c[h]){o=l[h],s=c[h];break}return o<s?-1:s<o?1:0},u.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},u.prototype.indexOf=function(e,t,r){return m(this,e,t,r,!0)},u.prototype.lastIndexOf=function(e,t,r){return m(this,e,t,r,!1)},u.prototype.write=function(e,t,r,n){if(void 0===t)n=\"utf8\",r=this.length,t=0;else if(void 0===r&&\"string\"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error(\"Buffer.write(string, encoding, offset[, length]) is no longer supported\");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n=\"utf8\")):(n=r,r=void 0)}var i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError(\"Attempt to write outside buffer bounds\");n||(n=\"utf8\");for(var o=!1;;)switch(n){case\"hex\":return w(this,e,t,r);case\"utf8\":case\"utf-8\":return _(this,e,t,r);case\"ascii\":case\"latin1\":case\"binary\":return E(this,e,t,r);case\"base64\":return k(this,e,t,r);case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return S(this,e,t,r);default:if(o)throw new TypeError(\"Unknown encoding: \"+n);n=(\"\"+n).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:\"Buffer\",data:Array.prototype.slice.call(this._arr||this,0)}};var A=4096;function I(e,t,r){var n=\"\";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function x(e,t,r){var n=\"\";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function B(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var i=\"\",o=t;o<r;++o)i+=V[e[o]];return i}function R(e,t,r){for(var n=e.slice(t,r),i=\"\",o=0;o<n.length-1;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function O(e,t,r){if(e%1!=0||e<0)throw new RangeError(\"offset is not uint\");if(e+t>r)throw new RangeError(\"Trying to access beyond buffer length\")}function P(e,t,r,n,i,o){if(!u.isBuffer(e))throw new TypeError('\"buffer\" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('\"value\" argument is out of bounds');if(r+n>e.length)throw new RangeError(\"Index out of range\")}function N(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError(\"Index out of range\");if(r<0)throw new RangeError(\"Index out of range\")}function M(e,t,r,n,o){return t=+t,r>>>=0,o||N(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function L(e,t,r,n,o){return t=+t,r>>>=0,o||N(e,0,r,8),i.write(e,t,r,n,52,8),r+8}u.prototype.slice=function(e,t){var r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);var n=this.subarray(e,t);return Object.setPrototypeOf(n,u.prototype),n},u.prototype.readUintLE=u.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||O(e,t,this.length);for(var n=this[e],i=1,o=0;++o<t&&(i*=256);)n+=this[e+o]*i;return n},u.prototype.readUintBE=u.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||O(e,t,this.length);for(var n=this[e+--t],i=1;t>0&&(i*=256);)n+=this[e+--t]*i;return n},u.prototype.readUint8=u.prototype.readUInt8=function(e,t){return e>>>=0,t||O(e,1,this.length),this[e]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(e,t){return e>>>=0,t||O(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(e,t){return e>>>=0,t||O(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(e,t){return e>>>=0,t||O(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(e,t){return e>>>=0,t||O(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||O(e,t,this.length);for(var n=this[e],i=1,o=0;++o<t&&(i*=256);)n+=this[e+o]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*t)),n},u.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||O(e,t,this.length);for(var n=t,i=1,o=this[e+--n];n>0&&(i*=256);)o+=this[e+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},u.prototype.readInt8=function(e,t){return e>>>=0,t||O(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){e>>>=0,t||O(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(e,t){e>>>=0,t||O(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(e,t){return e>>>=0,t||O(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return e>>>=0,t||O(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readFloatLE=function(e,t){return e>>>=0,t||O(e,4,this.length),i.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return e>>>=0,t||O(e,4,this.length),i.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return e>>>=0,t||O(e,8,this.length),i.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return e>>>=0,t||O(e,8,this.length),i.read(this,e,!1,52,8)},u.prototype.writeUintLE=u.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||P(this,e,t,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[t]=255&e;++o<r&&(i*=256);)this[t+o]=e/i&255;return t+r},u.prototype.writeUintBE=u.prototype.writeUIntBE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||P(this,e,t,r,Math.pow(2,8*r)-1,0);var i=r-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r},u.prototype.writeUint8=u.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||P(this,e,t,1,255,0),this[t]=255&e,t+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||P(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||P(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||P(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||P(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var i=Math.pow(2,8*r-1);P(this,e,t,r,i-1,-i)}var o=0,s=1,a=0;for(this[t]=255&e;++o<r&&(s*=256);)e<0&&0===a&&0!==this[t+o-1]&&(a=1),this[t+o]=(e/s>>0)-a&255;return t+r},u.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var i=Math.pow(2,8*r-1);P(this,e,t,r,i-1,-i)}var o=r-1,s=1,a=0;for(this[t+o]=255&e;--o>=0&&(s*=256);)e<0&&0===a&&0!==this[t+o+1]&&(a=1),this[t+o]=(e/s>>0)-a&255;return t+r},u.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||P(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||P(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||P(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||P(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},u.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||P(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeFloatLE=function(e,t,r){return M(this,e,t,!0,r)},u.prototype.writeFloatBE=function(e,t,r){return M(this,e,t,!1,r)},u.prototype.writeDoubleLE=function(e,t,r){return L(this,e,t,!0,r)},u.prototype.writeDoubleBE=function(e,t,r){return L(this,e,t,!1,r)},u.prototype.copy=function(e,t,r,n){if(!u.isBuffer(e))throw new TypeError(\"argument should be a Buffer\");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError(\"targetStart out of bounds\");if(r<0||r>=this.length)throw new RangeError(\"Index out of range\");if(n<0)throw new RangeError(\"sourceEnd out of bounds\");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);var i=n-r;return this===e&&\"function\"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),i},u.prototype.fill=function(e,t,r,n){if(\"string\"==typeof e){if(\"string\"==typeof t?(n=t,t=0,r=this.length):\"string\"==typeof r&&(n=r,r=this.length),void 0!==n&&\"string\"!=typeof n)throw new TypeError(\"encoding must be a string\");if(\"string\"==typeof n&&!u.isEncoding(n))throw new TypeError(\"Unknown encoding: \"+n);if(1===e.length){var i=e.charCodeAt(0);(\"utf8\"===n&&i<128||\"latin1\"===n)&&(e=i)}}else\"number\"==typeof e?e&=255:\"boolean\"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError(\"Out of range index\");if(r<=t)return this;var o;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),\"number\"==typeof e)for(o=t;o<r;++o)this[o]=e;else{var s=u.isBuffer(e)?e:u.from(e,n),a=s.length;if(0===a)throw new TypeError('The value \"'+e+'\" is invalid for argument \"value\"');for(o=0;o<r-t;++o)this[o+t]=s[o%a]}return this};var U=/[^+/0-9A-Za-z-_]/g;function j(e,t){var r;t=t||1/0;for(var n=e.length,i=null,o=[],s=0;s<n;++s){if((r=e.charCodeAt(s))>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error(\"Invalid code point\");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function q(e){return n.toByteArray(function(e){if((e=(e=e.split(\"=\")[0]).trim().replace(U,\"\")).length<2)return\"\";for(;e.length%4!=0;)e+=\"=\";return e}(e))}function z(e,t,r,n){for(var i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function D(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function F(e){return e!=e}var V=function(){for(var e=\"0123456789abcdef\",t=new Array(256),r=0;r<16;++r)for(var n=16*r,i=0;i<16;++i)t[n+i]=e[r]+e[i];return t}()},8764:function(e,t,r){\"use strict\";const n=r(9742),i=r(645),o=\"function\"==typeof Symbol&&\"function\"==typeof Symbol.for?Symbol.for(\"nodejs.util.inspect.custom\"):null;t.Buffer=u,t.SlowBuffer=function(e){return+e!=e&&(e=0),u.alloc(+e)},t.INSPECT_MAX_BYTES=50;const s=2147483647;function a(e){if(e>s)throw new RangeError('The value \"'+e+'\" is invalid for option \"size\"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,u.prototype),t}function u(e,t,r){if(\"number\"==typeof e){if(\"string\"==typeof t)throw new TypeError('The \"string\" argument must be of type string. Received type number');return h(e)}return l(e,t,r)}function l(e,t,r){if(\"string\"==typeof e)return function(e,t){if(\"string\"==typeof t&&\"\"!==t||(t=\"utf8\"),!u.isEncoding(t))throw new TypeError(\"Unknown encoding: \"+t);const r=0|y(e,t);let n=a(r);const i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(Y(e,Uint8Array)){const t=new Uint8Array(e);return p(t.buffer,t.byteOffset,t.byteLength)}return f(e)}(e);if(null==e)throw new TypeError(\"The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type \"+typeof e);if(Y(e,ArrayBuffer)||e&&Y(e.buffer,ArrayBuffer))return p(e,t,r);if(\"undefined\"!=typeof SharedArrayBuffer&&(Y(e,SharedArrayBuffer)||e&&Y(e.buffer,SharedArrayBuffer)))return p(e,t,r);if(\"number\"==typeof e)throw new TypeError('The \"value\" argument must not be of type number. Received type number');const n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return u.from(n,t,r);const i=function(e){if(u.isBuffer(e)){const t=0|d(e.length),r=a(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?\"number\"!=typeof e.length||G(e.length)?a(0):f(e):\"Buffer\"===e.type&&Array.isArray(e.data)?f(e.data):void 0}(e);if(i)return i;if(\"undefined\"!=typeof Symbol&&null!=Symbol.toPrimitive&&\"function\"==typeof e[Symbol.toPrimitive])return u.from(e[Symbol.toPrimitive](\"string\"),t,r);throw new TypeError(\"The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type \"+typeof e)}function c(e){if(\"number\"!=typeof e)throw new TypeError('\"size\" argument must be of type number');if(e<0)throw new RangeError('The value \"'+e+'\" is invalid for option \"size\"')}function h(e){return c(e),a(e<0?0:0|d(e))}function f(e){const t=e.length<0?0:0|d(e.length),r=a(t);for(let n=0;n<t;n+=1)r[n]=255&e[n];return r}function p(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('\"offset\" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('\"length\" is outside of buffer bounds');let n;return n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(n,u.prototype),n}function d(e){if(e>=s)throw new RangeError(\"Attempt to allocate Buffer larger than maximum size: 0x\"+s.toString(16)+\" bytes\");return 0|e}function y(e,t){if(u.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||Y(e,ArrayBuffer))return e.byteLength;if(\"string\"!=typeof e)throw new TypeError('The \"string\" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(t){case\"ascii\":case\"latin1\":case\"binary\":return r;case\"utf8\":case\"utf-8\":return K(e).length;case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return 2*r;case\"hex\":return r>>>1;case\"base64\":return $(e).length;default:if(i)return n?-1:K(e).length;t=(\"\"+t).toLowerCase(),i=!0}}function g(e,t,r){let n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return\"\";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return\"\";if((r>>>=0)<=(t>>>=0))return\"\";for(e||(e=\"utf8\");;)switch(e){case\"hex\":return B(this,t,r);case\"utf8\":case\"utf-8\":return T(this,t,r);case\"ascii\":return I(this,t,r);case\"latin1\":case\"binary\":return x(this,t,r);case\"base64\":return C(this,t,r);case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return R(this,t,r);default:if(n)throw new TypeError(\"Unknown encoding: \"+e);e=(e+\"\").toLowerCase(),n=!0}}function b(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function m(e,t,r,n,i){if(0===e.length)return-1;if(\"string\"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),G(r=+r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if(\"string\"==typeof t&&(t=u.from(t,n)),u.isBuffer(t))return 0===t.length?-1:v(e,t,r,n,i);if(\"number\"==typeof t)return t&=255,\"function\"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):v(e,[t],r,n,i);throw new TypeError(\"val must be string, number or Buffer\")}function v(e,t,r,n,i){let o,s=1,a=e.length,u=t.length;if(void 0!==n&&(\"ucs2\"===(n=String(n).toLowerCase())||\"ucs-2\"===n||\"utf16le\"===n||\"utf-16le\"===n)){if(e.length<2||t.length<2)return-1;s=2,a/=2,u/=2,r/=2}function l(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){let n=-1;for(o=r;o<a;o++)if(l(e,o)===l(t,-1===n?0:o-n)){if(-1===n&&(n=o),o-n+1===u)return n*s}else-1!==n&&(o-=o-n),n=-1}else for(r+u>a&&(r=a-u),o=r;o>=0;o--){let r=!0;for(let n=0;n<u;n++)if(l(e,o+n)!==l(t,n)){r=!1;break}if(r)return o}return-1}function w(e,t,r,n){r=Number(r)||0;const i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;const o=t.length;let s;for(n>o/2&&(n=o/2),s=0;s<n;++s){const n=parseInt(t.substr(2*s,2),16);if(G(n))return s;e[r+s]=n}return s}function _(e,t,r,n){return Q(K(t,e.length-r),e,r,n)}function E(e,t,r,n){return Q(function(e){const t=[];for(let r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function k(e,t,r,n){return Q($(t),e,r,n)}function S(e,t,r,n){return Q(function(e,t){let r,n,i;const o=[];for(let s=0;s<e.length&&!((t-=2)<0);++s)r=e.charCodeAt(s),n=r>>8,i=r%256,o.push(i),o.push(n);return o}(t,e.length-r),e,r,n)}function C(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function T(e,t,r){r=Math.min(e.length,r);const n=[];let i=t;for(;i<r;){const t=e[i];let o=null,s=t>239?4:t>223?3:t>191?2:1;if(i+s<=r){let r,n,a,u;switch(s){case 1:t<128&&(o=t);break;case 2:r=e[i+1],128==(192&r)&&(u=(31&t)<<6|63&r,u>127&&(o=u));break;case 3:r=e[i+1],n=e[i+2],128==(192&r)&&128==(192&n)&&(u=(15&t)<<12|(63&r)<<6|63&n,u>2047&&(u<55296||u>57343)&&(o=u));break;case 4:r=e[i+1],n=e[i+2],a=e[i+3],128==(192&r)&&128==(192&n)&&128==(192&a)&&(u=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&a,u>65535&&u<1114112&&(o=u))}}null===o?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=s}return function(e){const t=e.length;if(t<=A)return String.fromCharCode.apply(String,e);let r=\"\",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=A));return r}(n)}t.kMaxLength=s,u.TYPED_ARRAY_SUPPORT=function(){try{const e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),u.TYPED_ARRAY_SUPPORT||\"undefined\"==typeof console||\"function\"!=typeof console.error||console.error(\"This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.\"),Object.defineProperty(u.prototype,\"parent\",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.buffer}}),Object.defineProperty(u.prototype,\"offset\",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.byteOffset}}),u.poolSize=8192,u.from=function(e,t,r){return l(e,t,r)},Object.setPrototypeOf(u.prototype,Uint8Array.prototype),Object.setPrototypeOf(u,Uint8Array),u.alloc=function(e,t,r){return function(e,t,r){return c(e),e<=0?a(e):void 0!==t?\"string\"==typeof r?a(e).fill(t,r):a(e).fill(t):a(e)}(e,t,r)},u.allocUnsafe=function(e){return h(e)},u.allocUnsafeSlow=function(e){return h(e)},u.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==u.prototype},u.compare=function(e,t){if(Y(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),Y(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),!u.isBuffer(e)||!u.isBuffer(t))throw new TypeError('The \"buf1\", \"buf2\" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,n=t.length;for(let i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},u.isEncoding=function(e){switch(String(e).toLowerCase()){case\"hex\":case\"utf8\":case\"utf-8\":case\"ascii\":case\"latin1\":case\"binary\":case\"base64\":case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return!0;default:return!1}},u.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('\"list\" argument must be an Array of Buffers');if(0===e.length)return u.alloc(0);let r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;const n=u.allocUnsafe(t);let i=0;for(r=0;r<e.length;++r){let t=e[r];if(Y(t,Uint8Array))i+t.length>n.length?(u.isBuffer(t)||(t=u.from(t)),t.copy(n,i)):Uint8Array.prototype.set.call(n,t,i);else{if(!u.isBuffer(t))throw new TypeError('\"list\" argument must be an Array of Buffers');t.copy(n,i)}i+=t.length}return n},u.byteLength=y,u.prototype._isBuffer=!0,u.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError(\"Buffer size must be a multiple of 16-bits\");for(let t=0;t<e;t+=2)b(this,t,t+1);return this},u.prototype.swap32=function(){const e=this.length;if(e%4!=0)throw new RangeError(\"Buffer size must be a multiple of 32-bits\");for(let t=0;t<e;t+=4)b(this,t,t+3),b(this,t+1,t+2);return this},u.prototype.swap64=function(){const e=this.length;if(e%8!=0)throw new RangeError(\"Buffer size must be a multiple of 64-bits\");for(let t=0;t<e;t+=8)b(this,t,t+7),b(this,t+1,t+6),b(this,t+2,t+5),b(this,t+3,t+4);return this},u.prototype.toString=function(){const e=this.length;return 0===e?\"\":0===arguments.length?T(this,0,e):g.apply(this,arguments)},u.prototype.toLocaleString=u.prototype.toString,u.prototype.equals=function(e){if(!u.isBuffer(e))throw new TypeError(\"Argument must be a Buffer\");return this===e||0===u.compare(this,e)},u.prototype.inspect=function(){let e=\"\";const r=t.INSPECT_MAX_BYTES;return e=this.toString(\"hex\",0,r).replace(/(.{2})/g,\"$1 \").trim(),this.length>r&&(e+=\" ... \"),\"<Buffer \"+e+\">\"},o&&(u.prototype[o]=u.prototype.inspect),u.prototype.compare=function(e,t,r,n,i){if(Y(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),!u.isBuffer(e))throw new TypeError('The \"target\" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError(\"out of range index\");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;let o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(t>>>=0);const a=Math.min(o,s),l=this.slice(n,i),c=e.slice(t,r);for(let e=0;e<a;++e)if(l[e]!==c[e]){o=l[e],s=c[e];break}return o<s?-1:s<o?1:0},u.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},u.prototype.indexOf=function(e,t,r){return m(this,e,t,r,!0)},u.prototype.lastIndexOf=function(e,t,r){return m(this,e,t,r,!1)},u.prototype.write=function(e,t,r,n){if(void 0===t)n=\"utf8\",r=this.length,t=0;else if(void 0===r&&\"string\"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error(\"Buffer.write(string, encoding, offset[, length]) is no longer supported\");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n=\"utf8\")):(n=r,r=void 0)}const i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError(\"Attempt to write outside buffer bounds\");n||(n=\"utf8\");let o=!1;for(;;)switch(n){case\"hex\":return w(this,e,t,r);case\"utf8\":case\"utf-8\":return _(this,e,t,r);case\"ascii\":case\"latin1\":case\"binary\":return E(this,e,t,r);case\"base64\":return k(this,e,t,r);case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return S(this,e,t,r);default:if(o)throw new TypeError(\"Unknown encoding: \"+n);n=(\"\"+n).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:\"Buffer\",data:Array.prototype.slice.call(this._arr||this,0)}};const A=4096;function I(e,t,r){let n=\"\";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function x(e,t,r){let n=\"\";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function B(e,t,r){const n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);let i=\"\";for(let n=t;n<r;++n)i+=Z[e[n]];return i}function R(e,t,r){const n=e.slice(t,r);let i=\"\";for(let e=0;e<n.length-1;e+=2)i+=String.fromCharCode(n[e]+256*n[e+1]);return i}function O(e,t,r){if(e%1!=0||e<0)throw new RangeError(\"offset is not uint\");if(e+t>r)throw new RangeError(\"Trying to access beyond buffer length\")}function P(e,t,r,n,i,o){if(!u.isBuffer(e))throw new TypeError('\"buffer\" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('\"value\" argument is out of bounds');if(r+n>e.length)throw new RangeError(\"Index out of range\")}function N(e,t,r,n,i){F(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,r}function M(e,t,r,n,i){F(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r+7]=o,o>>=8,e[r+6]=o,o>>=8,e[r+5]=o,o>>=8,e[r+4]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=s,s>>=8,e[r+2]=s,s>>=8,e[r+1]=s,s>>=8,e[r]=s,r+8}function L(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError(\"Index out of range\");if(r<0)throw new RangeError(\"Index out of range\")}function U(e,t,r,n,o){return t=+t,r>>>=0,o||L(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function j(e,t,r,n,o){return t=+t,r>>>=0,o||L(e,0,r,8),i.write(e,t,r,n,52,8),r+8}u.prototype.slice=function(e,t){const r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);const n=this.subarray(e,t);return Object.setPrototypeOf(n,u.prototype),n},u.prototype.readUintLE=u.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||O(e,t,this.length);let n=this[e],i=1,o=0;for(;++o<t&&(i*=256);)n+=this[e+o]*i;return n},u.prototype.readUintBE=u.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||O(e,t,this.length);let n=this[e+--t],i=1;for(;t>0&&(i*=256);)n+=this[e+--t]*i;return n},u.prototype.readUint8=u.prototype.readUInt8=function(e,t){return e>>>=0,t||O(e,1,this.length),this[e]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(e,t){return e>>>=0,t||O(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(e,t){return e>>>=0,t||O(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(e,t){return e>>>=0,t||O(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(e,t){return e>>>=0,t||O(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readBigUInt64LE=J((function(e){V(e>>>=0,\"offset\");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||W(e,this.length-8);const n=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,i=this[++e]+256*this[++e]+65536*this[++e]+r*2**24;return BigInt(n)+(BigInt(i)<<BigInt(32))})),u.prototype.readBigUInt64BE=J((function(e){V(e>>>=0,\"offset\");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||W(e,this.length-8);const n=t*2**24+65536*this[++e]+256*this[++e]+this[++e],i=this[++e]*2**24+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<<BigInt(32))+BigInt(i)})),u.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||O(e,t,this.length);let n=this[e],i=1,o=0;for(;++o<t&&(i*=256);)n+=this[e+o]*i;return i*=128,n>=i&&(n-=Math.pow(2,8*t)),n},u.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||O(e,t,this.length);let n=t,i=1,o=this[e+--n];for(;n>0&&(i*=256);)o+=this[e+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o},u.prototype.readInt8=function(e,t){return e>>>=0,t||O(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){e>>>=0,t||O(e,2,this.length);const r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(e,t){e>>>=0,t||O(e,2,this.length);const r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(e,t){return e>>>=0,t||O(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return e>>>=0,t||O(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readBigInt64LE=J((function(e){V(e>>>=0,\"offset\");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||W(e,this.length-8);const n=this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)})),u.prototype.readBigInt64BE=J((function(e){V(e>>>=0,\"offset\");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||W(e,this.length-8);const n=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(n)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+r)})),u.prototype.readFloatLE=function(e,t){return e>>>=0,t||O(e,4,this.length),i.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return e>>>=0,t||O(e,4,this.length),i.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return e>>>=0,t||O(e,8,this.length),i.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return e>>>=0,t||O(e,8,this.length),i.read(this,e,!1,52,8)},u.prototype.writeUintLE=u.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||P(this,e,t,r,Math.pow(2,8*r)-1,0);let i=1,o=0;for(this[t]=255&e;++o<r&&(i*=256);)this[t+o]=e/i&255;return t+r},u.prototype.writeUintBE=u.prototype.writeUIntBE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||P(this,e,t,r,Math.pow(2,8*r)-1,0);let i=r-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r},u.prototype.writeUint8=u.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||P(this,e,t,1,255,0),this[t]=255&e,t+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||P(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||P(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||P(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||P(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeBigUInt64LE=J((function(e,t=0){return N(this,e,t,BigInt(0),BigInt(\"0xffffffffffffffff\"))})),u.prototype.writeBigUInt64BE=J((function(e,t=0){return M(this,e,t,BigInt(0),BigInt(\"0xffffffffffffffff\"))})),u.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);P(this,e,t,r,n-1,-n)}let i=0,o=1,s=0;for(this[t]=255&e;++i<r&&(o*=256);)e<0&&0===s&&0!==this[t+i-1]&&(s=1),this[t+i]=(e/o>>0)-s&255;return t+r},u.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);P(this,e,t,r,n-1,-n)}let i=r-1,o=1,s=0;for(this[t+i]=255&e;--i>=0&&(o*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/o>>0)-s&255;return t+r},u.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||P(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||P(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||P(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||P(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},u.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||P(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeBigInt64LE=J((function(e,t=0){return N(this,e,t,-BigInt(\"0x8000000000000000\"),BigInt(\"0x7fffffffffffffff\"))})),u.prototype.writeBigInt64BE=J((function(e,t=0){return M(this,e,t,-BigInt(\"0x8000000000000000\"),BigInt(\"0x7fffffffffffffff\"))})),u.prototype.writeFloatLE=function(e,t,r){return U(this,e,t,!0,r)},u.prototype.writeFloatBE=function(e,t,r){return U(this,e,t,!1,r)},u.prototype.writeDoubleLE=function(e,t,r){return j(this,e,t,!0,r)},u.prototype.writeDoubleBE=function(e,t,r){return j(this,e,t,!1,r)},u.prototype.copy=function(e,t,r,n){if(!u.isBuffer(e))throw new TypeError(\"argument should be a Buffer\");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError(\"targetStart out of bounds\");if(r<0||r>=this.length)throw new RangeError(\"Index out of range\");if(n<0)throw new RangeError(\"sourceEnd out of bounds\");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);const i=n-r;return this===e&&\"function\"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),i},u.prototype.fill=function(e,t,r,n){if(\"string\"==typeof e){if(\"string\"==typeof t?(n=t,t=0,r=this.length):\"string\"==typeof r&&(n=r,r=this.length),void 0!==n&&\"string\"!=typeof n)throw new TypeError(\"encoding must be a string\");if(\"string\"==typeof n&&!u.isEncoding(n))throw new TypeError(\"Unknown encoding: \"+n);if(1===e.length){const t=e.charCodeAt(0);(\"utf8\"===n&&t<128||\"latin1\"===n)&&(e=t)}}else\"number\"==typeof e?e&=255:\"boolean\"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError(\"Out of range index\");if(r<=t)return this;let i;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),\"number\"==typeof e)for(i=t;i<r;++i)this[i]=e;else{const o=u.isBuffer(e)?e:u.from(e,n),s=o.length;if(0===s)throw new TypeError('The value \"'+e+'\" is invalid for argument \"value\"');for(i=0;i<r-t;++i)this[i+t]=o[i%s]}return this};const q={};function z(e,t,r){q[e]=class extends r{constructor(){super(),Object.defineProperty(this,\"message\",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,\"code\",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function D(e){let t=\"\",r=e.length;const n=\"-\"===e[0]?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function F(e,t,r,n,i,o){if(e>r||e<t){const n=\"bigint\"==typeof t?\"n\":\"\";let i;throw i=o>3?0===t||t===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(o+1)}${n}`:`>= -(2${n} ** ${8*(o+1)-1}${n}) and < 2 ** ${8*(o+1)-1}${n}`:`>= ${t}${n} and <= ${r}${n}`,new q.ERR_OUT_OF_RANGE(\"value\",i,e)}!function(e,t,r){V(t,\"offset\"),void 0!==e[t]&&void 0!==e[t+r]||W(t,e.length-(r+1))}(n,i,o)}function V(e,t){if(\"number\"!=typeof e)throw new q.ERR_INVALID_ARG_TYPE(t,\"number\",e)}function W(e,t,r){if(Math.floor(e)!==e)throw V(e,r),new q.ERR_OUT_OF_RANGE(r||\"offset\",\"an integer\",e);if(t<0)throw new q.ERR_BUFFER_OUT_OF_BOUNDS;throw new q.ERR_OUT_OF_RANGE(r||\"offset\",`>= ${r?1:0} and <= ${t}`,e)}z(\"ERR_BUFFER_OUT_OF_BOUNDS\",(function(e){return e?`${e} is outside of buffer bounds`:\"Attempt to access memory outside buffer bounds\"}),RangeError),z(\"ERR_INVALID_ARG_TYPE\",(function(e,t){return`The \"${e}\" argument must be of type number. Received type ${typeof t}`}),TypeError),z(\"ERR_OUT_OF_RANGE\",(function(e,t,r){let n=`The value of \"${e}\" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=D(String(r)):\"bigint\"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=D(i)),i+=\"n\"),n+=` It must be ${t}. Received ${i}`,n}),RangeError);const H=/[^+/0-9A-Za-z-_]/g;function K(e,t){let r;t=t||1/0;const n=e.length;let i=null;const o=[];for(let s=0;s<n;++s){if(r=e.charCodeAt(s),r>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error(\"Invalid code point\");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function $(e){return n.toByteArray(function(e){if((e=(e=e.split(\"=\")[0]).trim().replace(H,\"\")).length<2)return\"\";for(;e.length%4!=0;)e+=\"=\";return e}(e))}function Q(e,t,r,n){let i;for(i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function Y(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function G(e){return e!=e}const Z=function(){const e=\"0123456789abcdef\",t=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let i=0;i<16;++i)t[n+i]=e[r]+e[i]}return t}();function J(e){return\"undefined\"==typeof BigInt?X:e}function X(){throw new Error(\"BigInt not supported\")}},1227:function(e,t,r){var n=r(4155);t.formatArgs=function(t){if(t[0]=(this.useColors?\"%c\":\"\")+this.namespace+(this.useColors?\" %c\":\" \")+t[0]+(this.useColors?\"%c \":\" \")+\"+\"+e.exports.humanize(this.diff),!this.useColors)return;const r=\"color: \"+this.color;t.splice(1,0,r,\"color: inherit\");let n=0,i=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{\"%%\"!==e&&(n++,\"%c\"===e&&(i=n))})),t.splice(i,0,r)},t.save=function(e){try{e?t.storage.setItem(\"debug\",e):t.storage.removeItem(\"debug\")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem(\"debug\")}catch(e){}return!e&&void 0!==n&&\"env\"in n&&(e=n.env.DEBUG),e},t.useColors=function(){return!(\"undefined\"==typeof window||!window.process||\"renderer\"!==window.process.type&&!window.process.__nwjs)||(\"undefined\"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\\/(\\d+)/))&&(\"undefined\"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||\"undefined\"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||\"undefined\"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/)&&parseInt(RegExp.$1,10)>=31||\"undefined\"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/))},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn(\"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.\"))}})(),t.colors=[\"#0000CC\",\"#0000FF\",\"#0033CC\",\"#0033FF\",\"#0066CC\",\"#0066FF\",\"#0099CC\",\"#0099FF\",\"#00CC00\",\"#00CC33\",\"#00CC66\",\"#00CC99\",\"#00CCCC\",\"#00CCFF\",\"#3300CC\",\"#3300FF\",\"#3333CC\",\"#3333FF\",\"#3366CC\",\"#3366FF\",\"#3399CC\",\"#3399FF\",\"#33CC00\",\"#33CC33\",\"#33CC66\",\"#33CC99\",\"#33CCCC\",\"#33CCFF\",\"#6600CC\",\"#6600FF\",\"#6633CC\",\"#6633FF\",\"#66CC00\",\"#66CC33\",\"#9900CC\",\"#9900FF\",\"#9933CC\",\"#9933FF\",\"#99CC00\",\"#99CC33\",\"#CC0000\",\"#CC0033\",\"#CC0066\",\"#CC0099\",\"#CC00CC\",\"#CC00FF\",\"#CC3300\",\"#CC3333\",\"#CC3366\",\"#CC3399\",\"#CC33CC\",\"#CC33FF\",\"#CC6600\",\"#CC6633\",\"#CC9900\",\"#CC9933\",\"#CCCC00\",\"#CCCC33\",\"#FF0000\",\"#FF0033\",\"#FF0066\",\"#FF0099\",\"#FF00CC\",\"#FF00FF\",\"#FF3300\",\"#FF3333\",\"#FF3366\",\"#FF3399\",\"#FF33CC\",\"#FF33FF\",\"#FF6600\",\"#FF6633\",\"#FF9900\",\"#FF9933\",\"#FFCC00\",\"#FFCC33\"],t.log=console.debug||console.log||(()=>{}),e.exports=r(2447)(t);const{formatters:i}=e.exports;i.j=function(e){try{return JSON.stringify(e)}catch(e){return\"[UnexpectedJSONParseError]: \"+e.message}}},2447:function(e,t,r){e.exports=function(e){function t(e){let r,i,o,s=null;function a(...e){if(!a.enabled)return;const n=a,i=Number(new Date),o=i-(r||i);n.diff=o,n.prev=r,n.curr=i,r=i,e[0]=t.coerce(e[0]),\"string\"!=typeof e[0]&&e.unshift(\"%O\");let s=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((r,i)=>{if(\"%%\"===r)return\"%\";s++;const o=t.formatters[i];if(\"function\"==typeof o){const t=e[s];r=o.call(n,t),e.splice(s,1),s--}return r})),t.formatArgs.call(n,e),(n.log||t.log).apply(n,e)}return a.namespace=e,a.useColors=t.useColors(),a.color=t.selectColor(e),a.extend=n,a.destroy=t.destroy,Object.defineProperty(a,\"enabled\",{enumerable:!0,configurable:!1,get:()=>null!==s?s:(i!==t.namespaces&&(i=t.namespaces,o=t.enabled(e)),o),set:e=>{s=e}}),\"function\"==typeof t.init&&t.init(a),a}function n(e,r){const n=t(this.namespace+(void 0===r?\":\":r)+e);return n.log=this.log,n}function i(e){return e.toString().substring(2,e.toString().length-2).replace(/\\.\\*\\?$/,\"*\")}return t.debug=t,t.default=t,t.coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){const e=[...t.names.map(i),...t.skips.map(i).map((e=>\"-\"+e))].join(\",\");return t.enable(\"\"),e},t.enable=function(e){let r;t.save(e),t.namespaces=e,t.names=[],t.skips=[];const n=(\"string\"==typeof e?e:\"\").split(/[\\s,]+/),i=n.length;for(r=0;r<i;r++)n[r]&&(\"-\"===(e=n[r].replace(/\\*/g,\".*?\"))[0]?t.skips.push(new RegExp(\"^\"+e.slice(1)+\"$\")):t.names.push(new RegExp(\"^\"+e+\"$\")))},t.enabled=function(e){if(\"*\"===e[e.length-1])return!0;let r,n;for(r=0,n=t.skips.length;r<n;r++)if(t.skips[r].test(e))return!1;for(r=0,n=t.names.length;r<n;r++)if(t.names[r].test(e))return!0;return!1},t.humanize=r(7824),t.destroy=function(){console.warn(\"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.\")},Object.keys(e).forEach((r=>{t[r]=e[r]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let r=0;for(let t=0;t<e.length;t++)r=(r<<5)-r+e.charCodeAt(t),r|=0;return t.colors[Math.abs(r)%t.colors.length]},t.enable(t.load()),t}},5981:function(e,t,r){var n=r(8764).Buffer,i=r(4155),o=r(8473),s=r(2840),a=r(5717),u=r(1852),l=n.from&&n.from!==Uint8Array.from?n.from([0]):new n([0]),c=function(e,t){e._corked?e.once(\"uncork\",t):t()},h=function(e,t){return function(r){r?function(e,t){e._autoDestroy&&e.destroy(t)}(e,\"premature close\"===r.message?null:r):t&&!e._ended&&e.end()}},f=function(){},p=function(e,t,r){if(!(this instanceof p))return new p(e,t,r);o.Duplex.call(this,r),this._writable=null,this._readable=null,this._readable2=null,this._autoDestroy=!r||!1!==r.autoDestroy,this._forwardDestroy=!r||!1!==r.destroy,this._forwardEnd=!r||!1!==r.end,this._corked=1,this._ondrain=null,this._drained=!1,this._forwarding=!1,this._unwrite=null,this._unread=null,this._ended=!1,this.destroyed=!1,e&&this.setWritable(e),t&&this.setReadable(t)};a(p,o.Duplex),p.obj=function(e,t,r){return r||(r={}),r.objectMode=!0,r.highWaterMark=16,new p(e,t,r)},p.prototype.cork=function(){1==++this._corked&&this.emit(\"cork\")},p.prototype.uncork=function(){this._corked&&0==--this._corked&&this.emit(\"uncork\")},p.prototype.setWritable=function(e){if(this._unwrite&&this._unwrite(),this.destroyed)e&&e.destroy&&e.destroy();else if(null!==e&&!1!==e){var t=this,r=s(e,{writable:!0,readable:!1},h(this,this._forwardEnd)),n=function(){var e=t._ondrain;t._ondrain=null,e&&e()};this._unwrite&&i.nextTick(n),this._writable=e,this._writable.on(\"drain\",n),this._unwrite=function(){t._writable.removeListener(\"drain\",n),r()},this.uncork()}else this.end()},p.prototype.setReadable=function(e){if(this._unread&&this._unread(),this.destroyed)e&&e.destroy&&e.destroy();else{if(null===e||!1===e)return this.push(null),void this.resume();var t,r=this,n=s(e,{writable:!1,readable:!0},h(this)),i=function(){r._forward()},a=function(){r.push(null)};this._drained=!0,this._readable=e,this._readable2=e._readableState?e:(t=e,new o.Readable({objectMode:!0,highWaterMark:16}).wrap(t)),this._readable2.on(\"readable\",i),this._readable2.on(\"end\",a),this._unread=function(){r._readable2.removeListener(\"readable\",i),r._readable2.removeListener(\"end\",a),n()},this._forward()}},p.prototype._read=function(){this._drained=!0,this._forward()},p.prototype._forward=function(){if(!this._forwarding&&this._readable2&&this._drained){var e;for(this._forwarding=!0;this._drained&&null!==(e=u(this._readable2));)this.destroyed||(this._drained=this.push(e));this._forwarding=!1}},p.prototype.destroy=function(e,t){if(t||(t=f),this.destroyed)return t(null);this.destroyed=!0;var r=this;i.nextTick((function(){r._destroy(e),t(null)}))},p.prototype._destroy=function(e){if(e){var t=this._ondrain;this._ondrain=null,t?t(e):this.emit(\"error\",e)}this._forwardDestroy&&(this._readable&&this._readable.destroy&&this._readable.destroy(),this._writable&&this._writable.destroy&&this._writable.destroy()),this.emit(\"close\")},p.prototype._write=function(e,t,r){if(!this.destroyed)return this._corked?c(this,this._write.bind(this,e,t,r)):e===l?this._finish(r):this._writable?void(!1===this._writable.write(e)?this._ondrain=r:this.destroyed||r()):r()},p.prototype._finish=function(e){var t=this;this.emit(\"preend\"),c(this,(function(){var r,n;n=function(){!1===t._writableState.prefinished&&(t._writableState.prefinished=!0),t.emit(\"prefinish\"),c(t,e)},(r=t._forwardEnd&&t._writable)?r._writableState&&r._writableState.finished?n():r._writableState?r.end(n):(r.end(),n()):n()}))},p.prototype.end=function(e,t,r){return\"function\"==typeof e?this.end(null,null,e):\"function\"==typeof t?this.end(e,null,t):(this._ended=!0,e&&this.write(e),this._writableState.ending||this._writableState.destroyed||this.write(l),o.Writable.prototype.end.call(this,r))},e.exports=p},2840:function(e,t,r){var n=r(4155),i=r(778),o=function(){},s=function(e,t,r){if(\"function\"==typeof t)return s(e,null,t);t||(t={}),r=i(r||o);var a=e._writableState,u=e._readableState,l=t.readable||!1!==t.readable&&e.readable,c=t.writable||!1!==t.writable&&e.writable,h=!1,f=function(){e.writable||p()},p=function(){c=!1,l||r.call(e)},d=function(){l=!1,c||r.call(e)},y=function(t){r.call(e,t?new Error(\"exited with error code: \"+t):null)},g=function(t){r.call(e,t)},b=function(){n.nextTick(m)},m=function(){if(!h)return(!l||u&&u.ended&&!u.destroyed)&&(!c||a&&a.ended&&!a.destroyed)?void 0:r.call(e,new Error(\"premature close\"))},v=function(){e.req.on(\"finish\",p)};return function(e){return e.setHeader&&\"function\"==typeof e.abort}(e)?(e.on(\"complete\",p),e.on(\"abort\",b),e.req?v():e.on(\"request\",v)):c&&!a&&(e.on(\"end\",f),e.on(\"close\",f)),function(e){return e.stdio&&Array.isArray(e.stdio)&&3===e.stdio.length}(e)&&e.on(\"exit\",y),e.on(\"end\",d),e.on(\"finish\",p),!1!==t.error&&e.on(\"error\",g),e.on(\"close\",b),function(){h=!0,e.removeListener(\"complete\",p),e.removeListener(\"abort\",b),e.removeListener(\"request\",v),e.req&&e.req.removeListener(\"finish\",p),e.removeListener(\"end\",f),e.removeListener(\"close\",f),e.removeListener(\"finish\",p),e.removeListener(\"exit\",y),e.removeListener(\"end\",d),e.removeListener(\"error\",g),e.removeListener(\"close\",b)}};e.exports=s},7187:function(e){var t=Object.create||function(e){var t=function(){};return t.prototype=e,new t},r=Object.keys||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.push(r);return r},n=Function.prototype.bind||function(e){var t=this;return function(){return t.apply(e,arguments)}};function i(){this._events&&Object.prototype.hasOwnProperty.call(this,\"_events\")||(this._events=t(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0}e.exports=i,i.EventEmitter=i,i.prototype._events=void 0,i.prototype._maxListeners=void 0;var o,s=10;try{var a={};Object.defineProperty&&Object.defineProperty(a,\"x\",{value:0}),o=0===a.x}catch(e){o=!1}function u(e){return void 0===e._maxListeners?i.defaultMaxListeners:e._maxListeners}function l(e,t,r){if(t)e.call(r);else for(var n=e.length,i=v(e,n),o=0;o<n;++o)i[o].call(r)}function c(e,t,r,n){if(t)e.call(r,n);else for(var i=e.length,o=v(e,i),s=0;s<i;++s)o[s].call(r,n)}function h(e,t,r,n,i){if(t)e.call(r,n,i);else for(var o=e.length,s=v(e,o),a=0;a<o;++a)s[a].call(r,n,i)}function f(e,t,r,n,i,o){if(t)e.call(r,n,i,o);else for(var s=e.length,a=v(e,s),u=0;u<s;++u)a[u].call(r,n,i,o)}function p(e,t,r,n){if(t)e.apply(r,n);else for(var i=e.length,o=v(e,i),s=0;s<i;++s)o[s].apply(r,n)}function d(e,r,n,i){var o,s,a;if(\"function\"!=typeof n)throw new TypeError('\"listener\" argument must be a function');if((s=e._events)?(s.newListener&&(e.emit(\"newListener\",r,n.listener?n.listener:n),s=e._events),a=s[r]):(s=e._events=t(null),e._eventsCount=0),a){if(\"function\"==typeof a?a=s[r]=i?[n,a]:[a,n]:i?a.unshift(n):a.push(n),!a.warned&&(o=u(e))&&o>0&&a.length>o){a.warned=!0;var l=new Error(\"Possible EventEmitter memory leak detected. \"+a.length+' \"'+String(r)+'\" listeners added. Use emitter.setMaxListeners() to increase limit.');l.name=\"MaxListenersExceededWarning\",l.emitter=e,l.type=r,l.count=a.length,\"object\"==typeof console&&console.warn&&console.warn(\"%s: %s\",l.name,l.message)}}else a=s[r]=n,++e._eventsCount;return e}function y(){if(!this.fired)switch(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length){case 0:return this.listener.call(this.target);case 1:return this.listener.call(this.target,arguments[0]);case 2:return this.listener.call(this.target,arguments[0],arguments[1]);case 3:return this.listener.call(this.target,arguments[0],arguments[1],arguments[2]);default:for(var e=new Array(arguments.length),t=0;t<e.length;++t)e[t]=arguments[t];this.listener.apply(this.target,e)}}function g(e,t,r){var i={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},o=n.call(y,i);return o.listener=r,i.wrapFn=o,o}function b(e,t,r){var n=e._events;if(!n)return[];var i=n[t];return i?\"function\"==typeof i?r?[i.listener||i]:[i]:r?function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(i):v(i,i.length):[]}function m(e){var t=this._events;if(t){var r=t[e];if(\"function\"==typeof r)return 1;if(r)return r.length}return 0}function v(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}o?Object.defineProperty(i,\"defaultMaxListeners\",{enumerable:!0,get:function(){return s},set:function(e){if(\"number\"!=typeof e||e<0||e!=e)throw new TypeError('\"defaultMaxListeners\" must be a positive number');s=e}}):i.defaultMaxListeners=s,i.prototype.setMaxListeners=function(e){if(\"number\"!=typeof e||e<0||isNaN(e))throw new TypeError('\"n\" argument must be a positive number');return this._maxListeners=e,this},i.prototype.getMaxListeners=function(){return u(this)},i.prototype.emit=function(e){var t,r,n,i,o,s,a=\"error\"===e;if(s=this._events)a=a&&null==s.error;else if(!a)return!1;if(a){if(arguments.length>1&&(t=arguments[1]),t instanceof Error)throw t;var u=new Error('Unhandled \"error\" event. ('+t+\")\");throw u.context=t,u}if(!(r=s[e]))return!1;var d=\"function\"==typeof r;switch(n=arguments.length){case 1:l(r,d,this);break;case 2:c(r,d,this,arguments[1]);break;case 3:h(r,d,this,arguments[1],arguments[2]);break;case 4:f(r,d,this,arguments[1],arguments[2],arguments[3]);break;default:for(i=new Array(n-1),o=1;o<n;o++)i[o-1]=arguments[o];p(r,d,this,i)}return!0},i.prototype.addListener=function(e,t){return d(this,e,t,!1)},i.prototype.on=i.prototype.addListener,i.prototype.prependListener=function(e,t){return d(this,e,t,!0)},i.prototype.once=function(e,t){if(\"function\"!=typeof t)throw new TypeError('\"listener\" argument must be a function');return this.on(e,g(this,e,t)),this},i.prototype.prependOnceListener=function(e,t){if(\"function\"!=typeof t)throw new TypeError('\"listener\" argument must be a function');return this.prependListener(e,g(this,e,t)),this},i.prototype.removeListener=function(e,r){var n,i,o,s,a;if(\"function\"!=typeof r)throw new TypeError('\"listener\" argument must be a function');if(!(i=this._events))return this;if(!(n=i[e]))return this;if(n===r||n.listener===r)0==--this._eventsCount?this._events=t(null):(delete i[e],i.removeListener&&this.emit(\"removeListener\",e,n.listener||r));else if(\"function\"!=typeof n){for(o=-1,s=n.length-1;s>=0;s--)if(n[s]===r||n[s].listener===r){a=n[s].listener,o=s;break}if(o<0)return this;0===o?n.shift():function(e,t){for(var r=t,n=r+1,i=e.length;n<i;r+=1,n+=1)e[r]=e[n];e.pop()}(n,o),1===n.length&&(i[e]=n[0]),i.removeListener&&this.emit(\"removeListener\",e,a||r)}return this},i.prototype.removeAllListeners=function(e){var n,i,o;if(!(i=this._events))return this;if(!i.removeListener)return 0===arguments.length?(this._events=t(null),this._eventsCount=0):i[e]&&(0==--this._eventsCount?this._events=t(null):delete i[e]),this;if(0===arguments.length){var s,a=r(i);for(o=0;o<a.length;++o)\"removeListener\"!==(s=a[o])&&this.removeAllListeners(s);return this.removeAllListeners(\"removeListener\"),this._events=t(null),this._eventsCount=0,this}if(\"function\"==typeof(n=i[e]))this.removeListener(e,n);else if(n)for(o=n.length-1;o>=0;o--)this.removeListener(e,n[o]);return this},i.prototype.listeners=function(e){return b(this,e,!0)},i.prototype.rawListeners=function(e){return b(this,e,!1)},i.listenerCount=function(e,t){return\"function\"==typeof e.listenerCount?e.listenerCount(t):m.call(e,t)},i.prototype.listenerCount=m,i.prototype.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]}},645:function(e,t){t.read=function(e,t,r,n,i){var o,s,a=8*i-n-1,u=(1<<a)-1,l=u>>1,c=-7,h=r?i-1:0,f=r?-1:1,p=e[t+h];for(h+=f,o=p&(1<<-c)-1,p>>=-c,c+=a;c>0;o=256*o+e[t+h],h+=f,c-=8);for(s=o&(1<<-c)-1,o>>=-c,c+=n;c>0;s=256*s+e[t+h],h+=f,c-=8);if(0===o)o=1-l;else{if(o===u)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,n),o-=l}return(p?-1:1)*s*Math.pow(2,o-n)},t.write=function(e,t,r,n,i,o){var s,a,u,l=8*o-i-1,c=(1<<l)-1,h=c>>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,d=n?1:-1,y=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=c):(s=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-s))<1&&(s--,u*=2),(t+=s+h>=1?f/u:f*Math.pow(2,1-h))*u>=2&&(s++,u/=2),s+h>=c?(a=0,s=c):s+h>=1?(a=(t*u-1)*Math.pow(2,i),s+=h):(a=t*Math.pow(2,h-1)*Math.pow(2,i),s=0));i>=8;e[r+p]=255&a,p+=d,a/=256,i-=8);for(s=s<<i|a,l+=i;l>0;e[r+p]=255&s,p+=d,s/=256,l-=8);e[r+p-d]|=128*y}},5717:function(e){\"function\"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},9246:function(e,t,r){\"use strict\";r.d(t,{l4:function(){return f}});var n=function(e){var t=\"function\"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&\"number\"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?\"Object is not iterable.\":\"Symbol.iterator is not defined.\")};Object.freeze((function(e){var t=this;void 0===e&&(e=[]);var r=0,i=[];this.size=function(){return r},this.empty=function(){return 0===r},this.clear=function(){r=0,i.length=0},this.front=function(){if(!this.empty())return i[0]},this.back=function(){if(!this.empty())return i[r-1]},this.forEach=function(e){i.forEach(e)},this.getElementByPos=function(e){if(e<0||e>=r)throw new Error(\"pos must more than 0 and less than vector's size\");return i[e]},this.eraseElementByPos=function(e){if(e<0||e>=r)throw new Error(\"pos must more than 0 and less than vector's size\");for(var t=e;t<r-1;++t)i[t]=i[t+1];this.popBack()},this.eraseElementByValue=function(e){var t=[];this.forEach((function(r){r!==e&&t.push(r)})),t.forEach((function(e,t){i[t]=e}));for(var n=t.length;r>n;)this.popBack()},this.pushBack=function(e){i.push(e),++r},this.popBack=function(){i.pop(),r>0&&--r},this.setElementByPos=function(e,t){if(e<0||e>=r)throw new Error(\"pos must more than 0 and less than vector's size\");i[e]=t},this.insert=function(e,t,n){if(void 0===n&&(n=1),e<0||e>r)throw new Error(\"pos must more than 0 and less than or equal to vector's size\");i.splice.apply(i,function(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))}([e,0],function(e,t){var r=\"function\"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s}(new Array(n).fill(t)),!1)),r+=n},this.find=function(e){return i.includes(e)},this.reverse=function(){i.reverse()},this.unique=function(){var e,t=[];this.forEach((function(r,n){0!==n&&r===e||(t.push(r),e=r)})),t.forEach((function(e,t){i[t]=e}));for(var n=t.length;r>n;)this.popBack()},this.sort=function(e){i.sort(e)},this[Symbol.iterator]=function(){return function(){return function(e,t){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},\"function\"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(r)throw new TypeError(\"Generator is already executing.\");for(;s;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}}(this,(function(e){switch(e.label){case 0:return[5,n(i)];case 1:return[2,e.sent()]}}))}()},e.forEach((function(e){return t.pushBack(e)})),Object.freeze(this)})),Object.freeze((function(e){var t=this;void 0===e&&(e=[]);var r=0,n=[];this.size=function(){return r},this.empty=function(){return 0===r},this.clear=function(){r=0,n.length=0},this.push=function(e){n.push(e),++r},this.pop=function(){n.pop(),r>0&&--r},this.top=function(){return n[r-1]},e.forEach((function(e){return t.push(e)})),Object.freeze(this)}));var i=function(e){this.value=void 0,this.pre=void 0,this.next=void 0,this.value=e};function o(e){var t=this;void 0===e&&(e=[]);var r=0,n=void 0,o=void 0;this.size=function(){return r},this.empty=function(){return 0===r},this.clear=function(){n=o=void 0,r=0},this.front=function(){return null==n?void 0:n.value},this.back=function(){return null==o?void 0:o.value},this.forEach=function(e){for(var t=n,r=0;t;){if(void 0===t.value)throw new Error(\"unknown error\");e(t.value,r++),t=t.next}},this.getElementByPos=function(e){if(e<0||e>=r)throw new Error(\"pos must more then 0 and less then the list length\");for(var t=n;e--&&t;)t=t.next;if(!t||void 0===t.value)throw new Error(\"unknown error\");return t.value},this.eraseElementByPos=function(e){if(e<0||e>=r)throw new Error(\"erase pos must more then 0 and less then the list length\");if(0===e)this.popFront();else if(e===r-1)this.popBack();else{for(var t=n;e--;){if(!(null==t?void 0:t.next))throw new Error(\"unknown error\");t=t.next}if(!t||!t.pre||!t.next)throw new Error(\"unknown error\");var i=t.pre,o=t.next;o.pre=i,i.next=o,r>0&&--r}},this.eraseElementByValue=function(e){for(;n&&n.value===e;)this.popFront();for(;o&&o.value===e;)this.popBack();if(n)for(var t=n;t;){if(t.value===e){var i=t.pre,s=t.next;s&&(s.pre=i),i&&(i.next=s),r>0&&--r}t=t.next}},this.pushBack=function(e){if(null==e)throw new Error(\"you can't push null or undefined here\");++r;var t=new i(e);o?(o.next=t,t.pre=o,o=t):n=o=t},this.popBack=function(){o&&(r>0&&--r,o&&(n===o?n=o=void 0:(o=o.pre)&&(o.next=void 0)))},this.setElementByPos=function(e,t){if(null==t)throw new Error(\"you can't set null or undefined here\");if(e<0||e>=r)throw new Error(\"pos must more then 0 and less then the list length\");for(var i=n;e--;){if(!i)throw new Error(\"unknown error\");i=i.next}i&&(i.value=t)},this.insert=function(e,t,o){if(void 0===o&&(o=1),null==t)throw new Error(\"you can't insert null or undefined here\");if(e<0||e>r)throw new Error(\"insert pos must more then 0 and less then or equal to the list length\");if(o<0)throw new Error(\"insert size must more than 0\");if(0===e)for(;o--;)this.pushFront(t);else if(e===r)for(;o--;)this.pushBack(t);else{for(var s=n,a=1;a<e;++a){if(!(null==s?void 0:s.next))throw new Error(\"unknown error\");s=null==s?void 0:s.next}if(!s)throw new Error(\"unknown error\");var u=s.next;for(r+=o;o--;)s.next=new i(t),s.next.pre=s,s=s.next;s.next=u,u&&(u.pre=s)}},this.find=function(e){for(var t=n;t;){if(t.value===e)return!0;t=t.next}return!1},this.reverse=function(){for(var e=n,t=o,i=0;e&&t&&2*i<r;){var s=e.value;e.value=t.value,t.value=s,e=e.next,t=t.pre,++i}},this.unique=function(){for(var e=n;e;){for(var t=e;t&&t.next&&t.value===t.next.value;)t=t.next,r>0&&--r;e.next=t.next,e.next&&(e.next.pre=e),e=e.next}},this.sort=function(e){var t=[];this.forEach((function(e){t.push(e)})),t.sort(e);var r=n;t.forEach((function(e){r&&(r.value=e,r=r.next)}))},this.pushFront=function(e){if(null==e)throw new Error(\"you can't push null or undefined here\");++r;var t=new i(e);n?(t.next=n,n.pre=t,n=t):n=o=t},this.popFront=function(){n&&(r>0&&--r,n&&(n===o?n=o=void 0:(n=n.next)&&(n.pre=void 0)))},this.merge=function(e){var t=this,s=n;e.forEach((function(e){for(;s&&void 0!==s.value&&s.value<=e;)s=s.next;if(void 0===s)t.pushBack(e),s=o;else if(s===n)t.pushFront(e),s=n;else{++r;var a=s.pre;a&&(a.next=new i(e),a.next.pre=a,a.next.next=s,s&&(s.pre=a.next))}}))},this[Symbol.iterator]=function(){return function(){var e;return function(e,t){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},\"function\"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(r)throw new TypeError(\"Generator is already executing.\");for(;s;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}}(this,(function(t){switch(t.label){case 0:e=n,t.label=1;case 1:if(void 0===e)return[3,3];if(!e.value)throw new Error(\"unknown error\");return[4,e.value];case 2:return t.sent(),e=e.next,[3,1];case 3:return[2]}}))}()},e.forEach((function(e){return t.pushBack(e)})),Object.freeze(this)}Object.freeze(o);var s=o;Object.freeze((function(e){void 0===e&&(e=[]);var t=new s(e);this.size=function(){return t.size()},this.empty=function(){return t.empty()},this.clear=function(){t.clear()},this.push=function(e){t.pushBack(e)},this.pop=function(){t.popFront()},this.front=function(){return t.front()},Object.freeze(this)}));function a(e){var t=this;void 0===e&&(e=[]);var r=[],n=0,i=0,o=0,s=0,u=0,l=0;this.size=function(){return l},this.empty=function(){return 0===l},this.clear=function(){n=o=i=s=u=l=0,h.call(this,a.bucketSize),l=0},this.front=function(){return r[n][i]},this.back=function(){return r[o][s]},this.forEach=function(e){if(!this.empty()){var t=0;if(n!==o){for(l=i;l<a.bucketSize;++l)e(r[n][l],t++);for(l=n+1;l<o;++l)for(var u=0;u<a.bucketSize;++u)e(r[l][u],t++);for(l=0;l<=s;++l)e(r[o][l],t++)}else for(var l=i;l<=s;++l)e(r[n][l],t++)}};var c=function(e){var t=n*a.bucketSize+i,r=t+e,u=o*a.bucketSize+s;if(r<t||r>u)throw new Error(\"pos should more than 0 and less than queue's size\");return{curNodeBucketIndex:Math.floor(r/a.bucketSize),curNodePointerIndex:r%a.bucketSize}};this.getElementByPos=function(e){var t=c(e),n=t.curNodeBucketIndex,i=t.curNodePointerIndex;return r[n][i]},this.eraseElementByPos=function(e){var t=this;if(e<0||e>l)throw new Error(\"pos should more than 0 and less than queue's size\");if(0===e)this.popFront();else if(e===this.size())this.popBack();else{for(var r=[],n=e+1;n<l;++n)r.push(this.getElementByPos(n));this.cut(e),this.popBack(),r.forEach((function(e){return t.pushBack(e)}))}},this.eraseElementByValue=function(e){if(!this.empty()){var t=[];this.forEach((function(r){r!==e&&t.push(r)}));for(var r=t.length,n=0;n<r;++n)this.setElementByPos(n,t[n]);this.cut(r-1)}};var h=function(e){for(var t=[],c=e*a.sigma,h=Math.max(Math.ceil(c/a.bucketSize),2),f=0;f<h;++f)t.push(new Array(a.bucketSize));var p=Math.ceil(e/a.bucketSize),d=Math.floor(h/2)-Math.floor(p/2),y=d,g=0;if(this.size())for(f=0;f<p;++f){for(var b=0;b<a.bucketSize;++b)if(t[d+f][b]=this.front(),this.popFront(),this.empty()){y=d+f,g=b;break}if(this.empty())break}r=t,n=d,i=0,o=y,s=g,u=h,l=e};this.pushBack=function(e){this.empty()||(o===u-1&&s===a.bucketSize-1&&h.call(this,this.size()),s<a.bucketSize-1?++s:o<u-1&&(++o,s=0)),++l,r[o][s]=e},this.popBack=function(){this.empty()||(1!==this.size()&&(s>0?--s:n<o&&(--o,s=a.bucketSize-1)),l>0&&--l)},this.setElementByPos=function(e,t){var n=c(e),i=n.curNodeBucketIndex,o=n.curNodePointerIndex;r[i][o]=t},this.insert=function(e,t,r){var n=this;if(void 0===r&&(r=1),0===e)for(;r--;)this.pushFront(t);else if(e===this.size())for(;r--;)this.pushBack(t);else{for(var i=[],o=e;o<l;++o)i.push(this.getElementByPos(o));for(this.cut(e-1),o=0;o<r;++o)this.pushBack(t);i.forEach((function(e){return n.pushBack(e)}))}},this.find=function(e){if(n===o){for(var t=i;t<=s;++t)if(r[n][t]===e)return!0;return!1}for(t=i;t<a.bucketSize;++t)if(r[n][t]===e)return!0;for(t=n+1;t<o;++t)for(var u=0;u<a.bucketSize;++u)if(r[t][u]===e)return!0;for(t=0;t<=s;++t)if(r[o][t]===e)return!0;return!1},this.reverse=function(){for(var e=0,t=l-1;e<t;){var r=this.getElementByPos(e);this.setElementByPos(e,this.getElementByPos(t)),this.setElementByPos(t,r),++e,--t}},this.unique=function(){if(!this.empty()){var e=[],t=this.front();this.forEach((function(r,n){0!==n&&r===t||(e.push(r),t=r)}));for(var r=0;r<l;++r)this.setElementByPos(r,e[r]);this.cut(e.length-1)}},this.sort=function(e){var t=[];this.forEach((function(e){t.push(e)})),t.sort(e);for(var r=0;r<l;++r)this.setElementByPos(r,t[r])},this.pushFront=function(e){this.empty()||(0===n&&0===i&&h.call(this,this.size()),i>0?--i:n>0&&(--n,i=a.bucketSize-1)),++l,r[n][i]=e},this.popFront=function(){this.empty()||(1!==this.size()&&(i<a.bucketSize-1?++i:n<o&&(++n,i=0)),l>0&&--l)},this.shrinkToFit=function(){var e=this,t=[];this.forEach((function(e){t.push(e)}));var n=t.length;r=[];for(var i=Math.ceil(n/a.bucketSize),o=0;o<i;++o)r.push(new Array(a.bucketSize));this.clear(),t.forEach((function(t){return e.pushBack(t)}))},this.cut=function(e){if(e<0)this.clear();else{var t=c(e),r=t.curNodeBucketIndex,n=t.curNodePointerIndex;o=r,s=n,l=e+1}},this[Symbol.iterator]=function(){return function(){var e,t;return function(e,t){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},\"function\"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(r)throw new TypeError(\"Generator is already executing.\");for(;s;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}}(this,(function(u){switch(u.label){case 0:if(0===l)return[2];if(n!==o)return[3,5];t=i,u.label=1;case 1:return t<=s?[4,r[n][t]]:[3,4];case 2:u.sent(),u.label=3;case 3:return++t,[3,1];case 4:return[2];case 5:t=i,u.label=6;case 6:return t<a.bucketSize?[4,r[n][t]]:[3,9];case 7:u.sent(),u.label=8;case 8:return++t,[3,6];case 9:t=n+1,u.label=10;case 10:if(!(t<o))return[3,15];e=0,u.label=11;case 11:return e<a.bucketSize?[4,r[t][e]]:[3,14];case 12:u.sent(),u.label=13;case 13:return++e,[3,11];case 14:return++t,[3,10];case 15:t=0,u.label=16;case 16:return t<=s?[4,r[o][t]]:[3,19];case 17:u.sent(),u.label=18;case 18:return++t,[3,16];case 19:return[2]}}))}()},function(){var i=a.bucketSize;e.size?i=e.size():e.length&&(i=e.length);var s=i*a.sigma;u=Math.ceil(s/a.bucketSize),u=Math.max(u,3);for(var l=0;l<u;++l)r.push(new Array(a.bucketSize));var c=Math.ceil(i/a.bucketSize);n=Math.floor(u/2)-Math.floor(c/2),o=n,e.forEach((function(e){return t.pushBack(e)}))}(),Object.freeze(this)}a.sigma=3,a.bucketSize=5e3,Object.freeze(a),Object.freeze((function(e,t){void 0===e&&(e=[]),t=t||function(e,t){return e>t?-1:e<t?1:0};var r=[];e.forEach((function(e){return r.push(e)}));var n=r.length,i=function(e,t){if(e<0||e>=n)throw new Error(\"unknown error\");if(t<0||t>=n)throw new Error(\"unknown error\");var i=r[e];r[e]=r[t],r[t]=i},o=function(e){if(e<0||e>=n)throw new Error(\"unknown error\");var o=2*e+1,s=2*e+2;o<n&&t(r[e],r[o])>0&&i(e,o),s<n&&t(r[e],r[s])>0&&i(e,s)};!function(){for(var e=Math.floor((n-1)/2);e>=0;--e)for(var o=e,s=2*o+1;s<n;){var a=s+1,u=s;if(a<n&&t(r[s],r[a])>0&&(u=a),t(r[o],r[u])<=0)break;i(o,u),s=2*(o=u)+1}}(),this.size=function(){return n},this.empty=function(){return 0===n},this.clear=function(){n=0,r.length=0},this.push=function(e){if(r.push(e),1!=++n)for(var i=n-1;i>0;){var s=Math.floor((i-1)/2);if(t(r[s],e)<=0)break;o(s),i=s}},this.pop=function(){if(!this.empty())if(1!==this.size()){var e=r[n-1];--n;for(var i=0;i<this.size();){var o=2*i+1,s=2*i+2;if(o>=this.size())break;var a=o;if(s<this.size()&&t(r[o],r[s])>0&&(a=s),t(r[a],e)>=0)break;r[i]=r[a],i=a}r[i]=e}else--n},this.top=function(){return r[0]},Object.freeze(this)}));var u=function(){function e(e,t){this.color=!0,this.key=void 0,this.value=void 0,this.parent=void 0,this.brother=void 0,this.leftChild=void 0,this.rightChild=void 0,this.key=e,this.value=t}return e.prototype.rotateLeft=function(){var e=this.parent,t=this.brother,r=this.leftChild,n=this.rightChild;if(!n)throw new Error(\"unknown error\");var i=n.leftChild,o=n.rightChild;return e&&(e.leftChild===this?e.leftChild=n:e.rightChild===this&&(e.rightChild=n)),n.parent=e,n.brother=t,n.leftChild=this,n.rightChild=o,t&&(t.brother=n),this.parent=n,this.brother=o,this.leftChild=r,this.rightChild=i,o&&(o.parent=n,o.brother=this),r&&(r.parent=this,r.brother=i),i&&(i.parent=this,i.brother=r),n},e.prototype.rotateRight=function(){var e=this.parent,t=this.brother,r=this.leftChild;if(!r)throw new Error(\"unknown error\");var n=this.rightChild,i=r.leftChild,o=r.rightChild;return e&&(e.leftChild===this?e.leftChild=r:e.rightChild===this&&(e.rightChild=r)),r.parent=e,r.brother=t,r.leftChild=i,r.rightChild=this,t&&(t.brother=r),i&&(i.parent=r,i.brother=this),this.parent=r,this.brother=i,this.leftChild=o,this.rightChild=n,o&&(o.parent=this,o.brother=n),n&&(n.parent=this,n.brother=o),r},e.prototype.remove=function(){if(this.leftChild||this.rightChild)throw new Error(\"can only remove leaf node\");this.parent&&(this===this.parent.leftChild?this.parent.leftChild=void 0:this===this.parent.rightChild&&(this.parent.rightChild=void 0)),this.brother&&(this.brother.brother=void 0),this.key=void 0,this.value=void 0,this.parent=void 0,this.brother=void 0},e.TreeNodeColorType={red:!0,black:!1},e}();Object.freeze(u);var l=u,c=function(e){var t=\"function\"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&\"number\"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?\"Object is not iterable.\":\"Symbol.iterator is not defined.\")};function h(e,t){var r=this;void 0===e&&(e=[]),t=t||function(e,t){return e<t?-1:e>t?1:0};var n=0,i=new l;i.color=l.TreeNodeColorType.black,this.size=function(){return n},this.empty=function(){return 0===n},this.clear=function(){n=0,i.key=void 0,i.leftChild=i.rightChild=i.brother=i.parent=void 0,i.color=l.TreeNodeColorType.black};var o=function(e){if(!e||void 0===e.key)throw new Error(\"unknown error\");return e.leftChild?o(e.leftChild):e},s=function(e){if(!e||void 0===e.key)throw new Error(\"unknown error\");return e.rightChild?s(e.rightChild):e};this.front=function(){if(!this.empty())return o(i).key},this.back=function(){if(!this.empty())return s(i).key},this.forEach=function(e){var t,r,n=0;try{for(var i=c(this),o=i.next();!o.done;o=i.next())e(o.value,n++)}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}},this.getElementByPos=function(e){var t,r;if(e<0||e>=this.size())throw new Error(\"pos must more than 0 and less than set's size\");var n=0;try{for(var i=c(this),o=i.next();!o.done;o=i.next()){var s=o.value;if(n===e)return s;++n}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}throw new Error(\"unknown error\")};var a=function(e){var t=e.parent;if(!t){if(e===i)return;throw new Error(\"unknown error\")}if(e.color!==l.TreeNodeColorType.red){var r=e.brother;if(!r)throw new Error(\"unknown error\");if(e===t.leftChild)if(r.color===l.TreeNodeColorType.red){r.color=l.TreeNodeColorType.black,t.color=l.TreeNodeColorType.red;var n=t.rotateLeft();i===t&&(i=n),a(e)}else r.color===l.TreeNodeColorType.black&&(r.rightChild&&r.rightChild.color===l.TreeNodeColorType.red?(r.color=t.color,t.color=l.TreeNodeColorType.black,r.rightChild&&(r.rightChild.color=l.TreeNodeColorType.black),n=t.rotateLeft(),i===t&&(i=n),e.color=l.TreeNodeColorType.black):r.rightChild&&r.rightChild.color!==l.TreeNodeColorType.black||!r.leftChild||r.leftChild.color!==l.TreeNodeColorType.red?r.leftChild&&r.leftChild.color!==l.TreeNodeColorType.black||r.rightChild&&r.rightChild.color!==l.TreeNodeColorType.black||(r.color=l.TreeNodeColorType.red,a(t)):(r.color=l.TreeNodeColorType.red,r.leftChild&&(r.leftChild.color=l.TreeNodeColorType.black),n=r.rotateRight(),i===r&&(i=n),a(e)));else e===t.rightChild&&(r.color===l.TreeNodeColorType.red?(r.color=l.TreeNodeColorType.black,t.color=l.TreeNodeColorType.red,n=t.rotateRight(),i===t&&(i=n),a(e)):r.color===l.TreeNodeColorType.black&&(r.leftChild&&r.leftChild.color===l.TreeNodeColorType.red?(r.color=t.color,t.color=l.TreeNodeColorType.black,r.leftChild&&(r.leftChild.color=l.TreeNodeColorType.black),n=t.rotateRight(),i===t&&(i=n),e.color=l.TreeNodeColorType.black):r.leftChild&&r.leftChild.color!==l.TreeNodeColorType.black||!r.rightChild||r.rightChild.color!==l.TreeNodeColorType.red?r.leftChild&&r.leftChild.color!==l.TreeNodeColorType.black||r.rightChild&&r.rightChild.color!==l.TreeNodeColorType.black||(r.color=l.TreeNodeColorType.red,a(t)):(r.color=l.TreeNodeColorType.red,r.rightChild&&(r.rightChild.color=l.TreeNodeColorType.black),n=r.rotateLeft(),i===r&&(i=n),a(e))))}else e.color=l.TreeNodeColorType.black},u=function(e){for(var t=e;t.leftChild||t.rightChild;){if(t.rightChild){t=o(t.rightChild);var r=e.key;e.key=t.key,t.key=r,e=t}t.leftChild&&(t=s(t.leftChild),r=e.key,e.key=t.key,t.key=r,e=t)}a(t),t&&t.remove(),--n,i.color=l.TreeNodeColorType.black},h=function(e,t){return!(!e||void 0===e.key)&&(!!h(e.leftChild,t)||!!t(e)||h(e.rightChild,t))};this.eraseElementByPos=function(e){if(e<0||e>=n)throw new Error(\"pos must more than 0 and less than set's size\");var t=0;h(i,(function(r){return e===t?(u(r),!0):(++t,!1)}))},this.eraseElementByValue=function(e){if(!this.empty()){var r=d(i,e);void 0!==r&&void 0!==r.key&&0===t(r.key,e)&&u(r)}};var f=function(e,r){if(!e||void 0===e.key)throw new Error(\"unknown error\");var n=t(r,e.key);return n<0?e.leftChild?f(e.leftChild,r):(e.leftChild=new l,e.leftChild.parent=e,e.leftChild.brother=e.rightChild,e.rightChild&&(e.rightChild.brother=e.leftChild),e.leftChild):n>0?e.rightChild?f(e.rightChild,r):(e.rightChild=new l,e.rightChild.parent=e,e.rightChild.brother=e.leftChild,e.leftChild&&(e.leftChild.brother=e.rightChild),e.rightChild):e},p=function(e){var t=e.parent;if(!t){if(e===i)return;throw new Error(\"unknown error\")}if(t.color!==l.TreeNodeColorType.black&&t.color===l.TreeNodeColorType.red){var r=t.brother,n=t.parent;if(!n)throw new Error(\"unknown error\");if(r&&r.color===l.TreeNodeColorType.red)r.color=t.color=l.TreeNodeColorType.black,n.color=l.TreeNodeColorType.red,p(n);else if(!r||r.color===l.TreeNodeColorType.black)if(t===n.leftChild)if(e===t.leftChild){t.color=l.TreeNodeColorType.black,n.color=l.TreeNodeColorType.red;var o=n.rotateRight();n===i&&(i=o)}else e===t.rightChild&&(o=t.rotateLeft(),n===i&&(i=o),p(t));else t===n.rightChild&&(e===t.leftChild?(o=t.rotateRight(),n===i&&(i=o),p(t)):e===t.rightChild&&(t.color=l.TreeNodeColorType.black,n.color=l.TreeNodeColorType.red,o=n.rotateLeft(),n===i&&(i=o)))}};this.insert=function(e){if(null==e)throw new Error(\"to avoid some unnecessary errors, we don't suggest you insert null or undefined here\");if(this.empty())return++n,i.key=e,void(i.color=l.TreeNodeColorType.black);var r=f(i,e);void 0!==r.key&&0===t(r.key,e)||(++n,r.key=e,p(r),i.color=l.TreeNodeColorType.black)};var d=function(e,r){if(e&&void 0!==e.key){var n=t(r,e.key);return n<0?d(e.leftChild,r):n>0?d(e.rightChild,r):e}};this.find=function(e){var r=d(i,e);return void 0!==r&&void 0!==r.key&&0===t(r.key,e)};var y=function(e,r){if(e&&void 0!==e.key){var n=t(e.key,r);if(0===n)return e.key;if(n<0)return y(e.rightChild,r);var i=y(e.leftChild,r);return void 0!==i?i:e.key}};this.lowerBound=function(e){return y(i,e)};var g=function(e,r){if(e&&void 0!==e.key){if(t(e.key,r)<=0)return g(e.rightChild,r);var n=g(e.leftChild,r);return void 0!==n?n:e.key}};this.upperBound=function(e){return g(i,e)};var b=function(e,r){if(e&&void 0!==e.key){var n=t(e.key,r);if(0===n)return e.key;if(n>0)return b(e.leftChild,r);var i=b(e.rightChild,r);return void 0!==i?i:e.key}};this.reverseLowerBound=function(e){return b(i,e)};var m=function(e,r){if(e&&void 0!==e.key){if(t(e.key,r)>=0)return m(e.leftChild,r);var n=m(e.rightChild,r);return void 0!==n?n:e.key}};this.reverseUpperBound=function(e){return m(i,e)},this.union=function(e){var t=this;e.forEach((function(e){return t.insert(e)}))},this.getHeight=function(){if(this.empty())return 0;var e=function(t){return t?Math.max(e(t.leftChild),e(t.rightChild))+1:1};return e(i)};var v=function(e){return function(e,t){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},\"function\"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(r)throw new TypeError(\"Generator is already executing.\");for(;s;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}}(this,(function(t){switch(t.label){case 0:return e&&void 0!==e.key?[5,c(v(e.leftChild))]:[2];case 1:return t.sent(),[4,e.key];case 2:return t.sent(),[5,c(v(e.rightChild))];case 3:return t.sent(),[2]}}))};this[Symbol.iterator]=function(){return v(i)},e.forEach((function(e){return r.insert(e)})),Object.freeze(this)}Object.freeze(h);var f=h,p=function(e){var t=\"function\"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&\"number\"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?\"Object is not iterable.\":\"Symbol.iterator is not defined.\")};function d(e,t){var r=this;void 0===e&&(e=[]),t=t||function(e,t){return e<t?-1:e>t?1:0};var n=0,i=new l;i.color=l.TreeNodeColorType.black,this.size=function(){return n},this.empty=function(){return 0===n},this.clear=function(){n=0,i.key=i.value=void 0,i.leftChild=i.rightChild=i.brother=void 0};var o=function(e){if(!e||void 0===e.key)throw new Error(\"unknown error\");return e.leftChild?o(e.leftChild):e},s=function(e){if(!e||void 0===e.key)throw new Error(\"unknown error\");return e.rightChild?s(e.rightChild):e};this.front=function(){if(!this.empty()){var e=o(i);if(void 0===e.key||void 0===e.value)throw new Error(\"unknown error\");return{key:e.key,value:e.value}}},this.back=function(){if(!this.empty()){var e=s(i);if(void 0===e.key||void 0===e.value)throw new Error(\"unknown error\");return{key:e.key,value:e.value}}},this.forEach=function(e){var t,r,n=0;try{for(var i=p(this),o=i.next();!o.done;o=i.next())e(o.value,n++)}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}},this.getElementByPos=function(e){var t,r;if(e<0||e>=this.size())throw new Error(\"pos must more than 0 and less than set's size\");var n=0;try{for(var i=p(this),o=i.next();!o.done;o=i.next()){var s=o.value;if(n===e)return s;++n}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}throw new Error(\"unknown Error\")};var a=function(e,r){if(e&&void 0!==e.key&&void 0!==e.value){var n=t(e.key,r);return 0===n?{key:e.key,value:e.value}:n<0?a(e.rightChild,r):a(e.leftChild,r)||{key:e.key,value:e.value}}};this.lowerBound=function(e){return a(i,e)};var u=function(e,r){if(e&&void 0!==e.key&&void 0!==e.value)return t(e.key,r)<=0?u(e.rightChild,r):u(e.leftChild,r)||{key:e.key,value:e.value}};this.upperBound=function(e){return u(i,e)};var c=function(e,r){if(e&&void 0!==e.key&&void 0!==e.value){var n=t(e.key,r);return 0===n?{key:e.key,value:e.value}:n>0?c(e.leftChild,r):c(e.rightChild,r)||{key:e.key,value:e.value}}};this.reverseLowerBound=function(e){return c(i,e)};var h=function(e,r){if(e&&void 0!==e.key&&void 0!==e.value)return t(e.key,r)>=0?h(e.leftChild,r):h(e.rightChild,r)||{key:e.key,value:e.value}};this.reverseUpperBound=function(e){return h(i,e)};var f=function(e){var t=e.parent;if(!t){if(e===i)return;throw new Error(\"unknown error\")}if(e.color!==l.TreeNodeColorType.red){var r=e.brother;if(!r)throw new Error(\"unknown error\");if(e===t.leftChild)if(r.color===l.TreeNodeColorType.red){r.color=l.TreeNodeColorType.black,t.color=l.TreeNodeColorType.red;var n=t.rotateLeft();i===t&&(i=n),f(e)}else r.color===l.TreeNodeColorType.black&&(r.rightChild&&r.rightChild.color===l.TreeNodeColorType.red?(r.color=t.color,t.color=l.TreeNodeColorType.black,r.rightChild&&(r.rightChild.color=l.TreeNodeColorType.black),n=t.rotateLeft(),i===t&&(i=n),e.color=l.TreeNodeColorType.black):r.rightChild&&r.rightChild.color!==l.TreeNodeColorType.black||!r.leftChild||r.leftChild.color!==l.TreeNodeColorType.red?r.leftChild&&r.leftChild.color!==l.TreeNodeColorType.black||r.rightChild&&r.rightChild.color!==l.TreeNodeColorType.black||(r.color=l.TreeNodeColorType.red,f(t)):(r.color=l.TreeNodeColorType.red,r.leftChild&&(r.leftChild.color=l.TreeNodeColorType.black),n=r.rotateRight(),i===r&&(i=n),f(e)));else e===t.rightChild&&(r.color===l.TreeNodeColorType.red?(r.color=l.TreeNodeColorType.black,t.color=l.TreeNodeColorType.red,n=t.rotateRight(),i===t&&(i=n),f(e)):r.color===l.TreeNodeColorType.black&&(r.leftChild&&r.leftChild.color===l.TreeNodeColorType.red?(r.color=t.color,t.color=l.TreeNodeColorType.black,r.leftChild&&(r.leftChild.color=l.TreeNodeColorType.black),n=t.rotateRight(),i===t&&(i=n),e.color=l.TreeNodeColorType.black):r.leftChild&&r.leftChild.color!==l.TreeNodeColorType.black||!r.rightChild||r.rightChild.color!==l.TreeNodeColorType.red?r.leftChild&&r.leftChild.color!==l.TreeNodeColorType.black||r.rightChild&&r.rightChild.color!==l.TreeNodeColorType.black||(r.color=l.TreeNodeColorType.red,f(t)):(r.color=l.TreeNodeColorType.red,r.rightChild&&(r.rightChild.color=l.TreeNodeColorType.black),n=r.rotateLeft(),i===r&&(i=n),f(e))))}else e.color=l.TreeNodeColorType.black},d=function(e){for(var t=e;t.leftChild||t.rightChild;){if(t.rightChild){t=o(t.rightChild);var r=e.key;e.key=t.key,t.key=r;var a=e.value;e.value=t.value,t.value=a,e=t}t.leftChild&&(t=s(t.leftChild),r=e.key,e.key=t.key,t.key=r,a=e.value,e.value=t.value,t.value=a,e=t)}f(t),t&&t.remove(),--n,i.color=l.TreeNodeColorType.black},y=function(e,t){return!(!e||void 0===e.key)&&(!!y(e.leftChild,t)||!!t(e)||y(e.rightChild,t))};this.eraseElementByPos=function(e){if(e<0||e>=n)throw new Error(\"pos must more than 0 and less than set's size\");var t=0;y(i,(function(r){return e===t?(d(r),!0):(++t,!1)}))},this.eraseElementByKey=function(e){if(!this.empty()){var r=m(i,e);void 0!==r&&void 0!==r.key&&0===t(r.key,e)&&d(r)}};var g=function(e,r){if(!e||void 0===e.key)throw new Error(\"unknown error\");var n=t(r,e.key);return n<0?e.leftChild?g(e.leftChild,r):(e.leftChild=new l,e.leftChild.parent=e,e.leftChild.brother=e.rightChild,e.rightChild&&(e.rightChild.brother=e.leftChild),e.leftChild):n>0?e.rightChild?g(e.rightChild,r):(e.rightChild=new l,e.rightChild.parent=e,e.rightChild.brother=e.leftChild,e.leftChild&&(e.leftChild.brother=e.rightChild),e.rightChild):e},b=function(e){var t=e.parent;if(!t){if(e===i)return;throw new Error(\"unknown error\")}if(t.color!==l.TreeNodeColorType.black&&t.color===l.TreeNodeColorType.red){var r=t.brother,n=t.parent;if(!n)throw new Error(\"unknown error\");if(r&&r.color===l.TreeNodeColorType.red)r.color=t.color=l.TreeNodeColorType.black,n.color=l.TreeNodeColorType.red,b(n);else if(!r||r.color===l.TreeNodeColorType.black)if(t===n.leftChild)if(e===t.leftChild){t.color=l.TreeNodeColorType.black,n.color=l.TreeNodeColorType.red;var o=n.rotateRight();n===i&&(i=o)}else e===t.rightChild&&(o=t.rotateLeft(),n===i&&(i=o),b(t));else t===n.rightChild&&(e===t.leftChild?(o=t.rotateRight(),n===i&&(i=o),b(t)):e===t.rightChild&&(t.color=l.TreeNodeColorType.black,n.color=l.TreeNodeColorType.red,o=n.rotateLeft(),n===i&&(i=o)))}};this.setElement=function(e,r){if(null==e)throw new Error(\"to avoid some unnecessary errors, we don't suggest you insert null or undefined here\");if(null!=r){if(this.empty())return++n,i.key=e,i.value=r,void(i.color=l.TreeNodeColorType.black);var o=g(i,e);void 0===o.key||0!==t(o.key,e)?(++n,o.key=e,o.value=r,b(o),i.color=l.TreeNodeColorType.black):o.value=r}else this.eraseElementByKey(e)};var m=function(e,r){if(e&&void 0!==e.key){var n=t(r,e.key);return n<0?m(e.leftChild,r):n>0?m(e.rightChild,r):e}};this.find=function(e){return!!m(i,e)},this.getElementByKey=function(e){var t=m(i,e);if(void 0===(null==t?void 0:t.key)||void 0===(null==t?void 0:t.value))throw new Error(\"unknown error\");return t.value},this.union=function(e){var t=this;e.forEach((function(e){var r=e.key,n=e.value;return t.setElement(r,n)}))},this.getHeight=function(){if(this.empty())return 0;var e=function(t){return t?Math.max(e(t.leftChild),e(t.rightChild))+1:1};return e(i)};var v=function(e){return function(e,t){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},\"function\"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(r)throw new TypeError(\"Generator is already executing.\");for(;s;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}}(this,(function(t){switch(t.label){case 0:return e&&void 0!==e.key&&void 0!==e.value?[5,p(v(e.leftChild))]:[2];case 1:return t.sent(),[4,{key:e.key,value:e.value}];case 2:return t.sent(),[5,p(v(e.rightChild))];case 3:return t.sent(),[2]}}))};this[Symbol.iterator]=function(){return v(i)},e.forEach((function(e){var t=e.key,n=e.value;return r.setElement(t,n)})),Object.freeze(this)}Object.freeze(d);var y=d;function g(e,t,r){var n=this;if(void 0===e&&(e=[]),void 0===t&&(t=g.initSize),r=r||function(e){var t=0,r=\"\";if(\"number\"==typeof e)t=((t=Math.floor(e))<<5)-t,t&=t;else{r=\"string\"!=typeof e?JSON.stringify(e):e;for(var n=0;n<r.length;n++)t=(t<<5)-t+r.charCodeAt(n),t&=t}return t^t>>>16},0!=(t&t-1))throw new Error(\"initBucketNum must be 2 to the power of n\");var i=0,o=[],a=Math.max(g.initSize,Math.min(g.maxSize,t));this.size=function(){return i},this.empty=function(){return 0===i},this.clear=function(){i=0,a=t,o=[]},this.forEach=function(e){var t=0;o.forEach((function(r){r.forEach((function(r){e(r,t++)}))}))};var u=function(e){if(!(e>=g.maxSize)){a=2*e;var t=[];o.forEach((function(n,i){if(!n.empty()){if(n instanceof s&&1===n.size()){var u=n.front();if(void 0===u)throw new Error(\"unknown error\");t[r(u)&a-1]=new s([u])}else if(n instanceof f){var l=new s,c=new s;n.forEach((function(t){0==(r(t)&e)?l.pushBack(t):c.pushBack(t)})),l.size()>g.untreeifyThreshold?t[i]=new f(l):l.size()&&(t[i]=l),c.size()>g.untreeifyThreshold?t[i+e]=new f(c):c.size()&&(t[i+e]=c)}else{var h=new s,p=new s;n.forEach((function(t){0==(r(t)&e)?h.pushBack(t):p.pushBack(t)})),h.size()&&(t[i]=h),p.size()&&(t[i+e]=p)}o[i].clear()}})),o=t}};this.insert=function(e){if(null==e)throw new Error(\"to avoid some unnecessary errors, we don't suggest you insert null or undefined here\");var t=r(e)&a-1;if(o[t]){var n=o[t].size();if(o[t]instanceof s){if(o[t].find(e))return;o[t].pushBack(e),o[t].size()>=g.treeifyThreshold&&(o[t]=new f(o[t]))}else o[t].insert(e);var l=o[t].size();i+=l-n}else o[t]=new s([e]),++i;i>a*g.sigma&&u.call(this,a)},this.eraseElementByValue=function(e){var t=r(e)&a-1;if(o[t]){var n=o[t].size();o[t].eraseElementByValue(e),o[t]instanceof f&&o[t].size()<=g.untreeifyThreshold&&(o[t]=new s(o[t]));var u=o[t].size();i+=u-n}},this.find=function(e){var t=r(e)&a-1;return!!o[t]&&o[t].find(e)},this[Symbol.iterator]=function(){return function(){var e,t,r,n,i,s;return function(e,t){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},\"function\"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(r)throw new TypeError(\"Generator is already executing.\");for(;s;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}}(this,(function(u){switch(u.label){case 0:e=0,u.label=1;case 1:if(!(e<a))return[3,10];for(;e<a&&!o[e];)++e;if(e>=a)return[3,10];u.label=2;case 2:u.trys.push([2,7,8,9]),i=void 0,t=function(e){var t=\"function\"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&\"number\"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?\"Object is not iterable.\":\"Symbol.iterator is not defined.\")}(o[e]),r=t.next(),u.label=3;case 3:return r.done?[3,6]:[4,r.value];case 4:u.sent(),u.label=5;case 5:return r=t.next(),[3,3];case 6:return[3,9];case 7:return n=u.sent(),i={error:n},[3,9];case 8:try{r&&!r.done&&(s=t.return)&&s.call(t)}finally{if(i)throw i.error}return[7];case 9:return++e,[3,1];case 10:return[2]}}))}()},e.forEach((function(e){return n.insert(e)})),Object.freeze(this)}g.initSize=16,g.maxSize=1<<30,g.sigma=.75,g.treeifyThreshold=8,g.untreeifyThreshold=6,g.minTreeifySize=64,Object.freeze(g);var b=function(e){var t=\"function\"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&\"number\"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?\"Object is not iterable.\":\"Symbol.iterator is not defined.\")};function m(e,t,r){var n=this;if(void 0===e&&(e=[]),void 0===t&&(t=m.initSize),r=r||function(e){var t,r,n=0,i=\"\";if(\"number\"==typeof e)n=((n=Math.floor(e))<<5)-n,n&=n;else{i=\"string\"!=typeof e?JSON.stringify(e):e;try{for(var o=b(i),s=o.next();!s.done;s=o.next())n=(n<<5)-n+s.value.charCodeAt(0),n&=n}catch(e){t={error:e}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}}return n^n>>>16},0!=(t&t-1))throw new Error(\"initBucketNum must be 2 to the power of n\");var i=0,o=[],a=Math.max(m.initSize,Math.min(m.maxSize,t));this.size=function(){return i},this.empty=function(){return 0===i},this.clear=function(){i=0,a=t,o=[]},this.forEach=function(e){var t=0;o.forEach((function(r){r.forEach((function(r){e(r,t++)}))}))};var u=function(e){if(!(e>=m.maxSize)){a=2*e;var t=[];o.forEach((function(n,i){if(!n.empty()){if(n instanceof s&&1===n.size()){var u=n.front(),l=u.key,c=u.value;t[r(l)&a-1]=new s([{key:l,value:c}])}else if(n instanceof y){var h=new s,f=new s;n.forEach((function(t){0==(r(t.key)&e)?h.pushBack(t):f.pushBack(t)})),h.size()>m.untreeifyThreshold?t[i]=new y(h):h.size()&&(t[i]=h),f.size()>m.untreeifyThreshold?t[i+e]=new y(f):f.size()&&(t[i+e]=f)}else{var p=new s,d=new s;n.forEach((function(t){0==(r(t.key)&e)?p.pushBack(t):d.pushBack(t)})),p.size()&&(t[i]=p),d.size()&&(t[i+e]=d)}o[i].clear()}})),o=t}};this.setElement=function(e,t){var n,l;if(null==e)throw new Error(\"to avoid some unnecessary errors, we don't suggest you insert null or undefined here\");if(null!=t){var c=r(e)&a-1;if(o[c]){var h=o[c].size();if(o[c]instanceof s){try{for(var f=b(o[c]),p=f.next();!p.done;p=f.next()){var d=p.value;if(d.key===e)return void(d.value=t)}}catch(e){n={error:e}}finally{try{p&&!p.done&&(l=f.return)&&l.call(f)}finally{if(n)throw n.error}}o[c].pushBack({key:e,value:t}),o[c].size()>=m.treeifyThreshold&&(o[c]=new y(o[c]))}else o[c].setElement(e,t);var g=o[c].size();i+=g-h}else++i,o[c]=new s([{key:e,value:t}]);i>a*m.sigma&&u.call(this,a)}else this.eraseElementByKey(e)},this.getElementByKey=function(e){var t,n,i=r(e)&a-1;if(o[i]){if(o[i]instanceof y)return o[i].getElementByKey(e);try{for(var s=b(o[i]),u=s.next();!u.done;u=s.next()){var l=u.value;if(l.key===e)return l.value}}catch(e){t={error:e}}finally{try{u&&!u.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}}},this.eraseElementByKey=function(e){var t,n,u=r(e)&a-1;if(o[u]){var l=o[u].size();if(o[u]instanceof y)o[u].eraseElementByKey(e),o[u].size()<=m.untreeifyThreshold&&(o[u]=new s(o[u]));else{var c=-1;try{for(var h=b(o[u]),f=h.next();!f.done;f=h.next()){var p=f.value;if(++c,p.key===e){o[u].eraseElementByPos(c);break}}}catch(e){t={error:e}}finally{try{f&&!f.done&&(n=h.return)&&n.call(h)}finally{if(t)throw t.error}}}var d=o[u].size();i+=d-l}},this.find=function(e){var t,n,i=r(e)&a-1;if(!o[i])return!1;if(o[i]instanceof y)return o[i].find(e);try{for(var s=b(o[i]),u=s.next();!u.done;u=s.next())if(u.value.key===e)return!0}catch(e){t={error:e}}finally{try{u&&!u.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}return!1},this[Symbol.iterator]=function(){return function(){var e,t,r,n,i,s;return function(e,t){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},\"function\"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(r)throw new TypeError(\"Generator is already executing.\");for(;s;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}}(this,(function(u){switch(u.label){case 0:e=0,u.label=1;case 1:if(!(e<a))return[3,10];for(;e<a&&!o[e];)++e;if(e>=a)return[3,10];u.label=2;case 2:u.trys.push([2,7,8,9]),i=void 0,t=b(o[e]),r=t.next(),u.label=3;case 3:return r.done?[3,6]:[4,r.value];case 4:u.sent(),u.label=5;case 5:return r=t.next(),[3,3];case 6:return[3,9];case 7:return n=u.sent(),i={error:n},[3,9];case 8:try{r&&!r.done&&(s=t.return)&&s.call(t)}finally{if(i)throw i.error}return[7];case 9:return++e,[3,1];case 10:return[2]}}))}()},e.forEach((function(e){var t=e.key,r=e.value;return n.setElement(t,r)})),Object.freeze(this)}m.initSize=16,m.maxSize=1<<30,m.sigma=.75,m.treeifyThreshold=8,m.untreeifyThreshold=6,m.minTreeifySize=64,Object.freeze(m)},9593:function(e,t,r){\"use strict\";const n=r(4411),i=Symbol(\"max\"),o=Symbol(\"length\"),s=Symbol(\"lengthCalculator\"),a=Symbol(\"allowStale\"),u=Symbol(\"maxAge\"),l=Symbol(\"dispose\"),c=Symbol(\"noDisposeOnSet\"),h=Symbol(\"lruList\"),f=Symbol(\"cache\"),p=Symbol(\"updateAgeOnGet\"),d=()=>1,y=(e,t,r)=>{const n=e[f].get(t);if(n){const t=n.value;if(g(e,t)){if(m(e,n),!e[a])return}else r&&(e[p]&&(n.value.now=Date.now()),e[h].unshiftNode(n));return t.value}},g=(e,t)=>{if(!t||!t.maxAge&&!e[u])return!1;const r=Date.now()-t.now;return t.maxAge?r>t.maxAge:e[u]&&r>e[u]},b=e=>{if(e[o]>e[i])for(let t=e[h].tail;e[o]>e[i]&&null!==t;){const r=t.prev;m(e,t),t=r}},m=(e,t)=>{if(t){const r=t.value;e[l]&&e[l](r.key,r.value),e[o]-=r.length,e[f].delete(r.key),e[h].removeNode(t)}};class v{constructor(e,t,r,n,i){this.key=e,this.value=t,this.length=r,this.now=n,this.maxAge=i||0}}const w=(e,t,r,n)=>{let i=r.value;g(e,i)&&(m(e,r),e[a]||(i=void 0)),i&&t.call(n,i.value,i.key,e)};e.exports=class{constructor(e){if(\"number\"==typeof e&&(e={max:e}),e||(e={}),e.max&&(\"number\"!=typeof e.max||e.max<0))throw new TypeError(\"max must be a non-negative number\");this[i]=e.max||1/0;const t=e.length||d;if(this[s]=\"function\"!=typeof t?d:t,this[a]=e.stale||!1,e.maxAge&&\"number\"!=typeof e.maxAge)throw new TypeError(\"maxAge must be a number\");this[u]=e.maxAge||0,this[l]=e.dispose,this[c]=e.noDisposeOnSet||!1,this[p]=e.updateAgeOnGet||!1,this.reset()}set max(e){if(\"number\"!=typeof e||e<0)throw new TypeError(\"max must be a non-negative number\");this[i]=e||1/0,b(this)}get max(){return this[i]}set allowStale(e){this[a]=!!e}get allowStale(){return this[a]}set maxAge(e){if(\"number\"!=typeof e)throw new TypeError(\"maxAge must be a non-negative number\");this[u]=e,b(this)}get maxAge(){return this[u]}set lengthCalculator(e){\"function\"!=typeof e&&(e=d),e!==this[s]&&(this[s]=e,this[o]=0,this[h].forEach((e=>{e.length=this[s](e.value,e.key),this[o]+=e.length}))),b(this)}get lengthCalculator(){return this[s]}get length(){return this[o]}get itemCount(){return this[h].length}rforEach(e,t){t=t||this;for(let r=this[h].tail;null!==r;){const n=r.prev;w(this,e,r,t),r=n}}forEach(e,t){t=t||this;for(let r=this[h].head;null!==r;){const n=r.next;w(this,e,r,t),r=n}}keys(){return this[h].toArray().map((e=>e.key))}values(){return this[h].toArray().map((e=>e.value))}reset(){this[l]&&this[h]&&this[h].length&&this[h].forEach((e=>this[l](e.key,e.value))),this[f]=new Map,this[h]=new n,this[o]=0}dump(){return this[h].map((e=>!g(this,e)&&{k:e.key,v:e.value,e:e.now+(e.maxAge||0)})).toArray().filter((e=>e))}dumpLru(){return this[h]}set(e,t,r){if((r=r||this[u])&&\"number\"!=typeof r)throw new TypeError(\"maxAge must be a number\");const n=r?Date.now():0,a=this[s](t,e);if(this[f].has(e)){if(a>this[i])return m(this,this[f].get(e)),!1;const s=this[f].get(e).value;return this[l]&&(this[c]||this[l](e,s.value)),s.now=n,s.maxAge=r,s.value=t,this[o]+=a-s.length,s.length=a,this.get(e),b(this),!0}const p=new v(e,t,a,n,r);return p.length>this[i]?(this[l]&&this[l](e,t),!1):(this[o]+=p.length,this[h].unshift(p),this[f].set(e,this[h].head),b(this),!0)}has(e){if(!this[f].has(e))return!1;const t=this[f].get(e).value;return!g(this,t)}get(e){return y(this,e,!0)}peek(e){return y(this,e,!1)}pop(){const e=this[h].tail;return e?(m(this,e),e.value):null}del(e){m(this,this[f].get(e))}load(e){this.reset();const t=Date.now();for(let r=e.length-1;r>=0;r--){const n=e[r],i=n.e||0;if(0===i)this.set(n.k,n.v);else{const e=i-t;e>0&&this.set(n.k,n.v,e)}}}prune(){this[f].forEach(((e,t)=>y(this,t,!1)))}}},9990:function(e,t,r){var n=r(8764).Buffer;const i=e.exports;i.types={0:\"reserved\",1:\"connect\",2:\"connack\",3:\"publish\",4:\"puback\",5:\"pubrec\",6:\"pubrel\",7:\"pubcomp\",8:\"subscribe\",9:\"suback\",10:\"unsubscribe\",11:\"unsuback\",12:\"pingreq\",13:\"pingresp\",14:\"disconnect\",15:\"auth\"},i.codes={};for(const e in i.types){const t=i.types[e];i.codes[t]=e}i.CMD_SHIFT=4,i.CMD_MASK=240,i.DUP_MASK=8,i.QOS_MASK=3,i.QOS_SHIFT=1,i.RETAIN_MASK=1,i.VARBYTEINT_MASK=127,i.VARBYTEINT_FIN_MASK=128,i.VARBYTEINT_MAX=268435455,i.SESSIONPRESENT_MASK=1,i.SESSIONPRESENT_HEADER=n.from([i.SESSIONPRESENT_MASK]),i.CONNACK_HEADER=n.from([i.codes.connack<<i.CMD_SHIFT]),i.USERNAME_MASK=128,i.PASSWORD_MASK=64,i.WILL_RETAIN_MASK=32,i.WILL_QOS_MASK=24,i.WILL_QOS_SHIFT=3,i.WILL_FLAG_MASK=4,i.CLEAN_SESSION_MASK=2,i.CONNECT_HEADER=n.from([i.codes.connect<<i.CMD_SHIFT]),i.properties={sessionExpiryInterval:17,willDelayInterval:24,receiveMaximum:33,maximumPacketSize:39,topicAliasMaximum:34,requestResponseInformation:25,requestProblemInformation:23,userProperties:38,authenticationMethod:21,authenticationData:22,payloadFormatIndicator:1,messageExpiryInterval:2,contentType:3,responseTopic:8,correlationData:9,maximumQoS:36,retainAvailable:37,assignedClientIdentifier:18,reasonString:31,wildcardSubscriptionAvailable:40,subscriptionIdentifiersAvailable:41,sharedSubscriptionAvailable:42,serverKeepAlive:19,responseInformation:26,serverReference:28,topicAlias:35,subscriptionIdentifier:11},i.propertiesCodes={};for(const e in i.properties){const t=i.properties[e];i.propertiesCodes[t]=e}function o(e){return[0,1,2].map((t=>[0,1].map((r=>[0,1].map((o=>{const s=n.alloc(1);return s.writeUInt8(i.codes[e]<<i.CMD_SHIFT|(r?i.DUP_MASK:0)|t<<i.QOS_SHIFT|o,0,!0),s}))))))}i.propertiesTypes={sessionExpiryInterval:\"int32\",willDelayInterval:\"int32\",receiveMaximum:\"int16\",maximumPacketSize:\"int32\",topicAliasMaximum:\"int16\",requestResponseInformation:\"byte\",requestProblemInformation:\"byte\",userProperties:\"pair\",authenticationMethod:\"string\",authenticationData:\"binary\",payloadFormatIndicator:\"byte\",messageExpiryInterval:\"int32\",contentType:\"string\",responseTopic:\"string\",correlationData:\"binary\",maximumQoS:\"int8\",retainAvailable:\"byte\",assignedClientIdentifier:\"string\",reasonString:\"string\",wildcardSubscriptionAvailable:\"byte\",subscriptionIdentifiersAvailable:\"byte\",sharedSubscriptionAvailable:\"byte\",serverKeepAlive:\"int16\",responseInformation:\"string\",serverReference:\"string\",topicAlias:\"int16\",subscriptionIdentifier:\"var\"},i.PUBLISH_HEADER=o(\"publish\"),i.SUBSCRIBE_HEADER=o(\"subscribe\"),i.SUBSCRIBE_OPTIONS_QOS_MASK=3,i.SUBSCRIBE_OPTIONS_NL_MASK=1,i.SUBSCRIBE_OPTIONS_NL_SHIFT=2,i.SUBSCRIBE_OPTIONS_RAP_MASK=1,i.SUBSCRIBE_OPTIONS_RAP_SHIFT=3,i.SUBSCRIBE_OPTIONS_RH_MASK=3,i.SUBSCRIBE_OPTIONS_RH_SHIFT=4,i.SUBSCRIBE_OPTIONS_RH=[0,16,32],i.SUBSCRIBE_OPTIONS_NL=4,i.SUBSCRIBE_OPTIONS_RAP=8,i.SUBSCRIBE_OPTIONS_QOS=[0,1,2],i.UNSUBSCRIBE_HEADER=o(\"unsubscribe\"),i.ACKS={unsuback:o(\"unsuback\"),puback:o(\"puback\"),pubcomp:o(\"pubcomp\"),pubrel:o(\"pubrel\"),pubrec:o(\"pubrec\")},i.SUBACK_HEADER=n.from([i.codes.suback<<i.CMD_SHIFT]),i.VERSION3=n.from([3]),i.VERSION4=n.from([4]),i.VERSION5=n.from([5]),i.VERSION131=n.from([131]),i.VERSION132=n.from([132]),i.QOS=[0,1,2].map((e=>n.from([e]))),i.EMPTY={pingreq:n.from([i.codes.pingreq<<4,0]),pingresp:n.from([i.codes.pingresp<<4,0]),disconnect:n.from([i.codes.disconnect<<4,0])}},7721:function(e,t,r){var n=r(8764).Buffer;const i=r(9371),o=r(7187);class s extends o{constructor(){super(),this._array=new Array(20),this._i=0}write(e){return this._array[this._i++]=e,!0}concat(){let e=0;const t=new Array(this._array.length),r=this._array;let i,o=0;for(i=0;i<r.length&&void 0!==r[i];i++)\"string\"!=typeof r[i]?t[i]=r[i].length:t[i]=n.byteLength(r[i]),e+=t[i];const s=n.allocUnsafe(e);for(i=0;i<r.length&&void 0!==r[i];i++)\"string\"!=typeof r[i]?(r[i].copy(s,o),o+=t[i]):(s.write(r[i],o),o+=t[i]);return s}}e.exports=function(e,t){const r=new s;return i(e,r,t),r.concat()}},1772:function(e,t,r){t.parser=r(5322).parser,t.generate=r(7721),t.writeToStream=r(9371)},3903:function(e,t,r){var n=r(8764).Buffer;const i={},o=n.isBuffer(n.from([1,2]).subarray(0,1));function s(e){const t=n.allocUnsafe(2);return t.writeUInt8(e>>8,0),t.writeUInt8(255&e,1),t}e.exports={cache:i,generateCache:function(){for(let e=0;e<65536;e++)i[e]=s(e)},generateNumber:s,genBufVariableByteInt:function(e){let t=0,r=0;const i=n.allocUnsafe(4);do{t=e%128|0,(e=e/128|0)>0&&(t|=128),i.writeUInt8(t,r++)}while(e>0&&r<4);return e>0&&(r=0),o?i.subarray(0,r):i.slice(0,r)},generate4ByteBuffer:function(e){const t=n.allocUnsafe(4);return t.writeUInt32BE(e,0),t}}},9695:function(e){e.exports=class{constructor(){this.cmd=null,this.retain=!1,this.qos=0,this.dup=!1,this.length=-1,this.topic=null,this.payload=null}}},5322:function(e,t,r){const n=r(22),i=r(7187),o=r(9695),s=r(9990),a=r(1227)(\"mqtt-packet:parser\");class u extends i{constructor(){super(),this.parser=this.constructor.parser}static parser(e){return this instanceof u?(this.settings=e||{},this._states=[\"_parseHeader\",\"_parseLength\",\"_parsePayload\",\"_newPacket\"],this._resetState(),this):(new u).parser(e)}_resetState(){a(\"_resetState: resetting packet, error, _list, and _stateCounter\"),this.packet=new o,this.error=null,this._list=n(),this._stateCounter=0}parse(e){for(this.error&&this._resetState(),this._list.append(e),a(\"parse: current state: %s\",this._states[this._stateCounter]);(-1!==this.packet.length||this._list.length>0)&&this[this._states[this._stateCounter]]()&&!this.error;)this._stateCounter++,a(\"parse: state complete. _stateCounter is now: %d\",this._stateCounter),a(\"parse: packet.length: %d, buffer list length: %d\",this.packet.length,this._list.length),this._stateCounter>=this._states.length&&(this._stateCounter=0);return a(\"parse: exited while loop. packet: %d, buffer list length: %d\",this.packet.length,this._list.length),this._list.length}_parseHeader(){const e=this._list.readUInt8(0);return this.packet.cmd=s.types[e>>s.CMD_SHIFT],this.packet.retain=0!=(e&s.RETAIN_MASK),this.packet.qos=e>>s.QOS_SHIFT&s.QOS_MASK,this.packet.dup=0!=(e&s.DUP_MASK),a(\"_parseHeader: packet: %o\",this.packet),this._list.consume(1),!0}_parseLength(){const e=this._parseVarByteNum(!0);return e&&(this.packet.length=e.value,this._list.consume(e.bytes)),a(\"_parseLength %d\",e.value),!!e}_parsePayload(){a(\"_parsePayload: payload %O\",this._list);let e=!1;if(0===this.packet.length||this._list.length>=this.packet.length){switch(this._pos=0,this.packet.cmd){case\"connect\":this._parseConnect();break;case\"connack\":this._parseConnack();break;case\"publish\":this._parsePublish();break;case\"puback\":case\"pubrec\":case\"pubrel\":case\"pubcomp\":this._parseConfirmation();break;case\"subscribe\":this._parseSubscribe();break;case\"suback\":this._parseSuback();break;case\"unsubscribe\":this._parseUnsubscribe();break;case\"unsuback\":this._parseUnsuback();break;case\"pingreq\":case\"pingresp\":break;case\"disconnect\":this._parseDisconnect();break;case\"auth\":this._parseAuth();break;default:this._emitError(new Error(\"Not supported\"))}e=!0}return a(\"_parsePayload complete result: %s\",e),e}_parseConnect(){let e,t,r,n;a(\"_parseConnect\");const i={},o=this.packet,u=this._parseString();if(null===u)return this._emitError(new Error(\"Cannot parse protocolId\"));if(\"MQTT\"!==u&&\"MQIsdp\"!==u)return this._emitError(new Error(\"Invalid protocolId\"));if(o.protocolId=u,this._pos>=this._list.length)return this._emitError(new Error(\"Packet too short\"));if(o.protocolVersion=this._list.readUInt8(this._pos),o.protocolVersion>=128&&(o.bridgeMode=!0,o.protocolVersion=o.protocolVersion-128),3!==o.protocolVersion&&4!==o.protocolVersion&&5!==o.protocolVersion)return this._emitError(new Error(\"Invalid protocol version\"));if(this._pos++,this._pos>=this._list.length)return this._emitError(new Error(\"Packet too short\"));if(i.username=this._list.readUInt8(this._pos)&s.USERNAME_MASK,i.password=this._list.readUInt8(this._pos)&s.PASSWORD_MASK,i.will=this._list.readUInt8(this._pos)&s.WILL_FLAG_MASK,i.will&&(o.will={},o.will.retain=0!=(this._list.readUInt8(this._pos)&s.WILL_RETAIN_MASK),o.will.qos=(this._list.readUInt8(this._pos)&s.WILL_QOS_MASK)>>s.WILL_QOS_SHIFT),o.clean=0!=(this._list.readUInt8(this._pos)&s.CLEAN_SESSION_MASK),this._pos++,o.keepalive=this._parseNum(),-1===o.keepalive)return this._emitError(new Error(\"Packet too short\"));if(5===o.protocolVersion){const e=this._parseProperties();Object.getOwnPropertyNames(e).length&&(o.properties=e)}const l=this._parseString();if(null===l)return this._emitError(new Error(\"Packet too short\"));if(o.clientId=l,a(\"_parseConnect: packet.clientId: %s\",o.clientId),i.will){if(5===o.protocolVersion){const e=this._parseProperties();Object.getOwnPropertyNames(e).length&&(o.will.properties=e)}if(e=this._parseString(),null===e)return this._emitError(new Error(\"Cannot parse will topic\"));if(o.will.topic=e,a(\"_parseConnect: packet.will.topic: %s\",o.will.topic),t=this._parseBuffer(),null===t)return this._emitError(new Error(\"Cannot parse will payload\"));o.will.payload=t,a(\"_parseConnect: packet.will.paylaod: %s\",o.will.payload)}if(i.username){if(n=this._parseString(),null===n)return this._emitError(new Error(\"Cannot parse username\"));o.username=n,a(\"_parseConnect: packet.username: %s\",o.username)}if(i.password){if(r=this._parseBuffer(),null===r)return this._emitError(new Error(\"Cannot parse password\"));o.password=r}return this.settings=o,a(\"_parseConnect: complete\"),o}_parseConnack(){a(\"_parseConnack\");const e=this.packet;if(this._list.length<1)return null;if(e.sessionPresent=!!(this._list.readUInt8(this._pos++)&s.SESSIONPRESENT_MASK),5===this.settings.protocolVersion)this._list.length>=2?e.reasonCode=this._list.readUInt8(this._pos++):e.reasonCode=0;else{if(this._list.length<2)return null;e.returnCode=this._list.readUInt8(this._pos++)}if(-1===e.returnCode||-1===e.reasonCode)return this._emitError(new Error(\"Cannot parse return code\"));if(5===this.settings.protocolVersion){const t=this._parseProperties();Object.getOwnPropertyNames(t).length&&(e.properties=t)}a(\"_parseConnack: complete\")}_parsePublish(){a(\"_parsePublish\");const e=this.packet;if(e.topic=this._parseString(),null===e.topic)return this._emitError(new Error(\"Cannot parse topic\"));if(!(e.qos>0)||this._parseMessageId()){if(5===this.settings.protocolVersion){const t=this._parseProperties();Object.getOwnPropertyNames(t).length&&(e.properties=t)}e.payload=this._list.slice(this._pos,e.length),a(\"_parsePublish: payload from buffer list: %o\",e.payload)}}_parseSubscribe(){a(\"_parseSubscribe\");const e=this.packet;let t,r,n,i,o,u,l;if(1!==e.qos)return this._emitError(new Error(\"Wrong subscribe header\"));if(e.subscriptions=[],this._parseMessageId()){if(5===this.settings.protocolVersion){const t=this._parseProperties();Object.getOwnPropertyNames(t).length&&(e.properties=t)}for(;this._pos<e.length;){if(t=this._parseString(),null===t)return this._emitError(new Error(\"Cannot parse topic\"));if(this._pos>=e.length)return this._emitError(new Error(\"Malformed Subscribe Payload\"));r=this._parseByte(),n=r&s.SUBSCRIBE_OPTIONS_QOS_MASK,u=0!=(r>>s.SUBSCRIBE_OPTIONS_NL_SHIFT&s.SUBSCRIBE_OPTIONS_NL_MASK),o=0!=(r>>s.SUBSCRIBE_OPTIONS_RAP_SHIFT&s.SUBSCRIBE_OPTIONS_RAP_MASK),i=r>>s.SUBSCRIBE_OPTIONS_RH_SHIFT&s.SUBSCRIBE_OPTIONS_RH_MASK,l={topic:t,qos:n},5===this.settings.protocolVersion?(l.nl=u,l.rap=o,l.rh=i):this.settings.bridgeMode&&(l.rh=0,l.rap=!0,l.nl=!0),a(\"_parseSubscribe: push subscription `%s` to subscription\",l),e.subscriptions.push(l)}}}_parseSuback(){a(\"_parseSuback\");const e=this.packet;if(this.packet.granted=[],this._parseMessageId()){if(5===this.settings.protocolVersion){const t=this._parseProperties();Object.getOwnPropertyNames(t).length&&(e.properties=t)}for(;this._pos<this.packet.length;)this.packet.granted.push(this._list.readUInt8(this._pos++))}}_parseUnsubscribe(){a(\"_parseUnsubscribe\");const e=this.packet;if(e.unsubscriptions=[],this._parseMessageId()){if(5===this.settings.protocolVersion){const t=this._parseProperties();Object.getOwnPropertyNames(t).length&&(e.properties=t)}for(;this._pos<e.length;){const t=this._parseString();if(null===t)return this._emitError(new Error(\"Cannot parse topic\"));a(\"_parseUnsubscribe: push topic `%s` to unsubscriptions\",t),e.unsubscriptions.push(t)}}}_parseUnsuback(){a(\"_parseUnsuback\");const e=this.packet;if(!this._parseMessageId())return this._emitError(new Error(\"Cannot parse messageId\"));if(5===this.settings.protocolVersion){const t=this._parseProperties();for(Object.getOwnPropertyNames(t).length&&(e.properties=t),e.granted=[];this._pos<this.packet.length;)this.packet.granted.push(this._list.readUInt8(this._pos++))}}_parseConfirmation(){a(\"_parseConfirmation: packet.cmd: `%s`\",this.packet.cmd);const e=this.packet;if(this._parseMessageId(),5===this.settings.protocolVersion&&(e.length>2?(e.reasonCode=this._parseByte(),a(\"_parseConfirmation: packet.reasonCode `%d`\",e.reasonCode)):e.reasonCode=0,e.length>3)){const t=this._parseProperties();Object.getOwnPropertyNames(t).length&&(e.properties=t)}return!0}_parseDisconnect(){const e=this.packet;if(a(\"_parseDisconnect\"),5===this.settings.protocolVersion){this._list.length>0?e.reasonCode=this._parseByte():e.reasonCode=0;const t=this._parseProperties();Object.getOwnPropertyNames(t).length&&(e.properties=t)}return a(\"_parseDisconnect result: true\"),!0}_parseAuth(){a(\"_parseAuth\");const e=this.packet;if(5!==this.settings.protocolVersion)return this._emitError(new Error(\"Not supported auth packet for this version MQTT\"));e.reasonCode=this._parseByte();const t=this._parseProperties();return Object.getOwnPropertyNames(t).length&&(e.properties=t),a(\"_parseAuth: result: true\"),!0}_parseMessageId(){const e=this.packet;return e.messageId=this._parseNum(),null===e.messageId?(this._emitError(new Error(\"Cannot parse messageId\")),!1):(a(\"_parseMessageId: packet.messageId %d\",e.messageId),!0)}_parseString(e){const t=this._parseNum(),r=t+this._pos;if(-1===t||r>this._list.length||r>this.packet.length)return null;const n=this._list.toString(\"utf8\",this._pos,r);return this._pos+=t,a(\"_parseString: result: %s\",n),n}_parseStringPair(){return a(\"_parseStringPair\"),{name:this._parseString(),value:this._parseString()}}_parseBuffer(){const e=this._parseNum(),t=e+this._pos;if(-1===e||t>this._list.length||t>this.packet.length)return null;const r=this._list.slice(this._pos,t);return this._pos+=e,a(\"_parseBuffer: result: %o\",r),r}_parseNum(){if(this._list.length-this._pos<2)return-1;const e=this._list.readUInt16BE(this._pos);return this._pos+=2,a(\"_parseNum: result: %s\",e),e}_parse4ByteNum(){if(this._list.length-this._pos<4)return-1;const e=this._list.readUInt32BE(this._pos);return this._pos+=4,a(\"_parse4ByteNum: result: %s\",e),e}_parseVarByteNum(e){a(\"_parseVarByteNum\");let t,r=0,n=1,i=0,o=!1;const u=this._pos?this._pos:0;for(;r<4&&u+r<this._list.length;){if(t=this._list.readUInt8(u+r++),i+=n*(t&s.VARBYTEINT_MASK),n*=128,0==(t&s.VARBYTEINT_FIN_MASK)){o=!0;break}if(this._list.length<=r)break}return!o&&4===r&&this._list.length>=r&&this._emitError(new Error(\"Invalid variable byte integer\")),u&&(this._pos+=r),o=!!o&&(e?{bytes:r,value:i}:i),a(\"_parseVarByteNum: result: %o\",o),o}_parseByte(){let e;return this._pos<this._list.length&&(e=this._list.readUInt8(this._pos),this._pos++),a(\"_parseByte: result: %o\",e),e}_parseByType(e){switch(a(\"_parseByType: type: %s\",e),e){case\"byte\":return 0!==this._parseByte();case\"int8\":return this._parseByte();case\"int16\":return this._parseNum();case\"int32\":return this._parse4ByteNum();case\"var\":return this._parseVarByteNum();case\"string\":return this._parseString();case\"pair\":return this._parseStringPair();case\"binary\":return this._parseBuffer()}}_parseProperties(){a(\"_parseProperties\");const e=this._parseVarByteNum(),t=this._pos+e,r={};for(;this._pos<t;){const e=this._parseByte();if(!e)return this._emitError(new Error(\"Cannot parse property code type\")),!1;const t=s.propertiesCodes[e];if(!t)return this._emitError(new Error(\"Unknown property\")),!1;if(\"userProperties\"!==t)r[t]?(Array.isArray(r[t])||(r[t]=[r[t]]),r[t].push(this._parseByType(s.propertiesTypes[t]))):r[t]=this._parseByType(s.propertiesTypes[t]);else{r[t]||(r[t]=Object.create(null));const e=this._parseByType(s.propertiesTypes[t]);if(r[t][e.name])if(Array.isArray(r[t][e.name]))r[t][e.name].push(e.value);else{const n=r[t][e.name];r[t][e.name]=[n],r[t][e.name].push(e.value)}else r[t][e.name]=e.value}}return r}_newPacket(){return a(\"_newPacket\"),this.packet&&(this._list.consume(this.packet.length),a(\"_newPacket: parser emit packet: packet.cmd: %s, packet.payload: %s, packet.length: %d\",this.packet.cmd,this.packet.payload,this.packet.length),this.emit(\"packet\",this.packet)),a(\"_newPacket: new packet\"),this.packet=new o,this._pos=0,!0}_emitError(e){a(\"_emitError\"),this.error=e,this.emit(\"error\",e)}}e.exports=u},9371:function(e,t,r){var n=r(8764).Buffer;const i=r(9990),o=n.allocUnsafe(0),s=n.from([0]),a=r(3903),u=r(8212).nextTick,l=r(1227)(\"mqtt-packet:writeToStream\"),c=a.cache,h=a.generateNumber,f=a.generateCache,p=a.genBufVariableByteInt,d=a.generate4ByteBuffer;let y=k,g=!0;function b(e,t,r){switch(l(\"generate called\"),t.cork&&(t.cork(),u(m,t)),g&&(g=!1,f()),l(\"generate: packet.cmd: %s\",e.cmd),e.cmd){case\"connect\":return function(e,t,r){const o=e||{},s=o.protocolId||\"MQTT\";let a=o.protocolVersion||4;const u=o.will;let l=o.clean;const c=o.keepalive||0,h=o.clientId||\"\",f=o.username,p=o.password,d=o.properties;void 0===l&&(l=!0);let g=0;if(!s||\"string\"!=typeof s&&!n.isBuffer(s))return t.emit(\"error\",new Error(\"Invalid protocolId\")),!1;if(g+=s.length+2,3!==a&&4!==a&&5!==a)return t.emit(\"error\",new Error(\"Invalid protocol version\")),!1;if(g+=1,(\"string\"==typeof h||n.isBuffer(h))&&(h||a>=4)&&(h||l))g+=n.byteLength(h)+2;else{if(a<4)return t.emit(\"error\",new Error(\"clientId must be supplied before 3.1.1\")),!1;if(1*l==0)return t.emit(\"error\",new Error(\"clientId must be given if cleanSession set to 0\")),!1}if(\"number\"!=typeof c||c<0||c>65535||c%1!=0)return t.emit(\"error\",new Error(\"Invalid keepalive\")),!1;if(g+=2,g+=1,5===a){var b=T(t,d);if(!b)return!1;g+=b.length}if(u){if(\"object\"!=typeof u)return t.emit(\"error\",new Error(\"Invalid will\")),!1;if(!u.topic||\"string\"!=typeof u.topic)return t.emit(\"error\",new Error(\"Invalid will topic\")),!1;if(g+=n.byteLength(u.topic)+2,g+=2,u.payload){if(!(u.payload.length>=0))return t.emit(\"error\",new Error(\"Invalid will payload\")),!1;\"string\"==typeof u.payload?g+=n.byteLength(u.payload):g+=u.payload.length}var m={};if(5===a){if(!(m=T(t,u.properties)))return!1;g+=m.length}}let v=!1;if(null!=f){if(!R(f))return t.emit(\"error\",new Error(\"Invalid username\")),!1;v=!0,g+=n.byteLength(f)+2}if(null!=p){if(!v)return t.emit(\"error\",new Error(\"Username is required to use password\")),!1;if(!R(p))return t.emit(\"error\",new Error(\"Invalid password\")),!1;g+=B(p)+2}t.write(i.CONNECT_HEADER),w(t,g),C(t,s),o.bridgeMode&&(a+=128),t.write(131===a?i.VERSION131:132===a?i.VERSION132:4===a?i.VERSION4:5===a?i.VERSION5:i.VERSION3);let E=0;return E|=null!=f?i.USERNAME_MASK:0,E|=null!=p?i.PASSWORD_MASK:0,E|=u&&u.retain?i.WILL_RETAIN_MASK:0,E|=u&&u.qos?u.qos<<i.WILL_QOS_SHIFT:0,E|=u?i.WILL_FLAG_MASK:0,E|=l?i.CLEAN_SESSION_MASK:0,t.write(n.from([E])),y(t,c),5===a&&b.write(),C(t,h),u&&(5===a&&m.write(),_(t,u.topic),C(t,u.payload)),null!=f&&C(t,f),null!=p&&C(t,p),!0}(e,t);case\"connack\":return function(e,t,r){const o=r?r.protocolVersion:4,a=e||{},u=5===o?a.reasonCode:a.returnCode,l=a.properties;let c=2;if(\"number\"!=typeof u)return t.emit(\"error\",new Error(\"Invalid return code\")),!1;let h=null;if(5===o){if(h=T(t,l),!h)return!1;c+=h.length}return t.write(i.CONNACK_HEADER),w(t,c),t.write(a.sessionPresent?i.SESSIONPRESENT_HEADER:s),t.write(n.from([u])),null!=h&&h.write(),!0}(e,t,r);case\"publish\":return function(e,t,r){l(\"publish: packet: %o\",e);const s=r?r.protocolVersion:4,a=e||{},u=a.qos||0,c=a.retain?i.RETAIN_MASK:0,h=a.topic,f=a.payload||o,p=a.messageId,d=a.properties;let g=0;if(\"string\"==typeof h)g+=n.byteLength(h)+2;else{if(!n.isBuffer(h))return t.emit(\"error\",new Error(\"Invalid topic\")),!1;g+=h.length+2}if(n.isBuffer(f)?g+=f.length:g+=n.byteLength(f),u&&\"number\"!=typeof p)return t.emit(\"error\",new Error(\"Invalid messageId\")),!1;u&&(g+=2);let b=null;if(5===s){if(b=T(t,d),!b)return!1;g+=b.length}return t.write(i.PUBLISH_HEADER[u][a.dup?1:0][c?1:0]),w(t,g),y(t,B(h)),t.write(h),u>0&&y(t,p),null!=b&&b.write(),l(\"publish: payload: %o\",f),t.write(f)}(e,t,r);case\"puback\":case\"pubrec\":case\"pubrel\":case\"pubcomp\":return function(e,t,r){const o=r?r.protocolVersion:4,s=e||{},a=s.cmd||\"puback\",u=s.messageId,l=s.dup&&\"pubrel\"===a?i.DUP_MASK:0;let c=0;const h=s.reasonCode,f=s.properties;let p=5===o?3:2;if(\"pubrel\"===a&&(c=1),\"number\"!=typeof u)return t.emit(\"error\",new Error(\"Invalid messageId\")),!1;let d=null;if(5===o&&\"object\"==typeof f){if(d=A(t,f,r,p),!d)return!1;p+=d.length}return t.write(i.ACKS[a][c][l][0]),w(t,p),y(t,u),5===o&&t.write(n.from([h])),null!==d&&d.write(),!0}(e,t,r);case\"subscribe\":return function(e,t,r){l(\"subscribe: packet: \");const o=r?r.protocolVersion:4,s=e||{},a=s.dup?i.DUP_MASK:0,u=s.messageId,c=s.subscriptions,h=s.properties;let f=0;if(\"number\"!=typeof u)return t.emit(\"error\",new Error(\"Invalid messageId\")),!1;f+=2;let p=null;if(5===o){if(p=T(t,h),!p)return!1;f+=p.length}if(\"object\"!=typeof c||!c.length)return t.emit(\"error\",new Error(\"Invalid subscriptions\")),!1;for(let e=0;e<c.length;e+=1){const r=c[e].topic,i=c[e].qos;if(\"string\"!=typeof r)return t.emit(\"error\",new Error(\"Invalid subscriptions - invalid topic\")),!1;if(\"number\"!=typeof i)return t.emit(\"error\",new Error(\"Invalid subscriptions - invalid qos\")),!1;if(5===o){if(\"boolean\"!=typeof(c[e].nl||!1))return t.emit(\"error\",new Error(\"Invalid subscriptions - invalid No Local\")),!1;if(\"boolean\"!=typeof(c[e].rap||!1))return t.emit(\"error\",new Error(\"Invalid subscriptions - invalid Retain as Published\")),!1;const r=c[e].rh||0;if(\"number\"!=typeof r||r>2)return t.emit(\"error\",new Error(\"Invalid subscriptions - invalid Retain Handling\")),!1}f+=n.byteLength(r)+2+1}l(\"subscribe: writing to stream: %o\",i.SUBSCRIBE_HEADER),t.write(i.SUBSCRIBE_HEADER[1][a?1:0][0]),w(t,f),y(t,u),null!==p&&p.write();let d=!0;for(const e of c){const r=e.topic,s=e.qos,a=+e.nl,u=+e.rap,l=e.rh;let c;_(t,r),c=i.SUBSCRIBE_OPTIONS_QOS[s],5===o&&(c|=a?i.SUBSCRIBE_OPTIONS_NL:0,c|=u?i.SUBSCRIBE_OPTIONS_RAP:0,c|=l?i.SUBSCRIBE_OPTIONS_RH[l]:0),d=t.write(n.from([c]))}return d}(e,t,r);case\"suback\":return function(e,t,r){const o=r?r.protocolVersion:4,s=e||{},a=s.messageId,u=s.granted,l=s.properties;let c=0;if(\"number\"!=typeof a)return t.emit(\"error\",new Error(\"Invalid messageId\")),!1;if(c+=2,\"object\"!=typeof u||!u.length)return t.emit(\"error\",new Error(\"Invalid qos vector\")),!1;for(let e=0;e<u.length;e+=1){if(\"number\"!=typeof u[e])return t.emit(\"error\",new Error(\"Invalid qos vector\")),!1;c+=1}let h=null;if(5===o){if(h=A(t,l,r,c),!h)return!1;c+=h.length}return t.write(i.SUBACK_HEADER),w(t,c),y(t,a),null!==h&&h.write(),t.write(n.from(u))}(e,t,r);case\"unsubscribe\":return function(e,t,r){const o=r?r.protocolVersion:4,s=e||{},a=s.messageId,u=s.dup?i.DUP_MASK:0,l=s.unsubscriptions,c=s.properties;let h=0;if(\"number\"!=typeof a)return t.emit(\"error\",new Error(\"Invalid messageId\")),!1;if(h+=2,\"object\"!=typeof l||!l.length)return t.emit(\"error\",new Error(\"Invalid unsubscriptions\")),!1;for(let e=0;e<l.length;e+=1){if(\"string\"!=typeof l[e])return t.emit(\"error\",new Error(\"Invalid unsubscriptions\")),!1;h+=n.byteLength(l[e])+2}let f=null;if(5===o){if(f=T(t,c),!f)return!1;h+=f.length}t.write(i.UNSUBSCRIBE_HEADER[1][u?1:0][0]),w(t,h),y(t,a),null!==f&&f.write();let p=!0;for(let e=0;e<l.length;e++)p=_(t,l[e]);return p}(e,t,r);case\"unsuback\":return function(e,t,r){const o=r?r.protocolVersion:4,s=e||{},a=s.messageId,u=s.dup?i.DUP_MASK:0,l=s.granted,c=s.properties,h=s.cmd;let f=2;if(\"number\"!=typeof a)return t.emit(\"error\",new Error(\"Invalid messageId\")),!1;if(5===o){if(\"object\"!=typeof l||!l.length)return t.emit(\"error\",new Error(\"Invalid qos vector\")),!1;for(let e=0;e<l.length;e+=1){if(\"number\"!=typeof l[e])return t.emit(\"error\",new Error(\"Invalid qos vector\")),!1;f+=1}}let p=null;if(5===o){if(p=A(t,c,r,f),!p)return!1;f+=p.length}return t.write(i.ACKS[h][0][u][0]),w(t,f),y(t,a),null!==p&&p.write(),5===o&&t.write(n.from(l)),!0}(e,t,r);case\"pingreq\":case\"pingresp\":return function(e,t,r){return t.write(i.EMPTY[e.cmd])}(e,t);case\"disconnect\":return function(e,t,r){const o=r?r.protocolVersion:4,s=e||{},a=s.reasonCode,u=s.properties;let l=5===o?1:0,c=null;if(5===o){if(c=A(t,u,r,l),!c)return!1;l+=c.length}return t.write(n.from([i.codes.disconnect<<4])),w(t,l),5===o&&t.write(n.from([a])),null!==c&&c.write(),!0}(e,t,r);case\"auth\":return function(e,t,r){const o=r?r.protocolVersion:4,s=e||{},a=s.reasonCode,u=s.properties;let l=5===o?1:0;5!==o&&t.emit(\"error\",new Error(\"Invalid mqtt version for auth packet\"));const c=A(t,u,r,l);return!!c&&(l+=c.length,t.write(n.from([i.codes.auth<<4])),w(t,l),t.write(n.from([a])),null!==c&&c.write(),!0)}(e,t,r);default:return t.emit(\"error\",new Error(\"Unknown command\")),!1}}function m(e){e.uncork()}Object.defineProperty(b,\"cacheNumbers\",{get:()=>y===k,set(e){e?(c&&0!==Object.keys(c).length||(g=!0),y=k):(g=!1,y=S)}});const v={};function w(e,t){if(t>i.VARBYTEINT_MAX)return e.emit(\"error\",new Error(`Invalid variable byte integer: ${t}`)),!1;let r=v[t];return r||(r=p(t),t<16384&&(v[t]=r)),l(\"writeVarByteInt: writing to stream: %o\",r),e.write(r)}function _(e,t){const r=n.byteLength(t);return y(e,r),l(\"writeString: %s\",t),e.write(t,\"utf8\")}function E(e,t,r){_(e,t),_(e,r)}function k(e,t){return l(\"writeNumberCached: number: %d\",t),l(\"writeNumberCached: %o\",c[t]),e.write(c[t])}function S(e,t){const r=h(t);return l(\"writeNumberGenerated: %o\",r),e.write(r)}function C(e,t){\"string\"==typeof t?_(e,t):t?(y(e,t.length),e.write(t)):y(e,0)}function T(e,t){if(\"object\"!=typeof t||null!=t.length)return{length:1,write(){x(e,{},0)}};let r=0;function o(t,r){let o=0;switch(i.propertiesTypes[t]){case\"byte\":if(\"boolean\"!=typeof r)return e.emit(\"error\",new Error(`Invalid ${t}: ${r}`)),!1;o+=2;break;case\"int8\":if(\"number\"!=typeof r||r<0||r>255)return e.emit(\"error\",new Error(`Invalid ${t}: ${r}`)),!1;o+=2;break;case\"binary\":if(r&&null===r)return e.emit(\"error\",new Error(`Invalid ${t}: ${r}`)),!1;o+=1+n.byteLength(r)+2;break;case\"int16\":if(\"number\"!=typeof r||r<0||r>65535)return e.emit(\"error\",new Error(`Invalid ${t}: ${r}`)),!1;o+=3;break;case\"int32\":if(\"number\"!=typeof r||r<0||r>4294967295)return e.emit(\"error\",new Error(`Invalid ${t}: ${r}`)),!1;o+=5;break;case\"var\":if(\"number\"!=typeof r||r<0||r>268435455)return e.emit(\"error\",new Error(`Invalid ${t}: ${r}`)),!1;o+=1+n.byteLength(p(r));break;case\"string\":if(\"string\"!=typeof r)return e.emit(\"error\",new Error(`Invalid ${t}: ${r}`)),!1;o+=3+n.byteLength(r.toString());break;case\"pair\":if(\"object\"!=typeof r)return e.emit(\"error\",new Error(`Invalid ${t}: ${r}`)),!1;o+=Object.getOwnPropertyNames(r).reduce(((e,t)=>{const i=r[t];return Array.isArray(i)?e+=i.reduce(((e,r)=>e+(3+n.byteLength(t.toString())+2+n.byteLength(r.toString()))),0):e+=3+n.byteLength(t.toString())+2+n.byteLength(r[t].toString()),e}),0);break;default:return e.emit(\"error\",new Error(`Invalid property ${t}: ${r}`)),!1}return o}if(t)for(const e in t){let n=0,i=0;const s=t[e];if(Array.isArray(s))for(let t=0;t<s.length;t++){if(i=o(e,s[t]),!i)return!1;n+=i}else{if(i=o(e,s),!i)return!1;n=i}if(!n)return!1;r+=n}return{length:n.byteLength(p(r))+r,write(){x(e,t,r)}}}function A(e,t,r,n){const i=[\"reasonString\",\"userProperties\"],o=r&&r.properties&&r.properties.maximumPacketSize?r.properties.maximumPacketSize:0;let s=T(e,t);if(o)for(;n+s.length>o;){const r=i.shift();if(!r||!t[r])return!1;delete t[r],s=T(e,t)}return s}function I(e,t,r){switch(i.propertiesTypes[t]){case\"byte\":e.write(n.from([i.properties[t]])),e.write(n.from([+r]));break;case\"int8\":e.write(n.from([i.properties[t]])),e.write(n.from([r]));break;case\"binary\":e.write(n.from([i.properties[t]])),C(e,r);break;case\"int16\":e.write(n.from([i.properties[t]])),y(e,r);break;case\"int32\":e.write(n.from([i.properties[t]])),function(e,t){const r=d(t);l(\"write4ByteNumber: %o\",r),e.write(r)}(e,r);break;case\"var\":e.write(n.from([i.properties[t]])),w(e,r);break;case\"string\":e.write(n.from([i.properties[t]])),_(e,r);break;case\"pair\":Object.getOwnPropertyNames(r).forEach((o=>{const s=r[o];Array.isArray(s)?s.forEach((r=>{e.write(n.from([i.properties[t]])),E(e,o.toString(),r.toString())})):(e.write(n.from([i.properties[t]])),E(e,o.toString(),s.toString()))}));break;default:return e.emit(\"error\",new Error(`Invalid property ${t} value: ${r}`)),!1}}function x(e,t,r){w(e,r);for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&null!==t[r]){const n=t[r];if(Array.isArray(n))for(let t=0;t<n.length;t++)I(e,r,n[t]);else I(e,r,n)}}function B(e){return e?e instanceof n?e.length:n.byteLength(e):0}function R(e){return\"string\"==typeof e||e instanceof n}e.exports=b},7824:function(e){var t=1e3,r=60*t,n=60*r,i=24*n;function o(e,t,r,n){var i=t>=1.5*r;return Math.round(e/r)+\" \"+n+(i?\"s\":\"\")}e.exports=function(e,s){s=s||{};var a,u,l=typeof e;if(\"string\"===l&&e.length>0)return function(e){if(!((e=String(e)).length>100)){var o=/^(-?(?:\\d+)?\\.?\\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(o){var s=parseFloat(o[1]);switch((o[2]||\"ms\").toLowerCase()){case\"years\":case\"year\":case\"yrs\":case\"yr\":case\"y\":return 315576e5*s;case\"weeks\":case\"week\":case\"w\":return 6048e5*s;case\"days\":case\"day\":case\"d\":return s*i;case\"hours\":case\"hour\":case\"hrs\":case\"hr\":case\"h\":return s*n;case\"minutes\":case\"minute\":case\"mins\":case\"min\":case\"m\":return s*r;case\"seconds\":case\"second\":case\"secs\":case\"sec\":case\"s\":return s*t;case\"milliseconds\":case\"millisecond\":case\"msecs\":case\"msec\":case\"ms\":return s;default:return}}}}(e);if(\"number\"===l&&isFinite(e))return s.long?(a=e,(u=Math.abs(a))>=i?o(a,u,i,\"day\"):u>=n?o(a,u,n,\"hour\"):u>=r?o(a,u,r,\"minute\"):u>=t?o(a,u,t,\"second\"):a+\" ms\"):function(e){var o=Math.abs(e);return o>=i?Math.round(e/i)+\"d\":o>=n?Math.round(e/n)+\"h\":o>=r?Math.round(e/r)+\"m\":o>=t?Math.round(e/t)+\"s\":e+\"ms\"}(e);throw new Error(\"val is not a non-empty string or a valid number. val=\"+JSON.stringify(e))}},423:function(e,t,r){const n=r(9759);e.exports.Q=n},9759:function(e,t,r){\"use strict\";const n=r(9246).l4,i=r(1227)(\"number-allocator:trace\"),o=r(1227)(\"number-allocator:error\");function s(e,t){this.low=e,this.high=t}function a(e,t){if(!(this instanceof a))return new a(e,t);this.min=e,this.max=t,this.ss=new n([],((e,t)=>e.compare(t))),i(\"Create\"),this.clear()}s.prototype.equals=function(e){return this.low===e.low&&this.high===e.high},s.prototype.compare=function(e){return this.low<e.low&&this.high<e.low?-1:e.low<this.low&&e.high<this.low?1:0},a.prototype.firstVacant=function(){return 0===this.ss.size()?null:this.ss.front().low},a.prototype.alloc=function(){if(0===this.ss.size())return i(\"alloc():empty\"),null;const e=this.ss.front(),t=e.low;return t+1<=e.high?++e.low:this.ss.eraseElementByPos(0),i(\"alloc():\"+t),t},a.prototype.use=function(e){const t=new s(e,e),r=this.ss.lowerBound(t);if(r){if(r.equals(t))return this.ss.eraseElementByValue(r),i(\"use():\"+e),!0;if(r.low>e)return!1;if(r.low===e)return++r.low,i(\"use():\"+e),!0;if(r.high===e)return--r.high,i(\"use():\"+e),!0;const n=r.low;return r.low=e+1,this.ss.insert(new s(n,e-1)),i(\"use():\"+e),!0}return i(\"use():failed\"),!1},a.prototype.free=function(e){if(e<this.min||e>this.max)return void o(\"free():\"+e+\" is out of range\");const t=new s(e,e),r=this.ss.lowerBound(t);if(r){if(r.low<=e&&e<=r.high)return void o(\"free():\"+e+\" has already been vacant\");if(r===this.ss.front())e+1===r.low?--r.low:this.ss.insert(t);else{const n=this.ss.reverseLowerBound(t);n.high+1===e?e+1===r.low?(this.ss.eraseElementByValue(n),r.low=n.low):n.high=e:e+1===r.low?r.low=e:this.ss.insert(t)}}else{if(r===this.ss.front())return void this.ss.insert(t);const n=this.ss.reverseLowerBound(t);n.high+1===e?n.high=e:this.ss.insert(t)}i(\"free():\"+e)},a.prototype.clear=function(){i(\"clear()\"),this.ss.clear(),this.ss.insert(new s(this.min,this.max))},a.prototype.intervalCount=function(){return this.ss.size()},a.prototype.dump=function(){console.log(\"length:\"+this.ss.size());for(const e of this.ss)console.log(e)},e.exports=a},778:function(e,t,r){var n=r(2479);function i(e){var t=function(){return t.called?t.value:(t.called=!0,t.value=e.apply(this,arguments))};return t.called=!1,t}function o(e){var t=function(){if(t.called)throw new Error(t.onceError);return t.called=!0,t.value=e.apply(this,arguments)},r=e.name||\"Function wrapped with `once`\";return t.onceError=r+\" shouldn't be called more than once\",t.called=!1,t}e.exports=n(i),e.exports.strict=n(o),i.proto=i((function(){Object.defineProperty(Function.prototype,\"once\",{value:function(){return i(this)},configurable:!0}),Object.defineProperty(Function.prototype,\"onceStrict\",{value:function(){return o(this)},configurable:!0})}))},8212:function(e,t,r){\"use strict\";var n=r(4155);void 0===n||!n.version||0===n.version.indexOf(\"v0.\")||0===n.version.indexOf(\"v1.\")&&0!==n.version.indexOf(\"v1.8.\")?e.exports={nextTick:function(e,t,r,i){if(\"function\"!=typeof e)throw new TypeError('\"callback\" argument must be a function');var o,s,a=arguments.length;switch(a){case 0:case 1:return n.nextTick(e);case 2:return n.nextTick((function(){e.call(null,t)}));case 3:return n.nextTick((function(){e.call(null,t,r)}));case 4:return n.nextTick((function(){e.call(null,t,r,i)}));default:for(o=new Array(a-1),s=0;s<o.length;)o[s++]=arguments[s];return n.nextTick((function(){e.apply(null,o)}))}}}:e.exports=n},4155:function(e){var t,r,n=e.exports={};function i(){throw new Error(\"setTimeout has not been defined\")}function o(){throw new Error(\"clearTimeout has not been defined\")}function s(e){if(t===setTimeout)return setTimeout(e,0);if((t===i||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}!function(){try{t=\"function\"==typeof setTimeout?setTimeout:i}catch(e){t=i}try{r=\"function\"==typeof clearTimeout?clearTimeout:o}catch(e){r=o}}();var a,u=[],l=!1,c=-1;function h(){l&&a&&(l=!1,a.length?u=a.concat(u):c=-1,u.length&&f())}function f(){if(!l){var e=s(h);l=!0;for(var t=u.length;t;){for(a=u,u=[];++c<t;)a&&a[c].run();c=-1,t=u.length}a=null,l=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===o||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function p(e,t){this.fun=e,this.array=t}function d(){}n.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];u.push(new p(e,t)),1!==u.length||l||s(f)},p.prototype.run=function(){this.fun.apply(null,this.array)},n.title=\"browser\",n.browser=!0,n.env={},n.argv=[],n.version=\"\",n.versions={},n.on=d,n.addListener=d,n.once=d,n.off=d,n.removeListener=d,n.removeAllListeners=d,n.emit=d,n.prependListener=d,n.prependOnceListener=d,n.listeners=function(e){return[]},n.binding=function(e){throw new Error(\"process.binding is not supported\")},n.cwd=function(){return\"/\"},n.chdir=function(e){throw new Error(\"process.chdir is not supported\")},n.umask=function(){return 0}},2587:function(e){\"use strict\";function t(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.exports=function(e,r,n,i){r=r||\"&\",n=n||\"=\";var o={};if(\"string\"!=typeof e||0===e.length)return o;var s=/\\+/g;e=e.split(r);var a=1e3;i&&\"number\"==typeof i.maxKeys&&(a=i.maxKeys);var u=e.length;a>0&&u>a&&(u=a);for(var l=0;l<u;++l){var c,h,f,p,d=e[l].replace(s,\"%20\"),y=d.indexOf(n);y>=0?(c=d.substr(0,y),h=d.substr(y+1)):(c=d,h=\"\"),f=decodeURIComponent(c),p=decodeURIComponent(h),t(o,f)?Array.isArray(o[f])?o[f].push(p):o[f]=[o[f],p]:o[f]=p}return o}},2182:function(e){\"use strict\";var t=function(e){switch(typeof e){case\"string\":return e;case\"boolean\":return e?\"true\":\"false\";case\"number\":return isFinite(e)?e:\"\";default:return\"\"}};e.exports=function(e,r,n,i){return r=r||\"&\",n=n||\"=\",null===e&&(e=void 0),\"object\"==typeof e?Object.keys(e).map((function(i){var o=encodeURIComponent(t(i))+n;return Array.isArray(e[i])?e[i].map((function(e){return o+encodeURIComponent(t(e))})).join(r):o+encodeURIComponent(t(e[i]))})).join(r):i?encodeURIComponent(t(i))+n+encodeURIComponent(t(e)):\"\"}},7673:function(e,t,r){\"use strict\";t.decode=t.parse=r(2587),t.encode=t.stringify=r(2182)},4281:function(e){\"use strict\";var t={};function r(e,r,n){n||(n=Error);var i=function(e){var t,n;function i(t,n,i){return e.call(this,function(e,t,n){return\"string\"==typeof r?r:r(e,t,n)}(t,n,i))||this}return n=e,(t=i).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n,i}(n);i.prototype.name=n.name,i.prototype.code=e,t[e]=i}function n(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map((function(e){return String(e)})),r>2?\"one of \".concat(t,\" \").concat(e.slice(0,r-1).join(\", \"),\", or \")+e[r-1]:2===r?\"one of \".concat(t,\" \").concat(e[0],\" or \").concat(e[1]):\"of \".concat(t,\" \").concat(e[0])}return\"of \".concat(t,\" \").concat(String(e))}r(\"ERR_INVALID_OPT_VALUE\",(function(e,t){return'The value \"'+t+'\" is invalid for option \"'+e+'\"'}),TypeError),r(\"ERR_INVALID_ARG_TYPE\",(function(e,t,r){var i,o,s,a,u;if(\"string\"==typeof t&&(o=\"not \",t.substr(0,o.length)===o)?(i=\"must not be\",t=t.replace(/^not /,\"\")):i=\"must be\",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}(e,\" argument\"))s=\"The \".concat(e,\" \").concat(i,\" \").concat(n(t,\"type\"));else{var l=(\"number\"!=typeof u&&(u=0),u+\".\".length>(a=e).length||-1===a.indexOf(\".\",u)?\"argument\":\"property\");s='The \"'.concat(e,'\" ').concat(l,\" \").concat(i,\" \").concat(n(t,\"type\"))}return s+\". Received type \".concat(typeof r)}),TypeError),r(\"ERR_STREAM_PUSH_AFTER_EOF\",\"stream.push() after EOF\"),r(\"ERR_METHOD_NOT_IMPLEMENTED\",(function(e){return\"The \"+e+\" method is not implemented\"})),r(\"ERR_STREAM_PREMATURE_CLOSE\",\"Premature close\"),r(\"ERR_STREAM_DESTROYED\",(function(e){return\"Cannot call \"+e+\" after a stream was destroyed\"})),r(\"ERR_MULTIPLE_CALLBACK\",\"Callback called multiple times\"),r(\"ERR_STREAM_CANNOT_PIPE\",\"Cannot pipe, not readable\"),r(\"ERR_STREAM_WRITE_AFTER_END\",\"write after end\"),r(\"ERR_STREAM_NULL_VALUES\",\"May not write null values to stream\",TypeError),r(\"ERR_UNKNOWN_ENCODING\",(function(e){return\"Unknown encoding: \"+e}),TypeError),r(\"ERR_STREAM_UNSHIFT_AFTER_END_EVENT\",\"stream.unshift() after end event\"),e.exports.q=t},6753:function(e,t,r){\"use strict\";var n=r(4155),i=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=c;var o=r(9481),s=r(4229);r(5717)(c,o);for(var a=i(s.prototype),u=0;u<a.length;u++){var l=a[u];c.prototype[l]||(c.prototype[l]=s.prototype[l])}function c(e){if(!(this instanceof c))return new c(e);o.call(this,e),s.call(this,e),this.allowHalfOpen=!0,e&&(!1===e.readable&&(this.readable=!1),!1===e.writable&&(this.writable=!1),!1===e.allowHalfOpen&&(this.allowHalfOpen=!1,this.once(\"end\",h)))}function h(){this._writableState.ended||n.nextTick(f,this)}function f(e){e.end()}Object.defineProperty(c.prototype,\"writableHighWaterMark\",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(c.prototype,\"writableBuffer\",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(c.prototype,\"writableLength\",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(c.prototype,\"destroyed\",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}})},2725:function(e,t,r){\"use strict\";e.exports=i;var n=r(4605);function i(e){if(!(this instanceof i))return new i(e);n.call(this,e)}r(5717)(i,n),i.prototype._transform=function(e,t,r){r(null,e)}},9481:function(e,t,r){\"use strict\";var n,i=r(4155);e.exports=C,C.ReadableState=S,r(7187).EventEmitter;var o,s=function(e,t){return e.listeners(t).length},a=r(2503),u=r(8764).Buffer,l=r.g.Uint8Array||function(){},c=r(4616);o=c&&c.debuglog?c.debuglog(\"stream\"):function(){};var h,f,p,d=r(7327),y=r(1195),g=r(2457).getHighWaterMark,b=r(4281).q,m=b.ERR_INVALID_ARG_TYPE,v=b.ERR_STREAM_PUSH_AFTER_EOF,w=b.ERR_METHOD_NOT_IMPLEMENTED,_=b.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;r(5717)(C,a);var E=y.errorOrDestroy,k=[\"error\",\"close\",\"destroy\",\"pause\",\"resume\"];function S(e,t,i){n=n||r(6753),e=e||{},\"boolean\"!=typeof i&&(i=t instanceof n),this.objectMode=!!e.objectMode,i&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=g(this,e,\"readableHighWaterMark\",i),this.buffer=new d,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||\"utf8\",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(h||(h=r(2553).s),this.decoder=new h(e.encoding),this.encoding=e.encoding)}function C(e){if(n=n||r(6753),!(this instanceof C))return new C(e);var t=this instanceof n;this._readableState=new S(e,this,t),this.readable=!0,e&&(\"function\"==typeof e.read&&(this._read=e.read),\"function\"==typeof e.destroy&&(this._destroy=e.destroy)),a.call(this)}function T(e,t,r,n,i){o(\"readableAddChunk\",t);var s,a=e._readableState;if(null===t)a.reading=!1,function(e,t){if(o(\"onEofChunk\"),!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?B(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,R(e)))}}(e,a);else if(i||(s=function(e,t){var r,n;return n=t,u.isBuffer(n)||n instanceof l||\"string\"==typeof t||void 0===t||e.objectMode||(r=new m(\"chunk\",[\"string\",\"Buffer\",\"Uint8Array\"],t)),r}(a,t)),s)E(e,s);else if(a.objectMode||t&&t.length>0)if(\"string\"==typeof t||a.objectMode||Object.getPrototypeOf(t)===u.prototype||(t=function(e){return u.from(e)}(t)),n)a.endEmitted?E(e,new _):A(e,a,t,!0);else if(a.ended)E(e,new v);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!r?(t=a.decoder.write(t),a.objectMode||0!==t.length?A(e,a,t,!1):O(e,a)):A(e,a,t,!1)}else n||(a.reading=!1,O(e,a));return!a.ended&&(a.length<a.highWaterMark||0===a.length)}function A(e,t,r,n){t.flowing&&0===t.length&&!t.sync?(t.awaitDrain=0,e.emit(\"data\",r)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&B(e)),O(e,t)}Object.defineProperty(C.prototype,\"destroyed\",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),C.prototype.destroy=y.destroy,C.prototype._undestroy=y.undestroy,C.prototype._destroy=function(e,t){t(e)},C.prototype.push=function(e,t){var r,n=this._readableState;return n.objectMode?r=!0:\"string\"==typeof e&&((t=t||n.defaultEncoding)!==n.encoding&&(e=u.from(e,t),t=\"\"),r=!0),T(this,e,t,!1,r)},C.prototype.unshift=function(e){return T(this,e,null,!0,!1)},C.prototype.isPaused=function(){return!1===this._readableState.flowing},C.prototype.setEncoding=function(e){h||(h=r(2553).s);var t=new h(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;for(var n=this._readableState.buffer.head,i=\"\";null!==n;)i+=t.write(n.data),n=n.next;return this._readableState.buffer.clear(),\"\"!==i&&this._readableState.buffer.push(i),this._readableState.length=i.length,this};var I=1073741824;function x(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=I?e=I:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function B(e){var t=e._readableState;o(\"emitReadable\",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(o(\"emitReadable\",t.flowing),t.emittedReadable=!0,i.nextTick(R,e))}function R(e){var t=e._readableState;o(\"emitReadable_\",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit(\"readable\"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,U(e)}function O(e,t){t.readingMore||(t.readingMore=!0,i.nextTick(P,e,t))}function P(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){var r=t.length;if(o(\"maybeReadMore read 0\"),e.read(0),r===t.length)break}t.readingMore=!1}function N(e){var t=e._readableState;t.readableListening=e.listenerCount(\"readable\")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount(\"data\")>0&&e.resume()}function M(e){o(\"readable nexttick read 0\"),e.read(0)}function L(e,t){o(\"resume\",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit(\"resume\"),U(e),t.flowing&&!t.reading&&e.read(0)}function U(e){var t=e._readableState;for(o(\"flow\",t.flowing);t.flowing&&null!==e.read(););}function j(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(\"\"):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r);var r}function q(e){var t=e._readableState;o(\"endReadable\",t.endEmitted),t.endEmitted||(t.ended=!0,i.nextTick(z,t,e))}function z(e,t){if(o(\"endReadableNT\",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit(\"end\"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function D(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}C.prototype.read=function(e){o(\"read\",e),e=parseInt(e,10);var t=this._readableState,r=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&((0!==t.highWaterMark?t.length>=t.highWaterMark:t.length>0)||t.ended))return o(\"read: emitReadable\",t.length,t.ended),0===t.length&&t.ended?q(this):B(this),null;if(0===(e=x(e,t))&&t.ended)return 0===t.length&&q(this),null;var n,i=t.needReadable;return o(\"need readable\",i),(0===t.length||t.length-e<t.highWaterMark)&&o(\"length less than watermark\",i=!0),t.ended||t.reading?o(\"reading or ended\",i=!1):i&&(o(\"do read\"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=x(r,t))),null===(n=e>0?j(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&q(this)),null!==n&&this.emit(\"data\",n),n},C.prototype._read=function(e){E(this,new w(\"_read()\"))},C.prototype.pipe=function(e,t){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e)}n.pipesCount+=1,o(\"pipe count=%d opts=%j\",n.pipesCount,t);var a=t&&!1===t.end||e===i.stdout||e===i.stderr?y:u;function u(){o(\"onend\"),e.end()}n.endEmitted?i.nextTick(a):r.once(\"end\",a),e.on(\"unpipe\",(function t(i,s){o(\"onunpipe\"),i===r&&s&&!1===s.hasUnpiped&&(s.hasUnpiped=!0,o(\"cleanup\"),e.removeListener(\"close\",p),e.removeListener(\"finish\",d),e.removeListener(\"drain\",l),e.removeListener(\"error\",f),e.removeListener(\"unpipe\",t),r.removeListener(\"end\",u),r.removeListener(\"end\",y),r.removeListener(\"data\",h),c=!0,!n.awaitDrain||e._writableState&&!e._writableState.needDrain||l())}));var l=function(e){return function(){var t=e._readableState;o(\"pipeOnDrain\",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&s(e,\"data\")&&(t.flowing=!0,U(e))}}(r);e.on(\"drain\",l);var c=!1;function h(t){o(\"ondata\");var i=e.write(t);o(\"dest.write\",i),!1===i&&((1===n.pipesCount&&n.pipes===e||n.pipesCount>1&&-1!==D(n.pipes,e))&&!c&&(o(\"false write response, pause\",n.awaitDrain),n.awaitDrain++),r.pause())}function f(t){o(\"onerror\",t),y(),e.removeListener(\"error\",f),0===s(e,\"error\")&&E(e,t)}function p(){e.removeListener(\"finish\",d),y()}function d(){o(\"onfinish\"),e.removeListener(\"close\",p),y()}function y(){o(\"unpipe\"),r.unpipe(e)}return r.on(\"data\",h),function(e,t,r){if(\"function\"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events.error?Array.isArray(e._events.error)?e._events.error.unshift(r):e._events.error=[r,e._events.error]:e.on(t,r)}(e,\"error\",f),e.once(\"close\",p),e.once(\"finish\",d),e.emit(\"pipe\",r),n.flowing||(o(\"pipe resume\"),r.resume()),e},C.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit(\"unpipe\",this,r)),this;if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o<i;o++)n[o].emit(\"unpipe\",this,{hasUnpiped:!1});return this}var s=D(t.pipes,e);return-1===s||(t.pipes.splice(s,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit(\"unpipe\",this,r)),this},C.prototype.on=function(e,t){var r=a.prototype.on.call(this,e,t),n=this._readableState;return\"data\"===e?(n.readableListening=this.listenerCount(\"readable\")>0,!1!==n.flowing&&this.resume()):\"readable\"===e&&(n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,o(\"on readable\",n.length,n.reading),n.length?B(this):n.reading||i.nextTick(M,this))),r},C.prototype.addListener=C.prototype.on,C.prototype.removeListener=function(e,t){var r=a.prototype.removeListener.call(this,e,t);return\"readable\"===e&&i.nextTick(N,this),r},C.prototype.removeAllListeners=function(e){var t=a.prototype.removeAllListeners.apply(this,arguments);return\"readable\"!==e&&void 0!==e||i.nextTick(N,this),t},C.prototype.resume=function(){var e=this._readableState;return e.flowing||(o(\"resume\"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,i.nextTick(L,e,t))}(this,e)),e.paused=!1,this},C.prototype.pause=function(){return o(\"call pause flowing=%j\",this._readableState.flowing),!1!==this._readableState.flowing&&(o(\"pause\"),this._readableState.flowing=!1,this.emit(\"pause\")),this._readableState.paused=!0,this},C.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var i in e.on(\"end\",(function(){if(o(\"wrapped end\"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on(\"data\",(function(i){o(\"wrapped data\"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i||(r.objectMode||i&&i.length)&&(t.push(i)||(n=!0,e.pause()))})),e)void 0===this[i]&&\"function\"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var s=0;s<k.length;s++)e.on(k[s],this.emit.bind(this,k[s]));return this._read=function(t){o(\"wrapped _read\",t),n&&(n=!1,e.resume())},this},\"function\"==typeof Symbol&&(C.prototype[Symbol.asyncIterator]=function(){return void 0===f&&(f=r(5850)),f(this)}),Object.defineProperty(C.prototype,\"readableHighWaterMark\",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(C.prototype,\"readableBuffer\",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(C.prototype,\"readableFlowing\",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}}),C._fromList=j,Object.defineProperty(C.prototype,\"readableLength\",{enumerable:!1,get:function(){return this._readableState.length}}),\"function\"==typeof Symbol&&(C.from=function(e,t){return void 0===p&&(p=r(5167)),p(C,e,t)})},4605:function(e,t,r){\"use strict\";e.exports=c;var n=r(4281).q,i=n.ERR_METHOD_NOT_IMPLEMENTED,o=n.ERR_MULTIPLE_CALLBACK,s=n.ERR_TRANSFORM_ALREADY_TRANSFORMING,a=n.ERR_TRANSFORM_WITH_LENGTH_0,u=r(6753);function l(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(null===n)return this.emit(\"error\",new o);r.writechunk=null,r.writecb=null,null!=t&&this.push(t),n(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function c(e){if(!(this instanceof c))return new c(e);u.call(this,e),this._transformState={afterTransform:l.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&(\"function\"==typeof e.transform&&(this._transform=e.transform),\"function\"==typeof e.flush&&(this._flush=e.flush)),this.on(\"prefinish\",h)}function h(){var e=this;\"function\"!=typeof this._flush||this._readableState.destroyed?f(this,null,null):this._flush((function(t,r){f(e,t,r)}))}function f(e,t,r){if(t)return e.emit(\"error\",t);if(null!=r&&e.push(r),e._writableState.length)throw new a;if(e._transformState.transforming)throw new s;return e.push(null)}r(5717)(c,u),c.prototype.push=function(e,t){return this._transformState.needTransform=!1,u.prototype.push.call(this,e,t)},c.prototype._transform=function(e,t,r){r(new i(\"_transform()\"))},c.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},c.prototype._read=function(e){var t=this._transformState;null===t.writechunk||t.transforming?t.needTransform=!0:(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform))},c.prototype._destroy=function(e,t){u.prototype._destroy.call(this,e,(function(e){t(e)}))}},4229:function(e,t,r){\"use strict\";var n,i=r(4155);function o(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,r){var n=e.entry;for(e.entry=null;n;){var i=n.callback;t.pendingcb--,i(undefined),n=n.next}t.corkedRequestsFree.next=e}(t,e)}}e.exports=C,C.WritableState=S;var s,a={deprecate:r(4927)},u=r(2503),l=r(8764).Buffer,c=r.g.Uint8Array||function(){},h=r(1195),f=r(2457).getHighWaterMark,p=r(4281).q,d=p.ERR_INVALID_ARG_TYPE,y=p.ERR_METHOD_NOT_IMPLEMENTED,g=p.ERR_MULTIPLE_CALLBACK,b=p.ERR_STREAM_CANNOT_PIPE,m=p.ERR_STREAM_DESTROYED,v=p.ERR_STREAM_NULL_VALUES,w=p.ERR_STREAM_WRITE_AFTER_END,_=p.ERR_UNKNOWN_ENCODING,E=h.errorOrDestroy;function k(){}function S(e,t,s){n=n||r(6753),e=e||{},\"boolean\"!=typeof s&&(s=t instanceof n),this.objectMode=!!e.objectMode,s&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=f(this,e,\"writableHighWaterMark\",s),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var a=!1===e.decodeStrings;this.decodeStrings=!a,this.defaultEncoding=e.defaultEncoding||\"utf8\",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var r=e._writableState,n=r.sync,o=r.writecb;if(\"function\"!=typeof o)throw new g;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(r),t)!function(e,t,r,n,o){--t.pendingcb,r?(i.nextTick(o,n),i.nextTick(R,e,t),e._writableState.errorEmitted=!0,E(e,n)):(o(n),e._writableState.errorEmitted=!0,E(e,n),R(e,t))}(e,r,n,t,o);else{var s=x(r)||e.destroyed;s||r.corked||r.bufferProcessing||!r.bufferedRequest||I(e,r),n?i.nextTick(A,e,r,s,o):A(e,r,s,o)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new o(this)}function C(e){var t=this instanceof(n=n||r(6753));if(!t&&!s.call(C,this))return new C(e);this._writableState=new S(e,this,t),this.writable=!0,e&&(\"function\"==typeof e.write&&(this._write=e.write),\"function\"==typeof e.writev&&(this._writev=e.writev),\"function\"==typeof e.destroy&&(this._destroy=e.destroy),\"function\"==typeof e.final&&(this._final=e.final)),u.call(this)}function T(e,t,r,n,i,o,s){t.writelen=n,t.writecb=s,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new m(\"write\")):r?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function A(e,t,r,n){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit(\"drain\"))}(e,t),t.pendingcb--,n(),R(e,t)}function I(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,i=new Array(n),s=t.corkedRequestsFree;s.entry=r;for(var a=0,u=!0;r;)i[a]=r,r.isBuf||(u=!1),r=r.next,a+=1;i.allBuffers=u,T(e,t,!0,t.length,i,\"\",s.finish),t.pendingcb++,t.lastBufferedRequest=null,s.next?(t.corkedRequestsFree=s.next,s.next=null):t.corkedRequestsFree=new o(t),t.bufferedRequestCount=0}else{for(;r;){var l=r.chunk,c=r.encoding,h=r.callback;if(T(e,t,!1,t.objectMode?1:l.length,l,c,h),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function x(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function B(e,t){e._final((function(r){t.pendingcb--,r&&E(e,r),t.prefinished=!0,e.emit(\"prefinish\"),R(e,t)}))}function R(e,t){var r=x(t);if(r&&(function(e,t){t.prefinished||t.finalCalled||(\"function\"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit(\"prefinish\")):(t.pendingcb++,t.finalCalled=!0,i.nextTick(B,e,t)))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit(\"finish\"),t.autoDestroy))){var n=e._readableState;(!n||n.autoDestroy&&n.endEmitted)&&e.destroy()}return r}r(5717)(C,u),S.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(S.prototype,\"buffer\",{get:a.deprecate((function(){return this.getBuffer()}),\"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.\",\"DEP0003\")})}catch(e){}}(),\"function\"==typeof Symbol&&Symbol.hasInstance&&\"function\"==typeof Function.prototype[Symbol.hasInstance]?(s=Function.prototype[Symbol.hasInstance],Object.defineProperty(C,Symbol.hasInstance,{value:function(e){return!!s.call(this,e)||this===C&&e&&e._writableState instanceof S}})):s=function(e){return e instanceof this},C.prototype.pipe=function(){E(this,new b)},C.prototype.write=function(e,t,r){var n,o=this._writableState,s=!1,a=!o.objectMode&&(n=e,l.isBuffer(n)||n instanceof c);return a&&!l.isBuffer(e)&&(e=function(e){return l.from(e)}(e)),\"function\"==typeof t&&(r=t,t=null),a?t=\"buffer\":t||(t=o.defaultEncoding),\"function\"!=typeof r&&(r=k),o.ending?function(e,t){var r=new w;E(e,r),i.nextTick(t,r)}(this,r):(a||function(e,t,r,n){var o;return null===r?o=new v:\"string\"==typeof r||t.objectMode||(o=new d(\"chunk\",[\"string\",\"Buffer\"],r)),!o||(E(e,o),i.nextTick(n,o),!1)}(this,o,e,r))&&(o.pendingcb++,s=function(e,t,r,n,i,o){if(!r){var s=function(e,t,r){return e.objectMode||!1===e.decodeStrings||\"string\"!=typeof t||(t=l.from(t,r)),t}(t,n,i);n!==s&&(r=!0,i=\"buffer\",n=s)}var a=t.objectMode?1:n.length;t.length+=a;var u=t.length<t.highWaterMark;if(u||(t.needDrain=!0),t.writing||t.corked){var c=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:o,next:null},c?c.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else T(e,t,!1,a,n,i,o);return u}(this,o,a,e,t,r)),s},C.prototype.cork=function(){this._writableState.corked++},C.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||I(this,e))},C.prototype.setDefaultEncoding=function(e){if(\"string\"==typeof e&&(e=e.toLowerCase()),!([\"hex\",\"utf8\",\"utf-8\",\"ascii\",\"binary\",\"base64\",\"ucs2\",\"ucs-2\",\"utf16le\",\"utf-16le\",\"raw\"].indexOf((e+\"\").toLowerCase())>-1))throw new _(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(C.prototype,\"writableBuffer\",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(C.prototype,\"writableHighWaterMark\",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),C.prototype._write=function(e,t,r){r(new y(\"_write()\"))},C.prototype._writev=null,C.prototype.end=function(e,t,r){var n=this._writableState;return\"function\"==typeof e?(r=e,e=null,t=null):\"function\"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||function(e,t,r){t.ending=!0,R(e,t),r&&(t.finished?i.nextTick(r):e.once(\"finish\",r)),t.ended=!0,e.writable=!1}(this,n,r),this},Object.defineProperty(C.prototype,\"writableLength\",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(C.prototype,\"destroyed\",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),C.prototype.destroy=h.destroy,C.prototype._undestroy=h.undestroy,C.prototype._destroy=function(e,t){t(e)}},5850:function(e,t,r){\"use strict\";var n,i=r(4155);function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var s=r(8610),a=Symbol(\"lastResolve\"),u=Symbol(\"lastReject\"),l=Symbol(\"error\"),c=Symbol(\"ended\"),h=Symbol(\"lastPromise\"),f=Symbol(\"handlePromise\"),p=Symbol(\"stream\");function d(e,t){return{value:e,done:t}}function y(e){var t=e[a];if(null!==t){var r=e[p].read();null!==r&&(e[h]=null,e[a]=null,e[u]=null,t(d(r,!1)))}}function g(e){i.nextTick(y,e)}var b=Object.getPrototypeOf((function(){})),m=Object.setPrototypeOf((o(n={get stream(){return this[p]},next:function(){var e=this,t=this[l];if(null!==t)return Promise.reject(t);if(this[c])return Promise.resolve(d(void 0,!0));if(this[p].destroyed)return new Promise((function(t,r){i.nextTick((function(){e[l]?r(e[l]):t(d(void 0,!0))}))}));var r,n=this[h];if(n)r=new Promise(function(e,t){return function(r,n){e.then((function(){t[c]?r(d(void 0,!0)):t[f](r,n)}),n)}}(n,this));else{var o=this[p].read();if(null!==o)return Promise.resolve(d(o,!1));r=new Promise(this[f])}return this[h]=r,r}},Symbol.asyncIterator,(function(){return this})),o(n,\"return\",(function(){var e=this;return new Promise((function(t,r){e[p].destroy(null,(function(e){e?r(e):t(d(void 0,!0))}))}))})),n),b);e.exports=function(e){var t,r=Object.create(m,(o(t={},p,{value:e,writable:!0}),o(t,a,{value:null,writable:!0}),o(t,u,{value:null,writable:!0}),o(t,l,{value:null,writable:!0}),o(t,c,{value:e._readableState.endEmitted,writable:!0}),o(t,f,{value:function(e,t){var n=r[p].read();n?(r[h]=null,r[a]=null,r[u]=null,e(d(n,!1))):(r[a]=e,r[u]=t)},writable:!0}),t));return r[h]=null,s(e,(function(e){if(e&&\"ERR_STREAM_PREMATURE_CLOSE\"!==e.code){var t=r[u];return null!==t&&(r[h]=null,r[a]=null,r[u]=null,t(e)),void(r[l]=e)}var n=r[a];null!==n&&(r[h]=null,r[a]=null,r[u]=null,n(d(void 0,!0))),r[c]=!0})),e.on(\"readable\",g.bind(null,r)),r}},7327:function(e,t,r){\"use strict\";function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,\"value\"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var s=r(8764).Buffer,a=r(2361).inspect,u=a&&a.custom||\"inspect\";e.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError(\"Cannot call a class as a function\")}(this,e),this.head=null,this.tail=null,this.length=0}var t,r;return t=e,r=[{key:\"push\",value:function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:\"unshift\",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:\"shift\",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:\"clear\",value:function(){this.head=this.tail=null,this.length=0}},{key:\"join\",value:function(e){if(0===this.length)return\"\";for(var t=this.head,r=\"\"+t.data;t=t.next;)r+=e+t.data;return r}},{key:\"concat\",value:function(e){if(0===this.length)return s.alloc(0);for(var t,r,n,i=s.allocUnsafe(e>>>0),o=this.head,a=0;o;)t=o.data,r=i,n=a,s.prototype.copy.call(t,r,n),a+=o.data.length,o=o.next;return i}},{key:\"consume\",value:function(e,t){var r;return e<this.head.data.length?(r=this.head.data.slice(0,e),this.head.data=this.head.data.slice(e)):r=e===this.head.data.length?this.shift():t?this._getString(e):this._getBuffer(e),r}},{key:\"first\",value:function(){return this.head.data}},{key:\"_getString\",value:function(e){var t=this.head,r=1,n=t.data;for(e-=n.length;t=t.next;){var i=t.data,o=e>i.length?i.length:e;if(o===i.length?n+=i:n+=i.slice(0,e),0==(e-=o)){o===i.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=i.slice(o));break}++r}return this.length-=r,n}},{key:\"_getBuffer\",value:function(e){var t=s.allocUnsafe(e),r=this.head,n=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var i=r.data,o=e>i.length?i.length:e;if(i.copy(t,t.length-e,0,o),0==(e-=o)){o===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(o));break}++n}return this.length-=n,t}},{key:u,value:function(e,t){return a(this,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?n(Object(r),!0).forEach((function(t){i(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},t,{depth:0,customInspect:!1}))}}],r&&o(t.prototype,r),e}()},1195:function(e,t,r){\"use strict\";var n=r(4155);function i(e,t){s(e,t),o(e)}function o(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit(\"close\")}function s(e,t){e.emit(\"error\",t)}e.exports={destroy:function(e,t){var r=this,a=this._readableState&&this._readableState.destroyed,u=this._writableState&&this._writableState.destroyed;return a||u?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,n.nextTick(s,this,e)):n.nextTick(s,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,(function(e){!t&&e?r._writableState?r._writableState.errorEmitted?n.nextTick(o,r):(r._writableState.errorEmitted=!0,n.nextTick(i,r,e)):n.nextTick(i,r,e):t?(n.nextTick(o,r),t(e)):n.nextTick(o,r)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit(\"error\",t)}}},8610:function(e,t,r){\"use strict\";var n=r(4281).q.ERR_STREAM_PREMATURE_CLOSE;function i(){}e.exports=function e(t,r,o){if(\"function\"==typeof r)return e(t,null,r);r||(r={}),o=function(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];e.apply(this,n)}}}(o||i);var s=r.readable||!1!==r.readable&&t.readable,a=r.writable||!1!==r.writable&&t.writable,u=function(){t.writable||c()},l=t._writableState&&t._writableState.finished,c=function(){a=!1,l=!0,s||o.call(t)},h=t._readableState&&t._readableState.endEmitted,f=function(){s=!1,h=!0,a||o.call(t)},p=function(e){o.call(t,e)},d=function(){var e;return s&&!h?(t._readableState&&t._readableState.ended||(e=new n),o.call(t,e)):a&&!l?(t._writableState&&t._writableState.ended||(e=new n),o.call(t,e)):void 0},y=function(){t.req.on(\"finish\",c)};return function(e){return e.setHeader&&\"function\"==typeof e.abort}(t)?(t.on(\"complete\",c),t.on(\"abort\",d),t.req?y():t.on(\"request\",y)):a&&!t._writableState&&(t.on(\"end\",u),t.on(\"close\",u)),t.on(\"end\",f),t.on(\"finish\",c),!1!==r.error&&t.on(\"error\",p),t.on(\"close\",d),function(){t.removeListener(\"complete\",c),t.removeListener(\"abort\",d),t.removeListener(\"request\",y),t.req&&t.req.removeListener(\"finish\",c),t.removeListener(\"end\",u),t.removeListener(\"close\",u),t.removeListener(\"finish\",c),t.removeListener(\"end\",f),t.removeListener(\"error\",p),t.removeListener(\"close\",d)}}},5167:function(e){e.exports=function(){throw new Error(\"Readable.from is not available in the browser\")}},9946:function(e,t,r){\"use strict\";var n,i=r(4281).q,o=i.ERR_MISSING_ARGS,s=i.ERR_STREAM_DESTROYED;function a(e){if(e)throw e}function u(e,t,i,o){o=function(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}(o);var a=!1;e.on(\"close\",(function(){a=!0})),void 0===n&&(n=r(8610)),n(e,{readable:t,writable:i},(function(e){if(e)return o(e);a=!0,o()}));var u=!1;return function(t){if(!a&&!u)return u=!0,function(e){return e.setHeader&&\"function\"==typeof e.abort}(e)?e.abort():\"function\"==typeof e.destroy?e.destroy():void o(t||new s(\"pipe\"))}}function l(e){e()}function c(e,t){return e.pipe(t)}function h(e){return e.length?\"function\"!=typeof e[e.length-1]?a:e.pop():a}e.exports=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n,i=h(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new o(\"streams\");var s=t.map((function(e,r){var o=r<t.length-1;return u(e,o,r>0,(function(e){n||(n=e),e&&s.forEach(l),o||(s.forEach(l),i(n))}))}));return t.reduce(c)}},2457:function(e,t,r){\"use strict\";var n=r(4281).q.ERR_INVALID_OPT_VALUE;e.exports={getHighWaterMark:function(e,t,r,i){var o=function(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}(t,i,r);if(null!=o){if(!isFinite(o)||Math.floor(o)!==o||o<0)throw new n(i?r:\"highWaterMark\",o);return Math.floor(o)}return e.objectMode?16:16384}}},2503:function(e,t,r){e.exports=r(7187).EventEmitter},8473:function(e,t,r){(t=e.exports=r(9481)).Stream=t,t.Readable=t,t.Writable=r(4229),t.Duplex=r(6753),t.Transform=r(4605),t.PassThrough=r(2725),t.finished=r(8610),t.pipeline=r(9946)},5408:function(e){\"use strict\";function t(e,t,r){var n=this;this._callback=e,this._args=r,this._interval=setInterval(e,t,this._args),this.reschedule=function(e){e||(e=n._interval),n._interval&&clearInterval(n._interval),n._interval=setInterval(n._callback,e,n._args)},this.clear=function(){n._interval&&(clearInterval(n._interval),n._interval=void 0)},this.destroy=function(){n._interval&&clearInterval(n._interval),n._callback=void 0,n._interval=void 0,n._args=void 0}}e.exports=function(){if(\"function\"!=typeof arguments[0])throw new Error(\"callback needed\");if(\"number\"!=typeof arguments[1])throw new Error(\"interval needed\");var e;if(arguments.length>0){e=new Array(arguments.length-2);for(var r=0;r<e.length;r++)e[r]=arguments[r+2]}return new t(arguments[0],arguments[1],e)}},1697:function(e,t,r){\"use strict\";e.exports=r(3188)()},3188:function(e,t,r){\"use strict\";var n=r(8764).Buffer;function i(e){return e instanceof n?n.from(e):new e.constructor(e.buffer.slice(),e.byteOffset,e.length)}e.exports=function(e){return(e=e||{}).circles?function(e){var t=[],r=[];return e.proto?function e(o){if(\"object\"!=typeof o||null===o)return o;if(o instanceof Date)return new Date(o);if(Array.isArray(o))return n(o,e);if(o instanceof Map)return new Map(n(Array.from(o),e));if(o instanceof Set)return new Set(n(Array.from(o),e));var s={};for(var a in t.push(o),r.push(s),o){var u=o[a];if(\"object\"!=typeof u||null===u)s[a]=u;else if(u instanceof Date)s[a]=new Date(u);else if(u instanceof Map)s[a]=new Map(n(Array.from(u),e));else if(u instanceof Set)s[a]=new Set(n(Array.from(u),e));else if(ArrayBuffer.isView(u))s[a]=i(u);else{var l=t.indexOf(u);s[a]=-1!==l?r[l]:e(u)}}return t.pop(),r.pop(),s}:function e(o){if(\"object\"!=typeof o||null===o)return o;if(o instanceof Date)return new Date(o);if(Array.isArray(o))return n(o,e);if(o instanceof Map)return new Map(n(Array.from(o),e));if(o instanceof Set)return new Set(n(Array.from(o),e));var s={};for(var a in t.push(o),r.push(s),o)if(!1!==Object.hasOwnProperty.call(o,a)){var u=o[a];if(\"object\"!=typeof u||null===u)s[a]=u;else if(u instanceof Date)s[a]=new Date(u);else if(u instanceof Map)s[a]=new Map(n(Array.from(u),e));else if(u instanceof Set)s[a]=new Set(n(Array.from(u),e));else if(ArrayBuffer.isView(u))s[a]=i(u);else{var l=t.indexOf(u);s[a]=-1!==l?r[l]:e(u)}}return t.pop(),r.pop(),s};function n(e,n){for(var o=Object.keys(e),s=new Array(o.length),a=0;a<o.length;a++){var u=o[a],l=e[u];if(\"object\"!=typeof l||null===l)s[u]=l;else if(l instanceof Date)s[u]=new Date(l);else if(ArrayBuffer.isView(l))s[u]=i(l);else{var c=t.indexOf(l);s[u]=-1!==c?r[c]:n(l)}}return s}}(e):e.proto?function e(r){if(\"object\"!=typeof r||null===r)return r;if(r instanceof Date)return new Date(r);if(Array.isArray(r))return t(r,e);if(r instanceof Map)return new Map(t(Array.from(r),e));if(r instanceof Set)return new Set(t(Array.from(r),e));var n={};for(var o in r){var s=r[o];\"object\"!=typeof s||null===s?n[o]=s:s instanceof Date?n[o]=new Date(s):s instanceof Map?n[o]=new Map(t(Array.from(s),e)):s instanceof Set?n[o]=new Set(t(Array.from(s),e)):ArrayBuffer.isView(s)?n[o]=i(s):n[o]=e(s)}return n}:function e(r){if(\"object\"!=typeof r||null===r)return r;if(r instanceof Date)return new Date(r);if(Array.isArray(r))return t(r,e);if(r instanceof Map)return new Map(t(Array.from(r),e));if(r instanceof Set)return new Set(t(Array.from(r),e));var n={};for(var o in r)if(!1!==Object.hasOwnProperty.call(r,o)){var s=r[o];\"object\"!=typeof s||null===s?n[o]=s:s instanceof Date?n[o]=new Date(s):s instanceof Map?n[o]=new Map(t(Array.from(s),e)):s instanceof Set?n[o]=new Set(t(Array.from(s),e)):ArrayBuffer.isView(s)?n[o]=i(s):n[o]=e(s)}return n};function t(e,t){for(var r=Object.keys(e),n=new Array(r.length),o=0;o<r.length;o++){var s=r[o],a=e[s];\"object\"!=typeof a||null===a?n[s]=a:a instanceof Date?n[s]=new Date(a):ArrayBuffer.isView(a)?n[s]=i(a):n[s]=t(a)}return n}}},9509:function(e,t,r){var n=r(8764),i=n.Buffer;function o(e,t){for(var r in e)t[r]=e[r]}function s(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(o(n,t),t.Buffer=s),s.prototype=Object.create(i.prototype),o(i,s),s.from=function(e,t,r){if(\"number\"==typeof e)throw new TypeError(\"Argument must not be a number\");return i(e,t,r)},s.alloc=function(e,t,r){if(\"number\"!=typeof e)throw new TypeError(\"Argument must be a number\");var n=i(e);return void 0!==t?\"string\"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},s.allocUnsafe=function(e){if(\"number\"!=typeof e)throw new TypeError(\"Argument must be a number\");return i(e)},s.allocUnsafeSlow=function(e){if(\"number\"!=typeof e)throw new TypeError(\"Argument must be a number\");return n.SlowBuffer(e)}},1852:function(e){e.exports=function(e){var t,r=e._readableState;return r?r.objectMode||\"number\"==typeof e._duplexState?e.read():e.read((t=r).buffer.length?t.buffer.head?t.buffer.head.data.length:t.buffer[0].length:t.length):null}},2553:function(e,t,r){\"use strict\";var n=r(9509).Buffer,i=n.isEncoding||function(e){switch((e=\"\"+e)&&e.toLowerCase()){case\"hex\":case\"utf8\":case\"utf-8\":case\"ascii\":case\"binary\":case\"base64\":case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":case\"raw\":return!0;default:return!1}};function o(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return\"utf8\";for(var t;;)switch(e){case\"utf8\":case\"utf-8\":return\"utf8\";case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return\"utf16le\";case\"latin1\":case\"binary\":return\"latin1\";case\"base64\":case\"ascii\":case\"hex\":return e;default:if(t)return;e=(\"\"+e).toLowerCase(),t=!0}}(e);if(\"string\"!=typeof t&&(n.isEncoding===i||!i(e)))throw new Error(\"Unknown encoding: \"+e);return t||e}(e),this.encoding){case\"utf16le\":this.text=u,this.end=l,t=4;break;case\"utf8\":this.fillLast=a,t=4;break;case\"base64\":this.text=c,this.end=h,t=3;break;default:return this.write=f,void(this.end=p)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function s(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function a(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){if(128!=(192&t[0]))return e.lastNeed=0,\"�\";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,\"�\";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,\"�\"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function u(e,t){if((e.length-t)%2==0){var r=e.toString(\"utf16le\",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString(\"utf16le\",t,e.length-1)}function l(e){var t=e&&e.length?this.write(e):\"\";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString(\"utf16le\",0,r)}return t}function c(e,t){var r=(e.length-t)%3;return 0===r?e.toString(\"base64\",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString(\"base64\",t,e.length-r))}function h(e){var t=e&&e.length?this.write(e):\"\";return this.lastNeed?t+this.lastChar.toString(\"base64\",0,3-this.lastNeed):t}function f(e){return e.toString(this.encoding)}function p(e){return e&&e.length?this.write(e):\"\"}t.s=o,o.prototype.write=function(e){if(0===e.length)return\"\";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return\"\";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||\"\"},o.prototype.end=function(e){var t=e&&e.length?this.write(e):\"\";return this.lastNeed?t+\"�\":t},o.prototype.text=function(e,t){var r=function(e,t,r){var n=t.length-1;if(n<r)return 0;var i=s(t[n]);return i>=0?(i>0&&(e.lastNeed=i-1),i):--n<r||-2===i?0:(i=s(t[n]))>=0?(i>0&&(e.lastNeed=i-2),i):--n<r||-2===i?0:(i=s(t[n]))>=0?(i>0&&(2===i?i=0:e.lastNeed=i-3),i):0}(this,e,t);if(!this.lastNeed)return e.toString(\"utf8\",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString(\"utf8\",t,n)},o.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},2511:function(e,t,r){var n;e=r.nmd(e),function(i){t&&t.nodeType,e&&e.nodeType;var o=\"object\"==typeof r.g&&r.g;o.global!==o&&o.window!==o&&o.self;var s,a=2147483647,u=36,l=/^xn--/,c=/[^\\x20-\\x7E]/,h=/[\\x2E\\u3002\\uFF0E\\uFF61]/g,f={overflow:\"Overflow: input needs wider integers to process\",\"not-basic\":\"Illegal input >= 0x80 (not a basic code point)\",\"invalid-input\":\"Invalid input\"},p=Math.floor,d=String.fromCharCode;function y(e){throw RangeError(f[e])}function g(e,t){for(var r=e.length,n=[];r--;)n[r]=t(e[r]);return n}function b(e,t){var r=e.split(\"@\"),n=\"\";return r.length>1&&(n=r[0]+\"@\",e=r[1]),n+g((e=e.replace(h,\".\")).split(\".\"),t).join(\".\")}function m(e){for(var t,r,n=[],i=0,o=e.length;i<o;)(t=e.charCodeAt(i++))>=55296&&t<=56319&&i<o?56320==(64512&(r=e.charCodeAt(i++)))?n.push(((1023&t)<<10)+(1023&r)+65536):(n.push(t),i--):n.push(t);return n}function v(e){return g(e,(function(e){var t=\"\";return e>65535&&(t+=d((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+d(e)})).join(\"\")}function w(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function _(e,t,r){var n=0;for(e=r?p(e/700):e>>1,e+=p(e/t);e>455;n+=u)e=p(e/35);return p(n+36*e/(e+38))}function E(e){var t,r,n,i,o,s,l,c,h,f,d,g=[],b=e.length,m=0,w=128,E=72;for((r=e.lastIndexOf(\"-\"))<0&&(r=0),n=0;n<r;++n)e.charCodeAt(n)>=128&&y(\"not-basic\"),g.push(e.charCodeAt(n));for(i=r>0?r+1:0;i<b;){for(o=m,s=1,l=u;i>=b&&y(\"invalid-input\"),((c=(d=e.charCodeAt(i++))-48<10?d-22:d-65<26?d-65:d-97<26?d-97:u)>=u||c>p((a-m)/s))&&y(\"overflow\"),m+=c*s,!(c<(h=l<=E?1:l>=E+26?26:l-E));l+=u)s>p(a/(f=u-h))&&y(\"overflow\"),s*=f;E=_(m-o,t=g.length+1,0==o),p(m/t)>a-w&&y(\"overflow\"),w+=p(m/t),m%=t,g.splice(m++,0,w)}return v(g)}function k(e){var t,r,n,i,o,s,l,c,h,f,g,b,v,E,k,S=[];for(b=(e=m(e)).length,t=128,r=0,o=72,s=0;s<b;++s)(g=e[s])<128&&S.push(d(g));for(n=i=S.length,i&&S.push(\"-\");n<b;){for(l=a,s=0;s<b;++s)(g=e[s])>=t&&g<l&&(l=g);for(l-t>p((a-r)/(v=n+1))&&y(\"overflow\"),r+=(l-t)*v,t=l,s=0;s<b;++s)if((g=e[s])<t&&++r>a&&y(\"overflow\"),g==t){for(c=r,h=u;!(c<(f=h<=o?1:h>=o+26?26:h-o));h+=u)k=c-f,E=u-f,S.push(d(w(f+k%E,0))),c=p(k/E);S.push(d(w(c,0))),o=_(r,v,n==i),r=0,++n}++r,++t}return S.join(\"\")}s={version:\"1.3.2\",ucs2:{decode:m,encode:v},decode:E,encode:k,toASCII:function(e){return b(e,(function(e){return c.test(e)?\"xn--\"+k(e):e}))},toUnicode:function(e){return b(e,(function(e){return l.test(e)?E(e.slice(4).toLowerCase()):e}))}},void 0===(n=function(){return s}.call(t,r,t,e))||(e.exports=n)}()},8575:function(e,t,r){\"use strict\";var n=r(2511),i=r(2502);function o(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}t.parse=v,t.resolve=function(e,t){return v(e,!1,!0).resolve(t)},t.resolveObject=function(e,t){return e?v(e,!1,!0).resolveObject(t):t},t.format=function(e){return i.isString(e)&&(e=v(e)),e instanceof o?e.format():o.prototype.format.call(e)},t.Url=o;var s=/^([a-z0-9.+-]+:)/i,a=/:[0-9]*$/,u=/^(\\/\\/?(?!\\/)[^\\?\\s]*)(\\?[^\\s]*)?$/,l=[\"{\",\"}\",\"|\",\"\\\\\",\"^\",\"`\"].concat([\"<\",\">\",'\"',\"`\",\" \",\"\\r\",\"\\n\",\"\\t\"]),c=[\"'\"].concat(l),h=[\"%\",\"/\",\"?\",\";\",\"#\"].concat(c),f=[\"/\",\"?\",\"#\"],p=/^[+a-z0-9A-Z_-]{0,63}$/,d=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,y={javascript:!0,\"javascript:\":!0},g={javascript:!0,\"javascript:\":!0},b={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,\"http:\":!0,\"https:\":!0,\"ftp:\":!0,\"gopher:\":!0,\"file:\":!0},m=r(7673);function v(e,t,r){if(e&&i.isObject(e)&&e instanceof o)return e;var n=new o;return n.parse(e,t,r),n}o.prototype.parse=function(e,t,r){if(!i.isString(e))throw new TypeError(\"Parameter 'url' must be a string, not \"+typeof e);var o=e.indexOf(\"?\"),a=-1!==o&&o<e.indexOf(\"#\")?\"?\":\"#\",l=e.split(a);l[0]=l[0].replace(/\\\\/g,\"/\");var v=e=l.join(a);if(v=v.trim(),!r&&1===e.split(\"#\").length){var w=u.exec(v);if(w)return this.path=v,this.href=v,this.pathname=w[1],w[2]?(this.search=w[2],this.query=t?m.parse(this.search.substr(1)):this.search.substr(1)):t&&(this.search=\"\",this.query={}),this}var _=s.exec(v);if(_){var E=(_=_[0]).toLowerCase();this.protocol=E,v=v.substr(_.length)}if(r||_||v.match(/^\\/\\/[^@\\/]+@[^@\\/]+/)){var k=\"//\"===v.substr(0,2);!k||_&&g[_]||(v=v.substr(2),this.slashes=!0)}if(!g[_]&&(k||_&&!b[_])){for(var S,C,T=-1,A=0;A<f.length;A++)-1!==(I=v.indexOf(f[A]))&&(-1===T||I<T)&&(T=I);for(-1!==(C=-1===T?v.lastIndexOf(\"@\"):v.lastIndexOf(\"@\",T))&&(S=v.slice(0,C),v=v.slice(C+1),this.auth=decodeURIComponent(S)),T=-1,A=0;A<h.length;A++){var I;-1!==(I=v.indexOf(h[A]))&&(-1===T||I<T)&&(T=I)}-1===T&&(T=v.length),this.host=v.slice(0,T),v=v.slice(T),this.parseHost(),this.hostname=this.hostname||\"\";var x=\"[\"===this.hostname[0]&&\"]\"===this.hostname[this.hostname.length-1];if(!x)for(var B=this.hostname.split(/\\./),R=(A=0,B.length);A<R;A++){var O=B[A];if(O&&!O.match(p)){for(var P=\"\",N=0,M=O.length;N<M;N++)O.charCodeAt(N)>127?P+=\"x\":P+=O[N];if(!P.match(p)){var L=B.slice(0,A),U=B.slice(A+1),j=O.match(d);j&&(L.push(j[1]),U.unshift(j[2])),U.length&&(v=\"/\"+U.join(\".\")+v),this.hostname=L.join(\".\");break}}}this.hostname.length>255?this.hostname=\"\":this.hostname=this.hostname.toLowerCase(),x||(this.hostname=n.toASCII(this.hostname));var q=this.port?\":\"+this.port:\"\",z=this.hostname||\"\";this.host=z+q,this.href+=this.host,x&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),\"/\"!==v[0]&&(v=\"/\"+v))}if(!y[E])for(A=0,R=c.length;A<R;A++){var D=c[A];if(-1!==v.indexOf(D)){var F=encodeURIComponent(D);F===D&&(F=escape(D)),v=v.split(D).join(F)}}var V=v.indexOf(\"#\");-1!==V&&(this.hash=v.substr(V),v=v.slice(0,V));var W=v.indexOf(\"?\");if(-1!==W?(this.search=v.substr(W),this.query=v.substr(W+1),t&&(this.query=m.parse(this.query)),v=v.slice(0,W)):t&&(this.search=\"\",this.query={}),v&&(this.pathname=v),b[E]&&this.hostname&&!this.pathname&&(this.pathname=\"/\"),this.pathname||this.search){q=this.pathname||\"\";var H=this.search||\"\";this.path=q+H}return this.href=this.format(),this},o.prototype.format=function(){var e=this.auth||\"\";e&&(e=(e=encodeURIComponent(e)).replace(/%3A/i,\":\"),e+=\"@\");var t=this.protocol||\"\",r=this.pathname||\"\",n=this.hash||\"\",o=!1,s=\"\";this.host?o=e+this.host:this.hostname&&(o=e+(-1===this.hostname.indexOf(\":\")?this.hostname:\"[\"+this.hostname+\"]\"),this.port&&(o+=\":\"+this.port)),this.query&&i.isObject(this.query)&&Object.keys(this.query).length&&(s=m.stringify(this.query));var a=this.search||s&&\"?\"+s||\"\";return t&&\":\"!==t.substr(-1)&&(t+=\":\"),this.slashes||(!t||b[t])&&!1!==o?(o=\"//\"+(o||\"\"),r&&\"/\"!==r.charAt(0)&&(r=\"/\"+r)):o||(o=\"\"),n&&\"#\"!==n.charAt(0)&&(n=\"#\"+n),a&&\"?\"!==a.charAt(0)&&(a=\"?\"+a),t+o+(r=r.replace(/[?#]/g,(function(e){return encodeURIComponent(e)})))+(a=a.replace(\"#\",\"%23\"))+n},o.prototype.resolve=function(e){return this.resolveObject(v(e,!1,!0)).format()},o.prototype.resolveObject=function(e){if(i.isString(e)){var t=new o;t.parse(e,!1,!0),e=t}for(var r=new o,n=Object.keys(this),s=0;s<n.length;s++){var a=n[s];r[a]=this[a]}if(r.hash=e.hash,\"\"===e.href)return r.href=r.format(),r;if(e.slashes&&!e.protocol){for(var u=Object.keys(e),l=0;l<u.length;l++){var c=u[l];\"protocol\"!==c&&(r[c]=e[c])}return b[r.protocol]&&r.hostname&&!r.pathname&&(r.path=r.pathname=\"/\"),r.href=r.format(),r}if(e.protocol&&e.protocol!==r.protocol){if(!b[e.protocol]){for(var h=Object.keys(e),f=0;f<h.length;f++){var p=h[f];r[p]=e[p]}return r.href=r.format(),r}if(r.protocol=e.protocol,e.host||g[e.protocol])r.pathname=e.pathname;else{for(var d=(e.pathname||\"\").split(\"/\");d.length&&!(e.host=d.shift()););e.host||(e.host=\"\"),e.hostname||(e.hostname=\"\"),\"\"!==d[0]&&d.unshift(\"\"),d.length<2&&d.unshift(\"\"),r.pathname=d.join(\"/\")}if(r.search=e.search,r.query=e.query,r.host=e.host||\"\",r.auth=e.auth,r.hostname=e.hostname||e.host,r.port=e.port,r.pathname||r.search){var y=r.pathname||\"\",m=r.search||\"\";r.path=y+m}return r.slashes=r.slashes||e.slashes,r.href=r.format(),r}var v=r.pathname&&\"/\"===r.pathname.charAt(0),w=e.host||e.pathname&&\"/\"===e.pathname.charAt(0),_=w||v||r.host&&e.pathname,E=_,k=r.pathname&&r.pathname.split(\"/\")||[],S=(d=e.pathname&&e.pathname.split(\"/\")||[],r.protocol&&!b[r.protocol]);if(S&&(r.hostname=\"\",r.port=null,r.host&&(\"\"===k[0]?k[0]=r.host:k.unshift(r.host)),r.host=\"\",e.protocol&&(e.hostname=null,e.port=null,e.host&&(\"\"===d[0]?d[0]=e.host:d.unshift(e.host)),e.host=null),_=_&&(\"\"===d[0]||\"\"===k[0])),w)r.host=e.host||\"\"===e.host?e.host:r.host,r.hostname=e.hostname||\"\"===e.hostname?e.hostname:r.hostname,r.search=e.search,r.query=e.query,k=d;else if(d.length)k||(k=[]),k.pop(),k=k.concat(d),r.search=e.search,r.query=e.query;else if(!i.isNullOrUndefined(e.search))return S&&(r.hostname=r.host=k.shift(),(x=!!(r.host&&r.host.indexOf(\"@\")>0)&&r.host.split(\"@\"))&&(r.auth=x.shift(),r.host=r.hostname=x.shift())),r.search=e.search,r.query=e.query,i.isNull(r.pathname)&&i.isNull(r.search)||(r.path=(r.pathname?r.pathname:\"\")+(r.search?r.search:\"\")),r.href=r.format(),r;if(!k.length)return r.pathname=null,r.search?r.path=\"/\"+r.search:r.path=null,r.href=r.format(),r;for(var C=k.slice(-1)[0],T=(r.host||e.host||k.length>1)&&(\".\"===C||\"..\"===C)||\"\"===C,A=0,I=k.length;I>=0;I--)\".\"===(C=k[I])?k.splice(I,1):\"..\"===C?(k.splice(I,1),A++):A&&(k.splice(I,1),A--);if(!_&&!E)for(;A--;A)k.unshift(\"..\");!_||\"\"===k[0]||k[0]&&\"/\"===k[0].charAt(0)||k.unshift(\"\"),T&&\"/\"!==k.join(\"/\").substr(-1)&&k.push(\"\");var x,B=\"\"===k[0]||k[0]&&\"/\"===k[0].charAt(0);return S&&(r.hostname=r.host=B?\"\":k.length?k.shift():\"\",(x=!!(r.host&&r.host.indexOf(\"@\")>0)&&r.host.split(\"@\"))&&(r.auth=x.shift(),r.host=r.hostname=x.shift())),(_=_||r.host&&k.length)&&!B&&k.unshift(\"\"),k.length?r.pathname=k.join(\"/\"):(r.pathname=null,r.path=null),i.isNull(r.pathname)&&i.isNull(r.search)||(r.path=(r.pathname?r.pathname:\"\")+(r.search?r.search:\"\")),r.auth=e.auth||r.auth,r.slashes=r.slashes||e.slashes,r.href=r.format(),r},o.prototype.parseHost=function(){var e=this.host,t=a.exec(e);t&&(\":\"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},2502:function(e){\"use strict\";e.exports={isString:function(e){return\"string\"==typeof e},isObject:function(e){return\"object\"==typeof e&&null!==e},isNull:function(e){return null===e},isNullOrUndefined:function(e){return null==e}}},4927:function(e,t,r){function n(e){try{if(!r.g.localStorage)return!1}catch(e){return!1}var t=r.g.localStorage[e];return null!=t&&\"true\"===String(t).toLowerCase()}e.exports=function(e,t){if(n(\"noDeprecation\"))return e;var r=!1;return function(){if(!r){if(n(\"throwDeprecation\"))throw new Error(t);n(\"traceDeprecation\")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}}},2479:function(e){e.exports=function e(t,r){if(t&&r)return e(t)(r);if(\"function\"!=typeof t)throw new TypeError(\"need wrapper function\");return Object.keys(t).forEach((function(e){n[e]=t[e]})),n;function n(){for(var e=new Array(arguments.length),r=0;r<e.length;r++)e[r]=arguments[r];var n=t.apply(this,e),i=e[e.length-1];return\"function\"==typeof n&&n!==i&&Object.keys(i).forEach((function(e){n[e]=i[e]})),n}}},7026:function(e){\"use strict\";e.exports=function(){throw new Error(\"ws does not work in the browser. Browser clients must use the native WebSocket object\")}},7529:function(e){e.exports=function(){for(var e={},r=0;r<arguments.length;r++){var n=arguments[r];for(var i in n)t.call(n,i)&&(e[i]=n[i])}return e};var t=Object.prototype.hasOwnProperty},9602:function(e){\"use strict\";e.exports=function(e){e.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}},4411:function(e,t,r){\"use strict\";function n(e){var t=this;if(t instanceof n||(t=new n),t.tail=null,t.head=null,t.length=0,e&&\"function\"==typeof e.forEach)e.forEach((function(e){t.push(e)}));else if(arguments.length>0)for(var r=0,i=arguments.length;r<i;r++)t.push(arguments[r]);return t}function i(e,t){e.tail=new s(t,e.tail,null,e),e.head||(e.head=e.tail),e.length++}function o(e,t){e.head=new s(t,null,e.head,e),e.tail||(e.tail=e.head),e.length++}function s(e,t,r,n){if(!(this instanceof s))return new s(e,t,r,n);this.list=n,this.value=e,t?(t.next=this,this.prev=t):this.prev=null,r?(r.prev=this,this.next=r):this.next=null}e.exports=n,n.Node=s,n.create=n,n.prototype.removeNode=function(e){if(e.list!==this)throw new Error(\"removing node which does not belong to this list\");var t=e.next,r=e.prev;return t&&(t.prev=r),r&&(r.next=t),e===this.head&&(this.head=t),e===this.tail&&(this.tail=r),e.list.length--,e.next=null,e.prev=null,e.list=null,t},n.prototype.unshiftNode=function(e){if(e!==this.head){e.list&&e.list.removeNode(e);var t=this.head;e.list=this,e.next=t,t&&(t.prev=e),this.head=e,this.tail||(this.tail=e),this.length++}},n.prototype.pushNode=function(e){if(e!==this.tail){e.list&&e.list.removeNode(e);var t=this.tail;e.list=this,e.prev=t,t&&(t.next=e),this.tail=e,this.head||(this.head=e),this.length++}},n.prototype.push=function(){for(var e=0,t=arguments.length;e<t;e++)i(this,arguments[e]);return this.length},n.prototype.unshift=function(){for(var e=0,t=arguments.length;e<t;e++)o(this,arguments[e]);return this.length},n.prototype.pop=function(){if(this.tail){var e=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,e}},n.prototype.shift=function(){if(this.head){var e=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,e}},n.prototype.forEach=function(e,t){t=t||this;for(var r=this.head,n=0;null!==r;n++)e.call(t,r.value,n,this),r=r.next},n.prototype.forEachReverse=function(e,t){t=t||this;for(var r=this.tail,n=this.length-1;null!==r;n--)e.call(t,r.value,n,this),r=r.prev},n.prototype.get=function(e){for(var t=0,r=this.head;null!==r&&t<e;t++)r=r.next;if(t===e&&null!==r)return r.value},n.prototype.getReverse=function(e){for(var t=0,r=this.tail;null!==r&&t<e;t++)r=r.prev;if(t===e&&null!==r)return r.value},n.prototype.map=function(e,t){t=t||this;for(var r=new n,i=this.head;null!==i;)r.push(e.call(t,i.value,this)),i=i.next;return r},n.prototype.mapReverse=function(e,t){t=t||this;for(var r=new n,i=this.tail;null!==i;)r.push(e.call(t,i.value,this)),i=i.prev;return r},n.prototype.reduce=function(e,t){var r,n=this.head;if(arguments.length>1)r=t;else{if(!this.head)throw new TypeError(\"Reduce of empty list with no initial value\");n=this.head.next,r=this.head.value}for(var i=0;null!==n;i++)r=e(r,n.value,i),n=n.next;return r},n.prototype.reduceReverse=function(e,t){var r,n=this.tail;if(arguments.length>1)r=t;else{if(!this.tail)throw new TypeError(\"Reduce of empty list with no initial value\");n=this.tail.prev,r=this.tail.value}for(var i=this.length-1;null!==n;i--)r=e(r,n.value,i),n=n.prev;return r},n.prototype.toArray=function(){for(var e=new Array(this.length),t=0,r=this.head;null!==r;t++)e[t]=r.value,r=r.next;return e},n.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,r=this.tail;null!==r;t++)e[t]=r.value,r=r.prev;return e},n.prototype.slice=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var r=new n;if(t<e||t<0)return r;e<0&&(e=0),t>this.length&&(t=this.length);for(var i=0,o=this.head;null!==o&&i<e;i++)o=o.next;for(;null!==o&&i<t;i++,o=o.next)r.push(o.value);return r},n.prototype.sliceReverse=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var r=new n;if(t<e||t<0)return r;e<0&&(e=0),t>this.length&&(t=this.length);for(var i=this.length,o=this.tail;null!==o&&i>t;i--)o=o.prev;for(;null!==o&&i>e;i--,o=o.prev)r.push(o.value);return r},n.prototype.splice=function(e,t,...r){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var n=0,i=this.head;null!==i&&n<e;n++)i=i.next;var o,a,u,l,c=[];for(n=0;i&&n<t;n++)c.push(i.value),i=this.removeNode(i);for(null===i&&(i=this.tail),i!==this.head&&i!==this.tail&&(i=i.prev),n=0;n<r.length;n++)o=this,a=i,u=r[n],l=void 0,null===(l=a===o.head?new s(u,null,a,o):new s(u,a,a.next,o)).next&&(o.tail=l),null===l.prev&&(o.head=l),o.length++,i=l;return c},n.prototype.reverse=function(){for(var e=this.head,t=this.tail,r=e;null!==r;r=r.prev){var n=r.prev;r.prev=r.next,r.next=n}return this.head=t,this.tail=e,this};try{r(9602)(n)}catch(e){}},10:function(){},4995:function(){},2361:function(){},4616:function(){},3518:function(e,t,r){\"use strict\";var n=r(4155);const i=r(7187).EventEmitter,o=r(2681),s=r(8254),a=r(226),u=r(1772),l=r(298),c=r(8473).Writable,h=r(5717),f=r(5408),p=r(1697),d=r(3380),y=r(7529),g=r(1227)(\"mqttjs:client\"),b=n?n.nextTick:function(e){setTimeout(e,0)},m=r.g.setImmediate||function(e){b(e)},v={keepalive:60,reschedulePings:!0,protocolId:\"MQTT\",protocolVersion:4,reconnectPeriod:1e3,connectTimeout:3e4,clean:!0,resubscribe:!0},w=[\"ECONNREFUSED\",\"EADDRINUSE\",\"ECONNRESET\",\"ENOTFOUND\"],_={0:\"\",1:\"Unacceptable protocol version\",2:\"Identifier rejected\",3:\"Server unavailable\",4:\"Bad username or password\",5:\"Not authorized\",16:\"No matching subscribers\",17:\"No subscription existed\",128:\"Unspecified error\",129:\"Malformed Packet\",130:\"Protocol Error\",131:\"Implementation specific error\",132:\"Unsupported Protocol Version\",133:\"Client Identifier not valid\",134:\"Bad User Name or Password\",135:\"Not authorized\",136:\"Server unavailable\",137:\"Server busy\",138:\"Banned\",139:\"Server shutting down\",140:\"Bad authentication method\",141:\"Keep Alive timeout\",142:\"Session taken over\",143:\"Topic Filter invalid\",144:\"Topic Name invalid\",145:\"Packet identifier in use\",146:\"Packet Identifier not found\",147:\"Receive Maximum exceeded\",148:\"Topic Alias invalid\",149:\"Packet too large\",150:\"Message rate too high\",151:\"Quota exceeded\",152:\"Administrative action\",153:\"Payload format invalid\",154:\"Retain not supported\",155:\"QoS not supported\",156:\"Use another server\",157:\"Server moved\",158:\"Shared Subscriptions not supported\",159:\"Connection rate exceeded\",160:\"Maximum connect time\",161:\"Subscription Identifiers not supported\",162:\"Wildcard Subscriptions not supported\"};function E(e,t){let r;t.properties&&(r=t.properties.topicAlias);let n=t.topic.toString();if(0===n.length){if(void 0===r)return new Error(\"Unregistered Topic Alias\");if(n=e.topicAliasSend.getTopicByAlias(r),void 0===n)return new Error(\"Unregistered Topic Alias\");t.topic=n}r&&delete t.properties.topicAlias}function k(e,t,r){g(\"sendPacket :: packet: %O\",t),g(\"sendPacket :: emitting `packetsend`\"),e.emit(\"packetsend\",t),g(\"sendPacket :: writing to stream\");const n=u.writeToStream(t,e.stream,e.options);g(\"sendPacket :: writeToStream result %s\",n),!n&&r&&r!==T?(g(\"sendPacket :: handle events on `drain` once through callback.\"),e.stream.once(\"drain\",r)):r&&(g(\"sendPacket :: invoking cb\"),r())}function S(e){e&&(g(\"flush: queue exists? %b\",!!e),Object.keys(e).forEach((function(t){\"function\"==typeof e[t].cb&&(e[t].cb(new Error(\"Connection closed\")),delete e[t])})))}function C(e,t,r,n){g(\"storeAndSend :: store packet with cmd %s to outgoingStore\",t.cmd);let i,o=t;if(\"publish\"===o.cmd&&(o=p(t),i=E(e,o),i))return r&&r(i);e.outgoingStore.put(o,(function(i){if(i)return r&&r(i);n(),k(e,t,r)}))}function T(e){g(\"nop ::\",e)}function A(e,t){let r;const n=this;if(!(this instanceof A))return new A(e,t);for(r in this.options=t||{},v)void 0===this.options[r]?this.options[r]=v[r]:this.options[r]=t[r];g(\"MqttClient :: options.protocol\",t.protocol),g(\"MqttClient :: options.protocolVersion\",t.protocolVersion),g(\"MqttClient :: options.username\",t.username),g(\"MqttClient :: options.keepalive\",t.keepalive),g(\"MqttClient :: options.reconnectPeriod\",t.reconnectPeriod),g(\"MqttClient :: options.rejectUnauthorized\",t.rejectUnauthorized),g(\"MqttClient :: options.topicAliasMaximum\",t.topicAliasMaximum),this.options.clientId=\"string\"==typeof t.clientId?t.clientId:\"mqttjs_\"+Math.random().toString(16).substr(2,8),g(\"MqttClient :: clientId\",this.options.clientId),this.options.customHandleAcks=5===t.protocolVersion&&t.customHandleAcks?t.customHandleAcks:function(){arguments[3](0)},this.streamBuilder=e,this.messageIdProvider=void 0===this.options.messageIdProvider?new l:this.options.messageIdProvider,this.outgoingStore=t.outgoingStore||new o,this.incomingStore=t.incomingStore||new o,this.queueQoSZero=void 0===t.queueQoSZero||t.queueQoSZero,this._resubscribeTopics={},this.messageIdToTopic={},this.pingTimer=null,this.connected=!1,this.disconnecting=!1,this.queue=[],this.connackTimer=null,this.reconnectTimer=null,this._storeProcessing=!1,this._packetIdsDuringStoreProcessing={},this._storeProcessingQueue=[],this.outgoing={},this._firstConnection=!0,t.topicAliasMaximum>0&&(t.topicAliasMaximum>65535?g(\"MqttClient :: options.topicAliasMaximum is out of range\"):this.topicAliasRecv=new s(t.topicAliasMaximum)),this.on(\"connect\",(function(){const e=this.queue;g(\"connect :: sending queued packets\"),function t(){const r=e.shift();g(\"deliver :: entry %o\",r);let i=null;if(!r)return void n._resubscribe();i=r.packet,g(\"deliver :: call _sendPacket for %o\",i);let o=!0;i.messageId&&0!==i.messageId&&(n.messageIdProvider.register(i.messageId)||(o=!1)),o?n._sendPacket(i,(function(e){r.cb&&r.cb(e),t()})):(g(\"messageId: %d has already used. The message is skipped and removed.\",i.messageId),t())}()})),this.on(\"close\",(function(){g(\"close :: connected set to `false`\"),this.connected=!1,g(\"close :: clearing connackTimer\"),clearTimeout(this.connackTimer),g(\"close :: clearing ping timer\"),null!==n.pingTimer&&(n.pingTimer.clear(),n.pingTimer=null),this.topicAliasRecv&&this.topicAliasRecv.clear(),g(\"close :: calling _setupReconnect\"),this._setupReconnect()})),i.call(this),g(\"MqttClient :: setting up stream\"),this._setupStream()}h(A,i),A.prototype._setupStream=function(){const e=this,t=new c,r=u.parser(this.options);let n=null;const i=[];function o(){if(i.length)b(s);else{const e=n;n=null,e()}}function s(){g(\"work :: getting next packet in queue\");const t=i.shift();if(t)g(\"work :: packet pulled from queue\"),e._handlePacket(t,o);else{g(\"work :: no packets in queue\");const e=n;n=null,g(\"work :: done flag is %s\",!!e),e&&e()}}g(\"_setupStream :: calling method to clear reconnect\"),this._clearReconnect(),g(\"_setupStream :: using streamBuilder provided to client to create stream\"),this.stream=this.streamBuilder(this),r.on(\"packet\",(function(e){g(\"parser :: on packet push to packets array.\"),i.push(e)})),t._write=function(e,t,i){n=i,g(\"writable stream :: parsing buffer\"),r.parse(e),s()},g(\"_setupStream :: pipe stream to writable stream\"),this.stream.pipe(t),this.stream.on(\"error\",(function(t){g(\"streamErrorHandler :: error\",t.message),w.includes(t.code)?(g(\"streamErrorHandler :: emitting error\"),e.emit(\"error\",t)):T(t)})),this.stream.on(\"close\",(function(){var t;g(\"(%s)stream :: on close\",e.options.clientId),(t=e.outgoing)&&(g(\"flushVolatile :: deleting volatile messages from the queue and setting their callbacks as error function\"),Object.keys(t).forEach((function(e){t[e].volatile&&\"function\"==typeof t[e].cb&&(t[e].cb(new Error(\"Connection closed\")),delete t[e])}))),g(\"stream: emit close to MqttClient\"),e.emit(\"close\")})),g(\"_setupStream: sending packet `connect`\");const a=Object.create(this.options);if(a.cmd=\"connect\",this.topicAliasRecv&&(a.properties||(a.properties={}),this.topicAliasRecv&&(a.properties.topicAliasMaximum=this.topicAliasRecv.max)),k(this,a),r.on(\"error\",this.emit.bind(this,\"error\")),this.options.properties){if(!this.options.properties.authenticationMethod&&this.options.properties.authenticationData)return e.end((()=>this.emit(\"error\",new Error(\"Packet has no Authentication Method\")))),this;this.options.properties.authenticationMethod&&this.options.authPacket&&\"object\"==typeof this.options.authPacket&&k(this,y({cmd:\"auth\",reasonCode:0},this.options.authPacket))}this.stream.setMaxListeners(1e3),clearTimeout(this.connackTimer),this.connackTimer=setTimeout((function(){g(\"!!connectTimeout hit!! Calling _cleanUp with force `true`\"),e._cleanUp(!0)}),this.options.connectTimeout)},A.prototype._handlePacket=function(e,t){const r=this.options;if(5===r.protocolVersion&&r.properties&&r.properties.maximumPacketSize&&r.properties.maximumPacketSize<e.length)return this.emit(\"error\",new Error(\"exceeding packets size \"+e.cmd)),this.end({reasonCode:149,properties:{reasonString:\"Maximum packet size was exceeded\"}}),this;switch(g(\"_handlePacket :: emitting packetreceive\"),this.emit(\"packetreceive\",e),e.cmd){case\"publish\":this._handlePublish(e,t);break;case\"puback\":case\"pubrec\":case\"pubcomp\":case\"suback\":case\"unsuback\":this._handleAck(e),t();break;case\"pubrel\":this._handlePubrel(e,t);break;case\"connack\":this._handleConnack(e),t();break;case\"auth\":this._handleAuth(e),t();break;case\"pingresp\":this._handlePingresp(e),t();break;case\"disconnect\":this._handleDisconnect(e),t()}},A.prototype._checkDisconnecting=function(e){return this.disconnecting&&(e&&e!==T?e(new Error(\"client disconnecting\")):this.emit(\"error\",new Error(\"client disconnecting\"))),this.disconnecting},A.prototype.publish=function(e,t,r,n){g(\"publish :: message `%s` to topic `%s`\",t,e);const i=this.options;if(\"function\"==typeof r&&(n=r,r=null),r=y({qos:0,retain:!1,dup:!1},r),this._checkDisconnecting(n))return this;const o=this,s=function(){let s=0;if((1===r.qos||2===r.qos)&&(s=o._nextId(),null===s))return g(\"No messageId left\"),!1;const a={cmd:\"publish\",topic:e,payload:t,qos:r.qos,retain:r.retain,messageId:s,dup:r.dup};switch(5===i.protocolVersion&&(a.properties=r.properties),g(\"publish :: qos\",r.qos),r.qos){case 1:case 2:o.outgoing[a.messageId]={volatile:!1,cb:n||T},g(\"MqttClient:publish: packet cmd: %s\",a.cmd),o._sendPacket(a,void 0,r.cbStorePut);break;default:g(\"MqttClient:publish: packet cmd: %s\",a.cmd),o._sendPacket(a,n,r.cbStorePut)}return!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!s())&&this._storeProcessingQueue.push({invoke:s,cbStorePut:r.cbStorePut,callback:n}),this},A.prototype.subscribe=function(){const e=this,t=new Array(arguments.length);for(let e=0;e<arguments.length;e++)t[e]=arguments[e];const r=[];let n=t.shift();const i=n.resubscribe;let o=t.pop()||T,s=t.pop();const a=this.options.protocolVersion;delete n.resubscribe,\"string\"==typeof n&&(n=[n]),\"function\"!=typeof o&&(s=o,o=T);const u=d.validateTopics(n);if(null!==u)return m(o,new Error(\"Invalid topic \"+u)),this;if(this._checkDisconnecting(o))return g(\"subscribe: discconecting true\"),this;const l={qos:0};if(5===a&&(l.nl=!1,l.rap=!1,l.rh=0),s=y(l,s),Array.isArray(n)?n.forEach((function(t){if(g(\"subscribe: array topic %s\",t),!Object.prototype.hasOwnProperty.call(e._resubscribeTopics,t)||e._resubscribeTopics[t].qos<s.qos||i){const e={topic:t,qos:s.qos};5===a&&(e.nl=s.nl,e.rap=s.rap,e.rh=s.rh,e.properties=s.properties),g(\"subscribe: pushing topic `%s` and qos `%s` to subs list\",e.topic,e.qos),r.push(e)}})):Object.keys(n).forEach((function(t){if(g(\"subscribe: object topic %s\",t),!Object.prototype.hasOwnProperty.call(e._resubscribeTopics,t)||e._resubscribeTopics[t].qos<n[t].qos||i){const e={topic:t,qos:n[t].qos};5===a&&(e.nl=n[t].nl,e.rap=n[t].rap,e.rh=n[t].rh,e.properties=s.properties),g(\"subscribe: pushing `%s` to subs list\",e),r.push(e)}})),!r.length)return o(null,[]),this;const c=function(){const t=e._nextId();if(null===t)return g(\"No messageId left\"),!1;const n={cmd:\"subscribe\",subscriptions:r,qos:1,retain:!1,dup:!1,messageId:t};if(s.properties&&(n.properties=s.properties),e.options.resubscribe){g(\"subscribe :: resubscribe true\");const t=[];r.forEach((function(r){if(e.options.reconnectPeriod>0){const n={qos:r.qos};5===a&&(n.nl=r.nl||!1,n.rap=r.rap||!1,n.rh=r.rh||0,n.properties=r.properties),e._resubscribeTopics[r.topic]=n,t.push(r.topic)}})),e.messageIdToTopic[n.messageId]=t}return e.outgoing[n.messageId]={volatile:!0,cb:function(e,t){if(!e){const e=t.granted;for(let t=0;t<e.length;t+=1)r[t].qos=e[t]}o(e,r)}},g(\"subscribe :: call _sendPacket\"),e._sendPacket(n),!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!c())&&this._storeProcessingQueue.push({invoke:c,callback:o}),this},A.prototype.unsubscribe=function(){const e=this,t=new Array(arguments.length);for(let e=0;e<arguments.length;e++)t[e]=arguments[e];let r=t.shift(),n=t.pop()||T,i=t.pop();\"string\"==typeof r&&(r=[r]),\"function\"!=typeof n&&(i=n,n=T);const o=d.validateTopics(r);if(null!==o)return m(n,new Error(\"Invalid topic \"+o)),this;if(e._checkDisconnecting(n))return this;const s=function(){const t=e._nextId();if(null===t)return g(\"No messageId left\"),!1;const o={cmd:\"unsubscribe\",qos:1,messageId:t};return\"string\"==typeof r?o.unsubscriptions=[r]:Array.isArray(r)&&(o.unsubscriptions=r),e.options.resubscribe&&o.unsubscriptions.forEach((function(t){delete e._resubscribeTopics[t]})),\"object\"==typeof i&&i.properties&&(o.properties=i.properties),e.outgoing[o.messageId]={volatile:!0,cb:n},g(\"unsubscribe: call _sendPacket\"),e._sendPacket(o),!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!s())&&this._storeProcessingQueue.push({invoke:s,callback:n}),this},A.prototype.end=function(e,t,r){const n=this;function i(){g(\"end :: closeStores: closing incoming and outgoing stores\"),n.disconnected=!0,n.incomingStore.close((function(e){n.outgoingStore.close((function(t){if(g(\"end :: closeStores: emitting end\"),n.emit(\"end\"),r){const n=e||t;g(\"end :: closeStores: invoking callback with args\"),r(n)}}))})),n._deferredReconnect&&n._deferredReconnect()}function o(){g(\"end :: (%s) :: finish :: calling _cleanUp with force %s\",n.options.clientId,e),n._cleanUp(e,(()=>{g(\"end :: finish :: calling process.nextTick on closeStores\"),b(i.bind(n))}),t)}return g(\"end :: (%s)\",this.options.clientId),null!=e&&\"boolean\"==typeof e||(r=t||T,t=e,e=!1,\"object\"!=typeof t&&(r=t,t=null,\"function\"!=typeof r&&(r=T))),\"object\"!=typeof t&&(r=t,t=null),g(\"end :: cb? %s\",!!r),r=r||T,this.disconnecting?(r(),this):(this._clearReconnect(),this.disconnecting=!0,!e&&Object.keys(this.outgoing).length>0?(g(\"end :: (%s) :: calling finish in 10ms once outgoing is empty\",n.options.clientId),this.once(\"outgoingEmpty\",setTimeout.bind(null,o,10))):(g(\"end :: (%s) :: immediately calling finish\",n.options.clientId),o()),this)},A.prototype.removeOutgoingMessage=function(e){const t=this.outgoing[e]?this.outgoing[e].cb:null;return delete this.outgoing[e],this.outgoingStore.del({messageId:e},(function(){t(new Error(\"Message removed\"))})),this},A.prototype.reconnect=function(e){g(\"client reconnect\");const t=this,r=function(){e?(t.options.incomingStore=e.incomingStore,t.options.outgoingStore=e.outgoingStore):(t.options.incomingStore=null,t.options.outgoingStore=null),t.incomingStore=t.options.incomingStore||new o,t.outgoingStore=t.options.outgoingStore||new o,t.disconnecting=!1,t.disconnected=!1,t._deferredReconnect=null,t._reconnect()};return this.disconnecting&&!this.disconnected?this._deferredReconnect=r:r(),this},A.prototype._reconnect=function(){g(\"_reconnect: emitting reconnect to client\"),this.emit(\"reconnect\"),this.connected?(this.end((()=>{this._setupStream()})),g(\"client already connected. disconnecting first.\")):(g(\"_reconnect: calling _setupStream\"),this._setupStream())},A.prototype._setupReconnect=function(){const e=this;!e.disconnecting&&!e.reconnectTimer&&e.options.reconnectPeriod>0?(this.reconnecting||(g(\"_setupReconnect :: emit `offline` state\"),this.emit(\"offline\"),g(\"_setupReconnect :: set `reconnecting` to `true`\"),this.reconnecting=!0),g(\"_setupReconnect :: setting reconnectTimer for %d ms\",e.options.reconnectPeriod),e.reconnectTimer=setInterval((function(){g(\"reconnectTimer :: reconnect triggered!\"),e._reconnect()}),e.options.reconnectPeriod)):g(\"_setupReconnect :: doing nothing...\")},A.prototype._clearReconnect=function(){g(\"_clearReconnect : clearing reconnect timer\"),this.reconnectTimer&&(clearInterval(this.reconnectTimer),this.reconnectTimer=null)},A.prototype._cleanUp=function(e,t){const r=arguments[2];if(t&&(g(\"_cleanUp :: done callback provided for on stream close\"),this.stream.on(\"close\",t)),g(\"_cleanUp :: forced? %s\",e),e)0===this.options.reconnectPeriod&&this.options.clean&&S(this.outgoing),g(\"_cleanUp :: (%s) :: destroying stream\",this.options.clientId),this.stream.destroy();else{const e=y({cmd:\"disconnect\"},r);g(\"_cleanUp :: (%s) :: call _sendPacket with disconnect packet\",this.options.clientId),this._sendPacket(e,m.bind(null,this.stream.end.bind(this.stream)))}this.disconnecting||(g(\"_cleanUp :: client not disconnecting. Clearing and resetting reconnect.\"),this._clearReconnect(),this._setupReconnect()),null!==this.pingTimer&&(g(\"_cleanUp :: clearing pingTimer\"),this.pingTimer.clear(),this.pingTimer=null),t&&!this.connected&&(g(\"_cleanUp :: (%s) :: removing stream `done` callback `close` listener\",this.options.clientId),this.stream.removeListener(\"close\",t),t())},A.prototype._sendPacket=function(e,t,r){g(\"_sendPacket :: (%s) :: start\",this.options.clientId),r=r||T,t=t||T;const n=function(e,t){if(5===e.options.protocolVersion&&\"publish\"===t.cmd){let r;t.properties&&(r=t.properties.topicAlias);const n=t.topic.toString();if(e.topicAliasSend)if(r){if(0!==n.length&&(g(\"applyTopicAlias :: register topic: %s - alias: %d\",n,r),!e.topicAliasSend.put(n,r)))return g(\"applyTopicAlias :: error out of range. topic: %s - alias: %d\",n,r),new Error(\"Sending Topic Alias out of range\")}else 0!==n.length&&(e.options.autoAssignTopicAlias?(r=e.topicAliasSend.getAliasByTopic(n),r?(t.topic=\"\",t.properties={...t.properties,topicAlias:r},g(\"applyTopicAlias :: auto assign(use) topic: %s - alias: %d\",n,r)):(r=e.topicAliasSend.getLruAlias(),e.topicAliasSend.put(n,r),t.properties={...t.properties,topicAlias:r},g(\"applyTopicAlias :: auto assign topic: %s - alias: %d\",n,r))):e.options.autoUseTopicAlias&&(r=e.topicAliasSend.getAliasByTopic(n),r&&(t.topic=\"\",t.properties={...t.properties,topicAlias:r},g(\"applyTopicAlias :: auto use topic: %s - alias: %d\",n,r))));else if(r)return g(\"applyTopicAlias :: error out of range. topic: %s - alias: %d\",n,r),new Error(\"Sending Topic Alias out of range\")}}(this,e);if(n)t(n);else{if(!this.connected)return\"auth\"===e.cmd?(this._shiftPingInterval(),void k(this,e,t)):(g(\"_sendPacket :: client not connected. Storing packet offline.\"),void this._storePacket(e,t,r));switch(this._shiftPingInterval(),e.cmd){case\"publish\":break;case\"pubrel\":return void C(this,e,t,r);default:return void k(this,e,t)}switch(e.qos){case 2:case 1:C(this,e,t,r);break;default:k(this,e,t)}g(\"_sendPacket :: (%s) :: end\",this.options.clientId)}},A.prototype._storePacket=function(e,t,r){g(\"_storePacket :: packet: %o\",e),g(\"_storePacket :: cb? %s\",!!t),r=r||T;let n=e;if(\"publish\"===n.cmd){n=p(e);const r=E(this,n);if(r)return t&&t(r)}0===(n.qos||0)&&this.queueQoSZero||\"publish\"!==n.cmd?this.queue.push({packet:n,cb:t}):n.qos>0?(t=this.outgoing[n.messageId]?this.outgoing[n.messageId].cb:null,this.outgoingStore.put(n,(function(e){if(e)return t&&t(e);r()}))):t&&t(new Error(\"No connection to broker\"))},A.prototype._setupPingTimer=function(){g(\"_setupPingTimer :: keepalive %d (seconds)\",this.options.keepalive);const e=this;!this.pingTimer&&this.options.keepalive&&(this.pingResp=!0,this.pingTimer=f((function(){e._checkPing()}),1e3*this.options.keepalive))},A.prototype._shiftPingInterval=function(){this.pingTimer&&this.options.keepalive&&this.options.reschedulePings&&this.pingTimer.reschedule(1e3*this.options.keepalive)},A.prototype._checkPing=function(){g(\"_checkPing :: checking ping...\"),this.pingResp?(g(\"_checkPing :: ping response received. Clearing flag and sending `pingreq`\"),this.pingResp=!1,this._sendPacket({cmd:\"pingreq\"})):(g(\"_checkPing :: calling _cleanUp with force true\"),this._cleanUp(!0))},A.prototype._handlePingresp=function(){this.pingResp=!0},A.prototype._handleConnack=function(e){g(\"_handleConnack\");const t=this.options,r=5===t.protocolVersion?e.reasonCode:e.returnCode;if(clearTimeout(this.connackTimer),delete this.topicAliasSend,e.properties){if(e.properties.topicAliasMaximum){if(e.properties.topicAliasMaximum>65535)return void this.emit(\"error\",new Error(\"topicAliasMaximum from broker is out of range\"));e.properties.topicAliasMaximum>0&&(this.topicAliasSend=new a(e.properties.topicAliasMaximum))}e.properties.serverKeepAlive&&t.keepalive&&(t.keepalive=e.properties.serverKeepAlive,this._shiftPingInterval()),e.properties.maximumPacketSize&&(t.properties||(t.properties={}),t.properties.maximumPacketSize=e.properties.maximumPacketSize)}if(0===r)this.reconnecting=!1,this._onConnect(e);else if(r>0){const e=new Error(\"Connection refused: \"+_[r]);e.code=r,this.emit(\"error\",e)}},A.prototype._handleAuth=function(e){const t=this.options.protocolVersion,r=5===t?e.reasonCode:e.returnCode;if(5!==t){const e=new Error(\"Protocol error: Auth packets are only supported in MQTT 5. Your version:\"+t);return e.code=r,void this.emit(\"error\",e)}const n=this;this.handleAuth(e,(function(e,t){if(e)n.emit(\"error\",e);else if(24===r)n.reconnecting=!1,n._sendPacket(t);else{const t=new Error(\"Connection refused: \"+_[r]);e.code=r,n.emit(\"error\",t)}}))},A.prototype.handleAuth=function(e,t){t()},A.prototype._handlePublish=function(e,t){g(\"_handlePublish: packet %o\",e),t=void 0!==t?t:T;let r=e.topic.toString();const n=e.payload,i=e.qos,o=e.messageId,s=this,a=this.options,u=[0,16,128,131,135,144,145,151,153];if(5===this.options.protocolVersion){let t;if(e.properties&&(t=e.properties.topicAlias),void 0!==t)if(0===r.length){if(!(t>0&&t<=65535))return g(\"_handlePublish :: topic alias out of range. alias: %d\",t),void this.emit(\"error\",new Error(\"Received Topic Alias is out of range\"));{const e=this.topicAliasRecv.getTopicByAlias(t);if(!e)return g(\"_handlePublish :: unregistered topic alias. alias: %d\",t),void this.emit(\"error\",new Error(\"Received unregistered Topic Alias\"));r=e,g(\"_handlePublish :: topic complemented by alias. topic: %s - alias: %d\",r,t)}}else{if(!this.topicAliasRecv.put(r,t))return g(\"_handlePublish :: topic alias out of range. alias: %d\",t),void this.emit(\"error\",new Error(\"Received Topic Alias is out of range\"));g(\"_handlePublish :: registered topic: %s - alias: %d\",r,t)}}switch(g(\"_handlePublish: qos %d\",i),i){case 2:a.customHandleAcks(r,n,e,(function(r,n){return r instanceof Error||(n=r,r=null),r?s.emit(\"error\",r):-1===u.indexOf(n)?s.emit(\"error\",new Error(\"Wrong reason code for pubrec\")):void(n?s._sendPacket({cmd:\"pubrec\",messageId:o,reasonCode:n},t):s.incomingStore.put(e,(function(){s._sendPacket({cmd:\"pubrec\",messageId:o},t)})))}));break;case 1:a.customHandleAcks(r,n,e,(function(i,a){return i instanceof Error||(a=i,i=null),i?s.emit(\"error\",i):-1===u.indexOf(a)?s.emit(\"error\",new Error(\"Wrong reason code for puback\")):(a||s.emit(\"message\",r,n,e),void s.handleMessage(e,(function(e){if(e)return t&&t(e);s._sendPacket({cmd:\"puback\",messageId:o,reasonCode:a},t)})))}));break;case 0:this.emit(\"message\",r,n,e),this.handleMessage(e,t);break;default:g(\"_handlePublish: unknown QoS. Doing nothing.\")}},A.prototype.handleMessage=function(e,t){t()},A.prototype._handleAck=function(e){const t=e.messageId,r=e.cmd;let n=null;const i=this.outgoing[t]?this.outgoing[t].cb:null,o=this;let s;if(i){switch(g(\"_handleAck :: packet type\",r),r){case\"pubcomp\":case\"puback\":{const r=e.reasonCode;r&&r>0&&16!==r&&(s=new Error(\"Publish error: \"+_[r]),s.code=r,i(s,e)),delete this.outgoing[t],this.outgoingStore.del(e,i),this.messageIdProvider.deallocate(t),this._invokeStoreProcessingQueue();break}case\"pubrec\":{n={cmd:\"pubrel\",qos:2,messageId:t};const r=e.reasonCode;r&&r>0&&16!==r?(s=new Error(\"Publish error: \"+_[r]),s.code=r,i(s,e)):this._sendPacket(n);break}case\"suback\":delete this.outgoing[t],this.messageIdProvider.deallocate(t);for(let r=0;r<e.granted.length;r++)if(0!=(128&e.granted[r])){const e=this.messageIdToTopic[t];e&&e.forEach((function(e){delete o._resubscribeTopics[e]}))}this._invokeStoreProcessingQueue(),i(null,e);break;case\"unsuback\":delete this.outgoing[t],this.messageIdProvider.deallocate(t),this._invokeStoreProcessingQueue(),i(null);break;default:o.emit(\"error\",new Error(\"unrecognized packet type\"))}this.disconnecting&&0===Object.keys(this.outgoing).length&&this.emit(\"outgoingEmpty\")}else g(\"_handleAck :: Server sent an ack in error. Ignoring.\")},A.prototype._handlePubrel=function(e,t){g(\"handling pubrel packet\"),t=void 0!==t?t:T;const r=e.messageId,n=this,i={cmd:\"pubcomp\",messageId:r};n.incomingStore.get(e,(function(e,r){e?n._sendPacket(i,t):(n.emit(\"message\",r.topic,r.payload,r),n.handleMessage(r,(function(e){if(e)return t(e);n.incomingStore.del(r,T),n._sendPacket(i,t)})))}))},A.prototype._handleDisconnect=function(e){this.emit(\"disconnect\",e)},A.prototype._nextId=function(){return this.messageIdProvider.allocate()},A.prototype.getLastMessageId=function(){return this.messageIdProvider.getLastAllocated()},A.prototype._resubscribe=function(){g(\"_resubscribe\");const e=Object.keys(this._resubscribeTopics);if(!this._firstConnection&&(this.options.clean||5===this.options.protocolVersion&&!this.connackPacket.sessionPresent)&&e.length>0)if(this.options.resubscribe)if(5===this.options.protocolVersion){g(\"_resubscribe: protocolVersion 5\");for(let t=0;t<e.length;t++){const r={};r[e[t]]=this._resubscribeTopics[e[t]],r.resubscribe=!0,this.subscribe(r,{properties:r[e[t]].properties})}}else this._resubscribeTopics.resubscribe=!0,this.subscribe(this._resubscribeTopics);else this._resubscribeTopics={};this._firstConnection=!1},A.prototype._onConnect=function(e){if(this.disconnected)return void this.emit(\"connect\",e);const t=this;this.connackPacket=e,this.messageIdProvider.clear(),this._setupPingTimer(),this.connected=!0,function r(){let n=t.outgoingStore.createStream();function i(){t._storeProcessing=!1,t._packetIdsDuringStoreProcessing={}}function o(){n.destroy(),n=null,t._flushStoreProcessingQueue(),i()}t.once(\"close\",o),n.on(\"error\",(function(e){i(),t._flushStoreProcessingQueue(),t.removeListener(\"close\",o),t.emit(\"error\",e)})),n.on(\"end\",(function(){let n=!0;for(const e in t._packetIdsDuringStoreProcessing)if(!t._packetIdsDuringStoreProcessing[e]){n=!1;break}n?(i(),t.removeListener(\"close\",o),t._invokeAllStoreProcessingQueue(),t.emit(\"connect\",e)):r()})),function e(){if(!n)return;t._storeProcessing=!0;const r=n.read(1);let i;r?t._packetIdsDuringStoreProcessing[r.messageId]?e():t.disconnecting||t.reconnectTimer?n.destroy&&n.destroy():(i=t.outgoing[r.messageId]?t.outgoing[r.messageId].cb:null,t.outgoing[r.messageId]={volatile:!1,cb:function(t,r){i&&i(t,r),e()}},t._packetIdsDuringStoreProcessing[r.messageId]=!0,t.messageIdProvider.register(r.messageId)?t._sendPacket(r):g(\"messageId: %d has already used.\",r.messageId)):n.once(\"readable\",e)}()}()},A.prototype._invokeStoreProcessingQueue=function(){if(this._storeProcessingQueue.length>0){const e=this._storeProcessingQueue[0];if(e&&e.invoke())return this._storeProcessingQueue.shift(),!0}return!1},A.prototype._invokeAllStoreProcessingQueue=function(){for(;this._invokeStoreProcessingQueue(););},A.prototype._flushStoreProcessingQueue=function(){for(const e of this._storeProcessingQueue)e.cbStorePut&&e.cbStorePut(new Error(\"Connection closed\")),e.callback&&e.callback(new Error(\"Connection closed\"));this._storeProcessingQueue.splice(0)},e.exports=A},9908:function(e,t,r){\"use strict\";const{Buffer:n}=r(8764),i=r(8473).Transform,o=r(5981);let s,a,u,l=!1;e.exports=function(e,t){if(t.hostname=t.hostname||t.host,!t.hostname)throw new Error(\"Could not determine host. Specify host manually.\");const r=\"MQIsdp\"===t.protocolId&&3===t.protocolVersion?\"mqttv3.1\":\"mqtt\";!function(e){e.hostname||(e.hostname=\"localhost\"),e.path||(e.path=\"/\"),e.wsOptions||(e.wsOptions={})}(t);const c=function(e,t){const r=\"alis\"===e.protocol?\"wss\":\"ws\";let n=r+\"://\"+e.hostname+e.path;return e.port&&80!==e.port&&443!==e.port&&(n=r+\"://\"+e.hostname+\":\"+e.port+e.path),\"function\"==typeof e.transformWsUrl&&(n=e.transformWsUrl(n,e,t)),n}(t,e);return s=t.my,s.connectSocket({url:c,protocols:r}),a=function(){const e=new i;return e._write=function(e,t,r){s.sendSocketMessage({data:e.buffer,success:function(){r()},fail:function(){r(new Error)}})},e._flush=function(e){s.closeSocket({success:function(){e()}})},e}(),u=o.obj(),l||(l=!0,s.onSocketOpen((function(){u.setReadable(a),u.setWritable(a),u.emit(\"connect\")})),s.onSocketMessage((function(e){if(\"string\"==typeof e.data){const t=n.from(e.data,\"base64\");a.push(t)}else{const t=new FileReader;t.addEventListener(\"load\",(function(){let e=t.result;e=e instanceof ArrayBuffer?n.from(e):n.from(e,\"utf8\"),a.push(e)})),t.readAsArrayBuffer(e.data)}})),s.onSocketClose((function(){u.end(),u.destroy()})),s.onSocketError((function(e){u.destroy(e)}))),u}},2878:function(e,t,r){\"use strict\";var n=r(4155);const i=r(3518),o=r(2681),s=r(8575),a=r(7529),u=r(1227)(\"mqttjs\"),l={};function c(e,t){if(u(\"connecting to an MQTT broker...\"),\"object\"!=typeof e||t||(t=e,e=null),t=t||{},e){const r=s.parse(e,!0);if(null!=r.port&&(r.port=Number(r.port)),null===(t=a(r,t)).protocol)throw new Error(\"Missing protocol\");t.protocol=t.protocol.replace(/:$/,\"\")}if(function(e){let t;e.auth&&(t=e.auth.match(/^(.+):(.+)$/),t?(e.username=t[1],e.password=t[2]):e.username=e.auth)}(t),t.query&&\"string\"==typeof t.query.clientId&&(t.clientId=t.query.clientId),t.cert&&t.key){if(!t.protocol)throw new Error(\"Missing secure protocol key\");if(-1===[\"mqtts\",\"wss\",\"wxs\",\"alis\"].indexOf(t.protocol))switch(t.protocol){case\"mqtt\":t.protocol=\"mqtts\";break;case\"ws\":t.protocol=\"wss\";break;case\"wx\":t.protocol=\"wxs\";break;case\"ali\":t.protocol=\"alis\";break;default:throw new Error('Unknown protocol for secure connection: \"'+t.protocol+'\"!')}}if(!l[t.protocol]){const e=-1!==[\"mqtts\",\"wss\"].indexOf(t.protocol);t.protocol=[\"mqtt\",\"mqtts\",\"ws\",\"wss\",\"wx\",\"wxs\",\"ali\",\"alis\"].filter((function(t,r){return(!e||r%2!=0)&&\"function\"==typeof l[t]}))[0]}if(!1===t.clean&&!t.clientId)throw new Error(\"Missing clientId for unclean clients\");t.protocol&&(t.defaultProtocol=t.protocol);const r=new i((function(e){return t.servers&&(e._reconnectCount&&e._reconnectCount!==t.servers.length||(e._reconnectCount=0),t.host=t.servers[e._reconnectCount].host,t.port=t.servers[e._reconnectCount].port,t.protocol=t.servers[e._reconnectCount].protocol?t.servers[e._reconnectCount].protocol:t.defaultProtocol,t.hostname=t.host,e._reconnectCount++),u(\"calling streambuilder for\",t.protocol),l[t.protocol](e,t)}),t);return r.on(\"error\",(function(){})),r}void 0!==n&&\"browser\"!==n.title||\"function\"!=typeof r?(l.mqtt=r(4983),l.tcp=r(4983),l.ssl=r(4606),l.tls=r(4606),l.mqtts=r(4606)):(l.wx=r(7465),l.wxs=r(7465),l.ali=r(9908),l.alis=r(9908)),l.ws=r(4574),l.wss=r(4574),e.exports=c,e.exports.connect=c,e.exports.MqttClient=i,e.exports.Store=o},4983:function(e,t,r){\"use strict\";const n=r(10),i=r(1227)(\"mqttjs:tcp\");e.exports=function(e,t){t.port=t.port||1883,t.hostname=t.hostname||t.host||\"localhost\";const r=t.port,o=t.hostname;return i(\"port %d and host %s\",r,o),n.createConnection(r,o)}},4606:function(e,t,r){\"use strict\";const n=r(4995),i=r(10),o=r(1227)(\"mqttjs:tls\");e.exports=function(e,t){t.port=t.port||8883,t.host=t.hostname||t.host||\"localhost\",0===i.isIP(t.host)&&(t.servername=t.host),t.rejectUnauthorized=!1!==t.rejectUnauthorized,delete t.path,o(\"port %d host %s rejectUnauthorized %b\",t.port,t.host,t.rejectUnauthorized);const r=n.connect(t);function s(n){t.rejectUnauthorized&&e.emit(\"error\",n),r.end()}return r.on(\"secureConnect\",(function(){t.rejectUnauthorized&&!r.authorized?r.emit(\"error\",new Error(\"TLS not authorized\")):r.removeListener(\"error\",s)})),r.on(\"error\",s),r}},4574:function(e,t,r){\"use strict\";var n=r(4155);const{Buffer:i}=r(8764),o=r(7026),s=r(1227)(\"mqttjs:ws\"),a=r(5981),u=r(8473).Transform,l=[\"rejectUnauthorized\",\"ca\",\"cert\",\"key\",\"pfx\",\"passphrase\"],c=void 0!==n&&\"browser\"===n.title||\"function\"==typeof r;function h(e,t){let r=e.protocol+\"://\"+e.hostname+\":\"+e.port+e.path;return\"function\"==typeof e.transformWsUrl&&(r=e.transformWsUrl(r,e,t)),r}function f(e){const t=e;return e.hostname||(t.hostname=\"localhost\"),e.port||(\"wss\"===e.protocol?t.port=443:t.port=80),e.path||(t.path=\"/\"),e.wsOptions||(t.wsOptions={}),c||\"wss\"!==e.protocol||l.forEach((function(r){Object.prototype.hasOwnProperty.call(e,r)&&!Object.prototype.hasOwnProperty.call(e.wsOptions,r)&&(t.wsOptions[r]=e[r])})),t}e.exports=c?function(e,t){let r;s(\"browserStreamBuilder\");const n=function(e){const t=f(e);if(t.hostname||(t.hostname=t.host),!t.hostname){if(\"undefined\"==typeof document)throw new Error(\"Could not determine host. Specify host manually.\");const e=new URL(document.URL);t.hostname=e.hostname,t.port||(t.port=e.port)}return void 0===t.objectMode&&(t.objectMode=!(!0===t.binary||void 0===t.binary)),t}(t),o=n.browserBufferSize||524288,l=t.browserBufferTimeout||1e3,c=!t.objectMode,p=function(e,t){const r=\"MQIsdp\"===t.protocolId&&3===t.protocolVersion?\"mqttv3.1\":\"mqtt\",n=h(t,e),i=new WebSocket(n,[r]);return i.binaryType=\"arraybuffer\",i}(e,t),d=function(e,t,r){const n=new u({objectModeMode:e.objectMode});return n._write=function e(t,r,n){p.bufferedAmount>o&&setTimeout(e,l,t,r,n),c&&\"string\"==typeof t&&(t=i.from(t,\"utf8\"));try{p.send(t)}catch(e){return n(e)}n()},n._flush=function(e){p.close(),e()},n}(t);t.objectMode||(d._writev=w),d.on(\"close\",(()=>{p.close()}));const y=void 0!==p.addEventListener;function g(){r.setReadable(d),r.setWritable(d),r.emit(\"connect\")}function b(){r.end(),r.destroy()}function m(e){r.destroy(e)}function v(e){let t=e.data;t=t instanceof ArrayBuffer?i.from(t):i.from(t,\"utf8\"),d.push(t)}function w(e,t){const r=new Array(e.length);for(let t=0;t<e.length;t++)\"string\"==typeof e[t].chunk?r[t]=i.from(e[t],\"utf8\"):r[t]=e[t].chunk;this._write(i.concat(r),\"binary\",t)}return p.readyState===p.OPEN?r=d:(r=r=a(void 0,void 0,t),t.objectMode||(r._writev=w),y?p.addEventListener(\"open\",g):p.onopen=g),r.socket=p,y?(p.addEventListener(\"close\",b),p.addEventListener(\"error\",m),p.addEventListener(\"message\",v)):(p.onclose=b,p.onerror=m,p.onmessage=v),r}:function(e,t){s(\"streamBuilder\");const r=f(t),n=h(r,e),i=function(e,t,r){s(\"createWebSocket\"),s(\"protocol: \"+r.protocolId+\" \"+r.protocolVersion);const n=\"MQIsdp\"===r.protocolId&&3===r.protocolVersion?\"mqttv3.1\":\"mqtt\";return s(\"creating new Websocket for url: \"+t+\" and protocol: \"+n),new o(t,[n],r.wsOptions)}(0,n,r),a=o.createWebSocketStream(i,r.wsOptions);return a.url=n,i.on(\"close\",(()=>{a.destroy()})),a}},7465:function(e,t,r){\"use strict\";const{Buffer:n}=r(8764),i=r(8473).Transform,o=r(5981);let s,a,u;e.exports=function(e,t){if(t.hostname=t.hostname||t.host,!t.hostname)throw new Error(\"Could not determine host. Specify host manually.\");const r=\"MQIsdp\"===t.protocolId&&3===t.protocolVersion?\"mqttv3.1\":\"mqtt\";!function(e){e.hostname||(e.hostname=\"localhost\"),e.path||(e.path=\"/\"),e.wsOptions||(e.wsOptions={})}(t);const l=function(e,t){const r=\"wxs\"===e.protocol?\"wss\":\"ws\";let n=r+\"://\"+e.hostname+e.path;return e.port&&80!==e.port&&443!==e.port&&(n=r+\"://\"+e.hostname+\":\"+e.port+e.path),\"function\"==typeof e.transformWsUrl&&(n=e.transformWsUrl(n,e,t)),n}(t,e);s=wx.connectSocket({url:l,protocols:[r]}),a=function(){const e=new i;return e._write=function(e,t,r){s.send({data:e.buffer,success:function(){r()},fail:function(e){r(new Error(e))}})},e._flush=function(e){s.close({success:function(){e()}})},e}(),u=o.obj(),u._destroy=function(e,t){s.close({success:function(){t&&t(e)}})};const c=u.destroy;return u.destroy=function(){u.destroy=c;const e=this;setTimeout((function(){s.close({fail:function(){e._destroy(new Error)}})}),0)}.bind(u),s.onOpen((function(){u.setReadable(a),u.setWritable(a),u.emit(\"connect\")})),s.onMessage((function(e){let t=e.data;t=t instanceof ArrayBuffer?n.from(t):n.from(t,\"utf8\"),a.push(t)})),s.onClose((function(){u.end(),u.destroy()})),s.onError((function(e){u.destroy(new Error(e.errMsg))})),u}},298:function(e){\"use strict\";function t(){if(!(this instanceof t))return new t;this.nextId=Math.max(1,Math.floor(65535*Math.random()))}t.prototype.allocate=function(){const e=this.nextId++;return 65536===this.nextId&&(this.nextId=1),e},t.prototype.getLastAllocated=function(){return 1===this.nextId?65535:this.nextId-1},t.prototype.register=function(e){return!0},t.prototype.deallocate=function(e){},t.prototype.clear=function(){},e.exports=t},2681:function(e,t,r){\"use strict\";const n=r(7529),i=r(8473).Readable,o={objectMode:!0},s={clean:!0};function a(e){if(!(this instanceof a))return new a(e);this.options=e||{},this.options=n(s,e),this._inflights=new Map}a.prototype.put=function(e,t){return this._inflights.set(e.messageId,e),t&&t(),this},a.prototype.createStream=function(){const e=new i(o),t=[];let r=!1,n=0;return this._inflights.forEach((function(e,r){t.push(e)})),e._read=function(){!r&&n<t.length?this.push(t[n++]):this.push(null)},e.destroy=function(){if(r)return;const e=this;r=!0,setTimeout((function(){e.emit(\"close\")}),0)},e},a.prototype.del=function(e,t){return(e=this._inflights.get(e.messageId))?(this._inflights.delete(e.messageId),t(null,e)):t&&t(new Error(\"missing packet\")),this},a.prototype.get=function(e,t){return(e=this._inflights.get(e.messageId))?t(null,e):t&&t(new Error(\"missing packet\")),this},a.prototype.close=function(e){this.options.clean&&(this._inflights=null),e&&e()},e.exports=a},8254:function(e){\"use strict\";function t(e){if(!(this instanceof t))return new t(e);this.aliasToTopic={},this.max=e}t.prototype.put=function(e,t){return!(0===t||t>this.max||(this.aliasToTopic[t]=e,this.length=Object.keys(this.aliasToTopic).length,0))},t.prototype.getTopicByAlias=function(e){return this.aliasToTopic[e]},t.prototype.clear=function(){this.aliasToTopic={}},e.exports=t},226:function(e,t,r){\"use strict\";const n=r(9593),i=r(423).Q;function o(e){if(!(this instanceof o))return new o(e);e>0&&(this.aliasToTopic=new n({max:e}),this.topicToAlias={},this.numberAllocator=new i(1,e),this.max=e,this.length=0)}o.prototype.put=function(e,t){if(0===t||t>this.max)return!1;const r=this.aliasToTopic.get(t);return r&&delete this.topicToAlias[r],this.aliasToTopic.set(t,e),this.topicToAlias[e]=t,this.numberAllocator.use(t),this.length=this.aliasToTopic.length,!0},o.prototype.getTopicByAlias=function(e){return this.aliasToTopic.get(e)},o.prototype.getAliasByTopic=function(e){const t=this.topicToAlias[e];return void 0!==t&&this.aliasToTopic.get(t),t},o.prototype.clear=function(){this.aliasToTopic.reset(),this.topicToAlias={},this.numberAllocator.clear(),this.length=0},o.prototype.getLruAlias=function(){return this.numberAllocator.firstVacant()||this.aliasToTopic.keys()[this.aliasToTopic.length-1]},e.exports=o},3380:function(e){\"use strict\";function t(e){const t=e.split(\"/\");for(let e=0;e<t.length;e++)if(\"+\"!==t[e]){if(\"#\"===t[e])return e===t.length-1;if(-1!==t[e].indexOf(\"+\")||-1!==t[e].indexOf(\"#\"))return!1}return!0}e.exports={validateTopics:function(e){if(0===e.length)return\"empty_topic_list\";for(let r=0;r<e.length;r++)if(!t(e[r]))return e[r];return null}}}},t={};function r(n){var i=t[n];if(void 0!==i)return i.exports;var o=t[n]={id:n,loaded:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.loaded=!0,o.exports}r.d=function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if(\"object\"==typeof globalThis)return globalThis;try{return this||new Function(\"return this\")()}catch(e){if(\"object\"==typeof window)return window}}(),r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.nmd=function(e){return e.paths=[],e.children||(e.children=[]),e};var n=r(2878);module.exports=n}();\n\n//# sourceURL=webpack://hsync/./node_modules/precompiled-mqtt/dist/mqtt.browser.js?");
|
|
294
|
+
|
|
295
|
+
/***/ }),
|
|
296
|
+
|
|
297
|
+
/***/ "./node_modules/net-web/package.json":
|
|
298
|
+
/*!*******************************************!*\
|
|
299
|
+
!*** ./node_modules/net-web/package.json ***!
|
|
300
|
+
\*******************************************/
|
|
301
|
+
/***/ ((module) => {
|
|
302
|
+
|
|
303
|
+
"use strict";
|
|
304
|
+
eval("module.exports = JSON.parse('{\"_from\":\"net-web\",\"_id\":\"net-web@0.2.0\",\"_inBundle\":false,\"_integrity\":\"sha512-eiQ3Yo/8Ikg5fLSAkT+U+nBeKAyCptgxZjsICaaFIpj9jtdLpSrO7tzq8AlcQctkZ+qxyqaB0QC/VGxbwCxwIA==\",\"_location\":\"/net-web\",\"_phantomChildren\":{},\"_requested\":{\"type\":\"tag\",\"registry\":true,\"raw\":\"net-web\",\"name\":\"net-web\",\"escapedName\":\"net-web\",\"rawSpec\":\"\",\"saveSpec\":null,\"fetchSpec\":\"latest\"},\"_requiredBy\":[\"#USER\",\"/\"],\"_resolved\":\"https://registry.npmjs.org/net-web/-/net-web-0.2.0.tgz\",\"_shasum\":\"2a57c14ec88e210f77dee95c625008c8e0e167d3\",\"_spec\":\"net-web\",\"_where\":\"/home/monteslu/code/mine/hsync\",\"author\":{\"name\":\"Luis Montes\"},\"bugs\":{\"url\":\"https://github.com/monteslu/net-web/issues\"},\"bundleDependencies\":false,\"deprecated\":false,\"description\":\"a global(page) node net shim for the web\",\"devDependencies\":{\"webpack\":\"^5.75.0\",\"webpack-cli\":\"^5.0.1\"},\"homepage\":\"https://github.com/monteslu/net-web#readme\",\"license\":\"ISC\",\"main\":\"net-web.js\",\"name\":\"net-web\",\"repository\":{\"type\":\"git\",\"url\":\"git+https://github.com/monteslu/net-web.git\"},\"scripts\":{\"build\":\"webpack && BUILD_MODE=production webpack\",\"test\":\"echo \\\\\"Error: no test specified\\\\\" && exit 1\"},\"version\":\"0.2.0\"}');\n\n//# sourceURL=webpack://hsync/./node_modules/net-web/package.json?");
|
|
305
|
+
|
|
306
|
+
/***/ })
|
|
307
|
+
|
|
308
|
+
/******/ });
|
|
309
|
+
/************************************************************************/
|
|
310
|
+
/******/ // The module cache
|
|
311
|
+
/******/ var __webpack_module_cache__ = {};
|
|
312
|
+
/******/
|
|
313
|
+
/******/ // The require function
|
|
314
|
+
/******/ function __webpack_require__(moduleId) {
|
|
315
|
+
/******/ // Check if module is in cache
|
|
316
|
+
/******/ var cachedModule = __webpack_module_cache__[moduleId];
|
|
317
|
+
/******/ if (cachedModule !== undefined) {
|
|
318
|
+
/******/ return cachedModule.exports;
|
|
319
|
+
/******/ }
|
|
320
|
+
/******/ // Create a new module (and put it into the cache)
|
|
321
|
+
/******/ var module = __webpack_module_cache__[moduleId] = {
|
|
322
|
+
/******/ // no module.id needed
|
|
323
|
+
/******/ // no module.loaded needed
|
|
324
|
+
/******/ exports: {}
|
|
325
|
+
/******/ };
|
|
326
|
+
/******/
|
|
327
|
+
/******/ // Execute the module function
|
|
328
|
+
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
329
|
+
/******/
|
|
330
|
+
/******/ // Return the exports of the module
|
|
331
|
+
/******/ return module.exports;
|
|
332
|
+
/******/ }
|
|
333
|
+
/******/
|
|
334
|
+
/************************************************************************/
|
|
335
|
+
/******/ /* webpack/runtime/define property getters */
|
|
336
|
+
/******/ (() => {
|
|
337
|
+
/******/ // define getter functions for harmony exports
|
|
338
|
+
/******/ __webpack_require__.d = (exports, definition) => {
|
|
339
|
+
/******/ for(var key in definition) {
|
|
340
|
+
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
|
341
|
+
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
|
342
|
+
/******/ }
|
|
343
|
+
/******/ }
|
|
344
|
+
/******/ };
|
|
345
|
+
/******/ })();
|
|
346
|
+
/******/
|
|
347
|
+
/******/ /* webpack/runtime/global */
|
|
348
|
+
/******/ (() => {
|
|
349
|
+
/******/ __webpack_require__.g = (function() {
|
|
350
|
+
/******/ if (typeof globalThis === 'object') return globalThis;
|
|
351
|
+
/******/ try {
|
|
352
|
+
/******/ return this || new Function('return this')();
|
|
353
|
+
/******/ } catch (e) {
|
|
354
|
+
/******/ if (typeof window === 'object') return window;
|
|
355
|
+
/******/ }
|
|
356
|
+
/******/ })();
|
|
357
|
+
/******/ })();
|
|
358
|
+
/******/
|
|
359
|
+
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
|
360
|
+
/******/ (() => {
|
|
361
|
+
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
|
362
|
+
/******/ })();
|
|
363
|
+
/******/
|
|
364
|
+
/******/ /* webpack/runtime/make namespace object */
|
|
365
|
+
/******/ (() => {
|
|
366
|
+
/******/ // define __esModule on exports
|
|
367
|
+
/******/ __webpack_require__.r = (exports) => {
|
|
368
|
+
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
369
|
+
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
370
|
+
/******/ }
|
|
371
|
+
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
|
372
|
+
/******/ };
|
|
373
|
+
/******/ })();
|
|
374
|
+
/******/
|
|
375
|
+
/************************************************************************/
|
|
376
|
+
/******/
|
|
377
|
+
/******/ // startup
|
|
378
|
+
/******/ // Load entry module and return exports
|
|
379
|
+
/******/ // This entry module is referenced by other modules so it can't be inlined
|
|
380
|
+
/******/ var __webpack_exports__ = __webpack_require__("./hsync-web.js");
|
|
381
|
+
/******/
|
|
382
|
+
/******/ })()
|
|
383
|
+
;
|